@8wave/ai-elements 0.121.0-beta.47 → 0.121.0-beta.48

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.
@@ -160,14 +160,14 @@ var ge = {
160
160
  key: 0,
161
161
  class: "pk-voice-session__badge",
162
162
  "aria-hidden": "true"
163
- }, z = {
163
+ }, Se = {
164
164
  class: "pk-voice-session__status",
165
165
  role: "status"
166
- }, B = {
166
+ }, z = {
167
167
  key: 0,
168
168
  class: "pk-voice-session__live-dot",
169
169
  "aria-hidden": "true"
170
- }, Se = ["title"], Ce = ["title"], we = { class: "pk-voice-session__actions" }, Te = /* @__PURE__ */ E({
170
+ }, Ce = ["title"], we = ["title"], Te = { class: "pk-voice-session__actions" }, Ee = /* @__PURE__ */ E({
171
171
  __name: "PkVoiceSession",
172
172
  props: {
173
173
  state: {},
@@ -206,18 +206,18 @@ var ge = {
206
206
  "sample",
207
207
  "spectrum"
208
208
  ])),
209
- C("div", z, [C("span", { class: D(["pk-voice-session__state", l.value && `pk-voice-session__state--${l.value}`]) }, [c.value ? (k(), S("span", B)) : x("", !0), te(" " + j(a.value), 1)], 2), e.error ? (k(), S("p", {
209
+ C("div", Se, [C("span", { class: D(["pk-voice-session__state", l.value && `pk-voice-session__state--${l.value}`]) }, [c.value ? (k(), S("span", z)) : x("", !0), te(" " + j(a.value), 1)], 2), e.error ? (k(), S("p", {
210
210
  key: 0,
211
211
  class: "pk-voice-session__detail",
212
212
  title: e.rawError ?? e.error
213
- }, j(e.error), 9, Se)) : x("", !0)]),
213
+ }, j(e.error), 9, Ce)) : x("", !0)]),
214
214
  o.value ? (k(), S("span", {
215
215
  key: 2,
216
216
  class: D(["pk-voice-session__timer", { "pk-voice-session__timer--warning": s.value }]),
217
217
  title: M(i)("hint.voiceRemaining"),
218
218
  "aria-hidden": "true"
219
- }, j(o.value), 11, Ce)) : x("", !0),
220
- C("div", we, [e.error ? (k(), S(_, { key: 0 }, [w(d, {
219
+ }, j(o.value), 11, we)) : x("", !0),
220
+ C("div", Te, [e.error ? (k(), S(_, { key: 0 }, [w(d, {
221
221
  icon: "ri:refresh-line",
222
222
  label: M(i)("action.retry"),
223
223
  onClick: n[0] ||= (e) => r("retry")
@@ -254,7 +254,7 @@ var ge = {
254
254
  ], 2);
255
255
  };
256
256
  }
257
- }), Ee = (e) => {
257
+ }), De = (e) => {
258
258
  let t = le(), n = A("disconnected"), r = A("listening"), i = A(), o = A([]), s = A(), c = A(), l, u, d = 0, f = !1, p = () => {
259
259
  u &&= (clearInterval(u), void 0), s.value = void 0;
260
260
  }, m = (e) => {
@@ -378,12 +378,12 @@ var ge = {
378
378
  readLevel: S,
379
379
  readSpectrum: C
380
380
  };
381
- }, De = 4e3, Oe = [
381
+ }, Oe = 4e3, ke = [
382
382
  3e3,
383
383
  5e3,
384
384
  1e4
385
- ], ke = 12e4, Ae = 3e4;
386
- function je(e) {
385
+ ], Ae = 12e4, je = 3e4;
386
+ function Me(e) {
387
387
  let t = A(null), n = A(!1), r, i = !1, a = () => {
388
388
  clearTimeout(r), r = void 0;
389
389
  }, o = (e, t) => {
@@ -401,12 +401,12 @@ function je(e) {
401
401
  }
402
402
  let r = t.value;
403
403
  if (r) {
404
- let e = Date.parse(r.dueAt) - Date.now() + De;
405
- o(Math.max(De, e), () => l(r.wakeId, Date.now(), 0));
404
+ let e = Date.parse(r.dueAt) - Date.now() + Oe;
405
+ o(Math.max(Oe, e), () => l(r.wakeId, Date.now(), 0));
406
406
  }
407
407
  }
408
408
  async function l(t, n, r) {
409
- await e.refreshMessages(), !i && (s(t) || Date.now() - n >= ke ? await c() : o(Oe[Math.min(r, Oe.length - 1)], () => l(t, n, r + 1)));
409
+ await e.refreshMessages(), !i && (s(t) || Date.now() - n >= Ae ? await c() : o(ke[Math.min(r, ke.length - 1)], () => l(t, n, r + 1)));
410
410
  }
411
411
  async function u() {
412
412
  n.value = !0;
@@ -420,15 +420,23 @@ function je(e) {
420
420
  function d() {
421
421
  a(), t.value = null;
422
422
  }
423
- let f;
424
- function p() {
423
+ let f = y(() => e.messages().some((e) => e.role === "user"));
424
+ N([e.chatId, f], ([, t]) => {
425
+ d();
426
+ let n = e.status();
427
+ t && n !== "submitted" && n !== "streaming" && c();
428
+ }, { immediate: !0 }), N(e.status, (e, t) => {
429
+ e === "ready" && t !== "ready" && f.value && c();
430
+ });
431
+ let p;
432
+ function m() {
425
433
  t.value && document.visibilityState === "visible" && e.apiClient().markChatWakeupPresence(e.agentId(), e.chatId()).catch(() => void 0);
426
434
  }
427
- let m = () => p();
428
- return document.addEventListener("visibilitychange", m), N(() => t.value?.wakeId, (e) => {
429
- clearInterval(f), f = void 0, e && !i && (p(), f = setInterval(p, Ae));
435
+ let h = () => m();
436
+ return document.addEventListener("visibilitychange", h), N(() => t.value?.wakeId, (e) => {
437
+ clearInterval(p), p = void 0, e && !i && (m(), p = setInterval(m, je));
430
438
  }), O(() => {
431
- i = !0, a(), clearInterval(f), document.removeEventListener("visibilitychange", m);
439
+ i = !0, a(), clearInterval(p), document.removeEventListener("visibilitychange", h);
432
440
  }), {
433
441
  pendingWakeup: t,
434
442
  isStopping: n,
@@ -439,16 +447,16 @@ function je(e) {
439
447
  }
440
448
  //#endregion
441
449
  //#region ../../packages/components/src/chat/PkChatbotViewChat.vue?vue&type=script&setup=true&lang.ts
442
- var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
450
+ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
443
451
  key: 1,
444
452
  class: "p-md border-t border-surface-3 text-center text-12 text-danger bg-surface-danger"
445
- }, Pe = { class: "pk-chatbot-view-chat__agent-chip" }, Fe = {
453
+ }, Fe = { class: "pk-chatbot-view-chat__agent-chip" }, Ie = {
446
454
  key: 0,
447
455
  class: "pk-chatbot-view-chat__agent-chip-name"
448
- }, Ie = {
456
+ }, Le = {
449
457
  key: 0,
450
458
  class: "pk-chatbot-view-chat__drop-overlay"
451
- }, Le = 3e3, Re = 6e4, ze = 3e5, Be = 6e5, Ve = /* @__PURE__ */ E({
459
+ }, Re = 3e3, ze = 6e4, Be = 3e5, Ve = 6e5, He = /* @__PURE__ */ E({
452
460
  __name: "PkChatbotViewChat",
453
461
  props: {
454
462
  agentId: {},
@@ -457,121 +465,121 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
457
465
  },
458
466
  emits: ["show-info", "revise"],
459
467
  setup(a, { emit: d }) {
460
- let _ = T(() => import("./PkToolShowForm-LR8mW4SY.js").then((e) => e.n)), te = T(() => import("./PkToolShowContactForm-DKkapC2s.js").then((e) => e.n)), E = T(() => import("./PkToolShowSuggestedReply-Dw-yePEO.js").then((e) => e.n)), re = T(() => import("./PkToolShowSources-DeplEks2.js").then((e) => e.n)), ie = T(() => import("./PkToolRequestGeolocation-jkEuN6_1.js")), ae = T(() => import("./PkToolRequestOAuthConnection-BTNd8Urz.js")), oe = T(() => import("./PkToolShowLocation-BipZrvw7.js").then((e) => e.n)), ce = T(() => import("./PkToolShowDiagram-BI-fI2vG.js")), le = T(() => import("./PkToolEditedFile-DsiNIHAR.js")), ue = T(() => import("./PkToolShareDocument-C8sPmh0k.js").then((e) => e.n)), F = a, ge = d, I = r(F.agentId), { agentInterface: L, agentFileUpload: _e, agentType: R, agentVoice: ye, actions: be, revisedAnswers: xe, messages: z, chat: B, messageFeedbacks: Se, feedbackDialogMessage: Ce, isFeedbackSubmitting: we, isFeedbackSubmitted: De, feedbackSubmitError: Oe, isLeadSubmitted: ke, isLoadingSubmitLead: Ae, submitLeadError: Ve, input: He, inputMessagePlaceholder: Ue, isConversationBlocked: We, baseUrl: Ge, pendingAttachments: Ke, isAttachmentLimitReached: qe, fileLimitError: Je, apiClient: V, isDark: Ye, hostToolsPending: Xe, pageNoticeLevel: Ze, hostConfirmation: Qe, agentPageAccess: $e, hostStepTitles: et, canQueue: tt, queuedMessages: nt, backgroundAnswers: rt } = me(I);
461
- se(c, et);
462
- let H = y(() => R.value === "reasoning" ? void 0 : _e.value), it = (e) => V.value.getMediaDownloadUrl(F.agentId, I.localChatId, e), { handleSubmit: at, stopGeneration: ot, regenerate: st, onUpvote: ct, onDownvote: lt, onFeedback: ut, onFeedbackSubmit: dt, onLeadSubmit: ft, startNewChat: pt, addToolOutput: U, addToolApprovalResponse: mt, handleFileSelect: ht, clearFileLimitError: gt, refreshMessages: _t, appendMessage: vt, closePageNotice: yt, respondHostConfirmation: bt, editQueuedMessage: xt, removeQueuedMessage: St, openBackgroundAnswer: Ct, dismissBackgroundAnswer: wt } = I, { t: W } = fe({ useScope: "global" }), Tt = y(() => Xe.value > 0), Et = y(() => Tt.value && B.value.status === "ready" ? "streaming" : B.value.status), Dt = l(() => $e.value?.notice), Ot = y(() => Ze.value ? Dt.value || W(`message.pageAccessNotice.${Ze.value}`) : void 0), kt = y(() => {
463
- let e = Je.value;
464
- if (e) return e.reason === "per-chat" ? W("message.fileLimitPerChat", { max: e.max }) : W("message.fileLimitPerMessage", { max: e.max });
465
- }), At = y(() => rt.value.map(({ chatId: e, title: t }) => ({
468
+ let _ = T(() => import("./PkToolShowForm-LR8mW4SY.js").then((e) => e.n)), te = T(() => import("./PkToolShowContactForm-DKkapC2s.js").then((e) => e.n)), E = T(() => import("./PkToolShowSuggestedReply-Dw-yePEO.js").then((e) => e.n)), re = T(() => import("./PkToolShowSources-DeplEks2.js").then((e) => e.n)), ie = T(() => import("./PkToolRequestGeolocation-jkEuN6_1.js")), ae = T(() => import("./PkToolRequestOAuthConnection-BTNd8Urz.js")), oe = T(() => import("./PkToolShowLocation-BipZrvw7.js").then((e) => e.n)), ce = T(() => import("./PkToolShowDiagram-BI-fI2vG.js")), le = T(() => import("./PkToolEditedFile-DsiNIHAR.js")), ue = T(() => import("./PkToolShareDocument-C8sPmh0k.js").then((e) => e.n)), F = a, ge = d, I = r(F.agentId), { agentInterface: L, agentFileUpload: _e, agentType: R, agentVoice: ye, actions: be, revisedAnswers: xe, messages: Se, chat: z, messageFeedbacks: Ce, feedbackDialogMessage: we, isFeedbackSubmitting: Te, isFeedbackSubmitted: Oe, feedbackSubmitError: ke, isLeadSubmitted: Ae, isLoadingSubmitLead: je, submitLeadError: He, input: Ue, inputMessagePlaceholder: We, isConversationBlocked: Ge, baseUrl: Ke, pendingAttachments: qe, isAttachmentLimitReached: Je, fileLimitError: Ye, apiClient: B, isDark: Xe, hostToolsPending: Ze, pageNoticeLevel: Qe, hostConfirmation: $e, agentPageAccess: et, hostStepTitles: tt, canQueue: nt, queuedMessages: rt, backgroundAnswers: it } = me(I);
469
+ se(c, tt);
470
+ let V = y(() => R.value === "reasoning" ? void 0 : _e.value), at = (e) => B.value.getMediaDownloadUrl(F.agentId, I.localChatId, e), { handleSubmit: ot, stopGeneration: st, regenerate: ct, onUpvote: lt, onDownvote: ut, onFeedback: dt, onFeedbackSubmit: ft, onLeadSubmit: pt, startNewChat: mt, addToolOutput: H, addToolApprovalResponse: ht, handleFileSelect: gt, clearFileLimitError: _t, refreshMessages: vt, appendMessage: yt, closePageNotice: bt, respondHostConfirmation: xt, editQueuedMessage: St, removeQueuedMessage: Ct, openBackgroundAnswer: wt, dismissBackgroundAnswer: Tt } = I, { t: U } = fe({ useScope: "global" }), Et = y(() => Ze.value > 0), Dt = y(() => Et.value && z.value.status === "ready" ? "streaming" : z.value.status), Ot = l(() => et.value?.notice), kt = y(() => Qe.value ? Ot.value || U(`message.pageAccessNotice.${Qe.value}`) : void 0), At = y(() => {
471
+ let e = Ye.value;
472
+ if (e) return e.reason === "per-chat" ? U("message.fileLimitPerChat", { max: e.max }) : U("message.fileLimitPerMessage", { max: e.max });
473
+ }), jt = y(() => it.value.map(({ chatId: e, title: t }) => ({
466
474
  id: e,
467
- text: t ? W("message.backgroundAnswerReady", { title: t }) : W("message.backgroundAnswerReadyUntitled")
468
- }))), jt = l(() => L.value?.dismissableNotice), Mt = y(() => z.value.some((e) => e.role === "user")), Nt = y(() => F.modifier === "fullscreen" && !Mt.value), Pt = he(L, () => F.userName), Ft = de("chatViewEl"), It = async (e) => (await V.value.expandSourceContext(F.agentId, e.documentId, e.chunkIndex)).content, Lt = async (e) => {
469
- let t = await V.value.downloadSourceDocument(F.agentId, e);
475
+ text: t ? U("message.backgroundAnswerReady", { title: t }) : U("message.backgroundAnswerReadyUntitled")
476
+ }))), Mt = l(() => L.value?.dismissableNotice), Nt = y(() => Se.value.some((e) => e.role === "user")), Pt = y(() => F.modifier === "fullscreen" && !Nt.value), Ft = he(L, () => F.userName), It = de("chatViewEl"), Lt = async (e) => (await B.value.expandSourceContext(F.agentId, e.documentId, e.chunkIndex)).content, Rt = async (e) => {
477
+ let t = await B.value.downloadSourceDocument(F.agentId, e);
470
478
  window.open(t.downloadUrl, "_blank");
471
- }, { isOverDropZone: Rt } = pe(Ft, {
472
- dataTypes: (e) => t(e, H.value?.allowedMimeTypes ?? []),
479
+ }, { isOverDropZone: zt } = pe(It, {
480
+ dataTypes: (e) => t(e, V.value?.allowedMimeTypes ?? []),
473
481
  onDrop: (e) => {
474
- if (H.value?.enabled && e) for (let t of e) ht(t);
482
+ if (V.value?.enabled && e) for (let t of e) gt(t);
475
483
  }
476
- }), G = A(!1), K = !1, q = A(!1), zt = [
484
+ }), W = A(!1), G = !1, K = A(!1), Bt = [
477
485
  3e3,
478
486
  5e3,
479
487
  1e4
480
- ], Bt, J, Vt = !1, Y = 0, Ht = !1;
481
- function Ut() {
482
- clearTimeout(Bt), Bt = void 0, J = void 0, Vt = !1, Y = 0, q.value = !1;
488
+ ], q, J, Y = !1, X = 0, Vt = !1;
489
+ function Ht() {
490
+ clearTimeout(q), q = void 0, J = void 0, Y = !1, X = 0, K.value = !1;
483
491
  }
484
- function X(e) {
485
- K || (clearTimeout(Bt), Bt = setTimeout(() => {
492
+ function Ut(e) {
493
+ G || (clearTimeout(q), q = setTimeout(() => {
486
494
  Wt();
487
495
  }, e));
488
496
  }
489
497
  async function Wt() {
490
- if (K || Ht) return;
491
- Ht = !0;
498
+ if (G || Vt) return;
499
+ Vt = !0;
492
500
  let e;
493
501
  try {
494
- e = await _t();
502
+ e = await vt();
495
503
  } finally {
496
- Ht = !1;
504
+ Vt = !1;
497
505
  }
498
- if (K) return;
499
- if (e === "caught-up" && (q.value = !1), Z.isActive.value) {
500
- J = void 0, Vt = !1, Y = 0, X(Le);
506
+ if (G) return;
507
+ if (e === "caught-up" && (K.value = !1), Z.isActive.value) {
508
+ J = void 0, Y = !1, X = 0, Ut(Re);
501
509
  return;
502
510
  }
503
- J === void 0 && (J = Date.now(), Vt = !!Z.error.value);
511
+ J === void 0 && (J = Date.now(), Y = !!Z.error.value);
504
512
  let t = Date.now() - J;
505
- if (e === "caught-up" && t >= (Vt ? ze : Re) || t >= Be) {
506
- Ut();
513
+ if (e === "caught-up" && t >= (Y ? Be : ze) || t >= Ve) {
514
+ Ht();
507
515
  return;
508
516
  }
509
- let n = zt[Math.min(Y, zt.length - 1)];
510
- Y += 1, X(n);
517
+ let n = Bt[Math.min(X, Bt.length - 1)];
518
+ X += 1, Ut(n);
511
519
  }
512
520
  let Gt = (e = 1200) => {
513
- X(e);
514
- }, Z = Ee({
521
+ Ut(e);
522
+ }, Z = De({
515
523
  fetchGrant: async () => {
516
- let e = await V.value.createVoiceSession(F.agentId, I.localChatId, {
524
+ let e = await B.value.createVoiceSession(F.agentId, I.localChatId, {
517
525
  deviceContext: I.buildDeviceContext(),
518
526
  externalContext: I.externalContext
519
527
  });
520
528
  return e.chatId !== I.localChatId && (I.localChatId = e.chatId), e;
521
529
  },
522
- closeGrant: (e) => V.value.closeVoiceSession(F.agentId, e),
530
+ closeGrant: (e) => B.value.closeVoiceSession(F.agentId, e),
523
531
  onTranscript: (e) => {
524
- e.role === "user" ? (q.value = !0, vt({
532
+ e.role === "user" ? (K.value = !0, yt({
525
533
  id: `${i}user-${n()}`,
526
534
  role: "user",
527
535
  parts: [{
528
536
  type: "text",
529
537
  text: e.text
530
538
  }]
531
- })) : q.value = !1;
539
+ })) : K.value = !1;
532
540
  },
533
541
  onTurnEnd: () => {
534
542
  Gt();
535
543
  }
536
544
  });
537
545
  N(() => Z.error.value, (e) => {
538
- e && (q.value = !1);
546
+ e && (K.value = !1);
539
547
  });
540
548
  let Kt = y(() => ye.value?.enabled === !0), qt = y(() => Z.error.value ? "error" : Z.isConnecting.value ? "connecting" : Z.isSpeaking.value ? "speaking" : Z.isActive.value ? "listening" : "idle"), Jt = y(() => {
541
549
  let e = Z.error.value;
542
- if (e) return /took too long/i.test(e) ? W("message.voiceTookTooLong") : /cascade|no response|custom_llm_error/i.test(e) ? W("message.voiceNoAnswer") : W("message.voiceInterrupted");
550
+ if (e) return /took too long/i.test(e) ? U("message.voiceTookTooLong") : /cascade|no response|custom_llm_error/i.test(e) ? U("message.voiceNoAnswer") : U("message.voiceInterrupted");
543
551
  }), Yt = y(() => Z.isSpeaking.value ? "output" : "input"), Xt = () => Z.readLevel(Yt.value), Zt = () => Z.readSpectrum(Yt.value), Qt = async () => {
544
- G.value = !1, await Z.start(), Z.isActive.value && (Ut(), X(Le));
552
+ W.value = !1, await Z.start(), Z.isActive.value && (Ht(), Ut(Re));
545
553
  }, $t = async () => {
546
- q.value = !1, await Z.stop(), !K && Gt(0);
554
+ K.value = !1, await Z.stop(), !G && Gt(0);
547
555
  }, en = () => {
548
556
  Z.dismissError();
549
557
  }, tn = async () => {
550
558
  Z.dismissError(), await Z.stop(), await Qt();
551
559
  }, Q = (e) => e?.toolCallId ?? "", nn = A(/* @__PURE__ */ new Set()), rn = (e) => nn.value.has(Q(e)), an = A(/* @__PURE__ */ new Map()), $ = (e, t) => Z.isActive.value ? (Z.sendUserMessage(t) && (nn.value = new Set(nn.value).add(Q(e)), Gt()), !0) : !1, on = (e, t, n) => {
552
- $(t, o(t, n)) || U({
560
+ $(t, o(t, n)) || H({
553
561
  tool: e,
554
562
  toolCallId: Q(t),
555
563
  output: n
556
564
  });
557
565
  }, sn = (e) => {
558
- let t = e.confirmed ? W("message.voiceConfirmed") : W("message.voiceCancelled");
559
- $({ toolCallId: e.toolCallId }, t) ? nn.value.has(e.toolCallId) && (an.value = new Map(an.value).set(e.toolCallId, e.confirmed)) : U({
566
+ let t = e.confirmed ? U("message.voiceConfirmed") : U("message.voiceCancelled");
567
+ $({ toolCallId: e.toolCallId }, t) ? nn.value.has(e.toolCallId) && (an.value = new Map(an.value).set(e.toolCallId, e.confirmed)) : H({
560
568
  tool: "requestConfirm",
561
569
  toolCallId: e.toolCallId,
562
570
  output: e.confirmed ? "confirmed" : "cancelled"
563
571
  });
564
572
  }, cn = (e, t) => {
565
- $(e, t) || (He.value = t, at());
573
+ $(e, t) || (Ue.value = t, ot());
566
574
  }, ln = (e, t) => {
567
- let n = t.error ? W("message.voiceLocationRefused") : W("message.voiceLocationShared", { place: t.displayName ?? `${t.latitude}, ${t.longitude}` });
568
- $(e, n) || U({
575
+ let n = t.error ? U("message.voiceLocationRefused") : U("message.voiceLocationShared", { place: t.displayName ?? `${t.latitude}, ${t.longitude}` });
576
+ $(e, n) || H({
569
577
  tool: "requestGeolocation",
570
578
  toolCallId: Q(e),
571
579
  output: t
572
580
  });
573
581
  }, un = (e, t) => {
574
- $(e, W("message.voiceConnectionDone")) || U({
582
+ $(e, U("message.voiceConnectionDone")) || H({
575
583
  tool: "requestOAuthConnection",
576
584
  toolCallId: Q(e),
577
585
  output: {
@@ -580,39 +588,36 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
580
588
  }
581
589
  });
582
590
  }, dn = () => {
583
- G.value = !G.value, Z.setMuted(G.value);
591
+ W.value = !W.value, Z.setMuted(W.value);
584
592
  };
585
593
  O(() => {
586
- K = !0, Ut();
594
+ G = !0, Ht();
587
595
  });
588
- let { pendingWakeup: fn, isStopping: pn, check: mn, reset: hn, stop: gn } = je({
596
+ let { pendingWakeup: fn, isStopping: pn, stop: mn } = Me({
589
597
  agentId: () => F.agentId,
590
598
  chatId: () => I.localChatId,
591
- apiClient: () => V.value,
592
- messages: () => z.value,
593
- refreshMessages: _t
599
+ apiClient: () => B.value,
600
+ messages: () => Se.value,
601
+ refreshMessages: vt,
602
+ status: () => z.value.status
594
603
  });
595
- return N([() => I.localChatId, Mt], ([, e]) => {
596
- hn(), e && mn();
597
- }, { immediate: !0 }), N(() => B.value.status, (e, t) => {
598
- e === "ready" && t !== "ready" && Mt.value && mn();
599
- }), (t, n) => {
604
+ return (t, n) => {
600
605
  let r = g;
601
606
  return k(), S("div", {
602
607
  ref_key: "chatViewEl",
603
- ref: Ft,
608
+ ref: It,
604
609
  class: D(["pk-chatbot-view-chat", {
605
- "pk-chatbot-view-chat--dragover": M(Rt) && H.value?.enabled,
606
- "pk-chatbot-view-chat--empty": Nt.value
610
+ "pk-chatbot-view-chat--dragover": M(zt) && V.value?.enabled,
611
+ "pk-chatbot-view-chat--empty": Pt.value
607
612
  }])
608
613
  }, [
609
614
  w(v, {
610
615
  name: "pk-chatbot-view-chat-fade",
611
616
  mode: "out-in"
612
617
  }, {
613
- default: P(() => [Nt.value ? (k(), b(m, {
618
+ default: P(() => [Pt.value ? (k(), b(m, {
614
619
  key: 0,
615
- greeting: M(Pt),
620
+ greeting: M(Ft),
616
621
  logo: M(L)?.logo,
617
622
  name: M(I).name
618
623
  }, null, 8, [
@@ -623,47 +628,47 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
623
628
  key: 1,
624
629
  class: "flex flex-col flex-1 min-h-0 p-md overflow-y-auto",
625
630
  interactive: "",
626
- messages: M(z),
631
+ messages: M(Se),
627
632
  "confirm-verdicts-on-call": an.value,
628
- status: M(B).status,
629
- error: M(B).error,
633
+ status: M(z).status,
634
+ error: M(z).error,
630
635
  "main-color": M(L)?.mainColor,
631
636
  "text-color": M(L)?.textColor,
632
637
  "revised-answers": M(xe),
633
638
  actions: M(be),
634
- "message-feedbacks": M(Se),
635
- "feedback-message-id": M(Ce)?.id,
636
- "feedback-loading": M(we),
637
- "feedback-submitted": M(De),
638
- "feedback-error": M(Oe),
639
+ "message-feedbacks": M(Ce),
640
+ "feedback-message-id": M(we)?.id,
641
+ "feedback-loading": M(Te),
642
+ "feedback-submitted": M(Oe),
643
+ "feedback-error": M(ke),
639
644
  "show-extended-steps": M(L)?.showExtendedSteps,
640
- "awaiting-spoken-answer": q.value,
641
- "host-working": Tt.value,
642
- "host-confirmation": M(Qe),
643
- "is-dark": M(Ye),
645
+ "awaiting-spoken-answer": K.value,
646
+ "host-working": Et.value,
647
+ "host-confirmation": M($e),
648
+ "is-dark": M(Xe),
644
649
  "show-scroll-to-bottom": a.modifier === "fullscreen",
645
- onFeedbackSubmit: n[0] ||= (e) => M(dt)(e),
646
- onFeedbackClose: n[1] ||= (e) => Ce.value = void 0,
647
- onRegenerate: M(st),
648
- onAutoRetry: M(st),
649
- onResetChat: M(pt),
650
+ onFeedbackSubmit: n[0] ||= (e) => M(ft)(e),
651
+ onFeedbackClose: n[1] ||= (e) => we.value = void 0,
652
+ onRegenerate: M(ct),
653
+ onAutoRetry: M(ct),
654
+ onResetChat: M(mt),
650
655
  onShowInfo: n[2] ||= (e) => ge("show-info", e),
651
656
  onRevise: n[3] ||= (e) => ge("revise", e),
652
- onUpvote: M(ct),
653
- onDownvote: M(lt),
654
- onFeedback: M(ut),
655
- onApprovalRespond: M(mt),
657
+ onUpvote: M(lt),
658
+ onDownvote: M(ut),
659
+ onFeedback: M(dt),
660
+ onApprovalRespond: M(ht),
656
661
  onConfirmRespond: sn,
657
- onHostConfirmRespond: M(bt)
662
+ onHostConfirmRespond: M(xt)
658
663
  }, {
659
664
  "tool-showContactForm": P(({ part: e }) => [w(M(te), {
660
665
  part: e,
661
- readonly: !M(Ge),
662
- submitted: M(ke),
663
- loading: M(Ae),
664
- error: M(Ve),
666
+ readonly: !M(Ke),
667
+ submitted: M(Ae),
668
+ loading: M(je),
669
+ error: M(He),
665
670
  "privacy-policy-notice": M(L)?.privacyPolicyNotice,
666
- onSubmit: M(ft)
671
+ onSubmit: M(pt)
667
672
  }, null, 8, [
668
673
  "part",
669
674
  "readonly",
@@ -679,8 +684,8 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
679
684
  }, null, 8, ["part", "onSelect"])]),
680
685
  "tool-showSources": P(({ part: e }) => [w(M(re), {
681
686
  part: e,
682
- "on-expand-context": It,
683
- "on-download": Lt
687
+ "on-expand-context": Lt,
688
+ "on-download": Rt
684
689
  }, null, 8, ["part"])]),
685
690
  "tool-showForm": P(({ part: e }) => [w(v, { mode: "out-in" }, {
686
691
  default: P(() => [w(M(_), {
@@ -709,9 +714,9 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
709
714
  }, 1024)]),
710
715
  "tool-requestOAuthConnection": P(({ part: e }) => [w(M(ae), {
711
716
  part: e,
712
- "backend-url": M(Ge),
713
- "resolve-connection": (e) => M(V).getOAuthAuthorizeUrl(F.agentId, e),
714
- "check-connection": (e) => M(V).getOAuthConnectionStatus(F.agentId, e),
717
+ "backend-url": M(Ke),
718
+ "resolve-connection": (e) => M(B).getOAuthAuthorizeUrl(F.agentId, e),
719
+ "check-connection": (e) => M(B).getOAuthConnectionStatus(F.agentId, e),
715
720
  onConnected: (t) => un(e, t)
716
721
  }, null, 8, [
717
722
  "part",
@@ -723,7 +728,7 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
723
728
  "tool-requestGeolocation": P(({ part: e }) => [w(M(ie), {
724
729
  part: e,
725
730
  "call-live": M(Z).isActive.value,
726
- "reverse-geocode": (e, t) => M(V).reverseGeocode(e, t),
731
+ "reverse-geocode": (e, t) => M(B).reverseGeocode(e, t),
727
732
  onResult: (t) => ln(e, t)
728
733
  }, null, 8, [
729
734
  "part",
@@ -733,9 +738,9 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
733
738
  ])]),
734
739
  "tool-showLocation": P(({ part: e }) => [w(M(oe), {
735
740
  part: e,
736
- "is-dark": M(Ye),
741
+ "is-dark": M(Xe),
737
742
  "main-color": M(L)?.mainColor,
738
- "forward-geocode": (e, t) => M(V).forwardGeocode(e, t)
743
+ "forward-geocode": (e, t) => M(B).forwardGeocode(e, t)
739
744
  }, null, 8, [
740
745
  "part",
741
746
  "is-dark",
@@ -744,89 +749,89 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
744
749
  ])]),
745
750
  "tool-showDiagram": P(({ part: e }) => [w(M(ce), {
746
751
  part: e,
747
- "is-dark": M(Ye)
752
+ "is-dark": M(Xe)
748
753
  }, null, 8, ["part", "is-dark"])]),
749
754
  "tool-editSpreadsheet": P(({ part: e }) => [(k(), b(M(le), {
750
755
  key: M(s)(e),
751
756
  part: e,
752
- "file-url": it
757
+ "file-url": at
753
758
  }, null, 8, ["part"]))]),
754
759
  "tool-editWordDocument": P(({ part: e }) => [(k(), b(M(le), {
755
760
  key: M(s)(e),
756
761
  part: e,
757
- "file-url": it
762
+ "file-url": at
758
763
  }, null, 8, ["part"]))]),
759
764
  "tool-shareDocument": P(({ part: e }) => [(k(), b(M(ue), {
760
765
  key: M(s)(e),
761
766
  part: e,
762
- "on-download": Lt
767
+ "on-download": Rt
763
768
  }, null, 8, ["part"]))]),
764
769
  _: 1
765
770
  }, 8, /* @__PURE__ */ "messages.confirm-verdicts-on-call.status.error.main-color.text-color.revised-answers.actions.message-feedbacks.feedback-message-id.feedback-loading.feedback-submitted.feedback-error.show-extended-steps.awaiting-spoken-answer.host-working.host-confirmation.is-dark.show-scroll-to-bottom.onRegenerate.onAutoRetry.onResetChat.onUpvote.onDownvote.onFeedback.onApprovalRespond.onHostConfirmRespond".split(".")))]),
766
771
  _: 1
767
772
  }),
768
- M(nt).length ? (k(), b(p, {
773
+ M(rt).length ? (k(), b(p, {
769
774
  key: 0,
770
- messages: M(nt),
771
- onEdit: M(xt),
772
- onRemove: M(St)
775
+ messages: M(rt),
776
+ onEdit: M(St),
777
+ onRemove: M(Ct)
773
778
  }, null, 8, [
774
779
  "messages",
775
780
  "onEdit",
776
781
  "onRemove"
777
782
  ])) : x("", !0),
778
- C("div", Me, [
783
+ C("div", Ne, [
779
784
  w(v, { name: "pk-chatbot-view-chat-fade" }, {
780
- default: P(() => [Nt.value ? (k(), b(ve, {
785
+ default: P(() => [Pt.value ? (k(), b(ve, {
781
786
  key: 0,
782
787
  class: "pk-chatbot-view-chat__aurora",
783
788
  "source-selector": ".pk-chatbot-input__form"
784
789
  })) : x("", !0)]),
785
790
  _: 1
786
791
  }),
787
- M(fn) && !M(We) ? (k(), b(h, {
792
+ M(fn) && !M(Ge) ? (k(), b(h, {
788
793
  key: 0,
789
794
  pending: M(fn),
790
795
  stopping: M(pn),
791
- onStop: M(gn)
796
+ onStop: M(mn)
792
797
  }, null, 8, [
793
798
  "pending",
794
799
  "stopping",
795
800
  "onStop"
796
801
  ])) : x("", !0),
797
- M(We) ? (k(), S("div", Ne, j(M(W)("message.chatErrorConversationBlocked")), 1)) : qt.value === "idle" ? (k(), b(f, {
802
+ M(Ge) ? (k(), S("div", Pe, j(M(U)("message.chatErrorConversationBlocked")), 1)) : qt.value === "idle" ? (k(), b(f, {
798
803
  key: 3,
799
- modelValue: M(He),
800
- "onUpdate:modelValue": n[4] ||= (e) => ne(He) ? He.value = e : null,
801
- "pending-attachments": M(Ke),
802
- "onUpdate:pendingAttachments": n[5] ||= (e) => ne(Ke) ? Ke.value = e : null,
803
- placeholder: M(Ue),
804
- "dismissable-notice": M(jt) && M(B).messages.length <= 1 ? M(jt) : void 0,
805
- "page-notice": Ot.value,
806
- status: Et.value,
804
+ modelValue: M(Ue),
805
+ "onUpdate:modelValue": n[4] ||= (e) => ne(Ue) ? Ue.value = e : null,
806
+ "pending-attachments": M(qe),
807
+ "onUpdate:pendingAttachments": n[5] ||= (e) => ne(qe) ? qe.value = e : null,
808
+ placeholder: M(We),
809
+ "dismissable-notice": M(Mt) && M(z).messages.length <= 1 ? M(Mt) : void 0,
810
+ "page-notice": kt.value,
811
+ status: Dt.value,
807
812
  "max-message-length": M(L)?.maxMessageLength,
808
- "file-upload": H.value,
809
- "attachment-limit-reached": M(qe),
810
- "attachment-notice": kt.value,
813
+ "file-upload": V.value,
814
+ "attachment-limit-reached": M(Je),
815
+ "attachment-notice": At.value,
811
816
  "voice-enabled": Kt.value,
812
- "queue-enabled": M(tt),
813
- "answer-notices": At.value,
814
- onStopGeneration: M(ot),
815
- onSubmit: M(at),
816
- onFileSelect: M(ht),
817
- onDismissAttachmentNotice: M(gt),
818
- onDismissPageNotice: M(yt),
819
- onOpenAnswerNotice: M(Ct),
820
- onDismissAnswerNotice: M(wt),
817
+ "queue-enabled": M(nt),
818
+ "answer-notices": jt.value,
819
+ onStopGeneration: M(st),
820
+ onSubmit: M(ot),
821
+ onFileSelect: M(gt),
822
+ onDismissAttachmentNotice: M(_t),
823
+ onDismissPageNotice: M(bt),
824
+ onOpenAnswerNotice: M(wt),
825
+ onDismissAnswerNotice: M(Tt),
821
826
  onVoiceStart: Qt
822
827
  }, ee({ _: 2 }, [a.modifier === "fullscreen" ? {
823
828
  name: "prepend",
824
- fn: P(() => [C("span", Pe, [w(u, {
829
+ fn: P(() => [C("span", Fe, [w(u, {
825
830
  modifiers: "surface",
826
831
  class: "pk-chatbot-view-chat__agent-chip-avatar",
827
832
  "img-src": M(L)?.logo,
828
833
  name: M(I).name
829
- }, null, 8, ["img-src", "name"]), M(I).name ? (k(), S("strong", Fe, j(M(I).name), 1)) : x("", !0)])]),
834
+ }, null, 8, ["img-src", "name"]), M(I).name ? (k(), S("strong", Ie, j(M(I).name), 1)) : x("", !0)])]),
830
835
  key: "0"
831
836
  } : void 0]), 1032, [
832
837
  "modelValue",
@@ -849,13 +854,13 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
849
854
  "onDismissPageNotice",
850
855
  "onOpenAnswerNotice",
851
856
  "onDismissAnswerNotice"
852
- ])) : (k(), b(Te, {
857
+ ])) : (k(), b(Ee, {
853
858
  key: 2,
854
859
  state: qt.value,
855
860
  sample: Xt,
856
861
  spectrum: Zt,
857
862
  "remaining-seconds": M(Z).remainingSeconds.value,
858
- muted: G.value,
863
+ muted: W.value,
859
864
  error: Jt.value,
860
865
  "raw-error": M(Z).error.value,
861
866
  live: M(Z).isActive.value,
@@ -874,10 +879,10 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
874
879
  ]))
875
880
  ]),
876
881
  w(v, null, {
877
- default: P(() => [M(Rt) && H.value?.enabled ? (k(), S("div", Ie, [w(r, {
882
+ default: P(() => [M(zt) && V.value?.enabled ? (k(), S("div", Le, [w(r, {
878
883
  name: "ri:upload-cloud-2-line",
879
884
  class: "pk-chatbot-view-chat__drop-overlay-icon"
880
- }), C("span", null, j(M(W)("action.dropFile")), 1)])) : x("", !0)]),
885
+ }), C("span", null, j(M(U)("action.dropFile")), 1)])) : x("", !0)]),
881
886
  _: 1
882
887
  })
883
888
  ], 2);
@@ -885,6 +890,6 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
885
890
  }
886
891
  });
887
892
  //#endregion
888
- export { ve as i, Te as n, be as r, Ve as t };
893
+ export { ve as i, Ee as n, be as r, He as t };
889
894
 
890
- //# sourceMappingURL=PkChatbotViewChat-DDf8UaBR.js.map
895
+ //# sourceMappingURL=PkChatbotViewChat-10NIwiUP.js.map