@visulima/vis 4.1.20 → 4.3.0

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.
Files changed (197) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/LICENSE.md +804 -360
  3. package/dist/bin.js +1 -1
  4. package/dist/binx.js +1 -1
  5. package/dist/config/index.d.ts +117 -0
  6. package/dist/packem_chunks/CONFIG_FILES.js +1 -1
  7. package/dist/packem_chunks/bloom-status.js +1 -1
  8. package/dist/packem_chunks/bloom-sync.js +1 -1
  9. package/dist/packem_chunks/cargo-plan.js +3 -0
  10. package/dist/packem_chunks/catalog.js +50 -50
  11. package/dist/packem_chunks/cli-exec.js +1 -1
  12. package/dist/packem_chunks/cli-main.js +146 -142
  13. package/dist/packem_chunks/composer-projects.js +2 -0
  14. package/dist/packem_chunks/dart-plan.js +1 -0
  15. package/dist/packem_chunks/dart-projects.js +1 -0
  16. package/dist/packem_chunks/dispatch.js +1 -1
  17. package/dist/packem_chunks/fix.js +1 -1
  18. package/dist/packem_chunks/gem-plan.js +2 -0
  19. package/dist/packem_chunks/gem-projects.js +1 -0
  20. package/dist/packem_chunks/git.js +5 -5
  21. package/dist/packem_chunks/go-plan.js +1 -0
  22. package/dist/packem_chunks/go-projects.js +2 -0
  23. package/dist/packem_chunks/gradle-plan.js +1 -0
  24. package/dist/packem_chunks/handler.js +1 -1
  25. package/dist/packem_chunks/handler10.js +1 -1
  26. package/dist/packem_chunks/handler11.js +1 -1
  27. package/dist/packem_chunks/handler12.js +1 -1
  28. package/dist/packem_chunks/handler13.js +1 -1
  29. package/dist/packem_chunks/handler14.js +1 -1
  30. package/dist/packem_chunks/handler15.js +1 -1
  31. package/dist/packem_chunks/handler16.js +1 -1
  32. package/dist/packem_chunks/handler17.js +1 -1
  33. package/dist/packem_chunks/handler18.js +1 -1
  34. package/dist/packem_chunks/handler19.js +1 -1
  35. package/dist/packem_chunks/handler2.js +1 -1
  36. package/dist/packem_chunks/handler20.js +2 -2
  37. package/dist/packem_chunks/handler21.js +1 -1
  38. package/dist/packem_chunks/handler22.js +1 -1
  39. package/dist/packem_chunks/handler23.js +1 -1
  40. package/dist/packem_chunks/handler24.js +1 -1
  41. package/dist/packem_chunks/handler26.js +1 -1
  42. package/dist/packem_chunks/handler27.js +1 -1
  43. package/dist/packem_chunks/handler28.js +1 -1
  44. package/dist/packem_chunks/handler29.js +1 -1
  45. package/dist/packem_chunks/handler3.js +2 -2
  46. package/dist/packem_chunks/handler30.js +1 -1
  47. package/dist/packem_chunks/handler39.js +6 -6
  48. package/dist/packem_chunks/handler4.js +3 -3
  49. package/dist/packem_chunks/handler5.js +1 -1
  50. package/dist/packem_chunks/handler50.js +1 -1
  51. package/dist/packem_chunks/handler51.js +1 -1
  52. package/dist/packem_chunks/handler52.js +3 -3
  53. package/dist/packem_chunks/handler53.js +1 -1
  54. package/dist/packem_chunks/handler54.js +2 -2
  55. package/dist/packem_chunks/handler55.js +1 -1
  56. package/dist/packem_chunks/handler58.js +3 -3
  57. package/dist/packem_chunks/handler59.js +1 -1
  58. package/dist/packem_chunks/handler6.js +5 -5
  59. package/dist/packem_chunks/handler60.js +1 -1
  60. package/dist/packem_chunks/handler61.js +1 -1
  61. package/dist/packem_chunks/handler62.js +1 -1
  62. package/dist/packem_chunks/handler63.js +1 -1
  63. package/dist/packem_chunks/handler64.js +1 -1
  64. package/dist/packem_chunks/handler65.js +4 -4
  65. package/dist/packem_chunks/handler66.js +1 -1
  66. package/dist/packem_chunks/handler67.js +10 -10
  67. package/dist/packem_chunks/handler68.js +1 -1
  68. package/dist/packem_chunks/handler69.js +1 -1
  69. package/dist/packem_chunks/handler7.js +1 -1
  70. package/dist/packem_chunks/handler70.js +4 -4
  71. package/dist/packem_chunks/handler71.js +6 -6
  72. package/dist/packem_chunks/handler72.js +1 -1
  73. package/dist/packem_chunks/handler73.js +87 -86
  74. package/dist/packem_chunks/handler74.js +1 -1
  75. package/dist/packem_chunks/handler75.js +31 -31
  76. package/dist/packem_chunks/handler76.js +4 -4
  77. package/dist/packem_chunks/handler77.js +1 -1
  78. package/dist/packem_chunks/handler78.js +64 -64
  79. package/dist/packem_chunks/handler8.js +1 -1
  80. package/dist/packem_chunks/handler9.js +1 -1
  81. package/dist/packem_chunks/heal-accept.js +1 -1
  82. package/dist/packem_chunks/heal.js +1 -1
  83. package/dist/packem_chunks/help-command.js +7 -7
  84. package/dist/packem_chunks/hex-plan.js +3 -0
  85. package/dist/packem_chunks/hex-projects.js +1 -0
  86. package/dist/packem_chunks/index2.js +52 -42
  87. package/dist/packem_chunks/index4.js +58 -802
  88. package/dist/packem_chunks/index5.js +802 -7
  89. package/dist/packem_chunks/index6.js +7 -59
  90. package/dist/packem_chunks/keys-refresh.js +1 -1
  91. package/dist/packem_chunks/lean.js +1 -1
  92. package/dist/packem_chunks/list.js +1 -1
  93. package/dist/packem_chunks/loader.js +1 -1
  94. package/dist/packem_chunks/maven-plan.js +1 -0
  95. package/dist/packem_chunks/maven-projects.js +1 -0
  96. package/dist/packem_chunks/nuget-plan.js +1 -0
  97. package/dist/packem_chunks/nuget-projects.js +1 -0
  98. package/dist/packem_chunks/orchestrator.js +33 -33
  99. package/dist/packem_chunks/prune.js +1 -1
  100. package/dist/packem_chunks/python-plan.js +3 -0
  101. package/dist/packem_chunks/python-projects.js +1 -0
  102. package/dist/packem_chunks/security.js +1 -1
  103. package/dist/packem_chunks/snapshot.js +2 -2
  104. package/dist/packem_chunks/status.js +1 -1
  105. package/dist/packem_chunks/swift-projects.js +1 -0
  106. package/dist/packem_chunks/sync.js +3 -2
  107. package/dist/packem_chunks/sync2.js +1 -1
  108. package/dist/packem_chunks/tripwire.js +1 -1
  109. package/dist/packem_chunks/ts-loader.js +5 -5
  110. package/dist/packem_chunks/verify-lockfile.js +1 -1
  111. package/dist/packem_chunks/version-resolver.js +3 -3
  112. package/dist/packem_chunks/zig-plan.js +1 -0
  113. package/dist/packem_chunks/zig-projects.js +1 -0
  114. package/dist/packem_shared/Table-BB8xHTU5-BLPS917D.js +11 -0
  115. package/dist/packem_shared/affected-selection-BzIbfpA1.js +1 -0
  116. package/dist/packem_shared/{affected-shas-Dd0P7fGD.js → affected-shas-B2V84O0g.js} +1 -1
  117. package/dist/packem_shared/{ai-analysis-DSQQDFU9.js → ai-analysis-Cfj24UAy.js} +1 -1
  118. package/dist/packem_shared/{ai-fix-BHyx1F1j.js → ai-fix-DeRUtT-s.js} +1 -1
  119. package/dist/packem_shared/{augment-COAiXSIx.js → augment-B9kSZuvW.js} +1 -1
  120. package/dist/packem_shared/{bin-Bq3tJmvE.js → bin-D9TsVhq2.js} +1 -1
  121. package/dist/packem_shared/{build-scripts-pdVmqXRm.js → build-scripts-CEDx_nJp.js} +1 -1
  122. package/dist/packem_shared/{command-runtime-CiLVo4ED.js → command-runtime-p4IXiIf6.js} +1 -1
  123. package/dist/packem_shared/composer-DR3D-Psb.js +1 -0
  124. package/dist/packem_shared/dart-pubspec-BK_cK2EP.js +2 -0
  125. package/dist/packem_shared/{dependency-scan-DBH2Qo4I.js → dependency-scan-B8jroa1D.js} +1 -1
  126. package/dist/packem_shared/{docker-Dy-X_BuM.js → docker-DXqV-07f.js} +1 -1
  127. package/dist/packem_shared/ecosystem-gate-1M3wnsTr.js +6 -0
  128. package/dist/packem_shared/{failure-log-3R522Vb5.js → failure-log-D2x5BT8S.js} +1 -1
  129. package/dist/packem_shared/{formatBytes-BHAzNIrn-XohRrPdt.js → formatBytes-BHAzNIrn-CrusHOew.js} +1 -1
  130. package/dist/packem_shared/gemspec-K7N05xxc.js +3 -0
  131. package/dist/packem_shared/glob-Cyk1H9ZL-Dxlf9Swz.js +1 -0
  132. package/dist/packem_shared/go-modules-BsVqtyeC.js +1 -0
  133. package/dist/packem_shared/gradle-build-CHZDHyjI.js +8 -0
  134. package/dist/packem_shared/index-BO8qIogg.js +1 -0
  135. package/dist/packem_shared/index-BzhrR_iC.js +22 -0
  136. package/dist/packem_shared/{index-Vm90Te96.js → index-CNYv9D8g.js} +1 -1
  137. package/dist/packem_shared/{isAccessibleSync-DYKTrrvc-CSnBISfV.js → isAccessibleSync-DYKTrrvc-C-_5cgwu.js} +1 -1
  138. package/dist/packem_shared/{lifecycle-CAIJbxIa.js → lifecycle-D6PMPor-.js} +1 -1
  139. package/dist/packem_shared/{lockfile-DVFySxTS.js → lockfile-CiUtEbnt.js} +1 -1
  140. package/dist/packem_shared/{manifests-BNSmpPF_.js → manifests-Du4yKlf_.js} +1 -1
  141. package/dist/packem_shared/maven-pom-B0KG9kJQ.js +1 -0
  142. package/dist/packem_shared/{min-release-age-ChzTC7_I.js → min-release-age-JViyQuBM.js} +1 -1
  143. package/dist/packem_shared/missing-package-json-DnHMxRnG.js +1 -0
  144. package/dist/packem_shared/mix-project-RYvdZp3_.js +2 -0
  145. package/dist/packem_shared/multi-eco-lockfiles-CUUxUjHK.js +1 -0
  146. package/dist/packem_shared/{native-config-sync-BSzU4qUO.js → native-config-sync-TdTWjVgI.js} +2 -2
  147. package/dist/packem_shared/nuget-project-RApYSW_y.js +4 -0
  148. package/dist/packem_shared/{osv-bloom-JYIWcH3F.js → osv-bloom-BCAX5ARR.js} +1 -1
  149. package/dist/packem_shared/package-version-DUcG-b7S.js +4 -0
  150. package/dist/packem_shared/{packument-DyuhH1Gz.js → packument-CyGSNquL.js} +1 -1
  151. package/dist/packem_shared/{pm-runner-d93_73O6.js → pm-runner-CMSml1Bj.js} +1 -1
  152. package/dist/packem_shared/{project-name-filter-CC5FF49q.js → project-name-filter--bq-FL2f.js} +1 -1
  153. package/dist/packem_shared/{provenance-BH80RHXx.js → provenance-DyF0b6KX.js} +1 -1
  154. package/dist/packem_shared/{readJsonSync-CbryXYxN-B2aSeDpC.js → readJsonSync-CbryXYxN-EWl7_7KX.js} +1 -1
  155. package/dist/packem_shared/{registry-keys-BWHRFWbb.js → registry-keys-DwB3ZXS_.js} +1 -1
  156. package/dist/packem_shared/{resolve-explicit-DuJ3mbzt.js → resolve-explicit-BjCEm0s-.js} +1 -1
  157. package/dist/packem_shared/resolve-runtime-CNiHcVtx.js +1 -0
  158. package/dist/packem_shared/{run-file-jMngGQhs.js → run-file-UBukWaha.js} +1 -1
  159. package/dist/packem_shared/{runtime-check-BklgEMkC.js → runtime-check-1U8HrQd9.js} +1 -1
  160. package/dist/packem_shared/{s1ngularity-BJ5j2vbJ.js → s1ngularity-YfmkD_AH.js} +1 -1
  161. package/dist/packem_shared/scan-progress-C_zaZjyY.js +2 -0
  162. package/dist/packem_shared/{selectors-B7lSFz7l.js → selectors-edwcgNl3.js} +1 -1
  163. package/dist/packem_shared/{signatures-BP042BlB.js → signatures-CL3ckp_Y.js} +1 -1
  164. package/dist/packem_shared/{spinner-BM_0Bj6x.js → spinner-DuB0K0Am.js} +1 -1
  165. package/dist/packem_shared/swift-package-B6X5kzQE.js +1 -0
  166. package/dist/packem_shared/{tabs-UDYQ3tqt.js → tabs-RZd_e1M0.js} +1 -1
  167. package/dist/packem_shared/{target-merge-B4No-LHM.js → target-merge-DVJl-7Qz.js} +1 -1
  168. package/dist/packem_shared/{target-options-d_rIrLyq.js → target-options-DsHFmRZH.js} +1 -1
  169. package/dist/packem_shared/{toolchain-DY11tPCw.js → toolchain-BRdpaAC4.js} +1 -1
  170. package/dist/packem_shared/{typosquats-CSkIFgF5.js → typosquats-8u0drCqQ.js} +1 -1
  171. package/dist/packem_shared/{use-measured-height-BPQg2q_p.js → use-measured-height-DWkDV9Dj.js} +1 -1
  172. package/dist/packem_shared/verify-B_MblU_Q.js +1 -0
  173. package/dist/packem_shared/{vis-update-app-CR21zyht.js → vis-update-app-D73C__fx.js} +1 -1
  174. package/dist/packem_shared/{vis-user-error-qqqhLoF6.js → vis-user-error-Cpg2FqA4.js} +15 -15
  175. package/dist/packem_shared/{watch-Dswvj6Zp.js → watch-CcTketln.js} +1 -1
  176. package/dist/packem_shared/{watch-loop-COWvvSbR.js → watch-loop-qRn0IHPG.js} +1 -1
  177. package/dist/packem_shared/{writeFileSync-DJoHk3Ks-CgQ-VNNT.js → writeFileSync-DJoHk3Ks-BPRoepNw.js} +1 -1
  178. package/dist/packem_shared/zig-manifest-P7ydLEOa.js +7 -0
  179. package/dist/release/plugin-sdk.d.ts +1 -1
  180. package/dist/release/types.d.ts +133 -7
  181. package/dist/runtime/preload.js +1 -1
  182. package/index.js +52 -52
  183. package/package.json +12 -12
  184. package/schemas/vis-config.schema.json +279 -5
  185. package/schemas/vis-release-config.schema.json +132 -5
  186. package/dist/packem_shared/Table-kgZ-Cd21-DdNsp69H.js +0 -9
  187. package/dist/packem_shared/advisories-0ScpWAHV.js +0 -1
  188. package/dist/packem_shared/affected-selection-Bt4qkPUb.js +0 -1
  189. package/dist/packem_shared/cyclonedx-CX2fFvDi.js +0 -4
  190. package/dist/packem_shared/glob-Cyk1H9ZL-ox19CSsT.js +0 -1
  191. package/dist/packem_shared/index-Czrll7SU.js +0 -1
  192. package/dist/packem_shared/index-DHD8wb6Z.js +0 -22
  193. package/dist/packem_shared/missing-package-json-C0keIt78.js +0 -1
  194. package/dist/packem_shared/package-version-DFlytdgJ.js +0 -4
  195. package/dist/packem_shared/resolve-runtime-C7NBCA1C.js +0 -1
  196. package/dist/packem_shared/scan-progress-DRIGQRMr.js +0 -2
  197. package/dist/packem_shared/verify-D8wYvB85.js +0 -1
@@ -84,6 +84,16 @@
84
84
  "type": "boolean",
85
85
  "description": "Companion to `bumpMinorPreMajor` — also demote `minor` bumps to `patch` for pre-1.0 versions. Maps to release-please's `bump-patch-for-minor-pre-major`. No-op without `bumpMinorPreMajor`. Default `false`."
86
86
  },
87
+ "cargo": {
88
+ "type": "object",
89
+ "properties": {
90
+ "discover": {
91
+ "type": "boolean"
92
+ }
93
+ },
94
+ "additionalProperties": false,
95
+ "description": "Cargo crates as release packages. Off by default: a repo with Rust crates sees no change until `discover` is set. When on, every crate in the root `Cargo.toml`'s `[workspace].members` (minus `exclude`) is a release package, unless a JS package already claims its manifest."
96
+ },
87
97
  "changedFilePatterns": {
88
98
  "type": "array",
89
99
  "items": {
@@ -128,6 +138,16 @@
128
138
  },
129
139
  "description": "Per-channel routing config (semantic-release-style)."
130
140
  },
141
+ "composer": {
142
+ "type": "object",
143
+ "properties": {
144
+ "discover": {
145
+ "type": "boolean"
146
+ }
147
+ },
148
+ "additionalProperties": false,
149
+ "description": "Composer packages as release packages. Off by default. When on, the root `composer.json` with a `name` is a release package. The version is the highest `vX.Y.Z` git tag, and the release creates the next tag. Nested packages and a `\"version\"` key are refused."
150
+ },
131
151
  "currentVersionResolver": {
132
152
  "type": "string",
133
153
  "enum": [
@@ -137,6 +157,16 @@
137
157
  ],
138
158
  "description": "Source of truth for \"what is the current version of this package?\", controlling how `oldVersion` is resolved when building the release plan.\n\n `\"disk\"` (default) — read `package.json#version` (or the equivalent manifest field for non-npm versionActions). Preserves vis's historical behaviour and is the right choice when the manifest on disk is the canonical source. `\"registry\"` — query the package registry via the package's `versionActions.readPublishedVersion()`. Useful when the manifest drifts between repo and registry (e.g. teams that publish out-of-band) and you want the registry to win. `\"git-tag\"` — find the highest `releaseTagPattern`-matching tag in the current commit's ancestry and parse the version out of it. Matches nx's `git-tag` resolver and release-please's tag-based lookup.\n\n`\"registry\"` and `\"git-tag\"` fall back to the manifest version when their primary source cannot produce a valid semver (e.g. registry 404 on a freshly-added package, no matching tag yet, etc.) and surface a plan warning so the operator sees what happened.\n\nOverridable per-package via `packages.<name>.currentVersionResolver`.\n\nThe `--first-release` CLI flag is the bootstrap shortcut for this setting — it forces `\"disk\"` regardless of config and additionally skips remote-tag collision checks, so the very first run on a greenfield monorepo can't trip over missing tags or registry 404s."
139
159
  },
160
+ "dart": {
161
+ "type": "object",
162
+ "properties": {
163
+ "discover": {
164
+ "type": "boolean"
165
+ }
166
+ },
167
+ "additionalProperties": false,
168
+ "description": "Dart packages as release packages. Off by default. When on, the root `pubspec.yaml` (when it sets a version) and each member of its `workspace:` list is a release package named by its `name:`. The version must be a `version:` literal in that pubspec. Publishes to pub.dev with `dart pub publish`."
169
+ },
140
170
  "defaultManaged": {
141
171
  "type": "boolean",
142
172
  "description": "Default `release.managed` for unconfigured packages. Default: `false`."
@@ -164,6 +194,16 @@
164
194
  "type": "boolean",
165
195
  "description": "Run the project's Prettier over the files the version step writes (package.json bumps + CHANGELOG.md entries) before committing them (RFC §14 step 7). Scoped to the changed files only — never the whole tree. Resolves the project's own Prettier from the workspace root; soft-fails if Prettier isn't installed.\n\nDefault: `false` (opt-in — a project that doesn't use Prettier, or whose Prettier config conflicts with how vis writes JSON, leaves this off)."
166
196
  },
197
+ "gem": {
198
+ "type": "object",
199
+ "properties": {
200
+ "discover": {
201
+ "type": "boolean"
202
+ }
203
+ },
204
+ "additionalProperties": false,
205
+ "description": "Gems as release packages. Off by default. Every `*.gemspec` under the root (skipping `vendor`, `node_modules` and `.bundle`) is a release package named by its `spec.name` literal. The version is `spec.version = \"…\"`, or `Name::VERSION` with `VERSION = \"…\"` in `lib/<name>/version.rb`. Publish runs `gem build` and `gem push` (POSIX only)."
206
+ },
167
207
  "githubHost": {
168
208
  "type": "string",
169
209
  "description": "Self-hosted GitHub Enterprise host (e.g. `\"github.acme.com\"` — no scheme). Translates to the `GH_HOST` env var that the `gh` CLI consumes natively, so all adapter calls land on the right instance. Operators can also export `GH_HOST` directly; this config knob is the typed, vis.config.ts-discoverable equivalent. Ignored when `provider` resolves to anything other than `github`."
@@ -180,6 +220,26 @@
180
220
  "$ref": "#/$defs/GitUserConfig",
181
221
  "description": "Git committer identity used by CI workflows."
182
222
  },
