@floe-ai/sdk 0.1.0-dev.11 → 0.1.0-dev.13

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.
@@ -16223,6 +16223,9 @@ class th {
16223
16223
  // Scroll tracking for Fast Execution System
16224
16224
  O(this, "scrollHandler", null);
16225
16225
  O(this, "scrollDebounceTimer", null);
16226
+ // URL tracking for SPAs
16227
+ O(this, "urlCheckInterval", null);
16228
+ O(this, "popstateHandler", null);
16226
16229
  this.sdk = e, this.lastUrl = window.location.href;
16227
16230
  }
16228
16231
  /**
@@ -16344,18 +16347,21 @@ class th {
16344
16347
  * Stop tracking page events
16345
16348
  */
16346
16349
  stop() {
16347
- this.isTracking && (this.isTracking = !1, this.clickHandler && (document.removeEventListener("click", this.clickHandler, !0), this.clickHandler = null), this.focusHandler && (document.removeEventListener("focus", this.focusHandler, !0), this.focusHandler = null), this.blurHandler && (document.removeEventListener("blur", this.blurHandler, !0), this.blurHandler = null), this.inputHandler && (document.removeEventListener("input", this.inputHandler, !0), this.inputHandler = null), this.keydownHandler && (document.removeEventListener("keydown", this.keydownHandler, !0), this.keydownHandler = null), this.scrollHandler && (window.removeEventListener("scroll", this.scrollHandler), this.scrollHandler = null), this.scrollDebounceTimer && (clearTimeout(this.scrollDebounceTimer), this.scrollDebounceTimer = null), this.inputDebounceTimers.forEach((e) => clearTimeout(e)), this.inputDebounceTimers.clear(), console.log("[PageTracker] Stopped tracking"));
16350
+ this.isTracking && (this.isTracking = !1, this.clickHandler && (document.removeEventListener("click", this.clickHandler, !0), this.clickHandler = null), this.focusHandler && (document.removeEventListener("focus", this.focusHandler, !0), this.focusHandler = null), this.blurHandler && (document.removeEventListener("blur", this.blurHandler, !0), this.blurHandler = null), this.inputHandler && (document.removeEventListener("input", this.inputHandler, !0), this.inputHandler = null), this.keydownHandler && (document.removeEventListener("keydown", this.keydownHandler, !0), this.keydownHandler = null), this.scrollHandler && (window.removeEventListener("scroll", this.scrollHandler), this.scrollHandler = null), this.scrollDebounceTimer && (clearTimeout(this.scrollDebounceTimer), this.scrollDebounceTimer = null), this.urlCheckInterval && (clearInterval(this.urlCheckInterval), this.urlCheckInterval = null), this.popstateHandler && (window.removeEventListener("popstate", this.popstateHandler), this.popstateHandler = null), this.inputDebounceTimers.forEach((e) => clearTimeout(e)), this.inputDebounceTimers.clear(), console.log("[PageTracker] Stopped tracking"));
16348
16351
  }
16349
16352
  /**
16350
16353
  * Setup URL change tracking for SPAs
16351
16354
  */
16352
16355
  setupUrlTracking() {
16353
- setInterval(() => {
16356
+ this.urlCheckInterval || (this.urlCheckInterval = setInterval(() => {
16354
16357
  const e = window.location.href;
16355
16358
  e !== this.lastUrl && (this.lastUrl = e, this.sendPageMetadata());
16356
- }, 1e3), window.addEventListener("popstate", () => {
16357
- setTimeout(() => this.sendPageMetadata(), 100);
16358
- });
16359
+ }, 1e3), this.popstateHandler = () => {
16360
+ setTimeout(() => {
16361
+ const e = window.location.href;
16362
+ e !== this.lastUrl && (this.lastUrl = e, this.sendPageMetadata());
16363
+ }, 100);
16364
+ }, window.addEventListener("popstate", this.popstateHandler));
16359
16365
  }
16360
16366
  /**
16361
16367
  * Send current page metadata
@@ -16810,6 +16816,8 @@ class ec extends Yd {
16810
16816
  // Audio analyzer for user mic FFT
16811
16817
  O(this, "userMicStream", null);
16812
16818
  // User's mic stream for analysis
16819
+ O(this, "userMicStreamRequestId", 0);
16820
+ // Guards async getUserMedia against disconnect races
16813
16821
  O(this, "audioElements", []);
16814
16822
  O(this, "pageTracker");
16815
16823
  O(this, "screenShareEnabled", !1);
@@ -16938,18 +16946,24 @@ class ec extends Yd {
16938
16946
  * Setup user microphone analysis for waveform visualization
16939
16947
  */
