chordia-ui 3.4.2 → 3.4.3

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 (31) hide show
  1. package/dist/Timeline.cjs.js +6 -1
  2. package/dist/Timeline.cjs.js.map +1 -1
  3. package/dist/Timeline.es.js +597 -129
  4. package/dist/Timeline.es.js.map +1 -1
  5. package/dist/UpdatedInteractionRecording.cjs.js +1 -1
  6. package/dist/UpdatedInteractionRecording.cjs.js.map +1 -1
  7. package/dist/UpdatedInteractionRecording.es.js +260 -258
  8. package/dist/UpdatedInteractionRecording.es.js.map +1 -1
  9. package/dist/components/UpdatedInteractionDetails.cjs.js +2 -2
  10. package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
  11. package/dist/components/UpdatedInteractionDetails.es.js +349 -322
  12. package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
  13. package/dist/components/media.cjs.js +1 -1
  14. package/dist/components/media.cjs.js.map +1 -1
  15. package/dist/components/media.es.js +8 -9
  16. package/dist/components/media.es.js.map +1 -1
  17. package/dist/index.cjs.js +1 -1
  18. package/dist/index.es.js +52 -53
  19. package/dist/index.es.js.map +1 -1
  20. package/dist/pages/interactionDetails.cjs.js +2 -2
  21. package/dist/pages/interactionDetails.cjs.js.map +1 -1
  22. package/dist/pages/interactionDetails.es.js +16 -17
  23. package/dist/pages/interactionDetails.es.js.map +1 -1
  24. package/package.json +1 -1
  25. package/src/components/UpdatedInteractionDetails/UpdatedInteractionDetails.jsx +35 -1
  26. package/src/components/UpdatedInteractionDetails/UpdatedInteractionRecording.jsx +142 -124
  27. package/src/components/UpdatedInteractionDetails/UpdatedInteractionSignals.jsx +14 -6
  28. package/dist/TranscriptCard.cjs.js +0 -7
  29. package/dist/TranscriptCard.cjs.js.map +0 -1
  30. package/dist/TranscriptCard.es.js +0 -474
  31. package/dist/TranscriptCard.es.js.map +0 -1
