diff --git a/CHANGELOG.md b/CHANGELOG.md index 431f663..94944ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +# v4.4.1 (Wed Sep 27 2023) + +#### 🚀 Enhancement + +- Remove Universal option from prompts (it remains available in flags) + +# v4.4.0 (Wed Sep 27 2023) + +#### 🚀 Enhancement + +- Updates the UI design of the templates + +#### Authors: 2 + +- James ([@jamesrp13](https://github.com/jamesrp13)) +- Aditya Kulkarni ([@AdityaKulkarni](https://github.com/AdityaKulkarni)) + +--- + # v4.3.1 (Fri Sep 15 2023) #### 🚀 Enhancement diff --git a/compiled/config.jsonc b/compiled/config.jsonc index c54e2fb..66b3ea8 100644 --- a/compiled/config.jsonc +++ b/compiled/config.jsonc @@ -11,6 +11,5 @@ "react-is", "tar", "wrap-ansi", - "yargs-parser", - "zombi" + "yargs-parser" ] diff --git a/compiled/zombi/LICENSE b/compiled/zombi/LICENSE deleted file mode 100644 index e089273..0000000 --- a/compiled/zombi/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License (MIT) - -Copyright © 2018-present, Ian K Smith. All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the “Software”), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/compiled/zombi/index.js b/compiled/zombi/index.js deleted file mode 100644 index c45bfac..0000000 --- a/compiled/zombi/index.js +++ /dev/null @@ -1,24 +0,0 @@ -(()=>{var e={9151:(e,t,n)=>{"use strict";const isObject=e=>e!==null&&typeof e==="object"&&!Array.isArray(e);const i=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g;const hasColor=()=>{if(typeof process!=="undefined"){return process.env.FORCE_COLOR!=="0"}return false};const create=()=>{const e={enabled:hasColor(),visible:true,styles:{},keys:{}};const ansi=e=>{let t=e.open=`[${e.codes[0]}m`;let n=e.close=`[${e.codes[1]}m`;let i=e.regex=new RegExp(`\\u001b\\[${e.codes[1]}m`,"g");e.wrap=(e,s)=>{if(e.includes(n))e=e.replace(i,n+t);let a=t+e+n;return s?a.replace(/\r*\n/g,`${n}$&${t}`):a};return e};const wrap=(e,t,n)=>typeof e==="function"?e(t):e.wrap(t,n);const style=(t,n)=>{if(t===""||t==null)return"";if(e.enabled===false)return t;if(e.visible===false)return"";let i=""+t;let s=i.includes("\n");let a=n.length;if(a>0&&n.includes("unstyle")){n=[...new Set(["unstyle",...n])].reverse()}while(a-- >0)i=wrap(e.styles[n[a]],i,s);return i};const define=(t,n,i)=>{e.styles[t]=ansi({name:t,codes:n});let s=e.keys[i]||(e.keys[i]=[]);s.push(t);Reflect.defineProperty(e,t,{configurable:true,enumerable:true,set(n){e.alias(t,n)},get(){let color=e=>style(e,color.stack);Reflect.setPrototypeOf(color,e);color.stack=this.stack?this.stack.concat(t):[t];return color}})};define("reset",[0,0],"modifier");define("bold",[1,22],"modifier");define("dim",[2,22],"modifier");define("italic",[3,23],"modifier");define("underline",[4,24],"modifier");define("inverse",[7,27],"modifier");define("hidden",[8,28],"modifier");define("strikethrough",[9,29],"modifier");define("black",[30,39],"color");define("red",[31,39],"color");define("green",[32,39],"color");define("yellow",[33,39],"color");define("blue",[34,39],"color");define("magenta",[35,39],"color");define("cyan",[36,39],"color");define("white",[37,39],"color");define("gray",[90,39],"color");define("grey",[90,39],"color");define("bgBlack",[40,49],"bg");define("bgRed",[41,49],"bg");define("bgGreen",[42,49],"bg");define("bgYellow",[43,49],"bg");define("bgBlue",[44,49],"bg");define("bgMagenta",[45,49],"bg");define("bgCyan",[46,49],"bg");define("bgWhite",[47,49],"bg");define("blackBright",[90,39],"bright");define("redBright",[91,39],"bright");define("greenBright",[92,39],"bright");define("yellowBright",[93,39],"bright");define("blueBright",[94,39],"bright");define("magentaBright",[95,39],"bright");define("cyanBright",[96,39],"bright");define("whiteBright",[97,39],"bright");define("bgBlackBright",[100,49],"bgBright");define("bgRedBright",[101,49],"bgBright");define("bgGreenBright",[102,49],"bgBright");define("bgYellowBright",[103,49],"bgBright");define("bgBlueBright",[104,49],"bgBright");define("bgMagentaBright",[105,49],"bgBright");define("bgCyanBright",[106,49],"bgBright");define("bgWhiteBright",[107,49],"bgBright");e.ansiRegex=i;e.hasColor=e.hasAnsi=t=>{e.ansiRegex.lastIndex=0;return typeof t==="string"&&t!==""&&e.ansiRegex.test(t)};e.alias=(t,n)=>{let i=typeof n==="string"?e[n]:n;if(typeof i!=="function"){throw new TypeError("Expected alias to be the name of an existing color (string) or a function")}if(!i.stack){Reflect.defineProperty(i,"name",{value:t});e.styles[t]=i;i.stack=[t]}Reflect.defineProperty(e,t,{configurable:true,enumerable:true,set(n){e.alias(t,n)},get(){let color=e=>style(e,color.stack);Reflect.setPrototypeOf(color,e);color.stack=this.stack?this.stack.concat(i.stack):i.stack;return color}})};e.theme=t=>{if(!isObject(t))throw new TypeError("Expected theme to be an object");for(let n of Object.keys(t)){e.alias(n,t[n])}return e};e.alias("unstyle",(t=>{if(typeof t==="string"&&t!==""){e.ansiRegex.lastIndex=0;return t.replace(e.ansiRegex,"")}return""}));e.alias("noop",(e=>e));e.none=e.clear=e.noop;e.stripColor=e.unstyle;e.symbols=n(2522);e.define=define;return e};e.exports=create();e.exports.create=create},2522:e=>{"use strict";const t=typeof process!=="undefined"&&process.env.TERM_PROGRAM==="Hyper";const n=typeof process!=="undefined"&&process.platform==="win32";const i=typeof process!=="undefined"&&process.platform==="linux";const s={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",question:"?",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"};const a=Object.assign({},s,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"});const o=Object.assign({},s,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",questionFull:"?",questionSmall:"﹖",pointer:i?"▸":"❯",pointerSmall:i?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});e.exports=n&&!t?a:o;Reflect.defineProperty(e.exports,"common",{enumerable:false,value:s});Reflect.defineProperty(e.exports,"windows",{enumerable:false,value:a});Reflect.defineProperty(e.exports,"other",{enumerable:false,value:o})},5063:e=>{"use strict";e.exports=({onlyFirst:e=false}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?undefined:"g")}},2068:(e,t,n)=>{"use strict";e=n.nmd(e);const wrapAnsi16=(e,t)=>(...n)=>{const i=e(...n);return`[${i+t}m`};const wrapAnsi256=(e,t)=>(...n)=>{const i=e(...n);return`[${38+t};5;${i}m`};const wrapAnsi16m=(e,t)=>(...n)=>{const i=e(...n);return`[${38+t};2;${i[0]};${i[1]};${i[2]}m`};const ansi2ansi=e=>e;const rgb2rgb=(e,t,n)=>[e,t,n];const setLazyProperty=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const i=n();Object.defineProperty(e,t,{value:i,enumerable:true,configurable:true});return i},enumerable:true,configurable:true})};let i;const makeDynamicStyles=(e,t,s,a)=>{if(i===undefined){i=n(6931)}const o=a?10:0;const l={};for(const[n,a]of Object.entries(i)){const i=n==="ansi16"?"ansi":n;if(n===t){l[i]=e(s,o)}else if(typeof a==="object"){l[i]=e(a[t],o)}}return l};function assembleStyles(){const e=new Map;const t={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]}};t.color.gray=t.color.blackBright;t.bgColor.bgGray=t.bgColor.bgBlackBright;t.color.grey=t.color.blackBright;t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(const[n,i]of Object.entries(t)){for(const[n,s]of Object.entries(i)){t[n]={open:`[${s[0]}m`,close:`[${s[1]}m`};i[n]=t[n];e.set(s[0],s[1])}Object.defineProperty(t,n,{value:i,enumerable:false})}Object.defineProperty(t,"codes",{value:e,enumerable:false});t.color.close="";t.bgColor.close="";setLazyProperty(t.color,"ansi",(()=>makeDynamicStyles(wrapAnsi16,"ansi16",ansi2ansi,false)));setLazyProperty(t.color,"ansi256",(()=>makeDynamicStyles(wrapAnsi256,"ansi256",ansi2ansi,false)));setLazyProperty(t.color,"ansi16m",(()=>makeDynamicStyles(wrapAnsi16m,"rgb",rgb2rgb,false)));setLazyProperty(t.bgColor,"ansi",(()=>makeDynamicStyles(wrapAnsi16,"ansi16",ansi2ansi,true)));setLazyProperty(t.bgColor,"ansi256",(()=>makeDynamicStyles(wrapAnsi256,"ansi256",ansi2ansi,true)));setLazyProperty(t.bgColor,"ansi16m",(()=>makeDynamicStyles(wrapAnsi16m,"rgb",rgb2rgb,true)));return t}Object.defineProperty(e,"exports",{enumerable:true,get:assembleStyles})},3664:(e,t,n)=>{"use strict";const{Buffer:i}=n(4300);const s=Symbol.for("BufferList");function BufferList(e){if(!(this instanceof BufferList)){return new BufferList(e)}BufferList._init.call(this,e)}BufferList._init=function _init(e){Object.defineProperty(this,s,{value:true});this._bufs=[];this.length=0;if(e){this.append(e)}};BufferList.prototype._new=function _new(e){return new BufferList(e)};BufferList.prototype._offset=function _offset(e){if(e===0){return[0,0]}let t=0;for(let n=0;nthis.length||e<0){return undefined}const t=this._offset(e);return this._bufs[t[0]][t[1]]};BufferList.prototype.slice=function slice(e,t){if(typeof e==="number"&&e<0){e+=this.length}if(typeof t==="number"&&t<0){t+=this.length}return this.copy(null,0,e,t)};BufferList.prototype.copy=function copy(e,t,n,s){if(typeof n!=="number"||n<0){n=0}if(typeof s!=="number"||s>this.length){s=this.length}if(n>=this.length){return e||i.alloc(0)}if(s<=0){return e||i.alloc(0)}const copy=!!e;const a=this._offset(n);const o=s-n;let l=o;let u=copy&&t||0;let f=a[1];if(n===0&&s===this.length){if(!copy){return this._bufs.length===1?this._bufs[0]:i.concat(this._bufs,this.length)}for(let t=0;tn){this._bufs[t].copy(e,u,f);u+=n}else{this._bufs[t].copy(e,u,f,f+l);u+=n;break}l-=n;if(f){f=0}}if(e.length>u)return e.slice(0,u);return e};BufferList.prototype.shallowSlice=function shallowSlice(e,t){e=e||0;t=typeof t!=="number"?this.length:t;if(e<0){e+=this.length}if(t<0){t+=this.length}if(e===t){return this._new()}const n=this._offset(e);const i=this._offset(t);const s=this._bufs.slice(n[0],i[0]+1);if(i[1]===0){s.pop()}else{s[s.length-1]=s[s.length-1].slice(0,i[1])}if(n[1]!==0){s[0]=s[0].slice(n[1])}return this._new(s)};BufferList.prototype.toString=function toString(e,t,n){return this.slice(t,n).toString(e)};BufferList.prototype.consume=function consume(e){e=Math.trunc(e);if(Number.isNaN(e)||e<=0)return this;while(this._bufs.length){if(e>=this._bufs[0].length){e-=this._bufs[0].length;this.length-=this._bufs[0].length;this._bufs.shift()}else{this._bufs[0]=this._bufs[0].slice(e);this.length-=e;break}}return this};BufferList.prototype.duplicate=function duplicate(){const e=this._new();for(let t=0;tthis.length?this.length:t}const s=this._offset(t);let a=s[0];let o=s[1];for(;a=e.length){const n=t.indexOf(e,o);if(n!==-1){return this._reverseOffset([a,n])}o=t.length-e.length+1}else{const t=this._reverseOffset([a,o]);if(this._match(t,e)){return t}o++}}o=0}return-1};BufferList.prototype._match=function(e,t){if(this.length-e{"use strict";const i=n(5519).Duplex;const s=n(4124);const a=n(3664);function BufferListStream(e){if(!(this instanceof BufferListStream)){return new BufferListStream(e)}if(typeof e==="function"){this._callback=e;const t=function piper(e){if(this._callback){this._callback(e);this._callback=null}}.bind(this);this.on("pipe",(function onPipe(e){e.on("error",t)}));this.on("unpipe",(function onUnpipe(e){e.removeListener("error",t)}));e=null}a._init.call(this,e);i.call(this)}s(BufferListStream,i);Object.assign(BufferListStream.prototype,a.prototype);BufferListStream.prototype._new=function _new(e){return new BufferListStream(e)};BufferListStream.prototype._write=function _write(e,t,n){this._appendBuffer(e);if(typeof n==="function"){n()}};BufferListStream.prototype._read=function _read(e){if(!this.length){return this.push(null)}e=Math.min(e,this.length);this.push(this.slice(0,e));this.consume(e)};BufferListStream.prototype.end=function end(e){i.prototype.end.call(this,e);if(this._callback){this._callback(null,this.slice());this._callback=null}};BufferListStream.prototype._destroy=function _destroy(e,t){this._bufs.length=0;this.length=0;t(e)};BufferListStream.prototype._isBufferList=function _isBufferList(e){return e instanceof BufferListStream||e instanceof a||BufferListStream.isBufferList(e)};BufferListStream.isBufferList=a.isBufferList;e.exports=BufferListStream;e.exports.BufferListStream=BufferListStream;e.exports.BufferList=a},7713:e=>{"use strict";const t={};function createErrorType(e,n,i){if(!i){i=Error}function getMessage(e,t,i){if(typeof n==="string"){return n}else{return n(e,t,i)}}class NodeError extends i{constructor(e,t,n){super(getMessage(e,t,n))}}NodeError.prototype.name=i.name;NodeError.prototype.code=e;t[e]=NodeError}function oneOf(e,t){if(Array.isArray(e)){const n=e.length;e=e.map((e=>String(e)));if(n>2){return`one of ${t} ${e.slice(0,n-1).join(", ")}, or `+e[n-1]}else if(n===2){return`one of ${t} ${e[0]} or ${e[1]}`}else{return`of ${t} ${e[0]}`}}else{return`of ${t} ${String(e)}`}}function startsWith(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function endsWith(e,t,n){if(n===undefined||n>e.length){n=e.length}return e.substring(n-t.length,n)===t}function includes(e,t,n){if(typeof n!=="number"){n=0}if(n+t.length>e.length){return false}else{return e.indexOf(t,n)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,n){let i;if(typeof t==="string"&&startsWith(t,"not ")){i="must not be";t=t.replace(/^not /,"")}else{i="must be"}let s;if(endsWith(e," argument")){s=`The ${e} ${i} ${oneOf(t,"type")}`}else{const n=includes(e,".")?"property":"argument";s=`The "${e}" ${n} ${i} ${oneOf(t,"type")}`}s+=`. Received type ${typeof n}`;return s}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.q=t},3928:(e,t,n)=>{"use strict";var i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=Duplex;var s=n(5209);var a=n(8729);n(4124)(Duplex,s);{var o=i(a.prototype);for(var l=0;l{"use strict";e.exports=PassThrough;var i=n(6753);n(4124)(PassThrough,i);function PassThrough(e){if(!(this instanceof PassThrough))return new PassThrough(e);i.call(this,e)}PassThrough.prototype._transform=function(e,t,n){n(null,e)}},5209:(e,t,n)=>{"use strict";e.exports=Readable;var i;Readable.ReadableState=ReadableState;var s=n(2361).EventEmitter;var a=function EElistenerCount(e,t){return e.listeners(t).length};var o=n(6238);var l=n(4300).Buffer;var u=(typeof global!=="undefined"?global:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(e){return l.from(e)}function _isUint8Array(e){return l.isBuffer(e)||e instanceof u}var f=n(3837);var h;if(f&&f.debuglog){h=f.debuglog("stream")}else{h=function debug(){}}var d=n(662);var m=n(6994);var y=n(3533),g=y.getHighWaterMark;var v=n(7713).q,_=v.ERR_INVALID_ARG_TYPE,S=v.ERR_STREAM_PUSH_AFTER_EOF,x=v.ERR_METHOD_NOT_IMPLEMENTED,k=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;var E;var R;var O;n(4124)(Readable,o);var C=m.errorOrDestroy;var I=["error","close","destroy","pause","resume"];function prependListener(e,t,n){if(typeof e.prependListener==="function")return e.prependListener(t,n);if(!e._events||!e._events[t])e.on(t,n);else if(Array.isArray(e._events[t]))e._events[t].unshift(n);else e._events[t]=[n,e._events[t]]}function ReadableState(e,t,s){i=i||n(3928);e=e||{};if(typeof s!=="boolean")s=t instanceof i;this.objectMode=!!e.objectMode;if(s)this.objectMode=this.objectMode||!!e.readableObjectMode;this.highWaterMark=g(this,e,"readableHighWaterMark",s);this.buffer=new d;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.paused=true;this.emitClose=e.emitClose!==false;this.autoDestroy=!!e.autoDestroy;this.destroyed=false;this.defaultEncoding=e.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(e.encoding){if(!E)E=n(299).s;this.decoder=new E(e.encoding);this.encoding=e.encoding}}function Readable(e){i=i||n(3928);if(!(this instanceof Readable))return new Readable(e);var t=this instanceof i;this._readableState=new ReadableState(e,this,t);this.readable=true;if(e){if(typeof e.read==="function")this._read=e.read;if(typeof e.destroy==="function")this._destroy=e.destroy}o.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{enumerable:false,get:function get(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function set(e){if(!this._readableState){return}this._readableState.destroyed=e}});Readable.prototype.destroy=m.destroy;Readable.prototype._undestroy=m.undestroy;Readable.prototype._destroy=function(e,t){t(e)};Readable.prototype.push=function(e,t){var n=this._readableState;var i;if(!n.objectMode){if(typeof e==="string"){t=t||n.defaultEncoding;if(t!==n.encoding){e=l.from(e,t);t=""}i=true}}else{i=true}return readableAddChunk(this,e,t,false,i)};Readable.prototype.unshift=function(e){return readableAddChunk(this,e,null,true,false)};function readableAddChunk(e,t,n,i,s){h("readableAddChunk",t);var a=e._readableState;if(t===null){a.reading=false;onEofChunk(e,a)}else{var o;if(!s)o=chunkInvalid(a,t);if(o){C(e,o)}else if(a.objectMode||t&&t.length>0){if(typeof t!=="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==l.prototype){t=_uint8ArrayToBuffer(t)}if(i){if(a.endEmitted)C(e,new k);else addChunk(e,a,t,true)}else if(a.ended){C(e,new S)}else if(a.destroyed){return false}else{a.reading=false;if(a.decoder&&!n){t=a.decoder.write(t);if(a.objectMode||t.length!==0)addChunk(e,a,t,false);else maybeReadMore(e,a)}else{addChunk(e,a,t,false)}}}else if(!i){a.reading=false;maybeReadMore(e,a)}}return!a.ended&&(a.length=j){e=j}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}Readable.prototype.read=function(e){h("read",e);e=parseInt(e,10);var t=this._readableState;var n=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended)){h("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var i=t.needReadable;h("need readable",i);if(t.length===0||t.length-e0)s=fromList(e,t);else s=null;if(s===null){t.needReadable=t.length<=t.highWaterMark;e=0}else{t.length-=e;t.awaitDrain=0}if(t.length===0){if(!t.ended)t.needReadable=true;if(n!==e&&t.ended)endReadable(this)}if(s!==null)this.emit("data",s);return s};function onEofChunk(e,t){h("onEofChunk");if(t.ended)return;if(t.decoder){var n=t.decoder.end();if(n&&n.length){t.buffer.push(n);t.length+=t.objectMode?1:n.length}}t.ended=true;if(t.sync){emitReadable(e)}else{t.needReadable=false;if(!t.emittedReadable){t.emittedReadable=true;emitReadable_(e)}}}function emitReadable(e){var t=e._readableState;h("emitReadable",t.needReadable,t.emittedReadable);t.needReadable=false;if(!t.emittedReadable){h("emitReadable",t.flowing);t.emittedReadable=true;process.nextTick(emitReadable_,e)}}function emitReadable_(e){var t=e._readableState;h("emitReadable_",t.destroyed,t.length,t.ended);if(!t.destroyed&&(t.length||t.ended)){e.emit("readable");t.emittedReadable=false}t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark;flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;process.nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){while(!t.reading&&!t.ended&&(t.length1&&indexOf(i.pipes,e)!==-1)&&!u){h("false write response, pause",i.awaitDrain);i.awaitDrain++}n.pause()}}function onerror(t){h("onerror",t);unpipe();e.removeListener("error",onerror);if(a(e,"error")===0)C(e,t)}prependListener(e,"error",onerror);function onclose(){e.removeListener("finish",onfinish);unpipe()}e.once("close",onclose);function onfinish(){h("onfinish");e.removeListener("close",onclose);unpipe()}e.once("finish",onfinish);function unpipe(){h("unpipe");n.unpipe(e)}e.emit("pipe",n);if(!i.flowing){h("pipe resume");n.resume()}return e};function pipeOnDrain(e){return function pipeOnDrainFunctionResult(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a(e,"data")){t.flowing=true;flow(e)}}}Readable.prototype.unpipe=function(e){var t=this._readableState;var n={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,n);return this}if(!e){var i=t.pipes;var s=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var a=0;a0;if(i.flowing!==false)this.resume()}else if(e==="readable"){if(!i.endEmitted&&!i.readableListening){i.readableListening=i.needReadable=true;i.flowing=false;i.emittedReadable=false;h("on readable",i.length,i.reading);if(i.length){emitReadable(this)}else if(!i.reading){process.nextTick(nReadingNextTick,this)}}}return n};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(e,t){var n=o.prototype.removeListener.call(this,e,t);if(e==="readable"){process.nextTick(updateReadableListening,this)}return n};Readable.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);if(e==="readable"||e===undefined){process.nextTick(updateReadableListening,this)}return t};function updateReadableListening(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0;if(t.resumeScheduled&&!t.paused){t.flowing=true}else if(e.listenerCount("data")>0){e.resume()}}function nReadingNextTick(e){h("readable nexttick read 0");e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;if(!e.flowing){h("resume");e.flowing=!e.readableListening;resume(this,e)}e.paused=false;return this};function resume(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;process.nextTick(resume_,e,t)}}function resume_(e,t){h("resume",t.reading);if(!t.reading){e.read(0)}t.resumeScheduled=false;e.emit("resume");flow(e);if(t.flowing&&!t.reading)e.read(0)}Readable.prototype.pause=function(){h("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){h("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(e){var t=e._readableState;h("flow",t.flowing);while(t.flowing&&e.read()!==null);}Readable.prototype.wrap=function(e){var t=this;var n=this._readableState;var i=false;e.on("end",(function(){h("wrapped end");if(n.decoder&&!n.ended){var e=n.decoder.end();if(e&&e.length)t.push(e)}t.push(null)}));e.on("data",(function(s){h("wrapped data");if(n.decoder)s=n.decoder.write(s);if(n.objectMode&&(s===null||s===undefined))return;else if(!n.objectMode&&(!s||!s.length))return;var a=t.push(s);if(!a){i=true;e.pause()}}));for(var s in e){if(this[s]===undefined&&typeof e[s]==="function"){this[s]=function methodWrap(t){return function methodWrapReturnFunction(){return e[t].apply(e,arguments)}}(s)}}for(var a=0;a=t.length){if(t.decoder)n=t.buffer.join("");else if(t.buffer.length===1)n=t.buffer.first();else n=t.buffer.concat(t.length);t.buffer.clear()}else{n=t.buffer.consume(e,t.decoder)}return n}function endReadable(e){var t=e._readableState;h("endReadable",t.endEmitted);if(!t.endEmitted){t.ended=true;process.nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){h("endReadableNT",e.endEmitted,e.length);if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end");if(e.autoDestroy){var n=t._writableState;if(!n||n.autoDestroy&&n.finished){t.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(e,t){if(O===undefined){O=n(7039)}return O(Readable,e,t)}}function indexOf(e,t){for(var n=0,i=e.length;n{"use strict";e.exports=Transform;var i=n(7713).q,s=i.ERR_METHOD_NOT_IMPLEMENTED,a=i.ERR_MULTIPLE_CALLBACK,o=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,l=i.ERR_TRANSFORM_WITH_LENGTH_0;var u=n(3928);n(4124)(Transform,u);function afterTransform(e,t){var n=this._transformState;n.transforming=false;var i=n.writecb;if(i===null){return this.emit("error",new a)}n.writechunk=null;n.writecb=null;if(t!=null)this.push(t);i(e);var s=this._readableState;s.reading=false;if(s.needReadable||s.length{"use strict";e.exports=Writable;function WriteReq(e,t,n){this.chunk=e;this.encoding=t;this.callback=n;this.next=null}function CorkedRequest(e){var t=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(t,e)}}var i;Writable.WritableState=WritableState;var s={deprecate:n(5278)};var a=n(6238);var o=n(4300).Buffer;var l=(typeof global!=="undefined"?global:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(e){return o.from(e)}function _isUint8Array(e){return o.isBuffer(e)||e instanceof l}var u=n(6994);var f=n(3533),h=f.getHighWaterMark;var d=n(7713).q,m=d.ERR_INVALID_ARG_TYPE,y=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_MULTIPLE_CALLBACK,v=d.ERR_STREAM_CANNOT_PIPE,_=d.ERR_STREAM_DESTROYED,S=d.ERR_STREAM_NULL_VALUES,x=d.ERR_STREAM_WRITE_AFTER_END,k=d.ERR_UNKNOWN_ENCODING;var E=u.errorOrDestroy;n(4124)(Writable,a);function nop(){}function WritableState(e,t,s){i=i||n(3928);e=e||{};if(typeof s!=="boolean")s=t instanceof i;this.objectMode=!!e.objectMode;if(s)this.objectMode=this.objectMode||!!e.writableObjectMode;this.highWaterMark=h(this,e,"writableHighWaterMark",s);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var a=e.decodeStrings===false;this.decodeStrings=!a;this.defaultEncoding=e.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(e){onwrite(t,e)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.emitClose=e.emitClose!==false;this.autoDestroy=!!e.autoDestroy;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var e=this.bufferedRequest;var t=[];while(e){t.push(e);e=e.next}return t};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:s.deprecate((function writableStateBufferGetter(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(e){}})();var R;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){R=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function value(e){if(R.call(this,e))return true;if(this!==Writable)return false;return e&&e._writableState instanceof WritableState}})}else{R=function realHasInstance(e){return e instanceof this}}function Writable(e){i=i||n(3928);var t=this instanceof i;if(!t&&!R.call(Writable,this))return new Writable(e);this._writableState=new WritableState(e,this,t);this.writable=true;if(e){if(typeof e.write==="function")this._write=e.write;if(typeof e.writev==="function")this._writev=e.writev;if(typeof e.destroy==="function")this._destroy=e.destroy;if(typeof e.final==="function")this._final=e.final}a.call(this)}Writable.prototype.pipe=function(){E(this,new v)};function writeAfterEnd(e,t){var n=new x;E(e,n);process.nextTick(t,n)}function validChunk(e,t,n,i){var s;if(n===null){s=new S}else if(typeof n!=="string"&&!t.objectMode){s=new m("chunk",["string","Buffer"],n)}if(s){E(e,s);process.nextTick(i,s);return false}return true}Writable.prototype.write=function(e,t,n){var i=this._writableState;var s=false;var a=!i.objectMode&&_isUint8Array(e);if(a&&!o.isBuffer(e)){e=_uint8ArrayToBuffer(e)}if(typeof t==="function"){n=t;t=null}if(a)t="buffer";else if(!t)t=i.defaultEncoding;if(typeof n!=="function")n=nop;if(i.ending)writeAfterEnd(this,n);else if(a||validChunk(this,i,e,n)){i.pendingcb++;s=writeOrBuffer(this,i,a,e,t,n)}return s};Writable.prototype.cork=function(){this._writableState.corked++};Writable.prototype.uncork=function(){var e=this._writableState;if(e.corked){e.corked--;if(!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest)clearBuffer(this,e)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(e){if(typeof e==="string")e=e.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new k(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(e,t,n){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=o.from(t,n)}return t}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(e,t,n,i,s,a){if(!n){var o=decodeChunk(t,i,s);if(i!==o){n=true;s="buffer";i=o}}var l=t.objectMode?1:i.length;t.length+=l;var u=t.length{"use strict";var i;function _defineProperty(e,t,n){t=_toPropertyKey(t);if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return typeof t==="symbol"?t:String(t)}function _toPrimitive(e,t){if(typeof e!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==undefined){var i=n.call(e,t||"default");if(typeof i!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var s=n(2659);var a=Symbol("lastResolve");var o=Symbol("lastReject");var l=Symbol("error");var u=Symbol("ended");var f=Symbol("lastPromise");var h=Symbol("handlePromise");var d=Symbol("stream");function createIterResult(e,t){return{value:e,done:t}}function readAndResolve(e){var t=e[a];if(t!==null){var n=e[d].read();if(n!==null){e[f]=null;e[a]=null;e[o]=null;t(createIterResult(n,false))}}}function onReadable(e){process.nextTick(readAndResolve,e)}function wrapForNext(e,t){return function(n,i){e.then((function(){if(t[u]){n(createIterResult(undefined,true));return}t[h](n,i)}),i)}}var m=Object.getPrototypeOf((function(){}));var y=Object.setPrototypeOf((i={get stream(){return this[d]},next:function next(){var e=this;var t=this[l];if(t!==null){return Promise.reject(t)}if(this[u]){return Promise.resolve(createIterResult(undefined,true))}if(this[d].destroyed){return new Promise((function(t,n){process.nextTick((function(){if(e[l]){n(e[l])}else{t(createIterResult(undefined,true))}}))}))}var n=this[f];var i;if(n){i=new Promise(wrapForNext(n,this))}else{var s=this[d].read();if(s!==null){return Promise.resolve(createIterResult(s,false))}i=new Promise(this[h])}this[f]=i;return i}},_defineProperty(i,Symbol.asyncIterator,(function(){return this})),_defineProperty(i,"return",(function _return(){var e=this;return new Promise((function(t,n){e[d].destroy(null,(function(e){if(e){n(e);return}t(createIterResult(undefined,true))}))}))})),i),m);var g=function createReadableStreamAsyncIterator(e){var t;var n=Object.create(y,(t={},_defineProperty(t,d,{value:e,writable:true}),_defineProperty(t,a,{value:null,writable:true}),_defineProperty(t,o,{value:null,writable:true}),_defineProperty(t,l,{value:null,writable:true}),_defineProperty(t,u,{value:e._readableState.endEmitted,writable:true}),_defineProperty(t,h,{value:function value(e,t){var i=n[d].read();if(i){n[f]=null;n[a]=null;n[o]=null;e(createIterResult(i,false))}else{n[a]=e;n[o]=t}},writable:true}),t));n[f]=null;s(e,(function(e){if(e&&e.code!=="ERR_STREAM_PREMATURE_CLOSE"){var t=n[o];if(t!==null){n[f]=null;n[a]=null;n[o]=null;t(e)}n[l]=e;return}var i=n[a];if(i!==null){n[f]=null;n[a]=null;n[o]=null;i(createIterResult(undefined,true))}n[u]=true}));e.on("readable",onReadable.bind(null,n));return n};e.exports=g},662:(e,t,n)=>{"use strict";function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _objectSpread(e){for(var t=1;t0)this.tail.next=t;else this.head=t;this.tail=t;++this.length}},{key:"unshift",value:function unshift(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(e){if(this.length===0)return"";var t=this.head;var n=""+t.data;while(t=t.next)n+=e+t.data;return n}},{key:"concat",value:function concat(e){if(this.length===0)return s.alloc(0);var t=s.allocUnsafe(e>>>0);var n=this.head;var i=0;while(n){copyBuffer(n.data,t,i);i+=n.data.length;n=n.next}return t}},{key:"consume",value:function consume(e,t){var n;if(es.length?s.length:e;if(a===s.length)i+=s;else i+=s.slice(0,e);e-=a;if(e===0){if(a===s.length){++n;if(t.next)this.head=t.next;else this.head=this.tail=null}else{this.head=t;t.data=s.slice(a)}break}++n}this.length-=n;return i}},{key:"_getBuffer",value:function _getBuffer(e){var t=s.allocUnsafe(e);var n=this.head;var i=1;n.data.copy(t);e-=n.data.length;while(n=n.next){var a=n.data;var o=e>a.length?a.length:e;a.copy(t,t.length-e,0,o);e-=o;if(e===0){if(o===a.length){++i;if(n.next)this.head=n.next;else this.head=this.tail=null}else{this.head=n;n.data=a.slice(o)}break}++i}this.length-=i;return t}},{key:l,value:function value(e,t){return o(this,_objectSpread(_objectSpread({},t),{},{depth:0,customInspect:false}))}}]);return BufferList}()},6994:e=>{"use strict";function destroy(e,t){var n=this;var i=this._readableState&&this._readableState.destroyed;var s=this._writableState&&this._writableState.destroyed;if(i||s){if(t){t(e)}else if(e){if(!this._writableState){process.nextTick(emitErrorNT,this,e)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,e)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,(function(e){if(!t&&e){if(!n._writableState){process.nextTick(emitErrorAndCloseNT,n,e)}else if(!n._writableState.errorEmitted){n._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,n,e)}else{process.nextTick(emitCloseNT,n)}}else if(t){process.nextTick(emitCloseNT,n);t(e)}else{process.nextTick(emitCloseNT,n)}}));return this}function emitErrorAndCloseNT(e,t){emitErrorNT(e,t);emitCloseNT(e)}function emitCloseNT(e){if(e._writableState&&!e._writableState.emitClose)return;if(e._readableState&&!e._readableState.emitClose)return;e.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(e,t){e.emit("error",t)}function errorOrDestroy(e,t){var n=e._readableState;var i=e._writableState;if(n&&n.autoDestroy||i&&i.autoDestroy)e.destroy(t);else e.emit("error",t)}e.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},2659:(e,t,n)=>{"use strict";var i=n(7713).q.ERR_STREAM_PREMATURE_CLOSE;function once(e){var t=false;return function(){if(t)return;t=true;for(var n=arguments.length,i=new Array(n),s=0;s{"use strict";function asyncGeneratorStep(e,t,n,i,s,a,o){try{var l=e[a](o);var u=l.value}catch(e){n(e);return}if(l.done){t(u)}else{Promise.resolve(u).then(i,s)}}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise((function(i,s){var a=e.apply(t,n);function _next(e){asyncGeneratorStep(a,i,s,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(a,i,s,_next,_throw,"throw",e)}_next(undefined)}))}}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _objectSpread(e){for(var t=1;t{"use strict";var i;function once(e){var t=false;return function(){if(t)return;t=true;e.apply(void 0,arguments)}}var s=n(7713).q,a=s.ERR_MISSING_ARGS,o=s.ERR_STREAM_DESTROYED;function noop(e){if(e)throw e}function isRequest(e){return e.setHeader&&typeof e.abort==="function"}function destroyer(e,t,s,a){a=once(a);var l=false;e.on("close",(function(){l=true}));if(i===undefined)i=n(2659);i(e,{readable:t,writable:s},(function(e){if(e)return a(e);l=true;a()}));var u=false;return function(t){if(l)return;if(u)return;u=true;if(isRequest(e))return e.abort();if(typeof e.destroy==="function")return e.destroy();a(t||new o("pipe"))}}function call(e){e()}function pipe(e,t){return e.pipe(t)}function popCallback(e){if(!e.length)return noop;if(typeof e[e.length-1]!=="function")return noop;return e.pop()}function pipeline(){for(var e=arguments.length,t=new Array(e),n=0;n0;return destroyer(e,a,l,(function(e){if(!s)s=e;if(e)o.forEach(call);if(a)return;o.forEach(call);i(s)}))}));return t.reduce(pipe)}e.exports=pipeline},3533:(e,t,n)=>{"use strict";var i=n(7713).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(e,t,n){return e.highWaterMark!=null?e.highWaterMark:t?e[n]:null}function getHighWaterMark(e,t,n,s){var a=highWaterMarkFrom(t,s,n);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var o=s?n:"highWaterMark";throw new i(o,a)}return Math.floor(a)}return e.objectMode?16:16*1024}e.exports={getHighWaterMark:getHighWaterMark}},6238:(e,t,n)=>{e.exports=n(2781)},5519:(e,t,n)=>{var i=n(2781);if(process.env.READABLE_STREAM==="disable"&&i){e.exports=i.Readable;Object.assign(e.exports,i);e.exports.Stream=i}else{t=e.exports=n(5209);t.Stream=i||t;t.Readable=t;t.Writable=n(8729);t.Duplex=n(3928);t.Transform=n(6753);t.PassThrough=n(4991);t.finished=n(2659);t.pipeline=n(740)}},1186:(e,t,n)=>{ -/*! safe-buffer. MIT License. Feross Aboukhadijeh */ -var i=n(4300);var s=i.Buffer;function copyProps(e,t){for(var n in e){t[n]=e[n]}}if(s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow){e.exports=i}else{copyProps(i,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,n){return s(e,t,n)}SafeBuffer.prototype=Object.create(s.prototype);copyProps(s,SafeBuffer);SafeBuffer.from=function(e,t,n){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return s(e,t,n)};SafeBuffer.alloc=function(e,t,n){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var i=s(e);if(t!==undefined){if(typeof n==="string"){i.fill(t,n)}else{i.fill(t)}}else{i.fill(0)}return i};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return s(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i.SlowBuffer(e)}},299:(e,t,n)=>{"use strict";var i=n(1186).Buffer;var s=i.isEncoding||function(e){e=""+e;switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(e){if(!e)return"utf8";var t;while(true){switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase();t=true}}}function normalizeEncoding(e){var t=_normalizeEncoding(e);if(typeof t!=="string"&&(i.isEncoding===s||!s(e)))throw new Error("Unknown encoding: "+e);return t||e}t.s=StringDecoder;function StringDecoder(e){this.encoding=normalizeEncoding(e);var t;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;t=4;break;case"utf8":this.fillLast=utf8FillLast;t=4;break;case"base64":this.text=base64Text;this.end=base64End;t=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=i.allocUnsafe(t)}StringDecoder.prototype.write=function(e){if(e.length===0)return"";var t;var n;if(this.lastNeed){t=this.fillLast(e);if(t===undefined)return"";n=this.lastNeed;this.lastNeed=0}else{n=0}if(n>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function utf8CheckIncomplete(e,t,n){var i=t.length-1;if(i=0){if(s>0)e.lastNeed=s-1;return s}if(--i=0){if(s>0)e.lastNeed=s-2;return s}if(--i=0){if(s>0){if(s===2)s=0;else e.lastNeed=s-3}return s}return 0}function utf8CheckExtraBytes(e,t,n){if((t[0]&192)!==128){e.lastNeed=0;return"�"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"�"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"�"}}}}function utf8FillLast(e){var t=this.lastTotal-this.lastNeed;var n=utf8CheckExtraBytes(this,e,t);if(n!==undefined)return n;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}function utf8Text(e,t){var n=utf8CheckIncomplete(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var i=e.length-(n-this.lastNeed);e.copy(this.lastChar,0,i);return e.toString("utf8",t,i)}function utf8End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"�";return t}function utf16Text(e,t){if((e.length-t)%2===0){var n=e.toString("utf16le",t);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return n.slice(0,-1)}}return n}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}function utf16End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function base64Text(e,t){var n=(e.length-t)%3;if(n===0)return e.toString("base64",t);this.lastNeed=3-n;this.lastTotal=3;if(n===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-n)}function base64End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):""}},8818:(e,t,n)=>{"use strict";const i=n(2068);const{stdout:s,stderr:a}=n(9318);const{stringReplaceAll:o,stringEncaseCRLFWithFirstIndex:l}=n(2415);const{isArray:u}=Array;const f=["ansi","ansi","ansi256","ansi16m"];const h=Object.create(null);const applyOptions=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const n=s?s.level:0;e.level=t.level===undefined?n:t.level};class ChalkClass{constructor(e){return chalkFactory(e)}}const chalkFactory=e=>{const t={};applyOptions(t,e);t.template=(...e)=>chalkTag(t.template,...e);Object.setPrototypeOf(t,Chalk.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")};t.template.Instance=ChalkClass;return t.template};function Chalk(e){return chalkFactory(e)}for(const[e,t]of Object.entries(i)){h[e]={get(){const n=createBuilder(this,createStyler(t.open,t.close,this._styler),this._isEmpty);Object.defineProperty(this,e,{value:n});return n}}}h.visible={get(){const e=createBuilder(this,this._styler,true);Object.defineProperty(this,"visible",{value:e});return e}};const d=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of d){h[e]={get(){const{level:t}=this;return function(...n){const s=createStyler(i.color[f[t]][e](...n),i.color.close,this._styler);return createBuilder(this,s,this._isEmpty)}}}}for(const e of d){const t="bg"+e[0].toUpperCase()+e.slice(1);h[t]={get(){const{level:t}=this;return function(...n){const s=createStyler(i.bgColor[f[t]][e](...n),i.bgColor.close,this._styler);return createBuilder(this,s,this._isEmpty)}}}}const m=Object.defineProperties((()=>{}),{...h,level:{enumerable:true,get(){return this._generator.level},set(e){this._generator.level=e}}});const createStyler=(e,t,n)=>{let i;let s;if(n===undefined){i=e;s=t}else{i=n.openAll+e;s=t+n.closeAll}return{open:e,close:t,openAll:i,closeAll:s,parent:n}};const createBuilder=(e,t,n)=>{const builder=(...e)=>{if(u(e[0])&&u(e[0].raw)){return applyStyle(builder,chalkTag(builder,...e))}return applyStyle(builder,e.length===1?""+e[0]:e.join(" "))};Object.setPrototypeOf(builder,m);builder._generator=e;builder._styler=t;builder._isEmpty=n;return builder};const applyStyle=(e,t)=>{if(e.level<=0||!t){return e._isEmpty?"":t}let n=e._styler;if(n===undefined){return t}const{openAll:i,closeAll:s}=n;if(t.indexOf("")!==-1){while(n!==undefined){t=o(t,n.close,n.open);n=n.parent}}const a=t.indexOf("\n");if(a!==-1){t=l(t,s,i,a)}return i+t+s};let y;const chalkTag=(e,...t)=>{const[i]=t;if(!u(i)||!u(i.raw)){return t.join(" ")}const s=t.slice(1);const a=[i.raw[0]];for(let e=1;e{"use strict";const t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const n=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const i=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const s=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;const a=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function unescape(e){const t=e[0]==="u";const n=e[1]==="{";if(t&&!n&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}if(t&&n){return String.fromCodePoint(parseInt(e.slice(2,-1),16))}return a.get(e)||e}function parseArguments(e,t){const n=[];const a=t.trim().split(/\s*,\s*/g);let o;for(const t of a){const a=Number(t);if(!Number.isNaN(a)){n.push(a)}else if(o=t.match(i)){n.push(o[2].replace(s,((e,t,n)=>t?unescape(t):n)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return n}function parseStyle(e){n.lastIndex=0;const t=[];let i;while((i=n.exec(e))!==null){const e=i[1];if(i[2]){const n=parseArguments(e,i[2]);t.push([e].concat(n))}else{t.push([e])}}return t}function buildStyle(e,t){const n={};for(const e of t){for(const t of e.styles){n[t[0]]=e.inverse?null:t.slice(1)}}let i=e;for(const[e,t]of Object.entries(n)){if(!Array.isArray(t)){continue}if(!(e in i)){throw new Error(`Unknown Chalk style: ${e}`)}i=t.length>0?i[e](...t):i[e]}return i}e.exports=(e,n)=>{const i=[];const s=[];let a=[];n.replace(t,((t,n,o,l,u,f)=>{if(n){a.push(unescape(n))}else if(l){const t=a.join("");a=[];s.push(i.length===0?t:buildStyle(e,i)(t));i.push({inverse:o,styles:parseStyle(l)})}else if(u){if(i.length===0){throw new Error("Found extraneous } in Chalk template literal")}s.push(buildStyle(e,i)(a.join("")));a=[];i.pop()}else{a.push(f)}}));s.push(a.join(""));if(i.length>0){const e=`Chalk template literal is missing ${i.length} closing bracket${i.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return s.join("")}},2415:e=>{"use strict";const stringReplaceAll=(e,t,n)=>{let i=e.indexOf(t);if(i===-1){return e}const s=t.length;let a=0;let o="";do{o+=e.substr(a,i-a)+t+n;a=i+s;i=e.indexOf(t,a)}while(i!==-1);o+=e.substr(a);return o};const stringEncaseCRLFWithFirstIndex=(e,t,n,i)=>{let s=0;let a="";do{const o=e[i-1]==="\r";a+=e.substr(s,(o?i-1:i)-s)+t+(o?"\r\n":"\n")+n;s=i+1;i=e.indexOf("\n",s)}while(i!==-1);a+=e.substr(s);return a};e.exports={stringReplaceAll:stringReplaceAll,stringEncaseCRLFWithFirstIndex:stringEncaseCRLFWithFirstIndex}},9482:(e,t,n)=>{"use strict";const i=n(5847);let s=false;t.show=(e=process.stderr)=>{if(!e.isTTY){return}s=false;e.write("[?25h")};t.hide=(e=process.stderr)=>{if(!e.isTTY){return}i();s=true;e.write("[?25l")};t.toggle=(e,n)=>{if(e!==undefined){s=e}if(s){t.show(n)}else{t.hide(n)}}},2031:(e,t,n)=>{"use strict";const i=Object.assign({},n(6374));const s=Object.keys(i);Object.defineProperty(i,"random",{get(){const e=Math.floor(Math.random()*s.length);const t=s[e];return i[t]}});e.exports=i},8606:e=>{var t=function(){"use strict";function clone(e,t,n,i){var s;if(typeof t==="object"){n=t.depth;i=t.prototype;s=t.filter;t=t.circular}var a=[];var o=[];var l=typeof Buffer!="undefined";if(typeof t=="undefined")t=true;if(typeof n=="undefined")n=Infinity;function _clone(e,n){if(e===null)return null;if(n==0)return e;var s;var u;if(typeof e!="object"){return e}if(clone.__isArray(e)){s=[]}else if(clone.__isRegExp(e)){s=new RegExp(e.source,__getRegExpFlags(e));if(e.lastIndex)s.lastIndex=e.lastIndex}else if(clone.__isDate(e)){s=new Date(e.getTime())}else if(l&&Buffer.isBuffer(e)){if(Buffer.allocUnsafe){s=Buffer.allocUnsafe(e.length)}else{s=new Buffer(e.length)}e.copy(s);return s}else{if(typeof i=="undefined"){u=Object.getPrototypeOf(e);s=Object.create(u)}else{s=Object.create(i);u=i}}if(t){var f=a.indexOf(e);if(f!=-1){return o[f]}a.push(e);o.push(s)}for(var h in e){var d;if(u){d=Object.getOwnPropertyDescriptor(u,h)}if(d&&d.set==null){continue}s[h]=_clone(e[h],n-1)}return s}return _clone(e,n)}clone.clonePrototype=function clonePrototype(e){if(e===null)return null;var c=function(){};c.prototype=e;return new c};function __objToStr(e){return Object.prototype.toString.call(e)}clone.__objToStr=__objToStr;function __isDate(e){return typeof e==="object"&&__objToStr(e)==="[object Date]"}clone.__isDate=__isDate;function __isArray(e){return typeof e==="object"&&__objToStr(e)==="[object Array]"}clone.__isArray=__isArray;function __isRegExp(e){return typeof e==="object"&&__objToStr(e)==="[object RegExp]"}clone.__isRegExp=__isRegExp;function __getRegExpFlags(e){var t="";if(e.global)t+="g";if(e.ignoreCase)t+="i";if(e.multiline)t+="m";return t}clone.__getRegExpFlags=__getRegExpFlags;return clone}();if(true&&e.exports){e.exports=t}},7391:(e,t,n)=>{const i=n(8510);const s={};for(const e of Object.keys(i)){s[i[e]]=e}const a={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"]}};e.exports=a;for(const e of Object.keys(a)){if(!("channels"in a[e])){throw new Error("missing channels property: "+e)}if(!("labels"in a[e])){throw new Error("missing channel labels property: "+e)}if(a[e].labels.length!==a[e].channels){throw new Error("channel and label counts mismatch: "+e)}const{channels:t,labels:n}=a[e];delete a[e].channels;delete a[e].labels;Object.defineProperty(a[e],"channels",{value:t});Object.defineProperty(a[e],"labels",{value:n})}a.rgb.hsl=function(e){const t=e[0]/255;const n=e[1]/255;const i=e[2]/255;const s=Math.min(t,n,i);const a=Math.max(t,n,i);const o=a-s;let l;let u;if(a===s){l=0}else if(t===a){l=(n-i)/o}else if(n===a){l=2+(i-t)/o}else if(i===a){l=4+(t-n)/o}l=Math.min(l*60,360);if(l<0){l+=360}const f=(s+a)/2;if(a===s){u=0}else if(f<=.5){u=o/(a+s)}else{u=o/(2-a-s)}return[l,u*100,f*100]};a.rgb.hsv=function(e){let t;let n;let i;let s;let a;const o=e[0]/255;const l=e[1]/255;const u=e[2]/255;const f=Math.max(o,l,u);const h=f-Math.min(o,l,u);const diffc=function(e){return(f-e)/6/h+1/2};if(h===0){s=0;a=0}else{a=h/f;t=diffc(o);n=diffc(l);i=diffc(u);if(o===f){s=i-n}else if(l===f){s=1/3+t-i}else if(u===f){s=2/3+n-t}if(s<0){s+=1}else if(s>1){s-=1}}return[s*360,a*100,f*100]};a.rgb.hwb=function(e){const t=e[0];const n=e[1];let i=e[2];const s=a.rgb.hsl(e)[0];const o=1/255*Math.min(t,Math.min(n,i));i=1-1/255*Math.max(t,Math.max(n,i));return[s,o*100,i*100]};a.rgb.cmyk=function(e){const t=e[0]/255;const n=e[1]/255;const i=e[2]/255;const s=Math.min(1-t,1-n,1-i);const a=(1-t-s)/(1-s)||0;const o=(1-n-s)/(1-s)||0;const l=(1-i-s)/(1-s)||0;return[a*100,o*100,l*100,s*100]};function comparativeDistance(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}a.rgb.keyword=function(e){const t=s[e];if(t){return t}let n=Infinity;let a;for(const t of Object.keys(i)){const s=i[t];const o=comparativeDistance(e,s);if(o.04045?((t+.055)/1.055)**2.4:t/12.92;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;i=i>.04045?((i+.055)/1.055)**2.4:i/12.92;const s=t*.4124+n*.3576+i*.1805;const a=t*.2126+n*.7152+i*.0722;const o=t*.0193+n*.1192+i*.9505;return[s*100,a*100,o*100]};a.rgb.lab=function(e){const t=a.rgb.xyz(e);let n=t[0];let i=t[1];let s=t[2];n/=95.047;i/=100;s/=108.883;n=n>.008856?n**(1/3):7.787*n+16/116;i=i>.008856?i**(1/3):7.787*i+16/116;s=s>.008856?s**(1/3):7.787*s+16/116;const o=116*i-16;const l=500*(n-i);const u=200*(i-s);return[o,l,u]};a.hsl.rgb=function(e){const t=e[0]/360;const n=e[1]/100;const i=e[2]/100;let s;let a;let o;if(n===0){o=i*255;return[o,o,o]}if(i<.5){s=i*(1+n)}else{s=i+n-i*n}const l=2*i-s;const u=[0,0,0];for(let e=0;e<3;e++){a=t+1/3*-(e-1);if(a<0){a++}if(a>1){a--}if(6*a<1){o=l+(s-l)*6*a}else if(2*a<1){o=s}else if(3*a<2){o=l+(s-l)*(2/3-a)*6}else{o=l}u[e]=o*255}return u};a.hsl.hsv=function(e){const t=e[0];let n=e[1]/100;let i=e[2]/100;let s=n;const a=Math.max(i,.01);i*=2;n*=i<=1?i:2-i;s*=a<=1?a:2-a;const o=(i+n)/2;const l=i===0?2*s/(a+s):2*n/(i+n);return[t,l*100,o*100]};a.hsv.rgb=function(e){const t=e[0]/60;const n=e[1]/100;let i=e[2]/100;const s=Math.floor(t)%6;const a=t-Math.floor(t);const o=255*i*(1-n);const l=255*i*(1-n*a);const u=255*i*(1-n*(1-a));i*=255;switch(s){case 0:return[i,u,o];case 1:return[l,i,o];case 2:return[o,i,u];case 3:return[o,l,i];case 4:return[u,o,i];case 5:return[i,o,l]}};a.hsv.hsl=function(e){const t=e[0];const n=e[1]/100;const i=e[2]/100;const s=Math.max(i,.01);let a;let o;o=(2-n)*i;const l=(2-n)*s;a=n*s;a/=l<=1?l:2-l;a=a||0;o/=2;return[t,a*100,o*100]};a.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100;let i=e[2]/100;const s=n+i;let a;if(s>1){n/=s;i/=s}const o=Math.floor(6*t);const l=1-i;a=6*t-o;if((o&1)!==0){a=1-a}const u=n+a*(l-n);let f;let h;let d;switch(o){default:case 6:case 0:f=l;h=u;d=n;break;case 1:f=u;h=l;d=n;break;case 2:f=n;h=l;d=u;break;case 3:f=n;h=u;d=l;break;case 4:f=u;h=n;d=l;break;case 5:f=l;h=n;d=u;break}return[f*255,h*255,d*255]};a.cmyk.rgb=function(e){const t=e[0]/100;const n=e[1]/100;const i=e[2]/100;const s=e[3]/100;const a=1-Math.min(1,t*(1-s)+s);const o=1-Math.min(1,n*(1-s)+s);const l=1-Math.min(1,i*(1-s)+s);return[a*255,o*255,l*255]};a.xyz.rgb=function(e){const t=e[0]/100;const n=e[1]/100;const i=e[2]/100;let s;let a;let o;s=t*3.2406+n*-1.5372+i*-.4986;a=t*-.9689+n*1.8758+i*.0415;o=t*.0557+n*-.204+i*1.057;s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92;a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92;o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92;s=Math.min(Math.max(0,s),1);a=Math.min(Math.max(0,a),1);o=Math.min(Math.max(0,o),1);return[s*255,a*255,o*255]};a.xyz.lab=function(e){let t=e[0];let n=e[1];let i=e[2];t/=95.047;n/=100;i/=108.883;t=t>.008856?t**(1/3):7.787*t+16/116;n=n>.008856?n**(1/3):7.787*n+16/116;i=i>.008856?i**(1/3):7.787*i+16/116;const s=116*n-16;const a=500*(t-n);const o=200*(n-i);return[s,a,o]};a.lab.xyz=function(e){const t=e[0];const n=e[1];const i=e[2];let s;let a;let o;a=(t+16)/116;s=n/500+a;o=a-i/200;const l=a**3;const u=s**3;const f=o**3;a=l>.008856?l:(a-16/116)/7.787;s=u>.008856?u:(s-16/116)/7.787;o=f>.008856?f:(o-16/116)/7.787;s*=95.047;a*=100;o*=108.883;return[s,a,o]};a.lab.lch=function(e){const t=e[0];const n=e[1];const i=e[2];let s;const a=Math.atan2(i,n);s=a*360/2/Math.PI;if(s<0){s+=360}const o=Math.sqrt(n*n+i*i);return[t,o,s]};a.lch.lab=function(e){const t=e[0];const n=e[1];const i=e[2];const s=i/360*2*Math.PI;const a=n*Math.cos(s);const o=n*Math.sin(s);return[t,a,o]};a.rgb.ansi16=function(e,t=null){const[n,i,s]=e;let o=t===null?a.rgb.hsv(e)[2]:t;o=Math.round(o/50);if(o===0){return 30}let l=30+(Math.round(s/255)<<2|Math.round(i/255)<<1|Math.round(n/255));if(o===2){l+=60}return l};a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])};a.rgb.ansi256=function(e){const t=e[0];const n=e[1];const i=e[2];if(t===n&&n===i){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}const s=16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5);return s};a.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}const n=(~~(e>50)+1)*.5;const i=(t&1)*n*255;const s=(t>>1&1)*n*255;const a=(t>>2&1)*n*255;return[i,s,a]};a.ansi256.rgb=function(e){if(e>=232){const t=(e-232)*10+8;return[t,t,t]}e-=16;let t;const n=Math.floor(e/36)/5*255;const i=Math.floor((t=e%36)/6)/5*255;const s=t%6/5*255;return[n,i,s]};a.rgb.hex=function(e){const t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);const n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};a.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}let n=t[0];if(t[0].length===3){n=n.split("").map((e=>e+e)).join("")}const i=parseInt(n,16);const s=i>>16&255;const a=i>>8&255;const o=i&255;return[s,a,o]};a.rgb.hcg=function(e){const t=e[0]/255;const n=e[1]/255;const i=e[2]/255;const s=Math.max(Math.max(t,n),i);const a=Math.min(Math.min(t,n),i);const o=s-a;let l;let u;if(o<1){l=a/(1-o)}else{l=0}if(o<=0){u=0}else if(s===t){u=(n-i)/o%6}else if(s===n){u=2+(i-t)/o}else{u=4+(t-n)/o}u/=6;u%=1;return[u*360,o*100,l*100]};a.hsl.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const i=n<.5?2*t*n:2*t*(1-n);let s=0;if(i<1){s=(n-.5*i)/(1-i)}return[e[0],i*100,s*100]};a.hsv.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const i=t*n;let s=0;if(i<1){s=(n-i)/(1-i)}return[e[0],i*100,s*100]};a.hcg.rgb=function(e){const t=e[0]/360;const n=e[1]/100;const i=e[2]/100;if(n===0){return[i*255,i*255,i*255]}const s=[0,0,0];const a=t%1*6;const o=a%1;const l=1-o;let u=0;switch(Math.floor(a)){case 0:s[0]=1;s[1]=o;s[2]=0;break;case 1:s[0]=l;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]=l;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]=l}u=(1-n)*i;return[(n*s[0]+u)*255,(n*s[1]+u)*255,(n*s[2]+u)*255]};a.hcg.hsv=function(e){const t=e[1]/100;const n=e[2]/100;const i=t+n*(1-t);let s=0;if(i>0){s=t/i}return[e[0],s*100,i*100]};a.hcg.hsl=function(e){const t=e[1]/100;const n=e[2]/100;const i=n*(1-t)+.5*t;let s=0;if(i>0&&i<.5){s=t/(2*i)}else if(i>=.5&&i<1){s=t/(2*(1-i))}return[e[0],s*100,i*100]};a.hcg.hwb=function(e){const t=e[1]/100;const n=e[2]/100;const i=t+n*(1-t);return[e[0],(i-t)*100,(1-i)*100]};a.hwb.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const i=1-n;const s=i-t;let a=0;if(s<1){a=(i-s)/(1-s)}return[e[0],s*100,a*100]};a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};a.gray.hsl=function(e){return[0,0,e[0]]};a.gray.hsv=a.gray.hsl;a.gray.hwb=function(e){return[0,100,e[0]]};a.gray.cmyk=function(e){return[0,0,0,e[0]]};a.gray.lab=function(e){return[e[0],0,0]};a.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255;const n=(t<<16)+(t<<8)+t;const i=n.toString(16).toUpperCase();return"000000".substring(i.length)+i};a.rgb.gray=function(e){const t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},6931:(e,t,n)=>{const i=n(7391);const s=n(880);const a={};const o=Object.keys(i);function wrapRaw(e){const wrappedFn=function(...t){const n=t[0];if(n===undefined||n===null){return n}if(n.length>1){t=n}return e(t)};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}function wrapRounded(e){const wrappedFn=function(...t){const n=t[0];if(n===undefined||n===null){return n}if(n.length>1){t=n}const i=e(t);if(typeof i==="object"){for(let e=i.length,t=0;t{a[e]={};Object.defineProperty(a[e],"channels",{value:i[e].channels});Object.defineProperty(a[e],"labels",{value:i[e].labels});const t=s(e);const n=Object.keys(t);n.forEach((n=>{const i=t[n];a[e][n]=wrapRounded(i);a[e][n].raw=wrapRaw(i)}))}));e.exports=a},880:(e,t,n)=>{const i=n(7391);function buildGraph(){const e={};const t=Object.keys(i);for(let n=t.length,i=0;i{"use strict";e.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]}},732:(e,t,n)=>{var i=n(8606);e.exports=function(e,t){e=e||{};Object.keys(t).forEach((function(n){if(typeof e[n]==="undefined"){e[n]=i(t[n])}}));return e}},8431:(e,t,n)=>{"use strict"; -/** - * @file Embedded JavaScript templating engine. {@link http://ejs.co} - * @author Matthew Eernisse - * @author Tiancheng "Timothy" Gu - * @project EJS - * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0} - */var i=n(7147);var s=n(1017);var a=n(356);var o=false;var l=n(3558).i8;var u="<";var f=">";var h="%";var d="locals";var m="ejs";var y="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)";var g=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"];var v=g.concat("cache");var _=/^\uFEFF/;var S=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/;t.cache=a.cache;t.fileLoader=i.readFileSync;t.localsName=d;t.promiseImpl=new Function("return this;")().Promise;t.resolveInclude=function(e,t,n){var i=s.dirname;var a=s.extname;var o=s.resolve;var l=o(n?t:i(t),e);var u=a(e);if(!u){l+=".ejs"}return l};function resolvePaths(e,n){var s;if(n.some((function(n){s=t.resolveInclude(e,n,true);return i.existsSync(s)}))){return s}}function getIncludePath(e,n){var s;var a;var o=n.views;var l=/^[A-Za-z]+:\\|^\//.exec(e);if(l&&l.length){e=e.replace(/^\/*/,"");if(Array.isArray(n.root)){s=resolvePaths(e,n.root)}else{s=t.resolveInclude(e,n.root||"/",true)}}else{if(n.filename){a=t.resolveInclude(e,n.filename);if(i.existsSync(a)){s=a}}if(!s&&Array.isArray(o)){s=resolvePaths(e,o)}if(!s&&typeof n.includer!=="function"){throw new Error('Could not find the include file "'+n.escapeFunction(e)+'"')}}return s}function handleCache(e,n){var i;var s=e.filename;var a=arguments.length>1;if(e.cache){if(!s){throw new Error("cache option requires a filename")}i=t.cache.get(s);if(i){return i}if(!a){n=fileLoader(s).toString().replace(_,"")}}else if(!a){if(!s){throw new Error("Internal EJS error: no file name or template "+"provided")}n=fileLoader(s).toString().replace(_,"")}i=t.compile(n,e);if(e.cache){t.cache.set(s,i)}return i}function tryHandleCache(e,n,i){var s;if(!i){if(typeof t.promiseImpl=="function"){return new t.promiseImpl((function(t,i){try{s=handleCache(e)(n);t(s)}catch(e){i(e)}}))}else{throw new Error("Please provide a callback function")}}else{try{s=handleCache(e)(n)}catch(e){return i(e)}i(null,s)}}function fileLoader(e){return t.fileLoader(e)}function includeFile(e,t){var n=a.shallowCopy(a.createNullProtoObjWherePossible(),t);n.filename=getIncludePath(e,n);if(typeof t.includer==="function"){var i=t.includer(e,n.filename);if(i){if(i.filename){n.filename=i.filename}if(i.template){return handleCache(n,i.template)}}}return handleCache(n)}function rethrow(e,t,n,i,s){var a=t.split("\n");var o=Math.max(i-3,0);var l=Math.min(a.length,i+3);var u=s(n);var f=a.slice(o,l).map((function(e,t){var n=t+o+1;return(n==i?" >> ":" ")+n+"| "+e})).join("\n");e.path=u;e.message=(u||"ejs")+":"+i+"\n"+f+"\n\n"+e.message;throw e}function stripSemi(e){return e.replace(/;(\s*$)/,"$1")}t.compile=function compile(e,t){var n;if(t&&t.scope){if(!o){console.warn("`scope` option is deprecated and will be removed in EJS 3");o=true}if(!t.context){t.context=t.scope}delete t.scope}n=new Template(e,t);return n.compile()};t.render=function(e,t,n){var i=t||a.createNullProtoObjWherePossible();var s=n||a.createNullProtoObjWherePossible();if(arguments.length==2){a.shallowCopyFromList(s,i,g)}return handleCache(s,e)(i)};t.renderFile=function(){var e=Array.prototype.slice.call(arguments);var t=e.shift();var n;var i={filename:t};var s;var o;if(typeof arguments[arguments.length-1]=="function"){n=e.pop()}if(e.length){s=e.shift();if(e.length){a.shallowCopy(i,e.pop())}else{if(s.settings){if(s.settings.views){i.views=s.settings.views}if(s.settings["view cache"]){i.cache=true}o=s.settings["view options"];if(o){a.shallowCopy(i,o)}}a.shallowCopyFromList(i,s,v)}i.filename=t}else{s=a.createNullProtoObjWherePossible()}return tryHandleCache(i,s,n)};t.Template=Template;t.clearCache=function(){t.cache.reset()};function Template(e,n){n=n||a.createNullProtoObjWherePossible();var i=a.createNullProtoObjWherePossible();this.templateText=e;this.mode=null;this.truncate=false;this.currentLine=1;this.source="";i.client=n.client||false;i.escapeFunction=n.escape||n.escapeFunction||a.escapeXML;i.compileDebug=n.compileDebug!==false;i.debug=!!n.debug;i.filename=n.filename;i.openDelimiter=n.openDelimiter||t.openDelimiter||u;i.closeDelimiter=n.closeDelimiter||t.closeDelimiter||f;i.delimiter=n.delimiter||t.delimiter||h;i.strict=n.strict||false;i.context=n.context;i.cache=n.cache||false;i.rmWhitespace=n.rmWhitespace;i.root=n.root;i.includer=n.includer;i.outputFunctionName=n.outputFunctionName;i.localsName=n.localsName||t.localsName||d;i.views=n.views;i.async=n.async;i.destructuredLocals=n.destructuredLocals;i.legacyInclude=typeof n.legacyInclude!="undefined"?!!n.legacyInclude:true;if(i.strict){i._with=false}else{i._with=typeof n._with!="undefined"?n._with:true}this.opts=i;this.regex=this.createRegex()}Template.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};Template.prototype={createRegex:function(){var e=y;var t=a.escapeRegExpChars(this.opts.delimiter);var n=a.escapeRegExpChars(this.opts.openDelimiter);var i=a.escapeRegExpChars(this.opts.closeDelimiter);e=e.replace(/%/g,t).replace(//g,i);return new RegExp(e)},compile:function(){var e;var t;var n=this.opts;var i="";var o="";var l=n.escapeFunction;var u;var f=n.filename?JSON.stringify(n.filename):"undefined";if(!this.source){this.generateSource();i+=' var __output = "";\n'+" function __append(s) { if (s !== undefined && s !== null) __output += s }\n";if(n.outputFunctionName){if(!S.test(n.outputFunctionName)){throw new Error("outputFunctionName is not a valid JS identifier.")}i+=" var "+n.outputFunctionName+" = __append;"+"\n"}if(n.localsName&&!S.test(n.localsName)){throw new Error("localsName is not a valid JS identifier.")}if(n.destructuredLocals&&n.destructuredLocals.length){var h=" var __locals = ("+n.localsName+" || {}),\n";for(var d=0;d0){h+=",\n "}h+=m+" = __locals."+m}i+=h+";\n"}if(n._with!==false){i+=" with ("+n.localsName+" || {}) {"+"\n";o+=" }"+"\n"}o+=" return __output;"+"\n";this.source=i+this.source+o}if(n.compileDebug){e="var __line = 1"+"\n"+" , __lines = "+JSON.stringify(this.templateText)+"\n"+" , __filename = "+f+";"+"\n"+"try {"+"\n"+this.source+"} catch (e) {"+"\n"+" rethrow(e, __lines, __filename, __line, escapeFn);"+"\n"+"}"+"\n"}else{e=this.source}if(n.client){e="escapeFn = escapeFn || "+l.toString()+";"+"\n"+e;if(n.compileDebug){e="rethrow = rethrow || "+rethrow.toString()+";"+"\n"+e}}if(n.strict){e='"use strict";\n'+e}if(n.debug){console.log(e)}if(n.compileDebug&&n.filename){e=e+"\n"+"//# sourceURL="+f+"\n"}try{if(n.async){try{u=new Function("return (async function(){}).constructor;")()}catch(e){if(e instanceof SyntaxError){throw new Error("This environment does not support async/await")}else{throw e}}}else{u=Function}t=new u(n.localsName+", escapeFn, include, rethrow",e)}catch(e){if(e instanceof SyntaxError){if(n.filename){e.message+=" in "+n.filename}e.message+=" while compiling ejs\n\n";e.message+="If the above error is not helpful, you may want to try EJS-Lint:\n";e.message+="https://github.com/RyanZim/EJS-Lint";if(!n.async){e.message+="\n";e.message+="Or, if you meant to create an async function, pass `async: true` as an option."}}throw e}var y=n.client?t:function anonymous(e){var include=function(t,i){var s=a.shallowCopy(a.createNullProtoObjWherePossible(),e);if(i){s=a.shallowCopy(s,i)}return includeFile(t,n)(s)};return t.apply(n.context,[e||a.createNullProtoObjWherePossible(),l,include,rethrow])};if(n.filename&&typeof Object.defineProperty==="function"){var g=n.filename;var v=s.basename(g,s.extname(g));try{Object.defineProperty(y,"name",{value:v,writable:false,enumerable:false,configurable:true})}catch(e){}}return y},generateSource:function(){var e=this.opts;if(e.rmWhitespace){this.templateText=this.templateText.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")}this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var t=this;var n=this.parseTemplateText();var i=this.opts.delimiter;var s=this.opts.openDelimiter;var a=this.opts.closeDelimiter;if(n&&n.length){n.forEach((function(e,o){var l;if(e.indexOf(s+i)===0&&e.indexOf(s+i+i)!==0){l=n[o+2];if(!(l==i+a||l=="-"+i+a||l=="_"+i+a)){throw new Error('Could not find matching close tag for "'+e+'".')}}t.scanLine(e)}))}},parseTemplateText:function(){var e=this.templateText;var t=this.regex;var n=t.exec(e);var i=[];var s;while(n){s=n.index;if(s!==0){i.push(e.substring(0,s));e=e.slice(s)}i.push(n[0]);e=e.slice(n[0].length);n=t.exec(e)}if(e){i.push(e)}return i},_addOutput:function(e){if(this.truncate){e=e.replace(/^(?:\r\n|\r|\n)/,"");this.truncate=false}if(!e){return e}e=e.replace(/\\/g,"\\\\");e=e.replace(/\n/g,"\\n");e=e.replace(/\r/g,"\\r");e=e.replace(/"/g,'\\"');this.source+=' ; __append("'+e+'")'+"\n"},scanLine:function(e){var t=this;var n=this.opts.delimiter;var i=this.opts.openDelimiter;var s=this.opts.closeDelimiter;var a=0;a=e.split("\n").length-1;switch(e){case i+n:case i+n+"_":this.mode=Template.modes.EVAL;break;case i+n+"=":this.mode=Template.modes.ESCAPED;break;case i+n+"-":this.mode=Template.modes.RAW;break;case i+n+"#":this.mode=Template.modes.COMMENT;break;case i+n+n:this.mode=Template.modes.LITERAL;this.source+=' ; __append("'+e.replace(i+n+n,i+n)+'")'+"\n";break;case n+n+s:this.mode=Template.modes.LITERAL;this.source+=' ; __append("'+e.replace(n+n+s,n+s)+'")'+"\n";break;case n+s:case"-"+n+s:case"_"+n+s:if(this.mode==Template.modes.LITERAL){this._addOutput(e)}this.mode=null;this.truncate=e.indexOf("-")===0||e.indexOf("_")===0;break;default:if(this.mode){switch(this.mode){case Template.modes.EVAL:case Template.modes.ESCAPED:case Template.modes.RAW:if(e.lastIndexOf("//")>e.lastIndexOf("\n")){e+="\n"}}switch(this.mode){case Template.modes.EVAL:this.source+=" ; "+e+"\n";break;case Template.modes.ESCAPED:this.source+=" ; __append(escapeFn("+stripSemi(e)+"))"+"\n";break;case Template.modes.RAW:this.source+=" ; __append("+stripSemi(e)+")"+"\n";break;case Template.modes.COMMENT:break;case Template.modes.LITERAL:this._addOutput(e);break}}else{this._addOutput(e)}}if(t.opts.compileDebug&&a){this.currentLine+=a;this.source+=" ; __line = "+this.currentLine+"\n"}}};t.escapeXML=a.escapeXML;t.__express=t.renderFile;t.VERSION=l;t.name=m;if(typeof window!="undefined"){window.ejs=t}},356:(e,t)=>{"use strict";var n=/[|\\{}()[\]^$+*?.]/g;var i=Object.prototype.hasOwnProperty;var hasOwn=function(e,t){return i.apply(e,[t])};t.escapeRegExpChars=function(e){if(!e){return""}return String(e).replace(n,"\\$&")};var s={"&":"&","<":"<",">":">",'"':""","'":"'"};var a=/[&<>'"]/g;function encode_char(e){return s[e]||e}var o="var _ENCODE_HTML_RULES = {\n"+' "&": "&"\n'+' , "<": "<"\n'+' , ">": ">"\n'+' , \'"\': """\n'+' , "\'": "'"\n'+" }\n"+" , _MATCH_HTML = /[&<>'\"]/g;\n"+"function encode_char(c) {\n"+" return _ENCODE_HTML_RULES[c] || c;\n"+"};\n";t.escapeXML=function(e){return e==undefined?"":String(e).replace(a,encode_char)};function escapeXMLToString(){return Function.prototype.toString.call(this)+";\n"+o}try{if(typeof Object.defineProperty==="function"){Object.defineProperty(t.escapeXML,"toString",{value:escapeXMLToString})}else{t.escapeXML.toString=escapeXMLToString}}catch(e){console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)")}t.shallowCopy=function(e,t){t=t||{};if(e!==null&&e!==undefined){for(var n in t){if(!hasOwn(t,n)){continue}if(n==="__proto__"||n==="constructor"){continue}e[n]=t[n]}}return e};t.shallowCopyFromList=function(e,t,n){n=n||[];t=t||{};if(e!==null&&e!==undefined){for(var i=0;i{"use strict";const i=n(9491);const s=n(2361);const a=n(8527);class Enquirer extends s{constructor(e,t){super();this.options=a.merge({},e);this.answers={...t}}register(e,t){if(a.isObject(e)){for(let t of Object.keys(e))this.register(t,e[t]);return this}i.equal(typeof t,"function","expected a function");const n=e.toLowerCase();if(t.prototype instanceof this.Prompt){this.prompts[n]=t}else{this.prompts[n]=t(this.Prompt,this)}return this}async prompt(e=[]){for(let t of[].concat(e)){try{if(typeof t==="function")t=await t.call(this);await this.ask(a.merge({},this.options,t))}catch(e){return Promise.reject(e)}}return this.answers}async ask(e){if(typeof e==="function"){e=await e.call(this)}let t=a.merge({},this.options,e);let{type:n,name:s}=e;let{set:o,get:l}=a;if(typeof n==="function"){n=await n.call(this,e,this.answers)}if(!n)return this.answers[s];if(n==="number")n="numeral";i(this.prompts[n],`Prompt "${n}" is not registered`);let u=new this.prompts[n](t);let f=l(this.answers,s);u.state.answers=this.answers;u.enquirer=this;if(s){u.on("submit",(e=>{this.emit("answer",s,e,u);o(this.answers,s,e)}))}let h=u.emit.bind(u);u.emit=(...e)=>{this.emit.call(this,...e);return h(...e)};this.emit("prompt",u,this);if(t.autofill&&f!=null){u.value=u.input=f;if(t.autofill==="show"){await u.submit()}}else{f=u.value=await u.run()}return f}use(e){e.call(this,this);return this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||n(7072)}static get prompts(){return n(6048)}static get types(){return n(891)}static get prompt(){const fn=(e,...t)=>{let n=new this(...t);let i=n.emit.bind(n);n.emit=(...e)=>{fn.emit(...e);return i(...e)};return n.prompt(e)};a.mixinEmitter(fn,new s);return fn}}a.mixinEmitter(Enquirer,new s);const o=Enquirer.prompts;for(let e of Object.keys(o)){let t=e.toLowerCase();let run=t=>new o[e](t).run();Enquirer.prompt[t]=run;Enquirer[t]=run;if(!Enquirer[e]){Reflect.defineProperty(Enquirer,e,{get:()=>o[e]})}}const define=e=>{a.defineExport(Enquirer,e,(()=>Enquirer.types[e]))};define("ArrayPrompt");define("AuthPrompt");define("BooleanPrompt");define("NumberPrompt");define("StringPrompt");e.exports=Enquirer},1330:(e,t,n)=>{"use strict";const i=process.env.TERM_PROGRAM==="Apple_Terminal";const s=n(5591);const a=n(8527);const o=e.exports=t;const l="[";const u="";let f=false;const h=o.code={bell:u,beep:u,beginning:`${l}G`,down:`${l}J`,esc:l,getPosition:`${l}6n`,hide:`${l}?25l`,line:`${l}2K`,lineEnd:`${l}K`,lineStart:`${l}1K`,restorePosition:l+(i?"8":"u"),savePosition:l+(i?"7":"s"),screen:`${l}2J`,show:`${l}?25h`,up:`${l}1J`};const d=o.cursor={get hidden(){return f},hide(){f=true;return h.hide},show(){f=false;return h.show},forward:(e=1)=>`${l}${e}C`,backward:(e=1)=>`${l}${e}D`,nextLine:(e=1)=>`${l}E`.repeat(e),prevLine:(e=1)=>`${l}F`.repeat(e),up:(e=1)=>e?`${l}${e}A`:"",down:(e=1)=>e?`${l}${e}B`:"",right:(e=1)=>e?`${l}${e}C`:"",left:(e=1)=>e?`${l}${e}D`:"",to(e,t){return t?`${l}${t+1};${e+1}H`:`${l}${e+1}G`},move(e=0,t=0){let n="";n+=e<0?d.left(-e):e>0?d.right(e):"";n+=t<0?d.up(-t):t>0?d.down(t):"";return n},strLen(e){var t=0,n=e.length,i=-1;for(var s=0;s=0&&i<=128)t+=1;else t+=2}return t},restore(e={}){let{after:t,cursor:n,initial:i,input:s,prompt:l,size:u,value:f}=e;i=a.isPrimitive(i)?String(i):"";s=a.isPrimitive(s)?String(s):"";f=a.isPrimitive(f)?String(f):"";if(u){let e=o.cursor.up(u)+o.cursor.to(this.strLen(l));let t=s.length-n;if(t>0){e+=o.cursor.left(t)}return e}if(f||t){let e=!s&&!!i?-this.strLen(i):-this.strLen(s)+n;if(t)e-=this.strLen(t);if(s===""&&i&&!l.includes(i)){e+=this.strLen(i)}return o.cursor.move(e)}}};const m=o.erase={screen:h.screen,up:h.up,down:h.down,line:h.line,lineEnd:h.lineEnd,lineStart:h.lineStart,lines(e){let t="";for(let n=0;n{if(!t)return m.line+d.to(0);let width=e=>[...s(e)].length;let n=e.split(/\r?\n/);let i=0;for(let e of n){i+=1+Math.floor(Math.max(width(e)-1,0)/t)}return(m.line+d.prevLine()).repeat(i-1)+m.line+d.to(0)}},6580:(e,t)=>{"use strict";t.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};t.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};t.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};t.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};t.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}},4130:e=>{"use strict";const unique=e=>e.filter(((t,n)=>e.lastIndexOf(t)===n));const compact=e=>unique(e).filter(Boolean);e.exports=(e,t={},n="")=>{let{past:i=[],present:s=""}=t;let a,o;switch(e){case"prev":case"undo":a=i.slice(0,i.length-1);o=i[i.length-1]||"";return{past:compact([n,...a]),present:o};case"next":case"redo":a=i.slice(1);o=i[0]||"";return{past:compact([...a,n]),present:o};case"save":return{past:compact([...i,n]),present:""};case"remove":o=compact(i.filter((e=>e!==n)));s="";if(o.length){s=o.pop()}return{past:o,present:s};default:{throw new Error(`Invalid action: "${e}"`)}}}},2299:(e,t,n)=>{"use strict";const i=n(5591);const clean=(e="")=>typeof e==="string"?e.replace(/^['"]|['"]$/g,""):"";class Item{constructor(e){this.name=e.key;this.field=e.field||{};this.value=clean(e.initial||this.field.initial||"");this.message=e.message||this.name;this.cursor=0;this.input="";this.lines=[]}}const tokenize=async(e={},t={},n=(e=>e))=>{let i=new Set;let s=e.fields||[];let a=e.template;let o=[];let l=[];let u=[];let f=1;if(typeof a==="function"){a=await a()}let h=-1;let next=()=>a[++h];let peek=()=>a[h+1];let push=e=>{e.line=f;o.push(e)};push({type:"bos",value:""});while(he.name===o.key));o.field=s.find((e=>e.name===o.key));if(!h){h=new Item(o);l.push(h)}h.lines.push(o.line-1);continue}let a=o[o.length-1];if(a.type==="text"&&a.line===f){a.value+=e}else{push({type:"text",value:e})}}push({type:"eos",value:""});return{input:a,tabstops:o,unique:i,keys:u,items:l}};e.exports=async e=>{let t=e.options;let n=new Set(t.required===true?[]:t.required||[]);let s={...t.values,...t.initial};let{tabstops:a,items:o,keys:l}=await tokenize(t,s);let u=createFn("result",e,t);let f=createFn("format",e,t);let h=createFn("validate",e,t,true);let d=e.isValue.bind(e);return async(s={},m=false)=>{let y=0;s.required=n;s.items=o;s.keys=l;s.output="";let validate=async(e,t,n,i)=>{let s=await h(e,t,n,i);if(s===false){return"Invalid field "+n.name}return s};for(let n of a){let a=n.value;let l=n.key;if(n.type!=="template"){if(a)s.output+=a;continue}if(n.type==="template"){let h=o.find((e=>e.name===l));if(t.required===true){s.required.add(h.name)}let g=[h.input,s.values[h.value],h.value,a].find(d);let v=h.field||{};let _=v.message||n.inner;if(m){let e=await validate(s.values[l],s,h,y);if(e&&typeof e==="string"||e===false){s.invalid.set(l,e);continue}s.invalid.delete(l);let t=await u(s.values[l],s,h,y);s.output+=i(t);continue}h.placeholder=false;let S=a;a=await f(a,s,h,y);if(g!==a){s.values[l]=g;a=e.styles.typing(g);s.missing.delete(_)}else{s.values[l]=void 0;g=`<${_}>`;a=e.styles.primary(g);h.placeholder=true;if(s.required.has(l)){s.missing.add(_)}}if(s.missing.has(_)&&s.validating){a=e.styles.warning(g)}if(s.invalid.has(l)&&s.validating){a=e.styles.danger(g)}if(y===s.index){if(S!==a){a=e.styles.underline(a)}else{a=e.styles.heading(i(a))}}y++}if(a){s.output+=a}}let g=s.output.split("\n").map((e=>" "+e));let v=o.length;let _=0;for(let t of o){if(s.invalid.has(t.name)){t.lines.forEach((e=>{if(g[e][0]!==" ")return;g[e]=s.styles.danger(s.symbols.bullet)+g[e].slice(1)}))}if(e.isValue(s.values[t.name])){_++}}s.completed=(_/v*100).toFixed(0);s.output=g.join("\n");return s.output}};function createFn(e,t,n,i){return(n,s,a,o)=>{if(typeof a.field[e]==="function"){return a.field[e].call(t,n,s,a,o)}return[i,n].find((e=>t.isValue(e)))}}},4162:(e,t,n)=>{"use strict";const i=n(4521);const s=n(6580);const a=n(5404);const o=/^(?:\x1b)([a-zA-Z0-9])$/;const l=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/;const u={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"};function isShiftKey(e){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(e)}function isCtrlKey(e){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(e)}const keypress=(e="",t={})=>{let n;let i={name:t.name,ctrl:false,meta:false,shift:false,option:false,sequence:e,raw:e,...t};if(Buffer.isBuffer(e)){if(e[0]>127&&e[1]===void 0){e[0]-=128;e=""+String(e)}else{e=String(e)}}else if(e!==void 0&&typeof e!=="string"){e=String(e)}else if(!e){e=i.sequence||""}i.sequence=i.sequence||e||i.name;if(e==="\r"){i.raw=void 0;i.name="return"}else if(e==="\n"){i.name="enter"}else if(e==="\t"){i.name="tab"}else if(e==="\b"||e===""||e===""||e==="\b"){i.name="backspace";i.meta=e.charAt(0)===""}else if(e===""||e===""){i.name="escape";i.meta=e.length===2}else if(e===" "||e===" "){i.name="space";i.meta=e.length===2}else if(e<=""){i.name=String.fromCharCode(e.charCodeAt(0)+"a".charCodeAt(0)-1);i.ctrl=true}else if(e.length===1&&e>="0"&&e<="9"){i.name="number"}else if(e.length===1&&e>="a"&&e<="z"){i.name=e}else if(e.length===1&&e>="A"&&e<="Z"){i.name=e.toLowerCase();i.shift=true}else if(n=o.exec(e)){i.meta=true;i.shift=/^[A-Z]$/.test(n[1])}else if(n=l.exec(e)){let t=[...e];if(t[0]===""&&t[1]===""){i.option=true}let s=[n[1],n[2],n[4],n[6]].filter(Boolean).join("");let a=(n[3]||n[5]||1)-1;i.ctrl=!!(a&4);i.meta=!!(a&10);i.shift=!!(a&1);i.code=s;i.name=u[s];i.shift=isShiftKey(s)||i.shift;i.ctrl=isCtrlKey(s)||i.ctrl}return i};keypress.listen=(e={},t)=>{let{stdin:n}=e;if(!n||n!==process.stdin&&!n.isTTY){throw new Error("Invalid stream passed")}let s=i.createInterface({terminal:true,input:n});i.emitKeypressEvents(n,s);const o=new a(((e,n)=>t(e,keypress(e,n),s)));let l=n.isRaw;if(n.isTTY)n.setRawMode(true);n.on("keypress",o.enqueue);s.resume();let off=()=>{if(n.isTTY)n.setRawMode(l);n.removeListener("keypress",o.enqueue);o.destroy();s.pause();s.close()};return off};keypress.action=(e,t,n)=>{let i={...s,...n};if(t.ctrl){t.action=i.ctrl[t.name];return t}if(t.option&&i.option){t.action=i.option[t.name];return t}if(t.shift){t.action=i.shift[t.name];return t}t.action=i.keys[t.name];return t};e.exports=keypress},9690:(e,t,n)=>{"use strict";const i=n(8527);e.exports=(e,t={})=>{e.cursorHide();let{input:n="",initial:s="",pos:a,showCursor:o=true,color:l}=t;let u=l||e.styles.placeholder;let f=i.inverse(e.styles.primary);let blinker=t=>f(e.styles.black(t));let h=n;let d=" ";let m=blinker(d);if(e.blink&&e.blink.off===true){blinker=e=>e;m=""}if(o&&a===0&&s===""&&n===""){return blinker(d)}if(o&&a===0&&(n===s||n==="")){return blinker(s[0])+u(s.slice(1))}s=i.isPrimitive(s)?`${s}`:"";n=i.isPrimitive(n)?`${n}`:"";let y=s&&s.startsWith(n)&&s!==n;let g=y?blinker(s[n.length]):m;if(a!==n.length&&o===true){h=n.slice(0,a)+blinker(n[a])+n.slice(a+1);g=""}if(o===false){g=""}if(y){let t=e.styles.unstyle(h+g);return h+g+u(s.slice(t.length))}return h+g}},7072:(e,t,n)=>{"use strict";const i=n(2361);const s=n(5591);const a=n(4162);const o=n(7711);const l=n(1686);const u=n(6739);const f=n(8527);const h=n(1330);class Prompt extends i{constructor(e={}){super();this.name=e.name;this.type=e.type;this.options=e;u(this);o(this);this.state=new l(this);this.initial=[e.initial,e.default].find((e=>e!=null));this.stdout=e.stdout||process.stdout;this.stdin=e.stdin||process.stdin;this.scale=e.scale||1;this.term=this.options.term||process.env.TERM_PROGRAM;this.margin=margin(this.options.margin);this.setMaxListeners(0);setOptions(this)}async keypress(e,t={}){this.keypressed=true;let n=a.action(e,a(e,t),this.options.actions);this.state.keypress=n;this.emit("keypress",e,n);this.emit("state",this.state.clone());const i=this.options[n.action]||this[n.action]||this.dispatch;if(typeof i==="function"){return await i.call(this,e,n)}this.alert()}alert(){delete this.state.alert;if(this.options.show===false){this.emit("alert")}else{this.stdout.write(h.code.beep)}}cursorHide(){this.stdout.write(h.cursor.hide());const e=f.onExit((()=>this.cursorShow()));this.on("close",(()=>{this.cursorShow();e()}))}cursorShow(){this.stdout.write(h.cursor.show())}write(e){if(!e)return;if(this.stdout&&this.state.show!==false){this.stdout.write(e)}this.state.buffer+=e}clear(e=0){let t=this.state.buffer;this.state.buffer="";if(!t&&!e||this.options.show===false)return;this.stdout.write(h.cursor.down(e)+h.clear(t,this.width))}restore(){if(this.state.closed||this.options.show===false)return;let{prompt:e,after:t,rest:n}=this.sections();let{cursor:i,initial:s="",input:a="",value:o=""}=this;let l=this.state.size=n.length;let u={after:t,cursor:i,initial:s,input:a,prompt:e,size:l,value:o};let f=h.cursor.restore(u);if(f){this.stdout.write(f)}}sections(){let{buffer:e,input:t,prompt:n}=this.state;n=s(n);let i=s(e);let a=i.indexOf(n);let o=i.slice(0,a);let l=i.slice(a);let u=l.split("\n");let f=u[0];let h=u[u.length-1];let d=n+(t?" "+t:"");let m=d.length;let y=me.call(this,this.value);this.result=()=>n.call(this,this.value);if(typeof t.initial==="function"){this.initial=await t.initial.call(this,this)}if(typeof t.onRun==="function"){await t.onRun.call(this,this)}if(typeof t.onSubmit==="function"){let e=t.onSubmit.bind(this);let n=this.submit.bind(this);delete this.options.onSubmit;this.submit=async()=>{await e(this.name,this.value,this);return n()}}await this.start();await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise((async(e,t)=>{this.once("submit",e);this.once("cancel",t);if(await this.skip()){this.render=()=>{};return this.submit()}await this.initialize();this.emit("run")}))}async element(e,t,n){let{options:i,state:s,symbols:a,timers:o}=this;let l=o&&o[e];s.timer=l;let u=i[e]||s[e]||a[e];let f=t&&t[e]!=null?t[e]:await u;if(f==="")return f;let h=await this.resolve(f,s,t,n);if(!h&&t&&t[e]){return this.resolve(u,s,t,n)}return h}async prefix(){let e=await this.element("prefix")||this.symbols;let t=this.timers&&this.timers.prefix;let n=this.state;n.timer=t;if(f.isObject(e))e=e[n.status]||e.pending;if(!f.hasColor(e)){let t=this.styles[n.status]||this.styles.pending;return t(e)}return e}async message(){let e=await this.element("message");if(!f.hasColor(e)){return this.styles.strong(e)}return e}async separator(){let e=await this.element("separator")||this.symbols;let t=this.timers&&this.timers.separator;let n=this.state;n.timer=t;let i=e[n.status]||e.pending||n.separator;let s=await this.resolve(i,n);if(f.isObject(s))s=s[n.status]||s.pending;if(!f.hasColor(s)){return this.styles.muted(s)}return s}async pointer(e,t){let n=await this.element("pointer",e,t);if(typeof n==="string"&&f.hasColor(n)){return n}if(n){let e=this.styles;let i=this.index===t;let s=i?e.primary:e=>e;let a=await this.resolve(n[i?"on":"off"]||n,this.state);let o=!f.hasColor(a)?s(a):a;return i?o:" ".repeat(a.length)}}async indicator(e,t){let n=await this.element("indicator",e,t);if(typeof n==="string"&&f.hasColor(n)){return n}if(n){let t=this.styles;let i=e.enabled===true;let s=i?t.success:t.dark;let a=n[i?"on":"off"]||n;return!f.hasColor(a)?s(a):a}return""}body(){return null}footer(){if(this.state.status==="pending"){return this.element("footer")}}header(){if(this.state.status==="pending"){return this.element("header")}}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let e=await this.element("hint");if(!f.hasColor(e)){return this.styles.muted(e)}return e}}error(e){return!this.state.submitted?e||this.state.error:""}format(e){return e}result(e){return e}validate(e){if(this.options.required===true){return this.isValue(e)}return true}isValue(e){return e!=null&&e!==""}resolve(e,...t){return f.resolve(this,e,...t)}get base(){return Prompt.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||f.height(this.stdout,25)}get width(){return this.options.columns||f.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(e){this.state.cursor=e}get cursor(){return this.state.cursor}set input(e){this.state.input=e}get input(){return this.state.input}set value(e){this.state.value=e}get value(){let{input:e,value:t}=this.state;let n=[t,e].find(this.isValue.bind(this));return this.isValue(n)?n:this.initial}static get prompt(){return e=>new this(e).run()}}function setOptions(e){let isValidKey=t=>e[t]===void 0||typeof e[t]==="function";let t=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"];let n=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let i of Object.keys(e.options)){if(t.includes(i))continue;if(/^on[A-Z]/.test(i))continue;let s=e.options[i];if(typeof s==="function"&&isValidKey(i)){if(!n.includes(i)){e[i]=s.bind(e)}}else if(typeof e[i]!=="function"){e[i]=s}}}function margin(e){if(typeof e==="number"){e=[e,e,e,e]}let t=[].concat(e||[]);let pad=e=>e%2===0?"\n":" ";let n=[];for(let e=0;e<4;e++){let i=pad(e);if(t[e]){n.push(i.repeat(t[e]))}else{n.push("")}}return n}e.exports=Prompt},4858:(e,t,n)=>{"use strict";const i=n(4449);const highlight=(e,t)=>{const n=e?new RegExp(e,"ig"):/$^/;return i=>e?i.replace(n,(e=>t(e))):i};class AutoComplete extends i{constructor(e){super(e);this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:t,input:n}=this.state;this.input=n.slice(0,t)+e+n.slice(t);this.moveCursor(1);return this.complete()}delete(){let{cursor:e,input:t}=this.state;if(!t)return this.alert();this.input=t.slice(0,e-1)+t.slice(e);this.moveCursor(-1);return this.complete()}deleteForward(){let{cursor:e,input:t}=this.state;if(t[e]===void 0)return this.alert();this.input=`${t}`.slice(0,e)+`${t}`.slice(e+1);return this.complete()}number(e){return this.append(e)}async complete(){this.completing=true;this.choices=await this.suggest(this.input,this.state._choices);this.state.limit=void 0;this.index=Math.min(Math.max(this.visible.length-1,0),this.index);await this.render();this.completing=false}suggest(e=this.input,t=this.state._choices){if(typeof this.options.suggest==="function"){return this.options.suggest.call(this,e,t)}let n=e.toLowerCase();return t.filter((e=>e.message.toLowerCase().includes(n)))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted){return this.selected.map((e=>this.styles.primary(e.message))).join(", ")}if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!=="pending")return super.render();const e=this.options.highlight||this.styles.complement;const style=(t,n)=>{if(!t)return t;if(e.stack)return e(t);return e.call(this,t)};const t=highlight(this.input,style);const n=this.choices;this.choices=n.map((e=>({...e,message:t(e.message)})));await super.render();this.choices=n}submit(){if(this.options.multiple){this.value=this.selected.map((e=>e.name))}return super.submit()}}e.exports=AutoComplete},5389:(e,t,n)=>{"use strict";const i=n(3315);function defaultAuthenticate(e,t){if(e.username===this.options.username&&e.password===this.options.password){return true}return false}const factory=(e=defaultAuthenticate)=>{const t=[{name:"username",message:"username"},{name:"password",message:"password",format(e){if(this.options.showPassword){return e}let t=this.state.submitted?this.styles.primary:this.styles.muted;return t(this.symbols.asterisk.repeat(e.length))}}];class BasicAuthPrompt extends(i.create(e)){constructor(e){super({...e,choices:t})}static create(e){return factory(e)}}return BasicAuthPrompt};e.exports=factory()},410:(e,t,n)=>{"use strict";const i=n(3055);class ConfirmPrompt extends i{constructor(e){super(e);this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}}e.exports=ConfirmPrompt},8408:(e,t,n)=>{"use strict";const i=n(4449);const s=n(1787);const a=s.prototype;class Editable extends i{constructor(e){super({...e,multiple:true});this.align=[this.options.align,"left"].find((e=>e!=null));this.emptyError="";this.values={}}dispatch(e,t){let n=this.focused;let i=n.parent||{};if(!n.editable&&!i.editable){if(e==="a"||e==="i")return super[e]()}return a.dispatch.call(this,e,t)}append(e,t){return a.append.call(this,e,t)}delete(e,t){return a.delete.call(this,e,t)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?a.next.call(this):super.next()}prev(){return this.focused.editable?a.prev.call(this):super.prev()}async indicator(e,t){let n=e.indicator||"";let i=e.editable?n:super.indicator(e,t);return await this.resolve(i,this.state,e,t)||""}indent(e){return e.role==="heading"?"":e.editable?" ":" "}async renderChoice(e,t){e.indent="";if(e.editable)return a.renderChoice.call(this,e,t);return super.renderChoice(e,t)}error(){return""}footer(){return this.state.error}async validate(){let e=true;for(let t of this.choices){if(typeof t.validate!=="function"){continue}if(t.role==="heading"){continue}let n=t.parent?this.value[t.parent.name]:this.value;if(t.editable){n=t.value===t.name?t.initial||"":t.value}else if(!this.isDisabled(t)){n=t.enabled===true}e=await t.validate(n,this.state);if(e!==true){break}}if(e!==true){this.state.error=typeof e==="string"?e:"Invalid Input"}return e}submit(){if(this.focused.newChoice===true)return super.submit();if(this.choices.some((e=>e.newChoice))){return this.alert()}this.value={};for(let e of this.choices){let t=e.parent?this.value[e.parent.name]:this.value;if(e.role==="heading"){this.value[e.name]={};continue}if(e.editable){t[e.name]=e.value===e.name?e.initial||"":e.value}else if(!this.isDisabled(e)){t[e.name]=e.enabled===true}}return this.base.submit.call(this)}}e.exports=Editable},1787:(e,t,n)=>{"use strict";const i=n(5591);const s=n(4449);const a=n(9690);class FormPrompt extends s{constructor(e){super({...e,multiple:true});this.type="form";this.initial=this.options.initial;this.align=[this.options.align,"right"].find((e=>e!=null));this.emptyError="";this.values={}}async reset(e){await super.reset();if(e===true)this._index=this.index;this.index=this._index;this.values={};this.choices.forEach((e=>e.reset&&e.reset()));return this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let t=this.focused;if(!t)return this.alert();let{cursor:n,input:i}=t;t.value=t.input=i.slice(0,n)+e+i.slice(n);t.cursor++;return this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:t,input:n}=e;e.value=e.input=n.slice(0,t-1)+n.slice(t);e.cursor--;return this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:t,input:n}=e;if(n[t]===void 0)return this.alert();let i=`${n}`.slice(0,t)+`${n}`.slice(t+1);e.value=e.input=i;return this.render()}right(){let e=this.focused;if(!e)return this.alert();if(e.cursor>=e.input.length)return this.alert();e.cursor++;return this.render()}left(){let e=this.focused;if(!e)return this.alert();if(e.cursor<=0)return this.alert();e.cursor--;return this.render()}space(e,t){return this.dispatch(e,t)}number(e,t){return this.dispatch(e,t)}next(){let e=this.focused;if(!e)return this.alert();let{initial:t,input:n}=e;if(t&&t.startsWith(n)&&n!==t){e.value=e.input=t;e.cursor=e.value.length;return this.render()}return super.next()}prev(){let e=this.focused;if(!e)return this.alert();if(e.cursor===0)return super.prev();e.value=e.input="";e.cursor=0;return this.render()}separator(){return""}format(e){return!this.state.submitted?super.format(e):""}pointer(){return""}indicator(e){return e.input?"⦿":"⊙"}async choiceSeparator(e,t){let n=await this.resolve(e.separator,this.state,e,t)||":";return n?" "+this.styles.disabled(n):""}async renderChoice(e,t){await this.onChoice(e,t);let{state:n,styles:s}=this;let{cursor:o,initial:l="",name:u,input:f=""}=e;let{muted:h,submitted:d,primary:m,danger:y}=s;let g=this.index===t;let v=e.validate||(()=>true);let _=await this.choiceSeparator(e,t);let S=e.message;if(this.align==="right")S=S.padStart(this.longest+1," ");if(this.align==="left")S=S.padEnd(this.longest+1," ");let x=this.values[u]=f||l;let k=f?"success":"dark";if(await v.call(e,x,this.state)!==true){k="danger"}let E=s[k];let R=E(await this.indicator(e,t))+(e.pad||"");let O=this.indent(e);let line=()=>[O,R,S+_,f].filter(Boolean).join(" ");if(n.submitted){S=i(S);f=d(f);return line()}if(e.format){f=await e.format.call(this,f,e,t)}else{let e=this.styles.muted;let t={input:f,initial:l,pos:o,showCursor:g,color:e};f=a(this,t)}if(!this.isValue(f)){f=this.styles.muted(this.symbols.ellipsis)}if(e.result){this.values[u]=await e.result.call(this,x,e,t)}if(g){S=m(S)}if(e.error){f+=(f?" ":"")+y(e.error.trim())}else if(e.hint){f+=(f?" ":"")+h(e.hint.trim())}return line()}async submit(){this.value=this.values;return super.base.submit.call(this)}}e.exports=FormPrompt},6048:(e,t,n)=>{"use strict";const i=n(8527);const define=(e,n)=>{i.defineExport(t,e,n);i.defineExport(t,e.toLowerCase(),n)};define("AutoComplete",(()=>n(4858)));define("BasicAuth",(()=>n(5389)));define("Confirm",(()=>n(410)));define("Editable",(()=>n(8408)));define("Form",(()=>n(1787)));define("Input",(()=>n(338)));define("Invisible",(()=>n(1289)));define("List",(()=>n(1996)));define("MultiSelect",(()=>n(2350)));define("Numeral",(()=>n(3542)));define("Password",(()=>n(2824)));define("Scale",(()=>n(3513)));define("Select",(()=>n(4449)));define("Snippet",(()=>n(3625)));define("Sort",(()=>n(5873)));define("Survey",(()=>n(5610)));define("Text",(()=>n(8355)));define("Toggle",(()=>n(1394)));define("Quiz",(()=>n(3981)))},338:(e,t,n)=>{"use strict";const i=n(1401);const s=n(4130);class Input extends i{constructor(e){super(e);let t=this.options.history;if(t&&t.store){let e=t.values||this.initial;this.autosave=!!t.autosave;this.store=t.store;this.data=this.store.get("values")||{past:[],present:e};this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){if(!this.store)return this.alert();this.data=s(e,this.data,this.input);if(!this.data.present)return this.alert();this.input=this.data.present;this.cursor=this.input.length;return this.render()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){this.save();return super.prev()}save(){if(!this.store)return;this.data=s("save",this.data,this.input);this.store.set("values",this.data)}submit(){if(this.store&&this.autosave===true){this.save()}return super.submit()}}e.exports=Input},1289:(e,t,n)=>{"use strict";const i=n(1401);class InvisiblePrompt extends i{format(){return""}}e.exports=InvisiblePrompt},1996:(e,t,n)=>{"use strict";const i=n(1401);class ListPrompt extends i{constructor(e={}){super(e);this.sep=this.options.separator||/, */;this.initial=e.initial||""}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:e=>e;return this.list.map(e).join(", ")}async submit(e){let t=this.state.error||await this.validate(this.list,this.state);if(t!==true){this.state.error=t;return super.submit()}this.value=this.list;return super.submit()}get list(){return this.split()}}e.exports=ListPrompt},2350:(e,t,n)=>{"use strict";const i=n(4449);class MultiSelect extends i{constructor(e){super({...e,multiple:true})}}e.exports=MultiSelect},3542:(e,t,n)=>{e.exports=n(7572)},2824:(e,t,n)=>{"use strict";const i=n(1401);class PasswordPrompt extends i{constructor(e){super(e);this.cursorShow()}format(e=this.input){if(!this.keypressed)return"";let t=this.state.submitted?this.styles.primary:this.styles.muted;return t(this.symbols.asterisk.repeat(e.length))}}e.exports=PasswordPrompt},3981:(e,t,n)=>{"use strict";const i=n(4449);class Quiz extends i{constructor(e){super(e);if(typeof this.options.correctChoice!=="number"||this.options.correctChoice<0){throw new Error("Please specify the index of the correct answer from the list of choices")}}async toChoices(e,t){let n=await super.toChoices(e,t);if(n.length<2){throw new Error("Please give at least two choices to the user")}if(this.options.correctChoice>n.length){throw new Error("Please specify the index of the correct answer from the list of choices")}return n}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}}e.exports=Quiz},3513:(e,t,n)=>{"use strict";const i=n(5591);const s=n(7633);const a=n(8527);class LikertScale extends s{constructor(e={}){super(e);this.widths=[].concat(e.messageWidth||50);this.align=[].concat(e.align||"left");this.linebreak=e.linebreak||false;this.edgeLength=e.edgeLength||3;this.newline=e.newline||"\n ";let t=e.startNumber||1;if(typeof this.scale==="number"){this.scaleKey=false;this.scale=Array(this.scale).fill(0).map(((e,n)=>({name:n+t})))}}async reset(){this.tableized=false;await super.reset();return this.render()}tableize(){if(this.tableized===true)return;this.tableized=true;let e=0;for(let t of this.choices){e=Math.max(e,t.message.length);t.scaleIndex=t.initial||2;t.scale=[];for(let e=0;e=this.scale.length-1)return this.alert();e.scaleIndex++;return this.render()}left(){let e=this.focused;if(e.scaleIndex<=0)return this.alert();e.scaleIndex--;return this.render()}indent(){return""}format(){if(this.state.submitted){let e=this.choices.map((e=>this.styles.info(e.index)));return e.join(", ")}return""}pointer(){return""}renderScaleKey(){if(this.scaleKey===false)return"";if(this.state.submitted)return"";let e=this.scale.map((e=>` ${e.name} - ${e.message}`));let t=["",...e].map((e=>this.styles.muted(e)));return t.join("\n")}renderScaleHeading(e){let t=this.scale.map((e=>e.name));if(typeof this.options.renderScaleHeading==="function"){t=this.options.renderScaleHeading.call(this,e)}let n=this.scaleLength-t.join("").length;let i=Math.round(n/(t.length-1));let s=t.map((e=>this.styles.strong(e)));let a=s.join(" ".repeat(i));let o=" ".repeat(this.widths[0]);return this.margin[3]+o+this.margin[1]+a}scaleIndicator(e,t,n){if(typeof this.options.scaleIndicator==="function"){return this.options.scaleIndicator.call(this,e,t,n)}let i=e.scaleIndex===t.index;if(t.disabled)return this.styles.hint(this.symbols.radio.disabled);if(i)return this.styles.success(this.symbols.radio.on);return this.symbols.radio.off}renderScale(e,t){let n=e.scale.map((n=>this.scaleIndicator(e,n,t)));let i=this.term==="Hyper"?"":" ";return n.join(i+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,t){await this.onChoice(e,t);let n=this.index===t;let s=await this.pointer(e,t);let o=await e.hint;if(o&&!a.hasColor(o)){o=this.styles.muted(o)}let pad=e=>this.margin[3]+e.replace(/\s+$/,"").padEnd(this.widths[0]," ");let l=this.newline;let u=this.indent(e);let f=await this.resolve(e.message,this.state,e,t);let h=await this.renderScale(e,t);let d=this.margin[1]+this.margin[3];this.scaleLength=i(h).length;this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-d.length);let m=a.wordWrap(f,{width:this.widths[0],newline:l});let y=m.split("\n").map((e=>pad(e)+this.margin[1]));if(n){h=this.styles.info(h);y=y.map((e=>this.styles.info(e)))}y[0]+=h;if(this.linebreak)y.push("");return[u+s,y.join("\n")].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let e=this.visible.map((async(e,t)=>await this.renderChoice(e,t)));let t=await Promise.all(e);let n=await this.renderScaleHeading();return this.margin[0]+[n,...t.map((e=>e.join(" ")))].join("\n")}async render(){let{submitted:e,size:t}=this.state;let n=await this.prefix();let i=await this.separator();let s=await this.message();let a="";if(this.options.promptLine!==false){a=[n,s,i,""].join(" ");this.state.prompt=a}let o=await this.header();let l=await this.format();let u=await this.renderScaleKey();let f=await this.error()||await this.hint();let h=await this.renderChoices();let d=await this.footer();let m=this.emptyError;if(l)a+=l;if(f&&!a.includes(f))a+=" "+f;if(e&&!l&&!h.trim()&&this.multiple&&m!=null){a+=this.styles.danger(m)}this.clear(t);this.write([o,a,u,h,d].filter(Boolean).join("\n"));if(!this.state.submitted){this.write(this.margin[2])}this.restore()}submit(){this.value={};for(let e of this.choices){this.value[e.name]=e.scaleIndex}return this.base.submit.call(this)}}e.exports=LikertScale},4449:(e,t,n)=>{"use strict";const i=n(7633);const s=n(8527);class SelectPrompt extends i{constructor(e){super(e);this.emptyError=this.options.emptyError||"No items were selected"}async dispatch(e,t){if(this.multiple){return this[t.name]?await this[t.name](e,t):await super.dispatch(e,t)}this.alert()}separator(){if(this.options.separator)return super.separator();let e=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():e}pointer(e,t){return!this.multiple||this.options.pointer?super.pointer(e,t):""}indicator(e,t){return this.multiple?super.indicator(e,t):""}choiceMessage(e,t){let n=this.resolve(e.message,this.state,e,t);if(e.role==="heading"&&!s.hasColor(n)){n=this.styles.strong(n)}return this.resolve(n,this.state,e,t)}choiceSeparator(){return":"}async renderChoice(e,t){await this.onChoice(e,t);let n=this.index===t;let i=await this.pointer(e,t);let a=await this.indicator(e,t)+(e.pad||"");let o=await this.resolve(e.hint,this.state,e,t);if(o&&!s.hasColor(o)){o=this.styles.muted(o)}let l=this.indent(e);let u=await this.choiceMessage(e,t);let line=()=>[this.margin[3],l+i+a,u,this.margin[1],o].filter(Boolean).join(" ");if(e.role==="heading"){return line()}if(e.disabled){if(!s.hasColor(u)){u=this.styles.disabled(u)}return line()}if(n){u=this.styles.em(u)}return line()}async renderChoices(){if(this.state.loading==="choices"){return this.styles.warning("Loading choices")}if(this.state.submitted)return"";let e=this.visible.map((async(e,t)=>await this.renderChoice(e,t)));let t=await Promise.all(e);if(!t.length)t.push(this.styles.danger("No matching choices"));let n=this.margin[0]+t.join("\n");let i;if(this.options.choicesHeader){i=await this.resolve(this.options.choicesHeader,this.state)}return[i,n].filter(Boolean).join("\n")}format(){if(!this.state.submitted||this.state.cancelled)return"";if(Array.isArray(this.selected)){return this.selected.map((e=>this.styles.primary(e.name))).join(", ")}return this.styles.primary(this.selected.name)}async render(){let{submitted:e,size:t}=this.state;let n="";let i=await this.header();let s=await this.prefix();let a=await this.separator();let o=await this.message();if(this.options.promptLine!==false){n=[s,o,a,""].join(" ");this.state.prompt=n}let l=await this.format();let u=await this.error()||await this.hint();let f=await this.renderChoices();let h=await this.footer();if(l)n+=l;if(u&&!n.includes(u))n+=" "+u;if(e&&!l&&!f.trim()&&this.multiple&&this.emptyError!=null){n+=this.styles.danger(this.emptyError)}this.clear(t);this.write([i,n,f,h].filter(Boolean).join("\n"));this.write(this.margin[2]);this.restore()}}e.exports=SelectPrompt},3625:(e,t,n)=>{"use strict";const i=n(5591);const s=n(2299);const a=n(7072);class SnippetPrompt extends a{constructor(e){super(e);this.cursorHide();this.reset(true)}async initialize(){this.interpolate=await s(this);await super.initialize()}async reset(e){this.state.keys=[];this.state.invalid=new Map;this.state.missing=new Set;this.state.completed=0;this.state.values={};if(e!==true){await this.initialize();await this.render()}}moveCursor(e){let t=this.getItem();this.cursor+=e;t.cursor+=e}dispatch(e,t){if(!t.code&&!t.ctrl&&e!=null&&this.getItem()){this.append(e,t);return}this.alert()}append(e,t){let n=this.getItem();let i=n.input.slice(0,this.cursor);let s=n.input.slice(this.cursor);this.input=n.input=`${i}${e}${s}`;this.moveCursor(1);this.render()}delete(){let e=this.getItem();if(this.cursor<=0||!e.input)return this.alert();let t=e.input.slice(this.cursor);let n=e.input.slice(0,this.cursor-1);this.input=e.input=`${n}${t}`;this.moveCursor(-1);this.render()}increment(e){return e>=this.state.keys.length-1?0:e+1}decrement(e){return e<=0?this.state.keys.length-1:e-1}first(){this.state.index=0;this.render()}last(){this.state.index=this.state.keys.length-1;this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1);this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1);this.render()}prev(){this.state.index=this.decrement(this.state.index);this.getItem();this.render()}next(){this.state.index=this.increment(this.state.index);this.getItem();this.render()}up(){this.prev()}down(){this.next()}format(e){let t=this.state.completed<100?this.styles.warning:this.styles.success;if(this.state.submitted===true&&this.state.completed!==100){t=this.styles.danger}return t(`${this.state.completed}% completed`)}async render(){let{index:e,keys:t=[],submitted:n,size:i}=this.state;let s=[this.options.newline,"\n"].find((e=>e!=null));let a=await this.prefix();let o=await this.separator();let l=await this.message();let u=[a,l,o].filter(Boolean).join(" ");this.state.prompt=u;let f=await this.header();let h=await this.error()||"";let d=await this.hint()||"";let m=n?"":await this.interpolate(this.state);let y=this.state.key=t[e]||"";let g=await this.format(y);let v=await this.footer();if(g)u+=" "+g;if(d&&!g&&this.state.completed===0)u+=" "+d;this.clear(i);let _=[f,u,m,v,h.trim()];this.write(_.filter(Boolean).join(s));this.restore()}getItem(e){let{items:t,keys:n,index:i}=this.state;let s=t.find((e=>e.name===n[i]));if(s&&s.input!=null){this.input=s.input;this.cursor=s.cursor}return s}async submit(){if(typeof this.interpolate!=="function")await this.initialize();await this.interpolate(this.state,true);let{invalid:e,missing:t,output:n,values:s}=this.state;if(e.size){let t="";for(let[n,i]of e)t+=`Invalid ${n}: ${i}\n`;this.state.error=t;return super.submit()}if(t.size){this.state.error="Required: "+[...t.keys()].join(", ");return super.submit()}let a=i(n).split("\n");let o=a.map((e=>e.slice(1))).join("\n");this.value={values:s,result:o};return super.submit()}}e.exports=SnippetPrompt},5873:(e,t,n)=>{"use strict";const i="(Use + to sort)";const s=n(4449);class Sort extends s{constructor(e){super({...e,reorder:false,sort:true,multiple:true});this.state.hint=[this.options.hint,i].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,t){let n=await super.renderChoice(e,t);let i=this.symbols.identicalTo+" ";let s=this.index===t&&this.sorting?this.styles.muted(i):" ";if(this.options.drag===false)s="";if(this.options.numbered===true){return s+`${t+1} - `+n}return s+n}get selected(){return this.choices}submit(){this.value=this.choices.map((e=>e.value));return super.submit()}}e.exports=Sort},5610:(e,t,n)=>{"use strict";const i=n(7633);class Survey extends i{constructor(e={}){super(e);this.emptyError=e.emptyError||"No items were selected";this.term=process.env.TERM_PROGRAM;if(!this.options.header){let e=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];e=e.map((e=>this.styles.muted(e)));this.state.header=e.join("\n ")}}async toChoices(...e){if(this.createdScales)return false;this.createdScales=true;let t=await super.toChoices(...e);for(let e of t){e.scale=createScale(5,this.options);e.scaleIdx=2}return t}dispatch(){this.alert()}space(){let e=this.focused;let t=e.scale[e.scaleIdx];let n=t.selected;e.scale.forEach((e=>e.selected=false));t.selected=!n;return this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;if(e.scaleIdx>=e.scale.length-1)return this.alert();e.scaleIdx++;return this.render()}left(){let e=this.focused;if(e.scaleIdx<=0)return this.alert();e.scaleIdx--;return this.render()}indent(){return" "}async renderChoice(e,t){await this.onChoice(e,t);let n=this.index===t;let i=this.term==="Hyper";let s=!i?8:9;let a=!i?" ":"";let o=this.symbols.line.repeat(s);let l=" ".repeat(s+(i?0:1));let dot=e=>(e?this.styles.success("◉"):"◯")+a;let u=t+1+".";let f=n?this.styles.heading:this.styles.noop;let h=await this.resolve(e.message,this.state,e,t);let d=this.indent(e);let m=d+e.scale.map(((t,n)=>dot(n===e.scaleIdx))).join(o);let val=t=>t===e.scaleIdx?f(t):t;let y=d+e.scale.map(((e,t)=>val(t))).join(l);let line=()=>[u,h].filter(Boolean).join(" ");let lines=()=>[line(),m,y," "].filter(Boolean).join("\n");if(n){m=this.styles.cyan(m);y=this.styles.cyan(y)}return lines()}async renderChoices(){if(this.state.submitted)return"";let e=this.visible.map((async(e,t)=>await this.renderChoice(e,t)));let t=await Promise.all(e);if(!t.length)t.push(this.styles.danger("No matching choices"));return t.join("\n")}format(){if(this.state.submitted){let e=this.choices.map((e=>this.styles.info(e.scaleIdx)));return e.join(", ")}return""}async render(){let{submitted:e,size:t}=this.state;let n=await this.prefix();let i=await this.separator();let s=await this.message();let a=[n,s,i].filter(Boolean).join(" ");this.state.prompt=a;let o=await this.header();let l=await this.format();let u=await this.error()||await this.hint();let f=await this.renderChoices();let h=await this.footer();if(l||!u)a+=" "+l;if(u&&!a.includes(u))a+=" "+u;if(e&&!l&&!f&&this.multiple&&this.type!=="form"){a+=this.styles.danger(this.emptyError)}this.clear(t);this.write([a,o,f,h].filter(Boolean).join("\n"));this.restore()}submit(){this.value={};for(let e of this.choices){this.value[e.name]=e.scaleIdx}return this.base.submit.call(this)}}function createScale(e,t={}){if(Array.isArray(t.scale)){return t.scale.map((e=>({...e})))}let n=[];for(let t=1;t{e.exports=n(338)},1394:(e,t,n)=>{"use strict";const i=n(3055);class TogglePrompt extends i{async initialize(){await super.initialize();this.value=this.initial=this.resolve(this.options.initial);this.disabled=this.options.disabled||"no";this.enabled=this.options.enabled||"yes";await this.render()}reset(){this.value=this.initial;this.render()}delete(){this.alert()}toggle(){this.value=!this.value;this.render()}enable(){if(this.value===true)return this.alert();this.value=true;this.render()}disable(){if(this.value===false)return this.alert();this.value=false;this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(e="",t){switch(e.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:{return this.alert()}}}format(){let active=e=>this.styles.primary.underline(e);let e=[this.value?this.disabled:active(this.disabled),this.value?active(this.enabled):this.enabled];return e.join(this.styles.muted(" / "))}async render(){let{size:e}=this.state;let t=await this.header();let n=await this.prefix();let i=await this.separator();let s=await this.message();let a=await this.format();let o=await this.error()||await this.hint();let l=await this.footer();let u=[n,s,i,a].join(" ");this.state.prompt=u;if(o&&!u.includes(o))u+=" "+o;this.clear(e);this.write([t,u,l].filter(Boolean).join("\n"));this.write(this.margin[2]);this.restore()}}e.exports=TogglePrompt},5404:e=>{"use strict";e.exports=class Queue{_queue=[];_executing=false;_jobRunner=null;constructor(e){this._jobRunner=e}enqueue=(...e)=>{this._queue.push(e);this._dequeue()};destroy(){this._queue.length=0;this._jobRunner=null}_dequeue(){if(this._executing||!this._queue.length)return;this._executing=true;this._jobRunner(...this._queue.shift());setTimeout((()=>{this._executing=false;this._dequeue()}))}}},1487:(e,t,n)=>{"use strict";const i=n(8527);const s={default(e,t){return t},checkbox(e,t){throw new Error("checkbox role is not implemented yet")},editable(e,t){throw new Error("editable role is not implemented yet")},expandable(e,t){throw new Error("expandable role is not implemented yet")},heading(e,t){t.disabled="";t.indicator=[t.indicator," "].find((e=>e!=null));t.message=t.message||"";return t},input(e,t){throw new Error("input role is not implemented yet")},option(e,t){return s.default(e,t)},radio(e,t){throw new Error("radio role is not implemented yet")},separator(e,t){t.disabled="";t.indicator=[t.indicator," "].find((e=>e!=null));t.message=t.message||e.symbols.line.repeat(5);return t},spacer(e,t){return t}};e.exports=(e,t={})=>{let n=i.merge({},s,t.roles);return n[e]||n.default}},1686:(e,t,n)=>{"use strict";const{define:i,width:s}=n(8527);class State{constructor(e){let t=e.options;i(this,"_prompt",e);this.type=e.type;this.name=e.name;this.message="";this.header="";this.footer="";this.error="";this.hint="";this.input="";this.cursor=0;this.index=0;this.lines=0;this.tick=0;this.prompt="";this.buffer="";this.width=s(t.stdout||process.stdout);Object.assign(this,t);this.name=this.name||this.message;this.message=this.message||this.name;this.symbols=e.symbols;this.styles=e.styles;this.required=new Set;this.cancelled=false;this.submitted=false}clone(){let e={...this};e.status=this.status;e.buffer=Buffer.from(e.buffer);delete e.clone;return e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let t=this._color||e[this.status];return typeof t==="function"?t:e.pending}set loading(e){this._loading=e}get loading(){if(typeof this._loading==="boolean")return this._loading;if(this.loadingChoices)return"choices";return false}get status(){if(this.cancelled)return"cancelled";if(this.submitted)return"submitted";return"pending"}}e.exports=State},3751:(e,t,n)=>{"use strict";const i=n(8527);const s=n(9151);const a={default:s.noop,noop:s.noop,set inverse(e){this._inverse=e},get inverse(){return this._inverse||i.inverse(this.primary)},set complement(e){this._complement=e},get complement(){return this._complement||i.complement(this.primary)},primary:s.cyan,success:s.green,danger:s.magenta,strong:s.bold,warning:s.yellow,muted:s.dim,disabled:s.gray,dark:s.dim.gray,underline:s.underline,set info(e){this._info=e},get info(){return this._info||this.primary},set em(e){this._em=e},get em(){return this._em||this.primary.underline},set heading(e){this._heading=e},get heading(){return this._heading||this.muted.underline},set pending(e){this._pending=e},get pending(){return this._pending||this.primary},set submitted(e){this._submitted=e},get submitted(){return this._submitted||this.success},set cancelled(e){this._cancelled=e},get cancelled(){return this._cancelled||this.danger},set typing(e){this._typing=e},get typing(){return this._typing||this.dim},set placeholder(e){this._placeholder=e},get placeholder(){return this._placeholder||this.primary.dim},set highlight(e){this._highlight=e},get highlight(){return this._highlight||this.inverse}};a.merge=(e={})=>{if(e.styles&&typeof e.styles.enabled==="boolean"){s.enabled=e.styles.enabled}if(e.styles&&typeof e.styles.visible==="boolean"){s.visible=e.styles.visible}let t=i.merge({},a,e.styles);delete t.merge;for(let e of Object.keys(s)){if(!hasOwnProperty.call(t,e)){Reflect.defineProperty(t,e,{get:()=>s[e]})}}for(let e of Object.keys(s.styles)){if(!hasOwnProperty.call(t,e)){Reflect.defineProperty(t,e,{get:()=>s[e]})}}return t};e.exports=a},5586:(e,t,n)=>{"use strict";const i=process.platform==="win32";const s=n(9151);const a=n(8527);const o={...s.symbols,upDownDoubleArrow:"⇕",upDownDoubleArrow2:"⬍",upDownArrow:"↕",asterisk:"*",asterism:"⁂",bulletWhite:"◦",electricArrow:"⌁",ellipsisLarge:"⋯",ellipsisSmall:"…",fullBlock:"█",identicalTo:"≡",indicator:s.symbols.check,leftAngle:"‹",mark:"※",minus:"−",multiplication:"×",obelus:"÷",percent:"%",pilcrow:"¶",pilcrow2:"❡",pencilUpRight:"✐",pencilDownRight:"✎",pencilRight:"✏",plus:"+",plusMinus:"±",pointRight:"☞",rightAngle:"›",section:"§",hexagon:{off:"⬡",on:"⬢",disabled:"⬢"},ballot:{on:"☑",off:"☐",disabled:"☒"},stars:{on:"★",off:"☆",disabled:"☆"},folder:{on:"▼",off:"▶",disabled:"▶"},prefix:{pending:s.symbols.question,submitted:s.symbols.check,cancelled:s.symbols.cross},separator:{pending:s.symbols.pointerSmall,submitted:s.symbols.middot,cancelled:s.symbols.middot},radio:{off:i?"( )":"◯",on:i?"(*)":"◉",disabled:i?"(|)":"Ⓘ"},numbers:["⓪","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳","㉑","㉒","㉓","㉔","㉕","㉖","㉗","㉘","㉙","㉚","㉛","㉜","㉝","㉞","㉟","㊱","㊲","㊳","㊴","㊵","㊶","㊷","㊸","㊹","㊺","㊻","㊼","㊽","㊾","㊿"]};o.merge=e=>{let t=a.merge({},s.symbols,o,e.symbols);delete t.merge;return t};e.exports=o},6739:(e,t,n)=>{"use strict";const i=n(3751);const s=n(5586);const a=n(8527);e.exports=e=>{e.options=a.merge({},e.options.theme,e.options);e.symbols=s.merge(e.options);e.styles=i.merge(e.options)}},7711:e=>{"use strict";e.exports=e=>{e.timers=e.timers||{};let t=e.options.timers;if(!t)return;for(let n of Object.keys(t)){let i=t[n];if(typeof i==="number"){i={interval:i}}create(e,n,i)}};function create(e,t,n={}){let i=e.timers[t]={name:t,start:Date.now(),ms:0,tick:0};let s=n.interval||120;i.frames=n.frames||[];i.loading=true;let a=setInterval((()=>{i.ms=Date.now()-i.start;i.tick++;e.render()}),s);i.stop=()=>{i.loading=false;clearInterval(a)};Reflect.defineProperty(i,"interval",{value:a});e.once("close",(()=>i.stop()));return i.stop}},7633:(e,t,n)=>{"use strict";const i=n(5591);const s=n(7072);const a=n(1487);const o=n(8527);const{reorder:l,scrollUp:u,scrollDown:f,isObject:h,swap:d}=o;class ArrayPrompt extends s{constructor(e){super(e);this.cursorHide();this.maxSelected=e.maxSelected||Infinity;this.multiple=e.multiple||false;this.initial=e.initial||0;this.delay=e.delay||0;this.longest=0;this.num=""}async initialize(){if(typeof this.options.initial==="function"){this.initial=await this.options.initial.call(this)}await this.reset(true);await super.initialize()}async reset(){let{choices:e,initial:t,autofocus:n,suggest:i}=this.options;this.state._choices=[];this.state.choices=[];this.choices=await Promise.all(await this.toChoices(e));this.choices.forEach((e=>e.enabled=false));if(typeof i!=="function"&&this.selectable.length===0){throw new Error("At least one choice must be selectable")}if(h(t))t=Object.keys(t);if(Array.isArray(t)){if(n!=null)this.index=this.findIndex(n);t.forEach((e=>this.enable(this.find(e))));await this.render()}else{if(n!=null)t=n;if(typeof t==="string")t=this.findIndex(t);if(typeof t==="number"&&t>-1){this.index=Math.max(0,Math.min(t,this.choices.length));this.enable(this.find(this.index))}}if(this.isDisabled(this.focused)){await this.down()}}async toChoices(e,t){this.state.loadingChoices=true;let n=[];let i=0;let toChoices=async(e,t)=>{if(typeof e==="function")e=await e.call(this);if(e instanceof Promise)e=await e;for(let s=0;s{this.state.loadingChoices=false;return e}))}async toChoice(e,t,n){if(typeof e==="function")e=await e.call(this,this);if(e instanceof Promise)e=await e;if(typeof e==="string")e={name:e};if(e.normalized)return e;e.normalized=true;let s=e.value;let l=a(e.role,this.options);e=l(this,e);if(typeof e.disabled==="string"&&!e.hint){e.hint=e.disabled;e.disabled=true}if(e.disabled===true&&e.hint==null){e.hint="(disabled)"}if(e.index!=null)return e;e.name=e.name||e.key||e.title||e.value||e.message;e.message=e.message||e.name||"";e.value=[e.value,e.name].find(this.isValue.bind(this));e.input="";e.index=t;e.cursor=0;o.define(e,"parent",n);e.level=n?n.level+1:1;if(e.indent==null){e.indent=n?n.indent+" ":e.indent||""}e.path=n?n.path+"."+e.name:e.name;e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e)));if(!this.isDisabled(e)){this.longest=Math.max(this.longest,i(e.message).length)}let u={...e};e.reset=(t=u.input,n=u.value)=>{for(let t of Object.keys(u))e[t]=u[t];e.input=t;e.value=n};if(s==null&&typeof e.initial==="function"){e.input=await e.initial.call(this,this.state,e,t)}return e}async onChoice(e,t){this.emit("choice",e,t,this);if(typeof e.onChoice==="function"){await e.onChoice.call(this,this.state,e,t)}}async addChoice(e,t,n){let i=await this.toChoice(e,t,n);this.choices.push(i);this.index=this.choices.length-1;this.limit=this.choices.length;return i}async newItem(e,t,n){let i={name:"New choice name?",editable:true,newChoice:true,...e};let s=await this.addChoice(i,t,n);s.updateChoice=()=>{delete s.newChoice;s.name=s.message=s.input;s.input="";s.cursor=0};return this.render()}indent(e){if(e.indent==null){return e.level>1?" ".repeat(e.level-1):""}return e.indent}dispatch(e,t){if(this.multiple&&this[t.name])return this[t.name]();this.alert()}focus(e,t){if(typeof t!=="boolean")t=e.enabled;if(t&&!e.enabled&&this.selected.length>=this.maxSelected){return this.alert()}this.index=e.index;e.enabled=t&&!this.isDisabled(e);return e}space(){if(!this.multiple)return this.alert();if(!this.focused)return;this.toggle(this.focused);return this.render()}a(){if(this.maxSelectede.enabled));this.choices.forEach((t=>t.enabled=!e));return this.render()}i(){if(this.choices.length-this.selected.length>this.maxSelected){return this.alert()}this.choices.forEach((e=>e.enabled=!e.enabled));return this.render()}g(){if(!this.choices.some((e=>!!e.parent)))return this.a();const e=this.focused;this.toggle(e.parent&&!e.choices?e.parent:e);return this.render()}toggle(e,t){if(!e.enabled&&this.selected.length>=this.maxSelected){return this.alert()}if(typeof t!=="boolean")t=!e.enabled;e.enabled=t;if(e.choices){e.choices.forEach((e=>this.toggle(e,t)))}let n=e.parent;while(n){let e=n.choices.filter((e=>this.isDisabled(e)));n.enabled=e.every((e=>e.enabled===true));n=n.parent}reset(this,this.choices);this.emit("toggle",e,this);return e}enable(e){if(this.selected.length>=this.maxSelected)return this.alert();e.enabled=!this.isDisabled(e);e.choices&&e.choices.forEach(this.enable.bind(this));return e}disable(e){e.enabled=false;e.choices&&e.choices.forEach(this.disable.bind(this));return e}number(e){this.num+=e;let number=e=>{let t=Number(e);if(t>this.choices.length-1)return this.alert();let n=this.focused;let i=this.choices.find((e=>t===e.index));if(!i.enabled&&this.selected.length>=this.maxSelected){return this.alert()}if(this.visible.indexOf(i)===-1){let e=l(this.choices);let t=e.indexOf(i);if(n.index>t){let n=e.slice(t,t+this.limit);let i=e.filter((e=>!n.includes(e)));this.choices=n.concat(i)}else{let n=t-this.limit+1;this.choices=e.slice(n).concat(e.slice(0,n))}}this.index=this.choices.indexOf(i);this.toggle(this.focused);return this.render()};clearTimeout(this.numberTimeout);return new Promise((e=>{let t=this.choices.length;let n=this.num;let handle=(t=false,i)=>{clearTimeout(this.numberTimeout);if(t)i=number(n);this.num="";e(i)};if(n==="0"||n.length===1&&Number(n+"0")>t){return handle(true)}if(Number(n)>t){return handle(false,this.alert())}this.numberTimeout=setTimeout((()=>handle(true)),this.delay)}))}home(){this.choices=l(this.choices);this.index=0;return this.render()}end(){let e=this.choices.length-this.limit;let t=l(this.choices);this.choices=t.slice(e).concat(t.slice(0,e));this.index=this.limit-1;return this.render()}first(){this.index=0;return this.render()}last(){this.index=this.visible.length-1;return this.render()}prev(){if(this.visible.length<=1)return this.alert();return this.up()}next(){if(this.visible.length<=1)return this.alert();return this.down()}right(){if(this.cursor>=this.input.length)return this.alert();this.cursor++;return this.render()}left(){if(this.cursor<=0)return this.alert();this.cursor--;return this.render()}up(){let e=this.choices.length;let t=this.visible.length;let n=this.index;if(this.options.scroll===false&&n===0){return this.alert()}if(e>t&&n===0){return this.scrollUp()}this.index=(n-1%e+e)%e;if(this.isDisabled()&&!this.allChoicesAreDisabled()){return this.up()}return this.render()}down(){let e=this.choices.length;let t=this.visible.length;let n=this.index;if(this.options.scroll===false&&n===t-1){return this.alert()}if(e>t&&n===t-1){return this.scrollDown()}this.index=(n+1)%e;if(this.isDisabled()&&!this.allChoicesAreDisabled()){return this.down()}return this.render()}scrollUp(e=0){this.choices=u(this.choices);this.index=e;if(this.isDisabled()){return this.up()}return this.render()}scrollDown(e=this.visible.length-1){this.choices=f(this.choices);this.index=e;if(this.isDisabled()){return this.down()}return this.render()}async shiftUp(){if(this.options.sort===true){this.sorting=true;this.swap(this.index-1);await this.up();this.sorting=false;return}return this.scrollUp(this.index)}async shiftDown(){if(this.options.sort===true){this.sorting=true;this.swap(this.index+1);await this.down();this.sorting=false;return}return this.scrollDown(this.index)}pageUp(){if(this.visible.length<=1)return this.alert();this.limit=Math.max(this.limit-1,0);this.index=Math.min(this.limit-1,this.index);this._limit=this.limit;if(this.isDisabled()){return this.up()}return this.render()}pageDown(){if(this.visible.length>=this.choices.length)return this.alert();this.index=Math.max(0,this.index);this.limit=Math.min(this.limit+1,this.choices.length);this._limit=this.limit;if(this.isDisabled()){return this.down()}return this.render()}swap(e){d(this.choices,this.index,e)}allChoicesAreDisabled(e=this.choices){return e.every((e=>this.isDisabled(e)))}isDisabled(e=this.focused){let t=["disabled","collapsed","hidden","completing","readonly"];if(e&&t.some((t=>e[t]===true))){return true}return e&&e.role==="heading"}isEnabled(e=this.focused){if(Array.isArray(e))return e.every((e=>this.isEnabled(e)));if(e.choices){let t=e.choices.filter((e=>!this.isDisabled(e)));return e.enabled&&t.every((e=>this.isEnabled(e)))}return e.enabled&&!this.isDisabled(e)}isChoice(e,t){return e.name===t||e.index===Number(t)}isSelected(e){if(Array.isArray(this.initial)){return this.initial.some((t=>this.isChoice(e,t)))}return this.isChoice(e,this.initial)}map(e=[],t="value"){return[].concat(e||[]).reduce(((e,n)=>{e[n]=this.find(n,t);return e}),{})}filter(e,t){let isChoice=(t,n)=>[t.name,n].includes(e);let n=typeof e==="function"?e:isChoice;let i=this.options.multiple?this.state._choices:this.choices;let s=i.filter(n);if(t){return s.map((e=>e[t]))}return s}find(e,t){if(h(e))return t?e[t]:e;let isChoice=(t,n)=>[t.name,n].includes(e);let n=typeof e==="function"?e:isChoice;let i=this.choices.find(n);if(i){return t?i[t]:i}}findIndex(e){return this.choices.indexOf(this.find(e))}async submit(){let e=this.focused;if(!e)return this.alert();if(e.newChoice){if(!e.input)return this.alert();e.updateChoice();return this.render()}if(this.choices.some((e=>e.newChoice))){return this.alert()}let{reorder:t,sort:n}=this.options;let i=this.multiple===true;let s=this.selected;if(s===void 0){return this.alert()}if(Array.isArray(s)&&t!==false&&n!==true){s=o.reorder(s)}this.value=i?s.map((e=>e.name)):s.name;return super.submit()}set choices(e=[]){this.state._choices=this.state._choices||[];this.state.choices=e;for(let t of e){if(!this.state._choices.some((e=>e.name===t.name))){this.state._choices.push(t)}}if(!this._initial&&this.options.initial){this._initial=true;let e=this.initial;if(typeof e==="string"||typeof e==="number"){let t=this.find(e);if(t){this.initial=t.index;this.focus(t,true)}}}}get choices(){return reset(this,this.state.choices||[])}set visible(e){this.state.visible=e}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(e){this.state.limit=e}get limit(){let{state:e,options:t,choices:n}=this;let i=e.limit||this._limit||t.limit||n.length;return Math.min(i,this.height)}set value(e){super.value=e}get value(){if(typeof super.value!=="string"&&super.value===this.initial){return this.input}return super.value}set index(e){this.state.index=e}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let e=this.choices[this.index];if(e&&this.state.submitted&&this.multiple!==true){e.enabled=true}return e}get selectable(){return this.choices.filter((e=>!this.isDisabled(e)))}get selected(){return this.multiple?this.enabled:this.focused}}function reset(e,t){if(t instanceof Promise)return t;if(typeof t==="function"){if(o.isAsyncFn(t))return t;t=t.call(e,e)}for(let n of t){if(Array.isArray(n.choices)){let t=n.choices.filter((t=>!e.isDisabled(t)));n.enabled=t.every((e=>e.enabled===true))}if(e.isDisabled(n)===true){delete n.enabled}}return t}e.exports=ArrayPrompt},3315:(e,t,n)=>{"use strict";const i=n(1787);const defaultAuthenticate=()=>{throw new Error("expected prompt to have a custom authenticate method")};const factory=(e=defaultAuthenticate)=>{class AuthPrompt extends i{constructor(e){super(e)}async submit(){this.value=await e.call(this,this.values,this.state);super.base.submit.call(this)}static create(e){return factory(e)}}return AuthPrompt};e.exports=factory()},3055:(e,t,n)=>{"use strict";const i=n(7072);const{isPrimitive:s,hasColor:a}=n(8527);class BooleanPrompt extends i{constructor(e){super(e);this.cursorHide()}async initialize(){let e=await this.resolve(this.initial,this.state);this.input=await this.cast(e);await super.initialize()}dispatch(e){if(!this.isValue(e))return this.alert();this.input=e;return this.submit()}format(e){let{styles:t,state:n}=this;return!n.submitted?t.primary(e):t.success(e)}cast(e){return this.isTrue(e)}isTrue(e){return/^[ty1]/i.test(e)}isFalse(e){return/^[fn0]/i.test(e)}isValue(e){return s(e)&&(this.isTrue(e)||this.isFalse(e))}async hint(){if(this.state.status==="pending"){let e=await this.element("hint");if(!a(e)){return this.styles.muted(e)}return e}}async render(){let{input:e,size:t}=this.state;let n=await this.prefix();let i=await this.separator();let s=await this.message();let a=this.styles.muted(this.default);let o=[n,s,a,i].filter(Boolean).join(" ");this.state.prompt=o;let l=await this.header();let u=this.value=this.cast(e);let f=await this.format(u);let h=await this.error()||await this.hint();let d=await this.footer();if(h&&!o.includes(h))f+=" "+h;o+=" "+f;this.clear(t);this.write([l,o,d].filter(Boolean).join("\n"));this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}}e.exports=BooleanPrompt},891:(e,t,n)=>{e.exports={ArrayPrompt:n(7633),AuthPrompt:n(3315),BooleanPrompt:n(3055),NumberPrompt:n(7572),StringPrompt:n(1401)}},7572:(e,t,n)=>{"use strict";const i=n(1401);class NumberPrompt extends i{constructor(e={}){super({style:"number",...e});this.min=this.isValue(e.min)?this.toNumber(e.min):-Infinity;this.max=this.isValue(e.max)?this.toNumber(e.max):Infinity;this.delay=e.delay!=null?e.delay:1e3;this.float=e.float!==false;this.round=e.round===true||e.float===false;this.major=e.major||10;this.minor=e.minor||1;this.initial=e.initial!=null?e.initial:"";this.input=String(this.initial);this.cursor=this.input.length;this.cursorShow()}append(e){if(!/[-+.]/.test(e)||e==="."&&this.input.includes(".")){return this.alert("invalid number")}return super.append(e)}number(e){return super.append(e)}next(){if(this.input&&this.input!==this.initial)return this.alert();if(!this.isValue(this.initial))return this.alert();this.input=this.initial;this.cursor=String(this.initial).length;return this.render()}up(e){let t=e||this.minor;let n=this.toNumber(this.input);if(n>this.max+t)return this.alert();this.input=`${n+t}`;return this.render()}down(e){let t=e||this.minor;let n=this.toNumber(this.input);if(nthis.isValue(e)));this.value=this.toNumber(e||0);return super.submit()}}e.exports=NumberPrompt},1401:(e,t,n)=>{"use strict";const i=n(7072);const s=n(4162);const a=n(9690);const{isPrimitive:o}=n(8527);class StringPrompt extends i{constructor(e){super(e);this.initial=o(this.initial)?String(this.initial):"";if(this.initial)this.cursorHide();this.state.prevCursor=0;this.state.clipboard=[];this.keypressTimeout=this.options.keypressTimeout!==undefined?this.options.keypressTimeout:null}async keypress(e,t=(e?s(e,{}):{})){const n=Date.now();const i=n-this.lastKeypress;this.lastKeypress=n;const a=t.name==="return"||t.name==="enter";let o=this.state.prevKeypress;let l;this.state.prevKeypress=t;if(this.keypressTimeout!=null&&a){if(i=this.input.length)return this.alert();this.moveCursor(1);return this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1);return this.render()}isValue(e){return!!e}async format(e=this.value){let t=await this.resolve(this.initial,this.state);if(!this.state.submitted){return a(this,{input:e,initial:t,pos:this.cursor})}return this.styles.submitted(e||t)}async render(){let e=this.state.size;let t=await this.prefix();let n=await this.separator();let i=await this.message();let s=[t,i,n].filter(Boolean).join(" ");this.state.prompt=s;let a=await this.header();let o=await this.format();let l=await this.error()||await this.hint();let u=await this.footer();if(l&&!o.includes(l))o+=" "+l;s+=" "+o;this.clear(e);this.write([a,s,u].filter(Boolean).join("\n"));this.restore()}}e.exports=StringPrompt},8527:(e,t,n)=>{"use strict";const i=Object.prototype.toString;const s=n(9151);let a=false;let o=new Set;const l={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};t.longest=(e,t)=>e.reduce(((e,n)=>Math.max(e,t?n[t].length:n.length)),0);t.hasColor=e=>!!e&&s.hasColor(e);const u=t.isObject=e=>e!==null&&typeof e==="object"&&!Array.isArray(e);t.nativeType=e=>i.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"");t.isAsyncFn=e=>t.nativeType(e)==="asyncfunction";t.isPrimitive=e=>e!=null&&typeof e!=="object"&&typeof e!=="function";t.resolve=(e,t,...n)=>{if(typeof t==="function"){return t.call(e,...n)}return t};t.scrollDown=(e=[])=>[...e.slice(1),e[0]];t.scrollUp=(e=[])=>[e.pop(),...e];t.reorder=(e=[])=>{let t=e.slice();t.sort(((e,t)=>{if(e.index>t.index)return 1;if(e.index{let i=e.length;let s=n===i?0:n<0?i-1:n;let a=e[t];e[t]=e[s];e[s]=a};t.width=(e,t=80)=>{let n=e&&e.columns?e.columns:t;if(e&&typeof e.getWindowSize==="function"){n=e.getWindowSize()[0]}if(process.platform==="win32"){return n-1}return n};t.height=(e,t=20)=>{let n=e&&e.rows?e.rows:t;if(e&&typeof e.getWindowSize==="function"){n=e.getWindowSize()[1]}return n};t.wordWrap=(e,t={})=>{if(!e)return e;if(typeof t==="number"){t={width:t}}let{indent:n="",newline:i="\n"+n,width:s=80}=t;let a=(i+n).match(/[^\S\n]/g)||[];s-=a.length;let o=`.{1,${s}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`;let l=e.trim();let u=new RegExp(o,"g");let f=l.match(u)||[];f=f.map((e=>e.replace(/\n$/,"")));if(t.padEnd)f=f.map((e=>e.padEnd(s," ")));if(t.padStart)f=f.map((e=>e.padStart(s," ")));return n+f.join(i)};t.unmute=e=>{let t=e.stack.find((e=>s.keys.color.includes(e)));if(t){return s[t]}let n=e.stack.find((e=>e.slice(2)==="bg"));if(n){return s[t.slice(2)]}return e=>e};t.pascal=e=>e?e[0].toUpperCase()+e.slice(1):"";t.inverse=e=>{if(!e||!e.stack)return e;let n=e.stack.find((e=>s.keys.color.includes(e)));if(n){let i=s["bg"+t.pascal(n)];return i?i.black:e}let i=e.stack.find((e=>e.slice(0,2)==="bg"));if(i){return s[i.slice(2).toLowerCase()]||e}return s.none};t.complement=e=>{if(!e||!e.stack)return e;let n=e.stack.find((e=>s.keys.color.includes(e)));let i=e.stack.find((e=>e.slice(0,2)==="bg"));if(n&&!i){return s[l[n]||n]}if(i){let n=i.slice(2).toLowerCase();let a=l[n];if(!a)return e;return s["bg"+t.pascal(a)]||e}return s.none};t.meridiem=e=>{let t=e.getHours();let n=e.getMinutes();let i=t>=12?"pm":"am";t=t%12;let s=t===0?12:t;let a=n<10?"0"+n:n;return s+":"+a+" "+i};t.set=(e={},n="",i)=>n.split(".").reduce(((e,n,s,a)=>{let o=a.length-1>s?e[n]||{}:i;if(!t.isObject(o)&&s{let i=e[t]==null?t.split(".").reduce(((e,t)=>e&&e[t]),e):e[t];return i==null?n:i};t.mixin=(e,n)=>{if(!u(e))return n;if(!u(n))return e;for(let i of Object.keys(n)){let s=Object.getOwnPropertyDescriptor(n,i);if(hasOwnProperty.call(s,"value")){if(hasOwnProperty.call(e,i)&&u(s.value)){let a=Object.getOwnPropertyDescriptor(e,i);if(u(a.value)&&a.value!==s.value){e[i]=t.merge({},e[i],n[i])}else{Reflect.defineProperty(e,i,s)}}else{Reflect.defineProperty(e,i,s)}}else{Reflect.defineProperty(e,i,s)}}return e};t.merge=(...e)=>{let n={};for(let i of e)t.mixin(n,i);return n};t.mixinEmitter=(e,n)=>{let i=n.constructor.prototype;for(let s of Object.keys(i)){let a=i[s];if(typeof a==="function"){t.define(e,s,a.bind(n))}else{t.define(e,s,a)}}};const onExit=(e,t)=>{if(a)return;a=true;o.forEach((e=>e()));if(e===true){process.exit(128+t)}};const f=onExit.bind(null,true,15);const h=onExit.bind(null,true,2);t.onExit=e=>{if(o.size===0){process.once("SIGTERM",f);process.once("SIGINT",h);process.once("exit",onExit)}o.add(e);return()=>{o.delete(e);if(o.size===0){process.off("SIGTERM",f);process.off("SIGINT",h);process.off("exit",onExit)}}};t.define=(e,t,n)=>{Reflect.defineProperty(e,t,{value:n})};t.defineExport=(e,t,n)=>{let i;Reflect.defineProperty(e,t,{enumerable:true,configurable:true,set(e){i=e},get(){return i?i():n()}})}},8691:e=>{"use strict";var t=/[|\\{}()[\]^$+*?.]/g;e.exports=function(e){if(typeof e!=="string"){throw new TypeError("Expected a string")}return e.replace(t,"\\$&")}},3338:(e,t,n)=>{"use strict";const i=n(7758);const s=n(1017);const a=n(8605).mkdirsSync;const o=n(2548).utimesMillisSync;const l=Symbol("notExist");const u=Symbol("existsReg");function copySync(e,t,n){if(typeof n==="function"){n={filter:n}}n=n||{};n.clobber="clobber"in n?!!n.clobber:true;n.overwrite="overwrite"in n?!!n.overwrite:n.clobber;if(n.preserveTimestamps&&process.arch==="ia32"){console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)}e=s.resolve(e);t=s.resolve(t);if(e===t)throw new Error("Source and destination must not be the same.");if(n.filter&&!n.filter(e,t))return;const o=s.dirname(t);if(!i.existsSync(o))a(o);return startCopy(e,t,n)}function startCopy(e,t,n){if(n.filter&&!n.filter(e,t))return;return getStats(e,t,n)}function getStats(e,t,n){const s=n.dereference?i.statSync:i.lstatSync;const a=s(e);if(a.isDirectory())return onDir(a,e,t,n);else if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return onFile(a,e,t,n);else if(a.isSymbolicLink())return onLink(e,t,n)}function onFile(e,t,n,i){const s=checkDest(n);if(s===l){return copyFile(e,t,n,i)}else if(s===u){return mayCopyFile(e,t,n,i)}else{if(t===s)return;return mayCopyFile(e,t,n,i)}}function mayCopyFile(e,t,n,s){if(s.overwrite){i.unlinkSync(n);return copyFile(e,t,n,s)}else if(s.errorOnExist){throw new Error(`'${n}' already exists`)}}function copyFile(e,t,n,s){if(typeof i.copyFileSync==="function"){i.copyFileSync(t,n);i.chmodSync(n,e.mode);if(s.preserveTimestamps){return o(n,e.atime,e.mtime)}return}return copyFileFallback(e,t,n,s)}function copyFileFallback(e,t,s,a){const o=64*1024;const l=n(7696)(o);const u=i.openSync(t,"r");const f=i.openSync(s,"w",e.mode);let h=1;let d=0;while(h>0){h=i.readSync(u,l,0,o,d);i.writeSync(f,l,0,h);d+=h}if(a.preserveTimestamps)i.futimesSync(f,e.atime,e.mtime);i.closeSync(u);i.closeSync(f)}function onDir(e,t,n,i){const s=checkDest(n);if(s===l){if(isSrcSubdir(t,n)){throw new Error(`Cannot copy '${t}' to a subdirectory of itself, '${n}'.`)}return mkDirAndCopy(e,t,n,i)}else if(s===u){if(isSrcSubdir(t,n)){throw new Error(`Cannot copy '${t}' to a subdirectory of itself, '${n}'.`)}return mayCopyDir(t,n,i)}else{if(t===s)return;return copyDir(t,n,i)}}function mayCopyDir(e,t,n){if(!i.statSync(t).isDirectory()){throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`)}return copyDir(e,t,n)}function mkDirAndCopy(e,t,n,s){i.mkdirSync(n,e.mode);i.chmodSync(n,e.mode);return copyDir(t,n,s)}function copyDir(e,t,n){i.readdirSync(e).forEach((i=>{startCopy(s.join(e,i),s.join(t,i),n)}))}function onLink(e,t,n){let a=i.readlinkSync(e);if(n.dereference){a=s.resolve(process.cwd(),a)}let o=checkDest(t);if(o===l||o===u){return i.symlinkSync(a,t)}else{if(n.dereference){o=s.resolve(process.cwd(),o)}if(o===a)return;if(i.statSync(t).isDirectory()&&isSrcSubdir(o,a)){throw new Error(`Cannot overwrite '${o}' with '${a}'.`)}return copyLink(a,t)}}function copyLink(e,t){i.unlinkSync(t);return i.symlinkSync(e,t)}function checkDest(e){let t;try{t=i.readlinkSync(e)}catch(e){if(e.code==="ENOENT")return l;if(e.code==="EINVAL"||e.code==="UNKNOWN")return u;throw e}return t}function isSrcSubdir(e,t){const n=t.split(s.dirname(e)+s.sep)[1];if(n){const i=n.split(s.sep)[0];if(i){return e!==t&&t.indexOf(e)>-1&&i===s.basename(e)}return false}return false}e.exports=copySync},1135:(e,t,n)=>{e.exports={copySync:n(3338)}},8834:(e,t,n)=>{"use strict";const i=n(7758);const s=n(1017);const a=n(8605).mkdirs;const o=n(3835).pathExists;const l=n(2548).utimesMillis;const u=Symbol("notExist");const f=Symbol("existsReg");function copy(e,t,n,i){if(typeof n==="function"&&!i){i=n;n={}}else if(typeof n==="function"){n={filter:n}}i=i||function(){};n=n||{};n.clobber="clobber"in n?!!n.clobber:true;n.overwrite="overwrite"in n?!!n.overwrite:n.clobber;if(n.preserveTimestamps&&process.arch==="ia32"){console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)}e=s.resolve(e);t=s.resolve(t);if(e===t)return i(new Error("Source and destination must not be the same."));if(n.filter)return handleFilter(checkParentDir,e,t,n,i);return checkParentDir(e,t,n,i)}function checkParentDir(e,t,n,i){const l=s.dirname(t);o(l,((s,o)=>{if(s)return i(s);if(o)return startCopy(e,t,n,i);a(l,(s=>{if(s)return i(s);return startCopy(e,t,n,i)}))}))}function startCopy(e,t,n,i){if(n.filter)return handleFilter(getStats,e,t,n,i);return getStats(e,t,n,i)}function handleFilter(e,t,n,i,s){Promise.resolve(i.filter(t,n)).then((a=>{if(a)return e(t,n,i,s);return s()}),(e=>s(e)))}function getStats(e,t,n,s){const a=n.dereference?i.stat:i.lstat;a(e,((i,a)=>{if(i)return s(i);if(a.isDirectory())return onDir(a,e,t,n,s);else if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return onFile(a,e,t,n,s);else if(a.isSymbolicLink())return onLink(e,t,n,s)}))}function onFile(e,t,n,i,s){checkDest(n,((a,o)=>{if(a)return s(a);if(o===u){return copyFile(e,t,n,i,s)}else if(o===f){return mayCopyFile(e,t,n,i,s)}else{if(t===o)return s();return mayCopyFile(e,t,n,i,s)}}))}function mayCopyFile(e,t,n,s,a){if(s.overwrite){i.unlink(n,(i=>{if(i)return a(i);return copyFile(e,t,n,s,a)}))}else if(s.errorOnExist){return a(new Error(`'${n}' already exists`))}else return a()}function copyFile(e,t,n,s,a){if(typeof i.copyFile==="function"){return i.copyFile(t,n,(t=>{if(t)return a(t);return setDestModeAndTimestamps(e,n,s,a)}))}return copyFileFallback(e,t,n,s,a)}function copyFileFallback(e,t,n,s,a){const o=i.createReadStream(t);o.on("error",(e=>a(e))).once("open",(()=>{const t=i.createWriteStream(n,{mode:e.mode});t.on("error",(e=>a(e))).on("open",(()=>o.pipe(t))).once("close",(()=>setDestModeAndTimestamps(e,n,s,a)))}))}function setDestModeAndTimestamps(e,t,n,s){i.chmod(t,e.mode,(i=>{if(i)return s(i);if(n.preserveTimestamps){return l(t,e.atime,e.mtime,s)}return s()}))}function onDir(e,t,n,i,s){checkDest(n,((a,o)=>{if(a)return s(a);if(o===u){if(isSrcSubdir(t,n)){return s(new Error(`Cannot copy '${t}' to a subdirectory of itself, '${n}'.`))}return mkDirAndCopy(e,t,n,i,s)}else if(o===f){if(isSrcSubdir(t,n)){return s(new Error(`Cannot copy '${t}' to a subdirectory of itself, '${n}'.`))}return mayCopyDir(t,n,i,s)}else{if(t===o)return s();return copyDir(t,n,i,s)}}))}function mayCopyDir(e,t,n,s){i.stat(t,((i,a)=>{if(i)return s(i);if(!a.isDirectory()){return s(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`))}return copyDir(e,t,n,s)}))}function mkDirAndCopy(e,t,n,s,a){i.mkdir(n,e.mode,(o=>{if(o)return a(o);i.chmod(n,e.mode,(e=>{if(e)return a(e);return copyDir(t,n,s,a)}))}))}function copyDir(e,t,n,s){i.readdir(e,((i,a)=>{if(i)return s(i);return copyDirItems(a,e,t,n,s)}))}function copyDirItems(e,t,n,i,a){const o=e.pop();if(!o)return a();startCopy(s.join(t,o),s.join(n,o),i,(s=>{if(s)return a(s);return copyDirItems(e,t,n,i,a)}))}function onLink(e,t,n,a){i.readlink(e,((e,o)=>{if(e)return a(e);if(n.dereference){o=s.resolve(process.cwd(),o)}checkDest(t,((e,l)=>{if(e)return a(e);if(l===u||l===f){return i.symlink(o,t,a)}else{if(n.dereference){l=s.resolve(process.cwd(),l)}if(l===o)return a();i.stat(t,((e,n)=>{if(e)return a(e);if(n.isDirectory()&&isSrcSubdir(l,o)){return a(new Error(`Cannot overwrite '${l}' with '${o}'.`))}return copyLink(o,t,a)}))}}))}))}function copyLink(e,t,n){i.unlink(t,(s=>{if(s)return n(s);return i.symlink(e,t,n)}))}function checkDest(e,t){i.readlink(e,((e,n)=>{if(e){if(e.code==="ENOENT")return t(null,u);if(e.code==="EINVAL"||e.code==="UNKNOWN")return t(null,f);return t(e)}return t(null,n)}))}function isSrcSubdir(e,t){const n=t.split(s.dirname(e)+s.sep)[1];if(n){const i=n.split(s.sep)[0];if(i){return e!==t&&t.indexOf(e)>-1&&i===s.basename(e)}return false}return false}e.exports=copy},1335:(e,t,n)=>{const i=n(9046).E;e.exports={copy:i(n(8834))}},6970:(e,t,n)=>{"use strict";const i=n(9046).E;const s=n(7147);const a=n(1017);const o=n(8605);const l=n(7357);const u=i((function emptyDir(e,t){t=t||function(){};s.readdir(e,((n,i)=>{if(n)return o.mkdirs(e,t);i=i.map((t=>a.join(e,t)));deleteItem();function deleteItem(){const e=i.pop();if(!e)return t();l.remove(e,(e=>{if(e)return t(e);deleteItem()}))}}))}));function emptyDirSync(e){let t;try{t=s.readdirSync(e)}catch(t){return o.mkdirsSync(e)}t.forEach((t=>{t=a.join(e,t);l.removeSync(t)}))}e.exports={emptyDirSync:emptyDirSync,emptydirSync:emptyDirSync,emptyDir:u,emptydir:u}},2164:(e,t,n)=>{"use strict";const i=n(9046).E;const s=n(1017);const a=n(7758);const o=n(8605);const l=n(3835).pathExists;function createFile(e,t){function makeFile(){a.writeFile(e,"",(e=>{if(e)return t(e);t()}))}a.stat(e,((n,i)=>{if(!n&&i.isFile())return t();const a=s.dirname(e);l(a,((e,n)=>{if(e)return t(e);if(n)return makeFile();o.mkdirs(a,(e=>{if(e)return t(e);makeFile()}))}))}))}function createFileSync(e){let t;try{t=a.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=s.dirname(e);if(!a.existsSync(n)){o.mkdirsSync(n)}a.writeFileSync(e,"")}e.exports={createFile:i(createFile),createFileSync:createFileSync}},55:(e,t,n)=>{"use strict";const i=n(2164);const s=n(3797);const a=n(2549);e.exports={createFile:i.createFile,createFileSync:i.createFileSync,ensureFile:i.createFile,ensureFileSync:i.createFileSync,createLink:s.createLink,createLinkSync:s.createLinkSync,ensureLink:s.createLink,ensureLinkSync:s.createLinkSync,createSymlink:a.createSymlink,createSymlinkSync:a.createSymlinkSync,ensureSymlink:a.createSymlink,ensureSymlinkSync:a.createSymlinkSync}},3797:(e,t,n)=>{"use strict";const i=n(9046).E;const s=n(1017);const a=n(7758);const o=n(8605);const l=n(3835).pathExists;function createLink(e,t,n){function makeLink(e,t){a.link(e,t,(e=>{if(e)return n(e);n(null)}))}l(t,((i,u)=>{if(i)return n(i);if(u)return n(null);a.lstat(e,((i,a)=>{if(i){i.message=i.message.replace("lstat","ensureLink");return n(i)}const u=s.dirname(t);l(u,((i,s)=>{if(i)return n(i);if(s)return makeLink(e,t);o.mkdirs(u,(i=>{if(i)return n(i);makeLink(e,t)}))}))}))}))}function createLinkSync(e,t,n){const i=a.existsSync(t);if(i)return undefined;try{a.lstatSync(e)}catch(e){e.message=e.message.replace("lstat","ensureLink");throw e}const l=s.dirname(t);const u=a.existsSync(l);if(u)return a.linkSync(e,t);o.mkdirsSync(l);return a.linkSync(e,t)}e.exports={createLink:i(createLink),createLinkSync:createLinkSync}},3727:(e,t,n)=>{"use strict";const i=n(1017);const s=n(7758);const a=n(3835).pathExists;function symlinkPaths(e,t,n){if(i.isAbsolute(e)){return s.lstat(e,((t,i)=>{if(t){t.message=t.message.replace("lstat","ensureSymlink");return n(t)}return n(null,{toCwd:e,toDst:e})}))}else{const o=i.dirname(t);const l=i.join(o,e);return a(l,((t,a)=>{if(t)return n(t);if(a){return n(null,{toCwd:l,toDst:e})}else{return s.lstat(e,((t,s)=>{if(t){t.message=t.message.replace("lstat","ensureSymlink");return n(t)}return n(null,{toCwd:e,toDst:i.relative(o,e)})}))}}))}}function symlinkPathsSync(e,t){let n;if(i.isAbsolute(e)){n=s.existsSync(e);if(!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}else{const a=i.dirname(t);const o=i.join(a,e);n=s.existsSync(o);if(n){return{toCwd:o,toDst:e}}else{n=s.existsSync(e);if(!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:i.relative(a,e)}}}}e.exports={symlinkPaths:symlinkPaths,symlinkPathsSync:symlinkPathsSync}},8254:(e,t,n)=>{"use strict";const i=n(7758);function symlinkType(e,t,n){n=typeof t==="function"?t:n;t=typeof t==="function"?false:t;if(t)return n(null,t);i.lstat(e,((e,i)=>{if(e)return n(null,"file");t=i&&i.isDirectory()?"dir":"file";n(null,t)}))}function symlinkTypeSync(e,t){let n;if(t)return t;try{n=i.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}e.exports={symlinkType:symlinkType,symlinkTypeSync:symlinkTypeSync}},2549:(e,t,n)=>{"use strict";const i=n(9046).E;const s=n(1017);const a=n(7758);const o=n(8605);const l=o.mkdirs;const u=o.mkdirsSync;const f=n(3727);const h=f.symlinkPaths;const d=f.symlinkPathsSync;const m=n(8254);const y=m.symlinkType;const g=m.symlinkTypeSync;const v=n(3835).pathExists;function createSymlink(e,t,n,i){i=typeof n==="function"?n:i;n=typeof n==="function"?false:n;v(t,((o,u)=>{if(o)return i(o);if(u)return i(null);h(e,t,((o,u)=>{if(o)return i(o);e=u.toDst;y(u.toCwd,n,((n,o)=>{if(n)return i(n);const u=s.dirname(t);v(u,((n,s)=>{if(n)return i(n);if(s)return a.symlink(e,t,o,i);l(u,(n=>{if(n)return i(n);a.symlink(e,t,o,i)}))}))}))}))}))}function createSymlinkSync(e,t,n,i){i=typeof n==="function"?n:i;n=typeof n==="function"?false:n;const o=a.existsSync(t);if(o)return undefined;const l=d(e,t);e=l.toDst;n=g(l.toCwd,n);const f=s.dirname(t);const h=a.existsSync(f);if(h)return a.symlinkSync(e,t,n);u(f);return a.symlinkSync(e,t,n)}e.exports={createSymlink:i(createSymlink),createSymlinkSync:createSymlinkSync}},1176:(e,t,n)=>{const i=n(9046).E;const s=n(7758);const a=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>typeof s[e]==="function"));Object.keys(s).forEach((e=>{t[e]=s[e]}));a.forEach((e=>{t[e]=i(s[e])}));t.exists=function(e,t){if(typeof t==="function"){return s.exists(e,t)}return new Promise((t=>s.exists(e,t)))};t.read=function(e,t,n,i,a,o){if(typeof o==="function"){return s.read(e,t,n,i,a,o)}return new Promise(((o,l)=>{s.read(e,t,n,i,a,((e,t,n)=>{if(e)return l(e);o({bytesRead:t,buffer:n})}))}))};t.write=function(e,t,n,i,a,o){if(typeof arguments[arguments.length-1]==="function"){return s.write(e,t,n,i,a,o)}if(typeof t==="string"){return new Promise(((a,o)=>{s.write(e,t,n,i,((e,t,n)=>{if(e)return o(e);a({bytesWritten:t,buffer:n})}))}))}return new Promise(((o,l)=>{s.write(e,t,n,i,a,((e,t,n)=>{if(e)return l(e);o({bytesWritten:t,buffer:n})}))}))}},5630:(e,t,n)=>{"use strict";const i=n(660);const s={};i(s,n(1176));i(s,n(1335));i(s,n(1135));i(s,n(8605));i(s,n(7357));i(s,n(213));i(s,n(1497));i(s,n(9665));i(s,n(6970));i(s,n(55));i(s,n(6570));i(s,n(3835));e.exports=s},213:(e,t,n)=>{"use strict";const i=n(9046).E;const s=n(8970);s.outputJson=i(n(531));s.outputJsonSync=n(9421);s.outputJSON=s.outputJson;s.outputJSONSync=s.outputJsonSync;s.writeJSON=s.writeJson;s.writeJSONSync=s.writeJsonSync;s.readJSON=s.readJson;s.readJSONSync=s.readJsonSync;e.exports=s},8970:(e,t,n)=>{"use strict";const i=n(9046).E;const s=n(6160);e.exports={readJson:i(s.readFile),readJsonSync:s.readFileSync,writeJson:i(s.writeFile),writeJsonSync:s.writeFileSync}},9421:(e,t,n)=>{"use strict";const i=n(7758);const s=n(1017);const a=n(8605);const o=n(8970);function outputJsonSync(e,t,n){const l=s.dirname(e);if(!i.existsSync(l)){a.mkdirsSync(l)}o.writeJsonSync(e,t,n)}e.exports=outputJsonSync},531:(e,t,n)=>{"use strict";const i=n(1017);const s=n(8605);const a=n(3835).pathExists;const o=n(8970);function outputJson(e,t,n,l){if(typeof n==="function"){l=n;n={}}const u=i.dirname(e);a(u,((i,a)=>{if(i)return l(i);if(a)return o.writeJson(e,t,n,l);s.mkdirs(u,(i=>{if(i)return l(i);o.writeJson(e,t,n,l)}))}))}e.exports=outputJson},8605:(e,t,n)=>{"use strict";const i=n(9046).E;const s=i(n(9677));const a=n(684);e.exports={mkdirs:s,mkdirsSync:a,mkdirp:s,mkdirpSync:a,ensureDir:s,ensureDirSync:a}},684:(e,t,n)=>{"use strict";const i=n(7758);const s=n(1017);const a=n(1590).invalidWin32Path;const o=parseInt("0777",8);function mkdirsSync(e,t,n){if(!t||typeof t!=="object"){t={mode:t}}let l=t.mode;const u=t.fs||i;if(process.platform==="win32"&&a(e)){const t=new Error(e+" contains invalid WIN32 path characters.");t.code="EINVAL";throw t}if(l===undefined){l=o&~process.umask()}if(!n)n=null;e=s.resolve(e);try{u.mkdirSync(e,l);n=n||e}catch(i){switch(i.code){case"ENOENT":if(s.dirname(e)===e)throw i;n=mkdirsSync(s.dirname(e),t,n);mkdirsSync(e,t,n);break;default:let a;try{a=u.statSync(e)}catch(e){throw i}if(!a.isDirectory())throw i;break}}return n}e.exports=mkdirsSync},9677:(e,t,n)=>{"use strict";const i=n(7758);const s=n(1017);const a=n(1590).invalidWin32Path;const o=parseInt("0777",8);function mkdirs(e,t,n,l){if(typeof t==="function"){n=t;t={}}else if(!t||typeof t!=="object"){t={mode:t}}if(process.platform==="win32"&&a(e)){const t=new Error(e+" contains invalid WIN32 path characters.");t.code="EINVAL";return n(t)}let u=t.mode;const f=t.fs||i;if(u===undefined){u=o&~process.umask()}if(!l)l=null;n=n||function(){};e=s.resolve(e);f.mkdir(e,u,(i=>{if(!i){l=l||e;return n(null,l)}switch(i.code){case"ENOENT":if(s.dirname(e)===e)return n(i);mkdirs(s.dirname(e),t,((i,s)=>{if(i)n(i,s);else mkdirs(e,t,n,s)}));break;default:f.stat(e,((e,t)=>{if(e||!t.isDirectory())n(i,l);else n(null,l)}));break}}))}e.exports=mkdirs},1590:(e,t,n)=>{"use strict";const i=n(1017);function getRootPath(e){e=i.normalize(i.resolve(e)).split(i.sep);if(e.length>0)return e[0];return null}const s=/[<>:"|?*]/;function invalidWin32Path(e){const t=getRootPath(e);e=e.replace(t,"");return s.test(e)}e.exports={getRootPath:getRootPath,invalidWin32Path:invalidWin32Path}},9665:(e,t,n)=>{"use strict";const i=n(7758);const s=n(1017);const a=n(1135).copySync;const o=n(7357).removeSync;const l=n(8605).mkdirsSync;const u=n(7696);function moveSync(e,t,n){n=n||{};const a=n.overwrite||n.clobber||false;e=s.resolve(e);t=s.resolve(t);if(e===t)return i.accessSync(e);if(isSrcSubdir(e,t))throw new Error(`Cannot move '${e}' into itself '${t}'.`);l(s.dirname(t));tryRenameSync();function tryRenameSync(){if(a){try{return i.renameSync(e,t)}catch(i){if(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM"){o(t);n.overwrite=false;return moveSync(e,t,n)}if(i.code!=="EXDEV")throw i;return moveSyncAcrossDevice(e,t,a)}}else{try{i.linkSync(e,t);return i.unlinkSync(e)}catch(n){if(n.code==="EXDEV"||n.code==="EISDIR"||n.code==="EPERM"||n.code==="ENOTSUP"){return moveSyncAcrossDevice(e,t,a)}throw n}}}}function moveSyncAcrossDevice(e,t,n){const s=i.statSync(e);if(s.isDirectory()){return moveDirSyncAcrossDevice(e,t,n)}else{return moveFileSyncAcrossDevice(e,t,n)}}function moveFileSyncAcrossDevice(e,t,n){const s=64*1024;const a=u(s);const o=n?"w":"wx";const l=i.openSync(e,"r");const f=i.fstatSync(l);const h=i.openSync(t,o,f.mode);let d=1;let m=0;while(d>0){d=i.readSync(l,a,0,s,m);i.writeSync(h,a,0,d);m+=d}i.closeSync(l);i.closeSync(h);return i.unlinkSync(e)}function moveDirSyncAcrossDevice(e,t,n){const i={overwrite:false};if(n){o(t);tryCopySync()}else{tryCopySync()}function tryCopySync(){a(e,t,i);return o(e)}}function isSrcSubdir(e,t){try{return i.statSync(e).isDirectory()&&e!==t&&t.indexOf(e)>-1&&t.split(s.dirname(e)+s.sep)[1].split(s.sep)[0]===s.basename(e)}catch(e){return false}}e.exports={moveSync:moveSync}},1497:(e,t,n)=>{"use strict";const i=n(9046).E;const s=n(7758);const a=n(8834);const o=n(1017);const l=n(7357).remove;const u=n(8605).mkdirs;function move(e,t,n,i){if(typeof n==="function"){i=n;n={}}const a=n.overwrite||n.clobber||false;isSrcSubdir(e,t,((n,s)=>{if(n)return i(n);if(s)return i(new Error(`Cannot move '${e}' to a subdirectory of itself, '${t}'.`));u(o.dirname(t),(e=>{if(e)return i(e);doRename()}))}));function doRename(){if(o.resolve(e)===o.resolve(t)){s.access(e,i)}else if(a){s.rename(e,t,(s=>{if(!s)return i();if(s.code==="ENOTEMPTY"||s.code==="EEXIST"){l(t,(s=>{if(s)return i(s);n.overwrite=false;move(e,t,n,i)}));return}if(s.code==="EPERM"){setTimeout((()=>{l(t,(s=>{if(s)return i(s);n.overwrite=false;move(e,t,n,i)}))}),200);return}if(s.code!=="EXDEV")return i(s);moveAcrossDevice(e,t,a,i)}))}else{s.link(e,t,(n=>{if(n){if(n.code==="EXDEV"||n.code==="EISDIR"||n.code==="EPERM"||n.code==="ENOTSUP"){return moveAcrossDevice(e,t,a,i)}return i(n)}return s.unlink(e,i)}))}}}function moveAcrossDevice(e,t,n,i){s.stat(e,((s,a)=>{if(s)return i(s);if(a.isDirectory()){moveDirAcrossDevice(e,t,n,i)}else{moveFileAcrossDevice(e,t,n,i)}}))}function moveFileAcrossDevice(e,t,n,i){const a=n?"w":"wx";const o=s.createReadStream(e);const l=s.createWriteStream(t,{flags:a});o.on("error",(a=>{o.destroy();l.destroy();l.removeListener("close",onClose);s.unlink(t,(()=>{if(a.code==="EISDIR"||a.code==="EPERM"){moveDirAcrossDevice(e,t,n,i)}else{i(a)}}))}));l.on("error",(e=>{o.destroy();l.destroy();l.removeListener("close",onClose);i(e)}));l.once("close",onClose);o.pipe(l);function onClose(){s.unlink(e,i)}}function moveDirAcrossDevice(e,t,n,i){const s={overwrite:false};if(n){l(t,(e=>{if(e)return i(e);startCopy()}))}else{startCopy()}function startCopy(){a(e,t,s,(t=>{if(t)return i(t);l(e,i)}))}}function isSrcSubdir(e,t,n){s.stat(e,((i,s)=>{if(i)return n(i);if(s.isDirectory()){const i=t.split(o.dirname(e)+o.sep)[1];if(i){const s=i.split(o.sep)[0];if(s)return n(null,e!==t&&t.indexOf(e)>-1&&s===o.basename(e));return n(null,false)}return n(null,false)}return n(null,false)}))}e.exports={move:i(move)}},6570:(e,t,n)=>{"use strict";const i=n(9046).E;const s=n(7758);const a=n(1017);const o=n(8605);const l=n(3835).pathExists;function outputFile(e,t,n,i){if(typeof n==="function"){i=n;n="utf8"}const u=a.dirname(e);l(u,((a,l)=>{if(a)return i(a);if(l)return s.writeFile(e,t,n,i);o.mkdirs(u,(a=>{if(a)return i(a);s.writeFile(e,t,n,i)}))}))}function outputFileSync(e,t,n){const i=a.dirname(e);if(s.existsSync(i)){return s.writeFileSync.apply(s,arguments)}o.mkdirsSync(i);s.writeFileSync.apply(s,arguments)}e.exports={outputFile:i(outputFile),outputFileSync:outputFileSync}},3835:(e,t,n)=>{"use strict";const i=n(9046).p;const s=n(1176);function pathExists(e){return s.access(e).then((()=>true)).catch((()=>false))}e.exports={pathExists:i(pathExists),pathExistsSync:s.existsSync}},7357:(e,t,n)=>{"use strict";const i=n(9046).E;const s=n(8761);e.exports={remove:i(s),removeSync:s.sync}},8761:(e,t,n)=>{"use strict";const i=n(7758);const s=n(1017);const a=n(9491);const o=process.platform==="win32";function defaults(e){const t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((t=>{e[t]=e[t]||i[t];t=t+"Sync";e[t]=e[t]||i[t]}));e.maxBusyTries=e.maxBusyTries||3}function rimraf(e,t,n){let i=0;if(typeof t==="function"){n=t;t={}}a(e,"rimraf: missing path");a.equal(typeof e,"string","rimraf: path should be a string");a.equal(typeof n,"function","rimraf: callback function required");a(t,"rimraf: invalid options argument provided");a.equal(typeof t,"object","rimraf: options should be object");defaults(t);rimraf_(e,t,(function CB(s){if(s){if((s.code==="EBUSY"||s.code==="ENOTEMPTY"||s.code==="EPERM")&&irimraf_(e,t,CB)),n)}if(s.code==="ENOENT")s=null}n(s)}))}function rimraf_(e,t,n){a(e);a(t);a(typeof n==="function");t.lstat(e,((i,s)=>{if(i&&i.code==="ENOENT"){return n(null)}if(i&&i.code==="EPERM"&&o){return fixWinEPERM(e,t,i,n)}if(s&&s.isDirectory()){return rmdir(e,t,i,n)}t.unlink(e,(i=>{if(i){if(i.code==="ENOENT"){return n(null)}if(i.code==="EPERM"){return o?fixWinEPERM(e,t,i,n):rmdir(e,t,i,n)}if(i.code==="EISDIR"){return rmdir(e,t,i,n)}}return n(i)}))}))}function fixWinEPERM(e,t,n,i){a(e);a(t);a(typeof i==="function");if(n){a(n instanceof Error)}t.chmod(e,438,(s=>{if(s){i(s.code==="ENOENT"?null:n)}else{t.stat(e,((s,a)=>{if(s){i(s.code==="ENOENT"?null:n)}else if(a.isDirectory()){rmdir(e,t,n,i)}else{t.unlink(e,i)}}))}}))}function fixWinEPERMSync(e,t,n){let i;a(e);a(t);if(n){a(n instanceof Error)}try{t.chmodSync(e,438)}catch(e){if(e.code==="ENOENT"){return}else{throw n}}try{i=t.statSync(e)}catch(e){if(e.code==="ENOENT"){return}else{throw n}}if(i.isDirectory()){rmdirSync(e,t,n)}else{t.unlinkSync(e)}}function rmdir(e,t,n,i){a(e);a(t);if(n){a(n instanceof Error)}a(typeof i==="function");t.rmdir(e,(s=>{if(s&&(s.code==="ENOTEMPTY"||s.code==="EEXIST"||s.code==="EPERM")){rmkids(e,t,i)}else if(s&&s.code==="ENOTDIR"){i(n)}else{i(s)}}))}function rmkids(e,t,n){a(e);a(t);a(typeof n==="function");t.readdir(e,((i,a)=>{if(i)return n(i);let o=a.length;let l;if(o===0)return t.rmdir(e,n);a.forEach((i=>{rimraf(s.join(e,i),t,(i=>{if(l){return}if(i)return n(l=i);if(--o===0){t.rmdir(e,n)}}))}))}))}function rimrafSync(e,t){let n;t=t||{};defaults(t);a(e,"rimraf: missing path");a.equal(typeof e,"string","rimraf: path should be a string");a(t,"rimraf: missing options");a.equal(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if(n.code==="ENOENT"){return}if(n.code==="EPERM"&&o){fixWinEPERMSync(e,t,n)}}try{if(n&&n.isDirectory()){rmdirSync(e,t,null)}else{t.unlinkSync(e)}}catch(n){if(n.code==="ENOENT"){return}else if(n.code==="EPERM"){return o?fixWinEPERMSync(e,t,n):rmdirSync(e,t,n)}else if(n.code!=="EISDIR"){throw n}rmdirSync(e,t,n)}}function rmdirSync(e,t,n){a(e);a(t);if(n){a(n instanceof Error)}try{t.rmdirSync(e)}catch(i){if(i.code==="ENOTDIR"){throw n}else if(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM"){rmkidsSync(e,t)}else if(i.code!=="ENOENT"){throw i}}}function rmkidsSync(e,t){a(e);a(t);t.readdirSync(e).forEach((n=>rimrafSync(s.join(e,n),t)));const n=o?100:1;let i=0;do{let s=true;try{const a=t.rmdirSync(e,t);s=false;return a}finally{if(++i{"use strict";function assign(){const e=[].slice.call(arguments).filter((e=>e));const t=e.shift();e.forEach((e=>{Object.keys(e).forEach((n=>{t[n]=e[n]}))}));return t}e.exports=assign},7696:e=>{e.exports=function(e){if(typeof Buffer.allocUnsafe==="function"){try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}}return new Buffer(e)}},2548:(e,t,n)=>{"use strict";const i=n(7758);const s=n(2037);const a=n(1017);function hasMillisResSync(){let e=a.join("millis-test-sync"+Date.now().toString()+Math.random().toString().slice(2));e=a.join(s.tmpdir(),e);const t=new Date(1435410243862);i.writeFileSync(e,"https://github.com/jprichardson/node-fs-extra/pull/141");const n=i.openSync(e,"r+");i.futimesSync(n,t,t);i.closeSync(n);return i.statSync(e).mtime>1435410243e3}function hasMillisRes(e){let t=a.join("millis-test"+Date.now().toString()+Math.random().toString().slice(2));t=a.join(s.tmpdir(),t);const n=new Date(1435410243862);i.writeFile(t,"https://github.com/jprichardson/node-fs-extra/pull/141",(s=>{if(s)return e(s);i.open(t,"r+",((s,a)=>{if(s)return e(s);i.futimes(a,n,n,(n=>{if(n)return e(n);i.close(a,(n=>{if(n)return e(n);i.stat(t,((t,n)=>{if(t)return e(t);e(null,n.mtime>1435410243e3)}))}))}))}))}))}function timeRemoveMillis(e){if(typeof e==="number"){return Math.floor(e/1e3)*1e3}else if(e instanceof Date){return new Date(Math.floor(e.getTime()/1e3)*1e3)}else{throw new Error("fs-extra: timeRemoveMillis() unknown parameter type")}}function utimesMillis(e,t,n,s){i.open(e,"r+",((e,a)=>{if(e)return s(e);i.futimes(a,t,n,(e=>{i.close(a,(t=>{if(s)s(e||t)}))}))}))}function utimesMillisSync(e,t,n){const s=i.openSync(e,"r+");i.futimesSync(s,t,n);return i.closeSync(s)}e.exports={hasMillisRes:hasMillisRes,hasMillisResSync:hasMillisResSync,timeRemoveMillis:timeRemoveMillis,utimesMillis:utimesMillis,utimesMillisSync:utimesMillisSync}},7356:e=>{"use strict";e.exports=clone;var t=Object.getPrototypeOf||function(e){return e.__proto__};function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var n={__proto__:t(e)};else var n=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}));return n}},7758:(e,t,n)=>{var i=n(7147);var s=n(263);var a=n(3086);var o=n(7356);var l=n(3837);var u;var f;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){u=Symbol.for("graceful-fs.queue");f=Symbol.for("graceful-fs.previous")}else{u="___graceful-fs.queue";f="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,u,{get:function(){return t}})}var h=noop;if(l.debuglog)h=l.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))h=function(){var e=l.format.apply(l,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!i[u]){var d=global[u]||[];publishQueue(i,d);i.close=function(e){function close(t,n){return e.call(i,t,(function(e){if(!e){resetQueue()}if(typeof n==="function")n.apply(this,arguments)}))}Object.defineProperty(close,f,{value:e});return close}(i.close);i.closeSync=function(e){function closeSync(t){e.apply(i,arguments);resetQueue()}Object.defineProperty(closeSync,f,{value:e});return closeSync}(i.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){h(i[u]);n(9491).equal(i[u].length,0)}))}}if(!global[u]){publishQueue(global,i[u])}e.exports=patch(o(i));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!i.__patched){e.exports=patch(i);i.__patched=true}function patch(e){s(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,n,i){if(typeof n==="function")i=n,n=null;return go$readFile(e,n,i);function go$readFile(e,n,i,s){return t(e,n,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,n,i],t,s||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}}))}}var n=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,i,s){if(typeof i==="function")s=i,i=null;return go$writeFile(e,t,i,s);function go$writeFile(e,t,i,s,a){return n(e,t,i,(function(n){if(n&&(n.code==="EMFILE"||n.code==="ENFILE"))enqueue([go$writeFile,[e,t,i,s],n,a||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}var i=e.appendFile;if(i)e.appendFile=appendFile;function appendFile(e,t,n,s){if(typeof n==="function")s=n,n=null;return go$appendFile(e,t,n,s);function go$appendFile(e,t,n,s,a){return i(e,t,n,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$appendFile,[e,t,n,s],i,a||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}var o=e.copyFile;if(o)e.copyFile=copyFile;function copyFile(e,t,n,i){if(typeof n==="function"){i=n;n=0}return go$copyFile(e,t,n,i);function go$copyFile(e,t,n,i,s){return o(e,t,n,(function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$copyFile,[e,t,n,i],a,s||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}}))}}var l=e.readdir;e.readdir=readdir;var u=/^v[0-5]\./;function readdir(e,t,n){if(typeof t==="function")n=t,t=null;var i=u.test(process.version)?function go$readdir(e,t,n,i){return l(e,fs$readdirCallback(e,t,n,i))}:function go$readdir(e,t,n,i){return l(e,t,fs$readdirCallback(e,t,n,i))};return i(e,t,n);function fs$readdirCallback(e,t,n,s){return function(a,o){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([i,[e,t,n],a,s||Date.now(),Date.now()]);else{if(o&&o.sort)o.sort();if(typeof n==="function")n.call(this,a,o)}}}}if(process.version.substr(0,4)==="v0.8"){var f=a(e);ReadStream=f.ReadStream;WriteStream=f.WriteStream}var h=e.ReadStream;if(h){ReadStream.prototype=Object.create(h.prototype);ReadStream.prototype.open=ReadStream$open}var d=e.WriteStream;if(d){WriteStream.prototype=Object.create(d.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var m=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return m},set:function(e){m=e},enumerable:true,configurable:true});var y=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return y},set:function(e){y=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return h.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,n){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=n;e.emit("open",n);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return d.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,n){if(t){e.destroy();e.emit("error",t)}else{e.fd=n;e.emit("open",n)}}))}function createReadStream(t,n){return new e.ReadStream(t,n)}function createWriteStream(t,n){return new e.WriteStream(t,n)}var g=e.open;e.open=open;function open(e,t,n,i){if(typeof n==="function")i=n,n=null;return go$open(e,t,n,i);function go$open(e,t,n,i,s){return g(e,t,n,(function(a,o){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$open,[e,t,n,i],a,s||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}}))}}return e}function enqueue(e){h("ENQUEUE",e[0].name,e[1]);i[u].push(e);retry()}var m;function resetQueue(){var e=Date.now();for(var t=0;t2){i[u][t][3]=e;i[u][t][4]=e}}retry()}function retry(){clearTimeout(m);m=undefined;if(i[u].length===0)return;var e=i[u].shift();var t=e[0];var n=e[1];var s=e[2];var a=e[3];var o=e[4];if(a===undefined){h("RETRY",t.name,n);t.apply(null,n)}else if(Date.now()-a>=6e4){h("TIMEOUT",t.name,n);var l=n.pop();if(typeof l==="function")l.call(null,s)}else{var f=Date.now()-o;var d=Math.max(o-a,1);var y=Math.min(d*1.2,100);if(f>=y){h("RETRY",t.name,n);t.apply(null,n.concat([a]))}else{i[u].push(e)}}if(m===undefined){m=setTimeout(retry,0)}}},3086:(e,t,n)=>{var i=n(2781).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,n){if(!(this instanceof ReadStream))return new ReadStream(t,n);i.call(this);var s=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;n=n||{};var a=Object.keys(n);for(var o=0,l=a.length;othis.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){s._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){s.emit("error",e);s.readable=false;return}s.fd=t;s.emit("open",t);s._read()}))}function WriteStream(t,n){if(!(this instanceof WriteStream))return new WriteStream(t,n);i.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;n=n||{};var s=Object.keys(n);for(var a=0,o=s.length;a= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},263:(e,t,n)=>{var i=n(2057);var s=process.cwd;var a=null;var o=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!a)a=s.call(process);return a};try{process.cwd()}catch(e){}if(typeof process.chdir==="function"){var l=process.chdir;process.chdir=function(e){a=null;l.call(process,e)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,l)}e.exports=patch;function patch(e){if(i.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(e.chmod&&!e.lchmod){e.lchmod=function(e,t,n){if(n)process.nextTick(n)};e.lchmodSync=function(){}}if(e.chown&&!e.lchown){e.lchown=function(e,t,n,i){if(i)process.nextTick(i)};e.lchownSync=function(){}}if(o==="win32"){e.rename=typeof e.rename!=="function"?e.rename:function(t){function rename(n,i,s){var a=Date.now();var o=0;t(n,i,(function CB(l){if(l&&(l.code==="EACCES"||l.code==="EPERM"||l.code==="EBUSY")&&Date.now()-a<6e4){setTimeout((function(){e.stat(i,(function(e,a){if(e&&e.code==="ENOENT")t(n,i,CB);else s(l)}))}),o);if(o<100)o+=10;return}if(s)s(l)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,t);return rename}(e.rename)}e.read=typeof e.read!=="function"?e.read:function(t){function read(n,i,s,a,o,l){var u;if(l&&typeof l==="function"){var f=0;u=function(h,d,m){if(h&&h.code==="EAGAIN"&&f<10){f++;return t.call(e,n,i,s,a,o,u)}l.apply(this,arguments)}}return t.call(e,n,i,s,a,o,u)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,t);return read}(e.read);e.readSync=typeof e.readSync!=="function"?e.readSync:function(t){return function(n,i,s,a,o){var l=0;while(true){try{return t.call(e,n,i,s,a,o)}catch(e){if(e.code==="EAGAIN"&&l<10){l++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,n,s){e.open(t,i.O_WRONLY|i.O_SYMLINK,n,(function(t,i){if(t){if(s)s(t);return}e.fchmod(i,n,(function(t){e.close(i,(function(e){if(s)s(t||e)}))}))}))};e.lchmodSync=function(t,n){var s=e.openSync(t,i.O_WRONLY|i.O_SYMLINK,n);var a=true;var o;try{o=e.fchmodSync(s,n);a=false}finally{if(a){try{e.closeSync(s)}catch(e){}}else{e.closeSync(s)}}return o}}function patchLutimes(e){if(i.hasOwnProperty("O_SYMLINK")&&e.futimes){e.lutimes=function(t,n,s,a){e.open(t,i.O_SYMLINK,(function(t,i){if(t){if(a)a(t);return}e.futimes(i,n,s,(function(t){e.close(i,(function(e){if(a)a(t||e)}))}))}))};e.lutimesSync=function(t,n,s){var a=e.openSync(t,i.O_SYMLINK);var o;var l=true;try{o=e.futimesSync(a,n,s);l=false}finally{if(l){try{e.closeSync(a)}catch(e){}}else{e.closeSync(a)}}return o}}else if(e.futimes){e.lutimes=function(e,t,n,i){if(i)process.nextTick(i)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(n,i,s){return t.call(e,n,i,(function(e){if(chownErOk(e))e=null;if(s)s.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(n,i){try{return t.call(e,n,i)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(n,i,s,a){return t.call(e,n,i,s,(function(e){if(chownErOk(e))e=null;if(a)a.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(n,i,s){try{return t.call(e,n,i,s)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(n,i,s){if(typeof i==="function"){s=i;i=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(s)s.apply(this,arguments)}return i?t.call(e,n,i,callback):t.call(e,n,callback)}}function statFixSync(t){if(!t)return t;return function(n,i){var s=i?t.call(e,n,i):t.call(e,n);if(s){if(s.uid<0)s.uid+=4294967296;if(s.gid<0)s.gid+=4294967296}return s}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},1621:e=>{"use strict";e.exports=(e,t=process.argv)=>{const n=e.startsWith("-")?"":e.length===1?"-":"--";const i=t.indexOf(n+e);const s=t.indexOf("--");return i!==-1&&(s===-1||i{try{var i=n(3837);if(typeof i.inherits!=="function")throw"";e.exports=i.inherits}catch(t){e.exports=n(8544)}},8544:e=>{if(typeof Object.create==="function"){e.exports=function inherits(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}}}},284:e=>{"use strict";e.exports=({stream:e=process.stdout}={})=>Boolean(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))},9228:e=>{"use strict";e.exports=()=>{if(process.platform!=="win32"){return true}return Boolean(process.env.CI)||Boolean(process.env.WT_SESSION)||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color"||process.env.TERM==="alacritty"}},6160:(e,t,n)=>{var i;try{i=n(7758)}catch(e){i=n(7147)}function readFile(e,t,n){if(n==null){n=t;t={}}if(typeof t==="string"){t={encoding:t}}t=t||{};var s=t.fs||i;var a=true;if("throws"in t){a=t.throws}s.readFile(e,t,(function(i,s){if(i)return n(i);s=stripBom(s);var o;try{o=JSON.parse(s,t?t.reviver:null)}catch(t){if(a){t.message=e+": "+t.message;return n(t)}else{return n(null,null)}}n(null,o)}))}function readFileSync(e,t){t=t||{};if(typeof t==="string"){t={encoding:t}}var n=t.fs||i;var s=true;if("throws"in t){s=t.throws}try{var a=n.readFileSync(e,t);a=stripBom(a);return JSON.parse(a,t.reviver)}catch(t){if(s){t.message=e+": "+t.message;throw t}else{return null}}}function stringify(e,t){var n;var i="\n";if(typeof t==="object"&&t!==null){if(t.spaces){n=t.spaces}if(t.EOL){i=t.EOL}}var s=JSON.stringify(e,t?t.replacer:null,n);return s.replace(/\n/g,i)+i}function writeFile(e,t,n,s){if(s==null){s=n;n={}}n=n||{};var a=n.fs||i;var o="";try{o=stringify(t,n)}catch(e){if(s)s(e,null);return}a.writeFile(e,o,n,s)}function writeFileSync(e,t,n){n=n||{};var s=n.fs||i;var a=stringify(t,n);return s.writeFileSync(e,a,n)}function stripBom(e){if(Buffer.isBuffer(e))e=e.toString("utf8");e=e.replace(/^\uFEFF/,"");return e}var s={readFile:readFile,readFileSync:readFileSync,writeFile:writeFile,writeFileSync:writeFileSync};e.exports=s},250:function(e,t,n){e=n.nmd(e); -/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(){var n;var i="4.17.21";var s=200;var a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",l="Invalid `variable` option passed into `_.template`";var u="__lodash_hash_undefined__";var f=500;var h="__lodash_placeholder__";var d=1,m=2,y=4;var g=1,v=2;var _=1,S=2,x=4,k=8,E=16,R=32,O=64,C=128,I=256,j=512;var A=30,M="...";var P=800,B=16;var $=1,z=2,H=3;var V=1/0,K=9007199254740991,Y=17976931348623157e292,J=0/0;var X=4294967295,Q=X-1,te=X>>>1;var re=[["ary",C],["bind",_],["bindKey",S],["curry",k],["curryRight",E],["flip",j],["partial",R],["partialRight",O],["rearg",I]];var ne="[object Arguments]",se="[object Array]",ae="[object AsyncFunction]",oe="[object Boolean]",le="[object Date]",fe="[object DOMException]",de="[object Error]",me="[object Function]",ye="[object GeneratorFunction]",be="[object Map]",we="[object Number]",Se="[object Null]",xe="[object Object]",ke="[object Promise]",Ee="[object Proxy]",Re="[object RegExp]",Oe="[object Set]",Me="[object String]",Fe="[object Symbol]",De="[object Undefined]",Be="[object WeakMap]",Ne="[object WeakSet]";var Qe="[object ArrayBuffer]",et="[object DataView]",tt="[object Float32Array]",rt="[object Float64Array]",nt="[object Int8Array]",it="[object Int16Array]",st="[object Int32Array]",at="[object Uint8Array]",ot="[object Uint8ClampedArray]",lt="[object Uint16Array]",ut="[object Uint32Array]";var ct=/\b__p \+= '';/g,ft=/\b(__p \+=) '' \+/g,ht=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var pt=/&(?:amp|lt|gt|quot|#39);/g,dt=/[&<>"']/g,mt=RegExp(pt.source),yt=RegExp(dt.source);var gt=/<%-([\s\S]+?)%>/g,bt=/<%([\s\S]+?)%>/g,vt=/<%=([\s\S]+?)%>/g;var wt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_t=/^\w*$/,St=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var xt=/[\\^$.*+?()[\]{}|]/g,kt=RegExp(xt.source);var Et=/^\s+/;var Rt=/\s/;var Ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ct=/\{\n\/\* \[wrapped with (.+)\] \*/,It=/,? & /;var Tt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var jt=/[()=,{}\[\]\/\s]/;var Lt=/\\(\\)?/g;var At=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var Mt=/\w*$/;var Pt=/^[-+]0x[0-9a-f]+$/i;var Ft=/^0b[01]+$/i;var Dt=/^\[object .+?Constructor\]$/;var Bt=/^0o[0-7]+$/i;var Nt=/^(?:0|[1-9]\d*)$/;var Wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;var qt=/($^)/;var $t=/['\n\r\u2028\u2029\\]/g;var zt="\\ud800-\\udfff",Ut="\\u0300-\\u036f",Gt="\\ufe20-\\ufe2f",Ht="\\u20d0-\\u20ff",Vt=Ut+Gt+Ht,Kt="\\u2700-\\u27bf",Yt="a-z\\xdf-\\xf6\\xf8-\\xff",Jt="\\xac\\xb1\\xd7\\xf7",Zt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Xt="\\u2000-\\u206f",Qt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",er="A-Z\\xc0-\\xd6\\xd8-\\xde",tr="\\ufe0e\\ufe0f",rr=Jt+Zt+Xt+Qt;var nr="['’]",ir="["+zt+"]",sr="["+rr+"]",ar="["+Vt+"]",or="\\d+",lr="["+Kt+"]",ur="["+Yt+"]",cr="[^"+zt+rr+or+Kt+Yt+er+"]",fr="\\ud83c[\\udffb-\\udfff]",hr="(?:"+ar+"|"+fr+")",pr="[^"+zt+"]",dr="(?:\\ud83c[\\udde6-\\uddff]){2}",mr="[\\ud800-\\udbff][\\udc00-\\udfff]",yr="["+er+"]",gr="\\u200d";var br="(?:"+ur+"|"+cr+")",vr="(?:"+yr+"|"+cr+")",wr="(?:"+nr+"(?:d|ll|m|re|s|t|ve))?",_r="(?:"+nr+"(?:D|LL|M|RE|S|T|VE))?",Sr=hr+"?",xr="["+tr+"]?",kr="(?:"+gr+"(?:"+[pr,dr,mr].join("|")+")"+xr+Sr+")*",Er="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Or=xr+Sr+kr,Cr="(?:"+[lr,dr,mr].join("|")+")"+Or,Ir="(?:"+[pr+ar+"?",ar,dr,mr,ir].join("|")+")";var Tr=RegExp(nr,"g");var jr=RegExp(ar,"g");var Lr=RegExp(fr+"(?="+fr+")|"+Ir+Or,"g");var Ar=RegExp([yr+"?"+ur+"+"+wr+"(?="+[sr,yr,"$"].join("|")+")",vr+"+"+_r+"(?="+[sr,yr+br,"$"].join("|")+")",yr+"?"+br+"+"+wr,yr+"+"+_r,Rr,Er,or,Cr].join("|"),"g");var Mr=RegExp("["+gr+zt+Vt+tr+"]");var Pr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Fr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"];var Dr=-1;var Br={};Br[tt]=Br[rt]=Br[nt]=Br[it]=Br[st]=Br[at]=Br[ot]=Br[lt]=Br[ut]=true;Br[ne]=Br[se]=Br[Qe]=Br[oe]=Br[et]=Br[le]=Br[de]=Br[me]=Br[be]=Br[we]=Br[xe]=Br[Re]=Br[Oe]=Br[Me]=Br[Be]=false;var Nr={};Nr[ne]=Nr[se]=Nr[Qe]=Nr[et]=Nr[oe]=Nr[le]=Nr[tt]=Nr[rt]=Nr[nt]=Nr[it]=Nr[st]=Nr[be]=Nr[we]=Nr[xe]=Nr[Re]=Nr[Oe]=Nr[Me]=Nr[Fe]=Nr[at]=Nr[ot]=Nr[lt]=Nr[ut]=true;Nr[de]=Nr[me]=Nr[Be]=false;var Wr={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"};var qr={"&":"&","<":"<",">":">",'"':""","'":"'"};var $r={"&":"&","<":"<",">":">",""":'"',"'":"'"};var zr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var Ur=parseFloat,Gr=parseInt;var Hr=typeof global=="object"&&global&&global.Object===Object&&global;var Vr=typeof self=="object"&&self&&self.Object===Object&&self;var Kr=Hr||Vr||Function("return this")();var Yr=true&&t&&!t.nodeType&&t;var Jr=Yr&&"object"=="object"&&e&&!e.nodeType&&e;var Zr=Jr&&Jr.exports===Yr;var Xr=Zr&&Hr.process;var Qr=function(){try{var e=Jr&&Jr.require&&Jr.require("util").types;if(e){return e}return Xr&&Xr.binding&&Xr.binding("util")}catch(e){}}();var en=Qr&&Qr.isArrayBuffer,tn=Qr&&Qr.isDate,rn=Qr&&Qr.isMap,nn=Qr&&Qr.isRegExp,sn=Qr&&Qr.isSet,an=Qr&&Qr.isTypedArray;function apply(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function arrayAggregator(e,t,n,i){var s=-1,a=e==null?0:e.length;while(++s-1}function arrayIncludesWith(e,t,n){var i=-1,s=e==null?0:e.length;while(++i-1){}return n}function charsEndIndex(e,t){var n=e.length;while(n--&&baseIndexOf(t,e[n],0)>-1){}return n}function countHolders(e,t){var n=e.length,i=0;while(n--){if(e[n]===t){++i}}return i}var ln=basePropertyOf(Wr);var un=basePropertyOf(qr);function escapeStringChar(e){return"\\"+zr[e]}function getValue(e,t){return e==null?n:e[t]}function hasUnicode(e){return Mr.test(e)}function hasUnicodeWord(e){return Pr.test(e)}function iteratorToArray(e){var t,n=[];while(!(t=e.next()).done){n.push(t.value)}return n}function mapToArray(e){var t=-1,n=Array(e.size);e.forEach((function(e,i){n[++t]=[i,e]}));return n}function overArg(e,t){return function(n){return e(t(n))}}function replaceHolders(e,t){var n=-1,i=e.length,s=0,a=[];while(++n-1}function listCacheSet(e,t){var n=this.__data__,i=assocIndexOf(n,e);if(i<0){++this.size;n.push([e,t])}else{n[i][1]=t}return this}ListCache.prototype.clear=listCacheClear;ListCache.prototype["delete"]=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;function MapCache(e){var t=-1,n=e==null?0:e.length;this.clear();while(++t=t?e:t}}return e}function baseClone(e,t,i,s,a,o){var l,u=t&d,f=t&m,h=t&y;if(i){l=a?i(e,s,a,o):i(e)}if(l!==n){return l}if(!isObject(e)){return e}var g=Si(e);if(g){l=initCloneArray(e);if(!u){return copyArray(e,l)}}else{var v=Ln(e),_=v==me||v==ye;if(ki(e)){return cloneBuffer(e,u)}if(v==xe||v==ne||_&&!a){l=f||_?{}:initCloneObject(e);if(!u){return f?copySymbolsIn(e,baseAssignIn(l,e)):copySymbols(e,baseAssign(l,e))}}else{if(!Nr[v]){return a?e:{}}l=initCloneByTag(e,v,u)}}o||(o=new Stack);var S=o.get(e);if(S){return S}o.set(e,l);if(Ci(e)){e.forEach((function(n){l.add(baseClone(n,t,i,n,e,o))}))}else if(Ri(e)){e.forEach((function(n,s){l.set(s,baseClone(n,t,i,s,e,o))}))}var x=h?f?getAllKeysIn:getAllKeys:f?keysIn:keys;var k=g?n:x(e);arrayEach(k||e,(function(n,s){if(k){s=n;n=e[s]}assignValue(l,s,baseClone(n,t,i,s,e,o))}));return l}function baseConforms(e){var t=keys(e);return function(n){return baseConformsTo(n,e,t)}}function baseConformsTo(e,t,i){var s=i.length;if(e==null){return!s}e=Gt(e);while(s--){var a=i[s],o=t[a],l=e[a];if(l===n&&!(a in e)||!o(l)){return false}}return true}function baseDelay(e,t,i){if(typeof e!="function"){throw new Kt(o)}return Pn((function(){e.apply(n,i)}),t)}function baseDifference(e,t,n,i){var a=-1,o=arrayIncludes,l=true,u=e.length,f=[],h=t.length;if(!u){return f}if(n){t=arrayMap(t,baseUnary(n))}if(i){o=arrayIncludesWith;l=false}else if(t.length>=s){o=cacheHas;l=false;t=new SetCache(t)}e:while(++aa?0:a+i}s=s===n||s>a?a:toInteger(s);if(s<0){s+=a}s=i>s?0:toLength(s);while(i0&&n(l)){if(t>1){baseFlatten(l,t-1,n,i,s)}else{arrayPush(s,l)}}else if(!i){s[s.length]=l}}return s}var Sn=createBaseFor();var xn=createBaseFor(true);function baseForOwn(e,t){return e&&Sn(e,t,keys)}function baseForOwnRight(e,t){return e&&xn(e,t,keys)}function baseFunctions(e,t){return arrayFilter(t,(function(t){return isFunction(e[t])}))}function baseGet(e,t){t=castPath(t,e);var i=0,s=t.length;while(e!=null&&it}function baseHas(e,t){return e!=null&&er.call(e,t)}function baseHasIn(e,t){return e!=null&&t in Gt(e)}function baseInRange(e,t,n){return e>=Lr(t,n)&&e=120&&m.length>=120)?new SetCache(u&&m):n}m=e[0];var y=-1,g=f[0];e:while(++y-1){if(l!==e){dr.call(l,u,1)}dr.call(e,u,1)}}return e}function basePullAt(e,t){var n=e?t.length:0,i=n-1;while(n--){var s=t[n];if(n==i||s!==a){var a=s;if(isIndex(s)){dr.call(e,s,1)}else{baseUnset(e,s)}}}return e}function baseRandom(e,t){return e+xr(Pr()*(t-e+1))}function baseRange(e,n,i,s){var a=-1,o=Ir(Sr((n-e)/(i||1)),0),l=t(o);while(o--){l[s?o:++a]=e;e+=i}return l}function baseRepeat(e,t){var n="";if(!e||t<1||t>K){return n}do{if(t%2){n+=e}t=xr(t/2);if(t){e+=e}}while(t);return n}function baseRest(e,t){return Fn(overRest(e,t,identity),e+"")}function baseSample(e){return arraySample(values(e))}function baseSampleSize(e,t){var n=values(e);return shuffleSelf(n,baseClamp(t,0,n.length))}function baseSet(e,t,i,s){if(!isObject(e)){return e}t=castPath(t,e);var a=-1,o=t.length,l=o-1,u=e;while(u!=null&&++aa?0:a+n}i=i>a?a:i;if(i<0){i+=a}a=n>i?0:i-n>>>0;n>>>=0;var o=t(a);while(++s>>1,o=e[a];if(o!==null&&!isSymbol(o)&&(n?o<=t:o=s){var h=t?null:Cn(e);if(h){return setToArray(h)}l=false;a=cacheHas;f=new SetCache}else{f=t?[]:u}e:while(++i=s?e:baseSlice(e,t,i)}var On=vr||function(e){return Kr.clearTimeout(e)};function cloneBuffer(e,t){if(t){return e.slice()}var n=e.length,i=cr?cr(n):new e.constructor(n);e.copy(i);return i}function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);new ur(t).set(new ur(e));return t}function cloneDataView(e,t){var n=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function cloneRegExp(e){var t=new e.constructor(e.source,Mt.exec(e));t.lastIndex=e.lastIndex;return t}function cloneSymbol(e){return gn?Gt(gn.call(e)):{}}function cloneTypedArray(e,t){var n=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function compareAscending(e,t){if(e!==t){var i=e!==n,s=e===null,a=e===e,o=isSymbol(e);var l=t!==n,u=t===null,f=t===t,h=isSymbol(t);if(!u&&!h&&!o&&e>t||o&&l&&f&&!u&&!h||s&&l&&f||!i&&f||!a){return 1}if(!s&&!o&&!h&&e=l){return u}var f=n[i];return u*(f=="desc"?-1:1)}}return e.index-t.index}function composeArgs(e,n,i,s){var a=-1,o=e.length,l=i.length,u=-1,f=n.length,h=Ir(o-l,0),d=t(f+h),m=!s;while(++u1?i[a-1]:n,l=a>2?i[2]:n;o=e.length>3&&typeof o=="function"?(a--,o):n;if(l&&isIterateeCall(i[0],i[1],l)){o=a<3?n:o;a=1}t=Gt(t);while(++s-1?a[o?t[l]:l]:n}}function createFlow(e){return flatRest((function(t){var i=t.length,s=i,a=LodashWrapper.prototype.thru;if(e){t.reverse()}while(s--){var l=t[s];if(typeof l!="function"){throw new Kt(o)}if(a&&!u&&getFuncName(l)=="wrapper"){var u=new LodashWrapper([],true)}}s=u?s:i;while(++s1){_.reverse()}if(m&&hu)){return false}var h=o.get(e);var d=o.get(t);if(h&&d){return h==t&&d==e}var m=-1,y=true,_=i&v?new SetCache:n;o.set(e,t);o.set(t,e);while(++m1?"& ":"")+t[i];t=t.join(n>2?", ":" ");return e.replace(Ot,"{\n/* [wrapped with "+t+"] */\n")}function isFlattenable(e){return Si(e)||_i(e)||!!(mr&&e&&e[mr])}function isIndex(e,t){var n=typeof e;t=t==null?K:t;return!!t&&(n=="number"||n!="symbol"&&Nt.test(e))&&(e>-1&&e%1==0&&e0){if(++t>=P){return arguments[0]}}else{t=0}return e.apply(n,arguments)}}function shuffleSelf(e,t){var i=-1,s=e.length,a=s-1;t=t===n?s:t;while(++i1?e[t-1]:n;i=typeof i=="function"?(e.pop(),i):n;return unzipWith(e,i)}));function chain(e){var t=lodash(e);t.__chain__=true;return t}function tap(e,t){t(e);return e}function thru(e,t){return t(e)}var ti=flatRest((function(e){var t=e.length,i=t?e[0]:0,s=this.__wrapped__,interceptor=function(t){return baseAt(t,e)};if(t>1||this.__actions__.length||!(s instanceof LazyWrapper)||!isIndex(i)){return this.thru(interceptor)}s=s.slice(i,+i+(t?1:0));s.__actions__.push({func:thru,args:[interceptor],thisArg:n});return new LodashWrapper(s,this.__chain__).thru((function(e){if(t&&!e.length){e.push(n)}return e}))}));function wrapperChain(){return chain(this)}function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__)}function wrapperNext(){if(this.__values__===n){this.__values__=toArray(this.value())}var e=this.__index__>=this.__values__.length,t=e?n:this.__values__[this.__index__++];return{done:e,value:t}}function wrapperToIterator(){return this}function wrapperPlant(e){var t,i=this;while(i instanceof baseLodash){var s=wrapperClone(i);s.__index__=0;s.__values__=n;if(t){a.__wrapped__=s}else{t=s}var a=s;i=i.__wrapped__}a.__wrapped__=e;return t}function wrapperReverse(){var e=this.__wrapped__;if(e instanceof LazyWrapper){var t=e;if(this.__actions__.length){t=new LazyWrapper(this)}t=t.reverse();t.__actions__.push({func:thru,args:[reverse],thisArg:n});return new LodashWrapper(t,this.__chain__)}return this.thru(reverse)}function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)}var ri=createAggregator((function(e,t,n){if(er.call(e,n)){++e[n]}else{baseAssignValue(e,n,1)}}));function every(e,t,i){var s=Si(e)?arrayEvery:baseEvery;if(i&&isIterateeCall(e,t,i)){t=n}return s(e,getIteratee(t,3))}function filter(e,t){var n=Si(e)?arrayFilter:baseFilter;return n(e,getIteratee(t,3))}var ni=createFind(findIndex);var ii=createFind(findLastIndex);function flatMap(e,t){return baseFlatten(map(e,t),1)}function flatMapDeep(e,t){return baseFlatten(map(e,t),V)}function flatMapDepth(e,t,i){i=i===n?1:toInteger(i);return baseFlatten(map(e,t),i)}function forEach(e,t){var n=Si(e)?arrayEach:wn;return n(e,getIteratee(t,3))}function forEachRight(e,t){var n=Si(e)?arrayEachRight:_n;return n(e,getIteratee(t,3))}var si=createAggregator((function(e,t,n){if(er.call(e,n)){e[n].push(t)}else{baseAssignValue(e,n,[t])}}));function includes(e,t,n,i){e=isArrayLike(e)?e:values(e);n=n&&!i?toInteger(n):0;var s=e.length;if(n<0){n=Ir(s+n,0)}return isString(e)?n<=s&&e.indexOf(t,n)>-1:!!s&&baseIndexOf(e,t,n)>-1}var ai=baseRest((function(e,n,i){var s=-1,a=typeof n=="function",o=isArrayLike(e)?t(e.length):[];wn(e,(function(e){o[++s]=a?apply(n,e,i):baseInvoke(e,n,i)}));return o}));var oi=createAggregator((function(e,t,n){baseAssignValue(e,n,t)}));function map(e,t){var n=Si(e)?arrayMap:baseMap;return n(e,getIteratee(t,3))}function orderBy(e,t,i,s){if(e==null){return[]}if(!Si(t)){t=t==null?[]:[t]}i=s?n:i;if(!Si(i)){i=i==null?[]:[i]}return baseOrderBy(e,t,i)}var li=createAggregator((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));function reduce(e,t,n){var i=Si(e)?arrayReduce:baseReduce,s=arguments.length<3;return i(e,getIteratee(t,4),n,s,wn)}function reduceRight(e,t,n){var i=Si(e)?arrayReduceRight:baseReduce,s=arguments.length<3;return i(e,getIteratee(t,4),n,s,_n)}function reject(e,t){var n=Si(e)?arrayFilter:baseFilter;return n(e,negate(getIteratee(t,3)))}function sample(e){var t=Si(e)?arraySample:baseSample;return t(e)}function sampleSize(e,t,i){if(i?isIterateeCall(e,t,i):t===n){t=1}else{t=toInteger(t)}var s=Si(e)?arraySampleSize:baseSampleSize;return s(e,t)}function shuffle(e){var t=Si(e)?arrayShuffle:baseShuffle;return t(e)}function size(e){if(e==null){return 0}if(isArrayLike(e)){return isString(e)?stringSize(e):e.length}var t=Ln(e);if(t==be||t==Oe){return e.size}return baseKeys(e).length}function some(e,t,i){var s=Si(e)?arraySome:baseSome;if(i&&isIterateeCall(e,t,i)){t=n}return s(e,getIteratee(t,3))}var ui=baseRest((function(e,t){if(e==null){return[]}var n=t.length;if(n>1&&isIterateeCall(e,t[0],t[1])){t=[]}else if(n>2&&isIterateeCall(t[0],t[1],t[2])){t=[t[0]]}return baseOrderBy(e,baseFlatten(t,1),[])}));var ci=wr||function(){return Kr.Date.now()};function after(e,t){if(typeof t!="function"){throw new Kt(o)}e=toInteger(e);return function(){if(--e<1){return t.apply(this,arguments)}}}function ary(e,t,i){t=i?n:t;t=e&&t==null?e.length:t;return createWrap(e,C,n,n,n,n,t)}function before(e,t){var i;if(typeof t!="function"){throw new Kt(o)}e=toInteger(e);return function(){if(--e>0){i=t.apply(this,arguments)}if(e<=1){t=n}return i}}var fi=baseRest((function(e,t,n){var i=_;if(n.length){var s=replaceHolders(n,getHolder(fi));i|=R}return createWrap(e,i,t,n,s)}));var hi=baseRest((function(e,t,n){var i=_|S;if(n.length){var s=replaceHolders(n,getHolder(hi));i|=R}return createWrap(t,i,e,n,s)}));function curry(e,t,i){t=i?n:t;var s=createWrap(e,k,n,n,n,n,n,t);s.placeholder=curry.placeholder;return s}function curryRight(e,t,i){t=i?n:t;var s=createWrap(e,E,n,n,n,n,n,t);s.placeholder=curryRight.placeholder;return s}function debounce(e,t,i){var s,a,l,u,f,h,d=0,m=false,y=false,g=true;if(typeof e!="function"){throw new Kt(o)}t=toNumber(t)||0;if(isObject(i)){m=!!i.leading;y="maxWait"in i;l=y?Ir(toNumber(i.maxWait)||0,t):l;g="trailing"in i?!!i.trailing:g}function invokeFunc(t){var i=s,o=a;s=a=n;d=t;u=e.apply(o,i);return u}function leadingEdge(e){d=e;f=Pn(timerExpired,t);return m?invokeFunc(e):u}function remainingWait(e){var n=e-h,i=e-d,s=t-n;return y?Lr(s,l-i):s}function shouldInvoke(e){var i=e-h,s=e-d;return h===n||i>=t||i<0||y&&s>=l}function timerExpired(){var e=ci();if(shouldInvoke(e)){return trailingEdge(e)}f=Pn(timerExpired,remainingWait(e))}function trailingEdge(e){f=n;if(g&&s){return invokeFunc(e)}s=a=n;return u}function cancel(){if(f!==n){On(f)}d=0;s=h=a=f=n}function flush(){return f===n?u:trailingEdge(ci())}function debounced(){var e=ci(),i=shouldInvoke(e);s=arguments;a=this;h=e;if(i){if(f===n){return leadingEdge(h)}if(y){On(f);f=Pn(timerExpired,t);return invokeFunc(h)}}if(f===n){f=Pn(timerExpired,t)}return u}debounced.cancel=cancel;debounced.flush=flush;return debounced}var pi=baseRest((function(e,t){return baseDelay(e,1,t)}));var di=baseRest((function(e,t,n){return baseDelay(e,toNumber(t)||0,n)}));function flip(e){return createWrap(e,j)}function memoize(e,t){if(typeof e!="function"||t!=null&&typeof t!="function"){throw new Kt(o)}var memoized=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=memoized.cache;if(s.has(i)){return s.get(i)}var a=e.apply(this,n);memoized.cache=s.set(i,a)||s;return a};memoized.cache=new(memoize.Cache||MapCache);return memoized}memoize.Cache=MapCache;function negate(e){if(typeof e!="function"){throw new Kt(o)}return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function once(e){return before(2,e)}var mi=Rn((function(e,t){t=t.length==1&&Si(t[0])?arrayMap(t[0],baseUnary(getIteratee())):arrayMap(baseFlatten(t,1),baseUnary(getIteratee()));var n=t.length;return baseRest((function(i){var s=-1,a=Lr(i.length,n);while(++s=t}));var _i=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&er.call(e,"callee")&&!pr.call(e,"callee")};var Si=t.isArray;var xi=en?baseUnary(en):baseIsArrayBuffer;function isArrayLike(e){return e!=null&&isLength(e.length)&&!isFunction(e)}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}function isBoolean(e){return e===true||e===false||isObjectLike(e)&&baseGetTag(e)==oe}var ki=Er||stubFalse;var Ei=tn?baseUnary(tn):baseIsDate;function isElement(e){return isObjectLike(e)&&e.nodeType===1&&!isPlainObject(e)}function isEmpty(e){if(e==null){return true}if(isArrayLike(e)&&(Si(e)||typeof e=="string"||typeof e.splice=="function"||ki(e)||Ii(e)||_i(e))){return!e.length}var t=Ln(e);if(t==be||t==Oe){return!e.size}if(isPrototype(e)){return!baseKeys(e).length}for(var n in e){if(er.call(e,n)){return false}}return true}function isEqual(e,t){return baseIsEqual(e,t)}function isEqualWith(e,t,i){i=typeof i=="function"?i:n;var s=i?i(e,t):n;return s===n?baseIsEqual(e,t,n,i):!!s}function isError(e){if(!isObjectLike(e)){return false}var t=baseGetTag(e);return t==de||t==fe||typeof e.message=="string"&&typeof e.name=="string"&&!isPlainObject(e)}function isFinite(e){return typeof e=="number"&&Rr(e)}function isFunction(e){if(!isObject(e)){return false}var t=baseGetTag(e);return t==me||t==ye||t==ae||t==Ee}function isInteger(e){return typeof e=="number"&&e==toInteger(e)}function isLength(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=K}function isObject(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function isObjectLike(e){return e!=null&&typeof e=="object"}var Ri=rn?baseUnary(rn):baseIsMap;function isMatch(e,t){return e===t||baseIsMatch(e,t,getMatchData(t))}function isMatchWith(e,t,i){i=typeof i=="function"?i:n;return baseIsMatch(e,t,getMatchData(t),i)}function isNaN(e){return isNumber(e)&&e!=+e}function isNative(e){if(An(e)){throw new Tt(a)}return baseIsNative(e)}function isNull(e){return e===null}function isNil(e){return e==null}function isNumber(e){return typeof e=="number"||isObjectLike(e)&&baseGetTag(e)==we}function isPlainObject(e){if(!isObjectLike(e)||baseGetTag(e)!=xe){return false}var t=fr(e);if(t===null){return true}var n=er.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Qt.call(n)==ir}var Oi=nn?baseUnary(nn):baseIsRegExp;function isSafeInteger(e){return isInteger(e)&&e>=-K&&e<=K}var Ci=sn?baseUnary(sn):baseIsSet;function isString(e){return typeof e=="string"||!Si(e)&&isObjectLike(e)&&baseGetTag(e)==Me}function isSymbol(e){return typeof e=="symbol"||isObjectLike(e)&&baseGetTag(e)==Fe}var Ii=an?baseUnary(an):baseIsTypedArray;function isUndefined(e){return e===n}function isWeakMap(e){return isObjectLike(e)&&Ln(e)==Be}function isWeakSet(e){return isObjectLike(e)&&baseGetTag(e)==Ne}var Ti=createRelationalOperation(baseLt);var ji=createRelationalOperation((function(e,t){return e<=t}));function toArray(e){if(!e){return[]}if(isArrayLike(e)){return isString(e)?stringToArray(e):copyArray(e)}if(yr&&e[yr]){return iteratorToArray(e[yr]())}var t=Ln(e),n=t==be?mapToArray:t==Oe?setToArray:values;return n(e)}function toFinite(e){if(!e){return e===0?e:0}e=toNumber(e);if(e===V||e===-V){var t=e<0?-1:1;return t*Y}return e===e?e:0}function toInteger(e){var t=toFinite(e),n=t%1;return t===t?n?t-n:t:0}function toLength(e){return e?baseClamp(toInteger(e),0,X):0}function toNumber(e){if(typeof e=="number"){return e}if(isSymbol(e)){return J}if(isObject(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=isObject(t)?t+"":t}if(typeof e!="string"){return e===0?e:+e}e=baseTrim(e);var n=Ft.test(e);return n||Bt.test(e)?Gr(e.slice(2),n?2:8):Pt.test(e)?J:+e}function toPlainObject(e){return copyObject(e,keysIn(e))}function toSafeInteger(e){return e?baseClamp(toInteger(e),-K,K):e===0?e:0}function toString(e){return e==null?"":baseToString(e)}var Li=createAssigner((function(e,t){if(isPrototype(t)||isArrayLike(t)){copyObject(t,keys(t),e);return}for(var n in t){if(er.call(t,n)){assignValue(e,n,t[n])}}}));var Ai=createAssigner((function(e,t){copyObject(t,keysIn(t),e)}));var Mi=createAssigner((function(e,t,n,i){copyObject(t,keysIn(t),e,i)}));var Pi=createAssigner((function(e,t,n,i){copyObject(t,keys(t),e,i)}));var Fi=flatRest(baseAt);function create(e,t){var n=vn(e);return t==null?n:baseAssign(n,t)}var Di=baseRest((function(e,t){e=Gt(e);var i=-1;var s=t.length;var a=s>2?t[2]:n;if(a&&isIterateeCall(t[0],t[1],a)){s=1}while(++i1);return t}));copyObject(e,getAllKeysIn(e),n);if(i){n=baseClone(n,d|m|y,customOmitClone)}var s=t.length;while(s--){baseUnset(n,t[s])}return n}));function omitBy(e,t){return pickBy(e,negate(getIteratee(t)))}var Gi=flatRest((function(e,t){return e==null?{}:basePick(e,t)}));function pickBy(e,t){if(e==null){return{}}var n=arrayMap(getAllKeysIn(e),(function(e){return[e]}));t=getIteratee(t);return basePickBy(e,n,(function(e,n){return t(e,n[0])}))}function result(e,t,i){t=castPath(t,e);var s=-1,a=t.length;if(!a){a=1;e=n}while(++st){var s=e;e=t;t=s}if(i||e%1||t%1){var a=Pr();return Lr(e+a*(t-e+Ur("1e-"+((a+"").length-1))),t)}return baseRandom(e,t)}var Ki=createCompounder((function(e,t,n){t=t.toLowerCase();return e+(n?capitalize(t):t)}));function capitalize(e){return ts(toString(e).toLowerCase())}function deburr(e){e=toString(e);return e&&e.replace(Wt,ln).replace(jr,"")}function endsWith(e,t,i){e=toString(e);t=baseToString(t);var s=e.length;i=i===n?s:baseClamp(toInteger(i),0,s);var a=i;i-=t.length;return i>=0&&e.slice(i,a)==t}function escape(e){e=toString(e);return e&&yt.test(e)?e.replace(dt,un):e}function escapeRegExp(e){e=toString(e);return e&&kt.test(e)?e.replace(xt,"\\$&"):e}var Yi=createCompounder((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}));var Ji=createCompounder((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}));var Zi=createCaseFirst("toLowerCase");function pad(e,t,n){e=toString(e);t=toInteger(t);var i=t?stringSize(e):0;if(!t||i>=t){return e}var s=(t-i)/2;return createPadding(xr(s),n)+e+createPadding(Sr(s),n)}function padEnd(e,t,n){e=toString(e);t=toInteger(t);var i=t?stringSize(e):0;return t&&i>>0;if(!i){return[]}e=toString(e);if(e&&(typeof t=="string"||t!=null&&!Oi(t))){t=baseToString(t);if(!t&&hasUnicode(e)){return castSlice(stringToArray(e),0,i)}}return e.split(t,i)}var Qi=createCompounder((function(e,t,n){return e+(n?" ":"")+ts(t)}));function startsWith(e,t,n){e=toString(e);n=n==null?0:baseClamp(toInteger(n),0,e.length);t=baseToString(t);return e.slice(n,n+t.length)==t}function template(e,t,i){var s=lodash.templateSettings;if(i&&isIterateeCall(e,t,i)){t=n}e=toString(e);t=Mi({},t,s,customDefaultsAssignIn);var a=Mi({},t.imports,s.imports,customDefaultsAssignIn),o=keys(a),u=baseValues(a,o);var f,h,d=0,m=t.interpolate||qt,y="__p += '";var g=Ht((t.escape||qt).source+"|"+m.source+"|"+(m===vt?At:qt).source+"|"+(t.evaluate||qt).source+"|$","g");var v="//# sourceURL="+(er.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Dr+"]")+"\n";e.replace(g,(function(t,n,i,s,a,o){i||(i=s);y+=e.slice(d,o).replace($t,escapeStringChar);if(n){f=true;y+="' +\n__e("+n+") +\n'"}if(a){h=true;y+="';\n"+a+";\n__p += '"}if(i){y+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"}d=o+t.length;return t}));y+="';\n";var _=er.call(t,"variable")&&t.variable;if(!_){y="with (obj) {\n"+y+"\n}\n"}else if(jt.test(_)){throw new Tt(l)}y=(h?y.replace(ct,""):y).replace(ft,"$1").replace(ht,"$1;");y="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(f?", __e = _.escape":"")+(h?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+y+"return __p\n}";var S=rs((function(){return zt(o,v+"return "+y).apply(n,u)}));S.source=y;if(isError(S)){throw S}return S}function toLower(e){return toString(e).toLowerCase()}function toUpper(e){return toString(e).toUpperCase()}function trim(e,t,i){e=toString(e);if(e&&(i||t===n)){return baseTrim(e)}if(!e||!(t=baseToString(t))){return e}var s=stringToArray(e),a=stringToArray(t),o=charsStartIndex(s,a),l=charsEndIndex(s,a)+1;return castSlice(s,o,l).join("")}function trimEnd(e,t,i){e=toString(e);if(e&&(i||t===n)){return e.slice(0,trimmedEndIndex(e)+1)}if(!e||!(t=baseToString(t))){return e}var s=stringToArray(e),a=charsEndIndex(s,stringToArray(t))+1;return castSlice(s,0,a).join("")}function trimStart(e,t,i){e=toString(e);if(e&&(i||t===n)){return e.replace(Et,"")}if(!e||!(t=baseToString(t))){return e}var s=stringToArray(e),a=charsStartIndex(s,stringToArray(t));return castSlice(s,a).join("")}function truncate(e,t){var i=A,s=M;if(isObject(t)){var a="separator"in t?t.separator:a;i="length"in t?toInteger(t.length):i;s="omission"in t?baseToString(t.omission):s}e=toString(e);var o=e.length;if(hasUnicode(e)){var l=stringToArray(e);o=l.length}if(i>=o){return e}var u=i-stringSize(s);if(u<1){return s}var f=l?castSlice(l,0,u).join(""):e.slice(0,u);if(a===n){return f+s}if(l){u+=f.length-u}if(Oi(a)){if(e.slice(u).search(a)){var h,d=f;if(!a.global){a=Ht(a.source,toString(Mt.exec(a))+"g")}a.lastIndex=0;while(h=a.exec(d)){var m=h.index}f=f.slice(0,m===n?u:m)}}else if(e.indexOf(baseToString(a),u)!=u){var y=f.lastIndexOf(a);if(y>-1){f=f.slice(0,y)}}return f+s}function unescape(e){e=toString(e);return e&&mt.test(e)?e.replace(pt,cn):e}var es=createCompounder((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}));var ts=createCaseFirst("toUpperCase");function words(e,t,i){e=toString(e);t=i?n:t;if(t===n){return hasUnicodeWord(e)?unicodeWords(e):asciiWords(e)}return e.match(t)||[]}var rs=baseRest((function(e,t){try{return apply(e,n,t)}catch(e){return isError(e)?e:new Tt(e)}}));var ns=flatRest((function(e,t){arrayEach(t,(function(t){t=toKey(t);baseAssignValue(e,t,fi(e[t],e))}));return e}));function cond(e){var t=e==null?0:e.length,n=getIteratee();e=!t?[]:arrayMap(e,(function(e){if(typeof e[1]!="function"){throw new Kt(o)}return[n(e[0]),e[1]]}));return baseRest((function(n){var i=-1;while(++iK){return[]}var n=X,i=Lr(e,X);t=getIteratee(t);e-=X;var s=baseTimes(i,t);while(++n0||t<0)){return new LazyWrapper(i)}if(e<0){i=i.takeRight(-e)}else if(e){i=i.drop(e)}if(t!==n){t=toInteger(t);i=t<0?i.dropRight(-t):i.take(t-e)}return i};LazyWrapper.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()};LazyWrapper.prototype.toArray=function(){return this.take(X)};baseForOwn(LazyWrapper.prototype,(function(e,t){var i=/^(?:filter|find|map|reject)|While$/.test(t),s=/^(?:head|last)$/.test(t),a=lodash[s?"take"+(t=="last"?"Right":""):t],o=s||/^find/.test(t);if(!a){return}lodash.prototype[t]=function(){var t=this.__wrapped__,l=s?[1]:arguments,u=t instanceof LazyWrapper,f=l[0],h=u||Si(t);var interceptor=function(e){var t=a.apply(lodash,arrayPush([e],l));return s&&d?t[0]:t};if(h&&i&&typeof f=="function"&&f.length!=1){u=h=false}var d=this.__chain__,m=!!this.__actions__.length,y=o&&!d,g=u&&!m;if(!o&&h){t=g?t:new LazyWrapper(this);var v=e.apply(t,l);v.__actions__.push({func:thru,args:[interceptor],thisArg:n});return new LodashWrapper(v,d)}if(y&&g){return e.apply(this,l)}v=this.thru(interceptor);return y?s?v.value()[0]:v.value():v}}));arrayEach(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Yt[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);lodash.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var s=this.value();return t.apply(Si(s)?s:[],e)}return this[n]((function(n){return t.apply(Si(n)?n:[],e)}))}}));baseForOwn(LazyWrapper.prototype,(function(e,t){var n=lodash[t];if(n){var i=n.name+"";if(!er.call(Xr,i)){Xr[i]=[]}Xr[i].push({name:t,func:n})}}));Xr[createHybrid(n,S).name]=[{name:"wrapper",func:n}];LazyWrapper.prototype.clone=lazyClone;LazyWrapper.prototype.reverse=lazyReverse;LazyWrapper.prototype.value=lazyValue;lodash.prototype.at=ti;lodash.prototype.chain=wrapperChain;lodash.prototype.commit=wrapperCommit;lodash.prototype.next=wrapperNext;lodash.prototype.plant=wrapperPlant;lodash.prototype.reverse=wrapperReverse;lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=wrapperValue;lodash.prototype.first=lodash.prototype.head;if(yr){lodash.prototype[yr]=wrapperToIterator}return lodash};var pn=hn();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){Kr._=pn;define((function(){return pn}))}else if(Jr){(Jr.exports=pn)._=pn;Yr._=pn}else{Kr._=pn}}).call(this)},3479:(e,t,n)=>{"use strict";const i=n(8818);const s=n(9228);const a={info:i.blue("ℹ"),success:i.green("✔"),warning:i.yellow("⚠"),error:i.red("✖")};const o={info:i.blue("i"),success:i.green("√"),warning:i.yellow("‼"),error:i.red("×")};e.exports=s()?a:o},6047:e=>{"use strict";const mimicFn=(e,t)=>{for(const n of Reflect.ownKeys(t)){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}return e};e.exports=mimicFn;e.exports["default"]=mimicFn},9082:(e,t,n)=>{"use strict";const i=n(6047);const s=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let n;let a=0;const o=e.displayName||e.name||"";const onetime=function(...i){s.set(onetime,++a);if(a===1){n=e.apply(this,i);e=null}else if(t.throw===true){throw new Error(`Function \`${o}\` can only be called once`)}return n};i(onetime,e);s.set(onetime,a);return onetime};e.exports=onetime;e.exports["default"]=onetime;e.exports.callCount=e=>{if(!s.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return s.get(e)}},970:(e,t,n)=>{"use strict";const i=n(4521);const s=n(8818);const a=n(9482);const o=n(2031);const l=n(3479);const u=n(5591);const f=n(5917);const h=n(284);const d=n(9228);const{BufferListStream:m}=n(336);const y=Symbol("text");const g=Symbol("prefixText");const v=3;class StdinDiscarder{constructor(){this.requests=0;this.mutedStream=new m;this.mutedStream.pipe(process.stdout);const e=this;this.ourEmit=function(t,n,...i){const{stdin:s}=process;if(e.requests>0||s.emit===e.ourEmit){if(t==="keypress"){return}if(t==="data"&&n.includes(v)){process.emit("SIGINT")}Reflect.apply(e.oldEmit,this,[t,n,...i])}else{Reflect.apply(process.stdin.emit,this,[t,n,...i])}}}start(){this.requests++;if(this.requests===1){this.realStart()}}stop(){if(this.requests<=0){throw new Error("`stop` called more times than `start`")}this.requests--;if(this.requests===0){this.realStop()}}realStart(){if(process.platform==="win32"){return}this.rl=i.createInterface({input:process.stdin,output:this.mutedStream});this.rl.on("SIGINT",(()=>{if(process.listenerCount("SIGINT")===0){process.emit("SIGINT")}else{this.rl.close();process.kill(process.pid,"SIGINT")}}))}realStop(){if(process.platform==="win32"){return}this.rl.close();this.rl=undefined}}let _;class Ora{constructor(e){if(!_){_=new StdinDiscarder}if(typeof e==="string"){e={text:e}}this.options={text:"",color:"cyan",stream:process.stderr,discardStdin:true,...e};this.spinner=this.options.spinner;this.color=this.options.color;this.hideCursor=this.options.hideCursor!==false;this.interval=this.options.interval||this.spinner.interval||100;this.stream=this.options.stream;this.id=undefined;this.isEnabled=typeof this.options.isEnabled==="boolean"?this.options.isEnabled:h({stream:this.stream});this.isSilent=typeof this.options.isSilent==="boolean"?this.options.isSilent:false;this.text=this.options.text;this.prefixText=this.options.prefixText;this.linesToClear=0;this.indent=this.options.indent;this.discardStdin=this.options.discardStdin;this.isDiscardingStdin=false}get indent(){return this._indent}set indent(e=0){if(!(e>=0&&Number.isInteger(e))){throw new Error("The `indent` option must be an integer from 0 and up")}this._indent=e}_updateInterval(e){if(e!==undefined){this.interval=e}}get spinner(){return this._spinner}set spinner(e){this.frameIndex=0;if(typeof e==="object"){if(e.frames===undefined){throw new Error("The given spinner must have a `frames` property")}this._spinner=e}else if(!d()){this._spinner=o.line}else if(e===undefined){this._spinner=o.dots}else if(e!=="default"&&o[e]){this._spinner=o[e]}else{throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}this._updateInterval(this._spinner.interval)}get text(){return this[y]}set text(e){this[y]=e;this.updateLineCount()}get prefixText(){return this[g]}set prefixText(e){this[g]=e;this.updateLineCount()}get isSpinning(){return this.id!==undefined}getFullPrefixText(e=this[g],t=" "){if(typeof e==="string"){return e+t}if(typeof e==="function"){return e()+t}return""}updateLineCount(){const e=this.stream.columns||80;const t=this.getFullPrefixText(this.prefixText,"-");this.lineCount=0;for(const n of u(t+"--"+this[y]).split("\n")){this.lineCount+=Math.max(1,Math.ceil(f(n)/e))}}get isEnabled(){return this._isEnabled&&!this.isSilent}set isEnabled(e){if(typeof e!=="boolean"){throw new TypeError("The `isEnabled` option must be a boolean")}this._isEnabled=e}get isSilent(){return this._isSilent}set isSilent(e){if(typeof e!=="boolean"){throw new TypeError("The `isSilent` option must be a boolean")}this._isSilent=e}frame(){const{frames:e}=this.spinner;let t=e[this.frameIndex];if(this.color){t=s[this.color](t)}this.frameIndex=++this.frameIndex%e.length;const n=typeof this.prefixText==="string"&&this.prefixText!==""?this.prefixText+" ":"";const i=typeof this.text==="string"?" "+this.text:"";return n+t+i}clear(){if(!this.isEnabled||!this.stream.isTTY){return this}for(let e=0;e0){this.stream.moveCursor(0,-1)}this.stream.clearLine();this.stream.cursorTo(this.indent)}this.linesToClear=0;return this}render(){if(this.isSilent){return this}this.clear();this.stream.write(this.frame());this.linesToClear=this.lineCount;return this}start(e){if(e){this.text=e}if(this.isSilent){return this}if(!this.isEnabled){if(this.text){this.stream.write(`- ${this.text}\n`)}return this}if(this.isSpinning){return this}if(this.hideCursor){a.hide(this.stream)}if(this.discardStdin&&process.stdin.isTTY){this.isDiscardingStdin=true;_.start()}this.render();this.id=setInterval(this.render.bind(this),this.interval);return this}stop(){if(!this.isEnabled){return this}clearInterval(this.id);this.id=undefined;this.frameIndex=0;this.clear();if(this.hideCursor){a.show(this.stream)}if(this.discardStdin&&process.stdin.isTTY&&this.isDiscardingStdin){_.stop();this.isDiscardingStdin=false}return this}succeed(e){return this.stopAndPersist({symbol:l.success,text:e})}fail(e){return this.stopAndPersist({symbol:l.error,text:e})}warn(e){return this.stopAndPersist({symbol:l.warning,text:e})}info(e){return this.stopAndPersist({symbol:l.info,text:e})}stopAndPersist(e={}){if(this.isSilent){return this}const t=e.prefixText||this.prefixText;const n=e.text||this.text;const i=typeof n==="string"?" "+n:"";this.stop();this.stream.write(`${this.getFullPrefixText(t," ")}${e.symbol||" "}${i}\n`);return this}}const oraFactory=function(e){return new Ora(e)};e.exports=oraFactory;e.exports.promise=(e,t)=>{if(typeof e.then!=="function"){throw new TypeError("Parameter `action` must be a Promise")}const n=new Ora(t);n.start();(async()=>{try{await e;n.succeed()}catch{n.fail()}})();return n}},1618:(e,t,n)=>{"use strict"; -/*! - * pretty-time - * - * Copyright (c) 2015-2018, present, Jon Schlinkert. - * Released under the MIT License. - */const i=n(7492);e.exports=(e,t,n)=>{const s=/^[0-9]+$/.test(e);if(!s&&!Array.isArray(e)){throw new TypeError("expected an array or number in nanoseconds")}if(Array.isArray(e)&&e.length!==2){throw new TypeError("expected an array from process.hrtime()")}if(/^[0-9]+$/.test(t)){n=t;t=null}let a=s?e:i.nano(e);let o="";let l;for(const e of Object.keys(i.scale)){const s=i.scale[e];let u=a/s;if(t&&i.isSmallest(e,t)){u=i.round(u,n);if(l&&u===l/s)--u;o+=u+e;return o.trim()}if(u<1)continue;if(!t){u=i.round(u,n);o+=u+e;return o}l=s;u=Math.floor(u);a-=u*s;o+=u+e+" "}return o.trim()}},7492:(e,t)=>{t.nano=e=>+e[0]*1e9+ +e[1];t.scale={w:6048e11,d:864e11,h:36e11,m:6e10,s:1e9,ms:1e6,"μs":1e3,ns:1};t.regex={w:/^(w((ee)?k)?s?)$/,d:/^(d(ay)?s?)$/,h:/^(h((ou)?r)?s?)$/,m:/^(min(ute)?s?|m)$/,s:/^((sec(ond)?)s?|s)$/,ms:/^(milli(second)?s?|ms)$/,"μs":/^(micro(second)?s?|μs)$/,ns:/^(nano(second)?s?|ns?)$/};t.isSmallest=function(e,n){return t.regex[e].test(n)};t.round=function(e,t){const n=Math.abs(e);return/[0-9]/.test(t)?n.toFixed(t):Math.round(n)}},8433:(e,t,n)=>{"use strict";var i=n(7522);function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=_interopDefaultLegacy(i);function _extends(){_extends=Object.assign||function(e){for(var t=1;t0){var n=_extends({},e.state);for(var i=0,s=t.length;i0){var u=e[e.length-1].shift();if(void 0!==u){var f=visitElement(u,s,a);e.push(f);t.push(flushPrevContextMap());n.push(flushPrevContextStore());i.push(getCurrentErrorFrame())}else{e.pop();restoreContextMap(t.pop());restoreContextStore(n.pop());setCurrentErrorFrame(i.pop())}if(de&&Date.now()-l>5){return!0}}return!1}catch(e){var h=getCurrentErrorFrame();if(!h){throw e}h.error=e;s.unshift(h);return!1}finally{fe.current=o}};var makeYieldFrame=function(e,t,n,i){return{contextMap:getCurrentContextMap(),contextStore:getCurrentContextStore(),errorFrame:getCurrentErrorFrame(),thenable:null,kind:"frame.yield",traversalChildren:e,traversalMap:t,traversalStore:n,traversalErrorFrame:i}};var visit=function(e,t,n){var i=[e];var s=[flushPrevContextMap()];var a=[flushPrevContextStore()];var o=[getCurrentErrorFrame()];if(visitLoop(i,s,a,o,t,n)){t.unshift(makeYieldFrame(i,s,a,o))}};var update=function(e,t,n){if("frame.yield"===e.kind){setCurrentIdentity(null);setCurrentContextMap(e.contextMap);setCurrentContextStore(e.contextStore);setCurrentErrorFrame(e.errorFrame);if(visitLoop(e.traversalChildren,e.traversalMap,e.traversalStore,e.traversalErrorFrame,t,n)){t.unshift(makeYieldFrame(e.traversalChildren,e.traversalMap,e.traversalStore,e.traversalErrorFrame))}}else{var i=fe.current;var s=null;fe.current=le;try{if("frame.class"===e.kind){s=function(e,t){setCurrentIdentity(null);setCurrentContextMap(t.contextMap);setCurrentContextStore(t.contextStore);setCurrentErrorFrame(t.errorFrame);if(t.error){if(++t.instance.updater._thrown>=25){return null}t.instance._isMounted=!0;if("function"==typeof t.instance.componentDidCatch){t.instance.componentDidCatch(t.error)}if("function"==typeof t.type.getDerivedStateFromError){t.instance.updater.enqueueSetState(t.instance,t.type.getDerivedStateFromError(t.error))}}return render$1(t.type,t.instance,e)}(t,e)}else if("frame.hooks"===e.kind){s=function(e,t){setFirstHook(t.hook);setCurrentIdentity(t.id);setCurrentContextMap(t.contextMap);setCurrentContextStore(t.contextStore);setCurrentErrorFrame(t.errorFrame);return render$2(t.type,t.props,e)}(t,e)}else if("frame.lazy"===e.kind){s=function(e,t){setCurrentIdentity(null);setCurrentContextMap(t.contextMap);setCurrentContextStore(t.contextStore);setCurrentErrorFrame(t.errorFrame);return render$3(t.type,t.props)}(0,e)}}catch(e){var a=getCurrentErrorFrame();if(!a){throw e}a.error=e;t.unshift(a);s=null}finally{fe.current=i}visit(getChildrenArray(s),t,n)}};function _ref(e,t){setImmediate(e)}var flushFrames=function(e,t,n){var i=e.shift();if(!i){return Promise.resolve()}if(de&&"frame.yield"===i.kind){i.thenable=new Promise(_ref)}return Promise.resolve(i.thenable).then((function(){!function(e){X.current=e}(n);update(i,e,t);return flushFrames(e,t,n)}),(function(n){if(!i.errorFrame){throw n}i.errorFrame.error=n;update(i.errorFrame,e,t)}))};var defaultVisitor=function(){return};e.exports=function(e,t){if(!t){t=defaultVisitor}var n=[];var i=X.current={uniqueID:0};setCurrentContextMap({});setCurrentContextStore(new Map);setCurrentErrorFrame(null);try{visit(getChildrenArray(e),n,t)}catch(e){return Promise.reject(e)}return flushFrames(n,t,i)}},5847:(e,t,n)=>{"use strict";const i=n(9082);const s=n(4931);e.exports=i((()=>{s((()=>{process.stderr.write("[?25h")}),{alwaysLast:true})}))},8197:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(t.hasOwnProperty(n))e[n]=t[n]};return function(t,n){e(t,n);function __(){this.constructor=t}t.prototype=n===null?Object.create(n):(__.prototype=n.prototype,new __)}}();t.__esModule=true;var s=n(2950);var a=function(e){i(Lock,e);function Lock(){return e.call(this,1)||this}return Lock}(s["default"]);t.Lock=a},2950:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(s,a){function fulfilled(e){try{step(i.next(e))}catch(e){a(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){a(e)}}function step(e){e.done?s(e.value):new n((function(t){t(e.value)})).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,s,a;return{next:verb(0),throw:verb(1),return:verb(2)};function verb(e){return function(t){return step([e,t])}}function step(o){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,s&&(a=s[o[0]&2?"return":o[0]?"throw":"next"])&&!(a=a.call(s,o[1])).done)return a;if(s=0,a)o=[0,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;s=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]0){this.permits-=1;return[2,Promise.resolve(true)]}return[2,new Promise((function(t){return e.promiseResolverQueue.push(t)}))]}))}))};Semaphore.prototype.acquire=function(){return n(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.wait()]}))}))};Semaphore.prototype.waitFor=function(e){return n(this,void 0,void 0,(function(){var t=this;var n,s;return i(this,(function(i){if(this.permits>0){this.permits-=1;return[2,Promise.resolve(true)]}n=function(e){return void 0};s=new Promise((function(e){n=e}));this.promiseResolverQueue.push(n);setTimeout((function(){var e=t.promiseResolverQueue.indexOf(n);if(e!==-1){t.promiseResolverQueue.splice(e,1)}else{}n(false)}),e);return[2,s]}))}))};Semaphore.prototype.tryAcquire=function(){if(this.permits>0){this.permits-=1;return true}return false};Semaphore.prototype.drainPermits=function(){if(this.permits>0){var e=this.permits;this.permits=0;return e}return 0};Semaphore.prototype.signal=function(){this.permits+=1;if(this.permits>1&&this.promiseResolverQueue.length>0){throw new Error("this.permits should never be > 0 when there is someone waiting.")}else if(this.permits===1&&this.promiseResolverQueue.length>0){this.permits-=1;var e=this.promiseResolverQueue.shift();if(e){e(true)}}};Semaphore.prototype.release=function(){this.signal()};Semaphore.prototype.execute=function(e){return n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.wait()];case 1:t.sent();t.label=2;case 2:t.trys.push([2,,4,5]);return[4,e()];case 3:return[2,t.sent()];case 4:this.signal();return[7];case 5:return[2]}}))}))};return Semaphore}();t["default"]=s},57:(e,t,n)=>{"use strict";function __export(e){for(var n in e)if(!t.hasOwnProperty(n))t[n]=e[n]}t.__esModule=true;var i=n(2950);t["default"]=i["default"];__export(n(8197))},4931:(e,t,n)=>{var i=global.process;const processOk=function(e){return e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function"};if(!processOk(i)){e.exports=function(){return function(){}}}else{var s=n(9491);var a=n(3710);var o=/^win/i.test(i.platform);var l=n(2361);if(typeof l!=="function"){l=l.EventEmitter}var u;if(i.__signal_exit_emitter__){u=i.__signal_exit_emitter__}else{u=i.__signal_exit_emitter__=new l;u.count=0;u.emitted={}}if(!u.infinite){u.setMaxListeners(Infinity);u.infinite=true}e.exports=function(e,t){if(!processOk(global.process)){return function(){}}s.equal(typeof e,"function","a callback must be provided for exit handler");if(m===false){y()}var n="exit";if(t&&t.alwaysLast){n="afterexit"}var remove=function(){u.removeListener(n,e);if(u.listeners("exit").length===0&&u.listeners("afterexit").length===0){f()}};u.on(n,e);return remove};var f=function unload(){if(!m||!processOk(global.process)){return}m=false;a.forEach((function(e){try{i.removeListener(e,d[e])}catch(e){}}));i.emit=_;i.reallyExit=g;u.count-=1};e.exports.unload=f;var h=function emit(e,t,n){if(u.emitted[e]){return}u.emitted[e]=true;u.emit(e,t,n)};var d={};a.forEach((function(e){d[e]=function listener(){if(!processOk(global.process)){return}var t=i.listeners(e);if(t.length===u.count){f();h("exit",null,e);h("afterexit",null,e);if(o&&e==="SIGHUP"){e="SIGINT"}i.kill(i.pid,e)}}}));e.exports.signals=function(){return a};var m=false;var y=function load(){if(m||!processOk(global.process)){return}m=true;u.count+=1;a=a.filter((function(e){try{i.on(e,d[e]);return true}catch(e){return false}}));i.emit=S;i.reallyExit=v};e.exports.load=y;var g=i.reallyExit;var v=function processReallyExit(e){if(!processOk(global.process)){return}i.exitCode=e||0;h("exit",i.exitCode,null);h("afterexit",i.exitCode,null);g.call(i,i.exitCode)};var _=i.emit;var S=function processEmit(e,t){if(e==="exit"&&processOk(global.process)){if(t!==undefined){i.exitCode=t}var n=_.apply(this,arguments);h("exit",i.exitCode,null);h("afterexit",i.exitCode,null);return n}else{return _.apply(this,arguments)}}}},3710:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},5591:(e,t,n)=>{"use strict";const i=n(5063);e.exports=e=>typeof e==="string"?e.replace(i(),""):e},9318:(e,t,n)=>{"use strict";const i=n(2037);const s=n(6224);const a=n(1621);const{env:o}=process;let l;if(a("no-color")||a("no-colors")||a("color=false")||a("color=never")){l=0}else if(a("color")||a("colors")||a("color=true")||a("color=always")){l=1}if("FORCE_COLOR"in o){if(o.FORCE_COLOR==="true"){l=1}else if(o.FORCE_COLOR==="false"){l=0}else{l=o.FORCE_COLOR.length===0?1:Math.min(parseInt(o.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e,t){if(l===0){return 0}if(a("color=16m")||a("color=full")||a("color=truecolor")){return 3}if(a("color=256")){return 2}if(e&&!t&&l===undefined){return 0}const n=l||0;if(o.TERM==="dumb"){return n}if(process.platform==="win32"){const e=i.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in o){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in o))||o.CI_NAME==="codeship"){return 1}return n}if("TEAMCITY_VERSION"in o){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0}if(o.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in o){const e=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(o.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)){return 1}if("COLORTERM"in o){return 1}return n}function getSupportLevel(e){const t=supportsColor(e,e&&e.isTTY);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,s.isatty(1))),stderr:translateLevel(supportsColor(true,s.isatty(2)))}},9046:(e,t)=>{"use strict";t.E=function(e){return Object.defineProperty((function(){if(typeof arguments[arguments.length-1]==="function")e.apply(this,arguments);else{return new Promise(((t,n)=>{arguments[arguments.length]=(e,i)=>{if(e)return n(e);t(i)};arguments.length++;e.apply(this,arguments)}))}}),"name",{value:e.name})};t.p=function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if(typeof t!=="function")return e.apply(this,arguments);else e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},5278:(e,t,n)=>{e.exports=n(3837).deprecate},4383:e=>{e.exports=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]]},5917:(e,t,n)=>{"use strict";var i=n(732);var s=n(4383);var a={nul:0,control:0};e.exports=function wcwidth(e){return wcswidth(e,a)};e.exports.config=function(e){e=i(e||{},a);return function wcwidth(t){return wcswidth(t,e)}};function wcswidth(e,t){if(typeof e!=="string")return wcwidth(e,t);var n=0;for(var i=0;i=127&&e<160)return t.control;if(bisearch(e))return 0;return 1+(e>=4352&&(e<=4447||e==9001||e==9002||e>=11904&&e<=42191&&e!=12351||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141))}function bisearch(e){var t=0;var n=s.length-1;var i;if(es[n][1])return false;while(n>=t){i=Math.floor((t+n)/2);if(e>s[i][1])t=i+1;else if(e{var i=Object.create;var s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var je=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})},ee=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of o(t))!u.call(e,l)&&l!==n&&s(e,l,{get:()=>t[l],enumerable:!(i=a(t,l))||i.enumerable});return e};var p=(e,t,n)=>(n=e!=null?i(l(e)):{},ee(t||!e||!e.__esModule?s(n,"default",{value:e,enumerable:!0}):n,e)),He=e=>ee(s({},"__esModule",{value:!0}),e);var f={};je(f,{Directory:()=>ge,Template:()=>ye,Zombi:()=>w,ZombiContext:()=>H,ZombiError:()=>K,ZombiErrorCode:()=>V,mergePrompts:()=>he,scaffold:()=>Te,useZombiContext:()=>T});e.exports=He(f);var h=n(7522),d=p(n(8433)),m=n(6587),y=p(n(1618)),g=p(n(57)),v=p(n(970)),_=p(n(7248)),S=n(250);var N=()=>null;var x=p(n(5630)),k=p(n(1017)),E=p(n(7248)),R=n(8431),O=n(250);var C=p(n(1017)),I=p(n(6460)),j=p(n(6672));function Le(e,t){if(e){let t=C.basename(e).split(".").reverse();for(let e of t){if(I.default.includes(e))return!0;if(j.default.includes(e))return!1}}return t?L(t)==="utf8":null}function L(e,t){if(!e)return null;let n="utf8",i="binary",s=t?.chunkLength??24,a=t?.chunkBegin??0;if(t?.chunkBegin==null){let t=L(e,{chunkLength:s,chunkBegin:a});return t===n&&(a=Math.max(0,Math.floor(e.length/2)-s),t=L(e,{chunkLength:s,chunkBegin:a}),t===n&&(a=Math.max(0,e.length-s),t=L(e,{chunkLength:s,chunkBegin:a}))),t}let o=Math.min(e.length,a+s),l=e.toString(n,a,o);for(let e=0;e{let i=e(t,n);Promise.resolve(i).catch(n)}))}var A=n(250);function Ge(e){return(0,A.isArray)(e)}function b(e){return Ge(e)?e:[e]}function Z(e){return e.filter(Boolean)}async function W(e,t,n){let i=qe(e,t,n);await Je(i.from)?await ve(i.from,i.to,n):await Ke(i.from)&&await ue(i.from,i.to,n)}async function ve(e,t,n){let i=await n.modifier(t,n.data||{}),s=i&&!(0,O.isString)(i)?i?.filepath:i,a=i&&!(0,O.isString)(i)&&i?.transformer||void 0;if(!!s){if(n.symlink)return Ie(e,s,n);await G((async(t,i)=>{let o=await x.default.readFile(e);if(!q(e,o)&&!q(s)&&n.data&&!(0,O.isNil)(n.data)&&!(0,O.isEmpty)(n.data)&&n.ejs)(0,R.renderFile)(e,n.data||{},(async(o,l)=>{o&&i(o);try{let o=a?await a(Buffer.from(l)):l;await ie(e,s,o,n).then(t).catch(i)}catch(e){i(e)}}));else try{let l=a?await a(o):o;await ie(e,s,l,n).then(t).catch(i)}catch(e){i(e)}}))}}async function ue(e,t,n){if(b(n.clobber).includes("directories"))return await x.default.remove(k.default.join(t)),ue(e,t,{...n,clobber:b(n.clobber)?.filter((e=>e!=="directories"))});let i=await x.default.readdir(e);await Promise.all(i.map((async i=>{await W(k.default.join(e,i),k.default.join(t,i),n)})))}async function ie(e,t,n,i){await ce(t,i)&&await x.default.outputFile(t,n,{mode:i.permission??(await x.default.stat(e)).mode})}async function Ie(e,t,n){await ce(t,n)&&(await x.default.ensureDir(k.default.dirname(t)),await x.default.symlink(e,t))}async function ce(e,t){let n=Ze(e),i=await x.default.pathExists(e);if(!b(t.clobber).includes("files")&&i){let{overwrite:e}=await t.prompt({type:"confirm",name:"overwrite",message:`Conflict on \`${n}\` ${E.default.red(`\n Overwrite?`)}`,initial:!1});return e}return!0}async function Je(e){return(await x.default.stat(e)).isFile()}async function Ke(e){return(await x.default.stat(e)).isDirectory()}function qe(e,t,n){return{from:k.default.isAbsolute(e)?e:k.default.resolve(n.templateRoot,e),to:k.default.isAbsolute(t)?t:k.default.resolve(n.destinationRoot,t)}}function Ze(e){return e.replace(process.cwd(),".")}function We(e,t){let[n,i]=e,[s,a]=t,o=i-a,l=n-s;return o>=1e9&&(l-=1,o+=1e9),[l,o]}function pe(){let e,t=[],n=[];return{start(){e=process.hrtime(),t=n=[]},pause(){t.push(process.hrtime())},resume(){n.push(process.hrtime(t.pop()))},stop(){return n.reduce(((e,t)=>We(e,t)),process.hrtime(e))}}}var M=p(n(7522)),P=n(250);var B=p(n(7522)),$=n(250);var _e=e=>{let{children:t}=e,n=T(),i={...n,data:!(0,$.isBoolean)(n.data)&&(0,$.assign)({},n.data,z.answers.get(t))};return B.default.createElement(H.Provider,{value:i},(0,$.isFunction)(t)?z.nodes.get(t):t)},z=(0,$.assign)(_e,{answers:new Map,nodes:new Map});var H=(0,M.createContext)(void 0);function T(){return(0,M.useContext)(H)}var w=e=>{let{children:t,...n}=e,i=T(),s={...n,data:!(0,P.isBoolean)(n.data)&&(0,P.assign)({},n?.data,i?.data),templateRoot:n.templateRoot||process.cwd(),destinationRoot:i?.destinationRoot??n.destinationRoot??process.cwd()};return M.default.createElement(H.Provider,{value:s},M.default.createElement(z,null,t))};var V=(e=>(e.USER_CANCELED_PROMPT="USER_CANCELED_PROMPT",e))(V||{}),K=class extends Error{constructor(e,t){super(`[zombi ❯ ${e}] ${t}`);this.code=e}},Y=new K("USER_CANCELED_PROMPT","User canceled prompt. Nothing was rendered.");var{gray:J,cyan:X,yellow:Q,red:te}=_.default;async function Te(e,t){let n=!t?.quiet,i=pe(),s;i.start();let a=await Ue(e).catch(U()),o=(0,v.default)("Scaffolding"),l=Xe(i,o,t);n&&(console.log(J("Running scaffold")+(a?` ${X.bold(a)}`:"")),o.start());let{effects:u,globalData:f}=await Ve(e,l).catch(U(o,t));return Ye(u,l).then((e=>{s=i.stop();let t=(0,y.default)(s),a=e.map(((e,t)=>e.status==="fulfilled"?{status:e.status,...u[t]}:{status:e.status,reason:e.reason,...u[t]})),h=a.filter((e=>e.status==="rejected"));if(n){let D=()=>{console.error(te.underline.bold(`\nEncountered the following errors:\n`)),h.forEach((({reason:e,from:t})=>{console.error(`Affected request: ${t}`),console.error(e),console.error()}))};o.stop(),l.count>0&&console.log(),h.length?h.length===e.length?(o.fail(J(`Something went wrong. ${_.default.bold("Nothing was generated.")}`)),D()):h.length?(o.warn(J(`Generated, ${Q("with some issues")}, in ${X.bold(t)}`)),D()):e.length||o.succeed(Q("🤷 There's nothing to generate...")):o.succeed(J(`Generated in ${X.bold(t)}`))}return{effects:a,data:f}})).catch(U(o,t))}function U(e,t){return n=>(e?.isSpinning&&!t?.quiet&&e.stop(),Promise.reject(n))}function Ue(e){return G((async t=>{await(0,d.default)(e,(e=>{if((0,h.isValidElement)(e)&&e.type===w)throw t(e.props.name),new Error})).finally((()=>{t(void 0)}))}))}async function Ve(e,t){let n=[],i={};return await(0,d.default)(e,(async e=>{if((0,h.isValidElement)(e))switch(e.type){case N:n.push(e.props);break;case w:if(e.props.prompts){let n=e.props.prompts,s=await t(n,e.props.data);await(e.props.onPromptResponse?.(s)),(0,S.isFunction)(e.props.children)&&z.nodes.set(e.props.children,await e.props.children(s)),(0,S.assign)(i,{[e.props.name]:s}),z.answers.set(e.props.children,s)}else(0,S.assign)(i,{[e.props.name]:{...e.props.data}});break;default:break}})),{effects:n,globalData:i}}async function Ye(e,t){let n=e.map((async e=>{let n={...e.options,prompt:t};return await W(e.from,e.to,n),{...e,options:n}}));return Promise.allSettled(n)}var re=new g.default(1);function Xe(e,t,n){let i=(0,S.assign)((async(s,a)=>{let r=async s=>(await re.acquire(),t.isSpinning&&!n?.quiet&&t.stop(),e.pause(),i.count===0&&!n?.quiet&&console.log(),i.count++,(0,m.prompt)(s).then((i=>(e.resume(),!t.isSpinning&&!n?.quiet&&t.start(),re.signal(),i))).catch((()=>Promise.reject(Y)))),o={...a};for(let e of Z(b(s)))if((0,S.isFunction)(e)){let t=e(o),n=await r(Z(b(t)).filter((e=>o[e.name]==null)));(0,S.assign)(o,n)}else if(o[e.name]==null){let t=await r([e]);(0,S.assign)(o,t)}return o}),{count:0});return i}var ne=p(n(7522)),se=n(250);var ae=n(250);function F(e,t){return(0,ae.isFunction)(e)?e(t||{}):e}var oe=(0,ne.createContext)([]);function Ce(){return(0,ne.useContext)(oe)}var ge=e=>{let{name:t,children:n}=e,i=T(),s=(0,ne.useContext)(oe),a=F(t,(0,se.assign)({},i.data));return ne.default.createElement(oe.Provider,{value:[...s,a]},n)};var le=p(n(7522)),fe=p(n(1017)),de=p(n(7147)),me=n(250);var $e=e=>{let{name:t,source:n,clobber:i,data:s,permission:a,children:o}=e,l=T(),u=(0,me.assign)({},l?.data,s),f={...l,data:u,clobber:i??l?.clobber,ejs:s!==!1,symlink:!1,modifier:o??(e=>e),permission:Ae(F(a,u))},{from:h,to:d}=Pe(n,t,f);return le.default.createElement(N,{from:h,to:d,options:f})},ze=e=>{let{name:t,source:n,clobber:i,permission:s,children:a}=e,o=T(),l=(0,me.assign)({},o?.data),u={...o,data:l,clobber:i??o?.clobber,ejs:!1,symlink:!0,modifier:a??(e=>e),permission:Ae(F(s,l))},{from:f,to:h}=Pe(n,t,u);return le.default.createElement(N,{from:f,to:h,options:{...u}})};function Pe(e,t,n){let i=Ce(),s=F(e,n.data),a=F(t,n.data);return{from:s,to:fe.default.join(...i,a??s)}}function Ae(e){switch(e){case"r":return de.default.constants.O_RDONLY;case"rs":case"sr":return de.default.constants.O_RDONLY|de.default.constants.O_SYNC;case"r+":return de.default.constants.O_RDWR;case"rs+":case"sr+":return de.default.constants.O_RDWR|de.default.constants.O_SYNC;case"w":return de.default.constants.O_TRUNC|de.default.constants.O_CREAT|de.default.constants.O_WRONLY;case"wx":case"xw":return de.default.constants.O_TRUNC|de.default.constants.O_CREAT|de.default.constants.O_WRONLY|de.default.constants.O_EXCL;case"w+":return de.default.constants.O_TRUNC|de.default.constants.O_CREAT|de.default.constants.O_RDWR;case"wx+":case"xw+":return de.default.constants.O_TRUNC|de.default.constants.O_CREAT|de.default.constants.O_RDWR|de.default.constants.O_EXCL;case"a":return de.default.constants.O_APPEND|de.default.constants.O_CREAT|de.default.constants.O_WRONLY;case"ax":case"xa":return de.default.constants.O_APPEND|de.default.constants.O_CREAT|de.default.constants.O_WRONLY|de.default.constants.O_EXCL;case"a+":return de.default.constants.O_APPEND|de.default.constants.O_CREAT|de.default.constants.O_RDWR;case"ax+":case"xa+":return de.default.constants.O_APPEND|de.default.constants.O_CREAT|de.default.constants.O_RDWR|de.default.constants.O_EXCL;default:return}}var ye=(0,me.assign)($e,{Symlink:ze});function he(...e){let t=[];return e.forEach((e=>{Array.isArray(e)?t.push(...e):t.push(e)})),t}0&&0},7259:(e,t,n)=>{"use strict";e=n.nmd(e);const i=n(1864);const wrapAnsi16=(e,t)=>function(){const n=e.apply(i,arguments);return`[${n+t}m`};const wrapAnsi256=(e,t)=>function(){const n=e.apply(i,arguments);return`[${38+t};5;${n}m`};const wrapAnsi16m=(e,t)=>function(){const n=e.apply(i,arguments);return`[${38+t};2;${n[0]};${n[1]};${n[2]}m`};function assembleStyles(){const e=new Map;const t={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],gray:[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]}};t.color.grey=t.color.gray;for(const n of Object.keys(t)){const i=t[n];for(const n of Object.keys(i)){const s=i[n];t[n]={open:`[${s[0]}m`,close:`[${s[1]}m`};i[n]=t[n];e.set(s[0],s[1])}Object.defineProperty(t,n,{value:i,enumerable:false});Object.defineProperty(t,"codes",{value:e,enumerable:false})}const ansi2ansi=e=>e;const rgb2rgb=(e,t,n)=>[e,t,n];t.color.close="";t.bgColor.close="";t.color.ansi={ansi:wrapAnsi16(ansi2ansi,0)};t.color.ansi256={ansi256:wrapAnsi256(ansi2ansi,0)};t.color.ansi16m={rgb:wrapAnsi16m(rgb2rgb,0)};t.bgColor.ansi={ansi:wrapAnsi16(ansi2ansi,10)};t.bgColor.ansi256={ansi256:wrapAnsi256(ansi2ansi,10)};t.bgColor.ansi16m={rgb:wrapAnsi16m(rgb2rgb,10)};for(let e of Object.keys(i)){if(typeof i[e]!=="object"){continue}const n=i[e];if(e==="ansi16"){e="ansi"}if("ansi16"in n){t.color.ansi[e]=wrapAnsi16(n.ansi16,0);t.bgColor.ansi[e]=wrapAnsi16(n.ansi16,10)}if("ansi256"in n){t.color.ansi256[e]=wrapAnsi256(n.ansi256,0);t.bgColor.ansi256[e]=wrapAnsi256(n.ansi256,10)}if("rgb"in n){t.color.ansi16m[e]=wrapAnsi16m(n.rgb,0);t.bgColor.ansi16m[e]=wrapAnsi16m(n.rgb,10)}}return t}Object.defineProperty(e,"exports",{enumerable:true,get:assembleStyles})},7248:(e,t,n)=>{"use strict";const i=n(8691);const s=n(7259);const a=n(5619).stdout;const o=n(8799);const l=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm");const u=["ansi","ansi","ansi256","ansi16m"];const f=new Set(["gray"]);const h=Object.create(null);function applyOptions(e,t){t=t||{};const n=a?a.level:0;e.level=t.level===undefined?n:t.level;e.enabled="enabled"in t?t.enabled:e.level>0}function Chalk(e){if(!this||!(this instanceof Chalk)||this.template){const t={};applyOptions(t,e);t.template=function(){const e=[].slice.call(arguments);return chalkTag.apply(null,[t.template].concat(e))};Object.setPrototypeOf(t,Chalk.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=Chalk;return t.template}applyOptions(this,e)}if(l){s.blue.open=""}for(const e of Object.keys(s)){s[e].closeRe=new RegExp(i(s[e].close),"g");h[e]={get(){const t=s[e];return build.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}}}h.visible={get(){return build.call(this,this._styles||[],true,"visible")}};s.color.closeRe=new RegExp(i(s.color.close),"g");for(const e of Object.keys(s.color.ansi)){if(f.has(e)){continue}h[e]={get(){const t=this.level;return function(){const n=s.color[u[t]][e].apply(null,arguments);const i={open:n,close:s.color.close,closeRe:s.color.closeRe};return build.call(this,this._styles?this._styles.concat(i):[i],this._empty,e)}}}}s.bgColor.closeRe=new RegExp(i(s.bgColor.close),"g");for(const e of Object.keys(s.bgColor.ansi)){if(f.has(e)){continue}const t="bg"+e[0].toUpperCase()+e.slice(1);h[t]={get(){const t=this.level;return function(){const n=s.bgColor[u[t]][e].apply(null,arguments);const i={open:n,close:s.bgColor.close,closeRe:s.bgColor.closeRe};return build.call(this,this._styles?this._styles.concat(i):[i],this._empty,e)}}}}const d=Object.defineProperties((()=>{}),h);function build(e,t,n){const builder=function(){return applyStyle.apply(builder,arguments)};builder._styles=e;builder._empty=t;const i=this;Object.defineProperty(builder,"level",{enumerable:true,get(){return i.level},set(e){i.level=e}});Object.defineProperty(builder,"enabled",{enumerable:true,get(){return i.enabled},set(e){i.enabled=e}});builder.hasGrey=this.hasGrey||n==="gray"||n==="grey";builder.__proto__=d;return builder}function applyStyle(){const e=arguments;const t=e.length;let n=String(arguments[0]);if(t===0){return""}if(t>1){for(let i=1;i{"use strict";const t=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const n=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const i=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const s=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;const a=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function unescape(e){if(e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}return a.get(e)||e}function parseArguments(e,t){const n=[];const a=t.trim().split(/\s*,\s*/g);let o;for(const t of a){if(!isNaN(t)){n.push(Number(t))}else if(o=t.match(i)){n.push(o[2].replace(s,((e,t,n)=>t?unescape(t):n)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return n}function parseStyle(e){n.lastIndex=0;const t=[];let i;while((i=n.exec(e))!==null){const e=i[1];if(i[2]){const n=parseArguments(e,i[2]);t.push([e].concat(n))}else{t.push([e])}}return t}function buildStyle(e,t){const n={};for(const e of t){for(const t of e.styles){n[t[0]]=e.inverse?null:t.slice(1)}}let i=e;for(const e of Object.keys(n)){if(Array.isArray(n[e])){if(!(e in i)){throw new Error(`Unknown Chalk style: ${e}`)}if(n[e].length>0){i=i[e].apply(i,n[e])}else{i=i[e]}}}return i}e.exports=(e,n)=>{const i=[];const s=[];let a=[];n.replace(t,((t,n,o,l,u,f)=>{if(n){a.push(unescape(n))}else if(l){const t=a.join("");a=[];s.push(i.length===0?t:buildStyle(e,i)(t));i.push({inverse:o,styles:parseStyle(l)})}else if(u){if(i.length===0){throw new Error("Found extraneous } in Chalk template literal")}s.push(buildStyle(e,i)(a.join("")));a=[];i.pop()}else{a.push(f)}}));s.push(a.join(""));if(i.length>0){const e=`Chalk template literal is missing ${i.length} closing bracket${i.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return s.join("")}},4827:(e,t,n)=>{var i=n(43);var s={};for(var a in i){if(i.hasOwnProperty(a)){s[i[a]]=a}}var o=e.exports={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"]}};for(var l in o){if(o.hasOwnProperty(l)){if(!("channels"in o[l])){throw new Error("missing channels property: "+l)}if(!("labels"in o[l])){throw new Error("missing channel labels property: "+l)}if(o[l].labels.length!==o[l].channels){throw new Error("channel and label counts mismatch: "+l)}var u=o[l].channels;var f=o[l].labels;delete o[l].channels;delete o[l].labels;Object.defineProperty(o[l],"channels",{value:u});Object.defineProperty(o[l],"labels",{value:f})}}o.rgb.hsl=function(e){var t=e[0]/255;var n=e[1]/255;var i=e[2]/255;var s=Math.min(t,n,i);var a=Math.max(t,n,i);var o=a-s;var l;var u;var f;if(a===s){l=0}else if(t===a){l=(n-i)/o}else if(n===a){l=2+(i-t)/o}else if(i===a){l=4+(t-n)/o}l=Math.min(l*60,360);if(l<0){l+=360}f=(s+a)/2;if(a===s){u=0}else if(f<=.5){u=o/(a+s)}else{u=o/(2-a-s)}return[l,u*100,f*100]};o.rgb.hsv=function(e){var t;var n;var i;var s;var a;var o=e[0]/255;var l=e[1]/255;var u=e[2]/255;var f=Math.max(o,l,u);var h=f-Math.min(o,l,u);var diffc=function(e){return(f-e)/6/h+1/2};if(h===0){s=a=0}else{a=h/f;t=diffc(o);n=diffc(l);i=diffc(u);if(o===f){s=i-n}else if(l===f){s=1/3+t-i}else if(u===f){s=2/3+n-t}if(s<0){s+=1}else if(s>1){s-=1}}return[s*360,a*100,f*100]};o.rgb.hwb=function(e){var t=e[0];var n=e[1];var i=e[2];var s=o.rgb.hsl(e)[0];var a=1/255*Math.min(t,Math.min(n,i));i=1-1/255*Math.max(t,Math.max(n,i));return[s,a*100,i*100]};o.rgb.cmyk=function(e){var t=e[0]/255;var n=e[1]/255;var i=e[2]/255;var s;var a;var o;var l;l=Math.min(1-t,1-n,1-i);s=(1-t-l)/(1-l)||0;a=(1-n-l)/(1-l)||0;o=(1-i-l)/(1-l)||0;return[s*100,a*100,o*100,l*100]};function comparativeDistance(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}o.rgb.keyword=function(e){var t=s[e];if(t){return t}var n=Infinity;var a;for(var o in i){if(i.hasOwnProperty(o)){var l=i[o];var u=comparativeDistance(e,l);if(u.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var s=t*.4124+n*.3576+i*.1805;var a=t*.2126+n*.7152+i*.0722;var o=t*.0193+n*.1192+i*.9505;return[s*100,a*100,o*100]};o.rgb.lab=function(e){var t=o.rgb.xyz(e);var n=t[0];var i=t[1];var s=t[2];var a;var l;var u;n/=95.047;i/=100;s/=108.883;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;i=i>.008856?Math.pow(i,1/3):7.787*i+16/116;s=s>.008856?Math.pow(s,1/3):7.787*s+16/116;a=116*i-16;l=500*(n-i);u=200*(i-s);return[a,l,u]};o.hsl.rgb=function(e){var t=e[0]/360;var n=e[1]/100;var i=e[2]/100;var s;var a;var o;var l;var u;if(n===0){u=i*255;return[u,u,u]}if(i<.5){a=i*(1+n)}else{a=i+n-i*n}s=2*i-a;l=[0,0,0];for(var f=0;f<3;f++){o=t+1/3*-(f-1);if(o<0){o++}if(o>1){o--}if(6*o<1){u=s+(a-s)*6*o}else if(2*o<1){u=a}else if(3*o<2){u=s+(a-s)*(2/3-o)*6}else{u=s}l[f]=u*255}return l};o.hsl.hsv=function(e){var t=e[0];var n=e[1]/100;var i=e[2]/100;var s=n;var a=Math.max(i,.01);var o;var l;i*=2;n*=i<=1?i:2-i;s*=a<=1?a:2-a;l=(i+n)/2;o=i===0?2*s/(a+s):2*n/(i+n);return[t,o*100,l*100]};o.hsv.rgb=function(e){var t=e[0]/60;var n=e[1]/100;var i=e[2]/100;var s=Math.floor(t)%6;var a=t-Math.floor(t);var o=255*i*(1-n);var l=255*i*(1-n*a);var u=255*i*(1-n*(1-a));i*=255;switch(s){case 0:return[i,u,o];case 1:return[l,i,o];case 2:return[o,i,u];case 3:return[o,l,i];case 4:return[u,o,i];case 5:return[i,o,l]}};o.hsv.hsl=function(e){var t=e[0];var n=e[1]/100;var i=e[2]/100;var s=Math.max(i,.01);var a;var o;var l;l=(2-n)*i;a=(2-n)*s;o=n*s;o/=a<=1?a:2-a;o=o||0;l/=2;return[t,o*100,l*100]};o.hwb.rgb=function(e){var t=e[0]/360;var n=e[1]/100;var i=e[2]/100;var s=n+i;var a;var o;var l;var u;if(s>1){n/=s;i/=s}a=Math.floor(6*t);o=1-i;l=6*t-a;if((a&1)!==0){l=1-l}u=n+l*(o-n);var f;var h;var d;switch(a){default:case 6:case 0:f=o;h=u;d=n;break;case 1:f=u;h=o;d=n;break;case 2:f=n;h=o;d=u;break;case 3:f=n;h=u;d=o;break;case 4:f=u;h=n;d=o;break;case 5:f=o;h=n;d=u;break}return[f*255,h*255,d*255]};o.cmyk.rgb=function(e){var t=e[0]/100;var n=e[1]/100;var i=e[2]/100;var s=e[3]/100;var a;var o;var l;a=1-Math.min(1,t*(1-s)+s);o=1-Math.min(1,n*(1-s)+s);l=1-Math.min(1,i*(1-s)+s);return[a*255,o*255,l*255]};o.xyz.rgb=function(e){var t=e[0]/100;var n=e[1]/100;var i=e[2]/100;var s;var a;var o;s=t*3.2406+n*-1.5372+i*-.4986;a=t*-.9689+n*1.8758+i*.0415;o=t*.0557+n*-.204+i*1.057;s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92;a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92;o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92;s=Math.min(Math.max(0,s),1);a=Math.min(Math.max(0,a),1);o=Math.min(Math.max(0,o),1);return[s*255,a*255,o*255]};o.xyz.lab=function(e){var t=e[0];var n=e[1];var i=e[2];var s;var a;var o;t/=95.047;n/=100;i/=108.883;t=t>.008856?Math.pow(t,1/3):7.787*t+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;i=i>.008856?Math.pow(i,1/3):7.787*i+16/116;s=116*n-16;a=500*(t-n);o=200*(n-i);return[s,a,o]};o.lab.xyz=function(e){var t=e[0];var n=e[1];var i=e[2];var s;var a;var o;a=(t+16)/116;s=n/500+a;o=a-i/200;var l=Math.pow(a,3);var u=Math.pow(s,3);var f=Math.pow(o,3);a=l>.008856?l:(a-16/116)/7.787;s=u>.008856?u:(s-16/116)/7.787;o=f>.008856?f:(o-16/116)/7.787;s*=95.047;a*=100;o*=108.883;return[s,a,o]};o.lab.lch=function(e){var t=e[0];var n=e[1];var i=e[2];var s;var a;var o;s=Math.atan2(i,n);a=s*360/2/Math.PI;if(a<0){a+=360}o=Math.sqrt(n*n+i*i);return[t,o,a]};o.lch.lab=function(e){var t=e[0];var n=e[1];var i=e[2];var s;var a;var o;o=i/360*2*Math.PI;s=n*Math.cos(o);a=n*Math.sin(o);return[t,s,a]};o.rgb.ansi16=function(e){var t=e[0];var n=e[1];var i=e[2];var s=1 in arguments?arguments[1]:o.rgb.hsv(e)[2];s=Math.round(s/50);if(s===0){return 30}var a=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(t/255));if(s===2){a+=60}return a};o.hsv.ansi16=function(e){return o.rgb.ansi16(o.hsv.rgb(e),e[2])};o.rgb.ansi256=function(e){var t=e[0];var n=e[1];var i=e[2];if(t===n&&n===i){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}var s=16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5);return s};o.ansi16.rgb=function(e){var t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}var n=(~~(e>50)+1)*.5;var i=(t&1)*n*255;var s=(t>>1&1)*n*255;var a=(t>>2&1)*n*255;return[i,s,a]};o.ansi256.rgb=function(e){if(e>=232){var t=(e-232)*10+8;return[t,t,t]}e-=16;var n;var i=Math.floor(e/36)/5*255;var s=Math.floor((n=e%36)/6)/5*255;var a=n%6/5*255;return[i,s,a]};o.rgb.hex=function(e){var t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);var n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};o.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}var n=t[0];if(t[0].length===3){n=n.split("").map((function(e){return e+e})).join("")}var i=parseInt(n,16);var s=i>>16&255;var a=i>>8&255;var o=i&255;return[s,a,o]};o.rgb.hcg=function(e){var t=e[0]/255;var n=e[1]/255;var i=e[2]/255;var s=Math.max(Math.max(t,n),i);var a=Math.min(Math.min(t,n),i);var o=s-a;var l;var u;if(o<1){l=a/(1-o)}else{l=0}if(o<=0){u=0}else if(s===t){u=(n-i)/o%6}else if(s===n){u=2+(i-t)/o}else{u=4+(t-n)/o+4}u/=6;u%=1;return[u*360,o*100,l*100]};o.hsl.hcg=function(e){var t=e[1]/100;var n=e[2]/100;var i=1;var s=0;if(n<.5){i=2*t*n}else{i=2*t*(1-n)}if(i<1){s=(n-.5*i)/(1-i)}return[e[0],i*100,s*100]};o.hsv.hcg=function(e){var t=e[1]/100;var n=e[2]/100;var i=t*n;var s=0;if(i<1){s=(n-i)/(1-i)}return[e[0],i*100,s*100]};o.hcg.rgb=function(e){var t=e[0]/360;var n=e[1]/100;var i=e[2]/100;if(n===0){return[i*255,i*255,i*255]}var s=[0,0,0];var a=t%1*6;var o=a%1;var l=1-o;var u=0;switch(Math.floor(a)){case 0:s[0]=1;s[1]=o;s[2]=0;break;case 1:s[0]=l;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]=l;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]=l}u=(1-n)*i;return[(n*s[0]+u)*255,(n*s[1]+u)*255,(n*s[2]+u)*255]};o.hcg.hsv=function(e){var t=e[1]/100;var n=e[2]/100;var i=t+n*(1-t);var s=0;if(i>0){s=t/i}return[e[0],s*100,i*100]};o.hcg.hsl=function(e){var t=e[1]/100;var n=e[2]/100;var i=n*(1-t)+.5*t;var s=0;if(i>0&&i<.5){s=t/(2*i)}else if(i>=.5&&i<1){s=t/(2*(1-i))}return[e[0],s*100,i*100]};o.hcg.hwb=function(e){var t=e[1]/100;var n=e[2]/100;var i=t+n*(1-t);return[e[0],(i-t)*100,(1-i)*100]};o.hwb.hcg=function(e){var t=e[1]/100;var n=e[2]/100;var i=1-n;var s=i-t;var a=0;if(s<1){a=(i-s)/(1-s)}return[e[0],s*100,a*100]};o.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};o.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};o.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};o.gray.hsl=o.gray.hsv=function(e){return[0,0,e[0]]};o.gray.hwb=function(e){return[0,100,e[0]]};o.gray.cmyk=function(e){return[0,0,0,e[0]]};o.gray.lab=function(e){return[e[0],0,0]};o.gray.hex=function(e){var t=Math.round(e[0]/100*255)&255;var n=(t<<16)+(t<<8)+t;var i=n.toString(16).toUpperCase();return"000000".substring(i.length)+i};o.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},1864:(e,t,n)=>{var i=n(4827);var s=n(7816);var a={};var o=Object.keys(i);function wrapRaw(e){var wrappedFn=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}return e(t)};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}function wrapRounded(e){var wrappedFn=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}var n=e(t);if(typeof n==="object"){for(var i=n.length,s=0;s{var i=n(4827);function buildGraph(){var e={};var t=Object.keys(i);for(var n=t.length,s=0;s{"use strict";e.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]}},3610:e=>{"use strict";e.exports=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":e.length===1?"-":"--";const i=t.indexOf(n+e);const s=t.indexOf("--");return i!==-1&&(s===-1?true:i{"use strict";const i=n(2037);const s=n(3610);const a=process.env;let o;if(s("no-color")||s("no-colors")||s("color=false")){o=false}else if(s("color")||s("colors")||s("color=true")||s("color=always")){o=true}if("FORCE_COLOR"in a){o=a.FORCE_COLOR.length===0||parseInt(a.FORCE_COLOR,10)!==0}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===false){return 0}if(s("color=16m")||s("color=full")||s("color=truecolor")){return 3}if(s("color=256")){return 2}if(e&&!e.isTTY&&o!==true){return 0}const t=o?1:0;if(process.platform==="win32"){const e=i.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in a){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in a))||a.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in a){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION)?1:0}if(a.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in a){const e=parseInt((a.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(a.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(a.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)){return 1}if("COLORTERM"in a){return 1}if(a.TERM==="dumb"){return t}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},9491:e=>{"use strict";e.exports=require("assert")},4300:e=>{"use strict";e.exports=require("buffer")},2057:e=>{"use strict";e.exports=require("constants")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},7522:e=>{"use strict";e.exports=require("react")},4521:e=>{"use strict";e.exports=require("readline")},2781:e=>{"use strict";e.exports=require("stream")},6224:e=>{"use strict";e.exports=require("tty")},3837:e=>{"use strict";e.exports=require("util")},6672:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=["dds","eot","gif","ico","jar","jpeg","jpg","pdf","png","swf","tga","ttf","zip"];t["default"]=n},6460:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=["Dockerfile","Makefile","Rakefile","ada","adb","ads","applescript","as","ascx","asm","asmx","asp","aspx","atom","bas","bash","bashrc","bat","bbcolors","bdsgroup","bdsproj","bib","bowerrc","c","cbl","cc","cfc","cfg","cfm","cfml","cgi","clj","cls","cmake","cmd","cnf","cob","coffee","coffeekup","conf","cpp","cpt","cpy","crt","cs","csh","cson","csr","css","csslintrc","csv","ctl","curlrc","cxx","dart","dfm","diff","dockerignore","dof","dpk","dproj","dtd","eco","editorconfig","ejs","el","emacs","eml","ent","erb","erl","eslintignore","eslintrc","ex","exs","f","f03","f77","f90","f95","fish","for","fpp","frm","ftn","gemrc","gitattributes","gitconfig","gitignore","gitkeep","gitmodules","go","gpp","gradle","groovy","groupproj","grunit","gtmpl","gvimrc","h","haml","hbs","hgignore","hh","hpp","hrl","hs","hta","htaccess","htc","htm","html","htpasswd","hxx","iced","inc","ini","ino","int","irbrc","itcl","itermcolors","itk","jade","java","jhtm","jhtml","js","jscsrc","jshintignore","jshintrc","json","json5","jsonld","jsp","jspx","jsx","ksh","less","lhs","lisp","log","ls","lsp","lua","m","mak","map","markdown","master","md","mdown","mdwn","mdx","metadata","mht","mhtml","mjs","mk","mkd","mkdn","mkdown","ml","mli","mm","mxml","nfm","nfo","njk","noon","npmignore","npmrc","nvmrc","ops","pas","pasm","patch","pbxproj","pch","pem","pg","php","php3","php4","php5","phpt","phtml","pir","pl","pm","pmc","pod","pot","properties","props","pt","pug","py","r","rake","rb","rdoc","rdoc_options","resx","rhtml","rjs","rlib","rmd","ron","rs","rss","rst","rtf","rvmrc","rxml","s","sass","scala","scm","scss","seestyle","sh","shtml","sls","spec","sql","sqlite","ss","sss","st","strings","sty","styl","stylus","sub","sublime-build","sublime-commands","sublime-completions","sublime-keymap","sublime-macro","sublime-menu","sublime-project","sublime-settings","sublime-workspace","sv","svc","svg","t","tcl","tcsh","terminal","tex","text","textile","tg","tmLanguage","tmTheme","tmpl","toml","tpl","ts","tsv","tsx","tt","tt2","ttml","txt","v","vb","vbs","vh","vhd","vhdl","vim","viminfo","vimrc","vue","webapp","wxml","wxss","x-php","xaml","xht","xhtml","xml","xs","xsd","xsl","xslt","yaml","yml","zsh","zshrc"];t["default"]=n},6374:e=>{"use strict";e.exports=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots13":{"interval":80,"frames":["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"sand":{"interval":80,"frames":["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"binary":{"interval":80,"frames":["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","❤️ "]},"clock":{"interval":100,"frames":["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]},"grenade":{"interval":80,"frames":["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},"fistBump":{"interval":80,"frames":["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},"soccerHeader":{"interval":80,"frames":[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},"mindblown":{"interval":160,"frames":["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},"speaker":{"interval":160,"frames":["🔈 ","🔉 ","🔊 ","🔉 "]},"orangePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},"bluePulse":{"interval":100,"frames":["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"orangeBluePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"timeTravel":{"interval":100,"frames":["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},"dwarfFortress":{"interval":80,"frames":[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]}}')},3558:e=>{"use strict";e.exports={i8:"3.1.9"}}};var t={};function __nccwpck_require__(n){var i=t[n];if(i!==undefined){return i.exports}var s=t[n]={id:n,loaded:false,exports:{}};var a=true;try{e[n].call(s.exports,s,s.exports,__nccwpck_require__);a=false}finally{if(a)delete t[n]}s.loaded=true;return s.exports}(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n=__nccwpck_require__(3956);module.exports=n})(); \ No newline at end of file diff --git a/compiled/zombi/package.json b/compiled/zombi/package.json deleted file mode 100644 index 679d09d..0000000 --- a/compiled/zombi/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"zombi","version":"6.0.2","main":"index.js","author":"Ian K Smith ","license":"MIT"} diff --git a/core/cli.ts b/core/cli.ts index 053cee1..316968b 100644 --- a/core/cli.ts +++ b/core/cli.ts @@ -1,10 +1,10 @@ import fs from 'fs'; import chalk from 'chalk'; -import { ZombiError, ZombiErrorCode } from 'zombi'; +import got from 'got'; import { createApp } from './create-app'; import { printHelp } from './help-text'; import { resolveToRoot } from './utils/path-helpers'; -import { CreateMagicAppError } from './utils/errors-warnings'; +import { CreateMagicAppError, CreateMagicAppErrorCode } from './utils/errors-warnings'; import { parseFlags } from './flags'; import { globalOptions } from './global-options'; import { shutdown, useGracefulShutdown } from './utils/shutdown'; @@ -13,7 +13,43 @@ import { modifyUsageConsent, initializeUsageConfigIfneeded } from './utils/usage import { loadConfig } from './config'; import suppressWarnings from './utils/suppress-experimental-warnings'; -function sayHello() { +export const ConsoleMessages = { + bootstrapSuccess: (projectName: string, destination: string) => { + console.log(); // Aesthetics! + + const magic = chalk`{rgb(92,101,246) M}{rgb(127,103,246) ag}{rgb(168,140,248) ic}`; + + const msg = [ + '✨\n', + chalk`{bold {green Success!} You've bootstrapped a ${magic} app with {rgb(0,255,255) ${projectName}}!}`, + chalk`Created {bold.rgb(0,255,255) ${projectName}} at {bold.rgb(0,255,255) ${destination}}`, + ]; + + return msg.join('\n'); + }, + + postRenderCommands: (installCmd: string | undefined, startCmd: string | undefined, projectName: string) => { + console.log(); // Aesthetics! + + const msg = [ + (installCmd || startCmd) && chalk`Inside your app directory, you can run several commands:\n`, + + installCmd && chalk` {rgb(0,255,255) ${installCmd}}`, + installCmd && chalk` Install dependencies.\n`, + + startCmd && chalk` {rgb(0,255,255) ${startCmd}}`, + startCmd && chalk` Starts the app with a local development server.\n`, + + startCmd && chalk`Type the following to restart your newly-created app:\n`, + startCmd && chalk` {rgb(0,255,255) cd} ${projectName}`, + startCmd && chalk` {rgb(0,255,255) ${startCmd}}`, + ].filter(Boolean); + + return msg.join('\n'); + }, +}; + +async function sayHello() { console.log(chalk`\n {rgb(92,101,246) █▀▀ █}{rgb(127,103,246) ▀█ █▀▀} {rgb(133,139,247) ▄▀█ ▀█▀} {rgb(168,140,248) █▀▀} {rgb(92,101,246) █▄▄ █}{rgb(127,103,246) ▀▄ ██▄} {rgb(133,139,247) █▀█ █ } {rgb(168,140,248) ██▄} @@ -25,7 +61,16 @@ function sayHello() { {rgb(92,101,246) █▀█ █}{rgb(127,103,246) ▀▀ █▀▀} `); - console.log(chalk`\n {dim v${getMakeMagicVersion()}}\n\n`); + const currentVersion = getMakeMagicVersion(); + const latestVersion = await getLatestMakeMagicVersion(); + if (currentVersion !== latestVersion) { + console.log( + chalk`{rgb(92,101,246) A new version of {bold make-magic} is available! {rgb(0,255,255) ${currentVersion}} → {rgb(0,255,255) ${latestVersion}}}`, + ); + console.log(chalk`{rgb(92,101,246) Run {rgb(0,255,255) npm i -g make-magic} to update!}\n\n`); + } else { + console.log(chalk`\n {dim v${getMakeMagicVersion()}}\n\n`); + } } (async () => { @@ -44,7 +89,7 @@ function sayHello() { } if (help) { - sayHello(); + await sayHello(); printHelp(globalOptions, template); shutdown(0); } @@ -59,7 +104,7 @@ function sayHello() { shutdown(0); } - sayHello(); + await sayHello(); if (collectUsageData && config?.id) { SharedAnalytics.identifyUser(config.id); @@ -69,7 +114,7 @@ function sayHello() { await createApp({ projectName, template, branch, network }); })().catch((err) => { SharedAnalytics.logEvent('cli-tool-error', { error: err }); - if (err instanceof ZombiError && err.code === ZombiErrorCode.USER_CANCELED_PROMPT) { + if (err instanceof CreateMagicAppError && err.code === CreateMagicAppErrorCode.USER_CANCELED_PROMPT) { // Skip logging errors about users canceling input, just exit! shutdown(1); } @@ -87,3 +132,9 @@ function sayHello() { function getMakeMagicVersion() { return JSON.parse(fs.readFileSync(resolveToRoot('package.json')).toString('utf8')).version; } + +async function getLatestMakeMagicVersion() { + const latest = await got.get('https://registry.npmjs.org/make-magic/latest'); + + return JSON.parse(latest.body).version; +} diff --git a/core/create-app.tsx b/core/create-app.tsx index dcedfa6..82eca8e 100644 --- a/core/create-app.tsx +++ b/core/create-app.tsx @@ -6,24 +6,25 @@ import fs from 'fs'; import { URL } from 'url'; import path from 'path'; -import React from 'react'; -import { Zombi, Directory, scaffold } from 'zombi'; +import ora, { Ora } from 'ora'; +import prettyTime from 'pretty-time'; import execa from 'execa'; import chalk from 'chalk'; +import { BlockchainNetworkPrompt } from 'scaffolds/prompts'; import { downloadAndExtractRepo, getRepoInfo } from './utils/repo'; import { makeDir } from './utils/make-dir'; import { DEFAULT_CREATE_MAGIC_APP_REPO, GITHUB_BASE_URL } from './config'; -import { getAbsoluteTemplatePath, getRelativeTemplatePath, resolveToDist } from './utils/path-helpers'; -import { getScaffoldDefinition, getScaffoldRender } from './utils/scaffold-helpers'; -import { filterNilValues } from './utils/filter-nil-values'; +import { getAbsoluteTemplatePath, getRelativeTemplatePath, resolveToDist, resolveToRoot } from './utils/path-helpers'; +import { createProjectDirIfDoesntExists, getScaffoldDefinition } from './utils/scaffold-helpers'; import { printWarning } from './utils/errors-warnings'; import { parseFlags } from './flags'; import { addShutdownTask } from './utils/shutdown'; import { SharedAnalytics } from './analytics'; -import { Chain, mapTemplateToChain, mapTemplateToProduct } from './utils/templateMappings'; -import { BlockchainNetworkPrompt } from 'scaffolds/prompts'; - -const { Select, Input } = require('enquirer'); +import { buildTemplate, mapTemplateToFlags, mapTemplateToScaffold } from './utils/templateMappings'; +import { Timer, createTimer } from './utils/timer'; +import BaseScaffold from './types/BaseScaffold'; +import { renderScaffold } from './utils/renderScaffold'; +import { ConsoleMessages } from './cli'; export interface CreateMagicAppData extends BlockchainNetworkPrompt.Data { /** @@ -57,7 +58,6 @@ export interface CreateMagicAppConfig extends Partial { export async function createApp(config: CreateMagicAppConfig) { SharedAnalytics.logEvent('cli-tool-started', { input: config }); - const isProgrammaticFlow = !!config.data; const destinationRoot = process.cwd(); const availableScaffolds = fs @@ -71,258 +71,79 @@ export async function createApp(config: CreateMagicAppConfig) { }; }); - let isChosenTemplateValid = availableScaffolds.map((i) => i.name).includes(config?.template!); + const isChosenTemplateValid = availableScaffolds.map((i) => i.name).includes(config?.template!); if (config?.template && !isChosenTemplateValid) { printWarning(chalk`'{bold ${config.template}}' does not match any templates.`); console.warn(); // Aesthetics! } - if (!config.projectName) { - const projectName = await new Input({ - name: 'projectName', - message: 'What is your project named?', - initial: 'awesome-magic-app', - }).run(); - - config.projectName = projectName; - } + config = { + ...(await buildTemplate({ + ...config, + chain: undefined, + product: undefined, + configuration: undefined, + isChosenTemplateValid: false, + isQuickstart: false, + })), + }; - let chain: Chain | undefined = undefined; - let product: 'universal' | 'dedicated' | undefined = undefined; - let configuration = ''; - if (!config.template) { - configuration = await new Select({ - name: 'configuration', - message: 'Select a configuration to start with:', - choices: [ - { name: 'quickstart', message: 'Quickstart (Nextjs, Polygon Testnet, Email OTP)' }, - { name: 'custom', message: 'Custom Setup (Choose product, network, etc.)' }, - ], - }).run(); + const templateFlags: any = await parseFlags(mapTemplateToFlags(config.template as string), config?.data); + const repoUrl = new URL(`${DEFAULT_CREATE_MAGIC_APP_REPO}/tree/${config.branch}`, GITHUB_BASE_URL); + const repoInfo = await getRepoInfo(repoUrl, getRelativeTemplatePath(config.template as string)); + if (repoInfo) { + const templatePath = getAbsoluteTemplatePath(config.template as string); - if (configuration === 'quickstart') { - config.template = 'nextjs-dedicated-wallet'; - config.network = 'polygon-mumbai'; - product = 'dedicated'; - chain = 'evm'; - isChosenTemplateValid = true; + // TODO - come back to this to check if out of date + if (!fs.existsSync(templatePath)) { + await makeDir(templatePath); + await downloadAndExtractRepo(templatePath, repoInfo); } } else { - chain = mapTemplateToChain(config.template); - product = mapTemplateToProduct(config.template); - } - - if (!chain && !config.network) { - chain = await new Select({ - name: 'chain', - message: 'Which blockchain do you want to use?', - choices: [ - { name: 'evm', message: 'EVM (Ethereum, Polygon, etc.)' }, - { name: 'solana', message: 'Solana' }, - { name: 'flow', message: 'Flow' }, - ], - }).run(); - } - - if (!config.network) { - if (chain === 'solana') { - config.network = await new Select({ - name: 'network', - message: 'Which network would you like to use?', - hint: 'We recommend starting with a test network', - choices: [ - { name: 'solana-mainnet', message: 'Mainnet' }, - { name: 'solana-devnet', message: 'Devnet' }, - ], - }).run(); - - product = 'dedicated'; - config.template = 'nextjs-solana-dedicated-wallet'; - isChosenTemplateValid = true; - } else if (chain === 'flow') { - config.network = await new Select({ - name: 'network', - message: 'Which network would you like to use?', - hint: 'We recommend starting with a test network', - choices: [ - { name: 'flow-mainnet', message: 'Mainnet' }, - { name: 'flow-testnet', message: 'Testnet' }, - ], - }).run(); - } else if (chain === 'evm') { - config.network = await new Select({ - name: 'network', - message: 'Which network would like to use?', - hint: 'We recommend starting with a test network', - choices: [ - { name: 'ethereum', message: 'Ethereum (Mainnet)' }, - { name: 'ethereum-goerli', message: 'Ethereum (Goerli Testnet)' }, - { name: 'polygon', message: 'Polygon (Mainnet)' }, - { name: 'polygon-mumbai', message: 'Polygon (Mumbai Testnet)' }, - ], - }).run(); - } + // TODO: Handle case where repo info is not found } - if (!product) { - product = await new Select({ - name: 'product', - message: 'Choose your wallet type', - choices: [ - { name: 'dedicated', message: 'Dedicated' }, - { name: 'universal', message: 'Universal' }, - ], - }).run(); - - if (product === 'universal') { - if (chain === 'flow') { - config.template = 'nextjs-flow-universal-wallet'; - } else { - config.template = 'nextjs-universal-wallet'; - } - } else if (chain === 'flow') { - config.template = 'nextjs-flow-dedicated-wallet'; - } else { - config.template = 'nextjs-dedicated-wallet'; - } - isChosenTemplateValid = true; - } - - const template = ( - - name="create-magic-app" - templateRoot={false} - destinationRoot={destinationRoot} - data={filterNilValues({ - branch: config?.branch ?? 'master', - projectName: config?.projectName, - template: isChosenTemplateValid ? config.template : undefined, - network: config.network, - npmClient: 'npm', - loginMethods: configuration === 'quickstart' ? ['EmailOTP'] : undefined, - })} - prompts={[ - { - type: 'input', - name: 'projectName', - message: 'What is your project named?', - initial: 'awesome-magic-app', - }, - ]} - > - {async (data) => { - const repoUrl = new URL(`${DEFAULT_CREATE_MAGIC_APP_REPO}/tree/${data.branch}`, GITHUB_BASE_URL); - const repoInfo = await getRepoInfo(repoUrl, getRelativeTemplatePath(data.template)); - - if (repoInfo) { - const templatePath = getAbsoluteTemplatePath(data.template); - - if (!fs.existsSync(templatePath)) { - await makeDir(templatePath); - await downloadAndExtractRepo(templatePath, repoInfo); - } - } else { - // TODO: Handle case where repo info is not found - } - - const templateData = await parseFlags(getScaffoldDefinition(data.template).flags, config?.data); - const renderTemplate = getScaffoldRender(filterNilValues({ ...config, ...templateData, ...data })); - return {renderTemplate()}; - }} - - ); - const scaffoldResult = await scaffold<{ 'create-magic-app': CreateMagicAppData; [key: string]: any }>(template); - const { projectName: chosenProjectName, template: chosenTemplate } = scaffoldResult.data['create-magic-app']; - - SharedAnalytics.logEvent('cli-tool-scaffold-cloned', { data: scaffoldResult.data }); - - console.log(); // Aesthetics! - - // Save the current working directory and - // change directories into the rendered scaffold. const cwd = process.cwd(); - process.chdir(chosenProjectName); + createProjectDirIfDoesntExists(cwd, config.projectName!); - if (fs.existsSync(`${cwd}/${chosenProjectName}/.env.example`)) { - fs.renameSync(`${cwd}/${chosenProjectName}/.env.example`, `${cwd}/${chosenProjectName}/.env`); - } - - // Do post-render actions... - const data = { - ...scaffoldResult.data['create-magic-app'], - ...scaffoldResult.data[chosenTemplate], + const templateData = { + ...config, + ...templateFlags, + ...config.data, }; - if (isProgrammaticFlow) { - await createPostRenderAction({ data, cmd: 'installDependenciesCommand' })?.wait(); - } else { - addShutdownTask(() => { - console.log(); // Aesthetics! - - const magic = chalk`{rgb(92,101,246) M}{rgb(127,103,246) ag}{rgb(168,140,248) ic}`; - - const msg = [ - '✨\n', - chalk`{bold {green Success!} You've bootstrapped a ${magic} app with {rgb(0,255,255) ${chosenTemplate}}!}`, - chalk`Created {bold.rgb(0,255,255) ${chosenProjectName}} at {bold.rgb(0,255,255) ${path.join( - destinationRoot, - chosenProjectName, - )}}`, - ]; - - console.log(msg.join('\n')); - }); - - const installCmd = await createPostRenderAction({ data, cmd: 'installDependenciesCommand', log: true })?.wait(); - const startCmd = createPostRenderAction({ data, cmd: 'startCommand', log: true }); - - addShutdownTask(() => { - console.log(); // Aesthetics! - - const separator = ''; - - const msg = [ - (installCmd || startCmd) && chalk`Inside your app directory, you can run several commands:\n`, - - installCmd && chalk` {rgb(0,255,255) ${installCmd}}`, - installCmd && chalk` Install dependencies.\n`, + const { gray, cyan } = chalk; + const timer = createTimer(); - startCmd && chalk` {rgb(0,255,255) ${startCmd}}`, - startCmd && chalk` Starts the app with a local development server.\n`, + const spinner = ora({ text: 'Scaffolding', spinner: 'dots10' }); + startTimerAndSpinner(timer, spinner, false); - startCmd && chalk`Type the following to restart your newly-created app:\n`, - startCmd && chalk` {rgb(0,255,255) cd} ${chosenProjectName}`, - startCmd && chalk` {rgb(0,255,255) ${startCmd}}`, - ].filter(Boolean); + const scaffold = await mapTemplateToScaffold(config.template as string, templateData, spinner, timer); - console.log(msg.join('\n')); - }); - - SharedAnalytics.logEvent('cli-tool-completed', {}); - } + startTimerAndSpinner(timer, spinner, true); + console.log(`${gray('\n\nRunning scaffold ') + cyan.bold(scaffold.templateName)}\n`); - // Return to the previous working directory - // before "post-render actions" executed. - process.chdir(cwd); + await renderScaffold(process.cwd(), scaffold, templateData); - return scaffoldResult; -} - -function printPostShutdownInstructions(data: CreateMagicAppData & { destinationRoot: string } & Record) { - console.log(); // Aesthetics! + const prettyTimeElapsed = prettyTime(timer.stop()); + spinner.succeed(gray(`Generated in ${cyan.bold(prettyTimeElapsed)}\n\n`)); - const magic = chalk`{rgb(92,101,246) M}{rgb(127,103,246) ag}{rgb(168,140,248) ic}`; + addShutdownTask(() => { + console.log(ConsoleMessages.bootstrapSuccess(config.projectName!, path.join(destinationRoot, config.projectName!))); + }); - const msg = [ - chalk`{bold You've successfully bootstrapped a ${magic} app with {rgb(0,255,255) ${data.template}}!}`, - chalk`Created {bold.rgb(0,255,255) ${data.projectName}} at {bold.rgb(0,255,255) ${path.join( - data.destinationRoot, - data.projectName, - )}}`, - ]; + const installCmd = await createPostRenderAction({ + data: templateData, + cmd: 'installDependenciesCommand', + scaffold, + log: true, + })?.wait(); + const startCmd = createPostRenderAction({ data: templateData, cmd: 'startCommand', scaffold, log: true }); - console.log(msg.join('\n')); + addShutdownTask(() => { + console.log(ConsoleMessages.postRenderCommands(installCmd, startCmd, config.projectName!)); + }); } /** @@ -332,15 +153,15 @@ function printPostShutdownInstructions(data: CreateMagicAppData & { destinationR function createPostRenderAction(options: { data: CreateMagicAppData & Record; cmd: 'installDependenciesCommand' | 'startCommand'; + scaffold: BaseScaffold; log?: boolean; }) { - const getCmd = getScaffoldDefinition(options.data.template)[options.cmd]; - const cmdWithArgs = typeof getCmd === 'function' ? getCmd(options.data) : getCmd ?? []; - const [cmd, ...args] = cmdWithArgs; + const getCmd = + options.cmd === 'installDependenciesCommand' ? options.scaffold.installationCommand : options.scaffold.startCommand; - if (cmd) { - const subprocess = execa(cmd, args, { stdio: 'inherit' }); - const bin = cmdWithArgs.join(' '); + if (getCmd) { + const subprocess = execa(getCmd.command, getCmd.args, { stdio: 'inherit' }); + const bin = `${getCmd.command} ${getCmd.args.join(' ')}`; return Object.assign(bin, { wait: async () => { @@ -350,3 +171,18 @@ function createPostRenderAction(options: { }); } } + +export function startTimerAndSpinner(timer: Timer, spinner: Ora, isPaused: boolean) { + if (isPaused) { + timer.resume(); + } + timer.start(); + spinner.start(); +} + +export function pauseTimerAndSpinner(timer: Timer, spinner: Ora) { + timer.pause(); + if (spinner.isSpinning) { + spinner.stop(); + } +} diff --git a/core/global-options.ts b/core/global-options.ts index eb39500..4ccec63 100644 --- a/core/global-options.ts +++ b/core/global-options.ts @@ -1,8 +1,8 @@ import chalk from 'chalk'; +import { BlockchainNetworkPrompt } from 'scaffolds/prompts'; import { BINARY } from './config'; import { CreateMagicAppData } from './create-app'; import { Flags } from './flags'; -import { BlockchainNetworkPrompt } from 'scaffolds/prompts'; export interface GlobalOptions extends Partial { help?: boolean; diff --git a/core/help-text.ts b/core/help-text.ts index 40f0a64..b475320 100644 --- a/core/help-text.ts +++ b/core/help-text.ts @@ -1,12 +1,13 @@ /* eslint-disable no-param-reassign */ /* eslint-disable consistent-return */ +import { c } from 'tar'; import chalk from 'chalk'; import decamelize from 'decamelize'; import wrapAnsi from 'wrap-ansi'; import { BINARY } from './config'; import { Flags, Flag } from './flags'; -import { getScaffoldDefinition } from './utils/scaffold-helpers'; +import { mapTemplateToFlags } from './utils/templateMappings'; const styled = { Usage: chalk.bold.inverse(' USAGE '), @@ -43,11 +44,11 @@ export function printHelp(globalOptions: Flags, scaffoldName?: string) { // Template-specific options try { - const { flags } = getScaffoldDefinition(scaffoldName!); + const flags = mapTemplateToFlags(scaffoldName!); helpSections.push( createHelpSection({ heading: styled.Options + chalk.bold(' ❯ ') + chalk.bold.hex('#b93fff').inverse(` ${scaffoldName} `), - content: createOptionsTable(flags as any), + content: createOptionsTable(flags), }), ); } catch {} diff --git a/core/types/BaseScaffold.ts b/core/types/BaseScaffold.ts new file mode 100644 index 0000000..e9cf91b --- /dev/null +++ b/core/types/BaseScaffold.ts @@ -0,0 +1,8 @@ +export default abstract class BaseScaffold { + public abstract templateName: string; + public abstract source: string | string[]; + public abstract installationCommand: ExecaCommand; + public abstract startCommand: ExecaCommand; +} + +export type ExecaCommand = { command: string; args: string[] }; diff --git a/core/utils/create-promise.ts b/core/utils/create-promise.ts new file mode 100644 index 0000000..73cbfae --- /dev/null +++ b/core/utils/create-promise.ts @@ -0,0 +1,11 @@ +export type AsyncPromiseExecutor = ( + resolve: (value: TResult | PromiseLike) => void, + reject: (reason?: any) => void, +) => void | Promise; + +export function createPromise(executor: AsyncPromiseExecutor) { + return new Promise((resolve, reject) => { + const result = executor(resolve, reject); + Promise.resolve(result).catch(reject); + }); +} diff --git a/core/utils/errors-warnings.ts b/core/utils/errors-warnings.ts index 5e192bc..8341a1c 100644 --- a/core/utils/errors-warnings.ts +++ b/core/utils/errors-warnings.ts @@ -6,6 +6,7 @@ import chalk from 'chalk'; */ export enum CreateMagicAppErrorCode { VALIDATION_ERROR = 'VALIDATION_ERROR', + USER_CANCELED_PROMPT = 'USER_CANCELED_PROMPT', } /** @@ -30,3 +31,7 @@ export function printWarning(message?: string) { export function createValidationError(message?: string) { return new CreateMagicAppError(CreateMagicAppErrorCode.VALIDATION_ERROR, message); } + +export function createUserCanceledPromptError(message?: string) { + return new CreateMagicAppError(CreateMagicAppErrorCode.USER_CANCELED_PROMPT, message); +} diff --git a/core/utils/fs.ts b/core/utils/fs.ts new file mode 100644 index 0000000..6a87e0f --- /dev/null +++ b/core/utils/fs.ts @@ -0,0 +1,85 @@ +import fs from 'fs'; +import { renderFile } from 'ejs'; +import fse from 'fs-extra'; +import chalk from 'chalk'; +import { createPromise } from 'core/utils/create-promise'; +import { isBinary } from './is-binary'; + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { Confirm } = require('enquirer'); + +// TODO - rename so that we know it also renders ejs +export const copyFileWithEjsData = async (from: string, to: string, data: any) => { + await createPromise(async (resolve, reject) => { + const buffer = await fse.readFile(from); + const shouldRenderEjs = !isBinary(from, buffer); + + if (shouldRenderEjs) { + await renderFile(from, data || {}, async (err, str) => { + if (err) { + reject(err); + } else { + try { + await outputFile(to, str).then(resolve).catch(reject); + } catch (error) { + reject(error); + } + } + }); + } else { + try { + await outputFile(to, buffer).then(resolve).catch(reject); + } catch (err) { + reject(err); + } + } + }); +}; + +async function outputFile(to: string, data: any) { + if (await shouldOverwriteFile(to)) { + await fse.outputFile(to, data); + } +} + +export const readTemplateDirs = ( + root: string, + done: (err: NodeJS.ErrnoException | null, results: string[]) => void, +): string[] => { + let filePaths: string[] = []; + fs.readdir(root, (err, files) => { + if (err) { + console.log(err); + return; + } + let pending = files.length; + if (!pending) return done(null, filePaths); + files.forEach((file) => { + const stats = fs.statSync(`${root}/${file}`); + if (stats && stats.isDirectory()) { + readTemplateDirs(`${root}/${file}`, async (error, res) => { + filePaths = filePaths.concat(res); + if (!--pending) done(null, filePaths); + }); + } else { + filePaths.push(`${root}/${file}`); + if (!--pending) done(null, filePaths); + } + }); + }); + return filePaths; +}; + +const shouldOverwriteFile = async (filePath: string): Promise => { + const exists = await fse.pathExists(filePath); + if (exists) { + const overwrite = await new Confirm({ + name: 'overwrite', + message: `Conflict on \`${filePath.split('/').pop()}\` ${chalk.red('\n Overwrite?')}`, + initial: false, + }).run(); + + return overwrite; + } + return true; +}; diff --git a/core/utils/is-binary.ts b/core/utils/is-binary.ts new file mode 100644 index 0000000..f73aaaf --- /dev/null +++ b/core/utils/is-binary.ts @@ -0,0 +1,156 @@ +/** + * The utilities in this file are based on the NPM module `istextorbinary`. + * + * The implementation is copied here to reduce dependency overhead + * and improve compatibility with NodeJS compilers like `@vercel/ncc`. + * + * @see the `LICENSE` file at the root of this source tree: + * https://github.com/bevry/istextorbinary/blob/master/source/index.ts + */ + +import type Buffer from 'buffer'; +import * as pathUtil from 'path'; +import textExtensions from 'textextensions'; +import binaryExtensions from 'binaryextensions'; + +/** + * Determine if the filename and/or buffer is text. + * + * Determined by extension checks first (if filename is available), otherwise if + * the extension is unrecognized or no filename is provided, will perform a + * slower buffer encoding detection. + * + * Extension checks are quicker. + * Encoding checks cannot guarantee accuracy for chars between utf8 and utf16. + * + * The extension checks are performed using the following resources: + * - https://github.com/bevry/textextensions + * - https://github.com/bevry/binaryextensions + * + * @param filename The filename for the file/buffer if available + * @param buffer The buffer for the file if available + * @returns Will be `null` if neither `filename` nor `buffer` were provided. Otherwise will be a `boolean` value with the detection result. + */ +function isText(filename?: string | null, buffer?: Buffer | null): boolean | null { + // Test extensions + if (filename) { + // Extract filename + const parts = pathUtil.basename(filename).split('.').reverse(); + + // Cycle extensions + for (const extension of parts) { + if (textExtensions.includes(extension)) { + return true; + } + if (binaryExtensions.includes(extension)) { + return false; + } + } + } + + // Fallback to encoding if extension check was not enough + if (buffer) { + return getEncoding(buffer) === 'utf8'; + } + + // No buffer was provided + return null; +} + +interface EncodingOpts { + /** + * Defaults to 24. + */ + chunkLength?: number; + + /** + * If not provided, will check the start, beginning, and end. + */ + chunkBegin?: number; +} + +/** + * Get the encoding of a buffer. + * + * Checks the start, middle, and end of the buffer for characters that are + * unrecognized within UTF8 encoding. History has shown that inspection at all + * three locations is necessary. + * + * @returns Will be `null` if `buffer` was not provided. Otherwise will be either `'utf8'` or `'binary'`. + */ +function getEncoding(buffer: Buffer | null, opts?: EncodingOpts): 'utf8' | 'binary' | null { + // Check + if (!buffer) return null; + + // Prepare + const textEncoding = 'utf8'; + const binaryEncoding = 'binary'; + const chunkLength = opts?.chunkLength ?? 24; + let chunkBegin = opts?.chunkBegin ?? 0; + + // Discover + if (opts?.chunkBegin == null) { + // Start + let encoding = getEncoding(buffer, { chunkLength, chunkBegin }); + if (encoding === textEncoding) { + // Middle + chunkBegin = Math.max(0, Math.floor(buffer.length / 2) - chunkLength); + encoding = getEncoding(buffer, { + chunkLength, + chunkBegin, + }); + if (encoding === textEncoding) { + // End + chunkBegin = Math.max(0, buffer.length - chunkLength); + encoding = getEncoding(buffer, { + chunkLength, + chunkBegin, + }); + } + } + + // Return + return encoding; + } + // Extract + const chunkEnd = Math.min(buffer.length, chunkBegin + chunkLength); + const contentChunkUTF8 = buffer.toString(textEncoding, chunkBegin, chunkEnd); + + // Detect encoding + for (let i = 0; i < contentChunkUTF8.length; ++i) { + const charCode = contentChunkUTF8.charCodeAt(i); + if (charCode === 65533 || charCode <= 8) { + // 8 and below are control characters (e.g. backspace, null, eof, etc.) + // 65533 is the unknown character + // console.log(charCode, contentChunkUTF8[i]) + return binaryEncoding; + } + } + + // Return + return textEncoding; +} + +/** + * Determine if the filename and/or buffer is binary. + * + * Determined by extension checks first (if filename is available), otherwise if + * the extension is unrecognized or no filename is provided, will perform a + * slower buffer encoding detection. + * + * Extension checks are quicker. + * Encoding checks cannot guarantee accuracy for chars between utf8 and utf16. + * + * The extension checks are performed using the following resources: + * - https://github.com/bevry/textextensions + * - https://github.com/bevry/binaryextensions + * + * @param filename The filename for the file/buffer if available + * @param buffer The buffer for the file if available + * @returns Will be `null` if neither `filename` nor `buffer` were provided. Otherwise will be a `boolean` value with the detection result. + */ +export function isBinary(filename?: string | null, buffer?: Buffer | null) { + const text = isText(filename, buffer); + if (text == null) return null; + return !text; +} diff --git a/core/utils/path-helpers.ts b/core/utils/path-helpers.ts index 0b1791a..981d430 100644 --- a/core/utils/path-helpers.ts +++ b/core/utils/path-helpers.ts @@ -4,7 +4,7 @@ import { REPO_ROOT } from '../config'; /** * Resolve an absolute path relative to the repository root. */ -export function resolveToRoot(...pathSegments: string[]) { +export function resolveToRoot(...pathSegments: string[]): string { return path.resolve(REPO_ROOT, ...pathSegments); } diff --git a/core/utils/renderScaffold.ts b/core/utils/renderScaffold.ts new file mode 100644 index 0000000..de4593a --- /dev/null +++ b/core/utils/renderScaffold.ts @@ -0,0 +1,53 @@ +import path from 'path'; +import fs from 'fs'; +import BaseScaffold from 'core/types/BaseScaffold'; +import { resolveToRoot } from './path-helpers'; +import { copyFileWithEjsData, readTemplateDirs } from './fs'; + +// TODO - update templateData type to be more specific +export const renderScaffold = async (cwd: string, scaffold: BaseScaffold, templateData: any) => { + const basePath = resolveToRoot('scaffolds', scaffold.templateName, 'template'); + const allDirFilePaths: string[] = []; + // typeof scaffold.source being a string means it's a directory and we should copy all files + if (typeof scaffold.source === 'string') { + readTemplateDirs(basePath, async (err, filePaths) => { + if (err) { + console.log(err); + } + for (const filePath of filePaths) { + allDirFilePaths.push(filePath); + } + await copyFilesAndRenameEnv(allDirFilePaths, basePath, cwd, templateData); + }); + // Otherwise it's an array and we should copy all the files in the array + } else { + for (const filePath of scaffold.source) { + const resolvedPath = resolveToRoot('scaffolds', scaffold.templateName, 'template', filePath); + + const isDirectory = fs.statSync(resolvedPath).isDirectory(); + if (isDirectory) { + readTemplateDirs(resolvedPath, (err, filePaths) => { + if (err) { + console.log(err); + } + for (const sourceFilePath of filePaths) { + allDirFilePaths.push(sourceFilePath); + } + }); + } else { + allDirFilePaths.push(resolvedPath); + } + } + await copyFilesAndRenameEnv(allDirFilePaths, basePath, cwd, templateData); + } +}; + +async function copyFilesAndRenameEnv(allDirFilePaths: string[], basePath: string, cwd: string, templateData: any) { + for (const filePath of allDirFilePaths) { + // eslint-disable-next-line no-await-in-loop + await copyFileWithEjsData(filePath, path.join(cwd, filePath.replace(basePath, '')), templateData); + } + if (fs.existsSync(path.join(cwd, '.env.example'))) { + fs.renameSync(path.join(cwd, '.env.example'), path.join(cwd, '.env')); + } +} diff --git a/core/utils/scaffold-helpers.ts b/core/utils/scaffold-helpers.ts index 46d16a0..34d6afc 100644 --- a/core/utils/scaffold-helpers.ts +++ b/core/utils/scaffold-helpers.ts @@ -3,20 +3,12 @@ /* eslint-disable import/no-dynamic-require */ /* eslint-disable global-require */ -import { getAbsoluteTemplatePath, resolveToDist } from './path-helpers'; +import fs from 'fs'; +import { ExecaCommand } from 'core/types/BaseScaffold'; +import { getAbsoluteTemplatePath, resolveToDist, resolveToRoot } from './path-helpers'; import type { CreateMagicAppData } from '../create-app'; import type { Flags, ValueType } from '../flags'; -/** - * The render function for a `make-magic` scaffold. - * This is bound to some default props required by the underlying ``. - */ -type ScaffoldRender = Record> = (props: { - name: string; - templateRoot: string; - data: T & CreateMagicAppData; -}) => JSX.Element; - /** * Metadata about the scaffold being defined. */ @@ -38,12 +30,12 @@ type ScaffoldMetadata = Record> * Provides an optional shell command to install dependencies * required by the scaffolded project. */ - installDependenciesCommand?: string[] | ((data: T & CreateMagicAppData) => string[]); + installDependenciesCommand?: ExecaCommand | ((data: T & CreateMagicAppData) => ExecaCommand); /** * Provides an optional shell command to start the scaffolded project. */ - startCommand?: string[] | ((data: T & CreateMagicAppData) => string[]); + startCommand?: ExecaCommand | ((data: T & CreateMagicAppData) => ExecaCommand); /** * Provides metadata about CLI flags that may be used @@ -52,21 +44,7 @@ type ScaffoldMetadata = Record> flags: Flags>; }; -export type ScaffoldDefinition = Record> = ScaffoldRender & - ScaffoldMetadata; - -/** - * Creates the definition object for a scaffolding template. - * - * The return value of this function should be the default export - * of a `[root]/scaffolds/[scaffoldName]/scaffold.{ts,tsx}` file. - */ -export function createScaffold>( - scaffoldRender: ScaffoldRender, - metadata: ScaffoldMetadata, -): ScaffoldDefinition { - return Object.assign(scaffoldRender, { ...metadata }); -} +export type ScaffoldDefinition = Record> = ScaffoldMetadata; /** * Gets the definition object for a scaffolding template. @@ -74,21 +52,17 @@ export function createScaffold>( export function getScaffoldDefinition(scaffoldName: string): ScaffoldDefinition { // We are requiring this file in context of the // transpiled `/dist` output, so we use a JS extension... - return require(resolveToDist('scaffolds', scaffoldName, 'scaffold.js')).default; + return require(resolveToDist('scaffolds', scaffoldName, 'scaffold.js')).definition; } /** - * Gets the render function for a scaffolding template. - * The returned function is bound with `data` and some initial `Zombi` props. + * Creates a new project directory if it doesn't exist and makes it cwd. + * @param cwd Destination directory where the scaffold will be created + * @param projectName Project name */ -export function getScaffoldRender(data: CreateMagicAppData & Record): () => JSX.Element { - // We are requiring this file in context of the - // transpiled `/dist`, so we use a JS extension... - const scaffoldModule = getScaffoldDefinition(data.template); - - return scaffoldModule.bind(scaffoldModule, { - data, - name: data.template, - templateRoot: getAbsoluteTemplatePath(data.template), - }); +export function createProjectDirIfDoesntExists(cwd: string, projectName: string) { + if (!fs.existsSync(resolveToRoot(cwd, projectName))) { + fs.mkdirSync(resolveToRoot(cwd, projectName)); + } + process.chdir(projectName); } diff --git a/core/utils/templateMappings.ts b/core/utils/templateMappings.ts index fadff61..51935c0 100644 --- a/core/utils/templateMappings.ts +++ b/core/utils/templateMappings.ts @@ -1,3 +1,27 @@ +import { Ora, Spinner } from 'ora'; +import { + AuthTypePrompt, + BlockchainNetworkPrompt, + ConfigurationPrompt, + ProductPrompt, + ProjectNamePrompt, + PublishableApiKeyPrompt, +} from 'scaffolds/prompts'; +import { CreateMagicAppConfig, pauseTimerAndSpinner } from 'core/create-app'; +import BaseScaffold from '../types/BaseScaffold'; +import DedicatedScaffold, { flags as dedicatedFlags } from '../../scaffolds/nextjs-dedicated-wallet/scaffold'; +import FlowDedicatedScaffold, { + flags as flowDedicatedFlags, +} from '../../scaffolds/nextjs-flow-dedicated-wallet/scaffold'; +import FlowUniversalScaffold, { + flags as flowUniversalFlags, +} from '../../scaffolds/nextjs-flow-universal-wallet/scaffold'; +import SolanaDedicatedScaffold, { + flags as solanaDedicatedFlags, +} from '../../scaffolds/nextjs-solana-dedicated-wallet/scaffold'; +import UniversalScaffold, { flags as universalFlags } from '../../scaffolds/nextjs-universal-wallet/scaffold'; +import { Timer } from './timer'; + export type Chain = 'evm' | 'solana' | 'flow'; export type Template = | 'nextjs-dedicated-wallet' @@ -7,8 +31,15 @@ export type Template = | 'nextjs-flow-dedicated-wallet'; export type Product = 'universal' | 'dedicated'; +type ConfigType = CreateMagicAppConfig & { + chain: Chain | undefined; + product: Product | undefined; + configuration: string | undefined; + isChosenTemplateValid: boolean; + isQuickstart: boolean; +}; -export function mapTemplateToChain(template: string): Chain | undefined { +function mapTemplateToChain(template: string): Chain | undefined { switch (template) { case 'nextjs-dedicated-wallet': case 'nextjs-universal-wallet': @@ -23,7 +54,7 @@ export function mapTemplateToChain(template: string): Chain | undefined { } } -export function mapTemplateToProduct(template: string): Product | undefined { +function mapTemplateToProduct(template: string): Product | undefined { switch (template) { case 'nextjs-dedicated-wallet': case 'nextjs-solana-dedicated-wallet': @@ -36,3 +67,160 @@ export function mapTemplateToProduct(template: string): Product | undefined { return undefined; } } + +export async function mapTemplateToScaffold( + template: string, + appData: any, + spinner: Ora, + timer: Timer, +): Promise { + const data = appData; + pauseTimerAndSpinner(timer, spinner); + if (!data.publishableApiKey) { + data.publishableApiKey = await PublishableApiKeyPrompt.publishableApiKeyPrompt(); + } + switch (template) { + case 'nextjs-dedicated-wallet': + if (!data.network) { + data.network = await BlockchainNetworkPrompt.evmNetworkPrompt(); + } + + if (data.isQuickstart) { + data.loginMethods = ['Email OTP']; + } else if (!data.loginMethods || data.loginMethods.length === 0) { + data.loginMethods = await AuthTypePrompt.loginMethodsPrompt(); + } + return new DedicatedScaffold(data); + case 'nextjs-universal-wallet': + if (!data.network) { + data.network = await BlockchainNetworkPrompt.evmNetworkPrompt(); + } + return new UniversalScaffold(data); + case 'nextjs-solana-dedicated-wallet': + if (!data.network) { + data.network = await BlockchainNetworkPrompt.solanaNetworkPrompt(); + } + if (!data.loginMethods || data.loginMethods.length === 0) { + data.loginMethods = await AuthTypePrompt.loginMethodsPrompt(); + } + return new SolanaDedicatedScaffold(data); + case 'nextjs-flow-universal-wallet': + if (!data.network) { + data.network = await BlockchainNetworkPrompt.flowNetworkPrompt(); + } + return new FlowUniversalScaffold(data); + case 'nextjs-flow-dedicated-wallet': + if (!data.network) { + data.network = await BlockchainNetworkPrompt.flowNetworkPrompt(); + } + if (!data.loginMethods || data.loginMethods.length === 0) { + data.loginMethods = await AuthTypePrompt.loginMethodsPrompt(); + } + return new FlowDedicatedScaffold(data); + default: + throw new Error(`Invalid template: ${template}`); + } +} + +export function mapTemplateToFlags(template: string): any { + switch (template) { + case 'nextjs-dedicated-wallet': + return dedicatedFlags; + case 'nextjs-universal-wallet': + return universalFlags; + case 'nextjs-solana-dedicated-wallet': + return solanaDedicatedFlags; + case 'nextjs-flow-universal-wallet': + return flowUniversalFlags; + case 'nextjs-flow-dedicated-wallet': + return flowDedicatedFlags; + default: + throw new Error(`Invalid template: ${template}`); + } +} + +const quickstartConfig = (config: ConfigType): ConfigType => ({ + ...config, + template: 'nextjs-dedicated-wallet', + network: 'polygon-mumbai', + product: 'dedicated', + chain: 'evm', + isChosenTemplateValid: true, + isQuickstart: true, +}); + +const solanaConfig = async (config: ConfigType): Promise => ({ + ...config, + template: 'nextjs-solana-dedicated-wallet', + network: await BlockchainNetworkPrompt.solanaNetworkPrompt(), + product: 'dedicated', + chain: 'solana', + isChosenTemplateValid: true, + isQuickstart: false, +}); + +export const buildTemplate = async (appConfig: ConfigType): Promise => { + let config = appConfig; + if (!config.projectName) { + config.projectName = await ProjectNamePrompt.askProjectName(); + } + + if (!config.template) { + config.configuration = await ConfigurationPrompt.askConfiguration(); + + if (config.configuration === 'quickstart') { + config = quickstartConfig(config); + return config; + } + } else { + config = { + ...config, + product: mapTemplateToProduct(config.template), + chain: mapTemplateToChain(config.template), + }; + } + + if (!config.chain && !config.network) { + config.chain = await BlockchainNetworkPrompt.chainPrompt(); + } + + if (!config.network) { + if (config.chain === 'solana') { + config = await solanaConfig(config); + } else if (config.chain === 'flow') { + config.network = await BlockchainNetworkPrompt.flowNetworkPrompt(); + } else if (config.chain === 'evm') { + config.network = await BlockchainNetworkPrompt.evmNetworkPrompt(); + } + } else if ( + config.network === 'ethereum' || + config.network === 'ethereum-goerli' || + config.network === 'polygon' || + config.network === 'polygon-mumbai' + ) { + config.chain = 'evm'; + } else if (config.network === 'solana-denvet' || config.network === 'solana-mainnet') { + config.chain = 'solana'; + } else { + config.chain = 'flow'; + } + + if (!config.product) { + config.product = await ProductPrompt.askProduct(); + + if (config.product === 'universal') { + if (config.chain === 'flow') { + config.template = 'nextjs-flow-universal-wallet'; + } else { + config.template = 'nextjs-universal-wallet'; + } + } else if (config.chain === 'flow') { + config.template = 'nextjs-flow-dedicated-wallet'; + } else { + config.template = 'nextjs-dedicated-wallet'; + } + config.isChosenTemplateValid = true; + } + + return config; +}; diff --git a/core/utils/timer.ts b/core/utils/timer.ts new file mode 100644 index 0000000..72fa4c3 --- /dev/null +++ b/core/utils/timer.ts @@ -0,0 +1,54 @@ +export type HrTime = [number, number]; + +/** + * Calculate the difference between two Node hrtime (`[second, nanosecond]`) + * tuples. + * + * Based on the `diff-hrtime` NPM package. + * + * @see the `package.json#license` field at the root of this source tree: + * https://github.com/firefoxes/diff-hrtime/blob/master/index.js + */ +function subtractTime(a: HrTime, b: HrTime): HrTime { + // Capture seconds and nanoseconds + const [aS, aNS] = a; + const [bS, bNS] = b; + let ns = aNS - bNS; // Nanoseconds delta + let s = aS - bS; // Seconds delta + + // If we have overflow nanoseconds + if (ns >= 1e9) { + s -= 1; // Subtract a second + ns += 1e9; // Add a billion nanoseconds + } + + return [s, ns]; +} + +export function createTimer() { + let startTime: HrTime; + let pauses: HrTime[] = []; + let resumes: HrTime[] = []; + + return { + start() { + startTime = process.hrtime(); + pauses = []; + resumes = []; + }, + + pause() { + pauses.push(process.hrtime()); + }, + + resume() { + resumes.push(process.hrtime(pauses.pop())); + }, + + stop() { + return resumes.reduce((prev, curr) => subtractTime(prev, curr), process.hrtime(startTime)); + }, + }; +} + +export type Timer = ReturnType; diff --git a/package.json b/package.json index 7865c98..049c460 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "make-magic", - "version": "4.3.1", + "version": "4.4.1", "description": "A tool for quickly scaffolding an app with Magic authentication baked-in!", "repository": "magiclabs/create-magic-app", "license": "MIT", @@ -27,8 +27,10 @@ "@ikscodes/prettier-config": "^2.0.1", "@types/bytes": "^3.1.0", "@types/ejs": "^3.0.5", + "@types/fs-extra": "^11.0.2", "@types/node": "^14.14.12", "@types/parse-package-name": "^0.1.0", + "@types/pretty-time": "^1.1.3", "@types/react": "^17.0.0", "@types/react-is": "^17.0.0", "@types/tar": "^4.0.4", @@ -66,8 +68,7 @@ "tsc-watch": "^4.2.9", "typescript": "^4.1.2", "wrap-ansi": "^7.0.0", - "yargs-parser": "^20.2.4", - "zombi": "^6.0.2" + "yargs-parser": "^20.2.4" }, "auto": { "plugins": [ @@ -76,6 +77,12 @@ }, "dependencies": { "@segment/analytics-node": "^1.1.0", - "enquirer": "^2.4.0" + "binaryextensions": "^4.18.0", + "ejs": "^3.1.9", + "enquirer": "^2.4.0", + "fs-extra": "^11.1.1", + "ora": "^5.1.0", + "pretty-time": "^1.1.0", + "textextensions": "^5.16.0" } } diff --git a/scaffolds/nextjs-dedicated-wallet/scaffold.tsx b/scaffolds/nextjs-dedicated-wallet/scaffold.tsx index 118155a..90b6d23 100644 --- a/scaffolds/nextjs-dedicated-wallet/scaffold.tsx +++ b/scaffolds/nextjs-dedicated-wallet/scaffold.tsx @@ -1,93 +1,81 @@ -import React from 'react'; -import { Template, Zombi, mergePrompts } from 'zombi'; -import { createScaffold } from 'core/utils/scaffold-helpers'; -import { - AuthTypePrompt, - BlockchainNetworkPrompt, - NpmClientPrompt, - PublishableApiKeyPrompt, - SecretApiKeyPrompt, -} from 'scaffolds/prompts'; +import { Flags } from 'core/flags'; +import BaseScaffold, { ExecaCommand } from 'core/types/BaseScaffold'; +import { AuthTypePrompt, BlockchainNetworkPrompt, PublishableApiKeyPrompt } from 'scaffolds/prompts'; -type NextDedicatedWalletData = NpmClientPrompt.Data & - PublishableApiKeyPrompt.Data & - BlockchainNetworkPrompt.Data & - AuthTypePrompt.Data; +export type Data = BlockchainNetworkPrompt.Data & PublishableApiKeyPrompt.Data & AuthTypePrompt.Data; -export default createScaffold( - (props) => ( - - {(data) => ( - <> -