@redocly/replay 0.27.0-next.6 → 0.27.0-next.7

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