223
+ "go": {
224
+ "type": "object",
225
+ "properties": {
226
+ "discover": {
227
+ "type": "boolean"
228
+ }
229
+ },
230
+ "additionalProperties": false,
231
+ "description": "Go modules as release packages. Off by default. When on, every `use` entry of `go.work` (or the root `go.mod` without one) is a release package named by its module path. The version is the highest git tag for the module, and the release creates the next tag. A `/vN` major needs a matching module path."
232
+ },
233
+ "gradle": {
234
+ "type": "object",
235
+ "properties": {
236
+ "discover": {
237
+ "type": "boolean"
238
+ }
239
+ },
240
+ "additionalProperties": false,
241
+ "description": "Gradle modules as release packages. Off by default. When on, the root build and every module in `settings.gradle(.kts)` is a release package named `group:artifact`. The version must be a string literal in the module's script or the root script's allprojects / subprojects block; a group or version the release cannot read fails it."
242
+ },
183
243
  "groupPreVersionCommands": {
184
244
  "type": "object",
185
245
  "additionalProperties": {
@@ -187,6 +247,16 @@
187
247
  },
188
248
  "description": "Group-scoped preVersion command. Runs once before any package in the group is versioned. `groupName` matches a `fixed`/`linked` array's index (group-0, group-1, …) or a named entry (future)."
189
249
  },
250
+ "hex": {
251
+ "type": "object",
252
+ "properties": {
253
+ "discover": {
254
+ "type": "boolean"
255
+ }
256
+ },
257
+ "additionalProperties": false,
258
+ "description": "Hex packages as release packages. Off by default. The root `mix.exs` is a package, and so is each `<apps_path>/*` app of an umbrella. The name is the `package: [name: \"…\"]` string, or the `app:` atom. The version is a `version: \"…\"` literal, or `version: \\@version` with a literal `\\@version \"…\"` attribute; a `mix.exs` with no `version:` key is an aggregate and is skipped. Publish runs `mix hex.publish --yes` (POSIX only), with the key in `HEX_API_KEY`."
259
+ },
190
260
  "httpProxy": {
191
261
  "type": "string",
192
262
  "description": "HTTPS proxy URL (e.g. `\"http://proxy.acme.com:8080\"`) for enterprise networks that route outbound HTTPS through a proxy.\n\nWired through to two surfaces:\n\n 1. `gh` / `glab` CLI subprocesses get `HTTPS_PROXY` and `HTTP_PROXY` set on their env so they tunnel through the proxy exactly as if the operator had exported the vars manually.\n\n 2. Every internal `fetch()` call (registry probes in version-actions/{cargo,python,maven,container}.ts and the shared `safeFetchVersionMetadata` helper) attaches an undici `ProxyAgent` via the `dispatcher` option, so Node's built-in fetch routes through the proxy as well.\n\nNode 22's bundled undici handles the proxy plumbing — no `https-proxy-agent` dep needed."
@@ -230,13 +300,33 @@
230
300
  },
231
301
  "description": "Linked groups: members share bump levels but only changed members publish. Accepts the same dual-shape format as `fixed` — see the `ReleaseGroupConfig` doc comment for details."
232
302
  },
303
+ "maven": {
304
+ "type": "object",
305
+ "properties": {
306
+ "discover": {
307
+ "type": "boolean"
308
+ }
309
+ },
310
+ "additionalProperties": false,
311
+ "description": "Maven modules as release packages. Off by default. When on, the root `pom.xml` and every module reachable through `<modules>` is a release package named `groupId:artifactId`. A version the release cannot rewrite (no literal, no resolvable parent or property) fails the release."
312
+ },
233
313
  "notifications": {
234
314
  "$ref": "#/$defs/NotificationsConfig",
235
315
  "description": "Notifications — post-release fan-out to chat / webhook destinations. See {@link NotificationsConfig } . Each channel runs in parallel; per-channel failures log a warning but do NOT fail the publish."
236
316
  },
317
+ "nuget": {
318
+ "type": "object",
319
+ "properties": {
320
+ "discover": {
321
+ "type": "boolean"
322
+ }
323
+ },
324
+ "additionalProperties": false,
325
+ "description": "NuGet projects as release packages. Off by default. Every `*.csproj` / `*.fsproj` under the root (skipping `bin`, `obj`, `node_modules` and claimed JS directories) is a release package named by its lowercased package id. The version is a plain `<Version>` literal in the project file, or in the nearest `Directory.Build.props`, which releases its inheriting projects in lockstep. Publish runs `dotnet pack` and `dotnet nuget push` (POSIX only)."
326
+ },
237
327
  "oneCommitPerPackage": {
238
328
  "type": "boolean",
239
- "description": "Emit one release commit per package (a `release(channel): pkg@version [skip ci]` message) instead of a single aggregate commit for the whole wave (RFC §19.5). Mirrors the per-package commit history that multi-semantic-release produced — useful for projects migrating off it that want to preserve `git log` shape. Only honoured when `aggregateRelease` is falsy. Shared artifacts (lockfile + consumed change-file deletions) ride along in the final package's commit.\n\nDefault: `false` (one aggregate commit per wave)."
329
+ "description": "Emit one release commit per package (a `release(channel): pkg\\@version [skip ci]` message) instead of a single aggregate commit for the whole wave (RFC §19.5). Mirrors the per-package commit history that multi-semantic-release produced — useful for projects migrating off it that want to preserve `git log` shape. Only honoured when `aggregateRelease` is falsy. Shared artifacts (lockfile + consumed change-file deletions) ride along in the final package's commit.\n\nDefault: `false` (one aggregate commit per wave)."
240
330
  },
241
331
  "packages": {
242
332
  "type": "object",
@@ -250,7 +340,7 @@
250
340
  "items": {
251
341
  "$ref": "#/$defs/ReleasePlugin"
252
342
  },
253
- "description": "Lifecycle plugins (tegami-style hooks: `applyDraft` / `willPublish` / `afterPublish` / `afterPublishAll`)."
343
+ "description": "Lifecycle plugins (hooks: `applyDraft` / `willPublish` / `afterPublish` / `afterPublishAll`)."
254
344
  },
255
345
  "postPublishCommand": {
256
346
  "type": "string",
@@ -298,6 +388,16 @@
298
388
  "$ref": "#/$defs/PublishConfig",
299
389
  "description": "Publish-related config."
300
390
  },
391
+ "python": {
392
+ "type": "object",
393
+ "properties": {
394
+ "discover": {
395
+ "type": "boolean"
396
+ }
397
+ },
398
+ "additionalProperties": false,
399
+ "description": "Python projects as release packages. Off by default. When on, the root `pyproject.toml` (with `[project]`) and every `[tool.uv.workspace].members` entry (minus `exclude`) is a release package. A dynamic or missing version fails the release instead of being skipped."
400
+ },
301
401
  "releaseNoteTemplate": {
302
402
  "type": "object",
303
403
  "properties": {
@@ -344,6 +444,16 @@
344
444
  "$ref": "#/$defs/SuccessWalkConfig",
345
445
  "description": "Post-release notification walk. Configures the \"🎉 This is included in version X.Y.Z\" comment + `released` label pass that runs after a successful publish wave.\n\n**Default OFF.** Leave undefined and the walk never runs — vis will not touch third-party PRs referenced in changelog bodies. Set to `{}` to opt in with defaults, or pass an object to override the comment template / labels / prerelease behaviour."
346
446
  },
447
+ "swift": {
448
+ "type": "object",
449
+ "properties": {
450
+ "discover": {
451
+ "type": "boolean"
452
+ }
453
+ },
454
+ "additionalProperties": false,
455
+ "description": "Swift packages as release packages. Off by default. Every directory under the root with a `Package.swift` is a release package named by its `Package(name: \"…\")` literal. The version comes from Git tags, and the release creates the tag."
456
+ },
347
457
  "updateInternalDependencies": {
348
458
  "$ref": "#/$defs/UpdateInternalDependenciesMode",
349
459
  "description": "Dep-propagation mode. Default: `\"out-of-range\"`."
@@ -372,6 +482,16 @@
372
482
  }
373
483
  ],
374
484
  "description": "Workspace-level changelog config (RFC §6.1 / nx parity). When set, renders one CHANGELOG.md at the workspace root in addition to per-package files."
485
+ },
486
+ "zig": {
487
+ "type": "object",
488
+ "properties": {
489
+ "discover": {
490
+ "type": "boolean"
491
+ }
492
+ },
493
+ "additionalProperties": false,
494
+ "description": "Zig packages as release packages. Off by default. When on, the workspace root's `build.zig.zon` and each in-workspace `.path` dependency that has one is a release package named by its `.name`. The version must be a `.version` string literal; a package with no `.version` is an aggregate and is skipped. Release is a git tag: Zig has no registry, so nothing is uploaded."
375
495
  }
376
496
  },
377
497
  "additionalProperties": false,
@@ -524,7 +644,7 @@
524
644
  },
525
645
  "syncGitTag": {
526
646
  "type": "boolean",
527
- "description": "Emit a single shared git tag (and one aggregate GitHub/GitLab release) for the whole group instead of one tag + release per member (tegami parity). Default `false`."
647
+ "description": "Emit a single shared git tag (and one aggregate GitHub/GitLab release) for the whole group instead of one tag + release per member. Default `false`."
528
648
  },
529
649
  "tagPattern": {
530
650
  "type": "string",
@@ -930,6 +1050,13 @@
930
1050
  "versionActions": {
931
1051
  "type": "string",
932
1052
  "description": "Built-in id (`\"npm\"`, `\"native-addon\"`, `\"private\"`, `\"shell\"`, `\"cargo\"`, `\"python\"`, `\"maven\"`, `\"container\"`, `\"jsr\"`) or a path to a custom implementation module."
1053
+ },
1054
+ "versionFiles": {
1055
+ "type": "array",
1056
+ "items": {
1057
+ "type": "string"
1058
+ },
1059
+ "description": "Non-JS version manifests to bump alongside `package.json`, relative to the package directory. Supported basenames: `Cargo.toml` (`[package]` and `[workspace.package]`) and `tauri.conf.json` (Tauri v1 `package.version` and v2 top-level `version`). Unlike `extraFiles` no regex is needed, and an unsupported basename fails the release instead of being skipped."
933
1060
  }
934
1061
  },
935
1062
  "additionalProperties": false
@@ -1017,7 +1144,7 @@
1017
1144
  "name"
1018
1145
  ],
1019
1146
  "additionalProperties": true,
1020
- "description": "A release lifecycle plugin (tegami parity). Unlike the single-purpose `defineVersionActions` / `defineChangelogFormatter` / `defineNotificationChannel` extension points, a plugin can hook arbitrary points of the version/publish lifecycle — e.g. run a build in `willPublish`, push docs in `afterPublishAll`.\n\nError semantics: `applyDraft` and `willPublish` throw-propagate (they gate the release — fail fast). `afterPublish` / `afterPublishAll` are post-effect: a throw is logged and swallowed so a side-effect hiccup can't \"unpublish\"."
1147
+ "description": "A release lifecycle plugin. Unlike the single-purpose `defineVersionActions` / `defineChangelogFormatter` / `defineNotificationChannel` extension points, a plugin can hook arbitrary points of the version/publish lifecycle — e.g. run a build in `willPublish`, push docs in `afterPublishAll`.\n\nError semantics: `applyDraft` and `willPublish` throw-propagate (they gate the release — fail fast). `afterPublish` / `afterPublishAll` are post-effect: a throw is logged and swallowed so a side-effect hiccup can't \"unpublish\"."
1021
1148
  },
1022
1149
  "PublishConfig": {
1023
1150
  "type": "object",
@@ -1070,7 +1197,7 @@
1070
1197
  },
1071
1198
  "lockInGit": {
1072
1199
  "type": "boolean",
1073
- "description": "Persist in-progress publish state to a git-TRACKED `<changesDir>/publish-lock.json` instead of the gitignored `.state.json`. Default `false`.\n\nThe tracked lock is committed (and pushed by the publish flow) so a partially-failed publish can be resumed from a *fresh checkout on a different runner* — the ephemeral-CI case where `.state.json` (untracked) never survives the clone. On full success the lock is removed and the removal committed. Mirrors tegami's `publish-lock.yaml`-in-git model."
1200
+ "description": "Persist in-progress publish state to a git-TRACKED `<changesDir>/publish-lock.json` instead of the gitignored `.state.json`. Default `false`.\n\nThe tracked lock is committed (and pushed by the publish flow) so a partially-failed publish can be resumed from a *fresh checkout on a different runner* — the ephemeral-CI case where `.state.json` (untracked) never survives the clone. On full success the lock is removed and the removal committed."
1074
1201
  },
