@nlxai/touchpoint-ui 1.0.5-alpha.4 → 1.0.5-alpha.5

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/lib/index.js CHANGED
@@ -6569,7 +6569,7 @@ var tC = "@nlxai/chat-core", nC = "1.0.5-alpha.4", rC = "NLX Chat SDK core", iC
6569
6569
  uuid: "^9.0.1"
6570
6570
  }, mC = {
6571
6571
  access: "public"
6572
- }, gC = "4cc1ed43fde42daf06e14e0fc5dd4c386bc5f354", Al = {
6572
+ }, gC = "c701b502f0398e9956a8b35b711a45f264fa7603", Al = {
6573
6573
  name: tC,
6574
6574
  version: nC,
6575
6575
  description: rC,
@@ -23039,23 +23039,23 @@ const Ry = ({
23039
23039
  try {
23040
23040
  const d = new wi();
23041
23041
  i("pending");
23042
- const h = await e.getLiveKitCredentials(), f = (g) => {
23043
- if (g.kind === O.Kind.Audio) {
23044
- const T = g.attach();
23045
- l(!0);
23046
- const p = () => {
23047
- l(!1), T.removeEventListener("ended", p);
23048
- };
23049
- T.addEventListener("ended", p), T.play().catch((v) => {
23050
- console.warn(v);
23051
- });
23052
- }
23053
- }, m = (g) => {
23054
- o(g);
23042
+ const h = await e.getLiveKitCredentials(), f = (T) => {
23043
+ const p = T.some(
23044
+ (y) => y.isAgent
23045
+ ), v = T.some(
23046
+ (y) => y.isLocal
23047
+ );
23048
+ l(p), o(v);
23049
+ }, m = (T) => {
23050
+ T.kind === O.Kind.Audio && T.attach().play().catch((v) => {
23051
+ console.warn(v);
23052
+ });
23053
+ }, g = (T) => {
23054
+ o(T);
23055
23055
  };
23056
- await d.prepareConnection(h.url, h.token), d.on(M.TrackSubscribed, f), d.localParticipant.on(
23056
+ await d.prepareConnection(h.url, h.token), d.on(M.TrackSubscribed, m), d.on(M.ActiveSpeakersChanged, f), d.localParticipant.on(
23057
23057
  A.IsSpeakingChanged,
23058
- m
23058
+ g
23059
23059
  ), await d.connect(h.url, h.token, { autoSubscribe: !0 }), await d.localParticipant.setMicrophoneEnabled(!0), await d.startAudio(), i("active");
23060
23060
  } catch (d) {
23061
23061
  i("error"), console.warn(d), e.terminateLiveKitCall().catch((h) => {
@@ -23096,7 +23096,7 @@ const Ry = ({
23096
23096
  Icon: Vd,
23097
23097
  label: "Voice",
23098
23098
  type: n ? i === "error" ? "error" : "activated" : "ghost",
23099
- onClick: i === "pending" ? void 0 : () => {
23099
+ onClick: () => {
23100
23100
  r((a) => !a);
23101
23101
  }
23102
23102
  }