@fiction/sdk 1.0.62 → 1.0.64

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.
@@ -1,8 +1,8 @@
1
1
  var nr = Object.defineProperty;
2
2
  var So = (e, t, r) => t in e ? nr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var s = (e, t) => nr(e, "name", { value: t, configurable: !0 });
4
- var j = (e, t, r) => So(e, typeof t != "symbol" ? t + "" : t, r);
5
- import { defineComponent as q, createElementBlock as k, openBlock as v, createElementVNode as f, normalizeClass as T, ref as V, watch as be, createBlock as ve, TransitionGroup as Tr, withCtx as he, renderSlot as Be, computed as P, createCommentVNode as L, onMounted as We, Fragment as Ee, renderList as tt, withDirectives as Pr, vModelText as Dr, toDisplayString as Y, createVNode as W, withKeys as $o, createTextVNode as Ge, unref as re, resolveDynamicComponent as Co, nextTick as zt, Transition as sr, withModifiers as jr, normalizeStyle as Ot, onUnmounted as Lr, createPropsRestProxy as Ao, mergeProps as Io, shallowRef as Eo } from "vue";
4
+ var F = (e, t, r) => So(e, typeof t != "symbol" ? t + "" : t, r);
5
+ import { defineComponent as q, createElementBlock as k, openBlock as v, createElementVNode as f, normalizeClass as T, ref as V, watch as be, createBlock as ve, TransitionGroup as Tr, withCtx as he, renderSlot as Be, computed as P, createCommentVNode as j, onMounted as We, Fragment as Ee, renderList as tt, withDirectives as Pr, vModelText as Dr, toDisplayString as Y, createVNode as W, withKeys as $o, createTextVNode as Ge, unref as re, resolveDynamicComponent as Co, nextTick as zt, Transition as sr, withModifiers as jr, normalizeStyle as Ot, onUnmounted as Lr, createPropsRestProxy as Ao, mergeProps as Io, shallowRef as Eo } from "vue";
6
6
  import { Conversation as ir } from "@elevenlabs/client";
7
7
  import { objectId as Mo } from "@fiction/utils";
8
8
  import { S as Or, c as Zo, F as To } from "./sdkClient-C4JqZ1Sg.js";
