diff --git a/changelog.md b/changelog.md index 98ed222..4a68f89 100644 --- a/changelog.md +++ b/changelog.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) -## [Unreleased] +## [0.1.2] - 2022/09/20 ### Fixed @@ -30,5 +30,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Init webpack build - Init linter +[0.1.2]: https://github.com/ditrit/leto-modelizer-plugin-cli/blob/0.1.2/changelog.md [0.1.1]: https://github.com/ditrit/leto-modelizer-plugin-cli/blob/0.1.1/changelog.md [0.1.0]: https://github.com/ditrit/leto-modelizer-plugin-cli/blob/0.1.0/changelog.md diff --git a/dist/leto-modelizer-plugin-cli.js b/dist/leto-modelizer-plugin-cli.js index c83cc95..beac1a2 100644 --- a/dist/leto-modelizer-plugin-cli.js +++ b/dist/leto-modelizer-plugin-cli.js @@ -1,2 +1,2 @@ /*! For license information please see leto-modelizer-plugin-cli.js.LICENSE.txt */ -(()=>{var t={652:(t,e,i)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function s(){"use strict";s=function(){return t};var t={},e=Object.prototype,i=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",h=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function l(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,i){return t[e]=i}}function u(t,e,i,r){var s=e&&e.prototype instanceof p?e:p,n=Object.create(s.prototype),o=new C(r||[]);return n._invoke=function(t,e,i){var r="suspendedStart";return function(s,n){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===s)throw n;return{value:void 0,done:!0}}for(i.method=s,i.arg=n;;){var o=i.delegate;if(o){var h=_(o,i);if(h){if(h===d)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===r)throw r="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r="executing";var a=c(t,e,i);if("normal"===a.type){if(r=i.done?"completed":"suspendedYield",a.arg===d)continue;return{value:a.arg,done:i.done}}"throw"===a.type&&(r="completed",i.method="throw",i.arg=a.arg)}}}(t,i,o),n}function c(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var d={};function p(){}function m(){}function g(){}var f={};l(f,o,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(k([])));b&&b!==e&&i.call(b,o)&&(f=b);var y=g.prototype=p.prototype=Object.create(f);function w(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function s(n,o,h,a){var l=c(t[n],t,o);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==r(d)&&i.call(d,"__await")?e.resolve(d.__await).then((function(t){s("next",t,h,a)}),(function(t){s("throw",t,h,a)})):e.resolve(d).then((function(t){u.value=t,h(u)}),(function(t){return s("throw",t,h,a)}))}a(l.arg)}var n;this._invoke=function(t,i){function r(){return new e((function(e,r){s(t,i,e,r)}))}return n=n?n.then(r,r):r()}}function _(t,e){var i=t.iterator[e.method];if(void 0===i){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=c(i,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,d;var s=r.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function k(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,s=function e(){for(;++r=0;--s){var n=this.tryEntries[s],o=n.completion;if("root"===n.tryLoc)return r("end");if(n.tryLoc<=this.prev){var h=i.call(n,"catchLoc"),a=i.call(n,"finallyLoc");if(h&&a){if(this.prev=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),S(i),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var s=r.arg;S(i)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:k(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=void 0),d}},t}function n(t,e,i,r,s,n,o){try{var h=t[n](o),a=h.value}catch(t){return void i(t)}h.done?e(a):Promise.resolve(a).then(r,s)}function o(t){return function(){var e=this,i=arguments;return new Promise((function(r,s){var o=t.apply(e,i);function h(t){n(o,r,s,h,a,"next",t)}function a(t){n(o,r,s,h,a,"throw",t)}h(void 0)}))}}var h=i(4061),a=i(7147);function l(t){return t.replaceAll(/(-.)/gi,(function(t){return t.replace("-","").toUpperCase()}))}e.setup=function(t){t.command("init").description("Init plugin files").action(o(s().mark((function t(){var e,i,r,n;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=[],!a.existsSync("plugin.config.json")){t.next=6;break}i=JSON.parse(a.readFileSync("plugin.config.json","utf8")),e=e.concat(i.plugins),t.next=8;break;case 6:return console.log("\n".concat(h.red("✘")," plugin.config.json file was not found. Use 'cli install' to create it.\n")),t.abrupt("return");case 8:e.forEach((function(t){var e="./node_modules/".concat(t,"/public/"),i="./public/plugins/".concat(l(t),"/");a.existsSync(e)?(a.cpSync(e,i,{recursive:!0}),console.log("\n".concat(h.green("✔")," Plugin '").concat(t,"': Icons and models are imported."))):console.log("\n".concat(h.red("✘")," Plugin '").concat(t,"': No icons and models are imported."))})),e.length>0&&(r=e.map((function(t){return"import ".concat(l(t)," from '").concat(t,"';")})),n=[r.join("\n"),"\nexport default {",e.map((function(t){return"".concat(l(t),",")})).join("\n"),"};"].join("\n"),a.existsSync("src/plugins")||a.mkdirSync("src/plugins"),a.writeFileSync("src/plugins/index.js",n),console.log("\n".concat(h.green("✔")," 'src/plugins/index.js' has been created or updated.\n")));case 10:case"end":return t.stop()}}),t)}))))}},6460:(t,e,i)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function s(){"use strict";s=function(){return t};var t={},e=Object.prototype,i=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",h=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function l(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,i){return t[e]=i}}function u(t,e,i,r){var s=e&&e.prototype instanceof p?e:p,n=Object.create(s.prototype),o=new C(r||[]);return n._invoke=function(t,e,i){var r="suspendedStart";return function(s,n){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===s)throw n;return{value:void 0,done:!0}}for(i.method=s,i.arg=n;;){var o=i.delegate;if(o){var h=_(o,i);if(h){if(h===d)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===r)throw r="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r="executing";var a=c(t,e,i);if("normal"===a.type){if(r=i.done?"completed":"suspendedYield",a.arg===d)continue;return{value:a.arg,done:i.done}}"throw"===a.type&&(r="completed",i.method="throw",i.arg=a.arg)}}}(t,i,o),n}function c(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var d={};function p(){}function m(){}function g(){}var f={};l(f,o,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(k([])));b&&b!==e&&i.call(b,o)&&(f=b);var y=g.prototype=p.prototype=Object.create(f);function w(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function s(n,o,h,a){var l=c(t[n],t,o);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==r(d)&&i.call(d,"__await")?e.resolve(d.__await).then((function(t){s("next",t,h,a)}),(function(t){s("throw",t,h,a)})):e.resolve(d).then((function(t){u.value=t,h(u)}),(function(t){return s("throw",t,h,a)}))}a(l.arg)}var n;this._invoke=function(t,i){function r(){return new e((function(e,r){s(t,i,e,r)}))}return n=n?n.then(r,r):r()}}function _(t,e){var i=t.iterator[e.method];if(void 0===i){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=c(i,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,d;var s=r.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function k(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,s=function e(){for(;++r=0;--s){var n=this.tryEntries[s],o=n.completion;if("root"===n.tryLoc)return r("end");if(n.tryLoc<=this.prev){var h=i.call(n,"catchLoc"),a=i.call(n,"finallyLoc");if(h&&a){if(this.prev=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),S(i),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var s=r.arg;S(i)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:k(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=void 0),d}},t}function n(t,e,i,r,s,n,o){try{var h=t[n](o),a=h.value}catch(t){return void i(t)}h.done?e(a):Promise.resolve(a).then(r,s)}function o(t){return function(){var e=this,i=arguments;return new Promise((function(r,s){var o=t.apply(e,i);function h(t){n(o,r,s,h,a,"next",t)}function a(t){n(o,r,s,h,a,"throw",t)}h(void 0)}))}}var h=i(4061),a=i(7147),l=i(7718).execSync,u=i(5358);e.setup=function(t){t.command("install").description("Install plugin in leto-modelizer").action(o(s().mark((function t(){var e,i,r,n,o,c,d;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.getName();case 2:return e=t.sent,i=e.pluginName,t.next=6,u.getRepositoryUrl();case 6:if(r=t.sent,n=r.repositoryUrl,console.log("\n".concat(h.blue.bold("⚒")," Installing plugin via npm...")),l('npm install -s "'.concat(n,'"')),console.log("\n".concat(h.green("✔")," Installation succeed !")),o=JSON.parse(a.readFileSync("package.json","utf8")),Object.keys(o.dependencies).includes(i)){t.next=16;break}return console.log("\n".concat(h.red("✘")," Could not find plugin name in package.json dependencies")),t.abrupt("return");case 16:c={plugins:[i]},a.existsSync("plugin.config.json")&&((d=JSON.parse(a.readFileSync("plugin.config.json","utf8"))).plugins.includes(i)?c.plugins=d.plugins:c.plugins=c.plugins.concat(d.plugins)),a.writeFileSync("plugin.config.json",JSON.stringify(c,null,2)),console.log("\n".concat(h.yellow("⚠")," If you have install all your plugin, please ").concat(h.bold("'npm run plugin:init'"),".\n"));case 20:case"end":return t.stop()}}),t)}))))}},1307:(t,e,i)=>{var r=i(6460),s=i(652);t.exports={install:r,init:s}},5358:(t,e,i)=>{var r=i(8809);e.getName=function(){return r({type:"text",name:"pluginName",message:"What is your plugin name?",validate:function(t){return/^[a-zA-Z\s-]+$/.test(t)||"Plugin name must be only letters, spaces, or dashes"}})},e.getRepositoryUrl=function(){return r({type:"text",name:"repositoryUrl",message:"What is your git repository url?",validate:function(t){return/^(?:git@|http:\/\/|https:\/\/).+\.git$/.test(t)||'Invalid repository url, must be like "git@github.com/repository.git" or "http(s)://github.com/repository.git"'}})}},6064:(t,e,i)=>{"use strict";t=i.nmd(t);const r=(t,e)=>(...i)=>`[${t(...i)+e}m`,s=(t,e)=>(...i)=>{const r=t(...i);return`[${38+e};5;${r}m`},n=(t,e)=>(...i)=>{const r=t(...i);return`[${38+e};2;${r[0]};${r[1]};${r[2]}m`},o=t=>t,h=(t,e,i)=>[t,e,i],a=(t,e,i)=>{Object.defineProperty(t,e,{get:()=>{const r=i();return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})};let l;const u=(t,e,r,s)=>{void 0===l&&(l=i(1621));const n=s?10:0,o={};for(const[i,s]of Object.entries(l)){const h="ansi16"===i?"ansi":i;i===e?o[h]=t(r,n):"object"==typeof s&&(o[h]=t(s[e],n))}return o};Object.defineProperty(t,"exports",{enumerable:!0,get:function(){const t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(const[i,r]of Object.entries(e)){for(const[i,s]of Object.entries(r))e[i]={open:`[${s[0]}m`,close:`[${s[1]}m`},r[i]=e[i],t.set(s[0],s[1]);Object.defineProperty(e,i,{value:r,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="",e.bgColor.close="",a(e.color,"ansi",(()=>u(r,"ansi16",o,!1))),a(e.color,"ansi256",(()=>u(s,"ansi256",o,!1))),a(e.color,"ansi16m",(()=>u(n,"rgb",h,!1))),a(e.bgColor,"ansi",(()=>u(r,"ansi16",o,!0))),a(e.bgColor,"ansi256",(()=>u(s,"ansi256",o,!0))),a(e.bgColor,"ansi16m",(()=>u(n,"rgb",h,!0))),e}})},3583:(t,e,i)=>{const r=i(6771),s={};for(const t of Object.keys(r))s[r[t]]=t;const n={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};t.exports=n;for(const t of Object.keys(n)){if(!("channels"in n[t]))throw new Error("missing channels property: "+t);if(!("labels"in n[t]))throw new Error("missing channel labels property: "+t);if(n[t].labels.length!==n[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:i}=n[t];delete n[t].channels,delete n[t].labels,Object.defineProperty(n[t],"channels",{value:e}),Object.defineProperty(n[t],"labels",{value:i})}n.rgb.hsl=function(t){const e=t[0]/255,i=t[1]/255,r=t[2]/255,s=Math.min(e,i,r),n=Math.max(e,i,r),o=n-s;let h,a;n===s?h=0:e===n?h=(i-r)/o:i===n?h=2+(r-e)/o:r===n&&(h=4+(e-i)/o),h=Math.min(60*h,360),h<0&&(h+=360);const l=(s+n)/2;return a=n===s?0:l<=.5?o/(n+s):o/(2-n-s),[h,100*a,100*l]},n.rgb.hsv=function(t){let e,i,r,s,n;const o=t[0]/255,h=t[1]/255,a=t[2]/255,l=Math.max(o,h,a),u=l-Math.min(o,h,a),c=function(t){return(l-t)/6/u+.5};return 0===u?(s=0,n=0):(n=u/l,e=c(o),i=c(h),r=c(a),o===l?s=r-i:h===l?s=1/3+e-r:a===l&&(s=2/3+i-e),s<0?s+=1:s>1&&(s-=1)),[360*s,100*n,100*l]},n.rgb.hwb=function(t){const e=t[0],i=t[1];let r=t[2];const s=n.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(i,r));return r=1-1/255*Math.max(e,Math.max(i,r)),[s,100*o,100*r]},n.rgb.cmyk=function(t){const e=t[0]/255,i=t[1]/255,r=t[2]/255,s=Math.min(1-e,1-i,1-r);return[100*((1-e-s)/(1-s)||0),100*((1-i-s)/(1-s)||0),100*((1-r-s)/(1-s)||0),100*s]},n.rgb.keyword=function(t){const e=s[t];if(e)return e;let i,n=1/0;for(const e of Object.keys(r)){const s=(h=r[e],((o=t)[0]-h[0])**2+(o[1]-h[1])**2+(o[2]-h[2])**2);s.04045?((e+.055)/1.055)**2.4:e/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,[100*(.4124*e+.3576*i+.1805*r),100*(.2126*e+.7152*i+.0722*r),100*(.0193*e+.1192*i+.9505*r)]},n.rgb.lab=function(t){const e=n.rgb.xyz(t);let i=e[0],r=e[1],s=e[2];return i/=95.047,r/=100,s/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,s=s>.008856?s**(1/3):7.787*s+16/116,[116*r-16,500*(i-r),200*(r-s)]},n.hsl.rgb=function(t){const e=t[0]/360,i=t[1]/100,r=t[2]/100;let s,n,o;if(0===i)return o=255*r,[o,o,o];s=r<.5?r*(1+i):r+i-r*i;const h=2*r-s,a=[0,0,0];for(let t=0;t<3;t++)n=e+1/3*-(t-1),n<0&&n++,n>1&&n--,o=6*n<1?h+6*(s-h)*n:2*n<1?s:3*n<2?h+(s-h)*(2/3-n)*6:h,a[t]=255*o;return a},n.hsl.hsv=function(t){const e=t[0];let i=t[1]/100,r=t[2]/100,s=i;const n=Math.max(r,.01);return r*=2,i*=r<=1?r:2-r,s*=n<=1?n:2-n,[e,100*(0===r?2*s/(n+s):2*i/(r+i)),(r+i)/2*100]},n.hsv.rgb=function(t){const e=t[0]/60,i=t[1]/100;let r=t[2]/100;const s=Math.floor(e)%6,n=e-Math.floor(e),o=255*r*(1-i),h=255*r*(1-i*n),a=255*r*(1-i*(1-n));switch(r*=255,s){case 0:return[r,a,o];case 1:return[h,r,o];case 2:return[o,r,a];case 3:return[o,h,r];case 4:return[a,o,r];case 5:return[r,o,h]}},n.hsv.hsl=function(t){const e=t[0],i=t[1]/100,r=t[2]/100,s=Math.max(r,.01);let n,o;o=(2-i)*r;const h=(2-i)*s;return n=i*s,n/=h<=1?h:2-h,n=n||0,o/=2,[e,100*n,100*o]},n.hwb.rgb=function(t){const e=t[0]/360;let i=t[1]/100,r=t[2]/100;const s=i+r;let n;s>1&&(i/=s,r/=s);const o=Math.floor(6*e),h=1-r;n=6*e-o,0!=(1&o)&&(n=1-n);const a=i+n*(h-i);let l,u,c;switch(o){default:case 6:case 0:l=h,u=a,c=i;break;case 1:l=a,u=h,c=i;break;case 2:l=i,u=h,c=a;break;case 3:l=i,u=a,c=h;break;case 4:l=a,u=i,c=h;break;case 5:l=h,u=i,c=a}return[255*l,255*u,255*c]},n.cmyk.rgb=function(t){const e=t[0]/100,i=t[1]/100,r=t[2]/100,s=t[3]/100;return[255*(1-Math.min(1,e*(1-s)+s)),255*(1-Math.min(1,i*(1-s)+s)),255*(1-Math.min(1,r*(1-s)+s))]},n.xyz.rgb=function(t){const e=t[0]/100,i=t[1]/100,r=t[2]/100;let s,n,o;return s=3.2406*e+-1.5372*i+-.4986*r,n=-.9689*e+1.8758*i+.0415*r,o=.0557*e+-.204*i+1.057*r,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,n=n>.0031308?1.055*n**(1/2.4)-.055:12.92*n,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=Math.min(Math.max(0,s),1),n=Math.min(Math.max(0,n),1),o=Math.min(Math.max(0,o),1),[255*s,255*n,255*o]},n.xyz.lab=function(t){let e=t[0],i=t[1],r=t[2];return e/=95.047,i/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*i-16,500*(e-i),200*(i-r)]},n.lab.xyz=function(t){let e,i,r;i=(t[0]+16)/116,e=t[1]/500+i,r=i-t[2]/200;const s=i**3,n=e**3,o=r**3;return i=s>.008856?s:(i-16/116)/7.787,e=n>.008856?n:(e-16/116)/7.787,r=o>.008856?o:(r-16/116)/7.787,e*=95.047,i*=100,r*=108.883,[e,i,r]},n.lab.lch=function(t){const e=t[0],i=t[1],r=t[2];let s;return s=360*Math.atan2(r,i)/2/Math.PI,s<0&&(s+=360),[e,Math.sqrt(i*i+r*r),s]},n.lch.lab=function(t){const e=t[0],i=t[1],r=t[2]/360*2*Math.PI;return[e,i*Math.cos(r),i*Math.sin(r)]},n.rgb.ansi16=function(t,e=null){const[i,r,s]=t;let o=null===e?n.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),0===o)return 30;let h=30+(Math.round(s/255)<<2|Math.round(r/255)<<1|Math.round(i/255));return 2===o&&(h+=60),h},n.hsv.ansi16=function(t){return n.rgb.ansi16(n.hsv.rgb(t),t[2])},n.rgb.ansi256=function(t){const e=t[0],i=t[1],r=t[2];return e===i&&i===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(i/255*5)+Math.round(r/255*5)},n.ansi16.rgb=function(t){let e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];const i=.5*(1+~~(t>50));return[(1&e)*i*255,(e>>1&1)*i*255,(e>>2&1)*i*255]},n.ansi256.rgb=function(t){if(t>=232){const e=10*(t-232)+8;return[e,e,e]}let e;return t-=16,[Math.floor(t/36)/5*255,Math.floor((e=t%36)/6)/5*255,e%6/5*255]},n.rgb.hex=function(t){const e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},n.hex.rgb=function(t){const e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let i=e[0];3===e[0].length&&(i=i.split("").map((t=>t+t)).join(""));const r=parseInt(i,16);return[r>>16&255,r>>8&255,255&r]},n.rgb.hcg=function(t){const e=t[0]/255,i=t[1]/255,r=t[2]/255,s=Math.max(Math.max(e,i),r),n=Math.min(Math.min(e,i),r),o=s-n;let h,a;return h=o<1?n/(1-o):0,a=o<=0?0:s===e?(i-r)/o%6:s===i?2+(r-e)/o:4+(e-i)/o,a/=6,a%=1,[360*a,100*o,100*h]},n.hsl.hcg=function(t){const e=t[1]/100,i=t[2]/100,r=i<.5?2*e*i:2*e*(1-i);let s=0;return r<1&&(s=(i-.5*r)/(1-r)),[t[0],100*r,100*s]},n.hsv.hcg=function(t){const e=t[1]/100,i=t[2]/100,r=e*i;let s=0;return r<1&&(s=(i-r)/(1-r)),[t[0],100*r,100*s]},n.hcg.rgb=function(t){const e=t[0]/360,i=t[1]/100,r=t[2]/100;if(0===i)return[255*r,255*r,255*r];const s=[0,0,0],n=e%1*6,o=n%1,h=1-o;let a=0;switch(Math.floor(n)){case 0:s[0]=1,s[1]=o,s[2]=0;break;case 1:s[0]=h,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=o;break;case 3:s[0]=0,s[1]=h,s[2]=1;break;case 4:s[0]=o,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=h}return a=(1-i)*r,[255*(i*s[0]+a),255*(i*s[1]+a),255*(i*s[2]+a)]},n.hcg.hsv=function(t){const e=t[1]/100,i=e+t[2]/100*(1-e);let r=0;return i>0&&(r=e/i),[t[0],100*r,100*i]},n.hcg.hsl=function(t){const e=t[1]/100,i=t[2]/100*(1-e)+.5*e;let r=0;return i>0&&i<.5?r=e/(2*i):i>=.5&&i<1&&(r=e/(2*(1-i))),[t[0],100*r,100*i]},n.hcg.hwb=function(t){const e=t[1]/100,i=e+t[2]/100*(1-e);return[t[0],100*(i-e),100*(1-i)]},n.hwb.hcg=function(t){const e=t[1]/100,i=1-t[2]/100,r=i-e;let s=0;return r<1&&(s=(i-r)/(1-r)),[t[0],100*r,100*s]},n.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},n.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},n.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},n.gray.hsl=function(t){return[0,0,t[0]]},n.gray.hsv=n.gray.hsl,n.gray.hwb=function(t){return[0,100,t[0]]},n.gray.cmyk=function(t){return[0,0,0,t[0]]},n.gray.lab=function(t){return[t[0],0,0]},n.gray.hex=function(t){const e=255&Math.round(t[0]/100*255),i=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(i.length)+i},n.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},1621:(t,e,i)=>{const r=i(3583),s=i(9691),n={};Object.keys(r).forEach((t=>{n[t]={},Object.defineProperty(n[t],"channels",{value:r[t].channels}),Object.defineProperty(n[t],"labels",{value:r[t].labels});const e=s(t);Object.keys(e).forEach((i=>{const r=e[i];n[t][i]=function(t){const e=function(...e){const i=e[0];if(null==i)return i;i.length>1&&(e=i);const r=t(e);if("object"==typeof r)for(let t=r.length,e=0;e1&&(e=i),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(r)}))})),t.exports=n},9691:(t,e,i)=>{const r=i(3583);function s(t,e){return function(i){return e(t(i))}}function n(t,e){const i=[e[t].parent,t];let n=r[e[t].parent][t],o=e[t].parent;for(;e[o].parent;)i.unshift(e[o].parent),n=s(r[e[o].parent][o],n),o=e[o].parent;return n.conversion=i,n}t.exports=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(r);for(let i=e.length,r=0;r{"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},8470:(t,e,i)=>{"use strict";const r=i(2037),s=i(6224),n=i(6560),{env:o}=process;let h;function a(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function l(t,e){if(0===h)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!e&&void 0===h)return 0;const i=h||0;if("dumb"===o.TERM)return i;if("win32"===process.platform){const t=r.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in o)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((t=>t in o))||"codeship"===o.CI_NAME?1:i;if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if("truecolor"===o.COLORTERM)return 3;if("TERM_PROGRAM"in o){const t=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||"COLORTERM"in o?1:i}n("no-color")||n("no-colors")||n("color=false")||n("color=never")?h=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(h=1),"FORCE_COLOR"in o&&(h="true"===o.FORCE_COLOR?1:"false"===o.FORCE_COLOR?0:0===o.FORCE_COLOR.length?1:Math.min(parseInt(o.FORCE_COLOR,10),3)),t.exports={supportsColor:function(t){return a(l(t,t&&t.isTTY))},stdout:a(l(!0,s.isatty(1))),stderr:a(l(!0,s.isatty(2)))}},4061:(t,e,i)=>{"use strict";const r=i(6064),{stdout:s,stderr:n}=i(8470),{stringReplaceAll:o,stringEncaseCRLFWithFirstIndex:h}=i(3559),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],u=Object.create(null);class c{constructor(t){return d(t)}}const d=t=>{const e={};return((t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const i=s?s.level:0;t.level=void 0===e.level?i:e.level})(e,t),e.template=(...t)=>w(e.template,...t),Object.setPrototypeOf(e,p.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=c,e.template};function p(t){return d(t)}for(const[t,e]of Object.entries(r))u[t]={get(){const i=v(this,f(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:i}),i}};u.visible={get(){const t=v(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};const m=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const t of m)u[t]={get(){const{level:e}=this;return function(...i){const s=f(r.color[l[e]][t](...i),r.color.close,this._styler);return v(this,s,this._isEmpty)}}};for(const t of m)u["bg"+t[0].toUpperCase()+t.slice(1)]={get(){const{level:e}=this;return function(...i){const s=f(r.bgColor[l[e]][t](...i),r.bgColor.close,this._styler);return v(this,s,this._isEmpty)}}};const g=Object.defineProperties((()=>{}),{...u,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),f=(t,e,i)=>{let r,s;return void 0===i?(r=t,s=e):(r=i.openAll+t,s=e+i.closeAll),{open:t,close:e,openAll:r,closeAll:s,parent:i}},v=(t,e,i)=>{const r=(...t)=>a(t[0])&&a(t[0].raw)?b(r,w(r,...t)):b(r,1===t.length?""+t[0]:t.join(" "));return Object.setPrototypeOf(r,g),r._generator=t,r._styler=e,r._isEmpty=i,r},b=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let i=t._styler;if(void 0===i)return e;const{openAll:r,closeAll:s}=i;if(-1!==e.indexOf(""))for(;void 0!==i;)e=o(e,i.close,i.open),i=i.parent;const n=e.indexOf("\n");return-1!==n&&(e=h(e,s,r,n)),r+e+s};let y;const w=(t,...e)=>{const[r]=e;if(!a(r)||!a(r.raw))return e.join(" ");const s=e.slice(1),n=[r.raw[0]];for(let t=1;t{"use strict";const e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,i=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,s=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,n=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function o(t){const e="u"===t[0],i="{"===t[1];return e&&!i&&5===t.length||"x"===t[0]&&3===t.length?String.fromCharCode(parseInt(t.slice(1),16)):e&&i?String.fromCodePoint(parseInt(t.slice(2,-1),16)):n.get(t)||t}function h(t,e){const i=[],n=e.trim().split(/\s*,\s*/g);let h;for(const e of n){const n=Number(e);if(Number.isNaN(n)){if(!(h=e.match(r)))throw new Error(`Invalid Chalk template style argument: ${e} (in style '${t}')`);i.push(h[2].replace(s,((t,e,i)=>e?o(e):i)))}else i.push(n)}return i}function a(t){i.lastIndex=0;const e=[];let r;for(;null!==(r=i.exec(t));){const t=r[1];if(r[2]){const i=h(t,r[2]);e.push([t].concat(i))}else e.push([t])}return e}function l(t,e){const i={};for(const t of e)for(const e of t.styles)i[e[0]]=t.inverse?null:e.slice(1);let r=t;for(const[t,e]of Object.entries(i))if(Array.isArray(e)){if(!(t in r))throw new Error(`Unknown Chalk style: ${t}`);r=e.length>0?r[t](...e):r[t]}return r}t.exports=(t,i)=>{const r=[],s=[];let n=[];if(i.replace(e,((e,i,h,u,c,d)=>{if(i)n.push(o(i));else if(u){const e=n.join("");n=[],s.push(0===r.length?e:l(t,r)(e)),r.push({inverse:h,styles:a(u)})}else if(c){if(0===r.length)throw new Error("Found extraneous } in Chalk template literal");s.push(l(t,r)(n.join(""))),n=[],r.pop()}else n.push(d)})),s.push(n.join("")),r.length>0){const t=`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`;throw new Error(t)}return s.join("")}},3559:t=>{"use strict";t.exports={stringReplaceAll:(t,e,i)=>{let r=t.indexOf(e);if(-1===r)return t;const s=e.length;let n=0,o="";do{o+=t.substr(n,r-n)+e+i,n=r+s,r=t.indexOf(e,n)}while(-1!==r);return o+=t.substr(n),o},stringEncaseCRLFWithFirstIndex:(t,e,i,r)=>{let s=0,n="";do{const o="\r"===t[r-1];n+=t.substr(s,(o?r-1:r)-s)+e+(o?"\r\n":"\n")+i,s=r+1,r=t.indexOf("\n",s)}while(-1!==r);return n+=t.substr(s),n}}},6560:t=>{"use strict";t.exports=(t,e=process.argv)=>{const i=t.startsWith("-")?"":1===t.length?"-":"--",r=e.indexOf(i+t),s=e.indexOf("--");return-1!==r&&(-1===s||r{"use strict";const{FORCE_COLOR:e,NODE_DISABLE_COLORS:i,TERM:r}=process.env,s={enabled:!i&&"dumb"!==r&&"0"!==e,reset:o(0,0),bold:o(1,22),dim:o(2,22),italic:o(3,23),underline:o(4,24),inverse:o(7,27),hidden:o(8,28),strikethrough:o(9,29),black:o(30,39),red:o(31,39),green:o(32,39),yellow:o(33,39),blue:o(34,39),magenta:o(35,39),cyan:o(36,39),white:o(37,39),gray:o(90,39),grey:o(90,39),bgBlack:o(40,49),bgRed:o(41,49),bgGreen:o(42,49),bgYellow:o(43,49),bgBlue:o(44,49),bgMagenta:o(45,49),bgCyan:o(46,49),bgWhite:o(47,49)};function n(t,e){let i,r=0,s="",n="";for(;r{"use strict";class e{constructor({token:t,date:e,parts:i,locales:r}){this.token=t,this.date=e||new Date,this.parts=i||[this],this.locales=r||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((i,r)=>r>t&&i instanceof e))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const i=t.indexOf(this);return t.find(((t,r)=>r>i&&t instanceof e))}toString(){return String(this.date)}}t.exports=e},2102:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),e=this.date.getDay();return"DD"===this.token?String(t).padStart(2,"0"):"Do"===this.token?t+(i=t,1==(i%=10)?"st":2===i?"nd":3===i?"rd":"th"):"d"===this.token?e+1:"ddd"===this.token?this.locales.weekdaysShort[e]:"dddd"===this.token?this.locales.weekdays[e]:t;var i}}},4990:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}}},281:(t,e,i)=>{"use strict";t.exports={DatePart:i(7076),Meridiem:i(3692),Day:i(2102),Hours:i(4990),Milliseconds:i(2491),Minutes:i(1331),Month:i(9219),Seconds:i(1362),Year:i(6600)}},3692:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}},2491:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}},1331:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}},9219:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),e=this.token.length;return 2===e?String(t+1).padStart(2,"0"):3===e?this.locales.monthsShort[t]:4===e?this.locales.months[t]:String(t+1)}}},1362:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}},6600:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return 2===this.token.length?t.substr(-2):t}}},4439:(t,e,i)=>{"use strict";function r(t,e,i,r,s,n,o){try{var h=t[n](o),a=h.value}catch(t){return void i(t)}h.done?e(a):Promise.resolve(a).then(r,s)}const s=i(1391),n=i(1537),o=i(2698),h=o.erase,a=o.cursor,l=i(6513),u=l.style,c=l.clear,d=l.figures,p=l.wrap,m=l.entriesToDisplay,g=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),f=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]);t.exports=class extends n{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial="number"==typeof t.initial?t.initial:((t,e)=>{const i=t.findIndex((t=>t.value===e||t.title===e));return i>-1?i:void 0})(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=u.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=c("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return"number"==typeof this._fb?t=this.choices[this._fb]:"string"==typeof this._fb&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=g(this.suggestions,t):this.value=this.fallback.value,this.fire()}complete(t){var e,i=this;return(e=function*(){const e=i.completing=i.suggest(i.input,i.choices),r=yield e;if(i.completing!==e)return;i.suggestions=r.map(((t,e,i)=>({title:f(i,e),value:g(i,e),description:t.description}))),i.completing=!1;const s=Math.max(r.length-1,0);i.moveSelect(Math.min(s,i.select)),t&&t()},function(){var t=this,i=arguments;return new Promise((function(s,n){var o=e.apply(t,i);function h(t){r(o,s,n,h,a,"next",t)}function a(t){r(o,s,n,h,a,"throw",t)}h(void 0)}))})()}reset(){this.input="",this.complete((()=>{this.moveSelect(void 0!==this.initial?this.initial:0),this.render()})),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(t,e){let i=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${i}${t}${r}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(0===this.cursor)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){0===this.select?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,e,i,r){let n,o=i?d.arrowUp:r?d.arrowDown:" ",h=e?s.cyan().underline(t.title):t.title;return o=(e?s.cyan(d.pointer)+" ":" ")+o,t.description&&(n=` - ${t.description}`,(o.length+h.length+n.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(n="\n"+p(t.description,{margin:3,width:this.out.columns}))),o+" "+h+s.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(a.hide):this.out.write(c(this.outputText,this.out.columns)),super.render();let t=m(this.select,this.choices.length,this.limit),e=t.startIndex,i=t.endIndex;if(this.outputText=[u.symbol(this.done,this.aborted,this.exited),s.bold(this.msg),u.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const t=this.suggestions.slice(e,i).map(((t,r)=>this.renderOption(t,this.select===r+e,0===r&&e>0,r+e===i-1&&i{"use strict";const r=i(1391),s=i(2698).cursor,n=i(4491),o=i(6513),h=o.clear,a=o.style,l=o.figures;t.exports=class extends n{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=h("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){0===this.cursor?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>!this.inputValue||!("string"!=typeof t.title||!t.title.toLowerCase().includes(this.inputValue.toLowerCase()))||!("string"!=typeof t.value||!t.value.toLowerCase().includes(this.inputValue.toLowerCase()))));const e=this.filteredOptions.findIndex((e=>e===t));this.cursor=e<0?0:e,this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,e){" "===t?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${l.arrowUp}/${l.arrowDown}: Highlight option\n ${l.arrowLeft}/${l.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`:""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:r.gray("Enter something to filter")}\n`}renderOption(t,e,i){let s;return s=e.disabled?t===i?r.gray().underline(e.title):r.strikethrough().gray(e.title):t===i?r.cyan().underline(e.title):e.title,(e.selected?r.green(l.radioOn):l.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ");const t=[r.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(r.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(s.hide),super.render();let t=[a.symbol(this.done,this.aborted),r.bold(this.msg),a.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=r.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=h(t,this.out.columns)}}},2290:(t,e,i)=>{"use strict";const r=i(1391),s=i(1537),n=i(6513),o=n.style,h=n.clear,a=i(2698),l=a.erase,u=a.cursor;t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(t,e){return"y"===t.toLowerCase()?(this.value=!0,this.submit()):"n"===t.toLowerCase()?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(u.hide):this.out.write(h(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),r.bold(this.msg),o.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:r.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(l.line+u.to(0)+this.outputText))}}},1492:(t,e,i)=>{"use strict";function r(t,e,i,r,s,n,o){try{var h=t[n](o),a=h.value}catch(t){return void i(t)}h.done?e(a):Promise.resolve(a).then(r,s)}function s(t){return function(){var e=this,i=arguments;return new Promise((function(s,n){var o=t.apply(e,i);function h(t){r(o,s,n,h,a,"next",t)}function a(t){r(o,s,n,h,a,"throw",t)}h(void 0)}))}}const n=i(1391),o=i(1537),h=i(6513),a=h.style,l=h.clear,u=h.figures,c=i(2698),d=c.erase,p=c.cursor,m=i(281),g=m.DatePart,f=m.Meridiem,v=m.Day,b=m.Hours,y=m.Milliseconds,w=m.Minutes,x=m.Month,_=m.Seconds,O=m.Year,S=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,C={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new v(t),3:t=>new x(t),4:t=>new O(t),5:t=>new f(t),6:t=>new b(t),7:t=>new w(t),8:t=>new _(t),9:t=>new y(t)},k={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};t.exports=class extends o{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(k,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=l("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let e;for(this.parts=[];e=S.exec(t);){let t=e.shift(),i=e.findIndex((t=>null!=t));this.parts.push(i in C?C[i]({token:e[i]||t,date:this.date,parts:this.parts,locales:this.locales}):e[i]||t)}let i=this.parts.reduce(((t,e)=>("string"==typeof e&&"string"==typeof t[t.length-1]?t[t.length-1]+=e:t.push(e),t)),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof g))),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var t=this;return s((function*(){let e=yield t.validator(t.value);"string"==typeof e&&(t.errorMsg=e,e=!1),t.error=!e}))()}submit(){var t=this;return s((function*(){if(yield t.validate(),t.error)return t.color="red",t.fire(),void t.render();t.done=!0,t.aborted=!1,t.fire(),t.render(),t.out.write("\n"),t.close()}))()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(null==t)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(null==t)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof g))),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(p.hide):this.out.write(l(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),n.bold(this.msg),a.delimiter(!1),this.parts.reduce(((t,e,i)=>t.concat(i!==this.cursor||this.done?e:n.cyan().underline(e.toString()))),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split("\n").reduce(((t,e,i)=>t+`\n${i?" ":u.pointerSmall} ${n.red().italic(e)}`),"")),this.out.write(d.line+p.to(0)+this.outputText))}}},4910:(t,e,i)=>{"use strict";t.exports={TextPrompt:i(1741),SelectPrompt:i(2289),TogglePrompt:i(8660),DatePrompt:i(1492),NumberPrompt:i(8147),MultiselectPrompt:i(4491),AutocompletePrompt:i(4439),AutocompleteMultiselectPrompt:i(5174),ConfirmPrompt:i(2290)}},4491:(t,e,i)=>{"use strict";const r=i(1391),s=i(2698).cursor,n=i(1537),o=i(6513),h=o.clear,a=o.figures,l=o.style,u=o.wrap,c=o.entriesToDisplay;t.exports=class extends n{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map(((t,e)=>("string"==typeof t&&(t={title:t,value:e}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(void 0===t.value?e:t.value),selected:t&&t.selected,disabled:t&&t.disabled}))),this.clear=h("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map((t=>!t.selected)),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){const t=this.value.filter((t=>t.selected));this.minSelected&&t.lengtht.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}toggleAll(){if(void 0!==this.maxChoices||this.value[this.cursor].disabled)return this.bell();const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((e=>e.selected=t)),this.render()}_(t,e){if(" "===t)this.handleSpaceToggle();else{if("a"!==t)return this.bell();this.toggleAll()}}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${a.arrowUp}/${a.arrowDown}: Highlight option\n ${a.arrowLeft}/${a.arrowRight}/[space]: Toggle selection\n`+(void 0===this.maxChoices?" a: Toggle all\n":"")+" enter/return: Complete answer":""}renderOption(t,e,i,s){const n=(e.selected?r.green(a.radioOn):a.radioOff)+" "+s+" ";let o,h;return e.disabled?o=t===i?r.gray().underline(e.title):r.strikethrough().gray(e.title):(o=t===i?r.cyan().underline(e.title):e.title,t===i&&e.description&&(h=` - ${e.description}`,(n.length+o.length+h.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(h="\n"+u(e.description,{margin:n.length,width:this.out.columns})))),n+o+r.gray(h||"")}paginateOptions(t){if(0===t.length)return r.red("No matches for this query.");let e,i=c(this.cursor,t.length,this.optionsPerPage),s=i.startIndex,n=i.endIndex,o=[];for(let i=s;i0?a.arrowUp:i===n-1&&nt.selected)).map((t=>t.title)).join(", ");const t=[r.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(r.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(s.hide),super.render();let t=[l.symbol(this.done,this.aborted),r.bold(this.msg),l.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=r.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=h(t,this.out.columns)}}},8147:(t,e,i)=>{"use strict";function r(t,e,i,r,s,n,o){try{var h=t[n](o),a=h.value}catch(t){return void i(t)}h.done?e(a):Promise.resolve(a).then(r,s)}function s(t){return function(){var e=this,i=arguments;return new Promise((function(s,n){var o=t.apply(e,i);function h(t){r(o,s,n,h,a,"next",t)}function a(t){r(o,s,n,h,a,"throw",t)}h(void 0)}))}}const n=i(1391),o=i(1537),h=i(2698),a=h.cursor,l=h.erase,u=i(6513),c=u.style,d=u.figures,p=u.clear,m=u.lines,g=/[0-9]/,f=t=>void 0!==t,v=(t,e)=>{let i=Math.pow(10,e);return Math.round(t*i)/i};t.exports=class extends o{constructor(t={}){super(t),this.transform=c.render(t.style),this.msg=t.message,this.initial=f(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=f(t.min)?t.min:-1/0,this.max=f(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){t||0===t?(this.placeholder=!1,this.rendered=this.transform.render(`${v(t,this.round)}`),this._value=v(t,this.round)):(this.placeholder=!0,this.rendered=n.gray(this.transform.render(`${this.initial}`)),this._value=""),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return"-"===t||"."===t&&this.float||g.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=""!==t?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var t=this;return s((function*(){let e=yield t.validator(t.value);"string"==typeof e&&(t.errorMsg=e,e=!1),t.error=!e}))()}submit(){var t=this;return s((function*(){if(yield t.validate(),t.error)return t.color="red",t.fire(),void t.render();let e=t.value;t.value=""!==e?e:t.initial,t.done=!0,t.aborted=!1,t.error=!1,t.fire(),t.render(),t.out.write("\n"),t.close()}))()}up(){if(this.typed="",""===this.value&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",""===this.value&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(0===t.length)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",""!==this.value&&this.value1e3&&(this.typed=""),this.typed+=t,this.lastHit=i,this.color="cyan","."===t)return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.valuet+`\n${i?" ":d.pointerSmall} ${n.red().italic(e)}`),"")),this.out.write(l.line+a.to(0)+this.outputText+a.save+this.outputError+a.restore))}}},1537:(t,e,i)=>{"use strict";const r=i(4521),s=i(6513).action,n=i(2361),o=i(2698),h=o.beep,a=o.cursor,l=i(1391);t.exports=class extends n{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);const e=r.createInterface({input:this.in,escapeCodeTimeout:50});r.emitKeypressEvents(this.in,e),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(t,e)=>{let r=s(e,i);!1===r?this._&&this._(t,e):"function"==typeof this[r]?this[r](e):this.bell()};this.close=()=>{this.out.write(a.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(!1),e.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",n)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(h)}render(){this.onRender(l),this.firstRender&&(this.firstRender=!1)}}},2289:(t,e,i)=>{"use strict";const r=i(1391),s=i(1537),n=i(6513),o=n.style,h=n.clear,a=n.figures,l=n.wrap,u=n.entriesToDisplay,c=i(2698).cursor;t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map(((t,e)=>("string"==typeof t&&(t={title:t,value:e}),{title:t&&(t.title||t.value||t),value:t&&(void 0===t.value?e:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}))),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=h("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){0===this.cursor?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,e){if(" "===t)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(c.hide):this.out.write(h(this.outputText,this.out.columns)),super.render();let t=u(this.cursor,this.choices.length,this.optionsPerPage),e=t.startIndex,i=t.endIndex;if(this.outputText=[o.symbol(this.done,this.aborted),r.bold(this.msg),o.delimiter(!1),this.done?this.selection.title:this.selection.disabled?r.yellow(this.warn):r.gray(this.hint)].join(" "),!this.done){this.outputText+="\n";for(let t=e;t0?a.arrowUp:t===i-1&&i=this.out.columns||h.description.split(/\r?\n/).length>1)&&(o="\n"+l(h.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${s}${r.gray(o)}\n`}}this.out.write(this.outputText)}}},1741:(t,e,i)=>{"use strict";function r(t,e,i,r,s,n,o){try{var h=t[n](o),a=h.value}catch(t){return void i(t)}h.done?e(a):Promise.resolve(a).then(r,s)}function s(t){return function(){var e=this,i=arguments;return new Promise((function(s,n){var o=t.apply(e,i);function h(t){r(o,s,n,h,a,"next",t)}function a(t){r(o,s,n,h,a,"throw",t)}h(void 0)}))}}const n=i(1391),o=i(1537),h=i(2698),a=h.erase,l=h.cursor,u=i(6513),c=u.style,d=u.clear,p=u.lines,m=u.figures;t.exports=class extends o{constructor(t={}){super(t),this.transform=c.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=d("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=n.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var t=this;return s((function*(){let e=yield t.validator(t.value);"string"==typeof e&&(t.errorMsg=e,e=!1),t.error=!e}))()}submit(){var t=this;return s((function*(){if(t.value=t.value||t.initial,t.cursorOffset=0,t.cursor=t.rendered.length,yield t.validate(),t.error)return t.red=!0,t.fire(),void t.render();t.done=!0,t.aborted=!1,t.fire(),t.render(),t.out.write("\n"),t.close()}))()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,e){let i=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${i}${t}${r}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),e=this.value.slice(this.cursor);this.value=`${t}${e}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),e=this.value.slice(this.cursor+1);this.value=`${t}${e}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return 0===this.cursor||this.placeholder&&1===this.cursor}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(l.down(p(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns)),this.out.write(d(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[c.symbol(this.done,this.aborted),n.bold(this.msg),c.delimiter(this.done),this.red?n.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split("\n").reduce(((t,e,i)=>t+`\n${i?" ":m.pointerSmall} ${n.red().italic(e)}`),"")),this.out.write(a.line+l.to(0)+this.outputText+l.save+this.outputError+l.restore+l.move(this.cursorOffset,0)))}}},8660:(t,e,i)=>{"use strict";const r=i(1391),s=i(1537),n=i(6513),o=n.style,h=n.clear,a=i(2698),l=a.cursor,u=a.erase;t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}deactivate(){if(!1===this.value)return this.bell();this.value=!1,this.render()}activate(){if(!0===this.value)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,e){if(" "===t)this.value=!this.value;else if("1"===t)this.value=!0;else{if("0"!==t)return this.bell();this.value=!1}this.render()}render(){this.closed||(this.firstRender?this.out.write(l.hide):this.out.write(h(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),r.bold(this.msg),o.delimiter(this.done),this.value?this.inactive:r.cyan().underline(this.inactive),r.gray("/"),this.value?r.cyan().underline(this.active):this.active].join(" "),this.out.write(u.line+l.to(0)+this.outputText))}}},482:(t,e,i)=>{"use strict";function r(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function s(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,o=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){a=!0,n=t},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw n}}}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i{};function p(){return m.apply(this,arguments)}function m(){return m=l((function*(t=[],{onSubmit:e=d,onCancel:i=d}={}){const r={},n=p._override||{};let h,a,m,f,v,b;t=[].concat(t);const y=function(){var t=l((function*(t,e,i=!1){if(i||!t.validate||!0===t.validate(e))return t.format?yield t.format(e,r):e}));return function(e,i){return t.apply(this,arguments)}}();var w,x=o(t);try{for(x.s();!(w=x.n()).done;){a=w.value;var _=a;if(f=_.name,v=_.type,"function"==typeof v&&(v=yield v(h,s({},r),a),a.type=v),v){for(let t in a){if(c.includes(t))continue;let e=a[t];a[t]="function"==typeof e?yield e(h,s({},r),b):e}if(b=a,"string"!=typeof a.message)throw new Error("prompt message is required");var O=a;if(f=O.name,v=O.type,void 0===u[v])throw new Error(`prompt type (${v}) is not defined`);if(void 0===n[a.name]||(h=yield y(a,n[a.name]),void 0===h)){try{h=p._injected?g(p._injected,a.initial):yield u[v](a),r[f]=h=yield y(a,h,!0),m=yield e(a,h,r)}catch(t){m=!(yield i(a,r))}if(m)return r}else r[f]=h}}}catch(t){x.e(t)}finally{x.f()}return r})),m.apply(this,arguments)}function g(t,e){const i=t.shift();if(i instanceof Error)throw i;return void 0===i?e:i}t.exports=Object.assign(p,{prompt:p,prompts:u,inject:function(t){p._injected=(p._injected||[]).concat(t)},override:function(t){p._override=Object.assign({},t)}})},2897:(t,e,i)=>{"use strict";const r=e,s=i(4910),n=t=>t;function o(t,e,i={}){return new Promise(((r,o)=>{const h=new s[t](e),a=i.onAbort||n,l=i.onSubmit||n,u=i.onExit||n;h.on("state",e.onState||n),h.on("submit",(t=>r(l(t)))),h.on("exit",(t=>r(u(t)))),h.on("abort",(t=>o(a(t))))}))}r.text=t=>o("TextPrompt",t),r.password=t=>(t.style="password",r.text(t)),r.invisible=t=>(t.style="invisible",r.text(t)),r.number=t=>o("NumberPrompt",t),r.date=t=>o("DatePrompt",t),r.confirm=t=>o("ConfirmPrompt",t),r.list=t=>{const e=t.separator||",";return o("TextPrompt",t,{onSubmit:t=>t.split(e).map((t=>t.trim()))})},r.toggle=t=>o("TogglePrompt",t),r.select=t=>o("SelectPrompt",t),r.multiselect=t=>{t.choices=[].concat(t.choices||[]);const e=t=>t.filter((t=>t.selected)).map((t=>t.value));return o("MultiselectPrompt",t,{onAbort:e,onSubmit:e})},r.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const e=t=>t.filter((t=>t.selected)).map((t=>t.value));return o("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};const h=(t,e)=>Promise.resolve(e.filter((e=>e.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));r.autocomplete=t=>(t.suggest=t.suggest||h,t.choices=[].concat(t.choices||[]),o("AutocompletePrompt",t))},3556:t=>{"use strict";t.exports=(t,e)=>{if(!t.meta||"escape"===t.name){if(t.ctrl){if("a"===t.name)return"first";if("c"===t.name)return"abort";if("d"===t.name)return"abort";if("e"===t.name)return"last";if("g"===t.name)return"reset"}if(e){if("j"===t.name)return"down";if("k"===t.name)return"up"}return"return"===t.name||"enter"===t.name?"submit":"backspace"===t.name?"delete":"delete"===t.name?"deleteForward":"abort"===t.name?"abort":"escape"===t.name?"exit":"tab"===t.name?"next":"pagedown"===t.name?"nextPage":"pageup"===t.name?"prevPage":"home"===t.name?"home":"end"===t.name?"end":"up"===t.name?"up":"down"===t.name?"down":"right"===t.name?"right":"left"===t.name&&"left"}}},8296:(t,e,i)=>{"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[s++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,h=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return h=t.done,t},e:function(t){a=!0,o=t},f:function(){try{h||null==i.return||i.return()}finally{if(a)throw o}}}}(t.split(/\r?\n/));try{for(a.s();!(n=a.n()).done;){let t=n.value;i+=1+Math.floor(Math.max([...s(t)].length-1,0)/e)}}catch(t){a.e(t)}finally{a.f()}return o.lines(i)}},2496:t=>{"use strict";t.exports=(t,e,i)=>{i=i||e;let r=Math.min(e-i,t-Math.floor(i/2));return r<0&&(r=0),{startIndex:r,endIndex:Math.min(r+i,e)}}},9188:t=>{"use strict";const e={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},i={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},r="win32"===process.platform?i:e;t.exports=r},6513:(t,e,i)=>{"use strict";t.exports={action:i(3556),clear:i(8296),style:i(2052),strip:i(7734),figures:i(9188),lines:i(7731),wrap:i(8611),entriesToDisplay:i(2496)}},7731:(t,e,i)=>{"use strict";const r=i(7734);t.exports=function(t,e){let i=String(r(t)||"").split(/\r?\n/);return e?i.map((t=>Math.ceil(t.length/e))).reduce(((t,e)=>t+e)):i.length}},7734:t=>{"use strict";t.exports=t=>{const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),i=new RegExp(e,"g");return"string"==typeof t?t.replace(i,""):t}},2052:(t,e,i)=>{"use strict";const r=i(1391),s=i(9188),n=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),o=Object.freeze({aborted:r.red(s.cross),done:r.green(s.tick),exited:r.yellow(s.cross),default:r.cyan("?")});t.exports={styles:n,render:t=>n[t]||n.default,symbols:o,symbol:(t,e,i)=>e?o.aborted:i?o.exited:t?o.done:o.default,delimiter:t=>r.gray(t?s.ellipsis:s.pointerSmall),item:(t,e)=>r.gray(t?e?s.pointerSmall:"+":s.line)}},8611:t=>{"use strict";t.exports=(t,e={})=>{const i=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",r=e.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,e)=>(e.length+i.length>=r||t[t.length-1].length+e.length+1{t.exports=function(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,i=process.versions.node.split(".").map(Number);for(;et[e])return!1;if(t[e]>i[e])return!0}return!1}("8.6.0")?i(482):i(9439)},5468:t=>{"use strict";class e{constructor({token:t,date:e,parts:i,locales:r}){this.token=t,this.date=e||new Date,this.parts=i||[this],this.locales=r||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((i,r)=>r>t&&i instanceof e))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const i=t.indexOf(this);return t.find(((t,r)=>r>i&&t instanceof e))}toString(){return String(this.date)}}t.exports=e},608:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),e=this.date.getDay();return"DD"===this.token?String(t).padStart(2,"0"):"Do"===this.token?t+(i=t,1==(i%=10)?"st":2===i?"nd":3===i?"rd":"th"):"d"===this.token?e+1:"ddd"===this.token?this.locales.weekdaysShort[e]:"dddd"===this.token?this.locales.weekdays[e]:t;var i}}},4134:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}}},1106:(t,e,i)=>{"use strict";t.exports={DatePart:i(5468),Meridiem:i(689),Day:i(608),Hours:i(4134),Milliseconds:i(5479),Minutes:i(5512),Month:i(8318),Seconds:i(8908),Year:i(9958)}},689:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}},5479:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}},5512:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}},8318:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),e=this.token.length;return 2===e?String(t+1).padStart(2,"0"):3===e?this.locales.monthsShort[t]:4===e?this.locales.months[t]:String(t+1)}}},8908:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}},9958:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return 2===this.token.length?t.substr(-2):t}}},656:(t,e,i)=>{"use strict";const r=i(1391),s=i(1739),{erase:n,cursor:o}=i(2698),{style:h,clear:a,figures:l,wrap:u,entriesToDisplay:c}=i(9016),d=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),p=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]);t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial="number"==typeof t.initial?t.initial:((t,e)=>{const i=t.findIndex((t=>t.value===e||t.title===e));return i>-1?i:void 0})(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=h.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=a("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return"number"==typeof this._fb?t=this.choices[this._fb]:"string"==typeof this._fb&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=d(this.suggestions,t):this.value=this.fallback.value,this.fire()}async complete(t){const e=this.completing=this.suggest(this.input,this.choices),i=await e;if(this.completing!==e)return;this.suggestions=i.map(((t,e,i)=>({title:p(i,e),value:d(i,e),description:t.description}))),this.completing=!1;const r=Math.max(i.length-1,0);this.moveSelect(Math.min(r,this.select)),t&&t()}reset(){this.input="",this.complete((()=>{this.moveSelect(void 0!==this.initial?this.initial:0),this.render()})),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(t,e){let i=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${i}${t}${r}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(0===this.cursor)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){0===this.select?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,e,i,s){let n,o=i?l.arrowUp:s?l.arrowDown:" ",h=e?r.cyan().underline(t.title):t.title;return o=(e?r.cyan(l.pointer)+" ":" ")+o,t.description&&(n=` - ${t.description}`,(o.length+h.length+n.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(n="\n"+u(t.description,{margin:3,width:this.out.columns}))),o+" "+h+r.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(o.hide):this.out.write(a(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=c(this.select,this.choices.length,this.limit);if(this.outputText=[h.symbol(this.done,this.aborted,this.exited),r.bold(this.msg),h.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const i=this.suggestions.slice(t,e).map(((i,r)=>this.renderOption(i,this.select===r+t,0===r&&t>0,r+t===e-1&&e{"use strict";const r=i(1391),{cursor:s}=i(2698),n=i(3702),{clear:o,style:h,figures:a}=i(9016);t.exports=class extends n{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=o("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){0===this.cursor?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>!this.inputValue||!("string"!=typeof t.title||!t.title.toLowerCase().includes(this.inputValue.toLowerCase()))||!("string"!=typeof t.value||!t.value.toLowerCase().includes(this.inputValue.toLowerCase()))));const e=this.filteredOptions.findIndex((e=>e===t));this.cursor=e<0?0:e,this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,e){" "===t?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${a.arrowUp}/${a.arrowDown}: Highlight option\n ${a.arrowLeft}/${a.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`:""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:r.gray("Enter something to filter")}\n`}renderOption(t,e,i){let s;return s=e.disabled?t===i?r.gray().underline(e.title):r.strikethrough().gray(e.title):t===i?r.cyan().underline(e.title):e.title,(e.selected?r.green(a.radioOn):a.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ");const t=[r.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(r.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(s.hide),super.render();let t=[h.symbol(this.done,this.aborted),r.bold(this.msg),h.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=r.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=o(t,this.out.columns)}}},5747:(t,e,i)=>{const r=i(1391),s=i(1739),{style:n,clear:o}=i(9016),{erase:h,cursor:a}=i(2698);t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(t,e){return"y"===t.toLowerCase()?(this.value=!0,this.submit()):"n"===t.toLowerCase()?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(a.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),r.bold(this.msg),n.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:r.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(h.line+a.to(0)+this.outputText))}}},1054:(t,e,i)=>{"use strict";const r=i(1391),s=i(1739),{style:n,clear:o,figures:h}=i(9016),{erase:a,cursor:l}=i(2698),{DatePart:u,Meridiem:c,Day:d,Hours:p,Milliseconds:m,Minutes:g,Month:f,Seconds:v,Year:b}=i(1106),y=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,w={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new d(t),3:t=>new f(t),4:t=>new b(t),5:t=>new c(t),6:t=>new p(t),7:t=>new g(t),8:t=>new v(t),9:t=>new m(t)},x={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(x,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=o("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let e;for(this.parts=[];e=y.exec(t);){let t=e.shift(),i=e.findIndex((t=>null!=t));this.parts.push(i in w?w[i]({token:e[i]||t,date:this.date,parts:this.parts,locales:this.locales}):e[i]||t)}let i=this.parts.reduce(((t,e)=>("string"==typeof e&&"string"==typeof t[t.length-1]?t[t.length-1]+=e:t.push(e),t)),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof u))),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let t=await this.validator(this.value);"string"==typeof t&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error)return this.color="red",this.fire(),void this.render();this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(null==t)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(null==t)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof u))),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(l.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),r.bold(this.msg),n.delimiter(!1),this.parts.reduce(((t,e,i)=>t.concat(i!==this.cursor||this.done?e:r.cyan().underline(e.toString()))),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split("\n").reduce(((t,e,i)=>t+`\n${i?" ":h.pointerSmall} ${r.red().italic(e)}`),"")),this.out.write(a.line+l.to(0)+this.outputText))}}},635:(t,e,i)=>{"use strict";t.exports={TextPrompt:i(4490),SelectPrompt:i(9770),TogglePrompt:i(4639),DatePrompt:i(1054),NumberPrompt:i(8531),MultiselectPrompt:i(3702),AutocompletePrompt:i(656),AutocompleteMultiselectPrompt:i(6900),ConfirmPrompt:i(5747)}},3702:(t,e,i)=>{"use strict";const r=i(1391),{cursor:s}=i(2698),n=i(1739),{clear:o,figures:h,style:a,wrap:l,entriesToDisplay:u}=i(9016);t.exports=class extends n{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map(((t,e)=>("string"==typeof t&&(t={title:t,value:e}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(void 0===t.value?e:t.value),selected:t&&t.selected,disabled:t&&t.disabled}))),this.clear=o("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map((t=>!t.selected)),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){const t=this.value.filter((t=>t.selected));this.minSelected&&t.lengtht.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}toggleAll(){if(void 0!==this.maxChoices||this.value[this.cursor].disabled)return this.bell();const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((e=>e.selected=t)),this.render()}_(t,e){if(" "===t)this.handleSpaceToggle();else{if("a"!==t)return this.bell();this.toggleAll()}}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${h.arrowUp}/${h.arrowDown}: Highlight option\n ${h.arrowLeft}/${h.arrowRight}/[space]: Toggle selection\n`+(void 0===this.maxChoices?" a: Toggle all\n":"")+" enter/return: Complete answer":""}renderOption(t,e,i,s){const n=(e.selected?r.green(h.radioOn):h.radioOff)+" "+s+" ";let o,a;return e.disabled?o=t===i?r.gray().underline(e.title):r.strikethrough().gray(e.title):(o=t===i?r.cyan().underline(e.title):e.title,t===i&&e.description&&(a=` - ${e.description}`,(n.length+o.length+a.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(a="\n"+l(e.description,{margin:n.length,width:this.out.columns})))),n+o+r.gray(a||"")}paginateOptions(t){if(0===t.length)return r.red("No matches for this query.");let e,{startIndex:i,endIndex:s}=u(this.cursor,t.length,this.optionsPerPage),n=[];for(let r=i;r0?h.arrowUp:r===s-1&&st.selected)).map((t=>t.title)).join(", ");const t=[r.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(r.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(s.hide),super.render();let t=[a.symbol(this.done,this.aborted),r.bold(this.msg),a.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=r.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=o(t,this.out.columns)}}},8531:(t,e,i)=>{const r=i(1391),s=i(1739),{cursor:n,erase:o}=i(2698),{style:h,figures:a,clear:l,lines:u}=i(9016),c=/[0-9]/,d=t=>void 0!==t,p=(t,e)=>{let i=Math.pow(10,e);return Math.round(t*i)/i};t.exports=class extends s{constructor(t={}){super(t),this.transform=h.render(t.style),this.msg=t.message,this.initial=d(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=d(t.min)?t.min:-1/0,this.max=d(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){t||0===t?(this.placeholder=!1,this.rendered=this.transform.render(`${p(t,this.round)}`),this._value=p(t,this.round)):(this.placeholder=!0,this.rendered=r.gray(this.transform.render(`${this.initial}`)),this._value=""),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return"-"===t||"."===t&&this.float||c.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=""!==t?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let t=await this.validator(this.value);"string"==typeof t&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error)return this.color="red",this.fire(),void this.render();let t=this.value;this.value=""!==t?t:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}up(){if(this.typed="",""===this.value&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",""===this.value&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(0===t.length)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",""!==this.value&&this.value1e3&&(this.typed=""),this.typed+=t,this.lastHit=i,this.color="cyan","."===t)return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.valuet+`\n${i?" ":a.pointerSmall} ${r.red().italic(e)}`),"")),this.out.write(o.line+n.to(0)+this.outputText+n.save+this.outputError+n.restore))}}},1739:(t,e,i)=>{"use strict";const r=i(4521),{action:s}=i(9016),n=i(2361),{beep:o,cursor:h}=i(2698),a=i(1391);t.exports=class extends n{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);const e=r.createInterface({input:this.in,escapeCodeTimeout:50});r.emitKeypressEvents(this.in,e),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(t,e)=>{let r=s(e,i);!1===r?this._&&this._(t,e):"function"==typeof this[r]?this[r](e):this.bell()};this.close=()=>{this.out.write(h.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(!1),e.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",n)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(o)}render(){this.onRender(a),this.firstRender&&(this.firstRender=!1)}}},9770:(t,e,i)=>{"use strict";const r=i(1391),s=i(1739),{style:n,clear:o,figures:h,wrap:a,entriesToDisplay:l}=i(9016),{cursor:u}=i(2698);t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map(((t,e)=>("string"==typeof t&&(t={title:t,value:e}),{title:t&&(t.title||t.value||t),value:t&&(void 0===t.value?e:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}))),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=o("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){0===this.cursor?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,e){if(" "===t)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(u.hide):this.out.write(o(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=l(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[n.symbol(this.done,this.aborted),r.bold(this.msg),n.delimiter(!1),this.done?this.selection.title:this.selection.disabled?r.yellow(this.warn):r.gray(this.hint)].join(" "),!this.done){this.outputText+="\n";for(let i=t;i0?h.arrowUp:i===e-1&&e=this.out.columns||l.description.split(/\r?\n/).length>1)&&(o="\n"+a(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${s}${r.gray(o)}\n`}}this.out.write(this.outputText)}}},4490:(t,e,i)=>{const r=i(1391),s=i(1739),{erase:n,cursor:o}=i(2698),{style:h,clear:a,lines:l,figures:u}=i(9016);t.exports=class extends s{constructor(t={}){super(t),this.transform=h.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=a("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=r.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let t=await this.validator(this.value);"string"==typeof t&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error)return this.red=!0,this.fire(),void this.render();this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,e){let i=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${i}${t}${r}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),e=this.value.slice(this.cursor);this.value=`${t}${e}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),e=this.value.slice(this.cursor+1);this.value=`${t}${e}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return 0===this.cursor||this.placeholder&&1===this.cursor}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(o.down(l(this.outputError,this.out.columns)-1)+a(this.outputError,this.out.columns)),this.out.write(a(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[h.symbol(this.done,this.aborted),r.bold(this.msg),h.delimiter(this.done),this.red?r.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split("\n").reduce(((t,e,i)=>t+`\n${i?" ":u.pointerSmall} ${r.red().italic(e)}`),"")),this.out.write(n.line+o.to(0)+this.outputText+o.save+this.outputError+o.restore+o.move(this.cursorOffset,0)))}}},4639:(t,e,i)=>{const r=i(1391),s=i(1739),{style:n,clear:o}=i(9016),{cursor:h,erase:a}=i(2698);t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}deactivate(){if(!1===this.value)return this.bell();this.value=!1,this.render()}activate(){if(!0===this.value)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,e){if(" "===t)this.value=!this.value;else if("1"===t)this.value=!0;else{if("0"!==t)return this.bell();this.value=!1}this.render()}render(){this.closed||(this.firstRender?this.out.write(h.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),r.bold(this.msg),n.delimiter(this.done),this.value?this.inactive:r.cyan().underline(this.inactive),r.gray("/"),this.value?r.cyan().underline(this.active):this.active].join(" "),this.out.write(a.line+h.to(0)+this.outputText))}}},9439:(t,e,i)=>{"use strict";const r=i(8378),s=["suggest","format","onState","validate","onRender","type"],n=()=>{};async function o(t=[],{onSubmit:e=n,onCancel:i=n}={}){const a={},l=o._override||{};let u,c,d,p,m,g;t=[].concat(t);const f=async(t,e,i=!1)=>{if(i||!t.validate||!0===t.validate(e))return t.format?await t.format(e,a):e};for(c of t)if(({name:p,type:m}=c),"function"==typeof m&&(m=await m(u,{...a},c),c.type=m),m){for(let t in c){if(s.includes(t))continue;let e=c[t];c[t]="function"==typeof e?await e(u,{...a},g):e}if(g=c,"string"!=typeof c.message)throw new Error("prompt message is required");if(({name:p,type:m}=c),void 0===r[m])throw new Error(`prompt type (${m}) is not defined`);if(void 0===l[c.name]||(u=await f(c,l[c.name]),void 0===u)){try{u=o._injected?h(o._injected,c.initial):await r[m](c),a[p]=u=await f(c,u,!0),d=await e(c,u,a)}catch(t){d=!await i(c,a)}if(d)return a}else a[p]=u}return a}function h(t,e){const i=t.shift();if(i instanceof Error)throw i;return void 0===i?e:i}t.exports=Object.assign(o,{prompt:o,prompts:r,inject:function(t){o._injected=(o._injected||[]).concat(t)},override:function(t){o._override=Object.assign({},t)}})},8378:(t,e,i)=>{"use strict";const r=e,s=i(635),n=t=>t;function o(t,e,i={}){return new Promise(((r,o)=>{const h=new s[t](e),a=i.onAbort||n,l=i.onSubmit||n,u=i.onExit||n;h.on("state",e.onState||n),h.on("submit",(t=>r(l(t)))),h.on("exit",(t=>r(u(t)))),h.on("abort",(t=>o(a(t))))}))}r.text=t=>o("TextPrompt",t),r.password=t=>(t.style="password",r.text(t)),r.invisible=t=>(t.style="invisible",r.text(t)),r.number=t=>o("NumberPrompt",t),r.date=t=>o("DatePrompt",t),r.confirm=t=>o("ConfirmPrompt",t),r.list=t=>{const e=t.separator||",";return o("TextPrompt",t,{onSubmit:t=>t.split(e).map((t=>t.trim()))})},r.toggle=t=>o("TogglePrompt",t),r.select=t=>o("SelectPrompt",t),r.multiselect=t=>{t.choices=[].concat(t.choices||[]);const e=t=>t.filter((t=>t.selected)).map((t=>t.value));return o("MultiselectPrompt",t,{onAbort:e,onSubmit:e})},r.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const e=t=>t.filter((t=>t.selected)).map((t=>t.value));return o("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};const h=(t,e)=>Promise.resolve(e.filter((e=>e.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));r.autocomplete=t=>(t.suggest=t.suggest||h,t.choices=[].concat(t.choices||[]),o("AutocompletePrompt",t))},2866:t=>{"use strict";t.exports=(t,e)=>{if(!t.meta||"escape"===t.name){if(t.ctrl){if("a"===t.name)return"first";if("c"===t.name)return"abort";if("d"===t.name)return"abort";if("e"===t.name)return"last";if("g"===t.name)return"reset"}if(e){if("j"===t.name)return"down";if("k"===t.name)return"up"}return"return"===t.name||"enter"===t.name?"submit":"backspace"===t.name?"delete":"delete"===t.name?"deleteForward":"abort"===t.name?"abort":"escape"===t.name?"exit":"tab"===t.name?"next":"pagedown"===t.name?"nextPage":"pageup"===t.name?"prevPage":"home"===t.name?"home":"end"===t.name?"end":"up"===t.name?"up":"down"===t.name?"down":"right"===t.name?"right":"left"===t.name&&"left"}}},8694:(t,e,i)=>{"use strict";const r=i(9420),{erase:s,cursor:n}=i(2698);t.exports=function(t,e){if(!e)return s.line+n.to(0);let i=0;const o=t.split(/\r?\n/);for(let t of o)i+=1+Math.floor(Math.max([...r(t)].length-1,0)/e);return s.lines(i)}},2163:t=>{"use strict";t.exports=(t,e,i)=>{i=i||e;let r=Math.min(e-i,t-Math.floor(i/2));return r<0&&(r=0),{startIndex:r,endIndex:Math.min(r+i,e)}}},4815:t=>{"use strict";const e={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},i={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},r="win32"===process.platform?i:e;t.exports=r},9016:(t,e,i)=>{"use strict";t.exports={action:i(2866),clear:i(8694),style:i(424),strip:i(9420),figures:i(4815),lines:i(4985),wrap:i(8524),entriesToDisplay:i(2163)}},4985:(t,e,i)=>{"use strict";const r=i(9420);t.exports=function(t,e){let i=String(r(t)||"").split(/\r?\n/);return e?i.map((t=>Math.ceil(t.length/e))).reduce(((t,e)=>t+e)):i.length}},9420:t=>{"use strict";t.exports=t=>{const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),i=new RegExp(e,"g");return"string"==typeof t?t.replace(i,""):t}},424:(t,e,i)=>{"use strict";const r=i(1391),s=i(4815),n=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),o=Object.freeze({aborted:r.red(s.cross),done:r.green(s.tick),exited:r.yellow(s.cross),default:r.cyan("?")});t.exports={styles:n,render:t=>n[t]||n.default,symbols:o,symbol:(t,e,i)=>e?o.aborted:i?o.exited:t?o.done:o.default,delimiter:t=>r.gray(t?s.ellipsis:s.pointerSmall),item:(t,e)=>r.gray(t?e?s.pointerSmall:"+":s.line)}},8524:t=>{"use strict";t.exports=(t,e={})=>{const i=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",r=e.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,e)=>(e.length+i.length>=r||t[t.length-1].length+e.length+1{"use strict";const e={to:(t,e)=>e?`[${e+1};${t+1}H`:`[${t+1}G`,move(t,e){let i="";return t<0?i+=`[${-t}D`:t>0&&(i+=`[${t}C`),e<0?i+=`[${-e}A`:e>0&&(i+=`[${e}B`),i},up:(t=1)=>`[${t}A`,down:(t=1)=>`[${t}B`,forward:(t=1)=>`[${t}C`,backward:(t=1)=>`[${t}D`,nextLine:(t=1)=>"".repeat(t),prevLine:(t=1)=>"".repeat(t),left:"",hide:"[?25l",show:"[?25h",save:"7",restore:"8"},i={screen:"",up:(t=1)=>"".repeat(t),down:(t=1)=>"".repeat(t),line:"",lineEnd:"",lineStart:"",lines(t){let i="";for(let r=0;r"".repeat(t),down:(t=1)=>"".repeat(t)},erase:i,beep:""}},2081:t=>{"use strict";t.exports=require("child_process")},2361:t=>{"use strict";t.exports=require("events")},7147:t=>{"use strict";t.exports=require("fs")},7718:t=>{"use strict";t.exports=require("node:child_process")},2037:t=>{"use strict";t.exports=require("os")},1017:t=>{"use strict";t.exports=require("path")},7282:t=>{"use strict";t.exports=require("process")},4521:t=>{"use strict";t.exports=require("readline")},6224:t=>{"use strict";t.exports=require("tty")},7461:(t,e,i)=>{const{Argument:r}=i(8998),{Command:s}=i(5282),{CommanderError:n,InvalidArgumentError:o}=i(8056),{Help:h}=i(8917),{Option:a}=i(5790);(e=t.exports=new s).program=e,e.Argument=r,e.Command=s,e.CommanderError=n,e.Help=h,e.InvalidArgumentError=o,e.InvalidOptionArgumentError=o,e.Option=a},8998:(t,e,i)=>{const{InvalidArgumentError:r}=i(8056);e.Argument=class{constructor(t,e){switch(this.description=e||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,e){return e!==this.defaultValue&&Array.isArray(e)?e.concat(t):[t]}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,e)=>{if(!this.argChoices.includes(t))throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,e):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},e.humanReadableArgName=function(t){const e=t.name()+(!0===t.variadic?"...":"");return t.required?"<"+e+">":"["+e+"]"}},5282:(t,e,i)=>{const r=i(2361).EventEmitter,s=i(2081),n=i(1017),o=i(7147),h=i(7282),{Argument:a,humanReadableArgName:l}=i(8998),{CommanderError:u}=i(8056),{Help:c}=i(8917),{Option:d,splitOptionFlags:p,DualOptions:m}=i(5790),{suggestSimilar:g}=i(1812);class f extends r{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:t=>h.stdout.write(t),writeErr:t=>h.stderr.write(t),getOutHelpWidth:()=>h.stdout.isTTY?h.stdout.columns:void 0,getErrHelpWidth:()=>h.stderr.isTTY?h.stderr.columns:void 0,outputError:(t,e)=>e(t)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._hasHelpOption=t._hasHelpOption,this._helpFlags=t._helpFlags,this._helpDescription=t._helpDescription,this._helpShortFlag=t._helpShortFlag,this._helpLongFlag=t._helpLongFlag,this._helpCommandName=t._helpCommandName,this._helpCommandnameAndArgs=t._helpCommandnameAndArgs,this._helpCommandDescription=t._helpCommandDescription,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}command(t,e,i){let r=e,s=i;"object"==typeof r&&null!==r&&(s=r,r=null),s=s||{};const[,n,o]=t.match(/([^ ]+) *(.*)/),h=this.createCommand(n);return r&&(h.description(r),h._executableHandler=!0),s.isDefault&&(this._defaultCommandName=h._name),h._hidden=!(!s.noHelp&&!s.hidden),h._executableFile=s.executableFile||null,o&&h.arguments(o),this.commands.push(h),h.parent=this,h.copyInheritedSettings(this),r?this:h}createCommand(t){return new f(t)}createHelp(){return Object.assign(new c,this.configureHelp())}configureHelp(t){return void 0===t?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return void 0===t?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return"string"!=typeof t&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,e){if(!t._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(e=e||{}).isDefault&&(this._defaultCommandName=t._name),(e.noHelp||e.hidden)&&(t._hidden=!0),this.commands.push(t),t.parent=this,this}createArgument(t,e){return new a(t,e)}argument(t,e,i,r){const s=this.createArgument(t,e);return"function"==typeof i?s.default(r).argParser(i):s.default(i),this.addArgument(s),this}arguments(t){return t.split(/ +/).forEach((t=>{this.argument(t)})),this}addArgument(t){const e=this._args.slice(-1)[0];if(e&&e.variadic)throw new Error(`only the last argument can be variadic '${e.name()}'`);if(t.required&&void 0!==t.defaultValue&&void 0===t.parseArg)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this._args.push(t),this}addHelpCommand(t,e){return!1===t?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof t&&(this._helpCommandName=t.split(" ")[0],this._helpCommandnameAndArgs=t),this._helpCommandDescription=e||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(t,e){const i=["preSubcommand","preAction","postAction"];if(!i.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(e):this._lifeCycleHooks[t]=[e],this}exitOverride(t){return this._exitCallback=t||(t=>{if("commander.executeSubCommandAsync"!==t.code)throw t}),this}_exit(t,e,i){this._exitCallback&&this._exitCallback(new u(t,e,i)),h.exit(t)}action(t){return this._actionHandler=e=>{const i=this._args.length,r=e.slice(0,i);return this._storeOptionsAsProperties?r[i]=this:r[i]=this.opts(),r.push(this),t.apply(this,r)},this}createOption(t,e){return new d(t,e)}addOption(t){const e=t.name(),i=t.attributeName();if(t.negate){const e=t.long.replace(/^--no-/,"--");this._findOption(e)||this.setOptionValueWithSource(i,void 0===t.defaultValue||t.defaultValue,"default")}else void 0!==t.defaultValue&&this.setOptionValueWithSource(i,t.defaultValue,"default");this.options.push(t);const r=(e,r,s)=>{null==e&&void 0!==t.presetArg&&(e=t.presetArg);const n=this.getOptionValue(i);if(null!==e&&t.parseArg)try{e=t.parseArg(e,n)}catch(t){if("commander.invalidArgument"===t.code){const e=`${r} ${t.message}`;this.error(e,{exitCode:t.exitCode,code:t.code})}throw t}else null!==e&&t.variadic&&(e=t._concatValue(e,n));null==e&&(e=!t.negate&&(!(!t.isBoolean()&&!t.optional)||"")),this.setOptionValueWithSource(i,e,s)};return this.on("option:"+e,(e=>{const i=`error: option '${t.flags}' argument '${e}' is invalid.`;r(e,i,"cli")})),t.envVar&&this.on("optionEnv:"+e,(e=>{const i=`error: option '${t.flags}' value '${e}' from env '${t.envVar}' is invalid.`;r(e,i,"env")})),this}_optionEx(t,e,i,r,s){if("object"==typeof e&&e instanceof d)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const n=this.createOption(e,i);if(n.makeOptionMandatory(!!t.mandatory),"function"==typeof r)n.default(s).argParser(r);else if(r instanceof RegExp){const t=r;r=(e,i)=>{const r=t.exec(e);return r?r[0]:i},n.default(s).argParser(r)}else n.default(r);return this.addOption(n)}option(t,e,i,r){return this._optionEx({},t,e,i,r)}requiredOption(t,e,i,r){return this._optionEx({mandatory:!0},t,e,i,r)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){if(this._passThroughOptions=!!t,this.parent&&t&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(t=!0){if(this._storeOptionsAsProperties=!!t,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,e){return this._storeOptionsAsProperties?this[t]=e:this._optionValues[t]=e,this}setOptionValueWithSource(t,e,i){return this.setOptionValue(t,e),this._optionValueSources[t]=i,this}getOptionValueSource(t){return this._optionValueSources[t]}_prepareUserArgs(t,e){if(void 0!==t&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");let i;switch(e=e||{},void 0===t&&(t=h.argv,h.versions&&h.versions.electron&&(e.from="electron")),this.rawArgs=t.slice(),e.from){case void 0:case"node":this._scriptPath=t[1],i=t.slice(2);break;case"electron":h.defaultApp?(this._scriptPath=t[1],i=t.slice(2)):i=t.slice(1);break;case"user":i=t.slice(0);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(t,e){const i=this._prepareUserArgs(t,e);return this._parseCommand([],i),this}async parseAsync(t,e){const i=this._prepareUserArgs(t,e);return await this._parseCommand([],i),this}_executeSubCommand(t,e){e=e.slice();let i=!1;const r=[".js",".ts",".tsx",".mjs",".cjs"];function a(t,e){const i=n.resolve(t,e);if(o.existsSync(i))return i;if(r.includes(n.extname(e)))return;const s=r.find((t=>o.existsSync(`${i}${t}`)));return s?`${i}${s}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let l,c=t._executableFile||`${this._name}-${t._name}`,d=this._executableDir||"";if(this._scriptPath){let t;try{t=o.realpathSync(this._scriptPath)}catch(e){t=this._scriptPath}d=n.resolve(n.dirname(t),d)}if(d){let e=a(d,c);if(!e&&!t._executableFile&&this._scriptPath){const i=n.basename(this._scriptPath,n.extname(this._scriptPath));i!==this._name&&(e=a(d,`${i}-${t._name}`))}c=e||c}i=r.includes(n.extname(c)),"win32"!==h.platform?i?(e.unshift(c),e=b(h.execArgv).concat(e),l=s.spawn(h.argv[0],e,{stdio:"inherit"})):l=s.spawn(c,e,{stdio:"inherit"}):(e.unshift(c),e=b(h.execArgv).concat(e),l=s.spawn(h.execPath,e,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((t=>{h.on(t,(()=>{!1===l.killed&&null===l.exitCode&&l.kill(t)}))}));const p=this._exitCallback;p?l.on("close",(()=>{p(new u(h.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):l.on("close",h.exit.bind(h)),l.on("error",(e=>{if("ENOENT"===e.code){const e=d?`searched for local subcommand relative to directory '${d}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${c}' does not exist\n - if '${t._name}' 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 - ${e}`;throw new Error(i)}if("EACCES"===e.code)throw new Error(`'${c}' not executable`);if(p){const t=new u(1,"commander.executeSubCommandAsync","(error)");t.nestedError=e,p(t)}else h.exit(1)})),this.runningCommand=l}_dispatchSubcommand(t,e,i){const r=this._findCommand(t);let s;return r||this.help({error:!0}),s=this._chainOrCallSubCommandHook(s,r,"preSubcommand"),s=this._chainOrCall(s,(()=>{if(!r._executableHandler)return r._parseCommand(e,i);this._executeSubCommand(r,e.concat(i))})),s}_checkNumberOfArguments(){this._args.forEach(((t,e)=>{t.required&&null==this.args[e]&&this.missingArgument(t.name())})),this._args.length>0&&this._args[this._args.length-1].variadic||this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const t=(t,e,i)=>{let r=e;if(null!==e&&t.parseArg)try{r=t.parseArg(e,i)}catch(i){if("commander.invalidArgument"===i.code){const r=`error: command-argument value '${e}' is invalid for argument '${t.name()}'. ${i.message}`;this.error(r,{exitCode:i.exitCode,code:i.code})}throw i}return r};this._checkNumberOfArguments();const e=[];this._args.forEach(((i,r)=>{let s=i.defaultValue;i.variadic?rt(i,r,e)),i.defaultValue))):void 0===s&&(s=[]):re())):e()}_chainOrCallHooks(t,e){let i=t;const r=[];return y(this).reverse().filter((t=>void 0!==t._lifeCycleHooks[e])).forEach((t=>{t._lifeCycleHooks[e].forEach((e=>{r.push({hookedCommand:t,callback:e})}))})),"postAction"===e&&r.reverse(),r.forEach((t=>{i=this._chainOrCall(i,(()=>t.callback(t.hookedCommand,this)))})),i}_chainOrCallSubCommandHook(t,e,i){let r=t;return void 0!==this._lifeCycleHooks[i]&&this._lifeCycleHooks[i].forEach((t=>{r=this._chainOrCall(r,(()=>t(this,e)))})),r}_parseCommand(t,e){const i=this.parseOptions(e);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(i.operands),e=i.unknown,this.args=t.concat(e),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),e);if(this._hasImplicitHelpCommand()&&t[0]===this._helpCommandName)return 1===t.length&&this.help(),this._dispatchSubcommand(t[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return v(this,e),this._dispatchSubcommand(this._defaultCommandName,t,e);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),v(this,i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const r=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){let i;return r(),this._processArguments(),i=this._chainOrCallHooks(i,"preAction"),i=this._chainOrCall(i,(()=>this._actionHandler(this.processedArgs))),this.parent&&(i=this._chainOrCall(i,(()=>{this.parent.emit(s,t,e)}))),i=this._chainOrCallHooks(i,"postAction"),i}if(this.parent&&this.parent.listenerCount(s))r(),this._processArguments(),this.parent.emit(s,t,e);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,e);this.listenerCount("command:*")?this.emit("command:*",t,e):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(t){if(t)return this.commands.find((e=>e._name===t||e._aliases.includes(t)))}_findOption(t){return this.options.find((e=>e.is(t)))}_checkForMissingMandatoryOptions(){for(let t=this;t;t=t.parent)t.options.forEach((e=>{e.mandatory&&void 0===t.getOptionValue(e.attributeName())&&t.missingMandatoryOptionValue(e)}))}_checkForConflictingLocalOptions(){const t=this.options.filter((t=>{const e=t.attributeName();return void 0!==this.getOptionValue(e)&&"default"!==this.getOptionValueSource(e)}));t.filter((t=>t.conflictsWith.length>0)).forEach((e=>{const i=t.find((t=>e.conflictsWith.includes(t.attributeName())));i&&this._conflictingOption(e,i)}))}_checkForConflictingOptions(){for(let t=this;t;t=t.parent)t._checkForConflictingLocalOptions()}parseOptions(t){const e=[],i=[];let r=e;const s=t.slice();function n(t){return t.length>1&&"-"===t[0]}let o=null;for(;s.length;){const t=s.shift();if("--"===t){r===i&&r.push(t),r.push(...s);break}if(!o||n(t)){if(o=null,n(t)){const e=this._findOption(t);if(e){if(e.required){const t=s.shift();void 0===t&&this.optionMissingArgument(e),this.emit(`option:${e.name()}`,t)}else if(e.optional){let t=null;s.length>0&&!n(s[0])&&(t=s.shift()),this.emit(`option:${e.name()}`,t)}else this.emit(`option:${e.name()}`);o=e.variadic?e:null;continue}}if(t.length>2&&"-"===t[0]&&"-"!==t[1]){const e=this._findOption(`-${t[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,t.slice(2)):(this.emit(`option:${e.name()}`),s.unshift(`-${t.slice(2)}`));continue}}if(/^--[^=]+=/.test(t)){const e=t.indexOf("="),i=this._findOption(t.slice(0,e));if(i&&(i.required||i.optional)){this.emit(`option:${i.name()}`,t.slice(e+1));continue}}if(n(t)&&(r=i),(this._enablePositionalOptions||this._passThroughOptions)&&0===e.length&&0===i.length){if(this._findCommand(t)){e.push(t),s.length>0&&i.push(...s);break}if(t===this._helpCommandName&&this._hasImplicitHelpCommand()){e.push(t),s.length>0&&e.push(...s);break}if(this._defaultCommandName){i.push(t),s.length>0&&i.push(...s);break}}if(this._passThroughOptions){r.push(t),s.length>0&&r.push(...s);break}r.push(t)}else this.emit(`option:${o.name()}`,t)}return{operands:e,unknown:i}}opts(){if(this._storeOptionsAsProperties){const t={},e=this.options.length;for(let i=0;iObject.assign(t,e.opts())),{})}error(t,e){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const i=e||{},r=i.exitCode||1,s=i.code||"commander.error";this._exit(r,s,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in h.env){const e=t.attributeName();(void 0===this.getOptionValue(e)||["default","config","env"].includes(this.getOptionValueSource(e)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,h.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}}))}_parseOptionsImplied(){const t=new m(this.options),e=t=>void 0!==this.getOptionValue(t)&&!["default","implied"].includes(this.getOptionValueSource(t));this.options.filter((i=>void 0!==i.implied&&e(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i))).forEach((t=>{Object.keys(t.implied).filter((t=>!e(t))).forEach((e=>{this.setOptionValueWithSource(e,t.implied[e],"implied")}))}))}missingArgument(t){const e=`error: missing required argument '${t}'`;this.error(e,{code:"commander.missingArgument"})}optionMissingArgument(t){const e=`error: option '${t.flags}' argument missing`;this.error(e,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const e=`error: required option '${t.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,e){const i=t=>{const e=t.attributeName(),i=this.getOptionValue(e),r=this.options.find((t=>t.negate&&e===t.attributeName())),s=this.options.find((t=>!t.negate&&e===t.attributeName()));return r&&(void 0===r.presetArg&&!1===i||void 0!==r.presetArg&&i===r.presetArg)?r:s||t},r=t=>{const e=i(t),r=e.attributeName();return"env"===this.getOptionValueSource(r)?`environment variable '${e.envVar}'`:`option '${e.flags}'`},s=`error: ${r(t)} cannot be used with ${r(e)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],r=this;do{const t=r.createHelp().visibleOptions(r).filter((t=>t.long)).map((t=>t.long));i=i.concat(t),r=r.parent}while(r&&!r._enablePositionalOptions);e=g(t,i)}const i=`error: unknown option '${t}'${e}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const e=this._args.length,i=1===e?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${e} argument${i} but got ${t.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let e="";if(this._showSuggestionAfterError){const i=[];this.createHelp().visibleCommands(this).forEach((t=>{i.push(t.name()),t.alias()&&i.push(t.alias())})),e=g(t,i)}const i=`error: unknown command '${t}'${e}`;this.error(i,{code:"commander.unknownCommand"})}version(t,e,i){if(void 0===t)return this._version;this._version=t,e=e||"-V, --version",i=i||"output the version number";const r=this.createOption(e,i);return this._versionOptionName=r.attributeName(),this.options.push(r),this.on("option:"+r.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`),this._exit(0,"commander.version",t)})),this}description(t,e){return void 0===t&&void 0===e?this._description:(this._description=t,e&&(this._argsDescription=e),this)}summary(t){return void 0===t?this._summary:(this._summary=t,this)}alias(t){if(void 0===t)return this._aliases[0];let e=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(e=this.commands[this.commands.length-1]),t===e._name)throw new Error("Command alias can't be the same as its name");return e._aliases.push(t),this}aliases(t){return void 0===t?this._aliases:(t.forEach((t=>this.alias(t))),this)}usage(t){if(void 0===t){if(this._usage)return this._usage;const t=this._args.map((t=>l(t)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?t:[]).join(" ")}return this._usage=t,this}name(t){return void 0===t?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=n.basename(t,n.extname(t)),this}executableDir(t){return void 0===t?this._executableDir:(this._executableDir=t,this)}helpInformation(t){const e=this.createHelp();return void 0===e.helpWidth&&(e.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),e.formatHelp(this,e)}_getHelpContext(t){const e={error:!!(t=t||{}).error};let i;return i=e.error?t=>this._outputConfiguration.writeErr(t):t=>this._outputConfiguration.writeOut(t),e.write=t.write||i,e.command=this,e}outputHelp(t){let e;"function"==typeof t&&(e=t,t=void 0);const i=this._getHelpContext(t);y(this).reverse().forEach((t=>t.emit("beforeAllHelp",i))),this.emit("beforeHelp",i);let r=this.helpInformation(i);if(e&&(r=e(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(r),this.emit(this._helpLongFlag),this.emit("afterHelp",i),y(this).forEach((t=>t.emit("afterAllHelp",i)))}helpOption(t,e){if("boolean"==typeof t)return this._hasHelpOption=t,this;this._helpFlags=t||this._helpFlags,this._helpDescription=e||this._helpDescription;const i=p(this._helpFlags);return this._helpShortFlag=i.shortFlag,this._helpLongFlag=i.longFlag,this}help(t){this.outputHelp(t);let e=h.exitCode||0;0===e&&t&&"function"!=typeof t&&t.error&&(e=1),this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){const i=["beforeAll","before","after","afterAll"];if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${i.join("', '")}'`);const r=`${t}Help`;return this.on(r,(t=>{let i;i="function"==typeof e?e({error:t.error,command:t.command}):e,i&&t.write(`${i}\n`)})),this}}function v(t,e){t._hasHelpOption&&e.find((e=>e===t._helpLongFlag||e===t._helpShortFlag))&&(t.outputHelp(),t._exit(0,"commander.helpDisplayed","(outputHelp)"))}function b(t){return t.map((t=>{if(!t.startsWith("--inspect"))return t;let e,i,r="127.0.0.1",s="9229";return null!==(i=t.match(/^(--inspect(-brk)?)$/))?e=i[1]:null!==(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(e=i[1],/^\d+$/.test(i[3])?s=i[3]:r=i[3]):null!==(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(e=i[1],r=i[3],s=i[4]),e&&"0"!==s?`${e}=${r}:${parseInt(s)+1}`:t}))}function y(t){const e=[];for(let i=t;i;i=i.parent)e.push(i);return e}e.Command=f},8056:(t,e)=>{class i extends Error{constructor(t,e,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=e,this.exitCode=t,this.nestedError=void 0}}e.CommanderError=i,e.InvalidArgumentError=class extends i{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}},8917:(t,e,i)=>{const{humanReadableArgName:r}=i(8998);e.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(t){const e=t.commands.filter((t=>!t._hidden));if(t._hasImplicitHelpCommand()){const[,i,r]=t._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),s=t.createCommand(i).helpOption(!1);s.description(t._helpCommandDescription),r&&s.arguments(r),e.push(s)}return this.sortSubcommands&&e.sort(((t,e)=>t.name().localeCompare(e.name()))),e}visibleOptions(t){const e=t.options.filter((t=>!t.hidden)),i=t._hasHelpOption&&t._helpShortFlag&&!t._findOption(t._helpShortFlag),r=t._hasHelpOption&&!t._findOption(t._helpLongFlag);if(i||r){let s;s=i?r?t.createOption(t._helpFlags,t._helpDescription):t.createOption(t._helpShortFlag,t._helpDescription):t.createOption(t._helpLongFlag,t._helpDescription),e.push(s)}if(this.sortOptions){const t=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");e.sort(((e,i)=>t(e).localeCompare(t(i))))}return e}visibleArguments(t){return t._argsDescription&&t._args.forEach((e=>{e.description=e.description||t._argsDescription[e.name()]||""})),t._args.find((t=>t.description))?t._args:[]}subcommandTerm(t){const e=t._args.map((t=>r(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,e){return e.visibleCommands(t).reduce(((t,i)=>Math.max(t,e.subcommandTerm(i).length)),0)}longestOptionTermLength(t,e){return e.visibleOptions(t).reduce(((t,i)=>Math.max(t,e.optionTerm(i).length)),0)}longestArgumentTermLength(t,e){return e.visibleArguments(t).reduce(((t,i)=>Math.max(t,e.argumentTerm(i).length)),0)}commandUsage(t){let e=t._name;t._aliases[0]&&(e=e+"|"+t._aliases[0]);let i="";for(let e=t.parent;e;e=e.parent)i=e.name()+" "+i;return i+e+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){const e=[];return t.argChoices&&e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`),void 0!==t.defaultValue&&(t.required||t.optional||t.isBoolean()&&"boolean"==typeof t.defaultValue)&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),void 0!==t.presetArg&&t.optional&&e.push(`preset: ${JSON.stringify(t.presetArg)}`),void 0!==t.envVar&&e.push(`env: ${t.envVar}`),e.length>0?`${t.description} (${e.join(", ")})`:t.description}argumentDescription(t){const e=[];if(t.argChoices&&e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`),void 0!==t.defaultValue&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),e.length>0){const i=`(${e.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatHelp(t,e){const i=e.padWidth(t,e),r=e.helpWidth||80;function s(t,s){if(s){const n=`${t.padEnd(i+2)}${s}`;return e.wrap(n,r-2,i+2)}return t}function n(t){return t.join("\n").replace(/^/gm," ".repeat(2))}let o=[`Usage: ${e.commandUsage(t)}`,""];const h=e.commandDescription(t);h.length>0&&(o=o.concat([h,""]));const a=e.visibleArguments(t).map((t=>s(e.argumentTerm(t),e.argumentDescription(t))));a.length>0&&(o=o.concat(["Arguments:",n(a),""]));const l=e.visibleOptions(t).map((t=>s(e.optionTerm(t),e.optionDescription(t))));l.length>0&&(o=o.concat(["Options:",n(l),""]));const u=e.visibleCommands(t).map((t=>s(e.subcommandTerm(t),e.subcommandDescription(t))));return u.length>0&&(o=o.concat(["Commands:",n(u),""])),o.join("\n")}padWidth(t,e){return Math.max(e.longestOptionTermLength(t,e),e.longestSubcommandTermLength(t,e),e.longestArgumentTermLength(t,e))}wrap(t,e,i,r=40){if(t.match(/[\n]\s+/))return t;const s=e-i;if(s("\n"===t.slice(-1)&&(t=t.slice(0,t.length-1)),(e>0?h:"")+t.trimRight()))).join("\n")}}},5790:(t,e,i)=>{const{InvalidArgumentError:r}=i(8056);function s(t){let e,i;const r=t.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(e=r.shift()),i=r.shift(),!e&&/^-[^-]$/.test(i)&&(e=i,i=void 0),{shortFlag:e,longFlag:i}}e.Option=class{constructor(t,e){this.flags=t,this.description=e||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;const i=s(t);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){return this.implied=Object.assign(this.implied||{},t),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,e){return e!==this.defaultValue&&Array.isArray(e)?e.concat(t):[t]}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,e)=>{if(!this.argChoices.includes(t))throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,e):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce(((t,e)=>t+e[0].toUpperCase()+e.slice(1)))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},e.splitOptionFlags=s,e.DualOptions=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach((t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)})),this.negativeOptions.forEach(((t,e)=>{this.positiveOptions.has(e)&&this.dualOptions.add(e)}))}valueFromOption(t,e){const i=e.attributeName();if(!this.dualOptions.has(i))return!0;const r=this.negativeOptions.get(i).presetArg,s=void 0!==r&&r;return e.negate===(s===t)}}},1812:(t,e)=>{e.suggestSimilar=function(t,e){if(!e||0===e.length)return"";e=Array.from(new Set(e));const i=t.startsWith("--");i&&(t=t.slice(2),e=e.map((t=>t.slice(2))));let r=[],s=3;return e.forEach((e=>{if(e.length<=1)return;const i=function(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);const i=[];for(let e=0;e<=t.length;e++)i[e]=[e];for(let t=0;t<=e.length;t++)i[0][t]=t;for(let r=1;r<=e.length;r++)for(let s=1;s<=t.length;s++){let n=1;n=t[s-1]===e[r-1]?0:1,i[s][r]=Math.min(i[s-1][r]+1,i[s][r-1]+1,i[s-1][r-1]+n),s>1&&r>1&&t[s-1]===e[r-2]&&t[s-2]===e[r-1]&&(i[s][r]=Math.min(i[s][r],i[s-2][r-2]+1))}return i[t.length][e.length]}(t,e),n=Math.max(t.length,e.length);(n-i)/n>.4&&(it.localeCompare(e))),i&&(r=r.map((t=>`--${t}`))),r.length>1?`\n(Did you mean one of ${r.join(", ")}?)`:1===r.length?`\n(Did you mean ${r[0]}?)`:""}}},e={};function i(r){var s=e[r];if(void 0!==s)return s.exports;var n=e[r]={id:r,loaded:!1,exports:{}};return t[r](n,n.exports,i),n.loaded=!0,n.exports}i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r,s,n,o={};r=i(7461).Command,s=i(1307),(n=new r).name("leto-modelizer-plugin-cli").description("CLI install and manage plugins in leto-modelizer").version("0.1.1"),Object.keys(s).forEach((function(t){return s[t].setup(n)})),n.parse();var h=exports;for(var a in o)h[a]=o[a];o.__esModule&&Object.defineProperty(h,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{var t={652:(t,e,i)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function s(){"use strict";s=function(){return t};var t={},e=Object.prototype,i=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",h=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function l(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,i){return t[e]=i}}function u(t,e,i,r){var s=e&&e.prototype instanceof p?e:p,n=Object.create(s.prototype),o=new C(r||[]);return n._invoke=function(t,e,i){var r="suspendedStart";return function(s,n){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===s)throw n;return{value:void 0,done:!0}}for(i.method=s,i.arg=n;;){var o=i.delegate;if(o){var h=_(o,i);if(h){if(h===d)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===r)throw r="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r="executing";var a=c(t,e,i);if("normal"===a.type){if(r=i.done?"completed":"suspendedYield",a.arg===d)continue;return{value:a.arg,done:i.done}}"throw"===a.type&&(r="completed",i.method="throw",i.arg=a.arg)}}}(t,i,o),n}function c(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var d={};function p(){}function m(){}function g(){}var f={};l(f,o,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(k([])));b&&b!==e&&i.call(b,o)&&(f=b);var y=g.prototype=p.prototype=Object.create(f);function w(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function s(n,o,h,a){var l=c(t[n],t,o);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==r(d)&&i.call(d,"__await")?e.resolve(d.__await).then((function(t){s("next",t,h,a)}),(function(t){s("throw",t,h,a)})):e.resolve(d).then((function(t){u.value=t,h(u)}),(function(t){return s("throw",t,h,a)}))}a(l.arg)}var n;this._invoke=function(t,i){function r(){return new e((function(e,r){s(t,i,e,r)}))}return n=n?n.then(r,r):r()}}function _(t,e){var i=t.iterator[e.method];if(void 0===i){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=c(i,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,d;var s=r.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function k(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,s=function e(){for(;++r=0;--s){var n=this.tryEntries[s],o=n.completion;if("root"===n.tryLoc)return r("end");if(n.tryLoc<=this.prev){var h=i.call(n,"catchLoc"),a=i.call(n,"finallyLoc");if(h&&a){if(this.prev=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),S(i),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var s=r.arg;S(i)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:k(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=void 0),d}},t}function n(t,e,i,r,s,n,o){try{var h=t[n](o),a=h.value}catch(t){return void i(t)}h.done?e(a):Promise.resolve(a).then(r,s)}function o(t){return function(){var e=this,i=arguments;return new Promise((function(r,s){var o=t.apply(e,i);function h(t){n(o,r,s,h,a,"next",t)}function a(t){n(o,r,s,h,a,"throw",t)}h(void 0)}))}}var h=i(4061),a=i(7147);function l(t){return t.replaceAll(/(-.)/gi,(function(t){return t.replace("-","").toUpperCase()}))}e.setup=function(t){t.command("init").description("Init plugin files").action(o(s().mark((function t(){var e,i,r,n;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=[],!a.existsSync("plugin.config.json")){t.next=6;break}i=JSON.parse(a.readFileSync("plugin.config.json","utf8")),e=e.concat(i.plugins),t.next=8;break;case 6:return console.log("\n".concat(h.red("✘")," plugin.config.json file was not found. Use 'cli install' to create it.\n")),t.abrupt("return");case 8:e.forEach((function(t){var e="./node_modules/".concat(t,"/public/"),i="./public/plugins/".concat(l(t),"/");a.existsSync(e)?(a.cpSync(e,i,{recursive:!0}),console.log("\n".concat(h.green("✔")," Plugin '").concat(t,"': Icons and models are imported."))):console.log("\n".concat(h.red("✘")," Plugin '").concat(t,"': No icons and models are imported."))})),e.length>0&&(r=e.map((function(t){return"import ".concat(l(t)," from '").concat(t,"';")})),n=[r.join("\n"),"\nexport default {",e.map((function(t){return"".concat(l(t),",")})).join("\n"),"};"].join("\n"),a.existsSync("src/plugins")||a.mkdirSync("src/plugins"),a.writeFileSync("src/plugins/index.js",n),console.log("\n".concat(h.green("✔")," 'src/plugins/index.js' has been created or updated.\n")));case 10:case"end":return t.stop()}}),t)}))))}},6460:(t,e,i)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function s(){"use strict";s=function(){return t};var t={},e=Object.prototype,i=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",h=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function l(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,i){return t[e]=i}}function u(t,e,i,r){var s=e&&e.prototype instanceof p?e:p,n=Object.create(s.prototype),o=new C(r||[]);return n._invoke=function(t,e,i){var r="suspendedStart";return function(s,n){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===s)throw n;return{value:void 0,done:!0}}for(i.method=s,i.arg=n;;){var o=i.delegate;if(o){var h=_(o,i);if(h){if(h===d)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===r)throw r="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r="executing";var a=c(t,e,i);if("normal"===a.type){if(r=i.done?"completed":"suspendedYield",a.arg===d)continue;return{value:a.arg,done:i.done}}"throw"===a.type&&(r="completed",i.method="throw",i.arg=a.arg)}}}(t,i,o),n}function c(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var d={};function p(){}function m(){}function g(){}var f={};l(f,o,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(k([])));b&&b!==e&&i.call(b,o)&&(f=b);var y=g.prototype=p.prototype=Object.create(f);function w(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function s(n,o,h,a){var l=c(t[n],t,o);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==r(d)&&i.call(d,"__await")?e.resolve(d.__await).then((function(t){s("next",t,h,a)}),(function(t){s("throw",t,h,a)})):e.resolve(d).then((function(t){u.value=t,h(u)}),(function(t){return s("throw",t,h,a)}))}a(l.arg)}var n;this._invoke=function(t,i){function r(){return new e((function(e,r){s(t,i,e,r)}))}return n=n?n.then(r,r):r()}}function _(t,e){var i=t.iterator[e.method];if(void 0===i){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=c(i,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,d;var s=r.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function k(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,s=function e(){for(;++r=0;--s){var n=this.tryEntries[s],o=n.completion;if("root"===n.tryLoc)return r("end");if(n.tryLoc<=this.prev){var h=i.call(n,"catchLoc"),a=i.call(n,"finallyLoc");if(h&&a){if(this.prev=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),S(i),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var s=r.arg;S(i)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:k(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=void 0),d}},t}function n(t,e,i,r,s,n,o){try{var h=t[n](o),a=h.value}catch(t){return void i(t)}h.done?e(a):Promise.resolve(a).then(r,s)}function o(t){return function(){var e=this,i=arguments;return new Promise((function(r,s){var o=t.apply(e,i);function h(t){n(o,r,s,h,a,"next",t)}function a(t){n(o,r,s,h,a,"throw",t)}h(void 0)}))}}var h=i(4061),a=i(7147),l=i(7718).execSync,u=i(5358);e.setup=function(t){t.command("install").description("Install plugin in leto-modelizer").action(o(s().mark((function t(){var e,i,r,n,o,c,d;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.getName();case 2:return e=t.sent,i=e.pluginName,t.next=6,u.getRepositoryUrl();case 6:if(r=t.sent,n=r.repositoryUrl,console.log("\n".concat(h.blue.bold("⚒")," Installing plugin via npm...")),l('npm install -s "'.concat(n,'"')),console.log("\n".concat(h.green("✔")," Installation succeed !")),o=JSON.parse(a.readFileSync("package.json","utf8")),Object.keys(o.dependencies).includes(i)){t.next=16;break}return console.log("\n".concat(h.red("✘")," Could not find plugin name in package.json dependencies")),t.abrupt("return");case 16:c={plugins:[i]},a.existsSync("plugin.config.json")&&((d=JSON.parse(a.readFileSync("plugin.config.json","utf8"))).plugins.includes(i)?c.plugins=d.plugins:c.plugins=c.plugins.concat(d.plugins)),a.writeFileSync("plugin.config.json",JSON.stringify(c,null,2)),console.log("\n".concat(h.yellow("⚠")," If you have install all your plugin, please ").concat(h.bold("'npm run plugin:init'"),".\n"));case 20:case"end":return t.stop()}}),t)}))))}},1307:(t,e,i)=>{var r=i(6460),s=i(652);t.exports={install:r,init:s}},5358:(t,e,i)=>{var r=i(8809);e.getName=function(){return r({type:"text",name:"pluginName",message:"What is your plugin name?",validate:function(t){return/^[a-zA-Z\s-]+$/.test(t)||"Plugin name must be only letters, spaces, or dashes"}})},e.getRepositoryUrl=function(){return r({type:"text",name:"repositoryUrl",message:"What is your git repository url?",validate:function(t){return/^(?:git@|http:\/\/|https:\/\/).+\.git(#.+)?$/.test(t)||'Invalid repository url, must be like "git@github.com/repository.git", "http(s)://github.com/repository.git" or "http(s)://github.com/repository.git#1.0.0"'}})}},6064:(t,e,i)=>{"use strict";t=i.nmd(t);const r=(t,e)=>(...i)=>`[${t(...i)+e}m`,s=(t,e)=>(...i)=>{const r=t(...i);return`[${38+e};5;${r}m`},n=(t,e)=>(...i)=>{const r=t(...i);return`[${38+e};2;${r[0]};${r[1]};${r[2]}m`},o=t=>t,h=(t,e,i)=>[t,e,i],a=(t,e,i)=>{Object.defineProperty(t,e,{get:()=>{const r=i();return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})};let l;const u=(t,e,r,s)=>{void 0===l&&(l=i(1621));const n=s?10:0,o={};for(const[i,s]of Object.entries(l)){const h="ansi16"===i?"ansi":i;i===e?o[h]=t(r,n):"object"==typeof s&&(o[h]=t(s[e],n))}return o};Object.defineProperty(t,"exports",{enumerable:!0,get:function(){const t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(const[i,r]of Object.entries(e)){for(const[i,s]of Object.entries(r))e[i]={open:`[${s[0]}m`,close:`[${s[1]}m`},r[i]=e[i],t.set(s[0],s[1]);Object.defineProperty(e,i,{value:r,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="",e.bgColor.close="",a(e.color,"ansi",(()=>u(r,"ansi16",o,!1))),a(e.color,"ansi256",(()=>u(s,"ansi256",o,!1))),a(e.color,"ansi16m",(()=>u(n,"rgb",h,!1))),a(e.bgColor,"ansi",(()=>u(r,"ansi16",o,!0))),a(e.bgColor,"ansi256",(()=>u(s,"ansi256",o,!0))),a(e.bgColor,"ansi16m",(()=>u(n,"rgb",h,!0))),e}})},3583:(t,e,i)=>{const r=i(6771),s={};for(const t of Object.keys(r))s[r[t]]=t;const n={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};t.exports=n;for(const t of Object.keys(n)){if(!("channels"in n[t]))throw new Error("missing channels property: "+t);if(!("labels"in n[t]))throw new Error("missing channel labels property: "+t);if(n[t].labels.length!==n[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:i}=n[t];delete n[t].channels,delete n[t].labels,Object.defineProperty(n[t],"channels",{value:e}),Object.defineProperty(n[t],"labels",{value:i})}n.rgb.hsl=function(t){const e=t[0]/255,i=t[1]/255,r=t[2]/255,s=Math.min(e,i,r),n=Math.max(e,i,r),o=n-s;let h,a;n===s?h=0:e===n?h=(i-r)/o:i===n?h=2+(r-e)/o:r===n&&(h=4+(e-i)/o),h=Math.min(60*h,360),h<0&&(h+=360);const l=(s+n)/2;return a=n===s?0:l<=.5?o/(n+s):o/(2-n-s),[h,100*a,100*l]},n.rgb.hsv=function(t){let e,i,r,s,n;const o=t[0]/255,h=t[1]/255,a=t[2]/255,l=Math.max(o,h,a),u=l-Math.min(o,h,a),c=function(t){return(l-t)/6/u+.5};return 0===u?(s=0,n=0):(n=u/l,e=c(o),i=c(h),r=c(a),o===l?s=r-i:h===l?s=1/3+e-r:a===l&&(s=2/3+i-e),s<0?s+=1:s>1&&(s-=1)),[360*s,100*n,100*l]},n.rgb.hwb=function(t){const e=t[0],i=t[1];let r=t[2];const s=n.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(i,r));return r=1-1/255*Math.max(e,Math.max(i,r)),[s,100*o,100*r]},n.rgb.cmyk=function(t){const e=t[0]/255,i=t[1]/255,r=t[2]/255,s=Math.min(1-e,1-i,1-r);return[100*((1-e-s)/(1-s)||0),100*((1-i-s)/(1-s)||0),100*((1-r-s)/(1-s)||0),100*s]},n.rgb.keyword=function(t){const e=s[t];if(e)return e;let i,n=1/0;for(const e of Object.keys(r)){const s=(h=r[e],((o=t)[0]-h[0])**2+(o[1]-h[1])**2+(o[2]-h[2])**2);s.04045?((e+.055)/1.055)**2.4:e/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,[100*(.4124*e+.3576*i+.1805*r),100*(.2126*e+.7152*i+.0722*r),100*(.0193*e+.1192*i+.9505*r)]},n.rgb.lab=function(t){const e=n.rgb.xyz(t);let i=e[0],r=e[1],s=e[2];return i/=95.047,r/=100,s/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,s=s>.008856?s**(1/3):7.787*s+16/116,[116*r-16,500*(i-r),200*(r-s)]},n.hsl.rgb=function(t){const e=t[0]/360,i=t[1]/100,r=t[2]/100;let s,n,o;if(0===i)return o=255*r,[o,o,o];s=r<.5?r*(1+i):r+i-r*i;const h=2*r-s,a=[0,0,0];for(let t=0;t<3;t++)n=e+1/3*-(t-1),n<0&&n++,n>1&&n--,o=6*n<1?h+6*(s-h)*n:2*n<1?s:3*n<2?h+(s-h)*(2/3-n)*6:h,a[t]=255*o;return a},n.hsl.hsv=function(t){const e=t[0];let i=t[1]/100,r=t[2]/100,s=i;const n=Math.max(r,.01);return r*=2,i*=r<=1?r:2-r,s*=n<=1?n:2-n,[e,100*(0===r?2*s/(n+s):2*i/(r+i)),(r+i)/2*100]},n.hsv.rgb=function(t){const e=t[0]/60,i=t[1]/100;let r=t[2]/100;const s=Math.floor(e)%6,n=e-Math.floor(e),o=255*r*(1-i),h=255*r*(1-i*n),a=255*r*(1-i*(1-n));switch(r*=255,s){case 0:return[r,a,o];case 1:return[h,r,o];case 2:return[o,r,a];case 3:return[o,h,r];case 4:return[a,o,r];case 5:return[r,o,h]}},n.hsv.hsl=function(t){const e=t[0],i=t[1]/100,r=t[2]/100,s=Math.max(r,.01);let n,o;o=(2-i)*r;const h=(2-i)*s;return n=i*s,n/=h<=1?h:2-h,n=n||0,o/=2,[e,100*n,100*o]},n.hwb.rgb=function(t){const e=t[0]/360;let i=t[1]/100,r=t[2]/100;const s=i+r;let n;s>1&&(i/=s,r/=s);const o=Math.floor(6*e),h=1-r;n=6*e-o,0!=(1&o)&&(n=1-n);const a=i+n*(h-i);let l,u,c;switch(o){default:case 6:case 0:l=h,u=a,c=i;break;case 1:l=a,u=h,c=i;break;case 2:l=i,u=h,c=a;break;case 3:l=i,u=a,c=h;break;case 4:l=a,u=i,c=h;break;case 5:l=h,u=i,c=a}return[255*l,255*u,255*c]},n.cmyk.rgb=function(t){const e=t[0]/100,i=t[1]/100,r=t[2]/100,s=t[3]/100;return[255*(1-Math.min(1,e*(1-s)+s)),255*(1-Math.min(1,i*(1-s)+s)),255*(1-Math.min(1,r*(1-s)+s))]},n.xyz.rgb=function(t){const e=t[0]/100,i=t[1]/100,r=t[2]/100;let s,n,o;return s=3.2406*e+-1.5372*i+-.4986*r,n=-.9689*e+1.8758*i+.0415*r,o=.0557*e+-.204*i+1.057*r,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,n=n>.0031308?1.055*n**(1/2.4)-.055:12.92*n,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=Math.min(Math.max(0,s),1),n=Math.min(Math.max(0,n),1),o=Math.min(Math.max(0,o),1),[255*s,255*n,255*o]},n.xyz.lab=function(t){let e=t[0],i=t[1],r=t[2];return e/=95.047,i/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*i-16,500*(e-i),200*(i-r)]},n.lab.xyz=function(t){let e,i,r;i=(t[0]+16)/116,e=t[1]/500+i,r=i-t[2]/200;const s=i**3,n=e**3,o=r**3;return i=s>.008856?s:(i-16/116)/7.787,e=n>.008856?n:(e-16/116)/7.787,r=o>.008856?o:(r-16/116)/7.787,e*=95.047,i*=100,r*=108.883,[e,i,r]},n.lab.lch=function(t){const e=t[0],i=t[1],r=t[2];let s;return s=360*Math.atan2(r,i)/2/Math.PI,s<0&&(s+=360),[e,Math.sqrt(i*i+r*r),s]},n.lch.lab=function(t){const e=t[0],i=t[1],r=t[2]/360*2*Math.PI;return[e,i*Math.cos(r),i*Math.sin(r)]},n.rgb.ansi16=function(t,e=null){const[i,r,s]=t;let o=null===e?n.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),0===o)return 30;let h=30+(Math.round(s/255)<<2|Math.round(r/255)<<1|Math.round(i/255));return 2===o&&(h+=60),h},n.hsv.ansi16=function(t){return n.rgb.ansi16(n.hsv.rgb(t),t[2])},n.rgb.ansi256=function(t){const e=t[0],i=t[1],r=t[2];return e===i&&i===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(i/255*5)+Math.round(r/255*5)},n.ansi16.rgb=function(t){let e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];const i=.5*(1+~~(t>50));return[(1&e)*i*255,(e>>1&1)*i*255,(e>>2&1)*i*255]},n.ansi256.rgb=function(t){if(t>=232){const e=10*(t-232)+8;return[e,e,e]}let e;return t-=16,[Math.floor(t/36)/5*255,Math.floor((e=t%36)/6)/5*255,e%6/5*255]},n.rgb.hex=function(t){const e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},n.hex.rgb=function(t){const e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let i=e[0];3===e[0].length&&(i=i.split("").map((t=>t+t)).join(""));const r=parseInt(i,16);return[r>>16&255,r>>8&255,255&r]},n.rgb.hcg=function(t){const e=t[0]/255,i=t[1]/255,r=t[2]/255,s=Math.max(Math.max(e,i),r),n=Math.min(Math.min(e,i),r),o=s-n;let h,a;return h=o<1?n/(1-o):0,a=o<=0?0:s===e?(i-r)/o%6:s===i?2+(r-e)/o:4+(e-i)/o,a/=6,a%=1,[360*a,100*o,100*h]},n.hsl.hcg=function(t){const e=t[1]/100,i=t[2]/100,r=i<.5?2*e*i:2*e*(1-i);let s=0;return r<1&&(s=(i-.5*r)/(1-r)),[t[0],100*r,100*s]},n.hsv.hcg=function(t){const e=t[1]/100,i=t[2]/100,r=e*i;let s=0;return r<1&&(s=(i-r)/(1-r)),[t[0],100*r,100*s]},n.hcg.rgb=function(t){const e=t[0]/360,i=t[1]/100,r=t[2]/100;if(0===i)return[255*r,255*r,255*r];const s=[0,0,0],n=e%1*6,o=n%1,h=1-o;let a=0;switch(Math.floor(n)){case 0:s[0]=1,s[1]=o,s[2]=0;break;case 1:s[0]=h,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=o;break;case 3:s[0]=0,s[1]=h,s[2]=1;break;case 4:s[0]=o,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=h}return a=(1-i)*r,[255*(i*s[0]+a),255*(i*s[1]+a),255*(i*s[2]+a)]},n.hcg.hsv=function(t){const e=t[1]/100,i=e+t[2]/100*(1-e);let r=0;return i>0&&(r=e/i),[t[0],100*r,100*i]},n.hcg.hsl=function(t){const e=t[1]/100,i=t[2]/100*(1-e)+.5*e;let r=0;return i>0&&i<.5?r=e/(2*i):i>=.5&&i<1&&(r=e/(2*(1-i))),[t[0],100*r,100*i]},n.hcg.hwb=function(t){const e=t[1]/100,i=e+t[2]/100*(1-e);return[t[0],100*(i-e),100*(1-i)]},n.hwb.hcg=function(t){const e=t[1]/100,i=1-t[2]/100,r=i-e;let s=0;return r<1&&(s=(i-r)/(1-r)),[t[0],100*r,100*s]},n.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},n.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},n.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},n.gray.hsl=function(t){return[0,0,t[0]]},n.gray.hsv=n.gray.hsl,n.gray.hwb=function(t){return[0,100,t[0]]},n.gray.cmyk=function(t){return[0,0,0,t[0]]},n.gray.lab=function(t){return[t[0],0,0]},n.gray.hex=function(t){const e=255&Math.round(t[0]/100*255),i=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(i.length)+i},n.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},1621:(t,e,i)=>{const r=i(3583),s=i(9691),n={};Object.keys(r).forEach((t=>{n[t]={},Object.defineProperty(n[t],"channels",{value:r[t].channels}),Object.defineProperty(n[t],"labels",{value:r[t].labels});const e=s(t);Object.keys(e).forEach((i=>{const r=e[i];n[t][i]=function(t){const e=function(...e){const i=e[0];if(null==i)return i;i.length>1&&(e=i);const r=t(e);if("object"==typeof r)for(let t=r.length,e=0;e1&&(e=i),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(r)}))})),t.exports=n},9691:(t,e,i)=>{const r=i(3583);function s(t,e){return function(i){return e(t(i))}}function n(t,e){const i=[e[t].parent,t];let n=r[e[t].parent][t],o=e[t].parent;for(;e[o].parent;)i.unshift(e[o].parent),n=s(r[e[o].parent][o],n),o=e[o].parent;return n.conversion=i,n}t.exports=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(r);for(let i=e.length,r=0;r{"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},8470:(t,e,i)=>{"use strict";const r=i(2037),s=i(6224),n=i(6560),{env:o}=process;let h;function a(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function l(t,e){if(0===h)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!e&&void 0===h)return 0;const i=h||0;if("dumb"===o.TERM)return i;if("win32"===process.platform){const t=r.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in o)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((t=>t in o))||"codeship"===o.CI_NAME?1:i;if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if("truecolor"===o.COLORTERM)return 3;if("TERM_PROGRAM"in o){const t=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||"COLORTERM"in o?1:i}n("no-color")||n("no-colors")||n("color=false")||n("color=never")?h=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(h=1),"FORCE_COLOR"in o&&(h="true"===o.FORCE_COLOR?1:"false"===o.FORCE_COLOR?0:0===o.FORCE_COLOR.length?1:Math.min(parseInt(o.FORCE_COLOR,10),3)),t.exports={supportsColor:function(t){return a(l(t,t&&t.isTTY))},stdout:a(l(!0,s.isatty(1))),stderr:a(l(!0,s.isatty(2)))}},4061:(t,e,i)=>{"use strict";const r=i(6064),{stdout:s,stderr:n}=i(8470),{stringReplaceAll:o,stringEncaseCRLFWithFirstIndex:h}=i(3559),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],u=Object.create(null);class c{constructor(t){return d(t)}}const d=t=>{const e={};return((t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const i=s?s.level:0;t.level=void 0===e.level?i:e.level})(e,t),e.template=(...t)=>w(e.template,...t),Object.setPrototypeOf(e,p.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=c,e.template};function p(t){return d(t)}for(const[t,e]of Object.entries(r))u[t]={get(){const i=v(this,f(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:i}),i}};u.visible={get(){const t=v(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};const m=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const t of m)u[t]={get(){const{level:e}=this;return function(...i){const s=f(r.color[l[e]][t](...i),r.color.close,this._styler);return v(this,s,this._isEmpty)}}};for(const t of m)u["bg"+t[0].toUpperCase()+t.slice(1)]={get(){const{level:e}=this;return function(...i){const s=f(r.bgColor[l[e]][t](...i),r.bgColor.close,this._styler);return v(this,s,this._isEmpty)}}};const g=Object.defineProperties((()=>{}),{...u,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),f=(t,e,i)=>{let r,s;return void 0===i?(r=t,s=e):(r=i.openAll+t,s=e+i.closeAll),{open:t,close:e,openAll:r,closeAll:s,parent:i}},v=(t,e,i)=>{const r=(...t)=>a(t[0])&&a(t[0].raw)?b(r,w(r,...t)):b(r,1===t.length?""+t[0]:t.join(" "));return Object.setPrototypeOf(r,g),r._generator=t,r._styler=e,r._isEmpty=i,r},b=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let i=t._styler;if(void 0===i)return e;const{openAll:r,closeAll:s}=i;if(-1!==e.indexOf(""))for(;void 0!==i;)e=o(e,i.close,i.open),i=i.parent;const n=e.indexOf("\n");return-1!==n&&(e=h(e,s,r,n)),r+e+s};let y;const w=(t,...e)=>{const[r]=e;if(!a(r)||!a(r.raw))return e.join(" ");const s=e.slice(1),n=[r.raw[0]];for(let t=1;t{"use strict";const e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,i=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,s=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,n=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function o(t){const e="u"===t[0],i="{"===t[1];return e&&!i&&5===t.length||"x"===t[0]&&3===t.length?String.fromCharCode(parseInt(t.slice(1),16)):e&&i?String.fromCodePoint(parseInt(t.slice(2,-1),16)):n.get(t)||t}function h(t,e){const i=[],n=e.trim().split(/\s*,\s*/g);let h;for(const e of n){const n=Number(e);if(Number.isNaN(n)){if(!(h=e.match(r)))throw new Error(`Invalid Chalk template style argument: ${e} (in style '${t}')`);i.push(h[2].replace(s,((t,e,i)=>e?o(e):i)))}else i.push(n)}return i}function a(t){i.lastIndex=0;const e=[];let r;for(;null!==(r=i.exec(t));){const t=r[1];if(r[2]){const i=h(t,r[2]);e.push([t].concat(i))}else e.push([t])}return e}function l(t,e){const i={};for(const t of e)for(const e of t.styles)i[e[0]]=t.inverse?null:e.slice(1);let r=t;for(const[t,e]of Object.entries(i))if(Array.isArray(e)){if(!(t in r))throw new Error(`Unknown Chalk style: ${t}`);r=e.length>0?r[t](...e):r[t]}return r}t.exports=(t,i)=>{const r=[],s=[];let n=[];if(i.replace(e,((e,i,h,u,c,d)=>{if(i)n.push(o(i));else if(u){const e=n.join("");n=[],s.push(0===r.length?e:l(t,r)(e)),r.push({inverse:h,styles:a(u)})}else if(c){if(0===r.length)throw new Error("Found extraneous } in Chalk template literal");s.push(l(t,r)(n.join(""))),n=[],r.pop()}else n.push(d)})),s.push(n.join("")),r.length>0){const t=`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`;throw new Error(t)}return s.join("")}},3559:t=>{"use strict";t.exports={stringReplaceAll:(t,e,i)=>{let r=t.indexOf(e);if(-1===r)return t;const s=e.length;let n=0,o="";do{o+=t.substr(n,r-n)+e+i,n=r+s,r=t.indexOf(e,n)}while(-1!==r);return o+=t.substr(n),o},stringEncaseCRLFWithFirstIndex:(t,e,i,r)=>{let s=0,n="";do{const o="\r"===t[r-1];n+=t.substr(s,(o?r-1:r)-s)+e+(o?"\r\n":"\n")+i,s=r+1,r=t.indexOf("\n",s)}while(-1!==r);return n+=t.substr(s),n}}},6560:t=>{"use strict";t.exports=(t,e=process.argv)=>{const i=t.startsWith("-")?"":1===t.length?"-":"--",r=e.indexOf(i+t),s=e.indexOf("--");return-1!==r&&(-1===s||r{"use strict";const{FORCE_COLOR:e,NODE_DISABLE_COLORS:i,TERM:r}=process.env,s={enabled:!i&&"dumb"!==r&&"0"!==e,reset:o(0,0),bold:o(1,22),dim:o(2,22),italic:o(3,23),underline:o(4,24),inverse:o(7,27),hidden:o(8,28),strikethrough:o(9,29),black:o(30,39),red:o(31,39),green:o(32,39),yellow:o(33,39),blue:o(34,39),magenta:o(35,39),cyan:o(36,39),white:o(37,39),gray:o(90,39),grey:o(90,39),bgBlack:o(40,49),bgRed:o(41,49),bgGreen:o(42,49),bgYellow:o(43,49),bgBlue:o(44,49),bgMagenta:o(45,49),bgCyan:o(46,49),bgWhite:o(47,49)};function n(t,e){let i,r=0,s="",n="";for(;r{"use strict";class e{constructor({token:t,date:e,parts:i,locales:r}){this.token=t,this.date=e||new Date,this.parts=i||[this],this.locales=r||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((i,r)=>r>t&&i instanceof e))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const i=t.indexOf(this);return t.find(((t,r)=>r>i&&t instanceof e))}toString(){return String(this.date)}}t.exports=e},2102:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),e=this.date.getDay();return"DD"===this.token?String(t).padStart(2,"0"):"Do"===this.token?t+(i=t,1==(i%=10)?"st":2===i?"nd":3===i?"rd":"th"):"d"===this.token?e+1:"ddd"===this.token?this.locales.weekdaysShort[e]:"dddd"===this.token?this.locales.weekdays[e]:t;var i}}},4990:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}}},281:(t,e,i)=>{"use strict";t.exports={DatePart:i(7076),Meridiem:i(3692),Day:i(2102),Hours:i(4990),Milliseconds:i(2491),Minutes:i(1331),Month:i(9219),Seconds:i(1362),Year:i(6600)}},3692:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}},2491:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}},1331:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}},9219:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),e=this.token.length;return 2===e?String(t+1).padStart(2,"0"):3===e?this.locales.monthsShort[t]:4===e?this.locales.months[t]:String(t+1)}}},1362:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}},6600:(t,e,i)=>{"use strict";const r=i(7076);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return 2===this.token.length?t.substr(-2):t}}},4439:(t,e,i)=>{"use strict";function r(t,e,i,r,s,n,o){try{var h=t[n](o),a=h.value}catch(t){return void i(t)}h.done?e(a):Promise.resolve(a).then(r,s)}const s=i(1391),n=i(1537),o=i(2698),h=o.erase,a=o.cursor,l=i(6513),u=l.style,c=l.clear,d=l.figures,p=l.wrap,m=l.entriesToDisplay,g=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),f=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]);t.exports=class extends n{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial="number"==typeof t.initial?t.initial:((t,e)=>{const i=t.findIndex((t=>t.value===e||t.title===e));return i>-1?i:void 0})(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=u.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=c("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return"number"==typeof this._fb?t=this.choices[this._fb]:"string"==typeof this._fb&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=g(this.suggestions,t):this.value=this.fallback.value,this.fire()}complete(t){var e,i=this;return(e=function*(){const e=i.completing=i.suggest(i.input,i.choices),r=yield e;if(i.completing!==e)return;i.suggestions=r.map(((t,e,i)=>({title:f(i,e),value:g(i,e),description:t.description}))),i.completing=!1;const s=Math.max(r.length-1,0);i.moveSelect(Math.min(s,i.select)),t&&t()},function(){var t=this,i=arguments;return new Promise((function(s,n){var o=e.apply(t,i);function h(t){r(o,s,n,h,a,"next",t)}function a(t){r(o,s,n,h,a,"throw",t)}h(void 0)}))})()}reset(){this.input="",this.complete((()=>{this.moveSelect(void 0!==this.initial?this.initial:0),this.render()})),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(t,e){let i=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${i}${t}${r}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(0===this.cursor)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){0===this.select?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,e,i,r){let n,o=i?d.arrowUp:r?d.arrowDown:" ",h=e?s.cyan().underline(t.title):t.title;return o=(e?s.cyan(d.pointer)+" ":" ")+o,t.description&&(n=` - ${t.description}`,(o.length+h.length+n.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(n="\n"+p(t.description,{margin:3,width:this.out.columns}))),o+" "+h+s.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(a.hide):this.out.write(c(this.outputText,this.out.columns)),super.render();let t=m(this.select,this.choices.length,this.limit),e=t.startIndex,i=t.endIndex;if(this.outputText=[u.symbol(this.done,this.aborted,this.exited),s.bold(this.msg),u.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const t=this.suggestions.slice(e,i).map(((t,r)=>this.renderOption(t,this.select===r+e,0===r&&e>0,r+e===i-1&&i{"use strict";const r=i(1391),s=i(2698).cursor,n=i(4491),o=i(6513),h=o.clear,a=o.style,l=o.figures;t.exports=class extends n{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=h("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){0===this.cursor?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>!this.inputValue||!("string"!=typeof t.title||!t.title.toLowerCase().includes(this.inputValue.toLowerCase()))||!("string"!=typeof t.value||!t.value.toLowerCase().includes(this.inputValue.toLowerCase()))));const e=this.filteredOptions.findIndex((e=>e===t));this.cursor=e<0?0:e,this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,e){" "===t?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${l.arrowUp}/${l.arrowDown}: Highlight option\n ${l.arrowLeft}/${l.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`:""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:r.gray("Enter something to filter")}\n`}renderOption(t,e,i){let s;return s=e.disabled?t===i?r.gray().underline(e.title):r.strikethrough().gray(e.title):t===i?r.cyan().underline(e.title):e.title,(e.selected?r.green(l.radioOn):l.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ");const t=[r.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(r.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(s.hide),super.render();let t=[a.symbol(this.done,this.aborted),r.bold(this.msg),a.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=r.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=h(t,this.out.columns)}}},2290:(t,e,i)=>{"use strict";const r=i(1391),s=i(1537),n=i(6513),o=n.style,h=n.clear,a=i(2698),l=a.erase,u=a.cursor;t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(t,e){return"y"===t.toLowerCase()?(this.value=!0,this.submit()):"n"===t.toLowerCase()?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(u.hide):this.out.write(h(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),r.bold(this.msg),o.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:r.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(l.line+u.to(0)+this.outputText))}}},1492:(t,e,i)=>{"use strict";function r(t,e,i,r,s,n,o){try{var h=t[n](o),a=h.value}catch(t){return void i(t)}h.done?e(a):Promise.resolve(a).then(r,s)}function s(t){return function(){var e=this,i=arguments;return new Promise((function(s,n){var o=t.apply(e,i);function h(t){r(o,s,n,h,a,"next",t)}function a(t){r(o,s,n,h,a,"throw",t)}h(void 0)}))}}const n=i(1391),o=i(1537),h=i(6513),a=h.style,l=h.clear,u=h.figures,c=i(2698),d=c.erase,p=c.cursor,m=i(281),g=m.DatePart,f=m.Meridiem,v=m.Day,b=m.Hours,y=m.Milliseconds,w=m.Minutes,x=m.Month,_=m.Seconds,O=m.Year,S=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,C={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new v(t),3:t=>new x(t),4:t=>new O(t),5:t=>new f(t),6:t=>new b(t),7:t=>new w(t),8:t=>new _(t),9:t=>new y(t)},k={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};t.exports=class extends o{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(k,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=l("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let e;for(this.parts=[];e=S.exec(t);){let t=e.shift(),i=e.findIndex((t=>null!=t));this.parts.push(i in C?C[i]({token:e[i]||t,date:this.date,parts:this.parts,locales:this.locales}):e[i]||t)}let i=this.parts.reduce(((t,e)=>("string"==typeof e&&"string"==typeof t[t.length-1]?t[t.length-1]+=e:t.push(e),t)),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof g))),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var t=this;return s((function*(){let e=yield t.validator(t.value);"string"==typeof e&&(t.errorMsg=e,e=!1),t.error=!e}))()}submit(){var t=this;return s((function*(){if(yield t.validate(),t.error)return t.color="red",t.fire(),void t.render();t.done=!0,t.aborted=!1,t.fire(),t.render(),t.out.write("\n"),t.close()}))()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(null==t)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(null==t)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof g))),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(p.hide):this.out.write(l(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),n.bold(this.msg),a.delimiter(!1),this.parts.reduce(((t,e,i)=>t.concat(i!==this.cursor||this.done?e:n.cyan().underline(e.toString()))),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split("\n").reduce(((t,e,i)=>t+`\n${i?" ":u.pointerSmall} ${n.red().italic(e)}`),"")),this.out.write(d.line+p.to(0)+this.outputText))}}},4910:(t,e,i)=>{"use strict";t.exports={TextPrompt:i(1741),SelectPrompt:i(2289),TogglePrompt:i(8660),DatePrompt:i(1492),NumberPrompt:i(8147),MultiselectPrompt:i(4491),AutocompletePrompt:i(4439),AutocompleteMultiselectPrompt:i(5174),ConfirmPrompt:i(2290)}},4491:(t,e,i)=>{"use strict";const r=i(1391),s=i(2698).cursor,n=i(1537),o=i(6513),h=o.clear,a=o.figures,l=o.style,u=o.wrap,c=o.entriesToDisplay;t.exports=class extends n{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map(((t,e)=>("string"==typeof t&&(t={title:t,value:e}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(void 0===t.value?e:t.value),selected:t&&t.selected,disabled:t&&t.disabled}))),this.clear=h("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map((t=>!t.selected)),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){const t=this.value.filter((t=>t.selected));this.minSelected&&t.lengtht.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}toggleAll(){if(void 0!==this.maxChoices||this.value[this.cursor].disabled)return this.bell();const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((e=>e.selected=t)),this.render()}_(t,e){if(" "===t)this.handleSpaceToggle();else{if("a"!==t)return this.bell();this.toggleAll()}}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${a.arrowUp}/${a.arrowDown}: Highlight option\n ${a.arrowLeft}/${a.arrowRight}/[space]: Toggle selection\n`+(void 0===this.maxChoices?" a: Toggle all\n":"")+" enter/return: Complete answer":""}renderOption(t,e,i,s){const n=(e.selected?r.green(a.radioOn):a.radioOff)+" "+s+" ";let o,h;return e.disabled?o=t===i?r.gray().underline(e.title):r.strikethrough().gray(e.title):(o=t===i?r.cyan().underline(e.title):e.title,t===i&&e.description&&(h=` - ${e.description}`,(n.length+o.length+h.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(h="\n"+u(e.description,{margin:n.length,width:this.out.columns})))),n+o+r.gray(h||"")}paginateOptions(t){if(0===t.length)return r.red("No matches for this query.");let e,i=c(this.cursor,t.length,this.optionsPerPage),s=i.startIndex,n=i.endIndex,o=[];for(let i=s;i0?a.arrowUp:i===n-1&&nt.selected)).map((t=>t.title)).join(", ");const t=[r.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(r.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(s.hide),super.render();let t=[l.symbol(this.done,this.aborted),r.bold(this.msg),l.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=r.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=h(t,this.out.columns)}}},8147:(t,e,i)=>{"use strict";function r(t,e,i,r,s,n,o){try{var h=t[n](o),a=h.value}catch(t){return void i(t)}h.done?e(a):Promise.resolve(a).then(r,s)}function s(t){return function(){var e=this,i=arguments;return new Promise((function(s,n){var o=t.apply(e,i);function h(t){r(o,s,n,h,a,"next",t)}function a(t){r(o,s,n,h,a,"throw",t)}h(void 0)}))}}const n=i(1391),o=i(1537),h=i(2698),a=h.cursor,l=h.erase,u=i(6513),c=u.style,d=u.figures,p=u.clear,m=u.lines,g=/[0-9]/,f=t=>void 0!==t,v=(t,e)=>{let i=Math.pow(10,e);return Math.round(t*i)/i};t.exports=class extends o{constructor(t={}){super(t),this.transform=c.render(t.style),this.msg=t.message,this.initial=f(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=f(t.min)?t.min:-1/0,this.max=f(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){t||0===t?(this.placeholder=!1,this.rendered=this.transform.render(`${v(t,this.round)}`),this._value=v(t,this.round)):(this.placeholder=!0,this.rendered=n.gray(this.transform.render(`${this.initial}`)),this._value=""),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return"-"===t||"."===t&&this.float||g.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=""!==t?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var t=this;return s((function*(){let e=yield t.validator(t.value);"string"==typeof e&&(t.errorMsg=e,e=!1),t.error=!e}))()}submit(){var t=this;return s((function*(){if(yield t.validate(),t.error)return t.color="red",t.fire(),void t.render();let e=t.value;t.value=""!==e?e:t.initial,t.done=!0,t.aborted=!1,t.error=!1,t.fire(),t.render(),t.out.write("\n"),t.close()}))()}up(){if(this.typed="",""===this.value&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",""===this.value&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(0===t.length)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",""!==this.value&&this.value1e3&&(this.typed=""),this.typed+=t,this.lastHit=i,this.color="cyan","."===t)return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.valuet+`\n${i?" ":d.pointerSmall} ${n.red().italic(e)}`),"")),this.out.write(l.line+a.to(0)+this.outputText+a.save+this.outputError+a.restore))}}},1537:(t,e,i)=>{"use strict";const r=i(4521),s=i(6513).action,n=i(2361),o=i(2698),h=o.beep,a=o.cursor,l=i(1391);t.exports=class extends n{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);const e=r.createInterface({input:this.in,escapeCodeTimeout:50});r.emitKeypressEvents(this.in,e),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(t,e)=>{let r=s(e,i);!1===r?this._&&this._(t,e):"function"==typeof this[r]?this[r](e):this.bell()};this.close=()=>{this.out.write(a.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(!1),e.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",n)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(h)}render(){this.onRender(l),this.firstRender&&(this.firstRender=!1)}}},2289:(t,e,i)=>{"use strict";const r=i(1391),s=i(1537),n=i(6513),o=n.style,h=n.clear,a=n.figures,l=n.wrap,u=n.entriesToDisplay,c=i(2698).cursor;t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map(((t,e)=>("string"==typeof t&&(t={title:t,value:e}),{title:t&&(t.title||t.value||t),value:t&&(void 0===t.value?e:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}))),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=h("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){0===this.cursor?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,e){if(" "===t)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(c.hide):this.out.write(h(this.outputText,this.out.columns)),super.render();let t=u(this.cursor,this.choices.length,this.optionsPerPage),e=t.startIndex,i=t.endIndex;if(this.outputText=[o.symbol(this.done,this.aborted),r.bold(this.msg),o.delimiter(!1),this.done?this.selection.title:this.selection.disabled?r.yellow(this.warn):r.gray(this.hint)].join(" "),!this.done){this.outputText+="\n";for(let t=e;t0?a.arrowUp:t===i-1&&i=this.out.columns||h.description.split(/\r?\n/).length>1)&&(o="\n"+l(h.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${s}${r.gray(o)}\n`}}this.out.write(this.outputText)}}},1741:(t,e,i)=>{"use strict";function r(t,e,i,r,s,n,o){try{var h=t[n](o),a=h.value}catch(t){return void i(t)}h.done?e(a):Promise.resolve(a).then(r,s)}function s(t){return function(){var e=this,i=arguments;return new Promise((function(s,n){var o=t.apply(e,i);function h(t){r(o,s,n,h,a,"next",t)}function a(t){r(o,s,n,h,a,"throw",t)}h(void 0)}))}}const n=i(1391),o=i(1537),h=i(2698),a=h.erase,l=h.cursor,u=i(6513),c=u.style,d=u.clear,p=u.lines,m=u.figures;t.exports=class extends o{constructor(t={}){super(t),this.transform=c.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=d("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=n.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var t=this;return s((function*(){let e=yield t.validator(t.value);"string"==typeof e&&(t.errorMsg=e,e=!1),t.error=!e}))()}submit(){var t=this;return s((function*(){if(t.value=t.value||t.initial,t.cursorOffset=0,t.cursor=t.rendered.length,yield t.validate(),t.error)return t.red=!0,t.fire(),void t.render();t.done=!0,t.aborted=!1,t.fire(),t.render(),t.out.write("\n"),t.close()}))()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,e){let i=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${i}${t}${r}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),e=this.value.slice(this.cursor);this.value=`${t}${e}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),e=this.value.slice(this.cursor+1);this.value=`${t}${e}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return 0===this.cursor||this.placeholder&&1===this.cursor}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(l.down(p(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns)),this.out.write(d(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[c.symbol(this.done,this.aborted),n.bold(this.msg),c.delimiter(this.done),this.red?n.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split("\n").reduce(((t,e,i)=>t+`\n${i?" ":m.pointerSmall} ${n.red().italic(e)}`),"")),this.out.write(a.line+l.to(0)+this.outputText+l.save+this.outputError+l.restore+l.move(this.cursorOffset,0)))}}},8660:(t,e,i)=>{"use strict";const r=i(1391),s=i(1537),n=i(6513),o=n.style,h=n.clear,a=i(2698),l=a.cursor,u=a.erase;t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}deactivate(){if(!1===this.value)return this.bell();this.value=!1,this.render()}activate(){if(!0===this.value)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,e){if(" "===t)this.value=!this.value;else if("1"===t)this.value=!0;else{if("0"!==t)return this.bell();this.value=!1}this.render()}render(){this.closed||(this.firstRender?this.out.write(l.hide):this.out.write(h(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),r.bold(this.msg),o.delimiter(this.done),this.value?this.inactive:r.cyan().underline(this.inactive),r.gray("/"),this.value?r.cyan().underline(this.active):this.active].join(" "),this.out.write(u.line+l.to(0)+this.outputText))}}},482:(t,e,i)=>{"use strict";function r(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function s(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,o=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){a=!0,n=t},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw n}}}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i{};function p(){return m.apply(this,arguments)}function m(){return m=l((function*(t=[],{onSubmit:e=d,onCancel:i=d}={}){const r={},n=p._override||{};let h,a,m,f,v,b;t=[].concat(t);const y=function(){var t=l((function*(t,e,i=!1){if(i||!t.validate||!0===t.validate(e))return t.format?yield t.format(e,r):e}));return function(e,i){return t.apply(this,arguments)}}();var w,x=o(t);try{for(x.s();!(w=x.n()).done;){a=w.value;var _=a;if(f=_.name,v=_.type,"function"==typeof v&&(v=yield v(h,s({},r),a),a.type=v),v){for(let t in a){if(c.includes(t))continue;let e=a[t];a[t]="function"==typeof e?yield e(h,s({},r),b):e}if(b=a,"string"!=typeof a.message)throw new Error("prompt message is required");var O=a;if(f=O.name,v=O.type,void 0===u[v])throw new Error(`prompt type (${v}) is not defined`);if(void 0===n[a.name]||(h=yield y(a,n[a.name]),void 0===h)){try{h=p._injected?g(p._injected,a.initial):yield u[v](a),r[f]=h=yield y(a,h,!0),m=yield e(a,h,r)}catch(t){m=!(yield i(a,r))}if(m)return r}else r[f]=h}}}catch(t){x.e(t)}finally{x.f()}return r})),m.apply(this,arguments)}function g(t,e){const i=t.shift();if(i instanceof Error)throw i;return void 0===i?e:i}t.exports=Object.assign(p,{prompt:p,prompts:u,inject:function(t){p._injected=(p._injected||[]).concat(t)},override:function(t){p._override=Object.assign({},t)}})},2897:(t,e,i)=>{"use strict";const r=e,s=i(4910),n=t=>t;function o(t,e,i={}){return new Promise(((r,o)=>{const h=new s[t](e),a=i.onAbort||n,l=i.onSubmit||n,u=i.onExit||n;h.on("state",e.onState||n),h.on("submit",(t=>r(l(t)))),h.on("exit",(t=>r(u(t)))),h.on("abort",(t=>o(a(t))))}))}r.text=t=>o("TextPrompt",t),r.password=t=>(t.style="password",r.text(t)),r.invisible=t=>(t.style="invisible",r.text(t)),r.number=t=>o("NumberPrompt",t),r.date=t=>o("DatePrompt",t),r.confirm=t=>o("ConfirmPrompt",t),r.list=t=>{const e=t.separator||",";return o("TextPrompt",t,{onSubmit:t=>t.split(e).map((t=>t.trim()))})},r.toggle=t=>o("TogglePrompt",t),r.select=t=>o("SelectPrompt",t),r.multiselect=t=>{t.choices=[].concat(t.choices||[]);const e=t=>t.filter((t=>t.selected)).map((t=>t.value));return o("MultiselectPrompt",t,{onAbort:e,onSubmit:e})},r.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const e=t=>t.filter((t=>t.selected)).map((t=>t.value));return o("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};const h=(t,e)=>Promise.resolve(e.filter((e=>e.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));r.autocomplete=t=>(t.suggest=t.suggest||h,t.choices=[].concat(t.choices||[]),o("AutocompletePrompt",t))},3556:t=>{"use strict";t.exports=(t,e)=>{if(!t.meta||"escape"===t.name){if(t.ctrl){if("a"===t.name)return"first";if("c"===t.name)return"abort";if("d"===t.name)return"abort";if("e"===t.name)return"last";if("g"===t.name)return"reset"}if(e){if("j"===t.name)return"down";if("k"===t.name)return"up"}return"return"===t.name||"enter"===t.name?"submit":"backspace"===t.name?"delete":"delete"===t.name?"deleteForward":"abort"===t.name?"abort":"escape"===t.name?"exit":"tab"===t.name?"next":"pagedown"===t.name?"nextPage":"pageup"===t.name?"prevPage":"home"===t.name?"home":"end"===t.name?"end":"up"===t.name?"up":"down"===t.name?"down":"right"===t.name?"right":"left"===t.name&&"left"}}},8296:(t,e,i)=>{"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[s++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,h=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return h=t.done,t},e:function(t){a=!0,o=t},f:function(){try{h||null==i.return||i.return()}finally{if(a)throw o}}}}(t.split(/\r?\n/));try{for(a.s();!(n=a.n()).done;){let t=n.value;i+=1+Math.floor(Math.max([...s(t)].length-1,0)/e)}}catch(t){a.e(t)}finally{a.f()}return o.lines(i)}},2496:t=>{"use strict";t.exports=(t,e,i)=>{i=i||e;let r=Math.min(e-i,t-Math.floor(i/2));return r<0&&(r=0),{startIndex:r,endIndex:Math.min(r+i,e)}}},9188:t=>{"use strict";const e={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},i={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},r="win32"===process.platform?i:e;t.exports=r},6513:(t,e,i)=>{"use strict";t.exports={action:i(3556),clear:i(8296),style:i(2052),strip:i(7734),figures:i(9188),lines:i(7731),wrap:i(8611),entriesToDisplay:i(2496)}},7731:(t,e,i)=>{"use strict";const r=i(7734);t.exports=function(t,e){let i=String(r(t)||"").split(/\r?\n/);return e?i.map((t=>Math.ceil(t.length/e))).reduce(((t,e)=>t+e)):i.length}},7734:t=>{"use strict";t.exports=t=>{const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),i=new RegExp(e,"g");return"string"==typeof t?t.replace(i,""):t}},2052:(t,e,i)=>{"use strict";const r=i(1391),s=i(9188),n=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),o=Object.freeze({aborted:r.red(s.cross),done:r.green(s.tick),exited:r.yellow(s.cross),default:r.cyan("?")});t.exports={styles:n,render:t=>n[t]||n.default,symbols:o,symbol:(t,e,i)=>e?o.aborted:i?o.exited:t?o.done:o.default,delimiter:t=>r.gray(t?s.ellipsis:s.pointerSmall),item:(t,e)=>r.gray(t?e?s.pointerSmall:"+":s.line)}},8611:t=>{"use strict";t.exports=(t,e={})=>{const i=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",r=e.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,e)=>(e.length+i.length>=r||t[t.length-1].length+e.length+1{t.exports=function(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,i=process.versions.node.split(".").map(Number);for(;et[e])return!1;if(t[e]>i[e])return!0}return!1}("8.6.0")?i(482):i(9439)},5468:t=>{"use strict";class e{constructor({token:t,date:e,parts:i,locales:r}){this.token=t,this.date=e||new Date,this.parts=i||[this],this.locales=r||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((i,r)=>r>t&&i instanceof e))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const i=t.indexOf(this);return t.find(((t,r)=>r>i&&t instanceof e))}toString(){return String(this.date)}}t.exports=e},608:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),e=this.date.getDay();return"DD"===this.token?String(t).padStart(2,"0"):"Do"===this.token?t+(i=t,1==(i%=10)?"st":2===i?"nd":3===i?"rd":"th"):"d"===this.token?e+1:"ddd"===this.token?this.locales.weekdaysShort[e]:"dddd"===this.token?this.locales.weekdays[e]:t;var i}}},4134:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}}},1106:(t,e,i)=>{"use strict";t.exports={DatePart:i(5468),Meridiem:i(689),Day:i(608),Hours:i(4134),Milliseconds:i(5479),Minutes:i(5512),Month:i(8318),Seconds:i(8908),Year:i(9958)}},689:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}},5479:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}},5512:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}},8318:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),e=this.token.length;return 2===e?String(t+1).padStart(2,"0"):3===e?this.locales.monthsShort[t]:4===e?this.locales.months[t]:String(t+1)}}},8908:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}},9958:(t,e,i)=>{"use strict";const r=i(5468);t.exports=class extends r{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return 2===this.token.length?t.substr(-2):t}}},656:(t,e,i)=>{"use strict";const r=i(1391),s=i(1739),{erase:n,cursor:o}=i(2698),{style:h,clear:a,figures:l,wrap:u,entriesToDisplay:c}=i(9016),d=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),p=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]);t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial="number"==typeof t.initial?t.initial:((t,e)=>{const i=t.findIndex((t=>t.value===e||t.title===e));return i>-1?i:void 0})(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=h.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=a("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return"number"==typeof this._fb?t=this.choices[this._fb]:"string"==typeof this._fb&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=d(this.suggestions,t):this.value=this.fallback.value,this.fire()}async complete(t){const e=this.completing=this.suggest(this.input,this.choices),i=await e;if(this.completing!==e)return;this.suggestions=i.map(((t,e,i)=>({title:p(i,e),value:d(i,e),description:t.description}))),this.completing=!1;const r=Math.max(i.length-1,0);this.moveSelect(Math.min(r,this.select)),t&&t()}reset(){this.input="",this.complete((()=>{this.moveSelect(void 0!==this.initial?this.initial:0),this.render()})),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(t,e){let i=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${i}${t}${r}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(0===this.cursor)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){0===this.select?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,e,i,s){let n,o=i?l.arrowUp:s?l.arrowDown:" ",h=e?r.cyan().underline(t.title):t.title;return o=(e?r.cyan(l.pointer)+" ":" ")+o,t.description&&(n=` - ${t.description}`,(o.length+h.length+n.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(n="\n"+u(t.description,{margin:3,width:this.out.columns}))),o+" "+h+r.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(o.hide):this.out.write(a(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=c(this.select,this.choices.length,this.limit);if(this.outputText=[h.symbol(this.done,this.aborted,this.exited),r.bold(this.msg),h.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const i=this.suggestions.slice(t,e).map(((i,r)=>this.renderOption(i,this.select===r+t,0===r&&t>0,r+t===e-1&&e{"use strict";const r=i(1391),{cursor:s}=i(2698),n=i(3702),{clear:o,style:h,figures:a}=i(9016);t.exports=class extends n{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=o("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){0===this.cursor?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>!this.inputValue||!("string"!=typeof t.title||!t.title.toLowerCase().includes(this.inputValue.toLowerCase()))||!("string"!=typeof t.value||!t.value.toLowerCase().includes(this.inputValue.toLowerCase()))));const e=this.filteredOptions.findIndex((e=>e===t));this.cursor=e<0?0:e,this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,e){" "===t?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${a.arrowUp}/${a.arrowDown}: Highlight option\n ${a.arrowLeft}/${a.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`:""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:r.gray("Enter something to filter")}\n`}renderOption(t,e,i){let s;return s=e.disabled?t===i?r.gray().underline(e.title):r.strikethrough().gray(e.title):t===i?r.cyan().underline(e.title):e.title,(e.selected?r.green(a.radioOn):a.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ");const t=[r.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(r.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(s.hide),super.render();let t=[h.symbol(this.done,this.aborted),r.bold(this.msg),h.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=r.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=o(t,this.out.columns)}}},5747:(t,e,i)=>{const r=i(1391),s=i(1739),{style:n,clear:o}=i(9016),{erase:h,cursor:a}=i(2698);t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(t,e){return"y"===t.toLowerCase()?(this.value=!0,this.submit()):"n"===t.toLowerCase()?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(a.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),r.bold(this.msg),n.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:r.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(h.line+a.to(0)+this.outputText))}}},1054:(t,e,i)=>{"use strict";const r=i(1391),s=i(1739),{style:n,clear:o,figures:h}=i(9016),{erase:a,cursor:l}=i(2698),{DatePart:u,Meridiem:c,Day:d,Hours:p,Milliseconds:m,Minutes:g,Month:f,Seconds:v,Year:b}=i(1106),y=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,w={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new d(t),3:t=>new f(t),4:t=>new b(t),5:t=>new c(t),6:t=>new p(t),7:t=>new g(t),8:t=>new v(t),9:t=>new m(t)},x={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(x,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=o("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let e;for(this.parts=[];e=y.exec(t);){let t=e.shift(),i=e.findIndex((t=>null!=t));this.parts.push(i in w?w[i]({token:e[i]||t,date:this.date,parts:this.parts,locales:this.locales}):e[i]||t)}let i=this.parts.reduce(((t,e)=>("string"==typeof e&&"string"==typeof t[t.length-1]?t[t.length-1]+=e:t.push(e),t)),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof u))),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let t=await this.validator(this.value);"string"==typeof t&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error)return this.color="red",this.fire(),void this.render();this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(null==t)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(null==t)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof u))),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(l.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),r.bold(this.msg),n.delimiter(!1),this.parts.reduce(((t,e,i)=>t.concat(i!==this.cursor||this.done?e:r.cyan().underline(e.toString()))),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split("\n").reduce(((t,e,i)=>t+`\n${i?" ":h.pointerSmall} ${r.red().italic(e)}`),"")),this.out.write(a.line+l.to(0)+this.outputText))}}},635:(t,e,i)=>{"use strict";t.exports={TextPrompt:i(4490),SelectPrompt:i(9770),TogglePrompt:i(4639),DatePrompt:i(1054),NumberPrompt:i(8531),MultiselectPrompt:i(3702),AutocompletePrompt:i(656),AutocompleteMultiselectPrompt:i(6900),ConfirmPrompt:i(5747)}},3702:(t,e,i)=>{"use strict";const r=i(1391),{cursor:s}=i(2698),n=i(1739),{clear:o,figures:h,style:a,wrap:l,entriesToDisplay:u}=i(9016);t.exports=class extends n{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map(((t,e)=>("string"==typeof t&&(t={title:t,value:e}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(void 0===t.value?e:t.value),selected:t&&t.selected,disabled:t&&t.disabled}))),this.clear=o("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map((t=>!t.selected)),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){const t=this.value.filter((t=>t.selected));this.minSelected&&t.lengtht.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}toggleAll(){if(void 0!==this.maxChoices||this.value[this.cursor].disabled)return this.bell();const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((e=>e.selected=t)),this.render()}_(t,e){if(" "===t)this.handleSpaceToggle();else{if("a"!==t)return this.bell();this.toggleAll()}}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${h.arrowUp}/${h.arrowDown}: Highlight option\n ${h.arrowLeft}/${h.arrowRight}/[space]: Toggle selection\n`+(void 0===this.maxChoices?" a: Toggle all\n":"")+" enter/return: Complete answer":""}renderOption(t,e,i,s){const n=(e.selected?r.green(h.radioOn):h.radioOff)+" "+s+" ";let o,a;return e.disabled?o=t===i?r.gray().underline(e.title):r.strikethrough().gray(e.title):(o=t===i?r.cyan().underline(e.title):e.title,t===i&&e.description&&(a=` - ${e.description}`,(n.length+o.length+a.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(a="\n"+l(e.description,{margin:n.length,width:this.out.columns})))),n+o+r.gray(a||"")}paginateOptions(t){if(0===t.length)return r.red("No matches for this query.");let e,{startIndex:i,endIndex:s}=u(this.cursor,t.length,this.optionsPerPage),n=[];for(let r=i;r0?h.arrowUp:r===s-1&&st.selected)).map((t=>t.title)).join(", ");const t=[r.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(r.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(s.hide),super.render();let t=[a.symbol(this.done,this.aborted),r.bold(this.msg),a.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=r.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=o(t,this.out.columns)}}},8531:(t,e,i)=>{const r=i(1391),s=i(1739),{cursor:n,erase:o}=i(2698),{style:h,figures:a,clear:l,lines:u}=i(9016),c=/[0-9]/,d=t=>void 0!==t,p=(t,e)=>{let i=Math.pow(10,e);return Math.round(t*i)/i};t.exports=class extends s{constructor(t={}){super(t),this.transform=h.render(t.style),this.msg=t.message,this.initial=d(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=d(t.min)?t.min:-1/0,this.max=d(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){t||0===t?(this.placeholder=!1,this.rendered=this.transform.render(`${p(t,this.round)}`),this._value=p(t,this.round)):(this.placeholder=!0,this.rendered=r.gray(this.transform.render(`${this.initial}`)),this._value=""),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return"-"===t||"."===t&&this.float||c.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=""!==t?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let t=await this.validator(this.value);"string"==typeof t&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error)return this.color="red",this.fire(),void this.render();let t=this.value;this.value=""!==t?t:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}up(){if(this.typed="",""===this.value&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",""===this.value&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(0===t.length)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",""!==this.value&&this.value1e3&&(this.typed=""),this.typed+=t,this.lastHit=i,this.color="cyan","."===t)return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.valuet+`\n${i?" ":a.pointerSmall} ${r.red().italic(e)}`),"")),this.out.write(o.line+n.to(0)+this.outputText+n.save+this.outputError+n.restore))}}},1739:(t,e,i)=>{"use strict";const r=i(4521),{action:s}=i(9016),n=i(2361),{beep:o,cursor:h}=i(2698),a=i(1391);t.exports=class extends n{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);const e=r.createInterface({input:this.in,escapeCodeTimeout:50});r.emitKeypressEvents(this.in,e),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(t,e)=>{let r=s(e,i);!1===r?this._&&this._(t,e):"function"==typeof this[r]?this[r](e):this.bell()};this.close=()=>{this.out.write(h.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(!1),e.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",n)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(o)}render(){this.onRender(a),this.firstRender&&(this.firstRender=!1)}}},9770:(t,e,i)=>{"use strict";const r=i(1391),s=i(1739),{style:n,clear:o,figures:h,wrap:a,entriesToDisplay:l}=i(9016),{cursor:u}=i(2698);t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map(((t,e)=>("string"==typeof t&&(t={title:t,value:e}),{title:t&&(t.title||t.value||t),value:t&&(void 0===t.value?e:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}))),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=o("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){0===this.cursor?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,e){if(" "===t)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(u.hide):this.out.write(o(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=l(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[n.symbol(this.done,this.aborted),r.bold(this.msg),n.delimiter(!1),this.done?this.selection.title:this.selection.disabled?r.yellow(this.warn):r.gray(this.hint)].join(" "),!this.done){this.outputText+="\n";for(let i=t;i0?h.arrowUp:i===e-1&&e=this.out.columns||l.description.split(/\r?\n/).length>1)&&(o="\n"+a(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${s}${r.gray(o)}\n`}}this.out.write(this.outputText)}}},4490:(t,e,i)=>{const r=i(1391),s=i(1739),{erase:n,cursor:o}=i(2698),{style:h,clear:a,lines:l,figures:u}=i(9016);t.exports=class extends s{constructor(t={}){super(t),this.transform=h.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=a("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=r.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let t=await this.validator(this.value);"string"==typeof t&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error)return this.red=!0,this.fire(),void this.render();this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,e){let i=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${i}${t}${r}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),e=this.value.slice(this.cursor);this.value=`${t}${e}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),e=this.value.slice(this.cursor+1);this.value=`${t}${e}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return 0===this.cursor||this.placeholder&&1===this.cursor}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(o.down(l(this.outputError,this.out.columns)-1)+a(this.outputError,this.out.columns)),this.out.write(a(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[h.symbol(this.done,this.aborted),r.bold(this.msg),h.delimiter(this.done),this.red?r.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split("\n").reduce(((t,e,i)=>t+`\n${i?" ":u.pointerSmall} ${r.red().italic(e)}`),"")),this.out.write(n.line+o.to(0)+this.outputText+o.save+this.outputError+o.restore+o.move(this.cursorOffset,0)))}}},4639:(t,e,i)=>{const r=i(1391),s=i(1739),{style:n,clear:o}=i(9016),{cursor:h,erase:a}=i(2698);t.exports=class extends s{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}deactivate(){if(!1===this.value)return this.bell();this.value=!1,this.render()}activate(){if(!0===this.value)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,e){if(" "===t)this.value=!this.value;else if("1"===t)this.value=!0;else{if("0"!==t)return this.bell();this.value=!1}this.render()}render(){this.closed||(this.firstRender?this.out.write(h.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),r.bold(this.msg),n.delimiter(this.done),this.value?this.inactive:r.cyan().underline(this.inactive),r.gray("/"),this.value?r.cyan().underline(this.active):this.active].join(" "),this.out.write(a.line+h.to(0)+this.outputText))}}},9439:(t,e,i)=>{"use strict";const r=i(8378),s=["suggest","format","onState","validate","onRender","type"],n=()=>{};async function o(t=[],{onSubmit:e=n,onCancel:i=n}={}){const a={},l=o._override||{};let u,c,d,p,m,g;t=[].concat(t);const f=async(t,e,i=!1)=>{if(i||!t.validate||!0===t.validate(e))return t.format?await t.format(e,a):e};for(c of t)if(({name:p,type:m}=c),"function"==typeof m&&(m=await m(u,{...a},c),c.type=m),m){for(let t in c){if(s.includes(t))continue;let e=c[t];c[t]="function"==typeof e?await e(u,{...a},g):e}if(g=c,"string"!=typeof c.message)throw new Error("prompt message is required");if(({name:p,type:m}=c),void 0===r[m])throw new Error(`prompt type (${m}) is not defined`);if(void 0===l[c.name]||(u=await f(c,l[c.name]),void 0===u)){try{u=o._injected?h(o._injected,c.initial):await r[m](c),a[p]=u=await f(c,u,!0),d=await e(c,u,a)}catch(t){d=!await i(c,a)}if(d)return a}else a[p]=u}return a}function h(t,e){const i=t.shift();if(i instanceof Error)throw i;return void 0===i?e:i}t.exports=Object.assign(o,{prompt:o,prompts:r,inject:function(t){o._injected=(o._injected||[]).concat(t)},override:function(t){o._override=Object.assign({},t)}})},8378:(t,e,i)=>{"use strict";const r=e,s=i(635),n=t=>t;function o(t,e,i={}){return new Promise(((r,o)=>{const h=new s[t](e),a=i.onAbort||n,l=i.onSubmit||n,u=i.onExit||n;h.on("state",e.onState||n),h.on("submit",(t=>r(l(t)))),h.on("exit",(t=>r(u(t)))),h.on("abort",(t=>o(a(t))))}))}r.text=t=>o("TextPrompt",t),r.password=t=>(t.style="password",r.text(t)),r.invisible=t=>(t.style="invisible",r.text(t)),r.number=t=>o("NumberPrompt",t),r.date=t=>o("DatePrompt",t),r.confirm=t=>o("ConfirmPrompt",t),r.list=t=>{const e=t.separator||",";return o("TextPrompt",t,{onSubmit:t=>t.split(e).map((t=>t.trim()))})},r.toggle=t=>o("TogglePrompt",t),r.select=t=>o("SelectPrompt",t),r.multiselect=t=>{t.choices=[].concat(t.choices||[]);const e=t=>t.filter((t=>t.selected)).map((t=>t.value));return o("MultiselectPrompt",t,{onAbort:e,onSubmit:e})},r.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const e=t=>t.filter((t=>t.selected)).map((t=>t.value));return o("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};const h=(t,e)=>Promise.resolve(e.filter((e=>e.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));r.autocomplete=t=>(t.suggest=t.suggest||h,t.choices=[].concat(t.choices||[]),o("AutocompletePrompt",t))},2866:t=>{"use strict";t.exports=(t,e)=>{if(!t.meta||"escape"===t.name){if(t.ctrl){if("a"===t.name)return"first";if("c"===t.name)return"abort";if("d"===t.name)return"abort";if("e"===t.name)return"last";if("g"===t.name)return"reset"}if(e){if("j"===t.name)return"down";if("k"===t.name)return"up"}return"return"===t.name||"enter"===t.name?"submit":"backspace"===t.name?"delete":"delete"===t.name?"deleteForward":"abort"===t.name?"abort":"escape"===t.name?"exit":"tab"===t.name?"next":"pagedown"===t.name?"nextPage":"pageup"===t.name?"prevPage":"home"===t.name?"home":"end"===t.name?"end":"up"===t.name?"up":"down"===t.name?"down":"right"===t.name?"right":"left"===t.name&&"left"}}},8694:(t,e,i)=>{"use strict";const r=i(9420),{erase:s,cursor:n}=i(2698);t.exports=function(t,e){if(!e)return s.line+n.to(0);let i=0;const o=t.split(/\r?\n/);for(let t of o)i+=1+Math.floor(Math.max([...r(t)].length-1,0)/e);return s.lines(i)}},2163:t=>{"use strict";t.exports=(t,e,i)=>{i=i||e;let r=Math.min(e-i,t-Math.floor(i/2));return r<0&&(r=0),{startIndex:r,endIndex:Math.min(r+i,e)}}},4815:t=>{"use strict";const e={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},i={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},r="win32"===process.platform?i:e;t.exports=r},9016:(t,e,i)=>{"use strict";t.exports={action:i(2866),clear:i(8694),style:i(424),strip:i(9420),figures:i(4815),lines:i(4985),wrap:i(8524),entriesToDisplay:i(2163)}},4985:(t,e,i)=>{"use strict";const r=i(9420);t.exports=function(t,e){let i=String(r(t)||"").split(/\r?\n/);return e?i.map((t=>Math.ceil(t.length/e))).reduce(((t,e)=>t+e)):i.length}},9420:t=>{"use strict";t.exports=t=>{const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),i=new RegExp(e,"g");return"string"==typeof t?t.replace(i,""):t}},424:(t,e,i)=>{"use strict";const r=i(1391),s=i(4815),n=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),o=Object.freeze({aborted:r.red(s.cross),done:r.green(s.tick),exited:r.yellow(s.cross),default:r.cyan("?")});t.exports={styles:n,render:t=>n[t]||n.default,symbols:o,symbol:(t,e,i)=>e?o.aborted:i?o.exited:t?o.done:o.default,delimiter:t=>r.gray(t?s.ellipsis:s.pointerSmall),item:(t,e)=>r.gray(t?e?s.pointerSmall:"+":s.line)}},8524:t=>{"use strict";t.exports=(t,e={})=>{const i=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",r=e.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,e)=>(e.length+i.length>=r||t[t.length-1].length+e.length+1{"use strict";const e={to:(t,e)=>e?`[${e+1};${t+1}H`:`[${t+1}G`,move(t,e){let i="";return t<0?i+=`[${-t}D`:t>0&&(i+=`[${t}C`),e<0?i+=`[${-e}A`:e>0&&(i+=`[${e}B`),i},up:(t=1)=>`[${t}A`,down:(t=1)=>`[${t}B`,forward:(t=1)=>`[${t}C`,backward:(t=1)=>`[${t}D`,nextLine:(t=1)=>"".repeat(t),prevLine:(t=1)=>"".repeat(t),left:"",hide:"[?25l",show:"[?25h",save:"7",restore:"8"},i={screen:"",up:(t=1)=>"".repeat(t),down:(t=1)=>"".repeat(t),line:"",lineEnd:"",lineStart:"",lines(t){let i="";for(let r=0;r"".repeat(t),down:(t=1)=>"".repeat(t)},erase:i,beep:""}},2081:t=>{"use strict";t.exports=require("child_process")},2361:t=>{"use strict";t.exports=require("events")},7147:t=>{"use strict";t.exports=require("fs")},7718:t=>{"use strict";t.exports=require("node:child_process")},2037:t=>{"use strict";t.exports=require("os")},1017:t=>{"use strict";t.exports=require("path")},7282:t=>{"use strict";t.exports=require("process")},4521:t=>{"use strict";t.exports=require("readline")},6224:t=>{"use strict";t.exports=require("tty")},7461:(t,e,i)=>{const{Argument:r}=i(8998),{Command:s}=i(5282),{CommanderError:n,InvalidArgumentError:o}=i(8056),{Help:h}=i(8917),{Option:a}=i(5790);(e=t.exports=new s).program=e,e.Argument=r,e.Command=s,e.CommanderError=n,e.Help=h,e.InvalidArgumentError=o,e.InvalidOptionArgumentError=o,e.Option=a},8998:(t,e,i)=>{const{InvalidArgumentError:r}=i(8056);e.Argument=class{constructor(t,e){switch(this.description=e||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,e){return e!==this.defaultValue&&Array.isArray(e)?e.concat(t):[t]}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,e)=>{if(!this.argChoices.includes(t))throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,e):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},e.humanReadableArgName=function(t){const e=t.name()+(!0===t.variadic?"...":"");return t.required?"<"+e+">":"["+e+"]"}},5282:(t,e,i)=>{const r=i(2361).EventEmitter,s=i(2081),n=i(1017),o=i(7147),h=i(7282),{Argument:a,humanReadableArgName:l}=i(8998),{CommanderError:u}=i(8056),{Help:c}=i(8917),{Option:d,splitOptionFlags:p,DualOptions:m}=i(5790),{suggestSimilar:g}=i(1812);class f extends r{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:t=>h.stdout.write(t),writeErr:t=>h.stderr.write(t),getOutHelpWidth:()=>h.stdout.isTTY?h.stdout.columns:void 0,getErrHelpWidth:()=>h.stderr.isTTY?h.stderr.columns:void 0,outputError:(t,e)=>e(t)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._hasHelpOption=t._hasHelpOption,this._helpFlags=t._helpFlags,this._helpDescription=t._helpDescription,this._helpShortFlag=t._helpShortFlag,this._helpLongFlag=t._helpLongFlag,this._helpCommandName=t._helpCommandName,this._helpCommandnameAndArgs=t._helpCommandnameAndArgs,this._helpCommandDescription=t._helpCommandDescription,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}command(t,e,i){let r=e,s=i;"object"==typeof r&&null!==r&&(s=r,r=null),s=s||{};const[,n,o]=t.match(/([^ ]+) *(.*)/),h=this.createCommand(n);return r&&(h.description(r),h._executableHandler=!0),s.isDefault&&(this._defaultCommandName=h._name),h._hidden=!(!s.noHelp&&!s.hidden),h._executableFile=s.executableFile||null,o&&h.arguments(o),this.commands.push(h),h.parent=this,h.copyInheritedSettings(this),r?this:h}createCommand(t){return new f(t)}createHelp(){return Object.assign(new c,this.configureHelp())}configureHelp(t){return void 0===t?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return void 0===t?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return"string"!=typeof t&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,e){if(!t._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(e=e||{}).isDefault&&(this._defaultCommandName=t._name),(e.noHelp||e.hidden)&&(t._hidden=!0),this.commands.push(t),t.parent=this,this}createArgument(t,e){return new a(t,e)}argument(t,e,i,r){const s=this.createArgument(t,e);return"function"==typeof i?s.default(r).argParser(i):s.default(i),this.addArgument(s),this}arguments(t){return t.split(/ +/).forEach((t=>{this.argument(t)})),this}addArgument(t){const e=this._args.slice(-1)[0];if(e&&e.variadic)throw new Error(`only the last argument can be variadic '${e.name()}'`);if(t.required&&void 0!==t.defaultValue&&void 0===t.parseArg)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this._args.push(t),this}addHelpCommand(t,e){return!1===t?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof t&&(this._helpCommandName=t.split(" ")[0],this._helpCommandnameAndArgs=t),this._helpCommandDescription=e||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(t,e){const i=["preSubcommand","preAction","postAction"];if(!i.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(e):this._lifeCycleHooks[t]=[e],this}exitOverride(t){return this._exitCallback=t||(t=>{if("commander.executeSubCommandAsync"!==t.code)throw t}),this}_exit(t,e,i){this._exitCallback&&this._exitCallback(new u(t,e,i)),h.exit(t)}action(t){return this._actionHandler=e=>{const i=this._args.length,r=e.slice(0,i);return this._storeOptionsAsProperties?r[i]=this:r[i]=this.opts(),r.push(this),t.apply(this,r)},this}createOption(t,e){return new d(t,e)}addOption(t){const e=t.name(),i=t.attributeName();if(t.negate){const e=t.long.replace(/^--no-/,"--");this._findOption(e)||this.setOptionValueWithSource(i,void 0===t.defaultValue||t.defaultValue,"default")}else void 0!==t.defaultValue&&this.setOptionValueWithSource(i,t.defaultValue,"default");this.options.push(t);const r=(e,r,s)=>{null==e&&void 0!==t.presetArg&&(e=t.presetArg);const n=this.getOptionValue(i);if(null!==e&&t.parseArg)try{e=t.parseArg(e,n)}catch(t){if("commander.invalidArgument"===t.code){const e=`${r} ${t.message}`;this.error(e,{exitCode:t.exitCode,code:t.code})}throw t}else null!==e&&t.variadic&&(e=t._concatValue(e,n));null==e&&(e=!t.negate&&(!(!t.isBoolean()&&!t.optional)||"")),this.setOptionValueWithSource(i,e,s)};return this.on("option:"+e,(e=>{const i=`error: option '${t.flags}' argument '${e}' is invalid.`;r(e,i,"cli")})),t.envVar&&this.on("optionEnv:"+e,(e=>{const i=`error: option '${t.flags}' value '${e}' from env '${t.envVar}' is invalid.`;r(e,i,"env")})),this}_optionEx(t,e,i,r,s){if("object"==typeof e&&e instanceof d)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const n=this.createOption(e,i);if(n.makeOptionMandatory(!!t.mandatory),"function"==typeof r)n.default(s).argParser(r);else if(r instanceof RegExp){const t=r;r=(e,i)=>{const r=t.exec(e);return r?r[0]:i},n.default(s).argParser(r)}else n.default(r);return this.addOption(n)}option(t,e,i,r){return this._optionEx({},t,e,i,r)}requiredOption(t,e,i,r){return this._optionEx({mandatory:!0},t,e,i,r)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){if(this._passThroughOptions=!!t,this.parent&&t&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(t=!0){if(this._storeOptionsAsProperties=!!t,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,e){return this._storeOptionsAsProperties?this[t]=e:this._optionValues[t]=e,this}setOptionValueWithSource(t,e,i){return this.setOptionValue(t,e),this._optionValueSources[t]=i,this}getOptionValueSource(t){return this._optionValueSources[t]}_prepareUserArgs(t,e){if(void 0!==t&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");let i;switch(e=e||{},void 0===t&&(t=h.argv,h.versions&&h.versions.electron&&(e.from="electron")),this.rawArgs=t.slice(),e.from){case void 0:case"node":this._scriptPath=t[1],i=t.slice(2);break;case"electron":h.defaultApp?(this._scriptPath=t[1],i=t.slice(2)):i=t.slice(1);break;case"user":i=t.slice(0);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(t,e){const i=this._prepareUserArgs(t,e);return this._parseCommand([],i),this}async parseAsync(t,e){const i=this._prepareUserArgs(t,e);return await this._parseCommand([],i),this}_executeSubCommand(t,e){e=e.slice();let i=!1;const r=[".js",".ts",".tsx",".mjs",".cjs"];function a(t,e){const i=n.resolve(t,e);if(o.existsSync(i))return i;if(r.includes(n.extname(e)))return;const s=r.find((t=>o.existsSync(`${i}${t}`)));return s?`${i}${s}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let l,c=t._executableFile||`${this._name}-${t._name}`,d=this._executableDir||"";if(this._scriptPath){let t;try{t=o.realpathSync(this._scriptPath)}catch(e){t=this._scriptPath}d=n.resolve(n.dirname(t),d)}if(d){let e=a(d,c);if(!e&&!t._executableFile&&this._scriptPath){const i=n.basename(this._scriptPath,n.extname(this._scriptPath));i!==this._name&&(e=a(d,`${i}-${t._name}`))}c=e||c}i=r.includes(n.extname(c)),"win32"!==h.platform?i?(e.unshift(c),e=b(h.execArgv).concat(e),l=s.spawn(h.argv[0],e,{stdio:"inherit"})):l=s.spawn(c,e,{stdio:"inherit"}):(e.unshift(c),e=b(h.execArgv).concat(e),l=s.spawn(h.execPath,e,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((t=>{h.on(t,(()=>{!1===l.killed&&null===l.exitCode&&l.kill(t)}))}));const p=this._exitCallback;p?l.on("close",(()=>{p(new u(h.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):l.on("close",h.exit.bind(h)),l.on("error",(e=>{if("ENOENT"===e.code){const e=d?`searched for local subcommand relative to directory '${d}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${c}' does not exist\n - if '${t._name}' 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 - ${e}`;throw new Error(i)}if("EACCES"===e.code)throw new Error(`'${c}' not executable`);if(p){const t=new u(1,"commander.executeSubCommandAsync","(error)");t.nestedError=e,p(t)}else h.exit(1)})),this.runningCommand=l}_dispatchSubcommand(t,e,i){const r=this._findCommand(t);let s;return r||this.help({error:!0}),s=this._chainOrCallSubCommandHook(s,r,"preSubcommand"),s=this._chainOrCall(s,(()=>{if(!r._executableHandler)return r._parseCommand(e,i);this._executeSubCommand(r,e.concat(i))})),s}_checkNumberOfArguments(){this._args.forEach(((t,e)=>{t.required&&null==this.args[e]&&this.missingArgument(t.name())})),this._args.length>0&&this._args[this._args.length-1].variadic||this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const t=(t,e,i)=>{let r=e;if(null!==e&&t.parseArg)try{r=t.parseArg(e,i)}catch(i){if("commander.invalidArgument"===i.code){const r=`error: command-argument value '${e}' is invalid for argument '${t.name()}'. ${i.message}`;this.error(r,{exitCode:i.exitCode,code:i.code})}throw i}return r};this._checkNumberOfArguments();const e=[];this._args.forEach(((i,r)=>{let s=i.defaultValue;i.variadic?rt(i,r,e)),i.defaultValue))):void 0===s&&(s=[]):re())):e()}_chainOrCallHooks(t,e){let i=t;const r=[];return y(this).reverse().filter((t=>void 0!==t._lifeCycleHooks[e])).forEach((t=>{t._lifeCycleHooks[e].forEach((e=>{r.push({hookedCommand:t,callback:e})}))})),"postAction"===e&&r.reverse(),r.forEach((t=>{i=this._chainOrCall(i,(()=>t.callback(t.hookedCommand,this)))})),i}_chainOrCallSubCommandHook(t,e,i){let r=t;return void 0!==this._lifeCycleHooks[i]&&this._lifeCycleHooks[i].forEach((t=>{r=this._chainOrCall(r,(()=>t(this,e)))})),r}_parseCommand(t,e){const i=this.parseOptions(e);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(i.operands),e=i.unknown,this.args=t.concat(e),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),e);if(this._hasImplicitHelpCommand()&&t[0]===this._helpCommandName)return 1===t.length&&this.help(),this._dispatchSubcommand(t[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return v(this,e),this._dispatchSubcommand(this._defaultCommandName,t,e);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),v(this,i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const r=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){let i;return r(),this._processArguments(),i=this._chainOrCallHooks(i,"preAction"),i=this._chainOrCall(i,(()=>this._actionHandler(this.processedArgs))),this.parent&&(i=this._chainOrCall(i,(()=>{this.parent.emit(s,t,e)}))),i=this._chainOrCallHooks(i,"postAction"),i}if(this.parent&&this.parent.listenerCount(s))r(),this._processArguments(),this.parent.emit(s,t,e);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,e);this.listenerCount("command:*")?this.emit("command:*",t,e):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(t){if(t)return this.commands.find((e=>e._name===t||e._aliases.includes(t)))}_findOption(t){return this.options.find((e=>e.is(t)))}_checkForMissingMandatoryOptions(){for(let t=this;t;t=t.parent)t.options.forEach((e=>{e.mandatory&&void 0===t.getOptionValue(e.attributeName())&&t.missingMandatoryOptionValue(e)}))}_checkForConflictingLocalOptions(){const t=this.options.filter((t=>{const e=t.attributeName();return void 0!==this.getOptionValue(e)&&"default"!==this.getOptionValueSource(e)}));t.filter((t=>t.conflictsWith.length>0)).forEach((e=>{const i=t.find((t=>e.conflictsWith.includes(t.attributeName())));i&&this._conflictingOption(e,i)}))}_checkForConflictingOptions(){for(let t=this;t;t=t.parent)t._checkForConflictingLocalOptions()}parseOptions(t){const e=[],i=[];let r=e;const s=t.slice();function n(t){return t.length>1&&"-"===t[0]}let o=null;for(;s.length;){const t=s.shift();if("--"===t){r===i&&r.push(t),r.push(...s);break}if(!o||n(t)){if(o=null,n(t)){const e=this._findOption(t);if(e){if(e.required){const t=s.shift();void 0===t&&this.optionMissingArgument(e),this.emit(`option:${e.name()}`,t)}else if(e.optional){let t=null;s.length>0&&!n(s[0])&&(t=s.shift()),this.emit(`option:${e.name()}`,t)}else this.emit(`option:${e.name()}`);o=e.variadic?e:null;continue}}if(t.length>2&&"-"===t[0]&&"-"!==t[1]){const e=this._findOption(`-${t[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,t.slice(2)):(this.emit(`option:${e.name()}`),s.unshift(`-${t.slice(2)}`));continue}}if(/^--[^=]+=/.test(t)){const e=t.indexOf("="),i=this._findOption(t.slice(0,e));if(i&&(i.required||i.optional)){this.emit(`option:${i.name()}`,t.slice(e+1));continue}}if(n(t)&&(r=i),(this._enablePositionalOptions||this._passThroughOptions)&&0===e.length&&0===i.length){if(this._findCommand(t)){e.push(t),s.length>0&&i.push(...s);break}if(t===this._helpCommandName&&this._hasImplicitHelpCommand()){e.push(t),s.length>0&&e.push(...s);break}if(this._defaultCommandName){i.push(t),s.length>0&&i.push(...s);break}}if(this._passThroughOptions){r.push(t),s.length>0&&r.push(...s);break}r.push(t)}else this.emit(`option:${o.name()}`,t)}return{operands:e,unknown:i}}opts(){if(this._storeOptionsAsProperties){const t={},e=this.options.length;for(let i=0;iObject.assign(t,e.opts())),{})}error(t,e){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const i=e||{},r=i.exitCode||1,s=i.code||"commander.error";this._exit(r,s,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in h.env){const e=t.attributeName();(void 0===this.getOptionValue(e)||["default","config","env"].includes(this.getOptionValueSource(e)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,h.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}}))}_parseOptionsImplied(){const t=new m(this.options),e=t=>void 0!==this.getOptionValue(t)&&!["default","implied"].includes(this.getOptionValueSource(t));this.options.filter((i=>void 0!==i.implied&&e(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i))).forEach((t=>{Object.keys(t.implied).filter((t=>!e(t))).forEach((e=>{this.setOptionValueWithSource(e,t.implied[e],"implied")}))}))}missingArgument(t){const e=`error: missing required argument '${t}'`;this.error(e,{code:"commander.missingArgument"})}optionMissingArgument(t){const e=`error: option '${t.flags}' argument missing`;this.error(e,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const e=`error: required option '${t.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,e){const i=t=>{const e=t.attributeName(),i=this.getOptionValue(e),r=this.options.find((t=>t.negate&&e===t.attributeName())),s=this.options.find((t=>!t.negate&&e===t.attributeName()));return r&&(void 0===r.presetArg&&!1===i||void 0!==r.presetArg&&i===r.presetArg)?r:s||t},r=t=>{const e=i(t),r=e.attributeName();return"env"===this.getOptionValueSource(r)?`environment variable '${e.envVar}'`:`option '${e.flags}'`},s=`error: ${r(t)} cannot be used with ${r(e)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],r=this;do{const t=r.createHelp().visibleOptions(r).filter((t=>t.long)).map((t=>t.long));i=i.concat(t),r=r.parent}while(r&&!r._enablePositionalOptions);e=g(t,i)}const i=`error: unknown option '${t}'${e}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const e=this._args.length,i=1===e?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${e} argument${i} but got ${t.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let e="";if(this._showSuggestionAfterError){const i=[];this.createHelp().visibleCommands(this).forEach((t=>{i.push(t.name()),t.alias()&&i.push(t.alias())})),e=g(t,i)}const i=`error: unknown command '${t}'${e}`;this.error(i,{code:"commander.unknownCommand"})}version(t,e,i){if(void 0===t)return this._version;this._version=t,e=e||"-V, --version",i=i||"output the version number";const r=this.createOption(e,i);return this._versionOptionName=r.attributeName(),this.options.push(r),this.on("option:"+r.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`),this._exit(0,"commander.version",t)})),this}description(t,e){return void 0===t&&void 0===e?this._description:(this._description=t,e&&(this._argsDescription=e),this)}summary(t){return void 0===t?this._summary:(this._summary=t,this)}alias(t){if(void 0===t)return this._aliases[0];let e=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(e=this.commands[this.commands.length-1]),t===e._name)throw new Error("Command alias can't be the same as its name");return e._aliases.push(t),this}aliases(t){return void 0===t?this._aliases:(t.forEach((t=>this.alias(t))),this)}usage(t){if(void 0===t){if(this._usage)return this._usage;const t=this._args.map((t=>l(t)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?t:[]).join(" ")}return this._usage=t,this}name(t){return void 0===t?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=n.basename(t,n.extname(t)),this}executableDir(t){return void 0===t?this._executableDir:(this._executableDir=t,this)}helpInformation(t){const e=this.createHelp();return void 0===e.helpWidth&&(e.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),e.formatHelp(this,e)}_getHelpContext(t){const e={error:!!(t=t||{}).error};let i;return i=e.error?t=>this._outputConfiguration.writeErr(t):t=>this._outputConfiguration.writeOut(t),e.write=t.write||i,e.command=this,e}outputHelp(t){let e;"function"==typeof t&&(e=t,t=void 0);const i=this._getHelpContext(t);y(this).reverse().forEach((t=>t.emit("beforeAllHelp",i))),this.emit("beforeHelp",i);let r=this.helpInformation(i);if(e&&(r=e(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(r),this.emit(this._helpLongFlag),this.emit("afterHelp",i),y(this).forEach((t=>t.emit("afterAllHelp",i)))}helpOption(t,e){if("boolean"==typeof t)return this._hasHelpOption=t,this;this._helpFlags=t||this._helpFlags,this._helpDescription=e||this._helpDescription;const i=p(this._helpFlags);return this._helpShortFlag=i.shortFlag,this._helpLongFlag=i.longFlag,this}help(t){this.outputHelp(t);let e=h.exitCode||0;0===e&&t&&"function"!=typeof t&&t.error&&(e=1),this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){const i=["beforeAll","before","after","afterAll"];if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${i.join("', '")}'`);const r=`${t}Help`;return this.on(r,(t=>{let i;i="function"==typeof e?e({error:t.error,command:t.command}):e,i&&t.write(`${i}\n`)})),this}}function v(t,e){t._hasHelpOption&&e.find((e=>e===t._helpLongFlag||e===t._helpShortFlag))&&(t.outputHelp(),t._exit(0,"commander.helpDisplayed","(outputHelp)"))}function b(t){return t.map((t=>{if(!t.startsWith("--inspect"))return t;let e,i,r="127.0.0.1",s="9229";return null!==(i=t.match(/^(--inspect(-brk)?)$/))?e=i[1]:null!==(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(e=i[1],/^\d+$/.test(i[3])?s=i[3]:r=i[3]):null!==(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(e=i[1],r=i[3],s=i[4]),e&&"0"!==s?`${e}=${r}:${parseInt(s)+1}`:t}))}function y(t){const e=[];for(let i=t;i;i=i.parent)e.push(i);return e}e.Command=f},8056:(t,e)=>{class i extends Error{constructor(t,e,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=e,this.exitCode=t,this.nestedError=void 0}}e.CommanderError=i,e.InvalidArgumentError=class extends i{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}},8917:(t,e,i)=>{const{humanReadableArgName:r}=i(8998);e.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(t){const e=t.commands.filter((t=>!t._hidden));if(t._hasImplicitHelpCommand()){const[,i,r]=t._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),s=t.createCommand(i).helpOption(!1);s.description(t._helpCommandDescription),r&&s.arguments(r),e.push(s)}return this.sortSubcommands&&e.sort(((t,e)=>t.name().localeCompare(e.name()))),e}visibleOptions(t){const e=t.options.filter((t=>!t.hidden)),i=t._hasHelpOption&&t._helpShortFlag&&!t._findOption(t._helpShortFlag),r=t._hasHelpOption&&!t._findOption(t._helpLongFlag);if(i||r){let s;s=i?r?t.createOption(t._helpFlags,t._helpDescription):t.createOption(t._helpShortFlag,t._helpDescription):t.createOption(t._helpLongFlag,t._helpDescription),e.push(s)}if(this.sortOptions){const t=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");e.sort(((e,i)=>t(e).localeCompare(t(i))))}return e}visibleArguments(t){return t._argsDescription&&t._args.forEach((e=>{e.description=e.description||t._argsDescription[e.name()]||""})),t._args.find((t=>t.description))?t._args:[]}subcommandTerm(t){const e=t._args.map((t=>r(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,e){return e.visibleCommands(t).reduce(((t,i)=>Math.max(t,e.subcommandTerm(i).length)),0)}longestOptionTermLength(t,e){return e.visibleOptions(t).reduce(((t,i)=>Math.max(t,e.optionTerm(i).length)),0)}longestArgumentTermLength(t,e){return e.visibleArguments(t).reduce(((t,i)=>Math.max(t,e.argumentTerm(i).length)),0)}commandUsage(t){let e=t._name;t._aliases[0]&&(e=e+"|"+t._aliases[0]);let i="";for(let e=t.parent;e;e=e.parent)i=e.name()+" "+i;return i+e+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){const e=[];return t.argChoices&&e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`),void 0!==t.defaultValue&&(t.required||t.optional||t.isBoolean()&&"boolean"==typeof t.defaultValue)&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),void 0!==t.presetArg&&t.optional&&e.push(`preset: ${JSON.stringify(t.presetArg)}`),void 0!==t.envVar&&e.push(`env: ${t.envVar}`),e.length>0?`${t.description} (${e.join(", ")})`:t.description}argumentDescription(t){const e=[];if(t.argChoices&&e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`),void 0!==t.defaultValue&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),e.length>0){const i=`(${e.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatHelp(t,e){const i=e.padWidth(t,e),r=e.helpWidth||80;function s(t,s){if(s){const n=`${t.padEnd(i+2)}${s}`;return e.wrap(n,r-2,i+2)}return t}function n(t){return t.join("\n").replace(/^/gm," ".repeat(2))}let o=[`Usage: ${e.commandUsage(t)}`,""];const h=e.commandDescription(t);h.length>0&&(o=o.concat([h,""]));const a=e.visibleArguments(t).map((t=>s(e.argumentTerm(t),e.argumentDescription(t))));a.length>0&&(o=o.concat(["Arguments:",n(a),""]));const l=e.visibleOptions(t).map((t=>s(e.optionTerm(t),e.optionDescription(t))));l.length>0&&(o=o.concat(["Options:",n(l),""]));const u=e.visibleCommands(t).map((t=>s(e.subcommandTerm(t),e.subcommandDescription(t))));return u.length>0&&(o=o.concat(["Commands:",n(u),""])),o.join("\n")}padWidth(t,e){return Math.max(e.longestOptionTermLength(t,e),e.longestSubcommandTermLength(t,e),e.longestArgumentTermLength(t,e))}wrap(t,e,i,r=40){if(t.match(/[\n]\s+/))return t;const s=e-i;if(s("\n"===t.slice(-1)&&(t=t.slice(0,t.length-1)),(e>0?h:"")+t.trimRight()))).join("\n")}}},5790:(t,e,i)=>{const{InvalidArgumentError:r}=i(8056);function s(t){let e,i;const r=t.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(e=r.shift()),i=r.shift(),!e&&/^-[^-]$/.test(i)&&(e=i,i=void 0),{shortFlag:e,longFlag:i}}e.Option=class{constructor(t,e){this.flags=t,this.description=e||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;const i=s(t);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){return this.implied=Object.assign(this.implied||{},t),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,e){return e!==this.defaultValue&&Array.isArray(e)?e.concat(t):[t]}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,e)=>{if(!this.argChoices.includes(t))throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,e):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce(((t,e)=>t+e[0].toUpperCase()+e.slice(1)))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},e.splitOptionFlags=s,e.DualOptions=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach((t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)})),this.negativeOptions.forEach(((t,e)=>{this.positiveOptions.has(e)&&this.dualOptions.add(e)}))}valueFromOption(t,e){const i=e.attributeName();if(!this.dualOptions.has(i))return!0;const r=this.negativeOptions.get(i).presetArg,s=void 0!==r&&r;return e.negate===(s===t)}}},1812:(t,e)=>{e.suggestSimilar=function(t,e){if(!e||0===e.length)return"";e=Array.from(new Set(e));const i=t.startsWith("--");i&&(t=t.slice(2),e=e.map((t=>t.slice(2))));let r=[],s=3;return e.forEach((e=>{if(e.length<=1)return;const i=function(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);const i=[];for(let e=0;e<=t.length;e++)i[e]=[e];for(let t=0;t<=e.length;t++)i[0][t]=t;for(let r=1;r<=e.length;r++)for(let s=1;s<=t.length;s++){let n=1;n=t[s-1]===e[r-1]?0:1,i[s][r]=Math.min(i[s-1][r]+1,i[s][r-1]+1,i[s-1][r-1]+n),s>1&&r>1&&t[s-1]===e[r-2]&&t[s-2]===e[r-1]&&(i[s][r]=Math.min(i[s][r],i[s-2][r-2]+1))}return i[t.length][e.length]}(t,e),n=Math.max(t.length,e.length);(n-i)/n>.4&&(it.localeCompare(e))),i&&(r=r.map((t=>`--${t}`))),r.length>1?`\n(Did you mean one of ${r.join(", ")}?)`:1===r.length?`\n(Did you mean ${r[0]}?)`:""}}},e={};function i(r){var s=e[r];if(void 0!==s)return s.exports;var n=e[r]={id:r,loaded:!1,exports:{}};return t[r](n,n.exports,i),n.loaded=!0,n.exports}i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r,s,n,o={};r=i(7461).Command,s=i(1307),(n=new r).name("leto-modelizer-plugin-cli").description("CLI install and manage plugins in leto-modelizer").version("0.1.1"),Object.keys(s).forEach((function(t){return s[t].setup(n)})),n.parse();var h=exports;for(var a in o)h[a]=o[a];o.__esModule&&Object.defineProperty(h,"__esModule",{value:!0})})(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e697609..b9cc219 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "leto-modelizer-plugin-cli", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "leto-modelizer-plugin-cli", - "version": "0.1.1", + "version": "0.1.2", "license": "Mozilla Public License Version 2.0", "dependencies": { "chalk": "^4.1.2", diff --git a/package.json b/package.json index 0ec1be5..88f5a49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "leto-modelizer-plugin-cli", - "version": "0.1.1", + "version": "0.1.2", "description": "Command line tools to install and manage plugins in leto-modelizer", "main": "dist/leto-modelizer-plugin-cli.js", "exports": {