@visulima/tui 0.0.1 → 1.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +331 -0
- package/LICENSE.md +497 -0
- package/README.md +173 -29
- package/dist/core/index.d.ts +58 -0
- package/dist/core/index.js +1 -0
- package/dist/ink/index.d.ts +6574 -0
- package/dist/ink/index.js +1 -0
- package/dist/packem_chunks/devtools.js +4 -0
- package/dist/packem_shared/Accordion-BXsqchV-.js +1 -0
- package/dist/packem_shared/Alert-BhYVMHtR.js +1 -0
- package/dist/packem_shared/AnimatePresence-Eu7Z8KHc.js +1 -0
- package/dist/packem_shared/ApprovalPrompt-BSn0FT1g.js +1 -0
- package/dist/packem_shared/AreaChart-Chy-frI7.js +1 -0
- package/dist/packem_shared/Badge-B8WPyRsK.js +1 -0
- package/dist/packem_shared/BarChart-rpZtlMcF.js +1 -0
- package/dist/packem_shared/BigText-CRpwUzrt.js +1 -0
- package/dist/packem_shared/BlinkDot-BvnRuWP8.js +1 -0
- package/dist/packem_shared/Box-BwqSvWuq.js +1 -0
- package/dist/packem_shared/Breadcrumb-D0hClbRV.js +1 -0
- package/dist/packem_shared/Button-B89Yvbc6.js +1 -0
- package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +1 -0
- package/dist/packem_shared/Calendar-Dmflvm2S.js +1 -0
- package/dist/packem_shared/Canvas-CKg6WV47.js +1 -0
- package/dist/packem_shared/Card-B_9fXdtU.js +1 -0
- package/dist/packem_shared/Cell-BrXn3jxY.js +1 -0
- package/dist/packem_shared/Checkbox-BN71eCWU.js +1 -0
- package/dist/packem_shared/Code-HhevcyiH.js +2 -0
- package/dist/packem_shared/Collapsible-u6uf_FdV.js +1 -0
- package/dist/packem_shared/CommandBlock-B-nslpCv.js +4 -0
- package/dist/packem_shared/CommandPalette-CEFdaURo.js +1 -0
- package/dist/packem_shared/ConfirmDialog-5Jje_Xpu.js +1 -0
- package/dist/packem_shared/ConfirmInput-D44Mb9oo.js +1 -0
- package/dist/packem_shared/ConsoleOverlay-CM3APfgP.js +1 -0
- package/dist/packem_shared/ContentSwitcher-Dm5BkrCt.js +1 -0
- package/dist/packem_shared/ControlledScrollView-DI8KZOQB.js +1 -0
- package/dist/packem_shared/Cursor-BoLFIMol.js +1 -0
- package/dist/packem_shared/DatePicker-CnSrFFAE.js +1 -0
- package/dist/packem_shared/DefinitionList-v8RDuF_R.js +1 -0
- package/dist/packem_shared/DevTools-O8EbCfHa.js +1 -0
- package/dist/packem_shared/Dialog-CTaL8pn0.js +1 -0
- package/dist/packem_shared/DiffView-BUIFqUB0.js +1 -0
- package/dist/packem_shared/Divider-C47bKmqu.js +1 -0
- package/dist/packem_shared/FilePicker-CUo7R5Qb.js +1 -0
- package/dist/packem_shared/FocusContext-Xy0cwJpO.js +1 -0
- package/dist/packem_shared/FormField-af3aUpRL.js +1 -0
- package/dist/packem_shared/Fullscreen-CuJ8y0s0.js +1 -0
- package/dist/packem_shared/Gauge-Dz-usH__.js +1 -0
- package/dist/packem_shared/Gradient-DYNc0GZA.js +1 -0
- package/dist/packem_shared/Heading-mwEYza3Y.js +1 -0
- package/dist/packem_shared/Heatmap-ChL97U1-.js +1 -0
- package/dist/packem_shared/Help-Zcelyw_U.js +1 -0
- package/dist/packem_shared/Histogram-FIf2F83d.js +1 -0
- package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +1 -0
- package/dist/packem_shared/InputParser-rZKjY_7Y.js +2 -0
- package/dist/packem_shared/KEY-Bk8B-3h_.js +1 -0
- package/dist/packem_shared/Kbd-DpkPp4jB.js +1 -0
- package/dist/packem_shared/LayoutNode-rxblE317.js +1 -0
- package/dist/packem_shared/LineChart-BXE_girm.js +1 -0
- package/dist/packem_shared/Link-i2o2EG4-.js +1 -0
- package/dist/packem_shared/LoadingIndicator-TC1Fjwyt.js +1 -0
- package/dist/packem_shared/Markdown-R1XqK63D.js +1 -0
- package/dist/packem_shared/MaskedInput-J01phOZs.js +1 -0
- package/dist/packem_shared/Menu-CfrH4ymk.js +1 -0
- package/dist/packem_shared/MessageBubble-BmBBU2Rm.js +1 -0
- package/dist/packem_shared/ModelBadge-D3wrXncu.js +1 -0
- package/dist/packem_shared/MouseProvider-pjza-lpc.js +1 -0
- package/dist/packem_shared/MultiSelect-Dqmn-bVo.js +1 -0
- package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +1 -0
- package/dist/packem_shared/Newline-BSG4iUqp.js +2 -0
- package/dist/packem_shared/OperationTree-DksxjMIV.js +1 -0
- package/dist/packem_shared/OptionList-CNx7r9yN.js +1 -0
- package/dist/packem_shared/OrderedList-BeDy035w.js +1 -0
- package/dist/packem_shared/Paginator-B56s6bhS.js +1 -0
- package/dist/packem_shared/Paragraph-BqJlH0R-.js +1 -0
- package/dist/packem_shared/Placeholder-GMpHRGC8.js +1 -0
- package/dist/packem_shared/ProgressBar-Bj3fmORR.js +1 -0
- package/dist/packem_shared/RadioGroup-Br8BeEwS.js +1 -0
- package/dist/packem_shared/Renderer-DJXooAsp.js +1 -0
- package/dist/packem_shared/ResizeObserverEntry-Dq0dk8Kq.js +1 -0
- package/dist/packem_shared/ScatterPlot-OhfYco5l.js +1 -0
- package/dist/packem_shared/ScrollBar-Da5Y3z7N.js +1 -0
- package/dist/packem_shared/ScrollBarBox-Dz6F-Eat.js +1 -0
- package/dist/packem_shared/ScrollList-DiVGyEjv.js +1 -0
- package/dist/packem_shared/ScrollView-BojONotI.js +1 -0
- package/dist/packem_shared/SearchInput-BoPTRbhV.js +1 -0
- package/dist/packem_shared/SelectInput-CAJ7SCBq.js +1 -0
- package/dist/packem_shared/SelectInputIndicator-N1n8ULHs.js +1 -0
- package/dist/packem_shared/SelectInputItem-BEkbmobs.js +1 -0
- package/dist/packem_shared/ShimmerText-CuGQ2NDC.js +1 -0
- package/dist/packem_shared/Slider-Cg_tJpKa.js +1 -0
- package/dist/packem_shared/Spacer-eT3HOrXk.js +1 -0
- package/dist/packem_shared/Sparkline-T6_FPVET.js +1 -0
- package/dist/packem_shared/Spinner-B0-A50pu.js +1 -0
- package/dist/packem_shared/Static-DLynr5pn.js +1 -0
- package/dist/packem_shared/Static-jzLPaHJF.js +1 -0
- package/dist/packem_shared/StaticRender-BgD61E7x.js +1 -0
- package/dist/packem_shared/StatusLine-Ch4jjef1.js +1 -0
- package/dist/packem_shared/StatusMessage-B1qfKeMM.js +1 -0
- package/dist/packem_shared/Stepper-CNPAqxiU.js +1 -0
- package/dist/packem_shared/Stopwatch-CAx2EWwq.js +1 -0
- package/dist/packem_shared/StreamingText-BYOKSB2T.js +1 -0
- package/dist/packem_shared/Switch-DzSpKYu7.js +1 -0
- package/dist/packem_shared/Tab-BcXzSUdj.js +1 -0
- package/dist/packem_shared/Table-DJp1TLrR.js +1 -0
- package/dist/packem_shared/Tabs-D68z0SOt.js +1 -0
- package/dist/packem_shared/Tag-BvLHnYRn.js +1 -0
- package/dist/packem_shared/Text-mTAve9R2.js +1 -0
- package/dist/packem_shared/TextInput-C_gYQlnF.js +1 -0
- package/dist/packem_shared/Textarea-C2ET_oMb.js +2 -0
- package/dist/packem_shared/Timer-CI3aQX65.js +1 -0
- package/dist/packem_shared/Toast-Drvc8XfG.js +1 -0
- package/dist/packem_shared/Tooltip-C5UnQlLd.js +1 -0
- package/dist/packem_shared/Transform-fYmcdqRT.js +1 -0
- package/dist/packem_shared/Transition-CJDBKYUB.js +1 -0
- package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +1 -0
- package/dist/packem_shared/TreeView-DjhacGJ5.js +1 -0
- package/dist/packem_shared/TuiApp-DrjI_i-R.js +1 -0
- package/dist/packem_shared/TuiContext-BoJvG3NN.js +3 -0
- package/dist/packem_shared/UnorderedList-BnfqexZs.js +1 -0
- package/dist/packem_shared/accessibility-context-DDyHTwmA.js +1 -0
- package/dist/packem_shared/animation-context-DW3p-vpk.js +1 -0
- package/dist/packem_shared/ansi-parser-B6uXaq65.js +1 -0
- package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +1 -0
- package/dist/packem_shared/app-context-BVpKlG1z.js +1 -0
- package/dist/packem_shared/background-context-rjOaWFki.js +1 -0
- package/dist/packem_shared/boxes-DyY_LXCi.js +1 -0
- package/dist/packem_shared/braille-BBjIoaN0.js +1 -0
- package/dist/packem_shared/colorize-DbTZMrJO.js +1 -0
- package/dist/packem_shared/comparePoints-C85EsmNz.js +1 -0
- package/dist/packem_shared/controlled-scroll-view-CmrAEvJk.js +1 -0
- package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +2 -0
- package/dist/packem_shared/createLinkedScrollGroup-BMTJ7rAj.js +1 -0
- package/dist/packem_shared/createMemoryStorage-QVZNXbWz.js +2 -0
- package/dist/packem_shared/createScreen-CrLrxA6t.js +3 -0
- package/dist/packem_shared/cursor-context-CFviBqPX.js +1 -0
- package/dist/packem_shared/dom-4y__5fWB.js +1 -0
- package/dist/packem_shared/focus-context-CsT69klR.js +1 -0
- package/dist/packem_shared/format-time-C7Q-hQZq.js +1 -0
- package/dist/packem_shared/getPathToRoot-B2tKmx3i.js +1 -0
- package/dist/packem_shared/getScrollHeight-BTEY8ewu.js +1 -0
- package/dist/packem_shared/input-utils-fAxzSlNh.js +1 -0
- package/dist/packem_shared/input.d-Bfq7oc06.d.ts +90 -0
- package/dist/packem_shared/isIntersecting-B3KbKTmu.js +1 -0
- package/dist/packem_shared/isOsc52Supported-DKK7Uee6.js +1 -0
- package/dist/packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js +1 -0
- package/dist/packem_shared/kittyFlags-C3rZLbcK.js +1 -0
- package/dist/packem_shared/line-chart-DrM8PwnI.js +1 -0
- package/dist/packem_shared/measure-element-DSp7YDus.js +2 -0
- package/dist/packem_shared/measure-text-DDjHT1jD.js +3 -0
- package/dist/packem_shared/measureElement-DA8WqFP_.js +1 -0
- package/dist/packem_shared/mouse-context-DaARgUu1.js +1 -0
- package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +1 -0
- package/dist/packem_shared/processLayout-DXDfFb_d.js +1 -0
- package/dist/packem_shared/reconciler-BuOP-TZ6.js +1 -0
- package/dist/packem_shared/reconciler-DSYCrIZs.js +1 -0
- package/dist/packem_shared/render-DDqtMAFN.js +1 -0
- package/dist/packem_shared/render-_r0K9K11.js +28 -0
- package/dist/packem_shared/render.d-BR3gA-N8.d.ts +1257 -0
- package/dist/packem_shared/renderToString-DeqOWRP8.js +4 -0
- package/dist/packem_shared/renderToString-IYYPyASm.js +2 -0
- package/dist/packem_shared/renderTreeToBuffer-DPkoCgP2.js +2 -0
- package/dist/packem_shared/renderer-D2p6av2X.js +17 -0
- package/dist/packem_shared/setEnableStyledLineCache-D2gZbwFM.js +1 -0
- package/dist/packem_shared/squashTextNodesWithMap-Cpqmc45i.js +1 -0
- package/dist/packem_shared/stderr-context-BzEaUICS.js +1 -0
- package/dist/packem_shared/stdin-context-BTaaFagk.js +1 -0
- package/dist/packem_shared/stdout-context-BnblEPez.js +1 -0
- package/dist/packem_shared/text-width-CZ9vPvM0.js +2 -0
- package/dist/packem_shared/token-to-elements-BYxT6J_Q.js +1 -0
- package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +1 -0
- package/dist/packem_shared/useAnimation-B9we6ZzL.js +1 -0
- package/dist/packem_shared/useApp-B6fvM42d.js +1 -0
- package/dist/packem_shared/useBoxMetrics-D5pkIr6P.js +1 -0
- package/dist/packem_shared/useClipboard-CBxy0hT8.js +1 -0
- package/dist/packem_shared/useColorBlindness-BvWcu2Bb.js +1 -0
- package/dist/packem_shared/useConsoleCapture-BxiG8iLJ.js +1 -0
- package/dist/packem_shared/useCursor-CPu8T5Db.js +1 -0
- package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +1 -0
- package/dist/packem_shared/useFocus-DSmziO_x.js +1 -0
- package/dist/packem_shared/useFocusManager-Uapn3LQo.js +1 -0
- package/dist/packem_shared/useForm-CzV-Oext.js +1 -0
- package/dist/packem_shared/useHotkey-D0dGey14.js +1 -0
- package/dist/packem_shared/useInput-D1_jG26Z.js +2 -0
- package/dist/packem_shared/useInterval-AobjZT3u.js +1 -0
- package/dist/packem_shared/useIsScreenReaderEnabled-DjWHh-II.js +1 -0
- package/dist/packem_shared/useKeyBindings-zabkEJQs.js +1 -0
- package/dist/packem_shared/useKeyChord-CICQIxXj.js +1 -0
- package/dist/packem_shared/useMouseAction-2dRfU1vE.js +1 -0
- package/dist/packem_shared/useMouseContext-C746G7kY.js +1 -0
- package/dist/packem_shared/useMousePosition-BTWfV4JK.js +1 -0
- package/dist/packem_shared/useOnMouseClick-nY8xLZmt.js +1 -0
- package/dist/packem_shared/useOnMouseHover-D3DczIol.js +1 -0
- package/dist/packem_shared/useOnMouseState-cRK8QvzD.js +1 -0
- package/dist/packem_shared/usePaste-CKKB9H-Z.js +1 -0
- package/dist/packem_shared/useScrollAcceleration-NrY1oVMs.js +1 -0
- package/dist/packem_shared/useScrollInput-Caghtn-Q.js +1 -0
- package/dist/packem_shared/useStderr-BDZb6InG.js +1 -0
- package/dist/packem_shared/useStdin-DKa4h35k.js +1 -0
- package/dist/packem_shared/useStdout-B-2lX4C5.js +1 -0
- package/dist/packem_shared/useStopwatch-DffK7iMh.js +1 -0
- package/dist/packem_shared/useTerminalPalette-Cv7tSduR.js +1 -0
- package/dist/packem_shared/useTextBuffer-DekkGLxI.js +4 -0
- package/dist/packem_shared/useTextSelection-CGT0GLDR.js +1 -0
- package/dist/packem_shared/useTimeout-7LEFYTnG.js +1 -0
- package/dist/packem_shared/useTimer-DyoqSyGi.js +1 -0
- package/dist/packem_shared/useTreeView-8UlTK6sW.js +1 -0
- package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +1 -0
- package/dist/packem_shared/useWindowSize-yDZsXF8z.js +1 -0
- package/dist/packem_shared/utils-THUhYKG2.js +1 -0
- package/dist/packem_shared/variant-config-BJqpNo7H.js +1 -0
- package/dist/packem_shared/waitFor-Dj5zfL5s.js +4 -0
- package/dist/packem_shared/wrapOrTruncateStyledLine-BZ00SM8i.js +3 -0
- package/dist/react/index.d.ts +519 -0
- package/dist/react/index.js +1 -0
- package/dist/testing/index.d.ts +283 -0
- package/dist/testing/index.js +1 -0
- package/index.js +737 -0
- package/package.json +113 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{clearOsc52 as t,isOsc52Supported as o,writeOsc52 as a}from"../packem_shared/isOsc52Supported-DKK7Uee6.js";import{COLOR_BLINDNESS_COMPENSATION as s,COLOR_BLINDNESS_SIMULATION as l,IDENTITY_MATRIX as u,applyColorMatrix as p,hexToRgb as d,rgbToHex as m,transformHexColor as x}from"../packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js";import{default as n}from"../packem_shared/Accordion-BXsqchV-.js";import{default as S}from"../packem_shared/Alert-BhYVMHtR.js";import{default as T}from"../packem_shared/AnimatePresence-Eu7Z8KHc.js";import{default as h}from"../packem_shared/ApprovalPrompt-BSn0FT1g.js";import{default as B}from"../packem_shared/AreaChart-Chy-frI7.js";import{default as b}from"../packem_shared/Badge-B8WPyRsK.js";import{default as P}from"../packem_shared/BarChart-rpZtlMcF.js";import{default as y}from"../packem_shared/BigText-CRpwUzrt.js";import{default as w}from"../packem_shared/BlinkDot-BvnRuWP8.js";import{default as E}from"../packem_shared/Box-BwqSvWuq.js";import{default as F}from"../packem_shared/Breadcrumb-D0hClbRV.js";import{default as N}from"../packem_shared/Button-B89Yvbc6.js";import{default as D}from"../packem_shared/Calendar-Dmflvm2S.js";import{default as W}from"../packem_shared/Canvas-CKg6WV47.js";import{default as z}from"../packem_shared/Card-B_9fXdtU.js";import{default as K}from"../packem_shared/Checkbox-BN71eCWU.js";import{default as U}from"../packem_shared/Code-HhevcyiH.js";import{default as Q}from"../packem_shared/Collapsible-u6uf_FdV.js";import{default as Y}from"../packem_shared/CommandBlock-B-nslpCv.js";import{default as Z}from"../packem_shared/CommandPalette-CEFdaURo.js";import{default as ee}from"../packem_shared/ConfirmDialog-5Jje_Xpu.js";import{default as te}from"../packem_shared/ConfirmInput-D44Mb9oo.js";import{default as ae}from"../packem_shared/ConsoleOverlay-CM3APfgP.js";import{default as se}from"../packem_shared/ContentSwitcher-Dm5BkrCt.js";import{default as ue}from"../packem_shared/Cursor-BoLFIMol.js";import{default as de}from"../packem_shared/DatePicker-CnSrFFAE.js";import{default as xe}from"../packem_shared/DefinitionList-v8RDuF_R.js";import{default as ne}from"../packem_shared/Dialog-CTaL8pn0.js";import{default as Se}from"../packem_shared/DiffView-BUIFqUB0.js";import{default as Te}from"../packem_shared/Divider-C47bKmqu.js";import{default as he}from"../packem_shared/FilePicker-CUo7R5Qb.js";import{default as Be,FormField as Me}from"../packem_shared/FormField-af3aUpRL.js";import{default as Le}from"../packem_shared/Gauge-Dz-usH__.js";import{default as Oe}from"../packem_shared/Gradient-DYNc0GZA.js";import{default as ke}from"../packem_shared/Heading-mwEYza3Y.js";import{default as Ae}from"../packem_shared/Heatmap-ChL97U1-.js";import{default as Re}from"../packem_shared/Help-Zcelyw_U.js";import{default as He}from"../packem_shared/Histogram-FIf2F83d.js";import{default as ve}from"../packem_shared/Kbd-DpkPp4jB.js";import{E as Ve}from"../packem_shared/line-chart-DrM8PwnI.js";import{default as _e}from"../packem_shared/Link-i2o2EG4-.js";import{default as Ge}from"../packem_shared/LoadingIndicator-TC1Fjwyt.js";import{default as qe}from"../packem_shared/Markdown-R1XqK63D.js";import{default as je}from"../packem_shared/MaskedInput-J01phOZs.js";import{default as Xe}from"../packem_shared/Menu-CfrH4ymk.js";import{default as Je}from"../packem_shared/MessageBubble-BmBBU2Rm.js";import{default as $e}from"../packem_shared/ModelBadge-D3wrXncu.js";import{default as rr}from"../packem_shared/MultiSelect-Dqmn-bVo.js";import{default as or}from"../packem_shared/Newline-BSG4iUqp.js";import{default as fr}from"../packem_shared/OperationTree-DksxjMIV.js";import{default as lr}from"../packem_shared/OptionList-CNx7r9yN.js";import{default as pr}from"../packem_shared/OrderedList-BeDy035w.js";import{default as mr}from"../packem_shared/Paginator-B56s6bhS.js";import{default as ir}from"../packem_shared/Paragraph-BqJlH0R-.js";import{default as cr}from"../packem_shared/Placeholder-GMpHRGC8.js";import{default as gr}from"../packem_shared/ProgressBar-Bj3fmORR.js";import{default as Cr}from"../packem_shared/RadioGroup-Br8BeEwS.js";import{default as Ir}from"../packem_shared/ScatterPlot-OhfYco5l.js";import{C as Mr}from"../packem_shared/controlled-scroll-view-CmrAEvJk.js";import{ScrollBar as Lr}from"../packem_shared/ScrollBar-Da5Y3z7N.js";import{ScrollBarBox as Or}from"../packem_shared/ScrollBarBox-Dz6F-Eat.js";import{ScrollList as kr}from"../packem_shared/ScrollList-DiVGyEjv.js";import{ScrollView as Ar}from"../packem_shared/ScrollView-BojONotI.js";import{default as Rr}from"../packem_shared/SearchInput-BoPTRbhV.js";import{default as Hr}from"../packem_shared/SelectInput-CAJ7SCBq.js";import{default as vr}from"../packem_shared/SelectInputIndicator-N1n8ULHs.js";import{default as Vr}from"../packem_shared/SelectInputItem-BEkbmobs.js";import{default as _r}from"../packem_shared/ShimmerText-CuGQ2NDC.js";import{default as Gr}from"../packem_shared/Slider-Cg_tJpKa.js";import{default as qr}from"../packem_shared/Spacer-eT3HOrXk.js";import{default as jr}from"../packem_shared/Sparkline-T6_FPVET.js";import{default as Xr}from"../packem_shared/Spinner-B0-A50pu.js";import{default as Jr}from"../packem_shared/Static-jzLPaHJF.js";import{default as $r}from"../packem_shared/StaticRender-BgD61E7x.js";import{default as rt}from"../packem_shared/StatusLine-Ch4jjef1.js";import{default as ot}from"../packem_shared/StatusMessage-B1qfKeMM.js";import{default as ft}from"../packem_shared/Stepper-CNPAqxiU.js";import{default as lt}from"../packem_shared/Stopwatch-CAx2EWwq.js";import{default as pt}from"../packem_shared/StreamingText-BYOKSB2T.js";import{default as mt}from"../packem_shared/Switch-DzSpKYu7.js";import{default as it}from"../packem_shared/Tab-BcXzSUdj.js";import{default as ct}from"../packem_shared/Table-DJp1TLrR.js";import{default as gt}from"../packem_shared/Tabs-D68z0SOt.js";import{default as Ct}from"../packem_shared/Tag-BvLHnYRn.js";import{default as It}from"../packem_shared/Text-mTAve9R2.js";import{default as Mt}from"../packem_shared/TextInput-C_gYQlnF.js";import{default as Lt}from"../packem_shared/Textarea-C2ET_oMb.js";import{default as Ot}from"../packem_shared/Timer-CI3aQX65.js";import{default as kt}from"../packem_shared/Toast-Drvc8XfG.js";import{default as At}from"../packem_shared/Tooltip-C5UnQlLd.js";import{default as Rt}from"../packem_shared/Transform-fYmcdqRT.js";import{default as Ht}from"../packem_shared/Transition-CJDBKYUB.js";import{theme as vt}from"../packem_shared/treeViewTheme-1RIZyB4M.js";import{TreeNodeMap as Vt}from"../packem_shared/TreeNodeMap-CspqSCpb.js";import{TreeView as _t}from"../packem_shared/TreeView-DjhacGJ5.js";import{useTreeView as Gt}from"../packem_shared/useTreeView-8UlTK6sW.js";import{useTreeViewState as qt}from"../packem_shared/useTreeViewState-CRPCUWrb.js";import{default as jt}from"../packem_shared/UnorderedList-BnfqexZs.js";import{g as Xt,i as Yt}from"../packem_shared/dom-4y__5fWB.js";import{default as Zt}from"../packem_shared/useAnimation-B9we6ZzL.js";import{default as eo}from"../packem_shared/useApp-B6fvM42d.js";import{default as to}from"../packem_shared/useBoxMetrics-D5pkIr6P.js";import{default as ao}from"../packem_shared/useClipboard-CBxy0hT8.js";import{default as so}from"../packem_shared/useColorBlindness-BvWcu2Bb.js";import{default as uo}from"../packem_shared/useConsoleCapture-BxiG8iLJ.js";import{default as mo}from"../packem_shared/useCursor-CPu8T5Db.js";import{default as io}from"../packem_shared/useFocus-DSmziO_x.js";import{default as co}from"../packem_shared/useFocusManager-Uapn3LQo.js";import{default as go}from"../packem_shared/useForm-CzV-Oext.js";import{default as Co}from"../packem_shared/useHotkey-D0dGey14.js";import{default as Io}from"../packem_shared/useInput-D1_jG26Z.js";import{default as Mo}from"../packem_shared/useInterval-AobjZT3u.js";import{default as Lo}from"../packem_shared/useIsScreenReaderEnabled-DjWHh-II.js";import{default as Oo}from"../packem_shared/useKeyBindings-zabkEJQs.js";import{default as ko}from"../packem_shared/useKeyChord-CICQIxXj.js";import{default as Ao}from"../packem_shared/createLinkedScrollGroup-BMTJ7rAj.js";import{default as Ro}from"../packem_shared/usePaste-CKKB9H-Z.js";import{createFileStorage as Ho,createMemoryStorage as No,default as vo}from"../packem_shared/createMemoryStorage-QVZNXbWz.js";import{default as Vo}from"../packem_shared/useScrollAcceleration-NrY1oVMs.js";import{default as _o}from"../packem_shared/useScrollInput-Caghtn-Q.js";import{default as Go}from"../packem_shared/useStderr-BDZb6InG.js";import{default as qo}from"../packem_shared/useStdin-DKa4h35k.js";import{default as jo}from"../packem_shared/useStdout-B-2lX4C5.js";import{default as Xo}from"../packem_shared/useStopwatch-DffK7iMh.js";import{default as Jo}from"../packem_shared/useTerminalPalette-Cv7tSduR.js";import{default as $o}from"../packem_shared/useTextBuffer-DekkGLxI.js";import{default as ra}from"../packem_shared/useTextSelection-CGT0GLDR.js";import{default as oa}from"../packem_shared/useTimeout-7LEFYTnG.js";import{default as fa}from"../packem_shared/useTimer-DyoqSyGi.js";import{default as la}from"../packem_shared/useWindowSize-yDZsXF8z.js";import{IMECompositionBuffer as pa,isIMEInput as da}from"../packem_shared/IMECompositionBuffer-C89PhiOu.js";import{kittyFlags as xa,kittyModifiers as ia}from"../packem_shared/kittyFlags-C3rZLbcK.js";import{c as ca,a as Sa,b as ga,g as Ta,d as Ca,e as ha,f as Ia,h as Ba,i as Ma,j as ba,k as La,l as Pa,P as Oa,p as ya}from"../packem_shared/measure-element-DSp7YDus.js";import{c as wa,a as Aa,i as Ea,s as Ra,b as Fa,t as Ha}from"../packem_shared/measure-text-DDjHT1jD.js";import{default as va}from"../packem_shared/render-_r0K9K11.js";import{default as Va}from"../packem_shared/renderToString-DeqOWRP8.js";import{default as _a,ResizeObserverEntry as za}from"../packem_shared/ResizeObserverEntry-Dq0dk8Kq.js";import{calculateScroll as Ka,getScrollHeight as qa,getScrollLeft as Ua,getScrollTop as ja,getScrollWidth as Qa}from"../packem_shared/getScrollHeight-BTEY8ewu.js";import{Range as Ya,Selection as Ja,applySelectionToStyledLine as Za,comparePoints as $a}from"../packem_shared/comparePoints-C85EsmNz.js";import{squashTextNodesWithMap as rf}from"../packem_shared/squashTextNodesWithMap-Cpqmc45i.js";import{isTerminalPaletteQuerySupported as of,queryTerminalPalette as af}from"../packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js";import{wrapOrTruncateStyledLine as sf}from"../packem_shared/wrapOrTruncateStyledLine-BZ00SM8i.js";import{default as uf}from"../packem_shared/Fullscreen-CuJ8y0s0.js";import{default as df}from"../packem_shared/MouseProvider-pjza-lpc.js";import{default as xf}from"../packem_shared/isIntersecting-B3KbKTmu.js";import{default as cf}from"../packem_shared/useMouseAction-2dRfU1vE.js";import{default as gf}from"../packem_shared/useMouseContext-C746G7kY.js";import{default as Cf}from"../packem_shared/useMousePosition-BTWfV4JK.js";import{default as If}from"../packem_shared/useOnMouseHover-D3DczIol.js";import{default as Mf}from"../packem_shared/useOnMouseState-cRK8QvzD.js";import{a as Lf}from"../packem_shared/ansi-parser-B6uXaq65.js";import{useElementDimensions as Of,useElementPosition as yf}from"../packem_shared/useElementDimensions-qJ_WXFZ9.js";import{useOnMouseClick as wf}from"../packem_shared/useOnMouseClick-nY8xLZmt.js";export{n as Accordion,S as Alert,T as AnimatePresence,h as ApprovalPrompt,B as AreaChart,b as Badge,P as BarChart,y as BigText,w as BlinkDot,E as Box,F as Breadcrumb,N as Button,s as COLOR_BLINDNESS_COMPENSATION,l as COLOR_BLINDNESS_SIMULATION,D as Calendar,W as Canvas,z as Card,K as Checkbox,U as Code,Q as Collapsible,Y as CommandBlock,Z as CommandPalette,ee as ConfirmDialog,te as ConfirmInput,ae as ConsoleOverlay,se as ContentSwitcher,Mr as ControlledScrollView,ue as Cursor,de as DatePicker,xe as DefinitionList,ne as Dialog,Se as DiffView,Te as Divider,he as FilePicker,Be as Form,Me as FormField,uf as Fullscreen,Le as Gauge,Oe as Gradient,ke as Heading,Ae as Heatmap,Re as Help,He as Histogram,u as IDENTITY_MATRIX,pa as IMECompositionBuffer,ve as Kbd,Ve as LineChart,_e as Link,Ge as LoadingIndicator,qe as Markdown,je as MaskedInput,Xe as Menu,Je as MessageBubble,$e as ModelBadge,df as MouseProvider,rr as MultiSelect,or as Newline,fr as OperationTree,lr as OptionList,pr as OrderedList,mr as Paginator,ir as Paragraph,cr as Placeholder,gr as ProgressBar,Cr as RadioGroup,Ya as Range,_a as ResizeObserver,za as ResizeObserverEntry,Ir as ScatterPlot,Lr as ScrollBar,Or as ScrollBarBox,kr as ScrollList,Ar as ScrollView,Rr as SearchInput,Hr as SelectInput,vr as SelectInputIndicator,Vr as SelectInputItem,Ja as Selection,_r as ShimmerText,Gr as Slider,qr as Spacer,jr as Sparkline,Xr as Spinner,Jr as Static,$r as StaticRender,rt as StatusLine,ot as StatusMessage,ft as Stepper,lt as Stopwatch,pt as StreamingText,mt as Switch,it as Tab,ct as Table,gt as Tabs,Ct as Tag,It as Text,Mt as TextInput,Lt as Textarea,Ot as Timer,kt as Toast,At as Tooltip,Rt as Transform,Ht as Transition,Vt as TreeNodeMap,_t as TreeView,jt as UnorderedList,p as applyColorMatrix,Za as applySelectionToStyledLine,Ka as calculateScroll,ca as calculateScrollbarLayout,Sa as calculateScrollbarThumb,t as clearOsc52,wa as clearStringWidthCache,Aa as clearStyledLineCache,ga as collectSortedFragments,$a as comparePoints,Ho as createFileStorage,Ao as createLinkedScrollGroup,No as createMemoryStorage,Ta as getAddedScrollHeight,Ca as getBoundingBox,ha as getHorizontalScrollbarBoundingBox,Ia as getInnerHeight,Ba as getInnerWidth,Xt as getPathToRoot,Ma as getRelativeLeft,ba as getRelativeTop,qa as getScrollHeight,Ua as getScrollLeft,ja as getScrollTop,Qa as getScrollWidth,La as getText,Pa as getVerticalScrollbarBoundingBox,d as hexToRgb,Ea as inkCharacterWidth,da as isIMEInput,xf as isIntersecting,Yt as isNodeSelectable,o as isOsc52Supported,of as isTerminalPaletteQuerySupported,xa as kittyFlags,ia as kittyModifiers,Oa as measureElement,Lf as parseSgrMouse,ya as processLayout,af as queryTerminalPalette,va as render,Va as renderToString,m as rgbToHex,Ra as setEnableStyledLineCache,Fa as setStringWidthFunction,rf as squashTextNodesWithMap,Ha as toStyledLine,x as transformHexColor,vt as treeViewTheme,Zt as useAnimation,eo as useApp,to as useBoxMetrics,ao as useClipboard,so as useColorBlindness,uo as useConsoleCapture,mo as useCursor,Of as useElementDimensions,yf as useElementPosition,io as useFocus,co as useFocusManager,go as useForm,Co as useHotkey,Io as useInput,Mo as useInterval,Lo as useIsScreenReaderEnabled,Oo as useKeyBindings,ko as useKeyChord,cf as useMouseAction,gf as useMouseContext,Cf as useMousePosition,wf as useOnMouseClick,If as useOnMouseHover,Mf as useOnMouseState,Ro as usePaste,vo as usePersistentState,Vo as useScrollAcceleration,_o as useScrollInput,Go as useStderr,qo as useStdin,jo as useStdout,Xo as useStopwatch,Jo as useTerminalPalette,$o as useTextBuffer,ra as useTextSelection,oa as useTimeout,fa as useTimer,Gt as useTreeView,qt as useTreeViewState,la as useWindowSize,sf as wrapOrTruncateStyledLine,a as writeOsc52};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var a=Object.defineProperty;var r=(t,e)=>a(t,"name",{value:e,configurable:!0});import n from"react-devtools-core";import i from"ws";var s=Object.defineProperty,l=r((t,e)=>s(t,"name",{value:e,configurable:!0}),"n");const c=l(async()=>new Promise(t=>{const e=new i("ws://localhost:8097"),o=setTimeout(()=>{e.terminate(),t(!1)},2e3);o.unref(),e.on("open",()=>{clearTimeout(o),e.terminate(),t(!0)}),e.on("error",()=>{clearTimeout(o),e.terminate(),t(!1)})}),"isDevToolsReachable");await c()?(n.initialize(),n.connectToDevTools()):console.warn(`DEV is set to true, but the React DevTools server is not running. Start it with:
|
|
2
|
+
|
|
3
|
+
$ npx react-devtools
|
|
4
|
+
`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var F=Object.defineProperty;var m=(c,n)=>F(c,"name",{value:n,configurable:!0});import{jsx as p,jsxs as v}from"react/jsx-runtime";import{useState as g,useRef as k,useCallback as A}from"react";import L from"./useFocus-DSmziO_x.js";import y from"./useInput-D1_jG26Z.js";import f from"./Box-BwqSvWuq.js";import w from"./Text-mTAve9R2.js";var z=Object.defineProperty,B=m((c,n)=>z(c,"name",{value:n,configurable:!0}),"A");function E({accentColor:c="blue",allowMultiple:n=!1,autoFocus:j=!1,defaultExpanded:l,isDisabled:u=!1,items:d}){const{isFocused:s}=L({autoFocus:j,isActive:!u}),[C,D]=g(()=>l===void 0||l.length===0?[]:n?l:l.slice(0,1)),[a,h]=g(0),i=k(a);i.current=a;const x=A(r=>{D(e=>{const o=e.includes(r);return n?o?e.filter(t=>t!==r):[...e,r]:o?[]:[r]})},[n]);return y(A((r,e)=>{if(!s)return;const o=d.length;if((e.downArrow||r==="j")&&i.current<o-1)h(i.current+1);else if((e.upArrow||r==="k")&&i.current>0)h(i.current-1);else if(e.return||r===" "){const t=d[i.current];t&&x(t.id)}},[s,d,x]),{isActive:!u&&s}),p(f,{flexDirection:"column",children:d.map((r,e)=>{const o=C.includes(r.id),t=s&&e===a,b=t?c:void 0;return v(f,{flexDirection:"column",children:[v(f,{children:[v(w,{color:b,dimColor:u,children:[t?"▸ ":" ",o?"▼ ":"▶ "]}),p(w,{bold:t,color:b,dimColor:u,children:r.title})]}),o?p(f,{flexDirection:"column",marginBottom:1,marginLeft:4,children:r.content}):void 0]},r.id)})})}m(E,"w");B(E,"Accordion");export{E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var i=(e,r)=>f(e,"name",{value:r,configurable:!0});import{jsxs as d,jsx as o}from"react/jsx-runtime";import l from"./Box-BwqSvWuq.js";import n from"./Text-mTAve9R2.js";import{o as m}from"./variant-config-BJqpNo7H.js";var h=Object.defineProperty,p=i((e,r)=>h(e,"name",{value:r,configurable:!0}),"i");function u({children:e,title:r,variant:c}){const{color:t,icon:a}=m[c];return d(l,{borderColor:t,borderStyle:"round",flexGrow:1,gap:1,paddingX:1,children:[o(l,{flexShrink:0,children:o(n,{color:t,children:a})}),d(l,{flexDirection:"column",flexGrow:1,flexShrink:1,gap:1,minWidth:0,children:[r?o(n,{bold:!0,children:r}):void 0,o(n,{children:e})]})]})}i(u,"c");p(u,"Alert");export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var w=Object.defineProperty;var c=(o,s)=>w(o,"name",{value:s,configurable:!0});import{jsx as E}from"react/jsx-runtime";import{useState as b,Children as p,isValidElement as h,useEffect as x,useCallback as v,cloneElement as y}from"react";import A from"./Box-BwqSvWuq.js";var g=Object.defineProperty,u=c((o,s)=>g(o,"name",{value:s,configurable:!0}),"a");const k=u(o=>{const{key:s}=o;if(s!==null)return s},"getKey"),a=u(o=>o.type?.isAnimatable===!0?!0:typeof o.props=="object"&&o.props!==null&&"show"in o.props,"isAnimatable");function j({children:o}){const[s,f]=b(()=>{const e=[];return p.forEach(o,t=>{if(!h(t))return;const r=k(t);r!==void 0&&e.push({element:(a(t),t),key:r,show:!0})}),e});x(()=>{const e=new Map;p.forEach(o,t=>{if(!h(t))return;const r=k(t);r!==void 0&&e.set(r,(a(t),t))}),f(t=>{const r=[],m=new Set;let l=!1;for(const n of t)if(e.has(n.key)){const i=e.get(n.key);(!n.show||n.element!==i)&&(l=!0),r.push({element:i,key:n.key,show:!0}),m.add(n.key)}else n.show&&(l=!0),r.push({...n,show:!1});for(const[n,i]of e)m.has(n)||(l=!0,r.push({element:i,key:n,show:!0}));return l?r:t})},[o]);const d=v(e=>{f(t=>t.filter(r=>r.key!==e))},[]);return E(A,{flexDirection:"column",children:s.map(e=>{if(!a(e.element))return y(e.element,{key:e.key});const t=e.element.props.onExit;return y(e.element,{key:e.key,onExit:u(()=>{t?.(),d(e.key)},"onExit"),show:e.show})})})}c(j,"A");u(j,"AnimatePresence");export{j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var I=Object.defineProperty;var s=(r,l)=>I(r,"name",{value:l,configurable:!0});import{jsxs as n,jsx as e}from"react/jsx-runtime";import{useCallback as C}from"react";import D from"./useFocus-DSmziO_x.js";import T from"./useInput-D1_jG26Z.js";import i from"./Box-BwqSvWuq.js";import o from"./Text-mTAve9R2.js";var j=Object.defineProperty,y=s((r,l)=>j(r,"name",{value:l,configurable:!0}),"m");const k={high:"red",low:"green",medium:"yellow"},x={high:"HIGH RISK",low:"LOW RISK",medium:"MEDIUM RISK"},A=y(r=>{if(r===null)return"null";if(typeof r=="string")return r;if(typeof r=="number"||typeof r=="boolean")return String(r);try{return JSON.stringify(r)}catch{return String(r)}},"formatParameterValue");function O({accentColor:r,autoFocus:l=!0,children:p,description:h,isDisabled:f=!1,onDecision:t,params:b,risk:g="medium",tool:w}){const a=k[g],u=r??a,{isFocused:S}=D({autoFocus:l,isActive:!f});T(C((c,d)=>{const m=c.toLowerCase();if(m==="y"||d.return){t("allow-once");return}if(m==="a"){t("allow-always");return}(m==="n"||d.escape)&&t("deny")},[t]),{isActive:!f&&S});const v=b===void 0?[]:Object.entries(b);return n(i,{borderColor:a,borderStyle:"round",flexDirection:"column",paddingX:1,children:[n(i,{children:[n(o,{backgroundColor:a,color:"black",children:[" ",x[g]," "]}),n(o,{children:[" ",e(o,{bold:!0,children:w})]})]}),h===void 0?void 0:e(i,{marginTop:1,children:e(o,{children:h})}),v.length===0?void 0:e(i,{flexDirection:"column",marginTop:1,children:v.map(([c,d])=>n(i,{children:[n(o,{color:"cyan",children:[c,"="]}),e(o,{wrap:"truncate-end",children:A(d)})]},c))}),p===void 0?void 0:e(i,{marginTop:1,children:p}),e(i,{marginTop:1,children:n(o,{children:["Allow? [",e(o,{bold:!0,color:u,children:"y"}),"es /"," ",e(o,{bold:!0,color:u,children:"a"}),"lways /"," ",e(o,{bold:!0,color:u,children:"n"}),"o ]"]})})]})}s(O,"I");y(O,"ApprovalPrompt");export{O as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var P=Object.defineProperty;var f=(c,p)=>P(c,"name",{value:p,configurable:!0});import{jsxs as w,jsx as x}from"react/jsx-runtime";import{useMemo as Y}from"react";import{c as _}from"./braille-BBjIoaN0.js";import I from"./Box-BwqSvWuq.js";import D from"./Canvas-CKg6WV47.js";import{t as F,p as j,D as G,c as L,a as g}from"./line-chart-DrM8PwnI.js";import v from"./Text-mTAve9R2.js";var S=Object.defineProperty,V=f((c,p)=>S(c,"name",{value:p,configurable:!0}),"E");const $=G,O={heavy:"▓",light:"░",medium:"▒"};function U({axisColor:c="gray",fillDensity:p="medium",height:N=10,maxY:d,minY:M,palette:u=$,series:y,showLegend:A=!0,width:T=40}){const n=Y(()=>{const o=y.map((r,m)=>({color:j(r,m,u),points:F(r.data),series:r})),t=L(o);return{list:o,xMax:t.xMax===Number.NEGATIVE_INFINITY?1:t.xMax,xMin:t.xMin===Number.POSITIVE_INFINITY?0:t.xMin,yMax:d??(t.yMax===Number.NEGATIVE_INFINITY?1:t.yMax),yMin:M??(t.yMin===Number.POSITIVE_INFINITY?0:t.yMin)}},[y,u,M,d]),E=O[p];return w(I,{flexDirection:"column",children:[x(D,{draw:f(o=>{o.clear();const t=o.width*2,r=o.height*4,m={xMax:n.xMax,xMin:n.xMin,yMax:n.yMax,yMin:n.yMin};for(const{color:a,points:s}of n.list)if(s.length!==0)for(let l=0;l<o.width;l+=1){let i;for(const e of s){const{px:h,py:C}=g(e,m,t,r);if(Math.floor(h/2)===l){const b=Math.floor(C/4);(i===void 0||b<i)&&(i=b)}}if(i!==void 0)for(let e=i+1;e<o.height;e+=1)o.setCell(l,e,E,{color:a,dim:!0})}for(let a=0;a<o.width;a+=2)o.setCell(a,o.height-1,"·",{color:c,dim:!0});for(const{color:a,points:s}of n.list){if(s.length===0)continue;const l=_(o.width,o.height);let i=g(s[0],m,t,r);l.plotPoint(i.px,i.py);for(let e=1;e<s.length;e+=1){const h=g(s[e],m,t,r);l.plotLine(i.px,i.py,h.px,h.py),i=h}l.flush(o,{bold:!0,color:a})}},"draw"),height:N,version:[y,T,N,M,d,p,c,u],width:T}),A?x(I,{gap:2,marginTop:1,children:n.list.map(({color:o,series:t},r)=>w(I,{gap:1,children:[x(v,{color:o,children:E}),x(v,{children:t.label??`Series ${r+1}`})]},`${r}:${t.label??""}`))}):void 0]})}f(U,"G");V(U,"AreaChart");export{U as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=Object.defineProperty;var o=(r,e)=>n(r,"name",{value:e,configurable:!0});import{jsxs as c,jsx as l}from"react/jsx-runtime";import t from"./Text-mTAve9R2.js";var i=Object.defineProperty,p=o((r,e)=>i(r,"name",{value:e,configurable:!0}),"t");function d({children:r,color:e="magenta"}){const a=typeof r=="string"?r.toUpperCase():r;return c(t,{backgroundColor:e,children:[" ",l(t,{color:"black",children:a})," "]})}o(d,"p");p(d,"Badge");export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var D=Object.defineProperty;var m=(r,l)=>D(r,"name",{value:l,configurable:!0});import{jsx as e,jsxs as k}from"react/jsx-runtime";import{useMemo as M}from"react";import i from"./Box-BwqSvWuq.js";import E from"./Canvas-CKg6WV47.js";import p from"./Text-mTAve9R2.js";var y=Object.defineProperty,x=m((r,l)=>y(r,"name",{value:l,configurable:!0}),"u");const z=["cyan","magenta","yellow","green","blue","red"],V=x((r,l)=>{if(l!==void 0)return l;if(r.length===0)return 0;let o=r[0].value;for(let u=1;u<r.length;u+=1){const{value:c}=r[u];c>o&&(o=c)}return o},"findMax"),j=x((r,l,o)=>o.color??l[r%l.length]??"cyan","colorFor");function F({data:r,height:l=10,max:o,orientation:u="vertical",palette:c=z,showLabels:b=!0,showValues:C=!1,width:S}){const h=M(()=>V(r,o),[r,o]);if(u==="horizontal"){const t=S??24;return e(i,{flexDirection:"column",children:r.map((n,f)=>{const w=h===0?0:n.value/h,s=j(f,c,n);return k(i,{gap:1,children:[b&&n.label!==void 0?e(i,{flexShrink:0,minWidth:8,children:e(p,{dimColor:!0,wrap:"truncate-end",children:n.label})}):void 0,e(i,{flexGrow:1,flexShrink:1,children:e(E,{draw:m(v=>{v.clear(),v.drawHBar(0,0,t,w,{color:s})},"draw"),height:1,version:[n.value,h,s,t],width:t})}),C?e(i,{flexShrink:0,children:e(p,{children:String(n.value)})}):void 0]},f)})})}const a=2,d=1,B=S??Math.max(r.length*(a+d),1);return k(i,{flexDirection:"column",children:[e(E,{draw:m(t=>{t.clear(),r.forEach((n,f)=>{const w=h===0?0:n.value/h,s=j(f,c,n),v=f*(a+d);for(let g=0;g<a;g+=1)t.drawVBar(v+g,0,l,w,{color:s})})},"draw"),height:l,version:[r,h,c,a,d,l],width:B}),C?e(i,{children:r.map((t,n)=>e(i,{width:a+d,children:e(p,{dimColor:!0,children:String(t.value).padEnd(a+d," ")})},n))}):void 0,b?e(i,{children:r.map((t,n)=>e(i,{width:a+d,children:e(p,{dimColor:!0,wrap:"truncate-end",children:(t.label??"").padEnd(a+d," ")})},n))}):void 0]})}m(F,"R");x(F,"BarChart");export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p=Object.defineProperty;var r=(e,t)=>p(e,"name",{value:t,configurable:!0});import{jsx as s}from"react/jsx-runtime";import f from"cfonts";import{useMemo as u}from"react";import d from"./Text-mTAve9R2.js";var h=Object.defineProperty,x=r((e,t)=>h(e,"name",{value:t,configurable:!0}),"i");const b={align:"left",backgroundColor:"transparent",colors:["system"],font:"block",letterSpacing:1,lineHeight:1,maxLength:0,space:!0};function k({align:e,backgroundColor:t,colors:o,font:n,letterSpacing:a,lineHeight:i,maxLength:l,space:g,text:c}){const m=u(()=>f.render(c,{...b,align:e,backgroundColor:t,colors:o,font:n,letterSpacing:a,lineHeight:i,maxLength:l,space:g}),[c,e,t,o,n,a,i,l,g]);return s(d,{children:m&&m.string})}r(k,"f");x(k,"BigText");export{k as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l=Object.defineProperty;var t=(r,e)=>l(r,"name",{value:e,configurable:!0});import{jsx as n}from"react/jsx-runtime";import f from"./useAnimation-B9we6ZzL.js";import m from"./Text-mTAve9R2.js";var u=Object.defineProperty,v=t((r,e)=>u(r,"name",{value:e,configurable:!0}),"e");function s({character:r="●",color:e="red",interval:a=800,isActive:o=!0}){const{frame:i}=f({interval:Math.max(1,Math.floor(a/2)),isActive:o}),c=!o||i%2===0;return n(m,{color:e,children:c?r:" "})}t(s,"s");v(s,"BlinkDot");export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as i,jsxs as k}from"react/jsx-runtime";import{forwardRef as w,useContext as m}from"react";import{a as y}from"./accessibility-context-DDyHTwmA.js";import{b as h}from"./background-context-rjOaWFki.js";const C={flexDirection:"row",flexGrow:0,flexShrink:1,flexWrap:"nowrap"},g=w(({"aria-hidden":d,"aria-label":l,"aria-role":t,"aria-state":a,backgroundColor:o,children:b,opaque:u,scrollbar:x,sticky:n,stickyChildren:s,...r},p)=>{const{isScreenReaderEnabled:e}=m(y),c=l?i("ink-text",{children:l}):void 0,v=t||a?{role:t,state:a}:void 0;if(e&&d)return null;const f=k("ink-box",{internal_accessibility:v,opaque:u,ref:p,scrollbar:x,sticky:n,style:{...C,...r,backgroundColor:o,overflowX:r.overflowX??r.overflow??"visible",overflowY:r.overflowY??r.overflow??"visible"},children:[e&&c?c:b,n&&s&&!e?i("ink-box",{internalStickyAlternate:!0,style:{position:"absolute",...r},children:s}):null]});return o?i(h.Provider,{value:o,children:f}):f});g.displayName="Box";export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var a=(o,r)=>c(o,"name",{value:r,configurable:!0});import{jsx as d,jsxs as i,Fragment as u}from"react/jsx-runtime";import{Fragment as p}from"react";import f from"./Box-BwqSvWuq.js";import m from"./Text-mTAve9R2.js";var s=Object.defineProperty,b=a((o,r)=>s(o,"name",{value:r,configurable:!0}),"a");function v({currentColor:o="blue",items:r,separator:n="›"}){return d(f,{children:r.map((e,t)=>{const l=t===r.length-1;return i(p,{children:[t>0?i(m,{dimColor:!0,children:[" ",n," "]}):void 0,i(m,{bold:l,color:l?o:void 0,dimColor:!l,children:[e.icon===void 0?void 0:i(u,{children:[e.icon," "]}),e.label]})]},e.key??`${t}:${e.label}`)})})}a(v,"c");b(v,"Breadcrumb");export{v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var b=Object.defineProperty;var a=(o,i)=>b(o,"name",{value:i,configurable:!0});import{jsx as c,jsxs as v}from"react/jsx-runtime";import{useCallback as C}from"react";import y from"./useFocus-DSmziO_x.js";import g from"./useInput-D1_jG26Z.js";import s from"./Box-BwqSvWuq.js";import u from"./Text-mTAve9R2.js";var h=Object.defineProperty,m=a((o,i)=>h(o,"name",{value:i,configurable:!0}),"l");const x="round",j=m((o,i,l,e)=>{if(!l){if(o==="primary"&&i)return"black";if(i)return e}},"resolveTextColor");function k({accentColor:o="blue",autoFocus:i=!1,children:l,isDisabled:e=!1,onPress:d,variant:t="primary"}){const{isFocused:r}=y({autoFocus:i,isActive:!e});g(C((f,p)=>{r&&(p.return||f===" ")&&d?.()},[r,d]),{isActive:!e&&r});const n=j(t,r,e,o);return t==="ghost"?c(s,{paddingX:1,children:v(u,{bold:r,color:n,dimColor:e,children:[r?"▸ ":" ",l]})}):c(s,{backgroundColor:t==="primary"&&r?o:void 0,borderColor:t==="outline"?r?o:"gray":t==="secondary"||r?o:void 0,borderStyle:x,paddingX:1,children:c(u,{bold:r,color:n,dimColor:e,children:l})})}a(k,"C");m(k,"Button");export{k as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var u=Object.defineProperty;var p=(t,a)=>u(t,"name",{value:a,configurable:!0});var b=Object.defineProperty,n=p((t,a)=>b(t,"name",{value:a,configurable:!0}),"t");const x={achromatopsia:[[.299,.587,.114],[.299,.587,.114],[.299,.587,.114]],deuteranopia:[[.625,.375,0],[.7,.3,0],[0,.3,.7]],protanopia:[[.567,.433,0],[.558,.442,0],[0,.242,.758]],tritanopia:[[.95,.05,0],[0,.433,.567],[0,.475,.525]]},S={deuteranopia:[[1,.7,0],[0,1,0],[0,.7,1]],protanopia:[[1,0,0],[.7,1,0],[.7,0,1]],tritanopia:[[1,0,.7],[0,1,.7],[0,0,1]]},l=[[1,0,0],[0,1,0],[0,0,1]],e=n(t=>Math.max(0,Math.min(255,Math.round(t))),"clamp"),c=n((t,a,r,o)=>[e(o[0][0]*t+o[0][1]*a+o[0][2]*r),e(o[1][0]*t+o[1][1]*a+o[1][2]*r),e(o[2][0]*t+o[2][1]*a+o[2][2]*r)],"applyColorMatrix"),I=/^#?(?<r>[\da-f]{2})(?<g>[\da-f]{2})(?<b>[\da-f]{2})$/i,N=/^#?(?<r>[\da-f])(?<g>[\da-f])(?<b>[\da-f])$/i,d=n(t=>{const a=I.exec(t);if(a)return[Number.parseInt(a[1],16),Number.parseInt(a[2],16),Number.parseInt(a[3],16)];const r=N.exec(t);return r?[Number.parseInt(r[1]+r[1],16),Number.parseInt(r[2]+r[2],16),Number.parseInt(r[3]+r[3],16)]:null},"hexToRgb"),m=n((t,a,r)=>`#${e(t).toString(16).padStart(2,"0")}${e(a).toString(16).padStart(2,"0")}${e(r).toString(16).padStart(2,"0")}`,"rgbToHex"),g=n((t,a)=>{const r=d(t);if(!r)return t;const[o,i,s]=c(r[0],r[1],r[2],a);return m(o,i,s)},"transformHexColor");export{S as COLOR_BLINDNESS_COMPENSATION,x as COLOR_BLINDNESS_SIMULATION,l as IDENTITY_MATRIX,c as applyColorMatrix,d as hexToRgb,m as rgbToHex,g as transformHexColor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var X=Object.defineProperty;var v=(e,r)=>X(e,"name",{value:r,configurable:!0});import{jsxs as k,jsx as u}from"react/jsx-runtime";import{useMemo as F,useState as $,useRef as z,useCallback as O}from"react";import B from"./useFocus-DSmziO_x.js";import L from"./useInput-D1_jG26Z.js";import h from"./Box-BwqSvWuq.js";import b from"./Text-mTAve9R2.js";var _=Object.defineProperty,p=v((e,r)=>_(e,"name",{value:r,configurable:!0}),"g");const q=["January","February","March","April","May","June","July","August","September","October","November","December"],j=["Su","Mo","Tu","We","Th","Fr","Sa"],f=p(e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),"startOfDay"),x=p((e,r)=>{const i=e.getFullYear(),l=e.getMonth()+r,g=new Date(i,l+1,0).getDate(),a=Math.min(e.getDate(),g);return new Date(i,l,a)},"shiftMonth"),J=p((e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate(),"isSameDay"),R=p((e,r,i)=>r!==void 0&&e<f(r)||i!==void 0&&e>f(i),"isOutOfRange"),G=p((e,r,i)=>{const l=(new Date(e,r,1).getDay()-i+7)%7,g=new Date(e,r+1,0).getDate(),a=[];for(let o=0;o<l;o+=1)a.push(void 0);for(let o=1;o<=g;o+=1)a.push(new Date(e,r,o));for(;a.length%7!==0;)a.push(void 0);const D=[];for(let o=0;o<a.length;o+=7)D.push(a.slice(o,o+7));return D},"buildWeeks");function H({accentColor:e="blue",autoFocus:r=!1,defaultValue:i,firstDayOfWeek:l=1,isDisabled:g=!1,maxDate:a,minDate:D,onChange:o,onSubmit:M,selectedColor:T="green",value:w}){const{isFocused:m}=B({autoFocus:r,isActive:!g}),Y=F(()=>f(new Date),[]),W=f(w??i??Y),[E,I]=$(W),c=w?f(w):E,y=z(c);y.current=c;const N=F(()=>[...j.slice(l),...j.slice(0,l)],[l]),P=F(()=>G(c.getFullYear(),c.getMonth(),l),[c,l]),d=O(s=>{const n=f(s);R(n,D,a)||(w===void 0&&I(n),o?.(n))},[w,o,D,a]);L(O((s,n)=>{if(!m)return;const{current:t}=y;n.leftArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()-1)):n.rightArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()+1)):n.upArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()-7)):n.downArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()+7)):n.pageUp?d(x(t,-1)):n.pageDown?d(x(t,1)):n.return&&M?.(t)},[m,d,M]),{isActive:!g&&m});const U=`${q[c.getMonth()]} ${c.getFullYear()}`;return k(h,{borderColor:m?e:void 0,borderStyle:"round",flexDirection:"column",paddingX:1,children:[u(h,{justifyContent:"center",children:u(b,{bold:!0,color:e,children:U})}),u(h,{marginTop:1,children:N.map(s=>u(h,{width:3,children:u(b,{dimColor:!0,children:s.padEnd(2," ")})},s))}),P.map((s,n)=>u(h,{children:s.map((t,C)=>{if(t===void 0)return u(h,{width:3,children:u(b,{children:" "})},C);const S=J(t,Y),A=J(t,c),V=R(t,D,a);return u(h,{width:3,children:k(b,{backgroundColor:A&&m?e:void 0,bold:S,color:A&&m?"black":S?T:void 0,dimColor:V||g,children:[String(t.getDate()).padStart(2," ")," "]})},C)})},n))]})}v(H,"j");p(H,"Calendar");export{H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var O=Object.defineProperty;var S=(r,e)=>O(r,"name",{value:e,configurable:!0});import{jsx as D}from"react/jsx-runtime";import{useRef as P,useMemo as T,Fragment as H}from"react";import{d as I}from"./colorize-DbTZMrJO.js";import V from"./Box-BwqSvWuq.js";import _ from"./Text-mTAve9R2.js";var E=Object.defineProperty,m=S((r,e)=>E(r,"name",{value:e,configurable:!0}),"u$1");const z=Math.trunc(1),F=2,R=32,q=0,G=m(()=>{const r=new Map,e=[void 0];return{decode:m(d=>e[d],"decode"),encode:m(d=>{if(d===void 0)return q;const u=typeof d=="number"?`n:${d}`:`s:${d}`,h=r.get(u);if(h!==void 0)return h;const p=e.length;return e.push(d),r.set(u,p),p},"encode")}},"createColorCoders"),$=[9601,9602,9603,9604,9605,9606,9607,9608],k=[9615,9614,9613,9612,9611,9610,9609,9608],U=9608,J=m(r=>{if(!r)return 0;let e=0;return r.bold&&(e|=z),r.dim&&(e|=F),e},"flagsFromStyle"),j=m(r=>typeof r=="number"?r:r.codePointAt(0)??R,"toCodepoint"),K=m((r,e)=>{const d=Math.max(0,r*e),u=new Uint32Array(d),h=new Uint32Array(d),p=new Int32Array(d),y=new Int32Array(d),v=new Uint8Array(e),{decode:x,encode:g}=G();u.fill(R);const M=m(o=>{o>=0&&o<e&&(v[o]=1)},"markDirty"),w=m((o,n,c,a)=>{if(o<0||o>=r||n<0||n>=e)return;const t=n*r+o,l=j(c),f=g(a?.color),i=g(a?.background),s=J(a);u[t]===l&&h[t]===s&&p[t]===f&&y[t]===i||(u[t]=l,h[t]=s,p[t]=f,y[t]=i,v[n]=1)},"setCellImpl");return{bg:y,chars:u,colorDecoder:x,context:{clear:m(()=>{u.fill(R),h.fill(0),p.fill(0),y.fill(0),v.fill(1)},"clear"),drawHBar:m((o,n,c,a,t)=>{if(c<=0||n<0||n>=e)return;const l=Math.max(0,Math.min(1,a)),f=c*k.length,i=Math.round(l*f),s=Math.floor(i/k.length),C=i%k.length;for(let b=0;b<c;b+=1){const B=o+b;b<s?w(B,n,U,t):b===s&&C>0?w(B,n,k[C-1],t):w(B,n,R,t)}M(n)},"drawHBar"),drawRect:m((o,n,c,a,t,l)=>{if(c<=0||a<=0)return;const f=j(t);for(let i=0;i<a;i+=1){for(let s=0;s<c;s+=1)w(o+s,n+i,f,l);M(n+i)}},"drawRect"),drawText:m((o,n,c,a)=>{if(n<0||n>=e||c.length===0)return;let t=0;for(const l of c)w(o+t,n,l,a),t+=1;M(n)},"drawText"),drawVBar:m((o,n,c,a,t)=>{if(c<=0||o<0||o>=r)return;const l=Math.max(0,Math.min(1,a)),f=c*$.length,i=Math.round(l*f),s=Math.floor(i/$.length),C=i%$.length;for(let b=0;b<c;b+=1){const B=c-b-1,A=n+b;B<s?w(o,A,U,t):B===s&&C>0?w(o,A,$[C-1],t):w(o,A,R,t),M(A)}},"drawVBar"),height:e,setCell:w,width:r},dirty:v,fg:p,height:e,styles:h,width:r}},"createCanvasBuffer"),L=m((r,e)=>{const{bg:d,chars:u,colorDecoder:h,fg:p,styles:y,width:v}=r,x=e*v;let g="",M=0,w=y[x],o=p[x],n=d[x];const c=m(a=>{let t="";for(let s=M;s<a;s+=1)t+=String.fromCodePoint(u[x+s]);const l=h(o),f=h(n);let i=t;l!==void 0&&(i=I(i,typeof l=="number"?String(l):l,"foreground")),f!==void 0&&(i=I(i,typeof f=="number"?String(f):f,"background")),(w&z)!==0&&(i=`\x1B[1m${i}\x1B[22m`),(w&F)!==0&&(i=`\x1B[2m${i}\x1B[22m`),g+=i},"flush");for(let a=1;a<v;a+=1){const t=y[x+a],l=p[x+a],f=d[x+a];(t!==w||l!==o||f!==n)&&(c(a),M=a,w=t,o=l,n=f)}return c(v),g},"serializeRow");var N=Object.defineProperty,Q=S((r,e)=>N(r,"name",{value:e,configurable:!0}),"u");function W({draw:r,height:e,version:d,width:u}){const h=P(void 0),p=P(void 0);(h.current?.width!==u||h.current.height!==e)&&(h.current=K(u,e),p.current={hasRendered:!1,lines:Array.from({length:e}).fill("")});const y=h.current,v=p.current,x=T(()=>{r(y.context);for(let g=0;g<y.height;g+=1)v.hasRendered&&y.dirty[g]===0||(v.lines[g]=L(y,g),y.dirty[g]=0);return v.hasRendered=!0,[...v.lines]},[d,u,e]);return D(V,{flexDirection:"column",flexShrink:0,height:e,width:u,children:x.map((g,M)=>D(H,{children:D(_,{wrap:"truncate-end",children:g})},M))})}S(W,"w");Q(W,"Canvas");export{W as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var m=(e,i)=>f(e,"name",{value:i,configurable:!0});import{jsxs as d,jsx as r}from"react/jsx-runtime";import o from"./Box-BwqSvWuq.js";import p from"./Divider-C47bKmqu.js";import u from"./Text-mTAve9R2.js";var b=Object.defineProperty,x=m((e,i)=>b(e,"name",{value:i,configurable:!0}),"m");function g({borderColor:e,borderStyle:i="round",children:v,footer:h,headerRight:t,subtitle:n,title:l,titleColor:a,width:c}){return d(o,{borderColor:e,borderStyle:i,flexDirection:"column",paddingX:1,width:c,children:[l!==void 0||n!==void 0||t!==void 0?d(o,{flexDirection:"column",marginBottom:1,children:[d(o,{justifyContent:"space-between",children:[r(o,{children:l===void 0?void 0:r(u,{bold:!0,color:a,children:l})}),t===void 0?void 0:r(o,{children:t})]}),n===void 0?void 0:r(u,{dimColor:!0,children:n})]}):void 0,r(o,{flexDirection:"column",children:v}),h===void 0?void 0:d(o,{flexDirection:"column",marginTop:1,children:[r(p,{dimColor:!0,length:typeof c=="number"?Math.max(1,c-4):void 0}),r(o,{marginTop:1,children:h})]})]})}m(g,"y");x(g,"Card");export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const g={getBg(t){return t>>8&255},getChar(t){return t===0?" ":t>1114111?"":String.fromCodePoint(t)},getFg(t){return t&255},getStyles(t){return t>>16&255},pack(t,r=255,e=255,n=0){const o=t.codePointAt(0)??32,I=(n&255)<<16|(e&255)<<8|r&255;return[o,I]}},u={BLINK:16,BOLD:1,DIM:2,HIDDEN:64,INVERT:32,ITALIC:4,STRIKETHROUGH:128,UNDERLINE:8};export{g as Cell,u as StyleMasks};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var C=Object.defineProperty;var l=(o,r)=>C(o,"name",{value:r,configurable:!0});import{jsxs as n,jsx as b}from"react/jsx-runtime";import{useState as x,useCallback as k}from"react";import g from"./useFocus-DSmziO_x.js";import j from"./useInput-D1_jG26Z.js";import A from"./Box-BwqSvWuq.js";import m from"./Text-mTAve9R2.js";var F=Object.defineProperty,$=l((o,r)=>F(o,"name",{value:r,configurable:!0}),"d");const I="☒",y="☐";function z({accentColor:o="blue",autoFocus:r=!1,children:s,defaultChecked:u=!1,isChecked:c,isDisabled:i=!1,onChange:a}){const{isFocused:e}=g({autoFocus:r,isActive:!i}),[f,v]=x(u),t=c??f;return j(k((p,h)=>{if(e&&(h.return||p===" ")){const d=!t;c===void 0&&v(d),a?.(d)}},[e,t,c,a]),{isActive:!i&&e}),n(A,{gap:1,children:[n(m,{color:e?o:void 0,dimColor:i,children:[e?"▸ ":" ",t?I:y]}),s===void 0?void 0:b(m,{color:e?o:void 0,dimColor:i,children:s})]})}l(z,"I");$(z,"Checkbox");export{z as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var S=Object.defineProperty;var f=(e,r)=>S(e,"name",{value:r,configurable:!0});import{jsx as d,jsxs as p}from"react/jsx-runtime";import{useState as k,useRef as w,useEffect as y}from"react";import{r as P,i as j,P as C,g as T,t as E}from"./token-to-elements-BYxT6J_Q.js";import L from"./Box-BwqSvWuq.js";import x from"./Text-mTAve9R2.js";var N=Object.defineProperty,R=f((e,r)=>N(e,"name",{value:r,configurable:!0}),"p");function $({code:e,highlightLines:r,language:i,showLineNumbers:a=!1,startLine:l=1,theme:u="github-dark-default"}){const[h,c]=k(null),n=w(!1);y(()=>{n.current=!1;const t=i?P(i):"text";if(t!=="text"&&!j(t)){c(null);return}return(async()=>{try{const o=await C(t==="text"?[]:[t],u),s=T(o,e,t,u);n.current||c(s.tokens)}catch{n.current||c(null)}})(),()=>{n.current=!0}},[e,i,u]);const v={highlightLines:r,showLineNumbers:a,startLine:l};if(h)return E(h,v);const m=e.split(`
|
|
2
|
+
`),b=a?String(l+m.length-1).length:0;return d(L,{flexDirection:"column",children:m.map((t,o)=>{const s=l+o,g=r?.has(s)??!1;return p(L,{children:[a?p(x,{color:g?"yellow":void 0,dimColor:!g,children:[String(s).padStart(b)," "]}):void 0,d(x,{children:t})]},o)})})}f($,"P");R($,"Code");export{$ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var g=Object.defineProperty;var c=(o,e)=>g(o,"name",{value:e,configurable:!0});import{jsxs as m,jsx as n}from"react/jsx-runtime";import{useState as j,useCallback as D}from"react";import F from"./useFocus-DSmziO_x.js";import O from"./useInput-D1_jG26Z.js";import s from"./Box-BwqSvWuq.js";import u from"./Text-mTAve9R2.js";var A=Object.defineProperty,k=c((o,e)=>A(o,"name",{value:e,configurable:!0}),"f");function y({accentColor:o="blue",autoFocus:e=!1,children:d,defaultOpen:p=!1,isDisabled:i=!1,isOpen:t,onToggle:a,title:v}){const{isFocused:r}=F({autoFocus:e,isActive:!i}),[b,h]=j(p),l=t??b;return O(D((x,C)=>{if(C.return||x===" "){const f=!l;t===void 0&&h(f),a?.(f)}},[l,t,a]),{isActive:!i&&r}),m(s,{flexDirection:"column",children:[m(s,{children:[n(u,{color:r?o:void 0,dimColor:i,children:l?"▼ ":"▶ "}),n(u,{bold:r,color:r?o:void 0,dimColor:i,children:v})]}),l?n(s,{flexDirection:"column",marginLeft:2,children:d}):void 0]})}c(y,"N");k(y,"Collapsible");export{y as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var g=Object.defineProperty;var m=(r,e)=>g(r,"name",{value:e,configurable:!0});import{jsxs as d,jsx as o}from"react/jsx-runtime";import l from"./Box-BwqSvWuq.js";import x from"./Spinner-B0-A50pu.js";import i from"./Text-mTAve9R2.js";var v=Object.defineProperty,a=m((r,e)=>v(r,"name",{value:e,configurable:!0}),"d");const y={error:"red",idle:"gray",running:"cyan",success:"green"},$=a(r=>r<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(2)}s`,"formatDuration"),b=a(r=>r==="running"?o(x,{type:"dots"}):{error:"✖",idle:"$",success:"✔"}[r],"resolveStatusIcon"),C=a((r,e)=>{if(!Number.isFinite(e))return r;const n=r.split(`
|
|
2
|
+
`);if(n.length<=e)return r;const t=n.slice(0,e).join(`
|
|
3
|
+
`),c=n.length-e;return`${t}
|
|
4
|
+
… ${c} more line${c===1?"":"s"}`},"truncateOutput");function S({command:r,cwd:e,durationMs:n,exitCode:t,maxOutputRows:c=12,output:u,status:h="idle"}){const p=y[h],f=b(h),s=[];return n!==void 0&&s.push(d(i,{dimColor:!0,children:[" ",$(n)]},"duration")),t!==void 0&&h!=="running"&&s.push(d(i,{color:t===0?"green":"red",children:[" ","exit ",t]},"exit")),d(l,{borderColor:p,borderStyle:"round",flexDirection:"column",paddingX:1,children:[d(l,{children:[o(i,{color:p,children:f}),o(i,{children:" "}),o(l,{flexGrow:1,flexShrink:1,minWidth:0,children:o(i,{bold:!0,wrap:"truncate-end",children:r})}),e===void 0?void 0:d(i,{dimColor:!0,children:[" @",e]}),s.length===0?void 0:o(l,{flexShrink:0,children:s})]}),u===void 0?void 0:o(l,{flexDirection:"column",marginTop:1,children:typeof u=="string"?o(i,{children:C(u,c)}):u})]})}m(S,"h");a(S,"CommandBlock");export{S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T=Object.defineProperty;var k=(i,l)=>T(i,"name",{value:l,configurable:!0});import{jsxs as u,jsx as n}from"react/jsx-runtime";import{useState as M,useRef as D,useMemo as j,useEffect as A,useCallback as F}from"react";import I from"./useFocus-DSmziO_x.js";import L from"./useInput-D1_jG26Z.js";import{i as O}from"./input-utils-fAxzSlNh.js";import s from"./Box-BwqSvWuq.js";import t from"./Text-mTAve9R2.js";var P=Object.defineProperty,S=k((i,l)=>P(i,"name",{value:l,configurable:!0}),"w");const z=S((i,l)=>{if(i.length===0)return 1;const p=[l.label,l.description??"",...l.keywords??[]].map(c=>c.toLowerCase()).filter(c=>c.length>0),f=i.toLowerCase();let m=0;for(const c of p){if(c.includes(f)){const h=c.indexOf(f);m=Math.max(m,100-h);continue}let x=0,g=0;for(const h of f){const d=c.indexOf(h,x);if(d===-1){g=0;break}g+=1,x=d+1}g===f.length&&(m=Math.max(m,20))}return m},"scoreCommand");function B({accentColor:i="cyan",autoFocus:l=!0,commands:p,emptyText:f="No results",limit:m=8,onCancel:c,onSelect:x,placeholder:g="Type a command or search..."}){const{isFocused:h}=I({autoFocus:l}),[d,y]=M(""),[b,C]=M(0),v=D(b);v.current=b;const a=j(()=>{const e=p.map(r=>({command:r,score:z(d,r)})).filter(({score:r})=>r>0);return e.sort((r,o)=>o.score-r.score),e.slice(0,m).map(({command:r})=>r)},[p,d,m]);return A(()=>{const e=Math.max(0,a.length-1);v.current>e&&(v.current=e,C(e))},[a]),L(F((e,r)=>{if(h){if(r.escape){c?.();return}if(r.downArrow){if(a.length===0)return;C(o=>Math.min(a.length-1,o+1));return}if(r.upArrow){C(o=>Math.max(0,o-1));return}if(r.return){const o=a[v.current];o&&x(o.id,d);return}if(r.backspace||r.delete){y(o=>o.slice(0,-1)),C(0);return}O(e,r)&&(y(o=>o+e),C(0))}},[h,a,d,x,c]),{isActive:h}),u(s,{borderColor:i,borderStyle:"round",flexDirection:"column",paddingX:1,children:[u(s,{children:[n(t,{color:i,children:"❯"}),u(t,{children:[" ",d.length===0?n(t,{dimColor:!0,children:g}):d]}),n(t,{inverse:!0,children:" "})]}),n(s,{marginTop:1,children:u(t,{dimColor:!0,children:[a.length," of ",p.length]})}),n(s,{flexDirection:"column",marginTop:1,children:a.length===0?n(t,{dimColor:!0,children:f}):a.map((e,r)=>{const o=r===b,w=o?i:void 0;return u(s,{flexDirection:"column",children:[u(s,{children:[n(t,{color:w,children:o?"▸ ":" "}),e.icon===void 0?void 0:u(t,{color:w,children:[e.icon," "]}),n(s,{flexGrow:1,flexShrink:1,minWidth:0,children:n(t,{bold:o,color:w,wrap:"truncate-end",children:e.label})}),e.hotkey===void 0?void 0:n(s,{flexShrink:0,children:u(t,{dimColor:!0,children:[" ",e.hotkey]})})]}),e.description===void 0?void 0:n(s,{marginLeft:2,children:n(t,{dimColor:!0,wrap:"truncate-end",children:e.description})})]},e.id)})})]})}k(B,"D");S(B,"CommandPalette");export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var j=Object.defineProperty;var f=(r,o)=>j(r,"name",{value:o,configurable:!0});import{jsxs as p,jsx as e}from"react/jsx-runtime";import{useState as A,useCallback as D}from"react";import L from"./useFocus-DSmziO_x.js";import k from"./useInput-D1_jG26Z.js";import l from"./Box-BwqSvWuq.js";import m from"./Text-mTAve9R2.js";var B=Object.defineProperty,h=f((r,o)=>B(r,"name",{value:o,configurable:!0}),"s");const S={danger:"red",info:"blue",warning:"yellow"},g=h(({color:r,isFocused:o,label:i})=>e(l,{backgroundColor:o?r:void 0,borderColor:o?r:void 0,borderStyle:"round",paddingX:1,children:e(m,{bold:o,color:o?"black":void 0,children:i})}),"ButtonLabel");function P({autoFocus:r=!0,cancelLabel:o="Cancel",children:i,confirmLabel:v="Confirm",defaultFocus:C="confirm",isDisabled:s=!1,onCancel:a,onConfirm:u,title:b,tone:y="info",width:w}){const[n,F]=A(C),t=S[y],{isFocused:x}=L({autoFocus:r,isActive:!s});return k(D((c,d)=>{if(d.leftArrow||d.rightArrow||c==="h"||c==="l"){F(n==="confirm"?"cancel":"confirm");return}if(d.return){n==="confirm"?u():a();return}if(d.escape||c==="n"){a();return}c==="y"&&u()},[n,u,a]),{isActive:!s&&x}),p(l,{borderColor:t,borderStyle:"round",flexDirection:"column",paddingX:1,paddingY:1,width:w,children:[b===void 0?void 0:e(l,{marginBottom:1,children:e(m,{bold:!0,color:t,children:b})}),i===void 0?void 0:e(l,{flexDirection:"column",marginBottom:1,children:typeof i=="string"?e(m,{children:i}):i}),p(l,{gap:2,justifyContent:"flex-end",children:[e(g,{color:t,isFocused:n==="cancel",label:o}),e(g,{color:t,isFocused:n==="confirm",label:v})]})]})}f(P,"P");h(P,"ConfirmDialog");export{P as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var t=(r,e)=>s(r,"name",{value:e,configurable:!0});import{jsx as l,jsxs as p}from"react/jsx-runtime";import{useRef as m,useCallback as d}from"react";import C from"./useInput-D1_jG26Z.js";import b from"./Box-BwqSvWuq.js";import v from"./Text-mTAve9R2.js";var h=Object.defineProperty,j=t((r,e)=>h(r,"name",{value:e,configurable:!0}),"i");function x({defaultChoice:r="confirm",isDisabled:e=!1,onCancel:i,onConfirm:c,submitOnEnter:u=!0}){const n=m(c);n.current=c;const o=m(i);return o.current=i,C(d((f,a)=>{if(f.toLowerCase()==="y"){n.current();return}if(f.toLowerCase()==="n"){o.current();return}a.return&&u&&(r==="confirm"?n.current():o.current())},[u,r]),{isActive:!e}),l(b,{children:p(v,{dimColor:e,children:[r==="confirm"?"Y":"y","/",r==="cancel"?"N":"n"]})})}t(x,"d");j(x,"ConfirmInput");export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var a=(r,e)=>f(r,"name",{value:e,configurable:!0});import{jsx as m,jsxs as d}from"react/jsx-runtime";import{useMemo as h}from"react";import v from"./useConsoleCapture-BxiG8iLJ.js";import u from"./Box-BwqSvWuq.js";import l from"./Text-mTAve9R2.js";var b=Object.defineProperty,c=a((r,e)=>b(r,"name",{value:e,configurable:!0}),"a");const w={debug:"gray",error:"red",info:"blue",log:"white",warn:"yellow"},y={debug:"DBG",error:"ERR",info:"INF",log:"LOG",warn:"WRN"},C=c(r=>{const e=new Date(r),t=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0"),n=String(e.getSeconds()).padStart(2,"0");return`${t}:${i}:${n}`},"formatTimestamp");function S({dock:r="bottom",filter:e,height:t=8,maxEntries:i=200,showLevel:n=!0,showTimestamp:g=!0}){const{entries:s}=v({filter:e,maxEntries:i}),p=h(()=>s.slice(-t),[s,t]);return m(u,{borderBottom:r==="top",borderBottomColor:"gray",borderTop:r==="bottom",borderTopColor:"gray",flexDirection:"column",height:t+1,children:p.length===0?m(l,{dimColor:!0,children:"Console output will appear here..."}):p.map(o=>d(u,{children:[g?d(l,{dimColor:!0,children:["[",C(o.timestamp),"] "]}):void 0,n?d(l,{color:w[o.level],children:[y[o.level]," "]}):void 0,m(l,{color:o.level==="error"?"red":o.level==="warn"?"yellow":void 0,children:o.message})]},o.id))})}a(S,"L");c(S,"ConsoleOverlay");export{S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var M=Object.defineProperty;var f=(i,n)=>M(i,"name",{value:n,configurable:!0});import{jsxs as v,jsx as b,Fragment as j}from"react/jsx-runtime";import{useState as k,useMemo as w,useCallback as x}from"react";import D from"./useFocus-DSmziO_x.js";import I from"./useInput-D1_jG26Z.js";import h from"./Box-BwqSvWuq.js";import S from"./Text-mTAve9R2.js";var $=Object.defineProperty,y=f((i,n)=>$(i,"name",{value:n,configurable:!0}),"p");function z({accentColor:i="blue",autoFocus:n=!1,defaultValue:C,isDisabled:l=!1,onChange:p,options:e,value:a}){const{isFocused:d}=D({autoFocus:n,isActive:!l}),A=C??e[0]?.id,[u,F]=k(A),s=a??u,t=w(()=>{if(s===void 0)return 0;const o=e.findIndex(r=>r.id===s);return Math.max(o,0)},[e,s]),m=x(o=>{const r=e[o];if(!r)return;const c=a??u;r.id!==c&&(a===void 0&&F(r.id),p?.(r.id))},[e,a,u,p]);I(x((o,r)=>{d&&(r.leftArrow||o==="h"?m(Math.max(0,t-1)):(r.rightArrow||o==="l")&&m(Math.min(e.length-1,t+1)))},[d,t,e.length,m]),{isActive:!l&&d});const g=e[t];return v(h,{flexDirection:"column",children:[b(h,{children:e.map((o,r)=>{const c=r===t;return v(S,{backgroundColor:c?i:void 0,color:c?"black":void 0,dimColor:l&&!c,children:[" ",o.icon===void 0?void 0:v(j,{children:[o.icon," "]}),o.label," "]},o.id)})}),g===void 0?void 0:b(h,{flexDirection:"column",marginTop:1,children:g.content})]})}f(z,"S");y(z,"ContentSwitcher");export{z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"react/jsx-runtime";import"react";import"./measure-element-DSp7YDus.js";import"./Box-BwqSvWuq.js";import{C as l}from"./controlled-scroll-view-CmrAEvJk.js";export{l as ControlledScrollView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var t=(o,r)=>a(o,"name",{value:r,configurable:!0});import{jsx as c}from"react/jsx-runtime";import{useMemo as f}from"react";var s=Object.defineProperty,l=t((o,r)=>s(o,"name",{value:r,configurable:!0}),"c");function m({anchorRef:o,x:r=0,y:e=0}){const n=o??void 0,i=n===void 0&&r===0&&e===0,u=f(()=>({anchorRef:n,inline:i,x:r,y:e}),[n,i,r,e]);return c("ink-cursor",{internal_cursor:u})}t(m,"l");l(m,"Cursor");export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var y=Object.defineProperty;var v=(e,r)=>y(e,"name",{value:r,configurable:!0});import{jsxs as b,jsx as t}from"react/jsx-runtime";import{useState as C,useCallback as h}from"react";import P from"./useFocus-DSmziO_x.js";import D from"./useInput-D1_jG26Z.js";import l from"./Box-BwqSvWuq.js";import V from"./Calendar-Dmflvm2S.js";import n from"./Text-mTAve9R2.js";var E=Object.defineProperty,S=v((e,r)=>E(e,"name",{value:r,configurable:!0}),"y");const I=S(e=>{const r=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");return`${r}-${c}-${d}`},"defaultFormat");function z({accentColor:e="blue",autoFocus:r=!1,defaultValue:c,formatValue:d=I,isDisabled:u=!1,maxDate:x,minDate:F,onChange:g,placeholder:$="Pick a date",value:s}){const{isFocused:o}=P({autoFocus:r,isActive:!u}),[a,m]=C(!1),[j,A]=C(c),f=s??j;D(h((i,p)=>{!o||a||(p.return||i===" ")&&m(!0)},[o,a]),{isActive:!u&&o&&!a}),D(h((i,p)=>{p.escape&&m(!1)},[]),{isActive:!u&&o&&a});const k=h(i=>{s===void 0&&A(i),m(!1),g?.(i)},[s,g]);return b(l,{flexDirection:"column",children:[b(l,{borderColor:o?e:void 0,borderStyle:"round",paddingX:1,children:[t(n,{color:e,children:"📅 "}),f===void 0?t(n,{dimColor:!0,children:$}):t(n,{bold:!0,children:d(f)}),o&&!a?t(l,{marginLeft:1,children:t(n,{dimColor:!0,children:"(Enter to open)"})}):void 0]}),a?t(l,{marginTop:1,children:t(V,{accentColor:e,autoFocus:!0,defaultValue:f,maxDate:x,minDate:F,onSubmit:k})}):void 0]})}v(z,"I");S(z,"DatePicker");export{z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var h=Object.defineProperty;var o=(l,i)=>h(l,"name",{value:i,configurable:!0});import{jsx as e,jsxs as m}from"react/jsx-runtime";import n from"./Box-BwqSvWuq.js";import c from"./Text-mTAve9R2.js";var p=Object.defineProperty,u=o((l,i)=>p(l,"name",{value:i,configurable:!0}),"p");function x({columnGap:l=2,items:i,layout:a="inline",termColor:d="cyan",termWidth:f}){return a==="stacked"?e(n,{flexDirection:"column",gap:1,children:i.map((r,t)=>m(n,{flexDirection:"column",children:[e(c,{bold:!0,color:d,children:r.term}),e(c,{children:r.description})]},r.key??t))}):e(n,{flexDirection:"column",children:i.map((r,t)=>m(n,{gap:l,children:[e(n,{flexShrink:0,width:f,children:e(c,{color:d,children:r.term})}),e(n,{flexGrow:1,flexShrink:1,children:e(c,{children:r.description})})]},r.key??t))})}o(x,"x");u(x,"DefinitionList");export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var w=Object.defineProperty;var l=(e,r)=>w(e,"name",{value:r,configurable:!0});import{jsxs as a,jsx as c}from"react/jsx-runtime";import{useState as D,useRef as d,useEffect as T}from"react";import{useWindowSize as S,useTuiContext as b}from"./TuiContext-BoJvG3NN.js";import{_Box as i,_Spacer as g,_Text as v}from"./render-DDqtMAFN.js";var j=Object.defineProperty,s=l((e,r)=>j(e,"name",{value:r,configurable:!0}),"s");function p(){const{app:e}=b(),[r,u]=D(0),t=d(0),n=d(Date.now()),o=d(null);return T(()=>{const h=s(()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{u(0),t.current=0,n.current=Date.now()},2e3),t.current++;const f=Date.now(),m=f-n.current;m>=500&&(u(Math.round(t.current/m*1e3)),t.current=0,n.current=f)},"onRender"),x=e.onBeforeFlush(()=>{h()});return()=>{x(),o.current&&clearTimeout(o.current)}},[e]),r}l(p,"h");s(p,"useFpsCounter");const y=s(({fps:e})=>{const r=e===0?"--":String(e);return c(i,{borderColor:"gray",borderStyle:"round",paddingX:1,children:a(v,{dim:!0,children:[r," updates/sec"]})})},"FpsHud"),k=s(({children:e,enabled:r=!0})=>{const u=p(),{columns:t,rows:n}=S();return a(i,{flexDirection:"column",height:n,width:t,children:[c(i,{flexGrow:1,children:e}),r&&a(i,{flexDirection:"row",flexShrink:0,children:[c(g,{}),c(y,{fps:u})]})]})},"DevTools");export{k as DevTools};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var X=Object.defineProperty;var f=(l,r)=>X(l,"name",{value:r,configurable:!0});import{jsx as o,jsxs as B}from"react/jsx-runtime";import{useRef as H}from"react";import I from"./useTerminalPalette-Cv7tSduR.js";import R from"./useWindowSize-yDZsXF8z.js";import e from"./Box-BwqSvWuq.js";import V from"./Text-mTAve9R2.js";import{ScrollView as Y}from"./ScrollView-BojONotI.js";var q=Object.defineProperty,z=f((l,r)=>q(l,"name",{value:r,configurable:!0}),"b");const F=z(({backgroundColor:l,borderColor:r="cyan",borderStyle:b="round",children:g,columns:h,footer:d,maxHeight:n=.8,paddingX:t=2,paddingY:p=1,rows:k,scrollbarStyle:x="block",scrollRef:S,title:i,visible:y=!0,width:C=60})=>{const c=R(),{isLoading:w,palette:j}=I(),v=H(null),D=S??v;if(!y)return null;const m=h??(c.columns||80),a=k??(c.rows||24),u=l??(w?"black":j?.background??"black"),M=n<=1?Math.floor(a*n):Math.min(n,a-2),s=typeof i=="string"?o(e,{marginBottom:1,children:o(V,{bold:!0,color:r,children:i})}):i??null;return o(e,{alignItems:"center",height:a,justifyContent:"center",position:"absolute",width:m,children:B(e,{backgroundColor:u,borderBackgroundColor:u,borderColor:r,borderStyle:b,flexDirection:"column",maxHeight:M,opaque:!0,paddingY:p,width:Math.min(C,m-4),children:[s!=null&&o(e,{flexShrink:0,paddingX:t,children:s}),o(Y,{flexGrow:1,flexShrink:1,paddingX:t,ref:D,scrollbar:!0,scrollbarColor:r,scrollbarStyle:x,children:g}),d!=null&&o(e,{alignItems:"center",flexDirection:"column",flexShrink:0,marginTop:1,paddingX:t,children:d})]})})},"Dialog");export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var M=Object.defineProperty;var x=(r,i)=>M(r,"name",{value:i,configurable:!0});import{jsx as u,jsxs as g,Fragment as W}from"react/jsx-runtime";import{createPatch as j,parsePatch as B,diffWords as V,diffChars as $}from"diff";import{useMemo as k,useState as U,useRef as q,useEffect as z}from"react";import{r as A,i as E,P as F,g as G,a as J}from"./token-to-elements-BYxT6J_Q.js";import K from"./useWindowSize-yDZsXF8z.js";import p from"./Box-BwqSvWuq.js";import a from"./Text-mTAve9R2.js";var O=Object.defineProperty,v=x((r,i)=>O(r,"name",{value:i,configurable:!0}),"L");const N=v((r,i,n,d)=>{if(!i||n===void 0||n<1||n>i.length)return d?u(a,{color:d,children:r}):u(a,{dimColor:!0,children:r});const o=i[n-1];return!o||o.length===0?d?u(a,{color:d,children:r}):u(a,{dimColor:!0,children:r}):J(o)},"renderHighlightedContent"),S=v((r,i,n)=>{const[d,o]=U(null),h=q(!1);return z(()=>{if(h.current=!1,!i){o(null);return}const e=A(i);if(!E(e)){o(null);return}return(async()=>{try{const f=await F([e],n),l=G(f,r,e,n);h.current||o(l.tokens)}catch{h.current||o(null)}})(),()=>{h.current=!0}},[r,i,n]),d},"useHighlightedLines"),R=v((r,i,n="chars")=>{const d=B(r),o=[];for(const h of d)for(const e of h.hunks){const f=`@@ -${e.oldStart},${e.oldLines} +${e.newStart},${e.newLines} @@`,l=[];let s=e.oldStart,c=e.newStart;for(const w of e.lines)w.startsWith("\\")||(w.startsWith("+")?l.push({content:w.slice(1),newLineNum:c++,type:"add"}):w.startsWith("-")?l.push({content:w.slice(1),oldLineNum:s++,type:"del"}):l.push({content:w.slice(1),newLineNum:c++,oldLineNum:s++,type:"context"}));if(i){const w=Q(l);for(const[L,t]of w)if(l[L].type==="del"&&l[t].type==="add"){const m=X(l[L].content,l[t].content,n);l[L].inlineDiff=m??void 0,l[L].pairedIndex=t,l[t].inlineDiff=m??void 0,l[t].pairedIndex=L}}o.push({header:f,lines:l})}return o},"parseDiffLines"),P=500,X=v((r,i,n="chars")=>{if(r.length>P||i.length>P)return null;const d=n==="words"?V(r,i):$(r,i),o=[],h=[];for(const e of d)e.removed?o.push({highlight:!0,value:e.value}):e.added?h.push({highlight:!0,value:e.value}):(o.push({highlight:!1,value:e.value}),h.push({highlight:!1,value:e.value}));return{addParts:h,delParts:o}},"computeInlineDiff"),y=v((r,i,n)=>u(W,{children:r.map((d,o)=>d.highlight?u(a,{backgroundColor:n,color:"white",children:d.value},o):u(a,{color:i,children:d.value},o))}),"renderInlineParts"),Q=v(r=>{const i=new Map;let n=0;for(;n<r.length;){const d=n;for(;n<r.length&&r[n].type==="del";)n++;const o=n,h=n;for(;n<r.length&&r[n].type==="add";)n++;const e=n,f=o-d,l=e-h,s=Math.min(f,l);for(let c=0;c<s;c++)i.set(d+c,h+c),i.set(h+c,d+c);n===d&&n++}return i},"findInlinePairs");function H({hunks:r,newHighlighted:i,oldHighlighted:n,showLineNumbers:d}){return u(p,{flexDirection:"column",children:r.map((o,h)=>g(p,{flexDirection:"column",children:[h>0?u(p,{marginBottom:0,marginTop:0,children:u(a,{dimColor:!0,children:"···"})}):void 0,u(a,{color:"cyan",dimColor:!0,children:o.header}),o.lines.map((e,f)=>{let l,s,c;switch(e.type){case"add":{s="+",c="green",l=e.inlineDiff?y(e.inlineDiff.addParts,"green","green"):N(e.content,i,e.newLineNum,"green");break}case"del":{s="-",c="red",l=e.inlineDiff?y(e.inlineDiff.delParts,"red","red"):N(e.content,n,e.oldLineNum,"red");break}default:{s=" ",c=void 0,l=N(e.content,n,e.oldLineNum);break}}return g(p,{children:[d?g(a,{color:c,dimColor:e.type==="context",children:[String(e.oldLineNum??"").padStart(4)," ",String(e.newLineNum??"").padStart(4)," "]}):void 0,u(a,{color:c,children:s}),l]},f)})]},h))})}x(H,"q");v(H,"UnifiedView");function I({hunks:r,newHighlighted:i,oldHighlighted:n,showLineNumbers:d,width:o}){const h=Math.floor(o/2)-1;return u(p,{flexDirection:"column",children:r.map((e,f)=>{const l=f>0?u(p,{marginBottom:0,marginTop:0,children:u(a,{dimColor:!0,children:"···"})}):void 0,s=[],c=[];for(let L=0;L<e.lines.length;L++){const t=e.lines[L];switch(t.type){case"add":{t.pairedIndex===void 0&&(s.push({content:u(a,{dimColor:!0})}),c.push({content:N(t.content,i,t.newLineNum,"green"),lineNum:t.newLineNum}));break}case"context":{s.push({content:N(t.content,n,t.oldLineNum),lineNum:t.oldLineNum}),c.push({content:N(t.content,i,t.newLineNum),lineNum:t.newLineNum});break}case"del":{if(t.pairedIndex===void 0)s.push({content:N(t.content,n,t.oldLineNum,"red"),lineNum:t.oldLineNum}),c.push({content:u(a,{dimColor:!0})});else{const m=e.lines[t.pairedIndex];s.push({content:t.inlineDiff?y(t.inlineDiff.delParts,"red","red"):N(t.content,n,t.oldLineNum,"red"),lineNum:t.oldLineNum}),c.push({content:m.inlineDiff?y(m.inlineDiff.addParts,"green","green"):N(m.content,i,m.newLineNum,"green"),lineNum:m.newLineNum})}break}}}const w=Math.max(s.length,c.length);return g(p,{flexDirection:"column",children:[l,u(a,{color:"cyan",dimColor:!0,children:e.header}),Array.from({length:w},(L,t)=>{const m=s[t],D=c[t];return g(p,{flexDirection:"row",children:[g(p,{width:h,children:[d?g(a,{dimColor:!0,children:[String(m?.lineNum??"").padStart(4)," "]}):void 0,m?.content]}),u(a,{dimColor:!0,children:"│"}),g(p,{width:h,children:[d?g(a,{dimColor:!0,children:[String(D?.lineNum??"").padStart(4)," "]}):void 0,D?.content]})]},t)})]},f)})})}x(I,"J");v(I,"SplitView");function Y({context:r=3,diff:i,inlineDiff:n=!0,inlineDiffMode:d="chars",language:o,mode:h="unified",newLabel:e="new",newText:f="",oldLabel:l="old",oldText:s="",showLineNumbers:c=!0,theme:w="github-dark-default"}){const{columns:L}=K(),t=S(s,o,w),m=S(f,o,w),D=k(()=>i||j("file",s,f,l,e,{context:r}),[i,s,f,l,e,r]),C=k(()=>R(D,n,d),[D,n,d]);if(C.every(T=>T.lines.length===0))return u(p,{children:u(a,{dimColor:!0,children:"No differences found."})});const b=g(p,{flexDirection:"column",children:[g(a,{color:"red",dimColor:!0,children:["--- ",l]}),g(a,{color:"green",dimColor:!0,children:["+++ ",e]})]});return h==="split"?g(p,{flexDirection:"column",children:[b,u(I,{hunks:C,newHighlighted:m,oldHighlighted:t,showLineNumbers:c,width:L??80})]}):g(p,{flexDirection:"column",children:[b,u(H,{hunks:C,newHighlighted:m,oldHighlighted:t,showLineNumbers:c})]})}x(Y,"K");v(Y,"DiffView");export{Y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var v=Object.defineProperty;var d=(l,r)=>v(l,"name",{value:r,configurable:!0});import{jsx as o,jsxs as u}from"react/jsx-runtime";import C from"./useWindowSize-yDZsXF8z.js";import i from"./Box-BwqSvWuq.js";import n from"./Text-mTAve9R2.js";var g=Object.defineProperty,b=d((l,r)=>g(l,"name",{value:r,configurable:!0}),"x");function G({character:l,color:r,dimColor:t=!1,label:h,labelPadding:x=1,length:e,orientation:m="horizontal"}){const{columns:w}=C(),a=l??(m==="horizontal"?"─":"│");if(m==="vertical"){const p=e??1;return o(i,{flexDirection:"column",height:p,children:Array.from({length:p},(j,s)=>o(n,{color:r,dimColor:t,children:a},`divider-row-${s}`))})}const c=Math.min(500,e??Math.max(w,1));if(h===void 0)return o(i,{flexGrow:e===void 0?1:0,width:e,children:o(n,{color:r,dimColor:t,wrap:"truncate",children:a.repeat(c)})});const f=" ".repeat(x);return u(i,{flexGrow:e===void 0?1:0,width:e,children:[o(i,{flexGrow:1,flexShrink:1,children:o(n,{color:r,dimColor:t,wrap:"truncate",children:a.repeat(c)})}),o(i,{flexShrink:0,children:u(n,{color:r,dimColor:t,children:[f,h,f]})}),o(i,{flexGrow:1,flexShrink:1,children:o(n,{color:r,dimColor:t,wrap:"truncate",children:a.repeat(c)})})]})}d(G,"L");b(G,"Divider");export{G as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var W=Object.defineProperty;var d=(e,r)=>W(e,"name",{value:r,configurable:!0});import{createRequire as Y}from"node:module";import{jsxs as f,jsx as g}from"react/jsx-runtime";import{useState as v,useRef as Q,useEffect as V,useCallback as F}from"react";import X from"./useInput-D1_jG26Z.js";import B from"./Box-BwqSvWuq.js";import Z from"./Spinner-B0-A50pu.js";import m from"./Text-mTAve9R2.js";const J=Y(import.meta.url),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,E=d(e=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[r,c]=x.versions.node.split(".").map(Number);if(r>22||r===22&&c>=3||r===20&&c>=16)return x.getBuiltinModule(e)}return J(e)},"__cjs_getBuiltinModule"),{readdir:ee,stat:re}=E("node:fs/promises"),{resolve:k,dirname:ie,join:q,extname:te}=E("node:path");var oe=Object.defineProperty,D=d((e,r)=>oe(e,"name",{value:r,configurable:!0}),"o");function H(e){const r=D(c=>`${c&4?"r":"-"}${c&2?"w":"-"}${c&1?"x":"-"}`,"rwx");return`${r(e>>6&7)}${r(e>>3&7)}${r(e&7)}`}d(H,"q");D(H,"formatPermissions");function R(e,r){if(!(r.showHidden??!1)&&e.isHidden||!(r.showDirectories??!0)&&e.isDirectory||!(r.showFiles??!0)&&!e.isDirectory)return!1;if(r.extensions&&r.extensions.length>0&&!e.isDirectory){const c=te(e.name);if(!r.extensions.includes(c))return!1}return!0}d(R,"B");D(R,"matchesFilter");function G(e){const{filter:r,initialPath:c}=e,[h,b]=v(()=>k(c)),[j,l]=v([]),[M,w]=v(!0),[S,P]=v(),[$,o]=v(0),C=Q(r);C.current=r,V(()=>{let n=!1;return D(async()=>{w(!0),P(void 0);try{const s=await ee(h,{withFileTypes:!0}),_=await Promise.all(s.map(async i=>{try{return await re(q(h,i.name))}catch{return}})),z=s.map((i,t)=>{const T=q(h,i.name),L=i.isDirectory(),K=i.name.startsWith("."),A=_[t],O=A?.size??0,N=A?H(A.mode):"---------";return{isDirectory:L,isHidden:K,name:i.name,path:T,permissions:N,size:O}});if(n)return;const a=z.filter(i=>R(i,C.current));a.sort((i,t)=>i.isDirectory!==t.isDirectory?i.isDirectory?-1:1:i.name.localeCompare(t.name,void 0,{sensitivity:"base"})),l(a)}catch(s){n||(P(s instanceof Error?s.message:String(s)),l([]))}finally{n||w(!1)}},"loadDirectory")().catch(()=>{}),()=>{n=!0}},[h,$]);const u=F(n=>{b(k(n))},[]),p=F(()=>{b(n=>{const s=ie(n);return s===n?n:s})},[]),y=F(()=>{o(n=>n+1)},[]);return{currentPath:h,entries:j,error:S,goUp:p,isLoading:M,navigateTo:u,refresh:y}}d(G,"G$1");D(G,"useFileSystem");var ne=Object.defineProperty,U=d((e,r)=>ne(e,"name",{value:r,configurable:!0}),"u");function I(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}K`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)}M`:`${(e/(1024*1024*1024)).toFixed(1)}G`}d(I,"U");U(I,"formatSize");const se={},ae=U(()=>process.cwd(),"getDefaultInitialPath"),ye=U(({accentColor:e="cyan",directoryColor:r="blue",fileColor:c="white",filter:h=se,initialPath:b,isFocused:j=!0,limit:l=10,onCancel:M,onSelect:w,showPermissions:S=!1,showSize:P=!1})=>{const $=b??ae(),o=G({filter:h,initialPath:$}),[C,u]=v(0),p=Math.max(0,o.entries.length-1),y=Math.min(C,p);X(F((a,i)=>{if(i.upArrow)u(t=>Math.max(0,t-1));else if(i.downArrow)u(t=>Math.min(p,t+1));else if(i.return){const t=o.entries[y];t&&(t.isDirectory?(o.navigateTo(t.path),u(0)):w?.(t))}else i.backspace||i.leftArrow?(o.goUp(),u(0)):i.escape?M?.():a==="."?o.refresh():i.pageUp?u(t=>Math.max(0,t-l)):i.pageDown?u(t=>Math.min(p,t+l)):i.home?u(0):i.end&&u(p)},[p,y,o,l,w,M]),{isActive:j});const n=Math.floor(l/2);let s=Math.max(0,y-n);const _=Math.min(o.entries.length,s+l);s=Math.max(0,_-l);const z=o.entries.slice(s,_);return f(B,{flexDirection:"column",children:[g(m,{bold:!0,dimColor:!0,children:o.currentPath}),o.isLoading&&f(B,{children:[g(Z,{}),g(m,{children:" Loading..."})]}),o.error&&f(m,{color:"red",children:["Error:",o.error]}),!o.isLoading&&!o.error&&o.entries.length===0&&g(m,{dimColor:!0,children:"(empty directory)"}),z.map((a,i)=>{const t=s+i===y,T=a.isDirectory?"📁 ":"📄 ",L=a.isDirectory?r:c;return f(B,{children:[g(m,{color:t?e:void 0,children:t?"▸ ":" "}),g(m,{children:T}),f(m,{bold:a.isDirectory,color:t?e:L,children:[a.name,a.isDirectory?"/":""]}),P&&!a.isDirectory&&f(m,{dimColor:!0,children:[" ",I(a.size)]}),S&&f(m,{dimColor:!0,children:[" ",a.permissions]})]},a.name)}),o.entries.length>l&&f(m,{dimColor:!0,children:[y+1,"/",o.entries.length]})]})},"FilePicker");export{ye as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var S=Object.defineProperty;var p=(c,u)=>S(c,"name",{value:u,configurable:!0});import j,{createContext as k,useRef as O,useState as I,useCallback as s,useMemo as N,useContext as M,useEffect as C}from"react";var R=Object.defineProperty,b=p((c,u)=>R(c,"name",{value:u,configurable:!0}),"x");const m=k({activate(){},activeId:void 0,add(){},deactivate(){},disableFocus(){},enableFocus(){},focus(){},focusNext(){},focusPrevious(){},remove(){}});m.displayName="TuiFocusContext";const w=b(({children:c})=>{const u=O([]),[n,o]=I(void 0),[a,v]=I(!0),f=s((t,e)=>{if(u.current.some(r=>r.id===t))return;const d={autoFocus:e.autoFocus,id:t,isActive:!0};u.current=[...u.current,d],o(r=>e.autoFocus&&r===void 0||u.current.filter(E=>E.isActive).length===1&&r===void 0?t:r)},[]),l=s(t=>{u.current=u.current.filter(e=>e.id!==t),o(e=>e===t?void 0:e)},[]),F=s(t=>{u.current=u.current.map(e=>e.id===t?{...e,isActive:!0}:e)},[]),i=s(t=>{u.current=u.current.map(e=>e.id===t?{...e,isActive:!1}:e),o(e=>e===t?void 0:e)},[]),x=s(()=>v(!0),[]),g=s(()=>{v(!1),o(void 0)},[]),A=s(()=>{if(!a)return;const t=u.current.filter(e=>e.isActive);t.length!==0&&o(e=>{if(e===void 0)return t[0]?.id;const d=t.findIndex(r=>r.id===e);return t[(d+1)%t.length]?.id??t[0]?.id})},[a]),h=s(()=>{if(!a)return;const t=u.current.filter(e=>e.isActive);t.length!==0&&o(e=>{if(e===void 0)return t.at(-1)?.id;const d=t.findIndex(r=>r.id===e);return t[(d-1+t.length)%t.length]?.id??t.at(-1)?.id})},[a]),P=s(t=>{a&&u.current.some(e=>e.id===t&&e.isActive)&&o(t)},[a]),y=N(()=>({activate:F,activeId:n,add:f,deactivate:i,disableFocus:g,enableFocus:x,focus:P,focusNext:A,focusPrevious:h,remove:l}),[n,f,l,F,i,x,g,A,h,P]);return j.createElement(m.Provider,{value:y},c)},"FocusProvider"),z=b(({autoFocus:c=!1,id:u,isActive:n=!0}={})=>{const{activate:o,activeId:a,add:v,deactivate:f,focus:l,remove:F}=M(m),i=N(()=>u??Math.random().toString(36).slice(2,7),[u]);return C(()=>(v(i,{autoFocus:c}),()=>{F(i)}),[i,c]),C(()=>{n?o(i):f(i)},[n,i]),{focus:l,isFocused:!!i&&a===i}},"useFocus"),B=b(()=>{const c=M(m);return{activeId:c.activeId,disableFocus:c.disableFocus,enableFocus:c.enableFocus,focus:c.focus,focusNext:c.focusNext,focusPrevious:c.focusPrevious}},"useFocusManager");export{m as FocusContext,w as FocusProvider,z as useFocus,B as useFocusManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var u=(e,i)=>s(e,"name",{value:i,configurable:!0});import{jsxs as m,jsx as r}from"react/jsx-runtime";import o from"./Box-BwqSvWuq.js";import d from"./Text-mTAve9R2.js";var f=Object.defineProperty,v=u((e,i)=>f(e,"name",{value:i,configurable:!0}),"f");const b=v(({children:e,description:i,error:l,isDisabled:n=!1,label:c,required:t=!1})=>m(o,{flexDirection:"column",marginBottom:1,children:[m(o,{children:[r(d,{bold:!0,dimColor:n,children:c}),t?r(d,{color:"red",children:" *"}):void 0]}),r(o,{marginTop:0,children:e}),l===void 0?i===void 0?void 0:r(d,{dimColor:!0,children:i}):r(d,{color:"red",children:l})]}),"FormField"),C=Object.assign(({accentColor:e="blue",bordered:i=!0,children:l,description:n,footer:c,title:t,width:h})=>{const a=m(o,{flexDirection:"column",children:[t===void 0?void 0:r(o,{marginBottom:1,children:r(d,{bold:!0,color:e,children:t})}),n===void 0?void 0:r(o,{marginBottom:1,children:r(d,{dimColor:!0,children:n})}),r(o,{flexDirection:"column",children:l}),c===void 0?void 0:r(o,{marginTop:1,children:c})]});return i?r(o,{borderColor:e,borderStyle:"round",flexDirection:"column",paddingX:1,paddingY:1,width:h,children:a}):r(o,{flexDirection:"column",width:h,children:a})},{Field:b});export{b as FormField,C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=Object.defineProperty;var o=(r,e)=>i(r,"name",{value:e,configurable:!0});import{jsx as n}from"react/jsx-runtime";import"react";import m from"./Box-BwqSvWuq.js";import l from"./useWindowSize-yDZsXF8z.js";var c=Object.defineProperty,a=o((r,e)=>c(r,"name",{value:e,configurable:!0}),"t");const h=a(({children:r})=>{const{columns:e,rows:t}=l();return n(m,{flexGrow:1,height:t,width:e,children:r})},"Fullscreen");export{h as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var Y=Object.defineProperty;var w=(o,e)=>Y(o,"name",{value:e,configurable:!0});import{jsxs as C,jsx as h}from"react/jsx-runtime";import{useMemo as B}from"react";import{c as Z}from"./braille-BBjIoaN0.js";import d from"./Box-BwqSvWuq.js";import _ from"./Canvas-CKg6WV47.js";import x from"./Text-mTAve9R2.js";var $=Object.defineProperty,v=w((o,e)=>$(o,"name",{value:e,configurable:!0}),"g");const q={large:{cols:40,rows:10},medium:{cols:24,rows:6},small:{cols:16,rows:4}},R=.9,oo=2,ro=v(o=>String(Math.round(o)),"defaultFormat"),O=v((o,e,s,i)=>{const t=e+(s-e)*i;for(const f of o)if(t<=f.max)return f;return o[o.length-1]},"thresholdAtRatio");function to({backgroundColor:o="gray",formatValue:e=ro,label:s,max:i=100,min:t=0,showLegend:f=!1,showValue:P=!0,size:z="medium",thresholds:n,value:D}){const{cols:E,rows:G}=q[z],F=Math.max(t,Math.min(i,D)),H=i-t||1,M=(F-t)/H,m=B(()=>{if(!(n===void 0||n.length===0))return[...n].toSorted((r,c)=>r.max-c.max)},[n]),I=B(()=>{if(m!==void 0)return O(m,t,i,M)},[m,t,i,M]),J=e(F);return C(d,{flexDirection:"column",children:[h(_,{draw:w(r=>{r.clear();const c=r.width*2,L=r.height*4,y=c/2,b=L-1,K=c/2-1,N=L-1,g=Math.max(1,Math.min(K,N)),j=new Map,S=v(a=>{const l=j.get(a);if(l!==void 0)return l;const u=Z(r.width,r.height);return j.set(a,u),u},"gridFor"),V=Math.max(32,Math.round(Math.PI*g)*oo);for(let a=0;a<=V;a+=1){const l=a/V,u=Math.PI*(1-l),W=Math.round(y+g*Math.cos(u)),X=Math.round(b-g*Math.sin(u));let p;l>M?p=o:m?p=O(m,t,i,l)?.color??"cyan":p="cyan",S(p).plotPoint(W,X)}const k=g*R,A=Math.PI*(1-M),Q=Math.round(y+k*Math.cos(A)),T=Math.round(b-k*Math.sin(A)),U=I?.color??"white";S(U).plotLine(Math.round(y),Math.round(b),Q,T);for(const[a,l]of j)l.flush(r,{color:a})},"draw"),height:G,version:[D,t,i,z,n,o],width:E}),P||s?C(d,{flexDirection:"column",children:[s===void 0?void 0:h(d,{justifyContent:"center",children:h(x,{dimColor:!0,children:s})}),P?h(d,{justifyContent:"center",children:h(x,{bold:!0,color:I?.color??"white",children:J})}):void 0]}):void 0,f&&n&&n.length>0?h(d,{gap:2,justifyContent:"center",marginTop:1,children:n.map((r,c)=>C(d,{gap:1,children:[h(x,{color:r.color,children:"●"}),h(x,{dimColor:!0,children:r.label??`≤ ${r.max}`})]},c))}):void 0]})}w(to,"ee");v(to,"Gauge");export{to as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var D=Object.defineProperty;var y=(o,e)=>D(o,"name",{value:e,configurable:!0});import{jsx as a,Fragment as K}from"react/jsx-runtime";import{strip as N}from"@visulima/ansi";import{multilineGradient as k}from"@visulima/colorize/gradient";import{useMemo as z,Children as w,isValidElement as P,cloneElement as v}from"react";import $ from"./Box-BwqSvWuq.js";import C from"./Text-mTAve9R2.js";import g from"./Transform-fYmcdqRT.js";var B=Object.defineProperty,n=y((o,e)=>B(o,"name",{value:e,configurable:!0}),"o");const G={atlas:{colors:["#feac5e","#c779d0","#4bc0c8"]},cristal:{colors:["#bdfff3","#4ac29a"]},fruit:{colors:["#ff4e50","#f9d423"]},instagram:{colors:["#833ab4","#fd1d1d","#fcb045"]},mind:{colors:["#473b7b","#3584a7","#30d2be"]},morning:{colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},passion:{colors:["#f43b47","#453a94"]},pastel:{colors:["#74ebd5","#74ecd5"],options:{hsvSpin:"long",interpolation:"hsv"}},rainbow:{colors:["#ff0000","#ff0100"],options:{hsvSpin:"long",interpolation:"hsv"}},retro:{colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"]},summer:{colors:["#fdbb2d","#22c1c3"]},teen:{colors:["#77a1d3","#79cbca","#e684ae"]},vice:{colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}}},O=n(o=>{let e=!1;const t=n(h=>{w.forEach(h,s=>{if(e||!P(s))return;if(s.type===$){e=!0;return}const f=s.props;Object.hasOwn(f,"children")&&t(f.children)})},"search");return t(o),e},"containsBoxDescendant"),T=n(o=>Object.hasOwn(o,"children"),"hasChildrenProp"),S=n(o=>typeof o=="string"||typeof o=="number","isPlainTextNode"),F=n(o=>o==null||typeof o=="boolean","isNonRenderableChild");function M({children:o,colors:e,name:t}){if(t&&e)throw new Error("The `name` and `colors` props are mutually exclusive");if(!t&&!e)throw new Error("Either `name` or `colors` prop must be provided");const h=z(()=>t?k(G[t].colors,G[t].options):k(e??[]),[t,e]),s=n(b=>h(N(b)),"applyGradient"),f=w.count(o);if(S(o))return a(g,{transform:s,children:o});if(f===1&&!O(o))return a(g,{transform:s,children:o});const m=n(b=>{const c=[];let l="",E=0;const x=n(()=>{const r=`gradient-node-${String(E)}`;return E+=1,r},"createKey"),p=n((r,i)=>{c.push(a(g,{transform:s,children:r},i))},"pushTransformed"),j=n(()=>{if(l==="")return;const r=l;l="",p(a(C,{children:r}),x())},"flushText");return w.forEach(b,r=>{if(!F(r)){if(S(r)){l+=String(r);return}if(j(),P(r)){const i=r.key??x(),d=r.props;if(r.type===C){p(r,i);return}if(r.type===$){if(T(d)){const u=d.children;c.push(v(r,{key:i},m(u)));return}c.push(v(r,{key:i}));return}if(T(d)){const u=d.children;if(!O(u)){p(r,i);return}c.push(v(r,{key:i},m(u)));return}p(r,i);return}c.push(r)}}),j(),c},"applyGradientToChildren");return a(K,{children:m(o)})}y(M,"D");n(M,"Gradient");export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Object.defineProperty;var i=(e,r)=>t(e,"name",{value:r,configurable:!0});import{jsx as c,jsxs as a}from"react/jsx-runtime";import u from"./Box-BwqSvWuq.js";import d from"./Text-mTAve9R2.js";var f=Object.defineProperty,m=i((e,r)=>f(e,"name",{value:r,configurable:!0}),"t");const g={1:"blueBright",2:"cyanBright",3:"magentaBright",4:"yellowBright",5:"green",6:"white"},h={1:"# ",2:"## ",3:"### ",4:"#### ",5:"##### ",6:"###### "};function s({children:e,color:r,level:n=1,underline:l=!1}){const o=r??g[n];return c(u,{flexDirection:"column",children:a(d,{bold:n<=2,color:o,underline:l,children:[h[n],e]})})}i(s,"s");m(s,"Heading");export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var P=Object.defineProperty;var v=(r,a)=>P(r,"name",{value:a,configurable:!0});import{jsxs as j,jsx as l}from"react/jsx-runtime";import{useMemo as z}from"react";import f from"./Box-BwqSvWuq.js";import E from"./Canvas-CKg6WV47.js";import y from"./Text-mTAve9R2.js";var H=Object.defineProperty,O=v((r,a)=>H(r,"name",{value:a,configurable:!0}),"A");const R=["#0b1e4f","#1f3b96","#3258c8","#4e84ec","#78b0ff"];function U({cellWidth:r=2,character:a="█",columnLabels:g,data:i,max:d,min:m,palette:x=R,rowLabels:w,textColor:L}){const{cols:M,colWidth:u,extent:W,rows:p}=z(()=>{const t=i.length,e=i.reduce((c,o)=>Math.max(c,o.length),0);let n=m??1/0,h=d??-1/0;if(m===void 0||d===void 0)for(const c of i)for(const o of c)m===void 0&&o<n&&(n=o),d===void 0&&o>h&&(h=o);return{cols:e,colWidth:r,extent:{max:h,min:n},rows:t}},[i,m,d,r]),k=M*u,A=p;return j(f,{children:[w===void 0?void 0:l(f,{flexDirection:"column",marginRight:1,children:Array.from({length:p},(t,e)=>l(y,{dimColor:!0,children:w[e]??""},e))}),j(f,{flexDirection:"column",children:[l(E,{draw:v(t=>{t.clear();const{max:e,min:n}=W,h=e-n||1,c=x.length-1;for(let o=0;o<p;o+=1)for(let s=0;s<M;s+=1){const C=i[o]?.[s],D=C===void 0?void 0:x[Math.max(0,Math.min(c,Math.round((C-n)/h*c)))];for(let b=0;b<u;b+=1)t.setCell(s*u+b,o,a,{background:D,color:L})}},"draw"),height:A,version:[i,x,r,m,d],width:k}),g===void 0?void 0:l(f,{children:g.map((t,e)=>l(f,{width:u,children:l(y,{dimColor:!0,wrap:"truncate-end",children:t})},e))})]})]})}v(U,"U");O(U,"Heatmap");export{U as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var j=Object.defineProperty;var p=(o,r)=>j(o,"name",{value:r,configurable:!0});import{jsx as n,jsxs as y}from"react/jsx-runtime";import D from"./useWindowSize-yDZsXF8z.js";import u from"./Box-BwqSvWuq.js";import i from"./Text-mTAve9R2.js";var v=Object.defineProperty,h=p((o,r)=>v(o,"name",{value:r,configurable:!0}),"u");const g={backspace:"backspace",delete:"del",downArrow:"↓",end:"end",escape:"esc",home:"home",leftArrow:"←",pageDown:"pgdn",pageUp:"pgup",return:"enter",rightArrow:"→",tab:"tab",upArrow:"↑"};function b(o){const r=o.indexOf("+");if(r!==-1){const e=o.slice(0,r),t=o.slice(r+1);return`${e}+${g[t]??t}`}return g[o]??o}p(b,"R");h(b,"formatKeyLabel");function C(o){return(typeof o=="string"?[o]:o).map(r=>b(r)).join("/")}p(C,"x");h(C,"formatKeys");function M({bindings:o,descriptionColor:r,keyColor:e="cyan",maxColumns:t=3,mode:l="short",separator:s=" · "}){const{columns:d}=D();return l==="full"?w(o,{columns:d,descriptionColor:r,keyColor:e,maxColumns:t}):k(o,{columns:d,descriptionColor:r,keyColor:e,separator:s})}p(M,"w");h(M,"Help");function k(o,r){const e=[];let t=0;for(const[l,s]of o.entries()){const d=C(s.key),a=`${d} ${s.description}`,c=(l>0?r.separator.length:0)+a.length;if(t+c>r.columns&&e.length>0)break;l>0&&e.push(n(i,{dimColor:!0,children:r.separator},`sep-${l}`)),e.push(y(u,{children:[n(i,{color:r.keyColor,children:d}),n(i,{children:" "}),r.descriptionColor?n(i,{color:r.descriptionColor,children:s.description}):n(i,{dimColor:!0,children:s.description})]},`pair-${l}`)),t+=c}return n(u,{flexDirection:"row",children:e})}p(k,"T");h(k,"renderShort");function w(o,r){const e=new Map;for(const a of o){const c=a.group??"";e.has(c)||e.set(c,[]),e.get(c).push(a)}const t=[...e.entries()],l=Math.min(r.maxColumns,t.length||1),s=Math.floor(r.columns/l),d=[];for(const[a,[c,x]]of t.entries()){const m=[];c&&m.push(n(i,{bold:!0,children:c},"title"));for(const[$,f]of x.entries()){const A=C(f.key);m.push(y(u,{children:[n(i,{color:r.keyColor,children:A}),n(i,{children:" "}),r.descriptionColor?n(i,{color:r.descriptionColor,children:f.description}):n(i,{dimColor:!0,children:f.description})]},`b-${$}`))}d.push(n(u,{flexDirection:"column",width:s,children:m},`col-${a}`))}return n(u,{flexDirection:"row",children:d})}p(w,"A");h(w,"renderFull");export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var b=Object.defineProperty;var c=(e,t)=>b(e,"name",{value:t,configurable:!0});import{jsx as p}from"react/jsx-runtime";import{useMemo as v}from"react";import w from"./BarChart-rpZtlMcF.js";var y=Object.defineProperty,m=c((e,t)=>y(e,"name",{value:t,configurable:!0}),"c");const x=m((e,t,r)=>{if(r<=0||e>=t)return[e,t];const h=(t-e)/r;return Array.from({length:r+1},(n,o)=>e+o*h)},"computeThresholds"),g=m((e,t)=>{if(t.length<2)return[];const r=Array.from({length:t.length-1}).fill(0),h=t[0],n=t[t.length-1];for(const o of e)if(!(o<h||o>n))for(let l=0;l<t.length-1;l+=1){const a=l===t.length-2,f=t[l+1];if(o<f||a&&o<=f){r[l]=(r[l]??0)+1;break}}return r.map((o,l)=>{const a=t[l],f=t[l+1];return{count:o,label:`${Math.round(a)}-${Math.round(f)}`}})},"binData");function A({bins:e=10,color:t,data:r,height:h=10,max:n,min:o,showValues:l=!1,thresholds:a,width:f}){const d=v(()=>{if(a&&a.length>=2)return g(r,a);if(r.length===0)return[];let i=o??1/0,u=n??-1/0;if(o===void 0||n===void 0)for(const s of r)o===void 0&&s<i&&(i=s),n===void 0&&s>u&&(u=s);return i===u?[{count:r.length,label:i.toString()}]:g(r,x(i,u,e))},[r,a,e,o,n]);return p(w,{data:d.map(i=>({color:t,label:i.label,value:i.count})),height:h,orientation:"vertical",showLabels:!0,showValues:l,width:f})}c(A,"w");m(A,"Histogram");export{A as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=Object.defineProperty;var s=(i,t)=>o(i,"name",{value:t,configurable:!0});var u=Object.defineProperty,r=s((i,t)=>u(i,"name",{value:t,configurable:!0}),"r");const f=r(i=>{if(i.length===0)return!1;for(const t of i){const e=t.codePointAt(0)??0;return!(e<=127||e<=255)}return!1},"isIMEInput");class n{static{s(this,"n")}static{r(this,"IMECompositionBuffer")}buffer="";timer;onFlush;timeout;constructor({onFlush:t,timeout:e}){this.onFlush=t,this.timeout=e}add(t){this.buffer+=t,this.timer!==void 0&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.flush()},this.timeout)}flush(){if(this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0),this.buffer.length>0){const t=this.buffer;this.buffer="",this.onFlush(t)}}destroy(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0),this.buffer=""}}export{n as IMECompositionBuffer,f as isIMEInput};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var p=Object.defineProperty;var d=(r,t)=>p(r,"name",{value:t,configurable:!0});import c from"eventemitter3";var B=Object.defineProperty,x=d((r,t)=>B(r,"name",{value:t,configurable:!0}),"h");class b extends c{static{d(this,"InputParser")}constructor(t){super(),this.stdin=t}stdin;static{x(this,"InputParser")}_boundHandleData=null;_pasteBuffer=null;start(){typeof this.stdin.setRawMode=="function"&&this.stdin.setRawMode(!0),this.stdin.resume(),this.stdin.setEncoding("utf8"),this._boundHandleData=this.handleData.bind(this),this.stdin.on("data",this._boundHandleData)}stop(){typeof this.stdin.setRawMode=="function"&&this.stdin.setRawMode(!1),this.stdin.pause(),this._boundHandleData&&(this.stdin.removeListener("data",this._boundHandleData),this._boundHandleData=null)}handleData(t){if(t===""){this.emit("exit");return}if(t.includes("\x1B[200~")||this._pasteBuffer!==null){if(this._pasteBuffer===null?this._pasteBuffer=t.replace("\x1B[200~",""):this._pasteBuffer+=t,this._pasteBuffer.includes("\x1B[201~")){const e=this._pasteBuffer.replace("\x1B[201~","");this._pasteBuffer=null,this.emit("paste",e),this.listenerCount("paste")===0&&this.emit("data",e)}return}if(t.length===1){const e=t.charCodeAt(0);if(e>=1&&e<=26&&e!==3&&e!==9&&e!==10&&e!==13){const s=String.fromCharCode(e+96);this.emit("ctrl",s),this.emit("data",t,{ctrl:!0});return}}if(t==="\x1B[A"){this.emit("keydown","up");return}if(t==="\x1B[B"){this.emit("keydown","down");return}if(t==="\x1B[C"){this.emit("keydown","right");return}if(t==="\x1B[D"){this.emit("keydown","left");return}if(t===" "){this.emit("keydown","tab");return}if(t==="\x1B[Z"){this.emit("keydown","shift-tab");return}if(t==="\x1B"){this.emit("keydown","escape");return}if(t==="\r"||t===`
|
|
2
|
+
`){this.emit("keydown","enter");return}if(t===""){this.emit("keydown","backspace");return}if(t==="\x1B[3~"){this.emit("keydown","delete");return}if(t==="\x1B[5~"){this.emit("keydown","pageUp");return}if(t==="\x1B[6~"){this.emit("keydown","pageDown");return}if(t==="\x1B[H"||t==="\x1B[1~"){this.emit("keydown","home");return}if(t==="\x1B[F"||t==="\x1B[4~"){this.emit("keydown","end");return}if(t.length===2&&t[0]==="\x1B"){this.emit("meta",t[1]),this.emit("data",t,{meta:!0});return}if(t.startsWith("\x1B[<")){const e=t.match(/\u001B\[<(\d+);(\d+);(\d+)(M)/i);if(e){const s=Number.parseInt(e[1]),u=Number.parseInt(e[2])-1,h=Number.parseInt(e[3])-1,a=e[4]==="m",o=(s&4)!==0,f=(s&8)!==0,l=(s&16)!==0,n=s&-29;let i=null;if(n===0&&!a?i="left":n===1&&!a?i="middle":n===2&&!a?i="right":n===64?i="scrollUp":n===65&&(i="scrollDown"),i){const m={button:i,ctrl:l,meta:f,shift:o,x:u,y:h};this.emit("mouse",m),i==="left"&&this.emit("click",{x:u,y:h})}}return}this.emit("data",t)}}export{b as InputParser};
|
|
@@ -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}),"o");const p={backspace:"",ctrlC:"",delete:"\x1B[3~",down:"\x1B[B",end:"\x1B[F",escape:"\x1B",home:"\x1B[H",left:"\x1B[D",pageDown:"\x1B[6~",pageUp:"\x1B[5~",return:"\r",right:"\x1B[C",space:" ",tab:" ",up:"\x1B[A"},s=a(e=>({backspace:a(()=>{e(p.backspace)},"backspace"),delete:a(()=>{e(p.delete)},"delete"),down:a(()=>{e(p.down)},"down"),end:a(()=>{e(p.end)},"end"),enter:a(()=>{e(p.return)},"enter"),escape:a(()=>{e(p.escape)},"escape"),home:a(()=>{e(p.home)},"home"),left:a(()=>{e(p.left)},"left"),pageDown:a(()=>{e(p.pageDown)},"pageDown"),pageUp:a(()=>{e(p.pageUp)},"pageUp"),press(t){e(t)},raw:e,right:a(()=>{e(p.right)},"right"),space:a(()=>{e(p.space)},"space"),tab:a(()=>{e(p.tab)},"tab"),type(t){for(const c of t)e(c)},up:a(()=>{e(p.up)},"up")}),"createKeySender");export{p as KEY,s as createKeySender};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=Object.defineProperty;var e=(r,o)=>i(r,"name",{value:o,configurable:!0});import{jsxs as t,jsx as l}from"react/jsx-runtime";import a from"./Box-BwqSvWuq.js";import d from"./Text-mTAve9R2.js";var c=Object.defineProperty,u=e((r,o)=>c(r,"name",{value:o,configurable:!0}),"l");function m({children:r,color:o="gray",variant:n="solid"}){return n==="solid"?t(d,{backgroundColor:o,color:"black",children:[" ",r," "]}):n==="outline"?l(a,{borderColor:o,borderStyle:"round",paddingX:1,children:l(d,{color:o,children:r})}):l(d,{dimColor:!0,children:r})}e(m,"d");u(m,"Kbd");export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var g=(d,t)=>c(d,"name",{value:t,configurable:!0});import a from"yoga-layout";import{m as y}from"./text-width-CZ9vPvM0.js";var u=Object.defineProperty,N=g((d,t)=>u(d,"name",{value:t,configurable:!0}),"h");const l=new Map;class E{static{g(this,"LayoutNode")}static{N(this,"LayoutNode")}yogaNode;children=[];parent=null;_destroyed=!1;_hidden=!1;transform;_text;fg=255;bg=255;styles=0;_style;set text(t){this._text=t,t===void 0?this.yogaNode.unsetMeasureFunc():this.yogaNode.setMeasureFunc((e,o,r,n)=>{if(t.length===0)return{height:0,width:0};const i=y(t,Number.MAX_SAFE_INTEGER);let s=i.maxLineWidth;o===a.MEASURE_MODE_EXACTLY?s=Math.max(0,Math.floor(e)):o===a.MEASURE_MODE_AT_MOST&&(s=Math.min(i.maxLineWidth,Math.max(0,Math.floor(e))));let h=i.wrappedRows;return s>0&&(h=y(t,s).wrappedRows),n===a.MEASURE_MODE_EXACTLY?h=Math.max(0,Math.floor(r)):n===a.MEASURE_MODE_AT_MOST&&(h=Math.min(h,Math.max(0,Math.floor(r)))),{height:h,width:s}})}get text(){return this._text}constructor(){this.yogaNode=a.Node.create(),this.yogaNode.setFlexDirection(a.FLEX_DIRECTION_COLUMN)}insertChild(t,e){const o=l.get(t.yogaNode);o&&o.removeChild(t);const r=t.yogaNode.getParent();r&&r.removeChild(t.yogaNode);const n=this.yogaNode.getChildCount(),i=Math.min(e,n);try{this.yogaNode.insertChild(t.yogaNode,i)}catch{return}t.parent=this,this.children.splice(i,0,t),l.set(t.yogaNode,this)}remove(){this.parent&&this.parent.removeChild(this)}removeChild(t){const e=this.children.indexOf(t);if(e!==-1){this.children.splice(e,1),t.parent=null,l.delete(t.yogaNode);const o=t.yogaNode.getParent();o&&o.removeChild(t.yogaNode)}}destroy(){if(this._destroyed)return;this._destroyed=!0;for(const e of this.children)e.parent===this&&(e.parent=null);this.children=[],l.delete(this.yogaNode);const t=this.yogaNode.getParent();t&&t.removeChild(this.yogaNode),this.yogaNode.free()}calculateLayout(t,e){this.yogaNode.setWidth(t),this.yogaNode.setHeight(e),this.yogaNode.calculateLayout(t,e,a.DIRECTION_LTR)}getLayout(){return this.yogaNode.getComputedLayout()}}export{E as LayoutNode};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"react/jsx-runtime";import"react";import"./braille-BBjIoaN0.js";import"./Box-BwqSvWuq.js";import"./Canvas-CKg6WV47.js";import{E as s,d,a as n}from"./line-chart-DrM8PwnI.js";import"./Text-mTAve9R2.js";export{s as default,d as drawSeriesOnCanvas,n as projectPoint};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var o=(r,e)=>f(r,"name",{value:e,configurable:!0});import{jsx as u}from"react/jsx-runtime";import{hyperlink as a}from"@visulima/ansi";import{useCallback as l}from"react";import m from"./Text-mTAve9R2.js";import R from"./Transform-fYmcdqRT.js";var v=Object.defineProperty,i=o((r,e)=>v(r,"name",{value:e,configurable:!0}),"s");let p;const d=i(()=>{if(!process.stdout.isTTY)return!1;const r=process.env.TERM_PROGRAM??"",e=process.env.TERM_PROGRAM_VERSION??"";if(r==="iTerm.app")return Number.parseInt(e.split(".")[0]??"0",10)>=3;if(r==="WezTerm"||r==="ghostty")return!0;if(r==="vscode"){const s=e.split("."),n=Number.parseInt(s[0]??"0",10),c=Number.parseInt(s[1]??"0",10);return n>1||n===1&&c>=72}if(process.env.WT_SESSION)return!0;const t=process.env.VTE_VERSION;if(t){const s=Number.parseInt(t,10);return s>=5e3&&s!==5e3}return!1},"detectHyperlinkSupport"),E=i(()=>process.env.FORCE_HYPERLINK?process.env.FORCE_HYPERLINK!=="0":(p!==void 0||(p=d()),p),"supportsHyperlinks");function I({children:r,fallback:e=!0,url:t}){const s=l(n=>E()?a(n,t):e===!1?n:typeof e=="function"?e(n,t):`${n} ${t}`,[e,t]);return u(R,{transform:s,children:u(m,{children:r})})}o(I,"y");i(I,"Link");export{I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var e=(r,o)=>a(r,"name",{value:o,configurable:!0});import{jsxs as c,jsx as t}from"react/jsx-runtime";import d from"./Box-BwqSvWuq.js";import l from"./Spinner-B0-A50pu.js";import i from"./Text-mTAve9R2.js";var p=Object.defineProperty,m=e((r,o)=>p(r,"name",{value:o,configurable:!0}),"t");function f({children:r,color:o="cyan",type:n="dots"}){return c(d,{gap:1,children:[t(i,{color:o,children:t(l,{type:n})}),r===void 0?void 0:t(i,{color:o,children:r})]})}e(f,"l");m(f,"LoadingIndicator");export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var M=Object.defineProperty;var u=(c,t)=>M(c,"name",{value:t,configurable:!0});import{jsx as r,jsxs as w}from"react/jsx-runtime";import{Lexer as W}from"marked";import b,{useMemo as L}from"react";import q from"./useWindowSize-yDZsXF8z.js";import s from"./Box-BwqSvWuq.js";import A from"./Code-HhevcyiH.js";import B from"./Link-i2o2EG4-.js";import v from"./Newline-BSG4iUqp.js";import D from"./OrderedList-BeDy035w.js";import E from"./Table-DJp1TLrR.js";import m from"./Text-mTAve9R2.js";import I from"./UnorderedList-BnfqexZs.js";var P=Object.defineProperty,g=u((c,t)=>P(c,"name",{value:t,configurable:!0}),"g");const z={1:"cyan",2:"green",3:"yellow",4:"blue",5:"magenta",6:"gray"};function d(c){return!c||c.length===0?null:c.map((t,n)=>{switch(t.type){case"br":return r(v,{},n);case"codespan":return w(m,{inverse:!0,children:[" ",t.text," "]},n);case"del":return r(m,{strikethrough:!0,children:d(t.tokens)},n);case"em":return r(m,{italic:!0,children:d(t.tokens)},n);case"escape":return r(b.Fragment,{children:t.text},n);case"image":{const e=t;return w(m,{dimColor:!0,children:["[image: ",e.text||e.href,"]"]},n)}case"link":{const e=t;return r(B,{url:e.href,children:d(e.tokens)??e.text},n)}case"strong":return r(m,{bold:!0,children:d(t.tokens)},n);case"text":return r(b.Fragment,{children:t.text},n);default:{const e="raw"in t?t.raw:"";return r(b.Fragment,{children:e},n)}}})}u(d,"k");g(d,"renderInlineTokens");function T(c){return c.map(t=>{const n=t.tokens??[],e=n.find(i=>i.type==="text"),o=d(e?.tokens??n),p=n.find(i=>i.type==="list");return{children:p?T(p.items):void 0,label:o}})}u(T,"w");g(T,"mapListItems");function y(c,t,n){const e=[];for(const[o,p]of c.entries()){const i=p,l=o>0?1:0;switch(i.type){case"blockquote":{const a=i;e.push(r(s,{borderLeft:!0,borderLeftColor:"gray",marginTop:l,paddingLeft:1,children:r(s,{flexDirection:"column",children:y(a.tokens,t,n-3)})},o));break}case"code":{const a=i;e.push(r(s,{marginTop:l,children:r(A,{code:a.text,language:a.lang,theme:t})},o));break}case"heading":{const a=i,h=z[a.depth]??"white",x=`${"#".repeat(a.depth)} `;e.push(r(s,{marginTop:l,children:w(m,{bold:!0,color:h,children:[x,d(a.tokens)]})},o));break}case"hr":{e.push(r(s,{marginTop:l,children:r(m,{dimColor:!0,children:"─".repeat(Math.min(n,40))})},o));break}case"html":{const a=i.text.replaceAll(/<[^>]*>/g,"");a.trim()&&e.push(r(s,{marginTop:l,children:r(m,{dimColor:!0,children:a})},o));break}case"list":{const a=i,h=T(a.items);a.ordered?e.push(r(s,{marginTop:l,children:r(D,{items:h})},o)):e.push(r(s,{marginTop:l,children:r(I,{items:h})},o));break}case"paragraph":{const a=i;e.push(r(s,{marginTop:l,children:r(m,{wrap:"wrap",children:d(a.tokens)})},o));break}case"space":{e.push(r(v,{},o));break}case"table":{const a=i,h=(a.header??[]).map(f=>f.text),x=(a.rows??[]).map(f=>f.map(k=>k.text)).map(f=>{const k={};return h.forEach((F,j)=>{k[F]=f[j]??""}),k});e.push(r(s,{marginTop:l,children:r(E,{data:x})},o));break}default:{const a="raw"in i?i.raw:"",h="text"in i?i.text:a;h&&e.push(r(s,{marginTop:l,children:r(m,{children:h})},o));break}}}return e}u(y,"L");g(y,"renderBlockTokens");function C(c,t){const n=W.lex(c);if(!t||c.length===0)return n;let e=0;for(const o of n)e+=o.raw?.length??0;if(e<c.length){const o=c.slice(e);o.trim().length>0&&n.push({raw:o,text:o,tokens:[{raw:o,text:o,type:"text"}],type:"paragraph"})}return n}u(C,"q");g(C,"lexWithStreamingFallback");function H({children:c,codeTheme:t="github-dark-default",maxWidth:n,streaming:e=!1}){const{columns:o}=q(),p=n??o??80,i=L(()=>C(c,e),[c,e]),l=L(()=>y(i,t,p),[i,t,p]);return r(s,{flexDirection:"column",children:l})}u(H,"H");g(H,"Markdown");export{H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var V=Object.defineProperty;var C=(n,e)=>V(n,"name",{value:e,configurable:!0});import{jsxs as _,jsx as b}from"react/jsx-runtime";import{useMemo as y,useState as A,useCallback as j}from"react";import z from"./useInput-D1_jG26Z.js";import D from"./Box-BwqSvWuq.js";import v from"./Text-mTAve9R2.js";var L=Object.defineProperty,x=C((n,e)=>L(n,"name",{value:e,configurable:!0}),"x");const O=x((n,e)=>{const o=[];let s=0;for(const[a,l]of[...n].entries())l===e&&(o.push({maskColumn:a,rawPosition:s}),s+=1);return o},"buildTokenIndex"),R=x((n,e,o,s)=>{let a=0,l="";for(const f of e)if(f===o){const m=n[a];m===void 0?l+=s:(l+=m,a+=1)}else l+=f;return l},"formatValue");function $({defaultValue:n="",isDisabled:e=!1,mask:o,onChange:s,onSubmit:a,placeholderChar:l="_",token:f="#"}){const m=y(()=>O(o,f),[o,f]),h=m.length,M=n.slice(0,h),[t,w]=A(M),[r,d]=A(M.length),p=j((u,i)=>{w(u),d(Math.max(0,Math.min(h,i))),s?.(u)},[h,s]);z(j((u,i)=>{if(i.return){a?.(t);return}if(i.leftArrow){d(c=>Math.max(0,c-1));return}if(i.rightArrow){d(c=>Math.min(t.length,c+1));return}if(i.home||i.ctrl&&u==="a"){d(0);return}if(i.end||i.ctrl&&u==="e"){d(t.length);return}if(i.backspace){if(r===0)return;const c=t.slice(0,r-1)+t.slice(r);p(c,r-1);return}if(i.delete){if(r>=t.length)return;const c=t.slice(0,r)+t.slice(r+1);p(c,r);return}if(u.length!==1||t.length>=h)return;const T=t.slice(0,r)+u+t.slice(r);p(T,r+1)},[t,r,h,p,a]),{isActive:!e});const g=R(t,o,f,l),k=m[r]?.maskColumn??o.length,I=g.slice(0,k),P=g.charAt(k)||" ",S=g.slice(k+1);return _(D,{children:[b(v,{dimColor:e,children:I}),b(v,{dimColor:e,inverse:!e,children:P}),b(v,{dimColor:e,children:S})]})}C($,"_");x($,"MaskedInput");export{$ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var A=Object.defineProperty;var I=(r,i)=>A(r,"name",{value:i,configurable:!0});import{jsxs as p,jsx as s}from"react/jsx-runtime";import{useMemo as w,useState as F,useRef as M,useEffect as $,useCallback as B}from"react";import E from"./useFocus-DSmziO_x.js";import U from"./useInput-D1_jG26Z.js";import u from"./Box-BwqSvWuq.js";import f from"./Text-mTAve9R2.js";var z=Object.defineProperty,v=I((r,i)=>z(r,"name",{value:i,configurable:!0}),"b");const G=v((r,i)=>{if(i&&i.length>0){const t=[];for(const o of i){o.title!==void 0&&t.push({kind:"section-header",sectionId:o.id,title:o.title});for(const d of o.items)t.push({item:d,kind:"item",sectionId:o.id})}return t}return(r??[]).map(t=>({item:t,kind:"item",sectionId:void 0}))},"flatten"),S=v((r,i,t)=>{const o=r.length;if(o===0)return i;for(let d=1;d<=o;d+=1){const a=(i+t*d+o*d)%o,h=r[a];if(h?.kind==="item"&&!h.item.isDisabled)return a}return i},"findNextIndex"),j=v(r=>{for(const[i,t]of r.entries())if(t.kind==="item"&&!t.item.isDisabled)return i;return 0},"firstEnabledIndex");function N({accentColor:r="blue",autoFocus:i=!1,bordered:t=!0,items:o,onSelect:d,sections:a,title:h}){const{isFocused:b}=E({autoFocus:i}),n=w(()=>G(o,a),[o,a]),y=w(()=>j(n),[n]),[k,x]=F(y),m=M(k);m.current=k,$(()=>{const{current:c}=m,l=n[c];if(!(l?.kind==="item"&&!l.item.isDisabled)){const e=j(n);x(e),m.current=e}},[n]),U(B((c,l)=>{if(b){if(l.downArrow||c==="j")x(S(n,m.current,1));else if(l.upArrow||c==="k")x(S(n,m.current,-1));else if(l.return){const e=n[m.current];e?.kind==="item"&&!e.item.isDisabled&&d(e.item.id)}}},[b,n,d]),{isActive:b});const g=p(u,{flexDirection:"column",children:[h===void 0?void 0:s(u,{marginBottom:1,children:s(f,{bold:!0,color:r,children:h})}),n.map((c,l)=>{if(c.kind==="section-header")return s(u,{marginTop:l===0?0:1,children:s(f,{dimColor:!0,children:c.title.toUpperCase()})},`header:${c.sectionId}`);const{item:e}=c,C=b&&l===k,D=C?r:void 0;return p(u,{children:[s(f,{color:D,dimColor:e.isDisabled,children:C?"▸ ":" "}),e.icon===void 0?void 0:p(f,{color:D,dimColor:e.isDisabled,children:[e.icon," "]}),s(u,{flexGrow:1,flexShrink:1,minWidth:0,children:s(f,{bold:C,color:D,dimColor:e.isDisabled,wrap:"truncate-end",children:e.label})}),e.hotkey===void 0?void 0:s(u,{flexShrink:0,children:p(f,{dimColor:!0,children:[" ",e.hotkey]})})]},`item:${e.id}`)})]});return t?s(u,{borderColor:b?r:void 0,borderStyle:"round",paddingX:1,children:g}):g}I(N,"U");v(N,"Menu");export{N as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var m=Object.defineProperty;var a=(r,e)=>m(r,"name",{value:e,configurable:!0});import{jsxs as d,jsx as o}from"react/jsx-runtime";import i from"./Box-BwqSvWuq.js";import l from"./Text-mTAve9R2.js";var u=Object.defineProperty,h=a((r,e)=>u(r,"name",{value:e,configurable:!0}),"f");const p={assistant:{align:"flex-start",color:"blueBright",icon:""},system:{align:"flex-start",color:"gray",icon:""},tool:{align:"flex-start",color:"magentaBright",icon:""},user:{align:"flex-end",color:"greenBright",icon:""}};function x({children:r,color:e,flat:f=!1,label:n,meta:t,role:g="assistant"}){const s=p[g],c=e??s.color;return d(i,{alignSelf:s.align,flexDirection:"column",marginBottom:1,children:[n===void 0&&t===void 0?void 0:d(i,{gap:1,paddingX:1,children:[n===void 0?void 0:o(l,{bold:!0,color:c,children:n}),t===void 0?void 0:o(l,{dimColor:!0,children:t})]}),f?d(i,{paddingX:1,children:[o(l,{color:c,children:"│ "}),o(i,{flexDirection:"column",flexGrow:1,children:typeof r=="string"?o(l,{children:r}):r})]}):o(i,{borderColor:c,borderStyle:"round",flexDirection:"column",paddingX:1,children:typeof r=="string"?o(l,{children:r}):r})]})}a(x,"m");h(x,"MessageBubble");export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var n=(r,o)=>f(r,"name",{value:o,configurable:!0});import{jsxs as e,Fragment as p,jsx as c}from"react/jsx-runtime";import h from"./Box-BwqSvWuq.js";import d from"./Text-mTAve9R2.js";var v=Object.defineProperty,s=n((r,o)=>v(r,"name",{value:o,configurable:!0}),"d");function b({color:r="magenta",icon:o,model:t,provider:a,variant:u="solid"}){const m=s(i=>{const l=o===void 0?void 0:e(p,{children:[o," "]});return u==="outline"?c(h,{borderColor:r,borderStyle:"round",paddingX:1,children:e(d,{color:r,children:[l,i]})}):u==="subtle"?e(d,{color:r,children:[l,i]}):e(d,{backgroundColor:r,color:"black",children:[" ",l,i," "]})},"chip");return a===void 0?m(t):e(h,{children:[c(d,{dimColor:!0,children:a}),c(d,{dimColor:!0,children:"/"}),m(t)]})}n(b,"c");s(b,"ModelBadge");export{b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _=Object.defineProperty;var d=(e,t)=>_(e,"name",{value:t,configurable:!0});import{createRequire as T}from"node:module";import{jsx as j}from"react/jsx-runtime";import{useRef as f,useReducer as w,useEffect as k,useMemo as E}from"react";import{useStdinContext as B}from"./useStdin-DKa4h35k.js";import P from"./useStdout-B-2lX4C5.js";import{M as n,a as $}from"./ansi-parser-B6uXaq65.js";import{o as q}from"./mouse-context-DaARgUu1.js";const h=T(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=d(e=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[t,i]=u.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return u.getBuiltinModule(e)}return h(e)},"__cjs_getBuiltinModule"),{EventEmitter:x}=M("node:events"),R=u;var O=Object.defineProperty,b=d((e,t)=>O(e,"name",{value:t,configurable:!0}),"l");const S={button:null,click:null,drag:null,position:{x:0,y:0},scroll:null},G=b((e,t)=>{switch(t.type){case"click":return{...e,button:t.button,click:t.click,position:t.position};case"click-reset":return{...e,button:null,click:null};case"drag":return{...e,button:t.button,drag:t.drag,position:t.position};case"move":return{...e,position:t.position};case"scroll":return{...e,position:t.position,scroll:t.scroll};case"scroll-reset":return{...e,scroll:null};default:return e}},"mouseReducer"),H=b(({children:e})=>{const{internal_eventEmitter:t}=B(),{stdout:i}=P(),l=f(new x),[s,c]=w(G,S),p=f(void 0),m=f(void 0);k(()=>{const a=i.isTTY?i:R.stdout;return a.write(n.mouseButton.on+n.mouseMotion.on+n.mouseMotionOthers.on+n.mouseSGR.on),()=>{a.write(n.mouseSGR.off+n.mouseMotionOthers.off+n.mouseMotion.off+n.mouseButton.off)}},[i]),k(()=>{const a=b(y=>{const o=$(y);if(!o)return;const r={x:o.x,y:o.y};switch(l.current.emit("position",r),o.type){case"click":{c({button:o.button,click:o.action,position:r,type:"click"}),l.current.emit("click",r,o.action,o.button),clearTimeout(p.current),p.current=setTimeout(()=>{c({type:"click-reset"})},100);break}case"drag":{const g=o.action==="press"?"dragging":null;c({button:o.button,drag:g,position:r,type:"drag"}),l.current.emit("drag",r,g,o.button);break}case"move":{c({position:r,type:"move"});break}case"scroll":{c({position:r,scroll:o.direction,type:"scroll"}),l.current.emit("scroll",r,o.direction),clearTimeout(m.current),m.current=setTimeout(()=>{c({type:"scroll-reset"})},100);break}}},"handleInput");return t.on("input",a),()=>{t.off("input",a),clearTimeout(p.current),clearTimeout(m.current)}},[t]);const v=E(()=>({button:s.button,click:s.click,drag:s.drag,events:l.current,position:s.position,scroll:s.scroll}),[s]);return j(q,{value:v,children:e})},"MouseProvider");export{H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var L=Object.defineProperty;var F=(e,n)=>L(e,"name",{value:n,configurable:!0});import{jsx as m,jsxs as D}from"react/jsx-runtime";import{useReducer as P,useState as T,useRef as f,useMemo as V,useCallback as g}from"react";import Y from"./useInput-D1_jG26Z.js";import _ from"./useWindowSize-yDZsXF8z.js";import O from"./Box-BwqSvWuq.js";import a from"./Text-mTAve9R2.js";var q=Object.defineProperty,R=F((e,n)=>q(e,"name",{value:n,configurable:!0}),"S");const B=[],G=R((e,n)=>{switch(n.type){case"focus":return{...e,focusedIndex:n.index};case"focus-next":{const c=e.focusedIndex+1,u=c>=e.visibleFrom+n.limit;return{...e,focusedIndex:c,visibleFrom:u?e.visibleFrom+1:e.visibleFrom}}case"focus-prev":{const c=e.focusedIndex-1,u=c<e.visibleFrom;return{...e,focusedIndex:c,visibleFrom:u?e.visibleFrom-1:e.visibleFrom}}default:return e}},"multiSelectReducer");function H({accentColor:e="blue",defaultColor:n,defaultValue:c=B,isDisabled:u=!1,isFocused:v=!0,limit:I,onChange:C,onSubmit:w,options:t}){const{rows:z}=_(),l=Math.min(typeof I=="number"?I:z,t.length),[s,j]=P(G,{focusedIndex:0,visibleFrom:0}),[b,S]=T(c),k=f(b);k.current=b;const y=f(w);y.current=w;const p=f(C);p.current=C;const x=f(s);x.current=s;const E=V(()=>t.slice(s.visibleFrom,s.visibleFrom+l),[t,s.visibleFrom,l]),M=g(()=>{const r=t[x.current.focusedIndex]?.value;r&&S(o=>{const i=o.includes(r)?o.filter(d=>d!==r):[...o,r];return p.current?.(i),i})},[t]),A=g(()=>{S(r=>{const o=r.length===t.length?[]:t.map(i=>i.value);return p.current?.(o),o})},[t]);return Y(g((r,o)=>{const{focusedIndex:i}=x.current;(o.downArrow||r==="j")&&i<t.length-1&&j({limit:l,type:"focus-next"}),(o.upArrow||r==="k")&&i>0&&j({limit:l,type:"focus-prev"}),r===" "&&M(),r==="a"&&A(),o.return&&y.current?.(k.current)},[t.length,l,M,A]),{isActive:!u&&v}),m(O,{flexDirection:"column",children:E.map((r,o)=>{const i=s.visibleFrom+o===s.focusedIndex,d=b.includes(r.value);let h=n;return d?h="green":i&&(h=e),D(O,{gap:1,children:[i?m(a,{color:e,dimColor:!v,children:"▸"}):m(a,{children:" "}),D(a,{color:h,dimColor:u,children:[d?"◼":"◻"," ",r.label]}),d?m(a,{color:"green",dimColor:!v,children:"✓"}):void 0]},r.key??r.value)})})}F(H,"j");R(H,"MultiSelect");export{H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p=Object.defineProperty;var o=(n,t)=>p(n,"name",{value:t,configurable:!0});import e from"yoga-layout";var d=Object.defineProperty,s=o((n,t)=>d(n,"name",{value:t,configurable:!0}),"a");const g={black:0,blackBright:8,blue:4,blueBright:12,cyan:6,cyanBright:14,gray:8,green:2,greenBright:10,grey:8,magenta:5,magentaBright:13,red:1,redBright:9,white:7,whiteBright:15,yellow:3,yellowBright:11};function E(n,t,r){const i=Math.round(n/51),a=Math.round(t/51),l=Math.round(r/51);return 16+36*i+6*a+l}o(E,"s");s(E,"rgbToAnsi256");function f(n){if(n===void 0)return 255;if(typeof n=="number")return n;if(n in g)return g[n];const t=/^ansi256\(\s*(\d+)\s*\)$/.exec(n);if(t)return Number(t[1]);const r=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(n);if(r)return E(Number.parseInt(r[1]+r[1],16),Number.parseInt(r[2]+r[2],16),Number.parseInt(r[3]+r[3],16));const i=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(n);if(i)return E(Number.parseInt(i[1],16),Number.parseInt(i[2],16),Number.parseInt(i[3],16));const a=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/.exec(n);return a?E(Number(a[1]),Number(a[2]),Number(a[3])):255}o(f,"resolveColor");s(f,"resolveColor");const _=[["top",e.EDGE_TOP],["right",e.EDGE_RIGHT],["bottom",e.EDGE_BOTTOM],["left",e.EDGE_LEFT]],T=s((n,t)=>{"position"in t&&n.setPositionType(t.position==="absolute"?e.POSITION_TYPE_ABSOLUTE:e.POSITION_TYPE_RELATIVE);for(const[r,i]of _)if(r in t){const a=t[r];typeof a=="string"?n.setPositionPercent(i,Number.parseFloat(a)):n.setPosition(i,a)}},"applyPositionStyles"),m=s((n,t)=>{"margin"in t&&n.setMargin(e.EDGE_ALL,t.margin??0),"marginX"in t&&n.setMargin(e.EDGE_HORIZONTAL,t.marginX??0),"marginY"in t&&n.setMargin(e.EDGE_VERTICAL,t.marginY??0),"marginLeft"in t&&n.setMargin(e.EDGE_LEFT,t.marginLeft??0),"marginRight"in t&&n.setMargin(e.EDGE_RIGHT,t.marginRight??0),"marginTop"in t&&n.setMargin(e.EDGE_TOP,t.marginTop??0),"marginBottom"in t&&n.setMargin(e.EDGE_BOTTOM,t.marginBottom??0)},"applyMarginStyles"),h=s((n,t)=>{"padding"in t&&n.setPadding(e.EDGE_ALL,t.padding??0),"paddingX"in t&&n.setPadding(e.EDGE_HORIZONTAL,t.paddingX??0),"paddingY"in t&&n.setPadding(e.EDGE_VERTICAL,t.paddingY??0),"paddingLeft"in t&&n.setPadding(e.EDGE_LEFT,t.paddingLeft??0),"paddingRight"in t&&n.setPadding(e.EDGE_RIGHT,t.paddingRight??0),"paddingTop"in t&&n.setPadding(e.EDGE_TOP,t.paddingTop??0),"paddingBottom"in t&&n.setPadding(e.EDGE_BOTTOM,t.paddingBottom??0)},"applyPaddingStyles"),N=s((n,t)=>{if("flexGrow"in t&&n.setFlexGrow(t.flexGrow??0),"flexShrink"in t&&n.setFlexShrink(t.flexShrink??1),"flexWrap"in t&&n.setFlexWrap(t.flexWrap==="nowrap"?e.WRAP_NO_WRAP:t.flexWrap==="wrap"?e.WRAP_WRAP:e.WRAP_WRAP_REVERSE),"flexDirection"in t&&(t.flexDirection==="row"&&n.setFlexDirection(e.FLEX_DIRECTION_ROW),t.flexDirection==="row-reverse"&&n.setFlexDirection(e.FLEX_DIRECTION_ROW_REVERSE),t.flexDirection==="column"&&n.setFlexDirection(e.FLEX_DIRECTION_COLUMN),t.flexDirection==="column-reverse"&&n.setFlexDirection(e.FLEX_DIRECTION_COLUMN_REVERSE)),"flexBasis"in t&&(typeof t.flexBasis=="number"?n.setFlexBasis(t.flexBasis):typeof t.flexBasis=="string"?n.setFlexBasisPercent(Number.parseInt(t.flexBasis,10)):n.setFlexBasis(Number.NaN)),"alignItems"in t){const r={baseline:e.ALIGN_BASELINE,center:e.ALIGN_CENTER,"flex-end":e.ALIGN_FLEX_END,"flex-start":e.ALIGN_FLEX_START,stretch:e.ALIGN_STRETCH};n.setAlignItems(r[t.alignItems||"stretch"])}if("alignSelf"in t){const r={auto:e.ALIGN_AUTO,baseline:e.ALIGN_BASELINE,center:e.ALIGN_CENTER,"flex-end":e.ALIGN_FLEX_END,"flex-start":e.ALIGN_FLEX_START,stretch:e.ALIGN_STRETCH};n.setAlignSelf(r[t.alignSelf||"auto"])}if("alignContent"in t){const r={center:e.ALIGN_CENTER,"flex-end":e.ALIGN_FLEX_END,"flex-start":e.ALIGN_FLEX_START,"space-around":e.ALIGN_SPACE_AROUND,"space-between":e.ALIGN_SPACE_BETWEEN,stretch:e.ALIGN_STRETCH};n.setAlignContent(r[t.alignContent||"flex-start"])}if("justifyContent"in t){const r={center:e.JUSTIFY_CENTER,"flex-end":e.JUSTIFY_FLEX_END,"flex-start":e.JUSTIFY_FLEX_START,"space-around":e.JUSTIFY_SPACE_AROUND,"space-between":e.JUSTIFY_SPACE_BETWEEN,"space-evenly":e.JUSTIFY_SPACE_EVENLY};n.setJustifyContent(r[t.justifyContent||"flex-start"])}},"applyFlexStyles"),c=s((n,t)=>{"width"in t&&(typeof t.width=="number"?n.setWidth(t.width):typeof t.width=="string"?n.setWidthPercent(Number.parseInt(t.width,10)):n.setWidthAuto()),"height"in t&&(typeof t.height=="number"?n.setHeight(t.height):typeof t.height=="string"?n.setHeightPercent(Number.parseInt(t.height,10)):n.setHeightAuto()),"minWidth"in t&&(typeof t.minWidth=="string"?n.setMinWidthPercent(Number.parseInt(t.minWidth,10)):n.setMinWidth(t.minWidth??0)),"minHeight"in t&&(typeof t.minHeight=="string"?n.setMinHeightPercent(Number.parseInt(t.minHeight,10)):n.setMinHeight(t.minHeight??0)),"maxWidth"in t&&(typeof t.maxWidth=="string"?n.setMaxWidthPercent(Number.parseInt(t.maxWidth,10)):n.setMaxWidth(t.maxWidth)),"maxHeight"in t&&(typeof t.maxHeight=="string"?n.setMaxHeightPercent(Number.parseInt(t.maxHeight,10)):n.setMaxHeight(t.maxHeight)),"aspectRatio"in t&&n.setAspectRatio(t.aspectRatio)},"applyDimensionStyles"),I=s((n,t)=>{"display"in t&&n.setDisplay(t.display==="flex"?e.DISPLAY_FLEX:e.DISPLAY_NONE)},"applyDisplayStyles"),L=s((n,t,r)=>{if(!("borderStyle"in t||"borderTop"in t||"borderBottom"in t||"borderLeft"in t||"borderRight"in t))return;const i=r.borderStyle?1:0;n.setBorder(e.EDGE_TOP,r.borderTop===!1?0:i),n.setBorder(e.EDGE_BOTTOM,r.borderBottom===!1?0:i),n.setBorder(e.EDGE_LEFT,r.borderLeft===!1?0:i),n.setBorder(e.EDGE_RIGHT,r.borderRight===!1?0:i)},"applyBorderStyles"),u=s((n,t)=>{"gap"in t&&n.setGap(e.GUTTER_ALL,t.gap??0),"columnGap"in t&&n.setGap(e.GUTTER_COLUMN,t.columnGap??0),"rowGap"in t&&n.setGap(e.GUTTER_ROW,t.rowGap??0)},"applyGapStyles"),A=s((n,t={},r=t)=>{T(n,t),m(n,t),h(n,t),N(n,t),c(n,t),I(n,t),L(n,t,r),u(n,t)},"applyStyles");export{g as NAMED_COLORS,A as applyStyles,f as resolveColor};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var n=Object.defineProperty;var t=(e,r)=>n(e,"name",{value:r,configurable:!0});import{jsx as a}from"react/jsx-runtime";var o=Object.defineProperty,i=t((e,r)=>o(e,"name",{value:r,configurable:!0}),"t");function u({count:e=1}){return a("ink-text",{children:`
|
|
2
|
+
`.repeat(e)})}t(u,"o");i(u,"Newline");export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var w=Object.defineProperty;var s=(e,r)=>w(e,"name",{value:r,configurable:!0});import{jsx as i,jsxs as l,Fragment as y}from"react/jsx-runtime";import d from"./Box-BwqSvWuq.js";import C from"./Spinner-B0-A50pu.js";import o from"./Text-mTAve9R2.js";var k=Object.defineProperty,a=s((e,r)=>k(e,"name",{value:r,configurable:!0}),"s");const M={completed:"green",error:"red",pending:"gray",running:"cyan",skipped:"yellow"},b={completed:"✔",error:"✖",pending:"○",skipped:"⊘"},L=a(e=>{if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const r=Math.round(e/1e3),n=Math.floor(r/60),t=r%60;return`${n}m ${t}s`},"formatDuration"),h=a(({isLast:e,node:r,prefix:n,showSpinner:t})=>{const p=M[r.status],m=e?"└─ ":"├─ ",f=n.length===0?"":m,u=n+(e?" ":"│ "),g=t?i(C,{type:"dots"}):"…",x=r.status==="running"?g:b[r.status];return l(y,{children:[l(d,{children:[i(o,{dimColor:!0,children:n}),i(o,{dimColor:!0,children:f}),i(d,{flexShrink:0,children:i(o,{color:p,children:x})}),i(o,{children:" "}),i(d,{flexGrow:1,flexShrink:1,minWidth:0,children:i(o,{bold:r.status==="running",color:r.status==="pending"?"gray":void 0,dimColor:r.status==="skipped",wrap:"truncate-end",children:r.label})}),r.durationMs===void 0?void 0:i(d,{flexShrink:0,children:l(o,{dimColor:!0,children:[" ",L(r.durationMs)]})})]}),r.details===void 0?void 0:l(d,{children:[i(o,{dimColor:!0,children:u}),i(o,{dimColor:!0,children:r.details})]}),r.children?.map((c,v,S)=>i(h,{isLast:v===S.length-1,node:c,prefix:u,showSpinner:t},c.id))]})},"NodeLine");function $({nodes:e,showSpinner:r=!0}){return i(d,{flexDirection:"column",children:e.map((n,t)=>i(h,{isLast:t===e.length-1,node:n,prefix:"",showSpinner:r},n.id))})}s($,"R");a($,"OperationTree");export{$ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p=Object.defineProperty;var l=(n,o)=>p(n,"name",{value:o,configurable:!0});import{jsx as i,jsxs as u}from"react/jsx-runtime";import r from"./Box-BwqSvWuq.js";import t from"./Text-mTAve9R2.js";var s=Object.defineProperty,x=l((n,o)=>s(n,"name",{value:o,configurable:!0}),"s");function v({accentColor:n="blue",bordered:o=!1,currentId:f,iconColumnWidth:c=2,options:m}){const a=i(r,{flexDirection:"column",children:m.map(e=>{const d=e.id===f,h=d?n:void 0;return u(r,{flexDirection:"column",children:[u(r,{children:[i(r,{flexShrink:0,width:c,children:i(t,{color:h,children:e.icon??(d?"▸":" ")})}),i(r,{flexGrow:1,flexShrink:1,minWidth:0,children:i(t,{bold:d,color:h,wrap:"truncate-end",children:e.label})}),e.trailing===void 0?void 0:i(r,{flexShrink:0,children:e.trailing})]}),e.description===void 0?void 0:i(r,{marginLeft:c,children:i(t,{dimColor:!0,wrap:"truncate-end",children:e.description})})]},e.id)})});return o?i(r,{borderStyle:"round",paddingX:1,children:a}):a}l(v,"m");x(v,"OptionList");export{v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var t=(r,e)=>f(r,"name",{value:e,configurable:!0});import{jsx as i,jsxs as d}from"react/jsx-runtime";import l from"./Box-BwqSvWuq.js";import m from"./Text-mTAve9R2.js";var h=Object.defineProperty,a=t((r,e)=>h(r,"name",{value:e,configurable:!0}),"n");const s=a((r,e)=>{const u=String(r.length).length;return i(l,{flexDirection:"column",children:r.map((n,o)=>{const p=`${String(o+1).padStart(u)}.`,c=`${e}${p}`;return d(l,{gap:1,children:[i(m,{dimColor:!0,children:c}),d(l,{flexDirection:"column",children:[i(m,{children:n.label}),n.children?s(n.children,c):void 0]})]},o)})})},"renderList");function g({items:r}){return s(r,"")}t(g,"x");a(g,"OrderedList");export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var z=Object.defineProperty;var x=(e,r)=>z(e,"name",{value:r,configurable:!0});import{jsxs as m,jsx as o}from"react/jsx-runtime";import{useState as F,useCallback as y}from"react";import S from"./useInput-D1_jG26Z.js";import P from"./Box-BwqSvWuq.js";import t from"./Text-mTAve9R2.js";var $=Object.defineProperty,v=x((e,r)=>$(e,"name",{value:r,configurable:!0}),"y");const k=v(({color:e,currentPage:r,style:u,totalPages:a})=>{if(u==="fraction")return m(t,{children:[o(t,{color:e,children:r+1}),m(t,{dimColor:!0,children:["/",a]})]});if(u==="numeric"){const s=r>0?o(t,{color:e,children:"‹ "}):o(t,{dimColor:!0,children:"‹ "}),c=r<a-1?o(t,{color:e,children:" ›"}):o(t,{dimColor:!0,children:" ›"});return m(P,{children:[s,o(t,{color:e,children:r+1}),m(t,{dimColor:!0,children:[" /",a]}),c]})}const d=Array.from({length:a},(s,c)=>c===r?o(t,{color:e,children:"●"},c):o(t,{dimColor:!0,children:"○"},c));return o(P,{gap:1,children:d})},"Indicator"),q=v(({children:e,defaultPage:r=0,indicatorColor:u="cyan",isFocused:a=!0,items:d,onChange:s,page:c,pageSize:g,style:I="dots"})=>{const f=c!==void 0,[b,w]=F(r),A=f?c:b,n=Math.max(1,Math.ceil(d.length/g)),l=Math.max(0,Math.min(A,n-1)),h=y(M=>{const i=Math.max(0,Math.min(M,n-1));f||w(i),s?.(i)},[n,f,s]);S(y((M,i)=>{i.leftArrow||i.pageUp?h(l-1):i.rightArrow||i.pageDown?h(l+1):i.home?h(0):i.end&&h(n-1)},[l,n,h]),{isActive:a});const p=l*g,C=Math.min(p+g,d.length),j=d.slice(p,C),D={currentPage:l,endIndex:C,isFirstPage:l===0,isLastPage:l===n-1,startIndex:p,totalPages:n};return m(P,{flexDirection:"column",children:[e(j,D),n>1&&o(k,{color:u,currentPage:l,style:I,totalPages:n})]})},"Paginator");export{q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Object.defineProperty;var e=(r,o)=>t(r,"name",{value:o,configurable:!0});import{jsx as i}from"react/jsx-runtime";import l from"./Box-BwqSvWuq.js";import c from"./Text-mTAve9R2.js";var f=Object.defineProperty,p=e((r,o)=>f(r,"name",{value:o,configurable:!0}),"e");function d({children:r,color:o,dimColor:m=!1,marginBottom:a=1,marginTop:n=0}){return i(l,{flexDirection:"column",marginBottom:a,marginTop:n,children:i(c,{color:o,dimColor:m,children:r})})}e(d,"c");p(d,"Paragraph");export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var x=Object.defineProperty;var o=(r,t)=>x(r,"name",{value:t,configurable:!0});import{jsx as a}from"react/jsx-runtime";import g from"./useAnimation-B9we6ZzL.js";import y from"./useWindowSize-yDZsXF8z.js";import m from"./Box-BwqSvWuq.js";import A from"./Text-mTAve9R2.js";var M=Object.defineProperty,b=o((r,t)=>M(r,"name",{value:t,configurable:!0}),"l");const j=[1,.85,.6];function P({animated:r=!0,character:t="█",color:c="gray",interval:h=500,rows:d=3,width:i,widths:e=j}){const{frame:f}=g({interval:h,isActive:r}),{columns:u}=y(),p=r&&f%2===0,s=i??Math.max(1,u);return a(m,{flexDirection:"column",width:i,children:Array.from({length:d},(z,n)=>{const w=e.length>0?e[n%e.length]??1:1,l=Math.max(1,Math.round(s*w)),v=t.repeat(l);return a(m,{width:l,children:a(A,{color:c,dimColor:p,wrap:"truncate-end",children:v})},n)})})}o(P,"T");b(P,"Placeholder");export{P as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p=Object.defineProperty;var a=(r,t)=>p(r,"name",{value:t,configurable:!0});import{jsx as u}from"react/jsx-runtime";import s from"./useWindowSize-yDZsXF8z.js";import M from"./Text-mTAve9R2.js";var d=Object.defineProperty,g=a((r,t)=>d(r,"name",{value:t,configurable:!0}),"n");function x({character:r="█",columns:t=0,left:m=0,percent:n=1,right:i=0,rightPad:c=!1,...f}){const{columns:h}=s(),e=Math.max(0,(t||h||80)-i-m),o=Math.min(Math.floor(e*Math.max(0,Math.min(1,n))),e),l=r.repeat(o)+(c?" ".repeat(e-o):"");return u(M,{...f,children:l})}a(x,"h");g(x,"ProgressBar");export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var D=Object.defineProperty;var A=(n,o)=>D(n,"name",{value:o,configurable:!0});import{jsx as b,jsxs as O}from"react/jsx-runtime";import{useState as I,useRef as R,useCallback as M}from"react";import B from"./useFocus-DSmziO_x.js";import G from"./useInput-D1_jG26Z.js";import k from"./Box-BwqSvWuq.js";import C from"./Text-mTAve9R2.js";var N=Object.defineProperty,z=A((n,o)=>N(n,"name",{value:o,configurable:!0}),"I");const P=z((n,o)=>{if(o===void 0)return 0;const c=n.findIndex(x=>x.value===o);return Math.max(c,0)},"initialFocusIndex");function U({accentColor:n="blue",autoFocus:o=!1,commitOnNavigate:c=!0,defaultValue:x,isDisabled:d=!1,onChange:j,onSubmit:y,options:e,orientation:a="vertical",value:f}){const{isFocused:s}=B({autoFocus:o,isActive:!d}),[g,S]=I(x??e[0]?.value),m=f??g,[w,F]=I(()=>P(e,m)),u=R(w);u.current=w;const v=M(r=>{const t=e[r];if(!t)return;const l=f??g;t.value!==l&&(f===void 0&&S(t.value),j?.(t.value))},[e,f,g,j]);return G(M((r,t)=>{if(!s)return;const l=e.length;if(l===0)return;const p=t.downArrow&&a==="vertical"||t.rightArrow&&a==="horizontal"||r==="j",h=t.upArrow&&a==="vertical"||t.leftArrow&&a==="horizontal"||r==="k";if(p){const i=Math.min(l-1,u.current+1);F(i),c&&v(i);return}if(h){const i=Math.max(0,u.current-1);F(i),c&&v(i);return}if(r===" "){v(u.current);return}if(t.return){c||v(u.current);const i=e[u.current]?.value??m;i!==void 0&&y?.(i)}},[s,e,a,v,c,m,y]),{isActive:!d&&s}),b(k,{flexDirection:a==="vertical"?"column":"row",gap:a==="vertical"?0:2,children:e.map((r,t)=>{const l=r.value===m,p=s&&t===w,h=(l||p)&&s?n:void 0;return O(k,{gap:1,children:[b(C,{color:h,dimColor:d,children:l?"●":"○"}),b(C,{bold:p,color:h,dimColor:d,children:r.label}),r.description===void 0?void 0:b(C,{dimColor:!0,children:r.description})]},r.key??r.value)})})}A(U,"U");z(U,"RadioGroup");export{U as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Object.defineProperty;var s=(n,e)=>t(n,"name",{value:e,configurable:!0});import{createRequire as c}from"node:module";const u=c(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=s(n=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[e,i]=r.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return r.getBuiltinModule(n)}return u(n)},"__cjs_getBuiltinModule"),{createRequire:l}=a("node:module"),d=l(import.meta.url),m=d("../../index.js"),o=m,f=o.Renderer,g=o.TerminalGuard,j=o.terminalSize;export{f as Renderer,g as TerminalGuard,j as terminalSize};
|