@@ -2517,21 +2517,21 @@ const io = [
2517
2517
  ], er = class er extends Or {
2518
2518
  constructor(r) {
2519
2519
  super("ClientAudio", r);
2520
- j(this, "audioContext");
2521
- j(this, "analyser");
2522
- j(this, "microphone");
2523
- j(this, "audioLevelInterval");
2524
- j(this, "stream");
2525
- j(this, "visibilityChangeHandler");
2526
- j(this, "vadTimeout");
2527
- j(this, "lastSpeechTime", 0);
2520
+ F(this, "audioContext");
2521
+ F(this, "analyser");
2522
+ F(this, "microphone");
2523
+ F(this, "audioLevelInterval");
2524
+ F(this, "stream");
2525
+ F(this, "visibilityChangeHandler");
2526
+ F(this, "vadTimeout");
2527
+ F(this, "lastSpeechTime", 0);
2528
2528
  // VAD configuration - tuned for voice isolation (ignores background music)
2529
- j(this, "VAD_SILENCE_THRESHOLD", 0.03);
2529
+ F(this, "VAD_SILENCE_THRESHOLD", 0.03);
2530
2530
  // 3% audio level = silence (filters out quiet background noise)
2531
- j(this, "VAD_SILENCE_DURATION", 1200);
2531
+ F(this, "VAD_SILENCE_DURATION", 1200);
2532
2532
  // 1.2 seconds of silence before considering "stopped speaking"
2533
2533
  // Public reactive state
2534
- j(this, "audioLevels", V({ inputLevel: 0, outputLevel: 0 }));
2534
+ F(this, "audioLevels", V({ inputLevel: 0, outputLevel: 0 }));
2535
2535
  this.setupVisibilityHandler();
2536
2536
  }
2537
2537
  /**
@@ -2783,26 +2783,22 @@ s(vu, "generateFirstMessage");
2783
2783
  const tr = class tr extends Or {
2784
2784
  constructor(r) {
2785
2785
  super("SelfController", r);
2786
- j(this, "conversation");
2787
- j(this, "isTextMode", !1);
2788
- j(this, "lastMessage", { hash: "", time: 0 });
2789
- j(this, "clientAudio");
2790
- j(this, "unwatchAudio");
2791
- j(this, "isConnecting", !1);
2792
- j(this, "lastUserSpeechTime", 0);
2793
- // Track when user last spoke (audio VAD)
2794
- j(this, "lastUserMessageTime", 0);
2795
- // Track when user's last transcription arrived (ElevenLabs)
2786
+ F(this, "conversation");
2787
+ F(this, "isTextMode", !1);
2788
+ F(this, "lastMessage", { hash: "", time: 0 });
2789
+ F(this, "clientAudio");
2790
+ F(this, "unwatchAudio");
2791
+ F(this, "isConnecting", !1);
2796
2792
  // Simple usage tracking
2797
- j(this, "sessionId");
2798
- j(this, "conversationStartTime");
2799
- j(this, "chatCharacterCount", 0);
2793
+ F(this, "sessionId");
2794
+ F(this, "conversationStartTime");
2795
+ F(this, "chatCharacterCount", 0);
2800
2796
  // Participant IDs for message attribution
2801
- j(this, "hostParticipantId");
2797
+ F(this, "hostParticipantId");
2802
2798
  // The digital self
2803
- j(this, "visitorParticipantId");
2799
+ F(this, "visitorParticipantId");
2804
2800
  // The user/anon
2805
- j(this, "voiceState", V({
2801
+ F(this, "voiceState", V({
2806
2802
  isActive: !1,
2807
2803
  isConnected: !1,
2808
2804
  isSpeaking: !1,
@@ -2811,14 +2807,14 @@ const tr = class tr extends Or {
2811
2807
  transcript: "Tap to begin voice conversation",
2812
2808
  connectionStatus: "disconnected"
2813
2809
  }));
2814
- j(this, "textState", V({
2810
+ F(this, "textState", V({
2815
2811
  isActive: !1,
2816
2812
  isConnected: !1,
2817
2813
  isThinking: !1,
2818
2814
  connectionStatus: "disconnected"
2819
2815
  }));
2820
- j(this, "agentMode", V("self"));
2821
- j(this, "sharedMessages", V([]));
2816
+ F(this, "agentMode", V("self"));
2817
+ F(this, "sharedMessages", V([]));
2822
2818
  if (!r.self.elevenlabsAgentId || r.self.elevenlabsAgentId.trim() === "")
2823
2819
  throw new Error(`Agent ID is required for SelfController. Self "${r.self.name}" (${r.self.selfId}) does not have a valid elevenlabsAgentId.`);
2824
2820
  this.clientAudio = new Zt(r), this.setupModeWatcher();
@@ -2914,7 +2910,7 @@ Current User:
2914
2910
  transcript: "Ready to start a call...",
2915
2911
  connectionStatus: "disconnected",
2916
2912
  error: void 0
2917
- }), this.clientAudio.resetAudioLevels(), this.lastUserSpeechTime = 0, this.lastUserMessageTime = 0);
2913
+ }), this.clientAudio.resetAudioLevels());
2918
2914
  }
2919
2915
  setupModeWatcher() {
2920
2916
  be(this.agentMode, async (r, o) => {
@@ -2923,7 +2919,7 @@ Current User:
2923
2919
  }
2924
2920
  handleMessage(r, o) {
2925
2921
  const n = ja(r);
2926
- if (n && (o && n.sender === "user" && (this.lastUserMessageTime = Date.now(), this.logger.info("User transcription received", { text: n.text })), this.addMessage(n.text, n.sender), !o && n.sender === "agent" && this.updateState(this.textState, { isThinking: !1 }), this.sessionId && this.hostParticipantId && this.visitorParticipantId)) {
2922
+ if (n && (o && n.sender === "user" && this.logger.info("User transcription received", { text: n.text }), this.addMessage(n.text, n.sender), !o && n.sender === "agent" && this.updateState(this.textState, { isThinking: !1 }), this.sessionId && this.hostParticipantId && this.visitorParticipantId)) {
2927
2923
  const i = n.sender === "agent" ? this.hostParticipantId : this.visitorParticipantId, { sdk: a } = this.settings;
2928
2924
  a.saveMessage({
2929
2925
  conversationId: this.sessionId,
@@ -2980,7 +2976,7 @@ Current User:
2980
2976
  this.logger.info("Client-side VAD: User has stopped speaking"), this.conversation && (this.conversation.sendUserActivity(), this.logger.info("Sent user activity signal to ElevenLabs"));
2981
2977
  }
2982
2978
  ), this.unwatchAudio = be(this.audioLevels, (i) => {
2983
- i.inputLevel > 0.03 && (this.lastUserSpeechTime = Date.now()), r.onAudioLevel?.(i);
2979
+ r.onAudioLevel?.(i);
2984
2980
  }, { immediate: !0 }), this.updateState(this.voiceState, {
2985
2981
  isConnected: !0,
2986
2982
  isListening: !0,
@@ -3000,22 +2996,17 @@ Current User:
3000
2996
  i.includes("does not exist") ? a = `Agent not found: ${this.settings.self.elevenlabsAgentId}. Check ElevenLabs configuration.` : i.includes("limit") || i.includes("quota") ? a = "ElevenLabs account limit reached. Check your subscription and usage." : (i.includes("unauthorized") || i.includes("invalid")) && (a = "ElevenLabs API authentication failed. Check ELEVENLABS_API_KEY."), this.endSession().catch((l) => console.error("Failed to end session:", l)), this.handleError(new Error(a), !0), r.onError?.(new Error(a));
3001
2997
  }, "onError"),
3002
2998
  onModeChange: /* @__PURE__ */ s((i) => {
3003
- const a = i.mode === "speaking", l = 3e3, c = Date.now(), g = c - this.lastUserSpeechTime, u = c - this.lastUserMessageTime, h = g < l || u < l, m = !a && h;
3004
- let w;
3005
- a ? w = "Speaking..." : m ? w = "Thinking..." : w = "Listening...", this.updateState(this.voiceState, {
2999
+ const a = i.mode === "speaking", l = !a, c = a ? "Speaking..." : "Listening...";
3000
+ this.updateState(this.voiceState, {
3006
3001
  isSpeaking: a,
3007
- isListening: !a,
3008
- // Mic active when agent not speaking - ElevenLabs handles interruptions
3009
- isProcessing: m,
3010
- transcript: w
3002
+ isListening: l,
3003
+ isProcessing: !1,
3004
+ // Removed - ElevenLabs doesn't provide accurate processing state
3005
+ transcript: c
3011
3006
  }), this.logger.info("Voice mode changed", {
3012
3007
  mode: i.mode,
3013
3008
  isSpeaking: a,
3014
- isListening: !a,
3015
- isProcessing: m,
3016
- timeSinceUserSpeech: g,
3017
- timeSinceUserMessage: u,
3018
- detectionSource: u < g ? "message" : "audio"
3009
+ isListening: l
3019
3010
  }), r.onModeChange?.(i.mode);
3020
3011
  }, "onModeChange"),
3021
3012
  onMessage: /* @__PURE__ */ s((i) => {
@@ -3179,19 +3170,19 @@ const La = /* @__PURE__ */ q({
3179
3170
  }, [
3180
3171
  e.loading ? (v(), k("div", Oa, [...i[0] || (i[0] = [
3181
3172
  f("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
3182
- ])])) : L("", !0),
3173
+ ])])) : j("", !0),
3183
3174
  f("span", {
3184
3175
  class: T(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"])
3185
3176
  }, [
3186
3177
  e.icon ? (v(), k("i", {
3187
3178
  key: 0,
3188
3179
  class: T([e.icon, o.value])
3189
- }, null, 2)) : L("", !0),
3180
+ }, null, 2)) : j("", !0),
3190
3181
  Be(n.$slots, "default"),
3191
3182
  e.iconAfter ? (v(), k("i", {
3192
3183
  key: 1,
3193
3184
  class: T([e.iconAfter, o.value])
3194
- }, null, 2)) : L("", !0)
3185
+ }, null, 2)) : j("", !0)
3195
3186
  ], 2)
