@nice-move/cli 0.10.11 → 0.10.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/214.mjs +1 -0
- package/dist/402.mjs +1 -1
- package/dist/609.mjs +1 -0
- package/dist/777.mjs +1 -0
- package/dist/794.mjs +1 -0
- package/dist/cli.mjs +1 -1
- package/package.json +6 -6
- package/dist/600.mjs +0 -1
- package/dist/722.mjs +0 -1
package/dist/214.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const id=214;export const ids=[214];export const modules={5234:(e,t,r)=>{const s=r(3026),n=r(3528),i=r(8873),o=r(1623),a=(e,t={})=>{let r=[];if(Array.isArray(e))for(let s of e){let e=a.create(s,t);Array.isArray(e)?r.push(...e):r.push(e)}else r=[].concat(a.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(r=[...new Set(r)]),r};a.parse=(e,t={})=>o(e,t),a.stringify=(e,t={})=>s("string"==typeof e?a.parse(e,t):e,t),a.compile=(e,t={})=>("string"==typeof e&&(e=a.parse(e,t)),n(e,t)),a.expand=(e,t={})=>{"string"==typeof e&&(e=a.parse(e,t));let r=i(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},a.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?a.compile(e,t):a.expand(e,t),e.exports=a},3528:(e,t,r)=>{const s=r(7305),n=r(2012);e.exports=(e,t={})=>{let r=(e,i={})=>{let o=n.isInvalidBrace(i),a=!0===e.invalid&&!0===t.escapeInvalid,l=!0===o||!0===a,c=!0===t.escapeInvalid?"\\":"",u="";if(!0===e.isOpen)return c+e.value;if(!0===e.isClose)return c+e.value;if("open"===e.type)return l?c+e.value:"(";if("close"===e.type)return l?c+e.value:")";if("comma"===e.type)return"comma"===e.prev.type?"":l?e.value:"|";if(e.value)return e.value;if(e.nodes&&e.ranges>0){let r=n.reduce(e.nodes),i=s(...r,{...t,wrap:!1,toRegex:!0});if(0!==i.length)return r.length>1&&i.length>1?`(${i})`:i}if(e.nodes)for(let t of e.nodes)u+=r(t,e);return u};return r(e)}},8514:e=>{e.exports={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:"\xa0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"}},8873:(e,t,r)=>{const s=r(7305),n=r(3026),i=r(2012),o=(e="",t="",r=!1)=>{let s=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return r?i.flatten(t).map((e=>`{${e}}`)):t;for(let n of e)if(Array.isArray(n))for(let e of n)s.push(o(e,t,r));else for(let e of t)!0===r&&"string"==typeof e&&(e=`{${e}}`),s.push(Array.isArray(e)?o(n,e,r):n+e);return i.flatten(s)};e.exports=(e,t={})=>{let r=void 0===t.rangeLimit?1e3:t.rangeLimit,a=(e,l={})=>{e.queue=[];let c=l,u=l.queue;for(;"brace"!==c.type&&"root"!==c.type&&c.parent;)c=c.parent,u=c.queue;if(e.invalid||e.dollar)return void u.push(o(u.pop(),n(e,t)));if("brace"===e.type&&!0!==e.invalid&&2===e.nodes.length)return void u.push(o(u.pop(),["{}"]));if(e.nodes&&e.ranges>0){let a=i.reduce(e.nodes);if(i.exceedsLimit(...a,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let l=s(...a,t);return 0===l.length&&(l=n(e,t)),u.push(o(u.pop(),l)),void(e.nodes=[])}let p=i.encloseBrace(e),d=e.queue,h=e;for(;"brace"!==h.type&&"root"!==h.type&&h.parent;)h=h.parent,d=h.queue;for(let t=0;t<e.nodes.length;t++){let r=e.nodes[t];"comma"!==r.type||"brace"!==e.type?"close"!==r.type?r.value&&"open"!==r.type?d.push(o(d.pop(),r.value)):r.nodes&&a(r,e):u.push(o(u.pop(),d,p)):(1===t&&d.push(""),d.push(""))}return d};return i.flatten(a(e))}},1623:(e,t,r)=>{const s=r(3026),{MAX_LENGTH:n,CHAR_BACKSLASH:i,CHAR_BACKTICK:o,CHAR_COMMA:a,CHAR_DOT:l,CHAR_LEFT_PARENTHESES:c,CHAR_RIGHT_PARENTHESES:u,CHAR_LEFT_CURLY_BRACE:p,CHAR_RIGHT_CURLY_BRACE:d,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_RIGHT_SQUARE_BRACKET:f,CHAR_DOUBLE_QUOTE:g,CHAR_SINGLE_QUOTE:m,CHAR_NO_BREAK_SPACE:y,CHAR_ZERO_WIDTH_NOBREAK_SPACE:b}=r(8514);e.exports=(e,t={})=>{if("string"!=typeof e)throw new TypeError("Expected a string");let r=t||{},E="number"==typeof r.maxLength?Math.min(n,r.maxLength):n;if(e.length>E)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${E})`);let R,A={type:"root",input:e,nodes:[]},w=[A],C=A,S=A,v=0,T=e.length,O=0,x=0;const _=()=>e[O++],k=e=>{if("text"===e.type&&"dot"===S.type&&(S.type="text"),!S||"text"!==S.type||"text"!==e.type)return C.nodes.push(e),e.parent=C,e.prev=S,S=e,e;S.value+=e.value};for(k({type:"bos"});O<T;)if(C=w[w.length-1],R=_(),R!==b&&R!==y)if(R!==i)if(R!==f)if(R!==h)if(R!==c)if(R!==u)if(R!==g&&R!==m&&R!==o)if(R!==p)if(R!==d)if(R===a&&x>0){if(C.ranges>0){C.ranges=0;let e=C.nodes.shift();C.nodes=[e,{type:"text",value:s(C)}]}k({type:"comma",value:R}),C.commas++}else if(R===l&&x>0&&0===C.commas){let e=C.nodes;if(0===x||0===e.length){k({type:"text",value:R});continue}if("dot"===S.type){if(C.range=[],S.value+=R,S.type="range",3!==C.nodes.length&&5!==C.nodes.length){C.invalid=!0,C.ranges=0,S.type="text";continue}C.ranges++,C.args=[];continue}if("range"===S.type){e.pop();let t=e[e.length-1];t.value+=S.value+R,S=t,C.ranges--;continue}k({type:"dot",value:R})}else k({type:"text",value:R});else{if("brace"!==C.type){k({type:"text",value:R});continue}let e="close";C=w.pop(),C.close=!0,k({type:e,value:R}),x--,C=w[w.length-1]}else{x++;let e=S.value&&"$"===S.value.slice(-1)||!0===C.dollar;C=k({type:"brace",open:!0,close:!1,dollar:e,depth:x,commas:0,ranges:0,nodes:[]}),w.push(C),k({type:"open",value:R})}else{let e,r=R;for(!0!==t.keepQuotes&&(R="");O<T&&(e=_());)if(e!==i){if(e===r){!0===t.keepQuotes&&(R+=e);break}R+=e}else R+=e+_();k({type:"text",value:R})}else{if("paren"!==C.type){k({type:"text",value:R});continue}C=w.pop(),k({type:"text",value:R}),C=w[w.length-1]}else C=k({type:"paren",nodes:[]}),w.push(C),k({type:"text",value:R});else{v++;let e;for(;O<T&&(e=_());)if(R+=e,e!==h)if(e!==i){if(e===f&&(v--,0===v))break}else R+=_();else v++;k({type:"text",value:R})}else k({type:"text",value:"\\"+R});else k({type:"text",value:(t.keepEscaping?R:"")+_()});do{if(C=w.pop(),"root"!==C.type){C.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));let e=w[w.length-1],t=e.nodes.indexOf(C);e.nodes.splice(t,1,...C.nodes)}}while(w.length>0);return k({type:"eos"}),A}},3026:(e,t,r)=>{const s=r(2012);e.exports=(e,t={})=>{let r=(e,n={})=>{let i=t.escapeInvalid&&s.isInvalidBrace(n),o=!0===e.invalid&&!0===t.escapeInvalid,a="";if(e.value)return(i||o)&&s.isOpenOrClose(e)?"\\"+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)a+=r(t);return a};return r(e)}},2012:(e,t)=>{t.isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),t.find=(e,t)=>e.nodes.find((e=>e.type===t)),t.exceedsLimit=(e,r,s=1,n)=>!1!==n&&(!(!t.isInteger(e)||!t.isInteger(r))&&(Number(r)-Number(e))/Number(s)>=n),t.escapeNode=(e,t=0,r)=>{let s=e.nodes[t];s&&(r&&s.type===r||"open"===s.type||"close"===s.type)&&!0!==s.escaped&&(s.value="\\"+s.value,s.escaped=!0)},t.encloseBrace=e=>"brace"===e.type&&(e.commas>>0+e.ranges>>0==0&&(e.invalid=!0,!0)),t.isInvalidBrace=e=>"brace"===e.type&&(!(!0!==e.invalid&&!e.dollar)||(e.commas>>0+e.ranges>>0==0||!0!==e.open||!0!==e.close)&&(e.invalid=!0,!0)),t.isOpenOrClose=e=>"open"===e.type||"close"===e.type||(!0===e.open||!0===e.close),t.reduce=e=>e.reduce(((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e)),[]),t.flatten=(...e)=>{const t=[],r=e=>{for(let s=0;s<e.length;s++){let n=e[s];Array.isArray(n)?r(n,t):void 0!==n&&t.push(n)}return t};return r(e),t}},5881:e=>{var t=1e3,r=60*t,s=60*r,n=24*s,i=7*n,o=365.25*n;function a(e,t,r,s){var n=t>=1.5*r;return Math.round(e/r)+" "+s+(n?"s":"")}e.exports=function(e,l){l=l||{};var c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var l=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*o;case"weeks":case"week":case"w":return l*i;case"days":case"day":case"d":return l*n;case"hours":case"hour":case"hrs":case"hr":case"h":return l*s;case"minutes":case"minute":case"mins":case"min":case"m":return l*r;case"seconds":case"second":case"secs":case"sec":case"s":return l*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}(e);if("number"===c&&isFinite(e))return l.long?function(e){var i=Math.abs(e);if(i>=n)return a(e,i,n,"day");if(i>=s)return a(e,i,s,"hour");if(i>=r)return a(e,i,r,"minute");if(i>=t)return a(e,i,t,"second");return e+" ms"}(e):function(e){var i=Math.abs(e);if(i>=n)return Math.round(e/n)+"d";if(i>=s)return Math.round(e/s)+"h";if(i>=r)return Math.round(e/r)+"m";if(i>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},5130:(e,t,r)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let s=0,n=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(s++,"%c"===e&&(n=s))})),t.splice(n,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(7123)(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},7123:(e,t,r)=>{e.exports=function(e){function t(e){let r,n,i,o=null;function a(...e){if(!a.enabled)return;const s=a,n=Number(new Date),i=n-(r||n);s.diff=i,s.prev=r,s.curr=n,r=n,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,n)=>{if("%%"===r)return"%";o++;const i=t.formatters[n];if("function"==typeof i){const t=e[o];r=i.call(s,t),e.splice(o,1),o--}return r})),t.formatArgs.call(s,e);(s.log||t.log).apply(s,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=s,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(n!==t.namespaces&&(n=t.namespaces,i=t.enabled(e)),i),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function s(e,r){const s=t(this.namespace+(void 0===r?":":r)+e);return s.log=this.log,s}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const s=("string"==typeof e?e:"").split(/[\s,]+/),n=s.length;for(r=0;r<n;r++)s[r]&&("-"===(e=s[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,s;for(r=0,s=t.skips.length;r<s;r++)if(t.skips[r].test(e))return!1;for(r=0,s=t.names.length;r<s;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(5881),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},445:(e,t,r)=>{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=r(5130):e.exports=r(8414)},8414:(e,t,r)=>{const s=r(6224),n=r(3837);t.init=function(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let s=0;s<r.length;s++)e.inspectOpts[r[s]]=t.inspectOpts[r[s]]},t.log=function(...e){return process.stderr.write(n.format(...e)+"\n")},t.formatArgs=function(r){const{namespace:s,useColors:n}=this;if(n){const t=this.color,n="\x1b[3"+(t<8?t:"8;5;"+t),i=` ${n};1m${s} \x1b[0m`;r[0]=i+r[0].split("\n").join("\n"+i),r.push(n+"m+"+e.exports.humanize(this.diff)+"\x1b[0m")}else r[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+s+" "+r[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):s.isatty(process.stderr.fd)},t.destroy=n.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=r(7013);e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let s=process.env[t];return s=!!/^(yes|on|true|enabled)$/i.test(s)||!/^(no|off|false|disabled)$/i.test(s)&&("null"===s?null:Number(s)),e[r]=s,e}),{}),e.exports=r(7123)(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts)}},161:e=>{var t=Object.prototype.hasOwnProperty,r="~";function s(){}function n(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,s,i,o){if("function"!=typeof s)throw new TypeError("The listener must be a function");var a=new n(s,i||e,o),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new s:delete e._events[t]}function a(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,s,n=[];if(0===this._eventsCount)return n;for(s in e=this._events)t.call(e,s)&&n.push(r?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},a.prototype.listeners=function(e){var t=r?r+e:e,s=this._events[t];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,i=s.length,o=new Array(i);n<i;n++)o[n]=s[n].fn;return o},a.prototype.listenerCount=function(e){var t=r?r+e:e,s=this._events[t];return s?s.fn?1:s.length:0},a.prototype.emit=function(e,t,s,n,i,o){var a=r?r+e:e;if(!this._events[a])return!1;var l,c,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,s),!0;case 4:return u.fn.call(u.context,t,s,n),!0;case 5:return u.fn.call(u.context,t,s,n,i),!0;case 6:return u.fn.call(u.context,t,s,n,i,o),!0}for(c=1,l=new Array(p-1);c<p;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,h=u.length;for(c=0;c<h;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),p){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,s);break;case 4:u[c].fn.call(u[c].context,t,s,n);break;default:if(!l)for(d=1,l=new Array(p-1);d<p;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},a.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,s,n){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return o(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||n&&!a.once||s&&a.context!==s||o(this,i);else{for(var l=0,c=[],u=a.length;l<u;l++)(a[l].fn!==t||n&&!a[l].once||s&&a[l].context!==s)&&c.push(a[l]);c.length?this._events[i]=1===c.length?c[0]:c:o(this,i)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&o(this,t)):(this._events=new s,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},2162:(e,t,r)=>{var s=global.process;const n=function(e){return e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on};if(n(s)){var i,o=r(9491),a=r(3229),l=/^win/i.test(s.platform),c=r(2361);"function"!=typeof c&&(c=c.EventEmitter),s.__signal_exit_emitter__?i=s.__signal_exit_emitter__:((i=s.__signal_exit_emitter__=new c).count=0,i.emitted={}),i.infinite||(i.setMaxListeners(1/0),i.infinite=!0),e.exports=function(e,t){if(!n(global.process))return function(){};o.equal(typeof e,"function","a callback must be provided for exit handler"),!1===h&&f();var r="exit";t&&t.alwaysLast&&(r="afterexit");return i.on(r,e),function(){i.removeListener(r,e),0===i.listeners("exit").length&&0===i.listeners("afterexit").length&&u()}};var u=function(){h&&n(global.process)&&(h=!1,a.forEach((function(e){try{s.removeListener(e,d[e])}catch(e){}})),s.emit=y,s.reallyExit=g,i.count-=1)};e.exports.unload=u;var p=function(e,t,r){i.emitted[e]||(i.emitted[e]=!0,i.emit(e,t,r))},d={};a.forEach((function(e){d[e]=function(){n(global.process)&&(s.listeners(e).length===i.count&&(u(),p("exit",null,e),p("afterexit",null,e),l&&"SIGHUP"===e&&(e="SIGINT"),s.kill(s.pid,e)))}})),e.exports.signals=function(){return a};var h=!1,f=function(){!h&&n(global.process)&&(h=!0,i.count+=1,a=a.filter((function(e){try{return s.on(e,d[e]),!0}catch(e){return!1}})),s.emit=b,s.reallyExit=m)};e.exports.load=f;var g=s.reallyExit,m=function(e){n(global.process)&&(s.exitCode=e||0,p("exit",s.exitCode,null),p("afterexit",s.exitCode,null),g.call(s,s.exitCode))},y=s.emit,b=function(e,t){if("exit"===e&&n(global.process)){void 0!==t&&(s.exitCode=t);var r=y.apply(this,arguments);return p("exit",s.exitCode,null),p("afterexit",s.exitCode,null),r}return y.apply(this,arguments)}}else e.exports=function(){return function(){}}},3229:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==process.platform&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")},7305:(e,t,r)=>{const s=r(3837),n=r(1914),i=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),o=e=>"number"==typeof e||"string"==typeof e&&""!==e,a=e=>Number.isInteger(+e),l=e=>{let t=`${e}`,r=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++r];);return r>0},c=(e,t,r)=>{if(t>0){let r="-"===e[0]?"-":"";r&&(e=e.slice(1)),e=r+e.padStart(r?t-1:t,"0")}return!1===r?String(e):e},u=(e,t)=>{let r="-"===e[0]?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},p=(e,t,r,s)=>{if(r)return n(e,t,{wrap:!1,...s});let i=String.fromCharCode(e);return e===t?i:`[${i}-${String.fromCharCode(t)}]`},d=(e,t,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,s=r.capture?"":"?:";return t?`(${s}${e.join("|")})`:e.join("|")}return n(e,t,r)},h=(...e)=>new RangeError("Invalid range arguments: "+s.inspect(...e)),f=(e,t,r)=>{if(!0===r.strictRanges)throw h([e,t]);return[]},g=(e,t,r=1,s={})=>{let n=Number(e),i=Number(t);if(!Number.isInteger(n)||!Number.isInteger(i)){if(!0===s.strictRanges)throw h([e,t]);return[]}0===n&&(n=0),0===i&&(i=0);let o=n>i,a=String(e),f=String(t),g=String(r);r=Math.max(Math.abs(r),1);let m=l(a)||l(f)||l(g),y=m?Math.max(a.length,f.length,g.length):0,b=!1===m&&!1===((e,t,r)=>"string"==typeof e||"string"==typeof t||!0===r.stringify)(e,t,s),E=s.transform||(e=>t=>!0===e?Number(t):String(t))(b);if(s.toRegex&&1===r)return p(u(e,y),u(t,y),!0,s);let R={negatives:[],positives:[]},A=[],w=0;for(;o?n>=i:n<=i;)!0===s.toRegex&&r>1?R[(C=n)<0?"negatives":"positives"].push(Math.abs(C)):A.push(c(E(n,w),y,b)),n=o?n-r:n+r,w++;var C;return!0===s.toRegex?r>1?((e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let r,s=t.capture?"":"?:",n="",i="";return e.positives.length&&(n=e.positives.join("|")),e.negatives.length&&(i=`-(${s}${e.negatives.join("|")})`),r=n&&i?`${n}|${i}`:n||i,t.wrap?`(${s}${r})`:r})(R,s):d(A,null,{wrap:!1,...s}):A},m=(e,t,r,s={})=>{if(null==t&&o(e))return[e];if(!o(e)||!o(t))return f(e,t,s);if("function"==typeof r)return m(e,t,1,{transform:r});if(i(r))return m(e,t,0,r);let n={...s};return!0===n.capture&&(n.wrap=!0),r=r||n.step||1,a(r)?a(e)&&a(t)?g(e,t,r,n):((e,t,r=1,s={})=>{if(!a(e)&&e.length>1||!a(t)&&t.length>1)return f(e,t,s);let n=s.transform||(e=>String.fromCharCode(e)),i=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),l=i>o,c=Math.min(i,o),u=Math.max(i,o);if(s.toRegex&&1===r)return p(c,u,!1,s);let h=[],g=0;for(;l?i>=o:i<=o;)h.push(n(i,g)),i=l?i-r:i+r,g++;return!0===s.toRegex?d(h,null,{wrap:!1,options:s}):h})(e,t,Math.max(Math.abs(r),1),n):null==r||i(r)?m(e,t,1,r):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(r,n)};e.exports=m},4337:(e,t,r)=>{const{PassThrough:s}=r(2781);e.exports=e=>{e={...e};const{array:t}=e;let{encoding:r}=e;const n="buffer"===r;let i=!1;t?i=!(r||n):r=r||"utf8",n&&(r=null);const o=new s({objectMode:i});r&&o.setEncoding(r);let a=0;const l=[];return o.on("data",(e=>{l.push(e),i?a=l.length:a+=e.length})),o.getBufferedValue=()=>t?l:n?Buffer.concat(l,a):l.join(""),o.getBufferedLength=()=>a,o}},2935:(e,t,r)=>{const{constants:s}=r(4300),n=r(2781),{promisify:i}=r(3837),o=r(4337),a=i(n.pipeline);class l extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function c(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,n=o(t);return await new Promise(((t,i)=>{const o=e=>{e&&n.getBufferedLength()<=s.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),i(e)};(async()=>{try{await a(e,n),t()}catch(e){o(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&o(new l)}))})),n.getBufferedValue()}e.exports=c,e.exports.buffer=(e,t)=>c(e,{...t,encoding:"buffer"}),e.exports.array=(e,t)=>c(e,{...t,array:!0}),e.exports.MaxBufferError=l},8137:e=>{e.exports=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":1===e.length?"-":"--",s=t.indexOf(r+e),n=t.indexOf("--");return-1!==s&&(-1===n||s<n)}},1346:e=>{e.exports=function(e){return"number"==typeof e?e-e==0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))}},1876:(e,t,r)=>{const s=r(3837),n=r(5234),i=r(4763),o=r(3338),a=e=>""===e||"./"===e,l=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let s=new Set,n=new Set,o=new Set,a=0,l=e=>{o.add(e.output),r&&r.onResult&&r.onResult(e)};for(let o=0;o<t.length;o++){let c=i(String(t[o]),{...r,onResult:l},!0),u=c.state.negated||c.state.negatedExtglob;u&&a++;for(let t of e){let e=c(t,!0);(u?!e.isMatch:e.isMatch)&&(u?s.add(e.output):(s.delete(e.output),n.add(e.output)))}}let c=(a===t.length?[...o]:[...n]).filter((e=>!s.has(e)));if(r&&0===c.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}return c};l.match=l,l.matcher=(e,t)=>i(e,t),l.any=l.isMatch=(e,t,r)=>i(t,r)(e),l.not=(e,t,r={})=>{t=[].concat(t).map(String);let s=new Set,n=[],i=new Set(l(e,t,{...r,onResult:e=>{r.onResult&&r.onResult(e),n.push(e.output)}}));for(let e of n)i.has(e)||s.add(e);return[...s]},l.contains=(e,t,r)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${s.inspect(e)}"`);if(Array.isArray(t))return t.some((t=>l.contains(e,t,r)));if("string"==typeof t){if(a(e)||a(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return l.isMatch(e,t,{...r,contains:!0})},l.matchKeys=(e,t,r)=>{if(!o.isObject(e))throw new TypeError("Expected the first argument to be an object");let s=l(Object.keys(e),t,r),n={};for(let t of s)n[t]=e[t];return n},l.some=(e,t,r)=>{let s=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),r);if(s.some((e=>t(e))))return!0}return!1},l.every=(e,t,r)=>{let s=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),r);if(!s.every((e=>t(e))))return!1}return!0},l.all=(e,t,r)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${s.inspect(e)}"`);return[].concat(t).every((t=>i(t,r)(e)))},l.capture=(e,t,r)=>{let s=o.isWindows(r),n=i.makeRe(String(e),{...r,capture:!0}).exec(s?o.toPosixSlashes(t):t);if(n)return n.slice(1).map((e=>void 0===e?"":e))},l.makeRe=(...e)=>i.makeRe(...e),l.scan=(...e)=>i.scan(...e),l.parse=(e,t)=>{let r=[];for(let s of[].concat(e||[]))for(let e of n(String(s),t))r.push(i.parse(e,t));return r},l.braces=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return t&&!0===t.nobrace||!/\{.*\}/.test(e)?[e]:n(e,t)},l.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return l.braces(e,{...t,expand:!0})},e.exports=l},4763:(e,t,r)=>{e.exports=r(2595)},7411:(e,t,r)=>{const s=r(1017),n="\\\\/",i=`[^${n}]`,o="\\.",a="\\/",l="[^/]",c=`(?:${a}|$)`,u=`(?:^|${a})`,p=`${o}{1,2}${c}`,d={DOT_LITERAL:o,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:a,ONE_CHAR:"(?=.)",QMARK:l,END_ANCHOR:c,DOTS_SLASH:p,NO_DOT:`(?!${o})`,NO_DOTS:`(?!${u}${p})`,NO_DOT_SLASH:`(?!${o}{0,1}${c})`,NO_DOTS_SLASH:`(?!${p})`,QMARK_NO_DOT:`[^.${a}]`,STAR:`${l}*?`,START_ANCHOR:u},h={...d,SLASH_LITERAL:`[${n}]`,QMARK:i,STAR:`${i}*?`,DOTS_SLASH:`${o}{1,2}(?:[${n}]|$)`,NO_DOT:`(?!${o})`,NO_DOTS:`(?!(?:^|[${n}])${o}{1,2}(?:[${n}]|$))`,NO_DOT_SLASH:`(?!${o}{0,1}(?:[${n}]|$))`,NO_DOTS_SLASH:`(?!${o}{1,2}(?:[${n}]|$))`,QMARK_NO_DOT:`[^.${n}]`,START_ANCHOR:`(?:^|[${n}])`,END_ANCHOR:`(?:[${n}]|$)`};e.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:s.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?h:d}},2902:(e,t,r)=>{const s=r(7411),n=r(3338),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:l,REPLACEMENTS:c}=s,u=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map((e=>n.escapeRegex(e))).join("..")}return r},p=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=c[e]||e;const r={...t},h="number"==typeof r.maxLength?Math.min(i,r.maxLength):i;let f=e.length;if(f>h)throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${h}`);const g={type:"bos",value:"",output:r.prepend||""},m=[g],y=r.capture?"":"?:",b=n.isWindows(t),E=s.globChars(b),R=s.extglobChars(E),{DOT_LITERAL:A,PLUS_LITERAL:w,SLASH_LITERAL:C,ONE_CHAR:S,DOTS_SLASH:v,NO_DOT:T,NO_DOT_SLASH:O,NO_DOTS_SLASH:x,QMARK:_,QMARK_NO_DOT:k,STAR:L,START_ANCHOR:I}=E,P=e=>`(${y}(?:(?!${I}${e.dot?v:A}).)*?)`,$=r.dot?"":T,B=r.dot?_:k;let D=!0===r.bash?P(r):L;r.capture&&(D=`(${D})`),"boolean"==typeof r.noext&&(r.noextglob=r.noext);const M={input:e,index:-1,start:0,dot:!0===r.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:m};e=n.removePrefix(e,M),f=e.length;const F=[],H=[],G=[];let N,U=g;const j=()=>M.index===f-1,K=M.peek=(t=1)=>e[M.index+t],W=M.advance=()=>e[++M.index]||"",Y=()=>e.slice(M.index+1),z=(e="",t=0)=>{M.consumed+=e,M.index+=t},q=e=>{M.output+=null!=e.output?e.output:e.value,z(e.value)},V=()=>{let e=1;for(;"!"===K()&&("("!==K(2)||"?"===K(3));)W(),M.start++,e++;return e%2!=0&&(M.negated=!0,M.start++,!0)},Q=e=>{M[e]++,G.push(e)},X=e=>{M[e]--,G.pop()},Z=e=>{if("globstar"===U.type){const t=M.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||F.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(M.output=M.output.slice(0,-U.output.length),U.type="star",U.value="*",U.output=D,M.output+=U.output)}if(F.length&&"paren"!==e.type&&(F[F.length-1].inner+=e.value),(e.value||e.output)&&q(e),U&&"text"===U.type&&"text"===e.type)return U.value+=e.value,void(U.output=(U.output||"")+e.value);e.prev=U,m.push(e),U=e},J=(e,t)=>{const s={...R[t],conditions:1,inner:""};s.prev=U,s.parens=M.parens,s.output=M.output;const n=(r.capture?"(":"")+s.open;Q("parens"),Z({type:e,value:t,output:M.output?"":S}),Z({type:"paren",extglob:!0,value:W(),output:n}),F.push(s)},ee=e=>{let s,n=e.close+(r.capture?")":"");if("negate"===e.type){let i=D;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(i=P(r)),(i!==D||j()||/^\)+$/.test(Y()))&&(n=e.close=`)$))${i}`),e.inner.includes("*")&&(s=Y())&&/^\.[^\\/.]+$/.test(s)){const r=d(s,{...t,fastpaths:!1}).output;n=e.close=`)${r})${i})`}"bos"===e.prev.type&&(M.negatedExtglob=!0)}Z({type:"paren",extglob:!0,value:N,output:n}),X("parens")};if(!1!==r.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let s=!1,i=e.replace(l,((e,t,r,n,i,o)=>"\\"===n?(s=!0,e):"?"===n?t?t+n+(i?_.repeat(i.length):""):0===o?B+(i?_.repeat(i.length):""):_.repeat(r.length):"."===n?A.repeat(r.length):"*"===n?t?t+n+(i?D:""):D:t?e:`\\${e}`));return!0===s&&(i=!0===r.unescape?i.replace(/\\/g,""):i.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),i===e&&!0===r.contains?(M.output=e,M):(M.output=n.wrapOutput(i,M,t),M)}for(;!j();){if(N=W(),"\0"===N)continue;if("\\"===N){const e=K();if("/"===e&&!0!==r.bash)continue;if("."===e||";"===e)continue;if(!e){N+="\\",Z({type:"text",value:N});continue}const t=/^\\+/.exec(Y());let s=0;if(t&&t[0].length>2&&(s=t[0].length,M.index+=s,s%2!=0&&(N+="\\")),!0===r.unescape?N=W():N+=W(),0===M.brackets){Z({type:"text",value:N});continue}}if(M.brackets>0&&("]"!==N||"["===U.value||"[^"===U.value)){if(!1!==r.posix&&":"===N){const e=U.value.slice(1);if(e.includes("[")&&(U.posix=!0,e.includes(":"))){const e=U.value.lastIndexOf("["),t=U.value.slice(0,e),r=U.value.slice(e+2),s=o[r];if(s){U.value=t+s,M.backtrack=!0,W(),g.output||1!==m.indexOf(U)||(g.output=S);continue}}}("["===N&&":"!==K()||"-"===N&&"]"===K())&&(N=`\\${N}`),"]"!==N||"["!==U.value&&"[^"!==U.value||(N=`\\${N}`),!0===r.posix&&"!"===N&&"["===U.value&&(N="^"),U.value+=N,q({value:N});continue}if(1===M.quotes&&'"'!==N){N=n.escapeRegex(N),U.value+=N,q({value:N});continue}if('"'===N){M.quotes=1===M.quotes?0:1,!0===r.keepQuotes&&Z({type:"text",value:N});continue}if("("===N){Q("parens"),Z({type:"paren",value:N});continue}if(")"===N){if(0===M.parens&&!0===r.strictBrackets)throw new SyntaxError(p("opening","("));const e=F[F.length-1];if(e&&M.parens===e.parens+1){ee(F.pop());continue}Z({type:"paren",value:N,output:M.parens?")":"\\)"}),X("parens");continue}if("["===N){if(!0!==r.nobracket&&Y().includes("]"))Q("brackets");else{if(!0!==r.nobracket&&!0===r.strictBrackets)throw new SyntaxError(p("closing","]"));N=`\\${N}`}Z({type:"bracket",value:N});continue}if("]"===N){if(!0===r.nobracket||U&&"bracket"===U.type&&1===U.value.length){Z({type:"text",value:N,output:`\\${N}`});continue}if(0===M.brackets){if(!0===r.strictBrackets)throw new SyntaxError(p("opening","["));Z({type:"text",value:N,output:`\\${N}`});continue}X("brackets");const e=U.value.slice(1);if(!0===U.posix||"^"!==e[0]||e.includes("/")||(N=`/${N}`),U.value+=N,q({value:N}),!1===r.literalBrackets||n.hasRegexChars(e))continue;const t=n.escapeRegex(U.value);if(M.output=M.output.slice(0,-U.value.length),!0===r.literalBrackets){M.output+=t,U.value=t;continue}U.value=`(${y}${t}|${U.value})`,M.output+=U.value;continue}if("{"===N&&!0!==r.nobrace){Q("braces");const e={type:"brace",value:N,output:"(",outputIndex:M.output.length,tokensIndex:M.tokens.length};H.push(e),Z(e);continue}if("}"===N){const e=H[H.length-1];if(!0===r.nobrace||!e){Z({type:"text",value:N,output:N});continue}let t=")";if(!0===e.dots){const e=m.slice(),s=[];for(let t=e.length-1;t>=0&&(m.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&s.unshift(e[t].value);t=u(s,r),M.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const r=M.output.slice(0,e.outputIndex),s=M.tokens.slice(e.tokensIndex);e.value=e.output="\\{",N=t="\\}",M.output=r;for(const e of s)M.output+=e.output||e.value}Z({type:"brace",value:N,output:t}),X("braces"),H.pop();continue}if("|"===N){F.length>0&&F[F.length-1].conditions++,Z({type:"text",value:N});continue}if(","===N){let e=N;const t=H[H.length-1];t&&"braces"===G[G.length-1]&&(t.comma=!0,e="|"),Z({type:"comma",value:N,output:e});continue}if("/"===N){if("dot"===U.type&&M.index===M.start+1){M.start=M.index+1,M.consumed="",M.output="",m.pop(),U=g;continue}Z({type:"slash",value:N,output:C});continue}if("."===N){if(M.braces>0&&"dot"===U.type){"."===U.value&&(U.output=A);const e=H[H.length-1];U.type="dots",U.output+=N,U.value+=N,e.dots=!0;continue}if(M.braces+M.parens===0&&"bos"!==U.type&&"slash"!==U.type){Z({type:"text",value:N,output:A});continue}Z({type:"dot",value:N,output:A});continue}if("?"===N){if(!(U&&"("===U.value)&&!0!==r.noextglob&&"("===K()&&"?"!==K(2)){J("qmark",N);continue}if(U&&"paren"===U.type){const e=K();let t=N;if("<"===e&&!n.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===U.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(Y()))&&(t=`\\${N}`),Z({type:"text",value:N,output:t});continue}if(!0!==r.dot&&("slash"===U.type||"bos"===U.type)){Z({type:"qmark",value:N,output:k});continue}Z({type:"qmark",value:N,output:_});continue}if("!"===N){if(!0!==r.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){J("negate",N);continue}if(!0!==r.nonegate&&0===M.index){V();continue}}if("+"===N){if(!0!==r.noextglob&&"("===K()&&"?"!==K(2)){J("plus",N);continue}if(U&&"("===U.value||!1===r.regex){Z({type:"plus",value:N,output:w});continue}if(U&&("bracket"===U.type||"paren"===U.type||"brace"===U.type)||M.parens>0){Z({type:"plus",value:N});continue}Z({type:"plus",value:w});continue}if("@"===N){if(!0!==r.noextglob&&"("===K()&&"?"!==K(2)){Z({type:"at",extglob:!0,value:N,output:""});continue}Z({type:"text",value:N});continue}if("*"!==N){"$"!==N&&"^"!==N||(N=`\\${N}`);const e=a.exec(Y());e&&(N+=e[0],M.index+=e[0].length),Z({type:"text",value:N});continue}if(U&&("globstar"===U.type||!0===U.star)){U.type="star",U.star=!0,U.value+=N,U.output=D,M.backtrack=!0,M.globstar=!0,z(N);continue}let t=Y();if(!0!==r.noextglob&&/^\([^?]/.test(t)){J("star",N);continue}if("star"===U.type){if(!0===r.noglobstar){z(N);continue}const s=U.prev,n=s.prev,i="slash"===s.type||"bos"===s.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===r.bash&&(!i||t[0]&&"/"!==t[0])){Z({type:"star",value:N,output:""});continue}const a=M.braces>0&&("comma"===s.type||"brace"===s.type),l=F.length&&("pipe"===s.type||"paren"===s.type);if(!i&&"paren"!==s.type&&!a&&!l){Z({type:"star",value:N,output:""});continue}for(;"/**"===t.slice(0,3);){const r=e[M.index+4];if(r&&"/"!==r)break;t=t.slice(3),z("/**",3)}if("bos"===s.type&&j()){U.type="globstar",U.value+=N,U.output=P(r),M.output=U.output,M.globstar=!0,z(N);continue}if("slash"===s.type&&"bos"!==s.prev.type&&!o&&j()){M.output=M.output.slice(0,-(s.output+U.output).length),s.output=`(?:${s.output}`,U.type="globstar",U.output=P(r)+(r.strictSlashes?")":"|$)"),U.value+=N,M.globstar=!0,M.output+=s.output+U.output,z(N);continue}if("slash"===s.type&&"bos"!==s.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";M.output=M.output.slice(0,-(s.output+U.output).length),s.output=`(?:${s.output}`,U.type="globstar",U.output=`${P(r)}${C}|${C}${e})`,U.value+=N,M.output+=s.output+U.output,M.globstar=!0,z(N+W()),Z({type:"slash",value:"/",output:""});continue}if("bos"===s.type&&"/"===t[0]){U.type="globstar",U.value+=N,U.output=`(?:^|${C}|${P(r)}${C})`,M.output=U.output,M.globstar=!0,z(N+W()),Z({type:"slash",value:"/",output:""});continue}M.output=M.output.slice(0,-U.output.length),U.type="globstar",U.output=P(r),U.value+=N,M.output+=U.output,M.globstar=!0,z(N);continue}const s={type:"star",value:N,output:D};!0!==r.bash?!U||"bracket"!==U.type&&"paren"!==U.type||!0!==r.regex?(M.index!==M.start&&"slash"!==U.type&&"dot"!==U.type||("dot"===U.type?(M.output+=O,U.output+=O):!0===r.dot?(M.output+=x,U.output+=x):(M.output+=$,U.output+=$),"*"!==K()&&(M.output+=S,U.output+=S)),Z(s)):(s.output=N,Z(s)):(s.output=".*?","bos"!==U.type&&"slash"!==U.type||(s.output=$+s.output),Z(s))}for(;M.brackets>0;){if(!0===r.strictBrackets)throw new SyntaxError(p("closing","]"));M.output=n.escapeLast(M.output,"["),X("brackets")}for(;M.parens>0;){if(!0===r.strictBrackets)throw new SyntaxError(p("closing",")"));M.output=n.escapeLast(M.output,"("),X("parens")}for(;M.braces>0;){if(!0===r.strictBrackets)throw new SyntaxError(p("closing","}"));M.output=n.escapeLast(M.output,"{"),X("braces")}if(!0===r.strictSlashes||"star"!==U.type&&"bracket"!==U.type||Z({type:"maybe_slash",value:"",output:`${C}?`}),!0===M.backtrack){M.output="";for(const e of M.tokens)M.output+=null!=e.output?e.output:e.value,e.suffix&&(M.output+=e.suffix)}return M};d.fastpaths=(e,t)=>{const r={...t},o="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=e.length;if(a>o)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);e=c[e]||e;const l=n.isWindows(t),{DOT_LITERAL:u,SLASH_LITERAL:p,ONE_CHAR:d,DOTS_SLASH:h,NO_DOT:f,NO_DOTS:g,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:b}=s.globChars(l),E=r.dot?g:f,R=r.dot?m:f,A=r.capture?"":"?:";let w=!0===r.bash?".*?":y;r.capture&&(w=`(${w})`);const C=e=>!0===e.noglobstar?w:`(${A}(?:(?!${b}${e.dot?h:u}).)*?)`,S=e=>{switch(e){case"*":return`${E}${d}${w}`;case".*":return`${u}${d}${w}`;case"*.*":return`${E}${w}${u}${d}${w}`;case"*/*":return`${E}${w}${p}${d}${R}${w}`;case"**":return E+C(r);case"**/*":return`(?:${E}${C(r)}${p})?${R}${d}${w}`;case"**/*.*":return`(?:${E}${C(r)}${p})?${R}${w}${u}${d}${w}`;case"**/.*":return`(?:${E}${C(r)}${p})?${u}${d}${w}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=S(t[1]);if(!r)return;return r+u+t[2]}}},v=n.removePrefix(e,{negated:!1,prefix:""});let T=S(v);return T&&!0!==r.strictSlashes&&(T+=`${p}?`),T},e.exports=d},2595:(e,t,r)=>{const s=r(1017),n=r(4933),i=r(2902),o=r(3338),a=r(7411),l=(e,t,r=!1)=>{if(Array.isArray(e)){const s=e.map((e=>l(e,t,r))),n=e=>{for(const t of s){const r=t(e);if(r)return r}return!1};return n}const s=(n=e)&&"object"==typeof n&&!Array.isArray(n)&&e.tokens&&e.input;var n;if(""===e||"string"!=typeof e&&!s)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},a=o.isWindows(t),c=s?l.compileRe(e,t):l.makeRe(e,t,!1,!0),u=c.state;delete c.state;let p=()=>!1;if(i.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};p=l(i.ignore,e,r)}const d=(r,s=!1)=>{const{isMatch:n,match:o,output:d}=l.test(r,c,t,{glob:e,posix:a}),h={glob:e,state:u,regex:c,posix:a,input:r,output:d,match:o,isMatch:n};return"function"==typeof i.onResult&&i.onResult(h),!1===n?(h.isMatch=!1,!!s&&h):p(r)?("function"==typeof i.onIgnore&&i.onIgnore(h),h.isMatch=!1,!!s&&h):("function"==typeof i.onMatch&&i.onMatch(h),!s||h)};return r&&(d.state=u),d};l.test=(e,t,r,{glob:s,posix:n}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const i=r||{},a=i.format||(n?o.toPosixSlashes:null);let c=e===s,u=c&&a?a(e):e;return!1===c&&(u=a?a(e):e,c=u===s),!1!==c&&!0!==i.capture||(c=!0===i.matchBase||!0===i.basename?l.matchBase(e,t,r,n):t.exec(u)),{isMatch:Boolean(c),match:c,output:u}},l.matchBase=(e,t,r,n=o.isWindows(r))=>(t instanceof RegExp?t:l.makeRe(t,r)).test(s.basename(e)),l.isMatch=(e,t,r)=>l(t,r)(e),l.parse=(e,t)=>Array.isArray(e)?e.map((e=>l.parse(e,t))):i(e,{...t,fastpaths:!1}),l.scan=(e,t)=>n(e,t),l.compileRe=(e,t,r=!1,s=!1)=>{if(!0===r)return e.output;const n=t||{},i=n.contains?"":"^",o=n.contains?"":"$";let a=`${i}(?:${e.output})${o}`;e&&!0===e.negated&&(a=`^(?!${a}).*$`);const c=l.toRegex(a,t);return!0===s&&(c.state=e),c},l.makeRe=(e,t={},r=!1,s=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(n.output=i.fastpaths(e,t)),n.output||(n=i(e,t)),l.compileRe(n,t,r,s)},l.toRegex=(e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},l.constants=a,e.exports=l},4933:(e,t,r)=>{const s=r(3338),{CHAR_ASTERISK:n,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:l,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:u,CHAR_LEFT_CURLY_BRACE:p,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:f,CHAR_QUESTION_MARK:g,CHAR_RIGHT_CURLY_BRACE:m,CHAR_RIGHT_PARENTHESES:y,CHAR_RIGHT_SQUARE_BRACKET:b}=r(7411),E=e=>e===u||e===o,R=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};e.exports=(e,t)=>{const r=t||{},A=e.length-1,w=!0===r.parts||!0===r.scanToEnd,C=[],S=[],v=[];let T,O,x=e,_=-1,k=0,L=0,I=!1,P=!1,$=!1,B=!1,D=!1,M=!1,F=!1,H=!1,G=!1,N=!1,U=0,j={value:"",depth:0,isGlob:!1};const K=()=>_>=A,W=()=>(T=O,x.charCodeAt(++_));for(;_<A;){let e;if(O=W(),O!==o){if(!0===M||O===p){for(U++;!0!==K()&&(O=W());)if(O!==o)if(O!==p){if(!0!==M&&O===l&&(O=W())===l){if(I=j.isBrace=!0,$=j.isGlob=!0,N=!0,!0===w)continue;break}if(!0!==M&&O===a){if(I=j.isBrace=!0,$=j.isGlob=!0,N=!0,!0===w)continue;break}if(O===m&&(U--,0===U)){M=!1,I=j.isBrace=!0,N=!0;break}}else U++;else F=j.backslashes=!0,W();if(!0===w)continue;break}if(O!==u){if(!0!==r.noext){if(!0===(O===f||O===i||O===n||O===g||O===c)&&x.charCodeAt(_+1)===d){if($=j.isGlob=!0,B=j.isExtglob=!0,N=!0,O===c&&_===k&&(G=!0),!0===w){for(;!0!==K()&&(O=W());)if(O!==o){if(O===y){$=j.isGlob=!0,N=!0;break}}else F=j.backslashes=!0,O=W();continue}break}}if(O===n){if(T===n&&(D=j.isGlobstar=!0),$=j.isGlob=!0,N=!0,!0===w)continue;break}if(O===g){if($=j.isGlob=!0,N=!0,!0===w)continue;break}if(O===h){for(;!0!==K()&&(e=W());)if(e!==o){if(e===b){P=j.isBracket=!0,$=j.isGlob=!0,N=!0;break}}else F=j.backslashes=!0,W();if(!0===w)continue;break}if(!0===r.nonegate||O!==c||_!==k){if(!0!==r.noparen&&O===d){if($=j.isGlob=!0,!0===w){for(;!0!==K()&&(O=W());)if(O!==d){if(O===y){N=!0;break}}else F=j.backslashes=!0,O=W();continue}break}if(!0===$){if(N=!0,!0===w)continue;break}}else H=j.negated=!0,k++}else{if(C.push(_),S.push(j),j={value:"",depth:0,isGlob:!1},!0===N)continue;if(T===l&&_===k+1){k+=2;continue}L=_+1}}else F=j.backslashes=!0,O=W(),O===p&&(M=!0)}!0===r.noext&&(B=!1,$=!1);let Y=x,z="",q="";k>0&&(z=x.slice(0,k),x=x.slice(k),L-=k),Y&&!0===$&&L>0?(Y=x.slice(0,L),q=x.slice(L)):!0===$?(Y="",q=x):Y=x,Y&&""!==Y&&"/"!==Y&&Y!==x&&E(Y.charCodeAt(Y.length-1))&&(Y=Y.slice(0,-1)),!0===r.unescape&&(q&&(q=s.removeBackslashes(q)),Y&&!0===F&&(Y=s.removeBackslashes(Y)));const V={prefix:z,input:e,start:k,base:Y,glob:q,isBrace:I,isBracket:P,isGlob:$,isExtglob:B,isGlobstar:D,negated:H,negatedExtglob:G};if(!0===r.tokens&&(V.maxDepth=0,E(O)||S.push(j),V.tokens=S),!0===r.parts||!0===r.tokens){let t;for(let s=0;s<C.length;s++){const n=t?t+1:k,i=C[s],o=e.slice(n,i);r.tokens&&(0===s&&0!==k?(S[s].isPrefix=!0,S[s].value=z):S[s].value=o,R(S[s]),V.maxDepth+=S[s].depth),0===s&&""===o||v.push(o),t=i}if(t&&t+1<e.length){const s=e.slice(t+1);v.push(s),r.tokens&&(S[S.length-1].value=s,R(S[S.length-1]),V.maxDepth+=S[S.length-1].depth)}V.slashes=C,V.parts=v}return V}},3338:(e,t,r)=>{const s=r(1017),n="win32"===process.platform,{REGEX_BACKSLASH:i,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:l}=r(7411);t.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),t.hasRegexChars=e=>a.test(e),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=e=>e.replace(l,"\\$1"),t.toPosixSlashes=e=>e.replace(i,"/"),t.removeBackslashes=e=>e.replace(o,(e=>"\\"===e?"":e)),t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},t.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===s.sep,t.escapeLast=(e,r,s)=>{const n=e.lastIndexOf(r,s);return-1===n?e:"\\"===e[n-1]?t.escapeLast(e,r,n-1):`${e.slice(0,n)}\\${e.slice(n)}`},t.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},t.wrapOutput=(e,t={},r={})=>{let s=`${r.contains?"":"^"}(?:${e})${r.contains?"":"$"}`;return!0===t.negated&&(s=`(?:^(?!${s}).*$)`),s}},5417:(e,t,r)=>{String.prototype.startsWith||(String.prototype.startsWith=function(e){return this.substring(0,e.length)===e});var s=r(3978);e.exports=function(e,t,r){var n,i,o;if("function"==typeof t&&(r=t,t=void 0),"function"!=typeof r)return n=s,i=e,o=t,new Promise((function(e,t){n(i,o,(function(r,s){if(r)return t(r);e(s)}))}));s(e,t,r)}},5217:(e,t,r)=>{var s=r(2081).spawn;e.exports=function(e,t,r,n){"function"==typeof r&&(n=r,r=void 0);var i=!1,o=s(e,t,r),a="",l="";o.stdout.on("data",(function(e){a+=e.toString()})),o.stderr.on("data",(function(e){l+=e.toString()})),o.on("error",(function(e){i||(i=!0,n(new Error(e)))})),o.on("close",(function(e){if(!i){if(i=!0,l=function(e){if(e)return(e=(e=e.trim()).replace(/your \d+x\d+ screen size is bogus\. expect trouble/gi,"")).trim()}(l))return n(new Error(l));n(null,a,e)}}))}},8594:(e,t,r)=>{var s=r(2037),n={ps:()=>r(1694),wmic:()=>r(4010)},i=s.platform();i.startsWith("win")&&(i="win");var o={darwin:"ps",sunos:"ps",freebsd:"ps",netbsd:"ps",win:"wmic",linux:"ps",aix:"ps"}[i];e.exports=function(e){void 0===o&&e(new Error(s.platform()+" is not supported yet, please open an issue (https://github.com/simonepri/pidtree)")),n[o]()(e)}},3978:(e,t,r)=>{var s=r(8594);e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),"object"!=typeof t&&(t={}),e=parseInt(e,10),isNaN(e)||e<-1?r(new TypeError("The pid provided is invalid")):s((function(s,n){if(s)r(s);else if(-1!==e){for(var i,o=0;o<n.length;o++){if(n[o][1]===e){i=t.advanced?{ppid:n[o][0],pid:e}:e;break}n[o][0]===e&&(i=t.advanced?{pid:e}:e)}if(i){for(var a={};n.length>0;){var l=n.pop();a[l[0]]?a[l[0]].push(l[1]):a[l[0]]=[l[1]]}for(var c=0,u=[i];c<u.length;){var p=t.advanced?u[c++].pid:u[c++];if(a[p]){for(var d=a[p].length,h=0;h<d;h++)u.push(t.advanced?{ppid:p,pid:a[p][h]}:a[p][h]);delete a[p]}}t.root||u.shift(),r(null,u)}else r(new Error("No matching pid found"))}else{for(var f=0;f<n.length;f++)n[f]=t.advanced?{ppid:n[f][0],pid:n[f][1]}:n[f]=n[f][1];r(null,n)}}))}},1694:(e,t,r)=>{var s=r(2037),n=r(5217);e.exports=function(e){n("ps",["-A","-o","ppid,pid"],(function(t,r,n){if(t)return e(t);if(0!==n)return e(new Error("pidtree ps command exited with code "+n));try{r=r.split(s.EOL);for(var i=[],o=1;o<r.length;o++)r[o]=r[o].trim(),r[o]&&(r[o]=r[o].split(/\s+/),r[o][0]=parseInt(r[o][0],10),r[o][1]=parseInt(r[o][1],10),i.push(r[o]));e(null,i)}catch(t){e(t)}}))}},4010:(e,t,r)=>{var s=r(2037),n=r(5217);e.exports=function(e){n("wmic",["PROCESS","get","ParentProcessId,ProcessId"],{windowsHide:!0,windowsVerbatimArguments:!0},(function(t,r,n){if(t)e(t);else if(0===n)try{r=r.split(s.EOL);for(var i=[],o=1;o<r.length;o++)r[o]=r[o].trim(),r[o]&&(r[o]=r[o].split(/\s+/),r[o][0]=parseInt(r[o][0],10),r[o][1]=parseInt(r[o][1],10),i.push(r[o]));e(null,i)}catch(t){e(t)}else e(new Error("pidtree wmic command exited with code "+n))}))}},7152:e=>{function t(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}e.exports=function(e){return(e=e||{}).circles?function(e){var r=[],s=[];return e.proto?function e(i){if("object"!=typeof i||null===i)return i;if(i instanceof Date)return new Date(i);if(Array.isArray(i))return n(i,e);if(i instanceof Map)return new Map(n(Array.from(i),e));if(i instanceof Set)return new Set(n(Array.from(i),e));var o={};for(var a in r.push(i),s.push(o),i){var l=i[a];if("object"!=typeof l||null===l)o[a]=l;else if(l instanceof Date)o[a]=new Date(l);else if(l instanceof Map)o[a]=new Map(n(Array.from(l),e));else if(l instanceof Set)o[a]=new Set(n(Array.from(l),e));else if(ArrayBuffer.isView(l))o[a]=t(l);else{var c=r.indexOf(l);o[a]=-1!==c?s[c]:e(l)}}return r.pop(),s.pop(),o}:function e(i){if("object"!=typeof i||null===i)return i;if(i instanceof Date)return new Date(i);if(Array.isArray(i))return n(i,e);if(i instanceof Map)return new Map(n(Array.from(i),e));if(i instanceof Set)return new Set(n(Array.from(i),e));var o={};for(var a in r.push(i),s.push(o),i)if(!1!==Object.hasOwnProperty.call(i,a)){var l=i[a];if("object"!=typeof l||null===l)o[a]=l;else if(l instanceof Date)o[a]=new Date(l);else if(l instanceof Map)o[a]=new Map(n(Array.from(l),e));else if(l instanceof Set)o[a]=new Set(n(Array.from(l),e));else if(ArrayBuffer.isView(l))o[a]=t(l);else{var c=r.indexOf(l);o[a]=-1!==c?s[c]:e(l)}}return r.pop(),s.pop(),o};function n(e,n){for(var i=Object.keys(e),o=new Array(i.length),a=0;a<i.length;a++){var l=i[a],c=e[l];if("object"!=typeof c||null===c)o[l]=c;else if(c instanceof Date)o[l]=new Date(c);else if(ArrayBuffer.isView(c))o[l]=t(c);else{var u=r.indexOf(c);o[l]=-1!==u?s[u]:n(c)}}return o}}(e):e.proto?function e(s){if("object"!=typeof s||null===s)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return r(s,e);if(s instanceof Map)return new Map(r(Array.from(s),e));if(s instanceof Set)return new Set(r(Array.from(s),e));var n={};for(var i in s){var o=s[i];"object"!=typeof o||null===o?n[i]=o:o instanceof Date?n[i]=new Date(o):o instanceof Map?n[i]=new Map(r(Array.from(o),e)):o instanceof Set?n[i]=new Set(r(Array.from(o),e)):ArrayBuffer.isView(o)?n[i]=t(o):n[i]=e(o)}return n}:function e(s){if("object"!=typeof s||null===s)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return r(s,e);if(s instanceof Map)return new Map(r(Array.from(s),e));if(s instanceof Set)return new Set(r(Array.from(s),e));var n={};for(var i in s)if(!1!==Object.hasOwnProperty.call(s,i)){var o=s[i];"object"!=typeof o||null===o?n[i]=o:o instanceof Date?n[i]=new Date(o):o instanceof Map?n[i]=new Map(r(Array.from(o),e)):o instanceof Set?n[i]=new Set(r(Array.from(o),e)):ArrayBuffer.isView(o)?n[i]=t(o):n[i]=e(o)}return n};function r(e,r){for(var s=Object.keys(e),n=new Array(s.length),i=0;i<s.length;i++){var o=s[i],a=e[o];"object"!=typeof a||null===a?n[o]=a:a instanceof Date?n[o]=new Date(a):ArrayBuffer.isView(a)?n[o]=t(a):n[o]=r(a)}return n}}},7013:(e,t,r)=>{const s=r(2037),n=r(8137),i=process.env;let o;function a(e){const t=function(e){if(!1===o)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(e&&!e.isTTY&&!0!==o)return 0;const t=o?1:0;if("win32"===process.platform){const e=s.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in i)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in i))||"codeship"===i.CI_NAME?1:t;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if("truecolor"===i.COLORTERM)return 3;if("TERM_PROGRAM"in i){const e=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:(i.TERM,t)}(e);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(t)}n("no-color")||n("no-colors")||n("color=false")?o=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(o=!0),"FORCE_COLOR"in i&&(o=0===i.FORCE_COLOR.length||0!==parseInt(i.FORCE_COLOR,10)),e.exports={supportsColor:a,stdout:a(process.stdout),stderr:a(process.stderr)}},1914:(e,t,r)=>{const s=r(1346),n=(e,t,r)=>{if(!1===s(e))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===t||e===t)return String(e);if(!1===s(t))throw new TypeError("toRegexRange: expected the second argument to be a number.");let i={relaxZeros:!0,...r};"boolean"==typeof i.strictZeros&&(i.relaxZeros=!1===i.strictZeros);let l=e+":"+t+"="+String(i.relaxZeros)+String(i.shorthand)+String(i.capture)+String(i.wrap);if(n.cache.hasOwnProperty(l))return n.cache[l].result;let c=Math.min(e,t),u=Math.max(e,t);if(1===Math.abs(c-u)){let r=e+"|"+t;return i.capture?`(${r})`:!1===i.wrap?r:`(?:${r})`}let p=f(e)||f(t),d={min:e,max:t,a:c,b:u},h=[],g=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),c<0){g=o(u<0?Math.abs(u):1,Math.abs(c),d,i),c=d.a=0}return u>=0&&(h=o(c,u,d,i)),d.negatives=g,d.positives=h,d.result=function(e,t,r){let s=a(e,t,"-",!1,r)||[],n=a(t,e,"",!1,r)||[],i=a(e,t,"-?",!0,r)||[];return s.concat(i).concat(n).join("|")}(g,h,i),!0===i.capture?d.result=`(${d.result})`:!1!==i.wrap&&h.length+g.length>1&&(d.result=`(?:${d.result})`),n.cache[l]=d,d.result};function i(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let s=function(e,t){let r=[];for(let s=0;s<e.length;s++)r.push([e[s],t[s]]);return r}(e,t),n=s.length,i="",o=0;for(let e=0;e<n;e++){let[t,n]=s[e];t===n?i+=t:"0"!==t||"9"!==n?i+=h(t,n,r):o++}return o&&(i+=!0===r.shorthand?"\\d":"[0-9]"),{pattern:i,count:[o],digits:n}}function o(e,t,r,s){let n,o=function(e,t){let r=1,s=1,n=u(e,r),i=new Set([t]);for(;e<=n&&n<=t;)i.add(n),r+=1,n=u(e,r);for(n=p(t+1,s)-1;e<n&&n<=t;)i.add(n),s+=1,n=p(t+1,s)-1;return i=[...i],i.sort(l),i}(e,t),a=[],c=e;for(let e=0;e<o.length;e++){let t=o[e],l=i(String(c),String(t),s),u="";r.isPadded||!n||n.pattern!==l.pattern?(r.isPadded&&(u=g(t,r,s)),l.string=u+l.pattern+d(l.count),a.push(l),c=t+1,n=l):(n.count.length>1&&n.count.pop(),n.count.push(l.count[0]),n.string=n.pattern+d(n.count),c=t+1)}return a}function a(e,t,r,s,n){let i=[];for(let n of e){let{string:e}=n;s||c(t,"string",e)||i.push(r+e),s&&c(t,"string",e)&&i.push(r+e)}return i}function l(e,t){return e>t?1:t>e?-1:0}function c(e,t,r){return e.some((e=>e[t]===r))}function u(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function p(e,t){return e-e%Math.pow(10,t)}function d(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function h(e,t,r){return`[${e}${t-e==1?"":"-"}${t}]`}function f(e){return/^-?(0+)\d/.test(e)}function g(e,t,r){if(!t.isPadded)return e;let s=Math.abs(t.maxLen-String(e).length),n=!1!==r.relaxZeros;switch(s){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${s}}`:`0{${s}}`}}n.cache={},n.clearCache=()=>n.cache={},e.exports=n},9214:(e,t,r)=>{r.d(t,{default:()=>wi});var s=r(445),n=r(7261);const i=(e=0)=>t=>`\x1b[${t+e}m`,o=(e=0)=>t=>`\x1b[${38+e};5;${t}m`,a=(e=0)=>(t,r,s)=>`\x1b[${38+e};2;${t};${r};${s}m`,l={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(l.modifier),Object.keys(l.color),Object.keys(l.bgColor);const c=function(){const e=new Map;for(const[t,r]of Object.entries(l)){for(const[t,s]of Object.entries(r))l[t]={open:`\x1b[${s[0]}m`,close:`\x1b[${s[1]}m`},r[t]=l[t],e.set(s[0],s[1]);Object.defineProperty(l,t,{value:r,enumerable:!1})}return Object.defineProperty(l,"codes",{value:e,enumerable:!1}),l.color.close="\x1b[39m",l.bgColor.close="\x1b[49m",l.color.ansi=i(),l.color.ansi256=o(),l.color.ansi16m=a(),l.bgColor.ansi=i(10),l.bgColor.ansi256=o(10),l.bgColor.ansi16m=a(10),Object.defineProperties(l,{rgbToAnsi256:{value:(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;3===r.length&&(r=[...r].map((e=>e+e)).join(""));const s=Number.parseInt(r,16);return[s>>16&255,s>>8&255,255&s]},enumerable:!1},hexToAnsi256:{value:e=>l.rgbToAnsi256(...l.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,r,s;if(e>=232)t=(10*(e-232)+8)/255,r=t,s=t;else{const n=(e-=16)%36;t=Math.floor(e/36)/5,r=Math.floor(n/6)/5,s=n%6/5}const n=2*Math.max(t,r,s);if(0===n)return 30;let i=30+(Math.round(s)<<2|Math.round(r)<<1|Math.round(t));return 2===n&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>l.ansi256ToAnsi(l.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>l.ansi256ToAnsi(l.hexToAnsi256(e)),enumerable:!1}}),l}(),u=c;var p=r(7742),d=r(612),h=r(5997);function f(e,t=(globalThis.Deno?globalThis.Deno.args:p.argv)){const r=e.startsWith("-")?"":1===e.length?"-":"--",s=t.indexOf(r+e),n=t.indexOf("--");return-1!==s&&(-1===n||s<n)}const{env:g}=p;let m;function y(e,{streamIsTTY:t,sniffFlags:r=!0}={}){const s=function(){if("FORCE_COLOR"in g)return"true"===g.FORCE_COLOR?1:"false"===g.FORCE_COLOR?0:0===g.FORCE_COLOR.length?1:Math.min(Number.parseInt(g.FORCE_COLOR,10),3)}();void 0!==s&&(m=s);const n=r?m:s;if(0===n)return 0;if(r){if(f("color=16m")||f("color=full")||f("color=truecolor"))return 3;if(f("color=256"))return 2}if("TF_BUILD"in g&&"AGENT_NAME"in g)return 1;if(e&&!t&&void 0===n)return 0;const i=n||0;if("dumb"===g.TERM)return i;if("win32"===p.platform){const e=d.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in g)return"GITHUB_ACTIONS"in g||"GITEA_ACTIONS"in g?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((e=>e in g))||"codeship"===g.CI_NAME?1:i;if("TEAMCITY_VERSION"in g)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(g.TEAMCITY_VERSION)?1:0;if("truecolor"===g.COLORTERM)return 3;if("xterm-kitty"===g.TERM)return 3;if("TERM_PROGRAM"in g){const e=Number.parseInt((g.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(g.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(g.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(g.TERM)||"COLORTERM"in g?1:i}function b(e,t={}){return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(y(e,{streamIsTTY:e&&e.isTTY,...t}))}f("no-color")||f("no-colors")||f("color=false")||f("color=never")?m=0:(f("color")||f("colors")||f("color=true")||f("color=always"))&&(m=1);const E={stdout:b({isTTY:h.isatty(1)}),stderr:b({isTTY:h.isatty(2)})};function R(e,t,r){let s=e.indexOf(t);if(-1===s)return e;const n=t.length;let i=0,o="";do{o+=e.slice(i,s)+t+r,i=s+n,s=e.indexOf(t,i)}while(-1!==s);return o+=e.slice(i),o}const{stdout:A,stderr:w}=E,C=Symbol("GENERATOR"),S=Symbol("STYLER"),v=Symbol("IS_EMPTY"),T=["ansi","ansi","ansi256","ansi16m"],O=Object.create(null);const x=e=>{const t=(...e)=>e.join(" ");return((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 r=A?A.level:0;e.level=void 0===t.level?r:t.level})(t,e),Object.setPrototypeOf(t,_.prototype),t};function _(e){return x(e)}Object.setPrototypeOf(_.prototype,Function.prototype);for(const[e,t]of Object.entries(u))O[e]={get(){const r=$(this,P(t.open,t.close,this[S]),this[v]);return Object.defineProperty(this,e,{value:r}),r}};O.visible={get(){const e=$(this,this[S],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const k=(e,t,r,...s)=>"rgb"===e?"ansi16m"===t?u[r].ansi16m(...s):"ansi256"===t?u[r].ansi256(u.rgbToAnsi256(...s)):u[r].ansi(u.rgbToAnsi(...s)):"hex"===e?k("rgb",t,r,...u.hexToRgb(...s)):u[r][e](...s),L=["rgb","hex","ansi256"];for(const e of L){O[e]={get(){const{level:t}=this;return function(...r){const s=P(k(e,T[t],"color",...r),u.color.close,this[S]);return $(this,s,this[v])}}};O["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const{level:t}=this;return function(...r){const s=P(k(e,T[t],"bgColor",...r),u.bgColor.close,this[S]);return $(this,s,this[v])}}}}const I=Object.defineProperties((()=>{}),{...O,level:{enumerable:!0,get(){return this[C].level},set(e){this[C].level=e}}}),P=(e,t,r)=>{let s,n;return void 0===r?(s=e,n=t):(s=r.openAll+e,n=t+r.closeAll),{open:e,close:t,openAll:s,closeAll:n,parent:r}},$=(e,t,r)=>{const s=(...e)=>B(s,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(s,I),s[C]=e,s[S]=t,s[v]=r,s},B=(e,t)=>{if(e.level<=0||!t)return e[v]?"":t;let r=e[S];if(void 0===r)return t;const{openAll:s,closeAll:n}=r;if(t.includes("\x1b"))for(;void 0!==r;)t=R(t,r.close,r.open),r=r.parent;const i=t.indexOf("\n");return-1!==i&&(t=function(e,t,r,s){let n=0,i="";do{const o="\r"===e[s-1];i+=e.slice(n,o?s-1:s)+t+(o?"\r\n":"\n")+r,n=s+1,s=e.indexOf("\n",n)}while(-1!==s);return i+=e.slice(n),i}(t,n,s,i)),s+t+n};Object.defineProperties(_.prototype,O);const D=_(),M=(_({level:w?w.level:0}),D);const F=r(161);var H=r(6224),G=r.t(H,2);const{env:N={},argv:U=[],platform:j=""}="undefined"==typeof process?{}:process,K="NO_COLOR"in N||U.includes("--no-color"),W="FORCE_COLOR"in N||U.includes("--color"),Y="win32"===j,z="dumb"===N.TERM,q=G&&H.isatty&&H.isatty(1)&&N.TERM&&!z,V=!K&&(W||Y&&!z||q||"CI"in N&&("GITHUB_ACTIONS"in N||"GITLAB_CI"in N||"CIRCLECI"in N)),Q=(e,t,r,s,n=t.substring(0,e)+s,i=t.substring(e+r.length),o=i.indexOf(r))=>n+(o<0?i:Q(o,i,r,s)),X=(e,t,r=e,s=e.length+1)=>n=>n||""!==n&&void 0!==n?((e,t,r,s,n)=>e<0?r+t+s:r+Q(e,t,s,n)+s)((""+n).indexOf(t,s),n,e,t,r):"",Z=(e,t,r)=>X(`\x1b[${e}m`,`\x1b[${t}m`,r),J={reset:Z(0,0),bold:Z(1,22,"\x1b[22m\x1b[1m"),dim:Z(2,22,"\x1b[22m\x1b[2m"),italic:Z(3,23),underline:Z(4,24),inverse:Z(7,27),hidden:Z(8,28),strikethrough:Z(9,29),black:Z(30,39),red:Z(31,39),green:Z(32,39),yellow:Z(33,39),blue:Z(34,39),magenta:Z(35,39),cyan:Z(36,39),white:Z(37,39),gray:Z(90,39),bgBlack:Z(40,49),bgRed:Z(41,49),bgGreen:Z(42,49),bgYellow:Z(43,49),bgBlue:Z(44,49),bgMagenta:Z(45,49),bgCyan:Z(46,49),bgWhite:Z(47,49),blackBright:Z(90,39),redBright:Z(91,39),greenBright:Z(92,39),yellowBright:Z(93,39),blueBright:Z(94,39),magentaBright:Z(95,39),cyanBright:Z(96,39),whiteBright:Z(97,39),bgBlackBright:Z(100,49),bgRedBright:Z(101,49),bgGreenBright:Z(102,49),bgYellowBright:Z(103,49),bgBlueBright:Z(104,49),bgMagentaBright:Z(105,49),bgCyanBright:Z(106,49),bgWhiteBright:Z(107,49)},ee=({useColor:e=V}={})=>e?J:Object.keys(J).reduce(((e,t)=>({...e,[t]:String})),{}),{reset:te,bold:re,dim:se,italic:ne,underline:ie,inverse:oe,hidden:ae,strikethrough:le,black:ce,red:ue,green:pe,yellow:de,blue:he,magenta:fe,cyan:ge,white:me,gray:ye,bgBlack:be,bgRed:Ee,bgGreen:Re,bgYellow:Ae,bgBlue:we,bgMagenta:Ce,bgCyan:Se,bgWhite:ve,blackBright:Te,redBright:Oe,greenBright:xe,yellowBright:_e,blueBright:ke,magentaBright:Le,cyanBright:Ie,whiteBright:Pe,bgBlackBright:$e,bgRedBright:Be,bgGreenBright:De,bgYellowBright:Me,bgBlueBright:Fe,bgMagentaBright:He,bgCyanBright:Ge,bgWhiteBright:Ne}=ee();var Ue=r(3837),je=r(2037),Ke=r(1576),We=r(2781),Ye=r(7152),ze=r(6113),qe=Object.defineProperty,Ve=(e,t)=>qe(e,"name",{value:t,configurable:!0}),Qe={CURSOR_HIDE:"\x1b[?25l",CURSOR_SHOW:"\x1b[?25h"},Xe=(e=>(e.WAITING="WAITING",e.STARTED="STARTED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.SKIPPED="SKIPPED",e.ROLLING_BACK="ROLLING_BACK",e.ROLLED_BACK="ROLLED_BACK",e.RETRY="RETRY",e.PAUSED="PAUSED",e.PROMPT="PROMPT",e.PROMPT_COMPLETED="PROMPT_COMPLETED",e))(Xe||{}),Ze=class{constructor(){this.emitter=new F}emit(e,t){this.emitter.emit(e,t)}on(e,t){this.emitter.addListener(e,t)}once(e,t){this.emitter.once(e,t)}off(e,t){this.emitter.off(e,t)}complete(){this.emitter.removeAllListeners()}};Ve(Ze,"EventManager");var Je=Ze,et=class{};Ve(et,"BaseEventMap");function tt(e){return!!e&&"function"==typeof e.lift&&"function"==typeof e.subscribe}function rt(){return!!process.env.LISTR_FORCE_UNICODE||"win32"!==process.platform||!!process.env.CI||!!process.env.WT_SESSION||"vscode"===process.env.TERM_PROGRAM||"xterm-256color"===process.env.TERM||"alacritty"===process.env.TERM}Ve(tt,"isObservable"),Ve(rt,"isUnicodeSupported");var st=/\u0007/;function nt(e){return String(e).replace(new RegExp("(?:\\u001b|\\u009b)\\[[\\=><~/#&.:=?%@~_-]*[0-9]*[\\a-ln-tqyz=><~/#&.:=?%@~_-]+","gmi"),"").replace(new RegExp(st,"gmi"),"").trim()}Ve(nt,"cleanseAnsi");var it=ee({useColor:!process.env.LISTR_DISABLE_COLOR});function ot(e,t){return e.replace(/^(?!\s*$)/gm," ".repeat(t))}Ve(ot,"indent");var at={warning:"\u26a0",cross:"\u2716",arrowDown:"\u2193",tick:"\u2714",arrowRight:"\u2192",pointer:"\u276f",checkboxOn:"\u2612",arrowLeft:"\u2190",squareSmallFilled:"\u25fc",pointerSmall:"\u203a"},lt={...at,warning:"\u203c",cross:"\xd7",tick:"\u221a",pointer:">",checkboxOn:"[\xd7]",squareSmallFilled:"\u25a0"},ct=rt()?at:lt;function ut(e,...t){return(0,Ue.format)(String(e),...t)}Ve(ut,"splat");var pt={STARTED:ct.pointer,FAILED:ct.cross,SKIPPED:ct.arrowDown,COMPLETED:ct.tick,OUTPUT:ct.pointerSmall,TITLE:ct.arrowRight,RETRY:ct.warning,ROLLBACK:ct.arrowLeft,PAUSED:ct.squareSmallFilled},dt={STARTED:it.yellow,FAILED:it.red,SKIPPED:it.yellow,COMPLETED:it.green,RETRY:it.yellowBright,ROLLBACK:it.redBright,PAUSED:it.yellowBright},ht=["RETRY","ROLLBACK","FAILED"],ft=class{constructor(e){this.options=e,this.options={useIcons:!0,toStderr:[],...e??{}},this.options.fields??={},this.options.fields.prefix??=[],this.options.fields.suffix??=[],this.process=this.options.processOutput??new At}log(e,t,r){const s=this.format(e,t,r);this.options.toStderr.includes(e)?this.process.toStderr(s):this.process.toStdout(s)}toStdout(e,t,r=!0){this.process.toStdout(this.format(null,e,t),r)}toStderr(e,t,r=!0){this.process.toStderr(this.format(null,e,t),r)}wrap(e,t){return e?this.applyFormat(`[${e}]`,t):e}splat(...e){const t=e.shift()??"";return 0===e.length?t:ut(t,e)}suffix(e,...t){return t.filter(Boolean).forEach((t=>{if(e+=this.spacing(e),"string"==typeof t)e+=this.wrap(t);else if("object"==typeof t){if(t.args??=[],"function"==typeof t.condition?!t.condition(...t.args):!(t.condition??1))return e;e+=this.wrap("function"==typeof t.field?t.field(...t.args):t.field,{format:t?.format(...t.args)})}})),e}prefix(e,...t){return t.filter(Boolean).forEach((t=>{if(e=this.spacing(e)+e,"string"==typeof t)e=this.wrap(t)+e;else if("object"==typeof t){if(t.args??=[],"function"==typeof t.condition?!t.condition(...t.args):!(t.condition??1))return e;e=this.wrap("function"==typeof t.field?t.field(...t.args):t.field,{format:t?.format()})+e}})),e}fields(e,t){return this.options?.fields?.prefix&&(e=this.prefix(e,...this.options.fields.prefix)),t?.prefix&&(e=this.prefix(e,...t.prefix)),t?.suffix&&(e=this.suffix(e,...t.suffix)),this.options?.fields?.suffix&&(e=this.suffix(e,...this.options.fields.suffix)),e}icon(e,t){if(!e)return null;t||=this.options.icon?.[e];const r=this.options.color?.[e];return t&&r&&(t=r(t)),t}format(e,t,r){return Array.isArray(t)||(t=[t]),t=this.splat(t.shift(),...t).toString().split(je.EOL).filter((e=>!e||""!==e.trim())).map((t=>this.style(e,this.fields(t,{prefix:Array.isArray(r?.prefix)?r.prefix:[r?.prefix],suffix:Array.isArray(r?.suffix)?r.suffix:[r?.suffix]})))).join(je.EOL)}style(e,t){if(!e||!t)return t;const r=this.icon(e,!this.options.useIcons&&this.wrap(e));return r&&(t=r+" "+t),t}applyFormat(e,t){return t?.format?t.format(e):e}spacing(e){return void 0===e||""===e.trim()?"":" "}};Ve(ft,"ListrLogger");var gt=ft,mt=class{constructor(e){this.options=e,this.buffer=[],this.decoder=new Ke.StringDecoder}get all(){return this.buffer}get last(){return this.buffer.at(-1)}get length(){return this.buffer.length}write(e,...t){const r=t[t.length-1];return this.buffer.push({time:Date.now(),stream:this.options?.stream,entry:this.decoder.write("string"==typeof e?Buffer.from(e,"string"==typeof t[0]?t[0]:void 0):Buffer.from(e))}),this.options?.limit&&(this.buffer=this.buffer.slice(-this.options.limit)),"function"==typeof r&&r(),!0}reset(){this.buffer=[]}};Ve(mt,"ProcessOutputBuffer");var yt=mt,bt=class{constructor(e){this.stream=e,this.method=e.write,this.buffer=new yt({stream:e})}get out(){return Object.assign({},this.stream,{write:this.write.bind(this)})}hijack(){this.stream.write=this.buffer.write.bind(this.buffer)}release(){this.stream.write=this.method;const e=[...this.buffer.all];return this.buffer.reset(),e}write(...e){return this.method.apply(this.stream,e)}};Ve(bt,"ProcessOutputStream");var Et=bt,Rt=class{constructor(e,t,r){this.options=r,this.stream={stdout:new Et(e??process.stdout),stderr:new Et(t??process.stderr)},this.options={dump:["stdout","stderr"],leaveEmptyLine:!0,...r}}get stdout(){return this.stream.stdout.out}get stderr(){return this.stream.stderr.out}hijack(){if(this.active)throw new Error("ProcessOutput has been already hijacked!");this.stream.stdout.write(Qe.CURSOR_HIDE),Object.values(this.stream).forEach((e=>e.hijack())),this.active=!0}release(){const e=Object.entries(this.stream).map((([e,t])=>({name:e,buffer:t.release()}))).filter((e=>this.options.dump.includes(e.name))).flatMap((e=>e.buffer)).sort(((e,t)=>e.time-t.time)).map((e=>({...e,entry:nt(e.entry)}))).filter((e=>e.entry));e.length>0&&(this.options.leaveEmptyLine&&this.stdout.write(je.EOL),e.forEach((e=>{(e.stream??this.stdout).write(e.entry+je.EOL)}))),this.stream.stdout.write(Qe.CURSOR_SHOW),this.active=!1}toStdout(e,t=!0){return t&&(e+=je.EOL),this.stream.stdout.write(e)}toStderr(e,t=!0){return t&&(e+=je.EOL),this.stream.stderr.write(e)}};Ve(Rt,"ProcessOutput");var At=Rt;function wt(e){const t=new We.Writable;return t.write=t=>(e(t.toString()),!0),t}Ve(wt,"createWritable");var Ct=class{constructor(){this.spinner=rt()?["\u280b","\u2819","\u2839","\u2838","\u283c","\u2834","\u2826","\u2827","\u2807","\u280f"]:["-","\\","|","/"],this.spinnerPosition=0}spin(){this.spinnerPosition=++this.spinnerPosition%this.spinner.length}fetch(){return this.spinner[this.spinnerPosition]}isRunning(){return!!this.id}start(e,t=100){this.id=setInterval((()=>{this.spin(),e&&e()}),t)}stop(){clearInterval(this.id)}};Ve(Ct,"Spinner");var St=Ct;async function vt(e,t){let s,n;if(t={...t},Array.isArray(e)?1===e.length&&(e=e.map((e=>({...e,name:"default"})))):e=[{...e,name:"default"}],e=e.map((e=>({onCancel:()=>{const e=new sr("Cancelled prompt.");if(!(this instanceof ir))throw e;return this.task.prompt=e,!0},...e,stdout:this instanceof ir?t?.stdout??this.stdout("PROMPT"):process.stdout}))),t?.enquirer)s=t.enquirer;else try{s=await Promise.resolve().then(r.t.bind(r,3906,19)).then((e=>e.default?new e.default:new e))}catch(e){throw this instanceof ir&&(this.task.prompt=new sr("Enquirer is a peer dependency that must be installed separately.")),e}this instanceof ir&&(n=this.task.state,this.task.state$="PROMPT",s.on("prompt",(e=>this.task.prompt=e)).on("submit",(()=>this.task.prompt=void 0)),this.task.on("STATE",(e=>{"SKIPPED"!==e||!this.task.prompt||this.task.prompt instanceof sr||this.task.prompt.submit()})));const i=await s.prompt(e);return this instanceof ir&&(this.task.state$="PROMPT_COMPLETED",this.task.state=n),1===e.length?i.default:i}Ve(vt,"createPrompt");var Tt={SKIPPED_WITH_COLLAPSE:ct.arrowDown,SKIPPED_WITHOUT_COLLAPSE:ct.warning,OUTPUT:ct.pointerSmall,OUTPUT_WITH_BOTTOMBAR:ct.pointerSmall,PENDING:ct.pointer,COMPLETED:ct.tick,COMPLETED_WITH_FAILED_SUBTASKS:ct.warning,COMPLETED_WITH_SISTER_TASKS_FAILED:ct.squareSmallFilled,RETRY:ct.warning,ROLLING_BACK:ct.warning,ROLLED_BACK:ct.arrowLeft,FAILED:ct.cross,FAILED_WITH_SUBTASKS:ct.pointer,WAITING:ct.squareSmallFilled,PAUSED:ct.squareSmallFilled},Ot={SKIPPED_WITH_COLLAPSE:it.yellow,SKIPPED_WITHOUT_COLLAPSE:it.yellow,PENDING:it.yellow,COMPLETED:it.green,COMPLETED_WITH_FAILED_SUBTASKS:it.yellow,COMPLETED_WITH_SISTER_TASKS_FAILED:it.red,RETRY:it.yellowBright,ROLLING_BACK:it.redBright,ROLLED_BACK:it.redBright,FAILED:it.red,FAILED_WITH_SUBTASKS:it.red,WAITING:it.dim,PAUSED:it.yellowBright};function xt(e){const t=Math.floor(e/1e3),r=Math.floor(t/60);let s;return 0===t&&0===r&&(s=`0.${Math.floor(e/100)}s`),t>0&&(s=t%60+"s"),r>0&&(s=`${r}m${s}`),s}Ve(xt,"parseTimer");var _t={condition:!0,field:xt,format:()=>it.dim};function kt(){const e=new Date;return String(e.getHours()).padStart(2,"0")+":"+String(e.getMinutes()).padStart(2,"0")+":"+String(e.getSeconds()).padStart(2,"0")}Ve(kt,"parseTimestamp");var Lt=class e{constructor(t,r,s){this.tasks=t,this.options=r,this.events=s,this.bottom=new Map,this.cache={output:new Map,rendererOptions:new Map,rendererTaskOptions:new Map},this.options={...e.rendererOptions,...this.options,icon:{...Tt,...r?.icon??{}},color:{...Ot,...r?.color??{}}},this.spinner=this.options.spinner??new St,this.logger=this.options.logger??new gt({useIcons:!0,toStderr:[]}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color}isBottomBar(e){const t=this.cache.rendererTaskOptions.get(e.id).bottomBar;return"number"==typeof t&&0!==t||"boolean"==typeof t&&!1!==t||!e.hasTitle()}async render(){const{createLogUpdate:e}=await Promise.all([r.e(777),r.e(609)]).then(r.bind(r,6586)),{default:t}=await Promise.all([r.e(777),r.e(609)]).then(r.bind(r,3246)),{default:s}=await Promise.all([r.e(777),r.e(609)]).then(r.bind(r,1841));this.updater=e(this.logger.process.stdout),this.truncate=t,this.wrap=s,this.logger.process.hijack(),this.options?.lazy||this.spinner.start((()=>{this.update()})),this.events.on("SHOUD_REFRESH_RENDER",(()=>{this.update()}))}update(){this.updater(this.create())}end(){this.spinner.stop(),this.updater.clear(),this.updater.done(),this.options.clearOutput||this.logger.process.toStdout(this.create({prompt:!1})),this.logger.process.release()}create(e){e={tasks:!0,bottomBar:!0,prompt:!0,...e};const t=[],r=this.renderer(this.tasks),s=this.renderBottomBar(),n=this.renderPrompt();return e.tasks&&r.length>0&&t.push(...r),e.bottomBar&&s.length>0&&(t.length>0&&t.push(""),t.push(...s)),e.prompt&&n.length>0&&(t.length>0&&t.push(""),t.push(...n)),t.join(je.EOL)}style(e,t=!1){const r=this.cache.rendererOptions.get(e.id);if(e.isSkipped()){if(t||r.collapseSkips)return this.logger.icon("SKIPPED_WITH_COLLAPSE");if(!1===r.collapseSkips)return this.logger.icon("SKIPPED_WITHOUT_COLLAPSE")}if(t)return this.isBottomBar(e)?this.logger.icon("OUTPUT_WITH_BOTTOMBAR"):this.logger.icon("OUTPUT");if(e.hasSubtasks()){if(e.isStarted()||e.isPrompt()&&!1!==r.showSubtasks&&!e.subtasks.every((e=>!e.hasTitle())))return this.logger.icon("PENDING");if(e.isCompleted()&&e.subtasks.some((e=>e.hasFailed())))return this.logger.icon("COMPLETED_WITH_FAILED_SUBTASKS");if(e.hasFailed())return this.logger.icon("FAILED_WITH_SUBTASKS")}return e.isStarted()||e.isPrompt()?this.logger.icon("PENDING",!this.options?.lazy&&this.spinner.fetch()):e.isCompleted()?this.logger.icon("COMPLETED"):e.isRetrying()?this.logger.icon("RETRY",!this.options?.lazy&&this.spinner.fetch()):e.isRollingBack()?this.logger.icon("ROLLING_BACK",!this.options?.lazy&&this.spinner.fetch()):e.hasRolledBack()?this.logger.icon("ROLLED_BACK"):e.hasFailed()?this.logger.icon("FAILED"):e.isPaused()?this.logger.icon("PAUSED"):this.logger.icon("WAITING")}format(e,t,r){if(""===e.trim())return[];let s;t&&(e=t+" "+e);const n=(process.stdout.columns??80)-r*this.options.indentation-2;switch(this.options.formatOutput){case"truncate":s=e.split(je.EOL).map(((e,t)=>this.truncate(this.indent(e,t),n)));break;case"wrap":s=this.wrap(e,n,{hard:!0}).split(je.EOL).map(((e,t)=>this.indent(e,t)));break;default:throw new tr("Format option for the renderer is wrong.")}return this.options.removeEmptyLines&&(s=s.filter(Boolean)),s.map((e=>ot(e,r*this.options.indentation)))}renderer(e,t=0){return e.flatMap((r=>{if(!r.isEnabled())return[];if(this.cache.output.has(r.id))return this.cache.output.get(r.id);this.calculate(r);const s=this.cache.rendererOptions.get(r.id),n=this.cache.rendererTaskOptions.get(r.id),i=[];if(r.isPrompt()){if(this.activePrompt&&this.activePrompt!==r.id)throw new tr("Only one prompt can be active at the given time, please re-evaluate your task design.");this.activePrompt||(r.on("PROMPT",(e=>{const t=nt(e);t&&(this.prompt=t)})),r.on("STATE",(e=>{("PROMPT_COMPLETED"===e||r.hasFinalized()||r.hasReset())&&(this.prompt=null,this.activePrompt=null,r.off("PROMPT"))})),this.activePrompt=r.id)}if(r.hasTitle()&&(!e.some((e=>e.hasFailed()))||r.hasFailed()||!1===r.options.exitOnError||r.isCompleted()||r.isSkipped()?r.hasFailed()&&s.collapseErrors?i.push(...this.format(!r.hasSubtasks()&&r.message.error&&s.showErrorMessage?r.message.error:r.title,this.style(r),t)):r.isSkipped()&&s.collapseSkips?i.push(...this.format(this.logger.suffix(r.message.skip&&s.showSkipMessage?r.message.skip:r.title,{field:"SKIPPED",condition:s.suffixSkips,format:()=>it.dim}),this.style(r),t)):r.isRetrying()?i.push(...this.format(this.logger.suffix(r.title,{field:`RETRY:${r.message.retry.count}`,format:()=>it.yellow,condition:s.suffixRetries}),this.style(r),t)):r.isCompleted()&&r.hasTitle()&&Yt(n.timer?.condition,r.message.duration)?i.push(...this.format(this.logger.suffix(r?.title,{...n.timer,args:[r.message.duration]}),this.style(r),t)):r.isPaused()?i.push(...this.format(this.logger.suffix(r.title,{...s.pausedTimer,args:[r.message.paused-Date.now()]}),this.style(r),t)):i.push(...this.format(r.title,this.style(r),t)):i.push(...this.format(r.title,this.logger.icon("COMPLETED_WITH_SISTER_TASKS_FAILED"),t))),r.hasSubtasks()&&s.showSubtasks||(!r.hasFailed()||!1!==s.collapseErrors||!s.showErrorMessage&&s.showSubtasks?!r.isSkipped()||!1!==s.collapseSkips||!s.showSkipMessage&&s.showSubtasks||i.push(...this.dump(r,t,"SKIPPED")):i.push(...this.dump(r,t,"FAILED"))),r?.output&&(this.isBottomBar(r)?this.bottom.has(r.id)||(this.bottom.set(r.id,new yt({limit:"boolean"==typeof n.bottomBar?1:n.bottomBar})),r.on("OUTPUT",(e=>{const t=this.dump(r,-1,"OUTPUT",e);this.bottom.get(r.id).write(t.join(je.EOL))}))):(r.isPending()||n.persistentOutput)&&i.push(...this.dump(r,t))),!1!==s.showSubtasks&&r.hasSubtasks()&&(r.isPending()||r.hasFinalized()&&!r.hasTitle()||r.isCompleted()&&!1===s.collapseSubtasks&&!r.subtasks.some((e=>!0===e.rendererOptions.collapseSubtasks))||r.subtasks.some((e=>!1===e.rendererOptions.collapseSubtasks))||r.subtasks.some((e=>e.hasFailed()))||r.subtasks.some((e=>e.hasRolledBack())))){const e=r.hasTitle()?t+1:t,s=this.renderer(r.subtasks,e);i.push(...s)}return r.hasFinalized()&&(n.persistentOutput||this.bottom.delete(r.id)),r.isClosed()&&(this.cache.output.set(r.id,i),this.reset(r)),i}))}renderBottomBar(){return 0===this.bottom.size?[]:Array.from(this.bottom.values()).flatMap((e=>e.all)).sort(((e,t)=>e.time-t.time)).map((e=>e.entry))}renderPrompt(){return this.prompt?[this.prompt]:[]}calculate(t){if(this.cache.rendererOptions.has(t.id)&&this.cache.rendererTaskOptions.has(t.id))return;const r={...this.options,...t.rendererOptions};this.cache.rendererOptions.set(t.id,r),this.cache.rendererTaskOptions.set(t.id,{...e.rendererTaskOptions,timer:r.timer,...t.rendererTaskOptions})}reset(e){this.cache.rendererOptions.delete(e.id),this.cache.rendererTaskOptions.delete(e.id)}dump(e,t,r="OUTPUT",s){if(!s)switch(r){case"OUTPUT":s=e.output;break;case"SKIPPED":s=e.message.skip;break;case"FAILED":s=e.message.error}return e.hasTitle()&&"FAILED"===r&&s===e.title||"string"!=typeof s?[]:("OUTPUT"===r&&(s=nt(s)),this.format(s,this.style(e,!0),t+1))}indent(e,t){return t>0?ot(e.trim(),this.options.indentation):e.trim()}};Ve(Lt,"DefaultRenderer"),Lt.nonTTY=!1,Lt.rendererOptions={indentation:2,clearOutput:!1,showSubtasks:!0,collapseSubtasks:!0,collapseSkips:!0,showSkipMessage:!0,suffixSkips:!1,collapseErrors:!0,showErrorMessage:!0,suffixRetries:!0,lazy:!1,removeEmptyLines:!0,formatOutput:"wrap",pausedTimer:{..._t,format:()=>it.yellowBright}};var It=Lt,Pt=class{constructor(e,t){this.tasks=e,this.options=t}render(){}end(){}};Ve(Pt,"SilentRenderer"),Pt.nonTTY=!0;var $t=Pt,Bt=class e{constructor(t,r){this.tasks=t,this.options=r,this.cache={rendererOptions:new Map,rendererTaskOptions:new Map},this.options={...e.rendererOptions,...r,icon:{...pt,...r?.icon??{}},color:{...dt,...r?.color??{}}},this.logger=this.options.logger??new gt({useIcons:!0,toStderr:ht}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color,this.options.timestamp&&this.logger.options.fields.prefix.unshift(this.options.timestamp)}end(){this.logger.process.release()}render(){this.renderer(this.tasks)}renderer(e){e.forEach((e=>{this.calculate(e),e.once("CLOSED",(()=>{this.reset(e)}));const t=this.cache.rendererOptions.get(e.id),r=this.cache.rendererTaskOptions.get(e.id);e.on("SUBTASK",(e=>{this.renderer(e)})),e.on("STATE",(t=>{if(e.hasTitle())if("STARTED"===t)this.logger.log("STARTED",e.title);else if("COMPLETED"===t){const t=r?.timer;this.logger.log("COMPLETED",e.title,t&&{suffix:{...t,condition:!!e.message?.duration&&t.condition,args:[e.message.duration]}})}else"PROMPT"===t?(this.logger.process.hijack(),e.on("PROMPT",(e=>{this.logger.process.toStderr(e,!1)}))):"PROMPT_COMPLETED"===t&&(e.off("PROMPT"),this.logger.process.release())})),e.on("OUTPUT",(e=>{this.logger.log("OUTPUT",e)})),e.on("MESSAGE",(r=>{if(r.error)this.logger.log("FAILED",e.title,{suffix:{field:`FAILED: ${r.error}`,format:()=>it.red}});else if(r.skip)this.logger.log("SKIPPED",e.title,{suffix:{field:`SKIPPED: ${r.skip}`,format:()=>it.yellow}});else if(r.rollback)this.logger.log("ROLLBACK",e.title,{suffix:{field:`ROLLBACK: ${r.rollback}`,format:()=>it.red}});else if(r.retry)this.logger.log("RETRY",e.title,{suffix:{field:`RETRY:${r.retry.count}`,format:()=>it.red}});else if(r.paused){const s=t?.pausedTimer;this.logger.log("PAUSED",e.title,s&&{suffix:{...s,condition:!!r?.paused&&s.condition,args:[r.paused-Date.now()]}})}}))}))}calculate(t){if(this.cache.rendererOptions.has(t.id)&&this.cache.rendererTaskOptions.has(t.id))return;const r={...this.options,...t.rendererOptions};this.cache.rendererOptions.set(t.id,r),this.cache.rendererTaskOptions.set(t.id,{...e.rendererTaskOptions,timer:r.timer,...t.rendererTaskOptions})}reset(e){this.cache.rendererOptions.delete(e.id),this.cache.rendererTaskOptions.delete(e.id)}};Ve(Bt,"SimpleRenderer"),Bt.nonTTY=!0,Bt.rendererOptions={pausedTimer:{..._t,field:e=>`PAUSED:${e}`,format:()=>it.yellowBright}},Bt.rendererTaskOptions={};var Dt=Bt,Mt=class{constructor(e){this.options=e}serialize(e,t,r){return JSON.stringify(this.generate(e,t,r))}generate(e,t,r){const s={event:e,data:t};if("boolean"!=typeof this.options?.task){const e=Object.fromEntries(this.options.task.map((e=>{const t=r[e];return"function"==typeof t?[e,t.call(r)]:[e,t]})));Object.keys(r).length>0&&(s.task=e)}return s}};Ve(Mt,"TestRendererSerializer");var Ft=Mt,Ht=class e{constructor(t,r){this.tasks=t,this.options=r,this.options={...e.rendererOptions,...this.options},this.logger=this.options.logger??new gt({useIcons:!1}),this.serializer=new Ft(this.options)}render(){this.renderer(this.tasks)}end(){}renderer(e){e.forEach((e=>{this.options.subtasks&&e.on("SUBTASK",(e=>{this.renderer(e)})),this.options.state&&e.on("STATE",(t=>{this.logger.toStdout(this.serializer.serialize("STATE",t,e))})),this.options.output&&e.on("OUTPUT",(t=>{this.logger.toStdout(this.serializer.serialize("OUTPUT",t,e))})),this.options.prompt&&e.on("PROMPT",(t=>{this.logger.toStdout(this.serializer.serialize("PROMPT",t,e))})),this.options.title&&e.on("TITLE",(t=>{this.logger.toStdout(this.serializer.serialize("TITLE",t,e))})),e.on("MESSAGE",(t=>{const r=Object.fromEntries(Object.entries(t).map((([e,t])=>{if(this.options.messages.includes(e))return[e,t]})).filter(Boolean));if(Object.keys(r).length>0){const t=this.serializer.serialize("MESSAGE",r,e);this.options.messagesToStderr.some((e=>Object.keys(r).includes(e)))?this.logger.toStderr(t):this.logger.toStdout(t)}}))}))}};Ve(Ht,"TestRenderer"),Ht.nonTTY=!0,Ht.rendererOptions={subtasks:!0,state:Object.values(Xe),output:!0,prompt:!0,title:!0,messages:["skip","error","retry","rollback","paused"],messagesToStderr:["error","rollback","retry"],task:["hasRolledBack","isRollingBack","isCompleted","isSkipped","hasFinalized","hasSubtasks","title","hasReset","hasTitle","isPrompt","isPaused","isPending","isSkipped","isStarted","hasFailed","isEnabled","isRetrying","path"]};var Gt=Ht,Nt=class e{constructor(t,r){this.tasks=t,this.options=r,this.cache={rendererOptions:new Map,rendererTaskOptions:new Map},this.options={...e.rendererOptions,...this.options,icon:{...pt,...r?.icon??{}},color:{...dt,...r?.color??{}}},this.logger=this.options.logger??new gt({useIcons:!1,toStderr:ht}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color,this.options.timestamp&&this.logger.options.fields.prefix.unshift(this.options.timestamp)}render(){this.renderer(this.tasks)}end(){}renderer(e){e.forEach((e=>{this.calculate(e),e.once("CLOSED",(()=>{this.reset(e)}));const t=this.cache.rendererOptions.get(e.id),r=this.cache.rendererTaskOptions.get(e.id);e.on("SUBTASK",(e=>{this.renderer(e)})),e.on("STATE",(t=>{if(e.hasTitle())if("STARTED"===t)this.logger.log("STARTED",e.title);else if("COMPLETED"===t){const t=r.timer;this.logger.log("COMPLETED",e.title,t&&{suffix:{...t,condition:!!e.message?.duration&&t.condition,args:[e.message.duration]}})}})),e.on("OUTPUT",(e=>{this.logger.log("OUTPUT",e)})),e.on("PROMPT",(e=>{const t=nt(e);t&&this.logger.log("PROMPT",t)})),!1!==this.options?.logTitleChange&&e.on("TITLE",(e=>{this.logger.log("TITLE",e)})),e.on("MESSAGE",(r=>{if(r?.error)this.logger.log("FAILED",r.error);else if(r?.skip)this.logger.log("SKIPPED",r.skip);else if(r?.rollback)this.logger.log("ROLLBACK",r.rollback);else if(r?.retry)this.logger.log("RETRY",e.title,{suffix:r.retry.count.toString()});else if(r?.paused){const s=t?.pausedTimer;this.logger.log("PAUSED",e.title,s&&{suffix:{...s,condition:!!r?.paused&&s.condition,args:[r.paused-Date.now()]}})}}))}))}calculate(t){if(this.cache.rendererOptions.has(t.id)&&this.cache.rendererTaskOptions.has(t.id))return;const r={...this.options,...t.rendererOptions};this.cache.rendererOptions.set(t.id,r),this.cache.rendererTaskOptions.set(t.id,{...e.rendererTaskOptions,timer:r.timer,...t.rendererTaskOptions})}reset(e){this.cache.rendererOptions.delete(e.id),this.cache.rendererTaskOptions.delete(e.id)}};Ve(Nt,"VerboseRenderer"),Nt.nonTTY=!0,Nt.rendererOptions={logTitleChange:!1,pausedTimer:{..._t,format:()=>it.yellowBright}};var Ut={default:It,simple:Dt,verbose:Nt,test:Gt,silent:$t};function jt(e){return!0===process.stdout.isTTY||!0===e.nonTTY}function Kt(e){return"string"==typeof e?Ut[e]??Ut.default:"function"==typeof e?e:Ut.default}function Wt(e){if(Yt(e?.silentRendererCondition))return{renderer:Kt("silent")};const t={renderer:Kt(e.renderer),options:e.rendererOptions};return!jt(t.renderer)||Yt(e?.fallbackRendererCondition)?{renderer:Kt(e.fallbackRenderer),options:e.fallbackRendererOptions}:t}function Yt(e,...t){return"function"==typeof e?e(...t):e}Ve(jt,"isRendererSupported"),Ve(Kt,"getRendererClass"),Ve(Wt,"getRenderer"),Ve(Yt,"assertFunctionOrSelf");var zt=Ye({circles:!0});function qt(e){return zt(e)}Ve(qt,"cloneObject");var Vt=class{constructor(e){this.concurrency=e.concurrency,this.count=0,this.queue=new Set}add(e){return this.count<this.concurrency?this.run(e):new Promise((t=>{const r=Ve((()=>t(this.run(e))),"callback");this.queue.add(r)}))}flush(){for(const e of this.queue){if(this.count>=this.concurrency)break;this.queue.delete(e),e()}}run(e){this.count++;const t=e(),r=Ve((()=>{this.count--,this.flush()}),"cleanup");return t.then(r,(()=>{this.queue.clear()})),t}};Ve(Vt,"Concurrency");var Qt=Vt;function Xt(e){return new Promise((t=>{setTimeout(t,e)}))}Ve(Xt,"delay");var Zt=class extends Error{constructor(e,t,r){super(e.message),this.error=e,this.type=t,this.task=r,this.name="ListrError",this.path=r.path,"full"===r?.options.collectErrors&&(this.task=qt(r),this.ctx=qt(r.listr.ctx)),this.stack=e?.stack}};Ve(Zt,"ListrError");var Jt=Zt,er=class extends Error{};Ve(er,"ListrRendererError");var tr=er,rr=class extends Error{};Ve(rr,"PromptError");var sr=rr,nr=class{constructor(e,t){this.task=e,this.options=t}get title(){return this.task.title}set title(e){e=Array.isArray(e)?e:[e],this.task.title$=ut(e.shift(),...e)}get output(){return this.task.output}set output(e){e=Array.isArray(e)?e:[e],this.task.output$=ut(e.shift(),...e)}set promptOutput(e){this.task.promptOutput$=e}newListr(e,t){let r;return r="function"==typeof e?e(this):e,new hr(r,t,this.task)}report(e,t){!1!==this.task.options.collectErrors&&this.task.listr.errors.push(new Jt(e,t,this.task)),this.task.message$={error:e.message??this.task?.title}}skip(e,...t){this.task.state$="SKIPPED",e&&(this.task.message$={skip:e?ut(e,...t):this.task?.title})}isRetrying(){return this.task.isRetrying()?this.task.retry:{count:0}}async prompt(e){return vt.bind(this)(e,{...this.options?.injectWrapper})}cancelPrompt(e){!this.task.prompt||this.task.prompt instanceof sr||(e?.throw?this.task.prompt.cancel():this.task.prompt.submit())}stdout(e){return wt((t=>{if("PROMPT"===e)this.promptOutput=t.toString();else this.output=t.toString()}))}run(e){return this.task.run(e,this)}};Ve(nr,"TaskWrapper");var ir=nr,or=class extends Je{};Ve(or,"ListrTaskEventManager");var ar=or,lr=class extends ar{constructor(e,t,r,s){if(super(),this.listr=e,this.task=t,this.options=r,this.rendererOptions=s,this.id=(0,ze.randomUUID)(),this.state="WAITING",this.message={},t.title){const e=Array.isArray(t?.title)?t.title:[t.title];this.title=ut(e.shift(),...e),this.initialTitle=this.title}this.taskFn=t.task,this.parent=e.parentTask,this.rendererTaskOptions=t.options}set state$(e){if(this.state=e,this.emit("STATE",e),this.hasSubtasks()&&this.hasFailed())for(const e of this.subtasks)"STARTED"===e.state&&(e.state$="FAILED");this.listr.events.emit("SHOUD_REFRESH_RENDER")}set output$(e){this.output=e,this.emit("OUTPUT",e),this.listr.events.emit("SHOUD_REFRESH_RENDER")}set promptOutput$(e){this.emit("PROMPT",e),nt(e)&&this.listr.events.emit("SHOUD_REFRESH_RENDER")}set message$(e){this.message={...this.message,...e},this.emit("MESSAGE",e),this.listr.events.emit("SHOUD_REFRESH_RENDER")}set title$(e){this.title=e,this.emit("TITLE",e),this.listr.events.emit("SHOUD_REFRESH_RENDER")}get path(){return[...this.listr.path,this.initialTitle]}async check(e){return"WAITING"===this.state&&(this.enabled=await Yt(this.task?.enabled??!0,e),this.emit("ENABLED",this.enabled),this.listr.events.emit("SHOUD_REFRESH_RENDER")),this.enabled}hasSubtasks(){return this.subtasks?.length>0}hasFinalized(){return this.isCompleted()||this.hasFailed()||this.isSkipped()||this.hasRolledBack()}isPending(){return this.isStarted()||this.isPrompt()||this.hasReset()}isStarted(){return"STARTED"===this.state}isSkipped(){return"SKIPPED"===this.state}isCompleted(){return"COMPLETED"===this.state}hasFailed(){return"FAILED"===this.state}isRollingBack(){return"ROLLING_BACK"===this.state}hasRolledBack(){return"ROLLED_BACK"===this.state}isRetrying(){return"RETRY"===this.state}hasReset(){return"RETRY"===this.state||"ROLLING_BACK"===this.state}isEnabled(){return this.enabled}hasTitle(){return"string"==typeof this?.title}isPrompt(){return"PROMPT"===this.state||"PROMPT_COMPLETED"===this.state}isPaused(){return"PAUSED"===this.state}isClosed(){return this.closed}async pause(e){const t=this.state;this.state$="PAUSED",this.message$={paused:Date.now()+e},await Xt(e),this.state$=t,this.message$={paused:null}}async run(e,t){const r=Ve((t=>(t instanceof hr?(t.options={...this.options,...t.options},t.rendererClass=Kt("silent"),this.subtasks=t.tasks,t.errors=this.listr.errors,this.emit("SUBTASK",this.subtasks),t=t.run(e)):t instanceof Promise?t=t.then(r):t instanceof We.Readable?t=new Promise(((e,r)=>{t.on("data",(e=>{this.output$=e.toString()})),t.on("error",(e=>r(e))),t.on("end",(()=>e(null)))})):tt(t)&&(t=new Promise(((e,r)=>{t.subscribe({next:e=>{this.output$=e},error:r,complete:e})}))),t)),"handleResult"),s=Date.now();this.state$="STARTED";const n=await Yt(this.task?.skip??!1,e);if(n)return"string"==typeof n?this.message$={skip:n}:this.hasTitle()?this.message$={skip:this.title}:this.message$={skip:"Skipped task without a title."},void(this.state$="SKIPPED");try{const n="number"==typeof this.task?.retry&&this.task.retry>0?this.task.retry+1:"object"==typeof this.task?.retry&&this.task.retry.tries>0?this.task.retry.tries+1:1,i="object"==typeof this.task.retry&&this.task.retry.delay;for(let s=1;s<=n;s++)try{await r(this.taskFn(e,t));break}catch(e){if(s===n)throw e;this.retry={count:s,error:e},this.message$={retry:this.retry},this.title$=this.initialTitle,this.output=void 0,t.report(e,"WILL_RETRY"),this.state$="RETRY",i&&await this.pause(i)}(this.isStarted()||this.isRetrying())&&(this.message$={duration:Date.now()-s},this.state$="COMPLETED")}catch(r){if(this.prompt instanceof sr&&(r=this.prompt),this.task?.rollback){t.report(r,"WILL_ROLLBACK");try{this.state$="ROLLING_BACK",await this.task.rollback(e,t),this.message$={rollback:this.title},this.state$="ROLLED_BACK"}catch(e){throw this.state$="FAILED",t.report(e,"HAS_FAILED_TO_ROLLBACK"),this.close(),e}if(!1!==this.listr.options?.exitAfterRollback)throw this.close(),r}else{if(this.state$="FAILED",!1!==this.listr.options.exitOnError&&!1!==await Yt(this.task?.exitOnError,e))throw t.report(r,"HAS_FAILED"),this.close(),r;this.hasSubtasks()||t.report(r,"HAS_FAILED_WITHOUT_ERROR")}}finally{this.close()}}close(){this.emit("CLOSED"),this.listr.events.emit("SHOUD_REFRESH_RENDER"),this.complete()}};Ve(lr,"Task");var cr=lr,ur=class extends Je{};Ve(ur,"ListrEventManager");var pr=ur,dr=class{constructor(e,t,r){this.task=e,this.options=t,this.parentTask=r,this.tasks=[],this.errors=[],this.path=[],this.options={concurrent:!1,renderer:"default",fallbackRenderer:"simple",exitOnError:!0,exitAfterRollback:!0,collectErrors:!1,registerSignalListeners:!0,...this.parentTask?.options??{},...t},!0===this.options.concurrent?this.options.concurrent=1/0:"number"!=typeof this.options.concurrent&&(this.options.concurrent=1),this.concurrency=new Qt({concurrency:this.options.concurrent}),r&&(this.path=[...r.listr.path,r.title],this.errors=r.listr.errors),this.parentTask?.listr.events instanceof pr?this.events=this.parentTask.listr.events:this.events=new pr;const s=Wt({renderer:this.options.renderer,rendererOptions:this.options.rendererOptions,fallbackRenderer:this.options.fallbackRenderer,fallbackRendererOptions:this.options.fallbackRendererOptions,fallbackRendererCondition:this.options?.fallbackRendererCondition,silentRendererCondition:this.options?.silentRendererCondition});this.rendererClass=s.renderer,this.rendererClassOptions=s.options,this.add(e??[]),this.options.registerSignalListeners&&process.once("SIGINT",(()=>{this.tasks.forEach((async e=>{e.isPending()&&(e.state$="FAILED")})),this.renderer.end(new Error("Interrupted.")),process.exit(127)})).setMaxListeners(0),this.options?.disableColor?process.env.LISTR_DISABLE_COLOR="1":this.options?.forceColor&&(process.env.FORCE_COLOR="1"),this.options?.forceTTY&&(process.stdout.isTTY=!0,process.stderr.isTTY=!0),this.options?.forceUnicode&&(process.env.LISTR_FORCE_UNICODE="1")}add(e){this.tasks.push(...this.generate(e))}async run(e){this.renderer||(this.renderer=new this.rendererClass(this.tasks,this.rendererClassOptions,this.events)),await this.renderer.render(),this.ctx=this.options?.ctx??e??{},await Promise.all(this.tasks.map((e=>e.check(this.ctx))));try{await Promise.all(this.tasks.map((e=>this.concurrency.add((()=>this.runTask(e)))))),this.renderer.end()}catch(e){if(!1!==this.options.exitOnError)throw this.renderer.end(e),e}return this.ctx}generate(e){return(e=Array.isArray(e)?e:[e]).map((e=>new cr(this,e,this.options,{...this.rendererClassOptions})))}async runTask(e){if(await e.check(this.ctx))return new ir(e,this.options).run(this.ctx)}};Ve(dr,"Listr");var hr=dr,fr=class{constructor(e){this.options=e,this.errors=[],this.tasks=[]}get ctx(){return this.options.ctx}set ctx(e){this.options.ctx=e}add(e,t){t={...this.options,...t},this.tasks=[...this.tasks,this.indent(e,t)]}async runAll(e){e={...this.options,...e};const t=[...this.tasks];this.tasks=[];return await this.run(t,e)}newListr(e,t){return new hr(e,t)}indent(e,t,r){return t={...this.options,...t},"function"==typeof e?{...r,task:r=>this.newListr(e(r),t)}:{...r,task:()=>this.newListr(e,t)}}async run(e,t){t={...this.options,...t};const r=this.newListr(e,t),s=await r.run();return this.errors.push(...r.errors),s}};Ve(fr,"Manager");const gr=M.blue(ct.arrowRight),mr=M.redBright(ct.cross),yr=M.yellow(ct.warning),br=(e,t,r)=>`${M.redBright(`${mr} Validation Error:`)}\n\n Invalid value for '${M.bold(e)}': ${M.bold((0,n.inspect)(r))}\n\n ${t}`,Er=M.redBright(`${mr} Current directory is not a git directory!`),Rr=M.redBright(`${mr} Failed to get staged files!`),Ar=`${mr} No valid configuration found.`,wr=`${gr} No staged files found.`,Cr=`${gr} No staged files match any configured task.`,Sr=M.yellow(`${yr} Some of your tasks use \`git add\` command. Please remove it from the config since all modifications made by tasks will be automatically added to the git commit index.\n`),vr="Skipped because of errors from tasks.",Tr=`\n ${M.redBright(`${mr} lint-staged failed due to a git error.`)}`,Or=(e,t,r)=>`${M.redBright(`${mr} Validation Error:`)}\n\n Invalid value for option '${M.bold(e)}': ${M.bold(t)}\n\n ${r}\n\nSee https://github.com/okonet/lint-staged#command-line-flags`,xr=`\n ${M.yellow(`${yr} lint-staged prevented an empty git commit.\n Use the --allow-empty option to continue, or check your task configuration`)}\n`,_r=(M.redBright(`${mr} Failed to read config from stdin.`),(e={},t)=>{if(!Array.isArray(e.output))return;const r=e.errors?.size>0?t.error:t.log;for(const t of e.output)r(t)});var kr=r(9411);const Lr=e=>{if(e===kr.posix.sep||e===kr.win32.sep)return kr.posix.sep;let t=e.split(/[/\\]+/).join(kr.posix.sep);return(e.startsWith("\\\\?\\")||e.startsWith("\\\\.\\"))&&(t=t.replace(/^\/(\.|\?)/,"//$1")),t.endsWith(kr.posix.sep)&&(t=t.slice(0,-1)),t},Ir=s("lint-staged:chunkFiles"),Pr=({files:e,baseDir:t,maxArgLength:r=null,relative:s=!1})=>{const n=e.map((e=>Lr(s||!t?e:kr.resolve(t,e))));if(!r)return Ir("Skip chunking files because of undefined maxArgLength"),[n];const i=n.join(" ").length;Ir(`Resolved an argument string length of ${i} characters from ${n.length} files`);const o=Math.min(Math.ceil(i/r),n.length);return Ir(`Creating ${o} chunks for maxArgLength of ${r}`),((e,t)=>{if(1===t)return[e];const r=[];let s=0;for(let n=0;n<t;n++){const i=Math.ceil((e.length-s)/(t-n));r.push([]),r[n]=e.slice(s,i+s),s+=i}return r})(n,o)};var $r=r(2254),Br=r(7718),Dr=r(8995),Mr=r(3276),Fr=r(8028),Hr=r(9995);const Gr=(e,t)=>({name:`SIGRT${t+1}`,number:Nr+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Nr=34,Ur=64,jr=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],Kr=()=>{const e=(()=>{const e=Ur-Nr+1;return Array.from({length:e},Gr)})();return[...jr,...e].map(Wr)},Wr=({name:e,number:t,description:r,action:s,forced:n=!1,standard:i})=>{const{signals:{[e]:o}}=d.constants,a=void 0!==o;return{name:e,number:a?o:t,description:r,supported:a,action:s,forced:n,standard:i}},Yr=({name:e,number:t,description:r,supported:s,action:n,forced:i,standard:o})=>[e,{name:e,number:t,description:r,supported:s,action:n,forced:i,standard:o}],zr=(()=>{const e=Kr();return Object.fromEntries(e.map(Yr))})(),qr=(e,t)=>{const r=Vr(e,t);if(void 0===r)return{};const{name:s,description:n,supported:i,action:o,forced:a,standard:l}=r;return{[e]:{name:s,number:e,description:n,supported:i,action:o,forced:a,standard:l}}},Vr=(e,t)=>{const r=t.find((({name:t})=>d.constants.signals[t]===e));return void 0!==r?r:t.find((t=>t.number===e))},Qr=((()=>{const e=Kr(),t=Ur+1,r=Array.from({length:t},((t,r)=>qr(r,e)));Object.assign({},...r)})(),({stdout:e,stderr:t,all:r,error:s,signal:n,exitCode:i,command:o,escapedCommand:a,timedOut:l,isCanceled:c,killed:u,parsed:{options:{timeout:d,cwd:h=p.cwd()}}})=>{i=null===i?void 0:i;const f=void 0===(n=null===n?void 0:n)?void 0:zr[n].description,g=(({timedOut:e,timeout:t,errorCode:r,signal:s,signalDescription:n,exitCode:i,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?"was canceled":void 0!==r?`failed with ${r}`:void 0!==s?`was killed with ${s} (${n})`:void 0!==i?`failed with exit code ${i}`:"failed")({timedOut:l,timeout:d,errorCode:s&&s.code,signal:n,signalDescription:f,exitCode:i,isCanceled:c}),m=`Command ${g}: ${o}`,y="[object Error]"===Object.prototype.toString.call(s),b=y?`${m}\n${s.message}`:m,E=[b,t,e].filter(Boolean).join("\n");return y?(s.originalMessage=s.message,s.message=E):s=new Error(E),s.shortMessage=b,s.command=o,s.escapedCommand=a,s.exitCode=i,s.signal=n,s.signalDescription=f,s.stdout=e,s.stderr=t,s.cwd=h,void 0!==r&&(s.all=r),"bufferedData"in s&&delete s.bufferedData,s.failed=!0,s.timedOut=Boolean(l),s.isCanceled=c,s.killed=u&&!l,s}),Xr=["stdin","stdout","stderr"],Zr=e=>{if(!e)return;const{stdio:t}=e;if(void 0===t)return Xr.map((t=>e[t]));if((e=>Xr.some((t=>void 0!==e[t])))(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Xr.map((e=>`\`${e}\``)).join(", ")}`);if("string"==typeof t)return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const r=Math.max(t.length,Xr.length);return Array.from({length:r},((e,r)=>t[r]))};var Jr=r(2162);const es=(e,t="SIGTERM",r={})=>{const s=e(t);return ts(e,t,r,s),s},ts=(e,t,r,s)=>{if(!rs(t,r,s))return;const n=ns(r),i=setTimeout((()=>{e("SIGKILL")}),n);i.unref&&i.unref()},rs=(e,{forceKillAfterTimeout:t},r)=>ss(e)&&!1!==t&&r,ss=e=>e===d.constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),ns=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},is=(e,t)=>{e.kill()&&(t.isCanceled=!0)},os=(e,{timeout:t,killSignal:r="SIGTERM"},s)=>{if(0===t||void 0===t)return s;let n;const i=new Promise(((s,i)=>{n=setTimeout((()=>{((e,t,r)=>{e.kill(t),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))})(e,r,i)}),t)})),o=s.finally((()=>{clearTimeout(n)}));return Promise.race([i,o])},as=({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},ls=async(e,{cleanup:t,detached:r},s)=>{if(!t||r)return s;const n=Jr((()=>{e.kill()}));return s.finally((()=>{n()}))};var cs=r(7561),us=r(2622);const ps=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,cs.createWriteStream)(r)),e;if((0,us.lJ)(r))return e[t].pipe(r),e;if(!(e=>e instanceof Br.ChildProcess&&"function"==typeof e.then)(r))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!(0,us.lJ)(r.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r},ds=e=>{null!==e.stdout&&(e.pipeStdout=ps.bind(void 0,e,"stdout")),null!==e.stderr&&(e.pipeStderr=ps.bind(void 0,e,"stderr")),void 0!==e.all&&(e.pipeAll=ps.bind(void 0,e,"all"))};var hs=r(2935),fs=r(873);const gs=e=>{if(void 0!==e)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},ms=e=>{const t=(({input:e,inputFile:t})=>"string"!=typeof t?e:(gs(e),(0,cs.readFileSync)(t)))(e);if((0,us.ee)(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t},ys=(e,t)=>{const r=(({input:e,inputFile:t})=>"string"!=typeof t?e:(gs(e),(0,cs.createReadStream)(t)))(t);void 0!==r&&((0,us.ee)(r)?r.pipe(e.stdin):e.stdin.end(r))},bs=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const r=fs();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r},Es=async(e,t)=>{if(e&&void 0!==t){e.destroy();try{return await t}catch(e){return e.bufferedData}}},Rs=(e,{encoding:t,buffer:r,maxBuffer:s})=>{if(e&&r)return t?hs(e,{encoding:t,maxBuffer:s}):hs.buffer(e,{maxBuffer:s})},As=async({stdout:e,stderr:t,all:r},{encoding:s,buffer:n,maxBuffer:i},o)=>{const a=Rs(e,{encoding:s,buffer:n,maxBuffer:i}),l=Rs(t,{encoding:s,buffer:n,maxBuffer:i}),c=Rs(r,{encoding:s,buffer:n,maxBuffer:2*i});try{return await Promise.all([o,a,l,c])}catch(s){return Promise.all([{error:s,signal:s.signal,timedOut:s.timedOut},Es(e,a),Es(t,l),Es(r,c)])}},ws=(async()=>{})().constructor.prototype,Cs=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(ws,e)])),Ss=(e,t)=>{for(const[r,s]of Cs){const n="function"==typeof t?(...e)=>Reflect.apply(s.value,t(),e):s.value.bind(t);Reflect.defineProperty(e,r,{...s,value:n})}},vs=e=>new Promise(((t,r)=>{e.on("exit",((e,r)=>{t({exitCode:e,signal:r})})),e.on("error",(e=>{r(e)})),e.stdin&&e.stdin.on("error",(e=>{r(e)}))})),Ts=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Os=/^[\w.-]+$/,xs=/"/g,_s=(e,t)=>Ts(e,t).join(" "),ks=(e,t)=>Ts(e,t).map((e=>(e=>"string"!=typeof e||Os.test(e)?e:`"${e.replace(xs,'\\"')}"`)(e))).join(" "),Ls=/ +/g,Is=e=>{const t=typeof e;if("string"===t)return e;if("number"===t)return String(e);if("object"===t&&null!==e&&!(e instanceof Br.ChildProcess)&&"stdout"in e){const t=typeof e.stdout;if("string"===t)return e.stdout;if($r.Buffer.isBuffer(e.stdout))return e.stdout.toString();throw new TypeError(`Unexpected "${t}" stdout in template expression`)}throw new TypeError(`Unexpected "${t}" in template expression`)},Ps=(e,t,r)=>r||0===e.length||0===t.length?[...e,...t]:[...e.slice(0,-1),`${e[e.length-1]}${t[0]}`,...t.slice(1)],$s=({templates:e,expressions:t,tokens:r,index:s,template:n})=>{const i=n??e.raw[s],o=i.split(Ls).filter(Boolean),a=Ps(r,o,i.startsWith(" "));if(s===t.length)return a;const l=t[s],c=Array.isArray(l)?l.map((e=>Is(e))):[Is(l)];return Ps(a,c,i.endsWith(" "))},Bs=(e,t)=>{let r=[];for(const[s,n]of e.entries())r=$s({templates:e,expressions:t,tokens:r,index:s,template:n});return r},Ds=(0,n.debuglog)("execa").enabled,Ms=(e,t)=>String(e).padStart(t,"0"),Fs=(e,{verbose:t})=>{t&&p.stderr.write(`[${(()=>{const e=new Date;return`${Ms(e.getHours(),2)}:${Ms(e.getMinutes(),2)}:${Ms(e.getSeconds(),2)}.${Ms(e.getMilliseconds(),3)}`})()}] ${e}\n`)},Hs=(e,t,r={})=>{const s=Dr._parse(e,t,r);return e=s.command,t=s.args,(r={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(r=s.options).cwd||p.cwd(),execPath:p.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Ds,...r}).env=(({env:e,extendEnv:t,preferLocal:r,localDir:s,execPath:n})=>{const i=t?{...p.env,...e}:e;return r?(0,Fr.j)({env:i,cwd:s,execPath:n}):i})(r),r.stdio=Zr(r),"win32"===p.platform&&"cmd"===kr.basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:s}},Gs=(e,t,r)=>"string"==typeof t||$r.Buffer.isBuffer(t)?e.stripFinalNewline?(0,Mr.Z)(t):t:void 0===r?void 0:"";function Ns(e,t,r){const s=Hs(e,t,r),n=_s(e,t),i=ks(e,t);let o;Fs(i,s.options),as(s.options);try{o=Br.spawn(s.file,s.args,s.options)}catch(e){const t=new Br.ChildProcess,r=Promise.reject(Qr({error:e,stdout:"",stderr:"",all:"",command:n,escapedCommand:i,parsed:s,timedOut:!1,isCanceled:!1,killed:!1}));return Ss(t,r),t}const a=vs(o),l=os(o,s.options,a),c=ls(o,s.options,l),u={isCanceled:!1};o.kill=es.bind(null,o.kill.bind(o)),o.cancel=is.bind(null,o,u);const p=(0,Hr.Z)((async()=>{const[{error:e,exitCode:t,signal:r,timedOut:a},l,p,d]=await As(o,s.options,c),h=Gs(s.options,l),f=Gs(s.options,p),g=Gs(s.options,d);if(e||0!==t||null!==r){const l=Qr({error:e,exitCode:t,signal:r,stdout:h,stderr:f,all:g,command:n,escapedCommand:i,parsed:s,timedOut:a,isCanceled:u.isCanceled||!!s.options.signal&&s.options.signal.aborted,killed:o.killed});if(!s.options.reject)return l;throw l}return{command:n,escapedCommand:i,exitCode:0,stdout:h,stderr:f,all:g,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}));return ys(o,s.options),o.all=bs(o,s.options),ds(o),Ss(o,p),o}function Us(e,t,r){const s=Hs(e,t,r),n=_s(e,t),i=ks(e,t);Fs(i,s.options);const o=ms(s.options);let a;try{a=Br.spawnSync(s.file,s.args,{...s.options,input:o})}catch(e){throw Qr({error:e,stdout:"",stderr:"",all:"",command:n,escapedCommand:i,parsed:s,timedOut:!1,isCanceled:!1,killed:!1})}const l=Gs(s.options,a.stdout,a.error),c=Gs(s.options,a.stderr,a.error);if(a.error||0!==a.status||null!==a.signal){const e=Qr({stdout:l,stderr:c,error:a.error,signal:a.signal,exitCode:a.status,command:n,escapedCommand:i,parsed:s,timedOut:a.error&&"ETIMEDOUT"===a.error.code,isCanceled:!1,killed:null!==a.signal});if(!s.options.reject)return e;throw e}return{command:n,escapedCommand:i,exitCode:0,stdout:l,stderr:c,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}const js=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},Ks=(e={})=>({preferLocal:!0,...js(e),...e});(function e(t){function r(r,...s){if(!Array.isArray(r))return e({...t,...r});const[n,...i]=Bs(r,s);return Ns(n,i,Ks(t))}return r.sync=(e,...r)=>{if(!Array.isArray(e))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");const[s,...n]=Bs(e,r);return Us(s,n,Ks(t))},r})();function Ws(e,t){const[r,...s]=(e=>{const t=[];for(const r of e.trim().split(Ls)){const e=t[t.length-1];e&&e.endsWith("\\")?t[t.length-1]=`${e.slice(0,-1)} ${r}`:t.push(r)}return t})(e);return Ns(r,s,t)}const Ys=s("lint-staged:execGit"),zs=["-c","submodule.recurse=false"],qs=async(e,t={})=>{Ys("Running git command",e);try{const{stdout:r}=await Ns("git",zs.concat(e),{...t,all:!0,cwd:t.cwd||process.cwd()});return r}catch({all:e}){throw new Error(e)}};var Vs=r(1876);const Qs=s("lint-staged:generateTasks"),Xs=({config:e,cwd:t=process.cwd(),files:r,relative:s=!1})=>{Qs("Generating linter tasks");const n=r.map((e=>Lr(kr.relative(t,e))));return Object.entries(e).map((([e,r])=>{const i=e.startsWith("../"),o=n.filter((e=>!!i||!e.startsWith("..")&&!kr.isAbsolute(e))),a=Vs(o,e,{cwd:t,dot:!0,matchBase:!e.includes("/"),posixSlashes:!0,strictBrackets:!0}),l={pattern:e,commands:r,fileList:a.map((e=>Lr(s?e:kr.resolve(t,e))))};return Qs("Generated task: \n%O",l),l}))};var Zs=r(4492);const Js=new RegExp(d.EOL+"$"),en=e=>new Zs.Writable({write:function(t,r,s){e(t.toString().replace(Js,"")),s()}}),tn=({renderer:e},{FORCE_COLOR:t})=>"silent"===e||"test"===e||Number(t)>0?e:"verbose",rn=(e,t,r=process.env)=>{const s=(({debug:e,quiet:t},r,s)=>t?{renderer:"silent"}:"test"===s.NODE_ENV?{renderer:"test",rendererOptions:{logger:new gt({processOutput:new At(en(r.log),en(r.error))})}}:e||"dumb"===s.TERM?{renderer:"verbose"}:{renderer:"update",rendererOptions:{formatOutput:"truncate"}})(e,t,r);return{...s,fallbackRenderer:tn(s,r)}};function sn(e,t){return["diff","--name-only","-z",`--diff-filter=${void 0!==t?t.trim():"ACMR"}`,...void 0!==e?e.trim().split(" "):["--staged"]]}const nn=e=>e?e.replace(/\u0000$/,"").split("\0"):[];var on=r(3977);const an=s("lint-staged:file"),ln=async(e,t=!0)=>{an("Reading file `%s`",e);try{return await on.readFile(e)}catch(r){if(t&&"ENOENT"===r.code)return an("File `%s` doesn't exist, ignoring...",e),null;throw r}},cn=async(e,t=!0)=>{an("Removing file `%s`",e);try{await on.unlink(e)}catch(r){if(!t||"ENOENT"!==r.code)throw r;an("File `%s` doesn't exist, ignoring...",e)}},un=async(e,t)=>{an("Writing file `%s`",e),await on.writeFile(e,t)},pn=Symbol("ApplyEmptyCommitError"),dn=new Error("Configuration could not be found"),hn=new Error("Configuration should be an object or a function"),fn=new Error("Configuration should not be empty"),gn=Symbol("GetBackupStashError"),mn=Symbol("GetStagedFilesError"),yn=Symbol("GitError"),bn=Symbol("GitRepoError"),En=Symbol("HideUnstagedChangesError"),Rn=new Error("Invalid Options"),An=Symbol("RestoreMergeStatusError"),wn=Symbol("RestoreOriginalStateError"),Cn=Symbol("RestoreUnstagedChangesError"),Sn=Symbol("TaskError"),vn=s("lint-staged:GitWorkflow"),Tn=/\x00/,On=(e,t=!0)=>e.reduce(((e,r)=>{if(Tn.test(r)){const[s,n]=r.split(Tn);t&&e.push(n),e.push(s)}else e.push(r);return e}),[]),xn="lint-staged automatic backup",_n="lint-staged_unstaged.patch",kn=["--binary","--unified=0","--no-color","--no-ext-diff","--src-prefix=a/","--dst-prefix=b/","--patch","--submodule=short"],Ln=["-v","--whitespace=nowarn","--recount","--unidiff-zero"],In=(e,t,r)=>{throw t.errors.add(yn),r&&t.errors.add(r),e};class Pn{constructor({allowEmpty:e,gitConfigDir:t,gitDir:r,matchedFileChunks:s,diff:n,diffFilter:i}){this.execGit=(e,t={})=>qs(e,{...t,cwd:r}),this.deletedFiles=[],this.gitConfigDir=t,this.gitDir=r,this.diff=n,this.diffFilter=i,this.allowEmpty=e,this.matchedFileChunks=s,this.mergeHeadFilename=kr.resolve(t,"MERGE_HEAD"),this.mergeModeFilename=kr.resolve(t,"MERGE_MODE"),this.mergeMsgFilename=kr.resolve(t,"MERGE_MSG")}getHiddenFilepath(e){return kr.resolve(this.gitConfigDir,`./${e}`)}async getBackupStash(e){const t=(await this.execGit(["stash","list"])).split("\n").findIndex((e=>e.includes(xn)));if(-1===t)throw e.errors.add(gn),new Error("lint-staged automatic backup is missing!");return String(t)}async getDeletedFiles(){vn("Getting deleted files...");const e=(await this.execGit(["ls-files","--deleted"])).split("\n").filter(Boolean).map((e=>kr.resolve(this.gitDir,e)));return vn("Found deleted files:",e),e}async backupMergeStatus(){vn("Backing up merge state..."),await Promise.all([ln(this.mergeHeadFilename).then((e=>this.mergeHeadBuffer=e)),ln(this.mergeModeFilename).then((e=>this.mergeModeBuffer=e)),ln(this.mergeMsgFilename).then((e=>this.mergeMsgBuffer=e))]),vn("Done backing up merge state!")}async restoreMergeStatus(e){vn("Restoring merge state...");try{await Promise.all([this.mergeHeadBuffer&&un(this.mergeHeadFilename,this.mergeHeadBuffer),this.mergeModeBuffer&&un(this.mergeModeFilename,this.mergeModeBuffer),this.mergeMsgBuffer&&un(this.mergeMsgFilename,this.mergeMsgBuffer)]),vn("Done restoring merge state!")}catch(t){vn("Failed restoring merge state with error:"),vn(t),In(new Error("Merge state could not be restored due to an error!"),e,An)}}async getPartiallyStagedFiles(){vn("Getting partially staged files...");const e=(await this.execGit(["status","-z"])).split(/\x00(?=[ AMDRCU?!]{2} |$)/).filter((e=>{const[t,r]=e;return" "!==t&&" "!==r&&"?"!==t&&"?"!==r})).map((e=>e.substr(3))).filter(Boolean);return vn("Found partially staged files:",e),e.length?e:null}async prepare(e){try{if(vn("Backing up original state..."),this.partiallyStagedFiles=await this.getPartiallyStagedFiles(),this.partiallyStagedFiles){e.hasPartiallyStagedFiles=!0;const t=this.getHiddenFilepath(_n),r=On(this.partiallyStagedFiles);await this.execGit(["diff",...kn,"--output",t,"--",...r])}else e.hasPartiallyStagedFiles=!1;if(!e.shouldBackup)return;await this.backupMergeStatus(),this.deletedFiles=await this.getDeletedFiles();const t=await this.execGit(["stash","create"]);await this.execGit(["stash","store","--quiet","--message",xn,t]),vn("Done backing up original state!")}catch(t){In(t,e)}}async hideUnstagedChanges(e){try{const e=On(this.partiallyStagedFiles,!1);await this.execGit(["checkout","--force","--",...e])}catch(t){In(t,e,En)}}async applyModifications(e){vn("Adding task modifications to index...");for(const e of this.matchedFileChunks)await this.execGit(["add","--",...e]);vn("Done adding task modifications to index!");await this.execGit(sn(this.diff,this.diffFilter))||this.allowEmpty||In(new Error("Prevented an empty git commit!"),e,pn)}async restoreUnstagedChanges(e){vn("Restoring unstaged changes...");const t=this.getHiddenFilepath(_n);try{await this.execGit(["apply",...Ln,t])}catch(r){vn("Error while restoring changes:"),vn(r),vn("Retrying with 3-way merge");try{await this.execGit(["apply",...Ln,"--3way",t])}catch(t){vn("Error while restoring unstaged changes using 3-way merge:"),vn(t),In(new Error("Unstaged changes could not be restored due to a merge conflict!"),e,Cn)}}}async restoreOriginalState(e){try{vn("Restoring original state..."),await this.execGit(["reset","--hard","HEAD"]),await this.execGit(["stash","apply","--quiet","--index",await this.getBackupStash(e)]),await this.restoreMergeStatus(e),await Promise.all(this.deletedFiles.map((e=>cn(e)))),await cn(this.getHiddenFilepath(_n)),vn("Done restoring original state!")}catch(t){In(t,e,wn)}}async cleanup(e){try{vn("Dropping backup stash..."),await this.execGit(["stash","drop","--quiet",await this.getBackupStash(e)]),vn("Done dropping backup stash!")}catch(t){In(t,e)}}}const $n=s("lint-staged:groupFilesByConfig");function Bn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0;r<e.length;r++){var s=e[r];if("string"==typeof s)return s}}var Dn=r(5417),Mn=r(2361);const Fn=({quiet:e=!1}={})=>({hasPartiallyStagedFiles:null,shouldBackup:null,errors:new Set([]),events:new Mn,output:[],quiet:e}),Hn=e=>e.hasPartiallyStagedFiles,Gn=e=>!!e.shouldBackup&&(e.errors.has(yn)?Tr:e.errors.has(Sn)?vr:void 0),Nn=e=>e.errors.has(yn)?Tr:e.errors.has(Sn)?vr:void 0,Un=e=>e.shouldBackup&&(e.errors.has(Sn)||e.errors.has(pn)||e.errors.has(Cn)),jn=e=>{if(e.errors.has(yn)&&!e.errors.has(pn)&&!e.errors.has(Cn))return Tr},Kn=e=>e.shouldBackup,Wn=e=>!e.errors.has(yn)||e.errors.has(pn)||e.errors.has(Cn)?e.errors.has(wn)?Tr:void 0:Tr,Yn="lint-staged:taskError",zn=s("lint-staged:resolveTaskFn"),qn=({code:e,killed:t,signal:r})=>(t?"KILLED":r)||e||"FAILED",Vn=(e,t,r,s=!1)=>{const{stderr:n,stdout:i}=t;if(!!n||!!i){const t=s?M.redBright(`${mr} ${e}:`):`${gr} ${e}:`,o=[].concat(r.quiet?[]:["",t]).concat(n||[]).concat(i||[]);r.output.push(o.join("\n"))}else if(s){const s=qn(t),n=M.redBright(`\n${mr} ${e} failed without output (${s}).`);r.quiet||r.output.push(n)}},Qn=(e,t)=>{let r;const s=async()=>{r=(async e=>{try{const t=await Dn(e.pid);for(const e of t)try{process.kill(e)}catch(t){zn('Failed to kill process with pid "%d": %o',e,t)}}catch(t){zn('Failed to kill process with pid "%d": %o',e.pid,t)}e.kill()})(t),await r};return e.events.on(Yn,s,{once:!0}),async()=>{e.events.off(Yn,s),await r}},Xn=({command:e,cwd:t=process.cwd(),files:r,gitDir:s,isFn:n,shell:i=!1,verbose:o=!1})=>{const[a,...l]=function(e,t,r){var s,n=/([^\s'"]([^\s'"]*(['"])([^\3]*?)\3)+[^\s'"]*)|[^\s'"]+|(['"])([^\5]*?)\5/gi,i=e,o=[];t&&o.push(t),r&&o.push(r);do{null!==(s=n.exec(i))&&o.push(Bn(s[1],s[6],s[0]))}while(null!==s);return o}(e);zn("cmd:",a),zn("args:",l);const c={cwd:/^git(\.exe)?/i.test(a)?s:t,preferLocal:!0,reject:!1,shell:i};return zn("execaOptions:",c),async(t=Fn())=>{const s=i?Ws(n?e:`${e} ${r.join(" ")}`,c):Ns(a,n?l:l.concat(r),c),u=Qn(t,s),p=await s;if(await u(),p.failed||p.killed||null!=p.signal)throw((e,t,r)=>{r.errors.add(Sn),r.events.emit(Yn,Sn),Vn(e,t,r,!0);const s=qn(t);return new Error(`${M.redBright(e)} ${M.dim(`[${s}]`)}`)})(e,p,t);o&&Vn(e,p,t)}},Zn=s("lint-staged:makeCmdTasks"),Jn=async({commands:e,cwd:t,files:r,gitDir:s,shell:n,verbose:i})=>{Zn("Creating listr tasks for commands %o",e);const o=Array.isArray(e)?e:[e],a=[];for(const e of o){const o="function"==typeof e,l=o?await e(r):e,c=Array.isArray(l)?l:[l];for(const e of c){if(o&&"string"!=typeof e)throw new Error(br("[Function]","Function task should return a string or an array of strings",l));const c=Xn({command:e,cwd:t,files:r,gitDir:s,isFn:o,shell:n,verbose:i});a.push({title:e,command:e,task:c})}}return a},ei=s("lint-staged:resolveGitRepo"),ti=async(e=process.cwd())=>{try{ei("Resolving git repo from `%s`",e),ei("Unset GIT_DIR (was `%s`)",process.env.GIT_DIR),delete process.env.GIT_DIR,ei("Unset GIT_WORK_TREE (was `%s`)",process.env.GIT_WORK_TREE),delete process.env.GIT_WORK_TREE;const t=Lr(await qs(["rev-parse","--show-prefix"],{cwd:e})),r=((e,t)=>(t&&t.endsWith(kr.sep)&&(t=t.slice(0,-1)),Lr(t?e.substring(0,e.lastIndexOf(t)):e)))(Lr(e),t),s=Lr(await(async e=>{const t=Lr(await on.realpath(kr.join(e,".git")));if((await on.lstat(t)).isDirectory())return t;const r=(await ln(t)).toString();return kr.resolve(e,r.replace(/^gitdir: /,"")).trim()})(r));return ei("Resolved git directory to be `%s`",r),ei("Resolved git config directory to be `%s`",s),{gitDir:r,gitConfigDir:s}}catch(e){return ei("Failed to resolve git repo with error:",e),{error:e,gitDir:null,gitConfigDir:null}}};var ri=r(5138);const si=/(?<![\\$])({)(?:(?!(?<!\\),|\.\.|\{|\}).)*?(?<!\\)(})/g,ni=/{{[^}{]*}}/,ii=(e,t)=>{const r=(e=>{let t=`${e}`;const r=ni.exec(e)?.[0];if(r){const e=r.replace("{{","{").replace("}}","}");t=t.replace(r,e)}return t})((e=>{let t=`${e}`,r=null;for(;r=si.exec(e);){const e=r[0],s=e.replace(/{/,"").replace(/}/,"");t=t.replace(e,s)}return t})(e));var s,n;return r!==e&&t.warn((s=e,n=r,M.yellow(`${yr} Detected incorrect braces with only single value: \`${s}\`. Reformatted as: \`${n}\`\n`))),r},oi=s("lint-staged:validateConfig"),ai=e=>e&&"object"==typeof e&&!Array.isArray(e),li=new Map([["concurrent",e=>"boolean"==typeof e],["chunkSize",e=>"number"==typeof e],["globOptions",ai],["linters",ai],["ignore",e=>Array.isArray(e)],["subTaskConcurrency",e=>"number"==typeof e],["renderer",e=>"string"==typeof e],["relative",e=>"boolean"==typeof e]]),ci=(e,t,r)=>{if(oi("Validating config from `%s`...",t),!e||"object"!=typeof e&&"function"!=typeof e)throw hn;if("function"==typeof e)return{"*":e};if(0===Object.entries(e).length)throw fn;const s=[],i=Object.entries(e).reduce(((e,[t,n])=>{if(li.has(t)){return li.get(t)(n)&&s.push(br(t,"Advanced configuration has been deprecated.",n)),e}Array.isArray(n)&&!n.some((e=>"string"!=typeof e&&"function"!=typeof e))||"string"==typeof n||"function"==typeof n||s.push(br(t,"Should be a string, a function, or an array of strings and functions.",n));const i=ii(t,r);return{...e,[i]:n}}),{});if(s.length){const e=s.join("\n\n");throw r.error(`Could not parse lint-staged config.\n\n${e}\n\nSee https://github.com/okonet/lint-staged#configuration.`),new Error(e)}return oi("Validated config from `%s`:",t),oi((0,n.inspect)(e,{compact:!1})),i},ui=s("lint-staged:searchConfigs"),pi=["ls-files","-z","--full-name"],di=e=>e.filter((e=>ri.k.includes(kr.basename(e)))),hi=e=>e.split("/").length,fi=(e,t)=>hi(e)>hi(t)?-1:1,gi=async({configObject:e,configPath:t,cwd:r=process.cwd(),gitDir:s=r},n)=>{if(ui("Searching for configuration files..."),e)return ui("Using single direct configuration object..."),{"":ci(e,"config object",n)};if(t){ui("Using single configuration path...");const{config:e,filepath:r}=await(0,ri.M)({configPath:t},n);return e?{[t]:ci(e,r,n)}:{}}const[i,o]=await Promise.all([qs(pi,{cwd:s}).then(nn).then(di),qs([...pi,"--others","--exclude-standard"],{cwd:s}).then(nn).then(di)]),a=[...i,...o].map((e=>Lr(kr.join(s,e)))).filter((l=r,e=>e.startsWith(Lr(l)))).sort(fi);var l;ui("Found possible config files:",a);const c=a.reduce(((e,t)=>Object.assign(e,{[t]:null})),{});await Promise.all(Object.keys(c).map((e=>(0,ri.M)({configPath:e},n).then((({config:t,filepath:r})=>{t&&(e!==r&&ui('Config file "%s" resolved to "%s"',e,r),c[e]=ci(t,r,n))})))));const u=Object.entries(c).filter((([,e])=>!!e)).reduce(((e,[t,r])=>({...e,[t]:r})),{});if(!Object.keys(u).length){ui('Could not find config files inside "%s"',r);const{config:e,filepath:t}=await(0,ri.M)({cwd:r},n);e?(ui('Found parent configuration file from "%s"',t),u[t]=ci(e,t,n)):ui('Could not find parent configuration files from "%s"',r)}return ui("Found %d config files",Object.keys(u).length),u},mi=s("lint-staged:runAll"),yi=e=>Object.assign(new Error("lint-staged failed"),{ctx:e}),bi=async({allowEmpty:e=!1,concurrent:t=!0,configObject:r,configPath:s,cwd:n,debug:i=!1,diff:o,diffFilter:a,maxArgLength:l,quiet:c=!1,relative:u=!1,shell:p=!1,stash:d=void 0===o,verbose:h=!1},f=console)=>{mi("Running all linter scripts...");const g=!!n;n=g?kr.resolve(n):process.cwd(),mi("Using working directory `%s`",n);const m=Fn({quiet:c}),{gitDir:y,gitConfigDir:b}=await ti(n);if(!y)throw c||m.output.push(Er),m.errors.add(bn),yi(m);const E=await qs(["log","-1"],{cwd:y}).then((()=>!0)).catch((()=>!1));m.shouldBackup=E&&d,m.shouldBackup||f.warn(((e,t)=>{const r=void 0!==t?"`--diff` was used":e?"`--no-stash` was used":"there\u2019s no initial commit yet";return M.yellow(`${yr} Skipping backup because ${r}.\n`)})(E,o));const R=await(async({cwd:e=process.cwd(),diff:t,diffFilter:r}={})=>{try{const s=await qs(sn(t,r),{cwd:e});return s?nn(s).map((t=>Lr(kr.resolve(e,t)))):[]}catch{return null}})({cwd:y,diff:o,diffFilter:a});if(!R)throw c||m.output.push(Rr),m.errors.add(mn),yi(m);if(mi("Loaded list of staged files in git:\n%O",R),0===R.length)return c||m.output.push(wr),m;const A=await gi({configObject:r,configPath:s,cwd:n,gitDir:y},f),w=Object.keys(A).length;if(0===w)throw m.errors.add(dn),yi(m);const C=await(async({configs:e,files:t,singleConfigMode:r})=>{$n("Grouping %d files by %d configurations",t.length,Object.keys(e).length);const s=new Set(t),n={};for(const[i,o]of Object.entries(e)){if(r){n[i]={config:o,files:t};break}const e=kr.normalize(kr.dirname(i)),a=t=>{const r=kr.relative(e,t);return r&&!r.startsWith("..")&&!kr.isAbsolute(r)},l=Object.keys(o).some((e=>e.startsWith(".."))),c=new Set(l?s:void 0);l||s.forEach((e=>{a(e)&&c.add(e)})),c.forEach((e=>{s.delete(e)})),n[i]={config:o,files:Array.from(c)}}return n})({configs:A,files:R,singleConfigMode:r||void 0!==s}),S=w>1;let v=!1;const T={ctx:m,exitOnError:!1,registerSignalListeners:!1,...rn({debug:i,quiet:c},f)},O=[],x=new Set;for(const[e,{config:r,files:s}]of Object.entries(C)){const i=e?Lr(kr.relative(n,e)):"Config object",o=Pr({baseDir:y,files:s,maxArgLength:l,relative:u}),a=S&&!g?kr.dirname(e):n,c=o.length;c>1&&mi("Chunked staged files from `%s` into %d part",e,c);for(const[e,s]of o.entries()){const n=await Promise.all(Xs({config:r,cwd:a,files:s,relative:u}).map((e=>Jn({commands:e.commands,cwd:a,files:e.fileList,gitDir:y,shell:p,verbose:h}).then((t=>{e.fileList.forEach((e=>{const t=kr.isAbsolute(e)?e:Lr(kr.join(a,e));x.add(t)})),v=v||t.some((e=>"git add"===e.command));const r=e.fileList.length;return{title:`${e.pattern}${M.dim(` \u2014 ${r} ${1===r?"file":"files"}`)}`,task:async(e,r)=>r.newListr(t,{concurrent:!1,exitOnError:!0}),skip:()=>0===r&&`${e.pattern}${M.dim(" \u2014 no files")}`}})))));O.push({title:`${i}${M.dim(` \u2014 ${s.length} ${s.length>1?"files":"file"}`)}`+(c>1?M.dim(` (chunk ${e+1}/${c})...`):""),task:(e,r)=>r.newListr(n,{concurrent:t,exitOnError:!0}),skip:()=>m.errors.has(yn)?"Skipped because of previous git error.":!!n.every((e=>e.skip()))&&`${i}${M.dim(" \u2014 no tasks to run")}`})}}if(v&&f.warn(Sr),O.every((e=>e.skip())))return c||m.output.push(Cr),m;const _=Pr({baseDir:n,files:Array.from(x),maxArgLength:l,relative:!1}),k=new Pn({allowEmpty:e,gitConfigDir:b,gitDir:y,matchedFileChunks:_,diff:o,diffFilter:a}),L=new hr([{title:"Preparing lint-staged...",task:e=>k.prepare(e)},{title:"Hiding unstaged changes to partially staged files...",task:e=>k.hideUnstagedChanges(e),enabled:Hn},{title:"Running tasks for staged files...",task:(e,r)=>r.newListr(O,{concurrent:t}),skip:()=>O.every((e=>e.skip()))},{title:"Applying modifications from tasks...",task:e=>k.applyModifications(e),skip:Gn},{title:"Restoring unstaged changes to partially staged files...",task:e=>k.restoreUnstagedChanges(e),enabled:Hn,skip:Nn},{title:"Reverting to original state because of errors...",task:e=>k.restoreOriginalState(e),enabled:Un,skip:jn},{title:"Cleaning up temporary files...",task:e=>k.cleanup(e),enabled:Kn,skip:Wn}],T);if(await L.run(),m.errors.size>0)throw yi(m);return m},Ei=s("lint-staged:validateOptions"),Ri=s("lint-staged"),Ai=()=>{switch(process.platform){case"darwin":return 262144;case"win32":return 8191;default:return 131072}},wi=async({allowEmpty:e=!1,concurrent:t=!0,config:r,configPath:s,cwd:n,debug:i=!1,diff:o,diffFilter:a,maxArgLength:l=Ai()/2,quiet:c=!1,relative:u=!1,shell:p=!1,stash:d=void 0===o,verbose:h=!1}={},f=console)=>{await(async(e={},t)=>{if(Ei("Validating options..."),"string"==typeof e.cwd)try{const t=kr.resolve(e.cwd);await on.access(t,cs.constants.F_OK)}catch(r){throw t.error(Or("cwd",e.cwd,r.message)),Rn}if("string"==typeof e.shell)try{await on.access(e.shell,cs.constants.X_OK)}catch(r){throw t.error(Or("shell",e.shell,r.message)),Rn}Ei("Validated options!")})({cwd:n,shell:p},f),Ri("Unset GIT_LITERAL_PATHSPECS (was `%s`)",process.env.GIT_LITERAL_PATHSPECS),delete process.env.GIT_LITERAL_PATHSPECS;const g={allowEmpty:e,concurrent:t,configObject:r,configPath:s,cwd:n,debug:i,diff:o,diffFilter:a,maxArgLength:l,quiet:c,relative:u,shell:p,stash:d,verbose:h};try{const e=await bi(g,f);return Ri("Tasks were executed successfully!"),_r(e,f),!0}catch(e){if(e?.ctx?.errors){const{ctx:t}=e;return t.errors.has(dn)?f.error(Ar):t.errors.has(pn)?f.warn(xr):t.errors.has(yn)&&!t.errors.has(gn)&&(f.error(Tr),t.shouldBackup&&f.error(" Any lost modifications can be restored from a git stash:\n\n > git stash list\n stash@{0}: automatic lint-staged backup\n > git stash apply --index stash@{0}\n")),_r(t,f),!1}throw e}}}};
|