This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
infinite-wordle/.yarn/releases/yarn-sources.cjs

779 lines
2.1 MiB
JavaScript
Raw Permalink Normal View History

#!/usr/bin/env node
/* eslint-disable */
//prettier-ignore
(()=>{var bfe=Object.create,Th=Object.defineProperty,Qfe=Object.defineProperties,vfe=Object.getOwnPropertyDescriptor,Sfe=Object.getOwnPropertyDescriptors,xfe=Object.getOwnPropertyNames,RE=Object.getOwnPropertySymbols,kfe=Object.getPrototypeOf,aQ=Object.prototype.hasOwnProperty,oM=Object.prototype.propertyIsEnumerable;var aM=(r,e,t)=>e in r?Th(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,L=(r,e)=>{for(var t in e||(e={}))aQ.call(e,t)&&aM(r,t,e[t]);if(RE)for(var t of RE(e))oM.call(e,t)&&aM(r,t,e[t]);return r},ie=(r,e)=>Qfe(r,Sfe(e)),Pfe=r=>Th(r,"__esModule",{value:!0});var Tr=(r,e)=>{var t={};for(var i in r)aQ.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&RE)for(var i of RE(r))e.indexOf(i)<0&&oM.call(r,i)&&(t[i]=r[i]);return t},Dfe=(r,e)=>()=>(r&&(e=r(r=0)),e),w=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),pt=(r,e)=>{for(var t in e)Th(r,t,{get:e[t],enumerable:!0})},Ffe=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of xfe(e))!aQ.call(r,i)&&i!=="default"&&Th(r,i,{get:()=>e[i],enumerable:!(t=vfe(e,i))||t.enumerable});return r},ge=r=>Ffe(Pfe(Th(r!=null?bfe(kfe(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var LM=w((mZe,PM)=>{PM.exports=DM;DM.sync=_fe;var FM=require("fs");function Vfe(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var i=0;i<t.length;i++){var n=t[i].toLowerCase();if(n&&r.substr(-n.length).toLowerCase()===n)return!0}return!1}function RM(r,e,t){return!r.isSymbolicLink()&&!r.isFile()?!1:Vfe(e,t)}function DM(r,e,t){FM.stat(r,function(i,n){t(i,i?!1:RM(n,r,e))})}function _fe(r,e){return RM(FM.statSync(r),r,e)}});var UM=w((EZe,NM)=>{NM.exports=TM;TM.sync=Xfe;var OM=require("fs");function TM(r,e,t){OM.stat(r,function(i,n){t(i,i?!1:MM(n,e))})}function Xfe(r,e){return MM(OM.statSync(r),e)}function MM(r,e){return r.isFile()&&Zfe(r,e)}function Zfe(r,e){var t=r.mode,i=r.uid,n=r.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),u=a|l,g=t&c||t&l&&n===o||t&a&&i===s||t&u&&s===0;return g}});var HM=w((yZe,KM)=>{var IZe=require("fs"),WE;process.platform==="win32"||global.TESTING_WINDOWS?WE=LM():WE=UM();KM.exports=BQ;BQ.sync=$fe;function BQ(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){BQ(r,e||{},function(s,o){s?n(s):i(o)})})}WE(r,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=!1),t(i,n)})}function $fe(r,e){try{return WE.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var zM=w((wZe,jM)=>{var Wu=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",GM=require("path"),ehe=Wu?";":":",YM=HM(),qM=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),JM=(r,e)=>{let t=e.colon||ehe,i=r.match(/\//)||Wu&&r.match(/\\/)?[""]:[...Wu?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],n=Wu?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Wu?n.split(t):[""];return Wu&&r.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},WM=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=JM(r,e),o=[],a=c=>new Promise((u,g)=>{if(c===i.length)return e.all&&o.length?u(o):g(qM(r));let f=i[c],h=/^".*"$/.test(f)?f.slice(1,-1):f,p=GM.join(h,r),m=!h&&/^\.[\\\/]/.test(r)?r.slice(0,2)+p:p;u(l(m,c,0))}),l=(c,u,g)=>new Promise((f,h)=>{if(g===n.length)return f(a(u+1));let p=n[g];YM(c+p,{pathExt:s},(m,y)=>{if(!m&&y)if(e.all)o.push(c+p);else return f(c+p);return f(l(c,u,g+1))})});return t?a(0).then(c=>t(null,c),t):a(0)},the=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:i,pathExtExe:n}=JM(r,e),s=[];for(let o=0;o<t.length;o++){let a=t[o],l=/^".*"$/.test(a)?a.slice(1,-1):a,c=GM.join(l,r),u=!l&&/^\.[\\\/]/.test(r)?r.slice(0,2)+c:c;for(let g=0;g<i.length;g++){let f=u+i[g];try{if(YM.
`,Yn=Ce(`\\
`,!1),hs=function(){return""},ps="\\",ht=Ce("\\",!1),Po=/^[\\$"`]/,lt=_e(["\\","$",'"',"`"],!1,!1),En=function(C){return C},v="\\a",Tt=Ce("\\a",!1),Ou=function(){return"a"},Yl="\\b",vh=Ce("\\b",!1),Sh=function(){return"\b"},xh=/^[Ee]/,kh=_e(["E","e"],!1,!1),Ph=function(){return""},G="\\f",yt=Ce("\\f",!1),FA=function(){return"\f"},$i="\\n",ql=Ce("\\n",!1),$e=function(){return`
`},Ba="\\r",Mu=Ce("\\r",!1),BE=function(){return"\r"},Dh="\\t",bE=Ce("\\t",!1),ur=function(){return" "},qn="\\v",Jl=Ce("\\v",!1),Fh=function(){return"\v"},Zs=/^[\\'"?]/,ba=_e(["\\","'",'"',"?"],!1,!1),In=function(C){return String.fromCharCode(parseInt(C,16))},Me="\\x",Uu=Ce("\\x",!1),Wl="\\u",$s=Ce("\\u",!1),zl="\\U",RA=Ce("\\U",!1),Ku=function(C){return String.fromCodePoint(parseInt(C,16))},Hu=/^[0-7]/,Qa=_e([["0","7"]],!1,!1),va=/^[0-9a-fA-f]/,it=_e([["0","9"],["a","f"],["A","f"]],!1,!1),Do=ot(),LA="-",_l=Ce("-",!1),eo="+",Vl=Ce("+",!1),QE=".",Rh=Ce(".",!1),ju=function(C,b,R){return{type:"number",value:(C==="-"?-1:1)*parseFloat(b.join("")+"."+R.join(""))}},Lh=function(C,b){return{type:"number",value:(C==="-"?-1:1)*parseInt(b.join(""))}},vE=function(C){return L({type:"variable"},C)},Xl=function(C){return{type:"variable",name:C}},SE=function(C){return C},Gu="*",NA=Ce("*",!1),Nr="/",xE=Ce("/",!1),to=function(C,b,R){return{type:b==="*"?"multiplication":"division",right:R}},ro=function(C,b){return b.reduce((R,H)=>L({left:R},H),C)},Yu=function(C,b,R){return{type:b==="+"?"addition":"subtraction",right:R}},TA="$((",F=Ce("$((",!1),Y="))",de=Ce("))",!1),He=function(C){return C},Te="$(",Xe=Ce("$(",!1),Et=function(C){return C},Ft="${",Jn=Ce("${",!1),Yb=":-",FO=Ce(":-",!1),RO=function(C,b){return{name:C,defaultValue:b}},qb=":-}",LO=Ce(":-}",!1),NO=function(C){return{name:C,defaultValue:[]}},Jb=":+",TO=Ce(":+",!1),OO=function(C,b){return{name:C,alternativeValue:b}},Wb=":+}",MO=Ce(":+}",!1),UO=function(C){return{name:C,alternativeValue:[]}},zb=function(C){return{name:C}},KO="$",HO=Ce("$",!1),jO=function(C){return e.isGlobPattern(C)},GO=function(C){return C},_b=/^[a-zA-Z0-9_]/,Vb=_e([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),Xb=function(){return T()},Zb=/^[$@*?#a-zA-Z0-9_\-]/,$b=_e(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),YO=/^[(){}<>$|&; \t"']/,qu=_e(["(",")","{","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),eQ=/^[<>&; \t"']/,tQ=_e(["<",">","&",";"," "," ",'"',"'"],!1,!1),kE=/^[ \t]/,PE=_e([" "," "],!1,!1),B=0,Ke=0,OA=[{line:1,column:1}],d=0,E=[],I=0,D;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');n=i[e.startRule]}function T(){return r.substring(Ke,B)}function V(){return It(Ke,B)}function re(C,b){throw b=b!==void 0?b:It(Ke,B),Oi([ut(C)],r.substring(Ke,B),b)}function we(C,b){throw b=b!==void 0?b:It(Ke,B),Wn(C,b)}function Ce(C,b){return{type:"literal",text:C,ignoreCase:b}}function _e(C,b,R){return{type:"class",parts:C,inverted:b,ignoreCase:R}}function ot(){return{type:"any"}}function wt(){return{type:"end"}}function ut(C){return{type:"other",description:C}}function nt(C){var b=OA[C],R;if(b)return b;for(R=C-1;!OA[R];)R--;for(b=OA[R],b={line:b.line,column:b.column};R<C;)r.charCodeAt(R)===10?(b.line++,b.column=1):b.column++,R++;return OA[C]=b,b}function It(C,b){var R=nt(C),H=nt(b);return{start:{offset:C,line:R.line,column:R.column},end:{offset:b,line:H.line,column:H.column}}}function ve(C){B<d||(B>d&&(d=B,E=[]),E.push(C))}function Wn(C,b){return new nc(C,null,null,b)}function Oi(C,b,R){return new nc(nc.buildMessage(C,b),C,b,R)}function MA(){var C,b;return C=B,b=Gr(),b===t&&(b=null),b!==t&&(Ke=C,b=s(b)),C=b,C}function Gr(){var C,b,R,H,ue;if(C=B,b=Yr(),b!==t){for(R=[],H=je();H!==t;)R.push(H),H=je();R!==t?(H=Sa(),H!==t?(ue=ds(),ue===t&&(ue=null),ue!==t?(Ke=C,b=o(b,H,ue),C=b):(B=C,C=t)):(B=C,C=t)):(B=C,C=t)}else B=C,C=t;if(C===t)if(C=B,b=Yr(),b!==t){for(R=[],H=je();H!==t;)R.push(H),H=je();R!==t?(H=Sa(),H===t&&(H=null),H!==t?(Ke=C,b=a(b,H),C=b):(B=C,C=t)):(B=C,C=t)}else B=C,C=t;return C}function ds(){var C,b,R,H,ue;for(C=B,b=[],R=je();R!==t;)b.push(R),R=je();if(b!==t)if(R=Gr(),R!==t){for(H=[],ue=je();ue!==t;)H.push(ue),ue=je();H!==t?(Ke=C,b=l(R),C=b):(B=C,C=t)}else B=C,C=t;else B=C,C=t;return C}function Sa(){var C;return r.charCodeAt(B)===59?(C=c,B++):(C=t,I===0&&ve(u)),C===t&&(r.charCodeAt(B)===38?(C=g,B++):(C=t,I===0&&ve(f))),C}function Yr(){var C,b,R;return C=B,b=qO(),b!==t?(R=afe(),R===t&&(R=null),R!==t?(Ke=C,b=h(b,R),C=b):(B=C,C=t)):(B=C,C=t)
\x85\u2028\u2029`.indexOf(this.buffer.charAt(n-1))===-1;)if(n-=1,this.position-n>t/2-1){i=" ... ",n+=5;break}for(s="",o=this.position;o<this.buffer.length&&`\0\r
\x85\u2028\u2029`.indexOf(this.buffer.charAt(o))===-1;)if(o+=1,o-this.position>t/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(n,o),vU.repeat(" ",e)+i+a+s+`
`+vU.repeat(" ",e+this.position-n+i.length)+"^"};MQ.prototype.toString=function(e){var t,i="";return this.name&&(i+='in "'+this.name+'" '),i+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(i+=`:
`+t)),i};QU.exports=MQ});var Ai=w((XZe,xU)=>{"use strict";var kU=Xu(),Phe=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],Dhe=["scalar","sequence","mapping"];function Fhe(r){var e={};return r!==null&&Object.keys(r).forEach(function(t){r[t].forEach(function(i){e[String(i)]=t})}),e}function Rhe(r,e){if(e=e||{},Object.keys(e).forEach(function(t){if(Phe.indexOf(t)===-1)throw new kU('Unknown option "'+t+'" is met in definition of "'+r+'" YAML type.')}),this.tag=r,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=Fhe(e.styleAliases||null),Dhe.indexOf(this.kind)===-1)throw new kU('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')}xU.exports=Rhe});var lc=w((ZZe,PU)=>{"use strict";var DU=Ac(),eI=Xu(),Lhe=Ai();function UQ(r,e,t){var i=[];return r.include.forEach(function(n){t=UQ(n,e,t)}),r[e].forEach(function(n){t.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&i.push(o)}),t.push(n)}),t.filter(function(n,s){return i.indexOf(s)===-1})}function Nhe(){var r={scalar:{},sequence:{},mapping:{},fallback:{}},e,t;function i(n){r[n.kind][n.tag]=r.fallback[n.tag]=n}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(i);return r}function Zu(r){this.include=r.include||[],this.implicit=r.implicit||[],this.explicit=r.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&e.loadKind!=="scalar")throw new eI("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=UQ(this,"implicit",[]),this.compiledExplicit=UQ(this,"explicit",[]),this.compiledTypeMap=Nhe(this.compiledImplicit,this.compiledExplicit)}Zu.DEFAULT=null;Zu.create=function(){var e,t;switch(arguments.length){case 1:e=Zu.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new eI("Wrong number of arguments for Schema.create function")}if(e=DU.toArray(e),t=DU.toArray(t),!e.every(function(i){return i instanceof Zu}))throw new eI("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(i){return i instanceof Lhe}))throw new eI("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new Zu({include:e,explicit:t})};PU.exports=Zu});var RU=w(($Ze,FU)=>{"use strict";var The=Ai();FU.exports=new The("tag:yaml.org,2002:str",{kind:"scalar",construct:function(r){return r!==null?r:""}})});var NU=w((e$e,LU)=>{"use strict";var Ohe=Ai();LU.exports=new Ohe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(r){return r!==null?r:[]}})});var OU=w((t$e,TU)=>{"use strict";var Mhe=Ai();TU.exports=new Mhe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(r){return r!==null?r:{}}})});var tI=w((r$e,MU)=>{"use strict";var Uhe=lc();MU.exports=new Uhe({explicit:[RU(),NU(),OU()]})});var KU=w((i$e,UU)=>{"use strict";var Khe=Ai();function Hhe(r){if(r===null)return!0;var e=r.length;return e===1&&r==="~"||e===4&&(r==="null"||r==="Null"||r==="NULL")}function jhe(){return null}function Ghe(r){return r===null}UU.exports=new Khe("tag:yaml.org,2002:null",{kind:"scalar",resolve:Hhe,construct:jhe,predicate:Ghe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var jU=w((n$e,HU)=>{"use strict";var Yhe=Ai();function qhe(r){if(r===null)return!1;var e=r.length;return e===4&&(r==="true"||r==="True"||r==="TRUE")||e===5&&(r==="false"||r==="False"||r==="FALSE")}function Jhe(r){return r==="true"||r==="True"||r==="TRUE"}function Whe(r){return Object.prototype.toString.call(r)==="[object Boolean]"}HU.exports=new Yhe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:qhe,construct:Jhe,predicate:Whe,represent:{lowercase:function(r){return r?"true":"false"},uppercase:function(r){return r?"TRUE"
\r`;function mpe(r){if(r===null)return!1;var e,t,i=0,n=r.length,s=jQ;for(t=0;t<n;t++)if(e=s.indexOf(r.charAt(t)),!(e>64)){if(e<0)return!1;i+=6}return i%8==0}function Epe(r){var e,t,i=r.replace(/[\r\n=]/g,""),n=i.length,s=jQ,o=0,a=[];for(e=0;e<n;e++)e%4==0&&e&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(i.charAt(e));return t=n%4*6,t===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):t===18?(a.push(o>>10&255),a.push(o>>2&255)):t===12&&a.push(o>>4&255),cc?cc.from?cc.from(a):new cc(a):a}function Ipe(r){var e="",t=0,i,n,s=r.length,o=jQ;for(i=0;i<s;i++)i%3==0&&i&&(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]),t=(t<<8)+r[i];return n=s%3,n===0?(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]):n===2?(e+=o[t>>10&63],e+=o[t>>4&63],e+=o[t<<2&63],e+=o[64]):n===1&&(e+=o[t>>2&63],e+=o[t<<4&63],e+=o[64],e+=o[64]),e}function ype(r){return cc&&cc.isBuffer(r)}r1.exports=new Cpe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:mpe,construct:Epe,predicate:ype,represent:Ipe})});var o1=w((g$e,s1)=>{"use strict";var wpe=Ai(),Bpe=Object.prototype.hasOwnProperty,bpe=Object.prototype.toString;function Qpe(r){if(r===null)return!0;var e=[],t,i,n,s,o,a=r;for(t=0,i=a.length;t<i;t+=1){if(n=a[t],o=!1,bpe.call(n)!=="[object Object]")return!1;for(s in n)if(Bpe.call(n,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}function vpe(r){return r!==null?r:[]}s1.exports=new wpe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Qpe,construct:vpe})});var A1=w((f$e,a1)=>{"use strict";var Spe=Ai(),xpe=Object.prototype.toString;function kpe(r){if(r===null)return!0;var e,t,i,n,s,o=r;for(s=new Array(o.length),e=0,t=o.length;e<t;e+=1){if(i=o[e],xpe.call(i)!=="[object Object]"||(n=Object.keys(i),n.length!==1))return!1;s[e]=[n[0],i[n[0]]]}return!0}function Ppe(r){if(r===null)return[];var e,t,i,n,s,o=r;for(s=new Array(o.length),e=0,t=o.length;e<t;e+=1)i=o[e],n=Object.keys(i),s[e]=[n[0],i[n[0]]];return s}a1.exports=new Spe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:kpe,construct:Ppe})});var c1=w((h$e,l1)=>{"use strict";var Dpe=Ai(),Fpe=Object.prototype.hasOwnProperty;function Rpe(r){if(r===null)return!0;var e,t=r;for(e in t)if(Fpe.call(t,e)&&t[e]!==null)return!1;return!0}function Lpe(r){return r!==null?r:{}}l1.exports=new Dpe("tag:yaml.org,2002:set",{kind:"mapping",resolve:Rpe,construct:Lpe})});var $u=w((p$e,u1)=>{"use strict";var Npe=lc();u1.exports=new Npe({include:[HQ()],implicit:[$U(),t1()],explicit:[n1(),o1(),A1(),c1()]})});var f1=w((d$e,g1)=>{"use strict";var Tpe=Ai();function Ope(){return!0}function Mpe(){}function Upe(){return""}function Kpe(r){return typeof r=="undefined"}g1.exports=new Tpe("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:Ope,construct:Mpe,predicate:Kpe,represent:Upe})});var p1=w((C$e,h1)=>{"use strict";var Hpe=Ai();function jpe(r){if(r===null||r.length===0)return!1;var e=r,t=/\/([gim]*)$/.exec(r),i="";return!(e[0]==="/"&&(t&&(i=t[1]),i.length>3||e[e.length-i.length-1]!=="/"))}function Gpe(r){var e=r,t=/\/([gim]*)$/.exec(r),i="";return e[0]==="/"&&(t&&(i=t[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)}function Ype(r){var e="/"+r.source+"/";return r.global&&(e+="g"),r.multiline&&(e+="m"),r.ignoreCase&&(e+="i"),e}function qpe(r){return Object.prototype.toString.call(r)==="[object RegExp]"}h1.exports=new Hpe("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:jpe,construct:Gpe,predicate:qpe,represent:Ype})});var m1=w((m$e,d1)=>{"use strict";var rI;try{C1=require,rI=C1("esprima")}catch(r){typeof window!="undefined"&&(rI=window.esprima)}var C1,Jpe=Ai();function Wpe(r){if(r===null)return!1;try{var e="("+r+")",t=rI.parse(e,{range:!0});return!(t.type!=="Program"||t.body.length!==1||t.body[0].type!=="ExpressionStatement"||t.body[0].expression.type!=="ArrowFunctionExpression"&&t.body[0].expression.type!=="FunctionExpression")}catch(i){return!1}}function zpe(r){var e="("+r+")",t=rI.parse(e,{range:!0}),i=[],n;if(t.type!=="Program"||t.body.length!==1||t.body[0].type!=="ExpressionStatement"||t.body[0].expression.type!=="ArrowFunctionExpression"&&
`:r===118?"\v":r===102?"\f":r===114?"\r":r===101?"":r===32?" ":r===34?'"':r===47?"/":r===92?"\\":r===78?"\x85":r===95?"\xA0":r===76?"\u2028":r===80?"\u2029":""}function ode(r){return r<=65535?String.fromCharCode(r):String.fromCharCode((r-65536>>10)+55296,(r-65536&1023)+56320)}var P1=new Array(256),D1=new Array(256);for(var tg=0;tg<256;tg++)P1[tg]=k1(tg)?1:0,D1[tg]=k1(tg);function ade(r,e){this.input=r,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=r.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function F1(r,e){return new y1(e,new Xpe(r.filename,r.input,r.position,r.line,r.position-r.lineStart))}function dt(r,e){throw F1(r,e)}function sI(r,e){r.onWarning&&r.onWarning.call(null,F1(r,e))}var R1={YAML:function(e,t,i){var n,s,o;e.version!==null&&dt(e,"duplication of %YAML directive"),i.length!==1&&dt(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null&&dt(e,"ill-formed argument of the YAML directive"),s=parseInt(n[1],10),o=parseInt(n[2],10),s!==1&&dt(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&sI(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,s;i.length!==2&&dt(e,"TAG directive accepts exactly two arguments"),n=i[0],s=i[1],v1.test(n)||dt(e,"ill-formed tag handle (first argument) of the TAG directive"),jA.call(e.tagMap,n)&&dt(e,'there is a previously declared suffix for "'+n+'" tag handle'),S1.test(s)||dt(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[n]=s}};function GA(r,e,t,i){var n,s,o,a;if(e<t){if(a=r.input.slice(e,t),i)for(n=0,s=a.length;n<s;n+=1)o=a.charCodeAt(n),o===9||32<=o&&o<=1114111||dt(r,"expected valid JSON character");else ede.test(a)&&dt(r,"the stream contains non-printable characters");r.result+=a}}function L1(r,e,t,i){var n,s,o,a;for(La.isObject(t)||dt(r,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(t),o=0,a=n.length;o<a;o+=1)s=n[o],jA.call(e,s)||(e[s]=t[s],i[s]=!0)}function rg(r,e,t,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])&&dt(r,"nested arrays are not supported inside keys"),typeof n=="object"&&x1(n[l])==="[object Object]"&&(n[l]="[object Object]");if(typeof n=="object"&&x1(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)L1(r,e,s[l],t);else L1(r,e,s,t);else!r.json&&!jA.call(t,n)&&jA.call(e,n)&&(r.line=o||r.line,r.position=a||r.position,dt(r,"duplicated mapping key")),e[n]=s,delete t[n];return e}function YQ(r){var e;e=r.input.charCodeAt(r.position),e===10?r.position++:e===13?(r.position++,r.input.charCodeAt(r.position)===10&&r.position++):dt(r,"a line break is expected"),r.line+=1,r.lineStart=r.position}function $r(r,e,t){for(var i=0,n=r.input.charCodeAt(r.position);n!==0;){for(;uc(n);)n=r.input.charCodeAt(++r.position);if(e&&n===35)do n=r.input.charCodeAt(++r.position);while(n!==10&&n!==13&&n!==0);if(Ro(n))for(YQ(r),n=r.input.charCodeAt(r.position),i++,r.lineIndent=0;n===32;)r.lineIndent++,n=r.input.charCodeAt(++r.position);else break}return t!==-1&&i!==0&&r.lineIndent<t&&sI(r,"deficient indentation"),i}function oI(r){var e=r.position,t;return t=r.input.charCodeAt(e),!!((t===45||t===46)&&t===r.input.charCodeAt(e+1)&&t===r.input.charCodeAt(e+2)&&(e+=3,t=r.input.charCodeAt(e),t===0||wn(t)))}function qQ(r,e){e===1?r.result+=" ":e>1&&(r.result+=La.repeat(`
`,e-1))}function Ade(r,e,t){var i,n,s,o,a,l,c,u,g=r.kind,f=r.result,h;if(h=r.input.charCodeAt(r.position),wn(h)||eg(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=r.input.charCodeAt(r.position+1),wn(n)||t&&eg(n)))return!1;for(r.kind="scalar",r.result="",s=o=r.position,a=!1;h!==0;){if(h===58){if(n=r.input.charCodeAt(r.position+1),wn(n)||t&&eg(n))break}else if(h===35){if(i=r.input.charCodeAt(r.position-1),wn(i))break}else{if(r.position===r.lineStart&&oI(r)||t&&eg(h))break;if(Ro(h))if(l=r.line,c=r.lineStart,u=r.lineIndent,$r(r,!1,-1),r.lineIndent>=e){a=!0,h=r.input.charCodeAt(r.position);continue}else{r.position=o,r.line=l,r.lineStart=c,r.lineIndent=u;break}}a&&(GA(r,s,o,!1),qQ(r,r.line-l),s=o=r.position,a=!1),uc(h)||(o=r.position+1),h=r.input.charCodeAt(++r.position)}return GA(r,s,o,!1),r.result?!0:(r.kind=g,r.result=f,!1)}function lde(r,e){var t,i,n;if(t=r.input.charCodeAt(r.position),t!==39)return!1;for(r.kind="scalar",r.result="",r.position++,i=n=r.position;(t=r.input.charCodeAt(r.position))!==0;)if(t===39)if(GA(r,i,r.position,!0),t=r.input.charCodeAt(++r.position),t===39)i=r.position,r.position++,n=r.position;else return!0;else Ro(t)?(GA(r,i,n,!0),qQ(r,$r(r,!1,e)),i=n=r.position):r.position===r.lineStart&&oI(r)?dt(r,"unexpected end of the document within a single quoted scalar"):(r.position++,n=r.position);dt(r,"unexpected end of the stream within a single quoted scalar")}function cde(r,e){var t,i,n,s,o,a;if(a=r.input.charCodeAt(r.position),a!==34)return!1;for(r.kind="scalar",r.result="",r.position++,t=i=r.position;(a=r.input.charCodeAt(r.position))!==0;){if(a===34)return GA(r,t,r.position,!0),r.position++,!0;if(a===92){if(GA(r,t,r.position,!0),a=r.input.charCodeAt(++r.position),Ro(a))$r(r,!1,e);else if(a<256&&P1[a])r.result+=D1[a],r.position++;else if((o=nde(a))>0){for(n=o,s=0;n>0;n--)a=r.input.charCodeAt(++r.position),(o=ide(a))>=0?s=(s<<4)+o:dt(r,"expected hexadecimal character");r.result+=ode(s),r.position++}else dt(r,"unknown escape sequence");t=i=r.position}else Ro(a)?(GA(r,t,i,!0),qQ(r,$r(r,!1,e)),t=i=r.position):r.position===r.lineStart&&oI(r)?dt(r,"unexpected end of the document within a double quoted scalar"):(r.position++,i=r.position)}dt(r,"unexpected end of the stream within a double quoted scalar")}function ude(r,e){var t=!0,i,n=r.tag,s,o=r.anchor,a,l,c,u,g,f={},h,p,m,y;if(y=r.input.charCodeAt(r.position),y===91)l=93,g=!1,s=[];else if(y===123)l=125,g=!0,s={};else return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=s),y=r.input.charCodeAt(++r.position);y!==0;){if($r(r,!0,e),y=r.input.charCodeAt(r.position),y===l)return r.position++,r.tag=n,r.anchor=o,r.kind=g?"mapping":"sequence",r.result=s,!0;t||dt(r,"missed comma between flow collection entries"),p=h=m=null,c=u=!1,y===63&&(a=r.input.charCodeAt(r.position+1),wn(a)&&(c=u=!0,r.position++,$r(r,!0,e))),i=r.line,ig(r,e,iI,!1,!0),p=r.tag,h=r.result,$r(r,!0,e),y=r.input.charCodeAt(r.position),(u||r.line===i)&&y===58&&(c=!0,y=r.input.charCodeAt(++r.position),$r(r,!0,e),ig(r,e,iI,!1,!0),m=r.result),g?rg(r,s,f,p,h,m):c?s.push(rg(r,null,f,p,h,m)):s.push(h),$r(r,!0,e),y=r.input.charCodeAt(r.position),y===44?(t=!0,y=r.input.charCodeAt(++r.position)):t=!1}dt(r,"unexpected end of the stream within a flow collection")}function gde(r,e){var t,i,n=GQ,s=!1,o=!1,a=e,l=0,c=!1,u,g;if(g=r.input.charCodeAt(r.position),g===124)i=!1;else if(g===62)i=!0;else return!1;for(r.kind="scalar",r.result="";g!==0;)if(g=r.input.charCodeAt(++r.position),g===43||g===45)GQ===n?n=g===43?Q1:$pe:dt(r,"repeat of a chomping mode identifier");else if((u=sde(g))>=0)u===0?dt(r,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?dt(r,"repeat of an indentation width identifier"):(a=e+u-1,o=!0);else break;if(uc(g)){do g=r.input.charCodeAt(++r.position);while(uc(g));if(g===35)do g=r.input.charCodeAt(++r.position);while(!Ro(g)&&g!==0)}for(;g!==0;){for(YQ(r),r.lineIndent=0,g=r.input.charCodeAt(r.position);(!o||r.lineIndent<a)&&g===32;)r.lineIndent++,g=r.input.charCodeAt(++r.position);if(!o&&r.lineIndent>a&&(a=r
`,s?1+l:l):n===GQ&&s&&(r.result+=`
`);break}for(i?uc(g)?(c=!0,r.result+=La.repeat(`
`,s?1+l:l)):c?(c=!1,r.result+=La.repeat(`
`,l+1)):l===0?s&&(r.result+=" "):r.result+=La.repeat(`
`,l):r.result+=La.repeat(`
`,s?1+l:l),s=!0,o=!0,l=0,t=r.position;!Ro(g)&&g!==0;)g=r.input.charCodeAt(++r.position);GA(r,t,r.position,!1)}return!0}function N1(r,e){var t,i=r.tag,n=r.anchor,s=[],o,a=!1,l;for(r.anchor!==null&&(r.anchorMap[r.anchor]=s),l=r.input.charCodeAt(r.position);l!==0&&!(l!==45||(o=r.input.charCodeAt(r.position+1),!wn(o)));){if(a=!0,r.position++,$r(r,!0,-1)&&r.lineIndent<=e){s.push(null),l=r.input.charCodeAt(r.position);continue}if(t=r.line,ig(r,e,b1,!1,!0),s.push(r.result),$r(r,!0,-1),l=r.input.charCodeAt(r.position),(r.line===t||r.lineIndent>e)&&l!==0)dt(r,"bad indentation of a sequence entry");else if(r.lineIndent<e)break}return a?(r.tag=i,r.anchor=n,r.kind="sequence",r.result=s,!0):!1}function fde(r,e,t){var i,n,s,o,a=r.tag,l=r.anchor,c={},u={},g=null,f=null,h=null,p=!1,m=!1,y;for(r.anchor!==null&&(r.anchorMap[r.anchor]=c),y=r.input.charCodeAt(r.position);y!==0;){if(i=r.input.charCodeAt(r.position+1),s=r.line,o=r.position,(y===63||y===58)&&wn(i))y===63?(p&&(rg(r,c,u,g,f,null),g=f=h=null),m=!0,p=!0,n=!0):p?(p=!1,n=!0):dt(r,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),r.position+=1,y=i;else if(ig(r,t,B1,!1,!0))if(r.line===s){for(y=r.input.charCodeAt(r.position);uc(y);)y=r.input.charCodeAt(++r.position);if(y===58)y=r.input.charCodeAt(++r.position),wn(y)||dt(r,"a whitespace character is expected after the key-value separator within a block mapping"),p&&(rg(r,c,u,g,f,null),g=f=h=null),m=!0,p=!1,n=!1,g=r.tag,f=r.result;else if(m)dt(r,"can not read an implicit mapping pair; a colon is missed");else return r.tag=a,r.anchor=l,!0}else if(m)dt(r,"can not read a block mapping entry; a multiline key may not be an implicit key");else return r.tag=a,r.anchor=l,!0;else break;if((r.line===s||r.lineIndent>e)&&(ig(r,e,nI,!0,n)&&(p?f=r.result:h=r.result),p||(rg(r,c,u,g,f,h,s,o),g=f=h=null),$r(r,!0,-1),y=r.input.charCodeAt(r.position)),r.lineIndent>e&&y!==0)dt(r,"bad indentation of a mapping entry");else if(r.lineIndent<e)break}return p&&rg(r,c,u,g,f,null),m&&(r.tag=a,r.anchor=l,r.kind="mapping",r.result=c),m}function hde(r){var e,t=!1,i=!1,n,s,o;if(o=r.input.charCodeAt(r.position),o!==33)return!1;if(r.tag!==null&&dt(r,"duplication of a tag property"),o=r.input.charCodeAt(++r.position),o===60?(t=!0,o=r.input.charCodeAt(++r.position)):o===33?(i=!0,n="!!",o=r.input.charCodeAt(++r.position)):n="!",e=r.position,t){do o=r.input.charCodeAt(++r.position);while(o!==0&&o!==62);r.position<r.length?(s=r.input.slice(e,r.position),o=r.input.charCodeAt(++r.position)):dt(r,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!wn(o);)o===33&&(i?dt(r,"tag suffix cannot contain exclamation marks"):(n=r.input.slice(e-1,r.position+1),v1.test(n)||dt(r,"named tag handle cannot contain such characters"),i=!0,e=r.position+1)),o=r.input.charCodeAt(++r.position);s=r.input.slice(e,r.position),rde.test(s)&&dt(r,"tag suffix cannot contain flow indicator characters")}return s&&!S1.test(s)&&dt(r,"tag name cannot contain such characters: "+s),t?r.tag=s:jA.call(r.tagMap,n)?r.tag=r.tagMap[n]+s:n==="!"?r.tag="!"+s:n==="!!"?r.tag="tag:yaml.org,2002:"+s:dt(r,'undeclared tag handle "'+n+'"'),!0}function pde(r){var e,t;if(t=r.input.charCodeAt(r.position),t!==38)return!1;for(r.anchor!==null&&dt(r,"duplication of an anchor property"),t=r.input.charCodeAt(++r.position),e=r.position;t!==0&&!wn(t)&&!eg(t);)t=r.input.charCodeAt(++r.position);return r.position===e&&dt(r,"name of an anchor node must contain at least one character"),r.anchor=r.input.slice(e,r.position),!0}function dde(r){var e,t,i;if(i=r.input.charCodeAt(r.position),i!==42)return!1;for(i=r.input.charCodeAt(++r.position),e=r.position;i!==0&&!wn(i)&&!eg(i);)i=r.input.charCodeAt(++r.position);return r.position===e&&dt(r,"name of an alias node must contain at least one character"),t=r.input.slice(e,r.position),jA.call(r.anchorMap,t)||dt(r,'unidentified alias "'+t+'"'),r.result=r.anchorMap[t],$r(r,!0,-1),!0}function ig(r,e,t,i,n){var s,o,a,l=1,c=!1,u=!1,g,f,h,p,m;if(r.listener!==null&&r.listener("open",r),r.tag=null,r.anchor=null,r.kind=null,r.result=null,s
`),r.charCodeAt(0)===65279&&(r=r.slice(1)));var t=new ade(r,e),i=r.indexOf("\0");for(i!==-1&&(t.position=i,dt(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)Cde(t);return t.documents}function O1(r,e,t){e!==null&&typeof e=="object"&&typeof t=="undefined"&&(t=e,e=null);var i=T1(r,t);if(typeof e!="function")return i;for(var n=0,s=i.length;n<s;n+=1)e(i[n])}function M1(r,e){var t=T1(r,e);if(t.length!==0){if(t.length===1)return t[0];throw new y1("expected a single document in the stream, but found more")}}function mde(r,e,t){return typeof e=="object"&&e!==null&&typeof t=="undefined"&&(t=e,e=null),O1(r,e,La.extend({schema:w1},t))}function Ede(r,e){return M1(r,La.extend({schema:w1},e))}tp.exports.loadAll=O1;tp.exports.load=M1;tp.exports.safeLoadAll=mde;tp.exports.safeLoad=Ede});var AK=w((y$e,JQ)=>{"use strict";var rp=Ac(),ip=Xu(),Ide=ep(),yde=$u(),K1=Object.prototype.toString,H1=Object.prototype.hasOwnProperty,wde=9,np=10,Bde=13,bde=32,Qde=33,vde=34,j1=35,Sde=37,xde=38,kde=39,Pde=42,G1=44,Dde=45,Y1=58,Fde=61,Rde=62,Lde=63,Nde=64,q1=91,J1=93,Tde=96,W1=123,Ode=124,z1=125,Mi={};Mi[0]="\\0";Mi[7]="\\a";Mi[8]="\\b";Mi[9]="\\t";Mi[10]="\\n";Mi[11]="\\v";Mi[12]="\\f";Mi[13]="\\r";Mi[27]="\\e";Mi[34]='\\"';Mi[92]="\\\\";Mi[133]="\\N";Mi[160]="\\_";Mi[8232]="\\L";Mi[8233]="\\P";var Mde=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function Ude(r,e){var t,i,n,s,o,a,l;if(e===null)return{};for(t={},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=r.compiledTypeMap.fallback[o],l&&H1.call(l.styleAliases,a)&&(a=l.styleAliases[a]),t[o]=a;return t}function _1(r){var e,t,i;if(e=r.toString(16).toUpperCase(),r<=255)t="x",i=2;else if(r<=65535)t="u",i=4;else if(r<=4294967295)t="U",i=8;else throw new ip("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+rp.repeat("0",i-e.length)+e}function Kde(r){this.schema=r.schema||Ide,this.indent=Math.max(1,r.indent||2),this.noArrayIndent=r.noArrayIndent||!1,this.skipInvalid=r.skipInvalid||!1,this.flowLevel=rp.isNothing(r.flowLevel)?-1:r.flowLevel,this.styleMap=Ude(this.schema,r.styles||null),this.sortKeys=r.sortKeys||!1,this.lineWidth=r.lineWidth||80,this.noRefs=r.noRefs||!1,this.noCompatMode=r.noCompatMode||!1,this.condenseFlow=r.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function V1(r,e){for(var t=rp.repeat(" ",e),i=0,n=-1,s="",o,a=r.length;i<a;)n=r.indexOf(`
`,i),n===-1?(o=r.slice(i),i=a):(o=r.slice(i,n+1),i=n+1),o.length&&o!==`
`&&(s+=t),s+=o;return s}function WQ(r,e){return`
`+rp.repeat(" ",r.indent*e)}function Hde(r,e){var t,i,n;for(t=0,i=r.implicitTypes.length;t<i;t+=1)if(n=r.implicitTypes[t],n.resolve(e))return!0;return!1}function zQ(r){return r===bde||r===wde}function ng(r){return 32<=r&&r<=126||161<=r&&r<=55295&&r!==8232&&r!==8233||57344<=r&&r<=65533&&r!==65279||65536<=r&&r<=1114111}function jde(r){return ng(r)&&!zQ(r)&&r!==65279&&r!==Bde&&r!==np}function X1(r,e){return ng(r)&&r!==65279&&r!==G1&&r!==q1&&r!==J1&&r!==W1&&r!==z1&&r!==Y1&&(r!==j1||e&&jde(e))}function Gde(r){return ng(r)&&r!==65279&&!zQ(r)&&r!==Dde&&r!==Lde&&r!==Y1&&r!==G1&&r!==q1&&r!==J1&&r!==W1&&r!==z1&&r!==j1&&r!==xde&&r!==Pde&&r!==Qde&&r!==Ode&&r!==Fde&&r!==Rde&&r!==kde&&r!==vde&&r!==Sde&&r!==Nde&&r!==Tde}function Z1(r){var e=/^\n* /;return e.test(r)}var $1=1,eK=2,tK=3,rK=4,aI=5;function Yde(r,e,t,i,n){var s,o,a,l=!1,c=!1,u=i!==-1,g=-1,f=Gde(r.charCodeAt(0))&&!zQ(r.charCodeAt(r.length-1));if(e)for(s=0;s<r.length;s++){if(o=r.charCodeAt(s),!ng(o))return aI;a=s>0?r.charCodeAt(s-1):null,f=f&&X1(o,a)}else{for(s=0;s<r.length;s++){if(o=r.charCodeAt(s),o===np)l=!0,u&&(c=c||s-g-1>i&&r[g+1]!==" ",g=s);else if(!ng(o))return aI;a=s>0?r.charCodeAt(s-1):null,f=f&&X1(o,a)}c=c||u&&s-g-1>i&&r[g+1]!==" "}return!l&&!c?f&&!n(r)?$1:eK:t>9&&Z1(r)?aI:c?rK:tK}function Wde(r,e,t,i){r.dump=function(){if(e.length===0)return"''";if(!r.noCompatMode&&Mde.indexOf(e)!==-1)return"'"+e+"'";var n=r.indent*Math.max(1,t),s=r.lineWidth===-1?-1:Math.max(Math.min(r.lineWidth,40),r.lineWidth-n),o=i||r.flowLevel>-1&&t>=r.flowLevel;function a(l){return Hde(r,l)}switch(Yde(e,o,r.indent,s,a)){case $1:return e;case eK:return"'"+e.replace(/'/g,"''")+"'";case tK:return"|"+iK(e,r.indent)+nK(V1(e,n));case rK:return">"+iK(e,r.indent)+nK(V1(qde(e,s),n));case aI:return'"'+Jde(e,s)+'"';default:throw new ip("impossible error: invalid scalar style")}}()}function iK(r,e){var t=Z1(r)?String(e):"",i=r[r.length-1]===`
`,n=i&&(r[r.length-2]===`
`||r===`
`),s=n?"+":i?"":"-";return t+s+`
`}function nK(r){return r[r.length-1]===`
`?r.slice(0,-1):r}function qde(r,e){for(var t=/(\n+)([^\n]*)/g,i=function(){var c=r.indexOf(`
`);return c=c!==-1?c:r.length,t.lastIndex=c,sK(r.slice(0,c),e)}(),n=r[0]===`
`||r[0]===" ",s,o;o=t.exec(r);){var a=o[1],l=o[2];s=l[0]===" ",i+=a+(!n&&!s&&l!==""?`
`:"")+sK(l,e),n=s}return i}function sK(r,e){if(r===""||r[0]===" ")return r;for(var t=/ [^ ]/g,i,n=0,s,o=0,a=0,l="";i=t.exec(r);)a=i.index,a-n>e&&(s=o>n?o:a,l+=`
`+r.slice(n,s),n=s+1),o=a;return l+=`
`,r.length-n>e&&o>n?l+=r.slice(n,o)+`
`+r.slice(o+1):l+=r.slice(n),l.slice(1)}function Jde(r){for(var e="",t,i,n,s=0;s<r.length;s++){if(t=r.charCodeAt(s),t>=55296&&t<=56319&&(i=r.charCodeAt(s+1),i>=56320&&i<=57343)){e+=_1((t-55296)*1024+i-56320+65536),s++;continue}n=Mi[t],e+=!n&&ng(t)?r[s]:n||_1(t)}return e}function zde(r,e,t){var i="",n=r.tag,s,o;for(s=0,o=t.length;s<o;s+=1)gc(r,e,t[s],!1,!1)&&(s!==0&&(i+=","+(r.condenseFlow?"":" ")),i+=r.dump);r.tag=n,r.dump="["+i+"]"}function _de(r,e,t,i){var n="",s=r.tag,o,a;for(o=0,a=t.length;o<a;o+=1)gc(r,e+1,t[o],!0,!0)&&((!i||o!==0)&&(n+=WQ(r,e)),r.dump&&np===r.dump.charCodeAt(0)?n+="-":n+="- ",n+=r.dump);r.tag=s,r.dump=n||"[]"}function Vde(r,e,t){var i="",n=r.tag,s=Object.keys(t),o,a,l,c,u;for(o=0,a=s.length;o<a;o+=1)u="",o!==0&&(u+=", "),r.condenseFlow&&(u+='"'),l=s[o],c=t[l],!!gc(r,e,l,!1,!1)&&(r.dump.length>1024&&(u+="? "),u+=r.dump+(r.condenseFlow?'"':"")+":"+(r.condenseFlow?"":" "),!!gc(r,e,c,!1,!1)&&(u+=r.dump,i+=u));r.tag=n,r.dump="{"+i+"}"}function Xde(r,e,t,i){var n="",s=r.tag,o=Object.keys(t),a,l,c,u,g,f;if(r.sortKeys===!0)o.sort();else if(typeof r.sortKeys=="function")o.sort(r.sortKeys);else if(r.sortKeys)throw new ip("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)f="",(!i||a!==0)&&(f+=WQ(r,e)),c=o[a],u=t[c],!!gc(r,e+1,c,!0,!0,!0)&&(g=r.tag!==null&&r.tag!=="?"||r.dump&&r.dump.length>1024,g&&(r.dump&&np===r.dump.charCodeAt(0)?f+="?":f+="? "),f+=r.dump,g&&(f+=WQ(r,e)),!!gc(r,e+1,u,!0,g)&&(r.dump&&np===r.dump.charCodeAt(0)?f+=":":f+=": ",f+=r.dump,n+=f));r.tag=s,r.dump=n||"{}"}function oK(r,e,t){var i,n,s,o,a,l;for(n=t?r.explicitTypes:r.implicitTypes,s=0,o=n.length;s<o;s+=1)if(a=n[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(r.tag=t?a.tag:"?",a.represent){if(l=r.styleMap[a.tag]||a.defaultStyle,K1.call(a.represent)==="[object Function]")i=a.represent(e,l);else if(H1.call(a.represent,l))i=a.represent[l](e,l);else throw new ip("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');r.dump=i}return!0}return!1}function gc(r,e,t,i,n,s){r.tag=null,r.dump=t,oK(r,t,!1)||oK(r,t,!0);var o=K1.call(r.dump);i&&(i=r.flowLevel<0||r.flowLevel>e);var a=o==="[object Object]"||o==="[object Array]",l,c;if(a&&(l=r.duplicates.indexOf(t),c=l!==-1),(r.tag!==null&&r.tag!=="?"||c||r.indent!==2&&e>0)&&(n=!1),c&&r.usedDuplicates[l])r.dump="*ref_"+l;else{if(a&&c&&!r.usedDuplicates[l]&&(r.usedDuplicates[l]=!0),o==="[object Object]")i&&Object.keys(r.dump).length!==0?(Xde(r,e,r.dump,n),c&&(r.dump="&ref_"+l+r.dump)):(Vde(r,e,r.dump),c&&(r.dump="&ref_"+l+" "+r.dump));else if(o==="[object Array]"){var u=r.noArrayIndent&&e>0?e-1:e;i&&r.dump.length!==0?(_de(r,u,r.dump,n),c&&(r.dump="&ref_"+l+r.dump)):(zde(r,u,r.dump),c&&(r.dump="&ref_"+l+" "+r.dump))}else if(o==="[object String]")r.tag!=="?"&&Wde(r,r.dump,e,s);else{if(r.skipInvalid)return!1;throw new ip("unacceptable kind of an object to dump "+o)}r.tag!==null&&r.tag!=="?"&&(r.dump="!<"+r.tag+"> "+r.dump)}return!0}function Zde(r,e){var t=[],i=[],n,s;for(_Q(r,t,i),n=0,s=i.length;n<s;n+=1)e.duplicates.push(t[i[n]]);e.usedDuplicates=new Array(s)}function _Q(r,e,t){var i,n,s;if(r!==null&&typeof r=="object")if(n=e.indexOf(r),n!==-1)t.indexOf(n)===-1&&t.push(n);else if(e.push(r),Array.isArray(r))for(n=0,s=r.length;n<s;n+=1)_Q(r[n],e,t);else for(i=Object.keys(r),n=0,s=i.length;n<s;n+=1)_Q(r[i[n]],e,t)}function aK(r,e){e=e||{};var t=new Kde(e);return t.noRefs||Zde(r,t),gc(t,0,r,!0,!0)?t.dump+`
`:""}function $de(r,e){return aK(r,rp.extend({schema:yde},e))}JQ.exports.dump=aK;JQ.exports.safeDump=$de});var cK=w((w$e,Or)=>{"use strict";var AI=U1(),lK=AK();function lI(r){return function(){throw new Error("Function "+r+" is deprecated and cannot be used.")}}Or.exports.Type=Ai();Or.exports.Schema=lc();Or.exports.FAILSAFE_SCHEMA=tI();Or.exports.JSON_SCHEMA=KQ();Or.exports.CORE_SCHEMA=HQ();Or.exports.DEFAULT_SAFE_SCHEMA=$u();Or.exports.DEFAULT_FULL_SCHEMA=ep();Or.exports.load=AI.load;Or.exports.loadAll=AI.loadAll;Or.exports.safeLoad=AI.safeLoad;Or.exports.safeLoadAll=AI.safeLoadAll;Or.exports.dump=lK.dump;Or.exports.safeDump=lK.safeDump;Or.exports.YAMLException=Xu();Or.exports.MINIMAL_SCHEMA=tI();Or.exports.SAFE_SCHEMA=$u();Or.exports.DEFAULT_SCHEMA=ep();Or.exports.scan=lI("scan");Or.exports.parse=lI("parse");Or.exports.compose=lI("compose");Or.exports.addConstructor=lI("addConstructor")});var gK=w((B$e,uK)=>{"use strict";var eCe=cK();uK.exports=eCe});var hK=w((b$e,fK)=>{"use strict";function tCe(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function fc(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,fc)}tCe(fc,Error);fc.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g<c.parts.length;g++)u+=c.parts[g]instanceof Array?s(c.parts[g][0])+"-"+s(c.parts[g][1]):s(c.parts[g]);return"["+(c.inverted?"^":"")+u+"]"},any:function(c){return"any character"},end:function(c){return"end of input"},other:function(c){return c.description}};function i(c){return c.charCodeAt(0).toString(16).toUpperCase()}function n(c){return c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+i(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+i(u)})}function s(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+i(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+i(u)})}function o(c){return t[c.type](c)}function a(c){var u=new Array(c.length),g,f;for(g=0;g<c.length;g++)u[g]=o(c[g]);if(u.sort(),u.length>0){for(g=1,f=1;g<u.length;g++)u[g-1]!==u[g]&&(u[f]=u[g],f++);u.length=f}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}function l(c){return c?'"'+n(c)+'"':"end of input"}return"Expected "+a(r)+" but "+l(e)+" found."};function rCe(r,e){e=e!==void 0?e:{};var t={},i={Start:$s},n=$s,s=function(F){return[].concat(...F)},o="-",a=ur("-",!1),l=function(F){return F},c=function(F){return Object.assign({},...F)},u="#",g=ur("#",!1),f=Jl(),h=function(){return{}},p=":",m=ur(":",!1),y=function(F,Y){return{[F]:Y}},Q=",",S=ur(",",!1),x=function(F,Y){return Y},M=function(F,Y,de){return Object.assign({},...[F].concat(Y).map(He=>({[He]:de})))},q=function(F){return F},U=function(F){return F},W=Zs("correct indentation"),J=" ",oe=ur(" ",!1),Z=function(F){return F.length===TA*Yu},A=function(F){return F.length===(TA+1)*Yu},ne=function(){return TA++,!0},Ae=function(){return TA--,!0},ee=function(){return Mu()},O=Zs("pseudostring"),N=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,be=qn(["\r",`
`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),Ie=/^[^\r\n\t ,\][{}:#"']/,Ye=qn(["\r",`
`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),te=function(){return Mu().replace(/^ *| *$/g,"")},ae="--",Be=ur("--",!1),he=/^[a-zA-Z\/0-9]/,Fe=qn([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),Oe=/^[^\r\n\t :,]/,xe=qn(["\r",`
`," "," ",":",","],!0,!1),Se="null",pe=ur("null",!1),X=function(){return null},ke="true",le=ur("true",!1),fe=function(){return!0},gt="false",Ht=ur("false",!1),Mt=function(){return!1},mi=Zs("string"),jt='"',Qr=ur('"',!1),Ni=function(){return""},Xs=function(F){return F},Kn=function(F){return F.join("")},Hn=/^[^"\\\0-\x1F\x7F]/,vr=qn(['"',"\\",["\0",""],"\x7F"],!0,!1),jn='\\"',gs=ur('\\"',!1),ya=function(){return'"'},xA="\\\\",Fu=ur("\\\\",!1),fs=function(){return"\\"},kA="\\/",wa=ur("\\/",!1),Ru=function(){return"/"},PA="\\b",DA=ur("\\b",!1),Sr=function(){return"\b"},jl="\\f",Lu=ur("\\f",!1),xo=function(){return"\f"},Nu="\\n",bh=ur("\\n",!1),Qh=function(){return`
`},se="\\r",Ti=ur("\\r",!1),ko=function(){return"\r"},Gn="\\t",Tu=ur("\\t",!1),vt=function(){return" "},Gl="\\u",Yn=ur("\\u",!1),hs=function(F,Y,de,He){return String.fromCharCode(parseInt(`0x${F}${Y}${de}${He}`))},ps=/^[0-9a-fA-F]/,ht=qn([["0","9"],["a","f"],["A","F"]],!1,!1),Po=Zs("blank space"),lt=/^[ \t]/,En=qn([" "," "],!1,!1),v=Zs("white space"),Tt=/^[ \t\n\r]/,Ou=qn([" "," ",`
`,"\r"],!1,!1),Yl=`\r
`,vh=ur(`\r
`,!1),Sh=`
`,xh=ur(`
`,!1),kh="\r",Ph=ur("\r",!1),G=0,yt=0,FA=[{line:1,column:1}],$i=0,ql=[],$e=0,Ba;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');n=i[e.startRule]}function Mu(){return r.substring(yt,G)}function BE(){return In(yt,G)}function Dh(F,Y){throw Y=Y!==void 0?Y:In(yt,G),Wl([Zs(F)],r.substring(yt,G),Y)}function bE(F,Y){throw Y=Y!==void 0?Y:In(yt,G),Uu(F,Y)}function ur(F,Y){return{type:"literal",text:F,ignoreCase:Y}}function qn(F,Y,de){return{type:"class",parts:F,inverted:Y,ignoreCase:de}}function Jl(){return{type:"any"}}function Fh(){return{type:"end"}}function Zs(F){return{type:"other",description:F}}function ba(F){var Y=FA[F],de;if(Y)return Y;for(de=F-1;!FA[de];)de--;for(Y=FA[de],Y={line:Y.line,column:Y.column};de<F;)r.charCodeAt(de)===10?(Y.line++,Y.column=1):Y.column++,de++;return FA[F]=Y,Y}function In(F,Y){var de=ba(F),He=ba(Y);return{start:{offset:F,line:de.line,column:de.column},end:{offset:Y,line:He.line,column:He.column}}}function Me(F){G<$i||(G>$i&&($i=G,ql=[]),ql.push(F))}function Uu(F,Y){return new fc(F,null,null,Y)}function Wl(F,Y,de){return new fc(fc.buildMessage(F,Y),F,Y,de)}function $s(){var F;return F=Ku(),F}function zl(){var F,Y,de;for(F=G,Y=[],de=RA();de!==t;)Y.push(de),de=RA();return Y!==t&&(yt=F,Y=s(Y)),F=Y,F}function RA(){var F,Y,de,He,Te;return F=G,Y=va(),Y!==t?(r.charCodeAt(G)===45?(de=o,G++):(de=t,$e===0&&Me(a)),de!==t?(He=Nr(),He!==t?(Te=Qa(),Te!==t?(yt=F,Y=l(Te),F=Y):(G=F,F=t)):(G=F,F=t)):(G=F,F=t)):(G=F,F=t),F}function Ku(){var F,Y,de;for(F=G,Y=[],de=Hu();de!==t;)Y.push(de),de=Hu();return Y!==t&&(yt=F,Y=c(Y)),F=Y,F}function Hu(){var F,Y,de,He,Te,Xe,Et,Ft,Jn;if(F=G,Y=Nr(),Y===t&&(Y=null),Y!==t){if(de=G,r.charCodeAt(G)===35?(He=u,G++):(He=t,$e===0&&Me(g)),He!==t){if(Te=[],Xe=G,Et=G,$e++,Ft=ro(),$e--,Ft===t?Et=void 0:(G=Et,Et=t),Et!==t?(r.length>G?(Ft=r.charAt(G),G++):(Ft=t,$e===0&&Me(f)),Ft!==t?(Et=[Et,Ft],Xe=Et):(G=Xe,Xe=t)):(G=Xe,Xe=t),Xe!==t)for(;Xe!==t;)Te.push(Xe),Xe=G,Et=G,$e++,Ft=ro(),$e--,Ft===t?Et=void 0:(G=Et,Et=t),Et!==t?(r.length>G?(Ft=r.charAt(G),G++):(Ft=t,$e===0&&Me(f)),Ft!==t?(Et=[Et,Ft],Xe=Et):(G=Xe,Xe=t)):(G=Xe,Xe=t);else Te=t;Te!==t?(He=[He,Te],de=He):(G=de,de=t)}else G=de,de=t;if(de===t&&(de=null),de!==t){if(He=[],Te=to(),Te!==t)for(;Te!==t;)He.push(Te),Te=to();else He=t;He!==t?(yt=F,Y=h(),F=Y):(G=F,F=t)}else G=F,F=t}else G=F,F=t;if(F===t&&(F=G,Y=va(),Y!==t?(de=_l(),de!==t?(He=Nr(),He===t&&(He=null),He!==t?(r.charCodeAt(G)===58?(Te=p,G++):(Te=t,$e===0&&Me(m)),Te!==t?(Xe=Nr(),Xe===t&&(Xe=null),Xe!==t?(Et=Qa(),Et!==t?(yt=F,Y=y(de,Et),F=Y):(G=F,F=t)):(G=F,F=t)):(G=F,F=t)):(G=F,F=t)):(G=F,F=t)):(G=F,F=t),F===t&&(F=G,Y=va(),Y!==t?(de=eo(),de!==t?(He=Nr(),He===t&&(He=null),He!==t?(r.charCodeAt(G)===58?(Te=p,G++):(Te=t,$e===0&&Me(m)),Te!==t?(Xe=Nr(),Xe===t&&(Xe=null),Xe!==t?(Et=Qa(),Et!==t?(yt=F,Y=y(de,Et),F=Y):(G=F,F=t)):(G=F,F=t)):(G=F,F=t)):(G=F,F=t)):(G=F,F=t)):(G=F,F=t),F===t))){if(F=G,Y=va(),Y!==t)if(de=eo(),de!==t)if(He=Nr(),He!==t)if(Te=QE(),Te!==t){if(Xe=[],Et=to(),Et!==t)for(;Et!==t;)Xe.push(Et),Et=to();else Xe=t;Xe!==t?(yt=F,Y=y(de,Te),F=Y):(G=F,F=t)}else G=F,F=t;else G=F,F=t;else G=F,F=t;else G=F,F=t;if(F===t)if(F=G,Y=va(),Y!==t)if(de=eo(),de!==t){if(He=[],Te=G,Xe=Nr(),Xe===t&&(Xe=null),Xe!==t?(r.charCodeAt(G)===44?(Et=Q,G++):(Et=t,$e===0&&Me(S)),Et!==t?(Ft=Nr(),Ft===t&&(Ft=null),Ft!==t?(Jn=eo(),Jn!==t?(yt=Te,Xe=x(de,Jn),Te=Xe):(G=Te,Te=t)):(G=Te,Te=t)):(G=Te,Te=t)):(G=Te,Te=t),Te!==t)for(;Te!==t;)He.push(Te),Te=G,Xe=Nr(),Xe===t&&(Xe=null),Xe!==t?(r.charCodeAt(G)===44?(Et=Q,G++):(Et=t,$e===0&&Me(S)),Et!==t?(Ft=Nr(),Ft===t&&(Ft=null),Ft!==t?(Jn=eo(),Jn!==t?(yt=Te,Xe=x(de,Jn),Te=Xe):(G=Te,Te=t)):(G=Te,Te=t)):(G=Te,Te=t)):(G=Te,Te=t);else He=t;He!==t?(Te=Nr(),Te===t&&(Te=null),Te!==t?(r.charCodeAt(G)===58?(Xe=p,G++):(Xe=t,$e===0&&Me(m)),Xe!==t?(Et=Nr(),Et===t&&(Et=null),Et!==t?(Ft=Qa(),Ft!==t?(yt=F,Y=M(de,He,Ft),F=Y):(G=F,F=t)):(G=F,F=t)):(G=F,F=t)):(G=F,F=t)):(G=F,F=t)}else G=F,F=t;else G=F,F=t}return F}function Qa(){var F,Y,de,He,Te,Xe,Et;if(F=G,Y=G,$e++,de=G,He=ro(),He!==t?(Te=it(),Te!==t?(r.charCodeAt(G)===45?(Xe=o,G+
`),n("\r"),n("\u2028"),n("\u2029")]}},r.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},r.prototype.decimalEscapeAtom=function(){var p=this.positiveInteger();return{type:"GroupBackReference",value:p}},r.prototype.characterClassEscape=function(){var p,m=!1;switch(this.popChar()){case"d":p=u;break;case"D":p=u,m=!0;break;case"s":p=f;break;case"S":p=f,m=!0;break;case"w":p=g;break;case"W":p=g,m=!0;break}return a(p),{type:"Set",value:p,complement:m}},r.prototype.controlEscapeAtom=function(){var p;switch(this.popChar()){case"f":p=n("\f");break;case"n":p=n(`
`);break;case"r":p=n("\r");break;case"t":p=n(" ");break;case"v":p=n("\v");break}return a(p),{type:"Character",value:p}},r.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var p=this.popChar();if(/[a-zA-Z]/.test(p)===!1)throw Error("Invalid ");var m=p.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:m}},r.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:n("\0")}},r.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},r.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},r.prototype.identityEscapeAtom=function(){var p=this.popChar();return{type:"Character",value:n(p)}},r.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var p=this.popChar();return{type:"Character",value:n(p)}}},r.prototype.characterClass=function(){var p=[],m=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),m=!0);this.isClassAtom();){var y=this.classAtom(),Q=y.type==="Character";if(Q&&this.isRangeDash()){this.consumeChar("-");var S=this.classAtom(),x=S.type==="Character";if(x){if(S.value<y.value)throw Error("Range out of order in character class");p.push({from:y.value,to:S.value})}else s(y.value,p),p.push(n("-")),s(S.value,p)}else s(y.value,p)}return this.consumeChar("]"),{type:"Set",complement:m,value:p}},r.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},r.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:n("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},r.prototype.group=function(){var p=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),p=!1;break;default:this.groupIdx++;break}var m=this.disjunction();this.consumeChar(")");var y={type:"Group",capturing:p,value:m};return p&&(y.idx=this.groupIdx),y},r.prototype.positiveInteger=function(){var p=this.popChar();if(i.test(p)===!1)throw Error("Expecting a positive integer");for(;t.test(this.peekChar(0));)p+=this.popChar();return parseInt(p,10)},r.prototype.integerIncludingZero=function(){var p=this.popChar();if(t.test(p)===!1)throw Error("Expecting an integer");for(;t.test(this.peekChar(0));)p+=this.popChar();return parseInt(p,10)},r.prototype.patternCharacter=function(){var p=this.popChar();switch(p){case`
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:n(p)}}},r.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},r.prototype.isRangeDash=function(){return this.peekChar()==="-"&&this.isClassAtom(1)},r.prototype.isDigit=function(){return t.test(this.peekChar(0))},r.prototype.isClassAtom=function(p){switch(p===void 0&&(p=0),this.peekChar(p)){case"]":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},r.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},r.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},r.prototype.isAssertion=function(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}},r.prototype.isQuantifier=function(){var p=this.saveState();try{return this.quantifier(!0)!==void 0}catch(m){return!1}finally{this.restoreState(p)}},r.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},r.prototype.parseHexDigits=function(p){for(var m="",y=0;y<p;y++){var Q=this.popChar();if(e.test(Q)===!1)throw Error("Expecting a HexDecimal digits");m+=Q}var S=parseInt(m,16);return{type:"Character",value:S}},r.prototype.peekChar=function(p){return p===void 0&&(p=0),this.input[this.idx+p]},r.prototype.popChar=function(){var p=this.peekChar(0);return this.consumeChar(),p},r.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++},r.prototype.loc=function(p){return{begin:p,end:this.idx}};var e=/[0-9a-fA-F]/,t=/[0-9]/,i=/[1-9]/;function n(p){return p.charCodeAt(0)}function s(p,m){p.length!==void 0?p.forEach(function(y){m.push(y)}):m.push(p)}function o(p,m){if(p[m]===!0)throw"duplicate flag "+m;p[m]=!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 m in p){var y=p[m];p.hasOwnProperty(m)&&(y.type!==void 0?this.visit(y):Array.isArray(y)&&y.forEach(function(Q){this.visit(Q)},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:r,BaseRegExpVisitor:h,VERSION:"0.5.0"}})});var OI=w(ug=>{"use strict";Object.defineProperty(ug,"__esModule",{value:!0});ug.clearRegExpParserCache=ug.getRegExpAst=void 0;var fIe=NI(),TI={},hIe=new fIe.RegExpParser;function pIe(r){var e=r.toString();if(TI.hasOwnProperty(e))return TI[e];var t=hIe.pattern(e);return TI[e]=t,t}ug.getRegExpAst=pIe;function dIe(){TI={}}ug.clearRegExpParserCache=dIe});var tj=w(bn=>{"use strict";var CIe=bn&&bn.__extends||function(){var r=function(e,t){return r=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])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(bn,"__esModule",{value:!0});bn.canMatchCharCode=bn.firstCharOptimizedIndices=bn.getOptimizedStartCodesIndices=bn.failedOptimizationPrefixMsg=void 0;var XH=NI(),Qs=Yt(),ZH=OI(),Ua=Sv(),$H="Complement Sets are not supported for first char optimization";bn.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
`;function mIe(r,e){e===void 0&&(e=!1);try{var t=(0,ZH.getRegExpAst)(r),i=MI(t.value,{},t.flags.ignoreCase);return i}catch(s){if(s.message===$H)e&&(0,Qs.PRINT_WARNING)(""+bn.failedOptimizationPrefixMsg+(" Unable to optimize: < "+r.toString()+` >
`)+` Complement Sets cannot be automatically optimized.
This will disable the lexer's first char optimizations.
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var n="";e&&(n=`
This will disable the lexer's first char optimizations.
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),(0,Qs.PRINT_ERROR)(bn.failedOptimizationPrefixMsg+`
`+(" Failed parsing: < "+r.toString()+` >
`)+(" Using the regexp-to-ast library version: "+XH.VERSION+`
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+n)}}return[]}bn.getOptimizedStartCodesIndices=mIe;function MI(r,e,t){switch(r.type){case"Disjunction":for(var i=0;i<r.value.length;i++)MI(r.value[i],e,t);break;case"Alternative":for(var n=r.value,i=0;i<n.length;i++){var s=n[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var o=s;switch(o.type){case"Character":UI(o.value,e,t);break;case"Set":if(o.complement===!0)throw Error($H);(0,Qs.forEach)(o.value,function(c){if(typeof c=="number")UI(c,e,t);else{var u=c;if(t===!0)for(var g=u.from;g<=u.to;g++)UI(g,e,t);else{for(var g=u.from;g<=u.to&&g<Ua.minOptimizationVal;g++)UI(g,e,t);if(u.to>=Ua.minOptimizationVal)for(var f=u.from>=Ua.minOptimizationVal?u.from:Ua.minOptimizationVal,h=u.to,p=(0,Ua.charCodeToOptimizedIndex)(f),m=(0,Ua.charCodeToOptimizedIndex)(h),y=p;y<=m;y++)e[y]=y}}});break;case"Group":MI(o.value,e,t);break;default:throw Error("Non Exhaustive Match")}var a=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&xv(o)===!1||o.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return(0,Qs.values)(e)}bn.firstCharOptimizedIndices=MI;function UI(r,e,t){var i=(0,Ua.charCodeToOptimizedIndex)(r);e[i]=i,t===!0&&EIe(r,e)}function EIe(r,e){var t=String.fromCharCode(r),i=t.toUpperCase();if(i!==t){var n=(0,Ua.charCodeToOptimizedIndex)(i.charCodeAt(0));e[n]=n}else{var s=t.toLowerCase();if(s!==t){var n=(0,Ua.charCodeToOptimizedIndex)(s.charCodeAt(0));e[n]=n}}}function ej(r,e){return(0,Qs.find)(r.value,function(t){if(typeof t=="number")return(0,Qs.contains)(e,t);var i=t;return(0,Qs.find)(e,function(n){return i.from<=n&&n<=i.to})!==void 0})}function xv(r){return r.quantifier&&r.quantifier.atLeast===0?!0:r.value?(0,Qs.isArray)(r.value)?(0,Qs.every)(r.value,xv):xv(r.value):!1}var IIe=function(r){CIe(e,r);function e(t){var i=r.call(this)||this;return i.targetCharCodes=t,i.found=!1,i}return e.prototype.visitChildren=function(t){if(this.found!==!0){switch(t.type){case"Lookahead":this.visitLookahead(t);return;case"NegativeLookahead":this.visitNegativeLookahead(t);return}r.prototype.visitChildren.call(this,t)}},e.prototype.visitCharacter=function(t){(0,Qs.contains)(this.targetCharCodes,t.value)&&(this.found=!0)},e.prototype.visitSet=function(t){t.complement?ej(t,this.targetCharCodes)===void 0&&(this.found=!0):ej(t,this.targetCharCodes)!==void 0&&(this.found=!0)},e}(XH.BaseRegExpVisitor);function yIe(r,e){if(e instanceof RegExp){var t=(0,ZH.getRegExpAst)(e),i=new IIe(r);return i.visit(t),i.found}else return(0,Qs.find)(e,function(n){return(0,Qs.contains)(r,n.charCodeAt(0))})!==void 0}bn.canMatchCharCode=yIe});var Sv=w(Ze=>{"use strict";var rj=Ze&&Ze.__extends||function(){var r=function(e,t){return r=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])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Ze,"__esModule",{value:!0});Ze.charCodeToOptimizedIndex=Ze.minOptimizationVal=Ze.buildLineBreakIssueMessage=Ze.LineTerminatorOptimizedTester=Ze.isShortPattern=Ze.isCustomPattern=Ze.cloneEmptyGroups=Ze.performWarningRuntimeChecks=Ze.performRuntimeChecks=Ze.addStickyFlag=Ze.addStartOfInput=Ze.findUnreachablePatterns=Ze.findModesThatDoNotExist=Ze.findInvalidGroupType=Ze.findDuplicatePatterns=Ze.findUnsupportedFlags=Ze.findStartOfInputAnchor=Ze.findEmptyMatchRegExps=Ze.findEndOfInputAnchor=Ze.findInvalidPatterns=Ze.findMissingPatterns=Ze.validatePatterns=Ze.analyzeTokenTypes=Ze.enableSticky=Ze.disableSticky=Ze.SUPPORT_STICKY=Ze.MODES=Ze.DEFAULT_MODE=void 0;var ij=NI(),Ar=Dp(),Le=Yt(),gg=tj(),nj=OI(),To="PATTERN";Ze.DEFAULT_MODE="defaultMode";Ze.MODES="modes";Ze.SUPPORT_STI
`],tracer:function(S,x){return x()}});var t=e.tracer;t("initCharCodeToOptimizedIndexMap",function(){bIe()});var i;t("Reject Lexer.NA",function(){i=(0,Le.reject)(r,function(S){return S[To]===Ar.Lexer.NA})});var n=!1,s;t("Transform Patterns",function(){n=!1,s=(0,Le.map)(i,function(S){var x=S[To];if((0,Le.isRegExp)(x)){var M=x.source;return M.length===1&&M!=="^"&&M!=="$"&&M!=="."&&!x.ignoreCase?M:M.length===2&&M[0]==="\\"&&!(0,Le.contains)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],M[1])?M[1]:e.useSticky?Pv(x):kv(x)}else{if((0,Le.isFunction)(x))return n=!0,{exec:x};if((0,Le.has)(x,"exec"))return n=!0,x;if(typeof x=="string"){if(x.length===1)return x;var q=x.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),U=new RegExp(q);return e.useSticky?Pv(U):kv(U)}else throw Error("non exhaustive match")}})});var o,a,l,c,u;t("misc mapping",function(){o=(0,Le.map)(i,function(S){return S.tokenTypeIdx}),a=(0,Le.map)(i,function(S){var x=S.GROUP;if(x!==Ar.Lexer.SKIPPED){if((0,Le.isString)(x))return x;if((0,Le.isUndefined)(x))return!1;throw Error("non exhaustive match")}}),l=(0,Le.map)(i,function(S){var x=S.LONGER_ALT;if(x){var M=(0,Le.isArray)(x)?(0,Le.map)(x,function(q){return(0,Le.indexOf)(i,q)}):[(0,Le.indexOf)(i,x)];return M}}),c=(0,Le.map)(i,function(S){return S.PUSH_MODE}),u=(0,Le.map)(i,function(S){return(0,Le.has)(S,"POP_MODE")})});var g;t("Line Terminator Handling",function(){var S=aj(e.lineTerminatorCharacters);g=(0,Le.map)(i,function(x){return!1}),e.positionTracking!=="onlyOffset"&&(g=(0,Le.map)(i,function(x){if((0,Le.has)(x,"LINE_BREAKS"))return x.LINE_BREAKS;if(oj(x,S)===!1)return(0,gg.canMatchCharCode)(S,x.PATTERN)}))});var f,h,p,m;t("Misc Mapping #2",function(){f=(0,Le.map)(i,Dv),h=(0,Le.map)(s,sj),p=(0,Le.reduce)(i,function(S,x){var M=x.GROUP;return(0,Le.isString)(M)&&M!==Ar.Lexer.SKIPPED&&(S[M]=[]),S},{}),m=(0,Le.map)(s,function(S,x){return{pattern:s[x],longerAlt:l[x],canLineTerminator:g[x],isCustom:f[x],short:h[x],group:a[x],push:c[x],pop:u[x],tokenTypeIdx:o[x],tokenType:i[x]}})});var y=!0,Q=[];return e.safeMode||t("First Char Optimization",function(){Q=(0,Le.reduce)(i,function(S,x,M){if(typeof x.PATTERN=="string"){var q=x.PATTERN.charCodeAt(0),U=Rv(q);Fv(S,U,m[M])}else if((0,Le.isArray)(x.START_CHARS_HINT)){var W;(0,Le.forEach)(x.START_CHARS_HINT,function(oe){var Z=typeof oe=="string"?oe.charCodeAt(0):oe,A=Rv(Z);W!==A&&(W=A,Fv(S,A,m[M]))})}else if((0,Le.isRegExp)(x.PATTERN))if(x.PATTERN.unicode)y=!1,e.ensureOptimizations&&(0,Le.PRINT_ERROR)(""+gg.failedOptimizationPrefixMsg+(" Unable to analyze < "+x.PATTERN.toString()+` > pattern.
`)+` The regexp unicode flag is not currently supported by the regexp-to-ast library.
This will disable the lexer's first char optimizations.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var J=(0,gg.getOptimizedStartCodesIndices)(x.PATTERN,e.ensureOptimizations);(0,Le.isEmpty)(J)&&(y=!1),(0,Le.forEach)(J,function(oe){Fv(S,oe,m[M])})}else e.ensureOptimizations&&(0,Le.PRINT_ERROR)(""+gg.failedOptimizationPrefixMsg+(" TokenType: <"+x.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
`)+` This will disable the lexer's first char optimizations.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return S},[])}),t("ArrayPacking",function(){Q=(0,Le.packArray)(Q)}),{emptyGroups:p,patternIdxToConfig:m,charCodeToPatternIdxToConfig:Q,hasCustom:n,canBeOptimized:y}}Ze.analyzeTokenTypes=QIe;function SIe(r,e){var t=[],i=Aj(r);t=t.concat(i.errors);var n=lj(i.valid),s=n.valid;return t=t.concat(n.errors),t=t.concat(vIe(s)),t=t.concat(cj(s)),t=t.concat(uj(s,e)),t=t.concat(gj(s)),t}Ze.validatePatterns=SIe;function vIe(r){var e=[],t=(0,Le.filter)(r,function(i){return(0,Le.isRegExp)(i[To])});return e=e.concat(fj(t)),e=e.concat(pj(t)),e=e.concat(dj(t)),e=e.concat(Cj(t)),e=e.concat(hj(t)),e}function Aj(r){var e=(0,Le.filter)(r,function(n){return!(0,Le.has)(n,To)}),t=(0,Le.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- missing static 'PATTERN' property",type:Ar.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[n]}}),i=(0,Le.difference)(r,e);return{errors:t,valid:i}}Ze.findMissingPatterns=Aj;function lj(r){var e=(0,Le.filter)(r,function(n){var s=n[To];return!(0,Le.isRegExp)(s)&&!(0,Le.isFunction)(s)&&!(0,Le.has)(s,"exec")&&!(0,Le.isString)(s)}),t=(0,Le.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ar.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[n]}}),i=(0,Le.difference)(r,e);return{errors:t,valid:i}}Ze.findInvalidPatterns=lj;var xIe=/[^\\][\$]/;function fj(r){var e=function(n){rj(s,n);function s(){var o=n!==null&&n.apply(this,arguments)||this;return o.found=!1,o}return s.prototype.visitEndAnchor=function(o){this.found=!0},s}(ij.BaseRegExpVisitor),t=(0,Le.filter)(r,function(n){var s=n[To];try{var o=(0,nj.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch(l){return xIe.test(s.source)}}),i=(0,Le.map)(t,function(n){return{message:`Unexpected RegExp Anchor Error:
Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ar.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Ze.findEndOfInputAnchor=fj;function hj(r){var e=(0,Le.filter)(r,function(i){var n=i[To];return n.test("")}),t=(0,Le.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' must not match an empty string",type:Ar.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[i]}});return t}Ze.findEmptyMatchRegExps=hj;var kIe=/[^\\[][\^]|^\^/;function pj(r){var e=function(n){rj(s,n);function s(){var o=n!==null&&n.apply(this,arguments)||this;return o.found=!1,o}return s.prototype.visitStartAnchor=function(o){this.found=!0},s}(ij.BaseRegExpVisitor),t=(0,Le.filter)(r,function(n){var s=n[To];try{var o=(0,nj.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch(l){return kIe.test(s.source)}}),i=(0,Le.map)(t,function(n){return{message:`Unexpected RegExp Anchor Error:
Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ar.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Ze.findStartOfInputAnchor=pj;function dj(r){var e=(0,Le.filter)(r,function(i){var n=i[To];return n instanceof RegExp&&(n.multiline||n.global)}),t=(0,Le.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ar.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[i]}});return t}Ze.findUnsupportedFlags=dj;function Cj(r){var e=[],t=(0,Le.map)(r,function(s){return(0,Le.reduce)(r,function(o,a){return s.PATTERN.source===a.PATTERN.source&&!(0,Le.contains)(e,a)&&a.PATTERN!==Ar.Lexer.NA&&(e.push(a),o.push(a)),o},[])});t=(0,Le.compact)(t);var i=(0,Le.filter)(t,function(s){return s.length>1}),n=(0,Le.map)(i,function(s){var o=(0,Le.map)(s,function(l){return l.name}),a=(0,Le.first)(s).PATTERN;return{message:"The same RegExp pattern ->"+a+"<-"+("has been used in all of the following Token Types: "+o.join(", ")+" <-"),type:Ar.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}});return n}Ze.findDuplicatePatterns=Cj;function cj(r){var e=(0,Le.filter)(r,function(i){if(!(0,Le.has)(i,"GROUP"))return!1;var n=i.GROUP;return n!==Ar.Lexer.SKIPPED&&n!==Ar.Lexer.NA&&!(0,Le.isString)(n)}),t=(0,Le.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ar.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[i]}});return t}Ze.findInvalidGroupType=cj;function uj(r,e){var t=(0,Le.filter)(r,function(n){return n.PUSH_MODE!==void 0&&!(0,Le.contains)(e,n.PUSH_MODE)}),i=(0,Le.map)(t,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:Ar.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[n]}});return i}Ze.findModesThatDoNotExist=uj;function gj(r){var e=[],t=(0,Le.reduce)(r,function(i,n,s){var o=n.PATTERN;return o===Ar.Lexer.NA||((0,Le.isString)(o)?i.push({str:o,idx:s,tokenType:n}):(0,Le.isRegExp)(o)&&DIe(o)&&i.push({str:o.source,idx:s,tokenType:n})),i},[]);return(0,Le.forEach)(r,function(i,n){(0,Le.forEach)(t,function(s){var o=s.str,a=s.idx,l=s.tokenType;if(n<a&&PIe(o,i.PATTERN)){var c="Token: ->"+l.name+`<- can never be matched.
`+("Because it appears AFTER the Token Type ->"+i.name+"<-")+`in the lexer's definition.
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:Ar.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[i,l]})}})}),e}Ze.findUnreachablePatterns=gj;function PIe(r,e){if((0,Le.isRegExp)(e)){var t=e.exec(r);return t!==null&&t.index===0}else{if((0,Le.isFunction)(e))return e(r,0,[],{});if((0,Le.has)(e,"exec"))return e.exec(r,0,[],{});if(typeof e=="string")return e===r;throw Error("non exhaustive match")}}function DIe(r){var e=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return(0,Le.find)(e,function(t){return r.source.indexOf(t)!==-1})===void 0}function kv(r){var e=r.ignoreCase?"i":"";return new RegExp("^(?:"+r.source+")",e)}Ze.addStartOfInput=kv;function Pv(r){var e=r.ignoreCase?"iy":"y";return new RegExp(""+r.source,e)}Ze.addStickyFlag=Pv;function FIe(r,e,t){var i=[];return(0,Le.has)(r,Ze.DEFAULT_MODE)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ze.DEFAULT_MODE+`> property in its definition
`,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,Le.has)(r,Ze.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ze.MODES+`> property in its definition
`,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,Le.has)(r,Ze.MODES)&&(0,Le.has)(r,Ze.DEFAULT_MODE)&&!(0,Le.has)(r.modes,r.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a "+Ze.DEFAULT_MODE+": <"+r.defaultMode+`>which does not exist
`,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,Le.has)(r,Ze.MODES)&&(0,Le.forEach)(r.modes,function(n,s){(0,Le.forEach)(n,function(o,a){(0,Le.isUndefined)(o)&&i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+s+"> at index: <"+a+`>
`),type:Ar.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i}Ze.performRuntimeChecks=FIe;function RIe(r,e,t){var i=[],n=!1,s=(0,Le.compact)((0,Le.flatten)((0,Le.mapValues)(r.modes,function(l){return l}))),o=(0,Le.reject)(s,function(l){return l[To]===Ar.Lexer.NA}),a=aj(t);return e&&(0,Le.forEach)(o,function(l){var c=oj(l,a);if(c!==!1){var u=mj(l,c),g={message:u,type:c.issue,tokenType:l};i.push(g)}else(0,Le.has)(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(n=!0):(0,gg.canMatchCharCode)(a,l.PATTERN)&&(n=!0)}),e&&!n&&i.push({message:`Warning: No LINE_BREAKS Found.
This Lexer has been defined to track line and column information,
But none of the Token Types can be identified as matching a line terminator.
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
for details.`,type:Ar.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),i}Ze.performWarningRuntimeChecks=RIe;function LIe(r){var e={},t=(0,Le.keys)(r);return(0,Le.forEach)(t,function(i){var n=r[i];if((0,Le.isArray)(n))e[i]=[];else throw Error("non exhaustive match")}),e}Ze.cloneEmptyGroups=LIe;function Dv(r){var e=r.PATTERN;if((0,Le.isRegExp)(e))return!1;if((0,Le.isFunction)(e))return!0;if((0,Le.has)(e,"exec"))return!0;if((0,Le.isString)(e))return!1;throw Error("non exhaustive match")}Ze.isCustomPattern=Dv;function sj(r){return(0,Le.isString)(r)&&r.length===1?r.charCodeAt(0):!1}Ze.isShortPattern=sj;Ze.LineTerminatorOptimizedTester={test:function(r){for(var e=r.length,t=this.lastIndex;t<e;t++){var i=r.charCodeAt(t);if(i===10)return this.lastIndex=t+1,!0;if(i===13)return r.charCodeAt(t+1)===10?this.lastIndex=t+2:this.lastIndex=t+1,!0}return!1},lastIndex:0};function oj(r,e){if((0,Le.has)(r,"LINE_BREAKS"))return!1;if((0,Le.isRegExp)(r.PATTERN)){try{(0,gg.canMatchCharCode)(e,r.PATTERN)}catch(t){return{issue:Ar.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:t.message}}return!1}else{if((0,Le.isString)(r.PATTERN))return!1;if(Dv(r))return{issue:Ar.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function mj(r,e){if(e.issue===Ar.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
`+(" The problem is in the <"+r.name+`> Token Type
`)+(" Root cause: "+e.errMsg+`.
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===Ar.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
`+(" The problem is in the <"+r.name+`> Token Type
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}Ze.buildLineBreakIssueMessage=mj;function aj(r){var e=(0,Le.map)(r,function(t){return(0,Le.isString)(t)&&t.length>0?t.charCodeAt(0):t});return e}function Fv(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}Ze.minOptimizationVal=256;var KI=[];function Rv(r){return r<Ze.minOptimizationVal?r:KI[r]}Ze.charCodeToOptimizedIndex=Rv;function bIe(){if((0,Le.isEmpty)(KI)){KI=new Array(65536);for(var r=0;r<65536;r++)KI[r]=r>255?255+~~(r/255):r}}});var fg=w(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.isTokenType=Rt.hasExtendingTokensTypesMapProperty=Rt.hasExtendingTokensTypesProperty=Rt.hasCategoriesProperty=Rt.hasShortKeyProperty=Rt.singleAssignCategoriesToksMap=Rt.assignCategoriesMapProp=Rt.assignCategoriesTokensProp=Rt.assignTokenDefaultProps=Rt.expandCategories=Rt.augmentTokenTypes=Rt.tokenIdxToClass=Rt.tokenShortNameIdx=Rt.tokenStructuredMatcherNoCategories=Rt.tokenStructuredMatcher=void 0;var ri=Yt();function NIe(r,e){var t=r.tokenTypeIdx;return t===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[t]===!0}Rt.tokenStructuredMatcher=NIe;function TIe(r,e){return r.tokenTypeIdx===e.tokenTypeIdx}Rt.tokenStructuredMatcherNoCategories=TIe;Rt.tokenShortNameIdx=1;Rt.tokenIdxToClass={};function OIe(r){var e=Ej(r);Ij(e),wj(e),yj(e),(0,ri.forEach)(e,function(t){t.isParent=t.categoryMatches.length>0})}Rt.augmentTokenTypes=OIe;function Ej(r){for(var e=(0,ri.cloneArr)(r),t=r,i=!0;i;){t=(0,ri.compact)((0,ri.flatten)((0,ri.map)(t,function(s){return s.CATEGORIES})));var n=(0,ri.difference)(t,e);e=e.concat(n),(0,ri.isEmpty)(n)?i=!1:t=n}return e}Rt.expandCategories=Ej;function Ij(r){(0,ri.forEach)(r,function(e){Bj(e)||(Rt.tokenIdxToClass[Rt.tokenShortNameIdx]=e,e.tokenTypeIdx=Rt.tokenShortNameIdx++),Lv(e)&&!(0,ri.isArray)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Lv(e)||(e.CATEGORIES=[]),bj(e)||(e.categoryMatches=[]),Qj(e)||(e.categoryMatchesMap={})})}Rt.assignTokenDefaultProps=Ij;function yj(r){(0,ri.forEach)(r,function(e){e.categoryMatches=[],(0,ri.forEach)(e.categoryMatchesMap,function(t,i){e.categoryMatches.push(Rt.tokenIdxToClass[i].tokenTypeIdx)})})}Rt.assignCategoriesTokensProp=yj;function wj(r){(0,ri.forEach)(r,function(e){Nv([],e)})}Rt.assignCategoriesMapProp=wj;function Nv(r,e){(0,ri.forEach)(r,function(t){e.categoryMatchesMap[t.tokenTypeIdx]=!0}),(0,ri.forEach)(e.CATEGORIES,function(t){var i=r.concat(e);(0,ri.contains)(i,t)||Nv(i,t)})}Rt.singleAssignCategoriesToksMap=Nv;function Bj(r){return(0,ri.has)(r,"tokenTypeIdx")}Rt.hasShortKeyProperty=Bj;function Lv(r){return(0,ri.has)(r,"CATEGORIES")}Rt.hasCategoriesProperty=Lv;function bj(r){return(0,ri.has)(r,"categoryMatches")}Rt.hasExtendingTokensTypesProperty=bj;function Qj(r){return(0,ri.has)(r,"categoryMatchesMap")}Rt.hasExtendingTokensTypesMapProperty=Qj;function MIe(r){return(0,ri.has)(r,"tokenTypeIdx")}Rt.isTokenType=MIe});var Tv=w(HI=>{"use strict";Object.defineProperty(HI,"__esModule",{value:!0});HI.defaultLexerErrorProvider=void 0;HI.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(r){return"Unable to pop Lexer Mode after encountering Token ->"+r.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(r,e,t,i,n){return"unexpected character: ->"+r.charAt(e)+"<- at offset: "+e+","+(" skipped "+t+" characters.")}}});var Dp=w(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.Lexer=Bc.LexerDefinitionErrorType=void 0;var ao=Sv(),lr=Yt(),UIe=fg(),KIe=Tv(),HIe=OI(),jIe;(function(r){r[r.MISSING_PATTERN=0]="MISSING_PATTERN",r[r.INVALID_PATTERN=1]="INVALID_PATTERN",r[r.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",r[r.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",r[r.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",r[r.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",r[r.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",r[r.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",r[r.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:KIe.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(Fp);var GIe=function(){function r(e,t){var i=this;if(t===void 0&&(t=Fp),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
a boolean 2nd argument is no longer supported`);this.config=(0,lr.merge)(Fp,t);var n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=Infinity,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var s,o=!0;i.TRACE_INIT("Lexer Config handling",function(){if(i.config.lineTerminatorsPattern===Fp.lineTerminatorsPattern)i.config.lineTerminatorsPattern=ao.LineTerminatorOptimizedTester;else if(i.config.lineTerminatorCharacters===Fp.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');i.trackStartLines=/full|onlyStart/i.test(i.config.positionTracking),i.trackEndLines=/full/i.test(i.config.positionTracking),(0,lr.isArray)(e)?(s={modes:{}},s.modes[ao.DEFAULT_MODE]=(0,lr.cloneArr)(e),s[ao.DEFAULT_MODE]=ao.DEFAULT_MODE):(o=!1,s=(0,lr.cloneObj)(e))}),i.config.skipValidations===!1&&(i.TRACE_INIT("performRuntimeChecks",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,ao.performRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))}),i.TRACE_INIT("performWarningRuntimeChecks",function(){i.lexerDefinitionWarning=i.lexerDefinitionWarning.concat((0,ao.performWarningRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))})),s.modes=s.modes?s.modes:{},(0,lr.forEach)(s.modes,function(u,g){s.modes[g]=(0,lr.reject)(u,function(f){return(0,lr.isUndefined)(f)})});var a=(0,lr.keys)(s.modes);if((0,lr.forEach)(s.modes,function(u,g){i.TRACE_INIT("Mode: <"+g+"> processing",function(){if(i.modes.push(g),i.config.skipValidations===!1&&i.TRACE_INIT("validatePatterns",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,ao.validatePatterns)(u,a))}),(0,lr.isEmpty)(i.lexerDefinitionErrors)){(0,UIe.augmentTokenTypes)(u);var f;i.TRACE_INIT("analyzeTokenTypes",function(){f=(0,ao.analyzeTokenTypes)(u,{lineTerminatorCharacters:i.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:i.TRACE_INIT.bind(i)})}),i.patternIdxToConfig[g]=f.patternIdxToConfig,i.charCodeToPatternIdxToConfig[g]=f.charCodeToPatternIdxToConfig,i.emptyGroups=(0,lr.merge)(i.emptyGroups,f.emptyGroups),i.hasCustom=f.hasCustom||i.hasCustom,i.canModeBeOptimized[g]=f.canBeOptimized}})}),i.defaultMode=s.defaultMode,!(0,lr.isEmpty)(i.lexerDefinitionErrors)&&!i.config.deferDefinitionErrorsHandling){var l=(0,lr.map)(i.lexerDefinitionErrors,function(u){return u.message}),c=l.join(`-----------------------
`);throw new Error(`Errors detected in definition of Lexer:
`+c)}(0,lr.forEach)(i.lexerDefinitionWarning,function(u){(0,lr.PRINT_WARNING)(u.message)}),i.TRACE_INIT("Choosing sub-methods implementations",function(){if(ao.SUPPORT_STICKY?(i.chopInput=lr.IDENTITY,i.match=i.matchWithTest):(i.updateLastIndex=lr.NOOP,i.match=i.matchWithExec),o&&(i.handleModes=lr.NOOP),i.trackStartLines===!1&&(i.computeNewColumn=lr.IDENTITY),i.trackEndLines===!1&&(i.updateTokenEndLineColumnLocation=lr.NOOP),/full/i.test(i.config.positionTracking))i.createTokenInstance=i.createFullToken;else if(/onlyStart/i.test(i.config.positionTracking))i.createTokenInstance=i.createStartOnlyToken;else if(/onlyOffset/i.test(i.config.positionTracking))i.createTokenInstance=i.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'+i.config.positionTracking+'"');i.hasCustom?(i.addToken=i.addTokenUsingPush,i.handlePayload=i.handlePayloadWithCustom):(i.addToken=i.addTokenUsingMemberAccess,i.handlePayload=i.handlePayloadNoCustom)}),i.TRACE_INIT("Failed Optimization Warnings",function(){var u=(0,lr.reduce)(i.canModeBeOptimized,function(g,f,h){return f===!1&&g.push(h),g},[]);if(t.ensureOptimizations&&!(0,lr.isEmpty)(u))throw Error("Lexer Modes: < "+u.join(", ")+` > cannot be optimized.
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
Or inspect the console log for details on how to resolve these issues.`)}),i.TRACE_INIT("clearRegExpParserCache",function(){(0,HIe.clearRegExpParserCache)()}),i.TRACE_INIT("toFastProperties",function(){(0,lr.toFastProperties)(i)})})}return r.prototype.tokenize=function(e,t){if(t===void 0&&(t=this.defaultMode),!(0,lr.isEmpty)(this.lexerDefinitionErrors)){var i=(0,lr.map)(this.lexerDefinitionErrors,function(o){return o.message}),n=i.join(`-----------------------
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
`+n)}var s=this.tokenizeInternal(e,t);return s},r.prototype.tokenizeInternal=function(e,t){var i=this,n,s,o,a,l,c,u,g,f,h,p,m,y,Q,S,x,M=e,q=M.length,U=0,W=0,J=this.hasCustom?0:Math.floor(e.length/10),oe=new Array(J),Z=[],A=this.trackStartLines?1:void 0,ne=this.trackStartLines?1:void 0,Ae=(0,ao.cloneEmptyGroups)(this.emptyGroups),ee=this.trackStartLines,O=this.config.lineTerminatorsPattern,N=0,be=[],Ie=[],Ye=[],te=[];Object.freeze(te);var ae=void 0;function Be(){return be}function he(vr){var jn=(0,ao.charCodeToOptimizedIndex)(vr),gs=Ie[jn];return gs===void 0?te:gs}var Fe=function(vr){if(Ye.length===1&&vr.tokenType.PUSH_MODE===void 0){var jn=i.config.errorMessageProvider.buildUnableToPopLexerModeMessage(vr);Z.push({offset:vr.startOffset,line:vr.startLine!==void 0?vr.startLine:void 0,column:vr.startColumn!==void 0?vr.startColumn:void 0,length:vr.image.length,message:jn})}else{Ye.pop();var gs=(0,lr.last)(Ye);be=i.patternIdxToConfig[gs],Ie=i.charCodeToPatternIdxToConfig[gs],N=be.length;var ya=i.canModeBeOptimized[gs]&&i.config.safeMode===!1;Ie&&ya?ae=he:ae=Be}};function Oe(vr){Ye.push(vr),Ie=this.charCodeToPatternIdxToConfig[vr],be=this.patternIdxToConfig[vr],N=be.length,N=be.length;var jn=this.canModeBeOptimized[vr]&&this.config.safeMode===!1;Ie&&jn?ae=he:ae=Be}Oe.call(this,t);for(var xe;U<q;){c=null;var Se=M.charCodeAt(U),pe=ae(Se),X=pe.length;for(n=0;n<X;n++){xe=pe[n];var ke=xe.pattern;u=null;var le=xe.short;if(le!==!1?Se===le&&(c=ke):xe.isCustom===!0?(x=ke.exec(M,U,oe,Ae),x!==null?(c=x[0],x.payload!==void 0&&(u=x.payload)):c=null):(this.updateLastIndex(ke,U),c=this.match(ke,e,U)),c!==null){if(l=xe.longerAlt,l!==void 0){var fe=l.length;for(o=0;o<fe;o++){var gt=be[l[o]],Ht=gt.pattern;if(g=null,gt.isCustom===!0?(x=Ht.exec(M,U,oe,Ae),x!==null?(a=x[0],x.payload!==void 0&&(g=x.payload)):a=null):(this.updateLastIndex(Ht,U),a=this.match(Ht,e,U)),a&&a.length>c.length){c=a,u=g,xe=gt;break}}}break}}if(c!==null){if(f=c.length,h=xe.group,h!==void 0&&(p=xe.tokenTypeIdx,m=this.createTokenInstance(c,U,p,xe.tokenType,A,ne,f),this.handlePayload(m,u),h===!1?W=this.addToken(oe,W,m):Ae[h].push(m)),e=this.chopInput(e,f),U=U+f,ne=this.computeNewColumn(ne,f),ee===!0&&xe.canLineTerminator===!0){var Mt=0,mi=void 0,jt=void 0;O.lastIndex=0;do mi=O.test(c),mi===!0&&(jt=O.lastIndex-1,Mt++);while(mi===!0);Mt!==0&&(A=A+Mt,ne=f-jt,this.updateTokenEndLineColumnLocation(m,h,jt,Mt,A,ne,f))}this.handleModes(xe,Fe,Oe,m)}else{for(var Qr=U,Ni=A,Xs=ne,Kn=!1;!Kn&&U<q;)for(Q=M.charCodeAt(U),e=this.chopInput(e,1),U++,s=0;s<N;s++){var Hn=be[s],ke=Hn.pattern,le=Hn.short;if(le!==!1?M.charCodeAt(U)===le&&(Kn=!0):Hn.isCustom===!0?Kn=ke.exec(M,U,oe,Ae)!==null:(this.updateLastIndex(ke,U),Kn=ke.exec(e)!==null),Kn===!0)break}y=U-Qr,S=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(M,Qr,y,Ni,Xs),Z.push({offset:Qr,line:Ni,column:Xs,length:y,message:S})}}return this.hasCustom||(oe.length=W),{tokens:oe,groups:Ae,errors:Z}},r.prototype.handleModes=function(e,t,i,n){if(e.pop===!0){var s=e.push;t(n),s!==void 0&&i.call(this,s)}else e.push!==void 0&&i.call(this,e.push)},r.prototype.chopInput=function(e,t){return e.substring(t)},r.prototype.updateLastIndex=function(e,t){e.lastIndex=t},r.prototype.updateTokenEndLineColumnLocation=function(e,t,i,n,s,o,a){var l,c;t!==void 0&&(l=i===a-1,c=l?-1:0,n===1&&l===!0||(e.endLine=s+c,e.endColumn=o-1+-c))},r.prototype.computeNewColumn=function(e,t){return e+t},r.prototype.createTokenInstance=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return null},r.prototype.createOffsetOnlyToken=function(e,t,i,n){return{image:e,startOffset:t,tokenTypeIdx:i,tokenType:n}},r.prototype.createStartOnlyToken=function(e,t,i,n,s,o){return{image:e,startOffset:t,startLine:s,startColumn:o,tokenTypeIdx:i,tokenType:n}},r.prototype.createFullToken=function(e,t,i,n,s,o,a){return{image:e,startOffset:t,endOffset:t+a-1,startLine:s,endLine:s,startColumn:o,endColumn:o+a-1,tokenTypeIdx:i,tokenType:n}},r.prototype.addToken=function(e,t,i){return 666},r.prototype.addTokenUsingPush=function(e,t,i){return e.push(i),t},r.prototype.addTokenUsing
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return(0,Ao.has)(r,Sj)&&(t.CATEGORIES=r[Sj]),(0,Ov.augmentTokenTypes)([t]),(0,Ao.has)(r,xj)&&(t.LABEL=r[xj]),(0,Ao.has)(r,kj)&&(t.GROUP=r[kj]),(0,Ao.has)(r,Dj)&&(t.POP_MODE=r[Dj]),(0,Ao.has)(r,Pj)&&(t.PUSH_MODE=r[Pj]),(0,Ao.has)(r,Fj)&&(t.LONGER_ALT=r[Fj]),(0,Ao.has)(r,Rj)&&(t.LINE_BREAKS=r[Rj]),(0,Ao.has)(r,Lj)&&(t.START_CHARS_HINT=r[Lj]),t}ki.EOF=Nj({name:"EOF",pattern:YIe.Lexer.NA});(0,Ov.augmentTokenTypes)([ki.EOF]);function _Ie(r,e,t,i,n,s,o,a){return{image:e,startOffset:t,endOffset:i,startLine:n,endLine:s,startColumn:o,endColumn:a,tokenTypeIdx:r.tokenTypeIdx,tokenType:r}}ki.createTokenInstance=_Ie;function VIe(r,e){return(0,Ov.tokenStructuredMatcher)(r,e)}ki.tokenMatcher=VIe});var Qn=w(_t=>{"use strict";var Ka=_t&&_t.__extends||function(){var r=function(e,t){return r=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])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(_t,"__esModule",{value:!0});_t.serializeProduction=_t.serializeGrammar=_t.Terminal=_t.Alternation=_t.RepetitionWithSeparator=_t.Repetition=_t.RepetitionMandatoryWithSeparator=_t.RepetitionMandatory=_t.Option=_t.Alternative=_t.Rule=_t.NonTerminal=_t.AbstractProduction=void 0;var gr=Yt(),XIe=WA(),Oo=function(){function r(e){this._definition=e}return Object.defineProperty(r.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),r.prototype.accept=function(e){e.visit(this),(0,gr.forEach)(this.definition,function(t){t.accept(e)})},r}();_t.AbstractProduction=Oo;var Tj=function(r){Ka(e,r);function e(t){var i=r.call(this,[])||this;return i.idx=1,(0,gr.assign)(i,(0,gr.pick)(t,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(t){},enumerable:!1,configurable:!0}),e.prototype.accept=function(t){t.visit(this)},e}(Oo);_t.NonTerminal=Tj;var Oj=function(r){Ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.orgText="",(0,gr.assign)(i,(0,gr.pick)(t,function(n){return n!==void 0})),i}return e}(Oo);_t.Rule=Oj;var Mj=function(r){Ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.ignoreAmbiguities=!1,(0,gr.assign)(i,(0,gr.pick)(t,function(n){return n!==void 0})),i}return e}(Oo);_t.Alternative=Mj;var Uj=function(r){Ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,gr.assign)(i,(0,gr.pick)(t,function(n){return n!==void 0})),i}return e}(Oo);_t.Option=Uj;var Kj=function(r){Ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,gr.assign)(i,(0,gr.pick)(t,function(n){return n!==void 0})),i}return e}(Oo);_t.RepetitionMandatory=Kj;var Hj=function(r){Ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,gr.assign)(i,(0,gr.pick)(t,function(n){return n!==void 0})),i}return e}(Oo);_t.RepetitionMandatoryWithSeparator=Hj;var jj=function(r){Ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,gr.assign)(i,(0,gr.pick)(t,function(n){return n!==void 0})),i}return e}(Oo);_t.Repetition=jj;var Gj=function(r){Ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,gr.assign)(i,(0,gr.pick)(t,function(n){return n!==void 0})),i}return e}(Oo);_t.RepetitionWithSeparator=Gj;var Yj=function(r){Ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,i.ignoreAmbiguities=!1,i.hasPredicates=!1,(0,gr.assign)(i,(0,gr.pick)(t,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(t){this._definition
but found: '`+a+"'";if(n)return o+n+l;var c=(0,lo.reduce)(e,function(h,p){return h.concat(p)},[]),u=(0,lo.map)(c,function(h){return"["+(0,lo.map)(h,function(p){return(0,pg.tokenLabel)(p)}).join(", ")+"]"}),g=(0,lo.map)(u,function(h,p){return" "+(p+1)+". "+h}),f=`one of these possible Token sequences:
`+g.join(`
`);return o+f+l},buildEarlyExitMessage:function(r){var e=r.expectedIterationPaths,t=r.actual,i=r.customUserDescription,n=r.ruleName,s="Expecting: ",o=(0,lo.first)(t).image,a=`
but found: '`+o+"'";if(i)return s+i+a;var l=(0,lo.map)(e,function(u){return"["+(0,lo.map)(u,function(g){return(0,pg.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(Ha.defaultParserErrorProvider);Ha.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(r,e){var t="Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
inside top level rule: ->`+r.name+"<-";return t}};Ha.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(r,e){function t(u){return u instanceof Gv.Terminal?u.terminalType.name:u instanceof Gv.NonTerminal?u.nonTerminalName:""}var i=r.name,n=(0,lo.first)(e),s=n.idx,o=(0,rG.getProductionDslName)(n),a=t(n),l=s>0,c="->"+o+(l?s:"")+"<- "+(a?"with argument: ->"+a+"<-":"")+`
appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-.
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
`;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,`
`),c},buildNamespaceConflictError:function(r){var e=`Namespace conflict found in grammar.
`+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+r.name+`>.
`)+`To resolve this make sure each Terminal and Non-Terminal names are unique
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
and Non-Terminal names start with a lower case letter.`;return e},buildAlternationPrefixAmbiguityError:function(r){var e=(0,lo.map)(r.prefixPath,function(n){return(0,pg.tokenLabel)(n)}).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,i="Ambiguous alternatives: <"+r.ambiguityIndices.join(" ,")+`> due to common lookahead prefix
`+("in <OR"+t+"> inside <"+r.topLevelRule.name+`> Rule,
`)+("<"+e+`> may appears as a prefix path in all these alternatives.
`)+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
For Further details.`;return i},buildAlternationAmbiguityError:function(r){var e=(0,lo.map)(r.prefixPath,function(n){return(0,pg.tokenLabel)(n)}).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,i="Ambiguous Alternatives Detected: <"+r.ambiguityIndices.join(" ,")+"> in <OR"+t+">"+(" inside <"+r.topLevelRule.name+`> Rule,
`)+("<"+e+`> may appears as a prefix path in all these alternatives.
`);return i=i+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
For Further details.`,i},buildEmptyRepetitionError:function(r){var e=(0,rG.getProductionDslName)(r.repetition);r.repetition.idx!==0&&(e+=r.repetition.idx);var t="The repetition <"+e+"> within Rule <"+r.topLevelRule.name+`> can never consume any tokens.
This could lead to an infinite loop.`;return t},buildTokenNameError:function(r){return"deprecated"},buildEmptyAlternationError:function(r){var e="Ambiguous empty alternative: <"+(r.emptyChoiceIdx+1)+">"+(" in <OR"+r.alternation.idx+"> inside <"+r.topLevelRule.name+`> Rule.
`)+"Only the last alternative may be an empty alternative.";return e},buildTooManyAlternativesError:function(r){var e=`An Alternation cannot have more than 256 alternatives:
`+("<OR"+r.alternation.idx+"> inside <"+r.topLevelRule.name+`> Rule.
has `+(r.alternation.definition.length+1)+" alternatives.");return e},buildLeftRecursionError:function(r){var e=r.topLevelRule.name,t=fye.map(r.leftRecursionPath,function(s){return s.name}),i=e+" --> "+t.concat([e]).join(" --> "),n=`Left Recursion found in grammar.
`+("rule: <"+e+`> can be invoked from itself (directly or indirectly)
`)+(`without consuming any Tokens. The grammar path that causes this is:
`+i+`
`)+` To fix this refactor your grammar to remove the left recursion.
see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return n},buildInvalidRuleNameError:function(r){return"deprecated"},buildDuplicateRuleNameError:function(r){var e;r.topLevelRule instanceof Gv.Rule?e=r.topLevelRule.name:e=r.topLevelRule;var t="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+r.grammarName+"<-";return t}}});var sG=w(zA=>{"use strict";var hye=zA&&zA.__extends||function(){var r=function(e,t){return r=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])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(zA,"__esModule",{value:!0});zA.GastRefResolverVisitor=zA.resolveGrammar=void 0;var pye=Zn(),iG=Yt(),dye=hg();function Cye(r,e){var t=new nG(r,e);return t.resolveRefs(),t.errors}zA.resolveGrammar=Cye;var nG=function(r){hye(e,r);function e(t,i){var n=r.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=i,n.errors=[],n}return e.prototype.resolveRefs=function(){var t=this;(0,iG.forEach)((0,iG.values)(this.nameToTopRule),function(i){t.currTopLevel=i,i.accept(t)})},e.prototype.visitNonTerminal=function(t){var i=this.nameToTopRule[t.nonTerminalName];if(i)t.referencedRule=i;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:pye.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}},e}(dye.GAstVisitor);zA.GastRefResolverVisitor=nG});var Mp=w(Mr=>{"use strict";var bc=Mr&&Mr.__extends||function(){var r=function(e,t){return r=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])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Mr,"__esModule",{value:!0});Mr.nextPossibleTokensAfter=Mr.possiblePathsFrom=Mr.NextTerminalAfterAtLeastOneSepWalker=Mr.NextTerminalAfterAtLeastOneWalker=Mr.NextTerminalAfterManySepWalker=Mr.NextTerminalAfterManyWalker=Mr.AbstractNextTerminalAfterProductionWalker=Mr.NextAfterTokenWalker=Mr.AbstractNextPossibleTokensWalker=void 0;var oG=YI(),Ut=Yt(),mye=Hv(),Dt=Qn(),aG=function(r){bc(e,r);function e(t,i){var n=r.call(this)||this;return n.topProd=t,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,Ut.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,Ut.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(t,i){i===void 0&&(i=[]),this.found||r.prototype.walk.call(this,t,i)},e.prototype.walkProdRef=function(t,i,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){var s=i.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,s)}},e.prototype.updateExpectedNext=function(){(0,Ut.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(oG.RestWalker);Mr.AbstractNextPossibleTokensWalker=aG;var Eye=function(r){bc(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.path=i,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminal
`+(""+s.join(`
`).replace(/\n/g,`
`)))}}};return t.prototype=i,t.prototype.constructor=t,t._RULE_NAMES=e,t}Pi.createBaseSemanticVisitorConstructor=uwe;function gwe(r,e,t){var i=function(){};(0,jp.defineNameProp)(i,r+"BaseSemanticsWithDefaults");var n=Object.create(t.prototype);return(0,xs.forEach)(e,function(s){n[s]=UG}),i.prototype=n,i.prototype.constructor=i,i}Pi.createBaseVisitorConstructorWithDefaults=gwe;var iS;(function(r){r[r.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",r[r.MISSING_METHOD=1]="MISSING_METHOD"})(iS=Pi.CstVisitorDefinitionError||(Pi.CstVisitorDefinitionError={}));function KG(r,e){var t=HG(r,e),i=jG(r,e);return t.concat(i)}Pi.validateVisitor=KG;function HG(r,e){var t=(0,xs.map)(e,function(i){if(!(0,xs.isFunction)(r[i]))return{msg:"Missing visitor method: <"+i+"> on "+(0,jp.functionName)(r.constructor)+" CST Visitor.",type:iS.MISSING_METHOD,methodName:i}});return(0,xs.compact)(t)}Pi.validateMissingCstMethods=HG;var fwe=["constructor","visit","validateVisitor"];function jG(r,e){var t=[];for(var i in r)(0,xs.isFunction)(r[i])&&!(0,xs.contains)(fwe,i)&&!(0,xs.contains)(e,i)&&t.push({msg:"Redundant visitor method: <"+i+"> on "+(0,jp.functionName)(r.constructor)+` CST Visitor
There is no Grammar Rule corresponding to this method's name.
`,type:iS.REDUNDANT_METHOD,methodName:i});return t}Pi.validateRedundantMethods=jG});var qG=w(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.TreeBuilder=void 0;var Eg=TG(),ii=Yt(),YG=GG(),hwe=Zn(),pwe=function(){function r(){}return r.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,ii.has)(e,"nodeLocationTracking")?e.nodeLocationTracking:hwe.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ii.NOOP,this.cstFinallyStateUpdate=ii.NOOP,this.cstPostTerminal=ii.NOOP,this.cstPostNonTerminal=ii.NOOP,this.cstPostRule=ii.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Eg.setNodeLocationFull,this.setNodeLocationFromNode=Eg.setNodeLocationFull,this.cstPostRule=ii.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ii.NOOP,this.setNodeLocationFromNode=ii.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Eg.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=Eg.setNodeLocationOnlyOffset,this.cstPostRule=ii.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ii.NOOP,this.setNodeLocationFromNode=ii.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ii.NOOP,this.setNodeLocationFromNode=ii.NOOP,this.cstPostRule=ii.NOOP,this.setInitialNodeLocation=ii.NOOP;else throw Error('Invalid <nodeLocationTracking> config option: "'+e.nodeLocationTracking+'"')},r.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},r.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},r.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},r.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},r.prototype.cstInvocationStateUpdate=function(e,t){var i={name:e,children:{}};this.setInitialNodeLocation(i),this.CST_STACK.push(i)},r.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},r.prototype.cstPostRuleFull=function(e){var t=this.LA(0),i=e.location;i.startOffset<=t.startOffset?(i.endOffset=t.endOffset,i.endLine=t.endLine,i.endColumn=t.endColumn):(i.startOffset=NaN,i.startLine=NaN,i.startColumn=NaN)},r.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),i=e.location;i.startOffset<=t.startOffset?i.endOffset=t.endOffset:i.startOffset=NaN},r.prototype.cstPostTerminal=function(e,t){var i=this.CST_STACK[this.CST_STACK.length-1];(0,Eg.addTerminalToCst)(i,t,e),this.setNodeLocationFromToken(i.location,t)},r.prototype.cstPostNonTerminal=function(e,t){var i=this.CST_STACK[this.CST_STACK.length-1];(0,Eg.addNoneTerminalToCst)(i,t,e),this.setNodeLocationFromNode(i.location,e.location)},r.prototype.getBaseCstVisitorConstructor=function(){if((0,ii.isUndefined)(this.baseCstVisitorConstructor)){var e=(0,YG.createBaseSemanticVisitorConstructor)(this.className,(0,ii.keys)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},r.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,ii.isUndefined)(this.baseCstVisitorWithDefaultsConstructor)){var e=(0,YG.createBaseVisitorConstructorWithDefaults)(this.className,(0,ii.keys)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},r.prototype.getLastExplicitRuleShortNa
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
For Further details.`);if((0,Fr.isArray)(e)){if((0,Fr.isEmpty)(e))throw Error(`A Token Vocabulary cannot be empty.
Note that the first argument for the parser constructor
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
For Further details.`)}if((0,Fr.isArray)(e))this.tokensMap=(0,Fr.reduce)(e,function(o,a){return o[a.name]=a,o},{});else if((0,Fr.has)(e,"modes")&&(0,Fr.every)((0,Fr.flatten)((0,Fr.values)(e.modes)),Gp.isTokenType)){var i=(0,Fr.flatten)((0,Fr.values)(e.modes)),n=(0,Fr.uniq)(i);this.tokensMap=(0,Fr.reduce)(n,function(o,a){return o[a.name]=a,o},{})}else if((0,Fr.isObject)(e))this.tokensMap=(0,Fr.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=ZG.EOF;var s=(0,Fr.every)((0,Fr.values)(e),function(o){return(0,Fr.isEmpty)(o.categoryMatches)});this.tokenMatcher=s?Gp.tokenStructuredMatcherNoCategories:Gp.tokenStructuredMatcher,(0,Gp.augmentTokenTypes)((0,Fr.values)(this.tokensMap))},r.prototype.defineRule=function(e,t,i){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+`> may not be defined after the 'performSelfAnalysis' method has been called'
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var n=(0,Fr.has)(i,"resyncEnabled")?i.resyncEnabled:XG.DEFAULT_RULE_CONFIG.resyncEnabled,s=(0,Fr.has)(i,"recoveryValueFunc")?i.recoveryValueFunc:XG.DEFAULT_RULE_CONFIG.recoveryValueFunc,o=this.ruleShortNameIdx<<$n.BITS_FOR_METHOD_TYPE+$n.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o;function a(u){try{if(this.outputCst===!0){t.apply(this,u);var g=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(g),g}else return t.apply(this,u)}catch(f){return this.invokeRuleCatch(f,n,s)}finally{this.ruleFinallyStateUpdate()}}var l=function(u,g){return u===void 0&&(u=0),this.ruleInvocationStateUpdate(o,e,u),a.call(this,g)},c="ruleName";return l[c]=e,l.originalGrammarAction=t,l},r.prototype.invokeRuleCatch=function(e,t,i){var n=this.RULE_STACK.length===1,s=t&&!this.isBackTracking()&&this.recoveryEnabled;if((0,sy.isRecognitionException)(e)){var o=e;if(s){var a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(o.resyncedTokens=this.reSyncTo(a),this.outputCst){var l=this.CST_STACK[this.CST_STACK.length-1];return l.recoveredNode=!0,l}else return i();else{if(this.outputCst){var l=this.CST_STACK[this.CST_STACK.length-1];l.recoveredNode=!0,o.partialCstResult=l}throw o}}else{if(n)return this.moveToTerminatedState(),i();throw o}}else throw e},r.prototype.optionInternal=function(e,t){var i=this.getKeyForAutomaticLookahead($n.OPTION_IDX,t);return this.optionInternalLogic(e,t,i)},r.prototype.optionInternalLogic=function(e,t,i){var n=this,s=this.getLaFuncFromCache(i),o,a;if(e.DEF!==void 0){if(o=e.DEF,a=e.GATE,a!==void 0){var l=s;s=function(){return a.call(n)&&l.call(n)}}}else o=e;if(s.call(this)===!0)return o.call(this)},r.prototype.atLeastOneInternal=function(e,t){var i=this.getKeyForAutomaticLookahead($n.AT_LEAST_ONE_IDX,e);return this.atLeastOneInternalLogic(e,t,i)},r.prototype.atLeastOneInternalLogic=function(e,t,i){var n=this,s=this.getLaFuncFromCache(i),o,a;if(t.DEF!==void 0){if(o=t.DEF,a=t.GATE,a!==void 0){var l=s;s=function(){return a.call(n)&&l.call(n)}}}else o=t;if(s.call(this)===!0)for(var c=this.doSingleRepetition(o);s.call(this)===!0&&c===!0;)c=this.doSingleRepetition(o);else throw this.raiseEarlyExitException(e,VG.PROD_TYPE.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],s,$n.AT_LEAST_ONE_IDX,e,Ig.NextTerminalAfterAtLeastOneWalker)},r.prototype.atLeastOneSepFirstInternal=function(e,t){var i=this.getKeyForAutomaticLookahead($n.AT_LEAST_ONE_SEP_IDX,e);this.atLeastOneSepFirstInternalLogic(e,t,i)},r.prototype.atLeastOneSepFirstInternalLogic=function(e,t,i){var n=this,s=t.DEF,o=t.SEP,a=this.getLaFuncFromCache(i);if(a.call(this)===!0){s.call(this);for(var l=function(){return n.tokenMatcher(n.LA(1),o)};this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),s.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,l,s,Ig.NextTerminalAfterAtLeastOneSepWalker],l,$n.AT_LEAST_ONE_SEP_IDX,e,Ig.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(e,VG.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)},r.prototype.manyInternal=function(e,t){var i=this.getKeyForAutomaticLookahead($n.MANY_IDX,e);return this.manyInternalLogic(e,t,i)},r.prototype.manyInternalLogic=function(e,t,i){var n=this,s=this.getLaFuncFromCache(i),o,a;if(t.DEF!==void 0){if(o=t.DEF,a=t.GATE,a!==void 0){var l=s;s=function(){return a.call(n)&&l.call(n)}}}else o=t;for(var c=!0;s.call(this)===!0&&c===!0;)c=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],s,$n.MANY_IDX,e,Ig.NextTerminalAfterManyWalker,c)},r.prototype.manySepFirstInternal=function(e,t){var i=this.getKeyForAutomaticLookahead($n.MANY_SEP_IDX,e);this.manySepFirstInternalLogic(e,t,i)},r.prototype.manySepFirstInternalLogic=function(e,t,i){var n=this,s=t.DEF,o=t.SEP,a=this.getLaFuncFromCache(i);if(a.call(this)===!0){s.call(this);for(var l=function(){return n.tokenMatcher(n.LA(1),o)};this.tokenMatcher(this.LA(1)
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(cY);var Dwe={name:`This CSTNode indicates the Parser is in Recording Phase
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Rwe=function(){function r(){}return r.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},r.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var t=function(n){var s=n>0?n:"";e["CONSUME"+s]=function(o,a){return this.consumeInternalRecord(o,n,a)},e["SUBRULE"+s]=function(o,a){return this.subruleInternalRecord(o,n,a)},e["OPTION"+s]=function(o){return this.optionInternalRecord(o,n)},e["OR"+s]=function(o){return this.orInternalRecord(o,n)},e["MANY"+s]=function(o){this.manyInternalRecord(n,o)},e["MANY_SEP"+s]=function(o){this.manySepFirstInternalRecord(n,o)},e["AT_LEAST_ONE"+s]=function(o){this.atLeastOneInternalRecord(n,o)},e["AT_LEAST_ONE_SEP"+s]=function(o){this.atLeastOneSepFirstInternalRecord(n,o)}},i=0;i<10;i++)t(i);e.consume=function(n,s,o){return this.consumeInternalRecord(s,n,o)},e.subrule=function(n,s,o){return this.subruleInternalRecord(s,n,o)},e.option=function(n,s){return this.optionInternalRecord(s,n)},e.or=function(n,s){return this.orInternalRecord(s,n)},e.many=function(n,s){this.manyInternalRecord(n,s)},e.atLeastOne=function(n,s){this.atLeastOneInternalRecord(n,s)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD})},r.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var t=0;t<10;t++){var i=t>0?t:"";delete e["CONSUME"+i],delete e["SUBRULE"+i],delete e["OPTION"+i],delete e["OR"+i],delete e["MANY"+i],delete e["MANY_SEP"+i],delete e["AT_LEAST_ONE"+i],delete e["AT_LEAST_ONE_SEP"+i]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})},r.prototype.ACTION_RECORD=function(e){},r.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},r.prototype.LA_RECORD=function(e){return kwe.END_OF_FILE},r.prototype.topLevelRuleRecord=function(e,t){try{var i=new jo.Rule({definition:[],name:e});return i.name=e,this.recordingProdStack.push(i),t.call(this),this.recordingProdStack.pop(),i}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
This error was thrown during the "grammar recording phase" For more info see:
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch(s){throw n}throw n}},r.prototype.optionInternalRecord=function(e,t){return Yp.call(this,jo.Option,e,t)},r.prototype.atLeastOneInternalRecord=function(e,t){Yp.call(this,jo.RepetitionMandatory,t,e)},r.prototype.atLeastOneSepFirstInternalRecord=function(e,t){Yp.call(this,jo.RepetitionMandatoryWithSeparator,t,e,aY)},r.prototype.manyInternalRecord=function(e,t){Yp.call(this,jo.Repetition,t,e)},r.prototype.manySepFirstInternalRecord=function(e,t){Yp.call(this,jo.RepetitionWithSeparator,t,e,aY)},r.prototype.orInternalRecord=function(e,t){return Fwe.call(this,e,t)},r.prototype.subruleInternalRecord=function(e,t,i){if(cy(t),!e||(0,xn.has)(e,"ruleName")===!1){var n=new Error("<SUBRULE"+uY(t)+"> argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(e)+">")+(`
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var s=(0,xn.peek)(this.recordingProdStack),o=e.ruleName,a=new jo.NonTerminal({idx:t,nonTerminalName:o,label:i==null?void 0:i.LABEL,referencedRule:void 0});return s.definition.push(a),this.outputCst?Dwe:ly},r.prototype.consumeInternalRecord=function(e,t,i){if(cy(t),!(0,sY.hasShortKeyProperty)(e)){var n=new Error("<CONSUME"+uY(t)+"> argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(e)+">")+(`
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var s=(0,xn.peek)(this.recordingProdStack),o=new jo.Terminal({idx:t,terminalType:e,label:i==null?void 0:i.LABEL});return s.definition.push(o),cY},r}();Ay.GastRecorder=Rwe;function Yp(r,e,t,i){i===void 0&&(i=!1),cy(t);var n=(0,xn.peek)(this.recordingProdStack),s=(0,xn.isFunction)(e)?e:e.DEF,o=new r({definition:[],idx:t});return i&&(o.separator=e.SEP),(0,xn.has)(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),n.definition.push(o),this.recordingProdStack.pop(),ly}function Fwe(r,e){var t=this;cy(e);var i=(0,xn.peek)(this.recordingProdStack),n=(0,xn.isArray)(r)===!1,s=n===!1?r:r.DEF,o=new jo.Alternation({definition:[],idx:e,ignoreAmbiguities:n&&r.IGNORE_AMBIGUITIES===!0});(0,xn.has)(r,"MAX_LOOKAHEAD")&&(o.maxLookahead=r.MAX_LOOKAHEAD);var a=(0,xn.some)(s,function(l){return(0,xn.isFunction)(l.GATE)});return o.hasPredicates=a,i.definition.push(o),(0,xn.forEach)(s,function(l){var c=new jo.Alternative({definition:[]});o.definition.push(c),(0,xn.has)(l,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:(0,xn.has)(l,"GATE")&&(c.ignoreAmbiguities=!0),t.recordingProdStack.push(c),l.ALT.call(t),t.recordingProdStack.pop()}),ly}function uY(r){return r===0?"":""+r}function cy(r){if(r<0||r>AY){var e=new Error("Invalid DSL Method idx value: <"+r+`>
`+("Idx value must be a none negative value smaller than "+(AY+1)));throw e.KNOWN_RECORDER_ERROR=!0,e}}});var hY=w(uy=>{"use strict";Object.defineProperty(uy,"__esModule",{value:!0});uy.PerformanceTracer=void 0;var fY=Yt(),Lwe=Zn(),Nwe=function(){function r(){}return r.prototype.initPerformanceTracer=function(e){if((0,fY.has)(e,"traceInitPerf")){var t=e.traceInitPerf,i=typeof t=="number";this.traceInitMaxIdent=i?t:Infinity,this.traceInitPerf=i?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Lwe.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},r.prototype.TRACE_INIT=function(e,t){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,fY.timer)(t),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 t()},r}();uy.PerformanceTracer=Nwe});var pY=w(gy=>{"use strict";Object.defineProperty(gy,"__esModule",{value:!0});gy.applyMixins=void 0;function Twe(r,e){e.forEach(function(t){var i=t.prototype;Object.getOwnPropertyNames(i).forEach(function(n){if(n!=="constructor"){var s=Object.getOwnPropertyDescriptor(i,n);s&&(s.get||s.set)?Object.defineProperty(r.prototype,n,s):r.prototype[n]=t.prototype[n]}})})}gy.applyMixins=Twe});var Zn=w(Er=>{"use strict";var dY=Er&&Er.__extends||function(){var r=function(e,t){return r=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])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Er,"__esModule",{value:!0});Er.EmbeddedActionsParser=Er.CstParser=Er.Parser=Er.EMPTY_ALT=Er.ParserDefinitionErrorType=Er.DEFAULT_RULE_CONFIG=Er.DEFAULT_PARSER_CONFIG=Er.END_OF_FILE=void 0;var an=Yt(),Owe=tG(),CY=WA(),mY=Tp(),EY=SG(),Mwe=tS(),Uwe=NG(),Kwe=qG(),Hwe=WG(),jwe=_G(),Gwe=$G(),Ywe=tY(),qwe=nY(),Jwe=gY(),Wwe=hY(),zwe=pY();Er.END_OF_FILE=(0,CY.createTokenInstance)(CY.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Er.END_OF_FILE);Er.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:mY.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1});Er.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});var _we;(function(r){r[r.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",r[r.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",r[r.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",r[r.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",r[r.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",r[r.LEFT_RECURSION=5]="LEFT_RECURSION",r[r.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",r[r.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",r[r.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",r[r.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",r[r.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",r[r.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",r[r.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(_we=Er.ParserDefinitionErrorType||(Er.ParserDefinitionErrorType={}));function Vwe(r){return r===void 0&&(r=void 0),function(){return r}}Er.EMPTY_ALT=Vwe;var fy=function(){function r(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;var i=this;if(i.initErrorHandler(t),i.initLexerAdapter(),i.initLooksAhead(t),i.initRecognizerEngine(e,t),i.initRecoverable(t),i.initTreeBuilder(t),i.initContentAssist(),i.initGastRecorder(t),i.initPerformanceTracer(t),(0,an.has)(t,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
For further details.`);this.skipValidations=(0,an.has)(t,"skipValidations")?t.skipValidations:Er.DEFAULT_PARSER_CONFIG.skipValidations}return r.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},r.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT("performSelfAnalysis",function(){var t;e.selfAnalysisDone=!0;var i=e.className;e.TRACE_INIT("toFastProps",function(){(0,an.toFastProperties)(e)}),e.TRACE_INIT("Grammar Recording",function(){try{e.enableRecording(),(0,an.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,EY.resolveGrammar)({rules:(0,an.values)(e.gastProductionsCache)}),e.definitionErrors=e.definitionErrors.concat(n)}),e.TRACE_INIT("Grammar Validations",function(){if((0,an.isEmpty)(n)&&e.skipValidations===!1){var s=(0,EY.validateGrammar)({rules:(0,an.values)(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:(0,an.values)(e.tokensMap),errMsgProvider:mY.defaultGrammarValidatorErrorProvider,grammarName:i});e.definitionErrors=e.definitionErrors.concat(s)}}),(0,an.isEmpty)(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT("computeAllProdsFollows",function(){var s=(0,Owe.computeAllProdsFollows)((0,an.values)(e.gastProductionsCache));e.resyncFollows=s}),e.TRACE_INIT("ComputeLookaheadFunctions",function(){e.preComputeLookaheadFunctions((0,an.values)(e.gastProductionsCache))})),!r.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,an.isEmpty)(e.definitionErrors))throw t=(0,an.map)(e.definitionErrors,function(s){return s.message}),new Error(`Parser Definition Errors detected:
`+t.join(`
-------------------------------
`))})},r.DEFER_DEFINITION_ERRORS_HANDLING=!1,r}();Er.Parser=fy;(0,zwe.applyMixins)(fy,[Mwe.Recoverable,Uwe.LooksAhead,Kwe.TreeBuilder,Hwe.LexerAdapter,Gwe.RecognizerEngine,jwe.RecognizerApi,Ywe.ErrorHandler,qwe.ContentAssist,Jwe.GastRecorder,Wwe.PerformanceTracer]);var Xwe=function(r){dY(e,r);function e(t,i){i===void 0&&(i=Er.DEFAULT_PARSER_CONFIG);var n=this,s=(0,an.cloneObj)(i);return s.outputCst=!0,n=r.call(this,t,s)||this,n}return e}(fy);Er.CstParser=Xwe;var Zwe=function(r){dY(e,r);function e(t,i){i===void 0&&(i=Er.DEFAULT_PARSER_CONFIG);var n=this,s=(0,an.cloneObj)(i);return s.outputCst=!1,n=r.call(this,t,s)||this,n}return e}(fy);Er.EmbeddedActionsParser=Zwe});var yY=w(hy=>{"use strict";Object.defineProperty(hy,"__esModule",{value:!0});hy.createSyntaxDiagramsCode=void 0;var IY=vv();function $we(r,e){var t=e===void 0?{}:e,i=t.resourceBase,n=i===void 0?"https://unpkg.com/chevrotain@"+IY.VERSION+"/diagrams/":i,s=t.css,o=s===void 0?"https://unpkg.com/chevrotain@"+IY.VERSION+"/diagrams/diagrams.css":s,a=`
<!-- This is a generated file -->
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
background-color: hsl(30, 20%, 95%)
}
</style>
`,l=`
<link rel='stylesheet' href='`+o+`'>
`,c=`
<script src='`+n+`vendor/railroad-diagrams.js'></script>
<script src='`+n+`src/diagrams_builder.js'></script>
<script src='`+n+`src/diagrams_behavior.js'></script>
<script src='`+n+`src/main.js'></script>
`,u=`
<div id="diagrams" align="center"></div>
`,g=`
<script>
window.serializedGrammar = `+JSON.stringify(r,null," ")+`;
</script>
`,f=`
<script>
var diagramsDiv = document.getElementById("diagrams");
main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);
</script>
`;return a+l+c+u+g+f}hy.createSyntaxDiagramsCode=$we});var bY=w(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.Parser=Ve.createSyntaxDiagramsCode=Ve.clearCache=Ve.GAstVisitor=Ve.serializeProduction=Ve.serializeGrammar=Ve.Terminal=Ve.Rule=Ve.RepetitionWithSeparator=Ve.RepetitionMandatoryWithSeparator=Ve.RepetitionMandatory=Ve.Repetition=Ve.Option=Ve.NonTerminal=Ve.Alternative=Ve.Alternation=Ve.defaultLexerErrorProvider=Ve.NoViableAltException=Ve.NotAllInputParsedException=Ve.MismatchedTokenException=Ve.isRecognitionException=Ve.EarlyExitException=Ve.defaultParserErrorProvider=Ve.tokenName=Ve.tokenMatcher=Ve.tokenLabel=Ve.EOF=Ve.createTokenInstance=Ve.createToken=Ve.LexerDefinitionErrorType=Ve.Lexer=Ve.EMPTY_ALT=Ve.ParserDefinitionErrorType=Ve.EmbeddedActionsParser=Ve.CstParser=Ve.VERSION=void 0;var eBe=vv();Object.defineProperty(Ve,"VERSION",{enumerable:!0,get:function(){return eBe.VERSION}});var py=Zn();Object.defineProperty(Ve,"CstParser",{enumerable:!0,get:function(){return py.CstParser}});Object.defineProperty(Ve,"EmbeddedActionsParser",{enumerable:!0,get:function(){return py.EmbeddedActionsParser}});Object.defineProperty(Ve,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return py.ParserDefinitionErrorType}});Object.defineProperty(Ve,"EMPTY_ALT",{enumerable:!0,get:function(){return py.EMPTY_ALT}});var wY=Dp();Object.defineProperty(Ve,"Lexer",{enumerable:!0,get:function(){return wY.Lexer}});Object.defineProperty(Ve,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return wY.LexerDefinitionErrorType}});var yg=WA();Object.defineProperty(Ve,"createToken",{enumerable:!0,get:function(){return yg.createToken}});Object.defineProperty(Ve,"createTokenInstance",{enumerable:!0,get:function(){return yg.createTokenInstance}});Object.defineProperty(Ve,"EOF",{enumerable:!0,get:function(){return yg.EOF}});Object.defineProperty(Ve,"tokenLabel",{enumerable:!0,get:function(){return yg.tokenLabel}});Object.defineProperty(Ve,"tokenMatcher",{enumerable:!0,get:function(){return yg.tokenMatcher}});Object.defineProperty(Ve,"tokenName",{enumerable:!0,get:function(){return yg.tokenName}});var tBe=Tp();Object.defineProperty(Ve,"defaultParserErrorProvider",{enumerable:!0,get:function(){return tBe.defaultParserErrorProvider}});var qp=mg();Object.defineProperty(Ve,"EarlyExitException",{enumerable:!0,get:function(){return qp.EarlyExitException}});Object.defineProperty(Ve,"isRecognitionException",{enumerable:!0,get:function(){return qp.isRecognitionException}});Object.defineProperty(Ve,"MismatchedTokenException",{enumerable:!0,get:function(){return qp.MismatchedTokenException}});Object.defineProperty(Ve,"NotAllInputParsedException",{enumerable:!0,get:function(){return qp.NotAllInputParsedException}});Object.defineProperty(Ve,"NoViableAltException",{enumerable:!0,get:function(){return qp.NoViableAltException}});var rBe=Tv();Object.defineProperty(Ve,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return rBe.defaultLexerErrorProvider}});var Go=Qn();Object.defineProperty(Ve,"Alternation",{enumerable:!0,get:function(){return Go.Alternation}});Object.defineProperty(Ve,"Alternative",{enumerable:!0,get:function(){return Go.Alternative}});Object.defineProperty(Ve,"NonTerminal",{enumerable:!0,get:function(){return Go.NonTerminal}});Object.defineProperty(Ve,"Option",{enumerable:!0,get:function(){return Go.Option}});Object.defineProperty(Ve,"Repetition",{enumerable:!0,get:function(){return Go.Repetition}});Object.defineProperty(Ve,"RepetitionMandatory",{enumerable:!0,get:function(){return Go.RepetitionMandatory}});Object.defineProperty(Ve,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return Go.RepetitionMandatoryWithSeparator}});Object.defineProperty(Ve,"RepetitionWithSeparator",{enumerable:!0,get:function(){return Go.RepetitionWithSeparator}});Object.defineProperty(Ve,"Rule",{enumerable:!0,get:function(){return Go.Rule}});Object.defineProperty(Ve,"Terminal",{enumerable:!0,get:function(){return Go.Terminal}});var BY=Qn();Object.defineProperty(Ve,"serializeGrammar",{enumerable:!0,get:function(
It performs no action other than printing this message.
Please avoid using it as it will be completely removed in the future`)}Ve.clearCache=nBe;var sBe=yY();Object.defineProperty(Ve,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return sBe.createSyntaxDiagramsCode}});var oBe=function(){function r(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return r}();Ve.Parser=oBe});var SY=w((prt,QY)=>{var dy=bY(),Ya=dy.createToken,vY=dy.tokenMatcher,aS=dy.Lexer,aBe=dy.EmbeddedActionsParser;QY.exports=r=>{let e=Ya({name:"LogicalOperator",pattern:aS.NA}),t=Ya({name:"Or",pattern:/\|/,categories:e}),i=Ya({name:"Xor",pattern:/\^/,categories:e}),n=Ya({name:"And",pattern:/&/,categories:e}),s=Ya({name:"Not",pattern:/!/}),o=Ya({name:"LParen",pattern:/\(/}),a=Ya({name:"RParen",pattern:/\)/}),l=Ya({name:"Query",pattern:r}),u=[Ya({name:"WhiteSpace",pattern:/\s+/,group:aS.SKIPPED}),t,i,n,o,a,s,e,l],g=new aS(u);class f extends aBe{constructor(p){super(u);this.RULE("expression",()=>this.SUBRULE(this.logicalExpression)),this.RULE("logicalExpression",()=>{let y=this.SUBRULE(this.atomicExpression);return this.MANY(()=>{let Q=y,S=this.CONSUME(e),x=this.SUBRULE2(this.atomicExpression);vY(S,t)?y=M=>Q(M)||x(M):vY(S,i)?y=M=>!!(Q(M)^x(M)):y=M=>Q(M)&&x(M)}),y}),this.RULE("atomicExpression",()=>this.OR([{ALT:()=>this.SUBRULE(this.parenthesisExpression)},{ALT:()=>{let{image:m}=this.CONSUME(l);return y=>y(m)}},{ALT:()=>{this.CONSUME(s);let m=this.SUBRULE(this.atomicExpression);return y=>!m(y)}}])),this.RULE("parenthesisExpression",()=>{let m;return this.CONSUME(o),m=this.SUBRULE(this.expression),this.CONSUME(a),m}),this.performSelfAnalysis()}}return{TinylogicLexer:g,TinylogicParser:f}}});var xY=w(Cy=>{var ABe=SY();Cy.makeParser=(r=/[a-z]+/)=>{let{TinylogicLexer:e,TinylogicParser:t}=ABe(r),i=new t;return(n,s)=>{let o=e.tokenize(n);return i.input=o.tokens,i.expression()(s)}};Cy.parse=Cy.makeParser()});var PY=w((Crt,kY)=>{"use strict";kY.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedr
`:`
`)+t,n=i+1,i=r.indexOf(`
`,n)}while(i!==-1);return s+=r.substr(n),s};zY.exports={stringReplaceAll:yBe,stringEncaseCRLFWithFirstIndex:wBe}});var eq=w((Qrt,VY)=>{"use strict";var BBe=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,XY=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,bBe=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,QBe=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,vBe=new Map([["n",`
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a","\x07"]]);function ZY(r){let e=r[0]==="u",t=r[1]==="{";return e&&!t&&r.length===5||r[0]==="x"&&r.length===3?String.fromCharCode(parseInt(r.slice(1),16)):e&&t?String.fromCodePoint(parseInt(r.slice(2,-1),16)):vBe.get(r)||r}function SBe(r,e){let t=[],i=e.trim().split(/\s*,\s*/g),n;for(let s of i){let o=Number(s);if(!Number.isNaN(o))t.push(o);else if(n=s.match(bBe))t.push(n[2].replace(QBe,(a,l,c)=>l?ZY(l):c));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${r}')`)}return t}function xBe(r){XY.lastIndex=0;let e=[],t;for(;(t=XY.exec(r))!==null;){let i=t[1];if(t[2]){let n=SBe(i,t[2]);e.push([i].concat(n))}else e.push([i])}return e}function $Y(r,e){let t={};for(let n of e)for(let s of n.styles)t[s[0]]=n.inverse?null:s.slice(1);let i=r;for(let[n,s]of Object.entries(t))if(!!Array.isArray(s)){if(!(n in i))throw new Error(`Unknown Chalk style: ${n}`);i=s.length>0?i[n](...s):i[n]}return i}VY.exports=(r,e)=>{let t=[],i=[],n=[];if(e.replace(BBe,(s,o,a,l,c,u)=>{if(o)n.push(ZY(o));else if(l){let g=n.join("");n=[],i.push(t.length===0?g:$Y(r,t)(g)),t.push({inverse:a,styles:xBe(l)})}else if(c){if(t.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push($Y(r,t)(n.join(""))),n=[],t.pop()}else n.push(u)}),i.push(n.join("")),t.length>0){let s=`Chalk template literal is missing ${t.length} closing bracket${t.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return i.join("")}});var CS=w((vrt,tq)=>{"use strict";var Wp=jY(),{stdout:fS,stderr:hS}=WY(),{stringReplaceAll:kBe,stringEncaseCRLFWithFirstIndex:PBe}=_Y(),rq=["ansi","ansi","ansi256","ansi16m"],Qg=Object.create(null),DBe=(r,e={})=>{if(e.level>3||e.level<0)throw new Error("The `level` option should be an integer from 0 to 3");let t=fS?fS.level:0;r.level=e.level===void 0?t:e.level},iq=class{constructor(e){return nq(e)}},nq=r=>{let e={};return DBe(e,r),e.template=(...t)=>FBe(e.template,...t),Object.setPrototypeOf(e,Iy.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=iq,e.template};function Iy(r){return nq(r)}for(let[r,e]of Object.entries(Wp))Qg[r]={get(){let t=yy(this,pS(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,r,{value:t}),t}};Qg.visible={get(){let r=yy(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:r}),r}};var sq=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let r of sq)Qg[r]={get(){let{level:e}=this;return function(...t){let i=pS(Wp.color[rq[e]][r](...t),Wp.color.close,this._styler);return yy(this,i,this._isEmpty)}}};for(let r of sq){let e="bg"+r[0].toUpperCase()+r.slice(1);Qg[e]={get(){let{level:t}=this;return function(...i){let n=pS(Wp.bgColor[rq[t]][r](...i),Wp.bgColor.close,this._styler);return yy(this,n,this._isEmpty)}}}}var RBe=Object.defineProperties(()=>{},ie(L({},Qg),{level:{enumerable:!0,get(){return this._generator.level},set(r){this._generator.level=r}}})),pS=(r,e,t)=>{let i,n;return t===void 0?(i=r,n=e):(i=t.openAll+r,n=e+t.closeAll),{open:r,close:e,openAll:i,closeAll:n,parent:t}},yy=(r,e,t)=>{let i=(...n)=>LBe(i,n.length===1?""+n[0]:n.join(" "));return i.__proto__=RBe,i._generator=r,i._styler=e,i._isEmpty=t,i},LBe=(r,e)=>{if(r.level<=0||!e)return r._isEmpty?"":e;let t=r._styler;if(t===void 0)return e;let{openAll:i,closeAll:n}=t;if(e.indexOf("")!==-1)for(;t!==void 0;)e=kBe(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
`);return s!==-1&&(e=PBe(e,n,i,s)),i+e+n},dS,FBe=(r,...e)=>{let[t]=e;if(!Array.isArray(t))return e.join(" ");let i=e.slice(1),n=[t.raw[0]];for(let s=1;s<t.length;s++)n.push(String(i[s-1]).replace(/[{}\\]/g,"\\$&"),String(t.raw[s]));return dS===void 0&&(dS=eq()),dS(r,n.join(""))};Object.defineProperties(Iy.prototype,Qg);var zp=Iy();zp.supportsColor=fS;zp.stderr=Iy({level:hS?hS.level:0});zp.stderr.supportsColor=hS;zp.Level={None:0,Basic:1,Ansi256:2,TrueColor:3,0:"None",1:"Basic",2:"Ansi256",3:"TrueColor"};tq.exports=zp});var wy=w(Ps=>{"use strict";Ps.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;Ps.find=(r,e)=>r.nodes.find(t=>t.type===e);Ps.exceedsLimit=(r,e,t=1,i)=>i===!1||!Ps.isInteger(r)||!Ps.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=i;Ps.escapeNode=(r,e=0,t)=>{let i=r.nodes[e];!i||(t&&i.type===t||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)};Ps.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0==0?(r.invalid=!0,!0):!1;Ps.isInvalidBrace=r=>r.type!=="brace"?!1:r.invalid===!0||r.dollar?!0:r.commas>>0+r.ranges>>0==0||r.open!==!0||r.close!==!0?(r.invalid=!0,!0):!1;Ps.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;Ps.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);Ps.flatten=(...r)=>{let e=[],t=i=>{for(let n=0;n<i.length;n++){let s=i[n];Array.isArray(s)?t(s,e):s!==void 0&&e.push(s)}return e};return t(r),e}});var By=w((xrt,oq)=>{"use strict";var aq=wy();oq.exports=(r,e={})=>{let t=(i,n={})=>{let s=e.escapeInvalid&&aq.isInvalidBrace(n),o=i.invalid===!0&&e.escapeInvalid===!0,a="";if(i.value)return(s||o)&&aq.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(let l of i.nodes)a+=t(l);return a};return t(r)}});var lq=w((krt,Aq)=>{"use strict";Aq.exports=function(r){return typeof r=="number"?r-r==0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var mq=w((Prt,cq)=>{"use strict";var uq=lq(),vc=(r,e,t)=>{if(uq(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(uq(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let i=L({relaxZeros:!0},t);typeof i.strictZeros=="boolean"&&(i.relaxZeros=i.strictZeros===!1);let n=String(i.relaxZeros),s=String(i.shorthand),o=String(i.capture),a=String(i.wrap),l=r+":"+e+"="+n+s+o+a;if(vc.cache.hasOwnProperty(l))return vc.cache[l].result;let c=Math.min(r,e),u=Math.max(r,e);if(Math.abs(c-u)===1){let m=r+"|"+e;return i.capture?`(${m})`:i.wrap===!1?m:`(?:${m})`}let g=fq(r)||fq(e),f={min:r,max:e,a:c,b:u},h=[],p=[];if(g&&(f.isPadded=g,f.maxLen=String(f.max).length),c<0){let m=u<0?Math.abs(u):1;p=gq(m,Math.abs(c),f,i),c=f.a=0}return u>=0&&(h=gq(c,u,f,i)),f.negatives=p,f.positives=h,f.result=NBe(p,h,i),i.capture===!0?f.result=`(${f.result})`:i.wrap!==!1&&h.length+p.length>1&&(f.result=`(?:${f.result})`),vc.cache[l]=f,f.result};function NBe(r,e,t){let i=mS(r,e,"-",!1,t)||[],n=mS(e,r,"",!1,t)||[],s=mS(r,e,"-?",!0,t)||[];return i.concat(s).concat(n).join("|")}function OBe(r,e){let t=1,i=1,n=hq(r,t),s=new Set([e]);for(;r<=n&&n<=e;)s.add(n),t+=1,n=hq(r,t);for(n=pq(e+1,i)-1;r<n&&n<=e;)s.add(n),i+=1,n=pq(e+1,i)-1;return s=[...s],s.sort(TBe),s}function KBe(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let i=MBe(r,e),n=i.length,s="",o=0;for(let a=0;a<n;a++){let[l,c]=i[a];l===c?s+=l:l!=="0"||c!=="9"?s+=UBe(l,c,t):o++}return o&&(s+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:n}}function gq(r,e,t,i){let n=OBe(r,e),s=[],o=r,a;for(let l=0;l<n.length;l++){let c=n[l],u=KBe(String(o),String(c),i),g="";if(!t.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+dq(a.count),o=c+1;continue}t.isPadded&&(g=HBe(c,t,i)),u.string=g+u.pattern+dq(u.count),s.push(u),o=c+1,a=u}return s}function mS(r,e,t,i,n){let s=[];for(let o of r){let{string:a}=o;!i&&!Cq(e,"string",
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Uq=w((Nrt,Nq)=>{"use strict";var e0e=By(),{MAX_LENGTH:Tq,CHAR_BACKSLASH:wS,CHAR_BACKTICK:t0e,CHAR_COMMA:r0e,CHAR_DOT:i0e,CHAR_LEFT_PARENTHESES:n0e,CHAR_RIGHT_PARENTHESES:s0e,CHAR_LEFT_CURLY_BRACE:o0e,CHAR_RIGHT_CURLY_BRACE:a0e,CHAR_LEFT_SQUARE_BRACKET:Oq,CHAR_RIGHT_SQUARE_BRACKET:Mq,CHAR_DOUBLE_QUOTE:A0e,CHAR_SINGLE_QUOTE:l0e,CHAR_NO_BREAK_SPACE:c0e,CHAR_ZERO_WIDTH_NOBREAK_SPACE:u0e}=Lq(),g0e=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},i=typeof t.maxLength=="number"?Math.min(Tq,t.maxLength):Tq;if(r.length>i)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${i})`);let n={type:"root",input:r,nodes:[]},s=[n],o=n,a=n,l=0,c=r.length,u=0,g=0,f,h={},p=()=>r[u++],m=y=>{if(y.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&y.type==="text"){a.value+=y.value;return}return o.nodes.push(y),y.parent=o,y.prev=a,a=y,y};for(m({type:"bos"});u<c;)if(o=s[s.length-1],f=p(),!(f===u0e||f===c0e)){if(f===wS){m({type:"text",value:(e.keepEscaping?f:"")+p()});continue}if(f===Mq){m({type:"text",value:"\\"+f});continue}if(f===Oq){l++;let y=!0,Q;for(;u<c&&(Q=p());){if(f+=Q,Q===Oq){l++;continue}if(Q===wS){f+=p();continue}if(Q===Mq&&(l--,l===0))break}m({type:"text",value:f});continue}if(f===n0e){o=m({type:"paren",nodes:[]}),s.push(o),m({type:"text",value:f});continue}if(f===s0e){if(o.type!=="paren"){m({type:"text",value:f});continue}o=s.pop(),m({type:"text",value:f}),o=s[s.length-1];continue}if(f===A0e||f===l0e||f===t0e){let y=f,Q;for(e.keepQuotes!==!0&&(f="");u<c&&(Q=p());){if(Q===wS){f+=Q+p();continue}if(Q===y){e.keepQuotes===!0&&(f+=Q);break}f+=Q}m({type:"text",value:f});continue}if(f===o0e){g++;let y=a.value&&a.value.slice(-1)==="$"||o.dollar===!0;o=m({type:"brace",open:!0,close:!1,dollar:y,depth:g,commas:0,ranges:0,nodes:[]}),s.push(o),m({type:"open",value:f});continue}if(f===a0e){if(o.type!=="brace"){m({type:"text",value:f});continue}let y="close";o=s.pop(),o.close=!0,m({type:y,value:f}),g--,o=s[s.length-1];continue}if(f===r0e&&g>0){if(o.ranges>0){o.ranges=0;let y=o.nodes.shift();o.nodes=[y,{type:"text",value:e0e(o)}]}m({type:"comma",value:f}),o.commas++;continue}if(f===i0e&&g>0&&o.commas===0){let y=o.nodes;if(g===0||y.length===0){m({type:"text",value:f});continue}if(a.type==="dot"){if(o.range=[],a.value+=f,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){y.pop();let Q=y[y.length-1];Q.value+=a.value+f,a=Q,o.ranges--;continue}m({type:"dot",value:f});continue}m({type:"text",value:f})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(S=>{S.nodes||(S.type==="open"&&(S.isOpen=!0),S.type==="close"&&(S.isClose=!0),S.nodes||(S.type="text"),S.invalid=!0)});let y=s[s.length-1],Q=y.nodes.indexOf(o);y.nodes.splice(Q,1,...o.nodes)}while(s.length>0);return m({type:"eos"}),n};Nq.exports=g0e});var jq=w((Trt,Kq)=>{"use strict";var Hq=By(),f0e=kq(),h0e=Fq(),p0e=Uq(),es=(r,e={})=>{let t=[];if(Array.isArray(r))for(let i of r){let n=es.create(i,e);Array.isArray(n)?t.push(...n):t.push(n)}else t=[].concat(es.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};es.parse=(r,e={})=>p0e(r,e);es.stringify=(r,e={})=>typeof r=="string"?Hq(es.parse(r,e),e):Hq(r,e);es.compile=(r,e={})=>(typeof r=="string"&&(r=es.parse(r,e)),f0e(r,e));es.expand=(r,e={})=>{typeof r=="string"&&(r=es.parse(r,e));let t=h0e(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};es.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?es.compile(r,e):es.expand(r,e);Kq.exports=es});var Vp=w((Ort,Gq)=>{"use strict";var d0e=require("path"),Yo="\\\\/",Yq=`[^${Yo}]`,qa="\\.",C0e="\\+",m0e="\\?",Qy="\\/",E0e="(?=.)",qq="[^/]",BS=`(?:${Qy}|$)`,J
Please report this to https://github.com/szmarczak/http2-wrapper/`);p(m)}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=Wke.connect(e,L({createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(u)},t));f[gn]=0,f[zg]=!1;let h=()=>f[gn]<f.remoteSettings.maxConcurrentStreams,p=!0;f.socket.once("session",y=>{this.tlsSessionCache.set(u,y)}),f.once("error",y=>{for(let{reject:Q}of i)Q(y);this.tlsSessionCache.delete(u)}),f.setTimeout(this.timeout,()=>{f.destroy()}),f.once("close",()=>{if(g){p&&this._freeSessionsCount--,this._sessionsCount--;let y=this.sessions[o];y.splice(y.indexOf(f),1),y.length===0&&delete this.sessions[o]}else{let y=new Error("Session closed without receiving a SETTINGS frame");y.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:Q}of i)Q(y);l()}this._tryToCreateNewSession(o,a)});let m=()=>{if(!(!(o in this.queue)||!h())){for(let y of f[Ns])if(y in this.queue[o]){let{listeners:Q}=this.queue[o][y];for(;Q.length!==0&&h();)Q.shift().resolve(f);let S=this.queue[o];if(S[y].listeners.length===0&&(delete S[y],Object.keys(S).length===0)){delete this.queue[o];break}if(!h())break}}};f.on("origin",()=>{f[Ns]=f.originSet,!!h()&&(m(),Zk(this.sessions[o],f))}),f.once("remoteSettings",()=>{if(f.ref(),f.unref(),this._sessionsCount++,c.destroyed){let y=new Error("Agent has been destroyed");for(let Q of i)Q.reject(y);f.destroy();return}f[Ns]=f.originSet;{let y=this.sessions;if(o in y){let Q=y[o];Q.splice(Vke(Q,f,Xke),0,f)}else y[o]=[f]}this._freeSessionsCount+=1,g=!0,this.emit("session",f),m(),l(),f[gn]===0&&this._freeSessionsCount>this.maxFreeSessions&&f.close(),i.length!==0&&(this.getSession(a,t,i),i.length=0),f.on("remoteSettings",()=>{m(),Zk(this.sessions[o],f)})}),f[g4]=f.request,f.request=(y,Q)=>{if(f[zg])throw new Error("The session is gracefully closing. No new streams are allowed.");let S=f[g4](y,Q);return f.ref(),++f[gn],f[gn]===f.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,S.once("close",()=>{if(p=h(),--f[gn],!f.destroyed&&!f.closed&&(Zke(this.sessions[o],f),h()&&!f.closed)){p||(this._freeSessionsCount++,p=!0);let x=f[gn]===0;x&&f.unref(),x&&(this._freeSessionsCount>this.maxFreeSessions||f[zg])?f.close():(Zk(this.sessions[o],f),m())}}),S}}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,t,i,n){return new Promise((s,o)=>{this.getSession(e,t,[{reject:o,resolve:a=>{try{s(a.request(i,n))}catch(l){o(l)}}}])})}createConnection(e,t){return tA.connect(e,t)}static connect(e,t){t.ALPNProtocols=["h2"];let i=e.port||443,n=e.hostname||e.host;return typeof t.servername=="undefined"&&(t.servername=n),Jke.connect(i,n,t)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let t of e)t[gn]===0&&t.close()}destroy(e){for(let t of Object.values(this.sessions))for(let i of t)i.destroy(e);for(let t of Object.values(this.queue))for(let i of Object.values(t))i.destroyed=!0;this.queue={}}get freeSessions(){return h4({agent:this,isFree:!0})}get busySessions(){return h4({agent:this,isFree:!1})}};tA.kCurrentStreamsCount=gn;tA.kGracefullyClosing=zg;u4.exports={Agent:tA,globalAgent:new tA}});var eP=w((Pot,p4)=>{"use strict";var{Readable:$ke}=require("stream"),d4=class extends $ke{constructor(e,t){super({highWaterMark:t,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,t){return this.req.setTimeout(e,t),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners
`).reverse(),a=t.stack.slice(t.stack.indexOf(t.message)+t.message.length).split(`
`).reverse();for(;a.length!==0&&a[0]===o[0];)o.shift();this.stack=`${this.stack.slice(0,s)}${o.reverse().join(`
`)}${a.reverse().join(`
`)}`}}};qt.RequestError=gi;var kP=class extends gi{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e);this.name="MaxRedirectsError"}};qt.MaxRedirectsError=kP;var PP=class extends gi{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request);this.name="HTTPError"}};qt.HTTPError=PP;var DP=class extends gi{constructor(e,t){super(e.message,e,t);this.name="CacheError"}};qt.CacheError=DP;var FP=class extends gi{constructor(e,t){super(e.message,e,t);this.name="UploadError"}};qt.UploadError=FP;var RP=class extends gi{constructor(e,t,i){super(e.message,e,i);this.name="TimeoutError",this.event=e.event,this.timings=t}};qt.TimeoutError=RP;var Rw=class extends gi{constructor(e,t){super(e.message,e,t);this.name="ReadError"}};qt.ReadError=Rw;var LP=class extends gi{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e);this.name="UnsupportedProtocolError"}};qt.UnsupportedProtocolError=LP;var oDe=["socket","connect","continue","information","upgrade","timeout"],xP=class extends a_.Duplex{constructor(e,t={},i){super({autoDestroy:!1,highWaterMark:0});this[Xg]=0,this[$g]=0,this.requestInitialized=!1,this[Dw]=new Set,this.redirects=[],this[ef]=!1,this[Fw]=!1,this[kd]=[],this.retryCount=0,this._progressCallbacks=[];let n=()=>this._unlockWrite(),s=()=>this._lockWrite();this.on("pipe",c=>{c.prependListener("data",n),c.on("data",s),c.prependListener("end",n),c.on("end",s)}),this.on("unpipe",c=>{c.off("data",n),c.off("data",s),c.off("end",n),c.off("end",s)}),this.on("pipe",c=>{c instanceof bP.IncomingMessage&&(this.options.headers=L(L({},c.headers),this.options.headers))});let{json:o,body:a,form:l}=t;if((o||a||l)&&this._lockWrite(),qt.kIsNormalizedAlready in t)this.options=t;else try{this.options=this.constructor.normalizeArguments(e,t,i)}catch(c){me.default.nodeStream(t.body)&&t.body.destroy(),this.destroy(c);return}(async()=>{var c;try{this.options.body instanceof UPe.ReadStream&&await iDe(this.options.body);let{url:u}=this.options;if(!u)throw new TypeError("Missing `url` property");if(this.requestUrl=u.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(c=this[Di])===null||c===void 0||c.destroy();return}for(let g of this[kd])g();this[kd].length=0,this.requestInitialized=!0}catch(u){if(u instanceof gi){this._beforeError(u);return}this.destroyed||this.destroy(u)}})()}static normalizeArguments(e,t,i){var n,s,o,a,l;let c=t;if(me.default.object(e)&&!me.default.urlInstance(e))t=L(L(L({},i),e),t);else{if(e&&t&&t.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");t=L(L({},i),t),e!==void 0&&(t.url=e),me.default.urlInstance(t.url)&&(t.url=new Al.URL(t.url.toString()))}if(t.cache===!1&&(t.cache=void 0),t.dnsCache===!1&&(t.dnsCache=void 0),me.assert.any([me.default.string,me.default.undefined],t.method),me.assert.any([me.default.object,me.default.undefined],t.headers),me.assert.any([me.default.string,me.default.urlInstance,me.default.undefined],t.prefixUrl),me.assert.any([me.default.object,me.default.undefined],t.cookieJar),me.assert.any([me.default.object,me.default.string,me.default.undefined],t.searchParams),me.assert.any([me.default.object,me.default.string,me.default.undefined],t.cache),me.assert.any([me.default.object,me.default.number,me.default.undefined],t.timeout),me.assert.any([me.default.object,me.default.undefined],t.context),me.assert.any([me.default.object,me.default.undefined],t.hooks),me.assert.any([me.default.boolean,me.default.undefined],t.decompress),me.assert.any([me.default.boolean,me.default.undefined],t.ignoreInvalidCookies),me.assert.any([me.default.boolean,me.default.undefined],t.followRedirect),me.assert.any([me.default.number,me.default.undefined],t.maxRedirects),me.assert.any([me.default.boolean,me.default.undefined],t.throwHttpErrors),me.assert.any([me.default.boolean,me.default.undefined],t.http2),me.assert.any([me.default.boolean,me.default.undefined],t.allowGetBody),me.assert.any([me.default.string,me.default.undefined],t.localAddress),me.ass
`,g.message,g.stack);var f=new Error("tunneling socket could not be established, cause="+g.message);f.code="ECONNRESET",e.request.emit("error",f),i.removeSocket(n)}};iA.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(t!==-1){this.sockets.splice(t,1);var i=this.requests.shift();i&&this.createSocket(i,function(n){i.request.onSocket(n)})}};function H_(r,e){var t=this;iA.prototype.createSocket.call(t,r,function(i){var n=r.request.getHeader("host"),s=jP({},t.options,{socket:i,servername:n?n.replace(/:.*$/,""):r.host}),o=FDe.connect(0,s);t.sockets[t.sockets.indexOf(i)]=o,e(o)})}function j_(r,e,t){return typeof r=="string"?{host:r,port:e,localAddress:t}:r}function jP(r){for(var e=1,t=arguments.length;e<t;++e){var i=arguments[e];if(typeof i=="object")for(var n=Object.keys(i),s=0,o=n.length;s<o;++s){var a=n[s];i[a]!==void 0&&(r[a]=i[a])}}return r}var gl;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?gl=function(){var r=Array.prototype.slice.call(arguments);typeof r[0]=="string"?r[0]="TUNNEL: "+r[0]:r.unshift("TUNNEL:"),console.error.apply(console,r)}:gl=function(){};tf.debug=gl});var q_=w((gat,Y_)=>{Y_.exports=G_()});var t5=w((Hw,WP)=>{var e5=Object.assign({},require("fs")),zP=function(){var r=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(r=r||__filename),function(e){e=e||{};var t=typeof e!="undefined"?e:{},i,n;t.ready=new Promise(function(d,E){i=d,n=E});var s={},o;for(o in t)t.hasOwnProperty(o)&&(s[o]=t[o]);var a=[],l="./this.program",c=function(d,E){throw E},u=!1,g=!0,f="";function h(d){return t.locateFile?t.locateFile(d,f):f+d}var p,m,y,Q;g&&(u?f=require("path").dirname(f)+"/":f=__dirname+"/",p=function(E,I){var D=Qa(E);return D?I?D:D.toString():(y||(y=e5),Q||(Q=require("path")),E=Q.normalize(E),y.readFileSync(E,I?null:"utf8"))},m=function(E){var I=p(E,!0);return I.buffer||(I=new Uint8Array(I)),ee(I.buffer),I},process.argv.length>1&&(l=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),c=function(d){process.exit(d)},t.inspect=function(){return"[Emscripten Module object]"});var S=t.print||console.log.bind(console),x=t.printErr||console.warn.bind(console);for(o in s)s.hasOwnProperty(o)&&(t[o]=s[o]);s=null,t.arguments&&(a=t.arguments),t.thisProgram&&(l=t.thisProgram),t.quit&&(c=t.quit);var M=16;function q(d,E){return E||(E=M),Math.ceil(d/E)*E}var U=0,W=function(d){U=d},J;t.wasmBinary&&(J=t.wasmBinary);var oe=t.noExitRuntime||!0;typeof WebAssembly!="object"&&Sr("no native wasm support detected");function Z(d,E,I){switch(E=E||"i8",E.charAt(E.length-1)==="*"&&(E="i32"),E){case"i1":return pe[d>>0];case"i8":return pe[d>>0];case"i16":return ke[d>>1];case"i32":return fe[d>>2];case"i64":return fe[d>>2];case"float":return Ht[d>>2];case"double":return Mt[d>>3];default:Sr("invalid type for getValue: "+E)}return null}var A,ne=!1,Ae;function ee(d,E){d||Sr("Assertion failed: "+E)}function O(d){var E=t["_"+d];return ee(E,"Cannot call unknown function "+d+", make sure it is exported"),E}function N(d,E,I,D,T){var V={string:function(nt){var It=0;if(nt!=null&&nt!==0){var ve=(nt.length<<2)+1;It=B(ve),Be(nt,It,ve)}return It},array:function(nt){var It=B(nt.length);return Oe(nt,It),It}};function re(nt){return E==="string"?te(nt):E==="boolean"?Boolean(nt):nt}var we=O(d),Ce=[],_e=0;if(D)for(var ot=0;ot<D.length;ot++){var wt=V[I[ot]];wt?(_e===0&&(_e=kE()),Ce[ot]=wt(D[ot])):Ce[ot]=D[ot]}var ut=we.apply(null,Ce);return ut=re(ut),_e!==0&&PE(_e),ut}function be(d,E,I,D){I=I||[];var T=I.every(function(re){return re==="number"}),V=E!=="string";return V&&T&&!D?O(d):function(){return N(d,E,I,arguments,D)}}var Ie=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function Ye(d,E,I){for(var D=E+I,T=E;d[T]&&!(T>=D);)++T;if(T-E>16&&d.subarray&&Ie)return Ie.decode(d.subarray(E,T));for(var V="";E<T;){var re=d[E++];if(!(re&128)){V+=String.fromCharCode(re);continue}var we=d[E++]&63;if((re&224)==192){V+=String.fromCharCode((re&31)<<6|we);continue}var Ce=d[E++]&63;if((re&240)==224?re=(re&15)<<12|we<<6|Ce:re=(re&7)<<18|we<<12|Ce<<6|d[E
`)):typeof readline=="function"&&(E=readline(),E!==null&&(E+=`
`));if(!E)return null;d.input=RA(E,!0)}return d.input.shift()},put_char:function(d,E){E===null||E===10?(S(Ye(d.output,0)),d.output=[]):E!=0&&d.output.push(E)},flush:function(d){d.output&&d.output.length>0&&(S(Ye(d.output,0)),d.output=[])}},default_tty1_ops:{put_char:function(d,E){E===null||E===10?(x(Ye(d.output,0)),d.output=[]):E!=0&&d.output.push(E)},flush:function(d){d.output&&d.output.length>0&&(x(Ye(d.output,0)),d.output=[])}}};function ps(d){for(var E=q(d,65536),I=Et(E);d<E;)pe[I+d++]=0;return I}var ht={ops_table:null,mount:function(d){return ht.createNode(null,"/",16384|511,0)},createNode:function(d,E,I,D){if(v.isBlkdev(I)||v.isFIFO(I))throw new v.ErrnoError(63);ht.ops_table||(ht.ops_table={dir:{node:{getattr:ht.node_ops.getattr,setattr:ht.node_ops.setattr,lookup:ht.node_ops.lookup,mknod:ht.node_ops.mknod,rename:ht.node_ops.rename,unlink:ht.node_ops.unlink,rmdir:ht.node_ops.rmdir,readdir:ht.node_ops.readdir,symlink:ht.node_ops.symlink},stream:{llseek:ht.stream_ops.llseek}},file:{node:{getattr:ht.node_ops.getattr,setattr:ht.node_ops.setattr},stream:{llseek:ht.stream_ops.llseek,read:ht.stream_ops.read,write:ht.stream_ops.write,allocate:ht.stream_ops.allocate,mmap:ht.stream_ops.mmap,msync:ht.stream_ops.msync}},link:{node:{getattr:ht.node_ops.getattr,setattr:ht.node_ops.setattr,readlink:ht.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ht.node_ops.getattr,setattr:ht.node_ops.setattr},stream:v.chrdev_stream_ops}});var T=v.createNode(d,E,I,D);return v.isDir(T.mode)?(T.node_ops=ht.ops_table.dir.node,T.stream_ops=ht.ops_table.dir.stream,T.contents={}):v.isFile(T.mode)?(T.node_ops=ht.ops_table.file.node,T.stream_ops=ht.ops_table.file.stream,T.usedBytes=0,T.contents=null):v.isLink(T.mode)?(T.node_ops=ht.ops_table.link.node,T.stream_ops=ht.ops_table.link.stream):v.isChrdev(T.mode)&&(T.node_ops=ht.ops_table.chrdev.node,T.stream_ops=ht.ops_table.chrdev.stream),T.timestamp=Date.now(),d&&(d.contents[E]=T,d.timestamp=T.timestamp),T},getFileDataAsTypedArray:function(d){return d.contents?d.contents.subarray?d.contents.subarray(0,d.usedBytes):new Uint8Array(d.contents):new Uint8Array(0)},expandFileStorage:function(d,E){var I=d.contents?d.contents.length:0;if(!(I>=E)){var D=1024*1024;E=Math.max(E,I*(I<D?2:1.125)>>>0),I!=0&&(E=Math.max(E,256));var T=d.contents;d.contents=new Uint8Array(E),d.usedBytes>0&&d.contents.set(T.subarray(0,d.usedBytes),0)}},resizeFileStorage:function(d,E){if(d.usedBytes!=E)if(E==0)d.contents=null,d.usedBytes=0;else{var I=d.contents;d.contents=new Uint8Array(E),I&&d.contents.set(I.subarray(0,Math.min(E,d.usedBytes))),d.usedBytes=E}},node_ops:{getattr:function(d){var E={};return E.dev=v.isChrdev(d.mode)?d.id:1,E.ino=d.id,E.mode=d.mode,E.nlink=1,E.uid=0,E.gid=0,E.rdev=d.rdev,v.isDir(d.mode)?E.size=4096:v.isFile(d.mode)?E.size=d.usedBytes:v.isLink(d.mode)?E.size=d.link.length:E.size=0,E.atime=new Date(d.timestamp),E.mtime=new Date(d.timestamp),E.ctime=new Date(d.timestamp),E.blksize=4096,E.blocks=Math.ceil(E.size/E.blksize),E},setattr:function(d,E){E.mode!==void 0&&(d.mode=E.mode),E.timestamp!==void 0&&(d.timestamp=E.timestamp),E.size!==void 0&&ht.resizeFileStorage(d,E.size)},lookup:function(d,E){throw v.genericErrors[44]},mknod:function(d,E,I,D){return ht.createNode(d,E,I,D)},rename:function(d,E,I){if(v.isDir(d.mode)){var D;try{D=v.lookupNode(E,I)}catch(V){}if(D)for(var T in D.contents)throw new v.ErrnoError(55)}delete d.parent.contents[d.name],d.parent.timestamp=Date.now(),d.name=I,E.contents[I]=d,E.timestamp=d.parent.timestamp,d.parent=E},unlink:function(d,E){delete d.contents[E],d.timestamp=Date.now()},rmdir:function(d,E){var I=v.lookupNode(d,E);for(var D in I.contents)throw new v.ErrnoError(55);delete d.contents[E],d.timestamp=Date.now()},readdir:function(d){var E=[".",".."];for(var I in d.contents)!d.contents.hasOwnProperty(I)||E.push(I);return E},symlink:function(d,E,I){var D=ht.createNode(d,E,511|40960,0);return D.link=I,D},readlink:function(d){if(!v.isLink(d.mode))throw new v.ErrnoError(28);return d.link}},stream_ops:{read:function(d,E,I,D,T){var V=d.node.contents;if(T>=d.node.usedBytes)return 0;var
`,n=Buffer.byteLength(i),s=Math.floor(Math.log(n)/Math.log(10))+1;return n+s>=Math.pow(10,s)&&(s+=1),s+n+i}};lB.parse=(r,e,t)=>new lB(NRe(TRe(r),e),t);var NRe=(r,e)=>e?Object.keys(r).reduce((t,i)=>(t[i]=r[i],t),e):r,TRe=r=>r.replace(/\n$/,"").split(`
`).reduce(ORe,Object.create(null)),ORe=(r,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return r;e=e.substr((t+" ").length);let i=e.split("="),n=i.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!n)return r;let s=i.join("=");return r[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(s*1e3):/^[0-9]+$/.test(s)?+s:s,r};V6.exports=lB});var uB=w((ZAt,X6)=>{"use strict";X6.exports=r=>class extends r{warn(e,t,i={}){this.file&&(i.file=this.file),this.cwd&&(i.cwd=this.cwd),i.code=t instanceof Error&&t.code||e,i.tarCode=e,!this.strict&&i.recoverable!==!1?(t instanceof Error&&(i=Object.assign(t,i),t=t.message),this.emit("warn",i.tarCode,t,i)):t instanceof Error?this.emit("error",Object.assign(t,i)):this.emit("error",Object.assign(new Error(`${e}: ${t}`),i))}}});var vD=w(($At,Z6)=>{"use strict";var gB=["|","<",">","?",":"],QD=gB.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),MRe=new Map(gB.map((r,e)=>[r,QD[e]])),URe=new Map(QD.map((r,e)=>[r,gB[e]]));Z6.exports={encode:r=>gB.reduce((e,t)=>e.split(t).join(MRe.get(t)),r),decode:r=>QD.reduce((e,t)=>e.split(t).join(URe.get(t)),r)}});var eV=w((elt,$6)=>{"use strict";$6.exports=(r,e,t)=>(r&=4095,t&&(r=(r|384)&~18),e&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)});var RD=w((slt,tV)=>{"use strict";var rV=sf(),iV=cB(),nV=Af(),tlt=Wd(),ra=require("fs"),lf=require("path"),rlt=Jd(),KRe=16*1024*1024,sV=Symbol("process"),oV=Symbol("file"),aV=Symbol("directory"),SD=Symbol("symlink"),AV=Symbol("hardlink"),zd=Symbol("header"),fB=Symbol("read"),xD=Symbol("lstat"),hB=Symbol("onlstat"),kD=Symbol("onread"),PD=Symbol("onreadlink"),DD=Symbol("openfile"),FD=Symbol("onopenfile"),Zc=Symbol("close"),pB=Symbol("mode"),lV=uB(),HRe=vD(),cV=eV(),dB=lV(class extends rV{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=e,this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid(),this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||KRe,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=t.cwd||process.cwd(),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let i=!1;if(!this.preservePaths&&lf.win32.isAbsolute(e)){let n=lf.win32.parse(e);this.path=e.substr(n.root.length),i=n.root}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=HRe.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=t.absolute||lf.resolve(this.cwd,e),this.path===""&&(this.path="./"),i&&this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path}),this.statCache.has(this.absolute)?this[hB](this.statCache.get(this.absolute)):this[xD]()}[xD](){ra.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[hB](t)})}[hB](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=jRe(e),this.emit("stat",e),this[sV]()}[sV](){switch(this.type){case"File":return this[oV]();case"Directory":return this[aV]();case"SymbolicLink":return this[SD]();default:return this.end()}}[pB](e){return cV(e,this.type==="Directory",this.portable)}[zd](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new nV({path:this.path,linkpath:this.linkpath,mode:this[pB](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&this.write(new iV({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this.path,linkpath:this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.d
`}),a},i})});var fA=w(PF=>{"use strict";Object.defineProperty(PF,"__esModule",{value:!0});PF.default=F7;function F7(){}F7.prototype={diff:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=i.callback;typeof i=="function"&&(n=i,i={}),this.options=i;var s=this;function o(m){return n?(setTimeout(function(){n(void 0,m)},0),!0):m}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var a=t.length,l=e.length,c=1,u=a+l,g=[{newPos:-1,components:[]}],f=this.extractCommon(g[0],t,e,0);if(g[0].newPos+1>=a&&f+1>=l)return o([{value:this.join(t),count:t.length}]);function h(){for(var m=-1*c;m<=c;m+=2){var y=void 0,Q=g[m-1],S=g[m+1],x=(S?S.newPos:0)-m;Q&&(g[m-1]=void 0);var M=Q&&Q.newPos+1<a,q=S&&0<=x&&x<l;if(!M&&!q){g[m]=void 0;continue}if(!M||q&&Q.newPos<S.newPos?(y=NNe(S),s.pushComponent(y.components,void 0,!0)):(y=Q,y.newPos++,s.pushComponent(y.components,!0,void 0)),x=s.extractCommon(y,t,e,m),y.newPos+1>=a&&x+1>=l)return o(LNe(s,y.components,t,e,s.useLongestToken));g[m]=y}c++}if(n)(function m(){setTimeout(function(){if(c>u)return n();h()||m()},0)})();else for(;c<=u;){var p=h();if(p)return p}},pushComponent:function(e,t,i){var n=e[e.length-1];n&&n.added===t&&n.removed===i?e[e.length-1]={count:n.count+1,added:t,removed:i}:e.push({count:1,added:t,removed:i})},extractCommon:function(e,t,i,n){for(var s=t.length,o=i.length,a=e.newPos,l=a-n,c=0;a+1<s&&l+1<o&&this.equals(t[a+1],i[l+1]);)a++,l++,c++;return c&&e.components.push({count:c}),e.newPos=a,l},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],i=0;i<e.length;i++)e[i]&&t.push(e[i]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};function LNe(r,e,t,i,n){for(var s=0,o=e.length,a=0,l=0;s<o;s++){var c=e[s];if(c.removed){if(c.value=r.join(i.slice(l,l+c.count)),l+=c.count,s&&e[s-1].added){var g=e[s-1];e[s-1]=e[s],e[s]=g}}else{if(!c.added&&n){var u=t.slice(a,a+c.count);u=u.map(function(h,p){var m=i[l+p];return m.length>h.length?m:h}),c.value=r.join(u)}else c.value=r.join(t.slice(a,a+c.count));a+=c.count,c.added||(l+=c.count)}}var f=e[o-1];return o>1&&typeof f.value=="string"&&(f.added||f.removed)&&r.equals("",f.value)&&(e[o-2].value+=f.value,e.pop()),e}function NNe(r){return{newPos:r.newPos,components:r.components.slice(0)}}});var L7=w(sC=>{"use strict";Object.defineProperty(sC,"__esModule",{value:!0});sC.diffChars=TNe;sC.characterDiff=void 0;var MNe=ONe(fA());function ONe(r){return r&&r.__esModule?r:{default:r}}var R7=new MNe.default;sC.characterDiff=R7;function TNe(r,e,t){return R7.diff(r,e,t)}});var FF=w(DF=>{"use strict";Object.defineProperty(DF,"__esModule",{value:!0});DF.generateOptions=UNe;function UNe(r,e){if(typeof r=="function")e.callback=r;else if(r)for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t]);return e}});var O7=w(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});Bf.diffWords=KNe;Bf.diffWordsWithSpace=HNe;Bf.wordDiff=void 0;var GNe=jNe(fA()),YNe=FF();function jNe(r){return r&&r.__esModule?r:{default:r}}var N7=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,T7=/\S/,oC=new GNe.default;Bf.wordDiff=oC;oC.equals=function(r,e){return this.options.ignoreCase&&(r=r.toLowerCase(),e=e.toLowerCase()),r===e||this.options.ignoreWhitespace&&!T7.test(r)&&!T7.test(e)};oC.tokenize=function(r){for(var e=r.split(/(\s+|[()[\]{}'"]|\b)/),t=0;t<e.length-1;t++)!e[t+1]&&e[t+2]&&N7.test(e[t])&&N7.test(e[t+2])&&(e[t]+=e[t+2],e.splice(t+1,2),t--);return e};function KNe(r,e,t){return t=(0,YNe.generateOptions)(t,{ignoreWhitespace:!0}),oC.diff(r,e,t)}function HNe(r,e,t){return oC.diff(r,e,t)}});var VB=w(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.diffLines=qNe;bf.diffTrimmedLines=JNe;bf.lineDiff=void 0;var zNe=WNe(fA()),_Ne=FF();function WNe(r){return r&&r.__esModule?r:{default:r}}var _B=new zNe.default;bf.lineDiff=_B;_B.tokenize=function(r){var e=[],t=r.
`),m==="+"?h++:m==="-"?p++:m===" "&&(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<t.length;)o();return n}});var G7=w(TF=>{"use strict";Object.defineProperty(TF,"__esModule",{value:!0});TF.default=cTe;function cTe(r,e,t){var i=!0,n=!1,s=!1,o=1;return function a(){if(i&&!s){if(n?o++:i=!1,r+o<=t)return o;s=!0}if(!n)return s||(i=!0),e<=r-o?-o++:(n=!0,a())}}});var J7=w(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});e0.applyPatch=Y7;e0.applyPatches=uTe;var q7=$B(),fTe=gTe(G7());function gTe(r){return r&&r.__esModule?r:{default:r}}function Y7(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string"&&(e=(0,q7.parsePatch)(e)),Array.isArray(e)){if(e.length>1)throw new Error("applyPatch only works with a single input.");e=e[0]}var i=r.split(/\r\n|[\n\v\f\r\x85]/),n=r.match(/\r\n|[\n\v\f\r\x85]/g)||[],s=e.hunks,o=t.compareLine||function(O,N,be,Ie){return N===Ie},a=0,l=t.fuzzFactor||0,c=0,u=0,g,f;function h(O,N){for(var be=0;be<O.lines.length;be++){var Ie=O.lines[be],Ye=Ie.length>0?Ie[0]:" ",te=Ie.length>0?Ie.substr(1):Ie;if(Ye===" "||Ye==="-"){if(!o(N+1,i[N],Ye,te)&&(a++,a>l))return!1;N++}}return!0}for(var p=0;p<s.length;p++){for(var m=s[p],y=i.length-m.oldLines,Q=0,S=u+m.oldStart-1,x=(0,fTe.default)(S,c,y);Q!==void 0;Q=x())if(h(m,S+Q)){m.offset=u+=Q;break}if(Q===void 0)return!1;c=m.offset+m.oldStart+m.oldLines}for(var M=0,q=0;q<s.length;q++){var U=s[q],W=U.oldStart+U.offset+M-1;M+=U.newLines-U.oldLines,W<0&&(W=0);for(var J=0;J<U.lines.length;J++){var oe=U.lines[J],Z=oe.length>0?oe[0]:" ",A=oe.length>0?oe.substr(1):oe,ne=U.linedelimiters[J];if(Z===" ")W++;else if(Z==="-")i.splice(W,1),n.splice(W,1);else if(Z==="+")i.splice(W,0,A),n.splice(W,0,ne),W++;else if(Z==="\\"){var Ae=U.lines[J-1]?U.lines[J-1][0]:null;Ae==="+"?g=!0:Ae==="-"&&(f=!0)}}}if(g)for(;!i[i.length-1];)i.pop(),n.pop();else f&&(i.push(""),n.push(`
`));for(var ee=0;ee<i.length-1;ee++)i[ee]=i[ee]+n[ee];return i.join("")}function uTe(r,e){typeof r=="string"&&(r=(0,q7.parsePatch)(r));var t=0;function i(){var n=r[t++];if(!n)return e.complete();e.loadFile(n,function(s,o){if(s)return e.complete(s);var a=Y7(o,n,e);e.patched(n,a,function(l){if(l)return e.complete(l);i()})})}i()}});var MF=w(uC=>{"use strict";Object.defineProperty(uC,"__esModule",{value:!0});uC.structuredPatch=W7;uC.createTwoFilesPatch=z7;uC.createPatch=hTe;var pTe=VB();function OF(r){return mTe(r)||CTe(r)||dTe()}function dTe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function CTe(r){if(Symbol.iterator in Object(r)||Object.prototype.toString.call(r)==="[object Arguments]")return Array.from(r)}function mTe(r){if(Array.isArray(r)){for(var e=0,t=new Array(r.length);e<r.length;e++)t[e]=r[e];return t}}function W7(r,e,t,i,n,s,o){o||(o={}),typeof o.context=="undefined"&&(o.context=4);var a=(0,pTe.diffLines)(t,i,o);a.push({value:"",lines:[]});function l(Q){return Q.map(function(S){return" "+S})}for(var c=[],u=0,g=0,f=[],h=1,p=1,m=function(S){var x=a[S],M=x.lines||x.value.replace(/\n$/,"").split(`
`);if(x.lines=M,x.added||x.removed){var q;if(!u){var U=a[S-1];u=h,g=p,U&&(f=o.context>0?l(U.lines.slice(-o.context)):[],u-=f.length,g-=f.length)}(q=f).push.apply(q,OF(M.map(function(ee){return(x.added?"+":"-")+ee}))),x.added?p+=M.length:h+=M.length}else{if(u)if(M.length<=o.context*2&&S<a.length-2){var W;(W=f).push.apply(W,OF(l(M)))}else{var J,oe=Math.min(M.length,o.context);(J=f).push.apply(J,OF(l(M.slice(0,oe))));var Z={oldStart:u,oldLines:h-u+oe,newStart:g,newLines:p-g+oe,lines:f};if(S>=a.length-2&&M.length<=o.context){var A=/\n$/.test(t),ne=/\n$/.test(i),Ae=M.length==0&&f.length>Z.oldLines;!A&&Ae&&f.splice(Z.oldLines,0,"\\ No newline at end of file"),(!A&&!Ae||!ne)&&f.push("\\ No newline at end of file")}c.push(Z),u=0,g=0,f=[]}h+=M.length,p+=M.length}},y=0;y<a.length;y++)m(y);return{oldFileName:r,newFileName:e,oldHeader:n,newHeader:s,hunks:c}}function z7(r,e,t,i,n,s,o){var a=W7(r,e,t,i,n,s,o),l=[];r==e&&l.push("Index: "+r),l.push("==================================================================="),l.push("--- "+a.oldFileName+(typeof a.oldHeader=="undefined"?"":" "+a.oldHeader)),l.push("+++ "+a.newFileName+(typeof a.newHeader=="undefined"?"":" "+a.newHeader));for(var c=0;c<a.hunks.length;c++){var u=a.hunks[c];l.push("@@ -"+u.oldStart+","+u.oldLines+" +"+u.newStart+","+u.newLines+" @@"),l.push.apply(l,u.lines)}return l.join(`
`)+`
`}function hTe(r,e,t,i,n,s){return z7(r,r,e,t,i,n,s)}});var V7=w(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});t0.arrayEqual=ETe;t0.arrayStartsWith=_7;function ETe(r,e){return r.length!==e.length?!1:_7(r,e)}function _7(r,e){if(e.length>r.length)return!1;for(var t=0;t<e.length;t++)if(e[t]!==r[t])return!1;return!0}});var aX=w(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});r0.calcLineCount=X7;r0.merge=ITe;var yTe=MF(),wTe=$B(),UF=V7();function vf(r){return QTe(r)||bTe(r)||BTe()}function BTe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function bTe(r){if(Symbol.iterator in Object(r)||Object.prototype.toString.call(r)==="[object Arguments]")return Array.from(r)}function QTe(r){if(Array.isArray(r)){for(var e=0,t=new Array(r.length);e<r.length;e++)t[e]=r[e];return t}}function X7(r){var e=KF(r.lines),t=e.oldLines,i=e.newLines;t!==void 0?r.oldLines=t:delete r.oldLines,i!==void 0?r.newLines=i:delete r.newLines}function ITe(r,e,t){r=Z7(r,t),e=Z7(e,t);var i={};(r.index||e.index)&&(i.index=r.index||e.index),(r.newFileName||e.newFileName)&&($7(r)?$7(e)?(i.oldFileName=i0(i,r.oldFileName,e.oldFileName),i.newFileName=i0(i,r.newFileName,e.newFileName),i.oldHeader=i0(i,r.oldHeader,e.oldHeader),i.newHeader=i0(i,r.newHeader,e.newHeader)):(i.oldFileName=r.oldFileName,i.newFileName=r.newFileName,i.oldHeader=r.oldHeader,i.newHeader=r.newHeader):(i.oldFileName=e.oldFileName||r.oldFileName,i.newFileName=e.newFileName||r.newFileName,i.oldHeader=e.oldHeader||r.oldHeader,i.newHeader=e.newHeader||r.newHeader)),i.hunks=[];for(var n=0,s=0,o=0,a=0;n<r.hunks.length||s<e.hunks.length;){var l=r.hunks[n]||{oldStart:Infinity},c=e.hunks[s]||{oldStart:Infinity};if(eX(l,c))i.hunks.push(tX(l,o)),n++,a+=l.newLines-l.oldLines;else if(eX(c,l))i.hunks.push(tX(c,a)),s++,o+=c.newLines-c.oldLines;else{var u={oldStart:Math.min(l.oldStart,c.oldStart),oldLines:0,newStart:Math.min(l.newStart+o,c.oldStart+a),newLines:0,lines:[]};vTe(u,l.oldStart,l.lines,c.oldStart,c.lines),s++,n++,i.hunks.push(u)}}return i}function Z7(r,e){if(typeof r=="string"){if(/^@@/m.test(r)||/^Index:/m.test(r))return(0,wTe.parsePatch)(r)[0];if(!e)throw new Error("Must provide a base reference or pass in a patch");return(0,yTe.structuredPatch)(void 0,void 0,e,r)}return r}function $7(r){return r.newFileName&&r.newFileName!==r.oldFileName}function i0(r,e,t){return e===t?e:(r.conflict=!0,{mine:e,theirs:t})}function eX(r,e){return r.oldStart<e.oldStart&&r.oldStart+r.oldLines<e.oldStart}function tX(r,e){return{oldStart:r.oldStart,oldLines:r.oldLines,newStart:r.newStart+e,newLines:r.newLines,lines:r.lines}}function vTe(r,e,t,i,n){var s={offset:e,lines:t,index:0},o={offset:i,lines:n,index:0};for(iX(r,s,o),iX(r,o,s);s.index<s.lines.length&&o.index<o.lines.length;){var a=s.lines[s.index],l=o.lines[o.index];if((a[0]==="-"||a[0]==="+")&&(l[0]==="-"||l[0]==="+"))STe(r,s,o);else if(a[0]==="+"&&l[0]===" "){var c;(c=r.lines).push.apply(c,vf(lu(s)))}else if(l[0]==="+"&&a[0]===" "){var u;(u=r.lines).push.apply(u,vf(lu(o)))}else a[0]==="-"&&l[0]===" "?rX(r,s,o):l[0]==="-"&&a[0]===" "?rX(r,o,s,!0):a===l?(r.lines.push(a),s.index++,o.index++):HF(r,lu(s),lu(o))}nX(r,s),nX(r,o),X7(r)}function STe(r,e,t){var i=lu(e),n=lu(t);if(sX(i)&&sX(n)){if((0,UF.arrayStartsWith)(i,n)&&oX(t,i,i.length-n.length)){var s;(s=r.lines).push.apply(s,vf(i));return}else if((0,UF.arrayStartsWith)(n,i)&&oX(e,n,n.length-i.length)){var o;(o=r.lines).push.apply(o,vf(n));return}}else if((0,UF.arrayEqual)(i,n)){var a;(a=r.lines).push.apply(a,vf(i));return}HF(r,i,n)}function rX(r,e,t,i){var n=lu(e),s=xTe(t,n);if(s.merged){var o;(o=r.lines).push.apply(o,vf(s.merged))}else HF(r,i?s:n,i?n:s)}function HF(r,e,t){r.conflict=!0,r.lines.push({conflict:!0,mine:e,theirs:t})}function iX(r,e,t){for(;e.offset<t.offset&&e.index<e.lines.length;){var i=e.lines[e.index++];r.lines.push(i),e.offset++}}function nX(r,e){for(;e.index<e.lines.length;){var t=e.lines[e.index++];r.lines.push(t)}}function lu(r){for(var e=[],t=r.lines[r.index][0];r.index<r.lines.length;){var i=r.lines[r.index];if(t==="-"&&i[0]===
attempted value: ${s}
`+(o!==s?`result of cast: ${o}`:""))}return n}_cast(e,t){let i=e===void 0?e:this.transforms.reduce((n,s)=>s.call(this,n,e,this),e);return i===void 0&&(i=this.getDefault()),i}_validate(e,t={},i){let{sync:n,path:s,from:o=[],originalValue:a=e,strict:l=this.spec.strict,abortEarly:c=this.spec.abortEarly}=t,u=e;l||(u=this._cast(u,Js({assert:!1},t)));let g={value:u,path:s,options:t,originalValue:a,schema:this,label:this.spec.label,sync:n,from:o},f=[];this._typeError&&f.push(this._typeError),this._whitelistError&&f.push(this._whitelistError),this._blacklistError&&f.push(this._blacklistError),(0,gre.default)({args:g,value:u,path:s,sync:n,tests:f,endEarly:c},h=>{if(h)return void i(h,u);(0,gre.default)({tests:this.tests,args:g,path:s,sync:n,value:u,endEarly:c},i)})}validate(e,t,i){let n=this.resolve(Js({},t,{value:e}));return typeof i=="function"?n._validate(e,t,i):new Promise((s,o)=>n._validate(e,t,(a,l)=>{a?o(a):s(l)}))}validateSync(e,t){let i=this.resolve(Js({},t,{value:e})),n;return i._validate(e,Js({},t,{sync:!0}),(s,o)=>{if(s)throw s;n=o}),n}isValid(e,t){return this.validate(e,t).then(()=>!0,i=>{if(hre.default.isError(i))return!1;throw i})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(i){if(hre.default.isError(i))return!1;throw i}}_getDefault(){let e=this.spec.default;return e==null?e:typeof e=="function"?e.call(this):(0,ure.default)(e)}getDefault(e){return this.resolve(e||{})._getDefault()}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){var t=this.clone();return t.spec.strict=e,t}_isPresent(e){return e!=null}defined(e=Kf.mixed.defined){return this.test({message:e,name:"defined",exclusive:!0,test(t){return t!==void 0}})}required(e=Kf.mixed.required){return this.clone({presence:"required"}).withMutation(t=>t.test({message:e,name:"required",exclusive:!0,test(i){return this.schema._isPresent(i)}}))}notRequired(){var e=this.clone({presence:"optional"});return e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e}nullable(e=!0){var t=this.clone({nullable:e!==!1});return t}transform(e){var t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=Kf.mixed.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),n=(0,L0.default)(t),s=t.exclusive||t.name&&i.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(i.exclusiveTests[t.name]=!!t.exclusive),i.tests=i.tests.filter(o=>!(o.OPTIONS.name===t.name&&(s||o.OPTIONS.test===n.OPTIONS.test))),i.tests.push(n),i}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let i=this.clone(),n=(0,dGe.default)(e).map(s=>new hGe.default(s));return n.forEach(s=>{s.isSibling&&i.deps.push(s.key)}),i.conditions.push(new fGe.default(n,t)),i}typeError(e){var t=this.clone();return t._typeError=(0,L0.default)({message:e,name:"typeError",test(i){return i!==void 0&&!this.schema.isType(i)?this.createError({params:{type:this.schema._type}}):!0}}),t}oneOf(e,t=Kf.mixed.oneOf){var i=this.clone();return e.forEach(n=>{i._whitelist.add(n),i._blacklist.delete(n)}),i._whitelistError=(0,L0.default)({message:t,name:"oneOf",test(n){if(n===void 0)return!0;let s=this.schema._whitelist;return s.has(n,this.resolve)?!0:this.createError({params:{values:s.toArray().join(", ")}})}}),i}notOneOf(e,t=Kf.mixed.notOneOf){var i=this.clone();return e.forEach(n=>{i._blacklist.add(n),i._whitelist.delete(n)}),i._blacklistError=(0,L0.default)({message:t,name:"notOneOf",test(n){let s=this.schema._blacklist;return s.has(n,this.resolve)?this.createError({params:{values:s.toArray().join(", ")}}):!0}}),i}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(){let e=this.clone(),{label:t,meta:i}=e.spec;return{meta:i,label:t,type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(s=>({name:s.OPTIONS.name,params
`),c=o.length;for(c>0&&o.includes("unstyle")&&(o=[...new Set(["unstyle",...o])].reverse());c-- >0;)a=t(r.styles[o[c]],a,l);return a},n=(s,o,a)=>{r.styles[s]=e({name:s,codes:o}),(r.keys[a]||(r.keys[a]=[])).push(s),Reflect.defineProperty(r,s,{configurable:!0,enumerable:!0,set(c){r.alias(s,c)},get(){let c=u=>i(u,c.stack);return Reflect.setPrototypeOf(c,r),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"),r.ansiRegex=Rqe,r.hasColor=r.hasAnsi=s=>(r.ansiRegex.lastIndex=0,typeof s=="string"&&s!==""&&r.ansiRegex.test(s)),r.alias=(s,o)=>{let a=typeof o=="string"?r[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}),r.styles[s]=a,a.stack=[s]),Reflect.defineProperty(r,s,{configurable:!0,enumerable:!0,set(l){r.alias(s,l)},get(){let l=c=>i(c,l.stack);return Reflect.setPrototypeOf(l,r),l.stack=this.stack?this.stack.concat(a.stack):a.stack,l}})},r.theme=s=>{if(!Fqe(s))throw new TypeError("Expected theme to be an object");for(let o of Object.keys(s))r.alias(o,s[o]);return r},r.alias("unstyle",s=>typeof s=="string"&&s!==""?(r.ansiRegex.lastIndex=0,s.replace(r.ansiRegex,"")):""),r.alias("noop",s=>s),r.none=r.clear=r.noop,r.stripColor=r.unstyle,r.symbols=Wie(),r.define=n,r};AL.exports=zie();AL.exports.create=zie});var Xi=w(Nt=>{"use strict";var Lqe=Object.prototype.toString,Ws=Eo(),_ie=!1,lL=[],Vie={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};Nt.longest=(r,e)=>r.reduce((t,i)=>Math.max(t,e?i[e].length:i.length),0);Nt.hasColor=r=>!!r&&Ws.hasColor(r);var q0=Nt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Nt.nativeType=r=>Lqe.call(r).slice(8,-1).toLowerCase().replace(/\s/g,"");Nt.isAsyncFn=r=>Nt.nativeType(r)==="asyncfunction";Nt.isPrimitive=r=>r!=null&&typeof r!="object"&&typeof r!="function";Nt.resolve=(r,e,...t)=>typeof e=="function"?e.call(r,...t):e;Nt.scrollDown=(r=[])=>[...r.slice(1),r[0]];Nt.scrollUp=(r=[])=>[r.pop(),...r];Nt.reorder=(r=[])=>{let e=r.slice();return e.sort((t,i)=>t.index>i.index?1:t.index<i.index?-1:0),e};Nt.swap=(r,e,t)=>{let i=r.length,n=t===i?0:t<0?i-1:t,s=r[e];r[e]=r[n],r[n]=s};Nt.width=(r,e=80)=>{let t=r&&r.columns?r.columns:e;return r&&typeof r.getWindowSize=="function"&&(t=r.getWindowSize()[0]),process.platform==="win32"?t-1:t};Nt.height=(r,e=20)=>{let t=r&&r.rows?r.rows:e;return r&&typeof r.getWindowSize=="function"&&(t=r.getWindowSize()[1]),t};Nt.wordWrap=(r,e={})=>{if(!r)return r;typeof e=="number"&&(e={width:e});let{indent:t="",newline:i=`
`+t,width:n=80}=e;n-=((i+t).match(/[^\S\n]/g)||[]).length;let o=`.{1,${n}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,a=r.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," "))),t+c.join(i)};Nt.unmute=r=>{let e=r.stack.find(i=>Ws.keys.color.includes(i));return e?Ws[e]:r.stack.find(i=>i.slice(2)==="bg")?Ws[e.slice(2)]:i=>i};Nt.pascal=r=>r?r[0].toUpperCase()+r.slice(1):"";Nt.inverse=r=>{if(!r||!r.stack)return r;let e=r.stack.find(i=>Ws.keys.color.includes(i));if(e){let i=Ws["bg"+Nt.pascal(e)];return i?i.black:r}let t=r.stack.find(i=>i.slice(0,2)==="bg");return t?Ws[t.slice(2).toLowerCase()]||r:Ws.none};Nt.complement=r=>{if(!r||!r.stack)return r;let e=r.stack.find(i=>Ws.keys.color.includes(i)),t=r.stack.find(i=>i.slice(0,2)==="bg");if(e&&!t)return Ws[Vie[e]||e];if(t){let i=t.slice(2).toLowerCase(),n=Vie[i];return n&&Ws["bg"+Nt.pascal(n)]||r}return Ws.none};Nt.meridiem=r=>{let e=r.getHours(),t=r.getMinutes(),i=e>=12?"pm":"am";e=e%12;let n=e===0?12:e,s=t<10?"0"+t:t;return n+":"+s+" "+i};Nt.set=(r={},e="",t)=>e.split(".").reduce((i,n,s,o)=>{let a=o.length-1>s?i[n]||{}:t;return!Nt.isObject(a)&&s<o.length-1&&(a={}),i[n]=a},r);Nt.get=(r={},e="",t)=>{let i=r[e]==null?e.split(".").reduce((n,s)=>n&&n[s],r):r[e];return i==null?t:i};Nt.mixin=(r,e)=>{if(!q0(r))return e;if(!q0(e))return r;for(let t of Object.keys(e)){let i=Object.getOwnPropertyDescriptor(e,t);if(i.hasOwnProperty("value"))if(r.hasOwnProperty(t)&&q0(i.value)){let n=Object.getOwnPropertyDescriptor(r,t);q0(n.value)?r[t]=Nt.merge({},r[t],e[t]):Reflect.defineProperty(r,t,i)}else Reflect.defineProperty(r,t,i);else Reflect.defineProperty(r,t,i)}return r};Nt.merge=(...r)=>{let e={};for(let t of r)Nt.mixin(e,t);return e};Nt.mixinEmitter=(r,e)=>{let t=e.constructor.prototype;for(let i of Object.keys(t)){let n=t[i];typeof n=="function"?Nt.define(r,i,n.bind(e)):Nt.define(r,i,n)}};Nt.onExit=r=>{let e=(t,i)=>{_ie||(_ie=!0,lL.forEach(n=>n()),t===!0&&process.exit(128+i))};lL.length===0&&(process.once("SIGTERM",e.bind(null,!0,15)),process.once("SIGINT",e.bind(null,!0,2)),process.once("exit",e)),lL.push(r)};Nt.define=(r,e,t)=>{Reflect.defineProperty(r,e,{value:t})};Nt.defineExport=(r,e,t)=>{let i;Reflect.defineProperty(r,e,{enumerable:!0,configurable:!0,set(n){i=n},get(){return i?i():t()}})}});var Xie=w(Jf=>{"use strict";Jf.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"};Jf.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};Jf.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};Jf.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};Jf.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 ene=w((Xpt,Zie)=>{"use strict";var $ie=require("readline"),Nqe=Xie(),Tqe=/^(?:\x1b)([a-zA-Z0-9])$/,Oqe=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,Mqe={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.name="enter";else if(r===" ")i.name="tab";else if(r==="\b"||r==="\x7F"||r==="\x7F"||r==="\b")i.name="backspace",i.meta=r.charAt(0)==="";else if(r===""||r==="")i.name="escape",i.meta=r.length===2;else if(r===" "||r===" ")i.name="space",i.meta=r.length===2;else if(r<="")i.name=String.fromCharCode(r.charCodeAt(0)+"a".charCodeAt(0)-1),i.ctrl=!0;else if(r.length===1&&r>="0"&&r<="9")i.name="number";else if(r.length===1&&r>="a"&&r<="z")i.name=r;else if(r.length===1&&r>="A"&&r<="Z")i.name=r.toLowerCase(),i.shift=!0;else if(t=Tqe.exec(r))i.meta=!0,i.shift=/^[A-Z]$/.test(t[1]);else if(t=Oqe.exec(r)){let n=[...r];n[0]===""&&n[1]===""&&(i.option=!0);let s=[t[1],t[2],t[4],t[6]].filter(Boolean).join(""),o=(t[3]||t[5]||1)-1;i.ctrl=!!(o&4),i.meta=!!(o&10),i.shift=!!(o&1),i.code=s,i.name=Mqe[s],i.shift=Uqe(s)||i.shift,i.ctrl=Kqe(s)||i.ctrl}return i};J0.listen=(r={},e)=>{let{stdin:t}=r;if(!t||t!==process.stdin&&!t.isTTY)throw new Error("Invalid stream passed");let i=$ie.createInterface({terminal:!0,input:t});$ie.emitKeypressEvents(t,i);let n=(a,l)=>e(a,J0(a,l),i),s=t.isRaw;return t.isTTY&&t.setRawMode(!0),t.on("keypress",n),i.resume(),()=>{t.isTTY&&t.setRawMode(s),t.removeListener("keypress",n),i.pause(),i.close()}};J0.action=(r,e,t)=>{let i=L(L({},Nqe),t);return e.ctrl?(e.action=i.ctrl[e.name],e):e.option&&i.option?(e.action=i.option[e.name],e):e.shift?(e.action=i.shift[e.name],e):(e.action=i.keys[e.name],e)};Zie.exports=J0});var rne=w((Zpt,tne)=>{"use strict";tne.exports=r=>{r.timers=r.timers||{};let e=r.options.timers;if(!!e)for(let t of Object.keys(e)){let i=e[t];typeof i=="number"&&(i={interval:i}),Hqe(r,t,i)}};function Hqe(r,e,t={}){let i=r.timers[e]={name:e,start:Date.now(),ms:0,tick:0},n=t.interval||120;i.frames=t.frames||[],i.loading=!0;let s=setInterval(()=>{i.ms=Date.now()-i.start,i.tick++,r.render()},n);return i.stop=()=>{i.loading=!1,clearInterval(s)},Reflect.defineProperty(i,"interval",{value:s}),r.once("close",()=>i.stop()),i.stop}});var sne=w(($pt,ine)=>{"use strict";var{define:jqe,width:Gqe}=Xi(),nne=class{constructor(e){let t=e.options;jqe(this,"_prompt",e),this.type=e.type,this.name=e.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=Gqe(t.stdout||process.stdout),Object.assign(this,t),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=e.symbols,this.styles=e.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let e=L({},this);return e.status=this.status,e.buffer=Buffer.from(e.buffer),delete e.clone,e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let t=this._color||e[this.status];return typeof t=="function"?t:e.pending}set loading(e){this._loading=e}get loading(){return typeof this._loading=="boolean"?this._loading:this.loadingChoices?"choices":!1}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}};ine.exports=nne});var ane=w((edt,one)=>{"use strict";var cL=Xi(),Fi=Eo(),uL={default:Fi.noop,noop:Fi.noop,set inverse(r){this._inverse=r},get inverse(){return this._inverse||cL.inverse(this.primary)},set complement(r){this._complement=r},get complement(){return this._complement||cL.complement(this.primary)},primary:Fi.cyan,success:Fi.green,danger:Fi.magenta,strong:Fi.bold,warning:Fi.yellow,muted:Fi.dim,disabled:Fi.gray,dark:Fi.dim.gray,underline:Fi.underline,set info(r){this._info=r},get info(){return this._info||this.primary},set em(r){this._em=r},get em(){return this._em||this.primary.underline},set heading(r){this._heading=r},get heading(){return this._heading||this.muted.underline},set pending(r){this._pending=r},get pending(){return this._pending||this.primary},set submitted(r){this._submitted=r},get submitted(){return this._submitted||this.success},set cancelled(r){this._cancelled=r},get cancelled(){return this._cancelled||this.danger},set typing(r){this._typing=r},get typing(){return this._typing
`),c=l[0],u=l[l.length-1],f=(i+(t?" "+t:"")).length,h=f<c.length?c.slice(f+1):"";return{header:o,prompt:c,after:h,rest:l.slice(1),last:u}}async submit(){this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit&&await this.options.onSubmit.call(this,this.name,this.value,this);let e=this.state.error||await this.validate(this.value,this.state);if(e!==!0){let t=`
`+this.symbols.pointer+" ";typeof e=="string"?t+=e.trim():t+="Invalid input",this.state.error=`
`+this.styles.danger(t),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit("submit",this.value)}async cancel(e){this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel=="function"&&await this.options.onCancel.call(this,this.name,this.value,this),this.emit("cancel",await this.error(e))}async close(){this.state.closed=!0;try{let e=this.sections(),t=Math.ceil(e.prompt.length/this.width);e.rest&&this.write(Eu.cursor.down(e.rest.length)),this.write(`
`.repeat(t))}catch(e){}this.emit("close")}start(){!this.stop&&this.options.show!==!1&&(this.stop=CL.listen(this,this.keypress.bind(this)),this.once("close",this.stop))}async skip(){return this.skipped=this.options.skip===!0,typeof this.options.skip=="function"&&(this.skipped=await this.options.skip.call(this,this.name,this.value)),this.skipped}async initialize(){let{format:e,options:t,result:i}=this;if(this.format=()=>e.call(this,this.value),this.result=()=>i.call(this,this.value),typeof t.initial=="function"&&(this.initial=await t.initial.call(this,this)),typeof t.onRun=="function"&&await t.onRun.call(this,this),typeof t.onSubmit=="function"){let n=t.onSubmit.bind(this),s=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await n(this.name,this.value,this),s())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise(async(e,t)=>{if(this.once("submit",e),this.once("cancel",t),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(e,t,i){let{options:n,state:s,symbols:o,timers:a}=this,l=a&&a[e];s.timer=l;let c=n[e]||s[e]||o[e],u=t&&t[e]!=null?t[e]:await c;if(u==="")return u;let g=await this.resolve(u,s,t,i);return!g&&t&&t[e]?this.resolve(c,s,t,i):g}async prefix(){let e=await this.element("prefix")||this.symbols,t=this.timers&&this.timers.prefix,i=this.state;return i.timer=t,On.isObject(e)&&(e=e[i.status]||e.pending),On.hasColor(e)?e:(this.styles[i.status]||this.styles.pending)(e)}async message(){let e=await this.element("message");return On.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element("separator")||this.symbols,t=this.timers&&this.timers.separator,i=this.state;i.timer=t;let n=e[i.status]||e.pending||i.separator,s=await this.resolve(n,i);return On.isObject(s)&&(s=s[i.status]||s.pending),On.hasColor(s)?s:this.styles.muted(s)}async pointer(e,t){let i=await this.element("pointer",e,t);if(typeof i=="string"&&On.hasColor(i))return i;if(i){let n=this.styles,s=this.index===t,o=s?n.primary:c=>c,a=await this.resolve(i[s?"on":"off"]||i,this.state),l=On.hasColor(a)?a:o(a);return s?l:" ".repeat(a.length)}}async indicator(e,t){let i=await this.element("indicator",e,t);if(typeof i=="string"&&On.hasColor(i))return i;if(i){let n=this.styles,s=e.enabled===!0,o=s?n.success:n.dark,a=i[s?"on":"off"]||i;return On.hasColor(a)?a:o(a)}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let e=await this.element("hint");return On.hasColor(e)?e:this.styles.muted(e)}}error(e){return this.state.submitted?"":e||this.state.error}format(e){return e}result(e){return e}validate(e){return this.options.required===!0?this.isValue(e):!0}isValue(e){return e!=null&&e!==""}resolve(e,...t){return On.resolve(this,e,...t)}get base(){return W0.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||On.height(this.stdout,25)}get width(){return this.options.columns||On.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(e){this.state.cursor=e}get cursor(){return this.state.cursor}set input(e){this.state.input=e}get input(){return this.state.input}set value(e){this.state.value=e}get value(){let{input:e,value:t}=this.state,i=[t,e].find(this.isValue.bind(this));return this.isValue(i)?i:this.initial}static get prompt(){return e=>new this(e).run()}};function $qe(r){let e=n=>r[n]===void 0||typeof r[n]=="function",t=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],i=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let n of Object.keys(r.options)){if(t.includes(n)||/^on[A-Z]/.test(n))continue;let s=r.options[n];typeof s=="function"&&e(n)?i.includes(n)||(r[n]=s.bind(r)):typeof r[n]!="function"&&(r[n]=s)}}function eJe(r
`:" ",i=[];for(let n=0;n<4;n++){let s=t(n);e[n]?i.push(s.repeat(e[n])):i.push("")}return i}Cne.exports=W0});var yne=w((ndt,Ene)=>{"use strict";var tJe=Xi(),Ine={default(r,e){return e},checkbox(r,e){throw new Error("checkbox role is not implemented yet")},editable(r,e){throw new Error("editable role is not implemented yet")},expandable(r,e){throw new Error("expandable role is not implemented yet")},heading(r,e){return e.disabled="",e.indicator=[e.indicator," "].find(t=>t!=null),e.message=e.message||"",e},input(r,e){throw new Error("input role is not implemented yet")},option(r,e){return Ine.default(r,e)},radio(r,e){throw new Error("radio role is not implemented yet")},separator(r,e){return e.disabled="",e.indicator=[e.indicator," "].find(t=>t!=null),e.message=e.message||r.symbols.line.repeat(5),e},spacer(r,e){return e}};Ene.exports=(r,e={})=>{let t=tJe.merge({},Ine,e.roles);return t[r]||t.default}});var WC=w((sdt,wne)=>{"use strict";var rJe=Eo(),iJe=Wf(),nJe=yne(),z0=Xi(),{reorder:mL,scrollUp:sJe,scrollDown:oJe,isObject:Bne,swap:aJe}=z0,bne=class extends iJe{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:t,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");Bne(t)&&(t=Object.keys(t)),Array.isArray(t)?(i!=null&&(this.index=this.findIndex(i)),t.forEach(s=>this.enable(this.find(s))),await this.render()):(i!=null&&(t=i),typeof t=="string"&&(t=this.findIndex(t)),typeof t=="number"&&t>-1&&(this.index=Math.max(0,Math.min(t,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,t){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,t).then(o=>(this.state.loadingChoices=!1,o))}async toChoice(e,t,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=nJe(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=t,e.cursor=0,z0.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,rJe.unstyle(e.message).length));let o=L({},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,t)),e}async onChoice(e,t){this.emit("choice",e,t,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,t)}async addChoice(e,t,i){let n=await this.toChoice(e,t,i);return this.choices.push(n),this.index=this.choices.length-1,this.limit=this.choices.length,n}async newItem(e,t,i){let n=L({name:"New choice name?",editable:!0,newChoice:!0},e),s=await this.addChoice(n,t,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,t)
`),n;return this.options.choicesHeader&&(n=await this.resolve(this.options.choicesHeader,this.state)),[n,i].filter(Boolean).join(`
`)}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map(e=>this.styles.primary(e.name)).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:e,size:t}=this.state,i="",n=await this.header(),s=await this.prefix(),o=await this.separator(),a=await this.message();this.options.promptLine!==!1&&(i=[s,a,o,""].join(" "),this.state.prompt=i);let l=await this.format(),c=await this.error()||await this.hint(),u=await this.renderChoices(),g=await this.footer();l&&(i+=l),c&&!i.includes(c)&&(i+=" "+c),e&&!l&&!u.trim()&&this.multiple&&this.emptyError!=null&&(i+=this.styles.danger(this.emptyError)),this.clear(t),this.write([n,i,u,g].filter(Boolean).join(`
`)),this.write(this.margin[2]),this.restore()}};vne.exports=Sne});var Pne=w((adt,xne)=>{"use strict";var lJe=xl(),cJe=(r,e)=>{let t=r.toLowerCase();return i=>{let s=i.toLowerCase().indexOf(t),o=e(i.slice(s,s+t.length));return s>=0?i.slice(0,s)+o+i.slice(s+t.length):i}},kne=class extends lJe{constructor(e){super(e);this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:t,input:i}=this.state;return this.input=i.slice(0,t)+e+i.slice(t),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:t}=this.state;return t?(this.input=t.slice(0,e-1)+t.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:t}=this.state;return t[e]===void 0?this.alert():(this.input=`${t}`.slice(0,e)+`${t}`.slice(e+1),this.complete())}number(e){return this.append(e)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(e=this.input,t=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,e,t);let i=e.toLowerCase();return t.filter(n=>n.message.toLowerCase().includes(i))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(e=>this.styles.primary(e.message)).join(", ");if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let e=this.options.highlight?this.options.highlight.bind(this):this.styles.placeholder,t=cJe(this.input,e),i=this.choices;this.choices=i.map(n=>ie(L({},n),{message:t(n.message)})),await super.render(),this.choices=i}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};xne.exports=kne});var yL=w((Adt,Dne)=>{"use strict";var IL=Xi();Dne.exports=(r,e={})=>{r.cursorHide();let{input:t="",initial:i="",pos:n,showCursor:s=!0,color:o}=e,a=o||r.styles.placeholder,l=IL.inverse(r.styles.primary),c=m=>l(r.styles.black(m)),u=t,g=" ",f=c(g);if(r.blink&&r.blink.off===!0&&(c=m=>m,f=""),s&&n===0&&i===""&&t==="")return c(g);if(s&&n===0&&(t===i||t===""))return c(i[0])+a(i.slice(1));i=IL.isPrimitive(i)?`${i}`:"",t=IL.isPrimitive(t)?`${t}`:"";let h=i&&i.startsWith(t)&&i!==t,p=h?c(i[t.length]):f;if(n!==t.length&&s===!0&&(u=t.slice(0,n)+c(t[n])+t.slice(n+1),p=""),s===!1&&(p=""),h){let m=r.styles.unstyle(u+p);return u+p+a(i.slice(m.length))}return u+p}});var _0=w((ldt,Fne)=>{"use strict";var uJe=Eo(),gJe=xl(),fJe=yL(),Rne=class extends gJe{constructor(e){super(ie(L({},e),{multiple:!0}));this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(t=>t!=null),this.emptyError="",this.values={}}async reset(e){return await super.reset(),e===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(t=>t.reset&&t.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let t=this.focused;if(!t)return this.alert();let{cursor:i,input:n}=t;return t.value=t.input=n.slice(0,i)+e+n.slice(i),t.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:t,input:i}=e;return e.value=e.input=i.slice(0,t-1)+i.slice(t),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:t,input:i}=e;if(i[t]===void 0)return this.alert();let n=`${i}`.slice(0,t)+`${i}`.slice(t+1);return e.value=e.input=n,this.render()}right(){let e=this.focused;return e?e.cursor>=e.input.length?this.alert():(e.cursor++,this.render()):this.alert()}left(){let e=this.focused;return e?e.cursor<=0?this.alert():(e.cursor--,this.render()):this.alert()}space(e,t){return this.dispatch(e,t)}number(e,t){return this.dispatch(e,t)}next(){let e=this.focused;if(!e)return this.alert();let{initial:t,input:i}=e;return t&&t.s
`)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};Une.exports=Kne});var Gne=w((fdt,Hne)=>{"use strict";var yJe=V0(),jne=class extends yJe{constructor(e){super(e);this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};Hne.exports=jne});var Jne=w((hdt,Yne)=>{"use strict";var wJe=xl(),BJe=_0(),zf=BJe.prototype,qne=class extends wJe{constructor(e){super(ie(L({},e),{multiple:!0}));this.align=[this.options.align,"left"].find(t=>t!=null),this.emptyError="",this.values={}}dispatch(e,t){let i=this.focused,n=i.parent||{};return!i.editable&&!n.editable&&(e==="a"||e==="i")?super[e]():zf.dispatch.call(this,e,t)}append(e,t){return zf.append.call(this,e,t)}delete(e,t){return zf.delete.call(this,e,t)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?zf.next.call(this):super.next()}prev(){return this.focused.editable?zf.prev.call(this):super.prev()}async indicator(e,t){let i=e.indicator||"",n=e.editable?i:super.indicator(e,t);return await this.resolve(n,this.state,e,t)||""}indent(e){return e.role==="heading"?"":e.editable?" ":" "}async renderChoice(e,t){return e.indent="",e.editable?zf.renderChoice.call(this,e,t):super.renderChoice(e,t)}error(){return""}footer(){return this.state.error}async validate(){let e=!0;for(let t of this.choices){if(typeof t.validate!="function"||t.role==="heading")continue;let i=t.parent?this.value[t.parent.name]:this.value;if(t.editable?i=t.value===t.name?t.initial||"":t.value:this.isDisabled(t)||(i=t.enabled===!0),e=await t.validate(i,this.state),e!==!0)break}return e!==!0&&(this.state.error=typeof e=="string"?e:"Invalid Input"),e}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(e=>e.newChoice))return this.alert();this.value={};for(let e of this.choices){let t=e.parent?this.value[e.parent.name]:this.value;if(e.role==="heading"){this.value[e.name]={};continue}e.editable?t[e.name]=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(t[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};Yne.exports=qne});var Iu=w((pdt,Wne)=>{"use strict";var bJe=Wf(),QJe=yL(),{isPrimitive:vJe}=Xi(),zne=class extends bJe{constructor(e){super(e);this.initial=vJe(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(e,t={}){let i=this.state.prevKeypress;return this.state.prevKeypress=t,this.options.multiline===!0&&t.name==="return"&&(!i||i.name!=="return")?this.append(`
`,t):super.keypress(e,t)}moveCursor(e){this.cursor+=e}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(e,t){if(!e||t.ctrl||t.code)return this.alert();this.append(e)}append(e){let{cursor:t,input:i}=this.state;this.input=`${i}`.slice(0,t)+e+`${i}`.slice(t),this.moveCursor(String(e).length),this.render()}insert(e){this.append(e)}delete(){let{cursor:e,input:t}=this.state;if(e<=0)return this.alert();this.input=`${t}`.slice(0,e-1)+`${t}`.slice(e),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:e,input:t}=this.state;if(t[e]===void 0)return this.alert();this.input=`${t}`.slice(0,e)+`${t}`.slice(e+1),this.render()}cutForward(){let e=this.cursor;if(this.input.length<=e)return this.alert();this.state.clipboard.push(this.input.slice(e)),this.input=this.input.slice(0,e),this.render()}cutLeft(){let e=this.cursor;if(e===0)return this.alert();let t=this.input.slice(0,e),i=this.input.slice(e),n=t.split(" ");this.state.clipboard.push(n.pop()),this.input=n.join(" "),this.cursor=this.input.length,this.input+=i,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let e=this.initial!=null?String(this.initial):"";if(!e||!e.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(e){return!!e}async format(e=this.value){let t=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(e||t):QJe(this,{input:e,initial:t,pos:this.cursor})}async render(){let e=this.state.size,t=await this.prefix(),i=await this.separator(),n=await this.message(),s=[t,n,i].filter(Boolean).join(" ");this.state.prompt=s;let o=await this.header(),a=await this.format(),l=await this.error()||await this.hint(),c=await this.footer();l&&!a.includes(l)&&(a+=" "+l),s+=" "+a,this.clear(e),this.write([o,s,c].filter(Boolean).join(`
`)),this.restore()}};Wne.exports=zne});var Vne=w((ddt,_ne)=>{"use strict";var SJe=r=>r.filter((e,t)=>r.lastIndexOf(e)===t),X0=r=>SJe(r).filter(Boolean);_ne.exports=(r,e={},t="")=>{let{past:i=[],present:n=""}=e,s,o;switch(r){case"prev":case"undo":return s=i.slice(0,i.length-1),o=i[i.length-1]||"",{past:X0([t,...s]),present:o};case"next":case"redo":return s=i.slice(1),o=i[0]||"",{past:X0([...s,t]),present:o};case"save":return{past:X0([...i,t]),present:""};case"remove":return o=X0(i.filter(a=>a!==t)),n="",o.length&&(n=o.pop()),{past:o,present:n};default:throw new Error(`Invalid action: "${r}"`)}}});var BL=w((Cdt,Xne)=>{"use strict";var xJe=Iu(),Zne=Vne(),$ne=class extends xJe{constructor(e){super(e);let t=this.options.history;if(t&&t.store){let i=t.values||this.initial;this.autosave=!!t.autosave,this.store=t.store,this.data=this.store.get("values")||{past:[],present:i},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=Zne(e,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){!this.store||(this.data=Zne("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};Xne.exports=$ne});var rse=w((mdt,ese)=>{"use strict";var kJe=Iu(),tse=class extends kJe{format(){return""}};ese.exports=tse});var sse=w((Edt,ise)=>{"use strict";var PJe=Iu(),nse=class extends PJe{constructor(e={}){super(e);this.sep=this.options.separator||/, */,this.initial=e.initial||""}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:t=>t;return this.list.map(e).join(", ")}async submit(e){let t=this.state.error||await this.validate(this.list,this.state);return t!==!0?(this.state.error=t,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};ise.exports=nse});var Ase=w((Idt,ose)=>{"use strict";var DJe=xl(),ase=class extends DJe{constructor(e){super(ie(L({},e),{multiple:!0}))}};ose.exports=ase});var bL=w((ydt,lse)=>{"use strict";var FJe=Iu(),cse=class extends FJe{constructor(e={}){super(L({style:"number"},e));this.min=this.isValue(e.min)?this.toNumber(e.min):-Infinity,this.max=this.isValue(e.max)?this.toNumber(e.max):Infinity,this.delay=e.delay!=null?e.delay:1e3,this.float=e.float!==!1,this.round=e.round===!0||e.float===!1,this.major=e.major||10,this.minor=e.minor||1,this.initial=e.initial!=null?e.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(e){return!/[-+.]/.test(e)||e==="."&&this.input.includes(".")?this.alert("invalid number"):super.append(e)}number(e){return super.append(e)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(e){let t=e||this.minor,i=this.toNumber(this.input);return i>this.max+t?this.alert():(this.input=`${i+t}`,this.render())}down(e){let t=e||this.minor,i=this.toNumber(this.input);return i<this.min-t?this.alert():(this.input=`${i-t}`,this.render())}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(e=this.input){return typeof this.options.format=="function"?this.options.format.call(this,e):this.styles.info(e)}toNumber(e=""){return this.float?+e:Math.round(+e)}isValue(e){return/^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(e)}submit(){let e=[this.input,this.initial].find(t=>this.isValue(t));return this.value=this.toNumber(e||0),super.submit()}};lse.exports=cse});var gse=w((wdt,use)=>{use.exports=bL()});var pse=w((Bdt,fse)=>{"use strict";var RJe=Iu(),hse=class extends RJe{constructor(e){super(e);this.cursorShow()}format(e=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(e.length)):""}};fse.exports=hse});var Es
`;let t=e.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((i,n)=>({name:n+t})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let e=0;for(let t of this.choices){e=Math.max(e,t.message.length),t.scaleIndex=t.initial||2,t.scale=[];for(let i=0;i<this.scale.length;i++)t.scale.push({index:i})}this.widths[0]=Math.min(this.widths[0],e+3)}async dispatch(e,t){if(this.multiple)return this[t.name]?await this[t.name](e,t):await super.dispatch(e,t);this.alert()}heading(e,t,i){return this.styles.strong(e)}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIndex>=this.scale.length-1?this.alert():(e.scaleIndex++,this.render())}left(){let e=this.focused;return e.scaleIndex<=0?this.alert():(e.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map(t=>this.styles.info(t.index)).join(", "):""}pointer(){return""}renderScaleKey(){if(this.scaleKey===!1||this.state.submitted)return"";let e=this.scale.map(i=>` ${i.name} - ${i.message}`);return["",...e].map(i=>this.styles.muted(i)).join(`
`)}renderScaleHeading(e){let t=this.scale.map(l=>l.name);typeof this.options.renderScaleHeading=="function"&&(t=this.options.renderScaleHeading.call(this,e));let i=this.scaleLength-t.join("").length,n=Math.round(i/(t.length-1)),o=t.map(l=>this.styles.strong(l)).join(" ".repeat(n)),a=" ".repeat(this.widths[0]);return this.margin[3]+a+this.margin[1]+o}scaleIndicator(e,t,i){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,e,t,i);let n=e.scaleIndex===t.index;return t.disabled?this.styles.hint(this.symbols.radio.disabled):n?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,t){let i=e.scale.map(s=>this.scaleIndicator(e,s,t)),n=this.term==="Hyper"?"":" ";return i.join(n+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,t){await this.onChoice(e,t);let i=this.index===t,n=await this.pointer(e,t),s=await e.hint;s&&!Cse.hasColor(s)&&(s=this.styles.muted(s));let o=p=>this.margin[3]+p.replace(/\s+$/,"").padEnd(this.widths[0]," "),a=this.newline,l=this.indent(e),c=await this.resolve(e.message,this.state,e,t),u=await this.renderScale(e,t),g=this.margin[1]+this.margin[3];this.scaleLength=LJe.unstyle(u).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-g.length);let h=Cse.wordWrap(c,{width:this.widths[0],newline:a}).split(`
`).map(p=>o(p)+this.margin[1]);return i&&(u=this.styles.info(u),h=h.map(p=>this.styles.info(p))),h[0]+=u,this.linebreak&&h.push(""),[l+n,h.join(`
`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let e=this.visible.map(async(n,s)=>await this.renderChoice(n,s)),t=await Promise.all(e),i=await this.renderScaleHeading();return this.margin[0]+[i,...t.map(n=>n.join(" "))].join(`
`)}async render(){let{submitted:e,size:t}=this.state,i=await this.prefix(),n=await this.separator(),s=await this.message(),o="";this.options.promptLine!==!1&&(o=[i,s,n,""].join(" "),this.state.prompt=o);let a=await this.header(),l=await this.format(),c=await this.renderScaleKey(),u=await this.error()||await this.hint(),g=await this.renderChoices(),f=await this.footer(),h=this.emptyError;l&&(o+=l),u&&!o.includes(u)&&(o+=" "+u),e&&!l&&!g.trim()&&this.multiple&&h!=null&&(o+=this.styles.danger(h)),this.clear(t),this.write([a,o,c,g,f].filter(Boolean).join(`
`)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIndex;return this.base.submit.call(this)}};dse.exports=mse});var Bse=w((Qdt,Ise)=>{"use strict";var yse=Eo(),TJe=(r="")=>typeof r=="string"?r.replace(/^['"]|['"]$/g,""):"",wse=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=TJe(e.initial||this.field.initial||""),this.message=e.message||this.name,this.cursor=0,this.input="",this.lines=[]}},OJe=async(r={},e={},t=i=>i)=>{let i=new Set,n=r.fields||[],s=r.template,o=[],a=[],l=[],c=1;typeof s=="function"&&(s=await s());let u=-1,g=()=>s[++u],f=()=>s[u+1],h=p=>{p.line=c,o.push(p)};for(h({type:"bos",value:""});u<s.length-1;){let p=g();if(/^[^\S\n ]$/.test(p)){h({type:"text",value:p});continue}if(p===`
`){h({type:"newline",value:p}),c++;continue}if(p==="\\"){p+=g(),h({type:"text",value:p});continue}if((p==="$"||p==="#"||p==="{")&&f()==="{"){p+=g();let Q={type:"template",open:p,inner:"",close:"",value:p},S;for(;S=g();){if(S==="}"){f()==="}"&&(S+=g()),Q.value+=S,Q.close=S;break}S===":"?(Q.initial="",Q.key=Q.inner):Q.initial!==void 0&&(Q.initial+=S),Q.value+=S,Q.inner+=S}Q.template=Q.open+(Q.initial||Q.inner)+Q.close,Q.key=Q.key||Q.inner,e.hasOwnProperty(Q.key)&&(Q.initial=e[Q.key]),Q=t(Q),h(Q),l.push(Q.key),i.add(Q.key);let x=a.find(M=>M.name===Q.key);Q.field=n.find(M=>M.name===Q.key),x||(x=new wse(Q),a.push(x)),x.lines.push(Q.line-1);continue}let m=o[o.length-1];m.type==="text"&&m.line===c?m.value+=p:h({type:"text",value:p})}return h({type:"eos",value:""}),{input:s,tabstops:o,unique:i,keys:l,items:a}};Ise.exports=async r=>{let e=r.options,t=new Set(e.required===!0?[]:e.required||[]),i=L(L({},e.values),e.initial),{tabstops:n,items:s,keys:o}=await OJe(e,i),a=QL("result",r,e),l=QL("format",r,e),c=QL("validate",r,e,!0),u=r.isValue.bind(r);return async(g={},f=!1)=>{let h=0;g.required=t,g.items=s,g.keys=o,g.output="";let p=async(S,x,M,q)=>{let U=await c(S,x,M,q);return U===!1?"Invalid field "+M.name:U};for(let S of n){let x=S.value,M=S.key;if(S.type!=="template"){x&&(g.output+=x);continue}if(S.type==="template"){let q=s.find(Z=>Z.name===M);e.required===!0&&g.required.add(q.name);let U=[q.input,g.values[q.value],q.value,x].find(u),J=(q.field||{}).message||S.inner;if(f){let Z=await p(g.values[M],g,q,h);if(Z&&typeof Z=="string"||Z===!1){g.invalid.set(M,Z);continue}g.invalid.delete(M);let A=await a(g.values[M],g,q,h);g.output+=yse.unstyle(A);continue}q.placeholder=!1;let oe=x;x=await l(x,g,q,h),U!==x?(g.values[M]=U,x=r.styles.typing(U),g.missing.delete(J)):(g.values[M]=void 0,U=`<${J}>`,x=r.styles.primary(U),q.placeholder=!0,g.required.has(M)&&g.missing.add(J)),g.missing.has(J)&&g.validating&&(x=r.styles.warning(U)),g.invalid.has(M)&&g.validating&&(x=r.styles.danger(U)),h===g.index&&(oe!==x?x=r.styles.underline(x):x=r.styles.heading(yse.unstyle(x))),h++}x&&(g.output+=x)}let m=g.output.split(`
`).map(S=>" "+S),y=s.length,Q=0;for(let S of s)g.invalid.has(S.name)&&S.lines.forEach(x=>{m[x][0]===" "&&(m[x]=g.styles.danger(g.symbols.bullet)+m[x].slice(1))}),r.isValue(g.values[S.name])&&Q++;return g.completed=(Q/y*100).toFixed(0),g.output=m.join(`
`),g.output}};function QL(r,e,t,i){return(n,s,o,a)=>typeof o.field[r]=="function"?o.field[r].call(e,n,s,o,a):[i,n].find(l=>e.isValue(l))}});var vse=w((vdt,bse)=>{"use strict";var MJe=Eo(),UJe=Bse(),KJe=Wf(),Qse=class extends KJe{constructor(e){super(e);this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await UJe(this),await super.initialize()}async reset(e){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},e!==!0&&(await this.initialize(),await this.render())}moveCursor(e){let t=this.getItem();this.cursor+=e,t.cursor+=e}dispatch(e,t){if(!t.code&&!t.ctrl&&e!=null&&this.getItem()){this.append(e,t);return}this.alert()}append(e,t){let i=this.getItem(),n=i.input.slice(0,this.cursor),s=i.input.slice(this.cursor);this.input=i.input=`${n}${e}${s}`,this.moveCursor(1),this.render()}delete(){let e=this.getItem();if(this.cursor<=0||!e.input)return this.alert();let t=e.input.slice(this.cursor),i=e.input.slice(0,this.cursor-1);this.input=e.input=`${i}${t}`,this.moveCursor(-1),this.render()}increment(e){return e>=this.state.keys.length-1?0:e+1}decrement(e){return e<=0?this.state.keys.length-1:e-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(e){let t=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(t=this.styles.danger),t(`${this.state.completed}% completed`)}async render(){let{index:e,keys:t=[],submitted:i,size:n}=this.state,s=[this.options.newline,`
`].find(S=>S!=null),o=await this.prefix(),a=await this.separator(),l=await this.message(),c=[o,l,a].filter(Boolean).join(" ");this.state.prompt=c;let u=await this.header(),g=await this.error()||"",f=await this.hint()||"",h=i?"":await this.interpolate(this.state),p=this.state.key=t[e]||"",m=await this.format(p),y=await this.footer();m&&(c+=" "+m),f&&!m&&this.state.completed===0&&(c+=" "+f),this.clear(n);let Q=[u,c,h,y,g.trim()];this.write(Q.filter(Boolean).join(s)),this.restore()}getItem(e){let{items:t,keys:i,index:n}=this.state,s=t.find(o=>o.name===i[n]);return s&&s.input!=null&&(this.input=s.input,this.cursor=s.cursor),s}async submit(){typeof this.interpolate!="function"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:e,missing:t,output:i,values:n}=this.state;if(e.size){let a="";for(let[l,c]of e)a+=`Invalid ${l}: ${c}
`;return this.state.error=a,super.submit()}if(t.size)return this.state.error="Required: "+[...t.keys()].join(", "),super.submit();let o=MJe.unstyle(i).split(`
`).map(a=>a.slice(1)).join(`
`);return this.value={values:n,result:o},super.submit()}};bse.exports=Qse});var kse=w((Sdt,Sse)=>{"use strict";var HJe="(Use <shift>+<up/down> to sort)",jJe=xl(),xse=class extends jJe{constructor(e){super(ie(L({},e),{reorder:!1,sort:!0,multiple:!0}));this.state.hint=[this.options.hint,HJe].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,t){let i=await super.renderChoice(e,t),n=this.symbols.identicalTo+" ",s=this.index===t&&this.sorting?this.styles.muted(n):" ";return this.options.drag===!1&&(s=""),this.options.numbered===!0?s+`${t+1} - `+i:s+i}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};Sse.exports=xse});var Fse=w((xdt,Pse)=>{"use strict";var GJe=WC(),Dse=class extends GJe{constructor(e={}){super(e);if(this.emptyError=e.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let t=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];t=t.map(i=>this.styles.muted(i)),this.state.header=t.join(`
`)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let t=await super.toChoices(...e);for(let i of t)i.scale=YJe(5,this.options),i.scaleIdx=2;return t}dispatch(){this.alert()}space(){let e=this.focused,t=e.scale[e.scaleIdx],i=t.selected;return e.scale.forEach(n=>n.selected=!1),t.selected=!i,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIdx>=e.scale.length-1?this.alert():(e.scaleIdx++,this.render())}left(){let e=this.focused;return e.scaleIdx<=0?this.alert():(e.scaleIdx--,this.render())}indent(){return" "}async renderChoice(e,t){await this.onChoice(e,t);let i=this.index===t,n=this.term==="Hyper",s=n?9:8,o=n?"":" ",a=this.symbols.line.repeat(s),l=" ".repeat(s+(n?0:1)),c=x=>(x?this.styles.success("\u25C9"):"\u25EF")+o,u=t+1+".",g=i?this.styles.heading:this.styles.noop,f=await this.resolve(e.message,this.state,e,t),h=this.indent(e),p=h+e.scale.map((x,M)=>c(M===e.scaleIdx)).join(a),m=x=>x===e.scaleIdx?g(x):x,y=h+e.scale.map((x,M)=>m(M)).join(l),Q=()=>[u,f].filter(Boolean).join(" "),S=()=>[Q(),p,y," "].filter(Boolean).join(`
`);return i&&(p=this.styles.cyan(p),y=this.styles.cyan(y)),S()}async renderChoices(){if(this.state.submitted)return"";let e=this.visible.map(async(i,n)=>await this.renderChoice(i,n)),t=await Promise.all(e);return t.length||t.push(this.styles.danger("No matching choices")),t.join(`
`)}format(){return this.state.submitted?this.choices.map(t=>this.styles.info(t.scaleIdx)).join(", "):""}async render(){let{submitted:e,size:t}=this.state,i=await this.prefix(),n=await this.separator(),s=await this.message(),o=[i,s,n].filter(Boolean).join(" ");this.state.prompt=o;let a=await this.header(),l=await this.format(),c=await this.error()||await this.hint(),u=await this.renderChoices(),g=await this.footer();(l||!c)&&(o+=" "+l),c&&!o.includes(c)&&(o+=" "+c),e&&!l&&!u&&this.multiple&&this.type!=="form"&&(o+=this.styles.danger(this.emptyError)),this.clear(t),this.write([o,a,u,g].filter(Boolean).join(`
`)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function YJe(r,e={}){if(Array.isArray(e.scale))return e.scale.map(i=>L({},i));let t=[];for(let i=1;i<r+1;i++)t.push({i,selected:!1});return t}Pse.exports=Dse});var Lse=w((kdt,Rse)=>{Rse.exports=BL()});var Ose=w((Pdt,Nse)=>{"use strict";var qJe=V0(),Tse=class extends qJe{async initialize(){await super.initialize(),this.value=this.initial=!!this.options.initial,this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(e="",t){switch(e.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let e=i=>this.styles.primary.underline(i);return[this.value?this.disabled:e(this.disabled),this.value?e(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:e}=this.state,t=await this.header(),i=await this.prefix(),n=await this.separator(),s=await this.message(),o=await this.format(),a=await this.error()||await this.hint(),l=await this.footer(),c=[i,s,n,o].join(" ");this.state.prompt=c,a&&!c.includes(a)&&(c+=" "+a),this.clear(e),this.write([t,c,l].filter(Boolean).join(`
`)),this.write(this.margin[2]),this.restore()}};Nse.exports=Tse});var Kse=w((Ddt,Mse)=>{"use strict";var JJe=xl(),Use=class extends JJe{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,t){let i=await super.toChoices(e,t);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)}}};Mse.exports=Use});var jse=w(vL=>{"use strict";var Hse=Xi(),di=(r,e)=>{Hse.defineExport(vL,r,e),Hse.defineExport(vL,r.toLowerCase(),e)};di("AutoComplete",()=>Pne());di("BasicAuth",()=>Mne());di("Confirm",()=>Gne());di("Editable",()=>Jne());di("Form",()=>_0());di("Input",()=>BL());di("Invisible",()=>rse());di("List",()=>sse());di("MultiSelect",()=>Ase());di("Numeral",()=>gse());di("Password",()=>pse());di("Scale",()=>Ese());di("Select",()=>xl());di("Snippet",()=>vse());di("Sort",()=>kse());di("Survey",()=>Fse());di("Text",()=>Lse());di("Toggle",()=>Ose());di("Quiz",()=>Kse())});var Yse=w((Rdt,Gse)=>{Gse.exports={ArrayPrompt:WC(),AuthPrompt:wL(),BooleanPrompt:V0(),NumberPrompt:bL(),StringPrompt:Iu()}});var _C=w((Ldt,qse)=>{"use strict";var Jse=require("assert"),SL=require("events"),kl=Xi(),ua=class extends SL{constructor(e,t){super();this.options=kl.merge({},e),this.answers=L({},t)}register(e,t){if(kl.isObject(e)){for(let n of Object.keys(e))this.register(n,e[n]);return this}Jse.equal(typeof t,"function","expected a function");let i=e.toLowerCase();return t.prototype instanceof this.Prompt?this.prompts[i]=t:this.prompts[i]=t(this.Prompt,this),this}async prompt(e=[]){for(let t of[].concat(e))try{typeof t=="function"&&(t=await t.call(this)),await this.ask(kl.merge({},this.options,t))}catch(i){return Promise.reject(i)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let t=kl.merge({},this.options,e),{type:i,name:n}=e,{set:s,get:o}=kl;if(typeof i=="function"&&(i=await i.call(this,e,this.answers)),!i)return this.answers[n];Jse(this.prompts[i],`Prompt "${i}" is not registered`);let a=new this.prompts[i](t),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),t.autofill&&l!=null?(a.value=a.input=l,t.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||Wf()}static get prompts(){return jse()}static get types(){return Yse()}static get prompt(){let e=(t,...i)=>{let n=new this(...i),s=n.emit.bind(n);return n.emit=(...o)=>(e.emit(...o),s(...o)),n.prompt(t)};return kl.mixinEmitter(e,new SL),e}};kl.mixinEmitter(ua,new SL);var xL=ua.prompts;for(let r of Object.keys(xL)){let e=r.toLowerCase(),t=i=>new xL[r](i).run();ua.prompt[e]=t,ua[e]=t,ua[r]||Reflect.defineProperty(ua,r,{get:()=>xL[r]})}var zC=r=>{kl.defineExport(ua,r,()=>ua.types[r])};zC("ArrayPrompt");zC("AuthPrompt");zC("BooleanPrompt");zC("NumberPrompt");zC("StringPrompt");qse.exports=ua});var soe=w((BCt,noe)=>{function XJe(r,e){for(var t=-1,i=r==null?0:r.length;++t<i&&e(r[t],t,r)!==!1;);return r}noe.exports=XJe});var Vf=w((bCt,ooe)=>{var ZJe=A0(),$Je=Ff();function eWe(r,e,t,i){var n=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=i?i(t[a],r[a],a,t,r):void 0;l===void 0&&(l=r[a]),n?$Je(t,a,l):ZJe(t,a,l)}return t}ooe.exports=eWe});var Aoe=w((QCt,aoe)=>{var tWe=Vf(),rWe=Of();function iWe(r,e){return r&&tWe(e,rWe(e),r)}aoe.expo
`:"";return o?g+=`@IF EXIST ${o} (\r
${o} ${l} ${n} ${u}%*\r
) ELSE (\r
@SETLOCAL\r
@SET PATHEXT=%PATHEXT:;.JS;=;%\r
${a} ${l} ${n} ${u}%*\r
)\r
`:g+=`@${a} ${l} ${n} ${u}%*\r
`,g}function __e(r,e,t){let i=zs.relative(zs.dirname(e),r),n=t.prog&&t.prog.split("\\").join("/"),s;i=i.split("\\").join("/");let o=zs.isAbsolute(i)?`"${i}"`:`"$basedir/${i}"`,a=t.args||"",l=sT(t.nodePath).posix;n?(s=`"$basedir/${t.prog}"`,i=o):(n=o,a="",i="");let c=t.progArgs?`${t.progArgs.join(" ")} `:"",u=`#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")
case \`uname\` in
*CYGWIN*) basedir=\`cygpath -w "$basedir"\`;;
esac
`,g=t.nodePath?`export NODE_PATH="${l}"
`:"";return s?u+=`${g}if [ -x ${s} ]; then
exec ${s} ${a} ${i} ${c}"$@"
else
exec ${n} ${a} ${i} ${c}"$@"
fi
`:u+=`${g}${n} ${a} ${i} ${c}"$@"
exit $?
`,u}function V_e(r,e,t){let i=zs.relative(zs.dirname(e),r),n=t.prog&&t.prog.split("\\").join("/"),s=n&&`"${n}$exe"`,o;i=i.split("\\").join("/");let a=zs.isAbsolute(i)?`"${i}"`:`"$basedir/${i}"`,l=t.args||"",c=sT(t.nodePath),u=c.win32,g=c.posix;s?(o=`"$basedir/${t.prog}$exe"`,i=a):(s=a,l="",i="");let f=t.progArgs?`${t.progArgs.join(" ")} `:"",h=`#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
${t.nodePath?`$env_node_path=$env:NODE_PATH
$env:NODE_PATH="${u}"
`:""}if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}`;return t.nodePath&&(h+=` else {
$env:NODE_PATH="${g}"
}`),o?h+=`
$ret=0
if (Test-Path ${o}) {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${o} ${l} ${i} ${f}$args
} else {
& ${o} ${l} ${i} ${f}$args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${s} ${l} ${i} ${f}$args
} else {
& ${s} ${l} ${i} ${f}$args
}
$ret=$LASTEXITCODE
}
${t.nodePath?`$env:NODE_PATH=$env_node_path
`:""}exit $ret
`:h+=`
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${s} ${l} ${i} ${f}$args
} else {
& ${s} ${l} ${i} ${f}$args
}
${t.nodePath?`$env:NODE_PATH=$env_node_path
`:""}exit $LASTEXITCODE
`,h}function Z_e(r,e){return e.fs_.chmod(r,493)}function sT(r){if(!r)return{win32:"",posix:""};let e=typeof r=="string"?r.split(zs.delimiter):Array.from(r),t={};for(let i=0;i<e.length;i++){let n=e[i].split("/").join("\\"),s=hce()?e[i].split("\\").join("/").replace(/^([^:\\/]*):/,(o,a)=>`/mnt/${a.toLowerCase()}`):e[i];t.win32=t.win32?`${t.win32};${n}`:n,t.posix=t.posix?`${t.posix}:${s}`:s,t[i]={win32:n,posix:s}}return t}fce.exports=nT});var BT=w((okt,Lce)=>{Lce.exports=require("stream")});var Mce=w((akt,Nce)=>{"use strict";function Tce(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function E5e(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tce(Object(t),!0).forEach(function(i){m5e(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Tce(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function m5e(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function I5e(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Oce(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}function y5e(r,e,t){return e&&Oce(r.prototype,e),t&&Oce(r,t),r}var w5e=require("buffer"),db=w5e.Buffer,B5e=require("util"),bT=B5e.inspect,b5e=bT&&bT.custom||"inspect";function Q5e(r,e,t){db.prototype.copy.call(r,e,t)}Nce.exports=function(){function r(){I5e(this,r),this.head=null,this.tail=null,this.length=0}return y5e(r,[{key:"push",value:function(t){var i={data:t,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(t){var i={data:t,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=t+i.data;return n}},{key:"concat",value:function(t){if(this.length===0)return db.alloc(0);for(var i=db.allocUnsafe(t>>>0),n=this.head,s=0;n;)Q5e(n.data,i,s),s+=n.data.length,n=n.next;return i}},{key:"consume",value:function(t,i){var n;return t<this.head.data.length?(n=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):t===this.head.data.length?n=this.shift():n=i?this._getString(t):this._getBuffer(t),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var i=this.head,n=1,s=i.data;for(t-=s.length;i=i.next;){var o=i.data,a=t>o.length?o.length:t;if(a===o.length?s+=o:s+=o.slice(0,t),t-=a,t===0){a===o.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(a));break}++n}return this.length-=n,s}},{key:"_getBuffer",value:function(t){var i=db.allocUnsafe(t),n=this.head,s=1;for(n.data.copy(i),t-=n.data.length;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(i,i.length-t,0,a),t-=a,t===0){a===o.length?(++s,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++s}return this.length-=s,i}},{key:b5e,value:function(t,i){return bT(this,E5e({},i,{depth:0,customInspect:!1}))}}]),r}()});var vT=w((Akt,Uce)=>{"use strict";function v5e(r,e){var t=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(QT,this,r)):process.nextTick(QT,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(
`)),r.linkname&&(e+=tO(" linkpath="+r.linkname+`
`));var t=r.pax;if(t)for(var i in t)e+=tO(" "+i+"="+t[i]+`
`);return Buffer.from(e)};hh.decodePax=function(r){for(var e={};r.length;){for(var t=0;t<r.length&&r[t]!==32;)t++;var i=parseInt(r.slice(0,t).toString(),10);if(!i)return e;var n=r.slice(t+1,i-1).toString(),s=n.indexOf("=");if(s===-1)return e;e[n.slice(0,s)]=n.slice(s+1),r=r.slice(i)}return e};hh.encode=function(r){var e=IVe(512),t=r.name,i="";if(r.typeflag===5&&t[t.length-1]!=="/"&&(t+="/"),Buffer.byteLength(t)!==t.length)return null;for(;Buffer.byteLength(t)>100;){var n=t.indexOf("/");if(n===-1)return null;i+=i?"/"+t.slice(0,n):t.slice(0,n),t=t.slice(n+1)}return Buffer.byteLength(t)>100||Buffer.byteLength(i)>155||r.linkname&&Buffer.byteLength(r.linkname)>100?null:(e.write(t),e.write(Kl(r.mode&vVe,6),100),e.write(Kl(r.uid,6),108),e.write(Kl(r.gid,6),116),e.write(Kl(r.size,11),124),e.write(Kl(r.mtime.getTime()/1e3|0,11),136),e[156]=Kue+kVe(r.type),r.linkname&&e.write(r.linkname,157),Hue.copy(e,tE),BVe.copy(e,eO),r.uname&&e.write(r.uname,265),r.gname&&e.write(r.gname,297),e.write(Kl(r.devmajor||0,6),329),e.write(Kl(r.devminor||0,6),337),i&&e.write(i,345),e.write(Kl(Gue(e),6),148),e)};hh.decode=function(r,e,t){var i=r[156]===0?0:r[156]-Kue,n=ph(r,0,100,e),s=Hl(r,100,8),o=Hl(r,108,8),a=Hl(r,116,8),l=Hl(r,124,12),c=Hl(r,136,12),u=xVe(i),g=r[157]===0?null:ph(r,157,100,e),f=ph(r,265,32),h=ph(r,297,32),p=Hl(r,329,8),m=Hl(r,337,8),y=Gue(r);if(y===8*32)return null;if(y!==Hl(r,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(Hue.compare(r,tE,tE+6)===0)r[345]&&(n=ph(r,345,155,e)+"/"+n);else if(!(bVe.compare(r,tE,tE+6)===0&&QVe.compare(r,eO,eO+2)===0)){if(!t)throw new Error("Invalid tar header: unknown format.")}return i===0&&n&&n[n.length-1]==="/"&&(i=5),{name:n,mode:s,uid:o,gid:a,size:l,mtime:new Date(1e3*c),type:u,linkname:g,uname:f,gname:h,devmajor:p,devminor:m}}});var Vue=w((xkt,Yue)=>{var que=require("util"),DVe=Uue(),rE=rO(),Jue=fh().Writable,Wue=fh().PassThrough,zue=function(){},_ue=function(r){return r&=511,r&&512-r},FVe=function(r,e){var t=new Fb(r,e);return t.end(),t},RVe=function(r,e){return e.path&&(r.name=e.path),e.linkpath&&(r.linkname=e.linkpath),e.size&&(r.size=parseInt(e.size,10)),r.pax=e,r},Fb=function(r,e){this._parent=r,this.offset=e,Wue.call(this,{autoDestroy:!1})};que.inherits(Fb,Wue);Fb.prototype.destroy=function(r){this._parent.destroy(r)};var vA=function(r){if(!(this instanceof vA))return new vA(r);Jue.call(this,r),r=r||{},this._offset=0,this._buffer=DVe(),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,t=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=_ue(e._header.size);f?e._parse(f,o):e._parse(512,g),e._locked||i()},o=function(){e._buffer.consume(_ue(e._header.size)),e._parse(512,g),i()},a=function(){var f=e._header.size;e._paxGlobal=rE.decodePax(t.slice(0,f)),t.consume(f),s()},l=function(){var f=e._header.size;e._pax=rE.decodePax(t.slice(0,f)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),t.consume(f),s()},c=function(){var f=e._header.size;this._gnuLongPath=rE.decodeLongPath(t.slice(0,f),r.filenameEncoding),t.consume(f),s()},u=function(){var f=e._header.size;this._gnuLongLinkPath=rE.decodeLongPath(t.slice(0,f),r.filenameEncoding),t.consume(f),s()},g=function(){var f=e._offset,h;try{h=e._header=rE.decode(t.slice(0,512),r.filenameEncoding,r.allowUnknownFormat)}catch(p){e.emit("error",p)}if(t.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=RVe(h,e._pax),e
Wanted: ${t.size}
Found: ${r.length}`);throw a.code="EBADSIZE",a.found=r.length,a.expected=t.size,a.sri=e,a}else{let a=new Error(`Integrity checksum failed when using ${i}: Wanted ${e}, but got ${s}. (${r.length} bytes)`);throw a.code="EINTEGRITY",a.found=s,a.expected=e,a.algorithm=i,a.sri=e,a}}ma.exports.checkStream=u9e;function u9e(r,e,t){t=mn(t);let i=t.Promise||Promise,n=fO(t.concat({integrity:e}));return new i((s,o)=>{r.pipe(n),r.on("error",o),n.on("error",o);let a;n.on("verified",l=>{a=l}),n.on("end",()=>s(a)),n.on("data",()=>{})})}ma.exports.integrityStream=fO;function fO(r){r=mn(r);let e=r.integrity&&Ea(r.integrity,r),t=e&&Object.keys(e).length,i=t&&e.pickAlgorithm(r),n=t&&e[i],s=Array.from(new Set(r.algorithms.concat(i?[i]:[]))),o=s.map(sE.createHash),a=0,l=new t9e({transform(c,u,g){a+=c.length,o.forEach(f=>f.update(c,u)),g(null,c,u)}}).on("end",()=>{let c=r.options&&r.options.length?`?${r.options.join("?")}`:"",u=Ea(o.map((f,h)=>`${s[h]}-${f.digest("base64")}${c}`).join(" "),r),g=t&&u.match(e,r);if(typeof r.size=="number"&&a!==r.size){let f=new Error(`stream size mismatch when checking ${e}.
Wanted: ${r.size}
Found: ${a}`);f.code="EBADSIZE",f.found=a,f.expected=r.size,f.sri=e,l.emit("error",f)}else if(r.integrity&&!g){let f=new Error(`${e} integrity checksum failed when using ${i}: wanted ${n} but got ${u}. (${a} bytes)`);f.code="EINTEGRITY",f.found=u,f.expected=n,f.algorithm=i,f.sri=e,l.emit("error",f)}else l.emit("size",a),l.emit("integrity",u),g&&l.emit("verified",g)});return l}ma.exports.create=g9e;function g9e(r){r=mn(r);let e=r.algorithms,t=r.options.length?`?${r.options.join("?")}`:"",i=e.map(sE.createHash);return{update:function(n,s){return i.forEach(o=>o.update(n,s)),this},digest:function(n){return e.reduce((o,a)=>{let l=i.shift().digest("base64"),c=new Du(`${a}-${l}${t}`,r);if(c.algorithm&&c.digest){let u=c.algorithm;o[u]||(o[u]=[]),o[u].push(c)}return o},new Eh)}}}var f9e=new Set(sE.getHashes()),Ege=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(r=>f9e.has(r));function o9e(r,e){return Ege.indexOf(r.toLowerCase())>=Ege.indexOf(e.toLowerCase())?r:e}});var yC={};pt(yC,{BuildType:()=>ls,Cache:()=>Lt,Configuration:()=>ye,DEFAULT_LOCK_FILENAME:()=>mk,DEFAULT_RC_FILENAME:()=>Ck,FormatType:()=>Ls,InstallMode:()=>pi,LightReport:()=>gA,LinkType:()=>Qt,Manifest:()=>At,MessageName:()=>$,PackageExtensionStatus:()=>Yi,PackageExtensionType:()=>yi,Project:()=>ze,ProjectLookup:()=>al,Report:()=>qi,ReportError:()=>ct,SettingsType:()=>Ee,StreamReport:()=>Je,TAG_REGEXP:()=>Gg,TelemetryManager:()=>IC,ThrowReport:()=>hi,VirtualFetcher:()=>Id,Workspace:()=>EC,WorkspaceResolver:()=>si,YarnVersion:()=>Ur,execUtils:()=>Rr,folderUtils:()=>gk,formatUtils:()=>ce,hashUtils:()=>Fn,httpUtils:()=>rr,miscUtils:()=>Qe,parseMessageName:()=>EI,scriptUtils:()=>Xt,semverUtils:()=>sr,stringifyMessageName:()=>qA,structUtils:()=>P,tgzUtils:()=>wi,treeUtils:()=>As});var Rr={};pt(Rr,{EndStrategy:()=>ns,ExecError:()=>Qk,PipeError:()=>Iw,execvp:()=>Fxe,pipevp:()=>$o});var Xh={};pt(Xh,{AliasFS:()=>Da,CwdFS:()=>zt,DEFAULT_COMPRESSION_LEVEL:()=>ic,FakeFS:()=>HA,Filename:()=>Pt,JailFS:()=>Fa,LazyFS:()=>Wh,LinkStrategy:()=>Hh,NoFS:()=>YE,NodeFS:()=>ar,PortablePath:()=>Ue,PosixFS:()=>zh,ProxiedFS:()=>bi,VirtualFS:()=>Jr,ZipFS:()=>ai,ZipOpenFS:()=>Es,constants:()=>Dr,extendFs:()=>JE,normalizeLineEndings:()=>$l,npath:()=>j,opendir:()=>HE,patchFs:()=>wQ,ppath:()=>k,statUtils:()=>lQ,toFilename:()=>qr,xfs:()=>K});var Dr={};pt(Dr,{SAFE_TIME:()=>AQ,S_IFDIR:()=>xa,S_IFLNK:()=>Pa,S_IFMT:()=>_n,S_IFREG:()=>ka});var _n=61440,xa=16384,ka=32768,Pa=40960,AQ=456789e3;var lQ={};pt(lQ,{BigIntStatsEntry:()=>Mh,DEFAULT_MODE:()=>Oh,DirEntry:()=>AM,StatEntry:()=>UA,areStatsEqual:()=>uQ,clearStats:()=>LE,convertToBigIntStats:()=>NE,makeDefaultStats:()=>Uh,makeEmptyStats:()=>Rfe});var cQ=ge(require("util"));var Oh=ka|420,AM=class{constructor(){this.name="";this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&_n)===xa}isFIFO(){return!1}isFile(){return(this.mode&_n)===ka}isSocket(){return!1}isSymbolicLink(){return(this.mode&_n)===Pa}},UA=class{constructor(){this.uid=0;this.gid=0;this.size=0;this.blksize=0;this.atimeMs=0;this.mtimeMs=0;this.ctimeMs=0;this.birthtimeMs=0;this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=0;this.ino=0;this.mode=Oh;this.nlink=1;this.rdev=0;this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&_n)===xa}isFIFO(){return!1}isFile(){return(this.mode&_n)===ka}isSocket(){return!1}isSymbolicLink(){return(this.mode&_n)===Pa}},Mh=class{constructor(){this.uid=BigInt(0);this.gid=BigInt(0);this.size=BigInt(0);this.blksize=BigInt(0);this.atimeMs=BigInt(0);this.mtimeMs=BigInt(0);this.ctimeMs=BigInt(0);this.birthtimeMs=BigInt(0);this.atimeNs=BigInt(0);this.mtimeNs=BigInt(0);this.ctimeNs=BigInt(0);this.birthtimeNs=BigInt(0);this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=BigInt(0);this.ino=BigInt(0);this.mode=BigInt(Oh);this.nlink=BigInt(1);this.rdev=BigInt(0);this.blocks=BigInt(1)}isB
`)}writeJsonSync(e,t){return this.writeFileSync(e,`${JSON.stringify(t,null,2)}
`)}async preserveTimePromise(e,t){let i=await this.lstatPromise(e),n=await t();typeof n!="undefined"&&(e=n),this.lutimesPromise?await this.lutimesPromise(e,i.atime,i.mtime):i.isSymbolicLink()||await this.utimesPromise(e,i.atime,i.mtime)}async preserveTimeSync(e,t){let i=this.lstatSync(e),n=t();typeof n!="undefined"&&(e=n),this.lutimesSync?this.lutimesSync(e,i.atime,i.mtime):i.isSymbolicLink()||this.utimesSync(e,i.atime,i.mtime)}},ec=class extends HA{constructor(){super(k)}};function Gfe(r){let e=r.match(/\r?\n/g);if(e===null)return CM.EOL;let t=e.filter(n=>n===`\r
`).length,i=e.length-t;return t>i?`\r
`:`
`}function $l(r,e){return e.replace(/\r?\n/g,Gfe(r))}var Ju=ge(require("fs")),CQ=ge(require("stream")),yM=ge(require("util")),mQ=ge(require("zlib"));var mM=ge(require("fs"));var ar=class extends ec{constructor(e=mM.default){super();this.realFs=e,typeof this.realFs.lutimes!="undefined"&&(this.lutimesPromise=this.lutimesPromiseImpl,this.lutimesSync=this.lutimesSyncImpl)}getExtractHint(){return!1}getRealPath(){return Ue.root}resolve(e){return k.resolve(e)}async openPromise(e,t,i){return await new Promise((n,s)=>{this.realFs.open(j.fromPortablePath(e),t,i,this.makeCallback(n,s))})}openSync(e,t,i){return this.realFs.openSync(j.fromPortablePath(e),t,i)}async opendirPromise(e,t){return await new Promise((i,n)=>{typeof t!="undefined"?this.realFs.opendir(j.fromPortablePath(e),t,this.makeCallback(i,n)):this.realFs.opendir(j.fromPortablePath(e),this.makeCallback(i,n))}).then(i=>Object.defineProperty(i,"path",{value:e,configurable:!0,writable:!0}))}opendirSync(e,t){let i=typeof t!="undefined"?this.realFs.opendirSync(j.fromPortablePath(e),t):this.realFs.opendirSync(j.fromPortablePath(e));return Object.defineProperty(i,"path",{value:e,configurable:!0,writable:!0})}async readPromise(e,t,i=0,n=0,s=-1){return await new Promise((o,a)=>{this.realFs.read(e,t,i,n,s,(l,c)=>{l?a(l):o(c)})})}readSync(e,t,i,n,s){return this.realFs.readSync(e,t,i,n,s)}async writePromise(e,t,i,n,s){return await new Promise((o,a)=>typeof t=="string"?this.realFs.write(e,t,i,this.makeCallback(o,a)):this.realFs.write(e,t,i,n,s,this.makeCallback(o,a)))}writeSync(e,t,i,n,s){return typeof t=="string"?this.realFs.writeSync(e,t,i):this.realFs.writeSync(e,t,i,n,s)}async closePromise(e){await new Promise((t,i)=>{this.realFs.close(e,this.makeCallback(t,i))})}closeSync(e){this.realFs.closeSync(e)}createReadStream(e,t){let i=e!==null?j.fromPortablePath(e):e;return this.realFs.createReadStream(i,t)}createWriteStream(e,t){let i=e!==null?j.fromPortablePath(e):e;return this.realFs.createWriteStream(i,t)}async realpathPromise(e){return await new Promise((t,i)=>{this.realFs.realpath(j.fromPortablePath(e),{},this.makeCallback(t,i))}).then(t=>j.toPortablePath(t))}realpathSync(e){return j.toPortablePath(this.realFs.realpathSync(j.fromPortablePath(e),{}))}async existsPromise(e){return await new Promise(t=>{this.realFs.exists(j.fromPortablePath(e),t)})}accessSync(e,t){return this.realFs.accessSync(j.fromPortablePath(e),t)}async accessPromise(e,t){return await new Promise((i,n)=>{this.realFs.access(j.fromPortablePath(e),t,this.makeCallback(i,n))})}existsSync(e){return this.realFs.existsSync(j.fromPortablePath(e))}async statPromise(e,t){return await new Promise((i,n)=>{t?this.realFs.stat(j.fromPortablePath(e),t,this.makeCallback(i,n)):this.realFs.stat(j.fromPortablePath(e),this.makeCallback(i,n))})}statSync(e,t){return t?this.realFs.statSync(j.fromPortablePath(e),t):this.realFs.statSync(j.fromPortablePath(e))}async fstatPromise(e,t){return await new Promise((i,n)=>{t?this.realFs.fstat(e,t,this.makeCallback(i,n)):this.realFs.fstat(e,this.makeCallback(i,n))})}fstatSync(e,t){return t?this.realFs.fstatSync(e,t):this.realFs.fstatSync(e)}async lstatPromise(e,t){return await new Promise((i,n)=>{t?this.realFs.lstat(j.fromPortablePath(e),t,this.makeCallback(i,n)):this.realFs.lstat(j.fromPortablePath(e),this.makeCallback(i,n))})}lstatSync(e,t){return t?this.realFs.lstatSync(j.fromPortablePath(e),t):this.realFs.lstatSync(j.fromPortablePath(e))}async chmodPromise(e,t){return await new Promise((i,n)=>{this.realFs.chmod(j.fromPortablePath(e),t,this.makeCallback(i,n))})}chmodSync(e,t){return this.realFs.chmodSync(j.fromPortablePath(e),t)}async chownPromise(e,t,i){return await new Promise((n,s)=>{this.realFs.chown(j.fromPortablePath(e),t,i,this.makeCallback(n,s))})}chownSync(e,t,i){return this.realFs.chownSync(j.fromPortablePath(e),t,i)}async renamePromise(e,t){return await new Promise((i,n)=>{this.realFs.rename(j.fromPortablePath(e),j.fromPortablePath(t),this.makeCallback(i,n))})}renameSync(e,t){return this.realFs.renameSync(j.fromPortablePath(e),j.fromPortablePath(t))}async copyFilePromise(e,t,i=0){retu
`;if(typeof r=="number"||typeof r=="boolean")return`${r.toString()}
`;if(typeof r=="string")return`${CK(r)}
`;if(Array.isArray(r)){if(r.length===0)return`[]
`;let i=" ".repeat(e);return`
${r.map(s=>`${i}- ${XQ(s,e+1,!1)}`).join("")}`}if(typeof r=="object"&&r){let i,n;r instanceof VQ?(i=r.data,n=!1):(i=r,n=!0);let s=" ".repeat(e),o=Object.keys(i);n&&o.sort((l,c)=>{let u=dK.indexOf(l),g=dK.indexOf(c);return u===-1&&g===-1?l<c?-1:l>c?1:0:u!==-1&&g===-1?-1:u===-1&&g!==-1?1:u-g});let a=o.filter(l=>!mK(i[l])).map((l,c)=>{let u=i[l],g=CK(l),f=XQ(u,e+1,!0),h=c>0||t?s:"";return f.startsWith(`
`)?`${h}${g}:${f}`:`${h}${g}: ${f}`}).join(e===0?`
`:"")||`
`;return t?`
${a}`:`${a}`}throw new Error(`Unsupported value type (${r})`)}function Na(r){try{let e=XQ(r,0,!1);return e!==`
`?e:""}catch(e){throw e.location&&(e.message=e.message.replace(/(\.)?$/,` (line ${e.location.start.line}, column ${e.location.start.column})$1`)),e}}Na.PreserveOrdering=VQ;function nCe(r){return r.endsWith(`
`)||(r+=`
`),(0,pK.parse)(r)}var sCe=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i;function oCe(r){if(sCe.test(r))return nCe(r);let e=(0,cI.safeLoad)(r,{schema:cI.FAILSAFE_SCHEMA,json:!0});if(e==null)return{};if(typeof e!="object")throw new Error(`Expected an indexed object, got a ${typeof e} instead. Does your file follow Yaml's rules?`);if(Array.isArray(e))throw new Error("Expected an indexed object, got an array instead. Does your file follow Yaml's rules?");return e}function Qi(r){return oCe(r)}var lz=ge(IK()),dw=ge(hc());var dp={};pt(dp,{Builtins:()=>gv,Cli:()=>ys,Command:()=>Re,Option:()=>z,UsageError:()=>Pe,formatMarkdownish:()=>Ui});var pc=0,op=1,tn=2,$Q="",vi="\0",sg=-1,ev=/^(-h|--help)(?:=([0-9]+))?$/,uI=/^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/,QK=/^-[a-zA-Z]{2,}$/,tv=/^([^=]+)=([\s\S]*)$/,rv=process.env.DEBUG_CLI==="1";var Pe=class extends Error{constructor(e){super(e);this.clipanion={type:"usage"},this.name="UsageError"}},ap=class extends Error{constructor(e,t){super();if(this.input=e,this.candidates=t,this.clipanion={type:"none"},this.name="UnknownSyntaxError",this.candidates.length===0)this.message="Command not found, but we're not sure what's the alternative.";else if(this.candidates.every(i=>i.reason!==null&&i.reason===t[0].reason)){let[{reason:i}]=this.candidates;this.message=`${i}
${this.candidates.map(({usage:n})=>`$ ${n}`).join(`
`)}`}else if(this.candidates.length===1){let[{usage:i}]=this.candidates;this.message=`Command not found; did you mean:
$ ${i}
${iv(e)}`}else this.message=`Command not found; did you mean one of:
${this.candidates.map(({usage:i},n)=>`${`${n}.`.padStart(4)} ${i}`).join(`
`)}
${iv(e)}`}},nv=class extends Error{constructor(e,t){super();this.input=e,this.usages=t,this.clipanion={type:"none"},this.name="AmbiguousSyntaxError",this.message=`Cannot find which to pick amongst the following alternatives:
${this.usages.map((i,n)=>`${`${n}.`.padStart(4)} ${i}`).join(`
`)}
${iv(e)}`}},iv=r=>`While running ${r.filter(e=>e!==vi).map(e=>{let t=JSON.stringify(e);return e.match(/\s/)||e.length===0||t!==`"${e}"`?t:e}).join(" ")}`;var Ap=Symbol("clipanion/isOption");function rn(r){return ie(L({},r),{[Ap]:!0})}function No(r,e){return typeof r=="undefined"?[r,e]:typeof r=="object"&&r!==null&&!Array.isArray(r)?[void 0,r]:[r,e]}function gI(r,e=!1){let t=r.replace(/^\.: /,"");return e&&(t=t[0].toLowerCase()+t.slice(1)),t}function lp(r,e){return e.length===1?new Pe(`${r}: ${gI(e[0],!0)}`):new Pe(`${r}:
${e.map(t=>`
- ${gI(t)}`).join("")}`)}function cp(r,e,t){if(typeof t=="undefined")return e;let i=[],n=[],s=a=>{let l=e;return e=a,s.bind(null,l)};if(!t(e,{errors:i,coercions:n,coercion:s}))throw lp(`Invalid value for ${r}`,i);for(let[,a]of n)a();return e}var Re=class{constructor(){this.help=!1}static Usage(e){return e}async catch(e){throw e}async validateAndExecute(){let t=this.constructor.schema;if(Array.isArray(t)){let{isDict:n,isUnknown:s,applyCascade:o}=await Promise.resolve().then(()=>(Is(),og)),a=o(n(s()),t),l=[],c=[];if(!a(this,{errors:l,coercions:c}))throw lp("Invalid option schema",l);for(let[,g]of c)g()}else if(t!=null)throw new Error("Invalid command schema");let i=await this.execute();return typeof i!="undefined"?i:0}};Re.isOption=Ap;Re.Default=[];var NK=80,av=Array(NK).fill("\u2501");for(let r=0;r<=24;++r)av[av.length-r]=`[38;5;${232+r}m\u2501`;var Av={header:r=>`\u2501\u2501\u2501 ${r}${r.length<NK-5?` ${av.slice(r.length+5).join("")}`:":"}`,bold:r=>`${r}`,error:r=>`${r}`,code:r=>`${r}`},TK={header:r=>r,bold:r=>r,error:r=>r,code:r=>r};function jCe(r){let e=r.split(`
`),t=e.filter(n=>n.match(/\S/)),i=t.length>0?t.reduce((n,s)=>Math.min(n,s.length-s.trimStart().length),Number.MAX_VALUE):0;return e.map(n=>n.slice(i).trimRight()).join(`
`)}function Ui(r,{format:e,paragraphs:t}){return r=r.replace(/\r\n?/g,`
`),r=jCe(r),r=r.replace(/^\n+|\n+$/g,""),r=r.replace(/^(\s*)-([^\n]*?)\n+/gm,`$1-$2
`),r=r.replace(/\n(\n)?\n*/g,"$1"),t&&(r=r.split(/\n/).map(i=>{let n=i.match(/^\s*[*-][\t ]+(.*)/);if(!n)return i.match(/(.{1,80})(?: |$)/g).join(`
`);let s=i.length-i.trimStart().length;return n[1].match(new RegExp(`(.{1,${78-s}})(?: |$)`,"g")).map((o,a)=>" ".repeat(s)+(a===0?"- ":" ")+o).join(`
`)}).join(`
`)),r=r.replace(/(`+)((?:.|[\n])*?)\1/g,(i,n,s)=>e.code(n+s+n)),r=r.replace(/(\*\*)((?:.|[\n])*?)\1/g,(i,n,s)=>e.bold(n+s+n)),r?`${r}
`:""}var uv=ge(require("tty"));function Bn(r){rv&&console.log(r)}var OK={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:sg};function MK(){return{nodes:[sn(),sn(),sn()]}}function YCe(r){let e=MK(),t=[],i=e.nodes.length;for(let n of r){t.push(i);for(let s=0;s<n.nodes.length;++s)UK(s)||e.nodes.push(GCe(n.nodes[s],i));i+=n.nodes.length-2}for(let n of t)ag(e,pc,n);return e}function so(r,e){return r.nodes.push(e),r.nodes.length-1}function qCe(r){let e=new Set,t=i=>{if(e.has(i))return;e.add(i);let n=r.nodes[i];for(let o of Object.values(n.statics))for(let{to:a}of o)t(a);for(let[,{to:o}]of n.dynamics)t(o);for(let{to:o}of n.shortcuts)t(o);let s=new Set(n.shortcuts.map(({to:o})=>o));for(;n.shortcuts.length>0;){let{to:o}=n.shortcuts.shift(),a=r.nodes[o];for(let[l,c]of Object.entries(a.statics)){let u=Object.prototype.hasOwnProperty.call(n.statics,l)?n.statics[l]:n.statics[l]=[];for(let g of c)u.some(({to:f})=>g.to===f)||u.push(g)}for(let[l,c]of a.dynamics)n.dynamics.some(([u,{to:g}])=>l===u&&c.to===g)||n.dynamics.push([l,c]);for(let l of a.shortcuts)s.has(l.to)||(n.shortcuts.push(l),s.add(l.to))}};t(pc)}function JCe(r,{prefix:e=""}={}){if(rv){Bn(`${e}Nodes are:`);for(let t=0;t<r.nodes.length;++t)Bn(`${e} ${t}: ${JSON.stringify(r.nodes[t])}`)}}function KK(r,e,t=!1){Bn(`Running a vm on ${JSON.stringify(e)}`);let i=[{node:pc,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null}}];JCe(r,{prefix:" "});let n=[$Q,...e];for(let s=0;s<n.length;++s){let o=n[s];Bn(` Processing ${JSON.stringify(o)}`);let a=[];for(let{node:l,state:c}of i){Bn(` Current node is ${l}`);let u=r.nodes[l];if(l===tn){a.push({node:l,state:c});continue}console.assert(u.shortcuts.length===0,"Shortcuts should have been eliminated by now");let g=Object.prototype.hasOwnProperty.call(u.statics,o);if(!t||s<n.length-1||g)if(g){let f=u.statics[o];for(let{to:h,reducer:p}of f)a.push({node:h,state:typeof p!="undefined"?hI(lv,p,c,o):c}),Bn(` Static transition to ${h} found`)}else Bn(" No static transition found");else{let f=!1;for(let h of Object.keys(u.statics))if(!!h.startsWith(o)){if(o===h)for(let{to:p,reducer:m}of u.statics[h])a.push({node:p,state:typeof m!="undefined"?hI(lv,m,c,o):c}),Bn(` Static transition to ${p} found`);else for(let{to:p}of u.statics[h])a.push({node:p,state:ie(L({},c),{remainder:h.slice(o.length)})}),Bn(` Static transition to ${p} found (partial match)`);f=!0}f||Bn(" No partial static transition found")}if(o!==vi)for(let[f,{to:h,reducer:p}]of u.dynamics)hI(pI,f,c,o)&&(a.push({node:h,state:typeof p!="undefined"?hI(lv,p,c,o):c}),Bn(` Dynamic transition to ${h} found (via ${f})`))}if(a.length===0&&o===vi&&e.length===1)return[{node:pc,state:OK}];if(a.length===0)throw new ap(e,i.filter(({node:l})=>l!==tn).map(({state:l})=>({usage:l.candidateUsage,reason:null})));if(a.every(({node:l})=>l===tn))throw new ap(e,a.map(({state:l})=>({usage:l.candidateUsage,reason:l.errorMessage})));i=WCe(a)}if(i.length>0){Bn(" Results:");for(let s of i)Bn(` - ${s.node} -> ${JSON.stringify(s.state)}`)}else Bn(" No results");return i}function zCe(r,e){if(e.selectedIndex!==null)return!0;if(Object.prototype.hasOwnProperty.call(r.statics,vi)){for(let{to:t}of r.statics[vi])if(t===op)return!0}return!1}function VCe(r,e,t){let i=t&&e.length>0?[""]:[],n=KK(r,e,t),s=[],o=new Set,a=(l,c,u=!0)=>{let g=[c];for(;g.length>0;){let h=g;g=[];for(let p of h){let m=r.nodes[p],y=Object.keys(m.statics);for(let Q of Object.keys(m.statics)){let S=y[0];for(let{to:x,reducer:M}of m.statics[S])M==="pushPath"&&(u||l.push(S),g.push(x))}}u=!1}let f=JSON.stringify(l);o.has(f)||(s.push(l),o.add(f))};for(let{node:l,state:c}of n){if(c.remainder!==null){a([c.remainder],l);continue}let u=r.nodes[l],g=zCe(u,c);for(let[f,h]of Object.entries(u.statics))(g&&f!==vi||!f.startsWith("-")&&h.some(({reducer:p})=>p==="pushPath"))&&a([...i,f],l);if(!!g)for(let[f,{to:h}]of u.dynamics){if(h===tn)continue;let p=_
`),this.context.stdout.write(`
`);let t=0;for(let i of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[i].commandClass,{prefix:`${t++}. `.padStart(5)}));this.context.stdout.write(`
`),this.context.stdout.write(`Run again with -h=<index> to see the longer details of any of those commands.
`)}}};var GK=Symbol("clipanion/errorCommand");function eme(){return process.env.FORCE_COLOR==="0"?1:process.env.FORCE_COLOR==="1"||typeof process.stdout!="undefined"&&process.stdout.isTTY?8:1}var ys=class{constructor({binaryLabel:e,binaryName:t="...",binaryVersion:i,enableCapture:n=!1,enableColors:s}={}){this.registrations=new Map,this.builder=new hp({binaryName:t}),this.binaryLabel=e,this.binaryName=t,this.binaryVersion=i,this.enableCapture=n,this.enableColors=s}static from(e,t={}){let i=new ys(t);for(let n of e)i.register(n);return i}register(e){var t;let i=new Map,n=new e;for(let l in n){let c=n[l];typeof c=="object"&&c!==null&&c[Re.isOption]&&i.set(l,c)}let s=this.builder.command(),o=s.cliIndex,a=(t=e.paths)!==null&&t!==void 0?t:n.paths;if(typeof a!="undefined")for(let l of a)s.addPath(l);this.registrations.set(e,{specs:i,builder:s,index:o});for(let[l,{definition:c}]of i.entries())c(s,l);s.setContext({commandClass:e})}process(e){let{contexts:t,process:i}=this.builder.compile(),n=i(e);switch(n.selectedIndex){case sg:return pp.from(n,t);default:{let{commandClass:s}=t[n.selectedIndex],o=this.registrations.get(s);if(typeof o=="undefined")throw new Error("Assertion failed: Expected the command class to have been registered.");let a=new s;a.path=n.path;try{for(let[l,{transformer:c}]of o.specs.entries())a[l]=c(o.builder,l,n);return a}catch(l){throw l[GK]=a,l}}break}}async run(e,t){var i;let n,s=L(L({},ys.defaultContext),t),o=(i=this.enableColors)!==null&&i!==void 0?i:s.colorDepth>1;if(!Array.isArray(e))n=e;else try{n=this.process(e)}catch(c){return s.stdout.write(this.error(c,{colored:o})),1}if(n.help)return s.stdout.write(this.usage(n,{colored:o,detailed:!0})),0;n.context=s,n.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableCapture:this.enableCapture,enableColors:this.enableColors,definitions:()=>this.definitions(),error:(c,u)=>this.error(c,u),format:c=>this.format(c),process:c=>this.process(c),run:(c,u)=>this.run(c,L(L({},s),u)),usage:(c,u)=>this.usage(c,u)};let a=this.enableCapture?tme(s):YK,l;try{l=await a(()=>n.validateAndExecute().catch(c=>n.catch(c).then(()=>0)))}catch(c){return s.stdout.write(this.error(c,{colored:o,command:n})),1}return l}async runExit(e,t){process.exitCode=await this.run(e,t)}suggest(e,t){let{suggest:i}=this.builder.compile();return i(e,t)}definitions({colored:e=!1}={}){let t=[];for(let[i,{index:n}]of this.registrations){if(typeof i.usage=="undefined")continue;let{usage:s}=this.getUsageByIndex(n,{detailed:!1}),{usage:o,options:a}=this.getUsageByIndex(n,{detailed:!0,inlineOptions:!1}),l=typeof i.usage.category!="undefined"?Ui(i.usage.category,{format:this.format(e),paragraphs:!1}):void 0,c=typeof i.usage.description!="undefined"?Ui(i.usage.description,{format:this.format(e),paragraphs:!1}):void 0,u=typeof i.usage.details!="undefined"?Ui(i.usage.details,{format:this.format(e),paragraphs:!0}):void 0,g=typeof i.usage.examples!="undefined"?i.usage.examples.map(([f,h])=>[Ui(f,{format:this.format(e),paragraphs:!1}),h.replace(/\$0/g,this.binaryName)]):void 0;t.push({path:s,usage:o,category:l,description:c,details:u,examples:g,options:a})}return t}usage(e=null,{colored:t,detailed:i=!1,prefix:n="$ "}={}){var s;if(e===null){for(let l of this.registrations.keys()){let c=l.paths,u=typeof l.usage!="undefined";if(!c||c.length===0||c.length===1&&c[0].length===0||((s=c==null?void 0:c.some(h=>h.length===0))!==null&&s!==void 0?s:!1))if(e){e=null;break}else e=l;else if(u){e=null;continue}}e&&(i=!0)}let o=e!==null&&e instanceof Re?e.constructor:e,a="";if(o)if(i){let{description:l="",details:c="",examples:u=[]}=o.usage||{};l!==""&&(a+=Ui(l,{format:this.format(t),paragraphs:!1}).replace(/^./,h=>h.toUpperCase()),a+=`
`),(c!==""||u.length>0)&&(a+=`${this.format(t).header("Usage")}
`,a+=`
`);let{usage:g,options:f}=this.getUsageByRegistration(o,{inlineOptions:!1});if(a+=`${this.format(t).bold(n)}${g}
`,f.length>0){a+=`
`,a+=`${Av.header("Options")}
`;let h=f.reduce((p,m)=>Math.max(p,m.definition.length),0);a+=`
`;for(let{definition:p,description:m}of f)a+=` ${this.format(t).bold(p.padEnd(h))} ${Ui(m,{format:this.format(t),paragraphs:!1})}`}if(c!==""&&(a+=`
`,a+=`${this.format(t).header("Details")}
`,a+=`
`,a+=Ui(c,{format:this.format(t),paragraphs:!0})),u.length>0){a+=`
`,a+=`${this.format(t).header("Examples")}
`;for(let[h,p]of u)a+=`
`,a+=Ui(h,{format:this.format(t),paragraphs:!1}),a+=`${p.replace(/^/m,` ${this.format(t).bold(n)}`).replace(/\$0/g,this.binaryName)}
`}}else{let{usage:l}=this.getUsageByRegistration(o);a+=`${this.format(t).bold(n)}${l}
`}else{let l=new Map;for(let[f,{index:h}]of this.registrations.entries()){if(typeof f.usage=="undefined")continue;let p=typeof f.usage.category!="undefined"?Ui(f.usage.category,{format:this.format(t),paragraphs:!1}):null,m=l.get(p);typeof m=="undefined"&&l.set(p,m=[]);let{usage:y}=this.getUsageByIndex(h);m.push({commandClass:f,usage:y})}let c=Array.from(l.keys()).sort((f,h)=>f===null?-1:h===null?1:f.localeCompare(h,"en",{usage:"sort",caseFirst:"upper"})),u=typeof this.binaryLabel!="undefined",g=typeof this.binaryVersion!="undefined";u||g?(u&&g?a+=`${this.format(t).header(`${this.binaryLabel} - ${this.binaryVersion}`)}
`:u?a+=`${this.format(t).header(`${this.binaryLabel}`)}
`:a+=`${this.format(t).header(`${this.binaryVersion}`)}
`,a+=` ${this.format(t).bold(n)}${this.binaryName} <command>
`):a+=`${this.format(t).bold(n)}${this.binaryName} <command>
`;for(let f of c){let h=l.get(f).slice().sort((m,y)=>m.usage.localeCompare(y.usage,"en",{usage:"sort",caseFirst:"upper"})),p=f!==null?f.trim():"General commands";a+=`
`,a+=`${this.format(t).header(`${p}`)}
`;for(let{commandClass:m,usage:y}of h){let Q=m.usage.description||"undocumented";a+=`
`,a+=` ${this.format(t).bold(y)}
`,a+=` ${Ui(Q,{format:this.format(t),paragraphs:!1})}`}}a+=`
`,a+=Ui("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(t),paragraphs:!0})}return a}error(e,t){var i,{colored:n,command:s=(i=e[GK])!==null&&i!==void 0?i:null}=t===void 0?{}:t;e instanceof Error||(e=new Error(`Execution failed with a non-error rejection (rejected value: ${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}
`;let l=e.clipanion;return typeof l!="undefined"?l.type==="usage"&&(o+=`
`,o+=this.usage(s)):e.stack&&(o+=`${e.stack.replace(/^.*\n/,"")}
`),o}format(e){var t;return((t=e!=null?e:this.enableColors)!==null&&t!==void 0?t:ys.defaultContext.colorDepth>1)?Av:TK}getUsageByRegistration(e,t){let i=this.registrations.get(e);if(typeof i=="undefined")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(i.index,t)}getUsageByIndex(e,t){return this.builder.getBuilderByIndex(e).usage(t)}};ys.defaultContext={stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:"getColorDepth"in uv.default.WriteStream.prototype?uv.default.WriteStream.prototype.getColorDepth():eme()};var qK;function tme(r){let e=qK;if(typeof e=="undefined"){if(r.stdout===process.stdout&&r.stderr===process.stderr)return YK;let{AsyncLocalStorage:t}=require("async_hooks");e=qK=new t;let i=process.stdout._write;process.stdout._write=function(s,o,a){let l=e.getStore();return typeof l=="undefined"?i.call(this,s,o,a):l.stdout.write(s,o,a)};let n=process.stderr._write;process.stderr._write=function(s,o,a){let l=e.getStore();return typeof l=="undefined"?n.call(this,s,o,a):l.stderr.write(s,o,a)}}return t=>e.run(r,t)}function YK(r){return r()}var gv={};pt(gv,{DefinitionsCommand:()=>dI,HelpCommand:()=>CI,VersionCommand:()=>mI});var dI=class extends Re{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)}
`)}};dI.paths=[["--clipanion=definitions"]];var CI=class extends Re{async execute(){this.context.stdout.write(this.cli.usage())}};CI.paths=[["-h"],["--help"]];var mI=class extends Re{async execute(){var e;this.context.stdout.write(`${(e=this.cli.binaryVersion)!==null&&e!==void 0?e:"<unknown>"}
`)}};mI.paths=[["-v"],["--version"]];var z={};pt(z,{Array:()=>JK,Boolean:()=>WK,Counter:()=>zK,Proxy:()=>_K,Rest:()=>VK,String:()=>XK,applyValidator:()=>cp,cleanValidationError:()=>gI,formatError:()=>lp,isOptionSymbol:()=>Ap,makeCommandOption:()=>rn,rerouteArguments:()=>No});function JK(r,e,t){let[i,n]=No(e,t!=null?t:{}),{arity:s=1}=n,o=r.split(","),a=new Set(o);return rn({definition(l){l.addOption({names:o,arity:s,hidden:n==null?void 0:n.hidden,description:n==null?void 0:n.description,required:n.required})},transformer(l,c,u){let g=typeof i!="undefined"?[...i]:void 0;for(let{name:f,value:h}of u.options)!a.has(f)||(g=g!=null?g:[],g.push(h));return g}})}function WK(r,e,t){let[i,n]=No(e,t!=null?t:{}),s=r.split(","),o=new Set(s);return rn({definition(a){a.addOption({names:s,allowBinding:!1,arity:0,hidden:n.hidden,description:n.description,required:n.required})},transformer(a,l,c){let u=i;for(let{name:g,value:f}of c.options)!o.has(g)||(u=f);return u}})}function zK(r,e,t){let[i,n]=No(e,t!=null?t:{}),s=r.split(","),o=new Set(s);return rn({definition(a){a.addOption({names:s,allowBinding:!1,arity:0,hidden:n.hidden,description:n.description,required:n.required})},transformer(a,l,c){let u=i;for(let{name:g,value:f}of c.options)!o.has(g)||(u!=null||(u=0),f?u+=1:u=0);return u}})}function _K(r={}){return rn({definition(e,t){var i;e.addProxy({name:(i=r.name)!==null&&i!==void 0?i:t,required:r.required})},transformer(e,t,i){return i.positionals.map(({value:n})=>n)}})}function VK(r={}){return rn({definition(e,t){var i;e.addRest({name:(i=r.name)!==null&&i!==void 0?i:t,required:r.required})},transformer(e,t,i){let n=o=>{let a=i.positionals[o];return a.extra===Xn||a.extra===!1&&o<e.arity.leading.length},s=0;for(;s<i.positionals.length&&n(s);)s+=1;return i.positionals.splice(0,s).map(({value:o})=>o)}})}function rme(r,e,t){let[i,n]=No(e,t!=null?t:{}),{arity:s=1}=n,o=r.split(","),a=new Set(o);return rn({definition(l){l.addOption({names:o,arity:n.tolerateBoolean?0:s,hidden:n.hidden,description:n.description,required:n.required})},transformer(l,c,u){let g,f=i;for(let{name:h,value:p}of u.options)!a.has(h)||(g=h,f=p);return typeof f=="string"?cp(g!=null?g:c,f,n.validator):f}})}function ime(r={}){let{required:e=!0}=r;return rn({definition(t,i){var n;t.addPositional({name:(n=r.name)!==null&&n!==void 0?n:i,required:r.required})},transformer(t,i,n){var s;for(let o=0;o<n.positionals.length;++o){if(n.positionals[o].extra===Xn||e&&n.positionals[o].extra===!0||!e&&n.positionals[o].extra===!1)continue;let[a]=n.positionals.splice(o,1);return cp((s=r.name)!==null&&s!==void 0?s:i,a.value,r.validator)}}})}function XK(r,...e){return typeof r=="string"?rme(r,...e):ime(r)}var cz=ge(Cp()),dk=ge(require("stream"));var $;(function(se){se[se.UNNAMED=0]="UNNAMED",se[se.EXCEPTION=1]="EXCEPTION",se[se.MISSING_PEER_DEPENDENCY=2]="MISSING_PEER_DEPENDENCY",se[se.CYCLIC_DEPENDENCIES=3]="CYCLIC_DEPENDENCIES",se[se.DISABLED_BUILD_SCRIPTS=4]="DISABLED_BUILD_SCRIPTS",se[se.BUILD_DISABLED=5]="BUILD_DISABLED",se[se.SOFT_LINK_BUILD=6]="SOFT_LINK_BUILD",se[se.MUST_BUILD=7]="MUST_BUILD",se[se.MUST_REBUILD=8]="MUST_REBUILD",se[se.BUILD_FAILED=9]="BUILD_FAILED",se[se.RESOLVER_NOT_FOUND=10]="RESOLVER_NOT_FOUND",se[se.FETCHER_NOT_FOUND=11]="FETCHER_NOT_FOUND",se[se.LINKER_NOT_FOUND=12]="LINKER_NOT_FOUND",se[se.FETCH_NOT_CACHED=13]="FETCH_NOT_CACHED",se[se.YARN_IMPORT_FAILED=14]="YARN_IMPORT_FAILED",se[se.REMOTE_INVALID=15]="REMOTE_INVALID",se[se.REMOTE_NOT_FOUND=16]="REMOTE_NOT_FOUND",se[se.RESOLUTION_PACK=17]="RESOLUTION_PACK",se[se.CACHE_CHECKSUM_MISMATCH=18]="CACHE_CHECKSUM_MISMATCH",se[se.UNUSED_CACHE_ENTRY=19]="UNUSED_CACHE_ENTRY",se[se.MISSING_LOCKFILE_ENTRY=20]="MISSING_LOCKFILE_ENTRY",se[se.WORKSPACE_NOT_FOUND=21]="WORKSPACE_NOT_FOUND",se[se.TOO_MANY_MATCHING_WORKSPACES=22]="TOO_MANY_MATCHING_WORKSPACES",se[se.CONSTRAINTS_MISSING_DEPENDENCY=23]="CONSTRAINTS_MISSING_DEPENDENCY",se[se.CONSTRAINTS_INCOMPATIBLE_DEPENDENCY=24]="CONSTRAINTS_INCOMPATIBLE_DEPENDENCY",se[se.CONSTRAINTS_EXTRANEOUS_DEPENDENCY=25]="CONSTRAINTS_EXTRANEOUS_DEPENDENCY",se[se.CONSTRAINTS_INVALID_DEPENDENCY=26]=
`),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}),t.on("end",()=>{let s=i.end();s!==""&&(e!==null?this.reportInfo(null,`${e} ${s}`):this.reportInfo(null,s))}),t}};var lk=class{constructor(e){this.fetchers=e}supports(e,t){return!!this.tryFetcher(e,t)}getLocalPath(e,t){return this.getFetcher(e,t).getLocalPath(e,t)}async fetch(e,t){return await this.getFetcher(e,t).fetch(e,t)}tryFetcher(e,t){let i=this.fetchers.find(n=>n.supports(e,t));return i||null}getFetcher(e,t){let i=this.fetchers.find(n=>n.supports(e,t));if(!i)throw new ct($.FETCHER_NOT_FOUND,`${Bt(t.project.configuration,e)} isn't supported by any available fetcher`);return i}};var Ed=class{constructor(e){this.resolvers=e.filter(t=>t)}supportsDescriptor(e,t){return!!this.tryResolverByDescriptor(e,t)}supportsLocator(e,t){return!!this.tryResolverByLocator(e,t)}shouldPersistResolution(e,t){return this.getResolverByLocator(e,t).shouldPersistResolution(e,t)}bindDescriptor(e,t,i){return this.getResolverByDescriptor(e,i).bindDescriptor(e,t,i)}getResolutionDependencies(e,t){return this.getResolverByDescriptor(e,t).getResolutionDependencies(e,t)}async getCandidates(e,t,i){return await this.getResolverByDescriptor(e,i).getCandidates(e,t,i)}async getSatisfying(e,t,i){return this.getResolverByDescriptor(e,i).getSatisfying(e,t,i)}async resolve(e,t){return await this.getResolverByLocator(e,t).resolve(e,t)}tryResolverByDescriptor(e,t){let i=this.resolvers.find(n=>n.supportsDescriptor(e,t));return i||null}getResolverByDescriptor(e,t){let i=this.resolvers.find(n=>n.supportsDescriptor(e,t));if(!i)throw new Error(`${nr(t.project.configuration,e)} isn't supported by any available resolver`);return i}tryResolverByLocator(e,t){let i=this.resolvers.find(n=>n.supportsLocator(e,t));return i||null}getResolverByLocator(e,t){let i=this.resolvers.find(n=>n.supportsLocator(e,t));if(!i)throw new Error(`${Bt(t.project.configuration,e)} isn't supported by any available resolver`);return i}};var oz=ge(ti());var Gg=/^(?!v)[a-z0-9._-]+$/i,ck=class{supportsDescriptor(e,t){return!!(po(e.range)||Gg.test(e.range))}supportsLocator(e,t){return!!(oz.default.valid(e.reference)||Gg.test(e.reference))}shouldPersistResolution(e,t){return t.resolver.shouldPersistResolution(this.forwardLocator(e,t),t)}bindDescriptor(e,t,i){return i.resolver.bindDescriptor(this.forwardDescriptor(e,i),t,i)}getResolutionDependencies(e,t){return t.resolver.getResolutionDependencies(this.forwardDescriptor(e,t),t)}async getCandidates(e,t,i){return await i.resolver.getCandidates(this.forwardDescriptor(e,i),t,i)}async getSatisfying(e,t,i){return await i.resolver.getSatisfying(this.forwardDescriptor(e,i),t,i)}async resolve(e,t){let i=await t.resolver.resolve(this.forwardLocator(e,t),t);return ad(i,e)}forwardDescriptor(e,t){return tr(e,`${t.project.configuration.get("defaultProtocol")}${e.range}`)}forwardLocator(e,t){return cn(e,`${t.project.configuration.get("defaultProtocol")}${e.reference}`)}};var Id=class{supports(e){return!!e.reference.startsWith("virtual:")}getLocalPath(e,t){let i=e.reference.indexOf("#");if(i===-1)throw new Error("Invalid virtual package reference");let n=e.reference.slice(i+1),s=cn(e,n);return t.fetcher.getLocalPath(s,t)}async fetch(e,t){let i=e.reference.indexOf("#");if(i===-1)throw new Error("Invalid virtual package reference");let n=e.reference.slice(i+1),s=cn(e,n),o=await t.fetcher.fetch(s,t);return await this.ensureVirtualLink(e,o,t)}getLocatorFilename(e){return Hg(e)}async ensureVirtualLink(e,t,i){let n=t.packageFs.getRealPath(),s=i.project.configuration.get("virtualFolder"),o=this.getLocatorFilename(e),a=Jr.makeVirtualPath(s,o,n),l=new Da(a,{baseFs:t.packageFs,pathUtils:k});return ie(L({},t),{packageFs:l})}};var Yg=class{static isVirtualDescriptor(e){return!!e.range.startsWith(Yg.protocol)}static isVirtualLocator(e){return!!e.reference.startsWith(Yg.protocol)}supportsDescriptor(e,t){return Yg.isVirtualDescriptor(e)}supportsLocator(e,t){return Yg.isVirtualLocator(e)}shouldPersistResolution(e,t){return!1}bindDescriptor(e
`);return{stdout:s,stderr:o}}makeResolver(){let e=[];for(let t of this.plugins.values())for(let i of t.resolvers||[])e.push(new i);return new Ed([new pw,new si,new ck,...e])}makeFetcher(){let e=[];for(let t of this.plugins.values())for(let i of t.fetchers||[])e.push(new i);return new lk([new Id,new uk,...e])}getLinkers(){let e=[];for(let t of this.plugins.values())for(let i of t.linkers||[])e.push(new i);return e}getSupportedArchitectures(){let e=this.get("supportedArchitectures"),t=e.get("os");t!==null&&(t=t.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:t,cpu:i}}async refreshPackageExtensions(){this.packageExtensions=new Map;let e=this.packageExtensions,t=(i,n,{userProvided:s=!1}={})=>{if(!po(i.range))throw new Error("Only semver ranges are allowed as keys for the packageExtensions setting");let o=new At;o.load(n,{yamlCompatibilityMode:!0});let a=xg(e,i.identHash),l=[];a.push([i.range,l]);let c={status:Yi.Inactive,userProvided:s,parentDescriptor:i};for(let u of o.dependencies.values())l.push(ie(L({},c),{type:yi.Dependency,descriptor:u}));for(let u of o.peerDependencies.values())l.push(ie(L({},c),{type:yi.PeerDependency,descriptor:u}));for(let[u,g]of o.peerDependenciesMeta)for(let[f,h]of Object.entries(g))l.push(ie(L({},c),{type:yi.PeerDependencyMeta,selector:u,key:f,value:h}))};await this.triggerHook(i=>i.registerPackageExtensions,this,t);for(let[i,n]of this.get("packageExtensions"))t(sl(i,!0),xy(n),{userProvided:!0})}normalizePackage(e){let t=Ad(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(!!Kc(s,o))for(let l of a)switch(l.status===Yi.Inactive&&(l.status=Yi.Redundant),l.type){case yi.Dependency:typeof t.dependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=Yi.Active,t.dependencies.set(l.descriptor.identHash,l.descriptor));break;case yi.PeerDependency:typeof t.peerDependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=Yi.Active,t.peerDependencies.set(l.descriptor.identHash,l.descriptor));break;case yi.PeerDependencyMeta:{let c=t.peerDependenciesMeta.get(l.selector);(typeof c=="undefined"||!Object.prototype.hasOwnProperty.call(c,l.key)||c[l.key]!==l.value)&&(l.status=Yi.Active,Ja(t.peerDependenciesMeta,l.selector,()=>({}))[l.key]=l.value)}break;default:TS(l);break}}}let n=s=>s.scope?`${s.scope}__${s.name}`:`${s.name}`;for(let s of t.peerDependenciesMeta.keys()){let o=An(s);t.peerDependencies.has(o.identHash)||t.peerDependencies.set(o.identHash,tr(o,"*"))}for(let s of t.peerDependencies.values()){if(s.scope==="types")continue;let o=n(s),a=Vo("types",o),l=Ot(a);t.peerDependencies.has(a.identHash)||t.peerDependenciesMeta.has(l)||(t.peerDependencies.set(a.identHash,tr(a,"*")),t.peerDependenciesMeta.set(l,{optional:!0}))}return t.dependencies=new Map(Pn(t.dependencies,([,s])=>Dn(s))),t.peerDependencies=new Map(Pn(t.peerDependencies,([,s])=>Dn(s))),t}getLimit(e){return Ja(this.limits,e,()=>(0,cz.default)(this.get(e)))}async triggerHook(e,...t){for(let i of this.plugins.values()){let n=i.hooks;if(!n)continue;let s=e(n);!s||await s(...t)}}async triggerMultipleHooks(e,t){for(let i of t)await this.triggerHook(e,...i)}async reduceHook(e,t,...i){let n=t;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,...t){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(...t);if(typeof o!="undefined")return o}return null}},ye=Za;ye.telemetry=null;var ns;(function(i){i[i.Never=0]="Never",i[i.ErrorCode=1]="ErrorCode",i[i.Always=2]="Always"})(ns||(ns={}));var Iw=class extends ct{constructor({fileName:e,code:t,signal:i}){let n=ye.create(k.cwd()),s=et(n,e,Ge.PATH);super($.EXCEPTION,`Child ${s} reported an error`,o=>{Dxe(t,i,{configuration:n,report:o})});this.code=bk(t,i)}},Qk=class extends Iw{constructor({fileName:e,code:t,si
`),c(127);break;case"EACCES":n[2].write(`permission denied: ${r}
`),c(128);break;default:n[2].write(`uncaught error: ${u.message}
`),c(1);break}}),l.on("exit",u=>{Jc.delete(l),Jc.size===0&&(process.off("SIGINT",XP),process.off("SIGTERM",ZP)),c(u!==null?u:129)})})}}}function g5(r){return e=>{let t=e[0]==="pipe"?new ta.PassThrough:e[0];return{stdin:t,promise:Promise.resolve().then(()=>r({stdin:t,stdout:e[1],stderr:e[2]}))}}}var mo=class{constructor(e){this.stream=e}close(){}get(){return this.stream}},f5=class{constructor(){this.stream=null}close(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");this.stream.end()}attach(e){this.stream=e}get(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");return this.stream}},Ld=class{constructor(e,t){this.stdin=null;this.stdout=null;this.stderr=null;this.pipe=null;this.ancestor=e,this.implementation=t}static start(e,{stdin:t,stdout:i,stderr:n}){let s=new Ld(null,e);return s.stdin=t,s.stdout=i,s.stderr=n,s}pipeTo(e,t=1){let i=new Ld(this,e),n=new f5;return i.pipe=n,i.stdout=this.stdout,i.stderr=this.stderr,(t&1)==1?this.stdout=n:this.ancestor!==null&&(this.stderr=this.ancestor.stdout),(t&2)==2?this.stderr=n:this.ancestor!==null&&(this.stderr=this.ancestor.stderr),i}async exec(){let e=["ignore","ignore","ignore"];if(this.pipe)e[0]="pipe";else{if(this.stdin===null)throw new Error("Assertion failed: No input stream registered");e[0]=this.stdin.get()}let t;if(this.stdout===null)throw new Error("Assertion failed: No output stream registered");t=this.stdout,e[1]=t.get();let i;if(this.stderr===null)throw new Error("Assertion failed: No error stream registered");i=this.stderr,e[2]=i.get();let n=this.implementation(e);return this.pipe&&this.pipe.attach(n.stdin),await n.promise.then(s=>(t.close(),i.close(),s))}async run(){let e=[];for(let i=this;i;i=i.ancestor)e.push(i.exec());return(await Promise.all(e))[0]}};function qw(r,e){return Ld.start(r,e)}function h5(r,e=null){let t=new ta.PassThrough,i=new c5.StringDecoder,n="";return t.on("data",s=>{let o=i.write(s),a;do if(a=o.indexOf(`
`),a!==-1){let l=n+o.substr(0,a);o=o.substr(a+1),n="",r(e!==null?`${e} ${l}`:l)}while(a!==-1);n+=o}),t.on("end",()=>{let s=i.end();s!==""&&r(e!==null?`${e} ${s}`:s)}),t}function p5(r,{prefix:e}){return{stdout:h5(t=>r.stdout.write(`${t}
`),r.stdout.isTTY?e:null),stderr:h5(t=>r.stderr.write(`${t}
`),r.stderr.isTTY?e:null)}}var zDe=(0,m5.promisify)(setTimeout);var Wi;(function(t){t[t.Readable=1]="Readable",t[t.Writable=2]="Writable"})(Wi||(Wi={}));function E5(r,e,t){let i=new ss.PassThrough({autoDestroy:!0});switch(r){case Ln.STDIN:(e&1)==1&&t.stdin.pipe(i,{end:!1}),(e&2)==2&&t.stdin instanceof ss.Writable&&i.pipe(t.stdin,{end:!1});break;case Ln.STDOUT:(e&1)==1&&t.stdout.pipe(i,{end:!1}),(e&2)==2&&i.pipe(t.stdout,{end:!1});break;case Ln.STDERR:(e&1)==1&&t.stderr.pipe(i,{end:!1}),(e&2)==2&&i.pipe(t.stderr,{end:!1});break;default:throw new Ms(`Bad file descriptor: "${r}"`)}return i}function Jw(r,e={}){let t=L(L({},r),e);return t.environment=L(L({},r.environment),e.environment),t.variables=L(L({},r.variables),e.variables),t}var _De=new Map([["cd",async([r=(0,C5.homedir)(),...e],t,i)=>{let n=k.resolve(i.cwd,j.toPortablePath(r));if(!(await t.baseFs.statPromise(n).catch(o=>{throw o.code==="ENOENT"?new Ms(`cd: no such file or directory: ${r}`):o})).isDirectory())throw new Ms(`cd: not a directory: ${r}`);return i.cwd=n,0}],["pwd",async(r,e,t)=>(t.stdout.write(`${j.fromPortablePath(t.cwd)}
`),0)],[":",async(r,e,t)=>0],["true",async(r,e,t)=>0],["false",async(r,e,t)=>1],["exit",async([r,...e],t,i)=>i.exitCode=parseInt(r!=null?r:i.variables["?"],10)],["echo",async(r,e,t)=>(t.stdout.write(`${r.join(" ")}
`),0)],["sleep",async([r],e,t)=>{if(typeof r=="undefined")throw new Ms("sleep: missing operand");let i=Number(r);if(Number.isNaN(i))throw new Ms(`sleep: invalid time interval '${r}'`);return await zDe(1e3*i,0)}],["__ysh_run_procedure",async(r,e,t)=>{let i=t.procedures[r[0]];return await qw(i,{stdin:new mo(t.stdin),stdout:new mo(t.stdout),stderr:new mo(t.stderr)}).run()}],["__ysh_set_redirects",async(r,e,t)=>{let i=t.stdin,n=t.stdout,s=t.stderr,o=[],a=[],l=[],c=0;for(;r[c]!=="--";){let g=r[c++],{type:f,fd:h}=JSON.parse(g),p=S=>{switch(h){case null:case 0:o.push(S);break;default:throw new Error(`Unsupported file descriptor: "${h}"`)}},m=S=>{switch(h){case null:case 1:a.push(S);break;case 2:l.push(S);break;default:throw new Error(`Unsupported file descriptor: "${h}"`)}},y=Number(r[c++]),Q=c+y;for(let S=c;S<Q;++c,++S)switch(f){case"<":p(()=>e.baseFs.createReadStream(k.resolve(t.cwd,j.toPortablePath(r[S]))));break;case"<<<":p(()=>{let x=new ss.PassThrough;return process.nextTick(()=>{x.write(`${r[S]}
`),x.end()}),x});break;case"<&":p(()=>E5(Number(r[S]),1,t));break;case">":case">>":{let x=k.resolve(t.cwd,j.toPortablePath(r[S]));m(x==="/dev/null"?new ss.Writable({autoDestroy:!0,emitClose:!0,write(M,q,U){setImmediate(U)}}):e.baseFs.createWriteStream(x,f===">>"?{flags:"a"}:void 0))}break;case">&":m(E5(Number(r[S]),2,t));break;default:throw new Error(`Assertion failed: Unsupported redirection type: "${f}"`)}}if(o.length>0){let g=new ss.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 ss.PassThrough;n=g;for(let f of a)g.pipe(f)}if(l.length>0){let g=new ss.PassThrough;s=g;for(let f of l)g.pipe(f)}let u=await qw(Td(r.slice(c+1),e,t),{stdin:new mo(i),stdout:new mo(n),stderr:new mo(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 VDe(r,e,t){let i=[],n=new ss.PassThrough;return n.on("data",s=>i.push(s)),await Ww(r,e,Jw(t,{stdout:n})),Buffer.concat(i).toString().replace(/[\r\n]+$/,"")}async function I5(r,e,t){let i=r.map(async s=>{let o=await nA(s.args,e,t);return{name:s.name,value:o.join(" ")}});return(await Promise.all(i)).reduce((s,o)=>(s[o.name]=o.value,s),{})}function zw(r){return r.match(/[^ \r\n\t]+/g)||[]}async function y5(r,e,t,i,n=i){switch(r.name){case"$":i(String(process.pid));break;case"#":i(String(e.args.length));break;case"@":if(r.quoted)for(let s of e.args)n(s);else for(let s of e.args){let o=zw(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(r.quoted)i(s);else for(let o of zw(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(r.name,10),o;if(Number.isFinite(s))if(s>=0&&s<e.args.length)o=e.args[s];else if(r.defaultValue)o=(await nA(r.defaultValue,e,t)).join(" ");else if(r.alternativeValue)o=(await nA(r.alternativeValue,e,t)).join(" ");else throw new Ms(`Unbound argument #${s}`);else if(Object.prototype.hasOwnProperty.call(t.variables,r.name))o=t.variables[r.name];else if(Object.prototype.hasOwnProperty.call(t.environment,r.name))o=t.environment[r.name];else if(r.defaultValue)o=(await nA(r.defaultValue,e,t)).join(" ");else throw new Ms(`Unbound variable "${r.name}"`);if(typeof o!="undefined"&&r.alternativeValue&&(o=(await nA(r.alternativeValue,e,t)).join(" ")),r.quoted)i(o);else{let a=zw(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 XDe={addition:(r,e)=>r+e,subtraction:(r,e)=>r-e,multiplication:(r,e)=>r*e,division:(r,e)=>Math.trunc(r/e)};async function Od(r,e,t){if(r.type==="number"){if(Number.isInteger(r.value))return r.value;throw new Error(`Invalid number: "${r.value}", only integers are allowed`)}else if(r.type==="variable"){let i=[];await y5(ie(L({},r),{quoted:!0}),e,t,s=>i.push(s));let n=Number(i.join(" "));return Number.isNaN(n)?Od({type:"variable",name:i.join(" ")},e,t):Od({type:"number",value:n},e,t)}else return XDe[r.type](await Od(r.left,e,t),await Od(r.right,e,t))}async function nA(r,e,t){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 r){let g=!1;switch(u.type){case"redirection":{let f=await nA(u.args,e,t);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 VDe(f.shell,e,t);if(f.quoted)o(h);else{let p=zw(h);for(let m=0;m<p.length-1;++m)l(p[m]);o(p[p.length-1])}}break;case"variable":await y5(f,e,t,o,l);break;case"arithmetic":o(String(await Od(f.arithmetic,e,t)));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.ma
`)).finally(()=>{t.stdout.isTTY&&t.stdout.write(`Job ${l}, '${o(Vu(r))}' has ended
`)})),0}return await B5(r,e,t)}async function tFe(r,e,t,{background:i=!1}={}){let n,s=a=>{n=a,t.variables["?"]=String(a)},o=async a=>{try{return await eFe(a.chain,e,t,{background:i&&typeof a.then=="undefined"})}catch(l){if(!(l instanceof Ms))throw l;return t.stderr.write(`${l.message}
`),1}};for(s(await o(r));r.then;){if(t.exitCode!==null)return t.exitCode;switch(r.then.type){case"&&":n===0&&s(await o(r.then.line));break;case"||":n!==0&&s(await o(r.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: "${r.then.type}"`)}r=r.then.line}return n}async function Ww(r,e,t){let i=t.backgroundJobs;t.backgroundJobs=[];let n=0;for(let{command:s,type:o}of r){if(n=await tFe(s,e,t,{background:o==="&"}),t.exitCode!==null)return t.exitCode;t.variables["?"]=String(n)}return await Promise.all(t.backgroundJobs),t.backgroundJobs=i,n}function b5(r){switch(r.type){case"variable":return r.name==="@"||r.name==="#"||r.name==="*"||Number.isFinite(parseInt(r.name,10))||"defaultValue"in r&&!!r.defaultValue&&r.defaultValue.some(e=>Md(e))||"alternativeValue"in r&&!!r.alternativeValue&&r.alternativeValue.some(e=>Md(e));case"arithmetic":return $P(r.arithmetic);case"shell":return eD(r.shell);default:return!1}}function Md(r){switch(r.type){case"redirection":return r.args.some(e=>Md(e));case"argument":return r.segments.some(e=>b5(e));default:throw new Error(`Assertion failed: Unsupported argument type: "${r.type}"`)}}function $P(r){switch(r.type){case"variable":return b5(r);case"number":return!1;default:return $P(r.left)||$P(r.right)}}function eD(r){return r.some(({command:e})=>{for(;e;){let t=e.chain;for(;t;){let i;switch(t.type){case"subshell":i=eD(t.subshell);break;case"command":i=t.envs.some(n=>n.args.some(s=>Md(s)))||t.args.some(n=>Md(n));break}if(i)return!0;if(!t.then)break;t=t.then.chain}if(!e.then)break;e=e.then.line}return!1})}async function _w(r,e=[],{baseFs:t=new ar,builtins:i={},cwd:n=j.toPortablePath(process.cwd()),env:s=process.env,stdin:o=process.stdin,stdout:a=process.stdout,stderr:l=process.stderr,variables:c={},glob:u=jw}={}){let g={};for(let[p,m]of Object.entries(s))typeof m!="undefined"&&(g[p]=m);let f=new Map(_De);for(let[p,m]of Object.entries(i))f.set(p,m);o===null&&(o=new ss.PassThrough,o.end());let h=zE(r,u);if(!eD(h)&&h.length>0&&e.length>0){let{command:p}=h[h.length-1];for(;p.then;)p=p.then.line;let m=p.chain;for(;m.then;)m=m.then.chain;m.type==="command"&&(m.args=m.args.concat(e.map(y=>({type:"argument",segments:[{type:"text",text:y}]}))))}return await Ww(h,{args:e,baseFs:t,builtins:f,initialStdin:o,initialStdout:a,initialStderr:l,glob:u},{cwd:n,environment:g,exitCode:null,procedures:{},stdin:o,stdout:a,stderr:l,variables:Object.assign({},c,{["?"]:0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}var c6=ge(Vw()),u6=ge(Cp()),Wc=ge(require("stream"));var s6=ge(n6()),$w=ge(hc());var o6=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],a6=80,$Fe=new Set([$.FETCH_NOT_CACHED,$.UNUSED_CACHE_ENTRY]),eRe=5,eB=$w.default.GITHUB_ACTIONS?{start:r=>`::group::${r}
`,end:r=>`::endgroup::
`}:$w.default.TRAVIS?{start:r=>`travis_fold:start:${r}
`,end:r=>`travis_fold:end:${r}
`}:$w.default.GITLAB?{start:r=>`section_start:${Math.floor(Date.now()/1e3)}:${r.toLowerCase().replace(/\W+/g,"_")}[collapsed=true]\r${r}
`,end:r=>`section_end:${Math.floor(Date.now()/1e3)}:${r.toLowerCase().replace(/\W+/g,"_")}\r`}:null,A6=new Date,tRe=["iTerm.app","Apple_Terminal"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,rRe=r=>r,tB=rRe({patrick:{date:[17,3],chars:["\u{1F340}","\u{1F331}"],size:40},simba:{date:[19,7],chars:["\u{1F981}","\u{1F334}"],size:40},jack:{date:[31,10],chars:["\u{1F383}","\u{1F987}"],size:40},hogsfather:{date:[31,12],chars:["\u{1F389}","\u{1F384}"],size:40},default:{chars:["=","-"],size:80}}),iRe=tRe&&Object.keys(tB).find(r=>{let e=tB[r];return!(e.date&&(e.date[0]!==A6.getDate()||e.date[1]!==A6.getMonth()+1))})||"default";function l6(r,{configuration:e,json:t}){if(!e.get("enableMessageNames"))return"";let n=qA(r===null?0:r);return!t&&r===null?et(e,n,"grey"):n}function sD(r,{configuration:e,json:t}){let i=l6(r,{configuration:e,json:t});if(!i||r===null||r===$.UNNAMED)return i;let n=$[r],s=`https://yarnpkg.com/advanced/error-codes#${i}---${n}`.toLowerCase();return Rg(e,i,s)}var Je=class extends qi{constructor({configuration:e,stdout:t,json:i=!1,includeFooter:n=!0,includeLogs:s=!i,includeInfos:o=s,includeWarnings:a=s,forgettableBufferSize:l=eRe,forgettableNames:c=new Set}){super();this.uncommitted=new Set;this.cacheHitCount=0;this.cacheMissCount=0;this.lastCacheMiss=null;this.warningCount=0;this.errorCount=0;this.startTime=Date.now();this.indent=0;this.progress=new Map;this.progressTime=0;this.progressFrame=0;this.progressTimeout=null;this.forgettableLines=[];id(this,{configuration:e}),this.configuration=e,this.forgettableBufferSize=l,this.forgettableNames=new Set([...c,...$Fe]),this.includeFooter=n,this.includeInfos=o,this.includeWarnings=a,this.json=i,this.stdout=t;let u=this.configuration.get("progressBarStyle")||iRe;if(!Object.prototype.hasOwnProperty.call(tB,u))throw new Error("Assertion failed: Invalid progress bar style");this.progressStyle=tB[u];let g="\u27A4 YN0000: \u250C ".length,f=Math.max(0,Math.min(process.stdout.columns-g,80));this.progressMaxScaledSize=Math.floor(this.progressStyle.size*f/80)}static async start(e,t){let i=new this(e),n=process.emitWarning;process.emitWarning=(s,o)=>{if(typeof s!="string"){let l=s;s=l.message,o=o!=null?o:l.name}let a=typeof o!="undefined"?`${o}: ${s}`:s;i.reportWarning($.UNNAMED,a)};try{await t(i)}catch(s){i.reportExceptionOnce(s)}finally{await i.finalize(),process.emitWarning=n}return i}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(e){this.cacheHitCount+=1}reportCacheMiss(e,t){this.lastCacheMiss=e,this.cacheMissCount+=1,typeof t!="undefined"&&!this.configuration.get("preferAggregateCacheInfo")&&this.reportInfo($.FETCH_NOT_CACHED,t)}startSectionSync({reportHeader:e,reportFooter:t,skipIfEmpty:i},n){let s={committed:!1,action:()=>{e==null||e()}};i?this.uncommitted.add(s):(s.action(),s.committed=!0);let o=Date.now();try{return n()}catch(a){throw this.reportExceptionOnce(a),a}finally{let a=Date.now();this.uncommitted.delete(s),s.committed&&(t==null||t(a-o))}}async startSectionPromise({reportHeader:e,reportFooter:t,skipIfEmpty:i},n){let s={committed:!1,action:()=>{e==null||e()}};i?this.uncommitted.add(s):(s.action(),s.committed=!0);let o=Date.now();try{return await n()}catch(a){throw this.reportExceptionOnce(a),a}finally{let a=Date.now();this.uncommitted.delete(s),s.committed&&(t==null||t(a-o))}}startTimerImpl(e,t,i){let n=typeof t=="function"?{}:t;return{cb:typeof t=="function"?t:i,reportHeader:()=>{this.reportInfo(null,`\u250C ${e}`),this.indent+=1,eB!==null&&!this.json&&this.includeInfos&&this.stdout.write(eB.start(e))},reportFooter:o=>{this.indent-=1,eB!==null&&!this.json&&this.includeInfos&&this.stdout.write(eB.end(e)),this.configuration.get("enableTimers")&&o>200?this.reportInfo(null,`\u2514 Completed in ${et(this.configuration,o,Ge.DURATION)}`):this.reportInfo(null,"\u2514 Completed")},skipIfEmpty:n.skipIfEmpty}}startTimerSync(e,t,i){let o=this.startTimerImpl(e,t,i),{cb:n}=o,s=Tr(o,["cb"]);return this.startSectionSync(s,n)}async startTimerPromise(e,t,i){let o=this.startTimerImpl(e,t,i),{cb:n}=o,s=Tr(o,["cb"]);retur
`),this.writeProgress()}writeLineWithForgettableReset(e,{truncate:t}={}){this.forgettableLines=[],this.writeLine(e,{truncate:t})}writeLines(e,{truncate:t}={}){this.clearProgress({delta:e.length});for(let i of e)this.stdout.write(`${this.truncate(i,{truncate:t})}
`);this.writeProgress()}reportCacheChanges({cacheHitCount:e,cacheMissCount:t}){let i=this.cacheHitCount-e,n=this.cacheMissCount-t;if(i===0&&n===0)return;let s="";this.cacheHitCount>1?s+=`${this.cacheHitCount} packages were already cached`:this.cacheHitCount===1?s+=" - one package was already cached":s+="No packages were cached",this.cacheHitCount>0?this.cacheMissCount>1?s+=`, ${this.cacheMissCount} had to be fetched`:this.cacheMissCount===1&&(s+=`, one had to be fetched (${Bt(this.configuration,this.lastCacheMiss)})`):this.cacheMissCount>1?s+=` - ${this.cacheMissCount} packages had to be fetched`:this.cacheMissCount===1&&(s+=` - one package had to be fetched (${Bt(this.configuration,this.lastCacheMiss)})`),this.reportInfo($.FETCH_NOT_CACHED,s)}commit(){let e=this.uncommitted;this.uncommitted=new Set;for(let t of e)t.committed=!0,t.action()}clearProgress({delta:e=0,clear:t=!1}){!this.configuration.get("enableProgressBars")||this.json||this.progress.size+e>0&&(this.stdout.write(`[${this.progress.size+e}A`),(e>0||t)&&this.stdout.write(""))}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>a6&&(this.progressFrame=(this.progressFrame+1)%o6.length,this.progressTime=e);let t=o6[this.progressFrame];for(let i of this.progress.values()){let n="";if(typeof i.lastScaledSize!="undefined"){let l=this.progressStyle.chars[0].repeat(i.lastScaledSize),c=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-i.lastScaledSize);n=` ${l}${c}`}let s=this.formatName(null),o=s?`${s}: `:"",a=i.definition.title?` ${i.definition.title}`:"";this.stdout.write(`${et(this.configuration,"\u27A4","blueBright")} ${o}${t}${n}${a}
`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},a6)}refreshProgress({delta:e=0,force:t=!1}={}){let i=!1,n=!1;if(t||this.progress.size===0)i=!0;else for(let s of this.progress.values()){let o=typeof s.definition.progress!="undefined"?Math.trunc(this.progressMaxScaledSize*s.definition.progress):void 0,a=s.lastScaledSize;s.lastScaledSize=o;let l=s.lastTitle;if(s.lastTitle=s.definition.title,o!==a||(n=l!==s.definition.title)){i=!0;break}}i&&(this.clearProgress({delta:e,clear:n}),this.writeProgress())}truncate(e,{truncate:t}={}){return this.configuration.get("enableProgressBars")||(t=!1),typeof t=="undefined"&&(t=this.configuration.get("preferTruncatedLines")),t&&(e=(0,s6.default)(e,0,process.stdout.columns-1)),e}formatName(e){return l6(e,{configuration:this.configuration,json:this.json})}formatNameWithHyperlink(e){return sD(e,{configuration:this.configuration,json:this.json})}formatIndent(){return"\u2502 ".repeat(this.indent)}};var Ur="3.2.0-rc.10.git.20220108.hash-ce1e0c317";var hn;(function(n){n.Yarn1="Yarn Classic",n.Yarn2="Yarn",n.Npm="npm",n.Pnpm="pnpm"})(hn||(hn={}));async function sA(r,e,t,i=[]){if(process.platform==="win32"){let n=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${t}" ${i.map(s=>`"${s.replace('"','""')}"`).join(" ")} %*`;await K.writeFilePromise(k.format({dir:r,name:e,ext:".cmd"}),n)}await K.writeFilePromise(k.join(r,e),`#!/bin/sh
exec "${t}" ${i.map(n=>`'${n.replace(/'/g,`'"'"'`)}'`).join(" ")} "$@"
`,{mode:493})}async function g6(r){let e=await At.tryFind(r);if(e==null?void 0:e.packageManager){let i=lw(e.packageManager);if(i==null?void 0:i.name){let n=`found ${JSON.stringify({packageManager:e.packageManager})} in manifest`,[s]=i.reference.split(".");switch(i.name){case"yarn":return{packageManager:Number(s)===1?hn.Yarn1:hn.Yarn2,reason:n};case"npm":return{packageManager:hn.Npm,reason:n};case"pnpm":return{packageManager:hn.Pnpm,reason:n}}}}let t;try{t=await K.readFilePromise(k.join(r,Pt.lockfile),"utf8")}catch{}return t!==void 0?t.match(/^__metadata:$/m)?{packageManager:hn.Yarn2,reason:'"__metadata" key found in yarn.lock'}:{packageManager:hn.Yarn1,reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:K.existsSync(k.join(r,"package-lock.json"))?{packageManager:hn.Npm,reason:`found npm's "package-lock.json" lockfile`}:K.existsSync(k.join(r,"pnpm-lock.yaml"))?{packageManager:hn.Pnpm,reason:`found pnpm's "pnpm-lock.yaml" lockfile`}:null}async function Ud({project:r,locator:e,binFolder:t,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=j.fromPortablePath(t);n.BERRY_BIN_FOLDER=j.fromPortablePath(s);let o=process.env.COREPACK_ROOT?j.join(process.env.COREPACK_ROOT,"dist/yarn.js"):process.argv[1];if(await Promise.all([sA(t,"node",process.execPath),...Ur!==null?[sA(t,"run",process.execPath,[o,"run"]),sA(t,"yarn",process.execPath,[o]),sA(t,"yarnpkg",process.execPath,[o]),sA(t,"node-gyp",process.execPath,[o,"run","--top-level","node-gyp"])]:[]]),r&&(n.INIT_CWD=j.fromPortablePath(r.configuration.startingCwd),n.PROJECT_CWD=j.fromPortablePath(r.cwd)),n.PATH=n.PATH?`${s}${j.delimiter}${n.PATH}`:`${s}`,n.npm_execpath=`${s}${j.sep}yarn`,n.npm_node_execpath=`${s}${j.sep}node`,e){if(!r)throw new Error("Assertion failed: Missing project");let u=r.tryWorkspaceByLocator(e),g=u?(l=u.manifest.version)!=null?l:"":(c=r.storedPackages.get(e.locatorHash).version)!=null?c:"";n.npm_package_name=Ot(e),n.npm_package_version=g}let a=Ur!==null?`yarn/${Ur}`:`yarn/${Fg("@yarnpkg/core").version}-core`;return n.npm_config_user_agent=`${a} npm/? node/${process.version} ${process.platform} ${process.arch}`,i&&(n.npm_lifecycle_event=i),r&&await r.configuration.triggerHook(u=>u.setupScriptEnvironment,r,n,async(u,g,f)=>await sA(t,qr(u),g,f)),n}var nRe=2,sRe=(0,u6.default)(nRe);async function oRe(r,e,{configuration:t,report:i,workspace:n=null,locator:s=null}){await sRe(async()=>{await K.mktempPromise(async o=>{let a=k.join(o,"pack.log"),l=null,{stdout:c,stderr:u}=t.getSubprocessStreams(a,{prefix:j.fromPortablePath(r),report:i}),g=s&&Xo(s)?cd(s):s,f=g?Ds(g):"an external project";c.write(`Packing ${f} from sources
`);let h=await g6(r),p;h!==null?(c.write(`Using ${h.packageManager} for bootstrap. Reason: ${h.reason}
`),p=h.packageManager):(c.write(`No package manager configuration detected; defaulting to Yarn
`),p=hn.Yarn2),await K.mktempPromise(async m=>{let y=await Ud({binFolder:m}),S=new Map([[hn.Yarn1,async()=>{let M=n!==null?["workspace",n]:[],q=await $o("yarn",["set","version","classic","--only-if-needed"],{cwd:r,env:y,stdin:l,stdout:c,stderr:u,end:ns.ErrorCode});if(q.code!==0)return q.code;await K.appendFilePromise(k.join(r,".npmignore"),`/.yarn
`),c.write(`
`);let U=await $o("yarn",["install"],{cwd:r,env:y,stdin:l,stdout:c,stderr:u,end:ns.ErrorCode});if(U.code!==0)return U.code;c.write(`
`);let W=await $o("yarn",[...M,"pack","--filename",j.fromPortablePath(e)],{cwd:r,env:y,stdin:l,stdout:c,stderr:u});return W.code!==0?W.code:0}],[hn.Yarn2,async()=>{let M=n!==null?["workspace",n]:[];y.YARN_ENABLE_INLINE_BUILDS="1";let q=k.join(r,Pt.lockfile);await K.existsPromise(q)||await K.writeFilePromise(q,"");let U=await $o("yarn",[...M,"pack","--install-if-needed","--filename",j.fromPortablePath(e)],{cwd:r,env:y,stdin:l,stdout:c,stderr:u});return U.code!==0?U.code:0}],[hn.Npm,async()=>{if(n!==null){let A=new Wc.PassThrough,ne=Dg(A);A.pipe(c,{end:!1});let Ae=await $o("npm",["--version"],{cwd:r,env:y,stdin:l,stdout:A,stderr:u,end:ns.Never});if(A.end(),Ae.code!==0)return c.end(),u.end(),Ae.code;let ee=(await ne).toString().trim();if(!Kc(ee,">=7.x")){let O=Vo(null,"npm"),N=tr(O,ee),be=tr(O,">=7.x");throw new Error(`Workspaces aren't supported by ${nr(t,N)}; please upgrade to ${nr(t,be)} (npm has been detected as the primary package manager for ${et(t,r,Ge.PATH)})`)}}let M=n!==null?["--workspace",n]:[];delete y.npm_config_user_agent;let q=await $o("npm",["install"],{cwd:r,env:y,stdin:l,stdout:c,stderr:u,end:ns.ErrorCode});if(q.code!==0)return q.code;let U=new Wc.PassThrough,W=Dg(U);U.pipe(c);let J=await $o("npm",["pack","--silent",...M],{cwd:r,env:y,stdin:l,stdout:U,stderr:u});if(J.code!==0)return J.code;let oe=(await W).toString().trim().replace(/^.*\n/s,""),Z=k.resolve(r,j.toPortablePath(oe));return await K.renamePromise(Z,e),0}]]).get(p);if(typeof S=="undefined")throw new Error("Assertion failed: Unsupported workflow");let x=await S();if(!(x===0||typeof x=="undefined"))throw K.detachTemp(o),new ct($.PACKAGE_PREPARATION_FAILED,`Packing the package failed (exit code ${x}, logs can be found here: ${et(t,a,Ge.PATH)})`)})})})}async function aRe(r,e,{project:t}){let i=t.tryWorkspaceByLocator(r);if(i!==null)return oD(i,e);let n=t.storedPackages.get(r.locatorHash);if(!n)throw new Error(`Package for ${Bt(t.configuration,r)} not found in the project`);return await Es.openPromise(async s=>{let o=t.configuration,a=t.configuration.getLinkers(),l={project:t,report:new Je({stdout:new Wc.PassThrough,configuration:o})},c=a.find(h=>h.supportsPackage(n,l));if(!c)throw new Error(`The package ${Bt(t.configuration,n)} isn't supported by any of the available linkers`);let u=await c.findPackageLocation(n,l),g=new zt(u,{baseFs:s});return(await At.find(Ue.dot,{baseFs:g})).scripts.has(e)},{libzip:await fn()})}async function rB(r,e,t,{cwd:i,project:n,stdin:s,stdout:o,stderr:a}){return await K.mktempPromise(async l=>{let{manifest:c,env:u,cwd:g}=await f6(r,{project:n,binFolder:l,cwd:i,lifecycleScript:e}),f=c.scripts.get(e);if(typeof f=="undefined")return 1;let h=async()=>await _w(f,t,{cwd:g,env:u,stdin:s,stdout:o,stderr:a});return await(await n.configuration.reduceHook(m=>m.wrapScriptExecution,h,n,r,e,{script:f,args:t,cwd:g,env:u,stdin:s,stdout:o,stderr:a}))()})}async function aD(r,e,t,{cwd:i,project:n,stdin:s,stdout:o,stderr:a}){return await K.mktempPromise(async l=>{let{env:c,cwd:u}=await f6(r,{project:n,binFolder:l,cwd:i});return await _w(e,t,{cwd:u,env:c,stdin:s,stdout:o,stderr:a})})}async function ARe(r,{binFolder:e,cwd:t,lifecycleScript:i}){let n=await Ud({project:r.project,locator:r.anchoredLocator,binFolder:e,lifecycleScript:i});return await Promise.all(Array.from(await h6(r),([s,[,o]])=>sA(e,qr(s),process.execPath,[o]))),typeof t=="undefined"&&(t=k.dirname(await K.realpathPromise(k.join(r.cwd,"package.json")))),{manifest:r.manifest,binFolder:e,env:n,cwd:t}}async function f6(r,{project:e,binFolder:t,cwd:i,lifecycleScript:n}){let s=e.tryWorkspaceByLocator(r);if(s!==null)return ARe(s,{binFolder:t,cwd:i,lifecycleScript:n});let o=e.storedPackages.get(r.locatorHash);if(!o)throw new Error(`Package for ${Bt(e.configuration,r)} not found in the project`);return await Es.openPromise(async a=>{let l=e.configuration,c=e.configuration.getLinkers(),u={project:e,report:new Je({stdout:new Wc.PassThrough,configuration:l})},g=c.find(y=>y.supportsPackage(o,u));if(!g)throw new Error(`The package ${Bt(e.configuration,o)} isn't supported by any of the availab
`,{stdout:c,stderr:u}=n.getSubprocessStreams(a,{report:i,prefix:Bt(n,r.anchoredLocator),header:l});i.reportInfo($.LIFECYCLE_SCRIPT,`Calling the "${e}" lifecycle script`);let g=await p6(r,e,[],{cwd:t,stdin:s,stdout:c,stderr:u});if(c.end(),u.end(),g!==0)throw K.detachTemp(o),new ct($.LIFECYCLE_SCRIPT,`${(0,c6.default)(e)} script failed (exit code ${et(n,g,Ge.NUMBER)}, logs can be found here: ${et(n,a,Ge.PATH)}); run ${et(n,`yarn ${e}`,Ge.CODE)} to investigate`)})}async function lRe(r,e,t){oD(r,e)&&await d6(r,e,t)}async function iB(r,{project:e}){let t=e.configuration,i=new Map,n=e.storedPackages.get(r.locatorHash);if(!n)throw new Error(`Package for ${Bt(t,r)} not found in the project`);let s=new Wc.Writable,o=t.getLinkers(),a={project:e,report:new Je({configuration:t,stdout:s})},l=new Set([r.locatorHash]);for(let u of n.dependencies.values()){let g=e.storedResolutions.get(u.descriptorHash);if(!g)throw new Error(`Assertion failed: The resolution (${nr(t,u)}) should have been registered`);l.add(g)}let c=await Promise.all(Array.from(l,async u=>{let g=e.storedPackages.get(u);if(!g)throw new Error(`Assertion failed: The package (${u}) should have been registered`);if(g.bin.size===0)return xc.skip;let f=o.find(p=>p.supportsPackage(g,a));if(!f)return xc.skip;let h=null;try{h=await f.findPackageLocation(g,a)}catch(p){if(p.code==="LOCATOR_NOT_INSTALLED")return xc.skip;throw p}return{dependency:g,packageLocation:h}}));for(let u of c){if(u===xc.skip)continue;let{dependency:g,packageLocation:f}=u;for(let[h,p]of g.bin)i.set(h,[g,j.fromPortablePath(k.resolve(f,p))])}return i}async function h6(r){return await iB(r.anchoredLocator,{project:r.project})}async function C6(r,e,t,{cwd:i,project:n,stdin:s,stdout:o,stderr:a,nodeArgs:l=[],packageAccessibleBinaries:c}){c!=null||(c=await iB(r,{project:n}));let u=c.get(e);if(!u)throw new Error(`Binary not found (${e}) for ${Bt(n.configuration,r)}`);return await K.mktempPromise(async g=>{let[,f]=u,h=await Ud({project:n,locator:r,binFolder:g});await Promise.all(Array.from(c,([m,[,y]])=>sA(h.BERRY_BIN_FOLDER,qr(m),process.execPath,[y])));let p;try{p=await $o(process.execPath,[...l,f,...t],{cwd:i,env:h,stdin:s,stdout:o,stderr:a})}finally{await K.removePromise(h.BERRY_BIN_FOLDER)}return p.code})}async function cRe(r,e,t,{cwd:i,stdin:n,stdout:s,stderr:o,packageAccessibleBinaries:a}){return await C6(r.anchoredLocator,e,t,{project:r.project,cwd:i,stdin:n,stdout:s,stderr:o,packageAccessibleBinaries:a})}var wi={};pt(wi,{convertToZip:()=>xNe,extractArchiveTo:()=>PNe,makeArchiveFromDirectory:()=>SNe});var y7=ge(require("stream")),w7=ge(i7());var d7=ge(require("os")),C7=ge(p7()),m7=ge(require("worker_threads")),QF=class{constructor(e){this.source=e;this.pool=[];this.queue=new C7.default({concurrency:Math.max(1,(0,d7.cpus)().length)});let t=setTimeout(()=>{if(!(this.queue.size!==0||this.queue.pending!==0)){for(let i of this.pool)i.terminate();this.pool=[]}},1e3).unref();this.queue.on("idle",()=>{t.refresh()})}run(e){return this.queue.add(()=>{var i;let t=(i=this.pool.pop())!=null?i:new m7.Worker(this.source,{eval:!0,execArgv:[...process.execArgv,"--unhandled-rejections=strict"]});return t.ref(),new Promise((n,s)=>{let o=a=>{a!==0&&s(new Error(`Worker exited with code ${a}`))};t.once("message",a=>{this.pool.push(t),t.unref(),t.off("error",s),t.off("exit",o),n(a)}),t.once("error",s),t.once("exit",o),t.postMessage(e)})})}};var B7=ge(I7());async function SNe(r,{baseFs:e=new ar,prefixPath:t=Ue.root,compressionLevel:i,inMemory:n=!1}={}){let s=await fn(),o;if(n)o=new ai(null,{libzip:s,level:i});else{let l=await K.mktempPromise(),c=k.join(l,"archive.zip");o=new ai(c,{create:!0,libzip:s,level:i})}let a=k.resolve(Ue.root,t);return await o.copyPromise(a,r,{baseFs:e,stableTime:!0,stableSort:!0}),o}var b7;async function xNe(r,e){let t=await K.mktempPromise(),i=k.join(t,"archive.zip");return b7||(b7=new QF((0,B7.getContent)())),await b7.run({tmpFile:i,tgz:r,opts:e}),new ai(i,{libzip:await fn(),level:e.compressionLevel})}async function*kNe(r){let e=new w7.default.Parse,t=new y7.PassThrough({objectMode:!0,autoDestroy:!0,emitClo
`);return}let s=(0,S7.asTree)(x7(r,{configuration:e}),!1,!1);if(n>=1&&(s=s.replace(/^([├└]─)/gm,`\u2502
$1`).replace(/^│\n/,"")),n>=2)for(let a=0;a<2;++a)s=s.replace(/^([│ ].{2}[├│ ].{2}[^\n]+\n)(([│ ]).{2}[├└].{2}[^\n]*\n[│ ].{2}[│ ].{2}[├└]─)/gm,`$1$3 \u2502
$2`).replace(/^│\n/,"");if(n>=3)throw new Error("Only the first two levels are accepted by treeUtils.emitTree");t.write(s)}var D7=ge(require("crypto")),xF=ge(require("fs"));var FNe=8,Lt=class{constructor(e,{configuration:t,immutable:i=t.get("enableImmutableCache"),check:n=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.cacheId=`-${(0,D7.randomBytes)(8).toString("hex")}.tmp`;this.configuration=t,this.cwd=e,this.immutable=i,this.check=n;let s=t.get("cacheKeyOverride");if(s!==null)this.cacheKey=`${s}`;else{let o=t.get("compressionLevel"),a=o!==ic?`c${o}`:"";this.cacheKey=[FNe,a].join("")}}static async find(e,{immutable:t,check:i}={}){let n=new Lt(e.get("cacheFolder"),{configuration:e,immutable:t,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`${Hg(e)}-${this.cacheKey}.zip`}getChecksumFilename(e,t){let n=RNe(t).slice(0,10);return`${Hg(e)}-${n}.zip`}getLocatorPath(e,t,i={}){var s;return this.mirrorCwd===null||((s=i.unstablePackages)==null?void 0:s.has(e.locatorHash))?k.resolve(this.cwd,this.getVersionFilename(e)):t===null||kF(t)!==this.cacheKey?null:k.resolve(this.cwd,this.getChecksumFilename(e,t))}getLocatorMirrorPath(e){let t=this.mirrorCwd;return t!==null?k.resolve(t,this.getVersionFilename(e)):null}async setup(){if(!this.configuration.get("enableGlobalCache"))if(this.immutable){if(!await K.existsPromise(this.cwd))throw new ct($.IMMUTABLE_CACHE,"Cache path does not exist.")}else{await K.mkdirPromise(this.cwd,{recursive:!0});let e=k.resolve(this.cwd,".gitignore");await K.changeFilePromise(e,`/.gitignore
*.flock
*.tmp
`)}(this.mirrorCwd||!this.immutable)&&await K.mkdirPromise(this.mirrorCwd||this.cwd,{recursive:!0})}async fetchPackageFromCache(e,t,a){var l=a,{onHit:i,onMiss:n,loader:s}=l,o=Tr(l,["onHit","onMiss","loader"]);var A;let c=this.getLocatorMirrorPath(e),u=new ar,g=()=>{let ne=new ai(null,{libzip:q}),Ae=k.join(Ue.root,ok(e));return ne.mkdirSync(Ae,{recursive:!0}),ne.writeJsonSync(k.join(Ae,Pt.manifest),{name:Ot(e),mocked:!0}),ne},f=async(ne,Ae=null)=>{let ee=!o.skipIntegrityCheck||!t?`${this.cacheKey}/${await nw(ne)}`:t;if(Ae!==null){let O=!o.skipIntegrityCheck||!t?`${this.cacheKey}/${await nw(Ae)}`:t;if(ee!==O)throw new ct($.CACHE_CHECKSUM_MISMATCH,"The remote archive doesn't match the local checksum - has the local cache been corrupted?")}if(t!==null&&ee!==t){let O;switch(this.check?O="throw":kF(t)!==kF(ee)?O="update":O=this.configuration.get("checksumBehavior"),O){case"ignore":return t;case"update":return ee;default:case"throw":throw new ct($.CACHE_CHECKSUM_MISMATCH,"The remote archive doesn't match the expected checksum")}}return ee},h=async ne=>{if(!s)throw new Error(`Cache check required but no loader configured for ${Bt(this.configuration,e)}`);let Ae=await s(),ee=Ae.getRealPath();return Ae.saveAndClose(),await K.chmodPromise(ee,420),await f(ne,ee)},p=async()=>{if(c===null||!await K.existsPromise(c)){let ne=await s(),Ae=ne.getRealPath();return ne.saveAndClose(),{source:"loader",path:Ae}}return{source:"mirror",path:c}},m=async()=>{if(!s)throw new Error(`Cache entry required but missing for ${Bt(this.configuration,e)}`);if(this.immutable)throw new ct($.IMMUTABLE_CACHE,`Cache entry required but missing for ${Bt(this.configuration,e)}`);let{path:ne,source:Ae}=await p(),ee=await f(ne),O=this.getLocatorPath(e,ee,o);if(!O)throw new Error("Assertion failed: Expected the cache path to be available");let N=[];Ae!=="mirror"&&c!==null&&N.push(async()=>{let Ie=`${c}${this.cacheId}`;await K.copyFilePromise(ne,Ie,xF.default.constants.COPYFILE_FICLONE),await K.chmodPromise(Ie,420),await K.renamePromise(Ie,c)}),(!o.mirrorWriteOnly||c===null)&&N.push(async()=>{let Ie=`${O}${this.cacheId}`;await K.copyFilePromise(ne,Ie,xF.default.constants.COPYFILE_FICLONE),await K.chmodPromise(Ie,420),await K.renamePromise(Ie,O)});let be=o.mirrorWriteOnly&&c!=null?c:O;return await Promise.all(N.map(Ie=>Ie())),[!1,be,ee]},y=async()=>{let Ae=(async()=>{var Ye;let ee=this.getLocatorPath(e,t,o),O=ee!==null?await u.existsPromise(ee):!1,N=!!((Ye=o.mockedPackages)==null?void 0:Ye.has(e.locatorHash))&&(!this.check||!O),be=N||O,Ie=be?i:n;if(Ie&&Ie(),be){let te=null,ae=ee;return N||(te=this.check?await h(ae):await f(ae)),[N,ae,te]}else return m()})();this.mutexes.set(e.locatorHash,Ae);try{return await Ae}finally{this.mutexes.delete(e.locatorHash)}};for(let ne;ne=this.mutexes.get(e.locatorHash);)await ne;let[Q,S,x]=await y();this.markedFiles.add(S);let M,q=await fn(),U=Q?()=>g():()=>new ai(S,{baseFs:u,libzip:q,readOnly:!0}),W=new Wh(()=>MS(()=>M=U(),ne=>`Failed to open the cache entry for ${Bt(this.configuration,e)}: ${ne}`),k),J=new Da(S,{baseFs:W,pathUtils:k}),oe=()=>{M==null||M.discardAndClose()},Z=((A=o.unstablePackages)==null?void 0:A.has(e.locatorHash))?null:x;return[J,oe,Z]}};function kF(r){let e=r.indexOf("/");return e!==-1?r.slice(0,e):null}function RNe(r){let e=r.indexOf("/");return e!==-1?r.slice(e+1):r}var ls;(function(t){t[t.SCRIPT=0]="SCRIPT",t[t.SHELLCODE=1]="SHELLCODE"})(ls||(ls={}));var gA=class extends qi{constructor({configuration:e,stdout:t,suggestInstall:i=!0}){super();this.errorCount=0;id(this,{configuration:e}),this.configuration=e,this.stdout=t,this.suggestInstall=i}static async start(e,t){let i=new this(e);try{await t(i)}catch(n){i.reportExceptionOnce(n)}finally{await i.finalize()}return i}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(e){}reportCacheMiss(e){}startSectionSync(e,t){return t()}async startSectionPromise(e,t){return await t()}startTimerSync(e,t,i){return(typeof t=="function"?t:i)()}async startTimerPromise(e,t,i){return await(typeof t=="function"?t:i)()}async startCacheReport(e){retu
`)}reportProgress(e){let t=Promise.resolve().then(async()=>{for await(let{}of e);}),i=()=>{};return ie(L({},t),{stop:i})}reportJson(e){}async finalize(){this.errorCount>0&&(this.stdout.write(`
`),this.stdout.write(`${et(this.configuration,"\u27A4","redBright")} Errors happened when preparing the environment required to run this command.
`),this.suggestInstall&&this.stdout.write(`${et(this.configuration,"\u27A4","redBright")} This might be caused by packages being missing from the lockfile, in which case running "yarn install" might help.
`))}formatNameWithHyperlink(e){return sD(e,{configuration:this.configuration,json:!1})}};var g0=ge(require("crypto")),w$=ge(hX()),f0=ge(I$()),B$=ge(Cp()),b$=ge(ti()),iR=ge(require("util")),nR=ge(require("v8")),sR=ge(require("zlib"));var p1e=[[/^(git(?:\+(?:https|ssh))?:\/\/.*(?:\.git)?)#(.*)$/,(r,e,t,i)=>`${t}#commit=${i}`],[/^https:\/\/((?:[^/]+?)@)?codeload\.github\.com\/([^/]+\/[^/]+)\/tar\.gz\/([0-9a-f]+)$/,(r,e,t="",i,n)=>`https://${t}github.com/${i}.git#commit=${n}`],[/^https:\/\/((?:[^/]+?)@)?github\.com\/([^/]+\/[^/]+?)(?:\.git)?#([0-9a-f]+)$/,(r,e,t="",i,n)=>`https://${t}github.com/${i}.git#commit=${n}`],[/^https?:\/\/[^/]+\/(?:[^/]+\/)*(?:@.+(?:\/|(?:%2f)))?([^/]+)\/(?:-|download)\/\1-[^/]+\.tgz(?:#|$)/,r=>`npm:${r}`],[/^https:\/\/npm\.pkg\.github\.com\/download\/(?:@[^/]+)\/(?:[^/]+)\/(?:[^/]+)\/(?:[0-9a-f]+)(?:#|$)/,r=>`npm:${r}`],[/^https:\/\/npm\.fontawesome\.com\/(?:@[^/]+)\/([^/]+)\/-\/([^/]+)\/\1-\2.tgz(?:#|$)/,r=>`npm:${r}`],[/^https?:\/\/(?:[^\\.]+)\.jfrog\.io\/.*\/(@[^/]+)\/([^/]+)\/-\/\1\/\2-(?:[.\d\w-]+)\.tgz(?:#|$)/,(r,e)=>cw({protocol:"npm:",source:null,selector:r,params:{__archiveUrl:e}})],[/^[^/]+\.tgz#[0-9a-f]+$/,r=>`npm:${r}`]],eR=class{constructor(e){this.resolver=e;this.resolutions=null}async setup(e,{report:t}){let i=k.join(e.cwd,e.configuration.get("lockfileFilename"));if(!K.existsSync(i))return;let n=await K.readFilePromise(i,"utf8"),s=Qi(n);if(Object.prototype.hasOwnProperty.call(s,"__metadata"))return;let o=this.resolutions=new Map;for(let a of Object.keys(s)){let l=fd(a);if(!l){t.reportWarning($.YARN_IMPORT_FAILED,`Failed to parse the string "${a}" into a proper descriptor`);continue}po(l.range)&&(l=tr(l,`npm:${l.range}`));let{version:c,resolved:u}=s[a];if(!u)continue;let g;for(let[h,p]of p1e){let m=u.match(h);if(m){g=p(c,...m);break}}if(!g){t.reportWarning($.YARN_IMPORT_FAILED,`${nr(e.configuration,l)}: Only some patterns can be imported from legacy lockfiles (not "${u}")`);continue}let f=l;try{let h=Kg(l.range),p=fd(h.selector,!0);p&&(f=p)}catch{}o.set(l.descriptorHash,cn(f,g))}}supportsDescriptor(e,t){return this.resolutions?this.resolutions.has(e.descriptorHash):!1}supportsLocator(e,t){return!1}shouldPersistResolution(e,t){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,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 await this.resolver.getCandidates(tk(n),t,i)}async getSatisfying(e,t,i){return null}async resolve(e,t){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}};var tR=class{constructor(e){this.resolver=e}supportsDescriptor(e,t){return!!(t.project.storedResolutions.get(e.descriptorHash)||t.project.originalPackages.has(Aw(e).locatorHash))}supportsLocator(e,t){return!!(t.project.originalPackages.has(e.locatorHash)&&!t.project.lockfileNeedsRefresh)}shouldPersistResolution(e,t){throw new Error("The shouldPersistResolution method shouldn't be called on the lockfile resolver, which would always answer yes")}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){return this.resolver.getResolutionDependencies(e,t)}async getCandidates(e,t,i){let n=i.project.originalPackages.get(Aw(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,t,i){return null}async resolve(e,t){let i=t.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 rR=class{constructor(e){this.resolver=e}supports
`;await K.changeFilePromise(t,i,{automaticNewlines:!0}),this.manifest.raw=e}};var Q$=5,d1e=1,C1e=/ *, */g,v$=/\/$/,m1e=32,E1e=(0,iR.promisify)(sR.default.gzip),I1e=(0,iR.promisify)(sR.default.gunzip),pi;(function(t){t.UpdateLockfile="update-lockfile",t.SkipBuild="skip-build"})(pi||(pi={}));var oR={restoreInstallersCustomData:["installersCustomData"],restoreResolutions:["accessibleLocators","conditionalLocators","disabledLocators","optionalBuilds","storedDescriptors","storedResolutions","storedPackages","lockFileChecksum"],restoreBuildState:["storedBuildState"]},S$=r=>ln(`${d1e}`,r),ze=class{constructor(e,{configuration:t}){this.resolutionAliases=new Map;this.workspaces=[];this.workspacesByCwd=new Map;this.workspacesByIdent=new Map;this.storedResolutions=new Map;this.storedDescriptors=new Map;this.storedPackages=new Map;this.storedChecksums=new Map;this.storedBuildState=new Map;this.accessibleLocators=new Set;this.conditionalLocators=new Set;this.disabledLocators=new Set;this.originalPackages=new Map;this.optionalBuilds=new Set;this.lockfileNeedsRefresh=!1;this.peerRequirements=new Map;this.installersCustomData=new Map;this.lockFileChecksum=null;this.installStateChecksum=null;this.configuration=t,this.cwd=e}static async find(e,t){var c,u,g;if(!e.projectCwd)throw new Pe(`No project found in ${t}`);let i=e.projectCwd,n=t,s=null;for(;s!==e.projectCwd;){if(s=n,K.existsSync(k.join(s,Pt.manifest))){i=s;break}n=k.dirname(s)}let o=new ze(e.projectCwd,{configuration:e});(c=ye.telemetry)==null||c.reportProject(o.cwd),await o.setupResolutions(),await o.setupWorkspaces(),(u=ye.telemetry)==null||u.reportWorkspaceCount(o.workspaces.length),(g=ye.telemetry)==null||g.reportDependencyCount(o.workspaces.reduce((f,h)=>f+h.manifest.dependencies.size+h.manifest.devDependencies.size,0));let a=o.tryWorkspaceByCwd(i);if(a)return{project:o,workspace:a,locator:a.anchoredLocator};let l=await o.findLocatorForLocation(`${i}/`,{strict:!0});if(l)return{project:o,locator:l,workspace:null};throw new Pe(`The nearest package directory (${et(e,i,Ge.PATH)}) doesn't seem to be part of the project declared in ${et(e,o.cwd,Ge.PATH)}.
- If the project directory is right, it might be that you forgot to list ${et(e,k.relative(o.cwd,i),Ge.PATH)} as a workspace.
- If it isn't, it's likely because you have a yarn.lock or package.json file there, confusing the project root detection.`)}async setupResolutions(){var i;this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let e=k.join(this.cwd,this.configuration.get("lockfileFilename")),t=this.configuration.get("defaultLanguageName");if(K.existsSync(e)){let n=await K.readFilePromise(e,"utf8");this.lockFileChecksum=S$(n);let s=Qi(n);if(s.__metadata){let o=s.__metadata.version,a=s.__metadata.cacheKey;this.lockfileNeedsRefresh=o<Q$;for(let l of Object.keys(s)){if(l==="__metadata")continue;let c=s[l];if(typeof c.resolution=="undefined")throw new Error(`Assertion failed: Expected the lockfile entry to have a resolution field (${l})`);let u=Uc(c.resolution,!0),g=new At;g.load(c,{yamlCompatibilityMode:!0});let f=g.version,h=g.languageName||t,p=c.linkType.toUpperCase(),m=(i=c.conditions)!=null?i:null,y=g.dependencies,Q=g.peerDependencies,S=g.dependenciesMeta,x=g.peerDependenciesMeta,M=g.bin;if(c.checksum!=null){let U=typeof a!="undefined"&&!c.checksum.includes("/")?`${a}/${c.checksum}`:c.checksum;this.storedChecksums.set(u.locatorHash,U)}let q=ie(L({},u),{version:f,languageName:h,linkType:p,conditions:m,dependencies:y,peerDependencies:Q,dependenciesMeta:S,peerDependenciesMeta:x,bin:M});this.originalPackages.set(q.locatorHash,q);for(let U of l.split(C1e)){let W=sl(U);this.storedDescriptors.set(W.descriptorHash,W),this.storedResolutions.set(W.descriptorHash,u.locatorHash)}}}}}async setupWorkspaces(){this.workspaces=[],this.workspacesByCwd=new Map,this.workspacesByIdent=new Map;let e=[this.cwd];for(;e.length>0;){let t=e;e=[];for(let i of t){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 t=new EC(e,{project:this});await t.setup();let i=this.workspacesByIdent.get(t.locator.identHash);if(typeof i!="undefined")throw new Error(`Duplicate workspace name ${ui(this.configuration,t.locator)}: ${j.fromPortablePath(e)} conflicts with ${j.fromPortablePath(i.cwd)}`);return this.workspaces.push(t),this.workspacesByCwd.set(e,t),this.workspacesByIdent.set(t.locator.identHash,t),t}get topLevelWorkspace(){return this.getWorkspaceByCwd(this.cwd)}tryWorkspaceByCwd(e){k.isAbsolute(e)||(e=k.resolve(this.cwd,e)),e=k.normalize(e).replace(/\/+$/,"");let t=this.workspacesByCwd.get(e);return t||null}getWorkspaceByCwd(e){let t=this.tryWorkspaceByCwd(e);if(!t)throw new Error(`Workspace not found (${e})`);return t}tryWorkspaceByFilePath(e){let t=null;for(let i of this.workspaces)k.relative(i.cwd,e).startsWith("../")||t&&t.cwd.length>=i.cwd.length||(t=i);return t||null}getWorkspaceByFilePath(e){let t=this.tryWorkspaceByFilePath(e);if(!t)throw new Error(`Workspace not found (${e})`);return t}tryWorkspaceByIdent(e){let t=this.workspacesByIdent.get(e.identHash);return typeof t=="undefined"?null:t}getWorkspaceByIdent(e){let t=this.tryWorkspaceByIdent(e);if(!t)throw new Error(`Workspace not found (${ui(this.configuration,e)})`);return t}tryWorkspaceByDescriptor(e){let t=this.tryWorkspaceByIdent(e);return t===null||(nl(e)&&(e=ld(e)),!t.accepts(e.range))?null:t}getWorkspaceByDescriptor(e){let t=this.tryWorkspaceByDescriptor(e);if(t===null)throw new Error(`Workspace not found (${nr(this.configuration,e)})`);return t}tryWorkspaceByLocator(e){let t=this.tryWorkspaceByIdent(e);return t===null||(Xo(e)&&(e=cd(e)),t.locator.locatorHash!==e.locatorHash&&t.anchoredLocator.locatorHash!==e.locatorHash)?null:t}getWorkspaceByLocator(e){let t=this.tryWorkspaceByLocator(e);if(!t)throw new Error(`Workspace not found (${Bt(this.configuration,e)})`);return t}refreshWorkspaceDependencies(){for(let e of this.workspaces){let t=this.storedPackages.get(e.anchoredLocator.locatorHash);if(!t)throw new Error(`Assertion failed: Expected workspace ${pd(this.configuration,e)} (${et(this.configuration,k.join(e.cwd,Pt.manifest),Ge.PATH)}) to have been resolved. Run "y
`;switch(Be){case ls.SCRIPT:Fe+=`# Script name: ${he}
`;break;case ls.SHELLCODE:Fe+=`# Script code: ${he}
`;break}let Oe=null;if(!await K.mktempPromise(async Se=>{let pe=k.join(Se,"build.log"),{stdout:X,stderr:ke}=this.configuration.getSubprocessStreams(pe,{header:Fe,prefix:Bt(this.configuration,be),report:t}),le;try{switch(Be){case ls.SCRIPT:le=await rB(be,he,[],{cwd:ae,project:this,stdin:Oe,stdout:X,stderr:ke});break;case ls.SHELLCODE:le=await aD(be,he,[],{cwd:ae,project:this,stdin:Oe,stdout:X,stderr:ke});break}}catch(gt){ke.write(gt.stack),le=1}if(X.end(),ke.end(),le===0)return oe.set(be.locatorHash,te),!0;K.detachTemp(Se);let fe=`${Bt(this.configuration,be)} couldn't be built successfully (exit code ${et(this.configuration,le,Ge.NUMBER)}, logs can be found here: ${et(this.configuration,pe,Ge.PATH)})`;return this.optionalBuilds.has(be.locatorHash)?(t.reportInfo($.BUILD_FAILED,fe),oe.set(be.locatorHash,te),!0):(t.reportError($.BUILD_FAILED,fe),!1)}))return}})())}}if(await go(O),ee===x.size){let N=Array.from(x).map(be=>{let Ie=this.storedPackages.get(be);if(!Ie)throw new Error("Assertion failed: The package should have been registered");return Bt(this.configuration,Ie)}).join(", ");t.reportError($.CYCLIC_DEPENDENCIES,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won't be built (affected packages are: ${N})`);break}}this.storedBuildState=oe}async install(e){var a,l;let t=this.configuration.get("nodeLinker");(a=ye.telemetry)==null||a.reportInstall(t),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=Yi.Inactive;let i=k.join(this.cwd,this.configuration.get("lockfileFilename")),n=null;if(e.immutable)try{n=await K.readFilePromise(i,"utf8")}catch(c){throw c.code==="ENOENT"?new ct($.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=et(this.configuration,g,Ge.PACKAGE_EXTENSION);switch(g.status){case Yi.Inactive:e.report.reportWarning($.UNUSED_PACKAGE_EXTENSION,`${f}: No matching package in the dependency tree; you may not need this rule anymore.`);break;case Yi.Redundant:e.report.reportWarning($.REDUNDANT_PACKAGE_EXTENSION,`${f}: This rule seems redundant when applied on the original package; the extension may have been applied upstream.`);break}}if(n!==null){let c=$l(n,this.generateLockfile());if(c!==n){let u=(0,w$.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($.FROZEN_LOCKFILE_EXCEPTION,et(this.configuration,f,Ge.ADDED)):f.startsWith("-")?e.report.reportError($.FROZEN_LOCKFILE_EXCEPTION,et(this.configuration,f,Ge.REMOVED)):e.report.reportInfo(null,et(this.configuration,f,"grey"))}throw e.report.reportSeparator(),new ct($.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===Yi.Active&&((l=ye.telemetry)==null||l.reportPackageExtension(Fc(g,Ge.PACKAGE_EXTENSION)));await e.report.startTimerPromise("Fetch step",async()=>{await this.fetchEverything(e),(typeof e.persistProject=="undefined"||e.persistProject)&&e.mode!==pi.UpdateLockfile&&await this.cacheCleanup(e)});let s=e.immutable?[...new Set(this.configuration.get("immutablePatterns"))].sort():[],o=await Promise.all(s.map(async c=>sw(c,{cwd:this.cwd})));(typeof e.persistProject=="undefined"||e.persistProject)&&await this.persis
`,`# Manual changes might be lost - proceed with caution!
`].join("")}
`+Na(t)}async persistLockfile(){let e=k.join(this.cwd,this.configuration.get("lockfileFilename")),t="";try{t=await K.readFilePromise(e,"utf8")}catch(s){}let i=this.generateLockfile(),n=$l(t,i);n!==t&&(await K.writeFilePromise(e,n),this.lockFileChecksum=S$(n),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let e=[];for(let o of Object.values(oR))e.push(...o);let t=(0,f0.default)(this,e),i=nR.default.serialize(t),n=ln(i);if(this.installStateChecksum===n)return;let s=this.configuration.get("installStatePath");await K.mkdirPromise(k.dirname(s),{recursive:!0}),await K.writeFilePromise(s,await E1e(i)),this.installStateChecksum=n}async restoreInstallState({restoreInstallersCustomData:e=!0,restoreResolutions:t=!0,restoreBuildState:i=!0}={}){let n=this.configuration.get("installStatePath"),s;try{let o=await I1e(await K.readFilePromise(n));s=nR.default.deserialize(o),this.installStateChecksum=ln(o)}catch{t&&await this.applyLightResolution();return}e&&typeof s.installersCustomData!="undefined"&&(this.installersCustomData=s.installersCustomData),i&&Object.assign(this,(0,f0.default)(s,oR.restoreBuildState)),t&&(s.lockFileChecksum===this.lockFileChecksum?(Object.assign(this,(0,f0.default)(s,oR.restoreResolutions)),this.refreshWorkspaceDependencies()):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new hi}),await this.persistInstallStateFile()}async persist(){await this.persistLockfile();for(let e of this.workspacesByCwd.values())await e.persistManifest()}async cacheCleanup({cache:e,report:t}){let i=new Set([".gitignore"]);if(!pk(e.cwd,this.cwd)||!await K.existsPromise(e.cwd))return;let n=this.configuration.get("preferAggregateCacheInfo"),s=0,o=null;for(let a of await K.readdirPromise(e.cwd)){if(i.has(a))continue;let l=k.resolve(e.cwd,a);e.markedFiles.has(l)||(o=a,e.immutable?t.reportError($.IMMUTABLE_CACHE,`${et(this.configuration,k.basename(l),"magenta")} appears to be unused and would be marked for deletion, but the cache is immutable`):(n?s+=1:t.reportInfo($.UNUSED_CACHE_ENTRY,`${et(this.configuration,k.basename(l),"magenta")} appears to be unused - removing`),await K.removePromise(l)))}n&&s!==0&&t.reportInfo($.UNUSED_CACHE_ENTRY,s>1?`${s} packages appeared to be unused and were removed`:`${o} appeared to be unused and was removed`),e.markedFiles.clear()}};function y1e({project:r,allDescriptors:e,allResolutions:t,allPackages:i,accessibleLocators:n=new Set,optionalBuilds:s=new Set,peerRequirements:o=new Map,volatileDescriptors:a=new Set,report:l,tolerateMissingPackages:c=!1}){var oe;let u=new Map,g=[],f=new Map,h=new Map,p=new Map,m=new Map,y=new Map,Q=new Map(r.workspaces.map(Z=>{let A=Z.anchoredLocator.locatorHash,ne=i.get(A);if(typeof ne=="undefined"){if(c)return[A,null];throw new Error("Assertion failed: The workspace should have an associated package")}return[A,Ad(ne)]})),S=()=>{let Z=K.mktempSync(),A=k.join(Z,"stacktrace.log"),ne=String(g.length+1).length,Ae=g.map((ee,O)=>`${`${O+1}.`.padStart(ne," ")} ${Ds(ee)}
`).join("");throw K.writeFileSync(A,Ae),K.detachTemp(Z),new ct($.STACK_OVERFLOW_RESOLUTION,`Encountered a stack overflow when resolving peer dependencies; cf ${j.fromPortablePath(A)}`)},x=Z=>{let A=t.get(Z.descriptorHash);if(typeof A=="undefined")throw new Error("Assertion failed: The resolution should have been registered");let ne=i.get(A);if(!ne)throw new Error("Assertion failed: The package could not be found");return ne},M=(Z,A,ne,{top:Ae,optional:ee})=>{g.length>1e3&&S(),g.push(A);let O=q(Z,A,ne,{top:Ae,optional:ee});return g.pop(),O},q=(Z,A,ne,{top:Ae,optional:ee})=>{if(n.has(A.locatorHash))return;n.add(A.locatorHash),ee||s.delete(A.locatorHash);let O=i.get(A.locatorHash);if(!O){if(c)return;throw new Error(`Assertion failed: The package (${Bt(r.configuration,A)}) should have been registered`)}let N=[],be=[],Ie=[],Ye=[],te=[];for(let Be of Array.from(O.dependencies.values())){if(O.peerDependencies.has(Be.identHash)&&O.locatorHash!==Ae)continue;if(nl(Be))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");a.delete(Be.descriptorHash);let he=ee;if(!he){let ke=O.dependenciesMeta.get(Ot(Be));if(typeof ke!="undefined"){let le=ke.get(null);typeof le!="undefined"&&le.optional&&(he=!0)}}let Fe=t.get(Be.descriptorHash);if(!Fe){if(c)continue;throw new Error(`Assertion failed: The resolution (${nr(r.configuration,Be)}) should have been registered`)}let Oe=Q.get(Fe)||i.get(Fe);if(!Oe)throw new Error(`Assertion failed: The package (${Fe}, resolved from ${nr(r.configuration,Be)}) should have been registered`);if(Oe.peerDependencies.size===0){M(Be,Oe,new Map,{top:Ae,optional:he});continue}let xe,Se,pe=new Set,X;be.push(()=>{xe=rk(Be,A.locatorHash),Se=ik(Oe,A.locatorHash),O.dependencies.delete(Be.identHash),O.dependencies.set(xe.identHash,xe),t.set(xe.descriptorHash,Se.locatorHash),e.set(xe.descriptorHash,xe),i.set(Se.locatorHash,Se),N.push([Oe,xe,Se])}),Ie.push(()=>{var ke;X=new Map;for(let le of Se.peerDependencies.values()){let fe=O.dependencies.get(le.identHash);if(!fe&&ud(A,le)&&(Z.identHash===A.identHash?fe=Z:(fe=tr(A,Z.range),e.set(fe.descriptorHash,fe),t.set(fe.descriptorHash,A.locatorHash),a.delete(fe.descriptorHash))),(!fe||fe.range==="missing:")&&Se.dependencies.has(le.identHash)){Se.peerDependencies.delete(le.identHash);continue}fe||(fe=tr(le,"missing:")),Se.dependencies.set(fe.identHash,fe),nl(fe)&&kc(p,fe.descriptorHash).add(Se.locatorHash),f.set(fe.identHash,fe),fe.range==="missing:"&&pe.add(fe.identHash),X.set(le.identHash,(ke=ne.get(le.identHash))!=null?ke:Se.locatorHash)}Se.dependencies=new Map(Pn(Se.dependencies,([le,fe])=>Ot(fe)))}),Ye.push(()=>{if(!i.has(Se.locatorHash))return;let ke=u.get(Oe.locatorHash);typeof ke=="number"&&ke>=2&&S();let le=u.get(Oe.locatorHash),fe=typeof le!="undefined"?le+1:1;u.set(Oe.locatorHash,fe),M(xe,Se,X,{top:Ae,optional:he}),u.set(Oe.locatorHash,fe-1)}),te.push(()=>{let ke=O.dependencies.get(Be.identHash);if(typeof ke=="undefined")throw new Error("Assertion failed: Expected the peer dependency to have been turned into a dependency");let le=t.get(ke.descriptorHash);if(typeof le=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");if(kc(y,le).add(A.locatorHash),!!i.has(Se.locatorHash)){for(let fe of Se.peerDependencies.values()){let gt=X.get(fe.identHash);if(typeof gt=="undefined")throw new Error("Assertion failed: Expected the peer dependency ident to be registered");xg(kg(m,gt),Ot(fe)).push(Se.locatorHash)}for(let fe of pe)Se.dependencies.delete(fe)}})}for(let Be of[...be,...Ie])Be();let ae;do{ae=!0;for(let[Be,he,Fe]of N){let Oe=kg(h,Be.locatorHash),xe=ln(...[...Fe.dependencies.values()].map(ke=>{let le=ke.range!=="missing:"?t.get(ke.descriptorHash):"missing:";if(typeof le=="undefined")throw new Error(`Assertion failed: Expected the resolution for ${nr(r.configuration,ke)} to have been registered`);return le===Ae?`${le} (top)`:le}),he.identHash),Se=Oe.get(xe);if(typeof Se=="undefined"){Oe.set(xe,he);continue}if(Se===he)continue;i.delete(Fe.locatorHash),e.delete(he.descriptorHash),t.delete(he.
`),(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout,includeLogs:!this.context.quiet},async y=>{await t.install({cache:n,report:y,mode:this.mode})})).exitCode()}};ZC.paths=[["add"]],ZC.usage=Re.Usage({description:"add dependencies to the project",details:"\n This command adds a package to the package.json for the nearest workspace.\n\n - If it didn't exist before, the package will by default be added to the regular `dependencies` field, but this behavior can be overriden thanks to the `-D,--dev` flag (which will cause the dependency to be added to the `devDependencies` field instead) and the `-P,--peer` flag (which will do the same but for `peerDependencies`).\n\n - If the package was already listed in your dependencies, it will by default be upgraded whether it's part of your `dependencies` or `devDependencies` (it won't ever update `peerDependencies`, though).\n\n - If set, the `--prefer-dev` flag will operate as a more flexible `-D,--dev` in that it will add the package to your `devDependencies` if it isn't already listed in either `dependencies` or `devDependencies`, but it will also happily upgrade your `dependencies` if that's what you already use (whereas `-D,--dev` would throw an exception).\n\n - If set, the `-O,--optional` flag will add the package to the `optionalDependencies` field and, in combination with the `-P,--peer` flag, it will add the package as an optional peer dependency. If the package was already listed in your `dependencies`, it will be upgraded to `optionalDependencies`. If the package was already listed in your `peerDependencies`, in combination with the `-P,--peer` flag, it will be upgraded to an optional peer dependency: `\"peerDependenciesMeta\": { \"<package>\": { \"optional\": true } }`\n\n - If the added package doesn't specify a range at all its `latest` tag will be resolved and the returned version will be used to generate a new semver range (using the `^` modifier by default unless otherwise configured via the `defaultSemverRangePrefix` configuration, or the `~` modifier if `-T,--tilde` is specified, or no modifier at all if `-E,--exact` is specified). Two exceptions to this rule: the first one is that if the package is a workspace then its local version will be used, and the second one is that if you use `-P,--peer` the default range will be `*` and won't be resolved at all.\n\n - If the added package specifies a range (such as `^1.0.0`, `latest`, or `rc`), Yarn will add this range as-is in the resulting package.json entry (in particular, tags such as `rc` will be encoded as-is rather than being converted into a semver range).\n\n If the `--cached` option is used, Yarn will preferably reuse the highest version already used somewhere within the project, even if through a transitive dependency.\n\n If the `-i,--interactive` option is used (or if the `preferInteractive` settings is toggled on) the command will first try to check whether other workspaces in the project use the specified package and, if so, will offer to reuse them.\n\n If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n For a compilation of all the supported protocols, please consult the dedicated page from our website: https://yarnpkg.com/features/protocols.\n ",examples:[["Add a regular package to the current workspace","$0 add lo
`),0}return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async s=>{let o=await Xt.getPackageAccessibleBinaries(i,{project:t}),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:P.stringifyIdent(u),path:g});if(this.verbose)for(let[c,[u]]of o)s.reportInfo(null,`${c.padEnd(l," ")} ${P.prettyLocator(e,u)}`);else for(let c of o.keys())s.reportInfo(null,c)})).exitCode()}};$C.paths=[["bin"]],$C.usage=Re.Usage({description:"get the path to a binary script",details:`
When used without arguments, this command will print the list of all the binaries available in the current workspace. Adding the \`-v,--verbose\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary.
When an argument is specified, this command will just print the path to the binary on the standard output and exit. Note that the reported path may be stored within a zip archive.
`,examples:[["List all the available binaries","$0 bin"],["Print the path to a specific binary","$0 bin eslint"]]});var eoe=$C;var em=class extends Ne{constructor(){super(...arguments);this.mirror=z.Boolean("--mirror",!1,{description:"Remove the global cache files instead of the local cache files"});this.all=z.Boolean("--all",!1,{description:"Remove both the global cache files and the local cache files of the current project"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=await Lt.find(e);return(await Je.start({configuration:e,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&t.mirrorCwd!==null,s=!this.mirror;n&&(await K.removePromise(t.mirrorCwd),await e.triggerHook(o=>o.cleanGlobalArtifacts,e)),s&&await K.removePromise(t.cwd)})).exitCode()}};em.paths=[["cache","clean"],["cache","clear"]],em.usage=Re.Usage({description:"remove the shared cache files",details:`
This command will remove all the files from the cache.
`,examples:[["Remove all the local archives","$0 cache clean"],["Remove all the archives stored in the ~/.yarn directory","$0 cache clean --mirror"]]});var toe=em;var roe=ge(v0()),RL=ge(require("util")),tm=class extends Ne{constructor(){super(...arguments);this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.unsafe=z.Boolean("--no-redacted",!1,{description:"Don't redact secrets (such as tokens) from the output"});this.name=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=this.name.replace(/[.[].*$/,""),i=this.name.replace(/^[^.[]*/,"");if(typeof e.settings.get(t)=="undefined")throw new Pe(`Couldn't find a configuration settings named "${t}"`);let s=e.getSpecial(t,{hideSecrets:!this.unsafe,getNativePaths:!0}),o=Qe.convertMapsToIndexableObjects(s),a=i?(0,roe.default)(o,i):o,l=await Je.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}
`),l.exitCode();RL.inspect.styles.name="cyan",this.context.stdout.write(`${(0,RL.inspect)(a,{depth:Infinity,colors:e.get("enableColors"),compact:!1})}
`)}return l.exitCode()}};tm.paths=[["config","get"]],tm.usage=Re.Usage({description:"read a configuration settings",details:`
This command will print a configuration setting.
Secrets (such as tokens) will be redacted from the output by default. If this behavior isn't desired, set the \`--no-redacted\` to get the untransformed value.
`,examples:[["Print a simple configuration setting","yarn config get yarnPath"],["Print a complex configuration setting","yarn config get packageExtensions"],["Print a nested field from the configuration",`yarn config get 'npmScopes["my-company"].npmRegistryServer'`],["Print a token from the configuration","yarn config get npmAuthToken --no-redacted"],["Print a configuration setting as JSON","yarn config get packageExtensions --json"]]});var ioe=tm;var pae=ge(UL()),dae=ge(v0()),Cae=ge(hae()),KL=ge(require("util")),im=class extends Ne{constructor(){super(...arguments);this.json=z.Boolean("--json",!1,{description:"Set complex configuration settings to JSON values"});this.home=z.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=z.String();this.value=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=()=>{if(!e.projectCwd)throw new Pe("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 Pe(`Couldn't find a configuration settings named "${i}"`);if(i==="enableStrictSettings")throw new Pe("This setting only affects the file it's in, and thus cannot be set from the CLI");let o=this.json?JSON.parse(this.value):this.value;await(this.home?h=>ye.updateHomeConfiguration(h):h=>ye.updateConfiguration(t(),h))(h=>{if(n){let p=(0,pae.default)(h);return(0,Cae.default)(p,this.name,o),p}else return ie(L({},h),{[i]:o})});let c=(await ye.find(this.context.cwd,this.context.plugins)).getSpecial(i,{hideSecrets:!0,getNativePaths:!0}),u=Qe.convertMapsToIndexableObjects(c),g=n?(0,dae.default)(u,n):u;return(await Je.start({configuration:e,includeFooter:!1,stdout:this.context.stdout},async h=>{KL.inspect.styles.name="cyan",h.reportInfo($.UNNAMED,`Successfully set ${this.name} to ${(0,KL.inspect)(g,{depth:Infinity,colors:e.get("enableColors"),compact:!1})}`)})).exitCode()}};im.paths=[["config","set"]],im.usage=Re.Usage({description:"change a configuration settings",details:`
This command will set a configuration setting.
When used without the \`--json\` flag, it can only set a simple configuration setting (a string, a number, or a boolean).
When used with the \`--json\` flag, it can set both simple and complex configuration settings, including Arrays and Objects.
`,examples:[["Set a simple configuration setting (a string, a number, or a boolean)","yarn config set initScope myScope"],["Set a simple configuration setting (a string, a number, or a boolean) using the `--json` flag",'yarn config set initScope --json \\"myScope\\"'],["Set a complex configuration setting (an Array) using the `--json` flag",`yarn config set unsafeHttpWhitelist --json '["*.example.com", "example.com"]'`],["Set a complex configuration setting (an Object) using the `--json` flag",`yarn config set packageExtensions --json '{ "@babel/parser@*": { "dependencies": { "@babel/types": "*" } } }'`],["Set a nested configuration setting",'yarn config set npmScopes.company.npmRegistryServer "https://npm.example.com"'],["Set a nested configuration setting using indexed access for non-simple keys",`yarn config set 'npmRegistries["//npm.example.com"].npmAuthToken' "ffffffff-ffff-ffff-ffff-ffffffffffff"`]]});var mae=im;var Sae=ge(UL()),xae=ge(BC()),kae=ge(vae()),nm=class extends Ne{constructor(){super(...arguments);this.home=z.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=()=>{if(!e.projectCwd)throw new Pe("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 Pe(`Couldn't find a configuration settings named "${i}"`);let o=this.home?l=>ye.updateHomeConfiguration(l):l=>ye.updateConfiguration(t(),l);return(await Je.start({configuration:e,includeFooter:!1,stdout:this.context.stdout},async l=>{let c=!1;await o(u=>{if(!(0,xae.default)(u,this.name))return l.reportWarning($.UNNAMED,`Configuration doesn't contain setting ${this.name}; there is nothing to unset`),c=!0,u;let g=n?(0,Sae.default)(u):L({},u);return(0,kae.default)(g,this.name),g}),c||l.reportInfo($.UNNAMED,`Successfully unset ${this.name}`)})).exitCode()}};nm.paths=[["config","unset"]],nm.usage=Re.Usage({description:"unset a configuration setting",details:`
This command will unset a configuration setting.
`,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 Pae=nm;var HL=ge(require("util")),sm=class extends Ne{constructor(){super(...arguments);this.verbose=z.Boolean("-v,--verbose",!1,{description:"Print the setting description on top of the regular key/value information"});this.why=z.Boolean("--why",!1,{description:"Print the reason why a setting is set a particular way"});this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins,{strict:!1});return(await Je.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($.INVALID_CONFIGURATION_KEY,`Invalid configuration key "${n}" in ${s}`);i.reportSeparator()}if(this.json){let n=Qe.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(L({key:s,effective:a,source:l},o))}}else{let n=Qe.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(`Assertion failed: This settings ("${c}") should have been registered`);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,HL.inspect)(e.getSpecial(c,{hideSecrets:!0,getNativePaths:!0}),o)}`)}else for(let a of n)i.reportInfo(null,`${a.padEnd(s," ")} ${(0,HL.inspect)(e.getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),o)}`)}})).exitCode()}};sm.paths=[["config"]],sm.usage=Re.Usage({description:"display the current configuration",details:`
This command prints the current active configuration settings.
`,examples:[["Print the active configuration settings","$0 config"]]});var Dae=sm;Is();var jL={};pt(jL,{Strategy:()=>yu,acceptedStrategies:()=>$8e,dedupe:()=>GL});var Fae=ge(rs()),yu;(function(e){e.HIGHEST="highest"})(yu||(yu={}));var $8e=new Set(Object.values(yu)),eze={highest:async(r,e,{resolver:t,fetcher:i,resolveOptions:n,fetchOptions:s})=>{let o=new Map;for(let[a,l]of r.storedResolutions){let c=r.storedDescriptors.get(a);if(typeof c=="undefined")throw new Error(`Assertion failed: The descriptor (${a}) should have been registered`);Qe.getSetWithDefault(o,c.identHash).add(l)}return Array.from(r.storedDescriptors.values(),async a=>{if(e.length&&!Fae.default.isMatch(P.stringifyIdent(a),e))return null;let l=r.storedResolutions.get(a.descriptorHash);if(typeof l=="undefined")throw new Error(`Assertion failed: The resolution (${a.descriptorHash}) should have been registered`);let c=r.originalPackages.get(l);if(typeof c=="undefined"||!t.shouldPersistResolution(c,n))return null;let u=o.get(a.identHash);if(typeof u=="undefined")throw new Error(`Assertion failed: The resolutions (${a.identHash}) should have been registered`);if(u.size===1)return null;let g=[...u].map(y=>{let Q=r.originalPackages.get(y);if(typeof Q=="undefined")throw new Error(`Assertion failed: The package (${y}) should have been registered`);return Q.reference}),f=await t.getSatisfying(a,g,n),h=f==null?void 0:f[0];if(typeof h=="undefined")return null;let p=h.locatorHash,m=r.originalPackages.get(p);if(typeof m=="undefined")throw new Error(`Assertion failed: The package (${p}) should have been registered`);return p===l?null:{descriptor:a,currentPackage:c,updatedPackage:m}})}};async function GL(r,{strategy:e,patterns:t,cache:i,report:n}){let{configuration:s}=r,o=new hi,a=s.makeResolver(),l=s.makeFetcher(),c={cache:i,checksums:r.storedChecksums,fetcher:l,project:r,report:o,skipIntegrityCheck:!0,cacheOptions:{skipIntegrityCheck:!0}},u={project:r,resolver:a,report:o,fetchOptions:c};return await n.startTimerPromise("Deduplication step",async()=>{let f=await eze[e](r,t,{resolver:a,resolveOptions:u,fetcher:l,fetchOptions:c}),h=qi.progressViaCounter(f.length);n.reportProgress(h);let p=0;await Promise.all(f.map(Q=>Q.then(S=>{if(S===null)return;p++;let{descriptor:x,currentPackage:M,updatedPackage:q}=S;n.reportInfo($.UNNAMED,`${P.prettyDescriptor(s,x)} can be deduped from ${P.prettyLocator(s,M)} to ${P.prettyLocator(s,q)}`),n.reportJson({descriptor:P.stringifyDescriptor(x),currentResolution:P.stringifyLocator(M),updatedResolution:P.stringifyLocator(q)}),r.storedResolutions.set(x.descriptorHash,q.locatorHash)}).finally(()=>h.tick())));let m;switch(p){case 0:m="No packages";break;case 1:m="One package";break;default:m=`${p} packages`}let y=ce.pretty(s,e,ce.Type.CODE);return n.reportInfo($.UNNAMED,`${m} can be deduped using the ${y} strategy`),p})}var om=class extends Ne{constructor(){super(...arguments);this.strategy=z.String("-s,--strategy",yu.HIGHEST,{description:"The strategy to use when deduping dependencies",validator:nn(yu)});this.check=z.Boolean("-c,--check",!1,{description:"Exit with exit code 1 when duplicates are found, without persisting the dependency tree"});this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.mode=z.String("--mode",{description:"Change what artifacts installs generate",validator:nn(pi)});this.patterns=z.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t}=await ze.find(e,this.context.cwd),i=await Lt.find(e);await t.restoreInstallState({restoreResolutions:!1});let n=0,s=await Je.start({configuration:e,includeFooter:!1,stdout:this.context.stdout,json:this.json},async o=>{n=await GL(t,{strategy:this.strategy,patterns:this.patterns,cache:i,report:o})});return s.hasErrors()?s.exitCode():this.check?n?1:0:(await Je.start({configuration:e,stdout:this.context.stdout,json:this.json},async a=>{await t.install({cache:i,report:a,mode:this.mode})})).exitCode()}};om.paths=[["dedupe"]],om.usage=Re.Usage({description:"deduplicate dependencies with overlapping ranges",details:"\
`)}};tb.paths=[["--clipanion=definitions"]];var Tae=tb;var rb=class extends Ne{async execute(){this.context.stdout.write(this.cli.usage(null))}};rb.paths=[["help"],["--help"],["-h"]];var Oae=rb;var YL=class extends Ne{constructor(){super(...arguments);this.leadingArgument=z.String();this.args=z.Proxy()}async execute(){if(this.leadingArgument.match(/[\\/]/)&&!P.tryParseIdent(this.leadingArgument)){let e=k.resolve(this.context.cwd,j.toPortablePath(this.leadingArgument));return await this.cli.run(this.args,{cwd:e})}else return await this.cli.run(["run",this.leadingArgument,...this.args])}},Mae=YL;var ib=class extends Ne{async execute(){this.context.stdout.write(`${Ur||"<unknown>"}
`)}};ib.paths=[["-v"],["--version"]];var Uae=ib;var am=class extends Ne{constructor(){super(...arguments);this.commandName=z.String();this.args=z.Proxy()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,locator:i}=await ze.find(e,this.context.cwd);return await t.restoreInstallState(),await Xt.executePackageShellcode(i,this.commandName,this.args,{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,project:t})}};am.paths=[["exec"]],am.usage=Re.Usage({description:"execute a shell script",details:`
This command simply executes a shell script within the context of the root directory of the active workspace using the portable shell.
It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
`,examples:[["Execute a single shell command","$0 exec echo Hello World"],["Execute a shell script",'$0 exec "tsc & babel src --out-dir lib"']]});var Kae=am;Is();var Am=class extends Ne{constructor(){super(...arguments);this.hash=z.String({required:!1,validator:gp(up(),[fp(/^p[0-9a-f]{5}$/)])})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t}=await ze.find(e,this.context.cwd);return await t.restoreInstallState({restoreResolutions:!1}),await t.applyLightResolution(),typeof this.hash!="undefined"?await tze(this.hash,t,{stdout:this.context.stdout}):(await Je.start({configuration:e,stdout:this.context.stdout,includeFooter:!1},async n=>{var o;let s=[([,a])=>P.stringifyLocator(t.storedPackages.get(a.subject)),([,a])=>P.stringifyIdent(a.requested)];for(let[a,l]of Qe.sortMap(t.peerRequirements,s)){let c=t.storedPackages.get(l.subject);if(typeof c=="undefined")throw new Error("Assertion failed: Expected the subject package to have been registered");let u=t.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=ce.pretty(e,a,ce.Type.CODE),h=P.prettyLocator(e,c),p=P.prettyIdent(e,l.requested),m=P.prettyIdent(e,u),y=l.allRequesters.length-1,Q=`descendant${y===1?"":"s"}`,S=y>0?` and ${y} ${Q}`:"",x=g!==null?"provides":"doesn't provide";n.reportInfo(null,`${f} \u2192 ${h} ${x} ${p} to ${m}${S}`)}})).exitCode()}};Am.paths=[["explain","peer-requirements"]],Am.usage=Re.Usage({description:"explain a set of peer requirements",details:`
A set of peer requirements represents all peer requirements that a dependent must satisfy when providing a given peer request to a requester and its descendants.
When the hash argument is specified, this command prints a detailed explanation of all requirements of the set corresponding to the hash and whether they're satisfied or not.
When used without arguments, this command lists all sets of peer requirements and the corresponding hash that can be used to get detailed information about a given set.
**Note:** A hash is a six-letter p-prefixed code that can be obtained from peer dependency warnings or from the list of all peer requirements (\`yarn explain peer-requirements\`).
`,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 Hae=Am;async function tze(r,e,t){let{configuration:i}=e,n=e.peerRequirements.get(r);if(typeof n=="undefined")throw new Error(`No peerDependency requirements found for hash: "${r}"`);return(await Je.start({configuration:i,stdout:t.stdout,includeFooter:!1},async o=>{var Q,S;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=(Q=a.dependencies.get(n.requested.identHash))!=null?Q: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(x=>{let M=e.storedPackages.get(x);if(typeof M=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let q=P.devirtualizeLocator(M),U=e.storedPackages.get(q.locatorHash);if(typeof U=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let W=U.peerDependencies.get(n.requested.identHash);if(typeof W=="undefined")throw new Error("Assertion failed: Expected the peer dependency to be registered");return{pkg:M,peerDependency:W}});if(g!==null){let x=f.every(({peerDependency:M})=>sr.satisfiesWithPrereleases(g.version,M.range));o.reportInfo($.UNNAMED,`${P.prettyLocator(i,a)} provides ${P.prettyLocator(i,g)} with version ${P.prettyReference(i,(S=g.version)!=null?S:"<missing>")}, which ${x?"satisfies":"doesn't satisfy"} the following requirements:`)}else o.reportInfo($.UNNAMED,`${P.prettyLocator(i,a)} doesn't provide ${P.prettyIdent(i,n.requested)}, breaking the following requirements:`);o.reportSeparator();let h=ce.mark(i),p=[];for(let{pkg:x,peerDependency:M}of Qe.sortMap(f,q=>P.stringifyLocator(q.pkg))){let U=(g!==null?sr.satisfiesWithPrereleases(g.version,M.range):!1)?h.Check:h.Cross;p.push({stringifiedLocator:P.stringifyLocator(x),prettyLocator:P.prettyLocator(i,x),prettyRange:P.prettyRange(i,M.range),mark:U})}let m=Math.max(...p.map(({stringifiedLocator:x})=>x.length)),y=Math.max(...p.map(({prettyRange:x})=>x.length));for(let{stringifiedLocator:x,prettyLocator:M,prettyRange:q,mark:U}of Qe.sortMap(p,({stringifiedLocator:W})=>W))o.reportInfo(null,`${M.padEnd(m+(M.length-x.length)," ")} \u2192 ${q.padEnd(y," ")} ${U}`);p.length>1&&(o.reportSeparator(),o.reportInfo($.UNNAMED,`Note: these requirements start with ${P.prettyLocator(e.configuration,l)}`))})).exitCode()}Is();var jae=ge(ti()),lm=class extends Ne{constructor(){super(...arguments);this.onlyIfNeeded=z.Boolean("--only-if-needed",!1,{description:"Only lock the Yarn version if it isn't already locked"});this.version=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);if(e.get("yarnPath")&&this.onlyIfNeeded)return 0;let t=()=>{if(typeof Ur=="undefined")throw new Pe("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=t();else if(this.version==="latest"||this.version==="berry"||this.version==="stable")i=`https://repo.yarnpkg.com/${await cm(e,"stable")}/packages/yarnpkg-cli/bin/yarn.js`;else if(this.version==="canary")i=`https://repo.yarnpkg.com/${await cm(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}[\\/]/)||j.isAbsolute(this.version))i=`file://${j.resolve(this.version)}`;else if(sr.satisfiesWithPrereleases(this.version,">=2.0.0"))i=`https://repo.yarnpkg.com/${this.version}/pa
${e}`)});let n=(g=r.projectCwd)!=null?g:r.startingCwd,s=k.resolve(n,".yarn/releases"),o=k.resolve(s,`yarn-${e}.cjs`),a=k.relative(r.startingCwd,o),l=k.relative(n,o),c=r.get("yarnPath"),u=c===null||c.startsWith(`${s}/`);if(i.reportInfo($.UNNAMED,`Saving the new release in ${ce.pretty(r,a,"magenta")}`),await K.removePromise(k.dirname(o)),await K.mkdirPromise(k.dirname(o),{recursive:!0}),await K.writeFilePromise(o,t,{mode:493}),u){await ye.updateConfiguration(n,{yarnPath:l});let f=await At.tryFind(n)||new At;f.packageManager=`yarn@${e&&Qe.isTaggedYarnVersion(e)?e:await cm(r,"stable")}`;let h={};f.exportTo(h);let p=k.join(n,At.fileName),m=`${JSON.stringify(h,null,f.indent)}
`;await K.changeFilePromise(p,m,{automaticNewlines:!0})}}function Yae(r){return $[EI(r)]}var ize=/## (?<code>YN[0-9]{4}) - `(?<name>[A-Z_]+)`\n\n(?<details>(?:.(?!##))+)/gs;async function nze(r){let t=`https://repo.yarnpkg.com/${Qe.isTaggedYarnVersion(Ur)?Ur:await cm(r,"canary")}/packages/gatsby/content/advanced/error-codes.md`,i=await rr.get(t,{configuration:r});return new Map(Array.from(i.toString().matchAll(ize),({groups:n})=>{if(!n)throw new Error("Assertion failed: Expected the match to have been successful");let s=Yae(n.code);if(n.name!==s)throw new Error(`Assertion failed: Invalid error code data: Expected "${n.name}" to be named "${s}"`);return[n.code,n.details]}))}var um=class extends Ne{constructor(){super(...arguments);this.code=z.String({required:!1,validator:gp(up(),[fp(/^YN[0-9]{4}$/)])});this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);if(typeof this.code!="undefined"){let t=Yae(this.code),i=ce.pretty(e,t,ce.Type.CODE),n=this.cli.format().header(`${this.code} - ${i}`),o=(await nze(e)).get(this.code),a=typeof o!="undefined"?ce.jsonOrPretty(this.json,e,ce.tuple(ce.Type.MARKDOWN,{text:o,format:this.cli.format(),paragraphs:!0})):`This error code does not have a description.
You can help us by editing this page on GitHub \u{1F642}:
${ce.jsonOrPretty(this.json,e,ce.tuple(ce.Type.URL,"https://github.com/yarnpkg/berry/blob/master/packages/gatsby/content/advanced/error-codes.md"))}
`;this.json?this.context.stdout.write(`${JSON.stringify({code:this.code,name:t,details:a})}
`):this.context.stdout.write(`${n}
${a}
`)}else{let t={children:Qe.mapAndFilter(Object.entries($),([i,n])=>Number.isNaN(Number(i))?Qe.mapAndFilter.skip:{label:qA(Number(i)),value:ce.tuple(ce.Type.CODE,n)})};As.emitTree(t,{configuration:e,stdout:this.context.stdout,json:this.json})}}};um.paths=[["explain"]],um.usage=Re.Usage({description:"explain an error code",details:`
When the code argument is specified, this command prints its name and its details.
When used without arguments, this command lists all error codes and their names.
`,examples:[["Explain an error code","$0 explain YN0006"],["List all error codes","$0 explain"]]});var qae=um;var Jae=ge(rs()),gm=class extends Ne{constructor(){super(...arguments);this.all=z.Boolean("-A,--all",!1,{description:"Print versions of a package from the whole project"});this.recursive=z.Boolean("-R,--recursive",!1,{description:"Print information for all packages, including transitive dependencies"});this.extra=z.Array("-X,--extra",[],{description:"An array of requests of extra data provided by plugins"});this.cache=z.Boolean("--cache",!1,{description:"Print information about the cache entry of a package (path, size, checksum)"});this.dependents=z.Boolean("--dependents",!1,{description:"Print all dependents for each matching package"});this.manifest=z.Boolean("--manifest",!1,{description:"Print data obtained by looking at the package archive (license, homepage, ...)"});this.nameOnly=z.Boolean("--name-only",!1,{description:"Only print the name for the matching packages"});this.virtuals=z.Boolean("--virtuals",!1,{description:"Print each instance of the virtual packages"});this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=z.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Lt.find(e);if(!i&&!this.all)throw new ft(t.cwd,this.context.cwd);await t.restoreInstallState();let s=new Set(this.extra);this.cache&&s.add("cache"),this.dependents&&s.add("dependents"),this.manifest&&s.add("manifest");let o=(x,{recursive:M})=>{let q=x.anchoredLocator.locatorHash,U=new Map,W=[q];for(;W.length>0;){let J=W.shift();if(U.has(J))continue;let oe=t.storedPackages.get(J);if(typeof oe=="undefined")throw new Error("Assertion failed: Expected the package to be registered");if(U.set(J,oe),P.isVirtualLocator(oe)&&W.push(P.devirtualizeLocator(oe).locatorHash),!(!M&&J!==q))for(let Z of oe.dependencies.values()){let A=t.storedResolutions.get(Z.descriptorHash);if(typeof A=="undefined")throw new Error("Assertion failed: Expected the resolution to be registered");W.push(A)}}return U.values()},a=({recursive:x})=>{let M=new Map;for(let q of t.workspaces)for(let U of o(q,{recursive:x}))M.set(U.locatorHash,U);return M.values()},l=({all:x,recursive:M})=>x&&M?t.storedPackages.values():x?a({recursive:M}):o(i,{recursive:M}),c=({all:x,recursive:M})=>{let q=l({all:x,recursive:M}),U=this.patterns.map(oe=>{let Z=P.parseLocator(oe),A=Jae.default.makeRe(P.stringifyIdent(Z)),ne=P.isVirtualLocator(Z),Ae=ne?P.devirtualizeLocator(Z):Z;return ee=>{let O=P.stringifyIdent(ee);if(!A.test(O))return!1;if(Z.reference==="unknown")return!0;let N=P.isVirtualLocator(ee),be=N?P.devirtualizeLocator(ee):ee;return!(ne&&N&&Z.reference!==ee.reference||Ae.reference!==be.reference)}}),W=Qe.sortMap([...q],oe=>P.stringifyLocator(oe));return{selection:W.filter(oe=>U.length===0||U.some(Z=>Z(oe))),sortedLookup:W}},{selection:u,sortedLookup:g}=c({all:this.all,recursive:this.recursive});if(u.length===0)throw new Pe("No package matched your request");let f=new Map;if(this.dependents)for(let x of g)for(let M of x.dependencies.values()){let q=t.storedResolutions.get(M.descriptorHash);if(typeof q=="undefined")throw new Error("Assertion failed: Expected the resolution to be registered");Qe.getArrayWithDefault(f,q).push(x)}let h=new Map;for(let x of g){if(!P.isVirtualLocator(x))continue;let M=P.devirtualizeLocator(x);Qe.getArrayWithDefault(h,M.locatorHash).push(x)}let p={},m={children:p},y=e.makeFetcher(),Q={project:t,fetcher:y,cache:n,checksums:t.storedChecksums,report:new hi,cacheOptions:{skipIntegrityCheck:!0},skipIntegrityCheck:!0},S=[async(x,M,q)=>{var J,oe;if(!M.has("manifest"))return;let U=await y.fetch(x,Q),W;try{W=await At.find(U.prefixPath,{baseFs:U.packageFs})}finally{(J=U.releaseFs)==null||J.call(U)}q("Manifest",{License:ce.tuple(ce.Type.NO_HINT,W.license),Homepage:ce.tuple(ce.Type.URL,(oe=W.raw.homepage)!=null?oe:null)})},async(x,M,q)=>{var A;if(!M.has("cache"))return;let U={mockedPackages:t.disabledLocators,unstablePackages:t.condit
This command sets up your project if needed. The installation is split into four different steps that each have their own characteristics:
- **Resolution:** First the package manager will resolve your dependencies. The exact way a dependency version is privileged over another isn't standardized outside of the regular semver guarantees. If a package doesn't resolve to what you would expect, check that all dependencies are correctly declared (also check our website for more information: ).
- **Fetch:** Then we download all the dependencies if needed, and make sure that they're all stored within our cache (check the value of \`cacheFolder\` in \`yarn config\` to see where the cache files are stored).
- **Link:** Then we send the dependency tree information to internal plugins tasked with writing them on the disk in some form (for example by generating the .pnp.cjs file you might know).
- **Build:** Once the dependency tree has been written on the disk, the package manager will now be free to run the build scripts for all packages that might need it, in a topological order compatible with the way they depend on one another. See https://yarnpkg.com/advanced/lifecycle-scripts for detail.
Note that running this command is not part of the recommended workflow. Yarn supports zero-installs, which means that as long as you store your cache and your .pnp.cjs file inside your repository, everything will work without requiring any install right after cloning your repository or switching branches.
If the \`--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.
If the \`--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).
If the \`--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.
If the \`--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.
If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
- \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
- \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
`,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=fm,oze="|||||||",aze=">>>>>>>",Aze="=======",_ae="<<<<<<<";async function sze(r,e){if(!r.projectCwd)return!1;let t=k.join(r.projectCwd,r.get("lockfileFilename"));if(!await K.existsPromise(t))return!1;let i=await K.readFilePromise(t,"utf8");if(!i.includes(_ae))return!1;if(e)throw new ct($.AUTOMERGE_IMMUTABLE,"Cannot autofix a lockfile when running an immutable install");let[n,s]=lze(i),o,a;try{o=Qi(n),a=Qi(s)}catch(c){throw new ct($.AUTOMERGE_FAILED_TO_PARSE,"The individual variants of the lockfile failed to parse")}let l=L(L({},o),a);for(let[c,u]of Object.entries(l))typeof u=="string"&&delete l[c];return await K.changeFilePromise(t,Na(l),{automaticNewlines:!0}),!0}function lze(r){let e=[[],[]],t=r.split(/\r?\n/g),i=!1;for(;t.length>0;){let n=t.shift();if(typeof n=="undefined")throw new Error("Assertion failed: Some lines should remain");if(n.startsWith(_ae)){for(;t.length>0;){let s=t.shift();if(typeof s=="undefined")throw new Error("Assertion failed: Some lines should remain");if(s===Aze){i=!1;break}else if(i||s.startsWith(oze)){i=!0;continue}else e[0].push(s)}for(;t.length>0;){let s=t.shift();if(typeof s=="undefined")throw new Error("Assertion failed: Some lines should remain");if(s.startsWith(aze))break;e[1].push(s)}}else e[0].push(n),e[1].push(n)}return[e[0].join(`
`),e[1].join(`
`)]}var hm=class extends Ne{constructor(){super(...arguments);this.all=z.Boolean("-A,--all",!1,{description:"Link all workspaces belonging to the target project to the current one"});this.private=z.Boolean("-p,--private",!1,{description:"Also link private workspaces belonging to the target project to the current one"});this.relative=z.Boolean("-r,--relative",!1,{description:"Link workspaces using relative paths instead of absolute paths"});this.destination=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Lt.find(e);if(!i)throw new ft(t.cwd,this.context.cwd);await t.restoreInstallState({restoreResolutions:!1});let s=k.resolve(this.context.cwd,j.toPortablePath(this.destination)),o=await ye.find(s,this.context.plugins,{useRc:!1,strict:!1}),{project:a,workspace:l}=await ze.find(o,s);if(t.cwd===a.cwd)throw new Pe("Invalid destination; Can't link the project to itself");if(!l)throw new ft(a.cwd,s);let c=t.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 Pe("No workspace found to be linked in the target project")}else{if(!l.manifest.name)throw new Pe("The target workspace doesn't have a name and thus cannot be linked");if(l.manifest.private&&!this.private)throw new Pe("The target workspace is marked private - use the --private flag to link it anyway");u.push(l)}for(let f of u){let h=P.stringifyIdent(f.locator),p=this.relative?k.relative(t.cwd,f.cwd):f.cwd;c.manifest.resolutions.push({pattern:{descriptor:{fullName:h}},reference:`portal:${p}`})}return(await Je.start({configuration:e,stdout:this.context.stdout},async f=>{await t.install({cache:n,report:f})})).exitCode()}};hm.paths=[["link"]],hm.usage=Re.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 Vae=hm;var pm=class extends Ne{constructor(){super(...arguments);this.args=z.Proxy()}async execute(){return this.cli.run(["exec","node",...this.args])}};pm.paths=[["node"]],pm.usage=Re.Usage({description:"run node with the hook already setup",details:`
This command simply runs Node. It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
The Node process will use the exact same version of Node as the one used to run Yarn itself, which might be a good way to ensure that your commands always use a consistent Node version.
`,examples:[["Run a Node script","$0 node ./my-script.js"]]});var Xae=pm;var oAe=ge(require("os"));var $ae=ge(require("os"));var cze="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function wu(r){let e=await rr.get(cze,{configuration:r});return Qi(e.toString())}var dm=class extends Ne{constructor(){super(...arguments);this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{let n=await wu(e);for(let s of Object.entries(n)){let[l,o]=s,a=o,{experimental:c}=a,u=Tr(a,["experimental"]);let g=l;c&&(g+=" [experimental]"),i.reportJson(L({name:l,experimental:c},u)),i.reportInfo(null,g)}})).exitCode()}};dm.paths=[["plugin","list"]],dm.usage=Re.Usage({category:"Plugin-related commands",description:"list the available official plugins",details:"\n This command prints the plugins available directly from the Yarn repository. Only those plugins can be referenced by name in `yarn plugin import`.\n ",examples:[["List the official plugins","$0 plugin list"]]});var Zae=dm;var uze=/^[0-9]+$/;function eAe(r){return uze.test(r)?`pull/${r}/head`:r}var gze=({repository:r,branch:e},t)=>[["git","init",j.fromPortablePath(t)],["git","remote","add","origin",r],["git","fetch","origin","--depth=1",eAe(e)],["git","reset","--hard","FETCH_HEAD"]],fze=({branch:r})=>[["git","fetch","origin","--depth=1",eAe(r),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx"]],hze=({plugins:r,noMinify:e},t)=>[["yarn","build:cli",...new Array().concat(...r.map(i=>["--plugin",k.resolve(t,i)])),...e?["--no-minify"]:[],"|"]],Cm=class extends Ne{constructor(){super(...arguments);this.installPath=z.String("--path",{description:"The path where the repository should be cloned to"});this.repository=z.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=z.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.plugins=z.Array("--plugin",[],{description:"An array of additional plugins that should be included in the bundle"});this.noMinify=z.Boolean("--no-minify",!1,{description:"Build a bundle for development (debugging) - non-minified and non-mangled"});this.force=z.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.skipPlugins=z.Boolean("--skip-plugins",!1,{description:"Skip updating the contrib plugins"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t}=await ze.find(e,this.context.cwd),i=typeof this.installPath!="undefined"?k.resolve(this.context.cwd,j.toPortablePath(this.installPath)):k.resolve(j.toPortablePath((0,$ae.tmpdir)()),"yarnpkg-sources",Fn.makeHash(this.repository).slice(0,6));return(await Je.start({configuration:e,stdout:this.context.stdout},async s=>{await WL(this,{configuration:e,report:s,target:i}),s.reportSeparator(),s.reportInfo($.UNNAMED,"Building a fresh bundle"),s.reportSeparator(),await mm(hze(this,i),{configuration:e,context:this.context,target:i}),s.reportSeparator();let o=k.resolve(i,"packages/yarnpkg-cli/bundles/yarn.js"),a=await K.readFilePromise(o);await qL(e,"sources",a,{report:s}),this.skipPlugins||await pze(this,{project:t,report:s,target:i})})).exitCode()}};Cm.paths=[["set","version","from","sources"]],Cm.usage=Re.Usage({description:"build Yarn from master",details:`
This command will clone the Yarn repository into a temporary folder, then build it. The resulting bundle will then be copied into the local project.
By default, it also updates all contrib plugins to the same commit the bundle is built from. This behavior can be disabled by using the \`--skip-plugins\` flag.
`,examples:[["Build Yarn from master","$0 set version from sources"]]});var tAe=Cm;async function mm(r,{configuration:e,context:t,target:i}){for(let[n,...s]of r){let o=s[s.length-1]==="|";if(o&&s.pop(),o)await Rr.pipevp(n,s,{cwd:i,stdin:t.stdin,stdout:t.stdout,stderr:t.stderr,strict:!0});else{t.stdout.write(`${ce.pretty(e,` $ ${[n,...s].join(" ")}`,"grey")}
`);try{await Rr.execvp(n,s,{cwd:i,strict:!0})}catch(a){throw t.stdout.write(a.stdout||a.stack),a}}}}async function WL(r,{configuration:e,report:t,target:i}){let n=!1;if(!r.force&&K.existsSync(k.join(i,".git"))){t.reportInfo($.UNNAMED,"Fetching the latest commits"),t.reportSeparator();try{await mm(fze(r),{configuration:e,context:r.context,target:i}),n=!0}catch(s){t.reportSeparator(),t.reportWarning($.UNNAMED,"Repository update failed; we'll try to regenerate it")}}n||(t.reportInfo($.UNNAMED,"Cloning the remote repository"),t.reportSeparator(),await K.removePromise(i),await K.mkdirPromise(i,{recursive:!0}),await mm(gze(r,i),{configuration:e,context:r.context,target:i}))}async function pze(r,{project:e,report:t,target:i}){let n=await wu(e.configuration),s=new Set(Object.keys(n));for(let o of e.configuration.plugins.keys())!s.has(o)||await JL(o,r,{project:e,report:t,target:i})}var rAe=ge(ti()),iAe=ge(require("url")),nAe=ge(require("vm"));var Em=class extends Ne{constructor(){super(...arguments);this.name=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);return(await Je.start({configuration:e,stdout:this.context.stdout},async i=>{let{project:n}=await ze.find(e,this.context.cwd),s,o;if(this.name.match(/^\.{0,2}[\\/]/)||j.isAbsolute(this.name)){let a=k.resolve(this.context.cwd,j.toPortablePath(this.name));i.reportInfo($.UNNAMED,`Reading ${ce.pretty(e,a,ce.Type.PATH)}`),s=k.relative(n.cwd,a),o=await K.readFilePromise(a)}else{let a;if(this.name.match(/^https?:/)){try{new iAe.URL(this.name)}catch{throw new ct($.INVALID_PLUGIN_REFERENCE,`Plugin specifier "${this.name}" is neither a plugin name nor a valid url`)}s=this.name,a=this.name}else{let l=P.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(l.reference!=="unknown"&&!rAe.default.valid(l.reference))throw new ct($.UNNAMED,"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.");let c=P.stringifyIdent(l),u=await wu(e);if(!Object.prototype.hasOwnProperty.call(u,c))throw new ct($.PLUGIN_NAME_NOT_FOUND,`Couldn't find a plugin named "${c}" on the remote registry. Note that only the plugins referenced on our website (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}/`):Ur!==null&&(a=a.replace(/\/master\//,`/@yarnpkg/cli/${Ur}/`))}i.reportInfo($.UNNAMED,`Downloading ${ce.pretty(e,a,"green")}`),o=await rr.get(a,{configuration:e})}await zL(s,o,{project:n,report:i})})).exitCode()}};Em.paths=[["plugin","import"]],Em.usage=Re.Usage({category:"Plugin-related commands",description:"download a plugin",details:`
This command downloads the specified plugin from its remote location and updates the configuration to reference it in further CLI invocations.
Three types of plugin references are accepted:
- If the plugin is stored within the Yarn repository, it can be referenced by name.
- Third-party plugins can be referenced directly through their public urls.
- Local plugins can be referenced by their path on the disk.
Plugins cannot be downloaded from the npm registry, and aren't allowed to have dependencies (they need to be bundled into a single file, possibly thanks to the \`@yarnpkg/builder\` package).
`,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 sAe=Em;async function zL(r,e,{project:t,report:i}){let{configuration:n}=t,s={},o={exports:s};(0,nAe.runInNewContext)(e.toString(),{module:o,exports:s});let a=o.exports.name,l=`.yarn/plugins/${a}.cjs`,c=k.resolve(t.cwd,l);i.reportInfo($.UNNAMED,`Saving the new plugin in ${ce.pretty(n,l,"magenta")}`),await K.mkdirPromise(k.dirname(c),{recursive:!0}),await K.writeFilePromise(c,e);let u={path:l,spec:r};await ye.updateConfiguration(t.cwd,g=>{let f=[],h=!1;for(let p of g.plugins||[]){let m=typeof p!="string"?p.path:p,y=k.resolve(t.cwd,j.toPortablePath(m)),{name:Q}=Qe.dynamicRequire(y);Q!==a?f.push(p):(f.push(u),h=!0)}return h||f.push(u),ie(L({},g),{plugins:f})})}var dze=({pluginName:r,noMinify:e},t)=>[["yarn",`build:${r}`,...e?["--no-minify"]:[],"|"]],Im=class extends Ne{constructor(){super(...arguments);this.installPath=z.String("--path",{description:"The path where the repository should be cloned to"});this.repository=z.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=z.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.noMinify=z.Boolean("--no-minify",!1,{description:"Build a plugin for development (debugging) - non-minified and non-mangled"});this.force=z.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.name=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=typeof this.installPath!="undefined"?k.resolve(this.context.cwd,j.toPortablePath(this.installPath)):k.resolve(j.toPortablePath((0,oAe.tmpdir)()),"yarnpkg-sources",Fn.makeHash(this.repository).slice(0,6));return(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{let{project:s}=await ze.find(e,this.context.cwd),o=P.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),a=P.stringifyIdent(o),l=await wu(e);if(!Object.prototype.hasOwnProperty.call(l,a))throw new ct($.PLUGIN_NAME_NOT_FOUND,`Couldn't find a plugin named "${a}" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);let c=a;await WL(this,{configuration:e,report:n,target:t}),await JL(c,this,{project:s,report:n,target:t})})).exitCode()}};Im.paths=[["plugin","import","from","sources"]],Im.usage=Re.Usage({category:"Plugin-related commands",description:"build a plugin from sources",details:`
This command clones the Yarn repository into a temporary folder, builds the specified contrib plugin and updates the configuration to reference it in further CLI invocations.
The plugins can be referenced by their short name if sourced from the official Yarn repository.
`,examples:[['Build and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import from sources @yarnpkg/plugin-exec"],['Build and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import from sources exec"]]});var aAe=Im;async function JL(r,{context:e,noMinify:t},{project:i,report:n,target:s}){let o=r.replace(/@yarnpkg\//,""),{configuration:a}=i;n.reportSeparator(),n.reportInfo($.UNNAMED,`Building a fresh ${o}`),n.reportSeparator(),await mm(dze({pluginName:o,noMinify:t},s),{configuration:a,context:e,target:s}),n.reportSeparator();let l=k.resolve(s,`packages/${o}/bundles/${r}.js`),c=await K.readFilePromise(l);await zL(r,c,{project:i,report:n})}var ym=class extends Ne{constructor(){super(...arguments);this.name=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t}=await ze.find(e,this.context.cwd);return(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{let s=this.name,o=P.parseIdent(s);if(!e.plugins.has(s))throw new Pe(`${P.prettyIdent(e,o)} isn't referenced by the current configuration`);let a=`.yarn/plugins/${s}.cjs`,l=k.resolve(t.cwd,a);K.existsSync(l)&&(n.reportInfo($.UNNAMED,`Removing ${ce.pretty(e,a,ce.Type.PATH)}...`),await K.removePromise(l)),n.reportInfo($.UNNAMED,"Updating the configuration..."),await ye.updateConfiguration(t.cwd,c=>{if(!Array.isArray(c.plugins))return c;let u=c.plugins.filter(g=>g.path!==a);return c.plugins.length===u.length?c:ie(L({},c),{plugins:u})})})).exitCode()}};ym.paths=[["plugin","remove"]],ym.usage=Re.Usage({category:"Plugin-related commands",description:"remove a plugin",details:`
This command deletes the specified plugin from the .yarn/plugins folder and removes it from the configuration.
**Note:** The plugins have to be referenced by their name property, which can be obtained using the \`yarn plugin runtime\` command. Shorthands are not allowed.
`,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 AAe=ym;var wm=class extends Ne{constructor(){super(...arguments);this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);return(await Je.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()}};wm.paths=[["plugin","runtime"]],wm.usage=Re.Usage({category:"Plugin-related commands",description:"list the active plugins",details:`
This command prints the currently active plugins. Will be displayed both builtin plugins and external plugins.
`,examples:[["List the currently active plugins","$0 plugin runtime"]]});var lAe=wm;var Bm=class extends Ne{constructor(){super(...arguments);this.idents=z.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Lt.find(e);if(!i)throw new ft(t.cwd,this.context.cwd);let s=new Set;for(let a of this.idents)s.add(P.parseIdent(a).identHash);if(await t.restoreInstallState({restoreResolutions:!1}),await t.resolveEverything({cache:n,report:new hi}),s.size>0)for(let a of t.storedPackages.values())s.has(a.identHash)&&t.storedBuildState.delete(a.locatorHash);else t.storedBuildState.clear();return(await Je.start({configuration:e,stdout:this.context.stdout,includeLogs:!this.context.quiet},async a=>{await t.install({cache:n,report:a})})).exitCode()}};Bm.paths=[["rebuild"]],Bm.usage=Re.Usage({description:"rebuild the project's native packages",details:`
This command will automatically cause Yarn to forget about previous compilations of the given packages and to run them again.
Note that while Yarn forgets the compilation, the previous artifacts aren't erased from the filesystem and may affect the next builds (in good or bad). To avoid this, you may remove the .yarn/unplugged folder, or any other relevant location where packages might have been stored (Yarn may offer a way to do that automatically in the future).
By default all packages will be rebuilt, but you can filter the list by specifying the names of the packages you want to clear from memory.
`,examples:[["Rebuild all packages","$0 rebuild"],["Rebuild fsevents only","$0 rebuild fsevents"]]});var cAe=Bm;var _L=ge(rs());Is();var bm=class extends Ne{constructor(){super(...arguments);this.all=z.Boolean("-A,--all",!1,{description:"Apply the operation to all workspaces from the current project"});this.mode=z.String("--mode",{description:"Change what artifacts installs generate",validator:nn(pi)});this.patterns=z.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Lt.find(e);if(!i)throw new ft(t.cwd,this.context.cwd);await t.restoreInstallState({restoreResolutions:!1});let s=this.all?t.workspaces:[i],o=[Hr.REGULAR,Hr.DEVELOPMENT,Hr.PEER],a=[],l=!1,c=[];for(let h of this.patterns){let p=!1,m=P.parseIdent(h);for(let y of s){let Q=[...y.manifest.peerDependenciesMeta.keys()];for(let S of(0,_L.default)(Q,h))y.manifest.peerDependenciesMeta.delete(S),l=!0,p=!0;for(let S of o){let x=y.manifest.getForScope(S),M=[...x.values()].map(q=>P.stringifyIdent(q));for(let q of(0,_L.default)(M,P.stringifyIdent(m))){let{identHash:U}=P.parseIdent(q),W=x.get(U);if(typeof W=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");y.manifest[S].delete(U),c.push([y,S,W]),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 Pe(`${u} ${ce.prettyList(e,a,Ls.CODE)} ${g} match any packages referenced by ${f} workspace`);return l?(await e.triggerMultipleHooks(p=>p.afterWorkspaceDependencyRemoval,c),(await Je.start({configuration:e,stdout:this.context.stdout},async p=>{await t.install({cache:n,report:p,mode:this.mode})})).exitCode()):0}};bm.paths=[["remove"]],bm.usage=Re.Usage({description:"remove dependencies from the project",details:`
This command will remove the packages matching the specified patterns from the current workspace.
If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
- \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
- \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.
`,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 uAe=bm;var gAe=ge(require("util")),sb=class extends Ne{async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ft(t.cwd,this.context.cwd);return(await Je.start({configuration:e,stdout:this.context.stdout},async s=>{let o=i.manifest.scripts,a=Qe.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,gAe.inspect)(g,l)}`)})).exitCode()}};sb.paths=[["run"]];var fAe=sb;var Qm=class extends Ne{constructor(){super(...arguments);this.inspect=z.String("--inspect",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.inspectBrk=z.String("--inspect-brk",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.topLevel=z.Boolean("-T,--top-level",!1,{description:"Check the root workspace for scripts and/or binaries instead of the current one"});this.binariesOnly=z.Boolean("-B,--binaries-only",!1,{description:"Ignore any user defined scripts and only check for binaries"});this.silent=z.Boolean("--silent",{hidden:!0});this.scriptName=z.String();this.args=z.Proxy()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i,locator:n}=await ze.find(e,this.context.cwd);await t.restoreInstallState();let s=this.topLevel?t.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await Xt.hasPackageScript(s,this.scriptName,{project:t}))return await Xt.executePackageScript(s,this.scriptName,this.args,{project:t,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let o=await Xt.getPackageAccessibleBinaries(s,{project:t});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 Xt.executePackageAccessibleBinary(s,this.scriptName,this.args,{cwd:this.context.cwd,project:t,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(t.workspaces.map(async u=>u.manifest.scripts.has(this.scriptName)?u:null))).filter(u=>u!==null);if(c.length===1)return await Xt.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 Pe(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${P.prettyLocator(e,n)}). This typically happens because some package depends on "node-gyp" to build itself, but didn't list it in their dependencies. To fix that, please run "yarn add node-gyp" into your top-level workspace. You also can open an issue on the repository of the specified package to suggest them to use an optional peer dependency.`):new Pe(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${P.prettyLocator(e,n)}).`);{if(this.scriptName==="global")throw new Pe("The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead");let l=[this.scriptName].concat(this.args);for(let[c,u]of Rf)for(let g of u)if(l.length>=g.length&&JSON.stringify(l.slice(0,g.length))===JSON.stringify(g))throw new Pe(`Couldn't find a script named "${this.scriptName}", but a matchin
This command will run a tool. The exact tool that will be executed will depend on the current state of your workspace:
- If the \`scripts\` field from your local package.json contains a matching script name, its definition will get executed.
- Otherwise, if one of the local workspace's dependencies exposes a binary with a matching name, this binary will get executed.
- Otherwise, if the specified name contains a colon character and if one of the workspaces in the project contains exactly one script with a matching name, then this script will get executed.
Whatever happens, the cwd of the spawned process will be the workspace that declares the script (which makes it possible to call commands cross-workspaces using the third syntax).
`,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 hAe=Qm;var vm=class extends Ne{constructor(){super(...arguments);this.save=z.Boolean("-s,--save",!1,{description:"Persist the resolution inside the top-level manifest"});this.descriptor=z.String();this.resolution=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Lt.find(e);if(await t.restoreInstallState({restoreResolutions:!1}),!i)throw new ft(t.cwd,this.context.cwd);let s=P.parseDescriptor(this.descriptor,!0),o=P.makeDescriptor(s,this.resolution);return t.storedDescriptors.set(s.descriptorHash,s),t.storedDescriptors.set(o.descriptorHash,o),t.resolutionAliases.set(s.descriptorHash,o.descriptorHash),(await Je.start({configuration:e,stdout:this.context.stdout},async l=>{await t.install({cache:n,report:l})})).exitCode()}};vm.paths=[["set","resolution"]],vm.usage=Re.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 pAe=vm;var dAe=ge(rs()),Sm=class extends Ne{constructor(){super(...arguments);this.all=z.Boolean("-A,--all",!1,{description:"Unlink all workspaces belonging to the target project from the current one"});this.leadingArguments=z.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Lt.find(e);if(!i)throw new ft(t.cwd,this.context.cwd);let s=t.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=k.resolve(this.context.cwd,j.toPortablePath(l));if(Qe.isPathLike(l)){let u=await ye.find(c,this.context.plugins,{useRc:!1,strict:!1}),{project:g,workspace:f}=await ze.find(u,c);if(!f)throw new ft(g.cwd,c);if(this.all){for(let h of g.workspaces)h.manifest.name&&o.add(P.stringifyIdent(h.locator));if(o.size===0)throw new Pe("No workspace found to be unlinked in the target project")}else{if(!f.manifest.name)throw new Pe("The target workspace doesn't have a name and thus cannot be unlinked");o.add(P.stringifyIdent(f.locator))}}else{let u=[...s.manifest.resolutions.map(({pattern:g})=>g.descriptor.fullName)];for(let g of(0,dAe.default)(u,l))o.add(g)}}return s.manifest.resolutions=s.manifest.resolutions.filter(({pattern:l})=>!o.has(l.descriptor.fullName)),(await Je.start({configuration:e,stdout:this.context.stdout},async l=>{await t.install({cache:n,report:l})})).exitCode()}};Sm.paths=[["unlink"]],Sm.usage=Re.Usage({description:"disconnect the local project from another one",details:`
This command will remove any resolutions in the project-level manifest that would have been added via a yarn link with similar arguments.
`,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 CAe=Sm;var mAe=ge(_C()),VL=ge(rs());Is();var $f=class extends Ne{constructor(){super(...arguments);this.interactive=z.Boolean("-i,--interactive",{description:"Offer various choices, depending on the detected upgrade paths"});this.exact=z.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=z.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=z.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.recursive=z.Boolean("-R,--recursive",!1,{description:"Resolve again ALL resolutions for those packages"});this.mode=z.String("--mode",{description:"Change what artifacts installs generate",validator:nn(pi)});this.patterns=z.Rest()}async execute(){return this.recursive?await this.executeUpRecursive():await this.executeUpClassic()}async executeUpRecursive(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Lt.find(e);if(!i)throw new ft(t.cwd,this.context.cwd);await t.restoreInstallState({restoreResolutions:!1});let s=[...t.storedDescriptors.values()],o=s.map(u=>P.stringifyIdent(u)),a=new Set;for(let u of this.patterns){if(P.parseDescriptor(u).range!=="unknown")throw new Pe("Ranges aren't allowed when using --recursive");for(let g of(0,VL.default)(o,u)){let f=P.parseIdent(g);a.add(f.identHash)}}let l=s.filter(u=>a.has(u.identHash));for(let u of l)t.storedDescriptors.delete(u.descriptorHash),t.storedResolutions.delete(u.descriptorHash);return(await Je.start({configuration:e,stdout:this.context.stdout},async u=>{await t.install({cache:n,report:u})})).exitCode()}async executeUpClassic(){var m;let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Lt.find(e);if(!i)throw new ft(t.cwd,this.context.cwd);await t.restoreInstallState({restoreResolutions:!1});let s=(m=this.interactive)!=null?m:e.get("preferInteractive"),o=VC(this,t),a=s?[_r.KEEP,_r.REUSE,_r.PROJECT,_r.LATEST]:[_r.PROJECT,_r.LATEST],l=[],c=[];for(let y of this.patterns){let Q=!1,S=P.parseDescriptor(y);for(let x of t.workspaces)for(let M of[Hr.REGULAR,Hr.DEVELOPMENT]){let U=[...x.manifest.getForScope(M).values()].map(W=>P.stringifyIdent(W));for(let W of(0,VL.default)(U,P.stringifyIdent(S))){let J=P.parseIdent(W),oe=x.manifest[M].get(J.identHash);if(typeof oe=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");let Z=P.makeDescriptor(J,S.range);l.push(Promise.resolve().then(async()=>[x,M,oe,await XC(Z,{project:t,workspace:x,cache:n,target:M,modifier:o,strategies:a})])),Q=!0}}Q||c.push(y)}if(c.length>1)throw new Pe(`Patterns ${ce.prettyList(e,c,Ls.CODE)} don't match any packages referenced by any workspace`);if(c.length>0)throw new Pe(`Pattern ${ce.prettyList(e,c,Ls.CODE)} doesn't match any packages referenced by any workspace`);let u=await Promise.all(l),g=await gA.start({configuration:e,stdout:this.context.stdout,suggestInstall:!1},async y=>{for(let[,,Q,{suggestions:S,rejections:x}]of u){let M=S.filter(q=>q.descriptor!==null);if(M.length===0){let[q]=x;if(typeof q=="undefined")throw new Error("Assertion failed: Expected an error to have been set");let U=this.cli.error(q);t.configuration.get("enableNetwork")?y.reportError($.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,Q)} can't be resolved to a satisfying range
${U}`):y.reportError($.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,Q)} can't be resolved to a satisfying range (note: network resolution has been disabled)
${U}`)}else M.length>1&&!s&&y.reportError($.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,Q)} has multiple possible upgrade strategies; use -i to disambiguate manually`)}});if(g.hasErrors())return g.exitCode();let f=!1,h=[];for(let[y,Q,,{suggestions:S}]of u){let x,M=S.filter(J=>J.descriptor!==null),q=M[0].descriptor,U=M.every(J=>P.areDescriptorsEqual(J.descriptor,q));M.length===1||U?x=q:(f=!0,{answer:x}=await(0,mAe.prompt)({type:"select",name:"answer",message:`Which range to you want to use in ${P.prettyWorkspace(e,y)} \u276F ${Q}?`,choices:S.map(({descriptor:J,name:oe,reason:Z})=>J?{name:oe,hint:Z,descriptor:J}:{name:oe,hint:Z,disabled:!0}),onCancel:()=>process.exit(130),result(J){return this.find(J,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let W=y.manifest[Q].get(x.identHash);if(typeof W=="undefined")throw new Error("Assertion failed: This descriptor should have a matching entry");if(W.descriptorHash!==x.descriptorHash)y.manifest[Q].set(x.identHash,x),h.push([y,Q,W,x]);else{let J=e.makeResolver(),oe={project:t,resolver:J},Z=J.bindDescriptor(W,y.anchoredLocator,oe);t.forgetResolution(Z)}}return await e.triggerMultipleHooks(y=>y.afterWorkspaceDependencyReplacement,h),f&&this.context.stdout.write(`
`),(await Je.start({configuration:e,stdout:this.context.stdout},async y=>{await t.install({cache:n,report:y,mode:this.mode})})).exitCode()}};$f.paths=[["up"]],$f.usage=Re.Usage({description:"upgrade dependencies across the project",details:"\n This command upgrades the packages matching the list of specified patterns to their latest available version across the whole project (regardless of whether they're part of `dependencies` or `devDependencies` - `peerDependencies` won't be affected). This is a project-wide command: all workspaces will be upgraded in the process.\n\n If `-R,--recursive` is set the command will change behavior and no other switch will be allowed. When operating under this mode `yarn up` will force all ranges matching the selected packages to be resolved again (often to the highest available versions) before being stored in the lockfile. It however won't touch your manifests anymore, so depending on your needs you might want to run both `yarn up` and `yarn up -R` to cover all bases.\n\n If `-i,--interactive` is set (or if the `preferInteractive` settings is toggled on) the command will offer various choices, depending on the detected upgrade paths. Some upgrades require this flag in order to resolve ambiguities.\n\n The, `-C,--caret`, `-E,--exact` and `-T,--tilde` options have the same meaning as in the `add` command (they change the modifier used when the range is missing or a tag, and are ignored when the range is explicitly set).\n\n If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n Generally you can see `yarn up` as a counterpart to what was `yarn upgrade --latest` in Yarn 1 (ie it ignores the ranges previously listed in your manifests), but unlike `yarn upgrade` which only upgraded dependencies in the current workspace, `yarn up` will upgrade all workspaces at the same time.\n\n This command accepts glob patterns as arguments (if valid Descriptors and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n\n **Note:** The ranges have to be static, only the package scopes and names can contain glob patterns.\n ",examples:[["Upgrade all instances of lodash to the latest release","$0 up lodash"],["Upgrade all instances of lodash to the latest release, but ask confirmation for each","$0 up lodash -i"],["Upgrade all instances of lodash to 1.2.3","$0 up lodash@1.2.3"],["Upgrade all instances of packages with the `@babel` scope to the latest release","$0 up '@babel/*'"],["Upgrade all instances of packages containing the word `jest` to the latest release","$0 up '*jest*'"],["Upgrade all instances of packages with the `@babel` scope to 7.0.0","$0 up '@babel/*@7.0.0'"]]}),$f.schema=[ov("recursive",Cc.Forbids,["interactive","exact","tilde","caret"],{ignore:[void 0,!1]})];var EAe=$f;var xm=class extends Ne{constructor(){super(...arguments);this.recursive=z.Boolean("-R,--recursive",!1,{description:"List, for each workspace, what are all the paths that lead to the dependency"});this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.peers=z.Boolean("--peers",!1,{description:"Also print the peer dependencies that match the specified name"});this.package=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.c
This command prints the exact reasons why a package appears in the dependency tree.
If \`-R,--recursive\` is set, the listing will go in depth and will list, for each workspaces, what are all the paths that lead to the dependency. Note that the display is somewhat optimized in that it will not print the package listing twice for a single package, so if you see a leaf named "Foo" when looking for "Bar", it means that "Foo" already got printed higher in the tree.
`,examples:[["Explain why lodash is used in your project","$0 why lodash"]]});var IAe=xm;function Cze(r,e,{configuration:t,peers:i}){let n=Qe.sortMap(r.storedPackages.values(),a=>P.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=r.storedResolutions.get(u.descriptorHash);if(!g)throw new Error("Assertion failed: The resolution should have been registered");let f=r.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=P.stringifyLocator(a);s[p]={value:[a,ce.Type.LOCATOR],children:l}}let h=P.stringifyLocator(f);l[h]={value:[{descriptor:u,locator:f},ce.Type.DEPENDENT]}}}return o}function mze(r,e,{configuration:t,peers:i}){let n=Qe.sortMap(r.workspaces,f=>P.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 m=r.storedResolutions.get(p.descriptorHash);if(!m)throw new Error("Assertion failed: The resolution should have been registered");let y=r.storedPackages.get(m);if(!y)throw new Error("Assertion failed: The package should have been registered");a(y)&&(h=!0)}return h&&o.add(f.locatorHash),h};for(let f of n){let h=r.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 m=p!==null?ce.tuple(ce.Type.DEPENDENT,{locator:f,descriptor:p}):ce.tuple(ce.Type.LOCATOR,f),y={},Q={value:m,children:y},S=P.stringifyLocator(f);if(h[S]=Q,!l.has(f.locatorHash)&&(l.add(f.locatorHash),!(p!==null&&r.tryWorkspaceByLocator(f))))for(let x of f.dependencies.values()){if(!i&&f.peerDependencies.has(x.identHash))continue;let M=r.storedResolutions.get(x.descriptorHash);if(!M)throw new Error("Assertion failed: The resolution should have been registered");let q=r.storedPackages.get(M);if(!q)throw new Error("Assertion failed: The package should have been registered");g(q,y,x)}};for(let f of n){let h=r.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 AN={};pt(AN,{default:()=>Uze,gitUtils:()=>Bu});var Bu={};pt(Bu,{TreeishProtocols:()=>Mn,clone:()=>sN,fetchBase:()=>HAe,fetchChangedFiles:()=>jAe,fetchChangedWorkspaces:()=>Oze,fetchRoot:()=>KAe,isGitUrl:()=>th,lsRemote:()=>UAe,normalizeLocator:()=>rN,normalizeRepoUrl:()=>km,resolveUrl:()=>nN,splitRepoUrl:()=>Pm});var eN=ge(NAe()),TAe=ge(Vw()),eh=ge(require("querystring")),tN=ge(ti()),OAe=ge(require("url"));function MAe(){return ie(L({},process.env),{GIT_SSH_COMMAND:"ssh -o BatchMode=yes"})}var Tze=[/^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\/(.+)?$/],Mn;(function(n){n.Commit="commit",n.Head="head",n.Tag="tag",n.Semver="semver"})(Mn||(Mn={}));function th(r){return r?Tze.some(e=>!!r.match(e)):!1}function Pm(r){r=km(r);let e=r.indexOf("#");if(e===-1)return{repo:r,treeish:{protocol:Mn.Head,request:"HEAD"},extra:{}};let t=r.slice(0,e),i=r.slice(e+1);if(i.match(/^[a-z]+=/)){let n=eh.default.parse(i);for(let[l,c]of Object.entries(n))if(typeof c!="string")throw new Error(`Assertion failed: The ${l} parameter must be a literal string`);let s=Object.values(Mn).find(l=>Object.prototype.hasOwnProperty.call(n,l)),o,a;typeof s!="undefined"?(o=s,a=n[s]):(o=Mn.Head,a="HEAD");for(let l of Object.values(Mn))delete n[l];return{repo:t,treeish:{protocol:o,request:a},extra:n}}else{let n=i.indexOf
- ${a.join(`
- `)}?`)}return this.cli.run([this.commandName,...this.args],{cwd:o.cwd})}};Fm.paths=[["workspace"]],Fm.usage=Re.Usage({category:"Workspace-related commands",description:"run a command within the specified workspace",details:`
This command will run a given sub-command on a single workspace.
`,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 YAe=Fm;var Kze={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:Ee.BOOLEAN,default:qAe.isCI},defaultSemverRangePrefix:{description:"The default save prefix: '^', '~' or ''",type:Ee.STRING,values:["^","~",""],default:ga.CARET}},commands:[toe,ioe,mae,Pae,pAe,tAe,Gae,GAe,Tae,Oae,Mae,Uae,$se,eoe,Dae,Rae,Kae,Hae,qae,Wae,zae,Vae,CAe,Xae,aAe,sAe,AAe,Zae,lAe,cAe,uAe,fAe,hAe,EAe,IAe,YAe]},Hze=Kze;var fN={};pt(fN,{default:()=>Gze});var qe={optional:!0},JAe=[["@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:qe,zenObservable:qe}}],["any-observable@<0.5.1",{peerDependenciesMeta:{rxjs:qe,zenObservable:qe}}],["@pm2/agent@<1.0.4",{dependencies:{debug:"*"}}],["debug@<4.2.0",{peerDependenciesMeta:{["supports-color"]:qe}}],["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"]:qe,["postcss-jsx"]:qe,["postcss-less"]:qe,["postcss-markdown"]:qe,["postcss-scss"]:qe}}],["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:qe}}],["snowpack@>=3.3.0",{dependencies:{["node-gyp"]:"^7.1.0"}}],["promise-inflight@*",{peerDependenciesMeta:{bluebird:qe}}],["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:qe,"vue-template-compiler":qe}}],["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:qe,"utf-8-validate":qe}}],["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-f
`),await K.writeFilePromise(k.join(t,"yarn.lock"),"");let i=k.join(t,".yarnrc.yml"),n=await ye.findProjectCwd(this.context.cwd,Pt.lockfile),s=!(await ye.find(this.context.cwd,null,{strict:!1})).get("enableGlobalCache"),o=n!==null?k.join(n,".yarnrc.yml"):null;o!==null&&K.existsSync(o)?(await K.copyFilePromise(o,i),await ye.updateConfiguration(t,m=>{let y=ie(L({},m),{enableGlobalCache:s,enableTelemetry:!1});return Array.isArray(m.plugins)&&(y.plugins=m.plugins.map(Q=>{let S=typeof Q=="string"?Q:Q.path,x=j.isAbsolute(S)?S:j.resolve(j.fromPortablePath(n),S);return typeof Q=="string"?x:{path:x,spec:Q.spec}})),y})):await K.writeFilePromise(i,`enableGlobalCache: ${s}
enableTelemetry: false
`);let a=(p=this.packages)!=null?p:[this.command],l=P.parseDescriptor(this.command).name,c=await this.cli.run(["add","--",...a],{cwd:t,quiet:this.quiet});if(c!==0)return c;this.quiet||this.context.stdout.write(`
`);let u=await ye.find(t,this.context.plugins),{project:g,workspace:f}=await ze.find(u,t);if(f===null)throw new ft(g.cwd,t);await g.restoreInstallState();let h=await Xt.getWorkspaceAccessibleBinaries(f);return h.has(l)===!1&&h.size===1&&typeof this.packages=="undefined"&&(l=Array.from(h)[0][0]),await Xt.executeWorkspaceAccessibleBinary(f,l,this.args,{packageAccessibleBinaries:h,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};Rm.paths=[["dlx"]],Rm.usage=Re.Usage({description:"run a package in a temporary environment",details:"\n This command will install a package within a temporary environment, and run its binary script if it contains any. The binary will run within the current cwd.\n\n By default Yarn will download the package named `command`, but this can be changed through the use of the `-p,--package` flag which will instruct Yarn to still run the same command but from a different package.\n\n Using `yarn dlx` as a replacement of `yarn add` isn't recommended, as it makes your project non-deterministic (Yarn doesn't keep track of the packages installed through `dlx` - neither their name, nor their version).\n ",examples:[["Use create-react-app to create a new React app","yarn dlx create-react-app ./my-app"],["Install multiple packages for a single command",`yarn dlx -p typescript -p ts-node ts-node --transpile-only -e "console.log('hello!')"`]]});var ZAe=Rm;var Yze={commands:[XAe,ZAe]},qze=Yze;var BN={};pt(BN,{default:()=>zze,fileUtils:()=>pN});var rh=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,Lm=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,Vr="file:";var pN={};pt(pN,{makeArchiveFromLocator:()=>ab,makeBufferFromLocator:()=>mN,makeLocator:()=>CN,makeSpec:()=>$Ae,parseSpec:()=>dN});function dN(r){let{params:e,selector:t}=P.parseRange(r),i=j.toPortablePath(t);return{parentLocator:e&&typeof e.locator=="string"?P.parseLocator(e.locator):null,path:i}}function $Ae({parentLocator:r,path:e,folderHash:t,protocol:i}){let n=r!==null?{locator:P.stringifyLocator(r)}:{},s=typeof t!="undefined"?{hash:t}:{};return P.makeRange({protocol:i,source:e,selector:e,params:L(L({},s),n)})}function CN(r,{parentLocator:e,path:t,folderHash:i,protocol:n}){return P.makeLocator(r,$Ae({parentLocator:e,path:t,folderHash:i,protocol:n}))}async function ab(r,{protocol:e,fetchOptions:t,inMemory:i=!1}){let{parentLocator:n,path:s}=P.parseFileStyleRange(r.reference,{protocol:e}),o=k.isAbsolute(s)?{packageFs:new zt(Ue.root),prefixPath:Ue.dot,localPath:Ue.root}:await t.fetcher.fetch(n,t),a=o.localPath?{packageFs:new zt(Ue.root),prefixPath:k.relative(Ue.root,o.localPath)}:o;o!==a&&o.releaseFs&&o.releaseFs();let l=a.packageFs,c=k.join(a.prefixPath,s);return await Qe.releaseAfterUseAsync(async()=>await wi.makeArchiveFromDirectory(c,{baseFs:l,prefixPath:P.getIdentVendorPath(r),compressionLevel:t.project.configuration.get("compressionLevel"),inMemory:i}),a.releaseFs)}async function mN(r,{protocol:e,fetchOptions:t}){return(await ab(r,{protocol:e,fetchOptions:t,inMemory:!0})).getBufferAndClose()}var EN=class{supports(e,t){return!!e.reference.startsWith(Vr)}getLocalPath(e,t){let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:Vr});if(k.isAbsolute(n))return n;let s=t.fetcher.getLocalPath(i,t);return s===null?null:k.resolve(s,n)}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,L({onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${P.prettyLocator(t.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFromDisk(e,t),skipIntegrityCheck:t.skipIntegrityCheck},t.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:P.getIdentVendorPath(e),localPath:this.getLocalPath(e,t),checksum:o}}async fetchFromDisk(e,t){return ab(e,{protocol:Vr,fetchOptions:t})}};var Jze=2,IN=class{supportsDescriptor(e,t){return e.range.match(rh)?!0:!!e.range.startsWith(Vr)}supportsLocator(e,t){return!!e.reference.startsWith(Vr)}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i)
`);let o=k.join(this.context.cwd,At.fileName);await K.changeFilePromise(o,`${JSON.stringify(s,null,2)}
`,{automaticNewlines:!0});let a=k.join(this.context.cwd,"README.md");if(K.existsSync(a)||await K.writeFilePromise(a,`# ${P.stringifyIdent(i.name)}
`),!t||t.cwd===this.context.cwd){let c=k.join(this.context.cwd,Pt.lockfile);K.existsSync(c)||await K.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(y=>`${y}
`).join(""),f=k.join(this.context.cwd,".gitignore");K.existsSync(f)||await K.writeFilePromise(f,g);let h={["*"]:{endOfLine:"lf",insertFinalNewline:!0},["*.{js,json,yml}"]:{charset:"utf-8",indentStyle:"space",indentSize:2}};(0,Ple.default)(h,e.get("initEditorConfig"));let p=`root = true
`;for(let[y,Q]of Object.entries(h)){p+=`
[${y}]
`;for(let[S,x]of Object.entries(Q))p+=`${S.replace(/[A-Z]/g,q=>`_${q.toLowerCase()}`)} = ${x}
`}let m=k.join(this.context.cwd,".editorconfig");K.existsSync(m)||await K.writeFilePromise(m,p),K.existsSync(k.join(this.context.cwd,".git"))||await Rr.execvp("git",["init"],{cwd:this.context.cwd})}}};Om.paths=[["init"]],Om.usage=Re.Usage({description:"create a new package",details:"\n This command will setup a new package in your local directory.\n\n If the `-p,--private` or `-w,--workspace` options are set, the package will be private by default.\n\n If the `-w,--workspace` option is set, the package will be configured to accept a set of workspaces in the `packages/` directory.\n\n If the `-i,--install` option is given a value, Yarn will first download it using `yarn set version` and only then forward the init call to the newly downloaded bundle. Without arguments, the downloaded bundle will be `latest`.\n\n The initial settings of the manifest can be changed by using the `initScope` and `initFields` configuration values. Additionally, Yarn will generate an EditorConfig file whose rules can be altered via `initEditorConfig`, and will initialize a Git repository in the current directory.\n ",examples:[["Create a new package in the local directory","yarn init"],["Create a new private package in the local directory","yarn init -p"],["Create a new package and store the Yarn release inside","yarn init -i=latest"],["Create a new private package and defines it as a workspace root","yarn init -w"]]});var Dle=Om;var $4e={configuration:{initScope:{description:"Scope used when creating packages via the init command",type:Ee.STRING,default:null},initFields:{description:"Additional fields to set when creating packages via the init command",type:Ee.MAP,valueDefinition:{description:"",type:Ee.ANY}},initEditorConfig:{description:"Extra rules to define in the generator editorconfig",type:Ee.MAP,valueDefinition:{description:"",type:Ee.ANY}}},commands:[Dle]},e_e=$4e;var ON={};pt(ON,{default:()=>r_e});var EA="portal:",IA="link:";var RN=class{supports(e,t){return!!e.reference.startsWith(EA)}getLocalPath(e,t){let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:EA});if(k.isAbsolute(n))return n;let s=t.fetcher.getLocalPath(i,t);return s===null?null:k.resolve(s,n)}async fetch(e,t){var c;let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:EA}),s=k.isAbsolute(n)?{packageFs:new zt(Ue.root),prefixPath:Ue.dot,localPath:Ue.root}:await t.fetcher.fetch(i,t),o=s.localPath?{packageFs:new zt(Ue.root),prefixPath:k.relative(Ue.root,s.localPath),localPath:Ue.root}:s;s!==o&&s.releaseFs&&s.releaseFs();let a=o.packageFs,l=k.resolve((c=o.localPath)!=null?c:o.packageFs.getRealPath(),o.prefixPath,n);return s.localPath?{packageFs:new zt(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Ue.dot,localPath:l}:{packageFs:new Fa(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Ue.dot}}};var LN=class{supportsDescriptor(e,t){return!!e.range.startsWith(EA)}supportsLocator(e,t){return!!e.reference.startsWith(EA)}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i){return P.bindDescriptor(e,{locator:P.stringifyLocator(t)})}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){let n=e.range.slice(EA.length);return[P.makeLocator(e,`${EA}${j.toPortablePath(n)}`)]}async getSatisfying(e,t,i){return null}async resolve(e,t){if(!t.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let i=await t.fetchOptions.fetcher.fetch(e,t.fetchOptions),n=await Qe.releaseAfterUseAsync(async()=>await At.find(i.prefixPath,{baseFs:i.packageFs}),i.releaseFs);return ie(L({},e),{version:n.version||"0.0.0",languageName:n.languageName||t.project.configuration.get("defaultLanguageName"),linkType:Qt.SOFT,conditions:n.getConditions(),dependencies:new Map([...n.dependencies]),peerDependencies:n.peerDependencies,dependenciesMeta:n.dependenciesMeta,peerDependenciesMeta:n.peerDependenciesMeta,bin:n.bin})}};var NN=class{supports(e,t){return!!e.reference.startsWith(IA)}getLocalPath(e,t){let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:IA});if(k.isAbso
${u}, next tree:
${Mm(a)}`);let f=Rle(a);if(f)throw new Error(`${f}, after hoisting finished:
${Mm(a)}`)}return s.debugLevel>=2&&console.log(Mm(a)),n_e(a)},s_e=r=>{let e=r[r.length-1],t=new Map,i=new Set,n=s=>{if(!i.has(s)){i.add(s);for(let o of s.hoistedDependencies.values())t.set(o.name,o);for(let o of s.dependencies.values())s.peerNames.has(o.name)||n(o)}};return n(e),t},o_e=r=>{let e=r[r.length-1],t=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 r)u=g.dependencies.get(c.name),u&&t.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),t},Nle=(r,e)=>{if(e.decoupled)return e;let{name:t,references:i,ident:n,locator:s,dependencies:o,originalDependencies:a,hoistedDependencies:l,peerNames:c,reasons:u,isHoistBorder:g,hoistPriority:f,dependencyKind:h,hoistedFrom:p,hoistedTo:m}=e,y={name:t,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,dependencyKind:h,hoistedFrom:new Map(p),hoistedTo:new Map(m)},Q=y.dependencies.get(t);return Q&&Q.ident==y.ident&&y.dependencies.set(t,y),r.dependencies.set(y.name,y),y},a_e=(r,e)=>{let t=new Map([[r.name,[r.ident]]]);for(let n of r.dependencies.values())r.peerNames.has(n.name)||t.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(!r.peerNames.has(s)){let a=t.get(s);a||(a=[],t.set(s,a)),a.indexOf(o)<0&&a.push(o)}}return t},KN=r=>{let e=new Set,t=(i,n=new Set)=>{if(!n.has(i)){n.add(i);for(let s of i.peerNames)if(!r.peerNames.has(s)){let o=r.dependencies.get(s);o&&!e.has(o)&&t(o,n)}e.add(i)}};for(let i of r.dependencies.values())r.peerNames.has(i.name)||t(i);return e},UN=(r,e,t,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=l_e(o),l=a_e(o,a),c=r==o?new Map:n.fastLookupPossible?s_e(e):o_e(e),u,g=!1,f=!1,h=new Map(Array.from(l.entries()).map(([m,y])=>[m,y[0]])),p=new Map;do{let m=A_e(r,e,t,c,h,l,i,p,n);m.isGraphChanged&&(f=!0),m.anotherRoundNeeded&&(g=!0),u=!1;for(let[y,Q]of l)Q.length>1&&!o.dependencies.has(y)&&(h.delete(y),Q.shift(),h.set(y,Q[0]),u=!0)}while(u);for(let m of o.dependencies.values())if(!o.peerNames.has(m.name)&&!t.has(m.locator)){t.add(m.locator);let y=UN(r,[...e,m],t,p,n);y.isGraphChanged&&(f=!0),y.anotherRoundNeeded&&(g=!0),t.delete(m.locator)}return{anotherRoundNeeded:g,isGraphChanged:f}},c_e=(r,e,t,i,n,s,o,a,{outputReason:l,fastLookupPossible:c})=>{let u,g=null,f=new Set;l&&(u=`${Array.from(e).map(y=>Ri(y)).join("\u2192")}`);let h=t[t.length-1],m=!(i.ident===h.ident);if(l&&!m&&(g="- self-reference"),m&&(m=i.dependencyKind!==1,l&&!m&&(g="- workspace")),m&&(m=i.dependencyKind!==2||i.dependencies.size===0,l&&!m&&(g="- external soft link with unhoisted dependencies")),m&&(m=h.dependencyKind!==1||h.hoistedFrom.has(i.name)||e.size===1,l&&!m&&(g=h.reasons.get(i.name))),m&&(m=!r.peerNames.has(i.name),l&&!m&&(g=`- cannot shadow peer: ${Ri(r.originalDependencies.get(i.name).locator)} at ${u}`)),m){let y=!1,Q=n.get(i.name);if(y=!Q||Q.ident===i.ident,l&&!y&&(g=`- filled by: ${Ri(Q.locator)} at ${u}`),y)for(let S=t.length-1;S>=1;S--){let M=t[S].dependencies.get(i.name);if(M&&M.ident!==i.ident){y=!1;let q=a.get(h);q||(q=new Set,a.set(h,q)),q.add(i.name),l&&(g=`- filled by ${Ri(M.locator)} at ${t.slice(0,S).map(U=>Ri(U.locator)).join("\u2192")}`);break}}m=y}if(m&&(m=s.get(i.name)===i.ident,l&&!m&&(g=`- filled by: ${Ri(o.get(i.name)[0])} at ${u}`)),m){let y=!0,Q=new Set(i.peerNames);for(let S=t.length-1;S>=1;S--){let x=t[S];for(let M of Q){if(x.peerNames.has(M)&&x.originalDependencies.has(M))continue;let q=x.dependencies.get(M);q&&r.depe
${Mm(r)}`)}let oe=KN(S);for(let Z of oe)if(W.has(Z)){let A=U.get(Z);if((n.get(Z.name)===Z.ident||!S.reasons.has(Z.name))&&A.isHoistable!==0&&S.reasons.set(Z.name,A.reason),!Z.isHoistBorder&&M.indexOf(Z.locator)<0){u.add(S);let Ae=Nle(S,Z);h([...y,S],[...Q,S.locator],Ae,m),u.delete(S)}}},p,m=new Set(KN(c));do{p=m,m=new Set;for(let y of p){if(y.locator===c.locator||y.isHoistBorder)continue;let Q=Nle(c,y);h([],Array.from(t),Q,m)}}while(m.size>0);return{anotherRoundNeeded:g,isGraphChanged:f}},Rle=r=>{let e=[],t=new Set,i=new Set,n=(s,o,a)=>{if(t.has(s)||(t.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=>Ri(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()} - broken peer promise: expected ${c.ident} but found ${f&&f.ident}`)}else{let f=a.hoistedFrom.get(s.name),h=s.hoistedTo.get(c.name),p=`${f?` hoisted from ${f.join(", ")}`:""}`,m=`${h?` hoisted to ${h}`:""}`,y=`${g()}${p}`;u?u.ident!==c.ident&&e.push(`${y} - broken require promise for ${c.name}${m}: expected ${c.ident}, but found: ${u.ident}`):e.push(`${y} - broken require promise: no required dependency ${c.name}${m} 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(r,r.dependencies,r),e.join(`
`)},i_e=(r,e)=>{let{identName:t,name:i,reference:n,peerNames:s}=r,o={name:i,references:new Set([n]),locator:MN(t,n),ident:Fle(t,n),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(s),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistPriority:0,dependencyKind:1,hoistedFrom:new Map,hoistedTo:new Map},a=new Map([[r,o]]),l=(c,u)=>{let g=a.get(c),f=!!g;if(!g){let{name:h,identName:p,reference:m,peerNames:y,hoistPriority:Q,dependencyKind:S}=c,x=e.hoistingLimits.get(u.locator);g={name:h,references:new Set([m]),locator:MN(p,m),ident:Fle(p,m),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(y),reasons:new Map,decoupled:!0,isHoistBorder:x?x.has(h):!1,hoistPriority:Q||0,dependencyKind:S||0,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=m=>{if(!h.has(m)){h.add(m),m.decoupled=!1;for(let y of m.dependencies.values())m.peerNames.has(y.name)||p(y)}};p(g)}else for(let h of c.dependencies)l(h,g)};for(let c of r.dependencies)l(c,o);return o},HN=r=>r.substring(0,r.indexOf("@",1)),n_e=r=>{let e={name:r.name,identName:HN(r.locator),references:new Set(r.references),dependencies:new Set},t=new Set([r]),i=(n,s,o)=>{let a=t.has(n),l;if(s===n)l=o;else{let{name:c,references:u,locator:g}=n;l={name:c,identName:HN(g),references:u,dependencies:new Set}}if(o.dependencies.add(l),!a){t.add(n);for(let c of n.dependencies.values())n.peerNames.has(c.name)||i(c,n,l);t.delete(n)}};for(let n of r.dependencies.values())i(n,r,e);return e},l_e=r=>{let e=new Map,t=new Set([r]),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=!!t.has(a);if(n(a).dependents.add(o.ident),!l){t.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 r.dependencies.values())r.peerNames.has(o.name)||s(r,o);return e},Ri=r=>{if(!r)return"none";let e=r.indexOf("@",1),t=r.substring(0,e);t.endsWith("$wsroot$")&&(t=`wh:${t.replace("$wsroot$","")}`);let i=r.substring(e+1);if(i==="workspace:.")return".";if(i){let n=(i.indexOf("#")>0?i.split("#")[1]:i).replace("npm:","");return i.startsWith("virtual")&&(t=`v:${t}`),n.startsWith("workspace")&&(t=`w:${t}`,n=""),`${t}${n?`@${n}`:""}`}else return`${t}`},Tle=5e4,Mm=r=>{let e=0,t=(n,s,o="")=>{if(e>Tle||s.has(n))return"";e++;let a=Array.from(n.dependencies.values()).sort((c,u)=>c.name===u.name?0:c.name>u.name?1:-1),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=HN(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}:`:"")+Ri(u.locator)+(g?` ${g}`:"")+(u!==n&&h.length>0?`, hoisted from: ${h.join(", ")}`:"")}
`,l+=t(u,s,`${o}${c<a.length-1?"\u2502 ":" "}`)}}return s.delete(n),l};return t(r,new Set)+(e>Tle?`
Tree is too large, part of the tree has been dunped
`:"")};var wo;(function(t){t.HARD="HARD",t.SOFT="SOFT"})(wo||(wo={}));var Un;(function(i){i.WORKSPACES="workspaces",i.DEPENDENCIES="dependencies",i.NONE="none"})(Un||(Un={}));var Ole="node_modules",bu="$wsroot$";var Um=(r,e)=>{let{packageTree:t,hoistingLimits:i,errors:n,preserveSymlinksRequired:s}=u_e(r,e),o=null;if(n.length===0){let a=Lle(t,{hoistingLimits:i});o=g_e(r,a,e)}return{tree:o,errors:n,preserveSymlinksRequired:s}},fa=r=>`${r.name}@${r.reference}`,jN=r=>{let e=new Map;for(let[t,i]of r.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(t)}for(let t of e.values())t.locations=t.locations.sort((i,n)=>{let s=i.split(k.delimiter).length,o=n.split(k.delimiter).length;return n===i?0:s!==o?o-s:n>i?1:-1});return e},Mle=(r,e)=>{let t=P.isVirtualLocator(r)?P.devirtualizeLocator(r):r,i=P.isVirtualLocator(e)?P.devirtualizeLocator(e):e;return P.areLocatorsEqual(t,i)},GN=(r,e,t,i)=>{if(r.linkType!==wo.SOFT)return!1;let n=j.toPortablePath(t.resolveVirtual&&e.reference&&e.reference.startsWith("virtual:")?t.resolveVirtual(r.packageLocation):r.packageLocation);return k.contains(i,n)===null},f_e=r=>{let e=r.getPackageInformation(r.topLevel);if(e===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");if(r.findPackageLocator(e.packageLocation)===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let i=j.toPortablePath(e.packageLocation.slice(0,-1)),n=new Map,s={children:new Map},o=r.getDependencyTreeRoots(),a=new Map,l=new Set,c=(f,h)=>{let p=fa(f);if(l.has(p))return;l.add(p);let m=r.getPackageInformation(f);if(m){let y=h?fa(h):"";if(fa(f)!==y&&m.linkType===wo.SOFT&&!GN(m,f,r,i)){let Q=Ule(m,f,r);(!a.get(Q)||f.reference.startsWith("workspace:"))&&a.set(Q,f)}for(let[Q,S]of m.packageDependencies)S!==null&&(m.packagePeers.has(Q)||c(r.getLocator(Q,S),f))}};for(let f of o)c(f,null);let u=i.split(k.sep);for(let f of a.values()){let h=r.getPackageInformation(f),m=j.toPortablePath(h.packageLocation.slice(0,-1)).split(k.sep).slice(u.length),y=s;for(let Q of m){let S=y.children.get(Q);S||(S={children:new Map},y.children.set(Q,S)),y=S}y.workspaceLocator=f}let g=(f,h)=>{if(f.workspaceLocator){let p=fa(h),m=n.get(p);m||(m=new Set,n.set(p,m)),m.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},u_e=(r,e)=>{let t=[],i=!1,n=new Map,s=f_e(r),o=r.getPackageInformation(r.topLevel);if(o===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");let a=r.findPackageLocator(o.packageLocation);if(a===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let l=j.toPortablePath(o.packageLocation.slice(0,-1)),c={name:a.name,identName:a.name,reference:a.reference,peerNames:o.packagePeers,dependencies:new Set,dependencyKind:cs.WORKSPACE},u=new Map,g=(h,p)=>`${fa(p)}:${h}`,f=(h,p,m,y,Q,S,x,M)=>{var ee,O;let q=g(h,m),U=u.get(q),W=!!U;!W&&m.name===a.name&&m.reference===a.reference&&(U=c,u.set(q,c));let J=GN(p,m,r,l);if(!U){let N=cs.REGULAR;J?N=cs.EXTERNAL_SOFT_LINK:p.linkType===wo.SOFT&&m.name.endsWith(bu)&&(N=cs.WORKSPACE),U={name:h,identName:m.name,reference:m.reference,dependencies:new Set,peerNames:N===cs.WORKSPACE?new Set:p.packagePeers,dependencyKind:N},u.set(q,U)}let oe;if(J?oe=2:Q.linkType===wo.SOFT?oe=1:oe=0,U.hoistPriority=Math.max(U.hoistPriority||0,oe),M&&!J){let N=fa({name:y.identName,reference:y.reference}),be=n.get(N)||new Set;n.set(N,be),be.add(U.name)}let Z=new Map(p.packageDependencies);if(e.project){let N=e.project.workspacesByCwd.get(j.toPortablePath(p.packageLocation.slice(0,-1)));if(N){let be=new Set([...Array.from(N.manifest.peerDependencies.values(),Ie=>P.stringifyIdent(Ie)),...Array.from(N.manifest.peerDependenciesMeta.keys())]);for(let Ie of be)Z.has(Ie)||(Z.set(Ie,S.get(Ie)||null),U.peerNames.add(Ie))}}let A=fa({name:m.name.replace(bu,""),reference:m.refer
`;for(let s=0,o=r.length;s<o;++s)n+=i+Ab(String(s),r[s],e,i).replace(/^ +/,""),s+1<o&&(n+=","),n+=`
`;return n+=t,n+="]",n}function C_e(r,e,t){let i=Object.keys(r),n="";n+="{";for(let s=0,o=i.length;s<o;++s){let a=i[s],l=r[a];typeof l!="undefined"&&(n+=JSON.stringify(a),n+=": ",n+=Ab(a,l,e,t).replace(/^ +/g,""),s+1<o&&(n+=", "))}return n+="}",n}function m_e(r,e,t){let i=Object.keys(r),n=`${t} `,s="";s+=t,s+=`{
`;for(let o=0,a=i.length;o<a;++o){let l=i[o],c=r[l];typeof c!="undefined"&&(s+=n,s+=JSON.stringify(l),s+=": ",s+=Ab(l,c,e,n).replace(/^ +/g,""),o+1<a&&(s+=","),s+=`
`)}return s+=t,s+="}",s}function Ab(r,e,t,i){let{next:n}=Hle[t],s=n[r]||n["*"];return jle(e,s,i)}function jle(r,e,t){let{collapsed:i}=Hle[e];return Array.isArray(r)?i?p_e(r,e,t):d_e(r,e,t):typeof r=="object"&&r!==null?i?C_e(r,e,t):m_e(r,e,t):JSON.stringify(r)}function Gle(r){return jle(r,$t.TOP_LEVEL,"")}function Km(r,e){let t=Array.from(r);Array.isArray(e)||(e=[e]);let i=[];for(let s of e)i.push(t.map(o=>s(o)));let n=t.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=>t[s])}function E_e(r){let e=new Map,t=Km(r.fallbackExclusionList||[],[({name:i,reference:n})=>i,({name:i,reference:n})=>n]);for(let{name:i,reference:n}of t){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 I_e(r){return Km(r.fallbackPool||[],([e])=>e)}function y_e(r){let e=[];for(let[t,i]of Km(r.packageRegistry,([n])=>n===null?"0":`1${n}`)){let n=[];e.push([t,n]);for(let[s,{packageLocation:o,packageDependencies:a,packagePeers:l,linkType:c,discardFromLookup:u}]of Km(i,([g])=>g===null?"0":`1${g}`)){let g=[];t!==null&&s!==null&&!a.has(t)&&g.push([t,s]);for(let[p,m]of Km(a.entries(),([y])=>y))g.push([p,m]);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 Hm(r){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:r.dependencyTreeRoots,enableTopLevelFallback:r.enableTopLevelFallback||!1,ignorePatternData:r.ignorePattern||null,fallbackExclusionList:E_e(r),fallbackPool:I_e(r),packageRegistryData:y_e(r)}}var Jle=ge(qle());function Wle(r,e){return[r?`${r}
`:"",`/* eslint-disable */
`,`try {
`,` Object.freeze({}).detectStrictMode = true;
`,`} catch (error) {
`," throw new Error(`The whole PnP file got strict-mode-ified, which is known to break (Emscripten libraries aren't strict mode). This usually happens when the file goes through Babel.`);\n",`}
`,`
`,`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
`,e.replace(/^/gm," "),`}
`,`
`,(0,Jle.default)()].join("")}function w_e(r){return JSON.stringify(r,null,2)}function B_e(r){return[`return hydrateRuntimeState(${Gle(r)}, {basePath: basePath || __dirname});
`].join("")}function b_e(r){return[`var path = require('path');
`,`var dataLocation = path.resolve(__dirname, ${JSON.stringify(r)});
`,`return hydrateRuntimeState(require(dataLocation), {basePath: basePath || path.dirname(dataLocation)});
`].join("")}function zle(r){let e=Hm(r),t=B_e(e);return Wle(r.shebang,t)}function _le(r){let e=Hm(r),t=b_e(r.dataLocation),i=Wle(r.shebang,t);return{dataFile:w_e(e),loaderFile:i}}var ece=ge(require("fs")),P_e=ge(require("path")),tce=ge(require("util"));function qN(r,{basePath:e}){let t=j.toPortablePath(e),i=k.resolve(t),n=r.ignorePatternData!==null?new RegExp(r.ignorePatternData):null,s=new Map,o=new Map(r.packageRegistryData.map(([g,f])=>[g,new Map(f.map(([h,p])=>{var x;if(g===null!=(h===null))throw new Error("Assertion failed: The name and reference should be null, or neither should");let m=(x=p.discardFromLookup)!=null?x:!1,y={name:g,reference:h},Q=s.get(p.packageLocation);Q?(Q.discardFromLookup=Q.discardFromLookup&&m,m||(Q.locator=y)):s.set(p.packageLocation,{locator:y,discardFromLookup:m});let S=null;return[h,{packageDependencies:new Map(p.packageDependencies),packagePeers:new Set(p.packagePeers),linkType:p.linkType,discardFromLookup:m,get packageLocation(){return S||(S=k.join(i,p.packageLocation))}}]}))])),a=new Map(r.fallbackExclusionList.map(([g,f])=>[g,new Set(f)])),l=new Map(r.fallbackPool),c=r.dependencyTreeRoots,u=r.enableTopLevelFallback;return{basePath:t,dependencyTreeRoots:c,enableTopLevelFallback:u,fallbackExclusionList:a,fallbackPool:l,ignorePattern:n,packageLocatorsByLocations:s,packageRegistry:o}}var jm=ge(require("module")),$le=ge(Xle()),WN=ge(require("util"));var dr;(function(c){c.API_ERROR="API_ERROR",c.BUILTIN_NODE_RESOLUTION_FAILED="BUILTIN_NODE_RESOLUTION_FAILED",c.EXPORTS_RESOLUTION_FAILED="EXPORTS_RESOLUTION_FAILED",c.MISSING_DEPENDENCY="MISSING_DEPENDENCY",c.MISSING_PEER_DEPENDENCY="MISSING_PEER_DEPENDENCY",c.QUALIFIED_PATH_RESOLUTION_FAILED="QUALIFIED_PATH_RESOLUTION_FAILED",c.INTERNAL="INTERNAL",c.UNDECLARED_DEPENDENCY="UNDECLARED_DEPENDENCY",c.UNSUPPORTED="UNSUPPORTED"})(dr||(dr={}));var S_e=new Set([dr.BUILTIN_NODE_RESOLUTION_FAILED,dr.MISSING_DEPENDENCY,dr.MISSING_PEER_DEPENDENCY,dr.QUALIFIED_PATH_RESOLUTION_FAILED,dr.UNDECLARED_DEPENDENCY]);function Ci(r,e,t={},i){i!=null||(i=S_e.has(r)?"MODULE_NOT_FOUND":r);let n={configurable:!0,writable:!0,enumerable:!1};return Object.defineProperties(new Error(e),{code:ie(L({},n),{value:i}),pnpCode:ie(L({},n),{value:r}),data:ie(L({},n),{value:t})})}function ha(r){return j.normalize(j.fromPortablePath(r))}var x_e=ge(require("fs")),Zle=ge(require("module")),k_e=new Set(Zle.Module.builtinModules||Object.keys(process.binding("natives"))),lb=r=>r.startsWith("node:")||k_e.has(r);function zN(r,e){let t=Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK)>0,i=Number(process.env.PNP_DEBUG_LEVEL),n=/^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/,s=/^(\/|\.{1,2}(\/|$))/,o=/\/$/,a=/^\.{0,2}\//,l={name:null,reference:null},c=[],u=new Set;if(r.enableTopLevelFallback===!0&&c.push(l),e.compatibilityMode!==!1)for(let te of["react-scripts","gatsby"]){let ae=r.packageRegistry.get(te);if(ae)for(let Be of ae.keys()){if(Be===null)throw new Error("Assertion failed: This reference shouldn't be null");c.push({name:te,reference:Be})}}let{ignorePattern:g,packageRegistry:f,packageLocatorsByLocations:h}=r;function p(te,ae){return{fn:te,args:ae,error:null,result:null}}function m(te){var Oe,xe,Se,pe,X,ke;let ae=(Se=(xe=(Oe=process.stderr)==null?void 0:Oe.hasColors)==null?void 0:xe.call(Oe))!=null?Se:process.stdout.isTTY,Be=(le,fe)=>`[${le}m${fe}`,he=te.error;console.error(he?Be("31;1",`\u2716 ${(pe=te.error)==null?void 0:pe.message.replace(/\n.*/s,"")}`):Be("33;1","\u203C Resolution")),te.args.length>0&&console.error();for(let le of te.args)console.error(` ${Be("37;1","In \u2190")} ${(0,WN.inspect)(le,{colors:ae,compact:!0})}`);te.result&&(console.error(),console.error(` ${Be("37;1","Out \u2192")} ${(0,WN.inspect)(te.result,{colors:ae,compact:!0})}`));let Fe=(ke=(X=new Error().stack.match(/(?<=^ +)at.*/gm))==null?void 0:X.slice(2))!=null?ke:[];if(Fe.length>0){console.error();for(let le of Fe)console.error(` ${Be("38;5;244",le)}`)}console.error()}function y(te,ae){if(e.allowDebug===!1)return ae;if(Number.isFinite(i)){if(i>=2)return(...Be)=>{let
Require request: "${he}"
Required by: ${Fe}
`,{request:he,issuer:Fe});return j.toPortablePath(Se)}let Oe,xe=te.match(n);if(xe){if(!ae)throw Ci(dr.API_ERROR,"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:he,issuer:Fe});let[,Se,pe]=xe,X=ee(ae);if(!X){let jt=W(te,ae);if(jt===!1)throw Ci(dr.BUILTIN_NODE_RESOLUTION_FAILED,`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree).
Require path: "${he}"
Required by: ${Fe}
`,{request:he,issuer:Fe});return j.toPortablePath(jt)}let le=Q(X).packageDependencies.get(Se),fe=null;if(le==null&&X.name!==null){let jt=r.fallbackExclusionList.get(X.name);if(!jt||!jt.has(X.reference)){for(let Ni=0,Xs=c.length;Ni<Xs;++Ni){let Hn=Q(c[Ni]).packageDependencies.get(Se);if(Hn!=null){t?fe=Hn:le=Hn;break}}if(r.enableTopLevelFallback&&le==null&&fe===null){let Ni=r.fallbackPool.get(Se);Ni!=null&&(fe=Ni)}}}let gt=null;if(le===null)if(S(X))gt=Ci(dr.MISSING_PEER_DEPENDENCY,`Your application tried to access ${Se} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed.
Required package: ${Se}${Se!==he?` (via "${he}")`:""}
Required by: ${Fe}
`,{request:he,issuer:Fe,dependencyName:Se});else{let jt=Ae(Se,X);jt.every(Qr=>S(Qr))?gt=Ci(dr.MISSING_PEER_DEPENDENCY,`${X.name} tried to access ${Se} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.
Required package: ${Se}${Se!==he?` (via "${he}")`:""}
Required by: ${X.name}@${X.reference} (via ${Fe})
${jt.map(Qr=>`Ancestor breaking the chain: ${Qr.name}@${Qr.reference}
`).join("")}
`,{request:he,issuer:Fe,issuerLocator:Object.assign({},X),dependencyName:Se,brokenAncestors:jt}):gt=Ci(dr.MISSING_PEER_DEPENDENCY,`${X.name} tried to access ${Se} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
Required package: ${Se}${Se!==he?` (via "${he}")`:""}
Required by: ${X.name}@${X.reference} (via ${Fe})
${jt.map(Qr=>`Ancestor breaking the chain: ${Qr.name}@${Qr.reference}
`).join("")}
`,{request:he,issuer:Fe,issuerLocator:Object.assign({},X),dependencyName:Se,brokenAncestors:jt})}else le===void 0&&(!Be&&lb(te)?S(X)?gt=Ci(dr.UNDECLARED_DEPENDENCY,`Your application tried to access ${Se}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${Se} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.
Required package: ${Se}${Se!==he?` (via "${he}")`:""}
Required by: ${Fe}
`,{request:he,issuer:Fe,dependencyName:Se}):gt=Ci(dr.UNDECLARED_DEPENDENCY,`${X.name} tried to access ${Se}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${Se} isn't otherwise declared in ${X.name}'s dependencies, this makes the require call ambiguous and unsound.
Required package: ${Se}${Se!==he?` (via "${he}")`:""}
Required by: ${Fe}
`,{request:he,issuer:Fe,issuerLocator:Object.assign({},X),dependencyName:Se}):S(X)?gt=Ci(dr.UNDECLARED_DEPENDENCY,`Your application tried to access ${Se}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
Required package: ${Se}${Se!==he?` (via "${he}")`:""}
Required by: ${Fe}
`,{request:he,issuer:Fe,dependencyName:Se}):gt=Ci(dr.UNDECLARED_DEPENDENCY,`${X.name} tried to access ${Se}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: ${Se}${Se!==he?` (via "${he}")`:""}
Required by: ${X.name}@${X.reference} (via ${Fe})
`,{request:he,issuer:Fe,issuerLocator:Object.assign({},X),dependencyName:Se}));if(le==null){if(fe===null||gt===null)throw gt||new Error("Assertion failed: Expected an error to have been set");le=fe;let jt=gt.message.replace(/\n.*/g,"");gt.message=jt,!u.has(jt)&&i!==0&&(u.add(jt),process.emitWarning(gt))}let Ht=Array.isArray(le)?{name:le[0],reference:le[1]}:{name:Se,reference:le},Mt=Q(Ht);if(!Mt.packageLocation)throw Ci(dr.MISSING_DEPENDENCY,`A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod.
Required package: ${Ht.name}@${Ht.reference}${Ht.name!==he?` (via "${he}")`:""}
Required by: ${X.name}@${X.reference} (via ${Fe})
`,{request:he,issuer:Fe,dependencyLocator:Object.assign({},Ht)});let mi=Mt.packageLocation;pe?Oe=k.join(mi,pe):Oe=mi}else if(k.isAbsolute(te))Oe=k.normalize(te);else{if(!ae)throw Ci(dr.API_ERROR,"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:he,issuer:Fe});let Se=k.resolve(ae);ae.match(o)?Oe=k.normalize(k.join(Se,te)):Oe=k.normalize(k.join(k.dirname(Se),te))}return k.normalize(Oe)}function N(te,ae,Be=x){if(s.test(te))return ae;let he=M(ae,Be);return he?k.normalize(he):ae}function be(te,{extensions:ae=Object.keys(jm.Module._extensions)}={}){let Be=[],he=q(te,Be,{extensions:ae});if(he)return k.normalize(he);{let Fe=ha(te),Oe=ee(te);if(Oe){let{packageLocation:xe}=Q(Oe);if(!e.fakeFs.existsSync(xe)){let Se=xe.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 Ci(dr.QUALIFIED_PATH_RESOLUTION_FAILED,`${Se}
Missing package: ${Oe.name}@${Oe.reference}
Expected package location: ${ha(xe)}
`,{unqualifiedPath:Fe,extensions:ae})}}throw Ci(dr.QUALIFIED_PATH_RESOLUTION_FAILED,`Qualified path resolution failed - none of those files can be found on the disk.
Source path: ${Fe}
${Be.map(xe=>`Not found: ${ha(xe)}
`).join("")}`,{unqualifiedPath:Fe,extensions:ae})}}function Ie(te,ae,{considerBuiltins:Be,extensions:he,conditions:Fe}={}){try{let Oe=O(te,ae,{considerBuiltins:Be});if(te==="pnpapi")return Oe;if(Oe===null)return null;let xe=()=>ae!==null?J(ae):!1,Se=(!Be||!lb(te))&&!xe()?N(te,Oe,Fe):Oe;return be(Se,{extensions:he})}catch(Oe){throw Object.prototype.hasOwnProperty.call(Oe,"pnpCode")&&Object.assign(Oe.data,{request:ha(te),issuer:ae&&ha(ae)}),Oe}}function Ye(te){let ae=k.normalize(te),Be=Jr.resolveVirtual(ae);return Be!==ae?Be:null}return{VERSIONS:oe,topLevel:Z,getLocator:(te,ae)=>Array.isArray(ae)?{name:ae[0],reference:ae[1]}:{name:te,reference:ae},getDependencyTreeRoots:()=>[...r.dependencyTreeRoots],getAllLocators(){let te=[];for(let[ae,Be]of f)for(let he of Be.keys())ae!==null&&he!==null&&te.push({name:ae,reference:he});return te},getPackageInformation:te=>{let ae=A(te);if(ae===null)return null;let Be=j.fromPortablePath(ae.packageLocation);return ie(L({},ae),{packageLocation:Be})},findPackageLocator:te=>ee(j.toPortablePath(te)),resolveToUnqualified:y("resolveToUnqualified",(te,ae,Be)=>{let he=ae!==null?j.toPortablePath(ae):null,Fe=O(j.toPortablePath(te),he,Be);return Fe===null?null:j.fromPortablePath(Fe)}),resolveUnqualified:y("resolveUnqualified",(te,ae)=>j.fromPortablePath(be(j.toPortablePath(te),ae))),resolveRequest:y("resolveRequest",(te,ae,Be)=>{let he=ae!==null?j.toPortablePath(ae):null,Fe=Ie(j.toPortablePath(te),he,Be);return Fe===null?null:j.fromPortablePath(Fe)}),resolveVirtual:y("resolveVirtual",te=>{let ae=Ye(j.toPortablePath(te));return ae!==null?j.fromPortablePath(ae):null})}}var gvt=(0,tce.promisify)(ece.readFile);var rce=(r,e,t)=>{let i=Hm(r),n=qN(i,{basePath:e}),s=j.join(e,Pt.pnpCjs);return zN(n,{fakeFs:t,pnpapiResolution:s})};var VN=ge(nce());var Bo={};pt(Bo,{checkAndReportManifestCompatibility:()=>oce,checkManifestCompatibility:()=>sce,extractBuildScripts:()=>cb,getExtractHint:()=>XN,hasBindingGyp:()=>ZN});function sce(r){return P.isPackageCompatible(r,{os:[process.platform],cpu:[process.arch]})}function oce(r,e,{configuration:t,report:i}){return sce(r)?!0:(i==null||i.reportWarningOnce($.INCOMPATIBLE_ARCHITECTURE,`${P.prettyLocator(t,r)} The ${process.platform}-${process.arch} architecture is incompatible with this module, ${e} skipped.`),!1)}function cb(r,e,t,{configuration:i,report:n}){let s=[];for(let a of["preinstall","install","postinstall"])e.manifest.scripts.has(a)&&s.push([ls.SCRIPT,a]);return!e.manifest.scripts.has("install")&&e.misc.hasBindingGyp&&s.push([ls.SHELLCODE,"node-gyp rebuild"]),s.length===0?[]:r.linkType!==Qt.HARD?(n==null||n.reportWarningOnce($.SOFT_LINK_BUILD,`${P.prettyLocator(i,r)} lists build scripts, but is referenced through a soft link. Soft links don't support build scripts, so they'll be ignored.`),[]):t&&t.built===!1?(n==null||n.reportInfoOnce($.BUILD_DISABLED,`${P.prettyLocator(i,r)} lists build scripts, but its build has been explicitly disabled through configuration.`),[]):!i.get("enableScripts")&&!t.built?(n==null||n.reportWarningOnce($.DISABLED_BUILD_SCRIPTS,`${P.prettyLocator(i,r)} lists build scripts, but all build scripts have been disabled.`),[]):oce(r,"build",{configuration:i,report:n})?s:[]}var D_e=new Set([".exe",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);function XN(r){return r.packageFs.getExtractHint({relevantExtensions:D_e})}function ZN(r){let e=k.join(r.prefixPath,"binding.gyp");return r.packageFs.existsSync(e)}var $N={};pt($N,{getUnpluggedPath:()=>Gm});function Gm(r,{configuration:e}){return k.resolve(e.get("pnpUnpluggedFolder"),P.slugifyLocator(r))}var F_e=new Set([P.makeIdent(null,"nan").identHash,P.makeIdent(null,"node-gyp").identHash,P.makeIdent(null,"node-pre-gyp").identHash,P.makeIdent(null,"node-addon-api").identHash,P.makeIdent(null,"fsevents").identHash]),vu=class{constructor(){this.mode="strict";this.pnpCache=new Map}supportsPackage(e,t){return this.isEnabled(t)}async findPackageLocation(e,t){if(!this.isEnabled(t))throw new Error("Assertion failed: Expected the PnP linker to be enabled");let i=Pl(t.project).cjs;if(!K.existsSy
`,n+=`# cause your node_modules installation to become invalidated.
`,n+=`
`,n+=`__metadata:
`,n+=` version: ${Ece}
`,n+=` nmMode: ${i.value}
`;let s=Array.from(e.keys()).sort(),o=P.stringifyLocator(r.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=k.contains(r.cwd,g);if(f===null)throw new Error(`Assertion failed: Expected the path to be within the project (${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&&t.size>0){n+=` bin:
`;for(let[g,f]of t){let h=k.contains(r.cwd,g);if(h===null)throw new Error(`Assertion failed: Expected the path to be within the project (${g})`);n+=` ${JSON.stringify(h)}:
`;for(let[p,m]of f){let y=k.relative(k.join(g,oi),m);n+=` ${JSON.stringify(p)}: ${JSON.stringify(y)}
`}}}}let a=r.cwd,l=k.join(a,oi,Ice);await K.changeFilePromise(l,n,{automaticNewlines:!0})}async function lT(r,{unrollAliases:e=!1}={}){let t=r.cwd,i=k.join(t,oi,Ice);if(!K.existsSync(i))return null;let n=Qi(await K.readFilePromise(i,"utf8"));if(n.__metadata.version>Ece)return null;let s=n.__metadata.nmMode||Li.CLASSIC,o=new Map,a=new Map;delete n.__metadata;for(let[l,c]of Object.entries(n)){let u=c.locations.map(f=>k.join(t,f)),g=c.bin;if(g)for(let[f,h]of Object.entries(g)){let p=k.join(t,j.toPortablePath(f)),m=Qe.getMapWithDefault(a,p);for(let[y,Q]of Object.entries(h))m.set(qr(y),j.toPortablePath([p,oi,Q].join(k.delimiter)))}if(o.set(l,{target:Ue.dot,linkType:Qt.HARD,locations:u,aliases:c.aliases||[]}),e&&c.aliases)for(let f of c.aliases){let{scope:h,name:p}=P.parseLocator(l),m=P.makeLocator(P.makeIdent(h,p),f),y=P.stringifyLocator(m);o.set(y,{target:Ue.dot,linkType:Qt.HARD,locations:u,aliases:[]})}}return{locatorMap:o,binSymlinks:a,locationTree:Bce(o,{skipPrefix:r.cwd}),nmMode:s}}var oh=async(r,e)=>{if(r.split(k.sep).indexOf(oi)<0)throw new Error(`Assertion failed: trying to remove dir that doesn't contain node_modules: ${r}`);try{if(!e.innerLoop){let i=e.allowSymlink?await K.statPromise(r):await K.lstatPromise(r);if(e.allowSymlink&&!i.isDirectory()||!e.allowSymlink&&i.isSymbolicLink()){await K.unlinkPromise(r);return}}let t=await K.readdirPromise(r,{withFileTypes:!0});for(let i of t){let n=k.join(r,qr(i.name));i.isDirectory()?(i.name!==oi||e&&e.innerLoop)&&await oh(n,{innerLoop:!0,contentsOnly:!1}):await K.unlinkPromise(n)}e.contentsOnly||await K.rmdirPromise(r)}catch(t){if(t.code!=="ENOENT"&&t.code!=="ENOTEMPTY")throw t}},bce=4,ub=(r,{skipPrefix:e})=>{let t=k.contains(e,r);if(t===null)throw new Error(`Assertion failed: Writing attempt prevented to ${r} which is outside project root: ${e}`);let i=t.split(k.sep).filter(l=>l!==""),n=i.indexOf(oi),s=i.slice(0,n).join(k.sep),o=k.join(e,s),a=i.slice(n);return{locationRoot:o,segments:a}},Bce=(r,{skipPrefix:e})=>{let t=new Map;if(r===null)return t;let i=()=>({children:new Map,linkType:Qt.HARD});for(let[n,s]of r.entries()){if(s.linkType===Qt.SOFT&&k.contains(e,s.target)!==null){let a=Qe.getFactoryWithDefault(t,s.target,i);a.locator=n,a.linkType=s.linkType}for(let o of s.locations){let{locationRoot:a,segments:l}=ub(o,{skipPrefix:e}),c=Qe.getFactoryWithDefault(t,a,i);for(let u=0;u<l.length;++u){let g=l[u];if(g!=="."){let f=Qe.getFactoryWithDefault(c.children,g,i);c.children.set(g,f),c=f}u===l.length-1&&(c.locator=n,c.linkType=s.linkType)}}}return t},cT=async(r,e)=>{let t;try{process.platform==="win32"&&(t=await K.lstatPromise(r))}catch(i){}process.platform=="win32"&&(!t||t.isDirectory())?await K.symlinkPromise(r,e,"junction"):await K.symlinkPromise(k.relative(k.dirname(e),r),e)};async function Qce(r,e,t){let i=k.join(r,qr(`${oT.default.randomBytes(16).toString("hex")}.tmp`));try{await K.writeFilePromise(i,t);try{await K.linkPromise(i,e)}catch(n){}}finally{await K.unlinkPromise(i)}}async function i5e({srcPath:r,dstPath:e,srcMode:t,globalHardlinksStore:i,baseFs:n,nmMode:s,digest:o}){if(s.value===Li.HARDLINKS_GLOBAL&&i&&o){let l=k.join(i,o.substring(0,2),`${o.substring(2)}.dat`),c;try{if(await Fn.checksumFile(l,{baseFs:K,algorithm:"sha1"})!==o){let g=k.join(i,qr(`${oT.default.randomBytes(16).toString("hex")}.tmp`));await K.renamePromise(l,g);let f=await n.readFilePromise(r);await K.writeFilePromise(g,f);try{await K.linkPromise(g,l),await K.unlinkPromise(g)}catch(h){}}await K.linkPromise(l,e),c=!0}catch(u){c=!1}if(!c){let u=await n.readFilePromise(r);await Qce(i,l,u);try{await K.linkPromise(l,e)}catch(g){g&&g.code&&g.code=="EXDEV"&&(s.value=Li.HARDLINKS_LOCAL,await n.copyFilePromise(r,e))}}}else await n.copyFilePromise(r,e);let a=t&511;a!==420&&await K.chmodPromise(e,a)}var Dl;(function(i){i.FILE="file",i.DIRECTORY="directory",i.SYMLINK="symlink"})(Dl||(Dl={}));var n5e=async(r,e,{baseFs:t,globalHardlinksStore:i,nmMode:n,packageChecksum:s})=>{await K.mkdirPromise(r,{recursive:!0});let o=async(l=Ue.dot)=>{let c=k.join(e,l),u=await t.readdirPromise(c,{withFileTypes:!0}),g=new Map;for
This command checks for known security reports on the packages you use. The reports are by default extracted from the npm registry, and may or may not be relevant to your actual program (not all vulnerabilities affect all code paths).
For consistency with our other commands the default is to only check the direct dependencies for the active workspace. To extend this search to all workspaces, use \`-A,--all\`. To extend this search to both direct and transitive dependencies, use \`-R,--recursive\`.
Applying the \`--severity\` flag will limit the audit table to vulnerabilities of the corresponding severity and above. Valid values are ${Ub.map(e=>`\`${e}\``).join(", ")}.
If the \`--json\` flag is set, Yarn will print the output exactly as received from the registry. Regardless of this flag, the process will exit with a non-zero exit code if a report is found for the selected packages.
To understand the dependency tree requiring vulnerable packages, check the raw report with the \`--json\` flag or use \`yarn why <package>\` to get more information as to who depends on them.
`,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 Fge=aE;var dO=ge(ti()),CO=ge(require("util")),AE=class extends Ne{constructor(){super(...arguments);this.fields=z.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=z.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t}=await ze.find(e,this.context.cwd),i=typeof this.fields!="undefined"?new Set(["name",...this.fields.split(/\s*,\s*/)]):null,n=[],s=!1,o=await Je.start({configuration:e,includeFooter:!1,json:this.json,stdout:this.context.stdout},async a=>{for(let l of this.packages){let c;if(l==="."){let x=t.topLevelWorkspace;if(!x.manifest.name)throw new Pe(`Missing 'name' field in ${j.fromPortablePath(k.join(x.cwd,Pt.manifest))}`);c=P.makeDescriptor(x.manifest.name,"unknown")}else c=P.parseDescriptor(l);let u=Wt.getIdentUrl(c),g=mO(await Wt.get(u,{configuration:e,ident:c,jsonResponse:!0,customErrorMessage:Wt.customPackageError})),f=Object.keys(g.versions).sort(dO.default.compareLoose),p=g["dist-tags"].latest||f[f.length-1],m=sr.validRange(c.range);if(m){let x=dO.default.maxSatisfying(f,m);x!==null?p=x:(a.reportWarning($.UNNAMED,`Unmet range ${P.prettyRange(e,c.range)}; falling back to the latest version`),s=!0)}else c.range!=="unknown"&&(a.reportWarning($.UNNAMED,`Invalid range ${P.prettyRange(e,c.range)}; falling back to the latest version`),s=!0);let y=g.versions[p],Q=ie(L(L({},g),y),{version:p,versions:f}),S;if(i!==null){S={};for(let x of i){let M=Q[x];if(typeof M!="undefined")S[x]=M;else{a.reportWarning($.EXCEPTION,`The '${x}' field doesn't exist inside ${P.prettyIdent(e,c)}'s informations`),s=!0;continue}}}else this.json||(delete Q.dist,delete Q.readme,delete Q.users),S=Q;a.reportJson(S),this.json||n.push(S)}});CO.inspect.styles.name="cyan";for(let a of n)(a!==n[0]||s)&&this.context.stdout.write(`
`),this.context.stdout.write(`${(0,CO.inspect)(a,{depth:Infinity,colors:!0,compact:!1})}
`);return o.exitCode()}};AE.paths=[["npm","info"]],AE.usage=Re.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 Rge=AE;function mO(r){if(Array.isArray(r)){let e=[];for(let t of r)t=mO(t),t&&e.push(t);return e}else if(typeof r=="object"&&r!==null){let e={};for(let t of Object.keys(r)){if(t.startsWith("_"))continue;let i=mO(r[t]);i&&(e[t]=i)}return e}else return r||null}var Lge=ge(_C()),lE=class extends Ne{constructor(){super(...arguments);this.scope=z.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=z.Boolean("--publish",!1,{description:"Login to the publish registry"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=await Kb({configuration:e,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{let s=await w9e({registry:t,report:n,stdin:this.context.stdin,stdout:this.context.stdout}),o=`/-/user/org.couchdb.user:${encodeURIComponent(s.name)}`,a=await Wt.put(o,s,{attemptedAs:s.name,configuration:e,registry:t,jsonResponse:!0,authType:Wt.AuthType.NO_AUTH});return await y9e(t,a.token,{configuration:e,scope:this.scope}),n.reportInfo($.UNNAMED,"Successfully logged in")})).exitCode()}};lE.paths=[["npm","login"]],lE.usage=Re.Usage({category:"Npm-related commands",description:"store new login info to access the npm registry",details:"\n This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\n\n Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n ",examples:[["Login to the default registry","yarn npm login"],["Login to the registry linked to the @my-scope registry","yarn npm login --scope my-scope"],["Login to the publish registry for the current package","yarn npm login --publish"]]});var Nge=lE;async function Kb({scope:r,publish:e,configuration:t,cwd:i}){return r&&e?br.getScopeRegistry(r,{configuration:t,type:br.RegistryType.PUBLISH_REGISTRY}):
This command will list all tags of a package from the npm registry.
If the package is not specified, Yarn will default to the current workspace.
`,examples:[["List all tags of package `my-pkg`","yarn npm tag list my-pkg"]]});var Uge=gE;async function fE(r,e){let t=`/-/package${Wt.getIdentUrl(r)}/dist-tags`;return Wt.get(t,{configuration:e,ident:r,jsonResponse:!0,customErrorMessage:Wt.customPackageError})}var hE=class extends Ne{constructor(){super(...arguments);this.package=z.String();this.tag=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ft(t.cwd,this.context.cwd);let n=P.parseDescriptor(this.package,!0),s=n.range;if(!Kge.default.valid(s))throw new Pe(`The range ${ce.pretty(e,n.range,ce.Type.RANGE)} must be a valid semver version`);let o=br.getPublishRegistry(i.manifest,{configuration:e}),a=ce.pretty(e,n,ce.Type.IDENT),l=ce.pretty(e,s,ce.Type.RANGE),c=ce.pretty(e,this.tag,ce.Type.CODE);return(await Je.start({configuration:e,stdout:this.context.stdout},async g=>{let f=await fE(n,e);Object.prototype.hasOwnProperty.call(f,this.tag)&&f[this.tag]===s&&g.reportWarning($.UNNAMED,`Tag ${c} is already set to version ${l}`);let h=`/-/package${Wt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await Wt.put(h,s,{configuration:e,registry:o,ident:n,jsonRequest:!0,jsonResponse:!0}),g.reportInfo($.UNNAMED,`Tag ${c} added to version ${l} of package ${a}`)})).exitCode()}};hE.paths=[["npm","tag","add"]],hE.usage=Re.Usage({category:"Npm-related commands",description:"add a tag for a specific version of a package",details:`
This command will add a tag to the npm registry for a specific version of a package. If the tag already exists, it will be overwritten.
`,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=hE;var pE=class extends Ne{constructor(){super(...arguments);this.package=z.String();this.tag=z.String()}async execute(){if(this.tag==="latest")throw new Pe("The 'latest' tag cannot be removed.");let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ft(t.cwd,this.context.cwd);let n=P.parseIdent(this.package),s=br.getPublishRegistry(i.manifest,{configuration:e}),o=ce.pretty(e,this.tag,ce.Type.CODE),a=ce.pretty(e,n,ce.Type.IDENT),l=await fE(n,e);if(!Object.prototype.hasOwnProperty.call(l,this.tag))throw new Pe(`${o} is not a tag of package ${a}`);return(await Je.start({configuration:e,stdout:this.context.stdout},async u=>{let g=`/-/package${Wt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await Wt.del(g,{configuration:e,registry:s,ident:n,jsonResponse:!0}),u.reportInfo($.UNNAMED,`Tag ${o} removed from package ${a}`)})).exitCode()}};pE.paths=[["npm","tag","remove"]],pE.usage=Re.Usage({category:"Npm-related commands",description:"remove a tag from a package",details:`
This command will remove a tag from a package from the npm registry.
`,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]});var jge=pE;var dE=class extends Ne{constructor(){super(...arguments);this.scope=z.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=z.Boolean("--publish",!1,{description:"Print username for the publish registry"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t;return this.scope&&this.publish?t=br.getScopeRegistry(this.scope,{configuration:e,type:br.RegistryType.PUBLISH_REGISTRY}):this.scope?t=br.getScopeRegistry(this.scope,{configuration:e}):this.publish?t=br.getPublishRegistry((await qf(e,this.context.cwd)).manifest,{configuration:e}):t=br.getDefaultRegistry({configuration:e}),(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{var o,a;let s;try{s=await Wt.get("/-/whoami",{configuration:e,registry:t,authType:Wt.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?P.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($.AUTHENTICATION_INVALID,"Authentication failed - your credentials may have expired");return}else throw l}n.reportInfo($.UNNAMED,s.username)})).exitCode()}};dE.paths=[["npm","whoami"]],dE.usage=Re.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 Gge=dE;var Q9e={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:Ee.STRING,default:null}},commands:[Fge,Rge,Nge,Oge,Mge,Hge,Uge,jge,Gge]},v9e=Q9e;var SO={};pt(SO,{default:()=>j9e,patchUtils:()=>IO});var IO={};pt(IO,{applyPatchFile:()=>Gb,diffFolders:()=>bO,extractPackageToDisk:()=>BO,extractPatchFlags:()=>Xge,isParentRequired:()=>wO,loadPatchFiles:()=>IE,makeDescriptor:()=>U9e,makeLocator:()=>yO,parseDescriptor:()=>mE,parseLocator:()=>EE,parsePatchFile:()=>jb});var CE=class extends Error{constructor(e,t){super(`Cannot apply hunk #${e+1}`);this.hunk=t}};var S9e=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function wh(r){return k.relative(Ue.root,k.resolve(Ue.root,j.toPortablePath(r)))}function x9e(r){let e=r.trim().match(S9e);if(!e)throw new Error(`Bad header line: '${r}'`);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 k9e=420,P9e=493,Xr;(function(i){i.Context="context",i.Insertion="insertion",i.Deletion="deletion"})(Xr||(Xr={}));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}),D9e=r=>({header:x9e(r),parts:[]}),F9e={["@"]:"header",["-"]:Xr.Deletion,["+"]:Xr.Insertion,[" "]:Xr.Context,["\\"]:"pragma",undefined:Xr.Context};function L9e(r){let e=[],t=Yge(),i="parsing header",n=null,s=null;function o(){n&&(s&&(n.parts.push(s),s=null),t.hunks.push(n),n=null)}function a(){o(),e.push(t),t=Yge()}for(let l=0;l<r.length;l++){let c=r[l];if(i==="parsing header")if(c.startsWith("@@"))i="parsing hunks",t.hunks=[],l-=1;else if(c.startsWith("diff --git ")){t&&t.diffLineFromPath&&
`)+(n.hunk.parts[0].noNewlineAtEndOfFile?"":`
`):"";await e.mkdirpPromise(k.dirname(n.path),{chmod:493,utimes:[Dr.SAFE_TIME,Dr.SAFE_TIME]}),await e.writeFilePromise(n.path,s,{mode:n.mode}),await e.utimesPromise(n.path,Dr.SAFE_TIME,Dr.SAFE_TIME)}break;case"patch":await Bh(e,n.path,async()=>{await T9e(n,{baseFs:e,dryRun:t})});break;case"mode change":{let o=(await e.statPromise(n.path)).mode;if(qge(n.newMode)!==qge(o))continue;await Bh(e,n.path,async()=>{await e.chmodPromise(n.path,n.newMode)})}break;default:Qe.assertNever(n);break}}function qge(r){return(r&64)>0}function Jge(r){return r.replace(/\s+$/,"")}function O9e(r,e){return Jge(r)===Jge(e)}async function T9e({hunks:r,path:e},{baseFs:t,dryRun:i=!1}){let n=await t.statSync(e).mode,o=(await t.readFileSync(e,"utf8")).split(/\n/),a=[],l=0,c=0;for(let g of r){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),m=Math.max(h,p),y=0,Q=0,S=null;for(;y<=m;){if(y<=h&&(Q=f-y,S=Wge(g,o,Q),S!==null)){y=-y;break}if(y<=p&&(Q=f+y,S=Wge(g,o,Q),S!==null))break;y+=1}if(S===null)throw new CE(r.indexOf(g),g);a.push(S),l+=y,c=Q+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:Qe.assertNever(f);break}await t.writeFilePromise(e,o.join(`
`),{mode:n})}function Wge(r,e,t){let i=[];for(let n of r.parts)switch(n.type){case Xr.Context:case Xr.Deletion:{for(let s of n.lines){let o=e[t];if(o==null||!O9e(o,s))return null;t+=1}n.type===Xr.Deletion&&(i.push({type:"splice",index:t-n.lines.length,numToDelete:n.lines.length,linesToInsert:[]}),n.noNewlineAtEndOfFile&&i.push({type:"push",line:""}))}break;case Xr.Insertion:i.push({type:"splice",index:t,numToDelete:0,linesToInsert:n.lines}),n.noNewlineAtEndOfFile&&i.push({type:"pop"});break;default:Qe.assertNever(n.type);break}return i}var M9e=/^builtin<([^>]+)>$/;function zge(r,e){let{source:t,selector:i,params:n}=P.parseRange(r);if(t===null)throw new Error("Patch locators must explicitly define their source");let s=i?i.split(/&/).map(c=>j.toPortablePath(c)):[],o=n&&typeof n.locator=="string"?P.parseLocator(n.locator):null,a=n&&typeof n.version=="string"?n.version:null,l=e(t);return{parentLocator:o,sourceItem:l,patchPaths:s,sourceVersion:a}}function mE(r){let i=zge(r.range,P.parseDescriptor),{sourceItem:e}=i,t=Tr(i,["sourceItem"]);return ie(L({},t),{sourceDescriptor:e})}function EE(r){let i=zge(r.reference,P.parseLocator),{sourceItem:e}=i,t=Tr(i,["sourceItem"]);return ie(L({},t),{sourceLocator:e})}function _ge({parentLocator:r,sourceItem:e,patchPaths:t,sourceVersion:i,patchHash:n},s){let o=r!==null?{locator:P.stringifyLocator(r)}:{},a=typeof i!="undefined"?{version:i}:{},l=typeof n!="undefined"?{hash:n}:{};return P.makeRange({protocol:"patch:",source:s(e),selector:t.join("&"),params:L(L(L({},a),l),o)})}function U9e(r,{parentLocator:e,sourceDescriptor:t,patchPaths:i}){return P.makeLocator(r,_ge({parentLocator:e,sourceItem:t,patchPaths:i},P.stringifyDescriptor))}function yO(r,{parentLocator:e,sourcePackage:t,patchPaths:i,patchHash:n}){return P.makeLocator(r,_ge({parentLocator:e,sourceItem:t,sourceVersion:t.version,patchPaths:i,patchHash:n},P.stringifyLocator))}function Vge({onAbsolute:r,onRelative:e,onBuiltin:t},i){i.startsWith("~")&&(i=i.slice(1));let s=i.match(M9e);return s!==null?t(s[1]):k.isAbsolute(i)?r(i):e(i)}function Xge(r){let e=r.startsWith("~");return e&&(r=r.slice(1)),{optional:e}}function wO(r){return Vge({onAbsolute:()=>!1,onRelative:()=>!0,onBuiltin:()=>!1},r)}async function IE(r,e,t){let i=r!==null?await t.fetcher.fetch(r,t):null,n=i&&i.localPath?{packageFs:new zt(Ue.root),prefixPath:k.relative(Ue.root,i.localPath)}:i;i&&i!==n&&i.releaseFs&&i.releaseFs();let s=await Qe.releaseAfterUseAsync(async()=>await Promise.all(e.map(async o=>{let a=Xge(o),l=await Vge({onAbsolute:async()=>await K.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(k.join(n.prefixPath,o),"utf8")},onBuiltin:async c=>await t.project.configuration.firstHook(u=>u.getBuiltinPatch,t.project,c)},o);return ie(L({},a),{source:l})})));for(let o of s)typeof o.source=="string"&&(o.source=o.source.replace(/\r\n?/g,`
`));return s}async function BO(r,{cache:e,project:t}){let i=t.storedPackages.get(r.locatorHash);if(typeof i=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let n=t.storedChecksums,s=new hi,o=t.configuration.makeFetcher(),a=await o.fetch(r,{cache:e,project:t,fetcher:o,checksums:n,report:s}),l=await K.mktempPromise(),c=k.join(l,"source"),u=k.join(l,"user"),g=k.join(l,".yarn-patch.json");return await Promise.all([K.copyPromise(c,a.prefixPath,{baseFs:a.packageFs}),K.copyPromise(u,a.prefixPath,{baseFs:a.packageFs}),K.writeJsonPromise(g,{locator:P.stringifyLocator(r),version:i.version})]),K.detachTemp(l),u}async function bO(r,e){let t=j.fromPortablePath(r).replace(/\\/g,"/"),i=j.fromPortablePath(e).replace(/\\/g,"/"),{stdout:n,stderr:s}=await Rr.execvp("git",["-c","core.safecrlf=false","diff","--src-prefix=a/","--dst-prefix=b/","--ignore-cr-at-eol","--full-index","--no-index","--text",t,i],{cwd:j.toPortablePath(process.cwd()),env:ie(L({},process.env),{GIT_CONFIG_NOSYSTEM:"1",HOME:"",XDG_CONFIG_HOME:"",USERPROFILE:""})});if(s.length>0)throw new Error(`Unable to diff directories. Make sure you have a recent version of 'git' available in PATH.
The following error was reported by 'git':
${s}`);let o=t.startsWith("/")?a=>a.slice(1):a=>a;return n.replace(new RegExp(`(a|b)(${Qe.escapeRegExp(`/${o(t)}/`)})`,"g"),"$1/").replace(new RegExp(`(a|b)${Qe.escapeRegExp(`/${o(i)}/`)}`,"g"),"$1/").replace(new RegExp(Qe.escapeRegExp(`${t}/`),"g"),"").replace(new RegExp(Qe.escapeRegExp(`${i}/`),"g"),"")}function Zge(r,{configuration:e,report:t}){for(let i of r.parts)for(let n of i.lines)switch(i.type){case Xr.Context:t.reportInfo(null,` ${ce.pretty(e,n,"grey")}`);break;case Xr.Deletion:t.reportError($.FROZEN_LOCKFILE_EXCEPTION,`- ${ce.pretty(e,n,ce.Type.REMOVED)}`);break;case Xr.Insertion:t.reportError($.FROZEN_LOCKFILE_EXCEPTION,`+ ${ce.pretty(e,n,ce.Type.ADDED)}`);break;default:Qe.assertNever(i.type)}}var QO=class{supports(e,t){return!!e.reference.startsWith("patch:")}getLocalPath(e,t){return null}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,L({onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${P.prettyLocator(t.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.patchPackage(e,t),skipIntegrityCheck:t.skipIntegrityCheck},t.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:P.getIdentVendorPath(e),localPath:this.getLocalPath(e,t),checksum:o}}async patchPackage(e,t){let{parentLocator:i,sourceLocator:n,sourceVersion:s,patchPaths:o}=EE(e),a=await IE(i,o,t),l=await K.mktempPromise(),c=k.join(l,"current.zip"),u=await t.fetcher.fetch(n,t),g=P.getIdentVendorPath(e),f=await fn(),h=new ai(c,{libzip:f,create:!0,level:t.project.configuration.get("compressionLevel")});await Qe.releaseAfterUseAsync(async()=>{await h.copyPromise(g,u.prefixPath,{baseFs:u.packageFs,stableSort:!0})},u.releaseFs),h.saveAndClose();for(let{source:p,optional:m}of a){if(p===null)continue;let y=new ai(c,{libzip:f,level:t.project.configuration.get("compressionLevel")}),Q=new zt(k.resolve(Ue.root,g),{baseFs:y});try{await Gb(jb(p),{baseFs:Q,version:s})}catch(S){if(!(S instanceof CE))throw S;let x=t.project.configuration.get("enableInlineHunks"),M=!x&&!m?" (set enableInlineHunks for details)":"",q=`${P.prettyLocator(t.project.configuration,e)}: ${S.message}${M}`,U=W=>{!x||Zge(S.hunk,{configuration:t.project.configuration,report:W})};if(y.discardAndClose(),m){t.report.reportWarningOnce($.PATCH_HUNK_FAILED,q,{reportExtra:U});continue}else throw new ct($.PATCH_HUNK_FAILED,q,U)}y.saveAndClose()}return new ai(c,{libzip:f,level:t.project.configuration.get("compressionLevel")})}};var K9e=3,vO=class{supportsDescriptor(e,t){return!!e.range.startsWith("patch:")}supportsLocator(e,t){return!!e.reference.startsWith("patch:")}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i){let{patchPaths:n}=mE(e);return n.every(s=>!wO(s))?e:P.bindDescriptor(e,{locator:P.stringifyLocator(t)})}getResolutionDependencies(e,t){let{sourceDescriptor:i}=mE(e);return[i]}async getCandidates(e,t,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}=mE(e),a=await IE(n,o,i.fetchOptions),l=t.get(s.descriptorHash);if(typeof l=="undefined")throw new Error("Assertion failed: The dependency should have been resolved");let c=Fn.makeHash(`${K9e}`,...a.map(u=>JSON.stringify(u))).slice(0,6);return[yO(e,{parentLocator:n,sourcePackage:l,patchPaths:o,patchHash:c})]}async getSatisfying(e,t,i){return null}async resolve(e,t){let{sourceLocator:i}=EE(e),n=await t.resolver.resolve(i,t);return L(L({},n),e)}};var yE=class extends Ne{constructor(){super(...arguments);this.save=z.Boolean("-s,--save",!1,{description:"Add the patch to your resolution entries"});this.patchFolder=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ft(t.cwd,this.context.cwd);await t.restoreInstallState();let n=k.resolve(this.context.cwd,j.toPortablePath(this.patchFolder)),s=k.join(n,"../source"),o=k.join(n,"../.yarn-patch.json");if(!K.existsSync(s))throw new Pe("Th
${o.map(a=>`
- ${P.prettyLocator(e,a)}`).join("")}`);s=o[0]}if(!t.storedPackages.has(s.locatorHash))throw new Pe("No package found in the project for the given locator");await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async o=>{let a=await BO(s,{cache:n,project:t});o.reportJson({locator:P.stringifyLocator(s),path:j.fromPortablePath(a)}),o.reportInfo($.UNNAMED,`Package ${P.prettyLocator(e,s)} got extracted with success!`),o.reportInfo($.UNNAMED,`You can now edit the following folder: ${ce.pretty(e,j.fromPortablePath(a),"magenta")}`),o.reportInfo($.UNNAMED,`Once you are done run ${ce.pretty(e,`yarn patch-commit -s ${process.platform==="win32"?'"':""}${j.fromPortablePath(a)}${process.platform==="win32"?'"':""}`,"cyan")} and Yarn will store a patchfile based on your changes.`)})}};wE.paths=[["patch"]],wE.usage=Re.Usage({description:"prepare a package for patching",details:"\n This command will cause a package to be extracted in a temporary directory intended to be editable at will.\n \n Once you're done with your changes, run `yarn patch-commit -s <path>` (with `<path>` being the temporary directory you received) to generate a patchfile and register it into your top-level manifest via the `patch:` protocol. Run `yarn patch-commit -h` for more details.\n "});var efe=wE;var H9e={configuration:{enableInlineHunks:{description:"If true, the installs will print unmatched patch hunks",type:Ee.BOOLEAN,default:!1},patchFolder:{description:"Folder where the patch files must be written",type:Ee.ABSOLUTE_PATH,default:"./.yarn/patches"}},commands:[$ge,efe],fetchers:[QO],resolvers:[vO]},j9e=H9e;var DO={};pt(DO,{default:()=>q9e});var xO=class{supportsPackage(e,t){return this.isEnabled(t)}async findPackageLocation(e,t){if(!this.isEnabled(t))throw new Error("Assertion failed: Expected the pnpm linker to be enabled");let i=kO(),n=t.project.installersCustomData.get(i);if(!n)throw new Pe(`The project in ${ce.pretty(t.project.configuration,`${t.project.cwd}/package.json`,ce.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let s=n.pathByLocator.get(e.locatorHash);if(typeof s=="undefined")throw new Pe(`Couldn't find ${P.prettyLocator(t.project.configuration,e)} in the currently installed pnpm map - running an install might help`);return s}async findPackageLocator(e,t){if(!this.isEnabled(t))return null;let i=kO(),n=t.project.installersCustomData.get(i);if(!n)throw new Pe(`The project in ${ce.pretty(t.project.configuration,`${t.project.cwd}/package.json`,ce.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let s=e.match(/(^.*\/node_modules\/(@[^/]*\/)?[^/]+)(\/.*$)/);if(s){let l=n.locatorByPath.get(s[1]);if(l)return l}let o=e,a=e;do{a=o,o=k.dirname(a);let l=n.locatorByPath.get(a);if(l)return l}while(o!==a);return null}makeInstaller(e){return new tfe(e)}isEnabled(e){return e.project.configuration.get("nodeLinker")==="pnpm"}},tfe=class{constructor(e){this.opts=e;this.asyncActions=new Qe.AsyncActions(10);this.customData={pathByLocator:new Map,locatorByPath:new Map}}getCustomDataKey(){return kO()}attachCustomData(e){}async installPackage(e,t,i){switch(e.linkType){case Qt.SOFT:return this.installPackageSoft(e,t,i);case Qt.HARD:return this.installPackageHard(e,t,i)}throw new Error("Assertion failed: Unsupported package link type")}async installPackageSoft(e,t,i){let n=k.resolve(t.packageFs.getRealPath(),t.prefixPath);return this.customData.pathByLocator.set(e.locatorHash,n),{packageLocation:n,buildDirective:null}}async installPackageHard(e,t,i){var u;let n=G9e(e,{project:this.opts.project});this.customData.locatorByPath.set(n,P.stringifyLocator(e)),this.customData.pathByLocator.set(e.locatorHash,n),i.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{await K.mkdirPromise(n,{recursive:!0}),await K.copyPromise(n,t.prefixPath,{baseFs:t.packageFs,overwrite:!1})}));let o=P.isVirtualLocator(e)?P.devirtualizeLocator(e):e,a={manifest:(u=await At.tryFind(t.prefixPath,{baseFs:t.packageFs}))!=null?u:new At,misc:{hasBindingGyp:Bo.hasBindingGyp(t)}}
/*!
* buildToken
* Builds OAuth token prefix (helper function)
*
* @name buildToken
* @function
* @param {GitUrl} obj The parsed Git url object.
* @return {String} token prefix
*/
/*!
* fill-range <https://github.com/jonschlinkert/fill-range>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Licensed under the MIT License.
*/
/*!
* is-extglob <https://github.com/jonschlinkert/is-extglob>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License.
*/
/*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
/*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*/
/*!
* is-windows <https://github.com/jonschlinkert/is-windows>
*
* Copyright © 2015-2018, Jon Schlinkert.
* Released under the MIT License.
*/
/*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*/