3196
3187
  ], 2));
3197
3188
  }
@@ -3332,7 +3323,7 @@ const La = /* @__PURE__ */ q({
3332
3323
  }, i = P(() => n[r.value]);
3333
3324
  return (a, l) => (v(), k("div", Ba, [
3334
3325
  f("div", Ga, [
3335
- e.sdk.error.value ? (v(), k("p", Wa, Y(e.sdk.error.value), 1)) : L("", !0),
3326
+ e.sdk.error.value ? (v(), k("p", Wa, Y(e.sdk.error.value), 1)) : j("", !0),
3336
3327
  f("h3", Ha, Y(i.value.title), 1),
3337
3328
  f("div", qa, [
3338
3329
  W(La, null, {
@@ -3373,7 +3364,7 @@ const La = /* @__PURE__ */ q({
3373
3364
  key: 0,
3374
3365
  class: "w-full text-xs text-white/50 hover:text-white/70 transition-colors py-2",
3375
3366
  onClick: l[2] || (l[2] = (c) => r.value = "email")
3376
- }, " Change Email ")) : L("", !0)
3367
+ }, " Change Email ")) : j("", !0)
3377
3368
  ]))
3378
3369
  ]),
3379
3370
  _: 1
@@ -3420,7 +3411,7 @@ const La = /* @__PURE__ */ q({
3420
3411
  style: { "animation-duration": "3s" }
3421
3412
  }, null, -1),
3422
3413
  f("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1)
3423
- ])])) : L("", !0)
3414
+ ])])) : j("", !0)
3424
3415
  ]),
