create-world-app
Version:
Scaffold world mini-apps faster
2 lines • 200 kB
JavaScript
#!/usr/bin/env node
(()=>{var s={422:(e,s,o)=>{"use strict";const a=o(317);const l=o(641);const c=o(609);function spawn(e,s,o){const D=l(e,s,o);const d=a.spawn(D.command,D.args,D.options);c.hookChildProcess(d,D);return d}function spawnSync(e,s,o){const D=l(e,s,o);const d=a.spawnSync(D.command,D.args,D.options);d.error=d.error||c.verifyENOENTSync(d.status,D);return d}e.exports=spawn;e.exports.spawn=spawn;e.exports.sync=spawnSync;e.exports._parse=l;e.exports._enoent=c},609:e=>{"use strict";const s=process.platform==="win32";function notFoundError(e,s){return Object.assign(new Error(`${s} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${s} ${e.command}`,path:e.command,spawnargs:e.args})}function hookChildProcess(e,o){if(!s){return}const a=e.emit;e.emit=function(s,l){if(s==="exit"){const s=verifyENOENT(l,o);if(s){return a.call(e,"error",s)}}return a.apply(e,arguments)}}function verifyENOENT(e,o){if(s&&e===1&&!o.file){return notFoundError(o.original,"spawn")}return null}function verifyENOENTSync(e,o){if(s&&e===1&&!o.file){return notFoundError(o.original,"spawnSync")}return null}e.exports={hookChildProcess:hookChildProcess,verifyENOENT:verifyENOENT,verifyENOENTSync:verifyENOENTSync,notFoundError:notFoundError}},641:(e,s,o)=>{"use strict";const a=o(928);const l=o(998);const c=o(528);const D=o(115);const d=process.platform==="win32";const g=/\.(?:com|exe)$/i;const y=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(e){e.file=l(e);const s=e.file&&D(e.file);if(s){e.args.unshift(e.file);e.command=s;return l(e)}return e.file}function parseNonShell(e){if(!d){return e}const s=detectShebang(e);const o=!g.test(s);if(e.options.forceShell||o){const o=y.test(s);e.command=a.normalize(e.command);e.command=c.command(e.command);e.args=e.args.map((e=>c.argument(e,o)));const l=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${l}"`];e.command=process.env.comspec||"cmd.exe";e.options.windowsVerbatimArguments=true}return e}function parse(e,s,o){if(s&&!Array.isArray(s)){o=s;s=null}s=s?s.slice(0):[];o=Object.assign({},o);const a={command:e,args:s,options:o,file:undefined,original:{command:e,args:s}};return o.shell?a:parseNonShell(a)}e.exports=parse},528:e=>{"use strict";const s=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(e){e=e.replace(s,"^$1");return e}function escapeArgument(e,o){e=`${e}`;e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"');e=e.replace(/(?=(\\+?)?)\1$/,"$1$1");e=`"${e}"`;e=e.replace(s,"^$1");if(o){e=e.replace(s,"^$1")}return e}e.exports.command=escapeCommand;e.exports.argument=escapeArgument},115:(e,s,o)=>{"use strict";const a=o(896);const l=o(668);function readShebang(e){const s=150;const o=Buffer.alloc(s);let c;try{c=a.openSync(e,"r");a.readSync(c,o,0,s,0);a.closeSync(c)}catch(e){}return l(o.toString())}e.exports=readShebang},998:(e,s,o)=>{"use strict";const a=o(928);const l=o(340);const c=o(661);function resolveCommandAttempt(e,s){const o=e.options.env||process.env;const D=process.cwd();const d=e.options.cwd!=null;const g=d&&process.chdir!==undefined&&!process.chdir.disabled;if(g){try{process.chdir(e.options.cwd)}catch(e){}}let y;try{y=l.sync(e.command,{path:o[c({env:o})],pathExt:s?a.delimiter:undefined})}catch(e){}finally{if(g){process.chdir(D)}}if(y){y=a.resolve(d?e.options.cwd:"",y)}return y}function resolveCommand(e){return resolveCommandAttempt(e)||resolveCommandAttempt(e,true)}e.exports=resolveCommand},648:(e,s,o)=>{var a=o(896);var l;if(process.platform==="win32"||global.TESTING_WINDOWS){l=o(117)}else{l=o(341)}e.exports=isexe;isexe.sync=sync;function isexe(e,s,o){if(typeof s==="function"){o=s;s={}}if(!o){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(o,a){isexe(e,s||{},(function(e,s){if(e){a(e)}else{o(s)}}))}))}l(e,s||{},(function(e,a){if(e){if(e.code==="EACCES"||s&&s.ignoreErrors){e=null;a=false}}o(e,a)}))}function sync(e,s){try{return l.sync(e,s||{})}catch(e){if(s&&s.ignoreErrors||e.code==="EACCES"){return false}else{throw e}}}},341:(e,s,o)=>{e.exports=isexe;isexe.sync=sync;var a=o(896);function isexe(e,s,o){a.stat(e,(function(e,a){o(e,e?false:checkStat(a,s))}))}function sync(e,s){return checkStat(a.statSync(e),s)}function checkStat(e,s){return e.isFile()&&checkMode(e,s)}function checkMode(e,s){var o=e.mode;var a=e.uid;var l=e.gid;var c=s.uid!==undefined?s.uid:process.getuid&&process.getuid();var D=s.gid!==undefined?s.gid:process.getgid&&process.getgid();var d=parseInt("100",8);var g=parseInt("010",8);var y=parseInt("001",8);var C=d|g;var F=o&y||o&g&&l===D||o&d&&a===c||o&C&&c===0;return F}},117:(e,s,o)=>{e.exports=isexe;isexe.sync=sync;var a=o(896);function checkPathExt(e,s){var o=s.pathExt!==undefined?s.pathExt:process.env.PATHEXT;if(!o){return true}o=o.split(";");if(o.indexOf("")!==-1){return true}for(var a=0;a<o.length;a++){var l=o[a].toLowerCase();if(l&&e.substr(-l.length).toLowerCase()===l){return true}}return false}function checkStat(e,s,o){if(!e.isSymbolicLink()&&!e.isFile()){return false}return checkPathExt(s,o)}function isexe(e,s,o){a.stat(e,(function(a,l){o(a,a?false:checkStat(l,e,s))}))}function sync(e,s){return checkStat(a.statSync(e),e,s)}},661:e=>{"use strict";const pathKey=(e={})=>{const s=e.env||process.env;const o=e.platform||process.platform;if(o!=="win32"){return"PATH"}return Object.keys(s).reverse().find((e=>e.toUpperCase()==="PATH"))||"Path"};e.exports=pathKey;e.exports["default"]=pathKey},596:e=>{let s=process||{},o=s.argv||[],a=s.env||{};let l=!(!!a.NO_COLOR||o.includes("--no-color"))&&(!!a.FORCE_COLOR||o.includes("--color")||s.platform==="win32"||(s.stdout||{}).isTTY&&a.TERM!=="dumb"||!!a.CI);let formatter=(e,s,o=e)=>a=>{let l=""+a,c=l.indexOf(s,e.length);return~c?e+replaceClose(l,s,o,c)+s:e+l+s};let replaceClose=(e,s,o,a)=>{let l="",c=0;do{l+=e.substring(c,a)+o;c=a+s.length;a=e.indexOf(s,c)}while(~a);return l+e.substring(c)};let createColors=(e=l)=>{let s=e?formatter:()=>String;return{isColorSupported:e,reset:s("[0m","[0m"),bold:s("[1m","[22m","[22m[1m"),dim:s("[2m","[22m","[22m[2m"),italic:s("[3m","[23m"),underline:s("[4m","[24m"),inverse:s("[7m","[27m"),hidden:s("[8m","[28m"),strikethrough:s("[9m","[29m"),black:s("[30m","[39m"),red:s("[31m","[39m"),green:s("[32m","[39m"),yellow:s("[33m","[39m"),blue:s("[34m","[39m"),magenta:s("[35m","[39m"),cyan:s("[36m","[39m"),white:s("[37m","[39m"),gray:s("[90m","[39m"),bgBlack:s("[40m","[49m"),bgRed:s("[41m","[49m"),bgGreen:s("[42m","[49m"),bgYellow:s("[43m","[49m"),bgBlue:s("[44m","[49m"),bgMagenta:s("[45m","[49m"),bgCyan:s("[46m","[49m"),bgWhite:s("[47m","[49m"),blackBright:s("[90m","[39m"),redBright:s("[91m","[39m"),greenBright:s("[92m","[39m"),yellowBright:s("[93m","[39m"),blueBright:s("[94m","[39m"),magentaBright:s("[95m","[39m"),cyanBright:s("[96m","[39m"),whiteBright:s("[97m","[39m"),bgBlackBright:s("[100m","[49m"),bgRedBright:s("[101m","[49m"),bgGreenBright:s("[102m","[49m"),bgYellowBright:s("[103m","[49m"),bgBlueBright:s("[104m","[49m"),bgMagentaBright:s("[105m","[49m"),bgCyanBright:s("[106m","[49m"),bgWhiteBright:s("[107m","[49m")}};e.exports=createColors();e.exports.createColors=createColors},668:(e,s,o)=>{"use strict";const a=o(570);e.exports=(e="")=>{const s=e.match(a);if(!s){return null}const[o,l]=s[0].replace(/#! ?/,"").split(" ");const c=o.split("/").pop();if(c==="env"){return l}return l?`${c} ${l}`:c}},570:e=>{"use strict";e.exports=/^#!(.*)/},798:e=>{"use strict";const s="";const o=`${s}[`;const a="";const l={to(e,s){if(!s)return`${o}${e+1}G`;return`${o}${s+1};${e+1}H`},move(e,s){let a="";if(e<0)a+=`${o}${-e}D`;else if(e>0)a+=`${o}${e}C`;if(s<0)a+=`${o}${-s}A`;else if(s>0)a+=`${o}${s}B`;return a},up:(e=1)=>`${o}${e}A`,down:(e=1)=>`${o}${e}B`,forward:(e=1)=>`${o}${e}C`,backward:(e=1)=>`${o}${e}D`,nextLine:(e=1)=>`${o}E`.repeat(e),prevLine:(e=1)=>`${o}F`.repeat(e),left:`${o}G`,hide:`${o}?25l`,show:`${o}?25h`,save:`${s}7`,restore:`${s}8`};const c={up:(e=1)=>`${o}S`.repeat(e),down:(e=1)=>`${o}T`.repeat(e)};const D={screen:`${o}2J`,up:(e=1)=>`${o}1J`.repeat(e),down:(e=1)=>`${o}J`.repeat(e),line:`${o}2K`,lineEnd:`${o}K`,lineStart:`${o}1K`,lines(e){let s="";for(let o=0;o<e;o++)s+=this.line+(o<e-1?l.up():"");if(e)s+=l.left;return s}};e.exports={cursor:l,scroll:c,erase:D,beep:a}},340:(e,s,o)=>{const a=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const l=o(928);const c=a?";":":";const D=o(648);const getNotFoundError=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"});const getPathInfo=(e,s)=>{const o=s.colon||c;const l=e.match(/\//)||a&&e.match(/\\/)?[""]:[...a?[process.cwd()]:[],...(s.path||process.env.PATH||"").split(o)];const D=a?s.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const d=a?D.split(o):[""];if(a){if(e.indexOf(".")!==-1&&d[0]!=="")d.unshift("")}return{pathEnv:l,pathExt:d,pathExtExe:D}};const which=(e,s,o)=>{if(typeof s==="function"){o=s;s={}}if(!s)s={};const{pathEnv:a,pathExt:c,pathExtExe:d}=getPathInfo(e,s);const g=[];const step=o=>new Promise(((c,D)=>{if(o===a.length)return s.all&&g.length?c(g):D(getNotFoundError(e));const d=a[o];const y=/^".*"$/.test(d)?d.slice(1,-1):d;const C=l.join(y,e);const F=!y&&/^\.[\\\/]/.test(e)?e.slice(0,2)+C:C;c(subStep(F,o,0))}));const subStep=(e,o,a)=>new Promise(((l,y)=>{if(a===c.length)return l(step(o+1));const C=c[a];D(e+C,{pathExt:d},((c,D)=>{if(!c&&D){if(s.all)g.push(e+C);else return l(e+C)}return l(subStep(e,o,a+1))}))}));return o?step(0).then((e=>o(null,e)),o):step(0)};const whichSync=(e,s)=>{s=s||{};const{pathEnv:o,pathExt:a,pathExtExe:c}=getPathInfo(e,s);const d=[];for(let g=0;g<o.length;g++){const y=o[g];const C=/^".*"$/.test(y)?y.slice(1,-1):y;const F=l.join(C,e);const _=!C&&/^\.[\\\/]/.test(e)?e.slice(0,2)+F:F;for(let e=0;e<a.length;e++){const o=_+a[e];try{const e=D.sync(o,{pathExt:c});if(e){if(s.all)d.push(o);else return o}}catch(e){}}}if(s.all&&d.length)return d;if(s.nothrow)return null;throw getNotFoundError(e)};e.exports=which;which.sync=whichSync},317:e=>{"use strict";e.exports=require("child_process")},896:e=>{"use strict";e.exports=require("fs")},421:e=>{"use strict";e.exports=require("node:child_process")},474:e=>{"use strict";e.exports=require("node:events")},24:e=>{"use strict";e.exports=require("node:fs")},760:e=>{"use strict";e.exports=require("node:path")},708:e=>{"use strict";e.exports=require("node:process")},928:e=>{"use strict";e.exports=require("path")},313:(e,s,o)=>{const{Argument:a}=o(854);const{Command:l}=o(600);const{CommanderError:c,InvalidArgumentError:D}=o(851);const{Help:d}=o(518);const{Option:g}=o(215);s.DM=new l;s.gu=e=>new l(e);s.Ww=(e,s)=>new g(e,s);s.er=(e,s)=>new a(e,s);s.uB=l;s.c$=g;s.ef=a;s._V=d;s.b7=c;s.Di=D;s.a2=D},854:(e,s,o)=>{const{InvalidArgumentError:a}=o(851);class Argument{constructor(e,s){this.description=s||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(e[0]){case"<":this.required=true;this._name=e.slice(1,-1);break;case"[":this.required=false;this._name=e.slice(1,-1);break;default:this.required=true;this._name=e;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(e,s){if(s===this.defaultValue||!Array.isArray(s)){return[e]}return s.concat(e)}default(e,s){this.defaultValue=e;this.defaultValueDescription=s;return this}argParser(e){this.parseArg=e;return this}choices(e){this.argChoices=e.slice();this.parseArg=(e,s)=>{if(!this.argChoices.includes(e)){throw new a(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(e,s)}return e};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(e){const s=e.name()+(e.variadic===true?"...":"");return e.required?"<"+s+">":"["+s+"]"}s.Argument=Argument;s.humanReadableArgName=humanReadableArgName},600:(e,s,o)=>{const a=o(474).EventEmitter;const l=o(421);const c=o(760);const D=o(24);const d=o(708);const{Argument:g,humanReadableArgName:y}=o(854);const{CommanderError:C}=o(851);const{Help:F,stripColor:_}=o(518);const{Option:w,DualOptions:A}=o(215);const{suggestSimilar:S}=o(266);class Command extends a{constructor(e){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=false;this.registeredArguments=[];this._args=this.registeredArguments;this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=e||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._summary="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._savedState=null;this._outputConfiguration={writeOut:e=>d.stdout.write(e),writeErr:e=>d.stderr.write(e),outputError:(e,s)=>s(e),getOutHelpWidth:()=>d.stdout.isTTY?d.stdout.columns:undefined,getErrHelpWidth:()=>d.stderr.isTTY?d.stderr.columns:undefined,getOutHasColors:()=>useColor()??(d.stdout.isTTY&&d.stdout.hasColors?.()),getErrHasColors:()=>useColor()??(d.stderr.isTTY&&d.stderr.hasColors?.()),stripColor:e=>_(e)};this._hidden=false;this._helpOption=undefined;this._addImplicitHelpCommand=undefined;this._helpCommand=undefined;this._helpConfiguration={}}copyInheritedSettings(e){this._outputConfiguration=e._outputConfiguration;this._helpOption=e._helpOption;this._helpCommand=e._helpCommand;this._helpConfiguration=e._helpConfiguration;this._exitCallback=e._exitCallback;this._storeOptionsAsProperties=e._storeOptionsAsProperties;this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue;this._allowExcessArguments=e._allowExcessArguments;this._enablePositionalOptions=e._enablePositionalOptions;this._showHelpAfterError=e._showHelpAfterError;this._showSuggestionAfterError=e._showSuggestionAfterError;return this}_getCommandAndAncestors(){const e=[];for(let s=this;s;s=s.parent){e.push(s)}return e}command(e,s,o){let a=s;let l=o;if(typeof a==="object"&&a!==null){l=a;a=null}l=l||{};const[,c,D]=e.match(/([^ ]+) *(.*)/);const d=this.createCommand(c);if(a){d.description(a);d._executableHandler=true}if(l.isDefault)this._defaultCommandName=d._name;d._hidden=!!(l.noHelp||l.hidden);d._executableFile=l.executableFile||null;if(D)d.arguments(D);this._registerCommand(d);d.parent=this;d.copyInheritedSettings(this);if(a)return this;return d}createCommand(e){return new Command(e)}createHelp(){return Object.assign(new F,this.configureHelp())}configureHelp(e){if(e===undefined)return this._helpConfiguration;this._helpConfiguration=e;return this}configureOutput(e){if(e===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,e);return this}showHelpAfterError(e=true){if(typeof e!=="string")e=!!e;this._showHelpAfterError=e;return this}showSuggestionAfterError(e=true){this._showSuggestionAfterError=!!e;return this}addCommand(e,s){if(!e._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}s=s||{};if(s.isDefault)this._defaultCommandName=e._name;if(s.noHelp||s.hidden)e._hidden=true;this._registerCommand(e);e.parent=this;e._checkForBrokenPassThrough();return this}createArgument(e,s){return new g(e,s)}argument(e,s,o,a){const l=this.createArgument(e,s);if(typeof o==="function"){l.default(a).argParser(o)}else{l.default(o)}this.addArgument(l);return this}arguments(e){e.trim().split(/ +/).forEach((e=>{this.argument(e)}));return this}addArgument(e){const s=this.registeredArguments.slice(-1)[0];if(s&&s.variadic){throw new Error(`only the last argument can be variadic '${s.name()}'`)}if(e.required&&e.defaultValue!==undefined&&e.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${e.name()}'`)}this.registeredArguments.push(e);return this}helpCommand(e,s){if(typeof e==="boolean"){this._addImplicitHelpCommand=e;return this}e=e??"help [command]";const[,o,a]=e.match(/([^ ]+) *(.*)/);const l=s??"display help for command";const c=this.createCommand(o);c.helpOption(false);if(a)c.arguments(a);if(l)c.description(l);this._addImplicitHelpCommand=true;this._helpCommand=c;return this}addHelpCommand(e,s){if(typeof e!=="object"){this.helpCommand(e,s);return this}this._addImplicitHelpCommand=true;this._helpCommand=e;return this}_getHelpCommand(){const e=this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"));if(e){if(this._helpCommand===undefined){this.helpCommand(undefined,undefined)}return this._helpCommand}return null}hook(e,s){const o=["preSubcommand","preAction","postAction"];if(!o.includes(e)){throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${o.join("', '")}'`)}if(this._lifeCycleHooks[e]){this._lifeCycleHooks[e].push(s)}else{this._lifeCycleHooks[e]=[s]}return this}exitOverride(e){if(e){this._exitCallback=e}else{this._exitCallback=e=>{if(e.code!=="commander.executeSubCommandAsync"){throw e}else{}}}return this}_exit(e,s,o){if(this._exitCallback){this._exitCallback(new C(e,s,o))}d.exit(e)}action(e){const listener=s=>{const o=this.registeredArguments.length;const a=s.slice(0,o);if(this._storeOptionsAsProperties){a[o]=this}else{a[o]=this.opts()}a.push(this);return e.apply(this,a)};this._actionHandler=listener;return this}createOption(e,s){return new w(e,s)}_callParseArg(e,s,o,a){try{return e.parseArg(s,o)}catch(e){if(e.code==="commander.invalidArgument"){const s=`${a} ${e.message}`;this.error(s,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){const s=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(s){const o=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'\n- already used by option '${s.flags}'`)}this.options.push(e)}_registerCommand(e){const knownBy=e=>[e.name()].concat(e.aliases());const s=knownBy(e).find((e=>this._findCommand(e)));if(s){const o=knownBy(this._findCommand(s)).join("|");const a=knownBy(e).join("|");throw new Error(`cannot add command '${a}' as already have command '${o}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);const s=e.name();const o=e.attributeName();if(e.negate){const s=e.long.replace(/^--no-/,"--");if(!this._findOption(s)){this.setOptionValueWithSource(o,e.defaultValue===undefined?true:e.defaultValue,"default")}}else if(e.defaultValue!==undefined){this.setOptionValueWithSource(o,e.defaultValue,"default")}const handleOptionValue=(s,a,l)=>{if(s==null&&e.presetArg!==undefined){s=e.presetArg}const c=this.getOptionValue(o);if(s!==null&&e.parseArg){s=this._callParseArg(e,s,c,a)}else if(s!==null&&e.variadic){s=e._concatValue(s,c)}if(s==null){if(e.negate){s=false}else if(e.isBoolean()||e.optional){s=true}else{s=""}}this.setOptionValueWithSource(o,s,l)};this.on("option:"+s,(s=>{const o=`error: option '${e.flags}' argument '${s}' is invalid.`;handleOptionValue(s,o,"cli")}));if(e.envVar){this.on("optionEnv:"+s,(s=>{const o=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;handleOptionValue(s,o,"env")}))}return this}_optionEx(e,s,o,a,l){if(typeof s==="object"&&s instanceof w){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const c=this.createOption(s,o);c.makeOptionMandatory(!!e.mandatory);if(typeof a==="function"){c.default(l).argParser(a)}else if(a instanceof RegExp){const e=a;a=(s,o)=>{const a=e.exec(s);return a?a[0]:o};c.default(l).argParser(a)}else{c.default(a)}return this.addOption(c)}option(e,s,o,a){return this._optionEx({},e,s,o,a)}requiredOption(e,s,o,a){return this._optionEx({mandatory:true},e,s,o,a)}combineFlagAndOptionalValue(e=true){this._combineFlagAndOptionalValue=!!e;return this}allowUnknownOption(e=true){this._allowUnknownOption=!!e;return this}allowExcessArguments(e=true){this._allowExcessArguments=!!e;return this}enablePositionalOptions(e=true){this._enablePositionalOptions=!!e;return this}passThroughOptions(e=true){this._passThroughOptions=!!e;this._checkForBrokenPassThrough();return this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions){throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}}storeOptionsAsProperties(e=true){if(this.options.length){throw new Error("call .storeOptionsAsProperties() before adding options")}if(Object.keys(this._optionValues).length){throw new Error("call .storeOptionsAsProperties() before setting option values")}this._storeOptionsAsProperties=!!e;return this}getOptionValue(e){if(this._storeOptionsAsProperties){return this[e]}return this._optionValues[e]}setOptionValue(e,s){return this.setOptionValueWithSource(e,s,undefined)}setOptionValueWithSource(e,s,o){if(this._storeOptionsAsProperties){this[e]=s}else{this._optionValues[e]=s}this._optionValueSources[e]=o;return this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let s;this._getCommandAndAncestors().forEach((o=>{if(o.getOptionValueSource(e)!==undefined){s=o.getOptionValueSource(e)}}));return s}_prepareUserArgs(e,s){if(e!==undefined&&!Array.isArray(e)){throw new Error("first parameter to parse must be array or undefined")}s=s||{};if(e===undefined&&s.from===undefined){if(d.versions?.electron){s.from="electron"}const e=d.execArgv??[];if(e.includes("-e")||e.includes("--eval")||e.includes("-p")||e.includes("--print")){s.from="eval"}}if(e===undefined){e=d.argv}this.rawArgs=e.slice();let o;switch(s.from){case undefined:case"node":this._scriptPath=e[1];o=e.slice(2);break;case"electron":if(d.defaultApp){this._scriptPath=e[1];o=e.slice(2)}else{o=e.slice(1)}break;case"user":o=e.slice(0);break;case"eval":o=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${s.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return o}parse(e,s){this._prepareForParse();const o=this._prepareUserArgs(e,s);this._parseCommand([],o);return this}async parseAsync(e,s){this._prepareForParse();const o=this._prepareUserArgs(e,s);await this._parseCommand([],o);return this}_prepareForParse(){if(this._savedState===null){this.saveStateBeforeParse()}else{this.restoreStateBeforeParse()}}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.\n- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name;this._scriptPath=null;this.rawArgs=[];this._optionValues={...this._savedState._optionValues};this._optionValueSources={...this._savedState._optionValueSources};this.args=[];this.processedArgs=[]}_checkForMissingExecutable(e,s,o){if(D.existsSync(e))return;const a=s?`searched for local subcommand relative to directory '${s}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const l=`'${e}' does not exist\n - if '${o}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${a}`;throw new Error(l)}_executeSubCommand(e,s){s=s.slice();let o=false;const a=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(e,s){const o=c.resolve(e,s);if(D.existsSync(o))return o;if(a.includes(c.extname(s)))return undefined;const l=a.find((e=>D.existsSync(`${o}${e}`)));if(l)return`${o}${l}`;return undefined}this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();let g=e._executableFile||`${this._name}-${e._name}`;let y=this._executableDir||"";if(this._scriptPath){let e;try{e=D.realpathSync(this._scriptPath)}catch{e=this._scriptPath}y=c.resolve(c.dirname(e),y)}if(y){let s=findFile(y,g);if(!s&&!e._executableFile&&this._scriptPath){const o=c.basename(this._scriptPath,c.extname(this._scriptPath));if(o!==this._name){s=findFile(y,`${o}-${e._name}`)}}g=s||g}o=a.includes(c.extname(g));let F;if(d.platform!=="win32"){if(o){s.unshift(g);s=incrementNodeInspectorPort(d.execArgv).concat(s);F=l.spawn(d.argv[0],s,{stdio:"inherit"})}else{F=l.spawn(g,s,{stdio:"inherit"})}}else{this._checkForMissingExecutable(g,y,e._name);s.unshift(g);s=incrementNodeInspectorPort(d.execArgv).concat(s);F=l.spawn(d.execPath,s,{stdio:"inherit"})}if(!F.killed){const e=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];e.forEach((e=>{d.on(e,(()=>{if(F.killed===false&&F.exitCode===null){F.kill(e)}}))}))}const _=this._exitCallback;F.on("close",(e=>{e=e??1;if(!_){d.exit(e)}else{_(new C(e,"commander.executeSubCommandAsync","(close)"))}}));F.on("error",(s=>{if(s.code==="ENOENT"){this._checkForMissingExecutable(g,y,e._name)}else if(s.code==="EACCES"){throw new Error(`'${g}' not executable`)}if(!_){d.exit(1)}else{const e=new C(1,"commander.executeSubCommandAsync","(error)");e.nestedError=s;_(e)}}));this.runningCommand=F}_dispatchSubcommand(e,s,o){const a=this._findCommand(e);if(!a)this.help({error:true});a._prepareForParse();let l;l=this._chainOrCallSubCommandHook(l,a,"preSubcommand");l=this._chainOrCall(l,(()=>{if(a._executableHandler){this._executeSubCommand(a,s.concat(o))}else{return a._parseCommand(s,o)}}));return l}_dispatchHelpCommand(e){if(!e){this.help()}const s=this._findCommand(e);if(s&&!s._executableHandler){s.help()}return this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach(((e,s)=>{if(e.required&&this.args[s]==null){this.missingArgument(e.name())}}));if(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic){return}if(this.args.length>this.registeredArguments.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(e,s,o)=>{let a=s;if(s!==null&&e.parseArg){const l=`error: command-argument value '${s}' is invalid for argument '${e.name()}'.`;a=this._callParseArg(e,s,o,l)}return a};this._checkNumberOfArguments();const e=[];this.registeredArguments.forEach(((s,o)=>{let a=s.defaultValue;if(s.variadic){if(o<this.args.length){a=this.args.slice(o);if(s.parseArg){a=a.reduce(((e,o)=>myParseArg(s,o,e)),s.defaultValue)}}else if(a===undefined){a=[]}}else if(o<this.args.length){a=this.args[o];if(s.parseArg){a=myParseArg(s,a,s.defaultValue)}}e[o]=a}));this.processedArgs=e}_chainOrCall(e,s){if(e&&e.then&&typeof e.then==="function"){return e.then((()=>s()))}return s()}_chainOrCallHooks(e,s){let o=e;const a=[];this._getCommandAndAncestors().reverse().filter((e=>e._lifeCycleHooks[s]!==undefined)).forEach((e=>{e._lifeCycleHooks[s].forEach((s=>{a.push({hookedCommand:e,callback:s})}))}));if(s==="postAction"){a.reverse()}a.forEach((e=>{o=this._chainOrCall(o,(()=>e.callback(e.hookedCommand,this)))}));return o}_chainOrCallSubCommandHook(e,s,o){let a=e;if(this._lifeCycleHooks[o]!==undefined){this._lifeCycleHooks[o].forEach((e=>{a=this._chainOrCall(a,(()=>e(this,s)))}))}return a}_parseCommand(e,s){const o=this.parseOptions(s);this._parseOptionsEnv();this._parseOptionsImplied();e=e.concat(o.operands);s=o.unknown;this.args=e.concat(s);if(e&&this._findCommand(e[0])){return this._dispatchSubcommand(e[0],e.slice(1),s)}if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name()){return this._dispatchHelpCommand(e[1])}if(this._defaultCommandName){this._outputHelpIfRequested(s);return this._dispatchSubcommand(this._defaultCommandName,e,s)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}this._outputHelpIfRequested(o.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(o.unknown.length>0){this.unknownOption(o.unknown[0])}};const a=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let o;o=this._chainOrCallHooks(o,"preAction");o=this._chainOrCall(o,(()=>this._actionHandler(this.processedArgs)));if(this.parent){o=this._chainOrCall(o,(()=>{this.parent.emit(a,e,s)}))}o=this._chainOrCallHooks(o,"postAction");return o}if(this.parent&&this.parent.listenerCount(a)){checkForUnknownOptions();this._processArguments();this.parent.emit(a,e,s)}else if(e.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",e,s)}if(this.listenerCount("command:*")){this.emit("command:*",e,s)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(e){if(!e)return undefined;return this.commands.find((s=>s._name===e||s._aliases.includes(e)))}_findOption(e){return this.options.find((s=>s.is(e)))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((e=>{e.options.forEach((s=>{if(s.mandatory&&e.getOptionValue(s.attributeName())===undefined){e.missingMandatoryOptionValue(s)}}))}))}_checkForConflictingLocalOptions(){const e=this.options.filter((e=>{const s=e.attributeName();if(this.getOptionValue(s)===undefined){return false}return this.getOptionValueSource(s)!=="default"}));const s=e.filter((e=>e.conflictsWith.length>0));s.forEach((s=>{const o=e.find((e=>s.conflictsWith.includes(e.attributeName())));if(o){this._conflictingOption(s,o)}}))}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((e=>{e._checkForConflictingLocalOptions()}))}parseOptions(e){const s=[];const o=[];let a=s;const l=e.slice();function maybeOption(e){return e.length>1&&e[0]==="-"}let c=null;while(l.length){const e=l.shift();if(e==="--"){if(a===o)a.push(e);a.push(...l);break}if(c&&!maybeOption(e)){this.emit(`option:${c.name()}`,e);continue}c=null;if(maybeOption(e)){const s=this._findOption(e);if(s){if(s.required){const e=l.shift();if(e===undefined)this.optionMissingArgument(s);this.emit(`option:${s.name()}`,e)}else if(s.optional){let e=null;if(l.length>0&&!maybeOption(l[0])){e=l.shift()}this.emit(`option:${s.name()}`,e)}else{this.emit(`option:${s.name()}`)}c=s.variadic?s:null;continue}}if(e.length>2&&e[0]==="-"&&e[1]!=="-"){const s=this._findOption(`-${e[1]}`);if(s){if(s.required||s.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${s.name()}`,e.slice(2))}else{this.emit(`option:${s.name()}`);l.unshift(`-${e.slice(2)}`)}continue}}if(/^--[^=]+=/.test(e)){const s=e.indexOf("=");const o=this._findOption(e.slice(0,s));if(o&&(o.required||o.optional)){this.emit(`option:${o.name()}`,e.slice(s+1));continue}}if(maybeOption(e)){a=o}if((this._enablePositionalOptions||this._passThroughOptions)&&s.length===0&&o.length===0){if(this._findCommand(e)){s.push(e);if(l.length>0)o.push(...l);break}else if(this._getHelpCommand()&&e===this._getHelpCommand().name()){s.push(e);if(l.length>0)s.push(...l);break}else if(this._defaultCommandName){o.push(e);if(l.length>0)o.push(...l);break}}if(this._passThroughOptions){a.push(e);if(l.length>0)a.push(...l);break}a.push(e)}return{operands:s,unknown:o}}opts(){if(this._storeOptionsAsProperties){const e={};const s=this.options.length;for(let o=0;o<s;o++){const s=this.options[o].attributeName();e[s]=s===this._versionOptionName?this._version:this[s]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(((e,s)=>Object.assign(e,s.opts())),{})}error(e,s){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const o=s||{};const a=o.exitCode||1;const l=o.code||"commander.error";this._exit(a,l,e)}_parseOptionsEnv(){this.options.forEach((e=>{if(e.envVar&&e.envVar in d.env){const s=e.attributeName();if(this.getOptionValue(s)===undefined||["default","config","env"].includes(this.getOptionValueSource(s))){if(e.required||e.optional){this.emit(`optionEnv:${e.name()}`,d.env[e.envVar])}else{this.emit(`optionEnv:${e.name()}`)}}}}))}_parseOptionsImplied(){const e=new A(this.options);const hasCustomOptionValue=e=>this.getOptionValue(e)!==undefined&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter((s=>s.implied!==undefined&&hasCustomOptionValue(s.attributeName())&&e.valueFromOption(this.getOptionValue(s.attributeName()),s))).forEach((e=>{Object.keys(e.implied).filter((e=>!hasCustomOptionValue(e))).forEach((s=>{this.setOptionValueWithSource(s,e.implied[s],"implied")}))}))}missingArgument(e){const s=`error: missing required argument '${e}'`;this.error(s,{code:"commander.missingArgument"})}optionMissingArgument(e){const s=`error: option '${e.flags}' argument missing`;this.error(s,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const s=`error: required option '${e.flags}' not specified`;this.error(s,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,s){const findBestOptionFromValue=e=>{const s=e.attributeName();const o=this.getOptionValue(s);const a=this.options.find((e=>e.negate&&s===e.attributeName()));const l=this.options.find((e=>!e.negate&&s===e.attributeName()));if(a&&(a.presetArg===undefined&&o===false||a.presetArg!==undefined&&o===a.presetArg)){return a}return l||e};const getErrorMessage=e=>{const s=findBestOptionFromValue(e);const o=s.attributeName();const a=this.getOptionValueSource(o);if(a==="env"){return`environment variable '${s.envVar}'`}return`option '${s.flags}'`};const o=`error: ${getErrorMessage(e)} cannot be used with ${getErrorMessage(s)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let s="";if(e.startsWith("--")&&this._showSuggestionAfterError){let o=[];let a=this;do{const e=a.createHelp().visibleOptions(a).filter((e=>e.long)).map((e=>e.long));o=o.concat(e);a=a.parent}while(a&&!a._enablePositionalOptions);s=S(e,o)}const o=`error: unknown option '${e}'${s}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const s=this.registeredArguments.length;const o=s===1?"":"s";const a=this.parent?` for '${this.name()}'`:"";const l=`error: too many arguments${a}. Expected ${s} argument${o} but got ${e.length}.`;this.error(l,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let s="";if(this._showSuggestionAfterError){const o=[];this.createHelp().visibleCommands(this).forEach((e=>{o.push(e.name());if(e.alias())o.push(e.alias())}));s=S(e,o)}const o=`error: unknown command '${e}'${s}`;this.error(o,{code:"commander.unknownCommand"})}version(e,s,o){if(e===undefined)return this._version;this._version=e;s=s||"-V, --version";o=o||"output the version number";const a=this.createOption(s,o);this._versionOptionName=a.attributeName();this._registerOption(a);this.on("option:"+a.name(),(()=>{this._outputConfiguration.writeOut(`${e}\n`);this._exit(0,"commander.version",e)}));return this}description(e,s){if(e===undefined&&s===undefined)return this._description;this._description=e;if(s){this._argsDescription=s}return this}summary(e){if(e===undefined)return this._summary;this._summary=e;return this}alias(e){if(e===undefined)return this._aliases[0];let s=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler){s=this.commands[this.commands.length-1]}if(e===s._name)throw new Error("Command alias can't be the same as its name");const o=this.parent?._findCommand(e);if(o){const s=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${s}'`)}s._aliases.push(e);return this}aliases(e){if(e===undefined)return this._aliases;e.forEach((e=>this.alias(e)));return this}usage(e){if(e===undefined){if(this._usage)return this._usage;const e=this.registeredArguments.map((e=>y(e)));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}this._usage=e;return this}name(e){if(e===undefined)return this._name;this._name=e;return this}nameFromFilename(e){this._name=c.basename(e,c.extname(e));return this}executableDir(e){if(e===undefined)return this._executableDir;this._executableDir=e;return this}helpInformation(e){const s=this.createHelp();const o=this._getOutputContext(e);s.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});const a=s.formatHelp(this,s);if(o.hasColors)return a;return this._outputConfiguration.stripColor(a)}_getOutputContext(e){e=e||{};const s=!!e.error;let o;let a;let l;if(s){o=e=>this._outputConfiguration.writeErr(e);a=this._outputConfiguration.getErrHasColors();l=this._outputConfiguration.getErrHelpWidth()}else{o=e=>this._outputConfiguration.writeOut(e);a=this._outputConfiguration.getOutHasColors();l=this._outputConfiguration.getOutHelpWidth()}const write=e=>{if(!a)e=this._outputConfiguration.stripColor(e);return o(e)};return{error:s,write:write,hasColors:a,helpWidth:l}}outputHelp(e){let s;if(typeof e==="function"){s=e;e=undefined}const o=this._getOutputContext(e);const a={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach((e=>e.emit("beforeAllHelp",a)));this.emit("beforeHelp",a);let l=this.helpInformation({error:o.error});if(s){l=s(l);if(typeof l!=="string"&&!Buffer.isBuffer(l)){throw new Error("outputHelp callback must return a string or a Buffer")}}o.write(l);if(this._getHelpOption()?.long){this.emit(this._getHelpOption().long)}this.emit("afterHelp",a);this._getCommandAndAncestors().forEach((e=>e.emit("afterAllHelp",a)))}helpOption(e,s){if(typeof e==="boolean"){if(e){this._helpOption=this._helpOption??undefined}else{this._helpOption=null}return this}e=e??"-h, --help";s=s??"display help for command";this._helpOption=this.createOption(e,s);return this}_getHelpOption(){if(this._helpOption===undefined){this.helpOption(undefined,undefined)}return this._helpOption}addHelpOption(e){this._helpOption=e;return this}help(e){this.outputHelp(e);let s=Number(d.exitCode??0);if(s===0&&e&&typeof e!=="function"&&e.error){s=1}this._exit(s,"commander.help","(outputHelp)")}addHelpText(e,s){const o=["beforeAll","before","after","afterAll"];if(!o.includes(e)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${o.join("', '")}'`)}const a=`${e}Help`;this.on(a,(e=>{let o;if(typeof s==="function"){o=s({error:e.error,command:e.command})}else{o=s}if(o){e.write(`${o}\n`)}}));return this}_outputHelpIfRequested(e){const s=this._getHelpOption();const o=s&&e.find((e=>s.is(e)));if(o){this.outputHelp();this._exit(0,"commander.helpDisplayed","(outputHelp)")}}}function incrementNodeInspectorPort(e){return e.map((e=>{if(!e.startsWith("--inspect")){return e}let s;let o="127.0.0.1";let a="9229";let l;if((l=e.match(/^(--inspect(-brk)?)$/))!==null){s=l[1]}else if((l=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){s=l[1];if(/^\d+$/.test(l[3])){a=l[3]}else{o=l[3]}}else if((l=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){s=l[1];o=l[3];a=l[4]}if(s&&a!=="0"){return`${s}=${o}:${parseInt(a)+1}`}return e}))}function useColor(){if(d.env.NO_COLOR||d.env.FORCE_COLOR==="0"||d.env.FORCE_COLOR==="false")return false;if(d.env.FORCE_COLOR||d.env.CLICOLOR_FORCE!==undefined)return true;return undefined}s.Command=Command;s.useColor=useColor},851:(e,s)=>{class CommanderError extends Error{constructor(e,s,o){super(o);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=s;this.exitCode=e;this.nestedError=undefined}}class InvalidArgumentError extends CommanderError{constructor(e){super(1,"commander.invalidArgument",e);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}s.CommanderError=CommanderError;s.InvalidArgumentError=InvalidArgumentError},518:(e,s,o)=>{const{humanReadableArgName:a}=o(854);class Help{constructor(){this.helpWidth=undefined;this.minWidthToWrap=40;this.sortSubcommands=false;this.sortOptions=false;this.showGlobalOptions=false}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){const s=e.commands.filter((e=>!e._hidden));const o=e._getHelpCommand();if(o&&!o._hidden){s.push(o)}if(this.sortSubcommands){s.sort(((e,s)=>e.name().localeCompare(s.name())))}return s}compareOptions(e,s){const getSortKey=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return getSortKey(e).localeCompare(getSortKey(s))}visibleOptions(e){const s=e.options.filter((e=>!e.hidden));const o=e._getHelpOption();if(o&&!o.hidden){const a=o.short&&e._findOption(o.short);const l=o.long&&e._findOption(o.long);if(!a&&!l){s.push(o)}else if(o.long&&!l){s.push(e.createOption(o.long,o.description))}else if(o.short&&!a){s.push(e.createOption(o.short,o.description))}}if(this.sortOptions){s.sort(this.compareOptions)}return s}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const s=[];for(let o=e.parent;o;o=o.parent){const e=o.options.filter((e=>!e.hidden));s.push(...e)}if(this.sortOptions){s.sort(this.compareOptions)}return s}visibleArguments(e){if(e._argsDescription){e.registeredArguments.forEach((s=>{s.description=s.description||e._argsDescription[s.name()]||""}))}if(e.registeredArguments.find((e=>e.description))){return e.registeredArguments}return[]}subcommandTerm(e){const s=e.registeredArguments.map((e=>a(e))).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(s?" "+s:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,s){return s.visibleCommands(e).reduce(((e,o)=>Math.max(e,this.displayWidth(s.styleSubcommandTerm(s.subcommandTerm(o))))),0)}longestOptionTermLength(e,s){return s.visibleOptions(e).reduce(((e,o)=>Math.max(e,this.displayWidth(s.styleOptionTerm(s.optionTerm(o))))),0)}longestGlobalOptionTermLength(e,s){return s.visibleGlobalOptions(e).reduce(((e,o)=>Math.max(e,this.displayWidth(s.styleOptionTerm(s.optionTerm(o))))),0)}longestArgumentTermLength(e,s){return s.visibleArguments(e).reduce(((e,o)=>Math.max(e,this.displayWidth(s.styleArgumentTerm(s.argumentTerm(o))))),0)}commandUsage(e){let s=e._name;if(e._aliases[0]){s=s+"|"+e._aliases[0]}let o="";for(let s=e.parent;s;s=s.parent){o=s.name()+" "+o}return o+s+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const s=[];if(e.argChoices){s.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`)}if(e.defaultValue!==undefined){const o=e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==="boolean";if(o){s.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}}if(e.presetArg!==undefined&&e.optional){s.push(`preset: ${JSON.stringify(e.presetArg)}`)}if(e.envVar!==undefined){s.push(`env: ${e.envVar}`)}if(s.length>0){return`${e.description} (${s.join(", ")})`}return e.description}argumentDescription(e){const s=[];if(e.argChoices){s.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`)}if(e.defaultValue!==undefined){s.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}if(s.length>0){const o=`(${s.join(", ")})`;if(e.description){return`${e.description} ${o}`}return o}return e.description}formatHelp(e,s){const o=s.padWidth(e,s);const a=s.helpWidth??80;function callFormatItem(e,a){return s.formatItem(e,o,a,s)}let l=[`${s.styleTitle("Usage:")} ${s.styleUsage(s.commandUsage(e))}`,""];const c=s.commandDescription(e);if(c.length>0){l=l.concat([s.boxWrap(s.styleCommandDescription(c),a),""])}const D=s.visibleArguments(e).map((e=>callFormatItem(s.styleArgumentTerm(s.argumentTerm(e)),s.styleArgumentDescription(s.argumentDescription(e)))));if(D.length>0){l=l.concat([s.styleTitle("Arguments:"),...D,""])}const d=s.visibleOptions(e).map((e=>callFormatItem(s.styleOptionTerm(s.optionTerm(e)),s.styleOptionDescription(s.optionDescription(e)))));if(d.length>0){l=l.concat([s.styleTitle("Options:"),...d,""])}if(s.showGlobalOptions){const o=s.visibleGlobalOptions(e).map((e=>callFormatItem(s.styleOptionTerm(s.optionTerm(e)),s.styleOptionDescription(s.optionDescription(e)))));if(o.length>0){l=l.concat([s.styleTitle("Global Options:"),...o,""])}}const g=s.visibleCommands(e).map((e=>callFormatItem(s.styleSubcommandTerm(s.subcommandTerm(e)),s.styleSubcommandDescription(s.subcommandDescription(e)))));if(g.length>0){l=l.concat([s.styleTitle("Commands:"),...g,""])}return l.join("\n")}displayWidth(e){return stripColor(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map((e=>{if(e==="[options]")return this.styleOptionText(e);if(e==="[command]")return this.styleSubcommandText(e);if(e[0]==="["||e[0]==="<")return this.styleArgumentText(e);return this.styleCommandText(e)})).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map((e=>{if(e==="[options]")return this.styleOptionText(e);if(e[0]==="["||e[0]==="<")return this.styleArgumentText(e);return this.styleSubcommandText(e)})).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,s){return Math.max(s.longestOptionTermLength(e,s),s.longestGlobalOptionTermLength(e,s),s.longestSubcommandTermLength(e,s),s.longestArgumentTermLength(e,s))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,s,o,a){const l=2;const c=" ".repeat(l);if(!o)return c+e;const D=e.padEnd(s+e.length-a.displayWidth(e));const d=2;const g=this.helpWidth??80;const y=g-s-d-l;let C;if(y<this.minWidthToWrap||a.preformatted(o)){C=o}else{const e=a.boxWrap(o,y);C=e.replace(/\n/g,"\n"+" ".repeat(s+d))}return c+D+" ".repeat(d)+C.replace(/\n/g,`\n${c}`)}boxWrap(e,s){if(s<this.minWidthToWrap)return e;const o=e.split(/\r\n|\n/);const a=/[\s]*[^\s]+/g;const l=[];o.forEach((e=>{const o=e.match(a);if(o===null){l.push("");return}let c=[o.shift()];let D=this.displayWidth(c[0]);o.forEach((e=>{const o=this.displayWidth(e);if(D+o<=s){c.push(e);D+=o;return}l.push(c.join(""));const a=e.trimStart();c=[a];D=this.displayWidth(a)}));l.push(c.join(""))}));return l.join("\n")}}function stripColor(e){const s=/\x1b\[\d*(;\d*)*m/g;return e.replace(s,"")}s.Help=Help;s.stripColor=stripColor},215:(e,s,o)=>{const{InvalidArgumentError:a}=o(851);class Option{constructor(e,s){this.flags=e;this.description=s||"";this.required=e.includes("<");this.optional=e.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(e);this.mandatory=false;const o=splitOptionFlags(e);this.short=o.shortFlag;this.long=o.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[];this.implied=undefined}default(e,s){this.defaultValue=e;this.defaultValueDescription=s;return this}preset(e){this.presetArg=e;return this}conflicts(e){this.conflictsWith=this.conflictsWith.concat(e);return this}implies(e){let s=e;if(typeof e==="string"){s={[e]:true}}this.implied=Object.assign(this.implied||{},s);return this}env(e){this.envVar=e;return this}argParser(e){this.parseArg=e;return this}makeOptionMandatory(e=true){this.mandatory=!!e;return this}hideHelp(e=true){this.hidden=!!e;return this}_concatValue(e,s){if(s===this.defaultValue||!Array.isArray(s)){return[e]}return s.concat(e)}choices(e){this.argChoices=e.slice();this.parseArg=(e,s)=>{if(!this.argChoices.includes(e)){throw new a(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(e,s)}return e};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){if(this.negate){return camelcase(this.name().replace(/^no-/,""))}return camelcase(this.name())}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class DualOptions{constructor(e){this.positiveOptions=new Map;this.negativeOptions=new Map;this.dualOptions=new Set;e.forEach((e=>{if(e.negate){this.negativeOptions.set(e.attributeName(),e)}else{this.positiveOptions.set(e.attributeName(),e)}}));this.negativeOptions.forEach(((e,s)=>{if(this.positiveOptions.has(s)){this.dualOptions.add(s)}}))}valueFromOption(e,s){const o=s.attributeName();if(!this.dualOptions.has(o))return true;const a=this.negativeOptions.get(o).presetArg;const l=a!==undefined?a:false;return s.negate===(l===e)}}function camelcase(e){return e.split("-").reduce(((e,s)=>e+s[0].toUpperCase()+s.slice(1)))}function splitOptionFlags(e){let s;let o;const a=/^-[^-]$/;const l=/^--[^-]/;const c=e.split(/[ |,]+/).concat("guard");if(a.test(c[0]))s=c.shift();if(l.test(c[0]))o=c.shift();if(!s&&a.test(c[0]))s=c.shift();if(!s&&l.test(c[0])){s=o;o=c.shift()}if(c[0].startsWith("-")){const s=c[0];const o=`option creation failed due to '${s}' in option flags '${e}'`;if(/^-[^-][^-]/.test(s))throw new Error(`${o}\n- a short flag is a single dash and a single character\n - either use a single dash and a single character (for a short flag)\n - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(a.test(s))throw new Error(`${o}\n- too many short flags`);if(l.test(s))throw new Error(`${o}\n- too many long flags`);throw new Error(`${o}\n- unrecognised flag format`)}if(s===undefined&&o===undefined)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:s,longFlag:o}}s.Option=Option;s.DualOptions=DualOptions},266:(e,s)=>{const o=3;function editDistance(e,s){if(Math.abs(e.length-s.length)>o)return Math.max(e.length,s.length);const a=[];for(let s=0;s<=e.length;s++){a[s]=[s]}for(let e=0;e<=s.length;e++){a[0][e]=e}for(let o=1;o<=s.length;o++){for(let l=1;l<=e.length;l++){let c=1;if(e[l-1]===s[o-1]){c=0}else{c=1}a[l][o]=Math.min(a[l-1][o]+1,a[l][o-1]+1,a[l-1][o-1]+c);if(l>1&&o>1&&e[l-1]===s[o-2]&&e[l-2]===s[o-1]){a[l][o]=Math.min(a[l][o],a[l-2][o-2]+1)}}}return a[e.length][s.length]}function suggestSimilar(e,s){if(!s||s.length===0)return"";s=Array.from(new Set(s));const a=e.startsWith("--");if(a){e=e.slice(2);s=s.map((e=>e.slice(2)))}let l=[];let c=o;const D=.4;s.forEach((s=>{if(s.length<=1)return;const o=editDistance(e,s);const a=Math.max(e.length,s.length);const d=(a-o)/a;if(d>D){if(o<c){c=o;l=[s]}else if(o===c){l.push(s)}}}));l.sort(((e,s)=>e.localeCompare(s)));if(a){l=l.map((e=>`--${e}`))}if(l.length>1){return`\n(Did you mean one of ${l.join(", ")}?)`}if(l.length===1){return`\n(Did you mean ${l[0]}?)`}return""}s.suggestSimilar=suggestSimilar}};var o={};function __nccwpck_require__(e){var a=o[e];if(a!==undefined){return a.exports}var l=o[e]={exports:{}};var c=true;try{s[e](l,l.exports,__nccwpck_require__);c=false}finally{if(c)delete o[e]}return l.exports}(()=>{__nccwpck_require__.n=e=>{var s=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(s,{a:s});return s}})();(()=>{var e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;var s;__nccwpck_require__.t=function(o,a){if(a&1)o=this(o);if(a&8)return o;if(typeof o==="object"&&o){if(a&4&&o.__esModule)return o;if(a&16&&typeof o.then==="function")return o}var l=Object.create(null);__nccwpck_require__.r(l);var c={};s=s||[null,e({}),e([]),e(e)];for(var D=a&2&&o;typeof D=="object"&&!~s.indexOf(D);D=e(D)){Object.getOwnPropertyNames(D).forEach((e=>c[e]=()=>o[e]))}c["default"]=()=>o;__nccwpck_require__.d(l,c);return l}})();(()=>{__nccwpck_require__.d=(e,s)=>{for(var o in s){if(__nccwpck_require__.o(s,o)&&!__nccwpck_require__.o(e,o)){Object.defineProperty(e,o,{enumerable:true,get:s[o]})}}}})();(()=>{__nccwpck_require__.o=(e,s)=>Object.prototype.hasOwnProperty.call(e,s)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var a={};(()=>{"use strict";const s=require("fs/promises");var o=__nccwpck_require__.n(s);const a=require("node:util");var l=__nccwpck_require__(798);var c=__nccwpck_require__(708);const D=require("node:readline");const d=require("node:stream");var g=__nccwpck_require__(596);var y=__nccwpck_require__.n(g);function DD({onlyFirst:e=!1}={}){const s=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(s,e?void 0:"g")}const C=DD();function P(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(C,"")}function L(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var F={exports:{}};(function(e){var s={};e.exports=s,s.eastAsianWidth=function(e){var s=e.charCodeAt(0),o=e.length==2?e.charCodeAt(1):0,a=s;return 55296<=s&&s<=56319&&56320<=o&&o<=57343&&(s&=1023,o&=1023,a=s<<10|o,a+=65536),a==12288||65281<=a&&a<=65376||65504<=a&&a<=65510?"F":a==8361||65377<=a&&a<=65470||65474<=a&&a<=65479||65482<=a&&a<=65487||65490<=a&&a<=65495||65498<=a&&a<=65500||65512<=a&&a<=65518?"H":4352<=a&&a<=4447||4515<=a&&a<=4519||4602<=a&&a<=4607||9001<=a&&a<=9002||11904<=a&&a<=11929||11931<=a&&a<=12019||12032<=a&&a<=12245||12272<=a&&a<=12283||12289<=a&&a<=12350||12353<=a&&a<=12438||12441<=a&&a<=12543||12549<=a&&a<=12589||12593<=a&&a<=12686||12688<=a&&a<=12730||12736<=a&&a<=12771||12784<=a&&a<=12830||12832<=a&&a<=12871||12880<=a&&a<=13054||13056<=a&&a<=19903||19968<=a&&a<=42124||42128<=a&&a<=42182||43360<=a&&a<=43388||44032<=a&&a<=55203||55216<=a&&a<=55238||55243<=a&&a<=55291||63744<=a&&a<=64255||65040<=a&&a<=65049||65072<=a&&a<=65106||65108<=a&&a<=65126||65128<=a&&a<=65131||110592<=a&&a<=110593||127488<=a&&a<=127490||127504<=a&&a<=127546||127552<=a&&a<=127560||127568<=a&&a<=127569||131072<=a&&a<=194367||177984<=a&&a<=196605||196608<=a&&a<=262141?"W":32<=a&&a<=126||162<=a&&a<=163||165<=a&&a<=166||a==172||a==175||10214<=a&&a<=10221||10629<=a&&a<=10630?"Na":a==161||a==164||167<=a&&a<=168||a==170||173<=a&&a<=174||176<=a&&a<=180||182<=a&&a<=186||188<=a&&a<=191||a==198||a==208||215<=a&&a<=216||222<=a&&a<=225||a==230||232<=a&&a<=234||236<=a&&a<=237||a==240||242<=a&&a<=243||247<=a&&a<=250||a==252||a==254||a==257||a==273||a==275||a==283||294<=a&&a<=295||a==299||305<=a&&a<=307||a==312||319<=a&&a<=322||a==324||328<=a&&a<=331||a==333||338<=a&&a<=339||358<=a&&a<=359||a==363||a==462||a==464||a==466||a==468||a==470||a==472||a==474||a==476||a==593||a==609||a==708||a==711||713<=a&&a<=715||a==717||a==720||728<=a&&a<=731||a==733||a==735||768<=a&&a<=879||913<=a&&a<=929||931<=a&&a<=937||945<=a&&a<=961||963<=a&&a<=969||a==1025||1040<=a&&a<=1103||a==1105||a==8208||8211<=a&&a<=8214||8216<=a&&a<=8217||8220<=a&&a<=8221||8224<=a&&a<=8226||8228<=a&&a<=8231||a==8240||8242<=a&&a<=8243||a==8245||a==8251||a==8254||a==8308||a==8319||8321<=a&&a<=8324||a==8364||a==8451||a==8453||a==8457||a==8467||a==8470||8481<=a&&a<=8482||a==8486||a==8491||8531<=a&&a<=8532||8539<=a&&a<=8542||8544<=a&&a<=8555||8560<=a&&a<=8569||a==8585||8592<=a&&a<=8601||8632<=a&&a<=8633||a==8658||a==8660||a==8679||a==8704||8706<=a&&a<=8707||8711<=a&&a<=8712||a==8715||a==8719||a==8721||a==8725||a==8730||8733<=a&&a<=8736||a==8739||a==8741||8743<=a&&a<=8748||a==8750||8756<=a&&a<=8759||8764<=a&&a<=8765||a==8776||a==8780||a==8786||8800<=a&&a<=8801||8804<=a&&a<=8807||8810<=a&&a<=8811||8814<=a&&a<=8815||8834<=a&&a<=8835||8838<=a&&a<=8839||a==8853||a==8857||a==8869||a==8895||a==8978||9312<=a&&a<=9449||9451<=a&&a<=9547||9552<=a&&a<=9587||9600<=a&&a<=9615||9618<=a&&a<=9621||9632<=a&&a<=9633||9635<=a&&a<=9641||9650<=a&&a<=9651||9654<=a&&a<=9655||9660<=a&&a<=9661||9664<=a&&a<=9665||9670<=a&&a<=9672||a==9675||9678<=a&&a<=9681||9698<=a&&a<=9701||a==9711||9733<=a&&a<=9734||a==9737||9742<=a&&a<=9743||9748<=a&&a<=9749||a==9756||a==9758||a==9792||a==9794||9824<=a&&a<=9825||9827<=a&&a<=9829||9831<=a&&a<=9834||9836<=a&&a<=9837||a==9839||9886<=a&&a<=9887||9918<=a&&a<=9919||9924<=a&&a<=9933||9935<=a&&a<=9953||a==9955||9960<=a&&a<=9983||a==10045||a==10071||10102<=a&&a<=10111||11093<=a&&a<=11097||12872<=a&&a<=12879||57344<=a&&a<=63743||65024<=a&&a<=65039||a==65533||127232<=a&&a<=127242||127248<=a&&a<=127277||127280<=a&&a<=127337||127344<=a&&a<=127386||917760<=a&&a<=917999||983040<=a&&a<=1048573||1048576<=a&&a<=1114109?"A":"N"},s.characterLength=function(e){var s=this.eastAsianWidth(e);return s=="F"||s=="W"||s=="A"?2:1};function t(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}s.length=function(e){for(var s=t(e),o=0,a=0;a<s.length;a++)o=o+this.characterLength(s[a]);return o},s.slice=function(e,o,a){textLen=s.length(e),o=o||0,a=a||1,o<0&&(o=textLen+o),a<0&&(a=textLen+a);for(var l="",c=0,D=t(e),d=0;d<D.length;d++){var g=D[d],y=s.length(g);if(c>=o-(y==2?1:0))if(c+y<=a)l+=g;else break;c+=y}return l}})(F);var _=F.exports;const w=L(_);var FD=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\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\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\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\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])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\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};const A=L(FD);function p(e,s={}){if(typeof e!="string"||e.length===0||(s={ambiguousIsNarrow:!0,...s},e=P(e),e.length===0))return 0;e=e.replace(A()," ");const o=s.ambiguousIsNarrow?1:2;let a=0;for(const s of e){const e=s.codePointAt(0);if(e<=31||e>=127&&e<=159||e>=768&&e<=879)continue;switch(w.eastAsianWidth(s)){case"F":case"W":a+=2;break;case"A":a+=o;break;default:a+=1}}return a}const M=10,N=(e=0)=>s=>`[${s+e}m`,I=(e=0)=>s=>`[${38+e};5;${s}m`,R=(e=0)=>(s,o,a)=>`[${38+e};2;${s};${o};${a}m`,V={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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(V.modifier);const W=Object.keys(V.color),G=Object.keys(V.bgColor);[...W,...G];function CD(){const e=new Map;for(const[s,o]of Object.entries(V)){for(const[s,a]of Object.entries(o))V[s]={open:`[${a[0]}m`,close:`[${a[1]}m`},o[s]=V[s],e.set(a[0],a[1]);Object.defineProperty(V,s,{value:o,enumerable:!1})}return Object.defineProperty(V,"codes",{value:e,enumerable:!1}),V.color.close="[39m",V.bgColor.close="[49m",V.color.ansi=N(),V.color.ansi256=I(),V.color.ansi16m=R(),V.bgColor.ansi=N(M),V.bgColor.ansi256=I(M),V.bgColor.ansi16m=R(M),Object.defineProperties(V,{rgbToAnsi256:{value:(e,s,o)=>e===s&&s===o?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(s/255*5)+Math.round(o/255*5),enumerable:!1},hexToRgb:{value:e=>{const s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!s)return[0,0,0];let[o]=s;o.length===3&&(o=[...o].map((e=>e+e)).join(""));const a=Number.parseInt(o,16);return[a>>16&255,a>>8&255,a&255]},enumerable:!1},hexToAnsi256:{value:e=>V.rgbToAnsi256(...V.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let s,o,a;if(e>=232)s=((e-232)*10+8)/255,o=s,a=s;else{e-=16;const l=e%36;s=Math.floor(e/36)/5,o=Math.floor(l/6)/5,a=l%6/5}const l=Math.max(s,o,a)*2;if(l===0)return 30;let c=30+(Math.round(a)<<2|Math.round(o)<<1|Math.round(s));return l===2&&(c+=60),c},enumerable:!1},rgbToAnsi:{value:(e,s,o)=>V.ansi256ToAnsi(V.rgbToAnsi256(e,s,o)),enumerable:!1},hexToAnsi:{value:e=>V.ansi256ToAnsi(V.hexToAnsi256(e)),enumerable:!1}}),V}const ee=CD(),ne=new Set(["",""]),oe=39,ue="",ae="[",le="]",De="m",de=`${le}8;;`,z=e=>`${ne.values().next().value}${ae}${e}${De}`,K=e=>`${ne.values().next().value}${de}${e}${ue}`,aD=e=>e.split(" ").map((e=>p(e))),k=(e,s,o)=>{const a=[...s];let l=!1,c=!1,D=p(P(e[e.length-1]));for(const[s,d]of a.entries()){const g=p(d);if(D+g<=o?e[e.length-1]+=d:(e.push(d),D=0),ne.has(d)&&(l=!0,c=a.slice(s+1).join("").startsWith(de)),l){c?d===ue&&(l=!1,c=!1):d===De&&(l=!1);continue}D+=g,D===o&&s<a.length-1&&(e.push(""),D=0)}!D&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},hD=e=>{const s=e.split(" ");let o=s.length;for(;o>0&&!(p(s[o-1])>0);)o--;return o===s.length?e:s.slice(0,o).join(" ")+s.slice(o).join("")},lD=(e,s,o={})=>{if(o.trim!==!1&&e.trim()==="")return"";let a="",l,c;const D=aD(e);let d=[""];for(const[a,l]of e.split(" ").entries()){o.trim!==!1&&(d[d.length-1]=d[d.length-1].trimStart());let e=p(d[d.length-1]);if(a!==0&&(e>=s&&(o.wordWrap===!1||o.trim===!1)&&(d.push(""),e=0),(e>0||o.trim===!1)&&(d[d.length-1]+=" ",e++)),o.hard&&D[a]>s){const o=s-e,c=1+Math.floor((D[a]-o-1)/s);Math.floor((D[a]-1)/s)<c&&d.push(""),k(d,l,s);continue}if(e+D[a]>s&&e>0&&D[a]>0){if(o.wordWrap===!1&&e<s){k(d,l,s);continue}d.push("")}if(e+D[a]>s&&o.wordWrap===!1){k(d,l,s);continue}d[d.length-1]+=l}o.trim!==!1&&(d=d.map((e=>hD(e))));const g=[...d.join(`\n`)];for(const[e,s]of g.entries()){if(a+=s,ne.has(s)){const{groups:s}=new RegExp(`(?:\\${ae}(?<code>\\d+)m|\\${de}(?<uri>.*)${ue})`).exec(g.slice(e).join(""))||{groups:{}};if(s.code!==void 0){const e=Number.parseFloat(s.code);l=e===oe?void 0:e}else s.uri!==void 0&&(c=s.uri.length===0?void 0:s.uri)}const o=ee.codes.get(Number(l));g[e+1]===`\n`?(c&&(a+=K("")),l&&o&&(a+=z(o))):s===`\n`&&(l&&o&&(a+=z(l)),c&&(a+=K(c)))}return a};function Y(e,s,o){return String(e).normalize().replace(/\r\n/g,`\n`).split(`\n`).map((e=>lD(e,s,o))).join(`\n`)}const pe=["up","down","left","right","space","enter","cancel"],me={actions:new Set(pe),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function cD(e){for(const s in e){const o=s;if(!Object.hasOwn(e,o))continue;const a=e[o];switch(o){case"aliases":{for(const e in a)Object.hasOwn(a,e)&&(me.aliases.has(e)||me.aliases.set(e,a[e]));break}}}}function $(e,s){if(typeof e=="string")return me.aliases.get(e)===s;for(const o of e)if(o!==void 0&&$(o,s))return!0;return!1}function BD(e,s){if(e===s)return;const o=e.split(`\n`),a=s.split(`\n`),l=[];for(let e=0;e<Math.max(o.length,a.length);e++)o[e]!==a[e]&&l.push(e);return l}const Ee=globalThis.process.platform.startsWith("win"),Fe=Symbol("clack:cancel");function pD(e){return e===Fe}function m(e,s){const o=e;o.isTTY&&o.setRawMode(s)}function fD({input:e=c.stdin,output:s=c.stdout,overwrite:o=!0,hideCursor:a=!0}={}){const d=D.createInterface({input:e,output:s,prompt:"",tabSize:1});D.emitKeypressEvents(e,d),e.isTTY&&e.setRawMode(!0);const i=(c,{name:d,sequence:g})=>{const y=String(c);if($([y,d,g],"cancel")){a&&s.write(l.cursor.show),process.exit(0);return}if(!o)return;const C=d==="return"?0:-1,F=d==="return"?-1:0;D.moveCursor(s,C,F,(()=>{D.clearLine(s,1,(()=>{e.once("keypress",i)}))}))};return a&&s.write(l.cursor.hide),e.once("keypress",i),()=>{e.off("keypress",i),a&&s.write(l.cursor.show),e.isTTY&&!Ee&&e.setRawMode(!1),d.terminal=!1,d.close()}}var _e=Object.defineProperty,vD=(e,s,o)=>s in e?_e(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o,h=(e,s,o)=>(vD(e,typeof s!="symbol"?s+"":s,o),o);class x{constructor(e,s=!0){h(this,"input"),h(this,"output"),h(this,"_abortSignal"),h(this,"rl"),h(this,"opts"),h(this,"_render"),h(this,"_track",!1),h(this,"_prevFrame",""),h(this,"_subscribers",new Map),h(this,"_cursor",0),h(this,"state","initial"),h(this,"error",""),h(this,"value");const{input:o=c.stdin,output:a=c.stdout,render:l,signal:D,...d}=e;this.opts=d,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=l.bind(this),this._track=s,this._abortSignal=D,this.input=o,this.output=a}unsubscribe(){this._subscribers.clear()}setSubscriber(e,s){const o=this._subscribers.get(e)??[];o.push(s),this._subscribers.set(e,o)}on(e,s){this.setSubscriber(e,{cb:s})}once(e,s){this.setSubscriber(e,{cb:s,once:!0})}emit(e,...s){const o=this._subscribers.get(e)??[],a=[];for(const e of o)e.cb(...s),e.once&&a.push((()=>o.splice(o.indexOf(e),1)));for(const e of a)e()}prompt(){return new Promise(((e,s)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(Fe);this._abortSignal.addEventListener("abort",(()=>{this.state="cancel",this.close()}),{once:!0})}const o=new d.Writable;o._write=(e,s,o)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),o()},this.input.pipe(o),this.rl=D.createInterface({input:this.input,output:o,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),D.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),m(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",(()=>{this.output.write(l.cursor.show),this.output.off("resize",this.render),m(this.input,!1),e(this.value)})),this.once("cancel",(()=>{this.output.write(l.cursor.show),this.output.off("resize",this.render),m(this.input,!1),e(Fe)}))}))}onKeypress(e,s){if(this.state==="error"&&(this.state="active"),s?.name&&(!this._track&&me.aliases.has(s.name)&&this.emit("cursor",me.aliases.get(s.name)),me.actions.has(s.name)&&this.emit("cursor",s.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),s?.name==="return"){if(!this.value&&this.opts.placeholder&&(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder)),this.opts.validate){const e=this.opts.validate(this.value);e&&(this.error=e instanceof Error?e.message:e,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}$([e,s?.name,s?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`\n`),m(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const e=Y(this._prevFrame,process.stdout.columns,{hard:!0}).split(`\n`).length-1;this.output.write(l.cursor.move(-999,e*-1))}render(){const e=Y(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(l.cursor.hide);else{const s=BD(this._prevFrame,e);if(this.restoreCursor(),s&&s?.length===1){const o=s[0];this.output.write(l.cursor.move(0,o)),this.output.write(l.erase.lines(1));const a=e.split(`\n`);this.output.write(a[o]),this._prevFrame=e,this.output.write(l.cursor.move(0,a.length-o-1));return}if(s&&s?.length>1){const o=s[0];this.output.write(l.cursor.move(0,o)),this.output.write(l.erase.down());const a=e.split(`\n`).slice(o);this.output.write(a.join(`\n`)),this._prevFrame=e;return}this.output.write(l.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}}class dD extends x{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",(()=>{this.value=this._value})),this.on("confirm",(e=>{this.output.write(l.cursor.move(0,-1)),this.value=e,this.state="submit",this.close()})),this.on("cursor",(()=>{this.value=!this.value}))}}var Oe=Object.defineProperty,bD=(e,s,o)=>s in e?Oe(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o,dist_Z=(e,s,o)=>(bD(e,typeof s!="symbol"?s+"":s,o),o),q=(e,s,o)=>{if(!s.has(e))throw TypeError("Cannot "+o)},T=(e,s,o)=>(q(e,s,"read from private field"),o?o.call(e):s.get(e)),wD=(e,s,o)=>{if(s.has(e))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(e):s.set(e,o)},yD=(e,s,o,a)=>(q(e,s,"write to private field"),a?a.call(e,o):s.set(e,o),o),Ae;let Be=class extends x{constructor(e){super(e,!1),dist_Z(this,"options"),dist_Z(this,"cursor",0),wD(this,Ae,void 0);const{options:s}=e;yD(this,Ae,e.selectableGroups!==!1),this.options=Object.entries(s).flatMap((([e,s])=>[{value:e,group:!0,label:e},...s.map((s=>({...s,group:e})))])),this.value=[...e.initialValues??[]],this.cursor=Math.max(this.options.findIndex((({value:s})=>s===e.cursorAt)),T(this,Ae)?0:1),this.on("cursor",(e=>{switch(e){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;const e=this.options[this.cursor]?.group===!0;!T(this,Ae)&&e&&(this.cursor=this.cursor===0?this.options.length-1:this.cursor-1);break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;const e=this.options[this.cursor]?.group===!0;!T(this,Ae)&&e&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}}))}getGroupItems(e){return this.options.filter((s=>s.group===e))}isGroupSelected(e){return this.getGroupItems(e).every((e=>this.value.includes(e.value)))}toggleValue(){const e=this.options[this.cursor];if(e.group===!0){const s=e.value,o=this.getGroupItems(s);this.isGroupSelected(s)?this.value=this.value.filter((e=>o.findIndex((s=>s.value===e))===-1)):this.value=[...this.value,...o.map((e=>e.value))],this.value=Array.from(new Set(this.value))}else{const s=this.value.includes(e.value);this.value=s?this.value.filter((s=>s!==e.value)):[...this.value,e.value]}}};Ae=new WeakMap;var ke=Object.defineProperty,$D=(e,s,o)=>s in e?ke(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o,H=(e,s,o)=>($D(e,typeof s!="symbol"?s+"":s,o),o);let Re=class extends x{constructor(e){super(e,!1),H(this,"options"),H(this,"cursor",0),this.options=e.options,this.value=[...e.initialValues??[]],this.cursor=Math.max(this.options.findIndex((({value:s})=>s===e.cursorAt)),0),this.on("key",(e=>{e==="a"&&this.toggleAll()})),this.on("cursor",(e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}}))}get _value(){return this.options[this.cursor].value}toggleAll(){const e=this.value.length===this.options.length;this.value=e?[]:this.options.map((e=>e.value))}toggleValue(){const e=this.value.includes(this._value);this.value=e?this.value.filter((e=>e!==this._value)):[...this.value,this._value]}};var $e=Object.defineProperty,jD=(e,s,o)=>s in e?$e(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o,U=(e,s,o)=>(jD(e,typeof s!="symbol"?s+"":s,o),o);class MD extends x{constructor({mask:e,...s}){super(s),U(this,"valueWithCursor",""),U(this,"_mask","•"),this._mask=e??"•",this.on("finalize",(()=>{this.valueWithCursor=this.masked})),this.on("value",(()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.masked}${g.inverse(g.hidden("_"))}`;else{const e=this.masked.slice(0,this.cursor),s=this.masked.slice(this.cursor);this.valueWithCursor=`${e}${g.inverse(s[0])}${s.slice(1)}`}}))}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}}var Ne=Object.defineProperty,PD=(e,s,o)=>s in e?Ne(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o,J=(e,s,o)=>(PD(e,typeof s!="symbol"?s+"":s,o),o);class LD extends x{constructor(e){super(e,!1),J(this,"options"),J(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex((({value:s})=>s===e.initialValue)),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()}))}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}var Le=Object.defineProperty,ND=(e,s,o)=>s in e?Le(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o,Q=(e,s,o)=>(ND(e,typeof s!="symbol"?s+"":s,o),o);class ID extends x{constructor(e){super(e,!1),Q(this,"options"),Q(this,"cursor",0),this.options=e.options;const s=this.options.map((({value:[e]})=>e?.toLowerCase()));this.cursor=Math.max(s.indexOf(e.initialValue),0),this.on("key",(e=>{if(!s.includes(e))return;const o=this.options.find((({value:[s]})=>s?.toLowerCase()===e));o&&(this.value=o.value,this.state="submit",this.emit("submit"))}))}}class RD extends x{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}█`;const e=this.value.slice(0,this.cursor),[s,...o]=this.value.slice(this.cursor);return`${e}${g.inverse(s)}${o.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",(()=>{this.value||(this.value=e.defaultValue)}))}}function ce(){return c.platform!=="win32"?c.env.TERM!=="linux":!!c.env.CI||!!c.env.WT_SESSION||!!c.env.TERMINUS_SUBLIME||c.env.ConEmuTask==="{cmd::Cmder}"||c.env.TERM_PROGRAM==="Terminus-Sublime"||c.env.TERM_PROGRAM==="vscode"||c.env.TERM==="xterm-256color"||c.env.TERM==="alacritty"||c.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const Pe=ce(),u=(e,s)=>Pe?e:s,je=u("◆","*"),He=u("■","x"),Ve=u("▲","x"),We=u("◇","o"),Ue=u("┌","T"),ze=u("│","|"),qe=u("└","—"),Ge=u("●",">"),Ze=u("○"," "),Ye=u("◻","[•]"),Ke=u("◼","[+]"),Xe=u("◻","[ ]"),Je=u("▪","•"),Qe=u("─","-"),et=u("╮","+"),tt=u("├","+"),st=u("╯","+"),it=u("●","•"),nt=u("◆","*"),rt=u("▲","!"),ot=u("■","x"),b=e=>{switch(e){case"initial":case"active":return g.cyan(je);case"cancel":return g.red(He);case"error":return g.yellow(Ve);case"submit":return g.green(We)}},dist_G=e=>{const{cursor:s,options:o,style:a}=e,l=e.maxItems??Number.POSITIVE_INFINITY,c=Math.max(process.stdout.rows-4,0),D=Math.min(c,Math.max(l,5));let d=0;s>=d+D-3?d=Math.max(Math.min(s-D+3,o.length-D),0):s<d+2&&(d=Math.max(s-2,0));const y=D<o.length&&d>0,C=D<o.length&&d+D<o.length;return o.slice(d,d+D).map(((e,o,l)=>{const c=o===0&&y,D=o===l.length-1&&C;return c||D?g.dim("..."):a(e,o+d===s)}))},he=e=>new RD({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,render(){const s=`${g.gray(ze)}\n${b(this.state)} ${e.message}\n`,o=e.placeholder?g.inverse(e.placeholder[0])+g.dim(e.placeholder.slice(1)):g.inverse(g.hidden("_")),a=this.value?this.valueWithCursor:o;switch(this.state){case"error":return`${s.trim()}\n${g.yellow(ze)} ${a}\n${g.yellow(qe)} ${g.yellow(this.error)}\n`;case"submit":return`${s}${g.gray(ze)} ${g.dim(this.value||e.placeholder)}`;case"cancel":return`${s}${g.gray(ze)} ${g.strikethrough(g.dim(this.value??""))}${this.value?.trim()?`\n${g.gray(ze)}`:""}`;default:return`${s}${g.cyan(ze)} ${a}\n${g.cyan(qe)}\n`}}}).prompt(),ge=s=>new X({validate:s.validate,mask:s.mask??Je,render(){const o=`${e.gray(ze)}\n${b(this.state)} ${s.message}\n`,a=this.valueWithCursor,l=this.masked;switch(this.state){case"error":return`${o.trim()}\n${e.yellow(ze)} ${l}\n${e.yellow(qe)} ${e.yellow(this.error)}\n`;case"submit":return`${o}${e.gray(ze)} ${e.dim(l)}`;case"cancel":return`${o}${e.gray(ze)} ${e.strikethrough(e.dim(l??""))}${l?`\n${e.gray(ze)}`:""}`;default:return`${o}${e.cyan(ze)} ${a}\n${e.cyan(qe)}\n`}}}).prompt(),ye=s=>{const o=s.active??"Yes",a=s.inactive??"No";return new Z({active:o,inactive:a,initialValue:s.initialValue??!0,render(){const l=`${e.gray(ze)}\n${b(this.state)} ${s.message}\n`,c=this.value?o:a;switch(this.state){case"submit":return`${l}${e.gray(ze)} ${e.dim(c)}`;case"cancel":return`${l}${e.gray(ze)} ${e.strikethrough(e.dim(c))}\n${e.gray(ze)}`;default:return`${l}${e.cyan(ze)} ${this.value?`${e.green(Ge)} ${o}`:`${e.dim(Ze)} ${e.dim(o)}`} ${e.dim("/")} ${this.value?`${e.dim(Ze)} ${e.dim(a)}`:`${e.green(Ge)} ${a}`}\n${e.cyan(qe)}\n`}}}).prompt()},ve=e=>{const n=(e,s)=>{const o=e.label??String(e.value);switch(s){case"selected":return`${g.dim(o)}`;case"active":return`${g.green(Ge)} ${o} ${e.hint?g.dim(`(${e.hint})`):""}`;case"cancelled":return`${g.strikethrough(g.dim(o))}`;default:return`${g.dim(Ze)} ${g.dim(o)}`}};return new LD({options:e.options,initialValue:e.initialValue,render(){const s=`${g.gray(ze)}\n${b(this.state)} ${e.message}\n`;switch(this.state){case"submit":return`${s}${g.gray(ze)} ${n(this.options[this.cursor],"selected")}`;case"cancel":return`${s}${g.gray(ze)} ${n(this.options[this.cursor],"cancelled")}\n${g.gray(ze)}`;default:return`${s}${g.cyan(ze)} ${dist_G({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(e,s)=>n(e,s?"active":"inactive")}).join(`\n${g.cyan(ze)} `)}\n${g.cyan(qe)}\n`}}}).prompt()},we=s=>{const n=(s,o="inactive")=>{const a=s.label??String(s.value);return o==="selected"?`${e.dim(a)}`:o==="cancelled"?`${e.strikethrough(e.dim(a))}`:o==="active"?`${e.bgCyan(e.gray(` ${s.value} `))} ${a} ${s.hint?e.dim(`(${s.hint})`):""}`:`${e.gray(e.bgWhite(e.inverse(` ${s.value} `)))} ${a} ${s.hint?e.dim(`(${s.hint})`):""}`};return new te({options:s.options,initialValue:s.initialValue,render(){const o=`${e.gray(ze)}\n${b(this.state)} ${s.message}\n`;switch(this.state){case"submit":return`${o}${e.gray(ze)} ${n(this.options.find((e=>e.value===this.value))??s.options[0],"selected")}`;case"cancel":return`${o}${e.gray(ze)} ${n(this.options[0],"cancelled")}\n${e.gray(ze)}`;default:return`${o}${e.cyan(ze)} ${this.options.map(((e,s)=>n(e,s===this.cursor?"active":"inactive"))).join(`\n${e.cyan(ze)} `)}\n${e.cyan(qe)}\n`}}}).prompt()},fe=s=>{const n=(s,o)=>{const a=s.label??String(s.value);return o==="active"?`${e.cyan(Ye)} ${a} ${s.hint?e.dim(`(${s.hint})`):""}`:o==="selected"?`${e.green(Ke)} ${e.dim(a)} ${s.hint?e.dim(`(${s.hint})`):""}`:o==="cancelled"?`${e.strikethrough(e.dim(a))}`:o==="active-selected"?`${e.green(Ke)} ${a} ${s.hint?e.dim(`(${s.hint})`):""}`:o==="submitted"?`${e.dim(a)}`:`${e.dim(Xe)} ${e.dim(a)}`};return new re({options:s.options,initialValues:s.initialValues,required:s.required??!0,cursorAt:s.cursorAt,validate(s){if(this.required&&s.length===0)return`Please select at least one option.\n${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e.gray(e.bgWhite(e.inverse(" enter ")))} to submit`))}`},render(){const o=`${e.gray(ze)}\n${b(this.state)} ${s.message}\n`,i=(e,s)=>{const o=this.value.includes(e.value);return s&&o?n(e,"active-selected"):o?n(e,"selected"):n(e,s?"active":"inactive")};switch(this.state){case"submit":return`${o}${e.gray(ze)} ${this.options.filter((({value:e})=>this.value.includes(e))).map((e=>n(e,"submitted"))).join(e.dim(", "))||e.dim("none")}`;case"cancel":{const s=this.options.filter((({value:e})=>this.value.includes(e))).map((e=>n(e,"cancelled"))).join(e.dim(", "));return`${o}${e.gray(ze)} ${s.trim()?`${s}\n${e.gray(ze)}`:""}`}case"error":{const a=this.error.split(`\n`).map(((s,o)=>o===0?`${e.yellow(qe)} ${e.yellow(s)}`:` ${s}`)).join(`\n`);return`${o+e.yellow(ze)} ${dist_G({options:this.options,cursor:this.cursor,maxItems:s.maxItems,style:i}).join(`\n${e.yellow(ze)} `)}\n${a}\n`}default:return`${o}${e.cyan(ze)} ${dist_G({options:this.options,cursor:this.cursor,maxItems:s.maxItems,style:i}).join(`\n${e.cyan(ze)} `)}\n${e.cyan(qe)}\n`}}}).prompt()},be=s=>{const{selectableGroups:o=!0}=s,r=(s,a,l=[])=>{const c=s.label??String(s.value),D=typeof s.group=="string",d=D&&(l[l.indexOf(s)+1]??{group:!0}),g=D&&d.group===!0,y=D?o?`${g?qe:ze} `:" ":"";if(a==="active")return`${e.dim(y)}${e.cyan(Ye)} ${c} ${s.hint?e.dim(`(${s.hint})`):""}`;if(a==="group-active")return`${y}${e.cyan(Ye)} ${e.dim(c)}`;if(a==="group-active-selected")return`${y}${e.green(Ke)} ${e.dim(c)}`;if(a==="selected"){const a=D||o?e.green(Ke):"";return`${e.dim(y)}${a} ${e.dim(c)} ${s.hint?e.dim(`(${s.hint})`):""}`}if(a==="cancelled")return`${e.strikethrough(e.dim(c))}`;if(a==="active-selected")return`${e.dim(y)}${e.green(Ke)} ${c} ${s.hint?e.dim(`(${s.hint})`):""}`;if(a==="submitted")return`${e.dim(c)}`;const C=D||o?e.dim(Xe):"";return`${e.dim(y)}${C} ${e.dim(c)}`};return new se({options:s.options,initialValues:s.initialValues,required:s.required??!0,cursorAt:s.cursorAt,selectableGroups:o,validate(s){if(this.required&&s.length===0)return`Please select at least one option.\n${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e.gray(e.bgWhite(e.inverse(" enter ")))} to submit`))}`},render(){const o=`${e.gray(ze)}\n${b(this.state)} ${s.message}\n`;switch(this.state){case"submit":return`${o}${e.gray(ze)} ${this.options.filter((({value:e})=>this.value.includes(e))).map((e=>r(e,"submitted"))).join(e.dim(", "))}`;case"cancel":{const s=this.options.filter((({value:e})=>this.value.includes(e))).map((e=>r(e,"cancelled"))).join(e.dim(", "));return`${o}${e.gray(ze)} ${s.trim()?`${s}\n${e.gray(ze)}`:""}`}case"error":{const s=this.error.split(`\n`).map(((s,o)=>o===0?`${e.yellow(qe)} ${e.yellow(s)}`:` ${s}`)).join(`\n`);return`${o}${e.yellow(ze)} ${this.options.map(((e,s,o)=>{const a=this.value.includes(e.value)||e.group===!0&&this.isGroupSelected(`${e.value}`),l=s===this.cursor;return!l&&typeof e.group=="string"&&this.options[this.cursor].value===e.group?r(e,a?"group-active-selected":"group-active",o):l&&a?r(e,"active-selected",o):a?r(e,"selected",o):r(e,l?"active":"inactive",o)})).join(`\n${e.yellow(ze)} `)}\n${s}\n`}default:return`${o}${e.cyan(ze)} ${this.options.map(((e,s,o)=>{const a=this.value.includes(e.value)||e.group===!0&&this.isGroupSelected(`${e.value}`),l=s===this.cursor;return!l&&typeof e.group=="string"&&this.options[this.cursor].value===e.group?r(e,a?"group-active-selected":"group-active",o):l&&a?r(e,"active-selected",o):a?r(e,"selected",o):r(e,l?"active":"inactive",o)})).join(`\n${e.cyan(ze)} `)}\n${e.cyan(qe)}\n`}}}).prompt()},Me=(s="",o="")=>{const a=`\n${s}\n`.split(`\n`),l=S(o).length,c=Math.max(a.reduce(((e,s)=>{const o=S(s);return o.length>e?o.length:e}),0),l)+2,D=a.map((s=>`${e.gray(ze)} ${e.dim(s)}${" ".repeat(c-S(s).length)}${e.gray(ze)}`)).join(`\n`);process.stdout.write(`${e.gray(ze)}\n${e.green(We)} ${e.reset(o)} ${e.gray(Qe.repeat(Math.max(c-l-1,1))+et)}\n${D}\n${e.gray(tt+Qe.repeat(c+2)+st)}\n`)},xe=(s="")=>{process.stdout.write(`${e.gray(qe)} ${e.red(s)}\n\n`)},Ie=(e="")=>{process.stdout.write(`${g.gray(Ue)} ${e}\n`)},Se=(e="")=>{process.stdout.write(`${g.gray(ze)}\n${g.gray(qe)} ${e}\n\n`)},ut={message:(e="",{symbol:s=g.gray(ze)}={})=>{const o=[`${g.gray(ze)}`];if(e){const[a,...l]=e.split(`\n`);o.push(`${s} ${a}`,...l.map((e=>`${g.gray(ze)} ${e}`)))}process.stdout.write(`${o.join(`\n`)}\n`)},info:e=>{ut.message(e,{symbol:g.blue(it)})},success:e=>{ut.message(e,{symbol:g.green(nt)})},step:e=>{ut.message(e,{symbol:g.green(We)})},warn:e=>{ut.message(e,{symbol:g.yellow(rt)})},warning:e=>{ut.warn(e)},error:e=>{ut.message(e,{symbol:g.red(ot)})}},at=`${g.gray(ze)} `,ht={message:async(e,{symbol:s=g.gray(ze)}={})=>{process.stdout.write(`${g.gray(ze)}\n${s} `);let o=3;for await(let s of e){s=s.replace(/\n/g,`\n${at}`),s.includes(`\n`)&&(o=3+(0,a.stripVTControlCharacters)(s.slice(s.lastIndexOf(`\n`))).length);const e=(0,a.stripVTControlCharacters)(s).length;o+e<process.stdout.columns?(o+=e,process.stdout.write(s)):(process.stdout.write(`\n${at}${s.trimStart()}`),o=3+(0,a.stripVTControlCharacters)(s.trimStart()).length)}process.stdout.write(`\n`)},info:e=>ht.message(e,{symbol:g.blue(it)}),success:e=>ht.message(e,{symbol:g.green(nt)}),step:e=>ht.message(e,{symbol:g.green(We)}),warn:e=>ht.message(e,{symbol:g.yellow(rt)}),warning:e=>ht.warn(e),error:e=>ht.message(e,{symbol:g.red(ot)})},dist_Y=({indicator:e="dots"}={})=>{const s=Pe?["◒","◐","◓","◑"]:["•","o","O","0"],o=Pe?80:120,a=process.env.CI==="true";let c,D,d=!1,y="",C,F=performance.now();const p=e=>{const s=e>1?"Something went wrong":"Canceled";d&&N(s,e)},v=()=>p(2),f=()=>p(1),j=()=>{process.on("uncaughtExceptionMonitor",v),process.on("unhandledRejection",v),process.on("SIGINT",f),process.on("SIGTERM",f),process.on("exit",p)},E=()=>{process.removeListener("uncaughtExceptionMonitor",v),process.removeListener("unhandledRejection",v),process.removeListener("SIGINT",f),process.removeListener("SIGTERM",f),process.removeListener("exit",p)},B=()=>{if(C===void 0)return;a&&process.stdout.write(`\n`);const e=C.split(`\n`);process.stdout.write(l.cursor.move(-999,e.length-1)),process.stdout.write(l.erase.down(e.length))},R=e=>e.replace(/\.+$/,""),O=e=>{const s=(performance.now()-e)/1e3,o=Math.floor(s/60),a=Math.floor(s%60);return o>0?`[${o}m ${a}s]`:`[${a}s]`},H=(l="")=>{d=!0,c=fD(),y=R(l),F=performance.now(),process.stdout.write(`${g.gray(ze)}\n`);let _=0,w=0;j(),D=setInterval((()=>{if(a&&y===C)return;B(),C=y;const o=g.magenta(s[_]);if(a)process.stdout.write(`${o} ${y}...`);else if(e==="timer")process.stdout.write(`${o} ${y} ${O(F)}`);else{const e=".".repeat(Math.floor(w)).slice(0,3);process.stdout.write(`${o} ${y}${e}`)}_=_+1<s.length?_+1:0,w=w<s.length?w+.125:0}),o)},N=(s="",o=0)=>{d=!1,clearInterval(D),B();const a=o===0?g.green(We):o===1?g.red(He):g.red(Ve);y=R(s??y),e==="timer"?process.stdout.write(`${a} ${y} ${O(F)}\n`):process.stdout.write(`${a} ${y}\n`),E(),c()};return{start:H,stop:N,message:(e="")=>{y=R(e??y)}}},Ce=async(e,s)=>{const o={},a=Object.keys(e);for(const l of a){const a=e[l],c=await(a({results:o})?.catch((e=>{throw e})));if(typeof s?.onCancel=="function"&&ie(c)){o[l]="canceled",s.onCancel({results:o});continue}o[l]=c}return o},Te=async e=>{for(const s of e){if(s.enabled===!1)continue;const e=dist_Y();e.start(s.title);const o=await s.task(e.message);e.stop(o||s.title)}};var lt=__nccwpck_require__(928);var ct=__nccwpck_require__.n(lt);var Dt=__nccwpck_require__(313);const{DM:dt,gu:ft,er:pt,Ww:mt,b7:gt,Di:Et,a2:yt,uB:Ct,ef:Ft,c$:bt,_V:_t}=Dt;const wt=JSON.parse('{"rE":"0.0.1-alpha.4"}');const vt=require("os");var Ot=__nccwpck_require__.n(vt);const At=require("stream");const St=require("events");var Bt=__nccwpck_require__(896);var kt=__nccwpck_require__(474);const Rt=require("node:string_decoder");const xt=typeof process==="object"&&process?process:{stdout:null,stderr:null};const isStream=e=>!!e&&typeof e==="object"&&(e instanceof Minipass||e instanceof d||isReadable(e)||isWritable(e));const isReadable=e=>!!e&&typeof e==="object"&&e instanceof kt.EventEmitter&&typeof e.pipe==="function"&&e.pipe!==d.Writable.prototype.pipe;const isWritable=e=>!!e&&typeof e==="object"&&e instanceof kt.EventEmitter&&typeof e.write==="function"&&typeof e.end==="function";const $t=Symbol("EOF");const Tt=Symbol("maybeEmitEnd");const Nt=Symbol("emittedEnd");const It=Symbol("emittingEnd");const Lt=Symbol("emittedError");const Pt=Symbol("closed");const Mt=Symbol("read");const jt=Symbol("flush");const Ht=Symbol("flushChunk");const Vt=Symbol("encoding");const Wt=Symbol("decoder");const Ut=Symbol("flowing");const zt=Symbol("paused");const qt=Symbol("resume");const Gt=Symbol("buffer");const Zt=Symbol("pipes");const Yt=Symbol("bufferLength");const Kt=Symbol("bufferPush");const Xt=Symbol("bufferShift");const Jt=Symbol("objectMode");const Qt=Symbol("destroyed");const es=Symbol("error");const ts=Symbol("emitData");const ss=Symbol("emitEnd");const is=Symbol("emitEnd2");const ns=Symbol("async");const rs=Symbol("abort");const os=Symbol("aborted");const us=Symbol("signal");const as=Symbol("dataListeners");const hs=Symbol("discarded");const defer=e=>Promise.resolve().then(e);const nodefer=e=>e();const isEndish=e=>e==="end"||e==="finish"||e==="prefinish";const isArrayBufferLike=e=>e instanceof ArrayBuffer||!!e&&typeof e==="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0;const isArrayBufferView=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e);class Pipe{src;dest;opts;ondrain;constructor(e,s,o){this.src=e;this.dest=s;this.opts=o;this.ondrain=()=>e[qt]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(e,s,o){super(e,s,o);this.proxyErrors=e=>s.emit("error",e);e.on("error",this.proxyErrors)}}const isObjectModeOptions=e=>!!e.objectMode;const isEncodingOptions=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer";class Minipass extends kt.EventEmitter{[Ut]=false;[zt]=false;[Zt]=[];[Gt]=[];[Jt];[Vt];[ns];[Wt];[$t]=false;[Nt]=false;[It]=false;[Pt]=false;[Lt]=null;[Yt]=0;[Qt]=false;[us];[os]=false;[as]=0;[hs]=false;writable=true;readable=true;constructor(...e){const s=e[0]||{};super();if(s.objectMode&&typeof s.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(s)){this[Jt]=true;this[Vt]=null}else if(isEncodingOptions(s)){this[Vt]=s.encoding;this[Jt]=false}else{this[Jt]=false;this[Vt]=null}this[ns]=!!s.async;this[Wt]=this[Vt]?new Rt.StringDecoder(this[Vt]):null;if(s&&s.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[Gt]})}if(s&&s.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[Zt]})}const{signal:o}=s;if(o){this[us]=o;if(o.aborted){this[rs]()}else{o.addEventListener("abort",(()=>this[rs]()))}}}get bufferLength(){return this[Yt]}get encoding(){return this[Vt]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Jt]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[ns]}set["async"](e){this[ns]=this[ns]||!!e}[rs](){this[os]=true;this.emit("abort",this[us]?.reason);this.destroy(this[us]?.reason)}get aborted(){return this[os]}set aborted(e){}write(e,s,o){if(this[os])return false;if(this[$t])throw new Error("write after end");if(this[Qt]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof s==="function"){o=s;s="utf8"}if(!s)s="utf8";const a=this[ns]?defer:nodefer;if(!this[Jt]&&!Buffer.isBuffer(e)){if(isArrayBufferView(e)){e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(isArrayBufferLike(e)){e=Buffer.from(e)}else if(typeof e!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[Jt]){if(this[Ut]&&this[Yt]!==0)this[jt](true);if(this[Ut])this.emit("data",e);else this[Kt](e);if(this[Yt]!==0)this.emit("readable");if(o)a(o);return this[Ut]}if(!e.length){if(this[Yt]!==0)this.emit("readable");if(o)a(o);return this[Ut]}if(typeof e==="string"&&!(s===this[Vt]&&!this[Wt]?.lastNeed)){e=Buffer.from(e,s)}if(Buffer.isBuffer(e)&&this[Vt]){e=this[Wt].write(e)}if(this[Ut]&&this[Yt]!==0)this[jt](true);if(this[Ut])this.emit("data",e);else this[Kt](e);if(this[Yt]!==0)this.emit("readable");if(o)a(o);return this[Ut]}read(e){if(this[Qt])return null;this[hs]=false;if(this[Yt]===0||e===0||e&&e>this[Yt]){this[Tt]();return null}if(this[Jt])e=null;if(this[Gt].length>1&&!this[Jt]){this[Gt]=[this[Vt]?this[Gt].join(""):Buffer.concat(this[Gt],this[Yt])]}const s=this[Mt](e||null,this[Gt][0]);this[Tt]();return s}[Mt](e,s){if(this[Jt])this[Xt]();else{const o=s;if(e===o.length||e===null)this[Xt]();else if(typeof o==="string"){this[Gt][0]=o.slice(e);s=o.slice(0,e);this[Yt]-=e}else{this[Gt][0]=o.subarray(e);s=o.subarray(0,e);this[Yt]-=e}}this.emit("data",s);if(!this[Gt].length&&!this[$t])this.emit("drain");return s}end(e,s,o){if(typeof e==="function"){o=e;e=undefined}if(typeof s==="function"){o=s;s="utf8"}if(e!==undefined)this.write(e,s);if(o)this.once("end",o);this[$t]=true;this.writable=false;if(this[Ut]||!this[zt])this[Tt]();return this}[qt](){if(this[Qt])return;if(!this[as]&&!this[Zt].length){this[hs]=true}this[zt]=false;this[Ut]=true;this.emit("resume");if(this[Gt].length)this[jt]();else if(this[$t])this[Tt]();else this.emit("drain")}resume(){return this[qt]()}pause(){this[Ut]=false;this[zt]=true;this[hs]=false}get destroyed(){return this[Qt]}get flowing(){return this[Ut]}get paused(){return this[zt]}[Kt](e){if(this[Jt])this[Yt]+=1;else this[Yt]+=e.length;this[Gt].push(e)}[Xt](){if(this[Jt])this[Yt]-=1;else this[Yt]-=this[Gt][0].length;return this[Gt].shift()}[jt](e=false){do{}while(this[Ht](this[Xt]())&&this[Gt].length);if(!e&&!this[Gt].length&&!this[$t])this.emit("drain")}[Ht](e){this.emit("data",e);return this[Ut]}pipe(e,s){if(this[Qt])return e;this[hs]=false;const o=this[Nt];s=s||{};if(e===xt.stdout||e===xt.stderr)s.end=false;else s.end=s.end!==false;s.proxyErrors=!!s.proxyErrors;if(o){if(s.end)e.end()}else{this[Zt].push(!s.proxyErrors?new Pipe(this,e,s):new PipeProxyErrors(this,e,s));if(this[ns])defer((()=>this[qt]()));else this[qt]()}return e}unpipe(e){const s=this[Zt].find((s=>s.dest===e));if(s){if(this[Zt].length===1){if(this[Ut]&&this[as]===0){this[Ut]=false}this[Zt]=[]}else this[Zt].splice(this[Zt].indexOf(s),1);s.unpipe()}}addListener(e,s){return this.on(e,s)}on(e,s){const o=super.on(e,s);if(e==="data"){this[hs]=false;this[as]++;if(!this[Zt].length&&!this[Ut]){this[qt]()}}else if(e==="readable"&&this[Yt]!==0){super.emit("readable")}else if(isEndish(e)&&this[Nt]){super.emit(e);this.removeAllListeners(e)}else if(e==="error"&&this[Lt]){const e=s;if(this[ns])defer((()=>e.call(this,this[Lt])));else e.call(this,this[Lt])}return o}removeListener(e,s){return this.off(e,s)}off(e,s){const o=super.off(e,s);if(e==="data"){this[as]=this.listeners("data").length;if(this[as]===0&&!this[hs]&&!this[Zt].length){this[Ut]=false}}return o}removeAllListeners(e){const s=super.removeAllListeners(e);if(e==="data"||e===undefined){this[as]=0;if(!this[hs]&&!this[Zt].length){this[Ut]=false}}return s}get emittedEnd(){return this[Nt]}[Tt](){if(!this[It]&&!this[Nt]&&!this[Qt]&&this[Gt].length===0&&this[$t]){this[It]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[Pt])this.emit("close");this[It]=false}}emit(e,...s){const o=s[0];if(e!=="error"&&e!=="close"&&e!==Qt&&this[Qt]){return false}else if(e==="data"){return!this[Jt]&&!o?false:this[ns]?(defer((()=>this[ts](o))),true):this[ts](o)}else if(e==="end"){return this[ss]()}else if(e==="close"){this[Pt]=true;if(!this[Nt]&&!this[Qt])return false;const e=super.emit("close");this.removeAllListeners("close");return e}else if(e==="error"){this[Lt]=o;super.emit(es,o);const e=!this[us]||this.listeners("error").length?super.emit("error",o):false;this[Tt]();return e}else if(e==="resume"){const e=super.emit("resume");this[Tt]();return e}else if(e==="finish"||e==="prefinish"){const s=super.emit(e);this.removeAllListeners(e);return s}const a=super.emit(e,...s);this[Tt]();return a}[ts](e){for(const s of this[Zt]){if(s.dest.write(e)===false)this.pause()}const s=this[hs]?false:super.emit("data",e);this[Tt]();return s}[ss](){if(this[Nt])return false;this[Nt]=true;this.readable=false;return this[ns]?(defer((()=>this[is]())),true):this[is]()}[is](){if(this[Wt]){const e=this[Wt].end();if(e){for(const s of this[Zt]){s.dest.write(e)}if(!this[hs])super.emit("data",e)}}for(const e of this[Zt]){e.end()}const e=super.emit("end");this.removeAllListeners("end");return e}async collect(){const e=Object.assign([],{dataLength:0});if(!this[Jt])e.dataLength=0;const s=this.promise();this.on("data",(s=>{e.push(s);if(!this[Jt])e.dataLength+=s.length}));await s;return e}async concat(){if(this[Jt]){throw new Error("cannot concat in objectMode")}const e=await this.collect();return this[Vt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise(((e,s)=>{this.on(Qt,(()=>s(new Error("stream destroyed"))));this.on("error",(e=>s(e)));this.on("end",(()=>e()))}))}[Symbol.asyncIterator](){this[hs]=false;let e=false;const stop=async()=>{this.pause();e=true;return{value:undefined,done:true}};const next=()=>{if(e)return stop();const s=this.read();if(s!==null)return Promise.resolve({done:false,value:s});if(this[$t])return stop();let o;let a;const onerr=e=>{this.off("data",ondata);this.off("end",onend);this.off(Qt,ondestroy);stop();a(e)};const ondata=e=>{this.off("error",onerr);this.off("end",onend);this.off(Qt,ondestroy);this.pause();o({value:e,done:!!this[$t]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(Qt,ondestroy);stop();o({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((e,s)=>{a=s;o=e;this.once(Qt,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[hs]=false;let e=false;const stop=()=>{this.pause();this.off(es,stop);this.off(Qt,stop);this.off("end",stop);e=true;return{done:true,value:undefined}};const next=()=>{if(e)return stop();const s=this.read();return s===null?stop():{done:false,value:s}};this.once("end",stop);this.once(es,stop);this.once(Qt,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(e){if(this[Qt]){if(e)this.emit("error",e);else this.emit(Qt);return this}this[Qt]=true;this[hs]=true;this[Gt].length=0;this[Yt]=0;const s=this;if(typeof s.close==="function"&&!this[Pt])s.close();if(e)this.emit("error",e);else this.emit(Qt);return this}static get isStream(){return isStream}}const ls=Bt.writev;const cs=Symbol("_autoClose");const Ds=Symbol("_close");const ds=Symbol("_ended");const fs=Symbol("_fd");const ps=Symbol("_finished");const ms=Symbol("_flags");const gs=Symbol("_flush");const Es=Symbol("_handleChunk");const ys=Symbol("_makeBuf");const Cs=Symbol("_mode");const Fs=Symbol("_needDrain");const bs=Symbol("_onerror");const _s=Symbol("_onopen");const ws=Symbol("_onread");const vs=Symbol("_onwrite");const Os=Symbol("_open");const As=Symbol("_path");const Ss=Symbol("_pos");const Bs=Symbol("_queue");const ks=Symbol("_read");const Rs=Symbol("_readSize");const xs=Symbol("_reading");const $s=Symbol("_remain");const Ts=Symbol("_size");const Ns=Symbol("_write");const Is=Symbol("_writing");const Ls=Symbol("_defaultFlag");const Ps=Symbol("_errored");class ReadStream extends Minipass{[Ps]=false;[fs];[As];[Rs];[xs]=false;[Ts];[$s];[cs];constructor(e,s){s=s||{};super(s);this.readable=true;this.writable=false;if(typeof e!=="string"){throw new TypeError("path must be a string")}this[Ps]=false;this[fs]=typeof s.fd==="number"?s.fd:undefined;this[As]=e;this[Rs]=s.readSize||16*1024*1024;this[xs]=false;this[Ts]=typeof s.size==="number"?s.size:Infinity;this[$s]=this[Ts];this[cs]=typeof s.autoClose==="boolean"?s.autoClose:true;if(typeof this[fs]==="number"){this[ks]()}else{this[Os]()}}get fd(){return this[fs]}get path(){return this[As]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Os](){Bt.open(this[As],"r",((e,s)=>this[_s](e,s)))}[_s](e,s){if(e){this[bs](e)}else{this[fs]=s;this.emit("open",s);this[ks]()}}[ys](){return Buffer.allocUnsafe(Math.min(this[Rs],this[$s]))}[ks](){if(!this[xs]){this[xs]=true;const e=this[ys]();if(e.length===0){return process.nextTick((()=>this[ws](null,0,e)))}Bt.read(this[fs],e,0,e.length,null,((e,s,o)=>this[ws](e,s,o)))}}[ws](e,s,o){this[xs]=false;if(e){this[bs](e)}else if(this[Es](s,o)){this[ks]()}}[Ds](){if(this[cs]&&typeof this[fs]==="number"){const e=this[fs];this[fs]=undefined;Bt.close(e,(e=>e?this.emit("error",e):this.emit("close")))}}[bs](e){this[xs]=true;this[Ds]();this.emit("error",e)}[Es](e,s){let o=false;this[$s]-=e;if(e>0){o=super.write(e<s.length?s.subarray(0,e):s)}if(e===0||this[$s]<=0){o=false;this[Ds]();super.end()}return o}emit(e,...s){switch(e){case"prefinish":case"finish":return false;case"drain":if(typeof this[fs]==="number"){this[ks]()}return false;case"error":if(this[Ps]){return false}this[Ps]=true;return super.emit(e,...s);default:return super.emit(e,...s)}}}class ReadStreamSync extends ReadStream{[Os](){let e=true;try{this[_s](null,Bt.openSync(this[As],"r"));e=false}finally{if(e){this[Ds]()}}}[ks](){let e=true;try{if(!this[xs]){this[xs]=true;do{const e=this[ys]();const s=e.length===0?0:Bt.readSync(this[fs],e,0,e.length,null);if(!this[Es](s,e)){break}}while(true);this[xs]=false}e=false}finally{if(e){this[Ds]()}}}[Ds](){if(this[cs]&&typeof this[fs]==="number"){const e=this[fs];this[fs]=undefined;Bt.closeSync(e);this.emit("close")}}}class WriteStream extends St{readable=false;writable=true;[Ps]=false;[Is]=false;[ds]=false;[Bs]=[];[Fs]=false;[As];[Cs];[cs];[fs];[Ls];[ms];[ps]=false;[Ss];constructor(e,s){s=s||{};super(s);this[As]=e;this[fs]=typeof s.fd==="number"?s.fd:undefined;this[Cs]=s.mode===undefined?438:s.mode;this[Ss]=typeof s.start==="number"?s.start:undefined;this[cs]=typeof s.autoClose==="boolean"?s.autoClose:true;const o=this[Ss]!==undefined?"r+":"w";this[Ls]=s.flags===undefined;this[ms]=s.flags===undefined?o:s.flags;if(this[fs]===undefined){this[Os]()}}emit(e,...s){if(e==="error"){if(this[Ps]){return false}this[Ps]=true}return super.emit(e,...s)}get fd(){return this[fs]}get path(){return this[As]}[bs](e){this[Ds]();this[Is]=true;this.emit("error",e)}[Os](){Bt.open(this[As],this[ms],this[Cs],((e,s)=>this[_s](e,s)))}[_s](e,s){if(this[Ls]&&this[ms]==="r+"&&e&&e.code==="ENOENT"){this[ms]="w";this[Os]()}else if(e){this[bs](e)}else{this[fs]=s;this.emit("open",s);if(!this[Is]){this[gs]()}}}end(e,s){if(e){this.write(e,s)}this[ds]=true;if(!this[Is]&&!this[Bs].length&&typeof this[fs]==="number"){this[vs](null,0)}return this}write(e,s){if(typeof e==="string"){e=Buffer.from(e,s)}if(this[ds]){this.emit("error",new Error("write() after end()"));return false}if(this[fs]===undefined||this[Is]||this[Bs].length){this[Bs].push(e);this[Fs]=true;return false}this[Is]=true;this[Ns](e);return true}[Ns](e){Bt.write(this[fs],e,0,e.length,this[Ss],((e,s)=>this[vs](e,s)))}[vs](e,s){if(e){this[bs](e)}else{if(this[Ss]!==undefined&&typeof s==="number"){this[Ss]+=s}if(this[Bs].length){this[gs]()}else{this[Is]=false;if(this[ds]&&!this[ps]){this[ps]=true;this[Ds]();this.emit("finish")}else if(this[Fs]){this[Fs]=false;this.emit("drain")}}}}[gs](){if(this[Bs].length===0){if(this[ds]){this[vs](null,0)}}else if(this[Bs].length===1){this[Ns](this[Bs].pop())}else{const e=this[Bs];this[Bs]=[];ls(this[fs],e,this[Ss],((e,s)=>this[vs](e,s)))}}[Ds](){if(this[cs]&&typeof this[fs]==="number"){const e=this[fs];this[fs]=undefined;Bt.close(e,(e=>e?this.emit("error",e):this.emit("close")))}}}class WriteStreamSync extends WriteStream{[Os](){let e;if(this[Ls]&&this[ms]==="r+"){try{e=Bt.openSync(this[As],this[ms],this[Cs])}catch(e){if(e?.code==="ENOENT"){this[ms]="w";return this[Os]()}else{throw e}}}else{e=Bt.openSync(this[As],this[ms],this[Cs])}this[_s](null,e)}[Ds](){if(this[cs]&&typeof this[fs]==="number"){const e=this[fs];this[fs]=undefined;Bt.closeSync(e);this.emit("close")}}[Ns](e){let s=true;try{this[vs](null,Bt.writeSync(this[fs],e,0,e.length,this[Ss]));s=false}finally{if(s){try{this[Ds]()}catch{}}}}}var Ms=__nccwpck_require__(760);var js=__nccwpck_require__(24);const Hs=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]);const isSyncFile=e=>!!e.sync&&!!e.file;const isAsyncFile=e=>!e.sync&&!!e.file;const isSyncNoFile=e=>!!e.sync&&!e.file;const isAsyncNoFile=e=>!e.sync&&!e.file;const isSync=e=>!!e.sync;const isAsync=e=>!e.sync;const isFile=e=>!!e.file;const isNoFile=e=>!e.file;const dealiasKey=e=>{const s=Hs.get(e);if(s)return s;return e};const dealias=(e={})=>{if(!e)return{};const s={};for(const[o,a]of Object.entries(e)){const e=dealiasKey(o);s[e]=a}if(s.chmod===undefined&&s.noChmod===false){s.chmod=true}delete s.noChmod;return s};const makeCommand=(e,s,o,a,l)=>Object.assign(((c=[],D,d)=>{if(Array.isArray(c)){D=c;c={}}if(typeof D==="function"){d=D;D=undefined}if(!D){D=[]}else{D=Array.from(D)}const g=dealias(c);l?.(g,D);if(isSyncFile(g)){if(typeof d==="function"){throw new TypeError("callback not supported for sync tar functions")}return e(g,D)}else if(isAsyncFile(g)){const e=s(g,D);const o=d?d:undefined;return o?e.then((()=>o()),o):e}else if(isSyncNoFile(g)){if(typeof d==="function"){throw new TypeError("callback not supported for sync tar functions")}return o(g,D)}else if(isAsyncNoFile(g)){if(typeof d==="function"){throw new TypeError("callback only supported with file option")}return a(g,D)}else{throw new Error("impossible options??")}}),{syncFile:e,asyncFile:s,syncNoFile:o,asyncNoFile:a,validate:l});const Vs=require("assert");const Ws=require("buffer");const Us=require("zlib");var zs=__nccwpck_require__.t(Us,2);const qs=Us.constants||{ZLIB_VERNUM:4736};const Gs=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:Infinity,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},qs));const Zs=Ws.Buffer.concat;const Ys=Object.getOwnPropertyDescriptor(Ws.Buffer,"concat");const noop=e=>e;const Ks=Ys?.writable===true||Ys?.set!==undefined?e=>{Ws.Buffer.concat=e?noop:Zs}:e=>{};const Xs=Symbol("_superWrite");class ZlibError extends Error{code;errno;constructor(e){super("zlib: "+e.message);this.code=e.code;this.errno=e.errno;if(!this.code)this.code="ZLIB_ERROR";this.message="zlib: "+e.message;Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}const Js=Symbol("flushFlag");class ZlibBase extends Minipass{#e=false;#t=false;#s;#i;#n;#r;#o;get sawError(){return this.#e}get handle(){return this.#r}get flushFlag(){return this.#s}constructor(e,s){if(!e||typeof e!=="object")throw new TypeError("invalid options for ZlibBase constructor");super(e);this.#s=e.flush??0;this.#i=e.finishFlush??0;this.#n=e.fullFlushFlag??0;try{this.#r=new zs[s](e)}catch(e){throw new ZlibError(e)}this.#o=e=>{if(this.#e)return;this.#e=true;this.close();this.emit("error",e)};this.#r?.on("error",(e=>this.#o(new ZlibError(e))));this.once("end",(()=>this.close))}close(){if(this.#r){this.#r.close();this.#r=undefined;this.emit("close")}}reset(){if(!this.#e){Vs(this.#r,"zlib binding closed");return this.#r.reset?.()}}flush(e){if(this.ended)return;if(typeof e!=="number")e=this.#n;this.write(Object.assign(Ws.Buffer.alloc(0),{[Js]:e}))}end(e,s,o){if(typeof e==="function"){o=e;s=undefined;e=undefined}if(typeof s==="function"){o=s;s=undefined}if(e){if(s)this.write(e,s);else this.write(e)}this.flush(this.#i);this.#t=true;return super.end(o)}get ended(){return this.#t}[Xs](e){return super.write(e)}write(e,s,o){if(typeof s==="function")o=s,s="utf8";if(typeof e==="string")e=Ws.Buffer.from(e,s);if(this.#e)return;Vs(this.#r,"zlib binding closed");const a=this.#r._handle;const l=a.close;a.close=()=>{};const c=this.#r.close;this.#r.close=()=>{};Ks(true);let D=undefined;try{const s=typeof e[Js]==="number"?e[Js]:this.#s;D=this.#r._processChunk(e,s);Ks(false)}catch(e){Ks(false);this.#o(new ZlibError(e))}finally{if(this.#r){this.#r._handle=a;a.close=l;this.#r.close=c;this.#r.removeAllListeners("error")}}if(this.#r)this.#r.on("error",(e=>this.#o(new ZlibError(e))));let d;if(D){if(Array.isArray(D)&&D.length>0){const e=D[0];d=this[Xs](Ws.Buffer.from(e));for(let e=1;e<D.length;e++){d=this[Xs](D[e])}}else{d=this[Xs](Ws.Buffer.from(D))}}if(o)o();return d}}class Zlib extends ZlibBase{#u;#a;constructor(e,s){e=e||{};e.flush=e.flush||Gs.Z_NO_FLUSH;e.finishFlush=e.finishFlush||Gs.Z_FINISH;e.fullFlushFlag=Gs.Z_FULL_FLUSH;super(e,s);this.#u=e.level;this.#a=e.strategy}params(e,s){if(this.sawError)return;if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#u!==e||this.#a!==s){this.flush(Gs.Z_SYNC_FLUSH);Vs(this.handle,"zlib binding closed");const o=this.handle.flush;this.handle.flush=(e,s)=>{if(typeof e==="function"){s=e;e=this.flushFlag}this.flush(e);s?.()};try{this.handle.params(e,s)}finally{this.handle.flush=o}if(this.handle){this.#u=e;this.#a=s}}}}class Deflate extends Zlib{constructor(e){super(e,"Deflate")}}class Inflate extends Zlib{constructor(e){super(e,"Inflate")}}class Gzip extends Zlib{#h;constructor(e){super(e,"Gzip");this.#h=e&&!!e.portable}[Xs](e){if(!this.#h)return super[Xs](e);this.#h=false;e[9]=255;return super[Xs](e)}}class Gunzip extends Zlib{constructor(e){super(e,"Gunzip")}}class DeflateRaw extends Zlib{constructor(e){super(e,"DeflateRaw")}}class InflateRaw extends Zlib{constructor(e){super(e,"InflateRaw")}}class Unzip extends Zlib{constructor(e){super(e,"Unzip")}}class Brotli extends ZlibBase{constructor(e,s){e=e||{};e.flush=e.flush||Gs.BROTLI_OPERATION_PROCESS;e.finishFlush=e.finishFlush||Gs.BROTLI_OPERATION_FINISH;e.fullFlushFlag=Gs.BROTLI_OPERATION_FLUSH;super(e,s)}}class BrotliCompress extends Brotli{constructor(e){super(e,"BrotliCompress")}}class BrotliDecompress extends Brotli{constructor(e){super(e,"BrotliDecompress")}}class Yallist{tail;head;length=0;static create(e=[]){return new Yallist(e)}constructor(e=[]){for(const s of e){this.push(s)}}*[Symbol.iterator](){for(let e=this.head;e;e=e.next){yield e.value}}removeNode(e){if(e.list!==this){throw new Error("removing node which does not belong to this list")}const s=e.next;const o=e.prev;if(s){s.prev=o}if(o){o.next=s}if(e===this.head){this.head=s}if(e===this.tail){this.tail=o}this.length--;e.next=undefined;e.prev=undefined;e.list=undefined;return s}unshiftNode(e){if(e===this.head){return}if(e.list){e.list.removeNode(e)}const s=this.head;e.list=this;e.next=s;if(s){s.prev=e}this.head=e;if(!this.tail){this.tail=e}this.length++}pushNode(e){if(e===this.tail){return}if(e.list){e.list.removeNode(e)}const s=this.tail;e.list=this;e.prev=s;if(s){s.next=e}this.tail=e;if(!this.head){this.head=e}this.length++}push(...e){for(let s=0,o=e.length;s<o;s++){push(this,e[s])}return this.length}unshift(...e){for(var s=0,o=e.length;s<o;s++){unshift(this,e[s])}return this.length}pop(){if(!this.tail){return undefined}const e=this.tail.value;const s=this.tail;this.tail=this.tail.prev;if(this.tail){this.tail.next=undefined}else{this.head=undefined}s.list=undefined;this.length--;return e}shift(){if(!this.head){return undefined}const e=this.head.value;const s=this.head;this.head=this.head.next;if(this.head){this.head.prev=undefined}else{this.tail=undefined}s.list=undefined;this.length--;return e}forEach(e,s){s=s||this;for(let o=this.head,a=0;!!o;a++){e.call(s,o.value,a,this);o=o.next}}forEachReverse(e,s){s=s||this;for(let o=this.tail,a=this.length-1;!!o;a--){e.call(s,o.value,a,this);o=o.prev}}get(e){let s=0;let o=this.head;for(;!!o&&s<e;s++){o=o.next}if(s===e&&!!o){return o.value}}getReverse(e){let s=0;let o=this.tail;for(;!!o&&s<e;s++){o=o.prev}if(s===e&&!!o){return o.value}}map(e,s){s=s||this;const o=new Yallist;for(let a=this.head;!!a;){o.push(e.call(s,a.value,this));a=a.next}return o}mapReverse(e,s){s=s||this;var o=new Yallist;for(let a=this.tail;!!a;){o.push(e.call(s,a.value,this));a=a.prev}return o}reduce(e,s){let o;let a=this.head;if(arguments.length>1){o=s}else if(this.head){a=this.head.next;o=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var l=0;!!a;l++){o=e(o,a.value,l);a=a.next}return o}reduceReverse(e,s){let o;let a=this.tail;if(arguments.length>1){o=s}else if(this.tail){a=this.tail.prev;o=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(let s=this.length-1;!!a;s--){o=e(o,a.value,s);a=a.prev}return o}toArray(){const e=new Array(this.length);for(let s=0,o=this.head;!!o;s++){e[s]=o.value;o=o.next}return e}toArrayReverse(){const e=new Array(this.length);for(let s=0,o=this.tail;!!o;s++){e[s]=o.value;o=o.prev}return e}slice(e=0,s=this.length){if(s<0){s+=this.length}if(e<0){e+=this.length}const o=new Yallist;if(s<e||s<0){return o}if(e<0){e=0}if(s>this.length){s=this.length}let a=this.head;let l=0;for(l=0;!!a&&l<e;l++){a=a.next}for(;!!a&&l<s;l++,a=a.next){o.push(a.value)}return o}sliceReverse(e=0,s=this.length){if(s<0){s+=this.length}if(e<0){e+=this.length}const o=new Yallist;if(s<e||s<0){return o}if(e<0){e=0}if(s>this.length){s=this.length}let a=this.length;let l=this.tail;for(;!!l&&a>s;a--){l=l.prev}for(;!!l&&a>e;a--,l=l.prev){o.push(l.value)}return o}splice(e,s=0,...o){if(e>this.length){e=this.length-1}if(e<0){e=this.length+e}let a=this.head;for(let s=0;!!a&&s<e;s++){a=a.next}const l=[];for(let e=0;!!a&&e<s;e++){l.push(a.value);a=this.removeNode(a)}if(!a){a=this.tail}else if(a!==this.tail){a=a.prev}for(const e of o){a=insertAfter(this,a,e)}return l}reverse(){const e=this.head;const s=this.tail;for(let s=e;!!s;s=s.prev){const e=s.prev;s.prev=s.next;s.next=e}this.head=s;this.tail=e;return this}}function insertAfter(e,s,o){const a=s;const l=s?s.next:e.head;const c=new Node(o,a,l,e);if(c.next===undefined){e.tail=c}if(c.prev===undefined){e.head=c}e.length++;return c}function push(e,s){e.tail=new Node(s,e.tail,undefined,e);if(!e.head){e.head=e.tail}e.length++}function unshift(e,s){e.head=new Node(s,undefined,e.head,e);if(!e.tail){e.tail=e.head}e.length++}class Node{list;next;prev;value;constructor(e,s,o,a){this.list=a;this.value=e;if(s){s.next=this;this.prev=s}else{this.prev=undefined}if(o){o.prev=this;this.next=o}else{this.next=undefined}}}const encode=(e,s)=>{if(!Number.isSafeInteger(e)){throw Error("cannot encode number outside of javascript safe integer range")}else if(e<0){encodeNegative(e,s)}else{encodePositive(e,s)}return s};const encodePositive=(e,s)=>{s[0]=128;for(var o=s.length;o>1;o--){s[o-1]=e&255;e=Math.floor(e/256)}};const encodeNegative=(e,s)=>{s[0]=255;var o=false;e=e*-1;for(var a=s.length;a>1;a--){var l=e&255;e=Math.floor(e/256);if(o){s[a-1]=onesComp(l)}else if(l===0){s[a-1]=0}else{o=true;s[a-1]=twosComp(l)}}};const parse=e=>{const s=e[0];const o=s===128?pos(e.subarray(1,e.length)):s===255?twos(e):null;if(o===null){throw Error("invalid base256 encoding")}if(!Number.isSafeInteger(o)){throw Error("parsed number outside of javascript safe integer range")}return o};const twos=e=>{var s=e.length;var o=0;var a=false;for(var l=s-1;l>-1;l--){var c=Number(e[l]);var D;if(a){D=onesComp(c)}else if(c===0){D=c}else{a=true;D=twosComp(c)}if(D!==0){o-=D*Math.pow(256,s-l-1)}}return o};const pos=e=>{var s=e.length;var o=0;for(var a=s-1;a>-1;a--){var l=Number(e[a]);if(l!==0){o+=l*Math.pow(256,s-a-1)}}return o};const onesComp=e=>(255^e)&255;const twosComp=e=>(255^e)+1&255;const isCode=e=>Qs.has(e);const isName=e=>ei.has(e);const Qs=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);const ei=new Map(Array.from(Qs).map((e=>[e[1],e[0]])));class Header{cksumValid=false;needPax=false;nullBlock=false;block;path;mode;uid;gid;size;cksum;#l="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,s=0,o,a){if(Buffer.isBuffer(e)){this.decode(e,s||0,o,a)}else if(e){this.#c(e)}}decode(e,s,o,a){if(!s){s=0}if(!e||!(e.length>=s+512)){throw new Error("need 512 bytes for header")}this.path=decString(e,s,100);this.mode=decNumber(e,s+100,8);this.uid=decNumber(e,s+108,8);this.gid=decNumber(e,s+116,8);this.size=decNumber(e,s+124,12);this.mtime=decDate(e,s+136,12);this.cksum=decNumber(e,s+148,12);if(a)this.#c(a,true);if(o)this.#c(o);const l=decString(e,s+156,1);if(isCode(l)){this.#l=l||"0"}if(this.#l==="0"&&this.path.slice(-1)==="/"){this.#l="5"}if(this.#l==="5"){this.size=0}this.linkpath=decString(e,s+157,100);if(e.subarray(s+257,s+265).toString()==="ustar\x0000"){this.uname=decString(e,s+265,32);this.gname=decString(e,s+297,32);this.devmaj=decNumber(e,s+329,8)??0;this.devmin=decNumber(e,s+337,8)??0;if(e[s+475]!==0){const o=decString(e,s+345,155);this.path=o+"/"+this.path}else{const o=decString(e,s+345,130);if(o){this.path=o+"/"+this.path}this.atime=decDate(e,s+476,12);this.ctime=decDate(e,s+488,12)}}let c=8*32;for(let o=s;o<s+148;o++){c+=e[o]}for(let o=s+156;o<s+512;o++){c+=e[o]}this.cksumValid=c===this.cksum;if(this.cksum===undefined&&c===8*32){this.nullBlock=true}}#c(e,s=false){Object.assign(this,Object.fromEntries(Object.entries(e).filter((([e,o])=>!(o===null||o===undefined||e==="path"&&s||e==="linkpath"&&s||e==="global")))))}encode(e,s=0){if(!e){e=this.block=Buffer.alloc(512)}if(this.#l==="Unsupported"){this.#l="0"}if(!(e.length>=s+512)){throw new Error("need 512 bytes for header")}const o=this.ctime||this.atime?130:155;const a=splitPrefix(this.path||"",o);const l=a[0];const c=a[1];this.needPax=!!a[2];this.needPax=encString(e,s,100,l)||this.needPax;this.needPax=encNumber(e,s+100,8,this.mode)||this.needPax;this.needPax=encNumber(e,s+108,8,this.uid)||this.needPax;this.needPax=encNumber(e,s+116,8,this.gid)||this.needPax;this.needPax=encNumber(e,s+124,12,this.size)||this.needPax;this.needPax=encDate(e,s+136,12,this.mtime)||this.needPax;e[s+156]=this.#l.charCodeAt(0);this.needPax=encString(e,s+157,100,this.linkpath)||this.needPax;e.write("ustar\x0000",s+257,8);this.needPax=encString(e,s+265,32,this.uname)||this.needPax;this.needPax=encString(e,s+297,32,this.gname)||this.needPax;this.needPax=encNumber(e,s+329,8,this.devmaj)||this.needPax;this.needPax=encNumber(e,s+337,8,this.devmin)||this.needPax;this.needPax=encString(e,s+345,o,c)||this.needPax;if(e[s+475]!==0){this.needPax=encString(e,s+345,155,c)||this.needPax}else{this.needPax=encString(e,s+345,130,c)||this.needPax;this.needPax=encDate(e,s+476,12,this.atime)||this.needPax;this.needPax=encDate(e,s+488,12,this.ctime)||this.needPax}let D=8*32;for(let o=s;o<s+148;o++){D+=e[o]}for(let o=s+156;o<s+512;o++){D+=e[o]}this.cksum=D;encNumber(e,s+148,8,this.cksum);this.cksumValid=true;return this.needPax}get type(){return this.#l==="Unsupported"?this.#l:Qs.get(this.#l)}get typeKey(){return this.#l}set type(e){const s=String(ei.get(e));if(isCode(s)||s==="Unsupported"){this.#l=s}else if(isCode(e)){this.#l=e}else{throw new TypeError("invalid entry type: "+e)}}}const splitPrefix=(e,s)=>{const o=100;let a=e;let l="";let c=undefined;const D=Ms.posix.parse(e).root||".";if(Buffer.byteLength(a)<o){c=[a,l,false]}else{l=Ms.posix.dirname(a);a=Ms.posix.basename(a);do{if(Buffer.byteLength(a)<=o&&Buffer.byteLength(l)<=s){c=[a,l,false]}else if(Buffer.byteLength(a)>o&&Buffer.byteLength(l)<=s){c=[a.slice(0,o-1),l,true]}else{a=Ms.posix.join(Ms.posix.basename(l),a);l=Ms.posix.dirname(l)}}while(l!==D&&c===undefined);if(!c){c=[e.slice(0,o-1),"",true]}}return c};const decString=(e,s,o)=>e.subarray(s,s+o).toString("utf8").replace(/\0.*/,"");const decDate=(e,s,o)=>numToDate(decNumber(e,s,o));const numToDate=e=>e===undefined?undefined:new Date(e*1e3);const decNumber=(e,s,o)=>Number(e[s])&128?parse(e.subarray(s,s+o)):decSmallNumber(e,s,o);const nanUndef=e=>isNaN(e)?undefined:e;const decSmallNumber=(e,s,o)=>nanUndef(parseInt(e.subarray(s,s+o).toString("utf8").replace(/\0.*$/,"").trim(),8));const ti={12:8589934591,8:2097151};const encNumber=(e,s,o,a)=>a===undefined?false:a>ti[o]||a<0?(encode(a,e.subarray(s,s+o)),true):(encSmallNumber(e,s,o,a),false);const encSmallNumber=(e,s,o,a)=>e.write(octalString(a,o),s,o,"ascii");const octalString=(e,s)=>padOctal(Math.floor(e).toString(8),s);const padOctal=(e,s)=>(e.length===s-1?e:new Array(s-e.length-1).join("0")+e+" ")+"\0";const encDate=(e,s,o,a)=>a===undefined?false:encNumber(e,s,o,a.getTime()/1e3);const si=new Array(156).join("\0");const encString=(e,s,o,a)=>a===undefined?false:(e.write(a+si,s,o,"utf8"),a.length!==Buffer.byteLength(a)||a.length>o);class Pax{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(e,s=false){this.atime=e.atime;this.charset=e.charset;this.comment=e.comment;this.ctime=e.ctime;this.dev=e.dev;this.gid=e.gid;this.global=s;this.gname=e.gname;this.ino=e.ino;this.linkpath=e.linkpath;this.mtime=e.mtime;this.nlink=e.nlink;this.path=e.path;this.size=e.size;this.uid=e.uid;this.uname=e.uname}encode(){const e=this.encodeBody();if(e===""){return Buffer.allocUnsafe(0)}const s=Buffer.byteLength(e);const o=512*Math.ceil(1+s/512);const a=Buffer.allocUnsafe(o);for(let e=0;e<512;e++){a[e]=0}new Header({path:("PaxHeader/"+(0,Ms.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:s,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(a);a.write(e,512,s,"utf8");for(let e=s+512;e<a.length;e++){a[e]=0}return a}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===undefined){return""}const s=this[e];const o=s instanceof Date?s.getTime()/1e3:s;const a=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+o+"\n";const l=Buffer.byteLength(a);let c=Math.floor(Math.log(l)/Math.log(10))+1;if(l+c>=Math.pow(10,c)){c+=1}const D=c+l;return D+a}static parse(e,s,o=false){return new Pax(merge(parseKV(e),s),o)}}const merge=(e,s)=>s?Object.assign({},s,e):e;const parseKV=e=>e.replace(/\n$/,"").split("\n").reduce(parseKVLine,Object.create(null));const parseKVLine=(e,s)=>{const o=parseInt(s,10);if(o!==Buffer.byteLength(s)+1){return e}s=s.slice((o+" ").length);const a=s.split("=");const l=a.shift();if(!l){return e}const c=l.replace(/^SCHILY\.(dev|ino|nlink)/,"$1");const D=a.join("=");e[c]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(c)?new Date(Number(D)*1e3):/^[0-9]+$/.test(D)?+D:D;return e};const ii=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;const ni=ii!=="win32"?e=>e:e=>e&&e.replace(/\\/g,"/");class ReadEntry extends Minipass{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=false;ignore=false;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=false;absolute;unsupported=false;constructor(e,s,o){super({});this.pause();this.extended=s;this.globalExtended=o;this.header=e;this.remain=e.size??0;this.startBlockSize=512*Math.ceil(this.remain/512);this.blockRemain=this.startBlockSize;this.type=e.type;switch(this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=true;break;default:this.ignore=true}if(!e.path){throw new Error("no path provided for tar.ReadEntry")}this.path=ni(e.path);this.mode=e.mode;if(this.mode){this.mode=this.mode&4095}this.uid=e.uid;this.gid=e.gid;this.uname=e.uname;this.gname=e.gname;this.size=this.remain;this.mtime=e.mtime;this.atime=e.atime;this.ctime=e.ctime;this.linkpath=e.linkpath?ni(e.linkpath):undefined;this.uname=e.uname;this.gname=e.gname;if(s){this.#c(s)}if(o){this.#c(o,true)}}write(e){const s=e.length;if(s>this.blockRemain){throw new Error("writing more to entry than is appropriate")}const o=this.remain;const a=this.blockRemain;this.remain=Math.max(0,o-s);this.blockRemain=Math.max(0,a-s);if(this.ignore){return true}if(o>=s){return super.write(e)}return super.write(e.subarray(0,o))}#c(e,s=false){if(e.path)e.path=ni(e.path);if(e.linkpath)e.linkpath=ni(e.linkpath);Object.assign(this,Object.fromEntries(Object.entries(e).filter((([e,o])=>!(o===null||o===undefined||e==="path"&&s)))))}}const warnMethod=(e,s,o,a={})=>{if(e.file){a.file=e.file}if(e.cwd){a.cwd=e.cwd}a.code=o instanceof Error&&o.code||s;a.tarCode=s;if(!e.strict&&a.recoverable!==false){if(o instanceof Error){a=Object.assign(o,a);o=o.message}e.emit("warn",s,o,a)}else if(o instanceof Error){e.emit("error",Object.assign(o,a))}else{e.emit("error",Object.assign(new Error(`${s}: ${o}`),a))}};const ri=1024*1024;const oi=Buffer.from([31,139]);const ui=Symbol("state");const ai=Symbol("writeEntry");const hi=Symbol("readEntry");const li=Symbol("nextEntry");const ci=Symbol("processEntry");const Di=Symbol("extendedHeader");const di=Symbol("globalExtendedHeader");const fi=Symbol("meta");const pi=Symbol("emitMeta");const mi=Symbol("buffer");const gi=Symbol("queue");const Ei=Symbol("ended");const yi=Symbol("emittedEnd");const Ci=Symbol("emit");const Fi=Symbol("unzip");const bi=Symbol("consumeChunk");const _i=Symbol("consumeChunkSub");const wi=Symbol("consumeBody");const vi=Symbol("consumeMeta");const Oi=Symbol("consumeHeader");const Ai=Symbol("consuming");const Si=Symbol("bufferConcat");const Bi=Symbol("maybeEnd");const ki=Symbol("writing");const Ri=Symbol("aborted");const xi=Symbol("onDone");const $i=Symbol("sawValidEntry");const Ti=Symbol("sawNullBlock");const Ni=Symbol("sawEOF");const Ii=Symbol("closeStream");const parse_noop=()=>true;class Parser extends St.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;writable=true;readable=false;[gi]=new Yallist;[mi];[hi];[ai];[ui]="begin";[fi]="";[Di];[di];[Ei]=false;[Fi];[Ri]=false;[$i];[Ti]=false;[Ni]=false;[ki]=false;[Ai]=false;[yi]=false;constructor(e={}){super();this.file=e.file||"";this.on(xi,(()=>{if(this[ui]==="begin"||this[$i]===false){this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}}));if(e.ondone){this.on(xi,e.ondone)}else{this.on(xi,(()=>{this.emit("prefinish");this.emit("finish");this.emit("end")}))}this.strict=!!e.strict;this.maxMetaEntrySize=e.maxMetaEntrySize||ri;this.filter=typeof e.filter==="function"?e.filter:parse_noop;const s=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!e.gzip&&e.brotli!==undefined?e.brotli:s?undefined:false;this.on("end",(()=>this[Ii]()));if(typeof e.onwarn==="function"){this.on("warn",e.onwarn)}if(typeof e.onReadEntry==="function"){this.on("entry",e.onReadEntry)}}warn(e,s,o={}){warnMethod(this,e,s,o)}[Oi](e,s){if(this[$i]===undefined){this[$i]=false}let o;try{o=new Header(e,s,this[Di],this[di])}catch(e){return this.warn("TAR_ENTRY_INVALID",e)}if(o.nullBlock){if(this[Ti]){this[Ni]=true;if(this[ui]==="begin"){this[ui]="header"}this[Ci]("eof")}else{this[Ti]=true;this[Ci]("nullBlock")}}else{this[Ti]=false;if(!o.cksumValid){this.warn("TAR_ENTRY_INVALID","checksum failure",{header:o})}else if(!o.path){this.warn("TAR_ENTRY_INVALID","path is required",{header:o})}else{const e=o.type;if(/^(Symbolic)?Link$/.test(e)&&!o.linkpath){this.warn("TAR_ENTRY_INVALID","linkpath required",{header:o})}else if(!/^(Symbolic)?Link$/.test(e)&&!/^(Global)?ExtendedHeader$/.test(e)&&o.linkpath){this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:o})}else{const e=this[ai]=new ReadEntry(o,this[Di],this[di]);if(!this[$i]){if(e.remain){const onend=()=>{if(!e.invalid){this[$i]=true}};e.on("end",onend)}else{this[$i]=true}}if(e.meta){if(e.size>this.maxMetaEntrySize){e.ignore=true;this[Ci]("ignoredEntry",e);this[ui]="ignore";e.resume()}else if(e.size>0){this[fi]="";e.on("data",(e=>this[fi]+=e));this[ui]="meta"}}else{this[Di]=undefined;e.ignore=e.ignore||!this.filter(e.path,e);if(e.ignore){this[Ci]("ignoredEntry",e);this[ui]=e.remain?"ignore":"header";e.resume()}else{if(e.remain){this[ui]="body"}else{this[ui]="header";e.end()}if(!this[hi]){this[gi].push(e);this[li]()}else{this[gi].push(e)}}}}}}}[Ii](){queueMicrotask((()=>this.emit("close")))}[ci](e){let s=true;if(!e){this[hi]=undefined;s=false}else if(Array.isArray(e)){const[s,...o]=e;this.emit(s,...o)}else{this[hi]=e;this.emit("entry",e);if(!e.emittedEnd){e.on("end",(()=>this[li]()));s=false}}return s}[li](){do{}while(this[ci](this[gi].shift()));if(!this[gi].length){const e=this[hi];const s=!e||e.flowing||e.size===e.remain;if(s){if(!this[ki]){this.emit("drain")}}else{e.once("drain",(()=>this.emit("drain")))}}}[wi](e,s){const o=this[ai];if(!o){throw new Error("attempt to consume body without entry??")}const a=o.blockRemain??0;const l=a>=e.length&&s===0?e:e.subarray(s,s+a);o.write(l);if(!o.blockRemain){this[ui]="header";this[ai]=undefined;o.end()}return l.length}[vi](e,s){const o=this[ai];const a=this[wi](e,s);if(!this[ai]&&o){this[pi](o)}return a}[Ci](e,s,o){if(!this[gi].length&&!this[hi]){this.emit(e,s,o)}else{this[gi].push([e,s,o])}}[pi](e){this[Ci]("meta",this[fi]);switch(e.type){case"ExtendedHeader":case"OldExtendedHeader":this[Di]=Pax.parse(this[fi],this[Di],false);break;case"GlobalExtendedHeader":this[di]=Pax.parse(this[fi],this[di],true);break;case"NextFileHasLongPath":case"OldGnuLongPath":{const e=this[Di]??Object.create(null);this[Di]=e;e.path=this[fi].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{const e=this[Di]||Object.create(null);this[Di]=e;e.linkpath=this[fi].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Ri]=true;this.emit("abort",e);this.warn("TAR_ABORT",e,{recoverable:false})}write(e,s,o){if(typeof s==="function"){o=s;s=undefined}if(typeof e==="string"){e=Buffer.from(e,typeof s==="string"?s:"utf8")}if(this[Ri]){o?.();return false}const a=this[Fi]===undefined||this.brotli===undefined&&this[Fi]===false;if(a&&e){if(this[mi]){e=Buffer.concat([this[mi],e]);this[mi]=undefined}if(e.length<oi.length){this[mi]=e;o?.();return true}for(let s=0;this[Fi]===undefined&&s<oi.length;s++){if(e[s]!==oi[s]){this[Fi]=false}}const s=this.brotli===undefined;if(this[Fi]===false&&s){if(e.length<512){if(this[Ei]){this.brotli=true}else{this[mi]=e;o?.();return true}}else{try{new Header(e.subarray(0,512));this.brotli=false}catch(e){this.brotli=true}}}if(this[Fi]===undefined||this[Fi]===false&&this.brotli){const s=this[Ei];this[Ei]=false;this[Fi]=this[Fi]===undefined?new Unzip({}):new BrotliDecompress({});this[Fi].on("data",(e=>this[bi](e)));this[Fi].on("error",(e=>this.abort(e)));this[Fi].on("end",(()=>{this[Ei]=true;this[bi]()}));this[ki]=true;const a=!!this[Fi][s?"end":"write"](e);this[ki]=false;o?.();return a}}this[ki]=true;if(this[Fi]){this[Fi].write(e)}else{this[bi](e)}this[ki]=false;const l=this[gi].length?false:this[hi]?this[hi].flowing:true;if(!l&&!this[gi].length){this[hi]?.once("drain",(()=>this.emit("drain")))}o?.();return l}[Si](e){if(e&&!this[Ri]){this[mi]=this[mi]?Buffer.concat([this[mi],e]):e}}[Bi](){if(this[Ei]&&!this[yi]&&!this[Ri]&&!this[Ai]){this[yi]=true;const e=this[ai];if(e&&e.blockRemain){const s=this[mi]?this[mi].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${s} available)`,{entry:e});if(this[mi]){e.write(this[mi])}e.end()}this[Ci](xi)}}[bi](e){if(this[Ai]&&e){this[Si](e)}else if(!e&&!this[mi]){this[Bi]()}else if(e){this[Ai]=true;if(this[mi]){this[Si](e);const s=this[mi];this[mi]=undefined;this[_i](s)}else{this[_i](e)}while(this[mi]&&this[mi]?.length>=512&&!this[Ri]&&!this[Ni]){const e=this[mi];this[mi]=undefined;this[_i](e)}this[Ai]=false}if(!this[mi]||this[Ei]){this[Bi]()}}[_i](e){let s=0;const o=e.length;while(s+512<=o&&!this[Ri]&&!this[Ni]){switch(this[ui]){case"begin":case"header":this[Oi](e,s);s+=512;break;case"ignore":case"body":s+=this[wi](e,s);break;case"meta":s+=this[vi](e,s);break;default:throw new Error("invalid state: "+this[ui])}}if(s<o){if(this[mi]){this[mi]=Buffer.concat([e.subarray(s),this[mi]])}else{this[mi]=e.subarray(s)}}}end(e,s,o){if(typeof e==="function"){o=e;s=undefined;e=undefined}if(typeof s==="function"){o=s;s=undefined}if(typeof e==="string"){e=Buffer.from(e,s)}if(o)this.once("finish",o);if(!this[Ri]){if(this[Fi]){if(e)this[Fi].write(e);this[Fi].end()}else{this[Ei]=true;if(this.brotli===undefined)e=e||Buffer.alloc(0);if(e)this.write(e);this[Bi]()}}return this}}const stripTrailingSlashes=e=>{let s=e.length-1;let o=-1;while(s>-1&&e.charAt(s)==="/"){o=s;s--}return o===-1?e:e.slice(0,o)};const onReadEntryFunction=e=>{const s=e.onReadEntry;e.onReadEntry=s?e=>{s(e);e.resume()}:e=>e.resume()};const filesFilter=(e,s)=>{const o=new Map(s.map((e=>[stripTrailingSlashes(e),true])));const a=e.filter;const mapHas=(e,s="")=>{const a=s||(0,lt.parse)(e).root||".";let l;if(e===a)l=false;else{const s=o.get(e);if(s!==undefined){l=s}else{l=mapHas((0,lt.dirname)(e),a)}}o.set(e,l);return l};e.filter=a?(e,s)=>a(e,s)&&mapHas(stripTrailingSlashes(e)):e=>mapHas(stripTrailingSlashes(e))};const listFileSync=e=>{const s=new Parser(e);const o=e.file;let a;try{const l=js.statSync(o);const c=e.maxReadSize||16*1024*1024;if(l.size<c){s.end(js.readFileSync(o))}else{let e=0;const D=Buffer.allocUnsafe(c);a=js.openSync(o,"r");while(e<l.size){const o=js.readSync(a,D,0,c,e);e+=o;s.write(D.subarray(0,o))}s.end()}}finally{if(typeof a==="number"){try{js.closeSync(a)}catch(e){}}}};const listFile=(e,s)=>{const o=new Parser(e);const a=e.maxReadSize||16*1024*1024;const l=e.file;const c=new Promise(((e,s)=>{o.on("error",s);o.on("end",e);js.stat(l,((e,c)=>{if(e){s(e)}else{const e=new ReadStream(l,{readSize:a,size:c.size});e.on("error",s);e.pipe(o)}}))}));return c};const Li=makeCommand(listFileSync,listFile,(e=>new Parser(e)),(e=>new Parser(e)),((e,s)=>{if(s?.length)filesFilter(e,s);if(!e.noResume)onReadEntryFunction(e)}));const modeFix=(e,s,o)=>{e&=4095;if(o){e=(e|384)&~18}if(s){if(e&256){e|=64}if(e&32){e|=8}if(e&4){e|=1}}return e};const{isAbsolute:Pi,parse:Mi}=Ms.win32;const stripAbsolutePath=e=>{let s="";let o=Mi(e);while(Pi(e)||o.root){const a=e.charAt(0)==="/"&&e.slice(0,4)!=="//?/"?"/":o.root;e=e.slice(a.length);s+=a;o=Mi(e)}return[s,e]};const ji=["|","<",">","?",":"];const Hi=ji.map((e=>String.fromCharCode(61440+e.charCodeAt(0))));const Vi=new Map(ji.map(((e,s)=>[e,Hi[s]])));const Wi=new Map(Hi.map(((e,s)=>[e,ji[s]])));const winchars_encode=e=>ji.reduce(((e,s)=>e.split(s).join(Vi.get(s))),e);const decode=e=>Hi.reduce(((e,s)=>e.split(s).join(Wi.get(s))),e);const prefixPath=(e,s)=>{if(!s){return ni(e)}e=ni(e).replace(/^\.(\/|$)/,"");return stripTrailingSlashes(s)+"/"+e};const Ui=16*1024*1024;const zi=Symbol("process");const qi=Symbol("file");const Gi=Symbol("directory");const Zi=Symbol("symlink");const Yi=Symbol("hardlink");const Ki=Symbol("header");const Xi=Symbol("read");const Ji=Symbol("lstat");const Qi=Symbol("onlstat");const en=Symbol("onread");const tn=Symbol("onreadlink");const sn=Symbol("openfile");const nn=Symbol("onopenfile");const rn=Symbol("close");const on=Symbol("mode");const un=Symbol("awaitDrain");const an=Symbol("ondrain");const hn=Symbol("prefix");class WriteEntry extends Minipass{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#D=false;constructor(e,s={}){const o=dealias(s);super();this.path=ni(e);this.portable=!!o.portable;this.maxReadSize=o.maxReadSize||Ui;this.linkCache=o.linkCache||new Map;this.statCache=o.statCache||new Map;this.preservePaths=!!o.preservePaths;this.cwd=ni(o.cwd||process.cwd());this.strict=!!o.strict;this.noPax=!!o.noPax;this.noMtime=!!o.noMtime;this.mtime=o.mtime;this.prefix=o.prefix?ni(o.prefix):undefined;this.onWriteEntry=o.onWriteEntry;if(typeof o.onwarn==="function"){this.on("warn",o.onwarn)}let a=false;if(!this.preservePaths){const[e,s]=stripAbsolutePath(this.path);if(e&&typeof s==="string"){this.path=s;a=e}}this.win32=!!o.win32||process.platform==="win32";if(this.win32){this.path=decode(this.path.replace(/\\/g,"/"));e=e.replace(/\\/g,"/")}this.absolute=ni(o.absolute||lt.resolve(this.cwd,e));if(this.path===""){this.path="./"}if(a){this.warn("TAR_ENTRY_INFO",`stripping ${a} from absolute path`,{entry:this,path:a+this.path})}const l=this.statCache.get(this.absolute);if(l){this[Qi](l)}else{this[Ji]()}}warn(e,s,o={}){return warnMethod(this,e,s,o)}emit(e,...s){if(e==="error"){this.#D=true}return super.emit(e,...s)}[Ji](){Bt.lstat(this.absolute,((e,s)=>{if(e){return this.emit("error",e)}this[Qi](s)}))}[Qi](e){this.statCache.set(this.absolute,e);this.stat=e;if(!e.isFile()){e.size=0}this.type=getType(e);this.emit("stat",e);this[zi]()}[zi](){switch(this.type){case"File":return this[qi]();case"Directory":return this[Gi]();case"SymbolicLink":return this[Zi]();default:return this.end()}}[on](e){return modeFix(e,this.type==="Directory",this.portable)}[hn](e){return prefixPath(e,this.prefix)}[Ki](){if(!this.stat){throw new Error("cannot write header before stat")}if(this.type==="Directory"&&this.portable){this.noMtime=true}this.onWriteEntry?.(this);this.header=new Header({path:this[hn](this.path),linkpath:this.type==="Link"&&this.linkpath!==undefined?this[hn](this.linkpath):this.linkpath,mode:this[on](this.stat.mode),uid:this.portable?undefined:this.stat.uid,gid:this.portable?undefined:this.stat.gid,size:this.stat.size,mtime:this.noMtime?undefined:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?undefined:this.type,uname:this.portable?undefined:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?undefined:this.stat.atime,ctime:this.portable?undefined:this.stat.ctime});if(this.header.encode()&&!this.noPax){super.write(new Pax({atime:this.portable?undefined:this.header.atime,ctime:this.portable?undefined:this.header.ctime,gid:this.portable?undefined:this.header.gid,mtime:this.noMtime?undefined:this.mtime||this.header.mtime,path:this[hn](this.path),linkpath:this.type==="Link"&&this.linkpath!==undefined?this[hn](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?undefined:this.header.uid,uname:this.portable?undefined:this.header.uname,dev:this.portable?undefined:this.stat.dev,ino:this.portable?undefined:this.stat.ino,nlink:this.portable?undefined:this.stat.nlink}).encode())}const e=this.header?.block;if(!e){throw new Error("failed to encode header")}super.write(e)}[Gi](){if(!this.stat){throw new Error("cannot create directory entry without stat")}if(this.path.slice(-1)!=="/"){this.path+="/"}this.stat.size=0;this[Ki]();this.end()}[Zi](){Bt.readlink(this.absolute,((e,s)=>{if(e){return this.emit("error",e)}this[tn](s)}))}[tn](e){this.linkpath=ni(e);this[Ki]();this.end()}[Yi](e){if(!this.stat){throw new Error("cannot create link entry without stat")}this.type="Link";this.linkpath=ni(lt.relative(this.cwd,e));this.stat.size=0;this[Ki]();this.end()}[qi](){if(!this.stat){throw new Error("cannot create file entry without stat")}if(this.stat.nlink>1){const e=`${this.stat.dev}:${this.stat.ino}`;const s=this.linkCache.get(e);if(s?.indexOf(this.cwd)===0){return this[Yi](s)}this.linkCache.set(e,this.absolute)}this[Ki]();if(this.stat.size===0){return this.end()}this[sn]()}[sn](){Bt.open(this.absolute,"r",((e,s)=>{if(e){return this.emit("error",e)}this[nn](s)}))}[nn](e){this.fd=e;if(this.#D){return this[rn]()}if(!this.stat){throw new Error("should stat before calling onopenfile")}this.blockLen=512*Math.ceil(this.stat.size/512);this.blockRemain=this.blockLen;const s=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(s);this.offset=0;this.pos=0;this.remain=this.stat.size;this.length=this.buf.length;this[Xi]()}[Xi](){const{fd:e,buf:s,offset:o,length:a,pos:l}=this;if(e===undefined||s===undefined){throw new Error("cannot read file without first opening")}Bt.read(e,s,o,a,l,((e,s)=>{if(e){return this[rn]((()=>this.emit("error",e)))}this[en](s)}))}[rn](e=()=>{}){if(this.fd!==undefined)Bt.close(this.fd,e)}[en](e){if(e<=0&&this.remain>0){const e=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[rn]((()=>this.emit("error",e)))}if(e>this.remain){const e=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[rn]((()=>this.emit("error",e)))}if(!this.buf){throw new Error("should have created buffer prior to reading")}if(e===this.remain){for(let s=e;s<this.length&&e<this.blockRemain;s++){this.buf[s+this.offset]=0;e++;this.remain++}}const s=this.offset===0&&e===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+e);const o=this.write(s);if(!o){this[un]((()=>this[an]()))}else{this[an]()}}[un](e){this.once("drain",e)}write(e,s,o){if(typeof s==="function"){o=s;s=undefined}if(typeof e==="string"){e=Buffer.from(e,typeof s==="string"?s:"utf8")}if(this.blockRemain<e.length){const e=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",e)}this.remain-=e.length;this.blockRemain-=e.length;this.pos+=e.length;this.offset+=e.length;return super.write(e,null,o)}[an](){if(!this.remain){if(this.blockRemain){super.write(Buffer.alloc(this.blockRemain))}return this[rn]((e=>e?this.emit("error",e):this.end()))}if(!this.buf){throw new Error("buffer lost somehow in ONDRAIN")}if(this.offset>=this.length){this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length));this.offset=0}this.length=this.buf.length-this.offset;this[Xi]()}}class WriteEntrySync extends WriteEntry{sync=true;[Ji](){this[Qi](Bt.lstatSync(this.absolute))}[Zi](){this[tn](Bt.readlinkSync(this.absolute))}[sn](){this[nn](Bt.openSync(this.absolute,"r"))}[Xi](){let e=true;try{const{fd:s,buf:o,offset:a,length:l,pos:c}=this;if(s===undefined||o===undefined){throw new Error("fd and buf must be set in READ method")}const D=Bt.readSync(s,o,a,l,c);this[en](D);e=false}finally{if(e){try{this[rn]((()=>{}))}catch(e){}}}}[un](e){e()}[rn](e=()=>{}){if(this.fd!==undefined)Bt.closeSync(this.fd);e()}}class WriteEntryTar extends Minipass{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(e,s,o={}){return warnMethod(this,e,s,o)}constructor(e,s={}){const o=dealias(s);super();this.preservePaths=!!o.preservePaths;this.portable=!!o.portable;this.strict=!!o.strict;this.noPax=!!o.noPax;this.noMtime=!!o.noMtime;this.onWriteEntry=o.onWriteEntry;this.readEntry=e;const{type:a}=e;if(a==="Unsupported"){throw new Error("writing entry that should be ignored")}this.type=a;if(this.type==="Directory"&&this.portable){this.noMtime=true}this.prefix=o.prefix;this.path=ni(e.path);this.mode=e.mode!==undefined?this[on](e.mode):undefined;this.uid=this.portable?undefined:e.uid;this.gid=this.portable?undefined:e.gid;this.uname=this.portable?undefined:e.uname;this.gname=this.portable?undefined:e.gname;this.size=e.size;this.mtime=this.noMtime?undefined:o.mtime||e.mtime;this.atime=this.portable?undefined:e.atime;this.ctime=this.portable?undefined:e.ctime;this.linkpath=e.linkpath!==undefined?ni(e.linkpath):undefined;if(typeof o.onwarn==="function"){this.on("warn",o.onwarn)}let l=false;if(!this.preservePaths){const[e,s]=stripAbsolutePath(this.path);if(e&&typeof s==="string"){this.path=s;l=e}}this.remain=e.size;this.blockRemain=e.startBlockSize;this.onWriteEntry?.(this);this.header=new Header({path:this[hn](this.path),linkpath:this.type==="Link"&&this.linkpath!==undefined?this[hn](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?undefined:this.uid,gid:this.portable?undefined:this.gid,size:this.size,mtime:this.noMtime?undefined:this.mtime,type:this.type,uname:this.portable?undefined:this.uname,atime:this.portable?undefined:this.atime,ctime:this.portable?undefined:this.ctime});if(l){this.warn("TAR_ENTRY_INFO",`stripping ${l} from absolute path`,{entry:this,path:l+this.path})}if(this.header.encode()&&!this.noPax){super.write(new Pax({atime:this.portable?undefined:this.atime,ctime:this.portable?undefined:this.ctime,gid:this.portable?undefined:this.gid,mtime:this.noMtime?undefined:this.mtime,path:this[hn](this.path),linkpath:this.type==="Link"&&this.linkpath!==undefined?this[hn](this.linkpath):this.linkpath,size:this.size,uid:this.portable?undefined:this.uid,uname:this.portable?undefined:this.uname,dev:this.portable?undefined:this.readEntry.dev,ino:this.portable?undefined:this.readEntry.ino,nlink:this.portable?undefined:this.readEntry.nlink}).encode())}const c=this.header?.block;if(!c)throw new Error("failed to encode header");super.write(c);e.pipe(this)}[hn](e){return prefixPath(e,this.prefix)}[on](e){return modeFix(e,this.type==="Directory",this.portable)}write(e,s,o){if(typeof s==="function"){o=s;s=undefined}if(typeof e==="string"){e=Buffer.from(e,typeof s==="string"?s:"utf8")}const a=e.length;if(a>this.blockRemain){throw new Error("writing more to entry than is appropriate")}this.blockRemain-=a;return super.write(e,o)}end(e,s,o){if(this.blockRemain){super.write(Buffer.alloc(this.blockRemain))}if(typeof e==="function"){o=e;s=undefined;e=undefined}if(typeof s==="function"){o=s;s=undefined}if(typeof e==="string"){e=Buffer.from(e,s??"utf8")}if(o)this.once("finish",o);e?super.end(e,o):super.end(o);return this}}const getType=e=>e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":"Unsupported";class PackJob{path;absolute;entry;stat;readdir;pending=false;ignore=false;piped=false;constructor(e,s){this.path=e||"./";this.absolute=s}}const ln=Buffer.alloc(1024);const cn=Symbol("onStat");const Dn=Symbol("ended");const dn=Symbol("queue");const fn=Symbol("current");const pn=Symbol("process");const mn=Symbol("processing");const gn=Symbol("processJob");const En=Symbol("jobs");const yn=Symbol("jobDone");const Cn=Symbol("addFSEntry");const Fn=Symbol("addTarEntry");const bn=Symbol("stat");const _n=Symbol("readdir");const wn=Symbol("onreaddir");const vn=Symbol("pipe");const On=Symbol("entry");const An=Symbol("entryOpt");const Sn=Symbol("writeEntryClass");const Bn=Symbol("write");const kn=Symbol("ondrain");class Pack extends Minipass{opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[Sn];onWriteEntry;[dn];[En]=0;[mn]=false;[Dn]=false;constructor(e={}){super();this.opt=e;this.file=e.file||"";this.cwd=e.cwd||process.cwd();this.maxReadSize=e.maxReadSize;this.preservePaths=!!e.preservePaths;this.strict=!!e.strict;this.noPax=!!e.noPax;this.prefix=ni(e.prefix||"");this.linkCache=e.linkCache||new Map;this.statCache=e.statCache||new Map;this.readdirCache=e.readdirCache||new Map;this.onWriteEntry=e.onWriteEntry;this[Sn]=WriteEntry;if(typeof e.onwarn==="function"){this.on("warn",e.onwarn)}this.portable=!!e.portable;if(e.gzip||e.brotli){if(e.gzip&&e.brotli){throw new TypeError("gzip and brotli are mutually exclusive")}if(e.gzip){if(typeof e.gzip!=="object"){e.gzip={}}if(this.portable){e.gzip.portable=true}this.zip=new Gzip(e.gzip)}if(e.brotli){if(typeof e.brotli!=="object"){e.brotli={}}this.zip=new BrotliCompress(e.brotli)}if(!this.zip)throw new Error("impossible");const s=this.zip;s.on("data",(e=>super.write(e)));s.on("end",(()=>super.end()));s.on("drain",(()=>this[kn]()));this.on("resume",(()=>s.resume()))}else{this.on("drain",this[kn])}this.noDirRecurse=!!e.noDirRecurse;this.follow=!!e.follow;this.noMtime=!!e.noMtime;if(e.mtime)this.mtime=e.mtime;this.filter=typeof e.filter==="function"?e.filter:()=>true;this[dn]=new Yallist;this[En]=0;this.jobs=Number(e.jobs)||4;this[mn]=false;this[Dn]=false}[Bn](e){return super.write(e)}add(e){this.write(e);return this}end(e,s,o){if(typeof e==="function"){o=e;e=undefined}if(typeof s==="function"){o=s;s=undefined}if(e){this.add(e)}this[Dn]=true;this[pn]();if(o)o();return this}write(e){if(this[Dn]){throw new Error("write after end")}if(e instanceof ReadEntry){this[Fn](e)}else{this[Cn](e)}return this.flowing}[Fn](e){const s=ni(lt.resolve(this.cwd,e.path));if(!this.filter(e.path,e)){e.resume()}else{const o=new PackJob(e.path,s);o.entry=new WriteEntryTar(e,this[An](o));o.entry.on("end",(()=>this[yn](o)));this[En]+=1;this[dn].push(o)}this[pn]()}[Cn](e){const s=ni(lt.resolve(this.cwd,e));this[dn].push(new PackJob(e,s));this[pn]()}[bn](e){e.pending=true;this[En]+=1;const s=this.follow?"stat":"lstat";Bt[s](e.absolute,((s,o)=>{e.pending=false;this[En]-=1;if(s){this.emit("error",s)}else{this[cn](e,o)}}))}[cn](e,s){this.statCache.set(e.absolute,s);e.stat=s;if(!this.filter(e.path,s)){e.ignore=true}this[pn]()}[_n](e){e.pending=true;this[En]+=1;Bt.readdir(e.absolute,((s,o)=>{e.pending=false;this[En]-=1;if(s){return this.emit("error",s)}this[wn](e,o)}))}[wn](e,s){this.readdirCache.set(e.absolute,s);e.readdir=s;this[pn]()}[pn](){if(this[mn]){return}this[mn]=true;for(let e=this[dn].head;!!e&&this[En]<this.jobs;e=e.next){this[gn](e.value);if(e.value.ignore){const s=e.next;this[dn].removeNode(e);e.next=s}}this[mn]=false;if(this[Dn]&&!this[dn].length&&this[En]===0){if(this.zip){this.zip.end(ln)}else{super.write(ln);super.end()}}}get[fn](){return this[dn]&&this[dn].head&&this[dn].head.value}[yn](e){this[dn].shift();this[En]-=1;this[pn]()}[gn](e){if(e.pending){return}if(e.entry){if(e===this[fn]&&!e.piped){this[vn](e)}return}if(!e.stat){const s=this.statCache.get(e.absolute);if(s){this[cn](e,s)}else{this[bn](e)}}if(!e.stat){return}if(e.ignore){return}if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){const s=this.readdirCache.get(e.absolute);if(s){this[wn](e,s)}else{this[_n](e)}if(!e.readdir){return}}e.entry=this[On](e);if(!e.entry){e.ignore=true;return}if(e===this[fn]&&!e.piped){this[vn](e)}}[An](e){return{onwarn:(e,s,o)=>this.warn(e,s,o),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[On](e){this[En]+=1;try{const s=new this[Sn](e.path,this[An](e));return s.on("end",(()=>this[yn](e))).on("error",(e=>this.emit("error",e)))}catch(e){this.emit("error",e)}}[kn](){if(this[fn]&&this[fn].entry){this[fn].entry.resume()}}[vn](e){e.piped=true;if(e.readdir){e.readdir.forEach((s=>{const o=e.path;const a=o==="./"?"":o.replace(/\/*$/,"/");this[Cn](a+s)}))}const s=e.entry;const o=this.zip;if(!s)throw new Error("cannot pipe without source");if(o){s.on("data",(e=>{if(!o.write(e)){s.pause()}}))}else{s.on("data",(e=>{if(!super.write(e)){s.pause()}}))}}pause(){if(this.zip){this.zip.pause()}return super.pause()}warn(e,s,o={}){warnMethod(this,e,s,o)}}class PackSync extends Pack{sync=true;constructor(e){super(e);this[Sn]=WriteEntrySync}pause(){}resume(){}[bn](e){const s=this.follow?"statSync":"lstatSync";this[cn](e,Bt[s](e.absolute))}[_n](e){this[wn](e,Bt.readdirSync(e.absolute))}[vn](e){const s=e.entry;const o=this.zip;if(e.readdir){e.readdir.forEach((s=>{const o=e.path;const a=o==="./"?"":o.replace(/\/*$/,"/");this[Cn](a+s)}))}if(!s)throw new Error("Cannot pipe without source");if(o){s.on("data",(e=>{o.write(e)}))}else{s.on("data",(e=>{super[Bn](e)}))}}}const createFileSync=(e,s)=>{const o=new PackSync(e);const a=new WriteStreamSync(e.file,{mode:e.mode||438});o.pipe(a);addFilesSync(o,s)};const createFile=(e,s)=>{const o=new Pack(e);const a=new WriteStream(e.file,{mode:e.mode||438});o.pipe(a);const l=new Promise(((e,s)=>{a.on("error",s);a.on("close",e);o.on("error",s)}));addFilesAsync(o,s);return l};const addFilesSync=(e,s)=>{s.forEach((s=>{if(s.charAt(0)==="@"){Li({file:Ms.resolve(e.cwd,s.slice(1)),sync:true,noResume:true,onReadEntry:s=>e.add(s)})}else{e.add(s)}}));e.end()};const addFilesAsync=async(e,s)=>{for(let o=0;o<s.length;o++){const a=String(s[o]);if(a.charAt(0)==="@"){await Li({file:Ms.resolve(String(e.cwd),a.slice(1)),noResume:true,onReadEntry:s=>{e.add(s)}})}else{e.add(a)}}e.end()};const createSync=(e,s)=>{const o=new PackSync(e);addFilesSync(o,s);return o};const createAsync=(e,s)=>{const o=new Pack(e);addFilesAsync(o,s);return o};const Rn=makeCommand(createFileSync,createFile,createSync,createAsync,((e,s)=>{if(!s?.length){throw new TypeError("no paths specified to add to archive")}}));const xn=require("node:assert");const $n=require("node:crypto");const Tn=process.env.__FAKE_PLATFORM__||process.platform;const Nn=Tn==="win32";const{O_CREAT:In,O_TRUNC:Ln,O_WRONLY:Pn}=Bt.constants;const Mn=Number(process.env.__FAKE_FS_O_FILENAME__)||Bt.constants.UV_FS_O_FILEMAP||0;const jn=Nn&&!!Mn;const Hn=512*1024;const Vn=Mn|Ln|In|Pn;const Wn=!jn?()=>"w":e=>e<Hn?Vn:"w";const lchownSync=(e,s,o)=>{try{return js.lchownSync(e,s,o)}catch(e){if(e?.code!=="ENOENT")throw e}};const chown=(e,s,o,a)=>{js.lchown(e,s,o,(e=>{a(e&&e?.code!=="ENOENT"?e:null)}))};const chownrKid=(e,s,o,a,l)=>{if(s.isDirectory()){chownr(Ms.resolve(e,s.name),o,a,(c=>{if(c)return l(c);const D=Ms.resolve(e,s.name);chown(D,o,a,l)}))}else{const c=Ms.resolve(e,s.name);chown(c,o,a,l)}};const chownr=(e,s,o,a)=>{js.readdir(e,{withFileTypes:true},((l,c)=>{if(l){if(l.code==="ENOENT")return a();else if(l.code!=="ENOTDIR"&&l.code!=="ENOTSUP")return a(l)}if(l||!c.length)return chown(e,s,o,a);let D=c.length;let d=null;const then=l=>{if(d)return;if(l)return a(d=l);if(--D===0)return chown(e,s,o,a)};for(const a of c){chownrKid(e,a,s,o,then)}}))};const chownrKidSync=(e,s,o,a)=>{if(s.isDirectory())chownrSync(Ms.resolve(e,s.name),o,a);lchownSync(Ms.resolve(e,s.name),o,a)};const chownrSync=(e,s,o)=>{let a;try{a=js.readdirSync(e,{withFileTypes:true})}catch(a){const l=a;if(l?.code==="ENOENT")return;else if(l?.code==="ENOTDIR"||l?.code==="ENOTSUP")return lchownSync(e,s,o);else throw l}for(const l of a){chownrKidSync(e,l,s,o)}return lchownSync(e,s,o)};const optsArg=e=>{if(!e){e={mode:511}}else if(typeof e==="object"){e={mode:511,...e}}else if(typeof e==="number"){e={mode:e}}else if(typeof e==="string"){e={mode:parseInt(e,8)}}else{throw new TypeError("invalid options argument")}const s=e;const o=e.fs||{};e.mkdir=e.mkdir||o.mkdir||Bt.mkdir;e.mkdirAsync=e.mkdirAsync?e.mkdirAsync:async(e,o)=>new Promise(((a,l)=>s.mkdir(e,o,((e,s)=>e?l(e):a(s)))));e.stat=e.stat||o.stat||Bt.stat;e.statAsync=e.statAsync?e.statAsync:async e=>new Promise(((o,a)=>s.stat(e,((e,s)=>e?a(e):o(s)))));e.statSync=e.statSync||o.statSync||Bt.statSync;e.mkdirSync=e.mkdirSync||o.mkdirSync||Bt.mkdirSync;return s};const mkdirp_manual_mkdirpManualSync=(e,s,o)=>{const a=(0,lt.dirname)(e);const l={...optsArg(s),recursive:false};if(a===e){try{return l.mkdirSync(e,l)}catch(e){const s=e;if(s&&s.code!=="EISDIR"){throw e}return}}try{l.mkdirSync(e,l);return o||e}catch(s){const c=s;if(c&&c.code==="ENOENT"){return mkdirp_manual_mkdirpManualSync(e,l,mkdirp_manual_mkdirpManualSync(a,l,o))}if(c&&c.code!=="EEXIST"&&c&&c.code!=="EROFS"){throw s}try{if(!l.statSync(e).isDirectory())throw s}catch(e){throw s}}};const Un=Object.assign((async(e,s,o)=>{const a=optsArg(s);a.recursive=false;const l=(0,lt.dirname)(e);if(l===e){return a.mkdirAsync(e,a).catch((e=>{const s=e;if(s&&s.code!=="EISDIR"){throw e}}))}return a.mkdirAsync(e,a).then((()=>o||e),(async s=>{const c=s;if(c&&c.code==="ENOENT"){return Un(l,a).then((s=>Un(e,a,s)))}if(c&&c.code!=="EEXIST"&&c.code!=="EROFS"){throw s}return a.statAsync(e).then((e=>{if(e.isDirectory()){return o}else{throw s}}),(()=>{throw s}))}))}),{sync:mkdirp_manual_mkdirpManualSync});const findMade=async(e,s,o)=>{if(o===s){return}return e.statAsync(s).then((e=>e.isDirectory()?o:undefined),(o=>{const a=o;return a&&a.code==="ENOENT"?findMade(e,(0,lt.dirname)(s),s):undefined}))};const findMadeSync=(e,s,o)=>{if(o===s){return undefined}try{return e.statSync(s).isDirectory()?o:undefined}catch(o){const a=o;return a&&a.code==="ENOENT"?findMadeSync(e,(0,lt.dirname)(s),s):undefined}};const mkdirp_native_mkdirpNativeSync=(e,s)=>{const o=optsArg(s);o.recursive=true;const a=(0,lt.dirname)(e);if(a===e){return o.mkdirSync(e,o)}const l=findMadeSync(o,e);try{o.mkdirSync(e,o);return l}catch(s){const a=s;if(a&&a.code==="ENOENT"){return mkdirp_manual_mkdirpManualSync(e,o)}else{throw s}}};const zn=Object.assign((async(e,s)=>{const o={...optsArg(s),recursive:true};const a=(0,lt.dirname)(e);if(a===e){return await o.mkdirAsync(e,o)}return findMade(o,e).then((s=>o.mkdirAsync(e,o).then((e=>s||e)).catch((s=>{const a=s;if(a&&a.code==="ENOENT"){return Un(e,o)}else{throw s}}))))}),{sync:mkdirp_native_mkdirpNativeSync});const qn=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform;const pathArg=e=>{if(/\0/.test(e)){throw Object.assign(new TypeError("path must be a string without null bytes"),{path:e,code:"ERR_INVALID_ARG_VALUE"})}e=(0,lt.resolve)(e);if(qn==="win32"){const s=/[*|"<>?:]/;const{root:o}=(0,lt.parse)(e);if(s.test(e.substring(o.length))){throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}}return e};const Gn=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version;const Zn=Gn.replace(/^v/,"").split(".");const Yn=+Zn[0]>10||+Zn[0]===10&&+Zn[1]>=12;const Kn=!Yn?()=>false:e=>optsArg(e).mkdirSync===Bt.mkdirSync;const Xn=Object.assign(!Yn?()=>false:e=>optsArg(e).mkdir===Bt.mkdir,{sync:Kn});const mkdirpSync=(e,s)=>{e=pathArg(e);const o=optsArg(s);return Kn(o)?mkdirp_native_mkdirpNativeSync(e,o):mkdirp_manual_mkdirpManualSync(e,o)};const Jn=null&&mkdirpSync;const Qn=null&&mkdirpManual;const er=null&&mkdirpManualSync;const tr=null&&mkdirpNative;const sr=null&&mkdirpNativeSync;const ir=Object.assign((async(e,s)=>{e=pathArg(e);const o=optsArg(s);return Xn(o)?zn(e,o):Un(e,o)}),{mkdirpSync:mkdirpSync,mkdirpNative:zn,mkdirpNativeSync:mkdirp_native_mkdirpNativeSync,mkdirpManual:Un,mkdirpManualSync:mkdirp_manual_mkdirpManualSync,sync:mkdirpSync,native:zn,nativeSync:mkdirp_native_mkdirpNativeSync,manual:Un,manualSync:mkdirp_manual_mkdirpManualSync,useNative:Xn,useNativeSync:Kn});class CwdError extends Error{path;code;syscall="chdir";constructor(e,s){super(`${s}: Cannot cd into '${e}'`);this.path=e;this.code=s}get name(){return"CwdError"}}class SymlinkError extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,s){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link");this.symlink=e;this.path=s}get name(){return"SymlinkError"}}const cGet=(e,s)=>e.get(ni(s));const cSet=(e,s,o)=>e.set(ni(s),o);const checkCwd=(e,s)=>{Bt.stat(e,((o,a)=>{if(o||!a.isDirectory()){o=new CwdError(e,o?.code||"ENOTDIR")}s(o)}))};const mkdir=(e,s,o)=>{e=ni(e);const a=s.umask??18;const l=s.mode|448;const c=(l&a)!==0;const D=s.uid;const d=s.gid;const g=typeof D==="number"&&typeof d==="number"&&(D!==s.processUid||d!==s.processGid);const y=s.preserve;const C=s.unlink;const F=s.cache;const _=ni(s.cwd);const done=(s,a)=>{if(s){o(s)}else{cSet(F,e,true);if(a&&g){chownr(a,D,d,(e=>done(e)))}else if(c){Bt.chmod(e,l,o)}else{o()}}};if(F&&cGet(F,e)===true){return done()}if(e===_){return checkCwd(e,done)}if(y){return ir(e,{mode:l}).then((e=>done(null,e??undefined)),done)}const w=ni(Ms.relative(_,e));const A=w.split("/");mkdir_(_,A,l,F,C,_,undefined,done)};const mkdir_=(e,s,o,a,l,c,D,d)=>{if(!s.length){return d(null,D)}const g=s.shift();const y=ni(Ms.resolve(e+"/"+g));if(cGet(a,y)){return mkdir_(y,s,o,a,l,c,D,d)}Bt.mkdir(y,o,onmkdir(y,s,o,a,l,c,D,d))};const onmkdir=(e,s,o,a,l,c,D,d)=>g=>{if(g){Bt.lstat(e,((y,C)=>{if(y){y.path=y.path&&ni(y.path);d(y)}else if(C.isDirectory()){mkdir_(e,s,o,a,l,c,D,d)}else if(l){Bt.unlink(e,(g=>{if(g){return d(g)}Bt.mkdir(e,o,onmkdir(e,s,o,a,l,c,D,d))}))}else if(C.isSymbolicLink()){return d(new SymlinkError(e,e+"/"+s.join("/")))}else{d(g)}}))}else{D=D||e;mkdir_(e,s,o,a,l,c,D,d)}};const checkCwdSync=e=>{let s=false;let o=undefined;try{s=Bt.statSync(e).isDirectory()}catch(e){o=e?.code}finally{if(!s){throw new CwdError(e,o??"ENOTDIR")}}};const mkdirSync=(e,s)=>{e=ni(e);const o=s.umask??18;const a=s.mode|448;const l=(a&o)!==0;const c=s.uid;const D=s.gid;const d=typeof c==="number"&&typeof D==="number"&&(c!==s.processUid||D!==s.processGid);const g=s.preserve;const y=s.unlink;const C=s.cache;const F=ni(s.cwd);const done=s=>{cSet(C,e,true);if(s&&d){chownrSync(s,c,D)}if(l){Bt.chmodSync(e,a)}};if(C&&cGet(C,e)===true){return done()}if(e===F){checkCwdSync(F);return done()}if(g){return done(mkdirpSync(e,a)??undefined)}const _=ni(Ms.relative(F,e));const w=_.split("/");let A=undefined;for(let e=w.shift(),s=F;e&&(s+="/"+e);e=w.shift()){s=ni(Ms.resolve(s));if(cGet(C,s)){continue}try{Bt.mkdirSync(s,a);A=A||s;cSet(C,s,true)}catch(e){const o=Bt.lstatSync(s);if(o.isDirectory()){cSet(C,s,true);continue}else if(y){Bt.unlinkSync(s);Bt.mkdirSync(s,a);A=A||s;cSet(C,s,true);continue}else if(o.isSymbolicLink()){return new SymlinkError(s,s+"/"+w.join("/"))}}}return done(A)};const nr=Object.create(null);const{hasOwnProperty:rr}=Object.prototype;const normalizeUnicode=e=>{if(!rr.call(nr,e)){nr[e]=e.normalize("NFD")}return nr[e]};const or=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;const ur=or==="win32";const getDirs=e=>{const s=e.split("/").slice(0,-1).reduce(((e,s)=>{const o=e[e.length-1];if(o!==undefined){s=(0,Ms.join)(o,s)}e.push(s||"/");return e}),[]);return s};class PathReservations{#d=new Map;#f=new Map;#p=new Set;reserve(e,s){e=ur?["win32 parallelization disabled"]:e.map((e=>stripTrailingSlashes((0,Ms.join)(normalizeUnicode(e))).toLowerCase()));const o=new Set(e.map((e=>getDirs(e))).reduce(((e,s)=>e.concat(s))));this.#f.set(s,{dirs:o,paths:e});for(const o of e){const e=this.#d.get(o);if(!e){this.#d.set(o,[s])}else{e.push(s)}}for(const e of o){const o=this.#d.get(e);if(!o){this.#d.set(e,[new Set([s])])}else{const e=o[o.length-1];if(e instanceof Set){e.add(s)}else{o.push(new Set([s]))}}}return this.#m(s)}#g(e){const s=this.#f.get(e);if(!s){throw new Error("function does not have any path reservations")}return{paths:s.paths.map((e=>this.#d.get(e))),dirs:[...s.dirs].map((e=>this.#d.get(e)))}}check(e){const{paths:s,dirs:o}=this.#g(e);return s.every((s=>s&&s[0]===e))&&o.every((s=>s&&s[0]instanceof Set&&s[0].has(e)))}#m(e){if(this.#p.has(e)||!this.check(e)){return false}this.#p.add(e);e((()=>this.#E(e)));return true}#E(e){if(!this.#p.has(e)){return false}const s=this.#f.get(e);if(!s){throw new Error("invalid reservation")}const{paths:o,dirs:a}=s;const l=new Set;for(const s of o){const o=this.#d.get(s);if(!o||o?.[0]!==e){continue}const a=o[1];if(!a){this.#d.delete(s);continue}o.shift();if(typeof a==="function"){l.add(a)}else{for(const e of a){l.add(e)}}}for(const s of a){const o=this.#d.get(s);const a=o?.[0];if(!o||!(a instanceof Set))continue;if(a.size===1&&o.length===1){this.#d.delete(s);continue}else if(a.size===1){o.shift();const e=o[0];if(typeof e==="function"){l.add(e)}}else{a.delete(e)}}this.#p.delete(e);l.forEach((e=>this.#m(e)));return true}}const ar=Symbol("onEntry");const hr=Symbol("checkFs");const lr=Symbol("checkFs2");const cr=Symbol("pruneCache");const Dr=Symbol("isReusable");const dr=Symbol("makeFs");const fr=Symbol("file");const pr=Symbol("directory");const mr=Symbol("link");const gr=Symbol("symlink");const Er=Symbol("hardlink");const yr=Symbol("unsupported");const Cr=Symbol("checkPath");const Fr=Symbol("mkdir");const br=Symbol("onError");const _r=Symbol("pending");const wr=Symbol("pend");const vr=Symbol("unpend");const Or=Symbol("ended");const Ar=Symbol("maybeClose");const Sr=Symbol("skip");const Br=Symbol("doChown");const kr=Symbol("uid");const Rr=Symbol("gid");const xr=Symbol("checkedCwd");const $r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;const Tr=$r==="win32";const Nr=1024;const unlinkFile=(e,s)=>{if(!Tr){return js.unlink(e,s)}const o=e+".DELETE."+(0,$n.randomBytes)(16).toString("hex");js.rename(e,o,(e=>{if(e){return s(e)}js.unlink(o,s)}))};const unlinkFileSync=e=>{if(!Tr){return js.unlinkSync(e)}const s=e+".DELETE."+(0,$n.randomBytes)(16).toString("hex");js.renameSync(e,s);js.unlinkSync(s)};const uint32=(e,s,o)=>e!==undefined&&e===e>>>0?e:s!==undefined&&s===s>>>0?s:o;const cacheKeyNormalize=e=>stripTrailingSlashes(ni(normalizeUnicode(e))).toLowerCase();const pruneCache=(e,s)=>{s=cacheKeyNormalize(s);for(const o of e.keys()){const a=cacheKeyNormalize(o);if(a===s||a.indexOf(s+"/")===0){e.delete(o)}}};const dropCache=e=>{for(const s of e.keys()){e.delete(s)}};class Unpack extends Parser{[Or]=false;[xr]=false;[_r]=0;reservations=new PathReservations;transform;writable=true;readable=false;dirCache;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(e={}){e.ondone=()=>{this[Or]=true;this[Ar]()};super(e);this.transform=e.transform;this.dirCache=e.dirCache||new Map;this.chmod=!!e.chmod;if(typeof e.uid==="number"||typeof e.gid==="number"){if(typeof e.uid!=="number"||typeof e.gid!=="number"){throw new TypeError("cannot set owner without number uid and gid")}if(e.preserveOwner){throw new TypeError("cannot preserve owner in archive and also set owner explicitly")}this.uid=e.uid;this.gid=e.gid;this.setOwner=true}else{this.uid=undefined;this.gid=undefined;this.setOwner=false}if(e.preserveOwner===undefined&&typeof e.uid!=="number"){this.preserveOwner=!!(process.getuid&&process.getuid()===0)}else{this.preserveOwner=!!e.preserveOwner}this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():undefined;this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():undefined;this.maxDepth=typeof e.maxDepth==="number"?e.maxDepth:Nr;this.forceChown=e.forceChown===true;this.win32=!!e.win32||Tr;this.newer=!!e.newer;this.keep=!!e.keep;this.noMtime=!!e.noMtime;this.preservePaths=!!e.preservePaths;this.unlink=!!e.unlink;this.cwd=ni(Ms.resolve(e.cwd||process.cwd()));this.strip=Number(e.strip)||0;this.processUmask=!this.chmod?0:typeof e.processUmask==="number"?e.processUmask:process.umask();this.umask=typeof e.umask==="number"?e.umask:this.processUmask;this.dmode=e.dmode||511&~this.umask;this.fmode=e.fmode||438&~this.umask;this.on("entry",(e=>this[ar](e)))}warn(e,s,o={}){if(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT"){o.recoverable=false}return super.warn(e,s,o)}[Ar](){if(this[Or]&&this[_r]===0){this.emit("prefinish");this.emit("finish");this.emit("end")}}[Cr](e){const s=ni(e.path);const o=s.split("/");if(this.strip){if(o.length<this.strip){return false}if(e.type==="Link"){const s=ni(String(e.linkpath)).split("/");if(s.length>=this.strip){e.linkpath=s.slice(this.strip).join("/")}else{return false}}o.splice(0,this.strip);e.path=o.join("/")}if(isFinite(this.maxDepth)&&o.length>this.maxDepth){this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:s,depth:o.length,maxDepth:this.maxDepth});return false}if(!this.preservePaths){if(o.includes("..")||Tr&&/^[a-z]:\.\.$/i.test(o[0]??"")){this.warn("TAR_ENTRY_ERROR",`path contains '..'`,{entry:e,path:s});return false}const[a,l]=stripAbsolutePath(s);if(a){e.path=String(l);this.warn("TAR_ENTRY_INFO",`stripping ${a} from absolute path`,{entry:e,path:s})}}if(Ms.isAbsolute(e.path)){e.absolute=ni(Ms.resolve(e.path))}else{e.absolute=ni(Ms.resolve(this.cwd,e.path))}if(!this.preservePaths&&typeof e.absolute==="string"&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd){this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:ni(e.path),resolvedPath:e.absolute,cwd:this.cwd});return false}if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir"){return false}if(this.win32){const{root:s}=Ms.win32.parse(String(e.absolute));e.absolute=s+winchars_encode(String(e.absolute).slice(s.length));const{root:o}=Ms.win32.parse(e.path);e.path=o+winchars_encode(e.path.slice(o.length))}return true}[ar](e){if(!this[Cr](e)){return e.resume()}xn.equal(typeof e.absolute,"string");switch(e.type){case"Directory":case"GNUDumpDir":if(e.mode){e.mode=e.mode|448}case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[hr](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[yr](e)}}[br](e,s){if(e.name==="CwdError"){this.emit("error",e)}else{this.warn("TAR_ENTRY_ERROR",e,{entry:s});this[vr]();s.resume()}}[Fr](e,s,o){mkdir(ni(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:s},o)}[Br](e){return this.forceChown||this.preserveOwner&&(typeof e.uid==="number"&&e.uid!==this.processUid||typeof e.gid==="number"&&e.gid!==this.processGid)||typeof this.uid==="number"&&this.uid!==this.processUid||typeof this.gid==="number"&&this.gid!==this.processGid}[kr](e){return uint32(this.uid,e.uid,this.processUid)}[Rr](e){return uint32(this.gid,e.gid,this.processGid)}[fr](e,s){const o=typeof e.mode==="number"?e.mode&4095:this.fmode;const a=new WriteStream(String(e.absolute),{flags:Wn(e.size),mode:o,autoClose:false});a.on("error",(o=>{if(a.fd){js.close(a.fd,(()=>{}))}a.write=()=>true;this[br](o,e);s()}));let l=1;const done=o=>{if(o){if(a.fd){js.close(a.fd,(()=>{}))}this[br](o,e);s();return}if(--l===0){if(a.fd!==undefined){js.close(a.fd,(o=>{if(o){this[br](o,e)}else{this[vr]()}s()}))}}};a.on("finish",(()=>{const s=String(e.absolute);const o=a.fd;if(typeof o==="number"&&e.mtime&&!this.noMtime){l++;const a=e.atime||new Date;const c=e.mtime;js.futimes(o,a,c,(e=>e?js.utimes(s,a,c,(s=>done(s&&e))):done()))}if(typeof o==="number"&&this[Br](e)){l++;const a=this[kr](e);const c=this[Rr](e);if(typeof a==="number"&&typeof c==="number"){js.fchown(o,a,c,(e=>e?js.chown(s,a,c,(s=>done(s&&e))):done()))}}done()}));const c=this.transform?this.transform(e)||e:e;if(c!==e){c.on("error",(o=>{this[br](o,e);s()}));e.pipe(c)}c.pipe(a)}[pr](e,s){const o=typeof e.mode==="number"?e.mode&4095:this.dmode;this[Fr](String(e.absolute),o,(o=>{if(o){this[br](o,e);s();return}let a=1;const done=()=>{if(--a===0){s();this[vr]();e.resume()}};if(e.mtime&&!this.noMtime){a++;js.utimes(String(e.absolute),e.atime||new Date,e.mtime,done)}if(this[Br](e)){a++;js.chown(String(e.absolute),Number(this[kr](e)),Number(this[Rr](e)),done)}done()}))}[yr](e){e.unsupported=true;this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e});e.resume()}[gr](e,s){this[mr](e,String(e.linkpath),"symlink",s)}[Er](e,s){const o=ni(Ms.resolve(this.cwd,String(e.linkpath)));this[mr](e,o,"link",s)}[wr](){this[_r]++}[vr](){this[_r]--;this[Ar]()}[Sr](e){this[vr]();e.resume()}[Dr](e,s){return e.type==="File"&&!this.unlink&&s.isFile()&&s.nlink<=1&&!Tr}[hr](e){this[wr]();const s=[e.path];if(e.linkpath){s.push(e.linkpath)}this.reservations.reserve(s,(s=>this[lr](e,s)))}[cr](e){if(e.type==="SymbolicLink"){dropCache(this.dirCache)}else if(e.type!=="Directory"){pruneCache(this.dirCache,String(e.absolute))}}[lr](e,s){this[cr](e);const done=o=>{this[cr](e);s(o)};const checkCwd=()=>{this[Fr](this.cwd,this.dmode,(s=>{if(s){this[br](s,e);done();return}this[xr]=true;start()}))};const start=()=>{if(e.absolute!==this.cwd){const s=ni(Ms.dirname(String(e.absolute)));if(s!==this.cwd){return this[Fr](s,this.dmode,(s=>{if(s){this[br](s,e);done();return}afterMakeParent()}))}}afterMakeParent()};const afterMakeParent=()=>{js.lstat(String(e.absolute),((s,o)=>{if(o&&(this.keep||this.newer&&o.mtime>(e.mtime??o.mtime))){this[Sr](e);done();return}if(s||this[Dr](e,o)){return this[dr](null,e,done)}if(o.isDirectory()){if(e.type==="Directory"){const s=this.chmod&&e.mode&&(o.mode&4095)!==e.mode;const afterChmod=s=>this[dr](s??null,e,done);if(!s){return afterChmod()}return js.chmod(String(e.absolute),Number(e.mode),afterChmod)}if(e.absolute!==this.cwd){return js.rmdir(String(e.absolute),(s=>this[dr](s??null,e,done)))}}if(e.absolute===this.cwd){return this[dr](null,e,done)}unlinkFile(String(e.absolute),(s=>this[dr](s??null,e,done)))}))};if(this[xr]){start()}else{checkCwd()}}[dr](e,s,o){if(e){this[br](e,s);o();return}switch(s.type){case"File":case"OldFile":case"ContiguousFile":return this[fr](s,o);case"Link":return this[Er](s,o);case"SymbolicLink":return this[gr](s,o);case"Directory":case"GNUDumpDir":return this[pr](s,o)}}[mr](e,s,o,a){js[o](s,String(e.absolute),(s=>{if(s){this[br](s,e)}else{this[vr]();e.resume()}a()}))}}const callSync=e=>{try{return[null,e()]}catch(e){return[e,null]}};class UnpackSync extends Unpack{sync=true;[dr](e,s){return super[dr](e,s,(()=>{}))}[hr](e){this[cr](e);if(!this[xr]){const s=this[Fr](this.cwd,this.dmode);if(s){return this[br](s,e)}this[xr]=true}if(e.absolute!==this.cwd){const s=ni(Ms.dirname(String(e.absolute)));if(s!==this.cwd){const o=this[Fr](s,this.dmode);if(o){return this[br](o,e)}}}const[s,o]=callSync((()=>js.lstatSync(String(e.absolute))));if(o&&(this.keep||this.newer&&o.mtime>(e.mtime??o.mtime))){return this[Sr](e)}if(s||this[Dr](e,o)){return this[dr](null,e)}if(o.isDirectory()){if(e.type==="Directory"){const s=this.chmod&&e.mode&&(o.mode&4095)!==e.mode;const[a]=s?callSync((()=>{js.chmodSync(String(e.absolute),Number(e.mode))})):[];return this[dr](a,e)}const[s]=callSync((()=>js.rmdirSync(String(e.absolute))));this[dr](s,e)}const[a]=e.absolute===this.cwd?[]:callSync((()=>unlinkFileSync(String(e.absolute))));this[dr](a,e)}[fr](e,s){const o=typeof e.mode==="number"?e.mode&4095:this.fmode;const oner=o=>{let l;try{js.closeSync(a)}catch(e){l=e}if(o||l){this[br](o||l,e)}s()};let a;try{a=js.openSync(String(e.absolute),Wn(e.size),o)}catch(e){return oner(e)}const l=this.transform?this.transform(e)||e:e;if(l!==e){l.on("error",(s=>this[br](s,e)));e.pipe(l)}l.on("data",(e=>{try{js.writeSync(a,e,0,e.length)}catch(e){oner(e)}}));l.on("end",(()=>{let s=null;if(e.mtime&&!this.noMtime){const o=e.atime||new Date;const l=e.mtime;try{js.futimesSync(a,o,l)}catch(a){try{js.utimesSync(String(e.absolute),o,l)}catch(e){s=a}}}if(this[Br](e)){const o=this[kr](e);const l=this[Rr](e);try{js.fchownSync(a,Number(o),Number(l))}catch(a){try{js.chownSync(String(e.absolute),Number(o),Number(l))}catch(e){s=s||a}}}oner(s)}))}[pr](e,s){const o=typeof e.mode==="number"?e.mode&4095:this.dmode;const a=this[Fr](String(e.absolute),o);if(a){this[br](a,e);s();return}if(e.mtime&&!this.noMtime){try{js.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch(a){}}if(this[Br](e)){try{js.chownSync(String(e.absolute),Number(this[kr](e)),Number(this[Rr](e)))}catch(a){}}s();e.resume()}[Fr](e,s){try{return mkdirSync(ni(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:s})}catch(e){return e}}[mr](e,s,o,a){const l=`${o}Sync`;try{js[l](s,String(e.absolute));a();e.resume()}catch(s){return this[br](s,e)}}}const extractFileSync=e=>{const s=new UnpackSync(e);const o=e.file;const a=js.statSync(o);const l=e.maxReadSize||16*1024*1024;const c=new ReadStreamSync(o,{readSize:l,size:a.size});c.pipe(s)};const extractFile=(e,s)=>{const o=new Unpack(e);const a=e.maxReadSize||16*1024*1024;const l=e.file;const c=new Promise(((e,s)=>{o.on("error",s);o.on("close",e);js.stat(l,((e,c)=>{if(e){s(e)}else{const e=new ReadStream(l,{readSize:a,size:c.size});e.on("error",s);e.pipe(o)}}))}));return c};const Ir=makeCommand(extractFileSync,extractFile,(e=>new UnpackSync(e)),(e=>new Unpack(e)),((e,s)=>{if(s?.length)filesFilter(e,s)}));const replaceSync=(e,s)=>{const o=new PackSync(e);let a=true;let l;let c;try{try{l=js.openSync(e.file,"r+")}catch(s){if(s?.code==="ENOENT"){l=js.openSync(e.file,"w+")}else{throw s}}const D=js.fstatSync(l);const d=Buffer.alloc(512);e:for(c=0;c<D.size;c+=512){for(let e=0,s=0;e<512;e+=s){s=js.readSync(l,d,e,d.length-e,c+e);if(c===0&&d[0]===31&&d[1]===139){throw new Error("cannot append to compressed archives")}if(!s){break e}}const s=new Header(d);if(!s.cksumValid){break}const o=512*Math.ceil((s.size||0)/512);if(c+o+512>D.size){break}c+=o;if(e.mtimeCache&&s.mtime){e.mtimeCache.set(String(s.path),s.mtime)}}a=false;streamSync(e,o,c,l,s)}finally{if(a){try{js.closeSync(l)}catch(e){}}}};const streamSync=(e,s,o,a,l)=>{const c=new WriteStreamSync(e.file,{fd:a,start:o});s.pipe(c);replace_addFilesSync(s,l)};const replaceAsync=(e,s)=>{s=Array.from(s);const o=new Pack(e);const getPos=(s,o,a)=>{const cb=(e,o)=>{if(e){js.close(s,(s=>a(e)))}else{a(null,o)}};let l=0;if(o===0){return cb(null,0)}let c=0;const D=Buffer.alloc(512);const onread=(a,d)=>{if(a||typeof d==="undefined"){return cb(a)}c+=d;if(c<512&&d){return js.read(s,D,c,D.length-c,l+c,onread)}if(l===0&&D[0]===31&&D[1]===139){return cb(new Error("cannot append to compressed archives"))}if(c<512){return cb(null,l)}const g=new Header(D);if(!g.cksumValid){return cb(null,l)}const y=512*Math.ceil((g.size??0)/512);if(l+y+512>o){return cb(null,l)}l+=y+512;if(l>=o){return cb(null,l)}if(e.mtimeCache&&g.mtime){e.mtimeCache.set(String(g.path),g.mtime)}c=0;js.read(s,D,0,512,l,onread)};js.read(s,D,0,512,l,onread)};const a=new Promise(((a,l)=>{o.on("error",l);let c="r+";const onopen=(D,d)=>{if(D&&D.code==="ENOENT"&&c==="r+"){c="w+";return js.open(e.file,c,onopen)}if(D||!d){return l(D)}js.fstat(d,((c,D)=>{if(c){return js.close(d,(()=>l(c)))}getPos(d,D.size,((c,D)=>{if(c){return l(c)}const g=new WriteStream(e.file,{fd:d,start:D});o.pipe(g);g.on("error",l);g.on("close",a);replace_addFilesAsync(o,s)}))}))};js.open(e.file,c,onopen)}));return a};const replace_addFilesSync=(e,s)=>{s.forEach((s=>{if(s.charAt(0)==="@"){Li({file:Ms.resolve(e.cwd,s.slice(1)),sync:true,noResume:true,onReadEntry:s=>e.add(s)})}else{e.add(s)}}));e.end()};const replace_addFilesAsync=async(e,s)=>{for(let o=0;o<s.length;o++){const a=String(s[o]);if(a.charAt(0)==="@"){await Li({file:Ms.resolve(String(e.cwd),a.slice(1)),noResume:true,onReadEntry:s=>e.add(s)})}else{e.add(a)}}e.end()};const Lr=makeCommand(replaceSync,replaceAsync,(()=>{throw new TypeError("file is required")}),(()=>{throw new TypeError("file is required")}),((e,s)=>{if(!isFile(e)){throw new TypeError("file is required")}if(e.gzip||e.brotli||e.file.endsWith(".br")||e.file.endsWith(".tbr")){throw new TypeError("cannot append to compressed archives")}if(!s?.length){throw new TypeError("no paths specified to add/replace")}}));const Pr=makeCommand(Lr.syncFile,Lr.asyncFile,Lr.syncNoFile,Lr.asyncNoFile,((e,s=[])=>{Lr.validate?.(e,s);mtimeFilter(e)}));const mtimeFilter=e=>{const s=e.filter;if(!e.mtimeCache){e.mtimeCache=new Map}e.filter=s?(o,a)=>s(o,a)&&!((e.mtimeCache?.get(o)??a.mtime??0)>(a.mtime??0)):(s,o)=>!((e.mtimeCache?.get(s)??o.mtime??0)>(o.mtime??0))};const getGithubRepo=()=>fetch("https://github.com//rabani-to/world/archive/refs/heads/master.tar.gz");const extractRepoFiles=async e=>{try{const s=await new Promise((e=>{const s=ct().join(Ot().tmpdir(),"repo-cloned-");o().mkdtemp(s).then(e)}));const a=await(await e).arrayBuffer();const l=At.Readable.from(Buffer.from(a));const c=await new Promise((e=>{l.pipe(Ir({strip:1,cwd:s})).on("error",(()=>e(null))).on("close",(()=>e(s)))}));return c}catch(e){}return null};const terminateWithError=e=>{Se(y().red(`❌ ${e}`));process.exit(1)};function getPKGManager(){const e=process.env.npm_config_user_agent||"";if(e.startsWith("yarn"))return"yarn";if(e.startsWith("pnpm"))return"pnpm";if(e.startsWith("bun"))return"bun";return"npm"}var Mr=__nccwpck_require__(422);var jr=__nccwpck_require__.n(Mr);async function install(e){const s=["install"];return new Promise(((o,a)=>{const l=jr()(e,s,{stdio:["ignore","pipe","pipe"],env:{...process.env,ADBLOCK:"1",NODE_ENV:"development",DISABLE_OPENCOLLECTIVE:"1"}});l.on("close",(l=>{if(l!==0){a({command:`${e} ${s.join(" ")}`});return}o()}))}))}const Hr="next14";const Vr={[Hr]:"template-next-14",next15:"template-next-15"};const getTemplateFolder=e=>{const s=Vr[e];return s||Hr};const handleSigTerm=()=>process.exit(0);process.on("SIGINT",handleSigTerm);process.on("SIGTERM",handleSigTerm);const Wr=new Ct;const Ur=getGithubRepo();Wr.name("create-world-app").description("Scaffold world mini-apps faster").argument("[name]","Project name").version(wt.rE,"-v, --version","Show package version").option("--template <template>","Template to use (next14, next15)").action((async(e,s)=>{Ie("Let's create your mini app");if(!e){e=await he({message:"Project name",placeholder:"my-app"});if(!e){return terminateWithError("Project name is required")}}if(typeof e!=="string"){return terminateWithError("Invalid project name")}const a=await extractRepoFiles(Ur);if(!a)return terminateWithError("Failed to extract repo files");let l=s.template;if(!l){l=await ve({message:"Select a template",options:[{value:"next14",label:"Next 14",hint:"recommended"},{value:"next15",label:"Next 15"}]})}if(typeof l!=="string"){return terminateWithError("Aborted: Invalid template")}const c=getTemplateFolder(l);const D=ct().join(a,"packages/",c);const d=ct().join(process.cwd(),e);await o().mkdir(d,{recursive:true});await o().cp(D,d,{recursive:true,force:true});const g=getPKGManager();process.chdir(d);ut.step(`Using ${y().bold(g)}`);await Te([{title:`🚀 Creating project: ${y().green(e)}`,task:async()=>{await install(g)}}]);Se(y().greenBright(`Project created successfully!`))})).allowUnknownOption().parse(process.argv)})();module.exports=a})();