@gymmymac/bob-widget 1.0.2 → 1.1.2
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/components/Bob.d.ts +1 -24
- package/dist/components/mobile/MobileBobCharacter.d.ts +12 -0
- package/dist/components/mobile/MobileBobLayout.d.ts +35 -0
- package/dist/components/mobile/MobileChatDrawer.d.ts +19 -0
- package/dist/components/mobile/MobileProductColumn.d.ts +18 -0
- package/dist/components/mobile/index.d.ts +4 -0
- package/dist/hooks/useBobAnimation.d.ts +14 -0
- package/dist/hooks/useBobAnimationData.d.ts +53 -0
- package/dist/hooks/useBobBackdrop.d.ts +17 -0
- package/dist/hooks/useBobStateTransitions.d.ts +22 -0
- package/dist/hooks/useSpeechRecognition.d.ts +18 -0
- package/dist/index.d.ts +11 -30
- package/dist/index.js +13 -13
- package/dist/index.mjs +2305 -788
- package/dist/types/product.d.ts +12 -1
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var sr = (e) => {
|
|
2
|
+
throw TypeError(e);
|
|
3
|
+
};
|
|
4
|
+
var $t = (e, t, s) => t.has(e) || sr("Cannot " + s);
|
|
5
|
+
var o = (e, t, s) => ($t(e, t, "read from private field"), s ? s.call(e) : t.get(e)), z = (e, t, s) => t.has(e) ? sr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), F = (e, t, s, n) => ($t(e, t, "write to private field"), n ? n.call(e, s) : t.set(e, s), s), Z = (e, t, s) => ($t(e, t, "access private method"), s);
|
|
6
|
+
import * as we from "react";
|
|
7
|
+
import Tt, { createContext as Lr, useMemo as Ft, useContext as Mr, useState as Q, useRef as H, useEffect as se, useCallback as G } from "react";
|
|
8
|
+
import { createClient as Fr } from "@supabase/supabase-js";
|
|
9
|
+
var Wt = { exports: {} }, wt = {};
|
|
4
10
|
/**
|
|
5
11
|
* @license React
|
|
6
12
|
* react-jsx-runtime.production.min.js
|
|
@@ -10,21 +16,21 @@ var sr = { exports: {} }, Je = {};
|
|
|
10
16
|
* This source code is licensed under the MIT license found in the
|
|
11
17
|
* LICENSE file in the root directory of this source tree.
|
|
12
18
|
*/
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
for (
|
|
22
|
-
if (
|
|
23
|
-
return { $$typeof:
|
|
19
|
+
var nr;
|
|
20
|
+
function Br() {
|
|
21
|
+
if (nr) return wt;
|
|
22
|
+
nr = 1;
|
|
23
|
+
var e = Tt, t = Symbol.for("react.element"), s = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
24
|
+
function u(g, d, y) {
|
|
25
|
+
var h, l = {}, v = null, w = null;
|
|
26
|
+
y !== void 0 && (v = "" + y), d.key !== void 0 && (v = "" + d.key), d.ref !== void 0 && (w = d.ref);
|
|
27
|
+
for (h in d) n.call(d, h) && !f.hasOwnProperty(h) && (l[h] = d[h]);
|
|
28
|
+
if (g && g.defaultProps) for (h in d = g.defaultProps, d) l[h] === void 0 && (l[h] = d[h]);
|
|
29
|
+
return { $$typeof: t, type: g, key: v, ref: w, props: l, _owner: i.current };
|
|
24
30
|
}
|
|
25
|
-
return
|
|
31
|
+
return wt.Fragment = s, wt.jsx = u, wt.jsxs = u, wt;
|
|
26
32
|
}
|
|
27
|
-
var
|
|
33
|
+
var Et = {};
|
|
28
34
|
/**
|
|
29
35
|
* @license React
|
|
30
36
|
* react-jsx-runtime.development.js
|
|
@@ -34,91 +40,91 @@ var Ge = {};
|
|
|
34
40
|
* This source code is licensed under the MIT license found in the
|
|
35
41
|
* LICENSE file in the root directory of this source tree.
|
|
36
42
|
*/
|
|
37
|
-
var
|
|
38
|
-
function
|
|
39
|
-
return
|
|
40
|
-
var
|
|
41
|
-
function
|
|
42
|
-
if (
|
|
43
|
+
var ir;
|
|
44
|
+
function Ar() {
|
|
45
|
+
return ir || (ir = 1, process.env.NODE_ENV !== "production" && function() {
|
|
46
|
+
var e = Tt, t = Symbol.for("react.element"), s = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), g = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), l = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), k = Symbol.iterator, N = "@@iterator";
|
|
47
|
+
function _(r) {
|
|
48
|
+
if (r === null || typeof r != "object")
|
|
43
49
|
return null;
|
|
44
|
-
var
|
|
45
|
-
return typeof
|
|
50
|
+
var c = k && r[k] || r[N];
|
|
51
|
+
return typeof c == "function" ? c : null;
|
|
46
52
|
}
|
|
47
|
-
var
|
|
48
|
-
function
|
|
53
|
+
var I = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
54
|
+
function p(r) {
|
|
49
55
|
{
|
|
50
|
-
for (var
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
for (var c = arguments.length, x = new Array(c > 1 ? c - 1 : 0), O = 1; O < c; O++)
|
|
57
|
+
x[O - 1] = arguments[O];
|
|
58
|
+
E("error", r, x);
|
|
53
59
|
}
|
|
54
60
|
}
|
|
55
|
-
function
|
|
61
|
+
function E(r, c, x) {
|
|
56
62
|
{
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
var
|
|
60
|
-
return String(
|
|
63
|
+
var O = I.ReactDebugCurrentFrame, W = O.getStackAddendum();
|
|
64
|
+
W !== "" && (c += "%s", x = x.concat([W]));
|
|
65
|
+
var q = x.map(function($) {
|
|
66
|
+
return String($);
|
|
61
67
|
});
|
|
62
|
-
|
|
68
|
+
q.unshift("Warning: " + c), Function.prototype.apply.call(console[r], console, q);
|
|
63
69
|
}
|
|
64
70
|
}
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
function
|
|
68
|
-
return !!(typeof
|
|
71
|
+
var T = !1, b = !1, m = !1, S = !1, C = !1, P;
|
|
72
|
+
P = Symbol.for("react.module.reference");
|
|
73
|
+
function j(r) {
|
|
74
|
+
return !!(typeof r == "string" || typeof r == "function" || r === n || r === f || C || r === i || r === y || r === h || S || r === w || T || b || m || typeof r == "object" && r !== null && (r.$$typeof === v || r.$$typeof === l || r.$$typeof === u || r.$$typeof === g || r.$$typeof === d || // This needs to include all possible module reference object
|
|
69
75
|
// types supported by any Flight configuration anywhere since
|
|
70
76
|
// we don't know which Flight build this will end up being used
|
|
71
77
|
// with.
|
|
72
|
-
|
|
78
|
+
r.$$typeof === P || r.getModuleId !== void 0));
|
|
73
79
|
}
|
|
74
|
-
function
|
|
75
|
-
var
|
|
76
|
-
if (
|
|
77
|
-
return
|
|
78
|
-
var
|
|
79
|
-
return
|
|
80
|
+
function R(r, c, x) {
|
|
81
|
+
var O = r.displayName;
|
|
82
|
+
if (O)
|
|
83
|
+
return O;
|
|
84
|
+
var W = c.displayName || c.name || "";
|
|
85
|
+
return W !== "" ? x + "(" + W + ")" : x;
|
|
80
86
|
}
|
|
81
|
-
function
|
|
82
|
-
return
|
|
87
|
+
function M(r) {
|
|
88
|
+
return r.displayName || "Context";
|
|
83
89
|
}
|
|
84
|
-
function
|
|
85
|
-
if (
|
|
90
|
+
function A(r) {
|
|
91
|
+
if (r == null)
|
|
86
92
|
return null;
|
|
87
|
-
if (typeof
|
|
88
|
-
return
|
|
89
|
-
if (typeof
|
|
90
|
-
return
|
|
91
|
-
switch (
|
|
92
|
-
case
|
|
93
|
+
if (typeof r.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
|
94
|
+
return r.displayName || r.name || null;
|
|
95
|
+
if (typeof r == "string")
|
|
96
|
+
return r;
|
|
97
|
+
switch (r) {
|
|
98
|
+
case n:
|
|
93
99
|
return "Fragment";
|
|
94
|
-
case
|
|
100
|
+
case s:
|
|
95
101
|
return "Portal";
|
|
96
|
-
case
|
|
102
|
+
case f:
|
|
97
103
|
return "Profiler";
|
|
98
|
-
case
|
|
104
|
+
case i:
|
|
99
105
|
return "StrictMode";
|
|
100
|
-
case
|
|
106
|
+
case y:
|
|
101
107
|
return "Suspense";
|
|
102
|
-
case
|
|
108
|
+
case h:
|
|
103
109
|
return "SuspenseList";
|
|
104
110
|
}
|
|
105
|
-
if (typeof
|
|
106
|
-
switch (
|
|
107
|
-
case
|
|
108
|
-
var
|
|
109
|
-
return
|
|
111
|
+
if (typeof r == "object")
|
|
112
|
+
switch (r.$$typeof) {
|
|
113
|
+
case g:
|
|
114
|
+
var c = r;
|
|
115
|
+
return M(c) + ".Consumer";
|
|
116
|
+
case u:
|
|
117
|
+
var x = r;
|
|
118
|
+
return M(x._context) + ".Provider";
|
|
119
|
+
case d:
|
|
120
|
+
return R(r, r.render, "ForwardRef");
|
|
110
121
|
case l:
|
|
111
|
-
var
|
|
112
|
-
return
|
|
113
|
-
case
|
|
114
|
-
|
|
115
|
-
case s:
|
|
116
|
-
var a = e.displayName || null;
|
|
117
|
-
return a !== null ? a : D(e.type) || "Memo";
|
|
118
|
-
case b: {
|
|
119
|
-
var v = e, m = v._payload, d = v._init;
|
|
122
|
+
var O = r.displayName || null;
|
|
123
|
+
return O !== null ? O : A(r.type) || "Memo";
|
|
124
|
+
case v: {
|
|
125
|
+
var W = r, q = W._payload, $ = W._init;
|
|
120
126
|
try {
|
|
121
|
-
return
|
|
127
|
+
return A($(q));
|
|
122
128
|
} catch {
|
|
123
129
|
return null;
|
|
124
130
|
}
|
|
@@ -126,636 +132,636 @@ function _r() {
|
|
|
126
132
|
}
|
|
127
133
|
return null;
|
|
128
134
|
}
|
|
129
|
-
var
|
|
130
|
-
function
|
|
135
|
+
var L = Object.assign, te = 0, Re, K, oe, ue, je, J, Ae;
|
|
136
|
+
function kt() {
|
|
131
137
|
}
|
|
132
|
-
|
|
133
|
-
function
|
|
138
|
+
kt.__reactDisabledLog = !0;
|
|
139
|
+
function pe() {
|
|
134
140
|
{
|
|
135
|
-
if (
|
|
136
|
-
|
|
137
|
-
var
|
|
141
|
+
if (te === 0) {
|
|
142
|
+
Re = console.log, K = console.info, oe = console.warn, ue = console.error, je = console.group, J = console.groupCollapsed, Ae = console.groupEnd;
|
|
143
|
+
var r = {
|
|
138
144
|
configurable: !0,
|
|
139
145
|
enumerable: !0,
|
|
140
|
-
value:
|
|
146
|
+
value: kt,
|
|
141
147
|
writable: !0
|
|
142
148
|
};
|
|
143
149
|
Object.defineProperties(console, {
|
|
144
|
-
info:
|
|
145
|
-
log:
|
|
146
|
-
warn:
|
|
147
|
-
error:
|
|
148
|
-
group:
|
|
149
|
-
groupCollapsed:
|
|
150
|
-
groupEnd:
|
|
150
|
+
info: r,
|
|
151
|
+
log: r,
|
|
152
|
+
warn: r,
|
|
153
|
+
error: r,
|
|
154
|
+
group: r,
|
|
155
|
+
groupCollapsed: r,
|
|
156
|
+
groupEnd: r
|
|
151
157
|
});
|
|
152
158
|
}
|
|
153
|
-
|
|
159
|
+
te++;
|
|
154
160
|
}
|
|
155
161
|
}
|
|
156
|
-
function
|
|
162
|
+
function Bt() {
|
|
157
163
|
{
|
|
158
|
-
if (
|
|
159
|
-
var
|
|
164
|
+
if (te--, te === 0) {
|
|
165
|
+
var r = {
|
|
160
166
|
configurable: !0,
|
|
161
167
|
enumerable: !0,
|
|
162
168
|
writable: !0
|
|
163
169
|
};
|
|
164
170
|
Object.defineProperties(console, {
|
|
165
|
-
log:
|
|
166
|
-
value:
|
|
171
|
+
log: L({}, r, {
|
|
172
|
+
value: Re
|
|
167
173
|
}),
|
|
168
|
-
info:
|
|
169
|
-
value:
|
|
174
|
+
info: L({}, r, {
|
|
175
|
+
value: K
|
|
170
176
|
}),
|
|
171
|
-
warn:
|
|
172
|
-
value:
|
|
177
|
+
warn: L({}, r, {
|
|
178
|
+
value: oe
|
|
173
179
|
}),
|
|
174
|
-
error:
|
|
175
|
-
value:
|
|
180
|
+
error: L({}, r, {
|
|
181
|
+
value: ue
|
|
176
182
|
}),
|
|
177
|
-
group:
|
|
178
|
-
value:
|
|
183
|
+
group: L({}, r, {
|
|
184
|
+
value: je
|
|
179
185
|
}),
|
|
180
|
-
groupCollapsed:
|
|
181
|
-
value:
|
|
186
|
+
groupCollapsed: L({}, r, {
|
|
187
|
+
value: J
|
|
182
188
|
}),
|
|
183
|
-
groupEnd:
|
|
184
|
-
value:
|
|
189
|
+
groupEnd: L({}, r, {
|
|
190
|
+
value: Ae
|
|
185
191
|
})
|
|
186
192
|
});
|
|
187
193
|
}
|
|
188
|
-
|
|
194
|
+
te < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
189
195
|
}
|
|
190
196
|
}
|
|
191
|
-
var
|
|
192
|
-
function
|
|
197
|
+
var tt = I.ReactCurrentDispatcher, Ot;
|
|
198
|
+
function pt(r, c, x) {
|
|
193
199
|
{
|
|
194
|
-
if (
|
|
200
|
+
if (Ot === void 0)
|
|
195
201
|
try {
|
|
196
202
|
throw Error();
|
|
197
|
-
} catch (
|
|
198
|
-
var
|
|
199
|
-
|
|
203
|
+
} catch (W) {
|
|
204
|
+
var O = W.stack.trim().match(/\n( *(at )?)/);
|
|
205
|
+
Ot = O && O[1] || "";
|
|
200
206
|
}
|
|
201
207
|
return `
|
|
202
|
-
` +
|
|
208
|
+
` + Ot + r;
|
|
203
209
|
}
|
|
204
210
|
}
|
|
205
|
-
var
|
|
211
|
+
var It = !1, gt;
|
|
206
212
|
{
|
|
207
|
-
var
|
|
208
|
-
|
|
213
|
+
var rr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
214
|
+
gt = new rr();
|
|
209
215
|
}
|
|
210
|
-
function
|
|
211
|
-
if (!
|
|
216
|
+
function At(r, c) {
|
|
217
|
+
if (!r || It)
|
|
212
218
|
return "";
|
|
213
219
|
{
|
|
214
|
-
var
|
|
215
|
-
if (
|
|
216
|
-
return
|
|
220
|
+
var x = gt.get(r);
|
|
221
|
+
if (x !== void 0)
|
|
222
|
+
return x;
|
|
217
223
|
}
|
|
218
|
-
var
|
|
219
|
-
|
|
220
|
-
var
|
|
224
|
+
var O;
|
|
225
|
+
It = !0;
|
|
226
|
+
var W = Error.prepareStackTrace;
|
|
221
227
|
Error.prepareStackTrace = void 0;
|
|
222
|
-
var
|
|
223
|
-
|
|
228
|
+
var q;
|
|
229
|
+
q = tt.current, tt.current = null, pe();
|
|
224
230
|
try {
|
|
225
|
-
if (
|
|
226
|
-
var
|
|
231
|
+
if (c) {
|
|
232
|
+
var $ = function() {
|
|
227
233
|
throw Error();
|
|
228
234
|
};
|
|
229
|
-
if (Object.defineProperty(
|
|
235
|
+
if (Object.defineProperty($.prototype, "props", {
|
|
230
236
|
set: function() {
|
|
231
237
|
throw Error();
|
|
232
238
|
}
|
|
233
239
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
234
240
|
try {
|
|
235
|
-
Reflect.construct(
|
|
236
|
-
} catch (
|
|
237
|
-
|
|
241
|
+
Reflect.construct($, []);
|
|
242
|
+
} catch (ce) {
|
|
243
|
+
O = ce;
|
|
238
244
|
}
|
|
239
|
-
Reflect.construct(
|
|
245
|
+
Reflect.construct(r, [], $);
|
|
240
246
|
} else {
|
|
241
247
|
try {
|
|
242
|
-
|
|
243
|
-
} catch (
|
|
244
|
-
|
|
248
|
+
$.call();
|
|
249
|
+
} catch (ce) {
|
|
250
|
+
O = ce;
|
|
245
251
|
}
|
|
246
|
-
|
|
252
|
+
r.call($.prototype);
|
|
247
253
|
}
|
|
248
254
|
} else {
|
|
249
255
|
try {
|
|
250
256
|
throw Error();
|
|
251
|
-
} catch (
|
|
252
|
-
|
|
257
|
+
} catch (ce) {
|
|
258
|
+
O = ce;
|
|
253
259
|
}
|
|
254
|
-
|
|
260
|
+
r();
|
|
255
261
|
}
|
|
256
|
-
} catch (
|
|
257
|
-
if (
|
|
258
|
-
for (var
|
|
259
|
-
`),
|
|
260
|
-
`),
|
|
261
|
-
|
|
262
|
-
for (;
|
|
263
|
-
if (
|
|
264
|
-
if (
|
|
262
|
+
} catch (ce) {
|
|
263
|
+
if (ce && O && typeof ce.stack == "string") {
|
|
264
|
+
for (var B = ce.stack.split(`
|
|
265
|
+
`), ie = O.stack.split(`
|
|
266
|
+
`), Y = B.length - 1, X = ie.length - 1; Y >= 1 && X >= 0 && B[Y] !== ie[X]; )
|
|
267
|
+
X--;
|
|
268
|
+
for (; Y >= 1 && X >= 0; Y--, X--)
|
|
269
|
+
if (B[Y] !== ie[X]) {
|
|
270
|
+
if (Y !== 1 || X !== 1)
|
|
265
271
|
do
|
|
266
|
-
if (
|
|
267
|
-
var
|
|
268
|
-
` +
|
|
269
|
-
return
|
|
272
|
+
if (Y--, X--, X < 0 || B[Y] !== ie[X]) {
|
|
273
|
+
var he = `
|
|
274
|
+
` + B[Y].replace(" at new ", " at ");
|
|
275
|
+
return r.displayName && he.includes("<anonymous>") && (he = he.replace("<anonymous>", r.displayName)), typeof r == "function" && gt.set(r, he), he;
|
|
270
276
|
}
|
|
271
|
-
while (
|
|
277
|
+
while (Y >= 1 && X >= 0);
|
|
272
278
|
break;
|
|
273
279
|
}
|
|
274
280
|
}
|
|
275
281
|
} finally {
|
|
276
|
-
|
|
282
|
+
It = !1, tt.current = q, Bt(), Error.prepareStackTrace = W;
|
|
277
283
|
}
|
|
278
|
-
var
|
|
279
|
-
return typeof
|
|
284
|
+
var at = r ? r.displayName || r.name : "", He = at ? pt(at) : "";
|
|
285
|
+
return typeof r == "function" && gt.set(r, He), He;
|
|
280
286
|
}
|
|
281
|
-
function
|
|
282
|
-
return
|
|
287
|
+
function Nt(r, c, x) {
|
|
288
|
+
return At(r, !1);
|
|
283
289
|
}
|
|
284
|
-
function
|
|
285
|
-
var
|
|
286
|
-
return !!(
|
|
290
|
+
function Pt(r) {
|
|
291
|
+
var c = r.prototype;
|
|
292
|
+
return !!(c && c.isReactComponent);
|
|
287
293
|
}
|
|
288
|
-
function
|
|
289
|
-
if (
|
|
294
|
+
function De(r, c, x) {
|
|
295
|
+
if (r == null)
|
|
290
296
|
return "";
|
|
291
|
-
if (typeof
|
|
292
|
-
return
|
|
293
|
-
if (typeof
|
|
294
|
-
return
|
|
295
|
-
switch (
|
|
297
|
+
if (typeof r == "function")
|
|
298
|
+
return At(r, Pt(r));
|
|
299
|
+
if (typeof r == "string")
|
|
300
|
+
return pt(r);
|
|
301
|
+
switch (r) {
|
|
302
|
+
case y:
|
|
303
|
+
return pt("Suspense");
|
|
296
304
|
case h:
|
|
297
|
-
return
|
|
298
|
-
case o:
|
|
299
|
-
return Ne("SuspenseList");
|
|
305
|
+
return pt("SuspenseList");
|
|
300
306
|
}
|
|
301
|
-
if (typeof
|
|
302
|
-
switch (
|
|
303
|
-
case
|
|
304
|
-
return
|
|
305
|
-
case
|
|
306
|
-
return
|
|
307
|
-
case
|
|
308
|
-
var
|
|
307
|
+
if (typeof r == "object")
|
|
308
|
+
switch (r.$$typeof) {
|
|
309
|
+
case d:
|
|
310
|
+
return Nt(r.render);
|
|
311
|
+
case l:
|
|
312
|
+
return De(r.type, c, x);
|
|
313
|
+
case v: {
|
|
314
|
+
var O = r, W = O._payload, q = O._init;
|
|
309
315
|
try {
|
|
310
|
-
return
|
|
316
|
+
return De(q(W), c, x);
|
|
311
317
|
} catch {
|
|
312
318
|
}
|
|
313
319
|
}
|
|
314
320
|
}
|
|
315
321
|
return "";
|
|
316
322
|
}
|
|
317
|
-
var
|
|
318
|
-
function
|
|
319
|
-
if (
|
|
320
|
-
var
|
|
321
|
-
|
|
323
|
+
var ke = Object.prototype.hasOwnProperty, D = {}, ee = I.ReactDebugCurrentFrame;
|
|
324
|
+
function ne(r) {
|
|
325
|
+
if (r) {
|
|
326
|
+
var c = r._owner, x = De(r.type, r._source, c ? c.type : null);
|
|
327
|
+
ee.setExtraStackFrame(x);
|
|
322
328
|
} else
|
|
323
|
-
|
|
329
|
+
ee.setExtraStackFrame(null);
|
|
324
330
|
}
|
|
325
|
-
function
|
|
331
|
+
function rt(r, c, x, O, W) {
|
|
326
332
|
{
|
|
327
|
-
var
|
|
328
|
-
for (var
|
|
329
|
-
if (
|
|
330
|
-
var
|
|
333
|
+
var q = Function.call.bind(ke);
|
|
334
|
+
for (var $ in r)
|
|
335
|
+
if (q(r, $)) {
|
|
336
|
+
var B = void 0;
|
|
331
337
|
try {
|
|
332
|
-
if (typeof
|
|
333
|
-
var
|
|
334
|
-
throw
|
|
338
|
+
if (typeof r[$] != "function") {
|
|
339
|
+
var ie = Error((O || "React class") + ": " + x + " type `" + $ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[$] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
340
|
+
throw ie.name = "Invariant Violation", ie;
|
|
335
341
|
}
|
|
336
|
-
|
|
337
|
-
} catch (
|
|
338
|
-
|
|
342
|
+
B = r[$](c, $, O, x, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
343
|
+
} catch (Y) {
|
|
344
|
+
B = Y;
|
|
339
345
|
}
|
|
340
|
-
|
|
346
|
+
B && !(B instanceof Error) && (ne(W), p("%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).", O || "React class", x, $, typeof B), ne(null)), B instanceof Error && !(B.message in D) && (D[B.message] = !0, ne(W), p("Failed %s type: %s", x, B.message), ne(null));
|
|
341
347
|
}
|
|
342
348
|
}
|
|
343
349
|
}
|
|
344
|
-
var
|
|
345
|
-
function
|
|
346
|
-
return
|
|
350
|
+
var st = Array.isArray;
|
|
351
|
+
function Ue(r) {
|
|
352
|
+
return st(r);
|
|
347
353
|
}
|
|
348
|
-
function
|
|
354
|
+
function $e(r) {
|
|
349
355
|
{
|
|
350
|
-
var
|
|
351
|
-
return
|
|
356
|
+
var c = typeof Symbol == "function" && Symbol.toStringTag, x = c && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
|
357
|
+
return x;
|
|
352
358
|
}
|
|
353
359
|
}
|
|
354
|
-
function
|
|
360
|
+
function We(r) {
|
|
355
361
|
try {
|
|
356
|
-
return
|
|
362
|
+
return Ve(r), !1;
|
|
357
363
|
} catch {
|
|
358
364
|
return !0;
|
|
359
365
|
}
|
|
360
366
|
}
|
|
361
|
-
function
|
|
362
|
-
return "" +
|
|
367
|
+
function Ve(r) {
|
|
368
|
+
return "" + r;
|
|
363
369
|
}
|
|
364
|
-
function
|
|
365
|
-
if (
|
|
366
|
-
return
|
|
370
|
+
function Oe(r) {
|
|
371
|
+
if (We(r))
|
|
372
|
+
return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", $e(r)), Ve(r);
|
|
367
373
|
}
|
|
368
|
-
var
|
|
374
|
+
var Ie = I.ReactCurrentOwner, ge = {
|
|
369
375
|
key: !0,
|
|
370
376
|
ref: !0,
|
|
371
377
|
__self: !0,
|
|
372
378
|
__source: !0
|
|
373
|
-
},
|
|
374
|
-
function
|
|
375
|
-
if (
|
|
376
|
-
var
|
|
377
|
-
if (
|
|
379
|
+
}, Ke, qe;
|
|
380
|
+
function Ee(r) {
|
|
381
|
+
if (ke.call(r, "ref")) {
|
|
382
|
+
var c = Object.getOwnPropertyDescriptor(r, "ref").get;
|
|
383
|
+
if (c && c.isReactWarning)
|
|
378
384
|
return !1;
|
|
379
385
|
}
|
|
380
|
-
return
|
|
386
|
+
return r.ref !== void 0;
|
|
381
387
|
}
|
|
382
|
-
function
|
|
383
|
-
if (
|
|
384
|
-
var
|
|
385
|
-
if (
|
|
388
|
+
function be(r) {
|
|
389
|
+
if (ke.call(r, "key")) {
|
|
390
|
+
var c = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
391
|
+
if (c && c.isReactWarning)
|
|
386
392
|
return !1;
|
|
387
393
|
}
|
|
388
|
-
return
|
|
394
|
+
return r.key !== void 0;
|
|
389
395
|
}
|
|
390
|
-
function
|
|
391
|
-
typeof
|
|
396
|
+
function Se(r, c) {
|
|
397
|
+
typeof r.ref == "string" && Ie.current;
|
|
392
398
|
}
|
|
393
|
-
function
|
|
399
|
+
function ze(r, c) {
|
|
394
400
|
{
|
|
395
|
-
var
|
|
396
|
-
|
|
401
|
+
var x = function() {
|
|
402
|
+
Ke || (Ke = !0, p("%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)", c));
|
|
397
403
|
};
|
|
398
|
-
|
|
399
|
-
get:
|
|
404
|
+
x.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
405
|
+
get: x,
|
|
400
406
|
configurable: !0
|
|
401
407
|
});
|
|
402
408
|
}
|
|
403
409
|
}
|
|
404
|
-
function
|
|
410
|
+
function me(r, c) {
|
|
405
411
|
{
|
|
406
|
-
var
|
|
407
|
-
|
|
412
|
+
var x = function() {
|
|
413
|
+
qe || (qe = !0, p("%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)", c));
|
|
408
414
|
};
|
|
409
|
-
|
|
410
|
-
get:
|
|
415
|
+
x.isReactWarning = !0, Object.defineProperty(r, "ref", {
|
|
416
|
+
get: x,
|
|
411
417
|
configurable: !0
|
|
412
418
|
});
|
|
413
419
|
}
|
|
414
420
|
}
|
|
415
|
-
var
|
|
416
|
-
var
|
|
421
|
+
var de = function(r, c, x, O, W, q, $) {
|
|
422
|
+
var B = {
|
|
417
423
|
// This tag allows us to uniquely identify this as a React Element
|
|
418
|
-
$$typeof:
|
|
424
|
+
$$typeof: t,
|
|
419
425
|
// Built-in properties that belong on the element
|
|
420
|
-
type:
|
|
421
|
-
key:
|
|
422
|
-
ref:
|
|
423
|
-
props:
|
|
426
|
+
type: r,
|
|
427
|
+
key: c,
|
|
428
|
+
ref: x,
|
|
429
|
+
props: $,
|
|
424
430
|
// Record the component responsible for creating this element.
|
|
425
|
-
_owner:
|
|
431
|
+
_owner: q
|
|
426
432
|
};
|
|
427
|
-
return
|
|
433
|
+
return B._store = {}, Object.defineProperty(B._store, "validated", {
|
|
428
434
|
configurable: !1,
|
|
429
435
|
enumerable: !1,
|
|
430
436
|
writable: !0,
|
|
431
437
|
value: !1
|
|
432
|
-
}), Object.defineProperty(
|
|
438
|
+
}), Object.defineProperty(B, "_self", {
|
|
433
439
|
configurable: !1,
|
|
434
440
|
enumerable: !1,
|
|
435
441
|
writable: !1,
|
|
436
|
-
value:
|
|
437
|
-
}), Object.defineProperty(
|
|
442
|
+
value: O
|
|
443
|
+
}), Object.defineProperty(B, "_source", {
|
|
438
444
|
configurable: !1,
|
|
439
445
|
enumerable: !1,
|
|
440
446
|
writable: !1,
|
|
441
|
-
value:
|
|
442
|
-
}), Object.freeze && (Object.freeze(
|
|
447
|
+
value: W
|
|
448
|
+
}), Object.freeze && (Object.freeze(B.props), Object.freeze(B)), B;
|
|
443
449
|
};
|
|
444
|
-
function
|
|
450
|
+
function ve(r, c, x, O, W) {
|
|
445
451
|
{
|
|
446
|
-
var
|
|
447
|
-
|
|
448
|
-
for (
|
|
449
|
-
|
|
450
|
-
if (
|
|
451
|
-
var
|
|
452
|
-
for (
|
|
453
|
-
|
|
452
|
+
var q, $ = {}, B = null, ie = null;
|
|
453
|
+
x !== void 0 && (Oe(x), B = "" + x), be(c) && (Oe(c.key), B = "" + c.key), Ee(c) && (ie = c.ref, Se(c, W));
|
|
454
|
+
for (q in c)
|
|
455
|
+
ke.call(c, q) && !ge.hasOwnProperty(q) && ($[q] = c[q]);
|
|
456
|
+
if (r && r.defaultProps) {
|
|
457
|
+
var Y = r.defaultProps;
|
|
458
|
+
for (q in Y)
|
|
459
|
+
$[q] === void 0 && ($[q] = Y[q]);
|
|
454
460
|
}
|
|
455
|
-
if (
|
|
456
|
-
var
|
|
457
|
-
|
|
461
|
+
if (B || ie) {
|
|
462
|
+
var X = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
463
|
+
B && ze($, X), ie && me($, X);
|
|
458
464
|
}
|
|
459
|
-
return
|
|
465
|
+
return de(r, B, ie, W, O, Ie.current, $);
|
|
460
466
|
}
|
|
461
467
|
}
|
|
462
|
-
var
|
|
463
|
-
function
|
|
464
|
-
if (
|
|
465
|
-
var
|
|
466
|
-
|
|
468
|
+
var _e = I.ReactCurrentOwner, bt = I.ReactDebugCurrentFrame;
|
|
469
|
+
function Ne(r) {
|
|
470
|
+
if (r) {
|
|
471
|
+
var c = r._owner, x = De(r.type, r._source, c ? c.type : null);
|
|
472
|
+
bt.setExtraStackFrame(x);
|
|
467
473
|
} else
|
|
468
|
-
|
|
474
|
+
bt.setExtraStackFrame(null);
|
|
469
475
|
}
|
|
470
|
-
var
|
|
471
|
-
|
|
472
|
-
function
|
|
473
|
-
return typeof
|
|
476
|
+
var nt;
|
|
477
|
+
nt = !1;
|
|
478
|
+
function fe(r) {
|
|
479
|
+
return typeof r == "object" && r !== null && r.$$typeof === t;
|
|
474
480
|
}
|
|
475
|
-
function
|
|
481
|
+
function Pe() {
|
|
476
482
|
{
|
|
477
|
-
if (
|
|
478
|
-
var
|
|
479
|
-
if (
|
|
483
|
+
if (_e.current) {
|
|
484
|
+
var r = A(_e.current.type);
|
|
485
|
+
if (r)
|
|
480
486
|
return `
|
|
481
487
|
|
|
482
|
-
Check the render method of \`` +
|
|
488
|
+
Check the render method of \`` + r + "`.";
|
|
483
489
|
}
|
|
484
490
|
return "";
|
|
485
491
|
}
|
|
486
492
|
}
|
|
487
|
-
function
|
|
493
|
+
function mt(r) {
|
|
488
494
|
return "";
|
|
489
495
|
}
|
|
490
|
-
var
|
|
491
|
-
function
|
|
496
|
+
var ye = {};
|
|
497
|
+
function Lt(r) {
|
|
492
498
|
{
|
|
493
|
-
var
|
|
494
|
-
if (!
|
|
495
|
-
var
|
|
496
|
-
|
|
499
|
+
var c = Pe();
|
|
500
|
+
if (!c) {
|
|
501
|
+
var x = typeof r == "string" ? r : r.displayName || r.name;
|
|
502
|
+
x && (c = `
|
|
497
503
|
|
|
498
|
-
Check the top-level render call using <` +
|
|
504
|
+
Check the top-level render call using <` + x + ">.");
|
|
499
505
|
}
|
|
500
|
-
return
|
|
506
|
+
return c;
|
|
501
507
|
}
|
|
502
508
|
}
|
|
503
|
-
function
|
|
509
|
+
function re(r, c) {
|
|
504
510
|
{
|
|
505
|
-
if (!
|
|
511
|
+
if (!r._store || r._store.validated || r.key != null)
|
|
506
512
|
return;
|
|
507
|
-
|
|
508
|
-
var
|
|
509
|
-
if (
|
|
513
|
+
r._store.validated = !0;
|
|
514
|
+
var x = Lt(c);
|
|
515
|
+
if (ye[x])
|
|
510
516
|
return;
|
|
511
|
-
|
|
512
|
-
var
|
|
513
|
-
|
|
517
|
+
ye[x] = !0;
|
|
518
|
+
var O = "";
|
|
519
|
+
r && r._owner && r._owner !== _e.current && (O = " It was passed a child from " + A(r._owner.type) + "."), Ne(r), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', x, O), Ne(null);
|
|
514
520
|
}
|
|
515
521
|
}
|
|
516
|
-
function
|
|
522
|
+
function vt(r, c) {
|
|
517
523
|
{
|
|
518
|
-
if (typeof
|
|
524
|
+
if (typeof r != "object")
|
|
519
525
|
return;
|
|
520
|
-
if (
|
|
521
|
-
for (var
|
|
522
|
-
var
|
|
523
|
-
|
|
526
|
+
if (Ue(r))
|
|
527
|
+
for (var x = 0; x < r.length; x++) {
|
|
528
|
+
var O = r[x];
|
|
529
|
+
fe(O) && re(O, c);
|
|
524
530
|
}
|
|
525
|
-
else if (
|
|
526
|
-
|
|
527
|
-
else if (
|
|
528
|
-
var
|
|
529
|
-
if (typeof
|
|
530
|
-
for (var
|
|
531
|
-
|
|
531
|
+
else if (fe(r))
|
|
532
|
+
r._store && (r._store.validated = !0);
|
|
533
|
+
else if (r) {
|
|
534
|
+
var W = _(r);
|
|
535
|
+
if (typeof W == "function" && W !== r.entries)
|
|
536
|
+
for (var q = W.call(r), $; !($ = q.next()).done; )
|
|
537
|
+
fe($.value) && re($.value, c);
|
|
532
538
|
}
|
|
533
539
|
}
|
|
534
540
|
}
|
|
535
|
-
function
|
|
541
|
+
function yt(r) {
|
|
536
542
|
{
|
|
537
|
-
var
|
|
538
|
-
if (
|
|
543
|
+
var c = r.type;
|
|
544
|
+
if (c == null || typeof c == "string")
|
|
539
545
|
return;
|
|
540
|
-
var
|
|
541
|
-
if (typeof
|
|
542
|
-
|
|
543
|
-
else if (typeof
|
|
546
|
+
var x;
|
|
547
|
+
if (typeof c == "function")
|
|
548
|
+
x = c.propTypes;
|
|
549
|
+
else if (typeof c == "object" && (c.$$typeof === d || // Note: Memo only checks outer props here.
|
|
544
550
|
// Inner props are checked in the reconciler.
|
|
545
|
-
|
|
546
|
-
|
|
551
|
+
c.$$typeof === l))
|
|
552
|
+
x = c.propTypes;
|
|
547
553
|
else
|
|
548
554
|
return;
|
|
549
|
-
if (
|
|
550
|
-
var
|
|
551
|
-
|
|
552
|
-
} else if (
|
|
553
|
-
|
|
554
|
-
var
|
|
555
|
-
|
|
555
|
+
if (x) {
|
|
556
|
+
var O = A(c);
|
|
557
|
+
rt(x, r.props, "prop", O, r);
|
|
558
|
+
} else if (c.PropTypes !== void 0 && !nt) {
|
|
559
|
+
nt = !0;
|
|
560
|
+
var W = A(c);
|
|
561
|
+
p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", W || "Unknown");
|
|
556
562
|
}
|
|
557
|
-
typeof
|
|
563
|
+
typeof c.getDefaultProps == "function" && !c.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
558
564
|
}
|
|
559
565
|
}
|
|
560
|
-
function
|
|
566
|
+
function Qe(r) {
|
|
561
567
|
{
|
|
562
|
-
for (var
|
|
563
|
-
var
|
|
564
|
-
if (
|
|
565
|
-
|
|
568
|
+
for (var c = Object.keys(r.props), x = 0; x < c.length; x++) {
|
|
569
|
+
var O = c[x];
|
|
570
|
+
if (O !== "children" && O !== "key") {
|
|
571
|
+
Ne(r), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", O), Ne(null);
|
|
566
572
|
break;
|
|
567
573
|
}
|
|
568
574
|
}
|
|
569
|
-
|
|
575
|
+
r.ref !== null && (Ne(r), p("Invalid attribute `ref` supplied to `React.Fragment`."), Ne(null));
|
|
570
576
|
}
|
|
571
577
|
}
|
|
572
|
-
var
|
|
573
|
-
function
|
|
578
|
+
var it = {};
|
|
579
|
+
function xt(r, c, x, O, W, q) {
|
|
574
580
|
{
|
|
575
|
-
var
|
|
576
|
-
if (
|
|
577
|
-
var
|
|
578
|
-
(
|
|
579
|
-
var
|
|
580
|
-
|
|
581
|
-
var
|
|
582
|
-
|
|
581
|
+
var $ = j(r);
|
|
582
|
+
if (!$) {
|
|
583
|
+
var B = "";
|
|
584
|
+
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (B += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
585
|
+
var ie = mt();
|
|
586
|
+
ie ? B += ie : B += Pe();
|
|
587
|
+
var Y;
|
|
588
|
+
r === null ? Y = "null" : Ue(r) ? Y = "array" : r !== void 0 && r.$$typeof === t ? (Y = "<" + (A(r.type) || "Unknown") + " />", B = " Did you accidentally export a JSX literal instead of a component?") : Y = typeof r, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Y, B);
|
|
583
589
|
}
|
|
584
|
-
var
|
|
585
|
-
if (
|
|
586
|
-
return
|
|
587
|
-
if (
|
|
588
|
-
var
|
|
589
|
-
if (
|
|
590
|
-
if (
|
|
591
|
-
if (
|
|
592
|
-
for (var
|
|
593
|
-
|
|
594
|
-
Object.freeze && Object.freeze(
|
|
590
|
+
var X = ve(r, c, x, W, q);
|
|
591
|
+
if (X == null)
|
|
592
|
+
return X;
|
|
593
|
+
if ($) {
|
|
594
|
+
var he = c.children;
|
|
595
|
+
if (he !== void 0)
|
|
596
|
+
if (O)
|
|
597
|
+
if (Ue(he)) {
|
|
598
|
+
for (var at = 0; at < he.length; at++)
|
|
599
|
+
vt(he[at], r);
|
|
600
|
+
Object.freeze && Object.freeze(he);
|
|
595
601
|
} else
|
|
596
|
-
|
|
602
|
+
p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
597
603
|
else
|
|
598
|
-
|
|
604
|
+
vt(he, r);
|
|
599
605
|
}
|
|
600
|
-
if (
|
|
601
|
-
var
|
|
602
|
-
return
|
|
603
|
-
}),
|
|
604
|
-
if (!
|
|
605
|
-
var
|
|
606
|
-
|
|
606
|
+
if (ke.call(c, "key")) {
|
|
607
|
+
var He = A(r), ce = Object.keys(c).filter(function(Pr) {
|
|
608
|
+
return Pr !== "key";
|
|
609
|
+
}), Ut = ce.length > 0 ? "{key: someKey, " + ce.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
610
|
+
if (!it[He + Ut]) {
|
|
611
|
+
var Nr = ce.length > 0 ? "{" + ce.join(": ..., ") + ": ...}" : "{}";
|
|
612
|
+
p(`A props object containing a "key" prop is being spread into JSX:
|
|
607
613
|
let props = %s;
|
|
608
614
|
<%s {...props} />
|
|
609
615
|
React keys must be passed directly to JSX without using spread:
|
|
610
616
|
let props = %s;
|
|
611
|
-
<%s key={someKey} {...props} />`,
|
|
617
|
+
<%s key={someKey} {...props} />`, Ut, He, Nr, He), it[He + Ut] = !0;
|
|
612
618
|
}
|
|
613
619
|
}
|
|
614
|
-
return
|
|
620
|
+
return r === n ? Qe(X) : yt(X), X;
|
|
615
621
|
}
|
|
616
622
|
}
|
|
617
|
-
function
|
|
618
|
-
return
|
|
623
|
+
function Dt(r, c, x) {
|
|
624
|
+
return xt(r, c, x, !0);
|
|
619
625
|
}
|
|
620
|
-
function
|
|
621
|
-
return
|
|
626
|
+
function kr(r, c, x) {
|
|
627
|
+
return xt(r, c, x, !1);
|
|
622
628
|
}
|
|
623
|
-
var
|
|
624
|
-
|
|
625
|
-
}()),
|
|
629
|
+
var Or = kr, Ir = Dt;
|
|
630
|
+
Et.Fragment = n, Et.jsx = Or, Et.jsxs = Ir;
|
|
631
|
+
}()), Et;
|
|
626
632
|
}
|
|
627
|
-
process.env.NODE_ENV === "production" ?
|
|
628
|
-
var
|
|
629
|
-
const
|
|
630
|
-
function
|
|
631
|
-
children:
|
|
632
|
-
bobConfig:
|
|
633
|
-
hostApiConfig:
|
|
634
|
-
hostContext:
|
|
635
|
-
callbacks:
|
|
633
|
+
process.env.NODE_ENV === "production" ? Wt.exports = Br() : Wt.exports = Ar();
|
|
634
|
+
var a = Wt.exports;
|
|
635
|
+
const Er = Lr(null);
|
|
636
|
+
function Ns({
|
|
637
|
+
children: e,
|
|
638
|
+
bobConfig: t,
|
|
639
|
+
hostApiConfig: s,
|
|
640
|
+
hostContext: n = {},
|
|
641
|
+
callbacks: i = {}
|
|
636
642
|
}) {
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
}, [
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
...
|
|
644
|
-
...
|
|
643
|
+
const f = Ft(() => Fr(t.supabaseUrl, t.supabaseKey), [t.supabaseUrl, t.supabaseKey]), [u, g] = Tt.useState(n);
|
|
644
|
+
Tt.useEffect(() => {
|
|
645
|
+
g(n);
|
|
646
|
+
}, [n]);
|
|
647
|
+
const d = Tt.useCallback((h) => {
|
|
648
|
+
g((l) => ({
|
|
649
|
+
...l,
|
|
650
|
+
...h
|
|
645
651
|
}));
|
|
646
|
-
}, []),
|
|
652
|
+
}, []), y = Ft(
|
|
647
653
|
() => ({
|
|
648
|
-
bobSupabase:
|
|
649
|
-
bobConfig:
|
|
650
|
-
hostApiConfig:
|
|
651
|
-
hostContext:
|
|
652
|
-
callbacks:
|
|
653
|
-
updateHostContext:
|
|
654
|
+
bobSupabase: f,
|
|
655
|
+
bobConfig: t,
|
|
656
|
+
hostApiConfig: s,
|
|
657
|
+
hostContext: u,
|
|
658
|
+
callbacks: i,
|
|
659
|
+
updateHostContext: d
|
|
654
660
|
}),
|
|
655
|
-
[
|
|
661
|
+
[f, t, s, u, i, d]
|
|
656
662
|
);
|
|
657
|
-
return /* @__PURE__ */
|
|
663
|
+
return /* @__PURE__ */ a.jsx(Er.Provider, { value: y, children: e });
|
|
658
664
|
}
|
|
659
|
-
function
|
|
660
|
-
const
|
|
661
|
-
if (!
|
|
665
|
+
function et() {
|
|
666
|
+
const e = Mr(Er);
|
|
667
|
+
if (!e)
|
|
662
668
|
throw new Error("useBobContext must be used within a BobProvider");
|
|
663
|
-
return
|
|
669
|
+
return e;
|
|
664
670
|
}
|
|
665
|
-
function
|
|
666
|
-
const { bobSupabase:
|
|
667
|
-
return
|
|
671
|
+
function _r() {
|
|
672
|
+
const { bobSupabase: e } = et();
|
|
673
|
+
return e;
|
|
668
674
|
}
|
|
669
|
-
function
|
|
670
|
-
const { hostContext:
|
|
671
|
-
return
|
|
675
|
+
function Ps() {
|
|
676
|
+
const { hostContext: e } = et();
|
|
677
|
+
return e;
|
|
672
678
|
}
|
|
673
|
-
function
|
|
674
|
-
const { hostApiConfig:
|
|
675
|
-
return
|
|
679
|
+
function Ls() {
|
|
680
|
+
const { hostApiConfig: e } = et();
|
|
681
|
+
return e;
|
|
676
682
|
}
|
|
677
|
-
function
|
|
678
|
-
const { callbacks:
|
|
679
|
-
return
|
|
683
|
+
function Ms() {
|
|
684
|
+
const { callbacks: e } = et();
|
|
685
|
+
return e;
|
|
680
686
|
}
|
|
681
|
-
const
|
|
682
|
-
onStart:
|
|
683
|
-
onEnd:
|
|
684
|
-
onFailed:
|
|
687
|
+
const ar = 5e3, Dr = ({
|
|
688
|
+
onStart: e,
|
|
689
|
+
onEnd: t,
|
|
690
|
+
onFailed: s
|
|
685
691
|
} = {}) => {
|
|
686
|
-
const { bobConfig:
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
}, [
|
|
690
|
-
const
|
|
691
|
-
|
|
692
|
-
}, []),
|
|
693
|
-
var
|
|
694
|
-
|
|
695
|
-
}, []),
|
|
696
|
-
var
|
|
697
|
-
if (
|
|
698
|
-
|
|
699
|
-
var
|
|
700
|
-
console.warn("[BobWidget TTS] Timeout after 5s - triggering fallback callbacks"),
|
|
701
|
-
},
|
|
692
|
+
const { bobConfig: n } = et(), [i, f] = Q(!1), u = H(null), g = H(null), d = H(!1), y = H(e), h = H(t), l = H(s);
|
|
693
|
+
se(() => {
|
|
694
|
+
y.current = e, h.current = t, l.current = s;
|
|
695
|
+
}, [e, t, s]);
|
|
696
|
+
const v = G(() => {
|
|
697
|
+
g.current && (clearTimeout(g.current), g.current = null);
|
|
698
|
+
}, []), w = G(() => {
|
|
699
|
+
var p;
|
|
700
|
+
d.current || (d.current = !0, console.log("[BobWidget TTS] Fallback: triggering onStart without audio"), (p = y.current) == null || p.call(y));
|
|
701
|
+
}, []), k = G(async (p) => {
|
|
702
|
+
var E, T, b, m;
|
|
703
|
+
if (p.trim()) {
|
|
704
|
+
d.current = !1, v(), u.current && (u.current.pause(), u.current = null), g.current = setTimeout(() => {
|
|
705
|
+
var S, C;
|
|
706
|
+
console.warn("[BobWidget TTS] Timeout after 5s - triggering fallback callbacks"), w(), f(!1), (S = h.current) == null || S.call(h), (C = l.current) == null || C.call(l), u.current = null;
|
|
707
|
+
}, ar);
|
|
702
708
|
try {
|
|
703
|
-
const
|
|
704
|
-
`${
|
|
709
|
+
const S = new AbortController(), C = setTimeout(() => S.abort(), ar - 1e3), P = await fetch(
|
|
710
|
+
`${n.supabaseUrl}/functions/v1/bob-tts`,
|
|
705
711
|
{
|
|
706
712
|
method: "POST",
|
|
707
713
|
headers: {
|
|
708
714
|
"Content-Type": "application/json",
|
|
709
|
-
Authorization: `Bearer ${
|
|
715
|
+
Authorization: `Bearer ${n.supabaseKey}`
|
|
710
716
|
},
|
|
711
|
-
body: JSON.stringify({ text:
|
|
712
|
-
signal:
|
|
717
|
+
body: JSON.stringify({ text: p }),
|
|
718
|
+
signal: S.signal
|
|
713
719
|
}
|
|
714
720
|
);
|
|
715
|
-
if (clearTimeout(
|
|
716
|
-
const
|
|
717
|
-
throw console.error("[BobWidget TTS] Request failed:",
|
|
721
|
+
if (clearTimeout(C), !P.ok) {
|
|
722
|
+
const M = await P.json().catch(() => ({}));
|
|
723
|
+
throw console.error("[BobWidget TTS] Request failed:", M), new Error("TTS request failed");
|
|
718
724
|
}
|
|
719
|
-
const { audioContent:
|
|
720
|
-
|
|
721
|
-
var
|
|
722
|
-
|
|
723
|
-
},
|
|
724
|
-
var
|
|
725
|
-
|
|
726
|
-
},
|
|
727
|
-
var
|
|
728
|
-
|
|
725
|
+
const { audioContent: j } = await P.json(), R = new Audio(`data:audio/mp3;base64,${j}`);
|
|
726
|
+
u.current = R, R.onplay = () => {
|
|
727
|
+
var M;
|
|
728
|
+
v(), d.current || (d.current = !0, f(!0), console.log("[BobWidget TTS] Audio playing, triggering onStart"), (M = y.current) == null || M.call(y));
|
|
729
|
+
}, R.onended = () => {
|
|
730
|
+
var M;
|
|
731
|
+
v(), f(!1), (M = h.current) == null || M.call(h), u.current = null;
|
|
732
|
+
}, R.onerror = (M) => {
|
|
733
|
+
var A, L;
|
|
734
|
+
v(), console.warn("[BobWidget TTS] Audio playback error:", M), w(), f(!1), (A = h.current) == null || A.call(h), (L = l.current) == null || L.call(l), u.current = null;
|
|
729
735
|
};
|
|
730
736
|
try {
|
|
731
|
-
await
|
|
732
|
-
} catch (
|
|
733
|
-
console.warn("[BobWidget TTS] Audio play() failed (likely autoplay policy):",
|
|
737
|
+
await R.play();
|
|
738
|
+
} catch (M) {
|
|
739
|
+
console.warn("[BobWidget TTS] Audio play() failed (likely autoplay policy):", M), v(), w(), f(!1), (E = h.current) == null || E.call(h), (T = l.current) == null || T.call(l), u.current = null;
|
|
734
740
|
}
|
|
735
|
-
} catch (
|
|
736
|
-
|
|
741
|
+
} catch (S) {
|
|
742
|
+
v(), console.error("[BobWidget TTS] Speech synthesis error:", S), w(), f(!1), (b = h.current) == null || b.call(h), (m = l.current) == null || m.call(l);
|
|
737
743
|
}
|
|
738
744
|
}
|
|
739
|
-
}, [
|
|
740
|
-
|
|
741
|
-
}, [
|
|
742
|
-
var
|
|
743
|
-
(
|
|
744
|
-
}, []),
|
|
745
|
-
var
|
|
746
|
-
(
|
|
745
|
+
}, [n.supabaseUrl, n.supabaseKey, v, w]), N = G(() => {
|
|
746
|
+
v(), u.current && (u.current.pause(), u.current = null), f(!1);
|
|
747
|
+
}, [v]), _ = G(() => {
|
|
748
|
+
var p;
|
|
749
|
+
(p = u.current) == null || p.pause();
|
|
750
|
+
}, []), I = G(() => {
|
|
751
|
+
var p;
|
|
752
|
+
(p = u.current) == null || p.play();
|
|
747
753
|
}, []);
|
|
748
|
-
return
|
|
749
|
-
|
|
750
|
-
}, [
|
|
751
|
-
speak:
|
|
752
|
-
stop:
|
|
753
|
-
pause:
|
|
754
|
-
resume:
|
|
755
|
-
isSpeaking:
|
|
754
|
+
return se(() => () => {
|
|
755
|
+
v(), u.current && (u.current.pause(), u.current = null);
|
|
756
|
+
}, [v]), {
|
|
757
|
+
speak: k,
|
|
758
|
+
stop: N,
|
|
759
|
+
pause: _,
|
|
760
|
+
resume: I,
|
|
761
|
+
isSpeaking: i,
|
|
756
762
|
isSupported: !0
|
|
757
763
|
};
|
|
758
|
-
},
|
|
764
|
+
}, or = [
|
|
759
765
|
"recommend",
|
|
760
766
|
"suggest",
|
|
761
767
|
"need",
|
|
@@ -781,7 +787,7 @@ const fr = 5e3, wr = ({
|
|
|
781
787
|
"add-on",
|
|
782
788
|
"tyre shine",
|
|
783
789
|
"windscreen wash"
|
|
784
|
-
],
|
|
790
|
+
], Ur = [
|
|
785
791
|
"WIPER BLADE FRONT",
|
|
786
792
|
"WIPER BLADE REAR",
|
|
787
793
|
"WIPER BLADE SET",
|
|
@@ -848,482 +854,1993 @@ const fr = 5e3, wr = ({
|
|
|
848
854
|
"shock absorber",
|
|
849
855
|
"struts",
|
|
850
856
|
"suspension"
|
|
851
|
-
],
|
|
852
|
-
setAnimationState:
|
|
853
|
-
manualMode:
|
|
854
|
-
talkingState:
|
|
855
|
-
thinkingState:
|
|
856
|
-
completeState:
|
|
857
|
-
idleState:
|
|
858
|
-
listenState:
|
|
859
|
-
onStreamStart:
|
|
860
|
-
onStreamComplete:
|
|
861
|
-
onShowingProduct:
|
|
862
|
-
onResearchStart:
|
|
863
|
-
onReadyToSpeak:
|
|
864
|
-
onHighlightPart:
|
|
865
|
-
onHighlightProduct:
|
|
866
|
-
onNoPartsFound:
|
|
867
|
-
onAutoFetchComplete:
|
|
857
|
+
], $r = ({
|
|
858
|
+
setAnimationState: e,
|
|
859
|
+
manualMode: t = !1,
|
|
860
|
+
talkingState: s = "talk",
|
|
861
|
+
thinkingState: n = "research",
|
|
862
|
+
completeState: i = "complete",
|
|
863
|
+
idleState: f = "idle",
|
|
864
|
+
listenState: u = "talk_pause",
|
|
865
|
+
onStreamStart: g,
|
|
866
|
+
onStreamComplete: d,
|
|
867
|
+
onShowingProduct: y,
|
|
868
|
+
onResearchStart: h,
|
|
869
|
+
onReadyToSpeak: l,
|
|
870
|
+
onHighlightPart: v,
|
|
871
|
+
onHighlightProduct: w,
|
|
872
|
+
onNoPartsFound: k,
|
|
873
|
+
onAutoFetchComplete: N
|
|
868
874
|
}) => {
|
|
869
|
-
var
|
|
870
|
-
const { bobConfig:
|
|
871
|
-
|
|
872
|
-
}, { speak:
|
|
875
|
+
var Nt, Pt, De, ke;
|
|
876
|
+
const { bobConfig: _, hostApiConfig: I, hostContext: p, callbacks: E } = et(), [T, b] = Q([]), [m, S] = Q(""), [C, P] = Q(!1), [j, R] = Q(!1), [M, A] = Q(null), L = H(null), te = H(!1), Re = H(!1), K = H(""), oe = H(!1), ue = H(null), je = () => {
|
|
877
|
+
ue.current && (clearTimeout(ue.current), ue.current = null);
|
|
878
|
+
}, { speak: J, stop: Ae, isSpeaking: kt } = Dr({
|
|
873
879
|
onStart: () => {
|
|
874
|
-
|
|
880
|
+
je(), oe.current = !0, console.log("[BobWidget] Speech started - revealing products"), l == null || l(), t || pe(s);
|
|
875
881
|
},
|
|
876
882
|
onEnd: () => {
|
|
877
|
-
|
|
878
|
-
const
|
|
879
|
-
(
|
|
883
|
+
je();
|
|
884
|
+
const D = or.some(
|
|
885
|
+
(ee) => K.current.toLowerCase().includes(ee.toLowerCase())
|
|
880
886
|
);
|
|
881
|
-
|
|
887
|
+
t || (D && y ? y() : d ? d() : (pe(i), setTimeout(() => pe(u), 3e3)));
|
|
882
888
|
},
|
|
883
889
|
onFailed: () => {
|
|
884
890
|
console.warn("[BobWidget] Speech synthesis failed - fallback triggered");
|
|
885
891
|
}
|
|
886
892
|
});
|
|
887
|
-
|
|
888
|
-
var
|
|
889
|
-
(
|
|
890
|
-
}, [
|
|
891
|
-
var
|
|
892
|
-
const
|
|
893
|
-
|
|
894
|
-
}, [(
|
|
895
|
-
var
|
|
896
|
-
if (
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
899
|
-
|
|
900
|
-
const
|
|
901
|
-
|
|
893
|
+
se(() => {
|
|
894
|
+
var D;
|
|
895
|
+
(D = L.current) == null || D.scrollIntoView({ behavior: "smooth" });
|
|
896
|
+
}, [T]), se(() => {
|
|
897
|
+
var ee, ne;
|
|
898
|
+
const D = (ee = p.vehicle) == null ? void 0 : ee.selectedVehicle;
|
|
899
|
+
D && !M && (console.log("[BobWidget] Setting vehicle from host context:", D), A(D), (ne = E.onVehicleIdentified) == null || ne.call(E, D));
|
|
900
|
+
}, [(Nt = p.vehicle) == null ? void 0 : Nt.selectedVehicle]), se(() => {
|
|
901
|
+
var D;
|
|
902
|
+
if (T.length === 0 && !Re.current) {
|
|
903
|
+
const ee = (D = p.vehicle) == null ? void 0 : D.selectedVehicle;
|
|
904
|
+
if (ee) {
|
|
905
|
+
Re.current = !0;
|
|
906
|
+
const ne = `${ee.year} ${ee.make} ${ee.model}`;
|
|
907
|
+
b([{
|
|
902
908
|
role: "assistant",
|
|
903
|
-
content: `G'day! Saw you've got the ${
|
|
909
|
+
content: `G'day! Saw you've got the ${ne} - choice wagon! What can I help you find for it today?`
|
|
904
910
|
}]);
|
|
905
911
|
} else
|
|
906
|
-
|
|
912
|
+
b([{
|
|
907
913
|
role: "assistant",
|
|
908
914
|
content: "G'day! Bob from CARFIX here. How can I help ya today?"
|
|
909
915
|
}]);
|
|
910
916
|
}
|
|
911
|
-
}, [(
|
|
912
|
-
var
|
|
913
|
-
const
|
|
914
|
-
if (!
|
|
915
|
-
const
|
|
916
|
-
if (!Number.isFinite(
|
|
917
|
-
console.warn("[BobWidget] Vehicle has invalid vehicle_id, cannot auto-fetch:",
|
|
917
|
+
}, [(Pt = p.vehicle) == null ? void 0 : Pt.selectedVehicle, T.length]), se(() => {
|
|
918
|
+
var $e, We;
|
|
919
|
+
const D = ($e = p.vehicle) == null ? void 0 : $e.selectedVehicle;
|
|
920
|
+
if (!D || te.current) return;
|
|
921
|
+
const ee = D.vehicle_id ?? D.id, ne = Number.parseInt(String(ee), 10);
|
|
922
|
+
if (!Number.isFinite(ne)) {
|
|
923
|
+
console.warn("[BobWidget] Vehicle has invalid vehicle_id, cannot auto-fetch:", D);
|
|
918
924
|
return;
|
|
919
925
|
}
|
|
920
|
-
|
|
921
|
-
const
|
|
926
|
+
te.current = !0;
|
|
927
|
+
const rt = { ...D, vehicle_id: String(ne) }, st = (We = p.user) == null ? void 0 : We.email;
|
|
922
928
|
(async () => {
|
|
923
|
-
var
|
|
924
|
-
const
|
|
929
|
+
var Oe, Ie;
|
|
930
|
+
const Ve = `${_.supabaseUrl}/functions/v1/bob-chat`;
|
|
925
931
|
try {
|
|
926
|
-
const
|
|
932
|
+
const ge = await fetch(Ve, {
|
|
927
933
|
method: "POST",
|
|
928
934
|
headers: {
|
|
929
935
|
"Content-Type": "application/json",
|
|
930
|
-
Authorization: `Bearer ${
|
|
936
|
+
Authorization: `Bearer ${_.supabaseKey}`
|
|
931
937
|
},
|
|
932
938
|
body: JSON.stringify({
|
|
933
939
|
messages: [],
|
|
934
|
-
vehicleContext:
|
|
935
|
-
customerEmail:
|
|
940
|
+
vehicleContext: rt,
|
|
941
|
+
customerEmail: st,
|
|
936
942
|
autoFetchParts: !0,
|
|
937
|
-
hostConfig:
|
|
938
|
-
hostContext:
|
|
943
|
+
hostConfig: I,
|
|
944
|
+
hostContext: p
|
|
939
945
|
})
|
|
940
946
|
});
|
|
941
|
-
if (!
|
|
942
|
-
console.error("[BobWidget] Auto-fetch failed:",
|
|
947
|
+
if (!ge.ok || !ge.body) {
|
|
948
|
+
console.error("[BobWidget] Auto-fetch failed:", ge.status);
|
|
943
949
|
return;
|
|
944
950
|
}
|
|
945
|
-
const
|
|
946
|
-
let
|
|
951
|
+
const Ke = ge.body.getReader(), qe = new TextDecoder();
|
|
952
|
+
let Ee = "";
|
|
947
953
|
for (; ; ) {
|
|
948
|
-
const { done:
|
|
949
|
-
if (
|
|
950
|
-
|
|
951
|
-
let
|
|
952
|
-
for (; (
|
|
954
|
+
const { done: be, value: Se } = await Ke.read();
|
|
955
|
+
if (be) break;
|
|
956
|
+
Ee += qe.decode(Se, { stream: !0 });
|
|
957
|
+
let ze;
|
|
958
|
+
for (; (ze = Ee.indexOf(`
|
|
953
959
|
`)) !== -1; ) {
|
|
954
|
-
let
|
|
955
|
-
if (
|
|
956
|
-
const
|
|
957
|
-
if (
|
|
960
|
+
let me = Ee.slice(0, ze);
|
|
961
|
+
if (Ee = Ee.slice(ze + 1), me.endsWith("\r") && (me = me.slice(0, -1)), me.startsWith(":") || me.trim() === "" || !me.startsWith("data: ")) continue;
|
|
962
|
+
const de = me.slice(6).trim();
|
|
963
|
+
if (de === "[DONE]") break;
|
|
958
964
|
try {
|
|
959
|
-
const
|
|
960
|
-
|
|
965
|
+
const ve = JSON.parse(de);
|
|
966
|
+
ve.type === "service_packages_found" && ve.packages && ((Oe = E.onServicePackagesFound) == null || Oe.call(E, ve.packages)), ve.type === "parts_found" && ve.parts && ((Ie = E.onPartsFound) == null || Ie.call(E, ve.parts));
|
|
961
967
|
} catch {
|
|
962
968
|
}
|
|
963
969
|
}
|
|
964
970
|
}
|
|
965
|
-
|
|
966
|
-
} catch (
|
|
967
|
-
console.error("[BobWidget] Auto-fetch error:",
|
|
971
|
+
N == null || N();
|
|
972
|
+
} catch (ge) {
|
|
973
|
+
console.error("[BobWidget] Auto-fetch error:", ge);
|
|
968
974
|
}
|
|
969
975
|
})();
|
|
970
|
-
}, [(
|
|
971
|
-
const
|
|
976
|
+
}, [(De = p.vehicle) == null ? void 0 : De.selectedVehicle, (ke = p.user) == null ? void 0 : ke.email]);
|
|
977
|
+
const pe = (D) => {
|
|
972
978
|
try {
|
|
973
|
-
|
|
979
|
+
e(D);
|
|
974
980
|
} catch {
|
|
975
|
-
console.warn(`[BobWidget] State "${
|
|
981
|
+
console.warn(`[BobWidget] State "${D}" not available`);
|
|
976
982
|
}
|
|
977
|
-
},
|
|
978
|
-
var
|
|
979
|
-
const
|
|
983
|
+
}, Bt = async (D) => {
|
|
984
|
+
var rt, st, Ue, $e, We, Ve, Oe, Ie, ge, Ke, qe, Ee;
|
|
985
|
+
const ee = `${_.supabaseUrl}/functions/v1/bob-chat`, ne = (rt = p.user) == null ? void 0 : rt.email;
|
|
980
986
|
try {
|
|
981
|
-
const
|
|
982
|
-
messages: [...
|
|
983
|
-
hostConfig:
|
|
984
|
-
hostContext:
|
|
987
|
+
const be = {
|
|
988
|
+
messages: [...T, D],
|
|
989
|
+
hostConfig: I,
|
|
990
|
+
hostContext: p
|
|
985
991
|
};
|
|
986
|
-
|
|
987
|
-
const
|
|
992
|
+
M && (be.vehicleContext = M), ne && (be.customerEmail = ne);
|
|
993
|
+
const Se = await fetch(ee, {
|
|
988
994
|
method: "POST",
|
|
989
995
|
headers: {
|
|
990
996
|
"Content-Type": "application/json",
|
|
991
|
-
Authorization: `Bearer ${
|
|
997
|
+
Authorization: `Bearer ${_.supabaseKey}`
|
|
992
998
|
},
|
|
993
|
-
body: JSON.stringify(
|
|
999
|
+
body: JSON.stringify(be)
|
|
994
1000
|
});
|
|
995
|
-
if (!
|
|
996
|
-
if (
|
|
997
|
-
(
|
|
1001
|
+
if (!Se.ok) {
|
|
1002
|
+
if (Se.status === 429) {
|
|
1003
|
+
(st = E.onError) == null || st.call(E, new Error("Rate limit exceeded"));
|
|
998
1004
|
return;
|
|
999
1005
|
}
|
|
1000
|
-
if (
|
|
1001
|
-
(
|
|
1006
|
+
if (Se.status === 402) {
|
|
1007
|
+
(Ue = E.onError) == null || Ue.call(E, new Error("Payment required"));
|
|
1002
1008
|
return;
|
|
1003
1009
|
}
|
|
1004
1010
|
throw new Error("Failed to start stream");
|
|
1005
1011
|
}
|
|
1006
|
-
if (!
|
|
1007
|
-
const
|
|
1008
|
-
let
|
|
1009
|
-
for (; !
|
|
1010
|
-
const { done:
|
|
1011
|
-
if (
|
|
1012
|
-
|
|
1013
|
-
let
|
|
1014
|
-
for (; (
|
|
1012
|
+
if (!Se.body) throw new Error("No response body");
|
|
1013
|
+
const ze = Se.body.getReader(), me = new TextDecoder();
|
|
1014
|
+
let de = "", ve = !1, _e = "";
|
|
1015
|
+
for (; !ve; ) {
|
|
1016
|
+
const { done: fe, value: Pe } = await ze.read();
|
|
1017
|
+
if (fe) break;
|
|
1018
|
+
de += me.decode(Pe, { stream: !0 });
|
|
1019
|
+
let mt;
|
|
1020
|
+
for (; (mt = de.indexOf(`
|
|
1015
1021
|
`)) !== -1; ) {
|
|
1016
|
-
let
|
|
1017
|
-
if (
|
|
1018
|
-
const
|
|
1019
|
-
if (
|
|
1020
|
-
|
|
1022
|
+
let ye = de.slice(0, mt);
|
|
1023
|
+
if (de = de.slice(mt + 1), ye.endsWith("\r") && (ye = ye.slice(0, -1)), ye.startsWith(":") || ye.trim() === "" || !ye.startsWith("data: ")) continue;
|
|
1024
|
+
const Lt = ye.slice(6).trim();
|
|
1025
|
+
if (Lt === "[DONE]") {
|
|
1026
|
+
ve = !0;
|
|
1021
1027
|
break;
|
|
1022
1028
|
}
|
|
1023
1029
|
try {
|
|
1024
|
-
const
|
|
1025
|
-
if (
|
|
1026
|
-
|
|
1030
|
+
const re = JSON.parse(Lt);
|
|
1031
|
+
if (re.type === "vehicle_identified" && re.vehicle) {
|
|
1032
|
+
A(re.vehicle), ($e = E.onVehicleIdentified) == null || $e.call(E, re.vehicle);
|
|
1027
1033
|
continue;
|
|
1028
1034
|
}
|
|
1029
|
-
if (
|
|
1030
|
-
(
|
|
1035
|
+
if (re.type === "service_packages_found" && re.packages) {
|
|
1036
|
+
(We = E.onServicePackagesFound) == null || We.call(E, re.packages);
|
|
1031
1037
|
continue;
|
|
1032
1038
|
}
|
|
1033
|
-
if (
|
|
1034
|
-
(
|
|
1039
|
+
if (re.type === "parts_found" && re.parts) {
|
|
1040
|
+
(Ve = E.onPartsFound) == null || Ve.call(E, re.parts);
|
|
1035
1041
|
continue;
|
|
1036
1042
|
}
|
|
1037
|
-
if (
|
|
1038
|
-
|
|
1043
|
+
if (re.type === "no_parts_found") {
|
|
1044
|
+
k == null || k();
|
|
1039
1045
|
continue;
|
|
1040
1046
|
}
|
|
1041
|
-
if (
|
|
1042
|
-
(
|
|
1047
|
+
if (re.type === "cart_updated" && re.items) {
|
|
1048
|
+
(Oe = E.onCartUpdated) == null || Oe.call(E, re.items);
|
|
1043
1049
|
continue;
|
|
1044
1050
|
}
|
|
1045
|
-
const
|
|
1046
|
-
if (
|
|
1047
|
-
|
|
1048
|
-
const
|
|
1049
|
-
|
|
1050
|
-
const
|
|
1051
|
-
return (
|
|
1052
|
-
(
|
|
1053
|
-
) : [...
|
|
1054
|
-
}), (
|
|
1051
|
+
const vt = (Ke = (ge = (Ie = re.choices) == null ? void 0 : Ie[0]) == null ? void 0 : ge.delta) == null ? void 0 : Ke.content;
|
|
1052
|
+
if (vt) {
|
|
1053
|
+
_e += vt;
|
|
1054
|
+
const yt = _e.replace(/\[VEHICLE_CONFIRMED:\{[\s\S]*?\}\]/g, "");
|
|
1055
|
+
b((Qe) => {
|
|
1056
|
+
const it = Qe[Qe.length - 1];
|
|
1057
|
+
return (it == null ? void 0 : it.role) === "assistant" ? Qe.map(
|
|
1058
|
+
(xt, Dt) => Dt === Qe.length - 1 ? { ...xt, content: yt } : xt
|
|
1059
|
+
) : [...Qe, { role: "assistant", content: yt }];
|
|
1060
|
+
}), (qe = E.onBobMessage) == null || qe.call(E, yt);
|
|
1055
1061
|
}
|
|
1056
1062
|
} catch {
|
|
1057
|
-
|
|
1058
|
-
` +
|
|
1063
|
+
de = ye + `
|
|
1064
|
+
` + de;
|
|
1059
1065
|
break;
|
|
1060
1066
|
}
|
|
1061
1067
|
}
|
|
1062
1068
|
}
|
|
1063
|
-
|
|
1064
|
-
const
|
|
1065
|
-
(
|
|
1066
|
-
),
|
|
1067
|
-
for (const
|
|
1068
|
-
if (
|
|
1069
|
-
const
|
|
1070
|
-
|
|
1069
|
+
K.current = _e.replace(/\[VEHICLE_CONFIRMED:\{[\s\S]*?\}\]/g, "");
|
|
1070
|
+
const bt = or.some(
|
|
1071
|
+
(fe) => _e.toLowerCase().includes(fe.toLowerCase())
|
|
1072
|
+
), Ne = _e.toLowerCase();
|
|
1073
|
+
for (const fe of Ur)
|
|
1074
|
+
if (Ne.includes(fe.toLowerCase())) {
|
|
1075
|
+
const Pe = fe.replace(/s\s*$/i, "").toUpperCase();
|
|
1076
|
+
v == null || v(Pe);
|
|
1071
1077
|
break;
|
|
1072
1078
|
}
|
|
1073
|
-
const
|
|
1074
|
-
if (
|
|
1075
|
-
const [,
|
|
1076
|
-
|
|
1079
|
+
const nt = _e.match(/(?:go with|recommend|suggest|grab|try)\s+(?:the\s+)?(\w+)\s+(?:at|for)\s+\$(\d+(?:\.\d{2})?)/i);
|
|
1080
|
+
if (nt) {
|
|
1081
|
+
const [, fe, Pe] = nt;
|
|
1082
|
+
w == null || w({ brand: fe, price: parseFloat(Pe) });
|
|
1077
1083
|
}
|
|
1078
|
-
!
|
|
1079
|
-
|
|
1080
|
-
}, 2e3)) : (
|
|
1081
|
-
} catch (
|
|
1082
|
-
console.error("[BobWidget] Chat error:",
|
|
1084
|
+
!j && K.current.trim() ? (oe.current = !1, je(), J(K.current), ue.current = setTimeout(() => {
|
|
1085
|
+
oe.current || (console.warn("[BobWidget] Speech fallback after 2s"), l == null || l(), t || (bt && y ? y() : d ? d() : (pe(i), setTimeout(() => pe(u), 3e3))));
|
|
1086
|
+
}, 2e3)) : (l == null || l(), t || (bt && y ? y() : d ? d() : (pe(i), setTimeout(() => pe(u), 3e3))));
|
|
1087
|
+
} catch (be) {
|
|
1088
|
+
console.error("[BobWidget] Chat error:", be), (Ee = E.onError) == null || Ee.call(E, be instanceof Error ? be : new Error("Unknown error")), t || pe(f);
|
|
1083
1089
|
}
|
|
1084
|
-
},
|
|
1085
|
-
if (!
|
|
1086
|
-
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1090
|
+
}, tt = async () => {
|
|
1091
|
+
if (!m.trim() || C) return;
|
|
1092
|
+
Ae();
|
|
1093
|
+
const D = { role: "user", content: m };
|
|
1094
|
+
b((ee) => [...ee, D]), S(""), P(!0), h == null || h(), t || pe(n), await Bt(D), P(!1);
|
|
1089
1095
|
};
|
|
1090
1096
|
return {
|
|
1091
|
-
messages:
|
|
1092
|
-
input:
|
|
1093
|
-
setInput:
|
|
1094
|
-
isLoading:
|
|
1095
|
-
handleSend:
|
|
1096
|
-
handleKeyPress: (
|
|
1097
|
-
|
|
1097
|
+
messages: T,
|
|
1098
|
+
input: m,
|
|
1099
|
+
setInput: S,
|
|
1100
|
+
isLoading: C,
|
|
1101
|
+
handleSend: tt,
|
|
1102
|
+
handleKeyPress: (D) => {
|
|
1103
|
+
D.key === "Enter" && !D.shiftKey && (D.preventDefault(), tt());
|
|
1098
1104
|
},
|
|
1099
1105
|
handleInputFocus: () => {
|
|
1100
1106
|
},
|
|
1101
1107
|
handleInputBlur: () => {
|
|
1102
1108
|
},
|
|
1103
|
-
chatEndRef:
|
|
1109
|
+
chatEndRef: L,
|
|
1104
1110
|
clearMessages: () => {
|
|
1105
|
-
|
|
1111
|
+
b([{
|
|
1106
1112
|
role: "assistant",
|
|
1107
1113
|
content: "G'day! Bob from CARFIX here. How can I help ya today?"
|
|
1108
1114
|
}]);
|
|
1109
1115
|
},
|
|
1110
|
-
isMuted:
|
|
1116
|
+
isMuted: j,
|
|
1111
1117
|
toggleMute: () => {
|
|
1112
|
-
|
|
1118
|
+
R((D) => !D), j || Ae();
|
|
1113
1119
|
},
|
|
1114
|
-
isSpeaking:
|
|
1115
|
-
identifiedVehicle:
|
|
1120
|
+
isSpeaking: kt,
|
|
1121
|
+
identifiedVehicle: M,
|
|
1116
1122
|
clearVehicle: () => {
|
|
1117
|
-
|
|
1123
|
+
A(null);
|
|
1124
|
+
}
|
|
1125
|
+
};
|
|
1126
|
+
};
|
|
1127
|
+
var er = class {
|
|
1128
|
+
constructor() {
|
|
1129
|
+
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
1130
|
+
}
|
|
1131
|
+
subscribe(e) {
|
|
1132
|
+
return this.listeners.add(e), this.onSubscribe(), () => {
|
|
1133
|
+
this.listeners.delete(e), this.onUnsubscribe();
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1136
|
+
hasListeners() {
|
|
1137
|
+
return this.listeners.size > 0;
|
|
1138
|
+
}
|
|
1139
|
+
onSubscribe() {
|
|
1140
|
+
}
|
|
1141
|
+
onUnsubscribe() {
|
|
1142
|
+
}
|
|
1143
|
+
}, Wr = {
|
|
1144
|
+
// We need the wrapper function syntax below instead of direct references to
|
|
1145
|
+
// global setTimeout etc.
|
|
1146
|
+
//
|
|
1147
|
+
// BAD: `setTimeout: setTimeout`
|
|
1148
|
+
// GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
|
|
1149
|
+
//
|
|
1150
|
+
// If we use direct references here, then anything that wants to spy on or
|
|
1151
|
+
// replace the global setTimeout (like tests) won't work since we'll already
|
|
1152
|
+
// have a hard reference to the original implementation at the time when this
|
|
1153
|
+
// file was imported.
|
|
1154
|
+
setTimeout: (e, t) => setTimeout(e, t),
|
|
1155
|
+
clearTimeout: (e) => clearTimeout(e),
|
|
1156
|
+
setInterval: (e, t) => setInterval(e, t),
|
|
1157
|
+
clearInterval: (e) => clearInterval(e)
|
|
1158
|
+
}, Te, Ye, vr, Vr = (vr = class {
|
|
1159
|
+
constructor() {
|
|
1160
|
+
// We cannot have TimeoutManager<T> as we must instantiate it with a concrete
|
|
1161
|
+
// type at app boot; and if we leave that type, then any new timer provider
|
|
1162
|
+
// would need to support ReturnType<typeof setTimeout>, which is infeasible.
|
|
1163
|
+
//
|
|
1164
|
+
// We settle for type safety for the TimeoutProvider type, and accept that
|
|
1165
|
+
// this class is unsafe internally to allow for extension.
|
|
1166
|
+
z(this, Te, Wr);
|
|
1167
|
+
z(this, Ye, !1);
|
|
1168
|
+
}
|
|
1169
|
+
setTimeoutProvider(e) {
|
|
1170
|
+
process.env.NODE_ENV !== "production" && o(this, Ye) && e !== o(this, Te) && console.error(
|
|
1171
|
+
"[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",
|
|
1172
|
+
{ previous: o(this, Te), provider: e }
|
|
1173
|
+
), F(this, Te, e), process.env.NODE_ENV !== "production" && F(this, Ye, !1);
|
|
1174
|
+
}
|
|
1175
|
+
setTimeout(e, t) {
|
|
1176
|
+
return process.env.NODE_ENV !== "production" && F(this, Ye, !0), o(this, Te).setTimeout(e, t);
|
|
1177
|
+
}
|
|
1178
|
+
clearTimeout(e) {
|
|
1179
|
+
o(this, Te).clearTimeout(e);
|
|
1180
|
+
}
|
|
1181
|
+
setInterval(e, t) {
|
|
1182
|
+
return process.env.NODE_ENV !== "production" && F(this, Ye, !0), o(this, Te).setInterval(e, t);
|
|
1183
|
+
}
|
|
1184
|
+
clearInterval(e) {
|
|
1185
|
+
o(this, Te).clearInterval(e);
|
|
1186
|
+
}
|
|
1187
|
+
}, Te = new WeakMap(), Ye = new WeakMap(), vr), Mt = new Vr();
|
|
1188
|
+
function Kr(e) {
|
|
1189
|
+
setTimeout(e, 0);
|
|
1190
|
+
}
|
|
1191
|
+
var St = typeof window > "u" || "Deno" in globalThis;
|
|
1192
|
+
function Vt() {
|
|
1193
|
+
}
|
|
1194
|
+
function cr(e) {
|
|
1195
|
+
return typeof e == "number" && e >= 0 && e !== 1 / 0;
|
|
1196
|
+
}
|
|
1197
|
+
function qr(e, t) {
|
|
1198
|
+
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
1199
|
+
}
|
|
1200
|
+
function Rt(e, t) {
|
|
1201
|
+
return typeof e == "function" ? e(t) : e;
|
|
1202
|
+
}
|
|
1203
|
+
function xe(e, t) {
|
|
1204
|
+
return typeof e == "function" ? e(t) : e;
|
|
1205
|
+
}
|
|
1206
|
+
var zr = Object.prototype.hasOwnProperty;
|
|
1207
|
+
function Kt(e, t) {
|
|
1208
|
+
if (e === t)
|
|
1209
|
+
return e;
|
|
1210
|
+
const s = lr(e) && lr(t);
|
|
1211
|
+
if (!s && !(ur(e) && ur(t))) return t;
|
|
1212
|
+
const i = (s ? e : Object.keys(e)).length, f = s ? t : Object.keys(t), u = f.length, g = s ? new Array(u) : {};
|
|
1213
|
+
let d = 0;
|
|
1214
|
+
for (let y = 0; y < u; y++) {
|
|
1215
|
+
const h = s ? y : f[y], l = e[h], v = t[h];
|
|
1216
|
+
if (l === v) {
|
|
1217
|
+
g[h] = l, (s ? y < i : zr.call(e, h)) && d++;
|
|
1218
|
+
continue;
|
|
1219
|
+
}
|
|
1220
|
+
if (l === null || v === null || typeof l != "object" || typeof v != "object") {
|
|
1221
|
+
g[h] = v;
|
|
1222
|
+
continue;
|
|
1223
|
+
}
|
|
1224
|
+
const w = Kt(l, v);
|
|
1225
|
+
g[h] = w, w === l && d++;
|
|
1226
|
+
}
|
|
1227
|
+
return i === u && d === i ? e : g;
|
|
1228
|
+
}
|
|
1229
|
+
function qt(e, t) {
|
|
1230
|
+
if (!t || Object.keys(e).length !== Object.keys(t).length)
|
|
1231
|
+
return !1;
|
|
1232
|
+
for (const s in e)
|
|
1233
|
+
if (e[s] !== t[s])
|
|
1234
|
+
return !1;
|
|
1235
|
+
return !0;
|
|
1236
|
+
}
|
|
1237
|
+
function lr(e) {
|
|
1238
|
+
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
1239
|
+
}
|
|
1240
|
+
function ur(e) {
|
|
1241
|
+
if (!dr(e))
|
|
1242
|
+
return !1;
|
|
1243
|
+
const t = e.constructor;
|
|
1244
|
+
if (t === void 0)
|
|
1245
|
+
return !0;
|
|
1246
|
+
const s = t.prototype;
|
|
1247
|
+
return !(!dr(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
1248
|
+
}
|
|
1249
|
+
function dr(e) {
|
|
1250
|
+
return Object.prototype.toString.call(e) === "[object Object]";
|
|
1251
|
+
}
|
|
1252
|
+
function fr(e, t, s) {
|
|
1253
|
+
if (typeof s.structuralSharing == "function")
|
|
1254
|
+
return s.structuralSharing(e, t);
|
|
1255
|
+
if (s.structuralSharing !== !1) {
|
|
1256
|
+
if (process.env.NODE_ENV !== "production")
|
|
1257
|
+
try {
|
|
1258
|
+
return Kt(e, t);
|
|
1259
|
+
} catch (n) {
|
|
1260
|
+
throw console.error(
|
|
1261
|
+
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${n}`
|
|
1262
|
+
), n;
|
|
1263
|
+
}
|
|
1264
|
+
return Kt(e, t);
|
|
1265
|
+
}
|
|
1266
|
+
return t;
|
|
1267
|
+
}
|
|
1268
|
+
function Qr(e, t) {
|
|
1269
|
+
return typeof e == "function" ? e(...t) : !!e;
|
|
1270
|
+
}
|
|
1271
|
+
var Ge, Le, ot, yr, Hr = (yr = class extends er {
|
|
1272
|
+
constructor() {
|
|
1273
|
+
super();
|
|
1274
|
+
z(this, Ge);
|
|
1275
|
+
z(this, Le);
|
|
1276
|
+
z(this, ot);
|
|
1277
|
+
F(this, ot, (t) => {
|
|
1278
|
+
if (!St && window.addEventListener) {
|
|
1279
|
+
const s = () => t();
|
|
1280
|
+
return window.addEventListener("visibilitychange", s, !1), () => {
|
|
1281
|
+
window.removeEventListener("visibilitychange", s);
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
});
|
|
1285
|
+
}
|
|
1286
|
+
onSubscribe() {
|
|
1287
|
+
o(this, Le) || this.setEventListener(o(this, ot));
|
|
1288
|
+
}
|
|
1289
|
+
onUnsubscribe() {
|
|
1290
|
+
var t;
|
|
1291
|
+
this.hasListeners() || ((t = o(this, Le)) == null || t.call(this), F(this, Le, void 0));
|
|
1292
|
+
}
|
|
1293
|
+
setEventListener(t) {
|
|
1294
|
+
var s;
|
|
1295
|
+
F(this, ot, t), (s = o(this, Le)) == null || s.call(this), F(this, Le, t((n) => {
|
|
1296
|
+
typeof n == "boolean" ? this.setFocused(n) : this.onFocus();
|
|
1297
|
+
}));
|
|
1298
|
+
}
|
|
1299
|
+
setFocused(t) {
|
|
1300
|
+
o(this, Ge) !== t && (F(this, Ge, t), this.onFocus());
|
|
1301
|
+
}
|
|
1302
|
+
onFocus() {
|
|
1303
|
+
const t = this.isFocused();
|
|
1304
|
+
this.listeners.forEach((s) => {
|
|
1305
|
+
s(t);
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1308
|
+
isFocused() {
|
|
1309
|
+
var t;
|
|
1310
|
+
return typeof o(this, Ge) == "boolean" ? o(this, Ge) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
|
|
1311
|
+
}
|
|
1312
|
+
}, Ge = new WeakMap(), Le = new WeakMap(), ot = new WeakMap(), yr), Yr = new Hr();
|
|
1313
|
+
function hr() {
|
|
1314
|
+
let e, t;
|
|
1315
|
+
const s = new Promise((i, f) => {
|
|
1316
|
+
e = i, t = f;
|
|
1317
|
+
});
|
|
1318
|
+
s.status = "pending", s.catch(() => {
|
|
1319
|
+
});
|
|
1320
|
+
function n(i) {
|
|
1321
|
+
Object.assign(s, i), delete s.resolve, delete s.reject;
|
|
1322
|
+
}
|
|
1323
|
+
return s.resolve = (i) => {
|
|
1324
|
+
n({
|
|
1325
|
+
status: "fulfilled",
|
|
1326
|
+
value: i
|
|
1327
|
+
}), e(i);
|
|
1328
|
+
}, s.reject = (i) => {
|
|
1329
|
+
n({
|
|
1330
|
+
status: "rejected",
|
|
1331
|
+
reason: i
|
|
1332
|
+
}), t(i);
|
|
1333
|
+
}, s;
|
|
1334
|
+
}
|
|
1335
|
+
var Gr = Kr;
|
|
1336
|
+
function Jr() {
|
|
1337
|
+
let e = [], t = 0, s = (g) => {
|
|
1338
|
+
g();
|
|
1339
|
+
}, n = (g) => {
|
|
1340
|
+
g();
|
|
1341
|
+
}, i = Gr;
|
|
1342
|
+
const f = (g) => {
|
|
1343
|
+
t ? e.push(g) : i(() => {
|
|
1344
|
+
s(g);
|
|
1345
|
+
});
|
|
1346
|
+
}, u = () => {
|
|
1347
|
+
const g = e;
|
|
1348
|
+
e = [], g.length && i(() => {
|
|
1349
|
+
n(() => {
|
|
1350
|
+
g.forEach((d) => {
|
|
1351
|
+
s(d);
|
|
1352
|
+
});
|
|
1353
|
+
});
|
|
1354
|
+
});
|
|
1355
|
+
};
|
|
1356
|
+
return {
|
|
1357
|
+
batch: (g) => {
|
|
1358
|
+
let d;
|
|
1359
|
+
t++;
|
|
1360
|
+
try {
|
|
1361
|
+
d = g();
|
|
1362
|
+
} finally {
|
|
1363
|
+
t--, t || u();
|
|
1364
|
+
}
|
|
1365
|
+
return d;
|
|
1366
|
+
},
|
|
1367
|
+
/**
|
|
1368
|
+
* All calls to the wrapped function will be batched.
|
|
1369
|
+
*/
|
|
1370
|
+
batchCalls: (g) => (...d) => {
|
|
1371
|
+
f(() => {
|
|
1372
|
+
g(...d);
|
|
1373
|
+
});
|
|
1374
|
+
},
|
|
1375
|
+
schedule: f,
|
|
1376
|
+
/**
|
|
1377
|
+
* Use this method to set a custom notify function.
|
|
1378
|
+
* This can be used to for example wrap notifications with `React.act` while running tests.
|
|
1379
|
+
*/
|
|
1380
|
+
setNotifyFunction: (g) => {
|
|
1381
|
+
s = g;
|
|
1382
|
+
},
|
|
1383
|
+
/**
|
|
1384
|
+
* Use this method to set a custom function to batch notifications together into a single tick.
|
|
1385
|
+
* By default React Query will use the batch function provided by ReactDOM or React Native.
|
|
1386
|
+
*/
|
|
1387
|
+
setBatchNotifyFunction: (g) => {
|
|
1388
|
+
n = g;
|
|
1389
|
+
},
|
|
1390
|
+
setScheduler: (g) => {
|
|
1391
|
+
i = g;
|
|
1392
|
+
}
|
|
1393
|
+
};
|
|
1394
|
+
}
|
|
1395
|
+
var Tr = Jr(), ct, Me, lt, xr, Xr = (xr = class extends er {
|
|
1396
|
+
constructor() {
|
|
1397
|
+
super();
|
|
1398
|
+
z(this, ct, !0);
|
|
1399
|
+
z(this, Me);
|
|
1400
|
+
z(this, lt);
|
|
1401
|
+
F(this, lt, (t) => {
|
|
1402
|
+
if (!St && window.addEventListener) {
|
|
1403
|
+
const s = () => t(!0), n = () => t(!1);
|
|
1404
|
+
return window.addEventListener("online", s, !1), window.addEventListener("offline", n, !1), () => {
|
|
1405
|
+
window.removeEventListener("online", s), window.removeEventListener("offline", n);
|
|
1406
|
+
};
|
|
1407
|
+
}
|
|
1408
|
+
});
|
|
1409
|
+
}
|
|
1410
|
+
onSubscribe() {
|
|
1411
|
+
o(this, Me) || this.setEventListener(o(this, lt));
|
|
1412
|
+
}
|
|
1413
|
+
onUnsubscribe() {
|
|
1414
|
+
var t;
|
|
1415
|
+
this.hasListeners() || ((t = o(this, Me)) == null || t.call(this), F(this, Me, void 0));
|
|
1416
|
+
}
|
|
1417
|
+
setEventListener(t) {
|
|
1418
|
+
var s;
|
|
1419
|
+
F(this, lt, t), (s = o(this, Me)) == null || s.call(this), F(this, Me, t(this.setOnline.bind(this)));
|
|
1420
|
+
}
|
|
1421
|
+
setOnline(t) {
|
|
1422
|
+
o(this, ct) !== t && (F(this, ct, t), this.listeners.forEach((n) => {
|
|
1423
|
+
n(t);
|
|
1424
|
+
}));
|
|
1425
|
+
}
|
|
1426
|
+
isOnline() {
|
|
1427
|
+
return o(this, ct);
|
|
1428
|
+
}
|
|
1429
|
+
}, ct = new WeakMap(), Me = new WeakMap(), lt = new WeakMap(), xr), Zr = new Xr();
|
|
1430
|
+
function es(e) {
|
|
1431
|
+
return (e ?? "online") === "online" ? Zr.isOnline() : !0;
|
|
1432
|
+
}
|
|
1433
|
+
function ts(e, t) {
|
|
1434
|
+
return {
|
|
1435
|
+
fetchFailureCount: 0,
|
|
1436
|
+
fetchFailureReason: null,
|
|
1437
|
+
fetchStatus: es(t.networkMode) ? "fetching" : "paused",
|
|
1438
|
+
...e === void 0 && {
|
|
1439
|
+
error: null,
|
|
1440
|
+
status: "pending"
|
|
1441
|
+
}
|
|
1442
|
+
};
|
|
1443
|
+
}
|
|
1444
|
+
var le, U, Ct, ae, Je, ut, Ce, Fe, jt, dt, ft, Xe, Ze, Be, ht, V, _t, zt, Qt, Ht, Yt, Gt, Jt, Xt, Rr, wr, rs = (wr = class extends er {
|
|
1445
|
+
constructor(t, s) {
|
|
1446
|
+
super();
|
|
1447
|
+
z(this, V);
|
|
1448
|
+
z(this, le);
|
|
1449
|
+
z(this, U);
|
|
1450
|
+
z(this, Ct);
|
|
1451
|
+
z(this, ae);
|
|
1452
|
+
z(this, Je);
|
|
1453
|
+
z(this, ut);
|
|
1454
|
+
z(this, Ce);
|
|
1455
|
+
z(this, Fe);
|
|
1456
|
+
z(this, jt);
|
|
1457
|
+
z(this, dt);
|
|
1458
|
+
// This property keeps track of the last query with defined data.
|
|
1459
|
+
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
1460
|
+
z(this, ft);
|
|
1461
|
+
z(this, Xe);
|
|
1462
|
+
z(this, Ze);
|
|
1463
|
+
z(this, Be);
|
|
1464
|
+
z(this, ht, /* @__PURE__ */ new Set());
|
|
1465
|
+
this.options = s, F(this, le, t), F(this, Fe, null), F(this, Ce, hr()), this.bindMethods(), this.setOptions(s);
|
|
1466
|
+
}
|
|
1467
|
+
bindMethods() {
|
|
1468
|
+
this.refetch = this.refetch.bind(this);
|
|
1469
|
+
}
|
|
1470
|
+
onSubscribe() {
|
|
1471
|
+
this.listeners.size === 1 && (o(this, U).addObserver(this), pr(o(this, U), this.options) ? Z(this, V, _t).call(this) : this.updateResult(), Z(this, V, Yt).call(this));
|
|
1472
|
+
}
|
|
1473
|
+
onUnsubscribe() {
|
|
1474
|
+
this.hasListeners() || this.destroy();
|
|
1475
|
+
}
|
|
1476
|
+
shouldFetchOnReconnect() {
|
|
1477
|
+
return Zt(
|
|
1478
|
+
o(this, U),
|
|
1479
|
+
this.options,
|
|
1480
|
+
this.options.refetchOnReconnect
|
|
1481
|
+
);
|
|
1482
|
+
}
|
|
1483
|
+
shouldFetchOnWindowFocus() {
|
|
1484
|
+
return Zt(
|
|
1485
|
+
o(this, U),
|
|
1486
|
+
this.options,
|
|
1487
|
+
this.options.refetchOnWindowFocus
|
|
1488
|
+
);
|
|
1489
|
+
}
|
|
1490
|
+
destroy() {
|
|
1491
|
+
this.listeners = /* @__PURE__ */ new Set(), Z(this, V, Gt).call(this), Z(this, V, Jt).call(this), o(this, U).removeObserver(this);
|
|
1492
|
+
}
|
|
1493
|
+
setOptions(t) {
|
|
1494
|
+
const s = this.options, n = o(this, U);
|
|
1495
|
+
if (this.options = o(this, le).defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof xe(this.options.enabled, o(this, U)) != "boolean")
|
|
1496
|
+
throw new Error(
|
|
1497
|
+
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
1498
|
+
);
|
|
1499
|
+
Z(this, V, Xt).call(this), o(this, U).setOptions(this.options), s._defaulted && !qt(this.options, s) && o(this, le).getQueryCache().notify({
|
|
1500
|
+
type: "observerOptionsUpdated",
|
|
1501
|
+
query: o(this, U),
|
|
1502
|
+
observer: this
|
|
1503
|
+
});
|
|
1504
|
+
const i = this.hasListeners();
|
|
1505
|
+
i && gr(
|
|
1506
|
+
o(this, U),
|
|
1507
|
+
n,
|
|
1508
|
+
this.options,
|
|
1509
|
+
s
|
|
1510
|
+
) && Z(this, V, _t).call(this), this.updateResult(), i && (o(this, U) !== n || xe(this.options.enabled, o(this, U)) !== xe(s.enabled, o(this, U)) || Rt(this.options.staleTime, o(this, U)) !== Rt(s.staleTime, o(this, U))) && Z(this, V, zt).call(this);
|
|
1511
|
+
const f = Z(this, V, Qt).call(this);
|
|
1512
|
+
i && (o(this, U) !== n || xe(this.options.enabled, o(this, U)) !== xe(s.enabled, o(this, U)) || f !== o(this, Be)) && Z(this, V, Ht).call(this, f);
|
|
1513
|
+
}
|
|
1514
|
+
getOptimisticResult(t) {
|
|
1515
|
+
const s = o(this, le).getQueryCache().build(o(this, le), t), n = this.createResult(s, t);
|
|
1516
|
+
return ns(this, n) && (F(this, ae, n), F(this, ut, this.options), F(this, Je, o(this, U).state)), n;
|
|
1517
|
+
}
|
|
1518
|
+
getCurrentResult() {
|
|
1519
|
+
return o(this, ae);
|
|
1520
|
+
}
|
|
1521
|
+
trackResult(t, s) {
|
|
1522
|
+
return new Proxy(t, {
|
|
1523
|
+
get: (n, i) => (this.trackProp(i), s == null || s(i), i === "promise" && (this.trackProp("data"), !this.options.experimental_prefetchInRender && o(this, Ce).status === "pending" && o(this, Ce).reject(
|
|
1524
|
+
new Error(
|
|
1525
|
+
"experimental_prefetchInRender feature flag is not enabled"
|
|
1526
|
+
)
|
|
1527
|
+
)), Reflect.get(n, i))
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
trackProp(t) {
|
|
1531
|
+
o(this, ht).add(t);
|
|
1532
|
+
}
|
|
1533
|
+
getCurrentQuery() {
|
|
1534
|
+
return o(this, U);
|
|
1535
|
+
}
|
|
1536
|
+
refetch({ ...t } = {}) {
|
|
1537
|
+
return this.fetch({
|
|
1538
|
+
...t
|
|
1539
|
+
});
|
|
1540
|
+
}
|
|
1541
|
+
fetchOptimistic(t) {
|
|
1542
|
+
const s = o(this, le).defaultQueryOptions(t), n = o(this, le).getQueryCache().build(o(this, le), s);
|
|
1543
|
+
return n.fetch().then(() => this.createResult(n, s));
|
|
1544
|
+
}
|
|
1545
|
+
fetch(t) {
|
|
1546
|
+
return Z(this, V, _t).call(this, {
|
|
1547
|
+
...t,
|
|
1548
|
+
cancelRefetch: t.cancelRefetch ?? !0
|
|
1549
|
+
}).then(() => (this.updateResult(), o(this, ae)));
|
|
1550
|
+
}
|
|
1551
|
+
createResult(t, s) {
|
|
1552
|
+
var P;
|
|
1553
|
+
const n = o(this, U), i = this.options, f = o(this, ae), u = o(this, Je), g = o(this, ut), y = t !== n ? t.state : o(this, Ct), { state: h } = t;
|
|
1554
|
+
let l = { ...h }, v = !1, w;
|
|
1555
|
+
if (s._optimisticResults) {
|
|
1556
|
+
const j = this.hasListeners(), R = !j && pr(t, s), M = j && gr(t, n, s, i);
|
|
1557
|
+
(R || M) && (l = {
|
|
1558
|
+
...l,
|
|
1559
|
+
...ts(h.data, t.options)
|
|
1560
|
+
}), s._optimisticResults === "isRestoring" && (l.fetchStatus = "idle");
|
|
1561
|
+
}
|
|
1562
|
+
let { error: k, errorUpdatedAt: N, status: _ } = l;
|
|
1563
|
+
w = l.data;
|
|
1564
|
+
let I = !1;
|
|
1565
|
+
if (s.placeholderData !== void 0 && w === void 0 && _ === "pending") {
|
|
1566
|
+
let j;
|
|
1567
|
+
f != null && f.isPlaceholderData && s.placeholderData === (g == null ? void 0 : g.placeholderData) ? (j = f.data, I = !0) : j = typeof s.placeholderData == "function" ? s.placeholderData(
|
|
1568
|
+
(P = o(this, ft)) == null ? void 0 : P.state.data,
|
|
1569
|
+
o(this, ft)
|
|
1570
|
+
) : s.placeholderData, j !== void 0 && (_ = "success", w = fr(
|
|
1571
|
+
f == null ? void 0 : f.data,
|
|
1572
|
+
j,
|
|
1573
|
+
s
|
|
1574
|
+
), v = !0);
|
|
1118
1575
|
}
|
|
1576
|
+
if (s.select && w !== void 0 && !I)
|
|
1577
|
+
if (f && w === (u == null ? void 0 : u.data) && s.select === o(this, jt))
|
|
1578
|
+
w = o(this, dt);
|
|
1579
|
+
else
|
|
1580
|
+
try {
|
|
1581
|
+
F(this, jt, s.select), w = s.select(w), w = fr(f == null ? void 0 : f.data, w, s), F(this, dt, w), F(this, Fe, null);
|
|
1582
|
+
} catch (j) {
|
|
1583
|
+
F(this, Fe, j);
|
|
1584
|
+
}
|
|
1585
|
+
o(this, Fe) && (k = o(this, Fe), w = o(this, dt), N = Date.now(), _ = "error");
|
|
1586
|
+
const p = l.fetchStatus === "fetching", E = _ === "pending", T = _ === "error", b = E && p, m = w !== void 0, C = {
|
|
1587
|
+
status: _,
|
|
1588
|
+
fetchStatus: l.fetchStatus,
|
|
1589
|
+
isPending: E,
|
|
1590
|
+
isSuccess: _ === "success",
|
|
1591
|
+
isError: T,
|
|
1592
|
+
isInitialLoading: b,
|
|
1593
|
+
isLoading: b,
|
|
1594
|
+
data: w,
|
|
1595
|
+
dataUpdatedAt: l.dataUpdatedAt,
|
|
1596
|
+
error: k,
|
|
1597
|
+
errorUpdatedAt: N,
|
|
1598
|
+
failureCount: l.fetchFailureCount,
|
|
1599
|
+
failureReason: l.fetchFailureReason,
|
|
1600
|
+
errorUpdateCount: l.errorUpdateCount,
|
|
1601
|
+
isFetched: l.dataUpdateCount > 0 || l.errorUpdateCount > 0,
|
|
1602
|
+
isFetchedAfterMount: l.dataUpdateCount > y.dataUpdateCount || l.errorUpdateCount > y.errorUpdateCount,
|
|
1603
|
+
isFetching: p,
|
|
1604
|
+
isRefetching: p && !E,
|
|
1605
|
+
isLoadingError: T && !m,
|
|
1606
|
+
isPaused: l.fetchStatus === "paused",
|
|
1607
|
+
isPlaceholderData: v,
|
|
1608
|
+
isRefetchError: T && m,
|
|
1609
|
+
isStale: tr(t, s),
|
|
1610
|
+
refetch: this.refetch,
|
|
1611
|
+
promise: o(this, Ce),
|
|
1612
|
+
isEnabled: xe(s.enabled, t) !== !1
|
|
1613
|
+
};
|
|
1614
|
+
if (this.options.experimental_prefetchInRender) {
|
|
1615
|
+
const j = (A) => {
|
|
1616
|
+
C.status === "error" ? A.reject(C.error) : C.data !== void 0 && A.resolve(C.data);
|
|
1617
|
+
}, R = () => {
|
|
1618
|
+
const A = F(this, Ce, C.promise = hr());
|
|
1619
|
+
j(A);
|
|
1620
|
+
}, M = o(this, Ce);
|
|
1621
|
+
switch (M.status) {
|
|
1622
|
+
case "pending":
|
|
1623
|
+
t.queryHash === n.queryHash && j(M);
|
|
1624
|
+
break;
|
|
1625
|
+
case "fulfilled":
|
|
1626
|
+
(C.status === "error" || C.data !== M.value) && R();
|
|
1627
|
+
break;
|
|
1628
|
+
case "rejected":
|
|
1629
|
+
(C.status !== "error" || C.error !== M.reason) && R();
|
|
1630
|
+
break;
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
return C;
|
|
1634
|
+
}
|
|
1635
|
+
updateResult() {
|
|
1636
|
+
const t = o(this, ae), s = this.createResult(o(this, U), this.options);
|
|
1637
|
+
if (F(this, Je, o(this, U).state), F(this, ut, this.options), o(this, Je).data !== void 0 && F(this, ft, o(this, U)), qt(s, t))
|
|
1638
|
+
return;
|
|
1639
|
+
F(this, ae, s);
|
|
1640
|
+
const n = () => {
|
|
1641
|
+
if (!t)
|
|
1642
|
+
return !0;
|
|
1643
|
+
const { notifyOnChangeProps: i } = this.options, f = typeof i == "function" ? i() : i;
|
|
1644
|
+
if (f === "all" || !f && !o(this, ht).size)
|
|
1645
|
+
return !0;
|
|
1646
|
+
const u = new Set(
|
|
1647
|
+
f ?? o(this, ht)
|
|
1648
|
+
);
|
|
1649
|
+
return this.options.throwOnError && u.add("error"), Object.keys(o(this, ae)).some((g) => {
|
|
1650
|
+
const d = g;
|
|
1651
|
+
return o(this, ae)[d] !== t[d] && u.has(d);
|
|
1652
|
+
});
|
|
1653
|
+
};
|
|
1654
|
+
Z(this, V, Rr).call(this, { listeners: n() });
|
|
1655
|
+
}
|
|
1656
|
+
onQueryUpdate() {
|
|
1657
|
+
this.updateResult(), this.hasListeners() && Z(this, V, Yt).call(this);
|
|
1658
|
+
}
|
|
1659
|
+
}, le = new WeakMap(), U = new WeakMap(), Ct = new WeakMap(), ae = new WeakMap(), Je = new WeakMap(), ut = new WeakMap(), Ce = new WeakMap(), Fe = new WeakMap(), jt = new WeakMap(), dt = new WeakMap(), ft = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), Be = new WeakMap(), ht = new WeakMap(), V = new WeakSet(), _t = function(t) {
|
|
1660
|
+
Z(this, V, Xt).call(this);
|
|
1661
|
+
let s = o(this, U).fetch(
|
|
1662
|
+
this.options,
|
|
1663
|
+
t
|
|
1664
|
+
);
|
|
1665
|
+
return t != null && t.throwOnError || (s = s.catch(Vt)), s;
|
|
1666
|
+
}, zt = function() {
|
|
1667
|
+
Z(this, V, Gt).call(this);
|
|
1668
|
+
const t = Rt(
|
|
1669
|
+
this.options.staleTime,
|
|
1670
|
+
o(this, U)
|
|
1671
|
+
);
|
|
1672
|
+
if (St || o(this, ae).isStale || !cr(t))
|
|
1673
|
+
return;
|
|
1674
|
+
const n = qr(o(this, ae).dataUpdatedAt, t) + 1;
|
|
1675
|
+
F(this, Xe, Mt.setTimeout(() => {
|
|
1676
|
+
o(this, ae).isStale || this.updateResult();
|
|
1677
|
+
}, n));
|
|
1678
|
+
}, Qt = function() {
|
|
1679
|
+
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(o(this, U)) : this.options.refetchInterval) ?? !1;
|
|
1680
|
+
}, Ht = function(t) {
|
|
1681
|
+
Z(this, V, Jt).call(this), F(this, Be, t), !(St || xe(this.options.enabled, o(this, U)) === !1 || !cr(o(this, Be)) || o(this, Be) === 0) && F(this, Ze, Mt.setInterval(() => {
|
|
1682
|
+
(this.options.refetchIntervalInBackground || Yr.isFocused()) && Z(this, V, _t).call(this);
|
|
1683
|
+
}, o(this, Be)));
|
|
1684
|
+
}, Yt = function() {
|
|
1685
|
+
Z(this, V, zt).call(this), Z(this, V, Ht).call(this, Z(this, V, Qt).call(this));
|
|
1686
|
+
}, Gt = function() {
|
|
1687
|
+
o(this, Xe) && (Mt.clearTimeout(o(this, Xe)), F(this, Xe, void 0));
|
|
1688
|
+
}, Jt = function() {
|
|
1689
|
+
o(this, Ze) && (Mt.clearInterval(o(this, Ze)), F(this, Ze, void 0));
|
|
1690
|
+
}, Xt = function() {
|
|
1691
|
+
const t = o(this, le).getQueryCache().build(o(this, le), this.options);
|
|
1692
|
+
if (t === o(this, U))
|
|
1693
|
+
return;
|
|
1694
|
+
const s = o(this, U);
|
|
1695
|
+
F(this, U, t), F(this, Ct, t.state), this.hasListeners() && (s == null || s.removeObserver(this), t.addObserver(this));
|
|
1696
|
+
}, Rr = function(t) {
|
|
1697
|
+
Tr.batch(() => {
|
|
1698
|
+
t.listeners && this.listeners.forEach((s) => {
|
|
1699
|
+
s(o(this, ae));
|
|
1700
|
+
}), o(this, le).getQueryCache().notify({
|
|
1701
|
+
query: o(this, U),
|
|
1702
|
+
type: "observerResultsUpdated"
|
|
1703
|
+
});
|
|
1704
|
+
});
|
|
1705
|
+
}, wr);
|
|
1706
|
+
function ss(e, t) {
|
|
1707
|
+
return xe(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
1708
|
+
}
|
|
1709
|
+
function pr(e, t) {
|
|
1710
|
+
return ss(e, t) || e.state.data !== void 0 && Zt(e, t, t.refetchOnMount);
|
|
1711
|
+
}
|
|
1712
|
+
function Zt(e, t, s) {
|
|
1713
|
+
if (xe(t.enabled, e) !== !1 && Rt(t.staleTime, e) !== "static") {
|
|
1714
|
+
const n = typeof s == "function" ? s(e) : s;
|
|
1715
|
+
return n === "always" || n !== !1 && tr(e, t);
|
|
1716
|
+
}
|
|
1717
|
+
return !1;
|
|
1718
|
+
}
|
|
1719
|
+
function gr(e, t, s, n) {
|
|
1720
|
+
return (e !== t || xe(n.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && tr(e, s);
|
|
1721
|
+
}
|
|
1722
|
+
function tr(e, t) {
|
|
1723
|
+
return xe(t.enabled, e) !== !1 && e.isStaleByTime(Rt(t.staleTime, e));
|
|
1724
|
+
}
|
|
1725
|
+
function ns(e, t) {
|
|
1726
|
+
return !qt(e.getCurrentResult(), t);
|
|
1727
|
+
}
|
|
1728
|
+
var is = we.createContext(
|
|
1729
|
+
void 0
|
|
1730
|
+
), Sr = (e) => {
|
|
1731
|
+
const t = we.useContext(is);
|
|
1732
|
+
if (!t)
|
|
1733
|
+
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
1734
|
+
return t;
|
|
1735
|
+
}, Cr = we.createContext(!1), as = () => we.useContext(Cr);
|
|
1736
|
+
Cr.Provider;
|
|
1737
|
+
function os() {
|
|
1738
|
+
let e = !1;
|
|
1739
|
+
return {
|
|
1740
|
+
clearReset: () => {
|
|
1741
|
+
e = !1;
|
|
1742
|
+
},
|
|
1743
|
+
reset: () => {
|
|
1744
|
+
e = !0;
|
|
1745
|
+
},
|
|
1746
|
+
isReset: () => e
|
|
1747
|
+
};
|
|
1748
|
+
}
|
|
1749
|
+
var cs = we.createContext(os()), ls = () => we.useContext(cs), us = (e, t) => {
|
|
1750
|
+
(e.suspense || e.throwOnError || e.experimental_prefetchInRender) && (t.isReset() || (e.retryOnMount = !1));
|
|
1751
|
+
}, ds = (e) => {
|
|
1752
|
+
we.useEffect(() => {
|
|
1753
|
+
e.clearReset();
|
|
1754
|
+
}, [e]);
|
|
1755
|
+
}, fs = ({
|
|
1756
|
+
result: e,
|
|
1757
|
+
errorResetBoundary: t,
|
|
1758
|
+
throwOnError: s,
|
|
1759
|
+
query: n,
|
|
1760
|
+
suspense: i
|
|
1761
|
+
}) => e.isError && !t.isReset() && !e.isFetching && n && (i && e.data === void 0 || Qr(s, [e.error, n])), hs = (e) => {
|
|
1762
|
+
if (e.suspense) {
|
|
1763
|
+
const s = (i) => i === "static" ? i : Math.max(i ?? 1e3, 1e3), n = e.staleTime;
|
|
1764
|
+
e.staleTime = typeof n == "function" ? (...i) => s(n(...i)) : s(n), typeof e.gcTime == "number" && (e.gcTime = Math.max(
|
|
1765
|
+
e.gcTime,
|
|
1766
|
+
1e3
|
|
1767
|
+
));
|
|
1768
|
+
}
|
|
1769
|
+
}, ps = (e, t) => e.isLoading && e.isFetching && !t, gs = (e, t) => (e == null ? void 0 : e.suspense) && t.isPending, br = (e, t, s) => t.fetchOptimistic(e).catch(() => {
|
|
1770
|
+
s.clearReset();
|
|
1771
|
+
});
|
|
1772
|
+
function bs(e, t, s) {
|
|
1773
|
+
var l, v, w, k, N;
|
|
1774
|
+
if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
|
|
1775
|
+
throw new Error(
|
|
1776
|
+
'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'
|
|
1777
|
+
);
|
|
1778
|
+
const n = as(), i = ls(), f = Sr(), u = f.defaultQueryOptions(e);
|
|
1779
|
+
(v = (l = f.getDefaultOptions().queries) == null ? void 0 : l._experimental_beforeQuery) == null || v.call(
|
|
1780
|
+
l,
|
|
1781
|
+
u
|
|
1782
|
+
), process.env.NODE_ENV !== "production" && (u.queryFn || console.error(
|
|
1783
|
+
`[${u.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`
|
|
1784
|
+
)), u._optimisticResults = n ? "isRestoring" : "optimistic", hs(u), us(u, i), ds(i);
|
|
1785
|
+
const g = !f.getQueryCache().get(u.queryHash), [d] = we.useState(
|
|
1786
|
+
() => new t(
|
|
1787
|
+
f,
|
|
1788
|
+
u
|
|
1789
|
+
)
|
|
1790
|
+
), y = d.getOptimisticResult(u), h = !n && e.subscribed !== !1;
|
|
1791
|
+
if (we.useSyncExternalStore(
|
|
1792
|
+
we.useCallback(
|
|
1793
|
+
(_) => {
|
|
1794
|
+
const I = h ? d.subscribe(Tr.batchCalls(_)) : Vt;
|
|
1795
|
+
return d.updateResult(), I;
|
|
1796
|
+
},
|
|
1797
|
+
[d, h]
|
|
1798
|
+
),
|
|
1799
|
+
() => d.getCurrentResult(),
|
|
1800
|
+
() => d.getCurrentResult()
|
|
1801
|
+
), we.useEffect(() => {
|
|
1802
|
+
d.setOptions(u);
|
|
1803
|
+
}, [u, d]), gs(u, y))
|
|
1804
|
+
throw br(u, d, i);
|
|
1805
|
+
if (fs({
|
|
1806
|
+
result: y,
|
|
1807
|
+
errorResetBoundary: i,
|
|
1808
|
+
throwOnError: u.throwOnError,
|
|
1809
|
+
query: f.getQueryCache().get(u.queryHash),
|
|
1810
|
+
suspense: u.suspense
|
|
1811
|
+
}))
|
|
1812
|
+
throw y.error;
|
|
1813
|
+
if ((k = (w = f.getDefaultOptions().queries) == null ? void 0 : w._experimental_afterQuery) == null || k.call(
|
|
1814
|
+
w,
|
|
1815
|
+
u,
|
|
1816
|
+
y
|
|
1817
|
+
), u.experimental_prefetchInRender && !St && ps(y, n)) {
|
|
1818
|
+
const _ = g ? (
|
|
1819
|
+
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1820
|
+
br(u, d, i)
|
|
1821
|
+
) : (
|
|
1822
|
+
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
1823
|
+
(N = f.getQueryCache().get(u.queryHash)) == null ? void 0 : N.promise
|
|
1824
|
+
);
|
|
1825
|
+
_ == null || _.catch(Vt).finally(() => {
|
|
1826
|
+
d.updateResult();
|
|
1827
|
+
});
|
|
1828
|
+
}
|
|
1829
|
+
return u.notifyOnChangeProps ? y : d.trackResult(y);
|
|
1830
|
+
}
|
|
1831
|
+
function jr(e, t) {
|
|
1832
|
+
return bs(e, rs);
|
|
1833
|
+
}
|
|
1834
|
+
const ms = (e) => {
|
|
1835
|
+
const t = Sr(), s = _r();
|
|
1836
|
+
return se(() => {
|
|
1837
|
+
const n = s.channel("animation-states-changes").on("postgres_changes", {
|
|
1838
|
+
event: "*",
|
|
1839
|
+
schema: "public",
|
|
1840
|
+
table: "animation_states"
|
|
1841
|
+
}, () => {
|
|
1842
|
+
t.invalidateQueries({ queryKey: ["bob-animation-data"] });
|
|
1843
|
+
}).subscribe(), i = s.channel("bob-animations-changes").on("postgres_changes", {
|
|
1844
|
+
event: "*",
|
|
1845
|
+
schema: "public",
|
|
1846
|
+
table: "bob_animations"
|
|
1847
|
+
}, () => {
|
|
1848
|
+
t.invalidateQueries({ queryKey: ["bob-animation-data"] });
|
|
1849
|
+
}).subscribe();
|
|
1850
|
+
return () => {
|
|
1851
|
+
s.removeChannel(n), s.removeChannel(i);
|
|
1852
|
+
};
|
|
1853
|
+
}, [t, s]), jr({
|
|
1854
|
+
queryKey: ["bob-animation-data", e],
|
|
1855
|
+
queryFn: async () => {
|
|
1856
|
+
var _;
|
|
1857
|
+
const { data: n, error: i } = await s.from("bob_looks").select("*").order("display_order");
|
|
1858
|
+
if (i) throw i;
|
|
1859
|
+
const f = (n || []).find((I) => I.is_active), u = e || (f == null ? void 0 : f.id) || n && ((_ = n[0]) == null ? void 0 : _.id) || null;
|
|
1860
|
+
if (!u)
|
|
1861
|
+
return {
|
|
1862
|
+
states: [],
|
|
1863
|
+
configs: [],
|
|
1864
|
+
uploadedImages: [],
|
|
1865
|
+
looks: n || [],
|
|
1866
|
+
activeLookId: null
|
|
1867
|
+
};
|
|
1868
|
+
const { data: g, error: d } = await s.from("animation_states").select("*").eq("is_active", !0).eq("look_id", u).order("display_order");
|
|
1869
|
+
if (d) throw d;
|
|
1870
|
+
const { data: y, error: h } = await s.from("bob_animations").select("*").eq("is_active", !0).eq("look_id", u).order("animation_state").order("sequence_order");
|
|
1871
|
+
if (h) throw h;
|
|
1872
|
+
const l = new Set((g || []).map((I) => I.state_key)), v = (y || []).filter((I) => l.has(I.animation_state)), { data: w, error: k } = await s.storage.from("bob-images").list();
|
|
1873
|
+
if (k) throw k;
|
|
1874
|
+
const N = (w || []).map((I) => {
|
|
1875
|
+
const { data: p } = s.storage.from("bob-images").getPublicUrl(I.name);
|
|
1876
|
+
return p.publicUrl;
|
|
1877
|
+
});
|
|
1878
|
+
return v.forEach((I) => {
|
|
1879
|
+
const p = new Image();
|
|
1880
|
+
p.src = I.image_url;
|
|
1881
|
+
}), {
|
|
1882
|
+
states: g || [],
|
|
1883
|
+
configs: v,
|
|
1884
|
+
uploadedImages: N,
|
|
1885
|
+
looks: n || [],
|
|
1886
|
+
activeLookId: u
|
|
1887
|
+
};
|
|
1888
|
+
},
|
|
1889
|
+
staleTime: 30 * 1e3,
|
|
1890
|
+
gcTime: 5 * 60 * 1e3
|
|
1891
|
+
});
|
|
1892
|
+
}, vs = () => {
|
|
1893
|
+
const [e, t] = Q(""), [s, n] = Q(0), [i, f] = Q(400), [u, g] = Q(!1), d = H(), { data: y, isLoading: h } = ms(), l = H({}), { imageUrlsMap: v, alternateImages: w, offsetsMap: k, scalesMap: N, availableStates: _ } = Ft(() => {
|
|
1894
|
+
if (!y)
|
|
1895
|
+
return {
|
|
1896
|
+
imageUrlsMap: {},
|
|
1897
|
+
alternateImages: {},
|
|
1898
|
+
offsetsMap: {},
|
|
1899
|
+
scalesMap: {},
|
|
1900
|
+
availableStates: []
|
|
1901
|
+
};
|
|
1902
|
+
const T = {}, b = {}, m = {}, S = {}, C = y.states.map((P) => P.state_key);
|
|
1903
|
+
return C.forEach((P) => {
|
|
1904
|
+
const j = y.configs.filter((L) => L.animation_state === P), R = j.map((L) => L.image_url), M = j.map((L) => L.vertical_offset || 0), A = j.map((L) => L.scale || 100);
|
|
1905
|
+
if (R.length > 0) {
|
|
1906
|
+
const L = y.states.find((te) => te.state_key === P);
|
|
1907
|
+
T[P] = {
|
|
1908
|
+
url: R[0],
|
|
1909
|
+
animation_speed: (L == null ? void 0 : L.animation_speed) || 400,
|
|
1910
|
+
pause_duration: (L == null ? void 0 : L.pause_duration) || 0,
|
|
1911
|
+
loop_count: (L == null ? void 0 : L.loop_count) || 0
|
|
1912
|
+
}, b[P] = R, m[P] = M, S[P] = A;
|
|
1913
|
+
}
|
|
1914
|
+
}), {
|
|
1915
|
+
imageUrlsMap: T,
|
|
1916
|
+
alternateImages: b,
|
|
1917
|
+
offsetsMap: m,
|
|
1918
|
+
scalesMap: S,
|
|
1919
|
+
availableStates: C
|
|
1920
|
+
};
|
|
1921
|
+
}, [y]);
|
|
1922
|
+
return se(() => {
|
|
1923
|
+
l.current = v;
|
|
1924
|
+
}, [v]), se(() => {
|
|
1925
|
+
_.length > 0 && !e && t(_[0]);
|
|
1926
|
+
}, [_, e]), se(() => {
|
|
1927
|
+
const T = w[e];
|
|
1928
|
+
if (d.current && clearInterval(d.current), T && T.length > 1) {
|
|
1929
|
+
n(0);
|
|
1930
|
+
const b = l.current[e], m = (b == null ? void 0 : b.animation_speed) || i || 400, S = (b == null ? void 0 : b.loop_count) || 0, C = (b == null ? void 0 : b.pause_duration) || 0;
|
|
1931
|
+
let P = 0, j = !1;
|
|
1932
|
+
const R = () => {
|
|
1933
|
+
d.current = setInterval(() => {
|
|
1934
|
+
j || n((M) => {
|
|
1935
|
+
const A = (M + 1) % T.length;
|
|
1936
|
+
return A === 0 && (P++, S > 0 && P >= S) ? (clearInterval(d.current), C > 0 && (j = !0, setTimeout(() => {
|
|
1937
|
+
P = 0, j = !1, R();
|
|
1938
|
+
}, C)), M) : A;
|
|
1939
|
+
});
|
|
1940
|
+
}, m);
|
|
1941
|
+
};
|
|
1942
|
+
R();
|
|
1943
|
+
} else
|
|
1944
|
+
n(0);
|
|
1945
|
+
return () => {
|
|
1946
|
+
d.current && clearInterval(d.current);
|
|
1947
|
+
};
|
|
1948
|
+
}, [e, w]), {
|
|
1949
|
+
animationState: e,
|
|
1950
|
+
setAnimationState: t,
|
|
1951
|
+
getCurrentImage: () => {
|
|
1952
|
+
const T = w[e];
|
|
1953
|
+
if (!T || T.length === 0) {
|
|
1954
|
+
const b = _.find((m) => {
|
|
1955
|
+
var S;
|
|
1956
|
+
return ((S = w[m]) == null ? void 0 : S.length) > 0;
|
|
1957
|
+
});
|
|
1958
|
+
return b ? w[b][0] : "";
|
|
1959
|
+
}
|
|
1960
|
+
return T[s] || T[0];
|
|
1961
|
+
},
|
|
1962
|
+
getCurrentOffset: () => {
|
|
1963
|
+
const T = k[e];
|
|
1964
|
+
if (!T || T.length === 0) {
|
|
1965
|
+
const b = _.find((m) => {
|
|
1966
|
+
var S;
|
|
1967
|
+
return ((S = k[m]) == null ? void 0 : S.length) > 0;
|
|
1968
|
+
});
|
|
1969
|
+
return b ? k[b][0] : 0;
|
|
1970
|
+
}
|
|
1971
|
+
return T[s] || T[0];
|
|
1972
|
+
},
|
|
1973
|
+
getCurrentScale: () => {
|
|
1974
|
+
const T = N[e];
|
|
1975
|
+
if (!T || T.length === 0) {
|
|
1976
|
+
const b = _.find((m) => {
|
|
1977
|
+
var S;
|
|
1978
|
+
return ((S = N[m]) == null ? void 0 : S.length) > 0;
|
|
1979
|
+
});
|
|
1980
|
+
return b ? N[b][0] : 100;
|
|
1981
|
+
}
|
|
1982
|
+
return T[s] || T[0];
|
|
1983
|
+
},
|
|
1984
|
+
imageUrls: v,
|
|
1985
|
+
availableStates: _,
|
|
1986
|
+
setTalkSpeed: f,
|
|
1987
|
+
manualMode: u,
|
|
1988
|
+
setManualMode: g,
|
|
1989
|
+
isLoading: h
|
|
1119
1990
|
};
|
|
1120
|
-
},
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1991
|
+
}, ys = () => {
|
|
1992
|
+
const e = _r(), { data: t = [], isLoading: s } = jr({
|
|
1993
|
+
queryKey: ["bob-backdrops"],
|
|
1994
|
+
queryFn: async () => {
|
|
1995
|
+
const { data: i, error: f } = await e.from("bob_backdrops").select("*").order("display_order", { ascending: !0 });
|
|
1996
|
+
if (f) throw f;
|
|
1997
|
+
return i;
|
|
1998
|
+
},
|
|
1999
|
+
staleTime: 5 * 60 * 1e3,
|
|
2000
|
+
gcTime: 10 * 60 * 1e3
|
|
2001
|
+
}), n = t.find((i) => i.is_active);
|
|
2002
|
+
return {
|
|
2003
|
+
backdrops: t,
|
|
2004
|
+
activeBackdrop: n,
|
|
2005
|
+
isLoading: s
|
|
2006
|
+
};
|
|
2007
|
+
}, xs = ({
|
|
2008
|
+
currentImage: e,
|
|
2009
|
+
animationState: t,
|
|
2010
|
+
backdropUrl: s,
|
|
2011
|
+
counterOverlayUrl: n,
|
|
2012
|
+
counterHeightPercent: i = 12,
|
|
2013
|
+
className: f = "",
|
|
2014
|
+
verticalOffset: u = 0,
|
|
2015
|
+
scale: g = 100
|
|
1129
2016
|
}) => {
|
|
1130
|
-
const
|
|
1131
|
-
return /* @__PURE__ */
|
|
1132
|
-
|
|
2017
|
+
const d = u + i, y = 55 * (g / 100);
|
|
2018
|
+
return /* @__PURE__ */ a.jsx("div", { className: `flex flex-col items-center justify-center gap-6 w-full ${f}`, children: /* @__PURE__ */ a.jsxs("div", { className: "relative w-full max-w-[600px] mx-auto aspect-[16/10] overflow-hidden", children: [
|
|
2019
|
+
s && /* @__PURE__ */ a.jsx(
|
|
1133
2020
|
"img",
|
|
1134
2021
|
{
|
|
1135
|
-
src:
|
|
2022
|
+
src: s,
|
|
1136
2023
|
alt: "Backdrop",
|
|
1137
2024
|
className: "absolute inset-0 z-0 w-full h-full object-cover object-bottom"
|
|
1138
2025
|
}
|
|
1139
2026
|
),
|
|
1140
|
-
/* @__PURE__ */
|
|
2027
|
+
/* @__PURE__ */ a.jsx(
|
|
1141
2028
|
"img",
|
|
1142
2029
|
{
|
|
1143
|
-
src:
|
|
1144
|
-
alt: `Bob ${
|
|
2030
|
+
src: e,
|
|
2031
|
+
alt: `Bob ${t}`,
|
|
1145
2032
|
className: "absolute z-10 h-auto object-contain left-1/2 -translate-x-1/2",
|
|
1146
2033
|
style: {
|
|
1147
|
-
bottom: `${
|
|
1148
|
-
width: `${
|
|
1149
|
-
maxWidth: `${220 * (
|
|
2034
|
+
bottom: `${d}%`,
|
|
2035
|
+
width: `${y}%`,
|
|
2036
|
+
maxWidth: `${220 * (g / 100)}px`,
|
|
1150
2037
|
transformOrigin: "center bottom"
|
|
1151
2038
|
}
|
|
1152
2039
|
}
|
|
1153
2040
|
),
|
|
1154
|
-
|
|
2041
|
+
n && /* @__PURE__ */ a.jsx(
|
|
1155
2042
|
"img",
|
|
1156
2043
|
{
|
|
1157
|
-
src:
|
|
2044
|
+
src: n,
|
|
1158
2045
|
alt: "Counter",
|
|
1159
2046
|
className: "absolute z-20 bottom-0 left-0 w-full object-cover object-bottom",
|
|
1160
|
-
style: { height: `${
|
|
2047
|
+
style: { height: `${i}%` }
|
|
1161
2048
|
}
|
|
1162
2049
|
)
|
|
1163
2050
|
] }) });
|
|
1164
|
-
},
|
|
1165
|
-
messages:
|
|
1166
|
-
input:
|
|
1167
|
-
setInput:
|
|
1168
|
-
isLoading:
|
|
1169
|
-
onSend:
|
|
1170
|
-
onKeyPress:
|
|
1171
|
-
onInputFocus:
|
|
1172
|
-
onInputBlur:
|
|
1173
|
-
chatEndRef:
|
|
1174
|
-
isMuted:
|
|
1175
|
-
onToggleMute:
|
|
1176
|
-
isSpeaking:
|
|
1177
|
-
className:
|
|
1178
|
-
}) => /* @__PURE__ */
|
|
1179
|
-
/* @__PURE__ */
|
|
1180
|
-
/* @__PURE__ */
|
|
2051
|
+
}, ws = ({
|
|
2052
|
+
messages: e,
|
|
2053
|
+
input: t,
|
|
2054
|
+
setInput: s,
|
|
2055
|
+
isLoading: n,
|
|
2056
|
+
onSend: i,
|
|
2057
|
+
onKeyPress: f,
|
|
2058
|
+
onInputFocus: u,
|
|
2059
|
+
onInputBlur: g,
|
|
2060
|
+
chatEndRef: d,
|
|
2061
|
+
isMuted: y = !1,
|
|
2062
|
+
onToggleMute: h,
|
|
2063
|
+
isSpeaking: l = !1,
|
|
2064
|
+
className: v = ""
|
|
2065
|
+
}) => /* @__PURE__ */ a.jsx("div", { className: `w-full max-w-6xl mx-auto px-4 pb-8 ${v}`, children: /* @__PURE__ */ a.jsxs("div", { className: "bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg overflow-hidden", children: [
|
|
2066
|
+
/* @__PURE__ */ a.jsx("div", { className: "p-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800", children: /* @__PURE__ */ a.jsxs("div", { className: "flex gap-2", children: [
|
|
2067
|
+
/* @__PURE__ */ a.jsx(
|
|
1181
2068
|
"input",
|
|
1182
2069
|
{
|
|
1183
|
-
value:
|
|
1184
|
-
onChange: (
|
|
1185
|
-
onKeyPress:
|
|
1186
|
-
onFocus:
|
|
1187
|
-
onBlur:
|
|
2070
|
+
value: t,
|
|
2071
|
+
onChange: (w) => s(w.target.value),
|
|
2072
|
+
onKeyPress: f,
|
|
2073
|
+
onFocus: u,
|
|
2074
|
+
onBlur: g,
|
|
1188
2075
|
placeholder: "Ask Bob about car parts...",
|
|
1189
|
-
disabled:
|
|
2076
|
+
disabled: n,
|
|
1190
2077
|
className: "flex-1 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
1191
2078
|
}
|
|
1192
2079
|
),
|
|
1193
|
-
|
|
2080
|
+
h && /* @__PURE__ */ a.jsx(
|
|
1194
2081
|
"button",
|
|
1195
2082
|
{
|
|
1196
|
-
onClick:
|
|
1197
|
-
className: `shrink-0 p-2 border border-gray-300 dark:border-gray-600 rounded-md ${
|
|
1198
|
-
title:
|
|
1199
|
-
children:
|
|
2083
|
+
onClick: h,
|
|
2084
|
+
className: `shrink-0 p-2 border border-gray-300 dark:border-gray-600 rounded-md ${l ? "animate-pulse" : ""}`,
|
|
2085
|
+
title: y ? "Unmute Bob's voice" : "Mute Bob's voice",
|
|
2086
|
+
children: y ? "🔇" : "🔊"
|
|
1200
2087
|
}
|
|
1201
2088
|
),
|
|
1202
|
-
/* @__PURE__ */
|
|
2089
|
+
/* @__PURE__ */ a.jsx(
|
|
1203
2090
|
"button",
|
|
1204
2091
|
{
|
|
1205
|
-
onClick:
|
|
1206
|
-
disabled:
|
|
2092
|
+
onClick: i,
|
|
2093
|
+
disabled: n || !t.trim(),
|
|
1207
2094
|
className: "shrink-0 px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1208
2095
|
children: "Send"
|
|
1209
2096
|
}
|
|
1210
2097
|
)
|
|
1211
2098
|
] }) }),
|
|
1212
|
-
/* @__PURE__ */
|
|
1213
|
-
[...
|
|
2099
|
+
/* @__PURE__ */ a.jsxs("div", { className: "overflow-y-auto p-4 space-y-3 h-[300px] md:h-[400px]", children: [
|
|
2100
|
+
[...e].reverse().map((w, k) => /* @__PURE__ */ a.jsx(
|
|
1214
2101
|
"div",
|
|
1215
2102
|
{
|
|
1216
|
-
className: `flex ${
|
|
1217
|
-
children: /* @__PURE__ */
|
|
2103
|
+
className: `flex ${w.role === "user" ? "justify-end" : "justify-start"}`,
|
|
2104
|
+
children: /* @__PURE__ */ a.jsx(
|
|
1218
2105
|
"div",
|
|
1219
2106
|
{
|
|
1220
|
-
className: `max-w-[80%] rounded-lg px-4 py-2 text-sm md:text-base ${
|
|
1221
|
-
children:
|
|
2107
|
+
className: `max-w-[80%] rounded-lg px-4 py-2 text-sm md:text-base ${w.role === "user" ? "bg-blue-600 text-white" : "bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-gray-100"}`,
|
|
2108
|
+
children: w.content
|
|
1222
2109
|
}
|
|
1223
2110
|
)
|
|
1224
2111
|
},
|
|
1225
|
-
|
|
2112
|
+
k
|
|
1226
2113
|
)),
|
|
1227
|
-
/* @__PURE__ */
|
|
2114
|
+
/* @__PURE__ */ a.jsx("div", { ref: d })
|
|
1228
2115
|
] })
|
|
1229
|
-
] }) }),
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
counterHeightPercent: l = 12,
|
|
1237
|
-
defaultBobImage: T,
|
|
1238
|
-
verticalOffset: c = 0,
|
|
1239
|
-
scale: h = 100
|
|
2116
|
+
] }) }), Es = ({
|
|
2117
|
+
currentImage: e,
|
|
2118
|
+
animationState: t,
|
|
2119
|
+
counterOverlayUrl: s,
|
|
2120
|
+
counterHeightPercent: n = 15,
|
|
2121
|
+
scale: i = 100,
|
|
2122
|
+
position: f = "center"
|
|
1240
2123
|
}) => {
|
|
1241
|
-
const
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
2124
|
+
const u = 85 * i / 100, g = 400 * i / 100, d = f === "center" ? "-20%" : "-35%";
|
|
2125
|
+
return /* @__PURE__ */ a.jsxs("div", { className: "absolute inset-0 pointer-events-none overflow-hidden", children: [
|
|
2126
|
+
/* @__PURE__ */ a.jsx(
|
|
2127
|
+
"div",
|
|
2128
|
+
{
|
|
2129
|
+
className: "absolute left-0 z-40",
|
|
2130
|
+
style: {
|
|
2131
|
+
bottom: `${n - 2}%`,
|
|
2132
|
+
transform: `translateX(${d})`,
|
|
2133
|
+
width: `${u}%`,
|
|
2134
|
+
maxWidth: `${g}px`,
|
|
2135
|
+
transition: "transform 0.4s ease-out"
|
|
2136
|
+
},
|
|
2137
|
+
children: /* @__PURE__ */ a.jsx(
|
|
2138
|
+
"img",
|
|
2139
|
+
{
|
|
2140
|
+
src: e,
|
|
2141
|
+
alt: `Bob ${t}`,
|
|
2142
|
+
className: "w-full h-auto object-contain",
|
|
2143
|
+
style: { display: "block" }
|
|
2144
|
+
}
|
|
2145
|
+
)
|
|
1257
2146
|
}
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
2147
|
+
),
|
|
2148
|
+
s && /* @__PURE__ */ a.jsx(
|
|
2149
|
+
"div",
|
|
2150
|
+
{
|
|
2151
|
+
className: "absolute bottom-0 left-0 right-0 z-50",
|
|
2152
|
+
style: { height: `${n}%` },
|
|
2153
|
+
children: /* @__PURE__ */ a.jsx(
|
|
2154
|
+
"img",
|
|
2155
|
+
{
|
|
2156
|
+
src: s,
|
|
2157
|
+
alt: "Shop counter",
|
|
2158
|
+
className: "w-full h-full object-cover object-top"
|
|
2159
|
+
}
|
|
2160
|
+
)
|
|
2161
|
+
}
|
|
2162
|
+
)
|
|
2163
|
+
] });
|
|
2164
|
+
}, mr = (e, t) => {
|
|
2165
|
+
if (!e || !t) return !1;
|
|
2166
|
+
const s = e.toLowerCase();
|
|
2167
|
+
return t.toLowerCase().replace(/s\b/g, "").split(/\s+/).filter(Boolean).every((i) => s.includes(i));
|
|
2168
|
+
}, _s = (e, t) => {
|
|
2169
|
+
var i;
|
|
2170
|
+
const s = ((i = e.brand) == null ? void 0 : i.toLowerCase()) === t.brand.toLowerCase(), n = Math.abs(e.price - t.price) < 1;
|
|
2171
|
+
return s && n;
|
|
2172
|
+
}, Ts = ({
|
|
2173
|
+
products: e,
|
|
2174
|
+
servicePackages: t,
|
|
2175
|
+
highlightedPartType: s,
|
|
2176
|
+
highlightedProduct: n,
|
|
2177
|
+
onProductClick: i,
|
|
2178
|
+
onPackageSelect: f,
|
|
2179
|
+
isResearching: u,
|
|
2180
|
+
visible: g = !0,
|
|
2181
|
+
counterHeightPercent: d = 22,
|
|
2182
|
+
hasVehicle: y = !1
|
|
2183
|
+
}) => {
|
|
2184
|
+
const h = H(null), l = H({}), v = H(null), w = Ft(() => {
|
|
2185
|
+
const p = {};
|
|
2186
|
+
return e.forEach((T) => {
|
|
2187
|
+
const b = T.partslotDescription || "Other Parts";
|
|
2188
|
+
p[b] || (p[b] = []), p[b].push(T);
|
|
2189
|
+
}), Object.keys(p).sort((T, b) => T.localeCompare(b)).map((T) => ({ name: T, products: p[T] }));
|
|
2190
|
+
}, [e]);
|
|
2191
|
+
se(() => {
|
|
2192
|
+
var p;
|
|
2193
|
+
if (s) {
|
|
2194
|
+
const E = w.find((T) => mr(T.name, s));
|
|
2195
|
+
E && l.current[E.name] && ((p = l.current[E.name]) == null || p.scrollIntoView({ behavior: "smooth", block: "start" }));
|
|
2196
|
+
}
|
|
2197
|
+
}, [s, w]), se(() => {
|
|
2198
|
+
n && v.current && v.current.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
2199
|
+
}, [n]);
|
|
2200
|
+
const k = e.length > 0 || t.length > 0, N = u, _ = k && !u, I = y ? "56px" : "8px";
|
|
2201
|
+
return /* @__PURE__ */ a.jsxs(
|
|
2202
|
+
"div",
|
|
2203
|
+
{
|
|
2204
|
+
ref: h,
|
|
2205
|
+
className: `absolute right-2 w-[52%] max-w-[220px] overflow-y-auto overflow-x-hidden z-30 flex flex-col gap-2 pb-4 transition-all duration-300 ease-out ${g ? "opacity-100 translate-x-0" : "opacity-0 translate-x-8 pointer-events-none"}`,
|
|
2206
|
+
style: {
|
|
2207
|
+
top: I,
|
|
2208
|
+
bottom: `calc(${d}% + 16px)`,
|
|
2209
|
+
paddingTop: "env(safe-area-inset-top, 4px)"
|
|
2210
|
+
},
|
|
2211
|
+
children: [
|
|
2212
|
+
N && /* @__PURE__ */ a.jsx("div", { className: "rounded-lg p-3", children: /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-500", children: [
|
|
2213
|
+
/* @__PURE__ */ a.jsx("div", { className: "w-4 h-4 border-2 border-blue-600 border-t-transparent rounded-full animate-spin" }),
|
|
2214
|
+
/* @__PURE__ */ a.jsx("span", { children: "Finding parts..." })
|
|
2215
|
+
] }) }),
|
|
2216
|
+
_ && t.length > 0 && /* @__PURE__ */ a.jsxs("div", { className: "space-y-2", children: [
|
|
2217
|
+
/* @__PURE__ */ a.jsxs("div", { className: "text-xs font-semibold text-blue-600 flex items-center gap-1 px-1", children: [
|
|
2218
|
+
/* @__PURE__ */ a.jsx("svg", { className: "h-3 w-3", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a.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" }) }),
|
|
2219
|
+
"Service Packages"
|
|
2220
|
+
] }),
|
|
2221
|
+
t.map((p) => /* @__PURE__ */ a.jsxs(
|
|
2222
|
+
"div",
|
|
2223
|
+
{
|
|
2224
|
+
onClick: () => f == null ? void 0 : f(p),
|
|
2225
|
+
className: "cursor-pointer hover:shadow-md transition-all bg-white/80 rounded-lg border border-gray-200 p-2",
|
|
2226
|
+
children: [
|
|
2227
|
+
/* @__PURE__ */ a.jsx("p", { className: "text-xs font-medium line-clamp-1", children: p.title }),
|
|
2228
|
+
/* @__PURE__ */ a.jsxs("p", { className: "text-sm font-bold text-blue-600", children: [
|
|
2229
|
+
"$",
|
|
2230
|
+
p.from_price.toFixed(0)
|
|
2231
|
+
] })
|
|
2232
|
+
]
|
|
2233
|
+
},
|
|
2234
|
+
p.id
|
|
2235
|
+
))
|
|
2236
|
+
] }),
|
|
2237
|
+
_ && w.map(({ name: p, products: E }, T) => {
|
|
2238
|
+
const b = s && mr(p, s);
|
|
2239
|
+
return /* @__PURE__ */ a.jsxs(
|
|
2240
|
+
"section",
|
|
2241
|
+
{
|
|
2242
|
+
ref: (m) => {
|
|
2243
|
+
l.current[p] = m;
|
|
2244
|
+
},
|
|
2245
|
+
className: `rounded-lg transition-all border border-transparent ${b ? "ring-2 ring-blue-600 p-2 bg-blue-50/50 shadow-lg" : ""}`,
|
|
2246
|
+
children: [
|
|
2247
|
+
/* @__PURE__ */ a.jsxs("h3", { className: "text-xs font-semibold mb-2 flex items-center gap-1 px-1 text-gray-900", children: [
|
|
2248
|
+
/* @__PURE__ */ a.jsx("svg", { className: "h-3 w-3 text-gray-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a.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" }) }),
|
|
2249
|
+
/* @__PURE__ */ a.jsx("span", { className: "truncate", children: p }),
|
|
2250
|
+
/* @__PURE__ */ a.jsxs("span", { className: "text-[10px] text-gray-500", children: [
|
|
2251
|
+
"(",
|
|
2252
|
+
E.length,
|
|
2253
|
+
")"
|
|
2254
|
+
] })
|
|
2255
|
+
] }),
|
|
2256
|
+
/* @__PURE__ */ a.jsx("div", { className: "space-y-2", children: E.map((m, S) => {
|
|
2257
|
+
const C = n && _s(m, n);
|
|
2258
|
+
return /* @__PURE__ */ a.jsxs(
|
|
2259
|
+
"div",
|
|
2260
|
+
{
|
|
2261
|
+
ref: C ? v : void 0,
|
|
2262
|
+
onClick: () => i == null ? void 0 : i(m),
|
|
2263
|
+
className: `cursor-pointer transition-all bg-white/80 rounded-lg border border-gray-200 relative ${C ? "ring-4 ring-blue-600 scale-105 z-10" : "hover:shadow-md"}`,
|
|
2264
|
+
children: [
|
|
2265
|
+
C && /* @__PURE__ */ a.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: [
|
|
2266
|
+
/* @__PURE__ */ a.jsx("svg", { className: "h-2 w-2 mr-0.5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ a.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" }) }),
|
|
2267
|
+
"Pick"
|
|
2268
|
+
] }),
|
|
2269
|
+
/* @__PURE__ */ a.jsxs("div", { className: "p-2", children: [
|
|
2270
|
+
/* @__PURE__ */ a.jsx("div", { className: "aspect-square bg-gray-100 rounded-md mb-1 flex items-center justify-center overflow-hidden", children: m.image_url ? /* @__PURE__ */ a.jsx("img", { src: m.image_url, alt: m.name, className: "w-full h-full object-contain" }) : /* @__PURE__ */ a.jsx("svg", { className: "h-8 w-8 text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a.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" }) }) }),
|
|
2271
|
+
/* @__PURE__ */ a.jsx("p", { className: "text-xs font-medium line-clamp-2", children: m.name }),
|
|
2272
|
+
m.brand && /* @__PURE__ */ a.jsx("p", { className: "text-[10px] text-gray-500", children: m.brand })
|
|
2273
|
+
] }),
|
|
2274
|
+
/* @__PURE__ */ a.jsx("div", { className: "px-2 pb-2", children: /* @__PURE__ */ a.jsx("span", { className: "text-sm font-bold text-blue-600", children: m.price > 0 ? `$${m.price.toFixed(2)}` : "Price on request" }) }),
|
|
2275
|
+
/* @__PURE__ */ a.jsx("div", { className: "px-2 pb-2", children: /* @__PURE__ */ a.jsx(
|
|
2276
|
+
"button",
|
|
2277
|
+
{
|
|
2278
|
+
className: "w-full bg-blue-600 text-white text-xs py-1.5 rounded-md hover:bg-blue-700",
|
|
2279
|
+
onClick: (P) => {
|
|
2280
|
+
P.stopPropagation(), i == null || i(m);
|
|
2281
|
+
},
|
|
2282
|
+
children: "Buy Now"
|
|
2283
|
+
}
|
|
2284
|
+
) })
|
|
2285
|
+
]
|
|
2286
|
+
},
|
|
2287
|
+
`${m.id}-${S}`
|
|
2288
|
+
);
|
|
2289
|
+
}) })
|
|
2290
|
+
]
|
|
2291
|
+
},
|
|
2292
|
+
p
|
|
2293
|
+
);
|
|
2294
|
+
})
|
|
2295
|
+
]
|
|
2296
|
+
}
|
|
2297
|
+
);
|
|
2298
|
+
}, Rs = ({
|
|
2299
|
+
onTranscript: e,
|
|
2300
|
+
onSpeechEnd: t,
|
|
2301
|
+
language: s = "en-NZ",
|
|
2302
|
+
mode: n = "toggle"
|
|
2303
|
+
} = {}) => {
|
|
2304
|
+
const [i, f] = Q(!1), [u, g] = Q(""), [d, y] = Q(""), [h, l] = Q(null), [v, w] = Q(!1), k = H(null), N = H(""), _ = H(e), I = H(t);
|
|
2305
|
+
se(() => {
|
|
2306
|
+
_.current = e, I.current = t;
|
|
2307
|
+
}, [e, t]), se(() => {
|
|
2308
|
+
const b = window.SpeechRecognition || window.webkitSpeechRecognition;
|
|
2309
|
+
if (b) {
|
|
2310
|
+
w(!0);
|
|
2311
|
+
const m = new b();
|
|
2312
|
+
m.continuous = n === "ptt", m.interimResults = !0, m.lang = s, m.maxAlternatives = 1, m.onstart = () => {
|
|
2313
|
+
f(!0), l(null);
|
|
2314
|
+
}, m.onresult = (S) => {
|
|
2315
|
+
let C = "", P = "";
|
|
2316
|
+
for (let j = S.resultIndex; j < S.results.length; j++) {
|
|
2317
|
+
const R = S.results[j][0].transcript;
|
|
2318
|
+
S.results[j].isFinal ? P += R : C += R;
|
|
2319
|
+
}
|
|
2320
|
+
P && (N.current = P, g(P), _.current && _.current(P)), y(C);
|
|
2321
|
+
}, m.onerror = (S) => {
|
|
2322
|
+
switch (f(!1), S.error) {
|
|
2323
|
+
case "no-speech":
|
|
2324
|
+
l("No speech detected. Please try again.");
|
|
2325
|
+
break;
|
|
2326
|
+
case "audio-capture":
|
|
2327
|
+
l("No microphone found. Please check your device.");
|
|
2328
|
+
break;
|
|
2329
|
+
case "not-allowed":
|
|
2330
|
+
l("Microphone permission denied. Please allow access.");
|
|
2331
|
+
break;
|
|
2332
|
+
default:
|
|
2333
|
+
l("Speech recognition error. Please try again.");
|
|
2334
|
+
}
|
|
2335
|
+
}, m.onend = () => {
|
|
2336
|
+
f(!1), y(""), N.current && I.current && I.current(N.current), N.current = "";
|
|
2337
|
+
}, k.current = m;
|
|
2338
|
+
}
|
|
2339
|
+
return () => {
|
|
2340
|
+
k.current && k.current.stop();
|
|
2341
|
+
};
|
|
2342
|
+
}, [s, n]);
|
|
2343
|
+
const p = () => {
|
|
2344
|
+
k.current && !i && (g(""), y(""), l(null), k.current.start());
|
|
2345
|
+
}, E = () => {
|
|
2346
|
+
k.current && i && k.current.stop();
|
|
2347
|
+
};
|
|
2348
|
+
return {
|
|
2349
|
+
isListening: i,
|
|
2350
|
+
transcript: u,
|
|
2351
|
+
interimTranscript: d,
|
|
2352
|
+
error: h,
|
|
2353
|
+
isSupported: v,
|
|
2354
|
+
startListening: p,
|
|
2355
|
+
stopListening: E,
|
|
2356
|
+
toggleListening: () => {
|
|
2357
|
+
i ? E() : p();
|
|
2358
|
+
}
|
|
2359
|
+
};
|
|
2360
|
+
}, Ss = ({
|
|
2361
|
+
messages: e,
|
|
2362
|
+
input: t,
|
|
2363
|
+
setInput: s,
|
|
2364
|
+
isLoading: n,
|
|
2365
|
+
onSend: i,
|
|
2366
|
+
onKeyPress: f,
|
|
2367
|
+
onInputFocus: u,
|
|
2368
|
+
onInputBlur: g,
|
|
2369
|
+
chatEndRef: d,
|
|
2370
|
+
isMuted: y = !1,
|
|
2371
|
+
onToggleMute: h,
|
|
2372
|
+
isSpeaking: l = !1
|
|
2373
|
+
}) => {
|
|
2374
|
+
const [v, w] = Q(!1), k = H(null), N = H(!1), {
|
|
2375
|
+
isListening: _,
|
|
2376
|
+
interimTranscript: I,
|
|
2377
|
+
error: p,
|
|
2378
|
+
isSupported: E,
|
|
2379
|
+
startListening: T,
|
|
2380
|
+
stopListening: b
|
|
2381
|
+
} = Rs({
|
|
2382
|
+
onTranscript: (j) => s(j),
|
|
2383
|
+
language: "en-NZ",
|
|
2384
|
+
mode: "ptt"
|
|
2385
|
+
});
|
|
2386
|
+
se(() => {
|
|
2387
|
+
I && s(I);
|
|
2388
|
+
}, [I, s]);
|
|
2389
|
+
const m = G(() => {
|
|
2390
|
+
n || N.current || (N.current = !0, navigator.vibrate && navigator.vibrate(10), T());
|
|
2391
|
+
}, [n, T]), S = G(() => {
|
|
2392
|
+
N.current && (N.current = !1, navigator.vibrate && navigator.vibrate(10), b(), setTimeout(() => {
|
|
2393
|
+
i();
|
|
2394
|
+
}, 150));
|
|
2395
|
+
}, [b, i]), C = [...e].reverse().find((j) => j.role === "assistant"), P = C != null && C.content ? C.content.length > 50 ? C.content.slice(0, 50) + "..." : C.content : "Ask Bob about car parts...";
|
|
2396
|
+
return /* @__PURE__ */ a.jsxs(
|
|
2397
|
+
"div",
|
|
2398
|
+
{
|
|
2399
|
+
ref: k,
|
|
2400
|
+
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)] ${v ? "h-[55vh]" : "h-auto"}`,
|
|
2401
|
+
style: {
|
|
2402
|
+
zIndex: 60,
|
|
2403
|
+
paddingBottom: "env(safe-area-inset-bottom, 8px)"
|
|
2404
|
+
},
|
|
2405
|
+
children: [
|
|
2406
|
+
/* @__PURE__ */ a.jsx(
|
|
2407
|
+
"button",
|
|
2408
|
+
{
|
|
2409
|
+
onClick: () => w(!v),
|
|
2410
|
+
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",
|
|
2411
|
+
"aria-label": v ? "Collapse chat" : "Expand chat",
|
|
2412
|
+
children: v ? /* @__PURE__ */ a.jsx("svg", { className: "h-4 w-4 text-gray-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) : /* @__PURE__ */ a.jsx("svg", { className: "h-4 w-4 text-gray-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 15l7-7 7 7" }) })
|
|
2413
|
+
}
|
|
2414
|
+
),
|
|
2415
|
+
!v && /* @__PURE__ */ a.jsx("div", { className: "px-3 pt-2 pb-0.5", onClick: () => w(!0), children: /* @__PURE__ */ a.jsx("p", { className: "text-xs text-gray-500 line-clamp-1", children: P }) }),
|
|
2416
|
+
v && /* @__PURE__ */ a.jsxs("div", { className: "h-[calc(100%-100px)] overflow-y-auto p-4 space-y-2", children: [
|
|
2417
|
+
[...e].reverse().map((j, R) => /* @__PURE__ */ a.jsx("div", { className: `flex ${j.role === "user" ? "justify-end" : "justify-start"}`, children: /* @__PURE__ */ a.jsx("div", { className: `max-w-[85%] rounded-lg px-3 py-2 text-sm ${j.role === "user" ? "bg-blue-600 text-white" : "bg-gray-100 text-gray-900"}`, children: j.content }) }, R)),
|
|
2418
|
+
/* @__PURE__ */ a.jsx("div", { ref: d })
|
|
2419
|
+
] }),
|
|
2420
|
+
/* @__PURE__ */ a.jsxs("div", { className: `px-2 pb-1.5 ${v ? "pt-2 border-t border-gray-200" : "pt-0.5"}`, children: [
|
|
2421
|
+
_ && /* @__PURE__ */ a.jsxs("div", { className: "mb-2 text-xs text-gray-500 flex items-center gap-2", children: [
|
|
2422
|
+
/* @__PURE__ */ a.jsx("span", { className: "inline-block w-2 h-2 bg-red-500 rounded-full animate-pulse" }),
|
|
2423
|
+
"Listening..."
|
|
2424
|
+
] }),
|
|
2425
|
+
p && /* @__PURE__ */ a.jsx("div", { className: "mb-2 text-xs text-red-500", children: p }),
|
|
2426
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex gap-1.5 items-center", children: [
|
|
2427
|
+
h && v && /* @__PURE__ */ a.jsx(
|
|
2428
|
+
"button",
|
|
2429
|
+
{
|
|
2430
|
+
onClick: h,
|
|
2431
|
+
className: `shrink-0 h-9 w-9 flex items-center justify-center rounded-md hover:bg-gray-100 ${l ? "text-blue-600 animate-pulse" : "text-gray-600"}`,
|
|
2432
|
+
title: y ? "Unmute" : "Mute",
|
|
2433
|
+
children: y ? /* @__PURE__ */ a.jsxs("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
|
|
2434
|
+
/* @__PURE__ */ a.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z" }),
|
|
2435
|
+
/* @__PURE__ */ a.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2" })
|
|
2436
|
+
] }) : /* @__PURE__ */ a.jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z" }) })
|
|
2437
|
+
}
|
|
2438
|
+
),
|
|
2439
|
+
/* @__PURE__ */ a.jsx(
|
|
2440
|
+
"input",
|
|
2441
|
+
{
|
|
2442
|
+
type: "text",
|
|
2443
|
+
value: t,
|
|
2444
|
+
onChange: (j) => s(j.target.value),
|
|
2445
|
+
onKeyPress: f,
|
|
2446
|
+
onFocus: u,
|
|
2447
|
+
onBlur: g,
|
|
2448
|
+
placeholder: "Message Bob...",
|
|
2449
|
+
disabled: n,
|
|
2450
|
+
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"
|
|
2451
|
+
}
|
|
2452
|
+
),
|
|
2453
|
+
E && /* @__PURE__ */ a.jsx(
|
|
2454
|
+
"button",
|
|
2455
|
+
{
|
|
2456
|
+
onTouchStart: m,
|
|
2457
|
+
onTouchEnd: S,
|
|
2458
|
+
onTouchCancel: S,
|
|
2459
|
+
onMouseDown: m,
|
|
2460
|
+
onMouseUp: S,
|
|
2461
|
+
onMouseLeave: S,
|
|
2462
|
+
disabled: n,
|
|
2463
|
+
className: `shrink-0 h-12 w-12 rounded-full flex items-center justify-center select-none touch-none ${_ ? "bg-red-500 text-white animate-pulse ring-2 ring-red-300 scale-110" : "bg-blue-600 text-white"} disabled:opacity-50`,
|
|
2464
|
+
title: "Hold to talk",
|
|
2465
|
+
children: /* @__PURE__ */ a.jsx("svg", { className: "h-5 w-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a.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" }) })
|
|
2466
|
+
}
|
|
2467
|
+
)
|
|
2468
|
+
] })
|
|
2469
|
+
] })
|
|
2470
|
+
]
|
|
2471
|
+
}
|
|
2472
|
+
);
|
|
2473
|
+
}, Cs = ({
|
|
2474
|
+
currentImage: e,
|
|
2475
|
+
animationState: t,
|
|
2476
|
+
backdropUrl: s,
|
|
2477
|
+
counterOverlayUrl: n,
|
|
2478
|
+
counterHeightPercent: i = 22,
|
|
2479
|
+
messages: f,
|
|
2480
|
+
input: u,
|
|
2481
|
+
setInput: g,
|
|
2482
|
+
isLoading: d,
|
|
2483
|
+
onSend: y,
|
|
2484
|
+
onKeyPress: h,
|
|
2485
|
+
onInputFocus: l,
|
|
2486
|
+
onInputBlur: v,
|
|
2487
|
+
chatEndRef: w,
|
|
2488
|
+
isMuted: k,
|
|
2489
|
+
onToggleMute: N,
|
|
2490
|
+
isSpeaking: _,
|
|
2491
|
+
products: I,
|
|
2492
|
+
servicePackages: p,
|
|
2493
|
+
highlightedPartType: E,
|
|
2494
|
+
highlightedProduct: T,
|
|
2495
|
+
onProductClick: b,
|
|
2496
|
+
onPackageSelect: m,
|
|
2497
|
+
isResearching: S,
|
|
2498
|
+
vehicle: C,
|
|
2499
|
+
onChangeVehicle: P
|
|
2500
|
+
}) => {
|
|
2501
|
+
const j = typeof window < "u" && window.self !== window.top, [R, M] = Q("center"), [A, L] = Q("hidden"), te = I.length > 0 || p.length > 0;
|
|
2502
|
+
se(() => {
|
|
2503
|
+
if (S && A !== "loading" && A !== "visible")
|
|
2504
|
+
L("loading"), R === "center" && M("left");
|
|
2505
|
+
else if (te && A !== "visible")
|
|
2506
|
+
if (R === "center") {
|
|
2507
|
+
M("left"), L("transitioning");
|
|
2508
|
+
const K = setTimeout(() => {
|
|
2509
|
+
L("visible");
|
|
2510
|
+
}, 400);
|
|
2511
|
+
return () => clearTimeout(K);
|
|
2512
|
+
} else
|
|
2513
|
+
L("visible");
|
|
2514
|
+
else !te && !S && A !== "hidden" && (L("hidden"), M("center"));
|
|
2515
|
+
}, [te, S, A, R]);
|
|
2516
|
+
const Re = A !== "hidden";
|
|
2517
|
+
return /* @__PURE__ */ a.jsxs(
|
|
2518
|
+
"div",
|
|
2519
|
+
{
|
|
2520
|
+
className: "fixed inset-0 overflow-hidden",
|
|
2521
|
+
style: {
|
|
2522
|
+
height: "100dvh",
|
|
2523
|
+
touchAction: "manipulation"
|
|
2524
|
+
},
|
|
2525
|
+
children: [
|
|
2526
|
+
s && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
2527
|
+
/* @__PURE__ */ a.jsx(
|
|
2528
|
+
"div",
|
|
2529
|
+
{
|
|
2530
|
+
className: "absolute inset-0 z-0",
|
|
2531
|
+
style: {
|
|
2532
|
+
backgroundImage: `url(${s})`,
|
|
2533
|
+
backgroundSize: "cover",
|
|
2534
|
+
backgroundPosition: "center bottom",
|
|
2535
|
+
filter: "blur(12px) brightness(0.7)",
|
|
2536
|
+
transform: "scale(1.1)"
|
|
2537
|
+
}
|
|
2538
|
+
}
|
|
2539
|
+
),
|
|
2540
|
+
/* @__PURE__ */ a.jsx(
|
|
2541
|
+
"div",
|
|
2542
|
+
{
|
|
2543
|
+
className: "absolute inset-0 z-[1]",
|
|
2544
|
+
style: {
|
|
2545
|
+
background: "linear-gradient(to bottom, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.6) 100%)"
|
|
2546
|
+
}
|
|
2547
|
+
}
|
|
2548
|
+
)
|
|
2549
|
+
] }),
|
|
2550
|
+
/* @__PURE__ */ a.jsx(
|
|
2551
|
+
Es,
|
|
2552
|
+
{
|
|
2553
|
+
currentImage: e,
|
|
2554
|
+
animationState: t,
|
|
2555
|
+
counterOverlayUrl: n,
|
|
2556
|
+
counterHeightPercent: i,
|
|
2557
|
+
scale: 200,
|
|
2558
|
+
position: R
|
|
2559
|
+
}
|
|
2560
|
+
),
|
|
2561
|
+
C && !j && /* @__PURE__ */ a.jsx("div", { className: "absolute top-2 left-2 right-2 z-20", children: /* @__PURE__ */ a.jsxs(
|
|
2562
|
+
"div",
|
|
2563
|
+
{
|
|
2564
|
+
className: "bg-white/90 backdrop-blur-sm rounded-lg px-3 py-2 border border-gray-200 shadow-lg flex items-center justify-between",
|
|
2565
|
+
style: { paddingTop: "calc(env(safe-area-inset-top, 4px) + 8px)" },
|
|
2566
|
+
children: [
|
|
2567
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
2568
|
+
/* @__PURE__ */ a.jsxs("p", { className: "text-xs font-medium text-gray-900 truncate", children: [
|
|
2569
|
+
C.year,
|
|
2570
|
+
" ",
|
|
2571
|
+
C.make,
|
|
2572
|
+
" ",
|
|
2573
|
+
C.model
|
|
2574
|
+
] }),
|
|
2575
|
+
C.rego && /* @__PURE__ */ a.jsx("p", { className: "text-[10px] text-gray-500", children: C.rego })
|
|
2576
|
+
] }),
|
|
2577
|
+
P && /* @__PURE__ */ a.jsx(
|
|
2578
|
+
"button",
|
|
2579
|
+
{
|
|
2580
|
+
onClick: P,
|
|
2581
|
+
className: "text-xs text-blue-600 hover:underline ml-2 shrink-0",
|
|
2582
|
+
children: "Change"
|
|
2583
|
+
}
|
|
2584
|
+
)
|
|
2585
|
+
]
|
|
2586
|
+
}
|
|
2587
|
+
) }),
|
|
2588
|
+
/* @__PURE__ */ a.jsx(
|
|
2589
|
+
Ts,
|
|
2590
|
+
{
|
|
2591
|
+
products: I,
|
|
2592
|
+
servicePackages: p,
|
|
2593
|
+
highlightedPartType: E,
|
|
2594
|
+
highlightedProduct: T,
|
|
2595
|
+
onProductClick: b,
|
|
2596
|
+
onPackageSelect: m,
|
|
2597
|
+
isResearching: S,
|
|
2598
|
+
visible: Re,
|
|
2599
|
+
counterHeightPercent: i,
|
|
2600
|
+
hasVehicle: !!C
|
|
2601
|
+
}
|
|
2602
|
+
),
|
|
2603
|
+
/* @__PURE__ */ a.jsx(
|
|
2604
|
+
Ss,
|
|
2605
|
+
{
|
|
2606
|
+
messages: f,
|
|
2607
|
+
input: u,
|
|
2608
|
+
setInput: g,
|
|
2609
|
+
isLoading: d,
|
|
2610
|
+
onSend: y,
|
|
2611
|
+
onKeyPress: h,
|
|
2612
|
+
onInputFocus: l,
|
|
2613
|
+
onInputBlur: v,
|
|
2614
|
+
chatEndRef: w,
|
|
2615
|
+
isMuted: k,
|
|
2616
|
+
onToggleMute: N,
|
|
2617
|
+
isSpeaking: _
|
|
2618
|
+
}
|
|
2619
|
+
)
|
|
2620
|
+
]
|
|
1264
2621
|
}
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
2622
|
+
);
|
|
2623
|
+
}, Fs = ({
|
|
2624
|
+
variant: e = "inline",
|
|
2625
|
+
initialState: t = "idle",
|
|
2626
|
+
showChat: s = !0,
|
|
2627
|
+
className: n = "",
|
|
2628
|
+
backdropUrl: i,
|
|
2629
|
+
counterOverlayUrl: f,
|
|
2630
|
+
counterHeightPercent: u,
|
|
2631
|
+
defaultBobImage: g,
|
|
2632
|
+
verticalOffset: d = 0,
|
|
2633
|
+
scale: y = 100
|
|
2634
|
+
}) => {
|
|
2635
|
+
const { callbacks: h } = et(), {
|
|
2636
|
+
animationState: l,
|
|
2637
|
+
setAnimationState: v,
|
|
2638
|
+
getCurrentImage: w,
|
|
2639
|
+
availableStates: k,
|
|
2640
|
+
isLoading: N
|
|
2641
|
+
} = vs(), { activeBackdrop: _ } = ys(), [I, p] = Q([]), [E, T] = Q([]), [b, m] = Q(null), [S, C] = Q(null), [P, j] = Q(!1), R = $r({
|
|
2642
|
+
setAnimationState: v,
|
|
1273
2643
|
manualMode: !1,
|
|
1274
2644
|
onReadyToSpeak: () => {
|
|
1275
2645
|
console.log("[BobWidget] Ready to speak");
|
|
1276
2646
|
},
|
|
1277
2647
|
onStreamComplete: () => {
|
|
1278
|
-
|
|
2648
|
+
v(k.find((K) => K.includes("idle")) || "idle");
|
|
2649
|
+
},
|
|
2650
|
+
onResearchStart: () => {
|
|
2651
|
+
j(!0);
|
|
2652
|
+
},
|
|
2653
|
+
onHighlightPart: (K) => {
|
|
2654
|
+
m(K), setTimeout(() => m(null), 8e3);
|
|
2655
|
+
},
|
|
2656
|
+
onHighlightProduct: (K) => {
|
|
2657
|
+
C(K), setTimeout(() => C(null), 8e3);
|
|
2658
|
+
},
|
|
2659
|
+
onAutoFetchComplete: () => {
|
|
2660
|
+
j(!1);
|
|
1279
2661
|
}
|
|
1280
|
-
})
|
|
2662
|
+
});
|
|
2663
|
+
se(() => {
|
|
2664
|
+
const K = h.onPartsFound, oe = h.onServicePackagesFound;
|
|
2665
|
+
return h.onPartsFound = (ue) => {
|
|
2666
|
+
j(!1);
|
|
2667
|
+
const je = ue.map((J, Ae) => ({
|
|
2668
|
+
id: J.SKU || J.sku || `part-${Ae}`,
|
|
2669
|
+
name: J["Part Product Type"] || J.partslot_description || "Unknown Part",
|
|
2670
|
+
brand: J.Brand || J.brand,
|
|
2671
|
+
price: J["Metro Retail Price"] || J.price || 0,
|
|
2672
|
+
sku: J.SKU || J.sku,
|
|
2673
|
+
partNumber: J["Part Number"] || J.part_number,
|
|
2674
|
+
partslotDescription: J["Part Product Type"] || J.partslot_description,
|
|
2675
|
+
image_url: J.image_url
|
|
2676
|
+
}));
|
|
2677
|
+
p(je), K == null || K(ue);
|
|
2678
|
+
}, h.onServicePackagesFound = (ue) => {
|
|
2679
|
+
T(ue), oe == null || oe(ue);
|
|
2680
|
+
}, () => {
|
|
2681
|
+
h.onPartsFound = K, h.onServicePackagesFound = oe;
|
|
2682
|
+
};
|
|
2683
|
+
}, [h]);
|
|
2684
|
+
const M = i || (_ == null ? void 0 : _.image_url), A = f || (_ == null ? void 0 : _.counter_overlay_url) || void 0, L = u || (_ == null ? void 0 : _.counter_height_percent) || 12, te = w() || g || "";
|
|
2685
|
+
if (e === "mobile" || e === "fullscreen")
|
|
2686
|
+
return /* @__PURE__ */ a.jsx(
|
|
2687
|
+
Cs,
|
|
2688
|
+
{
|
|
2689
|
+
currentImage: te,
|
|
2690
|
+
animationState: l,
|
|
2691
|
+
backdropUrl: M,
|
|
2692
|
+
counterOverlayUrl: A,
|
|
2693
|
+
counterHeightPercent: L,
|
|
2694
|
+
messages: R.messages,
|
|
2695
|
+
input: R.input,
|
|
2696
|
+
setInput: R.setInput,
|
|
2697
|
+
isLoading: R.isLoading,
|
|
2698
|
+
onSend: R.handleSend,
|
|
2699
|
+
onKeyPress: R.handleKeyPress,
|
|
2700
|
+
onInputFocus: R.handleInputFocus,
|
|
2701
|
+
onInputBlur: R.handleInputBlur,
|
|
2702
|
+
chatEndRef: R.chatEndRef,
|
|
2703
|
+
isMuted: R.isMuted,
|
|
2704
|
+
onToggleMute: R.toggleMute,
|
|
2705
|
+
isSpeaking: R.isSpeaking,
|
|
2706
|
+
products: I,
|
|
2707
|
+
servicePackages: E,
|
|
2708
|
+
highlightedPartType: b,
|
|
2709
|
+
highlightedProduct: S,
|
|
2710
|
+
onProductClick: (K) => {
|
|
2711
|
+
var oe;
|
|
2712
|
+
return (oe = h.onAddToCart) == null ? void 0 : oe.call(h, {
|
|
2713
|
+
product_id: K.id,
|
|
2714
|
+
product_name: K.name,
|
|
2715
|
+
quantity: 1,
|
|
2716
|
+
unit_price: K.price,
|
|
2717
|
+
sku: K.sku,
|
|
2718
|
+
brand: K.brand
|
|
2719
|
+
});
|
|
2720
|
+
},
|
|
2721
|
+
onPackageSelect: (K) => console.log("[BobWidget] Package selected:", K),
|
|
2722
|
+
isResearching: P,
|
|
2723
|
+
vehicle: R.identifiedVehicle
|
|
2724
|
+
}
|
|
2725
|
+
);
|
|
2726
|
+
const Re = {
|
|
1281
2727
|
inline: "",
|
|
1282
2728
|
floating: "fixed bottom-4 right-4 w-96 z-50 shadow-2xl rounded-lg overflow-hidden",
|
|
1283
|
-
fullscreen: "fixed inset-0 z-50 bg-black/80"
|
|
2729
|
+
fullscreen: "fixed inset-0 z-50 bg-black/80",
|
|
2730
|
+
mobile: ""
|
|
1284
2731
|
};
|
|
1285
|
-
return /* @__PURE__ */
|
|
1286
|
-
|
|
1287
|
-
|
|
2732
|
+
return /* @__PURE__ */ a.jsxs("div", { className: `${Re[e]} ${n}`, children: [
|
|
2733
|
+
te && /* @__PURE__ */ a.jsx(
|
|
2734
|
+
xs,
|
|
1288
2735
|
{
|
|
1289
|
-
currentImage:
|
|
1290
|
-
animationState:
|
|
1291
|
-
backdropUrl:
|
|
1292
|
-
counterOverlayUrl:
|
|
1293
|
-
counterHeightPercent:
|
|
1294
|
-
verticalOffset:
|
|
1295
|
-
scale:
|
|
2736
|
+
currentImage: te,
|
|
2737
|
+
animationState: l,
|
|
2738
|
+
backdropUrl: M,
|
|
2739
|
+
counterOverlayUrl: A,
|
|
2740
|
+
counterHeightPercent: L,
|
|
2741
|
+
verticalOffset: d,
|
|
2742
|
+
scale: y
|
|
1296
2743
|
}
|
|
1297
2744
|
),
|
|
1298
|
-
|
|
1299
|
-
|
|
2745
|
+
s && /* @__PURE__ */ a.jsx(
|
|
2746
|
+
ws,
|
|
1300
2747
|
{
|
|
1301
|
-
messages:
|
|
1302
|
-
input:
|
|
1303
|
-
setInput:
|
|
1304
|
-
isLoading:
|
|
1305
|
-
onSend:
|
|
1306
|
-
onKeyPress:
|
|
1307
|
-
onInputFocus:
|
|
1308
|
-
onInputBlur:
|
|
1309
|
-
chatEndRef:
|
|
1310
|
-
isMuted:
|
|
1311
|
-
onToggleMute:
|
|
1312
|
-
isSpeaking:
|
|
2748
|
+
messages: R.messages,
|
|
2749
|
+
input: R.input,
|
|
2750
|
+
setInput: R.setInput,
|
|
2751
|
+
isLoading: R.isLoading,
|
|
2752
|
+
onSend: R.handleSend,
|
|
2753
|
+
onKeyPress: R.handleKeyPress,
|
|
2754
|
+
onInputFocus: R.handleInputFocus,
|
|
2755
|
+
onInputBlur: R.handleInputBlur,
|
|
2756
|
+
chatEndRef: R.chatEndRef,
|
|
2757
|
+
isMuted: R.isMuted,
|
|
2758
|
+
onToggleMute: R.toggleMute,
|
|
2759
|
+
isSpeaking: R.isSpeaking
|
|
1313
2760
|
}
|
|
1314
2761
|
)
|
|
1315
2762
|
] });
|
|
2763
|
+
}, js = 6e4, Bs = ({
|
|
2764
|
+
states: e,
|
|
2765
|
+
setAnimationState: t,
|
|
2766
|
+
manualMode: s
|
|
2767
|
+
}) => {
|
|
2768
|
+
const [n, i] = Q("page_load"), [f, u] = Q(!1), g = H(null), d = G((b) => e.find((m) => m.chat_trigger === b && m.is_active), [e]), y = G(() => e.find(
|
|
2769
|
+
(b) => b.chat_trigger === "awaiting_input" || b.state_key === "talk_pause" || b.title.toLowerCase().includes("listen") || b.title.toLowerCase().includes("pause")
|
|
2770
|
+
), [e]), h = G(() => e.find(
|
|
2771
|
+
(b) => b.state_key === "idle" || b.title.toLowerCase().includes("idle")
|
|
2772
|
+
), [e]), l = G((b) => {
|
|
2773
|
+
const m = e.find((S) => S.state_key === b);
|
|
2774
|
+
return {
|
|
2775
|
+
speed: (m == null ? void 0 : m.animation_speed) || 400,
|
|
2776
|
+
pauseDuration: (m == null ? void 0 : m.pause_duration) || 0,
|
|
2777
|
+
loopCount: (m == null ? void 0 : m.loop_count) || 0
|
|
2778
|
+
};
|
|
2779
|
+
}, [e]), v = G(() => {
|
|
2780
|
+
g.current && (clearTimeout(g.current), g.current = null);
|
|
2781
|
+
}, []), w = G(() => {
|
|
2782
|
+
v(), !s && (g.current = setTimeout(() => {
|
|
2783
|
+
const b = h();
|
|
2784
|
+
b && (i("idle"), t(b.state_key));
|
|
2785
|
+
}, js));
|
|
2786
|
+
}, [s, h, t, v]), k = G((b) => {
|
|
2787
|
+
if (s) return;
|
|
2788
|
+
const m = d(b);
|
|
2789
|
+
m && t(m.state_key);
|
|
2790
|
+
}, [s, d, t]), N = G(() => {
|
|
2791
|
+
if (s) return;
|
|
2792
|
+
const b = y();
|
|
2793
|
+
b && (i("awaiting_input"), t(b.state_key), w());
|
|
2794
|
+
}, [s, y, t, w]), _ = G(() => {
|
|
2795
|
+
f || s || (u(!0), i("page_load"), k("page_load"), setTimeout(() => {
|
|
2796
|
+
N();
|
|
2797
|
+
}, 3e3));
|
|
2798
|
+
}, [f, s, k, N]), I = G(() => {
|
|
2799
|
+
v(), i("processing_input"), k("processing_input");
|
|
2800
|
+
}, [k, v]), p = G(() => {
|
|
2801
|
+
v(), i("streaming_response"), k("streaming_response");
|
|
2802
|
+
}, [k, v]), E = G(() => {
|
|
2803
|
+
i("response_complete"), k("response_complete"), setTimeout(() => {
|
|
2804
|
+
N();
|
|
2805
|
+
}, 3e3);
|
|
2806
|
+
}, [k, N]), T = G(() => {
|
|
2807
|
+
i("showing_product");
|
|
2808
|
+
const b = e.find(
|
|
2809
|
+
(m) => m.chat_trigger === "showing_product" || m.state_key === "showing_product"
|
|
2810
|
+
);
|
|
2811
|
+
b && t(b.state_key), setTimeout(() => {
|
|
2812
|
+
N();
|
|
2813
|
+
}, 4e3);
|
|
2814
|
+
}, [e, t, N]);
|
|
2815
|
+
return se(() => () => v(), [v]), {
|
|
2816
|
+
chatStage: n,
|
|
2817
|
+
initialize: _,
|
|
2818
|
+
onUserInput: I,
|
|
2819
|
+
onStreamStart: p,
|
|
2820
|
+
onStreamComplete: E,
|
|
2821
|
+
onShowingProduct: T,
|
|
2822
|
+
getStateSettings: l
|
|
2823
|
+
};
|
|
1316
2824
|
};
|
|
1317
2825
|
export {
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
2826
|
+
Fs as Bob,
|
|
2827
|
+
xs as BobCharacter,
|
|
2828
|
+
Ns as BobProvider,
|
|
2829
|
+
ws as ChatInterface,
|
|
2830
|
+
Es as MobileBobCharacter,
|
|
2831
|
+
Cs as MobileBobLayout,
|
|
2832
|
+
Ss as MobileChatDrawer,
|
|
2833
|
+
Ts as MobileProductColumn,
|
|
2834
|
+
vs as useBobAnimation,
|
|
2835
|
+
ms as useBobAnimationData,
|
|
2836
|
+
ys as useBobBackdrop,
|
|
2837
|
+
Ms as useBobCallbacks,
|
|
2838
|
+
$r as useBobChat,
|
|
2839
|
+
et as useBobContext,
|
|
2840
|
+
Bs as useBobStateTransitions,
|
|
2841
|
+
_r as useBobSupabase,
|
|
2842
|
+
Ls as useHostApiConfig,
|
|
2843
|
+
Ps as useHostContext,
|
|
2844
|
+
Rs as useSpeechRecognition,
|
|
2845
|
+
Dr as useSpeechSynthesis
|
|
1329
2846
|
};
|