@opencx/widget 3.0.86 → 3.0.87
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/designs.cjs +23 -23
- package/dist/designs.cjs.map +1 -1
- package/dist/designs.js +2817 -2760
- package/dist/designs.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +12 -11
- package/dist/src/designs/react/hooks/useCanvas.d.ts +3 -0
- package/dist/src/designs/react/hooks/useTheme.d.ts +6 -0
- package/dist/src/designs/react/screens/chat/ChatCanvas.d.ts +2 -0
- package/dist/src/headless/core/__tests__/test-utils.d.ts +2 -2
- package/dist/src/headless/core/api/api-caller.d.ts +2 -2
- package/dist/src/headless/core/api/schema.d.ts +176 -75
- package/dist/src/headless/core/context/session.ctx.d.ts +8 -0
- package/dist/src/headless/core/context/widget.ctx.d.ts +2 -0
- package/dist/src/headless/core/types/dtos.d.ts +3 -2
- package/dist/src/headless/core/types/widget-config.d.ts +7 -0
- package/dist/src/headless/react/hooks/useModes.d.ts +12 -0
- package/dist/src/headless/react/hooks/useSessions.d.ts +12 -0
- package/dist/src/headless/react/index.d.ts +1 -0
- package/dist/{useWidgetTrigger-Bplu_1C-.cjs → useModes-C5Jd3NZU.cjs} +4 -4
- package/dist/useModes-C5Jd3NZU.cjs.map +1 -0
- package/dist/{useWidgetTrigger-Bi12WVrs.js → useModes-CCwRYrkY.js} +234 -225
- package/dist/useModes-CCwRYrkY.js.map +1 -0
- package/dist/{widget.ctx-oIT8sGvJ.cjs → widget.ctx-BIrCsbNY.cjs} +3 -3
- package/dist/{widget.ctx-oIT8sGvJ.cjs.map → widget.ctx-BIrCsbNY.cjs.map} +1 -1
- package/dist/{widget.ctx-DFFwNHvy.js → widget.ctx-D-BdBFz5.js} +54 -51
- package/dist/{widget.ctx-DFFwNHvy.js.map → widget.ctx-D-BdBFz5.js.map} +1 -1
- package/dist-embed/script.js +83 -83
- package/dist-embed/script.js.map +1 -1
- package/package.json +1 -1
- package/dist/useWidgetTrigger-Bi12WVrs.js.map +0 -1
- package/dist/useWidgetTrigger-Bplu_1C-.cjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { v4 as
|
|
1
|
+
import Y, { createContext as Me, useRef as W, useState as Fe, useMemo as oe, useEffect as se, useContext as Ue, useSyncExternalStore as Xt, useLayoutEffect as Qt, useCallback as Ee, useDebugValue as Zt } from "react";
|
|
2
|
+
import { v4 as en } from "uuid";
|
|
3
3
|
import { jsx as it } from "react/jsx-runtime";
|
|
4
|
-
import { W as
|
|
5
|
-
const
|
|
6
|
-
class
|
|
4
|
+
import { W as tn } from "./widget.ctx-D-BdBFz5.js";
|
|
5
|
+
const nn = "3.0.87";
|
|
6
|
+
class rn {
|
|
7
7
|
constructor(t) {
|
|
8
8
|
this.components = [];
|
|
9
9
|
const { components: n } = t;
|
|
@@ -28,7 +28,7 @@ class nn {
|
|
|
28
28
|
return (n = this.get(t)) == null ? void 0 : n.component;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
const at =
|
|
31
|
+
const at = Me(null);
|
|
32
32
|
function Qn({
|
|
33
33
|
options: e,
|
|
34
34
|
children: t,
|
|
@@ -36,14 +36,14 @@ function Qn({
|
|
|
36
36
|
storage: r,
|
|
37
37
|
loadingComponent: o
|
|
38
38
|
}) {
|
|
39
|
-
const s = W(null), i = W(!1), [f, h] =
|
|
40
|
-
() => new
|
|
39
|
+
const s = W(null), i = W(!1), [f, h] = Fe(null), c = oe(
|
|
40
|
+
() => new rn({
|
|
41
41
|
components: n
|
|
42
42
|
}),
|
|
43
43
|
[n]
|
|
44
44
|
);
|
|
45
45
|
return se(() => {
|
|
46
|
-
i.current || (i.current = !0,
|
|
46
|
+
i.current || (i.current = !0, tn.initialize({ config: e, storage: r }).then(h));
|
|
47
47
|
}, []), f ? /* @__PURE__ */ it(
|
|
48
48
|
at.Provider,
|
|
49
49
|
{
|
|
@@ -52,39 +52,39 @@ function Qn({
|
|
|
52
52
|
config: e,
|
|
53
53
|
components: n,
|
|
54
54
|
componentStore: c,
|
|
55
|
-
version:
|
|
55
|
+
version: nn,
|
|
56
56
|
contentIframeRef: s
|
|
57
57
|
},
|
|
58
58
|
children: t
|
|
59
59
|
}
|
|
60
60
|
) : o || null;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function K() {
|
|
63
63
|
const e = Ue(at);
|
|
64
64
|
if (!e)
|
|
65
65
|
throw new Error("useWidget must be used within a WidgetProvider");
|
|
66
66
|
return e;
|
|
67
67
|
}
|
|
68
68
|
function ut() {
|
|
69
|
-
const { config: e } =
|
|
69
|
+
const { config: e } = K();
|
|
70
70
|
return e;
|
|
71
71
|
}
|
|
72
72
|
function ie(e) {
|
|
73
|
-
return
|
|
73
|
+
return Xt(e.subscribe, e.get, e.get);
|
|
74
74
|
}
|
|
75
75
|
function Zn() {
|
|
76
|
-
const { widgetCtx: e } =
|
|
76
|
+
const { widgetCtx: e } = K();
|
|
77
77
|
return {
|
|
78
78
|
contactState: ie(e.contactCtx.state),
|
|
79
79
|
createUnverifiedContact: e.contactCtx.createUnverifiedContact
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
const { widgetCtx: e } =
|
|
82
|
+
function on() {
|
|
83
|
+
const { widgetCtx: e } = K();
|
|
84
84
|
return { messagesState: ie(e.messageCtx.state), sendMessage: e.messageCtx.sendMessage };
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
const { widgetCtx: e } =
|
|
86
|
+
function ct() {
|
|
87
|
+
const { widgetCtx: e } = K(), { oneOpenSessionAllowed: t } = ut(), n = ie(e.sessionCtx.sessionState), r = ie(e.sessionCtx.sessionsState), { openSessions: o, closedSessions: s } = oe(() => ({
|
|
88
88
|
openSessions: r.data.filter((f) => f.isOpened === !0),
|
|
89
89
|
closedSessions: r.data.filter((f) => f.isOpened === !1)
|
|
90
90
|
}), [r.data]), i = oe(() => t ? o.length === 0 : !0, [t, o.length]);
|
|
@@ -100,7 +100,7 @@ function on() {
|
|
|
100
100
|
}
|
|
101
101
|
function er() {
|
|
102
102
|
var i;
|
|
103
|
-
const { sessionState: e } =
|
|
103
|
+
const { sessionState: e } = ct(), { messagesState: t } = on(), n = ((i = e.session) == null ? void 0 : i.assignee.kind) === "ai", r = t.messages.length > 0 ? t.messages[t.messages.length - 1] : null, o = (r == null ? void 0 : r.type) === "FROM_USER";
|
|
104
104
|
return { isAwaitingBotReply: (n || e.isCreatingSession) && (t.isSendingMessage || o) };
|
|
105
105
|
}
|
|
106
106
|
var tr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -140,7 +140,7 @@ var Ze;
|
|
|
140
140
|
function an() {
|
|
141
141
|
if (Ze) return we;
|
|
142
142
|
Ze = 1;
|
|
143
|
-
var e =
|
|
143
|
+
var e = Y;
|
|
144
144
|
function t(u, d) {
|
|
145
145
|
return u === d && (u !== 0 || 1 / u === 1 / d) || u !== u && d !== d;
|
|
146
146
|
}
|
|
@@ -185,19 +185,19 @@ var et;
|
|
|
185
185
|
function un() {
|
|
186
186
|
return et || (et = 1, process.env.NODE_ENV !== "production" && function() {
|
|
187
187
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
188
|
-
var e =
|
|
188
|
+
var e = Y, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
189
189
|
function n(O) {
|
|
190
190
|
{
|
|
191
|
-
for (var v = arguments.length,
|
|
192
|
-
S
|
|
193
|
-
r("error", O,
|
|
191
|
+
for (var v = arguments.length, E = new Array(v > 1 ? v - 1 : 0), S = 1; S < v; S++)
|
|
192
|
+
E[S - 1] = arguments[S];
|
|
193
|
+
r("error", O, E);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
function r(O, v,
|
|
196
|
+
function r(O, v, E) {
|
|
197
197
|
{
|
|
198
|
-
var
|
|
199
|
-
|
|
200
|
-
var w =
|
|
198
|
+
var S = t.ReactDebugCurrentFrame, I = S.getStackAddendum();
|
|
199
|
+
I !== "" && (v += "%s", E = E.concat([I]));
|
|
200
|
+
var w = E.map(function(C) {
|
|
201
201
|
return String(C);
|
|
202
202
|
});
|
|
203
203
|
w.unshift("Warning: " + v), Function.prototype.apply.call(console[O], console, w);
|
|
@@ -207,24 +207,24 @@ function un() {
|
|
|
207
207
|
return O === v && (O !== 0 || 1 / O === 1 / v) || O !== O && v !== v;
|
|
208
208
|
}
|
|
209
209
|
var s = typeof Object.is == "function" ? Object.is : o, i = e.useState, f = e.useEffect, h = e.useLayoutEffect, c = e.useDebugValue, a = !1, u = !1;
|
|
210
|
-
function d(O, v,
|
|
210
|
+
function d(O, v, E) {
|
|
211
211
|
a || e.startTransition !== void 0 && (a = !0, n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
|
212
|
-
var
|
|
212
|
+
var S = v();
|
|
213
213
|
if (!u) {
|
|
214
|
-
var
|
|
215
|
-
s(
|
|
214
|
+
var I = v();
|
|
215
|
+
s(S, I) || (n("The result of getSnapshot should be cached to avoid an infinite loop"), u = !0);
|
|
216
216
|
}
|
|
217
217
|
var w = i({
|
|
218
218
|
inst: {
|
|
219
|
-
value:
|
|
219
|
+
value: S,
|
|
220
220
|
getSnapshot: v
|
|
221
221
|
}
|
|
222
222
|
}), C = w[0].inst, j = w[1];
|
|
223
223
|
return h(function() {
|
|
224
|
-
C.value =
|
|
224
|
+
C.value = S, C.getSnapshot = v, l(C) && j({
|
|
225
225
|
inst: C
|
|
226
226
|
});
|
|
227
|
-
}, [O,
|
|
227
|
+
}, [O, S, v]), f(function() {
|
|
228
228
|
l(C) && j({
|
|
229
229
|
inst: C
|
|
230
230
|
});
|
|
@@ -234,18 +234,18 @@ function un() {
|
|
|
234
234
|
});
|
|
235
235
|
};
|
|
236
236
|
return O(B);
|
|
237
|
-
}, [O]), c(
|
|
237
|
+
}, [O]), c(S), S;
|
|
238
238
|
}
|
|
239
239
|
function l(O) {
|
|
240
|
-
var v = O.getSnapshot,
|
|
240
|
+
var v = O.getSnapshot, E = O.value;
|
|
241
241
|
try {
|
|
242
|
-
var
|
|
243
|
-
return !s(
|
|
242
|
+
var S = v();
|
|
243
|
+
return !s(E, S);
|
|
244
244
|
} catch {
|
|
245
245
|
return !0;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
function y(O, v,
|
|
248
|
+
function y(O, v, E) {
|
|
249
249
|
return v();
|
|
250
250
|
}
|
|
251
251
|
var _ = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", T = !_, p = T ? y : d, k = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : p;
|
|
@@ -258,10 +258,10 @@ const $ = () => {
|
|
|
258
258
|
}, P = (
|
|
259
259
|
/*#__NOINLINE__*/
|
|
260
260
|
$()
|
|
261
|
-
), be = Object, g = (e) => e === P,
|
|
261
|
+
), be = Object, g = (e) => e === P, M = (e) => typeof e == "function", G = (e, t) => ({
|
|
262
262
|
...e,
|
|
263
263
|
...t
|
|
264
|
-
}), fn = (e) =>
|
|
264
|
+
}), fn = (e) => M(e.then), le = /* @__PURE__ */ new WeakMap();
|
|
265
265
|
let ln = 0;
|
|
266
266
|
const ae = (e) => {
|
|
267
267
|
const t = typeof e, n = e && e.constructor, r = n == Date;
|
|
@@ -283,7 +283,7 @@ const ae = (e) => {
|
|
|
283
283
|
} else
|
|
284
284
|
o = r ? e.toJSON() : t == "symbol" ? e.toString() : t == "string" ? JSON.stringify(e) : "" + e;
|
|
285
285
|
return o;
|
|
286
|
-
}, q = /* @__PURE__ */ new WeakMap(), Oe = {}, de = {}, We = "undefined", ye = typeof window != We, xe = typeof document != We, dn = () => ye && typeof window.requestAnimationFrame != We,
|
|
286
|
+
}, q = /* @__PURE__ */ new WeakMap(), Oe = {}, de = {}, We = "undefined", ye = typeof window != We, xe = typeof document != We, dn = () => ye && typeof window.requestAnimationFrame != We, ft = (e, t) => {
|
|
287
287
|
const n = q.get(e);
|
|
288
288
|
return [
|
|
289
289
|
// Getter
|
|
@@ -302,7 +302,7 @@ const ae = (e) => {
|
|
|
302
302
|
];
|
|
303
303
|
};
|
|
304
304
|
let je = !0;
|
|
305
|
-
const pn = () => je, [Pe,
|
|
305
|
+
const pn = () => je, [Pe, Ie] = ye && window.addEventListener ? [
|
|
306
306
|
window.addEventListener.bind(window),
|
|
307
307
|
window.removeEventListener.bind(window)
|
|
308
308
|
] : [
|
|
@@ -312,7 +312,7 @@ const pn = () => je, [Pe, Le] = ye && window.addEventListener ? [
|
|
|
312
312
|
const e = xe && document.visibilityState;
|
|
313
313
|
return g(e) || e !== "hidden";
|
|
314
314
|
}, _n = (e) => (xe && document.addEventListener("visibilitychange", e), Pe("focus", e), () => {
|
|
315
|
-
xe && document.removeEventListener("visibilitychange", e),
|
|
315
|
+
xe && document.removeEventListener("visibilitychange", e), Ie("focus", e);
|
|
316
316
|
}), yn = (e) => {
|
|
317
317
|
const t = () => {
|
|
318
318
|
je = !0, e();
|
|
@@ -320,7 +320,7 @@ const pn = () => je, [Pe, Le] = ye && window.addEventListener ? [
|
|
|
320
320
|
je = !1;
|
|
321
321
|
};
|
|
322
322
|
return Pe("online", t), Pe("offline", n), () => {
|
|
323
|
-
|
|
323
|
+
Ie("online", t), Ie("offline", n);
|
|
324
324
|
};
|
|
325
325
|
}, gn = {
|
|
326
326
|
isOnline: pn,
|
|
@@ -328,11 +328,11 @@ const pn = () => je, [Pe, Le] = ye && window.addEventListener ? [
|
|
|
328
328
|
}, vn = {
|
|
329
329
|
initFocus: _n,
|
|
330
330
|
initReconnect: yn
|
|
331
|
-
}, tt = !
|
|
331
|
+
}, tt = !Y.useId, ue = !ye || "Deno" in window, Sn = (e) => dn() ? window.requestAnimationFrame(e) : setTimeout(e, 1), Re = ue ? se : Qt, Te = typeof navigator < "u" && navigator.connection, nt = !ue && Te && ([
|
|
332
332
|
"slow-2g",
|
|
333
333
|
"2g"
|
|
334
334
|
].includes(Te.effectiveType) || Te.saveData), qe = (e) => {
|
|
335
|
-
if (
|
|
335
|
+
if (M(e))
|
|
336
336
|
try {
|
|
337
337
|
e = e();
|
|
338
338
|
} catch {
|
|
@@ -344,16 +344,16 @@ const pn = () => je, [Pe, Le] = ye && window.addEventListener ? [
|
|
|
344
344
|
t
|
|
345
345
|
];
|
|
346
346
|
};
|
|
347
|
-
let
|
|
348
|
-
const
|
|
347
|
+
let En = 0;
|
|
348
|
+
const Le = () => ++En, lt = 0, dt = 1, pt = 2, wn = 3;
|
|
349
349
|
var re = {
|
|
350
350
|
__proto__: null,
|
|
351
351
|
ERROR_REVALIDATE_EVENT: wn,
|
|
352
|
-
FOCUS_EVENT:
|
|
353
|
-
MUTATE_EVENT:
|
|
354
|
-
RECONNECT_EVENT:
|
|
352
|
+
FOCUS_EVENT: lt,
|
|
353
|
+
MUTATE_EVENT: pt,
|
|
354
|
+
RECONNECT_EVENT: dt
|
|
355
355
|
};
|
|
356
|
-
async function
|
|
356
|
+
async function ht(...e) {
|
|
357
357
|
const [t, n, r, o] = e, s = G({
|
|
358
358
|
populateCache: !0,
|
|
359
359
|
throwOnError: !0
|
|
@@ -364,7 +364,7 @@ async function pt(...e) {
|
|
|
364
364
|
const f = s.rollbackOnError;
|
|
365
365
|
let h = s.optimisticData;
|
|
366
366
|
const c = (d) => typeof f == "function" ? f(d) : f !== !1, a = s.throwOnError;
|
|
367
|
-
if (
|
|
367
|
+
if (M(n)) {
|
|
368
368
|
const d = n, l = [], y = t.keys();
|
|
369
369
|
for (const _ of y)
|
|
370
370
|
// Skip the special useSWRInfinite and useSWRSubscription keys.
|
|
@@ -375,41 +375,41 @@ async function pt(...e) {
|
|
|
375
375
|
async function u(d) {
|
|
376
376
|
const [l] = qe(d);
|
|
377
377
|
if (!l) return;
|
|
378
|
-
const [y, _] =
|
|
378
|
+
const [y, _] = ft(t, l), [T, p, k, O] = q.get(t), v = () => {
|
|
379
379
|
const V = T[l];
|
|
380
|
-
return (
|
|
380
|
+
return (M(s.revalidate) ? s.revalidate(y().data, d) : s.revalidate !== !1) && (delete k[l], delete O[l], V && V[0]) ? V[0](pt).then(() => y().data) : y().data;
|
|
381
381
|
};
|
|
382
382
|
if (e.length < 3)
|
|
383
383
|
return v();
|
|
384
|
-
let
|
|
385
|
-
const
|
|
384
|
+
let E = r, S;
|
|
385
|
+
const I = Le();
|
|
386
386
|
p[l] = [
|
|
387
|
-
|
|
387
|
+
I,
|
|
388
388
|
0
|
|
389
389
|
];
|
|
390
|
-
const w = !g(h), C = y(), j = C.data, B = C._c,
|
|
391
|
-
if (w && (h =
|
|
390
|
+
const w = !g(h), C = y(), j = C.data, B = C._c, z = g(B) ? j : B;
|
|
391
|
+
if (w && (h = M(h) ? h(z, j) : h, _({
|
|
392
392
|
data: h,
|
|
393
|
-
_c:
|
|
394
|
-
})),
|
|
393
|
+
_c: z
|
|
394
|
+
})), M(E))
|
|
395
395
|
try {
|
|
396
|
-
|
|
396
|
+
E = E(z);
|
|
397
397
|
} catch (V) {
|
|
398
|
-
|
|
398
|
+
S = V;
|
|
399
399
|
}
|
|
400
|
-
if (
|
|
401
|
-
if (
|
|
402
|
-
|
|
403
|
-
}),
|
|
404
|
-
if (
|
|
405
|
-
return
|
|
406
|
-
} else
|
|
407
|
-
data:
|
|
400
|
+
if (E && fn(E))
|
|
401
|
+
if (E = await E.catch((V) => {
|
|
402
|
+
S = V;
|
|
403
|
+
}), I !== p[l][0]) {
|
|
404
|
+
if (S) throw S;
|
|
405
|
+
return E;
|
|
406
|
+
} else S && w && c(S) && (i = !0, _({
|
|
407
|
+
data: z,
|
|
408
408
|
_c: P
|
|
409
409
|
}));
|
|
410
|
-
if (i && !
|
|
411
|
-
if (
|
|
412
|
-
const V = i(
|
|
410
|
+
if (i && !S)
|
|
411
|
+
if (M(i)) {
|
|
412
|
+
const V = i(E, z);
|
|
413
413
|
_({
|
|
414
414
|
data: V,
|
|
415
415
|
error: P,
|
|
@@ -417,19 +417,19 @@ async function pt(...e) {
|
|
|
417
417
|
});
|
|
418
418
|
} else
|
|
419
419
|
_({
|
|
420
|
-
data:
|
|
420
|
+
data: E,
|
|
421
421
|
error: P,
|
|
422
422
|
_c: P
|
|
423
423
|
});
|
|
424
|
-
if (p[l][1] =
|
|
424
|
+
if (p[l][1] = Le(), Promise.resolve(v()).then(() => {
|
|
425
425
|
_({
|
|
426
426
|
_c: P
|
|
427
427
|
});
|
|
428
|
-
}),
|
|
429
|
-
if (a) throw
|
|
428
|
+
}), S) {
|
|
429
|
+
if (a) throw S;
|
|
430
430
|
return;
|
|
431
431
|
}
|
|
432
|
-
return
|
|
432
|
+
return E;
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
const rt = (e, t) => {
|
|
@@ -437,7 +437,7 @@ const rt = (e, t) => {
|
|
|
437
437
|
e[n][0] && e[n][0](t);
|
|
438
438
|
}, mn = (e, t) => {
|
|
439
439
|
if (!q.has(e)) {
|
|
440
|
-
const n = G(vn, t), r = {}, o =
|
|
440
|
+
const n = G(vn, t), r = {}, o = ht.bind(P, e);
|
|
441
441
|
let s = $;
|
|
442
442
|
const i = {}, f = (a, u) => {
|
|
443
443
|
const d = i[a] || [];
|
|
@@ -458,7 +458,7 @@ const rt = (e, t) => {
|
|
|
458
458
|
h,
|
|
459
459
|
f
|
|
460
460
|
]), !ue)) {
|
|
461
|
-
const a = n.initFocus(setTimeout.bind(P, rt.bind(P, r,
|
|
461
|
+
const a = n.initFocus(setTimeout.bind(P, rt.bind(P, r, lt))), u = n.initReconnect(setTimeout.bind(P, rt.bind(P, r, dt)));
|
|
462
462
|
s = () => {
|
|
463
463
|
a && a(), u && u(), q.delete(e);
|
|
464
464
|
};
|
|
@@ -478,7 +478,7 @@ const rt = (e, t) => {
|
|
|
478
478
|
}, bn = (e, t, n, r, o) => {
|
|
479
479
|
const s = n.errorRetryCount, i = o.retryCount, f = ~~((Math.random() + 0.5) * (1 << (i < 8 ? i : 8))) * n.errorRetryInterval;
|
|
480
480
|
!g(s) && i > s || setTimeout(r, f, o);
|
|
481
|
-
}, On = (e, t) => ae(e) == ae(t), [
|
|
481
|
+
}, On = (e, t) => ae(e) == ae(t), [_t, Rn] = mn(/* @__PURE__ */ new Map()), Tn = G(
|
|
482
482
|
{
|
|
483
483
|
// events
|
|
484
484
|
onLoadingSlow: $,
|
|
@@ -499,7 +499,7 @@ const rt = (e, t) => {
|
|
|
499
499
|
// providers
|
|
500
500
|
compare: On,
|
|
501
501
|
isPaused: () => !1,
|
|
502
|
-
cache:
|
|
502
|
+
cache: _t,
|
|
503
503
|
mutate: Rn,
|
|
504
504
|
fallback: {}
|
|
505
505
|
},
|
|
@@ -512,9 +512,9 @@ const rt = (e, t) => {
|
|
|
512
512
|
r && s && (n.use = r.concat(s)), o && i && (n.fallback = G(o, i));
|
|
513
513
|
}
|
|
514
514
|
return n;
|
|
515
|
-
}, An =
|
|
516
|
-
|
|
517
|
-
}, Pn = (e) =>
|
|
515
|
+
}, An = Me({}), Dn = "$inf$", yt = ye && window.__SWR_DEVTOOLS_USE__, xn = yt ? window.__SWR_DEVTOOLS_USE__ : [], jn = () => {
|
|
516
|
+
yt && (window.__SWR_DEVTOOLS_REACT__ = Y);
|
|
517
|
+
}, Pn = (e) => M(e[1]) ? [
|
|
518
518
|
e[0],
|
|
519
519
|
e[1],
|
|
520
520
|
e[2] || {}
|
|
@@ -522,20 +522,20 @@ const rt = (e, t) => {
|
|
|
522
522
|
e[0],
|
|
523
523
|
null,
|
|
524
524
|
(e[1] === null ? e[2] : e[1]) || {}
|
|
525
|
-
],
|
|
526
|
-
const [i] = qe(t), [, , , f] = q.get(
|
|
525
|
+
], In = () => G(Tn, Ue(An)), Ln = (e) => (t, n, r) => e(t, n && ((...s) => {
|
|
526
|
+
const [i] = qe(t), [, , , f] = q.get(_t);
|
|
527
527
|
if (i.startsWith(Dn))
|
|
528
528
|
return n(...s);
|
|
529
529
|
const h = f[i];
|
|
530
530
|
return g(h) ? n(...s) : (delete f[i], h);
|
|
531
|
-
}), r), Vn = xn.concat(
|
|
532
|
-
const r =
|
|
531
|
+
}), r), Vn = xn.concat(Ln), Nn = (e) => function(...n) {
|
|
532
|
+
const r = In(), [o, s, i] = Pn(n), f = Cn(r, i);
|
|
533
533
|
let h = e;
|
|
534
534
|
const { use: c } = f, a = (c || []).concat(Vn);
|
|
535
535
|
for (let u = a.length; u--; )
|
|
536
536
|
h = a[u](h);
|
|
537
537
|
return h(o, s || f.fetcher || null, f);
|
|
538
|
-
},
|
|
538
|
+
}, Mn = (e, t, n) => {
|
|
539
539
|
const r = t[e] || (t[e] = []);
|
|
540
540
|
return r.push(n), () => {
|
|
541
541
|
const o = r.indexOf(n);
|
|
@@ -543,7 +543,7 @@ const rt = (e, t) => {
|
|
|
543
543
|
};
|
|
544
544
|
};
|
|
545
545
|
jn();
|
|
546
|
-
const ot =
|
|
546
|
+
const ot = Y.use || ((e) => {
|
|
547
547
|
if (e.status === "pending")
|
|
548
548
|
throw e;
|
|
549
549
|
if (e.status === "fulfilled")
|
|
@@ -555,8 +555,8 @@ const ot = z.use || ((e) => {
|
|
|
555
555
|
}), e);
|
|
556
556
|
}), Ce = {
|
|
557
557
|
dedupe: !0
|
|
558
|
-
},
|
|
559
|
-
const { cache: r, compare: o, suspense: s, fallbackData: i, revalidateOnMount: f, revalidateIfStale: h, refreshInterval: c, refreshWhenHidden: a, refreshWhenOffline: u, keepPreviousData: d } = n, [l, y, _, T] = q.get(r), [p, k] = qe(e), O = W(!1), v = W(!1),
|
|
558
|
+
}, Fn = (e, t, n) => {
|
|
559
|
+
const { cache: r, compare: o, suspense: s, fallbackData: i, revalidateOnMount: f, revalidateIfStale: h, refreshInterval: c, refreshWhenHidden: a, refreshWhenOffline: u, keepPreviousData: d } = n, [l, y, _, T] = q.get(r), [p, k] = qe(e), O = W(!1), v = W(!1), E = W(p), S = W(t), I = W(n), w = () => I.current, C = () => w().isVisible() && w().isOnline(), [j, B, z, V] = ft(r, p), J = W({}).current, Kt = g(i) ? n.fallback[p] : i, He = (m, b) => {
|
|
560
560
|
for (const D in J) {
|
|
561
561
|
const R = D;
|
|
562
562
|
if (R === "data") {
|
|
@@ -568,12 +568,12 @@ const ot = z.use || ((e) => {
|
|
|
568
568
|
return !0;
|
|
569
569
|
}, $e = oe(() => {
|
|
570
570
|
const m = !p || !t ? !1 : g(f) ? w().isPaused() || s ? !1 : g(h) ? !0 : h : f, b = (x) => {
|
|
571
|
-
const
|
|
572
|
-
return delete
|
|
571
|
+
const F = G(x);
|
|
572
|
+
return delete F._k, m ? {
|
|
573
573
|
isValidating: !0,
|
|
574
574
|
isLoading: !0,
|
|
575
|
-
...
|
|
576
|
-
} :
|
|
575
|
+
...F
|
|
576
|
+
} : F;
|
|
577
577
|
}, D = j(), R = V(), N = b(D), ee = D === R ? N : b(R);
|
|
578
578
|
let A = N;
|
|
579
579
|
return [
|
|
@@ -586,8 +586,8 @@ const ot = z.use || ((e) => {
|
|
|
586
586
|
}, [
|
|
587
587
|
r,
|
|
588
588
|
p
|
|
589
|
-
]), X = cn.useSyncExternalStore(
|
|
590
|
-
(m) =>
|
|
589
|
+
]), X = cn.useSyncExternalStore(Ee(
|
|
590
|
+
(m) => z(p, (b, D) => {
|
|
591
591
|
He(D, b) || m();
|
|
592
592
|
}),
|
|
593
593
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -595,20 +595,20 @@ const ot = z.use || ((e) => {
|
|
|
595
595
|
r,
|
|
596
596
|
p
|
|
597
597
|
]
|
|
598
|
-
), $e[0], $e[1]), Ge = !O.current,
|
|
598
|
+
), $e[0], $e[1]), Ge = !O.current, zt = l[p] && l[p].length > 0, Q = X.data, Z = g(Q) ? Kt : Q, ce = X.error, Ke = W(Z), fe = d ? g(Q) ? Ke.current : Q : Z, ze = zt && !g(ce) ? !1 : Ge && !g(f) ? f : w().isPaused() ? !1 : s ? g(Z) ? !1 : h : g(Z) || h, Ye = !!(p && t && Ge && ze), Yt = g(X.isValidating) ? Ye : X.isValidating, kt = g(X.isLoading) ? Ye : X.isLoading, ne = Ee(
|
|
599
599
|
async (m) => {
|
|
600
|
-
const b =
|
|
600
|
+
const b = S.current;
|
|
601
601
|
if (!p || !b || v.current || w().isPaused())
|
|
602
602
|
return !1;
|
|
603
603
|
let D, R, N = !0;
|
|
604
|
-
const ee = m || {}, A = !_[p] || !ee.dedupe, x = () => tt ? !v.current && p ===
|
|
604
|
+
const ee = m || {}, A = !_[p] || !ee.dedupe, x = () => tt ? !v.current && p === E.current && O.current : p === E.current, F = {
|
|
605
605
|
isValidating: !1,
|
|
606
606
|
isLoading: !1
|
|
607
607
|
}, Je = () => {
|
|
608
|
-
B(
|
|
608
|
+
B(F);
|
|
609
609
|
}, Xe = () => {
|
|
610
|
-
const
|
|
611
|
-
|
|
610
|
+
const L = _[p];
|
|
611
|
+
L && L[1] === R && delete _[p];
|
|
612
612
|
}, Qe = {
|
|
613
613
|
isValidating: !0
|
|
614
614
|
};
|
|
@@ -618,24 +618,24 @@ const ot = z.use || ((e) => {
|
|
|
618
618
|
N && x() && w().onLoadingSlow(p, n);
|
|
619
619
|
}, n.loadingTimeout), _[p] = [
|
|
620
620
|
b(k),
|
|
621
|
-
|
|
621
|
+
Le()
|
|
622
622
|
]), [D, R] = _[p], D = await D, A && setTimeout(Xe, n.dedupingInterval), !_[p] || _[p][1] !== R)
|
|
623
623
|
return A && x() && w().onDiscarded(p), !1;
|
|
624
|
-
|
|
625
|
-
const
|
|
626
|
-
if (!g(
|
|
627
|
-
(R <=
|
|
628
|
-
R <=
|
|
629
|
-
|
|
624
|
+
F.error = P;
|
|
625
|
+
const L = y[p];
|
|
626
|
+
if (!g(L) && // case 1
|
|
627
|
+
(R <= L[0] || // case 2
|
|
628
|
+
R <= L[1] || // case 3
|
|
629
|
+
L[1] === 0))
|
|
630
630
|
return Je(), A && x() && w().onDiscarded(p), !1;
|
|
631
631
|
const U = j().data;
|
|
632
|
-
|
|
633
|
-
} catch (
|
|
632
|
+
F.data = o(U, D) ? U : D, A && x() && w().onSuccess(D, p, n);
|
|
633
|
+
} catch (L) {
|
|
634
634
|
Xe();
|
|
635
635
|
const U = w(), { shouldRetryOnError: ve } = U;
|
|
636
|
-
U.isPaused() || (
|
|
637
|
-
const
|
|
638
|
-
|
|
636
|
+
U.isPaused() || (F.error = L, A && x() && (U.onError(L, p, U), (ve === !0 || M(ve) && ve(L)) && (!w().revalidateOnFocus || !w().revalidateOnReconnect || C()) && U.onErrorRetry(L, p, U, (Jt) => {
|
|
637
|
+
const Se = l[p];
|
|
638
|
+
Se && Se[0] && Se[0](re.ERROR_REVALIDATE_EVENT, Jt);
|
|
639
639
|
}, {
|
|
640
640
|
retryCount: (ee.retryCount || 0) + 1,
|
|
641
641
|
dedupe: !0
|
|
@@ -658,19 +658,19 @@ const ot = z.use || ((e) => {
|
|
|
658
658
|
p,
|
|
659
659
|
r
|
|
660
660
|
]
|
|
661
|
-
), ke =
|
|
661
|
+
), ke = Ee(
|
|
662
662
|
// Use callback to make sure `keyRef.current` returns latest result every time
|
|
663
|
-
(...m) =>
|
|
663
|
+
(...m) => ht(r, E.current, ...m),
|
|
664
664
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
665
665
|
[]
|
|
666
666
|
);
|
|
667
667
|
if (Re(() => {
|
|
668
|
-
|
|
668
|
+
S.current = t, I.current = n, g(Q) || (Ke.current = Q);
|
|
669
669
|
}), Re(() => {
|
|
670
670
|
if (!p) return;
|
|
671
671
|
const m = ne.bind(P, Ce);
|
|
672
672
|
let b = 0;
|
|
673
|
-
const R =
|
|
673
|
+
const R = Mn(p, l, (N, ee = {}) => {
|
|
674
674
|
if (N == re.FOCUS_EVENT) {
|
|
675
675
|
const A = Date.now();
|
|
676
676
|
w().revalidateOnFocus && A > b && C() && (b = A + w().focusThrottleInterval, m());
|
|
@@ -683,9 +683,9 @@ const ot = z.use || ((e) => {
|
|
|
683
683
|
return ne(ee);
|
|
684
684
|
}
|
|
685
685
|
});
|
|
686
|
-
return v.current = !1,
|
|
686
|
+
return v.current = !1, E.current = p, O.current = !0, B({
|
|
687
687
|
_k: k
|
|
688
|
-
}), ze && (g(Z) || ue ? m() :
|
|
688
|
+
}), ze && (g(Z) || ue ? m() : Sn(m)), () => {
|
|
689
689
|
v.current = !0, R();
|
|
690
690
|
};
|
|
691
691
|
}, [
|
|
@@ -693,7 +693,7 @@ const ot = z.use || ((e) => {
|
|
|
693
693
|
]), Re(() => {
|
|
694
694
|
let m;
|
|
695
695
|
function b() {
|
|
696
|
-
const R =
|
|
696
|
+
const R = M(c) ? c(j().data) : c;
|
|
697
697
|
R && m !== -1 && (m = setTimeout(D, R));
|
|
698
698
|
}
|
|
699
699
|
function D() {
|
|
@@ -707,10 +707,10 @@ const ot = z.use || ((e) => {
|
|
|
707
707
|
a,
|
|
708
708
|
u,
|
|
709
709
|
p
|
|
710
|
-
]),
|
|
710
|
+
]), Zt(fe), s && g(Z) && p) {
|
|
711
711
|
if (!tt && ue)
|
|
712
712
|
throw new Error("Fallback data is required when using suspense in SSR.");
|
|
713
|
-
|
|
713
|
+
S.current = t, I.current = n, v.current = !1;
|
|
714
714
|
const m = T[p];
|
|
715
715
|
if (!g(m)) {
|
|
716
716
|
const b = ke(m);
|
|
@@ -731,35 +731,35 @@ const ot = z.use || ((e) => {
|
|
|
731
731
|
return J.error = !0, ce;
|
|
732
732
|
},
|
|
733
733
|
get isValidating() {
|
|
734
|
-
return J.isValidating = !0,
|
|
734
|
+
return J.isValidating = !0, Yt;
|
|
735
735
|
},
|
|
736
736
|
get isLoading() {
|
|
737
|
-
return J.isLoading = !0,
|
|
737
|
+
return J.isLoading = !0, kt;
|
|
738
738
|
}
|
|
739
739
|
};
|
|
740
|
-
}, Un = Nn(
|
|
740
|
+
}, Un = Nn(Fn);
|
|
741
741
|
function rr() {
|
|
742
|
-
const { widgetCtx: e } =
|
|
742
|
+
const { widgetCtx: e } = K();
|
|
743
743
|
return Un([e.config.token], e.api.widgetPrelude, {
|
|
744
744
|
revalidateOnFocus: !1
|
|
745
745
|
});
|
|
746
746
|
}
|
|
747
747
|
function or() {
|
|
748
|
-
const { widgetCtx: e } =
|
|
748
|
+
const { widgetCtx: e } = K();
|
|
749
749
|
return {
|
|
750
750
|
routerState: ie(e.routerCtx.state),
|
|
751
751
|
toSessionsScreen: e.routerCtx.toSessionsScreen,
|
|
752
752
|
toChatScreen: e.routerCtx.toChatScreen
|
|
753
753
|
};
|
|
754
754
|
}
|
|
755
|
-
var
|
|
755
|
+
var gt = {}, Ve = function(e, t) {
|
|
756
756
|
return Ve = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
757
757
|
n.__proto__ = r;
|
|
758
758
|
} || function(n, r) {
|
|
759
759
|
for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (n[o] = r[o]);
|
|
760
760
|
}, Ve(e, t);
|
|
761
761
|
};
|
|
762
|
-
function
|
|
762
|
+
function vt(e, t) {
|
|
763
763
|
if (typeof t != "function" && t !== null)
|
|
764
764
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
765
765
|
Ve(e, t);
|
|
@@ -777,7 +777,7 @@ var he = function() {
|
|
|
777
777
|
return t;
|
|
778
778
|
}, he.apply(this, arguments);
|
|
779
779
|
};
|
|
780
|
-
function
|
|
780
|
+
function St(e, t) {
|
|
781
781
|
var n = {};
|
|
782
782
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
783
783
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -791,12 +791,12 @@ function Et(e, t, n, r) {
|
|
|
791
791
|
else for (var f = e.length - 1; f >= 0; f--) (i = e[f]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, n, s) : i(t, n)) || s);
|
|
792
792
|
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
793
793
|
}
|
|
794
|
-
function
|
|
794
|
+
function wt(e, t) {
|
|
795
795
|
return function(n, r) {
|
|
796
796
|
t(n, r, e);
|
|
797
797
|
};
|
|
798
798
|
}
|
|
799
|
-
function
|
|
799
|
+
function mt(e, t, n, r, o, s) {
|
|
800
800
|
function i(p) {
|
|
801
801
|
if (p !== void 0 && typeof p != "function") throw new TypeError("Function expected");
|
|
802
802
|
return p;
|
|
@@ -818,21 +818,21 @@ function wt(e, t, n, r, o, s) {
|
|
|
818
818
|
}
|
|
819
819
|
c && Object.defineProperty(c, r.name, a), d = !0;
|
|
820
820
|
}
|
|
821
|
-
function
|
|
821
|
+
function bt(e, t, n) {
|
|
822
822
|
for (var r = arguments.length > 2, o = 0; o < t.length; o++)
|
|
823
823
|
n = r ? t[o].call(e, n) : t[o].call(e);
|
|
824
824
|
return r ? n : void 0;
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function Ot(e) {
|
|
827
827
|
return typeof e == "symbol" ? e : "".concat(e);
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function Rt(e, t, n) {
|
|
830
830
|
return typeof t == "symbol" && (t = t.description ? "[".concat(t.description, "]") : ""), Object.defineProperty(e, "name", { configurable: !0, value: n ? "".concat(n, " ", t) : t });
|
|
831
831
|
}
|
|
832
|
-
function
|
|
832
|
+
function Tt(e, t) {
|
|
833
833
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function Ct(e, t, n, r) {
|
|
836
836
|
function o(s) {
|
|
837
837
|
return s instanceof n ? s : new n(function(i) {
|
|
838
838
|
i(s);
|
|
@@ -859,7 +859,7 @@ function Tt(e, t, n, r) {
|
|
|
859
859
|
c((r = r.apply(e, t || [])).next());
|
|
860
860
|
});
|
|
861
861
|
}
|
|
862
|
-
function
|
|
862
|
+
function At(e, t) {
|
|
863
863
|
var n = { label: 0, sent: function() {
|
|
864
864
|
if (s[0] & 1) throw s[1];
|
|
865
865
|
return s[1];
|
|
@@ -928,7 +928,7 @@ var ge = Object.create ? function(e, t, n, r) {
|
|
|
928
928
|
} : function(e, t, n, r) {
|
|
929
929
|
r === void 0 && (r = n), e[r] = t[n];
|
|
930
930
|
};
|
|
931
|
-
function
|
|
931
|
+
function Dt(e, t) {
|
|
932
932
|
for (var n in e) n !== "default" && !Object.prototype.hasOwnProperty.call(t, n) && ge(t, e, n);
|
|
933
933
|
}
|
|
934
934
|
function _e(e) {
|
|
@@ -958,19 +958,19 @@ function Be(e, t) {
|
|
|
958
958
|
}
|
|
959
959
|
return s;
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function xt() {
|
|
962
962
|
for (var e = [], t = 0; t < arguments.length; t++)
|
|
963
963
|
e = e.concat(Be(arguments[t]));
|
|
964
964
|
return e;
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function jt() {
|
|
967
967
|
for (var e = 0, t = 0, n = arguments.length; t < n; t++) e += arguments[t].length;
|
|
968
968
|
for (var r = Array(e), o = 0, t = 0; t < n; t++)
|
|
969
969
|
for (var s = arguments[t], i = 0, f = s.length; i < f; i++, o++)
|
|
970
970
|
r[o] = s[i];
|
|
971
971
|
return r;
|
|
972
972
|
}
|
|
973
|
-
function
|
|
973
|
+
function Pt(e, t, n) {
|
|
974
974
|
if (n || arguments.length === 2) for (var r = 0, o = t.length, s; r < o; r++)
|
|
975
975
|
(s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
|
|
976
976
|
return e.concat(s || Array.prototype.slice.call(t));
|
|
@@ -978,7 +978,7 @@ function jt(e, t, n) {
|
|
|
978
978
|
function te(e) {
|
|
979
979
|
return this instanceof te ? (this.v = e, this) : new te(e);
|
|
980
980
|
}
|
|
981
|
-
function
|
|
981
|
+
function It(e, t, n) {
|
|
982
982
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
983
983
|
var r = n.apply(e, t || []), o, s = [];
|
|
984
984
|
return o = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), f("next"), f("throw"), f("return", i), o[Symbol.asyncIterator] = function() {
|
|
@@ -1029,7 +1029,7 @@ function Lt(e) {
|
|
|
1029
1029
|
} : s;
|
|
1030
1030
|
}
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1032
|
+
function Vt(e) {
|
|
1033
1033
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
1034
1034
|
var t = e[Symbol.asyncIterator], n;
|
|
1035
1035
|
return t ? t.call(e) : (e = typeof _e == "function" ? _e(e) : e[Symbol.iterator](), n = {}, r("next"), r("throw"), r("return"), n[Symbol.asyncIterator] = function() {
|
|
@@ -1048,7 +1048,7 @@ function It(e) {
|
|
|
1048
1048
|
}, i);
|
|
1049
1049
|
}
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1051
|
+
function Nt(e, t) {
|
|
1052
1052
|
return Object.defineProperty ? Object.defineProperty(e, "raw", { value: t }) : e.raw = t, e;
|
|
1053
1053
|
}
|
|
1054
1054
|
var Wn = Object.create ? function(e, t) {
|
|
@@ -1056,7 +1056,7 @@ var Wn = Object.create ? function(e, t) {
|
|
|
1056
1056
|
} : function(e, t) {
|
|
1057
1057
|
e.default = t;
|
|
1058
1058
|
};
|
|
1059
|
-
function
|
|
1059
|
+
function Mt(e) {
|
|
1060
1060
|
if (e && e.__esModule) return e;
|
|
1061
1061
|
var t = {};
|
|
1062
1062
|
if (e != null) for (var n in e) n !== "default" && Object.prototype.hasOwnProperty.call(e, n) && ge(t, e, n);
|
|
@@ -1065,22 +1065,22 @@ function Nt(e) {
|
|
|
1065
1065
|
function Ft(e) {
|
|
1066
1066
|
return e && e.__esModule ? e : { default: e };
|
|
1067
1067
|
}
|
|
1068
|
-
function
|
|
1068
|
+
function Ut(e, t, n, r) {
|
|
1069
1069
|
if (n === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
|
|
1070
1070
|
if (typeof t == "function" ? e !== t || !r : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1071
1071
|
return n === "m" ? r : n === "a" ? r.call(e) : r ? r.value : t.get(e);
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function Wt(e, t, n, r, o) {
|
|
1074
1074
|
if (r === "m") throw new TypeError("Private method is not writable");
|
|
1075
1075
|
if (r === "a" && !o) throw new TypeError("Private accessor was defined without a setter");
|
|
1076
1076
|
if (typeof t == "function" ? e !== t || !o : !t.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1077
1077
|
return r === "a" ? o.call(e, n) : o ? o.value = n : t.set(e, n), n;
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function qt(e, t) {
|
|
1080
1080
|
if (t === null || typeof t != "object" && typeof t != "function") throw new TypeError("Cannot use 'in' operator on non-object");
|
|
1081
1081
|
return typeof e == "function" ? t === e : e.has(t);
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1083
|
+
function Bt(e, t, n) {
|
|
1084
1084
|
if (t != null) {
|
|
1085
1085
|
if (typeof t != "object" && typeof t != "function") throw new TypeError("Object expected.");
|
|
1086
1086
|
var r, o;
|
|
@@ -1107,7 +1107,7 @@ var qn = typeof SuppressedError == "function" ? SuppressedError : function(e, t,
|
|
|
1107
1107
|
var r = new Error(n);
|
|
1108
1108
|
return r.name = "SuppressedError", r.error = e, r.suppressed = t, r;
|
|
1109
1109
|
};
|
|
1110
|
-
function
|
|
1110
|
+
function Ht(e) {
|
|
1111
1111
|
function t(s) {
|
|
1112
1112
|
e.error = e.hasError ? new qn(s, e.error, "An error was suppressed during disposal.") : s, e.hasError = !0;
|
|
1113
1113
|
}
|
|
@@ -1130,79 +1130,79 @@ function Bt(e) {
|
|
|
1130
1130
|
}
|
|
1131
1131
|
return o();
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function $t(e, t) {
|
|
1134
1134
|
return typeof e == "string" && /^\.\.?\//.test(e) ? e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(n, r, o, s, i) {
|
|
1135
1135
|
return r ? t ? ".jsx" : ".js" : o && (!s || !i) ? n : o + s + "." + i.toLowerCase() + "js";
|
|
1136
1136
|
}) : e;
|
|
1137
1137
|
}
|
|
1138
1138
|
const Bn = {
|
|
1139
|
-
__extends:
|
|
1139
|
+
__extends: vt,
|
|
1140
1140
|
__assign: he,
|
|
1141
|
-
__rest:
|
|
1141
|
+
__rest: St,
|
|
1142
1142
|
__decorate: Et,
|
|
1143
|
-
__param:
|
|
1144
|
-
__esDecorate:
|
|
1145
|
-
__runInitializers:
|
|
1146
|
-
__propKey:
|
|
1147
|
-
__setFunctionName:
|
|
1148
|
-
__metadata:
|
|
1149
|
-
__awaiter:
|
|
1150
|
-
__generator:
|
|
1143
|
+
__param: wt,
|
|
1144
|
+
__esDecorate: mt,
|
|
1145
|
+
__runInitializers: bt,
|
|
1146
|
+
__propKey: Ot,
|
|
1147
|
+
__setFunctionName: Rt,
|
|
1148
|
+
__metadata: Tt,
|
|
1149
|
+
__awaiter: Ct,
|
|
1150
|
+
__generator: At,
|
|
1151
1151
|
__createBinding: ge,
|
|
1152
|
-
__exportStar:
|
|
1152
|
+
__exportStar: Dt,
|
|
1153
1153
|
__values: _e,
|
|
1154
1154
|
__read: Be,
|
|
1155
|
-
__spread:
|
|
1156
|
-
__spreadArrays:
|
|
1157
|
-
__spreadArray:
|
|
1155
|
+
__spread: xt,
|
|
1156
|
+
__spreadArrays: jt,
|
|
1157
|
+
__spreadArray: Pt,
|
|
1158
1158
|
__await: te,
|
|
1159
|
-
__asyncGenerator:
|
|
1159
|
+
__asyncGenerator: It,
|
|
1160
1160
|
__asyncDelegator: Lt,
|
|
1161
|
-
__asyncValues:
|
|
1162
|
-
__makeTemplateObject:
|
|
1163
|
-
__importStar:
|
|
1161
|
+
__asyncValues: Vt,
|
|
1162
|
+
__makeTemplateObject: Nt,
|
|
1163
|
+
__importStar: Mt,
|
|
1164
1164
|
__importDefault: Ft,
|
|
1165
|
-
__classPrivateFieldGet:
|
|
1166
|
-
__classPrivateFieldSet:
|
|
1167
|
-
__classPrivateFieldIn:
|
|
1168
|
-
__addDisposableResource:
|
|
1169
|
-
__disposeResources:
|
|
1170
|
-
__rewriteRelativeImportExtension:
|
|
1165
|
+
__classPrivateFieldGet: Ut,
|
|
1166
|
+
__classPrivateFieldSet: Wt,
|
|
1167
|
+
__classPrivateFieldIn: qt,
|
|
1168
|
+
__addDisposableResource: Bt,
|
|
1169
|
+
__disposeResources: Ht,
|
|
1170
|
+
__rewriteRelativeImportExtension: $t
|
|
1171
1171
|
}, Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1172
1172
|
__proto__: null,
|
|
1173
|
-
__addDisposableResource:
|
|
1173
|
+
__addDisposableResource: Bt,
|
|
1174
1174
|
get __assign() {
|
|
1175
1175
|
return he;
|
|
1176
1176
|
},
|
|
1177
1177
|
__asyncDelegator: Lt,
|
|
1178
|
-
__asyncGenerator:
|
|
1179
|
-
__asyncValues:
|
|
1178
|
+
__asyncGenerator: It,
|
|
1179
|
+
__asyncValues: Vt,
|
|
1180
1180
|
__await: te,
|
|
1181
|
-
__awaiter:
|
|
1182
|
-
__classPrivateFieldGet:
|
|
1183
|
-
__classPrivateFieldIn:
|
|
1184
|
-
__classPrivateFieldSet:
|
|
1181
|
+
__awaiter: Ct,
|
|
1182
|
+
__classPrivateFieldGet: Ut,
|
|
1183
|
+
__classPrivateFieldIn: qt,
|
|
1184
|
+
__classPrivateFieldSet: Wt,
|
|
1185
1185
|
__createBinding: ge,
|
|
1186
1186
|
__decorate: Et,
|
|
1187
|
-
__disposeResources:
|
|
1188
|
-
__esDecorate:
|
|
1189
|
-
__exportStar:
|
|
1190
|
-
__extends:
|
|
1191
|
-
__generator:
|
|
1187
|
+
__disposeResources: Ht,
|
|
1188
|
+
__esDecorate: mt,
|
|
1189
|
+
__exportStar: Dt,
|
|
1190
|
+
__extends: vt,
|
|
1191
|
+
__generator: At,
|
|
1192
1192
|
__importDefault: Ft,
|
|
1193
|
-
__importStar:
|
|
1194
|
-
__makeTemplateObject:
|
|
1195
|
-
__metadata:
|
|
1196
|
-
__param:
|
|
1197
|
-
__propKey:
|
|
1193
|
+
__importStar: Mt,
|
|
1194
|
+
__makeTemplateObject: Nt,
|
|
1195
|
+
__metadata: Tt,
|
|
1196
|
+
__param: wt,
|
|
1197
|
+
__propKey: Ot,
|
|
1198
1198
|
__read: Be,
|
|
1199
|
-
__rest:
|
|
1200
|
-
__rewriteRelativeImportExtension:
|
|
1201
|
-
__runInitializers:
|
|
1202
|
-
__setFunctionName:
|
|
1203
|
-
__spread:
|
|
1204
|
-
__spreadArray:
|
|
1205
|
-
__spreadArrays:
|
|
1199
|
+
__rest: St,
|
|
1200
|
+
__rewriteRelativeImportExtension: $t,
|
|
1201
|
+
__runInitializers: bt,
|
|
1202
|
+
__setFunctionName: Rt,
|
|
1203
|
+
__spread: xt,
|
|
1204
|
+
__spreadArray: Pt,
|
|
1205
|
+
__spreadArrays: jt,
|
|
1206
1206
|
__values: _e,
|
|
1207
1207
|
default: Bn
|
|
1208
1208
|
}, Symbol.toStringTag, { value: "Module" })), $n = /* @__PURE__ */ sn(Hn);
|
|
@@ -1210,7 +1210,7 @@ var pe = {}, st;
|
|
|
1210
1210
|
function Gn() {
|
|
1211
1211
|
if (st) return pe;
|
|
1212
1212
|
st = 1, Object.defineProperty(pe, "__esModule", { value: !0 });
|
|
1213
|
-
var e =
|
|
1213
|
+
var e = Y;
|
|
1214
1214
|
function t() {
|
|
1215
1215
|
var n = e.useRef(!1), r = e.useCallback(function() {
|
|
1216
1216
|
return n.current;
|
|
@@ -1223,8 +1223,8 @@ function Gn() {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
return pe.default = t, pe;
|
|
1225
1225
|
}
|
|
1226
|
-
Object.defineProperty(
|
|
1227
|
-
var Ne = $n, Ae =
|
|
1226
|
+
Object.defineProperty(gt, "__esModule", { value: !0 });
|
|
1227
|
+
var Ne = $n, Ae = Y, Kn = Ne.__importDefault(Gn());
|
|
1228
1228
|
function zn(e, t, n) {
|
|
1229
1229
|
t === void 0 && (t = []), n === void 0 && (n = { loading: !1 });
|
|
1230
1230
|
var r = Ae.useRef(0), o = Kn.default(), s = Ae.useState(n), i = s[0], f = s[1], h = Ae.useCallback(function() {
|
|
@@ -1241,16 +1241,16 @@ function zn(e, t, n) {
|
|
|
1241
1241
|
}, t);
|
|
1242
1242
|
return [i, h];
|
|
1243
1243
|
}
|
|
1244
|
-
var sr =
|
|
1244
|
+
var sr = gt.default = zn;
|
|
1245
1245
|
const H = /* @__PURE__ */ new Map();
|
|
1246
1246
|
function ir() {
|
|
1247
|
-
const [e, t] =
|
|
1247
|
+
const [e, t] = Fe([]), {
|
|
1248
1248
|
widgetCtx: { api: n }
|
|
1249
|
-
} =
|
|
1249
|
+
} = K();
|
|
1250
1250
|
function r(a) {
|
|
1251
1251
|
const u = a.map((d) => ({
|
|
1252
1252
|
file: d,
|
|
1253
|
-
id:
|
|
1253
|
+
id: en(),
|
|
1254
1254
|
status: "pending",
|
|
1255
1255
|
progress: 0
|
|
1256
1256
|
}));
|
|
@@ -1322,9 +1322,9 @@ function ir() {
|
|
|
1322
1322
|
isUploading: e.some((a) => a.status === "uploading")
|
|
1323
1323
|
};
|
|
1324
1324
|
}
|
|
1325
|
-
const
|
|
1325
|
+
const Gt = Me(null);
|
|
1326
1326
|
function ar({ children: e }) {
|
|
1327
|
-
const t = ut(), [n, r] =
|
|
1327
|
+
const t = ut(), [n, r] = Fe(t.isOpen ?? !1);
|
|
1328
1328
|
return se(() => {
|
|
1329
1329
|
r((o) => t.isOpen ?? o);
|
|
1330
1330
|
}, [t.isOpen]), se(() => {
|
|
@@ -1333,32 +1333,41 @@ function ar({ children: e }) {
|
|
|
1333
1333
|
return;
|
|
1334
1334
|
const s = setTimeout(() => r(!0), o * 1e3);
|
|
1335
1335
|
return () => clearTimeout(s);
|
|
1336
|
-
}, [t.openAfterNSeconds]), /* @__PURE__ */ it(
|
|
1336
|
+
}, [t.openAfterNSeconds]), /* @__PURE__ */ it(Gt.Provider, { value: { isOpen: n, setIsOpen: r }, children: e });
|
|
1337
1337
|
}
|
|
1338
1338
|
function ur() {
|
|
1339
|
-
const e = Ue(
|
|
1339
|
+
const e = Ue(Gt);
|
|
1340
1340
|
if (!e)
|
|
1341
1341
|
throw new Error(
|
|
1342
1342
|
"useWidgetTrigger must be used within a WidgetTriggerProvider"
|
|
1343
1343
|
);
|
|
1344
1344
|
return e;
|
|
1345
1345
|
}
|
|
1346
|
+
function cr() {
|
|
1347
|
+
var s;
|
|
1348
|
+
const { widgetCtx: e } = K(), { sessionState: t } = ct(), n = e.modes, r = (s = t.session) == null ? void 0 : s.modeId, o = n.find((i) => i.id === r);
|
|
1349
|
+
return {
|
|
1350
|
+
modes: n,
|
|
1351
|
+
activeMode: o
|
|
1352
|
+
};
|
|
1353
|
+
}
|
|
1346
1354
|
export {
|
|
1347
1355
|
Qn as W,
|
|
1348
1356
|
sr as _,
|
|
1349
1357
|
ut as a,
|
|
1350
1358
|
Zn as b,
|
|
1351
1359
|
er as c,
|
|
1352
|
-
|
|
1360
|
+
on as d,
|
|
1353
1361
|
rr as e,
|
|
1354
1362
|
ie as f,
|
|
1355
|
-
|
|
1363
|
+
ct as g,
|
|
1356
1364
|
or as h,
|
|
1357
1365
|
ir as i,
|
|
1358
1366
|
ur as j,
|
|
1359
1367
|
ar as k,
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1368
|
+
cr as l,
|
|
1369
|
+
tr as m,
|
|
1370
|
+
nr as n,
|
|
1371
|
+
K as u
|
|
1363
1372
|
};
|
|
1364
|
-
//# sourceMappingURL=
|
|
1373
|
+
//# sourceMappingURL=useModes-CCwRYrkY.js.map
|