@opencx/widget 2.4.4-rn.0 → 2.4.4-rn.1
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/basic.cjs +1 -1
- package/dist/basic.js +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/{index-BVoLVQCZ.cjs → index-Bx4hrNc7.cjs} +2 -2
- package/dist/{index-BVoLVQCZ.cjs.map → index-Bx4hrNc7.cjs.map} +1 -1
- package/dist/{index-Cjs7ckCU.js → index-ENMg5VOh.js} +2 -2
- package/dist/{index-Cjs7ckCU.js.map → index-ENMg5VOh.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +313 -258
- package/dist/index.js.map +1 -1
- package/dist/package.json.d.ts +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist-embed/script.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,28 +3,28 @@ var N = (t) => {
|
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
5
|
var q = (t, e, s) => e in t ? x(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
import
|
|
9
|
-
import { g as
|
|
10
|
-
import { A as
|
|
11
|
-
var
|
|
12
|
-
class
|
|
6
|
+
var S = (t, e, s) => q(t, typeof e != "symbol" ? e + "" : e, s), D = (t, e, s) => e.has(t) || N("Cannot " + s);
|
|
7
|
+
var h = (t, e, s) => (D(t, e, "read from private field"), s ? s.call(t) : e.get(t)), M = (t, e, s) => e.has(t) ? N("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), P = (t, e, s, o) => (D(t, e, "write to private field"), o ? o.call(t, s) : e.set(t, s), s);
|
|
8
|
+
import j from "lodash.isequal";
|
|
9
|
+
import { g as _ } from "./schemas-BBAV6Sd_.js";
|
|
10
|
+
import { A as de, M as fe, b as me, a as ge, S as he, d as Se, e as pe, c as Ee, f as ye, s as be } from "./schemas-BBAV6Sd_.js";
|
|
11
|
+
var H = /* @__PURE__ */ ((t) => (t.INIT = "init", t.STATE_CHANGE = "stateChange", t.BEFORE_UPDATE = "beforeUpdate", t.AFTER_UPDATE = "afterUpdate", t.DESTROY = "destroy", t.ERROR = "error", t))(H || {}), y, L;
|
|
12
|
+
class C {
|
|
13
13
|
constructor(e) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
S(this, "subscribers", /* @__PURE__ */ new Set());
|
|
15
|
+
M(this, y);
|
|
16
|
+
S(this, "initialState");
|
|
17
|
+
M(this, L);
|
|
18
|
+
S(this, "lifecycleListeners", /* @__PURE__ */ new Map());
|
|
19
|
+
S(this, "emitLifecycle", (e, s) => {
|
|
20
20
|
const o = this.lifecycleListeners.get(e);
|
|
21
21
|
if (o) {
|
|
22
|
-
const
|
|
22
|
+
const d = {
|
|
23
23
|
type: e,
|
|
24
24
|
timestamp: Date.now(),
|
|
25
25
|
data: s
|
|
26
26
|
};
|
|
27
|
-
o.forEach((
|
|
27
|
+
o.forEach((n) => n(d));
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
/**
|
|
@@ -32,10 +32,10 @@ class v {
|
|
|
32
32
|
* @param callback Function to call when state changes
|
|
33
33
|
* @returns Unsubscribe function
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
S(this, "subscribe", (e) => (this.subscribers.add(e), e(h(this, y)), () => {
|
|
36
36
|
this.subscribers.delete(e);
|
|
37
37
|
}));
|
|
38
|
-
|
|
38
|
+
S(this, "onLifecycle", (e, s) => {
|
|
39
39
|
this.lifecycleListeners.has(e) || this.lifecycleListeners.set(e, /* @__PURE__ */ new Set());
|
|
40
40
|
const o = this.lifecycleListeners.get(e);
|
|
41
41
|
return o.add(s), () => {
|
|
@@ -45,16 +45,16 @@ class v {
|
|
|
45
45
|
/**
|
|
46
46
|
* Get the current state
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
S(this, "getState", () => h(this, y));
|
|
49
49
|
/**
|
|
50
50
|
* Set the state and notify subscribers if the state changes
|
|
51
51
|
* @param newState The new state to set
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
S(this, "setState", (e) => {
|
|
54
54
|
this.emitLifecycle("beforeUpdate", {
|
|
55
|
-
previousState:
|
|
55
|
+
previousState: h(this, y),
|
|
56
56
|
nextState: e
|
|
57
|
-
}),
|
|
57
|
+
}), j(h(this, y), e) || (P(this, y, e), P(this, L, Date.now()), this.emitLifecycle("stateChange", { state: e }), this.subscribers.forEach((s) => {
|
|
58
58
|
try {
|
|
59
59
|
s(e);
|
|
60
60
|
} catch (o) {
|
|
@@ -62,46 +62,46 @@ class v {
|
|
|
62
62
|
}
|
|
63
63
|
})), this.emitLifecycle("afterUpdate", { state: e });
|
|
64
64
|
});
|
|
65
|
-
|
|
66
|
-
const s = { ...
|
|
65
|
+
S(this, "setStatePartial", (e) => {
|
|
66
|
+
const s = { ...h(this, y), ...e };
|
|
67
67
|
this.setState(s);
|
|
68
68
|
});
|
|
69
69
|
/**
|
|
70
70
|
* Clear all subscriptions
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
S(this, "clear", () => {
|
|
73
73
|
this.emitLifecycle(
|
|
74
74
|
"destroy"
|
|
75
75
|
/* DESTROY */
|
|
76
76
|
), this.subscribers.clear(), this.lifecycleListeners.clear();
|
|
77
77
|
});
|
|
78
|
-
|
|
78
|
+
S(this, "reset", () => {
|
|
79
79
|
this.setState(this.initialState);
|
|
80
80
|
});
|
|
81
|
-
|
|
82
|
-
P(this, y, e), this.initialState = e, P(this,
|
|
81
|
+
S(this, "lastUpdated", () => h(this, L));
|
|
82
|
+
P(this, y, e), this.initialState = e, P(this, L, Date.now()), this.emitLifecycle("init", { initialState: h(this, y) });
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
y = new WeakMap(),
|
|
85
|
+
y = new WeakMap(), L = new WeakMap();
|
|
86
86
|
function W(t) {
|
|
87
|
-
return new
|
|
87
|
+
return new C(t);
|
|
88
88
|
}
|
|
89
|
-
class
|
|
89
|
+
class v extends Error {
|
|
90
90
|
constructor(e) {
|
|
91
91
|
super(e), this.name = "OpenCXError";
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
class Z extends
|
|
94
|
+
class Z extends v {
|
|
95
95
|
constructor(e = "Connection failed") {
|
|
96
96
|
super(e), this.name = "ConnectionError";
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
class ee extends
|
|
99
|
+
class ee extends v {
|
|
100
100
|
constructor(e = "Authentication failed") {
|
|
101
101
|
super(e), this.name = "AuthenticationError";
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
class B extends
|
|
104
|
+
class B extends v {
|
|
105
105
|
constructor(e = "Session error occurred") {
|
|
106
106
|
super(e), this.name = "SessionError";
|
|
107
107
|
}
|
|
@@ -111,12 +111,12 @@ class te extends B {
|
|
|
111
111
|
super(e), this.name = "SessionNotDefinedError";
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
class se extends
|
|
114
|
+
class se extends v {
|
|
115
115
|
constructor(e = "Transport error occurred") {
|
|
116
116
|
super(e), this.name = "TransportError";
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
class re extends
|
|
119
|
+
class re extends v {
|
|
120
120
|
constructor(e = "File upload failed") {
|
|
121
121
|
super(e), this.name = "FileUploadError";
|
|
122
122
|
}
|
|
@@ -147,7 +147,7 @@ const R = {
|
|
|
147
147
|
};
|
|
148
148
|
function k(t) {
|
|
149
149
|
const e = {
|
|
150
|
-
id: t.publicId ||
|
|
150
|
+
id: t.publicId || _(),
|
|
151
151
|
timestamp: t.sentAt || "",
|
|
152
152
|
attachments: t.attachments || void 0
|
|
153
153
|
};
|
|
@@ -171,113 +171,113 @@ function k(t) {
|
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
async function o(
|
|
176
|
-
const
|
|
177
|
-
if (
|
|
178
|
-
s == null || s.debug("No messages yet, fetching all history", { sessionId:
|
|
179
|
-
const g = await t.getSessionHistory(
|
|
174
|
+
function J(t, e, s) {
|
|
175
|
+
async function o(i) {
|
|
176
|
+
const c = e.getState().messages;
|
|
177
|
+
if (c.length === 0) {
|
|
178
|
+
s == null || s.debug("No messages yet, fetching all history", { sessionId: i.id });
|
|
179
|
+
const g = await t.getSessionHistory(i.id, "");
|
|
180
180
|
g && g.length > 0 && e.setStatePartial({
|
|
181
181
|
messages: g.map(k)
|
|
182
182
|
});
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
const
|
|
185
|
+
const l = c[c.length - 1], r = new Date(l.timestamp);
|
|
186
|
+
r.setSeconds(r.getSeconds() + 1);
|
|
187
|
+
const u = r.toISOString();
|
|
188
188
|
s == null || s.debug("Fetching history messages after timestamp", {
|
|
189
|
-
sessionId:
|
|
190
|
-
lastMessageTimestamp:
|
|
191
|
-
currentMessageCount:
|
|
189
|
+
sessionId: i.id,
|
|
190
|
+
lastMessageTimestamp: u,
|
|
191
|
+
currentMessageCount: c.length
|
|
192
192
|
});
|
|
193
|
-
const E = await t.getSessionHistory(
|
|
193
|
+
const E = await t.getSessionHistory(i.id, u);
|
|
194
194
|
if (E && E.length > 0) {
|
|
195
|
-
const g = E.map(k).filter((p) => !
|
|
195
|
+
const g = E.map(k).filter((p) => !c.some((I) => I.id === p.id));
|
|
196
196
|
g.length > 0 && (s == null || s.debug("Adding new messages to state", {
|
|
197
197
|
count: g.length,
|
|
198
198
|
messageIds: g.map((p) => p.id),
|
|
199
199
|
messageTypes: g.map((p) => p.type)
|
|
200
200
|
}), e.setStatePartial({
|
|
201
|
-
messages: [...
|
|
201
|
+
messages: [...c, ...g]
|
|
202
202
|
}));
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function d(i, c) {
|
|
206
206
|
return {
|
|
207
|
-
id:
|
|
207
|
+
id: _(),
|
|
208
208
|
type: "FROM_USER",
|
|
209
|
-
content:
|
|
209
|
+
content: i,
|
|
210
210
|
deliveredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
211
|
-
attachments:
|
|
211
|
+
attachments: c,
|
|
212
212
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
if (
|
|
215
|
+
function n(i) {
|
|
216
|
+
if (i.success && i.autopilotResponse)
|
|
217
217
|
return {
|
|
218
218
|
type: "FROM_BOT",
|
|
219
|
-
id:
|
|
219
|
+
id: i.autopilotResponse.id || _(),
|
|
220
220
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
221
221
|
component: "TEXT",
|
|
222
222
|
data: {
|
|
223
|
-
message:
|
|
223
|
+
message: i.autopilotResponse.value.content
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
|
-
if (
|
|
227
|
-
const
|
|
226
|
+
if (i.success && i.uiResponse) {
|
|
227
|
+
const c = i.uiResponse.value;
|
|
228
228
|
return {
|
|
229
229
|
type: "FROM_BOT",
|
|
230
|
-
id:
|
|
230
|
+
id: _(),
|
|
231
231
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
232
|
-
component:
|
|
233
|
-
data:
|
|
232
|
+
component: c.name,
|
|
233
|
+
data: c.request_response
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
236
|
return null;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function a(i) {
|
|
239
239
|
return {
|
|
240
240
|
type: "FROM_BOT",
|
|
241
|
-
id:
|
|
241
|
+
id: _(),
|
|
242
242
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
243
243
|
component: "TEXT",
|
|
244
244
|
data: {
|
|
245
|
-
message:
|
|
245
|
+
message: i,
|
|
246
246
|
variant: "error"
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
250
|
return {
|
|
251
251
|
fetchHistoryMessages: o,
|
|
252
|
-
addUserMessage:
|
|
253
|
-
addBotMessage:
|
|
254
|
-
addErrorMessage:
|
|
252
|
+
addUserMessage: d,
|
|
253
|
+
addBotMessage: n,
|
|
254
|
+
addErrorMessage: a
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function G(t, e, s, o, d, n) {
|
|
258
258
|
var F, U;
|
|
259
|
-
const
|
|
260
|
-
let
|
|
261
|
-
const
|
|
262
|
-
async function
|
|
263
|
-
if (
|
|
259
|
+
const a = (F = n.platform) == null ? void 0 : F.logger;
|
|
260
|
+
let i = null;
|
|
261
|
+
const c = (U = n.platform) == null ? void 0 : U.storage, l = `${d.getConfig().user.external_id}:${d.getConfig().token}:session`, r = n.config.getSettings().persistSession;
|
|
262
|
+
async function u() {
|
|
263
|
+
if (c)
|
|
264
264
|
try {
|
|
265
|
-
|
|
266
|
-
const
|
|
267
|
-
if (
|
|
268
|
-
const m = JSON.parse(
|
|
269
|
-
|
|
265
|
+
a == null || a.debug("Attempting to restore session from storage");
|
|
266
|
+
const f = await c.getItem(l);
|
|
267
|
+
if (f) {
|
|
268
|
+
const m = JSON.parse(f);
|
|
269
|
+
a == null || a.info("Session restored from storage", { sessionId: m.id }), e.setState(m), await o.fetchHistoryMessages(m), g();
|
|
270
270
|
}
|
|
271
|
-
} catch (
|
|
272
|
-
|
|
271
|
+
} catch (f) {
|
|
272
|
+
a == null || a.error("Error restoring session from storage:", f);
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
function E() {
|
|
276
|
-
|
|
276
|
+
c && (a == null || a.debug("Setting up session persistence"), e.subscribe(async (f) => {
|
|
277
277
|
try {
|
|
278
|
-
|
|
278
|
+
f ? (await c.setItem(l, JSON.stringify(f)), a == null || a.debug("Session persisted to storage", { sessionId: f.id })) : (await c.removeItem(l), a == null || a.debug("Session removed from storage"));
|
|
279
279
|
} catch (m) {
|
|
280
|
-
|
|
280
|
+
a == null || a.error("Error persisting session:", m), s.setStatePartial({
|
|
281
281
|
error: {
|
|
282
282
|
hasError: !0,
|
|
283
283
|
message: m instanceof Error ? m.message : "Failed to persist session",
|
|
@@ -288,10 +288,10 @@ function J(t, e, s, o, f, a) {
|
|
|
288
288
|
}));
|
|
289
289
|
}
|
|
290
290
|
function g() {
|
|
291
|
-
if (
|
|
292
|
-
|
|
293
|
-
const
|
|
294
|
-
|
|
291
|
+
if (i) return;
|
|
292
|
+
a == null || a.debug("Starting polling");
|
|
293
|
+
const f = [];
|
|
294
|
+
f.push(
|
|
295
295
|
setInterval(async () => {
|
|
296
296
|
const m = e.getState();
|
|
297
297
|
if (m != null && m.id)
|
|
@@ -299,36 +299,36 @@ function J(t, e, s, o, f, a) {
|
|
|
299
299
|
const w = await t.getSession(m.id);
|
|
300
300
|
w && e.setState(w);
|
|
301
301
|
} catch (w) {
|
|
302
|
-
|
|
302
|
+
a == null || a.error("Error polling session:", w);
|
|
303
303
|
}
|
|
304
304
|
}, R.SESSION)
|
|
305
|
-
),
|
|
305
|
+
), f.push(
|
|
306
306
|
setInterval(async () => {
|
|
307
307
|
const m = e.getState();
|
|
308
308
|
if (m != null && m.id)
|
|
309
309
|
try {
|
|
310
310
|
await o.fetchHistoryMessages(m);
|
|
311
311
|
} catch (w) {
|
|
312
|
-
|
|
312
|
+
a == null || a.error("Error polling messages:", w);
|
|
313
313
|
}
|
|
314
314
|
}, R.MESSAGES)
|
|
315
|
-
),
|
|
316
|
-
|
|
315
|
+
), i = () => {
|
|
316
|
+
a == null || a.debug("Stopping polling"), f.forEach(clearInterval);
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
319
|
async function p() {
|
|
320
320
|
try {
|
|
321
|
-
|
|
321
|
+
a == null || a.info("Creating new session"), s.setStatePartial({
|
|
322
322
|
loading: { isLoading: !0, reason: "creating_session" },
|
|
323
323
|
error: { hasError: !1 }
|
|
324
324
|
});
|
|
325
|
-
const
|
|
326
|
-
return
|
|
327
|
-
} catch (
|
|
328
|
-
|
|
325
|
+
const f = await t.createSession();
|
|
326
|
+
return a == null || a.info("Session created successfully", { sessionId: f.id }), e.setState(f), g(), f;
|
|
327
|
+
} catch (f) {
|
|
328
|
+
a == null || a.error("Failed to create session:", f);
|
|
329
329
|
const m = {
|
|
330
330
|
hasError: !0,
|
|
331
|
-
message:
|
|
331
|
+
message: f instanceof Error ? f.message : "Failed to create session",
|
|
332
332
|
code: "SESSION_CREATION_FAILED"
|
|
333
333
|
};
|
|
334
334
|
return s.setStatePartial({ error: m }), null;
|
|
@@ -338,17 +338,17 @@ function J(t, e, s, o, f, a) {
|
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
async function
|
|
341
|
+
async function I() {
|
|
342
342
|
var m;
|
|
343
|
-
const
|
|
344
|
-
if (
|
|
343
|
+
const f = e.getState();
|
|
344
|
+
if (f != null && f.id)
|
|
345
345
|
try {
|
|
346
|
-
|
|
346
|
+
i && (i(), i = null), e.setState(null), r && c && T(c) && c.removeItem(l), s.setState({
|
|
347
347
|
messages: [],
|
|
348
348
|
keyboard: null,
|
|
349
349
|
loading: { isLoading: !1 },
|
|
350
350
|
error: { hasError: !1 }
|
|
351
|
-
}), (m =
|
|
351
|
+
}), (m = n.onSessionDestroy) == null || m.call(n);
|
|
352
352
|
} catch (w) {
|
|
353
353
|
console.error("Error clearing session:", w), s.setStatePartial({
|
|
354
354
|
error: {
|
|
@@ -359,91 +359,91 @@ function J(t, e, s, o, f, a) {
|
|
|
359
359
|
});
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function A() {
|
|
363
363
|
try {
|
|
364
|
-
|
|
364
|
+
i && (i(), i = null), r && c && T(c) && c.removeItem(l), s.setState({
|
|
365
365
|
messages: [],
|
|
366
366
|
keyboard: null,
|
|
367
367
|
loading: { isLoading: !1 },
|
|
368
368
|
error: { hasError: !1 }
|
|
369
369
|
}), e.setState(null), s.clear(), e.clear();
|
|
370
|
-
} catch (
|
|
371
|
-
console.error("Error in cleanup:",
|
|
370
|
+
} catch (f) {
|
|
371
|
+
console.error("Error in cleanup:", f), s.setStatePartial({
|
|
372
372
|
error: {
|
|
373
373
|
hasError: !0,
|
|
374
|
-
message:
|
|
374
|
+
message: f instanceof Error ? f.message : "Failed to cleanup",
|
|
375
375
|
code: "SESSION_CLEAR_FAILED"
|
|
376
376
|
}
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
|
-
return
|
|
380
|
+
return r && T(c) && (u(), E()), {
|
|
381
381
|
createSession: p,
|
|
382
|
-
clearSession:
|
|
383
|
-
cleanup:
|
|
382
|
+
clearSession: I,
|
|
383
|
+
cleanup: A,
|
|
384
384
|
startPolling: g
|
|
385
385
|
};
|
|
386
386
|
}
|
|
387
387
|
function ae(t) {
|
|
388
|
-
var
|
|
389
|
-
const e = (
|
|
388
|
+
var i;
|
|
389
|
+
const e = (i = t.platform) == null ? void 0 : i.logger;
|
|
390
390
|
e == null || e.info("Initializing chat");
|
|
391
|
-
const s = new
|
|
391
|
+
const s = new C({
|
|
392
392
|
messages: [],
|
|
393
393
|
keyboard: null,
|
|
394
394
|
loading: { isLoading: !1 },
|
|
395
395
|
error: { hasError: !1 }
|
|
396
|
-
}), o = new
|
|
396
|
+
}), o = new C(null), d = J(t.api, s, e), n = G(
|
|
397
397
|
t.api,
|
|
398
398
|
o,
|
|
399
399
|
s,
|
|
400
|
-
|
|
400
|
+
d,
|
|
401
401
|
t.config,
|
|
402
402
|
t
|
|
403
403
|
);
|
|
404
|
-
async function
|
|
405
|
-
var
|
|
406
|
-
let
|
|
407
|
-
if (!(
|
|
404
|
+
async function a(c) {
|
|
405
|
+
var r;
|
|
406
|
+
let l = o.getState();
|
|
407
|
+
if (!(l != null && l.id) && (e == null || e.debug("No active session, creating new session"), l = await n.createSession(), !l))
|
|
408
408
|
return !1;
|
|
409
409
|
try {
|
|
410
|
-
e == null || e.debug("Sending message", { sessionId:
|
|
410
|
+
e == null || e.debug("Sending message", { sessionId: l.id }), s.setStatePartial({
|
|
411
411
|
loading: { isLoading: !0, reason: "sending_message" },
|
|
412
412
|
error: { hasError: !1 }
|
|
413
413
|
});
|
|
414
|
-
const
|
|
414
|
+
const u = d.addUserMessage(c.content, c.attachments || void 0), E = s.getState().messages;
|
|
415
415
|
s.setStatePartial({
|
|
416
|
-
messages: [...E,
|
|
416
|
+
messages: [...E, u]
|
|
417
417
|
});
|
|
418
418
|
const g = t.config.getConfig(), p = await t.api.handleMessage({
|
|
419
419
|
bot_token: g.token,
|
|
420
420
|
headers: g.headers,
|
|
421
421
|
query_params: g.queryParams,
|
|
422
|
-
session_id:
|
|
423
|
-
...
|
|
422
|
+
session_id: l.id,
|
|
423
|
+
...c
|
|
424
424
|
});
|
|
425
425
|
if (p.success) {
|
|
426
426
|
e == null || e.debug("Message sent successfully");
|
|
427
|
-
const
|
|
428
|
-
if (
|
|
429
|
-
const
|
|
427
|
+
const I = d.addBotMessage(p);
|
|
428
|
+
if (I) {
|
|
429
|
+
const A = s.getState().messages;
|
|
430
430
|
s.setStatePartial({
|
|
431
|
-
messages: [...
|
|
431
|
+
messages: [...A, I]
|
|
432
432
|
});
|
|
433
433
|
}
|
|
434
434
|
} else {
|
|
435
435
|
e == null || e.warn("Message send failed", p.error);
|
|
436
|
-
const
|
|
436
|
+
const I = d.addErrorMessage(((r = p.error) == null ? void 0 : r.message) || "Unknown error occurred"), A = s.getState().messages;
|
|
437
437
|
s.setStatePartial({
|
|
438
|
-
messages: [...
|
|
438
|
+
messages: [...A, I]
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
441
|
return !0;
|
|
442
|
-
} catch (
|
|
443
|
-
return e == null || e.error("Error sending message:",
|
|
442
|
+
} catch (u) {
|
|
443
|
+
return e == null || e.error("Error sending message:", u), s.setStatePartial({
|
|
444
444
|
error: {
|
|
445
445
|
hasError: !0,
|
|
446
|
-
message:
|
|
446
|
+
message: u instanceof Error ? u.message : "Failed to send message",
|
|
447
447
|
code: "MESSAGE_SEND_FAILED"
|
|
448
448
|
}
|
|
449
449
|
}), !1;
|
|
@@ -456,94 +456,94 @@ function ae(t) {
|
|
|
456
456
|
return {
|
|
457
457
|
chatState: s,
|
|
458
458
|
sessionState: o,
|
|
459
|
-
sendMessage:
|
|
460
|
-
createSession:
|
|
461
|
-
clearSession:
|
|
462
|
-
cleanup:
|
|
459
|
+
sendMessage: a,
|
|
460
|
+
createSession: n.createSession,
|
|
461
|
+
clearSession: n.clearSession,
|
|
462
|
+
cleanup: n.cleanup
|
|
463
463
|
};
|
|
464
464
|
}
|
|
465
465
|
function ne(t) {
|
|
466
466
|
const e = t.config.getConfig();
|
|
467
467
|
t.config.getConfig;
|
|
468
468
|
const s = `${e.token}:contact:${e.user.external_id}`, o = T(t.platform.storage) ? t.platform.storage : void 0;
|
|
469
|
-
let
|
|
469
|
+
let d = null;
|
|
470
470
|
o && O(
|
|
471
471
|
async () => {
|
|
472
|
-
const
|
|
473
|
-
return
|
|
472
|
+
const r = await o.getItem(s);
|
|
473
|
+
return r ? JSON.parse(r) : null;
|
|
474
474
|
},
|
|
475
475
|
"Error loading contact from storage"
|
|
476
|
-
).then((
|
|
477
|
-
|
|
476
|
+
).then((r) => {
|
|
477
|
+
r.success && (d = r.result);
|
|
478
478
|
});
|
|
479
|
-
const
|
|
480
|
-
contact:
|
|
479
|
+
const n = new C({
|
|
480
|
+
contact: d,
|
|
481
481
|
loading: { isLoading: !1 },
|
|
482
482
|
error: { hasError: !1 }
|
|
483
483
|
});
|
|
484
|
-
T(o) &&
|
|
484
|
+
T(o) && n.subscribe((r) => {
|
|
485
485
|
O(
|
|
486
486
|
async () => {
|
|
487
|
-
|
|
487
|
+
r.contact ? await o.setItem(s, JSON.stringify(r.contact)) : o.removeItem(s);
|
|
488
488
|
},
|
|
489
489
|
"Error persisting contact state"
|
|
490
|
-
).then((
|
|
491
|
-
|
|
490
|
+
).then((u) => {
|
|
491
|
+
u.success || n.setStatePartial({
|
|
492
492
|
error: {
|
|
493
493
|
hasError: !0,
|
|
494
|
-
message:
|
|
494
|
+
message: u.error.message,
|
|
495
495
|
code: "CONTACT_PERSISTENCE_FAILED"
|
|
496
496
|
}
|
|
497
497
|
});
|
|
498
498
|
});
|
|
499
499
|
});
|
|
500
|
-
async function
|
|
500
|
+
async function a() {
|
|
501
501
|
try {
|
|
502
|
-
if (
|
|
502
|
+
if (n.setStatePartial({
|
|
503
503
|
loading: { isLoading: !0, reason: "loading_contact" },
|
|
504
504
|
error: { hasError: !1 }
|
|
505
505
|
}), o) {
|
|
506
|
-
const
|
|
506
|
+
const r = await O(
|
|
507
507
|
async () => {
|
|
508
|
-
const
|
|
509
|
-
return
|
|
508
|
+
const u = await o.getItem(s);
|
|
509
|
+
return u ? JSON.parse(u) : null;
|
|
510
510
|
},
|
|
511
511
|
"Error loading contact"
|
|
512
512
|
);
|
|
513
|
-
if (!
|
|
514
|
-
throw
|
|
515
|
-
return
|
|
516
|
-
contact:
|
|
513
|
+
if (!r.success)
|
|
514
|
+
throw r.error;
|
|
515
|
+
return n.setStatePartial({
|
|
516
|
+
contact: r.result,
|
|
517
517
|
error: { hasError: !1 }
|
|
518
|
-
}),
|
|
518
|
+
}), r.result;
|
|
519
519
|
}
|
|
520
|
-
return
|
|
521
|
-
} catch (
|
|
522
|
-
return
|
|
520
|
+
return n.getState().contact;
|
|
521
|
+
} catch (r) {
|
|
522
|
+
return n.setStatePartial({
|
|
523
523
|
error: {
|
|
524
524
|
hasError: !0,
|
|
525
|
-
message:
|
|
525
|
+
message: r instanceof Error ? r.message : "Failed to load contact",
|
|
526
526
|
code: "CONTACT_LOAD_FAILED"
|
|
527
527
|
}
|
|
528
528
|
}), null;
|
|
529
529
|
} finally {
|
|
530
|
-
|
|
530
|
+
n.setStatePartial({
|
|
531
531
|
loading: { isLoading: !1, reason: null }
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
async function
|
|
535
|
+
async function i(r) {
|
|
536
536
|
try {
|
|
537
|
-
|
|
537
|
+
n.setStatePartial({
|
|
538
538
|
loading: { isLoading: !0, reason: "saving_contact" },
|
|
539
539
|
error: { hasError: !1 }
|
|
540
540
|
});
|
|
541
|
-
const
|
|
542
|
-
id:
|
|
543
|
-
name:
|
|
544
|
-
created_at:
|
|
545
|
-
avatar_url:
|
|
546
|
-
email:
|
|
541
|
+
const u = n.getState().contact, E = {
|
|
542
|
+
id: r.id || (u == null ? void 0 : u.id) || "",
|
|
543
|
+
name: r.name ?? (u == null ? void 0 : u.name) ?? null,
|
|
544
|
+
created_at: r.created_at || (u == null ? void 0 : u.created_at) || (/* @__PURE__ */ new Date()).toISOString(),
|
|
545
|
+
avatar_url: r.avatar_url ?? (u == null ? void 0 : u.avatar_url) ?? null,
|
|
546
|
+
email: r.email ?? (u == null ? void 0 : u.email) ?? null
|
|
547
547
|
};
|
|
548
548
|
if (T(o)) {
|
|
549
549
|
const g = await O(
|
|
@@ -553,71 +553,71 @@ function ne(t) {
|
|
|
553
553
|
if (!g.success)
|
|
554
554
|
throw g.error;
|
|
555
555
|
}
|
|
556
|
-
return
|
|
556
|
+
return n.setStatePartial({
|
|
557
557
|
contact: E,
|
|
558
558
|
error: { hasError: !1 }
|
|
559
559
|
}), E;
|
|
560
|
-
} catch (
|
|
561
|
-
return
|
|
560
|
+
} catch (u) {
|
|
561
|
+
return n.setStatePartial({
|
|
562
562
|
error: {
|
|
563
563
|
hasError: !0,
|
|
564
|
-
message:
|
|
564
|
+
message: u instanceof Error ? u.message : "Failed to save contact",
|
|
565
565
|
code: "CONTACT_SAVE_FAILED"
|
|
566
566
|
}
|
|
567
567
|
}), null;
|
|
568
568
|
} finally {
|
|
569
|
-
|
|
569
|
+
n.setStatePartial({
|
|
570
570
|
loading: { isLoading: !1, reason: null }
|
|
571
571
|
});
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
function
|
|
575
|
-
var
|
|
576
|
-
return !((
|
|
574
|
+
function c() {
|
|
575
|
+
var u;
|
|
576
|
+
return !((u = n.getState().contact) != null && u.id) && e.collectUserData ? {
|
|
577
577
|
should: !0,
|
|
578
578
|
reason: "No contact id and collectUserData is true"
|
|
579
579
|
} : {
|
|
580
580
|
should: !1
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
|
-
async function
|
|
583
|
+
async function l() {
|
|
584
584
|
try {
|
|
585
|
-
if (
|
|
585
|
+
if (n.setStatePartial({
|
|
586
586
|
loading: { isLoading: !0, reason: "cleaning_up" },
|
|
587
587
|
error: { hasError: !1 }
|
|
588
588
|
}), o) {
|
|
589
|
-
const
|
|
589
|
+
const r = await O(
|
|
590
590
|
() => o.removeItem(s),
|
|
591
591
|
"Error removing contact data"
|
|
592
592
|
);
|
|
593
|
-
if (!
|
|
594
|
-
throw
|
|
593
|
+
if (!r.success)
|
|
594
|
+
throw r.error;
|
|
595
595
|
}
|
|
596
|
-
|
|
596
|
+
n.setState({
|
|
597
597
|
contact: null,
|
|
598
598
|
loading: { isLoading: !1 },
|
|
599
599
|
error: { hasError: !1 }
|
|
600
|
-
}),
|
|
601
|
-
} catch (
|
|
602
|
-
console.error("Error cleaning up contact:",
|
|
600
|
+
}), n.clear();
|
|
601
|
+
} catch (r) {
|
|
602
|
+
console.error("Error cleaning up contact:", r), n.setStatePartial({
|
|
603
603
|
error: {
|
|
604
604
|
hasError: !0,
|
|
605
|
-
message:
|
|
605
|
+
message: r instanceof Error ? r.message : "Failed to cleanup contact data",
|
|
606
606
|
code: "CONTACT_CLEANUP_FAILED"
|
|
607
607
|
}
|
|
608
608
|
});
|
|
609
609
|
} finally {
|
|
610
|
-
|
|
610
|
+
n.setStatePartial({
|
|
611
611
|
loading: { isLoading: !1, reason: null }
|
|
612
612
|
});
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
615
|
return {
|
|
616
|
-
contactState:
|
|
617
|
-
shouldCollectData:
|
|
618
|
-
loadContact:
|
|
619
|
-
saveContact:
|
|
620
|
-
cleanup:
|
|
616
|
+
contactState: n,
|
|
617
|
+
shouldCollectData: c,
|
|
618
|
+
loadContact: a,
|
|
619
|
+
saveContact: i,
|
|
620
|
+
cleanup: l
|
|
621
621
|
};
|
|
622
622
|
}
|
|
623
623
|
const X = {
|
|
@@ -627,7 +627,7 @@ const X = {
|
|
|
627
627
|
triggerOffset: "20px"
|
|
628
628
|
}, z = 1e3 * 3;
|
|
629
629
|
function oe(t) {
|
|
630
|
-
var s, o,
|
|
630
|
+
var s, o, d, n, a, i, c, l, r;
|
|
631
631
|
if (!t.token)
|
|
632
632
|
throw new Error("Token is required");
|
|
633
633
|
if (t.pollingInterval && t.pollingInterval < z)
|
|
@@ -644,23 +644,23 @@ function oe(t) {
|
|
|
644
644
|
bot: {
|
|
645
645
|
name: ((s = t.bot) == null ? void 0 : s.name) ?? "Bot",
|
|
646
646
|
avatarUrl: (o = t.bot) == null ? void 0 : o.avatarUrl,
|
|
647
|
-
id: ((
|
|
648
|
-
is_ai: ((
|
|
647
|
+
id: ((d = t.bot) == null ? void 0 : d.id) ?? null,
|
|
648
|
+
is_ai: ((n = t.bot) == null ? void 0 : n.is_ai) ?? !0
|
|
649
649
|
},
|
|
650
650
|
contactToken: t.contactToken,
|
|
651
651
|
debug: t.debug ?? !1,
|
|
652
652
|
language: t.language ?? "en",
|
|
653
653
|
user: t.user ?? {},
|
|
654
654
|
soundEffectFiles: {
|
|
655
|
-
messageArrived: ((
|
|
655
|
+
messageArrived: ((a = t.soundEffectFiles) == null ? void 0 : a.messageArrived) ?? X.messageArrived
|
|
656
656
|
},
|
|
657
657
|
theme: {
|
|
658
|
-
primaryColor: ((
|
|
659
|
-
triggerOffset: ((
|
|
658
|
+
primaryColor: ((i = t.theme) == null ? void 0 : i.primaryColor) ?? $.primaryColor,
|
|
659
|
+
triggerOffset: ((c = t.theme) == null ? void 0 : c.triggerOffset) ?? $.triggerOffset
|
|
660
660
|
},
|
|
661
661
|
settings: {
|
|
662
|
-
persistSession: ((
|
|
663
|
-
useSoundEffects: ((
|
|
662
|
+
persistSession: ((l = t.settings) == null ? void 0 : l.persistSession) ?? !1,
|
|
663
|
+
useSoundEffects: ((r = t.settings) == null ? void 0 : r.useSoundEffects) ?? !1
|
|
664
664
|
}
|
|
665
665
|
};
|
|
666
666
|
return {
|
|
@@ -682,74 +682,74 @@ function oe(t) {
|
|
|
682
682
|
};
|
|
683
683
|
}
|
|
684
684
|
function V(t = {}) {
|
|
685
|
-
const e = [], s = [], o = [],
|
|
686
|
-
let
|
|
685
|
+
const e = [], s = [], o = [], d = async (n, a = {}) => {
|
|
686
|
+
let i = {
|
|
687
687
|
...t,
|
|
688
|
-
...
|
|
688
|
+
...a,
|
|
689
689
|
headers: {
|
|
690
690
|
...t.headers,
|
|
691
|
-
...
|
|
691
|
+
...a.headers
|
|
692
692
|
}
|
|
693
693
|
};
|
|
694
694
|
try {
|
|
695
|
-
for (const
|
|
696
|
-
|
|
697
|
-
const
|
|
698
|
-
let
|
|
699
|
-
for (const
|
|
700
|
-
|
|
701
|
-
return
|
|
702
|
-
} catch (
|
|
703
|
-
let
|
|
704
|
-
for (const
|
|
705
|
-
|
|
706
|
-
throw
|
|
695
|
+
for (const u of e)
|
|
696
|
+
i = await u(i);
|
|
697
|
+
const c = i.params ? "?" + new URLSearchParams(i.params).toString() : "", l = i.baseURL ? `${i.baseURL}${n}${c}`.replace(/([^:]\/)\/+/g, "$1") : `${n}${c}`;
|
|
698
|
+
let r = await fetch(l, i);
|
|
699
|
+
for (const u of s)
|
|
700
|
+
r = await u(r);
|
|
701
|
+
return r;
|
|
702
|
+
} catch (c) {
|
|
703
|
+
let l = c;
|
|
704
|
+
for (const r of o)
|
|
705
|
+
l = await r(l);
|
|
706
|
+
throw l;
|
|
707
707
|
}
|
|
708
708
|
};
|
|
709
|
-
return
|
|
709
|
+
return d.interceptors = {
|
|
710
710
|
request: {
|
|
711
|
-
use: (
|
|
712
|
-
eject: (
|
|
713
|
-
e.splice(
|
|
711
|
+
use: (n) => (e.push(n), e.length - 1),
|
|
712
|
+
eject: (n) => {
|
|
713
|
+
e.splice(n, 1);
|
|
714
714
|
}
|
|
715
715
|
},
|
|
716
716
|
response: {
|
|
717
|
-
use: (
|
|
718
|
-
eject: (
|
|
719
|
-
s.splice(
|
|
717
|
+
use: (n, a) => (s.push(n), a && o.push(a), s.length - 1),
|
|
718
|
+
eject: (n) => {
|
|
719
|
+
s.splice(n, 1), o.splice(n, 1);
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
|
-
},
|
|
722
|
+
}, d;
|
|
723
723
|
}
|
|
724
|
-
var
|
|
724
|
+
var b;
|
|
725
725
|
class ie {
|
|
726
726
|
constructor(e) {
|
|
727
|
-
|
|
727
|
+
M(this, b);
|
|
728
728
|
this.options = e;
|
|
729
729
|
const s = this.options.config.user, o = {
|
|
730
730
|
claim: "",
|
|
731
731
|
value: ""
|
|
732
732
|
};
|
|
733
733
|
s != null && s.email ? (o.claim = "email", o.value = s.email) : s != null && s.phone && (o.claim = "phone", o.value = s.phone);
|
|
734
|
-
const
|
|
734
|
+
const d = {
|
|
735
735
|
"X-Bot-Token": this.options.config.token,
|
|
736
736
|
"X-Consumer-Id": `${o.claim}:${o.value}`,
|
|
737
737
|
"Content-Type": "application/json",
|
|
738
738
|
Accept: "application/json"
|
|
739
739
|
};
|
|
740
|
-
this.options.config.contactToken && (
|
|
740
|
+
this.options.config.contactToken && (d.Authorization = `Bearer ${this.options.config.contactToken}`), P(this, b, V({
|
|
741
741
|
baseURL: `${this.options.config.apiUrl}/widget/v2`,
|
|
742
|
-
headers:
|
|
742
|
+
headers: d
|
|
743
743
|
}));
|
|
744
744
|
}
|
|
745
745
|
async me() {
|
|
746
|
-
return (await
|
|
746
|
+
return (await h(this, b).call(this, "/me")).json();
|
|
747
747
|
}
|
|
748
748
|
async widgetPrelude() {
|
|
749
|
-
return (await
|
|
749
|
+
return (await h(this, b).call(this, "/prelude")).json();
|
|
750
750
|
}
|
|
751
751
|
async handleMessage(e) {
|
|
752
|
-
return (await
|
|
752
|
+
return (await h(this, b).call(this, "/chat/send", {
|
|
753
753
|
method: "POST",
|
|
754
754
|
body: JSON.stringify(e)
|
|
755
755
|
})).json();
|
|
@@ -757,55 +757,110 @@ class ie {
|
|
|
757
757
|
async getSessionHistory(e, s) {
|
|
758
758
|
const o = new URLSearchParams({
|
|
759
759
|
lastMessageTimestamp: s || ""
|
|
760
|
-
}),
|
|
761
|
-
return (await
|
|
760
|
+
}), d = `/session/history/${e}?${o.toString()}`;
|
|
761
|
+
return (await h(this, b).call(this, d, {
|
|
762
762
|
method: "GET"
|
|
763
763
|
})).json();
|
|
764
764
|
}
|
|
765
765
|
async createSession() {
|
|
766
|
-
return (await
|
|
766
|
+
return (await h(this, b).call(this, "/create-session", {
|
|
767
767
|
method: "POST"
|
|
768
768
|
})).json();
|
|
769
769
|
}
|
|
770
770
|
async getSession(e) {
|
|
771
|
-
return (await
|
|
771
|
+
return (await h(this, b).call(this, `/session/${e}`, {
|
|
772
772
|
method: "GET"
|
|
773
773
|
})).json();
|
|
774
774
|
}
|
|
775
775
|
async createContact(e) {
|
|
776
|
-
return (await
|
|
776
|
+
return (await h(this, b).call(this, "/contact/upsert", {
|
|
777
777
|
method: "POST",
|
|
778
778
|
body: JSON.stringify(e)
|
|
779
779
|
})).json();
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
-
|
|
782
|
+
b = new WeakMap();
|
|
783
|
+
function ce(t = {}) {
|
|
784
|
+
const {
|
|
785
|
+
level: e = "info",
|
|
786
|
+
prefix: s = "[openCx]",
|
|
787
|
+
enabled: o = !0
|
|
788
|
+
} = t;
|
|
789
|
+
let d = e;
|
|
790
|
+
const n = {
|
|
791
|
+
debug: 0,
|
|
792
|
+
info: 1,
|
|
793
|
+
warn: 2,
|
|
794
|
+
error: 3
|
|
795
|
+
};
|
|
796
|
+
function a(l) {
|
|
797
|
+
return o && n[l] >= n[d];
|
|
798
|
+
}
|
|
799
|
+
function i(l) {
|
|
800
|
+
return `${s} ${l}`;
|
|
801
|
+
}
|
|
802
|
+
function c(l) {
|
|
803
|
+
return l.map((r) => {
|
|
804
|
+
if (r instanceof Error)
|
|
805
|
+
return {
|
|
806
|
+
name: r.name,
|
|
807
|
+
message: r.message,
|
|
808
|
+
stack: r.stack
|
|
809
|
+
};
|
|
810
|
+
if (typeof r == "object")
|
|
811
|
+
try {
|
|
812
|
+
return JSON.stringify(r, null, 2);
|
|
813
|
+
} catch {
|
|
814
|
+
return r;
|
|
815
|
+
}
|
|
816
|
+
return r;
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
return {
|
|
820
|
+
debug(l, ...r) {
|
|
821
|
+
a("debug") && console.debug(i(l), ...c(r));
|
|
822
|
+
},
|
|
823
|
+
info(l, ...r) {
|
|
824
|
+
a("info") && console.info(i(l), ...c(r));
|
|
825
|
+
},
|
|
826
|
+
warn(l, ...r) {
|
|
827
|
+
a("warn") && console.warn(i(l), ...c(r));
|
|
828
|
+
},
|
|
829
|
+
error(l, ...r) {
|
|
830
|
+
a("error") && console.error(i(l), ...c(r));
|
|
831
|
+
},
|
|
832
|
+
setLevel(l) {
|
|
833
|
+
d = l;
|
|
834
|
+
}
|
|
835
|
+
};
|
|
836
|
+
}
|
|
783
837
|
export {
|
|
784
|
-
|
|
838
|
+
de as AIClosureType,
|
|
785
839
|
ie as ApiCaller,
|
|
786
840
|
ee as AuthenticationError,
|
|
787
841
|
Z as ConnectionError,
|
|
788
842
|
re as FileUploadError,
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
843
|
+
H as LifecycleEvent,
|
|
844
|
+
fe as MessageTypeEnum,
|
|
845
|
+
v as OpenCXError,
|
|
846
|
+
C as PubSub,
|
|
847
|
+
me as SentimentEnum,
|
|
848
|
+
ge as SessionChannel,
|
|
795
849
|
B as SessionError,
|
|
796
850
|
te as SessionNotDefinedError,
|
|
797
|
-
|
|
851
|
+
he as SessionStatus,
|
|
798
852
|
se as TransportError,
|
|
799
853
|
Se as chatAttachmentSchema,
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
854
|
+
pe as chatHistoryMessageSchema,
|
|
855
|
+
Ee as chatSessionSchema,
|
|
856
|
+
ye as consumerSchema,
|
|
803
857
|
ae as createChat,
|
|
804
858
|
oe as createConfig,
|
|
805
859
|
ne as createContact,
|
|
860
|
+
ce as createLogger,
|
|
806
861
|
W as createPubSub,
|
|
807
862
|
T as isStorageAvailable,
|
|
808
863
|
O as safeStorageOperation,
|
|
809
|
-
|
|
864
|
+
be as structuredSocketMessageSchema
|
|
810
865
|
};
|
|
811
866
|
//# sourceMappingURL=index.js.map
|