@kitn.ai/ui 0.17.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (494) hide show
  1. package/README.md +28 -5
  2. package/dist/components/artifact.d.ts +39 -1
  3. package/dist/components/attachment-types.d.ts +12 -0
  4. package/dist/components/attachments.d.ts +2 -10
  5. package/dist/components/card.d.ts +27 -0
  6. package/dist/components/chain-of-thought.d.ts +78 -2
  7. package/dist/components/chat-scope-picker.d.ts +7 -0
  8. package/dist/components/chat-thread.d.ts +37 -12
  9. package/dist/components/choice-card.d.ts +26 -0
  10. package/dist/components/coachmark.d.ts +49 -0
  11. package/dist/components/composer-dom.d.ts +35 -0
  12. package/dist/components/composer-highlight.d.ts +48 -0
  13. package/dist/components/composer-history.d.ts +34 -0
  14. package/dist/components/composer.d.ts +86 -0
  15. package/dist/components/confirm-card.d.ts +17 -0
  16. package/dist/components/conversation-item.d.ts +9 -0
  17. package/dist/components/conversation-list.d.ts +36 -1
  18. package/dist/components/file-tree.d.ts +15 -0
  19. package/dist/components/form.d.ts +34 -0
  20. package/dist/components/markdown.d.ts +3 -0
  21. package/dist/components/message.d.ts +12 -0
  22. package/dist/components/model-switcher.d.ts +7 -0
  23. package/dist/components/prompt-input.d.ts +13 -4
  24. package/dist/components/prompt-suggestion.d.ts +9 -1
  25. package/dist/components/reasoning.d.ts +14 -1
  26. package/dist/components/response-compare.d.ts +14 -0
  27. package/dist/components/screen.d.ts +46 -0
  28. package/dist/components/tasks-card.d.ts +49 -1
  29. package/dist/components/toast.d.ts +12 -2
  30. package/dist/components/tool-types.d.ts +10 -0
  31. package/dist/components/tool.d.ts +8 -8
  32. package/dist/components/voice-input.d.ts +27 -0
  33. package/dist/components/voice-output.d.ts +33 -0
  34. package/dist/core-C8fzo39E.js +12 -0
  35. package/dist/custom-elements.json +8392 -1860
  36. package/dist/elements/agent-card.d.ts +1 -0
  37. package/dist/elements/agent-card.js +1 -0
  38. package/dist/elements/artifact.js +1 -1
  39. package/dist/elements/attachments.js +1 -1
  40. package/dist/elements/autoloader.js +1 -1
  41. package/dist/elements/avatar.d.ts +1 -0
  42. package/dist/elements/avatar.js +1 -0
  43. package/dist/elements/badge.d.ts +1 -0
  44. package/dist/elements/badge.js +1 -0
  45. package/dist/elements/button.d.ts +1 -0
  46. package/dist/elements/button.js +1 -0
  47. package/dist/elements/card.js +1 -1
  48. package/dist/elements/cards.js +1 -1
  49. package/dist/elements/chain-of-thought.js +1 -1
  50. package/dist/elements/chat-scope-picker.js +1 -1
  51. package/dist/elements/chat-types.d.ts +47 -0
  52. package/dist/elements/chat-workspace.js +1 -1
  53. package/dist/elements/chat.js +1 -1
  54. package/dist/elements/checkpoint.js +1 -1
  55. package/dist/elements/choice.js +1 -1
  56. package/dist/elements/chunks/Icon-C2LTALdM.js +1 -0
  57. package/dist/elements/chunks/action-icons-Dtl8Ox5D.js +1 -0
  58. package/dist/elements/chunks/arrow-left-GbBceGBE.js +1 -0
  59. package/dist/elements/chunks/attachments-DLJcWCDV.js +1 -0
  60. package/dist/elements/chunks/badge-BTNZTODL.js +1 -0
  61. package/dist/elements/chunks/button-DBDZebGr.js +1 -0
  62. package/dist/elements/chunks/card-YfCyI4fH.js +1 -0
  63. package/dist/elements/chunks/chat-thread-Dz2qbzvI.js +1 -0
  64. package/dist/elements/chunks/check-fhmRksq_.js +1 -0
  65. package/dist/elements/chunks/chevron-down-DcRg1aRU.js +1 -0
  66. package/dist/elements/chunks/chevron-right-ChzBcNJ-.js +1 -0
  67. package/dist/elements/chunks/circle-B4fTe9v6.js +1 -0
  68. package/dist/elements/chunks/circle-check-CJV-3Rem.js +1 -0
  69. package/dist/elements/chunks/circle-x-pDtzlghQ.js +1 -0
  70. package/dist/elements/chunks/cn-CU7UAWzk.js +1 -0
  71. package/dist/elements/chunks/code-block-DZ6mz6vs.js +1 -0
  72. package/dist/elements/chunks/collapsible-CWUAShMC.js +1 -0
  73. package/dist/elements/chunks/composer-BZyPU6gD.js +65 -0
  74. package/dist/elements/chunks/context-Cx6eQA_G.js +1 -0
  75. package/dist/elements/chunks/conversation-list-C4xTQSpT.js +1 -0
  76. package/dist/elements/chunks/default-input-BZcwyKcP.js +1 -0
  77. package/dist/elements/chunks/define-CNSKFZCd.js +1 -0
  78. package/dist/elements/chunks/disclosure-BcBs--Jf.js +1 -0
  79. package/dist/elements/chunks/download-BDQwcFav.js +1 -0
  80. package/dist/elements/chunks/dropdown-wgs8xCJZ.js +1 -0
  81. package/dist/elements/chunks/ellipsis-CUiEJ6R1.js +1 -0
  82. package/dist/elements/chunks/external-link-DJUmC7g2.js +1 -0
  83. package/dist/elements/chunks/file-text-DOYfYvrh.js +1 -0
  84. package/dist/elements/chunks/file-tree-DQzNQrbr.js +1 -0
  85. package/dist/elements/chunks/folder-DBDUBANz.js +1 -0
  86. package/dist/elements/chunks/hover-card-BQGdGAQ3.js +1 -0
  87. package/dist/elements/chunks/icon-CAyRqVrg.js +1 -0
  88. package/dist/elements/chunks/{index-CTBEJeo6.js → index-BCRhi84a.js} +1 -1
  89. package/dist/elements/chunks/info-DBQl-m6e.js +1 -0
  90. package/dist/elements/chunks/input-DZD67EvW.js +1 -0
  91. package/dist/elements/chunks/kbd-DbyVrlnU.js +1 -0
  92. package/dist/elements/chunks/link-vko7AttA.js +1 -0
  93. package/dist/elements/chunks/loader-Cg6rO8tQ.js +1 -0
  94. package/dist/elements/chunks/{markdown-CMTGx9r8.js → markdown-n3Xbj3PR.js} +9 -9
  95. package/dist/elements/chunks/message-CgKytiSB.js +1 -0
  96. package/dist/elements/chunks/message-feedback-Ds3-US0e.js +1 -0
  97. package/dist/elements/chunks/message-square-MmRkvc-M.js +1 -0
  98. package/dist/elements/chunks/minimize-2-3kCdE0q3.js +1 -0
  99. package/dist/elements/chunks/model-switcher-BMtXGwLU.js +1 -0
  100. package/dist/elements/chunks/overlay-B1-MBI6h.js +1 -0
  101. package/dist/elements/chunks/paperclip-DDEfmkHc.js +1 -0
  102. package/dist/elements/chunks/progress-bar-Dwbiyv3s.js +1 -0
  103. package/dist/elements/chunks/prompt-suggestion-9lvgFcEa.js +1 -0
  104. package/dist/elements/chunks/reasoning-DzHWsdAJ.js +1 -0
  105. package/dist/elements/chunks/resizable-Bq_eHxUm.js +1 -0
  106. package/dist/elements/chunks/rotate-cw-jpisOdOV.js +1 -0
  107. package/dist/elements/chunks/scroll-area-g5Ze3K6f.js +1 -0
  108. package/dist/elements/chunks/separator-Bmjc5XyX.js +1 -0
  109. package/dist/elements/chunks/settings-Cz1bMJP9.js +1 -0
  110. package/dist/elements/chunks/settings-group-9imY3kRA.js +1 -0
  111. package/dist/elements/chunks/share-BdenF0wQ.js +1 -0
  112. package/dist/elements/chunks/skeleton-Pjc5jiaY.js +1 -0
  113. package/dist/elements/chunks/slots-DkZ-Cmha.js +1 -0
  114. package/dist/elements/chunks/star-DY6z1UUH.js +1 -0
  115. package/dist/elements/chunks/store-th4VyJXM.js +1 -0
  116. package/dist/elements/chunks/text-shimmer-CEi-tlXr.js +1 -0
  117. package/dist/elements/chunks/textarea-CboigarR.js +1 -0
  118. package/dist/elements/chunks/thumbs-up-BR33KLfA.js +1 -0
  119. package/dist/elements/chunks/toast-store-BEMda0fv.js +1 -0
  120. package/dist/elements/chunks/tool-TMued3WO.js +1 -0
  121. package/dist/elements/chunks/tooltip-Cft_Rxiw.js +1 -0
  122. package/dist/elements/chunks/triangle-alert-B07fX3Q8.js +1 -0
  123. package/dist/elements/chunks/use-card-resolution-M36zVciB.js +1 -0
  124. package/dist/elements/chunks/video-MKp3LmNT.js +1 -0
  125. package/dist/elements/chunks/x-Ckwicf6g.js +1 -0
  126. package/dist/elements/coachmark.d.ts +1 -0
  127. package/dist/elements/coachmark.js +1 -0
  128. package/dist/elements/code-block.js +1 -1
  129. package/dist/elements/command.d.ts +1 -0
  130. package/dist/elements/command.js +1 -0
  131. package/dist/elements/compare.js +1 -1
  132. package/dist/elements/composer.d.ts +1 -0
  133. package/dist/elements/composer.js +1 -0
  134. package/dist/elements/confirm-card.js +1 -1
  135. package/dist/elements/context-meter.js +1 -1
  136. package/dist/elements/conversation-list.js +1 -1
  137. package/dist/elements/css.d.ts +1 -0
  138. package/dist/elements/default-input.d.ts +51 -0
  139. package/dist/elements/define.d.ts +53 -0
  140. package/dist/elements/dialog.d.ts +1 -0
  141. package/dist/elements/dialog.js +1 -0
  142. package/dist/elements/disclosure.d.ts +37 -0
  143. package/dist/elements/editable-label.d.ts +1 -0
  144. package/dist/elements/editable-label.js +1 -0
  145. package/dist/elements/embed.js +1 -1
  146. package/dist/elements/empty.js +1 -1
  147. package/dist/elements/feedback-bar.js +1 -1
  148. package/dist/elements/file-tree.js +1 -1
  149. package/dist/elements/file-upload.js +1 -1
  150. package/dist/elements/form.js +1 -1
  151. package/dist/elements/hover-card.d.ts +1 -0
  152. package/dist/elements/hover-card.js +1 -0
  153. package/dist/elements/icon.d.ts +1 -0
  154. package/dist/elements/icon.js +1 -0
  155. package/dist/elements/image.js +1 -1
  156. package/dist/elements/input.d.ts +1 -0
  157. package/dist/elements/input.js +1 -0
  158. package/dist/elements/kbd.d.ts +1 -0
  159. package/dist/elements/kbd.js +1 -0
  160. package/dist/elements/link-preview.js +1 -1
  161. package/dist/elements/loader.js +1 -1
  162. package/dist/elements/markdown.js +1 -1
  163. package/dist/elements/menu.d.ts +1 -0
  164. package/dist/elements/menu.js +1 -0
  165. package/dist/elements/message-skills.js +1 -1
  166. package/dist/elements/message.js +1 -1
  167. package/dist/elements/model-switcher.js +1 -1
  168. package/dist/elements/nav.d.ts +1 -0
  169. package/dist/elements/nav.js +1 -0
  170. package/dist/elements/notice.d.ts +1 -0
  171. package/dist/elements/notice.js +1 -0
  172. package/dist/elements/pane-group.d.ts +1 -0
  173. package/dist/elements/pane-group.js +1 -0
  174. package/dist/elements/pane.d.ts +1 -0
  175. package/dist/elements/pane.js +1 -0
  176. package/dist/elements/popover.js +1 -1
  177. package/dist/elements/progress-bar.d.ts +1 -0
  178. package/dist/elements/progress-bar.js +1 -0
  179. package/dist/elements/prompt-dock.d.ts +1 -0
  180. package/dist/elements/prompt-dock.js +1 -0
  181. package/dist/elements/prompt-input.js +1 -1
  182. package/dist/elements/prompt-suggestions.js +1 -1
  183. package/dist/elements/reasoning.js +1 -1
  184. package/dist/elements/register-impl.d.ts +0 -0
  185. package/dist/elements/register.d.ts +13 -0
  186. package/dist/elements/remote.d.ts +1 -0
  187. package/dist/elements/remote.js +1 -0
  188. package/dist/elements/resizable.js +1 -1
  189. package/dist/elements/response-stream.js +2 -2
  190. package/dist/elements/screen.d.ts +1 -0
  191. package/dist/elements/screen.js +1 -0
  192. package/dist/elements/scroll-area.d.ts +1 -0
  193. package/dist/elements/scroll-area.js +1 -0
  194. package/dist/elements/scroll-button.js +1 -1
  195. package/dist/elements/search.d.ts +1 -0
  196. package/dist/elements/search.js +1 -0
  197. package/dist/elements/segmented.d.ts +1 -0
  198. package/dist/elements/segmented.js +1 -0
  199. package/dist/elements/separator.d.ts +1 -0
  200. package/dist/elements/separator.js +1 -0
  201. package/dist/elements/setting-item.d.ts +1 -0
  202. package/dist/elements/setting-item.js +1 -0
  203. package/dist/elements/settings-group.d.ts +1 -0
  204. package/dist/elements/settings-group.js +1 -0
  205. package/dist/elements/skeleton.d.ts +1 -0
  206. package/dist/elements/skeleton.js +1 -0
  207. package/dist/elements/slots.d.ts +176 -0
  208. package/dist/elements/source.js +1 -1
  209. package/dist/elements/status.d.ts +1 -0
  210. package/dist/elements/status.js +1 -0
  211. package/dist/elements/switch.js +1 -1
  212. package/dist/elements/tabs.d.ts +1 -0
  213. package/dist/elements/tabs.js +1 -0
  214. package/dist/elements/tasks.js +1 -1
  215. package/dist/elements/text-shimmer.js +1 -1
  216. package/dist/elements/thinking-bar.js +1 -1
  217. package/dist/elements/toast.js +1 -1
  218. package/dist/elements/tool.js +1 -1
  219. package/dist/elements/tooltip.d.ts +1 -0
  220. package/dist/elements/tooltip.js +1 -0
  221. package/dist/elements/voice-input.js +1 -1
  222. package/dist/elements/voice-output.d.ts +1 -0
  223. package/dist/elements/voice-output.js +1 -0
  224. package/dist/elements.d.ts +733 -58
  225. package/dist/engine-javascript-C1x7zo1_.js +141 -0
  226. package/dist/index.d.ts +3 -2
  227. package/dist/index.js +8255 -5703
  228. package/dist/kai.es.js +1 -0
  229. package/dist/llms/llms-full.txt +1146 -64
  230. package/dist/llms/llms.txt +4 -4
  231. package/dist/mcp.es.js +62 -7
  232. package/dist/primitives/composer-model.d.ts +22 -0
  233. package/dist/primitives/composer-triggers.d.ts +19 -0
  234. package/dist/primitives/create-kai-chat.d.ts +38 -0
  235. package/dist/primitives/toast-store.d.ts +32 -2
  236. package/dist/primitives/use-speech-recognition.d.ts +26 -0
  237. package/dist/react/index.d.ts +1085 -97
  238. package/dist/react/runtime.d.ts +9 -2
  239. package/dist/react/use-kai-chat.d.ts +41 -0
  240. package/dist/react.js +572 -193
  241. package/dist/register-impl-cKscku5m.js +141 -0
  242. package/dist/schemas/tasks.schema.json +2 -2
  243. package/dist/state/index.d.ts +4 -0
  244. package/dist/state/messages.d.ts +11 -0
  245. package/dist/state/stream.d.ts +22 -0
  246. package/dist/state/suggestions.d.ts +4 -0
  247. package/dist/state.js +117 -0
  248. package/dist/theme.tokens.css +87 -0
  249. package/dist/types.d.ts +4 -0
  250. package/dist/ui/agent-card.d.ts +61 -0
  251. package/dist/ui/button.d.ts +5 -2
  252. package/dist/ui/card.d.ts +61 -0
  253. package/dist/ui/collapsible.d.ts +15 -1
  254. package/dist/ui/command.d.ts +33 -0
  255. package/dist/ui/dialog.d.ts +42 -0
  256. package/dist/ui/dropdown.d.ts +95 -1
  257. package/dist/ui/editable-label.d.ts +26 -0
  258. package/dist/ui/hover-card.d.ts +13 -1
  259. package/dist/ui/icon.d.ts +18 -0
  260. package/dist/ui/input.d.ts +33 -0
  261. package/dist/ui/kbd.d.ts +21 -0
  262. package/dist/ui/nav.d.ts +62 -0
  263. package/dist/ui/notice.d.ts +31 -0
  264. package/dist/ui/overlay.d.ts +12 -0
  265. package/dist/ui/pane-grid.d.ts +58 -0
  266. package/dist/ui/pane-group.d.ts +77 -0
  267. package/dist/ui/pane.d.ts +78 -0
  268. package/dist/ui/popover.d.ts +11 -1
  269. package/dist/ui/progress-bar.d.ts +23 -0
  270. package/dist/ui/prompt-dock.d.ts +96 -0
  271. package/dist/ui/resizable.d.ts +12 -0
  272. package/dist/ui/scroll-area.d.ts +4 -0
  273. package/dist/ui/segmented.d.ts +28 -0
  274. package/dist/ui/settings-group.d.ts +32 -0
  275. package/dist/ui/skeleton.d.ts +12 -0
  276. package/dist/ui/stat.d.ts +16 -0
  277. package/dist/ui/status.d.ts +13 -0
  278. package/dist/ui/switch.d.ts +8 -1
  279. package/dist/ui/tabs.d.ts +35 -0
  280. package/dist/ui/tooltip.d.ts +19 -1
  281. package/frameworks/react/index.tsx +1042 -157
  282. package/frameworks/react/runtime.tsx +30 -1
  283. package/frameworks/react/use-kai-chat.tsx +87 -0
  284. package/llms-full.txt +1146 -64
  285. package/llms.txt +4 -4
  286. package/package.json +31 -10
  287. package/src/agent-tooling/mcp/manifest.ts +14 -0
  288. package/src/agent-tooling/mcp/tools/debug.ts +11 -7
  289. package/src/agent-tooling/mcp/tools/reference.ts +32 -0
  290. package/src/agent-tooling/mcp/tools/scaffold.ts +30 -1
  291. package/src/components/artifact.tsx +98 -13
  292. package/src/components/attachment-types.ts +13 -0
  293. package/src/components/attachments.tsx +4 -14
  294. package/src/components/card.tsx +109 -15
  295. package/src/components/chain-of-thought.tsx +210 -1
  296. package/src/components/chat-scope-picker.tsx +13 -3
  297. package/src/components/chat-thread.tsx +225 -116
  298. package/src/components/choice-card.tsx +103 -11
  299. package/src/components/coachmark.tsx +249 -0
  300. package/src/components/component-meta.json +699 -110
  301. package/src/components/composer-dom.ts +159 -0
  302. package/src/components/composer-highlight.ts +242 -0
  303. package/src/components/composer-history.ts +82 -0
  304. package/src/components/composer.tsx +979 -0
  305. package/src/components/confirm-card.tsx +54 -1
  306. package/src/components/conversation-item.tsx +69 -7
  307. package/src/components/conversation-list.tsx +134 -37
  308. package/src/components/file-tree.tsx +197 -47
  309. package/src/components/form-widgets.tsx +9 -7
  310. package/src/components/form.tsx +140 -17
  311. package/src/components/image.tsx +3 -5
  312. package/src/components/link-preview.tsx +5 -4
  313. package/src/components/markdown.tsx +5 -2
  314. package/src/components/message.tsx +23 -4
  315. package/src/components/model-switcher.tsx +19 -4
  316. package/src/components/prompt-input.tsx +46 -75
  317. package/src/components/prompt-suggestion.tsx +48 -16
  318. package/src/components/reasoning.tsx +29 -6
  319. package/src/components/response-compare.tsx +31 -2
  320. package/src/components/screen.tsx +176 -0
  321. package/src/components/tasks-card.tsx +341 -21
  322. package/src/components/toast.tsx +119 -31
  323. package/src/components/tool-types.ts +10 -0
  324. package/src/components/tool.tsx +22 -16
  325. package/src/components/voice-input.tsx +102 -19
  326. package/src/components/voice-output.tsx +202 -0
  327. package/src/elements/agent-card.tsx +67 -0
  328. package/src/elements/artifact.tsx +53 -4
  329. package/src/elements/attachments.tsx +1 -0
  330. package/src/elements/avatar.tsx +33 -0
  331. package/src/elements/badge.tsx +32 -0
  332. package/src/elements/button.tsx +126 -0
  333. package/src/elements/card-media.jpg +0 -0
  334. package/src/elements/card.tsx +124 -31
  335. package/src/elements/cards.tsx +81 -7
  336. package/src/elements/chain-of-thought.tsx +77 -32
  337. package/src/elements/chat-scope-picker.tsx +35 -8
  338. package/src/elements/chat-types.ts +2 -2
  339. package/src/elements/chat-workspace.tsx +153 -41
  340. package/src/elements/chat.tsx +45 -23
  341. package/src/elements/choice.tsx +71 -19
  342. package/src/elements/coachmark.tsx +90 -0
  343. package/src/elements/command.tsx +209 -0
  344. package/src/elements/compare.tsx +24 -2
  345. package/src/elements/compiled.css +2 -2
  346. package/src/elements/composer.tsx +151 -0
  347. package/src/elements/confirm-card.tsx +36 -11
  348. package/src/elements/conversation-list.tsx +80 -11
  349. package/src/elements/default-input.tsx +75 -53
  350. package/src/elements/define.tsx +87 -7
  351. package/src/elements/dialog.tsx +98 -0
  352. package/src/elements/disclosure.ts +73 -0
  353. package/src/elements/editable-label.tsx +125 -0
  354. package/src/elements/element-manifest.json +129 -1
  355. package/src/elements/element-meta.json +5562 -1336
  356. package/src/elements/element-types.d.ts +732 -57
  357. package/src/elements/file-tree.tsx +12 -2
  358. package/src/elements/file-upload.tsx +1 -1
  359. package/src/elements/form.tsx +54 -11
  360. package/src/elements/hover-card.tsx +80 -0
  361. package/src/elements/icon-names.json +48 -0
  362. package/src/elements/icon.tsx +41 -0
  363. package/src/elements/input.tsx +203 -0
  364. package/src/elements/kbd.tsx +45 -0
  365. package/src/elements/menu.tsx +217 -0
  366. package/src/elements/message.tsx +58 -11
  367. package/src/elements/model-switcher.tsx +27 -1
  368. package/src/elements/nav.tsx +87 -0
  369. package/src/elements/notice.tsx +53 -0
  370. package/src/elements/pane-group.tsx +119 -0
  371. package/src/elements/pane.tsx +129 -0
  372. package/src/elements/popover.tsx +39 -17
  373. package/src/elements/progress-bar.tsx +39 -0
  374. package/src/elements/prompt-dock.tsx +81 -0
  375. package/src/elements/prompt-input.tsx +112 -63
  376. package/src/elements/prompt-suggestions.tsx +25 -9
  377. package/src/elements/reasoning.tsx +30 -9
  378. package/src/elements/register-impl.ts +38 -3
  379. package/src/elements/register.ts +11 -3
  380. package/src/elements/resizable.tsx +48 -11
  381. package/src/elements/screen.tsx +90 -0
  382. package/src/elements/scroll-area.tsx +33 -0
  383. package/src/elements/search.tsx +180 -0
  384. package/src/elements/segmented.tsx +135 -0
  385. package/src/elements/separator.tsx +36 -0
  386. package/src/elements/setting-item.tsx +50 -0
  387. package/src/elements/settings-group.tsx +37 -0
  388. package/src/elements/skeleton.tsx +45 -0
  389. package/src/elements/slots.ts +607 -0
  390. package/src/elements/source.tsx +13 -6
  391. package/src/elements/status.tsx +42 -0
  392. package/src/elements/switch.tsx +89 -14
  393. package/src/elements/tabs.tsx +95 -0
  394. package/src/elements/tasks.tsx +70 -14
  395. package/src/elements/toast.tsx +17 -2
  396. package/src/elements/tool.tsx +43 -9
  397. package/src/elements/tooltip.tsx +85 -0
  398. package/src/elements/video-poster.jpg +0 -0
  399. package/src/elements/voice-input.tsx +66 -16
  400. package/src/elements/voice-output.tsx +69 -0
  401. package/src/index.ts +5 -2
  402. package/src/primitives/card-schemas/tasks.schema.json +2 -2
  403. package/src/primitives/composer-model.ts +49 -0
  404. package/src/primitives/composer-triggers.ts +35 -0
  405. package/src/primitives/create-kai-chat.ts +66 -0
  406. package/src/primitives/toast-store.ts +43 -2
  407. package/src/primitives/use-speech-recognition.ts +135 -0
  408. package/src/state/index.ts +6 -0
  409. package/src/state/messages.ts +36 -0
  410. package/src/state/stream.ts +92 -0
  411. package/src/state/suggestions.ts +9 -0
  412. package/src/types.ts +4 -0
  413. package/src/ui/agent-card.tsx +218 -0
  414. package/src/ui/button.tsx +16 -5
  415. package/src/ui/card.tsx +245 -0
  416. package/src/ui/collapsible.tsx +30 -4
  417. package/src/ui/command.tsx +99 -0
  418. package/src/ui/dialog.tsx +217 -0
  419. package/src/ui/dropdown.tsx +375 -13
  420. package/src/ui/editable-label.tsx +112 -0
  421. package/src/ui/hover-card.tsx +28 -5
  422. package/src/ui/icon.tsx +110 -0
  423. package/src/ui/input.tsx +132 -0
  424. package/src/ui/kbd.tsx +118 -0
  425. package/src/ui/nav.tsx +282 -0
  426. package/src/ui/notice.tsx +84 -0
  427. package/src/ui/overlay.tsx +108 -2
  428. package/src/ui/pane-grid.tsx +117 -0
  429. package/src/ui/pane-group.tsx +291 -0
  430. package/src/ui/pane.tsx +193 -0
  431. package/src/ui/popover.tsx +16 -2
  432. package/src/ui/progress-bar.tsx +83 -0
  433. package/src/ui/prompt-dock.tsx +145 -0
  434. package/src/ui/resizable.tsx +69 -1
  435. package/src/ui/scroll-area.tsx +14 -3
  436. package/src/ui/segmented.tsx +109 -0
  437. package/src/ui/settings-group.tsx +67 -0
  438. package/src/ui/skeleton.tsx +62 -5
  439. package/src/ui/stat.tsx +41 -0
  440. package/src/ui/status.tsx +48 -0
  441. package/src/ui/switch.tsx +49 -23
  442. package/src/ui/tabs.tsx +168 -0
  443. package/src/ui/tooltip.tsx +52 -8
  444. package/theme.css +113 -0
  445. package/dist/components/slash-command.d.ts +0 -15
  446. package/dist/elements/chunks/Icon-D_Zmwmwh.js +0 -1
  447. package/dist/elements/chunks/action-icons-PVfIvcuG.js +0 -1
  448. package/dist/elements/chunks/attachments-Dp6vqtrc.js +0 -1
  449. package/dist/elements/chunks/button-CKyYD9G4.js +0 -1
  450. package/dist/elements/chunks/card-Cjho-PYk.js +0 -1
  451. package/dist/elements/chunks/chat-thread-RT808iPf.js +0 -1
  452. package/dist/elements/chunks/check-CDYaMYrM.js +0 -1
  453. package/dist/elements/chunks/chevron-down-3SBiq8HF.js +0 -1
  454. package/dist/elements/chunks/chevron-right-k2UFlIVK.js +0 -1
  455. package/dist/elements/chunks/cn-Dogu6PbV.js +0 -1
  456. package/dist/elements/chunks/code-block-BYUmfFSd.js +0 -1
  457. package/dist/elements/chunks/collapsible-BiNwdOn6.js +0 -1
  458. package/dist/elements/chunks/context-18g6oi4J.js +0 -1
  459. package/dist/elements/chunks/conversation-list-D9Y0NVdo.js +0 -1
  460. package/dist/elements/chunks/default-input-CSAoYYMd.js +0 -1
  461. package/dist/elements/chunks/download-D8K0Je8r.js +0 -1
  462. package/dist/elements/chunks/dropdown-bUs2iTia.js +0 -1
  463. package/dist/elements/chunks/external-link-6mA0wxab.js +0 -1
  464. package/dist/elements/chunks/file-text-DnaYk3Dm.js +0 -1
  465. package/dist/elements/chunks/file-tree-CgtRLlxK.js +0 -1
  466. package/dist/elements/chunks/hover-card-CIGw62gP.js +0 -1
  467. package/dist/elements/chunks/link-BlGSeoPy.js +0 -1
  468. package/dist/elements/chunks/loader-DvhR4qa0.js +0 -1
  469. package/dist/elements/chunks/message-CDZwXjhL.js +0 -1
  470. package/dist/elements/chunks/message-feedback-CYx81QiA.js +0 -1
  471. package/dist/elements/chunks/model-switcher-O_tUhoOT.js +0 -1
  472. package/dist/elements/chunks/overlay-DydXYMQW.js +0 -1
  473. package/dist/elements/chunks/prompt-suggestion-ldlWV5kd.js +0 -1
  474. package/dist/elements/chunks/reasoning-2PUnHlmr.js +0 -1
  475. package/dist/elements/chunks/resizable-B5WNbSeb.js +0 -1
  476. package/dist/elements/chunks/star-t9tI-P0q.js +0 -1
  477. package/dist/elements/chunks/store-C6rIooZz.js +0 -1
  478. package/dist/elements/chunks/text-shimmer-uh9V_KUh.js +0 -1
  479. package/dist/elements/chunks/textarea-3nm6Ia9U.js +0 -1
  480. package/dist/elements/chunks/thumbs-up-BBtguGld.js +0 -1
  481. package/dist/elements/chunks/toast-store-D8cL3fWl.js +0 -1
  482. package/dist/elements/chunks/tool-GJ3vwp1U.js +0 -1
  483. package/dist/elements/chunks/tooltip-DwKAz4XR.js +0 -1
  484. package/dist/elements/chunks/triangle-alert-Ct1zt2JL.js +0 -1
  485. package/dist/elements/chunks/use-card-resolution-D-_0Alzy.js +0 -1
  486. package/dist/elements/chunks/video-mVYiM99-.js +0 -1
  487. package/dist/elements/chunks/x-CzxL27Ch.js +0 -1
  488. package/dist/kitn-chat.es.js +0 -1
  489. package/dist/register-JyTglR6m.js +0 -1
  490. package/dist/register-impl-C6wlSsts.js +0 -77
  491. package/src/components/slash-command.tsx +0 -232
  492. package/src/elements/framework-usage.json +0 -588
  493. /package/dist/{kitn-chat-provider.d.ts → kai-provider.d.ts} +0 -0
  494. /package/dist/{kitn-chat-provider.es.js → kai-provider.es.js} +0 -0
