(()=>{varMfe=Object.create,Vf=Object.defineProperty,Ofe=Object.defineProperties,Kfe=Object.getOwnPropertyDescriptor,Ufe=Object.getOwnPropertyDescriptors,Hfe=Object.getOwnPropertyNames,hE=Object.getOwnPropertySymbols,Gfe=Object.getPrototypeOf,eb=Object.prototype.hasOwnProperty,lO=Object.prototype.propertyIsEnumerable;varcO=(t,e,r)=>eint?Vf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,P=(t,e)=>{for(varrine||(e={}))eb.call(e,r)&&cO(t,r,e[r]);if(hE)for(varrofhE(e))lO.call(e,r)&&cO(t,r,e[r]);returnt},_=(t,e)=>Ofe(t,Ufe(e)),jfe=t=>Vf(t,"__esModule",{value:!0});varqr=(t,e)=>{varr={};for(variint)eb.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&hE)for(variofhE(t))e.indexOf(i)<0&&lO.call(t,i)&&(r[i]=t[i]);returnr},Yfe=(t,e)=>()=>(t&&(e=t(t=0)),e),E=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),it=(t,e)=>{for(varrine)Vf(t,r,{get:e[r],enumerable:!0})},qfe=(t,e,r)=>{if(e&&typeofe=="object"||typeofe=="function")for(letiofHfe(e))!eb.call(t,i)&&i!=="default"&&Vf(t,i,{get:()=>e[i],enumerable:!(r=Kfe(e,i))||r.enumerable});returnt},ie=t=>qfe(jfe(Vf(t!=null?Mfe(Gfe(t)):{},"default",t&&t.__esModule&&"default"int?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);varMO=E((i$e,FO)=>{FO.exports=NO;NO.sync=Ahe;varLO=require("fs");functionlhe(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}functionTO(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:lhe(e,r)}functionNO(t,e,r){LO.stat(t,function(i,n){r(i,i?!1:TO(n,t,e))})}functionAhe(t,e){returnTO(LO.statSync(t),t,e)}});varGO=E((n$e,OO)=>{OO.exports=KO;KO.sync=che;varUO=require("fs");functionKO(t,e,r){UO.stat(t,function(i,n){r(i,i?!1:HO(n,e))})}functionche(t,e){returnHO(UO.statSync(t),e)}functionHO(t,e){returnt.isFile()&&uhe(t,e)}functionuhe(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}});varYO=E((o$e,jO)=>{vars$e=require("fs"),xE;process.platform==="win32"||global.TESTING_WINDOWS?xE=MO():xE=GO();jO.exports=db;db.sync=ghe;functiondb(t,e,r){if(typeofe=="function"&&(r=e,e={}),!r){if(typeofPromise!="function")thrownewTypeError("callback not provided");returnnewPromise(function(i,n){db(t,e||{},function(s,o){s?n(s):i(o)})})}xE(t,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=!1),r(i,n)})}functionghe(t,e){try{returnxE.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throwr}}});varXO=E((a$e,qO)=>{vareu=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",JO=require("path"),fhe=eu?";":":",WO=YO(),zO=t=>Object.assign(newError(`not found: ${t}`),{code:"ENOENT"}),VO=(t,e)=>{letr=e.colon||fhe,i=t.match(/\//)||eu&&t.match(/\\/)?[""]:[...eu?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],n=eu?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=eu?n.split(r):[""];returneu&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},_O=(t,e,r)=>{typeofe=="function"&&(r=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=VO(t,e),o=[],a=c=>newPromise((u,g)=>{if(c===i.length)returne.all&&o.length?u(o):g(zO(t));letf=i[c],h=/^".*"$/.test(f)?f.slice(1,-1):f,p=JO.join(h,t),d=!h&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;u(l(d,c,0))}),l=(c,u,g)=>newPromise((f,h)=>{if(g===n.length)returnf(a(u+1));letp=n[g];WO(c+p,{pathExt:s},(d,m)=>{if(!d&&m)if(e.all)o.push(c+p);elsereturnf(c+p);returnf(l(c,u,g+1))})});returnr?a(0).then(c=>r(null,c),r):a(0)},hhe=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=VO(t,e),s=[];for(leto=0;o<r.length;o++){leta=r[o],l=/^".*"$/.test(a)?a.slice(1,-1):a,c=JO.join(l,t),u=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(letg=0;g<i.length;g++){letf=u+i[g];try{if(WO.s
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a","\x07"]]);function jK(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)):$he.get(t)||t}function epe(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(Xhe))r.push(n[2].replace(Zhe,(a,l,c)=>l?jK(l):c));else throw new Error(`InvalidChalktemplatestyleargument:${s}(instyle'${t}')`)}return r}function tpe(t){GK.lastIndex=0;let e=[],r;for(;(r=GK.exec(t))!==null;){let i=r[1];if(r[2]){let n=epe(i,r[2]);e.push([i].concat(n))}else e.push([i])}return e}function YK(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}HK.exports=(t,e)=>{let r=[],i=[],n=[];if(e.replace(_he,(s,o,a,l,c,u)=>{if(o)n.push(jK(o));else if(l){let g=n.join("");n=[],i.push(r.length===0?g:YK(t,r)(g)),r.push({inverse:a,styles:tpe(l)})}else if(c){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(YK(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("")}});varjb=E((P$e,JK)=>{"use strict";varfh=FK(),{stdout:Kb,stderr:Ub}=OK(),{stringReplaceAll:rpe,stringEncaseCRLFWithFirstIndex:ipe}=UK(),WK=["ansi","ansi","ansi256","ansi16m"],su=Object.create(null),npe=(t,e={})=>{if(e.level>3||e.level<0)thrownewError("The `level` option should be an integer from 0 to 3");letr=Kb?Kb.level:0;t.level=e.level===void0?r:e.level},zK=class{constructor(e){returnVK(e)}},VK=t=>{lete={};returnnpe(e,t),e.template=(...r)=>spe(e.template,...r),Object.setPrototypeOf(e,DE.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{thrownewError("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=zK,e.template};functionDE(t){returnVK(t)}for(let[t,e]ofObject.entries(fh))su[t]={get(){letr=RE(this,Hb(e.open,e.close,this._styler),this._isEmpty);returnObject.defineProperty(this,t,{value:r}),r}};su.visible={get(){lett=RE(this,this._styler,!0);returnObject.defineProperty(this,"visible",{value:t}),t}};var_K=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(lettof_K)su[t]={get(){let{level:e}=this;returnfunction(...r){leti=Hb(fh.color[WK[e]][t](...r),fh.color.close,this._styler);returnRE(this,i,this._isEmpty)}}};for(lettof_K){lete="bg"+t[0].toUpperCase()+t.slice(1);su[e]={get(){let{level:r}=this;returnfunction(...i){letn=Hb(fh.bgColor[WK[r]][t](...i),fh.bgColor.close,this._styler);returnRE(this,n,this._isEmpty)}}}}varope=Object.defineProperties(()=>{},_(P({},su),{level:{enumerable:!0,get(){returnthis._generator.level},set(t){this._generator.level=t}}})),Hb=(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}},RE=(t,e,r)=>{leti=(...n)=>ape(i,n.length===1?""+n[0]:n.join(" "));returni.__proto__=ope,i._generator=t,i._styler=e,i._isEmpty=r,i},ape=(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=rpe(e,r.close,r.open),r=r.parent;lets=e.indexOf(`
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var p=this.popChar();return{type:"Character",value:n(p)}}},t.prototype.characterClass=function(){var p=[],d=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),d=!0);this.isClassAtom();){var m=this.classAtom(),I=m.type==="Character";if(I&&this.isRangeDash()){this.consumeChar("-");var B=this.classAtom(),b=B.type==="Character";if(b){if(B.value<m.value)throw Error("Range out of order in character class");p.push({from:m.value,to:B.value})}else s(m.value,p),p.push(n("-")),s(B.value,p)}else s(m.value,p)}return this.consumeChar("]"),{type:"Set",complement:d,value:p}},t.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.parseHexDigits=function(p){for(var d="",m=0;m<p;m++){var I=this.popChar();if(e.test(I)===!1)throw Error("Expecting a HexDecimal digits");d+=I}var B=parseInt(d,16);return{type:"Character",value:B}},t.prototype.peekChar=function(p){return p===void 0&&(p=0),this.input[this.idx+p]},t.prototype.popChar=function(){var p=this.peekChar(0);return this.consumeChar(),p},t.prototype.consumeChar=function(p){if(p!==void 0&&this.input[this.idx]!==p)throw Error("Expected: '"+p+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++},t.prototype.loc=function(p){return{begin:p,end:this.idx}};var e=/[0-9a-fA-F]/,r=/[0-9]/,i=/[1-9]/;function n(p){return p.charCodeAt(0)}function s(p,d){p.length!==void 0?p.forEach(function(m){d.push(m)}):d.push(p)}function o(p,d){if(p[d]===!0)throw"duplicate flag "+d;p[d]=!0}function a(p){if(p===void 0)throw Error("Internal Error - Should never get here!")}function l(){throw Error("Internal Error - Should never get here!")}var c,u=[];for(c=n("0");c<=n("9");c++)u.push(c);var g=[n("_")].concat(u);for(c=n("a");c<=n("z");c++)g.push(c);for(c=n("A");c<=n("Z");c++)g.push(c);var f=[n(" "),n("\f"),n(`
`),n("\r"),n(" "),n("\v"),n(" "),n("\xA0"),n("\u1680"),n("\u2000"),n("\u2001"),n("\u2002"),n("\u2003"),n("\u2004"),n("\u2005"),n("\u2006"),n("\u2007"),n("\u2008"),n("\u2009"),n("\u200A"),n("\u2028"),n("\u2029"),n("\u202F"),n("\u205F"),n("\u3000"),n("\uFEFF")];function h(){}return h.prototype.visitChildren=function(p){for(var d in p){var m=p[d];p.hasOwnProperty(d)&&(m.type!==void 0?this.visit(m):Array.isArray(m)&&m.forEach(function(I){this.visit(I)},this))}},h.prototype.visit=function(p){switch(p.type){case"Pattern":this.visitPattern(p);break;case"Flags":this.visitFlags(p);break;case"Disjunction":this.visitDisjunction(p);break;case"Alternative":this.visitAlternative(p);break;case"StartAnchor":this.visitStartAnchor(p);break;case"EndAnchor":this.visitEndAnchor(p);break;case"WordBoundary":this.visitWordBoundary(p);break;case"NonWordBoundary":this.visitNonWordBoundary(p);break;case"Lookahead":this.visitLookahead(p);break;case"NegativeLookahead":this.visitNegativeLookahead(p);break;case"Character":this.visitCharacter(p);break;case"Set":this.visitSet(p);break;case"Group":this.visitGroup(p);break;case"GroupBackReference":this.visitGroupBackReference(p);break;case"Quantifier":this.visitQuantifier(p);break}this.visitChildren(p)},h.prototype.visitPattern=function(p){},h.prototype.visitFlags=function(p){},h.prototype.visitDisjunction=function(p){},h.prototype.visitAlternative=function(p){},h.prototype.visitStartAnchor=function(p){},h.prototype.visitEndAnchor=function(p){},h.prototype.visitWordBoundary=function(p){},h.prototype.visitNonWordBoundary=function(p){},h.prototype.visitLookahead=function(p){},h.prototype.visitNegativeLookahead=function(p){},h.prototype.visitCharacter=function(p){},h.prototype.visitSet=function(p){},h.prototype.visitGroup=function(p){},h.prototype.visitGroupBackReference=function(p){},h.prototype.visitQuantifier=function(p){},{RegExpParser:t,BaseRegExpVisitor:h,VERSION:"0.5.0"}})});var gI=E(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.clearRegExpParserCache=Eu.getRegExpAst=void 0;var FEe=cI(),uI={},NEe=new FEe.RegExpParser;function LEe(t){var e=t.toString();if(uI.hasOwnProperty(e))return uI[e];var r=NEe.pattern(e);return uI[e]=r,r}Eu.getRegExpAst=LEe;function TEe(){uI={}}Eu.clearRegExpParserCache=TEe});var VH=E(fn=>{"use strict";var MEe=fn&&fn.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(fn,"__esModule",{value:!0});fn.canMatchCharCode=fn.firstCharOptimizedIndices=fn.getOptimizedStartCodesIndices=fn.failedOptimizationPrefixMsg=void 0;var qH=cI(),$n=Dt(),JH=gI(),sa=Hv(),WH="Complement Sets are not supported for first char optimization";fn.failedOptimizationPrefixMsg=`Unabletouse"first char"lexeroptimizations:
`;function OEe(t,e){e===void 0&&(e=!1);try{var r=(0,JH.getRegExpAst)(t),i=fI(r.value,{},r.flags.ignoreCase);return i}catch(s){if(s.message===WH)e&&(0,$n.PRINT_WARNING)(""+fn.failedOptimizationPrefixMsg+(" Unable to optimize: < "+t.toString()+`>
FordetailsSee:https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var J=(0,Iu.getOptimizedStartCodesIndices)(b.PATTERN,e.ensureOptimizations);(0,Ie.isEmpty)(J)&&(m=!1),(0,Ie.forEach)(J,function(ne){Jv(B,ne,d[R])})}else e.ensureOptimizations&&(0,Ie.PRINT_ERROR)(""+Iu.failedOptimizationPrefixMsg+(" TokenType: <"+b.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
Seehttps://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:zt.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}je.findStartOfInputAnchor=lG;function cG(t){var e=(0,Ie.filter)(t,function(i){var n=i[ao];return n instanceof RegExp&&(n.multiline||n.global)}),r=(0,Ie.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:zt.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[i]}});return r}je.findUnsupportedFlags=cG;function uG(t){var e=[],r=(0,Ie.map)(t,function(s){return(0,Ie.reduce)(t,function(o,a){return s.PATTERN.source===a.PATTERN.source&&!(0,Ie.contains)(e,a)&&a.PATTERN!==zt.Lexer.NA&&(e.push(a),o.push(a)),o},[])});r=(0,Ie.compact)(r);var i=(0,Ie.filter)(r,function(s){return s.length>1}),n=(0,Ie.map)(i,function(s){var o=(0,Ie.map)(s,function(l){return l.name}),a=(0,Ie.first)(s).PATTERN;return{message:"The same RegExp pattern ->"+a+"<-"+("has been used in all of the following Token Types: "+o.join(", ")+" <-"),type:zt.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}});return n}je.findDuplicatePatterns=uG;function nG(t){var e=(0,Ie.filter)(t,function(i){if(!(0,Ie.has)(i,"GROUP"))return!1;var n=i.GROUP;return n!==zt.Lexer.SKIPPED&&n!==zt.Lexer.NA&&!(0,Ie.isString)(n)}),r=(0,Ie.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:zt.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[i]}});return r}je.findInvalidGroupType=nG;function sG(t,e){var r=(0,Ie.filter)(t,function(n){return n.PUSH_MODE!==void 0&&!(0,Ie.contains)(e,n.PUSH_MODE)}),i=(0,Ie.map)(r,function(n){var s="Token Type: ->"+n.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+n.PUSH_MODE+"<-which does not exist";return{message:s,type:zt.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[n]}});return i}je.findModesThatDoNotExist=sG;function oG(t){var e=[],r=(0,Ie.reduce)(t,function(i,n,s){var o=n.PATTERN;return o===zt.Lexer.NA||((0,Ie.isString)(o)?i.push({str:o,idx:s,tokenType:n}):(0,Ie.isRegExp)(o)&&XEe(o)&&i.push({str:o.source,idx:s,tokenType:n})),i},[]);return(0,Ie.forEach)(t,function(i,n){(0,Ie.forEach)(r,function(s){var o=s.str,a=s.idx,l=s.tokenType;if(n<a&&_Ee(o,i.PATTERN)){var c="Token: ->"+l.name+`<- can never be matched.
Seehttps://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:zt.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[i,l]})}})}),e}je.findUnreachablePatterns=oG;function _Ee(t,e){if((0,Ie.isRegExp)(e)){var r=e.exec(t);return r!==null&&r.index===0}else{if((0,Ie.isFunction)(e))return e(t,0,[],{});if((0,Ie.has)(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function XEe(t){var e=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return(0,Ie.find)(e,function(r){return t.source.indexOf(r)!==-1})===void 0}function jv(t){var e=t.ignoreCase?"i":"";return new RegExp("^(?:"+t.source+")",e)}je.addStartOfInput=jv;function Yv(t){var e=t.ignoreCase?"iy":"y";return new RegExp(""+t.source,e)}je.addStickyFlag=Yv;function ZEe(t,e,r){var i=[];return(0,Ie.has)(t,je.DEFAULT_MODE)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+je.DEFAULT_MODE+`> property in its definition
`,type:zt.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,Ie.has)(t,je.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+je.MODES+`>propertyinitsdefinition
`,type:zt.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,Ie.has)(t,je.MODES)&&(0,Ie.has)(t,je.DEFAULT_MODE)&&!(0,Ie.has)(t.modes,t.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a "+je.DEFAULT_MODE+": <"+t.defaultMode+`>whichdoesnotexist
`,type:zt.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,Ie.has)(t,je.MODES)&&(0,Ie.forEach)(t.modes,function(n,s){(0,Ie.forEach)(n,function(o,a){(0,Ie.isUndefined)(o)&&i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+s+"> at index: <"+a+`>
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===zt.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning:ACustomTokenPatternshouldspecifythe<line_breaks>option.
butfound:'`+a+"'";if(n)return o+n+l;var c=(0,Rs.reduce)(e,function(h,p){return h.concat(p)},[]),u=(0,Rs.map)(c,function(h){return"["+(0,Rs.map)(h,function(p){return(0,Bu.tokenLabel)(p)}).join(",")+"]"}),g=(0,Rs.map)(u,function(h,p){return""+(p+1)+"."+h}),f=`one of these possible Token sequences:
butfound:'`+o+"'";if(i)return s+i+a;var l=(0,Rs.map)(e,function(u){return"["+(0,Rs.map)(u,function(g){return(0,Bu.tokenLabel)(g)}).join(",")+"]"}),c=`expecting at least one iteration which starts with one of these possible Token sequences::
`+("<"+l.join(" ,")+">");return s+c+a}};Object.freeze(aa.defaultParserErrorProvider);aa.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(t,e){var r="Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
ForFurtherdetails.`,i},buildEmptyRepetitionError:function(t){var e=(0,_G.getProductionDslName)(t.repetition);t.repetition.idx!==0&&(e+=t.repetition.idx);var r="The repetition <"+e+"> within Rule <"+t.topLevelRule.name+`>canneverconsumeanytokens.
Thiscouldleadtoaninfiniteloop.`;return r},buildTokenNameError:function(t){return"deprecated"},buildEmptyAlternationError:function(t){var e="Ambiguous empty alternative: <"+(t.emptyChoiceIdx+1)+">"+(" in <OR"+t.alternation.idx+"> inside <"+t.topLevelRule.name+`>Rule.
`)+"Only the last alternative may be an empty alternative.";return e},buildTooManyAlternativesError:function(t){var e=`AnAlternationcannothavemorethan256alternatives:
see:https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return n},buildInvalidRuleNameError:function(t){return"deprecated"},buildDuplicateRuleNameError:function(t){var e;t.topLevelRule instanceof iS.Rule?e=t.topLevelRule.name:e=t.topLevelRule;var r="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+t.grammarName+"<-";return r}}});var $G=E(sA=>{"use strict";var NIe=sA&&sA.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(sA,"__esModule",{value:!0});sA.GastRefResolverVisitor=sA.resolveGrammar=void 0;var LIe=Tn(),XG=Dt(),TIe=wu();function MIe(t,e){var r=new ZG(t,e);return r.resolveRefs(),r.errors}sA.resolveGrammar=MIe;var ZG=function(t){NIe(e,t);function e(r,i){var n=t.call(this)||this;return n.nameToTopRule=r,n.errMsgProvider=i,n.errors=[],n}return e.prototype.resolveRefs=function(){var r=this;(0,XG.forEach)((0,XG.values)(this.nameToTopRule),function(i){r.currTopLevel=i,i.accept(r)})},e.prototype.visitNonTerminal=function(r){var i=this.nameToTopRule[r.nonTerminalName];if(i)r.referencedRule=i;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,r);this.errors.push({message:n,type:LIe.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:r.nonTerminalName})}},e}(TIe.GAstVisitor);sA.GastRefResolverVisitor=ZG});var Vh=E(Br=>{"use strict";var Fl=Br&&Br.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(Br,"__esModule",{value:!0});Br.nextPossibleTokensAfter=Br.possiblePathsFrom=Br.NextTerminalAfterAtLeastOneSepWalker=Br.NextTerminalAfterAtLeastOneWalker=Br.NextTerminalAfterManySepWalker=Br.NextTerminalAfterManyWalker=Br.AbstractNextTerminalAfterProductionWalker=Br.NextAfterTokenWalker=Br.AbstractNextPossibleTokensWalker=void 0;var ej=EI(),xt=Dt(),OIe=tS(),It=hn(),tj=function(t){Fl(e,t);function e(r,i){var n=t.call(this)||this;return n.topProd=r,n.path=i,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return e.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,xt.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,xt.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(r,i){i===void 0&&(i=[]),this.found||t.prototype.walk.call(this,r,i)},e.prototype.walkProdRef=function(r,i,n){if(r.referencedRule.name===this.nextProductionName&&r.idx===this.nextProductionOccurrence){var s=i.concat(n);this.updateExpectedNext(),this.walk(r.referencedRule,s)}},e.prototype.updateExpectedNext=function(){(0,xt.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(ej.RestWalker);Br.AbstractNextPossibleTokensWalker=tj;var KIe=function(t){Fl(e,t);function e(r,i){var n=t.call(this,r,i)||this;return n.path=i,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminal
ForFurtherdetails.`)}if((0,Er.isArray)(e))this.tokensMap=(0,Er.reduce)(e,function(o,a){return o[a.name]=a,o},{});else if((0,Er.has)(e,"modes")&&(0,Er.every)((0,Er.flatten)((0,Er.values)(e.modes)),ep.isTokenType)){var i=(0,Er.flatten)((0,Er.values)(e.modes)),n=(0,Er.uniq)(i);this.tokensMap=(0,Er.reduce)(n,function(o,a){return o[a.name]=a,o},{})}else if((0,Er.isObject)(e))this.tokensMap=(0,Er.cloneObj)(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Jj.EOF;var s=(0,Er.every)((0,Er.values)(e),function(o){return(0,Er.isEmpty)(o.categoryMatches)});this.tokenMatcher=s?ep.tokenStructuredMatcherNoCategories:ep.tokenStructuredMatcher,(0,ep.augmentTokenTypes)((0,Er.values)(this.tokensMap))},t.prototype.defineRule=function(e,r,i){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+`>maynotbedefinedafterthe'performSelfAnalysis'methodhasbeencalled'
See:https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(nY);var Xye={name:`This CSTNode indicates the Parser is in Recording Phase
`+("Idx value must be a none negative value smaller than "+(rY+1)));throw e.KNOWN_RECORDER_ERROR=!0,e}}});var AY=E(UI=>{"use strict";Object.defineProperty(UI,"__esModule",{value:!0});UI.PerformanceTracer=void 0;var aY=Dt(),ewe=Tn(),twe=function(){function t(){}return t.prototype.initPerformanceTracer=function(e){if((0,aY.has)(e,"traceInitPerf")){var r=e.traceInitPerf,i=typeof r=="number";this.traceInitMaxIdent=i?r:Infinity,this.traceInitPerf=i?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=ewe.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},t.prototype.TRACE_INIT=function(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;var i=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(i+"--> <"+e+">");var n=(0,aY.timer)(r),s=n.time,o=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(i+"<-- <"+e+"> time: "+s+"ms"),this.traceInitIndent--,o}else return r()},t}();UI.PerformanceTracer=twe});var lY=E(HI=>{"use strict";Object.defineProperty(HI,"__esModule",{value:!0});HI.applyMixins=void 0;function rwe(t,e){e.forEach(function(r){var i=r.prototype;Object.getOwnPropertyNames(i).forEach(function(n){if(n!=="constructor"){var s=Object.getOwnPropertyDescriptor(i,n);s&&(s.get||s.set)?Object.defineProperty(t.prototype,n,s):t.prototype[n]=r.prototype[n]}})})}HI.applyMixins=rwe});var Tn=E(or=>{"use strict";var cY=or&&or.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(or,"__esModule",{value:!0});or.EmbeddedActionsParser=or.CstParser=or.Parser=or.EMPTY_ALT=or.ParserDefinitionErrorType=or.DEFAULT_RULE_CONFIG=or.DEFAULT_PARSER_CONFIG=or.END_OF_FILE=void 0;var Wi=Dt(),iwe=VG(),uY=nA(),gY=Wh(),fY=yj(),nwe=pS(),swe=kj(),owe=Kj(),awe=Hj(),Awe=jj(),lwe=Wj(),cwe=Vj(),uwe=Zj(),gwe=oY(),fwe=AY(),hwe=lY();or.END_OF_FILE=(0,uY.createTokenInstance)(uY.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(or.END_OF_FILE);or.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:gY.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1});or.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});var pwe;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(pwe=or.ParserDefinitionErrorType||(or.ParserDefinitionErrorType={}));function dwe(t){return t===void 0&&(t=void 0),function(){return t}}or.EMPTY_ALT=dwe;var GI=function(){function t(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;var i=this;if(i.initErrorHandler(r),i.initLexerAdapter(),i.initLooksAhead(r),i.initRecognizerEngine(e,r),i.initRecoverable(r),i.initTreeBuilder(r),i.initContentAssist(),i.initGastRecorder(r),i.initPerformanceTracer(r),(0,Wi.has)(r,"ignoredIssues"))throw new Error(`The<ignoredIssues>IParserConfigpropertyhasbeendeprecated.
Forfurtherdetails.`);this.skipValidations=(0,Wi.has)(r,"skipValidations")?r.skipValidations:or.DEFAULT_PARSER_CONFIG.skipValidations}return t.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},t.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT("performSelfAnalysis",function(){var r;e.selfAnalysisDone=!0;var i=e.className;e.TRACE_INIT("toFastProps",function(){(0,Wi.toFastProperties)(e)}),e.TRACE_INIT("Grammar Recording",function(){try{e.enableRecording(),(0,Wi.forEach)(e.definedRulesNames,function(s){var o=e[s],a=o.originalGrammarAction,l=void 0;e.TRACE_INIT(s+" Rule",function(){l=e.topLevelRuleRecord(s,a)}),e.gastProductionsCache[s]=l})}finally{e.disableRecording()}});var n=[];if(e.TRACE_INIT("Grammar Resolving",function(){n=(0,fY.resolveGrammar)({rules:(0,Wi.values)(e.gastProductionsCache)}),e.definitionErrors=e.definitionErrors.concat(n)}),e.TRACE_INIT("Grammar Validations",function(){if((0,Wi.isEmpty)(n)&&e.skipValidations===!1){var s=(0,fY.validateGrammar)({rules:(0,Wi.values)(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:(0,Wi.values)(e.tokensMap),errMsgProvider:gY.defaultGrammarValidatorErrorProvider,grammarName:i});e.definitionErrors=e.definitionErrors.concat(s)}}),(0,Wi.isEmpty)(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT("computeAllProdsFollows",function(){var s=(0,iwe.computeAllProdsFollows)((0,Wi.values)(e.gastProductionsCache));e.resyncFollows=s}),e.TRACE_INIT("ComputeLookaheadFunctions",function(){e.preComputeLookaheadFunctions((0,Wi.values)(e.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,Wi.isEmpty)(e.definitionErrors))throw r=(0,Wi.map)(e.definitionErrors,function(s){return s.message}),new Error(`ParserDefinitionErrorsdetected:
Pleasereportthistohttps://github.com/szmarczak/http2-wrapper/`);p(d)}return}i[0].resolve(h);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 f=dve.connect(e,P({createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(u)},r));f[_i]=0,f[Yu]=!1;let h=()=>f[_i]<f.remoteSettings.maxConcurrentStreams,p=!0;f.socket.once("session",m=>{this.tlsSessionCache.set(u,m)}),f.once("error",m=>{for(let{reject:I}of i)I(m);this.tlsSessionCache.delete(u)}),f.setTimeout(this.timeout,()=>{f.destroy()}),f.once("close",()=>{if(g){p&&this._freeSessionsCount--,this._sessionsCount--;let m=this.sessions[o];m.splice(m.indexOf(f),1),m.length===0&&delete this.sessions[o]}else{let m=new Error("Session closed without receiving a SETTINGS frame");m.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:I}of i)I(m);l()}this._tryToCreateNewSession(o,a)});let d=()=>{if(!(!(o in this.queue)||!h())){for(let m of f[ns])if(m in this.queue[o]){let{listeners:I}=this.queue[o][m];for(;I.length!==0&&h();)I.shift().resolve(f);let B=this.queue[o];if(B[m].listeners.length===0&&(delete B[m],Object.keys(B).length===0)){delete this.queue[o];break}if(!h())break}}};f.on("origin",()=>{f[ns]=f.originSet,!!h()&&(d(),ck(this.sessions[o],f))}),f.once("remoteSettings",()=>{if(f.ref(),f.unref(),this._sessionsCount++,c.destroyed){let m=new Error("Agent has been destroyed");for(let I of i)I.reject(m);f.destroy();return}f[ns]=f.originSet;{let m=this.sessions;if(o in m){let I=m[o];I.splice(Eve(I,f,Ive),0,f)}else m[o]=[f]}this._freeSessionsCount+=1,g=!0,this.emit("session",f),d(),l(),f[_i]===0&&this._freeSessionsCount>this.maxFreeSessions&&f.close(),i.length!==0&&(this.getSession(a,r,i),i.length=0),f.on("remoteSettings",()=>{d(),ck(this.sessions[o],f)})}),f[lW]=f.request,f.request=(m,I)=>{if(f[Yu])throw new Error("The session is gracefully closing. No new streams are allowed.");let B=f[lW](m,I);return f.ref(),++f[_i],f[_i]===f.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,B.once("close",()=>{if(p=h(),--f[_i],!f.destroyed&&!f.closed&&(yve(this.sessions[o],f),h()&&!f.closed)){p||(this._freeSessionsCount++,p=!0);let b=f[_i]===0;b&&f.unref(),b&&(this._freeSessionsCount>this.maxFreeSessions||f[Yu])?f.close():(ck(this.sessions[o],f),d())}}),B}}catch(f){for(let h of i)h.reject(f);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 ma.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),pve.connect(i,n,r)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let r of e)r[_i]===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 uW({agent:this,isFree:!0})}get busySessions(){return uW({agent:this,isFree:!1})}};ma.kCurrentStreamsCount=_i;ma.kGracefullyClosing=Yu;AW.exports={Agent:ma,globalAgent:new ma}});var gk=E((Nnt,gW)=>{"use strict";var{Readable:wve}=require("stream"),fW=class extends wve{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
`+T4.repeat(" ",e+this.position-n+i.length)+"^"};kP.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};L4.exports=kP});var Xr=E((_ot,O4)=>{"use strict";var K4=ng(),vke=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],Ske=["scalar","sequence","mapping"];function xke(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(i){e[String(i)]=r})}),e}function kke(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(vke.indexOf(r)===-1)throw new K4('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=xke(e.styleAliases||null),Ske.indexOf(this.kind)===-1)throw new K4('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}O4.exports=kke});var ec=E((Xot,U4)=>{"use strict";var H4=$l(),hw=ng(),Pke=Xr();function PP(t,e,r){var i=[];return t.include.forEach(function(n){r=PP(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 Dke(){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 sg(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 hw("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=PP(this,"implicit",[]),this.compiledExplicit=PP(this,"explicit",[]),this.compiledTypeMap=Dke(this.compiledImplicit,this.compiledExplicit)}sg.DEFAULT=null;sg.create=function(){var e,r;switch(arguments.length){case 1:e=sg.DEFAULT,r=arguments[0];break;case 2:e=arguments[0],r=arguments[1];break;default:throw new hw("Wrong number of arguments for Schema.create function")}if(e=H4.toArray(e),r=H4.toArray(r),!e.every(function(i){return i instanceof sg}))throw new hw("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(i){return i instanceof Pke}))throw new hw("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new sg({include:e,explicit:r})};U4.exports=sg});var j4=E((Zot,G4)=>{"use strict";var Rke=Xr();G4.exports=new Rke("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var q4=E(($ot,Y4)=>{"use strict";var Fke=Xr();Y4.exports=new Fke("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var W4=E((eat,J4)=>{"use strict";var Nke=Xr();J4.exports=new Nke("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var pw=E((tat,z4)=>{"use strict";var Lke=ec();z4.exports=new Lke({explicit:[j4(),q4(),W4()]})});var _4=E((rat,V4)=>{"use strict";var Tke=Xr();function Mke(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function Oke(){return null}function Kke(t){return t===null}V4.exports=new Tke("tag:yaml.org,2002:null",{kind:"scalar",resolve:Mke,construct:Oke,predicate:Kke,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var Z4=E((iat,X4)=>{"use strict";var Uke=Xr();function Hke(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 Gke(t){return t==="true"||t==="True"||t==="TRUE"}function jke(t){return Object.prototype.toString.call(t)==="[object Boolean]"}X4.exports=new Uke("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Hke,construct:Gke,predicate:jke,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 rDe(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}var Uz=new Array(256),Hz=new Array(256);for(var Ag=0;Ag<256;Ag++)Uz[Ag]=Kz(Ag)?1:0,Hz[Ag]=Kz(Ag);function iDe(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||zPe,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 Gz(t,e){return new Dz(e,new WPe(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function st(t,e){throw Gz(t,e)}function Ew(t,e){t.onWarning&&t.onWarning.call(null,Gz(t,e))}var jz={YAML:function(e,r,i){var n,s,o;e.version!==null&&st(e,"duplication of %YAML directive"),i.length!==1&&st(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null&&st(e,"ill-formed argument of the YAML directive"),s=parseInt(n[1],10),o=parseInt(n[2],10),s!==1&&st(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&Ew(e,"unsupported YAML version of the document")},TAG:function(e,r,i){var n,s;i.length!==2&&st(e,"TAG directive accepts exactly two arguments"),n=i[0],s=i[1],Tz.test(n)||st(e,"ill-formed tag handle (first argument) of the TAG directive"),QA.call(e.tagMap,n)&&st(e,'there is a previously declared suffix for "'+n+'" tag handle'),Mz.test(s)||st(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[n]=s}};function bA(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||st(t,"expected valid JSON character");else _Pe.test(a)&&st(t,"the stream contains non-printable characters");t.result+=a}}function Yz(t,e,r,i){var n,s,o,a;for(Ba.isObject(r)||st(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],QA.call(e,s)||(e[s]=r[s],i[s]=!0)}function lg(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])&&st(t,"nested arrays are not supported inside keys"),typeof n=="object"&&Oz(n[l])==="[object Object]"&&(n[l]="[object Object]");if(typeof n=="object"&&Oz(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)Yz(t,e,s[l],r);else Yz(t,e,s,r);else!t.json&&!QA.call(r,n)&&QA.call(e,n)&&(t.line=o||t.line,t.position=a||t.position,st(t,"duplicated mapping key")),e[n]=s,delete r[n];return e}function LP(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++):st(t,"a line break is expected"),t.line+=1,t.lineStart=t.position}function jr(t,e,r){for(var i=0,n=t.input.charCodeAt(t.position);n!==0;){for(;rc(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(wo(n))for(LP(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&&Ew(t,"deficient indentation"),i}function Iw(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||yn(r)))}function TP(t,e){e===1?t.result+=" ":e>1&&(t.result+=Ba.repeat(`
`,e-1))}function nDe(t,e,r){var i,n,s,o,a,l,c,u,g=t.kind,f=t.result,h;if(h=t.input.charCodeAt(t.position),yn(h)||ag(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(n=t.input.charCodeAt(t.position+1),yn(n)||r&&ag(n)))return!1;for(t.kind="scalar",t.result="",s=o=t.position,a=!1;h!==0;){if(h===58){if(n=t.input.charCodeAt(t.position+1),yn(n)||r&&ag(n))break}else if(h===35){if(i=t.input.charCodeAt(t.position-1),yn(i))break}else{if(t.position===t.lineStart&&Iw(t)||r&&ag(h))break;if(wo(h))if(l=t.line,c=t.lineStart,u=t.lineIndent,jr(t,!1,-1),t.lineIndent>=e){a=!0,h=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=l,t.lineStart=c,t.lineIndent=u;break}}a&&(bA(t,s,o,!1),TP(t,t.line-l),s=o=t.position,a=!1),rc(h)||(o=t.position+1),h=t.input.charCodeAt(++t.position)}return bA(t,s,o,!1),t.result?!0:(t.kind=g,t.result=f,!1)}function sDe(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(bA(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 wo(r)?(bA(t,i,n,!0),TP(t,jr(t,!1,e)),i=n=t.position):t.position===t.lineStart&&Iw(t)?st(t,"unexpected end of the document within a single quoted scalar"):(t.position++,n=t.position);st(t,"unexpected end of the stream within a single quoted scalar")}function oDe(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 bA(t,r,t.position,!0),t.position++,!0;if(a===92){if(bA(t,r,t.position,!0),a=t.input.charCodeAt(++t.position),wo(a))jr(t,!1,e);else if(a<256&&Uz[a])t.result+=Hz[a],t.position++;else if((o=eDe(a))>0){for(n=o,s=0;n>0;n--)a=t.input.charCodeAt(++t.position),(o=$Pe(a))>=0?s=(s<<4)+o:st(t,"expected hexadecimal character");t.result+=rDe(s),t.position++}else st(t,"unknown escape sequence");r=i=t.position}else wo(a)?(bA(t,r,i,!0),TP(t,jr(t,!1,e)),r=i=t.position):t.position===t.lineStart&&Iw(t)?st(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}st(t,"unexpected end of the stream within a double quoted scalar")}function aDe(t,e){var r=!0,i,n=t.tag,s,o=t.anchor,a,l,c,u,g,f={},h,p,d,m;if(m=t.input.charCodeAt(t.position),m===91)l=93,g=!1,s=[];else if(m===123)l=125,g=!0,s={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),m=t.input.charCodeAt(++t.position);m!==0;){if(jr(t,!0,e),m=t.input.charCodeAt(t.position),m===l)return t.position++,t.tag=n,t.anchor=o,t.kind=g?"mapping":"sequence",t.result=s,!0;r||st(t,"missed comma between flow collection entries"),p=h=d=null,c=u=!1,m===63&&(a=t.input.charCodeAt(t.position+1),yn(a)&&(c=u=!0,t.position++,jr(t,!0,e))),i=t.line,cg(t,e,Cw,!1,!0),p=t.tag,h=t.result,jr(t,!0,e),m=t.input.charCodeAt(t.position),(u||t.line===i)&&m===58&&(c=!0,m=t.input.charCodeAt(++t.position),jr(t,!0,e),cg(t,e,Cw,!1,!0),d=t.result),g?lg(t,s,f,p,h,d):c?s.push(lg(t,null,f,p,h,d)):s.push(h),jr(t,!0,e),m=t.input.charCodeAt(t.position),m===44?(r=!0,m=t.input.charCodeAt(++t.position)):r=!1}st(t,"unexpected end of the stream within a flow collection")}function ADe(t,e){var r,i,n=NP,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)NP===n?n=g===43?Lz:VPe:st(t,"repeat of a chomping mode identifier");else if((u=tDe(g))>=0)u===0?st(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?st(t,"repeat of an indentation width identifier"):(a=e+u-1,o=!0);else break;if(rc(g)){do g=t.input.charCodeAt(++t.position);while(rc(g));if(g===35)do g=t.input.charCodeAt(++t.position);while(!wo(g)&&g!==0)}for(;g!==0;){for(LP(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;!wo(g)&&g!==0;)g=t.input.charCodeAt(++t.position);bA(t,r,t.position,!1)}return!0}function qz(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),!yn(o)));){if(a=!0,t.position++,jr(t,!0,-1)&&t.lineIndent<=e){s.push(null),l=t.input.charCodeAt(t.position);continue}if(r=t.line,cg(t,e,Nz,!1,!0),s.push(t.result),jr(t,!0,-1),l=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&l!==0)st(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 lDe(t,e,r){var i,n,s,o,a=t.tag,l=t.anchor,c={},u={},g=null,f=null,h=null,p=!1,d=!1,m;for(t.anchor!==null&&(t.anchorMap[t.anchor]=c),m=t.input.charCodeAt(t.position);m!==0;){if(i=t.input.charCodeAt(t.position+1),s=t.line,o=t.position,(m===63||m===58)&&yn(i))m===63?(p&&(lg(t,c,u,g,f,null),g=f=h=null),d=!0,p=!0,n=!0):p?(p=!1,n=!0):st(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,m=i;else if(cg(t,r,Fz,!1,!0))if(t.line===s){for(m=t.input.charCodeAt(t.position);rc(m);)m=t.input.charCodeAt(++t.position);if(m===58)m=t.input.charCodeAt(++t.position),yn(m)||st(t,"a whitespace character is expected after the key-value separator within a block mapping"),p&&(lg(t,c,u,g,f,null),g=f=h=null),d=!0,p=!1,n=!1,g=t.tag,f=t.result;else if(d)st(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=a,t.anchor=l,!0}else if(d)st(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)&&(cg(t,e,mw,!0,n)&&(p?f=t.result:h=t.result),p||(lg(t,c,u,g,f,h,s,o),g=f=h=null),jr(t,!0,-1),m=t.input.charCodeAt(t.position)),t.lineIndent>e&&m!==0)st(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return p&&lg(t,c,u,g,f,null),d&&(t.tag=a,t.anchor=l,t.kind="mapping",t.result=c),d}function cDe(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&&st(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)):st(t,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!yn(o);)o===33&&(i?st(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),Tz.test(n)||st(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),ZPe.test(s)&&st(t,"tag suffix cannot contain flow indicator characters")}return s&&!Mz.test(s)&&st(t,"tag name cannot contain such characters: "+s),r?t.tag=s:QA.call(t.tagMap,n)?t.tag=t.tagMap[n]+s:n==="!"?t.tag="!"+s:n==="!!"?t.tag="tag:yaml.org,2002:"+s:st(t,'undeclared tag handle "'+n+'"'),!0}function uDe(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&st(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!yn(r)&&!ag(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&st(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function gDe(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&&!yn(i)&&!ag(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&st(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),QA.call(t.anchorMap,r)||st(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],jr(t,!0,-1),!0}function cg(t,e,r,i,n){var s,o,a,l=1,c=!1,u=!1,g,f,h,p,d;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 iDe(t,e),i=t.indexOf("\0");for(i!==-1&&(r.position=i,st(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;)fDe(r);return r.documents}function Wz(t,e,r){e!==null&&typeof e=="object"&&typeof r=="undefined"&&(r=e,e=null);var i=Jz(t,r);if(typeof e!="function")return i;for(var n=0,s=i.length;n<s;n+=1)e(i[n])}function zz(t,e){var r=Jz(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new Dz("expected a single document in the stream, but found more")}}function hDe(t,e,r){return typeof e=="object"&&e!==null&&typeof r=="undefined"&&(r=e,e=null),Wz(t,e,Ba.extend({schema:Rz},r))}function pDe(t,e){return zz(t,Ba.extend({schema:Rz},e))}Mp.exports.loadAll=Wz;Mp.exports.load=zz;Mp.exports.safeLoadAll=hDe;Mp.exports.safeLoad=pDe});var m5=E((Iat,MP)=>{"use strict";var Op=$l(),Kp=ng(),dDe=Tp(),CDe=og(),_z=Object.prototype.toString,Xz=Object.prototype.hasOwnProperty,mDe=9,Up=10,EDe=13,IDe=32,yDe=33,wDe=34,Zz=35,BDe=37,QDe=38,bDe=39,vDe=42,$z=44,SDe=45,e5=58,xDe=61,kDe=62,PDe=63,DDe=64,t5=91,r5=93,RDe=96,i5=123,FDe=124,n5=125,Ri={};Ri[0]="\\0";Ri[7]="\\a";Ri[8]="\\b";Ri[9]="\\t";Ri[10]="\\n";Ri[11]="\\v";Ri[12]="\\f";Ri[13]="\\r";Ri[27]="\\e";Ri[34]='\\"';Ri[92]="\\\\";Ri[133]="\\N";Ri[160]="\\_";Ri[8232]="\\L";Ri[8233]="\\P";var NDe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function LDe(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&&Xz.call(l.styleAliases,a)&&(a=l.styleAliases[a]),r[o]=a;return r}function s5(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 Kp("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Op.repeat("0",i-e.length)+e}function TDe(t){this.schema=t.schema||dDe,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Op.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=LDe(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 o5(t,e){for(var r=Op.repeat(" ",e),i=0,n=-1,s="",o,a=t.length;i<a;)n=t.indexOf(`
`),d==="+"?h++:d==="-"?p++:d===" "&&(h++,p++);else break}if(!h&&f.newLines===1&&(f.newLines=0),!p&&f.oldLines===1&&(f.oldLines=0),e.strict){if(h!==f.newLines)throw new Error("Added line count did not match for hunk at line "+(c+1));if(p!==f.oldLines)throw new Error("Removed line count did not match for hunk at line "+(c+1))}return f}for(;s<r.length;)o();return n}});var J_=E(GR=>{"use strict";Object.defineProperty(GR,"__esModule",{value:!0});GR.default=XTe;function XTe(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 V_=E(jB=>{"use strict";Object.defineProperty(jB,"__esModule",{value:!0});jB.applyPatch=W_;jB.applyPatches=ZTe;var z_=GB(),eMe=$Te(J_());function $Te(t){return t&&t.__esModule?t:{default:t}}function W_(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string"&&(e=(0,z_.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(F,D,he,pe){return D===pe},a=0,l=r.fuzzFactor||0,c=0,u=0,g,f;function h(F,D){for(var he=0;he<F.lines.length;he++){var pe=F.lines[he],Ne=pe.length>0?pe[0]:" ",Pe=pe.length>0?pe.substr(1):pe;if(Ne===" "||Ne==="-"){if(!o(D+1,i[D],Ne,Pe)&&(a++,a>l))return!1;D++}}return!0}for(var p=0;p<s.length;p++){for(var d=s[p],m=i.length-d.oldLines,I=0,B=u+d.oldStart-1,b=(0,eMe.default)(B,c,m);I!==void 0;I=b())if(h(d,B+I)){d.offset=u+=I;break}if(I===void 0)return!1;c=d.offset+d.oldStart+d.oldLines}for(var R=0,H=0;H<s.length;H++){var L=s[H],K=L.oldStart+L.offset+R-1;R+=L.newLines-L.oldLines,K<0&&(K=0);for(var J=0;J<L.lines.length;J++){var ne=L.lines[J],q=ne.length>0?ne[0]:" ",A=ne.length>0?ne.substr(1):ne,V=L.linedelimiters[J];if(q===" ")K++;else if(q==="-")i.splice(K,1),n.splice(K,1);else if(q==="+")i.splice(K,0,A),n.splice(K,0,V),K++;else if(q==="\\"){var W=L.lines[J-1]?L.lines[J-1][0]:null;W==="+"?g=!0:W==="-"&&(f=!0)}}}if(g)for(;!i[i.length-1];)i.pop(),n.pop();else f&&(i.push(""),n.push(`
`);if(b.lines=R,b.added||b.removed){var H;if(!u){var L=a[B-1];u=h,g=p,L&&(f=o.context>0?l(L.lines.slice(-o.context)):[],u-=f.length,g-=f.length)}(H=f).push.apply(H,jR(R.map(function(X){return(b.added?"+":"-")+X}))),b.added?p+=R.length:h+=R.length}else{if(u)if(R.length<=o.context*2&&B<a.length-2){var K;(K=f).push.apply(K,jR(l(R)))}else{var J,ne=Math.min(R.length,o.context);(J=f).push.apply(J,jR(l(R.slice(0,ne))));var q={oldStart:u,oldLines:h-u+ne,newStart:g,newLines:p-g+ne,lines:f};if(B>=a.length-2&&R.length<=o.context){var A=/\n$/.test(r),V=/\n$/.test(i),W=R.length==0&&f.length>q.oldLines;!A&&W&&f.splice(q.oldLines,0,"\\ No newline at end of file"),(!A&&!W||!V)&&f.push("\\ No newline at end of file")}c.push(q),u=0,g=0,f=[]}h+=R.length,p+=R.length}},m=0;m<a.length;m++)d(m);return{oldFileName:t,newFileName:e,oldHeader:n,newHeader:s,hunks:c}}function X_(t,e,r,i,n,s,o){var a=__(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(`
`),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=yJe,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(!IJe(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=Xie(),t.define=n,t};hN.exports=Zie();hN.exports.create=Zie});var Mi=E(bt=>{"use strict";var wJe=Object.prototype.toString,Cs=js(),$ie=!1,pN=[],ene={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};bt.longest=(t,e)=>t.reduce((r,i)=>Math.max(r,e?i[e].length:i.length),0);bt.hasColor=t=>!!t&&Cs.hasColor(t);var N0=bt.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);bt.nativeType=t=>wJe.call(t).slice(8,-1).toLowerCase().replace(/\s/g,"");bt.isAsyncFn=t=>bt.nativeType(t)==="asyncfunction";bt.isPrimitive=t=>t!=null&&typeof t!="object"&&typeof t!="function";bt.resolve=(t,e,...r)=>typeof e=="function"?e.call(t,...r):e;bt.scrollDown=(t=[])=>[...t.slice(1),t[0]];bt.scrollUp=(t=[])=>[t.pop(),...t];bt.reorder=(t=[])=>{let e=t.slice();return e.sort((r,i)=>r.index>i.index?1:r.index<i.index?-1:0),e};bt.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};bt.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};bt.height=(t,e=20)=>{let r=t&&t.rows?t.rows:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[1]),r};bt.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)};bt.unmute=t=>{let e=t.stack.find(i=>Cs.keys.color.includes(i));return e?Cs[e]:t.stack.find(i=>i.slice(2)==="bg")?Cs[e.slice(2)]:i=>i};bt.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"";bt.inverse=t=>{if(!t||!t.stack)return t;let e=t.stack.find(i=>Cs.keys.color.includes(i));if(e){let i=Cs["bg"+bt.pascal(e)];return i?i.black:t}let r=t.stack.find(i=>i.slice(0,2)==="bg");return r?Cs[r.slice(2).toLowerCase()]||t:Cs.none};bt.complement=t=>{if(!t||!t.stack)return t;let e=t.stack.find(i=>Cs.keys.color.includes(i)),r=t.stack.find(i=>i.slice(0,2)==="bg");if(e&&!r)return Cs[ene[e]||e];if(r){let i=r.slice(2).toLowerCase(),n=ene[i];return n&&Cs["bg"+bt.pascal(n)]||t}return Cs.none};bt.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};bt.set=(t={},e="",r)=>e.split(".").reduce((i,n,s,o)=>{let a=o.length-1>s?i[n]||{}:r;return!bt.isObject(a)&&s<o.length-1&&(a={}),i[n]=a},t);bt.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};bt.mixin=(t,e)=>{if(!N0(t))return e;if(!N0(e))return t;for(let r of Object.keys(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i.hasOwnProperty("value"))if(t.hasOwnProperty(r)&&N0(i.value)){let n=Object.getOwnPropertyDescriptor(t,r);N0(n.value)?t[r]=bt.merge({},t[r],e[r]):Reflect.defineProperty(t,r,i)}else Reflect.defineProperty(t,r,i);else Reflect.defineProperty(t,r,i)}return t};bt.merge=(...t)=>{let e={};for(let r of t)bt.mixin(e,r);return e};bt.mixinEmitter=(t,e)=>{let r=e.constructor.prototype;for(let i of Object.keys(r)){let n=r[i];typeof n=="function"?bt.define(t,i,n.bind(e)):bt.define(t,i,n)}};bt.onExit=t=>{let e=(r,i)=>{$ie||($ie=!0,pN.forEach(n=>n()),r===!0&&process.exit(128+i))};pN.length===0&&(process.once("SIGTERM",e.bind(null,!0,15)),process.once("SIGINT",e.bind(null,!0,2)),process.once("exit",e)),pN.push(t)};bt.define=(t,e,r)=>{Reflect.defineProperty(t,e,{value:r})};bt.defineExport=(t,e,r)=>{let i;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(n){i=n},get(){return i?i():r()}})}});var tne=E(nf=>{"use strict";nf.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"};nf.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};nf.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};nf.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};nf.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 nne=E((dCt,rne)=>{"use strict";var ine=require("readline"),BJe=tne(),QJe=/^(?:\x1b)([a-zA-Z0-9])$/,bJe=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,vJe={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
`:" ",i=[];for(let n=0;n<4;n++){let s=r(n);e[n]?i.push(s.repeat(e[n])):i.push("")}return i}yne.exports=T0});var bne=E((BCt,Bne)=>{"use strict";var jJe=Mi(),Qne={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 Qne.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}};Bne.exports=(t,e={})=>{let r=jJe.merge({},Qne,e.roles);return r[t]||r.default}});var sC=E((QCt,vne)=>{"use strict";var YJe=js(),qJe=sf(),JJe=bne(),M0=Mi(),{reorder:QN,scrollUp:WJe,scrollDown:zJe,isObject:Sne,swap:VJe}=M0,xne=class extends qJe{constructor(e){super(e);this.cursorHide(),this.maxSelected=e.maxSelected||Infinity,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:r,autofocus:i,suggest:n}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(s=>s.enabled=!1),typeof n!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");Sne(r)&&(r=Object.keys(r)),Array.isArray(r)?(i!=null&&(this.index=this.findIndex(i)),r.forEach(s=>this.enable(this.find(s))),await this.render()):(i!=null&&(r=i),typeof r=="string"&&(r=this.findIndex(r)),typeof r=="number"&&r>-1&&(this.index=Math.max(0,Math.min(r,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,r){this.state.loadingChoices=!0;let i=[],n=0,s=async(o,a)=>{typeof o=="function"&&(o=await o.call(this)),o instanceof Promise&&(o=await o);for(let l=0;l<o.length;l++){let c=o[l]=await this.toChoice(o[l],n++,a);i.push(c),c.choices&&await s(c.choices,c)}return i};return s(e,r).then(o=>(this.state.loadingChoices=!1,o))}async toChoice(e,r,i){if(typeof e=="function"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e=="string"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let n=e.value;if(e=JJe(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,M0.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,YJe.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)
`).map(B=>" "+B),m=s.length,I=0;for(let B of s)g.invalid.has(B.name)&&B.lines.forEach(b=>{d[b][0]===" "&&(d[b]=g.styles.danger(g.symbols.bullet)+d[b].slice(1))}),t.isValue(g.values[B.name])&&I++;return g.completed=(I/m*100).toFixed(0),g.output=d.join(`
`)),this.write(this.margin[2]),this.restore()}};Kse.exports=Use});var Yse=E((_Ct,Gse)=>{"use strict";var N3e=GA(),jse=class extends N3e{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)}}};Gse.exports=jse});var Jse=E(RN=>{"use strict";var qse=Mi(),ti=(t,e)=>{qse.defineExport(RN,t,e),qse.defineExport(RN,t.toLowerCase(),e)};ti("AutoComplete",()=>Nne());ti("BasicAuth",()=>Gne());ti("Confirm",()=>Wne());ti("Editable",()=>_ne());ti("Form",()=>O0());ti("Input",()=>kN());ti("Invisible",()=>ose());ti("List",()=>lse());ti("MultiSelect",()=>gse());ti("Numeral",()=>dse());ti("Password",()=>Ese());ti("Scale",()=>Bse());ti("Select",()=>GA());ti("Snippet",()=>Pse());ti("Sort",()=>Fse());ti("Survey",()=>Tse());ti("Text",()=>Ose());ti("Toggle",()=>Hse());ti("Quiz",()=>Yse())});var zse=E((ZCt,Wse)=>{Wse.exports={ArrayPrompt:sC(),AuthPrompt:xN(),BooleanPrompt:K0(),NumberPrompt:PN(),StringPrompt:Mc()}});var aC=E(($Ct,Vse)=>{"use strict";var _se=require("assert"),FN=require("events"),jA=Mi(),No=class extends FN{constructor(e,r){super();this.options=jA.merge({},e),this.answers=P({},r)}register(e,r){if(jA.isObject(e)){for(let n of Object.keys(e))this.register(n,e[n]);return this}_se.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(jA.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=jA.merge({},this.options,e),{type:i,name:n}=e,{set:s,get:o}=jA;if(typeof i=="function"&&(i=await i.call(this,e,this.answers)),!i)return this.answers[n];_se(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||sf()}static get prompts(){return Jse()}static get types(){return zse()}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 jA.mixinEmitter(e,new FN),e}};jA.mixinEmitter(No,new FN);var NN=No.prompts;for(let t of Object.keys(NN)){let e=t.toLowerCase(),r=i=>new NN[t](i).run();No.prompt[e]=r,No[e]=r,No[t]||Reflect.defineProperty(No,t,{get:()=>NN[t]})}var oC=t=>{jA.defineExport(No,t,()=>No.types[t])};oC("ArrayPrompt");oC("AuthPrompt");oC("BooleanPrompt");oC("NumberPrompt");oC("StringPrompt");Vse.exports=No});var loe=E((Gmt,Aoe)=>{function K3e(t,e){for(var r=-1,i=t==null?0:t.length;++r<i&&e(t[r],r,t)!==!1;);return t}Aoe.exports=K3e});var Af=E((jmt,coe)=>{var U3e=XB(),H3e=jg();function G3e(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?H3e(r,a,l):U3e(r,a,l)}return r}coe.exports=G3e});var goe=E((Ymt,uoe)=>{var j3e=Af(),Y3e=zg();function q3e(t,e){return t&&j3e(e,Y3e(e),t)}uoe.expo
`);return Buffer.from(e)};vf.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};vf.encode=function(t){var e=t7e(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(tl(t.mode&a7e,6),100),e.write(tl(t.uid,6),108),e.write(tl(t.gid,6),116),e.write(tl(t.size,11),124),e.write(tl(t.mtime.getTime()/1e3|0,11),136),e[156]=Uue+c7e(t.type),t.linkname&&e.write(t.linkname,157),Hue.copy(e,cm),n7e.copy(e,aM),t.uname&&e.write(t.uname,265),t.gname&&e.write(t.gname,297),e.write(tl(t.devmajor||0,6),329),e.write(tl(t.devminor||0,6),337),i&&e.write(i,345),e.write(tl(jue(e),6),148),e)};vf.decode=function(t,e,r){var i=t[156]===0?0:t[156]-Uue,n=Sf(t,0,100,e),s=rl(t,100,8),o=rl(t,108,8),a=rl(t,116,8),l=rl(t,124,12),c=rl(t,136,12),u=l7e(i),g=t[157]===0?null:Sf(t,157,100,e),f=Sf(t,265,32),h=Sf(t,297,32),p=rl(t,329,8),d=rl(t,337,8),m=jue(t);if(m===8*32)return null;if(m!==rl(t,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(Hue.compare(t,cm,cm+6)===0)t[345]&&(n=Sf(t,345,155,e)+"/"+n);else if(!(s7e.compare(t,cm,cm+6)===0&&o7e.compare(t,aM,aM+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return i===0&&n&&n[n.length-1]==="/"&&(i=5),{name:n,mode:s,uid:o,gid:a,size:l,mtime:new Date(1e3*c),type:u,linkname:g,uname:f,gname:h,devmajor:p,devminor:d}}});var _ue=E((LPt,Yue)=>{var que=require("util"),g7e=Kue(),um=lM(),Jue=bf().Writable,Wue=bf().PassThrough,zue=function(){},Vue=function(t){return t&=511,t&&512-t},f7e=function(t,e){var r=new EQ(t,e);return r.end(),r},h7e=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},EQ=function(t,e){this._parent=t,this.offset=e,Wue.call(this,{autoDestroy:!1})};que.inherits(EQ,Wue);EQ.prototype.destroy=function(t){this._parent.destroy(t)};var Wa=function(t){if(!(this instanceof Wa))return new Wa(t);Jue.call(this,t),t=t||{},this._offset=0,this._buffer=g7e(),this._missing=0,this._partial=!1,this._onparse=zue,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var e=this,r=e._buffer,i=function(){e._continue()},n=function(f){if(e._locked=!1,f)return e.destroy(f);e._stream||i()},s=function(){e._stream=null;var f=Vue(e._header.size);f?e._parse(f,o):e._parse(512,g),e._locked||i()},o=function(){e._buffer.consume(Vue(e._header.size)),e._parse(512,g),i()},a=function(){var f=e._header.size;e._paxGlobal=um.decodePax(r.slice(0,f)),r.consume(f),s()},l=function(){var f=e._header.size;e._pax=um.decodePax(r.slice(0,f)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),r.consume(f),s()},c=function(){var f=e._header.size;this._gnuLongPath=um.decodeLongPath(r.slice(0,f),t.filenameEncoding),r.consume(f),s()},u=function(){var f=e._header.size;this._gnuLongLinkPath=um.decodeLongPath(r.slice(0,f),t.filenameEncoding),r.consume(f),s()},g=function(){var f=e._offset,h;try{h=e._header=um.decode(r.slice(0,512),t.filenameEncoding,t.allowUnknownFormat)}catch(p){e.emit("error",p)}if(r.consume(512),!h){e._parse(512,g),i();return}if(h.type==="gnu-long-path"){e._parse(h.size,c),i();return}if(h.type==="gnu-long-link-path"){e._parse(h.size,u),i();return}if(h.type==="pax-global-header"){e._parse(h.size,a),i();return}if(h.type==="pax-header"){e._parse(h.size,l),i();return}if(e._gnuLongPath&&(h.name=e._gnuLongPath,e._gnuLongPath=null),e._gnuLongLinkPath&&(h.linkname=e._gnuLongLinkPath,e._gnuLongLinkPath=null),e._pax&&(e._header=h=h7e(h,e._pax),e
-${HE(r)}`).join("")}`)}functionBh(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}))throwwh(`Invalid value for ${t}`,i);for(let[,a]ofn)a();returne}varye=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(()=>(Ss(),lu)),a=o(n(s()),r),l=[],c=[];if(!a(this,{errors:l,coercions:c}))throwwh("Invalid option schema",l);for(let[,g]ofc)g()}leti=awaitthis.execute();returntypeofi!="undefined"?i:0}};ye.isOption=yh;ye.Default=[];functionun(t){Av&&console.log(t)}varBU={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:Au};functionQU(){return{nodes:[qi(),qi(),qi()]}}functionnCe(t){lete=QU(),r=[],i=e.nodes.length;for(letnoft){r.push(i);for(lets=0;s<n.nodes.length;++s)bU(s)||e.nodes.push(iCe(n.nodes[s],i));i+=n.nodes.length-2}for(letnofr)cu(e,yl,n);returne}functionxs(t,e){returnt.nodes.push(e),t.nodes.length-1}functionsCe(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:f})=>g.to===f)||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(yl)}functionoCe(t,{prefix:e=""}={}){if(Av){un(`${e}Nodes are:`);for(letr=0;r<t.nodes.length;++r)un(`${e}${r}: ${JSON.stringify(t.nodes[r])}`)}}functionvU(t,e,r=!1){un(`Running a vm on ${JSON.stringify(e)}`);leti=[{node:yl,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null}}];oCe(t,{prefix:" "});letn=[sv,...e];for(lets=0;s<n.length;++s){leto=n[s];un(` Processing ${JSON.stringify(o)}`);leta=[];for(let{node:l,state:c}ofi){un(` Current node is ${l}`);letu=t.nodes[l];if(l===Gi){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){letf=u.statics[o];for(let{to:h,reducer:p}off)a.push({node:h,state:typeofp!="undefined"?jE(dv,p,c,o):c}),un(` Static transition to ${h} found`)}elseun(" No static transition found");else{letf=!1;for(lethofObject.keys(u.statics))if(!!h.startsWith(o)){if(o===h)for(let{to:p,reducer:d}ofu.statics[h])a.push({node:p,state:typeofd!="undefined"?jE(dv,d,c,o):c}),un(` Static transition to ${p} found`);elsefor(let{to:p}ofu.statics[h])a.push({node:p,state:_(P({},c),{remainder:h.slice(o.length)})}),un(` Static transition to ${p} found (partial match)`);f=!0}f||un(" No partial static transition found")}if(o!==hi)for(let[f,{to:h,reducer:p}]ofu.dynamics)jE(YE,f,c,o)&&(a.push({node:h,state:typeofp!="undefined"?jE(dv,p,c,o):c}),un(` Dynamic transition to ${h} found (via ${f})`))}if(a.length===0&&o===hi&&e.length===1)return[{node:yl,state:BU}];if(a.length===0)thrownewIh(e,i.filter(({node:l})=>l!==Gi).map(({state:l})=>({usage:l.candidateUsage,reason:null})));if(a.every(({node:l})=>l===Gi))thrownewIh(e,a.map(({state:l})=>({usage:l.candidateUsage,reason:l.errorMessage})));i=aCe(a)}if(i.length>0){un(" Results:");for(letsofi)un(` - ${s.node} -> ${JSON.stringify(s.state)}`)}elseun(" No results");returni}functionACe(t,e){if(e.selectedIndex!==null)return!0;if(Object.prototype.hasOwnProperty.call(t.statics,hi)){for(let{to:r}oft.statics[hi])if(r===Eh)return!0}return!1}functio
`:""}var bh=class extends ye{constructor(e){super();this.contexts=e,this.commands=[]}static from(e,r){let i=new bh(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 f of c){let h=l.get(f).slice().sort((d,m)=>d.usage.localeCompare(m.usage,"en",{usage:"sort",caseFirst:"upper"})),p=f!==null?f.trim():"General commands";a+=`
`,a+=Vn("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 a}error(e,r){var i,{colored:n,command:s=(i=e[DU])!==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}
`),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 z8=ie(zy()),V8=new Map,_8=new Map,lxe=new W8.Agent({keepAlive:!0}),cxe=new J8.Agent({keepAlive:!0});function X8(t){let e=new Vy.URL(t),r={host:e.hostname,headers:{}};return e.port&&(r.port=Number(e.port)),{proxy:r}}async function uxe(t){return na(_8,t,()=>T.readFilePromise(t).then(e=>(_8.set(t,e),e)))}function gxe({statusCode:t,statusMessage:e},r){let i=Ve(r,t,Le.NUMBER),n=`https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/${t}`;return Ku(r,`${i}${e?` (${e})`:""}`,n)}async function _y(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 q8.TimeoutError&&s.event==="socket"&&(o+=`(can be increased via ${Ve(e,"httpTimeout",Le.SETTING)})`);let a=new nt(z.NETWORK_ERROR,o,l=>{s.response&&l.reportError(z.NETWORK_ERROR,` ${Yl(e,{label:"Response Code",value:jl(Le.NO_HINT,gxe(s.response,e))})}`),s.request&&(l.reportError(z.NETWORK_ERROR,` ${Yl(e,{label:"Request Method",value:jl(Le.NO_HINT,s.request.options.method)})}`),l.reportError(z.NETWORK_ERROR,` ${Yl(e,{label:"Request URL",value:jl(Le.URL,s.request.requestUrl)})}`)),s.request.redirects.length>0&&l.reportError(z.NETWORK_ERROR,` ${Yl(e,{label:"Request Redirects",value:jl(Le.NO_HINT,Kx(e,s.request.redirects,Le.URL))})}`),s.request.retryCount===s.request.options.retry.limit&&l.reportError(z.NETWORK_ERROR,` ${Yl(e,{label:"Request Retry Count",value:jl(Le.NO_HINT,`${Ve(e,s.request.retryCount,Le.NUMBER)} (can be increased via ${Ve(e,"httpRetry",Le.SETTING)})`)})}`)});throw a.originalError=s,a}}function Z8(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 Vy.URL(t):t;for(let[o,a]of r)if(tP.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 Jl;(function(n){n.GET="GET",n.PUT="PUT",n.POST="POST",n.DELETE="DELETE"})(Jl||(Jl={}));async function xp(t,e,{configuration:r,headers:i,jsonRequest:n,jsonResponse:s,method:o=Jl.GET}){let a=typeof t=="string"?new Vy.URL(t):t,l=Z8(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:"&&!tP.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?rP.default.httpOverHttp(X8(l.httpProxy)):lxe,https:l.httpsProxy?rP.default.httpsOverHttp(X8(l.httpsProxy)):cxe},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"),f=r.get("httpRetry"),h=r.get("enableStrictSsl"),p=l.caFilePath,{default:d}=await Promise.resolve().then(()=>ie(zy())),m=p?await uxe(p):void 0,I=d.extend(P({timeout:{socket:g},retry:f,https:{rejectUnauthorized:h,certificateAuthority:m}},u));return r.getLimit("networkConcurrency")(()=>I(a))}async function fxe(t,n){var s=n,{configuration:e,jsonResponse:r}=s,i=qr(s,["configuration","jsonResponse"]);let o=na(V8,t,()=>_y(xp(t,null,P({configuration:e},i)),{configuration:e}).then(a=>(V8.set(t,a.body),a.body)));return Buffer.isBuffer(o)===!1&&(o=await o),r?JSON.parse(o.toString()):o}async function hxe(t,e,n){var s=n,{customErrorMessage:r}=s,i=qr(s,["customErrorMessage"]);return(await _y(xp(t,e,_(P({},i),{method:Jl.PUT})),i)).body}async function iP(t,e,n){var s=n,{customErrorMessage:r
`),b.end()}),b});break;case"<&":p(()=>j5(Number(t[B]),1,r));break;case">":case">>":{let b=v.resolve(r.cwd,M.toPortablePath(t[B]));d(b==="/dev/null"?new Kn.Writable({autoDestroy:!0,emitClose:!0,write(R,H,L){setImmediate(L)}}):e.baseFs.createWriteStream(b,f===">>"?{flags:"a"}:void 0))}break;case">&":d(j5(Number(t[B]),2,r));break;default:throw new Error(`Assertionfailed:Unsupportedredirectiontype:"${f}"`)}}if(o.length>0){let g=new Kn.PassThrough;i=g;let f=h=>{if(h===o.length)g.end();else{let p=o[h]();p.pipe(g,{end:!1}),p.on("end",()=>{f(h+1)})}};f(0)}if(a.length>0){let g=new Kn.PassThrough;n=g;for(let f of a)g.pipe(f)}if(l.length>0){let g=new Kn.PassThrough;s=g;for(let f of l)g.pipe(f)}let u=await xw(Yp(t.slice(c+1),e,r),{stdin:new Os(i),stdout:new Os(n),stderr:new Os(s)}).run();return await Promise.all(a.map(g=>new Promise((f,h)=>{g.on("error",p=>{h(p)}),g.on("close",()=>{f()}),g.end()}))),await Promise.all(l.map(g=>new Promise((f,h)=>{g.on("error",p=>{h(p)}),g.on("close",()=>{f()}),g.end()}))),u}]]);async function aRe(t,e,r){let i=[],n=new Kn.PassThrough;return n.on("data",s=>i.push(s)),await Pw(t,e,kw(r,{stdout:n})),Buffer.concat(i).toString().replace(/[\r\n]+$/,"")}async function Y5(t,e,r){let i=t.map(async s=>{let o=await oc(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 Dw(t){return t.match(/[^ \r\n\t]+/g)||[]}async function q5(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=Dw(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 Dw(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),o;if(Number.isFinite(s))if(s>=0&&s<e.args.length)o=e.args[s];else if(t.defaultValue)o=(await oc(t.defaultValue,e,r)).join(" ");else throw new as(`Unboundargument#${s}`);else if(Object.prototype.hasOwnProperty.call(r.variables,t.name))o=r.variables[t.name];else if(Object.prototype.hasOwnProperty.call(r.environment,t.name))o=r.environment[t.name];else if(t.defaultValue)o=(await oc(t.defaultValue,e,r)).join(" ");else throw new as(`Unboundvariable"${t.name}"`);if(t.quoted)i(o);else{let a=Dw(o);for(let c=0;c<a.length-1;++c)n(a[c]);let l=a[a.length-1];typeof l!="undefined"&&i(l)}}break}}var ARe={addition:(t,e)=>t+e,subtraction:(t,e)=>t-e,multiplication:(t,e)=>t*e,division:(t,e)=>Math.trunc(t/e)};async function qp(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 q5(_(P({},t),{quoted:!0}),e,r,s=>i.push(s));let n=Number(i.join(" "));return Number.isNaN(n)?qp({type:"variable",name:i.join(" ")},e,r):qp({type:"number",value:n},e,r)}else return ARe[t.type](await qp(t.left,e,r),await qp(t.right,e,r))}async function oc(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,f)=>{let h=JSON.stringify({type:u,fd:g}),p=i.get(h);typeof p=="undefined"&&i.set(h,p=[]),p.push(f)};for(let u of t){let g=!1;switch(u.type){case"redirection":{let f=await oc(u.args,e,r);for(let h of f)c(u.subtype,u.fd,h)}break;case"argument":for(let f of u.segments)switch(f.type){case"text":o(f.text);break;case"glob":o(f.pattern),g=!0;break;case"shell":{let h=await aRe(f.shell,e,r);if(f.quoted)o(h);else{let p=Dw(h);for(let d=0;d<p.length-1;++d)l(p[d]);o(p[p.length-1])}}break;case"variable":await q5(f,e,r,o,l);break;case"arithmetic":o(String(await qp(f.arithmetic,e,r)));break}break}if(a(),g){let f=n.pop();if(typeof f=="undefined")throw new Error("Assertion failed: Expected a glob pattern to have been set");let h=await e.glob.match(f,{cwd:r.cwd,baseFs:e.baseFs});if(h.length===0){let p=R5(f)?". Note: Brace expansion of arbitrary strings isn't currently supported. For more details, please read
`),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(${lt(this.configuration,this.lastCacheMiss)})`):this.cacheMissCount>1?s+=`-${this.cacheMissCount}packageshadtobefetched`:this.cacheMissCount===1&&(s+=`-onepackagehadtobefetched(${lt(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>r9&&(this.progressFrame=(this.progressFrame+1)%t9.length,this.progressTime=e);let r=t9[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(`${Ve(this.configuration,"\u27A4","blueBright")}${a}${r}${n}${s}
`,{mode:493})}async function a9(t){let e=await Ze.tryFind(t);if(e==null?void 0:e.packageManager){let i=Qy(e.packageManager);if(i==null?void 0:i.name){let n=`found${JSON.stringify({packageManager:e.packageManager})}inmanifest`,[s]=i.reference.split(".");switch(i.name){case"yarn":return{packageManager:Number(s)===1?tn.Yarn1:tn.Yarn2,reason:n};case"npm":return{packageManager:tn.Npm,reason:n};case"pnpm":return{packageManager:tn.Pnpm,reason:n}}}}let r;try{r=await T.readFilePromise(v.join(t,wt.lockfile),"utf8")}catch{}return r!==void 0?r.match(/^__metadata:$/m)?{packageManager:tn.Yarn2,reason:'"__metadata" key found in yarn.lock'}:{packageManager:tn.Yarn1,reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:T.existsSync(v.join(t,"package-lock.json"))?{packageManager:tn.Npm,reason:`foundnpm's "package-lock.json" lockfile`}:T.existsSync(v.join(t,"pnpm-lock.yaml"))?{packageManager:tn.Pnpm,reason:`found pnpm's"pnpm-lock.yaml"lockfile`}:null}async function Vp({project:t,locator:e,binFolder:r,lifecycleScript:i}){var l,c;let n={};for(let[u,g]of Object.entries(process.env))typeof g!="undefined"&&(n[u.toLowerCase()!=="path"?u:"PATH"]=g);let s=M.fromPortablePath(r);n.BERRY_BIN_FOLDER=M.fromPortablePath(s);let o=process.env.COREPACK_ROOT?M.join(process.env.COREPACK_ROOT,"dist/yarn.js"):process.argv[1];if(await Promise.all([ba(r,"node",process.execPath),...Zr!==null?[ba(r,"run",process.execPath,[o,"run"]),ba(r,"yarn",process.execPath,[o]),ba(r,"yarnpkg",process.execPath,[o]),ba(r,"node-gyp",process.execPath,[o,"run","--top-level","node-gyp"])]:[]]),t&&(n.INIT_CWD=M.fromPortablePath(t.configuration.startingCwd),n.PROJECT_CWD=M.fromPortablePath(t.cwd)),n.PATH=n.PATH?`${s}${M.delimiter}${n.PATH}`:`${s}`,n.npm_execpath=`${s}${M.sep}yarn`,n.npm_node_execpath=`${s}${M.sep}node`,e){if(!t)throw new Error("Assertion failed: Missing project");let u=t.tryWorkspaceByLocator(e),g=u?(l=u.manifest.version)!=null?l:"":(c=t.storedPackages.get(e.locatorHash).version)!=null?c:"";n.npm_package_name=St(e),n.npm_package_version=g}let a=Zr!==null?`yarn/${Zr}`:`yarn/${mu("@yarnpkg/core").version}-core`;return n.npm_config_user_agent=`${a}npm/?node/${process.versions.node}${process.platform}${process.arch}`,i&&(n.npm_lifecycle_event=i),t&&await t.configuration.triggerHook(u=>u.setupScriptEnvironment,t,n,async(u,g,f)=>await ba(r,kr(u),g,f)),n}var KFe=2,UFe=(0,o9.default)(KFe);async function HFe(t,e,{configuration:r,report:i,workspace:n=null,locator:s=null}){await UFe(async()=>{await T.mktempPromise(async o=>{let a=v.join(o,"pack.log"),l=null,{stdout:c,stderr:u}=r.getSubprocessStreams(a,{prefix:M.fromPortablePath(t),report:i}),g=s&&Io(s)?lp(s):s,f=g?is(g):"an external project";c.write(`Packing${f}fromsources
$2`).replace(/^│\n/,"");if(n>=3)throw new Error("Only the first two levels are accepted by treeUtils.emitTree");r.write(s)}var v_=ie(require("crypto")),BR=ie(require("fs"));var fTe=8,Qt=class{constructor(e,{configuration:r,immutable:i=r.get("enableImmutableCache"),check:n=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.cacheId=`-${(0,v_.randomBytes)(8).toString("hex")}.tmp`;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!==pl?`c${o}`:"";this.cacheKey=[fTe,a].join("")}}static async find(e,{immutable:r,check:i}={}){let n=new Qt(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`${Mu(e)}-${this.cacheKey}.zip`}getChecksumFilename(e,r){let n=hTe(r).slice(0,10);return`${Mu(e)}-${n}.zip`}getLocatorPath(e,r,i={}){var s;return this.mirrorCwd===null||((s=i.unstablePackages)==null?void 0:s.has(e.locatorHash))?v.resolve(this.cwd,this.getVersionFilename(e)):r===null||QR(r)!==this.cacheKey?null:v.resolve(this.cwd,this.getChecksumFilename(e,r))}getLocatorMirrorPath(e){let r=this.mirrorCwd;return r!==null?v.resolve(r,this.getVersionFilename(e)):null}async setup(){if(!this.configuration.get("enableGlobalCache"))if(this.immutable){if(!await T.existsPromise(this.cwd))throw new nt(z.IMMUTABLE_CACHE,"Cache path does not exist.")}else{await T.mkdirPromise(this.cwd,{recursive:!0});let e=v.resolve(this.cwd,".gitignore");await T.changeFilePromise(e,`/.gitignore
`)}(this.mirrorCwd||!this.immutable)&&await T.mkdirPromise(this.mirrorCwd||this.cwd,{recursive:!0})}async fetchPackageFromCache(e,r,a){var l=a,{onHit:i,onMiss:n,loader:s}=l,o=qr(l,["onHit","onMiss","loader"]);var A;let c=this.getLocatorMirrorPath(e),u=new Wt,g=()=>{let V=new Jr(null,{libzip:H}),W=v.join(Se.root,Lx(e));return V.mkdirSync(W,{recursive:!0}),V.writeJsonSync(v.join(W,wt.manifest),{name:St(e),mocked:!0}),V},f=async(V,W=null)=>{let X=!o.skipIntegrityCheck||!r?`${this.cacheKey}/${awaitEy(V)}`:r;if(W!==null){let F=!o.skipIntegrityCheck||!r?`${this.cacheKey}/${awaitEy(W)}`:r;if(X!==F)throw new nt(z.CACHE_CHECKSUM_MISMATCH,"The remote archive doesn't match the local checksum - has the local cache been corrupted?")}if(r!==null&&X!==r){let F;switch(this.check?F="throw":QR(r)!==QR(X)?F="update":F=this.configuration.get("checksumBehavior"),F){case"ignore":return r;case"update":return X;default:case"throw":throw new nt(z.CACHE_CHECKSUM_MISMATCH,"The remote archive doesn't match the expected checksum")}}return X},h=async V=>{if(!s)throw new Error(`Cachecheckrequiredbutnoloaderconfiguredfor${lt(this.configuration,e)}`);let W=await s(),X=W.getRealPath();return W.saveAndClose(),await T.chmodPromise(X,420),await f(V,X)},p=async()=>{if(c===null||!await T.existsPromise(c)){let V=await s(),W=V.getRealPath();return V.saveAndClose(),{source:"loader",path:W}}return{source:"mirror",path:c}},d=async()=>{if(!s)throw new Error(`Cacheentryrequiredbutmissingfor${lt(this.configuration,e)}`);if(this.immutable)throw new nt(z.IMMUTABLE_CACHE,`Cacheentryrequiredbutmissingfor${lt(this.configuration,e)}`);let{path:V,source:W}=await p(),X=await f(V),F=this.getLocatorPath(e,X,o);if(!F)throw new Error("Assertion failed: Expected the cache path to be available");let D=[];W!=="mirror"&&c!==null&&D.push(async()=>{let pe=`${c}${this.cacheId}`;await T.copyFilePromise(V,pe,BR.default.constants.COPYFILE_FICLONE),await T.chmodPromise(pe,420),await T.renamePromise(pe,c)}),(!o.mirrorWriteOnly||c===null)&&D.push(async()=>{let pe=`${F}${this.cacheId}`;await T.copyFilePromise(V,pe,BR.default.constants.COPYFILE_FICLONE),await T.chmodPromise(pe,420),await T.renamePromise(pe,F)});let he=o.mirrorWriteOnly&&c!=null?c:F;return await Promise.all(D.map(pe=>pe())),[!1,he,X]},m=async()=>{let W=(async()=>{var Ne;let X=this.getLocatorPath(e,r,o),F=X!==null?await u.existsPromise(X):!1,D=!!((Ne=o.mockedPackages)==null?void 0:Ne.has(e.locatorHash))&&(!this.check||!F),he=D||F,pe=he?i:n;if(pe&&pe(),he){let Pe=null,qe=X;return D||(Pe=this.check?await h(qe):await f(qe)),[D,qe,Pe]}else return d()})();this.mutexes.set(e.locatorHash,W);try{return await W}finally{this.mutexes.delete(e.locatorHash)}};for(let V;V=this.mutexes.get(e.locatorHash);)await V;let[I,B,b]=await m();this.markedFiles.add(B);let R,H=await $i(),L=I?()=>g():()=>new Jr(B,{baseFs:u,libzip:H,readOnly:!0}),K=new oh(()=>Mv(()=>R=L(),V=>`Failedtoopenthecacheentryfor${lt(this.configuration,e)}:${V}`),v),J=new Xo(B,{baseFs:K,pathUtils:v}),ne=()=>{R==null||R.discardAndClose()},q=((A=o.unstablePackages)==null?void 0:A.has(e.locatorHash))?null:b;return[J,ne,q]}};function QR(t){let e=t.indexOf("/");return e!==-1?t.slice(0,e):null}function hTe(t){let e=t.indexOf("/");return e!==-1?t.slice(e+1):t}var F_=ie(x_()),NB=ie(ml());var N_=ie(Wp()),kR=ie(require("stream"));var k_={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!==St(r)||o.from&&o.from.description&&o.from.description!==r.reference||o.descriptor.fullName!==St(t)||o.descriptor.description&&o.descriptor.description!==t.range)continue;return n.bindDescriptor(Yt(t,a),e.topLevelWorkspace.anchoredLocator,s)}return t},validateProject:async(t,e)=>{for(let r of t.workspaces){let i=hp(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.leng
`);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 pd([new FB,new Yr,new SR,...e])}makeFetcher(){let e=[];for(let r of this.plugins.values())for(let i of r.fetchers||[])e.push(new i);return new vR([new dd,new xR,...e])}getLinkers(){let e=[];for(let r of this.plugins.values())for(let i of r.linkers||[])e.push(new i);return e}getSupportedArchitectures(){let e=this.get("supportedArchitectures"),r=e.get("os");r!==null&&(r=r.map(n=>n==="current"?process.platform:n));let i=e.get("cpu");return i!==null&&(i=i.map(n=>n==="current"?process.arch:n)),{os:r,cpu:i}}async refreshPackageExtensions(){this.packageExtensions=new Map;let e=this.packageExtensions,r=(i,n,{userProvided:s=!1}={})=>{if(!Us(i.range))throw new Error("Only semver ranges are allowed as keys for the packageExtensions setting");let o=new Ze;o.load(n,{yamlCompatibilityMode:!0});let a=hu(e,i.identHash),l=[];a.push([i.range,l]);let c={status:ki.Inactive,userProvided:s,parentDescriptor:i};for(let u of o.dependencies.values())l.push(_(P({},c),{type:oi.Dependency,descriptor:u}));for(let u of o.peerDependencies.values())l.push(_(P({},c),{type:oi.PeerDependency,descriptor:u}));for(let[u,g]of o.peerDependenciesMeta)for(let[f,h]of Object.entries(g))l.push(_(P({},c),{type:oi.PeerDependencyMeta,selector:u,key:f,value:h}))};await this.triggerHook(i=>i.registerPackageExtensions,this,r);for(let[i,n]of this.get("packageExtensions"))r(pA(i,!0),aI(n),{userProvided:!0})}normalizePackage(e){let r=ap(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(!!lc(s,o))for(let l of a)switch(l.status===ki.Inactive&&(l.status=ki.Redundant),l.type){case oi.Dependency:typeof r.dependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=ki.Active,r.dependencies.set(l.descriptor.identHash,l.descriptor));break;case oi.PeerDependency:typeof r.peerDependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=ki.Active,r.peerDependencies.set(l.descriptor.identHash,l.descriptor));break;case oi.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=ki.Active,na(r.peerDependenciesMeta,l.selector,()=>({}))[l.key]=l.value)}break;default:Lv(l);break}}}let n=s=>s.scope?`${s.scope}__${s.name}`:`${s.name}`;for(let s of r.peerDependenciesMeta.keys()){let o=En(s);r.peerDependencies.has(o.identHash)||r.peerDependencies.set(o.identHash,Yt(o,"*"))}for(let s of r.peerDependencies.values()){if(s.scope==="types")continue;let o=n(s),a=Eo("types",o),l=St(a);r.peerDependencies.has(a.identHash)||r.peerDependenciesMeta.has(l)||(r.peerDependencies.set(a.identHash,Yt(a,"*")),r.peerDependenciesMeta.set(l,{optional:!0}))}return r.dependencies=new Map(gn(r.dependencies,([,s])=>In(s))),r.peerDependencies=new Map(gn(r.peerDependencies,([,s])=>In(s))),r}getLimit(e){return na(this.limits,e,()=>(0,N_.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}},fe=Ra;fe.telemetry=null;var Gn;(function(r){r[r.SCRIPT=0]="SCRIPT",r[r.SHELLCODE=1]="SHELLCODE"})(Gn||(Gn={}));var Fa=class extends Xi{constructor({configuration:e,stdout:r,suggestInstall:i=!0}){super();this.errorCount=0;Cp(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{awai
`))}formatNameWithHyperlink(e){return eD(e,{configuration:this.configuration,json:!1})}};var t0=ie(require("crypto")),v$=ie(CX()),r0=ie(Q$()),S$=ie(Wp()),x$=ie(Or()),lF=ie(require("util")),cF=ie(require("v8")),uF=ie(require("zlib"));var iUe=[[/^(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)=>by({protocol:"npm:",source:null,selector:t,params:{__archiveUrl:e}})],[/^[^/]+\.tgz#[0-9a-f]+$/,t=>`npm:${t}`]],oF=class{constructor(){this.resolutions=null}async setup(e,{report:r}){let i=v.join(e.cwd,e.configuration.get("lockfileFilename"));if(!T.existsSync(i))return;let n=await T.readFilePromise(i,"utf8"),s=Ii(n);if(Object.prototype.hasOwnProperty.call(s,"__metadata"))return;let o=this.resolutions=new Map;for(let a of Object.keys(s)){let l=gp(a);if(!l){r.reportWarning(z.YARN_IMPORT_FAILED,`Failed to parse the string "${a}" into a proper descriptor`);continue}Us(l.range)&&(l=Yt(l,`npm:${l.range}`));let{version:c,resolved:u}=s[a];if(!u)continue;let g;for(let[h,p]of iUe){let d=u.match(h);if(d){g=p(c,...d);break}}if(!g){r.reportWarning(z.YARN_IMPORT_FAILED,`${Xt(e.configuration,l)}: Only some patterns can be imported from legacy lockfiles (not "${u}")`);continue}let f=l;try{let h=Tu(l.range),p=gp(h.selector,!0);p&&(f=p)}catch{}o.set(l.descriptorHash,Vi(f,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 aF=class{constructor(e){this.resolver=e}supportsDescriptor(e,r){return!!(r.project.storedResolutions.get(e.descriptorHash)||r.project.originalPackages.has(By(e).locatorHash))}supportsLocator(e,r){return!!(r.project.originalPackages.has(e.locatorHash)&&!r.project.lockfileNeedsRefresh)}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 this.resolver.getResolutionDependencies(e,r)}async getCandidates(e,r,i){let n=i.project.originalPackages.get(By(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 AF=class{constructor(e){this.resolver=e}supportsDescriptor(e,r){return this.resolver.supportsDescriptor(e,r
-Ifitisn't, it'slikelybecauseyouhaveayarn.lockorpackage.jsonfilethere,confusingtheprojectrootdetection.`)}async setupResolutions(){var i;this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let e=v.join(this.cwd,this.configuration.get("lockfileFilename")),r=this.configuration.get("defaultLanguageName");if(T.existsSync(e)){let n=await T.readFilePromise(e,"utf8");this.lockFileChecksum=D$(n);let s=Ii(n);if(s.__metadata){let o=s.__metadata.version,a=s.__metadata.cacheKey;this.lockfileNeedsRefresh=o<k$;for(let l of Object.keys(s)){if(l==="__metadata")continue;let c=s[l];if(typeof c.resolution=="undefined")throw new Error(`Assertionfailed:Expectedthelockfileentrytohavearesolutionfield(${l})`);let u=Hl(c.resolution,!0),g=new Ze;g.load(c,{yamlCompatibilityMode:!0});let f=g.version,h=g.languageName||r,p=c.linkType.toUpperCase(),d=(i=c.conditions)!=null?i:null,m=g.dependencies,I=g.peerDependencies,B=g.dependenciesMeta,b=g.peerDependenciesMeta,R=g.bin;if(c.checksum!=null){let L=typeof a!="undefined"&&!c.checksum.includes("/")?`${a}/${c.checksum}`:c.checksum;this.storedChecksums.set(u.locatorHash,L)}let H=_(P({},u),{version:f,languageName:h,linkType:p,conditions:d,dependencies:m,peerDependencies:I,dependenciesMeta:B,peerDependenciesMeta:b,bin:R});this.originalPackages.set(H.locatorHash,H);for(let L of l.split(sUe)){let K=pA(L);this.storedDescriptors.set(K.descriptorHash,K),this.storedResolutions.set(K.descriptorHash,u.locatorHash)}}}}}async setupWorkspaces(){this.workspaces=[],this.workspacesByCwd=new Map,this.workspacesByIdent=new Map;let e=[this.cwd];for(;e.length>0;){let r=e;e=[];for(let 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 Dd(e,{project:this});await r.setup();let i=this.workspacesByIdent.get(r.locator.identHash);if(typeof i!="undefined")throw new Error(`Duplicateworkspacename${Vr(this.configuration,r.locator)}:${M.fromPortablePath(e)}conflictswith${M.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){v.isAbsolute(e)||(e=v.resolve(this.cwd,e)),e=v.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)v.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(${Vr(this.configuration,e)})`);return r}tryWorkspaceByDescriptor(e){let r=this.tryWorkspaceByIdent(e);return r===null||(hA(e)&&(e=Ap(e)),!r.accepts(e.range))?null:r}getWorkspaceByDescriptor(e){let r=this.tryWorkspaceByDescriptor(e);if(r===null)throw new Error(`Workspacenotfound(${Xt(this.configuration,e)})`);return r}tryWorkspaceByLocator(e){let r=this.tryWorkspaceByIdent(e);return r===null||(Io(e)&&(e=lp(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(${lt(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${hp(this.configuration,e)}(${Ve(this.configuration,v.join(e.cwd,wt.manifest),Le.PATH)})tohavebeenresolved.Run"ya
`;break}let ae=null;if(!await T.mktempPromise(async De=>{let $=v.join(De,"build.log"),{stdout:G,stderr:Ce}=this.configuration.getSubprocessStreams($,{header:be,prefix:lt(this.configuration,he),report:r}),ee;try{switch(re){case Gn.SCRIPT:ee=await Uw(he,se,[],{cwd:qe,project:this,stdin:ae,stdout:G,stderr:Ce});break;case Gn.SHELLCODE:ee=await rD(he,se,[],{cwd:qe,project:this,stdin:ae,stdout:G,stderr:Ce});break}}catch(Oe){Ce.write(Oe.stack),ee=1}if(G.end(),Ce.end(),ee===0)return ne.set(he.locatorHash,Pe),!0;T.detachTemp(De);let Ue=`${lt(this.configuration,he)}couldn't be built successfully (exit code ${Ve(this.configuration,ee,Le.NUMBER)}, logs can be found here: ${Ve(this.configuration,$,Le.PATH)})`;return this.optionalBuilds.has(he.locatorHash)?(r.reportInfo(z.BUILD_FAILED,Ue),ne.set(he.locatorHash,Pe),!0):(r.reportError(z.BUILD_FAILED,Ue),!1)}))return}})())}}if(await Promise.all(F),X===b.size){let D=Array.from(b).map(he=>{let pe=this.storedPackages.get(he);if(!pe)throw new Error("Assertion failed: The package should have been registered");return lt(this.configuration,pe)}).join(", ");r.reportError(z.CYCLIC_DEPENDENCIES,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won'tbebuilt(affectedpackagesare:${D})`);break}}this.storedBuildState=ne}async install(e){var a,l;let r=this.configuration.get("nodeLinker");(a=fe.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=ki.Inactive;let i=v.join(this.cwd,this.configuration.get("lockfileFilename")),n=null;if(e.immutable)try{n=await T.readFilePromise(i,"utf8")}catch(c){throw c.code==="ENOENT"?new nt(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 f=Ve(this.configuration,g,Le.PACKAGE_EXTENSION);switch(g.status){case ki.Inactive:e.report.reportWarning(z.UNUSED_PACKAGE_EXTENSION,`${f}:Nomatchingpackageinthedependencytree;youmaynotneedthisruleanymore.`);break;case ki.Redundant:e.report.reportWarning(z.REDUNDANT_PACKAGE_EXTENSION,`${f}:Thisruleseemsredundantwhenappliedontheoriginalpackage;theextensionmayhavebeenappliedupstream.`);break}}if(n!==null){let c=ul(n,this.generateLockfile());if(c!==n){let u=(0,v$.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 f of g.lines)f.startsWith("+")?e.report.reportError(z.FROZEN_LOCKFILE_EXCEPTION,Ve(this.configuration,f,Le.ADDED)):f.startsWith("-")?e.report.reportError(z.FROZEN_LOCKFILE_EXCEPTION,Ve(this.configuration,f,Le.REMOVED)):e.report.reportInfo(null,Ve(this.configuration,f,"grey"))}throw e.report.reportSeparator(),new nt(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===ki.Active&&((l=fe.telemetry)==null||l.reportPackageExtension(Uu(g,Le.PACKAGE_EXTENSION)));await e.report.startTimerPromise("Fetch step",async()=>{await this.fetchEverything(e),(typeof e.persistProject=="undefined"||e.persistProject)&&e.mode!==li.UpdateLockfile&&await this.cacheCleanup(e)});let s=e.immutable?[...new Set(this.configuration.get("immutablePatterns"))].sort():[],o=await Promise.all(s.map(async c=>Iy(c,{cwd:this.cwd})));(typeof e.persistProject=="undefined"||e.persistProject)&&await this.p
`+Qa(r)}async persistLockfile(){let e=v.join(this.cwd,this.configuration.get("lockfileFilename")),r="";try{r=await T.readFilePromise(e,"utf8")}catch(s){}let i=this.generateLockfile(),n=ul(r,i);n!==r&&(await T.writeFilePromise(e,n),this.lockFileChecksum=D$(n),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let e=[];for(let o of Object.values(gF))e.push(...o);let r=(0,r0.default)(this,e),i=cF.default.serialize(r),n=zi(i);if(this.installStateChecksum===n)return;let s=this.configuration.get("installStatePath");await T.mkdirPromise(v.dirname(s),{recursive:!0}),await T.writeFilePromise(s,await aUe(i)),this.installStateChecksum=n}async restoreInstallState({restoreInstallersCustomData:e=!0,restoreResolutions:r=!0,restoreBuildState:i=!0}={}){let n=this.configuration.get("installStatePath");if(!T.existsSync(n)){r&&await this.applyLightResolution();return}let s=await AUe(await T.readFilePromise(n));this.installStateChecksum=zi(s);let o=cF.default.deserialize(s);e&&typeof o.installersCustomData!="undefined"&&(this.installersCustomData=o.installersCustomData),i&&Object.assign(this,(0,r0.default)(o,gF.restoreBuildState)),r&&(o.lockFileChecksum===this.lockFileChecksum?(Object.assign(this,(0,r0.default)(o,gF.restoreResolutions)),this.refreshWorkspaceDependencies()):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new ei}),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(!Fb(e.cwd,this.cwd)||!await T.existsPromise(e.cwd))return;let n=this.configuration.get("preferAggregateCacheInfo"),s=0,o=null;for(let a of await T.readdirPromise(e.cwd)){if(i.has(a))continue;let l=v.resolve(e.cwd,a);e.markedFiles.has(l)||(o=a,e.immutable?r.reportError(z.IMMUTABLE_CACHE,`${Ve(this.configuration,v.basename(l),"magenta")}appearstobeunusedandwouldbemarkedfordeletion,butthecacheisimmutable`):(n?s+=1:r.reportInfo(z.UNUSED_CACHE_ENTRY,`${Ve(this.configuration,v.basename(l),"magenta")}appearstobeunused-removing`),await T.removePromise(l)))}n&&s!==0&&r.reportInfo(z.UNUSED_CACHE_ENTRY,s>1?`${s}packagesappearedtobeunusedandwereremoved`:`${o}appearedtobeunusedandwasremoved`),e.markedFiles.clear()}};function lUe({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 ne;let u=new Map,g=[],f=new Map,h=new Map,p=new Map,d=new Map,m=new Map,I=new Map(t.workspaces.map(q=>{let A=q.anchoredLocator.locatorHash,V=i.get(A);if(typeof V=="undefined"){if(c)return[A,null];throw new Error("Assertion failed: The workspace should have an associated package")}return[A,ap(V)]})),B=()=>{let q=T.mktempSync(),A=v.join(q,"stacktrace.log"),V=String(g.length+1).length,W=g.map((X,F)=>`${`${F+1}.`.padStart(V," ")}${is(X)}
`).join("");throw T.writeFileSync(A,W),T.detachTemp(q),new nt(z.STACK_OVERFLOW_RESOLUTION,`Encounteredastackoverflowwhenresolvingpeerdependencies;cf${M.fromPortablePath(A)}`)},b=q=>{let A=r.get(q.descriptorHash);if(typeof A=="undefined")throw new Error("Assertion failed: The resolution should have been registered");let V=i.get(A);if(!V)throw new Error("Assertion failed: The package could not be found");return V},R=(q,A,V,{top:W,optional:X})=>{g.length>1e3&&B(),g.push(A);let F=H(q,A,V,{top:W,optional:X});return g.pop(),F},H=(q,A,V,{top:W,optional:X})=>{if(n.has(A.locatorHash))return;n.add(A.locatorHash),X||s.delete(A.locatorHash);let F=i.get(A.locatorHash);if(!F){if(c)return;throw new Error(`Assertionfailed:Thepackage(${lt(t.configuration,A)})shouldhavebeenregistered`)}let D=[],he=[],pe=[],Ne=[],Pe=[];for(let re of Array.from(F.dependencies.values())){if(F.peerDependencies.has(re.identHash)&&F.locatorHash!==W)continue;if(hA(re))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");o.delete(re.descriptorHash);let se=X;if(!se){let ee=F.dependenciesMeta.get(St(re));if(typeof ee!="undefined"){let Ue=ee.get(null);typeof Ue!="undefined"&&Ue.optional&&(se=!0)}}let be=r.get(re.descriptorHash);if(!be){if(c)continue;throw new Error(`Assertionfailed:Theresolution(${Xt(t.configuration,re)})shouldhavebeenregistered`)}let ae=I.get(be)||i.get(be);if(!ae)throw new Error(`Assertionfailed:Thepackage(${be},resolvedfrom${Xt(t.configuration,re)})shouldhavebeenregistered`);if(ae.peerDependencies.size===0){R(re,ae,new Map,{top:W,optional:se});continue}let Ae=u.get(ae.locatorHash);typeof Ae=="number"&&Ae>=2&&B();let De,$,G=new Set,Ce;he.push(()=>{De=kx(re,A.locatorHash),$=Px(ae,A.locatorHash),F.dependencies.delete(re.identHash),F.dependencies.set(De.identHash,De),r.set(De.descriptorHash,$.locatorHash),e.set(De.descriptorHash,De),i.set($.locatorHash,$),D.push([ae,De,$])}),pe.push(()=>{var ee;Ce=new Map;for(let Ue of $.peerDependencies.values()){let Oe=F.dependencies.get(Ue.identHash);if(!Oe&&cp(A,Ue)&&(Oe=q),(!Oe||Oe.range==="missing:")&&$.dependencies.has(Ue.identHash)){$.peerDependencies.delete(Ue.identHash);continue}Oe||(Oe=Yt(Ue,"missing:")),$.dependencies.set(Oe.identHash,Oe),hA(Oe)&&Pl(p,Oe.descriptorHash).add($.locatorHash),f.set(Oe.identHash,Oe),Oe.range==="missing:"&&G.add(Oe.identHash),Ce.set(Ue.identHash,(ee=V.get(Ue.identHash))!=null?ee:$.locatorHash)}$.dependencies=new Map(gn($.dependencies,([Ue,Oe])=>St(Oe)))}),Ne.push(()=>{if(!i.has($.locatorHash))return;let ee=u.get(ae.locatorHash),Ue=typeof ee!="undefined"?ee+1:1;u.set(ae.locatorHash,Ue),R(De,$,Ce,{top:W,optional:se}),u.set(ae.locatorHash,Ue-1)}),Pe.push(()=>{let ee=F.dependencies.get(re.identHash);if(typeof ee=="undefined")throw new Error("Assertion failed: Expected the peer dependency to have been turned into a dependency");let Ue=r.get(ee.descriptorHash);if(typeof Ue=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");if(Pl(m,Ue).add(A.locatorHash),!!i.has($.locatorHash)){for(let Oe of $.peerDependencies.values()){let vt=Ce.get(Oe.identHash);if(typeof vt=="undefined")throw new Error("Assertion failed: Expected the peer dependency ident to be registered");hu(pu(d,vt),St(Oe)).push($.locatorHash)}for(let Oe of G)$.dependencies.delete(Oe)}})}for(let re of[...he,...pe])re();let qe;do{qe=!0;for(let[re,se,be]of D){if(!i.has(be.locatorHash))continue;let ae=pu(h,re.locatorHash),Ae=zi(...[...be.dependencies.values()].map(Ce=>{let ee=Ce.range!=="missing:"?r.get(Ce.descriptorHash):"missing:";if(typeof ee=="undefined")throw new Error(`Assertionfailed:Expectedtheresolutionfor${Xt(t.configuration,Ce)}tohavebeenregistered`);return ee===W?`${ee}(top)`:ee}),se.identHash),De=ae.get(Ae);if(typeof De=="undefined"){ae.set(Ae,se);continue}if(De===se)continue;qe=!1,i.delete(be.locatorHash),e.delete(se.descriptorHash),r.delete(se.descriptorHash),n.delete(be.locatorHash);let $=p.get(se.descriptorHash)||[],G=[F.locatorHash,...$];p.delete(se.descriptorHash);for(let Ce
`),(await Fe.start({configuration:e,json:this.json,stdout:this.context.stdout,includeLogs:!this.context.quiet},async m=>{await r.install({cache:n,report:m,mode:this.mode})})).exitCode()}};cC.paths=[["add"]],cC.usage=ye.Usage({description:"add dependencies to the project",details:"\n This command adds a package to the package.json for the nearest workspace.\n\n - If it didn't exist before, the package will by default be added to the regular `dependencies` field, but this behavior can be overriden thanks to the `-D,--dev` flag (which will cause the dependency to be added to the `devDependencies` field instead) and the `-P,--peer` flag (which will do the same but for `peerDependencies`).\n\n - If the package was already listed in your dependencies, it will by default be upgraded whether it's part of your `dependencies` or `devDependencies` (it won't ever update `peerDependencies`, though).\n\n - If set, the `--prefer-dev` flag will operate as a more flexible `-D,--dev` in that it will add the package to your `devDependencies` if it isn't already listed in either `dependencies` or `devDependencies`, but it will also happily upgrade your `dependencies` if that's what you already use (whereas `-D,--dev` would throw an exception).\n\n - If set, the `-O,--optional` flag will add the package to the `optionalDependencies` field and, in combination with the `-P,--peer` flag, it will add the package as an optional peer dependency. If the package was already listed in your `dependencies`, it will be upgraded to `optionalDependencies`. If the package was already listed in your `peerDependencies`, in combination with the `-P,--peer` flag, it will be upgraded to an optional peer dependency: `\"peerDependenciesMeta\": { \"<package>\": { \"optional\": true } }`\n\n - If the added package doesn't specify a range at all its `latest` tag will be resolved and the returned version will be used to generate a new semver range (using the `^` modifier by default unless otherwise configured via the `defaultSemverRangePrefix` configuration, or the `~` modifier if `-T,--tilde` is specified, or no modifier at all if `-E,--exact` is specified). Two exceptions to this rule: the first one is that if the package is a workspace then its local version will be used, and the second one is that if you use `-P,--peer` the default range will be `*` and won't be resolved at all.\n\n - If the added package specifies a range (such as `^1.0.0`, `latest`, or `rc`), Yarn will add this range as-is in the resulting package.json entry (in particular, tags such as `rc` will be encoded as-is rather than being converted into a semver range).\n\n If the `--cached` option is used, Yarn will preferably reuse the highest version already used somewhere within the project, even if through a transitive dependency.\n\n If the `-i,--interactive` option is used (or if the `preferInteractive` settings is toggled on) the command will first try to check whether other workspaces in the project use the specified package and, if so, will offer to reuse them.\n\n If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n For a compilation of all the supported protocols, please consult the dedicated page from our website: https://yarnpkg.com/features/protocols.\n ",examples:[["Add a regular package to the current workspace","$0addlo
`),0}return(await Fe.start({configuration:e,json:this.json,stdout:this.context.stdout},async s=>{let o=await Kt.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:S.stringifyIdent(u),path:g});if(this.verbose)for(let[c,[u]]of o)s.reportInfo(null,`${c.padEnd(l," ")}${S.prettyLocator(e,u)}`);else for(let c of o.keys())s.reportInfo(null,c)})).exitCode()}};uC.paths=[["bin"]],uC.usage=ye.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 noe=uC;var gC=class extends Be{constructor(){super(...arguments);this.mirror=Y.Boolean("--mirror",!1,{description:"Remove the global cache files instead of the local cache files"});this.all=Y.Boolean("--all",!1,{description:"Remove both the global cache files and the local cache files of the current project"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),r=await Qt.find(e);return(await Fe.start({configuration:e,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&r.mirrorCwd!==null,s=!this.mirror;n&&(await T.removePromise(r.mirrorCwd),await e.triggerHook(o=>o.cleanGlobalArtifacts,e)),s&&await T.removePromise(r.cwd)})).exitCode()}};gC.paths=[["cache","clean"],["cache","clear"]],gC.usage=ye.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 soe=gC;var ooe=ie(p0()),KN=ie(require("util")),fC=class extends Be{constructor(){super(...arguments);this.json=Y.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.unsafe=Y.Boolean("--no-redacted",!1,{description:"Don't redact secrets (such as tokens) from the output"});this.name=Y.String()}async execute(){let e=await fe.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,ooe.default)(o,i):o,l=await Fe.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}
`,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 aoe=fC;var Eae=ie(qN()),Iae=ie(p0()),yae=ie(mae()),JN=ie(require("util")),pC=class extends Be{constructor(){super(...arguments);this.json=Y.Boolean("--json",!1,{description:"Set complex configuration settings to JSON values"});this.home=Y.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=Y.String();this.value=Y.String()}async execute(){let e=await fe.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't find a configuration settings named "${i}"`);if(i==="enableStrictSettings")throw new me("This setting only affects the file it'sin,andthuscannotbesetfromtheCLI");let o=this.json?JSON.parse(this.value):this.value;await(this.home?h=>fe.updateHomeConfiguration(h):h=>fe.updateConfiguration(r(),h))(h=>{if(n){let p=(0,Eae.default)(h);return(0,yae.default)(p,this.name,o),p}else return _(P({},h),{[i]:o})});let c=(await fe.find(this.context.cwd,this.context.plugins)).getSpecial(i,{hideSecrets:!0,getNativePaths:!0}),u=de.convertMapsToIndexableObjects(c),g=n?(0,Iae.default)(u,n):u;return(await Fe.start({configuration:e,includeFooter:!1,stdout:this.context.stdout},async h=>{JN.inspect.styles.name="cyan",h.reportInfo(z.UNNAMED,`Successfully set ${this.name} to ${(0,JN.inspect)(g,{depth:Infinity,colors:e.get("enableColors"),compact:!1})}`)})).exitCode()}};pC.paths=[["config","set"]],pC.usage=ye.Usage({description:"changeaconfigurationsettings",details:`
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 wae=pC;var Dae=ie(qN()),Rae=ie(Ld()),Fae=ie(Pae()),dC=class extends Be{constructor(){super(...arguments);this.home=Y.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=Y.String()}async execute(){let e=await fe.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't find a configuration settings named "${i}"`);let o=this.home?l=>fe.updateHomeConfiguration(l):l=>fe.updateConfiguration(r(),l);return(await Fe.start({configuration:e,includeFooter:!1,stdout:this.context.stdout},async l=>{let c=!1;await o(u=>{if(!(0,Rae.default)(u,this.name))return l.reportWarning(z.UNNAMED,`Configuration doesn'tcontainsetting${this.name};thereisnothingtounset`),c=!0,u;let g=n?(0,Dae.default)(u):P({},u);return(0,Fae.default)(g,this.name),g}),c||l.reportInfo(z.UNNAMED,`Successfullyunset${this.name}`)})).exitCode()}};dC.paths=[["config","unset"]],dC.usage=ye.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 Nae=dC;var WN=ie(require("util")),CC=class extends Be{constructor(){super(...arguments);this.verbose=Y.Boolean("-v,--verbose",!1,{description:"Print the setting description on top of the regular key/value information"});this.why=Y.Boolean("--why",!1,{description:"Print the reason why a setting is set a particular way"});this.json=Y.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins,{strict:!1});return(await Fe.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,WN.inspect)(e.getSpecial(c,{hideSecrets:!0,getNativePaths:!0}),o)}`)}else for(let a of n)i.reportInfo(null,`${a.padEnd(s," ")}${(0,WN.inspect)(e.getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),o)}`)}})).exitCode()}};CC.paths=[["config"]],CC.usage=ye.Usage({description:"display the current configuration",details:`
`,examples:[["Execute a single shell command","$0 exec echo Hello World"],["Execute a shell script",'$0 exec "tsc & babel src --out-dir lib"']]});var Yae=EC;Ss();var IC=class extends Be{constructor(){super(...arguments);this.hash=Y.String({required:!1,validator:fv(gv(),[hv(/^p[0-9a-f]{5}$/)])})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r}=await Ke.find(e,this.context.cwd);return await r.restoreInstallState({restoreResolutions:!1}),await r.applyLightResolution(),typeof this.hash!="undefined"?await j4e(this.hash,r,{stdout:this.context.stdout}):(await Fe.start({configuration:e,stdout:this.context.stdout,includeFooter:!1},async n=>{var o;let s=[([,a])=>S.stringifyLocator(r.storedPackages.get(a.subject)),([,a])=>S.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,f=ue.pretty(e,a,ue.Type.CODE),h=S.prettyLocator(e,c),p=S.prettyIdent(e,l.requested),d=S.prettyIdent(e,u),m=l.allRequesters.length-1,I=`descendant${m===1?"":"s"}`,B=m>0?`and${m}${I}`:"",b=g!==null?"provides":"doesn't provide";n.reportInfo(null,`${f}\u2192${h}${b}${p}to${d}${B}`)}})).exitCode()}};IC.paths=[["explain","peer-requirements"]],IC.usage=ye.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 qae=IC;async function j4e(t,e,r){let{configuration:i}=e,n=e.peerRequirements.get(t);if(typeof n=="undefined")throw new Error(`NopeerDependencyrequirementsfoundforhash:"${t}"`);return(await Fe.start({configuration:i,stdout:r.stdout,includeFooter:!1},async o=>{var I,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=(I=a.dependencies.get(n.requested.identHash))!=null?I: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 f=[...n.allRequesters.values()].map(b=>{let R=e.storedPackages.get(b);if(typeof R=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let H=S.devirtualizeLocator(R),L=e.storedPackages.get(H.locatorHash);if(typeof L=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let K=L.peerDependencies.get(n.requested.identHash);if(typeof K=="undefined")throw new Error("Assertion failed: Expected the peer dependency to be registered");return{pkg:R,peerDependency:K}});if(g!==null){let b=f.every(({peerDependency:R})=>qt.satisfiesWithPrereleases(g.version,R.range));o.reportInfo(z.UNNAMED,`${S.prettyLocator(i,a)}provides${S.prettyLocator(i,g)}withversion${S.prettyReference(i,(B=g.version)!=null?B:"<missing>")},which${b?"satisfies":"doesn't satisfy"}thefollowingrequirements:`)}else o.reportInfo(z.UNNAMED,`${S.prettyLocator(i,a)}doesn'tprovide${S.prettyIdent(i,n.requested)},breakingthefollowingrequirements:`);o.reportSeparator();let h=ue.mark(i),p=[];for(let{pkg:b,peerDependency:R}of de.sortMap(f,H=>S.stringifyLocator(H.pkg))){let L=(g!==null?qt.satisfiesWithPrereleases(g.version,R.range):!1)?h.Check:h.Cross;p.push({stringifiedLocator:S.stringifyLocator(b),prettyLocator:S.prettyLocator(i,b),prettyRange:S.prettyRange(i,R.range),mark:L})}let d=Math.max(...p.map(({stringifiedLocator:b})=>b.length)),m=Math.max(...p.map(({prettyRange:b})=>b.length));for(let{stringifiedLocator:b,prettyLocator:R,prettyRange:H,mark:L}of de.sortMap(p,({stringifiedLocator:K})=>K))o.reportInfo(null,`${R.padEnd(d+(R.length-b.length)," ")}\u2192${H.padEnd(m," ")}${L}`);p.length>1&&(o.reportSeparator(),o.reportInfo(z.UNNAMED,`Note:theserequirementsstartwith${S.prettyLocator(e.configuration,l)}`))})).exitCode()}var Jae=ie(Nn()),yC=class extends Be{constructor(){super(...arguments);this.all=Y.Boolean("-A,--all",!1,{description:"Print versions of a package from the whole project"});this.recursive=Y.Boolean("-R,--recursive",!1,{description:"Print information for all packages, including transitive dependencies"});this.extra=Y.Array("-X,--extra",[],{description:"An array of requests of extra data provided by plugins"});this.cache=Y.Boolean("--cache",!1,{description:"Print information about the cache entry of a package (path, size, checksum)"});this.dependents=Y.Boolean("--dependents",!1,{description:"Print all dependents for each matching package"});this.manifest=Y.Boolean("--manifest",!1,{description:"Print data obtained by looking at the package archive (license, homepage, ...)"});this.nameOnly=Y.Boolean("--name-only",!1,{description:"Only print the name for the matching packages"});this.virtuals=Y.Boolean("--virtuals",!1,{description:"Print each instance of the virtual packages"});this.json=Y.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=Y.Rest()}async execute(){let e=await fe.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 the cache files are stored).
-**Build:**Oncethedependencytreehasbeenwrittenonthedisk,thepackagemanagerwillnowbefreetorunthebuildscriptsforallpackagesthatmightneedit,inatopologicalordercompatiblewiththewaytheydependononeanother.Seehttps://yarnpkg.com/advanced/lifecycle-scripts for detail.
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\`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
-\`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
-\`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
`,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 zae=wC,q4e="|||||||",J4e=">>>>>>>",W4e="=======",Vae="<<<<<<<";async function Y4e(t,e){if(!t.projectCwd)return!1;let r=v.join(t.projectCwd,t.get("lockfileFilename"));if(!await T.existsPromise(r))return!1;let i=await T.readFilePromise(r,"utf8");if(!i.includes(Vae))return!1;if(e)throw new nt(z.AUTOMERGE_IMMUTABLE,"Cannot autofix a lockfile when running an immutable install");let[n,s]=z4e(i),o,a;try{o=Ii(n),a=Ii(s)}catch(c){throw new nt(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 T.changeFilePromise(r,Qa(l),{automaticNewlines:!0}),!0}function z4e(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(Vae)){for(;r.length>0;){let s=r.shift();if(typeof s=="undefined")throw new Error("Assertion failed: Some lines should remain");if(s===W4e){i=!1;break}else if(i||s.startsWith(q4e)){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(J4e))break;e[1].push(s)}}else e[0].push(n),e[1].push(n)}return[e[0].join(`
`)]}var BC=class extends Be{constructor(){super(...arguments);this.all=Y.Boolean("-A,--all",!1,{description:"Link all workspaces belonging to the target project to the current one"});this.private=Y.Boolean("-p,--private",!1,{description:"Also link private workspaces belonging to the target project to the current one"});this.relative=Y.Boolean("-r,--relative",!1,{description:"Link workspaces using relative paths instead of absolute paths"});this.destination=Y.String()}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd),n=await Qt.find(e);if(!i)throw new rt(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=v.resolve(this.context.cwd,M.toPortablePath(this.destination)),o=await fe.find(s,this.context.plugins,{useRc:!1,strict:!1}),{project:a,workspace:l}=await Ke.find(o,s);if(r.cwd===a.cwd)throw new me("Invalid destination; Can't link the project to itself");if(!l)throw new rt(a.cwd,s);let c=r.topLevelWorkspace,u=[];if(this.all){for(let f of a.workspaces)f.manifest.name&&(!f.manifest.private||this.private)&&u.push(f);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 f of u){let h=S.stringifyIdent(f.locator),p=this.relative?v.relative(r.cwd,f.cwd):f.cwd;c.manifest.resolutions.push({pattern:{descriptor:{fullName:h}},reference:`portal:${p}`})}return(await Fe.start({configuration:e,stdout:this.context.stdout},async f=>{await r.install({cache:n,report:f})})).exitCode()}};BC.paths=[["link"]],BC.usage=ye.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 _ae=BC;var QC=class extends Be{constructor(){super(...arguments);this.args=Y.Proxy()}async execute(){return this.cli.run(["exec","node",...this.args])}};QC.paths=[["node"]],QC.usage=ye.Usage({description:"run node with the hook already setup",details:`
`,examples:[["Run a Node script","$0 node ./my-script.js"]]});var Xae=QC;var lAe=ie(require("os"));var rAe=ie(require("os"));var V4e="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function Kc(t){let e=await Zt.get(V4e,{configuration:t});return Ii(e.toString())}var bC=class extends Be{constructor(){super(...arguments);this.json=Y.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins);return(await Fe.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{let n=await Kc(e);for(let s of Object.entries(n)){let[l,o]=s,a=o,{experimental:c}=a,u=qr(a,["experimental"]);let g=l;c&&(g+=" [experimental]"),i.reportJson(P({name:l,experimental:c},u)),i.reportInfo(null,g)}})).exitCode()}};bC.paths=[["plugin","list"]],bC.usage=ye.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 Zae=bC;var $ae=ie(Or()),vC=class extends Be{constructor(){super(...arguments);this.onlyIfNeeded=Y.Boolean("--only-if-needed",!1,{description:"Only lock the Yarn version if it isn't already locked"});this.version=Y.String()}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins);if(e.get("yarnPath")&&this.onlyIfNeeded)return 0;let r=()=>{if(typeof Zr=="undefined")throw new me("The --install flag can only be used without explicit version specifier from the Yarn CLI");return`file://${process.argv[1]}`},i;if(this.version==="self")i=r();else if(this.version==="latest"||this.version==="berry"||this.version==="stable")i=`https://repo.yarnpkg.com/${await eAe(e,"stable")}/packages/yarnpkg-cli/bin/yarn.js`;else if(this.version==="canary")i=`https://repo.yarnpkg.com/${await eAe(e,"canary")}/packages/yarnpkg-cli/bin/yarn.js`;else if(this.version==="classic")i="https://nightly.yarnpkg.com/latest.js";else if(this.version.match(/^\.{0,2}[\\/]/)||M.isAbsolute(this.version))i=`file://${M.resolve(this.version)}`;else if(qt.satisfiesWithPrereleases(this.version,">=2.0.0"))i=`https://repo.yarnpkg.com/${this.version}/packages/yarnpkg-cli/bin/yarn.js`;else if(qt.satisfiesWithPrereleases(this.version,"^0.x || ^1.x"))i=`https://github.com/yarnpkg/yarn/releases/download/v${this.version}/yarn-${this.version}.js`;else if(qt.validRange(this.version))i=`https://repo.yarnpkg.com/${await _4e(e,this.version)}/packages/yarnpkg-cli/bin/yarn.js`;else throw new me(`Invalid version descriptor "${this.version}"`);return(await Fe.start({configuration:e,stdout:this.context.stdout,includeLogs:!this.context.quiet},async s=>{let o="file://",a;i.startsWith(o)?(s.reportInfo(z.UNNAMED,`Downloading ${ue.pretty(e,i,ps.URL)}`),a=await T.readFilePromise(M.toPortablePath(i.slice(o.length)))):(s.reportInfo(z.UNNAMED,`Retrieving ${ue.pretty(e,i,ps.PATH)}`),a=await Zt.get(i,{configuration:e})),await XN(e,null,a,{report:s})})).exitCode()}};vC.paths=[["set","version"]],vC.usage=ye.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\n The version specifier can be:\n\n - a tag:\n - `latest` / `berry` / `stable` -> the most recent stable berry (`>=2.0.0`) release\n - `canary` -> the most recent canary (release
`;await T.changeFilePromise(p,d,{automaticNewlines:!0})}}var X4e=/^[0-9]+$/;function iAe(t){return X4e.test(t)?`pull/${t}/head`:t}var Z4e=({repository:t,branch:e},r)=>[["git","init",M.fromPortablePath(r)],["git","remote","add","origin",t],["git","fetch","origin",iAe(e)],["git","reset","--hard","FETCH_HEAD"]],$4e=({branch:t})=>[["git","fetch","origin",iAe(t),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx"]],eze=({plugins:t,noMinify:e},r)=>[["yarn","build:cli",...new Array().concat(...t.map(i=>["--plugin",v.resolve(r,i)])),...e?["--no-minify"]:[],"|"]],SC=class extends Be{constructor(){super(...arguments);this.installPath=Y.String("--path",{description:"The path where the repository should be cloned to"});this.repository=Y.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=Y.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.plugins=Y.Array("--plugin",[],{description:"An array of additional plugins that should be included in the bundle"});this.noMinify=Y.Boolean("--no-minify",!1,{description:"Build a bundle for development (debugging) - non-minified and non-mangled"});this.force=Y.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.skipPlugins=Y.Boolean("--skip-plugins",!1,{description:"Skip updating the contrib plugins"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r}=await Ke.find(e,this.context.cwd),i=typeof this.installPath!="undefined"?v.resolve(this.context.cwd,M.toPortablePath(this.installPath)):v.resolve(M.toPortablePath((0,rAe.tmpdir)()),"yarnpkg-sources",mn.makeHash(this.repository).slice(0,6));return(await Fe.start({configuration:e,stdout:this.context.stdout},async s=>{await $N(this,{configuration:e,report:s,target:i}),s.reportSeparator(),s.reportInfo(z.UNNAMED,"Building a fresh bundle"),s.reportSeparator(),await xC(eze(this,i),{configuration:e,context:this.context,target:i}),s.reportSeparator();let o=v.resolve(i,"packages/yarnpkg-cli/bundles/yarn.js"),a=await T.readFilePromise(o);await XN(e,"sources",a,{report:s}),this.skipPlugins||await tze(this,{project:r,report:s,target:i})})).exitCode()}};SC.paths=[["set","version","from","sources"]],SC.usage=ye.Usage({description:"build Yarn from master",details:`
`,examples:[["Build Yarn from master","$0 set version from sources"]]});var nAe=SC;async function xC(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 hr.pipevp(n,s,{cwd:i,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,strict:!0});else{r.stdout.write(`${ue.pretty(e,`$${[n,...s].join(" ")}`,"grey")}
`);try{await hr.execvp(n,s,{cwd:i,strict:!0})}catch(a){throw r.stdout.write(a.stdout||a.stack),a}}}}async function $N(t,{configuration:e,report:r,target:i}){let n=!1;if(!t.force&&T.existsSync(v.join(i,".git"))){r.reportInfo(z.UNNAMED,"Fetching the latest commits"),r.reportSeparator();try{await xC($4e(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 T.removePromise(i),await T.mkdirPromise(i,{recursive:!0}),await xC(Z4e(t,i),{configuration:e,context:t.context,target:i}))}async function tze(t,{project:e,report:r,target:i}){let n=await Kc(e.configuration),s=new Set(Object.keys(n));for(let o of e.configuration.plugins.keys())!s.has(o)||await ZN(o,t,{project:e,report:r,target:i})}var sAe=ie(Or()),oAe=ie(require("url")),aAe=ie(require("vm"));var kC=class extends Be{constructor(){super(...arguments);this.name=Y.String()}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins);return(await Fe.start({configuration:e,stdout:this.context.stdout},async i=>{let{project:n}=await Ke.find(e,this.context.cwd),s,o;if(this.name.match(/^\.{0,2}[\\/]/)||M.isAbsolute(this.name)){let a=v.resolve(this.context.cwd,M.toPortablePath(this.name));i.reportInfo(z.UNNAMED,`Reading${ue.pretty(e,a,ue.Type.PATH)}`),s=v.relative(n.cwd,a),o=await T.readFilePromise(a)}else{let a;if(this.name.match(/^https?:/)){try{new oAe.URL(this.name)}catch{throw new nt(z.INVALID_PLUGIN_REFERENCE,`Pluginspecifier"${this.name}"isneitherapluginnamenoravalidurl`)}s=this.name,a=this.name}else{let l=S.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(l.reference!=="unknown"&&!sAe.default.valid(l.reference))throw new nt(z.UNNAMED,"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.");let c=S.stringifyIdent(l),u=await Kc(e);if(!Object.prototype.hasOwnProperty.call(u,c))throw new nt(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}/`):Zr!==null&&(a=a.replace(/\/master\//,`/@yarnpkg/cli/${Zr}/`))}i.reportInfo(z.UNNAMED,`Downloading ${ue.pretty(e,a,"green")}`),o=await Zt.get(a,{configuration:e})}await eL(s,o,{project:n,report:i})})).exitCode()}};kC.paths=[["plugin","import"]],kC.usage=ye.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 AAe=kC;async function eL(t,e,{project:r,report:i}){let{configuration:n}=r,s={},o={exports:s};(0,aAe.runInNewContext)(e.toString(),{module:o,exports:s});let a=o.exports.name,l=`.yarn/plugins/${a}.cjs`,c=v.resolve(r.cwd,l);i.reportInfo(z.UNNAMED,`Savingthenewpluginin${ue.pretty(n,l,"magenta")}`),await T.mkdirPromise(v.dirname(c),{recursive:!0}),await T.writeFilePromise(c,e);let u={path:l,spec:t};await fe.updateConfiguration(r.cwd,g=>{let f=[],h=!1;for(let p of g.plugins||[]){let d=typeof p!="string"?p.path:p,m=v.resolve(r.cwd,M.toPortablePath(d)),{name:I}=de.dynamicRequire(m);I!==a?f.push(p):(f.push(u),h=!0)}return h||f.push(u),_(P({},g),{plugins:f})})}var rze=({pluginName:t,noMinify:e},r)=>[["yarn",`build:${t}`,...e?["--no-minify"]:[],"|"]],PC=class extends Be{constructor(){super(...arguments);this.installPath=Y.String("--path",{description:"The path where the repository should be cloned to"});this.repository=Y.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=Y.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.noMinify=Y.Boolean("--no-minify",!1,{description:"Build a plugin for development (debugging) - non-minified and non-mangled"});this.force=Y.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.name=Y.String()}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),r=typeof this.installPath!="undefined"?v.resolve(this.context.cwd,M.toPortablePath(this.installPath)):v.resolve(M.toPortablePath((0,lAe.tmpdir)()),"yarnpkg-sources",mn.makeHash(this.repository).slice(0,6));return(await Fe.start({configuration:e,stdout:this.context.stdout},async n=>{let{project:s}=await Ke.find(e,this.context.cwd),o=S.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),a=S.stringifyIdent(o),l=await Kc(e);if(!Object.prototype.hasOwnProperty.call(l,a))throw new nt(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 $N(this,{configuration:e,report:n,target:r}),await ZN(c,this,{project:s,report:n,target:r})})).exitCode()}};PC.paths=[["plugin","import","from","sources"]],PC.usage=ye.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 uAe=DC;var RC=class extends Be{constructor(){super(...arguments);this.json=Y.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins);return(await Fe.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()}};RC.paths=[["plugin","runtime"]],RC.usage=ye.Usage({category:"Plugin-related commands",description:"list the active plugins",details:`
`,examples:[["List the currently active plugins","$0 plugin runtime"]]});var gAe=RC;var FC=class extends Be{constructor(){super(...arguments);this.idents=Y.Rest()}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd),n=await Qt.find(e);if(!i)throw new rt(r.cwd,this.context.cwd);let s=new Set;for(let a of this.idents)s.add(S.parseIdent(a).identHash);if(await r.restoreInstallState({restoreResolutions:!1}),await r.resolveEverything({cache:n,report:new ei}),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 Fe.start({configuration:e,stdout:this.context.stdout,includeLogs:!this.context.quiet},async a=>{await r.install({cache:n,report:a})})).exitCode()}};FC.paths=[["rebuild"]],FC.usage=ye.Usage({description:"rebuild the project's native packages",details:`
`,examples:[["Rebuild all packages","$0 rebuild"],["Rebuild fsevents only","$0 rebuild fsevents"]]});var fAe=FC;var tL=ie(Nn());Ss();var NC=class extends Be{constructor(){super(...arguments);this.all=Y.Boolean("-A,--all",!1,{description:"Apply the operation to all workspaces from the current project"});this.mode=Y.String("--mode",{description:"Change what artifacts installs generate",validator:Yi(li)});this.patterns=Y.Rest()}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd),n=await Qt.find(e);if(!i)throw new rt(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=this.all?r.workspaces:[i],o=[vr.REGULAR,vr.DEVELOPMENT,vr.PEER],a=[],l=!1,c=[];for(let h of this.patterns){let p=!1,d=S.parseIdent(h);for(let m of s){let I=[...m.manifest.peerDependenciesMeta.keys()];for(let B of(0,tL.default)(I,h))m.manifest.peerDependenciesMeta.delete(B),l=!0,p=!0;for(let B of o){let b=m.manifest.getForScope(B),R=[...b.values()].map(H=>S.stringifyIdent(H));for(let H of(0,tL.default)(R,S.stringifyIdent(d))){let{identHash:L}=S.parseIdent(H),K=b.get(L);if(typeof K=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");m.manifest[B].delete(L),c.push([m,B,K]),l=!0,p=!0}}}p||a.push(h)}let u=a.length>1?"Patterns":"Pattern",g=a.length>1?"don't":"doesn't",f=this.all?"any":"this";if(a.length>0)throw new me(`${u}${ue.prettyList(e,a,ps.CODE)}${g}matchanypackagesreferencedby${f}workspace`);return l?(await e.triggerMultipleHooks(p=>p.afterWorkspaceDependencyRemoval,c),(await Fe.start({configuration:e,stdout:this.context.stdout},async p=>{await r.install({cache:n,report:p,mode:this.mode})})).exitCode()):0}};NC.paths=[["remove"]],NC.usage=ye.Usage({description:"remove dependencies from the project",details:`
Ifthe\`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
-\`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
-\`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
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 hAe=NC;var pAe=ie(require("util")),z0=class extends Be{async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd);if(!i)throw new rt(r.cwd,this.context.cwd);return(await Fe.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,pAe.inspect)(g,l)}`)})).exitCode()}};z0.paths=[["run"]];var dAe=z0;var LC=class extends Be{constructor(){super(...arguments);this.inspect=Y.String("--inspect",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.inspectBrk=Y.String("--inspect-brk",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.topLevel=Y.Boolean("-T,--top-level",!1,{description:"Check the root workspace for scripts and/or binaries instead of the current one"});this.binariesOnly=Y.Boolean("-B,--binaries-only",!1,{description:"Ignore any user defined scripts and only check for binaries"});this.silent=Y.Boolean("--silent",{hidden:!0});this.scriptName=Y.String();this.args=Y.Proxy()}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i,locator:n}=await Ke.find(e,this.context.cwd);await r.restoreInstallState();let s=this.topLevel?r.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await Kt.hasPackageScript(s,this.scriptName,{project:r}))return await Kt.executePackageScript(s,this.scriptName,this.args,{project:r,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let o=await Kt.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 Kt.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 Kt.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 ${S.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 ${S.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 Yg)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}",butamatchin
`,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 CAe=LC;var TC=class extends Be{constructor(){super(...arguments);this.save=Y.Boolean("-s,--save",!1,{description:"Persist the resolution inside the top-level manifest"});this.descriptor=Y.String();this.resolution=Y.String()}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd),n=await Qt.find(e);if(await r.restoreInstallState({restoreResolutions:!1}),!i)throw new rt(r.cwd,this.context.cwd);let s=S.parseDescriptor(this.descriptor,!0),o=S.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 Fe.start({configuration:e,stdout:this.context.stdout},async l=>{await r.install({cache:n,report:l})})).exitCode()}};TC.paths=[["set","resolution"]],TC.usage=ye.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 mAe=TC;var EAe=ie(Nn()),MC=class extends Be{constructor(){super(...arguments);this.all=Y.Boolean("-A,--all",!1,{description:"Unlink all workspaces belonging to the target project from the current one"});this.leadingArguments=Y.Rest()}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd),n=await Qt.find(e);if(!i)throw new rt(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=v.resolve(this.context.cwd,M.toPortablePath(l));if(de.isPathLike(l)){let u=await fe.find(c,this.context.plugins,{useRc:!1,strict:!1}),{project:g,workspace:f}=await Ke.find(u,c);if(!f)throw new rt(g.cwd,c);if(this.all){for(let h of g.workspaces)h.manifest.name&&o.add(S.stringifyIdent(h.locator));if(o.size===0)throw new me("No workspace found to be unlinked in the target project")}else{if(!f.manifest.name)throw new me("The target workspace doesn't have a name and thus cannot be unlinked");o.add(S.stringifyIdent(f.locator))}}else{let u=[...s.manifest.resolutions.map(({pattern:g})=>g.descriptor.fullName)];for(let g of(0,EAe.default)(u,l))o.add(g)}}return s.manifest.resolutions=s.manifest.resolutions.filter(({pattern:l})=>!o.has(l.descriptor.fullName)),(await Fe.start({configuration:e,stdout:this.context.stdout},async l=>{await r.install({cache:n,report:l})})).exitCode()}};MC.paths=[["unlink"]],MC.usage=ye.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 IAe=MC;var yAe=ie(aC()),rL=ie(Nn());Ss();var uf=class extends Be{constructor(){super(...arguments);this.interactive=Y.Boolean("-i,--interactive",{description:"Offer various choices, depending on the detected upgrade paths"});this.exact=Y.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=Y.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=Y.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.recursive=Y.Boolean("-R,--recursive",!1,{description:"Resolve again ALL resolutions for those packages"});this.mode=Y.String("--mode",{description:"Change what artifacts installs generate",validator:Yi(li)});this.patterns=Y.Rest()}async execute(){return this.recursive?await this.executeUpRecursive():await this.executeUpClassic()}async executeUpRecursive(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd),n=await Qt.find(e);if(!i)throw new rt(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=[...r.storedDescriptors.values()],o=s.map(u=>S.stringifyIdent(u)),a=new Set;for(let u of this.patterns){if(S.parseDescriptor(u).range!=="unknown")throw new me("Ranges aren't allowed when using --recursive");for(let g of(0,rL.default)(o,u)){let f=S.parseIdent(g);a.add(f.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 Fe.start({configuration:e,stdout:this.context.stdout},async u=>{await r.install({cache:n,report:u})})).exitCode()}async executeUpClassic(){var d;let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd),n=await Qt.find(e);if(!i)throw new rt(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=(d=this.interactive)!=null?d:e.get("preferInteractive"),o=AC(this,r),a=s?[Fr.KEEP,Fr.REUSE,Fr.PROJECT,Fr.LATEST]:[Fr.PROJECT,Fr.LATEST],l=[],c=[];for(let m of this.patterns){let I=!1,B=S.parseDescriptor(m);for(let b of r.workspaces)for(let R of[vr.REGULAR,vr.DEVELOPMENT]){let L=[...b.manifest.getForScope(R).values()].map(K=>S.stringifyIdent(K));for(let K of(0,rL.default)(L,S.stringifyIdent(B))){let J=S.parseIdent(K),ne=b.manifest[R].get(J.identHash);if(typeof ne=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");let q=S.makeDescriptor(J,B.range);l.push(Promise.resolve().then(async()=>[b,R,ne,await lC(q,{project:r,workspace:b,cache:n,target:R,modifier:o,strategies:a})])),I=!0}}I||c.push(m)}if(c.length>1)throw new me(`Patterns${ue.prettyList(e,c,ps.CODE)}don't match any packages referenced by any workspace`);if(c.length>0)throw new me(`Pattern ${ue.prettyList(e,c,ps.CODE)} doesn'tmatchanypackagesreferencedbyanyworkspace`);let u=await Promise.all(l),g=await Fa.start({configuration:e,stdout:this.context.stdout,suggestInstall:!1},async m=>{for(let[,,I,{suggestions:B,rejections:b}]of u){let R=B.filter(H=>H.descriptor!==null);if(R.length===0){let[H]=b;if(typeof H=="undefined")throw new Error("Assertion failed: Expected an error to have been set");let L=this.cli.error(H);r.configuration.get("enableNetwork")?m.reportError(z.CANT_SUGGEST_RESOLUTIONS,`${S.prettyDescriptor(e,I)}can'tberesolvedtoasatisfyingrange
${L}`)}else R.length>1&&!s&&m.reportError(z.CANT_SUGGEST_RESOLUTIONS,`${S.prettyDescriptor(e,I)}hasmultiplepossibleupgradestrategies;use-itodisambiguatemanually`)}});if(g.hasErrors())return g.exitCode();let f=!1,h=[];for(let[m,I,,{suggestions:B}]of u){let b,R=B.filter(J=>J.descriptor!==null),H=R[0].descriptor,L=R.every(J=>S.areDescriptorsEqual(J.descriptor,H));R.length===1||L?b=H:(f=!0,{answer:b}=await(0,yAe.prompt)({type:"select",name:"answer",message:`Whichrangetoyouwanttousein${S.prettyWorkspace(e,m)}\u276F${I}?`,choices:B.map(({descriptor:J,name:ne,reason:q})=>J?{name:ne,hint:q,descriptor:J}:{name:ne,hint:q,disabled:!0}),onCancel:()=>process.exit(130),result(J){return this.find(J,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let K=m.manifest[I].get(b.identHash);if(typeof K=="undefined")throw new Error("Assertion failed: This descriptor should have a matching entry");if(K.descriptorHash!==b.descriptorHash)m.manifest[I].set(b.identHash,b),h.push([m,I,K,b]);else{let J=e.makeResolver(),ne={project:r,resolver:J},q=J.bindDescriptor(K,m.anchoredLocator,ne);r.forgetResolution(q)}}return await e.triggerMultipleHooks(m=>m.afterWorkspaceDependencyReplacement,h),f&&this.context.stdout.write(`
`),(await Fe.start({configuration:e,stdout:this.context.stdout},async m=>{await r.install({cache:n,report:m,mode:this.mode})})).exitCode()}};uf.paths=[["up"]],uf.usage=ye.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 If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n Generally you can see `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'"]]}),uf.schema=[pv("recursive",Bl.Forbids,["interactive","exact","tilde","caret"],{ignore:[void 0,!1]})];var wAe=uf;var OC=class extends Be{constructor(){super(...arguments);this.recursive=Y.Boolean("-R,--recursive",!1,{description:"List, for each workspace, what are all the paths that lead to the dependency"});this.json=Y.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.peers=Y.Boolean("--peers",!1,{description:"Also print the peer dependencies that match the specified name"});this.package=Y.String()}async execute(){let e=await fe.find(this.context.cwd,this.c
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 BAe=OC;function ize(t,e,{configuration:r,peers:i}){let n=de.sortMap(t.storedPackages.values(),a=>S.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 f=t.storedPackages.get(g);if(!f)throw new Error("Assertion failed: The package should have been registered");if(f.identHash!==e)continue;if(c===null){let p=S.stringifyLocator(a);s[p]={value:[a,ue.Type.LOCATOR],children:l}}let h=S.stringifyLocator(f);l[h]={value:[{descriptor:u,locator:f},ue.Type.DEPENDENT]}}}return o}function nze(t,e,{configuration:r,peers:i}){let n=de.sortMap(t.workspaces,f=>S.stringifyLocator(f.anchoredLocator)),s=new Set,o=new Set,a=f=>{if(s.has(f.locatorHash))return o.has(f.locatorHash);if(s.add(f.locatorHash),f.identHash===e)return o.add(f.locatorHash),!0;let h=!1;f.identHash===e&&(h=!0);for(let p of f.dependencies.values()){if(!i&&f.peerDependencies.has(p.identHash))continue;let d=t.storedResolutions.get(p.descriptorHash);if(!d)throw new Error("Assertion failed: The resolution should have been registered");let m=t.storedPackages.get(d);if(!m)throw new Error("Assertion failed: The package should have been registered");a(m)&&(h=!0)}return h&&o.add(f.locatorHash),h};for(let f of n){let h=t.storedPackages.get(f.anchoredLocator.locatorHash);if(!h)throw new Error("Assertion failed: The package should have been registered");a(h)}let l=new Set,c={},u={children:c},g=(f,h,p)=>{if(!o.has(f.locatorHash))return;let d=p!==null?ue.tuple(ue.Type.DEPENDENT,{locator:f,descriptor:p}):ue.tuple(ue.Type.LOCATOR,f),m={},I={value:d,children:m},B=S.stringifyLocator(f);if(h[B]=I,!l.has(f.locatorHash)&&(l.add(f.locatorHash),!(p!==null&&t.tryWorkspaceByLocator(f))))for(let b of f.dependencies.values()){if(!i&&f.peerDependencies.has(b.identHash))continue;let R=t.storedResolutions.get(b.descriptorHash);if(!R)throw new Error("Assertion failed: The resolution should have been registered");let H=t.storedPackages.get(R);if(!H)throw new Error("Assertion failed: The package should have been registered");g(H,m,b)}};for(let f of n){let h=t.storedPackages.get(f.anchoredLocator.locatorHash);if(!h)throw new Error("Assertion failed: The package should have been registered");g(h,c,null)}return u}var fL={};it(fL,{default:()=>wze,gitUtils:()=>Uc});var Uc={};it(Uc,{TreeishProtocols:()=>vn,clone:()=>cL,fetchBase:()=>jAe,fetchChangedFiles:()=>YAe,fetchChangedWorkspaces:()=>Ize,fetchRoot:()=>GAe,isGitUrl:()=>ff,lsRemote:()=>HAe,normalizeLocator:()=>AL,normalizeRepoUrl:()=>KC,resolveUrl:()=>lL,splitRepoUrl:()=>UC});var oL=ie(OAe()),gf=ie(require("querystring")),aL=ie(Or()),KAe=ie(require("url"));function UAe(){return _(P({},process.env),{GIT_SSH_COMMAND:"ssh -o BatchMode=yes"})}var Eze=[/^ssh:/,/^git(?:\+[^:]+)?:/,/^(?:git\+)?https?:[^#]+\/[^#]+(?:\.git)(?:#.*)?$/,/^git@[^#]+\/[^#]+\.git(?:#.*)?$/,/^(?:github:|https:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z._0-9-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z._0-9-]+?)(?:\.git)?(?:#.*)?$/,/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/],vn;(function(n){n.Commit="commit",n.Head="head",n.Tag="tag",n.Semver="semver"})(vn||(vn={}));function ff(t){return t?Eze.some(e=>!!t.match(e)):!1}function UC(t){t=KC(t);let e=t.indexOf("#");if(e===-1)return{repo:t,treeish:{protocol:vn.Head,request:"HEAD"},extra:{}};let r=t.slice(0,e),i=t.slice(e+1);if(i.match(/^[a-z]+=/)){let n=gf.default.parse(i);for(let[l,c]of Object.entries(n))if(typeof c!="string")throw new Error(`Assertionfailed:The${l}parametermustbealiteralstring`);let s=Object.values(vn).find(l=>Object.prototype.hasOwnProperty.call(n,l)),o,a;typeof s!="undefined"?(o=s,a=n[s]):(o=vn.Head,a="HEAD");for(let l of Object.values(vn))delete n[l];return{repo:r,treeish:{protocol:o,request:a},extra:n}}else{let n=i.indexOf(":"),s,o;retu
-`)}?`)}returnthis.cli.run([this.commandName,...this.args],{cwd:o.cwd})}};GC.paths=[["workspace"]],GC.usage=ye.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 JAe=GC;var Bze={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:ge.BOOLEAN,default:WAe.isCI},defaultSemverRangePrefix:{description:"The default save prefix: '^', '~' or ''",type:ge.STRING,values:["^","~",""],default:Lo.CARET}},commands:[soe,aoe,wae,Nae,mAe,nAe,tAe,qAe,Uae,Hae,Gae,jae,ioe,noe,Lae,Mae,Yae,qae,Wae,zae,_ae,IAe,Xae,cAe,AAe,uAe,Zae,gAe,fAe,hAe,dAe,CAe,wAe,BAe,JAe]},Qze=Bze;var mL={};it(mL,{default:()=>vze});var Me={optional:!0},zAe=[["@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:Me,zenObservable:Me}}],["any-observable@<0.5.1",{peerDependenciesMeta:{rxjs:Me,zenObservable:Me}}],["@pm2/agent@<1.0.4",{dependencies:{debug:"*"}}],["debug@<4.2.0",{peerDependenciesMeta:{["supports-color"]:Me}}],["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"]:Me,["postcss-jsx"]:Me,["postcss-less"]:Me,["postcss-markdown"]:Me,["postcss-scss"]:Me}}],["jss-plugin-rule-value-function@<=10.1.1",{dependencies:{["tiny-warning"]:"^1.0.2"}}],["ink-select-input@<4.1.0",{peerDependencies:{react:"^16.8.2"}}],["license-webpack-plugin@<2.3.18",{peerDependenciesMeta:{webpack:Me}}],["snowpack@>=3.3.0",{dependencies:{["node-gyp"]:"^7.1.0"}}],["promise-inflight@*",{peerDependenciesMeta:{bluebird:Me}}],["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@<=6.3.4",{peerDependencies:{eslint:">= 6",typescript:">= 2.7",webpack:">= 4","vue-template-compiler":"*"},peerDependenciesMeta:{eslint:Me,"vue-template-compiler":Me}}],["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:Me,"utf-8-validate":Me}}],["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-favic
`);let u=await fe.find(r,this.context.plugins),{project:g,workspace:f}=await Ke.find(u,r);if(f===null)throw new rt(g.cwd,r);await g.restoreInstallState();let h=await Kt.getWorkspaceAccessibleBinaries(f);return h.has(l)===!1&&h.size===1&&typeof this.packages=="undefined"&&(l=Array.from(h)[0][0]),await Kt.executeWorkspaceAccessibleBinary(f,l,this.args,{packageAccessibleBinaries:h,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};jC.paths=[["dlx"]],jC.usage=ye.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"],["Install multiple packages for a single command",`yarndlx-ptypescript-pts-nodets-node--transpile-only-e"console.log('hello!')"`]]});var ele=jC;var Sze={commands:[$Ae,ele]},xze=Sze;var xL={};it(xL,{default:()=>Dze,fileUtils:()=>IL});var hf=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,YC=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,Nr="file:";var IL={};it(IL,{makeArchiveFromLocator:()=>_0,makeBufferFromLocator:()=>BL,makeLocator:()=>wL,makeSpec:()=>tle,parseSpec:()=>yL});function yL(t){let{params:e,selector:r}=S.parseRange(t),i=M.toPortablePath(r);return{parentLocator:e&&typeof e.locator=="string"?S.parseLocator(e.locator):null,path:i}}function tle({parentLocator:t,path:e,folderHash:r,protocol:i}){let n=t!==null?{locator:S.stringifyLocator(t)}:{},s=typeof r!="undefined"?{hash:r}:{};return S.makeRange({protocol:i,source:e,selector:e,params:P(P({},s),n)})}function wL(t,{parentLocator:e,path:r,folderHash:i,protocol:n}){return S.makeLocator(t,tle({parentLocator:e,path:r,folderHash:i,protocol:n}))}async function _0(t,{protocol:e,fetchOptions:r,inMemory:i=!1}){let{parentLocator:n,path:s}=S.parseFileStyleRange(t.reference,{protocol:e}),o=v.isAbsolute(s)?{packageFs:new Ft(Se.root),prefixPath:Se.dot,localPath:Se.root}:await r.fetcher.fetch(n,r),a=o.localPath?{packageFs:new Ft(Se.root),prefixPath:v.relative(Se.root,o.localPath)}:o;o!==a&&o.releaseFs&&o.releaseFs();let l=a.packageFs,c=v.join(a.prefixPath,s);return await de.releaseAfterUseAsync(async()=>await Ai.makeArchiveFromDirectory(c,{baseFs:l,prefixPath:S.getIdentVendorPath(t),compressionLevel:r.project.configuration.get("compressionLevel"),inMemory:i}),a.releaseFs)}async function BL(t,{protocol:e,fetchOptions:r}){return(await _0(t,{protocol:e,fetchOptions:r,inMemory:!0})).getBufferAndClose()}var QL=class{supports(e,r){return!!e.reference.startsWith(Nr)}getLocalPath(e,r){let{parentLocator:i,path:n}=S.parseFileStyleRange(e.reference,{protocol:Nr});if(v.isAbsolute(n))return n;let s=r.fetcher.getLocalPath(i,r);return s===null?null:v.resolve(s,n)}async fetch(e,r){let i=r.checksums.get(e.locatorHash)||null,[n,s,o]=await r.cache.fetchPackageFromCache(e,i,P({onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${S.prettyLocator(r.project.configuration,e)}can'tbefoundinthecacheandwillbefetchedfromthedisk`),loader:()=>this.fetchFromDisk(e,r),skipIntegrityCheck:r.skipIntegrityCheck},r.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:S.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:o}}async fetchFromDisk(e,r){return _0(e,{protocol:Nr,fetchOptions:r})}};var kze=2,bL=class{supportsDescriptor(e,r){return e.range.match(hf)?!0:!!e.range.startsWith(Nr)}supportsLocator(e,r){return!!e.reference.startsWith(Nr)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,i)
`),!r||r.cwd===this.context.cwd){let c=v.join(this.context.cwd,wt.lockfile);T.existsSync(c)||await T.writeFilePromise(c,"");let g=["/.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 d=v.join(this.context.cwd,".editorconfig");T.existsSync(d)||await T.writeFilePromise(d,p),T.existsSync(v.join(this.context.cwd,".git"))||await hr.execvp("git",["init"],{cwd:this.context.cwd})}}};WC.paths=[["init"]],WC.usage=ye.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 Fle=WC;var T5e={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:[Fle]},M5e=T5e;var GL={};it(GL,{default:()=>K5e});var Ua="portal:",Ha="link:";var OL=class{supports(e,r){return!!e.reference.startsWith(Ua)}getLocalPath(e,r){let{parentLocator:i,path:n}=S.parseFileStyleRange(e.reference,{protocol:Ua});if(v.isAbsolute(n))return n;let s=r.fetcher.getLocalPath(i,r);return s===null?null:v.resolve(s,n)}async fetch(e,r){var c;let{parentLocator:i,path:n}=S.parseFileStyleRange(e.reference,{protocol:Ua}),s=v.isAbsolute(n)?{packageFs:new Ft(Se.root),prefixPath:Se.dot,localPath:Se.root}:await r.fetcher.fetch(i,r),o=s.localPath?{packageFs:new Ft(Se.root),prefixPath:v.relative(Se.root,s.localPath),localPath:Se.root}:s;s!==o&&s.releaseFs&&s.releaseFs();let a=o.packageFs,l=v.resolve((c=o.localPath)!=null?c:o.packageFs.getRealPath(),o.prefixPath,n);return s.localPath?{packageFs:new Ft(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Se.dot,localPath:l}:{packageFs:new Zo(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Se.dot}}};var KL=class{supportsDescriptor(e,r){return!!e.range.startsWith(Ua)}supportsLocator(e,r){return!!e.reference.startsWith(Ua)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,i){return S.bindDescriptor(e,{locator:S.stringifyLocator(r)})}getResolutionDependencies(e,r){return[]}async getCandidates(e,r,i){let n=e.range.slice(Ua.length);return[S.makeLocator(e,`${Ua}${M.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 _(P({},e),{version:n.version||"0.0.0",languageName:n.languageName||r.project.configuration.get("defaultLanguageName"),linkType:gt.SOFT,conditions:n.getConditions(),dependencies:new Map([...n.dependencies]),peerDependencies:n.peerDependencies,dependenciesMeta:n.dependenciesMeta,peerDependenciesMeta:n.peerDependenciesMeta,bin:n.bin})}};var UL=class{supports(e,r){return!!e.reference.startsWith(Ha)}getLocalPath(e,r){let{parentLocator:i,path:n}=S.parseFileStyleRange(e.reference,{protocol:Ha});if(v.isAbsol
${u},nexttree:
${zC(a)}`);let f=Lle(a);if(f)throw new Error(`${f},afterhoistingfinished:
${zC(a)}`)}return s.debugLevel>=2&&console.log(zC(a)),H5e(a)},G5e=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},j5e=t=>{let e=t[t.length-1],r=new Map,i=new Set,n=new Set,s=(o,a)=>{if(i.has(o))return;i.add(o);for(let c of o.hoistedDependencies.values())if(!a.has(c.name)){let u;for(let g of t)u=g.dependencies.get(c.name),u&&r.set(u.name,u)}let l=new Set;for(let c of o.dependencies.values())l.add(c.name);for(let c of o.dependencies.values())o.peerNames.has(c.name)||s(c,l)};return s(e,n),r},Mle=(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,hoistPriority:f,isWorkspace:h,hoistedFrom:p,hoistedTo:d}=e,m={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,hoistPriority:f,isWorkspace:h,hoistedFrom:new Map(p),hoistedTo:new Map(d)},I=m.dependencies.get(r);return I&&I.ident==m.ident&&m.dependencies.set(r,m),t.dependencies.set(m.name,m),m},Y5e=(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.hoistPriority!==o.hoistPriority?a.hoistPriority-o.hoistPriority: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},qL=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},YL=(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=J5e(o),l=Y5e(o,a),c=t==o?new Map:n.fastLookupPossible?G5e(e):j5e(e),u,g=!1,f=!1,h=new Map(Array.from(l.entries()).map(([d,m])=>[d,m[0]])),p=new Map;do{let d=q5e(t,e,r,c,h,l,i,p,n);d.isGraphChanged&&(f=!0),d.anotherRoundNeeded&&(g=!0),u=!1;for(let[m,I]of l)I.length>1&&!o.dependencies.has(m)&&(h.delete(m),I.shift(),h.set(m,I[0]),u=!0)}while(u);for(let d of o.dependencies.values())if(!o.peerNames.has(d.name)&&!r.has(d.locator)){r.add(d.locator);let m=YL(t,[...e,d],r,p,n);m.isGraphChanged&&(f=!0),m.anotherRoundNeeded&&(g=!0),r.delete(d.locator)}return{anotherRoundNeeded:g,isGraphChanged:f}},W5e=(t,e,r,i,n,s,o,a,{outputReason:l,fastLookupPossible:c})=>{let u,g=null,f=new Set;l&&(u=`${Array.from(e).map(m=>wi(m)).join("\u2192")}`);let h=r[r.length-1],d=!(i.ident===h.ident);if(l&&!d&&(g="- self-reference"),d&&(d=!i.isWorkspace,l&&!d&&(g="- workspace")),d&&(d=!h.isWorkspace||h.hoistedFrom.has(i.name)||e.size===1,l&&!d&&(g=h.reasons.get(i.name))),d&&(d=!t.peerNames.has(i.name),l&&!d&&(g=`-cannotshadowpeer:${wi(t.originalDependencies.get(i.name).locator)}at${u}`)),d){let m=!1,I=n.get(i.name);if(m=!I||I.ident===i.ident,l&&!m&&(g=`-filledby:${wi(I.locator)}at${u}`),m)for(let B=r.length-1;B>=1;B--){let R=r[B].dependencies.get(i.name);if(R&&R.ident!==i.ident){m=!1;let H=a.get(h);H||(H=new Set,a.set(h,H)),H.add(i.name),l&&(g=`-filledby${wi(R.locator)}at${r.slice(0,B).map(L=>wi(L.locator)).join("\u2192")}`);break}}d=m}if(d&&(d=s.get(i.name)===i.ident,l&&!d&&(g=`-filledby:${wi(o.get(i.name)[0])}at${u}`)),d){let m=!0,I=new Set(i.peerNames);for(let B=r.length-1;B>=1;B--){let b=r[B];for(let R of I){if(b.peerNames.has(R)&&b.originalDependencies.has(R))continue;let H=b.dependencies.get(R);H&&t.dependencies.get(R)!==H&&(B===r.length-1?f.add(H):(f=null,m=!1,l&&(g=`-peerdependency${wi(H.locator)}fromparent${wi(b.locator)}was
${zC(t)}`)}let ne=qL(B);for(let q of ne)if(K.has(q)){let A=L.get(q);if((n.get(q.name)===q.ident||!B.reasons.has(q.name))&&A.isHoistable!==0&&B.reasons.set(q.name,A.reason),!q.isHoistBorder&&R.indexOf(q.locator)<0){u.add(B);let W=Mle(B,q);h([...m,B],[...I,B.locator],W,d),u.delete(B)}}},p,d=new Set(qL(c));do{p=d,d=new Set;for(let m of p){if(m.locator===c.locator||m.isHoistBorder)continue;let I=Mle(c,m);h([],Array.from(r),I,d)}}while(d.size>0);return{anotherRoundNeeded:g,isGraphChanged:f}},Lle=t=>{let e=[],r=new Set,i=new Set,n=(s,o,a)=>{if(r.has(s)||(r.add(s),i.has(s)))return;let l=new Map(o);for(let c of s.dependencies.values())s.peerNames.has(c.name)||l.set(c.name,c);for(let c of s.originalDependencies.values()){let u=l.get(c.name),g=()=>`${Array.from(i).concat([s]).map(f=>wi(f.locator)).join("\u2192")}`;if(s.peerNames.has(c.name)){let f=o.get(c.name);(f!==u||!f||f.ident!==c.ident)&&e.push(`${g()}-brokenpeerpromise:expected${c.ident}butfound${f&&f.ident}`)}else{let f=a.hoistedFrom.get(s.name),h=s.hoistedTo.get(c.name),p=`${f?` hoisted from ${f.join(", ")}`:""}`,d=`${h?` hoisted to ${h}`:""}`,m=`${g()}${p}`;u?u.ident!==c.ident&&e.push(`${m}-brokenrequirepromisefor${c.name}${d}:expected${c.ident},butfound:${u.ident}`):e.push(`${m}-brokenrequirepromise:norequireddependency${c.name}${d}found`)}}i.add(s);for(let c of s.dependencies.values())s.peerNames.has(c.name)||n(c,l,s);i.delete(s)};return n(t,t.dependencies,t),e.join(`
`)},U5e=(t,e)=>{let{identName:r,name:i,reference:n,peerNames:s}=t,o={name:i,references:new Set([n]),locator:jL(r,n),ident:Nle(r,n),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(s),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistPriority:0,isWorkspace:!0,hoistedFrom:new Map,hoistedTo:new Map},a=new Map([[t,o]]),l=(c,u)=>{let g=a.get(c),f=!!g;if(!g){let{name:h,identName:p,reference:d,peerNames:m,hoistPriority:I,isWorkspace:B}=c,b=e.hoistingLimits.get(u.locator);g={name:h,references:new Set([d]),locator:jL(p,d),ident:Nle(p,d),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(m),reasons:new Map,decoupled:!0,isHoistBorder:b?b.has(h):!1,hoistPriority:I||0,isWorkspace:B||!1,hoistedFrom:new Map,hoistedTo:new Map},a.set(c,g)}if(u.dependencies.set(c.name,g),u.originalDependencies.set(c.name,g),f){let h=new Set,p=d=>{if(!h.has(d)){h.add(d),d.decoupled=!1;for(let m of d.dependencies.values())d.peerNames.has(m.name)||p(m)}};p(g)}else for(let h of c.dependencies)l(h,g)};for(let c of t.dependencies)l(c,o);return o},JL=t=>t.substring(0,t.indexOf("@",1)),H5e=t=>{let e={name:t.name,identName:JL(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:JL(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},J5e=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,hoistPriority:0},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()){let g=n(u);g.hoistPriority=Math.max(g.hoistPriority,u.hoistPriority),a.peerNames.has(u.name)?g.peerDependents.add(a.ident):s(a,u)}}};for(let o of t.dependencies.values())t.peerNames.has(o.name)||s(t,o);return e},wi=t=>{if(!t)return"none";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}`},Ole=5e4,zC=t=>{let e=0,r=(n,s,o="")=>{if(e>Ole||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),f=JL(u.locator),h=n.hoistedFrom.get(u.name)||[];l+=`${o}${c<a.length-1?"\u251C\u2500":"\u2514\u2500"}${(s.has(u)?">":"")+(f!==u.name?`a:${u.name}:`:"")+wi(u.locator)+(g?`${g}`:"")+(u!==n&&h.length>0?`, hoisted from: ${h.join(", ")}`:"")}
`:"")};var Js;(function(r){r.HARD="HARD",r.SOFT="SOFT"})(Js||(Js={}));var Sn;(function(i){i.WORKSPACES="workspaces",i.DEPENDENCIES="dependencies",i.NONE="none"})(Sn||(Sn={}));var Kle="node_modules",Hc="$wsroot$";var VC=(t,e)=>{let{packageTree:r,hoistingLimits:i,errors:n,preserveSymlinksRequired:s}=z5e(t,e),o=null;if(n.length===0){let a=Tle(r,{hoistingLimits:i});o=V5e(t,a,e)}return{tree:o,errors:n,preserveSymlinksRequired:s}},ms=t=>`${t.name}@${t.reference}`,WL=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(v.delimiter).length,o=n.split(v.delimiter).length;return s!==o?o-s:n.localeCompare(i)});return e},Ule=(t,e)=>{let r=S.isVirtualLocator(t)?S.devirtualizeLocator(t):t,i=S.isVirtualLocator(e)?S.devirtualizeLocator(e):e;return S.areLocatorsEqual(r,i)},zL=(t,e,r,i)=>{if(t.linkType!==Js.SOFT)return!1;let n=M.toPortablePath(r.resolveVirtual&&e.reference&&e.reference.startsWith("virtual:")?r.resolveVirtual(t.packageLocation):t.packageLocation);return v.contains(i,n)===null},_5e=t=>{let e=t.getPackageInformation(t.topLevel);if(e===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");if(t.findPackageLocator(e.packageLocation)===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let i=M.toPortablePath(e.packageLocation.slice(0,-1)),n=new Map,s={children:new Map},o=t.getDependencyTreeRoots(),a=new Map,l=new Set,c=(f,h)=>{let p=ms(f);if(l.has(p))return;l.add(p);let d=t.getPackageInformation(f);if(d){let m=h?ms(h):"";if(ms(f)!==m&&d.linkType===Js.SOFT&&!zL(d,f,t,i)){let I=Hle(d,f,t);(!a.get(I)||f.reference.startsWith("workspace:"))&&a.set(I,f)}for(let[I,B]of d.packageDependencies)B!==null&&(d.packagePeers.has(I)||c(t.getLocator(I,B),f))}};for(let f of o)c(f,null);let u=i.split(v.sep);for(let f of a.values()){let h=t.getPackageInformation(f),d=M.toPortablePath(h.packageLocation.slice(0,-1)).split(v.sep).slice(u.length),m=s;for(let I of d){let B=m.children.get(I);B||(B={children:new Map},m.children.set(I,B)),m=B}m.workspaceLocator=f}let g=(f,h)=>{if(f.workspaceLocator){let p=ms(h),d=n.get(p);d||(d=new Set,n.set(p,d)),d.add(f.workspaceLocator)}for(let p of f.children.values())g(p,f.workspaceLocator||h)};for(let f of s.children.values())g(f,s.workspaceLocator);return n},z5e=(t,e)=>{let r=[],i=!1,n=new Map,s=_5e(t),o=t.getPackageInformation(t.topLevel);if(o===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");let a=t.findPackageLocator(o.packageLocation);if(a===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let l=M.toPortablePath(o.packageLocation.slice(0,-1)),c={name:a.name,identName:a.name,reference:a.reference,peerNames:o.packagePeers,dependencies:new Set,isWorkspace:!0},u=new Map,g=(h,p)=>`${ms(p)}:${h}`,f=(h,p,d,m,I,B,b,R)=>{var X,F;let H=g(h,d),L=u.get(H),K=!!L;!K&&d.name===a.name&&d.reference===a.reference&&(L=c,u.set(H,c));let J=zL(p,d,t,l);if(!L){let D=p.linkType===Js.SOFT&&d.name.endsWith(Hc);L={name:h,identName:d.name,reference:d.reference,dependencies:new Set,peerNames:D?new Set:p.packagePeers,isWorkspace:D},u.set(H,L)}let ne;if(J?ne=2:I.linkType===Js.SOFT?ne=1:ne=0,L.hoistPriority=Math.max(L.hoistPriority||0,ne),R&&!J){let D=ms({name:m.identName,reference:m.reference}),he=n.get(D)||new Set;n.set(D,he),he.add(L.name)}let q=new Map(p.packageDependencies);if(e.project){let D=e.project.workspacesByCwd.get(M.toPortablePath(p.packageLocation.slice(0,-1)));if(D){let he=new Set([...Array.from(D.manifest.peerDependencies.values(),pe=>S.stringifyIdent(pe)),...Array.from(D.manifest.peerDependenciesMeta.keys())]);for(let pe of he)q.has(pe)||(q.set(pe,B.get(pe)||null),L.peerNames.add(pe))}}let A=ms({name:d.name.replace(Hc,""),reference:d.reference}),V=s.get(A);if(V)for(let D of V)q.set(`${D.name}${Hc}`,D.reference);(p!==I||p.l
`)}return s+=r,s+="}",s}function X0(t,e,r,i){let{next:n}=jle[r],s=n[t]||n["*"];return Yle(e,s,i)}function Yle(t,e,r){let{collapsed:i}=jle[e];return Array.isArray(t)?i?Z5e(t,e,r):$5e(t,e,r):typeof t=="object"&&t!==null?i?e6e(t,e,r):t6e(t,e,r):JSON.stringify(t)}function qle(t){return Yle(t,Ht.TOP_LEVEL,"")}function _C(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 r6e(t){let e=new Map,r=_C(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 i6e(t){return _C(t.fallbackPool||[],([e])=>e)}function n6e(t){let e=[];for(let[r,i]of _C(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 _C(i,([g])=>g===null?"0":`1${g}`)){let g=[];r!==null&&s!==null&&!a.has(r)&&g.push([r,s]);for(let[p,d]of _C(a.entries(),([m])=>m))g.push([p,d]);let f=l&&l.size>0?Array.from(l):void 0,h=u||void 0;n.push([s,{packageLocation:o,packageDependencies:g,packagePeers:f,linkType:c,discardFromLookup:h}])}}return e}function XC(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:r6e(t),fallbackPool:i6e(t),packageRegistryData:n6e(t)}}var zle=ie(Wle());function Vle(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",`}
`,{request:ae,issuer:Ae});return M.toPortablePath(G)}let De,$=re.match(o);if($){if(!se)throw ui(ur.API_ERROR,"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:ae,issuer:Ae});let[,G,Ce]=$,ee=D(se);if(!ee){let yr=ne(re,se);if(yr===!1)throw ui(ur.BUILTIN_NODE_RESOLUTION_FAILED,`Thebuiltinnoderesolutionalgorithmwasunabletoresolvetherequestedmodule(itdidn't go through the pnp resolver because the issuer doesn'tseemtobepartoftheYarn-manageddependencytree).
`,{request:ae,issuer:Ae,dependencyName:G}):dt=ui(ur.UNDECLARED_DEPENDENCY,`${ee.name}triedtoaccess${G}.WhilethismoduleisusuallyinterpretedasaNodebuiltin,yourresolverisrunninginsideanon-Noderesolutioncontextwheresuchbuiltinsareignored.Since${G}isn't otherwise declared in ${ee.name}'sdependencies,thismakestherequirecallambiguousandunsound.
`,{request:ae,issuer:Ae,issuerLocator:Object.assign({},ee),dependencyName:G}));if(Oe==null){if(vt===null||dt===null)throw dt||new Error("Assertion failed: Expected an error to have been set");Oe=vt;let yr=dt.message.replace(/\n.*/g,"");dt.message=yr,!f.has(yr)&&i!==0&&(f.add(yr),process.emitWarning(dt))}let ri=Array.isArray(Oe)?{name:Oe[0],reference:Oe[1]}:{name:G,reference:Oe},ii=b(ri);if(!ii.packageLocation)throw ui(ur.MISSING_DEPENDENCY,`Adependencyseemsvalidbutdidn'tgetinstalledforsomereason.Thismightbecausedbyapartialinstall,suchasdevvsprod.
`,{request:ae,issuer:Ae,dependencyLocator:Object.assign({},ri)});let an=ii.packageLocation;Ce?De=v.join(an,Ce):De=an}else if(v.isAbsolute(re))De=v.normalize(re);else{if(!se)throw ui(ur.API_ERROR,"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:ae,issuer:Ae});let G=v.resolve(se);se.match(l)?De=v.normalize(v.join(G,re)):De=v.normalize(v.join(v.dirname(G),re))}return v.normalize(De)}function pe(re,se,be=H){if(a.test(re))return se;let ae=L(se,be);return ae?v.normalize(ae):se}function Ne(re,{extensions:se=Object.keys(df.Module._extensions)}={}){let be=[],ae=K(re,be,{extensions:se});if(ae)return v.normalize(ae);{let Ae=YA(re),De=D(re);if(De){let{packageLocation:$}=b(De);if(!e.fakeFs.existsSync($)){let G=$.includes("/unplugged/")?"Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).":"Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.";throw ui(ur.QUALIFIED_PATH_RESOLUTION_FAILED,`${G}
`).join("")}`,{unqualifiedPath:Ae})}}functionPe(re,se,{considerBuiltins:be,extensions:ae,conditions:Ae}={}){letDe=he(re,se,{considerBuiltins:be});if(re==="pnpapi")returnDe;if(De===null)returnnull;let$=()=>se!==null?q(se):!1,G=(!be||!s(re))&&!$()?pe(re,De,Ae):De;try{returnNe(G,{extensions:ae})}catch(Ce){throwCe.pnpCode==="QUALIFIED_PATH_RESOLUTION_FAILED"&&Object.assign(Ce.data,{request:YA(re),issuer:se&&YA(se)}),Ce}}functionqe(re){letse=v.normalize(re),be=Pr.resolveVirtual(se);returnbe!==se?be:null}return{VERSIONS:A,topLevel:V,getLocator:(re,se)=>Array.isArray(se)?{name:se[0],reference:se[1]}:{name:re,reference:se},getDependencyTreeRoots:()=>[...t.dependencyTreeRoots],getAllLocators(){letre=[];for(let[se,be]ofp)for(letaeofbe.keys())se!==null&&ae!==null&&re.push({name:se,reference:ae});returnre},getPackageInformation:re=>{letse=W(re);if(se===null)returnnull;letbe=M.fromPortablePath(se.packageLocation);return_(P({},se),{packageLocation:be})},findPackageLocator:re=>D(M.toPortablePath(re)),resolveToUnqualified:B("resolveToUnqualified",(re,se,be)=>{letae=se!==null?M.toPortablePath(se):null,Ae=he(M.toPortablePath(re),ae,be);returnAe===null?null:M.fromPortablePath(Ae)}),resolveUnqualified:B("resolveUnqualified",(re,se)=>M.fromPortablePath(Ne(M.toPortablePath(re),se))),resolveRequest:B("resolveRequest",(re,se,be)=>{letae=se!==null?M.toPortablePath(se):null,Ae=Pe(M.toPortablePath(re),ae,be);returnAe===null?null:M.fromPortablePath(Ae)}),resolveVirtual:B("resolveVirtual",re=>{letse=qe(M.toPortablePath(re));returnse!==null?M.fromPortablePath(se):null})}}varISt=(0,rce.promisify)(tce.readFile);varice=(t,e,r)=>{leti=XC(t),n=_L(i,{basePath:e}),s=M.join(e,wt.pnpCjs);return$L(n,{fakeFs:r,pnpapiResolution:s})};vartT=ie(sce());varWs={};it(Ws,{checkAndReportManifestCompatibility:()=>oce,extractBuildScripts:()=>Z0,getExtractHint:()=>rT,hasBindingGyp:()=>iT});functionoce(t,e,{configuration:r,report:i}){returnS.isPackageCompatible(t,{os:[process.platform],cpu:[process.arch]})?!0:(i==null||i.reportWarningOnce(z.INCOMPATIBLE_ARCHITECTURE,`${S.prettyLocator(r,t)} The ${process.platform}-${process.arch} architecture is incompatible with this module, ${e} skipped.`),!1)}functionZ0(t,e,r,{configuration:i,report:n}){lets=[];for(letaof["preinstall","install","postinstall"])e.manifest.scripts.has(a)&&s.push([Gn.SCRIPT,a]);return!e.manifest.scripts.has("install")&&e.misc.hasBindingGyp&&s.push([Gn.SHELLCODE,"node-gyp rebuild"]),s.length===0?[]:t.linkType!==gt.HARD?(n==null||n.reportWarningOnce(z.SOFT_LINK_BUILD,`${S.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,`${S.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,`${S.prettyLocator(i,t)} lists build scripts, but all build scripts have been disabled.`),[]):oce(t,"build",{configuration:i,report:n})?s:[]}varg6e=newSet([".exe",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);functionrT(t){returnt.packageFs.getExtractHint({relevantExtensions:g6e})}functioniT(t){lete=v.join(t.prefixPath,"binding.gyp");returnt.packageFs.existsSync(e)}varnT={};it(nT,{getUnpluggedPath:()=>ZC});functionZC(t,{configuration:e}){returnv.resolve(e.get("pnpUnpluggedFolder"),S.slugifyLocator(t))}varf6e=newSet([S.makeIdent(null,"nan").identHash,S.makeIdent(null,"node-gyp").identHash,S.makeIdent(null,"node-pre-gyp").identHash,S.makeIdent(null,"node-addon-api").identHash,S.makeIdent(null,"fsevents").identHash]),jc=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=qA(r.project).cjs;if(!T.existsSync(i))thrownewme(`The project in ${ue.pretty(r.project.configuration,`${r.project.cwd}/package.j
`;let s=Array.from(e.keys()).sort(),o=S.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 f=v.contains(t.cwd,g);if(f===null)throw new Error(`Assertionfailed:Expectedthepathtobewithintheproject(${g})`);n+=`-${JSON.stringify(f)}
`}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,f]of r){let h=v.contains(t.cwd,g);if(h===null)throw new Error(`Assertionfailed:Expectedthepathtobewithintheproject(${g})`);n+=`${JSON.stringify(h)}:
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 ${vQ.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 Rge=dm;var BM=ie(Or()),QM=ie(require("util")),Cm=class extends Be{constructor(){super(...arguments);this.fields=Y.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=Y.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=Y.Rest()}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r}=await Ke.find(e,this.context.cwd),i=typeof this.fields!="undefined"?new Set(["name",...this.fields.split(/\s*,\s*/)]):null,n=[],s=!1,o=await Fe.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 b=r.topLevelWorkspace;if(!b.manifest.name)throw new me(`Missing'name'fieldin${M.fromPortablePath(v.join(b.cwd,wt.manifest))}`);c=S.makeDescriptor(b.manifest.name,"unknown")}else c=S.parseDescriptor(l);let u=Lt.getIdentUrl(c),g=bM(await Lt.get(u,{configuration:e,ident:c,jsonResponse:!0,customErrorMessage:Lt.customPackageError})),f=Object.keys(g.versions).sort(BM.default.compareLoose),p=g["dist-tags"].latest||f[f.length-1],d=qt.validRange(c.range);if(d){let b=BM.default.maxSatisfying(f,d);b!==null?p=b:(a.reportWarning(z.UNNAMED,`Unmetrange${S.prettyRange(e,c.range)};fallingbacktothelatestversion`),s=!0)}else c.range!=="unknown"&&(a.reportWarning(z.UNNAMED,`Invalidrange${S.prettyRange(e,c.range)};fallingbacktothelatestversion`),s=!0);let m=g.versions[p],I=_(P(P({},g),m),{version:p,versions:f}),B;if(i!==null){B={};for(let b of i){let R=I[b];if(typeof R!="undefined")B[b]=R;else{a.reportWarning(z.EXCEPTION,`The'${b}'fielddoesn't exist inside ${S.prettyIdent(e,c)}'sinformations`),s=!0;continue}}}else this.json||(delete I.dist,delete I.readme,delete I.users),B=I;a.reportJson(B),this.json||n.push(B)}});QM.inspect.styles.name="cyan";for(let a of n)(a!==n[0]||s)&&this.context.stdout.write(`
`);return o.exitCode()}};Cm.paths=[["npm","info"]],Cm.usage=ye.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 Fge=Cm;function bM(t){if(Array.isArray(t)){let e=[];for(let r of t)r=bM(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=bM(t[r]);i&&(e[r]=i)}return e}else return t||null}var Nge=ie(aC()),mm=class extends Be{constructor(){super(...arguments);this.scope=Y.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=Y.Boolean("--publish",!1,{description:"Login to the publish registry"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),r=await SQ({configuration:e,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Fe.start({configuration:e,stdout:this.context.stdout},async n=>{let s=await i_e({registry:r,report:n,stdin:this.context.stdin,stdout:this.context.stdout}),o=`/-/user/org.couchdb.user:${encodeURIComponent(s.name)}`,a=awaitLt.put(o,s,{attemptedAs:s.name,configuration:e,registry:r,jsonResponse:!0,authType:Lt.AuthType.NO_AUTH});returnawaitr_e(r,a.token,{configuration:e,scope:this.scope}),n.reportInfo(z.UNNAMED,"Successfullyloggedin")})).exitCode()}};mm.paths=[["npm","login"]],mm.usage=ye.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"]]});varLge=mm;asyncfunctionSQ({scope:t,publish:e,configuration:r,cwd:i}){returnt&&e?gr.getScopeRegistry(t,{configuration:r,type:gr.RegistryType.PUBLISH_REGISTRY}):
`,examples:[["List all tags of package `my-pkg`","yarn npm tag list my-pkg"]]});var Kge=ym;async function wm(t,e){let r=`/-/package${Lt.getIdentUrl(t)}/dist-tags`;returnLt.get(r,{configuration:e,ident:t,jsonResponse:!0,customErrorMessage:Lt.customPackageError})}varBm=classextendsBe{constructor(){super(...arguments);this.package=Y.String();this.tag=Y.String()}asyncexecute(){lete=awaitfe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=awaitKe.find(e,this.context.cwd);if(!i)thrownewrt(r.cwd,this.context.cwd);letn=S.parseDescriptor(this.package,!0),s=n.range;if(!Uge.default.valid(s))thrownewme(`Therange${ue.pretty(e,n.range,ue.Type.RANGE)}mustbeavalidsemverversion`);leto=gr.getPublishRegistry(i.manifest,{configuration:e}),a=ue.pretty(e,n,ue.Type.IDENT),l=ue.pretty(e,s,ue.Type.RANGE),c=ue.pretty(e,this.tag,ue.Type.CODE);return(awaitFe.start({configuration:e,stdout:this.context.stdout},asyncg=>{letf=awaitwm(n,e);Object.prototype.hasOwnProperty.call(f,this.tag)&&f[this.tag]===s&&g.reportWarning(z.UNNAMED,`Tag${c}isalreadysettoversion${l}`);leth=`/-/package${Lt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;awaitLt.put(h,s,{configuration:e,registry:o,ident:n,jsonRequest:!0,jsonResponse:!0}),g.reportInfo(z.UNNAMED,`Tag${c}addedtoversion${l}ofpackage${a}`)})).exitCode()}};Bm.paths=[["npm","tag","add"]],Bm.usage=ye.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 Hge=Bm;var Qm=class extends Be{constructor(){super(...arguments);this.package=Y.String();this.tag=Y.String()}async execute(){if(this.tag==="latest")throw new me("The 'latest' tag cannot be removed.");let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd);if(!i)throw new rt(r.cwd,this.context.cwd);let n=S.parseIdent(this.package),s=gr.getPublishRegistry(i.manifest,{configuration:e}),o=ue.pretty(e,this.tag,ue.Type.CODE),a=ue.pretty(e,n,ue.Type.IDENT),l=await wm(n,e);if(!Object.prototype.hasOwnProperty.call(l,this.tag))throw new me(`${o}isnotatagofpackage${a}`);return(await Fe.start({configuration:e,stdout:this.context.stdout},async u=>{let g=`/-/package${Lt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;awaitLt.del(g,{configuration:e,registry:s,ident:n,jsonResponse:!0}),u.reportInfo(z.UNNAMED,`Tag${o}removedfrompackage${a}`)})).exitCode()}};Qm.paths=[["npm","tag","remove"]],Qm.usage=ye.Usage({category:"Npm-relatedcommands",description:"removeatagfromapackage",details:`
`,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]});var Gge=Qm;var bm=class extends Be{constructor(){super(...arguments);this.scope=Y.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=Y.Boolean("--publish",!1,{description:"Print username for the publish registry"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),r;return this.scope&&this.publish?r=gr.getScopeRegistry(this.scope,{configuration:e,type:gr.RegistryType.PUBLISH_REGISTRY}):this.scope?r=gr.getScopeRegistry(this.scope,{configuration:e}):this.publish?r=gr.getPublishRegistry((await rf(e,this.context.cwd)).manifest,{configuration:e}):r=gr.getDefaultRegistry({configuration:e}),(await Fe.start({configuration:e,stdout:this.context.stdout},async n=>{var o,a;let s;try{s=await Lt.get("/-/whoami",{configuration:e,registry:r,authType:Lt.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?S.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()}};bm.paths=[["npm","whoami"]],bm.usage=ye.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 jge=bm;var o_e={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:ge.STRING,default:null}},commands:[Rge,Fge,Lge,Mge,Oge,Hge,Kge,Gge,jge]},a_e=o_e;var NM={};it(NM,{default:()=>B_e,patchUtils:()=>SM});var SM={};it(SM,{applyPatchFile:()=>PQ,diffFolders:()=>DM,extractPackageToDisk:()=>PM,extractPatchFlags:()=>Xge,isParentRequired:()=>kM,loadPatchFiles:()=>km,makeDescriptor:()=>I_e,makeLocator:()=>xM,parseDescriptor:()=>Sm,parseLocator:()=>xm,parsePatchFile:()=>kQ});var vm=class extends Error{constructor(e,r){super(`Cannotapplyhunk#${e+1}`);this.hunk=r}};var A_e=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function Nf(t){return v.relative(Se.root,v.resolve(Se.root,M.toPortablePath(t)))}function l_e(t){let e=t.trim().match(A_e);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 c_e=420,u_e=493,Lr;(function(i){i.Context="context",i.Insertion="insertion",i.Deletion="deletion"})(Lr||(Lr={}));var Yge=()=>({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}),g_e=t=>({header:l_e(t),parts:[]}),f_e={["@"]:"header",["-"]:Lr.Deletion,["+"]:Lr.Insertion,[" "]:Lr.Context,["\\"]:"pragma",undefined:Lr.Context};function p_e(t){let e=[],r=Yge(),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=Yge()}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&&
`):"";await e.mkdirpPromise(v.dirname(n.path),{chmod:493,utimes:[mr.SAFE_TIME,mr.SAFE_TIME]}),await e.writeFilePromise(n.path,s,{mode:n.mode}),await e.utimesPromise(n.path,mr.SAFE_TIME,mr.SAFE_TIME)}break;case"patch":await Lf(e,n.path,async()=>{await C_e(n,{baseFs:e,dryRun:r})});break;case"mode change":{let o=(await e.statPromise(n.path)).mode;if(qge(n.newMode)!==qge(o))continue;await Lf(e,n.path,async()=>{await e.chmodPromise(n.path,n.newMode)})}break;default:de.assertNever(n);break}}function qge(t){return(t&64)>0}function Jge(t){return t.replace(/\s+$/,"")}function m_e(t,e){return Jge(t)===Jge(e)}async function C_e({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 f=Math.max(c,g.header.patched.start+l),h=Math.max(0,f-c),p=Math.max(0,o.length-f-g.header.original.length),d=Math.max(h,p),m=0,I=0,B=null;for(;m<=d;){if(m<=h&&(I=f-m,B=Wge(g,o,I),B!==null)){m=-m;break}if(m<=p&&(I=f+m,B=Wge(g,o,I),B!==null))break;m+=1}if(B===null)throw new vm(t.indexOf(g),g);a.push(B),l+=m,c=I+g.header.original.length}if(i)return;let u=0;for(let g of a)for(let f of g)switch(f.type){case"splice":{let h=f.index+u;o.splice(h,f.numToDelete,...f.linesToInsert),u+=f.linesToInsert.length-f.numToDelete}break;case"pop":o.pop();break;case"push":o.push(f.line);break;default:de.assertNever(f);break}await r.writeFilePromise(e,o.join(`
`),{mode:n})}function Wge(t,e,r){let i=[];for(let n of t.parts)switch(n.type){case Lr.Context:case Lr.Deletion:{for(let s of n.lines){let o=e[r];if(o==null||!m_e(o,s))return null;r+=1}n.type===Lr.Deletion&&(i.push({type:"splice",index:r-n.lines.length,numToDelete:n.lines.length,linesToInsert:[]}),n.noNewlineAtEndOfFile&&i.push({type:"push",line:""}))}break;case Lr.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 E_e=/^builtin<([^>]+)>$/;function zge(t,e){let{source:r,selector:i,params:n}=S.parseRange(t);if(r===null)throw new Error("Patch locators must explicitly define their source");let s=i?i.split(/&/).map(c=>M.toPortablePath(c)):[],o=n&&typeof n.locator=="string"?S.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 Sm(t){let i=zge(t.range,S.parseDescriptor),{sourceItem:e}=i,r=qr(i,["sourceItem"]);return _(P({},r),{sourceDescriptor:e})}function xm(t){let i=zge(t.reference,S.parseLocator),{sourceItem:e}=i,r=qr(i,["sourceItem"]);return _(P({},r),{sourceLocator:e})}function Vge({parentLocator:t,sourceItem:e,patchPaths:r,sourceVersion:i,patchHash:n},s){let o=t!==null?{locator:S.stringifyLocator(t)}:{},a=typeof i!="undefined"?{version:i}:{},l=typeof n!="undefined"?{hash:n}:{};return S.makeRange({protocol:"patch:",source:s(e),selector:r.join("&"),params:P(P(P({},a),l),o)})}function I_e(t,{parentLocator:e,sourceDescriptor:r,patchPaths:i}){return S.makeLocator(t,Vge({parentLocator:e,sourceItem:r,patchPaths:i},S.stringifyDescriptor))}function xM(t,{parentLocator:e,sourcePackage:r,patchPaths:i,patchHash:n}){return S.makeLocator(t,Vge({parentLocator:e,sourceItem:r,sourceVersion:r.version,patchPaths:i,patchHash:n},S.stringifyLocator))}function _ge({onAbsolute:t,onRelative:e,onBuiltin:r},i){i.startsWith("~")&&(i=i.slice(1));let s=i.match(E_e);return s!==null?r(s[1]):v.isAbsolute(i)?t(i):e(i)}function Xge(t){let e=t.startsWith("~");return e&&(t=t.slice(1)),{optional:e}}function kM(t){return _ge({onAbsolute:()=>!1,onRelative:()=>!0,onBuiltin:()=>!1},t)}async function km(t,e,r){let i=t!==null?await r.fetcher.fetch(t,r):null,n=i&&i.localPath?{packageFs:new Ft(Se.root),prefixPath:v.relative(Se.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=Xge(o),l=await _ge({onAbsolute:async()=>await T.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(v.join(n.prefixPath,o),"utf8")},onBuiltin:async c=>await r.project.configuration.firstHook(u=>u.getBuiltinPatch,r.project,c)},o);return _(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 PM(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 ei,o=r.configuration.makeFetcher(),a=await o.fetch(t,{cache:e,project:r,fetcher:o,checksums:n,report:s}),l=await T.mktempPromise(),c=v.join(l,"source"),u=v.join(l,"user"),g=v.join(l,".yarn-patch.json");return await Promise.all([T.copyPromise(c,a.prefixPath,{baseFs:a.packageFs}),T.copyPromise(u,a.prefixPath,{baseFs:a.packageFs}),T.writeJsonPromise(g,{locator:S.stringifyLocator(t),version:i.version})]),T.detachTemp(l),u}async function DM(t,e){let r=M.fromPortablePath(t).replace(/\\/g,"/"),i=M.fromPortablePath(e).replace(/\\/g,"/"),{stdout:n,stderr:s}=await hr.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:M.toPortablePath(process.cwd()),env:_(P({},process.env),{GIT_CONFIG_NOSYSTEM:"1",HOME:"",XDG_CONFIG_HOME:"",USERPROFILE:""})});if(s.length>0)throw new Error(`Unabletodiffdirectories.Makesureyouhavearecentversionof'git'availableinPATH.
${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 Zge(t,{configuration:e,report:r}){for(let i of t.parts)for(let n of i.lines)switch(i.type){case Lr.Context:r.reportInfo(null,`${ue.pretty(e,n,"grey")}`);break;case Lr.Deletion:r.reportError(z.FROZEN_LOCKFILE_EXCEPTION,`-${ue.pretty(e,n,ue.Type.REMOVED)}`);break;case Lr.Insertion:r.reportError(z.FROZEN_LOCKFILE_EXCEPTION,`+${ue.pretty(e,n,ue.Type.ADDED)}`);break;default:de.assertNever(i.type)}}var RM=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,P({onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${S.prettyLocator(r.project.configuration,e)}can'tbefoundinthecacheandwillbefetchedfromthedisk`),loader:()=>this.patchPackage(e,r),skipIntegrityCheck:r.skipIntegrityCheck},r.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:S.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:o}}async patchPackage(e,r){let{parentLocator:i,sourceLocator:n,sourceVersion:s,patchPaths:o}=xm(e),a=await km(i,o,r),l=await T.mktempPromise(),c=v.join(l,"current.zip"),u=await r.fetcher.fetch(n,r),g=S.getIdentVendorPath(e),f=await $i(),h=new Jr(c,{libzip:f,create:!0,level:r.project.configuration.get("compressionLevel")});await de.releaseAfterUseAsync(async()=>{await h.copyPromise(g,u.prefixPath,{baseFs:u.packageFs,stableSort:!0})},u.releaseFs),h.saveAndClose();for(let{source:p,optional:d}of a){if(p===null)continue;let m=new Jr(c,{libzip:f,level:r.project.configuration.get("compressionLevel")}),I=new Ft(v.resolve(Se.root,g),{baseFs:m});try{await PQ(kQ(p),{baseFs:I,version:s})}catch(B){if(!(B instanceof vm))throw B;let b=r.project.configuration.get("enableInlineHunks"),R=!b&&!d?" (set enableInlineHunks for details)":"",H=`${S.prettyLocator(r.project.configuration,e)}:${B.message}${R}`,L=K=>{!b||Zge(B.hunk,{configuration:r.project.configuration,report:K})};if(m.discardAndClose(),d){r.report.reportWarningOnce(z.PATCH_HUNK_FAILED,H,{reportExtra:L});continue}else throw new nt(z.PATCH_HUNK_FAILED,H,L)}m.saveAndClose()}return new Jr(c,{libzip:f,level:r.project.configuration.get("compressionLevel")})}};var y_e=3,FM=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}=Sm(e);return n.every(s=>!kM(s))?e:S.bindDescriptor(e,{locator:S.stringifyLocator(r)})}getResolutionDependencies(e,r){let{sourceDescriptor:i}=Sm(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}=Sm(e),a=await km(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=mn.makeHash(`${y_e}`,...a.map(u=>JSON.stringify(u))).slice(0,6);return[xM(e,{parentLocator:n,sourcePackage:l,patchPaths:o,patchHash:c})]}async getSatisfying(e,r,i){return null}async resolve(e,r){let{sourceLocator:i}=xm(e),n=await r.resolver.resolve(i,r);return P(P({},n),e)}};var Pm=class extends Be{constructor(){super(...arguments);this.save=Y.Boolean("-s,--save",!1,{description:"Add the patch to your resolution entries"});this.patchFolder=Y.String()}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd);if(!i)throw new rt(r.cwd,this.context.cwd);await r.restoreInstallState();let n=v.resolve(this.context.cwd,M.toPortablePath(this.patchFolder)),s=v.join(n,"../source"),o=v.join(n,"../.yarn-patch.json");if(!T.existsSync(s))throw new me("Th
-${S.prettyLocator(e,a)}`).join("")}`);s=o[0]}if(!r.storedPackages.has(s.locatorHash))thrownewme("No package found in the project for the given locator");awaitFe.start({configuration:e,json:this.json,stdout:this.context.stdout},asynco=>{leta=awaitPM(s,{cache:n,project:r});o.reportJson({locator:S.stringifyLocator(s),path:M.fromPortablePath(a)}),o.reportInfo(z.UNNAMED,`Package ${S.prettyLocator(e,s)} got extracted with success!`),o.reportInfo(z.UNNAMED,`You can now edit the following folder: ${ue.pretty(e,M.fromPortablePath(a),"magenta")}`),o.reportInfo(z.UNNAMED,`Once you are done run ${ue.pretty(e,`yarn patch-commit ${process.platform==="win32"?'"':""}${M.fromPortablePath(a)}${process.platform==="win32"?'"':""}`,"cyan")} and Yarn will store a patchfile based on your changes.`)})}};Dm.paths=[["patch"]],Dm.usage=ye.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 '});varefe=Dm;varw_e={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:[$ge,efe],fetchers:[RM],resolvers:[FM]},B_e=w_e;varTM={};it(TM,{default:()=>S_e});vartfe=ie(Wp()),LM=class{supportsPackage(e,r){returnr.project.configuration.get("nodeLinker")==="pnpm"}asyncfindPackageLocation(e,r){returnnfe(e,{project:r.project})}asyncfindPackageLocator(e,r){leti=ife(),n=r.project.installersCustomData.get(i);if(!n)thrownewme(`The project in ${ue.pretty(r.project.configuration,`${r.project.cwd}/package.json`,ue.Type.PATH)} doesn't seem to have been installed - running an install there might help`);lets=e.match(/(^.*\/node_modules\/(@[^/]*\/)?[^/]+)(\/.*$)/);if(s){letl=n.locatorByPath.get(s[1]);if(l)returnl}leto=e,a=e;do{a=o,o=v.dirname(a);letl=n.locatorByPath.get(a);if(l)returnl}while(o!==a);returnnull}makeInstaller(e){returnnewrfe(e)}},rfe=class{constructor(e){this.opts=e;this.asyncActions=newafe;this.packageLocations=newMap;this.customData={locatorByPath:newMap}}getCustomDataKey(){returnife()}attachCustomData(e){this.customData=e}asyncinstallPackage(e,r,i){switch(e.linkType){casegt.SOFT:returnthis.installPackageSoft(e,r,i);casegt.HARD:returnthis.installPackageHard(e,r,i)}thrownewError("Assertion failed: Unsupported package link type")}asyncinstallPackageSoft(e,r,i){letn=v.resolve(r.packageFs.getRealPath(),r.prefixPath);returnthis.packageLocations.set(e.locatorHash,n),{packageLocation:n,buildDirective:null}}asyncinstallPackageHard(e,r,i){varu;letn=nfe(e,{project:this.opts.project});this.customData.locatorByPath.set(n,S.stringifyLocator(e)),this.packageLocations.set(e.locatorHash,n),i.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{awaitT.mkdirPromise(n,{recursive:!0}),awaitT.copyPromise(n,r.prefixPath,{baseFs:r.packageFs,overwrite:!1})}));leto=S.isVirtualLocator(e)?S.devirtualizeLocator(e):e,a={manifest:(u=awaitZe.tryFind(r.prefixPath,{baseFs:r.packageFs}))!=null?u:newZe,misc:{hasBindingGyp:Ws.hasBindingGyp(r)}},l=this.opts.project.getDependencyMeta(o,e.version),c=Ws.extractBuildScripts(e,a,l,{configuration:this.opts.project.configuration,report:this.opts.report});return{packageLocation:n,buildDirective:c}}asyncattachInternalDependencies(e,r){this.opts.project.configuration.get("nodeLinker")==="pnpm"&&(!ofe(e,{project:this.opts.project})||this.asyncActions.reduce(e.locatorHash,asynci=>{awaiti;letn=this.packageLocations.get(e.locatorHash);if(typeofn=="undefined")thrownewError(`Assertion failed: Expected the package to have been registered (${S.stringifyLocator(e)})`);lets=v.join(n,wt.nodeModules);r.length>0&&awaitT.mkdirpPromise(s);leto=awaitQ_e(s),a=[];for(let[l,c]ofr){let