1075
1202
  "noRelease": {
1076
1203
  "type": "boolean",
@@ -1,9 +0,0 @@
1
- import{createRequire as ei}from"node:module";let oi;const ni=t=>(oi??=ei(import.meta.url))(t),D=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ri=t=>{if(typeof D<"u"&&D.versions&&D.versions.node){const[i,e]=D.versions.node.split(".").map(Number);if(i>22||i===22&&e>=3||i===20&&e>=16)return D.getBuiltinModule(t)}return ni(t)},{createRequire:si}=ri("node:module");let hi;const ci=t=>(hi??=si(import.meta.url))(t),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:T,wt=t=>{if(typeof V<"u"&&V.versions&&V.versions.node){const[i,e]=V.versions.node.split(".").map(Number);if(i>22||i===22&&e>=3||i===20&&e>=16)return V.getBuiltinModule(t)}return ci(t)},T=V,{execFileSync:ai}=wt("node:child_process"),Y=wt("node:fs"),li=wt("node:tty"),di=[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],ui=12288,fi=65510,mi=[12288,12288,65281,65376,65504,65510],wi=8361,pi=65518,gi=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],bi=32,yi=10630,xi=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Wi=4352,Bi=262141,_t=[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],K=(t,i)=>{let e=0,o=Math.floor(t.length/2)-1;for(;e<=o;){const s=Math.floor((e+o)/2),h=s*2;if(i<t[h])o=s-1;else if(i>t[h+1])e=s+1;else return!0}return!1},bt=19968,[vi,Ri]=Ci(_t);function Ci(t){let i=t[0],e=t[1];for(let o=0;o<t.length;o+=2){const s=t[o],h=t[o+1];if(bt>=s&&bt<=h)return[s,h];h-s>e-i&&(i=s,e=h)}return[i,e]}const Si=t=>t<161||t>1114109?!1:K(di,t),Ai=t=>t<ui||t>fi?!1:K(mi,t),Ii=t=>t<wi||t>pi?!1:K(gi,t),Mi=t=>t<bi||t>yi?!1:K(xi,t),ki=t=>t>=vi&&t<=Ri?!0:t<Wi||t>Bi?!1:K(_t,t);function ji(t){return Si(t)?"ambiguous":Ai(t)?"fullwidth":Ii(t)?"halfwidth":Mi(t)?"narrow":ki(t)?"wide":"neutral"}function Ei(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function Ht(t){return Ei(t),ji(t)}const $t=String.raw,yt=$t`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Ni=()=>new RegExp($t`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${yt}(?:\u200D${yt})*`,"gu"),J=new Set(["\x1B","›"]),pt="\x07",q="]8;;",Li=/[\u200B\uFEFF\u2060-\u2064]/g,ht=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,xt=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,Wt=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,Z=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Ji=Ni(),Bt=new Map,Fi=t=>[t.ambiguousIsNarrow?1:0,t.control,t.fullWidth,t.regular,t.wide].join("|"),Ti=t=>{const i=Fi(t.width);let e=Bt.get(i);return e||(e=new Map,Bt.set(i,e)),e},X=new RegExp(ht.source,"y"),dt=new RegExp(Ji.source,"uy"),Q=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Pt=t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other",Oi=(t,i)=>{const e=Ti(i),o=Math.floor(t/65536),s=t%65536;let h=e.get(o);if(h||(h=new Map,e.set(o,h)),h.has(s))return h.get(s);let n;switch(Pt(t)){case"control":{n=i.width.control;break}case"latin":{n=i.width.regular;break}case"wide":{n=i.width.wide;break}case"zero":{n=0;break}default:switch(Ht(t)){case"ambiguous":{n=i.width.ambiguousIsNarrow?i.width.regular:i.width.wide;break}case"fullwidth":{n=i.width.fullWidth;break}case"wide":{n=i.width.wide;break}default:n=i.width.regular}}return h.set(s,n),n},_i=t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,z=(t,i={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const e={truncation:{countAnsiEscapeCodes:i.countAnsiEscapeCodes??!1,ellipsis:i.ellipsis??"",ellipsisWidth:i.ellipsisWidth??(i.ellipsis?z(i.ellipsis,{...i,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:i.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:i.ambiguousIsNarrow??!1,ansi:i.ansiWidth??0,control:i.controlWidth??0,emoji:i.emojiWidth??2,fullWidth:i.fullWidth??2,halfWidth:i.halfWidth??1,regular:i.regularWidth??1,tab:i.tabWidth??8,wide:i.wideWidth??2}},o=Math.max(0,e.truncation.limit-e.truncation.ellipsisWidth),{length:s}=t,h=s>1e4;let n=0,r=0,c=s,a=!1;const d=t.includes("\x1B")||t.includes("›");for(;n<s;){if(d&&(t[n]==="\x1B"||t[n]==="›")){if(t.startsWith("\x1B]8;;",n)){const g="\x1B]8;;\x07",u=g.length,b=t.indexOf("\x07",n+5);if(b!==-1){const W=t.indexOf(g,b+1);if(W!==-1){const y=W+u,x=t.slice(b+1,W).replace(ht,""),R=z(x,{ambiguousIsNarrow:e.width.ambiguousIsNarrow,ansiWidth:e.width.ansi,controlWidth:e.width.control,countAnsiEscapeCodes:!1,ellipsis:e.truncation.ellipsis,ellipsisWidth:e.truncation.ellipsisWidth,emojiWidth:e.width.emoji,fullWidth:e.width.fullWidth,halfWidth:e.width.halfWidth,limit:Math.max(0,o-r),regularWidth:e.width.regular,tabWidth:e.width.tab,wideWidth:e.width.wide}),S=R.width;if(R.truncated)a=!0,c=Math.min(c,n);else if(r+S>o&&(c=Math.min(c,n),a=!0,r+S>e.truncation.limit))break;if(r+=S,n=y,a&&r>=e.truncation.limit)break;continue}}}if(X.lastIndex=n,X.test(t)){const g=X.lastIndex-n,u=e.truncation.countAnsiEscapeCodes?g:e.width.ansi;if(r+u>o&&(c=Math.min(c,n),r+u>e.truncation.limit)){a=!0;break}r+=u,n=X.lastIndex;continue}}const f=t.codePointAt(n);if(f===8203||f===65279||f>=8288&&f<=8292){n+=1;continue}if(f===9){if(r+e.width.tab>o&&(c=Math.min(c,n),r+e.width.tab>e.truncation.limit)){a=!0;break}r+=e.width.tab,n+=1;continue}if(Q.lastIndex=n,Q.test(t)){const g=(Q.lastIndex-n)*e.width.regular;if(r+g>o){const u=e.width.regular>0?Math.floor((o-r)/e.width.regular):0;if(c=Math.min(c,n+u),r+g>e.truncation.limit){a=!0;break}}r+=g,n=Q.lastIndex;continue}if((f<=31||f>=127&&f<=159)&&(Z.lastIndex=n,Z.test(t))){const g=(Z.lastIndex-n)*e.width.control;if(r+g>o){const u=e.width.control>0?Math.floor((o-r)/e.width.control):0;if(c=Math.min(c,n+u),r+g>e.truncation.limit){a=!0;break}}r+=g,n=Z.lastIndex;continue}if(dt.lastIndex=n,dt.test(t)){if(r+e.width.emoji>o&&(c=Math.min(c,n),r+e.width.emoji>e.truncation.limit)){a=!0;break}r+=e.width.emoji,n=dt.lastIndex;continue}const w=t.codePointAt(n)??0;if(_i(w)){n+=w>65535?2:1;continue}let p;if(h)p=Oi(w,e);else switch(Pt(w)){case"control":{p=e.width.control;break}case"latin":{p=e.width.regular;break}case"wide":{p=e.width.wide;break}case"zero":{p=0;break}default:switch(Ht(w)){case"ambiguous":{p=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{p=e.width.fullWidth;break}case"wide":{p=e.width.wide;break}default:p=e.width.regular}}if(r+p>o&&(c=Math.min(c,n),r+p>e.truncation.limit)){a=!0;break}r+=p,n+=w>65535?2:1}let l=r,m=!1;return a&&e.truncation.limit>=e.truncation.ellipsisWidth&&(l=e.truncation.limit,m=!0),{ellipsed:m,index:a?c:s,truncated:a,width:l}},k=(t,i={})=>z(t,{...i,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;class Hi{capacity;cache;constructor(i){this.capacity=i,this.cache=new Map}get(i){if(!this.cache.has(i))return;const e=this.cache.get(i);return this.cache.delete(i),this.cache.set(i,e),e}has(i){return this.cache.has(i)}set(i,e){if(this.cache.has(i))this.cache.delete(i);else if(this.cache.size>=this.capacity){const o=this.cache.keys().next().value;o!==void 0&&this.cache.delete(o)}this.cache.set(i,e)}delete(i){this.cache.delete(i)}clear(){this.cache.clear()}size(){return this.cache.size}}const $i=/^(?:\u001B\[|\u009B)([\d:;]*)m$/,Gt=new Map([[1,22],[2,22],[3,23],[4,24],[5,25],[6,25],[7,27],[8,28],[9,29],[21,24],[53,55]]),Pi=new Set(Gt.values()),Vt=t=>{const i=t.split(";"),e=[];for(let o=0;o<i.length;o+=1){const s=i[o];if(s.includes(":")){e.push([s]);continue}const h=s===""?0:Number.parseInt(s,10);if(h===38||h===48||h===58){const n=i[o+1];let r=0;n==="5"?r=2:n==="2"?r=4:n?.includes(":")&&(r=1),e.push(i.slice(o,o+1+r)),o+=r;continue}e.push([s])}return e},qt=t=>{const i=t[0],e=i.indexOf(":"),o=e===-1?i:i.slice(0,e);return o===""?0:Number.parseInt(o,10)},zt=t=>t===38||t>=30&&t<=37||t>=90&&t<=97,Ut=t=>t===48||t>=40&&t<=47||t>=100&&t<=107,Dt=t=>{const i=Vt(t);if(i.length!==1)return;const e=qt(i[0]);return zt(e)?"foreground":Ut(e)?"background":void 0};class Gi{activeForeground=void 0;activeBackground=void 0;activeUnderlineColor=void 0;activeAttributes=new Map;processEscape(i){const e=$i.exec(i);if(e)for(const o of Vt(e[1])){const s=qt(o);switch(s){case 0:{this.resetAll();break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}case 59:{this.activeUnderlineColor=void 0;break}default:this.applyParameter(s,`\x1B[${o.join(";")}m`)}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,this.activeUnderlineColor,...this.activeAttributes.values()].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const i=[...this.activeAttributes.keys()].toReversed().map(e=>`\x1B[${String(e)}m`);return this.activeUnderlineColor&&i.push("\x1B[59m"),this.activeForeground&&i.push("\x1B[39m"),this.activeBackground&&i.push("\x1B[49m"),i.join("")}resetAll(){this.activeForeground=void 0,this.activeBackground=void 0,this.activeUnderlineColor=void 0,this.activeAttributes.clear()}applyParameter(i,e){if(!((i===38||i===48||i===58)&&!e.includes(";")&&!e.includes(":")))if(zt(i))this.activeForeground=e;else if(Ut(i))this.activeBackground=e;else if(i===58)this.activeUnderlineColor=e;else if(Pi.has(i))this.activeAttributes.delete(i);else{const o=Gt.get(i);o!==void 0&&this.activeAttributes.set(o,e)}}}const vt=new Hi(100),Vi=new Intl.Segmenter("en",{granularity:"grapheme"}),qi=/^[\u0000-\u007F]*$/,zi=new Set(["0","22","23","24","27","28","29","39","49"]),Ui=new Set(["1","3","4","7","8","9"]),Rt=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),tt=t=>Dt(t)==="foreground",it=t=>Dt(t)==="background",Di=[{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"}],Ct=(t,i)=>{let e=-1;for(const o of i){const s=t.indexOf(o);s!==-1&&(e===-1||s<e)&&(e=s)}return e},Yi=(t,i)=>{if(!t.includes("\x1B"))return[{after:"",before:"",content:t,visibleLength:k(t,i.width)}];const e=`${JSON.stringify(i.width??void 0)}\0${t}`,o=vt.get(e);if(o)return o;const s=[],h=[];let n=0,r;for(ht.lastIndex=0;(r=ht.exec(t))!==null;){const l=r[0];s.push(t.slice(n,r.index)),h.push(l),n=r.index+l.length}n<t.length&&s.push(t.slice(n));const c=[];for(const l of h){if(l==="\x1B[0m"||l==="\x1B]8;;\x07"){c.push(l);continue}if(l.startsWith("\x1B[")&&l.endsWith("m")){const m=l.slice(2,-1);if(zi.has(m)){c.push(l);continue}}}const a=new Set,d=[];for(const[l,m]of s.entries()){if(l>0&&h[l-1]){const p=h[l-1];if(p==="\x1B[0m")a.clear();else if(p==="\x1B]8;;\x07"){for(const g of a)if(g.startsWith("\x1B]8;;")&&!g.endsWith("\x1B]8;;\x07")){a.delete(g);break}}else if(p.startsWith("\x1B[")&&p.endsWith("m")){const g=p.slice(2,-1);if(g==="39"){for(const u of a)if(u.startsWith("\x1B[")&&u.endsWith("m")){const b=u.slice(2,-1);if(tt(b)){a.delete(u);break}}}else if(g==="49"){for(const u of a)if(u.startsWith("\x1B[")&&u.endsWith("m")){const b=u.slice(2,-1);if(it(b)){a.delete(u);break}}}else if(Rt.has(g)){const u=Rt.get(g);for(const b of a)if(b===`\x1B[${u}m`){a.delete(b);break}}else{if(tt(g)){for(const u of a)if(u.startsWith("\x1B[")&&u.endsWith("m")){const b=u.slice(2,-1);if(tt(b)){a.delete(u);break}}}else if(it(g)){for(const u of a)if(u.startsWith("\x1B[")&&u.endsWith("m")){const b=u.slice(2,-1);if(it(b)){a.delete(u);break}}}else if(Ui.has(g)){const u=`\x1B[${g}m`;a.has(u)&&a.delete(u)}a.add(p)}}else if(p.startsWith("\x1B]8;;")&&!p.endsWith("\x1B]8;;\x07")){for(const g of a)if(g.startsWith("\x1B]8;;")&&!g.endsWith("\x1B]8;;\x07")){a.delete(g);break}a.add(p)}}if(m==="")continue;let f="";if(a.size>0)if(c.includes("\x1B[0m"))f="\x1B[0m";else{const p=[];let g=!1;for(const y of a)if(y.startsWith("\x1B]8;;")&&!y.endsWith("\x1B]8;;\x07")){g=!0;break}g&&c.includes("\x1B]8;;\x07")&&p.push("\x1B]8;;\x07");let u=!1,b=!1;for(const y of a)if(y.startsWith("\x1B[")&&y.endsWith("m")){const x=y.slice(2,-1);tt(x)?u=!0:it(x)&&(b=!0)}if(u&&b){const y=Ct(t,["\x1B[3","\x1B[9","\x1B[38;"]),x=Ct(t,["\x1B[4","\x1B[10","\x1B[48;"]);y>=0&&x>=0?y>x?p.push("\x1B[39m","\x1B[49m"):p.push("\x1B[49m","\x1B[39m"):p.push("\x1B[39m","\x1B[49m")}else u&&p.push("\x1B[39m"),b&&p.push("\x1B[49m");u&&b&&t.includes("\x1B[39m")&&t.includes("\x1B[49m")&&(t.indexOf("\x1B[39m")<t.indexOf("\x1B[49m")?(p.length-=2,p.push("\x1B[39m","\x1B[49m")):t.indexOf("\x1B[49m")<t.indexOf("\x1B[39m")&&(p.length-=2,p.push("\x1B[49m","\x1B[39m")));const W=Di.filter(y=>a.has(y.open)).map(y=>({position:t.indexOf(y.open),style:y})).filter(y=>y.position>=0).toSorted((y,x)=>x.position-y.position);for(const y of W){const x=y;c.includes(x.style.close)&&p.push(x.style.close)}f=p.join("")}const w=[...a].join("");d.push({after:f,before:w,content:m,visibleLength:k(m,i.width)})}return vt.set(e,d),d},St=(t,i,e,o)=>{const s=[...o.segmenter.segment(t)],h=[];let n=0,r=!1;for(const c of s){const a=k(c.segment,o.width),d=n,l=n+a;if(!r)if(d<i){n=l;continue}else r=!0;if(d>=e||l>e)break;h.push(c.segment),n=l}return h.join("")},F=(t,i=0,e=Number.MAX_SAFE_INTEGER,o={})=>{const s={segmenter:Vi,...o};if(i>=e||t==="")return"";const h=k(t,s.width);if(i===0&&e>=h)return t;if(i<0||e<0)throw new RangeError("Negative indices aren't supported");if(!t.includes("\x1B"))return qi.test(t)?t.slice(i,e):St(t,i,e,s);if(xt.lastIndex=0,Wt.lastIndex=0,!xt.test(t)&&!Wt.test(t))return t;const n=Yi(t,s);if(n.length===0)return"";let r=0;const c=[];for(const[l,m]of n.entries()){const f=r,w=r+m.visibleLength;if(w>i&&f<e){const p=Math.max(0,i-f),g=Math.min(m.visibleLength,e-f);c.push({end:g,index:l,segment:m,start:p})}r=w}if(c.length===0)return"";const a=[],d=c[0].segment;a.push(d.before);for(let l=0;l<c.length;l++){const{end:m,segment:f,start:w}=c[l];if(w===0&&m===f.visibleLength?a.push(f.content):a.push(St(f.content,w,m,s)),l<c.length-1){const p=c[l+1].segment,g=f.after,u=p.before;g!==u&&(g||u)&&a.push(g,u)}}return a.push(c.at(-1).segment.after),a.join("")},At="…",Ki=3,et=(t,i,e=!1)=>{if(t.charAt(i)===" ")return i;const o=e?1:-1,s=Math.min(Ki,e?t.length-i:i);for(let h=1;h<=s;h++){const n=i+h*o;if(t.charAt(n)===" ")return n}return i},ot=(t,i,e)=>z(t,{...e,ellipsis:"",ellipsisWidth:0,limit:i}).index,nt=(t,i,e)=>k(t.slice(0,i),e),It=(t,i,e={})=>{if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof t}`);if(typeof i!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof i}`);if(t===""||i<=0)return"";const o=t.normalize("NFC"),{ellipsis:s=At,position:h="end",preferTruncationOnSpace:n=!1}=e;let r=e.ellipsisWidth??(s===At?1:void 0);r??=z(s,{...e.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:c}=z(o,{...e.width,ellipsis:s,ellipsisWidth:r});if(c<=i)return o;switch(h){case"end":{if(n){const a=i-r,d=ot(o,a,e.width),l=et(o,d),m=nt(o,l,e.width);return F(o,0,m,{width:e.width})+s}return F(o,0,i-r,{width:e.width})+s}case"middle":{const a=Math.floor(i/2),d=Math.max(0,i-r),l=Math.min(a,d),m=Math.max(0,d-l);if(n){const f=ot(o,l,e.width),w=et(o,f),p=nt(o,w,e.width),g=c-m,u=ot(o,g,e.width),b=et(o,u,!0),W=nt(o,b,e.width);return F(o,0,p,{width:e.width})+s+F(o,W,c,{width:e.width}).trim()}return F(o,0,l,{width:e.width})+s+F(o,c-m,c,{width:e.width})}case"start":{if(n){const a=c-i+r,d=ot(o,a,e.width),l=et(o,d,!0),m=nt(o,l,e.width);return s+F(o,m,c,{width:e.width}).trim()}return s+F(o,c-i+r,c,{width:e.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${h}'`)}},Mt=/(?:\u{1B}\[|\u{9B})[\u{30}-\u{3F}]*[\u{20}-\u{2F}]*[\u{40}-\u{7E}]/uy,lt=(t,i)=>{if(J.has(t[i])){if(t.startsWith(q,i+1)){const e=t.indexOf(pt,i);return e===-1?void 0:t.slice(i,e+1)}return Mt.lastIndex=i,Mt.exec(t)?.[0]}},Zi=(t,i)=>{if(!J.has(t[i]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const e=!0,o=t.slice(i+1,i+1+q.length).join("")===q;return{isInsideEscape:e,isInsideLinkEscape:o}},Xi=t=>{let i=0;for(let e=0;e<t.length;e+=1)t.codePointAt(e)>65535&&(e+=1),i+=1;return i},Qi=(t,i={})=>{let e="",o=!1,s=0,h="",n="",r=!1;const c=[...t],a=[];for(let d=0,l=0;d<c.length;d+=1)a.push(l),l+=c[d].length;for(let d=0;d<c.length;d++){const l=c[d];if(l&&J.has(l)){if(e){const g=i.getWidth?.(e)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:e,width:g};if(r&&(u.isHyperlink=!0,u.hyperlinkUrl=n),i.onSegment?.(u)===!1)return;e=""}o=!0,s=d,h=l;const w=Zi(c,d),{isInsideLinkEscape:p}=w;if(p){let g=d+1;for(n="";g<c.length;){const b=c[g];if(b===pt)break;n+=b,g+=1}n=n.slice(4);const u={hyperlinkUrl:n,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(i.onSegment?.(u)===!1)return;d=g,r=!0,o=!1,h="";continue}if(d+1<c.length&&c[d+1]==="\\"&&r){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(i.onSegment?.(g)===!1)return;r=!1,n="",d+=1,o=!1,h="";continue}}if(o){const w=lt(t,a[s]);o=!1,w===void 0?(h=c.slice(s).join(""),d=c.length):(h=w,d=s+Xi(w)-1);const p={isEscapeSequence:!0,isGrapheme:!1,text:h,width:0};if(i.onSegment?.(p)===!1)return;h="";continue}e+=l;const m=i.getWidth?.(e)??0,f={isEscapeSequence:!1,isGrapheme:!0,text:e,width:m};if(r&&(f.isHyperlink=!0,f.hyperlinkUrl=n),i.onSegment?.(f)===!1)return;e=""}if(e){const d=i.getWidth?.(e)??0,l={isEscapeSequence:!1,isGrapheme:!0,text:e,width:d};r&&(l.isHyperlink=!0,l.hyperlinkUrl=n),i.onSegment?.(l)}if(h){const d={isEscapeSequence:!0,isGrapheme:!1,text:h,width:0};i.onSegment?.(d)}},kt=t=>`${J.values().next().value}${q}${t}${pt}`,te=(t,i,e)=>{let o=e,s=0;for(;s<t.length;){if(!J.has(t[s])){s+=1;continue}const h=lt(t,s);if(h===void 0){s+=1;continue}if(t.startsWith(q,s+1)){const n=h.slice(1+q.length,-1);o=n.length===0?void 0:n}else i.processEscape(h);s+=h.length}return o},ie=t=>{if(t.length===0)return"";if(t.length===1)return t[0];const i=new Gi,e=t.length-1;let o="",s;for(const[h,n]of t.entries())h>0&&(o+=i.getStartEscapesForAllActiveAttributes(),s!==void 0&&(o+=kt(s))),o+=n,s=te(n,i,s),h<e&&(s!==void 0&&(o+=kt("")),o+=i.getEndEscapesForAllActiveAttributes(),o+=`
2
- `);return o},ee=/(?=\s)|(?<=\s)/,oe=new Intl.Segmenter("en",{granularity:"grapheme"}),ne=/[^\u0000-\u02FF]/,gt=/^\s+$/,jt=new Map,re=t=>{const i=jt.get(t);if(i!==void 0)return i;const e=k(t);return jt.set(t,e),e},se=t=>{if(!ne.test(t))return[t];const i=[];let e="";for(const{segment:o}of oe.segment(t)){if(k(o)>1){e!==""&&(i.push(e),e=""),i.push(o);continue}e+=o}return e!==""&&i.push(e),i},Et=t=>t.split(ee).flatMap(i=>i===""||gt.test(i)?[i]:se(i)),Nt="x",he=t=>{let i="",e=0;for(;e<t.length;){const o=J.has(t[e])?lt(t,e):void 0;if(o===void 0){if(J.has(t[e]))return i+Nt.repeat(t.length-e);i+=t[e],e+=1;continue}i+=Nt.repeat(o.length),e+=o.length}return i},Yt=t=>{if(![...J].some(o=>t.includes(o)))return Et(t);const i=[];let e=0;for(const o of Et(he(t)))i.push(t.slice(e,e+o.length)),e+=o.length;return i},_=t=>{const i=t.split(" ");let e=i.length;for(;e>0&&k(i[e-1])===0;)e--;return e===i.length?t:i.slice(0,e).join(" ")+i.slice(e).join("")},Kt=(t,i,e)=>{if(t.length===0)return[""];if(i<=0)return[t];const o=[];let s="",h=0,n=0;for(;n<t.length;){const r=t.codePointAt(n),c=String.fromCodePoint(r),a=c.length;if(J.has(c)){const m=lt(t,n);if(m===void 0){s+=t.slice(n);break}s+=m,n+=m.length;continue}const d=re(c),l=c===" ";if(d===0){s+=c,n+=a;continue}if(h+d>i&&(s&&o.push(s),s="",h=0,l&&e)){for(;n<t.length&&t[n]===" ";)n+=1;continue}if(s+=c,h+=d,h===i&&n+a<t.length&&(o.push(s),s="",h=0,n+a<t.length&&t[n+a]===" "&&e)){for(n+=a;n<t.length&&t[n]===" ";)n+=1;continue}n+=a}return s&&o.push(s),e?o.map(r=>_(r)):o},ce=(t,i,e)=>{if(t.length===0)return[];const o=e?t.trim():t;if(o.length===0)return[];const s=[];let h="",n=0;return Qi(o,{getWidth:k,onSegment:r=>{const c=r.text??"";if(r.isEscapeSequence)h+=c;else{const a=c===" ";if(r.width===0)return h+=c,!0;if(n+r.width>i&&(h&&s.push(h),h="",n=0,a))return e||s.push(c),!0;h+=c,n+=r.width}return!0}}),h&&s.push(h),e?s.map(r=>_(r)):s},ae=(t,i,e)=>{if(t.length===0)return[];const o=e?t.trim():t;if(o.length===0)return[];const s=Yt(o),h=[];let n="",r=0,c=0;for(;c<s.length;){const a=s[c],d=gt.test(a),l=k(a);if(a.length===0){c+=1;continue}if(e&&d&&r===0){c+=1;continue}if(r+l>i&&r>0){e?h.push(_(n)):h.push(n),n="",r=0;continue}n+=a,r+=l,c+=1}return n&&(e?h.push(_(n)):h.push(n)),h},le=(t,i,e)=>{if(t.length===0)return[];const o=e?t.trim():t;if(o.length===0)return[];const s=Yt(o),h=[];let n="",r=0,c=0;for(;c<s.length;){const a=s[c],d=gt.test(a),l=k(a);if(a.length===0){c+=1;continue}if(e&&d&&r===0){c+=1;continue}if(l>i){n&&h.push(e?_(n):n);const m=Kt(a,i,e);if(m.length>0){for(let f=0;f<m.length-1;f+=1)h.push(m[f]);n=m.at(-1),r=k(n)}else n="",r=0;c+=1;continue}if(r+l>i&&r>0&&(h.push(e?_(n):n),n="",r=0,e&&d)){c+=1;continue}n+=a,r+=l,c+=1}return n&&h.push(e?_(n):n),h},rt={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},de=(t,i={})=>{const{removeZeroWidthCharacters:e=!0,trim:o=!0,width:s=80,wrapMode:h=rt.PRESERVE_WORDS}=i;if(o&&t.trim()==="")return"";let n=t.normalize("NFC").replaceAll(`\r
3
- `,`
4
- `);return e&&(n=n.replaceAll(Li,"")),n.split(`
5
- `).map(r=>{if(o&&r.trim()==="")return"";let c;switch(h){case rt.BREAK_AT_CHARACTERS:{c=ce(r,s,o);break}case rt.BREAK_WORDS:{c=le(r,s,o);break}case rt.STRICT_WIDTH:{c=Kt(r,s,o);break}default:c=ae(r,s,o)}return ie(c)}).join(`
6
- `)},Zt=80,Xt=24,ft=(t,i,{shell:e,env:o}={})=>ai(t,i,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:e,env:o}).trim(),st=(t,i)=>({columns:Number.parseInt(t,10),rows:Number.parseInt(i,10)}),Qt=(t,i)=>{const{columns:e,rows:o}=st(t,i);if(!(Number.isNaN(e)||Number.isNaN(o))&&!(e===Zt&&o===Xt))return{columns:e,rows:o}},ue=()=>{if(T.platform!=="linux")return!0;try{const t=Y.readFileSync("/proc/self/stat","utf8"),i=t.lastIndexOf(") ");if(i===-1)return!1;const e=t.slice(i+2).trim().split(/\s+/),o=Number.parseInt(e[2],10),s=Number.parseInt(e[5],10);return Number.isNaN(o)||Number.isNaN(s)||s<=0?!1:o===s}catch{return!1}};function fe(){const{env:t,stdout:i,stderr:e}=T;if(i?.columns&&i?.rows)return st(i.columns,i.rows);if(e?.columns&&e?.rows)return st(e.columns,e.rows);if(t.COLUMNS&&t.LINES)return st(t.COLUMNS,t.LINES);const o={columns:Zt,rows:Xt};return T.platform==="win32"?ut()??o:T.platform==="darwin"?Lt()??ut()??o:Lt()??ut()??me()??o}const Lt=()=>{try{const t=T.platform==="darwin"?Y.constants.O_EVTONLY|Y.constants.O_NONBLOCK:Y.constants.O_NONBLOCK,{columns:i,rows:e}=li.WriteStream(Y.openSync("/dev/tty",t));return{columns:i,rows:e}}catch{}},ut=()=>{try{const t=ft("tput",["cols"],{env:{TERM:"dumb",...T.env}}),i=ft("tput",["lines"],{env:{TERM:"dumb",...T.env}});if(t&&i)return Qt(t,i)}catch{}},me=()=>{try{if(!ue())return;const t=ft("resize",["-u"]).match(/\d+/g);if(t.length===2)return Qt(t[0],t[1])}catch{}},P=(t,i)=>{switch(i){case"bottom":return{body:t.bottomBody,join:t.bottomJoin,left:t.bottomLeft,right:t.bottomRight};case"middle":return{body:t.joinBody,join:t.joinJoin,left:t.joinLeft,right:t.joinRight};case"top":return{body:t.topBody,join:t.topJoin,left:t.topLeft,right:t.topRight};default:throw new Error(`Invalid borderType: ${String(i)}`)}},we=t=>({join:t.bodyJoin,left:t.bodyLeft,right:t.bodyRight}),ct=(t,i,e,o=1)=>{let s=0;for(let h=0;h<e;h+=1)s+=t[i+h]??0;return e>1&&(s+=(e-1)*o),s},mt=(t,i,e,o)=>{let s=i;for(;s>0&&t[s-1]?.[e]===o;)s-=1;let h=i;for(;h<t.length-1&&t[h+1]?.[e]===o;)h+=1;let n;const r=h-s+1;if(r===1)n=!0;else switch(o.vAlign){case"bottom":{n=i===h;break}case"middle":{const c=s+Math.floor(r/2);n=i===c;break}case"top":{n=i===s;break}default:n=i===s}return{firstRow:s,lastRow:h,showContent:n}},pe=(t,i,e,o,s)=>{if(t.length===0)return[];const h=e.showBorders?e.border?.bodyJoin.width??0:0,n=e.showBorders&&(e.border?.joinBody.width??0)>0;let r=t.length-1;for(let d=0;d<t.length;d+=1){const l=t[d];if(l){for(const[m,f]of l.entries())if(f&&s(t,d,m,f)===d){const w=mt(t,d,m,f);r=Math.max(r,w.lastRow)}}}const c=Array.from({length:r+1}).fill(1);for(let d=0;d<t.length;d+=1){const l=t[d];if(l)for(let m=0;m<e.columns;m+=1){const f=l[m];if(f&&s(t,d,m,f)===d&&(f.rowSpan??1)===1){const w=f.colSpan??1,p=ct(i,m,w,h),g=o(f,p).length;c[d]=Math.max(c[d]??1,g)}}}const a=Array.from({length:c.length}).fill(!1);if(e.fixedRowHeights)for(let d=0;d<c.length;d+=1){let l;e.fixedRowHeights[d]!==void 0?l=e.fixedRowHeights[d]:e.fixedRowHeights.length===1&&e.fixedRowHeights[0]!==void 0&&(l=e.fixedRowHeights[0]),l!==void 0&&(c[d]=Math.max(1,l),a[d]=!0)}for(let d=0;d<t.length;d+=1){const l=t[d];if(l)for(let m=0;m<e.columns;m+=1){const f=l[m];if(f&&s(t,d,m,f)===d&&(f.rowSpan??1)>1){const w=f.colSpan??1,p=ct(i,m,w,h),g=o(f,p),u=n?g.length-1:g.length,b=mt(t,d,m,f),{firstRow:W,lastRow:y}=b;let x=0,R=0;for(let v=W;v<=y&&v<c.length;v+=1)x+=c[v]??1,a[v]||(R+=1);const S=u-x;if(S>0)if(R>0){const v=Math.ceil(S/R);let B=0;for(let A=W;A<=y&&A<c.length;A+=1)if(!a[A]){const M=Math.min(v,S-B);if(c[A]=(c[A]??1)+M,B+=M,B>=S)break}}else(e.onWarn??(v=>{console.warn(v)}))(`[calculateRowHeights] Content of spanning cell exceeds fixed height allocated. Cell: ${JSON.stringify(f.content)}, Required: ${String(u)}, Allocated: ${String(x)} (fixed).`)}}}return c},G=(t,i,e,o)=>{let s=i;for(;s>0&&t[s-1]?.[e]===o;)s-=1;return s},Jt=t=>{if(typeof t=="string")return{content:t};if(typeof t=="number"||typeof t=="bigint"||typeof t=="boolean")return{content:String(t)};if(t==null)return{content:"",isEmpty:!0};if(typeof t=="object"&&"content"in t){let{content:i}=t,e=!1;if(typeof i=="number"||typeof i=="bigint"||typeof i=="boolean")i=String(i);else if(i==null)i="",e=!0;else if(typeof i!="string")throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(t)} (type: ${typeof t})`);return e?{...t,content:i,isEmpty:!0}:{...t,content:i}}throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(t)} (type: ${typeof t})`)},ge=(t,i,e,o,s)=>{const h=k(t),n=" ".repeat(Math.max(0,o)),r=" ".repeat(Math.max(0,s));if(h===0)return n+" ".repeat(Math.max(0,i))+r;const c=Math.max(0,i-h);switch(e){case"center":{const a=Math.floor(c/2),d=c-a;return n+" ".repeat(a)+t+" ".repeat(d)+r}case"right":return n+" ".repeat(c)+t+r;default:return n+t+" ".repeat(c)+r}},Ft=/\r?\n/,Tt=/\s+/;let Ot;const be=()=>(Ot??=fe().columns,Ot),C=(t,i)=>!t||!i?t:typeof i=="function"?i(t):i.open+t+i.close;class at{#t;#e=[];#o;#r=new WeakMap;#n=new WeakMap;#i=new WeakMap;#s(i){const e=this.#i.get(i);if(e)return e;const o=String(i.content??"").split(Ft);let s=0;for(const n of o)s=Math.max(s,k(n));const h={lines:o,maxLineWidth:s};return this.#i.set(i,h),h}#h(i){const e=this.#t.onWarn;if(e){e(i);return}console.warn(i)}static createGridLayout(){return[]}static calculateImplicitRowCount(i,e){let o=0;for(const s of i)o+=(s.colSpan??1)*(s.rowSpan??1);return Math.max(1,Math.ceil(o/e))}constructor(i){const e={autoColumns:1,autoFlow:"row",autoRows:1,balancedWidths:!1,gap:0,paddingLeft:1,paddingRight:1,rows:0,showBorders:i.border!==void 0,truncate:!1,truncateOverflow:!0,wordWrap:!1};let o;Array.isArray(i.fixedRowHeights)?o=i.fixedRowHeights:typeof i.fixedRowHeights=="number"&&(o=[i.fixedRowHeights]),this.#t={...e,...i,columns:i.columns,fixedRowHeights:o,showBorders:i.border!==void 0||(i.showBorders??!1)};const{terminalWidth:s}=this.#t;this.#o=s??be(),this.#t.maxWidth&&(this.#t.maxWidth=Math.min(this.#t.maxWidth,this.#o))}addItem(i){const e=Jt(i);return this.#c(e),this.#e.push(e),this}#c(i){i.width!==void 0&&this.#h("@visulima/tabular: GridItem.width is ignored by Grid (it is only consumed by Table). Use fixedColumnWidths or maxWidth to constrain Grid column widths.")}addItems(i){for(const e of i){const o=Jt(e);this.#c(o),this.#e.push(o)}return this}setColumns(i){return this.#t.columns=i,this}setRows(i){return this.#t.rows=i,this}setBorder(i){return this.#t.border=i,this}setShowBorders(i){return this.#t.showBorders=i,this}setMaxWidth(i){return this.#t.maxWidth=i,this}toString(){const i=at.createGridLayout();if(this.#r=new WeakMap,this.#n=new WeakMap,this.#i=new WeakMap,this.placeItems(i),i.length===0||i[0]?.length===0)return"";let e=this.calculateColumnWidths(i);const o=this.calculateTotalGridWidth(e),s=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth,this.#o):this.#o;return o>s&&(e=this.adjustColumnWidthsForTerminal(e,o)),this.renderGrid(i,e)}placeItems(i){let e=0,o=0;const s=this.#t.rows>0?this.#t.rows:Number.POSITIVE_INFINITY,h=this.#t.rows>0?this.#t.rows:at.calculateImplicitRowCount(this.#e,Math.max(1,this.#t.columns));for(let n=0;n<this.#e.length;n+=1){const r=this.#e[n];if(r.isEmpty&&!(r.rowSpan&&r.rowSpan>1)&&!(r.colSpan&&r.colSpan>1)){this.#t.autoFlow==="row"?(o+=1,o>=this.#t.columns&&(o=0,e+=1)):(e+=1,e>=h&&(e=0,o+=1));continue}const c=r.colSpan??1,a=r.rowSpan??1;let d=!1,l=e,m=o,f=0;const w=((this.#t.autoFlow==="column"?Math.max(i.length,h):i.length)+a+5)*this.#t.columns,p=c<=this.#t.columns;for(;p&&!d&&l<s&&f<w;){for(f+=1;l+a>i.length;)i.push(Array.from({length:this.#t.columns}).fill(void 0));if(this.canPlaceItem(i,l,m,c,a))this.placeItem(i,l,m,r),d=!0,this.#t.autoFlow==="row"?(o=m+c,e=l,o>=this.#t.columns&&(o=0,e+=1)):(e=l+a,o=m,e>=h&&(e=0,o+=1));else if(this.#t.autoFlow==="row")m+=1,m>=this.#t.columns&&(m=0,l+=1);else if(l+=1,l>=h&&(l=0,m+=1,m>=this.#t.columns))break}d||(this.#h(`@visulima/tabular: Could not find position for item: ${JSON.stringify(r)} after ${String(f)} attempts. Grid might be too small or layout impossible.`),this.#t.autoFlow==="row"?(o+=1,o>=this.#t.columns&&(o=0,e+=1)):(e+=1,e>=h&&(e=0,o+=1)))}if(this.#t.rows>0){if(i.length>0)for(;i.length<this.#t.rows;)i.push(Array.from({length:this.#t.columns}).fill(void 0))}else for(;i.length>0&&i.at(-1)?.every(n=>n===void 0);)i.pop()}canPlaceItem(i,e,o,s,h,n=!1){if(o+s>this.#t.columns)return!1;for(let r=e;r<e+h;r+=1)if(r<i.length){if(!i[r])return this.#h(`Grid layout unexpectedly missing row ${String(r)} during canPlaceItem check.`),!1;for(let c=o;c<o+s;c+=1)if(i[r]?.[c]!==void 0)return!1}else if(!n)return!1;return!0}computeWrappedContentWidth(i,e,o,s){let h=i;if(s){if(h>20){let n=0;for(const r of e){const c=r.split(Tt);for(const a of c)n=Math.max(n,Math.min(k(a),o))}h=Math.min(h,Math.max(n+4,12))}}else{let n=0;for(const r of e){const c=r.split(Tt);for(const a of c)n=Math.max(n,Math.min(k(a),o))}h=Math.min(h,Math.max(n+12,20))}return h}placeItem(i,e,o,s){const h=s.rowSpan??1,n=s.colSpan??1;for(let r=e;r<e+h;r+=1){for(;r>=i.length;)i.push(Array.from({length:this.#t.columns}).fill(void 0));for(let c=o;c<o+n;c+=1)c<this.#t.columns&&(i[r]||(this.#h(`Logic error: Row ${String(r)} not found in placeItem despite check.`),i[r]=Array.from({length:this.#t.columns}).fill(void 0)),i[r][c]=s)}}calculateTotalGridWidth(i){let e=0;const o=this.#t.showBorders?this.#t.border:void 0;o&&(e+=o.bodyLeft.width,e+=o.bodyRight.width);const s=i.length,h=this.#t.showBorders?o?.bodyJoin.width??0:0,n=this.#t.gap;for(let r=0;r<s;r+=1)e+=i[r]??0,r<s-1&&(e+=n,e+=h);return e}adjustColumnWidthsForTerminal(i,e){const o=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth??0,this.#o):this.#o;if(e<=o)return i;let s=0;const h=i.length,n=this.#t.showBorders?this.#t.border:void 0;if(n&&(s+=n.bodyLeft.width,s+=n.bodyRight.width),h>1){s+=(h-1)*this.#t.gap;const m=n?.bodyJoin.width??0;s+=(h-1)*m}if(s>=o)return Array.from({length:h}).fill(1);const r=o-s,c=i.reduce((m,f)=>m+f,0);if(c===0){const m=Math.floor(r/h);return Array.from({length:h}).fill(m)}const a=i.map(m=>{const f=m/c;return Math.max(1,Math.floor(r*f))});let d=a.reduce((m,f)=>m+f,0)-r;for(;d>0;){let m=-1;for(let f=0;f<a.length;f+=1)(a[f]??0)>1&&(m===-1||(a[f]??0)>(a[m]??0))&&(m=f);if(m===-1)break;a[m]-=1,d-=1}let l=r-a.reduce((m,f)=>m+f,0);if(l>0){const m=a.map((f,w)=>{const p=c>0?(i[w]??0)/c:1/h;return{index:w,remainder:r*p%1}}).toSorted((f,w)=>w.remainder-f.remainder);for(const f of m){if(l<=0)break;const{index:w}=f;a[w]!==void 0&&(a[w]+=1,l-=1)}}return a}calculateBalancedColumnWidths(i){const e=this.calculateMinimumColumnWidthsWithGrowableInfo(i),o=e.widths,{growableColumns:s}=e,h=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth,this.#o):this.#o,n=this.#t.showBorders?this.#t.border:void 0;let r=0;if(n&&(r+=n.bodyLeft.width,r+=n.bodyRight.width),this.#t.columns>1){r+=(this.#t.columns-1)*this.#t.gap;const d=n?.bodyJoin.width??0;r+=(this.#t.columns-1)*d}const c=Math.max(0,h-r);if(o.reduce((d,l)=>d+l,0)>0){const d=Math.floor(c/this.#t.columns),l=Array.from({length:this.#t.columns}).fill(d),m=d*this.#t.columns;let f=c-m;for(let u=0;u<l.length&&f>0;u+=1)l[u]=(l[u]??0)+1,f-=1;const w=[];let p=0;for(let u=0;u<this.#t.columns;u+=1){const b=l[u]??0,W=o[u]??0,y=Math.max(b,W);w.push(y),p+=y}if(p>c){const u=c/p,b=w.map(x=>Math.max(3,Math.floor(x*u))),W=b.reduce((x,R)=>x+R,0);let y=c-W;for(let x=0;x<b.length&&y>0;x+=1)b[x]=(b[x]??0)+1,y-=1;return b}let g=c-p;if(g>0){const u=s.length>0?s:w.map((b,W)=>W);for(;g>0&&u.length>0;)for(const b of u){if(g<=0)break;w[b]=(w[b]??0)+1,g-=1}}return w}const a=Math.floor(c/this.#t.columns);return Array.from({length:this.#t.columns}).fill(a)}calculateMinimumColumnWidthsWithGrowableInfo(i){const e=Array.from({length:this.#t.columns}).fill(0),o=[],s=this.#t.paddingLeft+this.#t.paddingRight,h=this.#t.gap+(this.#t.showBorders?this.#t.border?.bodyJoin.width??0:0);for(let n=0;n<this.#t.columns;n+=1)for(let r=0;r<i.length;r+=1){const c=i[r]?.[n];if(!c||G(i,r,n,c)!==r||n>0&&i[r]?.[n-1]===c)continue;const a=c.colSpan??1,d=c.maxWidth??Number.POSITIVE_INFINITY,{lines:l,maxLineWidth:m}=this.#s(c),f=this.#t.wordWrap&&c.wordWrap!==!1;let w=Math.min(m,d);w=this.computeWrappedContentWidth(w,l,d,f),a===1&&(e[n]=Math.max(e[n]??0,w+s),f&&!o.includes(n)&&o.push(n))}for(let n=0;n<i.length;n+=1)for(let r=0;r<this.#t.columns;r+=1){const c=i[n]?.[r];if(!c||G(i,n,r,c)!==n||r>0&&i[n]?.[r-1]===c)continue;const a=c.colSpan??1;if(a>1){const d=c.maxWidth??Number.POSITIVE_INFINITY,{lines:l,maxLineWidth:m}=this.#s(c),f=this.#t.wordWrap&&c.wordWrap!==!1;let w=Math.min(m,d);w=this.computeWrappedContentWidth(w,l,d,f);const p=(a-1)*h,g=w+s+p;let u=0;for(let W=r;W<r+a;W+=1)u+=e[W]??0;const b=u+p;if(g>b){const W=g-b,y=Math.floor(W/a);let x=0;for(let R=0;R<a&&r+R<this.#t.columns;R+=1){const S=Math.min(y,W-x);if(e[r+R]=(e[r+R]??0)+S,x+=S,x>=W)break}}}}return{growableColumns:o,widths:e}}calculateColumnWidths(i){if(this.#t.fixedColumnWidths&&this.#t.fixedColumnWidths.length===this.#t.columns){const h=this.#t.fixedColumnWidths;if(!h.some(n=>n===void 0||!Number.isFinite(n)))return[...h];if(this.#t.balancedWidths){const n=Array.from({length:h.length}).fill(0),r=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth,this.#o):this.#o,c=this.calculateTotalGridWidth(Array.from({length:n.length}).fill(0)),a=Math.max(0,r-c);let d=0;const l=[];for(const[w,p]of h.entries())typeof p=="number"&&Number.isFinite(p)?(n[w]=p,d+=p):l.push(w);let m=Math.max(0,a-d);const f=l.length>0?Math.floor(m/l.length):0;for(const w of l)n[w]=f;m-=f*l.length;for(const w of l){if(m<=0)break;n[w]+=1,m-=1}return n}}if(this.#t.balancedWidths)return this.calculateBalancedColumnWidths(i);const e=Array.from({length:this.#t.columns}).fill(0),o=this.#t.paddingLeft+this.#t.paddingRight,s=this.#t.gap+(this.#t.showBorders?this.#t.border?.bodyJoin.width??0:0);for(let h=0;h<this.#t.columns;h+=1)for(let n=0;n<i.length;n+=1){const r=i[n]?.[h];if(!r||G(i,n,h,r)!==n||h>0&&i[n]?.[h-1]===r)continue;const c=r.colSpan??1,a=r.maxWidth??Number.POSITIVE_INFINITY,{maxLineWidth:d}=this.#s(r),l=Math.min(d,a);c===1&&(e[h]=Math.max(e[h]??0,l+o))}for(let h=0;h<i.length;h+=1)for(let n=0;n<this.#t.columns;n+=1){const r=i[h]?.[n];if(!r||G(i,h,n,r)!==h||n>0&&i[h]?.[n-1]===r)continue;const c=r.colSpan??1;if(c>1){const a=r.maxWidth??Number.POSITIVE_INFINITY,{lines:d,maxLineWidth:l}=this.#s(r),m=this.#t.wordWrap&&r.wordWrap!==!1;let f=Math.min(l,a);f=this.computeWrappedContentWidth(f,d,a,m);let w=0;for(let b=n;b<n+c;b+=1)w+=e[b]??0;const p=c>1?(c-1)*s:0,g=f+o+p,u=w+p;if(g>u){const b=g-u,W=Math.floor(b/c);let y=0;for(let x=0;x<c&&n+x<this.#t.columns;x+=1){const R=Math.min(W,b-y);if(e[n+x]=(e[n+x]??0)+R,y+=R,y>=b)break}}}}if(this.#t.fixedColumnWidths&&this.#t.fixedColumnWidths.length===this.#t.columns)for(const[h,n]of this.#t.fixedColumnWidths.entries())typeof n=="number"&&Number.isFinite(n)&&(e[h]=n);if(this.#t.maxWidth){const h=this.calculateTotalGridWidth(e);if(h>this.#t.maxWidth)return this.adjustColumnWidthsForTerminal(e,h)}return e}renderVisualRowContent(i,e,o,s,h){const n=i[e];if(!n)return"";const r=this.#t.borderColor??this.#t.foregroundColor??void 0,c=[],a=this.#t.showBorders&&this.#t.border?we(this.#t.border):void 0,d=a&&a.left.width>0?a.left.char:"",l=a&&a.right.width>0?a.right.char:"",m=a&&a.join.width>0?a.join.char:"",f=" ".repeat(this.#t.gap);d&&c.push(C(C(d,r),this.#t.backgroundColor));let w=0;for(;w<this.#t.columns;){const p=n[w]??void 0;let g=1,u;if(p){const b=p.colSpan??1;g=b;const W=G(i,e,w,p),y=this.#t.showBorders?this.#t.border?.bodyJoin.width??0:0,x=ct(s,w,b,y),R=this.alignCellContent(p,x),S=R.length,v=this.getCachedCellVerticalPosition(i,e,w,p);v.firstRow!==W&&this.#h(`Mismatch between findFirstOccurrenceRow (${String(W)}) and determineCellVerticalPosition (${String(v.firstRow)})`);const B=h.slice(W,v.lastRow+1).reduce((I,j)=>I+j,0),A=v.lastRow-v.firstRow+1;let M=o,L=0;const H=this.#t.showBorders&&(this.#t.border?.joinBody.width??0)>0;for(let I=W;I<e;I+=1)I<h.length&&(M+=h[I]??1),H&&I<v.lastRow&&(L+=1);M+=L;const O=p.vAlign??"top";let E;switch(O){case"bottom":{let I=o;for(let N=W;N<e;N+=1)I+=h[N]??1;const j=B-S;E=I>=j?I-j:-1;break}case"middle":{const I=Math.round((B-S)/2);let j=o;for(let N=W;N<e;N+=1)j+=h[N]??1;E=j>=I&&j<I+S?j-I:-1;break}case"top":{E=M;break}default:E=M}const U=E>=0&&E<S;if(u=" ".repeat(Math.max(0,x)),U){let I=!1;O==="middle"&&A%2===0&&E===0&&(I=!0),I||(u=R[E]??u)}p.colSpan&&p.colSpan>1&&(u+=f.repeat(p.colSpan)),p.foregroundColor?u=C(u,p.foregroundColor):this.#t.foregroundColor&&(u=C(u,this.#t.foregroundColor)),p.backgroundColor?u=C(u,p.backgroundColor):this.#t.backgroundColor&&(u=C(u,this.#t.backgroundColor))}else{const b=this.#t.paddingLeft+this.#t.paddingRight,W=Math.max(0,(s[w]??0)-b),y=" ".repeat(this.#t.paddingLeft+W+this.#t.paddingRight);u=C(C(o===0?y:" ".repeat(y.length),this.#t.foregroundColor),this.#t.backgroundColor)}c.push(u),w+g<this.#t.columns&&(c.push(f),this.#t.showBorders&&m&&c.push(C(C(m,r),this.#t.backgroundColor)),this.#t.gap>0&&c.push(f)),w+=g}return l&&c.push(C(C(l,r),this.#t.backgroundColor)),c.join("")}alignCellContent(i,e){const o=this.#r.get(i);if(o?.has(e))return o.get(e);const{paddingLeft:s,paddingRight:h}=this.#t,n=s+h,r=e-n;if(r<=0){const l=[" ".repeat(n+this.#t.gap)];return o?o.set(e,l):this.#r.set(i,new Map([[e,l]])),l}let c;const a=String(i.content??"");if(c=a.includes(`
7
- `)||a.includes("\r")?a.split(Ft):[a],this.#t.wordWrap&&i.wordWrap!==!1){const l=typeof this.#t.wordWrap=="object"?this.#t.wordWrap:{},m=typeof i.wordWrap=="object"?i.wordWrap:l;c=de(a,{...m,width:r}).split(`
8
- `)}if(this.#t.truncate&&i.truncate!==!1){const l=typeof this.#t.truncate=="object"?this.#t.truncate:{},m=typeof i.truncate=="object"?i.truncate:l;c=c.map(f=>It(f,r,m))}else this.#t.truncateOverflow&&(c=c.map(l=>k(l)>r?It(l,r,{}):l));const d=c.map(l=>ge(l,r,i.hAlign??"left",s,h));return o?o.set(e,d):this.#r.set(i,new Map([[e,d]])),d}renderHorizontalBorder(i,e,o,s,h,n=-1){if(!this.#t.showBorders||!this.#t.border)return"";const r=this.#t.border,c=P(r,h),a=c.body.char,d=c.body.width,l=r.bodyJoin.char;if(h!=="middle"&&d===0)return"";let m=c.left.char,f=c.right.char;if(h==="middle"&&n!==-1){const u=i[o]?.[0]??void 0,b=i[n]?.[0]??void 0;u&&b&&u===b&&(m=l);const W=this.#t.columns-1,y=i[o]?.[W]??void 0,x=i[n]?.[W]??void 0;y&&x&&y===x&&(f=l)}const w=[],p=" ".repeat(this.#t.gap);m&&w.push(C(C(m,this.#t.borderColor),this.#t.backgroundColor));let g;for(let u=0;u<this.#t.columns;u+=1){const b=i[o]?.[u]??void 0,W=h==="middle"&&n!==-1?i[n]?.[u]??void 0:void 0;let y,x=!1;if(b&&(u===0||i[o]?.[u-1]!==b)&&(y=b,x=!0),b&&!x)continue;if(!b){const v=s[u]??0;if(g=d>0?a.repeat(v):" ".repeat(v),w.push(C(C(g,this.#t.borderColor),this.#t.backgroundColor)),u<this.#t.columns-1){const B=this.determineJoinChar(h,i,o,n,u,u+1);w.push(p),B.width>0&&w.push(C(C(B.char,this.#t.borderColor),this.#t.backgroundColor))}continue}const R=y?.colSpan??1;if(h==="middle"&&h==="middle"&&W&&b===W&&y){const v=y.vAlign==="middle",{firstRow:B,lastRow:A}=this.getCachedCellVerticalPosition(i,o,u,y),M=A-B+1,L=M%2===0,H=B+Math.ceil(M/2)-1,O=r.bodyJoin.width,E=ct(s,u,R,O),U=this.alignCellContent(y,E),I=U.length;if(v&&L&&o===H)g=C(U[0]??"",this.#t.borderColor);else{let j=0;for(let $=B;$<=o;$+=1)j+=e[$]??1,$<o&&(j+=1);const N=j;if(N>=0&&N<I)g=C(U[N]??"",this.#t.foregroundColor);else{const $=s.slice(u,u+R).reduce((ti,ii)=>ti+ii,0)+(R-1)*(this.#t.gap+this.#t.border.bodyJoin.width);g=C(" ".repeat($),this.#t.borderColor)}}w.push(C(g,this.#t.backgroundColor))}else{const v=[];for(let B=u;B<u+R;B+=1){const A=s[B]??0,M=d>0?a:" ";if(v.push(M.repeat(A+this.#t.gap)),B<u+R-1){const L=this.determineJoinChar(h,i,o,n,B,B+1);L.width>0&&v.push(L.char)}}g=v.join(""),w.push(C(C(g,this.#t.borderColor),this.#t.backgroundColor))}const S=u+R-1;if(S<this.#t.columns-1){const v=this.determineJoinChar(h,i,o,n,S,S+1);v.width>0&&w.push(C(C(v.char,this.#t.borderColor),this.#t.backgroundColor))}u+=R-1}return f&&w.push(C(C(f,this.#t.borderColor),this.#t.backgroundColor)),w.join("")}determineJoinChar(i,e,o,s,h,n=-1){if(!this.#t.showBorders||!this.#t.border)return{char:" ",width:this.#t.gap};const r=this.#t.border;if(i!=="middle"){const x=P(r,i),R=e[o]?.[h]??void 0,S=n===-1?h+1:n,v=e[o]?.[S]??void 0,B=R!==void 0&&v!==void 0&&R===v?x.body:x.join,{char:A,width:M}=B;return{char:A,width:M>0?M:this.#t.gap}}if(s===-1||n===-1)return{char:" ",width:this.#t.gap};const c=r.bodyJoin,a=e[o]?.[h]??void 0,d=e[s]?.[h]??void 0,l=e[o]?.[n]??void 0,m=e[s]?.[n]??void 0,f=a!==void 0&&d!==void 0&&a===d,w=l!==void 0&&m!==void 0&&l===m,p=a!==void 0&&l!==void 0&&a===l,g=d!==void 0&&m!==void 0&&d===m;let u;const b=P(r,"middle");f&&w?u=p?{char:" ",width:c.width}:c:f?u=r.joinLeft:w?u=r.joinRight:p&&g?u=b.body:p?u=r.topJoin:g?u=r.bottomJoin:u=r.joinJoin;const{char:W,width:y}=u;return{char:W,width:y>0?y:this.#t.gap}}renderGrid(i,e){if(i.length===0)return"";const o=[],s=pe(i,e,this.#t,this.alignCellContent.bind(this),G),h=this.#t.showBorders&&this.#t.border?P(this.#t.border,"top"):void 0;h&&h.body.width>0&&o.push(this.renderHorizontalBorder(i,s,0,e,"top"));for(let r=0;r<i.length;r+=1){const c=s[r]??1;for(let d=0;d<c;d+=1)o.push(this.renderVisualRowContent(i,r,d,e,s));const a=this.#t.showBorders&&this.#t.border?P(this.#t.border,"middle"):void 0;if(r<i.length-1&&a&&a.body.width>0){const d=i[r],l=i[r+1];let m=!1;if(d&&l)for(let f=0;f<this.#t.columns;f+=1){const w=d[f],p=l[f];if(w!==p){m=!0;break}}m&&o.push(this.renderHorizontalBorder(i,s,r,e,"middle",r+1))}}const n=this.#t.showBorders&&this.#t.border?P(this.#t.border,"bottom"):void 0;return n&&n.body.width>0&&o.push(this.renderHorizontalBorder(i,s,i.length-1,e,"bottom")),o.join(`
9
- `)}getCachedCellVerticalPosition(i,e,o,s){const h=this.#n.get(s);if(h)return h;const n=mt(i,e,o,s);return this.#n.set(s,n),n}}const ye={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}},Ce={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}},Se={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}},Ae={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}},Ie={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}},Me={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}},ke={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}},je={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}},Ee={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}},Ne={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}},xe=t=>t.reduce((i,e)=>{if(e===null)return i+1;if(typeof e=="object"&&!Array.isArray(e)){const o=typeof e.colSpan=="number"?e.colSpan:1;return i+(o<=0?1:o)}return i+1},0),We=/[\u0000-\u001F\u007F-\u009F]/gu,Be=t=>t.replaceAll(We,"");class ve{#t;#e=[];#o=[];#r=[];#n=!0;#i=void 0;#s(i){const e=this.#t.onWarn;if(e){e(i);return}console.warn(i)}constructor(i={}){this.#t={...i,showFooter:i.showFooter??!0,showHeader:i.showHeader??!0,style:{border:ye,paddingLeft:1,paddingRight:1,...i.style}}}setHeaders(i){return i.length>0&&!Array.isArray(i[0])?this.#o=[i]:this.#o=i.map(e=>Array.isArray(e)?e:[e]),this.#n=!0,this.#i=void 0,this}setFooter(i){return i.length>0&&!Array.isArray(i[0])?this.#r=[i]:this.#r=i.map(e=>Array.isArray(e)?e:[e]),this.#n=!0,this.#i=void 0,this}addRow(i){if(!Array.isArray(i))throw new TypeError("Row must be an array");return this.#e.push(i),this.#n=!0,this.#i=void 0,this}addRows(...i){for(const e of i)this.addRow(e);return this.#n=!0,this.#i=void 0,this}getRows(){return this.#e.map(i=>[...i])}get rowCount(){return this.#e.length}removeRow(i){if(!Number.isInteger(i)||i<0||i>=this.#e.length)throw new RangeError(`Row index ${String(i)} is out of bounds (0..${String(this.#e.length-1)})`);return this.#e.splice(i,1),this.#n=!0,this.#i=void 0,this}clear(){return this.#e.length=0,this.#n=!0,this.#i=void 0,this}toString(){if(!this.#n&&this.#i!==void 0)return this.#i;const i=this.#t.showHeader?this.#o:[],e=this.#t.showFooter?this.#r:[],o=[...i,...this.#e,...e];if(o.length===0)return this.#i="",this.#n=!1,"";let s=0;for(const f of o){const w=f;Array.isArray(w)?s=Math.max(s,xe(w)):this.#s(`Unexpected non-array element found while calculating columns: ${JSON.stringify(w)}`)}if(s===0)return this.#i="",this.#n=!1,"";let h;Array.isArray(this.#t.columnWidths)?h=this.#t.columnWidths.length>=s?this.#t.columnWidths.slice(0,s):[...this.#t.columnWidths,...Array.from({length:s-this.#t.columnWidths.length}).fill(void 0)]:typeof this.#t.columnWidths=="number"&&(h=Array.from({length:s}).fill(this.#t.columnWidths));let n;const r=o.length;if(Array.isArray(this.#t.rowHeights)?n=this.#t.rowHeights:typeof this.#t.rowHeights=="number"&&(n=Array.from({length:r}).fill(this.#t.rowHeights)),h||o.some(f=>Array.isArray(f)&&f.some(w=>typeof w=="object"&&w!==null&&!Array.isArray(w)&&w.width!==void 0))&&(h=Array.from({length:s}).fill(void 0)),h&&Array.isArray(h)){const f=[...h];for(const w of o){const p=w;let g=0;for(const u of p){let b={};if(typeof u=="object"&&u!==null&&!Array.isArray(u)){const{content:W,href:y,...x}=u;b=x}b.width!==void 0?f[g]=b.width:b.maxWidth!==void 0&&f[g]!==void 0&&(f[g]=Math.min(f[g],b.maxWidth)),g+=b.colSpan??1}}h=f}const c={autoFlow:"row",backgroundColor:this.#t.style?.backgroundColor,balancedWidths:this.#t.balancedWidths??!1,border:this.#t.style?.border,borderColor:this.#t.style?.borderColor,columns:s,fixedColumnWidths:h,fixedRowHeights:n,foregroundColor:this.#t.style?.foregroundColor,gap:this.#t.gap??0,maxWidth:this.#t.maxWidth,onWarn:this.#t.onWarn,paddingLeft:this.#t.style?.paddingLeft,paddingRight:this.#t.style?.paddingRight,terminalWidth:this.#t.terminalWidth,truncate:this.#t.truncate??(h?.every(f=>typeof f=="number")||this.#t.maxWidth!==void 0&&!this.#t.balancedWidths),truncateOverflow:this.#t.truncateOverflow??!0,wordWrap:this.#t.wordWrap??!1},a=new at(c),d=[];if(this.#t.columnDefaults)for(const[f,w]of this.#t.columnDefaults.entries())w&&(d[f]={...w});if(this.#t.colAligns)for(const[f,w]of this.#t.colAligns.entries())w!==void 0&&(d[f]={...d[f],hAlign:d[f]?.hAlign??w});const l=d.length>0,m=[];for(const[f,w]of o.entries()){const p=w;if(!Array.isArray(p)){this.#s(`Skipping non-array row while creating GridItems: ${JSON.stringify(p)}`);continue}const g=this.#t.showHeader?this.#o.length:0,u=this.#e.length,b=this.#t.showHeader&&f<g,W=this.#t.showFooter&&f>=g+u,y=b&&p.length===1&&s>1,x=W&&p.length===1&&s>1;let R=0;for(const S of p){let v=S,B={};if(typeof v=="object"&&v!==null&&!Array.isArray(v)){const{content:H,href:O,...E}=v;v=O?`\x1B]8;;${Be(O)}\x1B\\${String(H)}\x1B]8;;\x1B\\`:H,B=E}const A=l?d[R]:void 0;A&&(B={...B,hAlign:B.hAlign??A.hAlign,maxWidth:B.maxWidth??A.maxWidth,truncate:B.truncate??A.truncate,vAlign:B.vAlign??A.vAlign,wordWrap:B.wordWrap??A.wordWrap}),R+=B.colSpan??1,y&&(B.colSpan=s),x&&(B.colSpan=s);const M=this.#t.transformTabToSpace&&typeof v=="string"?v.replaceAll(" "," ".repeat(this.#t.transformTabToSpace)):v,{maxWidth:L}=B;m.push({backgroundColor:B.backgroundColor,colSpan:B.colSpan,content:M,foregroundColor:B.foregroundColor,hAlign:B.hAlign,maxWidth:L,rowSpan:B.rowSpan,truncate:B.truncate??(L===void 0?void 0:!0),vAlign:B.vAlign,wordWrap:B.wordWrap})}}return a.addItems(m),this.#i=a.toString(),this.#n=!1,this.#i}}const Le=t=>new ve(t);export{Le as N,Ne as R,je as a,Me as c,Ie as d,Ce as h,Ae as i,ve as k,Se as o,ke as r,ye as t,Ee as w};
@@ -1 +0,0 @@
1
- import{createRequire as D}from"node:module";import{L as q}from"./target-merge-B4No-LHM.js";import{advisoriesQuery as C,advisoriesIngest as M,advisoriesStatus as S,NATIVE_BINDING_VERSION as w}from"#native";let I;const R=e=>(I??=D(import.meta.url))(e),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=e=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[t,s]=u.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return u.getBuiltinModule(e)}return R(e)},{randomUUID:T}=l("node:crypto"),{existsSync:O,createWriteStream:L}=l("node:fs"),{mkdir:$,unlink:U,stat:x}=l("node:fs/promises"),{join:g,dirname:P}=l("node:path"),{Readable:k}=l("node:stream"),{pipeline:B}=l("node:stream/promises"),p=6;if(w!==p)throw new Error(`vis native binding ABI mismatch in advisories: expected ${p}, got ${w}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const X="https://osv-vulnerabilities.storage.googleapis.com",W=new Set(["osv-vulnerabilities.storage.googleapis.com"]);class j extends Error{cause="DB_NOT_FOUND";constructor(t){super(`No local advisory DB at ${t}. Run 'vis advisories sync' first.`),this.name="AdvisoryDbNotFoundError"}}class y extends Error{cause="SOURCE_NOT_ALLOWED";constructor(t){super(`Advisory source host '${t}' is not in the built-in allowlist. Add it to \`security.audit.advisories.allowedHosts\` if intentional.`),this.name="AdvisorySourceNotAllowedError"}}class _ extends Error{cause="SYNC_NETWORK";constructor(t,s){super(`Advisory sync failed for ${t}: ${s}. Check connectivity, proxy env vars, or --source.`),this.name="AdvisorySyncNetworkError"}}const v=e=>{const s=q("vis",{create:!0,cwd:e})??g(e,"node_modules",".cache","vis");return g(s,"advisories","db.sqlite")},V=(e,t)=>{let s;try{s=new URL(e)}catch{throw new y(e)}if(s.protocol!=="https:")throw new y(`${s.protocol}//${s.host}`);if(!new Set([...W,...t??[]]).has(s.host))throw new y(s.host);return s},J=async e=>{const t=e.dbPath??v(e.workspaceRoot);await $(P(t),{recursive:!0});const s=V(e.source,e.allowedHosts),n=new URL(`${e.ecosystem}/all.zip`,G(s.toString())),a=await H(t,e.ecosystem);let o=null;if(!e.force){const i=await E(n,{method:"HEAD"});if(i.ok&&(o=i.headers.get("etag"),o&&a&&o===a))return{advisoriesIngested:0,dbPath:t,durationMs:0,upToDate:!0}}const c=`${t}.${e.ecosystem}.${process.pid}.${T()}.zip.tmp`,r=await E(n,{method:"GET"});if(!r.ok||!r.body)throw new _(n.toString(),r.status);o||(o=r.headers.get("etag"));const m=r.headers.get("content-length"),d=m?Number.parseInt(m,10):null;let h=0;const b=L(c),f=k.fromWeb(r.body);e.onProgress&&d&&f.on("data",i=>{h+=i.byteLength,e.onProgress?.(h,d,"download")}),await B(f,b);try{const i=await M({dbPath:t,ecosystem:e.ecosystem,manifestEtag:o??void 0,zipPath:c},(A,N)=>e.onProgress?.(A,N,"ingest"));return{advisoriesIngested:i.advisoriesIngested,dbPath:t,durationMs:i.durationMs,upToDate:!1}}finally{await U(c).catch(()=>{})}},Z=(e,t)=>{if(e.length===0)return new Map;const s=t.dbPath??v(t.workspaceRoot),n=t.ecosystem??"npm";if(!O(s))throw new j(s);const a=e.map(r=>({ecosystem:n,name:r.name,version:r.version})),o=C(s,a),c=new Map;for(const[r,m]of e.entries()){const d=o[r];!d||d.vulnerabilities.length===0||c.set(m.name,d.vulnerabilities.map(h=>z(h)))}return c},ee=async(e,t)=>{const s=t??v(e);return S(s)},H=async(e,t)=>{try{await x(e)}catch{return null}return S(e).ecosystems.find(a=>a.name===t)?.manifestEtag??null},z=e=>({aliases:e.aliases.length>0?e.aliases:void 0,cvssScore:e.cvssScore??void 0,fixedVersions:e.fixedVersions,id:e.id,severity:F(e.severity),summary:e.summary}),F=e=>{const t=e.toUpperCase();return t==="CRITICAL"||t==="HIGH"||t==="MODERATE"||t==="LOW"?t:"UNKNOWN"},G=e=>e.endsWith("/")?e:`${e}/`,E=async(e,t)=>{try{return await fetch(e,t)}catch(s){throw new _(e.toString(),s instanceof Error?s.message:String(s))}};export{j as A,X as D,ee as g,Z as q,v as r,J as s};
@@ -1 +0,0 @@
1
- import{createRequire as C}from"node:module";import{getAffectedProjects as S}from"@visulima/task-runner";import{i as W}from"./index-BjdW45xX.js";import{V as j}from"./vis-user-error-qqqhLoF6.js";import{r as A}from"./affected-shas-Dd0P7fGD.js";let T;const $=e=>(T??=C(import.meta.url))(e),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=e=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[t,s]=f.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return f.getBuiltinModule(e)}return $(e)},{spawnSync:I}=R("node:child_process"),v=new Set(["deep","direct","none"]),B=e=>{const t=[],s=e.split("\0");for(let n=0;n<s.length;n++){const o=s[n];if(!o||o.length<4)continue;const p=o.slice(0,2),d=o.slice(3);if(d&&t.push(d),p.includes("R")||p.includes("C")){n+=1;const c=s[n];c&&t.push(c)}}return t},P=e=>{const t=I("git",["status","--porcelain","-z"],{cwd:e,encoding:"utf8"});return t.error||t.status!==0||typeof t.stdout!="string"?[]:B(t.stdout)},D=async(e,t,s={})=>{const n=e.downstream??"deep",o=e.upstream??"none";if(!v.has(n))throw new j(`Invalid --downstream value: "${n}". Must be "none", "direct", or "deep".`);if(!v.has(o))throw new j(`Invalid --upstream value: "${o}". Must be "none", "direct", or "deep".`);const{projectGraph:p,projects:d,workspaceRoot:c}=t,u=[];let{base:m}=e,{head:r}=e;if(!m||!r){const l=A({defaultBase:s.defaultBase,workspaceRoot:c});m=m||l.base,r=r||l.head,u.push(`Resolved affected refs from ${l.provider} (${l.notes.join("; ")})`)}const k=s.runningInCi??W,h=r==="HEAD"||r==="",b=e.uncommitted??(!k&&h);let a=[];if(b)if(h){const g=(s.readWorkingTreeChanges??P)(c),y=Object.values(d).map(i=>i.root?.replace(/\/$/,"")).filter(i=>!!i&&i!==".");a=g.filter(i=>y.some(_=>i===_||i.startsWith(`${_}/`)));const w=g.length-a.length;a.length>0&&u.push(`including ${a.length} uncommitted working-tree file(s)`),w>0&&u.push(`ignoring ${w} uncommitted path(s) outside any project (untracked scratch would otherwise mark every project affected)`)}else u.push(`ignoring --uncommitted: --head=${r} pins the comparison to a commit, not the working tree`);return{...await S({additionalChangedFiles:a,base:m,downstream:n,head:r,projectGraph:p,projects:d,upstream:o,workspaceRoot:c}),notes:u,uncommittedFileCount:a.length}};export{D as s};
@@ -1,4 +0,0 @@
1
- import{createRequire as ie}from"node:module";import{e as I,z as ue}from"./index-DHD8wb6Z.js";import{r as fe}from"./docker-Dy-X_BuM.js";import{p as oe}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";import{e as me}from"./license-DvlYdo6T.js";import{S as he}from"./lockfile-DhHAaHN5.js";import{a as _e}from"./index-B4AjSxHU.js";let ae;const pe=e=>(ae??=ie(import.meta.url))(e),J=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,se=e=>{if(typeof J<"u"&&J.versions&&J.versions.node){const[t,n]=J.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return J.getBuiltinModule(e)}return pe(e)},{randomUUID:le}=se("node:crypto"),{readdirSync:de}=se("node:fs"),H=e=>e.replaceAll(/[^\w.~-]/g,t=>`%${(t.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),j=(e,t)=>{const n=e.toLowerCase();if(n.startsWith("@")){const s=n.indexOf("/");if(s>0){const c=n.slice(0,s),p=n.slice(s+1);return`pkg:npm/${H(c)}/${H(p)}@${H(t)}`}}return`pkg:npm/${H(n)}@${H(t)}`},d={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},ge=[d.STRING,d.NUMBER,d.BOOLEAN],ye='<?xml version="1.0" encoding="UTF-8"?>',ee=["_selfCloseTag","_attrs"],Oe=(e="",t=0)=>e.repeat(t),W=e=>Array.isArray(e)&&d.ARRAY||typeof e===d.OBJECT&&e!==null&&e._name&&d.JSTOXML_OBJECT||e instanceof Date&&d.DATE||e===null&&d.NULL||typeof e,re=e=>e.startsWith("<![CDATA["),ce=(e="",t={},n)=>{let s=e;if(typeof e===d.STRING){if(re(e))return e;const c=new RegExp(`(${Object.keys(t).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(c,(p,m)=>t[m]||"")}return typeof n=="function"?n(s):s},Se=(e={},t,n,s)=>(Array.isArray(e)?e:Object.entries(e).map(([p,m])=>({[p]:m}))).reduce((p,m)=>{const _=Object.keys(m)[0],O=m[_];if(typeof n===d.FUNCTION&&n(_,O))return p;const S=t?ce(O,t):O,v=!s&&S===!0?"":`="${S}"`;return p.push(`${_}${v}`),p},[]),Ce=(e={},t,n,s)=>{const c=Se(e,t,n,s);return c.length===0?"":` ${c.join(" ")}`},Ae=(e={})=>Object.keys(e).map(t=>({_name:t,_content:e[t]})),ve=e=>ge.includes(W(e)),Te=e=>!e.match("<"),Re=({header:e,isOutputStart:t})=>e&&t?typeof e===d.BOOLEAN?ye:e:"",te={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;"},B=(e={},t={})=>{const{depth:n=0,indent:s,_isFirstItem:c,_isOutputStart:p=!0,header:m,attributeReplacements:_={},attributeFilter:O,attributeExplicitTrue:S=!1,contentReplacements:v={},contentMap:x,selfCloseTags:L=!0}=t,Y=typeof _=="boolean"&&!_?{}:{...te,..._},k=typeof v=="boolean"&&!v?{}:{...te,...v},U=typeof s=="string",D=Oe(s,n),G=W(e),w=Re({header:m,isOutputStart:p}),b=p&&!w&&c&&n===0,X=U&&!b?`
2
- `:"";let C="";switch(G){case d.JSTOXML_OBJECT:{const{_name:h,_content:g}=e;if(g===null&&typeof x!="function"){C=`${X}${D}${h}`;break}if(Array.isArray(g)&&g.every(ve))return g.map(F=>B({_name:h,_content:F},{...t,depth:n,_isOutputStart:!1})).join("");if(ee.includes(h))break;const y=B(g,{...t,depth:n+1,_isOutputStart:b}),M=W(y),R=Te(y),r=re(y),o=`${X}${D}`;if(h==="_comment"){C+=`${o}<!-- ${g} -->`;break}const i=M==="undefined"||y==="",a=L,l=e._selfCloseTag,f=typeof l===d.BOOLEAN?i&&l:i&&a,E=f?"/":"",$=Ce(e._attrs,Y,O,S),T=`<${h}${$}${E}>`,A=U&&!R&&!r?`
3
- ${D}`:"",N=f?"":`${y}${A}</${h}>`;C+=`${o}${T}${N}`;break}case d.OBJECT:{const h=Object.keys(e);C=h.map((u,y)=>{const M={...t,_isFirstItem:y===0,_isLastItem:y+1===h.length,_isOutputStart:b},R={_name:u};if(W(e[u])===d.OBJECT&&(ee.forEach(i=>{const a=e[u][i];typeof a<"u"&&(R[i]=a,delete e[u][i])}),typeof e[u]._content<"u"&&Object.keys(e[u]).length>1)){const i=Object.assign({},e[u]);delete i._content,R._content=[...Ae(i),e[u]._content]}return typeof R._content>"u"&&(R._content=e[u]),B(R,M)},t).join("");break}case d.FUNCTION:{const h=e(t);C=B(h,t);break}case d.ARRAY:{C=e.map((g,u)=>{const y={...t,_isFirstItem:u===0,_isLastItem:u+1===e.length,_isOutputStart:b};return B(g,y)}).join("");break}default:{C=ce(e,k,x);break}}return`${w}${C}`},Q=e=>{try{return oe(e)}catch{return}},Ee=e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const t=e.indexOf("/");return t>1&&!e.includes("/",t+1)}return!e.includes("/")},$e=e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),be=(e,t,n)=>{const c=`${t.replaceAll("/","+")}@${n}`,p=I(e,"node_modules",".pnpm"),m=Q(I(p,c,"node_modules",t,"package.json"));if(m)return m;let _;try{_=de(p)}catch{return}const O=`${c}_`;for(const S of _){if(!S.startsWith(O))continue;const v=Q(I(p,S,"node_modules",t,"package.json"));if(v)return v}},Ne=(e,t,n)=>{const s=Q(I(e,"node_modules",t,"package.json"));return s?.version===n?s:void 0},xe=(e,t,n)=>{if(!(!Ee(t)||!$e(n)))return be(e,t,n)??Ne(e,t,n)},ke={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},De={sha256:64,sha384:96,sha512:128},we=e=>{const t={name:e.name,version:e.version},{integrity:n}=e;return n&&n.hex.length===De[n.algorithm]&&(t.hash={alg:ke[n.algorithm],content:n.hex}),e.dependencies&&(t.dependencies=e.dependencies),e.peerDependencies&&(t.peerDependencies=e.peerDependencies),e.optionalDependencies&&(t.optionalDependencies=e.optionalDependencies),t},je=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Ie=e=>{for(const{file:t,type:n}of je){let s;try{s=ue(I(e,t))}catch{continue}const c=new Map;for(const p of he(s,n))c.set(`${p.name}@${p.version}`,we(p));return{packages:c,type:n}}},Le=e=>{const t=e.indexOf(":");return t<=0?e:e.slice(0,t)==="npm"?e.slice(t+1):e},z=(e,t,n)=>{const s=n.get(e);if(!s||s.size===0)return;if(s.has(t))return t;const c=Le(t);if(c!==t&&s.has(c))return c;const p=[...s],m=_e.maxSatisfying(p,c,{includePrerelease:!0});return m||p[0]},Me="1.7",Pe="CycloneDX",Be="http://cyclonedx.org/schema/bom-1.7.schema.json",Ve="@visulima/vis",ne=e=>{try{return oe(e)}catch{return}},Ue=e=>{if(e){if(typeof e=="string")return e;if(typeof e=="object"&&e.name)return e.email?`${e.name} <${e.email}>`:e.name}},Xe=e=>{if(e)return typeof e=="string"?e:e.url},Fe=e=>{if(e)return typeof e=="string"?e:e.url},Je=e=>{const t=[];e.homepage&&t.push({type:"website",url:e.homepage});const n=Xe(e.repository);n&&t.push({type:"vcs",url:n});const s=Fe(e.bugs);return s&&t.push({type:"issue-tracker",url:s}),t.length>0?t:void 0},He=e=>e==="application"||e==="service"||e==="tool"?"application":"library",K=(e,t)=>{if(!t)return;t.description&&(e.description=t.description);const n=Ue(t.author);n&&(e.author=n);const s=me(t);s&&(e.licenses=s);const c=Je(t);c&&(e.externalReferences=c)},nt=e=>{const{focus:t,generatorVersion:n,includeDev:s=!1,now:c=new Date,projectGraph:p,serialNumber:m,workspace:_,workspaceRoot:O}=e,S=t&&t.length>0?[...fe(t,p)].sort():Object.keys(_.projects).sort(),v=new Set(S),x=new Map;for(const r of S){const o=_.projects[r];o&&x.set(r,ne(I(O,o.root,"package.json")))}const L=[],q=new Map;for(const r of S){const o=_.projects[r];if(!o)continue;const i=x.get(r),a=i?.version??"0.0.0",l=j(r,a);q.set(r,l);const f={"bom-ref":l,name:r,purl:l,type:He(o.projectType),version:a};K(f,i),L.push(f)}const Y=Ie(O),V=new Map,k=new Map;if(Y)for(const r of Y.packages.values()){V.set(`${r.name}@${r.version}`,r);let o=k.get(r.name);o||(o=new Set,k.set(r.name,o)),o.add(r.version)}const U=[],D=[],G=new Map;for(const r of S){const o=x.get(r);if(!o)continue;const i=[o.dependencies,o.peerDependencies];s&&i.push(o.devDependencies);const a=new Set,l=(f,E)=>{if(E)for(const[$,T]of Object.entries(E)){if(v.has($)){const N=q.get($);N&&a.add(N);continue}const A=z($,T,k);A&&(a.add(j($,A)),f.push(`${$}@${A}`))}};for(const f of i)l(U,f);l(D,o.optionalDependencies),G.set(r,a)}const w=new Map,b=new Map,X=(r,o)=>{const i=[...r];for(;i.length>0;){const a=i.pop(),l=w.get(a);if(l==="required"||l==="optional"&&o==="optional")continue;w.set(a,o);const f=V.get(a);if(!f)continue;const E=b.get(a)??new Set,$=[f.dependencies,f.peerDependencies];for(const T of $)if(T)for(const[A,N]of Object.entries(T))for(const P of N){const F=z(A,P,k);F&&(E.add(j(A,F)),i.push(`${A}@${F}`))}if(f.optionalDependencies)for(const[T,A]of Object.entries(f.optionalDependencies))for(const N of A){const P=z(T,N,k);P&&(E.add(j(T,P)),D.push(`${T}@${P}`))}E.size>0&&b.set(a,E)}};X(U,"required"),X(D,"optional");const C=[],h=[...w.keys()].sort();for(const r of h){const o=V.get(r);if(!o)continue;const i=j(o.name,o.version),a={"bom-ref":i,name:o.name,purl:i,scope:w.get(r)??"required",type:"library",version:o.version};o.hash&&(a.hashes=[o.hash]),K(a,xe(O,o.name,o.version)),C.push(a)}const g=[];for(const[r,o]of G){const i=q.get(r);if(!i)continue;const a=[...o].sort();g.push(a.length>0?{dependsOn:a,ref:i}:{ref:i})}for(const r of h){const o=V.get(r);if(!o)continue;const i=j(o.name,o.version),a=b.get(r),l=a?[...a].sort():[];g.push(l.length>0?{dependsOn:l,ref:i}:{ref:i})}g.sort((r,o)=>r.ref.localeCompare(o.ref));const u=ne(I(O,"package.json")),y=(()=>{if(t?.length===1){const l=L.find(f=>f.name===t[0]);if(l)return{"bom-ref":l["bom-ref"],name:l.name,purl:l.purl,type:l.type,version:l.version}}const r=u?.name??"workspace",o=u?.version??"0.0.0",i=j(r,o),a={"bom-ref":i,name:r,purl:i,type:"application",version:o};return K(a,u),a})(),M=y["bom-ref"],R=M?L.filter(r=>r["bom-ref"]!==M):L;return{$schema:Be,bomFormat:Pe,components:[...R,...C],dependencies:g,metadata:{component:y,lifecycles:[{phase:"build"}],timestamp:c.toISOString(),tools:{components:[{name:Ve,type:"application",...n?{version:n}:{}}]}},serialNumber:m??`urn:uuid:${le()}`,specVersion:Me,version:1}},st=e=>{const t={version:e.version??1,xmlns:"http://cyclonedx.org/schema/bom/1.7"};e.serialNumber&&(t.serialNumber=e.serialNumber);const n=[];return e.metadata&&n.push(qe(e.metadata)),e.components&&e.components.length>0&&n.push({_content:e.components.map(c=>Z(c)),_name:"components"}),e.dependencies&&e.dependencies.length>0&&n.push({_content:e.dependencies.map(c=>Ge(c)),_name:"dependencies"}),`${B({_attrs:t,_content:n,_name:"bom"},{header:!0,indent:" ",selfCloseTags:!0})}
4
- `},qe=e=>{const t=[];return e.timestamp&&t.push({timestamp:e.timestamp}),e.lifecycles&&e.lifecycles.length>0&&t.push({_content:e.lifecycles.map(n=>{const s=[];return n.phase&&s.push({phase:n.phase}),n.name&&s.push({name:n.name}),n.description&&s.push({description:n.description}),{_content:s,_name:"lifecycle"}}),_name:"lifecycles"}),e.tools?.components&&t.push({_content:[{_content:e.tools.components.map(n=>Z(n)),_name:"components"}],_name:"tools"}),e.component&&t.push(Z(e.component)),{_content:t,_name:"metadata"}},Z=e=>{const t={type:e.type};e["bom-ref"]&&(t["bom-ref"]=e["bom-ref"]);const n=[];e.group&&n.push({group:e.group}),n.push({name:e.name}),e.version&&n.push({version:e.version}),e.description&&n.push({description:e.description}),e.author&&n.push({author:e.author}),e.hashes&&e.hashes.length>0&&n.push({_content:e.hashes.map(c=>({_attrs:{alg:c.alg},_content:c.content,_name:"hash"})),_name:"hashes"});const s=Ye(e.licenses);return s&&n.push(s),e.purl&&n.push({purl:e.purl}),e.scope&&n.push({scope:e.scope}),e.externalReferences&&e.externalReferences.length>0&&n.push({_content:e.externalReferences.map(c=>({_attrs:{type:c.type},_content:[{url:c.url}],_name:"reference"})),_name:"externalReferences"}),{_attrs:t,_content:n,_name:"component"}},Ye=e=>{if(!e||e.length===0)return;const t=[];for(const n of e){if("expression"in n){t.push({expression:n.expression});continue}const s=[];"id"in n.license&&n.license.id?s.push({id:n.license.id}):"name"in n.license&&n.license.name&&s.push({name:n.license.name}),t.push({_content:s,_name:"license"})}return{_content:t,_name:"licenses"}},Ge=e=>e.dependsOn&&e.dependsOn.length>0?{_attrs:{ref:e.ref},_content:e.dependsOn.map(t=>({_attrs:{ref:t},_name:"dependency"})),_name:"dependency"}:{_attrs:{ref:e.ref},_name:"dependency"};export{nt as b,st as s,j as t};
@@ -1 +0,0 @@
1
- import{createRequire as ae}from"node:module";let le;const ce=t=>(le??=ae(import.meta.url))(t),dt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,pe=t=>{if(typeof dt<"u"&&dt.versions&&dt.versions.node){const[e,n]=dt.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return dt.getBuiltinModule(t)}return ce(t)},{createRequire:he}=pe("node:module");function fe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Lt={},xt,Pt;function vt(){if(Pt)return xt;Pt=1;const t="\\\\/",e=`[^${t}]`,n=0,l=Symbol("unignore"),c="\\.",u="\\+",r="\\?",p="\\/",y="(?=.)",$="[^/]",v=`(?:${p}|$)`,x=`(?:^|${p})`,T=`${c}{1,2}${v}`,E=`(?!${c})`,O=`(?!${x}${T})`,L=`(?!${c}{0,1}${v})`,m=`(?!${T})`,j=`[^.${p}]`,C=`${$}*?`,g={DOT_LITERAL:c,PLUS_LITERAL:u,QMARK_LITERAL:r,SLASH_LITERAL:p,ONE_CHAR:y,QMARK:$,END_ANCHOR:v,DOTS_SLASH:T,NO_DOT:E,NO_DOTS:O,NO_DOT_SLASH:L,NO_DOTS_SLASH:m,QMARK_NO_DOT:j,STAR:C,START_ANCHOR:x,SEP:"/"},d={...g,SLASH_LITERAL:`[${t}]`,QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${c}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${c})`,NO_DOTS:`(?!(?:^|[${t}])${c}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${c}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${c}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"},s={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return xt={DEFAULT_MAX_EXTGLOB_RECURSION:n,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:s,UNIGNORE:l,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(b){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${b.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(b){return b===!0?d:g}},xt}var It;function St(){return It||(It=1,(function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:l,REGEX_SPECIAL_CHARS_GLOBAL:c}=vt();t.isObject=u=>u!==null&&typeof u=="object"&&!Array.isArray(u),t.hasRegexChars=u=>l.test(u),t.isRegexChar=u=>u.length===1&&t.hasRegexChars(u),t.escapeRegex=u=>u.replace(c,"\\$1"),t.toPosixSlashes=u=>u.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const u=navigator.platform.toLowerCase();return u==="win32"||u==="windows"}return process.platform?process.platform==="win32":!1},t.removeBackslashes=u=>u.replace(n,r=>r==="\\"?"":r),t.escapeLast=(u,r,p)=>{const y=u.lastIndexOf(r,p);return y===-1?u:u[y-1]==="\\"?t.escapeLast(u,r,y-1):`${u.slice(0,y)}\\${u.slice(y)}`},t.removePrefix=(u,r={})=>{let p=u;return p.startsWith("./")&&(p=p.slice(2),r.prefix="./"),p},t.wrapOutput=(u,r={},p={})=>{const y=p.contains?"":"^",$=p.contains?"":"$";let v=`${y}(?:${u})${$}`;return r.negated===!0&&(v=`(?:^(?!${v}).*$)`),v},t.basename=(u,{windows:r}={})=>{const p=u.split(r?/[\\/]/:"/"),y=p[p.length-1];return y===""?p[p.length-2]:y}})(Lt)),Lt}var mt,Nt;function ge(){if(Nt)return mt;Nt=1;const t=St(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:l,CHAR_COMMA:c,CHAR_DOT:u,CHAR_EXCLAMATION_MARK:r,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:y,CHAR_LEFT_PARENTHESES:$,CHAR_LEFT_SQUARE_BRACKET:v,CHAR_PLUS:x,CHAR_QUESTION_MARK:T,CHAR_RIGHT_CURLY_BRACE:E,CHAR_RIGHT_PARENTHESES:O,CHAR_RIGHT_SQUARE_BRACKET:L}=vt(),m=C=>C===p||C===l,j=C=>{C.isPrefix!==!0&&(C.depth=C.isGlobstar?1/0:1)};return mt=(C,g)=>{const d=g||{},s=C.length-1,b=d.parts===!0||d.scanToEnd===!0,w=[],R=[],_=[];let A=C,I=-1,M=0,V=0,at=!1,J=!1,K=!1,tt=!1,lt=!1,rt=!1,et=!1,U=!1,st=!1,Q=!1,ct=0,z,S,N={value:"",depth:0,isGlob:!1};const W=()=>I>=s,a=()=>A.charCodeAt(I+1),F=()=>(z=S,A.charCodeAt(++I));for(;I<s;){S=F();let Z;if(S===l){et=N.backslashes=!0,S=F(),S===y&&(rt=!0);continue}if(rt===!0||S===y){for(ct++;W()!==!0&&(S=F());){if(S===l){et=N.backslashes=!0,F();continue}if(S===y){ct++;continue}if(rt!==!0&&S===u&&(S=F())===u){if(at=N.isBrace=!0,K=N.isGlob=!0,Q=!0,b===!0)continue;break}if(rt!==!0&&S===c){if(at=N.isBrace=!0,K=N.isGlob=!0,Q=!0,b===!0)continue;break}if(S===E&&(ct--,ct===0)){rt=!1,at=N.isBrace=!0,Q=!0;break}}if(b===!0)continue;break}if(S===p){if(w.push(I),R.push(N),N={value:"",depth:0,isGlob:!1},Q===!0)continue;if(z===u&&I===M+1){M+=2;continue}V=I+1;continue}if(d.noext!==!0&&(S===x||S===n||S===e||S===T||S===r)&&a()===$){if(K=N.isGlob=!0,tt=N.isExtglob=!0,Q=!0,S===r&&I===M&&(st=!0),b===!0){for(;W()!==!0&&(S=F());){if(S===l){et=N.backslashes=!0,S=F();continue}if(S===O){K=N.isGlob=!0,Q=!0;break}}continue}break}if(S===e){if(z===e&&(lt=N.isGlobstar=!0),K=N.isGlob=!0,Q=!0,b===!0)continue;break}if(S===T){if(K=N.isGlob=!0,Q=!0,b===!0)continue;break}if(S===v){for(;W()!==!0&&(Z=F());){if(Z===l){et=N.backslashes=!0,F();continue}if(Z===L){J=N.isBracket=!0,K=N.isGlob=!0,Q=!0;break}}if(b===!0)continue;break}if(d.nonegate!==!0&&S===r&&I===M){U=N.negated=!0,M++;continue}if(d.noparen!==!0&&S===$){if(K=N.isGlob=!0,b===!0){for(;W()!==!0&&(S=F());){if(S===$){et=N.backslashes=!0,S=F();continue}if(S===O){Q=!0;break}}continue}break}if(K===!0){if(Q=!0,b===!0)continue;break}}d.noext===!0&&(tt=!1,K=!1);let B=A,pt="",o="";M>0&&(pt=A.slice(0,M),A=A.slice(M),V-=M),B&&K===!0&&V>0?(B=A.slice(0,V),o=A.slice(V)):K===!0?(B="",o=A):B=A,B&&B!==""&&B!=="/"&&B!==A&&m(B.charCodeAt(B.length-1))&&(B=B.slice(0,-1)),d.unescape===!0&&(o&&(o=t.removeBackslashes(o)),B&&et===!0&&(B=t.removeBackslashes(B)));const i={prefix:pt,input:C,start:M,base:B,glob:o,isBrace:at,isBracket:J,isGlob:K,isExtglob:tt,isGlobstar:lt,negated:U,negatedExtglob:st};if(d.tokens===!0&&(i.maxDepth=0,m(S)||R.push(N),i.tokens=R),d.parts===!0||d.tokens===!0){let Z;for(let P=0;P<w.length;P++){const nt=Z?Z+1:M,ot=w[P],Y=C.slice(nt,ot);d.tokens&&(P===0&&M!==0?(R[P].isPrefix=!0,R[P].value=pt):R[P].value=Y,j(R[P]),i.maxDepth+=R[P].depth),(P!==0||Y!=="")&&_.push(Y),Z=ot}if(Z&&Z+1<C.length){const P=C.slice(Z+1);_.push(P),d.tokens&&(R[R.length-1].value=P,j(R[R.length-1]),i.maxDepth+=R[R.length-1].depth)}i.slashes=w,i.parts=_}return i},mt}var Ct,Dt;function de(){if(Dt)return Ct;Dt=1;const t=vt(),e=St(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:l,REGEX_NON_SPECIAL_CHARS:c,REGEX_SPECIAL_CHARS_BACKREF:u,REPLACEMENTS:r}=t,p=(g,d)=>{if(typeof d.expandRange=="function")return d.expandRange(...g,d);g.sort();const s=`[${g.join("-")}]`;try{new RegExp(s)}catch{return g.map(b=>e.escapeRegex(b)).join("..")}return s},y=(g,d)=>`Missing ${g}: "${d}" - use "\\\\${d}" to match literal characters`,$=g=>{const d=[];let s=0,b=0,w=0,R="",_=!1;for(const A of g){if(_===!0){R+=A,_=!1;continue}if(A==="\\"){R+=A,_=!0;continue}if(A==='"'){w=w===1?0:1,R+=A;continue}if(w===0){if(A==="[")s++;else if(A==="]"&&s>0)s--;else if(s===0){if(A==="(")b++;else if(A===")"&&b>0)b--;else if(A==="|"&&b===0){d.push(R),R="";continue}}}R+=A}return d.push(R),d},v=g=>{let d=!1;for(const s of g){if(d===!0){d=!1;continue}if(s==="\\"){d=!0;continue}if(/[?*+@!()[\]{}]/.test(s))return!1}return!0},x=g=>{let d=g.trim(),s=!0;for(;s===!0;)s=!1,/^@\([^\\()[\]{}|]+\)$/.test(d)&&(d=d.slice(2,-1),s=!0);if(v(d))return d.replace(/\\(.)/g,"$1")},T=g=>{const d=g.map(x).filter(Boolean);for(let s=0;s<d.length;s++)for(let b=s+1;b<d.length;b++){const w=d[s],R=d[b],_=w[0];if(!(!_||w!==_.repeat(w.length)||R!==_.repeat(R.length))&&(w===R||w.startsWith(R)||R.startsWith(w)))return!0}return!1},E=(g,d=!0)=>{if(g[0]!=="+"&&g[0]!=="*"||g[1]!=="(")return;let s=0,b=0,w=0,R=!1;for(let _=1;_<g.length;_++){const A=g[_];if(R===!0){R=!1;continue}if(A==="\\"){R=!0;continue}if(A==='"'){w=w===1?0:1;continue}if(w!==1){if(A==="["){s++;continue}if(A==="]"&&s>0){s--;continue}if(!(s>0)){if(A==="("){b++;continue}if(A===")"&&(b--,b===0))return d===!0&&_!==g.length-1?void 0:{type:g[0],body:g.slice(2,_),end:_}}}}},O=g=>`${g.length===1?e.escapeRegex(g[0]):`[${g.map(d=>e.escapeRegex(d)).join("")}]`}*`,L=g=>{let d=0;const s=[];for(;d<g.length;){const b=E(g.slice(d),!1);if(!b||b.type!=="*")return;const w=$(b.body).map(_=>_.trim());if(w.length!==1)return;const R=x(w[0]);if(!R||R.length!==1)return;s.push(R),d+=b.end+1}if(!(s.length<1))return s},m=g=>{let d=0,s=g.trim(),b=E(s);for(;b;)d++,s=b.body.trim(),b=E(s);return d},j=(g,d)=>{if(d.maxExtglobRecursion===!1)return{risky:!1};const s=typeof d.maxExtglobRecursion=="number"?d.maxExtglobRecursion:t.DEFAULT_MAX_EXTGLOB_RECURSION,b=$(g).map(A=>A.trim());if(b.length>1&&(b.some(A=>A==="")||b.some(A=>/^[*?]+$/.test(A))||T(b)))return{risky:!0};const w=[];let R=!1,_=!0;for(const A of b){const I=L(A);if(I){R=!0,w.push(...I);continue}const M=x(A);if(M&&M.length===1){w.push(M);continue}if(_=!1,m(A)>s)return{risky:!0}}return R?_?{risky:!0,safeOutput:O([...new Set(w)])}:{risky:!0}:{risky:!1}},C=(g,d)=>{if(typeof g!="string")throw new TypeError("Expected a string");g=r[g]||g;const s={...d},b=typeof s.maxLength=="number"?Math.min(n,s.maxLength):n;let w=g.length;if(w>b)throw new SyntaxError(`Input length: ${w}, exceeds maximum allowed length: ${b}`);const R={type:"bos",value:"",output:s.prepend||""},_=[R],A=s.capture?"":"?:",I=t.globChars(s.windows),M=t.extglobChars(I),{DOT_LITERAL:V,PLUS_LITERAL:at,SLASH_LITERAL:J,ONE_CHAR:K,DOTS_SLASH:tt,NO_DOT:lt,NO_DOT_SLASH:rt,NO_DOTS_SLASH:et,QMARK:U,QMARK_NO_DOT:st,STAR:Q,START_ANCHOR:ct}=I,z=f=>`(${A}(?:(?!${ct}${f.dot?tt:V}).)*?)`,S=s.dot?"":lt,N=s.dot?U:st;let W=s.bash===!0?z(s):Q;s.capture&&(W=`(${W})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);const a={input:g,index:-1,start:0,dot:s.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:_};g=e.removePrefix(g,a),w=g.length;const F=[],B=[],pt=[];let o=R,i;const Z=()=>a.index===w-1,P=a.peek=(f=1)=>g[a.index+f],nt=a.advance=()=>g[++a.index]||"",ot=()=>g.slice(a.index+1),Y=(f="",G=0)=>{a.consumed+=f,a.index+=G},_t=f=>{a.output+=f.output!=null?f.output:f.value,Y(f.value)},ue=()=>{let f=1;for(;P()==="!"&&(P(2)!=="("||P(3)==="?");)nt(),a.start++,f++;return f%2===0?!1:(a.negated=!0,a.start++,!0)},bt=f=>{a[f]++,pt.push(f)},ht=f=>{a[f]--,pt.pop()},k=f=>{if(o.type==="globstar"){const G=a.braces>0&&(f.type==="comma"||f.type==="brace"),h=f.extglob===!0||F.length&&(f.type==="pipe"||f.type==="paren");f.type!=="slash"&&f.type!=="paren"&&!G&&!h&&(a.output=a.output.slice(0,-o.output.length),o.type="star",o.value="*",o.output=W,a.output+=o.output)}if(F.length&&f.type!=="paren"&&(F[F.length-1].inner+=f.value),(f.value||f.output)&&_t(f),o&&o.type==="text"&&f.type==="text"){o.output=(o.output||o.value)+f.value,o.value+=f.value;return}f.prev=o,_.push(f),o=f},Et=(f,G)=>{const h={...M[G],conditions:1,inner:""};h.prev=o,h.parens=a.parens,h.output=a.output,h.startIndex=a.index,h.tokensIndex=_.length;const H=(s.capture?"(":"")+h.open;bt("parens"),k({type:f,value:G,output:a.output?"":K}),k({type:"paren",extglob:!0,value:nt(),output:H}),F.push(h)},ie=f=>{const G=g.slice(f.startIndex,a.index+1),h=g.slice(f.startIndex+2,a.index),H=j(h,s);if((f.type==="plus"||f.type==="star")&&H.risky){const D=H.safeOutput?(f.output?"":K)+(s.capture?`(${H.safeOutput})`:H.safeOutput):void 0,ut=_[f.tokensIndex];ut.type="text",ut.value=G,ut.output=D||e.escapeRegex(G);for(let it=f.tokensIndex+1;it<_.length;it++)_[it].value="",_[it].output="",delete _[it].suffix;a.output=f.output+ut.output,a.backtrack=!0,k({type:"paren",extglob:!0,value:i,output:""}),ht("parens");return}let q=f.close+(s.capture?")":""),X;if(f.type==="negate"){let D=W;if(f.inner&&f.inner.length>1&&f.inner.includes("/")&&(D=z(s)),(D!==W||Z()||/^\)+$/.test(ot()))&&(q=f.close=`)$))${D}`),f.inner.includes("*")&&(X=ot())&&/^\.[^\\/.]+$/.test(X)){const ut=C(X,{...d,fastpaths:!1}).output;q=f.close=`)${ut})${D})`}f.prev.type==="bos"&&(a.negatedExtglob=!0)}k({type:"paren",extglob:!0,value:i,output:q}),ht("parens")};if(s.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(g)){let f=!1,G=g.replace(u,(h,H,q,X,D,ut)=>X==="\\"?(f=!0,h):X==="?"?H?H+X+(D?U.repeat(D.length):""):ut===0?N+(D?U.repeat(D.length):""):U.repeat(q.length):X==="."?V.repeat(q.length):X==="*"?H?H+X+(D?W:""):W:H?h:`\\${h}`);return f===!0&&(s.unescape===!0?G=G.replace(/\\/g,""):G=G.replace(/\\+/g,h=>h.length%2===0?"\\\\":h?"\\":"")),G===g&&s.contains===!0?(a.output=g,a):(a.output=e.wrapOutput(G,a,d),a)}for(;!Z();){if(i=nt(),i==="\0")continue;if(i==="\\"){const h=P();if(h==="/"&&s.bash!==!0||h==="."||h===";")continue;if(!h){i+="\\",k({type:"text",value:i});continue}const H=/^\\+/.exec(ot());let q=0;if(H&&H[0].length>2&&(q=H[0].length,a.index+=q,q%2!==0&&(i+="\\")),s.unescape===!0?i=nt():i+=nt(),a.brackets===0){k({type:"text",value:i});continue}}if(a.brackets>0&&(i!=="]"||o.value==="["||o.value==="[^")){if(s.posix!==!1&&i===":"){const h=o.value.slice(1);if(h.includes("[")&&(o.posix=!0,h.includes(":"))){const H=o.value.lastIndexOf("["),q=o.value.slice(0,H),X=o.value.slice(H+2),D=l[X];if(D){o.value=q+D,a.backtrack=!0,nt(),!R.output&&_.indexOf(o)===1&&(R.output=K);continue}}}(i==="["&&P()!==":"||i==="-"&&P()==="]")&&(i=`\\${i}`),i==="]"&&(o.value==="["||o.value==="[^")&&(i=`\\${i}`),s.posix===!0&&i==="!"&&o.value==="["&&(i="^"),o.value+=i,_t({value:i});continue}if(a.quotes===1&&i!=='"'){i=e.escapeRegex(i),o.value+=i,_t({value:i});continue}if(i==='"'){a.quotes=a.quotes===1?0:1,s.keepQuotes===!0&&k({type:"text",value:i});continue}if(i==="("){bt("parens"),k({type:"paren",value:i});continue}if(i===")"){if(a.parens===0&&s.strictBrackets===!0)throw new SyntaxError(y("opening","("));const h=F[F.length-1];if(h&&a.parens===h.parens+1){ie(F.pop());continue}k({type:"paren",value:i,output:a.parens?")":"\\)"}),ht("parens");continue}if(i==="["){if(s.nobracket===!0||!ot().includes("]")){if(s.nobracket!==!0&&s.strictBrackets===!0)throw new SyntaxError(y("closing","]"));i=`\\${i}`}else bt("brackets");k({type:"bracket",value:i});continue}if(i==="]"){if(s.nobracket===!0||o&&o.type==="bracket"&&o.value.length===1){k({type:"text",value:i,output:`\\${i}`});continue}if(a.brackets===0){if(s.strictBrackets===!0)throw new SyntaxError(y("opening","["));k({type:"text",value:i,output:`\\${i}`});continue}ht("brackets");const h=o.value.slice(1);if(o.posix!==!0&&h[0]==="^"&&!h.includes("/")&&(i=`/${i}`),o.value+=i,_t({value:i}),s.literalBrackets===!1||e.hasRegexChars(h))continue;const H=e.escapeRegex(o.value);if(a.output=a.output.slice(0,-o.value.length),s.literalBrackets===!0){a.output+=H,o.value=H;continue}o.value=`(${A}${H}|${o.value})`,a.output+=o.value;continue}if(i==="{"&&s.nobrace!==!0){bt("braces");const h={type:"brace",value:i,output:"(",outputIndex:a.output.length,tokensIndex:a.tokens.length};B.push(h),k(h);continue}if(i==="}"){const h=B[B.length-1];if(s.nobrace===!0||!h){k({type:"text",value:i,output:i});continue}let H=")";if(h.dots===!0){const q=_.slice(),X=[];for(let D=q.length-1;D>=0&&(_.pop(),q[D].type!=="brace");D--)q[D].type!=="dots"&&X.unshift(q[D].value);H=p(X,s),a.backtrack=!0}if(h.comma!==!0&&h.dots!==!0){const q=a.output.slice(0,h.outputIndex),X=a.tokens.slice(h.tokensIndex);h.value=h.output="\\{",i=H="\\}",a.output=q;for(const D of X)a.output+=D.output||D.value}k({type:"brace",value:i,output:H}),ht("braces"),B.pop();continue}if(i==="|"){F.length>0&&F[F.length-1].conditions++,k({type:"text",value:i});continue}if(i===","){let h=i;const H=B[B.length-1];H&&pt[pt.length-1]==="braces"&&(H.comma=!0,h="|"),k({type:"comma",value:i,output:h});continue}if(i==="/"){if(o.type==="dot"&&a.index===a.start+1){a.start=a.index+1,a.consumed="",a.output="",_.pop(),o=R;continue}k({type:"slash",value:i,output:J});continue}if(i==="."){if(a.braces>0&&o.type==="dot"){o.value==="."&&(o.output=V);const h=B[B.length-1];o.type="dots",o.output+=i,o.value+=i,h.dots=!0;continue}if(a.braces+a.parens===0&&o.type!=="bos"&&o.type!=="slash"){k({type:"text",value:i,output:V});continue}k({type:"dot",value:i,output:V});continue}if(i==="?"){if(!(o&&o.value==="(")&&s.noextglob!==!0&&P()==="("&&P(2)!=="?"){Et("qmark",i);continue}if(o&&o.type==="paren"){const h=P();let H=i;(o.value==="("&&!/[!=<:]/.test(h)||h==="<"&&!/<([!=]|\w+>)/.test(ot()))&&(H=`\\${i}`),k({type:"text",value:i,output:H});continue}if(s.dot!==!0&&(o.type==="slash"||o.type==="bos")){k({type:"qmark",value:i,output:st});continue}k({type:"qmark",value:i,output:U});continue}if(i==="!"){if(s.noextglob!==!0&&P()==="("&&(P(2)!=="?"||!/[!=<:]/.test(P(3)))){Et("negate",i);continue}if(s.nonegate!==!0&&a.index===0){ue();continue}}if(i==="+"){if(s.noextglob!==!0&&P()==="("&&P(2)!=="?"){Et("plus",i);continue}if(o&&o.value==="("||s.regex===!1){k({type:"plus",value:i,output:at});continue}if(o&&(o.type==="bracket"||o.type==="paren"||o.type==="brace")||a.parens>0){k({type:"plus",value:i});continue}k({type:"plus",value:at});continue}if(i==="@"){if(s.noextglob!==!0&&P()==="("&&P(2)!=="?"){k({type:"at",extglob:!0,value:i,output:""});continue}k({type:"text",value:i});continue}if(i!=="*"){(i==="$"||i==="^")&&(i=`\\${i}`);const h=c.exec(ot());h&&(i+=h[0],a.index+=h[0].length),k({type:"text",value:i});continue}if(o&&(o.type==="globstar"||o.star===!0)){o.type="star",o.star=!0,o.value+=i,o.output=W,a.backtrack=!0,a.globstar=!0,Y(i);continue}let f=ot();if(s.noextglob!==!0&&/^\([^?]/.test(f)){Et("star",i);continue}if(o.type==="star"){if(s.noglobstar===!0){Y(i);continue}const h=o.prev,H=h.prev,q=h.type==="slash"||h.type==="bos",X=H&&(H.type==="star"||H.type==="globstar");if(s.bash===!0&&(!q||f[0]&&f[0]!=="/")){k({type:"star",value:i,output:""});continue}const D=a.braces>0&&(h.type==="comma"||h.type==="brace"),ut=F.length&&(h.type==="pipe"||h.type==="paren");if(!q&&h.type!=="paren"&&!D&&!ut){k({type:"star",value:i,output:""});continue}for(;f.slice(0,3)==="/**";){const it=g[a.index+4];if(it&&it!=="/")break;f=f.slice(3),Y("/**",3)}if(h.type==="bos"&&Z()){o.type="globstar",o.value+=i,o.output=z(s),a.output=o.output,a.globstar=!0,Y(i);continue}if(h.type==="slash"&&h.prev.type!=="bos"&&!X&&Z()){a.output=a.output.slice(0,-(h.output+o.output).length),h.output=`(?:${h.output}`,o.type="globstar",o.output=z(s)+(s.strictSlashes?")":"|$)"),o.value+=i,a.globstar=!0,a.output+=h.output+o.output,Y(i);continue}if(h.type==="slash"&&h.prev.type!=="bos"&&f[0]==="/"){const it=f[1]!==void 0?"|$":"";a.output=a.output.slice(0,-(h.output+o.output).length),h.output=`(?:${h.output}`,o.type="globstar",o.output=`${z(s)}${J}|${J}${it})`,o.value+=i,a.output+=h.output+o.output,a.globstar=!0,Y(i+nt()),k({type:"slash",value:"/",output:""});continue}if(h.type==="bos"&&f[0]==="/"){o.type="globstar",o.value+=i,o.output=`(?:^|${J}|${z(s)}${J})`,a.output=o.output,a.globstar=!0,Y(i+nt()),k({type:"slash",value:"/",output:""});continue}if(D&&f[0]==="/"){o.type="globstar",o.value+=i,o.output=`(?:^|${J}|${z(s)}${J})`,a.output+=o.output,a.globstar=!0,Y(i+nt()),k({type:"slash",value:"/",output:""});continue}a.output=a.output.slice(0,-o.output.length),o.type="globstar",o.output=z(s),o.value+=i,a.output+=o.output,a.globstar=!0,Y(i);continue}const G={type:"star",value:i,output:W};if(s.bash===!0){G.output=".*?",(o.type==="bos"||o.type==="slash")&&(G.output=S+G.output),k(G);continue}if(o&&(o.type==="bracket"||o.type==="paren")&&s.regex===!0){G.output=i,k(G);continue}(a.index===a.start||o.type==="slash"||o.type==="dot")&&(o.type==="dot"?(a.output+=rt,o.output+=rt):s.dot===!0?(a.output+=et,o.output+=et):(a.output+=S,o.output+=S),P()!=="*"&&(a.output+=K,o.output+=K)),k(G)}for(;a.brackets>0;){if(s.strictBrackets===!0)throw new SyntaxError(y("closing","]"));a.output=e.escapeLast(a.output,"["),ht("brackets")}for(;a.parens>0;){if(s.strictBrackets===!0)throw new SyntaxError(y("closing",")"));a.output=e.escapeLast(a.output,"("),ht("parens")}for(;a.braces>0;){if(s.strictBrackets===!0)throw new SyntaxError(y("closing","}"));a.output=e.escapeLast(a.output,"{"),ht("braces")}if(s.strictSlashes!==!0&&(o.type==="star"||o.type==="bracket")&&k({type:"maybe_slash",value:"",output:`${J}?`}),a.backtrack===!0){a.output="";for(const f of a.tokens)a.output+=f.output!=null?f.output:f.value,f.suffix&&(a.output+=f.suffix)}return a};return C.fastpaths=(g,d)=>{const s={...d},b=typeof s.maxLength=="number"?Math.min(n,s.maxLength):n,w=g.length;if(w>b)throw new SyntaxError(`Input length: ${w}, exceeds maximum allowed length: ${b}`);g=r[g]||g;const{DOT_LITERAL:R,SLASH_LITERAL:_,ONE_CHAR:A,DOTS_SLASH:I,NO_DOT:M,NO_DOTS:V,NO_DOTS_SLASH:at,STAR:J,START_ANCHOR:K}=t.globChars(s.windows),tt=s.dot?V:M,lt=s.dot?at:M,rt=s.capture?"":"?:",et={negated:!1,prefix:""};let U=s.bash===!0?".*?":J;s.capture&&(U=`(${U})`);const st=S=>S.noglobstar===!0?U:`(${rt}(?:(?!${K}${S.dot?I:R}).)*?)`,Q=S=>{switch(S){case"*":return`${tt}${A}${U}`;case".*":return`${R}${A}${U}`;case"*.*":return`${tt}${U}${R}${A}${U}`;case"*/*":return`${tt}${U}${_}${A}${lt}${U}`;case"**":return tt+st(s);case"**/*":return`(?:${tt}${st(s)}${_})?${lt}${A}${U}`;case"**/*.*":return`(?:${tt}${st(s)}${_})?${lt}${U}${R}${A}${U}`;case"**/.*":return`(?:${tt}${st(s)}${_})?${R}${A}${U}`;default:{const N=/^(.*?)\.(\w+)$/.exec(S);if(!N)return;const W=Q(N[1]);return W?W+R+N[2]:void 0}}},ct=e.removePrefix(g,et);let z=Q(ct);return z&&s.strictSlashes!==!0&&(z+=`${_}?`),z},Ct=C,Ct}var kt,Bt;function ye(){if(Bt)return kt;Bt=1;const t=ge(),e=de(),n=St(),l=vt(),c=r=>r&&typeof r=="object"&&!Array.isArray(r),u=(r,p,y=!1)=>{if(Array.isArray(r)){const m=r.map(j=>u(j,p,y));return j=>{for(const C of m){const g=C(j);if(g)return g}return!1}}const $=c(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!$)throw new TypeError("Expected pattern to be a non-empty string");const v=p||{},x=v.windows,T=$?u.compileRe(r,p):u.makeRe(r,p,!1,!0),E=T.state;delete T.state;let O=()=>!1;if(v.ignore){const m={...p,ignore:null,onMatch:null,onResult:null};O=u(v.ignore,m,y)}const L=(m,j=!1)=>{const{isMatch:C,match:g,output:d}=u.test(m,T,p,{glob:r,posix:x}),s={glob:r,state:E,regex:T,posix:x,input:m,output:d,match:g,isMatch:C};if(typeof v.onResult=="function"&&v.onResult(s),C===!1)return s.isMatch=!1,j?s:!1;t:if(O(m)){if(typeof v.onIgnore=="function"&&v.onIgnore(s)===l.UNIGNORE){s.isMatch=!0;break t}return s.isMatch=!1,j?s:!1}return typeof v.onMatch=="function"&&v.onMatch(s),j?s:!0};return y&&(L.state=E),L};return u.test=(r,p,y,{glob:$,posix:v}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};const x=y||{},T=x.format||(v?n.toPosixSlashes:null);let E=r===$,O=E&&T?T(r):r;return E===!1&&(O=T?T(r):r,E=O===$),(E===!1||x.capture===!0)&&(x.matchBase===!0||x.basename===!0?E=u.matchBase(r,p,y,v):E=p.exec(O)),{isMatch:!!E,match:E,output:O}},u.matchBase=(r,p,y,$=y&&y.windows)=>(p instanceof RegExp?p:u.makeRe(p,y)).test(n.basename(r,{windows:$})),u.isMatch=(r,p,y)=>u(p,y)(r),u.parse=(r,p)=>Array.isArray(r)?r.map(y=>u.parse(y,p)):e(r,{...p,fastpaths:!1}),u.scan=(r,p)=>t(r,p),u.compileRe=(r,p,y=!1,$=!1)=>{if(y===!0)return r.output;const v=p||{},x=v.contains?"":"^",T=v.contains?"":"$";let E=`${x}(?:${r.output})${T}`;r&&r.negated===!0&&(E=`^(?!${E}).*$`);const O=u.toRegex(E,p);return $===!0&&(O.state=r),O},u.makeRe=(r,p={},y=!1,$=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let v={negated:!1,fastpaths:!0};return p.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(v.output=e.fastpaths(r,p)),v.output||(v=e(r,p)),u.compileRe(v,p,y,$)},u.toRegex=(r,p)=>{try{const y=p||{};return new RegExp(r,y.flags||(y.nocase?"i":""))}catch(y){if(p&&p.debug===!0)throw y;return/$^/}},u.constants=l,kt=u,kt}var wt,Mt;function Ae(){if(Mt)return wt;Mt=1;const t=ye(),e=St();function n(l,c,u=!1){return c&&(c.windows===null||c.windows===void 0)&&(c={...c,windows:e.isWindows()}),t(l,c,u)}return Object.assign(n,t),wt=n,wt}var Re=Ae();const ft=fe(Re);let _e;const be=t=>(_e??=he(import.meta.url))(t),yt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Rt=t=>{if(typeof yt<"u"&&yt.versions&&yt.versions.node){const[e,n]=yt.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return yt.getBuiltinModule(t)}return be(t)},Ft=Rt("fs"),Ee={...Ft,default:Ft},{statSync:ve,stat:Se,realpathSync:$e,realpath:xe,readdirSync:me,readdir:Ce}=Rt("fs"),{sep:Wt,basename:ke,dirname:Tt,resolve:Qt,normalize:we,relative:He,posix:gt,isAbsolute:Oe}=Rt("path"),{fileURLToPath:Te}=Rt("url"),{createRequire:Le}=Rt("module");var Gt=Le(import.meta.url);function Pe(t){let e=we(t);return e.length>1&&e[e.length-1]===Wt&&(e=e.substring(0,e.length-1)),e}const Ie=/[\\/]/g;function zt(t,e){return t.replace(Ie,e)}const Ne=/^[a-z]:[\\/]$/i;function De(t){return t==="/"||Ne.test(t)}function Ht(t,e){const{resolvePaths:n,normalizePath:l,pathSeparator:c}=e,u=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(n&&(t=Qt(t)),(l||u)&&(t=Pe(t)),t===".")return"";const r=t[t.length-1]!==c;return zt(r?t+c:t,c)}function Zt(t,e){return e+t}function Be(t,e){return function(n,l){return l.startsWith(t)?l.slice(t.length)+n:zt(He(t,l),e.pathSeparator)+e.pathSeparator+n}}function Me(t){return t}function Fe(t,e,n){return e+t+n}function Ge(t,e){const{relativePaths:n,includeBasePath:l}=e;return n&&t?Be(t,e):l?Zt:Me}function Ue(t){return function(e,n){n.push(e.substring(t.length)||".")}}function qe(t){return function(e,n,l){const c=e.substring(t.length)||".";l.every(u=>u(c,!0))&&n.push(c)}}const Ke=(t,e)=>{e.push(t||".")},Xe=(t,e,n)=>{const l=t||".";n.every(c=>c(l,!0))&&e.push(l)},je=()=>{};function We(t,e){const{includeDirs:n,filters:l,relativePaths:c}=e;return n?c?l&&l.length?qe(t):Ue(t):l&&l.length?Xe:Ke:je}const Qe=(t,e,n,l)=>{l.every(c=>c(t,!1))&&n.files++},ze=(t,e,n,l)=>{l.every(c=>c(t,!1))&&e.push(t)},Ze=(t,e,n,l)=>{n.files++},Ye=(t,e)=>{e.push(t)},Ve=()=>{};function Je(t){const{excludeFiles:e,filters:n,onlyCounts:l}=t;return e?Ve:n&&n.length?l?Qe:ze:l?Ze:Ye}const tn=t=>t,en=()=>[""].slice(0,0);function nn(t){return t.group?en:tn}const rn=(t,e,n)=>{t.push({directory:e,files:n,dir:e})},sn=()=>{};function on(t){return t.group?rn:sn}const un=function(t,e,n){const{queue:l,fs:c,options:{suppressErrors:u}}=e;l.enqueue(),c.realpath(t,(r,p)=>{if(r)return l.dequeue(u?null:r,e);c.stat(p,(y,$)=>{if(y)return l.dequeue(u?null:y,e);if($.isDirectory()&&Yt(t,p,e))return l.dequeue(null,e);n($,p),l.dequeue(null,e)})})},an=function(t,e,n){const{queue:l,fs:c,options:{suppressErrors:u}}=e;l.enqueue();try{const r=c.realpathSync(t),p=c.statSync(r);if(p.isDirectory()&&Yt(t,r,e))return;n(p,r)}catch(r){if(!u)throw r}};function ln(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?an:un}function Yt(t,e,n){if(n.options.useRealPaths)return cn(e,n);let l=Tt(t),c=1;for(;l!==n.root&&c<2;){const u=n.symlinks.get(l);u&&(u===e||u.startsWith(e)||e.startsWith(u))?c++:l=Tt(l)}return n.symlinks.set(t,e),c>1}function cn(t,e){return e.visited.includes(t+e.options.pathSeparator)}const pn=t=>t.counts,hn=t=>t.groups,fn=t=>t.paths,gn=t=>t.paths.slice(0,t.options.maxFiles),dn=(t,e,n)=>($t(e,n,t.counts,t.options.suppressErrors),null),yn=(t,e,n)=>($t(e,n,t.paths,t.options.suppressErrors),null),An=(t,e,n)=>($t(e,n,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),Rn=(t,e,n)=>($t(e,n,t.groups,t.options.suppressErrors),null);function $t(t,e,n,l){e(t&&!l?t:null,n)}function _n(t,e){const{onlyCounts:n,group:l,maxFiles:c}=t;return n?e?pn:dn:l?e?hn:Rn:c?e?gn:An:e?fn:yn}const Vt={withFileTypes:!0},bn=(t,e,n,l,c)=>{if(t.queue.enqueue(),l<0)return t.queue.dequeue(null,t);const{fs:u}=t;t.visited.push(e),t.counts.directories++,u.readdir(e||".",Vt,(r,p=[])=>{c(p,n,l),t.queue.dequeue(t.options.suppressErrors?null:r,t)})},En=(t,e,n,l,c)=>{const{fs:u}=t;if(l<0)return;t.visited.push(e),t.counts.directories++;let r=[];try{r=u.readdirSync(e||".",Vt)}catch(p){if(!t.options.suppressErrors)throw p}c(r,n,l)};function vn(t){return t?En:bn}var Sn=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},$n=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},xn=class{aborted=!1;abort(){this.aborted=!0}},Jt=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,n){this.isSynchronous=!n,this.callbackInvoker=_n(e,this.isSynchronous),this.root=Ht(t,e),this.state={root:De(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new $n,options:e,queue:new Sn((l,c)=>this.callbackInvoker(c,l,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new xn,fs:e.fs||Ee},this.joinPath=Ge(this.root,e),this.pushDirectory=We(this.root,e),this.pushFile=Je(e),this.getArray=nn(e),this.groupFiles=on(e),this.resolveSymlink=ln(e,this.isSynchronous),this.walkDirectory=vn(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,n)=>{const{paths:l,options:{filters:c,resolveSymlinks:u,excludeSymlinks:r,exclude:p,maxFiles:y,signal:$,useRealPaths:v,pathSeparator:x},controller:T}=this.state;if(T.aborted||$&&$.aborted||y&&l.length>y)return;const E=this.getArray(this.state.paths);for(let O=0;O<t.length;++O){const L=t[O];if(L.isFile()||L.isSymbolicLink()&&!u&&!r){const m=this.joinPath(L.name,e);this.pushFile(m,E,this.state.counts,c)}else if(L.isDirectory()){let m=Fe(L.name,e,this.state.options.pathSeparator);if(p&&p(L.name,m))continue;this.pushDirectory(m,l,c),this.walkDirectory(this.state,m,m,n-1,this.walk)}else if(this.resolveSymlink&&L.isSymbolicLink()){let m=Zt(L.name,e);this.resolveSymlink(m,this.state,(j,C)=>{if(j.isDirectory()){if(C=Ht(C,this.state.options),p&&p(L.name,v?C:m+x))return;this.walkDirectory(this.state,C,v?C:m+x,n-1,this.walk)}else{C=v?C:m;const g=ke(C),d=Ht(Tt(C),this.state.options);C=this.joinPath(g,d),this.pushFile(C,E,this.state.counts,c)}})}}this.groupFiles(this.state.groups,e,E)}};function mn(t,e){return new Promise((n,l)=>{te(t,e,(c,u)=>{if(c)return l(c);n(u)})})}function te(t,e,n){new Jt(t,e,n).start()}function Cn(t,e){return new Jt(t,e).start()}var Ut=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return mn(this.root,this.options)}withCallback(t){te(this.root,this.options,t)}sync(){return Cn(this.root,this.options)}};let ee=null;try{Gt.resolve("picomatch"),ee=Gt("picomatch")}catch{}var kn=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:Wt,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new Ut(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new Ut(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){const n=this.globFunction||ee;if(!n)throw new Error("Please specify a glob function to use glob matching.");var l=this.globCache[t.join("\0")];return l||(l=n(t,...e),this.globCache[t.join("\0")]=l),this.options.filters.push(c=>l(c)),this}};const wn=Array.isArray,ne=/\\/g,Hn=/^[A-Za-z]:$/,re=process.platform==="win32",On=/^(\/?\.\.)+$/;function qt(t,e={}){const n=t.length,l=Array(n),c=Array(n);let u,r;for(u=0;u<n;u++){const p=se(t[u]);l[u]=p;const y=p.length,$=Array(y);for(r=0;r<y;r++)$[r]=ft(p[r],e);c[u]=$}return p=>{const y=p.split("/");if(y[0]===".."&&On.test(p))return!0;for(u=0;u<n;u++){const $=l[u],v=c[u],x=y.length,T=Math.min(x,$.length);for(r=0;r<T;){const E=$[r];if(E.includes("/"))return!0;if(!v[r](y[r]))break;if(!e.noglobstar&&E==="**")return!0;r++}if(r===x)return!0}return!1}}const Tn=/^[A-Z]:\/$/i,Ln=re?t=>Tn.test(t):t=>t==="/";function Kt(t,e,n){if(t===e||e.startsWith(`${t}/`)){if(n){const c=t.length+ +!Ln(t);return(u,r)=>u.slice(c,r?-1:void 0)||"."}const l=e.slice(t.length+1);return l?(c,u)=>{if(c===".")return l;const r=`${l}/${c}`;return u?r.slice(0,-1):r}:(c,u)=>u&&c!=="."?c.slice(0,-1):c}return n?l=>gt.relative(t,l)||".":l=>gt.relative(t,`${e}/${l}`)||"."}function Pn(t,e){if(e.startsWith(`${t}/`)){const n=e.slice(t.length+1);return l=>`${n}/${l}`}return n=>{const l=gt.relative(t,`${e}/${n}`);return n[n.length-1]==="/"&&l!==""?`${l}/`:l||"."}}function Xt(t){return t.replace(Hn,e=>`${e}/`)}const In={parts:!0};function se(t){var e;const n=ft.scan(t,In);return!((e=n.parts)===null||e===void 0)&&e.length?n.parts:[t]}const Nn=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Dn=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Bn=t=>t.replace(Nn,"\\$&"),Mn=t=>t.replace(Dn,"\\$&"),Fn=re?Mn:Bn;function Gn(t,e){const n=ft.scan(t);return n.isGlob||n.negated}function At(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function oe(t){return typeof t=="string"?[t]:t??[]}const Un=/^(\/?\.\.)+/,qn=/\\(?=[()[\]{}!*+?@|])/g;function Ot(t,e,n,l){var c;const u=e.cwd;let r=t;t[t.length-1]==="/"&&(r=t.slice(0,-1));const p=r.lastIndexOf("/"),y=(p===-1?r:r.slice(p+1)).startsWith("!(");r[r.length-1]!=="*"&&!y&&e.expandDirectories&&(r+="/**");const $=Fn(u);r=Oe(r.replace(qn,""))?gt.relative($,r):gt.normalize(r);const v=(c=Un.exec(r))===null||c===void 0?void 0:c[0],x=se(r);if(v){const E=(v.length+1)/3;let O=0;const L=$.split("/");for(;O<E&&x[O+E]===L[L.length+O-E];)r=r.slice(0,(E-O-1)*3)+r.slice((E-O)*3+x[O+E].length+1)||".",O++;const m=gt.join(u,v.slice(O*3));m[0]!=="."&&n.root.length>m.length&&(n.root=Xt(m),n.depthOffset=-E+O)}if(!l&&n.depthOffset>=0){var T;(T=n.commonPath)!==null&&T!==void 0||(n.commonPath=x);const E=[],O=Math.min(n.commonPath.length,x.length);for(let L=0;L<O;L++){const m=x[L];if(m==="**"&&!x[L+1]){E.pop();break}if(L===x.length-1||m!==n.commonPath[L]||Gn(m))break;E.push(m)}n.depthOffset=E.length,n.commonPath=E,n.root=Xt(E.length>0?gt.join(u,...E):u)}return r}function Kn(t,e,n){const l=[],c=[],u=[];for(const r of t.ignore)r&&(r[0]!=="!"||r[1]==="("?c.push(Ot(r,t,n,!0)):u.push(r.slice(1)));for(const r of e)r&&(r[0]!=="!"||r[1]==="("?l.push(Ot(r,t,n,!1)):(r[1]!=="!"||r[2]==="(")&&c.push(Ot(r.slice(1),t,n,!0)));return{match:l,ignore:c,unignore:u}}function Xn(t,e){const n=t.cwd,l={root:n,depthOffset:0},c=Kn(t,e,l);t.debug&&At("internal processing patterns:",c);const{absolute:u,caseSensitiveMatch:r,debug:p,dot:y,followSymbolicLinks:$,onlyDirectories:v}=t,x=l.root.replace(ne,""),T={dot:y,nobrace:t.braceExpansion===!1,nocase:!r,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},E=c.unignore.length>0,O=E?ft(c.unignore,T):void 0,L=E?qt(c.unignore,T):void 0,m=ft(c.match,{...T,ignore:c.ignore,onIgnore:O?_=>O(_.output)&&ft.constants.UNIGNORE:void 0}),j=ft(c.ignore,T),C=qt(c.match,T),g=Kt(n,x,u),d=u?g:Kt(n,x,!0),s=c.match.length>0&&c.match.every(_=>_==="**"||_==="**/*"),b=c.ignore.length>0||E||!s?(_,A)=>{const I=d(A,!0);return I==="."||L&&L(I)?!1:!C(I)||j(I)}:void 0;let w;t.deep!==void 0&&(w=Math.round(t.deep-l.depthOffset));const R=new kn({filters:[p?(_,A)=>{const I=g(_,A),M=m(I);return M&&At(`matched ${I}`),M}:(_,A)=>{const I=g(_,A);return m(I)}],exclude:p&&b?(_,A)=>{const I=b(_,A);return At(`${I?"skipped":"crawling"} ${A}`),I}:b,fs:t.fs,pathSeparator:"/",relativePaths:!u,resolvePaths:u,includeBasePath:u,resolveSymlinks:$,excludeSymlinks:!$,excludeFiles:v,includeDirs:v||!t.onlyFiles,maxDepth:w,signal:t.signal}).crawl(x);return t.debug&&At("internal properties:",{...l,root:x}),[R,n!==x&&!u&&Pn(n,x)]}function jn(t,e){if(e)for(let n=t.length-1;n>=0;n--)t[n]=e(t[n]);return t}const jt={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Wn(t){const e=Object.assign({},t);for(const n in jt)e[n]===void 0&&Object.assign(e,{[n]:jt[n]});return e.cwd=(e.cwd instanceof URL?Te(e.cwd):Qt(e.cwd||process.cwd())).replace(ne,"/"),e.ignore=oe(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||Ce,readdirSync:e.fs.readdirSync||me,realpath:e.fs.realpath||xe,realpathSync:e.fs.realpathSync||$e,stat:e.fs.stat||Se,statSync:e.fs.statSync||ve}),e.debug&&At("globbing with options:",e),e}function Qn(t,e={}){var n;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const l=wn(t)||typeof t=="string",c=oe((n=l?t:t.patterns)!==null&&n!==void 0?n:"**/*"),u=Wn(l?e:t);return c.length>0?Xn(u,c):[]}async function zn(t,e){const[n,l]=Qn(t,e);return n?jn(await n.withPromise(),l):[]}const Yn=async(t,e)=>await zn(t,e);export{Yn as l};