@opencx/widget-core 4.0.51 → 4.0.53

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.
Files changed (52) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +307 -177
  4. package/dist/index.js.map +1 -1
  5. package/dist/src/__tests__/context/message/on-message-received-hook.spec.d.ts +1 -0
  6. package/dist/src/__tests__/context/message/on-message-received-hook.spec.d.ts.map +1 -0
  7. package/dist/src/context/active-session-polling.ctx.d.ts.map +1 -1
  8. package/dist/src/context/message.ctx.d.ts +14 -0
  9. package/dist/src/context/message.ctx.d.ts.map +1 -1
  10. package/dist/src/translation/ar.d.ts.map +1 -1
  11. package/dist/src/translation/bg.d.ts.map +1 -1
  12. package/dist/src/translation/bn.d.ts.map +1 -1
  13. package/dist/src/translation/cs.d.ts.map +1 -1
  14. package/dist/src/translation/da.d.ts.map +1 -1
  15. package/dist/src/translation/de.d.ts.map +1 -1
  16. package/dist/src/translation/el.d.ts.map +1 -1
  17. package/dist/src/translation/en.d.ts.map +1 -1
  18. package/dist/src/translation/es.d.ts.map +1 -1
  19. package/dist/src/translation/et.d.ts.map +1 -1
  20. package/dist/src/translation/fi.d.ts.map +1 -1
  21. package/dist/src/translation/fil.d.ts.map +1 -1
  22. package/dist/src/translation/fr.d.ts.map +1 -1
  23. package/dist/src/translation/hi.d.ts.map +1 -1
  24. package/dist/src/translation/hr.d.ts.map +1 -1
  25. package/dist/src/translation/hu.d.ts.map +1 -1
  26. package/dist/src/translation/index.d.ts +3 -0
  27. package/dist/src/translation/index.d.ts.map +1 -1
  28. package/dist/src/translation/is.d.ts.map +1 -1
  29. package/dist/src/translation/it.d.ts.map +1 -1
  30. package/dist/src/translation/ja.d.ts.map +1 -1
  31. package/dist/src/translation/ko.d.ts.map +1 -1
  32. package/dist/src/translation/lb.d.ts.map +1 -1
  33. package/dist/src/translation/lt.d.ts.map +1 -1
  34. package/dist/src/translation/lv.d.ts.map +1 -1
  35. package/dist/src/translation/mt.d.ts.map +1 -1
  36. package/dist/src/translation/nb.d.ts.map +1 -1
  37. package/dist/src/translation/nl.d.ts.map +1 -1
  38. package/dist/src/translation/no.d.ts.map +1 -1
  39. package/dist/src/translation/pl.d.ts.map +1 -1
  40. package/dist/src/translation/pt.d.ts.map +1 -1
  41. package/dist/src/translation/ro.d.ts.map +1 -1
  42. package/dist/src/translation/ru.d.ts.map +1 -1
  43. package/dist/src/translation/sk.d.ts.map +1 -1
  44. package/dist/src/translation/sv.d.ts.map +1 -1
  45. package/dist/src/translation/th.d.ts.map +1 -1
  46. package/dist/src/translation/tr.d.ts.map +1 -1
  47. package/dist/src/translation/ur.d.ts.map +1 -1
  48. package/dist/src/translation/vi.d.ts.map +1 -1
  49. package/dist/src/translation/zh-cn.d.ts.map +1 -1
  50. package/dist/src/types/widget-config.d.ts +15 -0
  51. package/dist/src/types/widget-config.d.ts.map +1 -1
  52. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import D from "openapi-fetch";
1
+ import N from "openapi-fetch";
2
2
  import V from "lodash.isequal";
3
3
  import { v4 as L } from "uuid";