3425
3416
  f("div", el, [
3426
3417
  f("h1", {
@@ -3720,7 +3711,7 @@ const J = /* @__PURE__ */ s((e) => {
3720
3711
  repeat: ["", "x", "y", "space", "round"]
3721
3712
  }], "scaleBgRepeat"), E = /* @__PURE__ */ s(() => ["auto", "cover", "contain", Il, $l, {
3722
3713
  size: [x, y]
3723
- }], "scaleBgSize"), X = /* @__PURE__ */ s(() => [_t, Qe, Pe], "scaleGradientStopPosition"), O = /* @__PURE__ */ s(() => [
3714
+ }], "scaleBgSize"), X = /* @__PURE__ */ s(() => [_t, Qe, Pe], "scaleGradientStopPosition"), L = /* @__PURE__ */ s(() => [
3724
3715
  // Deprecated since Tailwind CSS v4.0.0
3725
3716
  "",
3726
3717
  "none",
@@ -3728,7 +3719,7 @@ const J = /* @__PURE__ */ s((e) => {
3728
3719
  g,
3729
3720
  x,
3730
3721
  y
3731
- ], "scaleRadius"), F = /* @__PURE__ */ s(() => ["", M, Qe, Pe], "scaleBorderWidth"), oe = /* @__PURE__ */ s(() => ["solid", "dashed", "dotted", "double"], "scaleLineStyle"), G = /* @__PURE__ */ s(() => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], "scaleBlendMode"), D = /* @__PURE__ */ s(() => [M, _t, Ir, Ar], "scaleMaskImagePosition"), ye = /* @__PURE__ */ s(() => [
3722
+ ], "scaleRadius"), O = /* @__PURE__ */ s(() => ["", M, Qe, Pe], "scaleBorderWidth"), oe = /* @__PURE__ */ s(() => ["solid", "dashed", "dotted", "double"], "scaleLineStyle"), G = /* @__PURE__ */ s(() => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], "scaleBlendMode"), D = /* @__PURE__ */ s(() => [M, _t, Ir, Ar], "scaleMaskImagePosition"), ye = /* @__PURE__ */ s(() => [
3732
3723
  // Deprecated since Tailwind CSS v4.0.0
3733
3724
  "",
3734
3725
  "none",
@@ -4773,175 +4764,175 @@ const J = /* @__PURE__ */ s((e) => {
4773
4764
  * @see https://tailwindcss.com/docs/border-radius
4774
4765
  */
4775
4766
  rounded: [{
4776
- rounded: O()
4767
+ rounded: L()
4777
4768
  }],
4778
4769
  /**
4779
4770
  * Border Radius Start
4780
4771
  * @see https://tailwindcss.com/docs/border-radius
4781
4772
  */
4782
4773
  "rounded-s": [{
4783
- "rounded-s": O()
4774
+ "rounded-s": L()
4784
4775
  }],
4785
4776
  /**
4786
4777
  * Border Radius End
4787
4778
  * @see https://tailwindcss.com/docs/border-radius
4788
4779
  */
4789
4780
  "rounded-e": [{
4790
- "rounded-e": O()
4781
+ "rounded-e": L()
4791
4782
  }],
4792
4783
  /**
4793
4784
  * Border Radius Top
4794
4785
  * @see https://tailwindcss.com/docs/border-radius
4795
4786
  */
4796
4787
  "rounded-t": [{
4797
- "rounded-t": O()
4788
+ "rounded-t": L()
4798
4789
  }],
4799
4790
  /**
4800
4791
  * Border Radius Right
4801
4792
  * @see https://tailwindcss.com/docs/border-radius
4802
4793
  */
4803
4794
  "rounded-r": [{
4804
- "rounded-r": O()
4795
+ "rounded-r": L()
4805
4796
  }],
4806
4797
  /**
4807
4798
  * Border Radius Bottom
4808
4799
  * @see https://tailwindcss.com/docs/border-radius
4809
4800
  */
4810
4801
  "rounded-b": [{
4811
- "rounded-b": O()
4802
+ "rounded-b": L()
4812
4803
  }],
4813
4804
  /**
4814
4805
  * Border Radius Left
4815
4806
  * @see https://tailwindcss.com/docs/border-radius
4816
4807
  */
4817
4808
  "rounded-l": [{
4818
- "rounded-l": O()
4809
+ "rounded-l": L()
4819
4810
  }],
4820
4811
  /**
4821
4812
  * Border Radius Start Start
4822
4813
  * @see https://tailwindcss.com/docs/border-radius
4823
4814
  */
4824
4815
  "rounded-ss": [{
4825
- "rounded-ss": O()
4816
+ "rounded-ss": L()
4826
4817
  }],
4827
4818
  /**
4828
4819
  * Border Radius Start End
4829
4820
  * @see https://tailwindcss.com/docs/border-radius
4830
4821
  */
4831
4822
  "rounded-se": [{
4832
- "rounded-se": O()
4823
+ "rounded-se": L()
4833
4824
  }],
4834
4825
  /**
4835
4826
  * Border Radius End End
4836
4827
  * @see https://tailwindcss.com/docs/border-radius
4837
4828
  */
4838
4829
  "rounded-ee": [{
4839
- "rounded-ee": O()
4830
+ "rounded-ee": L()
4840
4831
  }],
4841
4832
  /**
4842
4833
  * Border Radius End Start
4843
4834
  * @see https://tailwindcss.com/docs/border-radius
4844
4835
  */
4845
4836
  "rounded-es": [{
4846
- "rounded-es": O()
4837
+ "rounded-es": L()
4847
4838
  }],
4848
4839
  /**
4849
4840
  * Border Radius Top Left
4850
4841
  * @see https://tailwindcss.com/docs/border-radius
4851
4842
  */
4852
4843
  "rounded-tl": [{
4853
- "rounded-tl": O()
4844
+ "rounded-tl": L()
4854
4845
  }],
4855
4846
  /**
4856
4847
  * Border Radius Top Right
4857
4848
  * @see https://tailwindcss.com/docs/border-radius
4858
4849
  */
4859
4850
  "rounded-tr": [{
4860
- "rounded-tr": O()
4851
+ "rounded-tr": L()
4861
4852
  }],
4862
4853
  /**
4863
4854
  * Border Radius Bottom Right
4864
4855
  * @see https://tailwindcss.com/docs/border-radius
4865
4856
  */
4866
4857
  "rounded-br": [{
4867
- "rounded-br": O()
4858
+ "rounded-br": L()
4868
4859
  }],
4869
4860
  /**
4870
4861
  * Border Radius Bottom Left
4871
4862
  * @see https://tailwindcss.com/docs/border-radius
4872
4863
  */
4873
4864
  "rounded-bl": [{
4874
- "rounded-bl": O()
4865
+ "rounded-bl": L()
4875
4866
  }],
4876
4867
  /**
4877
4868
  * Border Width
4878
4869
  * @see https://tailwindcss.com/docs/border-width
4879
4870
  */
4880
4871
  "border-w": [{
4881
- border: F()
4872
+ border: O()
4882
4873
  }],
4883
4874
  /**
4884
4875
  * Border Width X
4885
4876
  * @see https://tailwindcss.com/docs/border-width
4886
4877
  */
4887
4878
  "border-w-x": [{
4888
- "border-x": F()
4879
+ "border-x": O()
4889
4880
  }],
4890
4881
  /**
4891
4882
  * Border Width Y
4892
4883
  * @see https://tailwindcss.com/docs/border-width
4893
4884
  */
4894
4885
  "border-w-y": [{
4895
- "border-y": F()
4886
+ "border-y": O()
4896
4887
  }],
4897
4888
  /**
4898
4889
  * Border Width Start
4899
4890
  * @see https://tailwindcss.com/docs/border-width
4900
4891
  */
4901
4892
  "border-w-s": [{
4902
- "border-s": F()
4893
+ "border-s": O()
4903
4894
  }],
4904
4895
  /**
4905
4896
  * Border Width End
4906
4897
  * @see https://tailwindcss.com/docs/border-width
4907
4898
  */
4908
4899
  "border-w-e": [{
4909
- "border-e": F()
4900
+ "border-e": O()
4910
4901
  }],
4911
4902
  /**
4912
4903
  * Border Width Top
4913
4904
  * @see https://tailwindcss.com/docs/border-width
4914
4905
  */
4915
4906
  "border-w-t": [{
4916
- "border-t": F()
4907
+ "border-t": O()
4917
4908
  }],
4918
4909
  /**
4919
4910
  * Border Width Right
4920
4911
  * @see https://tailwindcss.com/docs/border-width
4921
4912
  */
4922
4913
  "border-w-r": [{
4923
- "border-r": F()
4914
+ "border-r": O()
4924
4915
  }],
4925
4916
  /**
4926
4917
  * Border Width Bottom
4927
4918
  * @see https://tailwindcss.com/docs/border-width
4928
4919
  */
4929
4920
  "border-w-b": [{
4930
- "border-b": F()
4921
+ "border-b": O()
4931
4922
  }],
4932
4923
  /**
4933
4924
  * Border Width Left
4934
4925
  * @see https://tailwindcss.com/docs/border-width
4935
4926
  */
4936
4927
  "border-w-l": [{
4937
- "border-l": F()
4928
+ "border-l": O()
4938
4929
  }],
4939
4930
  /**
4940
4931
  * Divide Width X
4941
4932
  * @see https://tailwindcss.com/docs/border-width#between-children
4942
4933
  */
4943
4934
  "divide-x": [{
4944
- "divide-x": F()
4935
+ "divide-x": O()
4945
4936
  }],
4946
4937
  /**
4947
4938
  * Divide Width X Reverse
@@ -4953,7 +4944,7 @@ const J = /* @__PURE__ */ s((e) => {
4953
4944
  * @see https://tailwindcss.com/docs/border-width#between-children
4954
4945
  */
4955
4946
  "divide-y": [{
4956
- "divide-y": F()
4947
+ "divide-y": O()
4957
4948
  }],
4958
4949
  /**
4959
4950
  * Divide Width Y Reverse
@@ -5115,7 +5106,7 @@ const J = /* @__PURE__ */ s((e) => {
5115
5106
  * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring
5116
5107
  */
5117
5108
  "ring-w": [{
5118
- ring: F()
5109
+ ring: O()
5119
5110
  }],
5120
5111
  /**
5121
5112
  * Ring Width Inset
@@ -5154,7 +5145,7 @@ const J = /* @__PURE__ */ s((e) => {
5154
5145
  * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring
5155
5146
  */
5156
5147
  "inset-ring-w": [{
5157
- "inset-ring": F()
5148
+ "inset-ring": O()
5158
5149
  }],
5159
5150
  /**
5160
5151
  * Inset Ring Color
@@ -6514,19 +6505,19 @@ const J = /* @__PURE__ */ s((e) => {
6514
6505
  W(Wt, {
6515
6506
  class: T(o.value)
6516
6507
  }, null, 8, ["class"])
6517
- ])) : L("", !0),
6508
+ ])) : j("", !0),
6518
6509
  f("span", {
6519
6510
  class: T(["flex items-center gap-2 transition-opacity duration-200 whitespace-nowrap", e.loading ? "opacity-0" : "opacity-100"])
6520
6511
  }, [
6521
6512
  t.value.icon ? (v(), k("span", {
6522
6513
  key: 0,
6523
6514
  class: T(["flex items-center size-[1.1em] mt-[-.07em]", [t.value.icon, a.value]])
6524
- }, null, 2)) : L("", !0),
6515
+ }, null, 2)) : j("", !0),
6525
6516
  Be(l.$slots, "default"),
6526
6517
  t.value.iconAfter ? (v(), k("span", {
6527
6518
  key: 1,
6528
6519
  class: T(["flex items-center size-[1.1em] mt-[-.07em]", [t.value.iconAfter, a.value]])
6529
- }, null, 2)) : L("", !0)
6520
+ }, null, 2)) : j("", !0)
6530
6521
  ], 2)
6531
6522
  ]),
