@visulima/vis 1.0.0-alpha.27 → 1.0.0-alpha.29
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/CHANGELOG.md +42 -0
- package/LICENSE.md +3217 -99
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/bin.js +468 -364
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/config.js +15 -15
- package/dist/packem_chunks/devtools.js +82 -0
- package/dist/packem_chunks/doctor-probe.js +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -2
- package/dist/packem_chunks/handler11.js +5 -1
- package/dist/packem_chunks/handler12.js +1 -5
- package/dist/packem_chunks/handler13.js +27 -1
- package/dist/packem_chunks/handler14.js +5 -27
- package/dist/packem_chunks/handler15.js +1 -5
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +5 -1
- package/dist/packem_chunks/handler21.js +2 -5
- package/dist/packem_chunks/handler22.js +2 -2
- package/dist/packem_chunks/handler23.js +1 -2
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +5 -1
- package/dist/packem_chunks/handler26.js +1 -5
- package/dist/packem_chunks/handler27.js +3 -1
- package/dist/packem_chunks/handler28.js +1 -3
- package/dist/packem_chunks/handler29.js +7 -1
- package/dist/packem_chunks/handler3.js +4 -4
- package/dist/packem_chunks/handler30.js +32 -6
- package/dist/packem_chunks/handler31.js +3 -33
- package/dist/packem_chunks/handler32.js +8 -3
- package/dist/packem_chunks/handler33.js +1 -1
- package/dist/packem_chunks/handler34.js +4 -4
- package/dist/packem_chunks/handler35.js +11 -3
- package/dist/packem_chunks/handler36.js +3 -22
- package/dist/packem_chunks/handler37.js +21 -60
- package/dist/packem_chunks/handler38.js +61 -3
- package/dist/packem_chunks/handler39.js +3 -6
- package/dist/packem_chunks/handler4.js +5 -5
- package/dist/packem_chunks/handler40.js +6 -24
- package/dist/packem_chunks/handler41.js +24 -153
- package/dist/packem_chunks/handler42.js +153 -10
- package/dist/packem_chunks/handler43.js +6 -6
- package/dist/packem_chunks/handler44.js +10 -708
- package/dist/packem_chunks/handler45.js +708 -24
- package/dist/packem_chunks/handler46.js +24 -322
- package/dist/packem_chunks/handler47.js +322 -48
- package/dist/packem_chunks/handler48.js +48 -3
- package/dist/packem_chunks/handler49.js +3 -27
- package/dist/packem_chunks/handler5.js +7 -7
- package/dist/packem_chunks/handler50.js +21 -190
- package/dist/packem_chunks/handler51.js +194 -33
- package/dist/packem_chunks/handler52.js +34 -0
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +7 -17
- package/dist/packem_chunks/index.js +3 -3
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/loader2.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/Table-3pFgIUZ2-DABgc6rj.js +12 -0
- package/dist/packem_shared/_commonjsHelpers-CLblCigl.js +1 -0
- package/dist/packem_shared/{advisories-xIOdLbAI.js → advisories-DpgSuWDH.js} +1 -1
- package/dist/packem_shared/{affected-shas-Dm7eqcI8.js → affected-shas-BkXXecyi.js} +1 -1
- package/dist/packem_shared/ai-analysis-KP8b5lc0.js +68 -0
- package/dist/packem_shared/{ai-fix-BlYyz5bI.js → ai-fix-CfFWatGY.js} +5 -5
- package/dist/packem_shared/{applyDefaults-KxZkvlp3.js → applyDefaults-DLvOqXGX.js} +1 -1
- package/dist/packem_shared/{build-scripts-3E2pmscY.js → build-scripts-D-ysm_bS.js} +1 -1
- package/dist/packem_shared/{cyclonedx-B3ILsY74.js → cyclonedx-B04lIvwu.js} +3 -3
- package/dist/packem_shared/{dependency-scan-s2MD0vi-.js → dependency-scan-B9wTcLxf.js} +1 -1
- package/dist/packem_shared/{docker-BynKrOLe.js → docker-DxA80dRx.js} +1 -1
- package/dist/packem_shared/{failure-log-B0Uh-65U.js → failure-log-n3j_-w8s.js} +1 -1
- package/dist/packem_shared/index-BDF8gawl.js +29 -0
- package/dist/packem_shared/{index-B_KtN1MB.js → index-BfG9_znI.js} +1 -1
- package/dist/packem_shared/{lifecycle-CJRNbN3x.js → lifecycle-NHIKDiCh.js} +2 -2
- package/dist/packem_shared/lockfile-CoeFxWAv.js +1 -0
- package/dist/packem_shared/lockfile-DAuTDwow.js +1 -0
- package/dist/packem_shared/{manifests-Z3spBpxv.js → manifests-B7wUR3Rk.js} +1 -1
- package/dist/packem_shared/{min-release-age-aEn0x8Vy.js → min-release-age-YyNI7gqV.js} +1 -1
- package/dist/packem_shared/{native-config-sync-DdhTLlKL.js → native-config-sync-CgRIIRZV.js} +2 -2
- package/dist/packem_shared/{osv-bloom-BJhlc_I2.js → osv-bloom-BQSIHt5h.js} +2 -2
- package/dist/packem_shared/pm-runner-Ta_yz2uP.js +1 -0
- package/dist/packem_shared/{provenance-BuiEsWbI.js → provenance-DoEp2uOo.js} +1 -1
- package/dist/packem_shared/{readFileSync-CGmzMUF2-D6rUjGDn.js → readFileSync-4c_c6Qey-6SWMDNdw.js} +1 -1
- package/dist/packem_shared/{registry-keys-pemEkRM9.js → registry-keys-CD1xHavV.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-RgRrUDZv.js → resolve-explicit-DpSc7RN2.js} +1 -1
- package/dist/packem_shared/{runtime-check-DgXsKCsv.js → runtime-check-Cbtb_Utb.js} +1 -1
- package/dist/packem_shared/s1ngularity-CIX7UcT5.js +1 -0
- package/dist/packem_shared/scan-progress-CTVVf9WW.js +2 -0
- package/dist/packem_shared/{selectors-BE2BCnTR.js → selectors-BU8aTRQm.js} +1 -1
- package/dist/packem_shared/{signatures-LYMy8OR5.js → signatures-BHM7cnqB.js} +1 -1
- package/dist/packem_shared/spinner-C8xs6QZv.js +1 -0
- package/dist/packem_shared/spinners-f91Rbo99-Bjf3NcO0.js +1 -0
- package/dist/packem_shared/tabs-xZkm6Y_J.js +1 -0
- package/dist/packem_shared/{toolchain-Jx2lkAYy.js → toolchain-juKl-WgV.js} +1 -1
- package/dist/packem_shared/typosquats-DRKU6d2S.js +1 -0
- package/dist/packem_shared/use-measured-height-Lea6TCVD.js +1 -0
- package/dist/packem_shared/{verify-C8EAHql6.js → verify-DA80ja1b.js} +1 -1
- package/dist/packem_shared/vis-update-app-BCKzlqj8.js +1 -0
- package/dist/packem_shared/{watch-BSVsZ_1I.js → watch-DdR-pFzX.js} +1 -1
- package/dist/packem_shared/{watch-loop-DLlMLg_J.js → watch-loop-C8csFvRU.js} +2 -2
- package/index.d.ts +201 -201
- package/index.js +567 -751
- package/package.json +13 -13
- package/dist/packem_shared/ai-analysis-Csn82p17.js +0 -68
- package/dist/packem_shared/index-efSniSRN.js +0 -29
- package/dist/packem_shared/index.server-B7ETiT4C.js +0 -2
- package/dist/packem_shared/lockfile-BG1HvBzH.js +0 -1
- package/dist/packem_shared/pm-runner-BwX5AL3W.js +0 -1
- package/dist/packem_shared/s1ngularity-Bs9fUf3q.js +0 -1
- package/dist/packem_shared/scan-progress-DjPT66jy.js +0 -2
- package/dist/packem_shared/typosquats-znskIR5j.js +0 -1
- package/dist/packem_shared/use-measured-height-DjYgUOKk.js +0 -1
- package/dist/packem_shared/vis-update-app-qhQPV97i.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var u=Object.defineProperty;var m=(n,o)=>u(n,"name",{value:o,configurable:!0});import{r as h}from"../packem_shared/affected-shas-
|
|
1
|
+
var u=Object.defineProperty;var m=(n,o)=>u(n,"name",{value:o,configurable:!0});import{r as h}from"../packem_shared/affected-shas-BkXXecyi.js";import{r as w}from"../packem_shared/toolchain-juKl-WgV.js";var $=Object.defineProperty,a=m((n,o)=>$(n,"name",{value:o,configurable:!0}),"t");const S=a(async({argument:n,logger:o,options:r,runtime:l,visConfig:f,workspaceRoot:s})=>{const p=n[0];if(!p)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");const c=p.split(",").map(e=>e.trim()).filter(Boolean);if(c.length===0)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");if(!s)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const t=h({defaultBase:f?.defaultBase,workspaceRoot:s}),d=r.base??t.base,g=r.head??t.head;!r.base&&!r.head&&o.info(`▸ Resolved affected refs from ${t.provider} (${t.notes.join("; ")})`),r.skipToolchain||o.info("▸ Toolchain pre-flight"),await w(s,f?.toolchain,{error:a(e=>{o.error(e)},"error"),info:a(e=>{o.info(e)},"info"),warn:a(e=>{o.warn(e)},"warn")},!!r.skipToolchain),r.install===!1?o.info("▸ Skipping install (--no-install)"):(o.info("▸ Installing dependencies"),await l.runCommand("install",{argv:["--ci","--frozen-lockfile"]}));for(const e of c){o.info(`▸ Running affected ${e} (base=${d}, head=${g})`);const i=[e,`--base=${d}`,`--head=${g}`,`--upstream=${String(r.upstream??"none")}`,`--downstream=${String(r.downstream??"deep")}`];r.parallel!==void 0&&i.push(`--parallel=${String(r.parallel)}`),r.partition&&i.push(`--partition=${String(r.partition)}`),r.query&&i.push(`--query=${String(r.query)}`),await l.runCommand("affected",{argv:i})}o.info("▸ CI pipeline complete")},"execute");export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var m=Object.defineProperty;var d=(s,o)=>m(s,"name",{value:o,configurable:!0});import{createRequire as p}from"node:module";import{M as a,i as k}from"../packem_shared/readFileSync-
|
|
1
|
+
var m=Object.defineProperty;var d=(s,o)=>m(s,"name",{value:o,configurable:!0});import{createRequire as p}from"node:module";import{M as a,i as k}from"../packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js";import{cleanWorkspace as b}from"#native";import{p as c}from"./bin.js";import{f as $}from"../packem_shared/utils-DrNg0XTR.js";const g=p(import.meta.url),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=d(s=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[o,n]=f.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return f.getBuiltinModule(s)}return g(s)},"__cjs_getBuiltinModule"),{readdirSync:v,lstatSync:y,unlinkSync:_}=h("node:fs");var R=Object.defineProperty,u=d((s,o)=>R(s,"name",{value:o,configurable:!0}),"f");const j=u(s=>{const o=[],n=[s];for(;n.length>0;){const t=n.pop();let i;try{i=v(t)}catch{continue}for(const r of i){const e=a(t,r);try{const l=y(e);if(l.isSymbolicLink()||!l.isDirectory())continue}catch{continue}r==="node_modules"?o.push(e):r!==".git"&&r!==".hg"&&n.push(e)}}return o},"findNodeModulesDirectories"),M=["pnpm-lock.yaml","package-lock.json","npm-shrinkwrap.json","yarn.lock","bun.lock","bun.lockb"],x=u((s,o,n)=>{let t=0,i=!1;for(const r of M){const e=a(s,r);if(k(e)){if(o){n.info(` ${e}`),t++;continue}try{_(e),c.success(`Removed ${e}`),t++}catch(l){c.error(`${e}: ${$(l)}`),i=!0}}}return{hadError:i,removed:t}},"removeLockfiles"),C=u(async({logger:s,options:o,workspaceRoot:n})=>{const t=n??process.cwd(),i=o.lockfile||!1;if(o.dryRun){const e=j(t);if(e.length>0){c.info("Would remove:");for(const l of e)s.info(` ${l}`)}else c.info("No node_modules directories found.");i&&x(t,!0,s);return}const r=b(t,i);for(const e of r.removed)c.success(`Removed ${e}`);for(const e of r.lockfilesRemoved)c.success(`Removed ${e}`);for(const e of r.errors)c.error(e);r.removed.length===0&&r.lockfilesRemoved.length===0?c.info("No node_modules directories found."):c.info(`Cleaned ${r.removed.length} node_modules director${r.removed.length===1?"y":"ies"}`),r.errors.length>0&&(process.exitCode=1)},"execute");export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var i=Object.defineProperty;var s=(e,o)=>i(e,"name",{value:o,configurable:!0});import{R as l,M as p}from"../packem_shared/pm-runner-
|
|
1
|
+
var i=Object.defineProperty;var s=(e,o)=>i(e,"name",{value:o,configurable:!0});import{R as l,M as p}from"../packem_shared/pm-runner-Ta_yz2uP.js";var f=Object.defineProperty,d=s((e,o)=>f(e,"name",{value:o,configurable:!0}),"n");const u=d(async({logger:e,options:o,visConfig:a,workspaceRoot:r})=>{const c=r??process.cwd(),t=l(c,{configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),n=p(t,o.check||!1,c,e);n!==0&&(process.exitCode=n)},"execute");export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var d=Object.defineProperty;var i=(e,s)=>d(e,"name",{value:s,configurable:!0});import{R as k,B as u}from"../packem_shared/pm-runner-
|
|
1
|
+
var d=Object.defineProperty;var i=(e,s)=>d(e,"name",{value:s,configurable:!0});import{R as k,B as u}from"../packem_shared/pm-runner-Ta_yz2uP.js";var v=Object.defineProperty,x=i((e,s)=>v(e,"name",{value:s,configurable:!0}),"n");const w=x(async({argument:e,logger:s,options:a,visConfig:r,workspaceRoot:l})=>{const o=e;if(!o||o.length===0)throw new Error("No package specified. Usage: vis dlx <package[@version]> [args...]");const[t,...g]=o,n=l??process.cwd(),p=k(n,{configBackend:r?.install?.backend,configCorepack:r?.install?.corepack}),f=a.package?Array.isArray(a.package)?a.package:[a.package]:[],c=u(p,{additionalPackages:f,args:g,package:t,shellMode:a.shellMode||!1,silent:a.silent||!1},n,s,{offline:a.offline||!1});c!==0&&(process.exitCode=c)},"execute");export{w as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var H=Object.defineProperty;var I=(e,t)=>H(e,"name",{value:t,configurable:!0});import{createRequire as U}from"node:module";import{C as O,z as F}from"../packem_shared/readFileSync-
|
|
1
|
+
var H=Object.defineProperty;var I=(e,t)=>H(e,"name",{value:t,configurable:!0});import{createRequire as U}from"node:module";import{C as O,z as F}from"../packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js";import{d as D,P as K,R as S,w as j,p as V}from"./heal.js";import{A as q,P as Y}from"../packem_shared/pm-runner-Ta_yz2uP.js";import{p as a}from"./bin.js";const P=U(import.meta.url),T=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=I(e=>{if(typeof T<"u"&&T.versions&&T.versions.node){const[t,o]=T.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return T.getBuiltinModule(e)}return P(e)},"__cjs_getBuiltinModule"),{readFile:B}=A("node:fs/promises"),{createInterface:M}=A("node:readline");var J=Object.defineProperty,k=I((e,t)=>J(e,"name",{value:t,configurable:!0}),"o");const z=k(()=>!!process.stdout.isTTY&&process.env.CI!=="true","isInteractive"),W=k(e=>new Promise(t=>{const o=M({input:process.stdin,output:process.stderr});o.question(`${e} (Y/n) `,i=>{o.close();const s=i.trim().toLowerCase();t(s===""||s==="y"||s==="yes")})}),"defaultPrompt"),X=k((e,t)=>{const o=q(t),i=Y(o,{exact:!1,filter:[],global:!1,optional:!1,packages:[e],peer:!1,saveDev:!1,workspace:!1,workspaceRoot:!1},t,console);return Promise.resolve({exitCode:i})},"defaultRunInstall"),y=k(e=>`pnpm add ${e}`,"installCommandFor"),Q=k(e=>e==="@gitbeaker/rest"?import("@gitbeaker/rest"):import("@octokit/rest"),"defaultImport"),L=k(async(e,t={})=>{const o=t.interactive??z(),i=t.prompt??W,s=t.runInstall??X,l=t.importImpl??Q,d=t.workspaceRoot??process.cwd();try{return await l(e)}catch(n){const{code:p}=n;if(p!=="ERR_MODULE_NOT_FOUND"&&p!=="MODULE_NOT_FOUND")throw n}if(!o)throw new Error(`${e} is not installed. \`vis ai heal accept\` needs it to talk to the host. Install it in your repo first:
|
|
2
2
|
${y(e)}`);if(!await i(`${e} isn't installed. Install it now?`))throw new Error(`${e} install declined. Re-run \`vis ai heal accept\` after installing manually:
|
|
3
3
|
${y(e)}`);const r=await s(e,d);if(r.exitCode!==0)throw new Error(`Install of ${e} failed (exit ${String(r.exitCode)}). Install manually and retry:
|
|
4
4
|
${y(e)}`);return await l(e)},"loadOptionalSdk");var Z=Object.defineProperty,_=I((e,t)=>Z(e,"name",{value:t,configurable:!0}),"s");const ee=_(e=>{const t=e.indexOf("/");if(t<=0||t===e.length-1)throw new Error(`Expected GITHUB_REPOSITORY in "owner/repo" form, got: ${e}`);return{owner:e.slice(0,t),repo:e.slice(t+1)}},"splitGithubRepo"),te=_(async(e,t)=>{if(t.githubClient)return t.githubClient;const o=(await(t.loadSdk??L)("@octokit/rest")).Octokit;if(!o)throw new TypeError("Loaded `@octokit/rest` but no `Octokit` export was found. Reinstall the package or pin to a supported major.");return new o({auth:e})},"loadGithubClient"),oe=_(async(e,t,o)=>{if(o.gitlabClient)return o.gitlabClient;const i=(await(o.loadSdk??L)("@gitbeaker/rest")).Gitlab;if(!i)throw new TypeError("Loaded `@gitbeaker/rest` but no `Gitlab` export was found. Reinstall the package or pin to a supported major.");return new i({host:t,token:e})},"loadGitlabClient"),re=_(e=>e.replace(/\/api\/v\d+\/?$/,""),"apiBaseToHost"),ie=_(async e=>{const{branch:t,ciContext:o,files:i,message:s,workspaceRoot:l}=e,d=e.readFile??(w=>B(w,"utf8"));if(!o.repo)throw new Error("Cannot commit on GitHub: GITHUB_REPOSITORY (owner/repo) is not set.");if(!o.token)throw new Error("Cannot commit on GitHub: GITHUB_TOKEN is not set. Grant the workflow `contents: write` and pass the token through.");const{owner:r,repo:n}=ee(o.repo),p=await te(o.token,e),u=(await p.rest.git.getRef({owner:r,ref:`heads/${t}`,repo:n})).data.object.sha,h=(await p.rest.git.getCommit({commit_sha:u,owner:r,repo:n})).data.tree.sha,m=await Promise.all(i.map(async w=>{const v=O(l,w),E=await d(v),C=await p.rest.git.createBlob({content:Buffer.from(E,"utf8").toString("base64"),encoding:"base64",owner:r,repo:n});return{mode:"100644",path:w,sha:C.data.sha,type:"blob"}})),f=await p.rest.git.createTree({base_tree:h,owner:r,repo:n,tree:m}),b=await p.rest.git.createCommit({message:s,owner:r,parents:[u],repo:n,tree:f.data.sha});return await p.rest.git.updateRef({owner:r,ref:`heads/${t}`,repo:n,sha:b.data.sha}),{sha:b.data.sha,url:b.data.html_url}},"commitToGithub"),ae=_(async e=>{const{branch:t,ciContext:o,files:i,message:s,workspaceRoot:l}=e,d=e.readFile??(m=>B(m,"utf8"));if(!o.repo)throw new Error("Cannot commit on GitLab: CI_PROJECT_ID / CI_PROJECT_PATH is not set.");if(!o.token)throw new Error("Cannot commit on GitLab: no token. CI_JOB_TOKEN cannot push commits — set GITLAB_TOKEN to a PAT/project-token with `api` scope.");if(!o.apiBaseUrl)throw new Error("Cannot commit on GitLab: CI_API_V4_URL is not set.");const r=re(o.apiBaseUrl),n=await oe(o.token,r,e),p=await Promise.all(i.map(async m=>{const f=O(l,m);return{action:"update",content:await d(f),filePath:m}})),u=await n.Commits.create(o.repo,t,s,p),h=u.id??u.sha;if(!h)throw new Error("GitLab Commits.create returned no commit ID — cannot reference the new commit.");return{sha:h,url:u.web_url??u.webUrl}},"commitToGitlab"),ne=_(async e=>{if(e.files.length===0)throw new Error("Cannot commit: no files to include.");if(e.ciContext.provider==="github-actions")return await ie(e);if(e.ciContext.provider==="gitlab-ci")return await ae(e);throw new Error(`Cannot commit: unsupported CI provider \`${e.ciContext.provider}\`. Run \`vis ai heal accept\` from a recognised CI environment.`)},"commitFiles");var se=Object.defineProperty,g=I((e,t)=>se(e,"name",{value:t,configurable:!0}),"u");const G="/vis heal accept",ce=g(async e=>{if(!e)return;let t;try{t=await B(e,"utf8")}catch{return}const o=JSON.parse(t),i=o.comment?.body??"",s=o.comment?.user?.login??"",l=o.pull_request?.head?.repo?.full_name,d=o.pull_request?.base?.repo?.full_name??o.repository?.full_name,r=l!==void 0&&d!==void 0&&l!==d;return{actor:s,body:i,headRef:o.pull_request?.head?.ref,isFork:r}},"loadGithubTrigger"),le=g(e=>{const t=e.VIS_HEAL_TRIGGER_BODY,o=e.VIS_HEAL_TRIGGER_ACTOR;if(!(!t||!o))return{actor:o,body:t,headRef:e.VIS_HEAL_HEAD_REF,isFork:!1}},"loadGitlabTrigger"),de=g(e=>{const t=e.BUILDKITE_UNBLOCKER_EMAIL??e.BUILDKITE_UNBLOCKER;if(t)return{actor:t,body:G,headRef:e.BUILDKITE_BRANCH,isFork:!1}},"loadBuildkiteTrigger"),pe=g(async(e,t)=>{if(e.provider==="github-actions")return await ce(t.GITHUB_EVENT_PATH);if(e.provider==="gitlab-ci")return le(t);if(e.provider==="buildkite")return de(t)},"loadTrigger"),ue=g((e,t)=>{const o=t.BUILDKITE_REPO;if(!o)return;const i=/(?:^|@|\/\/)github\.com[:/]([^/]+)\/([^/]+?)(?:\.git)?\/?$/i.exec(o);if(i&&t.GITHUB_TOKEN)return{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:e.prNumber,provider:"github-actions",repo:`${i[1]}/${i[2]}`,sha:e.sha,token:t.GITHUB_TOKEN};const s=/\/\/([^/]*gitlab[^/]*)\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(o),l=s?null:/@([^/:]*gitlab[^/:]*):([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(o),d=s??l;if(d&&t.GITLAB_TOKEN){const r=d[1];return{apiBaseUrl:t.CI_API_V4_URL??`https://${r}/api/v4`,buildId:void 0,buildNumber:void 0,prNumber:e.prNumber,provider:"gitlab-ci",repo:`${d[2]}/${d[3]}`,sha:e.sha,token:t.GITLAB_TOKEN}}},"deriveBuildkiteCommitContext"),me=g(async e=>{const t=e.fetchImpl??globalThis.fetch,o=`${(e.apiBaseUrl??"https://api.github.com").replace(/\/+$/,"")}/repos/${e.repo}/pulls/${String(e.prNumber)}`;try{const i=await t(o,{headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${e.token}`,"X-GitHub-Api-Version":"2022-11-28"}});return i.ok?(await i.json()).head?.ref:void 0}catch{return}},"fetchGithubHeadRef"),fe=g((e,t,o,i)=>{const s=t.map(l=>`- \`${l}\``).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var U=Object.defineProperty;var I=(t,e)=>U(t,"name",{value:e,configurable:!0});import{createRequire as A}from"node:module";import{j as O,E as v,T as G,I as j,e as F}from"../packem_shared/
|
|
1
|
+
var U=Object.defineProperty;var I=(t,e)=>U(t,"name",{value:e,configurable:!0});import{createRequire as A}from"node:module";import{j as O,E as v,T as G,I as j,e as F}from"../packem_shared/Table-3pFgIUZ2-DABgc6rj.js";import{z as D}from"../packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js";import{readLastRunSummary as K}from"@visulima/task-runner";import{r as H,a as M,b as V,c as z}from"../packem_shared/ai-fix-CfFWatGY.js";import{E as q,p as u}from"./bin.js";const L=A(import.meta.url),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=I(t=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[e,o]=b.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return b.getBuiltinModule(t)}return L(t)},"__cjs_getBuiltinModule"),{spawn:k}=T("node:child_process"),{readFile:J}=T("node:fs/promises");var Q=Object.defineProperty,g=I((t,e)=>Q(t,"name",{value:e,configurable:!0}),"i");const W=g(t=>{if(!t)return;const e=/^refs\/pull\/(\d+)\//.exec(t);return e?Number.parseInt(e[1],10):void 0},"parsePrNumberFromGithubRef"),Y=g(async t=>{if(!t)return{prNumber:void 0,sha:void 0};try{const e=await J(t,"utf8"),o=JSON.parse(e),r=o.pull_request?.number??o.issue?.number??o.number,i=o.pull_request?.head?.sha;return{prNumber:r,sha:i}}catch{return{prNumber:void 0,sha:void 0}}},"readPrNumberFromGithubEvent"),Z=g(async t=>{const e=W(t.GITHUB_REF),{prNumber:o,sha:r}=e===void 0?await Y(t.GITHUB_EVENT_PATH):{prNumber:e,sha:void 0};return{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:e??o,provider:"github-actions",repo:t.GITHUB_REPOSITORY,sha:r??t.GITHUB_SHA,token:t.GITHUB_TOKEN}},"detectGithubActions"),X=g(t=>{const e=t.CI_MERGE_REQUEST_IID,o=e!==void 0&&e!==""?Number.parseInt(e,10):void 0,r=t.CI_API_V4_URL,i=t.GITLAB_TOKEN??t.CI_TOKEN;return{apiBaseUrl:r,buildId:void 0,buildNumber:void 0,prNumber:Number.isFinite(o)?o:void 0,provider:"gitlab-ci",repo:t.CI_PROJECT_ID??t.CI_PROJECT_PATH,sha:t.CI_COMMIT_SHA,token:i}},"detectGitlabCi"),ee=g(t=>{const e=t.BUILDKITE_PULL_REQUEST,o=e!==void 0&&e!==""&&e!=="false"?Number.parseInt(e,10):void 0,r=t.BUILDKITE_BUILD_NUMBER,i=r!==void 0&&r!==""?Number.parseInt(r,10):void 0,n=t.BUILDKITE_ORGANIZATION_SLUG,a=t.BUILDKITE_PIPELINE_SLUG,s=n!==void 0&&n!==""&&a!==void 0&&a!==""?`${n}/${a}`:void 0;return{apiBaseUrl:(t.BUILDKITE_API_BASE_URL??"https://api.buildkite.com").replace(/\/+$/,""),buildId:t.BUILDKITE_BUILD_ID,buildNumber:Number.isFinite(i)?i:void 0,prNumber:Number.isFinite(o)?o:void 0,provider:"buildkite",repo:s,sha:t.BUILDKITE_COMMIT,token:t.BUILDKITE_API_TOKEN}},"detectBuildkite"),te=g(async(t=process.env)=>t.GITHUB_ACTIONS==="true"?await Z(t):t.GITLAB_CI==="true"?X(t):t.BUILDKITE==="true"?ee(t):{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:void 0,provider:"unknown",repo:void 0,sha:void 0,token:void 0},"detectCiContext");var oe=Object.defineProperty,h=I((t,e)=>oe(t,"name",{value:e,configurable:!0}),"p");const re=h((t,e,o,r)=>new Promise(i=>{const n=["pr","comment",String(e),"--body-file","-"];r&&n.push("--repo",r);const a=k(t,n,{stdio:["pipe","ignore","pipe"]});let s="";a.stderr?.setEncoding("utf8"),a.stderr?.on("data",d=>{s+=d}),a.once("error",()=>{i({exitCode:127,stderr:s})}),a.once("close",d=>{i({exitCode:d??-1,stderr:s})}),a.stdin?.on("error",()=>{}),a.stdin?.end(o)}),"runGhComment"),ie=h(async(t,e,o,r,i)=>{const n=`https://api.github.com/repos/${e}/issues/${String(o)}/comments`;try{const a=await t(n,{body:JSON.stringify({body:r}),headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${i}`,"Content-Type":"application/json","X-GitHub-Api-Version":"2022-11-28"},method:"POST"});if(!a.ok){const s=await a.text().catch(()=>"");return{error:`GitHub REST returned ${String(a.status)}: ${s.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(a){return{error:a instanceof Error?a.message:String(a),ok:!1}}},"postViaGithubRest"),ne=h(async(t,e,o,r,i,n)=>{const a=encodeURIComponent(o),s=`${e.replace(/\/+$/,"")}/projects/${a}/merge_requests/${String(r)}/notes`;try{const d=await t(s,{body:JSON.stringify({body:i}),headers:{"Content-Type":"application/json","PRIVATE-TOKEN":n},method:"POST"});if(!d.ok){const p=await d.text().catch(()=>"");return{error:`GitLab REST returned ${String(d.status)}: ${p.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(d){return{error:d instanceof Error?d.message:String(d),ok:!1}}},"postViaGitlabRest"),ae=h((t,e,o,r)=>new Promise(i=>{const n=k(t,["annotate","--style",o,"--context",r],{stdio:["pipe","ignore","pipe"]});let a="";n.stderr?.setEncoding("utf8"),n.stderr?.on("data",s=>{a+=s}),n.once("error",()=>{i({exitCode:127,stderr:a})}),n.once("close",s=>{i({exitCode:s??-1,stderr:a})}),n.stdin?.on("error",()=>{}),n.stdin?.end(e)}),"runBuildkiteAnnotate"),se=h(async(t,e,o,r,i,n,a,s)=>{const[d,p]=o.split("/",2);if(!d||!p)return{error:`Buildkite repo identifier \`${o}\` is not in {org}/{pipeline} form.`,ok:!1};const m=`${e}/v2/organizations/${encodeURIComponent(d)}/pipelines/${encodeURIComponent(p)}/builds/${String(r)}/annotations`;try{const c=await t(m,{body:JSON.stringify({body:i,context:a,style:n}),headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},method:"POST"});if(!c.ok){const l=await c.text().catch(()=>"");return{error:`Buildkite REST returned ${String(c.status)}: ${l.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(c){return{error:c instanceof Error?c.message:String(c),ok:!1}}},"postViaBuildkiteRest"),de=h(async(t,e,o,r)=>{const i=e.buildId?`vis-ai-heal-${e.buildId}`:"vis-ai-heal",n="info",a=await ae(o,t,n,i);if(a.exitCode===0)return{method:"buildkite-cli",posted:!0};if(!e.apiBaseUrl||!e.repo||e.buildNumber===void 0||!e.token){const d=[];return e.repo||d.push("BUILDKITE_ORGANIZATION_SLUG / BUILDKITE_PIPELINE_SLUG"),e.buildNumber===void 0&&d.push("BUILDKITE_BUILD_NUMBER"),e.token||d.push("BUILDKITE_API_TOKEN (with `write_build_annotations` scope)"),{error:`buildkite-agent annotate exited ${String(a.exitCode)} (${a.stderr.trim().slice(0,200)}); cannot fall back to REST without ${d.join(", ")}`,method:"buildkite-cli",posted:!1}}const s=await se(r,e.apiBaseUrl,e.repo,e.buildNumber,t,n,i,e.token);return s.ok?{method:"rest",posted:!0}:{error:`buildkite-agent annotate exited ${String(a.exitCode)}; REST fallback also failed: ${s.error??"unknown"}`,method:"rest",posted:!1}},"postBuildkiteAnnotation"),pe=h(async(t,e,o,r)=>{if(e.prNumber===void 0)return{method:"skipped",posted:!1};const i=await re(o,e.prNumber,t,e.repo);if(i.exitCode===0)return{method:"gh-cli",posted:!0};if(!e.repo||!e.token)return{error:`gh exited ${String(i.exitCode)} (${i.stderr.trim().slice(0,200)}); cannot fall back to REST without GITHUB_REPOSITORY + GITHUB_TOKEN`,method:"gh-cli",posted:!1};const n=await ie(r,e.repo,e.prNumber,t,e.token);return n.ok?{method:"rest",posted:!0}:{error:`gh exited ${String(i.exitCode)}; REST fallback also failed: ${n.error??"unknown"}`,method:"rest",posted:!1}},"postGithubComment"),ce=h(async(t,e,o)=>{if(e.prNumber===void 0)return{method:"skipped",posted:!1};if(!e.apiBaseUrl||!e.repo)return{error:"GitLab CI context is missing CI_API_V4_URL or CI_PROJECT_ID; cannot post note.",method:"rest",posted:!1};if(!e.token)return{error:"GitLab CI context has no token. CI_JOB_TOKEN cannot post MR notes — set GITLAB_TOKEN to a personal/project access token with `api` scope.",method:"rest",posted:!1};const r=await ne(o,e.apiBaseUrl,e.repo,e.prNumber,t,e.token);return r.ok?{method:"rest",posted:!0}:{error:r.error,method:"rest",posted:!1}},"postGitlabComment"),ue=h(async t=>{const{body:e,buildkiteAgentBin:o="buildkite-agent",context:r,fetchImpl:i=globalThis.fetch,ghBin:n="gh"}=t;return r.provider==="github-actions"?await pe(e,r,n,i):r.provider==="gitlab-ci"?await ce(e,r,i):r.provider==="buildkite"?await de(e,r,o,i):{method:"skipped",posted:!1}},"postPrComment");var le=Object.defineProperty,f=I((t,e)=>le(t,"name",{value:e,configurable:!0}),"l");const C=f(t=>{let e=0,o=0;for(const r of t)r.status==="applied"?e+=1:o+=1;return{applied:e,failed:o}},"summarizeApply"),_=f((t,e,o)=>{const r=H(t,e,o),i=D(t,r);return i===""||i.startsWith("..")?r:i},"formatDisplayPath"),fe=f((t,e,o,r)=>new Promise(i=>{const n=process.argv[1];if(!n){i({exitCode:-1,stderr:"Cannot locate vis bin (process.argv[1] missing).",stdout:""});return}const a=[n,"run",o,"--projects",e,"--no-cache","--summarize","--fail-fast"],s=k(process.execPath,a,{cwd:t,env:{...process.env,NO_COLOR:"1"},stdio:["ignore","pipe","pipe"]});let d="",p="";const m=setTimeout(()=>{s.kill("SIGTERM"),setTimeout(()=>s.kill("SIGKILL"),2e3).unref()},r);s.stdout?.setEncoding("utf8"),s.stdout?.on("data",c=>{d+=c}),s.stderr?.setEncoding("utf8"),s.stderr?.on("data",c=>{p+=c}),s.once("error",c=>{clearTimeout(m),i({exitCode:-1,stderr:c.message,stdout:d})}),s.once("close",c=>{clearTimeout(m),i({exitCode:c??-1,stderr:p,stdout:d})})}),"validateFixByRerun"),me=6e4,y=f(t=>{let e=0;const o=t.match(/`{3,}/g);if(o)for(const r of o)e=Math.max(e,r.length);return"`".repeat(Math.max(3,e+1))},"pickFence"),$=f((t,e,o)=>{if(t.patches.length===0)return"_No patches proposed._";const r=[];for(const[i,n]of t.patches.entries()){const a=_(e,o,n.file),s=[`**[${String(i+1)}] \`${a}\`**`];n.reason&&s.push(`_${n.reason}_`);const d=y(`${n.oldString}
|
|
2
2
|
${n.newString}`);s.push(`${d}diff`);for(const p of n.oldString.split(`
|
|
3
3
|
`))s.push(`- ${p}`);for(const p of n.newString.split(`
|
|
4
4
|
`))s.push(`+ ${p}`);s.push(d),r.push(s.join(`
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
var pi=Object.defineProperty;var O=(e,t)=>pi(e,"name",{value:t,configurable:!0});import{createRequire as gi}from"node:module";import{B as yi,j as vi,I as V,N as M,q as ge,e as et}from"../packem_shared/index.server-B7ETiT4C.js";import{b as $i,c as Se,f as Me,n as Ot}from"../packem_shared/index-efSniSRN.js";const bi=gi(import.meta.url),Be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,wi=O(e=>{if(typeof Be<"u"&&Be.versions&&Be.versions.node){const[t,r]=Be.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Be.getBuiltinModule(e)}return bi(e)},"__cjs_getBuiltinModule"),{createRequire:Sr}=wi("node:module");var xi=Object.defineProperty,J=O((e,t)=>xi(e,"name",{value:t,configurable:!0}),"j$2"),Wi=Object.defineProperty,A=J((e,t)=>Wi(e,"name",{value:t,configurable:!0}),"$");const Oi=Sr(import.meta.url),me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_t=A(e=>{if(typeof me<"u"&&me.versions&&me.versions.node){const[t,r]=me.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return me.getBuiltinModule(e)}return Oi(e)},"__cjs_getBuiltinModule"),ee=me,{execFileSync:Bi}=_t("node:child_process"),Ie=_t("node:fs"),Si=_t("node:tty");var Ai=Object.defineProperty,Ht=A((e,t)=>Ai(e,"name",{value:t,configurable:!0}),"u$5"),ji=Object.defineProperty,st=Ht((e,t)=>ji(e,"name",{value:t,configurable:!0}),"l");const Ii=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Ci=12288,Ni=65510,Ei=[12288,12288,65281,65376,65504,65510],ki=8361,Pi=65518,Ri=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Mi=32,Ti=10630,Fi=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Li=4352,_i=262141,Ar=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var Hi=Object.defineProperty,Gi=st((e,t)=>Hi(e,"name",{value:t,configurable:!0}),"r$1");const Ee=Gi((e,t)=>{let r=0,i=Math.floor(e.length/2)-1;for(;r<=i;){const s=Math.floor((r+i)/2),o=s*2;if(t<e[o])i=s-1;else if(t>e[o+1])r=s+1;else return!0}return!1},"isInRange");var Vi=Object.defineProperty,ne=st((e,t)=>Vi(e,"name",{value:t,configurable:!0}),"r");const Kt=19968,[Ji,zi]=we(Ar);function we(e){let t=e[0],r=e[1];for(let i=0;i<e.length;i+=2){const s=e[i],o=e[i+1];if(Kt>=s&&Kt<=o)return[s,o];o-s>r-t&&(t=s,r=o)}return[t,r]}O(we,"nt");J(we,"ge");A(we,"c$2");Ht(we,"f");st(we,"k");ne(we,"findWideFastPathRange");const jr=ne(e=>e<161||e>1114109?!1:Ee(Ii,e),"isAmbiguous"),Ir=ne(e=>e<Ci||e>Ni?!1:Ee(Ei,e),"isFullWidth"),qi=ne(e=>e<ki||e>Pi?!1:Ee(Ri,e),"isHalfWidth"),Ui=ne(e=>e<Mi||e>Ti?!1:Ee(Fi,e),"isNarrow"),Cr=ne(e=>e>=Ji&&e<=zi?!0:e<Li||e>_i?!1:Ee(Ar,e),"isWide");function ye(e){return jr(e)?"ambiguous":Ir(e)?"fullwidth":qi(e)?"halfwidth":Ui(e)?"narrow":Cr(e)?"wide":"neutral"}O(ye,"rt$1");J(ye,"be");A(ye,"g$4");Ht(ye,"S");st(ye,"getCategory");ne(ye,"getCategory");var Di=Object.defineProperty,at=A((e,t)=>Di(e,"name",{value:t,configurable:!0}),"i$4"),Yi=Object.defineProperty,lt=at((e,t)=>Yi(e,"name",{value:t,configurable:!0}),"a"),Ki=Object.defineProperty,Gt=lt((e,t)=>Ki(e,"name",{value:t,configurable:!0}),"e");function oe(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}O(oe,"U$2");J(oe,"ee");A(oe,"s$1");at(oe,"s");lt(oe,"r");Gt(oe,"validate");function se(e){return oe(e),ye(e)}O(se,"Z$2");J(se,"te");A(se,"r$3");at(se,"p");lt(se,"eastAsianWidthType");Gt(se,"eastAsianWidthType");function ke(e,{ambiguousAsWide:t=!1}={}){return oe(e),Ir(e)||Cr(e)||t&&jr(e)?2:1}O(ke,"yt");J(ke,"je");A(ke,"o$2");at(ke,"W");lt(ke,"eastAsianWidth");Gt(ke,"eastAsianWidth");var Zi=Object.defineProperty,Xi=A((e,t)=>Zi(e,"name",{value:t,configurable:!0}),"p$3"),Qi=Object.defineProperty,Nr=Xi((e,t)=>Qi(e,"name",{value:t,configurable:!0}),"e"),en=Object.defineProperty,tn=Nr((e,t)=>en(e,"name",{value:t,configurable:!0}),"E");const Er=String.raw,Zt=Er`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,rn=tn(()=>new RegExp(Er`\p{RI}{2}|(?)${Zt}(?:\u200D${Zt})*`,"gu"),"default");var nn=Object.defineProperty,on=Nr((e,t)=>nn(e,"name",{value:t,configurable:!0}),"p");const ve=new Set(["\x1B",""]),ct="\x07",kr="[",Vt="m",tt="]8;;",sn=39,an=/[\u200B\uFEFF\u2060-\u2064]/g,ln=new RegExp(`(?:\\${kr}(?<code>\\d+)m|\\${tt}(?<uri>.*)${ct})`),cn=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),Q=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Xt=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,Qt=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,Te=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,qe=rn();on(e=>e.replace(qe,""),"stripEmoji");var hn=Object.defineProperty,un=A((e,t)=>hn(e,"name",{value:t,configurable:!0}),"E$1"),dn=Object.defineProperty,fn=un((e,t)=>dn(e,"name",{value:t,configurable:!0}),"A"),mn=Object.defineProperty,ht=fn((e,t)=>mn(e,"name",{value:t,configurable:!0}),"d");const er=new Map,Fe=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Ue=ht(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),pn=ht((e,t)=>{const r=Math.floor(e/65536),i=e%65536;let s=er.get(r);if(s||(s=new Map,er.set(r,s)),s.has(i))return s.get(i);let o;if(Ue(e)==="latin")o=t.width.regular;else if(Ue(e)==="control")o=t.width.control;else if(Ue(e)==="wide")o=t.width.wide;else switch(se(e)){case"ambiguous":{o=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{o=t.width.fullWidth;break}case"wide":{o=t.width.wide;break}default:o=t.width.regular}return s.set(i,o),o},"getCachedCharWidth"),gn=ht(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),be=ht((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?be(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},i=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:s}=e,o=s>1e4;let n=0,a=0,l=s,h=!1;const c=e.includes("\x1B")||e.includes("");for(;n<s;){if(c&&(e[n]==="\x1B"||e[n]==="")){if(e.startsWith("\x1B]8;;",n)){const m="\x1B]8;;\x07",d=m.length,$=e.indexOf("\x07",n+5);if($!==-1){const w=e.indexOf(m,$+1);if(w!==-1){const v=w+d,x=e.slice($+1,w).replace(Q,""),W=be(x,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,i-a),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),B=W.width;if(W.truncated)h=!0,l=Math.min(l,n);else if(a+B>i&&(l=Math.min(l,n),h=!0,a+B>r.truncation.limit))break;if(a+=B,n=v,h&&a>=r.truncation.limit)break;continue}}}if(Q.lastIndex=n,Q.test(e)){const m=Q.lastIndex-n,d=r.truncation.countAnsiEscapeCodes?m:r.width.ansi;if(a+d>i&&(l=Math.min(l,n),a+d>r.truncation.limit)){h=!0;break}a+=d,n=Q.lastIndex;continue}}const b=e.codePointAt(n);if(b===8203||b===65279||b>=8288&&b<=8292){n+=1;continue}if(b===9){if(a+r.width.tab>i&&(l=Math.min(l,n),a+r.width.tab>r.truncation.limit)){h=!0;break}a+=r.width.tab,n+=1;continue}if(Fe.lastIndex=n,Fe.test(e)){const m=(Fe.lastIndex-n)*r.width.regular;if(a+m>i){const d=Math.floor((i-a)/r.width.regular);if(l=Math.min(l,n+d),a+m>r.truncation.limit){h=!0;break}}a+=m,n=Fe.lastIndex;continue}if((b<=31||b>=127&&b<=159)&&(Te.lastIndex=n,Te.test(e))){const m=(Te.lastIndex-n)*r.width.control;if(a+m>i&&(l=Math.min(l,n+Math.floor((i-a)/r.width.control)),a+m>r.truncation.limit)){h=!0;break}a+=m,n=Te.lastIndex;continue}if(qe.lastIndex=n,qe.test(e)){if(a+r.width.emoji>i&&(l=Math.min(l,n),a+r.width.emoji>r.truncation.limit)){h=!0;break}a+=r.width.emoji,n=qe.lastIndex;continue}const f=e.codePointAt(n)??0;if(gn(f)){n+=f>65535?2:1;continue}let p;if(o)p=pn(f,r);else switch(Ue(f)){case"control":{p=r.width.control;break}case"latin":{p=r.width.regular;break}case"wide":{p=r.width.wide;break}case"zero":{p=0;break}default:switch(se(f)){case"ambiguous":{p=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{p=r.width.fullWidth;break}case"wide":{p=r.width.wide;break}default:p=r.width.regular}}if(a+p>i&&(l=Math.min(l,n),a+p>r.truncation.limit)){h=!0;break}a+=p,n+=f>65535?2:1}let u=a,g=!1;return h&&r.truncation.limit>=r.truncation.ellipsisWidth&&(u=r.truncation.limit,g=!0),{ellipsed:g,index:h?l:s,truncated:h,width:u}},"getStringTruncatedWidth");var bn=Object.defineProperty,wn=A((e,t)=>bn(e,"name",{value:t,configurable:!0}),"i$2"),yn=Object.defineProperty,vn=wn((e,t)=>yn(e,"name",{value:t,configurable:!0}),"e"),$n=Object.defineProperty,xn=vn((e,t)=>$n(e,"name",{value:t,configurable:!0}),"r");const E=xn((e,t={})=>be(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var Wn=Object.defineProperty,Pr=A((e,t)=>Wn(e,"name",{value:t,configurable:!0}),"i$1"),On=Object.defineProperty,Rr=Pr((e,t)=>On(e,"name",{value:t,configurable:!0}),"r"),Bn=Object.defineProperty,Sn=Rr((e,t)=>Bn(e,"name",{value:t,configurable:!0}),"c");let An=class{static{O(this,"ki")}static{J(this,"Si")}static{A(this,"l")}static{Pr(this,"y")}static{Rr(this,"s")}static{Sn(this,"LRUCache")}capacity;cache;keyOrder;constructor(e){this.capacity=e,this.cache=new Map,this.keyOrder=[]}get(e){if(this.cache.has(e))return this.keyOrder=this.keyOrder.filter(t=>t!==e),this.keyOrder.push(e),this.cache.get(e)}has(e){return this.cache.has(e)}set(e,t){if(this.cache.has(e))this.keyOrder=this.keyOrder.filter(r=>r!==e);else if(this.cache.size>=this.capacity){const r=this.keyOrder.shift();r!==void 0&&this.cache.delete(r)}this.cache.set(e,t),this.keyOrder.push(e)}delete(e){this.cache.delete(e),this.keyOrder=this.keyOrder.filter(t=>t!==e)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var jn=Object.defineProperty,In=A((e,t)=>jn(e,"name",{value:t,configurable:!0}),"S$1"),Cn=Object.defineProperty,Nn=In((e,t)=>Cn(e,"name",{value:t,configurable:!0}),"w"),En=Object.defineProperty,$e=Nn((e,t)=>En(e,"name",{value:t,configurable:!0}),"y");const tr=new An(100),kn=new Intl.Segmenter("en",{granularity:"grapheme"}),Pn=/^[\u0000-\u007F]*$/,Rn=new Set(["0","22","23","24","27","28","29","39","49"]),Mn=new Set(["1","3","4","7","8","9"]),rr=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),Le=$e(e=>e>="30"&&e<="37"||e>="90"&&e<="97"||e.startsWith("38;"),"isForegroundColor"),_e=$e(e=>e>="40"&&e<="47"||e>="100"&&e<="107"||e.startsWith("48;"),"isBackgroundColor"),Tn=[{close:"\x1B[22m",open:"\x1B[1m"},{close:"\x1B[23m",open:"\x1B[3m"},{close:"\x1B[24m",open:"\x1B[4m"},{close:"\x1B[27m",open:"\x1B[7m"},{close:"\x1B[28m",open:"\x1B[8m"},{close:"\x1B[29m",open:"\x1B[9m"}],ir=$e((e,t)=>{let r=-1;for(const i of t){const s=e.indexOf(i);s!==-1&&(r===-1||s<r)&&(r=s)}return r},"findFirstPositionOfAny"),Fn=$e((e,t)=>{if(!e.includes("\x1B"))return[{after:"",before:"",content:e,visibleLength:E(e,t.width)}];const r=tr.get(e);if(r)return r;const i=[],s=[];let o=0,n;for(Q.lastIndex=0;(n=Q.exec(e))!==null;){const c=n[0];i.push(e.slice(o,n.index)),s.push(c),o=n.index+c.length}o<e.length&&i.push(e.slice(o));const a=[];for(const c of s){if(c==="\x1B[0m"||c==="\x1B]8;;\x07"){a.push(c);continue}if(c.startsWith("\x1B[")&&c.endsWith("m")){const u=c.slice(2,-1);if(Rn.has(u)){a.push(c);continue}}}const l=new Set,h=[];for(const[c,u]of i.entries()){if(c>0&&s[c-1]){const f=s[c-1];if(f==="\x1B[0m")l.clear();else if(f==="\x1B]8;;\x07"){for(const p of l)if(p.startsWith("\x1B]8;;")&&!p.endsWith("\x1B]8;;\x07")){l.delete(p);break}}else if(f.startsWith("\x1B[")&&f.endsWith("m")){const p=f.slice(2,-1);if(p==="39"){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(Le(d)){l.delete(m);break}}}else if(p==="49"){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(_e(d)){l.delete(m);break}}}else if(rr.has(p)){const m=rr.get(p);for(const d of l)if(d===`\x1B[${m}m`){l.delete(d);break}}else{if(Le(p)){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(Le(d)){l.delete(m);break}}}else if(_e(p)){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(_e(d)){l.delete(m);break}}}else if(Mn.has(p)){const m=`\x1B[${p}m`;l.has(m)&&l.delete(m)}l.add(f)}}else if(f.startsWith("\x1B]8;;")&&!f.endsWith("\x1B]8;;\x07")){for(const p of l)if(p.startsWith("\x1B]8;;")&&!p.endsWith("\x1B]8;;\x07")){l.delete(p);break}l.add(f)}}if(u==="")continue;let g="";if(l.size>0)if(a.includes("\x1B[0m"))g="\x1B[0m";else{const f=[];let p=!1;for(const w of l)if(w.startsWith("\x1B]8;;")&&!w.endsWith("\x1B]8;;\x07")){p=!0;break}p&&a.includes("\x1B]8;;\x07")&&f.push("\x1B]8;;\x07");let m=!1,d=!1;for(const w of l)if(w.startsWith("\x1B[")&&w.endsWith("m")){const v=w.slice(2,-1);Le(v)?m=!0:_e(v)&&(d=!0)}if(m&&d){const w=ir(e,["\x1B[3","\x1B[9","\x1B[38;"]),v=ir(e,["\x1B[4","\x1B[10","\x1B[48;"]);w>=0&&v>=0?w>v?f.push("\x1B[39m","\x1B[49m"):f.push("\x1B[49m","\x1B[39m"):f.push("\x1B[39m","\x1B[49m")}else m&&f.push("\x1B[39m"),d&&f.push("\x1B[49m");m&&d&&e.includes("\x1B[39m")&&e.includes("\x1B[49m")&&(e.indexOf("\x1B[39m")<e.indexOf("\x1B[49m")?(f.length-=2,f.push("\x1B[39m","\x1B[49m")):e.indexOf("\x1B[49m")<e.indexOf("\x1B[39m")&&(f.length-=2,f.push("\x1B[49m","\x1B[39m")));const $=Tn.filter(w=>l.has(w.open)).map(w=>({position:e.indexOf(w.open),style:w})).filter(w=>w.position>=0).toSorted((w,v)=>v.position-w.position);for(const w of $){const v=w;a.includes(v.style.close)&&f.push(v.style.close)}g=f.join("")}const b=[...l].join("");h.push({after:g,before:b,content:u,visibleLength:E(u,{fullWidth:1,wideWidth:1})})}return tr.set(e,h),h},"processIntoStyledSegments"),Ln=$e((e,t,r,i)=>{const s=[...i.segmenter.segment(e)],o=[];let n=0,a=!1;for(const l of s){const h=E(l.segment,i.width),c=n,u=n+h;if(!a)if(c<t){n=u;continue}else a=!0;if(c>=r||u>r)break;o.push(l.segment),n=u}return o.join("")},"fastSlice"),U=$e((e,t=0,r=Number.MAX_SAFE_INTEGER,i={})=>{const s={segmenter:kn,...i};if(t>=r||e==="")return"";const o=E(e,s.width);if(t===0&&r>=o)return e;if(t<0||r<0)throw new RangeError("Negative indices aren't supported");if(!e.includes("\x1B"))return Pn.test(e)?e.slice(t,r):Ln(e,t,r,s);if(Xt.lastIndex=0,Qt.lastIndex=0,!Xt.test(e)&&!Qt.test(e))return e;const n=Fn(e,s);if(n.length===0)return"";let a=0;const l=[];for(const[u,g]of n.entries()){const b=a,f=a+g.visibleLength;if(f>t&&b<r){const p=Math.max(0,t-b),m=Math.min(g.visibleLength,r-b);l.push({end:m,index:u,segment:g,start:p})}a=f}if(l.length===0)return"";const h=[],c=l[0].segment;h.push(c.before);for(let u=0;u<l.length;u++){const{end:g,segment:b,start:f}=l[u];if(f===0&&g===b.visibleLength)h.push(b.content);else{const p=[...s.segmenter.segment(b.content)];h.push(p.slice(f,g).map(m=>m.segment).join(""))}if(u<l.length-1){const p=l[u+1].segment,m=b.after,d=p.before;m!==d&&(m||d)&&h.push(m,d)}}return h.push(l.at(-1).segment.after),h.join("")},"slice");var _n=Object.defineProperty,Hn=A((e,t)=>_n(e,"name",{value:t,configurable:!0}),"x"),Gn=Object.defineProperty,Vn=Hn((e,t)=>Gn(e,"name",{value:t,configurable:!0}),"T"),Jn=Object.defineProperty,ut=Vn((e,t)=>Jn(e,"name",{value:t,configurable:!0}),"f");const nr="…",zn=3,He=ut((e,t,r=!1)=>{if(e.charAt(t)===" ")return t;const i=r?1:-1,s=Math.min(zn,r?e.length-t:t);for(let o=1;o<=s;o++){const n=t+o*i;if(e.charAt(n)===" ")return n}return t},"findNearestSpace"),Ge=ut((e,t,r)=>be(e,{...r,ellipsis:"",ellipsisWidth:0,limit:t}).index,"widthToIndex"),Ve=ut((e,t,r)=>E(e.slice(0,t),r),"indexToWidth"),or=ut((e,t,r={})=>{if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof t}`);if(e===""||t<=0)return"";const i=e.normalize("NFC"),{ellipsis:s=nr,position:o="end",preferTruncationOnSpace:n=!1}=r;let a=r.ellipsisWidth??s===nr?1:void 0;a??=be(s,{...r.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:l}=be(i,{...r.width,ellipsis:s,ellipsisWidth:a});if(l<=t)return i;switch(o){case"end":{if(n){const h=t-a,c=Ge(i,h,r.width),u=He(i,c),g=Ve(i,u,r.width);return U(i,0,g,{width:r.width})+s}return U(i,0,t-a,{width:r.width})+s}case"middle":{const h=Math.floor(t/2),c=Math.max(0,t-a),u=Math.min(h,c),g=Math.max(0,c-u);if(n){const b=Ge(i,u,r.width),f=He(i,b),p=Ve(i,f,r.width),m=l-g,d=Ge(i,m,r.width),$=He(i,d,!0),w=Ve(i,$,r.width);return U(i,0,p,{width:r.width})+s+U(i,w,l,{width:r.width}).trim()}return U(i,0,u,{width:r.width})+s+U(i,l-g,l,{width:r.width})}case"start":{if(n){const h=l-t+a,c=Ge(i,h,r.width),u=He(i,c,!0),g=Ve(i,u,r.width);return s+U(i,g,l,{width:r.width}).trim()}return s+U(i,l-t+a,l,{width:r.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${o}'`)}},"truncate");var qn=Object.defineProperty,Mr=A((e,t)=>qn(e,"name",{value:t,configurable:!0}),"b$2"),Un=Object.defineProperty,ae=Mr((e,t)=>Un(e,"name",{value:t,configurable:!0}),"d"),Dn=Object.defineProperty,Yn=ae((e,t)=>Dn(e,"name",{value:t,configurable:!0}),"a");const Kn=/\x1B\[(\d+)m/;class Tr{static{O(this,"he")}static{J(this,"at")}static{A(this,"T")}static{Mr(this,"T")}static{ae(this,"d")}static{Yn(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=Kn.exec(t);if(!r)return;const i=Number.parseInt(r[1],10);switch(i){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(i>=30&&i<=37||i>=90&&i<=97)this.activeForeground=t;else if(i>=40&&i<=47||i>=100&&i<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(i))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(i)){const s={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[i];s&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(s)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(i=>{const s=r[i];s&&t.push(s)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}var Zn=Object.defineProperty,Fr=ae((e,t)=>Zn(e,"name",{value:t,configurable:!0}),"o");const Lr=Fr((e,t)=>{if(!ve.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,i=e.slice(t+1,t+1+tt.length).join("")===tt;return{isInsideEscape:r,isInsideLinkEscape:i}},"checkEscapeSequence"),Xn=Fr((e,t={})=>{const r=new Tr;let i="",s=!1,o="",n="",a=!1;const l=[...e];for(let h=0;h<l.length;h++){const c=l[h];if(c&&ve.has(c)){if(i){const p=t.getWidth?.(i)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:i,width:p};if(a&&(m.isHyperlink=!0,m.hyperlinkUrl=n),t.onSegment?.(m,r)===!1)return;i=""}s=!0,o=c;const b=Lr(l,h),{isInsideLinkEscape:f}=b;if(f){let p=h+1;for(n="";p<l.length;){const d=l[p];if(d===ct)break;n+=d,p+=1}n=n.slice(4);const m={hyperlinkUrl:n,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,r)===!1)return;h=p,a=!0,s=!1,o="";continue}if(h+1<l.length&&l[h+1]==="\\"&&a){const p={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(p,r)===!1)return;a=!1,n="",h+=1,s=!1,o="";continue}}if(s){if(o!==c&&(o+=c),c===Vt){s=!1,r.processEscape(o);const b={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(t.onSegment?.(b,r)===!1)return;o=""}continue}i+=c;const u=t.getWidth?.(i)??0,g={isEscapeSequence:!1,isGrapheme:!0,text:i,width:u};if(a&&(g.isHyperlink=!0,g.hyperlinkUrl=n),t.onSegment?.(g,r)===!1)return;i=""}if(i){const h=t.getWidth?.(i)??0,c={isEscapeSequence:!1,isGrapheme:!0,text:i,width:h};a&&(c.isHyperlink=!0,c.hyperlinkUrl=n),t.onSegment?.(c,r)}if(o){const h={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};t.onSegment?.(h,r)}},"processAnsiString");var Qn=Object.defineProperty,eo=ae((e,t)=>Qn(e,"name",{value:t,configurable:!0}),"t$1");const sr=eo(e=>`${ve.values().next().value}${kr}${String(e)}${Vt}`,"wrapAnsiCode");var to=Object.defineProperty,ro=ae((e,t)=>to(e,"name",{value:t,configurable:!0}),"s");const ar=ro(e=>`${ve.values().next().value}${tt}${e}${ct}`,"wrapAnsiHyperlink");var io=Object.defineProperty,no=ae((e,t)=>io(e,"name",{value:t,configurable:!0}),"l");const oo=no(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,i;const s=e.join(`
|
|
2
|
-
`),o
|
|
3
|
-
`?(i&&(t+=ar("")),r&&h&&(t+=sr(h))):l===`
|
|
4
|
-
|
|
5
|
-
`,`
|
|
6
|
-
`);return r&&(n=n.replaceAll(an,"")),n.split(`
|
|
7
|
-
`).map(a=>{if(i&&a.trim()==="")return"";let l;switch(o){case Je.BREAK_AT_CHARACTERS:{l=ao(a,s,i);break}case Je.BREAK_WORDS:{l=co(a,s,i);break}case Je.STRICT_WIDTH:{l=Gr(a,s,i);break}default:l=lo(a,s,i)}return oo(l)}).join(`
|
|
8
|
-
`)},"wordWrap");var uo=Object.defineProperty,Z=A((e,t)=>uo(e,"name",{value:t,configurable:!0}),"n$3");const Vr=80,Jr=24,jt=Z((e,t,{shell:r,env:i}={})=>Bi(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:i}).trim(),"exec"),De=Z((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),zr=Z((e,t)=>{const{columns:r,rows:i}=De(e,t);if(!(Number.isNaN(r)||Number.isNaN(i))&&!(r===Vr&&i===Jr))return{columns:r,rows:i}},"createIfNotDefault"),fo=Z(()=>{if(ee.platform!=="linux")return!0;try{const e=Ie.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),i=Number.parseInt(r[2],10),s=Number.parseInt(r[5],10);return Number.isNaN(i)||Number.isNaN(s)||s<=0?!1:i===s}catch{return!1}},"isForegroundProcess");function dt(){const{env:e,stdout:t,stderr:r}=ee;if(t?.columns&&t?.rows)return De(t.columns,t.rows);if(r?.columns&&r?.rows)return De(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return De(e.COLUMNS,e.LINES);const i={columns:Vr,rows:Jr};return ee.platform==="win32"?St()??i:ee.platform==="darwin"?lr()??St()??i:lr()??St()??mo()??i}O(dt,"Tt$1");J(dt,"bt");A(dt,"O");Z(dt,"terminalSize");const lr=Z(()=>{try{const e=ee.platform==="darwin"?Ie.constants.O_EVTONLY|Ie.constants.O_NONBLOCK:Ie.constants.O_NONBLOCK,{columns:t,rows:r}=Si.WriteStream(Ie.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),St=Z(()=>{try{const e=jt("tput",["cols"],{env:{TERM:"dumb",...ee.env}}),t=jt("tput",["lines"],{env:{TERM:"dumb",...ee.env}});if(e&&t)return zr(e,t)}catch{}},"tput"),mo=Z(()=>{try{if(!fo())return;const e=jt("resize",["-u"]).match(/\d+/g);if(e.length===2)return zr(e[0],e[1])}catch{}},"resize");var po=Object.defineProperty,qr=A((e,t)=>po(e,"name",{value:t,configurable:!0}),"e");const de=qr((e,t)=>{switch(t){case"bottom":return{body:e.bottomBody,join:e.bottomJoin,left:e.bottomLeft,right:e.bottomRight};case"middle":return{body:e.joinBody,join:e.joinJoin,left:e.joinLeft,right:e.joinRight};case"top":return{body:e.topBody,join:e.topJoin,left:e.topLeft,right:e.topRight};default:throw new Error(`Invalid borderType: ${String(t)}`)}},"getHorizontalBorderChars"),go=qr(e=>({join:e.bodyJoin,left:e.bodyLeft,right:e.bodyRight}),"getVerticalBorderChars");var bo=Object.defineProperty,wo=A((e,t)=>bo(e,"name",{value:t,configurable:!0}),"n$1");const rt=wo((e,t,r)=>{let i=0;for(let s=0;s<r;s+=1)i+=e[t+s]??0;return r>1&&(i+=r-1),i},"calculateCellTotalWidth");var yo=Object.defineProperty,vo=A((e,t)=>yo(e,"name",{value:t,configurable:!0}),"a");const It=vo((e,t,r,i)=>{let s=t;for(;s>0&&e[s-1]?.[r]===i;)s-=1;let o=t;for(;o<e.length-1&&e[o+1]?.[r]===i;)o+=1;let n;const a=o-s+1;if(a===1)n=!0;else switch(i.vAlign){case"bottom":{n=t===o;break}case"middle":{const l=s+Math.floor(a/2);n=t===l;break}case"top":{n=t===s;break}default:n=t===s}return{firstRow:s,lastRow:o,showContent:n}},"determineCellVerticalPosition");var $o=Object.defineProperty,xo=A((e,t)=>$o(e,"name",{value:t,configurable:!0}),"F");const Wo=xo((e,t,r,i,s)=>{if(e.length===0)return[];let o=e.length-1;for(let l=0;l<e.length;l+=1){const h=e[l];if(h){for(const[c,u]of h.entries())if(u&&s(e,l,c,u)===l){const g=It(e,l,c,u);o=Math.max(o,g.lastRow)}}}const n=Array.from({length:o+1}).fill(1);for(let l=0;l<e.length;l+=1){const h=e[l];if(h)for(let c=0;c<r.columns;c+=1){const u=h[c];if(u&&s(e,l,c,u)===l&&(u.rowSpan??1)===1){const g=u.colSpan??1,b=rt(t,c,g),f=i(u,b).length;n[l]=Math.max(n[l]??1,f)}}}const a=Array.from({length:n.length}).fill(!1);if(r.fixedRowHeights)for(let l=0;l<n.length;l+=1){let h;r.fixedRowHeights[l]!==void 0?h=r.fixedRowHeights[l]:r.fixedRowHeights.length===1&&r.fixedRowHeights[0]!==void 0&&(h=r.fixedRowHeights[0]),h!==void 0&&(n[l]=Math.max(1,h),a[l]=!0)}for(let l=0;l<e.length;l+=1){const h=e[l];if(h)for(let c=0;c<r.columns;c+=1){const u=h[c];if(u&&s(e,l,c,u)===l&&(u.rowSpan??1)>1){const g=u.colSpan??1,b=rt(t,c,g),f=i(u,b).length-1,p=It(e,l,c,u),{firstRow:m,lastRow:d}=p;let $=0,w=0;for(let x=m;x<=d&&x<n.length;x+=1)$+=n[x]??1,a[x]||(w+=1);const v=f-$;if(v>0)if(w>0){const x=Math.ceil(v/w);let W=0;for(let B=m;B<=d&&B<n.length;B+=1)if(!a[B]){const j=Math.min(x,v-W);if(n[B]=(n[B]??1)+j,W+=j,W>=v)break}}else console.warn(`[calculateRowHeights] Content of spanning cell exceeds fixed height allocated. Cell: ${JSON.stringify(u.content)}, Required: ${String(f)}, Allocated: ${String($)} (fixed).`)}}}return n},"calculateRowHeights");var Oo=Object.defineProperty,Bo=A((e,t)=>Oo(e,"name",{value:t,configurable:!0}),"i");const fe=Bo((e,t,r,i)=>{let s=t;for(;s>0&&e[s-1]?.[r]===i;)s-=1;return s},"findFirstOccurrenceRow");var So=Object.defineProperty,Ao=A((e,t)=>So(e,"name",{value:t,configurable:!0}),"n");const Ct="__EMPTY__",cr=Ao(e=>{if(typeof e=="string")return{content:e};if(typeof e=="number"||typeof e=="bigint"||typeof e=="boolean")return{content:String(e)};if(e==null)return{content:Ct};if(typeof e=="object"&&"content"in e){let{content:t}=e;if(typeof t=="number"||typeof t=="bigint"||typeof t=="boolean")t=String(t);else if(t==null)t=Ct;else if(typeof t!="string")throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(e)} (type: ${typeof e})`);return{...e,content:t}}throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(e)} (type: ${typeof e})`)},"normalizeGridCell");var jo=Object.defineProperty,Io=A((e,t)=>jo(e,"name",{value:t,configurable:!0}),"p");const Co=Io((e,t,r,i,s)=>{const o=E(e),n=" ".repeat(Math.max(0,i)),a=" ".repeat(Math.max(0,s));if(o===0)return n+" ".repeat(Math.max(0,t))+a;const l=Math.max(0,t-o);switch(r){case"center":{const h=Math.floor(l/2),c=l-h;return n+" ".repeat(h)+e+" ".repeat(c)+a}case"right":return n+" ".repeat(l)+e+a;default:return n+e+" ".repeat(l)+a}},"padAndAlignContent");var No=Object.defineProperty,Jt=A((e,t)=>No(e,"name",{value:t,configurable:!0}),"H");const Ae=/\r?\n/,hr=/\s+/,S=Jt((e,t)=>!e||!t?e:typeof t=="function"?t(e):t.open+e+t.close,"applyColor");let Ur=class Dr{static{O(this,"It")}static{J(this,"Te")}static{A(this,"Grid")}static{Jt(this,"Grid")}#e;#n=[];#t;#o=new WeakMap;#r=new WeakMap;static createGridLayout(){return[]}constructor(t){const r={autoColumns:1,autoFlow:"row",autoRows:1,balancedWidths:!1,gap:0,paddingLeft:1,paddingRight:1,rows:0,showBorders:t.border!==void 0,truncate:!1,truncateOverflow:!0,wordWrap:!1};let i;Array.isArray(t.fixedRowHeights)?i=t.fixedRowHeights:typeof t.fixedRowHeights=="number"&&(i=[t.fixedRowHeights]),this.#e={...r,...t,columns:t.columns,fixedRowHeights:i,showBorders:t.border!==void 0||(t.showBorders??!1)};let{terminalWidth:s}=this.#e;if(s===void 0){const{columns:o}=dt();s=o}this.#t=s,this.#e.maxWidth&&(this.#e.maxWidth=Math.min(this.#e.maxWidth,this.#t))}addItem(t){return this.#n.push(cr(t)),this}addItems(t){return this.#n.push(...t.map(r=>cr(r))),this}setColumns(t){return this.#e.columns=t,this}setRows(t){return this.#e.rows=t,this}setBorder(t){return this.#e.border=t,this}setShowBorders(t){return this.#e.showBorders=t,this}setMaxWidth(t){return this.#e.maxWidth=t,this}toString(){const t=Dr.createGridLayout();if(this.placeItems(t),t.length===0||t[0]?.length===0)return"";let r=this.calculateColumnWidths(t);const i=this.calculateTotalGridWidth(r),s=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth,this.#t):this.#t;return i>s&&(r=this.adjustColumnWidthsForTerminal(r,i)),this.renderGrid(t,r)}placeItems(t){let r=0,i=0;const s=this.#e.rows>0?this.#e.rows:Number.POSITIVE_INFINITY;for(let o=0;o<this.#n.length;o+=1){const n=this.#n[o];if(n.content===Ct&&!(n.rowSpan&&n.rowSpan>1)&&!(n.colSpan&&n.colSpan>1)){if(this.#e.autoFlow==="row")i+=1,i>=this.#e.columns&&(i=0,r+=1);else{r+=1;const f=t.length>0?t.length:s;r>=f&&f!==Number.POSITIVE_INFINITY?(r=0,i+=1):t.length===0&&f===Number.POSITIVE_INFINITY&&(i+=1)}continue}const a=n.colSpan??1,l=n.rowSpan??1;let h=!1,c=r,u=i,g=0;const b=(t.length+l+5)*this.#e.columns;for(;!h&&c<s&&g<b;){for(g+=1;c+l>t.length;)t.push(Array.from({length:this.#e.columns}).fill(void 0));if(this.canPlaceItem(t,c,u,a,l))if(this.placeItem(t,c,u,n),h=!0,this.#e.autoFlow==="row")i=u+a,r=c,i>=this.#e.columns&&(i=0,r+=1);else{r=c+l,i=u;const f=t.length>0?t.length:s;r>=f&&(r=0,i+=1)}else if(this.#e.autoFlow==="row")u+=1,u>=this.#e.columns&&(u=0,c+=1);else{for(c+=1;c+l>t.length;)t.push(Array.from({length:this.#e.columns}).fill(void 0));const f=t.length>0?t.length:s;if(c>=f&&(c=0,u+=1,u>=this.#e.columns))break}}if(!h)if(console.warn(`@visulima/tabular: Could not find position for item: ${JSON.stringify(n)} after ${String(g)} attempts. Grid might be too small or layout impossible.`),this.#e.autoFlow==="row")i+=1,i>=this.#e.columns&&(i=0,r+=1);else{r+=1;const f=t.length>0?t.length:s;r>=f&&(r=0,i+=1)}if(g>=b)break}if(this.#e.rows===0)for(;t.length>0&&t.at(-1)?.every(o=>o===void 0);)t.pop()}canPlaceItem(t,r,i,s,o,n=!1){if(i+s>this.#e.columns)return!1;for(let a=r;a<r+o;a+=1)if(a<t.length){if(!t[a])return console.warn(`Grid layout unexpectedly missing row ${String(a)} during canPlaceItem check.`),!1;for(let l=i;l<i+s;l+=1)if(t[a]?.[l]!==void 0)return!1}else if(!n)return!1;return!0}computeWrappedContentWidth(t,r,i,s){let o=t;if(s){if(o>20){let n=0;for(const a of r){const l=a.split(hr);for(const h of l)n=Math.max(n,Math.min(E(h),i))}o=Math.min(o,Math.max(n+4,12))}}else{let n=0;for(const a of r){const l=a.split(hr);for(const h of l)n=Math.max(n,Math.min(E(h),i))}o=Math.min(o,Math.max(n+12,20))}return o}placeItem(t,r,i,s){const o=s.rowSpan??1,n=s.colSpan??1;for(let a=r;a<r+o;a+=1){for(;a>=t.length;)t.push(Array.from({length:this.#e.columns}).fill(void 0));for(let l=i;l<i+n;l+=1)l<this.#e.columns&&(t[a]||(console.error(`Logic error: Row ${String(a)} not found in placeItem despite check.`),t[a]=Array.from({length:this.#e.columns}).fill(void 0)),t[a][l]=s)}}calculateTotalGridWidth(t){let r=0;const i=this.#e.showBorders?this.#e.border:void 0;i&&(r+=i.bodyLeft.width,r+=i.bodyRight.width);const s=t.length,o=this.#e.showBorders?i?.bodyJoin.width??0:0,n=this.#e.gap;for(let a=0;a<s;a+=1)r+=t[a]??0,a<s-1&&(r+=n,r+=o);return r}adjustColumnWidthsForTerminal(t,r){const i=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth??0,this.#t):this.#t;if(r<=i)return t;let s=0;const o=t.length,n=this.#e.showBorders?this.#e.border:void 0;if(n&&(s+=n.bodyLeft.width,s+=n.bodyRight.width),o>1){s+=(o-1)*this.#e.gap;const u=n?.bodyJoin.width??0;s+=(o-1)*u}if(s>=i)return Array.from({length:o}).fill(1);const a=i-s,l=t.reduce((u,g)=>u+g,0);if(l===0){const u=Math.floor(a/o);return Array.from({length:o}).fill(u)}const h=t.map(u=>{const g=u/l;return Math.max(1,Math.floor(a*g))});let c=a-h.reduce((u,g)=>u+g,0);if(c>0){const u=h.map((g,b)=>{const f=l>0?(t[b]??0)/l:1/o;return{index:b,remainder:a*f%1}}).toSorted((g,b)=>b.remainder-g.remainder);for(const g of u){if(c<=0)break;const{index:b}=g;h[b]!==void 0&&(h[b]+=1,c-=1)}}return h}calculateBalancedColumnWidths(t){const r=this.calculateMinimumColumnWidthsWithGrowableInfo(t),i=r.widths,{growableColumns:s}=r,o=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth,this.#t):this.#t,n=this.#e.showBorders?this.#e.border:void 0;let a=0;if(n&&(a+=n.bodyLeft.width,a+=n.bodyRight.width),this.#e.columns>1){a+=(this.#e.columns-1)*this.#e.gap;const c=n?.bodyJoin.width??0;a+=(this.#e.columns-1)*c}const l=Math.max(0,o-a);if(i.reduce((c,u)=>c+u,0)>0){const c=Math.floor(l/this.#e.columns),u=Array.from({length:this.#e.columns}).fill(c),g=c*this.#e.columns;let b=l-g;for(let d=0;d<u.length&&b>0;d+=1)u[d]=(u[d]??0)+1,b-=1;const f=[];let p=0;for(let d=0;d<this.#e.columns;d+=1){const $=u[d]??0,w=i[d]??0,v=Math.max($,w);f.push(v),p+=v}if(p>l){const d=l/p,$=f.map(x=>Math.max(3,Math.floor(x*d))),w=$.reduce((x,W)=>x+W,0);let v=l-w;for(let x=0;x<$.length&&v>0;x+=1)$[x]=($[x]??0)+1,v-=1;return $}let m=l-p;if(m>0){const d=s.length>0?s:f.map(($,w)=>w);for(;m>0&&d.length>0;)for(const $ of d){if(m<=0)break;f[$]=(f[$]??0)+1,m-=1}}return f}const h=Math.floor(l/this.#e.columns);return Array.from({length:this.#e.columns}).fill(h)}calculateMinimumColumnWidthsWithGrowableInfo(t){const r=Array.from({length:this.#e.columns}).fill(0),i=[],s=this.#e.paddingLeft+this.#e.paddingRight,o=this.#e.gap+(this.#e.showBorders?this.#e.border?.bodyJoin.width??0:0);for(let n=0;n<this.#e.columns;n+=1)for(let a=0;a<t.length;a+=1){const l=t[a]?.[n];if(!l||fe(t,a,n,l)!==a||n>0&&t[a]?.[n-1]===l)continue;const h=l.colSpan??1,c=l.maxWidth??Number.POSITIVE_INFINITY,u=String(l.content??"").split(Ae),g=this.#e.wordWrap&&l.wordWrap!==!1;let b=0;for(const f of u)b=Math.max(b,Math.min(E(f),c));b=this.computeWrappedContentWidth(b,u,c,g),h===1&&(r[n]=Math.max(r[n]??0,b+s),g&&!i.includes(n)&&i.push(n))}for(let n=0;n<t.length;n+=1)for(let a=0;a<this.#e.columns;a+=1){const l=t[n]?.[a];if(!l||fe(t,n,a,l)!==n||a>0&&t[n]?.[a-1]===l)continue;const h=l.colSpan??1;if(h>1){const c=l.maxWidth??Number.POSITIVE_INFINITY,u=String(l.content??"").split(Ae),g=this.#e.wordWrap&&l.wordWrap!==!1;let b=0;for(const d of u)b=Math.max(b,Math.min(E(d),c));b=this.computeWrappedContentWidth(b,u,c,g);const f=(h-1)*o,p=b+s+f;let m=0;for(let d=a;d<a+h;d+=1)m+=r[d]??0;if(p>m){const d=p-m,$=Math.ceil(d/h);for(let w=0;w<h&&a+w<this.#e.columns;w+=1)r[a+w]=Math.max(r[a+w]??0,$)}}}return{growableColumns:i,widths:r}}calculateColumnWidths(t){if(this.#e.fixedColumnWidths&&this.#e.fixedColumnWidths.length===this.#e.columns){const o=this.#e.fixedColumnWidths;if(!o.some(n=>n===void 0||!Number.isFinite(n)))return[...o];if(this.#e.balancedWidths){const n=Array.from({length:o.length}).fill(0),a=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth,this.#t):this.#t,l=this.calculateTotalGridWidth(Array.from({length:n.length}).fill(0)),h=Math.max(0,a-l);let c=0;const u=[];for(const[f,p]of o.entries())typeof p=="number"&&Number.isFinite(p)?(n[f]=p,c+=p):u.push(f);let g=Math.max(0,h-c);const b=u.length>0?Math.floor(g/u.length):0;for(const f of u)n[f]=b;g-=b*u.length;for(const f of u){if(g<=0)break;n[f]+=1,g-=1}return n}}if(this.#e.balancedWidths)return this.calculateBalancedColumnWidths(t);const r=Array.from({length:this.#e.columns}).fill(0),i=this.#e.paddingLeft+this.#e.paddingRight,s=this.#e.gap+(this.#e.showBorders?this.#e.border?.bodyJoin.width??0:0);for(let o=0;o<this.#e.columns;o+=1)for(let n=0;n<t.length;n+=1){const a=t[n]?.[o];if(!a||fe(t,n,o,a)!==n||o>0&&t[n]?.[o-1]===a)continue;const l=a.colSpan??1,h=a.maxWidth??Number.POSITIVE_INFINITY,c=String(a.content??"").split(Ae);let u=0;for(const g of c)u=Math.max(u,Math.min(E(g),h));l===1&&(r[o]=Math.max(r[o]??0,u+i))}for(let o=0;o<t.length;o+=1)for(let n=0;n<this.#e.columns;n+=1){const a=t[o]?.[n];if(!a||fe(t,o,n,a)!==o||n>0&&t[o]?.[n-1]===a)continue;const l=a.colSpan??1;if(l>1){const h=a.maxWidth??Number.POSITIVE_INFINITY,c=String(a.content??"").split(Ae),u=this.#e.wordWrap&&a.wordWrap!==!1;let g=0;for(const d of c)g=Math.max(g,Math.min(E(d),h));g=this.computeWrappedContentWidth(g,c,h,u);let b=0;for(let d=n;d<n+l;d+=1)b+=r[d]??0;const f=l>1?(l-1)*s:0,p=g+i+f,m=b+f;if(p>m){const d=p-m,$=Math.floor(d/l);let w=0;for(let v=0;v<l&&n+v<this.#e.columns;v+=1){const x=Math.min($,d-w);if(r[n+v]=(r[n+v]??0)+x,w+=x,w>=d)break}}}}if(this.#e.maxWidth){const o=this.calculateTotalGridWidth(r);if(o>this.#e.maxWidth)return this.adjustColumnWidthsForTerminal(r,o)}return r}renderVisualRowContent(t,r,i,s,o){const n=t[r];if(!n)return"";const a=this.#e.borderColor??this.#e.foregroundColor??void 0,l=[],h=this.#e.showBorders&&this.#e.border?go(this.#e.border):void 0,c=h&&h.left.width>0?h.left.char:"",u=h&&h.right.width>0?h.right.char:"",g=h&&h.join.width>0?h.join.char:"",b=" ".repeat(this.#e.gap);c&&l.push(S(S(c,a),this.#e.backgroundColor));let f=0;for(;f<this.#e.columns;){const p=n[f]??void 0;let m=1,d;if(p){const $=p.colSpan??1;m=$;const w=fe(t,r,f,p),v=rt(s,f,$),x=this.alignCellContent(p,v),W=x.length,B=this.getCachedCellVerticalPosition(t,r,f,p);B.firstRow!==w&&console.warn(`Mismatch between findFirstOccurrenceRow (${String(w)}) and determineCellVerticalPosition (${String(B.firstRow)})`);const j=o.slice(w,B.lastRow+1).reduce((I,_)=>I+_,0),P=B.lastRow-B.firstRow+1;let F=i,L=0;for(let I=w;I<r;I+=1)I<o.length&&(F+=o[I]??1),I<B.lastRow&&(L+=1);F+=L;const q=p.vAlign??"top";let G;switch(q){case"bottom":{let I=i;for(let H=w;H<r;H+=1)I+=o[H]??1;const _=j-W;G=I>=_?I-_:-1;break}case"middle":{const I=Math.round((j-W)/2);let _=i;for(let H=w;H<r;H+=1)_+=o[H]??1;G=_>=I&&_<I+W?_-I:-1;break}case"top":{G=F;break}default:G=F}const xt=G>=0&&G<W;if(d=" ".repeat(Math.max(0,v)),xt){let I=!1;q==="middle"&&P%2===0&&G===0&&(I=!0),I||(d=x[G]??d)}p.colSpan&&p.colSpan>1&&(d+=b.repeat(p.colSpan)),p.foregroundColor?d=S(d,p.foregroundColor):this.#e.foregroundColor&&(d=S(d,this.#e.foregroundColor)),p.backgroundColor?d=S(d,p.backgroundColor):this.#e.backgroundColor&&(d=S(d,this.#e.backgroundColor))}else{const $=this.#e.paddingLeft+this.#e.paddingRight,w=Math.max(0,(s[f]??0)-$),v=" ".repeat(this.#e.paddingLeft+w+this.#e.paddingRight);d=S(S(i===0?v:" ".repeat(v.length),this.#e.foregroundColor),this.#e.backgroundColor)}l.push(d),f+m<this.#e.columns&&(l.push(b),this.#e.showBorders&&g&&l.push(S(S(g,a),this.#e.backgroundColor)),this.#e.gap>0&&l.push(b)),f+=m}return u&&l.push(S(S(u,a),this.#e.backgroundColor)),l.join("")}alignCellContent(t,r){const i=this.#o.get(t);if(i?.has(r))return i.get(r);const{paddingLeft:s,paddingRight:o}=this.#e,n=s+o,a=r-n;if(a<=0){const u=[" ".repeat(n+this.#e.gap)];return i?i.set(r,u):this.#o.set(t,new Map([[r,u]])),u}let l;const h=String(t.content??"");if(l=h.includes(`
|
|
9
|
-
`)||h.includes("\r")?h.split(Ae):[h],this.#e.wordWrap&&t.wordWrap!==!1){const u=typeof this.#e.wordWrap=="object"?this.#e.wordWrap:{},g=typeof t.wordWrap=="object"?t.wordWrap:u;l=ho(h,{...g,width:a}).split(`
|
|
10
|
-
`)}if(this.#e.truncate&&t.truncate!==!1){const u=typeof this.#e.truncate=="object"?this.#e.truncate:{},g=typeof t.truncate=="object"?t.truncate:u;l=l.map(b=>or(b,a,g))}else this.#e.truncateOverflow&&(l=l.map(u=>E(u)>a?or(u,a,{}):u));const c=l.map(u=>Co(u,a,t.hAlign??"left",s,o));return i?i.set(r,c):this.#o.set(t,new Map([[r,c]])),c}renderHorizontalBorder(t,r,i,s,o,n=-1){if(!this.#e.showBorders||!this.#e.border)return"";const a=this.#e.border,l=de(a,o),h=l.body.char,c=l.body.width,u=a.bodyJoin.char;if(o!=="middle"&&c===0)return"";let g=l.left.char,b=l.right.char;if(o==="middle"&&n!==-1){const d=t[i]?.[0]??void 0,$=t[n]?.[0]??void 0;d&&$&&d===$&&(g=u);const w=this.#e.columns-1,v=t[i]?.[w]??void 0,x=t[n]?.[w]??void 0;v&&x&&v===x&&(b=u)}const f=[],p=" ".repeat(this.#e.gap);g&&f.push(S(S(g,this.#e.borderColor),this.#e.backgroundColor));let m;for(let d=0;d<this.#e.columns;d+=1){const $=t[i]?.[d]??void 0,w=o==="middle"&&n!==-1?t[n]?.[d]??void 0:void 0;let v,x=!1;if($&&(d===0||t[i]?.[d-1]!==$)&&(v=$,x=!0),$&&!x)continue;if(!$){const j=s[d]??0;if(m=c>0?h.repeat(j):" ".repeat(j),f.push(S(S(m,this.#e.borderColor),this.#e.backgroundColor)),d<this.#e.columns-1){const P=this.determineJoinChar(o,t,i,n,d,d+1);f.push(p),P.width>0&&f.push(S(S(P.char,this.#e.borderColor),this.#e.backgroundColor))}continue}const W=v?.colSpan??1;if(o==="middle"&&o==="middle"&&w&&$===w&&v){const j=v.vAlign==="middle",{firstRow:P,lastRow:F}=this.getCachedCellVerticalPosition(t,i,d,v),L=F-P+1,q=L%2===0,G=P+Math.ceil(L/2)-1,xt=rt(s,d,W),I=this.alignCellContent(v,xt),_=I.length;if(j&&q&&i===G)m=S(I[0]??"",this.#e.borderColor);else{let H=0;for(let ue=P;ue<=i;ue+=1)H+=r[ue]??1,ue<i&&(H+=1);const Wt=H;if(Wt>=0&&Wt<_)m=S(I[Wt]??"",this.#e.foregroundColor);else{const ue=s.slice(d,d+W).reduce((fi,mi)=>fi+mi,0)+(W-1)*(this.#e.gap+this.#e.border.bodyJoin.width);m=S(" ".repeat(ue),this.#e.borderColor)}}f.push(S(m,this.#e.backgroundColor))}else{const j=[];for(let P=d;P<d+W;P+=1){const F=s[P]??0,L=c>0?h:" ";if(j.push(L.repeat(F+this.#e.gap)),P<d+W-1){const q=this.determineJoinChar(o,t,i,n,P,P+1);q.width>0&&j.push(q.char)}}m=j.join(""),f.push(S(S(m,this.#e.borderColor),this.#e.backgroundColor))}const B=d+W-1;if(B<this.#e.columns-1){const j=this.determineJoinChar(o,t,i,n,B,B+1);j.width>0&&f.push(S(S(j.char,this.#e.borderColor),this.#e.backgroundColor))}d+=W-1}return b&&f.push(S(S(b,this.#e.borderColor),this.#e.backgroundColor)),f.join("")}determineJoinChar(t,r,i,s,o,n=-1){if(!this.#e.showBorders||!this.#e.border)return{char:" ",width:this.#e.gap};const a=this.#e.border;if(t!=="middle"){const x=de(a,t),W=r[i]?.[o]??void 0,B=n===-1?o+1:n,j=r[i]?.[B]??void 0,P=W!==void 0&&j!==void 0&&W===j?x.body:x.join,{char:F,width:L}=P;return{char:F,width:L>0?L:this.#e.gap}}if(s===-1||n===-1)return{char:" ",width:this.#e.gap};const l=a.bodyJoin,h=r[i]?.[o]??void 0,c=r[s]?.[o]??void 0,u=r[i]?.[n]??void 0,g=r[s]?.[n]??void 0,b=h!==void 0&&c!==void 0&&h===c,f=u!==void 0&&g!==void 0&&u===g,p=h!==void 0&&u!==void 0&&h===u,m=c!==void 0&&g!==void 0&&c===g;let d;const $=de(a,"middle");b&&f?d=p?{char:" ",width:l.width}:l:b?d=a.joinLeft:f?d=a.joinRight:p&&m?d=$.body:p?d=a.topJoin:m?d=a.bottomJoin:d=a.joinJoin;const{char:w,width:v}=d;return{char:w,width:v>0?v:this.#e.gap}}renderGrid(t,r){if(t.length===0)return"";const i=[],s=Wo(t,r,this.#e,this.alignCellContent.bind(this),fe),o=this.#e.showBorders&&this.#e.border?de(this.#e.border,"top"):void 0;o&&o.body.width>0&&i.push(this.renderHorizontalBorder(t,s,0,r,"top"));for(let a=0;a<t.length;a+=1){const l=s[a]??1;for(let c=0;c<l;c+=1)i.push(this.renderVisualRowContent(t,a,c,r,s));const h=this.#e.showBorders&&this.#e.border?de(this.#e.border,"middle"):void 0;if(a<t.length-1&&h&&h.body.width>0){const c=t[a],u=t[a+1];let g=!1;if(c&&u)for(let b=0;b<this.#e.columns;b+=1){const f=c[b],p=u[b];if(f!==p){g=!0;break}}g&&i.push(this.renderHorizontalBorder(t,s,a,r,"middle",a+1))}}const n=this.#e.showBorders&&this.#e.border?de(this.#e.border,"bottom"):void 0;return n&&n.body.width>0&&i.push(this.renderHorizontalBorder(t,s,t.length-1,r,"bottom")),i.join(`
|
|
11
|
-
`)}getCachedCellVerticalPosition(t,r,i,s){const o=this.#r.get(s);if(o)return o;const n=It(t,r,i,s);return this.#r.set(s,n),n}};Jt(e=>new Ur(e),"createGrid");const Eo={bodyJoin:{char:"│",width:1},bodyLeft:{char:"│",width:1},bodyRight:{char:"│",width:1},bottomBody:{char:"─",width:1},bottomJoin:{char:"┴",width:1},bottomLeft:{char:"└",width:1},bottomRight:{char:"┘",width:1},joinBody:{char:"─",width:1},joinJoin:{char:"┼",width:1},joinLeft:{char:"├",width:1},joinRight:{char:"┤",width:1},topBody:{char:"─",width:1},topJoin:{char:"┬",width:1},topLeft:{char:"┌",width:1},topRight:{char:"┐",width:1}},Ye={bodyJoin:{char:"",width:0},bodyLeft:{char:"",width:0},bodyRight:{char:"",width:0},bottomBody:{char:"",width:0},bottomJoin:{char:"",width:0},bottomLeft:{char:"",width:0},bottomRight:{char:"",width:0},joinBody:{char:"",width:0},joinJoin:{char:"",width:0},joinLeft:{char:"",width:0},joinRight:{char:"",width:0},topBody:{char:"",width:0},topJoin:{char:"",width:0},topLeft:{char:"",width:0},topRight:{char:"",width:0}};var ko=Object.defineProperty,Yr=O((e,t)=>ko(e,"name",{value:t,configurable:!0}),"p$1"),Po=Object.defineProperty,zt=Yr((e,t)=>Po(e,"name",{value:t,configurable:!0}),"g"),Ro=Object.defineProperty,Mo=zt((e,t)=>Ro(e,"name",{value:t,configurable:!0}),"u");const To=Mo(e=>e.reduce((t,r)=>r===null?t+1:typeof r=="object"&&!Array.isArray(r)?(r.colSpan??=1,r.colSpan<=0?t+1:t+r.colSpan):t+1,0),"computeRowLogicalWidth");var Fo=Object.defineProperty,Kr=zt((e,t)=>Fo(e,"name",{value:t,configurable:!0}),"b");let Lo=class{static{O(this,"H")}static{Yr(this,"$")}static{zt(this,"Table")}static{Kr(this,"Table")}#e;#n=[];#t=[];#o=[];#r=!0;#i=void 0;constructor(t={}){this.#e={...t,showFooter:t.showFooter??!0,showHeader:t.showHeader??!0,style:{border:Eo,paddingLeft:1,paddingRight:1,...t.style}}}setHeaders(t){return t.length>0&&!Array.isArray(t[0])?this.#t=[t]:this.#t=t.map(r=>Array.isArray(r)?r:[r]),this.#r=!0,this.#i=void 0,this}setFooter(t){return t.length>0&&!Array.isArray(t[0])?this.#o=[t]:this.#o=t.map(r=>Array.isArray(r)?r:[r]),this.#r=!0,this.#i=void 0,this}addRow(t){if(!Array.isArray(t))throw new TypeError("Row must be an array");return this.#n.push(t),this.#r=!0,this.#i=void 0,this}addRows(...t){for(const r of t)this.addRow(r);return this.#r=!0,this.#i=void 0,this}toString(){if(!this.#r&&this.#i!==void 0)return this.#i;const t=this.#e.showHeader?this.#t:[],r=this.#e.showFooter?this.#o:[],i=[...t,...this.#n,...r];if(i.length===0)return this.#i="",this.#r=!1,"";let s=0;for(const u of i){const g=u;Array.isArray(g)?s=Math.max(s,To(g)):console.error("Unexpected non-array element found while calculating columns:",g)}if(s===0)return this.#i="",this.#r=!1,"";let o;Array.isArray(this.#e.columnWidths)?o=this.#e.columnWidths.length>=s?this.#e.columnWidths.slice(0,s):[...this.#e.columnWidths,...Array.from({length:s-this.#e.columnWidths.length}).fill(void 0)]:typeof this.#e.columnWidths=="number"&&(o=Array.from({length:s}).fill(this.#e.columnWidths));let n;const a=i.length;if(Array.isArray(this.#e.rowHeights)?n=this.#e.rowHeights:typeof this.#e.rowHeights=="number"&&(n=Array.from({length:a}).fill(this.#e.rowHeights)),o&&Array.isArray(o)){const u=[...o];for(const g of i){const b=g;for(const[f,p]of b.entries()){let m={};if(typeof p=="object"&&p!==null&&!Array.isArray(p)){const{content:d,href:$,...w}=p;m=w}m.width!==void 0?u[f]=m.width:m.maxWidth!==void 0&&u[f]!==void 0&&(u[f]=Math.min(u[f],m.maxWidth))}}o=u}const l={autoFlow:"row",backgroundColor:this.#e.style?.backgroundColor,balancedWidths:this.#e.balancedWidths??!1,border:this.#e.style?.border,borderColor:this.#e.style?.borderColor,columns:s,fixedColumnWidths:o,fixedRowHeights:n,foregroundColor:this.#e.style?.foregroundColor,gap:this.#e.gap??0,maxWidth:this.#e.maxWidth,paddingLeft:this.#e.style?.paddingLeft,paddingRight:this.#e.style?.paddingRight,terminalWidth:this.#e.terminalWidth,truncate:this.#e.truncate??(o?.every(u=>typeof u=="number")||this.#e.maxWidth!==void 0&&!this.#e.balancedWidths),truncateOverflow:this.#e.truncateOverflow??!0,wordWrap:this.#e.wordWrap??!1},h=new Ur(l),c=[];for(const[u,g]of i.entries()){const b=g;if(!Array.isArray(b)){console.error("Skipping non-array row while creating GridItems:",b);continue}const f=this.#e.showHeader?this.#t.length:0,p=this.#n.length,m=this.#e.showHeader&&u<f,d=this.#e.showFooter&&u>=f+p,$=m&&b.length===1&&s>1,w=d&&b.length===1&&s>1;for(const v of b){let x=v,W={};if(typeof x=="object"&&x!==null&&!Array.isArray(x)){const{content:F,href:L,...q}=x;x=L?`\x1B]8;;${L}\x1B\\${String(F)}\x1B]8;;\x1B\\`:F,W=q}$&&(W.colSpan=s),w&&(W.colSpan=s);const B=this.#e.transformTabToSpace&&typeof x=="string"?x.replaceAll(" "," ".repeat(this.#e.transformTabToSpace)):x,{maxWidth:j,width:P}=W;c.push({backgroundColor:W.backgroundColor,colSpan:W.colSpan,content:B,foregroundColor:W.foregroundColor,hAlign:W.hAlign,maxWidth:j,rowSpan:W.rowSpan,truncate:W.truncate??(j===void 0?void 0:!0),vAlign:W.vAlign,width:P,wordWrap:W.wordWrap})}}return h.addItems(c),this.#i=h.toString(),this.#r=!1,this.#i}};const Ke=Kr(e=>new Lo(e),"createTable");var _o=Object.defineProperty,Ho=O((e,t)=>_o(e,"name",{value:t,configurable:!0}),"b$5"),Go=Object.defineProperty,Vo=Ho((e,t)=>Go(e,"name",{value:t,configurable:!0}),"s"),Jo=Object.defineProperty,zo=Vo((e,t)=>Jo(e,"name",{value:t,configurable:!0}),"a");const qo=/([a-f\d]{3,6})/i,Nt=zo(e=>{let[,t]=qo.exec(e)??[];const r=t?t.length:0;if(r===3){const s=t.charAt(0),o=t.charAt(1),n=t.charAt(2);t=s+s+o+o+n+n}else if(r!==6)return[0,0,0];const i=Number.parseInt(t,16);return[i>>16&255,i>>8&255,i&255]},"convertHexToRgb");var Uo=Object.defineProperty,Do=O((e,t)=>Uo(e,"name",{value:t,configurable:!0}),"o$1"),Yo=Object.defineProperty,Ko=Do((e,t)=>Yo(e,"name",{value:t,configurable:!0}),"s"),Zo=Object.defineProperty,qt=Ko((e,t)=>Zo(e,"name",{value:t,configurable:!0}),"e");const Zr=qt((e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/51)+6*Math.round(t/51)+Math.round(r/51),"rgbToAnsi256"),Et=qt(e=>{let t,r,i;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)t=r=i=((e-232)*10+8)/255;else{e-=16;const n=e%36;t=Math.floor(e/36)/5,r=Math.floor(n/6)/5,i=n%6/5}const s=Math.max(t,r,i)*2;if(s===0)return 30;const o=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(t));return s===2?o+60:o},"ansi256To16"),ur=qt((e,t,r)=>Et(Zr(e,t,r)),"rgbToAnsi16");var Xo=Object.defineProperty,Xr=O((e,t)=>Xo(e,"name",{value:t,configurable:!0}),"m$1"),Qo=Object.defineProperty,xe=Xr((e,t)=>Qo(e,"name",{value:t,configurable:!0}),"u"),es=Object.defineProperty,ts=xe((e,t)=>es(e,"name",{value:t,configurable:!0}),"e");function ft({onlyFirst:e=!1}={}){const t="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(t,e?void 0:"g")}O(ft,"$$3");Xr(ft,"j");xe(ft,"t$1");ts(ft,"ansiRegex");var rs=Object.defineProperty,is=xe((e,t)=>rs(e,"name",{value:t,configurable:!0}),"n$1");const D=is((e,t,r)=>t>e?t:Math.min(e,r),"clamp");var ns=Object.defineProperty,T=xe((e,t)=>ns(e,"name",{value:t,configurable:!0}),"b");const C=39,N=49,dr=10,kt=yi(),Qr={close:"",open:""},y=kt>0?(e,t)=>({close:`\x1B[${String(t)}m`,open:`\x1B[${String(e)}m`}):()=>Qr,fr=T(e=>(t,r,i)=>e(Zr(Number(t),Number(r),Number(i))),"createRgbFunction"),mr=T(e=>t=>{const[r,i,s]=Nt(t);return e(r,i,s)},"createHexFunction");let Pt=T(e=>y(`38;5;${String(e)}`,C),"createAnsi256"),Rt=T(e=>y(`48;5;${String(e)}`,N),"createBgAnsi256"),it=T((e,t,r)=>y(`38;2;${String(e)};${String(t)};${String(r)}`,C),"createRgb"),nt=T((e,t,r)=>y(`48;2;${String(e)};${String(t)};${String(r)}`,N),"createBgRgb");kt===1?(Pt=T(e=>y(Et(Number(e)),C),"createAnsi256"),Rt=T(e=>y(Et(Number(e))+dr,N),"createBgAnsi256"),it=T((e,t,r)=>y(ur(Number(e),Number(t),Number(r)),C),"createRgb"),nt=T((e,t,r)=>y(ur(Number(e),Number(t),Number(r))+dr,N),"createBgRgb")):kt===2&&(it=fr(Pt),nt=fr(Rt));const pr={bold:y(1,22),dim:y(2,22),hidden:y(8,28),inverse:y(7,27),italic:y(3,23),overline:y(53,55),reset:y(0,0),strike:y(9,29),strikethrough:y(9,29),underline:y(4,24),visible:Qr},gr={bgBlack:y(40,N),bgBlackBright:y(100,N),bgBlue:y(44,N),bgBlueBright:y(104,N),bgCyan:y(46,N),bgCyanBright:y(106,N),bgGray:y(100,N),bgGreen:y(42,N),bgGreenBright:y(102,N),bgGrey:y(100,N),bgMagenta:y(45,N),bgMagentaBright:y(105,N),bgRed:y(41,N),bgRedBright:y(101,N),bgWhite:y(47,N),bgWhiteBright:y(107,N),bgYellow:y(43,N),bgYellowBright:y(103,N),black:y(30,C),blackBright:y(90,C),blue:y(34,C),blueBright:y(94,C),cyan:y(36,C),cyanBright:y(96,C),gray:y(90,C),green:y(32,C),greenBright:y(92,C),grey:y(90,C),magenta:y(35,C),magentaBright:y(95,C),red:y(31,C),redBright:y(91,C),white:y(37,C),whiteBright:y(97,C),yellow:y(33,C),yellowBright:y(93,C)},br={bg:T(e=>Rt(D(e,0,255)),"bg"),bgHex:mr(nt),bgRgb:T((e,t,r)=>nt(D(e,0,255),D(t,0,255),D(r,0,255)),"bgRgb"),fg:T(e=>Pt(D(e,0,255)),"fg"),hex:mr(it),rgb:T((e,t,r)=>it(D(e,0,255),D(t,0,255),D(r,0,255)),"rgb")};var os=Object.defineProperty,ss=xe((e,t)=>os(e,"name",{value:t,configurable:!0}),"s");const as=ss((e,t,r)=>{if(t==="")return e;let i=e.indexOf(t);if(i<0)return e;const s=t.length;let o=0,n="";for(;~i;)n+=e.slice(o,i)+r,o=i+s,i=e.indexOf(t,o);return n+e.slice(o)},"stringReplaceAll");var ls=Object.defineProperty,Ne=xe((e,t)=>ls(e,"name",{value:t,configurable:!0}),"a");const Y={};let Mt=null;const cs=Ne((e,t,r)=>{if(!e)return"";let i;if(e.raw===void 0?i=String(e):i=String.raw(e,...t),i.includes("\x1B"))for(let s=r;s;s=s.props)i=as(i,s.close,s.open);return i.includes(`
|
|
12
|
-
`)&&(i=i.replace(/(\r*\n)/g,`${r.closeStack}$1${r.openStack}`)),r.openStack+i+r.closeStack},"wrapText"),Tt=Ne(({props:e},{close:t,open:r})=>{const i=(e?.openStack??"")+r,s=t+(e?.closeStack??""),o=Ne((n,...a)=>cs(n,a,o.props),"style");return Object.setPrototypeOf(o,Mt),o.props={close:t,closeStack:s,open:r,openStack:i,props:e},o.open=i,o.close=s,o},"createStyle"),hs=Ne(function(){const e=Ne(t=>String(t),"self");e.strip=t=>t.replaceAll(ft(),"");for(const t in gr)Y[t]={get(){const r=Tt(this,gr[t]);return Object.defineProperty(this,t,{value:r}),r}};for(const t in pr)Y[t]={get(){const r=Tt(this,pr[t]);return Object.defineProperty(this,t,{value:r}),r}};return Mt=Object.defineProperties({},Y),Object.setPrototypeOf(e,Mt),e},"Colorize");for(const e in br)Y[e]={get(){return(...t)=>Tt(this,br[e](...t))}};Y.ansi256=Y.fg;Y.bgAnsi256=Y.bg;var us=Object.defineProperty,ds=O((e,t)=>us(e,"name",{value:t,configurable:!0}),"g$1"),fs=Object.defineProperty,mt=ds((e,t)=>fs(e,"name",{value:t,configurable:!0}),"i"),ms=Object.defineProperty,ps=mt((e,t)=>ms(e,"name",{value:t,configurable:!0}),"n");const ei=ps(e=>(t,...r)=>{if(!Array.isArray(t)||!Array.isArray(t.raw))throw new TypeError("A tagged template literal must be provided");const i=[t.raw[0]];for(let s=1;s<t.raw.length;s+=1)i.push(String(r[s-1]).replaceAll(/[{}\\]/g,String.raw`\$&`),String(t.raw[s]));return e(i.join(""))},"makeColorizeTemplate");var gs=Object.defineProperty,bs=mt((e,t)=>gs(e,"name",{value:t,configurable:!0}),"e$1");const ws=new Map([["0","\0"],["\\","\\"],["a","\x07"],["b","\b"],["e","\x1B"],["f","\f"],["n",`
|
|
13
|
-
`],["r","\r"],["t"," "],["v","\v"]]),ti=bs(e=>{const t=e.startsWith("u"),r=e[1]==="{";return t&&!r&&e.length===5||e.startsWith("x")&&e.length===3?String.fromCodePoint(Number.parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(Number.parseInt(e.slice(2,-1),16)):ws.get(e)??e},"unescape");var ys=Object.defineProperty,pt=mt((e,t)=>ys(e,"name",{value:t,configurable:!0}),"u");const vs=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|\{(~)?(#?[\w:]+(?:\([^)]*\))?(?:\.#?[\w:]+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n))|(\})|((?:.|[\r\n\f])+?)/gi,wr=/(?:^|\.)(?:(\w+)(?:\(([^)]*)\))?|#(?=[:a-f\d]{2,})([a-f\d]{6})?(?::([a-f\d]{6}))?)/gi,$s=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,xs=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,Ws=/\s*,\s*/,Os=pt((e,t)=>{const r=[],i=t.trim().split(Ws);let s;for(const o of i){const n=Number(o);if(!Number.isNaN(n))r.push(n);else if(s=$s.exec(o))r.push(s[2].replaceAll(xs,(a,l,h)=>l?ti(l):h));else throw new Error(`Invalid template style argument: ${o} (in style '${e}')`)}return r},"parseArguments"),Bs=pt(e=>{wr.lastIndex=0;const t=[];let r;for(;(r=wr.exec(e))!==null;){const i=r[1];r[2]?t.push([i,...Os(i,r[2])]):r[3]||r[4]?(r[3]&&t.push(["rgb",...Nt(r[3])]),r[4]&&t.push(["bgRgb",...Nt(r[4])])):t.push([i])}return t},"parseStyle"),yr=pt((e,t)=>{const r={};for(const s of t)for(const o of s.styles)r[o[0]]=s.inverse?void 0:o.slice(1);let i=e;for(const[s,o]of Object.entries(r))if(Array.isArray(o)){if(!(s in i))throw new Error(`Unknown style: ${s}`);i=o.length>0?i[s](...o):i[s]}return i},"buildStyle"),ri=pt(e=>t=>{const r=[],i=[];let s=[];if(t.replaceAll(vs,(o,n,a,l,h,c)=>{if(n)s.push(ti(n));else if(l){const u=s.join("");s=[],i.push(r.length===0?u:yr(e,r)(u)),r.push({inverse:a,styles:Bs(l)})}else if(h){if(r.length===0)throw new Error("Found extraneous } in template literal");i.push(yr(e,r)(s.join(""))),s=[],r.pop()}else s.push(c)}),i.push(s.join("")),r.length>0)throw new Error(`template literal is missing ${String(r.length)} closing bracket${r.length===1?"":"s"} (\`}\`)`);return i.join("")},"makeTemplate");var Ss=Object.defineProperty,As=mt((e,t)=>Ss(e,"name",{value:t,configurable:!0}),"e");const js=new hs;As(e=>ei(ri(e)),"makeTaggedTemplate");const Is=ri(js),Cs=ei(Is);var Ns=Object.defineProperty,z=O((e,t)=>Ns(e,"name",{value:t,configurable:!0}),"m"),Es=Object.defineProperty,k=z((e,t)=>Es(e,"name",{value:t,configurable:!0}),"d");const ks=Sr(import.meta.url),pe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gt=k(e=>{if(typeof pe<"u"&&pe.versions&&pe.versions.node){const[t,r]=pe.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return pe.getBuiltinModule(e)}return ks(e)},"__cjs_getBuiltinModule"),re=pe,{execFileSync:Ps}=gt("node:child_process"),Ce=gt("node:fs"),Rs=gt("node:tty"),Ms=gt("node:os");var Ts=Object.defineProperty,Ut=k((e,t)=>Ts(e,"name",{value:t,configurable:!0}),"u$2"),Fs=Object.defineProperty,bt=Ut((e,t)=>Fs(e,"name",{value:t,configurable:!0}),"l");const Ls=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],_s=12288,Hs=65510,Gs=[12288,12288,65281,65376,65504,65510],Vs=8361,Js=65518,zs=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],qs=32,Us=10630,Ds=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Ys=4352,Ks=262141,ii=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var Zs=Object.defineProperty,Xs=bt((e,t)=>Zs(e,"name",{value:t,configurable:!0}),"r$1");const Pe=Xs((e,t)=>{let r=0,i=Math.floor(e.length/2)-1;for(;r<=i;){const s=Math.floor((r+i)/2),o=s*2;if(t<e[o])i=s-1;else if(t>e[o+1])r=s+1;else return!0}return!1},"isInRange");var Qs=Object.defineProperty,le=bt((e,t)=>Qs(e,"name",{value:t,configurable:!0}),"r");const vr=19968,[ea,ta]=We(ii);function We(e){let t=e[0],r=e[1];for(let i=0;i<e.length;i+=2){const s=e[i],o=e[i+1];if(vr>=s&&vr<=o)return[s,o];o-s>r-t&&(t=s,r=o)}return[t,r]}O(We,"S$1");z(We,"F");k(We,"c$2");Ut(We,"f");bt(We,"k");le(We,"findWideFastPathRange");const ni=le(e=>e<161||e>1114109?!1:Pe(Ls,e),"isAmbiguous"),oi=le(e=>e<_s||e>Hs?!1:Pe(Gs,e),"isFullWidth"),ra=le(e=>e<Vs||e>Js?!1:Pe(zs,e),"isHalfWidth"),ia=le(e=>e<qs||e>Us?!1:Pe(Ds,e),"isNarrow"),si=le(e=>e>=ea&&e<=ta?!0:e<Ys||e>Ks?!1:Pe(ii,e),"isWide");function Oe(e){return ni(e)?"ambiguous":oi(e)?"fullwidth":ra(e)?"halfwidth":ia(e)?"narrow":si(e)?"wide":"neutral"}O(Oe,"P$1");z(Oe,"B");k(Oe,"g$3");Ut(Oe,"S");bt(Oe,"getCategory");le(Oe,"getCategory");var na=Object.defineProperty,wt=k((e,t)=>na(e,"name",{value:t,configurable:!0}),"i$2"),oa=Object.defineProperty,yt=wt((e,t)=>oa(e,"name",{value:t,configurable:!0}),"a"),sa=Object.defineProperty,Dt=yt((e,t)=>sa(e,"name",{value:t,configurable:!0}),"e");function ce(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}O(ce,"N$1");z(ce,"A");k(ce,"s$1");wt(ce,"s");yt(ce,"r");Dt(ce,"validate");function he(e){return ce(e),Oe(e)}O(he,"I");z(he,"x");k(he,"r$3");wt(he,"p");yt(he,"eastAsianWidthType");Dt(he,"eastAsianWidthType");function Re(e,{ambiguousAsWide:t=!1}={}){return ce(e),oi(e)||si(e)||t&&ni(e)?2:1}O(Re,"Y");z(Re,"Z");k(Re,"o$2");wt(Re,"W");yt(Re,"eastAsianWidth");Dt(Re,"eastAsianWidth");var aa=Object.defineProperty,la=k((e,t)=>aa(e,"name",{value:t,configurable:!0}),"E"),ca=Object.defineProperty,ha=la((e,t)=>ca(e,"name",{value:t,configurable:!0}),"A"),ua=Object.defineProperty,vt=ha((e,t)=>ua(e,"name",{value:t,configurable:!0}),"d");const $r=new Map,ze=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Ze=vt(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),da=vt((e,t)=>{const r=Math.floor(e/65536),i=e%65536;let s=$r.get(r);if(s||(s=new Map,$r.set(r,s)),s.has(i))return s.get(i);let o;if(Ze(e)==="latin")o=t.width.regular;else if(Ze(e)==="control")o=t.width.control;else if(Ze(e)==="wide")o=t.width.wide;else switch(he(e)){case"ambiguous":{o=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{o=t.width.fullWidth;break}case"wide":{o=t.width.wide;break}default:o=t.width.regular}return s.set(i,o),o},"getCachedCharWidth"),fa=vt(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),Ft=vt((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?Ft(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},i=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:s}=e,o=s>1e4;let n=0,a=0,l=s,h=!1;const c=e.includes("\x1B")||e.includes("");for(;n<s;){if(c&&(e[n]==="\x1B"||e[n]==="")){if(e.startsWith("\x1B]8;;",n)){const m="\x1B]8;;\x07",d=m.length,$=e.indexOf("\x07",n+5);if($!==-1){const w=e.indexOf(m,$+1);if(w!==-1){const v=w+d,x=e.slice($+1,w).replace(Se,""),W=Ft(x,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,i-a),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),B=W.width;if(W.truncated)h=!0,l=Math.min(l,n);else if(a+B>i&&(l=Math.min(l,n),h=!0,a+B>r.truncation.limit))break;if(a+=B,n=v,h&&a>=r.truncation.limit)break;continue}}}if(Se.lastIndex=n,Se.test(e)){const m=Se.lastIndex-n,d=r.truncation.countAnsiEscapeCodes?m:r.width.ansi;if(a+d>i&&(l=Math.min(l,n),a+d>r.truncation.limit)){h=!0;break}a+=d,n=Se.lastIndex;continue}}const b=e.codePointAt(n);if(b===8203||b===65279||b>=8288&&b<=8292){n+=1;continue}if(b===9){if(a+r.width.tab>i&&(l=Math.min(l,n),a+r.width.tab>r.truncation.limit)){h=!0;break}a+=r.width.tab,n+=1;continue}if(ze.lastIndex=n,ze.test(e)){const m=(ze.lastIndex-n)*r.width.regular;if(a+m>i){const d=Math.floor((i-a)/r.width.regular);if(l=Math.min(l,n+d),a+m>r.truncation.limit){h=!0;break}}a+=m,n=ze.lastIndex;continue}if((b<=31||b>=127&&b<=159)&&(Me.lastIndex=n,Me.test(e))){const m=(Me.lastIndex-n)*r.width.control;if(a+m>i&&(l=Math.min(l,n+Math.floor((i-a)/r.width.control)),a+m>r.truncation.limit)){h=!0;break}a+=m,n=Me.lastIndex;continue}if(Ot.lastIndex=n,Ot.test(e)){if(a+r.width.emoji>i&&(l=Math.min(l,n),a+r.width.emoji>r.truncation.limit)){h=!0;break}a+=r.width.emoji,n=Ot.lastIndex;continue}const f=e.codePointAt(n)??0;if(fa(f)){n+=f>65535?2:1;continue}let p;if(o)p=da(f,r);else switch(Ze(f)){case"control":{p=r.width.control;break}case"latin":{p=r.width.regular;break}case"wide":{p=r.width.wide;break}case"zero":{p=0;break}default:switch(he(f)){case"ambiguous":{p=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{p=r.width.fullWidth;break}case"wide":{p=r.width.wide;break}default:p=r.width.regular}}if(a+p>i&&(l=Math.min(l,n),a+p>r.truncation.limit)){h=!0;break}a+=p,n+=f>65535?2:1}let u=a,g=!1;return h&&r.truncation.limit>=r.truncation.ellipsisWidth&&(u=r.truncation.limit,g=!0),{ellipsed:g,index:h?l:s,truncated:h,width:u}},"getStringTruncatedWidth");var ma=Object.defineProperty,pa=k((e,t)=>ma(e,"name",{value:t,configurable:!0}),"i$1"),ga=Object.defineProperty,ba=pa((e,t)=>ga(e,"name",{value:t,configurable:!0}),"e"),wa=Object.defineProperty,ya=ba((e,t)=>wa(e,"name",{value:t,configurable:!0}),"r");const va=ya((e,t={})=>Ft(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var $a=Object.defineProperty,X=k((e,t)=>$a(e,"name",{value:t,configurable:!0}),"n$1");const ai=80,li=24,Lt=X((e,t,{shell:r,env:i}={})=>Ps(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:i}).trim(),"exec"),Xe=X((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),ci=X((e,t)=>{const{columns:r,rows:i}=Xe(e,t);if(!(Number.isNaN(r)||Number.isNaN(i))&&!(r===ai&&i===li))return{columns:r,rows:i}},"createIfNotDefault"),xa=X(()=>{if(re.platform!=="linux")return!0;try{const e=Ce.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),i=Number.parseInt(r[2],10),s=Number.parseInt(r[5],10);return Number.isNaN(i)||Number.isNaN(s)||s<=0?!1:i===s}catch{return!1}},"isForegroundProcess");function $t(){const{env:e,stdout:t,stderr:r}=re;if(t?.columns&&t?.rows)return Xe(t.columns,t.rows);if(r?.columns&&r?.rows)return Xe(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return Xe(e.COLUMNS,e.LINES);const i={columns:ai,rows:li};return re.platform==="win32"?At()??i:re.platform==="darwin"?xr()??At()??i:xr()??At()??Wa()??i}O($t,"it");z($t,"fe");k($t,"O$1");X($t,"terminalSize");const xr=X(()=>{try{const e=re.platform==="darwin"?Ce.constants.O_EVTONLY|Ce.constants.O_NONBLOCK:Ce.constants.O_NONBLOCK,{columns:t,rows:r}=Rs.WriteStream(Ce.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),At=X(()=>{try{const e=Lt("tput",["cols"],{env:{TERM:"dumb",...re.env}}),t=Lt("tput",["lines"],{env:{TERM:"dumb",...re.env}});if(e&&t)return ci(e,t)}catch{}},"tput"),Wa=X(()=>{try{if(!xa())return;const e=Lt("resize",["-u"]).match(/\d+/g);if(e.length===2)return ci(e[0],e[1])}catch{}},"resize");var Oa=Object.defineProperty,Ba=k((e,t)=>Oa(e,"name",{value:t,configurable:!0}),"s");const je=new Map,Sa=500,R=Ba(e=>{if(!e||e==="")return"";const t=je.get(e);if(t!==void 0)return t;const r=Cs(Object.assign([],{raw:[e]}));if(je.size>=Sa){const i=je.keys().next().value;i!==void 0&&je.delete(i)}return je.set(e,r),r},"templateFormat");var Aa=Object.defineProperty,ja=k((e,t)=>Aa(e,"name",{value:t,configurable:!0}),"t$1");const Qe=ja(()=>{const e=$i().CEREBRO_TERMINAL_WIDTH;if(e===void 0)return;const t=Number.parseInt(e,10);if(!(Number.isNaN(t)||t<=0))return t},"getTerminalWidth");var Ia=Object.defineProperty,Ca=k((e,t)=>Ia(e,"name",{value:t,configurable:!0}),"t");class hi{static{O(this,"mt")}static{z(this,"he")}static{k(this,"n")}static{Ca(this,"BaseSection")}lines;constructor(){this.lines=[]}add(t){this.lines.push(t)}toString(){return this.lines.join(Ms.EOL)}header(t){this.add(vi(t)),this.lines.push("")}}var Na=Object.defineProperty,ot=k((e,t)=>Na(e,"name",{value:t,configurable:!0}),"g");const Ea=ot(e=>e!==void 0&&e>0?e:$t().columns,"resolveTerminalWidth"),ka=ot((e,t,r,i)=>{if(e.length===0||e.some(h=>h.length!==2))return;let s=0;for(const h of e){const c=h[0];if(c===void 0)continue;const u=va(c);u>s&&(s=u)}if(s===0)return;const o=r+i,n=s+o,a=20+o;if(n+a>t)return;const l=t-n;return[n,l]},"computeColumnWidths");class Pa extends hi{static{O(this,"Ii")}static{z(this,"Wr")}static{k(this,"S")}static{ot(this,"ContentSection")}constructor(t){if(super(),t.header&&this.header(R(t.header)),t.content){if(t.raw)if(Array.isArray(t.content)&&t.content.every(r=>typeof r=="string"))t.content.forEach(r=>{Array.isArray(r)?r.forEach(i=>{this.add(R(i))}):this.add(R(r))});else if(typeof t.content=="string")this.add(R(t.content));else throw new TypeError("Invalid raw content, must be a string or array of strings.");else this.add(this.getContentLines(t.content));this.add("")}}getContentLines(t){if(typeof t=="string"){const r=Ke({showHeader:!1,style:{border:Ye,paddingLeft:4,paddingRight:1},terminalWidth:Qe(),truncateOverflow:!1,wordWrap:!0});return r.addRow([R(t)]),r.toString()}if(Array.isArray(t)&&t.every(r=>typeof r=="string"||Array.isArray(r)&&r.every(i=>typeof i=="string"))){const r=Ea(Qe()),i=ot(a=>Array.isArray(a)?a.map(l=>R(l)):[R(a)],"formatRow"),s=t.map(a=>i(a)),o=ka(s,r,4,1),n=Ke({columnWidths:o,showHeader:!1,style:{border:Ye,paddingLeft:4,paddingRight:1},terminalWidth:r,truncateOverflow:!1,wordWrap:!0});return s.forEach(a=>{o!==void 0&&a.length===2?n.addRow([{content:a[0],wordWrap:!1},a[1]]):n.addRow(a)}),n.toString()}if(typeof t=="object"){const r=t;if(!r.options||!r.data)throw new Error(`Must have an "options" or "data" property
|
|
14
|
-
${JSON.stringify(t)}`);const i=Ke({showHeader:!1,style:{border:Ye,paddingLeft:4,paddingRight:1},terminalWidth:Qe(),truncateOverflow:!1,wordWrap:!0});return r.data.forEach(s=>{Array.isArray(s)?i.addRow(s.map(o=>R(o))):i.addRow([R(s)])}),i.toString()}throw new Error(`invalid input - 'content' must be a string, array of strings or a object:
|
|
1
|
+
var ft=Object.defineProperty;var m=(e,t)=>ft(e,"name",{value:t,configurable:!0});import{createRequire as ht}from"node:module";import{B as mt,M as J,r as Z,j as bt,I as O,N as y,q as T,e as ee}from"../packem_shared/Table-3pFgIUZ2-DABgc6rj.js";import{b as wt,c as H,f as D,n as me}from"../packem_shared/index-BDF8gawl.js";const pt=ht(import.meta.url),F=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gt=m(e=>{if(typeof F<"u"&&F.versions&&F.versions.node){const[t,r]=F.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return F.getBuiltinModule(e)}return pt(e)},"__cjs_getBuiltinModule"),{createRequire:yt}=gt("node:module");var $t=Object.defineProperty,vt=m((e,t)=>$t(e,"name",{value:t,configurable:!0}),"f$2"),Ot=Object.defineProperty,Nt=vt((e,t)=>Ot(e,"name",{value:t,configurable:!0}),"s"),jt=Object.defineProperty,At=Nt((e,t)=>jt(e,"name",{value:t,configurable:!0}),"a");const Pt=/^#?([a-f\d]{3}|[a-f\d]{6})$/i,ye=At(e=>{let[,t]=Pt.exec(e)??[];const r=t?t.length:0;if(r===3){const i=t.charAt(0),a=t.charAt(1),o=t.charAt(2);t=i+i+a+a+o+o}else if(r!==6)return[0,0,0];const n=Number.parseInt(t,16);return[n>>16&255,n>>8&255,n&255]},"convertHexToRgb");var St=Object.defineProperty,Wt=m((e,t)=>St(e,"name",{value:t,configurable:!0}),"o$1"),xt=Object.defineProperty,It=Wt((e,t)=>xt(e,"name",{value:t,configurable:!0}),"s"),Et=Object.defineProperty,Se=It((e,t)=>Et(e,"name",{value:t,configurable:!0}),"e");const Ye=Se((e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/51)+6*Math.round(t/51)+Math.round(r/51),"rgbToAnsi256"),we=Se(e=>{let t,r,n;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)t=r=n=((e-232)*10+8)/255;else{e-=16;const o=e%36;t=Math.floor(e/36)/5,r=Math.floor(o/6)/5,n=o%6/5}const i=Math.max(t,r,n)*2;if(i===0)return 30;const a=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return i===2?a+60:a},"ansi256To16"),Ce=Se((e,t,r)=>we(Ye(e,t,r)),"rgbToAnsi16");var Bt=Object.defineProperty,Je=m((e,t)=>Bt(e,"name",{value:t,configurable:!0}),"m$1"),Ct=Object.defineProperty,k=Je((e,t)=>Ct(e,"name",{value:t,configurable:!0}),"u"),Mt=Object.defineProperty,Rt=k((e,t)=>Mt(e,"name",{value:t,configurable:!0}),"e");function ie({onlyFirst:e=!1}={}){const t="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(t,e?void 0:"g")}m(ie,"$$3");Je(ie,"j");k(ie,"t$1");Rt(ie,"ansiRegex");var Tt=Object.defineProperty,kt=k((e,t)=>Tt(e,"name",{value:t,configurable:!0}),"n$1");const A=kt((e,t,r)=>t>e?t:Math.min(e,r),"clamp");var _t=Object.defineProperty,w=k((e,t)=>_t(e,"name",{value:t,configurable:!0}),"b");const h=39,p=49,Me=10,$e=mt(),Ze={close:"",open:""},l=$e>0?(e,t)=>({close:`\x1B[${String(t)}m`,open:`\x1B[${String(e)}m`}):()=>Ze,Re=w(e=>(t,r,n)=>e(Ye(Number(t),Number(r),Number(n))),"createRgbFunction"),Te=w(e=>t=>{const[r,n,i]=ye(t);return e(r,n,i)},"createHexFunction");let ve=w(e=>l(`38;5;${String(e)}`,h),"createAnsi256"),Oe=w(e=>l(`48;5;${String(e)}`,p),"createBgAnsi256"),te=w((e,t,r)=>l(`38;2;${String(e)};${String(t)};${String(r)}`,h),"createRgb"),re=w((e,t,r)=>l(`48;2;${String(e)};${String(t)};${String(r)}`,p),"createBgRgb");$e===1?(ve=w(e=>l(we(Number(e)),h),"createAnsi256"),Oe=w(e=>l(we(Number(e))+Me,p),"createBgAnsi256"),te=w((e,t,r)=>l(Ce(Number(e),Number(t),Number(r)),h),"createRgb"),re=w((e,t,r)=>l(Ce(Number(e),Number(t),Number(r))+Me,p),"createBgRgb")):$e===2&&(te=Re(ve),re=Re(Oe));const ke={bold:l(1,22),dim:l(2,22),hidden:l(8,28),inverse:l(7,27),italic:l(3,23),overline:l(53,55),reset:l(0,0),strike:l(9,29),strikethrough:l(9,29),underline:l(4,24),visible:Ze},_e={bgBlack:l(40,p),bgBlackBright:l(100,p),bgBlue:l(44,p),bgBlueBright:l(104,p),bgCyan:l(46,p),bgCyanBright:l(106,p),bgGray:l(100,p),bgGreen:l(42,p),bgGreenBright:l(102,p),bgGrey:l(100,p),bgMagenta:l(45,p),bgMagentaBright:l(105,p),bgRed:l(41,p),bgRedBright:l(101,p),bgWhite:l(47,p),bgWhiteBright:l(107,p),bgYellow:l(43,p),bgYellowBright:l(103,p),black:l(30,h),blackBright:l(90,h),blue:l(34,h),blueBright:l(94,h),cyan:l(36,h),cyanBright:l(96,h),gray:l(90,h),green:l(32,h),greenBright:l(92,h),grey:l(90,h),magenta:l(35,h),magentaBright:l(95,h),red:l(31,h),redBright:l(91,h),white:l(37,h),whiteBright:l(97,h),yellow:l(33,h),yellowBright:l(93,h)},Le={bg:w(e=>Oe(A(e,0,255)),"bg"),bgHex:Te(re),bgRgb:w((e,t,r)=>re(A(e,0,255),A(t,0,255),A(r,0,255)),"bgRgb"),fg:w(e=>ve(A(e,0,255)),"fg"),hex:Te(te),rgb:w((e,t,r)=>te(A(e,0,255),A(t,0,255),A(r,0,255)),"rgb")};var Lt=Object.defineProperty,Ft=k((e,t)=>Lt(e,"name",{value:t,configurable:!0}),"s");const Ht=Ft((e,t,r)=>{if(t==="")return e;let n=e.indexOf(t);if(n<0)return e;const i=t.length;let a=0,o="";for(;~n;)o+=e.slice(a,n)+r,a=n+i,n=e.indexOf(t,a);return o+e.slice(a)},"stringReplaceAll");var Ut=Object.defineProperty,G=k((e,t)=>Ut(e,"name",{value:t,configurable:!0}),"a");const P={};let Ne=null;const Vt=G((e,t,r)=>{if(!e)return"";let n;if(e.raw===void 0?n=String(e):n=String.raw(e,...t),n.includes("\x1B"))for(let i=r;i;i=i.props)n=Ht(n,i.close,i.open);return n.includes(`
|
|
2
|
+
`)&&(n=n.replace(/(\r*\n)/g,`${r.closeStack}$1${r.openStack}`)),r.openStack+n+r.closeStack},"wrapText"),je=G(({props:e},{close:t,open:r})=>{const n=(e?.openStack??"")+r,i=t+(e?.closeStack??""),a=G((o,...s)=>Vt(o,s,a.props),"style");return Object.setPrototypeOf(a,Ne),a.props={close:t,closeStack:i,open:r,openStack:n,props:e},a.open=n,a.close=i,a},"createStyle"),Gt=G(function(){const e=G(t=>String(t),"self");e.strip=t=>t.replaceAll(ie(),"");for(const t in _e)P[t]={get(){const r=je(this,_e[t]);return Object.defineProperty(this,t,{value:r}),r}};for(const t in ke)P[t]={get(){const r=je(this,ke[t]);return Object.defineProperty(this,t,{value:r}),r}};return Ne=Object.defineProperties({},P),Object.setPrototypeOf(e,Ne),e},"Colorize");for(const e in Le)P[e]={get(){return(...t)=>je(this,Le[e](...t))}};P.ansi256=P.fg;P.bgAnsi256=P.bg;var qt=Object.defineProperty,zt=m((e,t)=>qt(e,"name",{value:t,configurable:!0}),"g$1"),Dt=Object.defineProperty,ae=zt((e,t)=>Dt(e,"name",{value:t,configurable:!0}),"i"),Yt=Object.defineProperty,Jt=ae((e,t)=>Yt(e,"name",{value:t,configurable:!0}),"n");const Ke=Jt(e=>(t,...r)=>{if(!Array.isArray(t)||!Array.isArray(t.raw))throw new TypeError("A tagged template literal must be provided");const n=[t.raw[0]];for(let i=1;i<t.raw.length;i+=1)n.push(String(r[i-1]).replaceAll(/[{}\\]/g,String.raw`\$&`),String(t.raw[i]));return e(n.join(""))},"makeColorizeTemplate");var Zt=Object.defineProperty,Kt=ae((e,t)=>Zt(e,"name",{value:t,configurable:!0}),"e$1");const Qt=new Map([["0","\0"],["\\","\\"],["a","\x07"],["b","\b"],["e","\x1B"],["f","\f"],["n",`
|
|
3
|
+
`],["r","\r"],["t"," "],["v","\v"]]),Qe=Kt(e=>{const t=e.startsWith("u"),r=e[1]==="{";return t&&!r&&e.length===5||e.startsWith("x")&&e.length===3?String.fromCodePoint(Number.parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(Number.parseInt(e.slice(2,-1),16)):Qt.get(e)??e},"unescape");var Xt=Object.defineProperty,oe=ae((e,t)=>Xt(e,"name",{value:t,configurable:!0}),"u");const er=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|\{(~)?(#?[\w:]+(?:\([^)]*\))?(?:\.#?[\w:]+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n))|(\})|((?:.|[\r\n\f])+?)/gi,Fe=/(?:^|\.)(?:(\w+)(?:\(([^)]*)\))?|#(?=[:a-f\d]{2,})([a-f\d]{6})?(?::([a-f\d]{6}))?)/gi,tr=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,rr=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,nr=/\s*,\s*/,ir=oe((e,t)=>{const r=[],n=t.trim().split(nr);let i;for(const a of n){const o=Number(a);if(!Number.isNaN(o))r.push(o);else if(i=tr.exec(a))r.push(i[2].replaceAll(rr,(s,u,c)=>u?Qe(u):c));else throw new Error(`Invalid template style argument: ${a} (in style '${e}')`)}return r},"parseArguments"),ar=oe(e=>{Fe.lastIndex=0;const t=[];let r;for(;(r=Fe.exec(e))!==null;){const n=r[1];r[2]?t.push([n,...ir(n,r[2])]):r[3]||r[4]?(r[3]&&t.push(["rgb",...ye(r[3])]),r[4]&&t.push(["bgRgb",...ye(r[4])])):t.push([n])}return t},"parseStyle"),He=oe((e,t)=>{const r={};for(const i of t)for(const a of i.styles)r[a[0]]=i.inverse?void 0:a.slice(1);let n=e;for(const[i,a]of Object.entries(r))if(Array.isArray(a)){if(!(i in n))throw new Error(`Unknown style: ${i}`);n=a.length>0?n[i](...a):n[i]}return n},"buildStyle"),Xe=oe(e=>t=>{const r=[],n=[];let i=[];if(t.replaceAll(er,(a,o,s,u,c,d)=>{if(o)i.push(Qe(o));else if(u){const f=i.join("");i=[],n.push(r.length===0?f:He(e,r)(f)),r.push({inverse:s,styles:ar(u)})}else if(c){if(r.length===0)throw new Error("Found extraneous } in template literal");n.push(He(e,r)(i.join(""))),i=[],r.pop()}else i.push(d)}),n.push(i.join("")),r.length>0)throw new Error(`template literal is missing ${String(r.length)} closing bracket${r.length===1?"":"s"} (\`}\`)`);return n.join("")},"makeTemplate");var or=Object.defineProperty,sr=ae((e,t)=>or(e,"name",{value:t,configurable:!0}),"e");const lr=new Gt;sr(e=>Ke(Xe(e)),"makeTaggedTemplate");const ur=Xe(lr),cr=Ke(ur);var dr=Object.defineProperty,N=m((e,t)=>dr(e,"name",{value:t,configurable:!0}),"m"),fr=Object.defineProperty,g=N((e,t)=>fr(e,"name",{value:t,configurable:!0}),"d");const hr=yt(import.meta.url),R=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,se=g(e=>{if(typeof R<"u"&&R.versions&&R.versions.node){const[t,r]=R.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return R.getBuiltinModule(e)}return hr(e)},"__cjs_getBuiltinModule"),x=R,{execFileSync:pr}=se("node:child_process"),V=se("node:fs"),gr=se("node:tty"),mr=se("node:os");var br=Object.defineProperty,We=g((e,t)=>br(e,"name",{value:t,configurable:!0}),"u$2"),yr=Object.defineProperty,le=We((e,t)=>yr(e,"name",{value:t,configurable:!0}),"l");const wr=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],$r=12288,vr=65510,Or=[12288,12288,65281,65376,65504,65510],Nr=8361,jr=65518,Ar=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Pr=32,Sr=10630,Wr=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],xr=4352,Ir=262141,et=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var Er=Object.defineProperty,Br=le((e,t)=>Er(e,"name",{value:t,configurable:!0}),"r$1");const q=Br((e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const i=Math.floor((r+n)/2),a=i*2;if(t<e[a])n=i-1;else if(t>e[a+1])r=i+1;else return!0}return!1},"isInRange");var Cr=Object.defineProperty,E=le((e,t)=>Cr(e,"name",{value:t,configurable:!0}),"r");const Ue=19968,[Mr,Rr]=_(et);function _(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const i=e[n],a=e[n+1];if(Ue>=i&&Ue<=a)return[i,a];a-i>r-t&&(t=i,r=a)}return[t,r]}m(_,"S$1");N(_,"F");g(_,"c$2");We(_,"f");le(_,"k");E(_,"findWideFastPathRange");const tt=E(e=>e<161||e>1114109?!1:q(wr,e),"isAmbiguous"),rt=E(e=>e<$r||e>vr?!1:q(Or,e),"isFullWidth"),Tr=E(e=>e<Nr||e>jr?!1:q(Ar,e),"isHalfWidth"),kr=E(e=>e<Pr||e>Sr?!1:q(Wr,e),"isNarrow"),nt=E(e=>e>=Mr&&e<=Rr?!0:e<xr||e>Ir?!1:q(et,e),"isWide");function L(e){return tt(e)?"ambiguous":rt(e)?"fullwidth":Tr(e)?"halfwidth":kr(e)?"narrow":nt(e)?"wide":"neutral"}m(L,"P$1");N(L,"B");g(L,"g$3");We(L,"S");le(L,"getCategory");E(L,"getCategory");var _r=Object.defineProperty,ue=g((e,t)=>_r(e,"name",{value:t,configurable:!0}),"i$2"),Lr=Object.defineProperty,ce=ue((e,t)=>Lr(e,"name",{value:t,configurable:!0}),"a"),Fr=Object.defineProperty,xe=ce((e,t)=>Fr(e,"name",{value:t,configurable:!0}),"e");function B(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}m(B,"N$1");N(B,"A");g(B,"s$1");ue(B,"s");ce(B,"r");xe(B,"validate");function C(e){return B(e),L(e)}m(C,"I");N(C,"x");g(C,"r$3");ue(C,"p");ce(C,"eastAsianWidthType");xe(C,"eastAsianWidthType");function z(e,{ambiguousAsWide:t=!1}={}){return B(e),rt(e)||nt(e)||t&&tt(e)?2:1}m(z,"Y");N(z,"Z");g(z,"o$2");ue(z,"W");ce(z,"eastAsianWidth");xe(z,"eastAsianWidth");var Hr=Object.defineProperty,Ur=g((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"E"),Vr=Object.defineProperty,Gr=Ur((e,t)=>Vr(e,"name",{value:t,configurable:!0}),"A"),qr=Object.defineProperty,de=Gr((e,t)=>qr(e,"name",{value:t,configurable:!0}),"d");const Ve=new Map,Y=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,K=de(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),zr=de((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=Ve.get(r);if(i||(i=new Map,Ve.set(r,i)),i.has(n))return i.get(n);let a;if(K(e)==="latin")a=t.width.regular;else if(K(e)==="control")a=t.width.control;else if(K(e)==="wide")a=t.width.wide;else switch(C(e)){case"ambiguous":{a=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{a=t.width.fullWidth;break}case"wide":{a=t.width.wide;break}default:a=t.width.regular}return i.set(n,a),a},"getCachedCharWidth"),Dr=de(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),Ae=de((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?Ae(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=e,a=i>1e4;let o=0,s=0,u=i,c=!1;const d=e.includes("\x1B")||e.includes("");for(;o<i;){if(d&&(e[o]==="\x1B"||e[o]==="")){if(e.startsWith("\x1B]8;;",o)){const v="\x1B]8;;\x07",W=v.length,he=e.indexOf("\x07",o+5);if(he!==-1){const pe=e.indexOf(v,he+1);if(pe!==-1){const ct=pe+W,dt=e.slice(he+1,pe).replace(H,""),Be=Ae(dt,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,n-s),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),ge=Be.width;if(Be.truncated)c=!0,u=Math.min(u,o);else if(s+ge>n&&(u=Math.min(u,o),c=!0,s+ge>r.truncation.limit))break;if(s+=ge,o=ct,c&&s>=r.truncation.limit)break;continue}}}if(H.lastIndex=o,H.test(e)){const v=H.lastIndex-o,W=r.truncation.countAnsiEscapeCodes?v:r.width.ansi;if(s+W>n&&(u=Math.min(u,o),s+W>r.truncation.limit)){c=!0;break}s+=W,o=H.lastIndex;continue}}const j=e.codePointAt(o);if(j===8203||j===65279||j>=8288&&j<=8292){o+=1;continue}if(j===9){if(s+r.width.tab>n&&(u=Math.min(u,o),s+r.width.tab>r.truncation.limit)){c=!0;break}s+=r.width.tab,o+=1;continue}if(Y.lastIndex=o,Y.test(e)){const v=(Y.lastIndex-o)*r.width.regular;if(s+v>n){const W=Math.floor((n-s)/r.width.regular);if(u=Math.min(u,o+W),s+v>r.truncation.limit){c=!0;break}}s+=v,o=Y.lastIndex;continue}if((j<=31||j>=127&&j<=159)&&(D.lastIndex=o,D.test(e))){const v=(D.lastIndex-o)*r.width.control;if(s+v>n&&(u=Math.min(u,o+Math.floor((n-s)/r.width.control)),s+v>r.truncation.limit)){c=!0;break}s+=v,o=D.lastIndex;continue}if(me.lastIndex=o,me.test(e)){if(s+r.width.emoji>n&&(u=Math.min(u,o),s+r.width.emoji>r.truncation.limit)){c=!0;break}s+=r.width.emoji,o=me.lastIndex;continue}const M=e.codePointAt(o)??0;if(Dr(M)){o+=M>65535?2:1;continue}let $;if(a)$=zr(M,r);else switch(K(M)){case"control":{$=r.width.control;break}case"latin":{$=r.width.regular;break}case"wide":{$=r.width.wide;break}case"zero":{$=0;break}default:switch(C(M)){case"ambiguous":{$=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{$=r.width.fullWidth;break}case"wide":{$=r.width.wide;break}default:$=r.width.regular}}if(s+$>n&&(u=Math.min(u,o),s+$>r.truncation.limit)){c=!0;break}s+=$,o+=M>65535?2:1}let f=s,Ee=!1;return c&&r.truncation.limit>=r.truncation.ellipsisWidth&&(f=r.truncation.limit,Ee=!0),{ellipsed:Ee,index:c?u:i,truncated:c,width:f}},"getStringTruncatedWidth");var Yr=Object.defineProperty,Jr=g((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"i$1"),Zr=Object.defineProperty,Kr=Jr((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"e"),Qr=Object.defineProperty,Xr=Kr((e,t)=>Qr(e,"name",{value:t,configurable:!0}),"r");const en=Xr((e,t={})=>Ae(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var tn=Object.defineProperty,S=g((e,t)=>tn(e,"name",{value:t,configurable:!0}),"n$1");const it=80,at=24,Pe=S((e,t,{shell:r,env:n}={})=>pr(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),Q=S((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),ot=S((e,t)=>{const{columns:r,rows:n}=Q(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===it&&n===at))return{columns:r,rows:n}},"createIfNotDefault"),rn=S(()=>{if(x.platform!=="linux")return!0;try{const e=V.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),n=Number.parseInt(r[2],10),i=Number.parseInt(r[5],10);return Number.isNaN(n)||Number.isNaN(i)||i<=0?!1:n===i}catch{return!1}},"isForegroundProcess");function fe(){const{env:e,stdout:t,stderr:r}=x;if(t?.columns&&t?.rows)return Q(t.columns,t.rows);if(r?.columns&&r?.rows)return Q(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return Q(e.COLUMNS,e.LINES);const n={columns:it,rows:at};return x.platform==="win32"?be()??n:x.platform==="darwin"?Ge()??be()??n:Ge()??be()??nn()??n}m(fe,"it");N(fe,"fe");g(fe,"O$1");S(fe,"terminalSize");const Ge=S(()=>{try{const e=x.platform==="darwin"?V.constants.O_EVTONLY|V.constants.O_NONBLOCK:V.constants.O_NONBLOCK,{columns:t,rows:r}=gr.WriteStream(V.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),be=S(()=>{try{const e=Pe("tput",["cols"],{env:{TERM:"dumb",...x.env}}),t=Pe("tput",["lines"],{env:{TERM:"dumb",...x.env}});if(e&&t)return ot(e,t)}catch{}},"tput"),nn=S(()=>{try{if(!rn())return;const e=Pe("resize",["-u"]).match(/\d+/g);if(e.length===2)return ot(e[0],e[1])}catch{}},"resize");var an=Object.defineProperty,on=g((e,t)=>an(e,"name",{value:t,configurable:!0}),"s");const U=new Map,sn=500,b=on(e=>{if(!e||e==="")return"";const t=U.get(e);if(t!==void 0)return t;const r=cr(Object.assign([],{raw:[e]}));if(U.size>=sn){const n=U.keys().next().value;n!==void 0&&U.delete(n)}return U.set(e,r),r},"templateFormat");var ln=Object.defineProperty,un=g((e,t)=>ln(e,"name",{value:t,configurable:!0}),"t$1");const X=un(()=>{const e=wt().CEREBRO_TERMINAL_WIDTH;if(e===void 0)return;const t=Number.parseInt(e,10);if(!(Number.isNaN(t)||t<=0))return t},"getTerminalWidth");var cn=Object.defineProperty,dn=g((e,t)=>cn(e,"name",{value:t,configurable:!0}),"t");class st{static{m(this,"mt")}static{N(this,"he")}static{g(this,"n")}static{dn(this,"BaseSection")}lines;constructor(){this.lines=[]}add(t){this.lines.push(t)}toString(){return this.lines.join(mr.EOL)}header(t){this.add(bt(t)),this.lines.push("")}}var fn=Object.defineProperty,ne=g((e,t)=>fn(e,"name",{value:t,configurable:!0}),"g");const hn=ne(e=>e!==void 0&&e>0?e:fe().columns,"resolveTerminalWidth"),pn=ne((e,t,r,n)=>{if(e.length===0||e.some(c=>c.length!==2))return;let i=0;for(const c of e){const d=c[0];if(d===void 0)continue;const f=en(d);f>i&&(i=f)}if(i===0)return;const a=r+n,o=i+a,s=20+a;if(o+s>t)return;const u=t-o;return[o,u]},"computeColumnWidths");class gn extends st{static{m(this,"Ii")}static{N(this,"Wr")}static{g(this,"S")}static{ne(this,"ContentSection")}constructor(t){if(super(),t.header&&this.header(b(t.header)),t.content){if(t.raw)if(Array.isArray(t.content)&&t.content.every(r=>typeof r=="string"))t.content.forEach(r=>{Array.isArray(r)?r.forEach(n=>{this.add(b(n))}):this.add(b(r))});else if(typeof t.content=="string")this.add(b(t.content));else throw new TypeError("Invalid raw content, must be a string or array of strings.");else this.add(this.getContentLines(t.content));this.add("")}}getContentLines(t){if(typeof t=="string"){const r=J({showHeader:!1,style:{border:Z,paddingLeft:4,paddingRight:1},terminalWidth:X(),truncateOverflow:!1,wordWrap:!0});return r.addRow([b(t)]),r.toString()}if(Array.isArray(t)&&t.every(r=>typeof r=="string"||Array.isArray(r)&&r.every(n=>typeof n=="string"))){const r=hn(X()),n=ne(s=>Array.isArray(s)?s.map(u=>b(u)):[b(s)],"formatRow"),i=t.map(s=>n(s)),a=pn(i,r,4,1),o=J({columnWidths:a,showHeader:!1,style:{border:Z,paddingLeft:4,paddingRight:1},terminalWidth:r,truncateOverflow:!1,wordWrap:!0});return i.forEach(s=>{a!==void 0&&s.length===2?o.addRow([{content:s[0],wordWrap:!1},s[1]]):o.addRow(s)}),o.toString()}if(typeof t=="object"){const r=t;if(!r.options||!r.data)throw new Error(`Must have an "options" or "data" property
|
|
4
|
+
${JSON.stringify(t)}`);const n=J({showHeader:!1,style:{border:Z,paddingLeft:4,paddingRight:1},terminalWidth:X(),truncateOverflow:!1,wordWrap:!0});return r.data.forEach(i=>{Array.isArray(i)?n.addRow(i.map(a=>b(a))):n.addRow([b(i)])}),n.toString()}throw new Error(`invalid input - 'content' must be a string, array of strings or a object:
|
|
15
5
|
|
|
16
|
-
${JSON.stringify(t)}`)}}var
|
|
17
|
-
${e.map(t=>t.optionList?new
|
|
18
|
-
`)}`,"commandLineUsage");var
|
|
6
|
+
${JSON.stringify(t)}`)}}var mn=Object.defineProperty,bn=g((e,t)=>mn(e,"name",{value:t,configurable:!0}),"m");class yn extends st{static{m(this,"$i")}static{N(this,"Ir")}static{g(this,"O")}static{bn(this,"OptionListSection")}constructor(t){super();let r=t.optionList??[];const n=Array.isArray(t.hide)?t.hide:[t.hide].filter(o=>typeof o=="string"),i=Array.isArray(t.group)?t.group:[t.group].filter(o=>typeof o=="string");n.length>0&&(r=r.filter(o=>!n.includes(o.name))),t.header&&this.header(b(t.header)),i.length>0&&(r=r.filter(o=>{const s=o,u=i.includes("_none")&&!s.group,c=s.group,d=this.intersect(Array.isArray(c)?c:[c],i);return u||d?o:void 0}));const a=J({showHeader:!1,style:{border:Z,paddingLeft:2,paddingRight:1,...t.tableOptions?.style},terminalWidth:X()??t.tableOptions?.terminalWidth,truncateOverflow:!1,wordWrap:t.tableOptions?.wordWrap??!0,...t.tableOptions});r.forEach(o=>{const s=o;a.addRow([this.getOptionNames(s,t.reverseNameOrder??!1,t.isArgument??!1),b(s.description)])}),this.add(a.toString()),this.lines.push("")}getOptionNames(t,r,n){if(!t.name)throw new TypeError("Invalid option definition, name is required.");let i=t.type?t.type.name.toLowerCase():"string";const a=t.multiple||t.lazyMultiple?"[]":"";i=b(t.typeLabel??`{underline ${i}${a}}`);let o;if(t.alias)if(t.name){const s=n?t.name:`{yellow --${t.name}}`;o=b(r?`{bold ${s}}, {bold -${t.alias}} ${i}`:`{bold -${t.alias}}, {bold ${s}} ${i}`)}else r?o=b(`{bold -${t.alias}} ${i}`):o=b(`{bold -${t.alias}} ${i}`);else o=b(`{bold ${n?t.name:`{yellow --${t.name}}`}} ${i}`);return o}intersect(t,r){return t.some(n=>r.includes(n))}}var wn=Object.defineProperty,$n=g((e,t)=>wn(e,"name",{value:t,configurable:!0}),"o");const Ie=$n(e=>(Array.isArray(e)?e:[e]).length===0?"":`
|
|
7
|
+
${e.map(t=>t.optionList?new yn(t).toString():new gn(t).toString()).join(`
|
|
8
|
+
`)}`,"commandLineUsage");var vn=Object.defineProperty,lt=m((e,t)=>vn(e,"name",{value:t,configurable:!0}),"b"),On=Object.defineProperty,ut=lt((e,t)=>On(e,"name",{value:t,configurable:!0}),"b");const Nn=[{defaultValue:"32",description:"Controls the verbosity level of output. Valid values: '16' (quiet), '32' (normal), '64' (verbose), '128' (debug)",name:"CEREBRO_OUTPUT_LEVEL",type:String},{description:"Sets the minimum required Node.js version. Overrides the default minimum version check",name:"CEREBRO_MIN_NODE_VERSION",type:Number},{defaultValue:!1,description:"When set, disables the update notifier check",name:"NO_UPDATE_NOTIFIER",type:Boolean},{description:"Standard Node.js environment variable. When set to 'test', disables update notifier",name:"NODE_ENV",type:String},{defaultValue:!1,description:"When set, enables debug output (same as --debug flag)",name:"DEBUG",type:Boolean},{description:"Sets the terminal width for table rendering. Useful for testing and consistent output",name:"CEREBRO_TERMINAL_WIDTH",type:Number}];var jn=Object.defineProperty,I=ut((e,t)=>jn(e,"name",{value:t,configurable:!0}),"f");const qe="__Other",ze=I(e=>e.charAt(0).toUpperCase()+e.slice(1),"upperFirstChar"),An=I((e,t,r,n)=>{e.debug("no command given, printing general help...");let i=[...new Set(r.values())].filter(s=>!s.hidden);n&&(i=i.filter(s=>s.group===n));const a=i.reduce((s,u)=>{const c=u.group??qe;return s[c]??=[],s[c].push(u),s},{}),o=I(s=>s.map(u=>{let c="";typeof u.alias=="string"?c=u.alias:Array.isArray(u.alias)&&(c=u.alias.join(", ")),c!==""&&(c=` [${c}]`);let d=u.name;return u.commandPath&&u.commandPath.length>0&&(d=`${u.commandPath.join(" ")} ${u.name}`),[`${O(d)}${c}`,u.description??""]}),"buildCommandList");(e.raw??e.log)(Ie([{content:`${T(t.getCliName())} ${O("<command>")} [positional arguments] ${ee("[options]")}`,header:y.cyan(" Usage ")},...Object.keys(a).map(s=>{const u=n?` ${ze(n)}`:"";return{content:o(a[s]),header:s===qe||n?y.green(` Available${u} Commands `):` ${y.green(` ${ze(s)} `)}`}}),r.has("help")?{header:y.yellow(" Command Options "),optionList:r.get("help").options?.filter(s=>!s.hidden)}:void 0,{header:y.yellow(" Global Options "),optionList:t.getGlobalOptions()},{content:Nn.filter(s=>!s.hidden).map(s=>[s.name,s.description??""]),header:y.magenta(" Environment Variables ")},{content:`Run "${T(t.getCliName())} ${O("help <command>")}" or "${T(t.getCliName())} ${O("<command>")} ${ee("--help")}" for help with a specific command.`,raw:!0}].filter(Boolean)))},"printGeneralHelp"),De=I((e,t)=>{const r=[];for(const n of e.values()){if(n.hidden)continue;const i=n.commandPath??[];if(i.length!==t.length)continue;let a=!0;for(const[o,s]of t.entries())if(i[o]!==s){a=!1;break}a&&r.push(n)}return r},"findChildren"),Pn=I((e,t,r,n)=>{const i=r.join(" "),a=[{content:`${T(t.getCliName())} ${O(i)} ${O("<subcommand>")} [positional arguments] ${ee("[options]")}`,header:y.cyan(" Usage ")},{content:n.map(o=>{const s=[...o.commandPath??[],o.name].join(" ");return[O(s),o.description??""]}),header:y.green(" Subcommands ")},{header:y.yellow(" Global Options "),optionList:t.getGlobalOptions()},{content:`Run "${T(t.getCliName())} ${O(`${i} <subcommand>`)} ${ee("--help")}" for help with a specific subcommand.`,raw:!0}];(e.raw??e.log)(Ie(a))},"printParentHelp"),Sn=I((e,t,r,n,i)=>{let a=i??r.get(n);if(!a)for(const d of r.values()){const f=d.commandPath?[...d.commandPath,d.name]:[d.name];if(f.at(-1)===n||f.join(" ")===n){a=d;break}}if(!a){const d=n.split(" ").filter(Boolean),f=d.length>0?De(r,d):[];if(f.length>0){Pn(e,t,d,f);return}e.error(`Command "${n}" not found`);return}const o=[],s=(a.commandPath?[...a.commandPath,a.name]:[a.name]).join(" ");if(o.push({content:`${T(t.getCliName())} ${O(s)}${a.argument?" [positional arguments]":""}${a.options?" [options]":""}`,header:y.cyan(" Usage ")}),a.description&&o.push({content:a.description,header:y.green(" Description ")}),a.argument&&o.push({header:"Command Positional Arguments",isArgument:!0,optionList:[a.argument]}),Array.isArray(a.options)&&a.options.length>0&&o.push({header:y.yellow(" Command Options "),optionList:a.options.filter(d=>!d.hidden)}),o.push({header:y.yellow(" Global Options "),optionList:t.getGlobalOptions()}),Array.isArray(a.env)&&a.env.length>0){const d=a.env.filter(f=>!f.hidden);d.length>0&&o.push({content:d.map(f=>[f.name,f.description??""]),header:y.magenta(" Environment Variables ")})}if(a.alias!==void 0&&a.alias.length>0){let d=a.alias;typeof a.alias=="string"&&(d=[a.alias]),o.splice(1,0,{content:d,header:"Alias(es)"})}Array.isArray(a.examples)&&a.examples.length>0&&o.push({content:a.examples,header:"Examples"});const u=[...a.commandPath??[],a.name],c=De(r,u);c.length>0&&o.push({content:c.map(d=>{const f=[...d.commandPath??[],d.name].join(" ");return[O(f),d.description??""]}),header:y.green(" Subcommands ")}),(e.raw??e.log)(Ie(o))},"printCommandHelp");class Bn{static{m(this,"L")}static{lt(this,"L")}static{ut(this,"x")}static{I(this,"HelpCommand")}argument={description:"Command to show help for (subcommand path supported, e.g. `cli help docker build`)",name:"command",type:String};name="help";options=[{description:"Display only the specified group",name:"group",type:String}];commands;constructor(t){this.commands=t}execute(t){const{argument:r,command:n,commandName:i,logger:a,options:o,runtime:s}=t,{footer:u,header:c}=s.getCommandSection();c&&(a.raw??a.log)(b(c));const d=i==="help"&&Array.isArray(r)&&r.length>0?r.join(" "):void 0;if(i==="help"&&d===void 0)An(a,s,this.commands,typeof o?.group=="string"?o.group:void 0);else{const f=d!==void 0||n===void 0||n.name==="help"?void 0:n;Sn(a,s,this.commands,d??i,f)}u&&(a.raw??a.log)(b(u))}}export{Bn as default};
|