4
- const F = (_) => {
4
+ const H = (_) => {
5
5
  console.log(_.error);
6
- }, B = (_) => {
7
- const o = D({
6
+ }, F = (_) => {
7
+ const o = N({
8
8
  baseUrl: _.baseUrl
9
9
  }), i = {
10
10
  onRequest: _.onRequest,
11
11
  onResponse: _.onResponse,
12
- onError: _.onError || F
12
+ onError: _.onError || H
13
13
  };
14
14
  return o.use(i), o;
15
15
  };
@@ -27,7 +27,7 @@ class M {
27
27
  }, this.createOpenAPIClient = ({
28
28
  baseUrl: e,
29
29
  headers: t
30
- }) => B({
30
+ }) => F({
31
31
  baseUrl: e,
32
32
  onRequest: ({ request: a }) => {
33
33
  Object.entries(t).forEach(([n, r]) => {
@@ -73,38 +73,38 @@ class M {
73
73
  abortSignal: t,
74
74
  onProgress: a
75
75
  }) => new Promise((n, r) => {
76
- var k;
77
- const c = new FormData();
78
- c.append("file", e);
79
- const u = new XMLHttpRequest();
76
+ var y;
77
+ const d = new FormData();
78
+ d.append("file", e);
79
+ const c = new XMLHttpRequest();
80
80
  if (t && (t.addEventListener("abort", () => {
81
- u.abort(), r(new DOMException("Aborted", "AbortError"));
81
+ c.abort(), r(new DOMException("Aborted", "AbortError"));
82
82
  }), t.aborted)) {
83
83
  r(new DOMException("Aborted", "AbortError"));
84
84
  return;
85
85
  }
86
- u.upload.addEventListener("progress", (g) => {
86
+ c.upload.addEventListener("progress", (g) => {
87
87
  if (g.lengthComputable && a) {
88
- const f = Math.round(g.loaded / g.total * 100);
89
- a(f);
88
+ const k = Math.round(g.loaded / g.total * 100);
89
+ a(k);
90
90
  }
91
- }), u.addEventListener("load", () => {
92
- if (u.status >= 200 && u.status < 300)
91
+ }), c.addEventListener("load", () => {
92
+ if (c.status >= 200 && c.status < 300)
93
93
  try {
94
- const g = JSON.parse(u.responseText);
94
+ const g = JSON.parse(c.responseText);
95
95
  n(g);
96
96
  } catch (g) {
97
97
  r(new Error(`Failed to parse response: ${g}`));
98
98
  }
99
99
  else
100
- r(new Error(`Upload failed with status: ${u.status}`));
101
- }), u.addEventListener("error", () => {
100
+ r(new Error(`Upload failed with status: ${c.status}`));
101
+ }), c.addEventListener("error", () => {
102
102
  r(new Error("Network error occurred"));
103
- }), u.addEventListener("timeout", () => {
103
+ }), c.addEventListener("timeout", () => {
104
104
  r(new Error("Upload timed out"));
105
105
  });
106
- const { baseUrl: p } = this.constructClientOptions(this.userToken), b = `${p}/backend/widget/v2/upload`;
107
- u.open("POST", b), u.setRequestHeader("X-Bot-Token", this.config.token), this.userToken ?? ((k = this.config.user) == null ? void 0 : k.token) ? u.setRequestHeader("Authorization", `Bearer ${this.userToken}`) : console.error("User token not set"), u.send(c);
106
+ const { baseUrl: v } = this.constructClientOptions(this.userToken), b = `${v}/backend/widget/v2/upload`;
107
+ c.open("POST", b), c.setRequestHeader("X-Bot-Token", this.config.token), this.userToken ?? ((y = this.config.user) == null ? void 0 : y.token) ? c.setRequestHeader("Authorization", `Bearer ${this.userToken}`) : console.error("User token not set"), c.send(d);
108
108
  }), this.vote = async (e) => await this.client.POST("/backend/widget/v2/chat/vote", { body: e }), this.resolveSession = async (e, t) => await this.client.POST("/backend/widget/v2/session/resolve", {
109
109
  body: e,
110
110
  signal: t
@@ -143,7 +143,7 @@ class S {
143
143
  }), this.state = o, this.initialState = o;
144
144
  }
145
145
  }
146
- class U {
146
+ class O {
147
147
  constructor() {
148
148
  this.state = new S({
149
149
  isPolling: !1,
@@ -172,7 +172,7 @@ class U {
172
172
  };
173
173
  }
174
174
  }
175
- function N(_) {
175
+ function R(_) {
176
176
  try {
177
177
  const o = _();
178
178
  return o instanceof Promise ? o.then((i) => ({ data: i })).catch((i) => ({ error: i })) : { data: o };
@@ -180,7 +180,7 @@ function N(_) {
180
180
  return { error: o };
181
181
  }
182
182
  }
183
- class H {
183
+ class B {
184
184
  constructor({
185
185
  api: o,
186
186
  config: i,
@@ -188,7 +188,7 @@ class H {
188
188
  messageCtx: h,
189
189
  sessionPollingIntervalSeconds: s
190
190
  }) {
191
- this.poller = new U(), this.fetchSessionAndFullHistoryAbortController = new AbortController(), this.registerPolling = () => {
191
+ this.poller = new O(), this.fetchSessionAndFullHistoryAbortController = new AbortController(), this.registerPolling = () => {
192
192
  this.sessionCtx.sessionState.subscribe(({ session: e }) => {
193
193
  e != null && e.id ? this.poller.startPolling(async (t) => {
194
194
  this.fetchSessionAndHistory({ sessionId: e.id, abortSignal: t });
@@ -212,20 +212,27 @@ class H {
212
212
  abortSignal: t,
213
213
  fetchFullHistory: a = !1
214
214
  }) => {
215
- var u;
216
- this.messageCtx.state.get().messages.length === 0 && this.messageCtx.state.setPartial({ isInitialFetchLoading: !0 });
217
- const n = this.messageCtx.state.get().messages, r = n.length > 0 ? ((u = n[n.length - 1]) == null ? void 0 : u.timestamp) ?? void 0 : void 0, { data: c } = await this.api.pollSessionAndHistory({
215
+ var v;
216
+ const n = this.messageCtx.state.get().messages.length === 0;
217
+ n && this.messageCtx.state.setPartial({ isInitialFetchLoading: !0 });
218
+ const r = this.messageCtx.state.get().messages, d = r.length > 0 ? ((v = r[r.length - 1]) == null ? void 0 : v.timestamp) ?? void 0 : void 0, { data: c } = await this.api.pollSessionAndHistory({
218
219
  sessionId: e,
219
220
  abortSignal: t,
220
- lastMessageTimestamp: a ? void 0 : r
221
+ lastMessageTimestamp: a ? void 0 : d
221
222
  });
222
223
  if (c != null && c.session && (this.sessionCtx.sessionState.setPartial({ session: c.session }), this.sessionCtx.setSessions([c.session])), c != null && c.history && c.history.length > 0) {
223
- const p = this.messageCtx.state.get().messages, y = c.history.map(this.mapHistoryToMessage).filter((b) => b !== null).filter(
224
- (b) => !p.some((v) => v.id === b.id)
224
+ const f = this.messageCtx.state.get().messages, b = c.history.map(this.mapHistoryToMessage).filter((u) => u !== null).filter(
225
+ (u) => !f.some((y) => y.id === u.id)
225
226
  );
226
- this.messageCtx.state.setPartial({
227
- messages: [...p, ...y]
228
- });
227
+ if (this.messageCtx.state.setPartial({
228
+ messages: [...f, ...b]
229
+ }), n)
230
+ this.messageCtx.markAsDispatchedToOnMessageReceivedHook(
231
+ b.map((u) => u.id)
232
+ );
233
+ else
234
+ for (const u of b)
235
+ this.messageCtx.dispatchToOnMessageReceivedHook(u);
229
236
  }
230
237
  this.messageCtx.state.get().isInitialFetchLoading && this.messageCtx.state.setPartial({ isInitialFetchLoading: !1 });
231
238
  }, this.mapHistoryToMessage = (e) => {
@@ -335,7 +342,7 @@ class H {
335
342
  const t = e.result;
336
343
  if (t === null || typeof t != "object") return t;
337
344
  if ("responseBodyText" in t && typeof t.responseBodyText == "string") {
338
- const a = t.responseBodyText, n = N(() => JSON.parse(a)).data;
345
+ const a = t.responseBodyText, n = R(() => JSON.parse(a)).data;
339
346
  if (n) return n;
340
347
  }
341
348
  return e.result;
@@ -353,26 +360,26 @@ class J {
353
360
  var s;
354
361
  return !!(!((s = this.state.get().contact) != null && s.token) && this.config.collectUserData);
355
362
  }, this.autoCreateUnverifiedUserIfNotExists = async () => {
356
- var s, e, t, a, n, r, c, u, p, y, b, v, k, g;
363
+ var s, e, t, a, n, r, d, c, v, f, b, u, y, g;
357
364
  if (!((s = this.config.user) != null && s.token)) {
358
365
  if (this.config.collectUserData && !((t = (e = this.config.user) == null ? void 0 : e.data) != null && t.email)) {
359
366
  if ((a = this.config.extraDataCollectionFields) != null && a.length)
360
367
  return;
361
- const f = await ((n = this.storageCtx) == null ? void 0 : n.getContactToken());
362
- f && await this.setUnverifiedContact(f);
368
+ const k = await ((n = this.storageCtx) == null ? void 0 : n.getContactToken());
369
+ k && await this.setUnverifiedContact(k);
363
370
  return;
364
371
  }
365
- if (!((c = (r = this.config.user) == null ? void 0 : r.data) != null && c.email)) {
366
- const f = await ((u = this.storageCtx) == null ? void 0 : u.getContactToken());
367
- if (f) {
368
- await this.setUnverifiedContact(f);
372
+ if (!((d = (r = this.config.user) == null ? void 0 : r.data) != null && d.email)) {
373
+ const k = await ((c = this.storageCtx) == null ? void 0 : c.getContactToken());
374
+ if (k) {
375
+ await this.setUnverifiedContact(k);
369
376
  return;
370
377
  }
371
378
  }
372
379
  await this.createUnverifiedContact({
373
- email: (y = (p = this.config.user) == null ? void 0 : p.data) == null ? void 0 : y.email,
374
- non_verified_name: (v = (b = this.config.user) == null ? void 0 : b.data) == null ? void 0 : v.name,
375
- non_verified_custom_data: (g = (k = this.config.user) == null ? void 0 : k.data) == null ? void 0 : g.customData
380
+ email: (f = (v = this.config.user) == null ? void 0 : v.data) == null ? void 0 : f.email,
381
+ non_verified_name: (u = (b = this.config.user) == null ? void 0 : b.data) == null ? void 0 : u.name,
382
+ non_verified_custom_data: (g = (y = this.config.user) == null ? void 0 : y.data) == null ? void 0 : g.customData
376
383
  });
377
384
  }
378
385
  }, this.createUnverifiedContact = async (s, e) => {
@@ -388,9 +395,9 @@ class J {
388
395
  this.state.setPartial({ isCreatingUnverifiedContact: !1 });
389
396
  }
390
397
  }, this.setUnverifiedContact = async (s) => {
391
- var a, n, r, c;
398
+ var a, n, r, d;
392
399
  const e = await ((a = this.storageCtx) == null ? void 0 : a.getExternalContactId()), t = ((n = this.config.user) == null ? void 0 : n.externalId) || e || L();
393
- this.api.setAuthToken(s), await ((r = this.storageCtx) == null ? void 0 : r.setContactToken(s)), await ((c = this.storageCtx) == null ? void 0 : c.setExternalContactId(t)), this.state.setPartial({ contact: { token: s, externalId: t } });
400
+ this.api.setAuthToken(s), await ((r = this.storageCtx) == null ? void 0 : r.setContactToken(s)), await ((d = this.storageCtx) == null ? void 0 : d.setExternalContactId(t)), this.state.setPartial({ contact: { token: s, externalId: t } });
394
401
  }, this.config = o, this.storageCtx = l, this.api = i, this.state = new S({
395
402
  contact: (h = o.user) != null && h.token ? {
396
403
  token: o.user.token,
@@ -445,14 +452,14 @@ class q {
445
452
  }, this.config = o, this.api = i, this.sessionCtx = l, this.messageCtx = h;
446
453
  }
447
454
  }
448
- class W {
455
+ class G {
449
456
  constructor({
450
457
  config: o,
451
458
  api: i,
452
459
  contactCtx: l,
453
460
  sessionsPollingIntervalSeconds: h
454
461
  }) {
455
- this.sessionsRefresher = new U(), this.sessionState = new S({
462
+ this.sessionsRefresher = new O(), this.sessionState = new S({
456
463
  session: null,
457
464
  isCreatingSession: !1,
458
465
  isResolvingSession: !1
@@ -481,11 +488,11 @@ class W {
481
488
  Object.entries(this.config.sessionCustomData || {}).map(
482
489
  ([s, e]) => {
483
490
  var t;
484
- return typeof e == "string" ? [s, e] : typeof e == "boolean" ? [s, e] : typeof e == "number" ? [s, e] : [s, ((t = N(() => JSON.stringify(e))) == null ? void 0 : t.data) || ""];
491
+ return typeof e == "string" ? [s, e] : typeof e == "boolean" ? [s, e] : typeof e == "number" ? [s, e] : [s, ((t = R(() => JSON.stringify(e))) == null ? void 0 : t.data) || ""];
485
492
  }
486
493
  )
487
494
  ), this.createSession = async () => {
488
- var n, r, c;
495
+ var n, r, d;
489
496
  this.sessionState.setPartial({ session: null, isCreatingSession: !0 });
490
497
  const s = (n = this.contactCtx.state.get().contact) == null ? void 0 : n.externalId, e = {
491
498
  ...this.getParsedCustomData(),
@@ -493,7 +500,7 @@ class W {
493
500
  }, { data: t, error: a } = await this.api.createSession({
494
501
  customData: Object.keys(e).length > 0 ? e : void 0
495
502
  });
496
- return t ? (this.sessionState.setPartial({ session: t, isCreatingSession: !1 }), (c = (r = this.config.hooks) == null ? void 0 : r.onSessionCreated) == null || c.call(r, { session: t }), t) : (this.sessionState.setPartial({ isCreatingSession: !1 }), console.error("Failed to create session:", a), null);
503
+ return t ? (this.sessionState.setPartial({ session: t, isCreatingSession: !1 }), (d = (r = this.config.hooks) == null ? void 0 : r.onSessionCreated) == null || d.call(r, { session: t }), t) : (this.sessionState.setPartial({ isCreatingSession: !1 }), console.error("Failed to create session:", a), null);
497
504
  }, this.loadMoreSessions = async () => {
498
505
  if (this.sessionsState.get().isLastPage) return;
499
506
  const { data: s } = await this.getSessions({
@@ -501,7 +508,7 @@ class W {
501
508
  });
502
509
  if (s) {
503
510
  const t = [...this.sessionsState.get().data, ...s.items].filter(
504
- (a, n, r) => n === r.findIndex((c) => a.id === c.id)
511
+ (a, n, r) => n === r.findIndex((d) => a.id === d.id)
505
512
  );
506
513
  this.sessionsState.setPartial({
507
514
  data: t,
@@ -548,7 +555,7 @@ class W {
548
555
  }, this.config = o, this.api = i, this.contactCtx = l, this.sessionsPollingIntervalSeconds = h, this.registerSessionsRefresherWrapper();
549
556
  }
550
557
  }
551
- class Y {
558
+ class W {
552
559
  constructor({
553
560
  config: o,
554
561
  api: i,
@@ -561,10 +568,19 @@ class Y {
561
568
  isSendingMessageToAI: !1,
562
569
  lastAIResMightSolveUserIssue: !1,
563
570
  isInitialFetchLoading: !1
564
- }), this.sendMessageAbortController = new AbortController(), this.reset = () => {
565
- this.sendMessageAbortController.abort("Resetting chat"), this.state.reset();
571
+ }), this.sendMessageAbortController = new AbortController(), this.messageIdsDispatchedToOnMessageReceivedHook = /* @__PURE__ */ new Set(), this.reset = () => {
572
+ this.sendMessageAbortController.abort("Resetting chat"), this.state.reset(), this.messageIdsDispatchedToOnMessageReceivedHook.clear();
573
+ }, this.dispatchToOnMessageReceivedHook = (s) => {
574
+ var t, a;
575
+ if (s.type === "USER" || this.messageIdsDispatchedToOnMessageReceivedHook.has(s.id)) return;
576
+ const e = this.sessionCtx.sessionState.get().session;
577
+ e && (this.messageIdsDispatchedToOnMessageReceivedHook.add(s.id), (a = (t = this.config.hooks) == null ? void 0 : t.onMessageReceived) == null || a.call(t, { message: s, session: e }));
578
+ }, this.markAsDispatchedToOnMessageReceivedHook = (s) => {
579
+ s.forEach(
580
+ (e) => this.messageIdsDispatchedToOnMessageReceivedHook.add(e)
581
+ );
566
582
  }, this.sendMessage = async (s) => {
567
- var t, a, n, r, c, u, p, y, b;
583
+ var t, a, n, r, d, c, v, f, b;
568
584
  let e;
569
585
  try {
570
586
  if (!s.content.trim() && (!s.attachments || s.attachments.length === 0)) {
@@ -573,25 +589,25 @@ class Y {
573
589
  );
574
590
  return;
575
591
  }
576
- const v = this.sessionCtx.sessionState.get().session, g = (v == null ? void 0 : v.assignee.kind) === "ai", f = this.state.get().isSendingMessageToAI, z = this.state.get().messages.at(-1);
577
- if (this.config.disableSendingWhenAwaitingAIReply !== !1 && (f || // If last message is from user, then bot response did not arrive yet
578
- g && (z == null ? void 0 : z.type) === "USER")) {
592
+ const u = this.sessionCtx.sessionState.get().session, g = (u == null ? void 0 : u.assignee.kind) === "ai", k = this.state.get().isSendingMessageToAI, x = this.state.get().messages.at(-1);
593
+ if (this.config.disableSendingWhenAwaitingAIReply !== !1 && (k || // If last message is from user, then bot response did not arrive yet
594
+ g && (x == null ? void 0 : x.type) === "USER")) {
579
595
  console.warn("Cannot send messages while awaiting AI response");
580
596
  return;
581
597
  }
582
598
  this.sendMessageAbortController.abort("Superseded by a newer message"), this.sendMessageAbortController = new AbortController(), e = this.sendMessageAbortController, this.state.setPartial({
583
599
  lastAIResMightSolveUserIssue: !1,
584
600
  isSendingMessage: !0,
585
- isSendingMessageToAI: !!g || !v
601
+ isSendingMessageToAI: !!g || !u
586
602
  });
587
- const P = this.state.get().messages, j = !((t = this.sessionCtx.sessionState.get().session) != null && t.id) && P.length === 0 && ((a = this.config.advancedInitialMessages) == null ? void 0 : a.some((d) => d.persistent)), A = j ? (this.config.advancedInitialMessages || []).filter((d) => d.persistent).map(
588
- (d) => ({
603
+ const j = this.state.get().messages, P = !((t = this.sessionCtx.sessionState.get().session) != null && t.id) && j.length === 0 && ((a = this.config.advancedInitialMessages) == null ? void 0 : a.some((m) => m.persistent)), T = P ? (this.config.advancedInitialMessages || []).filter((m) => m.persistent).map(
604
+ (m) => ({
589
605
  id: C(),
590
606
  component: "bot_message",
591
607
  type: "AI",
592
608
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
593
609
  data: {
594
- message: d.message
610
+ message: m.message
595
611
  },
596
612
  agent: this.config.bot ? { ...this.config.bot, isAi: !0, id: null } : void 0
597
613
  })
@@ -601,8 +617,8 @@ class Y {
601
617
  );
602
618
  if (this.state.setPartial({
603
619
  messages: [
604
- ...A,
605
- ...P,
620
+ ...T,
621
+ ...j,
606
622
  I
607
623
  ]
608
624
  }), !((n = this.sessionCtx.sessionState.get().session) != null && n.id)) {
@@ -612,16 +628,16 @@ class Y {
612
628
  }
613
629
  this.sessionCtx.refreshSessions();
614
630
  }
615
- const T = (r = this.sessionCtx.sessionState.get().session) == null ? void 0 : r.id;
616
- if (!T) return;
617
- const { data: m } = await this.api.sendMessage(
631
+ const A = (r = this.sessionCtx.sessionState.get().session) == null ? void 0 : r.id;
632
+ if (!A) return;
633
+ const { data: p } = await this.api.sendMessage(
618
634
  {
619
635
  uuid: I.id,
620
636
  bot_token: this.config.token,
621
637
  headers: this.config.headers,
622
638
  query_params: this.config.queryParams,
623
639
  body_properties: this.config.bodyProperties,
624
- session_id: T,
640
+ session_id: A,
625
641
  content: I.content,
626
642
  attachments: s.attachments,
627
643
  clientContext: this.config.context,
@@ -631,41 +647,41 @@ class Y {
631
647
  },
632
648
  language: this.config.language,
633
649
  exit_mode_prompt: s.exitModePrompt,
634
- initial_messages: j ? A.map((d) => ({
635
- uuid: d.id,
636
- content: d.data.message
650
+ initial_messages: P ? T.map((m) => ({
651
+ uuid: m.id,
652
+ content: m.data.message
637
653
  })) : void 0
638
654
  },
639
655
  e.signal
640
656
  );
641
- if (m != null && m.success) {
642
- const d = this.toBotMessage(m);
643
- if (d) {
644
- const x = this.state.get().messages;
645
- if (!!x.some(
646
- (R) => R.id === d.id
657
+ if (p != null && p.success) {
658
+ const m = this.toBotMessage(p);
659
+ if (m) {
660
+ const z = this.state.get().messages;
661
+ if (!!z.some(
662
+ (D) => D.id === m.id
647
663
  )) {
648
664
  this.state.setPartial({
649
- lastAIResMightSolveUserIssue: ((c = m.autopilotResponse) == null ? void 0 : c.mightSolveUserIssue) || ((u = m.uiResponse) == null ? void 0 : u.mightSolveUserIssue)
665
+ lastAIResMightSolveUserIssue: ((d = p.autopilotResponse) == null ? void 0 : d.mightSolveUserIssue) || ((c = p.uiResponse) == null ? void 0 : c.mightSolveUserIssue)
650
666
  });
651
667
  return;
652
668
  }
653
669
  this.state.setPartial({
654
- messages: [...x, d],
655
- lastAIResMightSolveUserIssue: ((p = m.autopilotResponse) == null ? void 0 : p.mightSolveUserIssue) || ((y = m.uiResponse) == null ? void 0 : y.mightSolveUserIssue)
656
- });
670
+ messages: [...z, m],
671
+ lastAIResMightSolveUserIssue: ((v = p.autopilotResponse) == null ? void 0 : v.mightSolveUserIssue) || ((f = p.uiResponse) == null ? void 0 : f.mightSolveUserIssue)
672
+ }), this.dispatchToOnMessageReceivedHook(m);
657
673
  }
658
- m.session && this.sessionCtx.sessionState.setPartial({ session: m.session });
674
+ p.session && this.sessionCtx.sessionState.setPartial({ session: p.session });
659
675
  } else {
660
- const d = this.toBotErrorMessage(
661
- ((b = m == null ? void 0 : m.error) == null ? void 0 : b.message) || "Something went wrong. Please refresh the page or try again."
662
- ), x = this.state.get().messages;
676
+ const m = this.toBotErrorMessage(
677
+ ((b = p == null ? void 0 : p.error) == null ? void 0 : b.message) || "Something went wrong. Please refresh the page or try again."
678
+ ), z = this.state.get().messages;
663
679
  this.state.setPartial({
664
- messages: [...x, d]
680
+ messages: [...z, m]
665
681
  });
666
682
  }
667
- } catch (v) {
668
- e != null && e.signal.aborted || console.error("Failed to send message:", v);
683
+ } catch (u) {
684
+ e != null && e.signal.aborted || console.error("Failed to send message:", u);
669
685
  } finally {
670
686
  e != null && e.signal.aborted || this.state.setPartial({
671
687
  isSendingMessage: !1,
@@ -675,7 +691,7 @@ class Y {
675
691
  }, this.toUserMessage = (s, e) => {
676
692
  const t = (() => {
677
693
  const a = this.contactCtx.state.get().extraCollectedData;
678
- return this.state.get().messages.length === 0 && a && Object.keys(a).length > 0 ? `${Object.entries(a).filter(([r, c]) => !!c).map(([r, c]) => `${r}: ${c}`).join(`
694
+ return this.state.get().messages.length === 0 && a && Object.keys(a).length > 0 ? `${Object.entries(a).filter(([r, d]) => !!d).map(([r, d]) => `${r}: ${d}`).join(`
679
695
  `)}
680
696
 
681
697
  ${s}` : s;
@@ -724,7 +740,7 @@ ${s}` : s;
724
740
  }), this.config = o, this.api = i, this.sessionCtx = l, this.contactCtx = h;
725
741
  }
726
742
  }
727
- class G {
743
+ class Y {
728
744
  constructor({
729
745
  config: o,
730
746
  contactCtx: i,
@@ -740,14 +756,14 @@ class G {
740
756
  });
741
757
  }), this.sessionCtx.sessionsState.subscribe(
742
758
  ({ isInitialFetchLoading: e, data: t }) => {
743
- var a, n, r, c;
759
+ var a, n, r, d;
744
760
  if ((a = this.config.router) != null && a.chatScreenOnly && // Do not route to a chat if we are currently inside one already
745
761
  // This also applies to newly created sessions; the new session will be in `sessionState` before it is refreshed and included in `sessionsState`
746
762
  !((n = this.sessionCtx.sessionState.get().session) != null && n.id)) {
747
- const u = (r = t.find((p) => p.isOpened)) == null ? void 0 : r.id;
748
- return u ? this.toChatScreen(u) : void 0;
763
+ const c = (r = t.find((v) => v.isOpened)) == null ? void 0 : r.id;
764
+ return c ? this.toChatScreen(c) : void 0;
749
765
  }
750
- t.length || ((c = this.config.router) == null ? void 0 : c.goToChatIfNoSessions) !== !1 && !e && this.state.get().screen !== "chat" && this.toChatScreen();
766
+ t.length || ((d = this.config.router) == null ? void 0 : d.goToChatIfNoSessions) !== !1 && !e && this.state.get().screen !== "chat" && this.toChatScreen();
751
767
  }
752
768
  );
753
769
  }, this.toSessionsScreen = () => {
@@ -800,12 +816,12 @@ const w = class w {
800
816
  api: this.api,
801
817
  config: this.config,
802
818
  storageCtx: this.storageCtx
803
- }), this.sessionCtx = new W({
819
+ }), this.sessionCtx = new G({
804
820
  config: this.config,
805
821
  api: this.api,
806
822
  contactCtx: this.contactCtx,
807
823
  sessionsPollingIntervalSeconds: w.pollingIntervalsSeconds.sessions
808
- }), this.messageCtx = new Y({
824
+ }), this.messageCtx = new W({
809
825
  config: this.config,
810
826
  api: this.api,
811
827
  sessionCtx: this.sessionCtx,
@@ -815,13 +831,13 @@ const w = class w {
815
831
  api: this.api,
816
832
  sessionCtx: this.sessionCtx,
817
833
  messageCtx: this.messageCtx
818
- }), this.activeSessionPollingCtx = new H({
834
+ }), this.activeSessionPollingCtx = new B({
819
835
  api: this.api,
820
836
  config: this.config,
821
837
  sessionCtx: this.sessionCtx,
822
838
  messageCtx: this.messageCtx,
823
839
  sessionPollingIntervalSeconds: w.pollingIntervalsSeconds.session
824
- }), this.routerCtx = new G({
840
+ }), this.routerCtx = new Y({
825
841
  config: this.config,
826
842
  contactCtx: this.contactCtx,
827
843
  sessionCtx: this.sessionCtx,
@@ -868,8 +884,11 @@ const Z = {
868
884
  optional: "اختياري",
869
885
  no_conversations_yet: "لا يوجد محادثات",
870
886
  back_to_conversations: "العودة إلى المحادثات",
871
- closed_conversations: "المحادثات المغلقة"
872
- }, X = {
887
+ closed_conversations: "المحادثات المغلقة",
888
+ csat_title: "كيف كانت محادثتك؟",
889
+ csat_submitted_title: "لقد قيّمت المحادثة بـ",
890
+ csat_feedback_placeholder: "أخبرنا المزيد... (اختياري)"
891
+ }, Q = {
873
892
  write_a_message_placeholder: "একটি বার্তা লিখুন...",
874
893
  your_issue_has_been_resolved: "আপনার সমস্যা সমাধান হয়েছে!",
875
894
  new_conversation: "নতুন কথোপকথন",
@@ -884,8 +903,11 @@ const Z = {
884
903
  optional: "ঐচ্ছিক",
885
904
  no_conversations_yet: "এখনো কোনো কথোপকথন নেই",
886
905
  back_to_conversations: "কথোপকথনে ফিরে যান",
887
- closed_conversations: "বন্ধ কথোপকথন"
888
- }, Q = {
906
+ closed_conversations: "বন্ধ কথোপকথন",
907
+ csat_title: "আপনার কথোপকথন কেমন ছিল?",
908
+ csat_submitted_title: "আপনি কথোপকথনটি মূল্যায়ন করেছেন",
909
+ csat_feedback_placeholder: "আমাদের আরও বলুন... (ঐচ্ছিক)"
910
+ }, X = {
889
911
  write_a_message_placeholder: "Напишете съобщение...",
890
912
  your_issue_has_been_resolved: "Вашият проблем е разрешен!",
891
913
  new_conversation: "Нов разговор",
@@ -900,7 +922,10 @@ const Z = {
900
922
  optional: "По избор",
901
923
  no_conversations_yet: "Все още няма разговори",
902
924
  back_to_conversations: "Назад към разговорите",
903
- closed_conversations: "Затворени разговори"
925
+ closed_conversations: "Затворени разговори",
926
+ csat_title: "Как мина разговорът ви?",
927
+ csat_submitted_title: "Оценихте разговора като",
928
+ csat_feedback_placeholder: "Кажете ни повече... (по желание)"
904
929
  }, ee = {
905
930
  write_a_message_placeholder: "Napište zprávu...",
906
931
  your_issue_has_been_resolved: "Váš problém byl vyřešen!",
@@ -916,7 +941,10 @@ const Z = {
916
941
  optional: "Volitelné",
917
942
  no_conversations_yet: "Zatím žádné konverzace",
918
943
  back_to_conversations: "Zpět na konverzace",
919
- closed_conversations: "Uzavřené konverzace"
944
+ closed_conversations: "Uzavřené konverzace",
945
+ csat_title: "Jaká byla vaše konverzace?",
946
+ csat_submitted_title: "Konverzaci jste ohodnotili jako",
947
+ csat_feedback_placeholder: "Řekněte nám více... (nepovinné)"
920
948
  }, te = {
921
949
  write_a_message_placeholder: "Skriv en besked...",
922
950
  your_issue_has_been_resolved: "Dit problem er løst!",
@@ -932,7 +960,10 @@ const Z = {
932
960
  optional: "Valgfrit",
933
961
  no_conversations_yet: "Ingen samtaler endnu",
934
962
  back_to_conversations: "Tilbage til samtaler",
935
- closed_conversations: "Lukkede samtaler"
963
+ closed_conversations: "Lukkede samtaler",
964
+ csat_title: "Hvordan var din samtale?",
965
+ csat_submitted_title: "Du vurderede samtalen som",
966
+ csat_feedback_placeholder: "Fortæl os mere... (valgfrit)"
936
967
  }, se = {
937
968
  write_a_message_placeholder: "Γράψτε ένα μήνυμα...",
938
969
  your_issue_has_been_resolved: "Το πρόβλημά σας επιλύθηκε!",
@@ -948,7 +979,10 @@ const Z = {
948
979
  optional: "Προαιρετικό",
949
980
  no_conversations_yet: "Δεν υπάρχουν συνομιλίες ακόμα",
950
981
  back_to_conversations: "Πίσω στις συνομιλίες",
951
- closed_conversations: "Κλειστές συνομιλίες"
982
+ closed_conversations: "Κλειστές συνομιλίες",
983
+ csat_title: "Πώς ήταν η συνομιλία σας;",
984
+ csat_submitted_title: "Βαθμολογήσατε τη συνομιλία ως",
985
+ csat_feedback_placeholder: "Πείτε μας περισσότερα... (προαιρετικό)"
952
986
  }, ae = {
953
987
  write_a_message_placeholder: "Nachricht schreiben...",
954
988
  your_issue_has_been_resolved: "Ihr Problem wurde gelöst!",
@@ -964,7 +998,10 @@ const Z = {
964
998
  optional: "Optional",
965
999
  no_conversations_yet: "noch keine Gespräche",
966
1000
  back_to_conversations: "Zurück zur Konversationen",
967
- closed_conversations: "Geschlossene Konversationen"
1001
+ closed_conversations: "Geschlossene Konversationen",
1002
+ csat_title: "Wie war Ihr Gespräch?",
1003
+ csat_submitted_title: "Sie haben das Gespräch bewertet als",
1004
+ csat_feedback_placeholder: "Erzählen Sie uns mehr... (optional)"
968
1005
  }, oe = {
969
1006
  write_a_message_placeholder: "Write a message...",
970
1007
  your_issue_has_been_resolved: "Your issue has been resolved!",
@@ -980,7 +1017,10 @@ const Z = {
980
1017
  optional: "Optional",
981
1018
  no_conversations_yet: "No conversations yet",
982
1019
  back_to_conversations: "Back to conversations",
983
- closed_conversations: "Closed conversations"
1020
+ closed_conversations: "Closed conversations",
1021
+ csat_title: "How was your conversation?",
1022
+ csat_submitted_title: "You rated the conversation as",
1023
+ csat_feedback_placeholder: "Tell us more... (optional)"
984
1024
  }, ne = {
985
1025
  write_a_message_placeholder: "Escribe un mensaje...",
986
1026
  your_issue_has_been_resolved: "¡Tu problema fue resuelto!",
@@ -996,7 +1036,10 @@ const Z = {
996
1036
  optional: "Opcional",
997
1037
  no_conversations_yet: "Sin conversaciones aún",
998
1038
  back_to_conversations: "Volver a conversaciones",
999
- closed_conversations: "Conversaciones cerradas"
1039
+ closed_conversations: "Conversaciones cerradas",
1040
+ csat_title: "¿Qué tal fue tu conversación?",
1041
+ csat_submitted_title: "Valoraste la conversación como",
1042
+ csat_feedback_placeholder: "Cuéntanos más... (opcional)"
1000
1043
  }, ie = {
1001
1044
  write_a_message_placeholder: "Magsulat ng mensahe...",
1002
1045
  your_issue_has_been_resolved: "Nalutas na ang iyong isyu!",
@@ -1012,7 +1055,10 @@ const Z = {
1012
1055
  optional: "Opsyonal",
1013
1056
  no_conversations_yet: "Wala pang mga usapan",
1014
1057
  back_to_conversations: "Bumalik sa mga usapan",
1015
- closed_conversations: "Mga saradong usapan"
1058
+ closed_conversations: "Mga saradong usapan",
1059
+ csat_title: "Kumusta ang iyong usapan?",
1060
+ csat_submitted_title: "Ni-rate mo ang usapan bilang",
1061
+ csat_feedback_placeholder: "Sabihin pa sa amin... (opsyonal)"
1016
1062
  }, re = {
1017
1063
  write_a_message_placeholder: "Kirjoita viesti...",
1018
1064
  your_issue_has_been_resolved: "Ongelmasi on ratkaistu!",
@@ -1028,7 +1074,10 @@ const Z = {
1028
1074
  optional: "Valinnainen",
1029
1075
  no_conversations_yet: "Ei vielä keskusteluja",
1030
1076
  back_to_conversations: "Takaisin keskusteluihin",
1031
- closed_conversations: "Suljetut keskustelut"
1077
+ closed_conversations: "Suljetut keskustelut",
1078
+ csat_title: "Millainen keskustelusi oli?",
1079
+ csat_submitted_title: "Arvioit keskustelun",
1080
+ csat_feedback_placeholder: "Kerro lisää... (valinnainen)"
1032
1081
  }, le = {
1033
1082
  write_a_message_placeholder: "Écrivez un message...",
1034
1083
  your_issue_has_been_resolved: "Votre problème a été résolu !",
@@ -1044,7 +1093,10 @@ const Z = {
1044
1093
  optional: "Optionnel",
1045
1094
  no_conversations_yet: "Aucune conversation pour le moment",
1046
1095
  back_to_conversations: "Retour aux conversations",
1047
- closed_conversations: "Conversations fermées"
1096
+ closed_conversations: "Conversations fermées",
1097
+ csat_title: "Comment s’est passée votre conversation ?",
1098
+ csat_submitted_title: "Vous avez évalué la conversation comme",
1099
+ csat_feedback_placeholder: "Dites-nous en plus... (facultatif)"
1048
1100
  }, ce = {
1049
1101
  write_a_message_placeholder: "एक संदेश लिखें...",
1050
1102
  your_issue_has_been_resolved: "आपकी समस्या हल हो गई है!",
@@ -1060,7 +1112,10 @@ const Z = {
1060
1112
  optional: "वैकल्पिक",
1061
1113
  no_conversations_yet: "अभी तक कोई बातचीत नहीं",
1062
1114
  back_to_conversations: "बातचीत पर वापस जाएं",
1063
- closed_conversations: "बंद बातचीत"
1115
+ closed_conversations: "बंद बातचीत",
1116
+ csat_title: "आपकी बातचीत कैसी रही?",
1117
+ csat_submitted_title: "आपने बातचीत को आंका",
1118
+ csat_feedback_placeholder: "हमें और बताएं... (वैकल्पिक)"
1064
1119
  }, _e = {
1065
1120
  write_a_message_placeholder: "Scrivi un messaggio...",
1066
1121
  your_issue_has_been_resolved: "Il tuo problema è stato risolto!",
@@ -1076,7 +1131,10 @@ const Z = {
1076
1131
  optional: "Opzionale",
1077
1132
  no_conversations_yet: "Nessuna conversazione ancora",
1078
1133
  back_to_conversations: "Torna alle conversazioni",
1079
- closed_conversations: "Conversazioni chiuse"
1134
+ closed_conversations: "Conversazioni chiuse",
1135
+ csat_title: "Com’è andata la tua conversazione?",
1136
+ csat_submitted_title: "Hai valutato la conversazione come",
1137
+ csat_feedback_placeholder: "Dicci di più... (facoltativo)"
1080
1138
  }, he = {
1081
1139
  write_a_message_placeholder: "メッセージを入力...",
1082
1140
  your_issue_has_been_resolved: "問題が解決しました!",
@@ -1092,8 +1150,11 @@ const Z = {
1092
1150
  optional: "任意",
1093
1151
  no_conversations_yet: "まだ会話がありません",
1094
1152
  back_to_conversations: "会話一覧に戻る",
1095
- closed_conversations: "終了した会話"
1096
- }, ue = {
1153
+ closed_conversations: "終了した会話",
1154
+ csat_title: "会話はいかがでしたか?",
1155
+ csat_submitted_title: "会話を次のように評価しました",
1156
+ csat_feedback_placeholder: "詳しく教えてください...(任意)"
1157
+ }, de = {
1097
1158
  write_a_message_placeholder: "메시지를 입력하세요...",
1098
1159
  your_issue_has_been_resolved: "문제가 해결되었습니다!",
1099
1160
  new_conversation: "새 대화",
@@ -1108,8 +1169,11 @@ const Z = {
1108
1169
  optional: "선택 사항",
1109
1170
  no_conversations_yet: "아직 대화가 없습니다",
1110
1171
  back_to_conversations: "대화 목록으로 돌아가기",
1111
- closed_conversations: "종료된 대화"
1112
- }, de = {
1172
+ closed_conversations: "종료된 대화",
1173
+ csat_title: "대화는 어떠셨나요?",
1174
+ csat_submitted_title: "대화를 다음과 같이 평가했습니다",
1175
+ csat_feedback_placeholder: "더 알려주세요... (선택 사항)"
1176
+ }, ue = {
1113
1177
  write_a_message_placeholder: "Schrijf een bericht...",
1114
1178
  your_issue_has_been_resolved: "Uw probleem is opgelost!",
1115
1179
  new_conversation: "Nieuw gesprek",
@@ -1124,8 +1188,11 @@ const Z = {
1124
1188
  optional: "Optioneel",
1125
1189
  no_conversations_yet: "Nog geen gesprekken",
1126
1190
  back_to_conversations: "Terug naar gesprekken",
1127
- closed_conversations: "Afgesloten gesprekken"
1128
- }, ge = {
1191
+ closed_conversations: "Afgesloten gesprekken",
1192
+ csat_title: "Hoe was je gesprek?",
1193
+ csat_submitted_title: "Je hebt het gesprek beoordeeld als",
1194
+ csat_feedback_placeholder: "Vertel ons meer... (optioneel)"
1195
+ }, me = {
1129
1196
  write_a_message_placeholder: "Skriv en melding...",
1130
1197
  your_issue_has_been_resolved: "Problemet ditt er løst!",
1131
1198
  new_conversation: "Ny samtale",
@@ -1140,8 +1207,11 @@ const Z = {
1140
1207
  optional: "Valgfritt",
1141
1208
  no_conversations_yet: "Ingen samtaler ennå",
1142
1209
  back_to_conversations: "Tilbake til samtaler",
1143
- closed_conversations: "Lukkede samtaler"
1144
- }, me = {
1210
+ closed_conversations: "Lukkede samtaler",
1211
+ csat_title: "Hvordan var samtalen din?",
1212
+ csat_submitted_title: "Du vurderte samtalen som",
1213
+ csat_feedback_placeholder: "Fortell oss mer... (valgfritt)"
1214
+ }, ge = {
1145
1215
  write_a_message_placeholder: "Napisz wiadomość...",
1146
1216
  your_issue_has_been_resolved: "Twój problem został rozwiązany!",
1147
1217
  new_conversation: "Nowa rozmowa",
@@ -1156,7 +1226,10 @@ const Z = {
1156
1226
  optional: "Opcjonalne",
1157
1227
  no_conversations_yet: "Jeszcze brak rozmów",
1158
1228
  back_to_conversations: "Powrót do rozmów",
1159
- closed_conversations: "Zamknięte rozmowy"
1229
+ closed_conversations: "Zamknięte rozmowy",
1230
+ csat_title: "Jak przebiegła Twoja rozmowa?",
1231
+ csat_submitted_title: "Oceniłeś rozmowę jako",
1232
+ csat_feedback_placeholder: "Powiedz nam więcej... (opcjonalnie)"
1160
1233
  }, pe = {
1161
1234
  write_a_message_placeholder: "Escreva uma mensagem...",
1162
1235
  your_issue_has_been_resolved: "Seu problema foi resolvido!",
@@ -1172,7 +1245,10 @@ const Z = {
1172
1245
  optional: "Opcional",
1173
1246
  no_conversations_yet: "Nenhuma conversa ainda",
1174
1247
  back_to_conversations: "Voltar para conversas",
1175
- closed_conversations: "Conversas fechadas"
1248
+ closed_conversations: "Conversas fechadas",
1249
+ csat_title: "Como foi a sua conversa?",
1250
+ csat_submitted_title: "Você avaliou a conversa como",
1251
+ csat_feedback_placeholder: "Conte-nos mais... (opcional)"
1176
1252
  }, ve = {
1177
1253
  write_a_message_placeholder: "Scrie un mesaj...",
1178
1254
  your_issue_has_been_resolved: "Problema ta a fost rezolvată!",
@@ -1188,7 +1264,10 @@ const Z = {
1188
1264
  optional: "Opțional",
1189
1265
  no_conversations_yet: "Încă nu există conversații",
1190
1266
  back_to_conversations: "Înapoi la conversații",
1191
- closed_conversations: "Conversații închise"
1267
+ closed_conversations: "Conversații închise",
1268
+ csat_title: "Cum a fost conversația ta?",
1269
+ csat_submitted_title: "Ai evaluat conversația ca",
1270
+ csat_feedback_placeholder: "Spune-ne mai multe... (opțional)"
1192
1271
  }, be = {
1193
1272
  write_a_message_placeholder: "Skriv ett meddelande...",
1194
1273
  your_issue_has_been_resolved: "Ditt problem har lösts!",
@@ -1204,7 +1283,10 @@ const Z = {
1204
1283
  optional: "Frivilligt",
1205
1284
  no_conversations_yet: "Inga konversationer ännu",
1206
1285
  back_to_conversations: "Tillbaka till konversationer",
1207
- closed_conversations: "Stängda konversationer"
1286
+ closed_conversations: "Stängda konversationer",
1287
+ csat_title: "Hur var din konversation?",
1288
+ csat_submitted_title: "Du betygsatte konversationen som",
1289
+ csat_feedback_placeholder: "Berätta mer... (valfritt)"
1208
1290
  }, fe = {
1209
1291
  write_a_message_placeholder: "Напишите сообщение...",
1210
1292
  your_issue_has_been_resolved: "Ваша проблема решена!",
@@ -1220,8 +1302,11 @@ const Z = {
1220
1302
  optional: "Необязательно",
1221
1303
  no_conversations_yet: "Пока нет разговоров",
1222
1304
  back_to_conversations: "Назад к разговорам",
1223
- closed_conversations: "Закрытые разговоры"
1224
- }, we = {
1305
+ closed_conversations: "Закрытые разговоры",
1306
+ csat_title: "Как прошёл ваш разговор?",
1307
+ csat_submitted_title: "Вы оценили разговор как",
1308
+ csat_feedback_placeholder: "Расскажите подробнее... (необязательно)"
1309
+ }, ke = {
1225
1310
  write_a_message_placeholder: "เขียนข้อความ...",
1226
1311
  your_issue_has_been_resolved: "ปัญหาของคุณได้รับการแก้ไขแล้ว!",
1227
1312
  new_conversation: "การสนทนาใหม่",
@@ -1236,8 +1321,11 @@ const Z = {
1236
1321
  optional: "ไม่บังคับ",
1237
1322
  no_conversations_yet: "ยังไม่มีการสนทนา",
1238
1323
  back_to_conversations: "กลับไปที่การสนทนา",
1239
- closed_conversations: "การสนทนาที่ปิดแล้ว"
1240
- }, ye = {
1324
+ closed_conversations: "การสนทนาที่ปิดแล้ว",
1325
+ csat_title: "การสนทนาของคุณเป็นอย่างไรบ้าง?",
1326
+ csat_submitted_title: "คุณให้คะแนนการสนทนาว่า",
1327
+ csat_feedback_placeholder: "บอกเราเพิ่มเติม... (ไม่บังคับ)"
1328
+ }, we = {
1241
1329
  write_a_message_placeholder: "Bir mesaj yazın...",
1242
1330
  your_issue_has_been_resolved: "Sorununuz çözüldü!",
1243
1331
  new_conversation: "Yeni konuşma",
@@ -1252,8 +1340,11 @@ const Z = {
1252
1340
  optional: "İsteğe bağlı",
1253
1341
  no_conversations_yet: "Henüz konuşma yok",
1254
1342
  back_to_conversations: "Konuşmalara geri dön",
1255
- closed_conversations: "Kapatılan konuşmalar"
1256
- }, ke = {
1343
+ closed_conversations: "Kapatılan konuşmalar",
1344
+ csat_title: "Görüşmeniz nasıldı?",
1345
+ csat_submitted_title: "Görüşmeyi şöyle değerlendirdiniz",
1346
+ csat_feedback_placeholder: "Bize daha fazlasını anlatın... (isteğe bağlı)"
1347
+ }, ye = {
1257
1348
  write_a_message_placeholder: "پیغام لکھیں...",
1258
1349
  your_issue_has_been_resolved: "آپ کا مسئلہ حل ہو گیا ہے!",
1259
1350
  new_conversation: "نئی گفتگو",
@@ -1268,7 +1359,10 @@ const Z = {
1268
1359
  optional: "اختیاری",
1269
1360
  no_conversations_yet: "ابھی تک کوئی گفتگو نہیں",
1270
1361
  back_to_conversations: "گفتگو پر واپس جائیں",
1271
- closed_conversations: "بند گفتگو"
1362
+ closed_conversations: "بند گفتگو",
1363
+ csat_title: "آپ کی گفتگو کیسی رہی؟",
1364
+ csat_submitted_title: "آپ نے گفتگو کو درجہ دیا",
1365
+ csat_feedback_placeholder: "ہمیں مزید بتائیں... (اختیاری)"
1272
1366
  }, Se = {
1273
1367
  write_a_message_placeholder: "Viết tin nhắn...",
1274
1368
  your_issue_has_been_resolved: "Vấn đề của bạn đã được giải quyết!",
@@ -1284,7 +1378,10 @@ const Z = {
1284
1378
  optional: "Tùy chọn",
1285
1379
  no_conversations_yet: "Chưa có cuộc trò chuyện nào",
1286
1380
  back_to_conversations: "Quay lại cuộc trò chuyện",
1287
- closed_conversations: "Cuộc trò chuyện đã đóng"
1381
+ closed_conversations: "Cuộc trò chuyện đã đóng",
1382
+ csat_title: "Cuộc trò chuyện của bạn thế nào?",
1383
+ csat_submitted_title: "Bạn đã đánh giá cuộc trò chuyện là",
1384
+ csat_feedback_placeholder: "Cho chúng tôi biết thêm... (tùy chọn)"
1288
1385
  }, Ce = {
1289
1386
  write_a_message_placeholder: "写一条消息...",
1290
1387
  your_issue_has_been_resolved: "您的问题已解决!",
@@ -1300,8 +1397,11 @@ const Z = {
1300
1397
  optional: "可选",
1301
1398
  no_conversations_yet: "暂无对话",
1302
1399
  back_to_conversations: "返回对话",
1303
- closed_conversations: "已关闭的对话"
1304
- }, xe = {
1400
+ closed_conversations: "已关闭的对话",
1401
+ csat_title: "您的对话感觉如何?",
1402
+ csat_submitted_title: "您将此对话评价为",
1403
+ csat_feedback_placeholder: "告诉我们更多...(可选)"
1404
+ }, ze = {
1305
1405
  write_a_message_placeholder: "Napišite poruku...",
1306
1406
  your_issue_has_been_resolved: "Vaš problem je riješen!",
1307
1407
  new_conversation: "Novi razgovor",
@@ -1316,8 +1416,11 @@ const Z = {
1316
1416
  optional: "Neobavezno",
1317
1417
  no_conversations_yet: "Još nema razgovora",
1318
1418
  back_to_conversations: "Natrag na razgovore",
1319
- closed_conversations: "Zatvoreni razgovori"
1320
- }, ze = {
1419
+ closed_conversations: "Zatvoreni razgovori",
1420
+ csat_title: "Kakav je bio vaš razgovor?",
1421
+ csat_submitted_title: "Ocijenili ste razgovor kao",
1422
+ csat_feedback_placeholder: "Recite nam više... (neobavezno)"
1423
+ }, xe = {
1321
1424
  write_a_message_placeholder: "Kirjuta sõnum...",
1322
1425
  your_issue_has_been_resolved: "Teie probleem on lahendatud!",
1323
1426
  new_conversation: "Uus vestlus",
@@ -1332,7 +1435,10 @@ const Z = {
1332
1435
  optional: "Valikuline",
1333
1436
  no_conversations_yet: "Vestlusi pole veel",
1334
1437
  back_to_conversations: "Tagasi vestluste juurde",
1335
- closed_conversations: "Suletud vestlused"
1438
+ closed_conversations: "Suletud vestlused",
1439
+ csat_title: "Milline oli teie vestlus?",
1440
+ csat_submitted_title: "Hindasite vestlust kui",
1441
+ csat_feedback_placeholder: "Rääkige meile rohkem... (valikuline)"
1336
1442
  }, Ie = {
1337
1443
  write_a_message_placeholder: "Írjon üzenetet...",
1338
1444
  your_issue_has_been_resolved: "A problémája megoldódott!",
@@ -1348,8 +1454,11 @@ const Z = {
1348
1454
  optional: "Opcionális",
1349
1455
  no_conversations_yet: "Még nincsenek beszélgetések",
1350
1456
  back_to_conversations: "Vissza a beszélgetésekhez",
1351
- closed_conversations: "Lezárt beszélgetések"
1352
- }, Pe = {
1457
+ closed_conversations: "Lezárt beszélgetések",
1458
+ csat_title: "Milyen volt a beszélgetése?",
1459
+ csat_submitted_title: "A beszélgetést így értékelte",
1460
+ csat_feedback_placeholder: "Mondjon többet... (opcionális)"
1461
+ }, je = {
1353
1462
  write_a_message_placeholder: "Skrifaðu skilaboð...",
1354
1463
  your_issue_has_been_resolved: "Málið þitt hefur verið leyst!",
1355
1464
  new_conversation: "Nýtt samtal",
@@ -1364,8 +1473,11 @@ const Z = {
1364
1473
  optional: "Valfrjálst",
1365
1474
  no_conversations_yet: "Engin samtöl ennþá",
1366
1475
  back_to_conversations: "Til baka í samtöl",
1367
- closed_conversations: "Lokuð samtöl"
1368
- }, je = {
1476
+ closed_conversations: "Lokuð samtöl",
1477
+ csat_title: "Hvernig var samtalið þitt?",
1478
+ csat_submitted_title: "Þú gafst samtalinu einkunnina",
1479
+ csat_feedback_placeholder: "Segðu okkur meira... (valfrjálst)"
1480
+ }, Pe = {
1369
1481
  write_a_message_placeholder: "Rakstiet ziņojumu...",
1370
1482
  your_issue_has_been_resolved: "Jūsu problēma ir atrisināta!",
1371
1483
  new_conversation: "Jauna saruna",
@@ -1380,8 +1492,11 @@ const Z = {
1380
1492
  optional: "Neobligāts",
1381
1493
  no_conversations_yet: "Pagaidām nav sarunu",
1382
1494
  back_to_conversations: "Atpakaļ pie sarunām",
1383
- closed_conversations: "Slēgtās sarunas"
1384
- }, Ae = {
1495
+ closed_conversations: "Slēgtās sarunas",
1496
+ csat_title: "Kāda bija jūsu saruna?",
1497
+ csat_submitted_title: "Jūs novērtējāt sarunu kā",
1498
+ csat_feedback_placeholder: "Pastāstiet mums vairāk... (neobligāti)"
1499
+ }, Te = {
1385
1500
  write_a_message_placeholder: "Parašykite žinutę...",
1386
1501
  your_issue_has_been_resolved: "Jūsų problema išspręsta!",
1387
1502
  new_conversation: "Naujas pokalbis",
@@ -1396,8 +1511,11 @@ const Z = {
1396
1511
  optional: "Neprivaloma",
1397
1512
  no_conversations_yet: "Pokalbių dar nėra",
1398
1513
  back_to_conversations: "Grįžti į pokalbius",
1399
- closed_conversations: "Uždaryti pokalbiai"
1400
- }, Te = {
1514
+ closed_conversations: "Uždaryti pokalbiai",
1515
+ csat_title: "Koks buvo jūsų pokalbis?",
1516
+ csat_submitted_title: "Pokalbį įvertinote kaip",
1517
+ csat_feedback_placeholder: "Papasakokite daugiau... (neprivaloma)"
1518
+ }, Ae = {
1401
1519
  write_a_message_placeholder: "Schreift eng Noriicht...",
1402
1520
  your_issue_has_been_resolved: "Äert Problem gouf geléist!",
1403
1521
  new_conversation: "Nei Konversatioun",
@@ -1412,7 +1530,10 @@ const Z = {
1412
1530
  optional: "Fakultativ",
1413
1531
  no_conversations_yet: "Nach keng Konversatiounen",
1414
1532
  back_to_conversations: "Zréck zu de Konversatiounen",
1415
- closed_conversations: "Zougemaachte Konversatiounen"
1533
+ closed_conversations: "Zougemaachte Konversatiounen",
1534
+ csat_title: "Wéi war Är Konversatioun?",
1535
+ csat_submitted_title: "Dir hutt d’Konversatioun bewäert als",
1536
+ csat_feedback_placeholder: "Sot eis méi... (fakultativ)"
1416
1537
  }, Me = {
1417
1538
  write_a_message_placeholder: "Ikteb messaġġ...",
1418
1539
  your_issue_has_been_resolved: "Il-problema tiegħek ġiet riżolta!",
@@ -1428,7 +1549,10 @@ const Z = {
1428
1549
  optional: "Mhux obbligatorju",
1429
1550
  no_conversations_yet: "Għad m'hemmx konversazzjonijiet",
1430
1551
  back_to_conversations: "Lura għall-konversazzjonijiet",
1431
- closed_conversations: "Konversazzjonijiet magħluqa"
1552
+ closed_conversations: "Konversazzjonijiet magħluqa",
1553
+ csat_title: "Kif kienet il-konversazzjoni tiegħek?",
1554
+ csat_submitted_title: "Int ivvalutajt il-konversazzjoni bħala",
1555
+ csat_feedback_placeholder: "Għidilna aktar... (mhux obbligatorju)"
1432
1556
  }, Ee = {
1433
1557
  write_a_message_placeholder: "Skriv en melding...",
1434
1558
  your_issue_has_been_resolved: "Saken din er løst!",
@@ -1444,7 +1568,10 @@ const Z = {
1444
1568
  optional: "Valgfritt",
1445
1569
  no_conversations_yet: "Ingen samtaler ennå",
1446
1570
  back_to_conversations: "Tilbake til samtaler",
1447
- closed_conversations: "Lukkede samtaler"
1571
+ closed_conversations: "Lukkede samtaler",
1572
+ csat_title: "Hvordan var samtalen din?",
1573
+ csat_submitted_title: "Du vurderte samtalen som",
1574
+ csat_feedback_placeholder: "Fortell oss mer... (valgfritt)"
1448
1575
  }, Le = {
1449
1576
  write_a_message_placeholder: "Napíšte správu...",
1450
1577
  your_issue_has_been_resolved: "Váš problém bol vyriešený!",
@@ -1460,59 +1587,62 @@ const Z = {
1460
1587
  optional: "Voliteľné",
1461
1588
  no_conversations_yet: "Zatiaľ žiadne konverzácie",
1462
1589
  back_to_conversations: "Späť na konverzácie",
1463
- closed_conversations: "Uzavreté konverzácie"
1464
- }, O = {
1590
+ closed_conversations: "Uzavreté konverzácie",
1591
+ csat_title: "Aká bola vaša konverzácia?",
1592
+ csat_submitted_title: "Konverzáciu ste ohodnotili ako",
1593
+ csat_feedback_placeholder: "Povedzte nám viac... (nepovinné)"
1594
+ }, U = {
1465
1595
  ar: Z,
1466
- bn: X,
1467
- bg: Q,
1596
+ bn: Q,
1597
+ bg: X,
1468
1598
  cs: ee,
1469
1599
  da: te,
1470
1600
  de: ae,
1471
1601
  el: se,
1472
1602
  en: oe,
1473
1603
  es: ne,
1474
- et: ze,
1604
+ et: xe,
1475
1605
  fi: re,
1476
1606
  fil: ie,
1477
1607
  fr: le,
1478
1608
  hi: ce,
1479
- hr: xe,
1609
+ hr: ze,
1480
1610
  hu: Ie,
1481
- is: Pe,
1611
+ is: je,
1482
1612
  it: _e,
1483
1613
  ja: he,
1484
- ko: ue,
1485
- lb: Te,
1486
- lt: Ae,
1487
- lv: je,
1614
+ ko: de,
1615
+ lb: Ae,
1616
+ lt: Te,
1617
+ lv: Pe,
1488
1618
  mt: Me,
1489
1619
  nb: Ee,
1490
- nl: de,
1491
- no: ge,
1492
- pl: me,
1620
+ nl: ue,
1621
+ no: me,
1622
+ pl: ge,
1493
1623
  pt: pe,
1494
1624
  ro: ve,
1495
1625
  ru: fe,
1496
1626
  sk: Le,
1497
1627
  sv: be,
1498
- th: we,
1499
- tr: ye,
1500
- ur: ke,
1628
+ th: ke,
1629
+ tr: we,
1630
+ ur: ye,
1501
1631
  vi: Se,
1502
1632
  "zh-cn": Ce
1503
- }, Ue = Object.keys(O);
1504
- function Fe(_) {
1505
- return Ue.includes(_);
1633
+ }, Oe = Object.keys(U);
1634
+ function He(_) {
1635
+ return Oe.includes(_);
1506
1636
  }
1507
- function Be(_, o, i) {
1637
+ function Fe(_, o, i) {
1508
1638
  var l;
1509
- return ((l = i == null ? void 0 : i[o]) == null ? void 0 : l[_]) || O[o][_] || "";
1639
+ return ((l = i == null ? void 0 : i[o]) == null ? void 0 : l[_]) || U[o][_] || "";
1510
1640
  }
1511
1641
  export {
1512
1642
  S as PrimitiveState,
1513
1643
  E as WidgetCtx,
1514
- Be as getTranslation,
1644
+ Fe as getTranslation,
1515
1645
  K as isExhaustive,
1516
- Fe as isSupportedLanguage
1646
+ He as isSupportedLanguage
1517
1647
  };
1518
1648
  //# sourceMappingURL=index.js.map