@@ -1 +1 @@
1
- import{q as K,a as W,l as V,p as Y,b as ee,o as te,i as ie,c as N,S as ne,r as X,h as Z,g as c,G as re,F as ae,A as se,t as z}from"./chunks/cn-Dogu6PbV.js";import{n as de,b as oe}from"./chunks/resizable-B5WNbSeb.js";var le=z("<style>:host{display:block;height:100%}"),ue=z("<div data-resizable-root style=display:flex;width:100%;height:100%>"),me=z('<div data-panel style="display:grid;grid-template-rows:minmax(0, 1fr);grid-template-columns:minmax(0, 1fr);min-width:0;min-height:0;overflow:hidden"><slot>'),ce=z("<style>:host{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:auto}"),he=z('<div style="display:grid;grid-template-rows:minmax(0, 1fr);grid-template-columns:minmax(0, 1fr);width:100%;height:100%;min-width:0;min-height:0"><slot>');const fe="kai-maximize-intent",ve="kai-maximize-state",E=3;function $(m){if(m===void 0||m==="")return{};const s=m.trim();return s.endsWith("px")?{pxAttr:String(parseFloat(s))}:s.endsWith("%")?{pctAttr:String(parseFloat(s))}:Number.isFinite(Number(s))?{pctAttr:s}:{}}K("kai-resizable",{orientation:"horizontal",maximizedIndex:null},(m,{element:s,dispatch:y})=>{const[f,G]=W([]),g=()=>m.orientation==="vertical"?"vertical":"horizontal";function p(){const e=Array.from(s.children).filter(t=>t.tagName.toLowerCase()==="kai-resizable-item");e.length>E&&console.warn(`<kai-resizable>: only the first ${E} <kai-resizable-item> children are laid out (got ${e.length}). Nest <kai-resizable> for more.`);const i=e.slice(0,E).map(t=>{t.hasAttribute("data-kai-default-size")||t.setAttribute("data-kai-default-size",t.getAttribute("size")??"");const r=t.getAttribute("data-kai-default-size")||void 0;return{el:t,size:t.getAttribute("size")??void 0,defaultSize:r,min:t.getAttribute("min")??void 0,max:t.getAttribute("max")??void 0,locked:t.hasAttribute("locked")&&t.getAttribute("locked")!=="false",hidden:t.hidden||t.hasAttribute("hidden")&&t.getAttribute("hidden")!=="false"}});let n=0;for(const t of i)t.hidden?t.el.removeAttribute("slot"):(t.el.setAttribute("slot",`p${n}`),n++);for(const t of e.slice(E))t.removeAttribute("slot");O(f(),i)&&G(i)}function O(e,i){if(e.length!==i.length)return!0;for(let n=0;n<e.length;n++){const t=e[n],r=i[n];if(t.el!==r.el||t.size!==r.size||t.min!==r.min||t.max!==r.max||t.locked!==r.locked||t.hidden!==r.hidden)return!0}return!1}const x=()=>f().filter(e=>!e.hidden);function M(){return x().map(e=>{var i;const n=((i=e.el.assignedSlot)==null?void 0:i.closest("[data-panel]"))??e.el,t=n.parentElement,r=g()==="horizontal"?"width":"height",a=t?t.getBoundingClientRect()[r]:0,o=n.getBoundingClientRect()[r];return a>0?Math.round(o/a*100):0})}function k(){y("kai-change",{sizes:M()})}let C=!1;function j(){const e=x(),i=M();e.length===i.length&&(C=!0,e.forEach((n,t)=>{const r=i[t];Number.isFinite(r)&&r>0&&n.el.setAttribute("size",`${r}%`)}),queueMicrotask(()=>{C=!1}))}const[A,q]=W(null);let b=!1;function D(e){let i=e instanceof Element?e:e?.parentElement??null;const n=f().map(t=>t.el);for(;i;){if(i instanceof HTMLElement&&n.includes(i))return i;i=i.parentElement??i.getRootNode().host??null}return null}function J(e){return{size:e.getAttribute("size"),hidden:e.hidden||e.hasAttribute("hidden")&&e.getAttribute("hidden")!=="false",locked:e.hasAttribute("locked")&&e.getAttribute("locked")!=="false"}}function w(e,i,n){n?e.setAttribute(i,""):e.removeAttribute(i)}function I(e){const i=f(),n=i.findIndex(u=>u.el===e);if(n<0)return;const t=A();if(t){if(t.item===e)return;v()}b=!0;const r=M();let a=0;const o=i.map(u=>{const h=J(u.el);if(!h.hidden){const l=r[a++];Number.isFinite(l)&&l>0&&u.el.setAttribute("size",`${l}%`)}return{el:u.el,size:u.el.getAttribute("size"),hidden:h.hidden,locked:h.locked}});i.forEach((u,h)=>{h===n?(u.el.removeAttribute("size"),u.el.removeAttribute("locked"),w(u.el,"hidden",!1)):w(u.el,"hidden",!0)}),q({item:e,saved:o}),s.setAttribute("data-maximized",""),e.setAttribute("data-maximized-panel",""),p(),k(),queueMicrotask(()=>{b=!1}),e.dispatchEvent(new CustomEvent("kai-maximize-state",{detail:{maximized:!0},bubbles:!1,composed:!0})),y("kai-maximize-change",{maximized:!0,index:n})}function v(){const e=A();if(!e)return;b=!0;for(const n of e.saved)n.el.isConnected&&(n.size===null?n.el.removeAttribute("size"):n.el.setAttribute("size",n.size),w(n.el,"hidden",n.hidden),w(n.el,"locked",n.locked),n.el.removeAttribute("data-maximized-panel"));const i=e.item;q(null),s.removeAttribute("data-maximized"),p(),k(),queueMicrotask(()=>{b=!1}),s.dispatchEvent(new CustomEvent("kai-maximize-state",{detail:{maximized:!1},bubbles:!1,composed:!0})),i?.dispatchEvent(new CustomEvent("kai-maximize-state",{detail:{maximized:!1},bubbles:!1,composed:!0})),y("kai-maximize-change",{maximized:!1,index:null})}V(()=>{p();const e=r=>{const a=r;r.stopPropagation();const o=D(a.target);o&&(a.detail.requested?I(o):v())};s.addEventListener("kai-maximize-intent",e);const i=r=>{r.key!=="Escape"||!A()||(r.stopPropagation(),v())};s.addEventListener("keydown",i,!0);const n=new MutationObserver(()=>{if(C)return;p();const r=A();if(r){const a=r.item,o=a.isConnected&&s.contains(a),u=o&&!(a.hidden||a.hasAttribute("hidden"));if(!o||!u){v();return}}b||queueMicrotask(k)});n.observe(s,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["size","locked","min","max","hidden"]}),Y(()=>{n.disconnect(),s.removeEventListener("kai-maximize-intent",e),s.removeEventListener("keydown",i,!0)});const t=s;t.maximize=r=>{var a;const o=(a=f()[r])==null?void 0:a.el;o&&I(o)},t.restore=()=>v(),ee(te(()=>m.maximizedIndex,r=>{var a;if(r==null)v();else{const o=(a=f()[r])==null?void 0:a.el;o&&I(o)}},{defer:!0}))});const Q=()=>g()==="horizontal";return[le(),(()=>{var e=ue();return ie(e,N(ae,{get each(){return x()},children:(i,n)=>{const t=$(i.min),r=$(i.max),a=$(i.defaultSize),o=de(i.size),u=()=>x()[n()-1],h=()=>{var l;return!!(i.locked||(l=u())!=null&&l.locked)};return[N(ne,{get when(){return n()>0},get children(){return N(oe,{withHandle:!0,get orientation(){return g()},get static(){return h()},onPanelResize:()=>{j(),queueMicrotask(k)}})}}),(()=>{var l=me(),F=l.firstChild;return F._$owner=X(),Z(d=>{var L=i.locked?"":void 0,S=t.pxAttr,_=t.pctAttr,T=r.pxAttr,R=r.pctAttr,P=a.pxAttr,B=a.pctAttr,U={...o!==void 0?{"flex-basis":o,"flex-grow":"0","flex-shrink":"0"}:{flex:"1 1 0%"}},H=`p${n()}`;return L!==d.e&&c(l,"data-locked",d.e=L),S!==d.t&&c(l,"data-min-size",d.t=S),_!==d.a&&c(l,"data-min-size-pct",d.a=_),T!==d.o&&c(l,"data-max-size",d.o=T),R!==d.i&&c(l,"data-max-size-pct",d.i=R),P!==d.n&&c(l,"data-default-size",d.n=P),B!==d.s&&c(l,"data-default-size-pct",d.s=B),d.h=re(l,U,d.h),H!==d.r&&c(F,"name",d.r=H),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),l})()]}})),Z(i=>{var n=g(),t=Q()?"row":"column";return n!==i.e&&c(e,"data-orientation",i.e=n),t!==i.t&&se(e,"flex-direction",i.t=t),i},{e:void 0,t:void 0}),e})()]}),K("kai-resizable-item",{size:void 0,min:void 0,max:void 0,locked:!1,hidden:!1},()=>[ce(),(()=>{var m=he(),s=m.firstChild;return s._$owner=X(),m})()]);export{fe as KAI_MAXIMIZE_INTENT,ve as KAI_MAXIMIZE_STATE};
1
+ import{f as X,g as Z,o as ee,i as te,c as $,S as ie,q as G,a as O,d as m,G as ne,F as ae,z as oe,h as j,t as b,p as se,l as re}from"./chunks/define-CNSKFZCd.js";import{c as de,n as q,b as le}from"./chunks/resizable-Bq_eHxUm.js";var ce=b("<style>:host{display:block;height:100%}"),ue=b("<div data-resizable-root style=display:flex;width:100%;height:100%>"),me=b('<div data-panel style="display:grid;grid-template-rows:minmax(0, 1fr);grid-template-columns:minmax(0, 1fr);min-width:0;min-height:0;overflow:hidden"><slot>'),he=b("<style>:host{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:auto}"),fe=b('<div style="display:grid;grid-template-rows:minmax(0, 1fr);grid-template-columns:minmax(0, 1fr);width:100%;height:100%;min-width:0;min-height:0"><slot>');const ve="kai-maximize-intent",pe="kai-maximize-state",y=3;function F(h){if(h===void 0||h==="")return{};const s=h.trim();return s.endsWith("px")?{pxAttr:String(parseFloat(s))}:s.endsWith("%")?{pctAttr:String(parseFloat(s))}:Number.isFinite(Number(s))?{pctAttr:s}:{}}X("kai-resizable",{orientation:"horizontal",maximizedIndex:null},(h,{element:s,dispatch:p})=>{const[u,M]=Z([]),g=()=>h.orientation==="vertical"?"vertical":"horizontal";function A(){const t=Array.from(s.children).filter(e=>e.tagName.toLowerCase()==="kai-resizable-item");t.length>y&&console.warn(`<kai-resizable>: only the first ${y} <kai-resizable-item> children are laid out (got ${t.length}). Nest <kai-resizable> for more.`);const i=t.slice(0,y).map(e=>{e.hasAttribute("data-kai-default-size")||e.setAttribute("data-kai-default-size",e.getAttribute("size")??"");const a=e.getAttribute("data-kai-default-size")||void 0,o=e.hasAttribute("collapsed")&&e.getAttribute("collapsed")!=="false";return{el:e,size:e.getAttribute("size")??void 0,defaultSize:a,min:e.getAttribute("min")??void 0,max:e.getAttribute("max")??void 0,locked:e.hasAttribute("locked")&&e.getAttribute("locked")!=="false",hidden:e.hidden||e.hasAttribute("hidden")&&e.getAttribute("hidden")!=="false",collapsed:o}});let n=0;for(const e of i)e.hidden||e.collapsed?e.el.removeAttribute("slot"):(e.el.setAttribute("slot",`p${n}`),n++);for(const e of t.slice(y))e.removeAttribute("slot");D(u(),i)&&M(i)}function D(t,i){if(t.length!==i.length)return!0;for(let n=0;n<t.length;n++){const e=t[n],a=i[n];if(e.el!==a.el||e.size!==a.size||e.min!==a.min||e.max!==a.max||e.locked!==a.locked||e.hidden!==a.hidden||e.collapsed!==a.collapsed)return!0}return!1}const x=()=>u().filter(t=>!t.hidden&&!t.collapsed);function C(){return x().map(t=>{var i;const n=((i=t.el.assignedSlot)==null?void 0:i.closest("[data-panel]"))??t.el,e=n.parentElement,a=g()==="horizontal"?"width":"height",o=e?e.getBoundingClientRect()[a]:0,d=n.getBoundingClientRect()[a];return o>0?Math.round(d/o*100):0})}function k(){p("kai-change",{sizes:C()})}let I=!1;function J(){const t=x(),i=C();t.length===i.length&&(I=!0,t.forEach((n,e)=>{const a=i[e];Number.isFinite(a)&&a>0&&n.el.setAttribute("size",`${a}%`)}),queueMicrotask(()=>{I=!1}))}const[w,L]=Z(null);let z=!1;function Q(t){let i=t instanceof Element?t:t?.parentElement??null;const n=u().map(e=>e.el);for(;i;){if(i instanceof HTMLElement&&n.includes(i))return i;i=i.parentElement??i.getRootNode().host??null}return null}function U(t){return{size:t.getAttribute("size"),hidden:t.hidden||t.hasAttribute("hidden")&&t.getAttribute("hidden")!=="false",locked:t.hasAttribute("locked")&&t.getAttribute("locked")!=="false"}}function E(t,i,n){n?t.setAttribute(i,""):t.removeAttribute(i)}function N(t){const i=u(),n=i.findIndex(c=>c.el===t);if(n<0)return;const e=w();if(e){if(e.item===t)return;v()}z=!0;const a=C();let o=0;const d=i.map(c=>{const f=U(c.el);if(!f.hidden){const l=a[o++];Number.isFinite(l)&&l>0&&c.el.setAttribute("size",`${l}%`)}return{el:c.el,size:c.el.getAttribute("size"),hidden:f.hidden,locked:f.locked}});i.forEach((c,f)=>{f===n?(c.el.removeAttribute("size"),c.el.removeAttribute("locked"),E(c.el,"hidden",!1)):E(c.el,"hidden",!0)}),L({item:t,saved:d}),s.setAttribute("data-maximized",""),t.setAttribute("data-maximized-panel",""),A(),k(),queueMicrotask(()=>{z=!1}),t.dispatchEvent(new CustomEvent("kai-maximize-state",{detail:{maximized:!0},bubbles:!1,composed:!0})),p("kai-maximize-change",{maximized:!0,index:n})}function v(){const t=w();if(!t)return;z=!0;for(const n of t.saved)n.el.isConnected&&(n.size===null?n.el.removeAttribute("size"):n.el.setAttribute("size",n.size),E(n.el,"hidden",n.hidden),E(n.el,"locked",n.locked),n.el.removeAttribute("data-maximized-panel"));const i=t.item;L(null),s.removeAttribute("data-maximized"),A(),k(),queueMicrotask(()=>{z=!1}),s.dispatchEvent(new CustomEvent("kai-maximize-state",{detail:{maximized:!1},bubbles:!1,composed:!0})),i?.dispatchEvent(new CustomEvent("kai-maximize-state",{detail:{maximized:!1},bubbles:!1,composed:!0})),p("kai-maximize-change",{maximized:!1,index:null})}ee(()=>{A();const t=a=>{const o=a;a.stopPropagation();const d=Q(o.target);d&&(o.detail.requested?N(d):v())};s.addEventListener("kai-maximize-intent",t);const i=a=>{a.key!=="Escape"||!w()||(a.stopPropagation(),v())};s.addEventListener("keydown",i,!0);const n=new MutationObserver(()=>{if(I)return;A();const a=w();if(a){const o=a.item,d=o.isConnected&&s.contains(o),c=d&&!(o.hidden||o.hasAttribute("hidden"))&&!(o.hasAttribute("collapsed")&&o.getAttribute("collapsed")!=="false");if(!d||!c){v();return}}z||queueMicrotask(k)});n.observe(s,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["size","locked","min","max","hidden","collapsed"]}),se(()=>{n.disconnect(),s.removeEventListener("kai-maximize-intent",t),s.removeEventListener("keydown",i,!0)});const e=s;e.maximize=a=>{var o;const d=(o=u()[a])==null?void 0:o.el;d&&N(d)},e.restore=()=>v(),j(re(()=>h.maximizedIndex,a=>{var o;if(a==null)v();else{const d=(o=u()[a])==null?void 0:o.el;d&&N(d)}},{defer:!0}))});const V=()=>g()==="horizontal";return[ce(),(()=>{var t=ue();return te(t,$(ae,{get each(){return x()},children:(i,n)=>{const e=F(i.min),a=F(i.max),o=F(i.defaultSize),d=de(q(i.size),q(i.min),q(i.max)),c=()=>x()[n()-1],f=()=>{var l;return!!(i.locked||(l=c())!=null&&l.locked)};return[$(ie,{get when(){return n()>0},get children(){return $(le,{withHandle:!0,get orientation(){return g()},get static(){return f()},onPanelResize:()=>{J(),queueMicrotask(k)}})}}),(()=>{var l=me(),S=l.firstChild;return S._$owner=G(),O(r=>{var _=i.locked?"":void 0,T=e.pxAttr,R=e.pctAttr,P=a.pxAttr,B=a.pctAttr,H=o.pxAttr,K=o.pctAttr,Y={...d!==void 0?{"flex-basis":d,"flex-grow":"0","flex-shrink":"0"}:{flex:"1 1 0%"}},W=`p${n()}`;return _!==r.e&&m(l,"data-locked",r.e=_),T!==r.t&&m(l,"data-min-size",r.t=T),R!==r.a&&m(l,"data-min-size-pct",r.a=R),P!==r.o&&m(l,"data-max-size",r.o=P),B!==r.i&&m(l,"data-max-size-pct",r.i=B),H!==r.n&&m(l,"data-default-size",r.n=H),K!==r.s&&m(l,"data-default-size-pct",r.s=K),r.h=ne(l,Y,r.h),W!==r.r&&m(S,"name",r.r=W),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),l})()]}})),O(i=>{var n=g(),e=V()?"row":"column";return n!==i.e&&m(t,"data-orientation",i.e=n),e!==i.t&&oe(t,"flex-direction",i.t=e),i},{e:void 0,t:void 0}),t})()]}),X("kai-resizable-item",{size:void 0,min:void 0,max:void 0,locked:!1,hidden:!1,collapsed:!1},(h,{element:s,flag:p})=>(j(()=>{s.toggleAttribute("collapsed",p("collapsed"))}),[he(),(()=>{var u=fe(),M=u.firstChild;return M._$owner=G(),u})()]));export{ve as KAI_MAXIMIZE_INTENT,pe as KAI_MAXIMIZE_STATE};
@@ -1,4 +1,4 @@
1
- import{a as M,p as A,s as B,b,o as D,i as v,c as C,F,h as I,j as E,k as z,A as G,n as H,S as J,t as x,q as K}from"./chunks/cn-Dogu6PbV.js";function L(t){const e=t.speed??20,y=t.characterChunkSize??3,[f,i]=M(""),[S,u]=M(!0),[a,n]=M([]);let s="",d=0,m,o=!1,r;function l(){m!==void 0&&(clearInterval(m),m=void 0)}function p(){if(!o){if(d>=s.length){r||(l(),u(!0));return}d=Math.min(d+y,s.length),i(s.slice(0,d))}}async function q(c){r=c[Symbol.asyncIterator]();try{for(;;){const{value:h,done:k}=await r.next();if(k)break;h&&(s+=h,n(g=>[...g,{text:h,index:g.length}]))}}finally{r=void 0}}function $(c){if(w(),u(!1),typeof c=="string")if(s=c,t.mode==="typewriter")m=setInterval(p,e);else{const h=c.split(/(\s+)/).filter(Boolean);n(h.map((k,g)=>({text:k,index:g}))),i(c)}else t.mode==="typewriter"&&(m=setInterval(p,e)),q(c).then(()=>{t.mode==="fade"&&(i(s),u(!0))})}function T(){o=!0}function j(){o=!1}function w(){l(),s="",d=0,o=!1,r=void 0,i(""),u(!0),n([])}return A(()=>l()),{displayedText:f,isComplete:S,segments:a,startStreaming:$,pause:T,resume:j,reset:w}}var N=x("<style>"),P=x("<div class=relative>"),R=x("<div>"),W=x("<span>");function _(t){const[e]=B(t,["textStream","mode","speed","class","onComplete","as","fadeDuration","segmentDelay","characterChunkSize"]),y=()=>e.mode??"typewriter",f=()=>e.speed??20,i=L({mode:y(),speed:f(),characterChunkSize:e.characterChunkSize,fadeDuration:e.fadeDuration});b(D(()=>e.textStream,a=>{a&&i.startStreaming(a)})),b(D(()=>i.isComplete(),a=>{var n;a&&((n=e.onComplete)==null||n.call(e))}));const S=()=>`
1
+ import{g as k,p as j,s as A,h as b,l as D,i as v,c as C,F as E,a as I,b as z,z as F,n as G,S as H,t as x,f as J}from"./chunks/define-CNSKFZCd.js";import{c as K}from"./chunks/cn-CU7UAWzk.js";function L(t){const e=t.speed??20,y=t.characterChunkSize??3,[f,i]=k(""),[S,u]=k(!0),[a,n]=k([]);let s="",d=0,m,o=!1,r;function l(){m!==void 0&&(clearInterval(m),m=void 0)}function p(){if(!o){if(d>=s.length){r||(l(),u(!0));return}d=Math.min(d+y,s.length),i(s.slice(0,d))}}async function $(c){r=c[Symbol.asyncIterator]();try{for(;;){const{value:h,done:M}=await r.next();if(M)break;h&&(s+=h,n(g=>[...g,{text:h,index:g.length}]))}}finally{r=void 0}}function q(c){if(w(),u(!1),typeof c=="string")if(s=c,t.mode==="typewriter")m=setInterval(p,e);else{const h=c.split(/(\s+)/).filter(Boolean);n(h.map((M,g)=>({text:M,index:g}))),i(c)}else t.mode==="typewriter"&&(m=setInterval(p,e)),$(c).then(()=>{t.mode==="fade"&&(i(s),u(!0))})}function T(){o=!0}function B(){o=!1}function w(){l(),s="",d=0,o=!1,r=void 0,i(""),u(!0),n([])}return j(()=>l()),{displayedText:f,isComplete:S,segments:a,startStreaming:q,pause:T,resume:B,reset:w}}var N=x("<style>"),P=x("<div class=relative>"),R=x("<div>"),W=x("<span>");function _(t){const[e]=A(t,["textStream","mode","speed","class","onComplete","as","fadeDuration","segmentDelay","characterChunkSize"]),y=()=>e.mode??"typewriter",f=()=>e.speed??20,i=L({mode:y(),speed:f(),characterChunkSize:e.characterChunkSize,fadeDuration:e.fadeDuration});b(D(()=>e.textStream,a=>{a&&i.startStreaming(a)})),b(D(()=>i.isComplete(),a=>{var n;a&&((n=e.onComplete)==null||n.call(e))}));const S=()=>`
2
2
  @keyframes fadeIn {
3
3
  from { opacity: 0; }
4
4
  to { opacity: 1; }
@@ -11,4 +11,4 @@ import{a as M,p as A,s as B,b,o as D,i as v,c as C,F,h as I,j as E,k as z,A as G
11
11
  .fade-segment-space {
12
12
  white-space: pre;
13
13
  }
14
- `,u=()=>{if(typeof e.segmentDelay=="number")return Math.max(0,e.segmentDelay);const a=Math.min(100,Math.max(1,f()));return Math.max(1,Math.round(100/Math.sqrt(a)))};return(()=>{var a=R();return v(a,C(J,{get when(){return y()==="fade"},get fallback(){return H(()=>i.displayedText())},get children(){return[(()=>{var n=N();return v(n,S),n})(),(()=>{var n=P();return v(n,C(F,{get each(){return i.segments()},children:(s,d)=>{const m=()=>/^\s+$/.test(s.text);return(()=>{var o=W();return v(o,()=>s.text),I(r=>{var l=E("fade-segment",m()&&"fade-segment-space"),p=`${d()*u()}ms`;return l!==r.e&&z(o,r.e=l),p!==r.t&&G(o,"animation-delay",r.t=p),r},{e:void 0,t:void 0}),o})()}})),n})()]}})),I(()=>z(a,e.class)),a})()}K("kai-response-stream",{text:"",mode:"typewriter",speed:20,as:void 0},(t,{dispatch:e})=>C(_,{get textStream(){return t.text??""},get mode(){return t.mode},get speed(){return t.speed},get as(){return t.as},class:"text-body",onComplete:()=>e("kai-complete")}));
14
+ `,u=()=>{if(typeof e.segmentDelay=="number")return Math.max(0,e.segmentDelay);const a=Math.min(100,Math.max(1,f()));return Math.max(1,Math.round(100/Math.sqrt(a)))};return(()=>{var a=R();return v(a,C(H,{get when(){return y()==="fade"},get fallback(){return G(()=>i.displayedText())},get children(){return[(()=>{var n=N();return v(n,S),n})(),(()=>{var n=P();return v(n,C(E,{get each(){return i.segments()},children:(s,d)=>{const m=()=>/^\s+$/.test(s.text);return(()=>{var o=W();return v(o,()=>s.text),I(r=>{var l=K("fade-segment",m()&&"fade-segment-space"),p=`${d()*u()}ms`;return l!==r.e&&z(o,r.e=l),p!==r.t&&F(o,"animation-delay",r.t=p),r},{e:void 0,t:void 0}),o})()}})),n})()]}})),I(()=>z(a,e.class)),a})()}J("kai-response-stream",{text:"",mode:"typewriter",speed:20,as:void 0},(t,{dispatch:e})=>C(_,{get textStream(){return t.text??""},get mode(){return t.mode},get speed(){return t.speed},get as(){return t.as},class:"text-body",onComplete:()=>e("kai-complete")}));
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{g as B,h as E,p as _,c as g,u as H,d as k,i as s,S,a as M,b as j,t as f,e as P,f as D,q as y}from"./chunks/define-CNSKFZCd.js";import{c as F}from"./chunks/cn-CU7UAWzk.js";import{c as G}from"./chunks/overlay-B1-MBI6h.js";import{a as J}from"./chunks/arrow-left-GbBceGBE.js";import{w as K}from"./chunks/disclosure-BcBs--Jf.js";var L=f('<button part=back type=button aria-label=Back class="inline-flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">'),N=f('<div part=body role=dialog aria-modal=true tabindex=-1><header part=header class="flex shrink-0 items-center gap-2 border-b border-border px-3 py-2"><h2 part=title class="min-w-0 flex-1 truncate text-sm font-semibold text-foreground"></h2><div class="flex shrink-0 items-center gap-1"></div></header><div class="min-h-0 flex-1 overflow-auto">');let Q=0;function T(t){var d;const[v,b]=B(t.defaultOpen??!1),h=`kai-screen-title-${++Q}`,m=()=>t.open!==void 0,l=()=>m()?!!t.open:v(),u=e=>{var r;m()||b(e),(r=t.onOpenChange)==null||r.call(t,e)};(d=t.controllerRef)==null||d.call(t,{open:l,setOpen:u});const n=G(l);let x,A=null,w=[];const C=()=>t.back!==!1,$=()=>{var e;return(e=t.onBack)==null?void 0:e.call(t)},q=()=>{var e;if(t.noInert)return;const r=(e=t.host)==null?void 0:e.call(t),o=r?.parentElement;if(!(!r||!o))for(const p of Array.from(o.children)){if(p===r)continue;const i=p;w.push({el:i,hadInert:i.hasAttribute("inert"),hadAriaHidden:i.getAttribute("aria-hidden")}),i.setAttribute("inert",""),i.setAttribute("aria-hidden","true")}},I=()=>{for(const{el:e,hadInert:r,hadAriaHidden:o}of w)r||e.removeAttribute("inert"),o===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",o);w=[]};E(e=>{const r=l();if(r&&!e)A=document.activeElement??null,q(),queueMicrotask(()=>x?.focus());else if(!r&&e){I();const o=A;A=null,o&&o.isConnected&&queueMicrotask(()=>o.focus())}return r},!1),_(I);const z=e=>{e.key==="Escape"&&(e.stopPropagation(),$())};return g(S,{get when(){return n.present()},get children(){var e=N(),r=e.firstChild,o=r.firstChild,p=o.nextSibling,i=r.nextSibling;return e.$$keydown=z,H(a=>{var c;x=a,n.setRef(a),(c=t.surfaceRef)==null||c.call(t,a)},e),k(e,"aria-labelledby",h),s(r,g(S,{get when(){return C()},get children(){var a=L();return a.$$click=$,s(a,g(J,{size:16,"aria-hidden":"true"})),a}}),o),k(o,"id",h),s(o,()=>t.titleSlot??t.title),s(p,()=>t.actions),s(i,()=>t.children),M(a=>{var c=n.state()==="open"?"":void 0,O=n.state()==="closed"?"":void 0,R=F("absolute inset-0 z-40 flex flex-col bg-background text-foreground outline-none","animate-in fade-in-0 slide-in-from-bottom-2 motion-reduce:animate-none","data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:slide-out-to-bottom-2");return c!==a.e&&k(e,"data-expanded",a.e=c),O!==a.t&&k(e,"data-closed",a.t=O),R!==a.a&&j(e,a.a=R),a},{e:void 0,t:void 0,a:void 0}),e}})}P(["keydown","click"]);var U=f("<slot>"),V=f("<slot name=title>"),W=f("<slot name=actions>");D("kai-screen",{open:void 0,defaultOpen:void 0,headline:void 0,back:void 0,noInert:void 0},(t,d)=>{const{flag:v,element:b,dispatch:h,expose:m}=d;let l,u;return K(d,()=>l,()=>t.open),m({focus:n=>u?.focus(n)}),g(T,{get defaultOpen(){return v("defaultOpen")},get back(){return!(t.back===!1||b.getAttribute("back")==="false")},get noInert(){return v("noInert")},host:()=>b,get titleSlot(){return(()=>{var n=V();return n._$owner=y(),s(n,()=>t.headline),n})()},get actions(){return(()=>{var n=W();return n._$owner=y(),n})()},onBack:()=>{h("kai-back",{})},controllerRef:n=>l=n,surfaceRef:n=>u=n,get children(){var n=U();return n._$owner=y(),n}})});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as l,c as o,q as i,t as a}from"./chunks/define-CNSKFZCd.js";import{S as e}from"./chunks/scroll-area-g5Ze3K6f.js";var n=a("<style>:host{display:block;min-height:0}"),s=a("<slot>");l("kai-scroll-area",{orientation:"vertical"},r=>[n(),o(e,{class:"h-full max-h-full w-full max-w-full",part:"viewport",get orientation(){return r.orientation},get children(){var t=s();return t._$owner=i(),t}})]);
@@ -1 +1 @@
1
- import{q as h,a as v,l as g,p as E,c,j as y}from"./chunks/cn-Dogu6PbV.js";import{B as H}from"./chunks/button-CKyYD9G4.js";import{c as b}from"./chunks/chevron-down-3SBiq8HF.js";const w=50;function k(n){let t=n.parentElement;for(;t&&t!==document.documentElement;){const r=getComputedStyle(t),l=r.overflow+r.overflowY;if(/auto|scroll/.test(l)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}h("kai-scroll-button",{for:void 0,variant:"outline",size:"icon"},(n,{element:t,dispatch:r})=>{const[l,a]=v(!0);let o=null,i=[];function s(){if(!o)return;const{scrollTop:e,scrollHeight:p,clientHeight:d}=o;a(p-e-d<w)}function u(){o&&(o.scrollTo({top:o.scrollHeight,behavior:"smooth"}),a(!0))}function f(e){o=e,e.addEventListener("scroll",s,{passive:!0}),s(),i.push(()=>e.removeEventListener("scroll",s))}function m(){i.forEach(e=>e()),i=[],o=null}return g(()=>{const e=n.for?document.getElementById(n.for):k(t);e&&f(e)}),E(m),c(H,{get variant(){return n.variant??"outline"},get size(){return n.size??"icon"},"aria-label":"Scroll to bottom",get class(){return y("rounded-full transition-all duration-150 ease-out",l()?"pointer-events-none translate-y-4 scale-95 opacity-0":"translate-y-0 scale-100 opacity-100")},onClick:()=>{u(),r("kai-scroll")},get children(){return c(b,{class:"h-5 w-5"})}})});
1
+ import{f as g,g as h,o as v,p as E,c as a}from"./chunks/define-CNSKFZCd.js";import{c as y}from"./chunks/cn-CU7UAWzk.js";import{B as H}from"./chunks/button-DBDZebGr.js";import{c as b}from"./chunks/chevron-down-DcRg1aRU.js";const w=50;function k(r){let t=r.parentElement;for(;t&&t!==document.documentElement;){const n=getComputedStyle(t),l=n.overflow+n.overflowY;if(/auto|scroll/.test(l)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}g("kai-scroll-button",{for:void 0,variant:"outline",size:"icon"},(r,{element:t,dispatch:n})=>{const[l,c]=h(!0);let o=null,i=[];function s(){if(!o)return;const{scrollTop:e,scrollHeight:p,clientHeight:d}=o;c(p-e-d<w)}function u(){o&&(o.scrollTo({top:o.scrollHeight,behavior:"smooth"}),c(!0))}function f(e){o=e,e.addEventListener("scroll",s,{passive:!0}),s(),i.push(()=>e.removeEventListener("scroll",s))}function m(){i.forEach(e=>e()),i=[],o=null}return v(()=>{const e=r.for?document.getElementById(r.for):k(t);e&&f(e)}),E(m),a(H,{get variant(){return r.variant??"outline"},get size(){return r.size??"icon"},"aria-label":"Scroll to bottom",get class(){return y("rounded-full transition-all duration-150 ease-out",l()?"pointer-events-none translate-y-4 scale-95 opacity-0":"translate-y-0 scale-100 opacity-100")},onClick:()=>{u(),n("kai-scroll")},get children(){return a(b,{class:"h-5 w-5"})}})});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as C,e as S,g as j,A as g,h as T,c as i,S as u,i as I,n as K,t as v}from"./chunks/define-CNSKFZCd.js";import{I as V}from"./chunks/input-DZD67EvW.js";import{K as $}from"./chunks/kbd-DbyVrlnU.js";import{L as E}from"./chunks/loader-Cg6rO8tQ.js";import{r as m}from"./chunks/icon-CAyRqVrg.js";var L=v('<button type=button part=clear aria-label=Clear class="inline-flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">'),N=v("<style>:host{display:block}");C("kai-search",{value:void 0,placeholder:"Search\u2026",icon:"search",debounce:200,loading:!1,shortcut:void 0},(a,d)=>{const{element:t,dispatch:n,flag:b,expose:f}=d,[r,l]=j(a.value??t.getAttribute("value")??""),p=e=>e==null?t.getAttribute("value")??"":String(e);Object.defineProperty(t,"value",{get:()=>r(),set:e=>{const h=p(e);g(r)!==h&&l(h)},configurable:!0,enumerable:!0}),T(()=>{const e=r();e?t.getAttribute("value")!==e&&t.setAttribute("value",e):t.hasAttribute("value")&&t.removeAttribute("value")});let s;const k=()=>{const e=Number(a.debounce??200);return Number.isFinite(e)&&e>=0?e:200},y=e=>{s&&clearTimeout(s),s=setTimeout(()=>n("kai-search",{value:e}),k())},o=()=>{var e;return((e=t.shadowRoot)==null?void 0:e.querySelector("input"))??null},z=e=>{l(e),y(e)},c=()=>{var e;s&&clearTimeout(s),l(""),n("kai-search",{value:""}),(e=o())==null||e.focus()},A=e=>{e.key==="Enter"&&n("kai-submit",{value:g(r)})};f({focus:()=>{var e;return(e=o())==null?void 0:e.focus()},clear:c});const x=i(u,{get when(){return b("loading")},get fallback(){return m(a.icon??"search",{class:"size-4 shrink-0",imgClass:"size-4 shrink-0",spanClass:"inline-flex size-4 shrink-0 items-center justify-center",ariaHidden:!0})},get children(){return i(E,{variant:"circular",size:"sm"})}}),w=[i(u,{get when(){return r()},get children(){var e=L();return e.$$click=c,I(e,()=>m("x",{class:"size-4",imgClass:"size-4"})),e}}),i(u,{get when(){return K(()=>!r())()&&a.shortcut},get children(){return i($,{get keys(){return a.shortcut},size:"sm",class:"opacity-80"})}})];return[N(),i(V,{type:"search",get value(){return r()},get placeholder(){return a.placeholder??"Search\u2026"},leading:x,trailing:w,onValueInput:z,onValueChange:e=>n("kai-change",{value:e}),onKeyDown:A})]}),S(["click"]);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{m as C,i as g,c as m,u as D,S as $,a as x,d as y,b as A,F as j,t as f,e as H,f as M,g as S,A as w,h as E}from"./chunks/define-CNSKFZCd.js";import{c as z}from"./chunks/cn-CU7UAWzk.js";import{r as F}from"./chunks/icon-CAyRqVrg.js";var I=f("<div role=group part=track>"),L=f('<span class="inline-flex shrink-0 items-center"aria-hidden=true>'),P=f("<button type=button part=segment><span>");const R={sm:"h-7 px-2 text-xs",md:"h-8 px-3 text-sm"};function K(u){const r=C({size:"md"},u),i=[],c=()=>r.options.findIndex(t=>t.value===r.value),s=t=>{var n;const o=r.options[t];o&&(r.onChange(o.value),(n=i[t])==null||n.focus())},d=t=>{const n=r.options.length;if(n===0)return;const o=c();t.key==="ArrowRight"||t.key==="ArrowDown"?(t.preventDefault(),s((Math.max(o,0)+1)%n)):t.key==="ArrowLeft"||t.key==="ArrowUp"?(t.preventDefault(),s((Math.max(o,0)-1+n)%n)):t.key==="Home"?(t.preventDefault(),s(0)):t.key==="End"&&(t.preventDefault(),s(n-1))};return(()=>{var t=I();return t.$$keydown=d,g(t,m(j,{get each(){return r.options},children:(n,o)=>{const e=()=>n.value===r.value,v=()=>e()||c()===-1&&o()===0;return(()=>{var l=P(),p=l.firstChild;return l.$$click=()=>r.onChange(n.value),D(a=>{i[o()]=a},l),g(l,m($,{get when(){return n.icon},get children(){var a=L();return g(a,()=>n.icon),a}}),p),g(p,()=>n.label),x(a=>{var h=e(),b=v()?0:-1,k=z("inline-flex items-center justify-center gap-1.5 rounded-md font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",R[r.size],e()?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground");return h!==a.e&&y(l,"aria-pressed",a.e=h),b!==a.t&&y(l,"tabindex",a.t=b),k!==a.a&&A(l,a.a=k),a},{e:void 0,t:void 0,a:void 0}),l})()}})),x(()=>A(t,z("inline-flex items-center gap-0.5 rounded-lg bg-surface-sunken p-0.5",r.class))),t})()}H(["keydown","click"]);var O=f("<style>:host{display:inline-flex}");M("kai-segmented",{options:[],value:void 0,size:"md"},(u,r)=>{const{element:i,dispatch:c}=r,[s,d]=S(u.value??i.getAttribute("value")??""),t=e=>e==null?i.getAttribute("value")??"":String(e),n=e=>{w(s)!==e&&(d(e),c("kai-change",{value:e}))};Object.defineProperty(i,"value",{get:()=>s(),set:e=>{const v=t(e);w(s)!==v&&d(v)},configurable:!0,enumerable:!0}),E(()=>{const e=s();e?i.getAttribute("value")!==e&&i.setAttribute("value",e):i.hasAttribute("value")&&i.removeAttribute("value")});const o=()=>(u.options??[]).map(e=>({value:e.value,label:e.label,icon:e.icon?F(e.icon,{class:"size-4 shrink-0",imgClass:"size-4 shrink-0",spanClass:"inline-flex size-4 shrink-0 items-center justify-center",ariaHidden:!0}):void 0}));return[O(),m(K,{get options(){return o()},get value(){return s()},get size(){return u.size??"md"},onChange:e=>n(e)})]});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as o,i,c as e,t as n}from"./chunks/define-CNSKFZCd.js";import{S as s}from"./chunks/separator-Bmjc5XyX.js";var l=n("<style>");o("kai-separator",{orientation:"horizontal"},a=>{const t=()=>a.orientation==="vertical";return[(()=>{var r=l();return i(r,()=>t()?":host{display:inline-block;align-self:stretch}":":host{display:block}"),r})(),e(s,{get orientation(){return t()?"vertical":"horizontal"},part:"separator"})]});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as i,g as a,o as c,c as l,n as u,q as b,t as d,p as m}from"./chunks/define-CNSKFZCd.js";import{S as p}from"./chunks/settings-group-9imY3kRA.js";var g=d("<slot name=control>");i("kai-setting-item",{label:"",description:void 0},(t,{element:r})=>{const[s,n]=a(!1);return c(()=>{const e=()=>n(!!r.querySelector(':scope > [slot="control"]'));e();const o=new MutationObserver(e);o.observe(r,{childList:!0,attributes:!0,subtree:!0}),m(()=>o.disconnect())}),l(p,{get label(){return t.label??""},get description(){return t.description},get control(){return u(()=>!!s())()?(()=>{var e=g();return e._$owner=b(),e})():void 0}})});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as t,c as e,q as n,t as o}from"./chunks/define-CNSKFZCd.js";import{a}from"./chunks/settings-group-9imY3kRA.js";var s=o("<slot>");t("kai-settings-group",{heading:"",description:void 0},r=>e(a,{get heading(){return r.heading??""},get description(){return r.description},get children(){var i=s();return i._$owner=n(),i}}));
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as e,c as i,n as r,t as a}from"./chunks/define-CNSKFZCd.js";import{S as n}from"./chunks/skeleton-Pjc5jiaY.js";var s=a("<style>:host{display:block}");e("kai-skeleton",{variant:"text",width:void 0,height:void 0,lines:void 0},t=>[s(),i(n,{get variant(){return t.variant??"text"},get width(){return t.width},get height(){return t.height},get lines(){return r(()=>t.lines!=null)()?Number(t.lines):void 0}})]);
@@ -0,0 +1,176 @@
1
+ /**
2
+ * Composition slots for `kai-*` elements. A slot is a named region a consumer
3
+ * fills with their own markup. This registry is the SINGLE SOURCE OF TRUTH:
4
+ * the facade derives its detection from it (and, later, docs are generated
5
+ * from it). See docs/superpowers/specs/2026-06-23-kai-chat-composition-seams-design.md.
6
+ */
7
+ /** `inject` = additive (the built-in region still renders, your markup is added
8
+ * in). `replace` = your markup stands in for the whole region — you own that
9
+ * region's data + events (a slotted light-DOM node can't read the component's
10
+ * reactive state). */
11
+ export type SlotMode = 'inject' | 'replace';
12
+ export interface SlotDef {
13
+ /** Slot name (kebab-case). Also the `::part` name when `part` is true. */
14
+ name: string;
15
+ mode: SlotMode;
16
+ /** Expose `::part(name)` on the region wrapper for consumer styling. */
17
+ part?: boolean;
18
+ /** One-line contract: what the consumer projects / owns. Feeds the docs. */
19
+ doc: string;
20
+ }
21
+ /** Slots of `<kai-chat>`, in render order. */
22
+ export declare const CHAT_SLOTS: SlotDef[];
23
+ /** Slots of `<kai-prompt-input>` (and the default composer inside `<kai-chat>`). Native
24
+ * shadow slots — an empty slot renders nothing, so no facade flag-gating is required.
25
+ *
26
+ * These are ONLY positions inside the card's shadow boundary — places a consumer
27
+ * cannot reach from their own DOM. Content ABOVE/BELOW the whole card is the
28
+ * consumer's own light-DOM layout (a sibling element), so there is intentionally
29
+ * no outer block slot here. (When the input is nested inside `<kai-chat>`'s shadow,
30
+ * that surrounding hole belongs to `kai-chat` — see `composer-actions`/`footer`.) */
31
+ export declare const PROMPT_INPUT_SLOTS: SlotDef[];
32
+ /** Slots of `<kai-conversations>` (also used inside `<kai-chat>`'s `sidebar`).
33
+ * Names mirror `<kai-chat>`'s so the two compose with one vocabulary. */
34
+ export declare const CONVERSATIONS_SLOTS: SlotDef[];
35
+ /** Styleable `::part`s of `<kai-conversations>`. */
36
+ export declare const CONVERSATIONS_PARTS: PartDef[];
37
+ /** Slots of `<kai-message>` — per-message composition seams. `before-body` and
38
+ * `after-body` are INJECT regions inside the message's body column; `avatar`
39
+ * REPLACES the built-in avatar rail (pair it with `avatar="none"` to omit the
40
+ * rail entirely). These are the keystone of compose-your-own message lists. */
41
+ export declare const MESSAGE_SLOTS: SlotDef[];
42
+ /** Slots of `<kai-notice>`. The message is the default slot; these are the named seams. */
43
+ export declare const NOTICE_SLOTS: SlotDef[];
44
+ /** Slots of `<kai-button>` (the label is the default slot). */
45
+ export declare const BUTTON_SLOTS: SlotDef[];
46
+ /** Slots of `<kai-hover-card>` (the trigger is the default slot). */
47
+ export declare const HOVER_CARD_SLOTS: SlotDef[];
48
+ /** Slots of `<kai-menu>` (the menu items come from the `items` prop). */
49
+ export declare const MENU_SLOTS: SlotDef[];
50
+ /** A styleable `::part` the kit renders (NOT a slot — you don't project into it;
51
+ * you restyle it from outside via `::part(name)`). This registry is the source
52
+ * of truth so the styling surface is discoverable: docs + the `kai` MCP
53
+ * component reference are generated from it, the same way slots are. The
54
+ * `recipe` is a copy-pasteable example — including the "just hide it" case that
55
+ * is pure CSS and therefore intentionally NOT a prop. */
56
+ export interface PartDef {
57
+ /** `::part(name)` exposed for consumer styling. */
58
+ name: string;
59
+ /** One-line contract: what the part is. */
60
+ doc: string;
61
+ /** A copy-pasteable styling example for docs / the MCP reference. */
62
+ recipe?: string;
63
+ }
64
+ /** Styleable `::part`s of `<kai-chat>` (beyond the slot-backed `header`/`sidebar`/
65
+ * `footer` parts). */
66
+ export declare const CHAT_PARTS: PartDef[];
67
+ /** Styleable `::part`s of `<kai-prompt-input>`. */
68
+ export declare const PROMPT_INPUT_PARTS: PartDef[];
69
+ /** Styleable `::part`s of `<kai-button>`. */
70
+ export declare const BUTTON_PARTS: PartDef[];
71
+ /** Styleable `::part`s of `<kai-badge>`. */
72
+ export declare const BADGE_PARTS: PartDef[];
73
+ /** Styleable `::part`s of `<kai-icon>`. */
74
+ export declare const ICON_PARTS: PartDef[];
75
+ /** Styleable `::part`s of `<kai-separator>`. */
76
+ export declare const SEPARATOR_PARTS: PartDef[];
77
+ /** Styleable `::part`s of `<kai-scroll-area>`. */
78
+ export declare const SCROLL_AREA_PARTS: PartDef[];
79
+ /** Styleable `::part`s of `<kai-skeleton>`. */
80
+ export declare const SKELETON_PARTS: PartDef[];
81
+ /** Styleable `::part`s of `<kai-message>`. (The `avatar` part is contributed by
82
+ * the `avatar` slot's `part: true` flag, so it is not repeated here.) */
83
+ export declare const MESSAGE_PARTS: PartDef[];
84
+ /** Styleable `::part`s of `<kai-attachments>`. */
85
+ export declare const ATTACHMENTS_PARTS: PartDef[];
86
+ /** Styleable `::part`s of `<kai-status>`. */
87
+ export declare const STATUS_PARTS: PartDef[];
88
+ /** Styleable `::part`s of `<kai-tabs>`. */
89
+ export declare const TABS_PARTS: PartDef[];
90
+ /** Styleable `::part`s of `<kai-voice-output>`. */
91
+ export declare const VOICE_OUTPUT_PARTS: PartDef[];
92
+ /** Slots of `<kai-screen>` (the default slot is the screen body). */
93
+ export declare const SCREEN_SLOTS: SlotDef[];
94
+ /** Styleable `::part`s of `<kai-screen>`. */
95
+ export declare const SCREEN_PARTS: PartDef[];
96
+ /** Slots of `<kai-card>` — structural regions only (the title/description are body
97
+ * or `slot="header"` content you mark up). The body is the default slot. */
98
+ export declare const CARD_SLOTS: SlotDef[];
99
+ /** Styleable `::part`s of `<kai-card>`. */
100
+ export declare const CARD_PARTS: PartDef[];
101
+ /** Injection slots of `<kai-workspace>` (the carrier regions the consumer drops
102
+ * content into: brand/tabs, the upgrade/Design/user-menu cluster, a top banner). */
103
+ export declare const WORKSPACE_SLOTS: SlotDef[];
104
+ /** Styleable `::part`s of `<kai-workspace>`. */
105
+ export declare const WORKSPACE_PARTS: PartDef[];
106
+ /** Styleable `::part`s of `<kai-nav>`. */
107
+ export declare const NAV_PARTS: PartDef[];
108
+ /** Slots of `<kai-coachmark>` (the anchor/trigger is the default slot). */
109
+ export declare const COACHMARK_SLOTS: SlotDef[];
110
+ /** Styleable `::part`s of `<kai-coachmark>`. */
111
+ export declare const COACHMARK_PARTS: PartDef[];
112
+ /** Styleable `::part`s of `<kai-progress-bar>`. */
113
+ export declare const PROGRESS_BAR_PARTS: PartDef[];
114
+ /** Styleable `::part`s of `<kai-file-tree>` — the changed-files / diff bits, shown
115
+ * only when a file carries diff metadata (or the `summary` attribute is set). */
116
+ export declare const FILE_TREE_PARTS: PartDef[];
117
+ /**
118
+ * Per-element composition surface — the SINGLE registry the build extracts
119
+ * (`scripts/gen-element-api.mjs`) into `element-meta.json`, the Custom Elements
120
+ * Manifest (`cssParts`/`slots`), `docs/web-components.md`, and the `kai` MCP
121
+ * `component_reference`. Each entry maps a `kai-*` tag to the slots it projects
122
+ * and the `::part`s it exposes for styling. Slots flagged `part: true` are ALSO
123
+ * styleable parts, so they surface in both places.
124
+ *
125
+ * Adding a `part="…"` in a facade/component without registering it here fails the
126
+ * `slots.test.ts` drift guard — keep this in sync with the source.
127
+ */
128
+ export interface ElementComposition {
129
+ slots?: SlotDef[];
130
+ parts?: PartDef[];
131
+ }
132
+ /** Slots + styleable `::part`s of `<kai-prompt-dock>`. */
133
+ export declare const PROMPT_DOCK_SLOTS: SlotDef[];
134
+ export declare const PROMPT_DOCK_PARTS: PartDef[];
135
+ /** Styleable `::part`s of `<kai-segmented>`. */
136
+ export declare const SEGMENTED_PARTS: PartDef[];
137
+ /** Styleable `::part`s of `<kai-settings-group>`. */
138
+ export declare const SETTINGS_GROUP_PARTS: PartDef[];
139
+ /** Slots + styleable `::part`s of `<kai-setting-item>`. */
140
+ export declare const SETTING_ITEM_SLOTS: SlotDef[];
141
+ export declare const SETTING_ITEM_PARTS: PartDef[];
142
+ /** Slots + styleable `::part`s of `<kai-pane>` (the editor-group pane frame). */
143
+ export declare const PANE_SLOTS: SlotDef[];
144
+ export declare const PANE_PARTS: PartDef[];
145
+ /** Styleable `::part`s of `<kai-agent-card>`. */
146
+ export declare const AGENT_CARD_PARTS: PartDef[];
147
+ /** Slots + styleable `::part`s of `<kai-dialog>` (the centered modal). */
148
+ export declare const DIALOG_SLOTS: SlotDef[];
149
+ export declare const DIALOG_PARTS: PartDef[];
150
+ /** Styleable `::part`s of `<kai-pane-group>` (the editor group: a tab strip over
151
+ * the active tab's pane). The per-tab content slots are NAMED DYNAMICALLY by tab
152
+ * id (`slot="<tab id>"`) plus a default slot, so they are not enumerable here —
153
+ * only the styleable parts are registered. */
154
+ export declare const PANE_GROUP_PARTS: PartDef[];
155
+ /** Affix slots + styleable `::part`s of `<kai-input>` (the field shell). */
156
+ export declare const INPUT_SLOTS: SlotDef[];
157
+ export declare const INPUT_PARTS: PartDef[];
158
+ /** Styleable `::part`s of `<kai-search>` (the debounced filter field; composes the
159
+ * kai-input field plus a clear button). */
160
+ export declare const SEARCH_PARTS: PartDef[];
161
+ /** Styleable `::part`s of `<kai-editable-label>` (inline rename; the edit field is the kai-input field). */
162
+ export declare const EDITABLE_LABEL_PARTS: PartDef[];
163
+ /** Styleable `::part`s of `<kai-kbd>` (the keyboard-shortcut display). */
164
+ export declare const KBD_PARTS: PartDef[];
165
+ /** Styleable `::part`s of `<kai-command>` (the command palette). */
166
+ export declare const COMMAND_PARTS: PartDef[];
167
+ /** Styleable `::part`s of `<kai-menu>` (the actions dropdown). */
168
+ export declare const MENU_PARTS: PartDef[];
169
+ export declare const ELEMENT_COMPOSITION: Record<string, ElementComposition>;
170
+ /**
171
+ * Which slots have projected light-DOM content — a DIRECT child of `host`
172
+ * carrying the matching `slot` attribute. Pure and synchronous; safe in jsdom
173
+ * and SSR (returns all-false when `host` has no matching children). The facade
174
+ * calls this on mount and on every childList mutation.
175
+ */
176
+ export declare function readSlots(host: Element, defs?: SlotDef[]): Record<string, boolean>;
@@ -1 +1 @@
1
- import{c as t,i as u,S as m,h,g as f,j as v,k as w,v as C,w as z,t as g,q as b,a as _,l as R,p as U,F as q,n as E}from"./chunks/cn-Dogu6PbV.js";import{a as I,b as L,c as $}from"./chunks/hover-card-CIGw62gP.js";var j=g('<img alt=favicon width=14 height=14 class="size-3.5 rounded-full">'),M=g('<a target=_blank rel="noopener noreferrer"><span class="truncate tabular-nums text-center font-normal">'),D=g('<a target=_blank rel="noopener noreferrer"class="flex flex-col gap-2 p-3"><div class="flex items-center gap-1.5"><img alt=favicon class="size-4 rounded-full"width=16 height=16><div class="text-primary truncate text-sm"></div></div><div class="line-clamp-2 text-sm font-medium"></div><div class="text-muted-foreground line-clamp-2 text-sm">'),H=g("<div>");const x=C();function F(){const e=z(x);if(!e)throw new Error("Source.* must be used inside <Source>");return e}function S(e){const r=()=>{try{return new URL(e.href).hostname}catch{return e.href.split("/").pop()||e.href}};return t(x.Provider,{value:{get href(){return e.href},get domain(){return r()}},get children(){return t(I,{openDelay:150,get children(){return e.children}})}})}function k(e){const r=F(),a=()=>e.label??r.domain.replace("www.","");return t(L,{get children(){var o=M(),l=o.firstChild;return u(o,t(m,{get when(){return e.showFavicon},get children(){var i=j();return h(()=>f(i,"src",`https://www.google.com/s2/favicons?sz=64&domain_url=${encodeURIComponent(r.href)}`)),i}}),l),u(l,a),h(i=>{var c=r.href,n=v("bg-muted text-foreground/80 hover:bg-muted-foreground/30 hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background inline-flex h-5 max-w-32 items-center gap-1 overflow-hidden rounded-full py-0 text-xs no-underline transition-colors duration-150",e.showFavicon?"pr-2 pl-1":"px-2",e.class);return c!==i.e&&f(o,"href",i.e=c),n!==i.t&&w(o,i.t=n),i},{e:void 0,t:void 0}),o}})}function A(e){const r=F();return t($,{get class(){return v("w-80 p-0 shadow-xs",e.class)},get children(){var a=D(),o=a.firstChild,l=o.firstChild,i=l.nextSibling,c=o.nextSibling,n=c.nextSibling;return u(i,()=>r.domain.replace("www.","")),u(c,()=>e.title),u(n,()=>e.description),h(s=>{var d=r.href,p=`https://www.google.com/s2/favicons?sz=64&domain_url=${encodeURIComponent(r.href)}`;return d!==s.e&&f(a,"href",s.e=d),p!==s.t&&f(l,"src",s.t=p),s},{e:void 0,t:void 0}),a}})}function K(e){return(()=>{var r=H();return u(r,()=>e.children),h(()=>w(r,v("flex flex-wrap gap-1.5 mt-3",e.class))),r})()}b("kai-source",{href:"",label:void 0,headline:"",description:"",showFavicon:!1},(e,{flag:r})=>t(m,{get when(){return e.href},get children(){return t(S,{get href(){return e.href},get children(){return[t(k,{get label(){return e.label},get showFavicon(){return r("showFavicon")}}),t(A,{get title(){return e.headline??""},get description(){return e.description??""}})]}})}}));function y(e){return{href:e.getAttribute("href")??"",label:e.getAttribute("label")??void 0,title:e.getAttribute("headline")??void 0,description:e.getAttribute("description")??void 0,showFavicon:e.hasAttribute("show-favicon")&&e.getAttribute("show-favicon")!=="false"}}b("kai-sources",{sources:[],showFavicon:!1,numbered:!1},(e,{element:r,flag:a})=>{const[o,l]=_([]);R(()=>{const n=()=>{const d=[...r.querySelectorAll("kai-source")];l(d.map(y))};n();const s=new MutationObserver(n);s.observe(r,{childList:!0,attributes:!0,subtree:!0}),U(()=>s.disconnect())});const i=()=>[...e.sources,...o()],c=()=>a("numbered");return t(K,{get children(){return t(q,{get each(){return i()},children:(n,s)=>t(S,{get href(){return n.href},get children(){return[t(k,{get label(){return E(()=>!!c())()?s()+1:n.label},get showFavicon(){return n.showFavicon??a("showFavicon")}}),t(A,{get title(){return n.title??""},get description(){return n.description??""}})]}})})}})});export{y as parseKaiSourceElement};
1
+ import{c as t,i as u,S as m,a as f,d as g,b as w,v as C,w as z,t as d,f as b,g as _,o as R,F as U,n as E,p as I}from"./chunks/define-CNSKFZCd.js";import{c as v}from"./chunks/cn-CU7UAWzk.js";import{a as L,b as $,c as q}from"./chunks/hover-card-BQGdGAQ3.js";var D=d('<img alt=favicon width=14 height=14 class="size-3.5 rounded-full">'),K=d('<a target=_blank rel="noopener noreferrer"><span class="truncate tabular-nums text-center font-normal">'),M=d('<a target=_blank rel="noopener noreferrer"class="flex flex-col gap-2 p-3"><div class="flex items-center gap-1.5"><img alt=favicon class="size-4 rounded-full"width=16 height=16><div class="text-primary truncate text-sm"></div></div><div class="line-clamp-2 text-sm font-medium"></div><div class="text-muted-foreground line-clamp-2 text-sm">'),H=d("<div>");const x=C();function F(){const e=z(x);if(!e)throw new Error("Source.* must be used inside <Source>");return e}function y(e){const r=()=>{try{return new URL(e.href).hostname}catch{return e.href.split("/").pop()||e.href}};return t(x.Provider,{value:{get href(){return e.href},get domain(){return r()}},get children(){return t(L,{openDelay:150,get children(){return e.children}})}})}function S(e){const r=F(),a=()=>e.label??r.domain.replace("www.","");return t($,{get children(){var o=K(),l=o.firstChild;return u(o,t(m,{get when(){return e.showFavicon},get children(){var i=D();return f(()=>g(i,"src",`https://www.google.com/s2/favicons?sz=64&domain_url=${encodeURIComponent(r.href)}`)),i}}),l),u(l,a),f(i=>{var c=r.href,n=v("bg-muted text-foreground/80 hover:bg-muted-foreground/30 hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background inline-flex h-5 max-w-32 items-center gap-1 overflow-hidden rounded-full py-0 text-xs no-underline transition-colors duration-150",e.showFavicon?"pr-2 pl-1":"px-2",e.class);return c!==i.e&&g(o,"href",i.e=c),n!==i.t&&w(o,i.t=n),i},{e:void 0,t:void 0}),o}})}function A(e){const r=F();return t(q,{get class(){return v("w-80 p-0 shadow-xs",e.class)},get children(){var a=M(),o=a.firstChild,l=o.firstChild,i=l.nextSibling,c=o.nextSibling,n=c.nextSibling;return u(i,()=>r.domain.replace("www.","")),u(c,()=>e.title),u(n,()=>e.description),f(s=>{var h=r.href,p=`https://www.google.com/s2/favicons?sz=64&domain_url=${encodeURIComponent(r.href)}`;return h!==s.e&&g(a,"href",s.e=h),p!==s.t&&g(l,"src",s.t=p),s},{e:void 0,t:void 0}),a}})}function N(e){return(()=>{var r=H();return u(r,()=>e.children),f(()=>w(r,v("flex flex-wrap gap-1.5 mt-3",e.class))),r})()}var O=d("<style>:host{display:inline-flex}");b("kai-source",{href:"",label:void 0,headline:"",description:"",showFavicon:!1},(e,{flag:r})=>[O(),t(m,{get when(){return e.href},get children(){return t(y,{get href(){return e.href},get children(){return[t(S,{get label(){return e.label},get showFavicon(){return r("showFavicon")}}),t(A,{get title(){return e.headline??""},get description(){return e.description??""}})]}})}})]);function k(e){return{href:e.getAttribute("href")??"",label:e.getAttribute("label")??void 0,title:e.getAttribute("headline")??void 0,description:e.getAttribute("description")??void 0,showFavicon:e.hasAttribute("show-favicon")&&e.getAttribute("show-favicon")!=="false"}}b("kai-sources",{sources:[],showFavicon:!1,numbered:!1},(e,{element:r,flag:a})=>{const[o,l]=_([]);R(()=>{const n=()=>{const h=[...r.querySelectorAll("kai-source")];l(h.map(k))};n();const s=new MutationObserver(n);s.observe(r,{childList:!0,attributes:!0,subtree:!0}),I(()=>s.disconnect())});const i=()=>[...e.sources,...o()],c=()=>a("numbered");return t(N,{get children(){return t(U,{get each(){return i()},children:(n,s)=>t(y,{get href(){return n.href},get children(){return[t(S,{get label(){return E(()=>!!c())()?s()+1:n.label},get showFavicon(){return n.showFavicon??a("showFavicon")}}),t(A,{get title(){return n.title??""},get description(){return n.description??""}})]}})})}})});export{k as parseKaiSourceElement};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{s as h,i as w,c as g,a as m,b as p,S as z,k as y,m as k,d as l,t as r,f as x}from"./chunks/define-CNSKFZCd.js";import{c as i}from"./chunks/cn-CU7UAWzk.js";var C=r("<span aria-hidden=true>"),S=r("<span><span>");const v={new:"bg-tool-blue",online:"bg-tool-green",busy:"bg-tool-red",away:"bg-tool-amber",offline:"bg-muted-foreground"},A={sm:"size-2",md:"size-2.5"};function _(t){const[s,c]=h(t,["status","size","pulse","label","class"]),n=()=>s.status??"new";return(()=>{var a=S(),o=a.firstChild;return w(a,g(z,{get when(){return s.pulse},get children(){var e=C();return m(()=>p(e,i("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75 motion-reduce:hidden",v[n()]))),e}}),o),y(o,k(c,{get class(){return i("relative inline-block rounded-full",v[n()],A[s.size??"sm"])}}),!1,!1),m(e=>{var u=i("relative inline-flex",s.class),d=s.label?"status":void 0,b=s.label,f=s.label?void 0:"true";return u!==e.e&&p(a,e.e=u),d!==e.t&&l(a,"role",e.t=d),b!==e.a&&l(a,"aria-label",e.a=b),f!==e.o&&l(a,"aria-hidden",e.o=f),e},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()}var $=r("<style>:host{display:inline-flex}");x("kai-status",{status:"new",pulse:!1,label:void 0,size:"sm"},(t,{flag:s})=>[$(),g(_,{get status(){return t.status??"new"},get size(){return t.size??"sm"},get pulse(){return s("pulse")},get label(){return t.label},part:"dot"})]);
@@ -1 +1 @@
1
- import{d as g,a as w,h as m,j as h,g as k,k as v,t as p,q as y,c as C}from"./chunks/cn-Dogu6PbV.js";var x=p("<button type=button role=switch><span>");function $(i){const[o,r]=w(i.defaultChecked??!1),l=()=>i.checked!==void 0,d=()=>l()?!!i.checked:o(),s=()=>{var a;if(i.disabled)return;const n=!d();l()||r(n),(a=i.onChange)==null||a.call(i,n)};return(()=>{var a=x(),n=a.firstChild;return a.$$keydown=e=>{(e.key===" "||e.key==="Enter")&&(e.preventDefault(),s())},a.$$click=s,m(e=>{var t=d(),c=i.label,u=i.disabled,b=h("relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",d()?"bg-primary":"bg-muted",i.class),f=h("inline-block h-4 w-4 rounded-full bg-white shadow transition-transform",d()?"translate-x-[1.125rem]":"translate-x-0.5");return t!==e.e&&k(a,"aria-checked",e.e=t),c!==e.t&&k(a,"aria-label",e.t=c),u!==e.a&&(a.disabled=e.a=u),b!==e.o&&v(a,e.o=b),f!==e.i&&v(n,e.i=f),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()}g(["click","keydown"]),y("kai-switch",{checked:void 0,disabled:void 0,label:void 0},(i,{dispatch:o,flag:r})=>C($,{get defaultChecked(){return r("checked")},get disabled(){return r("disabled")},get label(){return i.label},onChange:l=>o("kai-change",{checked:l})}));
1
+ import{g as p,n as m,a as b,d as v,u as C,b as w,t as y,e as A,f as $,A as f,h as R,c as E}from"./chunks/define-CNSKFZCd.js";import{c as x}from"./chunks/cn-CU7UAWzk.js";var j=y("<button type=button role=switch><span>"),q=y('<input type=checkbox aria-hidden=true tabindex=-1 style="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap">');function O(i){const[h,d]=p(i.defaultChecked??!1),c=()=>i.checked!==void 0,n=()=>c()?!!i.checked:h(),u=()=>{var e;if(i.disabled)return;const o=!n();c()||d(o),(e=i.onChange)==null||e.call(i,o)};return[m(()=>m(()=>i.name!=null)()&&(()=>{var e=q();return e.addEventListener("change",()=>{}),b(o=>{var l=i.name,t=i.disabled;return l!==o.e&&v(e,"name",o.e=l),t!==o.t&&(e.disabled=o.t=t),o},{e:void 0,t:void 0}),b(()=>e.value=i.value??"on"),b(()=>e.checked=n()),e})()),(()=>{var e=j(),o=e.firstChild;e.$$keydown=t=>{(t.key===" "||t.key==="Enter")&&(t.preventDefault(),u())},e.$$click=u;var l=i.buttonRef;return typeof l=="function"?C(l,e):i.buttonRef=e,b(t=>{var r=n(),a=i.label,s=i.disabled,g=x("relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",n()?"bg-primary":"bg-muted",i.class),k=x("inline-block h-4 w-4 rounded-full shadow transition-transform",n()?"translate-x-[1.125rem] bg-primary-foreground":"translate-x-0.5 bg-white");return r!==t.e&&v(e,"aria-checked",t.e=r),a!==t.t&&v(e,"aria-label",t.t=a),s!==t.a&&(e.disabled=t.a=s),g!==t.o&&w(e,t.o=g),k!==t.i&&w(o,t.i=k),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),e})()]}A(["click","keydown"]),$("kai-switch",{checked:void 0,defaultChecked:void 0,disabled:void 0,label:void 0,name:void 0,value:void 0},(i,h)=>{const{element:d,dispatch:c,flag:n,expose:u}=h,[e,o]=p(n("defaultChecked")||n("checked")),l=r=>r===!0?!0:r===!1?!1:d.hasAttribute("checked")&&d.getAttribute("checked")!=="false",t=r=>{n("disabled")||f(e)!==r&&(o(r),c("kai-change",{checked:r}))};return Object.defineProperty(d,"checked",{get:()=>e(),set:r=>{const a=l(r);f(e)!==a&&o(a)},configurable:!0,enumerable:!0}),R(()=>{const r=e();r!==d.hasAttribute("checked")&&d.toggleAttribute("checked",r)}),u({toggle:()=>t(!f(e)),focus:r=>{var a,s;return(s=(a=d.shadowRoot)==null?void 0:a.querySelector('button[role="switch"]'))==null?void 0:s.focus(r)}}),E(O,{get checked(){return e()},get disabled(){return n("disabled")},get label(){return i.label},get name(){return i.name},get value(){return i.value},onChange:r=>t(r)})});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{s as V,u as C,k as j,m as q,i as h,c as D,a as z,d as x,b as H,F as I,t as E,e as L,f as R,g as S}from"./chunks/define-CNSKFZCd.js";import{r as B}from"./chunks/icon-CAyRqVrg.js";import{c as k}from"./chunks/cn-CU7UAWzk.js";var F=E("<div>"),K=E("<button type=button part=tab role=tab>");const N={segmented:"inline-flex items-center gap-1 rounded-lg bg-muted p-1",underline:"inline-flex items-center gap-1 border-b border-border"};function P(l,a){const s="inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50";return l==="underline"?k(s,"border-b-2 px-3 py-2 -mb-px",a?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"):k(s,"rounded-md px-3 py-1.5",a?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground")}function T(l){const[a,s]=V(l,["items","value","variant","block","disabled","onChange","ref","class"]),b=()=>a.items??[],v=()=>a.variant??"segmented",f={},u=()=>b().filter(t=>!t.disabled),o=()=>a.value,c=()=>{var t;return o()!==void 0&&u().some(r=>r.id===o())?o():(t=u()[0])==null?void 0:t.id},n=t=>{var r;a.disabled||t.disabled||t.id!==a.value&&((r=a.onChange)==null||r.call(a,t.id))},g=t=>{const r=f[t];r&&r.focus()},m=(t,r)=>{const i=u();if(i.length===0)return;const d=i.findIndex(p=>p.id===r.id);let e;switch(t.key){case"ArrowRight":case"ArrowDown":e=i[(d+1)%i.length];break;case"ArrowLeft":case"ArrowUp":e=i[(d-1+i.length)%i.length];break;case"Home":e=i[0];break;case"End":e=i[i.length-1];break;case"Enter":case" ":t.preventDefault(),n(r);return;default:return}e&&(t.preventDefault(),n(e),g(e.id))};return(()=>{var t=F();return C(r=>{var i;return(i=a.ref)==null?void 0:i.call(a,r)},t),j(t,q(s,{role:"tablist",part:"tablist",get"aria-disabled"(){return a.disabled?"true":void 0},get class(){return k(N[v()],a.block&&"flex w-full",a.class)}}),!1,!0),h(t,D(I,{get each(){return b()},children:r=>{const i=()=>r.id===o();return(()=>{var d=K();return d.$$keydown=e=>m(e,r),d.$$click=()=>n(r),C(e=>{f[r.id]=e},d),h(d,()=>B(r.icon,{class:"size-4 shrink-0"}),null),h(d,()=>r.label,null),z(e=>{var p=i()?"":void 0,w=i()?"true":"false",y=r.id===c()?0:-1,A=a.disabled||r.disabled,$=k(P(v(),i()),a.block&&"flex-1 justify-center");return p!==e.e&&x(d,"data-active",e.e=p),w!==e.t&&x(d,"aria-selected",e.t=w),y!==e.a&&x(d,"tabindex",e.a=y),A!==e.o&&(d.disabled=e.o=A),$!==e.i&&H(d,e.i=$),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),d})()}})),t})()}L(["click","keydown"]),R("kai-tabs",{items:void 0,value:void 0,defaultValue:void 0,variant:"segmented",block:void 0,disabled:void 0},(l,{dispatch:a,flag:s,expose:b})=>{const[v,f]=S(l.defaultValue),u=()=>l.value??v(),o=n=>{f(n),a("kai-tab-change",{value:n})};let c;return b({select:n=>{var g;const m=(g=l.items)==null?void 0:g.find(t=>t.id===n);!m||m.disabled||s("disabled")||o(n)},focus:()=>{var n;(n=c?.querySelector('[role="tab"][tabindex="0"]:not([disabled])'))==null||n.focus()}}),D(T,{get items(){return l.items},get value(){return u()},get variant(){return l.variant??"segmented"},get block(){return s("block")},get disabled(){return s("disabled")},onChange:o,ref:n=>c=n})});
@@ -1 +1 @@
1
- import{d as se,m as oe,s as le,y as ce,e as v,a as ue,b as z,o as K,c as s,E as ge,S as b,i as c,u as he,h as E,j as N,k as M,g as x,F as Q,n as fe,t as p,q as me}from"./chunks/cn-Dogu6PbV.js";import{B as V}from"./chunks/button-CKyYD9G4.js";import{C as U}from"./chunks/card-Cjho-PYk.js";import{u as ve,a as pe,D as ke}from"./chunks/use-card-resolution-D-_0Alzy.js";import{e as be}from"./chunks/card-routing-C986KuUA.js";import{x as xe}from"./chunks/x-CzxL27Ch.js";import{c as ye}from"./chunks/check-CDYaMYrM.js";var we=p('<p class="pt-1 text-xs text-muted-foreground">Up to <!> selected.'),Ie=p('<div role=group><div class="divide-y divide-border overflow-hidden rounded-lg border border-input">'),Se=p("<span class=sr-only>"),Ce=p('<div class="flex w-full flex-wrap items-center justify-between gap-2"><span aria-live=polite class="text-xs text-muted-foreground"> selected</span><div class="ml-auto flex items-center gap-2">'),Ee=p("<label><input type=checkbox class=kai-checkbox><span>Select all"),$e=p('<span class="text-xs font-normal text-muted-foreground">'),Te=p('<label><input type=checkbox class="kai-checkbox mt-0.5"><span class="flex flex-col gap-0.5"><span>'),Ae=p('<ul class="list-disc pl-5 text-sm text-foreground">'),Re=p('<div class="flex flex-col gap-2"><p class="flex items-center gap-2 text-sm font-medium text-foreground"><span>Selected <!> of '),ze=p('<p class="text-sm text-muted-foreground">None selected'),Le=p("<li>");const je="tasks";function De(t){if(!Array.isArray(t)||t.length===0)return{tasks:[],error:"This card couldn't be displayed."};const n=new Set,e=[];for(const h of t){if(!h||typeof h!="object")continue;const o=h;if(!(typeof o.id!="string"||o.id.length===0)&&!(typeof o.label!="string"||o.label.length===0)){if(n.has(o.id)){console.warn(`[kai-tasks] duplicate task id "${o.id}" ignored`);continue}n.add(o.id),e.push({id:o.id,label:o.label,description:typeof o.description=="string"?o.description:void 0,checked:o.checked===!0,disabled:o.disabled===!0})}}return e.length===0?{tasks:[],error:"This card couldn't be displayed."}:{tasks:e}}function Ne(t){return t.filter(n=>n.checked).map(n=>n.id)}function Me(t,n){return t.filter(e=>n.has(e.id)).map(e=>e.id)}function q(t){return t.filter(n=>!n.disabled).map(n=>n.id)}function Ue(t,n){const e=q(t);if(e.length===0)return"unchecked";const h=e.filter(o=>n.has(o)).length;return h===0?"unchecked":h===e.length?"checked":"indeterminate"}function qe(t,n){if(t.selectAll!==!0)return!1;const e=q(n).length;return!(t.max!==void 0&&e>t.max)}function W(t,n){const e=t.min??(t.allowEmpty?0:1);return!(n<e||t.max!==void 0&&n>t.max)}function X(t,n){return t.max!==void 0&&n>=t.max}function Be(t,n){if(W(t,n))return;const e=t.min??(t.allowEmpty?0:1);if(n<e)return`Select at least ${e}.`;if(t.max!==void 0&&n>t.max)return`Select at most ${t.max}.`}const Fe={tasks:[]};function Pe(t){const n=oe({cardId:"kai-tasks"},t),[e]=le(n,["data","cardId","heading","host","hostElement","class","resolution"]),h=ve(),o=ce(),y=r=>{const a=e.host??h;a?a.emit(r):e.hostElement&&be(e.hostElement,r)},S=v(()=>{var r;return De((r=e.data)==null?void 0:r.tasks)}),T=v(()=>S().error===void 0),$=v(()=>S().error??""),I=v(()=>S().tasks),w=v(()=>e.data??Fe),[C,L]=ue(new Set),f=pe({prop:()=>e.resolution,data:()=>e.data});z(K(()=>e.data,()=>{L(new Set(Ne(I())))})),z(K(T,r=>{y(r?{kind:"ready",cardId:e.cardId}:{kind:"error",cardId:e.cardId,message:$()})}));const A=v(()=>C().size),Y=()=>w().confirmLabel??"Confirm",R=v(()=>Ue(I(),C())),Z=v(()=>qe(w(),I())),j=v(()=>Be(w(),A())),D=v(()=>W(w(),A())&&!f.isResolved()),ee=(r,a)=>{if(f.isResolved())return;const i=new Set(C());if(a){if(X(w(),i.size)&&!i.has(r))return;i.add(r)}else i.delete(r);L(i)},te=r=>{if(f.isResolved())return;const a=new Set(C());for(const i of q(I()))r?a.add(i):a.delete(i);L(a)},B=()=>{if(!D())return;const r={selected:Me(I(),C())};y({kind:"submit",cardId:e.cardId,data:r}),f.setLocal({kind:"submit",data:r})},re=()=>{f.isResolved()||(y({kind:"dismiss",cardId:e.cardId}),f.setLocal({kind:"dismissed"}))},ie=()=>y({kind:"reopen",cardId:e.cardId});z(()=>{var r;const a=e.hostElement;a&&(((r=f.resolution())==null?void 0:r.kind)==="submit"?a.setAttribute("data-kai-resolved","submitted"):a.removeAttribute("data-kai-resolved"))});const ne=v(()=>{var r;const a=f.resolution();if(!a||a.kind!=="submit")return;const i=(r=a.data)==null?void 0:r.selected,u=Array.isArray(i)?i:[],d=I(),l=d.filter(m=>u.includes(m.id)).map(m=>m.label);return{count:l.length,total:d.length,labels:l}}),F=`kai-tl-reason-${o}`,ae=`kai-tl-count-${o}`;return s(b,{get when(){return T()},get fallback(){return s(U,{get heading(){return e.heading},get errorMessage(){return $()}})},get children(){return s(ge,{fallback:()=>(y({kind:"error",cardId:e.cardId,message:"The card failed to render."}),s(U,{get heading(){return e.heading},errorMessage:"The card failed to render."})),get children(){return s(b,{get when(){return!f.isDeferred()},get fallback(){return s(ke,{type:je,get title(){var r;return e.heading??((r=e.data)==null?void 0:r.heading)},onReopen:ie})},get children(){return s(U,{get heading(){var r;return e.heading??((r=e.data)==null?void 0:r.heading)},get actions(){return fe(()=>!!f.isResolved())()?void 0:(()=>{var r=Ce(),a=r.firstChild,i=a.firstChild,u=a.nextSibling;return c(r,s(b,{get when(){var d;return((d=e.data)==null?void 0:d.dismissible)===!0},get children(){return s(V,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Dismiss",onClick:re,get children(){return s(xe,{size:16,"aria-hidden":"true"})}})}}),a),x(a,"id",ae),c(a,A,i),c(u,s(b,{get when(){return j()},get children(){var d=Se();return x(d,"id",F),c(d,j),d}}),null),c(u,s(V,{type:"button",get disabled(){return!D()},get"aria-describedby"(){return j()?F:void 0},onClick:B,get children(){return Y()}}),null),r})()},get children(){return s(b,{get when(){return!f.isResolved()},get fallback(){return s(Oe,{get summary(){return ne()},get optimistic(){return f.isOptimistic()}})},get children(){var r=Ie(),a=r.firstChild;return r.$$keydown=i=>{i.key!=="Enter"||i.target.tagName==="INPUT"||D()&&B()},c(a,s(b,{get when(){return Z()},get children(){return(()=>{const i=()=>R()==="indeterminate";return(()=>{var u=Ee(),d=u.firstChild;return d.addEventListener("change",l=>te(l.currentTarget.checked)),he(l=>{z(()=>{l.indeterminate=i()})},d),E(l=>{var m=N("flex cursor-pointer items-center gap-3 px-3 py-2.5 text-sm font-medium transition-colors",R()==="checked"?"bg-accent text-accent-foreground":"text-foreground hover:bg-muted/50"),k=i()?"mixed":R()==="checked";return m!==l.e&&M(u,l.e=m),k!==l.t&&x(d,"aria-checked",l.t=k),l},{e:void 0,t:void 0}),E(()=>d.checked=R()==="checked"),u})()})()}}),null),c(a,s(Q,{get each(){return I()},children:i=>{const u=()=>C().has(i.id),d=()=>i.disabled||!u()&&X(w(),A()),l=`kai-tl-desc-${o}-${i.id}`;return(()=>{var m=Te(),k=m.firstChild,P=k.nextSibling,de=P.firstChild;return k.addEventListener("change",g=>ee(i.id,g.currentTarget.checked)),c(de,()=>i.label),c(P,s(b,{get when(){return i.description},get children(){var g=$e();return x(g,"id",l),c(g,()=>i.description),g}}),null),E(g=>{var O=N("flex items-start gap-3 px-3 py-2.5 text-sm transition-colors",d()?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-muted/50",u()&&!d()?"bg-accent font-medium text-accent-foreground":"text-foreground"),_=i.id,G=d(),H=d()?"true":void 0,J=i.description?l:void 0;return O!==g.e&&M(m,g.e=O),_!==g.t&&x(m,"data-task-id",g.t=_),G!==g.a&&(k.disabled=g.a=G),H!==g.o&&x(k,"aria-disabled",g.o=H),J!==g.i&&x(k,"aria-describedby",g.i=J),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),E(()=>k.checked=u()),m})()}}),null),c(r,s(b,{get when(){return w().max!==void 0},get children(){var i=we(),u=i.firstChild,d=u.nextSibling;return d.nextSibling,c(i,()=>w().max,d),i}}),null),E(i=>{var u,d=e.heading??((u=e.data)==null?void 0:u.heading)??"Tasks",l=N("flex flex-col",e.class);return d!==i.e&&x(r,"aria-label",i.e=d),l!==i.t&&M(r,i.t=l),i},{e:void 0,t:void 0}),r}})}})}})}})}})}function Oe(t){return(()=>{var n=Re(),e=n.firstChild,h=e.firstChild,o=h.firstChild,y=o.nextSibling;return y.nextSibling,c(e,s(ye,{size:16,"aria-hidden":"true"}),h),c(h,()=>t.summary.count,y),c(h,()=>t.summary.total,null),c(n,s(b,{get when(){return t.summary.labels.length>0},get fallback(){return ze()},get children(){var S=Ae();return c(S,s(Q,{get each(){return t.summary.labels},children:T=>(()=>{var $=Le();return c($,T),$})()})),S}}),null),E(()=>x(n,"role",t.optimistic?"status":void 0)),n})()}se(["keydown"]),me("kai-tasks",{data:void 0,cardId:void 0,heading:void 0,resolution:void 0},(t,{element:n})=>s(Pe,{get data(){return t.data},get cardId(){return t.cardId??(n.id||"kai-tasks")},get heading(){return t.heading},get resolution(){return t.resolution},hostElement:n}));
1
+ import{m as xe,s as ke,r as ye,j as R,g as we,h as B,l as _,o as Ce,c as u,E as Se,S as k,n as G,i as g,u as Ie,a as T,b as D,d as m,F as W,t as y,e as Ee,f as Re}from"./chunks/define-CNSKFZCd.js";import{c as U}from"./chunks/cn-CU7UAWzk.js";import{B as ue}from"./chunks/button-DBDZebGr.js";import{P as $e}from"./chunks/progress-bar-Dwbiyv3s.js";import{C as X}from"./chunks/card-YfCyI4fH.js";import{u as Te,a as Ve,D as ze}from"./chunks/use-card-resolution-M36zVciB.js";import{e as Ae}from"./chunks/card-routing-C986KuUA.js";import{x as Le}from"./chunks/x-Ckwicf6g.js";import{c as Ne}from"./chunks/check-fhmRksq_.js";import{c as je}from"./chunks/circle-check-CJV-3Rem.js";import{c as De}from"./chunks/circle-B4fTe9v6.js";var Ue=y('<p class="pt-1 text-xs text-muted-foreground">Up to <!> selected.'),qe=y('<div role=group><div class="divide-y divide-border overflow-hidden rounded-lg border border-input">'),Be=y("<span class=sr-only>"),Me=y('<div class="flex w-full flex-wrap items-center justify-between gap-2"><span aria-live=polite class="text-xs text-muted-foreground"> selected</span><div class="ml-auto flex items-center gap-2">'),Fe=y("<label><input type=checkbox class=kai-checkbox><span>Select all"),ce=y('<span class="text-xs font-normal text-muted-foreground">'),Pe=y('<label><input type=checkbox class="kai-checkbox mt-0.5"><span class="flex flex-col gap-0.5"><span>'),Oe=y('<div class="flex items-center justify-between gap-3"><span class="text-sm font-medium text-foreground"></span><span aria-live=polite class="shrink-0 text-sm font-medium tabular-nums text-muted-foreground"> / '),_e=y('<p class="text-xs text-muted-foreground">Up to <!> selected.'),Ge=y('<div><ul class="flex flex-col gap-1">'),He=y('<div class="grid grid-rows-[0fr] group-hover:grid-rows-[1fr] group-focus-within:grid-rows-[1fr] motion-safe:transition-[grid-template-rows] motion-safe:duration-200"><span class="overflow-hidden text-xs font-normal text-muted-foreground opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 motion-safe:transition-opacity">'),Je=y('<li><label><input type=checkbox class=sr-only><span aria-hidden=true></span><span class="flex min-w-0 flex-col gap-0.5"><span>'),Ke=y('<ul class="list-disc pl-5 text-sm text-foreground">'),Qe=y('<div class="flex flex-col gap-2"><p class="flex items-center gap-2 text-sm font-medium text-foreground"><span>Selected <!> of '),We=y('<p class="text-sm text-muted-foreground">None selected'),Xe=y("<li>");const Ye="tasks";function Ze(e){if(!Array.isArray(e)||e.length===0)return{tasks:[],error:"This card couldn't be displayed."};const n=new Set,t=[];for(const a of e){if(!a||typeof a!="object")continue;const d=a;if(!(typeof d.id!="string"||d.id.length===0)&&!(typeof d.label!="string"||d.label.length===0)){if(n.has(d.id)){console.warn(`[kai-tasks] duplicate task id "${d.id}" ignored`);continue}n.add(d.id),t.push({id:d.id,label:d.label,description:typeof d.description=="string"?d.description:void 0,checked:d.checked===!0,disabled:d.disabled===!0})}}return t.length===0?{tasks:[],error:"This card couldn't be displayed."}:{tasks:t}}function et(e){return e.filter(n=>n.checked).map(n=>n.id)}function ge(e,n){return e.filter(t=>n.has(t.id)).map(t=>t.id)}function H(e){return e.filter(n=>!n.disabled).map(n=>n.id)}function tt(e,n){const t=H(e);if(t.length===0)return"unchecked";const a=t.filter(d=>n.has(d)).length;return a===0?"unchecked":a===t.length?"checked":"indeterminate"}function rt(e,n){if(e.selectAll!==!0)return!1;const t=H(n).length;return!(e.max!==void 0&&t>e.max)}function it(e){return e.mode==="progress"}function nt(e,n){return{done:e.filter(t=>n.has(t.id)).length,total:e.length}}function he(e,n){const t=e.min??(e.allowEmpty?0:1);return!(n<t||e.max!==void 0&&n>e.max)}function Y(e,n){return e.max!==void 0&&n>=e.max}function at(e,n){if(he(e,n))return;const t=e.min??(e.allowEmpty?0:1);if(n<t)return`Select at least ${t}.`;if(e.max!==void 0&&n>e.max)return`Select at most ${e.max}.`}const dt={tasks:[]};function st(e){const n=xe({cardId:"kai-tasks"},e),[t]=ke(n,["data","cardId","heading","host","hostElement","class","resolution","value","defaultValue","disabled","readonly","onValueChange","controllerRef"]),a=Te(),d=ye(),l=r=>{const o=t.host??a;o?o.emit(r):t.hostElement&&Ae(t.hostElement,r)},h=R(()=>{var r;return Ze((r=t.data)==null?void 0:r.tasks)}),w=R(()=>h().error===void 0),C=R(()=>h().error??""),v=R(()=>h().tasks),x=R(()=>t.data??dt),[I,A]=we(new Set),s=Ve({prop:()=>t.resolution,data:()=>t.data}),V=r=>{const o=new Set(v().map(i=>i.id));return r.filter(i=>o.has(i))};B(_(()=>t.data,()=>{const r=t.value??t.defaultValue??et(v());A(new Set(V(r)))})),B(_(()=>t.value,r=>{r&&A(new Set(V(r)))},{defer:!0})),B(_(I,r=>{var o;(o=t.onValueChange)==null||o.call(t,{value:ge(v(),r)})},{defer:!0})),B(_(w,r=>{l(r?{kind:"ready",cardId:t.cardId}:{kind:"error",cardId:t.cardId,message:C()})}));const $=()=>t.disabled===!0,S=()=>t.readonly===!0,L=R(()=>I().size),N=R(()=>it(x())),M=R(()=>nt(v(),I())),P=()=>x().confirmLabel??"Confirm",j=R(()=>tt(v(),I())),O=R(()=>rt(x(),v())),q=R(()=>at(x(),L())),J=R(()=>he(x(),L())&&!s.isResolved()&&!$()&&!S()),Z=(r,o,i)=>{if(i){if(Y(x(),r.size)&&!r.has(o))return r;r.add(o)}else r.delete(o);return r},K=(r,o)=>{s.isResolved()||$()||S()||A(Z(new Set(I()),r,o))},ee=r=>{if(s.isResolved()||$()||S())return;const o=new Set(I());for(const i of H(v()))r?o.add(i):o.delete(i);A(o)},Q=()=>{if(!J())return;const r={selected:ge(v(),I())};l({kind:"submit",cardId:t.cardId,data:r}),s.setLocal({kind:"submit",data:r})},te=()=>{s.isResolved()||(l({kind:"dismiss",cardId:t.cardId}),s.setLocal({kind:"dismissed"}))},re=()=>l({kind:"reopen",cardId:t.cardId});Ce(()=>{var r;(r=t.controllerRef)==null||r.call(t,{select:o=>{if(s.isResolved()||$()||S())return;if(o===void 0){ee(!0);return}const i=new Set,f=new Set(H(v()));for(const c of V(o))f.has(c)&&Z(i,c,!0);A(i)},toggle:(o,i)=>{const f=i??!I().has(o);K(o,f)},send:()=>Q(),focus:o=>{var i,f;const c=(((i=t.hostElement)==null?void 0:i.shadowRoot)??document).querySelector('[role="group"]');(f=c?.querySelector('input[type="checkbox"]')??c)==null||f.focus(o)},dismiss:()=>te(),reopen:()=>re()})}),B(()=>{var r;const o=t.hostElement;o&&(((r=s.resolution())==null?void 0:r.kind)==="submit"?o.setAttribute("data-kai-resolved","submitted"):o.removeAttribute("data-kai-resolved"))});const fe=R(()=>{var r;const o=s.resolution();if(!o||o.kind!=="submit")return;const i=(r=o.data)==null?void 0:r.selected,f=Array.isArray(i)?i:[],c=v(),p=c.filter(E=>f.includes(E.id)).map(E=>E.label);return{count:p.length,total:c.length,labels:p}}),ie=`kai-tl-reason-${d}`,ve=`kai-tl-count-${d}`,me=`kai-tl-progress-${d}`,pe=`kai-tl-heading-${d}`,ne=()=>{var r;return t.heading??((r=t.data)==null?void 0:r.heading)};return u(k,{get when(){return w()},get fallback(){return u(X,{get heading(){return t.heading},get errorMessage(){return C()}})},get children(){return u(Se,{fallback:()=>(l({kind:"error",cardId:t.cardId,message:"The card failed to render."}),u(X,{get heading(){return t.heading},errorMessage:"The card failed to render."})),get children(){return u(k,{get when(){return!s.isDeferred()},get fallback(){return u(ze,{type:Ye,get title(){var r;return t.heading??((r=t.data)==null?void 0:r.heading)},onReopen:re})},get children(){return u(X,{get heading(){return G(()=>!!N())()?void 0:ne()},get actions(){return G(()=>!!(N()||s.isResolved()||S()))()?void 0:(()=>{var r=Me(),o=r.firstChild,i=o.firstChild,f=o.nextSibling;return g(r,u(k,{get when(){var c;return((c=t.data)==null?void 0:c.dismissible)===!0},get children(){return u(ue,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Dismiss",onClick:te,get children(){return u(Le,{size:16,"aria-hidden":"true"})}})}}),o),m(o,"id",ve),g(o,L,i),g(f,u(k,{get when(){return q()},get children(){var c=Be();return m(c,"id",ie),g(c,q),c}}),null),g(f,u(ue,{type:"button",get disabled(){return!J()},get"aria-describedby"(){return q()?ie:void 0},onClick:Q,get children(){return P()}}),null),r})()},get children(){return u(k,{get when(){return!s.isResolved()},get fallback(){return u(lt,{get summary(){return fe()},get optimistic(){return s.isOptimistic()}})},get children(){return[u(k,{get when(){return N()},get children(){return u(ot,{get heading(){return ne()},headingId:pe,countId:me,get done(){return M().done},get total(){return M().total},get tasks(){return v()},uid:d,isChecked:r=>I().has(r),isBlocked:r=>$()||r.disabled===!0||!I().has(r.id)&&Y(x(),L()),onToggle:(r,o)=>K(r,o),get groupClass(){return t.class},get maxNote(){return G(()=>x().max!==void 0)()?x().max:void 0},get readonly(){return S()}})}}),u(k,{get when(){return!N()},get children(){var r=qe(),o=r.firstChild;return r.$$keydown=i=>{i.key!=="Enter"||i.target.tagName==="INPUT"||J()&&Q()},g(o,u(k,{get when(){return O()},get children(){return(()=>{const i=()=>j()==="indeterminate";return(()=>{var f=Fe(),c=f.firstChild;return c.addEventListener("change",p=>ee(p.currentTarget.checked)),Ie(p=>{B(()=>{p.indeterminate=i()})},c),T(p=>{var E=U("flex items-center gap-3 px-3 py-2.5 text-sm font-medium transition-colors",S()?"cursor-default":"cursor-pointer",j()==="checked"?"bg-accent text-accent-foreground":S()?"text-foreground":"text-foreground hover:bg-muted/50"),z=$()||S(),F=i()?"mixed":j()==="checked";return E!==p.e&&D(f,p.e=E),z!==p.t&&(c.disabled=p.t=z),F!==p.a&&m(c,"aria-checked",p.a=F),p},{e:void 0,t:void 0,a:void 0}),T(()=>c.checked=j()==="checked"),f})()})()}}),null),g(o,u(W,{get each(){return v()},children:i=>{const f=()=>I().has(i.id),c=()=>$()||i.disabled||!f()&&Y(x(),L()),p=`kai-tl-desc-${d}-${i.id}`;return(()=>{var E=Pe(),z=E.firstChild,F=z.nextSibling,be=F.firstChild;return z.addEventListener("change",b=>K(i.id,b.currentTarget.checked)),g(be,()=>i.label),g(F,u(k,{get when(){return i.description},get children(){var b=ce();return m(b,"id",p),g(b,()=>i.description),b}}),null),T(b=>{var ae=U("flex items-start gap-3 px-3 py-2.5 text-sm transition-colors",S()?"cursor-default":c()?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-muted/50",f()&&!c()?"bg-accent font-medium text-accent-foreground":"text-foreground"),de=i.id,se=c()||S(),oe=c()?"true":void 0,le=i.description?p:void 0;return ae!==b.e&&D(E,b.e=ae),de!==b.t&&m(E,"data-task-id",b.t=de),se!==b.a&&(z.disabled=b.a=se),oe!==b.o&&m(z,"aria-disabled",b.o=oe),le!==b.i&&m(z,"aria-describedby",b.i=le),b},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),T(()=>z.checked=f()),E})()}}),null),g(r,u(k,{get when(){return x().max!==void 0},get children(){var i=Ue(),f=i.firstChild,c=f.nextSibling;return c.nextSibling,g(i,()=>x().max,c),i}}),null),T(i=>{var f,c=t.heading??((f=t.data)==null?void 0:f.heading)??"Tasks",p=S()?"true":void 0,E=U("flex flex-col",t.class);return c!==i.e&&m(r,"aria-label",i.e=c),p!==i.t&&m(r,"aria-readonly",i.t=p),E!==i.a&&D(r,i.a=E),i},{e:void 0,t:void 0,a:void 0}),r}})]}})}})}})}})}})}function ot(e){return(()=>{var n=Ge(),t=n.firstChild;return g(n,u(k,{get when(){return e.heading},get children(){var a=Oe(),d=a.firstChild,l=d.nextSibling,h=l.firstChild;return g(d,()=>e.heading),g(l,()=>e.done,h),g(l,()=>e.total,null),T(w=>{var C=e.headingId,v=e.countId;return C!==w.e&&m(d,"id",w.e=C),v!==w.t&&m(l,"id",w.t=v),w},{e:void 0,t:void 0}),a}}),t),g(n,u($e,{get value(){return e.done},get max(){return e.total},tone:"success",get"aria-labelledby"(){return G(()=>!!e.heading)()?e.headingId:void 0},get"aria-label"(){return e.heading?void 0:"Task progress"}}),t),g(t,u(W,{get each(){return e.tasks},children:a=>{const d=()=>e.isChecked(a.id),l=()=>e.isBlocked(a),h=`kai-tl-pdesc-${e.uid}-${a.id}`;return(()=>{var w=Je(),C=w.firstChild,v=C.firstChild,x=v.nextSibling,I=x.nextSibling,A=I.firstChild;return v.addEventListener("change",s=>e.onToggle(a.id,s.currentTarget.checked)),g(x,u(k,{get when(){return d()},get fallback(){return u(De,{size:18})},get children(){return u(je,{size:18,class:"text-foreground"})}})),g(A,()=>a.label),g(I,u(k,{get when(){return a.description},get children(){return u(k,{get when(){return d()},get fallback(){return(()=>{var s=ce();return m(s,"id",h),g(s,()=>a.description),s})()},get children(){var s=He(),V=s.firstChild;return m(V,"id",h),g(V,()=>a.description),s}})}}),null),T(s=>{var V=U("group flex items-start gap-3 rounded-lg px-2.5 py-2 text-sm transition-colors",!e.readonly&&"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",e.readonly?"cursor-default":l()?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-muted/50"),$=a.id,S=!e.readonly&&d()?0:void 0,L=d()?a.label:void 0,N=d()&&a.description?h:void 0,M=l()||e.readonly,P=l()?"true":void 0,j=a.description?h:void 0,O=U("mt-0.5 shrink-0 text-muted-foreground",d()&&"motion-safe:transition-transform motion-safe:group-hover:scale-110"),q=U("font-medium text-foreground",d()&&"line-through opacity-70 motion-safe:transition-opacity motion-safe:group-hover:opacity-100");return V!==s.e&&D(C,s.e=V),$!==s.t&&m(C,"data-task-id",s.t=$),S!==s.a&&m(C,"tabindex",s.a=S),L!==s.o&&m(C,"aria-label",s.o=L),N!==s.i&&m(C,"aria-describedby",s.i=N),M!==s.n&&(v.disabled=s.n=M),P!==s.s&&m(v,"aria-disabled",s.s=P),j!==s.h&&m(v,"aria-describedby",s.h=j),O!==s.r&&D(x,s.r=O),q!==s.d&&D(A,s.d=q),s},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),T(()=>v.checked=d()),w})()}})),g(n,u(k,{get when(){return e.maxNote!==void 0},get children(){var a=_e(),d=a.firstChild,l=d.nextSibling;return l.nextSibling,g(a,()=>e.maxNote,l),a}}),null),T(a=>{var d=U("flex flex-col gap-3",e.groupClass),l=e.heading?e.headingId:void 0,h=e.heading?void 0:"Checklist";return d!==a.e&&D(n,a.e=d),l!==a.t&&m(t,"aria-labelledby",a.t=l),h!==a.a&&m(t,"aria-label",a.a=h),a},{e:void 0,t:void 0,a:void 0}),n})()}function lt(e){return(()=>{var n=Qe(),t=n.firstChild,a=t.firstChild,d=a.firstChild,l=d.nextSibling;return l.nextSibling,g(t,u(Ne,{size:16,"aria-hidden":"true"}),a),g(a,()=>e.summary.count,l),g(a,()=>e.summary.total,null),g(n,u(k,{get when(){return e.summary.labels.length>0},get fallback(){return We()},get children(){var h=Ke();return g(h,u(W,{get each(){return e.summary.labels},children:w=>(()=>{var C=Xe();return g(C,w),C})()})),h}}),null),T(()=>m(n,"role",e.optimistic?"status":void 0)),n})()}Ee(["keydown"]),Re("kai-tasks",{data:void 0,cardId:void 0,heading:void 0,resolution:void 0,value:void 0,defaultValue:void 0,disabled:!1,readonly:!1},(e,{element:n,dispatch:t,flag:a,expose:d})=>{let l;return d({select:h=>l?.select(h),toggle:(h,w)=>l?.toggle(h,w),send:()=>l?.send(),focus:h=>l?.focus(h),dismiss:()=>l?.dismiss(),reopen:()=>l?.reopen()}),u(st,{get data(){return e.data},get cardId(){return e.cardId??(n.id||"kai-tasks")},get heading(){return e.heading},get resolution(){return e.resolution},get value(){return e.value},get defaultValue(){return e.defaultValue},get disabled(){return a("disabled")},get readonly(){return a("readonly")},onValueChange:h=>t("kai-value-change",h),controllerRef:h=>l=h,hostElement:n})});
@@ -1 +1 @@
1
- import{q as r,c as a}from"./chunks/cn-Dogu6PbV.js";import{T as e}from"./chunks/text-shimmer-uh9V_KUh.js";r("kai-text-shimmer",{text:"",as:"span",duration:4,spread:20},t=>a(e,{get as(){return t.as},get duration(){return t.duration},get spread(){return t.spread},class:"text-body",get children(){return t.text}}));
1
+ import{f as r,c as a}from"./chunks/define-CNSKFZCd.js";import{T as e}from"./chunks/text-shimmer-CEi-tlXr.js";r("kai-text-shimmer",{text:"",as:"span",duration:4,spread:20},t=>a(e,{get as(){return t.as},get duration(){return t.duration},get spread(){return t.spread},class:"text-body",get children(){return t.text}}));
@@ -1 +1 @@
1
- import{d as p,s as g,i as n,c as r,z as i,S as u,h as b,k as m,j as f,t as l,q as h}from"./chunks/cn-Dogu6PbV.js";import{T as c}from"./chunks/text-shimmer-uh9V_KUh.js";import{c as x}from"./chunks/chevron-right-k2UFlIVK.js";var k=l('<button type=button class="flex items-center gap-1 text-sm transition-opacity hover:opacity-80">'),v=l('<button type=button class="text-muted-foreground hover:text-foreground border-muted-foreground/50 hover:border-foreground border-b border-dotted text-sm transition-colors">'),w=l("<div>");function y(o){const[t]=g(o,["class","text","onStop","stopLabel","onClick"]),s=()=>t.text??"Thinking",d=()=>t.stopLabel??"Answer now";return(()=>{var a=w();return n(a,r(u,{get when(){return t.onClick},get fallback(){return r(c,{class:"cursor-default text-sm font-medium",get children(){return s()}})},get children(){var e=k();return i(e,"click",t.onClick,!0),n(e,r(c,{class:"text-sm font-medium",get children(){return s()}}),null),n(e,r(x,{class:"text-muted-foreground size-4"}),null),e}}),null),n(a,r(u,{get when(){return t.onStop},get children(){var e=v();return i(e,"click",t.onStop,!0),n(e,d),e}}),null),b(()=>m(a,f("flex w-full items-center justify-between",t.class))),a})()}p(["click"]),h("kai-thinking-bar",{text:"Thinking",stoppable:!1,stopLabel:"Answer now"},(o,{dispatch:t,flag:s})=>r(y,{get text(){return o.text},get stopLabel(){return o.stopLabel},get onStop(){return s("stoppable")?()=>t("kai-stop"):void 0}}));
1
+ import{s as p,i as o,c as r,y as i,S as u,a as m,b,t as l,e as f,f as g}from"./chunks/define-CNSKFZCd.js";import{c as x}from"./chunks/cn-CU7UAWzk.js";import{T as c}from"./chunks/text-shimmer-CEi-tlXr.js";import{c as h}from"./chunks/chevron-right-ChzBcNJ-.js";var k=l('<button type=button class="flex items-center gap-1 text-sm transition-opacity hover:opacity-80">'),v=l('<button type=button class="text-muted-foreground hover:text-foreground border-muted-foreground/50 hover:border-foreground border-b border-dotted text-sm transition-colors">'),w=l("<div>");function y(n){const[t]=p(n,["class","text","onStop","stopLabel","onClick"]),s=()=>t.text??"Thinking",d=()=>t.stopLabel??"Answer now";return(()=>{var a=w();return o(a,r(u,{get when(){return t.onClick},get fallback(){return r(c,{class:"cursor-default text-sm font-medium",get children(){return s()}})},get children(){var e=k();return i(e,"click",t.onClick,!0),o(e,r(c,{class:"text-sm font-medium",get children(){return s()}}),null),o(e,r(h,{class:"text-muted-foreground size-4"}),null),e}}),null),o(a,r(u,{get when(){return t.onStop},get children(){var e=v();return i(e,"click",t.onStop,!0),o(e,d),e}}),null),m(()=>b(a,x("flex w-full items-center justify-between",t.class))),a})()}f(["click"]),g("kai-thinking-bar",{text:"Thinking",stoppable:!1,stopLabel:"Answer now"},(n,{dispatch:t,flag:s})=>r(y,{get text(){return n.text},get stopLabel(){return n.stopLabel},get onStop(){return s("stoppable")?()=>t("kai-stop"):void 0}}));
@@ -1 +1 @@
1
- import{d as nt,a as z,e as Q,b as W,p as Y,c as v,i as w,F as U,u as V,h as B,j as C,g as G,k as X,A as H,G as Z,S as M,t as E,o as _,q as it}from"./chunks/cn-Dogu6PbV.js";import{c as at}from"./chunks/overlay-DydXYMQW.js";import{r as tt,t as st}from"./chunks/toast-store-D8cL3fWl.js";import{c as dt}from"./chunks/check-CDYaMYrM.js";import{x as lt}from"./chunks/x-CzxL27Ch.js";var ct=E('<button type=button aria-label=Dismiss class="text-muted-foreground hover:text-foreground -mr-1 flex size-5 shrink-0 items-center justify-center rounded-md transition-colors">'),ut=E('<div role=status><span class="min-w-0 flex-1 truncate">'),mt=E('<button type=button class="text-primary hover:text-primary/80 shrink-0 rounded-md text-sm font-medium underline-offset-2 hover:underline">'),pt=E('<div role=region aria-label=Notifications aria-live=polite data-stack=collapsed><div class="pointer-events-auto relative transition-[height] duration-200 ease-out"style="min-width:16rem;max-width:min(28rem, calc(100vw - 2rem))">'),ft=E("<div role=region aria-label=Notifications aria-live=polite data-stack=expanded>"),vt=E("<div>");function ht(){var t,s;const[d,u]=z(typeof window<"u"&&((t=window.matchMedia)==null?void 0:t.call(window,"(prefers-reduced-motion: reduce)").matches)===!0);if(typeof window<"u"&&window.matchMedia){const o=window.matchMedia("(prefers-reduced-motion: reduce)"),l=()=>u(o.matches);(s=o.addEventListener)==null||s.call(o,"change",l),Y(()=>{var p;return(p=o.removeEventListener)==null?void 0:p.call(o,"change",l)})}return d}function et(t){const[s,d]=z(!0),u=at(s),o=()=>t.item.variant??"neutral",l=()=>t.item.dismissible!==!1;let p=tt(t.item),f=0,y,k="timeout";const h=()=>{y!==void 0&&(clearTimeout(y),y=void 0)},L=()=>{h(),!(p<=0)&&(f=Date.now(),y=setTimeout(()=>{k="timeout",d(!1)},p))},q=()=>{y!==void 0&&(h(),p-=Date.now()-f)},[F,j]=z(!1),R=()=>t.paused===!0||F();W(_(()=>tt(t.item),a=>{p=a,R()?h():L()})),W(_(R,a=>{a?q():L()},{defer:!0})),Y(h),W(()=>{!u.present()&&!s()&&t.onDismiss(k)});const S=()=>{h(),k="close",d(!1)},N=()=>{var a;const b=t.item.action;b&&((a=t.onAction)==null||a.call(t,b.label),b.onAction()===!1||(h(),k="action",d(!1)))};return v(M,{get when(){return u.present()},get children(){var a=ut(),b=a.firstChild;a.addEventListener("pointerleave",()=>j(!1)),a.addEventListener("pointerenter",()=>j(!0));var T=u.setRef;return typeof T=="function"?V(T,a):u.setRef=a,w(a,v(M,{get when(){return o()==="success"},get children(){return v(dt,{class:"size-4 shrink-0 text-emerald-500"})}}),b),w(b,()=>t.item.message),w(a,v(M,{get when(){return t.item.action},children:m=>(()=>{var $=mt();return $.$$click=N,w($,()=>m().label),$})()}),null),w(a,v(M,{get when(){return l()},get children(){var m=ct();return m.$$click=S,w(m,v(lt,{class:"size-3.5"})),m}}),null),B(m=>{var $=u.state()==="closed"?"":void 0,A=C("pointer-events-auto flex items-center gap-3 rounded-full border px-4 py-2.5 text-sm shadow-lg","bg-popover text-popover-foreground border-border","animate-in fade-in-0 slide-in-from-top-4","data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:slide-out-to-top-2");return $!==m.e&&G(a,"data-closed",m.e=$),A!==m.t&&X(a,m.t=A),m},{e:void 0,t:void 0}),a}})}const rt={"top-center":"top-4 left-1/2 -translate-x-1/2 items-center","top-right":"top-4 right-4 items-end","top-left":"top-4 left-4 items-start","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center flex-col-reverse","bottom-right":"bottom-4 right-4 items-end flex-col-reverse","bottom-left":"bottom-4 left-4 items-start flex-col-reverse"},xt={"top-center":"items-center","top-left":"items-start","top-right":"items-end","bottom-center":"items-center flex-col-reverse","bottom-left":"items-start flex-col-reverse","bottom-right":"items-end flex-col-reverse"},O=12;function ot(t,s){const d=s.left+s.width/2,u=s.top+O,o=s.bottom-O,l=s.left+O,p=s.right-O,f=`${Math.max(0,s.width-O*2)}px`;switch(t){case"top-left":return{top:`${u}px`,left:`${l}px`,transform:"none","max-width":f};case"top-right":return{top:`${u}px`,left:`${p}px`,transform:"translateX(-100%)","max-width":f};case"bottom-center":return{top:`${o}px`,left:`${d}px`,transform:"translate(-50%, -100%)","max-width":f};case"bottom-left":return{top:`${o}px`,left:`${l}px`,transform:"translateY(-100%)","max-width":f};case"bottom-right":return{top:`${o}px`,left:`${p}px`,transform:"translate(-100%, -100%)","max-width":f};default:return{top:`${u}px`,left:`${d}px`,transform:"translateX(-50%)","max-width":f}}}function gt(t){const s=()=>t.max??3,d=()=>t.position??"top-center",u=()=>t.stack??"expanded",o=ht(),l=()=>u()==="collapsed"&&!o(),[p,f]=z(!1),[y,k]=z(!1),h=()=>p()||y(),L=20,q=.05,F=48,j=8,R=()=>d().startsWith("bottom"),S=()=>R()?-1:1,[N,a]=z(F),b=e=>{if(!e||typeof window>"u")return;const i=()=>{const n=e.offsetHeight;n&&a(n)};if(i(),typeof ResizeObserver>"u")return;const r=new ResizeObserver(i);r.observe(e),Y(()=>r.disconnect())},T=e=>h()?`translateY(${S()*(N()+j)*e}px) scale(1)`:`translateY(${S()*L*e}px) scale(${1-q*e})`,m=()=>{const e=A().length;return e?h()?e*N()+(e-1)*j:N()+(e-1)*L:0},$=Q(()=>[...(t.toasts??[]).filter(e=>(e.target??void 0)===t.target)].reverse()),A=Q(()=>$().slice(0,s())),[D,I]=z(null);return W(()=>{const e=t.target;if(!e||typeof window>"u"){I(null);return}const i=()=>{const n=e.getBoundingClientRect();I({top:n.top,left:n.left,right:n.right,bottom:n.bottom,width:n.width})};i();const r=new ResizeObserver(i);r.observe(e),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),Y(()=>{r.disconnect(),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)})}),v(M,{get when(){return l()},get fallback(){return(()=>{var e=ft();return w(e,v(U,{get each(){return A()},children:i=>v(et,{item:i,onDismiss:r=>{var n;return(n=t.onDismiss)==null?void 0:n.call(t,i.id,r)},onAction:r=>{var n;return(n=t.onAction)==null?void 0:n.call(t,i.id,r)}})})),B(i=>{var r=C("pointer-events-none fixed z-[100] flex flex-col gap-2",D()?xt[d()]:C("max-w-[min(28rem,calc(100vw-2rem))]",rt[d()])),n=D()?ot(d(),D()):void 0;return r!==i.e&&X(e,i.e=r),i.t=Z(e,n,i.t),i},{e:void 0,t:void 0}),e})()},get children(){var e=pt(),i=e.firstChild;return e.$$focusout=()=>k(!1),e.$$focusin=()=>k(!0),e.addEventListener("pointerleave",()=>f(!1)),e.addEventListener("pointerenter",()=>f(!0)),w(i,v(U,{get each(){return A()},children:(r,n)=>(()=>{var g=vt();return V(c=>{n()===0&&b(c)},g),w(g,v(et,{item:r,get paused(){return h()},onDismiss:c=>{var x;return(x=t.onDismiss)==null?void 0:x.call(t,r.id,c)},onAction:c=>{var x;return(x=t.onAction)==null?void 0:x.call(t,r.id,c)}})),B(c=>{var x=n(),J=C("absolute inset-x-0 flex transition-[transform,opacity] duration-200 ease-out",R()?"bottom-0 origin-bottom":"top-0 origin-top",d().endsWith("right")?"justify-end":d().endsWith("left")?"justify-start":"justify-center"),K=String(s()-n()),P=T(n());return x!==c.e&&G(g,"data-depth",c.e=x),J!==c.t&&X(g,c.t=J),K!==c.a&&H(g,"z-index",c.a=K),P!==c.o&&H(g,"transform",c.o=P),c},{e:void 0,t:void 0,a:void 0,o:void 0}),g})()})),B(r=>{var n=h()?"":void 0,g=C("pointer-events-none fixed z-[100]",!D()&&rt[d()]),c=D()?ot(d(),D()):void 0,x=`${m()}px`;return n!==r.e&&G(e,"data-expanded",r.e=n),g!==r.t&&X(e,r.t=g),r.a=Z(e,c,r.a),x!==r.o&&H(i,"height",r.o=x),r},{e:void 0,t:void 0,a:void 0,o:void 0}),e}})}nt(["click","focusin","focusout"]),it("kai-toast-region",{toasts:[],position:"top-center",max:3,stack:"expanded",target:void 0},(t,{dispatch:s})=>{const d=()=>{const o=t.max,l=typeof o=="string"?parseInt(o,10):o;return typeof l=="number"&&!Number.isNaN(l)?l:3},u=o=>{st.dismiss(o)};return v(gt,{get toasts(){return t.toasts??[]},get position(){return t.position},get max(){return d()},get stack(){return t.stack},get target(){return t.target},onDismiss:(o,l)=>{u(o),s("kai-dismiss",{id:o,reason:l})},onAction:(o,l)=>s("kai-action",{id:o,label:l})})});
1
+ import{g as z,j as Q,h as G,p as H,c as a,i as h,F as U,u as V,a as L,d as C,b as E,z as J,G as Z,S as b,t as $,l as _,e as ie,f as ae}from"./chunks/define-CNSKFZCd.js";import{c as g}from"./chunks/cn-CU7UAWzk.js";import{c as se}from"./chunks/overlay-B1-MBI6h.js";import{r as ee,t as de}from"./chunks/toast-store-BEMda0fv.js";import{c as le}from"./chunks/check-fhmRksq_.js";import{c as ce}from"./chunks/circle-x-pDtzlghQ.js";import{i as ue}from"./chunks/info-DBQl-m6e.js";import{t as me}from"./chunks/triangle-alert-B07fX3Q8.js";import{x as pe}from"./chunks/x-Ckwicf6g.js";var ve=$("<button type=button>"),fe=$("<button type=button aria-label=Dismiss>"),te=$("<div>"),ge=$('<div class="min-w-0 flex-1"><div class="font-medium leading-snug">'),he=$("<div role=status>"),xe=$('<span class="min-w-0 flex-1 truncate">'),be=$('<div role=region aria-label=Notifications aria-live=polite data-stack=collapsed><div class="pointer-events-auto relative transition-[height] duration-200 ease-out"style="min-width:16rem;max-width:min(30rem, calc(100vw - 2rem))">'),we=$("<div role=region aria-label=Notifications aria-live=polite data-stack=expanded>");function ke(){var t,c;const[u,f]=z(typeof window<"u"&&((t=window.matchMedia)==null?void 0:t.call(window,"(prefers-reduced-motion: reduce)").matches)===!0);if(typeof window<"u"&&window.matchMedia){const m=window.matchMedia("(prefers-reduced-motion: reduce)"),l=()=>f(m.matches);(c=m.addEventListener)==null||c.call(m,"change",l),H(()=>{var d;return(d=m.removeEventListener)==null?void 0:d.call(m,"change",l)})}return u}function re(t){const[c,u]=z(!0),f=se(c),m=()=>t.item.variant??"neutral",l=()=>t.item.dismissible!==!1,d=()=>t.item.appearance??t.appearance??"pill",v=()=>t.item.inverse??t.inverse??!1,I=()=>v()?"bg-foreground text-background border-transparent":"bg-popover text-popover-foreground border-border",W=()=>v()?"text-background/70":"text-muted-foreground",D=()=>v()?"text-background hover:text-background/80":"text-primary hover:text-primary/80",Y=()=>v()?"text-background/70 hover:text-background":"text-muted-foreground hover:text-foreground";let A=ee(t.item),S=0,k,y="timeout";const w=()=>{k!==void 0&&(clearTimeout(k),k=void 0)},R=()=>{w(),!(A<=0)&&(S=Date.now(),k=setTimeout(()=>{y="timeout",u(!1)},A))},B=()=>{k!==void 0&&(w(),A-=Date.now()-S)},[P,T]=z(!1),X=()=>t.paused===!0||P();G(_(()=>ee(t.item),e=>{A=e,X()?w():R()})),G(_(X,e=>{e?B():R()},{defer:!0})),H(w),G(()=>{!f.present()&&!c()&&t.onDismiss(y)});const q=()=>{w(),y="close",u(!1)},j=()=>{var e;const n=t.item.action;n&&((e=t.onAction)==null||e.call(t,n.label),n.onAction()===!1||(w(),y="action",u(!1)))},x=()=>d()==="card"?"mt-0.5":void 0,F=()=>[a(b,{get when(){return m()==="success"},get children(){return a(le,{get class(){return g("size-4 shrink-0 text-emerald-500",x())}})}}),a(b,{get when(){return m()==="warning"},get children(){return a(me,{get class(){return g("size-4 shrink-0 text-warning",x())}})}}),a(b,{get when(){return m()==="error"},get children(){return a(ce,{get class(){return g("size-4 shrink-0 text-destructive",x())}})}}),a(b,{get when(){return m()==="info"},get children(){return a(ue,{get class(){return g("size-4 shrink-0 text-info",x())}})}})],r=e=>a(b,{get when(){return t.item.action},children:n=>(()=>{var o=ve();return o.$$click=j,h(o,()=>n().label),L(()=>E(o,g(d()==="card"?g("inline-flex shrink-0 items-center rounded-md border px-2.5 py-1 text-xs font-medium transition-colors",v()?"border-background/30 text-background hover:bg-background/10":"border-border text-foreground hover:bg-accent"):g("shrink-0 rounded-md text-sm font-medium underline-offset-2 hover:underline",D()),e.class))),o})()}),i=()=>a(b,{get when(){return l()},get children(){var e=fe();return e.$$click=q,h(e,a(pe,{class:"size-3.5"})),L(()=>E(e,g("-mr-1 flex size-5 shrink-0 items-center justify-center rounded-md transition-colors",Y()))),e}});return a(b,{get when(){return f.present()},get children(){var e=he();e.addEventListener("pointerleave",()=>T(!1)),e.addEventListener("pointerenter",()=>T(!0));var n=f.setRef;return typeof n=="function"?V(n,e):f.setRef=e,h(e,a(F,{}),null),h(e,a(b,{get when(){return d()==="card"},get fallback(){return[(()=>{var o=xe();return h(o,()=>t.item.message),o})(),a(r,{}),a(i,{})]},get children(){return[(()=>{var o=ge(),s=o.firstChild;return h(s,()=>t.item.message),h(o,a(b,{get when(){return t.item.description},get children(){var p=te();return h(p,()=>t.item.description),L(()=>E(p,g("mt-1 line-clamp-2 text-xs leading-snug",W()))),p}}),null),h(o,a(r,{class:"mt-2"}),null),o})(),a(i,{})]}}),null),L(o=>{var s=d(),p=v()?"":void 0,M=f.state()==="closed"?"":void 0,N=g("pointer-events-auto border text-sm shadow-lg",I(),"animate-in fade-in-0 slide-in-from-top-4","data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:slide-out-to-top-2",d()==="card"?"flex min-w-[24rem] items-start gap-3 rounded-xl p-4 shadow-xl":"flex items-center gap-3 rounded-full px-4 py-2.5");return s!==o.e&&C(e,"data-appearance",o.e=s),p!==o.t&&C(e,"data-inverse",o.t=p),M!==o.a&&C(e,"data-closed",o.a=M),N!==o.o&&E(e,o.o=N),o},{e:void 0,t:void 0,a:void 0,o:void 0}),e}})}const ne={"top-center":"top-4 left-1/2 -translate-x-1/2 items-center","top-right":"top-4 right-4 items-end","top-left":"top-4 left-4 items-start","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center flex-col-reverse","bottom-right":"bottom-4 right-4 items-end flex-col-reverse","bottom-left":"bottom-4 left-4 items-start flex-col-reverse"},$e={"top-center":"items-center","top-left":"items-start","top-right":"items-end","bottom-center":"items-center flex-col-reverse","bottom-left":"items-start flex-col-reverse","bottom-right":"items-end flex-col-reverse"},O=12;function oe(t,c){const u=c.left+c.width/2,f=c.top+O,m=c.bottom-O,l=c.left+O,d=c.right-O,v=`${Math.max(0,c.width-O*2)}px`;switch(t){case"top-left":return{top:`${f}px`,left:`${l}px`,transform:"none","max-width":v};case"top-right":return{top:`${f}px`,left:`${d}px`,transform:"translateX(-100%)","max-width":v};case"bottom-center":return{top:`${m}px`,left:`${u}px`,transform:"translate(-50%, -100%)","max-width":v};case"bottom-left":return{top:`${m}px`,left:`${l}px`,transform:"translateY(-100%)","max-width":v};case"bottom-right":return{top:`${m}px`,left:`${d}px`,transform:"translate(-100%, -100%)","max-width":v};default:return{top:`${f}px`,left:`${u}px`,transform:"translateX(-50%)","max-width":v}}}function ye(t){const c=()=>t.max??3,u=()=>t.position??"top-center",f=()=>t.stack??"expanded",m=ke(),l=()=>f()==="collapsed"&&!m(),[d,v]=z(!1),[I,W]=z(!1),D=()=>d()||I(),Y=20,A=.05,S=48,k=8,y=()=>u().startsWith("bottom"),w=()=>y()?-1:1,[R,B]=z(S),P=r=>{if(!r||typeof window>"u")return;const i=()=>{const n=r.offsetHeight;n&&B(n)};if(i(),typeof ResizeObserver>"u")return;const e=new ResizeObserver(i);e.observe(r),H(()=>e.disconnect())},T=r=>D()?`translateY(${w()*(R()+k)*r}px) scale(1)`:`translateY(${w()*Y*r}px) scale(${1-A*r})`,X=()=>{const r=j().length;return r?D()?r*R()+(r-1)*k:R()+(r-1)*Y:0},q=Q(()=>[...(t.toasts??[]).filter(r=>(r.target??void 0)===t.target)].reverse()),j=Q(()=>q().slice(0,c())),[x,F]=z(null);return G(()=>{const r=t.target;if(!r||typeof window>"u"){F(null);return}const i=()=>{const n=r.getBoundingClientRect();F({top:n.top,left:n.left,right:n.right,bottom:n.bottom,width:n.width})};i();const e=new ResizeObserver(i);e.observe(r),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),H(()=>{e.disconnect(),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)})}),a(b,{get when(){return l()},get fallback(){return(()=>{var r=we();return h(r,a(U,{get each(){return j()},children:i=>a(re,{item:i,get appearance(){return t.appearance},get inverse(){return t.inverse},onDismiss:e=>{var n;return(n=t.onDismiss)==null?void 0:n.call(t,i.id,e)},onAction:e=>{var n;return(n=t.onAction)==null?void 0:n.call(t,i.id,e)}})})),L(i=>{var e=g("pointer-events-none fixed z-[100] flex flex-col gap-2",x()?$e[u()]:g("max-w-[min(30rem,calc(100vw-2rem))]",ne[u()])),n=x()?oe(u(),x()):void 0;return e!==i.e&&E(r,i.e=e),i.t=Z(r,n,i.t),i},{e:void 0,t:void 0}),r})()},get children(){var r=be(),i=r.firstChild;return r.$$focusout=()=>W(!1),r.$$focusin=()=>W(!0),r.addEventListener("pointerleave",()=>v(!1)),r.addEventListener("pointerenter",()=>v(!0)),h(i,a(U,{get each(){return j()},children:(e,n)=>(()=>{var o=te();return V(s=>{n()===0&&P(s)},o),h(o,a(re,{item:e,get paused(){return D()},get appearance(){return t.appearance},get inverse(){return t.inverse},onDismiss:s=>{var p;return(p=t.onDismiss)==null?void 0:p.call(t,e.id,s)},onAction:s=>{var p;return(p=t.onAction)==null?void 0:p.call(t,e.id,s)}})),L(s=>{var p=n(),M=g("absolute inset-x-0 flex transition-[transform,opacity] duration-200 ease-out",y()?"bottom-0 origin-bottom":"top-0 origin-top",u().endsWith("right")?"justify-end":u().endsWith("left")?"justify-start":"justify-center"),N=String(c()-n()),K=T(n());return p!==s.e&&C(o,"data-depth",s.e=p),M!==s.t&&E(o,s.t=M),N!==s.a&&J(o,"z-index",s.a=N),K!==s.o&&J(o,"transform",s.o=K),s},{e:void 0,t:void 0,a:void 0,o:void 0}),o})()})),L(e=>{var n=D()?"":void 0,o=g("pointer-events-none fixed z-[100]",!x()&&ne[u()]),s=x()?oe(u(),x()):void 0,p=`${X()}px`;return n!==e.e&&C(r,"data-expanded",e.e=n),o!==e.t&&E(r,e.t=o),e.a=Z(r,s,e.a),p!==e.o&&J(i,"height",e.o=p),e},{e:void 0,t:void 0,a:void 0,o:void 0}),r}})}ie(["click","focusin","focusout"]),ae("kai-toast-region",{toasts:[],position:"top-center",max:3,stack:"expanded",appearance:"pill",inverse:!1,target:void 0},(t,{dispatch:c,flag:u})=>{const f=()=>{const l=t.max,d=typeof l=="string"?parseInt(l,10):l;return typeof d=="number"&&!Number.isNaN(d)?d:3},m=l=>{de.dismiss(l)};return a(ye,{get toasts(){return t.toasts??[]},get position(){return t.position},get max(){return f()},get stack(){return t.stack},get appearance(){return t.appearance},get inverse(){return u("inverse")},get target(){return t.target},onDismiss:(l,d)=>{m(l),c("kai-dismiss",{id:l,reason:d})},onAction:(l,d)=>c("kai-action",{id:l,label:d})})});
@@ -1 +1 @@
1
- import{q as r,c as o,S as n}from"./chunks/cn-Dogu6PbV.js";import{T as a}from"./chunks/tool-GJ3vwp1U.js";r("kai-tool",{tool:void 0,open:!1},(t,{flag:e})=>o(n,{get when(){return t.tool},get children(){return o(a,{get toolPart(){return t.tool},get defaultOpen(){return e("open")}})}}));
1
+ import{f as a,c as l,S as d}from"./chunks/define-CNSKFZCd.js";import{T as i}from"./chunks/tool-TMued3WO.js";import{w as f}from"./chunks/disclosure-BcBs--Jf.js";a("kai-tool",{tool:void 0,open:void 0,defaultOpen:void 0,disabled:void 0},(t,e)=>{const{flag:o}=e;let r;return f(e,()=>r,()=>t.open),l(d,{get when(){return t.tool},get children(){return l(i,{get toolPart(){return t.tool},get defaultOpen(){return o("defaultOpen")},get disabled(){return o("disabled")},controllerRef:n=>r=n})}})});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as i,c as d,q as s,n as r,t as a}from"./chunks/define-CNSKFZCd.js";import{T as p}from"./chunks/tooltip-Cft_Rxiw.js";import{w as u}from"./chunks/disclosure-BcBs--Jf.js";var c=a("<style>:host{display:inline-flex}"),m=a("<slot>");i("kai-tooltip",{content:"",openDelay:void 0,closeDelay:void 0,placement:void 0,open:void 0,defaultOpen:void 0,disabled:void 0},(e,o)=>{const{flag:n}=o;let l;return u(o,()=>l,()=>e.open),[c(),d(p,{get content(){return e.content??""},get openDelay(){return r(()=>e.openDelay!=null)()?Number(e.openDelay):void 0},get closeDelay(){return r(()=>e.closeDelay!=null)()?Number(e.closeDelay):void 0},get placement(){return e.placement??void 0},get defaultOpen(){return n("defaultOpen")},get disabled(){return n("disabled")},controllerRef:t=>l=t,get children(){var t=m();return t._$owner=s(),t}})]});