@opencx/widget-core 4.0.41 → 4.0.43

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.
package/dist/index.js CHANGED
@@ -1,43 +1,43 @@
1
- import D from "openapi-fetch";
2
- import N from "lodash.isequal";
3
- import { v4 as U } from "uuid";
4
- const F = (_) => {
1
+ import R from "openapi-fetch";
2
+ import D from "lodash.isequal";
3
+ import { v4 as E } from "uuid";
4
+ const V = (_) => {
5
5
  console.log(_.error);
6
- }, B = (_) => {
7
- const a = D({
6
+ }, F = (_) => {
7
+ const a = R({
8
8
  baseUrl: _.baseUrl
9
- }), o = {
9
+ }), n = {
10
10
  onRequest: _.onRequest,
11
11
  onResponse: _.onResponse,
12
- onError: _.onError || F
12
+ onError: _.onError || V
13
13
  };
14
- return a.use(o), a;
14
+ return a.use(n), a;
15
15
  };
16
- class E {
16
+ class A {
17
17
  constructor({ config: a }) {
18
18
  var h, s;
19
19
  this.userToken = null, this.constructClientOptions = (e) => {
20
- const t = this.config.apiUrl || "https://api.open.cx", n = {
20
+ const t = this.config.apiUrl || "https://api.open.cx", o = {
21
21
  "X-Bot-Token": this.config.token,
22
22
  "Content-Type": "application/json",
23
23
  Accept: "application/json",
24
24
  Authorization: e ? `Bearer ${e}` : void 0
25
25
  };
26
- return { baseUrl: t, headers: n };
26
+ return { baseUrl: t, headers: o };
27
27
  }, this.createOpenAPIClient = ({
28
28
  baseUrl: e,
29
29
  headers: t
30
- }) => B({
30
+ }) => F({
31
31
  baseUrl: e,
32
- onRequest: ({ request: n }) => {
32
+ onRequest: ({ request: o }) => {
33
33
  Object.entries(t).forEach(([i, l]) => {
34
- l && n.headers.set(i, l);
34
+ l && o.headers.set(i, l);
35
35
  });
36
36
  }
37
37
  }), this.setAuthToken = (e) => {
38
38
  this.userToken = e;
39
- const { baseUrl: t, headers: n } = this.constructClientOptions(e);
40
- this.client = this.createOpenAPIClient({ baseUrl: t, headers: n });
39
+ const { baseUrl: t, headers: o } = this.constructClientOptions(e);
40
+ this.client = this.createOpenAPIClient({ baseUrl: t, headers: o });
41
41
  }, this.getExternalWidgetConfig = async () => await this.client.GET("/backend/widget/v2/config", {
42
42
  params: { header: { "X-Bot-Token": this.config.token } }
43
43
  }), this.sendMessage = async (e, t) => await this.client.POST("/backend/widget/v2/chat/send", {
@@ -54,24 +54,24 @@ class E {
54
54
  }), this.pollSessionAndHistory = async ({
55
55
  sessionId: e,
56
56
  lastMessageTimestamp: t,
57
- abortSignal: n
57
+ abortSignal: o
58
58
  }) => {
59
59
  const i = t ? { lastMessageTimestamp: t } : void 0;
60
60
  return await this.client.GET("/backend/widget/v2/poll/{sessionId}", {
61
61
  params: { path: { sessionId: e }, query: i },
62
- signal: n
62
+ signal: o
63
63
  });
64
64
  }, this.getSessions = async ({
65
65
  cursor: e,
66
66
  filters: t,
67
- abortSignal: n
67
+ abortSignal: o
68
68
  }) => await this.client.GET("/backend/widget/v2/sessions", {
69
69
  params: { query: { cursor: e, filters: JSON.stringify(t) } },
70
- signal: n
70
+ signal: o
71
71
  }), this.uploadFile = async ({
72
72
  file: e,
73
73
  abortSignal: t,
74
- onProgress: n
74
+ onProgress: o
75
75
  }) => new Promise((i, l) => {
76
76
  var y;
77
77
  const c = new FormData();
@@ -84,9 +84,9 @@ class E {
84
84
  return;
85
85
  }
86
86
  u.upload.addEventListener("progress", (v) => {
87
- if (v.lengthComputable && n) {
88
- const f = Math.round(v.loaded / v.total * 100);
89
- n(f);
87
+ if (v.lengthComputable && o) {
88
+ const b = Math.round(v.loaded / v.total * 100);
89
+ o(b);
90
90
  }
91
91
  }), u.addEventListener("load", () => {
92
92
  if (u.status >= 200 && u.status < 300)
@@ -111,39 +111,39 @@ class E {
111
111
  }), this.createStateCheckpoint = async (e) => await this.client.POST("/backend/widget/v2/checkpoint", {
112
112
  body: e
113
113
  }), this.submitCsat = async (e) => await this.client.POST("/backend/widget/v2/submit-csat", { body: e }), this.config = a, this.userToken = ((h = a.user) == null ? void 0 : h.token) || null;
114
- const { baseUrl: o, headers: r } = this.constructClientOptions(
114
+ const { baseUrl: n, headers: r } = this.constructClientOptions(
115
115
  (s = a.user) == null ? void 0 : s.token
116
116
  );
117
- this.client = this.createOpenAPIClient({ baseUrl: o, headers: r });
117
+ this.client = this.createOpenAPIClient({ baseUrl: n, headers: r });
118
118
  }
119
119
  }
120
- function V(_, a) {
120
+ function B(_, a) {
121
121
  console.error(`Missing case for ${_} in ${a}`);
122
122
  }
123
123
  class S {
124
124
  constructor(a) {
125
- this.subscribers = /* @__PURE__ */ new Set(), this.get = () => this.state, this.set = (o) => {
126
- N(this.state, o) || (this.state = o, this.notifySubscribers(o));
127
- }, this.setPartial = (o) => {
128
- if (o == null) return;
129
- const r = { ...this.state, ...o };
125
+ this.subscribers = /* @__PURE__ */ new Set(), this.get = () => this.state, this.set = (n) => {
126
+ D(this.state, n) || (this.state = n, this.notifySubscribers(n));
127
+ }, this.setPartial = (n) => {
128
+ if (n == null) return;
129
+ const r = { ...this.state, ...n };
130
130
  this.set(r);
131
131
  }, this.reset = () => {
132
132
  this.set(this.initialState);
133
- }, this.notifySubscribers = (o) => {
133
+ }, this.notifySubscribers = (n) => {
134
134
  Array.from(this.subscribers).forEach((h) => {
135
135
  try {
136
- h(o);
136
+ h(n);
137
137
  } catch (s) {
138
138
  console.error(s);
139
139
  }
140
140
  });
141
- }, this.subscribe = (o) => (this.subscribers.add(o), () => {
142
- this.subscribers.delete(o);
141
+ }, this.subscribe = (n) => (this.subscribers.add(n), () => {
142
+ this.subscribers.delete(n);
143
143
  }), this.state = a, this.initialState = a;
144
144
  }
145
145
  }
146
- class O {
146
+ class L {
147
147
  constructor() {
148
148
  this.state = new S({
149
149
  isPolling: !1,
@@ -151,7 +151,7 @@ class O {
151
151
  }), this.abortController = new AbortController(), this.reset = () => {
152
152
  var a;
153
153
  this.abortController.abort("Resetting poller"), (a = this.stopPolling) == null || a.call(this), this.stopPolling = null;
154
- }, this.stopPolling = null, this.startPolling = (a, o) => {
154
+ }, this.stopPolling = null, this.startPolling = (a, n) => {
155
155
  if (this.stopPolling) return;
156
156
  const r = [], h = async () => {
157
157
  this.abortController = new AbortController(), this.state.setPartial({ isPolling: !0 });
@@ -164,7 +164,7 @@ class O {
164
164
  } finally {
165
165
  this.state.setPartial({ isPolling: !1 });
166
166
  }
167
- this.abortController.signal.aborted ? console.log("Poller aborted, not scheduling anymore") : r.push(setTimeout(h, o));
167
+ this.abortController.signal.aborted ? console.log("Poller aborted, not scheduling anymore") : r.push(setTimeout(h, n));
168
168
  };
169
169
  h(), this.stopPolling = () => {
170
170
  r.forEach(clearTimeout), this.state.reset();
@@ -172,23 +172,23 @@ class O {
172
172
  };
173
173
  }
174
174
  }
175
- function L(_) {
175
+ function U(_) {
176
176
  try {
177
177
  const a = _();
178
- return a instanceof Promise ? a.then((o) => ({ data: o })).catch((o) => ({ error: o })) : { data: a };
178
+ return a instanceof Promise ? a.then((n) => ({ data: n })).catch((n) => ({ error: n })) : { data: a };
179
179
  } catch (a) {
180
180
  return { error: a };
181
181
  }
182
182
  }
183
- class H {
183
+ class K {
184
184
  constructor({
185
185
  api: a,
186
- config: o,
186
+ config: n,
187
187
  sessionCtx: r,
188
188
  messageCtx: h,
189
189
  sessionPollingIntervalSeconds: s
190
190
  }) {
191
- this.poller = new O(), this.fetchSessionAndFullHistoryAbortController = new AbortController(), this.registerPolling = () => {
191
+ this.poller = new L(), 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 });
@@ -210,18 +210,18 @@ class H {
210
210
  }, this.fetchSessionAndHistory = async ({
211
211
  sessionId: e,
212
212
  abortSignal: t,
213
- fetchFullHistory: n = !1
213
+ fetchFullHistory: o = !1
214
214
  }) => {
215
215
  var u;
216
216
  this.messageCtx.state.get().messages.length === 0 && this.messageCtx.state.setPartial({ isInitialFetchLoading: !0 });
217
217
  const i = this.messageCtx.state.get().messages, l = i.length > 0 ? ((u = i[i.length - 1]) == null ? void 0 : u.timestamp) ?? void 0 : void 0, { data: c } = await this.api.pollSessionAndHistory({
218
218
  sessionId: e,
219
219
  abortSignal: t,
220
- lastMessageTimestamp: n ? void 0 : l
220
+ lastMessageTimestamp: o ? void 0 : l
221
221
  });
222
222
  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
223
  const p = this.messageCtx.state.get().messages, w = c.history.map(this.mapHistoryToMessage).filter((d) => d !== null).filter(
224
- (d) => !p.some((C) => C.id === d.id)
224
+ (d) => !p.some((k) => k.id === d.id)
225
225
  );
226
226
  this.messageCtx.state.setPartial({
227
227
  messages: [...p, ...w]
@@ -229,7 +229,7 @@ class H {
229
229
  }
230
230
  this.messageCtx.state.get().isInitialFetchLoading && this.messageCtx.state.setPartial({ isInitialFetchLoading: !1 });
231
231
  }, this.mapHistoryToMessage = (e) => {
232
- var n;
232
+ var o;
233
233
  const t = {
234
234
  id: e.publicId,
235
235
  timestamp: e.sentAt || "",
@@ -268,7 +268,7 @@ class H {
268
268
  component: "bot_message",
269
269
  agent: {
270
270
  id: null,
271
- name: ((n = this.config.bot) == null ? void 0 : n.name) || "",
271
+ name: ((o = this.config.bot) == null ? void 0 : o.name) || "",
272
272
  isAi: !0,
273
273
  // Do not set avatarUrl from config here... let it be taken from the config at render time
274
274
  avatarUrl: null,
@@ -326,7 +326,7 @@ class H {
326
326
  case "none":
327
327
  return null;
328
328
  default:
329
- return V(
329
+ return B(
330
330
  e.systemMessagePayload,
331
331
  this.constructSystemMessage.name
332
332
  ), null;
@@ -335,17 +335,17 @@ class H {
335
335
  const t = e.result;
336
336
  if (t === null || typeof t != "object") return t;
337
337
  if ("responseBodyText" in t && typeof t.responseBodyText == "string") {
338
- const n = t.responseBodyText, i = L(() => JSON.parse(n)).data;
338
+ const o = t.responseBodyText, i = U(() => JSON.parse(o)).data;
339
339
  if (i) return i;
340
340
  }
341
341
  return e.result;
342
- }, this.api = a, this.config = o, this.sessionCtx = r, this.messageCtx = h, this.sessionPollingIntervalSeconds = s, this.registerPolling();
342
+ }, this.api = a, this.config = n, this.sessionCtx = r, this.messageCtx = h, this.sessionPollingIntervalSeconds = s, this.registerPolling();
343
343
  }
344
344
  }
345
- class q {
345
+ class H {
346
346
  constructor({
347
347
  config: a,
348
- api: o,
348
+ api: n,
349
349
  storageCtx: r
350
350
  }) {
351
351
  var h;
@@ -353,25 +353,25 @@ class q {
353
353
  var s;
354
354
  return !!(!((s = this.state.get().contact) != null && s.token) && this.config.collectUserData);
355
355
  }, this.autoCreateUnverifiedUserIfNotExists = async () => {
356
- var s, e, t, n, i, l, c, u, p, w, d, C, y, v;
356
+ var s, e, t, o, i, l, c, u, p, w, d, k, y, v;
357
357
  if (!((s = this.config.user) != null && s.token)) {
358
358
  if (this.config.collectUserData && !((t = (e = this.config.user) == null ? void 0 : e.data) != null && t.email)) {
359
- if ((n = this.config.extraDataCollectionFields) != null && n.length)
359
+ if ((o = this.config.extraDataCollectionFields) != null && o.length)
360
360
  return;
361
- const f = await ((i = this.storageCtx) == null ? void 0 : i.getContactToken());
362
- f && await this.setUnverifiedContact(f);
361
+ const b = await ((i = this.storageCtx) == null ? void 0 : i.getContactToken());
362
+ b && await this.setUnverifiedContact(b);
363
363
  return;
364
364
  }
365
365
  if (!((c = (l = this.config.user) == null ? void 0 : l.data) != null && c.email)) {
366
- const f = await ((u = this.storageCtx) == null ? void 0 : u.getContactToken());
367
- if (f) {
368
- await this.setUnverifiedContact(f);
366
+ const b = await ((u = this.storageCtx) == null ? void 0 : u.getContactToken());
367
+ if (b) {
368
+ await this.setUnverifiedContact(b);
369
369
  return;
370
370
  }
371
371
  }
372
372
  await this.createUnverifiedContact({
373
373
  email: (w = (p = this.config.user) == null ? void 0 : p.data) == null ? void 0 : w.email,
374
- non_verified_name: (C = (d = this.config.user) == null ? void 0 : d.data) == null ? void 0 : C.name,
374
+ non_verified_name: (k = (d = this.config.user) == null ? void 0 : d.data) == null ? void 0 : k.name,
375
375
  non_verified_custom_data: (v = (y = this.config.user) == null ? void 0 : y.data) == null ? void 0 : v.customData
376
376
  });
377
377
  }
@@ -388,10 +388,10 @@ class q {
388
388
  this.state.setPartial({ isCreatingUnverifiedContact: !1 });
389
389
  }
390
390
  }, this.setUnverifiedContact = async (s) => {
391
- var n, i, l, c;
392
- const e = await ((n = this.storageCtx) == null ? void 0 : n.getExternalContactId()), t = ((i = this.config.user) == null ? void 0 : i.externalId) || e || U();
391
+ var o, i, l, c;
392
+ const e = await ((o = this.storageCtx) == null ? void 0 : o.getExternalContactId()), t = ((i = this.config.user) == null ? void 0 : i.externalId) || e || E();
393
393
  this.api.setAuthToken(s), await ((l = this.storageCtx) == null ? void 0 : l.setContactToken(s)), await ((c = this.storageCtx) == null ? void 0 : c.setExternalContactId(t)), this.state.setPartial({ contact: { token: s, externalId: t } });
394
- }, this.config = a, this.storageCtx = r, this.api = o, this.state = new S({
394
+ }, this.config = a, this.storageCtx = r, this.api = n, this.state = new S({
395
395
  contact: (h = a.user) != null && h.token ? {
396
396
  token: a.user.token,
397
397
  // Set optional externalId from config... not local storage
@@ -403,13 +403,13 @@ class q {
403
403
  }), this.autoCreateUnverifiedUserIfNotExists();
404
404
  }
405
405
  }
406
- function k() {
407
- return U();
406
+ function C() {
407
+ return E();
408
408
  }
409
- class K {
409
+ class J {
410
410
  constructor({
411
411
  config: a,
412
- api: o,
412
+ api: n,
413
413
  sessionCtx: r,
414
414
  messageCtx: h
415
415
  }) {
@@ -418,7 +418,7 @@ class K {
418
418
  const e = (l = this.sessionCtx.sessionState.get().session) == null ? void 0 : l.id;
419
419
  if (!e)
420
420
  return { data: null, error: "No session id found" };
421
- const t = k();
421
+ const t = C();
422
422
  this.messageCtx.state.setPartial({
423
423
  messages: [
424
424
  ...this.messageCtx.state.get().messages,
@@ -436,23 +436,23 @@ class K {
436
436
  }
437
437
  ]
438
438
  });
439
- const { data: n, error: i } = await this.api.submitCsat({
439
+ const { data: o, error: i } = await this.api.submitCsat({
440
440
  ...s,
441
441
  system_message_uuid: t,
442
442
  session_id: e
443
443
  });
444
- return { data: n, error: i };
445
- }, this.config = a, this.api = o, this.sessionCtx = r, this.messageCtx = h;
444
+ return { data: o, error: i };
445
+ }, this.config = a, this.api = n, this.sessionCtx = r, this.messageCtx = h;
446
446
  }
447
447
  }
448
- class Y {
448
+ class q {
449
449
  constructor({
450
450
  config: a,
451
- api: o,
451
+ api: n,
452
452
  contactCtx: r,
453
453
  sessionsPollingIntervalSeconds: h
454
454
  }) {
455
- this.sessionsRefresher = new O(), this.sessionState = new S({
455
+ this.sessionsRefresher = new L(), this.sessionState = new S({
456
456
  session: null,
457
457
  isCreatingSession: !1,
458
458
  isResolvingSession: !1
@@ -481,7 +481,7 @@ class Y {
481
481
  Object.entries(this.config.sessionCustomData || {}).map(
482
482
  ([s, e]) => {
483
483
  var t;
484
- return typeof e == "string" ? [s, e] : typeof e == "boolean" ? [s, e] : typeof e == "number" ? [s, e] : [s, ((t = L(() => JSON.stringify(e))) == null ? void 0 : t.data) || ""];
484
+ return typeof e == "string" ? [s, e] : typeof e == "boolean" ? [s, e] : typeof e == "number" ? [s, e] : [s, ((t = U(() => JSON.stringify(e))) == null ? void 0 : t.data) || ""];
485
485
  }
486
486
  )
487
487
  ), this.createSession = async () => {
@@ -490,10 +490,10 @@ class Y {
490
490
  const s = (i = this.contactCtx.state.get().contact) == null ? void 0 : i.externalId, e = {
491
491
  ...this.getParsedCustomData(),
492
492
  ...s ? { external_id: s } : {}
493
- }, { data: t, error: n } = await this.api.createSession({
493
+ }, { data: t, error: o } = await this.api.createSession({
494
494
  customData: Object.keys(e).length > 0 ? e : void 0
495
495
  });
496
- return t ? (this.sessionState.setPartial({ session: t, isCreatingSession: !1 }), t) : (this.sessionState.setPartial({ isCreatingSession: !1 }), console.error("Failed to create session:", n), null);
496
+ return t ? (this.sessionState.setPartial({ session: t, isCreatingSession: !1 }), t) : (this.sessionState.setPartial({ isCreatingSession: !1 }), console.error("Failed to create session:", o), null);
497
497
  }, this.loadMoreSessions = async () => {
498
498
  if (this.sessionsState.get().isLastPage) return;
499
499
  const { data: s } = await this.getSessions({
@@ -501,7 +501,7 @@ class Y {
501
501
  });
502
502
  if (s) {
503
503
  const t = [...this.sessionsState.get().data, ...s.items].filter(
504
- (n, i, l) => i === l.findIndex((c) => n.id === c.id)
504
+ (o, i, l) => i === l.findIndex((c) => o.id === c.id)
505
505
  );
506
506
  this.sessionsState.setPartial({
507
507
  data: t,
@@ -510,9 +510,9 @@ class Y {
510
510
  });
511
511
  }
512
512
  }, this.getSessions = async ({ cursor: s }) => {
513
- var t, n;
513
+ var t, o;
514
514
  if (!((t = this.contactCtx.state.get().contact) != null && t.token)) return { data: null };
515
- const e = (n = this.contactCtx.state.get().contact) == null ? void 0 : n.externalId;
515
+ const e = (o = this.contactCtx.state.get().contact) == null ? void 0 : o.externalId;
516
516
  return await this.api.getSessions({
517
517
  cursor: s,
518
518
  filters: e ? {
@@ -521,7 +521,7 @@ class Y {
521
521
  });
522
522
  }, this.setSessions = (s) => {
523
523
  const e = [...s, ...this.sessionsState.get().data].filter(
524
- (t, n, i) => n === i.findIndex((l) => t.id === l.id)
524
+ (t, o, i) => o === i.findIndex((l) => t.id === l.id)
525
525
  );
526
526
  this.sessionsState.setPartial({ data: e });
527
527
  }, this.refreshSessions = async () => {
@@ -540,18 +540,18 @@ class Y {
540
540
  var i;
541
541
  const e = (i = this.sessionState.get().session) == null ? void 0 : i.id;
542
542
  if (!e) return;
543
- const { data: t, error: n } = await this.api.createStateCheckpoint({
543
+ const { data: t, error: o } = await this.api.createStateCheckpoint({
544
544
  session_id: e,
545
545
  payload: s
546
546
  });
547
547
  return t != null && t.success ? { success: !0 } : { success: !1 };
548
- }, this.config = a, this.api = o, this.contactCtx = r, this.sessionsPollingIntervalSeconds = h, this.registerSessionsRefresherWrapper();
548
+ }, this.config = a, this.api = n, this.contactCtx = r, this.sessionsPollingIntervalSeconds = h, this.registerSessionsRefresherWrapper();
549
549
  }
550
550
  }
551
- class $ {
551
+ class Y {
552
552
  constructor({
553
553
  config: a,
554
- api: o,
554
+ api: n,
555
555
  sessionCtx: r,
556
556
  contactCtx: h
557
557
  }) {
@@ -564,7 +564,7 @@ class $ {
564
564
  }), this.sendMessageAbortController = new AbortController(), this.reset = () => {
565
565
  this.sendMessageAbortController.abort("Resetting chat"), this.state.reset();
566
566
  }, this.sendMessage = async (s) => {
567
- var e, t, n, i, l, c, u, p, w;
567
+ var e, t, o, i, l, c, u, p, w;
568
568
  try {
569
569
  if (!s.content.trim() && (!s.attachments || s.attachments.length === 0)) {
570
570
  console.warn(
@@ -572,9 +572,9 @@ class $ {
572
572
  );
573
573
  return;
574
574
  }
575
- const d = this.sessionCtx.sessionState.get().session, y = (d == null ? void 0 : d.assignee.kind) === "ai", v = this.state.get().isSendingMessageToAI, f = this.state.get().messages.at(-1);
575
+ const d = this.sessionCtx.sessionState.get().session, y = (d == null ? void 0 : d.assignee.kind) === "ai", v = this.state.get().isSendingMessageToAI, b = this.state.get().messages.at(-1);
576
576
  if (v || // If last message is from user, then bot response did not arrive yet
577
- y && (f == null ? void 0 : f.type) === "USER") {
577
+ y && (b == null ? void 0 : b.type) === "USER") {
578
578
  console.warn("Cannot send messages while awaiting AI response");
579
579
  return;
580
580
  }
@@ -583,9 +583,9 @@ class $ {
583
583
  isSendingMessage: !0,
584
584
  isSendingMessageToAI: !!y || !d
585
585
  });
586
- const P = this.state.get().messages, A = !((e = this.sessionCtx.sessionState.get().session) != null && e.id) && P.length === 0 && ((t = this.config.advancedInitialMessages) == null ? void 0 : t.some((g) => g.persistent)), T = A ? (this.config.advancedInitialMessages || []).filter((g) => g.persistent).map(
586
+ const I = this.state.get().messages, P = !((e = this.sessionCtx.sessionState.get().session) != null && e.id) && I.length === 0 && ((t = this.config.advancedInitialMessages) == null ? void 0 : t.some((g) => g.persistent)), j = P ? (this.config.advancedInitialMessages || []).filter((g) => g.persistent).map(
587
587
  (g) => ({
588
- id: k(),
588
+ id: C(),
589
589
  component: "bot_message",
590
590
  type: "AI",
591
591
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
@@ -594,34 +594,34 @@ class $ {
594
594
  },
595
595
  agent: this.config.bot ? { ...this.config.bot, isAi: !0, id: null } : void 0
596
596
  })
597
- ) : [], I = this.toUserMessage(
597
+ ) : [], z = this.toUserMessage(
598
598
  s.content.trim(),
599
599
  s.attachments || void 0
600
600
  );
601
601
  if (this.state.setPartial({
602
602
  messages: [
603
- ...T,
604
- ...P,
605
- I
603
+ ...j,
604
+ ...I,
605
+ z
606
606
  ]
607
- }), !((n = this.sessionCtx.sessionState.get().session) != null && n.id)) {
607
+ }), !((o = this.sessionCtx.sessionState.get().session) != null && o.id)) {
608
608
  if (!await this.sessionCtx.createSession()) {
609
609
  console.error("Failed to create session");
610
610
  return;
611
611
  }
612
612
  this.sessionCtx.refreshSessions();
613
613
  }
614
- const M = (i = this.sessionCtx.sessionState.get().session) == null ? void 0 : i.id;
615
- if (!M) return;
614
+ const T = (i = this.sessionCtx.sessionState.get().session) == null ? void 0 : i.id;
615
+ if (!T) return;
616
616
  const { data: m } = await this.api.sendMessage(
617
617
  {
618
- uuid: I.id,
618
+ uuid: z.id,
619
619
  bot_token: this.config.token,
620
620
  headers: this.config.headers,
621
621
  query_params: this.config.queryParams,
622
622
  body_properties: this.config.bodyProperties,
623
- session_id: M,
624
- content: I.content,
623
+ session_id: T,
624
+ content: z.content,
625
625
  attachments: s.attachments,
626
626
  clientContext: this.config.context,
627
627
  custom_data: {
@@ -630,7 +630,7 @@ class $ {
630
630
  },
631
631
  language: this.config.language,
632
632
  exit_mode_prompt: s.exitModePrompt,
633
- initial_messages: A ? T.map((g) => ({
633
+ initial_messages: P ? j.map((g) => ({
634
634
  uuid: g.id,
635
635
  content: g.data.message
636
636
  })) : void 0
@@ -642,7 +642,7 @@ class $ {
642
642
  if (g) {
643
643
  const x = this.state.get().messages;
644
644
  if (!!x.some(
645
- (R) => R.id === g.id
645
+ (O) => O.id === g.id
646
646
  )) {
647
647
  this.state.setPartial({
648
648
  lastAIResMightSolveUserIssue: ((l = m.autopilotResponse) == null ? void 0 : l.mightSolveUserIssue) || ((c = m.uiResponse) == null ? void 0 : c.mightSolveUserIssue)
@@ -673,14 +673,14 @@ class $ {
673
673
  }
674
674
  }, this.toUserMessage = (s, e) => {
675
675
  const t = (() => {
676
- const n = this.contactCtx.state.get().extraCollectedData;
677
- return this.state.get().messages.length === 0 && n && Object.keys(n).length > 0 ? `${Object.entries(n).filter(([l, c]) => !!c).map(([l, c]) => `${l}: ${c}`).join(`
676
+ const o = this.contactCtx.state.get().extraCollectedData;
677
+ return this.state.get().messages.length === 0 && o && Object.keys(o).length > 0 ? `${Object.entries(o).filter(([l, c]) => !!c).map(([l, c]) => `${l}: ${c}`).join(`
678
678
  `)}
679
679
 
680
680
  ${s}` : s;
681
681
  })();
682
682
  return {
683
- id: k(),
683
+ id: C(),
684
684
  type: "USER",
685
685
  content: t,
686
686
  deliveredAt: (/* @__PURE__ */ new Date()).toISOString(),
@@ -691,7 +691,7 @@ ${s}` : s;
691
691
  var e;
692
692
  return s.success && s.autopilotResponse ? {
693
693
  type: "AI",
694
- id: s.autopilotResponse.id || k(),
694
+ id: s.autopilotResponse.id || C(),
695
695
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
696
696
  component: "bot_message",
697
697
  agent: this.config.bot ? {
@@ -712,7 +712,7 @@ ${s}` : s;
712
712
  } : null;
713
713
  }, this.toBotErrorMessage = (s) => ({
714
714
  type: "AI",
715
- id: k(),
715
+ id: C(),
716
716
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
717
717
  component: "bot_message",
718
718
  data: {
@@ -720,13 +720,13 @@ ${s}` : s;
720
720
  variant: "error",
721
721
  action: void 0
722
722
  }
723
- }), this.config = a, this.api = o, this.sessionCtx = r, this.contactCtx = h;
723
+ }), this.config = a, this.api = n, this.sessionCtx = r, this.contactCtx = h;
724
724
  }
725
725
  }
726
- class J {
726
+ class G {
727
727
  constructor({
728
728
  config: a,
729
- contactCtx: o,
729
+ contactCtx: n,
730
730
  sessionCtx: r,
731
731
  resetChat: h
732
732
  }) {
@@ -739,8 +739,8 @@ class J {
739
739
  });
740
740
  }), this.sessionCtx.sessionsState.subscribe(
741
741
  ({ isInitialFetchLoading: e, data: t }) => {
742
- var n, i, l, c;
743
- if ((n = this.config.router) != null && n.chatScreenOnly && // Do not route to a chat if we are currently inside one already
742
+ var o, i, l, c;
743
+ if ((o = this.config.router) != null && o.chatScreenOnly && // Do not route to a chat if we are currently inside one already
744
744
  // This also applies to newly created sessions; the new session will be in `sessionState` before it is refreshed and included in `sessionsState`
745
745
  !((i = this.sessionCtx.sessionState.get().session) != null && i.id)) {
746
746
  const u = (l = t.find((p) => p.isOpened)) == null ? void 0 : l.id;
@@ -753,20 +753,20 @@ class J {
753
753
  this.resetChat(), this.state.setPartial({ screen: "sessions" });
754
754
  }, this.toChatScreen = (e) => {
755
755
  if (this.resetChat(), e) {
756
- const t = this.sessionCtx.sessionsState.get().data.find((n) => n.id === e);
756
+ const t = this.sessionCtx.sessionsState.get().data.find((o) => o.id === e);
757
757
  if (!t) return;
758
758
  this.sessionCtx.sessionState.setPartial({ session: t });
759
759
  }
760
760
  this.state.setPartial({ screen: "chat" });
761
- }, this.config = a, this.contactCtx = o, this.sessionCtx = r, this.resetChat = h, this.state = new S({
761
+ }, this.config = a, this.contactCtx = n, this.sessionCtx = r, this.resetChat = h, this.state = new S({
762
762
  screen: this.contactCtx.shouldCollectData() ? "welcome" : (s = this.config.router) != null && s.chatScreenOnly ? "chat" : "sessions"
763
763
  }), this.registerRoutingListener();
764
764
  }
765
765
  }
766
- class G {
766
+ class $ {
767
767
  constructor({
768
768
  storage: a,
769
- config: o
769
+ config: n
770
770
  }) {
771
771
  this.KEYS = {
772
772
  contactToken: (r) => `opencx-widget:org-token-${r}:contact-token`,
@@ -775,48 +775,48 @@ class G {
775
775
  await this.storage.set(this.KEYS.contactToken(this.config.token), r);
776
776
  }, this.getContactToken = async () => this.storage.get(this.KEYS.contactToken(this.config.token)), this.setExternalContactId = async (r) => {
777
777
  await this.storage.set(this.KEYS.externalContactId(this.config.token), r);
778
- }, this.getExternalContactId = async () => this.storage.get(this.KEYS.externalContactId(this.config.token)), this.storage = a, this.config = o;
778
+ }, this.getExternalContactId = async () => this.storage.get(this.KEYS.externalContactId(this.config.token)), this.storage = a, this.config = n;
779
779
  }
780
780
  }
781
- const b = class b {
781
+ const f = class f {
782
782
  constructor({
783
783
  config: a,
784
- storage: o,
784
+ storage: n,
785
785
  modes: r,
786
786
  org: h
787
787
  }) {
788
788
  if (this.modes = [], this.resetChat = () => {
789
789
  this.sessionCtx.reset(), this.messageCtx.reset();
790
- }, !b.pollingIntervalsSeconds)
790
+ }, !f.pollingIntervalsSeconds)
791
791
  throw Error(
792
792
  "Widget polling values are not defined, did you call WidgetCtx.initialize()"
793
793
  );
794
- this.config = a, this.org = h, this.api = new E({ config: a }), this.storageCtx = o ? new G({ storage: o, config: a }) : void 0, this.modes = r, this.contactCtx = new q({
794
+ this.config = a, this.org = h, this.api = new A({ config: a }), this.storageCtx = n ? new $({ storage: n, config: a }) : void 0, this.modes = r, this.contactCtx = new H({
795
795
  api: this.api,
796
796
  config: this.config,
797
797
  storageCtx: this.storageCtx
798
- }), this.sessionCtx = new Y({
798
+ }), this.sessionCtx = new q({
799
799
  config: this.config,
800
800
  api: this.api,
801
801
  contactCtx: this.contactCtx,
802
- sessionsPollingIntervalSeconds: b.pollingIntervalsSeconds.sessions
803
- }), this.messageCtx = new $({
802
+ sessionsPollingIntervalSeconds: f.pollingIntervalsSeconds.sessions
803
+ }), this.messageCtx = new Y({
804
804
  config: this.config,
805
805
  api: this.api,
806
806
  sessionCtx: this.sessionCtx,
807
807
  contactCtx: this.contactCtx
808
- }), this.csatCtx = new K({
808
+ }), this.csatCtx = new J({
809
809
  config: this.config,
810
810
  api: this.api,
811
811
  sessionCtx: this.sessionCtx,
812
812
  messageCtx: this.messageCtx
813
- }), this.activeSessionPollingCtx = new H({
813
+ }), this.activeSessionPollingCtx = new K({
814
814
  api: this.api,
815
815
  config: this.config,
816
816
  sessionCtx: this.sessionCtx,
817
817
  messageCtx: this.messageCtx,
818
- sessionPollingIntervalSeconds: b.pollingIntervalsSeconds.session
819
- }), this.routerCtx = new J({
818
+ sessionPollingIntervalSeconds: f.pollingIntervalsSeconds.session
819
+ }), this.routerCtx = new G({
820
820
  config: this.config,
821
821
  contactCtx: this.contactCtx,
822
822
  sessionCtx: this.sessionCtx,
@@ -824,22 +824,22 @@ const b = class b {
824
824
  });
825
825
  }
826
826
  };
827
- b.pollingIntervalsSeconds = null, b.initialize = async ({
827
+ f.pollingIntervalsSeconds = null, f.initialize = async ({
828
828
  config: a,
829
- storage: o
829
+ storage: n
830
830
  }) => {
831
831
  var h, s, e;
832
- const r = await new E({
832
+ const r = await new A({
833
833
  config: a
834
834
  }).getExternalWidgetConfig();
835
835
  if (!r.data)
836
836
  throw new Error("Failed to fetch widget config");
837
- return b.pollingIntervalsSeconds = {
837
+ return f.pollingIntervalsSeconds = {
838
838
  session: ((h = r.data) == null ? void 0 : h.sessionPollingIntervalSeconds) || 10,
839
839
  sessions: ((s = r.data) == null ? void 0 : s.sessionsPollingIntervalSeconds) || 60
840
- }, new b({
840
+ }, new f({
841
841
  config: a,
842
- storage: o,
842
+ storage: n,
843
843
  modes: ((e = r.data) == null ? void 0 : e.modes) || [],
844
844
  org: {
845
845
  id: r.data.org.id,
@@ -847,7 +847,7 @@ b.pollingIntervalsSeconds = null, b.initialize = async ({
847
847
  }
848
848
  });
849
849
  };
850
- let z = b;
850
+ let M = f;
851
851
  const W = {
852
852
  write_a_message_placeholder: "اكتب رسالة...",
853
853
  your_issue_has_been_resolved: "تم حل مشكلتك!",
@@ -976,7 +976,7 @@ const W = {
976
976
  no_conversations_yet: "No conversations yet",
977
977
  back_to_conversations: "Back to conversations",
978
978
  closed_conversations: "Closed conversations"
979
- }, ne = {
979
+ }, oe = {
980
980
  write_a_message_placeholder: "Escribe un mensaje...",
981
981
  your_issue_has_been_resolved: "¡Tu problema fue resuelto!",
982
982
  new_conversation: "Nueva conversación",
@@ -992,7 +992,7 @@ const W = {
992
992
  no_conversations_yet: "Sin conversaciones aún",
993
993
  back_to_conversations: "Volver a conversaciones",
994
994
  closed_conversations: "Conversaciones cerradas"
995
- }, oe = {
995
+ }, ne = {
996
996
  write_a_message_placeholder: "Magsulat ng mensahe...",
997
997
  your_issue_has_been_resolved: "Nalutas na ang iyong isyu!",
998
998
  new_conversation: "Bagong usapan",
@@ -1200,7 +1200,7 @@ const W = {
1200
1200
  no_conversations_yet: "Inga konversationer ännu",
1201
1201
  back_to_conversations: "Tillbaka till konversationer",
1202
1202
  closed_conversations: "Stängda konversationer"
1203
- }, fe = {
1203
+ }, be = {
1204
1204
  write_a_message_placeholder: "Напишите сообщение...",
1205
1205
  your_issue_has_been_resolved: "Ваша проблема решена!",
1206
1206
  new_conversation: "Новый разговор",
@@ -1216,7 +1216,7 @@ const W = {
1216
1216
  no_conversations_yet: "Пока нет разговоров",
1217
1217
  back_to_conversations: "Назад к разговорам",
1218
1218
  closed_conversations: "Закрытые разговоры"
1219
- }, be = {
1219
+ }, fe = {
1220
1220
  write_a_message_placeholder: "เขียนข้อความ...",
1221
1221
  your_issue_has_been_resolved: "ปัญหาของคุณได้รับการแก้ไขแล้ว!",
1222
1222
  new_conversation: "การสนทนาใหม่",
@@ -1264,7 +1264,7 @@ const W = {
1264
1264
  no_conversations_yet: "ابھی تک کوئی گفتگو نہیں",
1265
1265
  back_to_conversations: "گفتگو پر واپس جائیں",
1266
1266
  closed_conversations: "بند گفتگو"
1267
- }, Ce = {
1267
+ }, ke = {
1268
1268
  write_a_message_placeholder: "Viết tin nhắn...",
1269
1269
  your_issue_has_been_resolved: "Vấn đề của bạn đã được giải quyết!",
1270
1270
  new_conversation: "Cuộc trò chuyện mới",
@@ -1296,7 +1296,167 @@ const W = {
1296
1296
  no_conversations_yet: "暂无对话",
1297
1297
  back_to_conversations: "返回对话",
1298
1298
  closed_conversations: "已关闭的对话"
1299
- }, j = {
1299
+ }, Ce = {
1300
+ write_a_message_placeholder: "Napišite poruku...",
1301
+ your_issue_has_been_resolved: "Vaš problem je riješen!",
1302
+ new_conversation: "Novi razgovor",
1303
+ welcome_screen_title: "Dobrodošli u naš chat za podršku",
1304
+ welcome_screen_description: "Ovdje smo da pomognemo! Započnite razgovor i odgovorit ćemo vam što je prije moguće.",
1305
+ your_name_placeholder: "Vaše ime",
1306
+ your_email_placeholder: "Vaša e-mail adresa",
1307
+ start_chat_button: "Razgovarajte s podrškom",
1308
+ start_chat_button_loading: "Povezivanje...",
1309
+ i_need_more_help: "Trebam dodatnu pomoć",
1310
+ this_was_helpful: "Ovo je bilo korisno",
1311
+ optional: "Neobavezno",
1312
+ no_conversations_yet: "Još nema razgovora",
1313
+ back_to_conversations: "Natrag na razgovore",
1314
+ closed_conversations: "Zatvoreni razgovori"
1315
+ }, xe = {
1316
+ write_a_message_placeholder: "Kirjuta sõnum...",
1317
+ your_issue_has_been_resolved: "Teie probleem on lahendatud!",
1318
+ new_conversation: "Uus vestlus",
1319
+ welcome_screen_title: "Tere tulemast meie tugiteenusesse",
1320
+ welcome_screen_description: "Oleme siin, et aidata! Alustage vestlust ja vastame teile esimesel võimalusel.",
1321
+ your_name_placeholder: "Teie nimi",
1322
+ your_email_placeholder: "Teie e-posti aadress",
1323
+ start_chat_button: "Räägi toega",
1324
+ start_chat_button_loading: "Ühendamine...",
1325
+ i_need_more_help: "Vajan rohkem abi",
1326
+ this_was_helpful: "See oli kasulik",
1327
+ optional: "Valikuline",
1328
+ no_conversations_yet: "Vestlusi pole veel",
1329
+ back_to_conversations: "Tagasi vestluste juurde",
1330
+ closed_conversations: "Suletud vestlused"
1331
+ }, ze = {
1332
+ write_a_message_placeholder: "Írjon üzenetet...",
1333
+ your_issue_has_been_resolved: "A problémája megoldódott!",
1334
+ new_conversation: "Új beszélgetés",
1335
+ welcome_screen_title: "Üdvözöljük az ügyfélszolgálati chatünkön",
1336
+ welcome_screen_description: "Azért vagyunk itt, hogy segítsünk! Kezdjen beszélgetést, és mihamarabb válaszolunk.",
1337
+ your_name_placeholder: "Az Ön neve",
1338
+ your_email_placeholder: "Az Ön e-mail címe",
1339
+ start_chat_button: "Beszélgetés az ügyfélszolgálattal",
1340
+ start_chat_button_loading: "Csatlakozás...",
1341
+ i_need_more_help: "További segítségre van szükségem",
1342
+ this_was_helpful: "Ez hasznos volt",
1343
+ optional: "Opcionális",
1344
+ no_conversations_yet: "Még nincsenek beszélgetések",
1345
+ back_to_conversations: "Vissza a beszélgetésekhez",
1346
+ closed_conversations: "Lezárt beszélgetések"
1347
+ }, Ie = {
1348
+ write_a_message_placeholder: "Skrifaðu skilaboð...",
1349
+ your_issue_has_been_resolved: "Málið þitt hefur verið leyst!",
1350
+ new_conversation: "Nýtt samtal",
1351
+ welcome_screen_title: "Velkomin í þjónustuverið okkar",
1352
+ welcome_screen_description: "Við erum hér til að hjálpa! Byrjaðu samtal og við munum svara eins fljótt og auðið er.",
1353
+ your_name_placeholder: "Nafnið þitt",
1354
+ your_email_placeholder: "Netfangið þitt",
1355
+ start_chat_button: "Tala við þjónustuver",
1356
+ start_chat_button_loading: "Tengist...",
1357
+ i_need_more_help: "Ég þarf meiri hjálp",
1358
+ this_was_helpful: "Þetta var gagnlegt",
1359
+ optional: "Valfrjálst",
1360
+ no_conversations_yet: "Engin samtöl ennþá",
1361
+ back_to_conversations: "Til baka í samtöl",
1362
+ closed_conversations: "Lokuð samtöl"
1363
+ }, Pe = {
1364
+ write_a_message_placeholder: "Rakstiet ziņojumu...",
1365
+ your_issue_has_been_resolved: "Jūsu problēma ir atrisināta!",
1366
+ new_conversation: "Jauna saruna",
1367
+ welcome_screen_title: "Laipni lūdzam mūsu atbalsta tērzēšanā",
1368
+ welcome_screen_description: "Mēs esam šeit, lai palīdzētu! Sāciet sarunu, un mēs jums atbildēsim pēc iespējas ātrāk.",
1369
+ your_name_placeholder: "Jūsu vārds",
1370
+ your_email_placeholder: "Jūsu e-pasta adrese",
1371
+ start_chat_button: "Sazināties ar atbalstu",
1372
+ start_chat_button_loading: "Savienošana...",
1373
+ i_need_more_help: "Man vajag vairāk palīdzības",
1374
+ this_was_helpful: "Tas bija noderīgi",
1375
+ optional: "Neobligāts",
1376
+ no_conversations_yet: "Pagaidām nav sarunu",
1377
+ back_to_conversations: "Atpakaļ pie sarunām",
1378
+ closed_conversations: "Slēgtās sarunas"
1379
+ }, je = {
1380
+ write_a_message_placeholder: "Parašykite žinutę...",
1381
+ your_issue_has_been_resolved: "Jūsų problema išspręsta!",
1382
+ new_conversation: "Naujas pokalbis",
1383
+ welcome_screen_title: "Sveiki atvykę į mūsų pagalbos pokalbį",
1384
+ welcome_screen_description: "Mes čia, kad padėtume! Pradėkite pokalbį ir mes atsakysime kuo greičiau.",
1385
+ your_name_placeholder: "Jūsų vardas",
1386
+ your_email_placeholder: "Jūsų el. pašto adresas",
1387
+ start_chat_button: "Kalbėti su pagalba",
1388
+ start_chat_button_loading: "Jungiamasi...",
1389
+ i_need_more_help: "Man reikia daugiau pagalbos",
1390
+ this_was_helpful: "Tai buvo naudinga",
1391
+ optional: "Neprivaloma",
1392
+ no_conversations_yet: "Pokalbių dar nėra",
1393
+ back_to_conversations: "Grįžti į pokalbius",
1394
+ closed_conversations: "Uždaryti pokalbiai"
1395
+ }, Te = {
1396
+ write_a_message_placeholder: "Schreift eng Noriicht...",
1397
+ your_issue_has_been_resolved: "Äert Problem gouf geléist!",
1398
+ new_conversation: "Nei Konversatioun",
1399
+ welcome_screen_title: "Wëllkomm bei eisem Support-Chat",
1400
+ welcome_screen_description: "Mir sinn hei fir ze hëllefen! Start eng Konversatioun a mir äntweren Iech esou séier wéi méiglech.",
1401
+ your_name_placeholder: "Ären Numm",
1402
+ your_email_placeholder: "Är E-Mail-Adress",
1403
+ start_chat_button: "Mat dem Support schwätzen",
1404
+ start_chat_button_loading: "Verbindung...",
1405
+ i_need_more_help: "Ech brauch méi Hëllef",
1406
+ this_was_helpful: "Dat war hëllefräich",
1407
+ optional: "Fakultativ",
1408
+ no_conversations_yet: "Nach keng Konversatiounen",
1409
+ back_to_conversations: "Zréck zu de Konversatiounen",
1410
+ closed_conversations: "Zougemaachte Konversatiounen"
1411
+ }, Ae = {
1412
+ write_a_message_placeholder: "Ikteb messaġġ...",
1413
+ your_issue_has_been_resolved: "Il-problema tiegħek ġiet riżolta!",
1414
+ new_conversation: "Konversazzjoni ġdida",
1415
+ welcome_screen_title: "Merħba fis-support chat tagħna",
1416
+ welcome_screen_description: "Aħna hawn biex ngħinu! Ibda konversazzjoni u nirrispondu malajr kemm jista' jkun.",
1417
+ your_name_placeholder: "Ismek",
1418
+ your_email_placeholder: "L-indirizz tal-email tiegħek",
1419
+ start_chat_button: "Kellem lis-support",
1420
+ start_chat_button_loading: "Qed jikkonnettja...",
1421
+ i_need_more_help: "Għandi bżonn aktar għajnuna",
1422
+ this_was_helpful: "Dan kien ta' għajnuna",
1423
+ optional: "Mhux obbligatorju",
1424
+ no_conversations_yet: "Għad m'hemmx konversazzjonijiet",
1425
+ back_to_conversations: "Lura għall-konversazzjonijiet",
1426
+ closed_conversations: "Konversazzjonijiet magħluqa"
1427
+ }, Me = {
1428
+ write_a_message_placeholder: "Skriv en melding...",
1429
+ your_issue_has_been_resolved: "Saken din er løst!",
1430
+ new_conversation: "Ny samtale",
1431
+ welcome_screen_title: "Velkommen til vår kundestøtte",
1432
+ welcome_screen_description: "Vi er her for å hjelpe! Start en samtale, så svarer vi deg så snart som mulig.",
1433
+ your_name_placeholder: "Ditt navn",
1434
+ your_email_placeholder: "Din e-postadresse",
1435
+ start_chat_button: "Snakk med kundestøtte",
1436
+ start_chat_button_loading: "Kobler til...",
1437
+ i_need_more_help: "Jeg trenger mer hjelp",
1438
+ this_was_helpful: "Dette var nyttig",
1439
+ optional: "Valgfritt",
1440
+ no_conversations_yet: "Ingen samtaler ennå",
1441
+ back_to_conversations: "Tilbake til samtaler",
1442
+ closed_conversations: "Lukkede samtaler"
1443
+ }, Ee = {
1444
+ write_a_message_placeholder: "Napíšte správu...",
1445
+ your_issue_has_been_resolved: "Váš problém bol vyriešený!",
1446
+ new_conversation: "Nová konverzácia",
1447
+ welcome_screen_title: "Vitajte v našom zákazníckom chate",
1448
+ welcome_screen_description: "Sme tu, aby sme vám pomohli! Začnite konverzáciu a odpovieme vám čo najskôr.",
1449
+ your_name_placeholder: "Vaše meno",
1450
+ your_email_placeholder: "Vaša e-mailová adresa",
1451
+ start_chat_button: "Hovoriť s podporou",
1452
+ start_chat_button_loading: "Pripájanie...",
1453
+ i_need_more_help: "Potrebujem ďalšiu pomoc",
1454
+ this_was_helpful: "Toto bolo užitočné",
1455
+ optional: "Voliteľné",
1456
+ no_conversations_yet: "Zatiaľ žiadne konverzácie",
1457
+ back_to_conversations: "Späť na konverzácie",
1458
+ closed_conversations: "Uzavreté konverzácie"
1459
+ }, N = {
1300
1460
  ar: W,
1301
1461
  bn: Z,
1302
1462
  bg: X,
@@ -1305,39 +1465,49 @@ const W = {
1305
1465
  de: se,
1306
1466
  el: te,
1307
1467
  en: ae,
1308
- es: ne,
1468
+ es: oe,
1469
+ et: xe,
1309
1470
  fi: ie,
1310
- fil: oe,
1471
+ fil: ne,
1311
1472
  fr: re,
1312
1473
  hi: le,
1474
+ hr: Ce,
1475
+ hu: ze,
1476
+ is: Ie,
1313
1477
  it: ce,
1314
1478
  ja: _e,
1315
1479
  ko: he,
1480
+ lb: Te,
1481
+ lt: je,
1482
+ lv: Pe,
1483
+ mt: Ae,
1484
+ nb: Me,
1316
1485
  nl: ue,
1317
1486
  no: de,
1318
1487
  pl: ge,
1319
1488
  pt: me,
1320
1489
  ro: pe,
1321
- ru: fe,
1490
+ ru: be,
1491
+ sk: Ee,
1322
1492
  sv: ve,
1323
- th: be,
1493
+ th: fe,
1324
1494
  tr: we,
1325
1495
  ur: ye,
1326
- vi: Ce,
1496
+ vi: ke,
1327
1497
  "zh-cn": Se
1328
- }, ke = Object.keys(j);
1329
- function Te(_) {
1330
- return ke.includes(_);
1498
+ }, Le = Object.keys(N);
1499
+ function De(_) {
1500
+ return Le.includes(_);
1331
1501
  }
1332
- function Me(_, a, o) {
1502
+ function Ve(_, a, n) {
1333
1503
  var r;
1334
- return ((r = o == null ? void 0 : o[a]) == null ? void 0 : r[_]) || j[a][_] || "";
1504
+ return ((r = n == null ? void 0 : n[a]) == null ? void 0 : r[_]) || N[a][_] || "";
1335
1505
  }
1336
1506
  export {
1337
1507
  S as PrimitiveState,
1338
- z as WidgetCtx,
1339
- Me as getTranslation,
1340
- V as isExhaustive,
1341
- Te as isSupportedLanguage
1508
+ M as WidgetCtx,
1509
+ Ve as getTranslation,
1510
+ B as isExhaustive,
1511
+ De as isSupportedLanguage
1342
1512
  };
1343
1513
  //# sourceMappingURL=index.js.map