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