pickier 0.1.58 → 0.1.60

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 (290) hide show
  1. package/dist/bin/cli.d.ts +1 -0
  2. package/dist/bin/cli.js +2 -2
  3. package/dist/chunk-0whyx3r0.js +2 -0
  4. package/dist/chunk-0xebhmpv.js +224 -0
  5. package/dist/chunk-6xy2rbcn.js +62 -0
  6. package/dist/chunk-9vc029ds.js +156 -0
  7. package/dist/chunk-av6brc0s.js +2 -0
  8. package/dist/chunk-ha0tzyp8.js +2 -0
  9. package/dist/chunk-j0sjsw8n.js +33 -0
  10. package/dist/chunk-k110gscx.js +3 -0
  11. package/dist/chunk-ymb49mab.js +2 -0
  12. package/dist/src/index.js +1 -1
  13. package/dist/{rules → src/rules}/lockfile/parser.d.ts +12 -6
  14. package/package.json +3 -3
  15. package/dist/chunk-3wr40yqq.js +0 -2
  16. package/dist/chunk-720xck77.js +0 -2
  17. package/dist/chunk-8s8z5cnd.js +0 -2
  18. package/dist/chunk-ah6h41gy.js +0 -62
  19. package/dist/chunk-er69kh4d.js +0 -33
  20. package/dist/chunk-f0bqgs43.js +0 -2
  21. package/dist/chunk-fy0z5sp8.js +0 -224
  22. package/dist/chunk-q19vbsae.js +0 -3
  23. package/dist/chunk-v1x7hdmp.js +0 -156
  24. /package/dist/{chunk-43fsk0jg.js → chunk-cfytsdab.js} +0 -0
  25. /package/dist/{ast.d.ts → src/ast.d.ts} +0 -0
  26. /package/dist/{config.d.ts → src/config.d.ts} +0 -0
  27. /package/dist/{format.d.ts → src/format.d.ts} +0 -0
  28. /package/dist/{formatter.d.ts → src/formatter.d.ts} +0 -0
  29. /package/dist/{index.d.ts → src/index.d.ts} +0 -0
  30. /package/dist/{linter.d.ts → src/linter.d.ts} +0 -0
  31. /package/dist/{plugins → src/plugins}/eslint.d.ts +0 -0
  32. /package/dist/{plugins → src/plugins}/general.d.ts +0 -0
  33. /package/dist/{plugins → src/plugins}/index.d.ts +0 -0
  34. /package/dist/{plugins → src/plugins}/lockfile.d.ts +0 -0
  35. /package/dist/{plugins → src/plugins}/markdown.d.ts +0 -0
  36. /package/dist/{plugins → src/plugins}/node.d.ts +0 -0
  37. /package/dist/{plugins → src/plugins}/perfectionist.d.ts +0 -0
  38. /package/dist/{plugins → src/plugins}/pickier.d.ts +0 -0
  39. /package/dist/{plugins → src/plugins}/publint.d.ts +0 -0
  40. /package/dist/{plugins → src/plugins}/quality.d.ts +0 -0
  41. /package/dist/{plugins → src/plugins}/regexp.d.ts +0 -0
  42. /package/dist/{plugins → src/plugins}/shell.d.ts +0 -0
  43. /package/dist/{plugins → src/plugins}/spell.d.ts +0 -0
  44. /package/dist/{plugins → src/plugins}/style.d.ts +0 -0
  45. /package/dist/{plugins → src/plugins}/ts.d.ts +0 -0
  46. /package/dist/{plugins → src/plugins}/unused-imports.d.ts +0 -0
  47. /package/dist/{plugins → src/plugins}/utils.d.ts +0 -0
  48. /package/dist/{rules → src/rules}/general/_template-tracking.d.ts +0 -0
  49. /package/dist/{rules → src/rules}/general/array-callback-return.d.ts +0 -0
  50. /package/dist/{rules → src/rules}/general/constructor-super.d.ts +0 -0
  51. /package/dist/{rules → src/rules}/general/for-direction.d.ts +0 -0
  52. /package/dist/{rules → src/rules}/general/getter-return.d.ts +0 -0
  53. /package/dist/{rules → src/rules}/general/no-async-promise-executor.d.ts +0 -0
  54. /package/dist/{rules → src/rules}/general/no-compare-neg-zero.d.ts +0 -0
  55. /package/dist/{rules → src/rules}/general/no-cond-assign.d.ts +0 -0
  56. /package/dist/{rules → src/rules}/general/no-const-assign.d.ts +0 -0
  57. /package/dist/{rules → src/rules}/general/no-constant-condition.d.ts +0 -0
  58. /package/dist/{rules → src/rules}/general/no-constructor-return.d.ts +0 -0
  59. /package/dist/{rules → src/rules}/general/no-dupe-class-members.d.ts +0 -0
  60. /package/dist/{rules → src/rules}/general/no-dupe-keys.d.ts +0 -0
  61. /package/dist/{rules → src/rules}/general/no-duplicate-case.d.ts +0 -0
  62. /package/dist/{rules → src/rules}/general/no-empty-pattern.d.ts +0 -0
  63. /package/dist/{rules → src/rules}/general/no-fallthrough.d.ts +0 -0
  64. /package/dist/{rules → src/rules}/general/no-irregular-whitespace.d.ts +0 -0
  65. /package/dist/{rules → src/rules}/general/no-loss-of-precision.d.ts +0 -0
  66. /package/dist/{rules → src/rules}/general/no-new.d.ts +0 -0
  67. /package/dist/{rules → src/rules}/general/no-promise-executor-return.d.ts +0 -0
  68. /package/dist/{rules → src/rules}/general/no-redeclare.d.ts +0 -0
  69. /package/dist/{rules → src/rules}/general/no-regex-spaces.d.ts +0 -0
  70. /package/dist/{rules → src/rules}/general/no-self-assign.d.ts +0 -0
  71. /package/dist/{rules → src/rules}/general/no-self-compare.d.ts +0 -0
  72. /package/dist/{rules → src/rules}/general/no-sparse-arrays.d.ts +0 -0
  73. /package/dist/{rules → src/rules}/general/no-undef.d.ts +0 -0
  74. /package/dist/{rules → src/rules}/general/no-unreachable.d.ts +0 -0
  75. /package/dist/{rules → src/rules}/general/no-unsafe-negation.d.ts +0 -0
  76. /package/dist/{rules → src/rules}/general/no-unused-vars.d.ts +0 -0
  77. /package/dist/{rules → src/rules}/general/no-useless-catch.d.ts +0 -0
  78. /package/dist/{rules → src/rules}/general/prefer-const.d.ts +0 -0
  79. /package/dist/{rules → src/rules}/general/prefer-object-spread.d.ts +0 -0
  80. /package/dist/{rules → src/rules}/general/prefer-template.d.ts +0 -0
  81. /package/dist/{rules → src/rules}/general/use-isnan.d.ts +0 -0
  82. /package/dist/{rules → src/rules}/general/valid-typeof.d.ts +0 -0
  83. /package/dist/{rules → src/rules}/imports/first.d.ts +0 -0
  84. /package/dist/{rules → src/rules}/imports/import-dedupe.d.ts +0 -0
  85. /package/dist/{rules → src/rules}/imports/named.d.ts +0 -0
  86. /package/dist/{rules → src/rules}/imports/no-cycle.d.ts +0 -0
  87. /package/dist/{rules → src/rules}/imports/no-duplicate-imports.d.ts +0 -0
  88. /package/dist/{rules → src/rules}/imports/no-import-dist.d.ts +0 -0
  89. /package/dist/{rules → src/rules}/imports/no-import-node-modules-by-path.d.ts +0 -0
  90. /package/dist/{rules → src/rules}/imports/no-unresolved.d.ts +0 -0
  91. /package/dist/{rules → src/rules}/lockfile/validate-host.d.ts +0 -0
  92. /package/dist/{rules → src/rules}/lockfile/validate-https.d.ts +0 -0
  93. /package/dist/{rules → src/rules}/lockfile/validate-integrity.d.ts +0 -0
  94. /package/dist/{rules → src/rules}/lockfile/validate-package-names.d.ts +0 -0
  95. /package/dist/{rules → src/rules}/lockfile/validate-scheme.d.ts +0 -0
  96. /package/dist/{rules → src/rules}/markdown/_fence-tracking.d.ts +0 -0
  97. /package/dist/{rules → src/rules}/markdown/_shared.d.ts +0 -0
  98. /package/dist/{rules → src/rules}/markdown/blanks-around-fences.d.ts +0 -0
  99. /package/dist/{rules → src/rules}/markdown/blanks-around-headings.d.ts +0 -0
  100. /package/dist/{rules → src/rules}/markdown/blanks-around-lists.d.ts +0 -0
  101. /package/dist/{rules → src/rules}/markdown/blanks-around-tables.d.ts +0 -0
  102. /package/dist/{rules → src/rules}/markdown/code-block-style.d.ts +0 -0
  103. /package/dist/{rules → src/rules}/markdown/code-fence-style.d.ts +0 -0
  104. /package/dist/{rules → src/rules}/markdown/commands-show-output.d.ts +0 -0
  105. /package/dist/{rules → src/rules}/markdown/descriptive-link-text.d.ts +0 -0
  106. /package/dist/{rules → src/rules}/markdown/emphasis-style.d.ts +0 -0
  107. /package/dist/{rules → src/rules}/markdown/fenced-code-language.d.ts +0 -0
  108. /package/dist/{rules → src/rules}/markdown/first-line-heading.d.ts +0 -0
  109. /package/dist/{rules → src/rules}/markdown/heading-increment.d.ts +0 -0
  110. /package/dist/{rules → src/rules}/markdown/heading-start-left.d.ts +0 -0
  111. /package/dist/{rules → src/rules}/markdown/heading-style.d.ts +0 -0
  112. /package/dist/{rules → src/rules}/markdown/hr-style.d.ts +0 -0
  113. /package/dist/{rules → src/rules}/markdown/line-length.d.ts +0 -0
  114. /package/dist/{rules → src/rules}/markdown/link-fragments.d.ts +0 -0
  115. /package/dist/{rules → src/rules}/markdown/link-image-reference-definitions.d.ts +0 -0
  116. /package/dist/{rules → src/rules}/markdown/link-image-style.d.ts +0 -0
  117. /package/dist/{rules → src/rules}/markdown/list-indent.d.ts +0 -0
  118. /package/dist/{rules → src/rules}/markdown/list-marker-space.d.ts +0 -0
  119. /package/dist/{rules → src/rules}/markdown/no-alt-text.d.ts +0 -0
  120. /package/dist/{rules → src/rules}/markdown/no-bare-urls.d.ts +0 -0
  121. /package/dist/{rules → src/rules}/markdown/no-blanks-blockquote.d.ts +0 -0
  122. /package/dist/{rules → src/rules}/markdown/no-duplicate-heading.d.ts +0 -0
  123. /package/dist/{rules → src/rules}/markdown/no-emphasis-as-heading.d.ts +0 -0
  124. /package/dist/{rules → src/rules}/markdown/no-empty-links.d.ts +0 -0
  125. /package/dist/{rules → src/rules}/markdown/no-hard-tabs.d.ts +0 -0
  126. /package/dist/{rules → src/rules}/markdown/no-inline-html.d.ts +0 -0
  127. /package/dist/{rules → src/rules}/markdown/no-missing-space-atx.d.ts +0 -0
  128. /package/dist/{rules → src/rules}/markdown/no-missing-space-closed-atx.d.ts +0 -0
  129. /package/dist/{rules → src/rules}/markdown/no-multiple-blanks.d.ts +0 -0
  130. /package/dist/{rules → src/rules}/markdown/no-multiple-space-atx.d.ts +0 -0
  131. /package/dist/{rules → src/rules}/markdown/no-multiple-space-blockquote.d.ts +0 -0
  132. /package/dist/{rules → src/rules}/markdown/no-multiple-space-closed-atx.d.ts +0 -0
  133. /package/dist/{rules → src/rules}/markdown/no-reversed-links.d.ts +0 -0
  134. /package/dist/{rules → src/rules}/markdown/no-space-in-code.d.ts +0 -0
  135. /package/dist/{rules → src/rules}/markdown/no-space-in-emphasis.d.ts +0 -0
  136. /package/dist/{rules → src/rules}/markdown/no-space-in-links.d.ts +0 -0
  137. /package/dist/{rules → src/rules}/markdown/no-trailing-punctuation.d.ts +0 -0
  138. /package/dist/{rules → src/rules}/markdown/no-trailing-spaces.d.ts +0 -0
  139. /package/dist/{rules → src/rules}/markdown/ol-prefix.d.ts +0 -0
  140. /package/dist/{rules → src/rules}/markdown/proper-names.d.ts +0 -0
  141. /package/dist/{rules → src/rules}/markdown/reference-links-images.d.ts +0 -0
  142. /package/dist/{rules → src/rules}/markdown/required-headings.d.ts +0 -0
  143. /package/dist/{rules → src/rules}/markdown/single-title.d.ts +0 -0
  144. /package/dist/{rules → src/rules}/markdown/single-trailing-newline.d.ts +0 -0
  145. /package/dist/{rules → src/rules}/markdown/strong-style.d.ts +0 -0
  146. /package/dist/{rules → src/rules}/markdown/table-column-count.d.ts +0 -0
  147. /package/dist/{rules → src/rules}/markdown/table-column-style.d.ts +0 -0
  148. /package/dist/{rules → src/rules}/markdown/table-pipe-style.d.ts +0 -0
  149. /package/dist/{rules → src/rules}/markdown/ul-indent.d.ts +0 -0
  150. /package/dist/{rules → src/rules}/markdown/ul-style.d.ts +0 -0
  151. /package/dist/{rules → src/rules}/node/prefer-global-buffer.d.ts +0 -0
  152. /package/dist/{rules → src/rules}/node/prefer-global-process.d.ts +0 -0
  153. /package/dist/{rules → src/rules}/quality/complexity.d.ts +0 -0
  154. /package/dist/{rules → src/rules}/quality/default-case.d.ts +0 -0
  155. /package/dist/{rules → src/rules}/quality/eqeqeq.d.ts +0 -0
  156. /package/dist/{rules → src/rules}/quality/max-depth.d.ts +0 -0
  157. /package/dist/{rules → src/rules}/quality/max-lines-per-function.d.ts +0 -0
  158. /package/dist/{rules → src/rules}/quality/no-alert.d.ts +0 -0
  159. /package/dist/{rules → src/rules}/quality/no-await-in-loop.d.ts +0 -0
  160. /package/dist/{rules → src/rules}/quality/no-caller.d.ts +0 -0
  161. /package/dist/{rules → src/rules}/quality/no-case-declarations.d.ts +0 -0
  162. /package/dist/{rules → src/rules}/quality/no-else-return.d.ts +0 -0
  163. /package/dist/{rules → src/rules}/quality/no-empty-function.d.ts +0 -0
  164. /package/dist/{rules → src/rules}/quality/no-empty.d.ts +0 -0
  165. /package/dist/{rules → src/rules}/quality/no-eval.d.ts +0 -0
  166. /package/dist/{rules → src/rules}/quality/no-extend-native.d.ts +0 -0
  167. /package/dist/{rules → src/rules}/quality/no-extra-boolean-cast.d.ts +0 -0
  168. /package/dist/{rules → src/rules}/quality/no-global-assign.d.ts +0 -0
  169. /package/dist/{rules → src/rules}/quality/no-implied-eval.d.ts +0 -0
  170. /package/dist/{rules → src/rules}/quality/no-iterator.d.ts +0 -0
  171. /package/dist/{rules → src/rules}/quality/no-lonely-if.d.ts +0 -0
  172. /package/dist/{rules → src/rules}/quality/no-new-func.d.ts +0 -0
  173. /package/dist/{rules → src/rules}/quality/no-new-wrappers.d.ts +0 -0
  174. /package/dist/{rules → src/rules}/quality/no-new.d.ts +0 -0
  175. /package/dist/{rules → src/rules}/quality/no-octal.d.ts +0 -0
  176. /package/dist/{rules → src/rules}/quality/no-param-reassign.d.ts +0 -0
  177. /package/dist/{rules → src/rules}/quality/no-proto.d.ts +0 -0
  178. /package/dist/{rules → src/rules}/quality/no-return-assign.d.ts +0 -0
  179. /package/dist/{rules → src/rules}/quality/no-sequences.d.ts +0 -0
  180. /package/dist/{rules → src/rules}/quality/no-shadow.d.ts +0 -0
  181. /package/dist/{rules → src/rules}/quality/no-throw-literal.d.ts +0 -0
  182. /package/dist/{rules → src/rules}/quality/no-use-before-define.d.ts +0 -0
  183. /package/dist/{rules → src/rules}/quality/no-useless-call.d.ts +0 -0
  184. /package/dist/{rules → src/rules}/quality/no-useless-concat.d.ts +0 -0
  185. /package/dist/{rules → src/rules}/quality/no-useless-escape.d.ts +0 -0
  186. /package/dist/{rules → src/rules}/quality/no-useless-rename.d.ts +0 -0
  187. /package/dist/{rules → src/rules}/quality/no-useless-return.d.ts +0 -0
  188. /package/dist/{rules → src/rules}/quality/no-var.d.ts +0 -0
  189. /package/dist/{rules → src/rules}/quality/no-with.d.ts +0 -0
  190. /package/dist/{rules → src/rules}/quality/prefer-arrow-callback.d.ts +0 -0
  191. /package/dist/{rules → src/rules}/quality/require-await.d.ts +0 -0
  192. /package/dist/{rules → src/rules}/regexp/no-super-linear-backtracking.d.ts +0 -0
  193. /package/dist/{rules → src/rules}/regexp/no-unused-capturing-group.d.ts +0 -0
  194. /package/dist/{rules → src/rules}/regexp/no-useless-lazy.d.ts +0 -0
  195. /package/dist/{rules → src/rules}/shell/_shared.d.ts +0 -0
  196. /package/dist/{rules → src/rules}/shell/command-substitution.d.ts +0 -0
  197. /package/dist/{rules → src/rules}/shell/consistent-case-terminators.d.ts +0 -0
  198. /package/dist/{rules → src/rules}/shell/function-style.d.ts +0 -0
  199. /package/dist/{rules → src/rules}/shell/heredoc-indent.d.ts +0 -0
  200. /package/dist/{rules → src/rules}/shell/indent.d.ts +0 -0
  201. /package/dist/{rules → src/rules}/shell/keyword-spacing.d.ts +0 -0
  202. /package/dist/{rules → src/rules}/shell/no-broken-redirect.d.ts +0 -0
  203. /package/dist/{rules → src/rules}/shell/no-cd-without-check.d.ts +0 -0
  204. /package/dist/{rules → src/rules}/shell/no-eval.d.ts +0 -0
  205. /package/dist/{rules → src/rules}/shell/no-exit-in-subshell.d.ts +0 -0
  206. /package/dist/{rules → src/rules}/shell/no-ls-parsing.d.ts +0 -0
  207. /package/dist/{rules → src/rules}/shell/no-trailing-semicolons.d.ts +0 -0
  208. /package/dist/{rules → src/rules}/shell/no-trailing-whitespace.d.ts +0 -0
  209. /package/dist/{rules → src/rules}/shell/no-useless-cat.d.ts +0 -0
  210. /package/dist/{rules → src/rules}/shell/no-variable-in-single-quotes.d.ts +0 -0
  211. /package/dist/{rules → src/rules}/shell/operator-spacing.d.ts +0 -0
  212. /package/dist/{rules → src/rules}/shell/prefer-double-brackets.d.ts +0 -0
  213. /package/dist/{rules → src/rules}/shell/prefer-printf.d.ts +0 -0
  214. /package/dist/{rules → src/rules}/shell/quote-variables.d.ts +0 -0
  215. /package/dist/{rules → src/rules}/shell/set-options.d.ts +0 -0
  216. /package/dist/{rules → src/rules}/shell/shebang.d.ts +0 -0
  217. /package/dist/{rules → src/rules}/sort/exports.d.ts +0 -0
  218. /package/dist/{rules → src/rules}/sort/heritage-clauses.d.ts +0 -0
  219. /package/dist/{rules → src/rules}/sort/imports.d.ts +0 -0
  220. /package/dist/{rules → src/rules}/sort/keys.d.ts +0 -0
  221. /package/dist/{rules → src/rules}/sort/named-imports.d.ts +0 -0
  222. /package/dist/{rules → src/rules}/sort/objects.d.ts +0 -0
  223. /package/dist/{rules → src/rules}/sort/tailwind-classes.d.ts +0 -0
  224. /package/dist/{rules → src/rules}/style/array-bracket-spacing.d.ts +0 -0
  225. /package/dist/{rules → src/rules}/style/arrow-parens.d.ts +0 -0
  226. /package/dist/{rules → src/rules}/style/arrow-spacing.d.ts +0 -0
  227. /package/dist/{rules → src/rules}/style/block-spacing.d.ts +0 -0
  228. /package/dist/{rules → src/rules}/style/brace-style.d.ts +0 -0
  229. /package/dist/{rules → src/rules}/style/comma-dangle.d.ts +0 -0
  230. /package/dist/{rules → src/rules}/style/comma-spacing.d.ts +0 -0
  231. /package/dist/{rules → src/rules}/style/comma-style.d.ts +0 -0
  232. /package/dist/{rules → src/rules}/style/computed-property-spacing.d.ts +0 -0
  233. /package/dist/{rules → src/rules}/style/consistent-chaining.d.ts +0 -0
  234. /package/dist/{rules → src/rules}/style/consistent-list-newline.d.ts +0 -0
  235. /package/dist/{rules → src/rules}/style/curly.d.ts +0 -0
  236. /package/dist/{rules → src/rules}/style/dot-location.d.ts +0 -0
  237. /package/dist/{rules → src/rules}/style/function-call-spacing.d.ts +0 -0
  238. /package/dist/{rules → src/rules}/style/generator-star-spacing.d.ts +0 -0
  239. /package/dist/{rules → src/rules}/style/if-newline.d.ts +0 -0
  240. /package/dist/{rules → src/rules}/style/indent-binary-ops.d.ts +0 -0
  241. /package/dist/{rules → src/rules}/style/indent-unindent.d.ts +0 -0
  242. /package/dist/{rules → src/rules}/style/key-spacing.d.ts +0 -0
  243. /package/dist/{rules → src/rules}/style/keyword-spacing.d.ts +0 -0
  244. /package/dist/{rules → src/rules}/style/lines-between-class-members.d.ts +0 -0
  245. /package/dist/{rules → src/rules}/style/max-statements-per-line.d.ts +0 -0
  246. /package/dist/{rules → src/rules}/style/multiline-ternary.d.ts +0 -0
  247. /package/dist/{rules → src/rules}/style/new-parens.d.ts +0 -0
  248. /package/dist/{rules → src/rules}/style/no-extra-parens.d.ts +0 -0
  249. /package/dist/{rules → src/rules}/style/no-floating-decimal.d.ts +0 -0
  250. /package/dist/{rules → src/rules}/style/no-mixed-operators.d.ts +0 -0
  251. /package/dist/{rules → src/rules}/style/no-mixed-spaces-and-tabs.d.ts +0 -0
  252. /package/dist/{rules → src/rules}/style/no-multi-spaces.d.ts +0 -0
  253. /package/dist/{rules → src/rules}/style/no-multiple-empty-lines.d.ts +0 -0
  254. /package/dist/{rules → src/rules}/style/no-tabs.d.ts +0 -0
  255. /package/dist/{rules → src/rules}/style/no-trailing-spaces.d.ts +0 -0
  256. /package/dist/{rules → src/rules}/style/no-whitespace-before-property.d.ts +0 -0
  257. /package/dist/{rules → src/rules}/style/object-curly-spacing.d.ts +0 -0
  258. /package/dist/{rules → src/rules}/style/operator-linebreak.d.ts +0 -0
  259. /package/dist/{rules → src/rules}/style/padded-blocks.d.ts +0 -0
  260. /package/dist/{rules → src/rules}/style/quote-props.d.ts +0 -0
  261. /package/dist/{rules → src/rules}/style/rest-spread-spacing.d.ts +0 -0
  262. /package/dist/{rules → src/rules}/style/semi-spacing.d.ts +0 -0
  263. /package/dist/{rules → src/rules}/style/space-before-blocks.d.ts +0 -0
  264. /package/dist/{rules → src/rules}/style/space-before-function-paren.d.ts +0 -0
  265. /package/dist/{rules → src/rules}/style/space-in-parens.d.ts +0 -0
  266. /package/dist/{rules → src/rules}/style/space-infix-ops.d.ts +0 -0
  267. /package/dist/{rules → src/rules}/style/space-unary-ops.d.ts +0 -0
  268. /package/dist/{rules → src/rules}/style/spaced-comment.d.ts +0 -0
  269. /package/dist/{rules → src/rules}/style/switch-colon-spacing.d.ts +0 -0
  270. /package/dist/{rules → src/rules}/style/template-curly-spacing.d.ts +0 -0
  271. /package/dist/{rules → src/rules}/style/template-tag-spacing.d.ts +0 -0
  272. /package/dist/{rules → src/rules}/style/top-level-function.d.ts +0 -0
  273. /package/dist/{rules → src/rules}/style/wrap-iife.d.ts +0 -0
  274. /package/dist/{rules → src/rules}/style/yield-star-spacing.d.ts +0 -0
  275. /package/dist/{rules → src/rules}/ts/member-delimiter-style.d.ts +0 -0
  276. /package/dist/{rules → src/rules}/ts/no-explicit-any.d.ts +0 -0
  277. /package/dist/{rules → src/rules}/ts/no-floating-promises.d.ts +0 -0
  278. /package/dist/{rules → src/rules}/ts/no-misused-promises.d.ts +0 -0
  279. /package/dist/{rules → src/rules}/ts/no-require-imports.d.ts +0 -0
  280. /package/dist/{rules → src/rules}/ts/no-top-level-await.d.ts +0 -0
  281. /package/dist/{rules → src/rules}/ts/no-ts-export-equal.d.ts +0 -0
  282. /package/dist/{rules → src/rules}/ts/no-unsafe-assignment.d.ts +0 -0
  283. /package/dist/{rules → src/rules}/ts/prefer-nullish-coalescing.d.ts +0 -0
  284. /package/dist/{rules → src/rules}/ts/prefer-optional-chain.d.ts +0 -0
  285. /package/dist/{rules → src/rules}/ts/type-annotation-spacing.d.ts +0 -0
  286. /package/dist/{rules → src/rules}/ts/type-generic-spacing.d.ts +0 -0
  287. /package/dist/{rules → src/rules}/ts/type-named-tuple-spacing.d.ts +0 -0
  288. /package/dist/{run.d.ts → src/run.d.ts} +0 -0
  289. /package/dist/{types.d.ts → src/types.d.ts} +0 -0
  290. /package/dist/{utils.d.ts → src/utils.d.ts} +0 -0
