@kitn.ai/ui 0.15.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/README.md +37 -13
  2. package/bin/mcp.js +22 -0
  3. package/dist/bash-InADTalH.js +6 -1
  4. package/dist/components/artifact.d.ts +58 -0
  5. package/dist/components/attachments.d.ts +67 -0
  6. package/dist/components/card-fallback.d.ts +10 -0
  7. package/dist/components/card-renderer.d.ts +13 -0
  8. package/dist/components/card.d.ts +28 -0
  9. package/dist/components/chain-of-thought.d.ts +29 -0
  10. package/dist/components/chat-container.d.ts +19 -0
  11. package/dist/components/chat-scope-picker.d.ts +9 -0
  12. package/dist/components/chat-thread.d.ts +91 -0
  13. package/dist/components/checkpoint.d.ts +20 -0
  14. package/dist/components/choice-card.d.ts +78 -0
  15. package/dist/components/code-block.d.ts +16 -0
  16. package/dist/components/confirm-card.d.ts +57 -0
  17. package/dist/components/context.d.ts +65 -0
  18. package/dist/components/conversation-item.d.ts +8 -0
  19. package/dist/components/conversation-list.d.ts +11 -0
  20. package/dist/components/dismissed-stub.d.ts +22 -0
  21. package/dist/components/embed.d.ts +21 -0
  22. package/dist/components/empty.d.ts +43 -0
  23. package/dist/components/feedback-bar.d.ts +45 -0
  24. package/dist/components/file-tree.d.ts +57 -0
  25. package/dist/components/file-upload.d.ts +16 -0
  26. package/dist/components/form-widgets.d.ts +31 -0
  27. package/dist/components/form.d.ts +103 -0
  28. package/dist/components/image.d.ts +12 -0
  29. package/dist/components/link-preview.d.ts +23 -0
  30. package/dist/components/loader.d.ts +60 -0
  31. package/dist/components/markdown.d.ts +8 -0
  32. package/dist/components/message-skills.d.ts +15 -0
  33. package/dist/components/message.d.ts +111 -0
  34. package/dist/components/model-switcher.d.ts +8 -0
  35. package/dist/components/prompt-input.d.ts +38 -0
  36. package/dist/components/prompt-suggestion.d.ts +13 -0
  37. package/dist/components/reasoning.d.ts +20 -0
  38. package/dist/components/response-compare-types.d.ts +66 -0
  39. package/dist/components/response-compare.d.ts +51 -0
  40. package/dist/components/response-stream.d.ts +14 -0
  41. package/dist/components/scroll-button.d.ts +7 -0
  42. package/dist/components/slash-command.d.ts +15 -0
  43. package/dist/components/source.d.ts +23 -0
  44. package/dist/components/tasks-card.d.ts +72 -0
  45. package/dist/components/text-shimmer.d.ts +9 -0
  46. package/dist/components/thinking-bar.d.ts +10 -0
  47. package/dist/components/toast.d.ts +48 -0
  48. package/dist/components/tool.d.ts +16 -0
  49. package/dist/components/use-card-resolution.d.ts +16 -0
  50. package/dist/components/voice-input.d.ts +7 -0
  51. package/dist/core-AYMC6_lb.js +5874 -12
  52. package/dist/css-M7EaDHN_.js +6 -1
  53. package/dist/custom-elements.json +260 -11
  54. package/dist/elements/artifact.d.ts +1 -0
  55. package/dist/elements/artifact.js +1 -0
  56. package/dist/elements/attachments.d.ts +1 -0
  57. package/dist/elements/attachments.js +1 -0
  58. package/dist/elements/autoloader.d.ts +2 -0
  59. package/dist/elements/autoloader.js +1 -0
  60. package/dist/elements/card.d.ts +1 -0
  61. package/dist/elements/card.js +1 -0
  62. package/dist/elements/cards.d.ts +1 -0
  63. package/dist/elements/cards.js +1 -0
  64. package/dist/elements/chain-of-thought.d.ts +1 -0
  65. package/dist/elements/chain-of-thought.js +1 -0
  66. package/dist/elements/chat-scope-picker.d.ts +1 -0
  67. package/dist/elements/chat-scope-picker.js +1 -0
  68. package/dist/elements/chat-workspace.d.ts +1 -0
  69. package/dist/elements/chat-workspace.js +1 -0
  70. package/dist/elements/chat.d.ts +1 -0
  71. package/dist/elements/chat.js +1 -0
  72. package/dist/elements/checkpoint.d.ts +1 -0
  73. package/dist/elements/checkpoint.js +1 -0
  74. package/dist/elements/choice.d.ts +1 -0
  75. package/dist/elements/choice.js +1 -0
  76. package/dist/elements/chunks/Icon-D_Zmwmwh.js +1 -0
  77. package/dist/elements/chunks/action-icons-PVfIvcuG.js +1 -0
  78. package/dist/elements/chunks/attachments-Dp6vqtrc.js +1 -0
  79. package/dist/elements/chunks/bash-InADTalH.js +1 -0
  80. package/dist/elements/chunks/button-CKyYD9G4.js +1 -0
  81. package/dist/elements/chunks/card-Cjho-PYk.js +1 -0
  82. package/dist/elements/chunks/card-routing-C986KuUA.js +1 -0
  83. package/dist/elements/chunks/chat-thread-RT808iPf.js +1 -0
  84. package/dist/elements/chunks/check-CDYaMYrM.js +1 -0
  85. package/dist/elements/chunks/chevron-down-3SBiq8HF.js +1 -0
  86. package/dist/elements/chunks/chevron-right-k2UFlIVK.js +1 -0
  87. package/dist/elements/chunks/cn-Dogu6PbV.js +1 -0
  88. package/dist/elements/chunks/code-block-BYUmfFSd.js +1 -0
  89. package/dist/elements/chunks/collapsible-BiNwdOn6.js +1 -0
  90. package/dist/elements/chunks/context-18g6oi4J.js +1 -0
  91. package/dist/elements/chunks/conversation-list-D9Y0NVdo.js +1 -0
  92. package/dist/elements/chunks/core-AYMC6_lb.js +12 -0
  93. package/dist/elements/chunks/css-M7EaDHN_.js +1 -0
  94. package/dist/elements/chunks/default-input-CSAoYYMd.js +1 -0
  95. package/dist/elements/chunks/download-D8K0Je8r.js +1 -0
  96. package/dist/elements/chunks/dropdown-bUs2iTia.js +1 -0
  97. package/dist/elements/chunks/engine-javascript-vq0WuIJl.js +141 -0
  98. package/dist/elements/chunks/external-link-6mA0wxab.js +1 -0
  99. package/dist/elements/chunks/file-text-DnaYk3Dm.js +1 -0
  100. package/dist/elements/chunks/file-tree-CgtRLlxK.js +1 -0
  101. package/dist/elements/chunks/github-dark-dimmed-DUshB20C.js +1 -0
  102. package/dist/elements/chunks/github-light-JYsPkUQd.js +1 -0
  103. package/dist/elements/chunks/hover-card-CIGw62gP.js +1 -0
  104. package/dist/elements/chunks/html-CPZ3oZQ7.js +1 -0
  105. package/dist/elements/chunks/index-CTBEJeo6.js +1 -0
  106. package/dist/elements/chunks/javascript-C25yR2R2.js +1 -0
  107. package/dist/elements/chunks/json-DxJze_jm.js +1 -0
  108. package/dist/elements/chunks/link-BlGSeoPy.js +1 -0
  109. package/dist/elements/chunks/loader-DvhR4qa0.js +1 -0
  110. package/dist/elements/chunks/markdown-CMTGx9r8.js +64 -0
  111. package/dist/elements/chunks/message-CDZwXjhL.js +1 -0
  112. package/dist/elements/chunks/message-feedback-CYx81QiA.js +1 -0
  113. package/dist/elements/chunks/model-switcher-O_tUhoOT.js +1 -0
  114. package/dist/elements/chunks/overlay-DydXYMQW.js +1 -0
  115. package/dist/elements/chunks/prompt-suggestion-ldlWV5kd.js +1 -0
  116. package/dist/elements/chunks/reasoning-2PUnHlmr.js +1 -0
  117. package/dist/elements/chunks/resizable-B5WNbSeb.js +1 -0
  118. package/dist/elements/chunks/star-t9tI-P0q.js +1 -0
  119. package/dist/elements/chunks/store-C6rIooZz.js +1 -0
  120. package/dist/elements/chunks/svelte--5p79yCD.js +1 -0
  121. package/dist/elements/chunks/text-shimmer-uh9V_KUh.js +1 -0
  122. package/dist/elements/chunks/textarea-3nm6Ia9U.js +1 -0
  123. package/dist/elements/chunks/thumbs-up-BBtguGld.js +1 -0
  124. package/dist/elements/chunks/toast-store-D8cL3fWl.js +1 -0
  125. package/dist/elements/chunks/tool-GJ3vwp1U.js +1 -0
  126. package/dist/elements/chunks/tooltip-DwKAz4XR.js +1 -0
  127. package/dist/elements/chunks/triangle-alert-Ct1zt2JL.js +1 -0
  128. package/dist/elements/chunks/tsx-B8rCNbgL.js +1 -0
  129. package/dist/elements/chunks/typescript-RycA9KXf.js +1 -0
  130. package/dist/elements/chunks/use-card-resolution-D-_0Alzy.js +1 -0
  131. package/dist/elements/chunks/video-mVYiM99-.js +1 -0
  132. package/dist/elements/chunks/vue-BmIZj4XD.js +1 -0
  133. package/dist/elements/chunks/x-CzxL27Ch.js +1 -0
  134. package/dist/elements/code-block.d.ts +1 -0
  135. package/dist/elements/code-block.js +1 -0
  136. package/dist/elements/compare.d.ts +1 -0
  137. package/dist/elements/compare.js +1 -0
  138. package/dist/elements/confirm-card.d.ts +1 -0
  139. package/dist/elements/confirm-card.js +1 -0
  140. package/dist/elements/context-meter.d.ts +1 -0
  141. package/dist/elements/context-meter.js +1 -0
  142. package/dist/elements/conversation-list.d.ts +1 -0
  143. package/dist/elements/conversation-list.js +1 -0
  144. package/dist/elements/embed.d.ts +1 -0
  145. package/dist/elements/embed.js +1 -0
  146. package/dist/elements/empty.d.ts +1 -0
  147. package/dist/elements/empty.js +1 -0
  148. package/dist/elements/feedback-bar.d.ts +1 -0
  149. package/dist/elements/feedback-bar.js +1 -0
  150. package/dist/elements/file-tree.d.ts +1 -0
  151. package/dist/elements/file-tree.js +1 -0
  152. package/dist/elements/file-upload.d.ts +1 -0
  153. package/dist/elements/file-upload.js +1 -0
  154. package/dist/elements/form.d.ts +1 -0
  155. package/dist/elements/form.js +1 -0
  156. package/dist/elements/image.d.ts +1 -0
  157. package/dist/elements/image.js +1 -0
  158. package/dist/elements/link-preview.d.ts +1 -0
  159. package/dist/elements/link-preview.js +1 -0
  160. package/dist/elements/loader.d.ts +1 -0
  161. package/dist/elements/loader.js +1 -0
  162. package/dist/elements/markdown.d.ts +1 -0
  163. package/dist/elements/markdown.js +1 -0
  164. package/dist/elements/message-skills.d.ts +1 -0
  165. package/dist/elements/message-skills.js +1 -0
  166. package/dist/elements/message.d.ts +1 -0
  167. package/dist/elements/message.js +1 -0
  168. package/dist/elements/model-switcher.d.ts +1 -0
  169. package/dist/elements/model-switcher.js +1 -0
  170. package/dist/elements/popover.d.ts +1 -0
  171. package/dist/elements/popover.js +1 -0
  172. package/dist/elements/prompt-input.d.ts +1 -0
  173. package/dist/elements/prompt-input.js +1 -0
  174. package/dist/elements/prompt-suggestions.d.ts +1 -0
  175. package/dist/elements/prompt-suggestions.js +1 -0
  176. package/dist/elements/reasoning.d.ts +1 -0
  177. package/dist/elements/reasoning.js +1 -0
  178. package/dist/elements/resizable.d.ts +1 -0
  179. package/dist/elements/resizable.js +1 -0
  180. package/dist/elements/response-stream.d.ts +1 -0
  181. package/dist/elements/response-stream.js +14 -0
  182. package/dist/elements/scroll-button.d.ts +1 -0
  183. package/dist/elements/scroll-button.js +1 -0
  184. package/dist/elements/source.d.ts +1 -0
  185. package/dist/elements/source.js +1 -0
  186. package/dist/elements/switch.d.ts +1 -0
  187. package/dist/elements/switch.js +1 -0
  188. package/dist/elements/tasks.d.ts +1 -0
  189. package/dist/elements/tasks.js +1 -0
  190. package/dist/elements/text-shimmer.d.ts +1 -0
  191. package/dist/elements/text-shimmer.js +1 -0
  192. package/dist/elements/thinking-bar.d.ts +1 -0
  193. package/dist/elements/thinking-bar.js +1 -0
  194. package/dist/elements/toast.d.ts +1 -0
  195. package/dist/elements/toast.js +1 -0
  196. package/dist/elements/tool.d.ts +1 -0
  197. package/dist/elements/tool.js +1 -0
  198. package/dist/elements/voice-input.d.ts +1 -0
  199. package/dist/elements/voice-input.js +1 -0
  200. package/dist/elements.d.ts +768 -0
  201. package/dist/engine-javascript-vq0WuIJl.js +2516 -14
  202. package/dist/github-dark-dimmed-DUshB20C.js +4 -1
  203. package/dist/github-light-JYsPkUQd.js +4 -1
  204. package/dist/html-CPZ3oZQ7.js +10 -1
  205. package/dist/index.d.ts +124 -2
  206. package/dist/index.js +15593 -0
  207. package/dist/javascript-C25yR2R2.js +6 -1
  208. package/dist/json-DxJze_jm.js +6 -1
  209. package/dist/kitn-chat.es.js +1 -77
  210. package/dist/llms/llms-full.txt +57 -12
  211. package/dist/llms/llms.txt +3 -3
  212. package/dist/mcp.es.js +2296 -0
  213. package/dist/primitives/card-contract.d.ts +119 -0
  214. package/dist/primitives/card-host.d.ts +12 -0
  215. package/dist/primitives/card-recovery.d.ts +55 -0
  216. package/dist/primitives/card-registry.d.ts +17 -0
  217. package/dist/primitives/card-resolution.d.ts +8 -0
  218. package/dist/primitives/card-routing.d.ts +12 -0
  219. package/dist/primitives/card-validate.d.ts +25 -0
  220. package/dist/primitives/chat-config.d.ts +31 -0
  221. package/dist/primitives/controllable.d.ts +13 -0
  222. package/dist/primitives/embed-providers.d.ts +65 -0
  223. package/dist/primitives/highlighter.d.ts +23 -0
  224. package/dist/primitives/link-preview.d.ts +47 -0
  225. package/dist/primitives/message-feedback.d.ts +35 -0
  226. package/dist/primitives/pdf-preview.d.ts +50 -0
  227. package/dist/primitives/toast-store.d.ts +88 -0
  228. package/dist/primitives/use-auto-resize.d.ts +8 -0
  229. package/dist/primitives/use-resize-observer.d.ts +1 -0
  230. package/dist/primitives/use-stick-to-bottom.d.ts +5 -0
  231. package/dist/primitives/use-text-stream.d.ts +19 -0
  232. package/dist/primitives/use-voice-recorder.d.ts +9 -0
  233. package/dist/react/index.d.ts +1198 -0
  234. package/dist/react/runtime.d.ts +15 -0
  235. package/dist/react.js +275 -0
  236. package/dist/register-JyTglR6m.js +1 -0
  237. package/dist/register-impl-C6wlSsts.js +77 -0
  238. package/dist/remote/host-embed.d.ts +33 -0
  239. package/dist/remote/index.d.ts +2 -0
  240. package/dist/remote/origin.d.ts +5 -0
  241. package/dist/remote/provider-runtime.d.ts +27 -0
  242. package/dist/remote/provider.d.ts +2 -0
  243. package/dist/remote/validate.d.ts +4 -0
  244. package/dist/remote/version.d.ts +4 -0
  245. package/dist/remote/wire.d.ts +53 -0
  246. package/dist/schemas/choice.schema.json +5 -0
  247. package/dist/schemas/tasks.schema.json +5 -0
  248. package/dist/svelte--5p79yCD.js +15 -1
  249. package/dist/tsx-B8rCNbgL.js +6 -1
  250. package/dist/types.d.ts +42 -0
  251. package/dist/typescript-RycA9KXf.js +6 -1
  252. package/dist/ui/action-icons.d.ts +11 -0
  253. package/dist/ui/avatar.d.ts +8 -0
  254. package/dist/ui/badge.d.ts +9 -0
  255. package/dist/ui/button.d.ts +10 -0
  256. package/dist/ui/collapsible.d.ts +27 -0
  257. package/dist/ui/dropdown.d.ts +20 -0
  258. package/dist/ui/hover-card.d.ts +28 -0
  259. package/dist/ui/overlay.d.ts +67 -0
  260. package/dist/ui/popover.d.ts +32 -0
  261. package/dist/ui/resizable.d.ts +76 -0
  262. package/dist/ui/scroll-area.d.ts +5 -0
  263. package/dist/ui/separator.d.ts +5 -0
  264. package/dist/ui/skeleton.d.ts +5 -0
  265. package/dist/ui/switch.d.ts +19 -0
  266. package/dist/ui/textarea.d.ts +6 -0
  267. package/dist/ui/tooltip.d.ts +9 -0
  268. package/dist/utils/cn.d.ts +2 -0
  269. package/dist/vue-BmIZj4XD.js +33 -1
  270. package/frameworks/react/index.tsx +67 -11
  271. package/frameworks/react/runtime.tsx +16 -2
  272. package/llms-full.txt +57 -12
  273. package/llms.txt +3 -3
  274. package/package.json +36 -14
  275. package/src/agent-tooling/archetypes.ts +46 -0
  276. package/src/agent-tooling/integrations/cloudflare.ts +88 -0
  277. package/src/agent-tooling/integrations/langgraph.ts +60 -0
  278. package/src/agent-tooling/integrations/mastra.ts +27 -0
  279. package/src/agent-tooling/integrations/mock.ts +34 -0
  280. package/src/agent-tooling/integrations/ollama.ts +47 -0
  281. package/src/agent-tooling/integrations/openrouter.ts +26 -0
  282. package/src/agent-tooling/integrations/pi.ts +40 -0
  283. package/src/agent-tooling/integrations/pydantic-ai.ts +52 -0
  284. package/src/agent-tooling/integrations/vercel-ai-sdk.ts +44 -0
  285. package/src/agent-tooling/mcp/manifest.ts +128 -0
  286. package/src/agent-tooling/mcp/server.ts +59 -0
  287. package/src/agent-tooling/mcp/stdio.ts +18 -0
  288. package/src/agent-tooling/mcp/tools/debug.ts +489 -0
  289. package/src/agent-tooling/mcp/tools/reference.ts +132 -0
  290. package/src/agent-tooling/mcp/tools/scaffold.ts +1759 -0
  291. package/src/agent-tooling/mcp/tools/theme.ts +340 -0
  292. package/src/agent-tooling/mcp/tools/types.ts +14 -0
  293. package/src/agent-tooling/registry.ts +41 -0
  294. package/src/agent-tooling/types.ts +30 -0
  295. package/src/components/chat-thread.tsx +27 -35
  296. package/src/components/choice-card.tsx +33 -4
  297. package/src/components/component-meta.json +250 -26
  298. package/src/components/confirm-card.tsx +15 -1
  299. package/src/components/dismissed-stub.tsx +80 -0
  300. package/src/components/form.tsx +21 -3
  301. package/src/components/message.tsx +151 -10
  302. package/src/components/response-compare-types.ts +127 -0
  303. package/src/components/response-compare.tsx +431 -0
  304. package/src/components/tasks-card.tsx +33 -3
  305. package/src/components/toast.tsx +398 -0
  306. package/src/components/use-card-resolution.ts +24 -8
  307. package/src/elements/autoloader.ts +89 -0
  308. package/src/elements/chat-types.ts +7 -0
  309. package/src/elements/chat-workspace.tsx +4 -2
  310. package/src/elements/chat.tsx +4 -2
  311. package/src/elements/compare.tsx +88 -0
  312. package/src/elements/compiled.css +1 -1
  313. package/src/elements/define.tsx +7 -1
  314. package/src/elements/element-manifest.json +182 -0
  315. package/src/elements/element-meta.json +191 -68
  316. package/src/elements/element-types.d.ts +43 -6
  317. package/src/elements/framework-usage.json +25 -0
  318. package/src/elements/message.tsx +27 -45
  319. package/src/elements/register-impl.ts +58 -0
  320. package/src/elements/register.ts +26 -51
  321. package/src/elements/remote.tsx +4 -0
  322. package/src/elements/styles.css +19 -0
  323. package/src/elements/toast.tsx +74 -0
  324. package/src/index.ts +30 -0
  325. package/src/primitives/card-contract.ts +14 -5
  326. package/src/primitives/card-recovery.ts +149 -0
  327. package/src/primitives/card-routing.ts +3 -0
  328. package/src/primitives/card-schemas/choice.schema.json +5 -0
  329. package/src/primitives/card-schemas/tasks.schema.json +5 -0
  330. package/src/primitives/message-feedback.ts +123 -0
  331. package/src/primitives/toast-store.ts +235 -0
  332. package/src/ui/tooltip.tsx +8 -2
  333. package/theme.css +4 -2
