link
Version:
A better npm link
89 lines (86 loc) • 77.5 kB
JavaScript
#!/usr/bin/env node
"use strict";var O=require("fs/promises"),Ot=require("tty"),A=require("path"),fi=require("module"),ru=require("fs"),kt=require("events"),Fi=typeof document<"u"?document.currentScript:null;const jt="known-flag",xt="unknown-flag",Tt="argument",{stringify:ne}=JSON,Rt=/\B([A-Z])/g,Pt=u=>u.replace(Rt,"-$1").toLowerCase(),{hasOwnProperty:Lt}=Object.prototype,ie=(u,e)=>Lt.call(u,e),Mt=u=>Array.isArray(u),ou=u=>typeof u=="function"?[u,!1]:Mt(u)?[u[0],!0]:ou(u.type),Nt=(u,e)=>u===Boolean?e!=="false":e,It=(u,e)=>typeof e=="boolean"?e:u===Number&&e===""?Number.NaN:u(e),_t=/[\s.:=]/,Wt=u=>{const e=`Flag name ${ne(u)}`;if(u.length===0)throw new Error(`${e} cannot be empty`);if(u.length===1)throw new Error(`${e} must be longer than a character`);const t=u.match(_t);if(t)throw new Error(`${e} cannot contain ${ne(t?.[0])}`)},Gt=u=>{const e={},t=(D,n)=>{if(ie(e,D))throw new Error(`Duplicate flags named ${ne(D)}`);e[D]=n};for(const D in u){if(!ie(u,D))continue;Wt(D);const n=u[D],i=[[],...ou(n),n];t(D,i);const s=Pt(D);if(D!==s&&t(s,i),"alias"in n&&typeof n.alias=="string"){const{alias:o}=n,a=`Flag alias ${ne(o)} for flag ${ne(D)}`;if(o.length===0)throw new Error(`${a} cannot be empty`);if(o.length>1)throw new Error(`${a} must be a single character`);t(o,i)}}return e},qt=(u,e)=>{const t={};for(const D in u){if(!ie(u,D))continue;const[n,,i,s]=e[D];if(n.length===0&&"default"in s){let{default:o}=s;typeof o=="function"&&(o=o()),t[D]=o}else t[D]=i?n:n.pop()}return t},ge="--",zt=/[.:=]/,Jt=/^-{1,2}\w/,Vt=u=>{if(!Jt.test(u))return;const e=!u.startsWith(ge);let t=u.slice(e?1:2),D;const n=t.match(zt);if(n){const{index:i}=n;D=t.slice(i+1),t=t.slice(0,i)}return[t,D,e]},Ut=(u,{onFlag:e,onArgument:t})=>{let D;const n=(i,s)=>{if(typeof D!="function")return!0;D(i,s),D=void 0};for(let i=0;i<u.length;i+=1){const s=u[i];if(s===ge){n();const a=u.slice(i+1);t?.(a,[i],!0);break}const o=Vt(s);if(o){if(n(),!e)continue;const[a,h,f]=o;if(f)for(let g=0;g<a.length;g+=1){n();const F=g===a.length-1;D=e(a[g],F?h:void 0,[i,g+1,F])}else D=e(a,h,[i])}else n(s,[i])&&t?.([s],[i])}n()},Zt=(u,e)=>{for(const[t,D,n]of e.reverse()){if(D){const i=u[t];let s=i.slice(0,D);if(n||(s+=i.slice(D+1)),s!=="-"){u[t]=s;continue}}u.splice(t,1)}},Ht=(u,e=process.argv.slice(2),{ignore:t}={})=>{const D=[],n=Gt(u),i={},s=[];return s[ge]=[],Ut(e,{onFlag(o,a,h){const f=ie(n,o);if(!t?.(f?jt:xt,o,a)){if(f){const[g,F]=n[o],d=Nt(F,a),m=(w,S)=>{D.push(h),S&&D.push(S),g.push(It(F,w||""))};return d===void 0?m:m(d)}ie(i,o)||(i[o]=[]),i[o].push(a===void 0?!0:a),D.push(h)}},onArgument(o,a,h){t?.(Tt,e[a[0]])||(s.push(...o),h?(s[ge]=o,e.splice(a[0])):D.push(a))}}),Zt(e,D),{flags:qt(u,n),unknownFlags:i,_:s}};var Xt=Object.create,me=Object.defineProperty,Yt=Object.defineProperties,Kt=Object.getOwnPropertyDescriptor,Qt=Object.getOwnPropertyDescriptors,eD=Object.getOwnPropertyNames,au=Object.getOwnPropertySymbols,uD=Object.getPrototypeOf,lu=Object.prototype.hasOwnProperty,tD=Object.prototype.propertyIsEnumerable,cu=(u,e,t)=>e in u?me(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t,Be=(u,e)=>{for(var t in e||(e={}))lu.call(e,t)&&cu(u,t,e[t]);if(au)for(var t of au(e))tD.call(e,t)&&cu(u,t,e[t]);return u},Re=(u,e)=>Yt(u,Qt(e)),DD=u=>me(u,"__esModule",{value:!0}),nD=(u,e)=>()=>(u&&(e=u(u=0)),e),iD=(u,e)=>()=>(e||u((e={exports:{}}).exports,e),e.exports),sD=(u,e,t,D)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of eD(e))!lu.call(u,n)&&n!=="default"&&me(u,n,{get:()=>e[n],enumerable:!(D=Kt(e,n))||D.enumerable});return u},rD=(u,e)=>sD(DD(me(u!=null?Xt(uD(u)):{},"default",{value:u,enumerable:!0})),u),x=nD(()=>{}),oD=iD((u,e)=>{x(),e.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD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4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\u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uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});x(),x(),x();var aD=u=>{var e,t,D;let n=(e=process.stdout.columns)!=null?e:Number.POSITIVE_INFINITY;return typeof u=="function"&&(u=u(n)),u||(u={}),Array.isArray(u)?{columns:u,stdoutColumns:n}:{columns:(t=u.columns)!=null?t:[],stdoutColumns:(D=u.stdoutColumns)!=null?D:n}};x(),x(),x(),x(),x();function lD({onlyFirst:u=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,u?void 0:"g")}function hu(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(lD(),"")}x();function cD(u){return Number.isInteger(u)?u>=4352&&(u<=4447||u===9001||u===9002||11904<=u&&u<=12871&&u!==12351||12880<=u&&u<=19903||19968<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65131||65281<=u&&u<=65376||65504<=u&&u<=65510||110592<=u&&u<=110593||127488<=u&&u<=127569||131072<=u&&u<=262141):!1}var hD=rD(oD());function V(u){if(typeof u!="string"||u.length===0||(u=hu(u),u.length===0))return 0;u=u.replace((0,hD.default)()," ");let e=0;for(let t=0;t<u.length;t++){let D=u.codePointAt(t);D<=31||D>=127&&D<=159||D>=768&&D<=879||(D>65535&&t++,e+=cD(D)?2:1)}return e}var pu=u=>Math.max(...u.split(`
`).map(V)),pD=u=>{let e=[];for(let t of u){let{length:D}=t,n=D-e.length;for(let i=0;i<n;i+=1)e.push(0);for(let i=0;i<D;i+=1){let s=pu(t[i]);s>e[i]&&(e[i]=s)}}return e};x();var fu=/^\d+%$/,Fu={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},fD=(u,e)=>{var t;let D=[];for(let n=0;n<u.length;n+=1){let i=(t=e[n])!=null?t:"auto";if(typeof i=="number"||i==="auto"||i==="content-width"||typeof i=="string"&&fu.test(i)){D.push(Re(Be({},Fu),{width:i,contentWidth:u[n]}));continue}if(i&&typeof i=="object"){let s=Re(Be(Be({},Fu),i),{contentWidth:u[n]});s.horizontalPadding=s.paddingLeft+s.paddingRight,D.push(s);continue}throw new Error(`Invalid column width: ${JSON.stringify(i)}`)}return D};function FD(u,e){for(let t of u){let{width:D}=t;if(D==="content-width"&&(t.width=t.contentWidth),D==="auto"){let a=Math.min(20,t.contentWidth);t.width=a,t.autoOverflow=t.contentWidth-a}if(typeof D=="string"&&fu.test(D)){let a=Number.parseFloat(D.slice(0,-1))/100;t.width=Math.floor(e*a)-(t.paddingLeft+t.paddingRight)}let{horizontalPadding:n}=t,i=1,s=i+n;if(s>=e){let a=s-e,h=Math.ceil(t.paddingLeft/n*a),f=a-h;t.paddingLeft-=h,t.paddingRight-=f,t.horizontalPadding=t.paddingLeft+t.paddingRight}t.paddingLeftString=t.paddingLeft?" ".repeat(t.paddingLeft):"",t.paddingRightString=t.paddingRight?" ".repeat(t.paddingRight):"";let o=e-t.horizontalPadding;t.width=Math.max(Math.min(t.width,o),i)}}var du=()=>Object.assign([],{columns:0});function dD(u,e){let t=[du()],[D]=t;for(let n of u){let i=n.width+n.horizontalPadding;D.columns+i>e&&(D=du(),t.push(D)),D.push(n),D.columns+=i}for(let n of t){let i=n.reduce((F,d)=>F+d.width+d.horizontalPadding,0),s=e-i;if(s===0)continue;let o=n.filter(F=>"autoOverflow"in F),a=o.filter(F=>F.autoOverflow>0),h=a.reduce((F,d)=>F+d.autoOverflow,0),f=Math.min(h,s);for(let F of a){let d=Math.floor(F.autoOverflow/h*f);F.width+=d,s-=d}let g=Math.floor(s/o.length);for(let F=0;F<o.length;F+=1){let d=o[F];F===o.length-1?d.width+=s:d.width+=g,s-=g}}return t}function CD(u,e,t){let D=fD(t,e);return FD(D,u),dD(D,u)}x(),x(),x();var Pe=10,Cu=(u=0)=>e=>`\x1B[${e+u}m`,Eu=(u=0)=>e=>`\x1B[${38+u};5;${e}m`,gu=(u=0)=>(e,t,D)=>`\x1B[${38+u};2;${e};${t};${D}m`;function ED(){let u=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,D]of Object.entries(e)){for(let[n,i]of Object.entries(D))e[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},D[n]=e[n],u.set(i[0],i[1]);Object.defineProperty(e,t,{value:D,enumerable:!1})}return Object.defineProperty(e,"codes",{value:u,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=Cu(),e.color.ansi256=Eu(),e.color.ansi16m=gu(),e.bgColor.ansi=Cu(Pe),e.bgColor.ansi256=Eu(Pe),e.bgColor.ansi16m=gu(Pe),Object.defineProperties(e,{rgbToAnsi256:{value:(t,D,n)=>t===D&&D===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(D/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:t=>{let D=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!D)return[0,0,0];let{colorString:n}=D.groups;n.length===3&&(n=n.split("").map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>e.rgbToAnsi256(...e.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let D,n,i;if(t>=232)D=((t-232)*10+8)/255,n=D,i=D;else{t-=16;let a=t%36;D=Math.floor(t/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(D,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(D));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,D,n)=>e.ansi256ToAnsi(e.rgbToAnsi256(t,D,n)),enumerable:!1},hexToAnsi:{value:t=>e.ansi256ToAnsi(e.hexToAnsi256(t)),enumerable:!1}}),e}var gD=ED(),mD=gD,we=new Set(["\x1B","\x9B"]),BD=39,Le="\x07",mu="[",wD="]",Bu="m",Me=`${wD}8;;`,wu=u=>`${we.values().next().value}${mu}${u}${Bu}`,yu=u=>`${we.values().next().value}${Me}${u}${Le}`,yD=u=>u.split(" ").map(e=>V(e)),Ne=(u,e,t)=>{let D=[...e],n=!1,i=!1,s=V(hu(u[u.length-1]));for(let[o,a]of D.entries()){let h=V(a);if(s+h<=t?u[u.length-1]+=a:(u.push(a),s=0),we.has(a)&&(n=!0,i=D.slice(o+1).join("").startsWith(Me)),n){i?a===Le&&(n=!1,i=!1):a===Bu&&(n=!1);continue}s+=h,s===t&&o<D.length-1&&(u.push(""),s=0)}!s&&u[u.length-1].length>0&&u.length>1&&(u[u.length-2]+=u.pop())},$D=u=>{let e=u.split(" "),t=e.length;for(;t>0&&!(V(e[t-1])>0);)t--;return t===e.length?u:e.slice(0,t).join(" ")+e.slice(t).join("")},AD=(u,e,t={})=>{if(t.trim!==!1&&u.trim()==="")return"";let D="",n,i,s=yD(u),o=[""];for(let[h,f]of u.split(" ").entries()){t.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let g=V(o[o.length-1]);if(h!==0&&(g>=e&&(t.wordWrap===!1||t.trim===!1)&&(o.push(""),g=0),(g>0||t.trim===!1)&&(o[o.length-1]+=" ",g++)),t.hard&&s[h]>e){let F=e-g,d=1+Math.floor((s[h]-F-1)/e);Math.floor((s[h]-1)/e)<d&&o.push(""),Ne(o,f,e);continue}if(g+s[h]>e&&g>0&&s[h]>0){if(t.wordWrap===!1&&g<e){Ne(o,f,e);continue}o.push("")}if(g+s[h]>e&&t.wordWrap===!1){Ne(o,f,e);continue}o[o.length-1]+=f}t.trim!==!1&&(o=o.map(h=>$D(h)));let a=[...o.join(`
`)];for(let[h,f]of a.entries()){if(D+=f,we.has(f)){let{groups:F}=new RegExp(`(?:\\${mu}(?<code>\\d+)m|\\${Me}(?<uri>.*)${Le})`).exec(a.slice(h).join(""))||{groups:{}};if(F.code!==void 0){let d=Number.parseFloat(F.code);n=d===BD?void 0:d}else F.uri!==void 0&&(i=F.uri.length===0?void 0:F.uri)}let g=mD.codes.get(Number(n));a[h+1]===`
`?(i&&(D+=yu("")),n&&g&&(D+=wu(g))):f===`
`&&(n&&g&&(D+=wu(n)),i&&(D+=yu(i)))}return D};function bD(u,e,t){return String(u).normalize().replace(/\r\n/g,`
`).split(`
`).map(D=>AD(D,e,t)).join(`
`)}var $u=u=>Array.from({length:u}).fill("");function vD(u,e){let t=[],D=0;for(let n of u){let i=0,s=n.map(a=>{var h;let f=(h=e[D])!=null?h:"";D+=1,a.preprocess&&(f=a.preprocess(f)),pu(f)>a.width&&(f=bD(f,a.width,{hard:!0}));let g=f.split(`
`);if(a.postprocess){let{postprocess:F}=a;g=g.map((d,m)=>F.call(a,d,m))}return a.paddingTop&&g.unshift(...$u(a.paddingTop)),a.paddingBottom&&g.push(...$u(a.paddingBottom)),g.length>i&&(i=g.length),Re(Be({},a),{lines:g})}),o=[];for(let a=0;a<i;a+=1){let h=s.map(f=>{var g;let F=(g=f.lines[a])!=null?g:"",d=Number.isFinite(f.width)?" ".repeat(f.width-V(F)):"",m=f.paddingLeftString;return f.align==="right"&&(m+=d),m+=F,f.align==="left"&&(m+=d),m+f.paddingRightString}).join("");o.push(h)}t.push(o.join(`
`))}return t.join(`
`)}function SD(u,e){if(!u||u.length===0)return"";let t=pD(u),D=t.length;if(D===0)return"";let{stdoutColumns:n,columns:i}=aD(e);if(i.length>D)throw new Error(`${i.length} columns defined, but only ${D} columns found`);let s=CD(n,i,t);return u.map(o=>vD(s,o)).join(`
`)}x();var OD=["<",">","=",">=","<="];function kD(u){if(!OD.includes(u))throw new TypeError(`Invalid breakpoint operator: ${u}`)}function jD(u){let e=Object.keys(u).map(t=>{let[D,n]=t.split(" ");kD(D);let i=Number.parseInt(n,10);if(Number.isNaN(i))throw new TypeError(`Invalid breakpoint value: ${n}`);let s=u[t];return{operator:D,breakpoint:i,value:s}}).sort((t,D)=>D.breakpoint-t.breakpoint);return t=>{var D;return(D=e.find(({operator:n,breakpoint:i})=>n==="="&&t===i||n===">"&&t>i||n==="<"&&t<i||n===">="&&t>=i||n==="<="&&t<=i))==null?void 0:D.value}}const xD=u=>u.replace(/[\W_]([a-z\d])?/gi,(e,t)=>t?t.toUpperCase():""),TD=u=>u.replace(/\B([A-Z])/g,"-$1").toLowerCase(),RD={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:u=>u.trim()},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function PD(u){let e=!1;return{type:"table",data:{tableData:Object.keys(u).sort((t,D)=>t.localeCompare(D)).map(t=>{const D=u[t],n="alias"in D;return n&&(e=!0),{name:t,flag:D,flagFormatted:`--${TD(t)}`,aliasesEnabled:e,aliasFormatted:n?`-${D.alias}`:void 0}}).map(t=>(t.aliasesEnabled=e,[{type:"flagName",data:t},{type:"flagDescription",data:t}])),tableBreakpoints:RD}}}const Au=u=>!u||(u.version??(u.help?u.help.version:void 0)),bu=u=>{const e="parent"in u&&u.parent?.name;return(e?`${e} `:"")+u.name};function LD(u){const e=[];u.name&&e.push(bu(u));const t=Au(u)??("parent"in u&&Au(u.parent));if(t&&e.push(`v${t}`),e.length!==0)return{id:"name",type:"text",data:`${e.join(" ")}
`}}function MD(u){const{help:e}=u;if(!(!e||!e.description))return{id:"description",type:"text",data:`${e.description}
`}}function ND(u){const e=u.help||{};if("usage"in e)return e.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(e.usage)?e.usage.join(`
`):e.usage}}:void 0;if(u.name){const t=[],D=[bu(u)];if(u.flags&&Object.keys(u.flags).length>0&&D.push("[flags...]"),u.parameters&&u.parameters.length>0){const{parameters:n}=u,i=n.indexOf("--"),s=i>-1&&n.slice(i+1).some(o=>o.startsWith("<"));D.push(n.map(o=>o!=="--"?o:s?"--":"[--]").join(" "))}if(D.length>1&&t.push(D.join(" ")),"commands"in u&&u.commands?.length&&t.push(`${u.name} <command>`),t.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:t.join(`
`)}}}}function ID(u){return!("commands"in u)||!u.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:u.commands.map(e=>[e.options.name,e.options.help?e.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}function _D(u){if(!(!u.flags||Object.keys(u.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:PD(u.flags),indentBody:0}}}function WD(u){const{help:e}=u;if(!e||!e.examples||e.examples.length===0)return;let{examples:t}=e;if(Array.isArray(t)&&(t=t.join(`
`)),t)return{id:"examples",type:"section",data:{title:"Examples:",body:t}}}function GD(u){if(!("alias"in u)||!u.alias)return;const{alias:e}=u;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(e)?e.join(", "):e}}}const qD=u=>[LD,MD,ND,ID,_D,WD,GD].map(e=>e(u)).filter(Boolean),zD=Ot.WriteStream.prototype.hasColors();class JD{text(e){return e}bold(e){return zD?`\x1B[1m${e}\x1B[22m`:e.toLocaleUpperCase()}indentText({text:e,spaces:t}){return e.replace(/^/gm," ".repeat(t))}heading(e){return this.bold(e)}section({title:e,body:t,indentBody:D=2}){return`${(e?`${this.heading(e)}
`:"")+(t?this.indentText({text:this.render(t),spaces:D}):"")}
`}table({tableData:e,tableOptions:t,tableBreakpoints:D}){return SD(e.map(n=>n.map(i=>this.render(i))),D?jD(D):t)}flagParameter(e){return e===Boolean?"":e===String?"<string>":e===Number?"<number>":Array.isArray(e)?this.flagParameter(e[0]):"<value>"}flagOperator(e){return" "}flagName(e){const{flag:t,flagFormatted:D,aliasesEnabled:n,aliasFormatted:i}=e;let s="";if(i?s+=`${i}, `:n&&(s+=" "),s+=D,"placeholder"in t&&typeof t.placeholder=="string")s+=`${this.flagOperator(e)}${t.placeholder}`;else{const o=this.flagParameter("type"in t?t.type:t);o&&(s+=`${this.flagOperator(e)}${o}`)}return s}flagDefault(e){return JSON.stringify(e)}flagDescription({flag:e}){let t="description"in e?e.description??"":"";if("default"in e){let{default:D}=e;typeof D=="function"&&(D=D()),D&&(t+=` (default: ${this.flagDefault(D)})`)}return t}render(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(t=>this.render(t)).join(`
`);if("type"in e&&this[e.type]){const t=this[e.type];if(typeof t=="function")return t.call(this,e.data)}throw new Error(`Invalid node type: ${JSON.stringify(e)}`)}}const Ie=/^[\w.-]+$/,{stringify:I}=JSON,VD=/[|\\{}()[\]^$+*?.]/;function _e(u){const e=[];let t,D;for(const n of u){if(D)throw new Error(`Invalid parameter: Spread parameter ${I(D)} must be last`);const i=n[0],s=n[n.length-1];let o;if(i==="<"&&s===">"&&(o=!0,t))throw new Error(`Invalid parameter: Required parameter ${I(n)} cannot come after optional parameter ${I(t)}`);if(i==="["&&s==="]"&&(o=!1,t=n),o===void 0)throw new Error(`Invalid parameter: ${I(n)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let a=n.slice(1,-1);const h=a.slice(-3)==="...";h&&(D=n,a=a.slice(0,-3));const f=a.match(VD);if(f)throw new Error(`Invalid parameter: ${I(n)}. Invalid character found ${I(f[0])}`);e.push({name:a,required:o,spread:h})}return e}function We(u,e,t,D){for(let n=0;n<e.length;n+=1){const{name:i,required:s,spread:o}=e[n],a=xD(i);if(a in u)throw new Error(`Invalid parameter: ${I(i)} is used more than once.`);const h=o?t.slice(n):t[n];if(o&&(n=e.length),s&&(!h||o&&h.length===0))return console.error(`Error: Missing required parameter ${I(i)}
`),D(),process.exit(1);u[a]=h}}function UD(u){return u===void 0||u!==!1}function vu(u,e,t,D){const n={...e.flags},i=e.version;i&&(n.version={type:Boolean,description:"Show version"});const{help:s}=e,o=UD(s);o&&!("help"in n)&&(n.help={type:Boolean,alias:"h",description:"Show help"});const a=Ht(n,D,{ignore:e.ignoreArgv}),h=()=>{console.log(e.version)};if(i&&a.flags.version===!0)return h(),process.exit(0);const f=new JD,g=o&&s?.render?s.render:m=>f.render(m),F=m=>{const w=qD({...e,...m?{help:m}:{},flags:n});console.log(g(w,f))};if(o&&a.flags.help===!0)return F(),process.exit(0);if(e.parameters){let{parameters:m}=e,w=a._;const S=m.indexOf("--"),R=m.slice(S+1),M=Object.create(null);if(S>-1&&R.length>0){m=m.slice(0,S);const G=a._["--"];w=w.slice(0,-G.length||void 0),We(M,_e(m),w,F),We(M,_e(R),G,F)}else We(M,_e(m),w,F);Object.assign(a._,M)}const d={...a,showVersion:h,showHelp:F};return typeof t=="function"&&t(d),{command:u,...d}}function ZD(u,e){const t=new Map;for(const D of e){const n=[D.options.name],{alias:i}=D.options;i&&(Array.isArray(i)?n.push(...i):n.push(i));for(const s of n){if(t.has(s))throw new Error(`Duplicate command name found: ${I(s)}`);t.set(s,D)}}return t.get(u)}function HD(u,e,t=process.argv.slice(2)){if(!u)throw new Error("Options is required");if("name"in u&&(!u.name||!Ie.test(u.name)))throw new Error(`Invalid script name: ${I(u.name)}`);const D=t[0];if(u.commands&&Ie.test(D)){const n=ZD(D,u.commands);if(n)return vu(n.options.name,{...n.options,parent:u},n.callback,t.slice(1))}return vu(void 0,u,e,t)}function XD(u,e){if(!u)throw new Error("Command options are required");const{name:t}=u;if(u.name===void 0)throw new Error("Command name is required");if(!Ie.test(t))throw new Error(`Invalid command name ${JSON.stringify(t)}. Command names must be one word.`);return{options:u,callback:e}}function ye(){}function Su(){return typeof WeakMap<"u"?new WeakMap:YD()}function YD(){return{add:ye,delete:ye,get:ye,set:ye,has:function(u){return!1}}}var KD=Object.prototype.hasOwnProperty,Ge=function(u,e){return KD.call(u,e)};function qe(u,e){for(var t in e)Ge(e,t)&&(u[t]=e[t]);return u}var QD=/^[ \t]*(?:\r\n|\r|\n)/,en=/(?:\r\n|\r|\n)[ \t]*$/,un=/^(?:[\r\n]|$)/,tn=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,Dn=/^[ \t]*[\r\n][ \t\r\n]*$/;function Ou(u,e,t){var D=0,n=u[0].match(tn);n&&(D=n[1].length);var i="(\\r\\n|\\r|\\n).{0,"+D+"}",s=new RegExp(i,"g");e&&(u=u.slice(1));var o=t.newline,a=t.trimLeadingNewline,h=t.trimTrailingNewline,f=typeof o=="string",g=u.length,F=u.map(function(d,m){return d=d.replace(s,"$1"),m===0&&a&&(d=d.replace(QD,"")),m===g-1&&h&&(d=d.replace(en,"")),f&&(d=d.replace(/\r\n|\n|\r/g,function(w){return o})),d});return F}function nn(u,e){for(var t="",D=0,n=u.length;D<n;D++)t+=u[D],D<n-1&&(t+=e[D]);return t}function sn(u){return Ge(u,"raw")&&Ge(u,"length")}function ku(u){var e=Su(),t=Su();function D(i){for(var s=[],o=1;o<arguments.length;o++)s[o-1]=arguments[o];if(sn(i)){var a=i,h=(s[0]===D||s[0]===W)&&Dn.test(a[0])&&un.test(a[1]),f=h?t:e,g=f.get(a);if(g||(g=Ou(a,h,u),f.set(a,g)),s.length===0)return g[0];var F=nn(g,h?s.slice(1):s);return F}else return ku(qe(qe({},u),i||{}))}var n=qe(D,{string:function(i){return Ou([i],!1,u)[0]}});return n}var W=ku({trimLeadingNewline:!0,trimTrailingNewline:!0});if(typeof module<"u")try{module.exports=W,Object.defineProperty(W,"__esModule",{value:!0}),W.default=W,W.outdent=W}catch{}let U=!0;const H=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let se=0;if(H.process&&H.process.env&&H.process.stdout){const{FORCE_COLOR:u,NODE_DISABLE_COLORS:e,NO_COLOR:t,TERM:D,COLORTERM:n}=H.process.env;e||t||u==="0"?U=!1:u==="1"||u==="2"||u==="3"?U=!0:D==="dumb"?U=!1:"CI"in H.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(i=>i in H.process.env)?U=!0:U=process.stdout.isTTY,U&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?se=3:D&&(D.endsWith("-256color")||D.endsWith("256"))?se=2:se=1)}let ju={enabled:U,supportLevel:se};function X(u,e,t=1){const D=`\x1B[${u}m`,n=`\x1B[${e}m`,i=new RegExp(`\\x1b\\[${e}m`,"g");return s=>ju.enabled&&ju.supportLevel>=t?D+(""+s).replace(i,D)+n:""+s}const rn=X(1,22),ze=X(2,22),xu=X(31,39),Tu=X(32,39),Je=X(35,39),re=X(36,39),oe=u=>O.access(u).then(()=>!0,()=>!1);var on=require;const Ru=async u=>{const e=await O.readFile(u,"utf8");return JSON.parse(e)},an="link.config.json",Pu="link.config.js",Lu=async u=>{const e=A.join(u,an);if(await oe(e))try{return Ru(e)}catch(D){throw new Error(`Failed to parse config JSON ${e}: ${D.message}`)}const t=A.join(u,Pu);if(await oe(t))try{return on(t)}catch(D){throw new Error(`Failed to load config file ${Pu}: ${D.message}`)}};var Mu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nu(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var $e={};$e.replaceDollarWithPercentPair=_u,$e.convertToSetCommand=Iu,$e.convertToSetCommands=cn;function Iu(u,e){var t="";return u=u||"",u=u.trim(),e=e||"",e=e.trim(),u&&e&&e.length>0&&(t="@SET "+u+"="+_u(e)+`\r
`),t}function ln(u){var e={};return u.map(function(t){var D=t.split("=");e[D[0]]=D[1]}),e}function cn(u){var e=ln(u.split(" ")),t="";return Object.keys(e).forEach(function(D){t+=Iu(D,e[D])}),t}function _u(u){var e=/\$\{?([^$@#?\- \t{}:]+)\}?/g,t="",D=0;do{var n=e.exec(u);if(n){var i=u.substring(D,n.index)||"";t+=i+"%"+n[1]+"%",D=e.lastIndex}}while(e.lastIndex>0);return t+=u.slice(D),t}const{chmod:Ve,mkdir:hn,readFile:pn,stat:Wu,unlink:fn,writeFile:Ue}=O,{dirname:Gu,relative:Fn}=A,dn=$e,Cn=/^#!\s*(?:\/usr\/bin\/env\s+(?:-S\s+)?((?:[^ \t=]+=[^ \t=]+\s+)*))?([^ \t]+)(.*)$/,En=(u,e)=>Wu(u).then(()=>He(u,e),()=>{}),Ze=u=>fn(u).catch(()=>{}),He=(u,e)=>Wu(u).then(()=>gn(u,e)),gn=(u,e)=>Promise.all([Ze(e),Ze(e+".cmd"),Ze(e+".ps1")]).then(()=>mn(u,e)),mn=(u,e)=>hn(Gu(e),{recursive:!0}).then(()=>pn(u,"utf8")).then(t=>{const n=t.trim().split(/\r*\n/)[0].match(Cn);if(!n)return Xe(u,e);const i=n[1]||"",s=n[2],o=n[3]||"";return Xe(u,e,s,o,i)},t=>Xe(u,e)),Xe=(u,e,t,D,n)=>{let i=Fn(Gu(e),u),s=i.split("/").join("\\"),o,a=t&&t.split("\\").join("/"),h,f=a&&`"${a}$exe"`,g;i=i.split("\\").join("/"),D=D||"",n=n||"",t?(o=`"%dp0%\\${t}.exe"`,h=`"$basedir/${t}"`,g=`"$basedir/${t}$exe"`,s=`"%dp0%\\${s}"`,i=`"$basedir/${i}"`):(t=`"%dp0%\\${s}"`,a=`"$basedir/${i}"`,f=a,D="",s="",i="");const F=`@ECHO off\r
GOTO start\r
:find_dp0\r
SET dp0=%~dp0\r
EXIT /b\r
:start\r
SETLOCAL\r
CALL :find_dp0\r
`;let d;if(o){h=h.trim(),D=D.trim();const S=dn.convertToSetCommands(n);d=F+S+`\r
IF EXIST ${o} (\r
SET "_prog=${o.replace(/(^")|("$)/g,"")}"\r
) ELSE (\r
SET "_prog=${t.replace(/(^")|("$)/g,"")}"\r
SET PATHEXT=%PATHEXT:;.JS;=;%\r
)\r
\r
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" ${D} ${s} %*\r
`}else d=`${F}${t} ${D} ${s} %*\r
`;let m=`#!/bin/sh
`;m=m+`basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")
case \`uname\` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=\`cygpath -w "$basedir"\`;;
esac
`,h?m=m+`if [ -x ${h} ]; then
exec ${n}${h} ${D} ${i} "$@"
else
exec ${n}${a} ${D} ${i} "$@"
fi
`:m=m+`exec ${a} ${D} ${i} "$@"
`;let w=`#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
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 h?w=w+`$ret=0
if (Test-Path ${g}) {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${g} ${D} ${i} $args
} else {
& ${g} ${D} ${i} $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${f} ${D} ${i} $args
} else {
& ${f} ${D} ${i} $args
}
$ret=$LASTEXITCODE
}
exit $ret
`:w=w+`# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${f} ${D} ${i} $args
} else {
& ${f} ${D} ${i} $args
}
exit $LASTEXITCODE
`,Promise.all([Ue(e+".ps1",w,"utf8"),Ue(e+".cmd",d,"utf8"),Ue(e,m,"utf8")]).then(()=>Bn(e))},Bn=u=>Promise.all([Ve(u,493),Ve(u+".cmd",493),Ve(u+".ps1",493)]);var wn=He;He.ifExists=En;var yn=Nu(wn);const qu=async u=>{const e=A.join(u,"package.json");if(!await oe(e))throw new Error(`package.json not found in ${u}`);const D=await Ru(e);if(!D.name)throw new Error(`package.json must contain a name: ${e}`);return D},zu=async(u,e,t)=>{const D=await O.lstat(e).catch(()=>null);if(D){if(D.isSymbolicLink()){const n=await O.realpath(e).catch(()=>null);if(u===n)return}await O.rm(e,{recursive:!0})}await O.symlink(u,e,t)},$n=async(u,e)=>{await zu(u,e),await O.chmod(e,493)},An=async(u,e)=>{await oe(e)&&await O.rm(e,{recursive:!0}),await O.link(u,e)},bn=async(u,e,{name:t,bin:D},n)=>{if(!D)return[];t?.startsWith("@")&&([,t]=t.split("/"));const i=A.join(e,".bin");if(await O.mkdir(i,{recursive:!0}),typeof D=="string"){await n(A.resolve(u,D),A.join(i,t));return}await Promise.all(Object.entries(D).map(async([s,o])=>await n(A.resolve(u,o),A.join(i,s))))},vn="node_modules",Sn=async(u,e)=>{const t=A.resolve(u,e),D=await qu(t),n=A.join(u,vn),i=A.join(n,D.name),s=A.dirname(i);await O.mkdir(s,{recursive:!0});const o=A.relative(s,t);return await zu(o,i,"junction"),await bn(t,n,D,process.platform==="win32"?yn:$n),{name:D.name,path:i,target:o}},Ju=async(u,e,t)=>{const D=A.resolve(u,e);if(!await oe(D)){console.warn(xu("\u2716"),`Package path does not exist: ${e}`),process.exitCode=1;return}try{const i=await Sn(u,e);console.log(Tu("\u2714"),`Symlinked ${Je(i.name)}:`,re(i.path),"\u2192",re(i.target))}catch(i){console.warn(xu("\u2716"),"Failed to symlink",re(e),"with error:",i.message),process.exitCode=1;return}if(t.deep){const i=await Lu(D);i&&await Vu(D,i,t)}},Vu=async(u,e,t)=>{if(!e.packages)return;const D={deep:t.deep??e.deepLink??!1};await Promise.all(e.packages.map(async n=>await Ju(u,n,D)))};var Uu={},On=Zu;function Zu(u,e,t){u instanceof RegExp&&(u=Hu(u,t)),e instanceof RegExp&&(e=Hu(e,t));var D=Xu(u,e,t);return D&&{start:D[0],end:D[1],pre:t.slice(0,D[0]),body:t.slice(D[0]+u.length,D[1]),post:t.slice(D[1]+e.length)}}function Hu(u,e){var t=e.match(u);return t?t[0]:null}Zu.range=Xu;function Xu(u,e,t){var D,n,i,s,o,a=t.indexOf(u),h=t.indexOf(e,a+1),f=a;if(a>=0&&h>0){if(u===e)return[a,h];for(D=[],i=t.length;f>=0&&!o;)f==a?(D.push(f),a=t.indexOf(u,f+1)):D.length==1?o=[D.pop(),h]:(n=D.pop(),n<i&&(i=n,s=h),h=t.indexOf(e,f+1)),f=a<h&&a>=0?a:h;D.length&&(o=[i,s])}return o}var Yu=On,kn=Tn,Ku="\0SLASH"+Math.random()+"\0",Qu="\0OPEN"+Math.random()+"\0",Ye="\0CLOSE"+Math.random()+"\0",et="\0COMMA"+Math.random()+"\0",ut="\0PERIOD"+Math.random()+"\0";function Ke(u){return parseInt(u,10)==u?parseInt(u,10):u.charCodeAt(0)}function jn(u){return u.split("\\\\").join(Ku).split("\\{").join(Qu).split("\\}").join(Ye).split("\\,").join(et).split("\\.").join(ut)}function xn(u){return u.split(Ku).join("\\").split(Qu).join("{").split(Ye).join("}").split(et).join(",").split(ut).join(".")}function tt(u){if(!u)return[""];var e=[],t=Yu("{","}",u);if(!t)return u.split(",");var D=t.pre,n=t.body,i=t.post,s=D.split(",");s[s.length-1]+="{"+n+"}";var o=tt(i);return i.length&&(s[s.length-1]+=o.shift(),s.push.apply(s,o)),e.push.apply(e,s),e}function Tn(u){return u?(u.substr(0,2)==="{}"&&(u="\\{\\}"+u.substr(2)),ae(jn(u),!0).map(xn)):[]}function Rn(u){return"{"+u+"}"}function Pn(u){return/^-?0\d/.test(u)}function Ln(u,e){return u<=e}function Mn(u,e){return u>=e}function ae(u,e){var t=[],D=Yu("{","}",u);if(!D)return[u];var n=D.pre,i=D.post.length?ae(D.post,!1):[""];if(/\$$/.test(D.pre))for(var s=0;s<i.length;s++){var o=n+"{"+D.body+"}"+i[s];t.push(o)}else{var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(D.body),h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(D.body),f=a||h,g=D.body.indexOf(",")>=0;if(!f&&!g)return D.post.match(/,.*\}/)?(u=D.pre+"{"+D.body+Ye+D.post,ae(u)):[u];var F;if(f)F=D.body.split(/\.\./);else if(F=tt(D.body),F.length===1&&(F=ae(F[0],!1).map(Rn),F.length===1))return i.map(function(Ee){return D.pre+F[0]+Ee});var d;if(f){var m=Ke(F[0]),w=Ke(F[1]),S=Math.max(F[0].length,F[1].length),R=F.length==3?Math.abs(Ke(F[2])):1,M=Ln,G=w<m;G&&(R*=-1,M=Mn);var Te=F.some(Pn);d=[];for(var J=m;M(J,w);J+=R){var P;if(h)P=String.fromCharCode(J),P==="\\"&&(P="");else if(P=String(J),Te){var de=S-P.length;if(de>0){var Ce=new Array(de+1).join("0");J<0?P="-"+Ce+P.slice(1):P=Ce+P}}d.push(P)}}else{d=[];for(var _=0;_<F.length;_++)d.push.apply(d,ae(F[_],!1))}for(var _=0;_<d.length;_++)for(var s=0;s<i.length;s++){var o=n+d[_]+i[s];(!e||f||o)&&t.push(o)}}return t}var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.assertValidPattern=void 0;const Nn=1024*64,In=u=>{if(typeof u!="string")throw new TypeError("invalid pattern");if(u.length>Nn)throw new TypeError("pattern is too long")};Ae.assertValidPattern=In;var le={},be={};Object.defineProperty(be,"__esModule",{value:!0}),be.parseClass=void 0;const _n={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},ce=u=>u.replace(/[[\]\\-]/g,"\\$&"),Wn=u=>u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Dt=u=>u.join(""),Gn=(u,e)=>{const t=e;if(u.charAt(t)!=="[")throw new Error("not in a brace expression");const D=[],n=[];let i=t+1,s=!1,o=!1,a=!1,h=!1,f=t,g="";e:for(;i<u.length;){const w=u.charAt(i);if((w==="!"||w==="^")&&i===t+1){h=!0,i++;continue}if(w==="]"&&s&&!a){f=i+1;break}if(s=!0,w==="\\"&&!a){a=!0,i++;continue}if(w==="["&&!a){for(const[S,[R,M,G]]of Object.entries(_n))if(u.startsWith(S,i)){if(g)return["$.",!1,u.length-t,!0];i+=S.length,G?n.push(R):D.push(R),o=o||M;continue e}}if(a=!1,g){w>g?D.push(ce(g)+"-"+ce(w)):w===g&&D.push(ce(w)),g="",i++;continue}if(u.startsWith("-]",i+1)){D.push(ce(w+"-")),i+=2;continue}if(u.startsWith("-",i+1)){g=w,i+=2;continue}D.push(ce(w)),i++}if(f<i)return["",!1,0,!1];if(!D.length&&!n.length)return["$.",!1,u.length-t,!0];if(n.length===0&&D.length===1&&/^\\?.$/.test(D[0])&&!h){const w=D[0].length===2?D[0].slice(-1):D[0];return[Wn(w),!1,f-t,!1]}const F="["+(h?"^":"")+Dt(D)+"]",d="["+(h?"":"^")+Dt(n)+"]";return[D.length&&n.length?"("+F+"|"+d+")":D.length?F:d,o,f-t,!0]};be.parseClass=Gn;var Y={};Object.defineProperty(Y,"__esModule",{value:!0}),Y.unescape=void 0;const qn=(u,{windowsPathsNoEscape:e=!1}={})=>e?u.replace(/\[([^\/\\])\]/g,"$1"):u.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");Y.unescape=qn,Object.defineProperty(le,"__esModule",{value:!0}),le.AST=void 0;const zn=be,ve=Y,Jn=new Set(["!","?","+","*","@"]),nt=u=>Jn.has(u),Vn="(?!(?:^|/)\\.\\.?(?:$|/))",Se="(?!\\.)",Un=new Set(["[","."]),Zn=new Set(["..","."]),Hn=new Set("().*{}+?[]^$\\!"),Xn=u=>u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Qe="[^/]",it=Qe+"*?",st=Qe+"+?";class T{type;#t;#D;#n=!1;#e=[];#u;#s;#o;#r=!1;#i;#a;#c=!1;constructor(e,t,D={}){this.type=e,e&&(this.#D=!0),this.#u=t,this.#t=this.#u?this.#u.#t:this,this.#i=this.#t===this?D:this.#t.#i,this.#o=this.#t===this?[]:this.#t.#o,e==="!"&&!this.#t.#r&&this.#o.push(this),this.#s=this.#u?this.#u.#e.length:0}get hasMagic(){if(this.#D!==void 0)return this.#D;for(const e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#D=!0;return this.#D}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#a=this.#e.map(e=>String(e)).join("")}#p(){if(this!==this.#t)throw new Error("should only call on root");if(this.#r)return this;this.toString(),this.#r=!0;let e;for(;e=this.#o.pop();){if(e.type!=="!")continue;let t=e,D=t.#u;for(;D;){for(let n=t.#s+1;!D.type&&n<D.#e.length;n++)for(cons