@kitn.ai/ui 0.16.0 → 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 (194) hide show
  1. package/README.md +28 -13
  2. package/dist/components/chat-thread.d.ts +2 -4
  3. package/dist/components/choice-card.d.ts +1 -0
  4. package/dist/components/dismissed-stub.d.ts +22 -0
  5. package/dist/components/message.d.ts +59 -2
  6. package/dist/components/response-compare-types.d.ts +66 -0
  7. package/dist/components/response-compare.d.ts +51 -0
  8. package/dist/components/tasks-card.d.ts +1 -0
  9. package/dist/components/toast.d.ts +48 -0
  10. package/dist/components/use-card-resolution.d.ts +10 -6
  11. package/dist/custom-elements.json +260 -11
  12. package/dist/elements/artifact.js +1 -0
  13. package/dist/elements/attachments.js +1 -0
  14. package/dist/elements/autoloader.d.ts +2 -0
  15. package/dist/elements/autoloader.js +1 -0
  16. package/dist/elements/card.js +1 -0
  17. package/dist/elements/cards.d.ts +1 -0
  18. package/dist/elements/cards.js +1 -0
  19. package/dist/elements/chain-of-thought.d.ts +0 -12
  20. package/dist/elements/chain-of-thought.js +1 -0
  21. package/dist/elements/chat-scope-picker.js +1 -0
  22. package/dist/elements/chat-workspace.js +1 -0
  23. package/dist/elements/chat.js +1 -0
  24. package/dist/elements/checkpoint.js +1 -0
  25. package/dist/elements/choice.js +1 -0
  26. package/dist/elements/chunks/Icon-D_Zmwmwh.js +1 -0
  27. package/dist/elements/chunks/action-icons-PVfIvcuG.js +1 -0
  28. package/dist/elements/chunks/attachments-Dp6vqtrc.js +1 -0
  29. package/dist/elements/chunks/bash-InADTalH.js +1 -0
  30. package/dist/elements/chunks/button-CKyYD9G4.js +1 -0
  31. package/dist/elements/chunks/card-Cjho-PYk.js +1 -0
  32. package/dist/elements/chunks/card-routing-C986KuUA.js +1 -0
  33. package/dist/elements/chunks/chat-thread-RT808iPf.js +1 -0
  34. package/dist/elements/chunks/check-CDYaMYrM.js +1 -0
  35. package/dist/elements/chunks/chevron-down-3SBiq8HF.js +1 -0
  36. package/dist/elements/chunks/chevron-right-k2UFlIVK.js +1 -0
  37. package/dist/elements/chunks/cn-Dogu6PbV.js +1 -0
  38. package/dist/elements/chunks/code-block-BYUmfFSd.js +1 -0
  39. package/dist/elements/chunks/collapsible-BiNwdOn6.js +1 -0
  40. package/dist/elements/chunks/context-18g6oi4J.js +1 -0
  41. package/dist/elements/chunks/conversation-list-D9Y0NVdo.js +1 -0
  42. package/dist/elements/chunks/core-AYMC6_lb.js +12 -0
  43. package/dist/elements/chunks/css-M7EaDHN_.js +1 -0
  44. package/dist/elements/chunks/default-input-CSAoYYMd.js +1 -0
  45. package/dist/elements/chunks/download-D8K0Je8r.js +1 -0
  46. package/dist/elements/chunks/dropdown-bUs2iTia.js +1 -0
  47. package/dist/elements/chunks/engine-javascript-vq0WuIJl.js +141 -0
  48. package/dist/elements/chunks/external-link-6mA0wxab.js +1 -0
  49. package/dist/elements/chunks/file-text-DnaYk3Dm.js +1 -0
  50. package/dist/elements/chunks/file-tree-CgtRLlxK.js +1 -0
  51. package/dist/elements/chunks/github-dark-dimmed-DUshB20C.js +1 -0
  52. package/dist/elements/chunks/github-light-JYsPkUQd.js +1 -0
  53. package/dist/elements/chunks/hover-card-CIGw62gP.js +1 -0
  54. package/dist/elements/chunks/html-CPZ3oZQ7.js +1 -0
  55. package/dist/elements/chunks/index-CTBEJeo6.js +1 -0
  56. package/dist/elements/chunks/javascript-C25yR2R2.js +1 -0
  57. package/dist/elements/chunks/json-DxJze_jm.js +1 -0
  58. package/dist/elements/chunks/link-BlGSeoPy.js +1 -0
  59. package/dist/elements/chunks/loader-DvhR4qa0.js +1 -0
  60. package/dist/elements/chunks/markdown-CMTGx9r8.js +64 -0
  61. package/dist/elements/chunks/message-CDZwXjhL.js +1 -0
  62. package/dist/elements/chunks/message-feedback-CYx81QiA.js +1 -0
  63. package/dist/elements/chunks/model-switcher-O_tUhoOT.js +1 -0
  64. package/dist/elements/chunks/overlay-DydXYMQW.js +1 -0
  65. package/dist/elements/chunks/prompt-suggestion-ldlWV5kd.js +1 -0
  66. package/dist/elements/chunks/reasoning-2PUnHlmr.js +1 -0
  67. package/dist/elements/chunks/resizable-B5WNbSeb.js +1 -0
  68. package/dist/elements/chunks/star-t9tI-P0q.js +1 -0
  69. package/dist/elements/chunks/store-C6rIooZz.js +1 -0
  70. package/dist/elements/chunks/svelte--5p79yCD.js +1 -0
  71. package/dist/elements/chunks/text-shimmer-uh9V_KUh.js +1 -0
  72. package/dist/elements/chunks/textarea-3nm6Ia9U.js +1 -0
  73. package/dist/elements/chunks/thumbs-up-BBtguGld.js +1 -0
  74. package/dist/elements/chunks/toast-store-D8cL3fWl.js +1 -0
  75. package/dist/elements/chunks/tool-GJ3vwp1U.js +1 -0
  76. package/dist/elements/chunks/tooltip-DwKAz4XR.js +1 -0
  77. package/dist/elements/chunks/triangle-alert-Ct1zt2JL.js +1 -0
  78. package/dist/elements/chunks/tsx-B8rCNbgL.js +1 -0
  79. package/dist/elements/chunks/typescript-RycA9KXf.js +1 -0
  80. package/dist/elements/chunks/use-card-resolution-D-_0Alzy.js +1 -0
  81. package/dist/elements/chunks/video-mVYiM99-.js +1 -0
  82. package/dist/elements/chunks/vue-BmIZj4XD.js +1 -0
  83. package/dist/elements/chunks/x-CzxL27Ch.js +1 -0
  84. package/dist/elements/code-block.js +1 -0
  85. package/dist/elements/compare.js +1 -0
  86. package/dist/elements/confirm-card.js +1 -0
  87. package/dist/elements/context-meter.js +1 -0
  88. package/dist/elements/conversation-list.d.ts +1 -11
  89. package/dist/elements/conversation-list.js +1 -0
  90. package/dist/elements/embed.js +1 -0
  91. package/dist/elements/empty.js +1 -0
  92. package/dist/elements/feedback-bar.js +1 -0
  93. package/dist/elements/file-tree.js +1 -0
  94. package/dist/elements/file-upload.js +1 -0
  95. package/dist/elements/form.js +1 -0
  96. package/dist/elements/image.js +1 -0
  97. package/dist/elements/link-preview.js +1 -0
  98. package/dist/elements/loader.js +1 -0
  99. package/dist/elements/markdown.js +1 -0
  100. package/dist/elements/message-skills.d.ts +0 -16
  101. package/dist/elements/message-skills.js +1 -0
  102. package/dist/elements/message.js +1 -0
  103. package/dist/elements/model-switcher.d.ts +1 -11
  104. package/dist/elements/model-switcher.js +1 -0
  105. package/dist/elements/popover.js +1 -0
  106. package/dist/elements/prompt-input.d.ts +1 -9
  107. package/dist/elements/prompt-input.js +1 -0
  108. package/dist/elements/prompt-suggestions.d.ts +0 -6
  109. package/dist/elements/prompt-suggestions.js +1 -0
  110. package/dist/elements/reasoning.js +1 -0
  111. package/dist/elements/resizable.d.ts +1 -17
  112. package/dist/elements/resizable.js +1 -0
  113. package/dist/elements/response-stream.js +14 -0
  114. package/dist/elements/scroll-button.js +1 -0
  115. package/dist/elements/source.d.ts +0 -17
  116. package/dist/elements/source.js +1 -0
  117. package/dist/elements/switch.js +1 -0
  118. package/dist/elements/tasks.js +1 -0
  119. package/dist/elements/text-shimmer.js +1 -0
  120. package/dist/elements/thinking-bar.js +1 -0
  121. package/dist/elements/toast.d.ts +1 -0
  122. package/dist/elements/toast.js +1 -0
  123. package/dist/elements/tool.js +1 -0
  124. package/dist/elements/voice-input.js +1 -0
  125. package/dist/elements.d.ts +41 -5
  126. package/dist/index.d.ts +12 -0
  127. package/dist/index.js +11832 -9790
  128. package/dist/kitn-chat.es.js +1 -1
  129. package/dist/llms/llms-full.txt +57 -12
  130. package/dist/llms/llms.txt +3 -3
  131. package/dist/mcp.es.js +157 -1
  132. package/dist/primitives/card-contract.d.ts +20 -4
  133. package/dist/primitives/card-recovery.d.ts +55 -0
  134. package/dist/primitives/message-feedback.d.ts +35 -0
  135. package/dist/primitives/toast-store.d.ts +88 -0
  136. package/dist/react/index.d.ts +83 -3
  137. package/dist/react.js +90 -80
  138. package/dist/register-JyTglR6m.js +1 -0
  139. package/dist/register-impl-C6wlSsts.js +77 -0
  140. package/dist/schemas/choice.schema.json +5 -0
  141. package/dist/schemas/tasks.schema.json +5 -0
  142. package/dist/ui/tooltip.d.ts +1 -0
  143. package/frameworks/react/index.tsx +63 -11
  144. package/llms-full.txt +57 -12
  145. package/llms.txt +3 -3
  146. package/package.json +15 -6
  147. package/src/agent-tooling/mcp/tools/debug.ts +184 -0
  148. package/src/agent-tooling/mcp/tools/scaffold.ts +133 -1
  149. package/src/components/chat-thread.tsx +27 -35
  150. package/src/components/choice-card.tsx +33 -4
  151. package/src/components/component-meta.json +250 -26
  152. package/src/components/confirm-card.tsx +15 -1
  153. package/src/components/dismissed-stub.tsx +80 -0
  154. package/src/components/form.tsx +21 -3
  155. package/src/components/message.tsx +151 -10
  156. package/src/components/response-compare-types.ts +127 -0
  157. package/src/components/response-compare.tsx +431 -0
  158. package/src/components/tasks-card.tsx +33 -3
  159. package/src/components/toast.tsx +398 -0
  160. package/src/components/use-card-resolution.ts +24 -8
  161. package/src/elements/autoloader.ts +89 -0
  162. package/src/elements/chat-types.ts +7 -0
  163. package/src/elements/chat-workspace.tsx +4 -2
  164. package/src/elements/chat.tsx +4 -2
  165. package/src/elements/compare.tsx +88 -0
  166. package/src/elements/compiled.css +1 -1
  167. package/src/elements/element-manifest.json +182 -0
  168. package/src/elements/element-meta.json +191 -68
  169. package/src/elements/element-types.d.ts +41 -5
  170. package/src/elements/framework-usage.json +25 -0
  171. package/src/elements/message.tsx +27 -45
  172. package/src/elements/register-impl.ts +3 -0
  173. package/src/elements/register.ts +9 -0
  174. package/src/elements/remote.tsx +4 -0
  175. package/src/elements/styles.css +19 -0
  176. package/src/elements/toast.tsx +74 -0
  177. package/src/index.ts +30 -0
  178. package/src/primitives/card-contract.ts +14 -5
  179. package/src/primitives/card-recovery.ts +149 -0
  180. package/src/primitives/card-routing.ts +3 -0
  181. package/src/primitives/card-schemas/choice.schema.json +5 -0
  182. package/src/primitives/card-schemas/tasks.schema.json +5 -0
  183. package/src/primitives/message-feedback.ts +123 -0
  184. package/src/primitives/toast-store.ts +235 -0
  185. package/src/ui/tooltip.tsx +8 -2
  186. package/dist/elements/chat-types.d.ts +0 -41
  187. package/dist/elements/css.d.ts +0 -1
  188. package/dist/elements/default-input.d.ts +0 -40
  189. package/dist/elements/define.d.ts +0 -42
  190. package/dist/elements/register-impl.d.ts +0 -0
  191. package/dist/elements/register.d.ts +0 -3
  192. package/dist/register-impl-wCsFPoh9.js +0 -77
  193. package/dist/register-ujhr1nBS.js +0 -1
  194. /package/dist/elements/{remote.d.ts → compare.d.ts} +0 -0
