@nice-move/cli 0.11.28 → 0.11.30
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/{chunk-K9suQA8w.mjs → chunk-tuRmWmEN.mjs} +1 -1
- package/dist/{cli-truncate-C4mnTArR.mjs → cli-truncate-KBizENUJ.mjs} +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/cmd/git.mjs +1 -1
- package/dist/cmd/lint.mjs +1 -1
- package/dist/execa-CFcZKRhQ.mjs +35 -0
- package/dist/lib-7I1NoRZ3.mjs +2 -0
- package/dist/lib-CpGfI23z.mjs +43 -0
- package/dist/lint-CYF_OXOq.mjs +5 -0
- package/dist/{log-update-CbwACYto.mjs → log-update-BlmXx4Xt.mjs} +5 -5
- package/dist/{path-key-DxEsgIFz.mjs → path-key-DjAVgzm2.mjs} +1 -1
- package/dist/staged-CW2SjQ0z.mjs +1 -0
- package/dist/string-width-BpdcRJYu.mjs +1 -0
- package/dist/{wrap-ansi--xQZdqGK.mjs → wrap-ansi-TR6i00jW.mjs} +1 -1
- package/package.json +3 -3
- package/dist/git-hooks-CM3vzMX9.mjs +0 -35
- package/dist/lib-CV3GNWIq.mjs +0 -2
- package/dist/lib-Co7AUZZ4.mjs +0 -39
- package/dist/lint-B_6wPTR7.mjs +0 -1
- package/dist/lint-d0uGpI_d.mjs +0 -6
- package/dist/source-CW9jQ_O2.mjs +0 -5
- package/dist/string-width-C0SXopGZ.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./chunk-
|
|
1
|
+
import{r as e,t}from"./chunk-tuRmWmEN.mjs";var n=t(((t,n)=>{n.exports=o,o.sync=s;var r=e(`fs`);function i(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function a(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:i(t,n)}function o(e,t,n){r.stat(e,function(r,i){n(r,r?!1:a(i,e,t))})}function s(e,t){return a(r.statSync(e),e,t)}})),r=t(((t,n)=>{n.exports=i,i.sync=a;var r=e(`fs`);function i(e,t,n){r.stat(e,function(e,r){n(e,e?!1:o(r,t))})}function a(e,t){return o(r.statSync(e),t)}function o(e,t){return e.isFile()&&s(e,t)}function s(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}})),i=t(((t,i)=>{e(`fs`);var a=process.platform===`win32`||global.TESTING_WINDOWS?n():r();i.exports=o,o.sync=s;function o(e,t,n){if(typeof t==`function`&&(n=t,t={}),!n){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,r){o(e,t||{},function(e,t){e?r(e):n(t)})})}a(e,t||{},function(e,r){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)})}function s(e,t){try{return a.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}})),a=t(((t,n)=>{let r=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,a=e(`path`),o=r?`;`:`:`,s=i(),c=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),l=(e,t)=>{let n=t.colon||o,i=e.match(/\//)||r&&e.match(/\\/)?[``]:[...r?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(n)],a=r?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=r?a.split(n):[``];return r&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:i,pathExt:s,pathExtExe:a}},u=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:r,pathExt:i,pathExtExe:o}=l(e,t),u=[],d=n=>new Promise((i,o)=>{if(n===r.length)return t.all&&u.length?i(u):o(c(e));let s=r[n],l=/^".*"$/.test(s)?s.slice(1,-1):s,d=a.join(l,e);i(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,n,0))}),f=(e,n,r)=>new Promise((a,c)=>{if(r===i.length)return a(d(n+1));let l=i[r];s(e+l,{pathExt:o},(i,o)=>{if(!i&&o)if(t.all)u.push(e+l);else return a(e+l);return a(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};n.exports=u,u.sync=(e,t)=>{t||={};let{pathEnv:n,pathExt:r,pathExtExe:i}=l(e,t),o=[];for(let c=0;c<n.length;c++){let l=n[c],u=/^".*"$/.test(l)?l.slice(1,-1):l,d=a.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<r.length;e++){let n=f+r[e];try{if(s.sync(n,{pathExt:i}))if(t.all)o.push(n);else return n}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw c(e)}})),o=t(((e,t)=>{let n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n})),s=t(((t,n)=>{let r=e(`path`),i=a(),s=o();function c(e,t){let n=e.options.env||process.env,a=process.cwd(),o=e.options.cwd!=null,c=o&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=i.sync(e.command,{path:n[s({env:n})],pathExt:t?r.delimiter:void 0})}catch{}finally{c&&process.chdir(a)}return l&&=r.resolve(o?e.options.cwd:``,l),l}function l(e){return c(e)||c(e,!0)}n.exports=l})),c=t(((e,t)=>{let n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),e=e.replace(/(?=(\\+?)?)\1$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i})),l=t(((e,t)=>{t.exports=/^#!(.*)/})),u=t(((e,t)=>{let n=l();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}})),d=t(((t,n)=>{let r=e(`fs`),i=u();function a(e){let t=Buffer.alloc(150),n;try{n=r.openSync(e,`r`),r.readSync(n,t,0,150,0),r.closeSync(n)}catch{}return i(t.toString())}n.exports=a})),f=t(((t,n)=>{let r=e(`path`),i=s(),a=c(),o=d(),l=process.platform===`win32`,u=/\.(?:com|exe)$/i,f=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function p(e){e.file=i(e);let t=e.file&&o(e.file);return t?(e.args.unshift(e.file),e.command=t,i(e)):e.file}function m(e){if(!l)return e;let t=p(e),n=!u.test(t);if(e.options.forceShell||n){let n=f.test(t);e.command=r.normalize(e.command),e.command=a.command(e.command),e.args=e.args.map(e=>a.argument(e,n)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function h(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:m(r)}n.exports=h})),p=t(((e,t)=>{let n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}})),m=t(((t,n)=>{let r=e(`child_process`),i=f(),a=p();function o(e,t,n){let o=i(e,t,n),s=r.spawn(o.command,o.args,o.options);return a.hookChildProcess(s,o),s}function s(e,t,n){let o=i(e,t,n),s=r.spawnSync(o.command,o.args,o.options);return s.error=s.error||a.verifyENOENTSync(s.status,o),s}n.exports=o,n.exports.spawn=o,n.exports.sync=s,n.exports._parse=i,n.exports._enoent=a}));function h(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`}export{m as n,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{resolve as e}from"node:path";import{isAbsolute as t,resolve as n}from"path";import{readFileSync as r,statSync as i}from"fs";import{createRequire as a}from"module";import{fileURLToPath as o}from"url";import{readFile as s}from"node:fs/promises";const c=process.cwd(),l=a(import.meta.url);function u(e,r=c){return e.startsWith(`.`)?n(r,e):t(e)?e:l.resolve(e)}function d(e){try{return i(u(e)),!0}catch{return!1}}function f(e){try{let t=r(u(e),`utf8`);return JSON.parse(t)}catch{return{}}}function p(e,t={}){let n=f(`./package.json`);if(e){let{[e]:r=t}=n;return r}return n}const m={"body-leading-blank":[1,`always`],"body-max-line-length":[2,`always`,100],"footer-leading-blank":[1,`always`],"footer-max-line-length":[2,`always`,100],"header-max-length":[2,`always`,100],"subject-case":[0],"subject-empty":[2,`never`],"subject-full-stop":[2,`never`,`.`],"type-case":[2,`always`,`lower-case`],"type-empty":[2,`never`],"type-enum":[2,`always`,[`build`,`chore`,`ci`,`docs`,`feat`,`fix`,`perf`,`refactor`,`revert`,`style`,`test`]],"scope-case":[0],"body-case":[0],"header-case":[0]};function h(){return e(process.cwd(),`.git/COMMIT_EDITMSG`)}function g(){return s(h(),`utf8`)}async function _(){let e=await g(),t=await import(`./lint-CYF_OXOq.mjs`).then(e=>e.default.default||e.default),n=await import(`./lib-7I1NoRZ3.mjs`).then(e=>e.default.default||e.default),r=await t(e,m);return{result:r,output:await n({results:[r]})}}function v(e){e.command(`commit`,`Lint git commit message`,{},()=>{_().then(({result:e,output:t})=>{e.valid?console.log(`Pass.`):(console.log(`Fail:`),console.log(t),process.exitCode=1)}).catch(e=>{console.error(e),process.exitCode=1})})}function y(e){let t=Object.entries(e).map(([e,t])=>[e,t.filter(Boolean)]).filter(([e,t])=>t.length);return t.length>0?Object.fromEntries(t):void 0}function b({garou:e,stylelint:t,eslint:n,prettier:r}){let i=process.stdin.isTTY?` --color`:``;return y({"*.{vue,html,htm,md}":[e&&`garou`,r&&`prettier -w -u${i}`,t&&`stylelint --fix -- ${i}`,n&&`eslint --fix ${i}`],"*.{ts,tsx,mts,cts}":[e&&`garou`,r&&`prettier -w -u${i}`,n&&`eslint --fix ${i}`],"*.{js,jsx,mjs,cjs,wxs,qs}":[e&&`garou`,r&&`prettier -w -u${i}`,n&&`eslint --fix ${i}`],"*.{c,sc,le,wx,q,tt,jx,ac}ss":[e&&`garou`,r&&`prettier -w -u${i}`,t&&`stylelint --fix -- ${i}`],"*.{json,yml,yaml,svg}":[e&&`garou`,r&&`prettier -w -u${i}`],"{*.{jsonc,webmanifest,editorconfig,toml},.{babel,npm}rc}":[r&&`prettier -w -u${i}`],"{*.jenkinsfile,{j,J}enkinsfile}":[r&&`prettier -w -u${i}`],"yarn.lock":[e&&`garou`]})}function x(){let e=p(`devDependencies`),t=`prettier`in e,n=`eslint`in e,r=`stylelint`in e;return{garou:`garou`in e,stylelint:r,eslint:n,prettier:t}}async function S(){let{default:e}=await import(`./lib-CpGfI23z.mjs`);return e({allowEmpty:!0,concurrent:!0,config:b(x()),cwd:process.cwd(),debug:!1,quiet:!1,relative:!1,shell:!1,stash:!0})}function C(e){e.command(`staged`,`Lint and format git staged files`,{},()=>{S().then(e=>{process.exitCode=e?0:1}).catch(e=>{console.error(e),process.exitCode=1})})}export{v as n,d as r,C as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,t}from"./chunk-tuRmWmEN.mjs";const n=(e=0)=>t=>`\u001B[${t+e}m`,r=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,i=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,a={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(a.modifier);const o=Object.keys(a.color),s=Object.keys(a.bgColor);[...o,...s];function c(){let e=new Map;for(let[t,n]of Object.entries(a)){for(let[t,r]of Object.entries(n))a[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=a[t],e.set(r[0],r[1]);Object.defineProperty(a,t,{value:n,enumerable:!1})}return Object.defineProperty(a,`codes`,{value:e,enumerable:!1}),a.color.close=`\x1B[39m`,a.bgColor.close=`\x1B[49m`,a.color.ansi=n(),a.color.ansi256=r(),a.color.ansi16m=i(),a.bgColor.ansi=n(10),a.bgColor.ansi256=r(10),a.bgColor.ansi16m=i(10),Object.defineProperties(a,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?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(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>a.rgbToAnsi256(...a.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>a.ansi256ToAnsi(a.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>a.ansi256ToAnsi(a.hexToAnsi256(e)),enumerable:!1}}),a}const l=c();function u({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}const d=u();function f(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(d,``)}function p(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function m(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function h(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function g(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function _(e,{ambiguousAsWide:t=!1}={}){return g(e),m(e)||h(e)||t&&p(e)?2:1}var v=e(t(((e,t)=>{t.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}))(),1);const y=new Intl.Segmenter,b=/^\p{Default_Ignorable_Code_Point}$/u;function x(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=f(e)),e.length===0)return 0;let i=0,a={ambiguousAsWide:!n};for(let{segment:t}of y.segment(e)){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159)&&!(e>=8203&&e<=8207||e===65279)&&!(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071)&&!(e>=55296&&e<=57343)&&!(e>=65024&&e<=65039)&&!b.test(t)){if((0,v.default)().test(t)){i+=2;continue}i+=_(e,a)}}return i}export{l as a,f as i,m as n,h as r,x as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./string-width-
|
|
1
|
+
import{a as e,i as t,t as n}from"./string-width-BpdcRJYu.mjs";const r=new Set([`\x1B`,``]),i=`]8;;`,a=e=>`${r.values().next().value}[${e}m`,o=e=>`${r.values().next().value}${i}${e}`,s=e=>e.split(` `).map(e=>n(e)),c=(e,a,o)=>{let s=[...a],c=!1,l=!1,u=n(t(e.at(-1)));for(let[t,a]of s.entries()){let d=n(a);if(u+d<=o?e[e.length-1]+=a:(e.push(a),u=0),r.has(a)&&(c=!0,l=s.slice(t+1,t+1+4).join(``)===i),c){l?a===`\x07`&&(c=!1,l=!1):a===`m`&&(c=!1);continue}u+=d,u===o&&t<s.length-1&&(e.push(``),u=0)}!u&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},l=e=>{let t=e.split(` `),r=t.length;for(;r>0&&!(n(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(` `)+t.slice(r).join(``)},u=(t,u,d={})=>{if(d.trim!==!1&&t.trim()===``)return``;let f=``,p,m,h=s(t),g=[``];for(let[e,r]of t.split(` `).entries()){d.trim!==!1&&(g[g.length-1]=g.at(-1).trimStart());let t=n(g.at(-1));if(e!==0&&(t>=u&&(d.wordWrap===!1||d.trim===!1)&&(g.push(``),t=0),(t>0||d.trim===!1)&&(g[g.length-1]+=` `,t++)),d.hard&&h[e]>u){let n=u-t,i=1+Math.floor((h[e]-n-1)/u);Math.floor((h[e]-1)/u)<i&&g.push(``),c(g,r,u);continue}if(t+h[e]>u&&t>0&&h[e]>0){if(d.wordWrap===!1&&t<u){c(g,r,u);continue}g.push(``)}if(t+h[e]>u&&d.wordWrap===!1){c(g,r,u);continue}g[g.length-1]+=r}d.trim!==!1&&(g=g.map(e=>l(e)));let _=g.join(`
|
|
2
2
|
`),v=[..._],y=0;for(let[t,n]of v.entries()){if(f+=n,r.has(n)){let{groups:e}=RegExp(`(?:\\[(?<code>\\d+)m|\\${i}(?<uri>.*))`).exec(_.slice(y))||{groups:{}};if(e.code!==void 0){let t=Number.parseFloat(e.code);p=t===39?void 0:t}else e.uri!==void 0&&(m=e.uri.length===0?void 0:e.uri)}let s=e.codes.get(Number(p));v[t+1]===`
|
|
3
3
|
`?(m&&(f+=o(``)),p&&s&&(f+=a(s))):n===`
|
|
4
4
|
`&&(p&&s&&(f+=a(p)),m&&(f+=o(m))),y+=n.length}return f};function d(e,t,n){return String(e).normalize().replaceAll(`\r
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-move/cli",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.30",
|
|
4
4
|
"description": "Frontend develop helper for frontend development",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"cheetor": "^0.13.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@commitlint/format": "^20.
|
|
44
|
-
"@commitlint/lint": "^20.2
|
|
43
|
+
"@commitlint/format": "^20.4.0",
|
|
44
|
+
"@commitlint/lint": "^20.4.2",
|
|
45
45
|
"execa": "^9.6.1",
|
|
46
46
|
"lint-staged": "^15.5.2",
|
|
47
47
|
"settingz": "^0.2.0"
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t}from"./chunk-K9suQA8w.mjs";import{n,t as r}from"./path-key-DxEsgIFz.mjs";import{t as i}from"./mjs-Cl59bDdr.mjs";import{fileURLToPath as a}from"node:url";import{ChildProcess as o,execFile as s,spawn as c,spawnSync as l}from"node:child_process";import{StringDecoder as u}from"node:string_decoder";import{aborted as d,callbackify as f,debuglog as p,inspect as m,promisify as h,stripVTControlCharacters as g}from"node:util";import _,{execArgv as v,execPath as y,hrtime as b,platform as x}from"node:process";import S from"node:tty";import C from"node:path";import{scheduler as w,setImmediate as ee,setTimeout as te}from"node:timers/promises";import{constants as T}from"node:os";import{EventEmitter as ne,addAbortListener as re,on as ie,once as E,setMaxListeners as ae}from"node:events";import{serialize as oe}from"node:v8";import{appendFileSync as se,createReadStream as ce,createWriteStream as le,readFileSync as ue,statSync as de,writeFileSync as fe}from"node:fs";import{finished as D}from"node:stream/promises";import{Duplex as pe,PassThrough as me,Readable as O,Transform as he,Writable as ge,getDefaultHighWaterMark as _e}from"node:stream";import{Buffer as ve}from"node:buffer";function k(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}const ye=(e,t)=>{let n=Se(be(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},be=e=>xe(e)?e.toString():e,xe=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,Se=e=>e instanceof URL?a(e):e,Ce=(e,t=[],n={})=>{let r=ye(e,`First argument`),[i,a]=k(t)?[[],t]:[t,n];if(!Array.isArray(i))throw TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(e=>typeof e==`object`&&!!e))throw TypeError(`Second argument must be an array of strings: ${i}`);let o=i.map(String),s=o.find(e=>e.includes(`\0`));if(s!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${s}`);if(!k(a))throw TypeError(`Last argument must be an options object: ${a}`);return[r,o,a]},{toString:we}=Object.prototype,Te=e=>we.call(e)===`[object ArrayBuffer]`,A=e=>we.call(e)===`[object Uint8Array]`,j=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Ee=new TextEncoder,De=e=>Ee.encode(e),Oe=new TextDecoder,ke=e=>Oe.decode(e),Ae=(e,t)=>je(e,t).join(``),je=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new u(t),r=e.map(e=>typeof e==`string`?De(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},Me=e=>e.length===1&&A(e[0])?e[0]:Pe(Ne(e)),Ne=e=>e.map(e=>typeof e==`string`?De(e):e),Pe=e=>{let t=new Uint8Array(Fe(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},Fe=e=>{let t=0;for(let n of e)t+=n.length;return t},Ie=e=>Array.isArray(e)&&Array.isArray(e.raw),Le=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=Re({templates:e,expressions:t,tokens:n,index:r,template:i});if(n.length===0)throw TypeError(`Template script must not be empty`);let[r,...i]=n;return[r,i,{}]},Re=({templates:e,expressions:t,tokens:n,index:r,template:i})=>{if(i===void 0)throw TypeError(`Invalid backslash sequence: ${e.raw[r]}`);let{nextTokens:a,leadingWhitespaces:o,trailingWhitespaces:s}=ze(i,e.raw[r]),c=He(n,a,o);if(r===t.length)return c;let l=t[r];return He(c,Array.isArray(l)?l.map(e=>Ue(e)):[Ue(l)],s)},ze=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=Be.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let o=t[a];if(Be.has(o))r!==i&&n.push(e.slice(r,i)),r=i+1;else if(o===`\\`){let e=t[a+1];e===`
|
|
2
|
-
`?(--i,a+=1):e===`u`&&t[a+2]===`{`?a=t.indexOf(`}`,a+3):a+=Ve[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},Be=new Set([` `,` `,`\r`,`
|
|
3
|
-
`]),Ve={x:3,u:5},He=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Ue=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(k(e)&&(`stdout`in e||`isMaxBuffer`in e))return We(e);throw e instanceof o||Object.prototype.toString.call(e)===`[object Promise]`?TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):TypeError(`Unexpected "${t}" in template expression`)},We=({stdout:e})=>{if(typeof e==`string`)return e;if(A(e))return ke(e);throw e===void 0?TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):TypeError(`Unexpected "${typeof e}" stdout in template expression`)},M=e=>Ge.includes(e),Ge=[_.stdin,_.stdout,_.stderr],N=[`stdin`,`stdout`,`stderr`],Ke=e=>N[e]??`stdio[${e}]`,qe=e=>{let t={...e};for(let n of at)t[n]=Je(e,n);return t},Je=(e,t)=>{let n=Array.from({length:Ye(e)+1});return rt(Xe(e[t],n,t),t)},Ye=({stdio:e})=>Array.isArray(e)?Math.max(e.length,N.length):N.length,Xe=(e,t,n)=>k(e)?Ze(e,t,n):t.fill(e),Ze=(e,t,n)=>{for(let r of Object.keys(e).sort(Qe))for(let i of et(r,n,t))t[i]=e[r];return t},Qe=(e,t)=>$e(e)<$e(t)?1:-1,$e=e=>e===`stdout`||e===`stderr`?0:e===`all`?2:1,et=(e,t,n)=>{if(e===`ipc`)return[n.length-1];let r=tt(e);if(r===void 0||r===0)throw TypeError(`"${t}.${e}" is invalid.
|
|
4
|
-
It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(r>=n.length)throw TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
|
|
5
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);return r===`all`?[1,2]:[r]},tt=e=>{if(e===`all`)return e;if(N.includes(e))return N.indexOf(e);let t=nt.exec(e);if(t!==null)return Number(t[1])},nt=/^fd(\d+)$/,rt=(e,t)=>e.map(e=>e===void 0?it[t]:e),it={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:p(`execa`).enabled?`full`:`none`,stripFinalNewline:!0},at=[`lines`,`buffer`,`maxBuffer`,`verbose`,`stripFinalNewline`],P=(e,t)=>t===`ipc`?e.at(-1):e[t],ot=({verbose:e},t)=>lt(e,t)!==`none`,st=({verbose:e},t)=>![`none`,`short`].includes(lt(e,t)),ct=({verbose:e},t)=>{let n=lt(e,t);return dt(n)?n:void 0},lt=(e,t)=>t===void 0?ut(e):P(e,t),ut=e=>e.find(e=>dt(e))??ft.findLast(t=>e.includes(t)),dt=e=>typeof e==`function`,ft=[`none`,`short`,`full`],pt=(e,t)=>{let n=[e,...t];return{command:n.join(` `),escapedCommand:n.map(e=>bt(ht(e))).join(` `)}},mt=e=>g(e).split(`
|
|
6
|
-
`).map(e=>ht(e)).join(`
|
|
7
|
-
`),ht=e=>e.replaceAll(_t,e=>gt(e)),gt=e=>{let t=vt[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=yt?`\\u${r.padStart(4,`0`)}`:`\\U${r}`},_t=(()=>{try{return RegExp(`\\p{Separator}|\\p{Other}`,`gu`)}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),vt={" ":` `,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},yt=65535,bt=e=>xt.test(e)?e:x===`win32`?`"${e.replaceAll(`"`,`""`)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`,xt=/^[\w./-]+$/;function St(){let{env:e}=_,{TERM:t,TERM_PROGRAM:n}=e;return _.platform===`win32`?!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask===`{cmd::Cmder}`||n===`Terminus-Sublime`||n===`vscode`||t===`xterm-256color`||t===`alacritty`||t===`rxvt-unicode`||t===`rxvt-unicode-256color`||e.TERMINAL_EMULATOR===`JetBrains-JediTerm`:t!==`linux`}const Ct={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},wt={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},Tt={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},Et={...Ct,...wt},Dt={...Ct,...Tt};var Ot=St()?Et:Dt;Object.entries(wt);const kt=S?.WriteStream?.prototype?.hasColors?.()??!1,F=(e,t)=>{if(!kt)return e=>e;let n=`\u001B[${e}m`,r=`\u001B[${t}m`;return e=>{let i=e+``,a=i.indexOf(r);if(a===-1)return n+i+r;let o=n,s=0,c=(t===22?r:``)+n;for(;a!==-1;)o+=i.slice(s,a)+c,s=a+r.length,a=i.indexOf(r,s);return o+=i.slice(s)+r,o}};F(0,0);const At=F(1,22);F(2,22),F(3,23),F(4,24),F(53,55),F(7,27),F(8,28),F(9,29),F(30,39),F(31,39),F(32,39),F(33,39),F(34,39),F(35,39),F(36,39),F(37,39);const jt=F(90,39);F(40,49),F(41,49),F(42,49),F(43,49),F(44,49),F(45,49),F(46,49),F(47,49),F(100,49);const Mt=F(91,39);F(92,39);const Nt=F(93,39);F(94,39),F(95,39),F(96,39),F(97,39),F(101,49),F(102,49),F(103,49),F(104,49),F(105,49),F(106,49),F(107,49);const Pt=({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:a=!1}={},options:{reject:o=!0}})=>{let s=Ft(n),c=Rt[e]({failed:a,reject:o,piped:r}),l=Bt[e]({reject:o});return`${jt(`[${s}]`)} ${jt(`[${i}]`)} ${l(c)} ${l(t)}`},Ft=e=>`${It(e.getHours(),2)}:${It(e.getMinutes(),2)}:${It(e.getSeconds(),2)}.${It(e.getMilliseconds(),3)}`,It=(e,t)=>String(e).padStart(t,`0`),Lt=({failed:e,reject:t})=>e?t?Ot.cross:Ot.warning:Ot.tick,Rt={command:({piped:e})=>e?`|`:`$`,output:()=>` `,ipc:()=>`*`,error:Lt,duration:Lt},zt=e=>e,Bt={command:()=>At,output:()=>zt,ipc:()=>zt,error:({reject:e})=>e?Mt:Nt,duration:()=>jt},Vt=(e,t,n)=>{let r=ct(t,n);return e.map(({verboseLine:e,verboseObject:t})=>Ht(e,t,r)).filter(e=>e!==void 0).map(e=>Ut(e)).join(``)},Ht=(e,t,n)=>{if(n===void 0)return e;let r=n(e,t);if(typeof r==`string`)return r},Ut=e=>e.endsWith(`
|
|
8
|
-
`)?e:`${e}\n`,I=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{let a=Vt(Gt(t,Wt({type:e,result:i,verboseInfo:r})),r,n);a!==``&&console.warn(a.slice(0,-1))},Wt=({type:e,result:t,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...a}}})=>({type:e,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:t,options:a}),Gt=(e,t)=>e.split(`
|
|
9
|
-
`).map(e=>Kt({...t,message:e})),Kt=e=>({verboseLine:Pt(e),verboseObject:e}),qt=e=>mt(typeof e==`string`?e:m(e)).replaceAll(` `,` `.repeat(Jt)),Jt=2,Yt=(e,t)=>{ot(t)&&I({type:`command`,verboseMessage:e,verboseInfo:t})},Xt=(e,t,n)=>($t(e),{verbose:e,escapedCommand:t,commandId:Zt(e),rawOptions:n}),Zt=e=>ot({verbose:e})?Qt++:void 0;let Qt=0n;const $t=e=>{for(let t of e){if(t===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!ft.includes(t)&&!dt(t)){let e=ft.map(e=>`'${e}'`).join(`, `);throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}},en=()=>b.bigint(),tn=e=>Number(b.bigint()-e)/1e6,nn=(e,t,n)=>{let r=en(),{command:i,escapedCommand:a}=pt(e,t),o=Xt(Je(n,`verbose`),a,{...n});return Yt(a,o),{command:i,escapedCommand:a,startTime:r,verboseInfo:o}};h(s);function rn(e){return e instanceof URL?a(e):e}function an(e){return{*[Symbol.iterator](){let t=C.resolve(rn(e)),n;for(;n!==t;)yield t,n=t,t=C.resolve(t,`..`)}}}const on=({cwd:e=_.cwd(),path:t=_.env[r()],preferLocal:n=!0,execPath:i=_.execPath,addExecPath:a=!0}={})=>{let o=C.resolve(rn(e)),s=[],c=t.split(C.delimiter);return n&&sn(s,c,o),a&&cn(s,c,i,o),t===``||t===C.delimiter?`${s.join(C.delimiter)}${t}`:[...s,t].join(C.delimiter)},sn=(e,t,n)=>{for(let r of an(n)){let n=C.join(r,`node_modules/.bin`);t.includes(n)||e.push(n)}},cn=(e,t,n,r)=>{let i=C.resolve(r,rn(n),`..`);t.includes(i)||e.push(i)},ln=({env:e=_.env,...t}={})=>{e={...e};let n=r({env:e});return t.path=e[n],e[n]=on(t),e},un=(e,t,n)=>new(n?gn:hn)(t,e instanceof L?{}:{cause:e});var L=class extends Error{};const dn=(e,t)=>{Object.defineProperty(e.prototype,`name`,{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,pn,{value:!0,writable:!1,enumerable:!1,configurable:!1})},fn=e=>mn(e)&&pn in e,pn=Symbol(`isExecaError`),mn=e=>Object.prototype.toString.call(e)===`[object Error]`;var hn=class extends Error{};dn(hn,hn.name);var gn=class extends Error{};dn(gn,gn.name);const _n=()=>{let e=bn-yn+1;return Array.from({length:e},vn)},vn=(e,t)=>({name:`SIGRT${t+1}`,number:yn+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),yn=34,bn=64,xn=[{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`}],Sn=()=>{let e=_n();return[...xn,...e].map(Cn)},Cn=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=T,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}},wn=()=>{let e=Sn();return Object.fromEntries(e.map(Tn))},Tn=({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}],En=wn(),Dn=()=>{let e=Sn(),t=Array.from({length:65},(t,n)=>On(n,e));return Object.assign({},...t)},On=(e,t)=>{let n=kn(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}}},kn=(e,t)=>{let n=t.find(({name:t})=>T.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n};Dn();const An=e=>{let t="option `killSignal`";if(e===0)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return Mn(e,t)},jn=e=>e===0?e:Mn(e,"`subprocess.kill()`'s argument"),Mn=(e,t)=>{if(Number.isInteger(e))return Nn(e,t);if(typeof e==`string`)return Fn(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${In()}`)},Nn=(e,t)=>{if(Pn.has(e))return Pn.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${In()}`)},Pn=(()=>new Map(Object.entries(T.signals).reverse().map(([e,t])=>[t,e])))(),Fn=(e,t)=>{if(e in T.signals)return e;throw e.toUpperCase()in T.signals?TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${In()}`)},In=()=>`Available signal names: ${Ln()}.
|
|
10
|
-
Available signal numbers: ${Rn()}.`,Ln=()=>Object.keys(T.signals).sort().map(e=>`'${e}'`).join(`, `),Rn=()=>[...new Set(Object.values(T.signals).sort((e,t)=>e-t))].join(`, `),zn=e=>En[e].description,Bn=e=>{if(e===!1)return e;if(e===!0)return Vn;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Vn=1e3*5,Hn=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:a},o,s)=>{let{signal:c,error:l}=Un(o,s,n);Wn(l,r);let u=e(c);return Gn({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:u,context:i,controller:a}),u},Un=(e,t,n)=>{let[r=n,i]=mn(e)?[void 0,e]:[e,t];if(typeof r!=`string`&&!Number.isInteger(r))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!mn(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:jn(r),error:i}},Wn=(e,t)=>{e!==void 0&&t.reject(e)},Gn=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:a,controller:o})=>{t===r&&i&&Kn({kill:e,forceKillAfterDelay:n,context:a,controllerSignal:o.signal})},Kn=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await te(t,void 0,{signal:r}),e(`SIGKILL`)&&(n.isForcefullyTerminated??=!0)}catch{}},qn=async(e,t)=>{e.aborted||await E(e,`abort`,{signal:t})},Jn=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!==`[object AbortSignal]`)throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},Yn=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[Xn(e,t,r,i)],Xn=async(e,t,n,{signal:r})=>{throw await qn(t,r),n.terminationReason??=`cancel`,e.kill(),t.reason},Zn=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{Qn(e,t,n),$n(e,t,r)},Qn=(e,t,n)=>{if(!n)throw Error(`${R(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},$n=(e,t,n)=>{if(!n)throw Error(`${R(e,t)} cannot be used: the ${z(t)} has already exited or disconnected.`)},er=e=>{throw Error(`${R(`getOneMessage`,e)} could not complete: the ${z(e)} exited or disconnected.`)},tr=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} is sending a message too, instead of listening to incoming messages.
|
|
11
|
-
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
12
|
-
|
|
13
|
-
const [receivedMessage] = await Promise.all([
|
|
14
|
-
${R(`getOneMessage`,e)},
|
|
15
|
-
${R(`sendMessage`,e,`message, {strict: true}`)},
|
|
16
|
-
]);`)},nr=(e,t)=>Error(`${R(`sendMessage`,t)} failed when sending an acknowledgment response to the ${z(t)}.`,{cause:e}),rr=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} is not listening to incoming messages.`)},ir=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} exited without listening to incoming messages.`)},ar=()=>Error(`\`cancelSignal\` aborted: the ${z(!0)} disconnected.`),or=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},sr=({error:e,methodName:t,isSubprocess:n})=>{if(e.code===`EPIPE`)throw Error(`${R(t,n)} cannot be used: the ${z(n)} is disconnecting.`,{cause:e})},cr=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(lr(e))throw Error(`${R(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},lr=({code:e,message:t})=>ur.has(e)||dr.some(e=>t.includes(e)),ur=new Set([`ERR_MISSING_ARGS`,`ERR_INVALID_ARG_TYPE`]),dr=[`could not be cloned`,`circular structure`,`call stack size exceeded`],R=(e,t,n=``)=>e===`cancelSignal`?"`cancelSignal`'s `controller.abort()`":`${fr(t)}${e}(${n})`,fr=e=>e?``:`subprocess.`,z=e=>e?`parent process`:`subprocess`,pr=e=>{e.connected&&e.disconnect()},B=()=>{let e={},t=new Promise((t,n)=>{Object.assign(e,{resolve:t,reject:n})});return Object.assign(t,e)},mr=(e,t=`stdin`)=>{let{options:n,fileDescriptors:r}=V.get(e),i=gr(r,t,!0),a=e.stdio[i];if(a===null)throw TypeError(yr(i,t,n,!0));return a},hr=(e,t=`stdout`)=>{let{options:n,fileDescriptors:r}=V.get(e),i=gr(r,t,!1),a=i===`all`?e.all:e.stdio[i];if(a==null)throw TypeError(yr(i,t,n,!1));return a},V=new WeakMap,gr=(e,t,n)=>{let r=_r(t,n);return vr(r,t,n,e),r},_r=(e,t)=>{let n=tt(e);if(n!==void 0)return n;let{validOptions:r,defaultValue:i}=t?{validOptions:`"stdin"`,defaultValue:`stdin`}:{validOptions:`"stdout", "stderr", "all"`,defaultValue:`stdout`};throw TypeError(`"${H(t)}" must not be "${e}".
|
|
17
|
-
It must be ${r} or "fd3", "fd4" (and so on).
|
|
18
|
-
It is optional and defaults to "${i}".`)},vr=(e,t,n,r)=>{let i=r[xr(e)];if(i===void 0)throw TypeError(`"${H(n)}" must not be ${t}. That file descriptor does not exist.
|
|
19
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction===`input`&&!n)throw TypeError(`"${H(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!==`input`&&n)throw TypeError(`"${H(n)}" must not be ${t}. It must be a writable stream, not readable.`)},yr=(e,t,n,r)=>{if(e===`all`&&!n.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:a}=br(e,n);return`The "${i}: ${Sr(a)}" option is incompatible with using "${H(r)}: ${Sr(t)}".
|
|
20
|
-
Please set this option with "pipe" instead.`},br=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=xr(e);return a===0&&t!==void 0?{optionName:`stdin`,optionValue:t}:a===1&&n!==void 0?{optionName:`stdout`,optionValue:n}:a===2&&r!==void 0?{optionName:`stderr`,optionValue:r}:{optionName:`stdio[${a}]`,optionValue:i[a]}},xr=e=>e===`all`?1:e,H=e=>e?`to`:`from`,Sr=e=>typeof e==`string`?`'${e}'`:typeof e==`number`?`${e}`:`Stream`,Cr=(e,t,n)=>{let r=e.getMaxListeners();r===0||r===1/0||(e.setMaxListeners(r+t),re(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},wr=(e,t)=>{t&&Tr(e)},Tr=e=>{e.refCounted()},Er=(e,t)=>{t&&Dr(e)},Dr=e=>{e.unrefCounted()},Or=(e,t)=>{t&&(Dr(e),Dr(e))},kr=(e,t)=>{t&&(Tr(e),Tr(e))},Ar=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(Vr(i)||si(i))return;Mr.has(e)||Mr.set(e,[]);let a=Mr.get(e);if(a.push(i),!(a.length>1))for(;a.length>0;){await Yr(e,r,i),await w.yield();let o=await Br({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});a.shift(),r.emit(`message`,o),r.emit(`message:done`)}},jr=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{li();let a=Mr.get(e);for(;a?.length>0;)await E(r,`message:done`);e.removeListener(`message`,i),kr(t,n),r.connected=!1,r.emit(`disconnect`)},Mr=new WeakMap,Nr=(e,t,n)=>{if(Pr.has(e))return Pr.get(e);let r=new ne;return r.connected=!0,Pr.set(e,r),Fr({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},Pr=new WeakMap,Fr=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let i=Ar.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on(`message`,i),t.once(`disconnect`,jr.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),Or(n,r)},Ir=e=>{let t=Pr.get(e);return t===void 0?e.channel!==null:t.connected},Lr=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;let a=Xr(e,Nr(e,t,n));return{id:Rr++,type:Gr,message:r,hasListeners:a}};let Rr=0n;const zr=(e,t)=>{if(!(t?.type!==Gr||t.hasListeners))for(let{id:t}of e)t!==void 0&&Ur[t].resolve({isDeadlock:!0,hasListeners:!1})},Br=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==Gr||!t.connected)return e;let{id:a,message:o}=e,s={id:a,type:Kr,message:Xr(t,i)};try{await Qr({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},s)}catch(e){i.emit(`strict:error`,e)}return o},Vr=e=>{if(e?.type!==Kr)return!1;let{id:t,message:n}=e;return Ur[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},Hr=async(e,t,n)=>{if(e?.type!==Gr)return;let r=B();Ur[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,Wr(t,n,i)]);e&&tr(n),a||rr(n)}finally{i.abort(),delete Ur[e.id]}},Ur={},Wr=async(e,t,{signal:n})=>{Cr(e,1,n),await E(e,`disconnect`,{signal:n}),ir(t)},Gr=`execa:ipc:request`,Kr=`execa:ipc:response`,qr=(e,t,n)=>{U.has(e)||U.set(e,new Set);let r=U.get(e),i={onMessageSent:B(),id:n?t.id:void 0};return r.add(i),{outgoingMessages:r,outgoingMessage:i}},Jr=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},Yr=async(e,t,n)=>{for(;!Xr(e,t)&&U.get(e)?.size>0;){let t=[...U.get(e)];zr(t,n),await Promise.all(t.map(({onMessageSent:e})=>e))}},U=new WeakMap,Xr=(e,t)=>t.listenerCount(`message`)>Zr(e),Zr=e=>V.has(e)&&!P(V.get(e).options.buffer,`ipc`)?1:0,Qr=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:a=!1}={})=>{let o=`sendMessage`;return Zn({methodName:o,isSubprocess:n,ipc:r,isConnected:e.connected}),$r({anyProcess:e,channel:t,methodName:o,isSubprocess:n,message:i,strict:a})},$r=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:i,strict:a})=>{let o=Lr({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:a}),s=qr(e,o,a);try{await ei({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(t){throw pr(e),t}finally{Jr(s)}},ei=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:i})=>{let a=ti(e);try{await Promise.all([Hr(r,e,n),a(r)])}catch(e){throw sr({error:e,methodName:t,isSubprocess:n}),cr({error:e,methodName:t,isSubprocess:n,message:i}),e}},ti=e=>{if(ni.has(e))return ni.get(e);let t=h(e.send.bind(e));return ni.set(e,t),t},ni=new WeakMap,ri=(e,t)=>{let n=`cancelSignal`;return $n(n,!1,e.connected),ei({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:ci,message:t},message:t})},ii=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await ai({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),ui.signal),ai=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!oi){if(oi=!0,!r){or();return}if(t===null){li();return}Nr(e,t,n),await w.yield()}};let oi=!1;const si=e=>e?.type===ci?(ui.abort(e.message),!0):!1,ci=`execa:ipc:cancel`,li=()=>{ui.abort(ar())},ui=new AbortController,di=({gracefulCancel:e,cancelSignal:t,ipc:n,serialization:r})=>{if(e){if(t===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r===`json`)throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},fi=({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:a})=>n?[pi({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:a})]:[],pi=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{throw await qn(t,i),await ri(e,mi(t)),Kn({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??=`gracefulCancel`,t.reason},mi=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=Error(e.message);return Object.defineProperty(t,`stack`,{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},hi=({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})`)},gi=(e,t,n,r)=>t===0||t===void 0?[]:[_i(e,t,n,r)],_i=async(e,t,n,{signal:r})=>{throw await te(t,void 0,{signal:r}),n.terminationReason??=`timeout`,e.kill(),new L},vi=({options:e})=>{if(e.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},yi=(e,t,{node:n=!1,nodePath:r=y,nodeOptions:i=v.filter(e=>!e.startsWith(`--inspect`)),cwd:a,execPath:o,...s})=>{if(o!==void 0)throw TypeError(`The "execPath" option has been removed. Please use the "nodePath" option instead.`);let c=ye(r,`The "nodePath" option`),l=C.resolve(a,c),u={...s,nodePath:l,node:n,cwd:a};if(!n)return[e,t,u];if(C.basename(e,`.exe`)===`node`)throw TypeError(`When the "node" option is true, the first argument does not need to be "node".`);return[l,[...i,e,...t],{ipc:!0,...u,shell:!1}]},bi=({ipcInput:e,ipc:t,serialization:n})=>{if(e!==void 0){if(!t)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");xi[n](e)}},xi={advanced:e=>{try{oe(e)}catch(e){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},json:e=>{try{JSON.stringify(e)}catch(e){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}}},Si=async(e,t)=>{t!==void 0&&await e.sendMessage(t)},Ci=({encoding:e})=>{if(Ti.has(e))return;let t=Ei(e);if(t!==void 0)throw TypeError(`Invalid option \`encoding: ${Oi(e)}\`.
|
|
21
|
-
Please rename it to ${Oi(t)}.`);let n=[...Ti].map(e=>Oi(e)).join(`, `);throw TypeError(`Invalid option \`encoding: ${Oi(e)}\`.
|
|
22
|
-
Please rename it to one of: ${n}.`)},wi=new Set([`utf8`,`utf16le`]),W=new Set([`buffer`,`hex`,`base64`,`base64url`,`latin1`,`ascii`]),Ti=new Set([...wi,...W]),Ei=e=>{if(e===null)return`buffer`;if(typeof e!=`string`)return;let t=e.toLowerCase();if(t in Di)return Di[t];if(Ti.has(t))return t},Di={"utf-8":`utf8`,"utf-16le":`utf16le`,"ucs-2":`utf16le`,ucs2:`utf16le`,binary:`latin1`},Oi=e=>typeof e==`string`?`"${e}"`:String(e),ki=(e=Ai())=>{let t=ye(e,`The "cwd" option`);return C.resolve(t)},Ai=()=>{try{return _.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},ji=(e,t)=>{if(t===Ai())return e;let n;try{n=de(t)}catch(n){return`The "cwd" option is invalid: ${t}.\n${n.message}\n${e}`}return n.isDirectory()?e:`The "cwd" option is not a directory: ${t}.\n${e}`};var Mi=e(n(),1);const Ni=(e,t,n)=>{n.cwd=ki(n.cwd);let[r,i,a]=yi(e,t,n),{command:o,args:s,options:c}=Mi.default._parse(r,i,a),l=Pi(qe(c));return hi(l),Ci(l),bi(l),Jn(l),di(l),l.shell=Se(l.shell),l.env=Fi(l),l.killSignal=An(l.killSignal),l.forceKillAfterDelay=Bn(l.forceKillAfterDelay),l.lines=l.lines.map((e,t)=>e&&!W.has(l.encoding)&&l.buffer[t]),_.platform===`win32`&&C.basename(o,`.exe`)===`cmd`&&s.unshift(`/q`),{file:o,commandArguments:s,options:l}},Pi=({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:r=n,encoding:i=`utf8`,reject:a=!0,cleanup:o=!0,all:s=!1,windowsHide:c=!0,killSignal:l=`SIGTERM`,forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m=`advanced`,...h})=>({...h,extendEnv:e,preferLocal:t,cwd:n,localDirectory:r,encoding:i,reject:a,cleanup:o,all:s,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),Fi=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:a})=>{let o=t?{..._.env,...e}:e;return n||r?ln({env:o,cwd:i,execPath:a,preferLocal:n,addExecPath:r}):o},Ii=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n];function Li(e){if(typeof e==`string`)return Ri(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw Error(`Input must be a string or a Uint8Array`);return zi(e)}const Ri=e=>e.at(-1)===Bi?e.slice(0,e.at(-2)===Hi?-2:-1):e,zi=e=>e.at(-1)===Vi?e.subarray(0,e.at(-2)===Ui?-2:-1):e,Bi=`
|
|
23
|
-
`,Vi=`
|
|
24
|
-
`.codePointAt(0),Hi=`\r`,Ui=`\r`.codePointAt(0);function G(e,{checkOpen:t=!0}={}){return typeof e==`object`&&!!e&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe==`function`}function Wi(e,{checkOpen:t=!0}={}){return G(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write==`function`&&typeof e.end==`function`&&typeof e.writable==`boolean`&&typeof e.writableObjectMode==`boolean`&&typeof e.destroy==`function`&&typeof e.destroyed==`boolean`}function Gi(e,{checkOpen:t=!0}={}){return G(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read==`function`&&typeof e.readable==`boolean`&&typeof e.readableObjectMode==`boolean`&&typeof e.destroy==`function`&&typeof e.destroyed==`boolean`}function Ki(e,t){return Wi(e,t)&&Gi(e,t)}const qi=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);var Ji=class{#e;#t;#n=!1;#r=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){let e=()=>this.#i();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){let t=()=>this.#a(e);return this.#r?this.#r.then(t,t):t()}async#i(){if(this.#n)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(e){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),e}return e.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),e}async#a(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){let t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}};const Yi=Symbol();function Xi(){return this[Yi].next()}Object.defineProperty(Xi,`name`,{value:`next`});function Zi(e){return this[Yi].return(e)}Object.defineProperty(Zi,`name`,{value:`return`});const Qi=Object.create(qi,{next:{enumerable:!0,configurable:!0,writable:!0,value:Xi},return:{enumerable:!0,configurable:!0,writable:!0,value:Zi}});function $i({preventCancel:e=!1}={}){let t=new Ji(this.getReader(),e),n=Object.create(Qi);return n[Yi]=t,n}const ea=e=>{if(Gi(e,{checkOpen:!1})&&ia.on!==void 0)return na(e);if(typeof e?.[Symbol.asyncIterator]==`function`)return e;if(ta.call(e)===`[object ReadableStream]`)return $i.call(e);throw TypeError(`The first argument must be a Readable, a ReadableStream, or an async iterable.`)},{toString:ta}=Object.prototype,na=async function*(e){let t=new AbortController,n={};ra(e,t,n);try{for await(let[n]of ia.on(e,`data`,{signal:t.signal}))yield n}catch(e){if(n.error!==void 0)throw n.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},ra=async(e,t,n)=>{try{await ia.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},ia={},aa=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{let l=ea(e),u=t();u.length=0;try{for await(let e of l)sa({convertedChunk:n[la(e)](e,u),state:u,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c});return oa({state:u,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,maxBuffer:c}),s(u)}catch(e){let t=typeof e==`object`&&e?e:Error(e);throw t.bufferedData=s(u),t}},oa=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&sa({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},sa=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){ca(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&ca(c,t,i,a),new da},ca=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},la=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=ua.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&ua.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:ua}=Object.prototype;var da=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const K=e=>e,fa=()=>void 0,pa=({contents:e})=>e,ma=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},ha=e=>e.length;async function ga(e,t){return aa(e,_a,t)}const _a={init:()=>({contents:[]}),convertChunk:{string:K,buffer:K,arrayBuffer:K,dataView:K,typedArray:K,others:K},getSize:()=>1,truncateChunk:fa,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:fa,finalize:pa};async function va(e,t){return aa(e,Ma,t)}const ya=()=>({contents:new ArrayBuffer(0)}),ba=e=>xa.encode(e),xa=new TextEncoder,Sa=e=>new Uint8Array(e),Ca=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),wa=(e,t)=>e.slice(0,t),Ta=(e,{contents:t,length:n},r)=>{let i=ja()?Da(t,r):Ea(t,r);return new Uint8Array(i).set(e,n),i},Ea=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(Oa(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},Da=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:Oa(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},Oa=e=>ka**Math.ceil(Math.log(e)/Math.log(ka)),ka=2,Aa=({contents:e,length:t})=>ja()?e:e.slice(0,t),ja=()=>`resize`in ArrayBuffer.prototype,Ma={init:ya,convertChunk:{string:ba,buffer:Sa,arrayBuffer:Sa,dataView:Ca,typedArray:Ca,others:ma},getSize:ha,truncateChunk:wa,addChunk:Ta,getFinalChunk:fa,finalize:Aa};async function Na(e,t){return aa(e,Ia,t)}const Pa=()=>({contents:``,textDecoder:new TextDecoder}),Fa=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Ia={init:Pa,convertChunk:{string:K,buffer:Fa,arrayBuffer:Fa,dataView:Fa,typedArray:Fa,others:ma},getSize:ha,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},finalize:pa},La=({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:a})=>{if(!(e instanceof da))throw e;if(a===`all`)return e;throw e.maxBufferInfo={fdNumber:a,unit:Ra(n,r,i)},t.destroy(),e},Ra=(e,t,n)=>e?`objects`:t?`lines`:n===`buffer`?`bytes`:`characters`,za=(e,t,n)=>{if(t.length!==n)return;let r=new da;throw r.maxBufferInfo={fdNumber:`ipc`},r},Ba=(e,t)=>{let{streamName:n,threshold:r,unit:i}=Va(e,t);return`Command's ${n} was larger than ${r} ${i}`},Va=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:`output`,threshold:t[1],unit:`bytes`};let{maxBufferInfo:{fdNumber:n,unit:r}}=e;delete e.maxBufferInfo;let i=P(t,n);return n===`ipc`?{streamName:`IPC output`,threshold:i,unit:`messages`}:{streamName:Ke(n),threshold:i,unit:r}},Ha=(e,t,n)=>e?.code===`ENOBUFS`&&t!==null&&t.some(e=>e!==null&&e.length>Wa(n)),Ua=(e,t,n)=>{if(!t)return e;let r=Wa(n);return e.length>r?e.slice(0,r):e},Wa=([,e])=>e,Ga=({stdio:e,all:t,ipcOutput:n,originalError:r,signal:i,signalDescription:a,exitCode:o,escapedCommand:s,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:_})=>{let v=r?.code,y=Ka({originalError:r,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:v,signal:i,signalDescription:a,exitCode:o,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),b=Ja(r,_),x=`${y}: ${s}${b===void 0?``:`\n${b}`}`;return{originalMessage:b,shortMessage:x,message:[x,...t===void 0?[e[2],e[1]]:[t],...e.slice(3),n.map(e=>Ya(e)).join(`
|
|
25
|
-
`)].map(e=>mt(Li(Xa(e)))).filter(Boolean).join(`
|
|
26
|
-
|
|
27
|
-
`)}},Ka=({originalError:e,timedOut:t,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:a,signal:o,signalDescription:s,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=qa(d,f);return t?`Command timed out after ${n} milliseconds${m}`:u?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${o} (${s})`:l?`Command was canceled${m}`:r?`${Ba(e,i)}${m}`:a===void 0?d?`Command was killed with ${p} (${zn(p)})${m}`:o===void 0?c===void 0?`Command failed`:`Command failed with exit code ${c}`:`Command was killed with ${o} (${s})`:`Command failed with ${a}${m}`},qa=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:``,Ja=(e,t)=>{if(e instanceof L)return;let n=mt(ji(fn(e)?e.originalMessage:String(e?.message??e),t));return n===``?void 0:n},Ya=e=>typeof e==`string`?e:m(e),Xa=e=>Array.isArray(e)?e.map(e=>Li(Za(e))).filter(Boolean).join(`
|
|
28
|
-
`):Za(e),Za=e=>typeof e==`string`?e:A(e)?ke(e):``,Qa=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:a},startTime:o})=>no({command:e,escapedCommand:t,cwd:a,durationMs:tn(o),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),$a=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:o})=>eo({error:e,command:t,escapedCommand:n,startTime:a,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:o}),eo=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:_,cwd:v,maxBuffer:y},isSync:b})=>{let{exitCode:x,signal:S,signalDescription:C}=ro(l,u),{originalMessage:w,shortMessage:ee,message:te}=Ga({stdio:d,all:f,ipcOutput:p,originalError:e,signal:S,signalDescription:C,exitCode:x,escapedCommand:n,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:_,maxBuffer:y,timeout:h,cwd:v}),T=un(e,te,b);return Object.assign(T,to({error:T,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:x,signal:S,signalDescription:C,stdio:d,all:f,ipcOutput:p,cwd:v,originalMessage:w,shortMessage:ee})),T},to=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:_})=>no({shortMessage:_,originalMessage:g,command:t,escapedCommand:n,cwd:h,durationMs:tn(r),failed:!0,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isTerminated:u!==void 0,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:e.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),no=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),ro=(e,t)=>{let n=e===null?void 0:e,r=t===null?void 0:t;return{exitCode:n,signal:r,signalDescription:r===void 0?void 0:zn(t)}},io=e=>Number.isFinite(e)?e:0;function ao(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(io(e*1e3)%1e3),nanoseconds:Math.trunc(io(e*1e6)%1e3)}}function oo(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function so(e){switch(typeof e){case`number`:if(Number.isFinite(e))return ao(e);break;case`bigint`:return oo(e)}throw TypeError(`Expected a finite number or bigint`)}const co=e=>e===0||e===0n,lo=(e,t)=>t===1||t===1n?e:`${e}s`,uo=24n*60n*60n*1000n;function fo(e,t){let n=typeof e==`bigint`;if(!n&&!Number.isFinite(e))throw TypeError(`Expected a finite number or bigint`);t={...t};let r=e<0?`-`:``;e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[],a=(e,t)=>{let n=Math.floor(e*10**t+1e-7);return(Math.round(n)/10**t).toFixed(t)},o=(e,n,r,a)=>{if(!((i.length===0||!t.colonNotation)&&co(e)&&!(t.colonNotation&&r===`m`))){if(a??=String(e),t.colonNotation){let e=a.includes(`.`)?a.split(`.`)[0].length:a.length,t=i.length>0?2:1;a=`0`.repeat(Math.max(0,t-e))+a}else a+=t.verbose?` `+lo(n,e):r;i.push(a)}},s=so(e),c=BigInt(s.days);if(t.hideYearAndDays?o(BigInt(c)*24n+BigInt(s.hours),`hour`,`h`):(t.hideYear?o(c,`day`,`d`):(o(c/365n,`year`,`y`),o(c%365n,`day`,`d`)),o(Number(s.hours),`hour`,`h`)),o(Number(s.minutes),`minute`,`m`),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let e=Number(s.seconds),n=Number(s.milliseconds),r=Number(s.microseconds),i=Number(s.nanoseconds);if(o(e,`second`,`s`),t.formatSubMilliseconds)o(n,`millisecond`,`ms`),o(r,`microsecond`,`µs`),o(i,`nanosecond`,`ns`);else{let e=n+r/1e3+i/1e6,a=typeof t.millisecondsDecimalDigits==`number`?t.millisecondsDecimalDigits:0,s=a?e.toFixed(a):e>=1?Math.round(e):Math.ceil(e);o(Number.parseFloat(s),`millisecond`,`ms`,s)}}else{let r=a((n?Number(e%uo):e)/1e3%60,typeof t.secondsDecimalDigits==`number`?t.secondsDecimalDigits:1),i=t.keepDecimalsOnWholeSeconds?r:r.replace(/\.0+$/,``);o(Number.parseFloat(i),`second`,`s`,i)}if(i.length===0)return r+`0`+(t.verbose?` milliseconds`:`ms`);let l=t.colonNotation?`:`:` `;return typeof t.unitCount==`number`&&(i=i.slice(0,Math.max(t.unitCount,1))),r+i.join(l)}const po=(e,t)=>{e.failed&&I({type:`error`,verboseMessage:e.shortMessage,verboseInfo:t,result:e})},mo=(e,t)=>{ot(t)&&(po(e,t),ho(e,t))},ho=(e,t)=>{I({type:`duration`,verboseMessage:`(done in ${fo(e.durationMs)})`,verboseInfo:t,result:e})},go=(e,t,{reject:n})=>{if(mo(e,t),e.failed&&n)throw e;return e},_o=(e,t)=>q(e)?`asyncGenerator`:Eo(e)?`generator`:Oo(e)?`fileUrl`:Ao(e)?`filePath`:Lo(e)?`webStream`:G(e,{checkOpen:!1})?`native`:A(e)?`uint8Array`:zo(e)?`asyncIterable`:Bo(e)?`iterable`:Ro(e)?bo({transform:e},t):Do(e)?vo(e,t):`native`,vo=(e,t)=>Ki(e.transform,{checkOpen:!1})?yo(e,t):Ro(e.transform)?bo(e,t):Co(e,t),yo=(e,t)=>(xo(e,t,`Duplex stream`),`duplex`),bo=(e,t)=>(xo(e,t,`web TransformStream`),`webTransform`),xo=({final:e,binary:t,objectMode:n},r,i)=>{So(e,`${r}.final`,i),So(t,`${r}.binary`,i),wo(n,`${r}.objectMode`)},So=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},Co=({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!To(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Ki(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(Ro(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!To(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return wo(n,`${i}.binary`),wo(r,`${i}.objectMode`),q(e)||q(t)?`asyncGenerator`:`generator`},wo=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`The \`${t}\` option must use a boolean.`)},To=e=>q(e)||Eo(e),q=e=>Object.prototype.toString.call(e)===`[object AsyncGeneratorFunction]`,Eo=e=>Object.prototype.toString.call(e)===`[object GeneratorFunction]`,Do=e=>k(e)&&(e.transform!==void 0||e.final!==void 0),Oo=e=>Object.prototype.toString.call(e)===`[object URL]`,ko=e=>Oo(e)&&e.protocol!==`file:`,Ao=e=>k(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>jo.has(e))&&Mo(e.file),jo=new Set([`file`,`append`]),Mo=e=>typeof e==`string`,No=(e,t)=>e===`native`&&typeof t==`string`&&!Po.has(t),Po=new Set([`ipc`,`ignore`,`inherit`,`overlapped`,`pipe`]),Fo=e=>Object.prototype.toString.call(e)===`[object ReadableStream]`,Io=e=>Object.prototype.toString.call(e)===`[object WritableStream]`,Lo=e=>Fo(e)||Io(e),Ro=e=>Fo(e?.readable)&&Io(e?.writable),zo=e=>Vo(e)&&typeof e[Symbol.asyncIterator]==`function`,Bo=e=>Vo(e)&&typeof e[Symbol.iterator]==`function`,Vo=e=>typeof e==`object`&&!!e,J=new Set([`generator`,`asyncGenerator`,`duplex`,`webTransform`]),Ho=new Set([`fileUrl`,`filePath`,`fileNumber`]),Uo=new Set([`fileUrl`,`filePath`]),Wo=new Set([...Uo,`webStream`,`nodeStream`]),Go=new Set([`webTransform`,`duplex`]),Ko={generator:`a generator`,asyncGenerator:`an async generator`,fileUrl:`a file URL`,filePath:`a file path string`,fileNumber:`a file descriptor number`,webStream:`a web stream`,nodeStream:`a Node.js stream`,webTransform:`a web TransformStream`,duplex:`a Duplex stream`,native:`any value`,iterable:`an iterable`,asyncIterable:`an async iterable`,string:`a string`,uint8Array:`a Uint8Array`},qo=(e,t,n,r)=>r===`output`?Jo(e,t,n):Yo(e,t,n),Jo=(e,t,n)=>{let r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},Yo=(e,t,n)=>{let r=t===0?e===!0:n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t!==n.length-1&&(e??r)}},Xo=(e,t)=>{let n=e.findLast(({type:e})=>J.has(e));return n===void 0?!1:t===`input`?n.value.writableObjectMode:n.value.readableObjectMode},Zo=(e,t,n,r)=>[...e.filter(({type:e})=>!J.has(e)),...Qo(e,t,n,r)],Qo=(e,t,n,{encoding:r})=>{let i=e.filter(({type:e})=>J.has(e)),a=Array.from({length:i.length});for(let[e,o]of Object.entries(i))a[e]=$o({stdioItem:o,index:Number(e),newTransforms:a,optionName:t,direction:n,encoding:r});return rs(a,n)},$o=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:a,encoding:o})=>t===`duplex`?es({stdioItem:e,optionName:i}):t===`webTransform`?ts({stdioItem:e,index:n,newTransforms:r,direction:a}):ns({stdioItem:e,index:n,newTransforms:r,direction:a,encoding:o}),es=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:a})=>{if(i&&!r)throw TypeError(`The \`${a}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw TypeError(`The \`${a}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:n,readableObjectMode:r}}},ts=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{let{transform:a,objectMode:o}=k(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:c}=qo(o,n,r,i);return{...e,value:{transform:a,writableObjectMode:s,readableObjectMode:c}}},ns=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i,encoding:a})=>{let{transform:o,final:s,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=k(t)?t:{transform:t},d=c||W.has(a),{writableObjectMode:f,readableObjectMode:p}=qo(u,n,r,i);return{...e,value:{transform:o,final:s,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},rs=(e,t)=>t===`input`?e.reverse():e,is=(e,t,n)=>{let r=e.map(e=>as(e,t));if(r.includes(`input`)&&r.includes(`output`))throw TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??us},as=({type:e,value:t},n)=>os[n]??cs[e](t),os=[`input`,`output`,`output`],Y=()=>void 0,ss=()=>`input`,cs={generator:Y,asyncGenerator:Y,fileUrl:Y,filePath:Y,iterable:ss,asyncIterable:ss,uint8Array:ss,webStream:e=>Io(e)?`output`:`input`,nodeStream(e){return Gi(e,{checkOpen:!1})?Wi(e,{checkOpen:!1})?void 0:`input`:`output`},webTransform:Y,duplex:Y,native(e){let t=ls(e);if(t!==void 0)return t;if(G(e,{checkOpen:!1}))return cs.nodeStream(e)}},ls=e=>{if([0,_.stdin].includes(e))return`input`;if([1,2,_.stdout,_.stderr].includes(e))return`output`},us=`output`,ds=(e,t)=>t&&!e.includes(`ipc`)?[...e,`ipc`]:e,fs=({stdio:e,ipc:t,buffer:n,...r},i,a)=>{let o=ps(e,r).map((e,t)=>hs(e,t));return a?gs(o,n,i):ds(o,t)},ps=(e,t)=>{if(e===void 0)return N.map(e=>t[e]);if(ms(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${N.map(e=>`\`${e}\``).join(`, `)}`);if(typeof e==`string`)return[e,e,e];if(!Array.isArray(e))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let n=Math.max(e.length,N.length);return Array.from({length:n},(t,n)=>e[n])},ms=e=>N.some(t=>e[t]!==void 0),hs=(e,t)=>Array.isArray(e)?e.map(e=>hs(e,t)):e??(t>=N.length?`ignore`:`pipe`),gs=(e,t,n)=>e.map((e,r)=>!t[r]&&r!==0&&!st(n,r)&&_s(e)?`ignore`:e),_s=e=>e===`pipe`||Array.isArray(e)&&e.every(e=>e===`pipe`),vs=({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:a})=>!n||t!==`native`?e:a?ys({stdioItem:e,fdNumber:r,direction:i}):Ss({stdioItem:e,fdNumber:r}),ys=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{let a=bs({value:t,optionName:n,fdNumber:r,direction:i});if(a!==void 0)return a;if(G(t,{checkOpen:!1}))throw TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},bs=({value:e,optionName:t,fdNumber:n,direction:r})=>{let i=xs(e,n);if(i!==void 0){if(r===`output`)return{type:`fileNumber`,value:i,optionName:t};if(S.isatty(i))throw TypeError(`The \`${t}: ${Sr(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:`uint8Array`,value:j(ue(i)),optionName:t}}},xs=(e,t)=>{if(e===`inherit`)return t;if(typeof e==`number`)return e;let n=Ge.indexOf(e);if(n!==-1)return n},Ss=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t===`inherit`?{type:`nodeStream`,value:Cs(r,t,n),optionName:n}:typeof t==`number`?{type:`nodeStream`,value:Cs(t,t,n),optionName:n}:G(t,{checkOpen:!1})?{type:`nodeStream`,value:t,optionName:n}:e,Cs=(e,t,n)=>{let r=Ge[e];if(r===void 0)throw TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},ws=({input:e,inputFile:t},n)=>n===0?[...Ts(e),...Ds(t)]:[],Ts=e=>e===void 0?[]:[{type:Es(e),value:e,optionName:`input`}],Es=e=>{if(Gi(e,{checkOpen:!1}))return`nodeStream`;if(typeof e==`string`)return`string`;if(A(e))return`uint8Array`;throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Ds=e=>e===void 0?[]:[{...Os(e),optionName:`inputFile`}],Os=e=>{if(Oo(e))return{type:`fileUrl`,value:e};if(Mo(e))return{type:`filePath`,value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},ks=e=>e.filter((t,n)=>e.every((e,r)=>t.value!==e.value||n>=r||t.type===`generator`||t.type===`asyncGenerator`)),As=({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:a})=>{let o=js(i,e);if(o.length!==0){if(a){Ms({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});return}if(Wo.has(e))return Ns({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});Go.has(e)&&Fs({otherStdioItems:o,type:e,value:t,optionName:n})}},js=(e,t)=>e.flatMap(({direction:e,stdioItems:n})=>n.filter(e=>e.type===t).map((t=>({...t,direction:e})))),Ms=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{Uo.has(t)&&Ns({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},Ns=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{let a=e.filter(e=>Ps(e,n));if(a.length!==0)return Is(a.find(e=>e.direction!==i),r,t),i===`output`?a[0].stream:void 0},Ps=({type:e,value:t},n)=>e===`filePath`?t.file===n.file:e===`fileUrl`?t.href===n.href:t===n,Fs=({otherStdioItems:e,type:t,value:n,optionName:r})=>{Is(e.find(({value:{transform:e}})=>e===n.transform),r,t)},Is=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${Ko[n]} that is the same.`)},Ls=(e,t,n,r)=>{let i=Ks({initialFileDescriptors:fs(t,n,r).map((e,n)=>Rs({stdioOption:e,fdNumber:n,options:t,isSync:r})),addProperties:e,options:t,isSync:r});return t.stdio=i.map(({stdioItems:e})=>Xs(e)),i},Rs=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{let i=Ke(t),{stdioItems:a,isStdioArray:o}=zs({stdioOption:e,fdNumber:t,options:n,optionName:i}),s=is(a,t,i),c=Zo(a.map(e=>vs({stdioItem:e,isStdioArray:o,fdNumber:t,direction:s,isSync:r})),i,s,n),l=Xo(c,s);return Gs(c,l),{direction:s,objectMode:l,stdioItems:c}},zs=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{let i=ks([...(Array.isArray(e)?e:[e]).map(e=>Bs(e,r)),...ws(n,t)]),a=i.length>1;return Vs(i,a,r),Us(i),{stdioItems:i,isStdioArray:a}},Bs=(e,t)=>({type:_o(e,t),value:e,optionName:t}),Vs=(e,t,n)=>{if(e.length===0)throw TypeError(`The \`${n}\` option must not be an empty array.`);if(t){for(let{value:t,optionName:n}of e)if(Hs.has(t))throw Error(`The \`${n}\` option must not include \`${t}\`.`)}},Hs=new Set([`ignore`,`ipc`]),Us=e=>{for(let t of e)Ws(t)},Ws=({type:e,value:t,optionName:n})=>{if(ko(t))throw TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
|
|
29
|
-
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(No(e,t))throw TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},Gs=(e,t)=>{if(!t)return;let n=e.find(({type:e})=>Ho.has(e));if(n!==void 0)throw TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},Ks=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{let i=[];try{for(let a of e)i.push(qs({fileDescriptor:a,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(e){throw Ys(i),e}},qs=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:a,isSync:o})=>({direction:e,objectMode:t,stdioItems:n.map(t=>Js({stdioItem:t,addProperties:i,direction:e,options:a,fileDescriptors:r,isSync:o}))}),Js=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:a})=>{let o=As({stdioItem:e,direction:n,fileDescriptors:i,isSync:a});return o===void 0?{...e,...t[n][e.type](e,r)}:{...e,stream:o}},Ys=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)e!==void 0&&!M(e)&&e.destroy()},Xs=e=>{if(e.length>1)return e.some(({value:e})=>e===`overlapped`)?`overlapped`:`pipe`;let[{type:t,value:n}]=e;return t===`native`?n:`pipe`},Zs=(e,t)=>Ls(tc,e,t,!0),X=({type:e,optionName:t})=>{$s(t,Ko[e])},Qs=({optionName:e,value:t})=>((t===`ipc`||t===`overlapped`)&&$s(e,`"${t}"`),{}),$s=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},ec={generator(){},asyncGenerator:X,webStream:X,nodeStream:X,webTransform:X,duplex:X,asyncIterable:X,native:Qs},tc={input:{...ec,fileUrl:({value:e})=>({contents:[j(ue(e))]}),filePath:({value:{file:e}})=>({contents:[j(ue(e))]}),fileNumber:X,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...ec,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:X,string:X,uint8Array:X}},Z=(e,{stripFinalNewline:t},n)=>nc(t,n)&&e!==void 0&&!Array.isArray(e)?Li(e):e,nc=(e,t)=>t===`all`?e[1]||e[2]:e[t],rc=(e,t,n,r)=>e||n?void 0:oc(t,r),ic=(e,t,n)=>n?e.flatMap(e=>ac(e,t)):ac(e,t),ac=(e,t)=>{let{transform:n,final:r}=oc(t,{});return[...n(e),...r()]},oc=(e,t)=>(t.previousChunks=``,{transform:sc.bind(void 0,t,e),final:lc.bind(void 0,t)}),sc=function*(e,t,n){if(typeof n!=`string`){yield n;return}let{previousChunks:r}=e,i=-1;for(let a=0;a<n.length;a+=1)if(n[a]===`
|
|
30
|
-
`){let o=cc(n,a,t,e),s=n.slice(i+1,a+1-o);r.length>0&&(s=fc(r,s),r=``),yield s,i=a}i!==n.length-1&&(r=fc(r,n.slice(i+1))),e.previousChunks=r},cc=(e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]===`\r`,r.isWindowsNewline?2:1),lc=function*({previousChunks:e}){e.length>0&&(yield e)},uc=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:dc.bind(void 0,r)},dc=function*({isWindowsNewline:e=!1},t){let{unixNewline:n,windowsNewline:r,LF:i,concatBytes:a}=typeof t==`string`?pc:mc;if(t.at(-1)===i){yield t;return}yield a(t,e?r:n)},fc=(e,t)=>`${e}${t}`,pc={windowsNewline:`\r
|
|
31
|
-
`,unixNewline:`
|
|
32
|
-
`,LF:`
|
|
33
|
-
`,concatBytes:fc},mc={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}},hc=(e,t)=>e?void 0:gc.bind(void 0,t),gc=function*(e,t){if(typeof t!=`string`&&!A(t)&&!ve.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},_c=(e,t)=>e?vc.bind(void 0,t):yc.bind(void 0,t),vc=function*(e,t){bc(e,t),yield t},yc=function*(e,t){if(bc(e,t),typeof t!=`string`&&!A(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},bc=(e,t)=>{if(t==null)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
|
|
34
|
-
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
35
|
-
if (condition) { yield value; }`)},xc=(e,t,n)=>{if(n)return;if(e)return{transform:Sc.bind(void 0,new TextEncoder)};let r=new u(t);return{transform:Cc.bind(void 0,r),final:wc.bind(void 0,r)}},Sc=function*(e,t){ve.isBuffer(t)?yield j(t):typeof t==`string`?yield e.encode(t):yield t},Cc=function*(e,t){yield A(t)?e.write(t):t},wc=function*(e){let t=e.end();t!==``&&(yield t)},Tc=f(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),Ec=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Ac}=t[n];for await(let i of r(e))yield*Ec(i,t,n+1)},Dc=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Oc(n,Number(t),e)},Oc=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*Ec(r,n,t+1)},kc=f(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Ac=function*(e){yield e},jc=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},Mc=(e,t)=>[...t.flatMap(t=>[...Q(t,e,0)]),...Nc(e)],Q=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Fc}=t[n];for(let i of r(e))yield*Q(i,t,n+1)},Nc=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Pc(n,Number(t),e)},Pc=function*(e,t,n){if(e!==void 0)for(let r of e())yield*Q(r,n,t+1)},Fc=function*(e){yield e},Ic=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=Rc(e,o,a),l=q(t),u=q(n),d=l?Tc.bind(void 0,Ec,s):jc.bind(void 0,Q),f=l||u?Tc.bind(void 0,Dc,s):jc.bind(void 0,Nc),p=l||u?kc.bind(void 0,s):void 0;return{stream:new he({writableObjectMode:r,writableHighWaterMark:_e(r),readableObjectMode:i,readableHighWaterMark:_e(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p})}},Lc=(e,t,n,r)=>{let i=t.filter(({type:e})=>e===`generator`),a=r?i.reverse():i;for(let{value:t,optionName:r}of a)e=Mc(Rc(t,n,r),e);return e},Rc=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:hc(r,s)},xc(n,o,r),rc(n,a,r,c),{transform:e,final:t},{transform:_c(i,s)},uc({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)},zc=(e,t)=>{for(let n of Bc(e))Vc(e,n,t)},Bc=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),Vc=(e,t,n)=>{let{stdioItems:r}=e[t],i=r.filter(({contents:e})=>e!==void 0);if(i.length!==0){if(t!==0){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${Ko[e]} with synchronous methods.`)}n.input=Me(i.map(({contents:e})=>e).map(e=>Hc(e,r)))}},Hc=(e,t)=>{let n=Lc(e,t,`utf8`,!0);return Uc(n),Me(n)},Uc=e=>{let t=e.find(e=>typeof e!=`string`&&!A(e));if(t!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},Wc=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&st(n,r)&&!W.has(t)&&Gc(r)&&(e.some(({type:e,value:t})=>e===`native`&&Kc.has(t))||e.every(({type:e})=>J.has(e))),Gc=e=>e===1||e===2,Kc=new Set([`pipe`,`overlapped`]),qc=async(e,t,n,r)=>{for await(let i of e)Yc(t)||Xc(i,n,r)},Jc=(e,t,n)=>{for(let r of e)Xc(r,t,n)},Yc=e=>e._readableState.pipes.length>0,Xc=(e,t,n)=>{I({type:`output`,verboseMessage:qt(e),fdNumber:t,verboseInfo:n})},Zc=({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};let a={},o=new Set([]);return{output:t.map((t,s)=>Qc({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...a}},Qc=({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:a,verboseInfo:o},{buffer:s,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(e===null)return;let f=j(Ua(e,a,d)),{stdioItems:p,objectMode:m}=t[n],{serializedResult:h,finalResult:g=h}=el({chunks:$c([f],p,c,r),objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});tl({serializedResult:h,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:p,objectMode:m});let _=s[n]?g:void 0;try{return r.error===void 0&&nl(h,p,i),_}catch(e){return r.error=e,_}},$c=(e,t,n,r)=>{try{return Lc(e,t,n,!1)}catch(t){return r.error=t,e}},el=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:a})=>{if(t)return{serializedResult:e};if(n===`buffer`)return{serializedResult:Me(e)};let o=Ae(e,n);return r[a]?{serializedResult:o,finalResult:ic(o,!i[a],t)}:{serializedResult:o}},tl=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!Wc({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=ic(e,!1,o);try{Jc(s,t,r)}catch(e){n.error??=e}},nl=(e,t,n)=>{for(let{path:r,append:i}of t.filter(({type:e})=>Ho.has(e))){let t=typeof r==`string`?r:r.toString();i||n.has(t)?se(r,e):(n.add(t),fe(r,e))}},rl=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Z(t,n,`all`)]:Array.isArray(t)?[Z(e,n,`all`),...t]:A(e)&&A(t)?Pe([e,t]):`${e}${t}`},il=async(e,t)=>{let[n,r]=await al(e);return t.isForcefullyTerminated??=!1,[n,r]},al=async e=>{let[t,n]=await Promise.allSettled([E(e,`spawn`),E(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?ol(e):n.value},ol=async e=>{try{return await E(e,`exit`)}catch{return ol(e)}},sl=async e=>{let[t,n]=await e;if(!cl(t,n)&&ll(t,n))throw new L;return[t,n]},cl=(e,t)=>e===void 0&&t===void 0,ll=(e,t)=>e!==0||t!==null,ul=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=dl(e,t,n);return{resultError:a,exitCode:t,signal:n,timedOut:a?.code===`ETIMEDOUT`,isMaxBuffer:Ha(a,r,i)}},dl=(e,t,n)=>e===void 0?ll(t,n)?new L:void 0:e,fl=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=pl(e,t,n);return go(_l({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s}),c,l)},pl=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=nn(e,t,n),{file:s,commandArguments:c,options:l}=Ni(e,t,ml(n));return hl(l),{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:l,fileDescriptors:Zs(l,o)}},ml=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,hl=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&gl(`ipcInput`),e&&gl(`ipc: true`),n&&gl(`detached: true`),r&&gl(`cancelSignal`)},gl=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},_l=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=vl({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:s});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=ul(c,n),{output:m,error:h=l}=Zc({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a});return bl({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:m.map((e,t)=>Z(e,n,t)),all:Z(rl(m,n),n,`all`),options:n,command:r,escapedCommand:i,startTime:s})},vl=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{return zc(a,n),l(...Ii(e,t,yl(n)))}catch(e){return $a({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},yl=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:Wa(t)}),bl=({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:i,stdio:a,all:o,options:s,command:c,escapedCommand:l,startTime:u})=>e===void 0?Qa({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):eo({error:e,command:c,escapedCommand:l,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:a,all:o,ipcOutput:[],options:s,startTime:u,isSync:!0}),xl=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:a}={})=>(Zn({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:Ir(e)}),Sl({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:i})),Sl=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{wr(t,i);let a=Nr(e,t,n),o=new AbortController;try{return await Promise.race([Cl(a,r,o),wl(a,n,o),Tl(a,n,o)])}catch(t){throw pr(e),t}finally{o.abort(),Er(t,i)}},Cl=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await E(e,`message`,{signal:n});return t}for await(let[r]of ie(e,`message`,{signal:n}))if(t(r))return r},wl=async(e,t,{signal:n})=>{await E(e,`disconnect`,{signal:n}),er(t)},Tl=async(e,t,{signal:n})=>{let[r]=await E(e,`strict:error`,{signal:n});throw nr(r,t)},El=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>Dl({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),Dl=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:a})=>{Zn({methodName:`getEachMessage`,isSubprocess:n,ipc:r,isConnected:Ir(e)}),wr(t,a);let o=Nr(e,t,n),s=new AbortController,c={};return Ol(e,o,s),kl({ipcEmitter:o,isSubprocess:n,controller:s,state:c}),Al({anyProcess:e,channel:t,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:s,state:c,reference:a})},Ol=async(e,t,n)=>{try{await E(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},kl=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await E(e,`strict:error`,{signal:n.signal});r.error=nr(i,t),n.abort()}catch{}},Al=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:a,state:o,reference:s}){try{for await(let[e]of ie(n,`message`,{signal:a.signal}))jl(o),yield e}catch{jl(o)}finally{a.abort(),Er(t,s),r||pr(e),i&&await e}},jl=({error:e})=>{if(e)throw e},Ml=(e,{ipc:t})=>{Object.assign(e,Pl(e,!1,t))},Nl=()=>{let e=_,t=_.channel!==void 0;return{...Pl(e,!0,t),getCancelSignal:ii.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:t})}},Pl=(e,t,n)=>({sendMessage:Qr.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:xl.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:El.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),Fl=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,verboseInfo:s})=>{Ys(r);let c=new o;return Il(c,r),Object.assign(c,{readable:Rl,writable:zl,duplex:Bl}),{subprocess:c,promise:Vl($a({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:!1}),s,i)}},Il=(e,t)=>{let n=Ll(),r=Ll(),i=Ll(),a=Array.from({length:t.length-3},Ll),o=Ll(),s=[n,r,i,...a];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:o,stdio:s})},Ll=()=>{let e=new me;return e.end(),e},Rl=()=>new O({read(){}}),zl=()=>new ge({write(){}}),Bl=()=>new pe({read(){},write(){}}),Vl=async(e,t,n)=>go(e,t,n),Hl=(e,t)=>Ls(Gl,e,t,!1),Ul=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${Ko[e]}.`)},Wl={fileNumber:Ul,generator:Ic,asyncGenerator:Ic,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:pe.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Gl={input:{...Wl,fileUrl:({value:e})=>({stream:ce(e)}),filePath:({value:{file:e}})=>({stream:ce(e)}),webStream:({value:e})=>({stream:O.fromWeb(e)}),iterable:({value:e})=>({stream:O.from(e)}),asyncIterable:({value:e})=>({stream:O.from(e)}),string:({value:e})=>({stream:O.from(e)}),uint8Array:({value:e})=>({stream:O.from(ve.from(e))})},output:{...Wl,fileUrl:({value:e})=>({stream:le(e)}),filePath:({value:{file:e,append:t}})=>({stream:le(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:ge.fromWeb(e)}),iterable:Ul,asyncIterable:Ul,string:Ul,uint8Array:Ul}};function Kl(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)Ql(t);let t=e.some(({readableObjectMode:e})=>e),n=ql(e,t),r=new Jl({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}const ql=(e,t)=>{if(e.length===0)return _e(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)};var Jl=class extends me{#e=new Set([]);#t=new Set([]);#n=new Set([]);#r;#i=Symbol(`unpipe`);#a=new WeakMap;add(e){if(Ql(e),this.#e.has(e))return;this.#e.add(e),this.#r??=Yl(this,this.#e,this.#i);let t=$l({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#n,onFinished:this.#r,unpipeEvent:this.#i});this.#a.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(Ql(e),!this.#e.has(e))return!1;let t=this.#a.get(e);return t===void 0?!1:(this.#a.delete(e),e.unpipe(this),await t,!0)}};const Yl=async(e,t,n)=>{lu(e,uu);let r=new AbortController;try{await Promise.race([Xl(e,r),Zl(e,t,n,r)])}finally{r.abort(),lu(e,-uu)}},Xl=async(e,{signal:t})=>{try{await D(e,{signal:t,cleanup:!0})}catch(t){throw iu(e,t),t}},Zl=async(e,t,n,{signal:r})=>{for await(let[i]of ie(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},Ql=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},$l=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{lu(e,du);let s=new AbortController;try{await Promise.race([eu(a,t,s),tu({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),nu({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),lu(e,-du)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?ou(e):ru(e))},eu=async(e,t,{signal:n})=>{try{await e,n.aborted||ou(t)}catch(e){n.aborted||iu(t,e)}},tu=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await D(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;au(r)?i.add(t):su(e,r)}},nu=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await E(e,i,{signal:a}),!e.readable)return E(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},ru=e=>{e.writable&&e.end()},iu=(e,t)=>{au(t)?ou(e):su(e,t)},au=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,ou=e=>{(e.readable||e.writable)&&e.destroy()},su=(e,t)=>{e.destroyed||(e.once(`error`,cu),e.destroy(t))},cu=()=>{},lu=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},uu=2,du=1,fu=(e,t)=>{e.pipe(t),pu(e,t),hu(e,t)},pu=async(e,t)=>{if(!(M(e)||M(t))){try{await D(e,{cleanup:!0,readable:!0,writable:!1})}catch{}mu(t)}},mu=e=>{e.writable&&e.end()},hu=async(e,t)=>{if(!(M(e)||M(t))){try{await D(t,{cleanup:!0,readable:!1,writable:!0})}catch{}gu(e)}},gu=e=>{e.readable&&e.destroy()},_u=(e,t,n)=>{let r=new Map;for(let[i,{stdioItems:a,direction:o}]of Object.entries(t)){for(let{stream:t}of a.filter(({type:e})=>J.has(e)))vu(e,t,o,i);for(let{stream:t}of a.filter(({type:e})=>!J.has(e)))bu({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r.entries())fu(t.length===1?t[0]:Kl(t),e)},vu=(e,t,n,r)=>{n===`output`?fu(e.stdio[r],t):fu(t,e.stdio[r]);let i=yu[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},yu=[`stdin`,`stdout`,`stderr`],bu=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;xu(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},xu=(e,{signal:t})=>{M(e)&&Cr(e,Su,t)},Su=2,Cu=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let a=i(()=>{e.kill()});re(r,()=>{a()})},wu=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=en(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=Tu(n,r,i),{sourceStream:d,sourceError:f}=Ou(e,l),{options:p,fileDescriptors:m}=V.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},Tu=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=Eu(e,t,...n);return{destination:r,destinationStream:mr(r,a),from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},Eu=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(Du,e)(n,...r),pipeOptions:e};if(typeof n==`string`||n instanceof URL||xe(n)){if(Object.keys(e).length>0)throw TypeError(`Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).`);let[i,a,o]=Ce(n,...r);return{destination:t(Du)(i,a,o),pipeOptions:o}}if(V.has(n)){if(Object.keys(e).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},Du=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),Ou=(e,t)=>{try{return{sourceStream:hr(e,t)}}catch(e){return{sourceError:e}}},ku=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=Au({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw ju({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},Au=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return gu(e),r;if(t!==void 0)return mu(n),t},ju=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>$a({error:e,command:Mu,escapedCommand:Mu,fileDescriptors:t,options:n,startTime:r,isSync:!1}),Mu=`source.pipe(destination)`,Nu=async e=>{let[{status:t,reason:n,value:r=n},{status:i,reason:a,value:o=a}]=await e;if(o.pipedFrom.includes(r)||o.pipedFrom.push(r),i===`rejected`)throw o;if(t===`rejected`)throw r;return o},Pu=(e,t,n)=>{let r=Ru.has(t)?Iu(e,t):Fu(e,t);return Cr(e,zu,n.signal),Cr(t,Bu,n.signal),Lu(t),r},Fu=(e,t)=>{let n=Kl([e]);return fu(n,t),Ru.set(t,n),n},Iu=(e,t)=>{let n=Ru.get(t);return n.add(e),n},Lu=async e=>{try{await D(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Ru.delete(e)},Ru=new WeakMap,zu=2,Bu=1,Vu=(e,t)=>e===void 0?[]:[Hu(e,t)],Hu=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{throw await d(e,t),await n.remove(t),ju({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:r,sourceOptions:i,startTime:a})},Uu=(e,...t)=>{if(k(t[0]))return Uu.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=wu(e,...t),i=Wu({...r,destination:n});return i.pipe=Uu.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},Wu=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l})=>{let u=Gu(e,i);ku({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let d=new AbortController;try{let e=Pu(t,a,d);return await Promise.race([Nu(u),...Vu(s,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},Gu=(e,t)=>Promise.allSettled([e,t]),Ku=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return qu(t,o),Xu({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},qu=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Ju=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;Yu(t,o,e);let s=e.readableObjectMode&&!a;return Xu({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},Yu=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},Xu=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>$u({onStdoutChunk:ie(e,`data`,{signal:t.signal,highWaterMark:Qu,highWatermark:Qu}),controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}),Zu=_e(!0),Qu=Zu,$u=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=ed({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*Q(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*Nc(s)}},ed=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[xc(e,n,!t),rc(e,i,!r,{})].filter(Boolean),td=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:i,maxBuffer:a,lines:o,allMixed:s,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=nd({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([rd(e),d]);return}let f=Ju({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:nc(c,n),allMixed:s}),[p]=await Promise.all([id({stream:e,iterable:f,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return p},nd=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{Wc({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n})&&await qc(Ju({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i}),e,n,a)},rd=async e=>{await ee(),e.readableFlowing===null&&e.resume()},id=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await ga(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await va(n,{maxBuffer:a})):await Na(n,{maxBuffer:a})}catch(n){return od(La({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},ad=async e=>{try{return await e}catch(e){return od(e)}},od=({bufferedData:e})=>Te(e)?new Uint8Array(e):e,sd=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=cd(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],D(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||dd(e,t,n,r)}finally{o.abort()}},cd=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&ld(e,n,r),r},ld=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{ud(t,n),r.call(e,...i)}},ud=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},dd=(e,t,n,r)=>{if(!fd(e,t,n,r))throw e},fd=(e,t,n,r=!0)=>n.propagating?hd(e)||md(e):(n.propagating=!0,pd(n,t)===r?hd(e):md(e)),pd=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,md=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,hd=e=>e?.code===`EPIPE`,gd=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>_d({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),_d=async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l})=>{if(!e)return;let u=sd(e,t,l);if(pd(l,t)){await u;return}let[d]=await Promise.all([td({stream:e,onStreamEnd:u,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l}),u]);return d},vd=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Kl([e,t].filter(Boolean)):void 0,yd=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>_d({...bd(e,n),fdNumber:`all`,encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:xd(e),stripFinalNewline:a,verboseInfo:o,streamInfo:s}),bd=({stdout:e,stderr:t,all:n},[,r,i])=>{let a=r||i;return a?r?i?{stream:n,buffer:a}:{stream:e,buffer:a}:{stream:t,buffer:a}:{stream:n,buffer:a}},xd=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,Sd=e=>st(e,`ipc`),Cd=(e,t)=>{I({type:`ipc`,verboseMessage:qt(e),fdNumber:`ipc`,verboseInfo:t})},wd=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=Sd(a),s=P(t,`ipc`),c=P(n,`ipc`);for await(let t of Dl({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(za(e,i,c),i.push(t)),o&&Cd(t,a);return i},Td=async(e,t)=>(await Promise.allSettled([e]),t),Ed=async({subprocess:e,options:{encoding:t,buffer:n,maxBuffer:r,lines:i,timeoutDuration:a,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:_})=>{let v=il(e,f),y={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:v,propagating:!1},b=gd({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),x=yd({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),S=[],C=wd({subprocess:e,buffer:n,maxBuffer:r,ipc:u,ipcOutput:S,verboseInfo:p}),w=Dd(h,e,y),ee=Od(m,y);try{return await Promise.race([Promise.all([{},sl(v),Promise.all(b),x,C,Si(e,d),...w,...ee]),g,kd(e,_),...gi(e,a,f,_),...Yn({subprocess:e,cancelSignal:o,gracefulCancel:s,context:f,controller:_}),...fi({subprocess:e,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,context:f,controller:_})])}catch(e){return f.terminationReason??=`other`,Promise.all([{error:e},v,Promise.all(b.map(e=>ad(e))),ad(x),Td(C,S),Promise.allSettled(w),Promise.allSettled(ee)])}},Dd=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:sd(e,r,n)),Od=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>G(t,{checkOpen:!1})&&!M(t)).map(({type:e,value:r,stream:i=r})=>sd(i,n,t,{isSameDirection:J.has(e),stopOnExit:e===`native`}))),kd=async(e,{signal:t})=>{let[n]=await E(e,`error`,{signal:t});throw n},Ad=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),jd=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=B();return i.push(a),{resolve:a.resolve.bind(a),promises:i}},Md=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},Nd=async e=>{if(e!==void 0)try{await Fd(e)}catch{}},Pd=async e=>{if(e!==void 0)try{await Id(e)}catch{}},Fd=async e=>{await D(e,{cleanup:!0,readable:!1,writable:!0})},Id=async e=>{await D(e,{cleanup:!0,readable:!0,writable:!1})},Ld=async(e,t)=>{if(await e,t)throw t},Rd=(e,t,n)=>{n&&!md(n)?e.destroy(n):t&&e.destroy()},zd=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||W.has(n),{subprocessStdout:s,waitReadableDestroy:c}=Bd(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=Vd(s,o),{read:p,onStdoutDataDone:m}=Hd({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),h=new O({read:p,destroy:f(Gd.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return Wd({subprocessStdout:s,onStdoutDataDone:m,readable:h,subprocess:e}),h},Bd=(e,t,n)=>{let r=hr(e,t);return{subprocessStdout:r,waitReadableDestroy:jd(n,r,`readableDestroy`)}},Vd=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Zu},Hd=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=B(),o=Ku({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){Ud(this,o,a)},onStdoutDataDone:a}},Ud=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},Wd=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await Id(e),await r,await Nd(i),await t,n.readable&&n.push(null)}catch(e){await Nd(i),Kd(n,e)}},Gd=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Md(n,t)&&(Kd(e,r),await Ld(t,r))},Kd=(e,t)=>{Rd(e,e.readable,t)},qd=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=Jd(e,n,t),o=new ge({...Yd(r,e,i),destroy:f($d.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return Qd(r,o),o},Jd=(e,t,n)=>{let r=mr(e,t);return{subprocessStdin:r,waitWritableFinal:jd(n,r,`writableFinal`),waitWritableDestroy:jd(n,r,`writableDestroy`)}},Yd=(e,t,n)=>({write:Xd.bind(void 0,e),final:f(Zd.bind(void 0,e,t,n))}),Xd=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},Zd=async(e,t,n)=>{await Md(n,t)&&(e.writable&&e.end(),await t)},Qd=async(e,t,n)=>{try{await Fd(e),t.writable&&t.end()}catch(e){await Pd(n),ef(t,e)}},$d=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Md(n,t),await Md(r,t)&&(ef(e,i),await Ld(t,i))},ef=(e,t)=>{Rd(e,e.writable,t)},tf=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:a=!0,preserveNewlines:o=!0}={})=>{let s=a||W.has(n),{subprocessStdout:c,waitReadableDestroy:l}=Bd(e,r,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:p}=Jd(e,i,t),{readableEncoding:m,readableObjectMode:h,readableHighWaterMark:g}=Vd(c,s),{read:_,onStdoutDataDone:v}=Hd({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),y=new pe({read:_,...Yd(u,e,d),destroy:f(nf.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:p})),readableHighWaterMark:g,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:h,writableObjectMode:u.writableObjectMode,encoding:m});return Wd({subprocessStdout:c,onStdoutDataDone:v,readable:y,subprocess:e,subprocessStdin:u}),Qd(u,y,c),y},nf=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([Gd({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),$d({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])},rf=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||W.has(t),o=hr(e,n);return af(Ku({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i}),o,e)},af=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},of=(e,{encoding:t})=>{let n=Ad();e.readable=zd.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=qd.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=tf.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=rf.bind(void 0,e,t),e[Symbol.asyncIterator]=rf.bind(void 0,e,t,{})},sf=(e,t)=>{for(let[n,r]of lf){let i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},cf=(async()=>{})().constructor.prototype,lf=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(cf,e)]),uf=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=df(e,t,n),{subprocess:f,promise:p}=pf({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d});return f.pipe=Uu.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),sf(f,p),V.set(f,{options:u,fileDescriptors:d}),f},df=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=nn(e,t,n),{file:s,commandArguments:c,options:l}=Ni(e,t,n),u=ff(l);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:Hl(u,o)}},ff=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},pf=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:s})=>{let l;try{l=c(...Ii(e,t,n))}catch(e){return Fl({error:e,command:a,escapedCommand:o,fileDescriptors:s,options:n,startTime:r,verboseInfo:i})}let u=new AbortController;ae(1/0,u.signal);let d=[...l.stdio];_u(l,s,u),Cu(l,n,u);let f={},p=B();l.kill=Hn.bind(void 0,{kill:l.kill.bind(l),options:n,onInternalError:p,context:f,controller:u}),l.all=vd(l,n),of(l,n),Ml(l,n);let m=mf({subprocess:l,options:n,startTime:r,verboseInfo:i,fileDescriptors:s,originalStreams:d,command:a,escapedCommand:o,context:f,onInternalError:p,controller:u});return{subprocess:l,promise:m}},mf=async({subprocess:e,options:t,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:a,command:o,escapedCommand:s,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await Ed({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:a,onInternalError:l,controller:u});return u.abort(),l.resolve(),go(hf({errorInfo:d,exitCode:f,signal:p,stdio:m.map((e,n)=>Z(e,t,n)),all:Z(h,t,`all`),ipcOutput:g,context:c,options:t,command:o,escapedCommand:s,startTime:n}),r,t)},hf=({errorInfo:e,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,context:o,options:s,command:c,escapedCommand:l,startTime:u})=>`error`in e?eo({error:e.error,command:c,escapedCommand:l,timedOut:o.terminationReason===`timeout`,isCanceled:o.terminationReason===`cancel`||o.terminationReason===`gracefulCancel`,isGracefullyCanceled:o.terminationReason===`gracefulCancel`,isMaxBuffer:e.error instanceof da,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):Qa({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u}),gf=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([t,n])=>[t,_f(t,e[t],n)]));return{...e,...n}},_f=(e,t,n)=>vf.has(e)&&k(t)&&k(n)?{...t,...n}:n,vf=new Set([`env`,...at]),$=(e,t,n,r)=>{let i=(e,t,r)=>$(e,t,n,r),a=(...a)=>yf({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},yf=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(k(a))return i(e,gf(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=bf({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?fl(s,c,l):uf(s,c,l,i)},bf=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let[a,o,s]=Ce(...Ie(t)?Le(t,n):[t,...n]),c=gf(gf(r,i),s),{file:l=a,commandArguments:u=o,options:d=c,isSync:f=!1}=e({file:a,commandArguments:o,options:c});return{file:l,commandArguments:u,options:d,isSync:f}},xf=({file:e,commandArguments:t})=>Cf(e,t),Sf=({file:e,commandArguments:t})=>({...Cf(e,t),isSync:!0}),Cf=(e,t)=>{if(t.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[n,...r]=wf(e);return{file:n,commandArguments:r}},wf=e=>{if(typeof e!=`string`)throw TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t===``)return[];let n=[];for(let e of t.split(Tf)){let t=n.at(-1);t&&t.endsWith(`\\`)?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},Tf=/ +/g,Ef=(e,t,n)=>{e.sync=t(Of,n),e.s=e.sync},Df=({options:e})=>kf(e),Of=({options:e})=>({...kf(e),isSync:!0}),kf=e=>({options:{...Af(e),...e}}),Af=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},jf={preferLocal:!0},Mf=$(()=>({})),Nf=$(()=>({isSync:!0}));$(xf),$(Sf),$(vi),$(Df,{},jf,Ef);const{sendMessage:Pf,getOneMessage:Ff,getEachMessage:If,getCancelSignal:Lf}=Nl();var Rf=t({builder:()=>Kf,command:()=>zf,description:()=>Bf});const zf=`git`,Bf=``,Vf=process.cwd();function Hf(){try{return!!Nf(`git`,[`--version`],{cwd:Vf}).stdout}catch{throw Error(`git is not installed`)}}function Uf(){try{return Nf(`git`,[`rev-parse`,`--is-inside-work-tree`],{cwd:Vf}).stdout===`true`}catch{throw Error(`not a git repository`)}}function Wf(){return Mf(`git`,[`config`,`core.hooksPath`,`.githooks`],{cwd:Vf})}function Gf(){try{return Hf()&&Uf()}catch(e){return console.error(`Fail:`,e.message),!1}}function Kf(e){e.command(`hooks`,`Set .githooks as git.hooksPath`,{},()=>{Gf()&&Wf().then(()=>{console.log(`Done: set .githooks`)}).catch(()=>{console.error(`Fail:`,`setting hooks failed`),process.exitCode=1})}),e.demandCommand(1,"Typing `hooks`")}export{Mf as a,Rf as i,zf as n,Bf as r,Kf as t};
|
package/dist/lib-CV3GNWIq.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./source-CW9jQ_O2.mjs";const t=[` `,`⚠`,`✖`],n=[`white`,`yellow`,`red`];function r(e={},t={}){let{results:n=[]}=e,r=e=>i(e,t),o=e=>a(e,t);return n.filter(e=>Array.isArray(e.warnings)||Array.isArray(e.errors)).map(e=>[...r(e),...o(e)]).reduce((e,t)=>Array.isArray(t)?[...e,...t]:[...e,t],[]).join(`
|
|
2
|
-
`)}function i(t,n={}){let{color:r=!0}=n,{errors:i=[],warnings:a=[],input:o=``}=t;if(!o)return[``];let s=r?e.gray(`⧗`):`⧗`,c=r?e.bold(o):o,l=i.length>0||a.length>0;return n.verbose||l?[`${s} input: ${c}`]:[]}function a(r={},i={}){let{signs:a=t,colors:o=n,color:l=!0}=i,{errors:u=[],warnings:d=[]}=r,f=[...u,...d].map(t=>{let n=a[t.level]||``,r=o[t.level]||`white`,i=l?e[r](n):n,s=l?e.grey(`[${t.name}]`):`[${t.name}]`;return`${i} ${t.message} ${s}`}),p=s(r),m=c(r),h=l?e[m](p):p,g=u.length,_=d.length,v=f.length>0,y=i.verbose||v?`${h} found ${g} problems, ${_} warnings`:void 0,b=l&&typeof y==`string`?e.bold(y):y,x=v&&i.helpUrl?`ⓘ Get help: ${i.helpUrl}`:void 0;return[...f,v?``:void 0,b,x,v?``:void 0].filter(e=>typeof e==`string`)}var o=r;function s(e){return(e.errors||[]).length>0?`✖`:(e.warnings||[]).length?`⚠`:`✔`}function c(e){return(e.errors||[]).length>0?`red`:(e.warnings||[]).length?`yellow`:`green`}export{o as default};
|