@visulima/tui 1.0.0-alpha.2 → 1.0.0-alpha.20

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 (669) hide show
  1. package/CHANGELOG.md +285 -0
  2. package/LICENSE.md +2650 -55
  3. package/README.md +38 -10
  4. package/dist/components/accordion.d.ts +59 -0
  5. package/dist/components/accordion.js +1 -0
  6. package/dist/components/alert.d.ts +26 -0
  7. package/dist/components/alert.js +1 -0
  8. package/dist/components/animate-presence.d.ts +18 -0
  9. package/dist/components/animate-presence.js +1 -0
  10. package/dist/components/approval-prompt.d.ts +65 -0
  11. package/dist/components/approval-prompt.js +1 -0
  12. package/dist/components/area-chart.d.ts +66 -0
  13. package/dist/components/area-chart.js +1 -0
  14. package/dist/components/badge.d.ts +22 -0
  15. package/dist/components/badge.js +1 -0
  16. package/dist/components/bar-chart.d.ts +67 -0
  17. package/dist/components/bar-chart.js +1 -0
  18. package/dist/components/big-text.d.ts +81 -0
  19. package/dist/components/big-text.js +1 -0
  20. package/dist/components/blink-dot.d.ts +36 -0
  21. package/dist/components/blink-dot.js +1 -0
  22. package/dist/components/box.d.ts +61 -0
  23. package/dist/components/box.js +1 -0
  24. package/dist/components/breadcrumb.d.ts +33 -0
  25. package/dist/components/breadcrumb.js +1 -0
  26. package/dist/components/button.d.ts +45 -0
  27. package/dist/components/button.js +1 -0
  28. package/dist/components/calendar.d.ts +72 -0
  29. package/dist/components/calendar.js +1 -0
  30. package/dist/components/canvas.d.ts +44 -0
  31. package/dist/components/canvas.js +1 -0
  32. package/dist/components/card.d.ts +57 -0
  33. package/dist/components/card.js +1 -0
  34. package/dist/components/checkbox.d.ts +48 -0
  35. package/dist/components/checkbox.js +1 -0
  36. package/dist/components/code.d.ts +48 -0
  37. package/dist/components/code.js +2 -0
  38. package/dist/components/collapsible.d.ts +53 -0
  39. package/dist/components/collapsible.js +1 -0
  40. package/dist/components/command-block.d.ts +47 -0
  41. package/dist/components/command-block.js +4 -0
  42. package/dist/components/command-palette.d.ts +82 -0
  43. package/dist/components/command-palette.js +1 -0
  44. package/dist/components/confirm-dialog.d.ts +75 -0
  45. package/dist/components/confirm-dialog.js +1 -0
  46. package/dist/components/confirm-input.d.ts +38 -0
  47. package/dist/components/confirm-input.js +1 -0
  48. package/dist/components/console-overlay.d.ts +54 -0
  49. package/dist/components/console-overlay.js +1 -0
  50. package/dist/components/content-switcher.d.ts +57 -0
  51. package/dist/components/content-switcher.js +1 -0
  52. package/dist/components/controlled-scroll-view.d.ts +60 -0
  53. package/dist/components/controlled-scroll-view.js +1 -0
  54. package/dist/components/cursor.d.ts +61 -0
  55. package/dist/components/cursor.js +1 -0
  56. package/dist/components/date-picker.d.ts +65 -0
  57. package/dist/components/date-picker.js +1 -0
  58. package/dist/components/definition-list.d.ts +44 -0
  59. package/dist/components/definition-list.js +1 -0
  60. package/dist/components/dialog.d.ts +116 -0
  61. package/dist/components/dialog.js +1 -0
  62. package/dist/components/diff-view.d.ts +85 -0
  63. package/dist/components/diff-view.js +1 -0
  64. package/dist/components/divider.d.ts +49 -0
  65. package/dist/components/divider.js +1 -0
  66. package/dist/components/file-picker-entry.d.ts +104 -0
  67. package/dist/components/file-picker-entry.js +1 -0
  68. package/dist/components/form.d.ts +81 -0
  69. package/dist/components/form.js +1 -0
  70. package/dist/components/gauge.d.ts +87 -0
  71. package/dist/components/gauge.js +1 -0
  72. package/dist/components/gradient.d.ts +59 -0
  73. package/dist/components/gradient.js +4 -0
  74. package/dist/components/heading.d.ts +33 -0
  75. package/dist/components/heading.js +1 -0
  76. package/dist/components/heatmap.d.ts +62 -0
  77. package/dist/components/heatmap.js +1 -0
  78. package/dist/components/help.d.ts +52 -0
  79. package/dist/components/help.js +1 -0
  80. package/dist/components/histogram.d.ts +62 -0
  81. package/dist/components/histogram.js +1 -0
  82. package/dist/components/kbd.d.ts +31 -0
  83. package/dist/components/kbd.js +1 -0
  84. package/dist/components/line-chart.d.ts +109 -0
  85. package/dist/components/line-chart.js +1 -0
  86. package/dist/components/link.d.ts +38 -0
  87. package/dist/components/link.js +1 -0
  88. package/dist/components/loading-indicator.d.ts +29 -0
  89. package/dist/components/loading-indicator.js +1 -0
  90. package/dist/components/markdown.d.ts +40 -0
  91. package/dist/components/markdown.js +1 -0
  92. package/dist/components/masked-input.d.ts +50 -0
  93. package/dist/components/masked-input.js +1 -0
  94. package/dist/components/menu.d.ts +78 -0
  95. package/dist/components/menu.js +1 -0
  96. package/dist/components/message-bubble.d.ts +43 -0
  97. package/dist/components/message-bubble.js +1 -0
  98. package/dist/components/model-badge.d.ts +39 -0
  99. package/dist/components/model-badge.js +1 -0
  100. package/dist/components/multi-select.d.ts +65 -0
  101. package/dist/components/multi-select.js +1 -0
  102. package/dist/components/newline.d.ts +15 -0
  103. package/dist/components/newline.js +2 -0
  104. package/dist/components/operation-tree.d.ts +49 -0
  105. package/dist/components/operation-tree.js +1 -0
  106. package/dist/components/option-list.d.ts +47 -0
  107. package/dist/components/option-list.js +1 -0
  108. package/dist/components/ordered-list.d.ts +24 -0
  109. package/dist/components/ordered-list.js +1 -0
  110. package/dist/components/paginator.d.ts +69 -0
  111. package/dist/components/paginator.js +1 -0
  112. package/dist/components/paragraph.d.ts +38 -0
  113. package/dist/components/paragraph.js +1 -0
  114. package/dist/components/placeholder.d.ts +55 -0
  115. package/dist/components/placeholder.js +1 -0
  116. package/dist/components/progress-bar.d.ts +55 -0
  117. package/dist/components/progress-bar.js +1 -0
  118. package/dist/components/radio-group.d.ts +74 -0
  119. package/dist/components/radio-group.js +1 -0
  120. package/dist/components/scatter-plot.d.ts +35 -0
  121. package/dist/components/scatter-plot.js +1 -0
  122. package/dist/components/scroll-bar-box.d.ts +36 -0
  123. package/dist/components/scroll-bar-box.js +1 -0
  124. package/dist/components/scroll-bar.d.ts +24 -0
  125. package/dist/components/scroll-bar.js +1 -0
  126. package/dist/components/scroll-list.d.ts +19 -0
  127. package/dist/components/scroll-list.js +1 -0
  128. package/dist/components/scroll-view.d.ts +9 -0
  129. package/dist/components/scroll-view.js +1 -0
  130. package/dist/components/search-input.d.ts +55 -0
  131. package/dist/components/search-input.js +1 -0
  132. package/dist/components/select-input-indicator.d.ts +32 -0
  133. package/dist/components/select-input-indicator.js +1 -0
  134. package/dist/components/select-input-item.d.ts +41 -0
  135. package/dist/components/select-input-item.js +1 -0
  136. package/dist/components/select-input.d.ts +110 -0
  137. package/dist/components/select-input.js +1 -0
  138. package/dist/components/shimmer-text.d.ts +47 -0
  139. package/dist/components/shimmer-text.js +1 -0
  140. package/dist/components/slider.d.ts +103 -0
  141. package/dist/components/slider.js +1 -0
  142. package/dist/components/spacer.d.ts +8 -0
  143. package/dist/components/spacer.js +1 -0
  144. package/dist/components/sparkline.d.ts +35 -0
  145. package/dist/components/sparkline.js +1 -0
  146. package/dist/components/spinner.d.ts +17 -0
  147. package/dist/components/spinner.js +1 -0
  148. package/dist/components/static-render.d.ts +54 -0
  149. package/dist/components/static-render.js +1 -0
  150. package/dist/components/static.d.ts +28 -0
  151. package/dist/components/static.js +1 -0
  152. package/dist/components/status-line.d.ts +37 -0
  153. package/dist/components/status-line.js +1 -0
  154. package/dist/components/status-message.d.ts +21 -0
  155. package/dist/components/status-message.js +1 -0
  156. package/dist/components/stepper.d.ts +48 -0
  157. package/dist/components/stepper.js +1 -0
  158. package/dist/components/stopwatch.d.ts +49 -0
  159. package/dist/components/stopwatch.js +1 -0
  160. package/dist/components/streaming-text.d.ts +46 -0
  161. package/dist/components/streaming-text.js +1 -0
  162. package/dist/components/switch.d.ts +55 -0
  163. package/dist/components/switch.js +1 -0
  164. package/dist/components/tab.d.ts +19 -0
  165. package/dist/components/tab.js +1 -0
  166. package/dist/components/table.d.ts +119 -0
  167. package/dist/components/table.js +1 -0
  168. package/dist/components/tabs.d.ts +107 -0
  169. package/dist/components/tabs.js +1 -0
  170. package/dist/components/tag.d.ts +35 -0
  171. package/dist/components/tag.js +1 -0
  172. package/dist/components/text-input.d.ts +48 -0
  173. package/dist/components/text-input.js +1 -0
  174. package/dist/components/text.d.ts +78 -0
  175. package/dist/components/text.js +1 -0
  176. package/dist/components/textarea.d.ts +68 -0
  177. package/dist/components/textarea.js +2 -0
  178. package/dist/components/timer.d.ts +59 -0
  179. package/dist/components/timer.js +1 -0
  180. package/dist/components/toast.d.ts +49 -0
  181. package/dist/components/toast.js +1 -0
  182. package/dist/components/tooltip.d.ts +43 -0
  183. package/dist/components/tooltip.js +1 -0
  184. package/dist/components/transform.d.ts +21 -0
  185. package/dist/components/transform.js +1 -0
  186. package/dist/components/transition.d.ts +74 -0
  187. package/dist/components/transition.js +1 -0
  188. package/dist/components/tree-view-entry.d.ts +356 -0
  189. package/dist/components/tree-view-entry.js +1 -0
  190. package/dist/components/unordered-list.d.ts +30 -0
  191. package/dist/components/unordered-list.js +1 -0
  192. package/dist/core/index.d.ts +57 -5
  193. package/dist/core/index.js +1 -5
  194. package/dist/ink/hooks/use-animation.d.ts +37 -39
  195. package/dist/ink/hooks/use-animation.js +1 -0
  196. package/dist/ink/hooks/use-app.d.ts +36 -4
  197. package/dist/ink/hooks/use-app.js +1 -0
  198. package/dist/ink/hooks/use-box-metrics.d.ts +57 -50
  199. package/dist/ink/hooks/use-box-metrics.js +1 -0
  200. package/dist/ink/hooks/use-clipboard.d.ts +26 -25
  201. package/dist/ink/hooks/use-clipboard.js +1 -0
  202. package/dist/ink/hooks/use-color-blindness.d.ts +29 -29
  203. package/dist/ink/hooks/use-color-blindness.js +1 -0
  204. package/dist/ink/hooks/use-console-capture.d.ts +38 -38
  205. package/dist/ink/hooks/use-console-capture.js +1 -0
  206. package/dist/ink/hooks/use-cursor.d.ts +10 -9
  207. package/dist/ink/hooks/use-cursor.js +1 -0
  208. package/dist/ink/hooks/use-focus-manager.d.ts +53 -38
  209. package/dist/ink/hooks/use-focus-manager.js +1 -0
  210. package/dist/ink/hooks/use-focus.d.ts +29 -25
  211. package/dist/ink/hooks/use-focus.js +1 -0
  212. package/dist/ink/hooks/use-form.d.ts +68 -0
  213. package/dist/ink/hooks/use-form.js +1 -0
  214. package/dist/ink/hooks/use-hotkey.d.ts +37 -0
  215. package/dist/ink/hooks/use-hotkey.js +1 -0
  216. package/dist/ink/hooks/use-input.d.ts +142 -142
  217. package/dist/ink/hooks/use-input.js +2 -0
  218. package/dist/ink/hooks/use-interval.d.ts +25 -0
  219. package/dist/ink/hooks/use-interval.js +1 -0
  220. package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +4 -4
  221. package/dist/ink/hooks/use-is-screen-reader-enabled.js +1 -0
  222. package/dist/ink/hooks/use-key-bindings.d.ts +50 -52
  223. package/dist/ink/hooks/use-key-bindings.js +1 -0
  224. package/dist/ink/hooks/use-key-chord.d.ts +25 -0
  225. package/dist/ink/hooks/use-key-chord.js +1 -0
  226. package/dist/ink/hooks/use-linked-scroll.d.ts +44 -37
  227. package/dist/ink/hooks/use-linked-scroll.js +1 -0
  228. package/dist/ink/hooks/use-paste.d.ts +41 -40
  229. package/dist/ink/hooks/use-paste.js +1 -0
  230. package/dist/ink/hooks/use-persistent-state.d.ts +56 -0
  231. package/dist/ink/hooks/use-persistent-state.js +2 -0
  232. package/dist/ink/hooks/use-scroll-acceleration.d.ts +43 -43
  233. package/dist/ink/hooks/use-scroll-acceleration.js +1 -0
  234. package/dist/ink/hooks/use-scroll-input.d.ts +31 -31
  235. package/dist/ink/hooks/use-scroll-input.js +1 -0
  236. package/dist/ink/hooks/use-stderr.d.ts +14 -4
  237. package/dist/ink/hooks/use-stderr.js +1 -0
  238. package/dist/ink/hooks/use-stdin.d.ts +28 -5
  239. package/dist/ink/hooks/use-stdin.js +1 -0
  240. package/dist/ink/hooks/use-stdout.d.ts +14 -4
  241. package/dist/ink/hooks/use-stdout.js +1 -0
  242. package/dist/ink/hooks/use-stopwatch.d.ts +36 -37
  243. package/dist/ink/hooks/use-stopwatch.js +1 -0
  244. package/dist/ink/hooks/use-terminal-palette.d.ts +17 -16
  245. package/dist/ink/hooks/use-terminal-palette.js +1 -0
  246. package/dist/ink/hooks/use-text-buffer.d.ts +37 -37
  247. package/dist/ink/hooks/use-text-buffer.js +4 -0
  248. package/dist/ink/hooks/use-text-selection.d.ts +40 -41
  249. package/dist/ink/hooks/use-text-selection.js +1 -0
  250. package/dist/ink/hooks/use-timeout.d.ts +24 -0
  251. package/dist/ink/hooks/use-timeout.js +1 -0
  252. package/dist/ink/hooks/use-timer.d.ts +45 -46
  253. package/dist/ink/hooks/use-timer.js +1 -0
  254. package/dist/ink/hooks/use-window-size.d.ts +14 -14
  255. package/dist/ink/hooks/use-window-size.js +1 -0
  256. package/dist/ink/index.d.ts +397 -159
  257. package/dist/ink/index.js +1 -100
  258. package/dist/packem_chunks/devtools.js +3 -26
  259. package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +1 -0
  260. package/dist/packem_shared/Cell-BrXn3jxY.js +1 -0
  261. package/dist/packem_shared/ControlledScrollView-CIc-x1Cx.js +1 -0
  262. package/dist/packem_shared/DevTools-BR7K-5JX.js +1 -0
  263. package/dist/packem_shared/FilePicker-tYj_CIau.js +1 -0
  264. package/dist/packem_shared/FocusContext-Xy0cwJpO.js +1 -0
  265. package/dist/packem_shared/Fullscreen-CxLd1-Zu.js +1 -0
  266. package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +1 -0
  267. package/dist/packem_shared/InputParser-BAqciKJ6.js +2 -0
  268. package/dist/packem_shared/KEY-Bk8B-3h_.js +1 -0
  269. package/dist/packem_shared/LayoutNode-B0qeT8sl.js +1 -0
  270. package/dist/packem_shared/MouseProvider-CHU5DuwC.js +1 -0
  271. package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +1 -0
  272. package/dist/packem_shared/Renderer-DJXooAsp.js +1 -0
  273. package/dist/packem_shared/ResizeObserverEntry-Dq0dk8Kq.js +1 -0
  274. package/dist/packem_shared/ScrollBar-U_37hlIT.js +1 -0
  275. package/dist/packem_shared/ScrollBarBox-DwiCxilX.js +1 -0
  276. package/dist/packem_shared/ScrollList-C7nZ9ufK.js +1 -0
  277. package/dist/packem_shared/ScrollView-DKZ8OM-m.js +1 -0
  278. package/dist/packem_shared/Static-DLynr5pn.js +1 -0
  279. package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +1 -0
  280. package/dist/packem_shared/TreeView-C0Iv3et8.js +1 -0
  281. package/dist/packem_shared/TuiApp-CxBtziW8.js +1 -0
  282. package/dist/packem_shared/TuiContext-BoJvG3NN.js +3 -0
  283. package/dist/packem_shared/_commonjsHelpers-CHNfUHCT.js +1 -0
  284. package/dist/packem_shared/accessibility-context-DDyHTwmA.js +1 -0
  285. package/dist/packem_shared/animation-context-DW3p-vpk.js +1 -0
  286. package/dist/packem_shared/ansi-parser-C5JuL732.js +1 -0
  287. package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +1 -0
  288. package/dist/packem_shared/app-context-BVpKlG1z.js +1 -0
  289. package/dist/packem_shared/background-context-rjOaWFki.js +1 -0
  290. package/dist/packem_shared/boxes-DyY_LXCi.js +1 -0
  291. package/dist/packem_shared/braille-BBjIoaN0.js +1 -0
  292. package/dist/packem_shared/buffer.d-EJkZr8uH.d.ts +39 -0
  293. package/dist/packem_shared/clipboard.d-D6lZTQ21.d.ts +23 -0
  294. package/dist/packem_shared/color-matrix.d-DSXLsB64.d.ts +50 -0
  295. package/dist/packem_shared/colorize-gy_cY-wC.js +2 -0
  296. package/dist/packem_shared/comparePoints-Dez5FkH9.js +1 -0
  297. package/dist/packem_shared/constants-D12jy2Zh-RSfxu1eM.js +1 -0
  298. package/dist/packem_shared/controlled-scroll-view-CcUS50jx.js +1 -0
  299. package/dist/packem_shared/createInlineLoop-D0JaKX9A.js +2 -0
  300. package/dist/packem_shared/createScreen-87XLHZq6.js +3 -0
  301. package/dist/packem_shared/cursor-context-CFviBqPX.js +1 -0
  302. package/dist/packem_shared/cursor-helpers.d-BONB9tky.d.ts +12 -0
  303. package/dist/packem_shared/dom-CW6KYzFK.js +8 -0
  304. package/dist/packem_shared/dom.d-DgP_exKU.d.ts +412 -0
  305. package/dist/packem_shared/erase-DKKNxHZ_.js +1 -0
  306. package/dist/packem_shared/focus-context-CsT69klR.js +1 -0
  307. package/dist/packem_shared/format-time-C7Q-hQZq.js +1 -0
  308. package/dist/packem_shared/get-string-width-CbMPWEJO.js +1 -0
  309. package/dist/packem_shared/getPathToRoot-B3q6OlQy.js +1 -0
  310. package/dist/packem_shared/getScrollHeight-ClEOyLHH.js +1 -0
  311. package/dist/packem_shared/index-COPEEDn3.js +9 -0
  312. package/dist/packem_shared/index-CqsHHJkn.js +75 -0
  313. package/dist/packem_shared/index.d-Bk52cbgN.d.ts +14 -0
  314. package/dist/packem_shared/index.server.d-eZWyC2Ku.d.ts +5 -0
  315. package/dist/packem_shared/input-utils-fAxzSlNh.js +1 -0
  316. package/dist/packem_shared/input.d-D-Yxqha8.d.ts +172 -0
  317. package/dist/packem_shared/isIntersecting-B3KbKTmu.js +1 -0
  318. package/dist/packem_shared/isOsc52Supported-DKK7Uee6.js +1 -0
  319. package/dist/packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js +1 -0
  320. package/dist/packem_shared/kittyFlags-C3rZLbcK.js +1 -0
  321. package/dist/packem_shared/layout-BMo200nF.js +2 -0
  322. package/dist/packem_shared/line-chart-kf7uhR0K.js +1 -0
  323. package/dist/packem_shared/measure-text-D-jVetsl.js +3 -0
  324. package/dist/packem_shared/measureElement-BTtTFZg4.js +1 -0
  325. package/dist/packem_shared/mode-BOIU4Roy.js +1 -0
  326. package/dist/packem_shared/mouse-context-DaARgUu1.js +1 -0
  327. package/dist/packem_shared/parseSgrMouse-DoBY7MKw.js +1 -0
  328. package/dist/packem_shared/processLayout-FEKj_mWu.js +1 -0
  329. package/dist/packem_shared/reconciler-CGhHgXXG.js +1 -0
  330. package/dist/packem_shared/reconciler-ClRKkLS4.js +1 -0
  331. package/dist/packem_shared/render-BoukeuYD.js +1 -0
  332. package/dist/packem_shared/render-CBFHzIKj.js +27 -0
  333. package/dist/packem_shared/render.d-DarVJBG2.d.ts +417 -0
  334. package/dist/packem_shared/renderToString-Cx3DmmMR.js +4 -0
  335. package/dist/packem_shared/renderToString-nZdqfdWT.js +2 -0
  336. package/dist/packem_shared/renderTreeToBuffer-LnGZkEUX.js +2 -0
  337. package/dist/packem_shared/renderer-C2ycheBL.js +17 -0
  338. package/dist/packem_shared/scroll-view.d-DtpsgHLg.d.ts +119 -0
  339. package/dist/packem_shared/selection.d-WuD_83yQ.d.ts +62 -0
  340. package/dist/packem_shared/setEnableStyledLineCache-Cke6_ZQt.js +1 -0
  341. package/dist/packem_shared/squashTextNodesWithMap-DCdi3SZ2.js +1 -0
  342. package/dist/packem_shared/stderr-context-BzEaUICS.js +1 -0
  343. package/dist/packem_shared/stdin-context-BTaaFagk.js +1 -0
  344. package/dist/packem_shared/stdout-context-BnblEPez.js +1 -0
  345. package/dist/packem_shared/strip-C6HQYmlg.js +1 -0
  346. package/dist/packem_shared/styles.d-CLJdt-kg.d.ts +492 -0
  347. package/dist/packem_shared/terminal-palette.d-D2SQjfn-.d.ts +19 -0
  348. package/dist/packem_shared/text-width-CI9G0a-z.js +2 -0
  349. package/dist/packem_shared/token-to-elements-BAZpNZsu.js +1 -0
  350. package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +1 -0
  351. package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +1 -0
  352. package/dist/packem_shared/useMouseAction-2dRfU1vE.js +1 -0
  353. package/dist/packem_shared/useMouseContext-C746G7kY.js +1 -0
  354. package/dist/packem_shared/useMousePosition-BTWfV4JK.js +1 -0
  355. package/dist/packem_shared/useOnMouseClick-nY8xLZmt.js +1 -0
  356. package/dist/packem_shared/useOnMouseHover-D3DczIol.js +1 -0
  357. package/dist/packem_shared/useOnMouseState-cRK8QvzD.js +1 -0
  358. package/dist/packem_shared/useTreeView-BoMMeRPq.js +1 -0
  359. package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +1 -0
  360. package/dist/packem_shared/utils-THUhYKG2.js +1 -0
  361. package/dist/packem_shared/variant-config-BJqpNo7H.js +1 -0
  362. package/dist/packem_shared/variant-config.d-D5NnrrQK.d.ts +2 -0
  363. package/dist/packem_shared/waitFor-Dj5zfL5s.js +4 -0
  364. package/dist/packem_shared/wrapOrTruncateStyledLine-kyi6yijx.js +3 -0
  365. package/dist/react/index.d.ts +518 -8
  366. package/dist/react/index.js +1 -9
  367. package/dist/testing/index.d.ts +277 -135
  368. package/dist/testing/index.js +1 -260
  369. package/index.js +52 -52
  370. package/package.json +552 -40
  371. package/dist/core/app.d.ts +0 -50
  372. package/dist/core/cell.d.ts +0 -33
  373. package/dist/core/inline.d.ts +0 -22
  374. package/dist/core/input.d.ts +0 -18
  375. package/dist/core/native-binding.d.ts +0 -22
  376. package/dist/ink/ansi-to-cell.d.ts +0 -5
  377. package/dist/ink/ansi-tokenizer.d.ts +0 -38
  378. package/dist/ink/clipboard.d.ts +0 -29
  379. package/dist/ink/color-matrix.d.ts +0 -49
  380. package/dist/ink/color-utils.d.ts +0 -30
  381. package/dist/ink/colorize.d.ts +0 -4
  382. package/dist/ink/components/AccessibilityContext.d.ts +0 -4
  383. package/dist/ink/components/Alert.d.ts +0 -30
  384. package/dist/ink/components/AnimationContext.d.ts +0 -10
  385. package/dist/ink/components/App.d.ts +0 -19
  386. package/dist/ink/components/AppContext.d.ts +0 -38
  387. package/dist/ink/components/BackgroundContext.d.ts +0 -5
  388. package/dist/ink/components/Badge.d.ts +0 -27
  389. package/dist/ink/components/BigText.d.ts +0 -71
  390. package/dist/ink/components/Box.d.ts +0 -58
  391. package/dist/ink/components/Code.d.ts +0 -46
  392. package/dist/ink/components/ConfirmInput.d.ts +0 -40
  393. package/dist/ink/components/ConsoleOverlay.d.ts +0 -52
  394. package/dist/ink/components/Cursor.d.ts +0 -43
  395. package/dist/ink/components/CursorContext.d.ts +0 -12
  396. package/dist/ink/components/Dialog.d.ts +0 -93
  397. package/dist/ink/components/DiffView.d.ts +0 -71
  398. package/dist/ink/components/ErrorBoundary.d.ts +0 -17
  399. package/dist/ink/components/ErrorOverview.d.ts +0 -6
  400. package/dist/ink/components/FocusContext.d.ts +0 -17
  401. package/dist/ink/components/Gradient.d.ts +0 -38
  402. package/dist/ink/components/Help.d.ts +0 -49
  403. package/dist/ink/components/Link.d.ts +0 -34
  404. package/dist/ink/components/Markdown.d.ts +0 -34
  405. package/dist/ink/components/MultiSelect.d.ts +0 -63
  406. package/dist/ink/components/Newline.d.ts +0 -12
  407. package/dist/ink/components/OrderedList.d.ts +0 -30
  408. package/dist/ink/components/Paginator.d.ts +0 -75
  409. package/dist/ink/components/ProgressBar.d.ts +0 -51
  410. package/dist/ink/components/SelectInput.d.ts +0 -96
  411. package/dist/ink/components/SelectInputIndicator.d.ts +0 -36
  412. package/dist/ink/components/SelectInputItem.d.ts +0 -43
  413. package/dist/ink/components/Slider.d.ts +0 -92
  414. package/dist/ink/components/Spacer.d.ts +0 -7
  415. package/dist/ink/components/Spinner.d.ts +0 -42
  416. package/dist/ink/components/Static.d.ts +0 -24
  417. package/dist/ink/components/StaticRender.d.ts +0 -28
  418. package/dist/ink/components/StatusMessage.d.ts +0 -26
  419. package/dist/ink/components/StderrContext.d.ts +0 -16
  420. package/dist/ink/components/StdinContext.d.ts +0 -29
  421. package/dist/ink/components/StdoutContext.d.ts +0 -16
  422. package/dist/ink/components/Stopwatch.d.ts +0 -44
  423. package/dist/ink/components/Tab.d.ts +0 -25
  424. package/dist/ink/components/Table.d.ts +0 -80
  425. package/dist/ink/components/Tabs.d.ts +0 -104
  426. package/dist/ink/components/Text.d.ts +0 -63
  427. package/dist/ink/components/TextInput.d.ts +0 -48
  428. package/dist/ink/components/Textarea.d.ts +0 -62
  429. package/dist/ink/components/Timer.d.ts +0 -52
  430. package/dist/ink/components/Transform.d.ts +0 -16
  431. package/dist/ink/components/UnorderedList.d.ts +0 -35
  432. package/dist/ink/components/file-picker/FilePicker.d.ts +0 -75
  433. package/dist/ink/components/file-picker/index.d.ts +0 -3
  434. package/dist/ink/components/file-picker/types.d.ts +0 -38
  435. package/dist/ink/components/file-picker/use-file-system.d.ts +0 -16
  436. package/dist/ink/components/scroll/ControlledScrollView.d.ts +0 -43
  437. package/dist/ink/components/scroll/ScrollBar.d.ts +0 -20
  438. package/dist/ink/components/scroll/ScrollBarBox.d.ts +0 -15
  439. package/dist/ink/components/scroll/ScrollList.d.ts +0 -12
  440. package/dist/ink/components/scroll/ScrollView.d.ts +0 -98
  441. package/dist/ink/components/scroll/index.d.ts +0 -10
  442. package/dist/ink/components/scroll/use-state-ref.d.ts +0 -8
  443. package/dist/ink/components/tree-view/TreeView.d.ts +0 -89
  444. package/dist/ink/components/tree-view/TreeViewNode.d.ts +0 -29
  445. package/dist/ink/components/tree-view/index.d.ts +0 -11
  446. package/dist/ink/components/tree-view/theme.d.ts +0 -24
  447. package/dist/ink/components/tree-view/tree-node-map.d.ts +0 -72
  448. package/dist/ink/components/tree-view/types.d.ts +0 -55
  449. package/dist/ink/components/tree-view/use-tree-view-state.d.ts +0 -135
  450. package/dist/ink/components/tree-view/use-tree-view.d.ts +0 -26
  451. package/dist/ink/components/variant-config.d.ts +0 -10
  452. package/dist/ink/cursor-helpers.d.ts +0 -38
  453. package/dist/ink/data-limited-lru-map.d.ts +0 -21
  454. package/dist/ink/devtools-window-polyfill.d.ts +0 -1
  455. package/dist/ink/devtools.d.ts +0 -1
  456. package/dist/ink/dom.d.ts +0 -213
  457. package/dist/ink/get-max-width.d.ts +0 -3
  458. package/dist/ink/highlighter.d.ts +0 -28
  459. package/dist/ink/ime-utils.d.ts +0 -25
  460. package/dist/ink/ink.d.ts +0 -189
  461. package/dist/ink/input-parser.d.ts +0 -10
  462. package/dist/ink/input-utils.d.ts +0 -16
  463. package/dist/ink/instances.d.ts +0 -3
  464. package/dist/ink/kitty-keyboard.d.ts +0 -23
  465. package/dist/ink/layout.d.ts +0 -26
  466. package/dist/ink/log-update-native.d.ts +0 -14
  467. package/dist/ink/log-update.d.ts +0 -21
  468. package/dist/ink/measure-element.d.ts +0 -147
  469. package/dist/ink/measure-text.d.ts +0 -56
  470. package/dist/ink/mouse/Fullscreen.d.ts +0 -8
  471. package/dist/ink/mouse/MouseProvider.d.ts +0 -11
  472. package/dist/ink/mouse/ansi-parser.d.ts +0 -37
  473. package/dist/ink/mouse/constants.d.ts +0 -59
  474. package/dist/ink/mouse/index.d.ts +0 -20
  475. package/dist/ink/mouse/is-intersecting.d.ts +0 -18
  476. package/dist/ink/mouse/mouse-context.d.ts +0 -36
  477. package/dist/ink/mouse/use-element-position.d.ts +0 -29
  478. package/dist/ink/mouse/use-mouse-action.d.ts +0 -7
  479. package/dist/ink/mouse/use-mouse-position.d.ts +0 -7
  480. package/dist/ink/mouse/use-mouse.d.ts +0 -7
  481. package/dist/ink/mouse/use-on-mouse-click.d.ts +0 -14
  482. package/dist/ink/mouse/use-on-mouse-hover.d.ts +0 -8
  483. package/dist/ink/mouse/use-on-mouse-state.d.ts +0 -11
  484. package/dist/ink/output.d.ts +0 -74
  485. package/dist/ink/parse-keypress.d.ts +0 -22
  486. package/dist/ink/reconciler.d.ts +0 -3
  487. package/dist/ink/region.d.ts +0 -99
  488. package/dist/ink/render-background.d.ts +0 -4
  489. package/dist/ink/render-border.d.ts +0 -4
  490. package/dist/ink/render-node-to-output.d.ts +0 -38
  491. package/dist/ink/render-scrollbar.d.ts +0 -9
  492. package/dist/ink/render-sticky.d.ts +0 -44
  493. package/dist/ink/render-to-string.d.ts +0 -37
  494. package/dist/ink/render.d.ts +0 -191
  495. package/dist/ink/renderer.d.ts +0 -17
  496. package/dist/ink/resize-observer.d.ts +0 -44
  497. package/dist/ink/sanitize-ansi.d.ts +0 -2
  498. package/dist/ink/scroll.d.ts +0 -23
  499. package/dist/ink/selection.d.ts +0 -70
  500. package/dist/ink/squash-text-nodes.d.ts +0 -18
  501. package/dist/ink/style-flags.d.ts +0 -17
  502. package/dist/ink/styled-line-factory.d.ts +0 -25
  503. package/dist/ink/styled-line-serializer.d.ts +0 -18
  504. package/dist/ink/styled-line.d.ts +0 -109
  505. package/dist/ink/styles.d.ts +0 -369
  506. package/dist/ink/terminal-palette.d.ts +0 -25
  507. package/dist/ink/text-wrap.d.ts +0 -10
  508. package/dist/ink/token-to-elements.d.ts +0 -22
  509. package/dist/ink/utils/format-time.d.ts +0 -4
  510. package/dist/ink/utils.d.ts +0 -9
  511. package/dist/ink/wrap-text.d.ts +0 -3
  512. package/dist/ink/write-synchronized.d.ts +0 -4
  513. package/dist/packem_shared/AccessibilityContext-BLelHhNU.js +0 -7
  514. package/dist/packem_shared/Alert-Dr3s_LD9.js +0 -17
  515. package/dist/packem_shared/AnimationContext-BcJg8Jr6.js +0 -15
  516. package/dist/packem_shared/AppContext-CP0U6H7O.js +0 -11
  517. package/dist/packem_shared/BackgroundContext-BAUaxfOb.js +0 -5
  518. package/dist/packem_shared/Badge-Dk7EGGM6.js +0 -13
  519. package/dist/packem_shared/BigText-CjMdY63X.js +0 -24
  520. package/dist/packem_shared/Box-D_pSJ9Jp.js +0 -73
  521. package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-BsMy5Ewl.js +0 -81
  522. package/dist/packem_shared/Cell-DCg1kJY-.js +0 -48
  523. package/dist/packem_shared/Code-DjQvPBD9.js +0 -53
  524. package/dist/packem_shared/ConfirmInput-85Y4kRQW.js +0 -44
  525. package/dist/packem_shared/ConsoleOverlay-DBNa4vtj.js +0 -57
  526. package/dist/packem_shared/ControlledScrollView-BlOaxcsN.js +0 -286
  527. package/dist/packem_shared/ControlledScrollView-DfAhcufF.js +0 -5
  528. package/dist/packem_shared/Cursor-DiW7YoSK.js +0 -18
  529. package/dist/packem_shared/CursorContext-JxRzlqAx.js +0 -9
  530. package/dist/packem_shared/DevTools-aMPIsaHx.js +0 -61
  531. package/dist/packem_shared/Dialog-DsSNAVgC.js +0 -71
  532. package/dist/packem_shared/DiffView-hqaw-2S6.js +0 -329
  533. package/dist/packem_shared/FilePicker-DNwFxRhq.js +0 -254
  534. package/dist/packem_shared/FocusContext-CWkYtgcm.js +0 -26
  535. package/dist/packem_shared/FocusContext-D5wFxSRz.js +0 -153
  536. package/dist/packem_shared/Fullscreen-DrElAE1o.js +0 -11
  537. package/dist/packem_shared/Gradient-Ql5P0GUd.js +0 -136
  538. package/dist/packem_shared/Help-6wanGG38.js +0 -112
  539. package/dist/packem_shared/IMECompositionBuffer-Dl3S0KnF.js +0 -55
  540. package/dist/packem_shared/InputParser-BKHpWfvN.js +0 -156
  541. package/dist/packem_shared/LayoutNode-Cjnsodiy.js +0 -131
  542. package/dist/packem_shared/Link-COcKYfGT.js +0 -66
  543. package/dist/packem_shared/Markdown-y1ISztof.js +0 -212
  544. package/dist/packem_shared/MouseProvider-Y9TSSEGl.js +0 -136
  545. package/dist/packem_shared/MultiSelect-ChoLUcDI.js +0 -129
  546. package/dist/packem_shared/NAMED_COLORS-a4QBvb5r.js +0 -262
  547. package/dist/packem_shared/Newline-DBtYEg8x.js +0 -7
  548. package/dist/packem_shared/OrderedList-Cp7pXr6m.js +0 -26
  549. package/dist/packem_shared/Paginator-D1AuD-kj.js +0 -104
  550. package/dist/packem_shared/ProgressBar-DOfpVagn.js +0 -22
  551. package/dist/packem_shared/Renderer-zZ5O3vxc.js +0 -31
  552. package/dist/packem_shared/ResizeObserverEntry-Br4seLeQ.js +0 -102
  553. package/dist/packem_shared/ScrollBar-EWAs2Uc7.js +0 -106
  554. package/dist/packem_shared/ScrollBarBox-DTNNlh7R.js +0 -72
  555. package/dist/packem_shared/ScrollList-DCeIFL8M.js +0 -227
  556. package/dist/packem_shared/ScrollView-v3MCNIyX.js +0 -196
  557. package/dist/packem_shared/SelectInput-BN2TMyxp.js +0 -260
  558. package/dist/packem_shared/SelectInputIndicator-DkRMoH_b.js +0 -9
  559. package/dist/packem_shared/SelectInputItem-BF9LQgKu.js +0 -8
  560. package/dist/packem_shared/Slider-BWD7xZX6.js +0 -116
  561. package/dist/packem_shared/Spacer-Bs4ER-HK.js +0 -8
  562. package/dist/packem_shared/Spinner-BuI-kN4p.js +0 -1799
  563. package/dist/packem_shared/Static-DpTd6Eed.js +0 -22
  564. package/dist/packem_shared/Static-xmD9giJj.js +0 -18
  565. package/dist/packem_shared/StaticRender-tYwH6QXl.js +0 -33
  566. package/dist/packem_shared/StatusMessage-BtSYxzwb.js +0 -14
  567. package/dist/packem_shared/StderrContext-Bj4Mf7v7.js +0 -17
  568. package/dist/packem_shared/StdinContext-Bq_GNJ3z.js +0 -38
  569. package/dist/packem_shared/StdoutContext-CgjWeCdO.js +0 -17
  570. package/dist/packem_shared/Stopwatch-DjtTCyHn.js +0 -23
  571. package/dist/packem_shared/Tab-C6r5q4hR.js +0 -7
  572. package/dist/packem_shared/Table-D-rSVlzb.js +0 -82
  573. package/dist/packem_shared/Tabs-hki-KRnx.js +0 -153
  574. package/dist/packem_shared/Text-DvAUdZcK.js +0 -65
  575. package/dist/packem_shared/TextInput-C79WEQ5U.js +0 -137
  576. package/dist/packem_shared/Textarea-Dj06R6Zd.js +0 -272
  577. package/dist/packem_shared/Timer-wi9zuh4n.js +0 -22
  578. package/dist/packem_shared/Transform-BHxY_dAM.js +0 -14
  579. package/dist/packem_shared/TreeNodeMap-CtJUvBnd.js +0 -155
  580. package/dist/packem_shared/TreeView-C2062dtj.js +0 -148
  581. package/dist/packem_shared/TuiApp-DfxOnXqi.js +0 -120
  582. package/dist/packem_shared/TuiContext-CqEjMyXd.js +0 -415
  583. package/dist/packem_shared/UnorderedList-DhnadWjX.js +0 -33
  584. package/dist/packem_shared/ansi-parser-0BdVTKho.js +0 -41
  585. package/dist/packem_shared/ansi-tokenizer-LHq2LUWA.js +0 -307
  586. package/dist/packem_shared/boxes-oi3WUbyR.js +0 -92
  587. package/dist/packem_shared/colorize-88_Vk8cn.js +0 -48
  588. package/dist/packem_shared/comparePoints-CGMDnd3_.js +0 -287
  589. package/dist/packem_shared/createInlineLoop-BxMmcq9D.js +0 -93
  590. package/dist/packem_shared/createLinkedScrollGroup-Djw4Ceo0.js +0 -44
  591. package/dist/packem_shared/dom-DvzhsAez.js +0 -225
  592. package/dist/packem_shared/format-time-BGmnDukX.js +0 -12
  593. package/dist/packem_shared/getPathToRoot-a1wbwxfL.js +0 -4
  594. package/dist/packem_shared/getScrollHeight-BubfU_df.js +0 -63
  595. package/dist/packem_shared/input-utils-ViAEXa0Z.js +0 -19
  596. package/dist/packem_shared/isIntersecting-fEXHJN5R.js +0 -10
  597. package/dist/packem_shared/isOsc52Supported-G0k4sXJx.js +0 -36
  598. package/dist/packem_shared/isTerminalPaletteQuerySupported-EeiwMKbr.js +0 -93
  599. package/dist/packem_shared/kittyFlags-bNNf_9kX.js +0 -26
  600. package/dist/packem_shared/measure-element-Reza_yfC.js +0 -396
  601. package/dist/packem_shared/measure-text-DItZYotK.js +0 -1189
  602. package/dist/packem_shared/measureElement-CTgFCmKd.js +0 -4
  603. package/dist/packem_shared/mouse-context-BUHWKEIe.js +0 -6
  604. package/dist/packem_shared/parseSgrMouse-BHVBPP9G.js +0 -1
  605. package/dist/packem_shared/processLayout-BQ9kXfd3.js +0 -2
  606. package/dist/packem_shared/reconciler-BXf6miSS.js +0 -211
  607. package/dist/packem_shared/reconciler-gfmqURLy.js +0 -680
  608. package/dist/packem_shared/render-BAwdjfki.js +0 -2806
  609. package/dist/packem_shared/render-Bpjhf0lD.js +0 -195
  610. package/dist/packem_shared/renderToString-Cfg55DRD.js +0 -62
  611. package/dist/packem_shared/renderToString-ClIaXgrC.js +0 -86
  612. package/dist/packem_shared/renderTreeToBuffer-D3mo7M7m.js +0 -308
  613. package/dist/packem_shared/renderer-B3wROkeg.js +0 -1431
  614. package/dist/packem_shared/setEnableStyledLineCache-BpskngSJ.js +0 -2
  615. package/dist/packem_shared/squashTextNodesWithMap-iqm6OMMT.js +0 -100
  616. package/dist/packem_shared/text-width-DhuarWcB.js +0 -42
  617. package/dist/packem_shared/token-to-elements-BRFl_rzw.js +0 -249
  618. package/dist/packem_shared/treeViewTheme-BpSw9TMf.js +0 -52
  619. package/dist/packem_shared/useAnimation-kj31sA-T.js +0 -62
  620. package/dist/packem_shared/useApp-DPQlRzi5.js +0 -6
  621. package/dist/packem_shared/useBoxMetrics-rBjKc-g4.js +0 -54
  622. package/dist/packem_shared/useClipboard-B_9-adw1.js +0 -23
  623. package/dist/packem_shared/useColorBlindness-D_sTIhcb.js +0 -30
  624. package/dist/packem_shared/useConsoleCapture-Dvt7G1W1.js +0 -61
  625. package/dist/packem_shared/useCursor-BIJzc8k9.js +0 -19
  626. package/dist/packem_shared/useElementDimensions-CAoKitVD.js +0 -67
  627. package/dist/packem_shared/useFocus-CNl5QHHf.js +0 -37
  628. package/dist/packem_shared/useFocusManager-BPYaUuKQ.js +0 -16
  629. package/dist/packem_shared/useInput-Cfp5zB2s.js +0 -594
  630. package/dist/packem_shared/useIsScreenReaderEnabled-CnGKCe0f.js +0 -9
  631. package/dist/packem_shared/useKeyBindings-B78l1E1n.js +0 -66
  632. package/dist/packem_shared/useMouseAction-C5gZ2nj7.js +0 -29
  633. package/dist/packem_shared/useMouseContext-D-rFy60Q.js +0 -12
  634. package/dist/packem_shared/useMousePosition-BHBJ-kBk.js +0 -25
  635. package/dist/packem_shared/useOnMouseClick--ZIyBOBO.js +0 -35
  636. package/dist/packem_shared/useOnMouseHover-26diuXUC.js +0 -32
  637. package/dist/packem_shared/useOnMouseState-NO_Kda_C.js +0 -13
  638. package/dist/packem_shared/usePaste-Ct8J4AGR.js +0 -35
  639. package/dist/packem_shared/useScrollAcceleration-R9LfrPVG.js +0 -73
  640. package/dist/packem_shared/useScrollInput-D3CpBq_a.js +0 -72
  641. package/dist/packem_shared/useStderr-CAOVUh4E.js +0 -6
  642. package/dist/packem_shared/useStdin-X-O0kd-n.js +0 -7
  643. package/dist/packem_shared/useStdout-DyF6DSH0.js +0 -6
  644. package/dist/packem_shared/useStopwatch-qC4Beai4.js +0 -33
  645. package/dist/packem_shared/useTerminalPalette-BaWO2c4Q.js +0 -38
  646. package/dist/packem_shared/useTextBuffer-C8fEe9Ly.js +0 -398
  647. package/dist/packem_shared/useTextSelection-mXtxgsPK.js +0 -50
  648. package/dist/packem_shared/useTimer-CPQ7j827.js +0 -46
  649. package/dist/packem_shared/useTreeView-BT57P3Kx.js +0 -101
  650. package/dist/packem_shared/useTreeViewState-BpS_KZ-K.js +0 -502
  651. package/dist/packem_shared/useWindowSize-ugEmGZJm.js +0 -20
  652. package/dist/packem_shared/utils-BgdlrbOH.js +0 -140
  653. package/dist/packem_shared/variant-config-DSZoX5TM.js +0 -8
  654. package/dist/packem_shared/wrapOrTruncateStyledLine-DN3Nogoc.js +0 -147
  655. package/dist/react/devtools.d.ts +0 -27
  656. package/dist/react/focus.d.ts +0 -39
  657. package/dist/react/hooks.d.ts +0 -238
  658. package/dist/react/layout.d.ts +0 -35
  659. package/dist/react/react.d.ts +0 -57
  660. package/dist/react/reconciler.d.ts +0 -4
  661. package/dist/react/render-to-string.d.ts +0 -21
  662. package/dist/react/renderer.d.ts +0 -2
  663. package/dist/react/scene.d.ts +0 -3
  664. package/dist/react/static.d.ts +0 -39
  665. package/dist/react/styles.d.ts +0 -83
  666. package/dist/react/text-width.d.ts +0 -20
  667. package/dist/testing/keys.d.ts +0 -89
  668. package/dist/testing/screen.d.ts +0 -35
  669. package/dist/testing/wait-for.d.ts +0 -21