@@ -109,6 +109,13 @@ export interface CardsProps extends WebComponentProps {
109
109
  kind: "submit";
110
110
  data: unknown;
111
111
  at?: string;
112
+ } | {
113
+ kind: "dismissed";
114
+ at?: string;
115
+ } | {
116
+ kind: "expired";
117
+ reason?: string;
118
+ at?: string;
112
119
  };
113
120
  }[];
114
121
  /** Optional type→tag overrides/additions (merged over the built-ins). Property: `el.types`. Typed as a plain string map (not the `CardTagMap` alias) so the generated React wrapper inlines it instead of emitting an unresolved named type. */
@@ -124,6 +131,7 @@ export interface CardsProps extends WebComponentProps {
124
131
  onOpen?: (url: string, target: "tab" | "artifact") => void;
125
132
  onState?: (cardId: string, patch: unknown) => void;
126
133
  onDismiss?: (cardId: string) => void;
134
+ onReopen?: (cardId: string) => void;
127
135
  onError?: (cardId: string, message: string) => void;
128
136
  maxSendPromptMode?: "compose" | "send";
129
137
  };
@@ -174,6 +182,7 @@ export interface ChatProps extends WebComponentProps {
174
182
  fallback?: undefined | string;
175
183
  alt?: undefined | string;
176
184
  };