6532
6523
  _: 3
@@ -6560,11 +6551,11 @@ const J = /* @__PURE__ */ s((e) => {
6560
6551
  class: "text-white/70 leading-relaxed",
6561
6552
  innerHTML: e.self.summary
6562
6553
  }, null, 8, Rl)
6563
- ])) : L("", !0),
6554
+ ])) : j("", !0),
6564
6555
  e.self.entityType === "company" ? (v(), k("div", Ul, [
6565
6556
  r[1] || (r[1] = f("h3", { class: "text-sm font-medium text-white/90 mb-2" }, " Company Info ", -1)),
6566
6557
  f("p", Vl, " This is a company digital self representing " + Y(e.self.name) + ". ", 1)
6567
- ])) : L("", !0),
6558
+ ])) : j("", !0),
6568
6559
  e.self.email ? (v(), k("div", Nl, [
6569
6560
  r[3] || (r[3] = f("h3", { class: "text-sm font-medium text-white/90" }, " Contact ", -1)),
6570
6561
  W(Mr, {
@@ -6581,7 +6572,7 @@ const J = /* @__PURE__ */ s((e) => {
6581
6572
  ])]),
6582
6573
  _: 1
6583
6574
  }, 8, ["href"])
6584
- ])) : L("", !0),
6575
+ ])) : j("", !0),
6585
6576
  e.self.accounts && e.self.accounts.length > 0 ? (v(), k("div", Bl, [
6586
6577
  r[4] || (r[4] = f("h3", { class: "text-sm font-medium text-white/90" }, " Links ", -1)),
6587
6578
  f("div", Gl, [
@@ -6601,7 +6592,7 @@ const J = /* @__PURE__ */ s((e) => {
6601
6592
  _: 2
6602
6593
  }, 1032, ["icon", "href"]))), 128))
6603
6594
  ])
6604
- ])) : L("", !0)
6595
+ ])) : j("", !0)
6605
6596
  ])
6606
6597
  ]));
6607
6598
  }
@@ -6674,7 +6665,7 @@ const J = /* @__PURE__ */ s((e) => {
6674
6665
  ]),
