@gymmymac/bob-widget 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -12
- package/dist/index.mjs +933 -934
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
var Vr = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var i = (t, e, r) => (
|
|
4
|
+
var jr = (t, e, r) => e.has(t) || Vr("Cannot " + r);
|
|
5
|
+
var i = (t, e, r) => (jr(t, e, "read from private field"), r ? r.call(t) : e.get(t)), N = (t, e, r) => e.has(t) ? Vr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), _ = (t, e, r, s) => (jr(t, e, "write to private field"), s ? s.call(t, r) : e.set(t, r), r), $ = (t, e, r) => (jr(t, e, "access private method"), r);
|
|
6
6
|
var gr = (t, e, r, s) => ({
|
|
7
7
|
set _(a) {
|
|
8
|
-
|
|
8
|
+
_(t, e, a, r);
|
|
9
9
|
},
|
|
10
10
|
get _() {
|
|
11
11
|
return i(t, e, s);
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
import * as Ce from "react";
|
|
15
|
-
import er, { createContext as Us, useMemo as tr, useEffect as te, useContext as qs, useState as z, useRef as G, useCallback as
|
|
15
|
+
import er, { createContext as Us, useMemo as tr, useEffect as te, useContext as qs, useState as z, useRef as G, useCallback as J } from "react";
|
|
16
16
|
import { createClient as $s } from "@supabase/supabase-js";
|
|
17
|
-
const xr = "1.1.
|
|
18
|
-
var
|
|
17
|
+
const xr = "1.1.6", Gn = () => xr;
|
|
18
|
+
var Tr = { exports: {} }, Jt = {};
|
|
19
19
|
/**
|
|
20
20
|
* @license React
|
|
21
21
|
* react-jsx-runtime.production.min.js
|
|
@@ -31,11 +31,11 @@ function Qs() {
|
|
|
31
31
|
zr = 1;
|
|
32
32
|
var t = er, e = Symbol.for("react.element"), r = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
33
33
|
function l(f, u, x) {
|
|
34
|
-
var p, d = {}, m = null,
|
|
35
|
-
x !== void 0 && (m = "" + x), u.key !== void 0 && (m = "" + u.key), u.ref !== void 0 && (
|
|
34
|
+
var p, d = {}, m = null, S = null;
|
|
35
|
+
x !== void 0 && (m = "" + x), u.key !== void 0 && (m = "" + u.key), u.ref !== void 0 && (S = u.ref);
|
|
36
36
|
for (p in u) s.call(u, p) && !c.hasOwnProperty(p) && (d[p] = u[p]);
|
|
37
37
|
if (f && f.defaultProps) for (p in u = f.defaultProps, u) d[p] === void 0 && (d[p] = u[p]);
|
|
38
|
-
return { $$typeof: e, type: f, key: m, ref:
|
|
38
|
+
return { $$typeof: e, type: f, key: m, ref: S, props: d, _owner: a.current };
|
|
39
39
|
}
|
|
40
40
|
return Jt.Fragment = r, Jt.jsx = l, Jt.jsxs = l, Jt;
|
|
41
41
|
}
|
|
@@ -52,51 +52,51 @@ var Xt = {};
|
|
|
52
52
|
var Hr;
|
|
53
53
|
function Ws() {
|
|
54
54
|
return Hr || (Hr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
55
|
-
var t = er, e = Symbol.for("react.element"), r = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), f = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), m = Symbol.for("react.lazy"),
|
|
56
|
-
function
|
|
55
|
+
var t = er, e = Symbol.for("react.element"), r = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), f = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), P = Symbol.iterator, T = "@@iterator";
|
|
56
|
+
function j(n) {
|
|
57
57
|
if (n === null || typeof n != "object")
|
|
58
58
|
return null;
|
|
59
|
-
var
|
|
60
|
-
return typeof
|
|
59
|
+
var v = P && n[P] || n[T];
|
|
60
|
+
return typeof v == "function" ? v : null;
|
|
61
61
|
}
|
|
62
62
|
var R = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
63
63
|
function g(n) {
|
|
64
64
|
{
|
|
65
|
-
for (var
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
for (var v = arguments.length, O = new Array(v > 1 ? v - 1 : 0), M = 1; M < v; M++)
|
|
66
|
+
O[M - 1] = arguments[M];
|
|
67
|
+
E("error", n, O);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function E(n, v, O) {
|
|
71
71
|
{
|
|
72
|
-
var
|
|
73
|
-
K !== "" && (
|
|
74
|
-
var H =
|
|
72
|
+
var M = R.ReactDebugCurrentFrame, K = M.getStackAddendum();
|
|
73
|
+
K !== "" && (v += "%s", O = O.concat([K]));
|
|
74
|
+
var H = O.map(function(W) {
|
|
75
75
|
return String(W);
|
|
76
76
|
});
|
|
77
|
-
H.unshift("Warning: " +
|
|
77
|
+
H.unshift("Warning: " + v), Function.prototype.apply.call(console[n], console, H);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
var h = !1, b = !1,
|
|
81
|
-
|
|
82
|
-
function
|
|
83
|
-
return !!(typeof n == "string" || typeof n == "function" || n === s || n === c ||
|
|
80
|
+
var h = !1, b = !1, y = !1, I = !1, k = !1, F;
|
|
81
|
+
F = Symbol.for("react.module.reference");
|
|
82
|
+
function w(n) {
|
|
83
|
+
return !!(typeof n == "string" || typeof n == "function" || n === s || n === c || k || n === a || n === x || n === p || I || n === S || h || b || y || typeof n == "object" && n !== null && (n.$$typeof === m || n.$$typeof === d || n.$$typeof === l || n.$$typeof === f || n.$$typeof === u || // This needs to include all possible module reference object
|
|
84
84
|
// types supported by any Flight configuration anywhere since
|
|
85
85
|
// we don't know which Flight build this will end up being used
|
|
86
86
|
// with.
|
|
87
|
-
n.$$typeof ===
|
|
87
|
+
n.$$typeof === F || n.getModuleId !== void 0));
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
var
|
|
91
|
-
if (
|
|
92
|
-
return
|
|
93
|
-
var K =
|
|
94
|
-
return K !== "" ?
|
|
89
|
+
function C(n, v, O) {
|
|
90
|
+
var M = n.displayName;
|
|
91
|
+
if (M)
|
|
92
|
+
return M;
|
|
93
|
+
var K = v.displayName || v.name || "";
|
|
94
|
+
return K !== "" ? O + "(" + K + ")" : O;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function D(n) {
|
|
97
97
|
return n.displayName || "Context";
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function A(n) {
|
|
100
100
|
if (n == null)
|
|
101
101
|
return null;
|
|
102
102
|
if (typeof n.tag == "number" && g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof n == "function")
|
|
@@ -120,20 +120,20 @@ function Ws() {
|
|
|
120
120
|
if (typeof n == "object")
|
|
121
121
|
switch (n.$$typeof) {
|
|
122
122
|
case f:
|
|
123
|
-
var
|
|
124
|
-
return
|
|
123
|
+
var v = n;
|
|
124
|
+
return D(v) + ".Consumer";
|
|
125
125
|
case l:
|
|
126
|
-
var
|
|
127
|
-
return
|
|
126
|
+
var O = n;
|
|
127
|
+
return D(O._context) + ".Provider";
|
|
128
128
|
case u:
|
|
129
|
-
return
|
|
129
|
+
return C(n, n.render, "ForwardRef");
|
|
130
130
|
case d:
|
|
131
|
-
var
|
|
132
|
-
return
|
|
131
|
+
var M = n.displayName || null;
|
|
132
|
+
return M !== null ? M : A(n.type) || "Memo";
|
|
133
133
|
case m: {
|
|
134
134
|
var K = n, H = K._payload, W = K._init;
|
|
135
135
|
try {
|
|
136
|
-
return
|
|
136
|
+
return A(W(H));
|
|
137
137
|
} catch {
|
|
138
138
|
return null;
|
|
139
139
|
}
|
|
@@ -141,14 +141,14 @@ function Ws() {
|
|
|
141
141
|
}
|
|
142
142
|
return null;
|
|
143
143
|
}
|
|
144
|
-
var L = Object.assign,
|
|
144
|
+
var L = Object.assign, Z = 0, Ee, B, oe, ge, $e, Y, nt;
|
|
145
145
|
function ur() {
|
|
146
146
|
}
|
|
147
147
|
ur.__reactDisabledLog = !0;
|
|
148
148
|
function Se() {
|
|
149
149
|
{
|
|
150
|
-
if (
|
|
151
|
-
Ee = console.log, B = console.info,
|
|
150
|
+
if (Z === 0) {
|
|
151
|
+
Ee = console.log, B = console.info, oe = console.warn, ge = console.error, $e = console.group, Y = console.groupCollapsed, nt = console.groupEnd;
|
|
152
152
|
var n = {
|
|
153
153
|
configurable: !0,
|
|
154
154
|
enumerable: !0,
|
|
@@ -165,12 +165,12 @@ function Ws() {
|
|
|
165
165
|
groupEnd: n
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
|
|
168
|
+
Z++;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
function wr() {
|
|
172
172
|
{
|
|
173
|
-
if (
|
|
173
|
+
if (Z--, Z === 0) {
|
|
174
174
|
var n = {
|
|
175
175
|
configurable: !0,
|
|
176
176
|
enumerable: !0,
|
|
@@ -184,34 +184,34 @@ function Ws() {
|
|
|
184
184
|
value: B
|
|
185
185
|
}),
|
|
186
186
|
warn: L({}, n, {
|
|
187
|
-
value:
|
|
187
|
+
value: oe
|
|
188
188
|
}),
|
|
189
189
|
error: L({}, n, {
|
|
190
|
-
value:
|
|
190
|
+
value: ge
|
|
191
191
|
}),
|
|
192
192
|
group: L({}, n, {
|
|
193
193
|
value: $e
|
|
194
194
|
}),
|
|
195
195
|
groupCollapsed: L({}, n, {
|
|
196
|
-
value:
|
|
196
|
+
value: Y
|
|
197
197
|
}),
|
|
198
198
|
groupEnd: L({}, n, {
|
|
199
199
|
value: nt
|
|
200
200
|
})
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
-
|
|
203
|
+
Z < 0 && g("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
var _t = R.ReactCurrentDispatcher, dr;
|
|
207
|
-
function Wt(n,
|
|
207
|
+
function Wt(n, v, O) {
|
|
208
208
|
{
|
|
209
209
|
if (dr === void 0)
|
|
210
210
|
try {
|
|
211
211
|
throw Error();
|
|
212
212
|
} catch (K) {
|
|
213
|
-
var
|
|
214
|
-
dr =
|
|
213
|
+
var M = K.stack.trim().match(/\n( *(at )?)/);
|
|
214
|
+
dr = M && M[1] || "";
|
|
215
215
|
}
|
|
216
216
|
return `
|
|
217
217
|
` + dr + n;
|
|
@@ -222,22 +222,22 @@ function Ws() {
|
|
|
222
222
|
var Kr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
223
223
|
Kt = new Kr();
|
|
224
224
|
}
|
|
225
|
-
function Cr(n,
|
|
225
|
+
function Cr(n, v) {
|
|
226
226
|
if (!n || hr)
|
|
227
227
|
return "";
|
|
228
228
|
{
|
|
229
|
-
var
|
|
230
|
-
if (
|
|
231
|
-
return
|
|
229
|
+
var O = Kt.get(n);
|
|
230
|
+
if (O !== void 0)
|
|
231
|
+
return O;
|
|
232
232
|
}
|
|
233
|
-
var
|
|
233
|
+
var M;
|
|
234
234
|
hr = !0;
|
|
235
235
|
var K = Error.prepareStackTrace;
|
|
236
236
|
Error.prepareStackTrace = void 0;
|
|
237
237
|
var H;
|
|
238
238
|
H = _t.current, _t.current = null, Se();
|
|
239
239
|
try {
|
|
240
|
-
if (
|
|
240
|
+
if (v) {
|
|
241
241
|
var W = function() {
|
|
242
242
|
throw Error();
|
|
243
243
|
};
|
|
@@ -248,30 +248,30 @@ function Ws() {
|
|
|
248
248
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
249
249
|
try {
|
|
250
250
|
Reflect.construct(W, []);
|
|
251
|
-
} catch (
|
|
252
|
-
|
|
251
|
+
} catch (fe) {
|
|
252
|
+
M = fe;
|
|
253
253
|
}
|
|
254
254
|
Reflect.construct(n, [], W);
|
|
255
255
|
} else {
|
|
256
256
|
try {
|
|
257
257
|
W.call();
|
|
258
|
-
} catch (
|
|
259
|
-
|
|
258
|
+
} catch (fe) {
|
|
259
|
+
M = fe;
|
|
260
260
|
}
|
|
261
261
|
n.call(W.prototype);
|
|
262
262
|
}
|
|
263
263
|
} else {
|
|
264
264
|
try {
|
|
265
265
|
throw Error();
|
|
266
|
-
} catch (
|
|
267
|
-
|
|
266
|
+
} catch (fe) {
|
|
267
|
+
M = fe;
|
|
268
268
|
}
|
|
269
269
|
n();
|
|
270
270
|
}
|
|
271
|
-
} catch (
|
|
272
|
-
if (
|
|
273
|
-
for (var U =
|
|
274
|
-
`), le =
|
|
271
|
+
} catch (fe) {
|
|
272
|
+
if (fe && M && typeof fe.stack == "string") {
|
|
273
|
+
for (var U = fe.stack.split(`
|
|
274
|
+
`), le = M.stack.split(`
|
|
275
275
|
`), ee = U.length - 1, re = le.length - 1; ee >= 1 && re >= 0 && U[ee] !== le[re]; )
|
|
276
276
|
re--;
|
|
277
277
|
for (; ee >= 1 && re >= 0; ee--, re--)
|
|
@@ -293,14 +293,14 @@ function Ws() {
|
|
|
293
293
|
var Pt = n ? n.displayName || n.name : "", pt = Pt ? Wt(Pt) : "";
|
|
294
294
|
return typeof n == "function" && Kt.set(n, pt), pt;
|
|
295
295
|
}
|
|
296
|
-
function fr(n,
|
|
296
|
+
function fr(n, v, O) {
|
|
297
297
|
return Cr(n, !1);
|
|
298
298
|
}
|
|
299
299
|
function pr(n) {
|
|
300
|
-
var
|
|
301
|
-
return !!(
|
|
300
|
+
var v = n.prototype;
|
|
301
|
+
return !!(v && v.isReactComponent);
|
|
302
302
|
}
|
|
303
|
-
function it(n,
|
|
303
|
+
function it(n, v, O) {
|
|
304
304
|
if (n == null)
|
|
305
305
|
return "";
|
|
306
306
|
if (typeof n == "function")
|
|
@@ -318,11 +318,11 @@ function Ws() {
|
|
|
318
318
|
case u:
|
|
319
319
|
return fr(n.render);
|
|
320
320
|
case d:
|
|
321
|
-
return it(n.type,
|
|
321
|
+
return it(n.type, v, O);
|
|
322
322
|
case m: {
|
|
323
|
-
var
|
|
323
|
+
var M = n, K = M._payload, H = M._init;
|
|
324
324
|
try {
|
|
325
|
-
return it(H(K),
|
|
325
|
+
return it(H(K), v, O);
|
|
326
326
|
} catch {
|
|
327
327
|
}
|
|
328
328
|
}
|
|
@@ -330,14 +330,14 @@ function Ws() {
|
|
|
330
330
|
return "";
|
|
331
331
|
}
|
|
332
332
|
var Qe = Object.prototype.hasOwnProperty, q = {}, se = R.ReactDebugCurrentFrame;
|
|
333
|
-
function
|
|
333
|
+
function ne(n) {
|
|
334
334
|
if (n) {
|
|
335
|
-
var
|
|
336
|
-
se.setExtraStackFrame(
|
|
335
|
+
var v = n._owner, O = it(n.type, n._source, v ? v.type : null);
|
|
336
|
+
se.setExtraStackFrame(O);
|
|
337
337
|
} else
|
|
338
338
|
se.setExtraStackFrame(null);
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function he(n, v, O, M, K) {
|
|
341
341
|
{
|
|
342
342
|
var H = Function.call.bind(Qe);
|
|
343
343
|
for (var W in n)
|
|
@@ -345,14 +345,14 @@ function Ws() {
|
|
|
345
345
|
var U = void 0;
|
|
346
346
|
try {
|
|
347
347
|
if (typeof n[W] != "function") {
|
|
348
|
-
var le = Error((
|
|
348
|
+
var le = Error((M || "React class") + ": " + O + " type `" + W + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof n[W] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
349
349
|
throw le.name = "Invariant Violation", le;
|
|
350
350
|
}
|
|
351
|
-
U = n[W](
|
|
351
|
+
U = n[W](v, W, M, O, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
352
352
|
} catch (ee) {
|
|
353
353
|
U = ee;
|
|
354
354
|
}
|
|
355
|
-
U && !(U instanceof Error) && (
|
|
355
|
+
U && !(U instanceof Error) && (ne(K), g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", M || "React class", O, W, typeof U), ne(null)), U instanceof Error && !(U.message in q) && (q[U.message] = !0, ne(K), g("Failed %s type: %s", O, U.message), ne(null));
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
}
|
|
@@ -362,8 +362,8 @@ function Ws() {
|
|
|
362
362
|
}
|
|
363
363
|
function ot(n) {
|
|
364
364
|
{
|
|
365
|
-
var
|
|
366
|
-
return
|
|
365
|
+
var v = typeof Symbol == "function" && Symbol.toStringTag, O = v && n[Symbol.toStringTag] || n.constructor.name || "Object";
|
|
366
|
+
return O;
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
function ct(n) {
|
|
@@ -380,7 +380,7 @@ function Ws() {
|
|
|
380
380
|
if (ct(n))
|
|
381
381
|
return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ot(n)), lt(n);
|
|
382
382
|
}
|
|
383
|
-
var Ve = R.ReactCurrentOwner,
|
|
383
|
+
var Ve = R.ReactCurrentOwner, je = {
|
|
384
384
|
key: !0,
|
|
385
385
|
ref: !0,
|
|
386
386
|
__self: !0,
|
|
@@ -388,53 +388,53 @@ function Ws() {
|
|
|
388
388
|
}, ut, dt;
|
|
389
389
|
function Ie(n) {
|
|
390
390
|
if (Qe.call(n, "ref")) {
|
|
391
|
-
var
|
|
392
|
-
if (
|
|
391
|
+
var v = Object.getOwnPropertyDescriptor(n, "ref").get;
|
|
392
|
+
if (v && v.isReactWarning)
|
|
393
393
|
return !1;
|
|
394
394
|
}
|
|
395
395
|
return n.ref !== void 0;
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function Te(n) {
|
|
398
398
|
if (Qe.call(n, "key")) {
|
|
399
|
-
var
|
|
400
|
-
if (
|
|
399
|
+
var v = Object.getOwnPropertyDescriptor(n, "key").get;
|
|
400
|
+
if (v && v.isReactWarning)
|
|
401
401
|
return !1;
|
|
402
402
|
}
|
|
403
403
|
return n.key !== void 0;
|
|
404
404
|
}
|
|
405
|
-
function De(n,
|
|
405
|
+
function De(n, v) {
|
|
406
406
|
typeof n.ref == "string" && Ve.current;
|
|
407
407
|
}
|
|
408
|
-
function ht(n,
|
|
408
|
+
function ht(n, v) {
|
|
409
409
|
{
|
|
410
|
-
var
|
|
411
|
-
ut || (ut = !0, g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",
|
|
410
|
+
var O = function() {
|
|
411
|
+
ut || (ut = !0, g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", v));
|
|
412
412
|
};
|
|
413
|
-
|
|
414
|
-
get:
|
|
413
|
+
O.isReactWarning = !0, Object.defineProperty(n, "key", {
|
|
414
|
+
get: O,
|
|
415
415
|
configurable: !0
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
function Re(n,
|
|
419
|
+
function Re(n, v) {
|
|
420
420
|
{
|
|
421
|
-
var
|
|
422
|
-
dt || (dt = !0, g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",
|
|
421
|
+
var O = function() {
|
|
422
|
+
dt || (dt = !0, g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", v));
|
|
423
423
|
};
|
|
424
|
-
|
|
425
|
-
get:
|
|
424
|
+
O.isReactWarning = !0, Object.defineProperty(n, "ref", {
|
|
425
|
+
get: O,
|
|
426
426
|
configurable: !0
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
var be = function(n,
|
|
430
|
+
var be = function(n, v, O, M, K, H, W) {
|
|
431
431
|
var U = {
|
|
432
432
|
// This tag allows us to uniquely identify this as a React Element
|
|
433
433
|
$$typeof: e,
|
|
434
434
|
// Built-in properties that belong on the element
|
|
435
435
|
type: n,
|
|
436
|
-
key:
|
|
437
|
-
ref:
|
|
436
|
+
key: v,
|
|
437
|
+
ref: O,
|
|
438
438
|
props: W,
|
|
439
439
|
// Record the component responsible for creating this element.
|
|
440
440
|
_owner: H
|
|
@@ -448,7 +448,7 @@ function Ws() {
|
|
|
448
448
|
configurable: !1,
|
|
449
449
|
enumerable: !1,
|
|
450
450
|
writable: !1,
|
|
451
|
-
value:
|
|
451
|
+
value: M
|
|
452
452
|
}), Object.defineProperty(U, "_source", {
|
|
453
453
|
configurable: !1,
|
|
454
454
|
enumerable: !1,
|
|
@@ -456,12 +456,12 @@ function Ws() {
|
|
|
456
456
|
value: K
|
|
457
457
|
}), Object.freeze && (Object.freeze(U.props), Object.freeze(U)), U;
|
|
458
458
|
};
|
|
459
|
-
function _e(n,
|
|
459
|
+
function _e(n, v, O, M, K) {
|
|
460
460
|
{
|
|
461
461
|
var H, W = {}, U = null, le = null;
|
|
462
|
-
|
|
463
|
-
for (H in
|
|
464
|
-
Qe.call(
|
|
462
|
+
O !== void 0 && (Ke(O), U = "" + O), Te(v) && (Ke(v.key), U = "" + v.key), Ie(v) && (le = v.ref, De(v, K));
|
|
463
|
+
for (H in v)
|
|
464
|
+
Qe.call(v, H) && !je.hasOwnProperty(H) && (W[H] = v[H]);
|
|
465
465
|
if (n && n.defaultProps) {
|
|
466
466
|
var ee = n.defaultProps;
|
|
467
467
|
for (H in ee)
|
|
@@ -471,14 +471,14 @@ function Ws() {
|
|
|
471
471
|
var re = typeof n == "function" ? n.displayName || n.name || "Unknown" : n;
|
|
472
472
|
U && ht(W, re), le && Re(W, re);
|
|
473
473
|
}
|
|
474
|
-
return be(n, U, le, K,
|
|
474
|
+
return be(n, U, le, K, M, Ve.current, W);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
var Ne = R.ReactCurrentOwner, Vt = R.ReactDebugCurrentFrame;
|
|
478
478
|
function ze(n) {
|
|
479
479
|
if (n) {
|
|
480
|
-
var
|
|
481
|
-
Vt.setExtraStackFrame(
|
|
480
|
+
var v = n._owner, O = it(n.type, n._source, v ? v.type : null);
|
|
481
|
+
Vt.setExtraStackFrame(O);
|
|
482
482
|
} else
|
|
483
483
|
Vt.setExtraStackFrame(null);
|
|
484
484
|
}
|
|
@@ -490,7 +490,7 @@ function Ws() {
|
|
|
490
490
|
function He() {
|
|
491
491
|
{
|
|
492
492
|
if (Ne.current) {
|
|
493
|
-
var n =
|
|
493
|
+
var n = A(Ne.current.type);
|
|
494
494
|
if (n)
|
|
495
495
|
return `
|
|
496
496
|
|
|
@@ -505,79 +505,79 @@ Check the render method of \`` + n + "`.";
|
|
|
505
505
|
var ke = {};
|
|
506
506
|
function mr(n) {
|
|
507
507
|
{
|
|
508
|
-
var
|
|
509
|
-
if (!
|
|
510
|
-
var
|
|
511
|
-
|
|
508
|
+
var v = He();
|
|
509
|
+
if (!v) {
|
|
510
|
+
var O = typeof n == "string" ? n : n.displayName || n.name;
|
|
511
|
+
O && (v = `
|
|
512
512
|
|
|
513
|
-
Check the top-level render call using <` +
|
|
513
|
+
Check the top-level render call using <` + O + ">.");
|
|
514
514
|
}
|
|
515
|
-
return
|
|
515
|
+
return v;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function ie(n, v) {
|
|
519
519
|
{
|
|
520
520
|
if (!n._store || n._store.validated || n.key != null)
|
|
521
521
|
return;
|
|
522
522
|
n._store.validated = !0;
|
|
523
|
-
var
|
|
524
|
-
if (ke[
|
|
523
|
+
var O = mr(v);
|
|
524
|
+
if (ke[O])
|
|
525
525
|
return;
|
|
526
|
-
ke[
|
|
527
|
-
var
|
|
528
|
-
n && n._owner && n._owner !== Ne.current && (
|
|
526
|
+
ke[O] = !0;
|
|
527
|
+
var M = "";
|
|
528
|
+
n && n._owner && n._owner !== Ne.current && (M = " It was passed a child from " + A(n._owner.type) + "."), ze(n), g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', O, M), ze(null);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
|
-
function Ht(n,
|
|
531
|
+
function Ht(n, v) {
|
|
532
532
|
{
|
|
533
533
|
if (typeof n != "object")
|
|
534
534
|
return;
|
|
535
535
|
if (at(n))
|
|
536
|
-
for (var
|
|
537
|
-
var
|
|
538
|
-
ye(
|
|
536
|
+
for (var O = 0; O < n.length; O++) {
|
|
537
|
+
var M = n[O];
|
|
538
|
+
ye(M) && ie(M, v);
|
|
539
539
|
}
|
|
540
540
|
else if (ye(n))
|
|
541
541
|
n._store && (n._store.validated = !0);
|
|
542
542
|
else if (n) {
|
|
543
|
-
var K =
|
|
543
|
+
var K = j(n);
|
|
544
544
|
if (typeof K == "function" && K !== n.entries)
|
|
545
545
|
for (var H = K.call(n), W; !(W = H.next()).done; )
|
|
546
|
-
ye(W.value) &&
|
|
546
|
+
ye(W.value) && ie(W.value, v);
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
function Gt(n) {
|
|
551
551
|
{
|
|
552
|
-
var
|
|
553
|
-
if (
|
|
552
|
+
var v = n.type;
|
|
553
|
+
if (v == null || typeof v == "string")
|
|
554
554
|
return;
|
|
555
|
-
var
|
|
556
|
-
if (typeof
|
|
557
|
-
|
|
558
|
-
else if (typeof
|
|
555
|
+
var O;
|
|
556
|
+
if (typeof v == "function")
|
|
557
|
+
O = v.propTypes;
|
|
558
|
+
else if (typeof v == "object" && (v.$$typeof === u || // Note: Memo only checks outer props here.
|
|
559
559
|
// Inner props are checked in the reconciler.
|
|
560
|
-
|
|
561
|
-
|
|
560
|
+
v.$$typeof === d))
|
|
561
|
+
O = v.propTypes;
|
|
562
562
|
else
|
|
563
563
|
return;
|
|
564
|
-
if (
|
|
565
|
-
var
|
|
566
|
-
|
|
567
|
-
} else if (
|
|
564
|
+
if (O) {
|
|
565
|
+
var M = A(v);
|
|
566
|
+
he(O, n.props, "prop", M, n);
|
|
567
|
+
} else if (v.PropTypes !== void 0 && !kt) {
|
|
568
568
|
kt = !0;
|
|
569
|
-
var K =
|
|
569
|
+
var K = A(v);
|
|
570
570
|
g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", K || "Unknown");
|
|
571
571
|
}
|
|
572
|
-
typeof
|
|
572
|
+
typeof v.getDefaultProps == "function" && !v.getDefaultProps.isReactClassApproved && g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
function ft(n) {
|
|
576
576
|
{
|
|
577
|
-
for (var
|
|
578
|
-
var
|
|
579
|
-
if (
|
|
580
|
-
ze(n), g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",
|
|
577
|
+
for (var v = Object.keys(n.props), O = 0; O < v.length; O++) {
|
|
578
|
+
var M = v[O];
|
|
579
|
+
if (M !== "children" && M !== "key") {
|
|
580
|
+
ze(n), g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", M), ze(null);
|
|
581
581
|
break;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
@@ -585,24 +585,24 @@ Check the top-level render call using <` + P + ">.");
|
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
var Ot = {};
|
|
588
|
-
function Yt(n,
|
|
588
|
+
function Yt(n, v, O, M, K, H) {
|
|
589
589
|
{
|
|
590
|
-
var W =
|
|
590
|
+
var W = w(n);
|
|
591
591
|
if (!W) {
|
|
592
592
|
var U = "";
|
|
593
593
|
(n === void 0 || typeof n == "object" && n !== null && Object.keys(n).length === 0) && (U += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
594
594
|
var le = zt();
|
|
595
595
|
le ? U += le : U += He();
|
|
596
596
|
var ee;
|
|
597
|
-
n === null ? ee = "null" : at(n) ? ee = "array" : n !== void 0 && n.$$typeof === e ? (ee = "<" + (
|
|
597
|
+
n === null ? ee = "null" : at(n) ? ee = "array" : n !== void 0 && n.$$typeof === e ? (ee = "<" + (A(n.type) || "Unknown") + " />", U = " Did you accidentally export a JSX literal instead of a component?") : ee = typeof n, g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ee, U);
|
|
598
598
|
}
|
|
599
|
-
var re = _e(n,
|
|
599
|
+
var re = _e(n, v, O, K, H);
|
|
600
600
|
if (re == null)
|
|
601
601
|
return re;
|
|
602
602
|
if (W) {
|
|
603
|
-
var ve =
|
|
603
|
+
var ve = v.children;
|
|
604
604
|
if (ve !== void 0)
|
|
605
|
-
if (
|
|
605
|
+
if (M)
|
|
606
606
|
if (at(ve)) {
|
|
607
607
|
for (var Pt = 0; Pt < ve.length; Pt++)
|
|
608
608
|
Ht(ve[Pt], n);
|
|
@@ -612,12 +612,12 @@ Check the top-level render call using <` + P + ">.");
|
|
|
612
612
|
else
|
|
613
613
|
Ht(ve, n);
|
|
614
614
|
}
|
|
615
|
-
if (Qe.call(
|
|
616
|
-
var pt =
|
|
615
|
+
if (Qe.call(v, "key")) {
|
|
616
|
+
var pt = A(n), fe = Object.keys(v).filter(function(Bs) {
|
|
617
617
|
return Bs !== "key";
|
|
618
|
-
}), Sr =
|
|
618
|
+
}), Sr = fe.length > 0 ? "{key: someKey, " + fe.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
619
619
|
if (!Ot[pt + Sr]) {
|
|
620
|
-
var Ds =
|
|
620
|
+
var Ds = fe.length > 0 ? "{" + fe.join(": ..., ") + ": ...}" : "{}";
|
|
621
621
|
g(`A props object containing a "key" prop is being spread into JSX:
|
|
622
622
|
let props = %s;
|
|
623
623
|
<%s {...props} />
|
|
@@ -629,18 +629,18 @@ React keys must be passed directly to JSX without using spread:
|
|
|
629
629
|
return n === s ? ft(re) : Gt(re), re;
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
|
-
function Er(n,
|
|
633
|
-
return Yt(n,
|
|
632
|
+
function Er(n, v, O) {
|
|
633
|
+
return Yt(n, v, O, !0);
|
|
634
634
|
}
|
|
635
|
-
function Ms(n,
|
|
636
|
-
return Yt(n,
|
|
635
|
+
function Ms(n, v, O) {
|
|
636
|
+
return Yt(n, v, O, !1);
|
|
637
637
|
}
|
|
638
638
|
var As = Ms, Ls = Er;
|
|
639
639
|
Xt.Fragment = s, Xt.jsx = As, Xt.jsxs = Ls;
|
|
640
640
|
}()), Xt;
|
|
641
641
|
}
|
|
642
|
-
process.env.NODE_ENV === "production" ?
|
|
643
|
-
var o =
|
|
642
|
+
process.env.NODE_ENV === "production" ? Tr.exports = Qs() : Tr.exports = Ws();
|
|
643
|
+
var o = Tr.exports, lr = class {
|
|
644
644
|
constructor() {
|
|
645
645
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
646
646
|
}
|
|
@@ -679,23 +679,23 @@ var o = jr.exports, lr = class {
|
|
|
679
679
|
//
|
|
680
680
|
// We settle for type safety for the TimeoutProvider type, and accept that
|
|
681
681
|
// this class is unsafe internally to allow for extension.
|
|
682
|
-
|
|
683
|
-
|
|
682
|
+
N(this, Fe, Ks);
|
|
683
|
+
N(this, gt, !1);
|
|
684
684
|
}
|
|
685
685
|
setTimeoutProvider(t) {
|
|
686
686
|
process.env.NODE_ENV !== "production" && i(this, gt) && t !== i(this, Fe) && console.error(
|
|
687
687
|
"[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",
|
|
688
688
|
{ previous: i(this, Fe), provider: t }
|
|
689
|
-
),
|
|
689
|
+
), _(this, Fe, t), process.env.NODE_ENV !== "production" && _(this, gt, !1);
|
|
690
690
|
}
|
|
691
691
|
setTimeout(t, e) {
|
|
692
|
-
return process.env.NODE_ENV !== "production" &&
|
|
692
|
+
return process.env.NODE_ENV !== "production" && _(this, gt, !0), i(this, Fe).setTimeout(t, e);
|
|
693
693
|
}
|
|
694
694
|
clearTimeout(t) {
|
|
695
695
|
i(this, Fe).clearTimeout(t);
|
|
696
696
|
}
|
|
697
697
|
setInterval(t, e) {
|
|
698
|
-
return process.env.NODE_ENV !== "production" &&
|
|
698
|
+
return process.env.NODE_ENV !== "production" && _(this, gt, !0), i(this, Fe).setInterval(t, e);
|
|
699
699
|
}
|
|
700
700
|
clearInterval(t) {
|
|
701
701
|
i(this, Fe).clearInterval(t);
|
|
@@ -704,8 +704,8 @@ var o = jr.exports, lr = class {
|
|
|
704
704
|
function zs(t) {
|
|
705
705
|
setTimeout(t, 0);
|
|
706
706
|
}
|
|
707
|
-
var
|
|
708
|
-
function
|
|
707
|
+
var Tt = typeof window > "u" || "Deno" in globalThis;
|
|
708
|
+
function me() {
|
|
709
709
|
}
|
|
710
710
|
function Hs(t, e) {
|
|
711
711
|
return typeof t == "function" ? t(e) : t;
|
|
@@ -788,8 +788,8 @@ function _r(t, e) {
|
|
|
788
788
|
f[p] = m;
|
|
789
789
|
continue;
|
|
790
790
|
}
|
|
791
|
-
const
|
|
792
|
-
f[p] =
|
|
791
|
+
const S = _r(d, m);
|
|
792
|
+
f[p] = S, S === d && u++;
|
|
793
793
|
}
|
|
794
794
|
return a === l && u === a ? t : f;
|
|
795
795
|
}
|
|
@@ -864,11 +864,11 @@ function en(t, e, r) {
|
|
|
864
864
|
var bt, Ye, It, us, tn = (us = class extends lr {
|
|
865
865
|
constructor() {
|
|
866
866
|
super();
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
if (!
|
|
867
|
+
N(this, bt);
|
|
868
|
+
N(this, Ye);
|
|
869
|
+
N(this, It);
|
|
870
|
+
_(this, It, (e) => {
|
|
871
|
+
if (!Tt && window.addEventListener) {
|
|
872
872
|
const r = () => e();
|
|
873
873
|
return window.addEventListener("visibilitychange", r, !1), () => {
|
|
874
874
|
window.removeEventListener("visibilitychange", r);
|
|
@@ -881,16 +881,16 @@ var bt, Ye, It, us, tn = (us = class extends lr {
|
|
|
881
881
|
}
|
|
882
882
|
onUnsubscribe() {
|
|
883
883
|
var e;
|
|
884
|
-
this.hasListeners() || ((e = i(this, Ye)) == null || e.call(this),
|
|
884
|
+
this.hasListeners() || ((e = i(this, Ye)) == null || e.call(this), _(this, Ye, void 0));
|
|
885
885
|
}
|
|
886
886
|
setEventListener(e) {
|
|
887
887
|
var r;
|
|
888
|
-
|
|
888
|
+
_(this, It, e), (r = i(this, Ye)) == null || r.call(this), _(this, Ye, e((s) => {
|
|
889
889
|
typeof s == "boolean" ? this.setFocused(s) : this.onFocus();
|
|
890
890
|
}));
|
|
891
891
|
}
|
|
892
892
|
setFocused(e) {
|
|
893
|
-
i(this, bt) !== e && (
|
|
893
|
+
i(this, bt) !== e && (_(this, bt, e), this.onFocus());
|
|
894
894
|
}
|
|
895
895
|
onFocus() {
|
|
896
896
|
const e = this.isFocused();
|
|
@@ -985,14 +985,14 @@ function sn() {
|
|
|
985
985
|
}
|
|
986
986
|
};
|
|
987
987
|
}
|
|
988
|
-
var
|
|
988
|
+
var ce = sn(), Nt, Je, Ft, ds, nn = (ds = class extends lr {
|
|
989
989
|
constructor() {
|
|
990
990
|
super();
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
if (!
|
|
991
|
+
N(this, Nt, !0);
|
|
992
|
+
N(this, Je);
|
|
993
|
+
N(this, Ft);
|
|
994
|
+
_(this, Ft, (e) => {
|
|
995
|
+
if (!Tt && window.addEventListener) {
|
|
996
996
|
const r = () => e(!0), s = () => e(!1);
|
|
997
997
|
return window.addEventListener("online", r, !1), window.addEventListener("offline", s, !1), () => {
|
|
998
998
|
window.removeEventListener("online", r), window.removeEventListener("offline", s);
|
|
@@ -1005,14 +1005,14 @@ var oe = sn(), Nt, Je, Ft, ds, nn = (ds = class extends lr {
|
|
|
1005
1005
|
}
|
|
1006
1006
|
onUnsubscribe() {
|
|
1007
1007
|
var e;
|
|
1008
|
-
this.hasListeners() || ((e = i(this, Je)) == null || e.call(this),
|
|
1008
|
+
this.hasListeners() || ((e = i(this, Je)) == null || e.call(this), _(this, Je, void 0));
|
|
1009
1009
|
}
|
|
1010
1010
|
setEventListener(e) {
|
|
1011
1011
|
var r;
|
|
1012
|
-
|
|
1012
|
+
_(this, Ft, e), (r = i(this, Je)) == null || r.call(this), _(this, Je, e(this.setOnline.bind(this)));
|
|
1013
1013
|
}
|
|
1014
1014
|
setOnline(e) {
|
|
1015
|
-
i(this, Nt) !== e && (
|
|
1015
|
+
i(this, Nt) !== e && (_(this, Nt, e), this.listeners.forEach((s) => {
|
|
1016
1016
|
s(e);
|
|
1017
1017
|
}));
|
|
1018
1018
|
}
|
|
@@ -1033,49 +1033,49 @@ var Nr = class extends Error {
|
|
|
1033
1033
|
};
|
|
1034
1034
|
function Cs(t) {
|
|
1035
1035
|
let e = !1, r = 0, s;
|
|
1036
|
-
const a = Ir(), c = () => a.status !== "pending", l = (
|
|
1037
|
-
var
|
|
1036
|
+
const a = Ir(), c = () => a.status !== "pending", l = (T) => {
|
|
1037
|
+
var j;
|
|
1038
1038
|
if (!c()) {
|
|
1039
|
-
const R = new Nr(
|
|
1040
|
-
m(R), (
|
|
1039
|
+
const R = new Nr(T);
|
|
1040
|
+
m(R), (j = t.onCancel) == null || j.call(t, R);
|
|
1041
1041
|
}
|
|
1042
1042
|
}, f = () => {
|
|
1043
1043
|
e = !0;
|
|
1044
1044
|
}, u = () => {
|
|
1045
1045
|
e = !1;
|
|
1046
|
-
}, x = () => Qr.isFocused() && (t.networkMode === "always" || vr.isOnline()) && t.canRun(), p = () => ws(t.networkMode) && t.canRun(), d = (
|
|
1047
|
-
c() || (s == null || s(), a.resolve(
|
|
1048
|
-
}, m = (
|
|
1049
|
-
c() || (s == null || s(), a.reject(
|
|
1050
|
-
},
|
|
1051
|
-
var
|
|
1046
|
+
}, x = () => Qr.isFocused() && (t.networkMode === "always" || vr.isOnline()) && t.canRun(), p = () => ws(t.networkMode) && t.canRun(), d = (T) => {
|
|
1047
|
+
c() || (s == null || s(), a.resolve(T));
|
|
1048
|
+
}, m = (T) => {
|
|
1049
|
+
c() || (s == null || s(), a.reject(T));
|
|
1050
|
+
}, S = () => new Promise((T) => {
|
|
1051
|
+
var j;
|
|
1052
1052
|
s = (R) => {
|
|
1053
|
-
(c() || x()) &&
|
|
1054
|
-
}, (
|
|
1053
|
+
(c() || x()) && T(R);
|
|
1054
|
+
}, (j = t.onPause) == null || j.call(t);
|
|
1055
1055
|
}).then(() => {
|
|
1056
|
-
var
|
|
1057
|
-
s = void 0, c() || (
|
|
1058
|
-
}),
|
|
1056
|
+
var T;
|
|
1057
|
+
s = void 0, c() || (T = t.onContinue) == null || T.call(t);
|
|
1058
|
+
}), P = () => {
|
|
1059
1059
|
if (c())
|
|
1060
1060
|
return;
|
|
1061
|
-
let
|
|
1062
|
-
const
|
|
1061
|
+
let T;
|
|
1062
|
+
const j = r === 0 ? t.initialPromise : void 0;
|
|
1063
1063
|
try {
|
|
1064
|
-
|
|
1064
|
+
T = j ?? t.fn();
|
|
1065
1065
|
} catch (R) {
|
|
1066
|
-
|
|
1066
|
+
T = Promise.reject(R);
|
|
1067
1067
|
}
|
|
1068
|
-
Promise.resolve(
|
|
1069
|
-
var
|
|
1068
|
+
Promise.resolve(T).then(d).catch((R) => {
|
|
1069
|
+
var y;
|
|
1070
1070
|
if (c())
|
|
1071
1071
|
return;
|
|
1072
|
-
const g = t.retry ?? (
|
|
1072
|
+
const g = t.retry ?? (Tt ? 0 : 3), E = t.retryDelay ?? an, h = typeof E == "function" ? E(r, R) : E, b = g === !0 || typeof g == "number" && r < g || typeof g == "function" && g(r, R);
|
|
1073
1073
|
if (e || !b) {
|
|
1074
1074
|
m(R);
|
|
1075
1075
|
return;
|
|
1076
1076
|
}
|
|
1077
|
-
r++, (
|
|
1078
|
-
e ? m(R) :
|
|
1077
|
+
r++, (y = t.onFail) == null || y.call(t, r, R), Ys(h).then(() => x() ? void 0 : S()).then(() => {
|
|
1078
|
+
e ? m(R) : P();
|
|
1079
1079
|
});
|
|
1080
1080
|
});
|
|
1081
1081
|
};
|
|
@@ -1087,56 +1087,56 @@ function Cs(t) {
|
|
|
1087
1087
|
cancelRetry: f,
|
|
1088
1088
|
continueRetry: u,
|
|
1089
1089
|
canStart: p,
|
|
1090
|
-
start: () => (p() ?
|
|
1090
|
+
start: () => (p() ? P() : S().then(P), a)
|
|
1091
1091
|
};
|
|
1092
1092
|
}
|
|
1093
1093
|
var yt, hs, Es = (hs = class {
|
|
1094
1094
|
constructor() {
|
|
1095
|
-
|
|
1095
|
+
N(this, yt);
|
|
1096
1096
|
}
|
|
1097
1097
|
destroy() {
|
|
1098
1098
|
this.clearGcTimeout();
|
|
1099
1099
|
}
|
|
1100
1100
|
scheduleGc() {
|
|
1101
|
-
this.clearGcTimeout(), Rr(this.gcTime) &&
|
|
1101
|
+
this.clearGcTimeout(), Rr(this.gcTime) && _(this, yt, mt.setTimeout(() => {
|
|
1102
1102
|
this.optionalRemove();
|
|
1103
1103
|
}, this.gcTime));
|
|
1104
1104
|
}
|
|
1105
1105
|
updateGcTime(t) {
|
|
1106
1106
|
this.gcTime = Math.max(
|
|
1107
1107
|
this.gcTime || 0,
|
|
1108
|
-
t ?? (
|
|
1108
|
+
t ?? (Tt ? 1 / 0 : 5 * 60 * 1e3)
|
|
1109
1109
|
);
|
|
1110
1110
|
}
|
|
1111
1111
|
clearGcTimeout() {
|
|
1112
|
-
i(this, yt) && (mt.clearTimeout(i(this, yt)),
|
|
1112
|
+
i(this, yt) && (mt.clearTimeout(i(this, yt)), _(this, yt, void 0));
|
|
1113
1113
|
}
|
|
1114
|
-
}, yt = new WeakMap(), hs), vt, Mt, xe, xt,
|
|
1114
|
+
}, yt = new WeakMap(), hs), vt, Mt, xe, xt, ae, nr, wt, Oe, Be, fs, on = (fs = class extends Es {
|
|
1115
1115
|
constructor(e) {
|
|
1116
1116
|
super();
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1117
|
+
N(this, Oe);
|
|
1118
|
+
N(this, vt);
|
|
1119
|
+
N(this, Mt);
|
|
1120
|
+
N(this, xe);
|
|
1121
|
+
N(this, xt);
|
|
1122
|
+
N(this, ae);
|
|
1123
|
+
N(this, nr);
|
|
1124
|
+
N(this, wt);
|
|
1125
|
+
_(this, wt, !1), _(this, nr, e.defaultOptions), this.setOptions(e.options), this.observers = [], _(this, xt, e.client), _(this, xe, i(this, xt).getQueryCache()), this.queryKey = e.queryKey, this.queryHash = e.queryHash, _(this, vt, es(this.options)), this.state = e.state ?? i(this, vt), this.scheduleGc();
|
|
1126
1126
|
}
|
|
1127
1127
|
get meta() {
|
|
1128
1128
|
return this.options.meta;
|
|
1129
1129
|
}
|
|
1130
1130
|
get promise() {
|
|
1131
1131
|
var e;
|
|
1132
|
-
return (e = i(this,
|
|
1132
|
+
return (e = i(this, ae)) == null ? void 0 : e.promise;
|
|
1133
1133
|
}
|
|
1134
1134
|
setOptions(e) {
|
|
1135
1135
|
if (this.options = { ...i(this, nr), ...e }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
|
|
1136
1136
|
const r = es(this.options);
|
|
1137
1137
|
r.data !== void 0 && (this.setState(
|
|
1138
1138
|
Zr(r.data, r.dataUpdatedAt)
|
|
1139
|
-
),
|
|
1139
|
+
), _(this, vt, r));
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
1142
|
optionalRemove() {
|
|
@@ -1156,8 +1156,8 @@ var yt, hs, Es = (hs = class {
|
|
|
1156
1156
|
}
|
|
1157
1157
|
cancel(e) {
|
|
1158
1158
|
var s, a;
|
|
1159
|
-
const r = (s = i(this,
|
|
1160
|
-
return (a = i(this,
|
|
1159
|
+
const r = (s = i(this, ae)) == null ? void 0 : s.promise;
|
|
1160
|
+
return (a = i(this, ae)) == null || a.cancel(e), r ? r.then(me).catch(me) : Promise.resolve();
|
|
1161
1161
|
}
|
|
1162
1162
|
destroy() {
|
|
1163
1163
|
super.destroy(), this.cancel({ silent: !0 });
|
|
@@ -1189,18 +1189,18 @@ var yt, hs, Es = (hs = class {
|
|
|
1189
1189
|
onFocus() {
|
|
1190
1190
|
var r;
|
|
1191
1191
|
const e = this.observers.find((s) => s.shouldFetchOnWindowFocus());
|
|
1192
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (r = i(this,
|
|
1192
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (r = i(this, ae)) == null || r.continue();
|
|
1193
1193
|
}
|
|
1194
1194
|
onOnline() {
|
|
1195
1195
|
var r;
|
|
1196
1196
|
const e = this.observers.find((s) => s.shouldFetchOnReconnect());
|
|
1197
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (r = i(this,
|
|
1197
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (r = i(this, ae)) == null || r.continue();
|
|
1198
1198
|
}
|
|
1199
1199
|
addObserver(e) {
|
|
1200
1200
|
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), i(this, xe).notify({ type: "observerAdded", query: this, observer: e }));
|
|
1201
1201
|
}
|
|
1202
1202
|
removeObserver(e) {
|
|
1203
|
-
this.observers.includes(e) && (this.observers = this.observers.filter((r) => r !== e), this.observers.length || (i(this,
|
|
1203
|
+
this.observers.includes(e) && (this.observers = this.observers.filter((r) => r !== e), this.observers.length || (i(this, ae) && (i(this, wt) ? i(this, ae).cancel({ revert: !0 }) : i(this, ae).cancelRetry()), this.scheduleGc()), i(this, xe).notify({ type: "observerRemoved", query: this, observer: e }));
|
|
1204
1204
|
}
|
|
1205
1205
|
getObserversCount() {
|
|
1206
1206
|
return this.observers.length;
|
|
@@ -1209,15 +1209,15 @@ var yt, hs, Es = (hs = class {
|
|
|
1209
1209
|
this.state.isInvalidated || $(this, Oe, Be).call(this, { type: "invalidate" });
|
|
1210
1210
|
}
|
|
1211
1211
|
async fetch(e, r) {
|
|
1212
|
-
var u, x, p, d, m,
|
|
1212
|
+
var u, x, p, d, m, S, P, T, j, R, g, E;
|
|
1213
1213
|
if (this.state.fetchStatus !== "idle" && // If the promise in the retyer is already rejected, we have to definitely
|
|
1214
1214
|
// re-start the fetch; there is a chance that the query is still in a
|
|
1215
1215
|
// pending state when that happens
|
|
1216
|
-
((u = i(this,
|
|
1216
|
+
((u = i(this, ae)) == null ? void 0 : u.status()) !== "rejected") {
|
|
1217
1217
|
if (this.state.data !== void 0 && (r != null && r.cancelRefetch))
|
|
1218
1218
|
this.cancel({ silent: !0 });
|
|
1219
|
-
else if (i(this,
|
|
1220
|
-
return i(this,
|
|
1219
|
+
else if (i(this, ae))
|
|
1220
|
+
return i(this, ae).continueRetry(), i(this, ae).promise;
|
|
1221
1221
|
}
|
|
1222
1222
|
if (e && this.setOptions(e), !this.options.queryFn) {
|
|
1223
1223
|
const h = this.observers.find((b) => b.options.queryFn);
|
|
@@ -1229,22 +1229,22 @@ var yt, hs, Es = (hs = class {
|
|
|
1229
1229
|
const s = new AbortController(), a = (h) => {
|
|
1230
1230
|
Object.defineProperty(h, "signal", {
|
|
1231
1231
|
enumerable: !0,
|
|
1232
|
-
get: () => (
|
|
1232
|
+
get: () => (_(this, wt, !0), s.signal)
|
|
1233
1233
|
});
|
|
1234
1234
|
}, c = () => {
|
|
1235
|
-
const h = xs(this.options, r),
|
|
1236
|
-
const
|
|
1235
|
+
const h = xs(this.options, r), y = (() => {
|
|
1236
|
+
const I = {
|
|
1237
1237
|
client: i(this, xt),
|
|
1238
1238
|
queryKey: this.queryKey,
|
|
1239
1239
|
meta: this.meta
|
|
1240
1240
|
};
|
|
1241
|
-
return a(
|
|
1241
|
+
return a(I), I;
|
|
1242
1242
|
})();
|
|
1243
|
-
return
|
|
1243
|
+
return _(this, wt, !1), this.options.persister ? this.options.persister(
|
|
1244
1244
|
h,
|
|
1245
|
-
|
|
1245
|
+
y,
|
|
1246
1246
|
this
|
|
1247
|
-
) : h(
|
|
1247
|
+
) : h(y);
|
|
1248
1248
|
}, f = (() => {
|
|
1249
1249
|
const h = {
|
|
1250
1250
|
fetchOptions: r,
|
|
@@ -1256,7 +1256,7 @@ var yt, hs, Es = (hs = class {
|
|
|
1256
1256
|
};
|
|
1257
1257
|
return a(h), h;
|
|
1258
1258
|
})();
|
|
1259
|
-
(x = this.options.behavior) == null || x.onFetch(f, this),
|
|
1259
|
+
(x = this.options.behavior) == null || x.onFetch(f, this), _(this, Mt, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((p = f.fetchOptions) == null ? void 0 : p.meta)) && $(this, Oe, Be).call(this, { type: "fetch", meta: (d = f.fetchOptions) == null ? void 0 : d.meta }), _(this, ae, Cs({
|
|
1260
1260
|
initialPromise: r == null ? void 0 : r.initialPromise,
|
|
1261
1261
|
fn: f.fetchFn,
|
|
1262
1262
|
onCancel: (h) => {
|
|
@@ -1280,13 +1280,13 @@ var yt, hs, Es = (hs = class {
|
|
|
1280
1280
|
canRun: () => !0
|
|
1281
1281
|
}));
|
|
1282
1282
|
try {
|
|
1283
|
-
const h = await i(this,
|
|
1283
|
+
const h = await i(this, ae).start();
|
|
1284
1284
|
if (h === void 0)
|
|
1285
1285
|
throw process.env.NODE_ENV !== "production" && console.error(
|
|
1286
1286
|
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
|
|
1287
1287
|
), new Error(`${this.queryHash} data is undefined`);
|
|
1288
|
-
return this.setData(h), (
|
|
1289
|
-
|
|
1288
|
+
return this.setData(h), (S = (m = i(this, xe).config).onSuccess) == null || S.call(m, h, this), (T = (P = i(this, xe).config).onSettled) == null || T.call(
|
|
1289
|
+
P,
|
|
1290
1290
|
h,
|
|
1291
1291
|
this.state.error,
|
|
1292
1292
|
this
|
|
@@ -1294,7 +1294,7 @@ var yt, hs, Es = (hs = class {
|
|
|
1294
1294
|
} catch (h) {
|
|
1295
1295
|
if (h instanceof Nr) {
|
|
1296
1296
|
if (h.silent)
|
|
1297
|
-
return i(this,
|
|
1297
|
+
return i(this, ae).promise;
|
|
1298
1298
|
if (h.revert) {
|
|
1299
1299
|
if (this.state.data === void 0)
|
|
1300
1300
|
throw h;
|
|
@@ -1304,11 +1304,11 @@ var yt, hs, Es = (hs = class {
|
|
|
1304
1304
|
throw $(this, Oe, Be).call(this, {
|
|
1305
1305
|
type: "error",
|
|
1306
1306
|
error: h
|
|
1307
|
-
}), (R = (
|
|
1308
|
-
|
|
1307
|
+
}), (R = (j = i(this, xe).config).onError) == null || R.call(
|
|
1308
|
+
j,
|
|
1309
1309
|
h,
|
|
1310
1310
|
this
|
|
1311
|
-
), (
|
|
1311
|
+
), (E = (g = i(this, xe).config).onSettled) == null || E.call(
|
|
1312
1312
|
g,
|
|
1313
1313
|
this.state.data,
|
|
1314
1314
|
h,
|
|
@@ -1318,7 +1318,7 @@ var yt, hs, Es = (hs = class {
|
|
|
1318
1318
|
this.scheduleGc();
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
|
-
}, vt = new WeakMap(), Mt = new WeakMap(), xe = new WeakMap(), xt = new WeakMap(),
|
|
1321
|
+
}, vt = new WeakMap(), Mt = new WeakMap(), xe = new WeakMap(), xt = new WeakMap(), ae = new WeakMap(), nr = new WeakMap(), wt = new WeakMap(), Oe = new WeakSet(), Be = function(e) {
|
|
1322
1322
|
const r = (s) => {
|
|
1323
1323
|
switch (e.type) {
|
|
1324
1324
|
case "failed":
|
|
@@ -1354,7 +1354,7 @@ var yt, hs, Es = (hs = class {
|
|
|
1354
1354
|
fetchFailureReason: null
|
|
1355
1355
|
}
|
|
1356
1356
|
};
|
|
1357
|
-
return
|
|
1357
|
+
return _(this, Mt, e.manual ? a : void 0), a;
|
|
1358
1358
|
case "error":
|
|
1359
1359
|
const c = e.error;
|
|
1360
1360
|
return {
|
|
@@ -1379,7 +1379,7 @@ var yt, hs, Es = (hs = class {
|
|
|
1379
1379
|
};
|
|
1380
1380
|
}
|
|
1381
1381
|
};
|
|
1382
|
-
this.state = r(this.state),
|
|
1382
|
+
this.state = r(this.state), ce.batch(() => {
|
|
1383
1383
|
this.observers.forEach((s) => {
|
|
1384
1384
|
s.onQueryUpdate();
|
|
1385
1385
|
}), i(this, xe).notify({ query: this, type: "updated", action: e });
|
|
@@ -1422,28 +1422,28 @@ function es(t) {
|
|
|
1422
1422
|
fetchStatus: "idle"
|
|
1423
1423
|
};
|
|
1424
1424
|
}
|
|
1425
|
-
var
|
|
1425
|
+
var pe, Q, ir, ue, Ct, At, Ue, Xe, ar, Lt, Dt, Et, St, Ze, Bt, V, Zt, Fr, Mr, Ar, Lr, Dr, Br, Ur, js, ps, cn = (ps = class extends lr {
|
|
1426
1426
|
constructor(e, r) {
|
|
1427
1427
|
super();
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1428
|
+
N(this, V);
|
|
1429
|
+
N(this, pe);
|
|
1430
|
+
N(this, Q);
|
|
1431
|
+
N(this, ir);
|
|
1432
|
+
N(this, ue);
|
|
1433
|
+
N(this, Ct);
|
|
1434
|
+
N(this, At);
|
|
1435
|
+
N(this, Ue);
|
|
1436
|
+
N(this, Xe);
|
|
1437
|
+
N(this, ar);
|
|
1438
|
+
N(this, Lt);
|
|
1439
1439
|
// This property keeps track of the last query with defined data.
|
|
1440
1440
|
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
this.options = r,
|
|
1441
|
+
N(this, Dt);
|
|
1442
|
+
N(this, Et);
|
|
1443
|
+
N(this, St);
|
|
1444
|
+
N(this, Ze);
|
|
1445
|
+
N(this, Bt, /* @__PURE__ */ new Set());
|
|
1446
|
+
this.options = r, _(this, pe, e), _(this, Xe, null), _(this, Ue, Ir()), this.bindMethods(), this.setOptions(r);
|
|
1447
1447
|
}
|
|
1448
1448
|
bindMethods() {
|
|
1449
1449
|
this.refetch = this.refetch.bind(this);
|
|
@@ -1473,11 +1473,11 @@ var fe, Q, ir, ue, Ct, At, Ue, Xe, ar, Lt, Dt, Et, St, Ze, Bt, V, Zt, Fr, Mr, Ar
|
|
|
1473
1473
|
}
|
|
1474
1474
|
setOptions(e) {
|
|
1475
1475
|
const r = this.options, s = i(this, Q);
|
|
1476
|
-
if (this.options = i(this,
|
|
1476
|
+
if (this.options = i(this, pe).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof we(this.options.enabled, i(this, Q)) != "boolean")
|
|
1477
1477
|
throw new Error(
|
|
1478
1478
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
1479
1479
|
);
|
|
1480
|
-
$(this, V, Ur).call(this), i(this, Q).setOptions(this.options), r._defaulted && !kr(this.options, r) && i(this,
|
|
1480
|
+
$(this, V, Ur).call(this), i(this, Q).setOptions(this.options), r._defaulted && !kr(this.options, r) && i(this, pe).getQueryCache().notify({
|
|
1481
1481
|
type: "observerOptionsUpdated",
|
|
1482
1482
|
query: i(this, Q),
|
|
1483
1483
|
observer: this
|
|
@@ -1493,8 +1493,8 @@ var fe, Q, ir, ue, Ct, At, Ue, Xe, ar, Lt, Dt, Et, St, Ze, Bt, V, Zt, Fr, Mr, Ar
|
|
|
1493
1493
|
a && (i(this, Q) !== s || we(this.options.enabled, i(this, Q)) !== we(r.enabled, i(this, Q)) || c !== i(this, Ze)) && $(this, V, Ar).call(this, c);
|
|
1494
1494
|
}
|
|
1495
1495
|
getOptimisticResult(e) {
|
|
1496
|
-
const r = i(this,
|
|
1497
|
-
return un(this, s) && (
|
|
1496
|
+
const r = i(this, pe).getQueryCache().build(i(this, pe), e), s = this.createResult(r, e);
|
|
1497
|
+
return un(this, s) && (_(this, ue, s), _(this, At, this.options), _(this, Ct, i(this, Q).state)), s;
|
|
1498
1498
|
}
|
|
1499
1499
|
getCurrentResult() {
|
|
1500
1500
|
return i(this, ue);
|
|
@@ -1520,7 +1520,7 @@ var fe, Q, ir, ue, Ct, At, Ue, Xe, ar, Lt, Dt, Et, St, Ze, Bt, V, Zt, Fr, Mr, Ar
|
|
|
1520
1520
|
});
|
|
1521
1521
|
}
|
|
1522
1522
|
fetchOptimistic(e) {
|
|
1523
|
-
const r = i(this,
|
|
1523
|
+
const r = i(this, pe).defaultQueryOptions(e), s = i(this, pe).getQueryCache().build(i(this, pe), r);
|
|
1524
1524
|
return s.fetch().then(() => this.createResult(s, r));
|
|
1525
1525
|
}
|
|
1526
1526
|
fetch(e) {
|
|
@@ -1530,94 +1530,94 @@ var fe, Q, ir, ue, Ct, At, Ue, Xe, ar, Lt, Dt, Et, St, Ze, Bt, V, Zt, Fr, Mr, Ar
|
|
|
1530
1530
|
}).then(() => (this.updateResult(), i(this, ue)));
|
|
1531
1531
|
}
|
|
1532
1532
|
createResult(e, r) {
|
|
1533
|
-
var
|
|
1533
|
+
var F;
|
|
1534
1534
|
const s = i(this, Q), a = this.options, c = i(this, ue), l = i(this, Ct), f = i(this, At), x = e !== s ? e.state : i(this, ir), { state: p } = e;
|
|
1535
|
-
let d = { ...p }, m = !1,
|
|
1535
|
+
let d = { ...p }, m = !1, S;
|
|
1536
1536
|
if (r._optimisticResults) {
|
|
1537
|
-
const
|
|
1538
|
-
(
|
|
1537
|
+
const w = this.hasListeners(), C = !w && ts(e, r), D = w && rs(e, s, r, a);
|
|
1538
|
+
(C || D) && (d = {
|
|
1539
1539
|
...d,
|
|
1540
1540
|
...Ss(p.data, e.options)
|
|
1541
1541
|
}), r._optimisticResults === "isRestoring" && (d.fetchStatus = "idle");
|
|
1542
1542
|
}
|
|
1543
|
-
let { error:
|
|
1544
|
-
|
|
1543
|
+
let { error: P, errorUpdatedAt: T, status: j } = d;
|
|
1544
|
+
S = d.data;
|
|
1545
1545
|
let R = !1;
|
|
1546
|
-
if (r.placeholderData !== void 0 &&
|
|
1547
|
-
let
|
|
1548
|
-
c != null && c.isPlaceholderData && r.placeholderData === (f == null ? void 0 : f.placeholderData) ? (
|
|
1549
|
-
(
|
|
1546
|
+
if (r.placeholderData !== void 0 && S === void 0 && j === "pending") {
|
|
1547
|
+
let w;
|
|
1548
|
+
c != null && c.isPlaceholderData && r.placeholderData === (f == null ? void 0 : f.placeholderData) ? (w = c.data, R = !0) : w = typeof r.placeholderData == "function" ? r.placeholderData(
|
|
1549
|
+
(F = i(this, Dt)) == null ? void 0 : F.state.data,
|
|
1550
1550
|
i(this, Dt)
|
|
1551
|
-
) : r.placeholderData,
|
|
1551
|
+
) : r.placeholderData, w !== void 0 && (j = "success", S = Pr(
|
|
1552
1552
|
c == null ? void 0 : c.data,
|
|
1553
|
-
|
|
1553
|
+
w,
|
|
1554
1554
|
r
|
|
1555
1555
|
), m = !0);
|
|
1556
1556
|
}
|
|
1557
|
-
if (r.select &&
|
|
1558
|
-
if (c &&
|
|
1559
|
-
|
|
1557
|
+
if (r.select && S !== void 0 && !R)
|
|
1558
|
+
if (c && S === (l == null ? void 0 : l.data) && r.select === i(this, ar))
|
|
1559
|
+
S = i(this, Lt);
|
|
1560
1560
|
else
|
|
1561
1561
|
try {
|
|
1562
|
-
|
|
1563
|
-
} catch (
|
|
1564
|
-
|
|
1562
|
+
_(this, ar, r.select), S = r.select(S), S = Pr(c == null ? void 0 : c.data, S, r), _(this, Lt, S), _(this, Xe, null);
|
|
1563
|
+
} catch (w) {
|
|
1564
|
+
_(this, Xe, w);
|
|
1565
1565
|
}
|
|
1566
|
-
i(this, Xe) && (
|
|
1567
|
-
const g = d.fetchStatus === "fetching",
|
|
1568
|
-
status:
|
|
1566
|
+
i(this, Xe) && (P = i(this, Xe), S = i(this, Lt), T = Date.now(), j = "error");
|
|
1567
|
+
const g = d.fetchStatus === "fetching", E = j === "pending", h = j === "error", b = E && g, y = S !== void 0, k = {
|
|
1568
|
+
status: j,
|
|
1569
1569
|
fetchStatus: d.fetchStatus,
|
|
1570
|
-
isPending:
|
|
1571
|
-
isSuccess:
|
|
1570
|
+
isPending: E,
|
|
1571
|
+
isSuccess: j === "success",
|
|
1572
1572
|
isError: h,
|
|
1573
1573
|
isInitialLoading: b,
|
|
1574
1574
|
isLoading: b,
|
|
1575
|
-
data:
|
|
1575
|
+
data: S,
|
|
1576
1576
|
dataUpdatedAt: d.dataUpdatedAt,
|
|
1577
|
-
error:
|
|
1578
|
-
errorUpdatedAt:
|
|
1577
|
+
error: P,
|
|
1578
|
+
errorUpdatedAt: T,
|
|
1579
1579
|
failureCount: d.fetchFailureCount,
|
|
1580
1580
|
failureReason: d.fetchFailureReason,
|
|
1581
1581
|
errorUpdateCount: d.errorUpdateCount,
|
|
1582
1582
|
isFetched: d.dataUpdateCount > 0 || d.errorUpdateCount > 0,
|
|
1583
1583
|
isFetchedAfterMount: d.dataUpdateCount > x.dataUpdateCount || d.errorUpdateCount > x.errorUpdateCount,
|
|
1584
1584
|
isFetching: g,
|
|
1585
|
-
isRefetching: g && !
|
|
1586
|
-
isLoadingError: h && !
|
|
1585
|
+
isRefetching: g && !E,
|
|
1586
|
+
isLoadingError: h && !y,
|
|
1587
1587
|
isPaused: d.fetchStatus === "paused",
|
|
1588
1588
|
isPlaceholderData: m,
|
|
1589
|
-
isRefetchError: h &&
|
|
1589
|
+
isRefetchError: h && y,
|
|
1590
1590
|
isStale: Wr(e, r),
|
|
1591
1591
|
refetch: this.refetch,
|
|
1592
1592
|
promise: i(this, Ue),
|
|
1593
1593
|
isEnabled: we(r.enabled, e) !== !1
|
|
1594
1594
|
};
|
|
1595
1595
|
if (this.options.experimental_prefetchInRender) {
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1598
|
-
},
|
|
1599
|
-
const
|
|
1600
|
-
|
|
1601
|
-
},
|
|
1602
|
-
switch (
|
|
1596
|
+
const w = (A) => {
|
|
1597
|
+
k.status === "error" ? A.reject(k.error) : k.data !== void 0 && A.resolve(k.data);
|
|
1598
|
+
}, C = () => {
|
|
1599
|
+
const A = _(this, Ue, k.promise = Ir());
|
|
1600
|
+
w(A);
|
|
1601
|
+
}, D = i(this, Ue);
|
|
1602
|
+
switch (D.status) {
|
|
1603
1603
|
case "pending":
|
|
1604
|
-
e.queryHash === s.queryHash &&
|
|
1604
|
+
e.queryHash === s.queryHash && w(D);
|
|
1605
1605
|
break;
|
|
1606
1606
|
case "fulfilled":
|
|
1607
|
-
(
|
|
1607
|
+
(k.status === "error" || k.data !== D.value) && C();
|
|
1608
1608
|
break;
|
|
1609
1609
|
case "rejected":
|
|
1610
|
-
(
|
|
1610
|
+
(k.status !== "error" || k.error !== D.reason) && C();
|
|
1611
1611
|
break;
|
|
1612
1612
|
}
|
|
1613
1613
|
}
|
|
1614
|
-
return
|
|
1614
|
+
return k;
|
|
1615
1615
|
}
|
|
1616
1616
|
updateResult() {
|
|
1617
1617
|
const e = i(this, ue), r = this.createResult(i(this, Q), this.options);
|
|
1618
|
-
if (
|
|
1618
|
+
if (_(this, Ct, i(this, Q).state), _(this, At, this.options), i(this, Ct).data !== void 0 && _(this, Dt, i(this, Q)), kr(r, e))
|
|
1619
1619
|
return;
|
|
1620
|
-
|
|
1620
|
+
_(this, ue, r);
|
|
1621
1621
|
const s = () => {
|
|
1622
1622
|
if (!e)
|
|
1623
1623
|
return !0;
|
|
@@ -1632,53 +1632,53 @@ var fe, Q, ir, ue, Ct, At, Ue, Xe, ar, Lt, Dt, Et, St, Ze, Bt, V, Zt, Fr, Mr, Ar
|
|
|
1632
1632
|
return i(this, ue)[u] !== e[u] && l.has(u);
|
|
1633
1633
|
});
|
|
1634
1634
|
};
|
|
1635
|
-
$(this, V,
|
|
1635
|
+
$(this, V, js).call(this, { listeners: s() });
|
|
1636
1636
|
}
|
|
1637
1637
|
onQueryUpdate() {
|
|
1638
1638
|
this.updateResult(), this.hasListeners() && $(this, V, Lr).call(this);
|
|
1639
1639
|
}
|
|
1640
|
-
},
|
|
1640
|
+
}, pe = new WeakMap(), Q = new WeakMap(), ir = new WeakMap(), ue = new WeakMap(), Ct = new WeakMap(), At = new WeakMap(), Ue = new WeakMap(), Xe = new WeakMap(), ar = new WeakMap(), Lt = new WeakMap(), Dt = new WeakMap(), Et = new WeakMap(), St = new WeakMap(), Ze = new WeakMap(), Bt = new WeakMap(), V = new WeakSet(), Zt = function(e) {
|
|
1641
1641
|
$(this, V, Ur).call(this);
|
|
1642
1642
|
let r = i(this, Q).fetch(
|
|
1643
1643
|
this.options,
|
|
1644
1644
|
e
|
|
1645
1645
|
);
|
|
1646
|
-
return e != null && e.throwOnError || (r = r.catch(
|
|
1646
|
+
return e != null && e.throwOnError || (r = r.catch(me)), r;
|
|
1647
1647
|
}, Fr = function() {
|
|
1648
1648
|
$(this, V, Dr).call(this);
|
|
1649
1649
|
const e = st(
|
|
1650
1650
|
this.options.staleTime,
|
|
1651
1651
|
i(this, Q)
|
|
1652
1652
|
);
|
|
1653
|
-
if (
|
|
1653
|
+
if (Tt || i(this, ue).isStale || !Rr(e))
|
|
1654
1654
|
return;
|
|
1655
1655
|
const s = vs(i(this, ue).dataUpdatedAt, e) + 1;
|
|
1656
|
-
|
|
1656
|
+
_(this, Et, mt.setTimeout(() => {
|
|
1657
1657
|
i(this, ue).isStale || this.updateResult();
|
|
1658
1658
|
}, s));
|
|
1659
1659
|
}, Mr = function() {
|
|
1660
1660
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(i(this, Q)) : this.options.refetchInterval) ?? !1;
|
|
1661
1661
|
}, Ar = function(e) {
|
|
1662
|
-
$(this, V, Br).call(this),
|
|
1662
|
+
$(this, V, Br).call(this), _(this, Ze, e), !(Tt || we(this.options.enabled, i(this, Q)) === !1 || !Rr(i(this, Ze)) || i(this, Ze) === 0) && _(this, St, mt.setInterval(() => {
|
|
1663
1663
|
(this.options.refetchIntervalInBackground || Qr.isFocused()) && $(this, V, Zt).call(this);
|
|
1664
1664
|
}, i(this, Ze)));
|
|
1665
1665
|
}, Lr = function() {
|
|
1666
1666
|
$(this, V, Fr).call(this), $(this, V, Ar).call(this, $(this, V, Mr).call(this));
|
|
1667
1667
|
}, Dr = function() {
|
|
1668
|
-
i(this, Et) && (mt.clearTimeout(i(this, Et)),
|
|
1668
|
+
i(this, Et) && (mt.clearTimeout(i(this, Et)), _(this, Et, void 0));
|
|
1669
1669
|
}, Br = function() {
|
|
1670
|
-
i(this, St) && (mt.clearInterval(i(this, St)),
|
|
1670
|
+
i(this, St) && (mt.clearInterval(i(this, St)), _(this, St, void 0));
|
|
1671
1671
|
}, Ur = function() {
|
|
1672
|
-
const e = i(this,
|
|
1672
|
+
const e = i(this, pe).getQueryCache().build(i(this, pe), this.options);
|
|
1673
1673
|
if (e === i(this, Q))
|
|
1674
1674
|
return;
|
|
1675
1675
|
const r = i(this, Q);
|
|
1676
|
-
|
|
1677
|
-
},
|
|
1678
|
-
|
|
1676
|
+
_(this, Q, e), _(this, ir, e.state), this.hasListeners() && (r == null || r.removeObserver(this), e.addObserver(this));
|
|
1677
|
+
}, js = function(e) {
|
|
1678
|
+
ce.batch(() => {
|
|
1679
1679
|
e.listeners && this.listeners.forEach((r) => {
|
|
1680
1680
|
r(i(this, ue));
|
|
1681
|
-
}), i(this,
|
|
1681
|
+
}), i(this, pe).getQueryCache().notify({
|
|
1682
1682
|
query: i(this, Q),
|
|
1683
1683
|
type: "observerResultsUpdated"
|
|
1684
1684
|
});
|
|
@@ -1709,58 +1709,58 @@ function un(t, e) {
|
|
|
1709
1709
|
function ss(t) {
|
|
1710
1710
|
return {
|
|
1711
1711
|
onFetch: (e, r) => {
|
|
1712
|
-
var p, d, m,
|
|
1713
|
-
const s = e.options, a = (m = (d = (p = e.fetchOptions) == null ? void 0 : p.meta) == null ? void 0 : d.fetchMore) == null ? void 0 : m.direction, c = ((
|
|
1712
|
+
var p, d, m, S, P;
|
|
1713
|
+
const s = e.options, a = (m = (d = (p = e.fetchOptions) == null ? void 0 : p.meta) == null ? void 0 : d.fetchMore) == null ? void 0 : m.direction, c = ((S = e.state.data) == null ? void 0 : S.pages) || [], l = ((P = e.state.data) == null ? void 0 : P.pageParams) || [];
|
|
1714
1714
|
let f = { pages: [], pageParams: [] }, u = 0;
|
|
1715
1715
|
const x = async () => {
|
|
1716
|
-
let
|
|
1717
|
-
const
|
|
1716
|
+
let T = !1;
|
|
1717
|
+
const j = (E) => {
|
|
1718
1718
|
en(
|
|
1719
|
-
|
|
1719
|
+
E,
|
|
1720
1720
|
() => e.signal,
|
|
1721
|
-
() =>
|
|
1721
|
+
() => T = !0
|
|
1722
1722
|
);
|
|
1723
|
-
}, R = xs(e.options, e.fetchOptions), g = async (
|
|
1724
|
-
if (
|
|
1723
|
+
}, R = xs(e.options, e.fetchOptions), g = async (E, h, b) => {
|
|
1724
|
+
if (T)
|
|
1725
1725
|
return Promise.reject();
|
|
1726
|
-
if (h == null &&
|
|
1727
|
-
return Promise.resolve(
|
|
1728
|
-
const
|
|
1729
|
-
const
|
|
1726
|
+
if (h == null && E.pages.length)
|
|
1727
|
+
return Promise.resolve(E);
|
|
1728
|
+
const I = (() => {
|
|
1729
|
+
const C = {
|
|
1730
1730
|
client: e.client,
|
|
1731
1731
|
queryKey: e.queryKey,
|
|
1732
1732
|
pageParam: h,
|
|
1733
1733
|
direction: b ? "backward" : "forward",
|
|
1734
1734
|
meta: e.options.meta
|
|
1735
1735
|
};
|
|
1736
|
-
return
|
|
1737
|
-
})(),
|
|
1736
|
+
return j(C), C;
|
|
1737
|
+
})(), k = await R(I), { maxPages: F } = e.options, w = b ? Xs : Js;
|
|
1738
1738
|
return {
|
|
1739
|
-
pages: E
|
|
1740
|
-
pageParams: E
|
|
1739
|
+
pages: w(E.pages, k, F),
|
|
1740
|
+
pageParams: w(E.pageParams, h, F)
|
|
1741
1741
|
};
|
|
1742
1742
|
};
|
|
1743
1743
|
if (a && c.length) {
|
|
1744
|
-
const
|
|
1744
|
+
const E = a === "backward", h = E ? dn : ns, b = {
|
|
1745
1745
|
pages: c,
|
|
1746
1746
|
pageParams: l
|
|
1747
|
-
},
|
|
1748
|
-
f = await g(b,
|
|
1747
|
+
}, y = h(s, b);
|
|
1748
|
+
f = await g(b, y, E);
|
|
1749
1749
|
} else {
|
|
1750
|
-
const
|
|
1750
|
+
const E = t ?? c.length;
|
|
1751
1751
|
do {
|
|
1752
1752
|
const h = u === 0 ? l[0] ?? s.initialPageParam : ns(s, f);
|
|
1753
1753
|
if (u > 0 && h == null)
|
|
1754
1754
|
break;
|
|
1755
1755
|
f = await g(f, h), u++;
|
|
1756
|
-
} while (u <
|
|
1756
|
+
} while (u < E);
|
|
1757
1757
|
}
|
|
1758
1758
|
return f;
|
|
1759
1759
|
};
|
|
1760
1760
|
e.options.persister ? e.fetchFn = () => {
|
|
1761
|
-
var
|
|
1762
|
-
return (
|
|
1763
|
-
|
|
1761
|
+
var T, j;
|
|
1762
|
+
return (j = (T = e.options).persister) == null ? void 0 : j.call(
|
|
1763
|
+
T,
|
|
1764
1764
|
x,
|
|
1765
1765
|
{
|
|
1766
1766
|
client: e.client,
|
|
@@ -1787,15 +1787,15 @@ function dn(t, { pages: e, pageParams: r }) {
|
|
|
1787
1787
|
var s;
|
|
1788
1788
|
return e.length > 0 ? (s = t.getPreviousPageParam) == null ? void 0 : s.call(t, e[0], e, r[0], r) : void 0;
|
|
1789
1789
|
}
|
|
1790
|
-
var or, Me, de,
|
|
1790
|
+
var or, Me, de, jt, Ae, Ge, ms, hn = (ms = class extends Es {
|
|
1791
1791
|
constructor(e) {
|
|
1792
1792
|
super();
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1793
|
+
N(this, Ae);
|
|
1794
|
+
N(this, or);
|
|
1795
|
+
N(this, Me);
|
|
1796
|
+
N(this, de);
|
|
1797
|
+
N(this, jt);
|
|
1798
|
+
_(this, or, e.client), this.mutationId = e.mutationId, _(this, de, e.mutationCache), _(this, Me, []), this.state = e.state || fn(), this.setOptions(e.options), this.scheduleGc();
|
|
1799
1799
|
}
|
|
1800
1800
|
setOptions(e) {
|
|
1801
1801
|
this.options = e, this.updateGcTime(this.options.gcTime);
|
|
@@ -1811,7 +1811,7 @@ var or, Me, de, Tt, Ae, Ge, ms, hn = (ms = class extends Es {
|
|
|
1811
1811
|
}));
|
|
1812
1812
|
}
|
|
1813
1813
|
removeObserver(e) {
|
|
1814
|
-
|
|
1814
|
+
_(this, Me, i(this, Me).filter((r) => r !== e)), this.scheduleGc(), i(this, de).notify({
|
|
1815
1815
|
type: "observerRemoved",
|
|
1816
1816
|
mutation: this,
|
|
1817
1817
|
observer: e
|
|
@@ -1822,11 +1822,11 @@ var or, Me, de, Tt, Ae, Ge, ms, hn = (ms = class extends Es {
|
|
|
1822
1822
|
}
|
|
1823
1823
|
continue() {
|
|
1824
1824
|
var e;
|
|
1825
|
-
return ((e = i(this,
|
|
1825
|
+
return ((e = i(this, jt)) == null ? void 0 : e.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
|
|
1826
1826
|
this.execute(this.state.variables);
|
|
1827
1827
|
}
|
|
1828
1828
|
async execute(e) {
|
|
1829
|
-
var l, f, u, x, p, d, m,
|
|
1829
|
+
var l, f, u, x, p, d, m, S, P, T, j, R, g, E, h, b, y, I, k, F;
|
|
1830
1830
|
const r = () => {
|
|
1831
1831
|
$(this, Ae, Ge).call(this, { type: "continue" });
|
|
1832
1832
|
}, s = {
|
|
@@ -1834,10 +1834,10 @@ var or, Me, de, Tt, Ae, Ge, ms, hn = (ms = class extends Es {
|
|
|
1834
1834
|
meta: this.options.meta,
|
|
1835
1835
|
mutationKey: this.options.mutationKey
|
|
1836
1836
|
};
|
|
1837
|
-
|
|
1837
|
+
_(this, jt, Cs({
|
|
1838
1838
|
fn: () => this.options.mutationFn ? this.options.mutationFn(e, s) : Promise.reject(new Error("No mutationFn found")),
|
|
1839
|
-
onFail: (
|
|
1840
|
-
$(this, Ae, Ge).call(this, { type: "failed", failureCount:
|
|
1839
|
+
onFail: (w, C) => {
|
|
1840
|
+
$(this, Ae, Ge).call(this, { type: "failed", failureCount: w, error: C });
|
|
1841
1841
|
},
|
|
1842
1842
|
onPause: () => {
|
|
1843
1843
|
$(this, Ae, Ge).call(this, { type: "pause" });
|
|
@@ -1848,7 +1848,7 @@ var or, Me, de, Tt, Ae, Ge, ms, hn = (ms = class extends Es {
|
|
|
1848
1848
|
networkMode: this.options.networkMode,
|
|
1849
1849
|
canRun: () => i(this, de).canRun(this)
|
|
1850
1850
|
}));
|
|
1851
|
-
const a = this.state.status === "pending", c = !i(this,
|
|
1851
|
+
const a = this.state.status === "pending", c = !i(this, jt).canStart();
|
|
1852
1852
|
try {
|
|
1853
1853
|
if (a)
|
|
1854
1854
|
r();
|
|
@@ -1859,87 +1859,87 @@ var or, Me, de, Tt, Ae, Ge, ms, hn = (ms = class extends Es {
|
|
|
1859
1859
|
this,
|
|
1860
1860
|
s
|
|
1861
1861
|
));
|
|
1862
|
-
const
|
|
1862
|
+
const C = await ((x = (u = this.options).onMutate) == null ? void 0 : x.call(
|
|
1863
1863
|
u,
|
|
1864
1864
|
e,
|
|
1865
1865
|
s
|
|
1866
1866
|
));
|
|
1867
|
-
|
|
1867
|
+
C !== this.state.context && $(this, Ae, Ge).call(this, {
|
|
1868
1868
|
type: "pending",
|
|
1869
|
-
context:
|
|
1869
|
+
context: C,
|
|
1870
1870
|
variables: e,
|
|
1871
1871
|
isPaused: c
|
|
1872
1872
|
});
|
|
1873
1873
|
}
|
|
1874
|
-
const
|
|
1874
|
+
const w = await i(this, jt).start();
|
|
1875
1875
|
return await ((d = (p = i(this, de).config).onSuccess) == null ? void 0 : d.call(
|
|
1876
1876
|
p,
|
|
1877
|
-
|
|
1877
|
+
w,
|
|
1878
1878
|
e,
|
|
1879
1879
|
this.state.context,
|
|
1880
1880
|
this,
|
|
1881
1881
|
s
|
|
1882
|
-
)), await ((
|
|
1882
|
+
)), await ((S = (m = this.options).onSuccess) == null ? void 0 : S.call(
|
|
1883
1883
|
m,
|
|
1884
|
-
|
|
1884
|
+
w,
|
|
1885
1885
|
e,
|
|
1886
1886
|
this.state.context,
|
|
1887
1887
|
s
|
|
1888
|
-
)), await ((
|
|
1889
|
-
|
|
1890
|
-
|
|
1888
|
+
)), await ((T = (P = i(this, de).config).onSettled) == null ? void 0 : T.call(
|
|
1889
|
+
P,
|
|
1890
|
+
w,
|
|
1891
1891
|
null,
|
|
1892
1892
|
this.state.variables,
|
|
1893
1893
|
this.state.context,
|
|
1894
1894
|
this,
|
|
1895
1895
|
s
|
|
1896
|
-
)), await ((R = (
|
|
1897
|
-
|
|
1898
|
-
|
|
1896
|
+
)), await ((R = (j = this.options).onSettled) == null ? void 0 : R.call(
|
|
1897
|
+
j,
|
|
1898
|
+
w,
|
|
1899
1899
|
null,
|
|
1900
1900
|
e,
|
|
1901
1901
|
this.state.context,
|
|
1902
1902
|
s
|
|
1903
|
-
)), $(this, Ae, Ge).call(this, { type: "success", data:
|
|
1904
|
-
} catch (
|
|
1903
|
+
)), $(this, Ae, Ge).call(this, { type: "success", data: w }), w;
|
|
1904
|
+
} catch (w) {
|
|
1905
1905
|
try {
|
|
1906
|
-
throw await ((
|
|
1906
|
+
throw await ((E = (g = i(this, de).config).onError) == null ? void 0 : E.call(
|
|
1907
1907
|
g,
|
|
1908
|
-
|
|
1908
|
+
w,
|
|
1909
1909
|
e,
|
|
1910
1910
|
this.state.context,
|
|
1911
1911
|
this,
|
|
1912
1912
|
s
|
|
1913
1913
|
)), await ((b = (h = this.options).onError) == null ? void 0 : b.call(
|
|
1914
1914
|
h,
|
|
1915
|
-
|
|
1915
|
+
w,
|
|
1916
1916
|
e,
|
|
1917
1917
|
this.state.context,
|
|
1918
1918
|
s
|
|
1919
|
-
)), await ((
|
|
1920
|
-
|
|
1919
|
+
)), await ((I = (y = i(this, de).config).onSettled) == null ? void 0 : I.call(
|
|
1920
|
+
y,
|
|
1921
1921
|
void 0,
|
|
1922
|
-
|
|
1922
|
+
w,
|
|
1923
1923
|
this.state.variables,
|
|
1924
1924
|
this.state.context,
|
|
1925
1925
|
this,
|
|
1926
1926
|
s
|
|
1927
|
-
)), await ((
|
|
1928
|
-
|
|
1927
|
+
)), await ((F = (k = this.options).onSettled) == null ? void 0 : F.call(
|
|
1928
|
+
k,
|
|
1929
1929
|
void 0,
|
|
1930
|
-
|
|
1930
|
+
w,
|
|
1931
1931
|
e,
|
|
1932
1932
|
this.state.context,
|
|
1933
1933
|
s
|
|
1934
|
-
)),
|
|
1934
|
+
)), w;
|
|
1935
1935
|
} finally {
|
|
1936
|
-
$(this, Ae, Ge).call(this, { type: "error", error:
|
|
1936
|
+
$(this, Ae, Ge).call(this, { type: "error", error: w });
|
|
1937
1937
|
}
|
|
1938
1938
|
} finally {
|
|
1939
1939
|
i(this, de).runNext(this);
|
|
1940
1940
|
}
|
|
1941
1941
|
}
|
|
1942
|
-
}, or = new WeakMap(), Me = new WeakMap(), de = new WeakMap(),
|
|
1942
|
+
}, or = new WeakMap(), Me = new WeakMap(), de = new WeakMap(), jt = new WeakMap(), Ae = new WeakSet(), Ge = function(e) {
|
|
1943
1943
|
const r = (s) => {
|
|
1944
1944
|
switch (e.type) {
|
|
1945
1945
|
case "failed":
|
|
@@ -1993,7 +1993,7 @@ var or, Me, de, Tt, Ae, Ge, ms, hn = (ms = class extends Es {
|
|
|
1993
1993
|
};
|
|
1994
1994
|
}
|
|
1995
1995
|
};
|
|
1996
|
-
this.state = r(this.state),
|
|
1996
|
+
this.state = r(this.state), ce.batch(() => {
|
|
1997
1997
|
i(this, Me).forEach((s) => {
|
|
1998
1998
|
s.onMutationUpdate(e);
|
|
1999
1999
|
}), i(this, de).notify({
|
|
@@ -2019,10 +2019,10 @@ function fn() {
|
|
|
2019
2019
|
var qe, Pe, cr, gs, pn = (gs = class extends lr {
|
|
2020
2020
|
constructor(e = {}) {
|
|
2021
2021
|
super();
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
this.config = e,
|
|
2022
|
+
N(this, qe);
|
|
2023
|
+
N(this, Pe);
|
|
2024
|
+
N(this, cr);
|
|
2025
|
+
this.config = e, _(this, qe, /* @__PURE__ */ new Set()), _(this, Pe, /* @__PURE__ */ new Map()), _(this, cr, 0);
|
|
2026
2026
|
}
|
|
2027
2027
|
build(e, r, s) {
|
|
2028
2028
|
const a = new hn({
|
|
@@ -2077,7 +2077,7 @@ var qe, Pe, cr, gs, pn = (gs = class extends lr {
|
|
|
2077
2077
|
return Promise.resolve();
|
|
2078
2078
|
}
|
|
2079
2079
|
clear() {
|
|
2080
|
-
|
|
2080
|
+
ce.batch(() => {
|
|
2081
2081
|
i(this, qe).forEach((e) => {
|
|
2082
2082
|
this.notify({ type: "removed", mutation: e });
|
|
2083
2083
|
}), i(this, qe).clear(), i(this, Pe).clear();
|
|
@@ -2096,7 +2096,7 @@ var qe, Pe, cr, gs, pn = (gs = class extends lr {
|
|
|
2096
2096
|
return this.getAll().filter((r) => Yr(e, r));
|
|
2097
2097
|
}
|
|
2098
2098
|
notify(e) {
|
|
2099
|
-
|
|
2099
|
+
ce.batch(() => {
|
|
2100
2100
|
this.listeners.forEach((r) => {
|
|
2101
2101
|
r(e);
|
|
2102
2102
|
});
|
|
@@ -2104,9 +2104,9 @@ var qe, Pe, cr, gs, pn = (gs = class extends lr {
|
|
|
2104
2104
|
}
|
|
2105
2105
|
resumePausedMutations() {
|
|
2106
2106
|
const e = this.getAll().filter((r) => r.state.isPaused);
|
|
2107
|
-
return
|
|
2107
|
+
return ce.batch(
|
|
2108
2108
|
() => Promise.all(
|
|
2109
|
-
e.map((r) => r.continue().catch(
|
|
2109
|
+
e.map((r) => r.continue().catch(me))
|
|
2110
2110
|
)
|
|
2111
2111
|
);
|
|
2112
2112
|
}
|
|
@@ -2118,8 +2118,8 @@ function br(t) {
|
|
|
2118
2118
|
var Le, bs, mn = (bs = class extends lr {
|
|
2119
2119
|
constructor(e = {}) {
|
|
2120
2120
|
super();
|
|
2121
|
-
|
|
2122
|
-
this.config = e,
|
|
2121
|
+
N(this, Le);
|
|
2122
|
+
this.config = e, _(this, Le, /* @__PURE__ */ new Map());
|
|
2123
2123
|
}
|
|
2124
2124
|
build(e, r, s) {
|
|
2125
2125
|
const a = r.queryKey, c = r.queryHash ?? $r(a, r);
|
|
@@ -2144,7 +2144,7 @@ var Le, bs, mn = (bs = class extends lr {
|
|
|
2144
2144
|
r && (e.destroy(), r === e && i(this, Le).delete(e.queryHash), this.notify({ type: "removed", query: e }));
|
|
2145
2145
|
}
|
|
2146
2146
|
clear() {
|
|
2147
|
-
|
|
2147
|
+
ce.batch(() => {
|
|
2148
2148
|
this.getAll().forEach((e) => {
|
|
2149
2149
|
this.remove(e);
|
|
2150
2150
|
});
|
|
@@ -2167,51 +2167,51 @@ var Le, bs, mn = (bs = class extends lr {
|
|
|
2167
2167
|
return Object.keys(e).length > 0 ? r.filter((s) => Gr(e, s)) : r;
|
|
2168
2168
|
}
|
|
2169
2169
|
notify(e) {
|
|
2170
|
-
|
|
2170
|
+
ce.batch(() => {
|
|
2171
2171
|
this.listeners.forEach((r) => {
|
|
2172
2172
|
r(e);
|
|
2173
2173
|
});
|
|
2174
2174
|
});
|
|
2175
2175
|
}
|
|
2176
2176
|
onFocus() {
|
|
2177
|
-
|
|
2177
|
+
ce.batch(() => {
|
|
2178
2178
|
this.getAll().forEach((e) => {
|
|
2179
2179
|
e.onFocus();
|
|
2180
2180
|
});
|
|
2181
2181
|
});
|
|
2182
2182
|
}
|
|
2183
2183
|
onOnline() {
|
|
2184
|
-
|
|
2184
|
+
ce.batch(() => {
|
|
2185
2185
|
this.getAll().forEach((e) => {
|
|
2186
2186
|
e.onOnline();
|
|
2187
2187
|
});
|
|
2188
2188
|
});
|
|
2189
2189
|
}
|
|
2190
|
-
}, Le = new WeakMap(), bs),
|
|
2190
|
+
}, Le = new WeakMap(), bs), X, et, tt, Ut, qt, rt, $t, Qt, ys, gn = (ys = class {
|
|
2191
2191
|
constructor(t = {}) {
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2192
|
+
N(this, X);
|
|
2193
|
+
N(this, et);
|
|
2194
|
+
N(this, tt);
|
|
2195
|
+
N(this, Ut);
|
|
2196
|
+
N(this, qt);
|
|
2197
|
+
N(this, rt);
|
|
2198
|
+
N(this, $t);
|
|
2199
|
+
N(this, Qt);
|
|
2200
|
+
_(this, X, t.queryCache || new mn()), _(this, et, t.mutationCache || new pn()), _(this, tt, t.defaultOptions || {}), _(this, Ut, /* @__PURE__ */ new Map()), _(this, qt, /* @__PURE__ */ new Map()), _(this, rt, 0);
|
|
2201
2201
|
}
|
|
2202
2202
|
mount() {
|
|
2203
|
-
gr(this, rt)._++, i(this, rt) === 1 && (
|
|
2204
|
-
t && (await this.resumePausedMutations(), i(this,
|
|
2205
|
-
})),
|
|
2206
|
-
t && (await this.resumePausedMutations(), i(this,
|
|
2203
|
+
gr(this, rt)._++, i(this, rt) === 1 && (_(this, $t, Qr.subscribe(async (t) => {
|
|
2204
|
+
t && (await this.resumePausedMutations(), i(this, X).onFocus());
|
|
2205
|
+
})), _(this, Qt, vr.subscribe(async (t) => {
|
|
2206
|
+
t && (await this.resumePausedMutations(), i(this, X).onOnline());
|
|
2207
2207
|
})));
|
|
2208
2208
|
}
|
|
2209
2209
|
unmount() {
|
|
2210
2210
|
var t, e;
|
|
2211
|
-
gr(this, rt)._--, i(this, rt) === 0 && ((t = i(this, $t)) == null || t.call(this),
|
|
2211
|
+
gr(this, rt)._--, i(this, rt) === 0 && ((t = i(this, $t)) == null || t.call(this), _(this, $t, void 0), (e = i(this, Qt)) == null || e.call(this), _(this, Qt, void 0));
|
|
2212
2212
|
}
|
|
2213
2213
|
isFetching(t) {
|
|
2214
|
-
return i(this,
|
|
2214
|
+
return i(this, X).findAll({ ...t, fetchStatus: "fetching" }).length;
|
|
2215
2215
|
}
|
|
2216
2216
|
isMutating(t) {
|
|
2217
2217
|
return i(this, et).findAll({ ...t, status: "pending" }).length;
|
|
@@ -2226,28 +2226,28 @@ var Le, bs, mn = (bs = class extends lr {
|
|
|
2226
2226
|
getQueryData(t) {
|
|
2227
2227
|
var r;
|
|
2228
2228
|
const e = this.defaultQueryOptions({ queryKey: t });
|
|
2229
|
-
return (r = i(this,
|
|
2229
|
+
return (r = i(this, X).get(e.queryHash)) == null ? void 0 : r.state.data;
|
|
2230
2230
|
}
|
|
2231
2231
|
ensureQueryData(t) {
|
|
2232
|
-
const e = this.defaultQueryOptions(t), r = i(this,
|
|
2232
|
+
const e = this.defaultQueryOptions(t), r = i(this, X).build(this, e), s = r.state.data;
|
|
2233
2233
|
return s === void 0 ? this.fetchQuery(t) : (t.revalidateIfStale && r.isStaleByTime(st(e.staleTime, r)) && this.prefetchQuery(e), Promise.resolve(s));
|
|
2234
2234
|
}
|
|
2235
2235
|
getQueriesData(t) {
|
|
2236
|
-
return i(this,
|
|
2236
|
+
return i(this, X).findAll(t).map(({ queryKey: e, state: r }) => {
|
|
2237
2237
|
const s = r.data;
|
|
2238
2238
|
return [e, s];
|
|
2239
2239
|
});
|
|
2240
2240
|
}
|
|
2241
2241
|
setQueryData(t, e, r) {
|
|
2242
|
-
const s = this.defaultQueryOptions({ queryKey: t }), a = i(this,
|
|
2242
|
+
const s = this.defaultQueryOptions({ queryKey: t }), a = i(this, X).get(
|
|
2243
2243
|
s.queryHash
|
|
2244
2244
|
), c = a == null ? void 0 : a.state.data, l = Hs(e, c);
|
|
2245
2245
|
if (l !== void 0)
|
|
2246
|
-
return i(this,
|
|
2246
|
+
return i(this, X).build(this, s).setData(l, { ...r, manual: !0 });
|
|
2247
2247
|
}
|
|
2248
2248
|
setQueriesData(t, e, r) {
|
|
2249
|
-
return
|
|
2250
|
-
() => i(this,
|
|
2249
|
+
return ce.batch(
|
|
2250
|
+
() => i(this, X).findAll(t).map(({ queryKey: s }) => [
|
|
2251
2251
|
s,
|
|
2252
2252
|
this.setQueryData(s, e, r)
|
|
2253
2253
|
])
|
|
@@ -2256,21 +2256,21 @@ var Le, bs, mn = (bs = class extends lr {
|
|
|
2256
2256
|
getQueryState(t) {
|
|
2257
2257
|
var r;
|
|
2258
2258
|
const e = this.defaultQueryOptions({ queryKey: t });
|
|
2259
|
-
return (r = i(this,
|
|
2259
|
+
return (r = i(this, X).get(
|
|
2260
2260
|
e.queryHash
|
|
2261
2261
|
)) == null ? void 0 : r.state;
|
|
2262
2262
|
}
|
|
2263
2263
|
removeQueries(t) {
|
|
2264
|
-
const e = i(this,
|
|
2265
|
-
|
|
2264
|
+
const e = i(this, X);
|
|
2265
|
+
ce.batch(() => {
|
|
2266
2266
|
e.findAll(t).forEach((r) => {
|
|
2267
2267
|
e.remove(r);
|
|
2268
2268
|
});
|
|
2269
2269
|
});
|
|
2270
2270
|
}
|
|
2271
2271
|
resetQueries(t, e) {
|
|
2272
|
-
const r = i(this,
|
|
2273
|
-
return
|
|
2272
|
+
const r = i(this, X);
|
|
2273
|
+
return ce.batch(() => (r.findAll(t).forEach((s) => {
|
|
2274
2274
|
s.reset();
|
|
2275
2275
|
}), this.refetchQueries(
|
|
2276
2276
|
{
|
|
@@ -2281,13 +2281,13 @@ var Le, bs, mn = (bs = class extends lr {
|
|
|
2281
2281
|
)));
|
|
2282
2282
|
}
|
|
2283
2283
|
cancelQueries(t, e = {}) {
|
|
2284
|
-
const r = { revert: !0, ...e }, s =
|
|
2285
|
-
() => i(this,
|
|
2284
|
+
const r = { revert: !0, ...e }, s = ce.batch(
|
|
2285
|
+
() => i(this, X).findAll(t).map((a) => a.cancel(r))
|
|
2286
2286
|
);
|
|
2287
|
-
return Promise.all(s).then(
|
|
2287
|
+
return Promise.all(s).then(me).catch(me);
|
|
2288
2288
|
}
|
|
2289
2289
|
invalidateQueries(t, e = {}) {
|
|
2290
|
-
return
|
|
2290
|
+
return ce.batch(() => (i(this, X).findAll(t).forEach((r) => {
|
|
2291
2291
|
r.invalidate();
|
|
2292
2292
|
}), (t == null ? void 0 : t.refetchType) === "none" ? Promise.resolve() : this.refetchQueries(
|
|
2293
2293
|
{
|
|
@@ -2301,30 +2301,30 @@ var Le, bs, mn = (bs = class extends lr {
|
|
|
2301
2301
|
const r = {
|
|
2302
2302
|
...e,
|
|
2303
2303
|
cancelRefetch: e.cancelRefetch ?? !0
|
|
2304
|
-
}, s =
|
|
2305
|
-
() => i(this,
|
|
2304
|
+
}, s = ce.batch(
|
|
2305
|
+
() => i(this, X).findAll(t).filter((a) => !a.isDisabled() && !a.isStatic()).map((a) => {
|
|
2306
2306
|
let c = a.fetch(void 0, r);
|
|
2307
|
-
return r.throwOnError || (c = c.catch(
|
|
2307
|
+
return r.throwOnError || (c = c.catch(me)), a.state.fetchStatus === "paused" ? Promise.resolve() : c;
|
|
2308
2308
|
})
|
|
2309
2309
|
);
|
|
2310
|
-
return Promise.all(s).then(
|
|
2310
|
+
return Promise.all(s).then(me);
|
|
2311
2311
|
}
|
|
2312
2312
|
fetchQuery(t) {
|
|
2313
2313
|
const e = this.defaultQueryOptions(t);
|
|
2314
2314
|
e.retry === void 0 && (e.retry = !1);
|
|
2315
|
-
const r = i(this,
|
|
2315
|
+
const r = i(this, X).build(this, e);
|
|
2316
2316
|
return r.isStaleByTime(
|
|
2317
2317
|
st(e.staleTime, r)
|
|
2318
2318
|
) ? r.fetch(e) : Promise.resolve(r.state.data);
|
|
2319
2319
|
}
|
|
2320
2320
|
prefetchQuery(t) {
|
|
2321
|
-
return this.fetchQuery(t).then(
|
|
2321
|
+
return this.fetchQuery(t).then(me).catch(me);
|
|
2322
2322
|
}
|
|
2323
2323
|
fetchInfiniteQuery(t) {
|
|
2324
2324
|
return t.behavior = ss(t.pages), this.fetchQuery(t);
|
|
2325
2325
|
}
|
|
2326
2326
|
prefetchInfiniteQuery(t) {
|
|
2327
|
-
return this.fetchInfiniteQuery(t).then(
|
|
2327
|
+
return this.fetchInfiniteQuery(t).then(me).catch(me);
|
|
2328
2328
|
}
|
|
2329
2329
|
ensureInfiniteQueryData(t) {
|
|
2330
2330
|
return t.behavior = ss(t.pages), this.ensureQueryData(t);
|
|
@@ -2333,7 +2333,7 @@ var Le, bs, mn = (bs = class extends lr {
|
|
|
2333
2333
|
return vr.isOnline() ? i(this, et).resumePausedMutations() : Promise.resolve();
|
|
2334
2334
|
}
|
|
2335
2335
|
getQueryCache() {
|
|
2336
|
-
return i(this,
|
|
2336
|
+
return i(this, X);
|
|
2337
2337
|
}
|
|
2338
2338
|
getMutationCache() {
|
|
2339
2339
|
return i(this, et);
|
|
@@ -2342,7 +2342,7 @@ var Le, bs, mn = (bs = class extends lr {
|
|
|
2342
2342
|
return i(this, tt);
|
|
2343
2343
|
}
|
|
2344
2344
|
setDefaultOptions(t) {
|
|
2345
|
-
|
|
2345
|
+
_(this, tt, t);
|
|
2346
2346
|
}
|
|
2347
2347
|
setQueryDefaults(t, e) {
|
|
2348
2348
|
i(this, Ut).set(rr(t), {
|
|
@@ -2391,12 +2391,12 @@ var Le, bs, mn = (bs = class extends lr {
|
|
|
2391
2391
|
};
|
|
2392
2392
|
}
|
|
2393
2393
|
clear() {
|
|
2394
|
-
i(this,
|
|
2394
|
+
i(this, X).clear(), i(this, et).clear();
|
|
2395
2395
|
}
|
|
2396
|
-
},
|
|
2396
|
+
}, X = new WeakMap(), et = new WeakMap(), tt = new WeakMap(), Ut = new WeakMap(), qt = new WeakMap(), rt = new WeakMap(), $t = new WeakMap(), Qt = new WeakMap(), ys), Ts = Ce.createContext(
|
|
2397
2397
|
void 0
|
|
2398
2398
|
), Rs = (t) => {
|
|
2399
|
-
const e = Ce.useContext(
|
|
2399
|
+
const e = Ce.useContext(Ts);
|
|
2400
2400
|
if (!e)
|
|
2401
2401
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
2402
2402
|
return e;
|
|
@@ -2405,7 +2405,7 @@ var Le, bs, mn = (bs = class extends lr {
|
|
|
2405
2405
|
children: e
|
|
2406
2406
|
}) => (Ce.useEffect(() => (t.mount(), () => {
|
|
2407
2407
|
t.unmount();
|
|
2408
|
-
}), [t]), /* @__PURE__ */ o.jsx(
|
|
2408
|
+
}), [t]), /* @__PURE__ */ o.jsx(Ts.Provider, { value: t, children: e })), _s = Ce.createContext(!1), yn = () => Ce.useContext(_s);
|
|
2409
2409
|
_s.Provider;
|
|
2410
2410
|
function vn() {
|
|
2411
2411
|
let t = !1;
|
|
@@ -2431,7 +2431,7 @@ var xn = Ce.createContext(vn()), wn = () => Ce.useContext(xn), Cn = (t, e) => {
|
|
|
2431
2431
|
throwOnError: r,
|
|
2432
2432
|
query: s,
|
|
2433
2433
|
suspense: a
|
|
2434
|
-
}) => t.isError && !e.isReset() && !t.isFetching && s && (a && t.data === void 0 || Zs(r, [t.error, s])),
|
|
2434
|
+
}) => t.isError && !e.isReset() && !t.isFetching && s && (a && t.data === void 0 || Zs(r, [t.error, s])), jn = (t) => {
|
|
2435
2435
|
if (t.suspense) {
|
|
2436
2436
|
const r = (a) => a === "static" ? a : Math.max(a ?? 1e3, 1e3), s = t.staleTime;
|
|
2437
2437
|
t.staleTime = typeof s == "function" ? (...a) => r(s(...a)) : r(s), typeof t.gcTime == "number" && (t.gcTime = Math.max(
|
|
@@ -2439,11 +2439,11 @@ var xn = Ce.createContext(vn()), wn = () => Ce.useContext(xn), Cn = (t, e) => {
|
|
|
2439
2439
|
1e3
|
|
2440
2440
|
));
|
|
2441
2441
|
}
|
|
2442
|
-
},
|
|
2442
|
+
}, Tn = (t, e) => t.isLoading && t.isFetching && !e, Rn = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, is = (t, e, r) => e.fetchOptimistic(t).catch(() => {
|
|
2443
2443
|
r.clearReset();
|
|
2444
2444
|
});
|
|
2445
2445
|
function _n(t, e, r) {
|
|
2446
|
-
var d, m,
|
|
2446
|
+
var d, m, S, P, T;
|
|
2447
2447
|
if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
|
|
2448
2448
|
throw new Error(
|
|
2449
2449
|
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
@@ -2454,7 +2454,7 @@ function _n(t, e, r) {
|
|
|
2454
2454
|
l
|
|
2455
2455
|
), process.env.NODE_ENV !== "production" && (l.queryFn || console.error(
|
|
2456
2456
|
`[${l.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
|
|
2457
|
-
)), l._optimisticResults = s ? "isRestoring" : "optimistic",
|
|
2457
|
+
)), l._optimisticResults = s ? "isRestoring" : "optimistic", jn(l), Cn(l, a), En(a);
|
|
2458
2458
|
const f = !c.getQueryCache().get(l.queryHash), [u] = Ce.useState(
|
|
2459
2459
|
() => new e(
|
|
2460
2460
|
c,
|
|
@@ -2463,8 +2463,8 @@ function _n(t, e, r) {
|
|
|
2463
2463
|
), x = u.getOptimisticResult(l), p = !s && t.subscribed !== !1;
|
|
2464
2464
|
if (Ce.useSyncExternalStore(
|
|
2465
2465
|
Ce.useCallback(
|
|
2466
|
-
(
|
|
2467
|
-
const R = p ? u.subscribe(
|
|
2466
|
+
(j) => {
|
|
2467
|
+
const R = p ? u.subscribe(ce.batchCalls(j)) : me;
|
|
2468
2468
|
return u.updateResult(), R;
|
|
2469
2469
|
},
|
|
2470
2470
|
[u, p]
|
|
@@ -2483,19 +2483,19 @@ function _n(t, e, r) {
|
|
|
2483
2483
|
suspense: l.suspense
|
|
2484
2484
|
}))
|
|
2485
2485
|
throw x.error;
|
|
2486
|
-
if ((
|
|
2487
|
-
|
|
2486
|
+
if ((P = (S = c.getDefaultOptions().queries) == null ? void 0 : S._experimental_afterQuery) == null || P.call(
|
|
2487
|
+
S,
|
|
2488
2488
|
l,
|
|
2489
2489
|
x
|
|
2490
|
-
), l.experimental_prefetchInRender && !
|
|
2491
|
-
const
|
|
2490
|
+
), l.experimental_prefetchInRender && !Tt && Tn(x, s)) {
|
|
2491
|
+
const j = f ? (
|
|
2492
2492
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
2493
2493
|
is(l, u, a)
|
|
2494
2494
|
) : (
|
|
2495
2495
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
2496
|
-
(
|
|
2496
|
+
(T = c.getQueryCache().get(l.queryHash)) == null ? void 0 : T.promise
|
|
2497
2497
|
);
|
|
2498
|
-
|
|
2498
|
+
j == null || j.catch(me).finally(() => {
|
|
2499
2499
|
u.updateResult();
|
|
2500
2500
|
});
|
|
2501
2501
|
}
|
|
@@ -2531,12 +2531,12 @@ function kn({
|
|
|
2531
2531
|
er.useEffect(() => {
|
|
2532
2532
|
d(s);
|
|
2533
2533
|
}, [s]);
|
|
2534
|
-
const m = er.useCallback((
|
|
2535
|
-
d((
|
|
2536
|
-
...
|
|
2537
|
-
...
|
|
2534
|
+
const m = er.useCallback((P) => {
|
|
2535
|
+
d((T) => ({
|
|
2536
|
+
...T,
|
|
2537
|
+
...P
|
|
2538
2538
|
}));
|
|
2539
|
-
}, []),
|
|
2539
|
+
}, []), S = tr(
|
|
2540
2540
|
() => ({
|
|
2541
2541
|
bobSupabase: x,
|
|
2542
2542
|
bobConfig: e,
|
|
@@ -2547,7 +2547,7 @@ function kn({
|
|
|
2547
2547
|
}),
|
|
2548
2548
|
[x, e, r, p, a, m]
|
|
2549
2549
|
);
|
|
2550
|
-
return /* @__PURE__ */ o.jsx(bn, { client: f, children: /* @__PURE__ */ o.jsx(Os.Provider, { value:
|
|
2550
|
+
return /* @__PURE__ */ o.jsx(bn, { client: f, children: /* @__PURE__ */ o.jsx(Os.Provider, { value: S, children: t }) });
|
|
2551
2551
|
}
|
|
2552
2552
|
function Rt() {
|
|
2553
2553
|
const t = qs(Os);
|
|
@@ -2571,7 +2571,7 @@ function Xn() {
|
|
|
2571
2571
|
const { callbacks: t } = Rt();
|
|
2572
2572
|
return t;
|
|
2573
2573
|
}
|
|
2574
|
-
const as =
|
|
2574
|
+
const as = 8e3, On = ({
|
|
2575
2575
|
onStart: t,
|
|
2576
2576
|
onEnd: e,
|
|
2577
2577
|
onFailed: r
|
|
@@ -2580,20 +2580,20 @@ const as = 5e3, On = ({
|
|
|
2580
2580
|
te(() => {
|
|
2581
2581
|
x.current = t, p.current = e, d.current = r;
|
|
2582
2582
|
}, [t, e, r]);
|
|
2583
|
-
const m =
|
|
2583
|
+
const m = J(() => {
|
|
2584
2584
|
f.current && (clearTimeout(f.current), f.current = null);
|
|
2585
|
-
}, []),
|
|
2585
|
+
}, []), S = J(() => {
|
|
2586
2586
|
var g;
|
|
2587
2587
|
u.current || (u.current = !0, console.log("[BobWidget TTS] Fallback: triggering onStart without audio"), (g = x.current) == null || g.call(x));
|
|
2588
|
-
}, []),
|
|
2589
|
-
var
|
|
2588
|
+
}, []), P = J(async (g) => {
|
|
2589
|
+
var E, h, b;
|
|
2590
2590
|
if (g.trim()) {
|
|
2591
2591
|
u.current = !1, m(), l.current && (l.current.pause(), l.current = null), f.current = setTimeout(() => {
|
|
2592
|
-
var
|
|
2593
|
-
console.warn("[BobWidget TTS] Timeout after 5s - triggering fallback callbacks"),
|
|
2592
|
+
var y, I;
|
|
2593
|
+
console.warn("[BobWidget TTS] Timeout after 5s - triggering fallback callbacks"), S(), c(!1), (y = p.current) == null || y.call(p), (I = d.current) == null || I.call(d), l.current = null;
|
|
2594
2594
|
}, as);
|
|
2595
2595
|
try {
|
|
2596
|
-
const
|
|
2596
|
+
const y = new AbortController(), I = setTimeout(() => y.abort(), as - 1e3), k = await fetch(
|
|
2597
2597
|
`${s.supabaseUrl}/functions/v1/bob-tts`,
|
|
2598
2598
|
{
|
|
2599
2599
|
method: "POST",
|
|
@@ -2602,48 +2602,48 @@ const as = 5e3, On = ({
|
|
|
2602
2602
|
Authorization: `Bearer ${s.supabaseKey}`
|
|
2603
2603
|
},
|
|
2604
2604
|
body: JSON.stringify({ text: g }),
|
|
2605
|
-
signal:
|
|
2605
|
+
signal: y.signal
|
|
2606
2606
|
}
|
|
2607
2607
|
);
|
|
2608
|
-
if (clearTimeout(
|
|
2609
|
-
const
|
|
2610
|
-
throw console.error("[BobWidget TTS] Request failed:",
|
|
2608
|
+
if (clearTimeout(I), !k.ok) {
|
|
2609
|
+
const C = await k.json().catch(() => ({}));
|
|
2610
|
+
throw console.error("[BobWidget TTS] Request failed:", C), new Error("TTS request failed");
|
|
2611
2611
|
}
|
|
2612
|
-
const { audioContent:
|
|
2613
|
-
l.current =
|
|
2614
|
-
var
|
|
2615
|
-
m(), u.current || (u.current = !0, c(!0), console.log("[BobWidget TTS] Audio playing, triggering onStart"), (
|
|
2616
|
-
},
|
|
2617
|
-
var
|
|
2618
|
-
m(), c(!1), (
|
|
2619
|
-
},
|
|
2620
|
-
var D,
|
|
2621
|
-
m(), console.warn("[BobWidget TTS] Audio playback error:",
|
|
2612
|
+
const { audioContent: F } = await k.json(), w = new Audio(`data:audio/mp3;base64,${F}`);
|
|
2613
|
+
l.current = w, w.onplay = () => {
|
|
2614
|
+
var C;
|
|
2615
|
+
m(), u.current || (u.current = !0, c(!0), console.log("[BobWidget TTS] Audio playing, triggering onStart"), (C = x.current) == null || C.call(x));
|
|
2616
|
+
}, w.onended = () => {
|
|
2617
|
+
var C;
|
|
2618
|
+
m(), c(!1), (C = p.current) == null || C.call(p), l.current = null;
|
|
2619
|
+
}, w.onerror = (C) => {
|
|
2620
|
+
var D, A;
|
|
2621
|
+
m(), console.warn("[BobWidget TTS] Audio playback error:", C), S(), c(!1), (D = p.current) == null || D.call(p), (A = d.current) == null || A.call(d), l.current = null;
|
|
2622
2622
|
};
|
|
2623
2623
|
try {
|
|
2624
|
-
await
|
|
2625
|
-
} catch (
|
|
2626
|
-
console.warn("[BobWidget TTS] Audio play() failed (
|
|
2624
|
+
await w.play();
|
|
2625
|
+
} catch (C) {
|
|
2626
|
+
console.warn("[BobWidget TTS] Audio play() failed (autoplay policy), will retry on user interaction:", C), m(), S(), c(!1), (E = p.current) == null || E.call(p);
|
|
2627
2627
|
}
|
|
2628
|
-
} catch (
|
|
2629
|
-
m(), console.error("[BobWidget TTS] Speech synthesis error:",
|
|
2628
|
+
} catch (y) {
|
|
2629
|
+
m(), console.error("[BobWidget TTS] Speech synthesis error:", y), S(), c(!1), (h = p.current) == null || h.call(p), (b = d.current) == null || b.call(d);
|
|
2630
2630
|
}
|
|
2631
2631
|
}
|
|
2632
|
-
}, [s.supabaseUrl, s.supabaseKey, m,
|
|
2632
|
+
}, [s.supabaseUrl, s.supabaseKey, m, S]), T = J(() => {
|
|
2633
2633
|
m(), l.current && (l.current.pause(), l.current = null), c(!1);
|
|
2634
|
-
}, [m]),
|
|
2634
|
+
}, [m]), j = J(() => {
|
|
2635
2635
|
var g;
|
|
2636
2636
|
(g = l.current) == null || g.pause();
|
|
2637
|
-
}, []), R =
|
|
2637
|
+
}, []), R = J(() => {
|
|
2638
2638
|
var g;
|
|
2639
2639
|
(g = l.current) == null || g.play();
|
|
2640
2640
|
}, []);
|
|
2641
2641
|
return te(() => () => {
|
|
2642
2642
|
m(), l.current && (l.current.pause(), l.current = null);
|
|
2643
2643
|
}, [m]), {
|
|
2644
|
-
speak:
|
|
2645
|
-
stop:
|
|
2646
|
-
pause:
|
|
2644
|
+
speak: P,
|
|
2645
|
+
stop: T,
|
|
2646
|
+
pause: j,
|
|
2647
2647
|
resume: R,
|
|
2648
2648
|
isSpeaking: a,
|
|
2649
2649
|
isSupported: !0
|
|
@@ -2766,16 +2766,16 @@ const as = 5e3, On = ({
|
|
|
2766
2766
|
onResearchStart: p,
|
|
2767
2767
|
onReadyToSpeak: d,
|
|
2768
2768
|
onHighlightPart: m,
|
|
2769
|
-
onHighlightProduct:
|
|
2770
|
-
onNoPartsFound:
|
|
2771
|
-
onAutoFetchComplete:
|
|
2769
|
+
onHighlightProduct: S,
|
|
2770
|
+
onNoPartsFound: P,
|
|
2771
|
+
onAutoFetchComplete: T
|
|
2772
2772
|
}) => {
|
|
2773
2773
|
var fr, pr, it, Qe;
|
|
2774
|
-
const { bobConfig:
|
|
2775
|
-
|
|
2776
|
-
}, { speak:
|
|
2774
|
+
const { bobConfig: j, hostApiConfig: R, hostContext: g, callbacks: E } = Rt(), [h, b] = z([]), [y, I] = z(""), [k, F] = z(!1), [w, C] = z(!1), [D, A] = z(null), L = G(null), Z = G(!1), Ee = G(!1), B = G(""), oe = G(!1), ge = G(null), $e = () => {
|
|
2775
|
+
ge.current && (clearTimeout(ge.current), ge.current = null);
|
|
2776
|
+
}, { speak: Y, stop: nt, isSpeaking: ur } = On({
|
|
2777
2777
|
onStart: () => {
|
|
2778
|
-
$e(),
|
|
2778
|
+
$e(), oe.current = !0, console.log("[BobWidget] Speech started - revealing products"), d == null || d(), e || Se(r);
|
|
2779
2779
|
},
|
|
2780
2780
|
onEnd: () => {
|
|
2781
2781
|
$e();
|
|
@@ -2792,65 +2792,58 @@ const as = 5e3, On = ({
|
|
|
2792
2792
|
var q;
|
|
2793
2793
|
(q = L.current) == null || q.scrollIntoView({ behavior: "smooth" });
|
|
2794
2794
|
}, [h]), te(() => {
|
|
2795
|
-
var se,
|
|
2795
|
+
var se, ne;
|
|
2796
2796
|
const q = (se = g.vehicle) == null ? void 0 : se.selectedVehicle;
|
|
2797
|
-
q && !
|
|
2797
|
+
q && !D && (console.log("[BobWidget] Setting vehicle from host context:", q), A(q), (ne = E.onVehicleIdentified) == null || ne.call(E, q));
|
|
2798
2798
|
}, [(fr = g.vehicle) == null ? void 0 : fr.selectedVehicle]), te(() => {
|
|
2799
2799
|
var q;
|
|
2800
2800
|
if (h.length === 0 && !Ee.current) {
|
|
2801
|
+
Ee.current = !0;
|
|
2801
2802
|
const se = (q = g.vehicle) == null ? void 0 : q.selectedVehicle;
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
role: "assistant",
|
|
2807
|
-
content: `G'day! Saw you've got the ${ce} - choice wagon! What can I help you find for it today?`
|
|
2808
|
-
}]);
|
|
2809
|
-
} else
|
|
2810
|
-
b([{
|
|
2811
|
-
role: "assistant",
|
|
2812
|
-
content: "G'day! Bob from CARFIX here. How can I help ya today?"
|
|
2813
|
-
}]);
|
|
2803
|
+
let ne;
|
|
2804
|
+
se ? ne = `G'day! Saw you've got the ${`${se.year} ${se.make} ${se.model}`} - choice wagon! What can I help you find for it today?` : ne = "G'day! Bob from CARFIX here. How can I help ya today?", b([{ role: "assistant", content: ne }]), w || setTimeout(() => {
|
|
2805
|
+
console.log("[BobWidget] Speaking initial greeting"), Y(ne);
|
|
2806
|
+
}, 800);
|
|
2814
2807
|
}
|
|
2815
|
-
}, [(pr = g.vehicle) == null ? void 0 : pr.selectedVehicle, h.length]), te(() => {
|
|
2808
|
+
}, [(pr = g.vehicle) == null ? void 0 : pr.selectedVehicle, h.length, w, Y]), te(() => {
|
|
2816
2809
|
var ot, ct;
|
|
2817
2810
|
const q = (ot = g.vehicle) == null ? void 0 : ot.selectedVehicle;
|
|
2818
|
-
if (!q ||
|
|
2819
|
-
const se = q.vehicle_id ?? q.id,
|
|
2820
|
-
if (!Number.isFinite(
|
|
2811
|
+
if (!q || Z.current) return;
|
|
2812
|
+
const se = q.vehicle_id ?? q.id, ne = Number.parseInt(String(se), 10);
|
|
2813
|
+
if (!Number.isFinite(ne)) {
|
|
2821
2814
|
console.warn("[BobWidget] Vehicle has invalid vehicle_id, cannot auto-fetch:", q);
|
|
2822
2815
|
return;
|
|
2823
2816
|
}
|
|
2824
|
-
|
|
2825
|
-
const
|
|
2817
|
+
Z.current = !0;
|
|
2818
|
+
const he = { ...q, vehicle_id: String(ne) }, We = (ct = g.user) == null ? void 0 : ct.email;
|
|
2826
2819
|
(async () => {
|
|
2827
2820
|
var Ke, Ve;
|
|
2828
|
-
const lt = `${
|
|
2821
|
+
const lt = `${j.supabaseUrl}/functions/v1/bob-chat`;
|
|
2829
2822
|
try {
|
|
2830
|
-
const
|
|
2823
|
+
const je = await fetch(lt, {
|
|
2831
2824
|
method: "POST",
|
|
2832
2825
|
headers: {
|
|
2833
2826
|
"Content-Type": "application/json",
|
|
2834
|
-
Authorization: `Bearer ${
|
|
2827
|
+
Authorization: `Bearer ${j.supabaseKey}`
|
|
2835
2828
|
},
|
|
2836
2829
|
body: JSON.stringify({
|
|
2837
2830
|
messages: [],
|
|
2838
|
-
vehicleContext:
|
|
2831
|
+
vehicleContext: he,
|
|
2839
2832
|
customerEmail: We,
|
|
2840
2833
|
autoFetchParts: !0,
|
|
2841
2834
|
hostConfig: R,
|
|
2842
2835
|
hostContext: g
|
|
2843
2836
|
})
|
|
2844
2837
|
});
|
|
2845
|
-
if (!
|
|
2846
|
-
console.error("[BobWidget] Auto-fetch failed:",
|
|
2838
|
+
if (!je.ok || !je.body) {
|
|
2839
|
+
console.error("[BobWidget] Auto-fetch failed:", je.status);
|
|
2847
2840
|
return;
|
|
2848
2841
|
}
|
|
2849
|
-
const ut =
|
|
2842
|
+
const ut = je.body.getReader(), dt = new TextDecoder();
|
|
2850
2843
|
let Ie = "";
|
|
2851
2844
|
for (; ; ) {
|
|
2852
|
-
const { done:
|
|
2853
|
-
if (
|
|
2845
|
+
const { done: Te, value: De } = await ut.read();
|
|
2846
|
+
if (Te) break;
|
|
2854
2847
|
Ie += dt.decode(De, { stream: !0 });
|
|
2855
2848
|
let ht;
|
|
2856
2849
|
for (; (ht = Ie.indexOf(`
|
|
@@ -2861,14 +2854,14 @@ const as = 5e3, On = ({
|
|
|
2861
2854
|
if (be === "[DONE]") break;
|
|
2862
2855
|
try {
|
|
2863
2856
|
const _e = JSON.parse(be);
|
|
2864
|
-
_e.type === "service_packages_found" && _e.packages && ((Ke =
|
|
2857
|
+
_e.type === "service_packages_found" && _e.packages && ((Ke = E.onServicePackagesFound) == null || Ke.call(E, _e.packages)), _e.type === "parts_found" && _e.parts && ((Ve = E.onPartsFound) == null || Ve.call(E, _e.parts));
|
|
2865
2858
|
} catch {
|
|
2866
2859
|
}
|
|
2867
2860
|
}
|
|
2868
2861
|
}
|
|
2869
|
-
|
|
2870
|
-
} catch (
|
|
2871
|
-
console.error("[BobWidget] Auto-fetch error:",
|
|
2862
|
+
T == null || T();
|
|
2863
|
+
} catch (je) {
|
|
2864
|
+
console.error("[BobWidget] Auto-fetch error:", je);
|
|
2872
2865
|
}
|
|
2873
2866
|
})();
|
|
2874
2867
|
}, [(it = g.vehicle) == null ? void 0 : it.selectedVehicle, (Qe = g.user) == null ? void 0 : Qe.email]);
|
|
@@ -2879,30 +2872,30 @@ const as = 5e3, On = ({
|
|
|
2879
2872
|
console.warn(`[BobWidget] State "${q}" not available`);
|
|
2880
2873
|
}
|
|
2881
2874
|
}, wr = async (q) => {
|
|
2882
|
-
var
|
|
2883
|
-
const se = `${
|
|
2875
|
+
var he, We, at, ot, ct, lt, Ke, Ve, je, ut, dt, Ie;
|
|
2876
|
+
const se = `${j.supabaseUrl}/functions/v1/bob-chat`, ne = (he = g.user) == null ? void 0 : he.email;
|
|
2884
2877
|
try {
|
|
2885
|
-
const
|
|
2878
|
+
const Te = {
|
|
2886
2879
|
messages: [...h, q],
|
|
2887
2880
|
hostConfig: R,
|
|
2888
2881
|
hostContext: g
|
|
2889
2882
|
};
|
|
2890
|
-
|
|
2883
|
+
D && (Te.vehicleContext = D), ne && (Te.customerEmail = ne);
|
|
2891
2884
|
const De = await fetch(se, {
|
|
2892
2885
|
method: "POST",
|
|
2893
2886
|
headers: {
|
|
2894
2887
|
"Content-Type": "application/json",
|
|
2895
|
-
Authorization: `Bearer ${
|
|
2888
|
+
Authorization: `Bearer ${j.supabaseKey}`
|
|
2896
2889
|
},
|
|
2897
|
-
body: JSON.stringify(
|
|
2890
|
+
body: JSON.stringify(Te)
|
|
2898
2891
|
});
|
|
2899
2892
|
if (!De.ok) {
|
|
2900
2893
|
if (De.status === 429) {
|
|
2901
|
-
(We =
|
|
2894
|
+
(We = E.onError) == null || We.call(E, new Error("Rate limit exceeded"));
|
|
2902
2895
|
return;
|
|
2903
2896
|
}
|
|
2904
2897
|
if (De.status === 402) {
|
|
2905
|
-
(at =
|
|
2898
|
+
(at = E.onError) == null || at.call(E, new Error("Payment required"));
|
|
2906
2899
|
return;
|
|
2907
2900
|
}
|
|
2908
2901
|
throw new Error("Failed to start stream");
|
|
@@ -2925,28 +2918,28 @@ const as = 5e3, On = ({
|
|
|
2925
2918
|
break;
|
|
2926
2919
|
}
|
|
2927
2920
|
try {
|
|
2928
|
-
const
|
|
2929
|
-
if (
|
|
2930
|
-
|
|
2921
|
+
const ie = JSON.parse(mr);
|
|
2922
|
+
if (ie.type === "vehicle_identified" && ie.vehicle) {
|
|
2923
|
+
A(ie.vehicle), (ot = E.onVehicleIdentified) == null || ot.call(E, ie.vehicle);
|
|
2931
2924
|
continue;
|
|
2932
2925
|
}
|
|
2933
|
-
if (
|
|
2934
|
-
(ct =
|
|
2926
|
+
if (ie.type === "service_packages_found" && ie.packages) {
|
|
2927
|
+
(ct = E.onServicePackagesFound) == null || ct.call(E, ie.packages);
|
|
2935
2928
|
continue;
|
|
2936
2929
|
}
|
|
2937
|
-
if (
|
|
2938
|
-
(lt =
|
|
2930
|
+
if (ie.type === "parts_found" && ie.parts) {
|
|
2931
|
+
(lt = E.onPartsFound) == null || lt.call(E, ie.parts);
|
|
2939
2932
|
continue;
|
|
2940
2933
|
}
|
|
2941
|
-
if (
|
|
2942
|
-
|
|
2934
|
+
if (ie.type === "no_parts_found") {
|
|
2935
|
+
P == null || P();
|
|
2943
2936
|
continue;
|
|
2944
2937
|
}
|
|
2945
|
-
if (
|
|
2946
|
-
(Ke =
|
|
2938
|
+
if (ie.type === "cart_updated" && ie.items) {
|
|
2939
|
+
(Ke = E.onCartUpdated) == null || Ke.call(E, ie.items);
|
|
2947
2940
|
continue;
|
|
2948
2941
|
}
|
|
2949
|
-
const Ht = (ut = (
|
|
2942
|
+
const Ht = (ut = (je = (Ve = ie.choices) == null ? void 0 : Ve[0]) == null ? void 0 : je.delta) == null ? void 0 : ut.content;
|
|
2950
2943
|
if (Ht) {
|
|
2951
2944
|
Ne += Ht;
|
|
2952
2945
|
const Gt = Ne.replace(/\[VEHICLE_CONFIRMED:\{[\s\S]*?\}\]/g, "");
|
|
@@ -2955,7 +2948,7 @@ const as = 5e3, On = ({
|
|
|
2955
2948
|
return (Ot == null ? void 0 : Ot.role) === "assistant" ? ft.map(
|
|
2956
2949
|
(Yt, Er) => Er === ft.length - 1 ? { ...Yt, content: Gt } : Yt
|
|
2957
2950
|
) : [...ft, { role: "assistant", content: Gt }];
|
|
2958
|
-
}), (dt =
|
|
2951
|
+
}), (dt = E.onBobMessage) == null || dt.call(E, Gt);
|
|
2959
2952
|
}
|
|
2960
2953
|
} catch {
|
|
2961
2954
|
be = ke + `
|
|
@@ -2977,32 +2970,32 @@ const as = 5e3, On = ({
|
|
|
2977
2970
|
const kt = Ne.match(/(?:go with|recommend|suggest|grab|try)\s+(?:the\s+)?(\w+)\s+(?:at|for)\s+\$(\d+(?:\.\d{2})?)/i);
|
|
2978
2971
|
if (kt) {
|
|
2979
2972
|
const [, ye, He] = kt;
|
|
2980
|
-
|
|
2973
|
+
S == null || S({ brand: ye, price: parseFloat(He) });
|
|
2981
2974
|
}
|
|
2982
|
-
!
|
|
2983
|
-
|
|
2975
|
+
!w && B.current.trim() ? (oe.current = !1, $e(), Y(B.current), ge.current = setTimeout(() => {
|
|
2976
|
+
oe.current || (console.warn("[BobWidget] Speech fallback after 2s"), d == null || d(), e || (Vt && x ? x() : u ? u() : (Se(a), setTimeout(() => Se(l), 3e3))));
|
|
2984
2977
|
}, 2e3)) : (d == null || d(), e || (Vt && x ? x() : u ? u() : (Se(a), setTimeout(() => Se(l), 3e3))));
|
|
2985
|
-
} catch (
|
|
2986
|
-
console.error("[BobWidget] Chat error:",
|
|
2978
|
+
} catch (Te) {
|
|
2979
|
+
console.error("[BobWidget] Chat error:", Te), (Ie = E.onError) == null || Ie.call(E, Te instanceof Error ? Te : new Error("Unknown error")), e || Se(c);
|
|
2987
2980
|
}
|
|
2988
2981
|
}, _t = async () => {
|
|
2989
|
-
if (!
|
|
2982
|
+
if (!y.trim() || k) return;
|
|
2990
2983
|
nt();
|
|
2991
|
-
const q = { role: "user", content:
|
|
2992
|
-
b((
|
|
2993
|
-
const se =
|
|
2994
|
-
if (Pn.some((
|
|
2995
|
-
const
|
|
2996
|
-
b((We) => [...We, { role: "assistant", content:
|
|
2984
|
+
const q = { role: "user", content: y };
|
|
2985
|
+
b((he) => [...he, q]), I("");
|
|
2986
|
+
const se = y.toLowerCase();
|
|
2987
|
+
if (Pn.some((he) => se.includes(he))) {
|
|
2988
|
+
const he = `G'day mate! I'm running Bob v${xr} - she's running sweet as! Anything else I can help ya with?`;
|
|
2989
|
+
b((We) => [...We, { role: "assistant", content: he }]), w || Y(he);
|
|
2997
2990
|
return;
|
|
2998
2991
|
}
|
|
2999
|
-
|
|
2992
|
+
F(!0), p == null || p(), e || Se(s), await wr(q), F(!1);
|
|
3000
2993
|
};
|
|
3001
2994
|
return {
|
|
3002
2995
|
messages: h,
|
|
3003
|
-
input:
|
|
3004
|
-
setInput:
|
|
3005
|
-
isLoading:
|
|
2996
|
+
input: y,
|
|
2997
|
+
setInput: I,
|
|
2998
|
+
isLoading: k,
|
|
3006
2999
|
handleSend: _t,
|
|
3007
3000
|
handleKeyPress: (q) => {
|
|
3008
3001
|
q.key === "Enter" && !q.shiftKey && (q.preventDefault(), _t());
|
|
@@ -3018,14 +3011,14 @@ const as = 5e3, On = ({
|
|
|
3018
3011
|
content: "G'day! Bob from CARFIX here. How can I help ya today?"
|
|
3019
3012
|
}]);
|
|
3020
3013
|
},
|
|
3021
|
-
isMuted:
|
|
3014
|
+
isMuted: w,
|
|
3022
3015
|
toggleMute: () => {
|
|
3023
|
-
|
|
3016
|
+
C((q) => !q), w || nt();
|
|
3024
3017
|
},
|
|
3025
3018
|
isSpeaking: ur,
|
|
3026
|
-
identifiedVehicle:
|
|
3019
|
+
identifiedVehicle: D,
|
|
3027
3020
|
clearVehicle: () => {
|
|
3028
|
-
|
|
3021
|
+
A(null);
|
|
3029
3022
|
}
|
|
3030
3023
|
};
|
|
3031
3024
|
}, Fn = (t) => {
|
|
@@ -3050,10 +3043,10 @@ const as = 5e3, On = ({
|
|
|
3050
3043
|
}, [e, r]), ks({
|
|
3051
3044
|
queryKey: ["bob-animation-data", t],
|
|
3052
3045
|
queryFn: async () => {
|
|
3053
|
-
var
|
|
3046
|
+
var j;
|
|
3054
3047
|
const { data: s, error: a } = await r.from("bob_looks").select("*").order("display_order");
|
|
3055
3048
|
if (a) throw a;
|
|
3056
|
-
const c = (s || []).find((R) => R.is_active), l = t || (c == null ? void 0 : c.id) || s && ((
|
|
3049
|
+
const c = (s || []).find((R) => R.is_active), l = t || (c == null ? void 0 : c.id) || s && ((j = s[0]) == null ? void 0 : j.id) || null;
|
|
3057
3050
|
if (!l)
|
|
3058
3051
|
return {
|
|
3059
3052
|
states: [],
|
|
@@ -3066,9 +3059,9 @@ const as = 5e3, On = ({
|
|
|
3066
3059
|
if (u) throw u;
|
|
3067
3060
|
const { data: x, error: p } = await r.from("bob_animations").select("*").eq("is_active", !0).eq("look_id", l).order("animation_state").order("sequence_order");
|
|
3068
3061
|
if (p) throw p;
|
|
3069
|
-
const d = new Set((f || []).map((R) => R.state_key)), m = (x || []).filter((R) => d.has(R.animation_state)), { data:
|
|
3070
|
-
if (
|
|
3071
|
-
const
|
|
3062
|
+
const d = new Set((f || []).map((R) => R.state_key)), m = (x || []).filter((R) => d.has(R.animation_state)), { data: S, error: P } = await r.storage.from("bob-images").list();
|
|
3063
|
+
if (P) throw P;
|
|
3064
|
+
const T = (S || []).map((R) => {
|
|
3072
3065
|
const { data: g } = r.storage.from("bob-images").getPublicUrl(R.name);
|
|
3073
3066
|
return g.publicUrl;
|
|
3074
3067
|
});
|
|
@@ -3078,7 +3071,7 @@ const as = 5e3, On = ({
|
|
|
3078
3071
|
}), {
|
|
3079
3072
|
states: f || [],
|
|
3080
3073
|
configs: m,
|
|
3081
|
-
uploadedImages:
|
|
3074
|
+
uploadedImages: T,
|
|
3082
3075
|
looks: s || [],
|
|
3083
3076
|
activeLookId: l
|
|
3084
3077
|
};
|
|
@@ -3087,7 +3080,7 @@ const as = 5e3, On = ({
|
|
|
3087
3080
|
gcTime: 5 * 60 * 1e3
|
|
3088
3081
|
});
|
|
3089
3082
|
}, Mn = () => {
|
|
3090
|
-
const [t, e] = z(""), [r, s] = z(0), [a, c] = z(400), [l, f] = z(!1), u = G(), { data: x, isLoading: p } = Fn(), d = G({}), { imageUrlsMap: m, alternateImages:
|
|
3083
|
+
const [t, e] = z(""), [r, s] = z(0), [a, c] = z(400), [l, f] = z(!1), u = G(), { data: x, isLoading: p } = Fn(), d = G({}), { imageUrlsMap: m, alternateImages: S, offsetsMap: P, scalesMap: T, availableStates: j } = tr(() => {
|
|
3091
3084
|
if (!x)
|
|
3092
3085
|
return {
|
|
3093
3086
|
imageUrlsMap: {},
|
|
@@ -3096,90 +3089,90 @@ const as = 5e3, On = ({
|
|
|
3096
3089
|
scalesMap: {},
|
|
3097
3090
|
availableStates: []
|
|
3098
3091
|
};
|
|
3099
|
-
const h = {}, b = {},
|
|
3100
|
-
return
|
|
3101
|
-
const
|
|
3102
|
-
if (
|
|
3103
|
-
const L = x.states.find((
|
|
3104
|
-
h[
|
|
3105
|
-
url:
|
|
3092
|
+
const h = {}, b = {}, y = {}, I = {}, k = x.states.map((F) => F.state_key);
|
|
3093
|
+
return k.forEach((F) => {
|
|
3094
|
+
const w = x.configs.filter((L) => L.animation_state === F), C = w.map((L) => L.image_url), D = w.map((L) => L.vertical_offset || 0), A = w.map((L) => L.scale || 100);
|
|
3095
|
+
if (C.length > 0) {
|
|
3096
|
+
const L = x.states.find((Z) => Z.state_key === F);
|
|
3097
|
+
h[F] = {
|
|
3098
|
+
url: C[0],
|
|
3106
3099
|
animation_speed: (L == null ? void 0 : L.animation_speed) || 400,
|
|
3107
3100
|
pause_duration: (L == null ? void 0 : L.pause_duration) || 0,
|
|
3108
3101
|
loop_count: (L == null ? void 0 : L.loop_count) || 0
|
|
3109
|
-
}, b[
|
|
3102
|
+
}, b[F] = C, y[F] = D, I[F] = A;
|
|
3110
3103
|
}
|
|
3111
3104
|
}), {
|
|
3112
3105
|
imageUrlsMap: h,
|
|
3113
3106
|
alternateImages: b,
|
|
3114
|
-
offsetsMap:
|
|
3115
|
-
scalesMap:
|
|
3116
|
-
availableStates:
|
|
3107
|
+
offsetsMap: y,
|
|
3108
|
+
scalesMap: I,
|
|
3109
|
+
availableStates: k
|
|
3117
3110
|
};
|
|
3118
3111
|
}, [x]);
|
|
3119
3112
|
return te(() => {
|
|
3120
3113
|
d.current = m;
|
|
3121
3114
|
}, [m]), te(() => {
|
|
3122
|
-
|
|
3123
|
-
}, [
|
|
3124
|
-
const h =
|
|
3115
|
+
j.length > 0 && !t && e(j[0]);
|
|
3116
|
+
}, [j, t]), te(() => {
|
|
3117
|
+
const h = S[t];
|
|
3125
3118
|
if (u.current && clearInterval(u.current), h && h.length > 1) {
|
|
3126
3119
|
s(0);
|
|
3127
|
-
const b = d.current[t],
|
|
3128
|
-
let
|
|
3129
|
-
const
|
|
3120
|
+
const b = d.current[t], y = (b == null ? void 0 : b.animation_speed) || a || 400, I = (b == null ? void 0 : b.loop_count) || 0, k = (b == null ? void 0 : b.pause_duration) || 0;
|
|
3121
|
+
let F = 0, w = !1;
|
|
3122
|
+
const C = () => {
|
|
3130
3123
|
u.current = setInterval(() => {
|
|
3131
|
-
|
|
3132
|
-
const
|
|
3133
|
-
return
|
|
3134
|
-
|
|
3135
|
-
},
|
|
3124
|
+
w || s((D) => {
|
|
3125
|
+
const A = (D + 1) % h.length;
|
|
3126
|
+
return A === 0 && (F++, I > 0 && F >= I) ? (clearInterval(u.current), k > 0 && (w = !0, setTimeout(() => {
|
|
3127
|
+
F = 0, w = !1, C();
|
|
3128
|
+
}, k)), D) : A;
|
|
3136
3129
|
});
|
|
3137
|
-
},
|
|
3130
|
+
}, y);
|
|
3138
3131
|
};
|
|
3139
|
-
|
|
3132
|
+
C();
|
|
3140
3133
|
} else
|
|
3141
3134
|
s(0);
|
|
3142
3135
|
return () => {
|
|
3143
3136
|
u.current && clearInterval(u.current);
|
|
3144
3137
|
};
|
|
3145
|
-
}, [t,
|
|
3138
|
+
}, [t, S]), {
|
|
3146
3139
|
animationState: t,
|
|
3147
3140
|
setAnimationState: e,
|
|
3148
3141
|
getCurrentImage: () => {
|
|
3149
|
-
const h =
|
|
3142
|
+
const h = S[t];
|
|
3150
3143
|
if (!h || h.length === 0) {
|
|
3151
|
-
const b =
|
|
3152
|
-
var
|
|
3153
|
-
return ((
|
|
3144
|
+
const b = j.find((y) => {
|
|
3145
|
+
var I;
|
|
3146
|
+
return ((I = S[y]) == null ? void 0 : I.length) > 0;
|
|
3154
3147
|
});
|
|
3155
|
-
return b ?
|
|
3148
|
+
return b ? S[b][0] : "";
|
|
3156
3149
|
}
|
|
3157
3150
|
return h[r] || h[0];
|
|
3158
3151
|
},
|
|
3159
3152
|
getCurrentOffset: () => {
|
|
3160
|
-
const h =
|
|
3153
|
+
const h = P[t];
|
|
3161
3154
|
if (!h || h.length === 0) {
|
|
3162
|
-
const b =
|
|
3163
|
-
var
|
|
3164
|
-
return ((
|
|
3155
|
+
const b = j.find((y) => {
|
|
3156
|
+
var I;
|
|
3157
|
+
return ((I = P[y]) == null ? void 0 : I.length) > 0;
|
|
3165
3158
|
});
|
|
3166
|
-
return b ?
|
|
3159
|
+
return b ? P[b][0] : 0;
|
|
3167
3160
|
}
|
|
3168
3161
|
return h[r] || h[0];
|
|
3169
3162
|
},
|
|
3170
3163
|
getCurrentScale: () => {
|
|
3171
|
-
const h =
|
|
3164
|
+
const h = T[t];
|
|
3172
3165
|
if (!h || h.length === 0) {
|
|
3173
|
-
const b =
|
|
3174
|
-
var
|
|
3175
|
-
return ((
|
|
3166
|
+
const b = j.find((y) => {
|
|
3167
|
+
var I;
|
|
3168
|
+
return ((I = T[y]) == null ? void 0 : I.length) > 0;
|
|
3176
3169
|
});
|
|
3177
|
-
return b ?
|
|
3170
|
+
return b ? T[b][0] : 100;
|
|
3178
3171
|
}
|
|
3179
3172
|
return h[r] || h[0];
|
|
3180
3173
|
},
|
|
3181
3174
|
imageUrls: m,
|
|
3182
|
-
availableStates:
|
|
3175
|
+
availableStates: j,
|
|
3183
3176
|
setTalkSpeed: c,
|
|
3184
3177
|
manualMode: l,
|
|
3185
3178
|
setManualMode: f,
|
|
@@ -3265,7 +3258,7 @@ const as = 5e3, On = ({
|
|
|
3265
3258
|
"input",
|
|
3266
3259
|
{
|
|
3267
3260
|
value: e,
|
|
3268
|
-
onChange: (
|
|
3261
|
+
onChange: (S) => r(S.target.value),
|
|
3269
3262
|
onKeyPress: c,
|
|
3270
3263
|
onFocus: l,
|
|
3271
3264
|
onBlur: f,
|
|
@@ -3294,19 +3287,19 @@ const as = 5e3, On = ({
|
|
|
3294
3287
|
)
|
|
3295
3288
|
] }) }),
|
|
3296
3289
|
/* @__PURE__ */ o.jsxs("div", { className: "overflow-y-auto p-4 space-y-3 h-[300px] md:h-[400px]", children: [
|
|
3297
|
-
[...t].reverse().map((
|
|
3290
|
+
[...t].reverse().map((S, P) => /* @__PURE__ */ o.jsx(
|
|
3298
3291
|
"div",
|
|
3299
3292
|
{
|
|
3300
|
-
className: `flex ${
|
|
3293
|
+
className: `flex ${S.role === "user" ? "justify-end" : "justify-start"}`,
|
|
3301
3294
|
children: /* @__PURE__ */ o.jsx(
|
|
3302
3295
|
"div",
|
|
3303
3296
|
{
|
|
3304
|
-
className: `max-w-[80%] rounded-lg px-4 py-2 text-sm md:text-base ${
|
|
3305
|
-
children:
|
|
3297
|
+
className: `max-w-[80%] rounded-lg px-4 py-2 text-sm md:text-base ${S.role === "user" ? "bg-blue-600 text-white" : "bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-gray-100"}`,
|
|
3298
|
+
children: S.content
|
|
3306
3299
|
}
|
|
3307
3300
|
)
|
|
3308
3301
|
},
|
|
3309
|
-
|
|
3302
|
+
P
|
|
3310
3303
|
)),
|
|
3311
3304
|
/* @__PURE__ */ o.jsx("div", { ref: u })
|
|
3312
3305
|
] })
|
|
@@ -3318,7 +3311,7 @@ const as = 5e3, On = ({
|
|
|
3318
3311
|
scale: a = 100,
|
|
3319
3312
|
position: c = "center"
|
|
3320
3313
|
}) => {
|
|
3321
|
-
const l =
|
|
3314
|
+
const l = 65 * a / 100, f = 320 * a / 100, u = c === "center" ? "5%" : "-25%";
|
|
3322
3315
|
return /* @__PURE__ */ o.jsxs("div", { className: "absolute inset-0 pointer-events-none overflow-hidden", children: [
|
|
3323
3316
|
/* @__PURE__ */ o.jsx(
|
|
3324
3317
|
"div",
|
|
@@ -3326,6 +3319,8 @@ const as = 5e3, On = ({
|
|
|
3326
3319
|
className: "absolute left-0 z-40",
|
|
3327
3320
|
style: {
|
|
3328
3321
|
bottom: `${s - 2}%`,
|
|
3322
|
+
// Add max-height to prevent clipping at top
|
|
3323
|
+
maxHeight: `${100 - s - 5}%`,
|
|
3329
3324
|
transform: `translateX(${u})`,
|
|
3330
3325
|
width: `${l}%`,
|
|
3331
3326
|
maxWidth: `${f}px`,
|
|
@@ -3337,7 +3332,7 @@ const as = 5e3, On = ({
|
|
|
3337
3332
|
src: t,
|
|
3338
3333
|
alt: `Bob ${e}`,
|
|
3339
3334
|
className: "w-full h-auto object-contain",
|
|
3340
|
-
style: { display: "block" }
|
|
3335
|
+
style: { display: "block", maxHeight: "100%" }
|
|
3341
3336
|
}
|
|
3342
3337
|
)
|
|
3343
3338
|
}
|
|
@@ -3378,7 +3373,7 @@ const as = 5e3, On = ({
|
|
|
3378
3373
|
counterHeightPercent: u = 22,
|
|
3379
3374
|
hasVehicle: x = !1
|
|
3380
3375
|
}) => {
|
|
3381
|
-
const p = G(null), d = G({}), m = G(null),
|
|
3376
|
+
const p = G(null), d = G({}), m = G(null), S = tr(() => {
|
|
3382
3377
|
const g = {};
|
|
3383
3378
|
return t.forEach((h) => {
|
|
3384
3379
|
const b = h.partslotDescription || "Other Parts";
|
|
@@ -3388,13 +3383,13 @@ const as = 5e3, On = ({
|
|
|
3388
3383
|
te(() => {
|
|
3389
3384
|
var g;
|
|
3390
3385
|
if (r) {
|
|
3391
|
-
const
|
|
3392
|
-
|
|
3386
|
+
const E = S.find((h) => cs(h.name, r));
|
|
3387
|
+
E && d.current[E.name] && ((g = d.current[E.name]) == null || g.scrollIntoView({ behavior: "smooth", block: "start" }));
|
|
3393
3388
|
}
|
|
3394
|
-
}, [r,
|
|
3389
|
+
}, [r, S]), te(() => {
|
|
3395
3390
|
s && m.current && m.current.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
3396
3391
|
}, [s]);
|
|
3397
|
-
const
|
|
3392
|
+
const P = t.length > 0 || e.length > 0, T = l, j = P && !l, R = x ? "56px" : "8px";
|
|
3398
3393
|
return /* @__PURE__ */ o.jsxs(
|
|
3399
3394
|
"div",
|
|
3400
3395
|
{
|
|
@@ -3406,11 +3401,11 @@ const as = 5e3, On = ({
|
|
|
3406
3401
|
paddingTop: "env(safe-area-inset-top, 4px)"
|
|
3407
3402
|
},
|
|
3408
3403
|
children: [
|
|
3409
|
-
|
|
3404
|
+
T && /* @__PURE__ */ o.jsx("div", { className: "rounded-lg p-3", children: /* @__PURE__ */ o.jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-500", children: [
|
|
3410
3405
|
/* @__PURE__ */ o.jsx("div", { className: "w-4 h-4 border-2 border-blue-600 border-t-transparent rounded-full animate-spin" }),
|
|
3411
3406
|
/* @__PURE__ */ o.jsx("span", { children: "Finding parts..." })
|
|
3412
3407
|
] }) }),
|
|
3413
|
-
|
|
3408
|
+
j && e.length > 0 && /* @__PURE__ */ o.jsxs("div", { className: "space-y-2", children: [
|
|
3414
3409
|
/* @__PURE__ */ o.jsxs("div", { className: "text-xs font-semibold text-blue-600 flex items-center gap-1 px-1", children: [
|
|
3415
3410
|
/* @__PURE__ */ o.jsx("svg", { className: "h-3 w-3", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" }) }),
|
|
3416
3411
|
"Service Packages"
|
|
@@ -3431,13 +3426,13 @@ const as = 5e3, On = ({
|
|
|
3431
3426
|
g.id
|
|
3432
3427
|
))
|
|
3433
3428
|
] }),
|
|
3434
|
-
|
|
3429
|
+
j && S.map(({ name: g, products: E }, h) => {
|
|
3435
3430
|
const b = r && cs(g, r);
|
|
3436
3431
|
return /* @__PURE__ */ o.jsxs(
|
|
3437
3432
|
"section",
|
|
3438
3433
|
{
|
|
3439
|
-
ref: (
|
|
3440
|
-
d.current[g] =
|
|
3434
|
+
ref: (y) => {
|
|
3435
|
+
d.current[g] = y;
|
|
3441
3436
|
},
|
|
3442
3437
|
className: `rounded-lg transition-all border border-transparent ${b ? "ring-2 ring-blue-600 p-2 bg-blue-50/50 shadow-lg" : ""}`,
|
|
3443
3438
|
children: [
|
|
@@ -3446,42 +3441,45 @@ const as = 5e3, On = ({
|
|
|
3446
3441
|
/* @__PURE__ */ o.jsx("span", { className: "truncate", children: g }),
|
|
3447
3442
|
/* @__PURE__ */ o.jsxs("span", { className: "text-[10px] text-gray-500", children: [
|
|
3448
3443
|
"(",
|
|
3449
|
-
|
|
3444
|
+
E.length,
|
|
3450
3445
|
")"
|
|
3451
3446
|
] })
|
|
3452
3447
|
] }),
|
|
3453
|
-
/* @__PURE__ */ o.jsx("div", { className: "space-y-2", children:
|
|
3454
|
-
const
|
|
3448
|
+
/* @__PURE__ */ o.jsx("div", { className: "space-y-2", children: E.map((y, I) => {
|
|
3449
|
+
const k = s && Bn(y, s);
|
|
3455
3450
|
return /* @__PURE__ */ o.jsxs(
|
|
3456
3451
|
"div",
|
|
3457
3452
|
{
|
|
3458
|
-
ref:
|
|
3459
|
-
onClick: () => a == null ? void 0 : a(
|
|
3460
|
-
className: `cursor-pointer transition-all bg-white/80 rounded-lg border border-gray-200 relative ${
|
|
3453
|
+
ref: k ? m : void 0,
|
|
3454
|
+
onClick: () => a == null ? void 0 : a(y),
|
|
3455
|
+
className: `cursor-pointer transition-all bg-white/80 rounded-lg border border-gray-200 relative ${k ? "ring-4 ring-blue-600 scale-105 z-10" : "hover:shadow-md"}`,
|
|
3461
3456
|
children: [
|
|
3462
|
-
|
|
3457
|
+
k && /* @__PURE__ */ o.jsxs("span", { className: "absolute -top-2 -right-2 bg-blue-600 text-white text-[8px] px-1 py-0.5 rounded z-20 flex items-center", children: [
|
|
3463
3458
|
/* @__PURE__ */ o.jsx("svg", { className: "h-2 w-2 mr-0.5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ o.jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }),
|
|
3464
3459
|
"Pick"
|
|
3465
3460
|
] }),
|
|
3466
3461
|
/* @__PURE__ */ o.jsxs("div", { className: "p-2", children: [
|
|
3467
|
-
/* @__PURE__ */ o.jsx("div", { className: "aspect-square bg-gray-100 rounded-md mb-1 flex items-center justify-center overflow-hidden", children:
|
|
3468
|
-
|
|
3469
|
-
|
|
3462
|
+
/* @__PURE__ */ o.jsx("div", { className: "aspect-square bg-gradient-to-br from-gray-50 to-gray-100 rounded-md mb-1 flex items-center justify-center overflow-hidden border border-gray-200/50", children: y.image_url ? /* @__PURE__ */ o.jsx("img", { src: y.image_url, alt: y.name, className: "w-full h-full object-contain" }) : /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col items-center justify-center text-gray-400", children: [
|
|
3463
|
+
/* @__PURE__ */ o.jsx("svg", { className: "h-6 w-6 mb-0.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }),
|
|
3464
|
+
/* @__PURE__ */ o.jsx("span", { className: "text-[8px] font-medium uppercase tracking-wide", children: "No Image" })
|
|
3465
|
+
] }) }),
|
|
3466
|
+
/* @__PURE__ */ o.jsx("p", { className: "text-xs font-medium line-clamp-2", children: y.name }),
|
|
3467
|
+
y.brand && /* @__PURE__ */ o.jsx("p", { className: "text-[10px] text-gray-500", children: y.brand })
|
|
3470
3468
|
] }),
|
|
3471
|
-
/* @__PURE__ */ o.jsx("div", { className: "px-2 pb-2", children: /* @__PURE__ */ o.jsx("span", { className: "text-sm font-bold text-blue-600", children:
|
|
3469
|
+
/* @__PURE__ */ o.jsx("div", { className: "px-2 pb-2", children: /* @__PURE__ */ o.jsx("span", { className: "text-sm font-bold text-blue-600", children: y.price > 0 ? `$${y.price.toFixed(2)}` : "Price on request" }) }),
|
|
3472
3470
|
/* @__PURE__ */ o.jsx("div", { className: "px-2 pb-2", children: /* @__PURE__ */ o.jsx(
|
|
3473
3471
|
"button",
|
|
3474
3472
|
{
|
|
3475
3473
|
className: "w-full bg-blue-600 text-white text-xs py-1.5 rounded-md hover:bg-blue-700",
|
|
3476
|
-
onClick: (
|
|
3477
|
-
|
|
3474
|
+
onClick: (F) => {
|
|
3475
|
+
F.stopPropagation(), a == null || a(y);
|
|
3478
3476
|
},
|
|
3479
3477
|
children: "Buy Now"
|
|
3480
3478
|
}
|
|
3481
3479
|
) })
|
|
3482
3480
|
]
|
|
3483
3481
|
},
|
|
3484
|
-
`${
|
|
3482
|
+
`${y.id}-${I}`
|
|
3485
3483
|
);
|
|
3486
3484
|
}) })
|
|
3487
3485
|
]
|
|
@@ -3498,25 +3496,25 @@ const as = 5e3, On = ({
|
|
|
3498
3496
|
language: r = "en-NZ",
|
|
3499
3497
|
mode: s = "toggle"
|
|
3500
3498
|
} = {}) => {
|
|
3501
|
-
const [a, c] = z(!1), [l, f] = z(""), [u, x] = z(""), [p, d] = z(null), [m,
|
|
3499
|
+
const [a, c] = z(!1), [l, f] = z(""), [u, x] = z(""), [p, d] = z(null), [m, S] = z(!1), P = G(null), T = G(""), j = G(t), R = G(e);
|
|
3502
3500
|
te(() => {
|
|
3503
|
-
|
|
3501
|
+
j.current = t, R.current = e;
|
|
3504
3502
|
}, [t, e]), te(() => {
|
|
3505
3503
|
const b = window.SpeechRecognition || window.webkitSpeechRecognition;
|
|
3506
3504
|
if (b) {
|
|
3507
|
-
|
|
3508
|
-
const
|
|
3509
|
-
|
|
3505
|
+
S(!0);
|
|
3506
|
+
const y = new b();
|
|
3507
|
+
y.continuous = s === "ptt", y.interimResults = !0, y.lang = r, y.maxAlternatives = 1, y.onstart = () => {
|
|
3510
3508
|
c(!0), d(null);
|
|
3511
|
-
},
|
|
3512
|
-
let
|
|
3513
|
-
for (let
|
|
3514
|
-
const
|
|
3515
|
-
|
|
3509
|
+
}, y.onresult = (I) => {
|
|
3510
|
+
let k = "", F = "";
|
|
3511
|
+
for (let w = I.resultIndex; w < I.results.length; w++) {
|
|
3512
|
+
const C = I.results[w][0].transcript;
|
|
3513
|
+
I.results[w].isFinal ? F += C : k += C;
|
|
3516
3514
|
}
|
|
3517
|
-
|
|
3518
|
-
},
|
|
3519
|
-
switch (c(!1),
|
|
3515
|
+
F && (T.current = F, f(F), j.current && j.current(F)), x(k);
|
|
3516
|
+
}, y.onerror = (I) => {
|
|
3517
|
+
switch (c(!1), I.error) {
|
|
3520
3518
|
case "no-speech":
|
|
3521
3519
|
d("No speech detected. Please try again.");
|
|
3522
3520
|
break;
|
|
@@ -3529,18 +3527,18 @@ const as = 5e3, On = ({
|
|
|
3529
3527
|
default:
|
|
3530
3528
|
d("Speech recognition error. Please try again.");
|
|
3531
3529
|
}
|
|
3532
|
-
},
|
|
3533
|
-
c(!1), x(""),
|
|
3534
|
-
},
|
|
3530
|
+
}, y.onend = () => {
|
|
3531
|
+
c(!1), x(""), T.current && R.current && R.current(T.current), T.current = "";
|
|
3532
|
+
}, P.current = y;
|
|
3535
3533
|
}
|
|
3536
3534
|
return () => {
|
|
3537
|
-
|
|
3535
|
+
P.current && P.current.stop();
|
|
3538
3536
|
};
|
|
3539
3537
|
}, [r, s]);
|
|
3540
3538
|
const g = () => {
|
|
3541
|
-
|
|
3542
|
-
},
|
|
3543
|
-
|
|
3539
|
+
P.current && !a && (f(""), x(""), d(null), P.current.start());
|
|
3540
|
+
}, E = () => {
|
|
3541
|
+
P.current && a && P.current.stop();
|
|
3544
3542
|
};
|
|
3545
3543
|
return {
|
|
3546
3544
|
isListening: a,
|
|
@@ -3549,9 +3547,9 @@ const as = 5e3, On = ({
|
|
|
3549
3547
|
error: p,
|
|
3550
3548
|
isSupported: m,
|
|
3551
3549
|
startListening: g,
|
|
3552
|
-
stopListening:
|
|
3550
|
+
stopListening: E,
|
|
3553
3551
|
toggleListening: () => {
|
|
3554
|
-
a ?
|
|
3552
|
+
a ? E() : g();
|
|
3555
3553
|
}
|
|
3556
3554
|
};
|
|
3557
3555
|
}, Un = ({
|
|
@@ -3568,32 +3566,32 @@ const as = 5e3, On = ({
|
|
|
3568
3566
|
onToggleMute: p,
|
|
3569
3567
|
isSpeaking: d = !1
|
|
3570
3568
|
}) => {
|
|
3571
|
-
const [m,
|
|
3572
|
-
isListening:
|
|
3569
|
+
const [m, S] = z(!1), P = G(null), T = G(!1), {
|
|
3570
|
+
isListening: j,
|
|
3573
3571
|
interimTranscript: R,
|
|
3574
3572
|
error: g,
|
|
3575
|
-
isSupported:
|
|
3573
|
+
isSupported: E,
|
|
3576
3574
|
startListening: h,
|
|
3577
3575
|
stopListening: b
|
|
3578
3576
|
} = Fs({
|
|
3579
|
-
onTranscript: (
|
|
3577
|
+
onTranscript: (w) => r(w),
|
|
3580
3578
|
language: "en-NZ",
|
|
3581
3579
|
mode: "ptt"
|
|
3582
3580
|
});
|
|
3583
3581
|
te(() => {
|
|
3584
3582
|
R && r(R);
|
|
3585
3583
|
}, [R, r]);
|
|
3586
|
-
const
|
|
3587
|
-
s ||
|
|
3588
|
-
}, [s, h]),
|
|
3589
|
-
|
|
3584
|
+
const y = J(() => {
|
|
3585
|
+
s || T.current || (T.current = !0, navigator.vibrate && navigator.vibrate(10), h());
|
|
3586
|
+
}, [s, h]), I = J(() => {
|
|
3587
|
+
T.current && (T.current = !1, navigator.vibrate && navigator.vibrate(10), b(), setTimeout(() => {
|
|
3590
3588
|
a();
|
|
3591
3589
|
}, 150));
|
|
3592
|
-
}, [b, a]),
|
|
3590
|
+
}, [b, a]), k = [...t].reverse().find((w) => w.role === "assistant"), F = k != null && k.content ? k.content.length > 50 ? k.content.slice(0, 50) + "..." : k.content : "Ask Bob about car parts...";
|
|
3593
3591
|
return /* @__PURE__ */ o.jsxs(
|
|
3594
3592
|
"div",
|
|
3595
3593
|
{
|
|
3596
|
-
ref:
|
|
3594
|
+
ref: P,
|
|
3597
3595
|
className: `fixed bottom-0 left-0 right-0 bg-white/95 backdrop-blur-md border-t border-gray-200 transition-all duration-300 ease-out shadow-[0_-4px_20px_rgba(0,0,0,0.15)] ${m ? "h-[55vh]" : "h-auto"}`,
|
|
3598
3596
|
style: {
|
|
3599
3597
|
zIndex: 60,
|
|
@@ -3603,19 +3601,19 @@ const as = 5e3, On = ({
|
|
|
3603
3601
|
/* @__PURE__ */ o.jsx(
|
|
3604
3602
|
"button",
|
|
3605
3603
|
{
|
|
3606
|
-
onClick: () =>
|
|
3604
|
+
onClick: () => S(!m),
|
|
3607
3605
|
className: "absolute -top-5 left-1/2 -translate-x-1/2 bg-white border border-gray-200 rounded-full p-1.5 shadow-lg z-40",
|
|
3608
3606
|
"aria-label": m ? "Collapse chat" : "Expand chat",
|
|
3609
3607
|
children: m ? /* @__PURE__ */ o.jsx("svg", { className: "h-4 w-4 text-gray-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) : /* @__PURE__ */ o.jsx("svg", { className: "h-4 w-4 text-gray-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 15l7-7 7 7" }) })
|
|
3610
3608
|
}
|
|
3611
3609
|
),
|
|
3612
|
-
!m && /* @__PURE__ */ o.jsx("div", { className: "px-3 pt-2 pb-0.5", onClick: () =>
|
|
3610
|
+
!m && /* @__PURE__ */ o.jsx("div", { className: "px-3 pt-2 pb-0.5", onClick: () => S(!0), children: /* @__PURE__ */ o.jsx("p", { className: "text-xs text-gray-500 line-clamp-1", children: F }) }),
|
|
3613
3611
|
m && /* @__PURE__ */ o.jsxs("div", { className: "h-[calc(100%-100px)] overflow-y-auto p-4 space-y-2", children: [
|
|
3614
|
-
[...t].reverse().map((
|
|
3612
|
+
[...t].reverse().map((w, C) => /* @__PURE__ */ o.jsx("div", { className: `flex ${w.role === "user" ? "justify-end" : "justify-start"}`, children: /* @__PURE__ */ o.jsx("div", { className: `max-w-[85%] rounded-lg px-3 py-2 text-sm ${w.role === "user" ? "bg-blue-600 text-white" : "bg-gray-100 text-gray-900"}`, children: w.content }) }, C)),
|
|
3615
3613
|
/* @__PURE__ */ o.jsx("div", { ref: u })
|
|
3616
3614
|
] }),
|
|
3617
3615
|
/* @__PURE__ */ o.jsxs("div", { className: `px-2 pb-1.5 ${m ? "pt-2 border-t border-gray-200" : "pt-0.5"}`, children: [
|
|
3618
|
-
|
|
3616
|
+
j && /* @__PURE__ */ o.jsxs("div", { className: "mb-2 text-xs text-gray-500 flex items-center gap-2", children: [
|
|
3619
3617
|
/* @__PURE__ */ o.jsx("span", { className: "inline-block w-2 h-2 bg-red-500 rounded-full animate-pulse" }),
|
|
3620
3618
|
"Listening..."
|
|
3621
3619
|
] }),
|
|
@@ -3638,7 +3636,7 @@ const as = 5e3, On = ({
|
|
|
3638
3636
|
{
|
|
3639
3637
|
type: "text",
|
|
3640
3638
|
value: e,
|
|
3641
|
-
onChange: (
|
|
3639
|
+
onChange: (w) => r(w.target.value),
|
|
3642
3640
|
onKeyPress: c,
|
|
3643
3641
|
onFocus: l,
|
|
3644
3642
|
onBlur: f,
|
|
@@ -3647,17 +3645,17 @@ const as = 5e3, On = ({
|
|
|
3647
3645
|
className: "flex-1 h-10 text-base px-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50"
|
|
3648
3646
|
}
|
|
3649
3647
|
),
|
|
3650
|
-
|
|
3648
|
+
E && /* @__PURE__ */ o.jsx(
|
|
3651
3649
|
"button",
|
|
3652
3650
|
{
|
|
3653
|
-
onTouchStart:
|
|
3654
|
-
onTouchEnd:
|
|
3655
|
-
onTouchCancel:
|
|
3656
|
-
onMouseDown:
|
|
3657
|
-
onMouseUp:
|
|
3658
|
-
onMouseLeave:
|
|
3651
|
+
onTouchStart: y,
|
|
3652
|
+
onTouchEnd: I,
|
|
3653
|
+
onTouchCancel: I,
|
|
3654
|
+
onMouseDown: y,
|
|
3655
|
+
onMouseUp: I,
|
|
3656
|
+
onMouseLeave: I,
|
|
3659
3657
|
disabled: s,
|
|
3660
|
-
className: `shrink-0 h-12 w-12 rounded-full flex items-center justify-center select-none touch-none ${
|
|
3658
|
+
className: `shrink-0 h-12 w-12 rounded-full flex items-center justify-center select-none touch-none ${j ? "bg-red-500 text-white animate-pulse ring-2 ring-red-300 scale-110" : "bg-blue-600 text-white"} disabled:opacity-50`,
|
|
3661
3659
|
title: "Hold to talk",
|
|
3662
3660
|
children: /* @__PURE__ */ o.jsx("svg", { className: "h-5 w-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z" }) })
|
|
3663
3661
|
}
|
|
@@ -3681,36 +3679,36 @@ const as = 5e3, On = ({
|
|
|
3681
3679
|
onKeyPress: p,
|
|
3682
3680
|
onInputFocus: d,
|
|
3683
3681
|
onInputBlur: m,
|
|
3684
|
-
chatEndRef:
|
|
3685
|
-
isMuted:
|
|
3686
|
-
onToggleMute:
|
|
3687
|
-
isSpeaking:
|
|
3682
|
+
chatEndRef: S,
|
|
3683
|
+
isMuted: P,
|
|
3684
|
+
onToggleMute: T,
|
|
3685
|
+
isSpeaking: j,
|
|
3688
3686
|
products: R,
|
|
3689
3687
|
servicePackages: g,
|
|
3690
|
-
highlightedPartType:
|
|
3688
|
+
highlightedPartType: E,
|
|
3691
3689
|
highlightedProduct: h,
|
|
3692
3690
|
onProductClick: b,
|
|
3693
|
-
onPackageSelect:
|
|
3694
|
-
isResearching:
|
|
3695
|
-
vehicle:
|
|
3696
|
-
onChangeVehicle:
|
|
3691
|
+
onPackageSelect: y,
|
|
3692
|
+
isResearching: I,
|
|
3693
|
+
vehicle: k,
|
|
3694
|
+
onChangeVehicle: F
|
|
3697
3695
|
}) => {
|
|
3698
|
-
const
|
|
3696
|
+
const w = typeof window < "u" && window.self !== window.top, [C, D] = z("center"), [A, L] = z("hidden"), Z = R.length > 0 || g.length > 0;
|
|
3699
3697
|
te(() => {
|
|
3700
|
-
if (
|
|
3701
|
-
L("loading"),
|
|
3702
|
-
else if (
|
|
3703
|
-
if (
|
|
3704
|
-
|
|
3698
|
+
if (I && A !== "loading" && A !== "visible")
|
|
3699
|
+
L("loading"), C === "center" && D("left");
|
|
3700
|
+
else if (Z && A !== "visible")
|
|
3701
|
+
if (C === "center") {
|
|
3702
|
+
D("left"), L("transitioning");
|
|
3705
3703
|
const B = setTimeout(() => {
|
|
3706
3704
|
L("visible");
|
|
3707
3705
|
}, 400);
|
|
3708
3706
|
return () => clearTimeout(B);
|
|
3709
3707
|
} else
|
|
3710
3708
|
L("visible");
|
|
3711
|
-
else !
|
|
3712
|
-
}, [
|
|
3713
|
-
const Ee =
|
|
3709
|
+
else !Z && !I && A !== "hidden" && (L("hidden"), D("center"));
|
|
3710
|
+
}, [Z, I, A, C]);
|
|
3711
|
+
const Ee = A !== "hidden";
|
|
3714
3712
|
return /* @__PURE__ */ o.jsxs(
|
|
3715
3713
|
"div",
|
|
3716
3714
|
{
|
|
@@ -3752,10 +3750,10 @@ const as = 5e3, On = ({
|
|
|
3752
3750
|
counterOverlayUrl: s,
|
|
3753
3751
|
counterHeightPercent: a,
|
|
3754
3752
|
scale: 200,
|
|
3755
|
-
position:
|
|
3753
|
+
position: C
|
|
3756
3754
|
}
|
|
3757
3755
|
),
|
|
3758
|
-
|
|
3756
|
+
k && !w && /* @__PURE__ */ o.jsx("div", { className: "absolute top-2 left-2 right-2 z-20", children: /* @__PURE__ */ o.jsxs(
|
|
3759
3757
|
"div",
|
|
3760
3758
|
{
|
|
3761
3759
|
className: "bg-white/90 backdrop-blur-sm rounded-lg px-3 py-2 border border-gray-200 shadow-lg flex items-center justify-between",
|
|
@@ -3763,18 +3761,18 @@ const as = 5e3, On = ({
|
|
|
3763
3761
|
children: [
|
|
3764
3762
|
/* @__PURE__ */ o.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
3765
3763
|
/* @__PURE__ */ o.jsxs("p", { className: "text-xs font-medium text-gray-900 truncate", children: [
|
|
3766
|
-
|
|
3764
|
+
k.year,
|
|
3767
3765
|
" ",
|
|
3768
|
-
|
|
3766
|
+
k.make,
|
|
3769
3767
|
" ",
|
|
3770
|
-
|
|
3768
|
+
k.model
|
|
3771
3769
|
] }),
|
|
3772
|
-
|
|
3770
|
+
k.rego && /* @__PURE__ */ o.jsx("p", { className: "text-[10px] text-gray-500", children: k.rego })
|
|
3773
3771
|
] }),
|
|
3774
|
-
|
|
3772
|
+
F && /* @__PURE__ */ o.jsx(
|
|
3775
3773
|
"button",
|
|
3776
3774
|
{
|
|
3777
|
-
onClick:
|
|
3775
|
+
onClick: F,
|
|
3778
3776
|
className: "text-xs text-blue-600 hover:underline ml-2 shrink-0",
|
|
3779
3777
|
children: "Change"
|
|
3780
3778
|
}
|
|
@@ -3787,14 +3785,14 @@ const as = 5e3, On = ({
|
|
|
3787
3785
|
{
|
|
3788
3786
|
products: R,
|
|
3789
3787
|
servicePackages: g,
|
|
3790
|
-
highlightedPartType:
|
|
3788
|
+
highlightedPartType: E,
|
|
3791
3789
|
highlightedProduct: h,
|
|
3792
3790
|
onProductClick: b,
|
|
3793
|
-
onPackageSelect:
|
|
3794
|
-
isResearching:
|
|
3791
|
+
onPackageSelect: y,
|
|
3792
|
+
isResearching: I,
|
|
3795
3793
|
visible: Ee,
|
|
3796
3794
|
counterHeightPercent: a,
|
|
3797
|
-
hasVehicle: !!
|
|
3795
|
+
hasVehicle: !!k
|
|
3798
3796
|
}
|
|
3799
3797
|
),
|
|
3800
3798
|
/* @__PURE__ */ o.jsx(
|
|
@@ -3808,10 +3806,10 @@ const as = 5e3, On = ({
|
|
|
3808
3806
|
onKeyPress: p,
|
|
3809
3807
|
onInputFocus: d,
|
|
3810
3808
|
onInputBlur: m,
|
|
3811
|
-
chatEndRef:
|
|
3812
|
-
isMuted:
|
|
3813
|
-
onToggleMute:
|
|
3814
|
-
isSpeaking:
|
|
3809
|
+
chatEndRef: S,
|
|
3810
|
+
isMuted: P,
|
|
3811
|
+
onToggleMute: T,
|
|
3812
|
+
isSpeaking: j
|
|
3815
3813
|
}
|
|
3816
3814
|
)
|
|
3817
3815
|
]
|
|
@@ -3831,53 +3829,54 @@ const as = 5e3, On = ({
|
|
|
3831
3829
|
onToggleMute: p,
|
|
3832
3830
|
isSpeaking: d = !1
|
|
3833
3831
|
}) => {
|
|
3834
|
-
const [m,
|
|
3835
|
-
isListening:
|
|
3832
|
+
const [m, S] = z(!1), P = G(null), T = G(!1), {
|
|
3833
|
+
isListening: j,
|
|
3836
3834
|
interimTranscript: R,
|
|
3837
3835
|
error: g,
|
|
3838
|
-
isSupported:
|
|
3836
|
+
isSupported: E,
|
|
3839
3837
|
startListening: h,
|
|
3840
3838
|
stopListening: b
|
|
3841
3839
|
} = Fs({
|
|
3842
|
-
onTranscript: (
|
|
3840
|
+
onTranscript: (w) => r(w),
|
|
3843
3841
|
language: "en-NZ",
|
|
3844
3842
|
mode: "ptt"
|
|
3845
3843
|
});
|
|
3846
3844
|
te(() => {
|
|
3847
3845
|
R && r(R);
|
|
3848
3846
|
}, [R, r]);
|
|
3849
|
-
const
|
|
3850
|
-
s ||
|
|
3851
|
-
}, [s, h]),
|
|
3852
|
-
|
|
3847
|
+
const y = J(() => {
|
|
3848
|
+
s || T.current || (T.current = !0, navigator.vibrate && navigator.vibrate(10), h());
|
|
3849
|
+
}, [s, h]), I = J(() => {
|
|
3850
|
+
T.current && (T.current = !1, navigator.vibrate && navigator.vibrate(10), b(), setTimeout(() => {
|
|
3853
3851
|
a();
|
|
3854
3852
|
}, 150));
|
|
3855
|
-
}, [b, a]),
|
|
3853
|
+
}, [b, a]), k = [...t].reverse().find((w) => w.role === "assistant"), F = k != null && k.content ? k.content.length > 50 ? k.content.slice(0, 50) + "..." : k.content : "Ask Bob about car parts...";
|
|
3856
3854
|
return /* @__PURE__ */ o.jsxs(
|
|
3857
3855
|
"div",
|
|
3858
3856
|
{
|
|
3859
|
-
ref:
|
|
3857
|
+
ref: P,
|
|
3860
3858
|
className: `absolute bottom-0 left-0 right-0 bg-white/95 backdrop-blur-md border-t border-gray-200 transition-all duration-300 ease-out shadow-[0_-4px_20px_rgba(0,0,0,0.15)] ${m ? "h-[55%]" : "h-auto"}`,
|
|
3861
3859
|
style: {
|
|
3862
|
-
zIndex: 60
|
|
3860
|
+
zIndex: 60,
|
|
3861
|
+
paddingBottom: "env(safe-area-inset-bottom, 8px)"
|
|
3863
3862
|
},
|
|
3864
3863
|
children: [
|
|
3865
3864
|
/* @__PURE__ */ o.jsx(
|
|
3866
3865
|
"button",
|
|
3867
3866
|
{
|
|
3868
|
-
onClick: () =>
|
|
3867
|
+
onClick: () => S(!m),
|
|
3869
3868
|
className: "absolute -top-5 left-1/2 -translate-x-1/2 bg-white border border-gray-200 rounded-full p-1.5 shadow-lg z-40",
|
|
3870
3869
|
"aria-label": m ? "Collapse chat" : "Expand chat",
|
|
3871
3870
|
children: m ? /* @__PURE__ */ o.jsx("svg", { className: "h-4 w-4 text-gray-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) : /* @__PURE__ */ o.jsx("svg", { className: "h-4 w-4 text-gray-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 15l7-7 7 7" }) })
|
|
3872
3871
|
}
|
|
3873
3872
|
),
|
|
3874
|
-
!m && /* @__PURE__ */ o.jsx("div", { className: "px-3 pt-
|
|
3873
|
+
!m && /* @__PURE__ */ o.jsx("div", { className: "px-3 pt-1.5 pb-1", onClick: () => S(!0), children: /* @__PURE__ */ o.jsx("p", { className: "text-xs text-gray-500 line-clamp-1", children: F }) }),
|
|
3875
3874
|
m && /* @__PURE__ */ o.jsxs("div", { className: "h-[calc(100%-100px)] overflow-y-auto p-4 space-y-2", children: [
|
|
3876
|
-
[...t].reverse().map((
|
|
3875
|
+
[...t].reverse().map((w, C) => /* @__PURE__ */ o.jsx("div", { className: `flex ${w.role === "user" ? "justify-end" : "justify-start"}`, children: /* @__PURE__ */ o.jsx("div", { className: `max-w-[85%] rounded-lg px-3 py-2 text-sm ${w.role === "user" ? "bg-blue-600 text-white" : "bg-gray-100 text-gray-900"}`, children: w.content }) }, C)),
|
|
3877
3876
|
/* @__PURE__ */ o.jsx("div", { ref: u })
|
|
3878
3877
|
] }),
|
|
3879
|
-
/* @__PURE__ */ o.jsxs("div", { className: `px-
|
|
3880
|
-
|
|
3878
|
+
/* @__PURE__ */ o.jsxs("div", { className: `px-3 pb-1 ${m ? "pt-2 border-t border-gray-200" : "pt-1"}`, children: [
|
|
3879
|
+
j && /* @__PURE__ */ o.jsxs("div", { className: "mb-2 text-xs text-gray-500 flex items-center gap-2", children: [
|
|
3881
3880
|
/* @__PURE__ */ o.jsx("span", { className: "inline-block w-2 h-2 bg-red-500 rounded-full animate-pulse" }),
|
|
3882
3881
|
"Listening..."
|
|
3883
3882
|
] }),
|
|
@@ -3900,7 +3899,7 @@ const as = 5e3, On = ({
|
|
|
3900
3899
|
{
|
|
3901
3900
|
type: "text",
|
|
3902
3901
|
value: e,
|
|
3903
|
-
onChange: (
|
|
3902
|
+
onChange: (w) => r(w.target.value),
|
|
3904
3903
|
onKeyPress: c,
|
|
3905
3904
|
onFocus: l,
|
|
3906
3905
|
onBlur: f,
|
|
@@ -3909,17 +3908,17 @@ const as = 5e3, On = ({
|
|
|
3909
3908
|
className: "flex-1 h-10 text-base px-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50"
|
|
3910
3909
|
}
|
|
3911
3910
|
),
|
|
3912
|
-
|
|
3911
|
+
E && /* @__PURE__ */ o.jsx(
|
|
3913
3912
|
"button",
|
|
3914
3913
|
{
|
|
3915
|
-
onTouchStart:
|
|
3916
|
-
onTouchEnd:
|
|
3917
|
-
onTouchCancel:
|
|
3918
|
-
onMouseDown:
|
|
3919
|
-
onMouseUp:
|
|
3920
|
-
onMouseLeave:
|
|
3914
|
+
onTouchStart: y,
|
|
3915
|
+
onTouchEnd: I,
|
|
3916
|
+
onTouchCancel: I,
|
|
3917
|
+
onMouseDown: y,
|
|
3918
|
+
onMouseUp: I,
|
|
3919
|
+
onMouseLeave: I,
|
|
3921
3920
|
disabled: s,
|
|
3922
|
-
className: `shrink-0 h-12 w-12 rounded-full flex items-center justify-center select-none touch-none ${
|
|
3921
|
+
className: `shrink-0 h-12 w-12 rounded-full flex items-center justify-center select-none touch-none ${j ? "bg-red-500 text-white animate-pulse ring-2 ring-red-300 scale-110" : "bg-blue-600 text-white"} disabled:opacity-50`,
|
|
3923
3922
|
title: "Hold to talk",
|
|
3924
3923
|
children: /* @__PURE__ */ o.jsx("svg", { className: "h-5 w-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z" }) })
|
|
3925
3924
|
}
|
|
@@ -3943,36 +3942,36 @@ const as = 5e3, On = ({
|
|
|
3943
3942
|
onKeyPress: p,
|
|
3944
3943
|
onInputFocus: d,
|
|
3945
3944
|
onInputBlur: m,
|
|
3946
|
-
chatEndRef:
|
|
3947
|
-
isMuted:
|
|
3948
|
-
onToggleMute:
|
|
3949
|
-
isSpeaking:
|
|
3945
|
+
chatEndRef: S,
|
|
3946
|
+
isMuted: P,
|
|
3947
|
+
onToggleMute: T,
|
|
3948
|
+
isSpeaking: j,
|
|
3950
3949
|
products: R,
|
|
3951
3950
|
servicePackages: g,
|
|
3952
|
-
highlightedPartType:
|
|
3951
|
+
highlightedPartType: E,
|
|
3953
3952
|
highlightedProduct: h,
|
|
3954
3953
|
onProductClick: b,
|
|
3955
|
-
onPackageSelect:
|
|
3956
|
-
isResearching:
|
|
3957
|
-
vehicle:
|
|
3958
|
-
onChangeVehicle:
|
|
3954
|
+
onPackageSelect: y,
|
|
3955
|
+
isResearching: I,
|
|
3956
|
+
vehicle: k,
|
|
3957
|
+
onChangeVehicle: F
|
|
3959
3958
|
}) => {
|
|
3960
|
-
const [
|
|
3959
|
+
const [w, C] = z("center"), [D, A] = z("hidden"), L = R.length > 0 || g.length > 0;
|
|
3961
3960
|
te(() => {
|
|
3962
|
-
if (
|
|
3963
|
-
|
|
3964
|
-
else if (L &&
|
|
3965
|
-
if (
|
|
3966
|
-
|
|
3961
|
+
if (I && D !== "loading" && D !== "visible")
|
|
3962
|
+
A("loading"), w === "center" && C("left");
|
|
3963
|
+
else if (L && D !== "visible")
|
|
3964
|
+
if (w === "center") {
|
|
3965
|
+
C("left"), A("transitioning");
|
|
3967
3966
|
const Ee = setTimeout(() => {
|
|
3968
|
-
|
|
3967
|
+
A("visible");
|
|
3969
3968
|
}, 400);
|
|
3970
3969
|
return () => clearTimeout(Ee);
|
|
3971
3970
|
} else
|
|
3972
|
-
|
|
3973
|
-
else !L && !
|
|
3974
|
-
}, [L,
|
|
3975
|
-
const
|
|
3971
|
+
A("visible");
|
|
3972
|
+
else !L && !I && D !== "hidden" && (A("hidden"), C("center"));
|
|
3973
|
+
}, [L, I, D, w]);
|
|
3974
|
+
const Z = D !== "hidden";
|
|
3976
3975
|
return /* @__PURE__ */ o.jsxs(
|
|
3977
3976
|
"div",
|
|
3978
3977
|
{
|
|
@@ -4012,29 +4011,29 @@ const as = 5e3, On = ({
|
|
|
4012
4011
|
animationState: e,
|
|
4013
4012
|
counterOverlayUrl: s,
|
|
4014
4013
|
counterHeightPercent: a,
|
|
4015
|
-
scale:
|
|
4016
|
-
position:
|
|
4014
|
+
scale: 130,
|
|
4015
|
+
position: w
|
|
4017
4016
|
}
|
|
4018
4017
|
),
|
|
4019
|
-
|
|
4018
|
+
k && /* @__PURE__ */ o.jsx("div", { className: "absolute top-2 left-2 right-2 z-20", children: /* @__PURE__ */ o.jsxs(
|
|
4020
4019
|
"div",
|
|
4021
4020
|
{
|
|
4022
4021
|
className: "bg-white/90 backdrop-blur-sm rounded-lg px-3 py-2 border border-gray-200 shadow-lg flex items-center justify-between",
|
|
4023
4022
|
children: [
|
|
4024
4023
|
/* @__PURE__ */ o.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
4025
4024
|
/* @__PURE__ */ o.jsxs("p", { className: "text-xs font-medium text-gray-900 truncate", children: [
|
|
4026
|
-
|
|
4025
|
+
k.year,
|
|
4027
4026
|
" ",
|
|
4028
|
-
|
|
4027
|
+
k.make,
|
|
4029
4028
|
" ",
|
|
4030
|
-
|
|
4029
|
+
k.model
|
|
4031
4030
|
] }),
|
|
4032
|
-
|
|
4031
|
+
k.rego && /* @__PURE__ */ o.jsx("p", { className: "text-[10px] text-gray-500", children: k.rego })
|
|
4033
4032
|
] }),
|
|
4034
|
-
|
|
4033
|
+
F && /* @__PURE__ */ o.jsx(
|
|
4035
4034
|
"button",
|
|
4036
4035
|
{
|
|
4037
|
-
onClick:
|
|
4036
|
+
onClick: F,
|
|
4038
4037
|
className: "text-xs text-blue-600 hover:underline ml-2 shrink-0",
|
|
4039
4038
|
children: "Change"
|
|
4040
4039
|
}
|
|
@@ -4047,14 +4046,14 @@ const as = 5e3, On = ({
|
|
|
4047
4046
|
{
|
|
4048
4047
|
products: R,
|
|
4049
4048
|
servicePackages: g,
|
|
4050
|
-
highlightedPartType:
|
|
4049
|
+
highlightedPartType: E,
|
|
4051
4050
|
highlightedProduct: h,
|
|
4052
4051
|
onProductClick: b,
|
|
4053
|
-
onPackageSelect:
|
|
4054
|
-
isResearching:
|
|
4055
|
-
visible:
|
|
4052
|
+
onPackageSelect: y,
|
|
4053
|
+
isResearching: I,
|
|
4054
|
+
visible: Z,
|
|
4056
4055
|
counterHeightPercent: a,
|
|
4057
|
-
hasVehicle: !!
|
|
4056
|
+
hasVehicle: !!k
|
|
4058
4057
|
}
|
|
4059
4058
|
),
|
|
4060
4059
|
/* @__PURE__ */ o.jsx(
|
|
@@ -4068,10 +4067,10 @@ const as = 5e3, On = ({
|
|
|
4068
4067
|
onKeyPress: p,
|
|
4069
4068
|
onInputFocus: d,
|
|
4070
4069
|
onInputBlur: m,
|
|
4071
|
-
chatEndRef:
|
|
4072
|
-
isMuted:
|
|
4073
|
-
onToggleMute:
|
|
4074
|
-
isSpeaking:
|
|
4070
|
+
chatEndRef: S,
|
|
4071
|
+
isMuted: P,
|
|
4072
|
+
onToggleMute: T,
|
|
4073
|
+
isSpeaking: j
|
|
4075
4074
|
}
|
|
4076
4075
|
)
|
|
4077
4076
|
]
|
|
@@ -4092,81 +4091,81 @@ const as = 5e3, On = ({
|
|
|
4092
4091
|
const { callbacks: p } = Rt(), {
|
|
4093
4092
|
animationState: d,
|
|
4094
4093
|
setAnimationState: m,
|
|
4095
|
-
getCurrentImage:
|
|
4096
|
-
availableStates:
|
|
4097
|
-
isLoading:
|
|
4098
|
-
} = Mn(), { activeBackdrop:
|
|
4094
|
+
getCurrentImage: S,
|
|
4095
|
+
availableStates: P,
|
|
4096
|
+
isLoading: T
|
|
4097
|
+
} = Mn(), { activeBackdrop: j } = An(), [R, g] = z([]), [E, h] = z([]), [b, y] = z(null), [I, k] = z(null), [F, w] = z(!1), C = Nn({
|
|
4099
4098
|
setAnimationState: m,
|
|
4100
4099
|
manualMode: !1,
|
|
4101
4100
|
onReadyToSpeak: () => {
|
|
4102
4101
|
console.log("[BobWidget] Ready to speak");
|
|
4103
4102
|
},
|
|
4104
4103
|
onStreamComplete: () => {
|
|
4105
|
-
m(
|
|
4104
|
+
m(P.find((B) => B.includes("idle")) || "idle");
|
|
4106
4105
|
},
|
|
4107
4106
|
onResearchStart: () => {
|
|
4108
|
-
|
|
4107
|
+
w(!0);
|
|
4109
4108
|
},
|
|
4110
4109
|
onHighlightPart: (B) => {
|
|
4111
|
-
|
|
4110
|
+
y(B), setTimeout(() => y(null), 8e3);
|
|
4112
4111
|
},
|
|
4113
4112
|
onHighlightProduct: (B) => {
|
|
4114
|
-
|
|
4113
|
+
k(B), setTimeout(() => k(null), 8e3);
|
|
4115
4114
|
},
|
|
4116
4115
|
onAutoFetchComplete: () => {
|
|
4117
|
-
|
|
4116
|
+
w(!1);
|
|
4118
4117
|
}
|
|
4119
4118
|
});
|
|
4120
4119
|
te(() => {
|
|
4121
|
-
const B = p.onPartsFound,
|
|
4122
|
-
return p.onPartsFound = (
|
|
4123
|
-
|
|
4124
|
-
const $e =
|
|
4125
|
-
id:
|
|
4126
|
-
name:
|
|
4127
|
-
brand:
|
|
4128
|
-
price:
|
|
4129
|
-
sku:
|
|
4130
|
-
partNumber:
|
|
4131
|
-
partslotDescription:
|
|
4132
|
-
image_url:
|
|
4120
|
+
const B = p.onPartsFound, oe = p.onServicePackagesFound;
|
|
4121
|
+
return p.onPartsFound = (ge) => {
|
|
4122
|
+
w(!1);
|
|
4123
|
+
const $e = ge.map((Y, nt) => ({
|
|
4124
|
+
id: Y.SKU || Y.sku || `part-${nt}`,
|
|
4125
|
+
name: Y["Part Product Type"] || Y.partslot_description || "Unknown Part",
|
|
4126
|
+
brand: Y.Brand || Y.brand,
|
|
4127
|
+
price: Y["Metro Retail Price"] || Y.price || 0,
|
|
4128
|
+
sku: Y.SKU || Y.sku,
|
|
4129
|
+
partNumber: Y["Part Number"] || Y.part_number,
|
|
4130
|
+
partslotDescription: Y["Part Product Type"] || Y.partslot_description,
|
|
4131
|
+
image_url: Y.image_url
|
|
4133
4132
|
}));
|
|
4134
|
-
g($e), B == null || B(
|
|
4135
|
-
}, p.onServicePackagesFound = (
|
|
4136
|
-
h(
|
|
4133
|
+
g($e), B == null || B(ge);
|
|
4134
|
+
}, p.onServicePackagesFound = (ge) => {
|
|
4135
|
+
h(ge), oe == null || oe(ge);
|
|
4137
4136
|
}, () => {
|
|
4138
|
-
p.onPartsFound = B, p.onServicePackagesFound =
|
|
4137
|
+
p.onPartsFound = B, p.onServicePackagesFound = oe;
|
|
4139
4138
|
};
|
|
4140
4139
|
}, [p]);
|
|
4141
|
-
const
|
|
4140
|
+
const D = a || (j == null ? void 0 : j.image_url), A = c || (j == null ? void 0 : j.counter_overlay_url) || void 0, L = l || (j == null ? void 0 : j.counter_height_percent) || 12, Z = S() || f || "";
|
|
4142
4141
|
if (t === "mobile" || t === "fullscreen")
|
|
4143
4142
|
return /* @__PURE__ */ o.jsx(
|
|
4144
4143
|
qn,
|
|
4145
4144
|
{
|
|
4146
|
-
currentImage:
|
|
4145
|
+
currentImage: Z,
|
|
4147
4146
|
animationState: d,
|
|
4148
|
-
backdropUrl:
|
|
4149
|
-
counterOverlayUrl:
|
|
4147
|
+
backdropUrl: D,
|
|
4148
|
+
counterOverlayUrl: A,
|
|
4150
4149
|
counterHeightPercent: L,
|
|
4151
|
-
messages:
|
|
4152
|
-
input:
|
|
4153
|
-
setInput:
|
|
4154
|
-
isLoading:
|
|
4155
|
-
onSend:
|
|
4156
|
-
onKeyPress:
|
|
4157
|
-
onInputFocus:
|
|
4158
|
-
onInputBlur:
|
|
4159
|
-
chatEndRef:
|
|
4160
|
-
isMuted:
|
|
4161
|
-
onToggleMute:
|
|
4162
|
-
isSpeaking:
|
|
4150
|
+
messages: C.messages,
|
|
4151
|
+
input: C.input,
|
|
4152
|
+
setInput: C.setInput,
|
|
4153
|
+
isLoading: C.isLoading,
|
|
4154
|
+
onSend: C.handleSend,
|
|
4155
|
+
onKeyPress: C.handleKeyPress,
|
|
4156
|
+
onInputFocus: C.handleInputFocus,
|
|
4157
|
+
onInputBlur: C.handleInputBlur,
|
|
4158
|
+
chatEndRef: C.chatEndRef,
|
|
4159
|
+
isMuted: C.isMuted,
|
|
4160
|
+
onToggleMute: C.toggleMute,
|
|
4161
|
+
isSpeaking: C.isSpeaking,
|
|
4163
4162
|
products: R,
|
|
4164
|
-
servicePackages:
|
|
4163
|
+
servicePackages: E,
|
|
4165
4164
|
highlightedPartType: b,
|
|
4166
|
-
highlightedProduct:
|
|
4165
|
+
highlightedProduct: I,
|
|
4167
4166
|
onProductClick: (B) => {
|
|
4168
|
-
var
|
|
4169
|
-
return (
|
|
4167
|
+
var oe;
|
|
4168
|
+
return (oe = p.onAddToCart) == null ? void 0 : oe.call(p, {
|
|
4170
4169
|
product_id: B.id,
|
|
4171
4170
|
product_name: B.name,
|
|
4172
4171
|
quantity: 1,
|
|
@@ -4176,38 +4175,38 @@ const as = 5e3, On = ({
|
|
|
4176
4175
|
});
|
|
4177
4176
|
},
|
|
4178
4177
|
onPackageSelect: (B) => console.log("[BobWidget] Package selected:", B),
|
|
4179
|
-
isResearching:
|
|
4180
|
-
vehicle:
|
|
4178
|
+
isResearching: F,
|
|
4179
|
+
vehicle: C.identifiedVehicle
|
|
4181
4180
|
}
|
|
4182
4181
|
);
|
|
4183
4182
|
if (t === "inline" && r)
|
|
4184
4183
|
return /* @__PURE__ */ o.jsx("div", { className: `relative w-full h-full ${s}`, children: /* @__PURE__ */ o.jsx(
|
|
4185
4184
|
Qn,
|
|
4186
4185
|
{
|
|
4187
|
-
currentImage:
|
|
4186
|
+
currentImage: Z,
|
|
4188
4187
|
animationState: d,
|
|
4189
|
-
backdropUrl:
|
|
4190
|
-
counterOverlayUrl:
|
|
4188
|
+
backdropUrl: D,
|
|
4189
|
+
counterOverlayUrl: A,
|
|
4191
4190
|
counterHeightPercent: L,
|
|
4192
|
-
messages:
|
|
4193
|
-
input:
|
|
4194
|
-
setInput:
|
|
4195
|
-
isLoading:
|
|
4196
|
-
onSend:
|
|
4197
|
-
onKeyPress:
|
|
4198
|
-
onInputFocus:
|
|
4199
|
-
onInputBlur:
|
|
4200
|
-
chatEndRef:
|
|
4201
|
-
isMuted:
|
|
4202
|
-
onToggleMute:
|
|
4203
|
-
isSpeaking:
|
|
4191
|
+
messages: C.messages,
|
|
4192
|
+
input: C.input,
|
|
4193
|
+
setInput: C.setInput,
|
|
4194
|
+
isLoading: C.isLoading,
|
|
4195
|
+
onSend: C.handleSend,
|
|
4196
|
+
onKeyPress: C.handleKeyPress,
|
|
4197
|
+
onInputFocus: C.handleInputFocus,
|
|
4198
|
+
onInputBlur: C.handleInputBlur,
|
|
4199
|
+
chatEndRef: C.chatEndRef,
|
|
4200
|
+
isMuted: C.isMuted,
|
|
4201
|
+
onToggleMute: C.toggleMute,
|
|
4202
|
+
isSpeaking: C.isSpeaking,
|
|
4204
4203
|
products: R,
|
|
4205
|
-
servicePackages:
|
|
4204
|
+
servicePackages: E,
|
|
4206
4205
|
highlightedPartType: b,
|
|
4207
|
-
highlightedProduct:
|
|
4206
|
+
highlightedProduct: I,
|
|
4208
4207
|
onProductClick: (B) => {
|
|
4209
|
-
var
|
|
4210
|
-
return (
|
|
4208
|
+
var oe;
|
|
4209
|
+
return (oe = p.onAddToCart) == null ? void 0 : oe.call(p, {
|
|
4211
4210
|
product_id: B.id,
|
|
4212
4211
|
product_name: B.name,
|
|
4213
4212
|
quantity: 1,
|
|
@@ -4217,8 +4216,8 @@ const as = 5e3, On = ({
|
|
|
4217
4216
|
});
|
|
4218
4217
|
},
|
|
4219
4218
|
onPackageSelect: (B) => console.log("[BobWidget] Package selected:", B),
|
|
4220
|
-
isResearching:
|
|
4221
|
-
vehicle:
|
|
4219
|
+
isResearching: F,
|
|
4220
|
+
vehicle: C.identifiedVehicle
|
|
4222
4221
|
}
|
|
4223
4222
|
) });
|
|
4224
4223
|
const Ee = {
|
|
@@ -4226,13 +4225,13 @@ const as = 5e3, On = ({
|
|
|
4226
4225
|
floating: "fixed bottom-4 right-4 w-96 z-50 shadow-2xl rounded-lg overflow-hidden"
|
|
4227
4226
|
};
|
|
4228
4227
|
return /* @__PURE__ */ o.jsxs("div", { className: `${Ee[t] || ""} ${s}`, children: [
|
|
4229
|
-
|
|
4228
|
+
Z && /* @__PURE__ */ o.jsx(
|
|
4230
4229
|
Ln,
|
|
4231
4230
|
{
|
|
4232
|
-
currentImage:
|
|
4231
|
+
currentImage: Z,
|
|
4233
4232
|
animationState: d,
|
|
4234
|
-
backdropUrl:
|
|
4235
|
-
counterOverlayUrl:
|
|
4233
|
+
backdropUrl: D,
|
|
4234
|
+
counterOverlayUrl: A,
|
|
4236
4235
|
counterHeightPercent: L,
|
|
4237
4236
|
verticalOffset: u,
|
|
4238
4237
|
scale: x
|
|
@@ -4241,18 +4240,18 @@ const as = 5e3, On = ({
|
|
|
4241
4240
|
r && /* @__PURE__ */ o.jsx(
|
|
4242
4241
|
Dn,
|
|
4243
4242
|
{
|
|
4244
|
-
messages:
|
|
4245
|
-
input:
|
|
4246
|
-
setInput:
|
|
4247
|
-
isLoading:
|
|
4248
|
-
onSend:
|
|
4249
|
-
onKeyPress:
|
|
4250
|
-
onInputFocus:
|
|
4251
|
-
onInputBlur:
|
|
4252
|
-
chatEndRef:
|
|
4253
|
-
isMuted:
|
|
4254
|
-
onToggleMute:
|
|
4255
|
-
isSpeaking:
|
|
4243
|
+
messages: C.messages,
|
|
4244
|
+
input: C.input,
|
|
4245
|
+
setInput: C.setInput,
|
|
4246
|
+
isLoading: C.isLoading,
|
|
4247
|
+
onSend: C.handleSend,
|
|
4248
|
+
onKeyPress: C.handleKeyPress,
|
|
4249
|
+
onInputFocus: C.handleInputFocus,
|
|
4250
|
+
onInputBlur: C.handleInputBlur,
|
|
4251
|
+
chatEndRef: C.chatEndRef,
|
|
4252
|
+
isMuted: C.isMuted,
|
|
4253
|
+
onToggleMute: C.toggleMute,
|
|
4254
|
+
isSpeaking: C.isSpeaking
|
|
4256
4255
|
}
|
|
4257
4256
|
)
|
|
4258
4257
|
] });
|
|
@@ -4270,7 +4269,7 @@ const as = 5e3, On = ({
|
|
|
4270
4269
|
counterHeightPercent: p,
|
|
4271
4270
|
defaultBobImage: d,
|
|
4272
4271
|
verticalOffset: m,
|
|
4273
|
-
scale:
|
|
4272
|
+
scale: S
|
|
4274
4273
|
}) => /* @__PURE__ */ o.jsx(
|
|
4275
4274
|
kn,
|
|
4276
4275
|
{
|
|
@@ -4290,7 +4289,7 @@ const as = 5e3, On = ({
|
|
|
4290
4289
|
counterHeightPercent: p,
|
|
4291
4290
|
defaultBobImage: d,
|
|
4292
4291
|
verticalOffset: m,
|
|
4293
|
-
scale:
|
|
4292
|
+
scale: S
|
|
4294
4293
|
}
|
|
4295
4294
|
)
|
|
4296
4295
|
}
|
|
@@ -4299,59 +4298,59 @@ const as = 5e3, On = ({
|
|
|
4299
4298
|
setAnimationState: e,
|
|
4300
4299
|
manualMode: r
|
|
4301
4300
|
}) => {
|
|
4302
|
-
const [s, a] = z("page_load"), [c, l] = z(!1), f = G(null), u =
|
|
4301
|
+
const [s, a] = z("page_load"), [c, l] = z(!1), f = G(null), u = J((b) => t.find((y) => y.chat_trigger === b && y.is_active), [t]), x = J(() => t.find(
|
|
4303
4302
|
(b) => b.chat_trigger === "awaiting_input" || b.state_key === "talk_pause" || b.title.toLowerCase().includes("listen") || b.title.toLowerCase().includes("pause")
|
|
4304
|
-
), [t]), p =
|
|
4303
|
+
), [t]), p = J(() => t.find(
|
|
4305
4304
|
(b) => b.state_key === "idle" || b.title.toLowerCase().includes("idle")
|
|
4306
|
-
), [t]), d =
|
|
4307
|
-
const
|
|
4305
|
+
), [t]), d = J((b) => {
|
|
4306
|
+
const y = t.find((I) => I.state_key === b);
|
|
4308
4307
|
return {
|
|
4309
|
-
speed: (
|
|
4310
|
-
pauseDuration: (
|
|
4311
|
-
loopCount: (
|
|
4308
|
+
speed: (y == null ? void 0 : y.animation_speed) || 400,
|
|
4309
|
+
pauseDuration: (y == null ? void 0 : y.pause_duration) || 0,
|
|
4310
|
+
loopCount: (y == null ? void 0 : y.loop_count) || 0
|
|
4312
4311
|
};
|
|
4313
|
-
}, [t]), m =
|
|
4312
|
+
}, [t]), m = J(() => {
|
|
4314
4313
|
f.current && (clearTimeout(f.current), f.current = null);
|
|
4315
|
-
}, []),
|
|
4314
|
+
}, []), S = J(() => {
|
|
4316
4315
|
m(), !r && (f.current = setTimeout(() => {
|
|
4317
4316
|
const b = p();
|
|
4318
4317
|
b && (a("idle"), e(b.state_key));
|
|
4319
4318
|
}, Kn));
|
|
4320
|
-
}, [r, p, e, m]),
|
|
4319
|
+
}, [r, p, e, m]), P = J((b) => {
|
|
4321
4320
|
if (r) return;
|
|
4322
|
-
const
|
|
4323
|
-
|
|
4324
|
-
}, [r, u, e]),
|
|
4321
|
+
const y = u(b);
|
|
4322
|
+
y && e(y.state_key);
|
|
4323
|
+
}, [r, u, e]), T = J(() => {
|
|
4325
4324
|
if (r) return;
|
|
4326
4325
|
const b = x();
|
|
4327
|
-
b && (a("awaiting_input"), e(b.state_key),
|
|
4328
|
-
}, [r, x, e,
|
|
4329
|
-
c || r || (l(!0), a("page_load"),
|
|
4330
|
-
|
|
4326
|
+
b && (a("awaiting_input"), e(b.state_key), S());
|
|
4327
|
+
}, [r, x, e, S]), j = J(() => {
|
|
4328
|
+
c || r || (l(!0), a("page_load"), P("page_load"), setTimeout(() => {
|
|
4329
|
+
T();
|
|
4331
4330
|
}, 3e3));
|
|
4332
|
-
}, [c, r,
|
|
4333
|
-
m(), a("processing_input"),
|
|
4334
|
-
}, [
|
|
4335
|
-
m(), a("streaming_response"),
|
|
4336
|
-
}, [
|
|
4337
|
-
a("response_complete"),
|
|
4338
|
-
|
|
4331
|
+
}, [c, r, P, T]), R = J(() => {
|
|
4332
|
+
m(), a("processing_input"), P("processing_input");
|
|
4333
|
+
}, [P, m]), g = J(() => {
|
|
4334
|
+
m(), a("streaming_response"), P("streaming_response");
|
|
4335
|
+
}, [P, m]), E = J(() => {
|
|
4336
|
+
a("response_complete"), P("response_complete"), setTimeout(() => {
|
|
4337
|
+
T();
|
|
4339
4338
|
}, 3e3);
|
|
4340
|
-
}, [
|
|
4339
|
+
}, [P, T]), h = J(() => {
|
|
4341
4340
|
a("showing_product");
|
|
4342
4341
|
const b = t.find(
|
|
4343
|
-
(
|
|
4342
|
+
(y) => y.chat_trigger === "showing_product" || y.state_key === "showing_product"
|
|
4344
4343
|
);
|
|
4345
4344
|
b && e(b.state_key), setTimeout(() => {
|
|
4346
|
-
|
|
4345
|
+
T();
|
|
4347
4346
|
}, 4e3);
|
|
4348
|
-
}, [t, e,
|
|
4347
|
+
}, [t, e, T]);
|
|
4349
4348
|
return te(() => () => m(), [m]), {
|
|
4350
4349
|
chatStage: s,
|
|
4351
|
-
initialize:
|
|
4350
|
+
initialize: j,
|
|
4352
4351
|
onUserInput: R,
|
|
4353
4352
|
onStreamStart: g,
|
|
4354
|
-
onStreamComplete:
|
|
4353
|
+
onStreamComplete: E,
|
|
4355
4354
|
onShowingProduct: h,
|
|
4356
4355
|
getStateSettings: d
|
|
4357
4356
|
};
|