@@ -0,0 +1,15 @@
1
+ import { CSSProperties, ForwardRefExoticComponent, PropsWithoutRef, ReactNode, RefAttributes } from 'react';
2
+ export interface WebComponentProps {
3
+ /** Color mode (`auto` follows prefers-color-scheme). */
4
+ theme?: 'light' | 'dark' | 'auto';
5
+ className?: string;
6
+ style?: CSSProperties;
7
+ id?: string;
8
+ /** Light-DOM children passed through to the element (slots). */
9
+ children?: ReactNode;
10
+ }
11
+ export declare function createWebComponent<P extends WebComponentProps>(tagName: string,
12
+ /** DOM-property names to assign from props (incl. `theme`). */
13
+ propNames: readonly string[],
14
+ /** Map of React handler prop → DOM event name, e.g. `{ onMessageAction: 'kai-message-action' }`. */
15
+ eventMap: Record<string, string>): ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<HTMLElement>>;
package/dist/react.js ADDED
@@ -0,0 +1,275 @@
1
+ import "@kitn.ai/ui/elements";
2
+ import { forwardRef as C, useRef as k, useImperativeHandle as S, useLayoutEffect as g, createElement as T } from "react";
3
+ function e(n, p, l) {
4
+ const u = Object.entries(l), r = C((b, v) => {
5
+ const s = k(null);
6
+ S(v, () => s.current, []);
7
+ const o = b, h = k({});
8
+ for (const a of Object.keys(l)) h.current[a] = o[a];
9
+ return g(() => {
10
+ const a = s.current;
11
+ if (!a) return;
12
+ const i = () => {
13
+ for (const t of p)
14
+ t in o && o[t] !== void 0 && (a[t] = o[t]);
15
+ };
16
+ i(), typeof customElements < "u" && !customElements.get(n) && customElements.whenDefined(n).then(i);
17
+ }), g(() => {
18
+ const a = s.current;
19
+ if (!a) return;
20
+ const i = [];
21
+ for (const [t, c] of u) {
22
+ const d = (f) => {
23
+ const m = h.current[t];
24
+ typeof m == "function" && m(f);
25
+ };
26
+ a.addEventListener(c, d), i.push([c, d]);
27
+ }
28
+ return () => i.forEach(([t, c]) => a.removeEventListener(t, c));
29
+ }, []), T(
30
+ n,
31
+ {
32
+ ref: s,
33
+ className: o.className,
34
+ style: o.style,
35
+ id: o.id
36
+ },
37
+ // Light-DOM children pass straight through to the element (slots).
38
+ o.children ?? null
39
+ );
40
+ });
41
+ return r.displayName = n, r;
42
+ }
43
+ const y = e(
44
+ "kai-artifact",
45
+ ["theme", "src", "files", "tab", "activeFile", "sandbox", "iframeTitle", "maximized", "expandable", "openInTab", "noNav", "noReload", "noHome", "noPathField", "noTabs", "standalone", "readonlyPath"],
46
+ { onFileSelect: "kai-file-select", onMaximizeChange: "kai-maximize-change", onNavigate: "kai-navigate", onTabChange: "kai-tab-change" }
47
+ ), M = e(
48
+ "kai-attachments",
49
+ ["theme", "items", "variant", "hoverCard", "removable", "showMediaType", "emptyText"],
50
+ { onRemove: "kai-remove" }
51
+ ), w = e(
52
+ "kai-card",
53
+ ["theme", "heading", "description", "errorMessage", "dense"],
54
+ {}
55
+ ), I = e(
56
+ "kai-cards",
57
+ ["theme", "cards", "types", "policy"],
58
+ {}
59
+ ), R = e(
60
+ "kai-chain-of-thought",
61
+ ["theme", "steps"],
62
+ {}
63
+ ), E = e(
64
+ "kai-chat",
65
+ ["theme", "messages", "value", "placeholder", "loading", "suggestions", "suggestionMode", "persistSuggestions", "proseSize", "codeTheme", "codeHighlight", "chatTitle", "models", "currentModel", "context", "scrollButton", "headerStart", "headerEnd", "search", "voice", "slashCommands", "slashActiveIds", "slashCompact", "actionsReveal"],
66
+ { onMessageAction: "kai-message-action", onModelChange: "kai-model-change", onSearch: "kai-search", onSlashSelect: "kai-slash-select", onSubmit: "kai-submit", onSuggestionClick: "kai-suggestion-click", onValueChange: "kai-value-change", onVoice: "kai-voice" }
67
+ ), F = e(
68
+ "kai-checkpoint",
69
+ ["theme", "label", "tooltip", "variant", "size"],
70
+ { onSelect: "kai-select" }
71
+ ), A = e(
72
+ "kai-choice",
73
+ ["theme", "data", "cardId", "heading", "resolution"],
74
+ {}
75
+ ), H = e(
76
+ "kai-code-block",
77
+ ["theme", "code", "language", "codeTheme", "codeHighlight", "proseSize"],
78
+ {}
79
+ ), L = e(
80
+ "kai-compare",
81
+ ["theme", "data", "compareId", "selection", "layout", "proseSize", "codeTheme", "codeHighlight"],
82
+ { onCompareSelect: "kai-compare-select", onError: "kai-error", onReady: "kai-ready" }
83
+ ), P = e(
84
+ "kai-confirm",
85
+ ["theme", "data", "cardId", "heading", "autofocus", "resolution"],
86
+ {}
87
+ ), N = e(
88
+ "kai-context",
89
+ ["theme", "context", "warnThreshold", "dangerThreshold"],
90
+ { onThresholdChange: "kai-threshold-change" }
91
+ ), V = e(
92
+ "kai-conversations",
93
+ ["theme", "groups", "conversations", "activeId"],
94
+ { onConversationSelect: "kai-conversation-select", onNewChat: "kai-new-chat", onToggleSidebar: "kai-toggle-sidebar" }
95
+ ), B = e(
96
+ "kai-embed",
97
+ ["theme", "cardId", "data"],
98
+ {}
99
+ ), O = e(
100
+ "kai-empty",
101
+ ["theme", "emptyTitle", "description"],
102
+ {}
103
+ ), W = e(
104
+ "kai-feedback-bar",
105
+ ["theme", "barTitle", "collectDetail", "categories", "detailTitle", "detailPlaceholder", "submitLabel", "thanksMessage"],
106
+ { onClose: "kai-close", onFeedback: "kai-feedback", onFeedbackDetail: "kai-feedback-detail" }
107
+ ), D = e(
108
+ "kai-file-tree",
109
+ ["theme", "files", "activeFile", "defaultExpanded"],
110
+ { onSelect: "kai-select" }
111
+ ), j = e(
112
+ "kai-file-upload",
113
+ ["theme", "multiple", "accept", "disabled", "label"],
114
+ { onFilesAdded: "kai-files-added" }
115
+ ), U = e(
116
+ "kai-form",
117
+ ["theme", "data", "cardId", "heading", "resolution"],
118
+ {}
119
+ ), q = e(
120
+ "kai-image",
121
+ ["theme", "base64", "bytes", "alt", "mediaType"],
122
+ {}
123
+ ), G = e(
124
+ "kai-link-preview",
125
+ ["theme", "cardId", "data"],
126
+ {}
127
+ ), J = e(
128
+ "kai-loader",
129
+ ["theme", "variant", "size", "text"],
130
+ {}
131
+ ), K = e(
132
+ "kai-markdown",
133
+ ["theme", "content", "proseSize", "codeTheme", "codeHighlight"],
134
+ {}
135
+ ), Q = e(
136
+ "kai-message",
137
+ ["theme", "message", "role", "content", "markdown", "proseSize", "codeTheme", "codeHighlight", "actionsReveal", "avatarSrc", "avatarFallback"],
138
+ { onMessageAction: "kai-message-action" }
139
+ ), X = e(
140
+ "kai-model-switcher",
141
+ ["theme", "models", "currentModel"],
142
+ { onModelChange: "kai-model-change" }
143
+ ), Y = e(
144
+ "kai-popover",
145
+ ["theme", "placement", "gutter", "open"],
146
+ { onOpenChange: "kai-open-change" }
147
+ ), Z = e(
148
+ "kai-prompt-input",
149
+ ["theme", "value", "placeholder", "disabled", "loading", "suggestions", "suggestionMode", "slashCommands", "slashActiveIds", "slashCompact", "search", "voice", "stoppable", "attachments"],
150
+ { onSearch: "kai-search", onSlashSelect: "kai-slash-select", onStop: "kai-stop", onSubmit: "kai-submit", onSuggestionClick: "kai-suggestion-click", onToolbarAction: "kai-toolbar-action", onValueChange: "kai-value-change", onVoice: "kai-voice" }
151
+ ), _ = e(
152
+ "kai-reasoning",
153
+ ["theme", "text", "label", "open", "streaming", "markdown"],
154
+ { onOpenChange: "kai-open-change" }
155
+ ), $ = e(
156
+ "kai-remote",
157
+ ["theme", "src", "providerOrigin", "envelope", "policy"],
158
+ {}
159
+ ), ee = e(
160
+ "kai-resizable",
161
+ ["theme", "orientation", "maximizedIndex"],
162
+ { onChange: "kai-change", onMaximizeChange: "kai-maximize-change" }
163
+ ), ae = e(
164
+ "kai-resizable-item",
165
+ ["theme", "size", "min", "max", "locked", "hidden"],
166
+ { onChange: "kai-change", onMaximizeChange: "kai-maximize-change" }
167
+ ), oe = e(
168
+ "kai-response-stream",
169
+ ["theme", "text", "mode", "speed", "as"],
170
+ { onComplete: "kai-complete" }
171
+ ), te = e(
172
+ "kai-scope-picker",
173
+ ["theme", "availableAuthors", "availableTags", "currentLabel"],
174
+ { onScopeChange: "kai-scope-change" }
175
+ ), ie = e(
176
+ "kai-scroll-button",
177
+ ["theme", "for", "variant", "size"],
178
+ { onScroll: "kai-scroll" }
179
+ ), ne = e(
180
+ "kai-skills",
181
+ ["theme", "skills"],
182
+ {}
183
+ ), se = e(
184
+ "kai-source",
185
+ ["theme", "href", "label", "headline", "description", "showFavicon"],
186
+ {}
187
+ ), ce = e(
188
+ "kai-sources",
189
+ ["theme", "sources", "showFavicon", "numbered"],
190
+ {}
191
+ ), le = e(
192
+ "kai-suggestions",
193
+ ["theme", "suggestions", "variant", "size", "block", "highlight"],
194
+ { onSelect: "kai-select" }
195
+ ), re = e(
196
+ "kai-switch",
197
+ ["theme", "checked", "disabled", "label"],
198
+ { onChange: "kai-change" }
199
+ ), he = e(
200
+ "kai-tasks",
201
+ ["theme", "data", "cardId", "heading", "resolution"],
202
+ {}
203
+ ), de = e(
204
+ "kai-text-shimmer",
205
+ ["theme", "text", "as", "duration", "spread"],
206
+ {}
207
+ ), me = e(
208
+ "kai-thinking-bar",
209
+ ["theme", "text", "stoppable", "stopLabel"],
210
+ { onStop: "kai-stop" }
211
+ ), ke = e(
212
+ "kai-toast-region",
213
+ ["theme", "toasts", "position", "max", "stack", "target"],
214
+ { onAction: "kai-action", onDismiss: "kai-dismiss" }
215
+ ), ge = e(
216
+ "kai-tool",
217
+ ["theme", "tool", "open"],
218
+ {}
219
+ ), pe = e(
220
+ "kai-voice-input",
221
+ ["theme", "transcribe", "disabled"],
222
+ { onAudioCaptured: "kai-audio-captured", onTranscription: "kai-transcription" }
223
+ ), ue = e(
224
+ "kai-workspace",
225
+ ["theme", "groups", "conversations", "activeId", "messages", "value", "placeholder", "loading", "suggestions", "suggestionMode", "proseSize", "codeTheme", "codeHighlight", "chatTitle", "models", "currentModel", "context", "scrollButton", "search", "voice", "slashCommands", "slashActiveIds", "slashCompact", "sidebarWidth", "sidebarMinWidth", "sidebarMaxWidth", "sidebarCollapsed", "defaultSidebarCollapsed"],
226
+ { onConversationSelect: "kai-conversation-select", onMessageAction: "kai-message-action", onModelChange: "kai-model-change", onNewChat: "kai-new-chat", onSearch: "kai-search", onSidebarToggle: "kai-sidebar-toggle", onSlashSelect: "kai-slash-select", onSubmit: "kai-submit", onSuggestionClick: "kai-suggestion-click", onValueChange: "kai-value-change", onVoice: "kai-voice" }
227
+ );
228
+ export {
229
+ y as Artifact,
230
+ M as Attachments,
231
+ w as Card,
232
+ I as Cards,
233
+ R as ChainOfThought,
234
+ E as Chat,
235
+ F as Checkpoint,
236
+ A as Choice,
237
+ H as CodeBlock,
238
+ L as Compare,
239
+ P as Confirm,
240
+ N as Context,
241
+ V as Conversations,
242
+ B as Embed,
243
+ O as Empty,
244
+ W as FeedbackBar,
245
+ D as FileTree,
246
+ j as FileUpload,
247
+ U as Form,
248
+ q as Image,
249
+ G as LinkPreview,
250
+ J as Loader,
251
+ K as Markdown,
252
+ Q as Message,
253
+ X as ModelSwitcher,
254
+ Y as Popover,
255
+ Z as PromptInput,
256
+ _ as Reasoning,
257
+ $ as Remote,
258
+ ee as Resizable,
259
+ ae as ResizableItem,
260
+ oe as ResponseStream,
261
+ te as ScopePicker,
262
+ ie as ScrollButton,
263
+ ne as Skills,
264
+ se as Source,
265
+ ce as Sources,
266
+ le as Suggestions,
267
+ re as Switch,
268
+ he as Tasks,
269
+ de as TextShimmer,
270
+ me as ThinkingBar,
271
+ ke as ToastRegion,
272
+ ge as Tool,
273
+ pe as VoiceInput,
274
+ ue as Workspace
275
+ };
@@ -0,0 +1 @@
1
+ const un={bash:()=>import("./bash-InADTalH.js"),javascript:()=>import("./javascript-C25yR2R2.js"),typescript:()=>import("./typescript-RycA9KXf.js"),tsx:()=>import("./tsx-B8rCNbgL.js"),html:()=>import("./html-CPZ3oZQ7.js"),css:()=>import("./css-M7EaDHN_.js"),json:()=>import("./json-DxJze_jm.js"),vue:()=>import("./vue-BmIZj4XD.js"),svelte:()=>import("./svelte--5p79yCD.js")},ln={"github-dark-dimmed":()=>import("./github-dark-dimmed-DUshB20C.js"),"github-light":()=>import("./github-light-JYsPkUQd.js")},cn={js:"javascript",ts:"typescript",jsx:"tsx",sh:"bash",shell:"bash"},qt="github-dark-dimmed";let gt=!0,yt={...un},vt={...ln},bt={...cn},wt=null;const $t=new Set,Mt=new Set;function an(){return wt||(wt=(async()=>{const[{createHighlighterCore:t},{createJavaScriptRegexEngine:n}]=await Promise.all([import("./core-AYMC6_lb.js"),import("./engine-javascript-vq0WuIJl.js")]);return t({themes:[],langs:[],engine:n()})})()),wt}function Dt(t){return bt[t]??t}async function fn(t,n){const e=Dt(n);if($t.has(e))return!0;const r=yt[e];return r?(await t.loadLanguage(r()),$t.add(e),!0):!1}async function Et(t,n){if(Mt.has(n))return!0;const e=vt[n];return e?(await t.loadTheme(e()),Mt.add(n),!0):!1}function dn(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function tt(t){return`<pre><code>${dn(t)}</code></pre>`}async function pn(t,n,e){if(!gt||!t)return tt(t);try{const r=await an();if(!await fn(r,n))return tt(t);const o=await Et(r,e)?e:await Et(r,qt)?qt:null;return o?r.codeToHtml(t,{lang:Dt(n),theme:o}):tt(t)}catch{return tt(t)}}function hn(t){t.enabled!==void 0&&(gt=t.enabled),t.languages&&(yt={...yt,...t.languages}),t.themes&&(vt={...vt,...t.themes}),t.aliases&&(bt={...bt,...t.aliases})}function gn(){return gt}const ue=!1,yn=(t,n)=>t===n,P=Symbol("solid-proxy"),Ct=typeof Proxy=="function",L=Symbol("solid-track"),nt={equals:yn};let U=null,Ft=Rt;const $=1,et=2,Ht={owned:null,cleanups:null,context:null,owner:null},mt={};var f=null;let Ot=null,ie=null,p=null,b=null,S=null,rt=0;function H(t,n){const e=p,r=f,o=t.length===0,u=n===void 0?r:n,s=o?Ht:{owned:null,cleanups:null,context:u?u.context:null,owner:u},i=o?t:()=>t(()=>w(()=>G(s)));f=s,p=null;try{return E(i,!0)}finally{p=e,f=r}}function _(t,n){n=n?Object.assign({},nt,n):nt;const e={value:t,observers:null,observerSlots:null,comparator:n.equals||void 0},r=o=>(typeof o=="function"&&(o=o(e.value)),Nt(e,o));return[Kt.bind(e),r]}function vn(t,n,e){const r=W(t,n,!0,$);I(r)}function Tt(t,n,e){const r=W(t,n,!1,$);I(r)}function Vt(t,n,e){Ft=$n;const r=W(t,n,!1,$);(!e||!e.render)&&(r.user=!0),S?S.push(r):I(r)}function O(t,n,e){e=e?Object.assign({},nt,e):nt;const r=W(t,n,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=e.equals||void 0,I(r),Kt.bind(r)}function bn(t){return t&&typeof t=="object"&&"then"in t}function wn(t,n,e){let r,o,u;typeof n=="function"?(r=t,o=n,u={}):(r=!0,o=t,u=n||{});let s=null,i=mt,l=!1,a="initialValue"in u,d=typeof r=="function"&&O(r);const c=new Set,[g,A]=(u.storage||_)(u.initialValue),[x,D]=_(void 0),[R,z]=_(void 0,{equals:!1}),[j,k]=_(a?"ready":"unresolved");function y(v,h,q,m){return s===v&&(s=null,m!==void 0&&(a=!0),(v===i||h===i)&&u.onHydrated&&queueMicrotask(()=>u.onHydrated(m,{value:h})),i=mt,C(h,q)),h}function C(v,h){E(()=>{h===void 0&&A(()=>v),k(h!==void 0?"errored":a?"ready":"unresolved"),D(h);for(const q of c.keys())q.decrement();c.clear()},!1)}function B(){const v=Sn,h=g(),q=x();if(q!==void 0&&!s)throw q;return p&&p.user,h}function ht(v=!0){if(v!==!1&&l)return;l=!1;const h=d?d():r;if(h==null||h===!1){y(s,w(g));return}let q;const m=i!==mt?i:w(()=>{try{return o(h,{value:g(),refetching:v})}catch(J){q=J}});if(q!==void 0){y(s,void 0,it(q),h);return}else if(!bn(m))return y(s,m,void 0,h),m;return s=m,"v"in m?(m.s===1?y(s,m.v,void 0,h):y(s,void 0,it(m.v),h),m):(l=!0,queueMicrotask(()=>l=!1),E(()=>{k(a?"refreshing":"pending"),z()},!1),m.then(J=>y(m,J,void 0,h),J=>y(m,void 0,it(J),h)))}Object.defineProperties(B,{state:{get:()=>j()},error:{get:()=>x()},loading:{get(){const v=j();return v==="pending"||v==="refreshing"}},latest:{get(){if(!a)return B();const v=x();if(v&&!s)throw v;return g()}}});let _t=f;return d?vn(()=>(_t=f,ht(!1))):ht(!1),[B,{refetch:v=>zt(_t,()=>ht(v)),mutate:A}]}function mn(t){return E(t,!1)}function w(t){if(p===null)return t();const n=p;p=null;try{return t()}finally{p=n}}function On(t,n,e){const r=Array.isArray(t);let o,u=e&&e.defer;return s=>{let i;if(r){i=Array(t.length);for(let a=0;a<t.length;a++)i[a]=t[a]()}else i=t();if(u)return u=!1,s;const l=w(()=>n(i,o,s));return o=i,l}}function An(t){Vt(()=>w(t))}function ot(t){return f===null||(f.cleanups===null?f.cleanups=[t]:f.cleanups.push(t)),t}function jn(t,n){U||(U=Symbol("error")),f=W(void 0,void 0,!0),f.context={...f.context,[U]:[n]};try{return t()}catch(e){Q(e)}finally{f=f.owner}}function At(){return p}function kn(){return f}function zt(t,n){const e=f,r=p;f=t,p=null;try{return E(n,!0)}catch(o){Q(o)}finally{f=e,p=r}}const[le,ce]=_(!1);function Pn(t,n){const e=Symbol("context");return{id:e,Provider:Mn(e),defaultValue:t}}function xn(t){let n;return f&&f.context&&(n=f.context[t.id])!==void 0?n:t.defaultValue}function It(t){const n=O(t),e=O(()=>jt(n()));return e.toArray=()=>{const r=e();return Array.isArray(r)?r:r!=null?[r]:[]},e}let Sn;function Kt(){if(this.sources&&this.state)if(this.state===$)I(this);else{const t=b;b=null,E(()=>ut(this),!1),b=t}if(p){const t=this.observers;if(!t||t[t.length-1]!==p){const n=t?t.length:0;p.sources?(p.sources.push(this),p.sourceSlots.push(n)):(p.sources=[this],p.sourceSlots=[n]),t?(t.push(p),this.observerSlots.push(p.sources.length-1)):(this.observers=[p],this.observerSlots=[p.sources.length-1])}}return this.value}function Nt(t,n,e){let r=t.value;return(!t.comparator||!t.comparator(r,n))&&(t.value=n,t.observers&&t.observers.length&&E(()=>{for(let o=0;o<t.observers.length;o+=1){const u=t.observers[o],s=Ot&&Ot.running;s&&Ot.disposed.has(u),(s?!u.tState:!u.state)&&(u.pure?b.push(u):S.push(u),u.observers&&Bt(u)),s||(u.state=$)}if(b.length>1e6)throw b=[],new Error},!1)),n}function I(t){if(!t.fn)return;G(t);const n=rt;_n(t,t.value,n)}function _n(t,n,e){let r;const o=f,u=p;p=f=t;try{r=t.fn(n)}catch(s){return t.pure&&(t.state=$,t.owned&&t.owned.forEach(G),t.owned=null),t.updatedAt=e+1,Q(s)}finally{p=u,f=o}(!t.updatedAt||t.updatedAt<=e)&&(t.updatedAt!=null&&"observers"in t?Nt(t,r):t.value=r,t.updatedAt=e)}function W(t,n,e,r=$,o){const u={fn:t,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:n,owner:f,context:f?f.context:null,pure:e};return f===null||f!==Ht&&(f.owned?f.owned.push(u):f.owned=[u]),u}function st(t){if(t.state===0)return;if(t.state===et)return ut(t);if(t.suspense&&w(t.suspense.inFallback))return t.suspense.effects.push(t);const n=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<rt);)t.state&&n.push(t);for(let e=n.length-1;e>=0;e--)if(t=n[e],t.state===$)I(t);else if(t.state===et){const r=b;b=null,E(()=>ut(t,n[0]),!1),b=r}}function E(t,n){if(b)return t();let e=!1;n||(b=[]),S?e=!0:S=[],rt++;try{const r=t();return qn(e),r}catch(r){e||(S=null),b=null,Q(r)}}function qn(t){if(b&&(Rt(b),b=null),t)return;const n=S;S=null,n.length&&E(()=>Ft(n),!1)}function Rt(t){for(let n=0;n<t.length;n++)st(t[n])}function $n(t){let n,e=0;for(n=0;n<t.length;n++){const r=t[n];r.user?t[e++]=r:st(r)}for(n=0;n<e;n++)st(t[n])}function ut(t,n){t.state=0;for(let e=0;e<t.sources.length;e+=1){const r=t.sources[e];if(r.sources){const o=r.state;o===$?r!==n&&(!r.updatedAt||r.updatedAt<rt)&&st(r):o===et&&ut(r,n)}}}function Bt(t){for(let n=0;n<t.observers.length;n+=1){const e=t.observers[n];e.state||(e.state=et,e.pure?b.push(e):S.push(e),e.observers&&Bt(e))}}function G(t){let n;if(t.sources)for(;t.sources.length;){const e=t.sources.pop(),r=t.sourceSlots.pop(),o=e.observers;if(o&&o.length){const u=o.pop(),s=e.observerSlots.pop();r<o.length&&(u.sourceSlots[s]=r,o[r]=u,e.observerSlots[r]=s)}}if(t.tOwned){for(n=t.tOwned.length-1;n>=0;n--)G(t.tOwned[n]);delete t.tOwned}if(t.owned){for(n=t.owned.length-1;n>=0;n--)G(t.owned[n]);t.owned=null}if(t.cleanups){for(n=t.cleanups.length-1;n>=0;n--)t.cleanups[n]();t.cleanups=null}t.state=0}function it(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function Jt(t,n,e){try{for(const r of n)r(t)}catch(r){Q(r,e&&e.owner||null)}}function Q(t,n=f){const e=U&&n&&n.context&&n.context[U],r=it(t);if(!e)throw r;S?S.push({fn(){Jt(r,e,n)},state:$}):Jt(r,e,n)}function jt(t){if(typeof t=="function"&&!t.length)return jt(t());if(Array.isArray(t)){const n=[];for(let e=0;e<t.length;e++){const r=jt(t[e]);if(Array.isArray(r))if(r.length<32768)n.push.apply(n,r);else for(let o=0;o<r.length;o++)n.push(r[o]);else n.push(r)}return n}return t}function Mn(t,n){return function(e){let r;return Tt(()=>r=w(()=>(f.context={...f.context,[t]:e.value},It(()=>e.children))),void 0),r}}const kt=Symbol("fallback");function lt(t){for(let n=0;n<t.length;n++)t[n]()}function Dn(t,n,e={}){let r=[],o=[],u=[],s=0,i=n.length>1?[]:null;return ot(()=>lt(u)),()=>{let l=t()||[],a=l.length,d,c;return l[L],w(()=>{let A,x,D,R,z,j,k,y,C;if(a===0)s!==0&&(lt(u),u=[],r=[],o=[],s=0,i&&(i=[])),e.fallback&&(r=[kt],o[0]=H(B=>(u[0]=B,e.fallback())),s=1);else if(s===0){for(o=new Array(a),c=0;c<a;c++)r[c]=l[c],o[c]=H(g);s=a}else{for(D=new Array(a),R=new Array(a),i&&(z=new Array(a)),j=0,k=Math.min(s,a);j<k&&r[j]===l[j];j++);for(k=s-1,y=a-1;k>=j&&y>=j&&r[k]===l[y];k--,y--)D[y]=o[k],R[y]=u[k],i&&(z[y]=i[k]);for(A=new Map,x=new Array(y+1),c=y;c>=j;c--)C=l[c],d=A.get(C),x[c]=d===void 0?-1:d,A.set(C,c);for(d=j;d<=k;d++)C=r[d],c=A.get(C),c!==void 0&&c!==-1?(D[c]=o[d],R[c]=u[d],i&&(z[c]=i[d]),c=x[c],A.set(C,c)):u[d]();for(c=j;c<a;c++)c in D?(o[c]=D[c],u[c]=R[c],i&&(i[c]=z[c],i[c](c))):o[c]=H(g);o=o.slice(0,s=a),r=l.slice(0)}return o});function g(A){if(u[c]=A,i){const[x,D]=_(c);return i[c]=D,n(l[c],x)}return n(l[c])}}}function En(t,n,e={}){let r=[],o=[],u=[],s=[],i=0,l;return ot(()=>lt(u)),()=>{const a=t()||[],d=a.length;return a[L],w(()=>{if(d===0)return i!==0&&(lt(u),u=[],r=[],o=[],i=0,s=[]),e.fallback&&(r=[kt],o[0]=H(g=>(u[0]=g,e.fallback())),i=1),o;for(r[0]===kt&&(u[0](),u=[],r=[],o=[],i=0),l=0;l<d;l++)l<r.length&&r[l]!==a[l]?s[l](()=>a[l]):l>=r.length&&(o[l]=H(c));for(;l<r.length;l++)u[l]();return i=s.length=u.length=d,r=a.slice(0),o=o.slice(0,i)});function c(g){u[l]=g;const[A,x]=_(a[l]);return s[l]=x,n(A,l)}}}function Cn(t,n){return w(()=>t(n||{}))}function ct(){return!0}const Pt={get(t,n,e){return n===P?e:t.get(n)},has(t,n){return n===P?!0:t.has(n)},set:ct,deleteProperty:ct,getOwnPropertyDescriptor(t,n){return{configurable:!0,enumerable:!0,get(){return t.get(n)},set:ct,deleteProperty:ct}},ownKeys(t){return t.keys()}};function xt(t){return(t=typeof t=="function"?t():t)?t:{}}function Fn(){for(let t=0,n=this.length;t<n;++t){const e=this[t]();if(e!==void 0)return e}}function Hn(...t){let n=!1;for(let s=0;s<t.length;s++){const i=t[s];n=n||!!i&&P in i,t[s]=typeof i=="function"?(n=!0,O(i)):i}if(Ct&&n)return new Proxy({get(s){for(let i=t.length-1;i>=0;i--){const l=xt(t[i])[s];if(l!==void 0)return l}},has(s){for(let i=t.length-1;i>=0;i--)if(s in xt(t[i]))return!0;return!1},keys(){const s=[];for(let i=0;i<t.length;i++)s.push(...Object.keys(xt(t[i])));return[...new Set(s)]}},Pt);const e={},r=Object.create(null);for(let s=t.length-1;s>=0;s--){const i=t[s];if(!i)continue;const l=Object.getOwnPropertyNames(i);for(let a=l.length-1;a>=0;a--){const d=l[a];if(d==="__proto__"||d==="constructor")continue;const c=Object.getOwnPropertyDescriptor(i,d);if(!r[d])r[d]=c.get?{enumerable:!0,configurable:!0,get:Fn.bind(e[d]=[c.get.bind(i)])}:c.value!==void 0?c:void 0;else{const g=e[d];g&&(c.get?g.push(c.get.bind(i)):c.value!==void 0&&g.push(()=>c.value))}}}const o={},u=Object.keys(r);for(let s=u.length-1;s>=0;s--){const i=u[s],l=r[i];l&&l.get?Object.defineProperty(o,i,l):o[i]=l?l.value:void 0}return o}function Tn(t,...n){const e=n.length;if(Ct&&P in t){const o=e>1?n.flat():n[0],u=n.map(s=>new Proxy({get(i){return s.includes(i)?t[i]:void 0},has(i){return s.includes(i)&&i in t},keys(){return s.filter(i=>i in t)}},Pt));return u.push(new Proxy({get(s){return o.includes(s)?void 0:t[s]},has(s){return o.includes(s)?!1:s in t},keys(){return Object.keys(t).filter(s=>!o.includes(s))}},Pt)),u}const r=[];for(let o=0;o<=e;o++)r[o]={};for(const o of Object.getOwnPropertyNames(t)){let u=e;for(let i=0;i<n.length;i++)if(n[i].includes(o)){u=i;break}const s=Object.getOwnPropertyDescriptor(t,o);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?r[u][o]=s.value:Object.defineProperty(r[u],o,s)}return r}let Vn=0;function zn(){return`cl-${Vn++}`}const Lt=t=>`Stale read from <${t}>.`;function In(t){const n="fallback"in t&&{fallback:()=>t.fallback};return O(Dn(()=>t.each,t.children,n||void 0))}function Kn(t){const n="fallback"in t&&{fallback:()=>t.fallback};return O(En(()=>t.each,t.children,n||void 0))}function Nn(t){const n=t.keyed,e=O(()=>t.when,void 0,void 0),r=n?e:O(e,void 0,{equals:(o,u)=>!o==!u});return O(()=>{const o=r();if(o){const u=t.children;return typeof u=="function"&&u.length>0?w(()=>u(n?o:()=>{if(!w(r))throw Lt("Show");return e()})):u}return t.fallback},void 0,void 0)}function Rn(t){const n=It(()=>t.children),e=O(()=>{const r=n(),o=Array.isArray(r)?r:[r];let u=()=>{};for(let s=0;s<o.length;s++){const i=s,l=o[s],a=u,d=O(()=>a()?void 0:l.when,void 0,void 0),c=l.keyed?d:O(d,void 0,{equals:(g,A)=>!g==!A});u=()=>a()||(c()?[i,d,l]:void 0)}return u});return O(()=>{const r=e()();if(!r)return t.fallback;const[o,u,s]=r,i=s.children;return typeof i=="function"&&i.length>0?w(()=>i(s.keyed?u():()=>{var l;if(((l=w(e)())==null?void 0:l[0])!==o)throw Lt("Match");return u()})):i},void 0,void 0)}function Bn(t){return t}let at;function Jn(t){let n;const[e,r]=_(n,void 0);return at||(at=new Set),at.add(r),ot(()=>at.delete(r)),O(()=>{let o;if(o=e()){const u=t.fallback;return typeof u=="function"&&u.length?w(()=>u(o,()=>r())):u}return jn(()=>t.children,r)},void 0,void 0)}const ft=Symbol("store-raw"),T=Symbol("store-node"),M=Symbol("store-has"),Ut=Symbol("store-self");function Wt(t){let n=t[P];if(!n&&(Object.defineProperty(t,P,{value:n=new Proxy(t,Wn)}),!Array.isArray(t))){const e=Object.keys(t),r=Object.getOwnPropertyDescriptors(t),o=Object.getPrototypeOf(t),u=o!==null&&t!==null&&typeof t=="object"&&!Array.isArray(t)&&o!==Object.prototype;if(u){const s=Object.getOwnPropertyDescriptors(o);e.push(...Object.keys(s)),Object.assign(r,s)}for(let s=0,i=e.length;s<i;s++){const l=e[s];u&&l==="constructor"||r[l].get&&Object.defineProperty(t,l,{configurable:!0,enumerable:r[l].enumerable,get:r[l].get.bind(n)})}}return n}function K(t){let n;return t!=null&&typeof t=="object"&&(t[P]||!(n=Object.getPrototypeOf(t))||n===Object.prototype||Array.isArray(t))}function V(t,n=new Set){let e,r,o,u;if(e=t!=null&&t[ft])return e;if(!K(t)||n.has(t))return t;if(Array.isArray(t)){Object.isFrozen(t)?t=t.slice(0):n.add(t);for(let s=0,i=t.length;s<i;s++)o=t[s],(r=V(o,n))!==o&&(t[s]=r)}else{Object.isFrozen(t)?t=Object.assign({},t):n.add(t);const s=Object.keys(t),i=Object.getOwnPropertyDescriptors(t);for(let l=0,a=s.length;l<a;l++)u=s[l],!i[u].get&&(o=t[u],(r=V(o,n))!==o&&(t[u]=r))}return t}function dt(t,n){let e=t[n];return e||Object.defineProperty(t,n,{value:e=Object.create(null)}),e}function X(t,n,e){if(t[n])return t[n];const[r,o]=_(e,{equals:!1,internal:!0});return r.$=o,t[n]=r}function Ln(t,n){const e=Reflect.getOwnPropertyDescriptor(t,n);return!e||e.get||!e.configurable||n===P||n===T||(delete e.value,delete e.writable,e.get=()=>t[P][n]),e}function Gt(t){At()&&X(dt(t,T),Ut)()}function Un(t){return Gt(t),Reflect.ownKeys(t)}const Wn={get(t,n,e){if(n===ft)return t;if(n===P)return e;if(n===L)return Gt(t),e;const r=dt(t,T),o=r[n];let u=o?o():t[n];if(n===T||n===M||n==="__proto__")return u;if(!o){const s=Object.getOwnPropertyDescriptor(t,n);At()&&(typeof u!="function"||t.hasOwnProperty(n))&&!(s&&s.get)&&(u=X(r,n,u)())}return K(u)?Wt(u):u},has(t,n){return n===ft||n===P||n===L||n===T||n===M||n==="__proto__"?!0:(At()&&X(dt(t,M),n)(),n in t)},set(){return!0},deleteProperty(){return!0},ownKeys:Un,getOwnPropertyDescriptor:Ln};function N(t,n,e,r=!1){if(n==="__proto__"||!r&&t[n]===e)return;const o=t[n],u=t.length;e===void 0?(delete t[n],t[M]&&t[M][n]&&o!==void 0&&t[M][n].$()):(t[n]=e,t[M]&&t[M][n]&&o===void 0&&t[M][n].$());let s=dt(t,T),i;if((i=X(s,n,o))&&i.$(()=>e),Array.isArray(t)&&t.length!==u){for(let l=t.length;l<u;l++)(i=s[l])&&i.$();(i=X(s,"length",u))&&i.$(t.length)}(i=s[Ut])&&i.$()}function Qt(t,n){const e=Object.keys(n);for(let r=0;r<e.length;r+=1){const o=e[r];Xt(o)||N(t,o,n[o])}}function Xt(t){return t==="__proto__"||t==="constructor"||t==="prototype"}function Gn(t,n){if(typeof n=="function"&&(n=n(t)),n=V(n),Array.isArray(n)){if(t===n)return;let e=0,r=n.length;for(;e<r;e++){const o=n[e];t[e]!==o&&N(t,e,o)}N(t,"length",r)}else Qt(t,n)}function Y(t,n,e=[]){let r,o=t;if(n.length>1){r=n.shift();const s=typeof r,i=Array.isArray(t);if(s==="string"&&(r==="__proto__"||n.length>1&&Xt(r)))return;if(Array.isArray(r)){for(let l=0;l<r.length;l++)Y(t,[r[l]].concat(n),e);return}else if(i&&s==="function"){for(let l=0;l<t.length;l++)r(t[l],l)&&Y(t,[l].concat(n),e);return}else if(i&&s==="object"){const{from:l=0,to:a=t.length-1,by:d=1}=r;for(let c=l;c<=a;c+=d)Y(t,[c].concat(n),e);return}else if(n.length>1){Y(t[r],n,[r].concat(e));return}o=t[r],e=[r].concat(e)}let u=n[0];typeof u=="function"&&(u=u(o,e),u===o)||r===void 0&&u==null||(u=V(u),r===void 0||K(o)&&K(u)&&!Array.isArray(u)?Qt(o,u):N(t,r,u))}function Yt(...[t,n]){const e=V(t||{}),r=Array.isArray(e),o=Wt(e);function u(...s){mn(()=>{r&&s.length===1?Gn(e,s[0]):Y(e,s)})}return[o,u]}const pt=new WeakMap,Zt={get(t,n){if(n===ft)return t;const e=t[n];if(n===P||n===L||n===T||n===M||n==="__proto__")return e;let r;return K(e)?pt.get(e)||(pt.set(e,r=new Proxy(e,Zt)),r):e},set(t,n,e){return N(t,n,V(e)),!0},deleteProperty(t,n){return N(t,n,void 0,!0),!0}};function tn(t){return n=>{if(K(n)){let e;(e=pt.get(n))||pt.set(n,e=new Proxy(n,Zt)),t(e)}return n}}let F={};function nn(t){F.stack&&t.setAttribute("stack",F.stack),F.position&&t.setAttribute("position",F.position),F.max!==void 0&&t.setAttribute("max",String(F.max))}function Qn(t){F={...F,...t},!(typeof document>"u")&&document.querySelectorAll("kai-toast-region").forEach(n=>nn(n))}const Xn=5e3,Yn=7e3,{toasts:St,setToasts:Z,mounted:ae,setMounted:Zn}=H(()=>{const[t,n]=Yt([]),[e,r]=_(!1);return{toasts:t,setToasts:n,mounted:e,setMounted:r}});let en=0;function te(){return en+=1,`toast-${en}`}function ne(t){const n=t.duration??Xn;return n===0?0:t.action?Math.max(n,Yn):n}const rn=new Map;function ee(t=null){if(typeof document>"u")return;const n=rn.get(t);if(n&&n.isConnected)return n;const e=document.createElement("kai-toast-region");return document.body.appendChild(e),e.toasts=St,t&&(e.target=t),nn(e),rn.set(t,e),Zn(!0),e}function re(t){const n=St.findIndex(e=>e.id===t.id);n>=0?Z(n,t):Z(tn(e=>{e.push(t)}))}function on(t){Z(n=>n.filter(e=>e.id!==t))}function oe(t){return{id:t,dismiss:()=>on(t),update:n=>{const e=St.findIndex(r=>r.id===t);e>=0&&Z(e,r=>({...r,...n}))}}}function sn(t,n,e){ee(n?.target??null);const r=n?.id??te(),o={id:r,message:t,variant:n?.variant??e,action:n?.action,duration:n?.duration,dismissible:n?.dismissible,target:n?.target};return re(o),oe(r)}const se=Object.assign((t,n)=>sn(t,n,"neutral"),{success:(t,n)=>sn(t,n,"success"),dismiss:on,clear:()=>Z([])});typeof window<"u"&&typeof customElements<"u"&&import("./register-impl-C6wlSsts.js");export{hn as A,Qn as B,Jn as E,In as F,Kn as I,Bn as M,Nn as S,O as a,Vt as b,Tt as c,_ as d,H as e,Cn as f,kn as g,Pn as h,xn as i,An as j,zn as k,On as l,Hn as m,wn as n,ot as o,pn as p,gn as q,zt as r,Tn as s,Rn as t,w as u,se as v,ne as w,Yt as x,tn as y,V as z};