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