@@ -1,10 +1,9 @@
1
- import { jsxs as r, jsx as o, Fragment as ne } from "react/jsx-runtime";
2
- import { forwardRef as Ee, useRef as H, useState as h, useCallback as oe, useEffect as ie, useImperativeHandle as Ge } from "react";
3
- import { FileSignal as We, RotateCcw as Me, Pause as ze, Play as He, RotateCw as Pe, ChevronDown as Ae, AudioLines as re, PauseCircle as $e, PlayCircle as Be } from "lucide-react";
4
- import { T as je } from "./Timeline.es.js";
5
- function ae(u) {
6
- const l = Math.floor(u / 60), D = Math.round(u % 60);
7
- return `${l}:${D.toString().padStart(2, "0")}`;
1
+ import { jsxs as i, jsx as r, Fragment as Ge } from "react/jsx-runtime";
2
+ import { forwardRef as Ee, useRef as P, useState as f, useCallback as re, useEffect as oe, useImperativeHandle as We } from "react";
3
+ import { FileSignal as Me, RotateCcw as ze, Pause as He, Play as Ae, RotateCw as Pe, ChevronDown as $e, AudioLines as ie, PauseCircle as Be, PlayCircle as je } from "lucide-react";
4
+ function $(p) {
5
+ const d = Math.floor(p / 60), g = Math.round(p % 60);
6
+ return `${d}:${g.toString().padStart(2, "0")}`;
8
7
  }
9
8
  const Le = {
10
9
  Agent: [
@@ -23,183 +22,185 @@ const Le = {
23
22
  { start: 0.6, end: 0.66 },
24
23
  { start: 0.74, end: 0.8 }
25
24
  ]
26
- }, C = [
25
+ }, D = [
27
26
  { speaker: "Agent", type: "agent", time: "00:04", text: "Thanks for calling Miles Point S Pensau. This is Steve. How can I help you?" },
28
27
  { speaker: "Customer", type: "customer", time: "00:12", text: "Hi, Steve. This is Sandra with Botai Catering." },
29
28
  { speaker: "Agent", type: "agent", time: "00:18", text: "Hello. How are you?" },
30
29
  { speaker: "Customer", type: "customer", time: "00:20", text: "I'm doing really good. Hey. I brought my vans in last week, and I call it a beeping van, the one that beeps when you back up. Makes the crunchy noise. So I just took it on Saturday after, I think I had the, the Miles. I picked it up on Saturday morning, and I went to an event. So So I don't know if it's the tire or something, but makes it a little crunchy noise. Sometimes when I do the brake, but only if I turn the wheel too." },
31
30
  { speaker: "Agent", type: "agent", time: "00:21", text: "Oh, interesting. Okay. Can you swing by with it one of these days?" }
32
31
  ], _e = [1, 1.25, 1.5, 2];
33
- function se(u) {
34
- if (!u)
32
+ function ae(p) {
33
+ if (!p)
35
34
  return 0;
36
- const l = u.split(":").map(Number);
37
- return (l[0] || 0) * 60 + (l[1] || 0);
35
+ const d = p.split(":").map(Number);
36
+ return (d[0] || 0) * 60 + (d[1] || 0);
38
37
  }
39
38
  const Ke = Ee(function({
40
- audioUrl: l,
41
- timelineSegments: D = [],
42
- durationSeconds: S = 0,
39
+ audioUrl: d,
40
+ timelineSegments: g = [],
41
+ durationSeconds: R = 0,
43
42
  // Parent-managed audio props (optional — if not provided, component manages its own audio)
44
- currentTimeSeconds: P,
45
- timelinePlaying: A,
46
- playbackRate: $,
47
- onSeek: T,
48
- onTogglePlay: B,
49
- onSeekBack: j,
50
- onSeekForward: L,
51
- onSetPlaybackRate: _,
52
- audioRef: X,
43
+ currentTimeSeconds: se,
44
+ timelinePlaying: B,
45
+ playbackRate: le,
46
+ onSeek: j,
47
+ onTogglePlay: w,
48
+ onSeekBack: L,
49
+ onSeekForward: _,
50
+ onSetPlaybackRate: X,
51
+ audioRef: Y,
53
52
  // Speaker names
54
- agentName: le = "Agent",
55
- customerName: ce = "Customer",
53
+ agentName: T = "Agent",
54
+ customerName: G = "Customer",
56
55
  // Transcript props
57
- transcript: g,
58
- highlightedTurns: de = /* @__PURE__ */ new Set(),
59
- activeTurnIndex: N,
60
- activeDemoIndex: he = 1,
61
- turnObservations: ue = {},
62
- setExpandedSignals: R,
63
- onTurnPlayPause: Y
64
- }, ge) {
65
- var te;
66
- const q = H(null), c = H(null), v = H(null), [K, f] = h(!1), [E, V] = h(0), [fe, pe] = h(0), [me, ye] = h(1), [F, ve] = h(null), [be, ke] = h(1), [xe, w] = h(!1), [Se, Z] = h(!1), [J, G] = h(he), a = !!X, b = !l, s = l && !a, k = b ? xe : a ? A ?? !1 : K, Fe = b ? F ?? 0 : a ? P ?? 0 : E, W = b ? be : a ? $ ?? 1 : me, M = b ? S || 156 : a ? S : fe || S || 0, z = oe(() => {
56
+ transcript: y,
57
+ highlightedTurns: ce = /* @__PURE__ */ new Set(),
58
+ activeTurnIndex: q,
59
+ activeDemoIndex: de = 1,
60
+ turnObservations: he = {},
61
+ setExpandedSignals: E,
62
+ onTurnPlayPause: K
63
+ }, ue) {
64
+ var ne;
65
+ const V = P(null), h = P(null), k = P(null), [Z, m] = f(!1), [W, J] = f(0), [fe, pe] = f(0), [ge, ye] = f(1), [I, me] = f(null), [ve, be] = f(1), [ke, C] = f(!1), [xe, N] = f(!1), [Q, M] = f(de), s = !!Y, x = !d, l = d && !s, F = x ? ke : s ? B ?? !1 : Z, Fe = x ? I ?? 0 : s ? se ?? 0 : W, z = x ? ve : s ? le ?? 1 : ge, H = x ? R || 156 : s ? R : fe || R || 0, A = re(() => {
67
66
  const e = () => {
68
- const n = c.current;
69
- n && V(n.currentTime), v.current = requestAnimationFrame(e);
67
+ const t = h.current;
68
+ t && J(t.currentTime), k.current = requestAnimationFrame(e);
70
69
  };
71
- v.current = requestAnimationFrame(e);
72
- }, []), p = oe(() => {
73
- v.current && (cancelAnimationFrame(v.current), v.current = null);
70
+ k.current = requestAnimationFrame(e);
71
+ }, []), v = re(() => {
72
+ k.current && (cancelAnimationFrame(k.current), k.current = null);
74
73
  }, []);
75
- ie(() => () => p(), [p]), ie(() => {
76
- if (!s)
74
+ oe(() => () => v(), [v]), oe(() => {
75
+ if (!l)
77
76
  return;
78
- const e = c.current;
77
+ const e = h.current;
79
78
  if (!e)
80
79
  return;
81
- const n = () => pe(e.duration || 0), t = () => {
82
- f(!1), p();
80
+ const t = () => pe(e.duration || 0), n = () => {
81
+ m(!1), v();
83
82
  };
84
- return e.addEventListener("loadedmetadata", n), e.addEventListener("ended", t), () => {
85
- e.removeEventListener("loadedmetadata", n), e.removeEventListener("ended", t);
83
+ return e.addEventListener("loadedmetadata", t), e.addEventListener("ended", n), () => {
84
+ e.removeEventListener("loadedmetadata", t), e.removeEventListener("ended", n);
86
85
  };
87
- }, [s, p]);
86
+ }, [l, v]);
88
87
  const O = (e) => {
89
- for (let n = C.length - 1; n >= 0; n--) {
90
- const t = se(C[n].time);
91
- if (e >= t)
92
- return n;
88
+ for (let t = D.length - 1; t >= 0; t--) {
89
+ const n = ae(D[t].time);
90
+ if (e >= n)
91
+ return t;
93
92
  }
94
93
  return 0;
95
- }, m = (e) => {
96
- const t = Math.max(0, Math.min(e, M || 156));
97
- if (s) {
98
- const i = c.current;
99
- i && (i.currentTime = t), V(t);
94
+ }, b = (e) => {
95
+ const n = Math.max(0, Math.min(e, H || 156));
96
+ if (l) {
97
+ const o = h.current;
98
+ o && (o.currentTime = n), J(n);
100
99
  } else
101
- a && T && T(t);
102
- ve(t), G(O(t));
103
- }, we = () => {
104
- if (s) {
105
- const e = c.current;
100
+ s && j && j(n);
101
+ me(n), M(O(n));
102
+ }, Se = () => {
103
+ if (l) {
104
+ const e = h.current;
106
105
  if (!e)
107
106
  return;
108
- K ? (e.pause(), p(), f(!1)) : e.play().then(() => {
109
- f(!0), z();
107
+ Z ? (e.pause(), v(), m(!1)) : e.play().then(() => {
108
+ m(!0), A();
110
109
  }).catch(() => {
111
110
  });
112
111
  } else
113
- a && B ? B() : w((e) => !e);
112
+ s && w ? w() : C((e) => !e);
113
+ }, we = () => {
114
+ s && L ? L() : b(Math.max(0, (l ? W : I ?? 0) - 10));
114
115
  }, Ie = () => {
115
- a && j ? j() : m(Math.max(0, (s ? E : F ?? 0) - 10));
116
- }, Ce = () => {
117
- a && L ? L() : m(Math.min(M || 156, (s ? E : F ?? 0) + 10));
118
- }, De = (e) => {
119
- if (s) {
120
- const n = c.current;
121
- n && (n.playbackRate = e), ye(e);
116
+ s && _ ? _() : b(Math.min(H || 156, (l ? W : I ?? 0) + 10));
117
+ }, Ce = (e) => {
118
+ if (l) {
119
+ const t = h.current;
120
+ t && (t.playbackRate = e), ye(e);
122
121
  } else
123
- a && _ && _(e);
124
- ke(e), Z(!1);
122
+ s && X && X(e);
123
+ be(e), N(!1);
125
124
  };
126
- Ge(ge, () => ({
125
+ We(ue, () => ({
127
126
  seekTo: (e) => {
128
- if (m(e), s) {
129
- const t = c.current;
130
- t && t.play().then(() => {
131
- f(!0), z();
127
+ if (b(e), s)
128
+ !B && w && w();
129
+ else if (l) {
130
+ const n = h.current;
131
+ n && n.play().then(() => {
132
+ m(!0), A();
132
133
  }).catch(() => {
133
134
  });
134
135
  } else
135
- w(!0);
136
- const n = O(e);
137
- G(n), setTimeout(() => {
138
- var i;
139
- const t = (i = q.current) == null ? void 0 : i.children;
140
- t != null && t[n] && t[n].scrollIntoView({ behavior: "smooth", block: "nearest" });
136
+ C(!0);
137
+ const t = O(e);
138
+ M(t), setTimeout(() => {
139
+ var o;
140
+ const n = (o = V.current) == null ? void 0 : o.children;
141
+ n != null && n[t] && n[t].scrollIntoView({ behavior: "smooth", block: "nearest" });
141
142
  }, 50);
142
143
  }
143
144
  }));
144
- const Te = (e) => {
145
- var n;
146
- if (J === e && k) {
147
- if (s) {
148
- const t = c.current;
149
- t && t.pause(), p(), f(!1);
145
+ const De = (e) => {
146
+ var t;
147
+ if (Q === e && F) {
148
+ if (l) {
149
+ const n = h.current;
150
+ n && n.pause(), v(), m(!1);
150
151
  }
151
- w(!1);
152
+ C(!1);
152
153
  } else {
153
- const t = se((n = C[e]) == null ? void 0 : n.time);
154
- if (G(e), m(t), s) {
155
- const i = c.current;
156
- i && (i.currentTime = t, i.play().then(() => {
157
- f(!0), z();
154
+ const n = ae((t = D[e]) == null ? void 0 : t.time);
155
+ if (M(e), b(n), l) {
156
+ const o = h.current;
157
+ o && (o.currentTime = n, o.play().then(() => {
158
+ m(!0), A();
158
159
  }).catch(() => {
159
160
  }));
160
161
  }
161
- w(!0);
162
+ C(!0);
162
163
  }
163
- }, Re = (e, n) => {
164
+ }, Re = (e, t) => {
164
165
  if (e == null)
165
166
  return;
166
- const t = (i) => {
167
- const d = Math.floor(i / 6e4), y = Math.floor(i % 6e4 / 1e3);
168
- return `${d.toString().padStart(2, "0")}:${y.toString().padStart(2, "0")}`;
167
+ const n = (o) => {
168
+ const a = Math.floor(o / 6e4), c = Math.floor(o % 6e4 / 1e3);
169
+ return `${a.toString().padStart(2, "0")}:${c.toString().padStart(2, "0")}`;
169
170
  };
170
- return `${t(e)}–${n != null ? t(n) : t(e)}`;
171
- }, Q = (te = g == null ? void 0 : g.messages) != null && te.length ? g.messages.map((e, n) => {
172
- var t, i;
171
+ return `${n(e)}–${t != null ? n(t) : n(e)}`;
172
+ }, U = (ne = y == null ? void 0 : y.messages) != null && ne.length ? y.messages.map((e, t) => {
173
+ var n, o;
173
174
  return {
174
- actor: e.actor === "agent" ? ((t = g.actor_map) == null ? void 0 : t.agent) || "Agent" : ((i = g.actor_map) == null ? void 0 : i.customer) || "Customer",
175
+ actor: e.actor === "agent" ? ((n = y.actor_map) == null ? void 0 : n.agent) || "Agent" : ((o = y.actor_map) == null ? void 0 : o.customer) || "Customer",
175
176
  actorType: e.actor === "agent" ? "agent" : "customer",
176
177
  text: e.text || "",
177
178
  timeRange: Re(e.start ?? e.start_ms, e.end ?? e.end_ms),
178
- isHighlighted: de.has(n),
179
- highlightColor: k && N === n ? e.actor === "agent" ? "var(--rail-outcome)" : "var(--rail-discovery)" : void 0,
180
- observations: (ue[n] || []).map((d) => ({
181
- ...d,
179
+ isHighlighted: ce.has(t),
180
+ highlightColor: F && q === t ? e.actor === "agent" ? "var(--rail-outcome)" : "var(--rail-discovery)" : void 0,
181
+ observations: (he[t] || []).map((a) => ({
182
+ ...a,
182
183
  onClick: () => {
183
- R == null || R((y) => /* @__PURE__ */ new Set([...y, d.signalKey])), setTimeout(() => {
184
- const y = document.getElementById(`signal-${d.signalKey}`);
185
- y && y.scrollIntoView({ behavior: "smooth", block: "nearest" });
184
+ E == null || E((c) => /* @__PURE__ */ new Set([...c, a.signalKey])), setTimeout(() => {
185
+ const c = document.getElementById(`signal-${a.signalKey}`);
186
+ c && c.scrollIntoView({ behavior: "smooth", block: "nearest" });
186
187
  }, 100);
187
188
  }
188
189
  }))
189
190
  };
190
- }) : null, U = b ? F ?? 0 : Fe, I = M || 156, x = I > 0 ? U / I * 100 : 0, ee = Math.round(U);
191
- return /* @__PURE__ */ r("div", { style: {
191
+ }) : null, ee = x ? I ?? 0 : Fe, u = H || 156, S = u > 0 ? ee / u * 100 : 0, te = Math.round(ee);
192
+ return /* @__PURE__ */ i("div", { style: {
192
193
  display: "flex",
193
194
  flexDirection: "column",
194
195
  gap: 16
195
196
  }, children: [
196
- /* @__PURE__ */ r("div", { style: {
197
+ /* @__PURE__ */ i("div", { style: {
197
198
  display: "flex",
198
199
  alignItems: "center",
199
200
  gap: 16,
200
201
  width: "100%"
201
202
  }, children: [
202
- /* @__PURE__ */ o("div", { style: {
203
+ /* @__PURE__ */ r("div", { style: {
203
204
  display: "flex",
204
205
  alignItems: "center",
205
206
  justifyContent: "center",
@@ -208,14 +209,14 @@ const Ke = Ee(function({
208
209
  borderRadius: 9999,
209
210
  background: "var(--surface-hover, #F3F7F7)",
210
211
  flexShrink: 0
211
- }, children: /* @__PURE__ */ o(We, { size: 20, color: "#2E3236", strokeWidth: 1.5 }) }),
212
- /* @__PURE__ */ o("span", { style: {
212
+ }, children: /* @__PURE__ */ r(Me, { size: 20, color: "#2E3236", strokeWidth: 1.5 }) }),
213
+ /* @__PURE__ */ r("span", { style: {
213
214
  fontSize: 15,
214
215
  fontWeight: 500,
215
216
  color: "var(--Grey-Strong, #2E3236)"
216
217
  }, children: "Recording" })
217
218
  ] }),
218
- /* @__PURE__ */ r("div", { style: {
219
+ /* @__PURE__ */ i("div", { style: {
219
220
  display: "flex",
220
221
  padding: 24,
221
222
  flexDirection: "column",
@@ -225,22 +226,22 @@ const Ke = Ee(function({
225
226
  border: "1px solid var(--Grey-absent, #D9D9D9)",
226
227
  background: "var(--Grey-White, #FFF)"
227
228
  }, children: [
228
- /* @__PURE__ */ r("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: 16 }, children: [
229
- /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 24 }, children: [
230
- /* @__PURE__ */ r("span", { style: {
229
+ /* @__PURE__ */ i("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: 16 }, children: [
230
+ /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 24 }, children: [
231
+ /* @__PURE__ */ i("span", { style: {
231
232
  fontSize: 14,
232
233
  fontWeight: 500,
233
234
  color: "var(--Grey-Strong, #2E3236)",
234
235
  lineHeight: 1.2
235
236
  }, children: [
236
- le,
237
+ T,
237
238
  " / ",
238
- ce
239
+ G
239
240
  ] }),
240
- /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
241
- /* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 400, color: "var(--Grey-Muted, #808183)", lineHeight: 1.2 }, children: "10" }),
242
- /* @__PURE__ */ o("button", { onClick: Ie, style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ o(Me, { size: 20, color: "#808183", strokeWidth: 1.5 }) }),
243
- /* @__PURE__ */ o("button", { onClick: we, style: {
241
+ /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
242
+ /* @__PURE__ */ r("span", { style: { fontSize: 13, fontWeight: 400, color: "var(--Grey-Muted, #808183)", lineHeight: 1.2 }, children: "10" }),
243
+ /* @__PURE__ */ r("button", { onClick: we, style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ r(ze, { size: 20, color: "#808183", strokeWidth: 1.5 }) }),
244
+ /* @__PURE__ */ r("button", { onClick: Se, style: {
244
245
  background: "var(--Grey-Strong, #2E3236)",
245
246
  border: "none",
246
247
  cursor: "pointer",
@@ -251,15 +252,15 @@ const Ke = Ee(function({
251
252
  display: "flex",
252
253
  alignItems: "center",
253
254
  justifyContent: "center"
254
- }, children: k ? /* @__PURE__ */ o(ze, { size: 14, color: "#FFF", fill: "#FFF" }) : /* @__PURE__ */ o(He, { size: 14, color: "#FFF", fill: "#FFF", strokeWidth: 1.5, style: { marginLeft: 2 } }) }),
255
- /* @__PURE__ */ o("button", { onClick: Ce, style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ o(Pe, { size: 20, color: "#808183", strokeWidth: 1.5 }) }),
256
- /* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 400, color: "var(--Grey-Muted, #808183)", lineHeight: 1.2 }, children: "10" })
255
+ }, children: F ? /* @__PURE__ */ r(He, { size: 14, color: "#FFF", fill: "#FFF" }) : /* @__PURE__ */ r(Ae, { size: 14, color: "#FFF", fill: "#FFF", strokeWidth: 1.5, style: { marginLeft: 2 } }) }),
256
+ /* @__PURE__ */ r("button", { onClick: Ie, style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ r(Pe, { size: 20, color: "#808183", strokeWidth: 1.5 }) }),
257
+ /* @__PURE__ */ r("span", { style: { fontSize: 13, fontWeight: 400, color: "var(--Grey-Muted, #808183)", lineHeight: 1.2 }, children: "10" })
257
258
  ] }),
258
- /* @__PURE__ */ r("div", { style: { position: "relative" }, children: [
259
- /* @__PURE__ */ r(
259
+ /* @__PURE__ */ i("div", { style: { position: "relative" }, children: [
260
+ /* @__PURE__ */ i(
260
261
  "button",
261
262
  {
262
- onClick: () => Z((e) => !e),
263
+ onClick: () => N((e) => !e),
263
264
  style: {
264
265
  background: "var(--Grey-White, #FFF)",
265
266
  border: "1px solid var(--Grey-absent, #D9D9D9)",
@@ -279,13 +280,13 @@ const Ke = Ee(function({
279
280
  gap: 4
280
281
  },
281
282
  children: [
282
- W,
283
+ z,
283
284
  "x",
284
- /* @__PURE__ */ o(Ae, { size: 12, color: "#808183" })
285
+ /* @__PURE__ */ r($e, { size: 12, color: "#808183" })
285
286
  ]
286
287
  }
287
288
  ),
288
- Se && /* @__PURE__ */ o("div", { style: {
289
+ xe && /* @__PURE__ */ r("div", { style: {
289
290
  position: "absolute",
290
291
  top: "100%",
291
292
  right: 0,
@@ -297,19 +298,19 @@ const Ke = Ee(function({
297
298
  zIndex: 10,
298
299
  overflow: "hidden",
299
300
  minWidth: 80
300
- }, children: _e.map((e) => /* @__PURE__ */ r(
301
+ }, children: _e.map((e) => /* @__PURE__ */ i(
301
302
  "button",
302
303
  {
303
- onClick: () => De(e),
304
+ onClick: () => Ce(e),
304
305
  style: {
305
306
  display: "block",
306
307
  width: "100%",
307
308
  padding: "8px 12px",
308
309
  border: "none",
309
- background: W === e ? "var(--surface-hover, #F3F7F7)" : "var(--Grey-White, #FFF)",
310
+ background: z === e ? "var(--surface-hover, #F3F7F7)" : "var(--Grey-White, #FFF)",
310
311
  cursor: "pointer",
311
312
  fontSize: 13,
312
- fontWeight: W === e ? 600 : 400,
313
+ fontWeight: z === e ? 600 : 400,
313
314
  color: "var(--Grey-Strong, #2E3236)",
314
315
  fontFamily: "var(--font-sans)",
315
316
  textAlign: "left"
@@ -323,37 +324,22 @@ const Ke = Ee(function({
323
324
  )) })
324
325
  ] })
325
326
  ] }),
326
- l && a ? /* @__PURE__ */ r(ne, { children: [
327
- /* @__PURE__ */ o(
328
- je,
329
- {
330
- segments: D,
331
- durationSeconds: S,
332
- currentTimeSeconds: P,
333
- onSeek: T,
334
- showControls: !1,
335
- hasRecording: !0,
336
- timelinePlaying: A,
337
- playbackRate: $
338
- }
339
- ),
340
- /* @__PURE__ */ o("audio", { ref: X, preload: "none", style: { display: "none" }, children: /* @__PURE__ */ o("source", { src: l, type: "audio/mpeg" }) })
341
- ] }) : /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
342
- /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
343
- /* @__PURE__ */ o("span", { style: {
327
+ /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
328
+ /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
329
+ /* @__PURE__ */ r("span", { style: {
344
330
  fontSize: 13,
345
331
  fontWeight: 600,
346
- color: x > 0 ? "var(--Green-Primary, #00925F)" : "var(--Grey-Strong, #2E3236)",
332
+ color: S > 0 ? "var(--Green-Primary, #00925F)" : "var(--Grey-Strong, #2E3236)",
347
333
  fontFamily: "var(--font-sans)",
348
334
  lineHeight: 1.2,
349
335
  minWidth: 60
350
- }, children: ae(ee) }),
351
- /* @__PURE__ */ r(
336
+ }, children: $(te) }),
337
+ /* @__PURE__ */ i(
352
338
  "div",
353
339
  {
354
340
  onClick: (e) => {
355
- const n = e.currentTarget.getBoundingClientRect(), t = e.clientX - n.left, i = Math.max(0, Math.min(1, t / n.width));
356
- m(i * I);
341
+ const t = e.currentTarget.getBoundingClientRect(), n = e.clientX - t.left, o = Math.max(0, Math.min(1, n / t.width));
342
+ b(o * u);
357
343
  },
358
344
  style: {
359
345
  flex: 1,
@@ -364,7 +350,7 @@ const Ke = Ee(function({
364
350
  cursor: "pointer"
365
351
  },
366
352
  children: [
367
- /* @__PURE__ */ o("div", { style: {
353
+ /* @__PURE__ */ r("div", { style: {
368
354
  position: "absolute",
369
355
  left: 0,
370
356
  right: 0,
@@ -373,18 +359,18 @@ const Ke = Ee(function({
373
359
  background: "var(--rail-surface-2, #E3E1D7)",
374
360
  pointerEvents: "none"
375
361
  } }),
376
- /* @__PURE__ */ o("div", { style: {
362
+ /* @__PURE__ */ r("div", { style: {
377
363
  position: "absolute",
378
364
  left: 0,
379
365
  top: "50%",
380
366
  transform: "translateY(-50%)",
381
- width: `${x}%`,
367
+ width: `${S}%`,
382
368
  height: 4,
383
369
  borderRadius: 2,
384
370
  background: "var(--Green-Primary, #00925F)",
385
371
  pointerEvents: "none"
386
372
  } }),
387
- /* @__PURE__ */ o(
373
+ /* @__PURE__ */ r(
388
374
  "svg",
389
375
  {
390
376
  width: "16",
@@ -394,12 +380,12 @@ const Ke = Ee(function({
394
380
  xmlns: "http://www.w3.org/2000/svg",
395
381
  style: {
396
382
  position: "absolute",
397
- left: `${x}%`,
383
+ left: `${S}%`,
398
384
  top: "50%",
399
385
  transform: "translate(-50%, -50%)",
400
386
  pointerEvents: "none"
401
387
  },
402
- children: /* @__PURE__ */ o(
388
+ children: /* @__PURE__ */ r(
403
389
  "path",
404
390
  {
405
391
  d: "M7.875 1C11.6572 1 14.75 4.1191 14.75 8C14.75 11.8809 11.6572 15 7.875 15C4.09284 15 1 11.8809 1 8C1 4.1191 4.09284 1 7.875 1Z",
@@ -409,66 +395,82 @@ const Ke = Ee(function({
409
395
  }
410
396
  )
411
397
  }
412
- )
398
+ ),
399
+ /* @__PURE__ */ r("span", { style: {
400
+ position: "absolute",
401
+ right: -48,
402
+ fontSize: 13,
403
+ fontWeight: 400,
404
+ color: "var(--Grey-Muted, #808183)",
405
+ fontFamily: "var(--font-sans)",
406
+ lineHeight: 1.2,
407
+ whiteSpace: "nowrap"
408
+ }, children: $(u) })
413
409
  ]
414
410
  }
415
411
  )
416
412
  ] }),
417
- /* @__PURE__ */ r("div", { style: { position: "relative", paddingBottom: 30, cursor: "pointer" }, children: [
418
- ["Agent", "Customer"].map((e, n) => /* @__PURE__ */ r("div", { style: {
419
- display: "flex",
420
- alignItems: "center",
421
- gap: 8,
422
- height: 20,
423
- marginBottom: n === 0 ? 4 : 0
424
- }, children: [
425
- /* @__PURE__ */ o("span", { style: {
426
- fontSize: 13,
427
- fontWeight: 400,
428
- color: "var(--Grey-Muted, #808183)",
429
- fontFamily: "var(--font-sans)",
430
- lineHeight: 1.2,
431
- minWidth: 60
432
- }, children: e }),
433
- /* @__PURE__ */ r(
434
- "div",
435
- {
436
- onClick: (t) => {
437
- const i = t.currentTarget.getBoundingClientRect(), d = Math.max(0, Math.min(1, (t.clientX - i.left) / i.width));
438
- m(d * I);
439
- },
440
- style: {
441
- flex: 1,
442
- height: 6,
443
- position: "relative",
444
- borderRadius: 3,
445
- cursor: "pointer"
446
- },
447
- children: [
448
- /* @__PURE__ */ o("div", { style: {
449
- position: "absolute",
450
- left: 0,
451
- right: 0,
452
- top: "50%",
453
- transform: "translateY(-50%)",
454
- height: 4,
455
- borderRadius: 2,
456
- background: "var(--rail-surface-2, #E3E1D7)"
457
- } }),
458
- Le[e].map((t, i) => /* @__PURE__ */ o("div", { style: {
459
- position: "absolute",
460
- left: `${t.start * 100}%`,
461
- width: `${(t.end - t.start) * 100}%`,
462
- top: 0,
463
- bottom: 0,
413
+ /* @__PURE__ */ i("div", { style: { position: "relative", paddingBottom: 30, cursor: "pointer" }, children: [
414
+ [T, G].map((e, t) => {
415
+ const n = t === 0, o = g != null && g.length ? g.filter((a) => n ? a.actor === T : a.actor === G).map((a) => ({
416
+ start: u > 0 ? a.startTime / u : 0,
417
+ end: u > 0 ? a.endTime / u : 0
418
+ })) : Le[n ? "Agent" : "Customer"] || [];
419
+ return /* @__PURE__ */ i("div", { style: {
420
+ display: "flex",
421
+ alignItems: "center",
422
+ gap: 8,
423
+ height: 20,
424
+ marginBottom: t === 0 ? 4 : 0
425
+ }, children: [
426
+ /* @__PURE__ */ r("span", { style: {
427
+ fontSize: 13,
428
+ fontWeight: 400,
429
+ color: "var(--Grey-Muted, #808183)",
430
+ fontFamily: "var(--font-sans)",
431
+ lineHeight: 1.2,
432
+ minWidth: 60
433
+ }, children: e }),
434
+ /* @__PURE__ */ i(
435
+ "div",
436
+ {
437
+ onClick: (a) => {
438
+ const c = a.currentTarget.getBoundingClientRect(), Te = Math.max(0, Math.min(1, (a.clientX - c.left) / c.width));
439
+ b(Te * u);
440
+ },
441
+ style: {
442
+ flex: 1,
443
+ height: 6,
444
+ position: "relative",
464
445
  borderRadius: 3,
465
- background: e === "Agent" ? "var(--Grey-Strong, #2E3236)" : "var(--Grey-Muted, #808183)"
466
- } }, i))
467
- ]
468
- }
469
- )
470
- ] }, e)),
471
- /* @__PURE__ */ r("div", { style: {
446
+ cursor: "pointer"
447
+ },
448
+ children: [
449
+ /* @__PURE__ */ r("div", { style: {
450
+ position: "absolute",
451
+ left: 0,
452
+ right: 0,
453
+ top: "50%",
454
+ transform: "translateY(-50%)",
455
+ height: 4,
456
+ borderRadius: 2,
457
+ background: "var(--rail-surface-2, #E3E1D7)"
458
+ } }),
459
+ o.map((a, c) => /* @__PURE__ */ r("div", { style: {
460
+ position: "absolute",
461
+ left: `${a.start * 100}%`,
462
+ width: `${(a.end - a.start) * 100}%`,
463
+ top: 0,
464
+ bottom: 0,
465
+ borderRadius: 3,
466
+ background: n ? "var(--Grey-Strong, #2E3236)" : "var(--Grey-Muted, #808183)"
467
+ } }, c))
468
+ ]
469
+ }
470
+ )
471
+ ] }, e);
472
+ }),
473
+ /* @__PURE__ */ i("div", { style: {
472
474
  position: "absolute",
473
475
  left: 68,
474
476
  /* 60 label + 8 gap */
@@ -477,19 +479,18 @@ const Ke = Ee(function({
477
479
  bottom: 0,
478
480
  pointerEvents: "none"
479
481
  }, children: [
480
- /* @__PURE__ */ o("div", { style: {
482
+ /* @__PURE__ */ r("div", { style: {
481
483
  position: "absolute",
482
- left: `${x}%`,
484
+ left: `${S}%`,
483
485
  top: 0,
484
486
  height: 44,
485
- /* spans both rows */
486
487
  transform: "translateX(-50%)",
487
488
  borderLeft: "1.5px dashed var(--Grey-Muted, #808183)",
488
489
  opacity: 0.5
489
490
  } }),
490
- /* @__PURE__ */ o("div", { style: {
491
+ /* @__PURE__ */ r("div", { style: {
491
492
  position: "absolute",
492
- left: `${x}%`,
493
+ left: `${S}%`,
493
494
  bottom: 0,
494
495
  transform: "translateX(-50%)",
495
496
  background: "var(--Grey-Strong, #2E3236)",
@@ -500,68 +501,69 @@ const Ke = Ee(function({
500
501
  padding: "4px 6px",
501
502
  borderRadius: 4,
502
503
  whiteSpace: "nowrap"
503
- }, children: ae(ee) })
504
+ }, children: $(te) })
504
505
  ] })
505
506
  ] }),
506
- s && /* @__PURE__ */ o("audio", { ref: c, preload: "auto", style: { display: "none" }, children: /* @__PURE__ */ o("source", { src: l, type: "audio/mpeg" }) })
507
+ l && /* @__PURE__ */ r("audio", { ref: h, preload: "auto", style: { display: "none" }, children: /* @__PURE__ */ r("source", { src: d, type: "audio/mpeg" }) }),
508
+ s && d && /* @__PURE__ */ r("audio", { ref: Y, preload: "auto", style: { display: "none" }, children: /* @__PURE__ */ r("source", { src: d, type: "audio/mpeg" }) })
507
509
  ] })
508
510
  ] }),
509
- /* @__PURE__ */ r("div", { style: {
511
+ /* @__PURE__ */ i("div", { style: {
510
512
  width: "100%",
511
513
  display: "flex",
512
514
  flexDirection: "column",
513
515
  gap: 16
514
516
  }, children: [
515
- /* @__PURE__ */ o("div", { style: {
517
+ /* @__PURE__ */ r("div", { style: {
516
518
  borderBottom: "1px solid var(--Grey-absent, #D9D9D9)",
517
519
  paddingBottom: 16
518
- }, children: /* @__PURE__ */ o("span", { style: {
520
+ }, children: /* @__PURE__ */ r("span", { style: {
519
521
  fontSize: 14,
520
522
  fontWeight: 400,
521
523
  color: "var(--Grey-Strong, #2E3236)",
522
524
  lineHeight: 1.2
523
525
  }, children: "Transcript" }) }),
524
- /* @__PURE__ */ o("div", { id: "transcript-container", ref: q, style: {
526
+ /* @__PURE__ */ r("div", { id: "transcript-container", ref: V, style: {
525
527
  display: "flex",
526
528
  flexDirection: "column",
527
529
  maxHeight: 600,
528
530
  overflowY: "auto"
529
- }, children: (Q || C.map((e) => ({
531
+ }, children: (U || D.map((e) => ({
530
532
  actor: e.speaker,
531
533
  actorType: e.type,
532
534
  text: e.text,
533
535
  timeRange: e.time
534
- }))).map((e, n) => {
535
- const t = !!Q, i = t ? k && N === n : n === J && k, d = (e.actorType || e.type) === "customer";
536
- return /* @__PURE__ */ r("div", { style: {
536
+ }))).map((e, t) => {
537
+ const n = !!U, o = n ? F && q === t : t === Q && F, a = (e.actorType || e.type) === "customer";
538
+ return /* @__PURE__ */ i("div", { style: {
537
539
  display: "flex",
538
540
  padding: 16,
539
541
  flexDirection: "column",
540
542
  alignItems: "flex-start",
541
543
  gap: 16,
542
544
  alignSelf: "stretch",
543
- borderTop: n > 0 ? "1px solid var(--Grey-absent, #D9D9D9)" : "none",
544
- background: i ? "var(--surface-hover, #F3F7F7)" : "var(--Grey-White, #FFF)"
545
+ borderTop: t > 0 ? "1px solid var(--Grey-absent, #D9D9D9)" : "none",
546
+ background: o ? "var(--surface-hover, #F3F7F7)" : "var(--Grey-White, #FFF)"
545
547
  }, children: [
546
- /* @__PURE__ */ r("div", { style: {
548
+ /* @__PURE__ */ i("div", { style: {
547
549
  display: "flex",
548
550
  alignItems: "center",
549
551
  justifyContent: "space-between",
550
552
  width: "100%",
551
553
  gap: 8
552
554
  }, children: [
553
- /* @__PURE__ */ o("span", { style: {
555
+ /* @__PURE__ */ r("span", { style: {
554
556
  fontSize: 14,
555
557
  fontWeight: 600,
556
558
  lineHeight: 1.2,
557
- color: d ? "var(--Grey-Strong, #2E3236)" : "var(--Grey-Muted, #808183)"
559
+ color: a ? "var(--Grey-Strong, #2E3236)" : "var(--Grey-Muted, #808183)"
558
560
  }, children: e.actor }),
559
- /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
560
- i && /* @__PURE__ */ r(ne, { children: [
561
- /* @__PURE__ */ o(re, { size: 12, color: "#2E3236" }),
562
- /* @__PURE__ */ o(re, { size: 12, color: "#2E3236" })
561
+ /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
562
+ o && /* @__PURE__ */ i(Ge, { children: [
563
+ /* @__PURE__ */ r(ie, { size: 12, color: "#2E3236" }),
564
+ /* @__PURE__ */ r(ie, { size: 12, color: "#2E3236" })
563
565
  ] }),
564
- /* @__PURE__ */ o("span", { style: {
566
+ /* @__PURE__ */ r("span", { style: {
565
567
  fontSize: 13,
566
568
  fontWeight: 400,
567
569
  lineHeight: 1.2,
@@ -569,12 +571,12 @@ const Ke = Ee(function({
569
571
  }, children: e.timeRange })
570
572
  ] })
571
573
  ] }),
572
- /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "flex-start", gap: 8, width: "100%" }, children: [
573
- /* @__PURE__ */ o(
574
+ /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "flex-start", gap: 8, width: "100%" }, children: [
575
+ /* @__PURE__ */ r(
574
576
  "button",
575
577
  {
576
578
  onClick: () => {
577
- t && Y ? Y(e, n) : Te(n);
579
+ n && K ? K(e, t) : De(t);
578
580
  },
579
581
  style: {
580
582
  background: "none",
@@ -584,10 +586,10 @@ const Ke = Ee(function({
584
586
  flexShrink: 0,
585
587
  display: "flex"
586
588
  },
587
- children: i ? /* @__PURE__ */ o($e, { size: 17, color: "#2E3236", strokeWidth: 1.5 }) : /* @__PURE__ */ o(Be, { size: 17, color: "#808183", strokeWidth: 1 })
589
+ children: o ? /* @__PURE__ */ r(Be, { size: 17, color: "#2E3236", strokeWidth: 1.5 }) : /* @__PURE__ */ r(je, { size: 17, color: "#808183", strokeWidth: 1 })
588
590
  }
589
591
  ),
590
- /* @__PURE__ */ o("p", { style: {
592
+ /* @__PURE__ */ r("p", { style: {
591
593
  fontSize: 13,
592
594
  fontWeight: 400,
593
595
  color: "var(--Grey-Strong, #2E3236)",
@@ -596,7 +598,7 @@ const Ke = Ee(function({
596
598
  flex: 1
597
599
  }, children: e.text })
598
600
  ] })
599
- ] }, n);
601
+ ] }, t);
600
602
  }) })
601
603
  ] })
602
604
  ] })