6675
6666
  e.selfController?.textState.value.connectionStatus !== "connected" ? (v(), k("div", Kl, [
6676
6667
  W(Wt, { class: "size-4" })
6677
- ])) : L("", !0),
6668
+ ])) : j("", !0),
6678
6669
  f("div", {
6679
6670
  ref_key: "messagesContainer",
6680
6671
  ref: r,
@@ -6694,8 +6685,8 @@ const J = /* @__PURE__ */ s((e) => {
6694
6685
  src: n.value,
6695
6686
  alt: e.self.name,
6696
6687
  class: "size-7 rounded-full object-cover"
6697
- }, null, 8, Yl)) : L("", !0)
6698
- ])) : L("", !0),
6688
+ }, null, 8, Yl)) : j("", !0)
6689
+ ])) : j("", !0),
6699
6690
  f("div", Ql, [
6700
6691
  f("div", {
6701
6692
  class: T(["rounded-2xl px-3.5 py-1.5 backdrop-blur-sm", m.sender === "user" ? "bg-primary-500/80 text-white" : "bg-white/15 text-white/95"])
@@ -6715,7 +6706,7 @@ const J = /* @__PURE__ */ s((e) => {
6715
6706
  h[1] || (h[1] = f("div", { class: "rounded-2xl px-4 py-2.5 bg-white/15 backdrop-blur-sm flex items-center" }, [
6716
6707
  f("i", { class: "i-svg-spinners-3-dots-fade size-6 text-white/70" })
6717
6708
  ], -1))
6718
- ])) : L("", !0)
6709
+ ])) : j("", !0)
6719
6710
  ], 512),
6720
6711
  f("div", oc, [
6721
6712
  Pr(f("textarea", {
@@ -6850,7 +6841,7 @@ const J = /* @__PURE__ */ s((e) => {
6850
6841
  key: 0,
6851
6842
  class: "absolute inset-0 z-40 bg-black/50 backdrop-blur-sm",
6852
6843
  onClick: h[0] || (h[0] = (m) => a.value = !1)
6853
- })) : L("", !0)
6844
+ })) : j("", !0)
6854
6845
  ]),
6855
6846
  _: 1
6856
6847
  }),
@@ -6879,10 +6870,10 @@ const J = /* @__PURE__ */ s((e) => {
6879
6870
  }, null, 8, ["class"]),
6880
6871
  e.title ? (v(), k("div", pc, [
6881
6872
  f("h3", vc, Y(e.title), 1)
6882
- ])) : L("", !0),
6873
+ ])) : j("", !0),
6883
6874
  u.$slots.header ? (v(), k("div", bc, [
6884
6875
  Be(u.$slots, "header")
6885
- ])) : L("", !0),
6876
+ ])) : j("", !0),
6886
6877
  f("div", {
6887
6878
  class: T(["flex-1 p-6 space-y-2 overflow-y-auto", { "pt-6": !e.title && !u.$slots.header, "pt-4": e.title || u.$slots.header }])
6888
6879
  }, [
@@ -6912,12 +6903,12 @@ const J = /* @__PURE__ */ s((e) => {
6912
6903
  m.icon.src,
6913
6904
  m.isActive ? "text-primary-400" : "text-white/70 group-hover:text-white"
6914
6905
  ]])
6915
- }, null, 2)) : L("", !0),
6906
+ }, null, 2)) : j("", !0),
6916
6907
  f("div", xc, [
6917
6908
  f("div", {
6918
6909
  class: T(["font-medium text-sm", m.isActive ? "text-primary-300" : "text-white"])
6919
6910
  }, Y(m.label), 3),
6920
- m.subLabel ? (v(), k("div", wc, Y(m.subLabel), 1)) : L("", !0)
6911
+ m.subLabel ? (v(), k("div", wc, Y(m.subLabel), 1)) : j("", !0)
6921
6912
  ])
6922
6913
  ])
6923
6914
  ], 14, kc))), 128))
@@ -6940,7 +6931,7 @@ const J = /* @__PURE__ */ s((e) => {
6940
6931
  ])
6941
6932
  ])
6942
6933
  ], 2)
6943
- ], 2)) : L("", !0)
6934
+ ], 2)) : j("", !0)
6944
6935
  ]),
6945
6936
  _: 3
6946
6937
  }, 8, ["enter-from-class", "leave-to-class"])
