@opencx/widget 3.0.69 → 3.0.71
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 +43 -32
- package/dist/designs.cjs.map +1 -1
- package/dist/designs.js +9388 -9285
- package/dist/designs.js.map +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +19 -17
- package/dist/src/designs/react/WidgetPopoverAnchor.d.ts +2 -0
- package/dist/src/designs/react/WidgetPopoverContent.d.ts +2 -0
- package/dist/src/designs/react/WidgetPopoverTrigger.d.ts +1 -3
- package/dist/src/designs/react/components/lib/button.d.ts +2 -2
- package/dist/src/designs/react/hooks/useIsSmallScreen.d.ts +3 -0
- package/dist/src/{headless → designs}/react/hooks/useTheme.d.ts +11 -5
- package/dist/src/designs/react/index.d.ts +1 -1
- package/dist/src/headless/core/types/widget-config.d.ts +17 -6
- package/dist/src/headless/react/hooks/useWidgetTrigger.d.ts +10 -0
- package/dist/src/headless/react/index.d.ts +1 -0
- package/dist/{useUploadFiles-DH1k_nBL.cjs → useWidgetTrigger-DhYRJ5kj.cjs} +4 -4
- package/dist/useWidgetTrigger-DhYRJ5kj.cjs.map +1 -0
- package/dist/{useUploadFiles-CoBUxfoW.js → useWidgetTrigger-vh6E1XGL.js} +282 -275
- package/dist/useWidgetTrigger-vh6E1XGL.js.map +1 -0
- package/dist-embed/script.js +189 -178
- package/dist-embed/script.js.map +1 -1
- package/package.json +2 -2
- package/dist/useUploadFiles-CoBUxfoW.js.map +0 -1
- package/dist/useUploadFiles-DH1k_nBL.cjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import z, { createContext as
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { W as
|
|
4
|
-
import { v4 as
|
|
5
|
-
class
|
|
1
|
+
import z, { createContext as ot, useContext as st, useRef as H, useState as Ve, useMemo as Fe, useEffect as Me, useSyncExternalStore as Yt, useLayoutEffect as kt, useCallback as ve, useDebugValue as Jt } from "react";
|
|
2
|
+
import { jsx as it } from "react/jsx-runtime";
|
|
3
|
+
import { W as Xt } from "./widget.ctx-COUAUyWX.js";
|
|
4
|
+
import { v4 as Qt } from "uuid";
|
|
5
|
+
class Zt {
|
|
6
6
|
constructor(t) {
|
|
7
7
|
this.components = [];
|
|
8
8
|
const { components: n } = t;
|
|
@@ -27,31 +27,31 @@ class Qt {
|
|
|
27
27
|
return (n = this.get(t)) == null ? void 0 : n.component;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
const t =
|
|
30
|
+
function at(e) {
|
|
31
|
+
const t = ot({});
|
|
32
32
|
return [() => {
|
|
33
|
-
const r =
|
|
33
|
+
const r = st(t);
|
|
34
34
|
if (r === void 0)
|
|
35
35
|
throw new Error("useSafeContext must be used within a Provider");
|
|
36
36
|
return r;
|
|
37
37
|
}, t.Provider];
|
|
38
38
|
}
|
|
39
|
-
const en = "3.0.
|
|
40
|
-
function
|
|
39
|
+
const en = "3.0.71", [Y, tn] = at();
|
|
40
|
+
function Qn({
|
|
41
41
|
options: e,
|
|
42
42
|
children: t,
|
|
43
43
|
components: n,
|
|
44
44
|
storage: r
|
|
45
45
|
}) {
|
|
46
|
-
const o = H(!1), [s, i] =
|
|
47
|
-
() => new
|
|
46
|
+
const o = H(!1), [s, i] = Ve(null), d = Fe(
|
|
47
|
+
() => new Zt({
|
|
48
48
|
components: n
|
|
49
49
|
}),
|
|
50
50
|
[n]
|
|
51
51
|
);
|
|
52
|
-
return
|
|
53
|
-
o.current || (o.current = !0,
|
|
54
|
-
}, []), s ? /* @__PURE__ */
|
|
52
|
+
return Me(() => {
|
|
53
|
+
o.current || (o.current = !0, Xt.initialize({ config: e, storage: r }).then(i));
|
|
54
|
+
}, []), s ? /* @__PURE__ */ it(
|
|
55
55
|
tn,
|
|
56
56
|
{
|
|
57
57
|
value: {
|
|
@@ -65,14 +65,14 @@ function Xn({
|
|
|
65
65
|
}
|
|
66
66
|
) : null;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Zn() {
|
|
69
69
|
const { widgetCtx: e } = Y();
|
|
70
70
|
return e.config;
|
|
71
71
|
}
|
|
72
72
|
function oe(e) {
|
|
73
|
-
return
|
|
73
|
+
return Yt(e.subscribe, e.get, e.get);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function er() {
|
|
76
76
|
const { widgetCtx: e } = Y();
|
|
77
77
|
return {
|
|
78
78
|
contactState: oe(e.contactCtx.state),
|
|
@@ -91,13 +91,13 @@ function rn() {
|
|
|
91
91
|
loadMoreSessions: e.sessionCtx.loadMoreSessions
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function tr() {
|
|
95
95
|
var i;
|
|
96
96
|
const { sessionState: e } = rn(), { messagesState: t } = nn(), 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";
|
|
97
97
|
return { isAwaitingBotReply: (n || e.isCreatingSession) && (t.isSendingMessage || o) };
|
|
98
98
|
}
|
|
99
|
-
var
|
|
100
|
-
function
|
|
99
|
+
var nr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
100
|
+
function rr(e) {
|
|
101
101
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
102
102
|
}
|
|
103
103
|
function on(e) {
|
|
@@ -119,7 +119,7 @@ function on(e) {
|
|
|
119
119
|
});
|
|
120
120
|
}), n;
|
|
121
121
|
}
|
|
122
|
-
var
|
|
122
|
+
var Ce = { exports: {} }, Ee = {};
|
|
123
123
|
/**
|
|
124
124
|
* @license React
|
|
125
125
|
* use-sync-external-store-shim.production.min.js
|
|
@@ -129,22 +129,22 @@ var Te = { exports: {} }, ve = {};
|
|
|
129
129
|
* This source code is licensed under the MIT license found in the
|
|
130
130
|
* LICENSE file in the root directory of this source tree.
|
|
131
131
|
*/
|
|
132
|
-
var
|
|
132
|
+
var Xe;
|
|
133
133
|
function sn() {
|
|
134
|
-
if (
|
|
135
|
-
|
|
134
|
+
if (Xe) return Ee;
|
|
135
|
+
Xe = 1;
|
|
136
136
|
var e = z;
|
|
137
137
|
function t(u, l) {
|
|
138
138
|
return u === l && (u !== 0 || 1 / u === 1 / l) || u !== u && l !== l;
|
|
139
139
|
}
|
|
140
140
|
var n = typeof Object.is == "function" ? Object.is : t, r = e.useState, o = e.useEffect, s = e.useLayoutEffect, i = e.useDebugValue;
|
|
141
141
|
function d(u, l) {
|
|
142
|
-
var c = l(), y = r({ inst: { value: c, getSnapshot: l } }), _ = y[0].inst,
|
|
142
|
+
var c = l(), y = r({ inst: { value: c, getSnapshot: l } }), _ = y[0].inst, T = y[1];
|
|
143
143
|
return s(function() {
|
|
144
|
-
_.value = c, _.getSnapshot = l, h(_) &&
|
|
144
|
+
_.value = c, _.getSnapshot = l, h(_) && T({ inst: _ });
|
|
145
145
|
}, [u, c, l]), o(function() {
|
|
146
|
-
return h(_) &&
|
|
147
|
-
h(_) &&
|
|
146
|
+
return h(_) && T({ inst: _ }), u(function() {
|
|
147
|
+
h(_) && T({ inst: _ });
|
|
148
148
|
});
|
|
149
149
|
}, [u]), i(c), c;
|
|
150
150
|
}
|
|
@@ -162,7 +162,7 @@ function sn() {
|
|
|
162
162
|
return l();
|
|
163
163
|
}
|
|
164
164
|
var a = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? f : d;
|
|
165
|
-
return
|
|
165
|
+
return Ee.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : a, Ee;
|
|
166
166
|
}
|
|
167
167
|
var Se = {};
|
|
168
168
|
/**
|
|
@@ -174,84 +174,84 @@ var Se = {};
|
|
|
174
174
|
* This source code is licensed under the MIT license found in the
|
|
175
175
|
* LICENSE file in the root directory of this source tree.
|
|
176
176
|
*/
|
|
177
|
-
var
|
|
177
|
+
var Qe;
|
|
178
178
|
function an() {
|
|
179
|
-
return
|
|
179
|
+
return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
180
180
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
181
181
|
var e = z, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
182
182
|
function n(O) {
|
|
183
183
|
{
|
|
184
|
-
for (var
|
|
185
|
-
S[
|
|
184
|
+
for (var v = arguments.length, S = new Array(v > 1 ? v - 1 : 0), E = 1; E < v; E++)
|
|
185
|
+
S[E - 1] = arguments[E];
|
|
186
186
|
r("error", O, S);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
function r(O,
|
|
189
|
+
function r(O, v, S) {
|
|
190
190
|
{
|
|
191
|
-
var
|
|
192
|
-
L !== "" && (
|
|
193
|
-
var w = S.map(function(
|
|
194
|
-
return String(
|
|
191
|
+
var E = t.ReactDebugCurrentFrame, L = E.getStackAddendum();
|
|
192
|
+
L !== "" && (v += "%s", S = S.concat([L]));
|
|
193
|
+
var w = S.map(function(C) {
|
|
194
|
+
return String(C);
|
|
195
195
|
});
|
|
196
|
-
w.unshift("Warning: " +
|
|
196
|
+
w.unshift("Warning: " + v), Function.prototype.apply.call(console[O], console, w);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
function o(O,
|
|
200
|
-
return O ===
|
|
199
|
+
function o(O, v) {
|
|
200
|
+
return O === v && (O !== 0 || 1 / O === 1 / v) || O !== O && v !== v;
|
|
201
201
|
}
|
|
202
202
|
var s = typeof Object.is == "function" ? Object.is : o, i = e.useState, d = e.useEffect, h = e.useLayoutEffect, f = e.useDebugValue, a = !1, u = !1;
|
|
203
|
-
function l(O,
|
|
203
|
+
function l(O, v, S) {
|
|
204
204
|
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."));
|
|
205
|
-
var
|
|
205
|
+
var E = v();
|
|
206
206
|
if (!u) {
|
|
207
|
-
var L =
|
|
208
|
-
s(
|
|
207
|
+
var L = v();
|
|
208
|
+
s(E, L) || (n("The result of getSnapshot should be cached to avoid an infinite loop"), u = !0);
|
|
209
209
|
}
|
|
210
210
|
var w = i({
|
|
211
211
|
inst: {
|
|
212
|
-
value:
|
|
213
|
-
getSnapshot:
|
|
212
|
+
value: E,
|
|
213
|
+
getSnapshot: v
|
|
214
214
|
}
|
|
215
|
-
}),
|
|
215
|
+
}), C = w[0].inst, j = w[1];
|
|
216
216
|
return h(function() {
|
|
217
|
-
|
|
218
|
-
inst:
|
|
217
|
+
C.value = E, C.getSnapshot = v, c(C) && j({
|
|
218
|
+
inst: C
|
|
219
219
|
});
|
|
220
|
-
}, [O,
|
|
221
|
-
c(
|
|
222
|
-
inst:
|
|
220
|
+
}, [O, E, v]), d(function() {
|
|
221
|
+
c(C) && j({
|
|
222
|
+
inst: C
|
|
223
223
|
});
|
|
224
224
|
var q = function() {
|
|
225
|
-
c(
|
|
226
|
-
inst:
|
|
225
|
+
c(C) && j({
|
|
226
|
+
inst: C
|
|
227
227
|
});
|
|
228
228
|
};
|
|
229
229
|
return O(q);
|
|
230
|
-
}, [O]), f(
|
|
230
|
+
}, [O]), f(E), E;
|
|
231
231
|
}
|
|
232
232
|
function c(O) {
|
|
233
|
-
var
|
|
233
|
+
var v = O.getSnapshot, S = O.value;
|
|
234
234
|
try {
|
|
235
|
-
var
|
|
236
|
-
return !s(S,
|
|
235
|
+
var E = v();
|
|
236
|
+
return !s(S, E);
|
|
237
237
|
} catch {
|
|
238
238
|
return !0;
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
function y(O,
|
|
242
|
-
return
|
|
241
|
+
function y(O, v, S) {
|
|
242
|
+
return v();
|
|
243
243
|
}
|
|
244
|
-
var _ = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u",
|
|
244
|
+
var _ = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", T = !_, p = T ? y : l, k = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : p;
|
|
245
245
|
Se.useSyncExternalStore = k, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
246
246
|
}()), Se;
|
|
247
247
|
}
|
|
248
|
-
process.env.NODE_ENV === "production" ?
|
|
249
|
-
var un =
|
|
250
|
-
const
|
|
248
|
+
process.env.NODE_ENV === "production" ? Ce.exports = sn() : Ce.exports = an();
|
|
249
|
+
var un = Ce.exports;
|
|
250
|
+
const $ = () => {
|
|
251
251
|
}, P = (
|
|
252
252
|
/*#__NOINLINE__*/
|
|
253
|
-
|
|
254
|
-
), we = Object, g = (e) => e === P, M = (e) => typeof e == "function",
|
|
253
|
+
$()
|
|
254
|
+
), we = Object, g = (e) => e === P, M = (e) => typeof e == "function", G = (e, t) => ({
|
|
255
255
|
...e,
|
|
256
256
|
...t
|
|
257
257
|
}), cn = (e) => M(e.then), ce = /* @__PURE__ */ new WeakMap();
|
|
@@ -276,7 +276,7 @@ const se = (e) => {
|
|
|
276
276
|
} else
|
|
277
277
|
o = r ? e.toJSON() : t == "symbol" ? e.toString() : t == "string" ? JSON.stringify(e) : "" + e;
|
|
278
278
|
return o;
|
|
279
|
-
}, W = /* @__PURE__ */ new WeakMap(), me = {}, fe = {},
|
|
279
|
+
}, W = /* @__PURE__ */ new WeakMap(), me = {}, fe = {}, Ne = "undefined", he = typeof window != Ne, De = typeof document != Ne, ln = () => he && typeof window.requestAnimationFrame != Ne, ut = (e, t) => {
|
|
280
280
|
const n = W.get(e);
|
|
281
281
|
return [
|
|
282
282
|
// Getter
|
|
@@ -285,7 +285,7 @@ const se = (e) => {
|
|
|
285
285
|
(r) => {
|
|
286
286
|
if (!g(t)) {
|
|
287
287
|
const o = e.get(t);
|
|
288
|
-
t in fe || (fe[t] = o), n[5](t,
|
|
288
|
+
t in fe || (fe[t] = o), n[5](t, G(o, r), o || me);
|
|
289
289
|
}
|
|
290
290
|
},
|
|
291
291
|
// Subscriber
|
|
@@ -299,8 +299,8 @@ const dn = () => Ae, [xe, je] = he && window.addEventListener ? [
|
|
|
299
299
|
window.addEventListener.bind(window),
|
|
300
300
|
window.removeEventListener.bind(window)
|
|
301
301
|
] : [
|
|
302
|
-
|
|
303
|
-
|
|
302
|
+
$,
|
|
303
|
+
$
|
|
304
304
|
], pn = () => {
|
|
305
305
|
const e = De && document.visibilityState;
|
|
306
306
|
return g(e) || e !== "hidden";
|
|
@@ -321,10 +321,10 @@ const dn = () => Ae, [xe, je] = he && window.addEventListener ? [
|
|
|
321
321
|
}, gn = {
|
|
322
322
|
initFocus: hn,
|
|
323
323
|
initReconnect: _n
|
|
324
|
-
},
|
|
324
|
+
}, Ze = !z.useId, ie = !he || "Deno" in window, vn = (e) => ln() ? window.requestAnimationFrame(e) : setTimeout(e, 1), be = ie ? Me : kt, Oe = typeof navigator < "u" && navigator.connection, et = !ie && Oe && ([
|
|
325
325
|
"slow-2g",
|
|
326
326
|
"2g"
|
|
327
|
-
].includes(Oe.effectiveType) || Oe.saveData),
|
|
327
|
+
].includes(Oe.effectiveType) || Oe.saveData), Ue = (e) => {
|
|
328
328
|
if (M(e))
|
|
329
329
|
try {
|
|
330
330
|
e = e();
|
|
@@ -337,17 +337,17 @@ const dn = () => Ae, [xe, je] = he && window.addEventListener ? [
|
|
|
337
337
|
t
|
|
338
338
|
];
|
|
339
339
|
};
|
|
340
|
-
let
|
|
341
|
-
const Pe = () => ++
|
|
340
|
+
let En = 0;
|
|
341
|
+
const Pe = () => ++En, ct = 0, ft = 1, lt = 2, Sn = 3;
|
|
342
342
|
var re = {
|
|
343
343
|
__proto__: null,
|
|
344
344
|
ERROR_REVALIDATE_EVENT: Sn,
|
|
345
|
-
FOCUS_EVENT:
|
|
346
|
-
MUTATE_EVENT:
|
|
347
|
-
RECONNECT_EVENT:
|
|
345
|
+
FOCUS_EVENT: ct,
|
|
346
|
+
MUTATE_EVENT: lt,
|
|
347
|
+
RECONNECT_EVENT: ft
|
|
348
348
|
};
|
|
349
|
-
async function
|
|
350
|
-
const [t, n, r, o] = e, s =
|
|
349
|
+
async function dt(...e) {
|
|
350
|
+
const [t, n, r, o] = e, s = G({
|
|
351
351
|
populateCache: !0,
|
|
352
352
|
throwOnError: !0
|
|
353
353
|
}, typeof o == "boolean" ? {
|
|
@@ -366,21 +366,21 @@ async function ft(...e) {
|
|
|
366
366
|
}
|
|
367
367
|
return u(n);
|
|
368
368
|
async function u(l) {
|
|
369
|
-
const [c] =
|
|
369
|
+
const [c] = Ue(l);
|
|
370
370
|
if (!c) return;
|
|
371
|
-
const [y, _] =
|
|
372
|
-
const V =
|
|
373
|
-
return (M(s.revalidate) ? s.revalidate(y().data, l) : s.revalidate !== !1) && (delete k[c], delete O[c], V && V[0]) ? V[0](
|
|
371
|
+
const [y, _] = ut(t, c), [T, p, k, O] = W.get(t), v = () => {
|
|
372
|
+
const V = T[c];
|
|
373
|
+
return (M(s.revalidate) ? s.revalidate(y().data, l) : s.revalidate !== !1) && (delete k[c], delete O[c], V && V[0]) ? V[0](lt).then(() => y().data) : y().data;
|
|
374
374
|
};
|
|
375
375
|
if (e.length < 3)
|
|
376
|
-
return
|
|
377
|
-
let S = r,
|
|
376
|
+
return v();
|
|
377
|
+
let S = r, E;
|
|
378
378
|
const L = Pe();
|
|
379
379
|
p[c] = [
|
|
380
380
|
L,
|
|
381
381
|
0
|
|
382
382
|
];
|
|
383
|
-
const w = !g(h),
|
|
383
|
+
const w = !g(h), C = y(), j = C.data, q = C._c, K = g(q) ? j : q;
|
|
384
384
|
if (w && (h = M(h) ? h(K, j) : h, _({
|
|
385
385
|
data: h,
|
|
386
386
|
_c: K
|
|
@@ -388,19 +388,19 @@ async function ft(...e) {
|
|
|
388
388
|
try {
|
|
389
389
|
S = S(K);
|
|
390
390
|
} catch (V) {
|
|
391
|
-
|
|
391
|
+
E = V;
|
|
392
392
|
}
|
|
393
393
|
if (S && cn(S))
|
|
394
394
|
if (S = await S.catch((V) => {
|
|
395
|
-
|
|
395
|
+
E = V;
|
|
396
396
|
}), L !== p[c][0]) {
|
|
397
|
-
if (
|
|
397
|
+
if (E) throw E;
|
|
398
398
|
return S;
|
|
399
|
-
} else
|
|
399
|
+
} else E && w && f(E) && (i = !0, _({
|
|
400
400
|
data: K,
|
|
401
401
|
_c: P
|
|
402
402
|
}));
|
|
403
|
-
if (i && !
|
|
403
|
+
if (i && !E)
|
|
404
404
|
if (M(i)) {
|
|
405
405
|
const V = i(S, K);
|
|
406
406
|
_({
|
|
@@ -414,24 +414,24 @@ async function ft(...e) {
|
|
|
414
414
|
error: P,
|
|
415
415
|
_c: P
|
|
416
416
|
});
|
|
417
|
-
if (p[c][1] = Pe(), Promise.resolve(
|
|
417
|
+
if (p[c][1] = Pe(), Promise.resolve(v()).then(() => {
|
|
418
418
|
_({
|
|
419
419
|
_c: P
|
|
420
420
|
});
|
|
421
|
-
}),
|
|
422
|
-
if (a) throw
|
|
421
|
+
}), E) {
|
|
422
|
+
if (a) throw E;
|
|
423
423
|
return;
|
|
424
424
|
}
|
|
425
425
|
return S;
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
|
-
const
|
|
428
|
+
const tt = (e, t) => {
|
|
429
429
|
for (const n in e)
|
|
430
430
|
e[n][0] && e[n][0](t);
|
|
431
431
|
}, wn = (e, t) => {
|
|
432
432
|
if (!W.has(e)) {
|
|
433
|
-
const n =
|
|
434
|
-
let s =
|
|
433
|
+
const n = G(gn, t), r = {}, o = dt.bind(P, e);
|
|
434
|
+
let s = $;
|
|
435
435
|
const i = {}, d = (a, u) => {
|
|
436
436
|
const l = i[a] || [];
|
|
437
437
|
return i[a] = l, l.push(u), () => l.splice(l.indexOf(u), 1);
|
|
@@ -451,7 +451,7 @@ const et = (e, t) => {
|
|
|
451
451
|
h,
|
|
452
452
|
d
|
|
453
453
|
]), !ie)) {
|
|
454
|
-
const a = n.initFocus(setTimeout.bind(P,
|
|
454
|
+
const a = n.initFocus(setTimeout.bind(P, tt.bind(P, r, ct))), u = n.initReconnect(setTimeout.bind(P, tt.bind(P, r, ft)));
|
|
455
455
|
s = () => {
|
|
456
456
|
a && a(), u && u(), W.delete(e);
|
|
457
457
|
};
|
|
@@ -471,42 +471,42 @@ const et = (e, t) => {
|
|
|
471
471
|
}, mn = (e, t, n, r, o) => {
|
|
472
472
|
const s = n.errorRetryCount, i = o.retryCount, d = ~~((Math.random() + 0.5) * (1 << (i < 8 ? i : 8))) * n.errorRetryInterval;
|
|
473
473
|
!g(s) && i > s || setTimeout(r, d, o);
|
|
474
|
-
}, bn = (e, t) => se(e) == se(t), [
|
|
474
|
+
}, bn = (e, t) => se(e) == se(t), [pt, On] = wn(/* @__PURE__ */ new Map()), Rn = G(
|
|
475
475
|
{
|
|
476
476
|
// events
|
|
477
|
-
onLoadingSlow:
|
|
478
|
-
onSuccess:
|
|
479
|
-
onError:
|
|
477
|
+
onLoadingSlow: $,
|
|
478
|
+
onSuccess: $,
|
|
479
|
+
onError: $,
|
|
480
480
|
onErrorRetry: mn,
|
|
481
|
-
onDiscarded:
|
|
481
|
+
onDiscarded: $,
|
|
482
482
|
// switches
|
|
483
483
|
revalidateOnFocus: !0,
|
|
484
484
|
revalidateOnReconnect: !0,
|
|
485
485
|
revalidateIfStale: !0,
|
|
486
486
|
shouldRetryOnError: !0,
|
|
487
487
|
// timeouts
|
|
488
|
-
errorRetryInterval:
|
|
488
|
+
errorRetryInterval: et ? 1e4 : 5e3,
|
|
489
489
|
focusThrottleInterval: 5 * 1e3,
|
|
490
490
|
dedupingInterval: 2 * 1e3,
|
|
491
|
-
loadingTimeout:
|
|
491
|
+
loadingTimeout: et ? 5e3 : 3e3,
|
|
492
492
|
// providers
|
|
493
493
|
compare: bn,
|
|
494
494
|
isPaused: () => !1,
|
|
495
|
-
cache:
|
|
495
|
+
cache: pt,
|
|
496
496
|
mutate: On,
|
|
497
497
|
fallback: {}
|
|
498
498
|
},
|
|
499
499
|
// use web preset by default
|
|
500
500
|
yn
|
|
501
|
-
),
|
|
502
|
-
const n =
|
|
501
|
+
), Tn = (e, t) => {
|
|
502
|
+
const n = G(e, t);
|
|
503
503
|
if (t) {
|
|
504
504
|
const { use: r, fallback: o } = e, { use: s, fallback: i } = t;
|
|
505
|
-
r && s && (n.use = r.concat(s)), o && i && (n.fallback =
|
|
505
|
+
r && s && (n.use = r.concat(s)), o && i && (n.fallback = G(o, i));
|
|
506
506
|
}
|
|
507
507
|
return n;
|
|
508
|
-
},
|
|
509
|
-
|
|
508
|
+
}, Cn = ot({}), Dn = "$inf$", ht = he && window.__SWR_DEVTOOLS_USE__, An = ht ? window.__SWR_DEVTOOLS_USE__ : [], xn = () => {
|
|
509
|
+
ht && (window.__SWR_DEVTOOLS_REACT__ = z);
|
|
510
510
|
}, jn = (e) => M(e[1]) ? [
|
|
511
511
|
e[0],
|
|
512
512
|
e[1],
|
|
@@ -515,14 +515,14 @@ const et = (e, t) => {
|
|
|
515
515
|
e[0],
|
|
516
516
|
null,
|
|
517
517
|
(e[1] === null ? e[2] : e[1]) || {}
|
|
518
|
-
], Pn = () =>
|
|
519
|
-
const [i] =
|
|
518
|
+
], Pn = () => G(Rn, st(Cn)), Ln = (e) => (t, n, r) => e(t, n && ((...s) => {
|
|
519
|
+
const [i] = Ue(t), [, , , d] = W.get(pt);
|
|
520
520
|
if (i.startsWith(Dn))
|
|
521
521
|
return n(...s);
|
|
522
522
|
const h = d[i];
|
|
523
523
|
return g(h) ? n(...s) : (delete d[i], h);
|
|
524
524
|
}), r), In = An.concat(Ln), Vn = (e) => function(...n) {
|
|
525
|
-
const r = Pn(), [o, s, i] = jn(n), d =
|
|
525
|
+
const r = Pn(), [o, s, i] = jn(n), d = Tn(r, i);
|
|
526
526
|
let h = e;
|
|
527
527
|
const { use: f } = d, a = (f || []).concat(In);
|
|
528
528
|
for (let u = a.length; u--; )
|
|
@@ -536,7 +536,7 @@ const et = (e, t) => {
|
|
|
536
536
|
};
|
|
537
537
|
};
|
|
538
538
|
xn();
|
|
539
|
-
const
|
|
539
|
+
const nt = z.use || ((e) => {
|
|
540
540
|
if (e.status === "pending")
|
|
541
541
|
throw e;
|
|
542
542
|
if (e.status === "fulfilled")
|
|
@@ -549,7 +549,7 @@ const tt = z.use || ((e) => {
|
|
|
549
549
|
}), Re = {
|
|
550
550
|
dedupe: !0
|
|
551
551
|
}, Mn = (e, t, n) => {
|
|
552
|
-
const { cache: r, compare: o, suspense: s, fallbackData: i, revalidateOnMount: d, revalidateIfStale: h, refreshInterval: f, refreshWhenHidden: a, refreshWhenOffline: u, keepPreviousData: l } = n, [c, y, _,
|
|
552
|
+
const { cache: r, compare: o, suspense: s, fallbackData: i, revalidateOnMount: d, revalidateIfStale: h, refreshInterval: f, refreshWhenHidden: a, refreshWhenOffline: u, keepPreviousData: l } = n, [c, y, _, T] = W.get(r), [p, k] = Ue(e), O = H(!1), v = H(!1), S = H(p), E = H(t), L = H(n), w = () => L.current, C = () => w().isVisible() && w().isOnline(), [j, q, K, V] = ut(r, p), J = H({}).current, Ht = g(i) ? n.fallback[p] : i, qe = (m, b) => {
|
|
553
553
|
for (const A in J) {
|
|
554
554
|
const R = A;
|
|
555
555
|
if (R === "data") {
|
|
@@ -559,9 +559,9 @@ const tt = z.use || ((e) => {
|
|
|
559
559
|
return !1;
|
|
560
560
|
}
|
|
561
561
|
return !0;
|
|
562
|
-
},
|
|
562
|
+
}, Be = Fe(() => {
|
|
563
563
|
const m = !p || !t ? !1 : g(d) ? w().isPaused() || s ? !1 : g(h) ? !0 : h : d, b = (x) => {
|
|
564
|
-
const N =
|
|
564
|
+
const N = G(x);
|
|
565
565
|
return delete N._k, m ? {
|
|
566
566
|
isValidating: !0,
|
|
567
567
|
isLoading: !0,
|
|
@@ -572,47 +572,47 @@ const tt = z.use || ((e) => {
|
|
|
572
572
|
return [
|
|
573
573
|
() => {
|
|
574
574
|
const x = b(j());
|
|
575
|
-
return
|
|
575
|
+
return qe(x, D) ? (D.data = x.data, D.isLoading = x.isLoading, D.isValidating = x.isValidating, D.error = x.error, D) : (D = x, x);
|
|
576
576
|
},
|
|
577
577
|
() => ee
|
|
578
578
|
];
|
|
579
579
|
}, [
|
|
580
580
|
r,
|
|
581
581
|
p
|
|
582
|
-
]), X = un.useSyncExternalStore(
|
|
582
|
+
]), X = un.useSyncExternalStore(ve(
|
|
583
583
|
(m) => K(p, (b, A) => {
|
|
584
|
-
|
|
584
|
+
qe(A, b) || m();
|
|
585
585
|
}),
|
|
586
586
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
587
587
|
[
|
|
588
588
|
r,
|
|
589
589
|
p
|
|
590
590
|
]
|
|
591
|
-
),
|
|
591
|
+
), Be[0], Be[1]), He = !O.current, $t = c[p] && c[p].length > 0, Q = X.data, Z = g(Q) ? Ht : Q, ae = X.error, $e = H(Z), ue = l ? g(Q) ? $e.current : Q : Z, Ge = $t && !g(ae) ? !1 : He && !g(d) ? d : w().isPaused() ? !1 : s ? g(Z) ? !1 : h : g(Z) || h, Ke = !!(p && t && He && Ge), Gt = g(X.isValidating) ? Ke : X.isValidating, Kt = g(X.isLoading) ? Ke : X.isLoading, ne = ve(
|
|
592
592
|
async (m) => {
|
|
593
|
-
const b =
|
|
594
|
-
if (!p || !b ||
|
|
593
|
+
const b = E.current;
|
|
594
|
+
if (!p || !b || v.current || w().isPaused())
|
|
595
595
|
return !1;
|
|
596
596
|
let A, R, F = !0;
|
|
597
|
-
const ee = m || {}, D = !_[p] || !ee.dedupe, x = () =>
|
|
597
|
+
const ee = m || {}, D = !_[p] || !ee.dedupe, x = () => Ze ? !v.current && p === S.current && O.current : p === S.current, N = {
|
|
598
598
|
isValidating: !1,
|
|
599
599
|
isLoading: !1
|
|
600
|
-
}, ze = () => {
|
|
601
|
-
q(N);
|
|
602
600
|
}, Ye = () => {
|
|
601
|
+
q(N);
|
|
602
|
+
}, ke = () => {
|
|
603
603
|
const I = _[p];
|
|
604
604
|
I && I[1] === R && delete _[p];
|
|
605
|
-
},
|
|
605
|
+
}, Je = {
|
|
606
606
|
isValidating: !0
|
|
607
607
|
};
|
|
608
|
-
g(j().data) && (
|
|
608
|
+
g(j().data) && (Je.isLoading = !0);
|
|
609
609
|
try {
|
|
610
|
-
if (D && (q(
|
|
610
|
+
if (D && (q(Je), n.loadingTimeout && g(j().data) && setTimeout(() => {
|
|
611
611
|
F && x() && w().onLoadingSlow(p, n);
|
|
612
612
|
}, n.loadingTimeout), _[p] = [
|
|
613
613
|
b(k),
|
|
614
614
|
Pe()
|
|
615
|
-
]), [A, R] = _[p], A = await A, D && setTimeout(
|
|
615
|
+
]), [A, R] = _[p], A = await A, D && setTimeout(ke, n.dedupingInterval), !_[p] || _[p][1] !== R)
|
|
616
616
|
return D && x() && w().onDiscarded(p), !1;
|
|
617
617
|
N.error = P;
|
|
618
618
|
const I = y[p];
|
|
@@ -620,21 +620,21 @@ const tt = z.use || ((e) => {
|
|
|
620
620
|
(R <= I[0] || // case 2
|
|
621
621
|
R <= I[1] || // case 3
|
|
622
622
|
I[1] === 0))
|
|
623
|
-
return
|
|
623
|
+
return Ye(), D && x() && w().onDiscarded(p), !1;
|
|
624
624
|
const U = j().data;
|
|
625
625
|
N.data = o(U, A) ? U : A, D && x() && w().onSuccess(A, p, n);
|
|
626
626
|
} catch (I) {
|
|
627
|
-
|
|
627
|
+
ke();
|
|
628
628
|
const U = w(), { shouldRetryOnError: ye } = U;
|
|
629
|
-
U.isPaused() || (N.error = I, D && x() && (U.onError(I, p, U), (ye === !0 || M(ye) && ye(I)) && (!w().revalidateOnFocus || !w().revalidateOnReconnect ||
|
|
629
|
+
U.isPaused() || (N.error = I, D && x() && (U.onError(I, p, U), (ye === !0 || M(ye) && ye(I)) && (!w().revalidateOnFocus || !w().revalidateOnReconnect || C()) && U.onErrorRetry(I, p, U, (zt) => {
|
|
630
630
|
const ge = c[p];
|
|
631
|
-
ge && ge[0] && ge[0](re.ERROR_REVALIDATE_EVENT,
|
|
631
|
+
ge && ge[0] && ge[0](re.ERROR_REVALIDATE_EVENT, zt);
|
|
632
632
|
}, {
|
|
633
633
|
retryCount: (ee.retryCount || 0) + 1,
|
|
634
634
|
dedupe: !0
|
|
635
635
|
})));
|
|
636
636
|
}
|
|
637
|
-
return F = !1,
|
|
637
|
+
return F = !1, Ye(), !0;
|
|
638
638
|
},
|
|
639
639
|
// `setState` is immutable, and `eventsCallback`, `fnArg`, and
|
|
640
640
|
// `keyValidating` are depending on `key`, so we can exclude them from
|
|
@@ -651,14 +651,14 @@ const tt = z.use || ((e) => {
|
|
|
651
651
|
p,
|
|
652
652
|
r
|
|
653
653
|
]
|
|
654
|
-
),
|
|
654
|
+
), ze = ve(
|
|
655
655
|
// Use callback to make sure `keyRef.current` returns latest result every time
|
|
656
|
-
(...m) =>
|
|
656
|
+
(...m) => dt(r, S.current, ...m),
|
|
657
657
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
658
658
|
[]
|
|
659
659
|
);
|
|
660
660
|
if (be(() => {
|
|
661
|
-
|
|
661
|
+
E.current = t, L.current = n, g(Q) || ($e.current = Q);
|
|
662
662
|
}), be(() => {
|
|
663
663
|
if (!p) return;
|
|
664
664
|
const m = ne.bind(P, Re);
|
|
@@ -666,9 +666,9 @@ const tt = z.use || ((e) => {
|
|
|
666
666
|
const R = Fn(p, c, (F, ee = {}) => {
|
|
667
667
|
if (F == re.FOCUS_EVENT) {
|
|
668
668
|
const D = Date.now();
|
|
669
|
-
w().revalidateOnFocus && D > b &&
|
|
669
|
+
w().revalidateOnFocus && D > b && C() && (b = D + w().focusThrottleInterval, m());
|
|
670
670
|
} else if (F == re.RECONNECT_EVENT)
|
|
671
|
-
w().revalidateOnReconnect &&
|
|
671
|
+
w().revalidateOnReconnect && C() && m();
|
|
672
672
|
else {
|
|
673
673
|
if (F == re.MUTATE_EVENT)
|
|
674
674
|
return ne();
|
|
@@ -676,10 +676,10 @@ const tt = z.use || ((e) => {
|
|
|
676
676
|
return ne(ee);
|
|
677
677
|
}
|
|
678
678
|
});
|
|
679
|
-
return
|
|
679
|
+
return v.current = !1, S.current = p, O.current = !0, q({
|
|
680
680
|
_k: k
|
|
681
|
-
}), Ge && (g(Z) || ie ? m() :
|
|
682
|
-
|
|
681
|
+
}), Ge && (g(Z) || ie ? m() : vn(m)), () => {
|
|
682
|
+
v.current = !0, R();
|
|
683
683
|
};
|
|
684
684
|
}, [
|
|
685
685
|
p
|
|
@@ -700,23 +700,23 @@ const tt = z.use || ((e) => {
|
|
|
700
700
|
a,
|
|
701
701
|
u,
|
|
702
702
|
p
|
|
703
|
-
]),
|
|
704
|
-
if (!
|
|
703
|
+
]), Jt(ue), s && g(Z) && p) {
|
|
704
|
+
if (!Ze && ie)
|
|
705
705
|
throw new Error("Fallback data is required when using suspense in SSR.");
|
|
706
|
-
|
|
707
|
-
const m =
|
|
706
|
+
E.current = t, L.current = n, v.current = !1;
|
|
707
|
+
const m = T[p];
|
|
708
708
|
if (!g(m)) {
|
|
709
|
-
const b =
|
|
710
|
-
|
|
709
|
+
const b = ze(m);
|
|
710
|
+
nt(b);
|
|
711
711
|
}
|
|
712
712
|
if (g(ae)) {
|
|
713
713
|
const b = ne(Re);
|
|
714
|
-
g(ue) || (b.status = "fulfilled", b.value = !0),
|
|
714
|
+
g(ue) || (b.status = "fulfilled", b.value = !0), nt(b);
|
|
715
715
|
} else
|
|
716
716
|
throw ae;
|
|
717
717
|
}
|
|
718
718
|
return {
|
|
719
|
-
mutate:
|
|
719
|
+
mutate: ze,
|
|
720
720
|
get data() {
|
|
721
721
|
return J.data = !0, ue;
|
|
722
722
|
},
|
|
@@ -724,20 +724,20 @@ const tt = z.use || ((e) => {
|
|
|
724
724
|
return J.error = !0, ae;
|
|
725
725
|
},
|
|
726
726
|
get isValidating() {
|
|
727
|
-
return J.isValidating = !0,
|
|
727
|
+
return J.isValidating = !0, Gt;
|
|
728
728
|
},
|
|
729
729
|
get isLoading() {
|
|
730
|
-
return J.isLoading = !0,
|
|
730
|
+
return J.isLoading = !0, Kt;
|
|
731
731
|
}
|
|
732
732
|
};
|
|
733
733
|
}, Nn = Vn(Mn);
|
|
734
|
-
function
|
|
734
|
+
function or() {
|
|
735
735
|
const { widgetCtx: e } = Y();
|
|
736
736
|
return Nn([e.config.token], e.api.widgetPrelude, {
|
|
737
737
|
revalidateOnFocus: !1
|
|
738
738
|
});
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function sr() {
|
|
741
741
|
const { widgetCtx: e } = Y();
|
|
742
742
|
return {
|
|
743
743
|
routerState: oe(e.routerCtx.state),
|
|
@@ -745,14 +745,14 @@ function or() {
|
|
|
745
745
|
toChatScreen: e.routerCtx.toChatScreen
|
|
746
746
|
};
|
|
747
747
|
}
|
|
748
|
-
var
|
|
748
|
+
var _t = {}, Le = function(e, t) {
|
|
749
749
|
return Le = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
750
750
|
n.__proto__ = r;
|
|
751
751
|
} || function(n, r) {
|
|
752
752
|
for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (n[o] = r[o]);
|
|
753
753
|
}, Le(e, t);
|
|
754
754
|
};
|
|
755
|
-
function
|
|
755
|
+
function yt(e, t) {
|
|
756
756
|
if (typeof t != "function" && t !== null)
|
|
757
757
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
758
758
|
Le(e, t);
|
|
@@ -770,7 +770,7 @@ var de = function() {
|
|
|
770
770
|
return t;
|
|
771
771
|
}, de.apply(this, arguments);
|
|
772
772
|
};
|
|
773
|
-
function
|
|
773
|
+
function gt(e, t) {
|
|
774
774
|
var n = {};
|
|
775
775
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
776
776
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -778,18 +778,18 @@ function _t(e, t) {
|
|
|
778
778
|
t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
|
|
779
779
|
return n;
|
|
780
780
|
}
|
|
781
|
-
function
|
|
781
|
+
function vt(e, t, n, r) {
|
|
782
782
|
var o = arguments.length, s = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, i;
|
|
783
783
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(e, t, n, r);
|
|
784
784
|
else for (var d = e.length - 1; d >= 0; d--) (i = e[d]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, n, s) : i(t, n)) || s);
|
|
785
785
|
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function Et(e, t) {
|
|
788
788
|
return function(n, r) {
|
|
789
789
|
t(n, r, e);
|
|
790
790
|
};
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function St(e, t, n, r, o, s) {
|
|
793
793
|
function i(p) {
|
|
794
794
|
if (p !== void 0 && typeof p != "function") throw new TypeError("Function expected");
|
|
795
795
|
return p;
|
|
@@ -802,30 +802,30 @@ function Et(e, t, n, r, o, s) {
|
|
|
802
802
|
if (l) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
803
803
|
s.push(i(p || null));
|
|
804
804
|
};
|
|
805
|
-
var
|
|
805
|
+
var T = (0, n[c])(d === "accessor" ? { get: a.get, set: a.set } : a[h], y);
|
|
806
806
|
if (d === "accessor") {
|
|
807
|
-
if (
|
|
808
|
-
if (
|
|
809
|
-
(u = i(
|
|
810
|
-
} else (u = i(
|
|
807
|
+
if (T === void 0) continue;
|
|
808
|
+
if (T === null || typeof T != "object") throw new TypeError("Object expected");
|
|
809
|
+
(u = i(T.get)) && (a.get = u), (u = i(T.set)) && (a.set = u), (u = i(T.init)) && o.unshift(u);
|
|
810
|
+
} else (u = i(T)) && (d === "field" ? o.unshift(u) : a[h] = u);
|
|
811
811
|
}
|
|
812
812
|
f && Object.defineProperty(f, r.name, a), l = !0;
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function wt(e, t, n) {
|
|
815
815
|
for (var r = arguments.length > 2, o = 0; o < t.length; o++)
|
|
816
816
|
n = r ? t[o].call(e, n) : t[o].call(e);
|
|
817
817
|
return r ? n : void 0;
|
|
818
818
|
}
|
|
819
|
-
function
|
|
819
|
+
function mt(e) {
|
|
820
820
|
return typeof e == "symbol" ? e : "".concat(e);
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function bt(e, t, n) {
|
|
823
823
|
return typeof t == "symbol" && (t = t.description ? "[".concat(t.description, "]") : ""), Object.defineProperty(e, "name", { configurable: !0, value: n ? "".concat(n, " ", t) : t });
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function Ot(e, t) {
|
|
826
826
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function Rt(e, t, n, r) {
|
|
829
829
|
function o(s) {
|
|
830
830
|
return s instanceof n ? s : new n(function(i) {
|
|
831
831
|
i(s);
|
|
@@ -852,7 +852,7 @@ function bt(e, t, n, r) {
|
|
|
852
852
|
f((r = r.apply(e, t || [])).next());
|
|
853
853
|
});
|
|
854
854
|
}
|
|
855
|
-
function
|
|
855
|
+
function Tt(e, t) {
|
|
856
856
|
var n = { label: 0, sent: function() {
|
|
857
857
|
if (s[0] & 1) throw s[1];
|
|
858
858
|
return s[1];
|
|
@@ -921,7 +921,7 @@ var _e = Object.create ? function(e, t, n, r) {
|
|
|
921
921
|
} : function(e, t, n, r) {
|
|
922
922
|
r === void 0 && (r = n), e[r] = t[n];
|
|
923
923
|
};
|
|
924
|
-
function
|
|
924
|
+
function Ct(e, t) {
|
|
925
925
|
for (var n in e) n !== "default" && !Object.prototype.hasOwnProperty.call(t, n) && _e(t, e, n);
|
|
926
926
|
}
|
|
927
927
|
function pe(e) {
|
|
@@ -934,7 +934,7 @@ function pe(e) {
|
|
|
934
934
|
};
|
|
935
935
|
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
936
936
|
}
|
|
937
|
-
function
|
|
937
|
+
function We(e, t) {
|
|
938
938
|
var n = typeof Symbol == "function" && e[Symbol.iterator];
|
|
939
939
|
if (!n) return e;
|
|
940
940
|
var r = n.call(e), o, s = [], i;
|
|
@@ -951,19 +951,19 @@ function Ue(e, t) {
|
|
|
951
951
|
}
|
|
952
952
|
return s;
|
|
953
953
|
}
|
|
954
|
-
function
|
|
954
|
+
function Dt() {
|
|
955
955
|
for (var e = [], t = 0; t < arguments.length; t++)
|
|
956
|
-
e = e.concat(
|
|
956
|
+
e = e.concat(We(arguments[t]));
|
|
957
957
|
return e;
|
|
958
958
|
}
|
|
959
|
-
function
|
|
959
|
+
function At() {
|
|
960
960
|
for (var e = 0, t = 0, n = arguments.length; t < n; t++) e += arguments[t].length;
|
|
961
961
|
for (var r = Array(e), o = 0, t = 0; t < n; t++)
|
|
962
962
|
for (var s = arguments[t], i = 0, d = s.length; i < d; i++, o++)
|
|
963
963
|
r[o] = s[i];
|
|
964
964
|
return r;
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function xt(e, t, n) {
|
|
967
967
|
if (n || arguments.length === 2) for (var r = 0, o = t.length, s; r < o; r++)
|
|
968
968
|
(s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
|
|
969
969
|
return e.concat(s || Array.prototype.slice.call(t));
|
|
@@ -971,7 +971,7 @@ function Dt(e, t, n) {
|
|
|
971
971
|
function te(e) {
|
|
972
972
|
return this instanceof te ? (this.v = e, this) : new te(e);
|
|
973
973
|
}
|
|
974
|
-
function
|
|
974
|
+
function jt(e, t, n) {
|
|
975
975
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
976
976
|
var r = n.apply(e, t || []), o, s = [];
|
|
977
977
|
return o = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), d("next"), d("throw"), d("return", i), o[Symbol.asyncIterator] = function() {
|
|
@@ -984,8 +984,8 @@ function At(e, t, n) {
|
|
|
984
984
|
}
|
|
985
985
|
function d(c, y) {
|
|
986
986
|
r[c] && (o[c] = function(_) {
|
|
987
|
-
return new Promise(function(
|
|
988
|
-
s.push([c, _,
|
|
987
|
+
return new Promise(function(T, p) {
|
|
988
|
+
s.push([c, _, T, p]) > 1 || h(c, _);
|
|
989
989
|
});
|
|
990
990
|
}, y && (o[c] = y(o[c])));
|
|
991
991
|
}
|
|
@@ -1009,7 +1009,7 @@ function At(e, t, n) {
|
|
|
1009
1009
|
c(y), s.shift(), s.length && h(s[0][0], s[0][1]);
|
|
1010
1010
|
}
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function Pt(e) {
|
|
1013
1013
|
var t, n;
|
|
1014
1014
|
return t = {}, r("next"), r("throw", function(o) {
|
|
1015
1015
|
throw o;
|
|
@@ -1022,7 +1022,7 @@ function xt(e) {
|
|
|
1022
1022
|
} : s;
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1025
|
+
function Lt(e) {
|
|
1026
1026
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
1027
1027
|
var t = e[Symbol.asyncIterator], n;
|
|
1028
1028
|
return t ? t.call(e) : (e = typeof pe == "function" ? pe(e) : e[Symbol.iterator](), n = {}, r("next"), r("throw"), r("return"), n[Symbol.asyncIterator] = function() {
|
|
@@ -1041,7 +1041,7 @@ function jt(e) {
|
|
|
1041
1041
|
}, i);
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
|
-
function
|
|
1044
|
+
function It(e, t) {
|
|
1045
1045
|
return Object.defineProperty ? Object.defineProperty(e, "raw", { value: t }) : e.raw = t, e;
|
|
1046
1046
|
}
|
|
1047
1047
|
var Un = Object.create ? function(e, t) {
|
|
@@ -1049,31 +1049,31 @@ var Un = Object.create ? function(e, t) {
|
|
|
1049
1049
|
} : function(e, t) {
|
|
1050
1050
|
e.default = t;
|
|
1051
1051
|
};
|
|
1052
|
-
function
|
|
1052
|
+
function Vt(e) {
|
|
1053
1053
|
if (e && e.__esModule) return e;
|
|
1054
1054
|
var t = {};
|
|
1055
1055
|
if (e != null) for (var n in e) n !== "default" && Object.prototype.hasOwnProperty.call(e, n) && _e(t, e, n);
|
|
1056
1056
|
return Un(t, e), t;
|
|
1057
1057
|
}
|
|
1058
|
-
function
|
|
1058
|
+
function Ft(e) {
|
|
1059
1059
|
return e && e.__esModule ? e : { default: e };
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1061
|
+
function Mt(e, t, n, r) {
|
|
1062
1062
|
if (n === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
|
|
1063
1063
|
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");
|
|
1064
1064
|
return n === "m" ? r : n === "a" ? r.call(e) : r ? r.value : t.get(e);
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function Nt(e, t, n, r, o) {
|
|
1067
1067
|
if (r === "m") throw new TypeError("Private method is not writable");
|
|
1068
1068
|
if (r === "a" && !o) throw new TypeError("Private accessor was defined without a setter");
|
|
1069
1069
|
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");
|
|
1070
1070
|
return r === "a" ? o.call(e, n) : o ? o.value = n : t.set(e, n), n;
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1072
|
+
function Ut(e, t) {
|
|
1073
1073
|
if (t === null || typeof t != "object" && typeof t != "function") throw new TypeError("Cannot use 'in' operator on non-object");
|
|
1074
1074
|
return typeof e == "function" ? t === e : e.has(t);
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1076
|
+
function Wt(e, t, n) {
|
|
1077
1077
|
if (t != null) {
|
|
1078
1078
|
if (typeof t != "object" && typeof t != "function") throw new TypeError("Object expected.");
|
|
1079
1079
|
var r, o;
|
|
@@ -1100,7 +1100,7 @@ var Wn = typeof SuppressedError == "function" ? SuppressedError : function(e, t,
|
|
|
1100
1100
|
var r = new Error(n);
|
|
1101
1101
|
return r.name = "SuppressedError", r.error = e, r.suppressed = t, r;
|
|
1102
1102
|
};
|
|
1103
|
-
function
|
|
1103
|
+
function qt(e) {
|
|
1104
1104
|
function t(s) {
|
|
1105
1105
|
e.error = e.hasError ? new Wn(s, e.error, "An error was suppressed during disposal.") : s, e.hasError = !0;
|
|
1106
1106
|
}
|
|
@@ -1123,86 +1123,86 @@ function Ut(e) {
|
|
|
1123
1123
|
}
|
|
1124
1124
|
return o();
|
|
1125
1125
|
}
|
|
1126
|
-
function
|
|
1126
|
+
function Bt(e, t) {
|
|
1127
1127
|
return typeof e == "string" && /^\.\.?\//.test(e) ? e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(n, r, o, s, i) {
|
|
1128
1128
|
return r ? t ? ".jsx" : ".js" : o && (!s || !i) ? n : o + s + "." + i.toLowerCase() + "js";
|
|
1129
1129
|
}) : e;
|
|
1130
1130
|
}
|
|
1131
1131
|
const qn = {
|
|
1132
|
-
__extends:
|
|
1132
|
+
__extends: yt,
|
|
1133
1133
|
__assign: de,
|
|
1134
|
-
__rest:
|
|
1135
|
-
__decorate:
|
|
1136
|
-
__param:
|
|
1137
|
-
__esDecorate:
|
|
1138
|
-
__runInitializers:
|
|
1139
|
-
__propKey:
|
|
1140
|
-
__setFunctionName:
|
|
1141
|
-
__metadata:
|
|
1142
|
-
__awaiter:
|
|
1143
|
-
__generator:
|
|
1134
|
+
__rest: gt,
|
|
1135
|
+
__decorate: vt,
|
|
1136
|
+
__param: Et,
|
|
1137
|
+
__esDecorate: St,
|
|
1138
|
+
__runInitializers: wt,
|
|
1139
|
+
__propKey: mt,
|
|
1140
|
+
__setFunctionName: bt,
|
|
1141
|
+
__metadata: Ot,
|
|
1142
|
+
__awaiter: Rt,
|
|
1143
|
+
__generator: Tt,
|
|
1144
1144
|
__createBinding: _e,
|
|
1145
|
-
__exportStar:
|
|
1145
|
+
__exportStar: Ct,
|
|
1146
1146
|
__values: pe,
|
|
1147
|
-
__read:
|
|
1148
|
-
__spread:
|
|
1149
|
-
__spreadArrays:
|
|
1150
|
-
__spreadArray:
|
|
1147
|
+
__read: We,
|
|
1148
|
+
__spread: Dt,
|
|
1149
|
+
__spreadArrays: At,
|
|
1150
|
+
__spreadArray: xt,
|
|
1151
1151
|
__await: te,
|
|
1152
|
-
__asyncGenerator:
|
|
1153
|
-
__asyncDelegator:
|
|
1154
|
-
__asyncValues:
|
|
1155
|
-
__makeTemplateObject:
|
|
1156
|
-
__importStar:
|
|
1157
|
-
__importDefault:
|
|
1158
|
-
__classPrivateFieldGet:
|
|
1159
|
-
__classPrivateFieldSet:
|
|
1160
|
-
__classPrivateFieldIn:
|
|
1161
|
-
__addDisposableResource:
|
|
1162
|
-
__disposeResources:
|
|
1163
|
-
__rewriteRelativeImportExtension:
|
|
1152
|
+
__asyncGenerator: jt,
|
|
1153
|
+
__asyncDelegator: Pt,
|
|
1154
|
+
__asyncValues: Lt,
|
|
1155
|
+
__makeTemplateObject: It,
|
|
1156
|
+
__importStar: Vt,
|
|
1157
|
+
__importDefault: Ft,
|
|
1158
|
+
__classPrivateFieldGet: Mt,
|
|
1159
|
+
__classPrivateFieldSet: Nt,
|
|
1160
|
+
__classPrivateFieldIn: Ut,
|
|
1161
|
+
__addDisposableResource: Wt,
|
|
1162
|
+
__disposeResources: qt,
|
|
1163
|
+
__rewriteRelativeImportExtension: Bt
|
|
1164
1164
|
}, Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1165
1165
|
__proto__: null,
|
|
1166
|
-
__addDisposableResource:
|
|
1166
|
+
__addDisposableResource: Wt,
|
|
1167
1167
|
get __assign() {
|
|
1168
1168
|
return de;
|
|
1169
1169
|
},
|
|
1170
|
-
__asyncDelegator:
|
|
1171
|
-
__asyncGenerator:
|
|
1172
|
-
__asyncValues:
|
|
1170
|
+
__asyncDelegator: Pt,
|
|
1171
|
+
__asyncGenerator: jt,
|
|
1172
|
+
__asyncValues: Lt,
|
|
1173
1173
|
__await: te,
|
|
1174
|
-
__awaiter:
|
|
1175
|
-
__classPrivateFieldGet:
|
|
1176
|
-
__classPrivateFieldIn:
|
|
1177
|
-
__classPrivateFieldSet:
|
|
1174
|
+
__awaiter: Rt,
|
|
1175
|
+
__classPrivateFieldGet: Mt,
|
|
1176
|
+
__classPrivateFieldIn: Ut,
|
|
1177
|
+
__classPrivateFieldSet: Nt,
|
|
1178
1178
|
__createBinding: _e,
|
|
1179
|
-
__decorate:
|
|
1180
|
-
__disposeResources:
|
|
1181
|
-
__esDecorate:
|
|
1182
|
-
__exportStar:
|
|
1183
|
-
__extends:
|
|
1184
|
-
__generator:
|
|
1185
|
-
__importDefault:
|
|
1186
|
-
__importStar:
|
|
1187
|
-
__makeTemplateObject:
|
|
1188
|
-
__metadata:
|
|
1189
|
-
__param:
|
|
1190
|
-
__propKey:
|
|
1191
|
-
__read:
|
|
1192
|
-
__rest:
|
|
1193
|
-
__rewriteRelativeImportExtension:
|
|
1194
|
-
__runInitializers:
|
|
1195
|
-
__setFunctionName:
|
|
1196
|
-
__spread:
|
|
1197
|
-
__spreadArray:
|
|
1198
|
-
__spreadArrays:
|
|
1179
|
+
__decorate: vt,
|
|
1180
|
+
__disposeResources: qt,
|
|
1181
|
+
__esDecorate: St,
|
|
1182
|
+
__exportStar: Ct,
|
|
1183
|
+
__extends: yt,
|
|
1184
|
+
__generator: Tt,
|
|
1185
|
+
__importDefault: Ft,
|
|
1186
|
+
__importStar: Vt,
|
|
1187
|
+
__makeTemplateObject: It,
|
|
1188
|
+
__metadata: Ot,
|
|
1189
|
+
__param: Et,
|
|
1190
|
+
__propKey: mt,
|
|
1191
|
+
__read: We,
|
|
1192
|
+
__rest: gt,
|
|
1193
|
+
__rewriteRelativeImportExtension: Bt,
|
|
1194
|
+
__runInitializers: wt,
|
|
1195
|
+
__setFunctionName: bt,
|
|
1196
|
+
__spread: Dt,
|
|
1197
|
+
__spreadArray: xt,
|
|
1198
|
+
__spreadArrays: At,
|
|
1199
1199
|
__values: pe,
|
|
1200
1200
|
default: qn
|
|
1201
1201
|
}, Symbol.toStringTag, { value: "Module" })), Hn = /* @__PURE__ */ on(Bn);
|
|
1202
|
-
var le = {},
|
|
1203
|
-
function
|
|
1204
|
-
if (
|
|
1205
|
-
|
|
1202
|
+
var le = {}, rt;
|
|
1203
|
+
function $n() {
|
|
1204
|
+
if (rt) return le;
|
|
1205
|
+
rt = 1, Object.defineProperty(le, "__esModule", { value: !0 });
|
|
1206
1206
|
var e = z;
|
|
1207
1207
|
function t() {
|
|
1208
1208
|
var n = e.useRef(!1), r = e.useCallback(function() {
|
|
@@ -1216,11 +1216,11 @@ function Gn() {
|
|
|
1216
1216
|
}
|
|
1217
1217
|
return le.default = t, le;
|
|
1218
1218
|
}
|
|
1219
|
-
Object.defineProperty(
|
|
1220
|
-
var Ie = Hn,
|
|
1219
|
+
Object.defineProperty(_t, "__esModule", { value: !0 });
|
|
1220
|
+
var Ie = Hn, Te = z, Gn = Ie.__importDefault($n());
|
|
1221
1221
|
function Kn(e, t, n) {
|
|
1222
1222
|
t === void 0 && (t = []), n === void 0 && (n = { loading: !1 });
|
|
1223
|
-
var r =
|
|
1223
|
+
var r = Te.useRef(0), o = Gn.default(), s = Te.useState(n), i = s[0], d = s[1], h = Te.useCallback(function() {
|
|
1224
1224
|
for (var f = [], a = 0; a < arguments.length; a++)
|
|
1225
1225
|
f[a] = arguments[a];
|
|
1226
1226
|
var u = ++r.current;
|
|
@@ -1234,16 +1234,16 @@ function Kn(e, t, n) {
|
|
|
1234
1234
|
}, t);
|
|
1235
1235
|
return [i, h];
|
|
1236
1236
|
}
|
|
1237
|
-
var
|
|
1237
|
+
var ir = _t.default = Kn;
|
|
1238
1238
|
const B = /* @__PURE__ */ new Map();
|
|
1239
|
-
function
|
|
1240
|
-
const [e, t] =
|
|
1239
|
+
function ar() {
|
|
1240
|
+
const [e, t] = Ve([]), {
|
|
1241
1241
|
widgetCtx: { api: n }
|
|
1242
1242
|
} = Y();
|
|
1243
1243
|
function r(a) {
|
|
1244
1244
|
const u = a.map((l) => ({
|
|
1245
1245
|
file: l,
|
|
1246
|
-
id:
|
|
1246
|
+
id: Qt(),
|
|
1247
1247
|
status: "pending",
|
|
1248
1248
|
progress: 0
|
|
1249
1249
|
}));
|
|
@@ -1290,11 +1290,11 @@ function ir() {
|
|
|
1290
1290
|
}, d = (a) => {
|
|
1291
1291
|
const u = B.get(a);
|
|
1292
1292
|
u && (u.abort(), B.delete(a)), s(a);
|
|
1293
|
-
}, h =
|
|
1293
|
+
}, h = Fe(() => e.filter((a) => a.status === "success" && a.fileUrl), [e]);
|
|
1294
1294
|
function f() {
|
|
1295
1295
|
B.forEach((a) => a.abort()), B.clear(), t([]);
|
|
1296
1296
|
}
|
|
1297
|
-
return
|
|
1297
|
+
return Me(() => () => {
|
|
1298
1298
|
B.forEach((a) => a.abort()), B.clear();
|
|
1299
1299
|
}, []), {
|
|
1300
1300
|
allFiles: e,
|
|
@@ -1315,20 +1315,27 @@ function ir() {
|
|
|
1315
1315
|
isUploading: e.some((a) => a.status === "uploading")
|
|
1316
1316
|
};
|
|
1317
1317
|
}
|
|
1318
|
+
const [ur, zn] = at();
|
|
1319
|
+
function cr({ children: e }) {
|
|
1320
|
+
const [t, n] = Ve(!1);
|
|
1321
|
+
return /* @__PURE__ */ it(zn, { value: { isOpen: t, setIsOpen: n }, children: e });
|
|
1322
|
+
}
|
|
1318
1323
|
export {
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
+
Qn as W,
|
|
1325
|
+
ir as _,
|
|
1326
|
+
Zn as a,
|
|
1327
|
+
er as b,
|
|
1328
|
+
tr as c,
|
|
1324
1329
|
nn as d,
|
|
1325
|
-
|
|
1330
|
+
or as e,
|
|
1326
1331
|
oe as f,
|
|
1327
1332
|
rn as g,
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1333
|
+
sr as h,
|
|
1334
|
+
ar as i,
|
|
1335
|
+
ur as j,
|
|
1336
|
+
cr as k,
|
|
1337
|
+
nr as l,
|
|
1338
|
+
rr as m,
|
|
1332
1339
|
Y as u
|
|
1333
1340
|
};
|
|
1334
|
-
//# sourceMappingURL=
|
|
1341
|
+
//# sourceMappingURL=useWidgetTrigger-vh6E1XGL.js.map
|