@axos-web-dev/shared-components 2.0.0-dev.4 → 2.0.0-dev.4-fix-0

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.
@@ -11,14 +11,16 @@ import { useOpenChat } from "./store/chat.js";
11
11
  import { useMessages } from "./store/messages.js";
12
12
  const __vite_import_meta_env__ = { "VITE_COMPANY_ID": "17524785112945485a16ec8e771737dce", "VITE_HOST": "https://axccaipdev-i3ofmup.uc1.ccaiplatform.com", "VITE_TENANT_NAME": "axccaipdev-i3ofmup" };
13
13
  const env = __vite_import_meta_env__ || process.env;
14
- const OriginalAudio = window.Audio;
15
- class PatchedAudio extends OriginalAudio {
16
- constructor(src) {
17
- const newSrc = src === "https://websdk.ujet.co/v3/ping.mp3" ? notificationSound : src;
18
- super(newSrc);
14
+ if (typeof window !== "undefined") {
15
+ const OriginalAudio = window.Audio;
16
+ class PatchedAudio extends OriginalAudio {
17
+ constructor(src) {
18
+ const newSrc = src === "https://websdk.ujet.co/v3/ping.mp3" ? notificationSound : src;
19
+ super(newSrc);
20
+ }
19
21
  }
22
+ window.Audio = PatchedAudio;
20
23
  }
21
- window.Audio = PatchedAudio;
22
24
  const Chatbot = ({
23
25
  project = "axos",
24
26
  projectEnv = "dev",
@@ -287,14 +289,14 @@ const Chatbot = ({
287
289
  console.error("Error creating chat:", err);
288
290
  } finally {
289
291
  if (clientRef?.current?.chat?.state?.status == "va_assigned") {
290
- const OriginalAudio2 = window.Audio;
291
- class PatchedAudio2 extends OriginalAudio2 {
292
+ const OriginalAudio = window.Audio;
293
+ class PatchedAudio extends OriginalAudio {
292
294
  constructor(src) {
293
295
  const newSrc = src === "https://websdk.ujet.co/v3/ping.mp3" ? notificationSound : src;
294
296
  super(newSrc);
295
297
  }
296
298
  }
297
- window.Audio = PatchedAudio2;
299
+ window.Audio = PatchedAudio;
298
300
  }
299
301
  }
300
302
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@axos-web-dev/shared-components",
3
3
  "description": "Axos shared components library for web.",
4
- "version": "2.0.0-dev.4",
4
+ "version": "2.0.0-dev.4-fix-0",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "module": "dist/main.js",