@@ -0,0 +1,156 @@
1
+ // @bun
2
+ import"./chunk-cfytsdab.js";import{existsSync as It}from"fs";import de from"fs/promises";import ke from"os";import fe from"path";import G from"process";import{EventEmitter as Ot}from"events";import P from"process";import Ve from"process";import we from"process";import ae from"process";import Ne from"process";import Z from"process";import Re from"tty";import rt,{stdin as hs,stdout as ms}from"process";import*as U from"readline";import{ReadStream as je,WriteStream as ds}from"tty";import Le,{stdin as ys,stdout as bs}from"process";import xs from"readline";import Es from"process";import Rs from"process";import{WriteStream as js}from"tty";import Ws from"process";import Te from"process";import Fs from"process";import{stripVTControlCharacters as ge}from"util";import{existsSync as Us,lstatSync as Fe,readdirSync as Gs}from"fs";import{dirname as He,join as Ks}from"path";import qs from"process";import A from"process";import ee from"process";import{stripVTControlCharacters as $e}from"util";import Ys from"process";import{Buffer as Ke}from"buffer";import j from"fs/promises";import Js from"os";import le from"path";import x from"process";import{Readable as Qs,Writable as Xs}from"stream";class qe{configPath;config=null;events=[];retryCount=0;maxRetries=3;retryDelayMs=1000;constructor(){let e=ke.homedir(),t=fe.join(e,".config","clapp");this.configPath=fe.join(t,"telemetry.json")}async isEnabled(){if(G.env.DO_NOT_TRACK==="1"||G.env.DO_NOT_TRACK==="true")return!1;if(G.env.NO_TELEMETRY==="1"||G.env.NO_TELEMETRY==="true")return!1;return(await this.loadConfig()).enabled}async enable(){let e=await this.loadConfig();if(e.enabled=!0,!e.userId)e.userId=this.generateUserId();await this.saveConfig(e)}async disable(){let e=await this.loadConfig();e.enabled=!1,await this.saveConfig(e)}async track(e,t){if(!await this.isEnabled())return;let i={event:e,...t,timestamp:Date.now(),platform:ke.platform(),nodeVersion:G.version};if(this.events.push(i),this.events.length>=10)await this.send()}async trackCommand(e,t){await this.track("command",{command:e,duration:t})}async trackError(e,t){await this.track("error",{error:e,command:t})}async send(){if(!await this.isEnabled()||this.events.length===0)return!0;try{this.events=[],this.retryCount=0;let t=await this.loadConfig();return t.lastSent=Date.now(),await this.saveConfig(t),!0}catch{if(this.retryCount<this.maxRetries){this.retryCount++;let t=this.retryDelayMs*2**(this.retryCount-1);return await this.sleep(t),this.send()}return this.events=[],this.retryCount=0,!1}}async flush(){if(this.events.length===0)return!0;return this.send()}sleep(e){return new Promise((t)=>setTimeout(t,e))}async status(){let e=await this.loadConfig();return{enabled:e.enabled,doNotTrack:G.env.DO_NOT_TRACK==="1"||G.env.DO_NOT_TRACK==="true",eventsQueued:this.events.length,lastSent:e.lastSent}}async loadConfig(){if(this.config)return this.config;try{if(It(this.configPath)){let e=await de.readFile(this.configPath,"utf-8");return this.config=JSON.parse(e),this.config}}catch{}return this.config={enabled:!1},this.config}async saveConfig(e){this.config=e;try{let t=fe.dirname(this.configPath);await de.mkdir(t,{recursive:!0}),await de.writeFile(this.configPath,JSON.stringify(e,null,2),"utf-8")}catch{}}generateUserId(){let e=Math.random().toString(36).substring(2,15),t=Date.now().toString(36);return`${e}-${t}`}}var oi=new qe;function Et(e,t={}){let s={_:[]},i=t.alias||{},r=new Set(t.boolean||[]),o={};for(let u of Object.keys(i))for(let a of i[u])o[a]=u;for(let u of r)if(i[u])for(let a of i[u])r.add(a);function l(u,a){let c=o[u]||u;if(s[c]=a,i[c])for(let h of i[c])s[h]=a;if(o[u]&&i[o[u]])for(let h of i[o[u]])s[h]=a;s[u]=a}for(let u=0;u<e.length;u++){let a=e[u];if(a==="--"){s._.push(...e.slice(u+1));break}if(a.startsWith("--")){let c=a.indexOf("=");if(c!==-1){let h=a.slice(2,c),f=a.slice(c+1);l(h,f)}else{let h=a.slice(2);if(h.startsWith("no-")){let p=h.slice(3);l(p,!1);continue}let f=o[h]||h;if(r.has(f)||r.has(h))l(h,!0);else{let p=e[u+1];if(p!==void 0&&!p.startsWith("-"))l(h,p),u++;else l(h,!0)}}}else if(a.startsWith("-")&&a.length>1){let c=a.slice(1);for(let h=0;h<c.length;h++){let f=c[h],p=o[f]||f;if(h===c.length-1&&!r.has(p)&&!r.has(f)){let d=e[u+1];if(d!==void 0&&!d.startsWith("-"))l(f,d),u++;else l(f,!0)}else l(f,!0)}}else s._.push(a)}return s}function ve(e){return e.replace(/[<[].+/,"").trim()}function Bt(e){let t=/<([^>]+)>/g,s=/\[([^\]]+)\]/g,i=[],r=(u)=>{let a=!1,c=u[1];if(c.startsWith("..."))c=c.slice(3),a=!0;return{required:u[0].startsWith("<"),value:c,variadic:a}},o;while(o=t.exec(e))i.push(r(o));let l;while(l=s.exec(e))i.push(r(l));return i}function Tt(e){let t={alias:{},boolean:[]};for(let[s,i]of e.entries()){if(i.names.length>1)t.alias[i.names[0]]=i.names.slice(1);if(i.isBoolean)if(i.negated){if(!e.some((o,l)=>l!==s&&o.names.some((u)=>i.names.includes(u))&&typeof o.required==="boolean"))t.boolean.push(i.names[0])}else t.boolean.push(i.names[0])}return t}function Me(e){return e.reduce((t,s)=>t.length>=s.length?t:s,"")}function pe(e,t){return e.length>=t?e:`${e}${" ".repeat(t-e.length)}`}function kt(e){return e.replace(/([a-z])-([a-z])/g,(t,s,i)=>s+i.toUpperCase())}function Vt(e,t,s){let i=0,r=t.length,o=e,l;for(;i<r;++i)l=o[t[i]],o=o[t[i]]=i===r-1?s:l!=null?l:!!~t[i+1].indexOf(".")||!(+t[i+1]>-1)?{}:[]}function Mt(e,t){for(let s of Object.keys(t)){let i=t[s];if(i.shouldTransform){if(e[s]=Array.prototype.concat.call([],e[s]),typeof i.transformFunction==="function")e[s]=e[s].map(i.transformFunction)}}}function At(e){let t=/([^\\/]+)$/.exec(e);return t?t[1]:""}function ze(e){return e.split(".").map((t,s)=>s===0?kt(t):t).join(".")}class oe extends Error{exitCode=2;isUsageError=!0;constructor(e){super(e);if(this.name=this.constructor.name,typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error(e).stack}format(e=!1){if(e&&this.stack)return`${this.message}
3
+
4
+ Stack trace:
5
+ ${this.stack}`;return this.message}}function Nt(){let{env:e}=Ve,{TERM:t,TERM_PROGRAM:s}=e;if(Ve.platform!=="win32")return t!=="linux";return Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||e.ConEmuTask==="{cmd::Cmder}"||s==="Terminus-Sublime"||s==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ue="\x1B",S=`${ue}[`,ci="\x07",k={to(e,t){if(!t)return`${S}${e+1}G`;return`${S}${t+1};${e+1}H`},move(e,t){let s="";if(e<0)s+=`${S}${-e}D`;else if(e>0)s+=`${S}${e}C`;if(t<0)s+=`${S}${-t}A`;else if(t>0)s+=`${S}${t}B`;return s},up:(e=1)=>`${S}${e}A`,down:(e=1)=>`${S}${e}B`,forward:(e=1)=>`${S}${e}C`,backward:(e=1)=>`${S}${e}D`,nextLine:(e=1)=>`${S}E`.repeat(e),prevLine:(e=1)=>`${S}F`.repeat(e),left:`${S}G`,hide:`${S}?25l`,show:`${S}?25h`,save:`${ue}7`,restore:`${ue}8`},hi={up:(e=1)=>`${S}S`.repeat(e),down:(e=1)=>`${S}T`.repeat(e)},te={screen:`${S}2J`,up:(e=1)=>`${S}1J`.repeat(e),down:(e=1)=>`${S}J`.repeat(e),line:`${S}2K`,lineEnd:`${S}K`,lineStart:`${S}1K`,lines(e){let t="";for(let s=0;s<e;s++)t+=this.line+(s<e-1?k.up():"");if(e)t+=k.left;return t}},mi={screen:`${ue}c`};function Rt(e,t){let s=[];for(let i=0;i<=t.length;i++)s[i]=[i];for(let i=0;i<=e.length;i++)s[0][i]=i;for(let i=1;i<=t.length;i++)for(let r=1;r<=e.length;r++)if(t.charAt(i-1)===e.charAt(r-1))s[i][r]=s[i-1][r-1];else s[i][r]=Math.min(s[i-1][r-1]+1,s[i][r-1]+1,s[i-1][r]+1);return s[t.length][e.length]}function Ye(e,t,s=2,i=3){return t.map((r)=>({cmd:r,distance:Rt(e,r)})).filter(({distance:r})=>r<=s).sort((r,o)=>r.distance-o.distance).slice(0,i).map(({cmd:r})=>r)}class Je{rawName;description;name;names;isBoolean;required;config;negated;constructor(e,t,s){if(this.rawName=e,this.description=t,this.config=Object.assign({},s),e=e.replace(/\.\*/g,""),this.negated=!1,this.names=ve(e).split(",").map((i)=>{let r=i.trim().replace(/^-{1,2}/,"");if(r.startsWith("no-"))this.negated=!0,r=r.replace(/^no-/,"");return ze(r)}).sort((i,r)=>i.length>r.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(e.includes("<"))this.required=!0;else if(e.includes("["))this.required=!1;else this.isBoolean=!0}}var fi=we.argv,jt=`${we.platform}-${we.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,Ae=ae.argv,Lt=`${ae.platform}-${ae.arch} node-${ae.version}`;class _e{rawName;description;config;cli;options;aliasNames;name;namespace;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;beforeHooks;afterHooks;middleware;constructor(e,t,s,i){this.rawName=e,this.description=t,this.config=s,this.cli=i,this.options=[],this.aliasNames=[],this.name=ve(e);let r=ve(e),o=r.indexOf(":");if(o>0)this.namespace=r.substring(0,o),this.name=r.substring(o+1);if(this.args=Bt(e),this.examples=[],this.beforeHooks=[],this.afterHooks=[],this.middleware=[],!s)this.config={}}usage(e){return this.usageText=e,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(e,t="-v, --version"){return this.versionNumber=e,this.option(t,"Display version number"),this}example(e){return this.examples.push(e),this}option(e,t,s){let i=new Je(e,t,s);return this.options.push(i),this}alias(e){return this.aliasNames.push(e),this}action(e){return this.commandAction=e,this}before(e){return this.beforeHooks.push(e),this}after(e){return this.afterHooks.push(e),this}use(e){return this.middleware.push(e),this}isMatched(e){if(this.aliasNames.includes(e))return!0;if(this.namespace)return`${this.namespace}:${this.name}`===e;return this.name===e}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof Ie}get displayName(){return this.namespace?`${this.namespace}:${this.name}`:this.name}hasOption(e){return e=e.split(".")[0],!!this.options.find((t)=>t.names.includes(e))}outputHelp(){let{name:e,commands:t}=this.cli,{versionNumber:s,options:i,helpCallback:r}=this.cli.globalCommand,o=[{body:`${e}${s?`/${s}`:""}`}];if(o.push({title:"Usage",body:` $ ${e} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&t.length>0){let a=Me(t.map((d)=>d.rawName)),c=new Map,h=[];for(let d of t)if(d.namespace){if(!c.has(d.namespace))c.set(d.namespace,[]);c.get(d.namespace).push(d)}else h.push(d);let f="";if(h.length>0)f+=h.map((d)=>` ${pe(d.rawName,a.length)} ${d.description}`).join(`
6
+ `);let p=Array.from(c.keys()).sort();for(let d of p){let v=c.get(d);if(f.length>0)f+=`
7
+
8
+ `;f+=` ${d}:
9
+ `,f+=v.map((y)=>` ${pe(y.rawName,a.length-2)} ${y.description}`).join(`
10
+ `)}o.push({title:"Commands",body:f}),o.push({title:"For more info, run any command with the `--help` flag",body:t.map((d)=>` $ ${e}${d.displayName===""?"":` ${d.displayName}`} --help`).join(`
11
+ `)})}let u=this.isGlobalCommand?i:[...this.options,...i||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand)u=u.filter((a)=>a.name!=="version");if(u.length>0){let a=Me(u.map((c)=>c.rawName));o.push({title:"Options",body:u.map((c)=>` ${pe(c.rawName,a.length)} ${c.description} ${c.config.default===void 0?"":`(default: ${c.config.default})`}`).join(`
12
+ `)})}if(this.examples.length>0)o.push({title:"Examples",body:this.examples.map((a)=>{if(typeof a==="function")return a(e);return a}).join(`
13
+ `)});if(r)o=r(o)||o;console.log(o.map((a)=>a.title?`${a.title}:
14
+ ${a.body}`:a.body).join(`
15
+
16
+ `))}outputVersion(){let{name:e}=this.cli,{versionNumber:t}=this.cli.globalCommand;if(t)console.log(`${e}/${t} ${typeof Bun<"u"?jt:Lt}`)}checkRequiredArgs(){let e=this.args.filter((t)=>t.required).length;if(this.cli.args.length<e){let s=this.args.filter((r)=>r.required).slice(this.cli.args.length),i=s.map((r)=>`<${r.value}>`).join(" ");throw new oe(`Missing required argument${s.length>1?"s":""}: ${i}
17
+
18
+ Run \`${this.cli.name} ${this.rawName} --help\` for usage information.`)}}checkUnknownOptions(){let{options:e,globalCommand:t}=this.cli;if(!this.config.allowUnknownOptions){for(let s of Object.keys(e))if(s!=="--"&&!this.hasOption(s)&&!t.hasOption(s)){let r=[...t.options,...this.options].flatMap((a)=>a.names),o=s.length>1?`--${s}`:`-${s}`,l=Ye(s,r),u=`Unknown option \`${o}\``;if(l.length>0)u+=`
19
+
20
+ Did you mean one of these?`,l.forEach((a)=>{let c=a.length>1?`--${a}`:`-${a}`;u+=`
21
+ \u2022 ${c}`});throw u+=`
22
+
23
+ Run \`${this.cli.name} ${this.rawName} --help\` to see available options.`,new oe(u)}}}checkOptionValue(){let{options:e,globalCommand:t}=this.cli,s=[...t.options,...this.options];for(let i of s){let r=e[i.name.split(".")[0]];if(i.required){let o=s.some((l)=>l.negated&&l.names.includes(i.name));if(r===!0||r===!1&&!o)throw new oe(`Option \`${i.rawName}\` requires a value.
24
+
25
+ Example: ${this.cli.name} ${this.rawName} ${i.rawName} <value>`)}}}}class Ie extends _e{constructor(e){super("@@global@@","",{},e)}}var Dt=_e,F={red:["\x1B[31m","\x1B[39m"],green:["\x1B[32m","\x1B[39m"],blue:["\x1B[34m","\x1B[39m"],yellow:["\x1B[33m","\x1B[39m"],cyan:["\x1B[36m","\x1B[39m"],magenta:["\x1B[35m","\x1B[39m"],white:["\x1B[37m","\x1B[39m"],gray:["\x1B[90m","\x1B[39m"],bgRed:["\x1B[41m","\x1B[49m"],bgGreen:["\x1B[42m","\x1B[49m"],bgBlue:["\x1B[44m","\x1B[49m"],bgYellow:["\x1B[43m","\x1B[49m"],bgCyan:["\x1B[46m","\x1B[49m"],bgMagenta:["\x1B[45m","\x1B[49m"],bold:["\x1B[1m","\x1B[22m"],italic:["\x1B[3m","\x1B[23m"],underline:["\x1B[4m","\x1B[24m"],dim:["\x1B[2m","\x1B[22m"],inverse:["\x1B[7m","\x1B[27m"],hidden:["\x1B[8m","\x1B[28m"],strikethrough:["\x1B[9m","\x1B[29m"]},ye={default:{primary:"blue",secondary:"cyan",success:"green",warning:"yellow",error:"red",info:"magenta",muted:"gray"},dracula:{primary:"magenta",secondary:"cyan",success:"green",warning:"yellow",error:"red",info:"blue",muted:"gray"},nord:{primary:"blue",secondary:"cyan",success:"green",warning:"yellow",error:"red",info:"cyan",muted:"gray"},solarized:{primary:"cyan",secondary:"blue",success:"green",warning:"yellow",error:"red",info:"magenta",muted:"gray"},monokai:{primary:"magenta",secondary:"blue",success:"green",warning:"yellow",error:"red",info:"cyan",muted:"gray"}},J={primary:"blue",secondary:"cyan",success:"green",warning:"yellow",error:"red",info:"magenta",muted:"gray"};function Wt(){return!0}function Pt(){let e={};e.supportsColor=Wt();function t(i,r=[]){let o=i===""?[]:[...r,i],l=function(a){if(!e.supportsColor)return a;let c="",h="";for(let f of o)if(f in J&&J[f]in F){let p=J[f];c+=F[p][0],h=F[p][1]+h}else if(f in F)c+=F[f][0],h=F[f][1]+h;return c+a+h},u=[...Object.keys(F),...Object.keys(J)];for(let a of u)if(!(a in l))Object.defineProperty(l,a,{get(){return t(a,o)}});return l}let s=[...Object.keys(F),...Object.keys(J)];for(let i of s)if(!(i in e))Object.defineProperty(e,i,{get(){return t(i)}});return e}var K=Pt();function Ft(e){for(let t in e)if(e[t]!==void 0)J[t]=e[t]}function gi(e){if(e in ye)Ft(ye[e])}function $i(){return Object.keys(ye)}function vi(e){if(e.colors!==void 0)K.supportsColor=e.colors}function wi(e,t){let s=t?.title?` ${t.title} `:"",i=t?.padding||0,r=" ".repeat(i),o=e.split(`
26
+ `),u=Math.max(...o.map((c)=>c.length))+i*2,a=u;console.log(`\u250C${s?"\u2500".repeat(Math.floor((a-s.length)/2))+s+"\u2500".repeat(Math.ceil((a-s.length)/2)):"\u2500".repeat(a)}\u2510`),console.log(`\u2502${" ".repeat(a)}\u2502`);for(let c of o){let h=u-c.length-i;console.log(`\u2502${r}${c}${" ".repeat(h)}\u2502`)}console.log(`\u2502${" ".repeat(a)}\u2502`),console.log(`\u2514${"\u2500".repeat(a)}\u2518`)}function yi(e){let t=e?.title?` ${e.title} `:"",i=e.content.split(`
27
+ `),o=Math.max(...i.map((l)=>l.length))+2;console.log(`\u2554${t?"\u2550".repeat(Math.floor((o-t.length)/2))+t+"\u2550".repeat(Math.ceil((o-t.length)/2)):"\u2550".repeat(o)}\u2557`),console.log(`\u2551${" ".repeat(o)}\u2551`);for(let l of i){let u=o-l.length-1;console.log(`\u2551 ${l}${" ".repeat(u)}\u2551`)}console.log(`\u2551${" ".repeat(o)}\u2551`),console.log(`\u255A${"\u2550".repeat(o)}\u255D`)}function bi(e,t){if(!e||e.length===0)return;let s=Array.from({length:e[0].length},()=>0);for(let r of e)for(let o=0;o<r.length;o++)s[o]=Math.max(s[o],String(r[o]).length);if(t?.border)console.log(`\u250C${s.map((r)=>"\u2500".repeat(r+2)).join("\u252C")}\u2510`);if(t?.header&&e.length>0)if(console.log((t.border?"\u2502 ":"")+e[0].map((r,o)=>`${r}${" ".repeat(s[o]-String(r).length)}`).join(" \u2502 ")+(t.border?" \u2502":"")),t.border)console.log(`\u251C${s.map((r)=>"\u2500".repeat(r+2)).join("\u253C")}\u2524`);else console.log(`${s.map((r)=>"\u2500".repeat(r)).join("\u2500\u253C\u2500")}`);let i=t?.header?1:0;for(let r=i;r<e.length;r++)console.log((t?.border?"\u2502 ":"")+e[r].map((o,l)=>`${o}${" ".repeat(s[l]-String(o).length)}`).join(" \u2502 ")+(t?.border?" \u2502":""));if(t?.border)console.log(`\u2514${s.map((r)=>"\u2500".repeat(r+2)).join("\u2534")}\u2518`)}class Qe extends Ot{name;commands;globalCommand;matchedCommand;matchedCommandName;rawArgs;args;options;showHelpOnExit;showVersionOnExit;enableDidYouMean=!0;signalHandlersSet=!1;isVerbose=!1;isQuiet=!1;isDebug=!1;isNoInteraction=!1;environment;isDryRun=!1;isForce=!1;useEmoji=!0;theme;isNoCache=!1;constructor(e=""){super();this.name=e,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new Ie(this),this.globalCommand.usage("<command> [options]")}handleSignals(e){if(this.signalHandlersSet)return this;let t=async(s)=>{if(console.log(`
28
+
29
+ Received ${s}, cleaning up...`),e)try{await e()}catch(i){console.error("Error during cleanup:",i)}P.exit(0)};return P.on("SIGINT",()=>t("SIGINT")),P.on("SIGTERM",()=>t("SIGTERM")),this.signalHandlersSet=!0,this}didYouMean(e=!0){return this.enableDidYouMean=e,this}verbose(){return this.globalCommand.option("-v, --verbose","Enable verbose output"),this}quiet(){return this.globalCommand.option("-q, --quiet","Suppress non-essential output"),this}debug(){return this.globalCommand.option("--debug","Enable debug mode with detailed error information"),this}noInteraction(){return this.globalCommand.option("-n, --no-interaction","Do not ask any interactive questions (for CI/CD)"),this}env(){return this.globalCommand.option("--env <environment>","Target environment (e.g., production, staging, local)"),this}dryRun(){return this.globalCommand.option("--dry-run","Preview actions without executing them"),this}force(){return this.globalCommand.option("-f, --force","Skip confirmation prompts"),this}emoji(){return this.globalCommand.option("--no-emoji","Disable emoji in output"),this}themes(){return this.globalCommand.option("--theme <theme>","Color theme (default, dracula, nord, solarized, monokai)"),this}cache(){return this.globalCommand.option("--no-cache","Disable caching"),this}usage(e){return this.globalCommand.usage(e),this}command(e,t,s){if(!s)s={};let i=new Dt(e,t||"",s,this);return i.globalCommand=this.globalCommand,this.commands.push(i),i}option(e,t,s){return this.globalCommand.option(e,t,s),this}help(e){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=e,this.showHelpOnExit=!0,this}version(e,t="-v, --version"){return this.globalCommand.version(e,t),this.showVersionOnExit=!0,this}example(e){return this.globalCommand.example(e),this}outputHelp(){if(this.matchedCommand)this.matchedCommand.outputHelp();else this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:e,options:t},s,i){if(this.args=e,this.options=t,s)this.matchedCommand=s;if(i)this.matchedCommandName=i;return this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}showCommandNotFound(e){if(console.log(K.red(`
30
+ \u2717 Command "${e}" not found.
31
+ `)),this.enableDidYouMean){let t=[];for(let i of this.commands){if(i.displayName)t.push(i.displayName);if(i.aliasNames)t.push(...i.aliasNames)}let s=Ye(e,t);if(s.length>0)console.log(K.yellow("Did you mean one of these?")),s.forEach((i)=>console.log(` ${K.dim("\u2022")} ${this.name} ${i}`)),console.log("")}console.log(K.dim("Run"),`${this.name} --help`,K.dim("to see all available commands")),P.exit(1)}async parse(e=Ae,t={}){let{run:s=!0,exitOnError:i=!1}=t;if(i)try{return await this.parse(e,{run:s})}catch(a){throw this.handleUsageError(a),a}if(this.rawArgs=e,!this.name)this.name=e[1]?At(e[1]):"cli";let r=!0,o=e.slice(2),l=o[0];if(l&&!l.startsWith("-")){for(let a of this.commands)if(a.isMatched(l)){let c=this.mri(o,a);r=!1;let h={...c,args:c.args.slice(1)};this.setParsedInfo(h,a,l),this.emit(`command:${l}`,a);break}}if(r){for(let a of this.commands)if(a.name===""){r=!1;let c=this.mri(o,a);this.setParsedInfo(c,a),this.emit("command:!",a);break}}if(r){let a=this.mri(e.slice(2));this.setParsedInfo(a)}if(this.options.verbose)this.isVerbose=!0;if(this.options.quiet)this.isQuiet=!0;if(this.options.debug)this.isDebug=!0;if(this.options.noInteraction)this.isNoInteraction=!0;if(this.options.env)this.environment=String(this.options.env);if(this.options.dryRun)this.isDryRun=!0;if(this.options.force)this.isForce=!0;if(this.options.noEmoji!==void 0)this.useEmoji=!this.options.noEmoji;if(this.options.theme)this.theme=String(this.options.theme);if(this.options.noCache!==void 0)this.isNoCache=Boolean(this.options.noCache);if(this.options.help&&this.showHelpOnExit)this.outputHelp(),s=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),s=!1,this.unsetMatchedCommand();let u={args:this.args,options:this.options};if(s)await this.runMatchedCommand();if(!this.matchedCommand&&this.args[0]){if(this.emit("command:*"),!(this.listenerCount("command:*")>0))this.showCommandNotFound(this.args[0])}return u}mri(e,t){let s=[...this.globalCommand.options,...t?t.options:[]],i=Tt(s),r=[],o=e.indexOf("--");if(o>-1)r=e.slice(o+1),e=e.slice(0,o);let l=Et(e,i),u={_:l._};for(let p of Object.keys(l))if(p!=="_")u[ze(p)]=l[p];let a=u._,c={"--":r},h=t&&t.config.ignoreOptionDefaultValue?t.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,f=Object.create(null);for(let p of s){if(!h&&p.config.default!==void 0)for(let d of p.names)c[d]=p.config.default;if(Array.isArray(p.config.type)){if(f[p.name]===void 0)f[p.name]={shouldTransform:!0,transformFunction:p.config.type[0]}}}for(let p of Object.keys(u))if(p!=="_"){let d=p.split(".");Vt(c,d,u[p]),Mt(c,f)}return{args:a,options:c}}async run(e=Ae){return this.parse(e,{run:!0,exitOnError:!0})}handleUsageError(e){if(!(!!e&&typeof e==="object"&&e.name==="ClappError"&&e.isUsageError!==!1))return;let i=e,r=i.message??"command-line error",o=this.name?`${this.name}: `:"",l=/--help/.test(r)?"":`
32
+ Run \`${this.name??"cli"} --help\` for usage.`;P.stderr.write(`${o}${r}${l}
33
+ `),P.exit(i.exitCode??2)}async runMatchedCommand(){let{args:e,options:t,matchedCommand:s}=this;if(!s||!s.commandAction)return;s.checkUnknownOptions(),s.checkOptionValue(),s.checkRequiredArgs();let i=[];s.args.forEach((u,a)=>{if(u.variadic)i.push(e.slice(a));else i.push(e[a])}),i.push(t);let r={command:s,args:i,options:t};for(let u of s.beforeHooks)await u(r);let o,l=async()=>{let u=s.commandAction.apply(this,i);if(u instanceof Promise)o=await u;else o=u;return o};if(s.middleware.length>0){let u=0,a=async()=>{if(u<s.middleware.length){let c=s.middleware[u++];await c({...r,next:a})}else await l()};await a()}else await l();for(let u of s.afterHooks)await u(r);return o}removeSignalHandlers(){if(!this.signalHandlersSet)return this;return P.removeAllListeners("SIGINT"),P.removeAllListeners("SIGTERM"),this.signalHandlersSet=!1,this}destroy(){this.removeSignalHandlers(),this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.matchedCommand=void 0,this.matchedCommandName=void 0,this.removeAllListeners()}}var Xe=(e="")=>new Qe(e);class Ze{cache;enabled;cleanupInterval=null;hits=0;misses=0;constructor(){this.cache=new Map,this.enabled=!0,this.startCleanupInterval()}startCleanupInterval(){if(this.cleanupInterval)return;this.cleanupInterval=setInterval(()=>{this.cleanup()},30000),this.cleanupInterval.unref()}stopCleanup(){if(this.cleanupInterval)clearInterval(this.cleanupInterval),this.cleanupInterval=null}isEnabled(){return this.enabled}get(e){if(!this.enabled){this.misses++;return}let t=this.cache.get(e);if(!t){this.misses++;return}if(Date.now()-t.timestamp>t.ttl){this.cache.delete(e),this.misses++;return}return this.hits++,t.value}set(e,t,s=5000){if(!this.enabled)return;this.cache.set(e,{value:t,timestamp:Date.now(),ttl:s})}has(e){if(!this.enabled)return!1;let t=this.cache.get(e);if(!t)return!1;if(Date.now()-t.timestamp>t.ttl)return this.cache.delete(e),!1;return!0}delete(e){this.cache.delete(e)}clear(){this.cache.clear()}disable(){this.enabled=!1,this.clear()}enable(){this.enabled=!0}stats(){return{size:this.cache.size,enabled:this.enabled,hits:this.hits,misses:this.misses}}resetStats(){this.hits=0,this.misses=0}keys(){return Array.from(this.cache.keys())}cleanup(){let e=Date.now();for(let[t,s]of this.cache.entries())if(e-s.timestamp>s.ttl)this.cache.delete(t)}destroy(){this.stopCleanup(),this.clear(),this.resetStats()}}var xi=new Ze;function Si(e,t){e.on(`${t}:*`,()=>{let s=e.args??[];Ne.stderr.write(`Unknown ${t} subcommand: ${[...s].join(" ")}
34
+ Run \`${e.name??"cli"} ${t} --help\` to see available subcommands.
35
+ `),Ne.exit(64)})}function Ht(){if("FORCE_COLOR"in Z.env)return Z.env.FORCE_COLOR!=="0";if("NO_COLOR"in Z.env||Z.env.TERM==="dumb")return!1;if(Z.platform==="win32")return!0;return Re.isatty(1)&&Re.isatty(2)}var et=Ht();function _(e,t){if(!et)return(s)=>s;return(s)=>e+s+t}var Ut=_("\x1B[0m","\x1B[0m"),Gt=_("\x1B[31m","\x1B[39m"),tt=_("\x1B[32m","\x1B[39m"),Kt=_("\x1B[33m","\x1B[39m"),qt=_("\x1B[34m","\x1B[39m"),zt=_("\x1B[35m","\x1B[39m"),Yt=_("\x1B[36m","\x1B[39m"),Jt=_("\x1B[37m","\x1B[39m"),st=_("\x1B[90m","\x1B[39m"),it=_("\x1B[1m","\x1B[22m"),Qt=_("\x1B[3m","\x1B[23m"),Xt=_("\x1B[4m","\x1B[24m"),nt=_("\x1B[2m","\x1B[22m"),Zt=_("\x1B[7m","\x1B[27m"),es=_("\x1B[8m","\x1B[28m"),ts=_("\x1B[9m","\x1B[29m"),ss=_("\x1B[41m","\x1B[49m"),is=_("\x1B[42m","\x1B[49m"),ns=_("\x1B[43m","\x1B[49m"),rs=_("\x1B[44m","\x1B[49m"),os=_("\x1B[45m","\x1B[49m"),as=_("\x1B[46m","\x1B[49m"),ls=_("\x1B[47m","\x1B[49m"),us=et,cs={reset:Ut,red:Gt,green:tt,yellow:Kt,blue:qt,magenta:zt,cyan:Yt,white:Jt,gray:st,bold:it,italic:Qt,underline:Xt,dim:nt,inverse:Zt,hidden:es,strikethrough:ts,bgRed:ss,bgGreen:is,bgYellow:ns,bgBlue:rs,bgMagenta:os,bgCyan:as,bgWhite:ls,isColorSupported:us},n=cs,fs=["up","down","left","right","space","enter","cancel"],N={actions:new Set(fs),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};function Bi(e){if(e.aliases!==void 0){let t=e.aliases;for(let s in t){if(!Object.hasOwn(t,s))continue;let i=t[s];if(!N.actions.has(i))continue;if(!N.aliases.has(s))N.aliases.set(s,i)}}if(e.messages!==void 0){let t=e.messages;if(t.cancel!==void 0)N.messages.cancel=t.cancel;if(t.error!==void 0)N.messages.error=t.error}}function Oe(e,t){if(typeof e==="string")return N.aliases.get(e)===t;for(let s of e){if(s===void 0)continue;if(Oe(s,t))return!0}return!1}function ps(e,t){if(e===t)return[];let s=e.split(`
36
+ `),i=t.split(`
37
+ `),r=[];for(let o=0;o<Math.max(s.length,i.length);o++)if(s[o]!==i[o])r.push(o);return r}var gs=rt.platform.startsWith("win"),be=Symbol("clapp:cancel");function $s(e){return e===be}function re(e,t){let s=e;if(s.isTTY)s.setRawMode(t)}function vs(e){let{input:t=hs,output:s=ms,overwrite:i=!0,hideCursor:r=!0}=e||{},o=U.createInterface({input:t,output:s,prompt:"",tabSize:1});if(U.emitKeypressEvents(t,o),t instanceof je&&t.isTTY)t.setRawMode(!0);let l=(u,{name:a,sequence:c})=>{let h=String(u);if(Oe([h,a,c],"cancel")){if(r)s.write(k.show);rt.exit(0);return}if(!i)return;U.moveCursor(s,a==="return"?0:-1,a==="return"?-1:0,()=>{U.clearLine(s,1,()=>{t.once("keypress",l)})})};if(r)s.write(k.hide);return t.once("keypress",l),()=>{if(t.off("keypress",l),r)s.write(k.show);if(t instanceof je&&t.isTTY&&!gs)t.setRawMode(!1);o.terminal=!1,o.close()}}function ws(e){if(e instanceof ds&&e.columns)return e.columns;return 80}function Cs(e){return e.replace(/\x1b\[[0-9;]*m/g,"")}function Ss(e){return Cs(e).length}function De(e,t,s){if(!t||t<1)return e;let i=s?.hard??!1,r=s?.trim??!0,o=e.split(`
38
+ `),l=[];for(let u of o){if(Ss(u)<=t){l.push(r?u.trimEnd():u);continue}if(i){let a="",c=0,h=0;while(h<u.length){let f=u.slice(h).match(/^\x1b\[[0-9;]*m/);if(f){a+=f[0],h+=f[0].length;continue}if(c>=t)l.push(r?a.trimEnd():a),a="",c=0;a+=u[h],c++,h++}if(a)l.push(r?a.trimEnd():a)}else l.push(r?u.trimEnd():u)}return l.join(`
39
+ `)}class D{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;_manualLine="";state="initial";error="";value;userInput="";constructor(e,t=!0){let{input:s=ys,output:i=bs,render:r,signal:o,...l}=e;this.opts=l,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=r.bind(this),this._track=t,this._abortSignal=o,this.input=s,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let s=this._subscribers.get(e)??[];s.push(t),this._subscribers.set(e,s)}on(e,t){return this.setSubscriber(e,{cb:t}),this}once(e,t){return this.setSubscriber(e,{cb:t,once:!0}),this}emit(e,...t){let s=this._subscribers.get(e)??[],i=[];for(let r of s)if(r.cb(...t),r.once)i.push(()=>s.splice(s.indexOf(r),1));for(let r of i)r();return this}prompt(){return new Promise((e)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(be);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}if(this.rl=xs.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0)this._setUserInput(this.opts.initialUserInput,!0);this.input.on("keypress",this.onKeypress),re(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(k.show),this.output.off("resize",this.render),re(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(k.show),this.output.off("resize",this.render),re(this.input,!1),e(be)})})}_isActionKey(e,t){return e==="\t"}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,t){if(this.userInput=e??"",this.emit("userInput",this.userInput),t&&this._track&&this.rl)this.rl.write(this.userInput),this._cursor=this.rl.cursor}onKeypress(e,t){if(this._track&&t.name!=="return"){if(t.name&&this._isActionKey(e,t))this.rl?.write(null,{ctrl:!0,name:"h"});this._cursor=this.rl?.cursor??0;let s=t.name==="tab"||t.name==="escape"||t.name==="backspace"||t.name==="delete"||t.name==="enter"||t.name==="return"||t.name&&["up","down","left","right"].includes(t.name);if(e&&!s&&e.length===1&&e>=" ")this._manualLine+=e;else if(t.name==="backspace"&&this._manualLine.length>0)this._manualLine=this._manualLine.slice(0,-1);let i=this._manualLine.length>=(this.rl?.line?.length||0)?this._manualLine:this.rl?.line;this._setUserInput(i)}if(this.state==="error")this.state="active",this.error="";if(t?.name){if(!this._track&&N.aliases.has(t.name))this.emit("cursor",N.aliases.get(t.name));if(N.actions.has(t.name))this.emit("cursor",t.name)}if(e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n"))this.emit("confirm",e.toLowerCase()==="y");if(this.emit("key",e?.toLowerCase(),t),t?.name==="return"){if(this.opts.validate){let s=this.opts.validate(this.value);if(s)this.error=s instanceof Error?s.message:s,this.state="error"}if(this.state!=="error")this.state="submit"}if(Oe([e,t?.name,t?.sequence],"cancel"))this.state="cancel";if(this.state==="submit"||this.state==="cancel")this.emit("finalize");if(this.render(),this.state==="submit"||this.state==="cancel")this.close()}close(){if(this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
40
+ `),re(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.state==="cancel")setTimeout(()=>{this.unsubscribe()},10);else this.unsubscribe()}restoreCursor(){let e=De(this._prevFrame,Le.stdout.columns,{hard:!0,trim:!1}).split(`
41
+ `).length-1;this.output.write(k.move(-999,e*-1))}render(){let e=De(this._render(this)??"",Le.stdout.columns,{hard:!0,trim:!1});if(e===this._prevFrame)return;if(this.state==="initial")this.output.write(k.hide);else{let t=ps(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){let s=t[0];this.output.write(k.move(0,s)),this.output.write(te.lines(1));let i=e.split(`
42
+ `);this.output.write(i[s]),this._prevFrame=e,this.output.write(k.move(0,i.length-s-1));return}if(t&&t?.length>1){let s=t[0];this.output.write(k.move(0,s)),this.output.write(te.down());let r=e.split(`
43
+ `).slice(s);this.output.write(r.join(`
44
+ `)),this._prevFrame=e;return}this.output.write(te.down())}if(this.output.write(e),this.state==="initial")this.state="active";this._prevFrame=e}}function _s(e,t){if(e===void 0)return 0;if(t.length===0)return 0;let i=t.findIndex((r)=>r.value===e);return i!==-1?i:0}function Is(e,t){return(t.label??String(t.value)).toLowerCase().includes(e.toLowerCase())}function Os(e,t){if(!t)return;if(e)return t;return t[0]}class Ee extends D{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#e=0;#s="";#i;#t;get cursor(){return this.#e}get userInputWithCursor(){if(!this.userInput)return n.inverse(n.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}\u2588`;let e=this.userInput.slice(0,this._cursor),[t,...s]=this.userInput.slice(this._cursor);return`${e}${n.inverse(t)}${s.join("")}`}get options(){if(typeof this.#t==="function")return this.#t();return this.#t}constructor(e){super(e);this.#t=e.options;let t=this.options;this.filteredOptions=[...t],this.multiple=e.multiple===!0,this.#i=e.filter??Is;let s;if(e.initialValue&&Array.isArray(e.initialValue))if(this.multiple)s=e.initialValue;else s=e.initialValue.slice(0,1);else if(!this.multiple&&this.options.length>0)s=[this.options[0].value];if(s)for(let i of s){let r=t.findIndex((o)=>o.value===i);if(r!==-1)this.toggleSelected(i),this.#e=r}this.focusedValue=this.options[this.#e]?.value,this.on("key",(i,r)=>this.#n(i,r)),this.on("userInput",(i)=>this.#r(i))}_isActionKey(e,t){return e==="\t"||this.multiple&&this.isNavigating&&t.name==="space"&&e!==void 0&&e!==""}#n(e,t){let s=t.name==="up",i=t.name==="down",r=t.name==="return";if(s||i){if(this.#e=Math.max(0,Math.min(this.#e+(s?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#e]?.value,!this.multiple)this.selectedValues=[this.focusedValue];this.isNavigating=!0}else if(r)this.value=Os(this.multiple,this.selectedValues);else if(this.multiple)if(this.focusedValue!==void 0&&(t.name==="tab"||this.isNavigating&&t.name==="space"))this.toggleSelected(this.focusedValue);else this.isNavigating=!1;else{if(this.focusedValue)this.selectedValues=[this.focusedValue];this.isNavigating=!1}}deselectAll(){this.selectedValues=[]}toggleSelected(e){if(this.filteredOptions.length===0)return;if(this.multiple)if(this.selectedValues.includes(e))this.selectedValues=this.selectedValues.filter((t)=>t!==e);else this.selectedValues=[...this.selectedValues,e];else this.selectedValues=[e]}#r(e){if(e!==this.#s){this.#s=e;let t=this.options;if(e)this.filteredOptions=t.filter((s)=>this.#i(e,s));else this.filteredOptions=[...t];if(this.#e=_s(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#e]?.value,!this.multiple)if(this.focusedValue!==void 0)this.toggleSelected(this.focusedValue);else this.deselectAll()}}}class ot extends D{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1);this.value=!!e.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",(t)=>{this.output.write(k.move(0,-1)),this.value=t,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}class at extends D{options;cursor=0;#e;getGroupItems(e){return this.options.filter((t)=>t.group===e)}isGroupSelected(e){let t=this.getGroupItems(e),s=this.value;if(s===void 0)return!1;return t.every((i)=>s.includes(i.value))}toggleValue(){let e=this.options[this.cursor];if(this.value===void 0)this.value=[];if(e.group===!0){let t=String(e.value),s=this.getGroupItems(t);if(this.isGroupSelected(t))this.value=this.value.filter((i)=>s.findIndex((r)=>r.value===i)===-1);else this.value=[...this.value,...s.map((i)=>i.value)];this.value=Array.from(new Set(this.value))}else{let t=this.value.includes(e.value);this.value=t?this.value.filter((s)=>s!==e.value):[...this.value,e.value]}}constructor(e){super(e,!1);let{options:t}=e;this.#e=e.selectableGroups!==!1,this.options=Object.entries(t).flatMap(([s,i])=>[{value:s,group:!0,label:s},...i.map((r)=>({...r,group:s}))]),this.value=[...e.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:s})=>s===e.cursorAt),this.#e?0:1),this.on("cursor",(s)=>{switch(s){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let i=this.options[this.cursor]?.group===!0;if(!this.#e&&i)this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let i=this.options[this.cursor]?.group===!0;if(!this.#e&&i)this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}case"space":this.toggleValue();break}})}}class lt extends D{options;cursor=0;get _value(){return this.options[this.cursor].value}toggleAll(){let e=this.value!==void 0&&this.value.length===this.options.length;this.value=e?[]:this.options.map((t)=>t.value)}toggleValue(){if(this.value===void 0)this.value=[];let e=this.value.includes(this._value);this.value=e?this.value.filter((t)=>t!==this._value):[...this.value,this._value]}constructor(e){super(e,!1);this.options=e.options,this.value=[...e.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===e.cursorAt),0),this.on("key",(t)=>{if(t==="a")this.toggleAll()}),this.on("cursor",(t)=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}}class ut extends D{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let e=this.userInput;if(this.cursor>=e.length)return`${this.masked}${n.inverse(n.hidden("_"))}`;let t=this.masked,s=t.slice(0,this.cursor),i=t.slice(this.cursor);return`${s}${n.inverse(i[0])}${i.slice(1)}`}constructor({mask:e,...t}){super(t);this._mask=e??"\u2022",this.on("userInput",(s)=>{this._setValue(s)})}}class ct extends D{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(e){super(e,!1);if(this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),this.cursor===-1)this.cursor=0;this.changeValue(),this.on("cursor",(t)=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}}class ht extends D{options;cursor=0;constructor(e){super(e,!1);this.options=e.options;let t=this.options.map(({value:[s]})=>s?.toLowerCase());this.cursor=Math.max(t.indexOf(e.initialValue),0),this.on("key",(s)=>{if(!s||!t.includes(s))return;let i=this.options.find(({value:[r]})=>r?.toLowerCase()===s);if(i)this.value=i.value,this.state="submit",this.emit("submit")})}}class mt extends D{placeholder;get userInputWithCursor(){if(this.state==="submit")return this.userInput;let e=this.userInput;if(this.cursor>=e.length)return`${this.userInput}\u2588`;let t=e.slice(0,this.cursor),[s,...i]=e.slice(this.cursor);return`${t}${n.inverse(s)}${i.join("")}`}get cursor(){return this._cursor}constructor(e){super({...e,initialUserInput:e.initialUserInput??e.initialValue});this.placeholder=e.placeholder,this.on("key",(t)=>{if(t==="\t"&&this.placeholder){if(!this.userInput||this.userInput==="\t")this._setValue(this.placeholder),this._setUserInput(this.placeholder,!0)}}),this.on("userInput",(t)=>{this._setValue(t)}),this.on("finalize",()=>{if(!this.userInput&&this.placeholder)this.value=this.placeholder;if(!this.value)this.value=e.defaultValue;if(this.value===void 0)this.value=""})}}var xe=Nt(),dt=()=>Es.env.CI==="true";function Bs(e){return e.isTTY===!0}var C=(e,t)=>xe?e:t,Ts=C("\u25C6","*"),ft=C("\u25A0","x"),pt=C("\u25B2","x"),X=C("\u25C7","o"),ks=C("\u250C","T"),m=C("\u2502","|"),T=C("\u2514","\u2014"),ce=C("\u25CF",">"),he=C("\u25CB"," "),Ce=C("\u25FB","[\u2022]"),Q=C("\u25FC","[+]"),Be=C("\u25FB","[ ]"),Vs=C("\u25AA","\u2022"),We=C("\u2500","-"),Ms=C("\u256E","+"),As=C("\u251C","+"),Ns=C("\u256F","+"),gt=C("\u25CF","\u2022"),$t=C("\u25C6","*"),vt=C("\u25B2","!"),wt=C("\u25A0","x");function W(e){switch(e){case"initial":case"active":return n.cyan(Ts);case"cancel":return n.red(ft);case"error":return n.yellow(pt);case"submit":return n.green(X)}}function q(e){return e.replace(/_([^_]+)_/g,(t,s)=>K.italic(s))}function se(e){let{cursor:t,options:s,style:i}=e,r=e.output??Rs.stdout,o=r instanceof js&&r.rows!==void 0?r.rows:10,l=n.dim("..."),u=e.maxItems??Number.POSITIVE_INFINITY,a=Math.max(o-4,0),c=Math.min(a,Math.max(u,5)),h=0;if(t>=h+c-3)h=Math.max(Math.min(t-c+3,s.length-c),0);else if(t<h+2)h=Math.max(t-2,0);let f=c<s.length&&h>0,p=c<s.length&&h+c<s.length;return s.slice(h,h+c).map((d,v,y)=>{let g=v===0&&f,w=v===y.length-1&&p;return g||w?l:i(d,v+h===t)})}function Pe(e){return e.label??String(e.value??"")}function yt(e,t){if(!e)return!0;let s=(t.label??String(t.value??"")).toLowerCase(),i=(t.hint??"").toLowerCase(),r=String(t.value).toLowerCase(),o=e.toLowerCase();return s.includes(o)||i.includes(o)||r.includes(o)}function Ls(e,t){let s=[];for(let i of t)if(e.includes(i.value))s.push(i);return s}function Ds(e){return new Ee({options:e.options,initialValue:e.initialValue?[e.initialValue]:void 0,initialUserInput:e.initialUserInput,filter:(s,i)=>yt(s,i),signal:e.signal,input:e.input,output:e.output,validate:e.validate,render(){let s=`${n.gray(m)}
45
+ ${W(this.state)} ${e.message}
46
+ `,i=this.userInput,r=String(this.value??""),o=this.options,l=e.placeholder,u=r===""&&l!==void 0;switch(this.state){case"submit":{let a=Ls(this.selectedValues,o),c=a.length>0?` ${n.dim(a.map(Pe).join(", "))}`:"";return`${s}${n.gray(m)}${c}`}case"cancel":{let a=i?` ${n.strikethrough(n.dim(i))}`:"";return`${s}${n.gray(m)}${a}`}default:{let a="";if(this.isNavigating||u){let v=u?l:i;a=v!==""?` ${n.dim(v)}`:""}else a=` ${this.userInputWithCursor}`;let c=this.filteredOptions.length!==o.length?n.dim(` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"",h=this.filteredOptions.length===0?[]:se({cursor:this.cursor,options:this.filteredOptions,style:(v,y)=>{let g=Pe(v),w=v.hint&&v.value===this.focusedValue?n.dim(` (${v.hint})`):"";return y?`${n.green(ce)} ${g}${w}`:`${n.dim(he)} ${n.dim(g)}${w}`},maxItems:e.maxItems,output:e.output}),f=[`${n.dim("\u2191/\u2193")} to select`,`${n.dim("Enter:")} confirm`,`${n.dim("Type:")} to search`],p=this.filteredOptions.length===0&&i?[`${n.cyan(m)} ${n.yellow("No matches found")}`]:[],d=this.state==="error"?[`${n.yellow(m)} ${n.yellow(this.error)}`]:[];return[`${s}${n.cyan(m)}`,`${n.cyan(m)} ${n.dim("Search:")}${a}${c}`,...p,...d,...h.map((v)=>`${n.cyan(m)} ${v}`),`${n.cyan(m)} ${n.dim(f.join(" \u2022 "))}`,`${n.cyan(T)}`].join(`
47
+ `)}}}}).prompt()}function Ni(e){let t=(i,r,o,l)=>{let u=o.includes(i.value),a=i.label??String(i.value??""),c=i.hint&&l!==void 0&&i.value===l?n.dim(` (${i.hint})`):"",h=u?n.green(Q):n.dim(Be);if(r)return`${h} ${a}${c}`;return`${h} ${n.dim(a)}`},s=new Ee({options:e.options,multiple:!0,filter:(i,r)=>yt(i,r),validate:()=>{if(e.required&&s.selectedValues.length===0)return"Please select at least one item";return},initialValue:e.initialValues,signal:e.signal,input:e.input,output:e.output,render(){let i=`${n.gray(m)}
48
+ ${W(this.state)} ${e.message}
49
+ `,r=this.userInput,o=e.placeholder,l=r===""&&o!==void 0,u=this.isNavigating||l?n.dim(l?o:r):this.userInputWithCursor,a=this.options,c=this.filteredOptions.length!==a.length?n.dim(` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"";switch(this.state){case"submit":return`${i}${n.gray(m)} ${n.dim(`${this.selectedValues.length} items selected`)}`;case"cancel":return`${i}${n.gray(m)} ${n.strikethrough(n.dim(r))}`;default:{let h=[`${n.dim("\u2191/\u2193")} to navigate`,`${n.dim("Space:")} select`,`${n.dim("Enter:")} confirm`,`${n.dim("Type:")} to search`],f=this.filteredOptions.length===0&&r?[`${n.cyan(m)} ${n.yellow("No matches found")}`]:[],p=this.state==="error"?[`${n.cyan(m)} ${n.yellow(this.error)}`]:[],d=se({cursor:this.cursor,options:this.filteredOptions,style:(v,y)=>t(v,y,this.selectedValues,this.focusedValue),maxItems:e.maxItems,output:e.output});return[i,`${n.cyan(m)} ${n.dim("Search:")} ${u}${c}`,...f,...p,...d.map((v)=>`${n.cyan(m)} ${v}`),`${n.cyan(m)} ${n.dim(h.join(" \u2022 "))}`,`${n.cyan(T)}`].join(`
50
+ `)}}}});return s.prompt()}function Ri(e){let t=e.active??"Yes",s=e.inactive??"No",i=q(e.message);return new ot({active:t,inactive:s,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let r=`${n.gray(m)}
51
+ ${W(this.state)} ${i}
52
+ `,o=this.value?t:s;switch(this.state){case"submit":return`${r}${n.gray(m)} ${n.dim(o)}`;case"cancel":return`${r}${n.gray(m)} ${n.strikethrough(n.dim(o))}
53
+ ${n.gray(m)}`;default:return`${r}${n.cyan(m)} ${this.value?`${n.green(ce)} ${t}`:`${n.dim(he)} ${n.dim(t)}`} ${n.dim("/")} ${!this.value?`${n.green(ce)} ${s}`:`${n.dim(he)} ${n.dim(s)}`}
54
+ ${n.cyan(T)}
55
+ `}}}).prompt()}async function ji(e,t){let s={},i=Object.keys(e);for(let r of i){let o=e[r],l=await o({results:s})?.catch((u)=>{throw u});if(typeof t?.onCancel==="function"&&$s(l)){s[r]="canceled",t.onCancel({results:s});continue}s[r]=l}return s}function Li(e){let{selectableGroups:t=!0,groupSpacing:s=0}=e,i=(o,l,u=[])=>{let a=o.label??String(o.value),c=typeof o.group==="string",h=c&&(u[u.indexOf(o)+1]??{group:!0}),f=c&&h.group===!0,p=c?t?`${f?T:m} `:" ":"",d="";if(s>0&&!c){let y=`
56
+ ${n.cyan(m)}`;d=`${y.repeat(s-1)}${y} `}if(l==="active")return`${d}${n.dim(p)}${n.cyan(Ce)} ${a}${o.hint?` ${n.dim(`(${o.hint})`)}`:""}`;if(l==="group-active")return`${d}${p}${n.cyan(Ce)} ${n.dim(a)}`;if(l==="group-active-selected")return`${d}${p}${n.green(Q)} ${n.dim(a)}`;if(l==="selected"){let y=c||t?n.green(Q):"";return`${d}${n.dim(p)}${y} ${n.dim(a)}${o.hint?` ${n.dim(`(${o.hint})`)}`:""}`}if(l==="cancelled")return`${n.strikethrough(n.dim(a))}`;if(l==="active-selected")return`${d}${n.dim(p)}${n.green(Q)} ${a}${o.hint?` ${n.dim(`(${o.hint})`)}`:""}`;if(l==="submitted")return`${n.dim(a)}`;let v=c||t?n.dim(Be):"";return`${d}${n.dim(p)}${v} ${n.dim(a)}`},r=e.required??!0;return new at({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:r,cursorAt:e.cursorAt,selectableGroups:t,validate(o){if(r&&(o===void 0||o.length===0))return`Please select at least one option.
57
+ ${n.reset(n.dim(`Press ${n.gray(n.bgWhite(n.inverse(" space ")))} to select, ${n.gray(n.bgWhite(n.inverse(" enter ")))} to submit`))}`},render(){let o=`${n.gray(m)}
58
+ ${W(this.state)} ${e.message}
59
+ `,l=this.value??[];switch(this.state){case"submit":{let u=this.options.filter(({value:c})=>l.includes(c)).map((c)=>i(c,"submitted")),a=u.length===0?"":` ${u.join(n.dim(", "))}`;return`${o}${n.gray(m)}${a}`}case"cancel":{let u=this.options.filter(({value:a})=>l.includes(a)).map((a)=>i(a,"cancelled")).join(n.dim(", "));return`${o}${n.gray(m)} ${u.trim()?`${u}
60
+ ${n.gray(m)}`:""}`}case"error":{let u=this.error.split(`
61
+ `).map((a,c)=>c===0?`${n.yellow(T)} ${n.yellow(a)}`:` ${a}`).join(`
62
+ `);return`${o}${n.yellow(m)} ${this.options.map((a,c,h)=>{let f=l.includes(a.value)||a.group===!0&&this.isGroupSelected(`${a.value}`),p=c===this.cursor;if(!p&&typeof a.group==="string"&&this.options[this.cursor].value===a.group)return i(a,f?"group-active-selected":"group-active",h);if(p&&f)return i(a,"active-selected",h);if(f)return i(a,"selected",h);return i(a,p?"active":"inactive",h)}).join(`
63
+ ${n.yellow(m)} `)}
64
+ ${u}
65
+ `}default:{let u=this.options.map((c,h,f)=>{let p=l.includes(c.value)||c.group===!0&&this.isGroupSelected(`${c.value}`),d=h===this.cursor,v=!d&&typeof c.group==="string"&&this.options[this.cursor].value===c.group,y="";if(v)y=i(c,p?"group-active-selected":"group-active",f);else if(d&&p)y=i(c,"active-selected",f);else if(p)y=i(c,"selected",f);else y=i(c,d?"active":"inactive",f);return`${h!==0&&!y.startsWith(`
66
+ `)?" ":""}${y}`}).join(`
67
+ ${n.cyan(m)}`),a=u.startsWith(`
68
+ `)?"":" ";return`${o}${n.cyan(m)}${a}${u}
69
+ ${n.cyan(T)}
70
+ `}}}}).prompt()}function Ps(e){if(Array.isArray(e))return e.map((t)=>q(t));return q(e)}var V={message:(e=[],{symbol:t=n.gray(m),secondarySymbol:s=n.gray(m),output:i=Ws.stdout,spacing:r=1}={})=>{let o=[];for(let a=0;a<r;a++)o.push(`${s}`);let l=Ps(e),u=Array.isArray(l)?l:l.split(`
71
+ `);if(u.length>0){let[a,...c]=u;if(a.length>0)o.push(`${t} ${a}`);else o.push(t);for(let h of c)if(h.length>0)o.push(`${s} ${h}`);else o.push(s)}i.write(`${o.join(`
72
+ `)}
73
+ `)},info:(e,t)=>{V.message(e,{...t,symbol:n.blue(gt)})},success:(e,t)=>{V.message(e,{...t,symbol:n.green($t)})},step:(e,t)=>{V.message(e,{...t,symbol:n.green(X)})},warn:(e,t)=>{V.message(e,{...t,symbol:n.yellow(vt)})},warning:(e,t)=>{V.warn(e,t)},error:(e,t)=>{V.message(e,{...t,symbol:n.red(wt)})},custom:(e,t,s,i)=>{let r=typeof s==="string"?(o)=>n[s]?.(o)||o:s;V.message(t,{...i,symbol:r(e),secondarySymbol:r(e)})}};function Pi(e="",t){(t?.output??Te.stdout).write(`${n.gray(T)} ${n.red(e)}
74
+
75
+ `)}function Fi(e="",t){(t?.output??Te.stdout).write(`${n.gray(ks)} ${e}
76
+ `)}function Hi(e="",t){(t?.output??Te.stdout).write(`${n.gray(m)}
77
+ ${n.gray(T)} ${e}
78
+
79
+ `)}function Ui(e){let t=(i,r)=>{let o=i.label??String(i.value);if(r==="active")return`${n.cyan(Ce)} ${o}${i.hint?` ${n.dim(`(${i.hint})`)}`:""}`;if(r==="selected")return`${n.green(Q)} ${n.dim(o)}${i.hint?` ${n.dim(`(${i.hint})`)}`:""}`;if(r==="cancelled")return`${n.strikethrough(n.dim(o))}`;if(r==="active-selected")return`${n.green(Q)} ${o}${i.hint?` ${n.dim(`(${i.hint})`)}`:""}`;if(r==="submitted")return`${n.dim(o)}`;return`${n.dim(Be)} ${n.dim(o)}`},s=e.required??!0;return new lt({options:e.options,input:e.input,output:e.output,initialValues:e.initialValues,required:s,cursorAt:e.cursorAt,validate(i){if(s&&(i===void 0||i.length===0))return`Please select at least one option.
80
+ ${n.reset(n.dim(`Press ${n.gray(n.bgWhite(n.inverse(" space ")))} to select, ${n.gray(n.bgWhite(n.inverse(" enter ")))} to submit`))}`},render(){let i=`${n.gray(m)}
81
+ ${W(this.state)} ${e.message}
82
+ `,r=this.value??[],o=(l,u)=>{let a=r.includes(l.value);if(u&&a)return t(l,"active-selected");if(a)return t(l,"selected");return t(l,u?"active":"inactive")};switch(this.state){case"submit":return`${i}${n.gray(m)} ${this.options.filter(({value:l})=>r.includes(l)).map((l)=>t(l,"submitted")).join(n.dim(", "))||n.dim("none")}`;case"cancel":{let l=this.options.filter(({value:u})=>r.includes(u)).map((u)=>t(u,"cancelled")).join(n.dim(", "));return`${i}${n.gray(m)}${l.trim()?` ${l}
83
+ ${n.gray(m)}`:""}`}case"error":{let l=this.error.split(`
84
+ `).map((u,a)=>a===0?`${n.yellow(T)} ${n.yellow(u)}`:` ${u}`).join(`
85
+ `);return`${i+n.yellow(m)} ${se({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:o}).join(`
86
+ ${n.yellow(m)} `)}
87
+ ${l}
88
+ `}default:return`${i}${n.cyan(m)} ${se({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:o}).join(`
89
+ ${n.cyan(m)} `)}
90
+ ${n.cyan(T)}
91
+ `}}}).prompt()}var Hs=(e)=>n.dim(e);function qi(e="",t="",s){let i=s?.format??Hs,r=q(e),o=q(t),l=["",...r.split(`
92
+ `).map(i),""],u=ge(o).length,a=s?.output??Fs.stdout,c=Math.max(l.reduce((f,p)=>{let d=ge(p);return d.length>f?d.length:f},0),u)+2,h=l.map((f)=>`${n.gray(m)} ${f}${" ".repeat(c-ge(f).length)}${n.gray(m)}`).join(`
93
+ `);a.write(`${n.gray(m)}
94
+ ${n.green(X)} ${n.reset(o)} ${n.gray(We.repeat(Math.max(c-u-1,1))+Ms)}
95
+ ${h}
96
+ ${n.gray(As+We.repeat(c+2)+Ns)}
97
+ `)}function zi(e){return new ut({validate:e.validate,mask:e.mask??Vs,signal:e.signal,input:e.input,output:e.output,render(){let t=`${n.gray(m)}
98
+ ${W(this.state)} ${e.message}
99
+ `,s=this.userInputWithCursor,i=this.masked;switch(this.state){case"error":{let r=i?` ${i}`:"";return`${t.trim()}
100
+ ${n.yellow(m)}${r}
101
+ ${n.yellow(T)} ${n.yellow(this.error)}
102
+ `}case"submit":{let r=i?` ${n.dim(i)}`:"";return`${t}${n.gray(m)}${r}`}case"cancel":{let r=i?` ${n.strikethrough(n.dim(i))}`:"";return`${t}${n.gray(m)}${r}${i?`
103
+ ${n.gray(m)}`:""}`}default:return`${t}${n.cyan(m)} ${s}
104
+ ${n.cyan(T)}
105
+ `}}}).prompt()}function Xi(e){let t=e.validate;return Ds({...e,initialUserInput:e.initialValue??e.root??qs.cwd(),maxItems:5,validate(s){if(Array.isArray(s))return;if(!s)return"Please select a path";if(t)return t(s);return},options(){let s=this.userInput;if(s==="")return[];try{let i;if(!Us(s))i=He(s);else if(Fe(s).isDirectory())i=s;else i=He(s);return Gs(i).map((o)=>{let l=Ks(i,o),u=Fe(l);return{name:o,path:l,isDirectory:u.isDirectory()}}).filter(({path:o,isDirectory:l})=>o.startsWith(s)&&(e.directory||!l)).map((o)=>({value:o.path}))}catch(i){return console.error("Error reading directory:",i),[]}}})}function bt({indicator:e="dots",onCancel:t,output:s=A.stdout,cancelMessage:i,errorMessage:r,frames:o=xe?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:l=xe?80:120,signal:u}={}){let a=dt(),c,h,f=!1,p=!1,d="",v,y=performance.now();function g(){if(v===void 0)return;if(a)s.write(`
106
+ `);let B=v.split(`
107
+ `);s.write(k.move(-999,B.length-1)),s.write(te.down(B.length))}function w(B){return B.replace(/\.+$/,"")}function I(B){let M=(performance.now()-B)/1000,R=Math.floor(M/60),z=Math.floor(M%60);return R>0?`[${R}m ${z}s]`:`[${z}s]`}function b(B="",M=0){f=!1,clearInterval(h),g();let R=M===0?n.green(X):M===1?n.red(ft):n.red(pt);if(d=B??d,e==="timer")s.write(`${R} ${d} ${I(y)}
108
+ `);else s.write(`${R} ${d}
109
+ `);ne(),c()}function O(B){let M=B>1?r??N.messages.error:i??N.messages.cancel;if(p=B===1,f){if(b(M,B),p&&typeof t==="function")t()}}function E(){O(2)}function L(){O(1)}function ie(){A.on("uncaughtExceptionMonitor",E),A.on("unhandledRejection",E),A.on("SIGINT",L),A.on("SIGTERM",L),A.on("exit",O)}function ne(){if(A.removeListener("uncaughtExceptionMonitor",E),A.removeListener("unhandledRejection",E),A.removeListener("SIGINT",L),A.removeListener("SIGTERM",L),A.removeListener("exit",O),u)u.removeEventListener("abort",L)}function Ct(B=""){f=!0,c=vs({output:s}),d=w(B),y=performance.now(),s.write(`${n.gray(m)}
110
+ `);let M=0,R=0;ie(),h=setInterval(()=>{if(a&&d===v)return;g(),v=d;let z=n.magenta(o[M]);if(a)s.write(`${z} ${d}...`);else if(e==="timer")s.write(`${z} ${d} ${I(y)}`);else{let _t=".".repeat(Math.floor(R)).slice(0,3);s.write(`${z} ${d}${_t}`)}M=M+1<o.length?M+1:0,R=R<4?R+0.125:0},l)}function St(B=""){d=w(B??d)}return{start:Ct,stop:b,message:St,get isCancelled(){return p}}}var Ue={light:C("\u2500","-"),heavy:C("\u2501","="),block:C("\u2588","#")};function en(e={}){let{style:t="heavy",max:s=100,size:i=40,...r}=e,o=bt(r),l=0,u="",a=Math.max(1,s),c=Math.max(1,i),h=(v)=>{switch(v){case"initial":case"active":return n.magenta;case"error":case"cancel":return n.red;case"submit":return n.green;default:return n.magenta}},f=(v,y)=>{let g=Math.floor(l/a*c);return`${h(v)(Ue[t].repeat(g))}${n.dim(Ue[t].repeat(c-g))} ${y}`},p=(v="")=>(u=v,o.start(f("initial",v))),d=(v=1,y)=>{l=Math.min(a,v+l),o.message(f("active",y??u)),u=y??u};return{start:p,stop:o.stop,advance:d,isCancelled:o.isCancelled,message:(v)=>d(0,v)}}function tn(e){let t=q(e.message),s=(i,r)=>{let o=i.label??String(i.value);switch(r){case"selected":return`${n.dim(o)}`;case"active":return`${n.green(ce)} ${o}${i.hint?` ${n.dim(`(${i.hint})`)}`:""}`;case"cancelled":return`${n.strikethrough(n.dim(o))}`;default:return`${n.dim(he)} ${n.dim(o)}`}};return new ct({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let i=`${n.gray(m)}
111
+ ${W(this.state)} ${t}
112
+ `;switch(this.state){case"submit":return`${i}${n.gray(m)} ${s(this.options[this.cursor],"selected")}`;case"cancel":return`${i}${n.gray(m)} ${s(this.options[this.cursor],"cancelled")}
113
+ ${n.gray(m)}`;default:return`${i}${n.cyan(m)} ${se({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(r,o)=>s(r,o?"active":"inactive")}).join(`
114
+ ${n.cyan(m)} `)}
115
+ ${n.cyan(T)}
116
+ `}}}).prompt()}function sn(e){let t=(s,i="inactive")=>{let r=s.label??String(s.value);if(i==="selected")return`${n.dim(r)}`;if(i==="cancelled")return`${n.strikethrough(n.dim(r))}`;if(i==="active")return`${n.bgCyan(n.gray(` ${s.value} `))} ${r} ${s.hint?n.dim(`(${s.hint})`):""}`;return`${n.gray(n.bgWhite(n.inverse(` ${s.value} `)))} ${r} ${s.hint?n.dim(`(${s.hint})`):""}`};return new ht({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let s=`${n.gray(m)}
117
+ ${W(this.state)} ${e.message}
118
+ `;switch(this.state){case"submit":return`${s}${n.gray(m)} ${t(this.options.find((i)=>i.value===this.value)??e.options[0],"selected")}`;case"cancel":return`${s}${n.gray(m)} ${t(this.options[0],"cancelled")}
119
+ ${n.gray(m)}`;default:return`${s}${n.cyan(m)} ${this.options.map((i,r)=>t(i,r===this.cursor?"active":"inactive")).join(`
120
+ ${n.cyan(m)} `)}
121
+ ${n.cyan(T)}
122
+ `}}}).prompt()}function zs(){return`${n.gray(m)} `}var Ge=zs(),Y={message:async(e,{symbol:t=n.gray(m)}={})=>{ee.stdout.write(`${n.gray(m)}
123
+ ${t} `);let s=3;for await(let i of e){if(i=i.replace(/\n/g,`
124
+ ${Ge}`),i.includes(`
125
+ `))s=3+$e(i.slice(i.lastIndexOf(`
126
+ `))).length;let r=$e(i).length;if(s+r<ee.stdout.columns)s+=r,ee.stdout.write(i);else ee.stdout.write(`
127
+ ${Ge}${i.trimStart()}`),s=3+$e(i.trimStart()).length}ee.stdout.write(`
128
+ `)},info:(e)=>Y.message(e,{symbol:n.blue(gt)}),success:(e)=>Y.message(e,{symbol:n.green($t)}),step:(e)=>Y.message(e,{symbol:n.green(X)}),warn:(e)=>Y.message(e,{symbol:n.yellow(vt)}),warning:(e)=>Y.warn(e),error:(e)=>Y.message(e,{symbol:n.red(wt)})};async function on(e,t){for(let s of e){if(s.enabled===!1)continue;let i=bt(t);i.start(s.title);let r=await s.task(i.message);i.stop(r||s.title)}}function ln(e){let t=e.output??Ys.stdout,s=ws(t),i=st(m),r=e.spacing??1,o=3,l=e.retainLog===!0,u=!dt()&&Bs(t);t.write(`${i}
129
+ `),t.write(`${tt(X)} ${e.title}
130
+ `);for(let g=0;g<r;g++)t.write(`${i}
131
+ `);let a=[{value:"",full:""}],c=!1,h=(g)=>{if(a.length===0)return;let w=0;if(g)w+=r+2;for(let I of a){let{value:b,result:O}=I,E=O?.message??b;if(E.length===0)continue;if(O===void 0&&I.header!==void 0&&I.header!=="")E+=`
132
+ ${I.header}`;let L=E.split(`
133
+ `).reduce((ie,ne)=>{if(ne==="")return ie+1;return ie+Math.ceil((ne.length+3)/s)},0);w+=L}if(w>0)w+=1,t.write(te.lines(w))},f=(g,w,I)=>{let b=I?`${g.full}
134
+ ${g.value}`:g.value;if(g.header!==void 0&&g.header!=="")V.message(g.header.split(`
135
+ `).map(it),{output:t,secondarySymbol:i,symbol:i,spacing:0});V.message(b.split(`
136
+ `).map(nt),{output:t,secondarySymbol:i,symbol:i,spacing:w??r})},p=()=>{for(let g of a){let{header:w,value:I,full:b}=g;if((w===void 0||w.length===0)&&I.length===0)continue;f(g,void 0,l===!0&&b.length>0)}},d=()=>{for(let g of a)if(g.result)if(g.result.status==="error")V.error(g.result.message,{output:t,secondarySymbol:i,spacing:0});else V.success(g.result.message,{output:t,secondarySymbol:i,spacing:0});else if(g.value!=="")f(g,0)},v=(g,w,I)=>{if(h(!1),(I?.raw!==!0||!c)&&g.value!=="")g.value+=`
137
+ `;if(g.value+=w,c=I?.raw===!0,e.limit!==void 0){let b=g.value.split(`
138
+ `),O=b.length-e.limit;if(O>0){let E=b.splice(0,O);if(l)g.full+=(g.full===""?"":`
139
+ `)+E.join(`
140
+ `)}g.value=b.join(`
141
+ `)}if(u)d()},y=(g,w)=>{if(h(!1),g.result=w,u)d()};return{message(g,w){v(a[0],g,w)},group(g){let w={header:g,value:"",full:""};return a.push(w),{message(I,b){v(w,I,b)},error(I){y(w,{status:"error",message:I})},success(I){y(w,{status:"success",message:I})}}},error(g,w){if(h(!0),V.error(g,{output:t,secondarySymbol:i,spacing:1}),w?.showLog!==!1)p();a.splice(1,a.length-1),a[0].value="",a[0].full=""},success(g,w){if(h(!0),V.success(g,{output:t,secondarySymbol:i,spacing:1}),w?.showLog===!0)p();a.splice(1,a.length-1),a[0].value="",a[0].full=""}}}function un(e){let t=q(e.message);return new mt({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let s=`${n.gray(m)}
142
+ ${W(this.state)} ${t}
143
+ `,i=e.placeholder?n.inverse(e.placeholder[0])+n.dim(e.placeholder.slice(1)):n.inverse(n.hidden("_")),r=!this.userInput?i:this.userInputWithCursor,o=this.value??"";switch(this.state){case"error":{let l=this.error?` ${n.yellow(this.error)}`:"";return`${s.trim()}
144
+ ${n.yellow(m)} ${r}
145
+ ${n.yellow(T)}${l}
146
+ `}case"submit":{let u=(this.userInput||o!==e.placeholder)&&o?` ${n.dim(o)}`:"";return`${s}${n.gray(m)}${u}`}case"cancel":{let l=o?` ${n.strikethrough(n.dim(o))}`:"";return`${s}${n.gray(m)}${l}${o.trim()?`
147
+ ${n.gray(m)}`:""}`}default:return`${s}${n.cyan(m)} ${r}
148
+ ${n.cyan(T)}
149
+ `}}}).prompt()}class Se extends Xs{buffer=[];_write(e,t,s){this.buffer.push(e.toString()),s()}}class xt extends Qs{_buffer=[];_read(){if(this._buffer===null){this.push(null);return}for(let e of this._buffer)this.push(e);this._buffer=[]}pushValue(e){this._buffer?.push(e)}close(){this._buffer=null}}function gn(e={}){return Xe(e.name||"")}function Zs(){let e=new Se,t=new Se,s=new xt,i=x.exit,r=x.stdout,o=x.stderr,l=x.stdin,u=console.log;return x.exit=(a)=>{throw Error(`Process exit with code: ${a||0}`)},Object.defineProperty(x,"stdout",{value:e,writable:!0}),Object.defineProperty(x,"stderr",{value:t,writable:!0}),Object.defineProperty(x,"stdin",{value:s,writable:!0}),{stdout:e,stderr:t,stdin:s,originalExit:i,originalStdout:r,originalStderr:o,originalStdin:l,originalConsoleLog:u}}function ei(e){x.exit=e.originalExit,Object.defineProperty(x,"stdout",{value:e.originalStdout,writable:!0}),Object.defineProperty(x,"stderr",{value:e.originalStderr,writable:!0}),Object.defineProperty(x,"stdin",{value:e.originalStdin,writable:!0}),console.log=e.originalConsoleLog}async function $n(e,t,s={}){let i=Date.now(),{inputs:r=[],env:o={},cwd:l=x.cwd(),timeout:u=5000}=s,a=Zs(),{stdin:c,stdout:h,stderr:f}=a,p=t.includes("--help")||t.includes("-h"),d=[];if(x.stdout.write=function(b){let O=b.toString();return d.push(O),h.write(O),!0},console.log=function(...b){let O=b.map((E)=>String(E)).join(" ");d.push(`${O}
150
+ `),h.write(`${O}
151
+ `);return},r.length>0)for(let b of r)c.pushValue(`${b}
152
+ `);let v={...x.env},y=x.cwd();if(Object.entries(o).forEach(([b,O])=>{x.env[b]=O}),l!==y)x.chdir(l);let g,w=0;try{let b=new Promise((E,L)=>{setTimeout(()=>L(Error("Command execution timed out")),u)}),O=Promise.resolve().then(async()=>{try{if(e.showHelpOnExit=!1,e.showVersionOnExit=!1,await e.parse(["node","cli",...t],{run:!1}),p)e.outputHelp();return g=await e.runMatchedCommand(),g}catch(E){throw w=1,f.write(`${E}
153
+ `),E}});await Promise.race([O,b])}catch(b){if(b.message==="Command execution timed out")throw b}finally{if(x.env=v,l!==y)x.chdir(y);ei(a)}let I=Date.now()-i;if(p)w=0;return{stdout:d.join(""),stderr:f.buffer.join(""),exitCode:w,duration:I,outputs:[...d],result:g}}var H=null;function vn(e){H=e}function wn(e){if(!H)return;if(e in H)return H[e];for(let[t,s]of Object.entries(H))if(t.startsWith("/")&&t.endsWith("/i")){let i=t.slice(1,-2);if(new RegExp(i,"i").test(e))return s}else if(t.startsWith("/")&&t.endsWith("/")){let i=t.slice(1,-1);if(new RegExp(i).test(e))return s}if("*"in H)return H["*"];return}function yn(){H=null}var me=null;function bn(){let e=[],t=[],s=x.stdout.write,i=x.stderr.write;x.stdout.write=function(o){return e.push(o.toString()),!0},x.stderr.write=function(o){return t.push(o.toString()),!0};let r={stdout:e,stderr:t,stop:()=>(x.stdout.write=s,x.stderr.write=i,me=null,{stdout:e.join(""),stderr:t.join("")})};return me=r,r}function xn(){if(!me)throw Error("No output capture in progress. Call captureOutput() first.");return me.stdout.join("")}async function Cn(e){let t=await j.mkdtemp(le.join(Js.tmpdir(),"clapp-test-")),s=async(i,r)=>{for(let[o,l]of Object.entries(r)){let u=le.join(i,o);if(typeof l==="object"&&!Ke.isBuffer(l))if(o.endsWith("/"))await j.mkdir(u,{recursive:!0}),await s(u,l);else await j.mkdir(u,{recursive:!0}),await s(u,l);else{let a=le.dirname(u);if(await j.mkdir(a,{recursive:!0}),Ke.isBuffer(l))await j.writeFile(u,l);else if(typeof l==="string")await j.writeFile(u,l,"utf8");else await j.writeFile(u,JSON.stringify(l),"utf8")}}};return await s(t,e),t}async function Sn(e){let t=async(s)=>{let i=await j.readdir(s,{withFileTypes:!0});for(let r of i){let o=le.join(s,r.name);if(r.isDirectory())await t(o);else await j.unlink(o)}await j.rmdir(s)};await t(e)}var _n={outputToContain(e,t){if(!e.stdout.includes(t))throw Error(`Expected output to contain "${t}", but got:
154
+ ${e.stdout}`)},outputToMatch(e,t){if(!t.test(e.stdout))throw Error(`Expected output to match ${t}, but got:
155
+ ${e.stdout}`)},exitCode(e,t){if(e.exitCode!==t)throw Error(`Expected exit code ${t}, but got ${e.exitCode}`)},completedWithin(e,t){if(e.duration>t)throw Error(`Expected command to complete within ${t}ms, but took ${e.duration}ms`)},outputNotToContain(e,t){if(e.stdout.includes(t))throw Error(`Expected output not to contain "${t}", but it did`)},stderrToContain(e,t){if(!e.stderr.includes(t))throw Error(`Expected stderr to contain "${t}", but got:
156
+ ${e.stderr}`)}},In=Xe;export{be as CANCEL_SYMBOL,Qe as CLI,S as CSI,oe as ClappError,_e as Command,ue as ESC,Ie as GlobalCommand,m as S_BAR,T as S_BAR_END,We as S_BAR_H,ks as S_BAR_START,Ce as S_CHECKBOX_ACTIVE,Be as S_CHECKBOX_INACTIVE,Q as S_CHECKBOX_SELECTED,As as S_CONNECT_LEFT,Ns as S_CORNER_BOTTOM_RIGHT,Ms as S_CORNER_TOP_RIGHT,wt as S_ERROR,gt as S_INFO,Vs as S_PASSWORD_MASK,ce as S_RADIO_ACTIVE,he as S_RADIO_INACTIVE,Ts as S_STEP_ACTIVE,ft as S_STEP_CANCEL,pt as S_STEP_ERROR,X as S_STEP_SUBMIT,$t as S_SUCCESS,vt as S_WARN,gi as applyTheme,Ds as autocomplete,Ni as autocompleteMultiselect,ci as beep,vs as block,wi as box,kt as camelcase,ze as camelcaseOptionName,Pi as cancel,bn as captureOutput,Sn as cleanupTestFS,mi as clear,Xe as cli,xi as cliCache,F as codes,Ri as confirm,gn as createTestCLI,Cn as createTestFS,k as cursor,In as default,ps as diffLines,te as erase,$n as execCommand,_n as expect,Bt as findAllBrackets,Me as findLongest,Ye as findSimilarCommands,$i as getAvailableThemes,ws as getColumns,At as getFileName,xn as getLastOutput,wn as getMockResponse,Tt as getMriOptions,ji as group,Li as groupMultiselect,Fi as intro,Oe as isActionKey,dt as isCI,$s as isCancel,Bs as isTTY,Nt as isUnicodeSupported,Rt as levenshteinDistance,se as limitOptions,V as log,vn as mockPrompt,Ui as multiselect,qi as note,Si as onUnknownSubcommand,Hi as outro,pe as padRight,yi as panel,zi as password,Xi as path,q as processMarkdown,en as progress,ve as removeBrackets,yn as resetMockPrompts,hi as scroll,tn as select,sn as selectKey,vi as setAccessibility,Mt as setByType,Vt as setDotProp,re as setRawMode,Ft as setTheme,N as settings,Zs as setupTest,bt as spinner,Y as stream,K as style,W as symbol,bi as table,ln as taskLog,on as tasks,ei as teardownTest,oi as telemetry,un as text,ye as themes,xe as unicode,C as unicodeOr,Bi as updateSettings};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{b as a,c as b,d as c,e as d,f as e,g as f}from"./chunk-0xebhmpv.js";import"./chunk-j0sjsw8n.js";import"./chunk-6xy2rbcn.js";import"./chunk-cfytsdab.js";export{c as applyPlugins,a as lintText,f as runLint,b as runLintProgrammatic,e as scanContent,d as scanContentOptimized};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-cfytsdab.js";var e="pickier",u="module",t="0.1.60",r="Format, lint and more in a fraction of seconds.",s="Chris Breuer <chris@stacksjs.org>",l="MIT",p="https://github.com/pickier/pickier#readme",b={type:"git",url:"git+https://github.com/pickier/pickier.git"},c={url:"https://github.com/pickier/pickier/issues"},m=["pickier","linter","formatter","bun","fast"],o={".":{types:"./dist/src/index.d.ts",import:"./dist/src/index.js"},"./*":{import:"./dist/*"}},a="./dist/src/index.js",x="./dist/src/index.d.ts",d={pickier:"./dist/bin/cli.js"},w=["README.md","dist"],k={build:"bun --bun build.ts","build:bin":"bun --bun build.ts && bun run compile",compile:"bun build ./bin/cli.ts --compile --minify --outfile bin/pickier","compile:all":"bun run compile:linux-x64 && bun run compile:linux-arm64 && bun run compile:linux-x64-musl && bun run compile:linux-arm64-musl && bun run compile:windows-x64 && bun run compile:windows-arm64 && bun run compile:darwin-x64 && bun run compile:darwin-arm64","compile:linux-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64 --outfile bin/pickier-linux-x64","compile:linux-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64 --outfile bin/pickier-linux-arm64","compile:linux-x64-musl":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64-musl --outfile bin/pickier-linux-x64-musl","compile:linux-arm64-musl":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64-musl --outfile bin/pickier-linux-arm64-musl","compile:windows-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-windows-x64 --outfile bin/pickier-windows-x64.exe","compile:windows-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-windows-arm64 --outfile bin/pickier-windows-arm64.exe","compile:darwin-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-darwin-x64 --outfile bin/pickier-darwin-x64","compile:darwin-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-darwin-arm64 --outfile bin/pickier-darwin-arm64",zip:"bun run zip:all","zip:all":"bun run zip:linux-x64 && bun run zip:linux-arm64 && bun run zip:linux-x64-musl && bun run zip:linux-arm64-musl && bun run zip:windows-x64 && bun run zip:windows-arm64 && bun run zip:darwin-x64 && bun run zip:darwin-arm64","zip:linux-x64":"zip -j bin/pickier-linux-x64.zip bin/pickier-linux-x64","zip:linux-arm64":"zip -j bin/pickier-linux-arm64.zip bin/pickier-linux-arm64","zip:linux-x64-musl":"zip -j bin/pickier-linux-x64-musl.zip bin/pickier-linux-x64-musl","zip:linux-arm64-musl":"zip -j bin/pickier-linux-arm64-musl.zip bin/pickier-linux-arm64-musl","zip:windows-x64":"zip -j bin/pickier-windows-x64.zip bin/pickier-windows-x64.exe","zip:windows-arm64":"zip -j bin/pickier-windows-arm64.zip bin/pickier-windows-arm64.exe","zip:darwin-x64":"zip -j bin/pickier-darwin-x64.zip bin/pickier-darwin-x64","zip:darwin-arm64":"zip -j bin/pickier-darwin-arm64.zip bin/pickier-darwin-arm64",prepublishOnly:"bun --bun run build && bun run compile:all && bun run zip",test:"PICKIER_NO_AUTO_CONFIG=1 bun test --coverage","test:core":"PICKIER_NO_AUTO_CONFIG=1 bun test test/core","test:format":"PICKIER_NO_AUTO_CONFIG=1 bun test test/format","test:lint":"PICKIER_NO_AUTO_CONFIG=1 bun test test/lint","test:rules":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules","test:rules:sort":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/sort","test:rules:style":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/style","test:rules:quality":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/quality","test:rules:imports":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/imports","test:rules:typescript":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/typescript","test:rules:regexp":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/regexp","test:plugin":"PICKIER_NO_AUTO_CONFIG=1 bun test test/plugin","test:watch":"PICKIER_NO_AUTO_CONFIG=1 bun test --watch"},I={"@stacksjs/clarity":"^0.3.24","@stacksjs/clapp":"^0.2.3"},O={"@stacksjs/ts-spell-check":"^0.1.0"},_={bunfig:"^0.15.13"},z={name:e,type:u,version:t,description:r,author:s,license:l,homepage:p,repository:b,bugs:c,keywords:m,exports:o,module:a,types:x,bin:d,files:w,scripts:k,dependencies:I,optionalDependencies:O,devDependencies:_};export{s as author,d as bin,c as bugs,z as default,I as dependencies,r as description,_ as devDependencies,o as exports,w as files,p as homepage,m as keywords,l as license,a as module,e as name,O as optionalDependencies,b as repository,k as scripts,u as type,x as types,t as version};
@@ -0,0 +1,33 @@
1
+ // @bun
2
+ import{K as R}from"./chunk-6xy2rbcn.js";import{N as gt}from"./chunk-cfytsdab.js";function fe(t){let r=t.length,n=Array.from({length:r},(s,i)=>t[i]),e=0;while(e<r){let s=t[e];if(s==="#"&&(e===0||/\s/.test(t[e-1]))){while(e<r)n[e]=" ",e++;break}if(s==="$"&&t[e+1]==="'"){e+=2;while(e<r){if(t[e]==="\\"&&e+1<r){n[e]=" ",n[e+1]=" ",e+=2;continue}if(t[e]==="'"){e++;break}n[e]=" ",e++}continue}if(s==="$"&&t[e+1]==='"'){e++,e=A(t,e,n);continue}if(s==="$"&&t[e+1]==="{"){e+=2;let i=1;while(e<r&&i>0){let o=t[e];if(o==="\\"&&e+1<r){n[e]=" ",n[e+1]=" ",e+=2;continue}if(o==="'"){e++;while(e<r&&t[e]!=="'")n[e]=" ",e++;if(e<r)e++;continue}if(o==='"'){e=A(t,e,n);continue}if(o==="{"){i++,e++;continue}if(o==="}"){i--,e++;continue}n[e]=" ",e++}continue}if(s==="$"&&t[e+1]==="("&&t[e+2]==="("){e+=3;let i=2;while(e<r&&i>0){let o=t[e];if(o==="("){i++,e++;continue}if(o===")"){i--,e++;continue}n[e]=" ",e++}continue}if(s==="$"&&t[e+1]==="("){e+=2;let i=1;while(e<r&&i>0){let o=t[e];if(o==="\\"&&e+1<r){n[e]=" ",n[e+1]=" ",e+=2;continue}if(o==="'"){e++;while(e<r&&t[e]!=="'")n[e]=" ",e++;if(e<r)e++;continue}if(o==='"'){e=A(t,e,n);continue}if(o==="("){i++,e++;continue}if(o===")"){i--,e++;continue}n[e]=" ",e++}continue}if(s==="'"){e++;while(e<r&&t[e]!=="'")n[e]=" ",e++;if(e<r)e++;continue}if(s==='"'){e=A(t,e,n);continue}if(s==="`"){e++;while(e<r&&t[e]!=="`"){if(t[e]==="\\"&&e+1<r){n[e]=" ",n[e+1]=" ",e+=2;continue}n[e]=" ",e++}if(e<r)e++;continue}e++}return n.join("")}function A(t,r,n){let e=t.length,s=r+1;while(s<e){let i=t[s];if(i==="\\"&&s+1<e){n[s]=" ",n[s+1]=" ",s+=2;continue}if(i==='"')return s+1;if(i==="$"&&t[s+1]==="("&&t[s+2]==="("){s+=3;let o=2;while(s<e&&o>0){let c=t[s];if(c==="("){o++,s++;continue}if(c===")"){o--,s++;continue}n[s]=" ",s++}continue}if(i==="$"&&t[s+1]==="("){s+=2;let o=1;while(s<e&&o>0){let c=t[s];if(c==="\\"&&s+1<e){n[s]=" ",n[s+1]=" ",s+=2;continue}if(c==="'"){s++;while(s<e&&t[s]!=="'")n[s]=" ",s++;if(s<e)s++;continue}if(c==='"'){s=A(t,s,n);continue}if(c==="("){o++,s++;continue}if(c===")"){o--,s++;continue}n[s]=" ",s++}continue}if(i==="$"&&t[s+1]==="{"){s+=2;let o=1;while(s<e&&o>0){let c=t[s];if(c==="{"){o++,s++;continue}if(c==="}"){o--,s++;continue}n[s]=" ",s++}continue}n[s]=" ",s++}return s}function z(t){let n=fe(t).match(/<<-?/);if(!n||n.index===void 0)return null;let s=t.slice(n.index+n[0].length).match(/^\s*(['"]?)(\w+)\1/);if(!s)return null;return s[2]}var ue=new Set([".ts",".js"]),pe=new Set([".json",".jsonc"]),ge=new Set([".yaml",".yml"]),de=new Set([".sh",".bash",".zsh",".ksh",".dash"]),me=/^#!\s*(?:\/usr\/bin\/env\s+)?(?:ba|z|k|da)?sh\b/;var he=/^[}\])]/,ye=/[{[(]\s*$/,be=/\s*\/\/.*$/,we=/^(?:if|else\s+if|for|while)\s*\(/,Se=/^(?:\.[\w$[]|\?[\s.:]|:\s|&&|\|\|)/;function xe(t){let r=we.exec(t);if(!r)return/^(?:else|do)\s*$/.test(t);let n=0,e=null;for(let s=r[0].length-1;s<t.length;s++){let i=t[s];if(e){if(i==="\\"){s++;continue}if(i===e)e=null;continue}if(i==="'"||i==='"'||i==="`"){e=i;continue}if(i==="(")n++;else if(i===")"){if(n--,n===0)return t.slice(s+1).trim().length===0}}return!1}var Ce=/^\s*for\s*\(/,Ee=new RegExp("^\\s*;\\s*$"),$e=new RegExp(";{2,}\\s*$"),ke=/([\w)])\{/g,_e=/\{(return|if|for|while|switch|const|let|var|function)\b/g,Ie=/,(\S)/g,Re=/(?<![=!<>+\-*/%&|^?])=(?![=><])/g,Oe=/(\w)\+(\w)/g,Te=/(\w)-(\w)/g,Ne=/(\w)\*(\w)/g,ve=/(\w)\/(\w)/g,Ae=new RegExp("(?<=\\S);([^\\s;])","g"),Pe=/([\w)\]])<(\d)/g,Me=/([\w)\]])>(\d)/g,Y=/\s{2,}/g,H=/^\s*$/,Le=/^\s*\/\//,Q=/^\s*\/\*/,je=/^\s*import\b/,X=/\bfrom\s*['"][^'"]+['"]|^\s*import\s+['"][^'"]+['"]/,De=/package\.json$/i,Fe=/[jt]sconfig(?:\..+)?\.json$/i,j=/[ \t]+$/,Ue=/^\n+/;function M(t){let r=t.lastIndexOf(".");return r>=0?t.slice(r):""}function D(t){return ue.has(M(t))}function Ge(t){return pe.has(M(t))}function We(t){return ge.has(M(t))}function Be(t){return de.has(M(t))}function Je(t,r){return Be(t)||me.test(r)}function Ke(t,r){let n=t.split(`
3
+ `),e=n.length,s=Array(e),i=r.format.indent,o=r.format.indentStyle==="tabs",c=0,f=!1,p="",g=!1,m=0;for(let a=0;a<e;a++){let h=n[a];if(h.length===0||/^\s*$/.test(h)){s[a]="";continue}if(f){if(s[a]=h,h.trim()===p)f=!1,p="";continue}let b=z(h);if(b)f=!0,p=b;let w=0;while(w<h.length&&(h.charCodeAt(w)===32||h.charCodeAt(w)===9))w++;let d=h.slice(w).trimEnd();if(d.startsWith("#")&&a>0){let v=o?"\t".repeat(c):" ".repeat(c*i);s[a]=v+d;continue}if(/^case\b/.test(d)&&/\bin\s*$/.test(d))m++,g=!0;if(/^esac\b/.test(d)){if(m=Math.max(0,m-1),m===0)g=!1}let C=g&&/\)\s*$/.test(d)&&!/\$\(/.test(d)&&!/^\s*\(/.test(d)&&!d.startsWith("#"),E=/^;[;&]\s*$/.test(d);if(/^(?:fi|done|esac|elif|else)\b/.test(d)||/^\}/.test(d))c=Math.max(0,c-1);if(E)c=Math.max(0,c-1);let N=o?"\t".repeat(c):" ".repeat(c*i);if(s[a]=N+d,/^then\b/.test(d)||/^do\b/.test(d)||/^else\b/.test(d))c++;else if(/^if\b/.test(d)&&/\bthen\s*$/.test(d))c++;else if(/^elif\b/.test(d)&&/\bthen\s*$/.test(d))c++;else if(/^(?:while|for|until)\b/.test(d)&&/\bdo\s*$/.test(d))c++;else if(/^case\b/.test(d)&&/\bin\s*$/.test(d))c++;else if(C)c++;else if(/\{\s*$/.test(d)&&!d.startsWith("#"))c++}return s.join(`
4
+ `)}function ze(t,r){try{let n=Bun.YAML.parse(t),e=r.format.indentStyle==="tabs"?"\t":r.format.indent;return Bun.YAML.stringify(n,null,e).split(`
5
+ `).map((i)=>i.replace(/[ \t]+$/,"")).join(`
6
+ `)}catch{return t}}function Ye(t){return" ".repeat(Math.max(0,t))}function He(t,r){if((r.format.indentStyle||"spaces")==="tabs")return"\t".repeat(Math.max(0,t));return Ye(Math.max(0,t*r.format.indent))}function Qe(t){return`'${t.slice(1,-1).replace(/\\"/g,'"')}'`}function Xe(t){return`"${t.slice(1,-1).replace(/\\'/g,"'")}"`}function Ve(t,r){for(let n=0;n<t.length;n++){if(t[n]==="\\"){n++;continue}if(t[n]===r)return!0}return!1}function Ze(t,r,n){if(!D(n))return t;let e=t.split(`
7
+ `);for(let s=0;s<e.length;s++)e[s]=ee(e[s],r);return e.join(`
8
+ `)}function ee(t,r){let n=r==="single";if(n?!t.includes('"'):!t.includes("'"))return t;let e=[],s=0,i=0,o=0,c=0;while(s<t.length){let f=t[s];if(o===0){if(f==="/"){let p=t[s+1];if(p==="/")break;if(p==="*"){let g=t.indexOf("*/",s+2);s=g===-1?t.length:g+2;continue}if(se(t,s)){let g=re(t,s);if(g!==-1){s=g;continue}}s++;continue}if(f==='"'){o=2,c=s,s++;continue}if(f==="'"){o=1,c=s,s++;continue}if(f==="`"){o=3,s++;continue}s++}else if(o===3){if(f==="\\"){s+=2;continue}if(f==="`")o=0;s++}else{if(f==="\\"){s+=2;continue}if(f===(o===1?"'":'"')){let g=t.slice(c+1,s);if((o===2&&n||o===1&&!n)&&!Ve(g,n?"'":'"')){if(c>i)e.push(t.slice(i,c));if(o===2)e.push(Qe(`"${g}"`));else e.push(Xe(`'${g}'`));i=s+1}o=0,s++;continue}s++}}if(e.length===0)return t;if(i<t.length)e.push(t.slice(i));return e.join("")}var qe=new Set(["{",",","=","+","-","*","/",";","<",">"]);function et(t){if(t.length<4)return t;let r=0;while(r<t.length&&(t[r]===" "||t[r]==="\t"))r++;if(r<t.length){let o=t[r];if(o==="/"&&(t[r+1]==="/"||t[r+1]==="*"))return t;if(o==="*")return t}let n=!1;for(let o=r;o<t.length;o++)if(qe.has(t[o])){n=!0;break}if(!n)return t;let{text:e,strings:s}=rt(t),i=e;if(i=i.replace(ke,"$1 {"),i=i.replace(_e,"{ $1"),i=i.replace(Ie,", $1"),i=i.replace(Re," = "),i=i.replace(Oe,"$1 + $2"),i=i.replace(Te,"$1 - $2"),i=i.replace(Ne,"$1 * $2"),i=i.replace(ve,"$1 / $2"),i=i.replace(Ae,"; $1"),i=i.replace(Pe,"$1 < $2"),i=i.replace(Me,"$1 > $2"),r>0){let o=i.slice(r);i=i.slice(0,r)+o.replace(Y," ")}else i=i.replace(Y," ");return s.length>0?it(i,s):i}function L(t){let r=t[t.length-1];return r!==void 0&&r.t==="tmpl"}function te(t,r,n){r++;while(r<t.length){let e=t[r];if(e==="\\"){r+=2;continue}if(e===n)return r+1;r++}return r}function F(t,r){for(let e of r)if(e.t==="tmpl")e.start=-1;let n=0;while(n<t.length){let e=r[r.length-1],s=t[n];if(e===void 0||e.t==="interp"){if(s==="`"){r.push({t:"tmpl",start:n}),n++;continue}if(s==="'"||s==='"'){n=te(t,n,s);continue}if(s==="/"&&t[n+1]==="/")break;if(e!==void 0){if(s==="{"){e.braces++,n++;continue}if(s==="}"){if(e.braces===0)r.pop();else e.braces--;n++;continue}}n++}else{if(s==="\\"){n+=2;continue}if(s==="`"){r.pop(),n++;continue}if(s==="$"&&t[n+1]==="{"){r.push({t:"interp",braces:0}),n+=2;continue}n++}}if(L(r)){for(let e of r)if(e.t==="tmpl"&&e.start>=0)return e.start}return-1}function V(t,r){let n=r,e=null,s=0;while(s<t.length){let i=t[s];if(n){if(i==="*"&&t[s+1]==="/"){n=!1,s+=2;continue}s++;continue}if(e){if(i==="\\"){s+=2;continue}if(i===e)e=null;s++;continue}if(i==="'"||i==='"'||i==="`"){e=i,s++;continue}if(i==="/"){if(t[s+1]==="/")break;if(t[s+1]==="*"){n=!0,s+=2;continue}}s++}return n}function tt(t,r){let n=t.split(`
9
+ `),e=n.length,s=Array(e),i=r.format.quotes,o=r.format.semi===!0,c=0,f=0,p=!1,g=[];for(let m=0;m<e;m++){let a=n[m];if(p){p=V(a,!0),s[m]=a;continue}let h=L(g),b=-1;if(g.length>0||a.indexOf("`")!==-1)b=F(a,g);if(h){s[m]=a;continue}if(b<0&&g.length===0)p=V(a,!1);let w="",d=!1,C="";if(b>=0){w=a.slice(b);let I=a.slice(0,b);if(I.length===0){s[m]=w;continue}if(d=j.test(I),I.trim().length===0)C=I;a=I}if(a.length===0){s[m]="";continue}a=ee(a,i);let E=0;while(E<a.length&&(a.charCodeAt(E)===32||a.charCodeAt(E)===9))E++;let k=a.slice(E).trimEnd();if(he.test(k))c=Math.max(0,c-1);let N=Se.test(k)?1:0,v=a.slice(0,E);if(a=r.format.preserveCodeIndentation?v+k:He(c+f+N,r)+k,ye.test(k))c+=1,f=0;else if(!k.startsWith("//")&&!k.startsWith("*")&&!k.startsWith("/*")){let I=k.replace(be,"");f=xe(I)?f+1:0}if(a=et(a),o){if(!Ce.test(a))if(Ee.test(a))a="";else a=a.replace($e,";")}if(r.format.trimTrailingWhitespace)a=a.trimEnd();if(b>=0){if(C)a=C;else if(d&&!j.test(a))a+=" ";a+=w}s[m]=a}return s.join(`
10
+ `)}function nt(t,r){let n=[],e=0,s=[];for(let i of t){let o=L(s);if(s.length>0||i.indexOf("`")!==-1)F(i,s);if(o){n.push(i),e=0;continue}if(i===""){if(e++,e<=r)n.push("")}else e=0,n.push(i)}return n}function Tt(t,r,n){if(t.length===0)return"";let s=(t.includes("\r")?t.replace(/\r\n/g,`
11
+ `):t).split(`
12
+ `),i;if(r.format.trimTrailingWhitespace){i=[];let p=0,g=Math.max(0,r.format.maxConsecutiveBlankLines),m=[];for(let a of s){let h=L(m),b=!1;if(m.length>0||a.indexOf("`")!==-1)b=F(a,m)>=0;if(h||b){i.push(a),p=0;continue}let w=a[a.length-1],d=w===" "||w==="\t"?a.replace(j,""):a;if(d===""){if(p++,p<=g)i.push("")}else p=0,i.push(d)}}else i=nt(s,Math.max(0,r.format.maxConsecutiveBlankLines));let o=i.join(`
13
+ `);if(o=o.replace(Ue,""),D(n))o=ct(o);if(We(n)){let p=ze(o,r);if(p!==o)o=p}if(Ge(n)){let p=ft(o,n);if(p!=null)o=p}if(Je(n,o))o=Ke(o,r);else if(D(n))o=tt(o,r);else o=Ze(o,r.format.quotes,n);if(r.format.finalNewline==="none")return o.replace(/\n+$/g,"");let c=/[^\n]\n$/.test(o)||o===`
14
+ `,f=/\n\n$/.test(o);if(r.format.finalNewline==="two"){if(f)return o;if(c)return`${o}
15
+ `;return`${o}
16
+
17
+ `}if(f)return o.replace(/\n\n$/,`
18
+ `);if(c)return o;return`${o}
19
+ `}function Z(t,r,n,e){for(let s=r+1;s<t.length;s++){let i=t[s];if(i==="\\"){s++;continue}if(i===n)return!0;if(i===e)return!1}return!0}function Nt(t,r){if(/^\s*\/\/\/\s*<reference/.test(t))return[];let n=[],e=null,s=!1;for(let i=0;i<t.length;i++){let o=t[i];if(s){s=!1;continue}if(o==="\\"){s=!0;continue}if(!e){if(o==="/"&&t[i+1]==="/")break;if(o==="'"){if(r==="double"&&Z(t,i,"'",'"'))n.push(i);e="single";continue}else if(o==='"'){if(r==="single"&&Z(t,i,'"',"'"))n.push(i);e="double";continue}else if(o==="`"){e="template";continue}}else if(e==="single"&&o==="'"||e==="double"&&o==='"'||e==="template"&&o==="`"){e=null;continue}}return n}function vt(t,r,n="spaces",e){if(n==="tabs")return/[^\t]/.test(t);if(/\t/.test(t))return!0;let s=t.length;if(e&&s%r===1){let i=e.trimStart();if(i.startsWith("* ")||i.startsWith("*/")||i==="*")return!1}return s%r!==0}function ne(t,r){let n=r+1;while(n<t.length){let e=t[n];if(e==="\\"){n+=2;continue}if(e==="`")return n+1;if(e==="$"&&t[n+1]==="{"){n+=2;let s=1;while(n<t.length&&s>0){let i=t[n];if(i==="\\"){n+=2;continue}if(i==="`"){n=ne(t,n);continue}if(i==="'"||i==='"'){n=te(t,n,i);continue}if(i==="{")s++;else if(i==="}")s--;n++}continue}n++}return n}var st=new Set(["return","typeof","instanceof","in","of","new","delete","void","do","else","case","yield","await"]);function se(t,r){let n=r-1;while(n>=0&&(t[n]===" "||t[n]==="\t"))n--;if(n<0)return!0;let e=t[n];if("(,=:[!&|?;{}<>+-*%^~".includes(e))return!0;if(/[\w$]/.test(e)){let s=n;while(s>=0&&/[\w$]/.test(t[s]))s--;return st.has(t.slice(s+1,n+1))}return!1}function re(t,r){let n=r+1,e=!1,s=-1;while(n<t.length){let i=t[n];if(i==="\\"){n+=2;continue}if(i==="["&&!e)e=!0,s=n;else if(i==="]"&&e){let o=t[s+1]==="^"?s+2:s+1;if(n!==o)e=!1}else if(i==="/"&&!e){n++;while(n<t.length&&/[a-z]/i.test(t[n]))n++;return n}n++}return-1}function rt(t){if(!t.includes("'")&&!t.includes('"')&&!t.includes("`")&&!t.includes("/"))return{text:t,strings:[]};let r=[],n=[],e=0,s=0;while(e<t.length){let i=t[e];if(i==="/"){let o=t[e+1];if(o==="/"){if(e>s)n.push(t.slice(s,e));r.push(t.slice(e)),n.push(`@@S${r.length-1}@@`),s=t.length;break}if(o==="*"){let c=t.indexOf("*/",e+2),f=c===-1?t.length:c+2;if(e>s)n.push(t.slice(s,e));r.push(t.slice(e,f)),n.push(`@@S${r.length-1}@@`),e=f,s=e;continue}if(se(t,e)){let c=re(t,e);if(c!==-1){if(e>s)n.push(t.slice(s,e));r.push(t.slice(e,c)),n.push(`@@S${r.length-1}@@`),e=c,s=e;continue}}e++;continue}if(i==="'"||i==='"'||i==="`"){if(e>s)n.push(t.slice(s,e));let o=e;if(i==="`")e=ne(t,e);else{let c=i;e++;while(e<t.length){if(t[e]==="\\"){e+=2;continue}if(t[e]===c){e++;break}e++}}r.push(t.slice(o,e)),n.push(`@@S${r.length-1}@@`),s=e;continue}e++}if(s<t.length)n.push(t.slice(s));return{text:n.join(""),strings:r}}function it(t,r){if(r.length===0)return t;return t.replace(/@@S(\d+)@@/g,(n,e)=>r[Number(e)]??"")}function ot(t){let r=new Set,n=/[$A-Z_][\w$]*/gi,e=n.exec(t);while(e!==null)r.add(e[0]),e=n.exec(t);return r}function ct(t){let r=t[0];if(r!=="i"&&r!==" "&&r!=="\t"&&r!=="/"&&r!==`
20
+ `)return t;let n=t.split(`
21
+ `),e=[],s=[],i=[],o=0,c=0,f=-1,p=!1;while(o<n.length){let l=n[o];if(H.test(l)){o++;continue}if(Le.test(l)||Q.test(l)){let y=o;if(Q.test(l)){while(o<n.length&&!n[o].includes("*/"))o++;o++}else o++;if(!p){for(let _=y;_<o&&_<n.length;_++)s.push(n[_]);c=o}else if(f<0)f=y;continue}if(!je.test(l))break;let u=l.trim(),x=o+1;while(!X.test(u)&&x<n.length&&x-o<50)u+=` ${n[x].trim()}`,x++;if(!X.test(u))return t;let S=lt(u);if(!S)return t;if(f>=0){for(let y=f;y<o;y++)if(!H.test(n[y]))i.push(n[y]);f=-1}e.push(S),o=x,c=o,p=!0}if(e.length===0)return t;let g=f>=0?f:c,m=n.slice(g).join(`
22
+ `),a=ot(m),h=(l)=>a.has(l);for(let l of e){if(l.kind!=="value")continue;l.named=l.named.filter((u)=>{if(u.alias)return!0;return h(u.name)})}let b=e.filter((l)=>{if(l.kind==="side-effect")return!0;if(l.kind==="type")return l.namedTypes.length>0;return Boolean(l.defaultName||l.namespaceName||l.named.length>0)}),w=new Map;for(let l of b){let u=w.get(l.source)||{};if(l.kind==="side-effect")u.side=u.side||[],u.side.push(l);else if(l.kind==="type"){if(!u.type)u.type={kind:"type",source:l.source,named:[],namedTypes:[],original:""};u.type.namedTypes=(u.type.namedTypes||[]).concat(l.namedTypes)}else{if(!u.value)u.value={kind:"value",source:l.source,named:[],namedTypes:[],original:""};if(l.defaultName)u.value.defaultName=l.defaultName;if(l.namespaceName)u.value.namespaceName=l.namespaceName;if(u.value.named=(u.value.named||[]).concat(l.named),l.namedTypes.length>0){if(!u.type)u.type={kind:"type",source:l.source,named:[],namedTypes:[],original:""};u.type.namedTypes=u.type.namedTypes.concat(l.namedTypes)}}w.set(l.source,u)}let d=[];for(let[l,u]of w){if(u.side)d.push(...u.side);if(u.value){let x=(S)=>{if(!S.alias)return S;return/^[A-Z]$/i.test(S.name)&&/^[A-Z]$/i.test(S.alias)?{name:S.alias,alias:S.name}:S};u.value.named=u.value.named.map(x),u.value.named.sort((S,y)=>S.name.localeCompare(y.name)),d.push(u.value)}if(u.type&&u.type.namedTypes.length>0){let x=new Set,S=(y)=>{if(!y.alias)return y;return/^[A-Z]$/i.test(y.name)&&/^[A-Z]$/i.test(y.alias)?{name:y.alias,alias:y.name}:y};u.type.namedTypes=u.type.namedTypes.map(S).filter((y)=>{let _=`${y.name}|${y.alias||""}`;if(x.has(_))return!1;return x.add(_),!0}),u.type.namedTypes.sort((y,_)=>y.name.localeCompare(_.name)),d.push(u.type)}}let C=(l)=>l.startsWith(".")?2:l.startsWith("node:")?0:1,E=(l)=>{if(l.kind!=="value")return 99;if(l.defaultName)return 0;if(l.namespaceName)return 1;return 2};d.sort((l,u)=>{if(l.kind!==u.kind){if(l.kind==="type")return-1;if(u.kind==="type")return 1;if(l.kind==="side-effect")return-1;if(u.kind==="side-effect")return 1}if(l.kind==="type"&&u.kind==="type"){let x=C(l.source),S=C(u.source);if(x!==S)return x-S;return l.source.localeCompare(u.source)}if(l.kind==="value"&&u.kind==="value"){let x=C(l.source),S=C(u.source);if(x!==S)return x-S;let y=E(l),_=E(u);if(y!==_)return y-_;return l.source.localeCompare(u.source)}return l.source.localeCompare(u.source)});let k=s.length>0?`${s.join(`
23
+ `)}
24
+ `:"";if(d.length===0){let l=m.replace(/^\n+/,""),u=[...i];if(k||u.length>0)return`${k}${u.length>0?`${u.join(`
25
+ `)}
26
+ `:""}${l}`;return l}let N=d.map(at).join(`
27
+ `),v=i.length>0?`
28
+ ${i.join(`
29
+ `)}`:"",I=m.replace(/^\n+/,""),le=I.length>0?`
30
+
31
+ `:`
32
+ `;return`${k}${N}${v}${le}${I}`}function at(t){if(t.kind==="side-effect")return`import '${t.source}'`;if(t.kind==="type")return`import type { ${t.namedTypes.map((s)=>s.alias?`${s.name} as ${s.alias}`:s.name).join(", ")} } from '${t.source}'`;let r=[];if(t.defaultName)r.push(t.defaultName);if(t.namespaceName)r.push(`* as ${t.namespaceName}`);if(t.named.length>0){let e=t.named.map((s)=>s.alias?`${s.name} as ${s.alias}`:s.name).join(", ");r.push(`{ ${e} }`)}return`import ${r.join(", ")} from '${t.source}'`}function lt(t){let r=t.match(/^\s*import\s+['"]([^'"]+)['"]/);if(r)return{kind:"side-effect",source:r[1],named:[],namedTypes:[],original:t};if(r=t.match(/^\s*import\s+type\s+\{([^}]*)\}\s+from\s+['"]([^'"]+)['"]/),r){let a=r[1],h=r[2],b=a.split(",").map((w)=>w.trim()).filter(Boolean).map((w)=>{let d=w.match(/^(\w+)(?:\s+as\s+(\w+))?$/);return{name:d?.[1]||w,alias:d?.[2]}});return{kind:"type",source:h,named:[],namedTypes:b,original:t}}let n=t.match(/^\s*import\s+/),e=new RegExp(`\\sfrom\\s+['"]([^'"]+)['"]\\s*;?$`),s=t.match(e);if(!n||!s)return;let i=s[1],o=t.slice(n[0].length,s.index).trim(),c,f,p=[],g=[],m=o.match(/\{([^}]*)\}/);if(m){let h=m[1].split(",").map((b)=>b.trim()).filter(Boolean);for(let b of h){let w=/^type\s+/.test(b),C=b.replace(/^type\s+/,"").match(/^(\w+)(?:\s+as\s+(\w+))?$/);if(!C)continue;let E={name:C[1],alias:C[2]};if(w)g.push(E);else p.push(E)}o=o.replace(/\{[\s\S]*?\}/,"").trim()}if(o.length>0){let a=o.split(",").map((h)=>h.trim()).filter(Boolean);for(let h of a)if(h.startsWith("* as "))f=h.slice(5).trim();else if(/^\w+$/.test(h))c=h}return{kind:"value",source:i,defaultName:c,namespaceName:f,named:p,namedTypes:g,original:t}}function ft(t,r){if(De.test(r))return ut(t);if(Fe.test(r))return pt(t);return null}function ie(t){try{return JSON.parse(t)}catch{return null}}function P(t,r,n=[]){let e={};for(let i of r)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i];for(let i of n){let o=Object.keys(t).filter((c)=>i.test(c)&&!(c in e)).sort();for(let c of o)e[c]=t[c]}let s=Object.keys(t).filter((i)=>!(i in e)).sort();for(let i of s)e[i]=t[i];return e}function q(t){let r={};for(let n of Object.keys(t).sort())r[n]=t[n];return r}function ut(t){let r=ie(t);if(!r||typeof r!=="object")return t;let e=P(r,["publisher","name","displayName","type","version","private","packageManager","description","author","contributors","license","funding","homepage","repository","bugs","keywords","categories","sideEffects","imports","exports","main","module","unpkg","jsdelivr","types","typesVersions","bin","icon","files","engines","activationEvents","contributes","scripts","peerDependencies","peerDependenciesMeta","dependencies","optionalDependencies","devDependencies","pnpm","overrides","resolutions","husky","simple-git-hooks","lint-staged","eslintConfig"]);if(Array.isArray(e.files)){if(e.files.every((o)=>typeof o==="string"))e.files=[...e.files].sort()}for(let i of Object.keys(e))if(/^(?:dev|peer|optional|bundled)?[Dd]ependencies(?:Meta)?$/.test(i)||/^(?:resolutions|overrides|pnpm\.overrides)$/.test(i)){if(e[i]&&typeof e[i]==="object")e[i]=q(e[i])}if(e.pnpm&&typeof e.pnpm==="object"&&e.pnpm.overrides&&typeof e.pnpm.overrides==="object")e.pnpm.overrides=q(e.pnpm.overrides);if(e.exports&&typeof e.exports==="object"){let i=e.exports,o=["types","import","require","default"];if(!Array.isArray(i)){let c={};for(let f of Object.keys(i)){let p=i[f];if(p&&typeof p==="object"&&!Array.isArray(p))c[f]=P(p,o);else c[f]=p}e.exports=c}}let s=["pre-commit","prepare-commit-msg","commit-msg","post-commit","pre-rebase","post-rewrite","post-checkout","post-merge","pre-push","pre-auto-gc"];for(let i of["gitHooks","husky","simple-git-hooks"])if(e[i]&&typeof e[i]==="object")e[i]=P(e[i],s);return JSON.stringify(e,null,2)}function pt(t){let r=ie(t);if(!r||typeof r!=="object")return t;let e=P(r,["extends","compilerOptions","references","files","include","exclude"]);if(e.compilerOptions&&typeof e.compilerOptions==="object"){let s=["incremental","composite","tsBuildInfoFile","disableSourceOfProjectReferenceRedirect","disableSolutionSearching","disableReferencedProjectLoad","target","jsx","jsxFactory","jsxFragmentFactory","jsxImportSource","lib","moduleDetection","noLib","reactNamespace","useDefineForClassFields","emitDecoratorMetadata","experimentalDecorators","libReplacement","baseUrl","rootDir","rootDirs","customConditions","module","moduleResolution","moduleSuffixes","noResolve","paths","resolveJsonModule","resolvePackageJsonExports","resolvePackageJsonImports","typeRoots","types","allowArbitraryExtensions","allowImportingTsExtensions","allowUmdGlobalAccess","allowJs","checkJs","maxNodeModuleJsDepth","strict","strictBindCallApply","strictFunctionTypes","strictNullChecks","strictPropertyInitialization","allowUnreachableCode","allowUnusedLabels","alwaysStrict","exactOptionalPropertyTypes","noFallthroughCasesInSwitch","noImplicitAny","noImplicitOverride","noImplicitReturns","noImplicitThis","noPropertyAccessFromIndexSignature","noUncheckedIndexedAccess","noUnusedLocals","noUnusedParameters","useUnknownInCatchVariables","declaration","declarationDir","declarationMap","downlevelIteration","emitBOM","emitDeclarationOnly","importHelpers","importsNotUsedAsValues","inlineSourceMap","inlineSources","mapRoot","newLine","noEmit","noEmitHelpers","noEmitOnError","outDir","outFile","preserveConstEnums","preserveValueImports","removeComments","sourceMap","sourceRoot","stripInternal","allowSyntheticDefaultImports","esModuleInterop","forceConsistentCasingInFileNames","isolatedDeclarations","isolatedModules","preserveSymlinks","verbatimModuleSyntax","erasableSyntaxOnly","skipDefaultLibCheck","skipLibCheck"];e.compilerOptions=P(e.compilerOptions,s)}return JSON.stringify(e,null,2)}import{readdirSync as dt,readFileSync as mt,statSync as ce}from"fs";import{extname as ht,isAbsolute as G,join as W,resolve as yt}from"path";var jt=5;function bt(t){let r="",n=0;while(n<t.length){let e=t[n];if(e==="*")if(t[n+1]==="*"){if(r+=".*",n+=2,t[n]==="/")n++}else r+="[^/]*",n++;else if(e==="?")r+="[^/]",n++;else if(e==="["){let s=t.indexOf("]",n);if(s===-1)r+="\\[",n++;else r+=t.slice(n,s+1),n=s+1}else if(".+^${}()|\\".includes(e))r+=`\\${e}`,n++;else r+=e,n++}return new RegExp(`^${r}$`)}function*ae(t,r,n){let e;try{e=dt(t)}catch{return}for(let s of e){if(!n&&s.startsWith("."))continue;let i=W(t,s);if(r(i))continue;let o;try{o=ce(i)}catch{continue}if(o.isDirectory())yield*ae(i,r,n);else yield i}}function*oe(t,r,n,e){yield*ae(t,K(r,e),n)}async function Dt(t,r={}){let n=r.cwd??process.cwd(),e=r.ignore??[],s=r.dot??!1,i=r.absolute??!0,o=K(e,n);if(typeof globalThis.Bun?.Glob<"u"){let f=globalThis.Bun.Glob,p=[];for(let g of t){let m=new f(g);for await(let a of m.scan({cwd:n,dot:s,onlyFiles:r.onlyFiles??!0,followSymlinks:!1})){let h=G(a)?a:W(n,a),b=h.startsWith(`${n}/`)?h.slice(n.length+1):h;if(o(h))continue;p.push(i?h:b)}}return p}let c=[];for(let f of t){if(!/[*?[{]/.test(f)){let g=G(f)?f:W(n,f);try{if(!ce(g).isDirectory()){let a=g.startsWith(`${n}/`)?g.slice(n.length+1):g;if(!o(g))c.push(i?g:a)}else for(let a of oe(g,e,s,n))c.push(i?a:a.startsWith(`${n}/`)?a.slice(n.length+1):a)}catch{}continue}let p=bt(f);for(let g of oe(n,e,s,n)){let m=g.startsWith(`${n}/`)?g.slice(n.length+1):g;if(p.test(m)||p.test(m.replace(/\\/g,"/")))c.push(i?g:m)}}return c}function Ft(t){let r=0,n=[],e=()=>{if(n.length>0&&r<t)r++,n.shift()()};return(s)=>new Promise((i,o)=>{let c=()=>{s().then((f)=>{r--,i(f),e()},(f)=>{r--,o(f),e()})};if(r<t)r++,c();else n.push(c)})}var wt={get TRACE(){return process.env.PICKIER_TRACE==="1"},get TIMEOUT_MS(){return Number(process.env.PICKIER_TIMEOUT_MS||"8000")},get RULE_TIMEOUT_MS(){return Number(process.env.PICKIER_RULE_TIMEOUT_MS||"5000")},get CONCURRENCY(){return Number(process.env.PICKIER_CONCURRENCY)||8},get DIAGNOSTICS(){return process.env.PICKIER_DIAGNOSTICS==="1"},get FAIL_ON_WARNINGS(){return process.env.PICKIER_FAIL_ON_WARNINGS==="1"},get NO_AUTO_CONFIG(){return process.env.PICKIER_NO_AUTO_CONFIG==="1"}},B=["**/node_modules/**","**/.git/**"],St=["**/node_modules/**","**/dist/**","**/build/**","**/.git/**","**/.next/**","**/.nuxt/**","**/.output/**","**/.vercel/**","**/.netlify/**","**/.cache/**","**/.turbo/**","**/.vscode/**","**/.idea/**","**/.zed/**","**/.cursor/**","**/.claude/**","**/.github/**","**/coverage/**","**/.nyc_output/**","**/.tmp/**","**/.temp/**","**/vendor/**","**/pantry/**","**/target/**","**/zig-cache/**","**/zig-out/**","**/.zig-cache/**","**/__pycache__/**","**/.pytest_cache/**","**/venv/**","**/.venv/**","**/out/**","**/.DS_Store","**/Thumbs.db"];function Ut(t,r){let n=t[r];if(n===void 0){let i=r.indexOf("/");if(i>0){let o=r.slice(0,i),c=r.slice(i+1),f=o==="general"?"pickier":o==="pickier"?"general":null;if(f)n=t[`${f}/${c}`];if(n===void 0)n=t[c]}}let e,s;if(typeof n==="string"){if(n==="error")e="error";else if(n==="warn"||n==="warning")e="warning"}else if(Array.isArray(n)&&typeof n[0]==="string"){let i=n[0];if(i==="error")e="error";else if(i==="warn"||i==="warning")e="warning";s=n[1]}return{enabled:!!e,severity:e,options:s}}function T(t,r){return`\x1B[${t}m${r}\x1B[0m`}function xt(t){return T("32",t)}function Ct(t){return T("31",t)}function Et(t){return T("33",t)}function $t(t){return T("34",t)}function kt(t){return T("90",t)}function _t(t){return T("1",t)}var Gt={green:xt,red:Ct,yellow:Et,blue:$t,gray:kt,bold:_t};function O(t,r){let n=r.ignores?[...new Set([...t.ignores||[],...r.ignores])]:t.ignores,e={...t.pluginRules||{},...r.pluginRules||{}};if((r.tailwind??t.tailwind)?.enabled&&!Object.prototype.hasOwnProperty.call(e,"pickier/sort-tailwind-classes"))e["pickier/sort-tailwind-classes"]="warn";return{...t,...r,verbose:r.verbose??t.verbose,ignores:n,lint:{...t.lint,...r.lint||{}},format:{...t.format,...r.format||{}},rules:{...t.rules,...r.rules||{}},pluginRules:e}}var U=null;async function Wt(t){if(!t){if(wt.NO_AUTO_CONFIG){if(!U)U=O(R,{});return U}try{let{getConfig:e}=await import("./chunk-ymb49mab.js"),s=await e();return O(R,s)}catch{}return O(R,{})}let r=G(t)?t:yt(process.cwd(),t);if(ht(r).toLowerCase()===".json")try{let e=mt(r,"utf8");return O(R,JSON.parse(e))}catch{return console.warn(`[pickier:warn] Config file not found: ${r}. Using default config values.`),O(R,{})}try{let e=await import(r);return O(R,e.default||e)}catch{return console.warn(`[pickier:warn] Config file not found: ${r}. Using default config values.`),O(R,{})}}function Bt(t){return t.map((r)=>{if(/[*?[\]{}()!]/.test(r))return r;if(/\.[A-Z0-9]+$/i.test(r))return r;return`${r.replace(/\/$/,"")}/**/*`})}function Jt(t,r){let n=t.lastIndexOf(".");if(n<0)return!1;let e=t.slice(n);return r.has(e)}function J(t){return t.replace(/\\/g,"/").replace(/\/+/g,"/")}function It(t){let r=[];for(let n of t){let e=J(n.trim());if(!e)continue;let s=e.match(/\*\*\/\*\.(.+)$/);if(s){r.push({raw:e,kind:"extension",value:s[1]});continue}let i=e.match(/\*\*\/(.+?)\/\*\*$/);if(i){r.push({raw:e,kind:"segment",value:i[1]});continue}let o=e.match(/\*\*\/(.+)$/);if(o)r.push({raw:e,kind:"suffix",value:o[1].replace(/\/$/,"")})}return r}function Kt(t){return[...new Set([...B,...t])]}function K(t,r=process.cwd()){let n=It([...B,...t]);if(n.length===0)return()=>!1;let e=new Set([...St,...B]);return(s)=>{let i=J(s),o=J(r).replace(/\/$/,""),c=i!==o&&!i.startsWith(`${o}/`),f=c?i:i.slice(o.length);for(let p of n){if(c&&!e.has(p.raw))continue;if(p.kind==="extension"){if(f.endsWith(`.${p.value}`))return!0;continue}if(p.kind==="segment"||p.kind==="suffix"){let g=p.value;if(f.includes(`/${g}/`)||f.endsWith(`/${g}`))return!0}}return!1}}function zt(t,r){return K(r)(t)}
33
+ export{fe as i,z as j,Tt as k,Nt as l,vt as m,ct as n,jt as o,Dt as p,Ft as q,wt as r,B as s,St as t,Ut as u,T as v,xt as w,Ct as x,Et as y,$t as z,kt as A,_t as B,Gt as C,O as D,Wt as E,Bt as F,Jt as G,Kt as H,K as I,zt as J};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{E as u,k as m}from"./chunk-j0sjsw8n.js";import{N as y}from"./chunk-cfytsdab.js";import{readFileSync as O,statSync as p,writeFileSync as x}from"fs";import{isAbsolute as d,resolve as l}from"path";async function R(r,t){let a=t.mode||"auto";if(a==="format"&&r.length===1&&!/[*?[\]{}()!]/.test(r[0]))try{let n=r[0],i=d(n)?n:l(process.cwd(),n);if(p(i).isFile()){let o=await u(t.config),c=O(i,"utf8"),f=m(c,o,i);if(t.check&&f!==c)return 1;if(t.write&&f!==c)x(i,f,"utf8");return 0}}catch{}let{runLint:e}=await import("./chunk-av6brc0s.js");if(a==="lint")return e(r,t);if(a==="format"){let n={...t,fix:!0,dryRun:!!t.check,ext:t.ext,_formatOnly:!0};return e(r,n)}if(!(t.fix===!0||t.write===!0||t.check===!0))return e(r,t);let s={...t,fix:!0,dryRun:!!t.check,ext:t.ext};return e(r,s)}
3
+ export{R as h};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{K as a,L as b,M as c}from"./chunk-6xy2rbcn.js";import"./chunk-cfytsdab.js";export{c as config,a as defaultConfig,b as getConfig};
package/dist/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{a as t,b as f,c as m,g as e}from"../chunk-fy0z5sp8.js";import{h as x}from"../chunk-q19vbsae.js";import{A as F,B as G,C as H,D as I,E as J,F as K,G as M,H as N,I as Q,J as S,k as O,l as P,m as R,n as T,o as U,p as a,q as b,r as j,s as q,t as v,u as w,v as z,w as A,x as B,y as D,z as E}from"../chunk-er69kh4d.js";import{K as r,M as o}from"../chunk-ah6h41gy.js";import"../chunk-43fsk0jg.js";export{D as yellow,N as withAlwaysIgnores,S as shouldIgnorePath,m as runLintProgrammatic,e as runLint,t as runFormat,x as run,B as red,I as mergeConfig,J as loadConfigFromPath,f as lintText,M as isCodeFile,R as hasIndentIssue,A as green,F as gray,a as glob,w as getRuleSetting,T as formatImports,O as formatCode,K as expandPatterns,P as detectQuoteIssues,r as defaultConfig,b as createLimiter,Q as createIgnoreMatcher,o as config,H as colors,z as colorize,G as bold,E as blue,v as UNIVERSAL_IGNORES,U as MAX_FIXER_PASSES,j as ENV,q as ALWAYS_IGNORES};
2
+ import{a as i,b as r,c as t,g as o}from"../chunk-0xebhmpv.js";import{h as s}from"../chunk-k110gscx.js";import{A as F,B as I,C as O,D as A,E,F as W,G as U,H as q,I as z,J as B,k as m,l as b,m as P,n as C,o as R,p as d,q as y,r as k,s as h,t as v,u as w,v as S,w as L,x as M,y as T,z as j}from"../chunk-j0sjsw8n.js";import{K as e,M as n}from"../chunk-6xy2rbcn.js";import"../chunk-cfytsdab.js";export{h as ALWAYS_IGNORES,k as ENV,R as MAX_FIXER_PASSES,v as UNIVERSAL_IGNORES,j as blue,I as bold,S as colorize,O as colors,n as config,z as createIgnoreMatcher,y as createLimiter,e as defaultConfig,b as detectQuoteIssues,W as expandPatterns,m as formatCode,C as formatImports,w as getRuleSetting,d as glob,F as gray,L as green,P as hasIndentIssue,U as isCodeFile,r as lintText,E as loadConfigFromPath,A as mergeConfig,M as red,s as run,i as runFormat,o as runLint,t as runLintProgrammatic,B as shouldIgnorePath,q as withAlwaysIgnores,T as yellow};
@@ -57,12 +57,18 @@ export declare function extractIntegrityType(integrity: string): string | null;
57
57
  * Expand host aliases to actual hostnames
58
58
  */
59
59
  export declare function expandHostAliases(hosts: string[]): string[];
60
- // Registry aliases for convenience
61
- export declare const REGISTRY_ALIASES: {
62
- npm: 'registry.npmjs.org';
63
- yarn: 'registry.yarnpkg.com';
64
- verdaccio: 'registry.verdaccio.org'
65
- };
60
+ /**
61
+ * Registry aliases for convenience
62
+ * @defaultValue
63
+ * ```ts
64
+ * {
65
+ * npm: 'registry.npmjs.org',
66
+ * yarn: 'registry.yarnpkg.com',
67
+ * verdaccio: 'registry.verdaccio.org'
68
+ * }
69
+ * ```
70
+ */
71
+ export declare const REGISTRY_ALIASES: Record<string, string>;
66
72
  /**
67
73
  * Lockfile parser for npm, yarn, and bun lockfiles.
68
74
  * Normalizes different formats into a unified structure for validation.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pickier",
3
3
  "type": "module",
4
- "version": "0.1.58",
4
+ "version": "0.1.60",
5
5
  "description": "Format, lint and more in a fraction of seconds.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "exports": {
24
24
  ".": {
25
- "types": "./dist/index.d.ts",
25
+ "types": "./dist/src/index.d.ts",
26
26
  "import": "./dist/src/index.js"
27
27
  },
28
28
  "./*": {
@@ -30,7 +30,7 @@
30
30
  }
31
31
  },
32
32
  "module": "./dist/src/index.js",
33
- "types": "./dist/index.d.ts",
33
+ "types": "./dist/src/index.d.ts",
34
34
  "bin": {
35
35
  "pickier": "./dist/bin/cli.js"
36
36
  },
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{K as a,L as b,M as c}from"./chunk-ah6h41gy.js";import"./chunk-43fsk0jg.js";export{b as getConfig,a as defaultConfig,c as config};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{b as a,c as b,d as c,e as d,f as e,g as f}from"./chunk-fy0z5sp8.js";import"./chunk-er69kh4d.js";import"./chunk-ah6h41gy.js";import"./chunk-43fsk0jg.js";export{d as scanContentOptimized,e as scanContent,b as runLintProgrammatic,f as runLint,a as lintText,c as applyPlugins};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{h as a}from"./chunk-q19vbsae.js";import"./chunk-er69kh4d.js";import"./chunk-ah6h41gy.js";import"./chunk-43fsk0jg.js";export{a as runUnified};