UNPKG

@nice-move/cli

Version:
7 lines 135 kB
import{__commonJSMin as e,__require as t,__toESM as n}from"./chunk-CYNyJ7h0.mjs";import{pathKey as r,require_cross_spawn as i}from"./path-key-DNlqev5T.mjs";import{onExit as a}from"./mjs-D7OvYRUm.mjs";import{source_default as o}from"./source-DtPIOlG2.mjs";import{fileURLToPath as s}from"node:url";import c,{ChildProcess as l}from"node:child_process";import{debuglog as u,inspect as d}from"node:util";import f from"node:process";import p from"node:path";import{setTimeout as m}from"node:timers/promises";import h,{EOL as g,constants as _}from"node:os";import{constants as v,createReadStream as y,createWriteStream as b,readFileSync as x}from"node:fs";import{Writable as S}from"node:stream";import{Buffer as C}from"node:buffer";import w from"node:fs/promises";import{Writable as T}from"stream";import*as E from"tty";import{format as D}from"util";import{EOL as O}from"os";import{StringDecoder as k}from"string_decoder";import{randomUUID as A}from"crypto";import ee from"events";var j=e((exports,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t=t||{};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\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(t){var c=parseFloat(t[1]),l=(t[2]||`ms`).toLowerCase();switch(l){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}}),M=e((exports,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=j(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date),a=i-(t||i);r.diff=a,r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;o++;let a=n.formatters[i];if(typeof a==`function`){let n=e[o];t=a.call(r,n),e.splice(o,1),o--}return t}),n.formatArgs.call(r,e);let c=r.log||n.log;c.apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,`enabled`,{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n}),N=e((exports,t)=>{exports.formatArgs=r,exports.save=i,exports.load=a,exports.useColors=n,exports.storage=o(),exports.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`."))}})(),exports.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`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}exports.log=console.debug||console.log||(()=>{});function i(t){try{t?exports.storage.setItem(`debug`,t):exports.storage.removeItem(`debug`)}catch(e){}}function a(){let t;try{t=exports.storage.getItem(`debug`)||exports.storage.getItem(`DEBUG`)}catch(e){}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch(e){}}t.exports=M()(exports);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}}),te=e((exports,t)=>{t.exports=(e,t)=>{t=t||process.argv;let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1?!0:r<i)}}),P=e((exports,n)=>{let r=t(`os`),i=te(),a=process.env,o;i(`no-color`)||i(`no-colors`)||i(`color=false`)?o=!1:(i(`color`)||i(`colors`)||i(`color=true`)||i(`color=always`))&&(o=!0),`FORCE_COLOR`in a&&(o=a.FORCE_COLOR.length===0||parseInt(a.FORCE_COLOR,10)!==0);function s(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function c(e){if(o===!1)return 0;if(i(`color=16m`)||i(`color=full`)||i(`color=truecolor`))return 3;if(i(`color=256`))return 2;if(e&&!e.isTTY&&o!==!0)return 0;let t=o?1:0;if(process.platform===`win32`){let e=r.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 a)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`].some(e=>e in a)||a.CI_NAME===`codeship`?1:t;if(`TEAMCITY_VERSION`in a)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION)?1:0;if(a.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in a){let e=parseInt((a.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(a.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(a.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)||`COLORTERM`in a?1:(a.TERM,t)}function l(e){let t=c(e);return s(t)}n.exports={supportsColor:l,stdout:l(process.stdout),stderr:l(process.stderr)}}),F=e((exports,n)=>{let r=t(`tty`),i=t(`util`);exports.init=d,exports.log=c,exports.formatArgs=o,exports.save=l,exports.load=u,exports.useColors=a,exports.destroy=i.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),exports.colors=[6,2,3,4,5,1];try{let t=P();t&&(t.stderr||t).level>=2&&(exports.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){}exports.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function a(){return`colors`in exports.inspectOpts?!!exports.inspectOpts.colors:r.isatty(process.stderr.fd)}function o(e){let{namespace:t,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${t} \u001B[0m`;e[0]=a+e[0].split(` `).join(` `+a),e.push(i+`m+`+n.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=s()+t+` `+e[0]}function s(){return exports.inspectOpts.hideDate?``:new Date().toISOString()+` `}function c(...t){return process.stderr.write(i.formatWithOptions(exports.inspectOpts,...t)+` `)}function l(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function u(){return process.env.DEBUG}function d(t){t.inspectOpts={};let n=Object.keys(exports.inspectOpts);for(let r=0;r<n.length;r++)t.inspectOpts[n[r]]=exports.inspectOpts[n[r]]}n.exports=M()(exports);let{formatters:f}=n.exports;f.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split(` `).map(e=>e.trim()).join(` `)},f.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}}),I=e((exports,t)=>{typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?t.exports=N():t.exports=F()});function L(e){let t=typeof e==`string`?` `:10,n=typeof e==`string`?`\r`:13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}const R=({cwd:e=f.cwd(),path:t=f.env[r()],preferLocal:n=!0,execPath:i=f.execPath,addExecPath:a=!0}={})=>{let o=e instanceof URL?s(e):e,c=p.resolve(o),l=[];return n&&z(l,c),a&&B(l,i,c),[...l,t].join(p.delimiter)},z=(e,t)=>{let n;for(;n!==t;)e.push(p.join(t,`node_modules/.bin`)),n=t,t=p.resolve(t,`..`)},B=(e,t,n)=>{let r=t instanceof URL?s(t):t;e.push(p.resolve(n,r,`..`))},V=({env:e=f.env,...t}={})=>{e={...e};let n=r({env:e});return t.path=e[n],e[n]=R(t),e},H=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);!U(i,a)&&r||Object.defineProperty(e,n,a)},U=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},W=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},G=(e,t)=>`/* Wrapped ${e}*/\n${t}`,ne=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),re=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),K=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=G.bind(null,r,t.toString());Object.defineProperty(i,`name`,re),Object.defineProperty(e,`toString`,{...ne,value:i})};function ie(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))H(e,t,r,n);return W(e,t),K(e,t,r),e}const q=new WeakMap,ae=(e,t={})=>{if(typeof e!=`function`)throw TypeError(`Expected a function`);let n,r=0,i=e.displayName||e.name||`<anonymous>`,a=function(...o){if(q.set(a,++r),r===1)n=e.apply(this,o),e=null;else if(t.throw===!0)throw Error(`Function \`${i}\` can only be called once`);return n};return ie(a,e),q.set(a,r),a};ae.callCount=e=>{if(!q.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return q.get(e)};var oe=ae;const se=()=>{let e=ue-le+1;return Array.from({length:e},ce)},ce=(e,t)=>({name:`SIGRT${t+1}`,number:le+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),le=34,ue=64,de=[{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`}],fe=()=>{let e=se(),t=[...de,...e].map(pe);return t},pe=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=_,s=o!==void 0,c=s?o:t;return{name:e,number:c,description:n,supported:s,action:r,forced:i,standard:a}},me=()=>{let e=fe();return Object.fromEntries(e.map(he))},he=({name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o}],ge=me(),_e=()=>{let e=fe(),t=ue+1,n=Array.from({length:t},(t,n)=>ve(n,e));return Object.assign({},...n)},ve=(e,t)=>{let n=ye(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:o,forced:s,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:c}}},ye=(e,t)=>{let n=t.find(({name:t})=>_.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n},be=_e(),xe=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:a,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?`was canceled`:n===void 0?r===void 0?a===void 0?`failed`:`failed with exit code ${a}`:`was killed with ${r} (${i})`:`failed with ${n}`,Se=({stdout:e,stderr:t,all:n,error:r,signal:i,exitCode:a,command:o,escapedCommand:s,timedOut:c,isCanceled:l,killed:u,parsed:{options:{timeout:d,cwd:p=f.cwd()}}})=>{a=a===null?void 0:a,i=i===null?void 0:i;let m=i===void 0?void 0:ge[i].description,h=r&&r.code,g=xe({timedOut:c,timeout:d,errorCode:h,signal:i,signalDescription:m,exitCode:a,isCanceled:l}),_=`Command ${g}: ${o}`,v=Object.prototype.toString.call(r)===`[object Error]`,y=v?`${_}\n${r.message}`:_,b=[y,t,e].filter(Boolean).join(` `);return v?(r.originalMessage=r.message,r.message=b):r=Error(b),r.shortMessage=y,r.command=o,r.escapedCommand=s,r.exitCode=a,r.signal=i,r.signalDescription=m,r.stdout=e,r.stderr=t,r.cwd=p,n!==void 0&&(r.all=n),`bufferedData`in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!c,r.isCanceled=l,r.killed=u&&!c,r},Ce=[`stdin`,`stdout`,`stderr`],we=e=>Ce.some(t=>e[t]!==void 0),Te=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return Ce.map(t=>e[t]);if(we(e))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${Ce.map(e=>`\`${e}\``).join(`, `)}`);if(typeof t==`string`)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let n=Math.max(t.length,Ce.length);return Array.from({length:n},(e,n)=>t[n])},Ee=1e3*5,De=(e,t=`SIGTERM`,n={})=>{let r=e(t);return Oe(e,t,n,r),r},Oe=(e,t,n,r)=>{if(!ke(t,n,r))return;let i=je(n),a=setTimeout(()=>{e(`SIGKILL`)},i);a.unref&&a.unref()},ke=(e,{forceKillAfterTimeout:t},n)=>Ae(e)&&t!==!1&&n,Ae=e=>e===h.constants.signals.SIGTERM||typeof e==`string`&&e.toUpperCase()===`SIGTERM`,je=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Ee;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Me=(e,t)=>{let n=e.kill();n&&(t.isCanceled=!0)},Ne=(e,t,n)=>{e.kill(t),n(Object.assign(Error(`Timed out`),{timedOut:!0,signal:t}))},Pe=(e,{timeout:t,killSignal:n=`SIGTERM`},r)=>{if(t===0||t===void 0)return r;let i,a=new Promise((r,a)=>{i=setTimeout(()=>{Ne(e,n,a)},t)}),o=r.finally(()=>{clearTimeout(i)});return Promise.race([a,o])},Fe=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Ie=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;let i=a(()=>{e.kill()});return r.finally(()=>{i()})};function Le(e){return typeof e==`object`&&!!e&&typeof e.pipe==`function`}function Re(e){return Le(e)&&e.writable!==!1&&typeof e._write==`function`&&typeof e._writableState==`object`}const ze=e=>e instanceof l&&typeof e.then==`function`,Be=(e,t,n)=>{if(typeof n==`string`)return e[t].pipe(b(n)),e;if(Re(n))return e[t].pipe(n),e;if(!ze(n))throw TypeError(`The second argument must be a string, a stream or an Execa child process.`);if(!Re(n.stdin))throw TypeError(`The target child process's stdin must be available.`);return e[t].pipe(n.stdin),n},Ve=e=>{e.stdout!==null&&(e.pipeStdout=Be.bind(void 0,e,`stdout`)),e.stderr!==null&&(e.pipeStderr=Be.bind(void 0,e,`stderr`)),e.all!==void 0&&(e.pipeAll=Be.bind(void 0,e,`all`))},He=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{if(!Ke(e))throw Error(`The first argument must be a Readable, a ReadableStream, or an async iterable.`);let l=t();l.length=0;try{for await(let t of e){let e=qe(t),o=n[e](t,l);We({convertedChunk:o,state:l,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c})}return Ue({state:l,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,maxBuffer:c}),s(l)}catch(e){throw e.bufferedData=s(l),e}},Ue=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&We({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},We=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){Ge(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&Ge(c,t,i,a),new Ye},Ge=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},Ke=e=>typeof e==`object`&&!!e&&typeof e[Symbol.asyncIterator]==`function`,qe=e=>{let t=typeof e;if(t===`string`)return`string`;if(t!==`object`||e===null)return`others`;if(globalThis.Buffer?.isBuffer(e))return`buffer`;let n=Je.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Je.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:Je}=Object.prototype;var Ye=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const Xe=e=>e,Ze=()=>void 0,Qe=({contents:e})=>e,$e=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},et=e=>e.length;async function tt(e,t){return He(e,ht,t)}const nt=()=>({contents:new ArrayBuffer(0)}),rt=e=>it.encode(e),it=new TextEncoder,at=e=>new Uint8Array(e),ot=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),st=(e,t)=>e.slice(0,t),ct=(e,{contents:t,length:n},r)=>{let i=mt()?ut(t,r):lt(t,r);return new Uint8Array(i).set(e,n),i},lt=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(dt(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},ut=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:dt(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},dt=e=>ft**Math.ceil(Math.log(e)/Math.log(ft)),ft=2,pt=({contents:e,length:t})=>mt()?e:e.slice(0,t),mt=()=>`resize`in ArrayBuffer.prototype,ht={init:nt,convertChunk:{string:rt,buffer:at,arrayBuffer:at,dataView:ot,typedArray:ot,others:$e},getSize:et,truncateChunk:st,addChunk:ct,getFinalChunk:Ze,finalize:pt};async function gt(e,t){if(!(`Buffer`in globalThis))throw Error(`getStreamAsBuffer() is only supported in Node.js`);try{return _t(await tt(e,t))}catch(e){throw e.bufferedData!==void 0&&(e.bufferedData=_t(e.bufferedData)),e}}const _t=e=>globalThis.Buffer.from(e);async function vt(e,t){return He(e,wt,t)}const yt=()=>({contents:``,textDecoder:new TextDecoder}),bt=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),xt=(e,{contents:t})=>t+e,St=(e,t)=>e.slice(0,t),Ct=({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},wt={init:yt,convertChunk:{string:Xe,buffer:bt,arrayBuffer:bt,dataView:bt,typedArray:bt,others:$e},getSize:et,truncateChunk:St,addChunk:xt,getFinalChunk:Ct,finalize:Qe};var Tt=e((exports,n)=>{let{PassThrough:r}=t(`stream`);n.exports=function(){var e=[],t=new r({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=i,t.on(`unpipe`,a),Array.prototype.slice.call(arguments).forEach(n),t;function n(r){return Array.isArray(r)?(r.forEach(n),this):(e.push(r),r.once(`end`,a.bind(null,r)),r.once(`error`,t.emit.bind(t,`error`)),r.pipe(t,{end:!1}),this)}function i(){return e.length==0}function a(n){e=e.filter(function(e){return e!==n}),!e.length&&t.readable&&t.end()}}}),Et=n(Tt(),1);const Dt=e=>{if(e!==void 0)throw TypeError("The `input` and `inputFile` options cannot be both set.")},Ot=({input:e,inputFile:t})=>typeof t==`string`?(Dt(e),x(t)):e,kt=e=>{let t=Ot(e);if(Le(t))throw TypeError("The `input` option cannot be a stream in sync mode");return t},At=({input:e,inputFile:t})=>typeof t==`string`?(Dt(e),y(t)):e,jt=(e,t)=>{let n=At(t);n!==void 0&&(Le(n)?n.pipe(e.stdin):e.stdin.end(n))},Mt=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let n=(0,Et.default)();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},Nt=async(e,t)=>{if(!(!e||t===void 0)){await m(0),e.destroy();try{return await t}catch(e){return e.bufferedData}}},Pt=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t===`utf8`||t===`utf-8`?vt(e,{maxBuffer:r}):t===null||t===`buffer`?gt(e,{maxBuffer:r}):Ft(e,r,t)},Ft=async(e,t,n)=>{let r=await gt(e,{maxBuffer:t});return r.toString(n)},It=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:a},o)=>{let s=Pt(e,{encoding:r,buffer:i,maxBuffer:a}),c=Pt(t,{encoding:r,buffer:i,maxBuffer:a}),l=Pt(n,{encoding:r,buffer:i,maxBuffer:a*2});try{return await Promise.all([o,s,c,l])}catch(r){return Promise.all([{error:r,signal:r.signal,timedOut:r.timedOut},Nt(e,s),Nt(t,c),Nt(n,l)])}},Lt=(async()=>{})().constructor.prototype,Rt=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(Lt,e)]),zt=(e,t)=>{for(let[n,r]of Rt){let i=typeof t==`function`?(...e)=>Reflect.apply(r.value,t(),e):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},Bt=e=>new Promise((t,n)=>{e.on(`exit`,(e,n)=>{t({exitCode:e,signal:n})}),e.on(`error`,e=>{n(e)}),e.stdin&&e.stdin.on(`error`,e=>{n(e)})}),Vt=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Ht=/^[\w.-]+$/,Ut=e=>typeof e!=`string`||Ht.test(e)?e:`"${e.replaceAll(`"`,`\\"`)}"`,Wt=(e,t)=>Vt(e,t).join(` `),Gt=(e,t)=>Vt(e,t).map(e=>Ut(e)).join(` `),Kt=/ +/g,qt=e=>{let t=[];for(let n of e.trim().split(Kt)){let e=t.at(-1);e&&e.endsWith(`\\`)?t[t.length-1]=`${e.slice(0,-1)} ${n}`:t.push(n)}return t},Jt=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(t===`object`&&e!==null&&!(e instanceof l)&&`stdout`in e){let t=typeof e.stdout;if(t===`string`)return e.stdout;if(C.isBuffer(e.stdout))return e.stdout.toString();throw TypeError(`Unexpected "${t}" stdout in template expression`)}throw TypeError(`Unexpected "${t}" in template expression`)},Yt=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Xt=({templates:e,expressions:t,tokens:n,index:r,template:i})=>{let a=i??e.raw[r],o=a.split(Kt).filter(Boolean),s=Yt(n,o,a.startsWith(` `));if(r===t.length)return s;let c=t[r],l=Array.isArray(c)?c.map(e=>Jt(e)):[Jt(c)];return Yt(s,l,a.endsWith(` `))},Zt=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=Xt({templates:e,expressions:t,tokens:n,index:r,template:i});return n},Qt=u(`execa`).enabled,$t=(e,t)=>String(e).padStart(t,`0`),en=()=>{let e=new Date;return`${$t(e.getHours(),2)}:${$t(e.getMinutes(),2)}:${$t(e.getSeconds(),2)}.${$t(e.getMilliseconds(),3)}`},tn=(e,{verbose:t})=>{t&&f.stderr.write(`[${en()}] ${e}\n`)};var nn=n(i(),1);const rn=1e3*1e3*100,an=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{let a=t?{...f.env,...e}:e;return n?V({env:a,cwd:r,execPath:i}):a},on=(e,t,n={})=>{let r=nn.default._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:rn,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||f.cwd(),execPath:f.execPath,encoding:`utf8`,reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Qt,...n},n.env=an(n),n.stdio=Te(n),f.platform===`win32`&&p.basename(e,`.exe`)===`cmd`&&t.unshift(`/q`),{file:e,args:t,options:n,parsed:r}},sn=(e,t,n)=>typeof t!=`string`&&!C.isBuffer(t)?n===void 0?void 0:``:e.stripFinalNewline?L(t):t;function cn(e,t,n){let r=on(e,t,n),i=Wt(e,t),a=Gt(e,t);tn(a,r.options),Fe(r.options);let o;try{o=c.spawn(r.file,r.args,r.options)}catch(e){let t=new c.ChildProcess,n=Promise.reject(Se({error:e,stdout:``,stderr:``,all:``,command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return zt(t,n),t}let s=Bt(o),l=Pe(o,r.options,s),u=Ie(o,r.options,l),d={isCanceled:!1};o.kill=De.bind(null,o.kill.bind(o)),o.cancel=Me.bind(null,o,d);let f=async()=>{let[{error:e,exitCode:t,signal:n,timedOut:s},c,l,f]=await It(o,r.options,u),p=sn(r.options,c),m=sn(r.options,l),h=sn(r.options,f);if(e||t!==0||n!==null){let c=Se({error:e,exitCode:t,signal:n,stdout:p,stderr:m,all:h,command:i,escapedCommand:a,parsed:r,timedOut:s,isCanceled:d.isCanceled||(r.options.signal?r.options.signal.aborted:!1),killed:o.killed});if(!r.options.reject)return c;throw c}return{command:i,escapedCommand:a,exitCode:0,stdout:p,stderr:m,all:h,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},p=oe(f);return jt(o,r.options),o.all=Mt(o,r.options),Ve(o),zt(o,p),o}function ln(e,t,n){let r=on(e,t,n),i=Wt(e,t),a=Gt(e,t);tn(a,r.options);let o=kt(r.options),s;try{s=c.spawnSync(r.file,r.args,{...r.options,input:o})}catch(e){throw Se({error:e,stdout:``,stderr:``,all:``,command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let l=sn(r.options,s.stdout,s.error),u=sn(r.options,s.stderr,s.error);if(s.error||s.status!==0||s.signal!==null){let e=Se({stdout:l,stderr:u,error:s.error,signal:s.signal,exitCode:s.status,command:i,escapedCommand:a,parsed:r,timedOut:s.error&&s.error.code===`ETIMEDOUT`,isCanceled:!1,killed:s.signal!==null});if(!r.options.reject)return e;throw e}return{command:i,escapedCommand:a,exitCode:0,stdout:l,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}const un=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},dn=(e={})=>({preferLocal:!0,...un(e),...e});function fn(e){function t(t,...n){if(!Array.isArray(t))return fn({...e,...t});let[r,...i]=Zt(t,n);return cn(r,i,dn(e))}return t.sync=(t,...n)=>{if(!Array.isArray(t))throw TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[r,...i]=Zt(t,n);return ln(r,i,dn(e))},t}const pn=fn();function mn(e,t){let[n,...r]=qt(e);return cn(n,r,t)}var hn=n(I(),1);const gn=(0,hn.default)(`lint-staged:execGit`),_n=[`-c`,`submodule.recurse=false`],vn=[..._n],yn=async(e,t={})=>{gn(`Running git command`,e);try{let{stdout:n}=await cn(`git`,vn.concat(e),{...t,all:!0,cwd:t.cwd||process.cwd(),stdin:`ignore`});return n}catch({all:e}){throw Error(e)}};var bn=e((exports,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}),xn=n(bn(),1),Sn=xn.default;const{env:Cn={},argv:wn=[],platform:Tn=``}=typeof process>`u`?{}:process,En=`NO_COLOR`in Cn||wn.includes(`--no-color`),Dn=`FORCE_COLOR`in Cn||wn.includes(`--color`),On=Tn===`win32`,kn=Cn.TERM===`dumb`,An=E&&E.isatty&&E.isatty(1)&&Cn.TERM&&!kn,jn=`CI`in Cn&&(`GITHUB_ACTIONS`in Cn||`GITLAB_CI`in Cn||`CIRCLECI`in Cn),Mn=!En&&(Dn||On&&!kn||An||jn),Nn=(e,t,n,r,i=t.substring(0,e)+r,a=t.substring(e+n.length),o=a.indexOf(n))=>i+(o<0?a:Nn(o,a,n,r)),Pn=(e,t,n,r,i)=>e<0?n+t+r:n+Nn(e,t,r,i)+r,Fn=(e,t,n=e,r=e.length+1)=>i=>i||!(i===``||i===void 0)?Pn((``+i).indexOf(t,r),i,e,t,n):``,J=(e,t,n)=>Fn(`\x1b[${e}m`,`\x1b[${t}m`,n),In={reset:J(0,0),bold:J(1,22,`\x1B[22m\x1B[1m`),dim:J(2,22,`\x1B[22m\x1B[2m`),italic:J(3,23),underline:J(4,24),inverse:J(7,27),hidden:J(8,28),strikethrough:J(9,29),black:J(30,39),red:J(31,39),green:J(32,39),yellow:J(33,39),blue:J(34,39),magenta:J(35,39),cyan:J(36,39),white:J(37,39),gray:J(90,39),bgBlack:J(40,49),bgRed:J(41,49),bgGreen:J(42,49),bgYellow:J(43,49),bgBlue:J(44,49),bgMagenta:J(45,49),bgCyan:J(46,49),bgWhite:J(47,49),blackBright:J(90,39),redBright:J(91,39),greenBright:J(92,39),yellowBright:J(93,39),blueBright:J(94,39),magentaBright:J(95,39),cyanBright:J(96,39),whiteBright:J(97,39),bgBlackBright:J(100,49),bgRedBright:J(101,49),bgGreenBright:J(102,49),bgYellowBright:J(103,49),bgBlueBright:J(104,49),bgMagentaBright:J(105,49),bgCyanBright:J(106,49),bgWhiteBright:J(107,49)},Ln=({useColor:e=Mn}={})=>e?In:Object.keys(In).reduce((e,t)=>({...e,[t]:String}),{}),{reset:Rn,bold:zn,dim:Bn,italic:Vn,underline:Hn,inverse:Un,hidden:Wn,strikethrough:Gn,black:Kn,red:qn,green:Jn,yellow:Yn,blue:Xn,magenta:Zn,cyan:Qn,white:$n,gray:er,bgBlack:tr,bgRed:nr,bgGreen:rr,bgYellow:ir,bgBlue:ar,bgMagenta:or,bgCyan:sr,bgWhite:cr,blackBright:lr,redBright:ur,greenBright:dr,yellowBright:fr,blueBright:pr,magentaBright:mr,cyanBright:hr,whiteBright:gr,bgBlackBright:_r,bgRedBright:vr,bgGreenBright:yr,bgYellowBright:br,bgBlueBright:xr,bgMagentaBright:Sr,bgCyanBright:Cr,bgWhiteBright:wr}=Ln();var Tr=e((exports,t)=>{t.exports=r;function n(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function r(e){if(e=e||{},e.circles)return i(e);let t=new Map;if(t.set(Date,e=>new Date(e)),t.set(Map,(e,t)=>new Map(a(Array.from(e),t))),t.set(Set,(e,t)=>new Set(a(Array.from(e),t))),e.constructorHandlers)for(let n of e.constructorHandlers)t.set(n[0],n[1]);let r=null;return e.proto?s:o;function a(e,i){let a=Object.keys(e),o=Array(a.length);for(let s=0;s<a.length;s++){let c=a[s],l=e[c];typeof l!=`object`||!l?o[c]=l:l.constructor!==Object&&(r=t.get(l.constructor))?o[c]=r(l,i):ArrayBuffer.isView(l)?o[c]=n(l):o[c]=i(l)}return o}function o(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return a(e,o);if(e.constructor!==Object&&(r=t.get(e.constructor)))return r(e,o);let i={};for(let a in e){if(Object.hasOwnProperty.call(e,a)===!1)continue;let s=e[a];typeof s!=`object`||!s?i[a]=s:s.constructor!==Object&&(r=t.get(s.constructor))?i[a]=r(s,o):ArrayBuffer.isView(s)?i[a]=n(s):i[a]=o(s)}return i}function s(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return a(e,s);if(e.constructor!==Object&&(r=t.get(e.constructor)))return r(e,s);let i={};for(let a in e){let o=e[a];typeof o!=`object`||!o?i[a]=o:o.constructor!==Object&&(r=t.get(o.constructor))?i[a]=r(o,s):ArrayBuffer.isView(o)?i[a]=n(o):i[a]=s(o)}return i}}function i(e){let t=[],r=[],i=new Map;if(i.set(Date,e=>new Date(e)),i.set(Map,(e,t)=>new Map(o(Array.from(e),t))),i.set(Set,(e,t)=>new Set(o(Array.from(e),t))),e.constructorHandlers)for(let t of e.constructorHandlers)i.set(t[0],t[1]);let a=null;return e.proto?c:s;function o(e,o){let s=Object.keys(e),c=Array(s.length);for(let l=0;l<s.length;l++){let u=s[l],d=e[u];if(typeof d!=`object`||!d)c[u]=d;else if(d.constructor!==Object&&(a=i.get(d.constructor)))c[u]=a(d,o);else if(ArrayBuffer.isView(d))c[u]=n(d);else{let e=t.indexOf(d);e===-1?c[u]=o(d):c[u]=r[e]}}return c}function s(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return o(e,s);if(e.constructor!==Object&&(a=i.get(e.constructor)))return a(e,s);let c={};for(let o in t.push(e),r.push(c),e){if(Object.hasOwnProperty.call(e,o)===!1)continue;let l=e[o];if(typeof l!=`object`||!l)c[o]=l;else if(l.constructor!==Object&&(a=i.get(l.constructor)))c[o]=a(l,s);else if(ArrayBuffer.isView(l))c[o]=n(l);else{let e=t.indexOf(l);e===-1?c[o]=s(l):c[o]=r[e]}}return t.pop(),r.pop(),c}function c(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return o(e,c);if(e.constructor!==Object&&(a=i.get(e.constructor)))return a(e,c);let s={};for(let o in t.push(e),r.push(s),e){let l=e[o];if(typeof l!=`object`||!l)s[o]=l;else if(l.constructor!==Object&&(a=i.get(l.constructor)))s[o]=a(l,c);else if(ArrayBuffer.isView(l))s[o]=n(l);else{let e=t.indexOf(l);e===-1?s[o]=c(l):s[o]=r[e]}}return t.pop(),r.pop(),s}}}),Er=n(Tr(),1),Dr=Object.defineProperty,Y=(e,t)=>Dr(e,`name`,{value:t,configurable:!0}),Or=`\x1B[`,kr={CURSOR_HIDE:Or+`?25l`,CURSOR_SHOW:Or+`?25h`},Ar=(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.PROMPT_FAILED=`PROMPT_FAILED`,e))(Ar||{}),jr=class{static{Y(this,`EventManager`)}emitter=new Sn;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()}},Mr=class{static{Y(this,`BaseEventMap`)}};function Nr(e){return!!e&&typeof e==`object`&&typeof e.subscribe==`function`}Y(Nr,`isObservable`);function Pr(e){return!!e&&typeof e==`object`&&e.readable===!0&&typeof e.read==`function`&&typeof e.on==`function`}Y(Pr,`isReadable`);function Fr(){return!!process.env.LISTR_FORCE_UNICODE||process.platform!==`win32`||!!process.env.CI||!!process.env.WT_SESSION||process.env.TERM_PROGRAM===`vscode`||process.env.TERM===`xterm-256color`||process.env.TERM===`alacritty`}Y(Fr,`isUnicodeSupported`);var Ir=`(?:\\u001b|\\u009b)\\[[\\=><~/#&.:=?%@~_-]*[0-9]*[\\a-ln-tqyz=><~/#&.:=?%@~_-]+`,Lr=/\u0007/;function Rr(e){return String(e).replace(new RegExp(Ir,`gmi`),``).replace(new RegExp(Lr,`gmi`),``).trim()}Y(Rr,`cleanseAnsi`);var X=Ln();function zr(e,t){return e.replace(/^(?!\s*$)/gm,` `.repeat(t))}Y(zr,`indent`);var Br={warning:`⚠`,cross:`✖`,arrowDown:`↓`,tick:`✔`,arrowRight:`→`,pointer:`❯`,checkboxOn:`☒`,arrowLeft:`←`,squareSmallFilled:`◼`,pointerSmall:`›`},Vr={...Br,warning:`‼`,cross:`×`,tick:`√`,pointer:`>`,checkboxOn:`[×]`,squareSmallFilled:`■`},Z=Fr()?Br:Vr;function Hr(e,...t){return D(String(e),...t)}Y(Hr,`splat`);var Ur={icon:{STARTED:Z.pointer,FAILED:Z.cross,SKIPPED:Z.arrowDown,COMPLETED:Z.tick,OUTPUT:Z.pointerSmall,TITLE:Z.arrowRight,RETRY:Z.warning,ROLLBACK:Z.arrowLeft,PAUSED:Z.squareSmallFilled},color:{STARTED:X.yellow,FAILED:X.red,SKIPPED:X.yellow,COMPLETED:X.green,RETRY:X.yellowBright,ROLLBACK:X.redBright,PAUSED:X.yellowBright}},Wr=[`RETRY`,`ROLLBACK`,`FAILED`],Gr=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 Jr}static{Y(this,`ListrLogger`)}process;log(e,t,n){let r=this.format(e,t,n);if(this.options.toStderr.includes(e)){this.process.toStderr(r);return}this.process.toStdout(r)}toStdout(e,t,n=!0){this.process.toStdout(this.format(null,e,t),n)}toStderr(e,t,n=!0){this.process.toStderr(this.format(null,e,t),n)}wrap(e,t){return e&&this.applyFormat(`[${e}]`,t)}splat(...e){let t=e.shift()??``;return e.length===0?t:Hr(t,e)}suffix(e,...t){return t.filter(Boolean).forEach(t=>{if(e+=this.spacing(e),typeof t==`string`)e+=this.wrap(t);else if(typeof t==`object`){if(t.args??=[],typeof t.condition==`function`?!t.condition(...t.args):!(t.condition??!0))return e;e+=this.wrap(typeof t.field==`function`?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,typeof t==`string`)e=this.wrap(t)+e;else if(typeof t==`object`){if(t.args??=[],typeof t.condition==`function`?!t.condition(...t.args):!(t.condition??!0))return e;e=this.wrap(typeof t.field==`function`?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;if(!t){let n=this.options.icon?.[e];t=typeof n==`function`?n():n}let n=this.options.color?.[e];return t&&n&&(t=n(t)),t}format(e,t,n){return Array.isArray(t)||(t=[t]),t=this.splat(t.shift(),...t).toString().split(O).filter(e=>!e||e.trim()!==``).map(t=>this.style(e,this.fields(t,{prefix:Array.isArray(n?.prefix)?n.prefix:[n?.prefix],suffix:Array.isArray(n?.suffix)?n.suffix:[n?.suffix]}))).join(O),t}style(e,t){if(!e||!t)return t;let n=this.icon(e,!this.options.useIcons&&this.wrap(e));return n&&(t=n+` `+t),t}applyFormat(e,t){return t?.format?t.format(e):e}spacing(e){return e===void 0||e.trim()===``?``:` `}},Kr=class{constructor(e){this.options=e}static{Y(this,`ProcessOutputBuffer`)}buffer=[];decoder=new k;get all(){return this.buffer}get last(){return this.buffer.at(-1)}get length(){return this.buffer.length}write(e,...t){let n=t[t.length-1];return this.buffer.push({time:Date.now(),stream:this.options?.stream,entry:this.decoder.write(typeof e==`string`?Buffer.from(e,typeof t[0]==`string`?t[0]:void 0):Buffer.from(e))}),this.options?.limit&&(this.buffer=this.buffer.slice(-this.options.limit)),typeof n==`function`&&n(),!0}reset(){this.buffer=[]}},qr=class{constructor(e){this.stream=e,this.method=e.write,this.buffer=new Kr({stream:e})}static{Y(this,`ProcessOutputStream`)}method;buffer;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;let e=[...this.buffer.all];return this.buffer.reset(),e}write(...e){return this.method.apply(this.stream,e)}},Jr=class{constructor(e,t,n){this.options=n,this.stream={stdout:new qr(e??process.stdout),stderr:new qr(t??process.stderr)},this.options={dump:[`stdout`,`stderr`],leaveEmptyLine:!0,...n}}static{Y(this,`ProcessOutput`)}stream;active;get stdout(){return this.stream.stdout.out}get stderr(){return this.stream.stderr.out}hijack(){if(this.active)throw Error(`ProcessOutput has been already hijacked!`);this.stream.stdout.write(kr.CURSOR_HIDE),Object.values(this.stream).forEach(e=>e.hijack()),this.active=!0}release(){let 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:Rr(e.entry)})).filter(e=>e.entry);e.length>0&&(this.options.leaveEmptyLine&&this.stdout.write(O),e.forEach(e=>{let t=e.stream??this.stdout;t.write(e.entry+O)})),this.stream.stdout.write(kr.CURSOR_SHOW),this.active=!1}toStdout(e,t=!0){return t&&(e+=O),this.stream.stdout.write(e)}toStderr(e,t=!0){return t&&(e+=O),this.stream.stderr.write(e)}};function Yr(e){let t=new T;return t.rows=1/0,t.columns=1/0,t.write=t=>(e(t.toString()),!0),t}Y(Yr,`createWritable`);var Xr=class{constructor(e,t){this.task=e,this.wrapper=t}static{Y(this,`ListrPromptAdapter`)}state;reportStarted(){if(this.state=this.task.state,this.task.prompt)throw new yi(`There is already an active prompt attached to this task which may not be cleaned up properly.`);this.task.prompt=this,this.task.state$=`PROMPT`}reportFailed(){this.task.state$=`PROMPT_FAILED`,this.restoreState()}reportCompleted(){this.task.state$=`PROMPT_COMPLETED`,this.restoreState()}restoreState(){this.task.prompt=void 0,this.state&&(this.task.state=this.state)}},Zr=class{static{Y(this,`Spinner`)}spinner=Fr()?[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`]:[`-`,`\\`,`|`,`/`];id;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)}},Qr={icon:{SKIPPED_WITH_COLLAPSE:Z.arrowDown,SKIPPED_WITHOUT_COLLAPSE:Z.warning,OUTPUT:Z.pointerSmall,OUTPUT_WITH_BOTTOMBAR:Z.pointerSmall,PENDING:Z.pointer,COMPLETED:Z.tick,COMPLETED_WITH_FAILED_SUBTASKS:Z.warning,COMPLETED_WITH_SISTER_TASKS_FAILED:Z.squareSmallFilled,RETRY:Z.warning,ROLLING_BACK:Z.warning,ROLLED_BACK:Z.arrowLeft,FAILED:Z.cross,FAILED_WITH_SUBTASKS:Z.pointer,WAITING:Z.squareSmallFilled,PAUSED:Z.squareSmallFilled},color:{SKIPPED_WITH_COLLAPSE:X.yellow,SKIPPED_WITHOUT_COLLAPSE:X.yellow,PENDING:X.yellow,COMPLETED:X.green,COMPLETED_WITH_FAILED_SUBTASKS:X.yellow,COMPLETED_WITH_SISTER_TASKS_FAILED:X.red,RETRY:X.yellowBright,ROLLING_BACK:X.redBright,ROLLED_BACK:X.redBright,FAILED:X.red,FAILED_WITH_SUBTASKS:X.red,WAITING:X.dim,PAUSED:X.yellowBright}};function $r(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r;return t===0&&n===0&&(r=`0.${Math.floor(e/100)}s`),t>0&&(r=`${t%60}s`),n>0&&(r=`${n}m${r}`),r}Y($r,`parseTimer`);var ei={condition:!0,field:$r,format:Y(()=>X.dim,`format`)};function ti(){let e=new Date;return String(e.getHours()).padStart(2,`0`)+`:`+String(e.getMinutes()).padStart(2,`0`)+`:`+String(e.getSeconds()).padStart(2,`0`)}Y(ti,`parseTimestamp`);var ni=class e{constructor(t,n,r){this.tasks=t,this.options=n,this.events=r,this.options={...e.rendererOptions,...this.options,icon:{...Qr.icon,...n?.icon??{}},color:{...Qr.color,...n?.color??{}}},this.spinner=this.options.spinner??new Zr,this.logger=this.options.logger??new Gr({useIcons:!0,toStderr:[]}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color}static{Y(this,`DefaultRenderer`)}static nonTTY=!1;static 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:{...ei,format:Y(()=>X.yellowBright,`format`)}};static rendererTaskOptions={outputBar:!0};prompt;activePrompt;spinner;logger;updater;truncate;wrap;buffer={output:new Map,bottom:new Map};cache={render:new Map,rendererOptions:new Map,rendererTaskOptions:new Map};async render(){let{createLogUpdate:e}=await import(`./log-update-D1TopJsV.mjs`),{default:t}=await import(`./cli-truncate-hj9TMKuW.mjs`),{default:n}=await import(`./wrap-ansi-CY1LiFIZ.mjs`);this.updater=e(this.logger.process.stdout),this.truncate=t,this.wrap=n,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};let t=[],n=this.renderer(this.tasks),r=this.renderBottomBar(),i=this.renderPrompt();return e.tasks&&n.length>0&&t.push(...n),e.bottomBar&&r.length>0&&(t.length>0&&t.push(``),t.push(...r)),e.prompt&&i.length>0&&(t.length>0&&t.push(``),t.push(...i)),t.join(O)}style(e,t=!1){let n=this.cache.rendererOptions.get(e.id);if(e.isSkipped()){if(t||n.collapseSkips)return this.logger.icon(`SKIPPED_WITH_COLLAPSE`);if(n.collapseSkips===!1)return this.logger.icon(`SKIPPED_WITHOUT_COLLAPSE`)}if(t)return this.shouldOutputToBottomBar(e)?this.logger.icon(`OUTPUT_WITH_BOTTOMBAR`):this.logger.icon(`OUTPUT`);if(e.hasSubtasks()){if(e.isStarted()||e.isPrompt()&&n.showSubtasks!==!1&&!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()?th