chordia-ui 3.4.1 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Timeline.cjs.js +1 -6
- package/dist/Timeline.cjs.js.map +1 -1
- package/dist/Timeline.es.js +129 -597
- package/dist/Timeline.es.js.map +1 -1
- package/dist/TranscriptCard.cjs.js +7 -0
- package/dist/TranscriptCard.cjs.js.map +1 -0
- package/dist/TranscriptCard.es.js +474 -0
- package/dist/TranscriptCard.es.js.map +1 -0
- package/dist/UpdatedInteractionRecording.cjs.js +1 -1
- package/dist/UpdatedInteractionRecording.cjs.js.map +1 -1
- package/dist/UpdatedInteractionRecording.es.js +201 -204
- package/dist/UpdatedInteractionRecording.es.js.map +1 -1
- package/dist/components/UpdatedInteractionDetails.cjs.js +1 -1
- package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
- package/dist/components/UpdatedInteractionDetails.es.js +1 -1
- package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
- package/dist/components/media.cjs.js +1 -1
- package/dist/components/media.cjs.js.map +1 -1
- package/dist/components/media.es.js +9 -8
- package/dist/components/media.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +53 -52
- package/dist/index.es.js.map +1 -1
- package/dist/pages/interactionDetails.cjs.js +2 -2
- package/dist/pages/interactionDetails.cjs.js.map +1 -1
- package/dist/pages/interactionDetails.es.js +17 -16
- package/dist/pages/interactionDetails.es.js.map +1 -1
- package/package.json +1 -1
- package/src/components/UpdatedInteractionDetails/UpdatedInteractionDetails.jsx +2 -2
- package/src/components/UpdatedInteractionDetails/UpdatedInteractionRecording.jsx +92 -92
package/dist/Timeline.es.js
CHANGED
|
@@ -1,556 +1,90 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
label: "AI Assistant",
|
|
21
|
-
railColor: "var(--rail-purple)",
|
|
22
|
-
cardBg: "var(--card-assistant)",
|
|
23
|
-
cardBgHighlight: "rgba(155, 122, 168, 0.10)",
|
|
24
|
-
borderColor: "var(--border-subtle)"
|
|
25
|
-
},
|
|
26
|
-
system: {
|
|
27
|
-
label: "System",
|
|
28
|
-
railColor: "var(--text-faint)",
|
|
29
|
-
cardBg: "transparent",
|
|
30
|
-
cardBgHighlight: "transparent",
|
|
31
|
-
borderColor: "transparent"
|
|
32
|
-
}
|
|
33
|
-
}, j = "conversation-turn-keyframes";
|
|
34
|
-
function K() {
|
|
35
|
-
if (typeof document > "u" || document.getElementById(j))
|
|
36
|
-
return;
|
|
37
|
-
const s = document.createElement("style");
|
|
38
|
-
s.id = j, s.textContent = `
|
|
39
|
-
@keyframes turn-playing-pulse {
|
|
40
|
-
0%, 100% { opacity: 0.4; }
|
|
41
|
-
50% { opacity: 0.9; }
|
|
42
|
-
}
|
|
43
|
-
`, document.head.appendChild(s);
|
|
44
|
-
}
|
|
45
|
-
function O({
|
|
46
|
-
role: s = "agent",
|
|
47
|
-
text: h,
|
|
48
|
-
actorLabel: f,
|
|
49
|
-
actorRailColor: B,
|
|
50
|
-
actionKicker: b,
|
|
51
|
-
toolBadges: y,
|
|
52
|
-
streaming: g = !1,
|
|
53
|
-
meta: S,
|
|
54
|
-
timeRange: E,
|
|
55
|
-
isHighlighted: T = !1,
|
|
56
|
-
highlightRailColor: n,
|
|
57
|
-
observations: i,
|
|
58
|
-
onObservationClick: x,
|
|
59
|
-
children: R
|
|
60
|
-
}) {
|
|
61
|
-
A(() => {
|
|
62
|
-
K();
|
|
63
|
-
}, []);
|
|
64
|
-
const C = P[s] || P.agent, w = f || C.label, k = B || C.railColor, o = T || g;
|
|
65
|
-
return s === "system" ? /* @__PURE__ */ t(
|
|
66
|
-
"div",
|
|
67
|
-
{
|
|
68
|
-
style: {
|
|
69
|
-
textAlign: "center",
|
|
70
|
-
padding: "6px 0",
|
|
71
|
-
flexShrink: 0,
|
|
72
|
-
fontSize: "var(--text-sm, 11px)",
|
|
73
|
-
color: "var(--text-faint, rgba(30,33,37,0.36))",
|
|
74
|
-
fontWeight: 500,
|
|
75
|
-
letterSpacing: "0.02em"
|
|
76
|
-
},
|
|
77
|
-
children: h
|
|
78
|
-
}
|
|
79
|
-
) : /* @__PURE__ */ u(
|
|
80
|
-
"div",
|
|
81
|
-
{
|
|
82
|
-
style: {
|
|
83
|
-
position: "relative",
|
|
84
|
-
padding: "10px 14px 10px 18px",
|
|
85
|
-
borderRadius: 10,
|
|
86
|
-
overflow: "hidden",
|
|
87
|
-
flexShrink: 0,
|
|
88
|
-
background: o ? C.cardBgHighlight : C.cardBg,
|
|
89
|
-
border: `1px solid ${g ? k : C.borderColor}`,
|
|
90
|
-
boxShadow: g ? `0 0 8px ${C.cardBgHighlight}` : "none",
|
|
91
|
-
transition: "background 0.2s, border-color 0.2s, box-shadow 0.2s"
|
|
92
|
-
},
|
|
93
|
-
children: [
|
|
94
|
-
/* @__PURE__ */ t(
|
|
95
|
-
"div",
|
|
96
|
-
{
|
|
97
|
-
style: {
|
|
98
|
-
position: "absolute",
|
|
99
|
-
left: 0,
|
|
100
|
-
top: 0,
|
|
101
|
-
bottom: 0,
|
|
102
|
-
width: "var(--rail-width-thin, 4px)",
|
|
103
|
-
backgroundColor: k,
|
|
104
|
-
borderRadius: "10px 0 0 10px"
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
),
|
|
108
|
-
/* @__PURE__ */ u(
|
|
109
|
-
"div",
|
|
110
|
-
{
|
|
111
|
-
style: {
|
|
112
|
-
display: "flex",
|
|
113
|
-
alignItems: "flex-start",
|
|
114
|
-
justifyContent: "space-between",
|
|
115
|
-
gap: 8,
|
|
116
|
-
marginBottom: 4
|
|
117
|
-
},
|
|
118
|
-
children: [
|
|
119
|
-
/* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
120
|
-
b ? /* @__PURE__ */ t(
|
|
121
|
-
"div",
|
|
122
|
-
{
|
|
123
|
-
style: {
|
|
124
|
-
fontSize: "var(--text-xs-plus, 10.5px)",
|
|
125
|
-
fontWeight: 650,
|
|
126
|
-
textTransform: "uppercase",
|
|
127
|
-
letterSpacing: "var(--tracking-label, 0.16em)",
|
|
128
|
-
color: k
|
|
129
|
-
},
|
|
130
|
-
children: b
|
|
131
|
-
}
|
|
132
|
-
) : null,
|
|
133
|
-
/* @__PURE__ */ t(
|
|
134
|
-
"div",
|
|
135
|
-
{
|
|
136
|
-
style: {
|
|
137
|
-
fontSize: "var(--text-xs-plus, 10.5px)",
|
|
138
|
-
fontWeight: 650,
|
|
139
|
-
textTransform: "uppercase",
|
|
140
|
-
letterSpacing: "var(--tracking-label, 0.16em)",
|
|
141
|
-
color: "var(--text-faint, rgba(30,33,37,0.36))"
|
|
142
|
-
},
|
|
143
|
-
children: w
|
|
144
|
-
}
|
|
145
|
-
)
|
|
146
|
-
] }),
|
|
147
|
-
y && y.length > 0 ? /* @__PURE__ */ t("div", { style: { display: "flex", flexWrap: "wrap", gap: 4, flexShrink: 0, justifyContent: "flex-end" }, children: y.map((e, l) => {
|
|
148
|
-
const d = e.pending, c = !d && e.success === !1;
|
|
149
|
-
return /* @__PURE__ */ u(
|
|
150
|
-
"span",
|
|
151
|
-
{
|
|
152
|
-
style: {
|
|
153
|
-
display: "inline-flex",
|
|
154
|
-
alignItems: "center",
|
|
155
|
-
gap: 5,
|
|
156
|
-
fontSize: "var(--text-xs, 10px)",
|
|
157
|
-
padding: "2px 8px 2px 6px",
|
|
158
|
-
borderRadius: 999,
|
|
159
|
-
background: "var(--paper, rgba(255,255,255,0.78))",
|
|
160
|
-
border: "1px solid var(--border-subtle, rgba(52,58,64,0.08))",
|
|
161
|
-
color: "var(--text-faint, rgba(30,33,37,0.36))",
|
|
162
|
-
fontWeight: 500,
|
|
163
|
-
fontFamily: "var(--font-fira-code, var(--font-mono, monospace))",
|
|
164
|
-
letterSpacing: "0.01em",
|
|
165
|
-
lineHeight: 1.4,
|
|
166
|
-
whiteSpace: "nowrap"
|
|
167
|
-
},
|
|
168
|
-
children: [
|
|
169
|
-
/* @__PURE__ */ t(
|
|
170
|
-
"span",
|
|
171
|
-
{
|
|
172
|
-
style: {
|
|
173
|
-
width: 5,
|
|
174
|
-
height: 5,
|
|
175
|
-
borderRadius: "50%",
|
|
176
|
-
backgroundColor: d ? "var(--rail-discovery, #5E88B0)" : c ? "var(--rail-compliance, #C98A5A)" : "var(--text-xfaint, rgba(30,33,37,0.28))",
|
|
177
|
-
flexShrink: 0
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
),
|
|
181
|
-
e.name
|
|
182
|
-
]
|
|
183
|
-
},
|
|
184
|
-
l
|
|
185
|
-
);
|
|
186
|
-
}) }) : null
|
|
187
|
-
]
|
|
188
|
-
}
|
|
189
|
-
),
|
|
190
|
-
/* @__PURE__ */ u(
|
|
191
|
-
"div",
|
|
192
|
-
{
|
|
193
|
-
style: {
|
|
194
|
-
fontSize: "var(--text-md, 13px)",
|
|
195
|
-
lineHeight: "var(--leading-normal, 1.5)",
|
|
196
|
-
color: g ? "var(--text-strong, rgba(30,33,37,0.92))" : "var(--text-base, rgba(30,33,37,0.78))",
|
|
197
|
-
fontWeight: g ? 550 : 400
|
|
198
|
-
},
|
|
199
|
-
children: [
|
|
200
|
-
h,
|
|
201
|
-
g ? /* @__PURE__ */ t(
|
|
202
|
-
"span",
|
|
203
|
-
{
|
|
204
|
-
style: {
|
|
205
|
-
display: "inline-block",
|
|
206
|
-
width: 6,
|
|
207
|
-
height: 14,
|
|
208
|
-
background: k,
|
|
209
|
-
marginLeft: 2,
|
|
210
|
-
borderRadius: 1,
|
|
211
|
-
animation: "cursorBlink 0.8s ease-in-out infinite",
|
|
212
|
-
verticalAlign: "text-bottom"
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
) : null
|
|
216
|
-
]
|
|
217
|
-
}
|
|
218
|
-
),
|
|
219
|
-
E || R || i && i.length > 0 ? /* @__PURE__ */ u("div", { style: { marginTop: 6, display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
220
|
-
R,
|
|
221
|
-
E ? /* @__PURE__ */ t(
|
|
222
|
-
"span",
|
|
223
|
-
{
|
|
224
|
-
style: {
|
|
225
|
-
fontSize: "var(--text-sm, 11px)",
|
|
226
|
-
padding: "2px 8px",
|
|
227
|
-
borderRadius: 999,
|
|
228
|
-
border: "1px solid var(--border, rgba(52,58,64,0.12))",
|
|
229
|
-
background: "var(--timestamp-bg, rgba(255,255,255,0.70))",
|
|
230
|
-
color: "var(--text-muted, rgba(30,33,37,0.56))",
|
|
231
|
-
fontFamily: "var(--font-mono, monospace)"
|
|
232
|
-
},
|
|
233
|
-
children: E
|
|
234
|
-
}
|
|
235
|
-
) : null,
|
|
236
|
-
i && i.length > 0 ? /* @__PURE__ */ t("div", { style: { display: "flex", flexWrap: "wrap", gap: 4, marginLeft: "auto" }, children: i.map((e, l) => /* @__PURE__ */ u(
|
|
237
|
-
"span",
|
|
238
|
-
{
|
|
239
|
-
onClick: e.onClick || (x ? () => x(e) : void 0),
|
|
240
|
-
style: {
|
|
241
|
-
display: "inline-flex",
|
|
242
|
-
alignItems: "center",
|
|
243
|
-
gap: 4,
|
|
244
|
-
fontSize: "var(--text-xs, 10px)",
|
|
245
|
-
padding: "2px 8px",
|
|
246
|
-
borderRadius: 999,
|
|
247
|
-
background: `color-mix(in srgb, ${e.color || "var(--state-present)"} 12%, transparent)`,
|
|
248
|
-
border: `1px solid color-mix(in srgb, ${e.color || "var(--state-present)"} 25%, transparent)`,
|
|
249
|
-
color: e.color || "var(--state-present)",
|
|
250
|
-
fontWeight: 550,
|
|
251
|
-
lineHeight: 1.4,
|
|
252
|
-
whiteSpace: "nowrap",
|
|
253
|
-
cursor: e.onClick || x ? "pointer" : "default",
|
|
254
|
-
transition: "background 0.15s"
|
|
255
|
-
},
|
|
256
|
-
title: e.reason || e.label,
|
|
257
|
-
children: [
|
|
258
|
-
/* @__PURE__ */ t("span", { style: {
|
|
259
|
-
width: 4,
|
|
260
|
-
height: 4,
|
|
261
|
-
borderRadius: "50%",
|
|
262
|
-
backgroundColor: e.color || "var(--state-present)",
|
|
263
|
-
flexShrink: 0,
|
|
264
|
-
opacity: 0.7
|
|
265
|
-
} }),
|
|
266
|
-
e.label
|
|
267
|
-
]
|
|
268
|
-
},
|
|
269
|
-
l
|
|
270
|
-
)) }) : null
|
|
271
|
-
] }) : null,
|
|
272
|
-
S ? /* @__PURE__ */ t(
|
|
273
|
-
"div",
|
|
274
|
-
{
|
|
275
|
-
style: {
|
|
276
|
-
marginTop: 6,
|
|
277
|
-
fontSize: "var(--text-xs-plus, 10.5px)",
|
|
278
|
-
color: "var(--text-faint, rgba(30,33,37,0.36))",
|
|
279
|
-
fontFamily: "var(--font-mono, monospace)"
|
|
280
|
-
},
|
|
281
|
-
children: S
|
|
282
|
-
}
|
|
283
|
-
) : null,
|
|
284
|
-
o && n ? /* @__PURE__ */ t(
|
|
285
|
-
"div",
|
|
286
|
-
{
|
|
287
|
-
style: {
|
|
288
|
-
position: "absolute",
|
|
289
|
-
right: 8,
|
|
290
|
-
top: 8,
|
|
291
|
-
bottom: 8,
|
|
292
|
-
width: 6,
|
|
293
|
-
borderRadius: 4,
|
|
294
|
-
backgroundColor: n,
|
|
295
|
-
opacity: 0.7,
|
|
296
|
-
animation: "turn-playing-pulse 1.5s ease-in-out infinite"
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
) : null
|
|
300
|
-
]
|
|
301
|
-
}
|
|
302
|
-
);
|
|
303
|
-
}
|
|
304
|
-
const V = (s) => {
|
|
305
|
-
const [h, f] = s.split("–").map((B) => {
|
|
306
|
-
const [b, y] = B.split(":").map(Number);
|
|
307
|
-
return b * 60 + y;
|
|
308
|
-
});
|
|
309
|
-
return { start: h, end: f };
|
|
310
|
-
}, q = (s) => ({
|
|
311
|
-
customer: "customer",
|
|
312
|
-
agent: "agent",
|
|
313
|
-
third_party: "agent",
|
|
314
|
-
system: "system",
|
|
315
|
-
assistant: "assistant"
|
|
316
|
-
})[s] || "agent";
|
|
317
|
-
function U({
|
|
318
|
-
turns: s,
|
|
319
|
-
audioUrl: h,
|
|
320
|
-
activeTurnIndex: f = -1,
|
|
321
|
-
autoScrollActiveTurn: B = !1,
|
|
322
|
-
isExternalPlaying: b = !1,
|
|
323
|
-
onTurnPlayPause: y
|
|
324
|
-
}) {
|
|
325
|
-
const [g, S] = H(null), [E, T] = H(!1), n = W(null), i = W(null), x = W([]), R = W(null), C = W(-1), w = typeof y == "function", k = b !== void 0;
|
|
326
|
-
A(() => {
|
|
327
|
-
if (h)
|
|
328
|
-
return n.current = new Audio(h), n.current.preload = "auto", () => {
|
|
329
|
-
n.current && (n.current.pause(), n.current = null);
|
|
330
|
-
};
|
|
331
|
-
}, [h]), A(() => () => {
|
|
332
|
-
n.current && (n.current.pause(), i.current && n.current.removeEventListener("timeupdate", i.current));
|
|
333
|
-
}, []), A(() => {
|
|
334
|
-
if (!B || f < 0)
|
|
335
|
-
return;
|
|
336
|
-
const e = R.current, l = x.current[f];
|
|
337
|
-
if (!l || !e)
|
|
338
|
-
return;
|
|
339
|
-
const d = e.getBoundingClientRect(), c = l.getBoundingClientRect(), v = 12, m = c.top >= d.top + v && c.bottom <= d.bottom - 8;
|
|
340
|
-
if (!(C.current === f) || !m) {
|
|
341
|
-
const M = c.top - d.top + e.scrollTop;
|
|
342
|
-
e.scrollTop = Math.max(M - v, 0);
|
|
343
|
-
}
|
|
344
|
-
C.current = f;
|
|
345
|
-
}, [f, B]);
|
|
346
|
-
const o = (e, l) => {
|
|
347
|
-
if (w) {
|
|
348
|
-
y(s[l], l);
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
if (g === l && E)
|
|
352
|
-
n.current && (n.current.pause(), i.current && (n.current.removeEventListener("timeupdate", i.current), i.current = null)), T(!1);
|
|
353
|
-
else {
|
|
354
|
-
const d = g;
|
|
355
|
-
if (S(l), h && n.current) {
|
|
356
|
-
const { start: c, end: v } = V(e);
|
|
357
|
-
d !== null && d !== l && (n.current.pause(), i.current && (n.current.removeEventListener("timeupdate", i.current), i.current = null));
|
|
358
|
-
const m = () => {
|
|
359
|
-
if (n.current) {
|
|
360
|
-
if (n.current.currentTime = c, v) {
|
|
361
|
-
const $ = () => {
|
|
362
|
-
n.current && n.current.currentTime >= v && (n.current.pause(), T(!1), S(null), i.current && (n.current.removeEventListener("timeupdate", i.current), i.current = null));
|
|
363
|
-
};
|
|
364
|
-
i.current = $, n.current.addEventListener("timeupdate", $);
|
|
365
|
-
}
|
|
366
|
-
n.current.play().then(() => T(!0)).catch(($) => {
|
|
367
|
-
$ && $.name === "AbortError" || (T(!1), S(null));
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
};
|
|
371
|
-
n.current.readyState >= 2 ? m() : (n.current.addEventListener("loadedmetadata", m, { once: !0 }), n.current.load());
|
|
372
|
-
} else
|
|
373
|
-
T(!0);
|
|
374
|
-
}
|
|
375
|
-
};
|
|
376
|
-
return /* @__PURE__ */ u(
|
|
377
|
-
"div",
|
|
378
|
-
{
|
|
379
|
-
ref: R,
|
|
380
|
-
className: "custom-thin-scrollbar-library",
|
|
381
|
-
style: {
|
|
382
|
-
maxHeight: 560,
|
|
383
|
-
overflowY: "auto",
|
|
384
|
-
scrollBehavior: "smooth",
|
|
385
|
-
border: "1px solid var(--border, rgba(52,58,64,0.12))",
|
|
386
|
-
// borderRadius: "var(--radius-lg, 12px)",
|
|
387
|
-
borderRadius: "12px 0px 0px 12px",
|
|
388
|
-
background: "var(--paper-elevated, rgba(255,255,255,0.82))",
|
|
389
|
-
padding: 16
|
|
390
|
-
},
|
|
391
|
-
children: [
|
|
392
|
-
/* @__PURE__ */ t(
|
|
393
|
-
"div",
|
|
394
|
-
{
|
|
395
|
-
style: {
|
|
396
|
-
fontSize: "var(--text-xs-plus, 10.5px)",
|
|
397
|
-
fontWeight: 650,
|
|
398
|
-
textTransform: "uppercase",
|
|
399
|
-
letterSpacing: "var(--tracking-label, 0.16em)",
|
|
400
|
-
color: "var(--text-faint, rgba(30,33,37,0.36))",
|
|
401
|
-
marginBottom: 12
|
|
402
|
-
},
|
|
403
|
-
children: "Transcript"
|
|
404
|
-
}
|
|
405
|
-
),
|
|
406
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: s.map((e, l) => {
|
|
407
|
-
const d = w || k ? !!b && f === l : g === l && E, c = !!e.isHighlighted || d, v = q(e.actorType);
|
|
408
|
-
return /* @__PURE__ */ t(
|
|
409
|
-
"div",
|
|
410
|
-
{
|
|
411
|
-
ref: (m) => {
|
|
412
|
-
x.current[l] = m;
|
|
413
|
-
},
|
|
414
|
-
children: /* @__PURE__ */ t(
|
|
415
|
-
O,
|
|
416
|
-
{
|
|
417
|
-
role: v,
|
|
418
|
-
text: e.text,
|
|
419
|
-
actorLabel: e.actor,
|
|
420
|
-
actorRailColor: e.actorColor,
|
|
421
|
-
timeRange: e.timeRange,
|
|
422
|
-
isHighlighted: c,
|
|
423
|
-
highlightRailColor: d ? e.highlightColor || (v === "agent" ? "var(--rail-outcome)" : "var(--rail-discovery)") : e.highlightColor,
|
|
424
|
-
toolBadges: e.toolBadges,
|
|
425
|
-
observations: e.observations,
|
|
426
|
-
onObservationClick: e.onObservationClick,
|
|
427
|
-
children: e.timeRange ? /* @__PURE__ */ t(
|
|
428
|
-
"button",
|
|
429
|
-
{
|
|
430
|
-
onClick: () => o(e.timeRange, l),
|
|
431
|
-
style: {
|
|
432
|
-
width: 24,
|
|
433
|
-
height: 24,
|
|
434
|
-
borderRadius: "50%",
|
|
435
|
-
border: "1px solid var(--border, rgba(52,58,64,0.12))",
|
|
436
|
-
background: d ? "var(--rail-discovery, #5E88B0)" : "var(--paper, rgba(255,255,255,0.78))",
|
|
437
|
-
display: "inline-flex",
|
|
438
|
-
alignItems: "center",
|
|
439
|
-
justifyContent: "center",
|
|
440
|
-
cursor: "pointer",
|
|
441
|
-
padding: 0,
|
|
442
|
-
transition: "all 0.15s"
|
|
443
|
-
},
|
|
444
|
-
"aria-label": d ? `Pause segment ${e.timeRange}` : `Play segment ${e.timeRange}`,
|
|
445
|
-
children: d ? /* @__PURE__ */ t(
|
|
446
|
-
F,
|
|
447
|
-
{
|
|
448
|
-
style: { width: 12, height: 12, color: "var(--paper, #fff)", fill: "var(--paper, #fff)" },
|
|
449
|
-
strokeWidth: 0
|
|
450
|
-
}
|
|
451
|
-
) : /* @__PURE__ */ t(
|
|
452
|
-
D,
|
|
453
|
-
{
|
|
454
|
-
style: { width: 12, height: 12, color: "var(--text-muted, rgba(30,33,37,0.56))", fill: "var(--text-muted, rgba(30,33,37,0.56))", marginLeft: 1 },
|
|
455
|
-
strokeWidth: 0
|
|
456
|
-
}
|
|
457
|
-
)
|
|
458
|
-
}
|
|
459
|
-
) : null
|
|
460
|
-
}
|
|
461
|
-
)
|
|
462
|
-
},
|
|
463
|
-
l
|
|
464
|
-
);
|
|
465
|
-
}) })
|
|
466
|
-
]
|
|
467
|
-
}
|
|
468
|
-
);
|
|
469
|
-
}
|
|
470
|
-
function tt({
|
|
471
|
-
segments: s = [],
|
|
472
|
-
durationSeconds: h = 0,
|
|
473
|
-
actorRows: f = [],
|
|
474
|
-
currentTimeSeconds: B = 0,
|
|
475
|
-
onSeek: b,
|
|
476
|
-
showControls: y = !1,
|
|
477
|
-
hasRecording: g = !1,
|
|
478
|
-
timelinePlaying: S = !1,
|
|
479
|
-
playbackRate: E = 1,
|
|
480
|
-
speedOptions: T = [1, 1.25, 1.5, 2],
|
|
481
|
-
onTogglePlay: n,
|
|
482
|
-
onSeekBack: i,
|
|
483
|
-
onSeekForward: x,
|
|
484
|
-
onSetPlaybackRate: R,
|
|
485
|
-
totalDurationLabel: C
|
|
1
|
+
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as L, useEffect as D, useMemo as P } from "react";
|
|
3
|
+
import { RotateCcw as S, Pause as X, Play as A, RotateCw as N } from "lucide-react";
|
|
4
|
+
function J({
|
|
5
|
+
segments: d = [],
|
|
6
|
+
durationSeconds: T = 0,
|
|
7
|
+
actorRows: b = [],
|
|
8
|
+
currentTimeSeconds: w = 0,
|
|
9
|
+
onSeek: f,
|
|
10
|
+
showControls: M = !1,
|
|
11
|
+
hasRecording: m = !1,
|
|
12
|
+
timelinePlaying: x = !1,
|
|
13
|
+
playbackRate: k = 1,
|
|
14
|
+
speedOptions: E = [1, 1.25, 1.5, 2],
|
|
15
|
+
onTogglePlay: I,
|
|
16
|
+
onSeekBack: h,
|
|
17
|
+
onSeekForward: y,
|
|
18
|
+
onSetPlaybackRate: g,
|
|
19
|
+
totalDurationLabel: F
|
|
486
20
|
}) {
|
|
487
|
-
const [
|
|
488
|
-
|
|
489
|
-
if (!
|
|
21
|
+
const [u, v] = L(null);
|
|
22
|
+
D(() => {
|
|
23
|
+
if (!u)
|
|
490
24
|
return;
|
|
491
|
-
const
|
|
492
|
-
return () => clearTimeout(
|
|
493
|
-
}, [
|
|
494
|
-
const
|
|
495
|
-
Number(
|
|
496
|
-
...
|
|
25
|
+
const t = setTimeout(() => v(null), 220);
|
|
26
|
+
return () => clearTimeout(t);
|
|
27
|
+
}, [u]);
|
|
28
|
+
const a = Math.max(
|
|
29
|
+
Number(T) || 0,
|
|
30
|
+
...d.map((t) => Number(t.endTime) || 0),
|
|
497
31
|
1
|
|
498
|
-
),
|
|
499
|
-
const
|
|
500
|
-
return `${
|
|
501
|
-
},
|
|
502
|
-
if (
|
|
503
|
-
return
|
|
504
|
-
...
|
|
505
|
-
segments:
|
|
32
|
+
), C = Math.max(0, Math.min(Number(w) || 0, a)), $ = a > 0 ? C / a * 100 : 0, z = `calc(${$}% + ${(5 * (1 - $ / 100)).toFixed(4)}rem)`, n = (t) => {
|
|
33
|
+
const i = Math.floor(t / 60), e = Math.floor(t % 60);
|
|
34
|
+
return `${i.toString().padStart(2, "0")}:${e.toString().padStart(2, "0")}`;
|
|
35
|
+
}, B = P(() => {
|
|
36
|
+
if (b.length)
|
|
37
|
+
return b.map((e) => ({
|
|
38
|
+
...e,
|
|
39
|
+
segments: d.filter((c) => c.actor === e.key)
|
|
506
40
|
}));
|
|
507
|
-
const
|
|
508
|
-
return
|
|
509
|
-
key:
|
|
510
|
-
label:
|
|
511
|
-
color:
|
|
512
|
-
segments:
|
|
41
|
+
const t = Array.from(new Set(d.map((e) => e.actor))), i = new Map(d.map((e) => [e.actor, e.actorColor]));
|
|
42
|
+
return t.map((e) => ({
|
|
43
|
+
key: e,
|
|
44
|
+
label: e,
|
|
45
|
+
color: i.get(e) || "#6B7C93",
|
|
46
|
+
segments: d.filter((c) => c.actor === e)
|
|
513
47
|
}));
|
|
514
|
-
}, [
|
|
515
|
-
for (let
|
|
516
|
-
|
|
517
|
-
(!
|
|
518
|
-
const
|
|
519
|
-
if (!
|
|
48
|
+
}, [b, d]), l = [], j = 120;
|
|
49
|
+
for (let t = 0; t <= a; t += j)
|
|
50
|
+
l.push(t);
|
|
51
|
+
(!l.length || l[l.length - 1] < a) && l.push(a);
|
|
52
|
+
const R = (t) => {
|
|
53
|
+
if (!f)
|
|
520
54
|
return;
|
|
521
|
-
const
|
|
522
|
-
if (!
|
|
55
|
+
const i = t.currentTarget.getBoundingClientRect();
|
|
56
|
+
if (!i.width)
|
|
523
57
|
return;
|
|
524
|
-
const
|
|
525
|
-
|
|
58
|
+
const e = Math.max(0, Math.min((t.clientX - i.left) / i.width, 1));
|
|
59
|
+
f(e * a);
|
|
526
60
|
};
|
|
527
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ o("div", { style: {
|
|
528
62
|
padding: "10px 0"
|
|
529
63
|
}, children: [
|
|
530
|
-
|
|
531
|
-
/* @__PURE__ */
|
|
64
|
+
M && /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 8 }, children: [
|
|
65
|
+
/* @__PURE__ */ o("div", { style: {
|
|
532
66
|
fontSize: "var(--text-sm, 11px)",
|
|
533
67
|
fontFamily: "var(--font-mono, monospace)",
|
|
534
68
|
color: "var(--text-muted, rgba(30,33,37,0.56))",
|
|
535
69
|
fontWeight: 500,
|
|
536
70
|
minWidth: 70
|
|
537
71
|
}, children: [
|
|
538
|
-
|
|
72
|
+
n(C),
|
|
539
73
|
" ",
|
|
540
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ o("span", { style: { color: "var(--text-faint, rgba(30,33,37,0.36))" }, children: [
|
|
541
75
|
"/ ",
|
|
542
|
-
|
|
76
|
+
n(a)
|
|
543
77
|
] })
|
|
544
78
|
] }),
|
|
545
|
-
/* @__PURE__ */
|
|
546
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
80
|
+
/* @__PURE__ */ r(
|
|
547
81
|
"button",
|
|
548
82
|
{
|
|
549
83
|
type: "button",
|
|
550
84
|
onClick: () => {
|
|
551
|
-
|
|
85
|
+
v("rewind"), h == null || h();
|
|
552
86
|
},
|
|
553
|
-
disabled: !
|
|
87
|
+
disabled: !m,
|
|
554
88
|
title: "Rewind 15s",
|
|
555
89
|
style: {
|
|
556
90
|
display: "inline-flex",
|
|
@@ -559,20 +93,20 @@ function tt({
|
|
|
559
93
|
width: 28,
|
|
560
94
|
height: 28,
|
|
561
95
|
borderRadius: "50%",
|
|
562
|
-
border: `1px solid ${
|
|
96
|
+
border: `1px solid ${u === "rewind" ? "var(--rail-discovery, #5E88B0)" : "var(--border, rgba(52,58,64,0.12))"}`,
|
|
563
97
|
background: "var(--paper, rgba(255,255,255,0.78))",
|
|
564
98
|
cursor: "pointer",
|
|
565
99
|
padding: 0
|
|
566
100
|
},
|
|
567
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ r(S, { size: 13, stroke: "var(--rail-discovery, #5E88B0)" })
|
|
568
102
|
}
|
|
569
103
|
),
|
|
570
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ r(
|
|
571
105
|
"button",
|
|
572
106
|
{
|
|
573
107
|
type: "button",
|
|
574
|
-
onClick:
|
|
575
|
-
disabled: !
|
|
108
|
+
onClick: I,
|
|
109
|
+
disabled: !m,
|
|
576
110
|
style: {
|
|
577
111
|
display: "inline-flex",
|
|
578
112
|
alignItems: "center",
|
|
@@ -586,18 +120,18 @@ function tt({
|
|
|
586
120
|
cursor: "pointer",
|
|
587
121
|
padding: 0
|
|
588
122
|
},
|
|
589
|
-
"aria-label":
|
|
590
|
-
children:
|
|
123
|
+
"aria-label": x ? "Pause recording" : "Play recording",
|
|
124
|
+
children: x ? /* @__PURE__ */ r(X, { size: 14 }) : /* @__PURE__ */ r(A, { size: 14, style: { marginLeft: 1 } })
|
|
591
125
|
}
|
|
592
126
|
),
|
|
593
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ r(
|
|
594
128
|
"button",
|
|
595
129
|
{
|
|
596
130
|
type: "button",
|
|
597
131
|
onClick: () => {
|
|
598
|
-
|
|
132
|
+
v("forward"), y == null || y();
|
|
599
133
|
},
|
|
600
|
-
disabled: !
|
|
134
|
+
disabled: !m,
|
|
601
135
|
title: "Forward 15s",
|
|
602
136
|
style: {
|
|
603
137
|
display: "inline-flex",
|
|
@@ -606,23 +140,23 @@ function tt({
|
|
|
606
140
|
width: 28,
|
|
607
141
|
height: 28,
|
|
608
142
|
borderRadius: "50%",
|
|
609
|
-
border: `1px solid ${
|
|
143
|
+
border: `1px solid ${u === "forward" ? "var(--rail-discovery, #5E88B0)" : "var(--border, rgba(52,58,64,0.12))"}`,
|
|
610
144
|
background: "var(--paper, rgba(255,255,255,0.78))",
|
|
611
145
|
cursor: "pointer",
|
|
612
146
|
padding: 0
|
|
613
147
|
},
|
|
614
|
-
children: /* @__PURE__ */
|
|
148
|
+
children: /* @__PURE__ */ r(N, { size: 13, stroke: "var(--rail-discovery, #5E88B0)" })
|
|
615
149
|
}
|
|
616
150
|
),
|
|
617
|
-
/* @__PURE__ */
|
|
618
|
-
const
|
|
619
|
-
return /* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ r("div", { style: { display: "inline-flex", alignItems: "center", gap: 4, borderRadius: 999, border: "1px solid var(--border, rgba(52,58,64,0.12))", padding: "2px 3px", background: "var(--paper, rgba(255,255,255,0.78))", marginLeft: 4 }, children: E.map((t) => {
|
|
152
|
+
const i = k === t;
|
|
153
|
+
return /* @__PURE__ */ r(
|
|
620
154
|
"button",
|
|
621
155
|
{
|
|
622
156
|
type: "button",
|
|
623
|
-
onClick: () =>
|
|
624
|
-
disabled: !
|
|
625
|
-
title: `Speed: ${
|
|
157
|
+
onClick: () => g == null ? void 0 : g(t),
|
|
158
|
+
disabled: !m,
|
|
159
|
+
title: `Speed: ${t}x`,
|
|
626
160
|
style: {
|
|
627
161
|
display: "inline-flex",
|
|
628
162
|
alignItems: "center",
|
|
@@ -631,49 +165,49 @@ function tt({
|
|
|
631
165
|
minWidth: 38,
|
|
632
166
|
padding: "0 6px",
|
|
633
167
|
borderRadius: 999,
|
|
634
|
-
border: `1px solid ${
|
|
635
|
-
background:
|
|
636
|
-
color:
|
|
168
|
+
border: `1px solid ${i ? "var(--rail-discovery, #5E88B0)" : "transparent"}`,
|
|
169
|
+
background: i ? "var(--rail-discovery, #5E88B0)" : "transparent",
|
|
170
|
+
color: i ? "#fff" : "var(--text-muted, rgba(30,33,37,0.56))",
|
|
637
171
|
fontSize: "var(--text-xs, 10px)",
|
|
638
172
|
fontWeight: 600,
|
|
639
173
|
cursor: "pointer"
|
|
640
174
|
},
|
|
641
|
-
children:
|
|
175
|
+
children: t === 1.5 ? "1.50x" : `${t}x`
|
|
642
176
|
},
|
|
643
|
-
|
|
177
|
+
t
|
|
644
178
|
);
|
|
645
179
|
}) })
|
|
646
180
|
] })
|
|
647
181
|
] }),
|
|
648
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ r("div", { style: {
|
|
649
183
|
background: "var(--paper, rgba(255,255,255,0.78))",
|
|
650
184
|
border: "1px solid var(--border, rgba(52,58,64,0.12))",
|
|
651
185
|
borderRadius: 10,
|
|
652
186
|
padding: "12px 16px 10px"
|
|
653
|
-
}, children: /* @__PURE__ */
|
|
654
|
-
/* @__PURE__ */
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
/* @__PURE__ */
|
|
657
|
-
const
|
|
658
|
-
return /* @__PURE__ */
|
|
187
|
+
}, children: /* @__PURE__ */ o("div", { style: { position: "relative" }, children: [
|
|
188
|
+
/* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", marginBottom: 6, height: 16 }, children: [
|
|
189
|
+
/* @__PURE__ */ r("div", { style: { width: "5rem", flexShrink: 0 } }),
|
|
190
|
+
/* @__PURE__ */ r("div", { style: { position: "relative", flex: 1 }, children: l.map((t) => {
|
|
191
|
+
const i = a > 0 ? t / a * 100 : 0;
|
|
192
|
+
return /* @__PURE__ */ r(
|
|
659
193
|
"div",
|
|
660
194
|
{
|
|
661
195
|
style: {
|
|
662
196
|
position: "absolute",
|
|
663
197
|
fontSize: "var(--text-xs, 10px)",
|
|
664
198
|
color: "var(--text-faint, rgba(30,33,37,0.36))",
|
|
665
|
-
left: `${
|
|
199
|
+
left: `${i}%`,
|
|
666
200
|
transform: "translateX(-50%)",
|
|
667
201
|
fontFamily: "var(--font-mono, monospace)",
|
|
668
202
|
whiteSpace: "nowrap"
|
|
669
203
|
},
|
|
670
|
-
children:
|
|
204
|
+
children: n(t)
|
|
671
205
|
},
|
|
672
|
-
|
|
206
|
+
t
|
|
673
207
|
);
|
|
674
208
|
}) })
|
|
675
209
|
] }),
|
|
676
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ r(
|
|
677
211
|
"div",
|
|
678
212
|
{
|
|
679
213
|
style: {
|
|
@@ -685,29 +219,29 @@ function tt({
|
|
|
685
219
|
width: "calc(100% - 5rem)",
|
|
686
220
|
zIndex: 20
|
|
687
221
|
},
|
|
688
|
-
children:
|
|
689
|
-
const
|
|
690
|
-
return /* @__PURE__ */
|
|
222
|
+
children: l.map((t) => {
|
|
223
|
+
const i = a > 0 ? t / a * 100 : 0;
|
|
224
|
+
return /* @__PURE__ */ r(
|
|
691
225
|
"div",
|
|
692
226
|
{
|
|
693
227
|
style: {
|
|
694
228
|
position: "absolute",
|
|
695
229
|
top: 0,
|
|
696
230
|
bottom: 0,
|
|
697
|
-
left: `${
|
|
231
|
+
left: `${i}%`,
|
|
698
232
|
borderLeft: "1px dashed var(--border, rgba(52,58,64,0.12))",
|
|
699
233
|
transform: "translateX(-1px)"
|
|
700
234
|
}
|
|
701
235
|
},
|
|
702
|
-
|
|
236
|
+
t
|
|
703
237
|
);
|
|
704
238
|
})
|
|
705
239
|
}
|
|
706
240
|
),
|
|
707
|
-
/* @__PURE__ */
|
|
708
|
-
const
|
|
709
|
-
return /* @__PURE__ */
|
|
710
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: 10, marginTop: 8 }, children: B.map((t) => {
|
|
242
|
+
const i = t.key === "system" || t.label === "System";
|
|
243
|
+
return /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
244
|
+
/* @__PURE__ */ r(
|
|
711
245
|
"div",
|
|
712
246
|
{
|
|
713
247
|
style: {
|
|
@@ -719,10 +253,10 @@ function tt({
|
|
|
719
253
|
fontFamily: "var(--font-sans, system-ui, sans-serif)",
|
|
720
254
|
paddingRight: 8
|
|
721
255
|
},
|
|
722
|
-
children:
|
|
256
|
+
children: t.label
|
|
723
257
|
}
|
|
724
258
|
),
|
|
725
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ r(
|
|
726
260
|
"div",
|
|
727
261
|
{
|
|
728
262
|
style: {
|
|
@@ -733,54 +267,54 @@ function tt({
|
|
|
733
267
|
backgroundColor: "var(--paper-secondary, rgba(244,241,230,0.6))",
|
|
734
268
|
border: "1px solid var(--border-subtle, rgba(52,58,64,0.08))"
|
|
735
269
|
},
|
|
736
|
-
children:
|
|
737
|
-
let
|
|
738
|
-
|
|
739
|
-
const
|
|
740
|
-
return
|
|
270
|
+
children: t.segments.map((e, c) => {
|
|
271
|
+
let s = a > 0 ? e.startTime / a * 100 : 0, p = a > 0 ? (e.endTime - e.startTime) / a * 100 : 0;
|
|
272
|
+
s = Math.max(0, Math.min(100, s)), s + p > 100 && (p = 100 - s), p = Math.max(0, p);
|
|
273
|
+
const W = e.endTime - e.startTime;
|
|
274
|
+
return i && W <= 5 ? /* @__PURE__ */ r(
|
|
741
275
|
"div",
|
|
742
276
|
{
|
|
743
277
|
style: {
|
|
744
278
|
position: "absolute",
|
|
745
279
|
cursor: "pointer",
|
|
746
|
-
left: `${
|
|
280
|
+
left: `${s}%`,
|
|
747
281
|
top: "50%",
|
|
748
282
|
transform: "translateY(-50%)",
|
|
749
283
|
width: 10,
|
|
750
284
|
height: 10,
|
|
751
285
|
borderRadius: "50%",
|
|
752
|
-
backgroundColor:
|
|
286
|
+
backgroundColor: t.color,
|
|
753
287
|
opacity: 0.85
|
|
754
288
|
},
|
|
755
|
-
title: `${
|
|
289
|
+
title: `${t.label}: ${n(e.startTime)}-${n(e.endTime)}`
|
|
756
290
|
},
|
|
757
|
-
|
|
758
|
-
) : /* @__PURE__ */
|
|
291
|
+
c
|
|
292
|
+
) : /* @__PURE__ */ r(
|
|
759
293
|
"div",
|
|
760
294
|
{
|
|
761
295
|
style: {
|
|
762
296
|
position: "absolute",
|
|
763
297
|
top: 0,
|
|
764
298
|
bottom: 0,
|
|
765
|
-
left: `${
|
|
766
|
-
width: `${Math.max(
|
|
767
|
-
maxWidth: `${100 -
|
|
768
|
-
backgroundColor:
|
|
299
|
+
left: `${s}%`,
|
|
300
|
+
width: `${Math.max(p, 0.7)}%`,
|
|
301
|
+
maxWidth: `${100 - s}%`,
|
|
302
|
+
backgroundColor: t.color,
|
|
769
303
|
opacity: 0.85,
|
|
770
304
|
borderRadius: 2,
|
|
771
305
|
cursor: "pointer",
|
|
772
306
|
transition: "opacity 0.15s"
|
|
773
307
|
},
|
|
774
|
-
title: `${
|
|
308
|
+
title: `${t.label}: ${n(e.startTime)}-${n(e.endTime)}`
|
|
775
309
|
},
|
|
776
|
-
|
|
310
|
+
c
|
|
777
311
|
);
|
|
778
312
|
})
|
|
779
313
|
}
|
|
780
314
|
)
|
|
781
|
-
] },
|
|
315
|
+
] }, t.key);
|
|
782
316
|
}) }),
|
|
783
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ r(
|
|
784
318
|
"div",
|
|
785
319
|
{
|
|
786
320
|
style: {
|
|
@@ -793,16 +327,16 @@ function tt({
|
|
|
793
327
|
backgroundColor: "var(--rail-discovery, #5E88B0)",
|
|
794
328
|
opacity: 0.55,
|
|
795
329
|
boxShadow: "0 0 0 1px rgba(94,136,176,0.10)",
|
|
796
|
-
left:
|
|
330
|
+
left: z,
|
|
797
331
|
transform: "translateX(-50%)"
|
|
798
332
|
}
|
|
799
333
|
}
|
|
800
334
|
),
|
|
801
|
-
|
|
335
|
+
f ? /* @__PURE__ */ r(
|
|
802
336
|
"button",
|
|
803
337
|
{
|
|
804
338
|
type: "button",
|
|
805
|
-
onClick:
|
|
339
|
+
onClick: R,
|
|
806
340
|
style: {
|
|
807
341
|
position: "absolute",
|
|
808
342
|
cursor: "pointer",
|
|
@@ -825,8 +359,6 @@ function tt({
|
|
|
825
359
|
] });
|
|
826
360
|
}
|
|
827
361
|
export {
|
|
828
|
-
|
|
829
|
-
U as T,
|
|
830
|
-
tt as a
|
|
362
|
+
J as T
|
|
831
363
|
};
|
|
832
364
|
//# sourceMappingURL=Timeline.es.js.map
|