185
+ feedback?: undefined | "like" | "dislike";
177
186
  }[];
178
187
  /** Controlled value of the input. When set, the host owns the input text and must update it on `kai-value-change`; leave unset for uncontrolled behavior. */
179
188
  value?: string;
@@ -236,10 +245,11 @@ export interface ChatProps extends WebComponentProps {
236
245
  slashCompact?: boolean;
237
246
  /** Whether each message's action bar is always visible (`'always'`, default) or only revealed on hover of that message row (`'hover'`). */
238
247
  actionsReveal?: "always" | "hover";
239
- /** An action button on a message was clicked. `action` is the built-in name or custom id. */
248
+ /** An action button on a message was clicked. `action` is the built-in name or custom id. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear. */
240
249
  onMessageAction?: (event: CustomEvent<{
241
250
  messageId: string;
242
251
  action: string;
252
+ state?: undefined | "on" | "off";
243
253
  }>) => void;
244
254
  /** The header model switcher changed. */
245
255
  onModelChange?: (event: CustomEvent<{
@@ -317,6 +327,38 @@ export interface CodeBlockProps extends WebComponentProps {
317
327
  proseSize?: "xs" | "sm" | "base" | "lg";
318
328
  }
319
329
  export declare const CodeBlock: import('react').ForwardRefExoticComponent<CodeBlockProps & import('react').RefAttributes<HTMLElement>>;
330
+ export interface CompareProps extends WebComponentProps {
331
+ /** The compare definition (prompt + the two candidates). Set as a JS PROPERTY: `el.data = { prompt, candidates: [A, B], collapse? }`. Import `ResponseCompareData` from `@kitn.ai/ui` for the full shape. */
332
+ data?: Record<string, unknown>;
333
+ /** Stable id correlating every emitted event. Attribute: `compare-id`. */
334
+ compareId?: string;
335
+ /** Re-hydrate / control the user's pick. Set as a JS PROPERTY: `el.selection = { chosenId, rejectedIds }`. Renders the collapsed winner. */
336
+ selection?: Record<string, unknown>;
337
+ /** Layout: `'auto'` (default — columns when wide, tabs when narrow, by CONTAINER width) | `'columns'` (side-by-side) | `'tabs'` (pills to switch). Attribute: `layout`. */
338
+ layout?: "auto" | "columns" | "tabs";
339
+ /** Prose/text size for the rendered candidates. Attribute: `prose-size`. */
340
+ proseSize?: "xs" | "sm" | "base" | "lg";
341
+ /** Shiki theme for code blocks in the candidates. Attribute: `code-theme`. */
342
+ codeTheme?: string;
343
+ /** Whether code blocks are syntax-highlighted. Attribute: `code-highlight`. */
344
+ codeHighlight?: boolean;
345
+ /** The user committed a pick. `detail` = `{ chosenId, rejectedIds, at }`. */
346
+ onCompareSelect?: (event: CustomEvent<{
347
+ chosenId: string;
348
+ rejectedIds: string[];
349
+ at?: undefined | number;
350
+ }>) => void;
351
+ /** The definition was unusable. */
352
+ onError?: (event: CustomEvent<{
353
+ compareId: string;
354
+ message: string;
355
+ }>) => void;
356
+ /** Both candidates have settled and the pick is live. */
357
+ onReady?: (event: CustomEvent<{
358
+ compareId: string;
359
+ }>) => void;
360
+ }
361
+ export declare const Compare: import('react').ForwardRefExoticComponent<CompareProps & import('react').RefAttributes<HTMLElement>>;
320
362
  export interface ConfirmProps extends WebComponentProps {
321
363
  /** The confirm definition (the CardEnvelope.data). Set as a JS PROPERTY: `el.data = { body, tone, actions:[…] }`. Import `ConfirmCardData` from `@kitn.ai/ui` for the full shape. */
322
364
  data?: Record<string, unknown>;
@@ -575,6 +617,7 @@ export interface MessageProps extends WebComponentProps {
575
617
  fallback?: string;
576
618
  alt?: string;
577
619
  };
620
+ feedback?: "like" | "dislike";
578
621
  };
579
622
  /** Convenience for simple cases when not passing a `message` object. */
580
623
  role?: "user" | "assistant";
@@ -594,10 +637,11 @@ export interface MessageProps extends WebComponentProps {
594
637
  avatarSrc?: string;
595
638
  /** Convenience avatar fallback text (used when `message.avatar` is not set). */
596
639
  avatarFallback?: string;
597
- /** An action button was clicked. `action` is the built-in name or custom id. */
640
+ /** An action button was clicked. `action` is the built-in name or custom id. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear. */
598
641
  onMessageAction?: (event: CustomEvent<{
599
642
  messageId: string;
600
643
  action: string;
644
+ state?: undefined | "on" | "off";
601
645
  }>) => void;
602
646
  }
603
647
  export declare const Message: import('react').ForwardRefExoticComponent<MessageProps & import('react').RefAttributes<HTMLElement>>;
@@ -917,6 +961,40 @@ export interface ThinkingBarProps extends WebComponentProps {
917
961
  onStop?: (event: CustomEvent) => void;
918
962
  }
919
963
  export declare const ThinkingBar: import('react').ForwardRefExoticComponent<ThinkingBarProps & import('react').RefAttributes<HTMLElement>>;
964
+ export interface ToastRegionProps extends WebComponentProps {
965
+ /** The toasts to render. Newest is shown on top. Set as a JS property (array); pass a new array reference to update. */
966
+ toasts: {
967
+ id: string;
968
+ message: string;
969
+ variant?: undefined | "neutral" | "success";
970
+ action?: undefined | {
971
+ label: string;
972
+ onAction: () => void | false;
973
+ };
974
+ duration?: undefined | number;
975
+ dismissible?: undefined | boolean;
976
+ target?: undefined | HTMLElement;
977
+ }[];
978
+ /** Stack anchor: `'top-center'` (default), `'top-right'`, `'bottom-center'`, … */
979
+ position?: "top-center" | "top-right" | "top-left" | "bottom-center" | "bottom-right" | "bottom-left";
980
+ /** Max simultaneously-visible toasts; the rest queue. Defaults to `3`. */
981
+ max?: number;
982
+ /** Stacking: 'expanded' (default, full column) | 'collapsed' (Sonner-style pile that expands on hover/focus). Attribute: stack. */
983
+ stack?: "expanded" | "collapsed";
984
+ /** Container element to anchor this region to (JS property). Set by the store for a scoped region; unset = the global viewport region. */
985
+ target?: HTMLElement;
986
+ /** A toast's action button was pressed. */
987
+ onAction?: (event: CustomEvent<{
988
+ id: string;
989
+ label: string;
990
+ }>) => void;
991
+ /** A toast left the stack. `reason` is `'timeout' | 'close' | 'action'`. */
992
+ onDismiss?: (event: CustomEvent<{
993
+ id: string;
994
+ reason: "action" | "timeout" | "close";
995
+ }>) => void;
996
+ }
997
+ export declare const ToastRegion: import('react').ForwardRefExoticComponent<ToastRegionProps & import('react').RefAttributes<HTMLElement>>;
920
998
  export interface ToolProps extends WebComponentProps {
921
999
  /** The tool-call to display. Set as a JS property. */
922
1000
  tool?: {
@@ -1016,6 +1094,7 @@ export interface WorkspaceProps extends WebComponentProps {
1016
1094
  fallback?: undefined | string;
1017
1095
  alt?: undefined | string;
1018
1096
  };
1097
+ feedback?: undefined | "like" | "dislike";
1019
1098
  }[];
1020
1099
  value?: string;
1021
1100
  placeholder?: string;
@@ -1066,10 +1145,11 @@ export interface WorkspaceProps extends WebComponentProps {
1066
1145
  onConversationSelect?: (event: CustomEvent<{
1067
1146
  id: string;
1068
1147
  }>) => void;
1069
- /** An action button on a message was clicked. */
1148
+ /** An action button on a message was clicked. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear. */
1070
1149
  onMessageAction?: (event: CustomEvent<{
1071
1150
  messageId: string;
1072
1151
  action: string;
1152
+ state?: undefined | "on" | "off";
1073
1153
  }>) => void;
1074
1154
  /** The header model switcher changed. */
1075
1155
  onModelChange?: (event: CustomEvent<{
package/dist/react.js CHANGED
@@ -40,15 +40,15 @@ function e(n, p, l) {
40
40
  });
41
41
  return r.displayName = n, r;
42
42
  }
43
- const M = e(
43
+ const y = e(
44
44
  "kai-artifact",
45
45
  ["theme", "src", "files", "tab", "activeFile", "sandbox", "iframeTitle", "maximized", "expandable", "openInTab", "noNav", "noReload", "noHome", "noPathField", "noTabs", "standalone", "readonlyPath"],
46
46
  { onFileSelect: "kai-file-select", onMaximizeChange: "kai-maximize-change", onNavigate: "kai-navigate", onTabChange: "kai-tab-change" }
47
- ), w = e(
47
+ ), M = e(
48
48
  "kai-attachments",
49
49
  ["theme", "items", "variant", "hoverCard", "removable", "showMediaType", "emptyText"],
50
50
  { onRemove: "kai-remove" }
51
- ), y = e(
51
+ ), w = e(
52
52
  "kai-card",
53
53
  ["theme", "heading", "description", "errorMessage", "dense"],
54
54
  {}
@@ -56,7 +56,7 @@ const M = e(
56
56
  "kai-cards",
57
57
  ["theme", "cards", "types", "policy"],
58
58
  {}
59
- ), F = e(
59
+ ), R = e(
60
60
  "kai-chain-of-thought",
61
61
  ["theme", "steps"],
62
62
  {}
@@ -64,7 +64,7 @@ const M = e(
64
64
  "kai-chat",
65
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
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
- ), R = e(
67
+ ), F = e(
68
68
  "kai-checkpoint",
69
69
  ["theme", "label", "tooltip", "variant", "size"],
70
70
  { onSelect: "kai-select" }
@@ -72,194 +72,204 @@ const M = e(
72
72
  "kai-choice",
73
73
  ["theme", "data", "cardId", "heading", "resolution"],
74
74
  {}
75
- ), L = e(
75
+ ), H = e(
76
76
  "kai-code-block",
77
77
  ["theme", "code", "language", "codeTheme", "codeHighlight", "proseSize"],
78
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" }
79
83
  ), P = e(
80
84
  "kai-confirm",
81
85
  ["theme", "data", "cardId", "heading", "autofocus", "resolution"],
82
86
  {}
83
- ), H = e(
87
+ ), N = e(
84
88
  "kai-context",
85
89
  ["theme", "context", "warnThreshold", "dangerThreshold"],
86
90
  { onThresholdChange: "kai-threshold-change" }
87
- ), N = e(
91
+ ), V = e(
88
92
  "kai-conversations",
89
93
  ["theme", "groups", "conversations", "activeId"],
90
94
  { onConversationSelect: "kai-conversation-select", onNewChat: "kai-new-chat", onToggleSidebar: "kai-toggle-sidebar" }
91
- ), V = e(
95
+ ), B = e(
92
96
  "kai-embed",
93
97
  ["theme", "cardId", "data"],
94
98
  {}
95
- ), B = e(
99
+ ), O = e(
96
100
  "kai-empty",
97
101
  ["theme", "emptyTitle", "description"],
98
102
  {}
99
- ), O = e(
103
+ ), W = e(
100
104
  "kai-feedback-bar",
101
105
  ["theme", "barTitle", "collectDetail", "categories", "detailTitle", "detailPlaceholder", "submitLabel", "thanksMessage"],
102
106
  { onClose: "kai-close", onFeedback: "kai-feedback", onFeedbackDetail: "kai-feedback-detail" }
103
- ), W = e(
107
+ ), D = e(
104
108
  "kai-file-tree",
105
109
  ["theme", "files", "activeFile", "defaultExpanded"],
106
110
  { onSelect: "kai-select" }
107
- ), D = e(
111
+ ), j = e(
108
112
  "kai-file-upload",
109
113
  ["theme", "multiple", "accept", "disabled", "label"],
110
114
  { onFilesAdded: "kai-files-added" }
111
- ), j = e(
115
+ ), U = e(
112
116
  "kai-form",
113
117
  ["theme", "data", "cardId", "heading", "resolution"],
114
118
  {}
115
- ), U = e(
119
+ ), q = e(
116
120
  "kai-image",
117
121
  ["theme", "base64", "bytes", "alt", "mediaType"],
118
122
  {}
119
- ), q = e(
123
+ ), G = e(
120
124
  "kai-link-preview",
121
125
  ["theme", "cardId", "data"],
122
126
  {}
123
- ), G = e(
127
+ ), J = e(
124
128
  "kai-loader",
125
129
  ["theme", "variant", "size", "text"],
126
130
  {}
127
- ), J = e(
131
+ ), K = e(
128
132
  "kai-markdown",
129
133
  ["theme", "content", "proseSize", "codeTheme", "codeHighlight"],
130
134
  {}
131
- ), K = e(
135
+ ), Q = e(
132
136
  "kai-message",
133
137
  ["theme", "message", "role", "content", "markdown", "proseSize", "codeTheme", "codeHighlight", "actionsReveal", "avatarSrc", "avatarFallback"],
134
138
  { onMessageAction: "kai-message-action" }
135
- ), Q = e(
139
+ ), X = e(
136
140
  "kai-model-switcher",
137
141
  ["theme", "models", "currentModel"],
138
142
  { onModelChange: "kai-model-change" }
139
- ), X = e(
143
+ ), Y = e(
140
144
  "kai-popover",
141
145
  ["theme", "placement", "gutter", "open"],
142
146
  { onOpenChange: "kai-open-change" }
143
- ), Y = e(
147
+ ), Z = e(
144
148
  "kai-prompt-input",
145
149
  ["theme", "value", "placeholder", "disabled", "loading", "suggestions", "suggestionMode", "slashCommands", "slashActiveIds", "slashCompact", "search", "voice", "stoppable", "attachments"],
146
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" }
147
- ), Z = e(
151
+ ), _ = e(
148
152
  "kai-reasoning",
149
153
  ["theme", "text", "label", "open", "streaming", "markdown"],
150
154
  { onOpenChange: "kai-open-change" }
151
- ), _ = e(
155
+ ), $ = e(
152
156
  "kai-remote",
153
157
  ["theme", "src", "providerOrigin", "envelope", "policy"],
154
158
  {}
155
- ), $ = e(
159
+ ), ee = e(
156
160
  "kai-resizable",
157
161
  ["theme", "orientation", "maximizedIndex"],
158
162
  { onChange: "kai-change", onMaximizeChange: "kai-maximize-change" }
159
- ), ee = e(
163
+ ), ae = e(
160
164
  "kai-resizable-item",
161
165
  ["theme", "size", "min", "max", "locked", "hidden"],
162
166
  { onChange: "kai-change", onMaximizeChange: "kai-maximize-change" }
163
- ), ae = e(
167
+ ), oe = e(
164
168
  "kai-response-stream",
165
169
  ["theme", "text", "mode", "speed", "as"],
166
170
  { onComplete: "kai-complete" }
167
- ), oe = e(
171
+ ), te = e(
168
172
  "kai-scope-picker",
169
173
  ["theme", "availableAuthors", "availableTags", "currentLabel"],
170
174
  { onScopeChange: "kai-scope-change" }
171
- ), te = e(
175
+ ), ie = e(
172
176
  "kai-scroll-button",
173
177
  ["theme", "for", "variant", "size"],
174
178
  { onScroll: "kai-scroll" }
175
- ), ie = e(
179
+ ), ne = e(
176
180
  "kai-skills",
177
181
  ["theme", "skills"],
178
182
  {}
179
- ), ne = e(
183
+ ), se = e(
180
184
  "kai-source",
181
185
  ["theme", "href", "label", "headline", "description", "showFavicon"],
182
186
  {}
183
- ), se = e(
187
+ ), ce = e(
184
188
  "kai-sources",
185
189
  ["theme", "sources", "showFavicon", "numbered"],
186
190
  {}
187
- ), ce = e(
191
+ ), le = e(
188
192
  "kai-suggestions",
189
193
  ["theme", "suggestions", "variant", "size", "block", "highlight"],
190
194
  { onSelect: "kai-select" }
191
- ), le = e(
195
+ ), re = e(
192
196
  "kai-switch",
193
197
  ["theme", "checked", "disabled", "label"],
194
198
  { onChange: "kai-change" }
195
- ), re = e(
199
+ ), he = e(
196
200
  "kai-tasks",
197
201
  ["theme", "data", "cardId", "heading", "resolution"],
198
202
  {}
199
- ), he = e(
203
+ ), de = e(
200
204
  "kai-text-shimmer",
201
205
  ["theme", "text", "as", "duration", "spread"],
202
206
  {}
203
- ), de = e(
207
+ ), me = e(
204
208
  "kai-thinking-bar",
205
209
  ["theme", "text", "stoppable", "stopLabel"],
206
210
  { onStop: "kai-stop" }
207
- ), me = e(
211
+ ), ke = e(
212
+ "kai-toast-region",
213
+ ["theme", "toasts", "position", "max", "stack", "target"],
214
+ { onAction: "kai-action", onDismiss: "kai-dismiss" }
215
+ ), ge = e(
208
216
  "kai-tool",
209
217
  ["theme", "tool", "open"],
210
218
  {}
211
- ), ke = e(
219
+ ), pe = e(
212
220
  "kai-voice-input",
213
221
  ["theme", "transcribe", "disabled"],
214
222
  { onAudioCaptured: "kai-audio-captured", onTranscription: "kai-transcription" }
215
- ), ge = e(
223
+ ), ue = e(
216
224
  "kai-workspace",
217
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"],
218
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" }
219
227
  );
220
228
  export {
221
- M as Artifact,
222
- w as Attachments,
223
- y as Card,
229
+ y as Artifact,
230
+ M as Attachments,
231
+ w as Card,
224
232
  I as Cards,
225
- F as ChainOfThought,
233
+ R as ChainOfThought,
226
234
  E as Chat,
227
- R as Checkpoint,
235
+ F as Checkpoint,
228
236
  A as Choice,
229
- L as CodeBlock,
237
+ H as CodeBlock,
238
+ L as Compare,
230
239
  P as Confirm,
231
- H as Context,
232
- N as Conversations,
233
- V as Embed,
234
- B as Empty,
235
- O as FeedbackBar,
236
- W as FileTree,
237
- D as FileUpload,
238
- j as Form,
239
- U as Image,
240
- q as LinkPreview,
241
- G as Loader,
242
- J as Markdown,
243
- K as Message,
244
- Q as ModelSwitcher,
245
- X as Popover,
246
- Y as PromptInput,
247
- Z as Reasoning,
248
- _ as Remote,
249
- $ as Resizable,
250
- ee as ResizableItem,
251
- ae as ResponseStream,
252
- oe as ScopePicker,
253
- te as ScrollButton,
254
- ie as Skills,
255
- ne as Source,
256
- se as Sources,
257
- ce as Suggestions,
258
- le as Switch,
259
- re as Tasks,
260
- he as TextShimmer,
261
- de as ThinkingBar,
262
- me as Tool,
263
- ke as VoiceInput,
264
- ge as Workspace
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
265
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};