@redocly/replay 0.27.0-next.6 → 0.27.0-next.7
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/{replay-AiChatProvider-D7E0a83D.js → replay-AiChatProvider-Dub7iVgM.js} +6 -6
- package/dist/{replay-AiChatProvider-p9SioFWy.js → replay-AiChatProvider-e4PWUCRp.js} +1 -1
- package/dist/{replay-AiChatSqliteDBStorage-DgGB1XKW.js → replay-AiChatSqliteDBStorage-CpjwxLnF.js} +1 -1
- package/dist/{replay-AiChatSqliteDBStorage-CKQJ5VZi.js → replay-AiChatSqliteDBStorage-DbxNU-ot.js} +1 -1
- package/dist/replay-AiPanel-B_zDmo55.js +868 -0
- package/dist/{replay-AiPanel-DvOGYsWl.js → replay-AiPanel-DuRA2zAt.js} +1178 -1111
- package/dist/{replay-SqliteDBStorage-CNJbZXTw.js → replay-SqliteDBStorage-BrNleq7S.js} +1 -1
- package/dist/{replay-SqliteDBStorage-D_31Bd3Z.js → replay-SqliteDBStorage-CafBNNLB.js} +1 -1
- package/dist/{replay-agent-loop-DklepPbJ.js → replay-agent-loop-CV0s4022.js} +3 -3
- package/dist/{replay-agent-loop-fKCHgyOD.js → replay-agent-loop-CzV79Gr1.js} +1 -1
- package/dist/{replay-ai-chat-mappers-IWtvE0Nl.js → replay-ai-chat-mappers-BNsR30dS.js} +1 -1
- package/dist/{replay-ai-chat-mappers-D-vUBq2s.js → replay-ai-chat-mappers-BWeZN6p_.js} +1 -1
- package/dist/{replay-create-model-CfrWgdF7.js → replay-create-model-CEDEaJC8.js} +2 -2
- package/dist/{replay-create-model-xGRAIhcu.js → replay-create-model-CmRk68RD.js} +2 -2
- package/dist/{replay-db-XlueEDU-.js → replay-db-BfSnfWcb.js} +3 -3
- package/dist/{replay-db-BtdwaWh3.js → replay-db-CM8OLcFK.js} +7 -7
- package/dist/{replay-external-resolver-D6VSVDwt.js → replay-external-resolver-G86hjAvS.js} +2 -2
- package/dist/{replay-external-resolver-Skh0OGde.js → replay-external-resolver-bdSEZsNk.js} +1 -1
- package/dist/{replay-index-S_wAPmTA.js → replay-index-BmotNqNI.js} +1153 -1131
- package/dist/{replay-index-BOB__Jm6.js → replay-index-Bsag-eKM.js} +1 -1
- package/dist/{replay-index-fVC8e5y9.js → replay-index-C_eJVbPZ.js} +1 -1
- package/dist/{replay-index-DXnDNeqk.js → replay-index-Cd9LaUVx.js} +22877 -22392
- package/dist/{replay-index-CCvitTKt.js → replay-index-D58Mg6_y.js} +1 -1
- package/dist/{replay-index-BEzVYZeb.js → replay-index-DYtNY0OY.js} +5 -5
- package/dist/{replay-lint-BCVeL_wb.js → replay-lint-CxwKILeF.js} +3 -3
- package/dist/{replay-lint-DjMIgYfF.js → replay-lint-YfaLafO6.js} +3 -3
- package/dist/{replay-lint-graphql-Bltv-T6_.js → replay-lint-graphql-BRrk1UK5.js} +1 -1
- package/dist/{replay-lint-graphql-bkrdHRy7.js → replay-lint-graphql-GtbZklco.js} +1 -1
- package/dist/{replay-resolve-CQL6WBG1.js → replay-resolve-Bza6lozO.js} +1 -1
- package/dist/{replay-resolve-BhcSceq-.js → replay-resolve-Rb3XjiUd.js} +1 -1
- package/dist/{replay-respect-run-CecN1j9r.js → replay-respect-run-BB0VXCz-.js} +3 -3
- package/dist/{replay-respect-run-rJm4W93K.js → replay-respect-run-Pkoy4Q3P.js} +1 -1
- package/dist/{replay-tauri-path--BfusnkB.js → replay-tauri-path-B8tT4cGY.js} +2 -2
- package/dist/{replay-tauri-path--8KtMkGg.js → replay-tauri-path-yOFqWleH.js} +1 -1
- package/dist/{replay-useAiChatQueries-B1-NwsZz.js → replay-useAiChatQueries-1fqZwVTj.js} +4 -2
- package/dist/{replay-useAiChatQueries-Btd-PmIH.js → replay-useAiChatQueries-B7ZcWDmG.js} +155 -153
- package/dist/{replay-validate-key-Bk0SFd3-.js → replay-validate-key-C8-nF61w.js} +1 -1
- package/dist/{replay-validate-key-CYsfegSv.js → replay-validate-key-qJOuAQJK.js} +2 -2
- package/dist/replay.cjs +1 -1
- package/dist/replay.js +1 -1
- package/package.json +1 -1
- package/dist/replay-AiPanel-BLkqnlmb.js +0 -849
|
@@ -1,91 +1,13 @@
|
|
|
1
|
-
import { jsx as i, jsxs as h, Fragment as
|
|
2
|
-
import {
|
|
3
|
-
import c, { css as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { M as
|
|
1
|
+
import { jsx as i, jsxs as h, Fragment as Ne } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as D, useMemo as A, useState as G, Fragment as mt, useRef as N, useEffect as H, useLayoutEffect as Fe, createContext as yt, useContext as xt } from "react";
|
|
3
|
+
import c, { css as X, keyframes as bt } from "styled-components";
|
|
4
|
+
import { G as je, T as te, H as Ce, J as wt, b as Ct, m as We, i as kt, j as Tt, K as It, L as ge, N as ve, O as M, P as be, Q as At, U as St, V as Ue, W as Lt, X as Pt, R as me, E as pe, Y as ke, Z as Ye, p as Ge, _ as we, $ as W, a0 as Et } from "./replay-index-Cd9LaUVx.js";
|
|
5
|
+
import { l as Rt, n as Ot, p as $t, q as Dt, T as zt, t as Mt, v as _t, x as qe, C as k, y as Vt, z as Ke, L as Bt, B as Q, D as Ht, E as Nt, F as Ft, G as jt, H as F } from "./replay-useAiChatQueries-B7ZcWDmG.js";
|
|
6
|
+
import { AI_SEARCH_MAX_MESSAGE_LENGTH as Wt, Button as B, SubtractIcon as Ut, AddIcon as Yt, CheckmarkFilledIcon as Gt, CloseFilledIcon as qt, CheckboxIcon as Kt, capitalize as re, ChevronDownIcon as Zt, ChevronRightIcon as Jt, SettingsCogIcon as Xt, Dropdown as Qt, DropdownMenu as en, DropdownMenuItem as Ze, CheckmarkIcon as tn, ClaudeIcon as nn, GeminiIcon as on, ChatGptIcon as rn, Tooltip as U, Typography as se, TrashCanIcon as an, AiStarsGradientIcon as sn, NewChatIcon as cn, RecentlyViewedIcon as ln, CloseIcon as dn, ArrowLeftIcon as un } from "@redocly/theme";
|
|
7
|
+
import { M as z } from "./replay-db-CM8OLcFK.js";
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
|
-
import { Link as
|
|
10
|
-
const
|
|
11
|
-
width: var(--search-ai-thinking-dot-size);
|
|
12
|
-
height: var(--search-ai-thinking-dot-size);
|
|
13
|
-
border-radius: 50%;
|
|
14
|
-
background: var(--search-ai-thinking-dot-color);
|
|
15
|
-
animation: bounce 1.4s infinite ease-in-out;
|
|
16
|
-
|
|
17
|
-
&:nth-child(1) {
|
|
18
|
-
animation-delay: -0.32s;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&:nth-child(2) {
|
|
22
|
-
animation-delay: -0.16s;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&:nth-child(3) {
|
|
26
|
-
animation-delay: 0s;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@keyframes bounce {
|
|
30
|
-
0%,
|
|
31
|
-
80%,
|
|
32
|
-
100% {
|
|
33
|
-
opacity: 0.2;
|
|
34
|
-
transform: scale(0.8);
|
|
35
|
-
}
|
|
36
|
-
40% {
|
|
37
|
-
opacity: 1;
|
|
38
|
-
transform: scale(1);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
`, Xe = 280;
|
|
42
|
-
function be() {
|
|
43
|
-
const [e, t] = K(
|
|
44
|
-
() => xe().getIndexingActivityState().inProgress
|
|
45
|
-
);
|
|
46
|
-
return B(() => xe().subscribe("indexing-activity", (r) => {
|
|
47
|
-
t(r.inProgress);
|
|
48
|
-
}), []), /* @__PURE__ */ i(hn, { $open: e, children: /* @__PURE__ */ i(gn, { children: /* @__PURE__ */ i(vn, { $open: e, "aria-hidden": !e, children: /* @__PURE__ */ i(
|
|
49
|
-
Y,
|
|
50
|
-
{
|
|
51
|
-
tip: "We're building a search index of your project. Until it's ready, the assistant may need more context in each reply to stay accurate, which can use more tokens.",
|
|
52
|
-
placement: "top",
|
|
53
|
-
width: "240px",
|
|
54
|
-
arrowPosition: "left",
|
|
55
|
-
children: /* @__PURE__ */ h(mn, { role: "status", "aria-live": "polite", "aria-label": "Indexing in progress...", children: [
|
|
56
|
-
/* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(te, {}) }),
|
|
57
|
-
/* @__PURE__ */ i(yn, { children: "Indexing in progress..." })
|
|
58
|
-
] })
|
|
59
|
-
}
|
|
60
|
-
) }) }) });
|
|
61
|
-
}
|
|
62
|
-
const hn = c.div`
|
|
63
|
-
display: grid;
|
|
64
|
-
grid-template-rows: ${({ $open: e }) => e ? "1fr" : "0fr"};
|
|
65
|
-
transition: grid-template-rows ${Xe}ms ease-out;
|
|
66
|
-
`, gn = c.div`
|
|
67
|
-
min-height: 0;
|
|
68
|
-
overflow: hidden;
|
|
69
|
-
`, vn = c.div`
|
|
70
|
-
opacity: ${({ $open: e }) => e ? 1 : 0};
|
|
71
|
-
transition: opacity ${Xe}ms ease-out;
|
|
72
|
-
pointer-events: ${({ $open: e }) => e ? "auto" : "none"};
|
|
73
|
-
padding: var(--spacing-xs);
|
|
74
|
-
padding-top: var(--spacing-xxs);
|
|
75
|
-
`, mn = c.div`
|
|
76
|
-
width: 100%;
|
|
77
|
-
display: flex;
|
|
78
|
-
align-items: center;
|
|
79
|
-
gap: var(--spacing-xxs);
|
|
80
|
-
background: var(--layer-color);
|
|
81
|
-
padding: var(--spacing-xs) var(--spacing-sm);
|
|
82
|
-
border-radius: var(--border-radius);
|
|
83
|
-
font-size: var(--font-size-sm);
|
|
84
|
-
line-height: var(--line-height-sm);
|
|
85
|
-
`, yn = c.div`
|
|
86
|
-
flex: 1;
|
|
87
|
-
min-width: 0;
|
|
88
|
-
`, xn = (e) => /* @__PURE__ */ i(
|
|
9
|
+
import { Link as fn } from "react-router-dom";
|
|
10
|
+
const pn = (e) => /* @__PURE__ */ i(
|
|
89
11
|
"svg",
|
|
90
12
|
{
|
|
91
13
|
width: "16",
|
|
@@ -102,79 +24,79 @@ const hn = c.div`
|
|
|
102
24
|
}
|
|
103
25
|
)
|
|
104
26
|
}
|
|
105
|
-
),
|
|
27
|
+
), hn = c(pn).attrs({
|
|
106
28
|
"data-component-name": "icons/SendIcon/SendIcon"
|
|
107
29
|
})`
|
|
108
30
|
path {
|
|
109
|
-
fill: ${({ color: e }) =>
|
|
31
|
+
fill: ${({ color: e }) => je(e)};
|
|
110
32
|
}
|
|
111
33
|
|
|
112
34
|
height: ${({ size: e }) => e || "16px"};
|
|
113
35
|
width: ${({ size: e }) => e || "16px"};
|
|
114
|
-
`,
|
|
36
|
+
`, gn = (e) => /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 14 14", fill: "none", ...e, children: /* @__PURE__ */ i("path", { d: "M10.5 3.5V10.5H3.5V3.5H10.5ZM10.5 2.625H3.5C3.26794 2.625 3.04538 2.71719 2.88128 2.88128C2.71719 3.04538 2.625 3.26794 2.625 3.5V10.5C2.625 10.7321 2.71719 10.9546 2.88128 11.1187C3.04538 11.2828 3.26794 11.375 3.5 11.375H10.5C10.7321 11.375 10.9546 11.2828 11.1187 11.1187C11.2828 10.9546 11.375 10.7321 11.375 10.5V3.5C11.375 3.26794 11.2828 3.04538 11.1187 2.88128C10.9546 2.71719 10.7321 2.625 10.5 2.625Z" }) }), vn = c(gn).attrs({
|
|
115
37
|
"data-component-name": "icons/StopIcon/StopIcon"
|
|
116
38
|
})`
|
|
117
39
|
path {
|
|
118
|
-
fill: ${({ color: e }) =>
|
|
40
|
+
fill: ${({ color: e }) => je(e)};
|
|
119
41
|
}
|
|
120
42
|
|
|
121
43
|
height: ${({ size: e }) => e || "16px"};
|
|
122
44
|
width: ${({ size: e }) => e || "16px"};
|
|
123
45
|
`;
|
|
124
|
-
function
|
|
46
|
+
function mn({
|
|
125
47
|
placeholder: e = "Ask anything...",
|
|
126
48
|
className: t,
|
|
127
49
|
disabled: n,
|
|
128
|
-
isStreaming:
|
|
129
|
-
onStop:
|
|
50
|
+
isStreaming: o = !1,
|
|
51
|
+
onStop: r,
|
|
130
52
|
modelSelector: a,
|
|
131
53
|
value: s,
|
|
132
|
-
onValueChange:
|
|
133
|
-
onSubmit:
|
|
54
|
+
onValueChange: d,
|
|
55
|
+
onSubmit: l,
|
|
134
56
|
textareaRef: u
|
|
135
57
|
}) {
|
|
136
|
-
const f = s.trim(), p = !n && f.length > 0 && !
|
|
137
|
-
|
|
58
|
+
const f = s.trim(), p = !n && f.length > 0 && !o, g = !n && f.length > 0, m = (w) => {
|
|
59
|
+
d(w.target.value);
|
|
138
60
|
}, v = () => {
|
|
139
|
-
!f || n ||
|
|
61
|
+
!f || n || o || l();
|
|
140
62
|
}, x = () => {
|
|
141
|
-
!
|
|
63
|
+
!o || !r || r();
|
|
142
64
|
};
|
|
143
|
-
return /* @__PURE__ */ h(
|
|
65
|
+
return /* @__PURE__ */ h(yn, { className: t, $isActive: g, children: [
|
|
144
66
|
/* @__PURE__ */ i(
|
|
145
|
-
|
|
67
|
+
xn,
|
|
146
68
|
{
|
|
147
69
|
ref: u,
|
|
148
70
|
rows: 1,
|
|
149
|
-
maxLength:
|
|
71
|
+
maxLength: Wt,
|
|
150
72
|
placeholder: e,
|
|
151
73
|
value: s,
|
|
152
74
|
disabled: n,
|
|
153
75
|
spellCheck: !1,
|
|
154
76
|
onChange: m,
|
|
155
|
-
onKeyDown: (
|
|
156
|
-
|
|
77
|
+
onKeyDown: (w) => {
|
|
78
|
+
w.key === "Enter" && !w.shiftKey && !w.nativeEvent.isComposing && (w.preventDefault(), o && r ? x() : v());
|
|
157
79
|
}
|
|
158
80
|
}
|
|
159
81
|
),
|
|
160
|
-
/* @__PURE__ */ h(
|
|
82
|
+
/* @__PURE__ */ h(bn, { children: [
|
|
161
83
|
a,
|
|
162
|
-
|
|
163
|
-
|
|
84
|
+
o && r ? /* @__PURE__ */ i(
|
|
85
|
+
Cn,
|
|
164
86
|
{
|
|
165
87
|
type: "button",
|
|
166
88
|
size: "small",
|
|
167
89
|
"aria-label": "Stop generating",
|
|
168
|
-
icon: /* @__PURE__ */ i(
|
|
90
|
+
icon: /* @__PURE__ */ i(vn, { color: "var(--icon-color-on-color)" }),
|
|
169
91
|
onClick: x
|
|
170
92
|
}
|
|
171
93
|
) : /* @__PURE__ */ i(
|
|
172
|
-
|
|
94
|
+
wn,
|
|
173
95
|
{
|
|
174
96
|
type: "button",
|
|
175
97
|
size: "small",
|
|
176
98
|
"aria-label": "Send message",
|
|
177
|
-
icon: /* @__PURE__ */ i(
|
|
99
|
+
icon: /* @__PURE__ */ i(hn, { color: "var(--icon-color-on-color)" }),
|
|
178
100
|
onClick: v,
|
|
179
101
|
disabled: !p
|
|
180
102
|
}
|
|
@@ -182,7 +104,7 @@ function kn({
|
|
|
182
104
|
] })
|
|
183
105
|
] });
|
|
184
106
|
}
|
|
185
|
-
const
|
|
107
|
+
const yn = c.div`
|
|
186
108
|
display: flex;
|
|
187
109
|
flex-direction: column;
|
|
188
110
|
gap: var(--spacing-xs);
|
|
@@ -201,13 +123,13 @@ const Tn = c.div`
|
|
|
201
123
|
var(--replay-ai-gradient-soft) border-box;
|
|
202
124
|
}
|
|
203
125
|
|
|
204
|
-
${({ $isActive: e }) => e &&
|
|
126
|
+
${({ $isActive: e }) => e && X`
|
|
205
127
|
border-color: transparent;
|
|
206
128
|
background:
|
|
207
129
|
linear-gradient(var(--layer-color), var(--layer-color)) padding-box,
|
|
208
130
|
var(--replay-ai-gradient-soft) border-box;
|
|
209
131
|
`}
|
|
210
|
-
`,
|
|
132
|
+
`, xn = c.textarea`
|
|
211
133
|
max-height: 150px;
|
|
212
134
|
min-height: var(--search-ai-conversation-input-min-height);
|
|
213
135
|
|
|
@@ -227,12 +149,12 @@ const Tn = c.div`
|
|
|
227
149
|
color: var(--text-color-helper);
|
|
228
150
|
text-indent: 2px;
|
|
229
151
|
}
|
|
230
|
-
`,
|
|
152
|
+
`, bn = c.div`
|
|
231
153
|
display: flex;
|
|
232
154
|
justify-content: space-between;
|
|
233
155
|
align-items: center;
|
|
234
156
|
gap: var(--spacing-xs);
|
|
235
|
-
`,
|
|
157
|
+
`, wn = c(B)`
|
|
236
158
|
box-sizing: border-box;
|
|
237
159
|
background: var(--search-ai-gradient);
|
|
238
160
|
|
|
@@ -242,26 +164,26 @@ const Tn = c.div`
|
|
|
242
164
|
width: 24px;
|
|
243
165
|
height: 24px;
|
|
244
166
|
}
|
|
245
|
-
`,
|
|
167
|
+
`, Cn = c(B)`
|
|
246
168
|
box-sizing: border-box;
|
|
247
169
|
background: var(--color-warm-grey-9);
|
|
248
170
|
border-radius: var(--border-radius-xxl);
|
|
249
|
-
`,
|
|
250
|
-
function
|
|
171
|
+
`, kn = /* @__PURE__ */ new Set(["collection", "workflow", "step", "operation", "workflow-run"]);
|
|
172
|
+
function Je(e) {
|
|
251
173
|
return `replay://step?${new URLSearchParams({
|
|
252
174
|
collectionId: e.collectionId.trim(),
|
|
253
175
|
workflowId: e.workflowId.trim(),
|
|
254
176
|
stepId: e.stepId.trim()
|
|
255
177
|
}).toString()}`;
|
|
256
178
|
}
|
|
257
|
-
function
|
|
179
|
+
function O(e, t) {
|
|
258
180
|
const n = e.get(t);
|
|
259
181
|
if (n == null)
|
|
260
182
|
return null;
|
|
261
|
-
const
|
|
262
|
-
return
|
|
183
|
+
const o = n.trim();
|
|
184
|
+
return o.length > 0 ? o : null;
|
|
263
185
|
}
|
|
264
|
-
function
|
|
186
|
+
function Tn(e) {
|
|
265
187
|
let t;
|
|
266
188
|
try {
|
|
267
189
|
t = new URL(e);
|
|
@@ -271,57 +193,57 @@ function En(e) {
|
|
|
271
193
|
if (t.protocol !== "replay:")
|
|
272
194
|
return null;
|
|
273
195
|
const n = t.hostname.toLowerCase();
|
|
274
|
-
if (!
|
|
196
|
+
if (!kn.has(n))
|
|
275
197
|
return null;
|
|
276
|
-
const
|
|
198
|
+
const o = t.searchParams;
|
|
277
199
|
switch (n) {
|
|
278
200
|
case "collection": {
|
|
279
|
-
const
|
|
280
|
-
return
|
|
201
|
+
const r = O(o, "collectionId");
|
|
202
|
+
return r ? { kind: "collection", collectionId: r } : null;
|
|
281
203
|
}
|
|
282
204
|
case "workflow": {
|
|
283
|
-
const
|
|
284
|
-
return !
|
|
205
|
+
const r = O(o, "collectionId"), a = O(o, "workflowId");
|
|
206
|
+
return !r || !a ? null : { kind: "workflow", collectionId: r, workflowId: a };
|
|
285
207
|
}
|
|
286
208
|
case "step": {
|
|
287
|
-
const
|
|
288
|
-
return !
|
|
209
|
+
const r = O(o, "collectionId"), a = O(o, "workflowId"), s = O(o, "stepId");
|
|
210
|
+
return !r || !a || !s ? null : { kind: "step", collectionId: r, workflowId: a, stepId: s };
|
|
289
211
|
}
|
|
290
212
|
case "operation": {
|
|
291
|
-
const
|
|
292
|
-
return
|
|
213
|
+
const r = O(o, "operationId");
|
|
214
|
+
return r ? { kind: "operation", operationId: r } : null;
|
|
293
215
|
}
|
|
294
216
|
case "workflow-run": {
|
|
295
|
-
const
|
|
296
|
-
if (!
|
|
297
|
-
const s =
|
|
217
|
+
const r = O(o, "collectionId"), a = O(o, "workflowId");
|
|
218
|
+
if (!r || !a) return null;
|
|
219
|
+
const s = O(o, "historyId"), d = s === "null" || s === "undefined" ? null : s;
|
|
298
220
|
return {
|
|
299
221
|
kind: "workflow-run",
|
|
300
|
-
collectionId:
|
|
222
|
+
collectionId: r,
|
|
301
223
|
workflowId: a,
|
|
302
|
-
...
|
|
224
|
+
...d ? { historyId: d } : {}
|
|
303
225
|
};
|
|
304
226
|
}
|
|
305
227
|
default:
|
|
306
228
|
return null;
|
|
307
229
|
}
|
|
308
230
|
}
|
|
309
|
-
function
|
|
310
|
-
return e.tabsState.tabs.get({ noproxy: !0 }).findIndex(({ data:
|
|
231
|
+
function In(e, t, n) {
|
|
232
|
+
return e.tabsState.tabs.get({ noproxy: !0 }).findIndex(({ data: o }) => wt(o, Ct.WorkflowRun) && o.collectionId === t && o.workflowId === n);
|
|
311
233
|
}
|
|
312
|
-
function
|
|
234
|
+
function An(e, t, n, o = {}) {
|
|
313
235
|
switch (n.kind) {
|
|
314
236
|
case "collection":
|
|
315
237
|
t.openCollectionTab({
|
|
316
238
|
collectionId: n.collectionId,
|
|
317
|
-
activeTabName:
|
|
239
|
+
activeTabName: Ce.COLLECTION_SETTINGS
|
|
318
240
|
});
|
|
319
241
|
break;
|
|
320
242
|
case "workflow":
|
|
321
243
|
t.openWorkflowTab({
|
|
322
244
|
collectionId: n.collectionId,
|
|
323
245
|
workflowId: n.workflowId,
|
|
324
|
-
activeTabName:
|
|
246
|
+
activeTabName: Ce.WORKFLOW_SETTINGS
|
|
325
247
|
});
|
|
326
248
|
break;
|
|
327
249
|
case "step":
|
|
@@ -329,22 +251,22 @@ function On(e, t, n, r = {}) {
|
|
|
329
251
|
collectionId: n.collectionId,
|
|
330
252
|
workflowId: n.workflowId,
|
|
331
253
|
stepId: n.stepId,
|
|
332
|
-
state:
|
|
254
|
+
state: te.Normal
|
|
333
255
|
});
|
|
334
256
|
break;
|
|
335
257
|
case "workflow-run": {
|
|
336
|
-
const
|
|
258
|
+
const r = o.workflowRunHistoryIds?.[Dt(n.collectionId, n.workflowId)] ?? [], a = n.historyId && r.includes(n.historyId) ? n.historyId : r.at(-1) ?? n.historyId;
|
|
337
259
|
if (a) {
|
|
338
|
-
t.openWorkflowRunTabFromHistory(a, { state:
|
|
260
|
+
t.openWorkflowRunTabFromHistory(a, { state: te.Normal });
|
|
339
261
|
break;
|
|
340
262
|
}
|
|
341
|
-
const s =
|
|
263
|
+
const s = In(
|
|
342
264
|
e,
|
|
343
265
|
n.collectionId,
|
|
344
266
|
n.workflowId
|
|
345
267
|
);
|
|
346
268
|
if (s !== -1) {
|
|
347
|
-
e.tabsState.tabs.get({ noproxy: !0 })[s].state ===
|
|
269
|
+
e.tabsState.tabs.get({ noproxy: !0 })[s].state === te.Preview && t.changeTabState(s, te.Normal), t.handleTabChange(s);
|
|
348
270
|
break;
|
|
349
271
|
}
|
|
350
272
|
t.openWorkflowRunTab({
|
|
@@ -354,41 +276,41 @@ function On(e, t, n, r = {}) {
|
|
|
354
276
|
break;
|
|
355
277
|
}
|
|
356
278
|
case "operation": {
|
|
357
|
-
const
|
|
358
|
-
if (!
|
|
279
|
+
const r = Rt(e, n.operationId);
|
|
280
|
+
if (!r.ok) {
|
|
359
281
|
console.warn("[executeReplayChatLink] Operation not resolved", {
|
|
360
282
|
operationId: n.operationId,
|
|
361
|
-
message:
|
|
283
|
+
message: r.message
|
|
362
284
|
});
|
|
363
285
|
return;
|
|
364
286
|
}
|
|
365
|
-
|
|
287
|
+
Ot(
|
|
366
288
|
e,
|
|
367
|
-
|
|
289
|
+
$t(r.value),
|
|
368
290
|
t
|
|
369
291
|
);
|
|
370
292
|
break;
|
|
371
293
|
}
|
|
372
294
|
}
|
|
373
295
|
}
|
|
374
|
-
function
|
|
375
|
-
const
|
|
376
|
-
|
|
296
|
+
function Sn(e, t, n, o = {}) {
|
|
297
|
+
const r = Tn(n);
|
|
298
|
+
r && An(e, t, r, o);
|
|
377
299
|
}
|
|
378
|
-
function
|
|
300
|
+
function Xe({
|
|
379
301
|
workflowRunHistoryIds: e
|
|
380
302
|
} = {}) {
|
|
381
|
-
const t =
|
|
382
|
-
handleTabChange:
|
|
383
|
-
addNewTab:
|
|
303
|
+
const t = We(), { getApiOperation: n } = kt(), {
|
|
304
|
+
handleTabChange: o,
|
|
305
|
+
addNewTab: r,
|
|
384
306
|
openCollectionTab: a,
|
|
385
307
|
openWorkflowTab: s,
|
|
386
|
-
openStepTabFromCollection:
|
|
387
|
-
openWorkflowRunTab:
|
|
308
|
+
openStepTabFromCollection: d,
|
|
309
|
+
openWorkflowRunTab: l,
|
|
388
310
|
openWorkflowRunTabFromHistory: u,
|
|
389
311
|
changeTabState: f
|
|
390
|
-
} =
|
|
391
|
-
return
|
|
312
|
+
} = Tt();
|
|
313
|
+
return D(
|
|
392
314
|
(p) => {
|
|
393
315
|
const g = p.target;
|
|
394
316
|
if (!(g instanceof Element))
|
|
@@ -397,16 +319,16 @@ function et({
|
|
|
397
319
|
if (!(m instanceof HTMLAnchorElement))
|
|
398
320
|
return;
|
|
399
321
|
const v = m.getAttribute("href");
|
|
400
|
-
v?.startsWith("replay:") && (p.preventDefault(), p.stopPropagation(),
|
|
322
|
+
v?.startsWith("replay:") && (p.preventDefault(), p.stopPropagation(), Sn(
|
|
401
323
|
t,
|
|
402
324
|
{
|
|
403
325
|
getApiOperation: n,
|
|
404
|
-
handleTabChange:
|
|
405
|
-
addNewTab:
|
|
326
|
+
handleTabChange: o,
|
|
327
|
+
addNewTab: r,
|
|
406
328
|
openCollectionTab: a,
|
|
407
329
|
openWorkflowTab: s,
|
|
408
|
-
openStepTabFromCollection:
|
|
409
|
-
openWorkflowRunTab:
|
|
330
|
+
openStepTabFromCollection: d,
|
|
331
|
+
openWorkflowRunTab: l,
|
|
410
332
|
openWorkflowRunTabFromHistory: u,
|
|
411
333
|
changeTabState: f
|
|
412
334
|
},
|
|
@@ -418,102 +340,102 @@ function et({
|
|
|
418
340
|
e,
|
|
419
341
|
t,
|
|
420
342
|
n,
|
|
421
|
-
r,
|
|
422
343
|
o,
|
|
344
|
+
r,
|
|
423
345
|
a,
|
|
424
346
|
s,
|
|
425
|
-
l,
|
|
426
347
|
d,
|
|
348
|
+
l,
|
|
427
349
|
u,
|
|
428
350
|
f
|
|
429
351
|
]
|
|
430
352
|
);
|
|
431
353
|
}
|
|
432
|
-
class
|
|
433
|
-
diff(t, n,
|
|
434
|
-
let
|
|
435
|
-
typeof
|
|
436
|
-
const a = this.castInput(t,
|
|
437
|
-
return this.diffWithOptionsObj(l,
|
|
354
|
+
class Ln {
|
|
355
|
+
diff(t, n, o = {}) {
|
|
356
|
+
let r;
|
|
357
|
+
typeof o == "function" ? (r = o, o = {}) : "callback" in o && (r = o.callback);
|
|
358
|
+
const a = this.castInput(t, o), s = this.castInput(n, o), d = this.removeEmpty(this.tokenize(a, o)), l = this.removeEmpty(this.tokenize(s, o));
|
|
359
|
+
return this.diffWithOptionsObj(d, l, o, r);
|
|
438
360
|
}
|
|
439
|
-
diffWithOptionsObj(t, n,
|
|
361
|
+
diffWithOptionsObj(t, n, o, r) {
|
|
440
362
|
var a;
|
|
441
363
|
const s = (y) => {
|
|
442
|
-
if (y = this.postProcess(y,
|
|
364
|
+
if (y = this.postProcess(y, o), r) {
|
|
443
365
|
setTimeout(function() {
|
|
444
|
-
|
|
366
|
+
r(y);
|
|
445
367
|
}, 0);
|
|
446
368
|
return;
|
|
447
369
|
} else
|
|
448
370
|
return y;
|
|
449
|
-
},
|
|
450
|
-
let u = 1, f =
|
|
451
|
-
|
|
452
|
-
const p = (a =
|
|
453
|
-
let v = this.extractCommon(m[0], n, t, 0,
|
|
454
|
-
if (m[0].oldPos + 1 >=
|
|
371
|
+
}, d = n.length, l = t.length;
|
|
372
|
+
let u = 1, f = d + l;
|
|
373
|
+
o.maxEditLength != null && (f = Math.min(f, o.maxEditLength));
|
|
374
|
+
const p = (a = o.timeout) !== null && a !== void 0 ? a : 1 / 0, g = Date.now() + p, m = [{ oldPos: -1, lastComponent: void 0 }];
|
|
375
|
+
let v = this.extractCommon(m[0], n, t, 0, o);
|
|
376
|
+
if (m[0].oldPos + 1 >= l && v + 1 >= d)
|
|
455
377
|
return s(this.buildValues(m[0].lastComponent, n, t));
|
|
456
|
-
let x = -1 / 0,
|
|
457
|
-
const
|
|
458
|
-
for (let y = Math.max(x, -u); y <= Math.min(
|
|
459
|
-
let
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
let
|
|
463
|
-
if (
|
|
464
|
-
const
|
|
465
|
-
|
|
378
|
+
let x = -1 / 0, b = 1 / 0;
|
|
379
|
+
const w = () => {
|
|
380
|
+
for (let y = Math.max(x, -u); y <= Math.min(b, u); y += 2) {
|
|
381
|
+
let S;
|
|
382
|
+
const E = m[y - 1], R = m[y + 1];
|
|
383
|
+
E && (m[y - 1] = void 0);
|
|
384
|
+
let q = !1;
|
|
385
|
+
if (R) {
|
|
386
|
+
const ee = R.oldPos - y;
|
|
387
|
+
q = R && 0 <= ee && ee < d;
|
|
466
388
|
}
|
|
467
|
-
const
|
|
468
|
-
if (!
|
|
389
|
+
const _ = E && E.oldPos + 1 < l;
|
|
390
|
+
if (!q && !_) {
|
|
469
391
|
m[y] = void 0;
|
|
470
392
|
continue;
|
|
471
393
|
}
|
|
472
|
-
if (!
|
|
473
|
-
return s(this.buildValues(
|
|
474
|
-
m[y] =
|
|
394
|
+
if (!_ || q && E.oldPos < R.oldPos ? S = this.addToPath(R, !0, !1, 0, o) : S = this.addToPath(E, !1, !0, 1, o), v = this.extractCommon(S, n, t, y, o), S.oldPos + 1 >= l && v + 1 >= d)
|
|
395
|
+
return s(this.buildValues(S.lastComponent, n, t)) || !0;
|
|
396
|
+
m[y] = S, S.oldPos + 1 >= l && (b = Math.min(b, y - 1)), v + 1 >= d && (x = Math.max(x, y + 1));
|
|
475
397
|
}
|
|
476
398
|
u++;
|
|
477
399
|
};
|
|
478
|
-
if (
|
|
400
|
+
if (r)
|
|
479
401
|
(function y() {
|
|
480
402
|
setTimeout(function() {
|
|
481
403
|
if (u > f || Date.now() > g)
|
|
482
|
-
return
|
|
483
|
-
|
|
404
|
+
return r(void 0);
|
|
405
|
+
w() || y();
|
|
484
406
|
}, 0);
|
|
485
407
|
})();
|
|
486
408
|
else
|
|
487
409
|
for (; u <= f && Date.now() <= g; ) {
|
|
488
|
-
const y =
|
|
410
|
+
const y = w();
|
|
489
411
|
if (y)
|
|
490
412
|
return y;
|
|
491
413
|
}
|
|
492
414
|
}
|
|
493
|
-
addToPath(t, n,
|
|
415
|
+
addToPath(t, n, o, r, a) {
|
|
494
416
|
const s = t.lastComponent;
|
|
495
|
-
return s && !a.oneChangePerToken && s.added === n && s.removed ===
|
|
496
|
-
oldPos: t.oldPos +
|
|
497
|
-
lastComponent: { count: s.count + 1, added: n, removed:
|
|
417
|
+
return s && !a.oneChangePerToken && s.added === n && s.removed === o ? {
|
|
418
|
+
oldPos: t.oldPos + r,
|
|
419
|
+
lastComponent: { count: s.count + 1, added: n, removed: o, previousComponent: s.previousComponent }
|
|
498
420
|
} : {
|
|
499
|
-
oldPos: t.oldPos +
|
|
500
|
-
lastComponent: { count: 1, added: n, removed:
|
|
421
|
+
oldPos: t.oldPos + r,
|
|
422
|
+
lastComponent: { count: 1, added: n, removed: o, previousComponent: s }
|
|
501
423
|
};
|
|
502
424
|
}
|
|
503
|
-
extractCommon(t, n,
|
|
504
|
-
const s = n.length,
|
|
505
|
-
let
|
|
506
|
-
for (; u + 1 < s &&
|
|
507
|
-
u++,
|
|
508
|
-
return f && !a.oneChangePerToken && (t.lastComponent = { count: f, previousComponent: t.lastComponent, added: !1, removed: !1 }), t.oldPos =
|
|
425
|
+
extractCommon(t, n, o, r, a) {
|
|
426
|
+
const s = n.length, d = o.length;
|
|
427
|
+
let l = t.oldPos, u = l - r, f = 0;
|
|
428
|
+
for (; u + 1 < s && l + 1 < d && this.equals(o[l + 1], n[u + 1], a); )
|
|
429
|
+
u++, l++, f++, a.oneChangePerToken && (t.lastComponent = { count: 1, previousComponent: t.lastComponent, added: !1, removed: !1 });
|
|
430
|
+
return f && !a.oneChangePerToken && (t.lastComponent = { count: f, previousComponent: t.lastComponent, added: !1, removed: !1 }), t.oldPos = l, u;
|
|
509
431
|
}
|
|
510
|
-
equals(t, n,
|
|
511
|
-
return
|
|
432
|
+
equals(t, n, o) {
|
|
433
|
+
return o.comparator ? o.comparator(t, n) : t === n || !!o.ignoreCase && t.toLowerCase() === n.toLowerCase();
|
|
512
434
|
}
|
|
513
435
|
removeEmpty(t) {
|
|
514
436
|
const n = [];
|
|
515
|
-
for (let
|
|
516
|
-
t[
|
|
437
|
+
for (let o = 0; o < t.length; o++)
|
|
438
|
+
t[o] && n.push(t[o]);
|
|
517
439
|
return n;
|
|
518
440
|
}
|
|
519
441
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -533,138 +455,138 @@ class Dn {
|
|
|
533
455
|
get useLongestToken() {
|
|
534
456
|
return !1;
|
|
535
457
|
}
|
|
536
|
-
buildValues(t, n,
|
|
537
|
-
const
|
|
458
|
+
buildValues(t, n, o) {
|
|
459
|
+
const r = [];
|
|
538
460
|
let a;
|
|
539
461
|
for (; t; )
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
const s =
|
|
543
|
-
let
|
|
544
|
-
for (;
|
|
545
|
-
const f =
|
|
462
|
+
r.push(t), a = t.previousComponent, delete t.previousComponent, t = a;
|
|
463
|
+
r.reverse();
|
|
464
|
+
const s = r.length;
|
|
465
|
+
let d = 0, l = 0, u = 0;
|
|
466
|
+
for (; d < s; d++) {
|
|
467
|
+
const f = r[d];
|
|
546
468
|
if (f.removed)
|
|
547
|
-
f.value = this.join(
|
|
469
|
+
f.value = this.join(o.slice(u, u + f.count)), u += f.count;
|
|
548
470
|
else {
|
|
549
471
|
if (!f.added && this.useLongestToken) {
|
|
550
|
-
let p = n.slice(
|
|
472
|
+
let p = n.slice(l, l + f.count);
|
|
551
473
|
p = p.map(function(g, m) {
|
|
552
|
-
const v =
|
|
474
|
+
const v = o[u + m];
|
|
553
475
|
return v.length > g.length ? v : g;
|
|
554
476
|
}), f.value = this.join(p);
|
|
555
477
|
} else
|
|
556
|
-
f.value = this.join(n.slice(
|
|
557
|
-
|
|
478
|
+
f.value = this.join(n.slice(l, l + f.count));
|
|
479
|
+
l += f.count, f.added || (u += f.count);
|
|
558
480
|
}
|
|
559
481
|
}
|
|
560
|
-
return
|
|
482
|
+
return r;
|
|
561
483
|
}
|
|
562
484
|
}
|
|
563
|
-
class
|
|
485
|
+
class Pn extends Ln {
|
|
564
486
|
constructor() {
|
|
565
|
-
super(...arguments), this.tokenize =
|
|
487
|
+
super(...arguments), this.tokenize = On;
|
|
566
488
|
}
|
|
567
|
-
equals(t, n,
|
|
568
|
-
return
|
|
569
|
-
`)) && (t = t.trim()), (!
|
|
570
|
-
`)) && (n = n.trim())) :
|
|
489
|
+
equals(t, n, o) {
|
|
490
|
+
return o.ignoreWhitespace ? ((!o.newlineIsToken || !t.includes(`
|
|
491
|
+
`)) && (t = t.trim()), (!o.newlineIsToken || !n.includes(`
|
|
492
|
+
`)) && (n = n.trim())) : o.ignoreNewlineAtEof && !o.newlineIsToken && (t.endsWith(`
|
|
571
493
|
`) && (t = t.slice(0, -1)), n.endsWith(`
|
|
572
|
-
`) && (n = n.slice(0, -1))), super.equals(t, n,
|
|
494
|
+
`) && (n = n.slice(0, -1))), super.equals(t, n, o);
|
|
573
495
|
}
|
|
574
496
|
}
|
|
575
|
-
const
|
|
576
|
-
function
|
|
577
|
-
return
|
|
497
|
+
const En = new Pn();
|
|
498
|
+
function Rn(e, t, n) {
|
|
499
|
+
return En.diff(e, t, n);
|
|
578
500
|
}
|
|
579
|
-
function
|
|
501
|
+
function On(e, t) {
|
|
580
502
|
t.stripTrailingCr && (e = e.replace(/\r\n/g, `
|
|
581
503
|
`));
|
|
582
|
-
const n = [],
|
|
583
|
-
|
|
584
|
-
for (let
|
|
585
|
-
const a = r
|
|
586
|
-
|
|
504
|
+
const n = [], o = e.split(/(\n|\r\n)/);
|
|
505
|
+
o[o.length - 1] || o.pop();
|
|
506
|
+
for (let r = 0; r < o.length; r++) {
|
|
507
|
+
const a = o[r];
|
|
508
|
+
r % 2 && !t.newlineIsToken ? n[n.length - 1] += a : n.push(a);
|
|
587
509
|
}
|
|
588
510
|
return n;
|
|
589
511
|
}
|
|
590
|
-
const
|
|
591
|
-
function
|
|
592
|
-
const n =
|
|
512
|
+
const $n = 500;
|
|
513
|
+
function Dn(e, t) {
|
|
514
|
+
const n = zn(e, t);
|
|
593
515
|
if (n.length === 0) return [];
|
|
594
|
-
const
|
|
595
|
-
let
|
|
596
|
-
for (;
|
|
597
|
-
let a =
|
|
598
|
-
const s = n[
|
|
516
|
+
const o = [];
|
|
517
|
+
let r = 0;
|
|
518
|
+
for (; r < n.length; ) {
|
|
519
|
+
let a = r;
|
|
520
|
+
const s = n[r].type === "context";
|
|
599
521
|
for (; a < n.length && n[a].type === "context" === s; ) a++;
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
start:
|
|
522
|
+
const d = n.slice(r, a);
|
|
523
|
+
o.push({
|
|
524
|
+
start: r,
|
|
603
525
|
end: a,
|
|
604
|
-
rows:
|
|
605
|
-
hasAdditions:
|
|
606
|
-
hasRemovals:
|
|
607
|
-
}),
|
|
526
|
+
rows: d,
|
|
527
|
+
hasAdditions: d.some((l) => l.type === "add"),
|
|
528
|
+
hasRemovals: d.some((l) => l.type === "remove")
|
|
529
|
+
}), r = a;
|
|
608
530
|
}
|
|
609
|
-
return
|
|
531
|
+
return o;
|
|
610
532
|
}
|
|
611
|
-
function
|
|
533
|
+
function zn(e, t) {
|
|
612
534
|
if (e === void 0)
|
|
613
|
-
return t === void 0 ? [] :
|
|
614
|
-
if (t === void 0) return
|
|
615
|
-
if (e === t) return
|
|
616
|
-
const n =
|
|
535
|
+
return t === void 0 ? [] : j(t, "add");
|
|
536
|
+
if (t === void 0) return j(e, "remove");
|
|
537
|
+
if (e === t) return j(t, "context");
|
|
538
|
+
const n = Mn(e, t);
|
|
617
539
|
return n ? n.flatMap(
|
|
618
|
-
(
|
|
619
|
-
) : [...
|
|
540
|
+
(o) => j(o.value, o.added ? "add" : o.removed ? "remove" : "context")
|
|
541
|
+
) : [...j(e, "remove"), ...j(t, "add")];
|
|
620
542
|
}
|
|
621
|
-
function
|
|
543
|
+
function Mn(e, t) {
|
|
622
544
|
try {
|
|
623
|
-
return
|
|
545
|
+
return Rn(e, t, { timeout: $n });
|
|
624
546
|
} catch {
|
|
625
547
|
return;
|
|
626
548
|
}
|
|
627
549
|
}
|
|
628
|
-
function
|
|
550
|
+
function j(e, t) {
|
|
629
551
|
const n = e.split(`
|
|
630
552
|
`);
|
|
631
|
-
return n.length > 1 && n[n.length - 1] === "" && n.pop(), n.map((
|
|
553
|
+
return n.length > 1 && n[n.length - 1] === "" && n.pop(), n.map((o) => ({ type: t, text: o }));
|
|
632
554
|
}
|
|
633
|
-
const
|
|
634
|
-
function
|
|
555
|
+
const Te = 1, Ie = (e) => e && e.hasAdditions !== e.hasRemovals, Ae = (e) => e && (e.hasAdditions || e.hasRemovals);
|
|
556
|
+
function _n(e, t, n) {
|
|
635
557
|
if (e.hasAdditions || e.hasRemovals)
|
|
636
|
-
return
|
|
637
|
-
const
|
|
638
|
-
if (a + s >= e.rows.length) return
|
|
639
|
-
const
|
|
640
|
-
return u.push(...
|
|
558
|
+
return ne(e.rows);
|
|
559
|
+
const o = n[t - 1], r = n[t + 1], a = Ie(o) ? Te : 0, s = Ie(r) ? Te : 0;
|
|
560
|
+
if (a + s >= e.rows.length) return ne(e.rows);
|
|
561
|
+
const d = e.rows.slice(0, a), l = s > 0 ? e.rows.slice(-s) : [], u = [];
|
|
562
|
+
return u.push(...ne(d)), Ae(o) && Ae(r) && u.push({ kind: "separator" }), u.push(...ne(l)), u;
|
|
641
563
|
}
|
|
642
|
-
function
|
|
564
|
+
function ne(e) {
|
|
643
565
|
return e.map((t) => ({
|
|
644
566
|
kind: "row",
|
|
645
567
|
row: t
|
|
646
568
|
}));
|
|
647
569
|
}
|
|
648
|
-
const
|
|
649
|
-
function
|
|
650
|
-
const n =
|
|
651
|
-
return
|
|
570
|
+
const Vn = 200;
|
|
571
|
+
function Se({ oldValue: e, newValue: t }) {
|
|
572
|
+
const n = A(() => Dn(e, t), [e, t]), o = A(() => n.flatMap(_n), [n]);
|
|
573
|
+
return A(() => n.some((a) => a.hasAdditions || a.hasRemovals), [n]) ? /* @__PURE__ */ i(Hn, { $maxHeight: Vn, children: o.map((a, s) => {
|
|
652
574
|
if (a.kind === "separator")
|
|
653
|
-
return /* @__PURE__ */ i(
|
|
654
|
-
const { row:
|
|
655
|
-
return /* @__PURE__ */ h(
|
|
656
|
-
/* @__PURE__ */ h(
|
|
657
|
-
|
|
658
|
-
|
|
575
|
+
return /* @__PURE__ */ i(Un, { children: /* @__PURE__ */ i(Le, { children: "···" }) }, s);
|
|
576
|
+
const { row: d } = a, l = Bn(d.type);
|
|
577
|
+
return /* @__PURE__ */ h(l, { children: [
|
|
578
|
+
/* @__PURE__ */ h(Wn, { children: [
|
|
579
|
+
d.type === "remove" && /* @__PURE__ */ i(Ut, { size: "12px" }),
|
|
580
|
+
d.type === "add" && /* @__PURE__ */ i(Yt, { size: "12px" })
|
|
659
581
|
] }),
|
|
660
|
-
/* @__PURE__ */ i(
|
|
582
|
+
/* @__PURE__ */ i(Le, { children: d.text === "" ? " " : d.text })
|
|
661
583
|
] }, s);
|
|
662
584
|
}) }) : null;
|
|
663
585
|
}
|
|
664
|
-
function
|
|
665
|
-
return e === "remove" ?
|
|
586
|
+
function Bn(e) {
|
|
587
|
+
return e === "remove" ? Nn : e === "add" ? Fn : jn;
|
|
666
588
|
}
|
|
667
|
-
const
|
|
589
|
+
const Hn = c.div`
|
|
668
590
|
display: flex;
|
|
669
591
|
flex-direction: column;
|
|
670
592
|
width: 100%;
|
|
@@ -675,29 +597,29 @@ const Yn = c.div`
|
|
|
675
597
|
&::-webkit-scrollbar-track {
|
|
676
598
|
margin: var(--spacing-xxs) 0;
|
|
677
599
|
}
|
|
678
|
-
`,
|
|
600
|
+
`, ue = c.div`
|
|
679
601
|
display: flex;
|
|
680
602
|
font-size: var(--font-size-sm);
|
|
681
603
|
line-height: var(--line-height-sm);
|
|
682
604
|
font-weight: var(--font-weight-regular);
|
|
683
605
|
padding-right: var(--spacing-xxs);
|
|
684
|
-
`,
|
|
606
|
+
`, Nn = c(ue)`
|
|
685
607
|
background: var(--admonition-danger-bg-color);
|
|
686
608
|
color: var(--color-raspberry-7);
|
|
687
|
-
`,
|
|
609
|
+
`, Fn = c(ue)`
|
|
688
610
|
background: var(--admonition-success-bg-color);
|
|
689
611
|
color: var(--color-green-7);
|
|
690
|
-
`,
|
|
612
|
+
`, jn = c(ue)`
|
|
691
613
|
background: transparent;
|
|
692
614
|
color: var(--text-color-secondary);
|
|
693
|
-
`,
|
|
615
|
+
`, Wn = c.span`
|
|
694
616
|
display: flex;
|
|
695
617
|
align-items: center;
|
|
696
618
|
justify-content: center;
|
|
697
619
|
min-width: 16px;
|
|
698
620
|
height: 20px;
|
|
699
621
|
flex-shrink: 0;
|
|
700
|
-
`,
|
|
622
|
+
`, Le = c.span`
|
|
701
623
|
width: 100%;
|
|
702
624
|
min-width: 0;
|
|
703
625
|
line-height: var(--line-height-sm);
|
|
@@ -705,137 +627,144 @@ const Yn = c.div`
|
|
|
705
627
|
font-weight: var(--font-weight-regular);
|
|
706
628
|
white-space: pre-wrap;
|
|
707
629
|
word-break: break-all;
|
|
708
|
-
`,
|
|
630
|
+
`, Un = c(ue)`
|
|
709
631
|
user-select: none;
|
|
710
|
-
`,
|
|
711
|
-
function
|
|
632
|
+
`, Yn = (e) => typeof e != "object" || e === null ? !1 : "kind" in e && e.kind === "batch" ? "changes" in e ? Array.isArray(e.changes) && e.changes.every(Pe) : !1 : Pe(e);
|
|
633
|
+
function Pe(e) {
|
|
712
634
|
return typeof e != "object" || e === null || !("id" in e) || !("target" in e) || !("included" in e) || !("kind" in e) ? !1 : e.kind === "single";
|
|
713
635
|
}
|
|
714
|
-
const
|
|
636
|
+
const Gn = {
|
|
715
637
|
approveLabel: "Approve",
|
|
716
638
|
denyLabel: "Deny"
|
|
717
639
|
};
|
|
718
|
-
function
|
|
640
|
+
function qn(e, t) {
|
|
719
641
|
const n = T(t, "action");
|
|
720
642
|
if (n) {
|
|
721
|
-
const
|
|
722
|
-
if (
|
|
643
|
+
const r = zt[n];
|
|
644
|
+
if (r) return r;
|
|
723
645
|
}
|
|
724
|
-
const
|
|
725
|
-
return
|
|
646
|
+
const o = Mt[e];
|
|
647
|
+
return o || Gn;
|
|
726
648
|
}
|
|
727
649
|
function T(e, t) {
|
|
728
650
|
if (!e || typeof e != "object") return null;
|
|
729
651
|
const n = e.payload;
|
|
730
652
|
if (!n || typeof n != "object") return null;
|
|
731
|
-
const
|
|
732
|
-
return typeof
|
|
653
|
+
const o = n[t];
|
|
654
|
+
return typeof o != "string" ? null : o.trim() || null;
|
|
733
655
|
}
|
|
734
|
-
function
|
|
656
|
+
function oe(e, t) {
|
|
735
657
|
if (!(typeof t > "u"))
|
|
736
658
|
return e ? `${e}: ${t}` : t;
|
|
737
659
|
}
|
|
738
|
-
function
|
|
660
|
+
function Kn(e) {
|
|
739
661
|
return e ? "changes" in e ? Array.isArray(e.changes) ? e.changes.map((t) => !t || typeof t != "object" || !("approved" in t) ? !1 : t.approved === !0) : [] : [] : [];
|
|
740
662
|
}
|
|
741
|
-
function
|
|
663
|
+
function Zn(e, t) {
|
|
742
664
|
if (!e || typeof e != "object") return;
|
|
743
|
-
const n =
|
|
744
|
-
if (!(t in
|
|
745
|
-
const
|
|
746
|
-
if (Array.isArray(
|
|
747
|
-
return
|
|
665
|
+
const n = ce(e, ge), o = ce(n, ve);
|
|
666
|
+
if (!(t in o)) return;
|
|
667
|
+
const r = o[t];
|
|
668
|
+
if (Array.isArray(r) && r.length !== 0 && r.every(Yn))
|
|
669
|
+
return r;
|
|
748
670
|
}
|
|
749
|
-
function
|
|
750
|
-
return
|
|
671
|
+
function Qe(e, t) {
|
|
672
|
+
return _t(e) && qe(e) && e.toolCallId === t;
|
|
751
673
|
}
|
|
752
|
-
function
|
|
753
|
-
const
|
|
674
|
+
function Jn(e, t, n) {
|
|
675
|
+
const o = e.parts.map((l) => Qe(l, t) ? { ...l, input: Xn(l.input, n) } : l), r = e.metadata && typeof e.metadata == "object" ? e.metadata : {}, a = ce(r, ge), d = { ...ce(a, ve), [t]: It(n) };
|
|
754
676
|
return {
|
|
755
677
|
...e,
|
|
756
|
-
parts:
|
|
678
|
+
parts: o,
|
|
757
679
|
metadata: {
|
|
758
|
-
...
|
|
759
|
-
[
|
|
680
|
+
...r,
|
|
681
|
+
[ge]: {
|
|
760
682
|
...a,
|
|
761
|
-
[
|
|
683
|
+
[ve]: d
|
|
762
684
|
}
|
|
763
685
|
}
|
|
764
686
|
};
|
|
765
687
|
}
|
|
766
|
-
function
|
|
688
|
+
function ce(e, t) {
|
|
767
689
|
const n = e[t];
|
|
768
690
|
return typeof n == "object" && n !== null ? n : {};
|
|
769
691
|
}
|
|
770
|
-
function
|
|
692
|
+
function Xn(e, t) {
|
|
771
693
|
if (!e || !("changes" in e) || !Array.isArray(e.changes)) return e;
|
|
772
|
-
const { changes: n, ...
|
|
694
|
+
const { changes: n, ...o } = e;
|
|
773
695
|
return {
|
|
774
|
-
...
|
|
775
|
-
changes: n.map((
|
|
776
|
-
...
|
|
696
|
+
...o,
|
|
697
|
+
changes: n.map((r, a) => ({
|
|
698
|
+
...r,
|
|
777
699
|
approved: t[a]?.included ?? !1
|
|
778
700
|
}))
|
|
779
701
|
};
|
|
780
702
|
}
|
|
781
|
-
function
|
|
703
|
+
function Qn({
|
|
782
704
|
preview: e,
|
|
783
705
|
isIncluded: t,
|
|
784
706
|
onToggle: n,
|
|
785
|
-
readOnly:
|
|
707
|
+
readOnly: o
|
|
786
708
|
}) {
|
|
787
|
-
|
|
788
|
-
return /* @__PURE__ */ i(
|
|
789
|
-
Pe,
|
|
790
|
-
{
|
|
791
|
-
isIncluded: t,
|
|
792
|
-
onToggle: n,
|
|
793
|
-
readOnly: r,
|
|
794
|
-
primaryLabel: e.target.type,
|
|
795
|
-
children: /* @__PURE__ */ i(vr, { children: e.changes.map((l) => /* @__PURE__ */ i(
|
|
796
|
-
Ie,
|
|
797
|
-
{
|
|
798
|
-
oldValue: Le(l.target.key, l.oldValue),
|
|
799
|
-
newValue: Le(l.target.key, l.newValue)
|
|
800
|
-
},
|
|
801
|
-
l.id
|
|
802
|
-
)) })
|
|
803
|
-
}
|
|
804
|
-
);
|
|
805
|
-
const { target: o, oldValue: a, newValue: s } = e;
|
|
709
|
+
const { primaryLabel: r, categoryLabel: a, diffLineKey: s } = eo(e.target);
|
|
806
710
|
return /* @__PURE__ */ i(
|
|
807
|
-
|
|
711
|
+
to,
|
|
808
712
|
{
|
|
809
713
|
isIncluded: t,
|
|
810
714
|
onToggle: n,
|
|
811
|
-
readOnly:
|
|
812
|
-
primaryLabel:
|
|
813
|
-
categoryLabel:
|
|
814
|
-
children: /* @__PURE__ */ i(
|
|
715
|
+
readOnly: o,
|
|
716
|
+
primaryLabel: r,
|
|
717
|
+
categoryLabel: a,
|
|
718
|
+
children: e.kind === "batch" ? /* @__PURE__ */ i(po, { children: e.changes.map((d) => /* @__PURE__ */ i(
|
|
719
|
+
Se,
|
|
720
|
+
{
|
|
721
|
+
oldValue: oe(d.target.key, d.oldValue),
|
|
722
|
+
newValue: oe(d.target.key, d.newValue)
|
|
723
|
+
},
|
|
724
|
+
d.id
|
|
725
|
+
)) }) : /* @__PURE__ */ i(
|
|
726
|
+
Se,
|
|
727
|
+
{
|
|
728
|
+
oldValue: oe(s, e.oldValue),
|
|
729
|
+
newValue: oe(s, e.newValue)
|
|
730
|
+
}
|
|
731
|
+
)
|
|
815
732
|
}
|
|
816
733
|
);
|
|
817
734
|
}
|
|
818
|
-
function
|
|
735
|
+
function eo(e) {
|
|
736
|
+
const t = e.schemeId ?? e.type;
|
|
737
|
+
return e.stepId || e.schemeId ? {
|
|
738
|
+
primaryLabel: e.stepId ?? t,
|
|
739
|
+
categoryLabel: e.stepId ? t : void 0,
|
|
740
|
+
diffLineKey: e.key
|
|
741
|
+
} : {
|
|
742
|
+
primaryLabel: e.key ?? e.type,
|
|
743
|
+
categoryLabel: e.key ? e.type : void 0,
|
|
744
|
+
diffLineKey: void 0
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
function to({
|
|
819
748
|
isIncluded: e,
|
|
820
749
|
onToggle: t,
|
|
821
750
|
readOnly: n,
|
|
822
|
-
primaryLabel:
|
|
823
|
-
categoryLabel:
|
|
751
|
+
primaryLabel: o,
|
|
752
|
+
categoryLabel: r,
|
|
824
753
|
children: a
|
|
825
754
|
}) {
|
|
826
|
-
return /* @__PURE__ */ h(
|
|
827
|
-
/* @__PURE__ */ h(
|
|
828
|
-
n ? /* @__PURE__ */ i(
|
|
829
|
-
/* @__PURE__ */ i(
|
|
830
|
-
/* @__PURE__ */ i(
|
|
755
|
+
return /* @__PURE__ */ h(no, { $dimmed: n && !e, children: [
|
|
756
|
+
/* @__PURE__ */ h(oo, { children: [
|
|
757
|
+
n ? /* @__PURE__ */ i(lo, { children: e ? /* @__PURE__ */ i(uo, { size: "16px" }) : /* @__PURE__ */ i(fo, { size: "16px" }) }) : /* @__PURE__ */ h(so, { children: [
|
|
758
|
+
/* @__PURE__ */ i(ao, { checked: e }),
|
|
759
|
+
/* @__PURE__ */ i(co, { type: "checkbox", checked: e, onChange: t })
|
|
831
760
|
] }),
|
|
832
|
-
/* @__PURE__ */ i(
|
|
833
|
-
|
|
761
|
+
/* @__PURE__ */ i(ro, { children: o }),
|
|
762
|
+
r ? /* @__PURE__ */ i(io, { children: r }) : null
|
|
834
763
|
] }),
|
|
835
764
|
a
|
|
836
765
|
] });
|
|
837
766
|
}
|
|
838
|
-
const
|
|
767
|
+
const no = c.div`
|
|
839
768
|
display: flex;
|
|
840
769
|
flex-direction: column;
|
|
841
770
|
gap: var(--spacing-xs);
|
|
@@ -847,12 +776,12 @@ const ar = c.div`
|
|
|
847
776
|
&:last-child {
|
|
848
777
|
border-bottom: none;
|
|
849
778
|
}
|
|
850
|
-
`,
|
|
779
|
+
`, oo = c.div`
|
|
851
780
|
display: flex;
|
|
852
781
|
align-items: center;
|
|
853
782
|
gap: var(--spacing-xs);
|
|
854
783
|
min-width: 0;
|
|
855
|
-
`,
|
|
784
|
+
`, ro = c.span`
|
|
856
785
|
flex: 1;
|
|
857
786
|
min-width: 0;
|
|
858
787
|
color: var(--text-color-primary);
|
|
@@ -862,24 +791,24 @@ const ar = c.div`
|
|
|
862
791
|
overflow: hidden;
|
|
863
792
|
text-overflow: ellipsis;
|
|
864
793
|
white-space: nowrap;
|
|
865
|
-
`,
|
|
794
|
+
`, io = c.span`
|
|
866
795
|
flex-shrink: 0;
|
|
867
796
|
font-family: var(--code-block-font-family, var(--font-family-monospace, monospace));
|
|
868
797
|
font-size: var(--font-size-sm);
|
|
869
798
|
font-weight: var(--font-weight-regular);
|
|
870
799
|
line-height: var(--line-height-sm);
|
|
871
800
|
color: var(--text-color-secondary);
|
|
872
|
-
`,
|
|
801
|
+
`, ao = c(Kt).attrs({ "aria-hidden": !0 })`
|
|
873
802
|
--checkbox-border-color: var(--color-blueberry-6);
|
|
874
803
|
--checkbox-box-color: var(--color-blueberry-6);
|
|
875
804
|
--checkbox-box-color-active: var(--color-blueberry-6);
|
|
876
|
-
`,
|
|
805
|
+
`, so = c.span`
|
|
877
806
|
position: relative;
|
|
878
807
|
display: inline-flex;
|
|
879
808
|
flex-shrink: 0;
|
|
880
809
|
width: 16px;
|
|
881
810
|
height: 16px;
|
|
882
|
-
`,
|
|
811
|
+
`, co = c.input`
|
|
883
812
|
position: absolute;
|
|
884
813
|
inset: 0;
|
|
885
814
|
width: 16px;
|
|
@@ -887,142 +816,151 @@ const ar = c.div`
|
|
|
887
816
|
margin: 0;
|
|
888
817
|
opacity: 0;
|
|
889
818
|
cursor: pointer;
|
|
890
|
-
`,
|
|
819
|
+
`, lo = c.span`
|
|
891
820
|
display: inline-flex;
|
|
892
821
|
flex-shrink: 0;
|
|
893
822
|
width: 16px;
|
|
894
823
|
height: 16px;
|
|
895
824
|
align-items: center;
|
|
896
825
|
justify-content: center;
|
|
897
|
-
`,
|
|
826
|
+
`, uo = c(Gt)`
|
|
898
827
|
color: var(--color-success-base);
|
|
899
|
-
`,
|
|
828
|
+
`, fo = c(qt)`
|
|
900
829
|
color: var(--text-color-description);
|
|
901
|
-
`,
|
|
830
|
+
`, po = c.div`
|
|
902
831
|
display: flex;
|
|
903
832
|
flex-direction: column;
|
|
904
833
|
gap: var(--spacing-xxs);
|
|
905
834
|
min-width: 0;
|
|
906
835
|
`;
|
|
907
|
-
function
|
|
836
|
+
function et({
|
|
908
837
|
previews: e,
|
|
909
838
|
handleToggle: t,
|
|
910
839
|
readOnly: n
|
|
911
840
|
}) {
|
|
912
|
-
return e.length === 0 ? null : /* @__PURE__ */ i(
|
|
913
|
-
|
|
841
|
+
return e.length === 0 ? null : /* @__PURE__ */ i(ho, { children: e.map((o, r) => /* @__PURE__ */ i(
|
|
842
|
+
Qn,
|
|
914
843
|
{
|
|
915
|
-
preview:
|
|
916
|
-
isIncluded:
|
|
917
|
-
onToggle: t ? () => t(
|
|
844
|
+
preview: o,
|
|
845
|
+
isIncluded: o.included,
|
|
846
|
+
onToggle: t ? () => t(r) : void 0,
|
|
918
847
|
readOnly: n
|
|
919
848
|
},
|
|
920
|
-
|
|
849
|
+
o.id
|
|
921
850
|
)) });
|
|
922
851
|
}
|
|
923
|
-
const
|
|
852
|
+
const ho = c.div`
|
|
924
853
|
display: flex;
|
|
925
854
|
flex-direction: column;
|
|
926
|
-
`,
|
|
927
|
-
update_step:
|
|
928
|
-
update_security:
|
|
929
|
-
run_request:
|
|
930
|
-
web_search:
|
|
931
|
-
manage_environment:
|
|
932
|
-
manage_collection:
|
|
855
|
+
`, go = {
|
|
856
|
+
update_step: yo,
|
|
857
|
+
update_security: xo,
|
|
858
|
+
run_request: ko,
|
|
859
|
+
web_search: To,
|
|
860
|
+
manage_environment: wo,
|
|
861
|
+
manage_collection: Co
|
|
933
862
|
};
|
|
934
|
-
function
|
|
935
|
-
const n =
|
|
936
|
-
return n ? n(t) :
|
|
863
|
+
function vo(e, t) {
|
|
864
|
+
const n = go[e];
|
|
865
|
+
return n ? n(t) : mo(e);
|
|
937
866
|
}
|
|
938
|
-
function
|
|
867
|
+
function mo(e) {
|
|
939
868
|
return [{ kind: "text", text: e.split("_").map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join(" ") }];
|
|
940
869
|
}
|
|
941
|
-
function
|
|
942
|
-
return
|
|
870
|
+
function yo(e) {
|
|
871
|
+
return tt(e, "Update step");
|
|
943
872
|
}
|
|
944
|
-
function
|
|
945
|
-
|
|
873
|
+
function xo(e) {
|
|
874
|
+
const t = bo(e);
|
|
875
|
+
if (t.size > 1) return I("Update security");
|
|
876
|
+
const [n] = t;
|
|
877
|
+
return tt(e, "Update security", n);
|
|
946
878
|
}
|
|
947
|
-
function
|
|
948
|
-
const
|
|
949
|
-
|
|
879
|
+
function bo(e) {
|
|
880
|
+
const t = e && "changes" in e ? e.changes : void 0;
|
|
881
|
+
if (!Array.isArray(t)) return /* @__PURE__ */ new Set();
|
|
882
|
+
const n = Z(e, "stepId"), o = t.map((r) => Z(r, "stepId") ?? n);
|
|
883
|
+
return new Set(o.filter((r) => !!r));
|
|
884
|
+
}
|
|
885
|
+
function tt(e, t, n) {
|
|
886
|
+
const { collectionId: o, workflowId: r, stepId: a } = Io(e), s = n ?? a;
|
|
887
|
+
return !o || !r || !s ? I(t) : nt(
|
|
950
888
|
`${t} `,
|
|
951
|
-
|
|
952
|
-
|
|
889
|
+
Je({ collectionId: o, workflowId: r, stepId: s }),
|
|
890
|
+
s
|
|
953
891
|
);
|
|
954
892
|
}
|
|
955
893
|
function I(e) {
|
|
956
894
|
return [{ kind: "text", text: e }];
|
|
957
895
|
}
|
|
958
|
-
function
|
|
896
|
+
function P(e, t) {
|
|
959
897
|
return t ? `${e} "${t}"` : e;
|
|
960
898
|
}
|
|
961
|
-
function
|
|
899
|
+
function nt(e, t, n) {
|
|
962
900
|
return [
|
|
963
901
|
{ kind: "text", text: e },
|
|
964
902
|
{ kind: "link", href: t, label: n }
|
|
965
903
|
];
|
|
966
904
|
}
|
|
967
|
-
function
|
|
968
|
-
const t = T(e, "action"), n = T(e, "environment"),
|
|
905
|
+
function wo(e) {
|
|
906
|
+
const t = T(e, "action"), n = T(e, "environment"), o = n ? ` in environment "${n}"` : "";
|
|
969
907
|
switch (t) {
|
|
970
908
|
case "add_environment":
|
|
971
|
-
return I(
|
|
909
|
+
return I(P("Add environment", n));
|
|
972
910
|
case "set_active_environment":
|
|
973
911
|
return I(
|
|
974
912
|
n ? `Switch active environment to ${n}` : "Switch active environment"
|
|
975
913
|
);
|
|
976
914
|
case "upsert_input":
|
|
977
|
-
return I(
|
|
915
|
+
return I(P("Set input", T(e, "name")) + o);
|
|
978
916
|
case "remove_input":
|
|
979
917
|
return I(
|
|
980
|
-
|
|
918
|
+
P("Remove input", T(e, "inputName")) + o
|
|
981
919
|
);
|
|
982
920
|
case "upsert_server":
|
|
983
|
-
return I(
|
|
921
|
+
return I(P("Set server", T(e, "apiId")) + o);
|
|
984
922
|
case "remove_server":
|
|
985
923
|
return I(
|
|
986
|
-
|
|
924
|
+
P("Remove server", T(e, "apiId")) + o
|
|
987
925
|
);
|
|
988
926
|
default:
|
|
989
927
|
return I("Manage environment");
|
|
990
928
|
}
|
|
991
929
|
}
|
|
992
|
-
function
|
|
930
|
+
function Co(e) {
|
|
993
931
|
switch (T(e, "action")) {
|
|
994
932
|
case "create_collection":
|
|
995
|
-
return I(
|
|
933
|
+
return I(P("Create collection", T(e, "title")));
|
|
996
934
|
case "delete_collection":
|
|
997
935
|
return I(
|
|
998
|
-
|
|
936
|
+
P("Delete collection", T(e, "collectionId"))
|
|
999
937
|
);
|
|
1000
938
|
case "create_workflow":
|
|
1001
|
-
return I(
|
|
939
|
+
return I(P("Create workflow", T(e, "name")));
|
|
1002
940
|
case "delete_workflow":
|
|
1003
|
-
return I(
|
|
941
|
+
return I(P("Delete workflow", T(e, "workflowId")));
|
|
1004
942
|
case "create_step":
|
|
1005
|
-
return I(
|
|
943
|
+
return I(P("Create step", T(e, "stepName")));
|
|
1006
944
|
case "delete_step": {
|
|
1007
|
-
const n = T(e, "collectionId"),
|
|
1008
|
-
return !n || !
|
|
945
|
+
const n = T(e, "collectionId"), o = T(e, "workflowId"), r = T(e, "stepId");
|
|
946
|
+
return !n || !o || !r ? I("Delete step") : nt(
|
|
1009
947
|
"Delete step ",
|
|
1010
|
-
|
|
1011
|
-
|
|
948
|
+
Je({ collectionId: n, workflowId: o, stepId: r }),
|
|
949
|
+
r
|
|
1012
950
|
);
|
|
1013
951
|
}
|
|
1014
952
|
case "save_tab_to_collection":
|
|
1015
953
|
return I(
|
|
1016
|
-
|
|
954
|
+
P("Save tab as step", T(e, "newStepName"))
|
|
1017
955
|
);
|
|
1018
956
|
default:
|
|
1019
957
|
return I("Manage collection");
|
|
1020
958
|
}
|
|
1021
959
|
}
|
|
1022
|
-
function
|
|
960
|
+
function ko() {
|
|
1023
961
|
return [{ kind: "text", text: "Run current request" }];
|
|
1024
962
|
}
|
|
1025
|
-
function
|
|
963
|
+
function To(e) {
|
|
1026
964
|
return [
|
|
1027
965
|
{
|
|
1028
966
|
kind: "text",
|
|
@@ -1035,25 +973,25 @@ function Sr(e) {
|
|
|
1035
973
|
}
|
|
1036
974
|
];
|
|
1037
975
|
}
|
|
1038
|
-
function
|
|
976
|
+
function Io(e) {
|
|
1039
977
|
return {
|
|
1040
|
-
collectionId:
|
|
1041
|
-
workflowId:
|
|
1042
|
-
stepId:
|
|
978
|
+
collectionId: Z(e, "collectionId"),
|
|
979
|
+
workflowId: Z(e, "workflowId"),
|
|
980
|
+
stepId: Z(e, "stepId")
|
|
1043
981
|
};
|
|
1044
982
|
}
|
|
1045
|
-
function
|
|
1046
|
-
if (
|
|
983
|
+
function Z(e, t) {
|
|
984
|
+
if (typeof e != "object" || e === null || !(t in e)) return null;
|
|
1047
985
|
const n = e[t];
|
|
1048
986
|
return typeof n == "string" && n.trim() || null;
|
|
1049
987
|
}
|
|
1050
|
-
function
|
|
1051
|
-
const n =
|
|
1052
|
-
return /* @__PURE__ */ i(
|
|
1053
|
-
(
|
|
988
|
+
function ot({ toolName: e, input: t }) {
|
|
989
|
+
const n = vo(e, t), o = Xe();
|
|
990
|
+
return /* @__PURE__ */ i(Ao, { onClick: o, children: /* @__PURE__ */ i(So, { children: n.map(
|
|
991
|
+
(r, a) => r.kind === "text" ? /* @__PURE__ */ i("span", { children: r.text }, a) : /* @__PURE__ */ i(Lo, { href: r.href, children: r.label }, a)
|
|
1054
992
|
) }) });
|
|
1055
993
|
}
|
|
1056
|
-
const
|
|
994
|
+
const Ao = c.div`
|
|
1057
995
|
display: flex;
|
|
1058
996
|
flex-direction: column;
|
|
1059
997
|
gap: 0;
|
|
@@ -1063,13 +1001,13 @@ const Lr = c.div`
|
|
|
1063
1001
|
&:not(:last-child) {
|
|
1064
1002
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
1065
1003
|
}
|
|
1066
|
-
`,
|
|
1004
|
+
`, So = c.span`
|
|
1067
1005
|
font-family: var(--font-family-base);
|
|
1068
1006
|
font-size: var(--font-size-sm);
|
|
1069
1007
|
font-weight: var(--font-weight-regular);
|
|
1070
1008
|
line-height: var(--line-height-sm);
|
|
1071
1009
|
color: var(--text-color-primary);
|
|
1072
|
-
`,
|
|
1010
|
+
`, Lo = c.a`
|
|
1073
1011
|
color: var(--link-color-primary);
|
|
1074
1012
|
cursor: pointer;
|
|
1075
1013
|
text-decoration: none;
|
|
@@ -1078,145 +1016,175 @@ const Lr = c.div`
|
|
|
1078
1016
|
color: var(--link-color-primary, var(--text-color-link));
|
|
1079
1017
|
}
|
|
1080
1018
|
`;
|
|
1019
|
+
function rt(e, t, n) {
|
|
1020
|
+
const o = { type: e };
|
|
1021
|
+
return t !== void 0 && (o.key = t), n && (o.stepId = n), o;
|
|
1022
|
+
}
|
|
1081
1023
|
function C({
|
|
1082
1024
|
id: e,
|
|
1083
1025
|
targetType: t,
|
|
1084
1026
|
targetKey: n,
|
|
1027
|
+
targetStepId: o,
|
|
1085
1028
|
oldValue: r,
|
|
1086
|
-
newValue:
|
|
1029
|
+
newValue: a
|
|
1087
1030
|
}) {
|
|
1088
1031
|
return {
|
|
1089
1032
|
kind: "single",
|
|
1090
1033
|
id: e,
|
|
1091
|
-
target:
|
|
1034
|
+
target: rt(t, n, o),
|
|
1092
1035
|
oldValue: r,
|
|
1093
|
-
newValue:
|
|
1036
|
+
newValue: a,
|
|
1094
1037
|
included: !0
|
|
1095
1038
|
};
|
|
1096
1039
|
}
|
|
1097
|
-
function
|
|
1098
|
-
return C({ id: e, targetType: t, oldValue: void 0, newValue: void 0 });
|
|
1040
|
+
function V(e, t, n) {
|
|
1041
|
+
return C({ id: e, targetType: t, targetStepId: n, oldValue: void 0, newValue: void 0 });
|
|
1099
1042
|
}
|
|
1100
|
-
function
|
|
1043
|
+
function Y({
|
|
1101
1044
|
data: e,
|
|
1102
1045
|
baseId: t,
|
|
1103
1046
|
targetType: n,
|
|
1104
|
-
batchTargetKey:
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1047
|
+
batchTargetKey: o,
|
|
1048
|
+
targetStepId: r,
|
|
1049
|
+
getOldValue: a,
|
|
1050
|
+
getNewValue: s = (l, u) => String(u ?? ""),
|
|
1051
|
+
resolveTargetKey: d = (l) => l
|
|
1108
1052
|
}) {
|
|
1109
|
-
const l = Object.entries(e).filter(([,
|
|
1053
|
+
const l = Object.entries(e).filter(([, p]) => p !== void 0);
|
|
1110
1054
|
if (l.length === 0)
|
|
1111
|
-
return
|
|
1055
|
+
return V(t, n, r);
|
|
1112
1056
|
if (l.length >= 2) {
|
|
1113
|
-
const
|
|
1057
|
+
const p = l.map(
|
|
1114
1058
|
([g, m]) => C({
|
|
1115
1059
|
id: `${t}:${g}`,
|
|
1116
1060
|
targetType: n,
|
|
1117
|
-
targetKey:
|
|
1118
|
-
oldValue:
|
|
1119
|
-
newValue:
|
|
1061
|
+
targetKey: d(g),
|
|
1062
|
+
oldValue: a(g),
|
|
1063
|
+
newValue: s(g, m)
|
|
1120
1064
|
})
|
|
1121
1065
|
);
|
|
1122
|
-
return {
|
|
1066
|
+
return {
|
|
1067
|
+
kind: "batch",
|
|
1068
|
+
id: t,
|
|
1069
|
+
target: rt(n, o, r),
|
|
1070
|
+
changes: p,
|
|
1071
|
+
included: !0
|
|
1072
|
+
};
|
|
1123
1073
|
}
|
|
1124
|
-
const [
|
|
1074
|
+
const [u, f] = l[0];
|
|
1125
1075
|
return C({
|
|
1126
1076
|
id: t,
|
|
1127
1077
|
targetType: n,
|
|
1128
|
-
targetKey:
|
|
1129
|
-
|
|
1130
|
-
|
|
1078
|
+
targetKey: d(u),
|
|
1079
|
+
targetStepId: r,
|
|
1080
|
+
oldValue: a(u),
|
|
1081
|
+
newValue: s(u, f)
|
|
1131
1082
|
});
|
|
1132
1083
|
}
|
|
1133
|
-
function
|
|
1084
|
+
function Po({
|
|
1134
1085
|
store: e,
|
|
1135
1086
|
input: t
|
|
1136
1087
|
}) {
|
|
1137
|
-
if (!
|
|
1138
|
-
const n = /* @__PURE__ */ new Map(),
|
|
1139
|
-
const a = n.get(
|
|
1088
|
+
if (!Eo(t)) return [];
|
|
1089
|
+
const n = /* @__PURE__ */ new Map(), o = (r) => {
|
|
1090
|
+
const a = n.get(r);
|
|
1140
1091
|
if (a) return a;
|
|
1141
|
-
const s =
|
|
1142
|
-
return n.set(
|
|
1092
|
+
const s = Ke(e, t.collectionId, t.workflowId, r), d = s.ok ? s.value : null, l = d ? Array.from(d.security.get({ noproxy: !0 })) : [];
|
|
1093
|
+
return n.set(r, l), l;
|
|
1143
1094
|
};
|
|
1144
|
-
return t.changes.map((
|
|
1145
|
-
const s =
|
|
1146
|
-
return
|
|
1095
|
+
return t.changes.map((r, a) => {
|
|
1096
|
+
const s = r.stepId?.trim(), d = s || t.stepId;
|
|
1097
|
+
return Ro(o(d), r, a, s);
|
|
1147
1098
|
});
|
|
1148
1099
|
}
|
|
1149
|
-
function
|
|
1100
|
+
function Eo(e) {
|
|
1150
1101
|
if (typeof e != "object" || e === null) return !1;
|
|
1151
1102
|
const t = e;
|
|
1152
1103
|
return typeof t.collectionId == "string" && typeof t.workflowId == "string" && typeof t.stepId == "string" && Array.isArray(t.changes) && t.changes.length > 0;
|
|
1153
1104
|
}
|
|
1154
|
-
function
|
|
1155
|
-
|
|
1156
|
-
}
|
|
1157
|
-
function $r(e, t, n, r) {
|
|
1158
|
-
const o = `security[${n}]`;
|
|
1105
|
+
function Ro(e, t, n, o) {
|
|
1106
|
+
const r = `security[${n}]`;
|
|
1159
1107
|
switch (t.action) {
|
|
1160
1108
|
case k.ADD: {
|
|
1161
|
-
const { type: a, schemeId: s, data:
|
|
1162
|
-
return !
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1109
|
+
const { type: a, schemeId: s, data: d } = t;
|
|
1110
|
+
return !d || Object.keys(d).length === 0 ? K(
|
|
1111
|
+
C({
|
|
1112
|
+
id: r,
|
|
1113
|
+
targetType: a,
|
|
1114
|
+
targetStepId: o,
|
|
1115
|
+
oldValue: void 0,
|
|
1116
|
+
newValue: a
|
|
1117
|
+
}),
|
|
1118
|
+
s
|
|
1119
|
+
) : K(
|
|
1120
|
+
Y({
|
|
1121
|
+
data: d,
|
|
1122
|
+
baseId: r,
|
|
1123
|
+
targetType: a,
|
|
1124
|
+
targetStepId: o,
|
|
1125
|
+
getOldValue: () => {
|
|
1126
|
+
}
|
|
1127
|
+
}),
|
|
1128
|
+
s
|
|
1129
|
+
);
|
|
1177
1130
|
}
|
|
1178
1131
|
case k.UPDATE: {
|
|
1179
|
-
const { type: a,
|
|
1180
|
-
return !
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1132
|
+
const { type: a, data: s } = t, d = t.index !== void 0 ? e[t.index] : void 0, l = t.schemeId || ye(d);
|
|
1133
|
+
return !s || Object.keys(s).length === 0 ? K(
|
|
1134
|
+
C({
|
|
1135
|
+
id: r,
|
|
1136
|
+
targetType: a,
|
|
1137
|
+
targetStepId: o,
|
|
1138
|
+
oldValue: Re(d),
|
|
1139
|
+
newValue: a
|
|
1140
|
+
}),
|
|
1141
|
+
l
|
|
1142
|
+
) : K(
|
|
1143
|
+
Y({
|
|
1144
|
+
data: s,
|
|
1145
|
+
baseId: r,
|
|
1146
|
+
targetType: a,
|
|
1147
|
+
targetStepId: o,
|
|
1148
|
+
getOldValue: (u) => d ? Oo(d, u) : void 0
|
|
1149
|
+
}),
|
|
1150
|
+
l
|
|
1151
|
+
);
|
|
1194
1152
|
}
|
|
1195
1153
|
case k.REMOVE: {
|
|
1196
|
-
const a =
|
|
1197
|
-
return
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1154
|
+
const a = Vt(e, t), s = a.ok ? a.entry : void 0;
|
|
1155
|
+
return K(
|
|
1156
|
+
C({
|
|
1157
|
+
id: r,
|
|
1158
|
+
targetType: s?.securityType ?? "Security",
|
|
1159
|
+
targetStepId: o,
|
|
1160
|
+
oldValue: Re(s),
|
|
1161
|
+
newValue: void 0
|
|
1162
|
+
}),
|
|
1163
|
+
ye(s)
|
|
1164
|
+
);
|
|
1204
1165
|
}
|
|
1205
1166
|
}
|
|
1206
1167
|
}
|
|
1207
|
-
function
|
|
1168
|
+
function K(e, t) {
|
|
1169
|
+
return t ? { ...e, target: { ...e.target, schemeId: t } } : e;
|
|
1170
|
+
}
|
|
1171
|
+
function Oo(e, t) {
|
|
1208
1172
|
switch (e.securityType) {
|
|
1209
|
-
case
|
|
1173
|
+
case M.NoAuth:
|
|
1210
1174
|
return;
|
|
1211
|
-
case
|
|
1212
|
-
return Ee(e[
|
|
1213
|
-
case
|
|
1214
|
-
const n = e[
|
|
1175
|
+
case M.OAuth2:
|
|
1176
|
+
return Ee(e[M.OAuth2], t);
|
|
1177
|
+
case M.OpenIDConnect: {
|
|
1178
|
+
const n = e[M.OpenIDConnect];
|
|
1215
1179
|
return t === "openIdConnectUrl" ? n.openIdConnectUrl || void 0 : t === "userInfoUrl" ? n.userInfoUrl || void 0 : Ee(n, t);
|
|
1216
1180
|
}
|
|
1181
|
+
case M.APIKey: {
|
|
1182
|
+
const n = e[M.APIKey];
|
|
1183
|
+
return t === "location" ? ie(n, t)?.toLowerCase() : ie(n, t);
|
|
1184
|
+
}
|
|
1217
1185
|
default: {
|
|
1218
1186
|
const n = e[e.securityType];
|
|
1219
|
-
return
|
|
1187
|
+
return ie(n, t);
|
|
1220
1188
|
}
|
|
1221
1189
|
}
|
|
1222
1190
|
}
|
|
@@ -1224,112 +1192,112 @@ function Ee(e, t) {
|
|
|
1224
1192
|
if (t === "grantType") return e.grantType || void 0;
|
|
1225
1193
|
if (!e.grantType) return;
|
|
1226
1194
|
const n = e[e.grantType];
|
|
1227
|
-
return
|
|
1195
|
+
return ie(n, t);
|
|
1228
1196
|
}
|
|
1229
|
-
function
|
|
1197
|
+
function ie(e, t) {
|
|
1230
1198
|
const n = e[t];
|
|
1231
1199
|
return n !== void 0 && n !== "" ? String(n) : void 0;
|
|
1232
1200
|
}
|
|
1233
1201
|
function Re(e) {
|
|
1234
|
-
if (!e || e.securityType ===
|
|
1235
|
-
const t =
|
|
1202
|
+
if (!e || e.securityType === M.NoAuth) return;
|
|
1203
|
+
const t = ye(e);
|
|
1236
1204
|
return t ? `${e.securityType} (${t})` : e.securityType;
|
|
1237
1205
|
}
|
|
1238
|
-
function
|
|
1239
|
-
return !e || e.securityType ===
|
|
1206
|
+
function ye(e) {
|
|
1207
|
+
return !e || e.securityType === M.NoAuth ? void 0 : e[e.securityType]?.schemeName || void 0;
|
|
1240
1208
|
}
|
|
1241
|
-
function
|
|
1209
|
+
function $o({
|
|
1242
1210
|
store: e,
|
|
1243
1211
|
input: t
|
|
1244
1212
|
}) {
|
|
1245
|
-
if (!
|
|
1246
|
-
const n =
|
|
1247
|
-
return t.changes.map((
|
|
1213
|
+
if (!Do(t)) return [];
|
|
1214
|
+
const n = Ke(e, t.collectionId, t.workflowId, t.stepId), o = n.ok ? n.value : null;
|
|
1215
|
+
return t.changes.map((r, a) => zo(o, r, a));
|
|
1248
1216
|
}
|
|
1249
|
-
function
|
|
1217
|
+
function Do(e) {
|
|
1250
1218
|
return typeof e != "object" || e === null ? !1 : "collectionId" in e && "workflowId" in e && "stepId" in e && "changes" in e && Array.isArray(e.changes) && e.changes.length > 0 && typeof e.collectionId == "string" && typeof e.workflowId == "string" && typeof e.stepId == "string";
|
|
1251
1219
|
}
|
|
1252
|
-
function
|
|
1253
|
-
const
|
|
1220
|
+
function zo(e, t, n) {
|
|
1221
|
+
const o = t.id ?? `${t.field}[${n}]`;
|
|
1254
1222
|
switch (t.field) {
|
|
1255
1223
|
case "method":
|
|
1256
1224
|
case "url":
|
|
1257
1225
|
case "description":
|
|
1258
|
-
return
|
|
1226
|
+
return Mo(e, t, o);
|
|
1259
1227
|
case "parameters":
|
|
1260
|
-
return
|
|
1228
|
+
return _o(e, t, o);
|
|
1261
1229
|
case "outputs":
|
|
1262
|
-
return
|
|
1230
|
+
return Vo(e, t, o);
|
|
1263
1231
|
case "body":
|
|
1264
|
-
return
|
|
1232
|
+
return Bo(e, t, o);
|
|
1265
1233
|
case "successCriteria":
|
|
1266
|
-
return
|
|
1234
|
+
return Ho(e, t, o);
|
|
1267
1235
|
}
|
|
1268
1236
|
}
|
|
1269
|
-
function
|
|
1270
|
-
const
|
|
1237
|
+
function Mo(e, t, n) {
|
|
1238
|
+
const o = re(t.field);
|
|
1271
1239
|
switch (t.action) {
|
|
1272
1240
|
case k.ADD:
|
|
1273
1241
|
return C({
|
|
1274
1242
|
id: n,
|
|
1275
|
-
targetType:
|
|
1243
|
+
targetType: o,
|
|
1276
1244
|
oldValue: void 0,
|
|
1277
1245
|
newValue: t.data
|
|
1278
1246
|
});
|
|
1279
1247
|
case k.UPDATE:
|
|
1280
1248
|
return C({
|
|
1281
1249
|
id: n,
|
|
1282
|
-
targetType:
|
|
1250
|
+
targetType: o,
|
|
1283
1251
|
oldValue: Oe(e, t.field),
|
|
1284
1252
|
newValue: t.data
|
|
1285
1253
|
});
|
|
1286
1254
|
case k.REMOVE:
|
|
1287
1255
|
return C({
|
|
1288
1256
|
id: n,
|
|
1289
|
-
targetType:
|
|
1257
|
+
targetType: o,
|
|
1290
1258
|
oldValue: Oe(e, t.field),
|
|
1291
1259
|
newValue: void 0
|
|
1292
1260
|
});
|
|
1293
1261
|
}
|
|
1294
1262
|
}
|
|
1295
|
-
function
|
|
1263
|
+
function _o(e, t, n) {
|
|
1296
1264
|
switch (t.action) {
|
|
1297
1265
|
case k.ADD: {
|
|
1298
|
-
if (!t.data) return
|
|
1299
|
-
const { in:
|
|
1266
|
+
if (!t.data) return V(n, "parameter");
|
|
1267
|
+
const { in: o, name: r, value: a } = t.data;
|
|
1300
1268
|
return C({
|
|
1301
1269
|
id: n,
|
|
1302
|
-
targetType:
|
|
1303
|
-
targetKey:
|
|
1270
|
+
targetType: re(o),
|
|
1271
|
+
targetKey: r,
|
|
1304
1272
|
oldValue: void 0,
|
|
1305
1273
|
newValue: a
|
|
1306
1274
|
});
|
|
1307
1275
|
}
|
|
1308
1276
|
case k.UPDATE: {
|
|
1309
|
-
if (!t.id && !t.data?.name) return
|
|
1310
|
-
const
|
|
1277
|
+
if (!t.id && !t.data?.name) return V(n, "parameter");
|
|
1278
|
+
const o = $e(e, t), r = t.data?.in ?? o?.in ?? "parameter";
|
|
1311
1279
|
return C({
|
|
1312
1280
|
id: n,
|
|
1313
|
-
targetType:
|
|
1314
|
-
targetKey: t.data?.name ??
|
|
1315
|
-
oldValue:
|
|
1281
|
+
targetType: re(r),
|
|
1282
|
+
targetKey: t.data?.name ?? o?.key,
|
|
1283
|
+
oldValue: o ? o.value ?? "" : void 0,
|
|
1316
1284
|
newValue: t.data?.value
|
|
1317
1285
|
});
|
|
1318
1286
|
}
|
|
1319
1287
|
case k.REMOVE: {
|
|
1320
|
-
if (!t.id && !t.data?.name) return
|
|
1321
|
-
const
|
|
1288
|
+
if (!t.id && !t.data?.name) return V(n, "parameter");
|
|
1289
|
+
const o = $e(e, t), r = t.data?.in ?? o?.in ?? "parameter";
|
|
1322
1290
|
return C({
|
|
1323
1291
|
id: n,
|
|
1324
|
-
targetType:
|
|
1325
|
-
targetKey:
|
|
1326
|
-
oldValue:
|
|
1292
|
+
targetType: re(r),
|
|
1293
|
+
targetKey: o?.key ?? t.data?.name,
|
|
1294
|
+
oldValue: o ? o.value ?? "" : void 0,
|
|
1327
1295
|
newValue: void 0
|
|
1328
1296
|
});
|
|
1329
1297
|
}
|
|
1330
1298
|
}
|
|
1331
1299
|
}
|
|
1332
|
-
function
|
|
1300
|
+
function Vo(e, t, n) {
|
|
1333
1301
|
switch (t.action) {
|
|
1334
1302
|
case k.ADD:
|
|
1335
1303
|
return t.data ? C({
|
|
@@ -1352,108 +1320,108 @@ function Br(e, t, n) {
|
|
|
1352
1320
|
oldValue: void 0,
|
|
1353
1321
|
newValue: void 0
|
|
1354
1322
|
});
|
|
1355
|
-
const
|
|
1323
|
+
const o = t.id && e ? ze(e, t.id) : void 0;
|
|
1356
1324
|
return C({
|
|
1357
1325
|
id: n,
|
|
1358
1326
|
targetType: "Output",
|
|
1359
1327
|
targetKey: t.data.name,
|
|
1360
|
-
oldValue:
|
|
1328
|
+
oldValue: o?.value,
|
|
1361
1329
|
newValue: t.data.expression
|
|
1362
1330
|
});
|
|
1363
1331
|
}
|
|
1364
1332
|
case k.REMOVE: {
|
|
1365
|
-
if (!t.id && !t.data?.name) return
|
|
1366
|
-
let
|
|
1367
|
-
return !
|
|
1333
|
+
if (!t.id && !t.data?.name) return V(n, "Output");
|
|
1334
|
+
let o = t.id && e ? ze(e, t.id) : void 0;
|
|
1335
|
+
return !o && e && t.data?.name && (o = jo(e, t.data.name)), C({
|
|
1368
1336
|
id: n,
|
|
1369
1337
|
targetType: "Output",
|
|
1370
|
-
targetKey:
|
|
1371
|
-
oldValue:
|
|
1338
|
+
targetKey: o?.key ?? t.data?.name,
|
|
1339
|
+
oldValue: o?.value,
|
|
1372
1340
|
newValue: void 0
|
|
1373
1341
|
});
|
|
1374
1342
|
}
|
|
1375
1343
|
}
|
|
1376
1344
|
}
|
|
1377
|
-
function
|
|
1378
|
-
const { data:
|
|
1345
|
+
function Bo(e, t, n) {
|
|
1346
|
+
const { data: o } = t;
|
|
1379
1347
|
switch (t.action) {
|
|
1380
1348
|
case k.ADD:
|
|
1381
|
-
return
|
|
1382
|
-
data:
|
|
1349
|
+
return Y({
|
|
1350
|
+
data: o,
|
|
1383
1351
|
baseId: n,
|
|
1384
1352
|
targetType: "Body",
|
|
1385
1353
|
getOldValue: () => {
|
|
1386
1354
|
},
|
|
1387
|
-
getNewValue: (
|
|
1388
|
-
resolveTargetKey: (
|
|
1355
|
+
getNewValue: (r) => r === "content" ? he(o.content, o.contentType) : de(o[r]),
|
|
1356
|
+
resolveTargetKey: (r) => r === "content" ? void 0 : r
|
|
1389
1357
|
});
|
|
1390
1358
|
case k.UPDATE: {
|
|
1391
|
-
const
|
|
1392
|
-
return
|
|
1393
|
-
data:
|
|
1359
|
+
const r = e?.requestBody.type.get(), a = o.contentType ?? r;
|
|
1360
|
+
return Y({
|
|
1361
|
+
data: o,
|
|
1394
1362
|
baseId: n,
|
|
1395
1363
|
targetType: "Body",
|
|
1396
1364
|
getOldValue: (s) => {
|
|
1397
1365
|
if (e) {
|
|
1398
1366
|
if (s === "content")
|
|
1399
|
-
return
|
|
1400
|
-
if (s === "contentType") return
|
|
1367
|
+
return he(e.requestBody.content.get(), r) || void 0;
|
|
1368
|
+
if (s === "contentType") return r;
|
|
1401
1369
|
}
|
|
1402
1370
|
},
|
|
1403
|
-
getNewValue: (s) => s === "content" ?
|
|
1371
|
+
getNewValue: (s) => s === "content" ? he(o.content, a) : de(o[s]),
|
|
1404
1372
|
resolveTargetKey: (s) => s === "content" ? void 0 : s
|
|
1405
1373
|
});
|
|
1406
1374
|
}
|
|
1407
1375
|
case k.REMOVE: {
|
|
1408
|
-
const
|
|
1376
|
+
const r = e ? be({
|
|
1409
1377
|
contentType: e.requestBody.type.get(),
|
|
1410
1378
|
content: e.requestBody.content.get()
|
|
1411
1379
|
}) : void 0;
|
|
1412
1380
|
return C({
|
|
1413
1381
|
id: n,
|
|
1414
1382
|
targetType: "Body",
|
|
1415
|
-
oldValue:
|
|
1383
|
+
oldValue: r,
|
|
1416
1384
|
newValue: void 0
|
|
1417
1385
|
});
|
|
1418
1386
|
}
|
|
1419
1387
|
}
|
|
1420
1388
|
}
|
|
1421
|
-
function
|
|
1389
|
+
function Ho(e, t, n) {
|
|
1422
1390
|
switch (t.action) {
|
|
1423
1391
|
case k.ADD:
|
|
1424
|
-
return t.data ?
|
|
1392
|
+
return t.data ? Y({
|
|
1425
1393
|
data: t.data,
|
|
1426
1394
|
baseId: n,
|
|
1427
1395
|
targetType: "successCriteria",
|
|
1428
1396
|
getOldValue: () => {
|
|
1429
1397
|
},
|
|
1430
|
-
getNewValue: (
|
|
1431
|
-
}) :
|
|
1398
|
+
getNewValue: (o) => de(t.data[o])
|
|
1399
|
+
}) : V(n, "successCriteria");
|
|
1432
1400
|
case k.UPDATE: {
|
|
1433
|
-
if (!t.data) return
|
|
1434
|
-
const
|
|
1435
|
-
return
|
|
1401
|
+
if (!t.data) return V(n, "successCriteria");
|
|
1402
|
+
const o = typeof t.id == "string" && e ? De(e, t.id) : void 0;
|
|
1403
|
+
return Y({
|
|
1436
1404
|
data: t.data,
|
|
1437
1405
|
baseId: n,
|
|
1438
1406
|
targetType: "successCriteria",
|
|
1439
|
-
getOldValue: (
|
|
1440
|
-
if (
|
|
1441
|
-
if (
|
|
1442
|
-
if (
|
|
1443
|
-
if (
|
|
1407
|
+
getOldValue: (r) => {
|
|
1408
|
+
if (o) {
|
|
1409
|
+
if (r === "condition") return o.condition;
|
|
1410
|
+
if (r === "context") return o.context ?? void 0;
|
|
1411
|
+
if (r === "type") return o.type;
|
|
1444
1412
|
}
|
|
1445
1413
|
},
|
|
1446
|
-
getNewValue: (
|
|
1414
|
+
getNewValue: (r) => de(t.data[r])
|
|
1447
1415
|
});
|
|
1448
1416
|
}
|
|
1449
1417
|
case k.REMOVE: {
|
|
1450
|
-
if (typeof t.id != "string") return
|
|
1451
|
-
const
|
|
1418
|
+
if (typeof t.id != "string") return V(n, "successCriteria");
|
|
1419
|
+
const o = e ? De(e, t.id) : void 0;
|
|
1452
1420
|
return C({
|
|
1453
1421
|
id: n,
|
|
1454
1422
|
targetType: "successCriteria",
|
|
1455
|
-
targetKey:
|
|
1456
|
-
oldValue:
|
|
1423
|
+
targetKey: o?.condition,
|
|
1424
|
+
oldValue: o ? be(o) : void 0,
|
|
1457
1425
|
newValue: void 0
|
|
1458
1426
|
});
|
|
1459
1427
|
}
|
|
@@ -1471,151 +1439,151 @@ function Oe(e, t) {
|
|
|
1471
1439
|
}
|
|
1472
1440
|
}
|
|
1473
1441
|
function $e(e, t) {
|
|
1474
|
-
let n = t.id && e ?
|
|
1475
|
-
return !n && e && t.data?.name && (n =
|
|
1442
|
+
let n = t.id && e ? No(e, t.id) : null;
|
|
1443
|
+
return !n && e && t.data?.name && (n = Fo(e, t.data.name)), n;
|
|
1476
1444
|
}
|
|
1477
|
-
function
|
|
1445
|
+
function it(e, t) {
|
|
1478
1446
|
for (const n of ["path", "query", "header", "cookie"]) {
|
|
1479
|
-
const
|
|
1480
|
-
if (
|
|
1447
|
+
const o = e.parameters[Bt[n]].get().find((r) => At(r) && t(r));
|
|
1448
|
+
if (o) return o;
|
|
1481
1449
|
}
|
|
1482
1450
|
return null;
|
|
1483
1451
|
}
|
|
1484
|
-
function
|
|
1485
|
-
return
|
|
1452
|
+
function No(e, t) {
|
|
1453
|
+
return it(e, (n) => n.id === t);
|
|
1486
1454
|
}
|
|
1487
|
-
function
|
|
1488
|
-
return
|
|
1455
|
+
function Fo(e, t) {
|
|
1456
|
+
return it(e, (n) => n.key === t);
|
|
1489
1457
|
}
|
|
1490
1458
|
function De(e, t) {
|
|
1491
1459
|
return e.successCriteria.get().find((n) => n.condition === t);
|
|
1492
1460
|
}
|
|
1493
|
-
function
|
|
1461
|
+
function at(e, t) {
|
|
1494
1462
|
for (const n of e.outputs.get())
|
|
1495
1463
|
if (t(n))
|
|
1496
1464
|
return {
|
|
1497
|
-
key:
|
|
1498
|
-
value:
|
|
1465
|
+
key: le(n.key),
|
|
1466
|
+
value: le(n.value)
|
|
1499
1467
|
};
|
|
1500
1468
|
}
|
|
1501
|
-
function
|
|
1502
|
-
return
|
|
1469
|
+
function ze(e, t) {
|
|
1470
|
+
return at(e, (n) => le(n.id) === t);
|
|
1503
1471
|
}
|
|
1504
|
-
function
|
|
1505
|
-
return
|
|
1472
|
+
function jo(e, t) {
|
|
1473
|
+
return at(e, (n) => le(n.key) === t);
|
|
1506
1474
|
}
|
|
1507
|
-
function
|
|
1475
|
+
function le(e) {
|
|
1508
1476
|
return typeof e == "string" ? e : e.get();
|
|
1509
1477
|
}
|
|
1510
|
-
function
|
|
1511
|
-
return e == null ? "" : typeof e == "string" ? e :
|
|
1478
|
+
function de(e) {
|
|
1479
|
+
return e == null ? "" : typeof e == "string" ? e : be(e);
|
|
1512
1480
|
}
|
|
1513
|
-
function
|
|
1514
|
-
if (!e || t !==
|
|
1481
|
+
function he(e, t) {
|
|
1482
|
+
if (!e || t !== St.JSON) return e;
|
|
1515
1483
|
try {
|
|
1516
1484
|
return JSON.stringify(JSON.parse(e), null, 2);
|
|
1517
1485
|
} catch {
|
|
1518
1486
|
return e;
|
|
1519
1487
|
}
|
|
1520
1488
|
}
|
|
1521
|
-
const
|
|
1522
|
-
update_security:
|
|
1523
|
-
update_step:
|
|
1489
|
+
const Wo = {
|
|
1490
|
+
update_security: Po,
|
|
1491
|
+
update_step: $o
|
|
1524
1492
|
};
|
|
1525
|
-
function
|
|
1526
|
-
const n =
|
|
1527
|
-
const
|
|
1528
|
-
if (!
|
|
1493
|
+
function st(e, t) {
|
|
1494
|
+
const n = We(), o = A(() => {
|
|
1495
|
+
const l = e ? Wo[e] : void 0;
|
|
1496
|
+
if (!l) return [];
|
|
1529
1497
|
try {
|
|
1530
|
-
return
|
|
1498
|
+
return l({ store: n, input: t });
|
|
1531
1499
|
} catch (u) {
|
|
1532
1500
|
return console.error("Unable to build change previews", u), [];
|
|
1533
1501
|
}
|
|
1534
|
-
}, [e, n, t]), [
|
|
1535
|
-
() => Object.fromEntries(
|
|
1536
|
-
), s =
|
|
1537
|
-
() =>
|
|
1538
|
-
[
|
|
1539
|
-
),
|
|
1540
|
-
(
|
|
1541
|
-
a(typeof
|
|
1542
|
-
const f =
|
|
1502
|
+
}, [e, n, t]), [r, a] = G(
|
|
1503
|
+
() => Object.fromEntries(o.map((l) => [l.id, l.included]))
|
|
1504
|
+
), s = A(
|
|
1505
|
+
() => o.map((l) => ({ ...l, included: r[l.id] ?? l.included })),
|
|
1506
|
+
[o, r]
|
|
1507
|
+
), d = D(
|
|
1508
|
+
(l) => {
|
|
1509
|
+
a(typeof l == "function" ? (u) => {
|
|
1510
|
+
const f = o.map((p) => ({
|
|
1543
1511
|
...p,
|
|
1544
1512
|
included: u[p.id] ?? p.included
|
|
1545
1513
|
}));
|
|
1546
|
-
return Object.fromEntries(
|
|
1547
|
-
} : Object.fromEntries(
|
|
1514
|
+
return Object.fromEntries(l(f).map((p) => [p.id, p.included]));
|
|
1515
|
+
} : Object.fromEntries(l.map((u) => [u.id, u.included])));
|
|
1548
1516
|
},
|
|
1549
|
-
[
|
|
1517
|
+
[o]
|
|
1550
1518
|
);
|
|
1551
|
-
return { previews: s, setPreviews:
|
|
1519
|
+
return { previews: s, setPreviews: d };
|
|
1552
1520
|
}
|
|
1553
|
-
function
|
|
1521
|
+
function Uo({
|
|
1554
1522
|
toolCallId: e,
|
|
1555
1523
|
toolName: t,
|
|
1556
1524
|
input: n,
|
|
1557
|
-
onApprove:
|
|
1558
|
-
onDeny:
|
|
1525
|
+
onApprove: o,
|
|
1526
|
+
onDeny: r
|
|
1559
1527
|
}) {
|
|
1560
|
-
const { updateMessages: a } =
|
|
1528
|
+
const { updateMessages: a } = Q(), { previews: s, setPreviews: d } = st(t, n), { includedCount: l, totalCount: u } = A(
|
|
1561
1529
|
() => ({
|
|
1562
1530
|
includedCount: s.filter((v) => v.included).length,
|
|
1563
1531
|
totalCount: s.length
|
|
1564
1532
|
}),
|
|
1565
1533
|
[s]
|
|
1566
|
-
), { approveLabel: f, denyLabel: p } =
|
|
1567
|
-
() =>
|
|
1534
|
+
), { approveLabel: f, denyLabel: p } = A(
|
|
1535
|
+
() => qn(t, n),
|
|
1568
1536
|
[t, n]
|
|
1569
|
-
), g =
|
|
1537
|
+
), g = D(() => {
|
|
1570
1538
|
a((v) => {
|
|
1571
1539
|
const x = [];
|
|
1572
|
-
for (let
|
|
1573
|
-
const
|
|
1574
|
-
(
|
|
1540
|
+
for (let b = 0; b < v.length; b++) {
|
|
1541
|
+
const w = v[b], { parts: y } = w, S = w.role === "assistant", E = y.some(
|
|
1542
|
+
(R) => Qe(R, e)
|
|
1575
1543
|
);
|
|
1576
|
-
if (
|
|
1577
|
-
const
|
|
1578
|
-
x.push({ index:
|
|
1544
|
+
if (S && E) {
|
|
1545
|
+
const R = Jn(w, e, s);
|
|
1546
|
+
x.push({ index: b, message: R });
|
|
1579
1547
|
}
|
|
1580
1548
|
}
|
|
1581
1549
|
return x;
|
|
1582
|
-
}),
|
|
1583
|
-
}, [s,
|
|
1550
|
+
}), o();
|
|
1551
|
+
}, [s, o, a, e]), m = D(
|
|
1584
1552
|
(v) => {
|
|
1585
|
-
|
|
1553
|
+
d(
|
|
1586
1554
|
(x) => x.map(
|
|
1587
|
-
(
|
|
1555
|
+
(b, w) => w === v ? { ...b, included: !b.included } : b
|
|
1588
1556
|
)
|
|
1589
1557
|
);
|
|
1590
1558
|
},
|
|
1591
|
-
[
|
|
1559
|
+
[d]
|
|
1592
1560
|
);
|
|
1593
|
-
return /* @__PURE__ */ h(
|
|
1594
|
-
/* @__PURE__ */ i(
|
|
1595
|
-
s.length ? /* @__PURE__ */ i(
|
|
1596
|
-
s.length ? /* @__PURE__ */ i(
|
|
1597
|
-
/* @__PURE__ */ h(
|
|
1598
|
-
u > 1 ? /* @__PURE__ */ h(
|
|
1599
|
-
|
|
1561
|
+
return /* @__PURE__ */ h(Yo, { children: [
|
|
1562
|
+
/* @__PURE__ */ i(ot, { toolName: t, input: n }),
|
|
1563
|
+
s.length ? /* @__PURE__ */ i(Go, { children: /* @__PURE__ */ i(et, { previews: s, handleToggle: m }) }) : null,
|
|
1564
|
+
s.length ? /* @__PURE__ */ i(Ue, {}) : null,
|
|
1565
|
+
/* @__PURE__ */ h(qo, { children: [
|
|
1566
|
+
u > 1 ? /* @__PURE__ */ h(Ko, { children: [
|
|
1567
|
+
l,
|
|
1600
1568
|
" of ",
|
|
1601
1569
|
u,
|
|
1602
1570
|
" selected"
|
|
1603
1571
|
] }) : null,
|
|
1604
|
-
/* @__PURE__ */ i(
|
|
1572
|
+
/* @__PURE__ */ i(Zo, { size: "small", variant: "secondary", onClick: r, children: p }),
|
|
1605
1573
|
/* @__PURE__ */ i(
|
|
1606
|
-
|
|
1574
|
+
Jo,
|
|
1607
1575
|
{
|
|
1608
1576
|
size: "small",
|
|
1609
1577
|
variant: "primary",
|
|
1610
1578
|
onClick: g,
|
|
1611
|
-
disabled: u > 0 ?
|
|
1579
|
+
disabled: u > 0 ? l === 0 : !1,
|
|
1612
1580
|
children: f
|
|
1613
1581
|
}
|
|
1614
1582
|
)
|
|
1615
1583
|
] })
|
|
1616
1584
|
] });
|
|
1617
1585
|
}
|
|
1618
|
-
const
|
|
1586
|
+
const Yo = c.div`
|
|
1619
1587
|
display: flex;
|
|
1620
1588
|
color: var(--text-color-primary);
|
|
1621
1589
|
flex-direction: column;
|
|
@@ -1626,27 +1594,27 @@ const Kr = c.div`
|
|
|
1626
1594
|
border: 1px solid var(--border-color-secondary);
|
|
1627
1595
|
background: var(--layer-color);
|
|
1628
1596
|
line-height: var(--line-height-sm);
|
|
1629
|
-
`,
|
|
1597
|
+
`, Go = c.div`
|
|
1630
1598
|
display: flex;
|
|
1631
1599
|
flex-direction: column;
|
|
1632
1600
|
gap: var(--spacing-xs);
|
|
1633
1601
|
min-width: 0;
|
|
1634
|
-
`,
|
|
1602
|
+
`, qo = c.div`
|
|
1635
1603
|
display: flex;
|
|
1636
1604
|
flex-wrap: wrap;
|
|
1637
1605
|
justify-content: flex-end;
|
|
1638
1606
|
align-items: center;
|
|
1639
1607
|
padding: 0 var(--spacing-sm) var(--spacing-xs) var(--spacing-sm);
|
|
1640
1608
|
gap: var(--spacing-xxs);
|
|
1641
|
-
`,
|
|
1609
|
+
`, Ko = c.span`
|
|
1642
1610
|
flex: 1;
|
|
1643
1611
|
font-size: var(--font-size-sm);
|
|
1644
1612
|
font-weight: var(--font-weight-regular);
|
|
1645
1613
|
line-height: var(--line-height-sm);
|
|
1646
1614
|
color: var(--text-color-secondary);
|
|
1647
|
-
`,
|
|
1615
|
+
`, Zo = c(B)`
|
|
1648
1616
|
background: none;
|
|
1649
|
-
`,
|
|
1617
|
+
`, Jo = c(B)`
|
|
1650
1618
|
border: 1px solid var(--button-bg-color);
|
|
1651
1619
|
padding-top: 0;
|
|
1652
1620
|
padding-bottom: 0;
|
|
@@ -1654,66 +1622,66 @@ const Kr = c.div`
|
|
|
1654
1622
|
border: 1px solid var(--button-border-color-disabled);
|
|
1655
1623
|
}
|
|
1656
1624
|
`;
|
|
1657
|
-
function
|
|
1625
|
+
function Xo({
|
|
1658
1626
|
approvalId: e,
|
|
1659
1627
|
toolCallId: t,
|
|
1660
1628
|
toolName: n,
|
|
1661
|
-
input:
|
|
1629
|
+
input: o
|
|
1662
1630
|
}) {
|
|
1663
|
-
const { addToolApprovalResponse:
|
|
1664
|
-
|
|
1665
|
-
}, [e,
|
|
1666
|
-
|
|
1667
|
-
}, [e,
|
|
1631
|
+
const { addToolApprovalResponse: r } = Q(), a = D(() => {
|
|
1632
|
+
r({ id: e, approved: !0 });
|
|
1633
|
+
}, [e, r]), s = D(() => {
|
|
1634
|
+
r({ id: e, approved: !1 });
|
|
1635
|
+
}, [e, r]);
|
|
1668
1636
|
return /* @__PURE__ */ i(
|
|
1669
|
-
|
|
1637
|
+
Uo,
|
|
1670
1638
|
{
|
|
1671
1639
|
onApprove: a,
|
|
1672
1640
|
onDeny: s,
|
|
1673
1641
|
toolCallId: t,
|
|
1674
1642
|
toolName: n,
|
|
1675
|
-
input:
|
|
1643
|
+
input: o
|
|
1676
1644
|
}
|
|
1677
1645
|
);
|
|
1678
1646
|
}
|
|
1679
|
-
function
|
|
1647
|
+
function Qo({
|
|
1680
1648
|
toolName: e,
|
|
1681
1649
|
toolCallId: t,
|
|
1682
1650
|
input: n,
|
|
1683
|
-
isDenied:
|
|
1684
|
-
messageMetadata:
|
|
1651
|
+
isDenied: o,
|
|
1652
|
+
messageMetadata: r,
|
|
1685
1653
|
onUndo: a
|
|
1686
1654
|
}) {
|
|
1687
|
-
const s =
|
|
1688
|
-
() =>
|
|
1689
|
-
[
|
|
1690
|
-
), { previews:
|
|
1655
|
+
const s = A(
|
|
1656
|
+
() => Zn(r, t),
|
|
1657
|
+
[r, t]
|
|
1658
|
+
), { previews: d } = st(
|
|
1691
1659
|
s ? void 0 : e,
|
|
1692
1660
|
n
|
|
1693
|
-
),
|
|
1694
|
-
const g = s ??
|
|
1695
|
-
if (
|
|
1661
|
+
), l = A(() => {
|
|
1662
|
+
const g = s ?? d;
|
|
1663
|
+
if (o)
|
|
1696
1664
|
return g.map((v) => ({ ...v, included: !1 }));
|
|
1697
|
-
const m =
|
|
1665
|
+
const m = Kn(n);
|
|
1698
1666
|
return g.map((v, x) => ({
|
|
1699
1667
|
...v,
|
|
1700
1668
|
included: m[x] ?? v.included
|
|
1701
1669
|
}));
|
|
1702
|
-
}, [s,
|
|
1703
|
-
if (
|
|
1670
|
+
}, [s, d, n, o]);
|
|
1671
|
+
if (l.length === 0)
|
|
1704
1672
|
return null;
|
|
1705
|
-
const u =
|
|
1706
|
-
return /* @__PURE__ */ h(
|
|
1707
|
-
/* @__PURE__ */ i(
|
|
1708
|
-
/* @__PURE__ */ i(
|
|
1709
|
-
/* @__PURE__ */ i(
|
|
1710
|
-
/* @__PURE__ */ h(
|
|
1711
|
-
/* @__PURE__ */ i(
|
|
1712
|
-
a ? /* @__PURE__ */ i(
|
|
1673
|
+
const u = l.filter((g) => g.included).length, p = u === 0 ? "Nothing applied" : `${u} ${u === 1 ? "change" : "changes"} applied`;
|
|
1674
|
+
return /* @__PURE__ */ h(er, { children: [
|
|
1675
|
+
/* @__PURE__ */ i(ot, { toolName: e, input: n }),
|
|
1676
|
+
/* @__PURE__ */ i(tr, { children: /* @__PURE__ */ i(et, { previews: l, readOnly: !0 }) }),
|
|
1677
|
+
/* @__PURE__ */ i(Ue, {}),
|
|
1678
|
+
/* @__PURE__ */ h(nr, { children: [
|
|
1679
|
+
/* @__PURE__ */ i(or, { children: p }),
|
|
1680
|
+
a ? /* @__PURE__ */ i(rr, { size: "small", variant: "outlined", onClick: a, children: "Undo" }) : null
|
|
1713
1681
|
] })
|
|
1714
1682
|
] });
|
|
1715
1683
|
}
|
|
1716
|
-
const
|
|
1684
|
+
const er = c.div`
|
|
1717
1685
|
display: flex;
|
|
1718
1686
|
color: var(--text-color-primary);
|
|
1719
1687
|
flex-direction: column;
|
|
@@ -1723,77 +1691,77 @@ const no = c.div`
|
|
|
1723
1691
|
border: 1px solid var(--border-color-secondary);
|
|
1724
1692
|
background: var(--layer-color);
|
|
1725
1693
|
line-height: var(--line-height-sm);
|
|
1726
|
-
`,
|
|
1694
|
+
`, tr = c.div`
|
|
1727
1695
|
display: flex;
|
|
1728
1696
|
flex-direction: column;
|
|
1729
1697
|
min-width: 0;
|
|
1730
|
-
`,
|
|
1698
|
+
`, nr = c.div`
|
|
1731
1699
|
display: flex;
|
|
1732
1700
|
justify-content: space-between;
|
|
1733
1701
|
align-items: center;
|
|
1734
1702
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
1735
1703
|
gap: var(--spacing-xs);
|
|
1736
|
-
`,
|
|
1704
|
+
`, or = c.span`
|
|
1737
1705
|
font-size: var(--font-size-sm);
|
|
1738
1706
|
font-weight: var(--font-weight-regular);
|
|
1739
1707
|
line-height: var(--line-height-sm);
|
|
1740
1708
|
color: var(--text-color-secondary);
|
|
1741
|
-
`,
|
|
1709
|
+
`, rr = c(B)`
|
|
1742
1710
|
padding-top: 0;
|
|
1743
1711
|
padding-bottom: 0;
|
|
1744
1712
|
`;
|
|
1745
|
-
function
|
|
1746
|
-
const [n,
|
|
1747
|
-
|
|
1748
|
-
}, []), a =
|
|
1749
|
-
return /* @__PURE__ */ h(
|
|
1750
|
-
/* @__PURE__ */ h(
|
|
1751
|
-
/* @__PURE__ */ i(
|
|
1752
|
-
/* @__PURE__ */ h(
|
|
1713
|
+
function ir({ items: e, isLast: t }) {
|
|
1714
|
+
const [n, o] = G(t), r = D(() => {
|
|
1715
|
+
o((s) => !s);
|
|
1716
|
+
}, []), a = A(() => e.filter((s) => s.kind === "action"), [e]);
|
|
1717
|
+
return /* @__PURE__ */ h(sr, { children: [
|
|
1718
|
+
/* @__PURE__ */ h(cr, { type: "button", onClick: r, "aria-expanded": n, children: [
|
|
1719
|
+
/* @__PURE__ */ i(lr, { children: n ? /* @__PURE__ */ i(Zt, { size: "12px", color: "var(--icon-color-additional)" }) : /* @__PURE__ */ i(Jt, { size: "12px", color: "var(--icon-color-additional)" }) }),
|
|
1720
|
+
/* @__PURE__ */ h(dr, { children: [
|
|
1753
1721
|
a.length,
|
|
1754
1722
|
" ",
|
|
1755
1723
|
a.length === 1 ? "action" : "actions"
|
|
1756
1724
|
] })
|
|
1757
1725
|
] }),
|
|
1758
|
-
n && /* @__PURE__ */ i(
|
|
1726
|
+
n && /* @__PURE__ */ i(ur, { children: a.map((s, d) => /* @__PURE__ */ i(ar, { text: s.text }, d)) })
|
|
1759
1727
|
] });
|
|
1760
1728
|
}
|
|
1761
|
-
function
|
|
1762
|
-
return /* @__PURE__ */ h(
|
|
1763
|
-
/* @__PURE__ */ h(
|
|
1764
|
-
/* @__PURE__ */ i(
|
|
1765
|
-
/* @__PURE__ */ i(
|
|
1766
|
-
/* @__PURE__ */ i(
|
|
1729
|
+
function ar({ text: e }) {
|
|
1730
|
+
return /* @__PURE__ */ h(fr, { children: [
|
|
1731
|
+
/* @__PURE__ */ h(pr, { children: [
|
|
1732
|
+
/* @__PURE__ */ i(hr, { "aria-hidden": !0 }),
|
|
1733
|
+
/* @__PURE__ */ i(gr, { children: /* @__PURE__ */ i(vr, { "aria-hidden": !0 }) }),
|
|
1734
|
+
/* @__PURE__ */ i(ct, { "aria-hidden": !0 })
|
|
1767
1735
|
] }),
|
|
1768
|
-
/* @__PURE__ */ i(
|
|
1736
|
+
/* @__PURE__ */ i(mr, { children: e })
|
|
1769
1737
|
] });
|
|
1770
1738
|
}
|
|
1771
|
-
const
|
|
1739
|
+
const sr = c.div`
|
|
1772
1740
|
display: flex;
|
|
1773
1741
|
flex-direction: column;
|
|
1774
1742
|
width: 100%;
|
|
1775
1743
|
min-width: 0;
|
|
1776
|
-
`,
|
|
1744
|
+
`, cr = c.button`
|
|
1777
1745
|
display: flex;
|
|
1778
1746
|
align-items: center;
|
|
1779
1747
|
cursor: pointer;
|
|
1780
1748
|
user-select: none;
|
|
1781
1749
|
width: fit-content;
|
|
1782
1750
|
padding: 0;
|
|
1783
|
-
`,
|
|
1751
|
+
`, lr = c.span`
|
|
1784
1752
|
display: flex;
|
|
1785
1753
|
align-items: center;
|
|
1786
1754
|
flex-shrink: 0;
|
|
1787
|
-
`,
|
|
1755
|
+
`, dr = c.span`
|
|
1788
1756
|
font-size: var(--font-size-sm);
|
|
1789
1757
|
font-weight: var(--font-weight-regular);
|
|
1790
1758
|
line-height: var(--line-height-sm);
|
|
1791
1759
|
color: var(--text-color-description);
|
|
1792
|
-
`,
|
|
1760
|
+
`, ur = c.div`
|
|
1793
1761
|
display: flex;
|
|
1794
1762
|
flex-direction: column;
|
|
1795
1763
|
gap: 0;
|
|
1796
|
-
`,
|
|
1764
|
+
`, ct = c.span`
|
|
1797
1765
|
display: block;
|
|
1798
1766
|
width: 1px;
|
|
1799
1767
|
flex-shrink: 0;
|
|
@@ -1801,7 +1769,7 @@ const lo = c.div`
|
|
|
1801
1769
|
background: var(--border-color-secondary);
|
|
1802
1770
|
flex: 1 1 auto;
|
|
1803
1771
|
min-height: 8px;
|
|
1804
|
-
`,
|
|
1772
|
+
`, fr = c.div`
|
|
1805
1773
|
display: flex;
|
|
1806
1774
|
flex-direction: row;
|
|
1807
1775
|
align-items: stretch;
|
|
@@ -1809,11 +1777,11 @@ const lo = c.div`
|
|
|
1809
1777
|
min-width: 0;
|
|
1810
1778
|
|
|
1811
1779
|
&:last-child {
|
|
1812
|
-
${
|
|
1780
|
+
${ct} {
|
|
1813
1781
|
display: none;
|
|
1814
1782
|
}
|
|
1815
1783
|
}
|
|
1816
|
-
`,
|
|
1784
|
+
`, pr = c.div`
|
|
1817
1785
|
display: flex;
|
|
1818
1786
|
flex-direction: column;
|
|
1819
1787
|
align-items: center;
|
|
@@ -1822,14 +1790,14 @@ const lo = c.div`
|
|
|
1822
1790
|
flex: 0 0 auto;
|
|
1823
1791
|
align-self: stretch;
|
|
1824
1792
|
min-height: 0;
|
|
1825
|
-
`,
|
|
1793
|
+
`, hr = c.span`
|
|
1826
1794
|
display: block;
|
|
1827
1795
|
width: 1px;
|
|
1828
1796
|
height: 4px;
|
|
1829
1797
|
flex: 0 0 auto;
|
|
1830
1798
|
flex-shrink: 0;
|
|
1831
1799
|
background: var(--border-color-secondary);
|
|
1832
|
-
`,
|
|
1800
|
+
`, gr = c.div`
|
|
1833
1801
|
width: 12px;
|
|
1834
1802
|
height: 12px;
|
|
1835
1803
|
flex: 0 0 auto;
|
|
@@ -1837,7 +1805,7 @@ const lo = c.div`
|
|
|
1837
1805
|
display: flex;
|
|
1838
1806
|
align-items: center;
|
|
1839
1807
|
justify-content: center;
|
|
1840
|
-
`,
|
|
1808
|
+
`, vr = c.span`
|
|
1841
1809
|
width: 4px;
|
|
1842
1810
|
height: 4px;
|
|
1843
1811
|
flex-shrink: 0;
|
|
@@ -1845,7 +1813,7 @@ const lo = c.div`
|
|
|
1845
1813
|
box-sizing: border-box;
|
|
1846
1814
|
border: 1px solid var(--border-color-secondary);
|
|
1847
1815
|
background: transparent;
|
|
1848
|
-
`,
|
|
1816
|
+
`, mr = c.span`
|
|
1849
1817
|
flex: 1;
|
|
1850
1818
|
min-width: 0;
|
|
1851
1819
|
align-self: flex-start;
|
|
@@ -1854,59 +1822,59 @@ const lo = c.div`
|
|
|
1854
1822
|
line-height: var(--line-height-sm);
|
|
1855
1823
|
color: var(--text-color-helper);
|
|
1856
1824
|
`;
|
|
1857
|
-
function
|
|
1825
|
+
function yr({
|
|
1858
1826
|
items: e,
|
|
1859
1827
|
messageMetadata: t
|
|
1860
1828
|
}) {
|
|
1861
|
-
return /* @__PURE__ */ i(
|
|
1829
|
+
return /* @__PURE__ */ i(br, { children: e.map((n, o) => {
|
|
1862
1830
|
if (n.kind === "reasoning-block") {
|
|
1863
|
-
const s =
|
|
1864
|
-
return /* @__PURE__ */ i(
|
|
1831
|
+
const s = o === e.length - 1;
|
|
1832
|
+
return /* @__PURE__ */ i(ir, { items: n.items, isLast: s }, n.key);
|
|
1865
1833
|
}
|
|
1866
1834
|
if (n.kind === "text")
|
|
1867
1835
|
return /* @__PURE__ */ i(
|
|
1868
|
-
|
|
1836
|
+
xr,
|
|
1869
1837
|
{
|
|
1870
1838
|
rawMarkdown: n.text,
|
|
1871
1839
|
workflowRunHistoryIds: n.workflowRunHistoryIds
|
|
1872
1840
|
},
|
|
1873
1841
|
n.key
|
|
1874
1842
|
);
|
|
1875
|
-
const { part:
|
|
1876
|
-
return a &&
|
|
1877
|
-
|
|
1843
|
+
const { part: r } = n, a = Ht(r.type);
|
|
1844
|
+
return a && qe(r) ? /* @__PURE__ */ i(
|
|
1845
|
+
Xo,
|
|
1878
1846
|
{
|
|
1879
|
-
approvalId:
|
|
1880
|
-
toolCallId:
|
|
1847
|
+
approvalId: r.approval.id,
|
|
1848
|
+
toolCallId: r.toolCallId,
|
|
1881
1849
|
toolName: a,
|
|
1882
|
-
input:
|
|
1850
|
+
input: r.input
|
|
1883
1851
|
},
|
|
1884
1852
|
n.key
|
|
1885
|
-
) : a &&
|
|
1886
|
-
|
|
1853
|
+
) : a && Nt(r) ? /* @__PURE__ */ i(
|
|
1854
|
+
Qo,
|
|
1887
1855
|
{
|
|
1888
1856
|
toolName: a,
|
|
1889
|
-
toolCallId:
|
|
1890
|
-
input:
|
|
1891
|
-
isDenied:
|
|
1857
|
+
toolCallId: r.toolCallId,
|
|
1858
|
+
input: r.input,
|
|
1859
|
+
isDenied: r.state === "output-denied",
|
|
1892
1860
|
messageMetadata: t
|
|
1893
1861
|
},
|
|
1894
1862
|
n.key
|
|
1895
1863
|
) : null;
|
|
1896
1864
|
}) });
|
|
1897
1865
|
}
|
|
1898
|
-
function
|
|
1866
|
+
function xr({
|
|
1899
1867
|
rawMarkdown: e,
|
|
1900
1868
|
workflowRunHistoryIds: t
|
|
1901
1869
|
}) {
|
|
1902
|
-
const n =
|
|
1903
|
-
return /* @__PURE__ */ i(
|
|
1870
|
+
const n = Xe({ workflowRunHistoryIds: t });
|
|
1871
|
+
return /* @__PURE__ */ i(wr, { onClick: n, children: /* @__PURE__ */ i(Lt, { rawMarkdown: e, parser: Pt }) });
|
|
1904
1872
|
}
|
|
1905
|
-
const
|
|
1873
|
+
const br = c.div`
|
|
1906
1874
|
display: flex;
|
|
1907
1875
|
flex-direction: column;
|
|
1908
1876
|
gap: var(--spacing-xs);
|
|
1909
|
-
`,
|
|
1877
|
+
`, wr = c.div`
|
|
1910
1878
|
white-space: normal;
|
|
1911
1879
|
|
|
1912
1880
|
max-width: 100%;
|
|
@@ -1919,139 +1887,170 @@ const ko = c.div`
|
|
|
1919
1887
|
p:last-child {
|
|
1920
1888
|
margin-bottom: 0;
|
|
1921
1889
|
}
|
|
1922
|
-
`,
|
|
1890
|
+
`, lt = c.div`
|
|
1923
1891
|
font-family: var(--font-family-base);
|
|
1924
1892
|
font-size: var(--font-size-sm);
|
|
1925
1893
|
line-height: var(--line-height-sm);
|
|
1926
1894
|
color: var(--text-color-primary);
|
|
1895
|
+
`, J = c.div`
|
|
1896
|
+
width: var(--search-ai-thinking-dot-size);
|
|
1897
|
+
height: var(--search-ai-thinking-dot-size);
|
|
1898
|
+
border-radius: 50%;
|
|
1899
|
+
background: var(--search-ai-thinking-dot-color);
|
|
1900
|
+
animation: bounce 1.4s infinite ease-in-out;
|
|
1901
|
+
|
|
1902
|
+
&:nth-child(1) {
|
|
1903
|
+
animation-delay: -0.32s;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
&:nth-child(2) {
|
|
1907
|
+
animation-delay: -0.16s;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
&:nth-child(3) {
|
|
1911
|
+
animation-delay: 0s;
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
@keyframes bounce {
|
|
1915
|
+
0%,
|
|
1916
|
+
80%,
|
|
1917
|
+
100% {
|
|
1918
|
+
opacity: 0.2;
|
|
1919
|
+
transform: scale(0.8);
|
|
1920
|
+
}
|
|
1921
|
+
40% {
|
|
1922
|
+
opacity: 1;
|
|
1923
|
+
transform: scale(1);
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1927
1926
|
`;
|
|
1928
|
-
function
|
|
1929
|
-
return /* @__PURE__ */ h(
|
|
1930
|
-
/* @__PURE__ */ i(
|
|
1931
|
-
/* @__PURE__ */ i(
|
|
1932
|
-
/* @__PURE__ */ i(
|
|
1927
|
+
function Cr() {
|
|
1928
|
+
return /* @__PURE__ */ h(kr, { children: [
|
|
1929
|
+
/* @__PURE__ */ i(J, {}),
|
|
1930
|
+
/* @__PURE__ */ i(J, {}),
|
|
1931
|
+
/* @__PURE__ */ i(J, {})
|
|
1933
1932
|
] });
|
|
1934
1933
|
}
|
|
1935
|
-
const
|
|
1934
|
+
const kr = c.div`
|
|
1936
1935
|
display: flex;
|
|
1937
1936
|
align-items: center;
|
|
1938
1937
|
justify-content: space-between;
|
|
1939
1938
|
width: 24px;
|
|
1940
1939
|
height: 24px;
|
|
1941
1940
|
`;
|
|
1942
|
-
function
|
|
1943
|
-
return /* @__PURE__ */ h(
|
|
1944
|
-
/* @__PURE__ */ i(
|
|
1945
|
-
/* @__PURE__ */ i(
|
|
1941
|
+
function Tr() {
|
|
1942
|
+
return /* @__PURE__ */ h(Ir, { children: [
|
|
1943
|
+
/* @__PURE__ */ i(Cr, {}),
|
|
1944
|
+
/* @__PURE__ */ i(Ar, { children: "Thinking" })
|
|
1946
1945
|
] });
|
|
1947
1946
|
}
|
|
1948
|
-
const
|
|
1947
|
+
const Ir = c.div`
|
|
1949
1948
|
display: flex;
|
|
1950
1949
|
align-items: center;
|
|
1951
1950
|
gap: var(--spacing-xxs);
|
|
1952
|
-
`,
|
|
1951
|
+
`, Ar = c.span`
|
|
1953
1952
|
font-family: var(--font-family-base);
|
|
1954
1953
|
font-size: var(--font-size-sm);
|
|
1955
1954
|
line-height: var(--line-height-sm);
|
|
1956
1955
|
color: var(--text-color-helper);
|
|
1957
1956
|
`;
|
|
1958
|
-
function
|
|
1959
|
-
return /* @__PURE__ */ i(
|
|
1957
|
+
function Sr({ items: e }) {
|
|
1958
|
+
return /* @__PURE__ */ i(mt, { children: e.map((t) => t.kind !== "text" ? null : /* @__PURE__ */ i(lt, { children: t.text }, t.key)) });
|
|
1960
1959
|
}
|
|
1961
|
-
const
|
|
1962
|
-
function
|
|
1960
|
+
const Lr = "Something went wrong. Please try again.";
|
|
1961
|
+
function Pr(e) {
|
|
1963
1962
|
const t = e?.message?.trim();
|
|
1964
|
-
return t ||
|
|
1963
|
+
return t || Lr;
|
|
1965
1964
|
}
|
|
1966
|
-
function
|
|
1967
|
-
const { chatStatus: n, chatError:
|
|
1968
|
-
return !
|
|
1969
|
-
|
|
1965
|
+
function Er({ message: e, isLastMessage: t }) {
|
|
1966
|
+
const { chatStatus: n, chatError: o } = Q(), { role: r, parts: a } = e, s = r === z.ASSISTANT, d = A(() => Ft(a), [a]), l = d.length > 0, u = n === "error" && t && s && !l;
|
|
1967
|
+
return !l && !u ? null : /* @__PURE__ */ i(dt, { $role: r, children: /* @__PURE__ */ i(
|
|
1968
|
+
Or,
|
|
1970
1969
|
{
|
|
1971
1970
|
isFailedEmptyAssistant: u,
|
|
1972
|
-
chatError:
|
|
1971
|
+
chatError: o,
|
|
1973
1972
|
isAssistant: s,
|
|
1974
|
-
contentItems:
|
|
1973
|
+
contentItems: d,
|
|
1975
1974
|
messageMetadata: e.metadata
|
|
1976
1975
|
}
|
|
1977
1976
|
) });
|
|
1978
1977
|
}
|
|
1979
|
-
function
|
|
1980
|
-
return /* @__PURE__ */ i(
|
|
1978
|
+
function Rr() {
|
|
1979
|
+
return /* @__PURE__ */ i(dt, { $role: z.ASSISTANT, children: /* @__PURE__ */ i(xe, { children: /* @__PURE__ */ i(Tr, {}) }) });
|
|
1981
1980
|
}
|
|
1982
|
-
function
|
|
1981
|
+
function Or({
|
|
1983
1982
|
isFailedEmptyAssistant: e,
|
|
1984
1983
|
chatError: t,
|
|
1985
1984
|
isAssistant: n,
|
|
1986
|
-
contentItems:
|
|
1987
|
-
messageMetadata:
|
|
1985
|
+
contentItems: o,
|
|
1986
|
+
messageMetadata: r
|
|
1988
1987
|
}) {
|
|
1989
|
-
return e ? /* @__PURE__ */ i(
|
|
1988
|
+
return e ? /* @__PURE__ */ i(xe, { children: /* @__PURE__ */ i(lt, { children: Pr(t) }) }) : /* @__PURE__ */ i(xe, { children: n ? /* @__PURE__ */ i(yr, { items: o, messageMetadata: r }) : /* @__PURE__ */ i(Sr, { items: o }) });
|
|
1990
1989
|
}
|
|
1991
|
-
const
|
|
1990
|
+
const dt = c.div`
|
|
1992
1991
|
display: flex;
|
|
1993
1992
|
flex-direction: column;
|
|
1994
1993
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
1995
1994
|
gap: var(--spacing-xxs);
|
|
1996
1995
|
min-width: 0;
|
|
1997
|
-
width: ${({ $role: e }) => e ===
|
|
1998
|
-
border-radius: ${({ $role: e }) => e ===
|
|
1999
|
-
background: ${({ $role: e }) => e ===
|
|
1996
|
+
width: ${({ $role: e }) => e === z.ASSISTANT ? "100%" : "fit-content"};
|
|
1997
|
+
border-radius: ${({ $role: e }) => e === z.USER ? "6px 0px 6px 6px" : "0px 6px 6px 6px"};
|
|
1998
|
+
background: ${({ $role: e }) => e === z.USER ? "var(--replay-ai-user-message-gradient)" : "transparent"};
|
|
2000
1999
|
border: none;
|
|
2001
2000
|
color: var(--text-color-primary);
|
|
2002
2001
|
box-sizing: border-box;
|
|
2003
2002
|
word-wrap: break-word;
|
|
2004
2003
|
white-space: pre-wrap;
|
|
2005
2004
|
max-width: 100%;
|
|
2006
|
-
`,
|
|
2005
|
+
`, xe = c.div`
|
|
2007
2006
|
display: flex;
|
|
2008
2007
|
flex-direction: column;
|
|
2009
2008
|
gap: var(--spacing-xxs);
|
|
2010
2009
|
min-width: 0;
|
|
2011
2010
|
width: 100%;
|
|
2012
2011
|
`;
|
|
2013
|
-
function
|
|
2014
|
-
const { messages: e, isStreaming: t } =
|
|
2015
|
-
const
|
|
2016
|
-
return t && !(
|
|
2012
|
+
function $r() {
|
|
2013
|
+
const { messages: e, isStreaming: t } = Q(), n = e.at(-1), o = A(() => {
|
|
2014
|
+
const r = n?.role === z.ASSISTANT, a = n?.parts.at(-1)?.type === "text";
|
|
2015
|
+
return t && !(r && a);
|
|
2017
2016
|
}, [t, n?.parts, n?.role]);
|
|
2018
|
-
return /* @__PURE__ */ h(
|
|
2019
|
-
e.map((
|
|
2020
|
-
|
|
2017
|
+
return /* @__PURE__ */ h(Dr, { children: [
|
|
2018
|
+
e.map((r, a) => /* @__PURE__ */ i(Me, { $role: r.role, children: /* @__PURE__ */ i(_e, { $role: r.role, children: /* @__PURE__ */ i(Er, { message: r, isLastMessage: a === e.length - 1 }) }) }, r.id)),
|
|
2019
|
+
o && /* @__PURE__ */ i(Me, { $role: z.ASSISTANT, children: /* @__PURE__ */ i(_e, { $role: z.ASSISTANT, children: /* @__PURE__ */ i(Rr, {}) }) })
|
|
2021
2020
|
] });
|
|
2022
2021
|
}
|
|
2023
|
-
const
|
|
2022
|
+
const Dr = c.div`
|
|
2024
2023
|
display: flex;
|
|
2025
2024
|
flex-direction: column;
|
|
2026
2025
|
gap: var(--spacing-xs);
|
|
2027
2026
|
width: 100%;
|
|
2028
|
-
`,
|
|
2027
|
+
`, Me = c.div`
|
|
2029
2028
|
display: flex;
|
|
2030
2029
|
width: 100%;
|
|
2031
|
-
justify-content: ${({ $role: e }) => e ===
|
|
2030
|
+
justify-content: ${({ $role: e }) => e === z.USER ? "flex-end" : "flex-start"};
|
|
2032
2031
|
`, _e = c.div`
|
|
2033
2032
|
display: flex;
|
|
2034
2033
|
flex-direction: column;
|
|
2035
|
-
align-items: ${({ $role: e }) => e ===
|
|
2034
|
+
align-items: ${({ $role: e }) => e === z.USER ? "flex-end" : "stretch"};
|
|
2036
2035
|
gap: var(--spacing-xs);
|
|
2037
2036
|
min-width: 0;
|
|
2038
2037
|
width: 100%;
|
|
2039
2038
|
max-width: 100%;
|
|
2040
2039
|
`;
|
|
2041
|
-
function
|
|
2042
|
-
const t =
|
|
2043
|
-
return
|
|
2040
|
+
function zr(e) {
|
|
2041
|
+
const t = N(void 0);
|
|
2042
|
+
return H(() => {
|
|
2044
2043
|
t.current = e;
|
|
2045
2044
|
}), t.current;
|
|
2046
2045
|
}
|
|
2047
|
-
const
|
|
2046
|
+
const ut = c.div`
|
|
2048
2047
|
display: flex;
|
|
2049
2048
|
flex-direction: column;
|
|
2050
2049
|
flex: 1;
|
|
2051
2050
|
width: 100%;
|
|
2052
2051
|
overflow: auto;
|
|
2053
2052
|
padding: var(--spacing-xs);
|
|
2054
|
-
`,
|
|
2053
|
+
`, Mr = (e) => /* @__PURE__ */ h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 14 14", fill: "none", ...e, children: [
|
|
2055
2054
|
/* @__PURE__ */ i(
|
|
2056
2055
|
"path",
|
|
2057
2056
|
{
|
|
@@ -2083,98 +2082,98 @@ const ht = c.div`
|
|
|
2083
2082
|
]
|
|
2084
2083
|
}
|
|
2085
2084
|
) })
|
|
2086
|
-
] }),
|
|
2085
|
+
] }), _r = c(Mr)`
|
|
2087
2086
|
height: ${({ size: e }) => e || "14px"};
|
|
2088
2087
|
width: ${({ size: e }) => e || "14px"};
|
|
2089
2088
|
`;
|
|
2090
|
-
function
|
|
2089
|
+
function Vr(e) {
|
|
2091
2090
|
const t = "var(--font-size-base)";
|
|
2092
2091
|
switch (e) {
|
|
2093
|
-
case
|
|
2094
|
-
return /* @__PURE__ */ i(
|
|
2095
|
-
case
|
|
2096
|
-
return /* @__PURE__ */ i(
|
|
2097
|
-
case
|
|
2098
|
-
return /* @__PURE__ */ i(
|
|
2099
|
-
case
|
|
2100
|
-
return /* @__PURE__ */ i(
|
|
2092
|
+
case me:
|
|
2093
|
+
return /* @__PURE__ */ i(_r, { size: t });
|
|
2094
|
+
case pe.OPENAI:
|
|
2095
|
+
return /* @__PURE__ */ i(rn, { size: t, color: "var(--text-color-primary)" });
|
|
2096
|
+
case pe.GEMINI:
|
|
2097
|
+
return /* @__PURE__ */ i(on, { size: t });
|
|
2098
|
+
case pe.ANTHROPIC:
|
|
2099
|
+
return /* @__PURE__ */ i(nn, { size: t, color: "var(--replay-claude-icon-color)" });
|
|
2101
2100
|
}
|
|
2102
2101
|
}
|
|
2103
|
-
function
|
|
2102
|
+
function Br({
|
|
2104
2103
|
models: e,
|
|
2105
2104
|
selectedModelId: t,
|
|
2106
2105
|
placement: n,
|
|
2107
|
-
onModelSelect:
|
|
2108
|
-
onSettingsOpen:
|
|
2106
|
+
onModelSelect: o,
|
|
2107
|
+
onSettingsOpen: r
|
|
2109
2108
|
}) {
|
|
2110
|
-
const a = e.find((p) => p.id === t), s = a?.label ?? "Replay AI",
|
|
2111
|
-
return /* @__PURE__ */ i(
|
|
2112
|
-
|
|
2109
|
+
const a = e.find((p) => p.id === t), s = a?.label ?? "Replay AI", d = a?.id, l = e.filter((p) => p.provider === me), u = e.filter((p) => p.provider !== me), f = l.length > 0 && u.length > 0;
|
|
2110
|
+
return /* @__PURE__ */ i(jr, { children: /* @__PURE__ */ i(
|
|
2111
|
+
Wr,
|
|
2113
2112
|
{
|
|
2114
|
-
trigger: /* @__PURE__ */ i(
|
|
2113
|
+
trigger: /* @__PURE__ */ i(Hr, { label: s }),
|
|
2115
2114
|
placement: n,
|
|
2116
2115
|
alignment: "start",
|
|
2117
2116
|
withArrow: !0,
|
|
2118
|
-
children: /* @__PURE__ */ h(
|
|
2119
|
-
/* @__PURE__ */ h(
|
|
2120
|
-
|
|
2117
|
+
children: /* @__PURE__ */ h(Ur, { children: [
|
|
2118
|
+
/* @__PURE__ */ h(qr, { children: [
|
|
2119
|
+
l.map((p) => /* @__PURE__ */ i(
|
|
2121
2120
|
Ve,
|
|
2122
2121
|
{
|
|
2123
2122
|
model: p,
|
|
2124
|
-
activeModelId:
|
|
2125
|
-
onModelSelect:
|
|
2123
|
+
activeModelId: d,
|
|
2124
|
+
onModelSelect: o
|
|
2126
2125
|
},
|
|
2127
2126
|
p.id
|
|
2128
2127
|
)),
|
|
2129
|
-
f && /* @__PURE__ */ i(
|
|
2130
|
-
u.length > 0 && /* @__PURE__ */ i(
|
|
2128
|
+
f && /* @__PURE__ */ i(Be, { "aria-hidden": !0 }),
|
|
2129
|
+
u.length > 0 && /* @__PURE__ */ i(Ne, { children: u.map((p) => /* @__PURE__ */ i(
|
|
2131
2130
|
Ve,
|
|
2132
2131
|
{
|
|
2133
2132
|
model: p,
|
|
2134
|
-
activeModelId:
|
|
2135
|
-
onModelSelect:
|
|
2133
|
+
activeModelId: d,
|
|
2134
|
+
onModelSelect: o
|
|
2136
2135
|
},
|
|
2137
2136
|
p.id
|
|
2138
2137
|
)) })
|
|
2139
2138
|
] }),
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2139
|
+
r && e.length > 0 && /* @__PURE__ */ i(Be, { "aria-hidden": !0 }),
|
|
2140
|
+
r && /* @__PURE__ */ i(
|
|
2141
|
+
Kr,
|
|
2143
2142
|
{
|
|
2144
|
-
prefix: /* @__PURE__ */ i(
|
|
2143
|
+
prefix: /* @__PURE__ */ i(Xt, { size: "var(--font-size-base)", color: "var(--text-color-secondary)" }),
|
|
2145
2144
|
content: "Manage models",
|
|
2146
|
-
onAction: () =>
|
|
2145
|
+
onAction: () => r("ai-providers")
|
|
2147
2146
|
}
|
|
2148
2147
|
)
|
|
2149
2148
|
] })
|
|
2150
2149
|
}
|
|
2151
2150
|
) });
|
|
2152
2151
|
}
|
|
2153
|
-
function
|
|
2152
|
+
function Hr({
|
|
2154
2153
|
label: e,
|
|
2155
2154
|
icon: t,
|
|
2156
2155
|
onClick: n,
|
|
2157
|
-
onKeyDown:
|
|
2156
|
+
onKeyDown: o
|
|
2158
2157
|
}) {
|
|
2159
|
-
return /* @__PURE__ */ h(
|
|
2160
|
-
/* @__PURE__ */ i(
|
|
2158
|
+
return /* @__PURE__ */ h(Nr, { onClick: n, onKeyDown: o, children: [
|
|
2159
|
+
/* @__PURE__ */ i(Fr, { children: e }),
|
|
2161
2160
|
t
|
|
2162
2161
|
] });
|
|
2163
2162
|
}
|
|
2164
2163
|
function Ve({ model: e, activeModelId: t, onModelSelect: n }) {
|
|
2165
|
-
const
|
|
2164
|
+
const o = e.id === t;
|
|
2166
2165
|
return /* @__PURE__ */ i(
|
|
2167
|
-
|
|
2166
|
+
Ze,
|
|
2168
2167
|
{
|
|
2169
|
-
prefix:
|
|
2170
|
-
suffix:
|
|
2168
|
+
prefix: Vr(e.provider),
|
|
2169
|
+
suffix: o ? /* @__PURE__ */ i(Gr, { size: "var(--font-size-base)", color: "var(--text-color-primary)" }) : void 0,
|
|
2171
2170
|
onAction: () => n(e.id),
|
|
2172
|
-
active:
|
|
2173
|
-
children: /* @__PURE__ */ i(
|
|
2171
|
+
active: o,
|
|
2172
|
+
children: /* @__PURE__ */ i(Yr, { children: e.label })
|
|
2174
2173
|
}
|
|
2175
2174
|
);
|
|
2176
2175
|
}
|
|
2177
|
-
const
|
|
2176
|
+
const Nr = c.div`
|
|
2178
2177
|
display: flex;
|
|
2179
2178
|
align-items: center;
|
|
2180
2179
|
min-width: 0;
|
|
@@ -2189,7 +2188,7 @@ const Wo = c.div`
|
|
|
2189
2188
|
&:hover {
|
|
2190
2189
|
background: var(--layer-color-active);
|
|
2191
2190
|
}
|
|
2192
|
-
`,
|
|
2191
|
+
`, Fr = c.span`
|
|
2193
2192
|
overflow: hidden;
|
|
2194
2193
|
text-overflow: ellipsis;
|
|
2195
2194
|
font-family: var(--font-family-base);
|
|
@@ -2198,13 +2197,13 @@ const Wo = c.div`
|
|
|
2198
2197
|
line-height: var(--line-height-base);
|
|
2199
2198
|
color: var(--text-color-primary);
|
|
2200
2199
|
white-space: nowrap;
|
|
2201
|
-
`,
|
|
2200
|
+
`, jr = c.div`
|
|
2202
2201
|
--dropdown-menu-padding-top: 0;
|
|
2203
2202
|
|
|
2204
2203
|
min-width: 0;
|
|
2205
2204
|
flex: 1;
|
|
2206
2205
|
position: relative;
|
|
2207
|
-
`,
|
|
2206
|
+
`, Wr = c(Qt)`
|
|
2208
2207
|
width: 100%;
|
|
2209
2208
|
min-width: 0;
|
|
2210
2209
|
flex: 1;
|
|
@@ -2213,7 +2212,7 @@ const Wo = c.div`
|
|
|
2213
2212
|
width: 100%;
|
|
2214
2213
|
max-width: 200px;
|
|
2215
2214
|
}
|
|
2216
|
-
`,
|
|
2215
|
+
`, Ur = c(en)`
|
|
2217
2216
|
--dropdown-menu-item-gap: calc(var(--spacing-unit) / 2);
|
|
2218
2217
|
--dropdown-menu-item-padding-vertical: var(--spacing-xxs);
|
|
2219
2218
|
--dropdown-menu-item-padding-horizontal: var(--spacing-xs);
|
|
@@ -2222,111 +2221,171 @@ const Wo = c.div`
|
|
|
2222
2221
|
margin: 5px 0;
|
|
2223
2222
|
border-radius: var(--border-radius-lg);
|
|
2224
2223
|
background: var(--bg-color);
|
|
2225
|
-
`,
|
|
2224
|
+
`, Yr = c.span`
|
|
2226
2225
|
flex: 1;
|
|
2227
2226
|
min-width: 0;
|
|
2228
2227
|
overflow: hidden;
|
|
2229
2228
|
text-overflow: ellipsis;
|
|
2230
2229
|
white-space: nowrap;
|
|
2231
|
-
`,
|
|
2230
|
+
`, Gr = c(tn)`
|
|
2232
2231
|
margin-left: var(--spacing-xxs);
|
|
2233
|
-
`,
|
|
2232
|
+
`, Be = c.li`
|
|
2234
2233
|
flex-shrink: 0;
|
|
2235
2234
|
list-style: none;
|
|
2236
2235
|
width: 100%;
|
|
2237
2236
|
height: 1px;
|
|
2238
2237
|
margin: 0;
|
|
2239
2238
|
background: var(--border-color-secondary);
|
|
2240
|
-
`,
|
|
2239
|
+
`, qr = c.li`
|
|
2241
2240
|
display: flex;
|
|
2242
2241
|
flex-direction: column;
|
|
2243
2242
|
gap: var(--dropdown-menu-item-gap);
|
|
2244
2243
|
list-style: none;
|
|
2245
2244
|
min-height: 0;
|
|
2246
2245
|
overflow-y: auto;
|
|
2247
|
-
`,
|
|
2246
|
+
`, Kr = c(Ze)`
|
|
2248
2247
|
flex-shrink: 0;
|
|
2248
|
+
`, Zr = 280;
|
|
2249
|
+
function ft({ pinToBottom: e = !1 }) {
|
|
2250
|
+
const [t, n] = G(
|
|
2251
|
+
() => ke().getIndexingActivityState().inProgress
|
|
2252
|
+
);
|
|
2253
|
+
return H(() => ke().subscribe("indexing-activity", (r) => {
|
|
2254
|
+
n(r.inProgress);
|
|
2255
|
+
}), []), /* @__PURE__ */ i(Jr, { $open: t, $pinToBottom: e, "aria-hidden": !t, children: /* @__PURE__ */ i(
|
|
2256
|
+
U,
|
|
2257
|
+
{
|
|
2258
|
+
tip: "We're building a search index of your project. Until it's ready, the assistant may need more context in each reply to stay accurate, which can use more tokens.",
|
|
2259
|
+
placement: "top",
|
|
2260
|
+
width: "240px",
|
|
2261
|
+
arrowPosition: "left",
|
|
2262
|
+
children: /* @__PURE__ */ h(Xr, { role: "status", "aria-live": "polite", "aria-label": "Indexing in progress...", children: [
|
|
2263
|
+
/* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(J, {}) }),
|
|
2264
|
+
/* @__PURE__ */ i(Qr, { children: "Indexing in progress..." })
|
|
2265
|
+
] })
|
|
2266
|
+
}
|
|
2267
|
+
) });
|
|
2268
|
+
}
|
|
2269
|
+
const Jr = c.div`
|
|
2270
|
+
width: 100%;
|
|
2271
|
+
display: block;
|
|
2272
|
+
|
|
2273
|
+
${({ $pinToBottom: e }) => e ? X`
|
|
2274
|
+
order: 1;
|
|
2275
|
+
margin-top: auto;
|
|
2276
|
+
` : X`
|
|
2277
|
+
position: absolute;
|
|
2278
|
+
left: 0;
|
|
2279
|
+
right: 0;
|
|
2280
|
+
bottom: 100%;
|
|
2281
|
+
z-index: 1;
|
|
2282
|
+
margin-bottom: 4px;
|
|
2283
|
+
`}
|
|
2284
|
+
|
|
2285
|
+
opacity: ${({ $open: e }) => e ? 1 : 0};
|
|
2286
|
+
transition: opacity ${Zr}ms ease-out;
|
|
2287
|
+
pointer-events: ${({ $open: e }) => e ? "auto" : "none"};
|
|
2288
|
+
|
|
2289
|
+
${J} {
|
|
2290
|
+
animation-play-state: ${({ $open: e }) => e ? "running" : "paused"};
|
|
2291
|
+
}
|
|
2292
|
+
`, Xr = c.div`
|
|
2293
|
+
width: 100%;
|
|
2294
|
+
display: flex;
|
|
2295
|
+
align-items: center;
|
|
2296
|
+
gap: var(--spacing-xxs);
|
|
2297
|
+
background: var(--layer-color);
|
|
2298
|
+
padding: 2px var(--spacing-sm);
|
|
2299
|
+
border-radius: 4px;
|
|
2300
|
+
font-size: var(--font-size-sm);
|
|
2301
|
+
line-height: 12px;
|
|
2302
|
+
`, Qr = c.div`
|
|
2303
|
+
flex: 1;
|
|
2304
|
+
min-width: 0;
|
|
2249
2305
|
`;
|
|
2250
|
-
function
|
|
2306
|
+
function ei() {
|
|
2251
2307
|
const {
|
|
2252
2308
|
chatId: e,
|
|
2253
2309
|
isLoading: t,
|
|
2254
2310
|
pendingComposerPreset: n,
|
|
2255
|
-
clearPendingComposerPreset:
|
|
2256
|
-
availableModels:
|
|
2311
|
+
clearPendingComposerPreset: o,
|
|
2312
|
+
availableModels: r,
|
|
2257
2313
|
selectedModelId: a,
|
|
2258
2314
|
selectModel: s,
|
|
2259
|
-
onSettingsOpen:
|
|
2260
|
-
} =
|
|
2261
|
-
|
|
2262
|
-
top:
|
|
2315
|
+
onSettingsOpen: d
|
|
2316
|
+
} = Ye(), { messages: l, isStreaming: u, sendMessage: f, stopGeneration: p } = Q(), { isOpen: g } = Ge(), [m, v] = G(""), x = N(null), b = N(null), w = N(!0), y = l.length > 0, S = t || y, E = zr(l.length), q = E !== void 0 && E > 0 && !y, _ = D((L = "smooth") => {
|
|
2317
|
+
b.current && b.current.scrollTo({
|
|
2318
|
+
top: b.current.scrollHeight,
|
|
2263
2319
|
behavior: L
|
|
2264
2320
|
});
|
|
2265
|
-
}, []),
|
|
2266
|
-
const L =
|
|
2321
|
+
}, []), ee = D(() => {
|
|
2322
|
+
const L = b.current;
|
|
2267
2323
|
if (!L) return;
|
|
2268
|
-
L.scrollHeight - L.scrollTop - L.clientHeight < 50 && (
|
|
2324
|
+
L.scrollHeight - L.scrollTop - L.clientHeight < 50 && (w.current = !0);
|
|
2269
2325
|
}, []);
|
|
2270
|
-
|
|
2271
|
-
const L =
|
|
2326
|
+
H(() => {
|
|
2327
|
+
const L = b.current;
|
|
2272
2328
|
if (!L) return;
|
|
2273
|
-
const
|
|
2274
|
-
|
|
2329
|
+
const fe = (vt) => {
|
|
2330
|
+
vt.deltaY < 0 && (w.current = !1);
|
|
2275
2331
|
};
|
|
2276
|
-
return L.addEventListener("wheel",
|
|
2332
|
+
return L.addEventListener("wheel", fe, { passive: !0 }), () => L.removeEventListener("wheel", fe);
|
|
2277
2333
|
}, []);
|
|
2278
|
-
const
|
|
2279
|
-
m && (v(""),
|
|
2334
|
+
const gt = D(async () => {
|
|
2335
|
+
m && (v(""), w.current = !0, await f(m), x.current && requestAnimationFrame(() => x.current?.focus()));
|
|
2280
2336
|
}, [f, m]);
|
|
2281
|
-
return
|
|
2282
|
-
g && (x.current && x.current.focus(),
|
|
2283
|
-
}, [g,
|
|
2284
|
-
u &&
|
|
2285
|
-
}),
|
|
2337
|
+
return H(() => {
|
|
2338
|
+
g && (x.current && x.current.focus(), w.current = !0, _());
|
|
2339
|
+
}, [g, l.length, _]), H(() => {
|
|
2340
|
+
u && w.current && _();
|
|
2341
|
+
}), H(
|
|
2286
2342
|
function() {
|
|
2287
|
-
g && x.current && (x.current.focus(),
|
|
2343
|
+
g && x.current && (x.current.focus(), _("instant"));
|
|
2288
2344
|
},
|
|
2289
|
-
[e, g,
|
|
2290
|
-
),
|
|
2345
|
+
[e, g, _]
|
|
2346
|
+
), H(
|
|
2291
2347
|
function() {
|
|
2292
|
-
!g || n === null || (v(n),
|
|
2348
|
+
!g || n === null || (v(n), o());
|
|
2293
2349
|
},
|
|
2294
|
-
[g, n,
|
|
2295
|
-
), /* @__PURE__ */ h(
|
|
2350
|
+
[g, n, o]
|
|
2351
|
+
), /* @__PURE__ */ h(ut, { children: [
|
|
2296
2352
|
/* @__PURE__ */ i(
|
|
2297
|
-
|
|
2353
|
+
ti,
|
|
2298
2354
|
{
|
|
2299
|
-
ref:
|
|
2300
|
-
$isExpanded:
|
|
2301
|
-
$isAnimated: u ||
|
|
2302
|
-
onScroll:
|
|
2303
|
-
children: t ? /* @__PURE__ */ i(
|
|
2355
|
+
ref: b,
|
|
2356
|
+
$isExpanded: S,
|
|
2357
|
+
$isAnimated: u || q,
|
|
2358
|
+
onScroll: ee,
|
|
2359
|
+
children: t ? /* @__PURE__ */ i(oi, { children: /* @__PURE__ */ i(we, { size: "20px" }) }) : /* @__PURE__ */ i($r, {})
|
|
2304
2360
|
}
|
|
2305
2361
|
),
|
|
2306
|
-
/* @__PURE__ */
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2362
|
+
/* @__PURE__ */ h(ni, { $isExpanded: !S, children: [
|
|
2363
|
+
/* @__PURE__ */ i(ft, { pinToBottom: !S }),
|
|
2364
|
+
/* @__PURE__ */ i(
|
|
2365
|
+
mn,
|
|
2366
|
+
{
|
|
2367
|
+
value: m,
|
|
2368
|
+
onValueChange: v,
|
|
2369
|
+
onSubmit: gt,
|
|
2370
|
+
isStreaming: u,
|
|
2371
|
+
onStop: p,
|
|
2372
|
+
textareaRef: x,
|
|
2373
|
+
modelSelector: /* @__PURE__ */ i(
|
|
2374
|
+
Br,
|
|
2375
|
+
{
|
|
2376
|
+
models: r,
|
|
2377
|
+
selectedModelId: a,
|
|
2378
|
+
placement: y ? "top" : "bottom",
|
|
2379
|
+
onModelSelect: s,
|
|
2380
|
+
onSettingsOpen: d
|
|
2381
|
+
}
|
|
2382
|
+
)
|
|
2383
|
+
}
|
|
2384
|
+
)
|
|
2385
|
+
] })
|
|
2327
2386
|
] });
|
|
2328
2387
|
}
|
|
2329
|
-
const
|
|
2388
|
+
const ti = c.div`
|
|
2330
2389
|
flex: ${({ $isExpanded: e }) => e ? 1 : 0};
|
|
2331
2390
|
width: 100%;
|
|
2332
2391
|
overflow: auto;
|
|
@@ -2334,97 +2393,103 @@ const ei = c.div`
|
|
|
2334
2393
|
transition-property: flex;
|
|
2335
2394
|
transition-duration: ${(e) => e.$isAnimated ? "var(--replay-transition-duration)" : "0s"};
|
|
2336
2395
|
transition-timing-function: var(--replay-transition-timing-function);
|
|
2337
|
-
`,
|
|
2396
|
+
`, ni = c.div`
|
|
2397
|
+
position: relative;
|
|
2398
|
+
display: flex;
|
|
2399
|
+
flex-direction: column;
|
|
2400
|
+
width: 100%;
|
|
2401
|
+
flex: ${({ $isExpanded: e }) => e ? 1 : 0};
|
|
2402
|
+
`, oi = c.div`
|
|
2338
2403
|
display: flex;
|
|
2339
2404
|
justify-content: center;
|
|
2340
2405
|
height: 100%;
|
|
2341
2406
|
padding-top: var(--spacing-lg);
|
|
2342
|
-
`,
|
|
2407
|
+
`, $ = {
|
|
2343
2408
|
TODAY: "today",
|
|
2344
2409
|
YESTERDAY: "yesterday",
|
|
2345
2410
|
LAST_WEEK: "last_week",
|
|
2346
2411
|
LAST_MONTH: "last_month",
|
|
2347
2412
|
OLDER: "older"
|
|
2348
|
-
},
|
|
2349
|
-
[
|
|
2350
|
-
[
|
|
2351
|
-
[
|
|
2352
|
-
[
|
|
2353
|
-
[
|
|
2413
|
+
}, ri = {
|
|
2414
|
+
[$.TODAY]: "Today",
|
|
2415
|
+
[$.YESTERDAY]: "Yesterday",
|
|
2416
|
+
[$.LAST_WEEK]: "Last 7 days",
|
|
2417
|
+
[$.LAST_MONTH]: "Last 30 days",
|
|
2418
|
+
[$.OLDER]: "Older"
|
|
2354
2419
|
};
|
|
2355
|
-
function
|
|
2356
|
-
const n =
|
|
2357
|
-
return n.isSame(
|
|
2420
|
+
function ii(e, t = Date.now()) {
|
|
2421
|
+
const n = W(e).startOf("day"), o = W(t).startOf("day"), r = W(t).subtract(1, "day").startOf("day"), a = W(t).subtract(7, "day").startOf("day"), s = W(t).subtract(30, "day").startOf("day");
|
|
2422
|
+
return n.isSame(o, "day") ? $.TODAY : n.isSame(r, "day") ? $.YESTERDAY : !n.isBefore(a, "day") && n.isBefore(r, "day") ? $.LAST_WEEK : !n.isBefore(s, "day") && n.isBefore(a, "day") ? $.LAST_MONTH : $.OLDER;
|
|
2358
2423
|
}
|
|
2359
|
-
function
|
|
2424
|
+
function ai(e) {
|
|
2360
2425
|
const t = [];
|
|
2361
2426
|
for (const n of e) {
|
|
2362
|
-
const
|
|
2363
|
-
!
|
|
2427
|
+
const o = ii(n.updatedAt), r = t[t.length - 1];
|
|
2428
|
+
!r || r.bucket !== o ? t.push({ bucket: o, chats: [n] }) : r.chats.push(n);
|
|
2364
2429
|
}
|
|
2365
2430
|
return t;
|
|
2366
2431
|
}
|
|
2367
|
-
function
|
|
2432
|
+
function si(e) {
|
|
2368
2433
|
const {
|
|
2369
2434
|
scrollRef: t,
|
|
2370
2435
|
sentinelRef: n,
|
|
2371
|
-
hasNextPage:
|
|
2372
|
-
isFetchingNextPage:
|
|
2436
|
+
hasNextPage: o,
|
|
2437
|
+
isFetchingNextPage: r,
|
|
2373
2438
|
fetchNextPage: a,
|
|
2374
2439
|
observerResetKey: s
|
|
2375
2440
|
} = e;
|
|
2376
|
-
|
|
2377
|
-
const
|
|
2378
|
-
if (!
|
|
2441
|
+
Fe(() => {
|
|
2442
|
+
const d = t.current, l = n.current;
|
|
2443
|
+
if (!d || !l) return;
|
|
2379
2444
|
const u = new IntersectionObserver(
|
|
2380
2445
|
(f) => {
|
|
2381
2446
|
const p = f[0];
|
|
2382
|
-
p && p.isIntersecting &&
|
|
2447
|
+
p && p.isIntersecting && o && (r || a());
|
|
2383
2448
|
},
|
|
2384
|
-
{ root:
|
|
2449
|
+
{ root: d, rootMargin: "80px" }
|
|
2385
2450
|
);
|
|
2386
|
-
return u.observe(
|
|
2451
|
+
return u.observe(l), () => {
|
|
2387
2452
|
u.disconnect();
|
|
2388
2453
|
};
|
|
2389
|
-
}, [s, a,
|
|
2454
|
+
}, [s, a, o, r, t, n]);
|
|
2390
2455
|
}
|
|
2391
|
-
const
|
|
2456
|
+
const pt = c(ut)`
|
|
2392
2457
|
gap: var(--spacing-xxs);
|
|
2393
2458
|
user-select: none;
|
|
2394
|
-
`,
|
|
2459
|
+
`, ci = c.div`
|
|
2395
2460
|
display: flex;
|
|
2396
2461
|
flex-direction: column;
|
|
2397
2462
|
gap: var(--spacing-xs);
|
|
2398
|
-
`,
|
|
2463
|
+
`, li = c.div`
|
|
2399
2464
|
display: flex;
|
|
2400
2465
|
flex-direction: column;
|
|
2401
2466
|
gap: var(--spacing-xxs);
|
|
2402
|
-
`,
|
|
2467
|
+
`, di = c(pt)`
|
|
2403
2468
|
display: flex;
|
|
2404
2469
|
flex-grow: 1;
|
|
2405
2470
|
align-items: center;
|
|
2406
2471
|
flex-direction: column;
|
|
2407
2472
|
padding: var(--spacing-md);
|
|
2408
|
-
`,
|
|
2473
|
+
`, ui = c.div`
|
|
2409
2474
|
display: flex;
|
|
2410
2475
|
flex-grow: 1;
|
|
2411
2476
|
align-items: center;
|
|
2412
2477
|
justify-content: center;
|
|
2413
|
-
`,
|
|
2478
|
+
`, fi = c.div`
|
|
2414
2479
|
display: flex;
|
|
2415
2480
|
flex-direction: column;
|
|
2416
2481
|
align-items: center;
|
|
2417
2482
|
max-width: 75%;
|
|
2418
2483
|
gap: var(--spacing-xxs);
|
|
2419
|
-
`,
|
|
2484
|
+
`, pi = c.div`
|
|
2420
2485
|
display: flex;
|
|
2421
2486
|
justify-content: center;
|
|
2422
2487
|
padding: var(--spacing-xs);
|
|
2423
|
-
`,
|
|
2488
|
+
`, hi = c(se)`
|
|
2424
2489
|
padding-left: var(--spacing-xs);
|
|
2425
2490
|
font-size: var(--font-size-sm);
|
|
2426
2491
|
color: var(--color-warm-grey-7);
|
|
2427
|
-
`,
|
|
2492
|
+
`, gi = c.div`
|
|
2428
2493
|
display: flex;
|
|
2429
2494
|
flex-grow: 1;
|
|
2430
2495
|
|
|
@@ -2432,7 +2497,7 @@ const gt = c(ht)`
|
|
|
2432
2497
|
flex-grow: 1;
|
|
2433
2498
|
min-width: 0;
|
|
2434
2499
|
}
|
|
2435
|
-
`,
|
|
2500
|
+
`, vi = c.div`
|
|
2436
2501
|
display: flex;
|
|
2437
2502
|
align-items: center;
|
|
2438
2503
|
justify-content: space-between;
|
|
@@ -2443,7 +2508,7 @@ const gt = c(ht)`
|
|
|
2443
2508
|
gap: calc(var(--spacing-xxs) * 2.5);
|
|
2444
2509
|
cursor: pointer;
|
|
2445
2510
|
|
|
2446
|
-
${
|
|
2511
|
+
${B} {
|
|
2447
2512
|
display: none;
|
|
2448
2513
|
}
|
|
2449
2514
|
|
|
@@ -2451,73 +2516,73 @@ const gt = c(ht)`
|
|
|
2451
2516
|
&:hover {
|
|
2452
2517
|
background-color: var(--color-hover-base);
|
|
2453
2518
|
|
|
2454
|
-
${
|
|
2519
|
+
${B} {
|
|
2455
2520
|
display: inline-flex;
|
|
2456
2521
|
}
|
|
2457
2522
|
}
|
|
2458
|
-
`,
|
|
2523
|
+
`, mi = c(se)`
|
|
2459
2524
|
overflow: hidden;
|
|
2460
2525
|
white-space: nowrap;
|
|
2461
2526
|
text-overflow: ellipsis;
|
|
2462
|
-
`,
|
|
2527
|
+
`, yi = c.div`
|
|
2463
2528
|
height: 1px;
|
|
2464
2529
|
flex-shrink: 0;
|
|
2465
2530
|
`;
|
|
2466
|
-
function
|
|
2467
|
-
const { chat: t, onSelect: n, onRemove:
|
|
2468
|
-
return /* @__PURE__ */ i(
|
|
2469
|
-
/* @__PURE__ */ i(
|
|
2531
|
+
function xi(e) {
|
|
2532
|
+
const { chat: t, onSelect: n, onRemove: o } = e;
|
|
2533
|
+
return /* @__PURE__ */ i(gi, { children: /* @__PURE__ */ i(U, { tip: W(t.updatedAt).format("MMM DD, YYYY, hh:mm:ss A"), className: "expanded", children: /* @__PURE__ */ h(vi, { role: "button", onClick: () => n?.(t.id), children: [
|
|
2534
|
+
/* @__PURE__ */ i(mi, { children: t.title ?? "New chat" }),
|
|
2470
2535
|
/* @__PURE__ */ i(
|
|
2471
|
-
|
|
2536
|
+
B,
|
|
2472
2537
|
{
|
|
2473
2538
|
variant: "ghost",
|
|
2474
2539
|
size: "small",
|
|
2475
2540
|
tone: "danger",
|
|
2476
|
-
icon: /* @__PURE__ */ i(
|
|
2477
|
-
onClick: (
|
|
2478
|
-
|
|
2541
|
+
icon: /* @__PURE__ */ i(an, {}),
|
|
2542
|
+
onClick: (r) => {
|
|
2543
|
+
r.stopPropagation(), o?.(t.id);
|
|
2479
2544
|
}
|
|
2480
2545
|
}
|
|
2481
2546
|
)
|
|
2482
2547
|
] }) }) });
|
|
2483
2548
|
}
|
|
2484
|
-
function
|
|
2485
|
-
const { group: t, onChatSelect: n, onChatRemove:
|
|
2486
|
-
return /* @__PURE__ */ h(
|
|
2487
|
-
/* @__PURE__ */ i(
|
|
2488
|
-
t.chats.map((
|
|
2489
|
-
|
|
2549
|
+
function bi(e) {
|
|
2550
|
+
const { group: t, onChatSelect: n, onChatRemove: o } = e;
|
|
2551
|
+
return /* @__PURE__ */ h(li, { children: [
|
|
2552
|
+
/* @__PURE__ */ i(hi, { children: ri[t.bucket] }),
|
|
2553
|
+
t.chats.map((r) => /* @__PURE__ */ i(
|
|
2554
|
+
xi,
|
|
2490
2555
|
{
|
|
2491
|
-
chat:
|
|
2556
|
+
chat: r,
|
|
2492
2557
|
onSelect: n,
|
|
2493
|
-
onRemove:
|
|
2558
|
+
onRemove: o
|
|
2494
2559
|
},
|
|
2495
|
-
|
|
2560
|
+
r.id
|
|
2496
2561
|
))
|
|
2497
2562
|
] });
|
|
2498
2563
|
}
|
|
2499
|
-
function
|
|
2500
|
-
return /* @__PURE__ */ i(
|
|
2501
|
-
/* @__PURE__ */ i(
|
|
2502
|
-
/* @__PURE__ */ i(
|
|
2564
|
+
function wi() {
|
|
2565
|
+
return /* @__PURE__ */ i(ui, { children: /* @__PURE__ */ h(fi, { children: [
|
|
2566
|
+
/* @__PURE__ */ i(se, { textAlign: "center", fontWeight: "var(--font-weight-semibold)", children: "No chat history" }),
|
|
2567
|
+
/* @__PURE__ */ i(se, { textAlign: "center", children: "Ask questions or let the assistant take action for you." })
|
|
2503
2568
|
] }) });
|
|
2504
2569
|
}
|
|
2505
|
-
function
|
|
2506
|
-
return /* @__PURE__ */ i(
|
|
2507
|
-
}
|
|
2508
|
-
const
|
|
2509
|
-
function
|
|
2510
|
-
const { onChatSelect: t, onChatRemove: n } = e,
|
|
2511
|
-
return
|
|
2512
|
-
scrollRef:
|
|
2513
|
-
sentinelRef:
|
|
2514
|
-
hasNextPage:
|
|
2515
|
-
isFetchingNextPage:
|
|
2570
|
+
function Ci() {
|
|
2571
|
+
return /* @__PURE__ */ i(di, { children: /* @__PURE__ */ i(we, {}) });
|
|
2572
|
+
}
|
|
2573
|
+
const ki = 50;
|
|
2574
|
+
function Ti(e) {
|
|
2575
|
+
const { onChatSelect: t, onChatRemove: n } = e, o = N(null), r = N(null), { data: a, isPending: s, hasNextPage: d, isFetchingNextPage: l, fetchNextPage: u } = jt(ki), f = A(() => (a?.pages ?? []).flatMap((g) => g.items), [a?.pages]), p = A(() => ai(f), [f]);
|
|
2576
|
+
return si({
|
|
2577
|
+
scrollRef: o,
|
|
2578
|
+
sentinelRef: r,
|
|
2579
|
+
hasNextPage: d,
|
|
2580
|
+
isFetchingNextPage: l,
|
|
2516
2581
|
fetchNextPage: u,
|
|
2517
2582
|
observerResetKey: a?.pages.length
|
|
2518
|
-
}), s && !a ? /* @__PURE__ */ i(
|
|
2519
|
-
/* @__PURE__ */ i(
|
|
2520
|
-
|
|
2583
|
+
}), s && !a ? /* @__PURE__ */ i(Ci, {}) : f.length === 0 ? /* @__PURE__ */ i(wi, {}) : /* @__PURE__ */ h(pt, { ref: o, children: [
|
|
2584
|
+
/* @__PURE__ */ i(ci, { children: p.map((g) => /* @__PURE__ */ i(
|
|
2585
|
+
bi,
|
|
2521
2586
|
{
|
|
2522
2587
|
group: g,
|
|
2523
2588
|
onChatSelect: t,
|
|
@@ -2525,21 +2590,21 @@ function Ci(e) {
|
|
|
2525
2590
|
},
|
|
2526
2591
|
`${g.bucket}-${g.chats[0]?.id ?? ""}`
|
|
2527
2592
|
)) }),
|
|
2528
|
-
|
|
2529
|
-
|
|
2593
|
+
d && /* @__PURE__ */ i(yi, { ref: r, "aria-hidden": !0 }),
|
|
2594
|
+
l && /* @__PURE__ */ i(pi, { children: /* @__PURE__ */ i(we, {}) })
|
|
2530
2595
|
] });
|
|
2531
2596
|
}
|
|
2532
|
-
const
|
|
2533
|
-
function
|
|
2534
|
-
const t =
|
|
2597
|
+
const Ii = yt(null);
|
|
2598
|
+
function Ai(e) {
|
|
2599
|
+
const t = xt(Ii);
|
|
2535
2600
|
if (t?.components) {
|
|
2536
2601
|
const { LinkComponent: s } = t.components;
|
|
2537
2602
|
return /* @__PURE__ */ i(s, { ...e });
|
|
2538
2603
|
}
|
|
2539
|
-
const { external: n, languageInsensitive:
|
|
2540
|
-
return /* @__PURE__ */ i(
|
|
2604
|
+
const { external: n, languageInsensitive: o, innerRef: r, ...a } = e;
|
|
2605
|
+
return /* @__PURE__ */ i(fn, { ref: r, ...a });
|
|
2541
2606
|
}
|
|
2542
|
-
const
|
|
2607
|
+
const Si = () => bt`
|
|
2543
2608
|
0% {
|
|
2544
2609
|
color: var(--button-content-color);
|
|
2545
2610
|
background-color: var(--button-bg-color-active);
|
|
@@ -2553,30 +2618,30 @@ const Ii = () => bt`
|
|
|
2553
2618
|
color: var(--button-content-color);
|
|
2554
2619
|
background-color: var(--button-bg-color-active);
|
|
2555
2620
|
}
|
|
2556
|
-
`,
|
|
2621
|
+
`, Li = c(Ai)`
|
|
2557
2622
|
text-decoration: none;
|
|
2558
2623
|
&:focus-visible {
|
|
2559
2624
|
outline: 1px solid var(--button-border-color-focused);
|
|
2560
2625
|
}
|
|
2561
2626
|
border-radius: var(--button-border-radius);
|
|
2562
2627
|
`;
|
|
2563
|
-
function
|
|
2628
|
+
function Pi({
|
|
2564
2629
|
variant: e = "secondary",
|
|
2565
2630
|
tone: t = "default",
|
|
2566
2631
|
size: n = "medium",
|
|
2567
|
-
extraClass:
|
|
2568
|
-
className:
|
|
2632
|
+
extraClass: o = "",
|
|
2633
|
+
className: r = ""
|
|
2569
2634
|
}) {
|
|
2570
2635
|
return [
|
|
2571
2636
|
"button",
|
|
2572
|
-
|
|
2637
|
+
o,
|
|
2573
2638
|
`button-tone-${t}`,
|
|
2574
2639
|
`button-variant-${e}`,
|
|
2575
2640
|
`button-size-${n}`,
|
|
2576
|
-
|
|
2641
|
+
r
|
|
2577
2642
|
].filter((s) => s).join(" ").trim();
|
|
2578
2643
|
}
|
|
2579
|
-
const
|
|
2644
|
+
const Ei = c.button`
|
|
2580
2645
|
width: ${({ $fullWidth: e }) => e ? "100%" : "auto"};
|
|
2581
2646
|
|
|
2582
2647
|
display: inline-flex;
|
|
@@ -2647,90 +2712,90 @@ const Li = c.button`
|
|
|
2647
2712
|
border-width: var(--button-border-width-disabled);
|
|
2648
2713
|
}
|
|
2649
2714
|
|
|
2650
|
-
${({ $variant: e, $size: t }) => (e === "link" || e === "ghost") && t === "small" &&
|
|
2715
|
+
${({ $variant: e, $size: t }) => (e === "link" || e === "ghost") && t === "small" && X`
|
|
2651
2716
|
--button-font-size: var(--font-size-sm);
|
|
2652
2717
|
--button-line-height: var(--line-height-sm);
|
|
2653
2718
|
--button-icon-padding: var(--button-icon-padding-small) !important;
|
|
2654
2719
|
`}
|
|
2655
2720
|
|
|
2656
|
-
${({ $blinking: e }) => e &&
|
|
2721
|
+
${({ $blinking: e }) => e && X`
|
|
2657
2722
|
pointer-events: none;
|
|
2658
|
-
animation: ${
|
|
2723
|
+
animation: ${Si()} 1.2s infinite;
|
|
2659
2724
|
`}
|
|
2660
|
-
`,
|
|
2725
|
+
`, Ri = (e) => {
|
|
2661
2726
|
const {
|
|
2662
2727
|
languageInsensitive: t,
|
|
2663
2728
|
fullWidth: n,
|
|
2664
|
-
blinking:
|
|
2665
|
-
iconPosition:
|
|
2729
|
+
blinking: o,
|
|
2730
|
+
iconPosition: r,
|
|
2666
2731
|
icon: a,
|
|
2667
2732
|
children: s,
|
|
2668
|
-
variant:
|
|
2669
|
-
tone:
|
|
2733
|
+
variant: d,
|
|
2734
|
+
tone: l,
|
|
2670
2735
|
size: u,
|
|
2671
2736
|
extraClass: f,
|
|
2672
2737
|
to: p,
|
|
2673
2738
|
external: g,
|
|
2674
2739
|
className: m,
|
|
2675
2740
|
...v
|
|
2676
|
-
} = e, x = "tabIndex" in e ? e.tabIndex : e.to ? -1 : void 0,
|
|
2677
|
-
|
|
2741
|
+
} = e, x = "tabIndex" in e ? e.tabIndex : e.to ? -1 : void 0, b = /* @__PURE__ */ h(
|
|
2742
|
+
Ei,
|
|
2678
2743
|
{
|
|
2679
2744
|
"data-component-name": "Button/Button",
|
|
2680
2745
|
...v,
|
|
2681
|
-
className:
|
|
2746
|
+
className: Pi({ variant: d, tone: l, size: u, extraClass: f, className: m }),
|
|
2682
2747
|
$fullWidth: n,
|
|
2683
|
-
$blinking:
|
|
2684
|
-
$iconPosition:
|
|
2748
|
+
$blinking: o,
|
|
2749
|
+
$iconPosition: r,
|
|
2685
2750
|
$icon: a,
|
|
2686
2751
|
$iconOnly: !s && a != null,
|
|
2687
|
-
$variant:
|
|
2752
|
+
$variant: d,
|
|
2688
2753
|
$size: u,
|
|
2689
2754
|
tabIndex: x,
|
|
2690
2755
|
children: [
|
|
2691
|
-
a &&
|
|
2756
|
+
a && r !== "right" && a,
|
|
2692
2757
|
s,
|
|
2693
|
-
a &&
|
|
2758
|
+
a && r === "right" && a
|
|
2694
2759
|
]
|
|
2695
2760
|
}
|
|
2696
2761
|
);
|
|
2697
2762
|
return p ? /* @__PURE__ */ i(
|
|
2698
|
-
|
|
2763
|
+
Li,
|
|
2699
2764
|
{
|
|
2700
2765
|
to: p,
|
|
2701
2766
|
external: g,
|
|
2702
2767
|
languageInsensitive: t,
|
|
2703
2768
|
onClick: e.onClick,
|
|
2704
|
-
children:
|
|
2769
|
+
children: b
|
|
2705
2770
|
}
|
|
2706
|
-
) :
|
|
2707
|
-
},
|
|
2708
|
-
function
|
|
2709
|
-
const e =
|
|
2710
|
-
return
|
|
2771
|
+
) : b;
|
|
2772
|
+
}, ae = c(Ri)``;
|
|
2773
|
+
function Oi() {
|
|
2774
|
+
const e = N(null), [t, n] = G(!1);
|
|
2775
|
+
return Fe(() => {
|
|
2711
2776
|
if (!e.current) return;
|
|
2712
|
-
const
|
|
2713
|
-
function
|
|
2714
|
-
n(
|
|
2777
|
+
const o = e.current;
|
|
2778
|
+
function r() {
|
|
2779
|
+
n(o.scrollWidth > o.clientWidth);
|
|
2715
2780
|
}
|
|
2716
|
-
|
|
2717
|
-
const a = new ResizeObserver(
|
|
2718
|
-
return a.observe(
|
|
2781
|
+
r();
|
|
2782
|
+
const a = new ResizeObserver(r);
|
|
2783
|
+
return a.observe(o), () => a.disconnect();
|
|
2719
2784
|
}, []), {
|
|
2720
2785
|
ref: e,
|
|
2721
2786
|
value: t
|
|
2722
2787
|
};
|
|
2723
2788
|
}
|
|
2724
|
-
function
|
|
2725
|
-
const { ref: t, value: n } =
|
|
2726
|
-
return /* @__PURE__ */ i(
|
|
2789
|
+
function $i(e) {
|
|
2790
|
+
const { ref: t, value: n } = Oi();
|
|
2791
|
+
return /* @__PURE__ */ i(Di, { children: /* @__PURE__ */ i(U, { tip: e.value, className: "no-overflow", disabled: !n, children: /* @__PURE__ */ i(zi, { ref: t, children: e.value }) }) });
|
|
2727
2792
|
}
|
|
2728
|
-
const
|
|
2793
|
+
const Di = c.div`
|
|
2729
2794
|
overflow: hidden;
|
|
2730
2795
|
.tooltip-no-overflow {
|
|
2731
2796
|
overflow: hidden;
|
|
2732
2797
|
}
|
|
2733
|
-
`,
|
|
2798
|
+
`, zi = c.div`
|
|
2734
2799
|
color: var(--text-color-primary);
|
|
2735
2800
|
font-size: var(--font-size-base);
|
|
2736
2801
|
line-height: var(--line-height-base);
|
|
@@ -2739,14 +2804,14 @@ const Oi = c.div`
|
|
|
2739
2804
|
text-overflow: ellipsis;
|
|
2740
2805
|
user-select: none;
|
|
2741
2806
|
`;
|
|
2742
|
-
function
|
|
2807
|
+
function ht(e) {
|
|
2743
2808
|
const { children: t, buttons: n } = e;
|
|
2744
|
-
return /* @__PURE__ */ h(
|
|
2745
|
-
/* @__PURE__ */ i(
|
|
2746
|
-
n && /* @__PURE__ */ i(
|
|
2809
|
+
return /* @__PURE__ */ h(Mi, { children: [
|
|
2810
|
+
/* @__PURE__ */ i(_i, { children: t }),
|
|
2811
|
+
n && /* @__PURE__ */ i(Vi, { children: n })
|
|
2747
2812
|
] });
|
|
2748
2813
|
}
|
|
2749
|
-
const
|
|
2814
|
+
const Mi = c.div`
|
|
2750
2815
|
display: flex;
|
|
2751
2816
|
flex-direction: row;
|
|
2752
2817
|
align-items: center;
|
|
@@ -2754,62 +2819,62 @@ const Di = c.div`
|
|
|
2754
2819
|
gap: var(--spacing-xs);
|
|
2755
2820
|
width: 100%;
|
|
2756
2821
|
flex-shrink: 0;
|
|
2757
|
-
`,
|
|
2822
|
+
`, _i = c.div`
|
|
2758
2823
|
display: flex;
|
|
2759
2824
|
align-items: center;
|
|
2760
2825
|
gap: var(--spacing-xs);
|
|
2761
2826
|
min-width: 0;
|
|
2762
2827
|
flex: 1;
|
|
2763
|
-
`,
|
|
2828
|
+
`, Vi = c.div`
|
|
2764
2829
|
display: flex;
|
|
2765
2830
|
align-items: center;
|
|
2766
2831
|
gap: 2px;
|
|
2767
2832
|
`;
|
|
2768
|
-
function
|
|
2769
|
-
const { title: t, onCreateNewChat: n, onViewHistory:
|
|
2770
|
-
return /* @__PURE__ */ h(
|
|
2771
|
-
/* @__PURE__ */ i(
|
|
2772
|
-
|
|
2833
|
+
function Bi(e) {
|
|
2834
|
+
const { title: t, onCreateNewChat: n, onViewHistory: o, onClose: r } = e;
|
|
2835
|
+
return /* @__PURE__ */ h(ht, { buttons: /* @__PURE__ */ h(Ne, { children: [
|
|
2836
|
+
/* @__PURE__ */ i(U, { tip: "New chat", children: /* @__PURE__ */ i(
|
|
2837
|
+
ae,
|
|
2773
2838
|
{
|
|
2774
2839
|
size: "small",
|
|
2775
2840
|
variant: "text",
|
|
2776
2841
|
"aria-label": "Create new chat",
|
|
2777
2842
|
onClick: n,
|
|
2778
|
-
icon: /* @__PURE__ */ i(
|
|
2843
|
+
icon: /* @__PURE__ */ i(cn, {})
|
|
2779
2844
|
}
|
|
2780
2845
|
) }),
|
|
2781
|
-
/* @__PURE__ */ i(
|
|
2782
|
-
|
|
2846
|
+
/* @__PURE__ */ i(U, { tip: "Chat history", children: /* @__PURE__ */ i(
|
|
2847
|
+
ae,
|
|
2783
2848
|
{
|
|
2784
2849
|
size: "small",
|
|
2785
2850
|
variant: "text",
|
|
2786
2851
|
"aria-label": "View chat history",
|
|
2787
|
-
onClick:
|
|
2788
|
-
icon: /* @__PURE__ */ i(
|
|
2852
|
+
onClick: o,
|
|
2853
|
+
icon: /* @__PURE__ */ i(ln, {})
|
|
2789
2854
|
}
|
|
2790
2855
|
) }),
|
|
2791
|
-
/* @__PURE__ */ i(
|
|
2792
|
-
/* @__PURE__ */ i(
|
|
2793
|
-
|
|
2856
|
+
/* @__PURE__ */ i(Ni, { children: /* @__PURE__ */ i(Et, {}) }),
|
|
2857
|
+
/* @__PURE__ */ i(U, { tip: "Close", arrowPosition: "left", children: /* @__PURE__ */ i(
|
|
2858
|
+
ae,
|
|
2794
2859
|
{
|
|
2795
2860
|
variant: "text",
|
|
2796
2861
|
size: "small",
|
|
2797
2862
|
"aria-label": "Close panel",
|
|
2798
|
-
icon: /* @__PURE__ */ i(
|
|
2799
|
-
onClick:
|
|
2863
|
+
icon: /* @__PURE__ */ i(dn, {}),
|
|
2864
|
+
onClick: r
|
|
2800
2865
|
}
|
|
2801
2866
|
) })
|
|
2802
2867
|
] }), children: [
|
|
2803
|
-
/* @__PURE__ */ i(
|
|
2804
|
-
/* @__PURE__ */ i(
|
|
2868
|
+
/* @__PURE__ */ i(Hi, { children: /* @__PURE__ */ i(sn, { size: "14px" }) }),
|
|
2869
|
+
/* @__PURE__ */ i($i, { value: t })
|
|
2805
2870
|
] });
|
|
2806
2871
|
}
|
|
2807
|
-
const
|
|
2872
|
+
const Hi = c.div`
|
|
2808
2873
|
display: flex;
|
|
2809
|
-
`,
|
|
2874
|
+
`, Ni = c.div`
|
|
2810
2875
|
display: flex;
|
|
2811
2876
|
height: 14px;
|
|
2812
|
-
`,
|
|
2877
|
+
`, Fi = /* @__PURE__ */ new Set([
|
|
2813
2878
|
"color",
|
|
2814
2879
|
"fontFamily",
|
|
2815
2880
|
"fontSize",
|
|
@@ -2820,8 +2885,8 @@ const Vi = c.div`
|
|
|
2820
2885
|
"marginBottom",
|
|
2821
2886
|
"marginTop",
|
|
2822
2887
|
"textAlign"
|
|
2823
|
-
]),
|
|
2824
|
-
shouldForwardProp: (e) => !
|
|
2888
|
+
]), ji = c.span.withConfig({
|
|
2889
|
+
shouldForwardProp: (e) => !Fi.has(e)
|
|
2825
2890
|
}).attrs({
|
|
2826
2891
|
"data-component-name": "Typography/Typography"
|
|
2827
2892
|
})`
|
|
@@ -2836,63 +2901,62 @@ const Vi = c.div`
|
|
|
2836
2901
|
margin-top: ${({ marginTop: e }) => e};
|
|
2837
2902
|
text-align: ${({ textAlign: e }) => e};
|
|
2838
2903
|
`;
|
|
2839
|
-
function
|
|
2904
|
+
function Wi(e) {
|
|
2840
2905
|
const { onReturnFromHistory: t } = e;
|
|
2841
|
-
return /* @__PURE__ */ h(
|
|
2906
|
+
return /* @__PURE__ */ h(ht, { children: [
|
|
2842
2907
|
/* @__PURE__ */ i(
|
|
2843
|
-
|
|
2908
|
+
ae,
|
|
2844
2909
|
{
|
|
2845
2910
|
size: "small",
|
|
2846
2911
|
variant: "text",
|
|
2847
2912
|
"aria-label": "Return to chat",
|
|
2848
2913
|
onClick: t,
|
|
2849
|
-
icon: /* @__PURE__ */ i(
|
|
2914
|
+
icon: /* @__PURE__ */ i(un, {})
|
|
2850
2915
|
}
|
|
2851
2916
|
),
|
|
2852
|
-
/* @__PURE__ */ i(
|
|
2917
|
+
/* @__PURE__ */ i(Ui, { children: /* @__PURE__ */ i(ji, { children: "Chat history" }) })
|
|
2853
2918
|
] });
|
|
2854
2919
|
}
|
|
2855
|
-
const
|
|
2920
|
+
const Ui = c.div`
|
|
2856
2921
|
user-select: none;
|
|
2857
2922
|
`;
|
|
2858
|
-
function
|
|
2859
|
-
const [e, t] =
|
|
2860
|
-
t(
|
|
2923
|
+
function aa() {
|
|
2924
|
+
const [e, t] = G(F.CHAT), n = Ge(), o = Ye(), r = () => {
|
|
2925
|
+
t(F.HISTORY);
|
|
2861
2926
|
}, a = () => {
|
|
2862
|
-
t(
|
|
2863
|
-
}, s = async (
|
|
2864
|
-
|
|
2927
|
+
t(F.CHAT);
|
|
2928
|
+
}, s = async (d) => {
|
|
2929
|
+
o.selectChat(d), t(F.CHAT);
|
|
2865
2930
|
};
|
|
2866
|
-
return /* @__PURE__ */ h(
|
|
2867
|
-
/* @__PURE__ */ h(
|
|
2931
|
+
return /* @__PURE__ */ h(Yi, { children: [
|
|
2932
|
+
/* @__PURE__ */ h(He, { isActive: e === F.CHAT, children: [
|
|
2868
2933
|
/* @__PURE__ */ i(
|
|
2869
|
-
|
|
2934
|
+
Bi,
|
|
2870
2935
|
{
|
|
2871
|
-
title:
|
|
2872
|
-
onCreateNewChat:
|
|
2873
|
-
onViewHistory:
|
|
2936
|
+
title: o.title,
|
|
2937
|
+
onCreateNewChat: o.createNewChat,
|
|
2938
|
+
onViewHistory: r,
|
|
2874
2939
|
onClose: n.closePanel
|
|
2875
2940
|
}
|
|
2876
2941
|
),
|
|
2877
|
-
/* @__PURE__ */ i(
|
|
2878
|
-
/* @__PURE__ */ i(Ne, { children: /* @__PURE__ */ i(be, {}) })
|
|
2942
|
+
/* @__PURE__ */ i(ei, {})
|
|
2879
2943
|
] }),
|
|
2880
|
-
/* @__PURE__ */ h(
|
|
2881
|
-
/* @__PURE__ */ i(
|
|
2882
|
-
/* @__PURE__ */ i(
|
|
2883
|
-
/* @__PURE__ */ i(
|
|
2944
|
+
/* @__PURE__ */ h(He, { isActive: e === F.HISTORY, isSliding: !0, children: [
|
|
2945
|
+
/* @__PURE__ */ i(Wi, { onReturnFromHistory: a }),
|
|
2946
|
+
/* @__PURE__ */ i(Ti, { onChatSelect: s, onChatRemove: o.removeChat }),
|
|
2947
|
+
/* @__PURE__ */ i(qi, { children: /* @__PURE__ */ i(ft, { pinToBottom: !0 }) })
|
|
2884
2948
|
] })
|
|
2885
2949
|
] });
|
|
2886
2950
|
}
|
|
2887
|
-
function
|
|
2888
|
-
const { children: t, isActive: n, isSliding:
|
|
2889
|
-
return
|
|
2951
|
+
function He(e) {
|
|
2952
|
+
const { children: t, isActive: n, isSliding: o = !1 } = e, r = /* @__PURE__ */ i(Gi, { inert: !n, children: t });
|
|
2953
|
+
return o ? /* @__PURE__ */ i(Ki, { $isExpanded: n, children: r }) : r;
|
|
2890
2954
|
}
|
|
2891
|
-
const
|
|
2955
|
+
const Yi = c.div`
|
|
2892
2956
|
position: relative;
|
|
2893
2957
|
height: 100%;
|
|
2894
2958
|
overflow: clip;
|
|
2895
|
-
`,
|
|
2959
|
+
`, Gi = c.div`
|
|
2896
2960
|
display: flex;
|
|
2897
2961
|
height: 100%;
|
|
2898
2962
|
flex-direction: column;
|
|
@@ -2900,7 +2964,12 @@ const Wi = c.div`
|
|
|
2900
2964
|
border-radius: var(--border-radius-md);
|
|
2901
2965
|
background: var(--bg-color);
|
|
2902
2966
|
margin-left: var(--spacing-xxs);
|
|
2903
|
-
`,
|
|
2967
|
+
`, qi = c.div`
|
|
2968
|
+
display: flex;
|
|
2969
|
+
flex-direction: column;
|
|
2970
|
+
width: 100%;
|
|
2971
|
+
padding: 0 var(--spacing-xs) var(--spacing-xs);
|
|
2972
|
+
`, Ki = c.div`
|
|
2904
2973
|
position: absolute;
|
|
2905
2974
|
inset: 0;
|
|
2906
2975
|
transform: translateX(${(e) => e.$isExpanded ? "0%" : "100%"});
|
|
@@ -2910,9 +2979,7 @@ const Wi = c.div`
|
|
|
2910
2979
|
@media (prefers-reduced-motion: reduce) {
|
|
2911
2980
|
transition-duration: 0ms;
|
|
2912
2981
|
}
|
|
2913
|
-
`, Ne = c.div`
|
|
2914
|
-
width: 100%;
|
|
2915
2982
|
`;
|
|
2916
2983
|
export {
|
|
2917
|
-
|
|
2984
|
+
aa as AiPanel
|
|
2918
2985
|
};
|