16940
16948
  async setupUserMicAnalysis() {
16949
+ const t = ++this.userMicStreamRequestId;
16941
16950
  try {
16942
- this.userMicStream = await navigator.mediaDevices.getUserMedia({
16951
+ const r = await navigator.mediaDevices.getUserMedia({
16943
16952
  audio: {
16944
16953
  echoCancellation: !0,
16945
16954
  noiseSuppression: !0,
16946
16955
  autoGainControl: !0
16947
16956
  }
16948
- }), console.log("[OnboardingSDK] 🎤 User mic stream captured for visualization"), this.userAudioAnalyzer && this.userMicStream && this.userAudioAnalyzer.start(this.userMicStream, (t) => {
16949
- this.userIsSpeaking && (this.audioLevels = t, this.renderReactUI());
16950
16957
  });
16951
- } catch (t) {
16952
- console.warn("[OnboardingSDK] Could not capture mic for visualization:", t);
16958
+ if (t !== this.userMicStreamRequestId || !this.userAudioAnalyzer) {
16959
+ console.log("[OnboardingSDK] 🎤 Mic stream request invalidated (disconnect/reconnect occurred), stopping tracks"), r.getTracks().forEach((i) => i.stop());
16960
+ return;
16961
+ }
16962
+ this.userMicStream && this.userMicStream.getTracks().forEach((i) => i.stop()), this.userMicStream = r, console.log("[OnboardingSDK] 🎤 User mic stream captured for visualization"), this.userAudioAnalyzer && this.userAudioAnalyzer.start(r, (i) => {
16963
+ this.userIsSpeaking && (this.audioLevels = i, this.renderReactUI());
16964
+ });
16965
+ } catch (r) {
16966
+ console.warn("[OnboardingSDK] Could not capture mic for visualization:", r);
16953
16967
  }
16954
16968
  }
16955
16969
  /**
@@ -17053,9 +17067,9 @@ class ec extends Yd {
17053
17067
  * Disconnect and minimize the UI (instead of removing it)
17054
17068
  */
17055
17069
  async disconnectAndMinimize() {
17056
- this.pageTracker.stop(), this.domIntrospector.stopCapturing(), this.navigationCompleteDetector && this.navigationCompleteDetector.stop(), this.pipecatClient && (await this.pipecatClient.disconnect(), this.pipecatClient = null), this.transport && (this.transport = null), this.audioElements && (this.audioElements.forEach((t) => {
17070
+ this.pageTracker.stop(), this.domIntrospector.stopCapturing(), this.navigationCompleteDetector && this.navigationCompleteDetector.stop(), this.overlay.clearHighlight(), this.pipecatClient && (await this.pipecatClient.disconnect(), this.pipecatClient = null), this.transport && (this.transport = null), this.audioElements && (this.audioElements.forEach((t) => {
17057
17071
  t.pause(), t.remove();
17058
- }), this.audioElements = []), this.botAudioAnalyzer && (this.botAudioAnalyzer.destroy(), this.botAudioAnalyzer = null), this.userAudioAnalyzer && (this.userAudioAnalyzer.destroy(), this.userAudioAnalyzer = null), this.userMicStream && (this.userMicStream.getTracks().forEach((t) => t.stop()), this.userMicStream = null), this.audioLevels = [], this.isConnected = !1, this.agentState = "idle", this._isMinimized = !0, this.botTranscript = "", this.userTranscript = "", this.renderReactUI(), console.log("[OnboardingSDK] Disconnected and minimized"), this.emit("disconnected"), this.emit("minimized");
17072
+ }), this.audioElements = []), this.botAudioAnalyzer && (this.botAudioAnalyzer.destroy(), this.botAudioAnalyzer = null), this.userAudioAnalyzer && (this.userAudioAnalyzer.destroy(), this.userAudioAnalyzer = null), this.userMicStreamRequestId++, this.userMicStream && (this.userMicStream.getTracks().forEach((t) => t.stop()), this.userMicStream = null), this.audioLevels = [], this.isConnected = !1, this.agentState = "idle", this._isMinimized = !0, this.botTranscript = "", this.userTranscript = "", this.renderReactUI(), console.log("[OnboardingSDK] Disconnected and minimized"), this.emit("disconnected"), this.emit("minimized");
17059
17073
  }
17060
17074
  /**
17061
17075
  * Connect with progress stages for better UX.
@@ -17120,7 +17134,9 @@ class ec extends Yd {
17120
17134
  console.log("[OnboardingSDK] Connected to Pipecat"), this.isConnected = !0, this.agentState = "listening", this.micEnabled = ((t = this.pipecatClient) == null ? void 0 : t.isMicEnabled) ?? this.config.enableAudio !== !1, console.log("[OnboardingSDK] 🎤 Mic state on connect:", this.micEnabled ? "ON" : "MUTED"), this.clearConnectionProgress(), this.renderReactUI(), this.emit("connected");
17121
17135
  },
17122
17136
  onDisconnected: () => {
17123
- console.log("[OnboardingSDK] Disconnected from Pipecat"), this.isConnected = !1, this.agentState = "idle", this.renderReactUI(), this.emit("disconnected"), this.pageTracker.stop();
17137
+ console.log("[OnboardingSDK] Disconnected from Pipecat"), this.isConnected = !1, this.agentState = "idle", this.pageTracker.stop(), this.domIntrospector.stopCapturing(), this.navigationCompleteDetector && this.navigationCompleteDetector.stop(), this.overlay.clearHighlight(), this.audioElements && (this.audioElements.forEach((t) => {
17138
+ t.pause(), t.remove();
17139
+ }), this.audioElements = []), this.botAudioAnalyzer && (this.botAudioAnalyzer.destroy(), this.botAudioAnalyzer = null), this.userAudioAnalyzer && (this.userAudioAnalyzer.destroy(), this.userAudioAnalyzer = null), this.userMicStreamRequestId++, this.userMicStream && (console.log("[OnboardingSDK] 🎤 Stopping user microphone stream"), this.userMicStream.getTracks().forEach((t) => t.stop()), this.userMicStream = null), this.audioLevels = [], this.renderReactUI(), this.emit("disconnected");
17124
17140
  },
17125
17141
  onBotReady: () => {
17126
17142
  var t;
@@ -17169,7 +17185,7 @@ class ec extends Yd {
17169
17185
  }), console.log("[OnboardingSDK] 📝 Added assistant message to history:", this.botTranscript.substring(0, 50) + "...")), this.botTranscript = "", this.renderReactUI(), this.emit("botSpeaking", !1);
17170
17186
  },
17171
17187
  onServerMessage: (t) => {
17172
- console.log("[OnboardingSDK] Server message:", t), this.handleServerMessage(t), t.type === "session_paused" && (console.log("[OnboardingSDK] Session paused:", t), this.agentState = "paused", this.pausedSessionId = t.session_id || null, this.renderReactUI(), this.emit("sessionPaused", t));
17188
+ console.log("[OnboardingSDK] Server message:", t), this.handleServerMessage(t);
17173
17189
  },
17174
17190
  onError: (t) => {
17175
17191
  console.error("[OnboardingSDK] Error:", t), this.emit("error", t);
@@ -17279,7 +17295,7 @@ class ec extends Yd {
17279
17295
  console.log("[OnboardingSDK] 🎯 Received direct hybrid action:", r.action), this.handleHybridAction(r);
17280
17296
  return;
17281
17297
  }
17282
- r.type === "highlight" ? (console.log("[OnboardingSDK] Handling highlight command"), r.target ? this.overlay.highlightTarget(r.target, r.options) : r.selector && this.overlay.highlight(r.selector, r.options)) : r.type === "tooltip" && r.text ? this.overlay.showTooltip(r.text, r.options) : r.type === "action" ? r.target ? this.handleHybridAction(r) : this.actionExecutor.executeWithConsent(r.action) : r.type === "clear_highlight" ? this.overlay.clearHighlight() : r.type === "batched_navigation" ? this.handleBatchedNavigation(r) : r.type === "fast_action" ? this.executeActionFast(r) : r.type === "session_paused" ? (console.log("[OnboardingSDK] Session paused:", r), this.agentState = "paused", this.pausedSessionId = r.session_id || null, this.renderReactUI(), this.emit("sessionPaused", r)) : console.log("[OnboardingSDK] Unhandled server message type:", r.type || "unknown");
17298
+ r.type === "highlight" ? (console.log("[OnboardingSDK] Handling highlight command"), r.target ? this.overlay.highlightTarget(r.target, r.options) : r.selector && this.overlay.highlight(r.selector, r.options)) : r.type === "tooltip" && r.text ? this.overlay.showTooltip(r.text, r.options) : r.type === "action" ? r.target ? this.handleHybridAction(r) : this.actionExecutor.executeWithConsent(r.action) : r.type === "clear_highlight" ? this.overlay.clearHighlight() : r.type === "batched_navigation" ? this.handleBatchedNavigation(r) : r.type === "fast_action" ? this.executeActionFast(r) : r.type === "session_paused" ? (console.log("[OnboardingSDK] Session paused:", r), this.agentState = "paused", this.pausedSessionId = r.session_id || null, this.overlay.clearHighlight(), this.renderReactUI(), this.emit("sessionPaused", r)) : console.log("[OnboardingSDK] Unhandled server message type:", r.type || "unknown");
17283
17299
  }
17284
17300
  /**
17285
17301
  * Handle hybrid UI action from bot
@@ -18396,95 +18412,145 @@ class ec extends Yd {
18396
18412
  }
18397
18413
  </style>
18398
18414
 
18399
- <!-- Icon -->
18415
+ <!-- Icon with live indicator -->
18400
18416
  <div style="display: flex; justify-content: center; margin-bottom: 24px;">
18401
- <div style="
18402
- width: 64px;
18403
- height: 64px;
18404
- border-radius: 16px;
18405
- background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
18406
- border: 1px solid rgba(139, 92, 246, 0.3);
18407
- display: flex;
18408
- align-items: center;
18409
- justify-content: center;
18410
- box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15);
18411
- ">
18412
- <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="#a78bfa" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
18413
- <path d="M12 2L2 7l10 5 10-5-10-5z"/>
18414
- <path d="M2 17l10 5 10-5"/>
18415
- <path d="M2 12l10 5 10-5"/>
18416
- </svg>
18417
+ <div style="position: relative;">
18418
+ <div style="
18419
+ width: 64px;
18420
+ height: 64px;
18421
+ border-radius: 16px;
18422
+ background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
18423
+ border: 1px solid rgba(139, 92, 246, 0.3);
18424
+ display: flex;
18425
+ align-items: center;
18426
+ justify-content: center;
18427
+ box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15);
18428
+ ">
18429
+ <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="url(#welcomeIconGradient)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
18430
+ <defs>
18431
+ <linearGradient id="welcomeIconGradient" x1="0%" y1="0%" x2="100%" y2="100%">
18432
+ <stop offset="0%" stop-color="#818cf8" />
18433
+ <stop offset="100%" stop-color="#a78bfa" />
18434
+ </linearGradient>
18435
+ </defs>
18436
+ <!-- Headset/support icon -->
18437
+ <path d="M3 18v-6a9 9 0 0 1 18 0v6"/>
18438
+ <path d="M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3v5z"/>
18439
+ <path d="M3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3v5z"/>
18440
+ </svg>
18441
+ </div>
18442
+ <!-- Live pulse indicator -->
18443
+ <div style="
18444
+ position: absolute;
18445
+ top: -2px;
18446
+ right: -2px;
18447
+ width: 14px;
18448
+ height: 14px;
18449
+ background: #10b981;
18450
+ border-radius: 50%;
18451
+ border: 2px solid rgba(24, 24, 28, 0.99);
18452
+ animation: livePulse 2s ease-in-out infinite;
18453
+ "></div>
18417
18454
  </div>
18418
18455
  </div>
18419
18456
 
18457
+ <style>
18458
+ @keyframes livePulse {
18459
+ 0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
18460
+ 50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
18461
+ }
18462
+ #floe-start-guided, #floe-skip-guided {
18463
+ cursor: pointer !important;
18464
+ }
18465
+ #floe-start-guided:hover, #floe-skip-guided:hover {
18466
+ cursor: pointer !important;
18467
+ }
18468
+ </style>
18469
+
18420
18470
  <!-- Title -->
18421
18471
  <h2 style="margin: 0 0 12px 0; font-size: 20px; font-weight: 600; color: rgba(255, 255, 255, 0.95); text-align: center; letter-spacing: -0.02em;">
18422
- Let's personalize your setup
18472
+ Your AI guide is ready
18423
18473
  </h2>
18424
18474
 
18425
18475
  <!-- Description -->
18426
- <p style="margin: 0 0 20px 0; color: rgba(255, 255, 255, 0.6); font-size: 14px; line-height: 1.6; text-align: center;">
18427
- I'll ask a few quick questions to understand your needs, then guide you through the perfect setup for your use case.
18476
+ <p style="margin: 0 0 8px 0; color: rgba(255, 255, 255, 0.6); font-size: 14px; line-height: 1.6; text-align: center;">
18477
+ Start a live voice conversation to get personalized help setting up your account.
18428
18478
  </p>
18429
18479
 
18430
- <!-- Benefits -->
18431
- <div style="background: rgba(255, 255, 255, 0.03); border-radius: 10px; padding: 14px; margin-bottom: 24px; border: 1px solid rgba(255, 255, 255, 0.05);">
18432
- <div style="display: flex; align-items: center; gap: 10px; margin-bottom: 10px;">
18433
- <span style="font-size: 14px;">⚡</span>
18434
- <span style="font-size: 13px; color: rgba(255, 255, 255, 0.7);">Takes less than a minute</span>
18435
- </div>
18436
- <div style="display: flex; align-items: center; gap: 10px;">
18437
- <span style="font-size: 14px;">🎯</span>
18438
- <span style="font-size: 13px; color: rgba(255, 255, 255, 0.7);">Get a customized walkthrough</span>
18480
+ <!-- Live badge -->
18481
+ <div style="display: flex; justify-content: center; margin-bottom: 28px;">
18482
+ <div style="
18483
+ display: inline-flex;
18484
+ align-items: center;
18485
+ gap: 6px;
18486
+ padding: 6px 12px;
18487
+ background: rgba(16, 185, 129, 0.1);
18488
+ border: 1px solid rgba(16, 185, 129, 0.2);
18489
+ border-radius: 20px;
18490
+ ">
18491
+ <div style="width: 6px; height: 6px; background: #10b981; border-radius: 50%;"></div>
18492
+ <span style="font-size: 12px; font-weight: 500; color: #10b981;">Live voice assistant</span>
18439
18493
  </div>
18440
18494
  </div>
18441
18495
 
18442
18496
  <!-- Buttons -->
18443
- <div style="display: flex; flex-direction: column; gap: 12px;">
18497
+ <div style="display: flex; gap: 12px;">
18444
18498
  <button id="floe-start-guided" style="
18445
- width: 100%;
18499
+ flex: 1;
18446
18500
  padding: 14px 20px;
18447
18501
  border-radius: 12px;
18448
18502
  font-size: 14px;
18449
18503
  font-weight: 600;
18450
- cursor: pointer;
18504
+ cursor: pointer !important;
18451
18505
  border: none;
18452
- background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(139, 92, 246, 0.9) 100%);
18506
+ background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
18453
18507
  color: white;
18454
18508
  transition: all 0.2s ease;
18455
- box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
18456
- ">
18457
- 🚀 Let's Get Started
18458
- </button>
18459
- <button id="floe-skip-guided" style="
18460
- width: 100%;
18461
- padding: 14px 20px;
18462
- border-radius: 12px;
18463
- font-size: 14px;
18464
- font-weight: 500;
18465
- cursor: pointer;
18466
- border: 1px solid rgba(255, 255, 255, 0.1);
18467
- background: rgba(255, 255, 255, 0.05);
18468
- color: rgba(255, 255, 255, 0.7);
18469
- transition: all 0.2s ease;
18509
+ box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
18510
+ display: flex;
18511
+ align-items: center;
18512
+ justify-content: center;
18513
+ gap: 8px;
18470
18514
  ">
18471
- Skip I'll explore on my own
18515
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
18516
+ <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>
18517
+ <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>
18518
+ <line x1="12" y1="19" x2="12" y2="23"/>
18519
+ <line x1="8" y1="23" x2="16" y2="23"/>
18520
+ </svg>
18521
+ Start Conversation
18472
18522
  </button>
18473
18523
  </div>
18524
+
18525
+ <button id="floe-skip-guided" style="
18526
+ width: 100%;
18527
+ margin-top: 12px;
18528
+ padding: 12px 20px;
18529
+ border-radius: 12px;
18530
+ font-size: 14px;
18531
+ font-weight: 500;
18532
+ cursor: pointer !important;
18533
+ border: none;
18534
+ background: transparent;
18535
+ color: rgba(255, 255, 255, 0.4);
18536
+ transition: all 0.2s ease;
18537
+ ">
18538
+ I'll explore on my own
18539
+ </button>
18474
18540
  `, r.appendChild(i), document.body.appendChild(r);
18475
18541
  const o = r.querySelector("#floe-start-guided"), s = r.querySelector("#floe-skip-guided");
18476
18542
  o && (o.onmouseenter = () => {
18477
- o.style.transform = "translateY(-2px)", o.style.boxShadow = "0 8px 20px rgba(99, 102, 241, 0.4)";
18543
+ o.style.background = "linear-gradient(135deg, #818cf8 0%, #a78bfa 100%)", o.style.transform = "translateY(-1px)", o.style.boxShadow = "0 8px 24px rgba(99, 102, 241, 0.4)";
18478
18544
  }, o.onmouseleave = () => {
18479
- o.style.transform = "translateY(0)", o.style.boxShadow = "0 4px 12px rgba(99, 102, 241, 0.3)";
18545
+ o.style.background = "linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)", o.style.transform = "translateY(0)", o.style.boxShadow = "0 4px 12px rgba(99, 102, 241, 0.25)";
18480
18546
  }, o.onclick = () => {
18481
18547
  r.style.animation = "welcomeFadeOut 0.2s ease", setTimeout(() => {
18482
18548
  r.remove(), t(!0);
18483
18549
  }, 200);
18484
18550
  }), s && (s.onmouseenter = () => {
18485
- s.style.background = "rgba(255, 255, 255, 0.1)", s.style.color = "rgba(255, 255, 255, 0.9)";
18551
+ s.style.color = "rgba(255, 255, 255, 0.8)";
18486
18552
  }, s.onmouseleave = () => {
18487
- s.style.background = "rgba(255, 255, 255, 0.05)", s.style.color = "rgba(255, 255, 255, 0.7)";
18553
+ s.style.color = "rgba(255, 255, 255, 0.4)";
18488
18554
  }, s.onclick = () => {
18489
18555
  r.style.animation = "welcomeFadeOut 0.2s ease", setTimeout(() => {
18490
18556
  r.remove(), t(!1);
@@ -18588,9 +18654,9 @@ class ec extends Yd {
18588
18654
  * Disconnect and cleanup
18589
18655
  */
18590
18656
  async disconnect() {
18591
- this.pageTracker.stop(), this.domIntrospector.stopCapturing(), this.navigationCompleteDetector && this.navigationCompleteDetector.stop(), this.pipecatClient && (await this.pipecatClient.disconnect(), this.pipecatClient = null), this.transport && (this.transport = null), this.audioElements && (this.audioElements.forEach((t) => {
18657
+ this.pageTracker.stop(), this.domIntrospector.stopCapturing(), this.navigationCompleteDetector && this.navigationCompleteDetector.stop(), this.overlay.clearHighlight(), this.pipecatClient && (await this.pipecatClient.disconnect(), this.pipecatClient = null), this.transport && (this.transport = null), this.audioElements && (this.audioElements.forEach((t) => {
18592
18658
  t.pause(), t.remove();
18593
- }), this.audioElements = []), this.botAudioAnalyzer && (this.botAudioAnalyzer.destroy(), this.botAudioAnalyzer = null), this.userAudioAnalyzer && (this.userAudioAnalyzer.destroy(), this.userAudioAnalyzer = null), this.userMicStream && (this.userMicStream.getTracks().forEach((t) => t.stop()), this.userMicStream = null), this.audioLevels = [], this.reactRoot && (this.reactRoot.unmount(), this.reactRoot = null), this.reactContainer && (this.reactContainer.remove(), this.reactContainer = null), this.overlay.remove(), this.isInitialized = !1, this.isConnected = !1, this.agentState = "idle", console.log("[OnboardingSDK] Disconnected"), this.emit("disconnected");
18659
+ }), this.audioElements = []), this.botAudioAnalyzer && (this.botAudioAnalyzer.destroy(), this.botAudioAnalyzer = null), this.userAudioAnalyzer && (this.userAudioAnalyzer.destroy(), this.userAudioAnalyzer = null), this.userMicStreamRequestId++, this.userMicStream && (this.userMicStream.getTracks().forEach((t) => t.stop()), this.userMicStream = null), this.audioLevels = [], this.reactRoot && (this.reactRoot.unmount(), this.reactRoot = null), this.reactContainer && (this.reactContainer.remove(), this.reactContainer = null), this.overlay.remove(), this.isInitialized = !1, this.isConnected = !1, this.agentState = "idle", console.log("[OnboardingSDK] Disconnected"), this.emit("disconnected");
18594
18660
  }
18595
18661
  }
18596
18662
  typeof window < "u" && (window.OnboardingSDK = ec);