@@ -0,0 +1,75 @@
1
+ var M=Object.defineProperty;var o=(p,r)=>M(p,"name",{value:r,configurable:!0});import"./_commonjsHelpers-CHNfUHCT.js";var lib={},types={},hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,Object.defineProperty(types,"__esModule",{value:!0})),types}o(requireTypes,"requireTypes");var ee={},taskCollection$1={},taskCollection={},utils$1={},hasRequiredUtils$1;function requireUtils$1(){if(hasRequiredUtils$1)return utils$1;hasRequiredUtils$1=1;var p=Object.defineProperty,r=o((u,f)=>p(u,"name",{value:f,configurable:!0}),"s");Object.defineProperty(utils$1,"__esModule",{value:!0}),utils$1._fast_remove_single=void 0;function d(u,f){f!==-1&&(f===0?u.shift():f===u.length-1?u.length=u.length-1:u.splice(f,1))}return o(d,"_fast_remove_single"),r(d,"_fast_remove_single"),utils$1._fast_remove_single=d,utils$1}o(requireUtils$1,"requireUtils$1");var bakeCollection={},hasRequiredBakeCollection;function requireBakeCollection(){return hasRequiredBakeCollection||(hasRequiredBakeCollection=1,(function(exports$1){var i=Object.defineProperty,t=o((p,r)=>i(p,"name",{value:r,configurable:!0}),"t");Object.defineProperty(exports$1,"__esModule",{value:!0}),exports$1.bakeCollectionVariadic=exports$1.bakeCollectionAwait=exports$1.bakeCollection=exports$1.BAKED_EMPTY_FUNC=void 0,exports$1.BAKED_EMPTY_FUNC=(function(){});var FORLOOP_FALLBACK=1500;function generateArgsDefCode(p){var r="";if(p===0)return r;for(var d=0;d<p-1;++d)r+="arg"+String(d)+", ";return r+="arg"+String(p-1),r}o(generateArgsDefCode,"generateArgsDefCode"),t(generateArgsDefCode,"generateArgsDefCode");function generateBodyPartsCode(p,r){for(var d="",u="",f=0;f<r;++f)d+="var f".concat(f," = collection[").concat(f,`];
2
+ `),u+="f".concat(f,"(").concat(p,`)
3
+ `);return{funcDefCode:d,funcCallCode:u}}o(generateBodyPartsCode,"generateBodyPartsCode"),t(generateBodyPartsCode,"generateBodyPartsCode");function generateBodyPartsVariadicCode(p){for(var r="",d="",u=0;u<p;++u)r+="var f".concat(u," = collection[").concat(u,`];
4
+ `),d+="f".concat(u,`.apply(undefined, arguments)
5
+ `);return{funcDefCode:r,funcCallCode:d}}o(generateBodyPartsVariadicCode,"generateBodyPartsVariadicCode"),t(generateBodyPartsVariadicCode,"generateBodyPartsVariadicCode");function bakeCollection(collection,fixedArgsNum){if(collection.length===0)return exports$1.BAKED_EMPTY_FUNC;if(collection.length===1)return collection[0];var funcFactoryCode;if(collection.length<FORLOOP_FALLBACK){var argsDefCode=generateArgsDefCode(fixedArgsNum),_a=generateBodyPartsCode(argsDefCode,collection.length),funcDefCode=_a.funcDefCode,funcCallCode=_a.funcCallCode;funcFactoryCode=`(function(collection) {
6
+ `.concat(funcDefCode,`
7
+ collection = undefined;
8
+ return (function(`).concat(argsDefCode,`) {
9
+ `).concat(funcCallCode,`
10
+ });
11
+ })`)}else{var argsDefCode=generateArgsDefCode(fixedArgsNum);collection.length%10===0?funcFactoryCode=`(function(collection) {
12
+ return (function(`.concat(argsDefCode,`) {
13
+ for (var i = 0; i < collection.length; i += 10) {
14
+ collection[i](`).concat(argsDefCode,`);
15
+ collection[i+1](`).concat(argsDefCode,`);
16
+ collection[i+2](`).concat(argsDefCode,`);
17
+ collection[i+3](`).concat(argsDefCode,`);
18
+ collection[i+4](`).concat(argsDefCode,`);
19
+ collection[i+5](`).concat(argsDefCode,`);
20
+ collection[i+6](`).concat(argsDefCode,`);
21
+ collection[i+7](`).concat(argsDefCode,`);
22
+ collection[i+8](`).concat(argsDefCode,`);
23
+ collection[i+9](`).concat(argsDefCode,`);
24
+ }
25
+ });
26
+ })`):collection.length%4===0?funcFactoryCode=`(function(collection) {
27
+ return (function(`.concat(argsDefCode,`) {
28
+ for (var i = 0; i < collection.length; i += 4) {
29
+ collection[i](`).concat(argsDefCode,`);
30
+ collection[i+1](`).concat(argsDefCode,`);
31
+ collection[i+2](`).concat(argsDefCode,`);
32
+ collection[i+3](`).concat(argsDefCode,`);
33
+ }
34
+ });
35
+ })`):collection.length%3===0?funcFactoryCode=`(function(collection) {
36
+ return (function(`.concat(argsDefCode,`) {
37
+ for (var i = 0; i < collection.length; i += 3) {
38
+ collection[i](`).concat(argsDefCode,`);
39
+ collection[i+1](`).concat(argsDefCode,`);
40
+ collection[i+2](`).concat(argsDefCode,`);
41
+ }
42
+ });
43
+ })`):funcFactoryCode=`(function(collection) {
44
+ return (function(`.concat(argsDefCode,`) {
45
+ for (var i = 0; i < collection.length; ++i) {
46
+ collection[i](`).concat(argsDefCode,`);
47
+ }
48
+ });
49
+ })`)}{var funcFactory=eval(funcFactoryCode);return funcFactory(collection)}}o(bakeCollection,"bakeCollection"),t(bakeCollection,"bakeCollection"),exports$1.bakeCollection=bakeCollection;function bakeCollectionAwait(collection,fixedArgsNum){if(collection.length===0)return exports$1.BAKED_EMPTY_FUNC;if(collection.length===1)return collection[0];var funcFactoryCode;if(collection.length<FORLOOP_FALLBACK){var argsDefCode=generateArgsDefCode(fixedArgsNum),_a=generateBodyPartsCode(argsDefCode,collection.length),funcDefCode=_a.funcDefCode,funcCallCode=_a.funcCallCode;funcFactoryCode=`(function(collection) {
50
+ `.concat(funcDefCode,`
51
+ collection = undefined;
52
+ return (function(`).concat(argsDefCode,`) {
53
+ return Promise.all([ `).concat(funcCallCode,` ]);
54
+ });
55
+ })`)}else{var argsDefCode=generateArgsDefCode(fixedArgsNum);funcFactoryCode=`(function(collection) {
56
+ return (function(`.concat(argsDefCode,`) {
57
+ var promises = Array(collection.length);
58
+ for (var i = 0; i < collection.length; ++i) {
59
+ promises[i] = collection[i](`).concat(argsDefCode,`);
60
+ }
61
+ return Promise.all(promises);
62
+ });
63
+ })`)}{var funcFactory=eval(funcFactoryCode);return funcFactory(collection)}}o(bakeCollectionAwait,"bakeCollectionAwait"),t(bakeCollectionAwait,"bakeCollectionAwait"),exports$1.bakeCollectionAwait=bakeCollectionAwait;function bakeCollectionVariadic(collection){if(collection.length===0)return exports$1.BAKED_EMPTY_FUNC;if(collection.length===1)return collection[0];var funcFactoryCode;if(collection.length<FORLOOP_FALLBACK){var _a=generateBodyPartsVariadicCode(collection.length),funcDefCode=_a.funcDefCode,funcCallCode=_a.funcCallCode;funcFactoryCode=`(function(collection) {
64
+ `.concat(funcDefCode,`
65
+ collection = undefined;
66
+ return (function() {
67
+ `).concat(funcCallCode,`
68
+ });
69
+ })`)}else funcFactoryCode=`(function(collection) {
70
+ return (function() {
71
+ for (var i = 0; i < collection.length; ++i) {
72
+ collection[i].apply(undefined, arguments);
73
+ }
74
+ });
75
+ })`;{var funcFactory=eval(funcFactoryCode);return funcFactory(collection)}}o(bakeCollectionVariadic,"bakeCollectionVariadic"),t(bakeCollectionVariadic,"bakeCollectionVariadic"),exports$1.bakeCollectionVariadic=bakeCollectionVariadic})(bakeCollection)),bakeCollection}o(requireBakeCollection,"requireBakeCollection");var hasRequiredTaskCollection$1;function requireTaskCollection$1(){if(hasRequiredTaskCollection$1)return taskCollection;hasRequiredTaskCollection$1=1;var p=Object.defineProperty,r=o((a,b)=>p(a,"name",{value:b,configurable:!0}),"l"),d=taskCollection&&taskCollection.__spreadArray||function(a,b,e){if(e||arguments.length===2)for(var n=0,s=b.length,l;n<s;n++)(l||!(n in b))&&(l||(l=Array.prototype.slice.call(b,0,n)),l[n]=b[n]);return a.concat(l||Array.prototype.slice.call(b))};Object.defineProperty(taskCollection,"__esModule",{value:!0}),taskCollection.TaskCollection=void 0;var u=requireUtils$1(),f=requireBakeCollection();function _(a,b){var e=this.length;if(e>1)if(b){var n;(n=this._tasks).push.apply(n,arguments),this.length+=arguments.length}else this._tasks.push(a),this.length++;else if(b){if(e===1){var s=Array(1+arguments.length);s.push(s),s.push.apply(s,arguments),this._tasks=s}else{var s=Array(arguments.length);s.push.apply(s,arguments),this._tasks=s}this.length+=arguments.length}else e===1?this._tasks=[this._tasks,a]:this._tasks=a,this.length++}o(_,"push_norebuild"),r(_,"push_norebuild");function h(a,b){var e=this.length;if(e>1)if(b){var n;(n=this._tasks).push.apply(n,arguments),this.length+=arguments.length}else this._tasks.push(a),this.length++;else if(b){if(e===1){var s=Array(1+arguments.length);s.push(s),s.push.apply(s,arguments),this._tasks=s}else{var s=Array(arguments.length);s.push.apply(s,arguments),this._tasks=s}this.length+=arguments.length}else e===1?this._tasks=[this._tasks,a]:this._tasks=a,this.length++;this.firstEmitBuildStrategy?this.call=L:this.rebuild()}o(h,"push_rebuild"),r(h,"push_rebuild");function g(a){this.length!==0&&(this.length===1?this._tasks===a&&(this.length=0):((0,u._fast_remove_single)(this._tasks,this._tasks.lastIndexOf(a)),this._tasks.length===1?(this._tasks=this._tasks[0],this.length=1):this.length=this._tasks.length))}o(g,"removeLast_norebuild"),r(g,"removeLast_norebuild");function c(a){if(this.length!==0){if(this.length===1)if(this._tasks===a&&(this.length=0),this.firstEmitBuildStrategy){this.call=f.BAKED_EMPTY_FUNC;return}else{this.rebuild();return}else(0,u._fast_remove_single)(this._tasks,this._tasks.lastIndexOf(a)),this._tasks.length===1?(this._tasks=this._tasks[0],this.length=1):this.length=this._tasks.length;this.firstEmitBuildStrategy?this.call=L:this.rebuild()}}o(c,"removeLast_rebuild"),r(c,"removeLast_rebuild");function C(a){for(var b,e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.length===0?(this._tasks=e,this.length=1):this.length===1?(e.unshift(this._tasks),this._tasks=e,this.length=this._tasks.length):((b=this._tasks).splice.apply(b,d([a,0],e,!1)),this.length=this._tasks.length)}o(C,"insert_norebuild"),r(C,"insert_norebuild");function P(a){for(var b,e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.length===0?(this._tasks=e,this.length=1):this.length===1?(e.unshift(this._tasks),this._tasks=e,this.length=this._tasks.length):((b=this._tasks).splice.apply(b,d([a,0],e,!1)),this.length=this._tasks.length),this.firstEmitBuildStrategy?this.call=L:this.rebuild()}o(P,"insert_rebuild"),r(P,"insert_rebuild");function B(){this.length===0?this.call=f.BAKED_EMPTY_FUNC:this.length===1?this.call=this._tasks:this.call=(0,f.bakeCollection)(this._tasks,this.argsNum)}o(B,"rebuild_noawait"),r(B,"rebuild_noawait");function F(){this.length===0?this.call=f.BAKED_EMPTY_FUNC:this.length===1?this.call=this._tasks:this.call=(0,f.bakeCollectionAwait)(this._tasks,this.argsNum)}o(F,"rebuild_await"),r(F,"rebuild_await");function L(){this.rebuild(),this.call.apply(void 0,arguments)}o(L,"rebuild_on_first_call"),r(L,"rebuild_on_first_call");var E=(function(){function a(b,e,n,s){e===void 0&&(e=!0),n===void 0&&(n=null),s===void 0&&(s=!1),this.awaitTasks=s,this.call=f.BAKED_EMPTY_FUNC,this.argsNum=b,this.firstEmitBuildStrategy=!0,s?this.rebuild=F.bind(this):this.rebuild=B.bind(this),this.setAutoRebuild(e),n?typeof n=="function"?(this._tasks=n,this.length=1):(this._tasks=n,this.length=n.length):(this._tasks=null,this.length=0),e&&this.rebuild()}return o(a,"t"),r(a,"TaskCollection"),a})();taskCollection.TaskCollection=E;function x(){this._tasks=null,this.length=0,this.call=f.BAKED_EMPTY_FUNC}o(x,"fastClear"),r(x,"fastClear");function T(){this._tasks=null,this.length=0,this.call=f.BAKED_EMPTY_FUNC}o(T,"clear"),r(T,"clear");function q(a){this.argsNum<a&&(this.argsNum=a,this.firstEmitBuildStrategy?this.call=L:this.rebuild())}o(q,"growArgsNum"),r(q,"growArgsNum");function w(a){a?(this.push=h.bind(this),this.insert=P.bind(this),this.removeLast=c.bind(this)):(this.push=_.bind(this),this.insert=C.bind(this),this.removeLast=g.bind(this))}o(w,"setAutoRebuild"),r(w,"setAutoRebuild");function D(){return this.length===0?[]:this.length===1?[this._tasks]:this._tasks}o(D,"tasksAsArray"),r(D,"tasksAsArray");function j(a){a.length===0?(this.length=0,this.call=f.BAKED_EMPTY_FUNC):a.length===1?(this.length=1,this.call=a[0],this._tasks=a[0]):(this.length=a.length,this._tasks=a,this.firstEmitBuildStrategy?this.call=L:this.rebuild())}return o(j,"setTasks"),r(j,"setTasks"),E.prototype.fastClear=x,E.prototype.clear=T,E.prototype.growArgsNum=q,E.prototype.setAutoRebuild=w,E.prototype.tasksAsArray=D,E.prototype.setTasks=j,taskCollection}o(requireTaskCollection$1,"requireTaskCollection$1");var hasRequiredTaskCollection;function requireTaskCollection(){return hasRequiredTaskCollection||(hasRequiredTaskCollection=1,(function(p){var r=Object.defineProperty,d=o((_,h)=>r(_,"name",{value:h,configurable:!0}),"o"),u=taskCollection$1&&taskCollection$1.__createBinding||(Object.create?(function(_,h,g,c){c===void 0&&(c=g);var C=Object.getOwnPropertyDescriptor(h,g);(!C||("get"in C?!h.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:d(function(){return h[g]},"get")}),Object.defineProperty(_,c,C)}):(function(_,h,g,c){c===void 0&&(c=g),_[c]=h[g]})),f=taskCollection$1&&taskCollection$1.__exportStar||function(_,h){for(var g in _)g!=="default"&&!Object.prototype.hasOwnProperty.call(h,g)&&u(h,_,g)};Object.defineProperty(p,"__esModule",{value:!0}),f(requireTaskCollection$1(),p)})(taskCollection$1)),taskCollection$1}o(requireTaskCollection,"requireTaskCollection");var utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;var p=Object.defineProperty,r=o((u,f)=>p(u,"name",{value:f,configurable:!0}),"r");Object.defineProperty(utils,"__esModule",{value:!0}),utils.nullObj=void 0;function d(){var u={};return u.__proto__=null,u}return o(d,"nullObj"),r(d,"nullObj"),utils.nullObj=d,utils}o(requireUtils,"requireUtils");var hasRequiredEe;function requireEe(){if(hasRequiredEe)return ee;hasRequiredEe=1;var p=Object.defineProperty,r=o((e,n)=>p(e,"name",{value:n,configurable:!0}),"o"),d=ee&&ee.__spreadArray||function(e,n,s){if(s||arguments.length===2)for(var l=0,y=n.length,A;l<y;l++)(A||!(l in n))&&(A||(A=Array.prototype.slice.call(n,0,l)),A[l]=n[l]);return e.concat(A||Array.prototype.slice.call(n))};Object.defineProperty(ee,"__esModule",{value:!0}),ee.EventEmitter=void 0;var u=requireTaskCollection(),f=requireUtils$1(),_=requireUtils();function h(e,n,s,l,y,A){var k=this.events[e];if(k){if(k.length===0)return!1;if(k.argsNum<6)k.call(n,s,l,y,A);else{for(var m=new Array(k.argsNum),v=0,O=m.length;v<O;++v)m[v]=arguments[v+1];k.call.apply(void 0,m)}return!0}return!1}o(h,"emit"),r(h,"emit");function g(e,n,s,l,y,A){var k=this.events[e],m;if(k!==void 0){if(k.length===0)return!1;if(k.argsNum<6)k.call(n,s,l,y,A);else{m=new Array(k.argsNum);for(var v=0,O=m.length;v<O;++v)m[v]=arguments[v+1];k.call.apply(void 0,m)}}var N=this.onceEvents[e];if(N){if(typeof N=="function")if(this.onceEvents[e]=void 0,arguments.length<6)N(n,s,l,y,A);else{if(m===void 0){m=new Array(arguments.length-1);for(var v=0,O=m.length;v<O;++v)m[v]=arguments[v+1]}N.apply(void 0,m)}else{var $=N;if(this.onceEvents[e]=void 0,arguments.length<6)for(var v=0;v<$.length;++v)$[v](n,s,l,y,A);else{if(m===void 0){m=new Array(arguments.length-1);for(var v=0,O=m.length;v<O;++v)m[v]=arguments[v+1]}for(var v=0;v<$.length;++v)$[v].apply(void 0,m)}}return!0}return k!==void 0}o(g,"emitHasOnce"),r(g,"emitHasOnce");var c=(function(){function e(){this.events=(0,_.nullObj)(),this.onceEvents=(0,_.nullObj)(),this._symbolKeys=new Set,this.maxListeners=1/0}return o(e,"e"),r(e,"EventEmitter"),Object.defineProperty(e.prototype,"_eventsCount",{get:r(function(){return this.eventNames().length},"get"),enumerable:!1,configurable:!0}),e})();ee.EventEmitter=c;function C(e,n){switch(this.emit===h&&(this.emit=g),typeof this.onceEvents[e]){case"undefined":this.onceEvents[e]=n,typeof e=="symbol"&&this._symbolKeys.add(e);break;case"function":this.onceEvents[e]=[this.onceEvents[e],n];break;case"object":this.onceEvents[e].push(n)}return this}o(C,"once"),r(C,"once");function P(e,n,s){if(s===void 0&&(s=n.length),typeof n!="function")throw new TypeError("The listener must be a function");var l=this.events[e];return l?(l.push(n),l.growArgsNum(s),this.maxListeners!==1/0&&this.maxListeners<=l.length&&console.warn('Maximum event listeners for "'.concat(String(e),'" event!'))):(this.events[e]=new u.TaskCollection(s,!0,n,!1),typeof e=="symbol"&&this._symbolKeys.add(e)),this}o(P,"addListener"),r(P,"addListener");function B(e,n){var s=this.events[e];s&&s.removeLast(n);var l=this.onceEvents[e];return l&&(typeof l=="function"?this.onceEvents[e]=void 0:typeof l=="object"&&(l.length===1&&l[0]===n?this.onceEvents[e]=void 0:(0,f._fast_remove_single)(l,l.lastIndexOf(n)))),this}o(B,"removeListener"),r(B,"removeListener");function F(e,n,s,l){s===void 0&&(s=this),l===void 0&&(l=n.length),this.boundFuncs||(this.boundFuncs=new Map);var y=n.bind(s);return this.boundFuncs.set(n,y),this.addListener(e,y,l)}o(F,"addListenerBound"),r(F,"addListenerBound");function L(e,n){var s,l,y=(s=this.boundFuncs)===null||s===void 0?void 0:s.get(n);return(l=this.boundFuncs)===null||l===void 0||l.delete(n),this.removeListener(e,y)}o(L,"removeListenerBound"),r(L,"removeListenerBound");function E(e){return this.events[e]&&!!this.events[e].length}o(E,"hasListeners"),r(E,"hasListeners");function x(e,n,s){if(s===void 0&&(s=n.length),typeof n!="function")throw new TypeError("The listener must be a function");var l=this.events[e];return!l||!(l instanceof u.TaskCollection)?(l=this.events[e]=new u.TaskCollection(s,!0,n,!1),typeof e=="symbol"&&this._symbolKeys.add(e)):(l.insert(0,n),l.growArgsNum(s),this.maxListeners!==1/0&&this.maxListeners<=l.length&&console.warn('Maximum event listeners for "'.concat(String(e),'" event!'))),this}o(x,"prependListener"),r(x,"prependListener");function T(e,n){this.emit===h&&(this.emit=g);var s=this.onceEvents[e];return s?typeof s!="object"?(this.onceEvents[e]=[n,s],typeof e=="symbol"&&this._symbolKeys.add(e)):(s.unshift(n),this.maxListeners!==1/0&&this.maxListeners<=s.length&&console.warn('Maximum event listeners for "'.concat(String(e),'" once event!'))):(this.onceEvents[e]=[n],typeof e=="symbol"&&this._symbolKeys.add(e)),this}o(T,"prependOnceListener"),r(T,"prependOnceListener");function q(e){return e===void 0?(this.events=(0,_.nullObj)(),this.onceEvents=(0,_.nullObj)(),this._symbolKeys=new Set):(this.events[e]=void 0,this.onceEvents[e]=void 0,typeof e=="symbol"&&this._symbolKeys.delete(e)),this}o(q,"removeAllListeners"),r(q,"removeAllListeners");function w(e){return this.maxListeners=e,this}o(w,"setMaxListeners"),r(w,"setMaxListeners");function D(){return this.maxListeners}o(D,"getMaxListeners"),r(D,"getMaxListeners");function j(e){return this.emit===h?this.events[e]?this.events[e].tasksAsArray().slice():[]:this.events[e]&&this.onceEvents[e]?d(d([],this.events[e].tasksAsArray(),!0),typeof this.onceEvents[e]=="function"?[this.onceEvents[e]]:this.onceEvents[e],!0):this.events[e]?this.events[e].tasksAsArray():this.onceEvents[e]?typeof this.onceEvents[e]=="function"?[this.onceEvents[e]]:this.onceEvents[e]:[]}o(j,"listeners"),r(j,"listeners");function a(){var e=this;if(this.emit===h){var n=Object.keys(this.events);return d(d([],n,!0),Array.from(this._symbolKeys),!0).filter(function(l){return l in e.events&&e.events[l]&&e.events[l].length})}else{var n=Object.keys(this.events).filter(function(y){return e.events[y]&&e.events[y].length}),s=Object.keys(this.onceEvents).filter(function(y){return e.onceEvents[y]&&e.onceEvents[y].length});return d(d(d([],n,!0),s,!0),Array.from(this._symbolKeys).filter(function(y){return y in e.events&&e.events[y]&&e.events[y].length||y in e.onceEvents&&e.onceEvents[y]&&e.onceEvents[y].length}),!0)}}o(a,"eventNames"),r(a,"eventNames");function b(e){return this.emit===h?this.events[e]&&this.events[e].length||0:(this.events[e]&&this.events[e].length||0)+(this.onceEvents[e]&&this.onceEvents[e].length||0)}return o(b,"listenerCount"),r(b,"listenerCount"),c.prototype.emit=h,c.prototype.on=P,c.prototype.once=C,c.prototype.addListener=P,c.prototype.removeListener=B,c.prototype.addListenerBound=F,c.prototype.removeListenerBound=L,c.prototype.hasListeners=E,c.prototype.prependListener=x,c.prototype.prependOnceListener=T,c.prototype.off=B,c.prototype.removeAllListeners=q,c.prototype.setMaxListeners=w,c.prototype.getMaxListeners=D,c.prototype.listeners=j,c.prototype.eventNames=a,c.prototype.listenerCount=b,ee}o(requireEe,"requireEe");var hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,(function(p){var r=Object.defineProperty,d=o((_,h)=>r(_,"name",{value:h,configurable:!0}),"o"),u=lib&&lib.__createBinding||(Object.create?(function(_,h,g,c){c===void 0&&(c=g);var C=Object.getOwnPropertyDescriptor(h,g);(!C||("get"in C?!h.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:d(function(){return h[g]},"get")}),Object.defineProperty(_,c,C)}):(function(_,h,g,c){c===void 0&&(c=g),_[c]=h[g]})),f=lib&&lib.__exportStar||function(_,h){for(var g in _)g!=="default"&&!Object.prototype.hasOwnProperty.call(h,g)&&u(h,_,g)};Object.defineProperty(p,"__esModule",{value:!0}),f(requireTypes(),p),f(requireEe(),p)})(lib)),lib}o(requireLib,"requireLib");var libExports=requireLib();export{libExports as l};
@@ -0,0 +1,14 @@
1
+ // TODO: Load the spinner names from the JSON file.
2
+ type SpinnerName$1 = 'dots' | 'dots2' | 'dots3' | 'dots4' | 'dots5' | 'dots6' | 'dots7' | 'dots8' | 'dots9' | 'dots10' | 'dots11' | 'dots12' | 'dots13' | 'dots14' | 'dots8Bit' | 'dotsCircle' | 'sand' | 'line' | 'line2' | 'rollingLine' | 'pipe' | 'simpleDots' | 'simpleDotsScrolling' | 'star' | 'star2' | 'flip' | 'hamburger' | 'growVertical' | 'growHorizontal' | 'balloon' | 'balloon2' | 'noise' | 'bounce' | 'boxBounce' | 'boxBounce2' | 'binary' | 'triangle' | 'arc' | 'circle' | 'squareCorners' | 'circleQuarters' | 'circleHalves' | 'squish' | 'toggle' | 'toggle2' | 'toggle3' | 'toggle4' | 'toggle5' | 'toggle6' | 'toggle7' | 'toggle8' | 'toggle9' | 'toggle10' | 'toggle11' | 'toggle12' | 'toggle13' | 'arrow' | 'arrow2' | 'arrow3' | 'bouncingBar' | 'bouncingBall' | 'smiley' | 'monkey' | 'hearts' | 'clock' | 'earth' | 'material' | 'moon' | 'runner' | 'pong' | 'shark' | 'dqpb' | 'weather' | 'christmas' | 'grenade' | 'point' | 'layer' | 'betaWave' | 'fingerDance' | 'fistBump' | 'soccerHeader' | 'mindblown' | 'speaker' | 'orangePulse' | 'bluePulse' | 'orangeBluePulse' | 'timeTravel' | 'aesthetic' | 'dwarfFortress';
3
+ /**
4
+ * Names of custom spinners from Rattles and unicode-animations.
5
+ */
6
+ type CustomSpinnerName = "breathe" | "cascade" | "checkerboard" | "columns" | "diagSwipe" | "dna" | "doubleArrow" | "fillSweep" | "helix" | "infinity" | "orbit" | "pulse" | "rain" | "scan" | "scanline" | "snake" | "sparkle" | "wave" | "waveRows";
7
+ /**
8
+ * Union of all available spinner names.
9
+ */
10
+ type SpinnerName = SpinnerName$1 | CustomSpinnerName;
11
+ /**
12
+ * Represents a single frame-based spinner animation.
13
+ */
14
+ export { SpinnerName as S };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Base ANSI Colors
3
+ */
4
+ type AnsiColors = "bgBlack" | "bgBlackBright" | "bgBlue" | "bgBlueBright" | "bgCyan" | "bgCyanBright" | "bgGray" | "bgGreen" | "bgGreenBright" | "bgGrey" | "bgMagenta" | "bgMagentaBright" | "bgRed" | "bgRedBright" | "bgWhite" | "bgWhiteBright" | "bgYellow" | "bgYellowBright" | "black" | "blackBright" | "blue" | "blueBright" | "cyan" | "cyanBright" | "gray" | "green" | "greenBright" | "grey" | "magenta" | "magentaBright" | "red" | "redBright" | "white" | "whiteBright" | "yellow" | "yellowBright";
5
+ export { AnsiColors as A };
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var r=(e,t)=>n(e,"name",{value:t,configurable:!0});var o=Object.defineProperty,a=r((e,t)=>o(e,"name",{value:t,configurable:!0}),"r");const s=/^[a-z]$/i,c=a(e=>{const t=e.codePointAt(0);return t!==void 0&&(t<32||t===127)},"isControlCharacter"),l=a((e,t)=>e.length===0||c(e)?!1:t.ctrl&&t.meta?!s.test(e):!(t.ctrl||t.meta),"isInsertableInput");export{l as i};
@@ -0,0 +1,172 @@
1
+ type Listener = (...args: any[]) => Promise<any> | void;
2
+ type DefaultEventMap = { [event in (string | symbol)]: Listener } & {
3
+ /**
4
+ * __proto__ key not allowed due to implementation
5
+ * add prefix, if you want to use this keyword
6
+ */
7
+ __proto__?: never;
8
+ };
9
+ interface IEventEmitter<EventMap extends DefaultEventMap = DefaultEventMap> {
10
+ emit<EventKey extends keyof EventMap>(event: EventKey, ...args: Parameters<EventMap[EventKey]>): boolean;
11
+ on<EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]): this;
12
+ once<EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]): this;
13
+ addListener<EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]): this;
14
+ removeListener<EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]): this;
15
+ prependListener<EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]): this;
16
+ prependOnceListener<EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]): this;
17
+ off<EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]): this;
18
+ removeAllListeners<EventKey extends keyof EventMap = string>(event?: EventKey): this;
19
+ setMaxListeners(n: number): this;
20
+ getMaxListeners(): number;
21
+ listeners<EventKey extends keyof EventMap = string>(event: EventKey): EventMap[EventKey][];
22
+ rawListeners<EventKey extends keyof EventMap = string>(event: EventKey): EventMap[EventKey][];
23
+ eventNames(): Array<string | symbol>;
24
+ listenerCount<EventKey extends keyof EventMap = string>(type: EventKey): number;
25
+ }
26
+ type ArgsNum<T extends (...args: any[]) => any> = T extends ((...args: infer K) => any) ? K["length"] : never;
27
+ declare class TaskCollection<Func extends (...args: any) => void, AwaitTasks extends true | false = false> {
28
+ readonly awaitTasks: AwaitTasks;
29
+ constructor(argsNum: ArgsNum<Func>, autoRebuild?: boolean, initialTasks?: (Func[]) | Func | null, awaitTasks?: AwaitTasks);
30
+ /** DO NOT CHANGE DIRECTLY */
31
+ _tasks: (Func[]) | Func | null;
32
+ /** cached */
33
+ length: number;
34
+ /** auto rebuild on first emit call; otherwise autorebuild on every change */
35
+ firstEmitBuildStrategy: boolean;
36
+ readonly argsNum: ArgsNum<Func>;
37
+ autoRebuild: boolean;
38
+ readonly growArgsNum: typeof growArgsNum;
39
+ setAutoRebuild: typeof setAutoRebuild;
40
+ call: (...args: Parameters<Func>) => (AwaitTasks extends true ? Promise<void> : void);
41
+ rebuild: () => void;
42
+ push: (...func: Func[]) => void;
43
+ /** remove last matched task from tasks */
44
+ removeLast: (func: Func) => void;
45
+ insert: (index: number, ...func: Func[]) => void;
46
+ setTasks: (tasks: Func[]) => void;
47
+ tasksAsArray: () => Func[];
48
+ /** this autorebuilds */
49
+ readonly clear: typeof clear;
50
+ /** this autorebuilds */
51
+ readonly fastClear: typeof fastClear;
52
+ }
53
+ declare function fastClear<Func extends (...args: any) => void, AwaitTasks extends true | false = false>(this: TaskCollection<Func, AwaitTasks>): void;
54
+ declare function clear<Func extends (...args: any) => void, AwaitTasks extends true | false = false>(this: TaskCollection<Func, AwaitTasks>): void;
55
+ declare function growArgsNum<Func extends (...args: any) => void, AwaitTasks extends true | false = false>(this: TaskCollection<Func, AwaitTasks>, argsNum: number): void;
56
+ declare function setAutoRebuild<Func extends (...args: any) => void, AwaitTasks extends true | false = false>(this: TaskCollection<Func, AwaitTasks>, newVal: boolean): void;
57
+ /** Implemented event emitter */
58
+ declare class EventEmitter<EventMap extends DefaultEventMap = DefaultEventMap> implements IEventEmitter<EventMap> {
59
+ events: { [eventName in keyof EventMap]?: TaskCollection<EventMap[eventName]> };
60
+ onceEvents: { [eventName in keyof EventMap]?: (EventMap[eventName][]) | EventMap[eventName] };
61
+ boundFuncs: undefined | Map<Function, Function>;
62
+ _symbolKeys: Set<symbol>;
63
+ maxListeners: number;
64
+ get _eventsCount(): number;
65
+ emit: <EventKey extends keyof EventMap>(event: EventKey, ...args: Parameters<EventMap[EventKey]>) => boolean;
66
+ on: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]) => this;
67
+ once: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]) => this;
68
+ addListener: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey], argsNum?: ArgsNum<EventMap[EventKey]>) => this;
69
+ removeListener: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]) => this;
70
+ hasListeners: <EventKey extends keyof EventMap = string>(event: EventKey) => boolean;
71
+ prependListener: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]) => this;
72
+ prependOnceListener: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]) => this;
73
+ off: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]) => this;
74
+ removeAllListeners: <EventKey extends keyof EventMap = string>(event?: EventKey) => this;
75
+ setMaxListeners: (n: number) => this;
76
+ getMaxListeners: () => number;
77
+ listeners: <EventKey extends keyof EventMap = string>(event: EventKey) => EventMap[EventKey][];
78
+ rawListeners: <EventKey extends keyof EventMap = string>(event: EventKey) => EventMap[EventKey][];
79
+ eventNames: () => Array<string | symbol>;
80
+ listenerCount: <EventKey extends keyof EventMap = string>(type: EventKey) => number;
81
+ addListenerBound: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey], bindTo?: any, argsNum?: ArgsNum<EventMap[EventKey]>) => this;
82
+ removeListenerBound: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]) => this;
83
+ }
84
+ declare class TuiApp extends EventEmitter {
85
+ private renderer;
86
+ private terminal;
87
+ private backBuffer;
88
+ private width;
89
+ private height;
90
+ private isRunning;
91
+ private stdoutBuffer;
92
+ private stderrBuffer;
93
+ constructor();
94
+ /** Enters raw mode + alternate screen. Does NOT start any render loop. */
95
+ start(): void;
96
+ /** Request a clean exit — restores terminal, stops input, exits the process. */
97
+ quit(): void;
98
+ /** Exits raw mode + alternate screen, then flushes any buffered stdout/stderr. */
99
+ stop(): void;
100
+ /**
101
+ * Buffer a write to stdout. While the alternate screen is active, writing
102
+ * directly would corrupt the TUI. Buffered output is flushed on stop().
103
+ */
104
+ writeStdout(text: string): void;
105
+ /**
106
+ * Buffer a write to stderr. While the alternate screen is active, writing
107
+ * directly would corrupt the TUI. Buffered output is flushed on stop().
108
+ */
109
+ writeStderr(text: string): void;
110
+ /** Returns the shared Uint32Array back-buffer (width * height * 2 u32 cells). */
111
+ getBuffer(): Uint32Array;
112
+ /** Returns current terminal dimensions. */
113
+ getSize(): {
114
+ height: number;
115
+ width: number;
116
+ };
117
+ /** Update terminal dimensions (called on SIGWINCH). */
118
+ resize(width: number, height: number): void;
119
+ /**
120
+ * Callbacks fired on every frame after React paints the buffer but before
121
+ * the Rust diff engine flushes to stdout. Use for direct buffer painting
122
+ * that needs to overlay React output (animated graphs, overlays, FPS counters).
123
+ * Multiple listeners are supported — they fire in registration order.
124
+ */
125
+ private beforeFlushListeners;
126
+ onBeforeFlush(function_: (buffer: Uint32Array, width: number, height: number) => void): () => void;
127
+ /**
128
+ * Layout + paint synchronously. Called from the render loop on every dirty frame,
129
+ * and directly on resize for immediate response.
130
+ */
131
+ paintNow(calculateLayout: (w: number, h: number) => void, renderToBuffer: (buf: Uint32Array, w: number, h: number) => void): void;
132
+ }
133
+ interface InlineOptions {
134
+ /** Frames per second. Default: 60 */
135
+ fps?: number;
136
+ /**
137
+ * What to do with the rendered content when the loop stops.
138
+ * - 'preserve' (default) — content stays in terminal scrollback
139
+ * - 'destroy' — content is cleared, terminal looks untouched
140
+ */
141
+ onExit?: "preserve" | "destroy";
142
+ /** Number of terminal rows to reserve. Default: 10 */
143
+ rows?: number;
144
+ }
145
+ type InlinePaintFn = (buf: Uint32Array, cols: number, rows: number, frame: number) => void;
146
+ interface InlineLoop {
147
+ start: () => void;
148
+ stop: () => void;
149
+ }
150
+ /**
151
+ * Create an inline render loop. Renders `rows` lines immediately below the
152
+ * current cursor position (no alternate screen).
153
+ */
154
+ declare function createInlineLoop(paint: InlinePaintFn, options?: InlineOptions): InlineLoop;
155
+ interface MouseEvent {
156
+ button: "left" | "right" | "middle" | "scrollUp" | "scrollDown";
157
+ ctrl: boolean;
158
+ meta: boolean;
159
+ shift: boolean;
160
+ x: number;
161
+ y: number;
162
+ }
163
+ declare class InputParser extends EventEmitter {
164
+ private stdin;
165
+ private _boundHandleData;
166
+ private _pasteBuffer;
167
+ constructor(stdin: NodeJS.ReadStream);
168
+ start(): void;
169
+ stop(): void;
170
+ private handleData;
171
+ }
172
+ export { InlineLoop as I, MouseEvent as M, TuiApp as T, InlineOptions as a, InlinePaintFn as b, InputParser as c, createInlineLoop as d };
@@ -0,0 +1 @@
1
+ var s=Object.defineProperty;var n=(e,t)=>s(e,"name",{value:t,configurable:!0});var u=Object.defineProperty,l=n((e,t)=>u(e,"name",{value:t,configurable:!0}),"s");const f=l(({element:e,mouse:{x:t,y:r}})=>{const a=t<e.left||t>=e.left+e.width,o=r<e.top||r>=e.top+e.height;return!a&&!o},"isIntersecting");export{f as default};
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var c=(r,e)=>n(r,"name",{value:e,configurable:!0});var i=Object.defineProperty,s=c((r,e)=>i(r,"name",{value:e,configurable:!0}),"e");const a=new Set(["Alacritty","contour","foot","Ghostty","iTerm2","iTerm.app","kitty","rio","WezTerm"]),f=s(()=>{const r=process.env.TERM_PROGRAM??"";if(a.has(r))return!0;const e=process.env.TERM??"";return!!(e.startsWith("xterm")||process.env.WT_SESSION||process.env.TMUX||e.startsWith("screen"))},"isOsc52Supported"),p=new Set(["c","p","s"]),O=s((r,e,t="c")=>{if(!p.has(t))throw new Error(`Invalid clipboard target: ${t}`);const o=Buffer.from(e,"utf8").toString("base64");r.write(`\x1B]52;${t};${o}\x07`)},"writeOsc52"),v=s((r,e="c")=>{r.write(`\x1B]52;${e};\x07`)},"clearOsc52");export{v as clearOsc52,f as isOsc52Supported,O as writeOsc52};
@@ -0,0 +1 @@
1
+ var x=Object.defineProperty;var m=(t,r)=>x(t,"name",{value:r,configurable:!0});var T=Object.defineProperty,c=m((t,r)=>T(t,"name",{value:r,configurable:!0}),"i");const p=c(t=>{const r=/rgb:([\da-f]{2,4})\/([\da-f]{2,4})\/([\da-f]{2,4})/i.exec(t);if(!r)return null;const o=c(n=>n.length<=2?n.padStart(2,"0"):n.slice(0,2),"toHex");return`#${o(r[1])}${o(r[2])}${o(r[3])}`},"parseOscColorResponse"),h=c(()=>{const t=process.env.TERM_PROGRAM??"";return new Set(["Alacritty","contour","foot","Ghostty","iTerm2","iTerm.app","kitty","rio","WezTerm"]).has(t)?!0:(process.env.TERM??"").startsWith("xterm")||!!process.env.WT_SESSION},"isTerminalPaletteQuerySupported"),y=256,f=c((t,r,o,n=500)=>new Promise(i=>{let s="",l;const a=c(()=>{l&&clearTimeout(l),t.removeListener("data",e)},"cleanup"),e=c(u=>{if(s+=u.toString(),s.length>y){a(),i(null);return}(s.includes("\x07")||s.includes("\x1B\\"))&&(a(),i(s))},"onData");l=setTimeout(()=>{a(),i(null)},n),t.on("data",e),r.write(o)}),"queryOsc"),S=c(async(t,r,o=500)=>{const n={},i=await f(t,r,"\x1B]10;?\x07",o);if(i){const e=p(i);e&&(n.foreground=e)}const s=await f(t,r,"\x1B]11;?\x07",o);if(s){const e=p(s);e&&(n.background=e)}const l=await f(t,r,"\x1B]12;?\x07",o);if(l){const e=p(l);e&&(n.cursor=e)}const a=[];for(let e=0;e<16;e++){const u=await f(t,r,`\x1B]4;${e};?\x07`,o);if(u){const d=p(u);a.push(d??"")}else a.push("")}return a.some(e=>e.length>0)&&(n.colors=a),n},"queryTerminalPalette");export{h as isTerminalPaletteQuerySupported,S as queryTerminalPalette};
@@ -0,0 +1 @@
1
+ var o=Object.defineProperty;var r=(t,e)=>o(t,"name",{value:e,configurable:!0});var a=Object.defineProperty,c=r((t,e)=>a(t,"name",{value:e,configurable:!0}),"o");const l={disambiguateEscapeCodes:1,reportAllKeysAsEscapeCodes:8,reportAlternateKeys:4,reportAssociatedText:16,reportEventTypes:2};function n(t){let e=0;for(const s of t)e|=l[s];return e}r(n,"resolveFlags");c(n,"resolveFlags");const i={alt:2,capsLock:64,ctrl:4,hyper:16,meta:32,numLock:128,shift:1,super:8};export{l as kittyFlags,i as kittyModifiers,n as resolveFlags};
@@ -0,0 +1,2 @@
1
+ var F=Object.defineProperty;var M=(t,e)=>F(t,"name",{value:e,configurable:!0});import l from"yoga-layout";import{getScrollTop as k,getScrollLeft as W}from"./getScrollHeight-ClEOyLHH.js";import Y from"./squashTextNodesWithMap-DCdi3SZ2.js";var A=Object.defineProperty,c=M((t,e)=>A(t,"name",{value:e,configurable:!0}),"u");const Q=c(t=>{const e=j(t);return{height:Math.round(t.yogaNode?.getComputedHeight()??0),width:Math.round(t.yogaNode?.getComputedWidth()??0),x:Math.round(e?.x??0),y:Math.round(e?.y??0)}},"measureElement"),Z=c(t=>{const{yogaNode:e}=t;if(!e)return 0;const o=e.getComputedWidth()??0,r=e.getComputedBorder(l.EDGE_LEFT),s=e.getComputedBorder(l.EDGE_RIGHT);return Math.round(o-r-s)},"getInnerWidth"),tt=c(t=>{const{yogaNode:e}=t;if(!e)return 0;const o=e.getComputedHeight()??0,r=e.getComputedBorder(l.EDGE_TOP),s=e.getComputedBorder(l.EDGE_BOTTOM);return Math.round(o-r-s)},"getInnerHeight"),O=c(t=>{const{yogaNode:e}=t;if(!e)return{height:0,width:0,x:0,y:0};const o=e.getComputedWidth()??0,r=e.getComputedHeight()??0;let s=e.getComputedLeft(),n=e.getComputedTop(),d=t.parentNode;for(;d?.yogaNode;){if(s+=d.yogaNode.getComputedLeft(),n+=d.yogaNode.getComputedTop(),d.nodeName==="ink-box"){const a=d.style.overflow??"visible",i=d.style.overflowX??a;(d.style.overflowY??a)==="scroll"&&(n-=k(d)),i==="scroll"&&(s-=W(d))}d=d.parentNode}return{height:Math.round(r),width:Math.round(o),x:Math.round(s),y:Math.round(n)}},"getBoundingBox"),et=c(t=>{const e=t.internal_scrollState?.scrollHeight??0,o=t.internal_scrollState?.actualScrollHeight??0;return Math.max(0,e-o)},"getAddedScrollHeight"),G=c(t=>{const{axis:e,clientDimension:o,scrollbarDimension:r,scrollDimension:s,scrollPosition:n}=t,d=r*2,a=Math.max(e==="vertical"?2:1,Math.round(o/s*d)),i=s-o,g=d-a,u=i>0?Math.round(n/i*g):0,m=u,h=u+a,p=Math.floor(m/2);return{endIndex:Math.min(r,Math.ceil(h/2)),startIndex:p,thumbEndHalf:h,thumbStartHalf:m}},"calculateScrollbarThumb"),L=c(t=>{const{axis:e,clientDimension:o,hasOppositeScrollbar:r,height:s,marginBottom:n,marginRight:d,scrollDimension:a,scrollPosition:i,width:g,x:u,y:m}=t;if(a<=o)return;if(e==="vertical"){const{endIndex:x,startIndex:B,thumbEndHalf:v,thumbStartHalf:D}=G({axis:e,clientDimension:o,scrollbarDimension:s,scrollDimension:a,scrollPosition:i}),E=u+g-1-d;return{height:s,thumb:{end:x,endHalf:v,height:x-B,start:B,startHalf:D,width:1,x:E,y:m+B},width:1,x:E,y:m}}const h=g-(r?1:0),{endIndex:p,startIndex:y,thumbEndHalf:C,thumbStartHalf:f}=G({axis:e,clientDimension:o,scrollbarDimension:h,scrollDimension:a,scrollPosition:i}),T=m+s-1-n;return{height:1,thumb:{end:p,endHalf:C,height:1,start:y,startHalf:f,width:p-y,x:u+y,y:T},width:h,x:u,y:T}},"calculateScrollbarLayout"),ot=c((t,e)=>{const{yogaNode:o}=t;if(!o)return;const r=t.style.overflow??"visible";if((t.style.overflowY??r)!=="scroll")return;const s=t.internal_scrollState?.clientHeight??0,n=t.internal_scrollState?.scrollHeight??0;if(n<=s)return;const{x:d,y:a}=e??O(t),i=o.getComputedHeight()-o.getComputedBorder(l.EDGE_TOP)-o.getComputedBorder(l.EDGE_BOTTOM);return L({axis:"vertical",clientDimension:s,hasOppositeScrollbar:!1,height:i,marginBottom:o.getComputedBorder(l.EDGE_BOTTOM),marginRight:o.getComputedBorder(l.EDGE_RIGHT),scrollDimension:n,scrollPosition:t.internal_scrollState?.scrollTop??0,width:o.getComputedWidth()-o.getComputedBorder(l.EDGE_LEFT),x:d+o.getComputedBorder(l.EDGE_LEFT),y:a+o.getComputedBorder(l.EDGE_TOP)})},"getVerticalScrollbarBoundingBox"),nt=c((t,e)=>{const{yogaNode:o}=t;if(!o)return;const r=t.style.overflow??"visible";if((t.style.overflowX??r)!=="scroll")return;const s=t.internal_scrollState?.clientWidth??0,n=t.internal_scrollState?.scrollWidth??0;if(n<=s)return;const{x:d,y:a}=e??O(t),i=t.style.overflowY??r,g=t.internal_scrollState?.clientHeight??0,u=t.internal_scrollState?.scrollHeight??0,m=i==="scroll"&&u>g;return L({axis:"horizontal",clientDimension:s,hasOppositeScrollbar:m,height:o.getComputedHeight()-o.getComputedBorder(l.EDGE_TOP),marginBottom:o.getComputedBorder(l.EDGE_BOTTOM),marginRight:o.getComputedBorder(l.EDGE_RIGHT),scrollDimension:n,scrollPosition:t.internal_scrollState?.scrollLeft??0,width:o.getComputedWidth()-o.getComputedBorder(l.EDGE_LEFT)-o.getComputedBorder(l.EDGE_RIGHT),x:d+o.getComputedBorder(l.EDGE_LEFT),y:a+o.getComputedBorder(l.EDGE_TOP)})},"getHorizontalScrollbarBoundingBox"),rt=c((t,e)=>{if(!t.yogaNode||t===e)return 0;let o=t.yogaNode.getComputedTop(),r=t.parentNode;for(;r&&r!==e;)r.yogaNode&&(o+=r.yogaNode.getComputedTop()),r=r.parentNode;if(!(e!==void 0&&r!==e))return Math.round(o)},"getRelativeTop"),at=c((t,e)=>{if(!t.yogaNode||t===e)return 0;let o=t.yogaNode.getComputedLeft(),r=t.parentNode;for(;r&&r!==e;)r.yogaNode&&(o+=r.yogaNode.getComputedLeft()),r=r.parentNode;if(!(e!==void 0&&r!==e))return Math.round(o)},"getRelativeLeft"),$=c(t=>t.nodeName==="#text"?t.nodeValue:t.nodeName==="ink-text"||t.nodeName==="ink-virtual-text"?Y(t):"","getText"),V=c(t=>{const e=[],o=c((n,d,a)=>{const{visualX:i,visualY:g,x:u,y:m}=d;let h=0,p=0,y=a;const{userSelect:C}=n.style;if(C==="none"?y=!1:(C==="text"||C==="all")&&(y=!0),n.nodeName==="ink-text"||n.nodeName==="ink-virtual-text"){if(y){const f=$(n);return e.push({height:Math.round(n.yogaNode?.getComputedHeight()??0),node:n,text:f,visualX:Math.round(i),visualY:Math.round(g),width:Math.round(n.yogaNode?.getComputedWidth()??0),x:Math.round(u),y:Math.round(m)}),{h:0,hasContent:!0,v:0}}return{h:n.yogaNode?.getComputedWidth()??0,hasContent:!1,v:n.yogaNode?.getComputedHeight()??0}}if(n.nodeName==="ink-box"||n.nodeName==="ink-root"){if(!n.yogaNode||n.yogaNode.getDisplay()===l.DISPLAY_NONE)return{h:0,hasContent:!1,v:0};const f=n.yogaNode.getComputedBorder(l.EDGE_TOP),T=n.yogaNode.getComputedBorder(l.EDGE_BOTTOM),x=n.yogaNode.getComputedBorder(l.EDGE_LEFT),B=n.yogaNode.getComputedBorder(l.EDGE_RIGHT);h+=f+T,p+=x+B;const v=n.yogaNode.getFlexDirection(),D=v===l.FLEX_DIRECTION_COLUMN||v===l.FLEX_DIRECTION_COLUMN_REVERSE;let E=0,b=0,S=!1;for(const N of n.childNodes)if(N.yogaNode){const w=u+N.yogaNode.getComputedLeft()-x-E,I=m+N.yogaNode.getComputedTop()-f-b,R=i+N.yogaNode.getComputedLeft(),X=g+N.yogaNode.getComputedTop(),H=o(N,{visualX:R,visualY:X,x:w,y:I},y);H.hasContent&&(S=!0),D?b+=H.v:E+=H.h}return D?h+=b:p+=E,{h:p,hasContent:S,v:h}}return{h:0,hasContent:!1,v:0}},"collect"),{h:r,v:s}=o(t,{visualX:0,visualY:0,x:0,y:0},!0);return e.sort((n,d)=>n.y!==d.y?n.y-d.y:n.x-d.x),{fragments:e,removedHorizontal:Math.round(r),removedVertical:Math.round(s)}},"collectSortedFragments");var z=Object.defineProperty,_=M((t,e)=>z(t,"name",{value:e,configurable:!0}),"a");const P=_(t=>{let e=t,o=0,r=0;for(;e?.parentNode;){if(!e.yogaNode)return;o+=e.yogaNode.getComputedLeft(),r+=e.yogaNode.getComputedTop(),e=e.parentNode}return{x:o,y:r}},"getAbsoluteBorderPosition"),j=_(t=>P(t),"getAbsolutePosition"),it=_(t=>{const e=P(t);if(!(!e||!t.yogaNode))return{x:e.x+t.yogaNode.getComputedBorder(l.EDGE_LEFT)+t.yogaNode.getComputedPadding(l.EDGE_LEFT),y:e.y+t.yogaNode.getComputedBorder(l.EDGE_TOP)+t.yogaNode.getComputedPadding(l.EDGE_TOP)}},"getAbsoluteContentPosition"),lt=_((t,e)=>{const{initialState:o,onNewline:r,onSpace:s,onText:n}=e;if(t.nodeName!=="ink-box"&&t.nodeName!=="ink-root"&&t.nodeName!=="ink-text"&&t.nodeName!=="ink-virtual-text"||!t.yogaNode)return{lineBottom:0,state:o()};const{fragments:d}=V(t),a=o();a.currentX=0,a.lineBottom=0,a.yieldedContent=!1;for(const i of d){if(i.y>=a.lineBottom){const g=i.y-a.lineBottom,u=a.yieldedContent?1+g:g;u>0&&(r(u,a),a.currentX=0),a.lineBottom=i.y}if(i.x>a.currentX){const g=i.x-a.currentX;s(g,a),a.currentX=i.x}if(i.text.length>0&&(a.yieldedContent=!0,n(i,a)),(i.text.match(/\n/g)??[]).length>0){const g=i.text.lastIndexOf(`
2
+ `);a.currentX=i.text.length-g-1}else a.currentX+=i.text.length;a.lineBottom=Math.max(a.lineBottom,i.y+i.height)}return{lineBottom:a.lineBottom,state:a}},"processLayout");export{Q as P,G as a,V as b,L as c,O as d,nt as e,tt as f,et as g,Z as h,at as i,rt as j,$ as k,ot as l,it as m,j as n,lt as p};
@@ -0,0 +1 @@
1
+ var T=Object.defineProperty;var I=(e,o)=>T(e,"name",{value:o,configurable:!0});import{jsxs as d,jsx as h}from"react/jsx-runtime";import{useMemo as g}from"react";import{c as E}from"./braille-BBjIoaN0.js";import{Box as u}from"../components/box.js";import{Canvas as b}from"../components/canvas.js";import{Text as f}from"../components/text.js";var P=Object.defineProperty,y=I((e,o)=>P(e,"name",{value:o,configurable:!0}),"i");const C=["cyan","magenta","yellow","green","blue","red"],v=y(e=>e.length===0?[]:typeof e[0]=="number"?e.map((o,t)=>({x:t,y:o})):e,"toPoints"),w=y((e,o,t)=>e.color??t[o%t.length]??"cyan","pickSeriesColor"),Y=y(e=>{let o=Number.POSITIVE_INFINITY,t=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(const{points:l}of e)for(const r of l)r.x<o&&(o=r.x),r.x>t&&(t=r.x),r.y<n&&(n=r.y),r.y>s&&(s=r.y);return{xMax:t,xMin:o,yMax:s,yMin:n}},"computeExtents");var _=Object.defineProperty,N=I((e,o)=>_(e,"name",{value:o,configurable:!0}),"x");const F=C,M=N((e,o,t,n)=>{const s=o.xMax-o.xMin||1,l=o.yMax-o.yMin||1,r=(e.x-o.xMin)/s,c=(e.y-o.yMin)/l;return{px:Math.max(0,Math.min(t-1,Math.round(r*(t-1)))),py:Math.max(0,Math.min(n-1,Math.round((1-c)*(n-1))))}},"projectPoint"),S=N((e,o,t)=>{e.clear();const{axisColor:n,seriesList:s}=t,l=Math.max(1,e.width*2),r=Math.max(1,e.height*4);for(let c=0;c<e.width;c+=2)e.setCell(c,e.height-1,"·",{color:n,dim:!0});for(const{color:c,points:p}of s){if(p.length===0)continue;const x=E(e.width,e.height);if(o==="scatter")for(const i of p){const a=M(i,t,l,r);x.plotPoint(a.px,a.py)}else{let i=M(p[0],t,l,r);x.plotPoint(i.px,i.py);for(let a=1;a<p.length;a+=1){const m=M(p[a],t,l,r);x.plotLine(i.px,i.py,m.px,m.py),i=m}}x.flush(e,{color:c})}},"drawSeriesOnCanvas");function L({axisColor:e="gray",height:o=10,maxY:t,minY:n,palette:s=F,series:l,showLegend:r=!0,width:c=40}){const p=g(()=>{const x=l.map((a,m)=>({color:w(a,m,s),points:v(a.data),series:a})),i=Y(x);return{axisColor:e,palette:s,seriesList:x,xMax:i.xMax===Number.NEGATIVE_INFINITY?1:i.xMax,xMin:i.xMin===Number.POSITIVE_INFINITY?0:i.xMin,yMax:t??(i.yMax===Number.NEGATIVE_INFINITY?1:i.yMax),yMin:n??(i.yMin===Number.POSITIVE_INFINITY?0:i.yMin)}},[l,e,s,n,t]);return d(u,{flexDirection:"column",children:[h(b,{draw:I(x=>{S(x,"line",p)},"draw"),height:o,version:[l,c,o,n,t,e,s],width:c}),r?h(u,{gap:2,marginTop:1,children:p.seriesList.map(({color:x,series:i},a)=>d(u,{gap:1,children:[h(f,{color:x,children:"●"}),h(f,{children:i.label??`Series ${a+1}`})]},`${a}:${i.label??""}`))}):void 0]})}I(L,"f");N(L,"LineChart");export{C as D,M as a,Y as c,S as d,L as f,w as p,v as t};
@@ -0,0 +1,3 @@
1
+ var X=Object.defineProperty;var k=(n,t)=>X(n,"name",{value:t,configurable:!0});import{v as Y,c as Z,o as tt}from"./get-string-width-CbMPWEJO.js";import{t as et}from"./ansi-tokenizer-DqX9nJuk.js";var st=Object.defineProperty,at=k((n,t)=>st(n,"name",{value:t,configurable:!0}),"r$2"),nt=Object.defineProperty,rt=at((n,t)=>nt(n,"name",{value:t,configurable:!0}),"a"),it=Object.defineProperty,ht=rt((n,t)=>it(n,"name",{value:t,configurable:!0}),"i");const lt=ht(n=>Number.isInteger(n)?Y(n)||Z(n):!1,"isFullwidthCodePoint");var ot=Object.defineProperty,ct=k((n,t)=>ot(n,"name",{value:t,configurable:!0}),"r$1");let H=class{static{k(this,"h")}static{ct(this,"DataLimitedLruMap")}map;maxDataSize;maxKeys;currentDataSize=0;constructor(t,e){this.map=new Map,this.maxKeys=t,this.maxDataSize=e}get size(){return this.map.size}clear(){this.map.clear(),this.currentDataSize=0}get(t){if(!this.map.has(t))return;const e=this.map.get(t);return this.map.delete(t),this.map.set(t,e),e}set(t,e){const s=t.length;if(!(s>this.maxDataSize)){for(this.map.has(t)&&(this.map.delete(t),this.currentDataSize-=s);this.currentDataSize+s>this.maxDataSize&&this.map.size>0;){const a=this.map.keys().next().value;if(a===void 0)break;this.map.delete(a),this.currentDataSize-=a.length}for(;this.map.size>=this.maxKeys;){const a=this.map.keys().next().value;if(a===void 0)break;this.map.delete(a),this.currentDataSize-=a.length}this.map.set(t,e),this.currentDataSize+=s}}};const gt=1,ft=2,E=4,K=8,R=16,M=32,V=64,S=128;var ut=Object.defineProperty,dt=k((n,t)=>ut(n,"name",{value:t,configurable:!0}),"x");const p=1073741823,x=1073741824;class d{static{k(this,"StyledLine")}static{dt(this,"StyledLine")}length=0;static emptyCache=new Map;text;charData;spans;_cachedTrimmedLength;static empty(t){if(t<=0)return new d;const e=d.emptyCache.get(t);if(e)return e.clone();const s=new d;s.length=t,s.text=" ".repeat(t),s.charData=Array.from({length:t});for(let a=0;a<t;a++)s.charData[a]=a;return s.spans=[{formatFlags:0,length:t}],s._cachedTrimmedLength=0,Object.freeze(s.spans[0]),Object.freeze(s.spans),Object.freeze(s),d.emptyCache.set(t,s),s.clone()}getValue(t){if(this.text===void 0||t<0||t>=this.length)return"";const e=this.charData[t]&p,s=t+1<this.length?this.charData[t+1]&p:this.text.length;return this.text.slice(e,s)}getTextRange(t,e){if(this.text===void 0||t<0||e>this.length||t>=e)return"";const s=this.charData[t]&p,a=e<this.length?this.charData[e]&p:this.text.length;return this.text.slice(s,a)}getSpan(t){if(this.spans===void 0||t<0||t>=this.length)return;let e=0;for(const s of this.spans){if(t<e+s.length)return s;e+=s.length}}getFullWidth(t){return this.charData===void 0||t<0||t>=this.length?!1:(this.charData[t]&x)!==0}hasStyles(t){const e=this.getSpan(t);return e?(e.formatFlags&~S)!==0||e.fgColor!==void 0||e.bgColor!==void 0||e.link!==void 0:!1}getFormatFlags(t){let e=this.getSpan(t)?.formatFlags??0;return this.getFullWidth(t)&&(e|=S),e}getFgColor(t){return this.getSpan(t)?.fgColor}getBgColor(t){return this.getSpan(t)?.bgColor}getLink(t){return this.getSpan(t)?.link}setInverted(t,e){this._cachedTrimmedLength=void 0,this.updateSpanAt(t,s=>{e?s.formatFlags|=M:s.formatFlags&=~M})}setBackgroundColor(t,e){this._cachedTrimmedLength=void 0,this.updateSpanAt(t,s=>{s.bgColor=e})}setForegroundColor(t,e){this._cachedTrimmedLength=void 0,this.updateSpanAt(t,s=>{s.fgColor=e})}setChar(t,e,s,a,r,h){if(t<0||t>=this.length)return;this._cachedTrimmedLength=void 0,this.ensureInitialized();const i=(s&S)!==0,o=s&~S,l=this.charData[t]&p,c=t+1<this.length?this.charData[t+1]&p:this.text.length,m=c-l,b=e.length;if(this.text=this.text.slice(0,l)+e+this.text.slice(c),m!==b){const f=b-m;for(let v=t+1;v<this.length;v++){const T=this.charData[v],w=T&p,L=T&x;this.charData[v]=w+f|L}}if(this.charData[t]=l|(i?x:0),this.trySetStyleAtIndex(t,o,a,r,h))return;this.splitSpansAt(t),this.splitSpansAt(t+1);let u=0;for(let f=0;f<this.spans.length;f++){const v=this.spans[f];if(u===t&&v.length===1){this.spans[f]={bgColor:r,fgColor:a,formatFlags:o,length:1,link:h};break}u+=v.length}this.mergeSpans()}setCharFast(t,e,s,a,r,h){if(t<0||t>=this.length)return;this._cachedTrimmedLength=void 0,this.ensureInitialized();const i=(s&S)!==0,o=s&~S,l=this.charData[t]&p,c=t+1<this.length?this.charData[t+1]&p:this.text.length,m=c-l;if(e.length===m)e!==this.text.slice(l,c)&&(this.text=this.text.slice(0,l)+e+this.text.slice(c)),this.charData[t]=l|(i?x:0);else{if(this.text=this.text.slice(0,l)+e+this.text.slice(c),m!==e.length){const u=e.length-m;for(let f=t+1;f<this.length;f++){const v=this.charData[f];this.charData[f]=(v&p)+u|v&x}}this.charData[t]=l|(i?x:0)}if(this.trySetStyleAtIndex(t,o,a,r,h))return;this.splitSpansAt(t),this.splitSpansAt(t+1);let b=0;for(let u=0;u<this.spans.length;u++){const f=this.spans[u];if(b===t&&f.length===1){this.spans[u]={bgColor:r,fgColor:a,formatFlags:o,length:1,link:h};break}b+=f.length}this.mergeSpans()}writeFrom(t,e,s=0,a){const r=a??e.length-s;if(r<=0||t>=this.length)return;this._cachedTrimmedLength=void 0,this.ensureInitialized();const h=Math.min(r,this.length-t,e.length-s),i=this.charData[t]&p,o=t+h<this.length?this.charData[t+h]&p:this.text.length;let l="";for(let g=0;g<h;g++)l+=e.getValue(s+g);const c=o-i,m=l.length-c;this.text=this.text.slice(0,i)+l+this.text.slice(o);let b=i;for(let g=0;g<h;g++){const D=e.getFullWidth(s+g);this.charData[t+g]=b|(D?x:0),b+=e.getValue(s+g).length}if(m!==0)for(let g=t+h;g<this.length;g++){const D=this.charData[g];this.charData[g]=(D&p)+m|D&x}this.splitSpansAt(t),this.splitSpansAt(t+h);const u=[];let f=0;for(const g of e.getSpans()){const D=f+g.length,P=Math.max(s,f),j=Math.min(s+h,D);if(P<j&&u.push({...g,length:j-P}),f=D,f>=s+h)break}let v=0,T=0;for(let g=0;g<this.spans.length;g++){if(T===t){v=g;break}T+=this.spans[g].length}let w=0,L=0;for(let g=v;g<this.spans.length&&L<h;g++)L+=this.spans[g].length,w++;this.spans.splice(v,w,...u),this.mergeSpans()}pushChar(t,e,s,a,r){this._cachedTrimmedLength=void 0,this.ensureInitialized();const h=(e&S)!==0,i=e&~S,o=this.text.length;this.text=(this.text??"")+t,this.charData.push(o|(h?x:0));const l=this.spans.at(-1);l?.formatFlags===i&&l.fgColor===s&&l.bgColor===a&&l.link===r?l.length++:this.spans.push({bgColor:a,fgColor:s,formatFlags:i,length:1,link:r}),this.length++}clone(){if(this.charData===void 0)return new d;const t=new d;return t.length=this.length,t.text=this.text,t.charData=[...this.charData],t.spans=this.spans.map(e=>({...e})),t._cachedTrimmedLength=this._cachedTrimmedLength,t}slice(t,e){if(this.charData===void 0)return new d;const s=Math.max(0,t),a=e===void 0?this.length:Math.min(this.length,e);if(s>=a)return new d;if(s===0&&a===this.length)return this.clone();const r=new d;r.length=a-s,r.charData=Array.from({length:r.length});const h=this.charData[s]&p,i=a<this.length?this.charData[a]&p:this.text.length;r.text=this.text.slice(h,i);for(let c=0;c<r.length;c++){const m=this.charData[s+c],b=m&p,u=m&x;r.charData[c]=b-h|u}const o=[];let l=0;for(const c of this.spans){const m=l,b=l+c.length,u=Math.max(s,m),f=Math.min(a,b);if(u<f&&o.push({...c,length:f-u}),l+=c.length,l>=a)break}return r.spans=o,r.mergeSpans(),r}combine(...t){if(t.length===0)return this.clone();const e=[this,...t].filter(i=>i.length>0);if(e.length===0)return new d;if(e.length===1)return e[0].clone();let s=0;for(const i of e)s+=i.length;const a=new d;a.length=s,a.text=e.map(i=>i.getText()).join(""),a.charData=Array.from({length:s});let r=0,h=0;for(const i of e){const o=i.charData,l=i.getText();if(o)for(let c=0;c<i.length;c++){const m=o[c],b=m&p,u=m&x;a.charData[r+c]=h+b|u}else for(let c=0;c<i.length;c++)a.charData[r+c]=h+c;r+=i.length,h+=l.length}return a.spans=e.flatMap(i=>i.getSpans().map(o=>({...o}))),a.mergeSpans(),a}getTrimmedLength(){if(this._cachedTrimmedLength!==void 0)return this._cachedTrimmedLength;if(this.length===0)return this._cachedTrimmedLength=0,0;if(this.text===void 0||this.charData===void 0)return this._cachedTrimmedLength=0,0;let t=this.length-1;if(this.spans)for(let e=this.spans.length-1;e>=0;e--){const s=this.spans[e];if((s.formatFlags&~S)!==0||s.fgColor!==void 0||s.bgColor!==void 0||s.link!==void 0)return this._cachedTrimmedLength=t+1,this._cachedTrimmedLength;for(let a=0;a<s.length;a++){const r=this.charData[t]&p;if((t+1<this.length?this.charData[t+1]&p:this.text.length)-r!==1||this.text[r]!==" ")return this._cachedTrimmedLength=t+1,this._cachedTrimmedLength;t--}}return this._cachedTrimmedLength=0,0}trimEnd(){const t=this.getTrimmedLength();return t===this.length?this:t===0?new d:this.slice(0,t)}equals(t){if(this.length!==t.length)return!1;if(this.length===0)return!0;if(this.getText()!==t.getText())return!1;const e=this.getSpans(),s=t.getSpans();if(e.length!==s.length)return!1;for(const[h,i]of e.entries()){const o=i,l=s[h];if(o.length!==l.length||o.formatFlags!==l.formatFlags||o.fgColor!==l.fgColor||o.bgColor!==l.bgColor||o.link!==l.link)return!1}const a=this.charData,r=t.charData;if(a&&r){for(let h=0;h<this.length;h++)if(a[h]!==r[h])return!1}return!0}getText(){return this.text??""}getSpans(){return this.spans??[]}getValues(){return Array.from({length:this.length},(t,e)=>this.getValue(e))}*[Symbol.iterator](){if(this.length===0)return;let t=0,e=0;const s=this.getSpans();for(let a=0;a<this.length;a++){const r=s[t],h=r?r.formatFlags:0,i=this.getFullWidth(a);yield{bgColor:r?.bgColor,fgColor:r?.fgColor,formatFlags:h|(i?S:0),fullWidth:i,hasStyles:(h&~S)!==0||r?.fgColor!==void 0||r?.bgColor!==void 0||r?.link!==void 0,link:r?.link,value:this.getValue(a)},r&&(e++,e>=r.length&&(t++,e=0))}}updateSpanAt(t,e){if(t<0||t>=this.length)return;this.ensureInitialized(),this.splitSpansAt(t),this.splitSpansAt(t+1);let s=0;for(const a of this.spans){if(s===t&&a.length===1){e(a);break}s+=a.length}this.mergeSpans()}ensureWidth(t){if(t<=this.length)return;this.ensureInitialized();const e=this.length,s=t-e,a=this.text.length;for(let h=0;h<s;h++)this.charData.push(a);this.length=t;const r=this.spans.at(-1);r?.formatFlags===0&&r.fgColor===void 0&&r.bgColor===void 0&&r.link===void 0?r.length+=s:this.spans.push({formatFlags:0,length:s})}ensureInitialized(){if(this.charData===void 0&&(this.text="",this.charData=Array.from({length:this.length}),this.spans=this.length>0?[{formatFlags:0,length:this.length}]:[],this.length>0&&this.text.length===0)){this.text=" ".repeat(this.length);for(let t=0;t<this.length;t++)this.charData[t]=t}}splitSpansAt(t){if(this.spans===void 0||t<=0||t>=this.length)return;let e=0;for(let s=0;s<this.spans.length;s++){const a=this.spans[s];if(t>e&&t<e+a.length){const r=t-e,h=a.length-r;this.spans.splice(s,1,{...a,length:r},{...a,length:h});return}e+=a.length}}trySetStyleAtIndex(t,e,s,a,r){if(!this.spans)return!1;let h=0,i=-1,o;for(let l=0;l<this.spans.length;l++){const c=this.spans[l];if(h<=t&&h+c.length>t){i=l,o=c;break}h+=c.length}if(!o)return!1;if(o.formatFlags===e&&o.fgColor===s&&o.bgColor===a&&o.link===r)return!0;if(t===h&&i>0){const l=this.spans[i-1];if(l.formatFlags===e&&l.fgColor===s&&l.bgColor===a&&l.link===r)return l.length+=1,o.length===1?this.spans.splice(i,1):o.length-=1,!0}if(t===h+o.length-1&&i<this.spans.length-1){const l=this.spans[i+1];if(l.formatFlags===e&&l.fgColor===s&&l.bgColor===a&&l.link===r)return l.length+=1,o.length===1?this.spans.splice(i,1):o.length-=1,!0}return!1}mergeSpans(){if(this.spans===void 0)return;const t=[];for(const e of this.spans){if(e.length===0)continue;const s=t.at(-1);s?.formatFlags===e.formatFlags&&s.fgColor===e.fgColor&&s.bgColor===e.bgColor&&s.link===e.link?s.length+=e.length:t.push({...e})}this.spans=t}}var mt=Object.defineProperty,$=k((n,t)=>mt(n,"name",{value:t,configurable:!0}),"u$1");const G={black:0,blue:4,cyan:6,gray:8,green:2,grey:8,magenta:5,red:1,white:7,yellow:3},U={blackBright:8,blueBright:12,cyanBright:14,greenBright:10,magentaBright:13,redBright:9,whiteBright:15,yellowBright:11},q=/^ansi256\(\s?(\d+)\s?\)$/,J=/^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,Et=$(n=>{const t=G[n];if(t!==void 0)return t;const e=U[n];if(e!==void 0)return e;const s=q.exec(n);if(s)return Number(s[1])&255;if(n.startsWith("#")&&n.length===7){const r=Number.parseInt(n.slice(1,3),16),h=Number.parseInt(n.slice(3,5),16),i=Number.parseInt(n.slice(5,7),16);return 16+36*Math.round(r/51)+6*Math.round(h/51)+Math.round(i/51)}const a=J.exec(n);return a?16+36*Math.round(Number(a[1])/51)+6*Math.round(Number(a[2])/51)+Math.round(Number(a[3])/51):255},"colorToAnsi256"),pt=$((n,t)=>{const e=t?30:40,s=G[n];if(s!==void 0)return[e+s];const a=U[n];if(a!==void 0)return[e+60+(a-8)];if(n.startsWith("#")&&n.length===7){const i=Number.parseInt(n.slice(1,3),16),o=Number.parseInt(n.slice(3,5),16),l=Number.parseInt(n.slice(5,7),16);return[t?38:48,2,i,o,l]}const r=q.exec(n);if(r)return[t?38:48,5,Number(r[1])];const h=J.exec(n);return h?[t?38:48,2,Number(h[1]),Number(h[2]),Number(h[3])]:[]},"colorToSgrParams");$((n,t)=>{const e=pt(n,t);if(e.length!==0)return`\x1B[${e.join(";")}m`},"colorToAnsiCode");const A=$(n=>{const t=["black","red","green","yellow","blue","magenta","cyan","white"];return n>=0&&n<=7?t[n]:`ansi256(${n})`},"ansi256ToColorName");var bt=Object.defineProperty,y=k((n,t)=>bt(n,"name",{value:t,configurable:!0}),"u");const O=y(()=>({bgColor:void 0,fgColor:void 0,formatFlags:0,link:void 0}),"createSgrState"),vt=y((n,t)=>{if(t.length===0)return O();const e=(t.includes(":")?t.replaceAll(":",";"):t).split(";").filter(o=>o.length>0).map(Number);let{bgColor:s,fgColor:a,formatFlags:r,link:h}=n,i=0;for(;i<e.length;){const o=e[i];switch(o){case 0:{r=0,a=void 0,s=void 0,h=void 0;break}case 1:{r|=gt;break}case 2:{r|=ft;break}case 3:{r|=E;break}case 4:{r|=K;break}case 7:{r|=M;break}case 8:{r|=V;break}case 9:{r|=R;break}case 22:{r&=-4;break}case 23:{r&=~E;break}case 24:{r&=~K;break}case 27:{r&=~M;break}case 28:{r&=~V;break}case 29:{r&=~R;break}case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:{a=A(o-30);break}case 38:{e[i+1]===5&&e[i+2]!==void 0?(a=A(e[i+2]),i+=2):e[i+1]===2&&i+4<e.length&&(a=`rgb(${e[i+2]}, ${e[i+3]}, ${e[i+4]})`,i+=4);break}case 39:{a=void 0;break}case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:{s=A(o-40);break}case 48:{e[i+1]===5&&e[i+2]!==void 0?(s=A(e[i+2]),i+=2):e[i+1]===2&&i+4<e.length&&(s=`rgb(${e[i+2]}, ${e[i+3]}, ${e[i+4]})`,i+=4);break}case 49:{s=void 0;break}case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:{a=`ansi256(${o-90+8})`;break}case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:{s=`ansi256(${o-100+8})`;break}}i++}return{bgColor:s,fgColor:a,formatFlags:r,link:h}},"applySgrParams"),I=127462,z=127487,St=127995,xt=127999,Ct=8205,kt=917504,Dt=917631,yt=new RegExp("\\p{Mark}","u"),Tt=new Intl.Segmenter(void 0,{granularity:"grapheme"}),Ft=y((n,t)=>!!(lt(t)||n.includes("️")||t>=I&&t<=z),"isFullwidthGrapheme"),wt=/(?:\u001B\]|\u009D)8;([^;]*);(.*?)(?:\u001B\\|\u0007|\u009C)/,Lt=y(n=>{const t=wt.exec(n);return!t?.[2]||t[2].length===0?void 0:n.endsWith("\x1B\\")?`ST:${t[2]}`:t[2]},"parseOscHyperlink"),Q=y((n,t,e)=>{const s=Tt.segment(n),a=[];for(const{segment:r}of s)a.push(r);for(let r=0;r<a.length;r++){let h=a[r];if(h===" "){for(let l=0;l<4;l++)t.pushChar(" ",e.formatFlags,e.fgColor,e.bgColor,e.link);continue}if(h==="\b")continue;const i=h.codePointAt(0);if(!i)continue;if(i>=I&&i<=z&&r+1<a.length){const l=a[r+1],c=l.codePointAt(0);c&&c>=I&&c<=z&&(h+=l,r++)}else for(;r+1<a.length;){const l=a[r+1],c=l.codePointAt(0);if(!c)break;const m=yt.test(String.fromCodePoint(c)),b=c>=St&&c<=xt,u=c===Ct,f=c>=kt&&c<=Dt;if(!m&&!b&&!u&&!f)break;h+=l,r++,u&&r+1<a.length&&(h+=a[r+1],r++)}const o=Ft(h,i)?e.formatFlags|S:e.formatFlags;t.pushChar(h,o,e.fgColor,e.bgColor,e.link)}},"processTextToken"),At=y(n=>{if(n.length===0)return new d;const t=et(n),e=new d;let s=O();for(const a of t)switch(a.type){case"csi":{a.finalCharacter==="m"&&(s=vt(s,a.parameterString));break}case"osc":{const r=Lt(a.value);r!==void 0?s={...s,link:r}:a.value.includes("8;")&&(s={...s,link:void 0});break}case"text":{Q(a.value,e,s);break}}return e},"textToStyledLine"),Mt=/^[\u0020-\u007E]*$/,Kt=y(n=>{if(n.length===0)return new d;const t=new d;if(Mt.test(n)){for(const e of n)t.pushChar(e,0);return t}return Q(n,t,O()),t},"plainTextToStyledLine");var $t=Object.defineProperty,C=k((n,t)=>$t(n,"name",{value:t,configurable:!0}),"r");const N=new H(1e4,1e6),B=new Map,F=new H(1e4,1e6);let W=!0,_=tt;const Rt=C(n=>{W=n,n||F.clear()},"setEnableStyledLineCache"),Vt=C(()=>{F.clear()},"clearStyledLineCache"),Ht=C(n=>{_=n,It()},"setStringWidthFunction"),It=C(()=>{N.clear(),B.clear(),F.clear()},"clearStringWidthCache"),zt=C(n=>{if(n.length===1){const s=n.codePointAt(0);if(s!==void 0&&s>=32&&s<127)return 1}const t=B.get(n);if(t!==void 0)return t;let e;try{e=_(n)}catch{e=1}return B.set(n,e),e},"inkCharacterWidth"),Nt=C(n=>{try{return _(n)}catch{return 1}},"safeGetStringWidth"),Gt=C(n=>{if(n.length===0)return{height:0,width:0};const t=N.get(n);if(t)return t;const e=n.split(`
2
+ `),s=Math.max(...e.map(r=>Nt(r))),a={height:e.length,width:s};return N.set(n,a),a},"measureText"),Ut=C(n=>{if(W){const e=F.get(n);if(e!==void 0)return e}const t=At(n);return W&&F.set(n,t),t},"toStyledLine"),Bt=C(n=>{let t=0;for(let e=0;e<n.length;e++)t+=zt(n.getValue(e));return t},"styledLineWidth"),Wt=C(n=>{if(n.length===0)return[new d];const t=[];let e=0;for(let s=0;s<n.length;s++)n.getValue(s)===`
3
+ `&&(t.push(s>e?n.slice(e,s):new d),e=s+1);return t.push(e<n.length?n.slice(e):new d),t},"splitStyledLineByNewline"),qt=C(n=>{if(n.length===0)return{height:0,width:0};const t=Wt(n);let e=0;for(const s of t)e=Math.max(e,Bt(s));return{height:t.length,width:e}},"measureStyledLine");export{gt as B,ft as D,S as F,V as H,E as I,d as S,K as U,Vt as a,Ht as b,It as c,Bt as d,Gt as e,M as f,R as g,pt as h,zt as i,Et as j,At as k,lt as l,qt as m,Wt as n,Kt as p,Rt as s,Ut as t};
@@ -0,0 +1 @@
1
+ import"yoga-layout";import{c as r,a as g,b as i,P as s,g as c,d as n,e as d,f as u,h as b,i as m,j as B,k as S,l as h}from"./layout-BMo200nF.js";import"./getScrollHeight-ClEOyLHH.js";import"./squashTextNodesWithMap-DCdi3SZ2.js";export{r as calculateScrollbarLayout,g as calculateScrollbarThumb,i as collectSortedFragments,s as default,c as getAddedScrollHeight,n as getBoundingBox,d as getHorizontalScrollbarBoundingBox,u as getInnerHeight,b as getInnerWidth,m as getRelativeLeft,B as getRelativeTop,S as getText,h as getVerticalScrollbarBoundingBox};
@@ -0,0 +1 @@
1
+ var $=Object.defineProperty;var d=(e,o)=>$(e,"name",{value:o,configurable:!0});import{a}from"./constants-D12jy2Zh-RSfxu1eM.js";var f=Object.defineProperty,u=d((e,o)=>f(e,"name",{value:o,configurable:!0}),"i"),p=Object.defineProperty,M=u((e,o)=>p(e,"name",{value:o,configurable:!0}),"u"),S=Object.defineProperty,r=M((e,o)=>S(e,"name",{value:o,configurable:!0}),"s");class y{static{d(this,"j")}static{u(this,"h")}static{M(this,"g")}static{r(this,"AnsiModeImpl")}code;isDecMode=!1;constructor(o){this.code=o}}class R{static{d(this,"X")}static{u(this,"g")}static{M(this,"u")}static{r(this,"DecModeImpl")}code;isDecMode=!0;constructor(o){this.code=o}}const m=r((e,...o)=>{if(o.length===0)return"";const i=e?"l":"h";if(o.length===1){const n=o[0];let h=a;return n.isDecMode&&(h+="?"),h+String(n.code)+i}const c=o.filter(n=>!n.isDecMode).map(n=>n.code),g=o.filter(n=>n.isDecMode).map(n=>n.code);let l="";return c.length>0&&(l+=`${a}${c.join(";")}${i}`),g.length>0&&(l+=`${a}?${g.join(";")}${i}`),l},"generateModeSequence");var D=(e=>(e[e.NotRecognized=0]="NotRecognized",e[e.Set=1]="Set",e[e.Reset=2]="Reset",e[e.PermanentlySet=3]="PermanentlySet",e[e.PermanentlyReset=4]="PermanentlyReset",e))(D||{});r(e=>e===0,"isModeNotRecognized");r(e=>e===1||e===3,"isModeSet");r(e=>e===2||e===4,"isModeReset");r(e=>e===3,"isModePermanentlySet");r(e=>e===4,"isModePermanentlyReset");const s=r(e=>new y(e),"createAnsiMode"),t=r(e=>new R(e),"createDecMode"),b=r((...e)=>m(!1,...e),"setMode"),j=r((...e)=>m(!0,...e),"resetMode");r(e=>{let o=a;return e.isDecMode&&(o+="?"),`${o}${String(e.code)}$p`},"requestMode");r((e,o)=>{let i=o;(o<0||o>4)&&(i=0);let c=a;return e.isDecMode&&(c+="?"),`${c}${String(e.code)};${String(i)}$y`},"reportMode");s(2);s(4);s(8);s(12);s(20);t(1);t(6);t(7);t(9);t(25);t(66);t(67);t(69);t(1e3);t(1001);t(1002);t(1003);t(1004);t(1005);t(1006);t(1015);t(1016);t(1035);t(1047);t(1048);t(1049);const z=t(2004);t(2026);t(2027);t(9001);t(2031);t(2048);export{z as e,j as g,b as h,t as o};
@@ -0,0 +1 @@
1
+ import{createContext as o}from"react";const t=o(null);t.displayName="MouseContext";export{t as o};
@@ -0,0 +1 @@
1
+ import{a as e}from"./ansi-parser-C5JuL732.js";export{e as parseSgrMouse};
@@ -0,0 +1 @@
1
+ import"yoga-layout";import{m as e,n as i,p as n}from"./layout-BMo200nF.js";export{e as getAbsoluteContentPosition,i as getAbsolutePosition,n as processLayout};
@@ -0,0 +1 @@
1
+ var b=Object.defineProperty;var p=(e,t)=>b(e,"name",{value:t,configurable:!0});import{createRequire as D}from"node:module";import{version as F,createContext as G}from"react";import v from"react-reconciler";import{NoEventPriority as R,DefaultEventPriority as w}from"react-reconciler/constants.js";import{s as m}from"./index-COPEEDn3.js";import n from"yoga-layout";import{b as I,d as E,s as _,m as T,e as k,r as C,f as B,c as W,h as N,j as S}from"./dom-CW6KYzFK.js";const ee=D(import.meta.url),O=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,L=O;var M=Object.defineProperty,u=p((e,t)=>M(e,"name",{value:t,configurable:!0}),"t");const H=[["top",n.EDGE_TOP],["right",n.EDGE_RIGHT],["bottom",n.EDGE_BOTTOM],["left",n.EDGE_LEFT]],U=u((e,t)=>{if("position"in t){let r=n.POSITION_TYPE_RELATIVE;t.position==="absolute"?r=n.POSITION_TYPE_ABSOLUTE:t.position==="static"&&(r=n.POSITION_TYPE_STATIC),e.setPositionType(r)}for(const[r,s]of H){if(!(r in t))continue;const l=t[r];if(typeof l=="string"){e.setPositionPercent(s,Number.parseFloat(l));continue}e.setPosition(s,l)}},"applyPositionStyles"),Y=u((e,t)=>{"margin"in t&&e.setMargin(n.EDGE_ALL,t.margin??0),"marginX"in t&&e.setMargin(n.EDGE_HORIZONTAL,t.marginX??0),"marginY"in t&&e.setMargin(n.EDGE_VERTICAL,t.marginY??0),"marginLeft"in t&&e.setMargin(n.EDGE_START,t.marginLeft||0),"marginRight"in t&&e.setMargin(n.EDGE_END,t.marginRight||0),"marginTop"in t&&e.setMargin(n.EDGE_TOP,t.marginTop||0),"marginBottom"in t&&e.setMargin(n.EDGE_BOTTOM,t.marginBottom||0)},"applyMarginStyles"),j=u((e,t)=>{"padding"in t&&e.setPadding(n.EDGE_ALL,t.padding??0),"paddingX"in t&&e.setPadding(n.EDGE_HORIZONTAL,t.paddingX??0),"paddingY"in t&&e.setPadding(n.EDGE_VERTICAL,t.paddingY??0),"paddingLeft"in t&&e.setPadding(n.EDGE_LEFT,t.paddingLeft||0),"paddingRight"in t&&e.setPadding(n.EDGE_RIGHT,t.paddingRight||0),"paddingTop"in t&&e.setPadding(n.EDGE_TOP,t.paddingTop||0),"paddingBottom"in t&&e.setPadding(n.EDGE_BOTTOM,t.paddingBottom||0)},"applyPaddingStyles"),X=u((e,t)=>{"flexGrow"in t&&e.setFlexGrow(t.flexGrow??0),"flexShrink"in t&&e.setFlexShrink(typeof t.flexShrink=="number"?t.flexShrink:1),"flexWrap"in t&&(t.flexWrap==="nowrap"&&e.setFlexWrap(n.WRAP_NO_WRAP),t.flexWrap==="wrap"&&e.setFlexWrap(n.WRAP_WRAP),t.flexWrap==="wrap-reverse"&&e.setFlexWrap(n.WRAP_WRAP_REVERSE)),"flexDirection"in t&&(t.flexDirection==="row"&&e.setFlexDirection(n.FLEX_DIRECTION_ROW),t.flexDirection==="row-reverse"&&e.setFlexDirection(n.FLEX_DIRECTION_ROW_REVERSE),t.flexDirection==="column"&&e.setFlexDirection(n.FLEX_DIRECTION_COLUMN),t.flexDirection==="column-reverse"&&e.setFlexDirection(n.FLEX_DIRECTION_COLUMN_REVERSE)),"flexBasis"in t&&(typeof t.flexBasis=="number"?e.setFlexBasis(t.flexBasis):typeof t.flexBasis=="string"?e.setFlexBasisPercent(Number.parseInt(t.flexBasis,10)):e.setFlexBasis(Number.NaN)),"alignItems"in t&&((t.alignItems==="stretch"||!t.alignItems)&&e.setAlignItems(n.ALIGN_STRETCH),t.alignItems==="flex-start"&&e.setAlignItems(n.ALIGN_FLEX_START),t.alignItems==="center"&&e.setAlignItems(n.ALIGN_CENTER),t.alignItems==="flex-end"&&e.setAlignItems(n.ALIGN_FLEX_END),t.alignItems==="baseline"&&e.setAlignItems(n.ALIGN_BASELINE)),"alignSelf"in t&&((t.alignSelf==="auto"||!t.alignSelf)&&e.setAlignSelf(n.ALIGN_AUTO),t.alignSelf==="flex-start"&&e.setAlignSelf(n.ALIGN_FLEX_START),t.alignSelf==="center"&&e.setAlignSelf(n.ALIGN_CENTER),t.alignSelf==="flex-end"&&e.setAlignSelf(n.ALIGN_FLEX_END),t.alignSelf==="stretch"&&e.setAlignSelf(n.ALIGN_STRETCH),t.alignSelf==="baseline"&&e.setAlignSelf(n.ALIGN_BASELINE)),"alignContent"in t&&((t.alignContent==="flex-start"||!t.alignContent)&&e.setAlignContent(n.ALIGN_FLEX_START),t.alignContent==="center"&&e.setAlignContent(n.ALIGN_CENTER),t.alignContent==="flex-end"&&e.setAlignContent(n.ALIGN_FLEX_END),t.alignContent==="space-between"&&e.setAlignContent(n.ALIGN_SPACE_BETWEEN),t.alignContent==="space-around"&&e.setAlignContent(n.ALIGN_SPACE_AROUND),t.alignContent==="space-evenly"&&e.setAlignContent(n.ALIGN_SPACE_EVENLY),t.alignContent==="stretch"&&e.setAlignContent(n.ALIGN_STRETCH)),"justifyContent"in t&&((t.justifyContent==="flex-start"||!t.justifyContent)&&e.setJustifyContent(n.JUSTIFY_FLEX_START),t.justifyContent==="center"&&e.setJustifyContent(n.JUSTIFY_CENTER),t.justifyContent==="flex-end"&&e.setJustifyContent(n.JUSTIFY_FLEX_END),t.justifyContent==="space-between"&&e.setJustifyContent(n.JUSTIFY_SPACE_BETWEEN),t.justifyContent==="space-around"&&e.setJustifyContent(n.JUSTIFY_SPACE_AROUND),t.justifyContent==="space-evenly"&&e.setJustifyContent(n.JUSTIFY_SPACE_EVENLY))},"applyFlexStyles"),V=u((e,t)=>{"width"in t&&(typeof t.width=="number"?e.setWidth(t.width):typeof t.width=="string"?e.setWidthPercent(Number.parseInt(t.width,10)):e.setWidthAuto()),"height"in t&&(typeof t.height=="number"?e.setHeight(t.height):typeof t.height=="string"?e.setHeightPercent(Number.parseInt(t.height,10)):e.setHeightAuto()),"minWidth"in t&&(typeof t.minWidth=="string"?e.setMinWidthPercent(Number.parseInt(t.minWidth,10)):e.setMinWidth(t.minWidth??0)),"minHeight"in t&&(typeof t.minHeight=="string"?e.setMinHeightPercent(Number.parseInt(t.minHeight,10)):e.setMinHeight(t.minHeight??0)),"maxWidth"in t&&(typeof t.maxWidth=="string"?e.setMaxWidthPercent(Number.parseInt(t.maxWidth,10)):e.setMaxWidth(t.maxWidth)),"maxHeight"in t&&(typeof t.maxHeight=="string"?e.setMaxHeightPercent(Number.parseInt(t.maxHeight,10)):e.setMaxHeight(t.maxHeight)),"aspectRatio"in t&&e.setAspectRatio(t.aspectRatio)},"applyDimensionStyles"),J=u((e,t)=>{"display"in t&&e.setDisplay(t.display==="flex"?n.DISPLAY_FLEX:n.DISPLAY_NONE)},"applyDisplayStyles"),q=u((e,t,r)=>{if(!("borderStyle"in t||"borderTop"in t||"borderBottom"in t||"borderLeft"in t||"borderRight"in t))return;const s=r.borderStyle?1:0;e.setBorder(n.EDGE_TOP,r.borderTop===!1?0:s),e.setBorder(n.EDGE_BOTTOM,r.borderBottom===!1?0:s),e.setBorder(n.EDGE_LEFT,r.borderLeft===!1?0:s),e.setBorder(n.EDGE_RIGHT,r.borderRight===!1?0:s)},"applyBorderStyles"),$=u((e,t)=>{"gap"in t&&e.setGap(n.GUTTER_ALL,t.gap??0),"columnGap"in t&&e.setGap(n.GUTTER_COLUMN,t.columnGap??0),"rowGap"in t&&e.setGap(n.GUTTER_ROW,t.rowGap??0)},"applyGapStyles"),z=u((e,t)=>{const r=t.overflow??"visible",s=t.overflowX??r,l=t.overflowY??r;s==="scroll"||l==="scroll"?e.setOverflow(n.OVERFLOW_SCROLL):s==="hidden"||l==="hidden"?e.setOverflow(n.OVERFLOW_HIDDEN):e.setOverflow(n.OVERFLOW_VISIBLE)},"applyOverflowStyles"),x=u((e,t={},r=t)=>{U(e,t),Y(e,t),j(e,t),X(e,t),V(e,t),J(e,t),q(e,t,r),$(e,t),z(e,r)},"styles");var Z=Object.defineProperty,c=p((e,t)=>Z(e,"name",{value:t,configurable:!0}),"c");if(L.env.DEV==="true"){let e=!1;try{import.meta.resolve("react-devtools-core"),e=!0}catch{}e&&await import("../packem_chunks/devtools.js")}const A=c((e,t)=>{if(e===t)return;if(!e)return t;const r={};let s=!1;for(const l of Object.keys(e))(!t||!Object.hasOwn(t,l))&&(r[l]=void 0,s=!0);if(t)for(const l of Object.keys(t))t[l]!==e[l]&&(r[l]=t[l],s=!0);return s?r:void 0},"diff"),y=c(e=>{if(e){if(e.yogaNode?.unsetMeasureFunc(),"resizeObservers"in e&&e.resizeObservers?.clear(),"childNodes"in e&&e.childNodes)for(const t of e.childNodes)y(t);e.yogaNode?.free(),"cachedRender"in e&&(e.cachedRender=void 0),"childNodes"in e&&(e.childNodes=[]),e.parentNode=void 0}},"cleanupNodeTree");let g=R,h;async function P(){const e=(await import("node:fs")).readFileSync(new URL("../package.json",import.meta.url),"utf8"),t=JSON.parse(e);return{name:t?.name,version:t?.version}}p(P,"B");c(P,"loadPackageJson");let f={name:"ink",version:F};if(L.env.DEV==="true")try{const e=await P();f={name:e.name||f.name,version:e.version||f.version}}catch(e){console.warn("Failed to load package.json in development mode. Falling back to default renderer metadata.",e)}const ae=v({afterActiveInstanceBlur(){},appendChild:E,appendChildToContainer:E,appendInitialChild:E,beforeActiveInstanceBlur(){},cancelCallback:m.unstable_cancelCallback,cancelTimeout:clearTimeout,clearContainer:c(()=>!1,"clearContainer"),commitTextUpdate(e,t,r){_(e,r)},commitUpdate(e,t,r,s){h&&e.internal_static&&(h.isStaticDirty=!0);const l=A(r,s),a=A(r.style,s.style);if(!l&&!a)return;let i=!!a;if(l){for(const[o,d]of Object.entries(l))if(o!=="children"){if(o==="style"){N(e,d);continue}if(o==="internal_transform"){e.internal_transform=d,i=!0;continue}if(o==="internal_cursor"){e.internal_cursor=d,i=!0;continue}if(o==="internal_static"){e.internal_static=!0,i=!0;continue}if(o==="sticky"){e.internal_sticky=d,i=!0;continue}if(o==="internalStickyAlternate"){e.internal_stickyAlternate=d,i=!0;continue}if(o==="opaque"){e.internal_opaque=d,i=!0;continue}if(o==="scrollbar"){e.internal_scrollbar=d,i=!0;continue}if(o==="internal_terminalCursorFocus"){e.internal_terminalCursorFocus=d,i=!0;continue}if(o==="internal_terminalCursorPosition"){e.internal_terminalCursorPosition=d,i=!0;continue}if(o==="cachedRender"){e.cachedRender=d,i=!0;continue}S(e,o,d),i=!0}}a&&e.yogaNode&&x(e.yogaNode,a,s.style??{}),i&&T(e)},createInstance(e,t,r,s){if(s.isInsideText&&e==="ink-box")throw new Error("<Box> can’t be nested inside <Text> component");if(s.isInsideText&&e==="ink-cursor")throw new Error("<Cursor> can’t be nested inside <Text> component");const l=e==="ink-text"&&s.isInsideText?"ink-virtual-text":e,a=W(l);for(const[i,o]of Object.entries(t))if(i!=="children"){if(i==="style"){N(a,o),a.yogaNode&&x(a.yogaNode,o);continue}if(i==="internal_transform"){a.internal_transform=o;continue}if(i==="internal_cursor"){a.internal_cursor=o;continue}if(i==="internal_static"){h=r,a.internal_static=!0,r.isStaticDirty=!0,r.staticNode=a;continue}if(i==="sticky"){a.internal_sticky=o;continue}if(i==="internalStickyAlternate"){a.internal_stickyAlternate=o;continue}if(i==="opaque"){a.internal_opaque=o;continue}if(i==="scrollbar"){a.internal_scrollbar=o;continue}if(i==="internal_terminalCursorFocus"){a.internal_terminalCursorFocus=o;continue}if(i==="internal_terminalCursorPosition"){a.internal_terminalCursorPosition=o;continue}if(i==="internal_static"){a.internal_static=!0;continue}if(i==="cachedRender"){a.cachedRender=o;continue}S(a,i,o)}return a},createTextInstance(e,t,r){if(!r.isInsideText)throw new Error(`Text string "${e}" must be rendered inside <Text> component`);return B(e)},detachDeletedInstance(){},finalizeInitialChildren(){return!1},getChildHostContext(e,t){const r=e.isInsideText,s=t==="ink-text"||t==="ink-virtual-text";return r===s?e:{isInsideText:s}},getCurrentUpdatePriority:c(()=>g,"getCurrentUpdatePriority"),getInstanceFromNode:c(()=>null,"getInstanceFromNode"),getInstanceFromScope:c(()=>null,"getInstanceFromScope"),getPublicInstance:c(e=>e,"getPublicInstance"),getRootHostContext:c(()=>({isInsideText:!1}),"getRootHostContext"),hideInstance(e){e.internal_hidden=!0,e.yogaNode?.setDisplay(n.DISPLAY_NONE),T(e)},hideTextInstance(e){_(e,"")},HostTransitionContext:G(null),insertBefore:I,insertInContainerBefore:I,isPrimaryRenderer:!0,maySuspendCommit(){return!0},noTimeout:-1,NotPendingTransition:void 0,now:m.unstable_now,preloadInstance(){return!0},prepareForCommit:c(()=>null,"prepareForCommit"),preparePortalMount:c(()=>null,"preparePortalMount"),prepareScopeUpdate(){},removeChild(e,t){C(e,t),y(t)},removeChildFromContainer(e,t){C(e,t),y(t)},rendererPackageName:f.name,rendererVersion:f.version,requestPostPaintCallback(){},resetAfterCommit(e){if(typeof e.onComputeLayout=="function"&&e.onComputeLayout(),k(e),e.staticNode!==e.previousStaticNode&&(e.previousStaticNode=e.staticNode,typeof e.onStaticChange=="function"&&e.onStaticChange()),e.isStaticDirty){e.isStaticDirty=!1,typeof e.onImmediateRender=="function"&&e.onImmediateRender();return}typeof e.onRender=="function"&&e.onRender()},resetFormInstance(){},resetTextContent(){},resolveEventTimeStamp(){return-1.1},resolveEventType(){return null},resolveUpdatePriority(){return g!==R?g:w},scheduleCallback:m.unstable_scheduleCallback,scheduleMicrotask:queueMicrotask,scheduleTimeout:setTimeout,setCurrentUpdatePriority(e){g=e},shouldAttemptEagerTransition(){return!1},shouldSetTextContent:c(()=>!1,"shouldSetTextContent"),shouldYield:m.unstable_shouldYield,startSuspendingCommit(){},supportsHydration:!1,supportsMicrotasks:!0,supportsMutation:!0,supportsPersistence:!1,suspendInstance(){},trackSchedulerEvent(){},unhideInstance(e){e.internal_hidden=!1,e.yogaNode?.setDisplay(n.DISPLAY_FLEX),T(e)},unhideTextInstance(e,t){_(e,t)},waitForCommitToBeReady(){return null}});export{ae as L,x as u};
@@ -0,0 +1 @@
1
+ var b=Object.defineProperty;var c=(e,t)=>b(e,"name",{value:t,configurable:!0});import{createContext as T}from"react";import I from"react-reconciler";import{NoEventPriority as v,DefaultEventPriority as x,DiscreteEventPriority as P}from"react-reconciler/constants.js";import{s as u}from"./index-COPEEDn3.js";import{LayoutNode as h}from"./LayoutNode-B0qeT8sl.js";import{applyStyles as g,resolveColor as C}from"./NAMED_COLORS-B9fJsYdg.js";import{a as k}from"./text-width-CI9G0a-z.js";var S=Object.defineProperty,n=c((e,t)=>S(e,"name",{value:t,configurable:!0}),"o");let p=null;function E(e){p=e}c(E,"setOnAfterCommit");n(E,"setOnAfterCommit");let m=v;function f(e){const t=C(e.fg===void 0?e.color===void 0?void 0:e.color:e.fg),o=C(e.bg===void 0?e.backgroundColor===void 0?void 0:e.backgroundColor:e.bg);let r;return e.styles===void 0?(r=0,e.bold&&(r|=1),(e.dim||e.dimColor)&&(r|=2),e.italic&&(r|=4),e.underline&&(r|=8),e.blink&&(r|=16),e.inverse&&(r|=32),e.hidden&&(r|=64),e.strikethrough&&(r|=128)):r=e.styles,{bg:o,fg:t,styles:r}}c(f,"m");n(f,"resolveNodeColors");const N={afterActiveInstanceBlur:n(()=>{},"afterActiveInstanceBlur"),appendChild(e,t){e.insertChild(t,e.children.length)},appendChildToContainer(e,t){e.insertChild(t,e.children.length)},appendInitialChild(e,t){e.insertChild(t,e.children.length)},beforeActiveInstanceBlur:n(()=>{},"beforeActiveInstanceBlur"),cancelCallback:u.unstable_cancelCallback,cancelTimeout:clearTimeout,clearContainer(e){},commitTextUpdate(e,t,o){e.text=o,e.yogaNode.markDirty()},commitUpdate(e,t,o,r,a){g(e.yogaNode,r);const{bg:i,fg:s,styles:d}=f(r);e.fg=s,e.bg=i,e.styles=d,e._style=r,e.transform=typeof r.transform=="function"?r.transform:void 0},createInstance(e,t,o,r,a){const i=new h,s={...t};s.flexDirection===void 0&&(s.flexDirection="row"),s.flexShrink===void 0&&(s.flexShrink=1),g(i.yogaNode,s);const{bg:d,fg:l,styles:y}=f(t);return i.fg=l,i.bg=d,i.styles=y,i._style=t,typeof t.transform=="function"&&(i.transform=t.transform),i},createTextInstance(e,t,o,r){const a=new h;return a.text=e,a.yogaNode.setWidth(k(e)),a.yogaNode.setHeight(1),a},detachDeletedInstance:n(e=>{e.destroy()},"detachDeletedInstance"),finalizeInitialChildren(e,t,o,r,a){return!1},getChildHostContext(e,t,o){return{isInsideText:t==="text"}},getCurrentEventPriority:n(()=>P,"getCurrentEventPriority"),getCurrentUpdatePriority:n(()=>m,"getCurrentUpdatePriority"),getInstanceFromNode:n(()=>null,"getInstanceFromNode"),getPublicInstance(e){return e},getRootHostContext(e){return{isInsideText:!1}},hideInstance(e){e._hidden=!0},hideTextInstance(e){e._hidden=!0},HostTransitionContext:T(null),insertBefore(e,t,o){t.parent&&t.remove();const r=e.children.indexOf(o);e.insertChild(t,r)},isPrimaryRenderer:!0,maySuspendCommit:n(()=>!0,"maySuspendCommit"),noTimeout:-1,NotPendingTransition:void 0,now:u.unstable_now,preloadInstance:n(()=>!0,"preloadInstance"),prepareForCommit(e){return null},preparePortalMount:n(()=>{},"preparePortalMount"),prepareScopeUpdate:n(()=>{},"prepareScopeUpdate"),prepareUpdate(e,t,o,r,a,i){const s=Object.keys(o).filter(l=>l!=="children"),d=Object.keys(r).filter(l=>l!=="children");if(s.length!==d.length)return!0;for(const l of d)if(o[l]!==r[l])return!0;return null},removeChild(e,t){t.remove()},removeChildFromContainer(e,t){t.remove()},requestPostPaintCallback:n(()=>{},"requestPostPaintCallback"),resetAfterCommit(e){typeof p=="function"&&p()},resolveEventTimeStamp:n(()=>-1.1,"resolveEventTimeStamp"),resolveEventType:n(()=>null,"resolveEventType"),resolveUpdatePriority(){return m!==v?m:x},scheduleCallback:u.unstable_scheduleCallback,scheduleMicrotask:queueMicrotask,scheduleTimeout:setTimeout,setCurrentUpdatePriority(e){m=e},shouldAttemptEagerTransition:n(()=>!1,"shouldAttemptEagerTransition"),shouldSetTextContent(e,t){return!1},shouldYield:u.unstable_shouldYield,startSuspendingCommit:n(()=>{},"startSuspendingCommit"),supportsHydration:!1,supportsMicrotasks:!0,supportsMutation:!0,supportsPersistence:!1,suspendInstance:n(()=>{},"suspendInstance"),trackSchedulerEvent:n(()=>{},"trackSchedulerEvent"),unhideInstance(e,t){e._hidden=!1},unhideTextInstance(e,t){e._hidden=!1},waitForCommitToBeReady:n(()=>null,"waitForCommitToBeReady"),warnsIfNotActing:!0},O=I(N);export{O as T,E as s};
@@ -0,0 +1 @@
1
+ var W=Object.defineProperty;var v=(r,s)=>W(r,"name",{value:s,configurable:!0});import l from"react";import{FocusProvider as C,useFocusManager as z}from"./FocusContext-Xy0cwJpO.js";import{TuiContext as T,useInput as B}from"./TuiContext-BoJvG3NN.js";import{LayoutNode as b}from"./LayoutNode-B0qeT8sl.js";import{T as f,s as P}from"./reconciler-ClRKkLS4.js";import{renderTreeToBuffer as F}from"./renderTreeToBuffer-LnGZkEUX.js";import{TuiApp as j}from"./TuiApp-CxBtziW8.js";import{InputParser as H}from"./InputParser-BAqciKJ6.js";import{terminalSize as q}from"./Renderer-DJXooAsp.js";import{createInlineLoop as G}from"./createInlineLoop-D0JaKX9A.js";var M=Object.defineProperty,e=v((r,s)=>M(r,"name",{value:s,configurable:!0}),"e");const R=e(r=>l.createElement("box",r,r.children),"_Box"),ee=e(r=>l.createElement("text",r,r.children),"_Text"),te=e(()=>l.createElement(R,{flexGrow:1}),"_Spacer"),L=e(({children:r})=>{const{disableFocus:s,enableFocus:t,focusNext:c,focusPrevious:i}=z();return B((h,a)=>{a.tab&&!a.shift&&c(),a.tab&&a.shift&&i(),a.escape&&(s(),t())}),l.createElement(l.Fragment,null,r)},"TabHandler");function A(r,s){const t=new j,c=new H(process.stdin),i=new b,{height:h,width:a}=t.getSize();i.yogaNode.setWidth(a),i.yogaNode.setHeight(h);const p=f.createContainer(i,0,null,!1,null,"",o=>console.error(o),null),d=e(o=>l.createElement(T.Provider,{value:{app:t,input:c,writeStderr:e(u=>t.writeStderr(u),"writeStderr"),writeStdout:e(u=>t.writeStdout(u),"writeStdout")}},l.createElement(C,null,l.createElement(L,null,o))),"wrap");f.updateContainer(d(r),p,null,()=>{});const x=e((o,u)=>i.calculateLayout(o,u),"calcLayout"),S=e((o,u,_)=>F(i,o,u,_),"renderBuf"),g=e(()=>t.paintNow(x,S),"paintNow");let E=!1;P(()=>{E=!0});const m=Math.round(1e3/(s?.maxFps??60)),y=setInterval(()=>{E&&(E=!1,g())},m);let N;const n=new Promise(o=>{N=o}),w=e(()=>{clearInterval(y),f.updateContainer(null,p,null,()=>{}),i.destroy(),t.stop(),c.stop(),process.off("SIGWINCH",I),N()},"cleanup");c.on("exit",()=>{w(),process.exit(0)}),t.on("quit",()=>{w(),process.exit(0)}),c.start(),t.start();const I=e(()=>{const o=process.stdout.columns||80,u=process.stdout.rows||24;t.resize(o,u),i.yogaNode.setWidth(o),i.yogaNode.setHeight(u),t.emit("resize"),g()},"onSigwinch");return process.on("SIGWINCH",I),g(),{app:t,input:c,rerender(o){f.updateContainer(d(o),p,null,()=>{})},unmount(){w()},waitUntilExit(){return n}}}v(A,"render");e(A,"render");function O(r,s){const t=q(),c=s?.rows??10,{cols:i}=t,h=Math.min(c,t.rows),a=new H(process.stdin),p=new b;p.yogaNode.setWidth(i),p.yogaNode.setHeight(h);const d=[],x=[],S={quit:e(()=>m.stop(),"quit"),writeStderr:e(n=>x.push(n),"writeStderr"),writeStdout:e(n=>d.push(n),"writeStdout")},g=f.createContainer(p,0,null,!1,null,"",n=>console.error(n),null),E=e(n=>l.createElement(T.Provider,{value:{app:S,input:a,writeStderr:S.writeStderr,writeStdout:S.writeStdout}},l.createElement(C,null,l.createElement(L,null,n))),"wrap");f.updateContainer(E(r),g,null,()=>{}),P(()=>{});const m=G((n,w,I)=>{p.calculateLayout(w,I),F(p,n,w,I)},{...s,fps:s?.maxFps??s?.fps??60,rows:h});a.on("exit",()=>m.stop());let y;const N=new Promise(n=>{y=n});return process.on("exit",()=>{d.length>0&&process.stdout.write(d.join("")),x.length>0&&process.stderr.write(x.join("")),y()}),m.start(),a.start(),{unmount(){m.stop()},waitUntilExit(){return N}}}v(O,"renderInline");e(O,"renderInline");export{R as _Box,te as _Spacer,ee as _Text,A as render,O as renderInline};