@@ -7169,11 +7160,11 @@ const J = /* @__PURE__ */ s((e) => {
7169
7160
  s(fe, "resizeCanvas");
7170
7161
  function A(b) {
7171
7162
  return Array.from({ length: n.length }, (U, I) => {
7172
- const E = n[I], O = Math.floor(E / 12e3 * b.length), F = Math.max(1, Math.floor(b.length / n.length / 2));
7163
+ const E = n[I], L = Math.floor(E / 12e3 * b.length), O = Math.max(1, Math.floor(b.length / n.length / 2));
7173
7164
  let oe = 0;
7174
- for (let ue = 0; ue < F && O + ue < b.length; ue++)
7175
- oe += b[O + ue];
7176
- oe = oe / F / 255;
7165
+ for (let ue = 0; ue < O && L + ue < b.length; ue++)
7166
+ oe += b[L + ue];
7167
+ oe = oe / O / 255;
7177
7168
  let G = 1;
7178
7169
  E < 150 ? G = 0.1 : E < 200 ? G = 0.3 : E >= 400 && E <= 600 ? G = 1.4 : E >= 1400 && E <= 1600 ? G = 1.3 : E >= 2400 && E <= 2600 ? G = 1.2 : E >= 200 && E <= 2e3 ? G = 1.1 : E >= 2e3 && E <= 4e3 ? G = 0.9 : E > 6e3 ? G = 0.4 : G = 0.7;
7179
7170
  const $e = oe ** 0.5 * 0.6 * G;
@@ -7198,23 +7189,23 @@ const J = /* @__PURE__ */ s((e) => {
7198
7189
  return b;
7199
7190
  const I = performance.now() * 1e-3, E = [...b];
7200
7191
  for (let X = 0; X < b.length; X++) {
7201
- const O = X * (2 * Math.PI) / b.length;
7202
- let F = 0;
7192
+ const L = X * (2 * Math.PI) / b.length;
7193
+ let O = 0;
7203
7194
  if (U === "listening" || U === "speaking") {
7204
- const G = Math.sin(I * 4.2 + O * 0.6 - I * 2) * 0.15, D = Math.sin(I * 6.8 + O * 1.2 - I * 1.5) * 0.08, ye = Math.sin(I * 0.8) * 0.05;
7205
- F = G + D + ye;
7195
+ const G = Math.sin(I * 4.2 + L * 0.6 - I * 2) * 0.15, D = Math.sin(I * 6.8 + L * 1.2 - I * 1.5) * 0.08, ye = Math.sin(I * 0.8) * 0.05;
7196
+ O = G + D + ye;
7206
7197
  } else if (U === "processing") {
7207
- const G = Math.sin(I * 3 + O * 0.5 - I * 1.5) * 0.12, D = Math.sin(I * 5 + O * 0.8 - I * 1.2) * 0.06, ye = Math.sin(I * 0.6) * 0.04;
7208
- F = G + D + ye;
7198
+ const G = Math.sin(I * 3 + L * 0.5 - I * 1.5) * 0.12, D = Math.sin(I * 5 + L * 0.8 - I * 1.2) * 0.06, ye = Math.sin(I * 0.6) * 0.04;
7199
+ O = G + D + ye;
7209
7200
  } else if (U === "connected") {
7210
- const G = Math.sin(I * 0.6) * 0.1, D = Math.sin(I * 2 + O * 0.3) * 0.05;
7211
- F = G + D;
7201
+ const G = Math.sin(I * 0.6) * 0.1, D = Math.sin(I * 2 + L * 0.3) * 0.05;
7202
+ O = G + D;
7212
7203
  } else {
7213
- const G = Math.sin(I * 1.5 + O) * 0.12, D = Math.sin(I * 0.4) * 0.05;
7214
- F = G + D;
7204
+ const G = Math.sin(I * 1.5 + L) * 0.12, D = Math.sin(I * 0.4) * 0.05;
7205
+ O = G + D;
7215
7206
  }
7216
7207
  const oe = Math.max(0.3, p);
7217
- E[X] = Math.max(0, Math.min(0.9, b[X] + F * oe));
7208
+ E[X] = Math.max(0, Math.min(0.9, b[X] + O * oe));
7218
7209
  }
7219
7210
  return E;
7220
7211
  }
@@ -7258,7 +7249,7 @@ const J = /* @__PURE__ */ s((e) => {
7258
7249
  if (typeof window > "u" || !a || !i.value)
7259
7250
  return;
7260
7251
  Fe();
7261
- const b = i.value, { bars: p, barWidth: U, barSpacing: I, minHeight: E, maxHeight: X } = o.value, O = b.width / te, F = b.height / te;
7252
+ const b = i.value, { bars: p, barWidth: U, barSpacing: I, minHeight: E, maxHeight: X } = o.value, L = b.width / te, O = b.height / te;
7262
7253
  function oe(G) {
7263
7254
  if (!a)
7264
7255
  return;
@@ -7266,7 +7257,7 @@ const J = /* @__PURE__ */ s((e) => {
7266
7257
  l = requestAnimationFrame(oe);
7267
7258
  return;
7268
7259
  }
7269
- a.clearRect(0, 0, O, F);
7260
+ a.clearRect(0, 0, L, O);
7270
7261
  const D = nt(), ye = 0.3;
7271
7262
  for (let S = 0; S < p; S++) {
7272
7263
  const _e = E + D[S] * (X - E);
@@ -7289,14 +7280,14 @@ const J = /* @__PURE__ */ s((e) => {
7289
7280
  const me = H[K.value];
7290
7281
  a.fillStyle = me.glow;
7291
7282
  for (let pe = 0; pe < p; pe++) {
7292
- const Ae = pe * (U + I), Re = h[pe], de = F - Re;
7283
+ const Ae = pe * (U + I), Re = h[pe], de = O - Re;
7293
7284
  a.beginPath(), a.roundRect(Ae - 1, de - 1, U + 2, Re + 2, [2, 2, 0, 0]), a.fill();
7294
7285
  }
7295
7286
  a.restore();
7296
7287
  }
7297
7288
  const Te = H[K.value], [xe, we, ze] = Te.primary;
7298
7289
  for (let S = 0; S < p; S++) {
7299
- const _e = S * (U + I), me = h[S], pe = F - me, Ae = n[S], Re = Math.min(S, p - 1 - S), de = Math.min(1, Re / ue), Je = Math.min(1, me / X), Ye = (0.8 + Je * 0.2) * de, rr = (0.6 + Je * 0.2) * de, or = (0.3 + Je * 0.1) * de, ko = Math.round(Je * 10) / 10, yo = Math.round(de * 10) / 10, xo = `${K.value}-${ko}-${yo}-${me}`, wo = st(xo, () => {
7290
+ const _e = S * (U + I), me = h[S], pe = O - me, Ae = n[S], Re = Math.min(S, p - 1 - S), de = Math.min(1, Re / ue), Je = Math.min(1, me / X), Ye = (0.8 + Je * 0.2) * de, rr = (0.6 + Je * 0.2) * de, or = (0.3 + Je * 0.1) * de, ko = Math.round(Je * 10) / 10, yo = Math.round(de * 10) / 10, xo = `${K.value}-${ko}-${yo}-${me}`, wo = st(xo, () => {
7300
7291
  const se = a.createLinearGradient(0, pe, 0, pe + me);
7301
7292
  if (Ce === "speaking")
7302
7293
  se.addColorStop(0, `rgba(${xe}, ${we}, ${ze}, ${Ye})`), se.addColorStop(0.5, `rgba(${xe}, ${we}, ${ze}, ${rr})`), se.addColorStop(1, `rgba(${xe}, ${we}, ${ze}, ${or})`), (Ae >= 400 && Ae <= 600 || Ae >= 1400 && Ae <= 1600) && se.addColorStop(0, `rgba(74, 222, 128, ${Math.min(1, Ye + 0.2)})`);
@@ -7309,7 +7300,7 @@ const J = /* @__PURE__ */ s((e) => {
7309
7300
  return se;
7310
7301
  });
7311
7302
  if (a.fillStyle = wo, a.beginPath(), a.roundRect(_e, pe, U, me, [1, 1, 0, 0]), a.fill(), C[S] > E + 2) {
7312
- const se = F - C[S], it = z[S] > 0 ? 0.9 : Math.max(0.3, z[S] / Zr);
7303
+ const se = O - C[S], it = z[S] > 0 ? 0.9 : Math.max(0.3, z[S] / Zr);
7313
7304
  a.fillStyle = `rgba(255, 255, 255, ${it})`, a.fillRect(_e, se - 1, U, 2), it > 0.5 && !c.value && (a.shadowColor = Te.glow, a.shadowBlur = 3, a.fillRect(_e, se - 1, U, 2), a.shadowBlur = 0);
7314
7305
  }
7315
7306
  }
@@ -7438,7 +7429,7 @@ const J = /* @__PURE__ */ s((e) => {
7438
7429
  ]),
7439
7430
  f("div", jc, [
7440
7431
  f("div", Lc, [
7441
- e.selfController?.voiceState.value.isListening ? (v(), k("div", Oc)) : e.selfController?.voiceState.value.isSpeaking ? (v(), k("div", Fc)) : e.selfController?.voiceState.value.isConnected && !e.selfController?.voiceState.value.isListening && !e.selfController?.voiceState.value.isSpeaking ? (v(), k("div", Rc)) : e.selfController?.voiceState.value.error ? (v(), k("div", Uc)) : L("", !0)
7432
+ e.selfController?.voiceState.value.isListening ? (v(), k("div", Oc)) : e.selfController?.voiceState.value.isSpeaking ? (v(), k("div", Fc)) : e.selfController?.voiceState.value.isConnected && !e.selfController?.voiceState.value.isListening && !e.selfController?.voiceState.value.isSpeaking ? (v(), k("div", Rc)) : e.selfController?.voiceState.value.error ? (v(), k("div", Uc)) : j("", !0)
7442
7433
  ]),
7443
7434
  f("p", Vc, Y(e.selfController?.voiceState.value.error ? `Error: ${e.selfController.voiceState.value.error}` : e.selfController?.voiceState.value.transcript || "Ready to start a call..."), 1)
7444
7435
  ])
@@ -7593,7 +7584,7 @@ const J = /* @__PURE__ */ s((e) => {
7593
7584
  }, [...z[8] || (z[8] = [
7594
7585
  f("i", { class: "size-6 i-tabler-x" }, null, -1)
7595
7586
  ])])
7596
- ])) : L("", !0)
7587
+ ])) : j("", !0)
7597
7588
  ], 2)
7598
7589
  ], 2),
7599
7590
  c.value === "self" ? (v(), k("div", Kc, [
@@ -7624,7 +7615,7 @@ const J = /* @__PURE__ */ s((e) => {
7624
7615
  class: T([re(Ne)[Z.platform].icon, "size-5"])
7625
7616
  }, null, 2)
7626
7617
  ], 8, Qc))), 128))
7627
- ])) : L("", !0)
7618
+ ])) : j("", !0)
7628
7619
  ])
