@k2b/ui 0.60.0 → 0.61.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.
- package/dist/browser/chat/ChatPrimitives.js +435 -420
- package/dist/browser/chat/ChatPrimitives.js.map +1 -1
- package/dist/browser/chat/ChatTasks.js +78 -73
- package/dist/browser/chat/ChatTasks.js.map +1 -1
- package/dist/browser/chat/ChatTimeline.js +3 -0
- package/dist/browser/chat/ChatTimeline.js.map +1 -1
- package/dist/browser/content/Lightbox.js +31 -11
- package/dist/browser/content/Lightbox.js.map +1 -1
- package/dist/browser/content/PdfPages.js +26 -1
- package/dist/browser/content/PdfPages.js.map +1 -1
- package/dist/browser/content/RunLog.js +719 -0
- package/dist/browser/content/RunLog.js.map +1 -0
- package/dist/browser/content/index.js +1 -0
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/run-log-messages.js +134 -0
- package/dist/browser/content/run-log-messages.js.map +1 -0
- package/dist/browser/feedback/toast.js +11 -1
- package/dist/browser/feedback/toast.js.map +1 -1
- package/dist/browser/internal/step-row.js +78 -0
- package/dist/browser/internal/step-row.js.map +1 -0
- package/dist/browser/layout/PullToRefresh.js +76 -23
- package/dist/browser/layout/PullToRefresh.js.map +1 -1
- package/dist/browser/layout/refresh-messages.js +4 -2
- package/dist/browser/layout/refresh-messages.js.map +1 -1
- package/dist/ssr/chat/ChatPrimitives.js +109 -71
- package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
- package/dist/ssr/chat/ChatTasks.js +31 -16
- package/dist/ssr/chat/ChatTasks.js.map +1 -1
- package/dist/ssr/chat/ChatTimeline.js +3 -0
- package/dist/ssr/chat/ChatTimeline.js.map +1 -1
- package/dist/ssr/content/Lightbox.js +31 -11
- package/dist/ssr/content/Lightbox.js.map +1 -1
- package/dist/ssr/content/PdfPages.js +26 -1
- package/dist/ssr/content/PdfPages.js.map +1 -1
- package/dist/ssr/content/RunLog.js +471 -0
- package/dist/ssr/content/RunLog.js.map +1 -0
- package/dist/ssr/content/index.js +1 -0
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/run-log-messages.js +134 -0
- package/dist/ssr/content/run-log-messages.js.map +1 -0
- package/dist/ssr/feedback/toast.js +11 -1
- package/dist/ssr/feedback/toast.js.map +1 -1
- package/dist/ssr/internal/step-row.js +35 -0
- package/dist/ssr/internal/step-row.js.map +1 -0
- package/dist/ssr/layout/PullToRefresh.js +67 -16
- package/dist/ssr/layout/PullToRefresh.js.map +1 -1
- package/dist/ssr/layout/refresh-messages.js +4 -2
- package/dist/ssr/layout/refresh-messages.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/chat/ChatPrimitives.d.ts +6 -0
- package/dist/types/chat/ChatTimeline.d.ts +2 -0
- package/dist/types/content/Lightbox.d.ts +7 -5
- package/dist/types/content/RunLog.d.ts +53 -0
- package/dist/types/content/index.d.ts +1 -0
- package/dist/types/content/run-log-messages.d.ts +61 -0
- package/dist/types/feedback/toast.d.ts +9 -1
- package/dist/types/internal/step-row.d.ts +19 -0
- package/dist/types/layout/PullToRefresh.d.ts +2 -2
- package/dist/types/layout/refresh-messages.d.ts +1 -0
- package/package.json +9 -7
|
@@ -5,12 +5,12 @@ import { style as _$style } from "solid-js/web";
|
|
|
5
5
|
import { mergeProps as _$mergeProps } from "solid-js/web";
|
|
6
6
|
import { runHydrationEvents as _$runHydrationEvents } from "solid-js/web";
|
|
7
7
|
import { className as _$className } from "solid-js/web";
|
|
8
|
+
import { getNextMarker as _$getNextMarker } from "solid-js/web";
|
|
9
|
+
import { memo as _$memo } from "solid-js/web";
|
|
8
10
|
import { setAttribute as _$setAttribute } from "solid-js/web";
|
|
9
11
|
import { effect as _$effect } from "solid-js/web";
|
|
10
|
-
import { createComponent as _$createComponent } from "solid-js/web";
|
|
11
|
-
import { getNextMarker as _$getNextMarker } from "solid-js/web";
|
|
12
12
|
import { insert as _$insert } from "solid-js/web";
|
|
13
|
-
import {
|
|
13
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
14
14
|
import { getNextElement as _$getNextElement } from "solid-js/web";
|
|
15
15
|
var _tmpl$ = /*#__PURE__*/_$template(`<span class=k2b-chat-progress-dots aria-hidden=true><span></span><span></span><span>`),
|
|
16
16
|
_tmpl$2 = /*#__PURE__*/_$template(`<div class=k2b-chat-message__attachments role=list>`),
|
|
@@ -19,37 +19,37 @@ var _tmpl$ = /*#__PURE__*/_$template(`<span class=k2b-chat-progress-dots aria-hi
|
|
|
19
19
|
_tmpl$5 = /*#__PURE__*/_$template(`<i class="ti ti-dots"aria-hidden=true>`),
|
|
20
20
|
_tmpl$6 = /*#__PURE__*/_$template(`<span class=k2b-chat-message__actions role=group><!$><!/><!$><!/>`),
|
|
21
21
|
_tmpl$7 = /*#__PURE__*/_$template(`<footer class=k2b-chat-message__meta><!$><!/><!$><!/><!$><!/><!$><!/>`),
|
|
22
|
-
_tmpl$8 = /*#__PURE__*/_$template(`<article
|
|
23
|
-
_tmpl$9 = /*#__PURE__*/_$template(`<
|
|
24
|
-
_tmpl$0 = /*#__PURE__*/_$template(`<
|
|
25
|
-
_tmpl$1 = /*#__PURE__*/_$template(`<
|
|
26
|
-
_tmpl$10 = /*#__PURE__*/_$template(`<
|
|
27
|
-
_tmpl$11 = /*#__PURE__*/_$template(`<
|
|
28
|
-
_tmpl$12 = /*#__PURE__*/_$template(`<
|
|
29
|
-
_tmpl$13 = /*#__PURE__*/_$template(`<
|
|
30
|
-
_tmpl$14 = /*#__PURE__*/_$template(`<span class=k2b-chat-
|
|
31
|
-
_tmpl$15 = /*#__PURE__*/_$template(`<
|
|
32
|
-
_tmpl$16 = /*#__PURE__*/_$template(`<i
|
|
33
|
-
_tmpl$17 = /*#__PURE__*/_$template(`<
|
|
22
|
+
_tmpl$8 = /*#__PURE__*/_$template(`<article><!$><!/><!$><!/><!$><!/><!$><!/>`),
|
|
23
|
+
_tmpl$9 = /*#__PURE__*/_$template(`<span class=k2b-sr-only><!$><!/>: `),
|
|
24
|
+
_tmpl$0 = /*#__PURE__*/_$template(`<div class=k2b-chat-message__source>`),
|
|
25
|
+
_tmpl$1 = /*#__PURE__*/_$template(`<img>`),
|
|
26
|
+
_tmpl$10 = /*#__PURE__*/_$template(`<span class=k2b-chat-message__attachment-text><strong></strong><!$><!/>`),
|
|
27
|
+
_tmpl$11 = /*#__PURE__*/_$template(`<i aria-hidden=true>`),
|
|
28
|
+
_tmpl$12 = /*#__PURE__*/_$template(`<div class=k2b-chat-message__attachment role=listitem>`),
|
|
29
|
+
_tmpl$13 = /*#__PURE__*/_$template(`<a class=k2b-chat-message__attachment role=listitem target=_blank rel="noopener noreferrer">`),
|
|
30
|
+
_tmpl$14 = /*#__PURE__*/_$template(`<span class=k2b-chat-message__status><i aria-hidden=true></i><!$><!/>`),
|
|
31
|
+
_tmpl$15 = /*#__PURE__*/_$template(`<time>`),
|
|
32
|
+
_tmpl$16 = /*#__PURE__*/_$template(`<i>`),
|
|
33
|
+
_tmpl$17 = /*#__PURE__*/_$template(`<strong>`),
|
|
34
34
|
_tmpl$18 = /*#__PURE__*/_$template(`<small>`),
|
|
35
|
-
_tmpl$19 = /*#__PURE__*/_$template(`<span class=
|
|
36
|
-
_tmpl$20 = /*#__PURE__*/_$template(`<
|
|
37
|
-
_tmpl$21 = /*#__PURE__*/_$template(`<span class=k2b-chat-
|
|
38
|
-
_tmpl$22 = /*#__PURE__*/_$template(`<
|
|
39
|
-
_tmpl$23 = /*#__PURE__*/_$template(`<
|
|
40
|
-
_tmpl$24 = /*#__PURE__*/_$template(`<div><div class=k2b-chat-activity__row>`),
|
|
41
|
-
_tmpl$25 = /*#__PURE__*/_$template(`<
|
|
42
|
-
_tmpl$26 = /*#__PURE__*/_$template(`<span class=k2b-chat-
|
|
43
|
-
_tmpl$27 = /*#__PURE__*/_$template(`<
|
|
44
|
-
_tmpl$28 = /*#__PURE__*/_$template(`<
|
|
45
|
-
_tmpl$29 = /*#__PURE__*/_$template(`<div><dt></dt><dd
|
|
46
|
-
_tmpl$30 = /*#__PURE__*/_$template(`<
|
|
47
|
-
_tmpl$31 = /*#__PURE__*/_$template(`<
|
|
48
|
-
_tmpl$32 = /*#__PURE__*/_$template(`<
|
|
49
|
-
_tmpl$33 = /*#__PURE__*/_$template(`<section class=k2b-chat-usage__part><header class=k2b-chat-usage__head><h4></h4><!$><!/></header><!$><!/>`);
|
|
35
|
+
_tmpl$19 = /*#__PURE__*/_$template(`<span class=k2b-chat-activity__trailing>`),
|
|
36
|
+
_tmpl$20 = /*#__PURE__*/_$template(`<i class="ti ti-chevron-right k2b-chat-activity__chevron"aria-hidden=true>`),
|
|
37
|
+
_tmpl$21 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-activity__toggle><span class=k2b-chat-activity__toggle-label></span><i class="ti ti-chevron-right k2b-chat-activity__chevron"aria-hidden=true>`),
|
|
38
|
+
_tmpl$22 = /*#__PURE__*/_$template(`<details><summary class=k2b-chat-activity__row></summary><div class=k2b-chat-activity__body>`),
|
|
39
|
+
_tmpl$23 = /*#__PURE__*/_$template(`<div><div class=k2b-chat-activity__row>`),
|
|
40
|
+
_tmpl$24 = /*#__PURE__*/_$template(`<div><div class=k2b-chat-activity__row></div><div class=k2b-chat-activity__body>`),
|
|
41
|
+
_tmpl$25 = /*#__PURE__*/_$template(`<span class=k2b-chat-usage__number>`),
|
|
42
|
+
_tmpl$26 = /*#__PURE__*/_$template(`<span class=k2b-chat-usage>`),
|
|
43
|
+
_tmpl$27 = /*#__PURE__*/_$template(`<p>`),
|
|
44
|
+
_tmpl$28 = /*#__PURE__*/_$template(`<div><dt></dt><dd>`),
|
|
45
|
+
_tmpl$29 = /*#__PURE__*/_$template(`<section class=k2b-chat-usage__part><header class=k2b-chat-usage__head><h4></h4><span class=k2b-chat-usage__value></span><!$><!/></header><!$><!/><!$><!/><dl><!$><!/><div><dt></dt><dd></dd></div><div><dt></dt><dd></dd></div><!$><!/><!$><!/><div><dt></dt><dd></dd></div><!$><!/>`),
|
|
46
|
+
_tmpl$30 = /*#__PURE__*/_$template(`<div class="k2b-chat-context__tooltip k2b-chat-usage__panel"><!$><!/><!$><!/>`),
|
|
47
|
+
_tmpl$31 = /*#__PURE__*/_$template(`<span class=k2b-chat-usage__value>`),
|
|
48
|
+
_tmpl$32 = /*#__PURE__*/_$template(`<section class=k2b-chat-usage__part><header class=k2b-chat-usage__head><h4></h4><!$><!/></header><!$><!/>`);
|
|
50
49
|
import { children, createContext, createRenderEffect, createSignal, createUniqueId, For, onCleanup, Show, useContext } from "solid-js";
|
|
51
50
|
import { Dropdown } from "../actions/Dropdown";
|
|
52
51
|
import { Tooltip } from "../feedback/Tooltip";
|
|
52
|
+
import { StepRowContent } from "../internal/step-row";
|
|
53
53
|
import { Format } from "../intl/Format";
|
|
54
54
|
import { useLocale } from "../intl/locale";
|
|
55
55
|
import { useUiMessages } from "../intl/messages";
|
|
@@ -152,24 +152,41 @@ export function ChatMessage(props) {
|
|
|
152
152
|
}));
|
|
153
153
|
return (() => {
|
|
154
154
|
var _el$2 = _$getNextElement(_tmpl$8),
|
|
155
|
-
_el$
|
|
156
|
-
_el$
|
|
157
|
-
|
|
158
|
-
_el$
|
|
159
|
-
_el$25 = _el$
|
|
160
|
-
[_el$26, _co$
|
|
155
|
+
_el$21 = _el$2.firstChild,
|
|
156
|
+
[_el$22, _co$7] = _$getNextMarker(_el$21.nextSibling),
|
|
157
|
+
_el$23 = _el$22.nextSibling,
|
|
158
|
+
[_el$24, _co$8] = _$getNextMarker(_el$23.nextSibling),
|
|
159
|
+
_el$25 = _el$24.nextSibling,
|
|
160
|
+
[_el$26, _co$9] = _$getNextMarker(_el$25.nextSibling),
|
|
161
161
|
_el$27 = _el$26.nextSibling,
|
|
162
|
-
[_el$28, _co$
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
162
|
+
[_el$28, _co$0] = _$getNextMarker(_el$27.nextSibling);
|
|
163
|
+
_$insert(_el$2, _$createComponent(Show, {
|
|
164
|
+
get when() {
|
|
165
|
+
return props.source;
|
|
166
|
+
},
|
|
167
|
+
get fallback() {
|
|
168
|
+
return (() => {
|
|
169
|
+
var _el$29 = _$getNextElement(_tmpl$9),
|
|
170
|
+
_el$31 = _el$29.firstChild,
|
|
171
|
+
[_el$32, _co$1] = _$getNextMarker(_el$31.nextSibling),
|
|
172
|
+
_el$30 = _el$32.nextSibling;
|
|
173
|
+
_$insert(_el$29, () => props.label ?? roleLabel(props.role, chatMessages()), _el$32, _co$1);
|
|
174
|
+
return _el$29;
|
|
175
|
+
})();
|
|
176
|
+
},
|
|
177
|
+
children: source => (() => {
|
|
178
|
+
var _el$33 = _$getNextElement(_tmpl$0);
|
|
179
|
+
_$insert(_el$33, source);
|
|
180
|
+
return _el$33;
|
|
181
|
+
})()
|
|
182
|
+
}), _el$22, _co$7);
|
|
166
183
|
_$insert(_el$2, _$createComponent(Show, {
|
|
167
184
|
get when() {
|
|
168
185
|
return (props.attachments?.length ?? 0) > 0;
|
|
169
186
|
},
|
|
170
187
|
get children() {
|
|
171
|
-
var _el$
|
|
172
|
-
_$insert(_el$
|
|
188
|
+
var _el$3 = _$getNextElement(_tmpl$2);
|
|
189
|
+
_$insert(_el$3, _$createComponent(For, {
|
|
173
190
|
get each() {
|
|
174
191
|
return props.attachments;
|
|
175
192
|
},
|
|
@@ -182,37 +199,37 @@ export function ChatMessage(props) {
|
|
|
182
199
|
},
|
|
183
200
|
get fallback() {
|
|
184
201
|
return (() => {
|
|
185
|
-
var _el$
|
|
186
|
-
_$effect(() => _$className(_el$
|
|
187
|
-
return _el$
|
|
202
|
+
var _el$39 = _$getNextElement(_tmpl$11);
|
|
203
|
+
_$effect(() => _$className(_el$39, attachmentIcon(attachment)));
|
|
204
|
+
return _el$39;
|
|
188
205
|
})();
|
|
189
206
|
},
|
|
190
207
|
get children() {
|
|
191
|
-
var _el$
|
|
192
|
-
_el$
|
|
208
|
+
var _el$34 = _$getNextElement(_tmpl$1);
|
|
209
|
+
_el$34.addEventListener("error", () => setFailedPreviewUrl(attachment.previewUrl));
|
|
193
210
|
_$effect(_p$ => {
|
|
194
|
-
var _v$
|
|
195
|
-
_v$
|
|
196
|
-
_v$
|
|
197
|
-
_v$
|
|
211
|
+
var _v$7 = attachment.previewUrl,
|
|
212
|
+
_v$8 = attachment.alt ?? attachment.name;
|
|
213
|
+
_v$7 !== _p$.e && _$setAttribute(_el$34, "src", _p$.e = _v$7);
|
|
214
|
+
_v$8 !== _p$.t && _$setAttribute(_el$34, "alt", _p$.t = _v$8);
|
|
198
215
|
return _p$;
|
|
199
216
|
}, {
|
|
200
217
|
e: undefined,
|
|
201
218
|
t: undefined
|
|
202
219
|
});
|
|
203
|
-
return _el$
|
|
220
|
+
return _el$34;
|
|
204
221
|
}
|
|
205
222
|
}), _$createComponent(Show, {
|
|
206
223
|
get when() {
|
|
207
224
|
return attachment.kind !== "image";
|
|
208
225
|
},
|
|
209
226
|
get children() {
|
|
210
|
-
var _el$
|
|
211
|
-
_el$
|
|
212
|
-
_el$
|
|
213
|
-
[_el$
|
|
214
|
-
_$insert(_el$
|
|
215
|
-
_$insert(_el$
|
|
227
|
+
var _el$35 = _$getNextElement(_tmpl$10),
|
|
228
|
+
_el$36 = _el$35.firstChild,
|
|
229
|
+
_el$37 = _el$36.nextSibling,
|
|
230
|
+
[_el$38, _co$10] = _$getNextMarker(_el$37.nextSibling);
|
|
231
|
+
_$insert(_el$36, () => attachment.name);
|
|
232
|
+
_$insert(_el$35, _$createComponent(Show, {
|
|
216
233
|
get when() {
|
|
217
234
|
return _$memo(() => typeof attachment.size === "number")() && attachment.size > 0;
|
|
218
235
|
},
|
|
@@ -223,8 +240,8 @@ export function ChatMessage(props) {
|
|
|
223
240
|
}
|
|
224
241
|
});
|
|
225
242
|
}
|
|
226
|
-
}), _el$
|
|
227
|
-
return _el$
|
|
243
|
+
}), _el$38, _co$10);
|
|
244
|
+
return _el$35;
|
|
228
245
|
}
|
|
229
246
|
})];
|
|
230
247
|
return _$createComponent(Show, {
|
|
@@ -233,35 +250,35 @@ export function ChatMessage(props) {
|
|
|
233
250
|
},
|
|
234
251
|
get fallback() {
|
|
235
252
|
return (() => {
|
|
236
|
-
var _el$
|
|
237
|
-
_$insert(_el$
|
|
253
|
+
var _el$40 = _$getNextElement(_tmpl$12);
|
|
254
|
+
_$insert(_el$40, content);
|
|
238
255
|
_$effect(_p$ => {
|
|
239
|
-
var _v$
|
|
240
|
-
_v$
|
|
241
|
-
_v$
|
|
242
|
-
_v$
|
|
256
|
+
var _v$9 = attachment.kind,
|
|
257
|
+
_v$0 = attachment.name;
|
|
258
|
+
_v$9 !== _p$.e && _$setAttribute(_el$40, "data-kind", _p$.e = _v$9);
|
|
259
|
+
_v$0 !== _p$.t && _$setAttribute(_el$40, "title", _p$.t = _v$0);
|
|
243
260
|
return _p$;
|
|
244
261
|
}, {
|
|
245
262
|
e: undefined,
|
|
246
263
|
t: undefined
|
|
247
264
|
});
|
|
248
|
-
return _el$
|
|
265
|
+
return _el$40;
|
|
249
266
|
})();
|
|
250
267
|
},
|
|
251
268
|
children: href => (() => {
|
|
252
|
-
var _el$
|
|
253
|
-
_$insert(_el$
|
|
269
|
+
var _el$41 = _$getNextElement(_tmpl$13);
|
|
270
|
+
_$insert(_el$41, content);
|
|
254
271
|
_$effect(_p$ => {
|
|
255
|
-
var _v$
|
|
256
|
-
_v$
|
|
257
|
-
_v$
|
|
258
|
-
_v$
|
|
272
|
+
var _v$1 = attachment.kind,
|
|
273
|
+
_v$10 = attachment.name,
|
|
274
|
+
_v$11 = href(),
|
|
275
|
+
_v$12 = chatMessages().openInNewTab({
|
|
259
276
|
name: attachment.name
|
|
260
277
|
});
|
|
261
|
-
_v$
|
|
262
|
-
_v$
|
|
263
|
-
_v$
|
|
264
|
-
_v$
|
|
278
|
+
_v$1 !== _p$.e && _$setAttribute(_el$41, "data-kind", _p$.e = _v$1);
|
|
279
|
+
_v$10 !== _p$.t && _$setAttribute(_el$41, "title", _p$.t = _v$10);
|
|
280
|
+
_v$11 !== _p$.a && _$setAttribute(_el$41, "href", _p$.a = _v$11);
|
|
281
|
+
_v$12 !== _p$.o && _$setAttribute(_el$41, "aria-label", _p$.o = _v$12);
|
|
265
282
|
return _p$;
|
|
266
283
|
}, {
|
|
267
284
|
e: undefined,
|
|
@@ -269,41 +286,41 @@ export function ChatMessage(props) {
|
|
|
269
286
|
a: undefined,
|
|
270
287
|
o: undefined
|
|
271
288
|
});
|
|
272
|
-
return _el$
|
|
289
|
+
return _el$41;
|
|
273
290
|
})()
|
|
274
291
|
});
|
|
275
292
|
}
|
|
276
293
|
}));
|
|
277
|
-
_$effect(() => _$setAttribute(_el$
|
|
278
|
-
return _el$
|
|
294
|
+
_$effect(() => _$setAttribute(_el$3, "aria-label", chatMessages().attachments));
|
|
295
|
+
return _el$3;
|
|
279
296
|
}
|
|
280
|
-
}), _el$
|
|
297
|
+
}), _el$24, _co$8);
|
|
281
298
|
_$insert(_el$2, _$createComponent(Show, {
|
|
282
299
|
get when() {
|
|
283
300
|
return _$memo(() => !!(props.children !== undefined && props.children !== null))() && props.children !== "";
|
|
284
301
|
},
|
|
285
302
|
get children() {
|
|
286
|
-
var _el$
|
|
287
|
-
_el$
|
|
288
|
-
_$insert(_el$
|
|
289
|
-
return _el$
|
|
303
|
+
var _el$4 = _$getNextElement(_tmpl$3),
|
|
304
|
+
_el$5 = _el$4.firstChild;
|
|
305
|
+
_$insert(_el$5, () => props.children);
|
|
306
|
+
return _el$4;
|
|
290
307
|
}
|
|
291
|
-
}), _el$
|
|
308
|
+
}), _el$26, _co$9);
|
|
292
309
|
_$insert(_el$2, _$createComponent(Show, {
|
|
293
310
|
get when() {
|
|
294
311
|
return hasMeta();
|
|
295
312
|
},
|
|
296
313
|
get children() {
|
|
297
|
-
var _el$
|
|
298
|
-
_el$
|
|
299
|
-
[_el$
|
|
314
|
+
var _el$6 = _$getNextElement(_tmpl$7),
|
|
315
|
+
_el$13 = _el$6.firstChild,
|
|
316
|
+
[_el$14, _co$3] = _$getNextMarker(_el$13.nextSibling),
|
|
317
|
+
_el$15 = _el$14.nextSibling,
|
|
318
|
+
[_el$16, _co$4] = _$getNextMarker(_el$15.nextSibling),
|
|
319
|
+
_el$17 = _el$16.nextSibling,
|
|
320
|
+
[_el$18, _co$5] = _$getNextMarker(_el$17.nextSibling),
|
|
300
321
|
_el$19 = _el$18.nextSibling,
|
|
301
|
-
[_el$20, _co$
|
|
302
|
-
|
|
303
|
-
[_el$22, _co$6] = _$getNextMarker(_el$21.nextSibling),
|
|
304
|
-
_el$23 = _el$22.nextSibling,
|
|
305
|
-
[_el$24, _co$7] = _$getNextMarker(_el$23.nextSibling);
|
|
306
|
-
_$insert(_el$0, _$createComponent(Show, {
|
|
322
|
+
[_el$20, _co$6] = _$getNextMarker(_el$19.nextSibling);
|
|
323
|
+
_$insert(_el$6, _$createComponent(Show, {
|
|
307
324
|
get when() {
|
|
308
325
|
return props.status === "streaming";
|
|
309
326
|
},
|
|
@@ -313,54 +330,54 @@ export function ChatMessage(props) {
|
|
|
313
330
|
return status();
|
|
314
331
|
},
|
|
315
332
|
children: label => (() => {
|
|
316
|
-
var _el$
|
|
317
|
-
_el$
|
|
318
|
-
_el$
|
|
319
|
-
[_el$
|
|
320
|
-
_$insert(_el$
|
|
333
|
+
var _el$42 = _$getNextElement(_tmpl$14),
|
|
334
|
+
_el$43 = _el$42.firstChild,
|
|
335
|
+
_el$44 = _el$43.nextSibling,
|
|
336
|
+
[_el$45, _co$11] = _$getNextMarker(_el$44.nextSibling);
|
|
337
|
+
_$insert(_el$42, label, _el$45, _co$11);
|
|
321
338
|
_$effect(_p$ => {
|
|
322
|
-
var _v$
|
|
323
|
-
_v$
|
|
324
|
-
_v$
|
|
325
|
-
_v$
|
|
339
|
+
var _v$13 = props.status === "error" ? "alert" : "status",
|
|
340
|
+
_v$14 = statusIcon(props.status);
|
|
341
|
+
_v$13 !== _p$.e && _$setAttribute(_el$42, "role", _p$.e = _v$13);
|
|
342
|
+
_v$14 !== _p$.t && _$className(_el$43, _p$.t = _v$14);
|
|
326
343
|
return _p$;
|
|
327
344
|
}, {
|
|
328
345
|
e: undefined,
|
|
329
346
|
t: undefined
|
|
330
347
|
});
|
|
331
|
-
return _el$
|
|
348
|
+
return _el$42;
|
|
332
349
|
})()
|
|
333
350
|
});
|
|
334
351
|
},
|
|
335
352
|
get children() {
|
|
336
|
-
var _el$
|
|
337
|
-
_$insert(_el$
|
|
338
|
-
_$effect(() => _$setAttribute(_el$
|
|
339
|
-
return _el$
|
|
353
|
+
var _el$7 = _$getNextElement(_tmpl$4);
|
|
354
|
+
_$insert(_el$7, _$createComponent(ChatProgressDots, {}));
|
|
355
|
+
_$effect(() => _$setAttribute(_el$7, "aria-label", chatMessages().generating));
|
|
356
|
+
return _el$7;
|
|
340
357
|
}
|
|
341
|
-
}), _el$
|
|
342
|
-
_$insert(_el$
|
|
358
|
+
}), _el$14, _co$3);
|
|
359
|
+
_$insert(_el$6, _$createComponent(Show, {
|
|
343
360
|
get when() {
|
|
344
361
|
return time();
|
|
345
362
|
},
|
|
346
363
|
children: label => (() => {
|
|
347
|
-
var _el$
|
|
348
|
-
_$insert(_el$
|
|
349
|
-
_$effect(() => _$setAttribute(_el$
|
|
350
|
-
return _el$
|
|
364
|
+
var _el$46 = _$getNextElement(_tmpl$15);
|
|
365
|
+
_$insert(_el$46, label);
|
|
366
|
+
_$effect(() => _$setAttribute(_el$46, "datetime", timestamp() ?? undefined));
|
|
367
|
+
return _el$46;
|
|
351
368
|
})()
|
|
352
|
-
}), _el$
|
|
353
|
-
_$insert(_el$
|
|
369
|
+
}), _el$16, _co$4);
|
|
370
|
+
_$insert(_el$6, _$createComponent(Show, {
|
|
354
371
|
get when() {
|
|
355
372
|
return _$memo(() => actions().length > 0)() && actionDisplay() === "inline";
|
|
356
373
|
},
|
|
357
374
|
get children() {
|
|
358
|
-
var _el$
|
|
359
|
-
_el$
|
|
360
|
-
[_el$
|
|
361
|
-
_el$
|
|
362
|
-
[_el$
|
|
363
|
-
_$insert(_el$
|
|
375
|
+
var _el$8 = _$getNextElement(_tmpl$6),
|
|
376
|
+
_el$0 = _el$8.firstChild,
|
|
377
|
+
[_el$1, _co$] = _$getNextMarker(_el$0.nextSibling),
|
|
378
|
+
_el$10 = _el$1.nextSibling,
|
|
379
|
+
[_el$11, _co$2] = _$getNextMarker(_el$10.nextSibling);
|
|
380
|
+
_$insert(_el$8, _$createComponent(For, {
|
|
364
381
|
get each() {
|
|
365
382
|
return inlineActions();
|
|
366
383
|
},
|
|
@@ -386,13 +403,13 @@ export function ChatMessage(props) {
|
|
|
386
403
|
},
|
|
387
404
|
onClick: () => void runAction(action),
|
|
388
405
|
get children() {
|
|
389
|
-
var _el$
|
|
390
|
-
_$effect(() => _$className(_el$
|
|
391
|
-
return _el$
|
|
406
|
+
var _el$47 = _$getNextElement(_tmpl$11);
|
|
407
|
+
_$effect(() => _$className(_el$47, actionIcon(action)));
|
|
408
|
+
return _el$47;
|
|
392
409
|
}
|
|
393
410
|
})
|
|
394
|
-
}), _el$
|
|
395
|
-
_$insert(_el$
|
|
411
|
+
}), _el$1, _co$);
|
|
412
|
+
_$insert(_el$8, _$createComponent(Show, {
|
|
396
413
|
get when() {
|
|
397
414
|
return overflowActions().length > 0;
|
|
398
415
|
},
|
|
@@ -422,12 +439,12 @@ export function ChatMessage(props) {
|
|
|
422
439
|
}
|
|
423
440
|
});
|
|
424
441
|
}
|
|
425
|
-
}), _el$
|
|
426
|
-
_$effect(() => _$setAttribute(_el$
|
|
427
|
-
return _el$
|
|
442
|
+
}), _el$11, _co$2);
|
|
443
|
+
_$effect(() => _$setAttribute(_el$8, "aria-label", chatMessages().messageActions));
|
|
444
|
+
return _el$8;
|
|
428
445
|
}
|
|
429
|
-
}), _el$
|
|
430
|
-
_$insert(_el$
|
|
446
|
+
}), _el$18, _co$5);
|
|
447
|
+
_$insert(_el$6, _$createComponent(Show, {
|
|
431
448
|
get when() {
|
|
432
449
|
return _$memo(() => actions().length > 0)() && actionDisplay() === "menu";
|
|
433
450
|
},
|
|
@@ -457,28 +474,31 @@ export function ChatMessage(props) {
|
|
|
457
474
|
}
|
|
458
475
|
});
|
|
459
476
|
}
|
|
460
|
-
}), _el$
|
|
461
|
-
return _el$
|
|
477
|
+
}), _el$20, _co$6);
|
|
478
|
+
return _el$6;
|
|
462
479
|
}
|
|
463
|
-
}), _el$
|
|
480
|
+
}), _el$28, _co$0);
|
|
464
481
|
_$effect(_p$ => {
|
|
465
482
|
var _v$ = `k2b-chat-message ${props.class ?? ""}`,
|
|
466
483
|
_v$2 = props.role,
|
|
467
484
|
_v$3 = props.status ?? "complete",
|
|
468
485
|
_v$4 = props.anchorId !== undefined ? String(props.anchorId) : undefined,
|
|
469
|
-
_v$5 = props.
|
|
486
|
+
_v$5 = props.source ? "" : undefined,
|
|
487
|
+
_v$6 = props.status === "pending" || props.status === "streaming" ? "true" : undefined;
|
|
470
488
|
_v$ !== _p$.e && _$className(_el$2, _p$.e = _v$);
|
|
471
489
|
_v$2 !== _p$.t && _$setAttribute(_el$2, "data-role", _p$.t = _v$2);
|
|
472
490
|
_v$3 !== _p$.a && _$setAttribute(_el$2, "data-status", _p$.a = _v$3);
|
|
473
491
|
_v$4 !== _p$.o && _$setAttribute(_el$2, "data-chat-anchor", _p$.o = _v$4);
|
|
474
|
-
_v$5 !== _p$.i && _$setAttribute(_el$2, "
|
|
492
|
+
_v$5 !== _p$.i && _$setAttribute(_el$2, "data-source", _p$.i = _v$5);
|
|
493
|
+
_v$6 !== _p$.n && _$setAttribute(_el$2, "aria-busy", _p$.n = _v$6);
|
|
475
494
|
return _p$;
|
|
476
495
|
}, {
|
|
477
496
|
e: undefined,
|
|
478
497
|
t: undefined,
|
|
479
498
|
a: undefined,
|
|
480
499
|
o: undefined,
|
|
481
|
-
i: undefined
|
|
500
|
+
i: undefined,
|
|
501
|
+
n: undefined
|
|
482
502
|
});
|
|
483
503
|
return _el$2;
|
|
484
504
|
})();
|
|
@@ -488,82 +508,77 @@ export function ChatMessage(props) {
|
|
|
488
508
|
* One row on the shared grid: icon, text, meta, duration, and the chevron or ⓘ. Every cell has its own column, so a
|
|
489
509
|
* missing one shifts nothing, and the right columns end on the same edge in every row.
|
|
490
510
|
*/
|
|
491
|
-
const ActivityContent = props =>
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
return
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
})(), _el$57, _co$13);
|
|
542
|
-
_$effect(() => _$setAttribute(_el$53, "data-tone", props.metaTone));
|
|
543
|
-
return _el$53;
|
|
544
|
-
})()), _$memo(() => _$memo(() => !!props.duration)() && // A running row's clock ticks silently; the row says once what it does.
|
|
545
|
-
(() => {
|
|
546
|
-
var _el$59 = _$getNextElement(_tmpl$21);
|
|
547
|
-
_$insert(_el$59, () => props.duration);
|
|
548
|
-
_$effect(_p$ => {
|
|
549
|
-
var _v$14 = props.durationTitle,
|
|
550
|
-
_v$15 = props.busy ? "true" : undefined;
|
|
551
|
-
_v$14 !== _p$.e && _$setAttribute(_el$59, "title", _p$.e = _v$14);
|
|
552
|
-
_v$15 !== _p$.t && _$setAttribute(_el$59, "aria-hidden", _p$.t = _v$15);
|
|
553
|
-
return _p$;
|
|
554
|
-
}, {
|
|
555
|
-
e: undefined,
|
|
556
|
-
t: undefined
|
|
557
|
-
});
|
|
558
|
-
return _el$59;
|
|
559
|
-
})()), _$createComponent(Show, {
|
|
560
|
-
get when() {
|
|
561
|
-
return props.disclosure;
|
|
511
|
+
const ActivityContent = props => _$createComponent(StepRowContent, {
|
|
512
|
+
classes: {
|
|
513
|
+
leading: "k2b-chat-activity__leading",
|
|
514
|
+
label: "k2b-chat-activity__copy k2b-truncate-fade",
|
|
515
|
+
meta: "k2b-chat-activity__meta k2b-truncate-fade",
|
|
516
|
+
duration: "k2b-chat-activity__duration"
|
|
517
|
+
},
|
|
518
|
+
get leading() {
|
|
519
|
+
return _$createComponent(Show, {
|
|
520
|
+
get when() {
|
|
521
|
+
return props.leading;
|
|
522
|
+
},
|
|
523
|
+
get fallback() {
|
|
524
|
+
return (() => {
|
|
525
|
+
var _el$48 = _$getNextElement(_tmpl$16);
|
|
526
|
+
_$effect(() => _$className(_el$48, props.icon ?? "ti ti-sparkles"));
|
|
527
|
+
return _el$48;
|
|
528
|
+
})();
|
|
529
|
+
},
|
|
530
|
+
get children() {
|
|
531
|
+
return props.leading;
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
},
|
|
535
|
+
get label() {
|
|
536
|
+
return [(() => {
|
|
537
|
+
var _el$49 = _$getNextElement(_tmpl$17);
|
|
538
|
+
_$insert(_el$49, () => props.label);
|
|
539
|
+
_$effect(() => _$setAttribute(_el$49, "title", typeof props.label === "string" ? props.label : undefined));
|
|
540
|
+
return _el$49;
|
|
541
|
+
})(), _$createComponent(Show, {
|
|
542
|
+
get when() {
|
|
543
|
+
return props.description;
|
|
544
|
+
},
|
|
545
|
+
children: description => (() => {
|
|
546
|
+
var _el$50 = _$getNextElement(_tmpl$18);
|
|
547
|
+
_$insert(_el$50, description);
|
|
548
|
+
return _el$50;
|
|
549
|
+
})()
|
|
550
|
+
})];
|
|
551
|
+
},
|
|
552
|
+
get meta() {
|
|
553
|
+
return _$memo(() => !!(props.meta || props.trailing))() && [_$memo(() => props.meta), _$memo(() => _$memo(() => !!props.trailing)() && (() => {
|
|
554
|
+
var _el$51 = _$getNextElement(_tmpl$19);
|
|
555
|
+
_$insert(_el$51, () => props.trailing);
|
|
556
|
+
return _el$51;
|
|
557
|
+
})())];
|
|
558
|
+
},
|
|
559
|
+
get metaTone() {
|
|
560
|
+
return props.metaTone;
|
|
562
561
|
},
|
|
563
|
-
get
|
|
564
|
-
return
|
|
562
|
+
get duration() {
|
|
563
|
+
return props.duration;
|
|
564
|
+
},
|
|
565
|
+
get durationTitle() {
|
|
566
|
+
return props.durationTitle;
|
|
567
|
+
},
|
|
568
|
+
get silentDuration() {
|
|
569
|
+
return props.busy;
|
|
570
|
+
},
|
|
571
|
+
get end() {
|
|
572
|
+
return [_$createComponent(Show, {
|
|
573
|
+
get when() {
|
|
574
|
+
return props.disclosure;
|
|
575
|
+
},
|
|
576
|
+
get children() {
|
|
577
|
+
return _$getNextElement(_tmpl$20);
|
|
578
|
+
}
|
|
579
|
+
}), _$memo(() => _$memo(() => !!!props.expandable)() && props.end)];
|
|
565
580
|
}
|
|
566
|
-
})
|
|
581
|
+
});
|
|
567
582
|
const ActivityDisclosureContext = createContext();
|
|
568
583
|
/**
|
|
569
584
|
* The words of an activity label that open its body, with the chevron right after them. With a toggle in its label,
|
|
@@ -581,22 +596,22 @@ export function ChatActivityToggle(props) {
|
|
|
581
596
|
return props.children;
|
|
582
597
|
},
|
|
583
598
|
children: current => (() => {
|
|
584
|
-
var _el$
|
|
585
|
-
_el$
|
|
586
|
-
_el$
|
|
587
|
-
_$insert(_el$
|
|
599
|
+
var _el$53 = _$getNextElement(_tmpl$21),
|
|
600
|
+
_el$54 = _el$53.firstChild;
|
|
601
|
+
_el$53.$$click = () => current().toggle();
|
|
602
|
+
_$insert(_el$54, () => props.children);
|
|
588
603
|
_$effect(_p$ => {
|
|
589
|
-
var _v$
|
|
590
|
-
_v$
|
|
591
|
-
_v$
|
|
592
|
-
_v$
|
|
604
|
+
var _v$15 = current().open() ? "true" : "false",
|
|
605
|
+
_v$16 = current().bodyId;
|
|
606
|
+
_v$15 !== _p$.e && _$setAttribute(_el$53, "aria-expanded", _p$.e = _v$15);
|
|
607
|
+
_v$16 !== _p$.t && _$setAttribute(_el$53, "aria-controls", _p$.t = _v$16);
|
|
593
608
|
return _p$;
|
|
594
609
|
}, {
|
|
595
610
|
e: undefined,
|
|
596
611
|
t: undefined
|
|
597
612
|
});
|
|
598
613
|
_$runHydrationEvents();
|
|
599
|
-
return _el$
|
|
614
|
+
return _el$53;
|
|
600
615
|
})()
|
|
601
616
|
});
|
|
602
617
|
}
|
|
@@ -650,30 +665,30 @@ export function ChatActivity(props) {
|
|
|
650
665
|
},
|
|
651
666
|
get fallback() {
|
|
652
667
|
return (() => {
|
|
653
|
-
var _el$
|
|
654
|
-
_el$
|
|
655
|
-
_$insert(_el$
|
|
668
|
+
var _el$58 = _$getNextElement(_tmpl$23),
|
|
669
|
+
_el$59 = _el$58.firstChild;
|
|
670
|
+
_$insert(_el$59, _$createComponent(ActivityContent, _$mergeProps(props, {
|
|
656
671
|
get label() {
|
|
657
672
|
return label();
|
|
658
673
|
}
|
|
659
674
|
})));
|
|
660
675
|
_$effect(_p$ => {
|
|
661
|
-
var _v$
|
|
662
|
-
_v$
|
|
663
|
-
_v$
|
|
664
|
-
_v$
|
|
665
|
-
_v$
|
|
666
|
-
_v$
|
|
667
|
-
_v$
|
|
668
|
-
_v$
|
|
669
|
-
_v$
|
|
670
|
-
_v$
|
|
671
|
-
_v$
|
|
672
|
-
_v$
|
|
673
|
-
_v$
|
|
674
|
-
_v$
|
|
675
|
-
_p$.s = _$style(_el$
|
|
676
|
-
_v$
|
|
676
|
+
var _v$28 = `k2b-chat-activity ${props.class ?? ""}`,
|
|
677
|
+
_v$29 = tone(),
|
|
678
|
+
_v$30 = props.accent ? "true" : undefined,
|
|
679
|
+
_v$31 = props.busy ? "true" : undefined,
|
|
680
|
+
_v$32 = props.wrap ? "true" : undefined,
|
|
681
|
+
_v$33 = props.anchorId !== undefined ? String(props.anchorId) : undefined,
|
|
682
|
+
_v$34 = style(),
|
|
683
|
+
_v$35 = props.busy ? "true" : undefined;
|
|
684
|
+
_v$28 !== _p$.e && _$className(_el$58, _p$.e = _v$28);
|
|
685
|
+
_v$29 !== _p$.t && _$setAttribute(_el$58, "data-tone", _p$.t = _v$29);
|
|
686
|
+
_v$30 !== _p$.a && _$setAttribute(_el$58, "data-accent", _p$.a = _v$30);
|
|
687
|
+
_v$31 !== _p$.o && _$setAttribute(_el$58, "data-busy", _p$.o = _v$31);
|
|
688
|
+
_v$32 !== _p$.i && _$setAttribute(_el$58, "data-wrap", _p$.i = _v$32);
|
|
689
|
+
_v$33 !== _p$.n && _$setAttribute(_el$58, "data-chat-anchor", _p$.n = _v$33);
|
|
690
|
+
_p$.s = _$style(_el$58, _v$34, _p$.s);
|
|
691
|
+
_v$35 !== _p$.h && _$setAttribute(_el$58, "aria-busy", _p$.h = _v$35);
|
|
677
692
|
return _p$;
|
|
678
693
|
}, {
|
|
679
694
|
e: undefined,
|
|
@@ -685,7 +700,7 @@ export function ChatActivity(props) {
|
|
|
685
700
|
s: undefined,
|
|
686
701
|
h: undefined
|
|
687
702
|
});
|
|
688
|
-
return _el$
|
|
703
|
+
return _el$58;
|
|
689
704
|
})();
|
|
690
705
|
},
|
|
691
706
|
get children() {
|
|
@@ -695,40 +710,40 @@ export function ChatActivity(props) {
|
|
|
695
710
|
},
|
|
696
711
|
get fallback() {
|
|
697
712
|
return (() => {
|
|
698
|
-
var _el$
|
|
699
|
-
_el$
|
|
700
|
-
_el$
|
|
701
|
-
_$insert(_el$
|
|
713
|
+
var _el$60 = _$getNextElement(_tmpl$24),
|
|
714
|
+
_el$61 = _el$60.firstChild,
|
|
715
|
+
_el$62 = _el$61.nextSibling;
|
|
716
|
+
_$insert(_el$61, _$createComponent(ActivityContent, _$mergeProps(props, {
|
|
702
717
|
get label() {
|
|
703
718
|
return label();
|
|
704
719
|
},
|
|
705
720
|
expandable: true
|
|
706
721
|
})));
|
|
707
|
-
_$setAttribute(_el$
|
|
708
|
-
_$insert(_el$
|
|
722
|
+
_$setAttribute(_el$62, "id", bodyId);
|
|
723
|
+
_$insert(_el$62, body);
|
|
709
724
|
_$effect(_p$ => {
|
|
710
|
-
var _v$
|
|
711
|
-
_v$
|
|
712
|
-
_v$
|
|
713
|
-
_v$
|
|
714
|
-
_v$
|
|
715
|
-
_v$
|
|
716
|
-
_v$
|
|
717
|
-
_v$
|
|
718
|
-
_v$
|
|
719
|
-
_v$
|
|
720
|
-
_v$
|
|
721
|
-
_v$
|
|
722
|
-
_v$
|
|
723
|
-
_v$
|
|
724
|
-
_v$
|
|
725
|
-
_v$
|
|
726
|
-
_v$
|
|
727
|
-
_v$
|
|
728
|
-
_v$
|
|
729
|
-
_p$.r = _$style(_el$
|
|
730
|
-
_v$
|
|
731
|
-
_v$
|
|
725
|
+
var _v$36 = `k2b-chat-activity ${props.class ?? ""}`,
|
|
726
|
+
_v$37 = tone(),
|
|
727
|
+
_v$38 = props.accent ? "true" : undefined,
|
|
728
|
+
_v$39 = props.busy ? "true" : undefined,
|
|
729
|
+
_v$40 = props.wrap ? "true" : undefined,
|
|
730
|
+
_v$41 = props.bodyInset === false ? "false" : undefined,
|
|
731
|
+
_v$42 = open() ? "true" : "false",
|
|
732
|
+
_v$43 = props.anchorId !== undefined ? String(props.anchorId) : undefined,
|
|
733
|
+
_v$44 = style(),
|
|
734
|
+
_v$45 = props.busy ? "true" : undefined,
|
|
735
|
+
_v$46 = !open();
|
|
736
|
+
_v$36 !== _p$.e && _$className(_el$60, _p$.e = _v$36);
|
|
737
|
+
_v$37 !== _p$.t && _$setAttribute(_el$60, "data-tone", _p$.t = _v$37);
|
|
738
|
+
_v$38 !== _p$.a && _$setAttribute(_el$60, "data-accent", _p$.a = _v$38);
|
|
739
|
+
_v$39 !== _p$.o && _$setAttribute(_el$60, "data-busy", _p$.o = _v$39);
|
|
740
|
+
_v$40 !== _p$.i && _$setAttribute(_el$60, "data-wrap", _p$.i = _v$40);
|
|
741
|
+
_v$41 !== _p$.n && _$setAttribute(_el$60, "data-body-inset", _p$.n = _v$41);
|
|
742
|
+
_v$42 !== _p$.s && _$setAttribute(_el$60, "data-open", _p$.s = _v$42);
|
|
743
|
+
_v$43 !== _p$.h && _$setAttribute(_el$60, "data-chat-anchor", _p$.h = _v$43);
|
|
744
|
+
_p$.r = _$style(_el$60, _v$44, _p$.r);
|
|
745
|
+
_v$45 !== _p$.d && _$setAttribute(_el$60, "aria-busy", _p$.d = _v$45);
|
|
746
|
+
_v$46 !== _p$.l && _$setProperty(_el$62, "hidden", _p$.l = _v$46);
|
|
732
747
|
return _p$;
|
|
733
748
|
}, {
|
|
734
749
|
e: undefined,
|
|
@@ -743,48 +758,48 @@ export function ChatActivity(props) {
|
|
|
743
758
|
d: undefined,
|
|
744
759
|
l: undefined
|
|
745
760
|
});
|
|
746
|
-
return _el$
|
|
761
|
+
return _el$60;
|
|
747
762
|
})();
|
|
748
763
|
},
|
|
749
764
|
get children() {
|
|
750
|
-
var _el$
|
|
751
|
-
_el$
|
|
752
|
-
_el$
|
|
753
|
-
_el$
|
|
765
|
+
var _el$55 = _$getNextElement(_tmpl$22),
|
|
766
|
+
_el$56 = _el$55.firstChild,
|
|
767
|
+
_el$57 = _el$56.nextSibling;
|
|
768
|
+
_el$55.addEventListener("toggle", event => {
|
|
754
769
|
setExpanded(event.currentTarget.open);
|
|
755
770
|
props.onOpenChange?.(event.currentTarget.open);
|
|
756
771
|
});
|
|
757
|
-
_$insert(_el$
|
|
772
|
+
_$insert(_el$56, _$createComponent(ActivityContent, _$mergeProps(props, {
|
|
758
773
|
get label() {
|
|
759
774
|
return label();
|
|
760
775
|
},
|
|
761
776
|
disclosure: true,
|
|
762
777
|
expandable: true
|
|
763
778
|
})));
|
|
764
|
-
_$insert(_el$
|
|
779
|
+
_$insert(_el$57, body);
|
|
765
780
|
_$effect(_p$ => {
|
|
766
|
-
var _v$
|
|
767
|
-
_v$
|
|
768
|
-
_v$
|
|
769
|
-
_v$
|
|
770
|
-
_v$
|
|
771
|
-
_v$
|
|
772
|
-
_v$
|
|
773
|
-
_v$
|
|
774
|
-
_v$
|
|
775
|
-
_v$
|
|
776
|
-
_v$
|
|
777
|
-
_v$
|
|
778
|
-
_v$
|
|
779
|
-
_v$
|
|
780
|
-
_v$
|
|
781
|
-
_v$
|
|
782
|
-
_v$
|
|
783
|
-
_v$
|
|
784
|
-
_p$.h = _$style(_el$
|
|
785
|
-
_v$
|
|
786
|
-
_v$
|
|
787
|
-
_v$
|
|
781
|
+
var _v$17 = `k2b-chat-activity ${props.class ?? ""}`,
|
|
782
|
+
_v$18 = tone(),
|
|
783
|
+
_v$19 = props.accent ? "true" : undefined,
|
|
784
|
+
_v$20 = props.busy ? "true" : undefined,
|
|
785
|
+
_v$21 = props.wrap ? "true" : undefined,
|
|
786
|
+
_v$22 = props.bodyInset === false ? "false" : undefined,
|
|
787
|
+
_v$23 = props.anchorId !== undefined ? String(props.anchorId) : undefined,
|
|
788
|
+
_v$24 = style(),
|
|
789
|
+
_v$25 = open(),
|
|
790
|
+
_v$26 = props.busy ? "true" : undefined,
|
|
791
|
+
_v$27 = props.ariaLabel;
|
|
792
|
+
_v$17 !== _p$.e && _$className(_el$55, _p$.e = _v$17);
|
|
793
|
+
_v$18 !== _p$.t && _$setAttribute(_el$55, "data-tone", _p$.t = _v$18);
|
|
794
|
+
_v$19 !== _p$.a && _$setAttribute(_el$55, "data-accent", _p$.a = _v$19);
|
|
795
|
+
_v$20 !== _p$.o && _$setAttribute(_el$55, "data-busy", _p$.o = _v$20);
|
|
796
|
+
_v$21 !== _p$.i && _$setAttribute(_el$55, "data-wrap", _p$.i = _v$21);
|
|
797
|
+
_v$22 !== _p$.n && _$setAttribute(_el$55, "data-body-inset", _p$.n = _v$22);
|
|
798
|
+
_v$23 !== _p$.s && _$setAttribute(_el$55, "data-chat-anchor", _p$.s = _v$23);
|
|
799
|
+
_p$.h = _$style(_el$55, _v$24, _p$.h);
|
|
800
|
+
_v$25 !== _p$.r && _$setProperty(_el$55, "open", _p$.r = _v$25);
|
|
801
|
+
_v$26 !== _p$.d && _$setAttribute(_el$55, "aria-busy", _p$.d = _v$26);
|
|
802
|
+
_v$27 !== _p$.l && _$setAttribute(_el$56, "aria-label", _p$.l = _v$27);
|
|
788
803
|
return _p$;
|
|
789
804
|
}, {
|
|
790
805
|
e: undefined,
|
|
@@ -799,7 +814,7 @@ export function ChatActivity(props) {
|
|
|
799
814
|
d: undefined,
|
|
800
815
|
l: undefined
|
|
801
816
|
});
|
|
802
|
-
return _el$
|
|
817
|
+
return _el$55;
|
|
803
818
|
}
|
|
804
819
|
});
|
|
805
820
|
}
|
|
@@ -874,58 +889,58 @@ export function ChatContextUsage(props) {
|
|
|
874
889
|
});
|
|
875
890
|
const actionTooltip = action => action.disabled && action.disabledReason ? action.disabledReason : action.label;
|
|
876
891
|
return (() => {
|
|
877
|
-
var _el$
|
|
878
|
-
_$insert(_el$
|
|
892
|
+
var _el$63 = _$getNextElement(_tmpl$26);
|
|
893
|
+
_$insert(_el$63, _$createComponent(ChatContextPopup, {
|
|
879
894
|
get content() {
|
|
880
895
|
return (() => {
|
|
881
|
-
var _el$
|
|
882
|
-
_el$
|
|
883
|
-
[_el$
|
|
884
|
-
_el$
|
|
885
|
-
[_el$
|
|
886
|
-
_$insert(_el$
|
|
896
|
+
var _el$65 = _$getNextElement(_tmpl$30),
|
|
897
|
+
_el$104 = _el$65.firstChild,
|
|
898
|
+
[_el$105, _co$19] = _$getNextMarker(_el$104.nextSibling),
|
|
899
|
+
_el$106 = _el$105.nextSibling,
|
|
900
|
+
[_el$107, _co$20] = _$getNextMarker(_el$106.nextSibling);
|
|
901
|
+
_$insert(_el$65, _$createComponent(Show, {
|
|
887
902
|
get when() {
|
|
888
903
|
return showContext();
|
|
889
904
|
},
|
|
890
905
|
get children() {
|
|
891
|
-
var _el$
|
|
892
|
-
_el$
|
|
906
|
+
var _el$66 = _$getNextElement(_tmpl$29),
|
|
907
|
+
_el$67 = _el$66.firstChild,
|
|
908
|
+
_el$68 = _el$67.firstChild,
|
|
909
|
+
_el$69 = _el$68.nextSibling,
|
|
910
|
+
_el$70 = _el$69.nextSibling,
|
|
911
|
+
[_el$71, _co$12] = _$getNextMarker(_el$70.nextSibling),
|
|
912
|
+
_el$100 = _el$67.nextSibling,
|
|
913
|
+
[_el$101, _co$17] = _$getNextMarker(_el$100.nextSibling),
|
|
914
|
+
_el$102 = _el$101.nextSibling,
|
|
915
|
+
[_el$103, _co$18] = _$getNextMarker(_el$102.nextSibling),
|
|
916
|
+
_el$73 = _el$103.nextSibling,
|
|
917
|
+
_el$92 = _el$73.firstChild,
|
|
918
|
+
[_el$93, _co$13] = _$getNextMarker(_el$92.nextSibling),
|
|
919
|
+
_el$74 = _el$93.nextSibling,
|
|
893
920
|
_el$75 = _el$74.firstChild,
|
|
894
921
|
_el$76 = _el$75.nextSibling,
|
|
895
|
-
_el$77 = _el$
|
|
896
|
-
|
|
897
|
-
_el$
|
|
898
|
-
|
|
899
|
-
_el$
|
|
900
|
-
|
|
901
|
-
_el$
|
|
902
|
-
_el$
|
|
903
|
-
|
|
904
|
-
_el$
|
|
905
|
-
_el$
|
|
906
|
-
_el$
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
[_el$102, _co$16] = _$getNextMarker(_el$101.nextSibling),
|
|
912
|
-
_el$103 = _el$102.nextSibling,
|
|
913
|
-
[_el$104, _co$17] = _$getNextMarker(_el$103.nextSibling),
|
|
914
|
-
_el$93 = _el$104.nextSibling,
|
|
915
|
-
_el$94 = _el$93.firstChild,
|
|
916
|
-
_el$95 = _el$94.nextSibling,
|
|
917
|
-
_el$105 = _el$93.nextSibling,
|
|
918
|
-
[_el$106, _co$18] = _$getNextMarker(_el$105.nextSibling);
|
|
919
|
-
_$insert(_el$75, () => chatMessages().thisChat);
|
|
920
|
-
_$insert(_el$76, (() => {
|
|
921
|
-
var _c$2 = _$memo(() => percent() === null);
|
|
922
|
-
return () => _c$2() ? _$memo(() => !!reported())() ? chatMessages().tokensUsed({
|
|
922
|
+
_el$77 = _el$74.nextSibling,
|
|
923
|
+
_el$78 = _el$77.firstChild,
|
|
924
|
+
_el$79 = _el$78.nextSibling,
|
|
925
|
+
_el$94 = _el$77.nextSibling,
|
|
926
|
+
[_el$95, _co$14] = _$getNextMarker(_el$94.nextSibling),
|
|
927
|
+
_el$96 = _el$95.nextSibling,
|
|
928
|
+
[_el$97, _co$15] = _$getNextMarker(_el$96.nextSibling),
|
|
929
|
+
_el$86 = _el$97.nextSibling,
|
|
930
|
+
_el$87 = _el$86.firstChild,
|
|
931
|
+
_el$88 = _el$87.nextSibling,
|
|
932
|
+
_el$98 = _el$86.nextSibling,
|
|
933
|
+
[_el$99, _co$16] = _$getNextMarker(_el$98.nextSibling);
|
|
934
|
+
_$insert(_el$68, () => chatMessages().thisChat);
|
|
935
|
+
_$insert(_el$69, (() => {
|
|
936
|
+
var _c$ = _$memo(() => percent() === null);
|
|
937
|
+
return () => _c$() ? _$memo(() => !!reported())() ? chatMessages().tokensUsed({
|
|
923
938
|
total: formatNumber(total())
|
|
924
939
|
}) : messages().unknown : chatMessages().contextFull({
|
|
925
940
|
percent: formatPercent(percent())
|
|
926
941
|
});
|
|
927
942
|
})());
|
|
928
|
-
_$insert(_el$
|
|
943
|
+
_$insert(_el$67, _$createComponent(Show, {
|
|
929
944
|
get when() {
|
|
930
945
|
return props.action;
|
|
931
946
|
},
|
|
@@ -946,13 +961,13 @@ export function ChatContextUsage(props) {
|
|
|
946
961
|
},
|
|
947
962
|
onClick: () => void run(),
|
|
948
963
|
get children() {
|
|
949
|
-
var _el$
|
|
950
|
-
_$effect(() => _$className(_el$
|
|
951
|
-
return _el$
|
|
964
|
+
var _el$108 = _$getNextElement(_tmpl$11);
|
|
965
|
+
_$effect(() => _$className(_el$108, busy() ? "ti ti-loader-2 k2b-spin" : action().icon ?? "ti ti-arrows-diagonal-minimize-2"));
|
|
966
|
+
return _el$108;
|
|
952
967
|
}
|
|
953
968
|
})
|
|
954
|
-
}), _el$
|
|
955
|
-
_$insert(_el$
|
|
969
|
+
}), _el$71, _co$12);
|
|
970
|
+
_$insert(_el$66, _$createComponent(Show, {
|
|
956
971
|
get when() {
|
|
957
972
|
return percent() !== null;
|
|
958
973
|
},
|
|
@@ -970,115 +985,115 @@ export function ChatContextUsage(props) {
|
|
|
970
985
|
}
|
|
971
986
|
});
|
|
972
987
|
}
|
|
973
|
-
}), _el$
|
|
974
|
-
_$insert(_el$
|
|
988
|
+
}), _el$101, _co$17);
|
|
989
|
+
_$insert(_el$66, _$createComponent(Show, {
|
|
975
990
|
get when() {
|
|
976
991
|
return props.note;
|
|
977
992
|
},
|
|
978
993
|
get children() {
|
|
979
|
-
var _el$
|
|
980
|
-
_$insert(_el$
|
|
981
|
-
return _el$
|
|
994
|
+
var _el$72 = _$getNextElement(_tmpl$27);
|
|
995
|
+
_$insert(_el$72, () => props.note);
|
|
996
|
+
return _el$72;
|
|
982
997
|
}
|
|
983
|
-
}), _el$
|
|
984
|
-
_$insert(_el$
|
|
998
|
+
}), _el$103, _co$18);
|
|
999
|
+
_$insert(_el$73, _$createComponent(Show, {
|
|
985
1000
|
get when() {
|
|
986
1001
|
return props.modelLabel;
|
|
987
1002
|
},
|
|
988
1003
|
children: model => (() => {
|
|
989
|
-
var _el$
|
|
990
|
-
_el$
|
|
991
|
-
_el$
|
|
992
|
-
_$insert(_el$
|
|
993
|
-
_$insert(_el$
|
|
994
|
-
return _el$
|
|
1004
|
+
var _el$109 = _$getNextElement(_tmpl$28),
|
|
1005
|
+
_el$110 = _el$109.firstChild,
|
|
1006
|
+
_el$111 = _el$110.nextSibling;
|
|
1007
|
+
_$insert(_el$110, () => chatMessages().model);
|
|
1008
|
+
_$insert(_el$111, model);
|
|
1009
|
+
return _el$109;
|
|
995
1010
|
})()
|
|
996
|
-
}), _el$
|
|
997
|
-
_$insert(_el$
|
|
998
|
-
_$insert(_el$
|
|
999
|
-
_$insert(_el$
|
|
1000
|
-
_$insert(_el$
|
|
1001
|
-
_$insert(_el$
|
|
1011
|
+
}), _el$93, _co$13);
|
|
1012
|
+
_$insert(_el$75, () => chatMessages().input);
|
|
1013
|
+
_$insert(_el$76, () => formattedUsageValue(usage().input));
|
|
1014
|
+
_$insert(_el$78, () => chatMessages().output);
|
|
1015
|
+
_$insert(_el$79, () => formattedUsageValue(usage().output));
|
|
1016
|
+
_$insert(_el$73, _$createComponent(Show, {
|
|
1002
1017
|
get when() {
|
|
1003
1018
|
return reported();
|
|
1004
1019
|
},
|
|
1005
1020
|
get children() {
|
|
1006
|
-
var _el$
|
|
1007
|
-
_el$
|
|
1008
|
-
_el$
|
|
1009
|
-
_$insert(_el$
|
|
1010
|
-
_$insert(_el$
|
|
1011
|
-
return _el$
|
|
1021
|
+
var _el$80 = _$getNextElement(_tmpl$28),
|
|
1022
|
+
_el$81 = _el$80.firstChild,
|
|
1023
|
+
_el$82 = _el$81.nextSibling;
|
|
1024
|
+
_$insert(_el$81, () => chatMessages().contextInUse);
|
|
1025
|
+
_$insert(_el$82, () => formatNumber(total()));
|
|
1026
|
+
return _el$80;
|
|
1012
1027
|
}
|
|
1013
|
-
}), _el$
|
|
1014
|
-
_$insert(_el$
|
|
1028
|
+
}), _el$95, _co$14);
|
|
1029
|
+
_$insert(_el$73, _$createComponent(Show, {
|
|
1015
1030
|
get when() {
|
|
1016
1031
|
return loopUsage().reported;
|
|
1017
1032
|
},
|
|
1018
1033
|
get children() {
|
|
1019
|
-
var _el$
|
|
1020
|
-
_el$
|
|
1021
|
-
_el$
|
|
1022
|
-
_$insert(_el$
|
|
1023
|
-
_$insert(_el$
|
|
1024
|
-
return _el$
|
|
1034
|
+
var _el$83 = _$getNextElement(_tmpl$28),
|
|
1035
|
+
_el$84 = _el$83.firstChild,
|
|
1036
|
+
_el$85 = _el$84.nextSibling;
|
|
1037
|
+
_$insert(_el$84, () => chatMessages().loopTotal);
|
|
1038
|
+
_$insert(_el$85, () => formattedUsageValue(loopUsage().total));
|
|
1039
|
+
return _el$83;
|
|
1025
1040
|
}
|
|
1026
|
-
}), _el$
|
|
1027
|
-
_$insert(_el$
|
|
1028
|
-
_$insert(_el$
|
|
1029
|
-
var _c$
|
|
1030
|
-
return () => _c$
|
|
1041
|
+
}), _el$97, _co$15);
|
|
1042
|
+
_$insert(_el$87, () => chatMessages().contextWindow);
|
|
1043
|
+
_$insert(_el$88, (() => {
|
|
1044
|
+
var _c$2 = _$memo(() => windowSize() > 0);
|
|
1045
|
+
return () => _c$2() ? formatNumber(windowSize()) : chatMessages().notConfigured;
|
|
1031
1046
|
})());
|
|
1032
|
-
_$insert(_el$
|
|
1047
|
+
_$insert(_el$73, _$createComponent(Show, {
|
|
1033
1048
|
get when() {
|
|
1034
1049
|
return remaining() !== null;
|
|
1035
1050
|
},
|
|
1036
1051
|
get children() {
|
|
1037
|
-
var _el$
|
|
1038
|
-
_el$
|
|
1039
|
-
_el$
|
|
1040
|
-
_$insert(_el$
|
|
1041
|
-
_$insert(_el$
|
|
1042
|
-
var _c$
|
|
1043
|
-
return () => _c$
|
|
1052
|
+
var _el$89 = _$getNextElement(_tmpl$28),
|
|
1053
|
+
_el$90 = _el$89.firstChild,
|
|
1054
|
+
_el$91 = _el$90.nextSibling;
|
|
1055
|
+
_$insert(_el$90, () => chatMessages().remaining);
|
|
1056
|
+
_$insert(_el$91, (() => {
|
|
1057
|
+
var _c$3 = _$memo(() => remaining() === null);
|
|
1058
|
+
return () => _c$3() ? messages().unknown : formatNumber(remaining());
|
|
1044
1059
|
})());
|
|
1045
|
-
return _el$
|
|
1060
|
+
return _el$89;
|
|
1046
1061
|
}
|
|
1047
|
-
}), _el$
|
|
1048
|
-
_$effect(() => _$setAttribute(_el$
|
|
1049
|
-
return _el$
|
|
1062
|
+
}), _el$99, _co$16);
|
|
1063
|
+
_$effect(() => _$setAttribute(_el$69, "data-warning", contextWarns() ? "true" : undefined));
|
|
1064
|
+
return _el$66;
|
|
1050
1065
|
}
|
|
1051
|
-
}), _el$
|
|
1052
|
-
_$insert(_el$
|
|
1066
|
+
}), _el$105, _co$19);
|
|
1067
|
+
_$insert(_el$65, _$createComponent(For, {
|
|
1053
1068
|
get each() {
|
|
1054
1069
|
return sections();
|
|
1055
1070
|
},
|
|
1056
1071
|
children: section => (() => {
|
|
1057
|
-
var _el$
|
|
1058
|
-
_el$
|
|
1059
|
-
_el$
|
|
1060
|
-
_el$
|
|
1061
|
-
[_el$
|
|
1062
|
-
_el$
|
|
1063
|
-
[_el$
|
|
1064
|
-
_$insert(_el$
|
|
1065
|
-
_$insert(_el$
|
|
1072
|
+
var _el$112 = _$getNextElement(_tmpl$32),
|
|
1073
|
+
_el$113 = _el$112.firstChild,
|
|
1074
|
+
_el$114 = _el$113.firstChild,
|
|
1075
|
+
_el$116 = _el$114.nextSibling,
|
|
1076
|
+
[_el$117, _co$21] = _$getNextMarker(_el$116.nextSibling),
|
|
1077
|
+
_el$118 = _el$113.nextSibling,
|
|
1078
|
+
[_el$119, _co$22] = _$getNextMarker(_el$118.nextSibling);
|
|
1079
|
+
_$insert(_el$114, () => section.title);
|
|
1080
|
+
_$insert(_el$113, _$createComponent(Show, {
|
|
1066
1081
|
get when() {
|
|
1067
1082
|
return section.value;
|
|
1068
1083
|
},
|
|
1069
1084
|
get children() {
|
|
1070
|
-
var _el$
|
|
1071
|
-
_$insert(_el$
|
|
1072
|
-
_$effect(() => _$setAttribute(_el$
|
|
1073
|
-
return _el$
|
|
1085
|
+
var _el$115 = _$getNextElement(_tmpl$31);
|
|
1086
|
+
_$insert(_el$115, () => section.value);
|
|
1087
|
+
_$effect(() => _$setAttribute(_el$115, "data-warning", sectionWarns(section) ? "true" : undefined));
|
|
1088
|
+
return _el$115;
|
|
1074
1089
|
}
|
|
1075
|
-
}), _el$
|
|
1076
|
-
_$insert(_el$
|
|
1077
|
-
_$effect(() => _$setAttribute(_el$
|
|
1078
|
-
return _el$
|
|
1090
|
+
}), _el$117, _co$21);
|
|
1091
|
+
_$insert(_el$112, () => section.content, _el$119, _co$22);
|
|
1092
|
+
_$effect(() => _$setAttribute(_el$112, "data-section", section.id));
|
|
1093
|
+
return _el$112;
|
|
1079
1094
|
})()
|
|
1080
|
-
}), _el$
|
|
1081
|
-
return _el$
|
|
1095
|
+
}), _el$107, _co$20);
|
|
1096
|
+
return _el$65;
|
|
1082
1097
|
})();
|
|
1083
1098
|
},
|
|
1084
1099
|
type: "button",
|
|
@@ -1107,15 +1122,15 @@ export function ChatContextUsage(props) {
|
|
|
1107
1122
|
return _$memo(() => !!warning())() && highest() !== null;
|
|
1108
1123
|
},
|
|
1109
1124
|
get children() {
|
|
1110
|
-
var _el$
|
|
1111
|
-
_$insert(_el$
|
|
1112
|
-
return _el$
|
|
1125
|
+
var _el$64 = _$getNextElement(_tmpl$25);
|
|
1126
|
+
_$insert(_el$64, () => formatPercent(highest()));
|
|
1127
|
+
return _el$64;
|
|
1113
1128
|
}
|
|
1114
1129
|
})];
|
|
1115
1130
|
}
|
|
1116
1131
|
}));
|
|
1117
|
-
_$effect(() => _$setAttribute(_el$
|
|
1118
|
-
return _el$
|
|
1132
|
+
_$effect(() => _$setAttribute(_el$63, "data-warning", warning() ? "true" : undefined));
|
|
1133
|
+
return _el$63;
|
|
1119
1134
|
})();
|
|
1120
1135
|
}
|
|
1121
1136
|
_$delegateEvents(["click"]);
|