7629
7620
  ])) : c.value === "talk" ? (v(), k("div", Xc, [
7630
7621
  g.value ? (v(), k(Ee, { key: 1 }, [
@@ -7652,7 +7643,7 @@ const J = /* @__PURE__ */ s((e) => {
7652
7643
  ], 64)) : c.value === "info" ? (v(), ve(Wl, {
7653
7644
  key: 1,
7654
7645
  self: e.self
7655
- }, null, 8, ["self"])) : L("", !0)
7646
+ }, null, 8, ["self"])) : j("", !0)
7656
7647
  ])
7657
7648
  ])),
7658
7649
  f("div", {
@@ -7798,7 +7789,7 @@ const J = /* @__PURE__ */ s((e) => {
7798
7789
  context: e.context,
7799
7790
  firstMessage: e.firstMessage,
7800
7791
  loading: n.value
7801
- }) : L("", !0)
7792
+ }) : j("", !0)
7802
7793
  ]));
7803
7794
  }
7804
7795
  });
@@ -7822,4 +7813,4 @@ export {
7822
7813
  vu as l,
7823
7814
  ja as p
7824
7815
  };
7825
- //# sourceMappingURL=SelfWrap.vue_vue_type_script_setup_true_lang-Y1yR8Chp.js.map
7816
+ //# sourceMappingURL=SelfWrap.vue_vue_type_script_setup_true_lang-CIyP7f4f.js.map