@gymmymac/bob-widget 3.2.1 → 3.2.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/index.mjs CHANGED
@@ -12,8 +12,8 @@ var Ts = (t, e, r, s) => ({
12
12
  }
13
13
  });
14
14
  import * as at from "react";
15
- import br, { useRef as ee, useCallback as V, useEffect as he, createContext as Pa, useMemo as Tt, useContext as Ln, useState as H } from "react";
16
- const Gt = "3.2.1", Yu = () => Gt;
15
+ import mr, { useRef as te, useCallback as V, useEffect as he, createContext as Pa, useMemo as Tt, useContext as Ln, useState as H } from "react";
16
+ const Gt = "3.2.2", Yu = () => Gt;
17
17
  var ln = { exports: {} }, Xr = {};
18
18
  /**
19
19
  * @license React
@@ -28,7 +28,7 @@ var Jn;
28
28
  function Na() {
29
29
  if (Jn) return Xr;
30
30
  Jn = 1;
31
- var t = br, e = Symbol.for("react.element"), r = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, n = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
31
+ var t = mr, e = Symbol.for("react.element"), r = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, n = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
32
32
  function a(l, c, u) {
33
33
  var d, h = {}, f = null, p = null;
34
34
  u !== void 0 && (f = "" + u), c.key !== void 0 && (f = "" + c.key), c.ref !== void 0 && (p = c.ref);
@@ -51,24 +51,24 @@ var Zr = {};
51
51
  var Qn;
52
52
  function Fa() {
53
53
  return Qn || (Qn = 1, process.env.NODE_ENV !== "production" && function() {
54
- var t = br, e = Symbol.for("react.element"), r = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), l = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), y = Symbol.iterator, m = "@@iterator";
54
+ var t = mr, e = Symbol.for("react.element"), r = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), l = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), y = Symbol.iterator, b = "@@iterator";
55
55
  function g(w) {
56
56
  if (w === null || typeof w != "object")
57
57
  return null;
58
- var I = y && w[y] || w[m];
58
+ var I = y && w[y] || w[b];
59
59
  return typeof I == "function" ? I : null;
60
60
  }
61
- var b = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
61
+ var m = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
62
62
  function x(w) {
63
63
  {
64
- for (var I = arguments.length, M = new Array(I > 1 ? I - 1 : 0), X = 1; X < I; X++)
65
- M[X - 1] = arguments[X];
64
+ for (var I = arguments.length, M = new Array(I > 1 ? I - 1 : 0), ee = 1; ee < I; ee++)
65
+ M[ee - 1] = arguments[ee];
66
66
  _("error", w, M);
67
67
  }
68
68
  }
69
69
  function _(w, I, M) {
70
70
  {
71
- var X = b.ReactDebugCurrentFrame, ue = X.getStackAddendum();
71
+ var ee = m.ReactDebugCurrentFrame, ue = ee.getStackAddendum();
72
72
  ue !== "" && (I += "%s", M = M.concat([ue]));
73
73
  var ge = M.map(function(de) {
74
74
  return String(de);
@@ -86,9 +86,9 @@ function Fa() {
86
86
  w.$$typeof === D || w.getModuleId !== void 0));
87
87
  }
88
88
  function T(w, I, M) {
89
- var X = w.displayName;
90
- if (X)
91
- return X;
89
+ var ee = w.displayName;
90
+ if (ee)
91
+ return ee;
92
92
  var ue = I.displayName || I.name || "";
93
93
  return ue !== "" ? M + "(" + ue + ")" : M;
94
94
  }
@@ -127,8 +127,8 @@ function Fa() {
127
127
  case c:
128
128
  return T(w, w.render, "ForwardRef");
129
129
  case h:
130
- var X = w.displayName || null;
131
- return X !== null ? X : R(w.type) || "Memo";
130
+ var ee = w.displayName || null;
131
+ return ee !== null ? ee : R(w.type) || "Memo";
132
132
  case f: {
133
133
  var ue = w, ge = ue._payload, de = ue._init;
134
134
  try {
@@ -140,14 +140,14 @@ function Fa() {
140
140
  }
141
141
  return null;
142
142
  }
143
- var N = Object.assign, K = 0, se, re, L, U, Z, ce, Y;
143
+ var N = Object.assign, K = 0, X, se, L, U, Q, ce, Z;
144
144
  function C() {
145
145
  }
146
146
  C.__reactDisabledLog = !0;
147
147
  function $() {
148
148
  {
149
149
  if (K === 0) {
150
- se = console.log, re = console.info, L = console.warn, U = console.error, Z = console.group, ce = console.groupCollapsed, Y = console.groupEnd;
150
+ X = console.log, se = console.info, L = console.warn, U = console.error, Q = console.group, ce = console.groupCollapsed, Z = console.groupEnd;
151
151
  var w = {
152
152
  configurable: !0,
153
153
  enumerable: !0,
@@ -177,10 +177,10 @@ function Fa() {
177
177
  };
178
178
  Object.defineProperties(console, {
179
179
  log: N({}, w, {
180
- value: se
180
+ value: X
181
181
  }),
182
182
  info: N({}, w, {
183
- value: re
183
+ value: se
184
184
  }),
185
185
  warn: N({}, w, {
186
186
  value: L
@@ -189,28 +189,28 @@ function Fa() {
189
189
  value: U
190
190
  }),
191
191
  group: N({}, w, {
192
- value: Z
192
+ value: Q
193
193
  }),
194
194
  groupCollapsed: N({}, w, {
195
195
  value: ce
196
196
  }),
197
197
  groupEnd: N({}, w, {
198
- value: Y
198
+ value: Z
199
199
  })
200
200
  });
201
201
  }
202
202
  K < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
203
203
  }
204
204
  }
205
- var Q = b.ReactCurrentDispatcher, Ee;
205
+ var Y = m.ReactCurrentDispatcher, Ee;
206
206
  function Oe(w, I, M) {
207
207
  {
208
208
  if (Ee === void 0)
209
209
  try {
210
210
  throw Error();
211
211
  } catch (ue) {
212
- var X = ue.stack.trim().match(/\n( *(at )?)/);
213
- Ee = X && X[1] || "";
212
+ var ee = ue.stack.trim().match(/\n( *(at )?)/);
213
+ Ee = ee && ee[1] || "";
214
214
  }
215
215
  return `
216
216
  ` + Ee + w;
@@ -229,12 +229,12 @@ function Fa() {
229
229
  if (M !== void 0)
230
230
  return M;
231
231
  }
232
- var X;
232
+ var ee;
233
233
  Pe = !0;
234
234
  var ue = Error.prepareStackTrace;
235
235
  Error.prepareStackTrace = void 0;
236
236
  var ge;
237
- ge = Q.current, Q.current = null, $();
237
+ ge = Y.current, Y.current = null, $();
238
238
  try {
239
239
  if (I) {
240
240
  var de = function() {
@@ -248,14 +248,14 @@ function Fa() {
248
248
  try {
249
249
  Reflect.construct(de, []);
250
250
  } catch (Fe) {
251
- X = Fe;
251
+ ee = Fe;
252
252
  }
253
253
  Reflect.construct(w, [], de);
254
254
  } else {
255
255
  try {
256
256
  de.call();
257
257
  } catch (Fe) {
258
- X = Fe;
258
+ ee = Fe;
259
259
  }
260
260
  w.call(de.prototype);
261
261
  }
@@ -263,14 +263,14 @@ function Fa() {
263
263
  try {
264
264
  throw Error();
265
265
  } catch (Fe) {
266
- X = Fe;
266
+ ee = Fe;
267
267
  }
268
268
  w();
269
269
  }
270
270
  } catch (Fe) {
271
- if (Fe && X && typeof Fe.stack == "string") {
271
+ if (Fe && ee && typeof Fe.stack == "string") {
272
272
  for (var le = Fe.stack.split(`
273
- `), De = X.stack.split(`
273
+ `), De = ee.stack.split(`
274
274
  `), B = le.length - 1, Re = De.length - 1; B >= 1 && Re >= 0 && le[B] !== De[Re]; )
275
275
  Re--;
276
276
  for (; B >= 1 && Re >= 0; B--, Re--)
@@ -287,7 +287,7 @@ function Fa() {
287
287
  }
288
288
  }
289
289
  } finally {
290
- Pe = !1, Q.current = ge, G(), Error.prepareStackTrace = ue;
290
+ Pe = !1, Y.current = ge, G(), Error.prepareStackTrace = ue;
291
291
  }
292
292
  var Ae = w ? w.displayName || w.name : "", _e = Ae ? Oe(Ae) : "";
293
293
  return typeof w == "function" && $e.set(w, _e), _e;
@@ -319,7 +319,7 @@ function Fa() {
319
319
  case h:
320
320
  return O(w.type, I, M);
321
321
  case f: {
322
- var X = w, ue = X._payload, ge = X._init;
322
+ var ee = w, ue = ee._payload, ge = ee._init;
323
323
  try {
324
324
  return O(ge(ue), I, M);
325
325
  } catch {
@@ -328,7 +328,7 @@ function Fa() {
328
328
  }
329
329
  return "";
330
330
  }
331
- var te = Object.prototype.hasOwnProperty, Ne = {}, ke = b.ReactDebugCurrentFrame;
331
+ var re = Object.prototype.hasOwnProperty, Ne = {}, ke = m.ReactDebugCurrentFrame;
332
332
  function we(w) {
333
333
  if (w) {
334
334
  var I = w._owner, M = O(w.type, w._source, I ? I.type : null);
@@ -336,22 +336,22 @@ function Fa() {
336
336
  } else
337
337
  ke.setExtraStackFrame(null);
338
338
  }
339
- function oe(w, I, M, X, ue) {
339
+ function oe(w, I, M, ee, ue) {
340
340
  {
341
- var ge = Function.call.bind(te);
341
+ var ge = Function.call.bind(re);
342
342
  for (var de in w)
343
343
  if (ge(w, de)) {
344
344
  var le = void 0;
345
345
  try {
346
346
  if (typeof w[de] != "function") {
347
- var De = Error((X || "React class") + ": " + M + " type `" + de + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof w[de] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
347
+ var De = Error((ee || "React class") + ": " + M + " type `" + de + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof w[de] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
348
348
  throw De.name = "Invariant Violation", De;
349
349
  }
350
- le = w[de](I, de, X, M, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
350
+ le = w[de](I, de, ee, M, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
351
351
  } catch (B) {
352
352
  le = B;
353
353
  }
354
- le && !(le instanceof Error) && (we(ue), x("%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).", X || "React class", M, de, typeof le), we(null)), le instanceof Error && !(le.message in Ne) && (Ne[le.message] = !0, we(ue), x("Failed %s type: %s", M, le.message), we(null));
354
+ le && !(le instanceof Error) && (we(ue), x("%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).", ee || "React class", M, de, typeof le), we(null)), le instanceof Error && !(le.message in Ne) && (Ne[le.message] = !0, we(ue), x("Failed %s type: %s", M, le.message), we(null));
355
355
  }
356
356
  }
357
357
  }
@@ -379,22 +379,22 @@ function Fa() {
379
379
  if (Vn(w))
380
380
  return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Kn(w)), Gr(w);
381
381
  }
382
- var Qr = b.ReactCurrentOwner, Es = {
382
+ var Qr = m.ReactCurrentOwner, Es = {
383
383
  key: !0,
384
384
  ref: !0,
385
385
  __self: !0,
386
386
  __source: !0
387
- }, q, me;
387
+ }, q, be;
388
388
  function xe(w) {
389
- if (te.call(w, "ref")) {
389
+ if (re.call(w, "ref")) {
390
390
  var I = Object.getOwnPropertyDescriptor(w, "ref").get;
391
391
  if (I && I.isReactWarning)
392
392
  return !1;
393
393
  }
394
394
  return w.ref !== void 0;
395
395
  }
396
- function be(w) {
397
- if (te.call(w, "key")) {
396
+ function me(w) {
397
+ if (re.call(w, "key")) {
398
398
  var I = Object.getOwnPropertyDescriptor(w, "key").get;
399
399
  if (I && I.isReactWarning)
400
400
  return !1;
@@ -418,7 +418,7 @@ function Fa() {
418
418
  function Yt(w, I) {
419
419
  {
420
420
  var M = function() {
421
- me || (me = !0, x("%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)", I));
421
+ be || (be = !0, x("%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)", I));
422
422
  };
423
423
  M.isReactWarning = !0, Object.defineProperty(w, "ref", {
424
424
  get: M,
@@ -426,7 +426,7 @@ function Fa() {
426
426
  });
427
427
  }
428
428
  }
429
- var Xt = function(w, I, M, X, ue, ge, de) {
429
+ var Xt = function(w, I, M, ee, ue, ge, de) {
430
430
  var le = {
431
431
  // This tag allows us to uniquely identify this as a React Element
432
432
  $$typeof: e,
@@ -447,7 +447,7 @@ function Fa() {
447
447
  configurable: !1,
448
448
  enumerable: !1,
449
449
  writable: !1,
450
- value: X
450
+ value: ee
451
451
  }), Object.defineProperty(le, "_source", {
452
452
  configurable: !1,
453
453
  enumerable: !1,
@@ -455,12 +455,12 @@ function Fa() {
455
455
  value: ue
456
456
  }), Object.freeze && (Object.freeze(le.props), Object.freeze(le)), le;
457
457
  };
458
- function vr(w, I, M, X, ue) {
458
+ function vr(w, I, M, ee, ue) {
459
459
  {
460
460
  var ge, de = {}, le = null, De = null;
461
- M !== void 0 && (Jr(M), le = "" + M), be(I) && (Jr(I.key), le = "" + I.key), xe(I) && (De = I.ref, Ge(I, ue));
461
+ M !== void 0 && (Jr(M), le = "" + M), me(I) && (Jr(I.key), le = "" + I.key), xe(I) && (De = I.ref, Ge(I, ue));
462
462
  for (ge in I)
463
- te.call(I, ge) && !Es.hasOwnProperty(ge) && (de[ge] = I[ge]);
463
+ re.call(I, ge) && !Es.hasOwnProperty(ge) && (de[ge] = I[ge]);
464
464
  if (w && w.defaultProps) {
465
465
  var B = w.defaultProps;
466
466
  for (ge in B)
@@ -470,10 +470,10 @@ function Fa() {
470
470
  var Re = typeof w == "function" ? w.displayName || w.name || "Unknown" : w;
471
471
  le && Qt(de, Re), De && Yt(de, Re);
472
472
  }
473
- return Xt(w, le, De, ue, X, Qr.current, de);
473
+ return Xt(w, le, De, ue, ee, Qr.current, de);
474
474
  }
475
475
  }
476
- var xt = b.ReactCurrentOwner, At = b.ReactDebugCurrentFrame;
476
+ var xt = m.ReactCurrentOwner, At = m.ReactDebugCurrentFrame;
477
477
  function ze(w) {
478
478
  if (w) {
479
479
  var I = w._owner, M = O(w.type, w._source, I ? I.type : null);
@@ -523,8 +523,8 @@ Check the top-level render call using <` + M + ">.");
523
523
  if (Zt[M])
524
524
  return;
525
525
  Zt[M] = !0;
526
- var X = "";
527
- w && w._owner && w._owner !== xt.current && (X = " It was passed a child from " + R(w._owner.type) + "."), ze(w), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', M, X), ze(null);
526
+ var ee = "";
527
+ w && w._owner && w._owner !== xt.current && (ee = " It was passed a child from " + R(w._owner.type) + "."), ze(w), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', M, ee), ze(null);
528
528
  }
529
529
  }
530
530
  function Pt(w, I) {
@@ -533,8 +533,8 @@ Check the top-level render call using <` + M + ">.");
533
533
  return;
534
534
  if (je(w))
535
535
  for (var M = 0; M < w.length; M++) {
536
- var X = w[M];
537
- Ct(X) && Ze(X, I);
536
+ var ee = w[M];
537
+ Ct(ee) && Ze(ee, I);
538
538
  }
539
539
  else if (Ct(w))
540
540
  w._store && (w._store.validated = !0);
@@ -561,8 +561,8 @@ Check the top-level render call using <` + M + ">.");
561
561
  else
562
562
  return;
563
563
  if (M) {
564
- var X = R(I);
565
- oe(M, w.props, "prop", X, w);
564
+ var ee = R(I);
565
+ oe(M, w.props, "prop", ee, w);
566
566
  } else if (I.PropTypes !== void 0 && !Ot) {
567
567
  Ot = !0;
568
568
  var ue = R(I);
@@ -574,9 +574,9 @@ Check the top-level render call using <` + M + ">.");
574
574
  function st(w) {
575
575
  {
576
576
  for (var I = Object.keys(w.props), M = 0; M < I.length; M++) {
577
- var X = I[M];
578
- if (X !== "children" && X !== "key") {
579
- ze(w), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", X), ze(null);
577
+ var ee = I[M];
578
+ if (ee !== "children" && ee !== "key") {
579
+ ze(w), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", ee), ze(null);
580
580
  break;
581
581
  }
582
582
  }
@@ -584,7 +584,7 @@ Check the top-level render call using <` + M + ">.");
584
584
  }
585
585
  }
586
586
  var gt = {};
587
- function xr(w, I, M, X, ue, ge) {
587
+ function xr(w, I, M, ee, ue, ge) {
588
588
  {
589
589
  var de = E(w);
590
590
  if (!de) {
@@ -601,7 +601,7 @@ Check the top-level render call using <` + M + ">.");
601
601
  if (de) {
602
602
  var ve = I.children;
603
603
  if (ve !== void 0)
604
- if (X)
604
+ if (ee)
605
605
  if (je(ve)) {
606
606
  for (var Ae = 0; Ae < ve.length; Ae++)
607
607
  Pt(ve[Ae], w);
@@ -611,7 +611,7 @@ Check the top-level render call using <` + M + ">.");
611
611
  else
612
612
  Pt(ve, w);
613
613
  }
614
- if (te.call(I, "key")) {
614
+ if (re.call(I, "key")) {
615
615
  var _e = R(w), Fe = Object.keys(I).filter(function(Ia) {
616
616
  return Ia !== "key";
617
617
  }), Ft = Fe.length > 0 ? "{key: someKey, " + Fe.join(": ..., ") + ": ...}" : "{key: someKey}";
@@ -749,28 +749,28 @@ class Da {
749
749
  p || (p = this.region);
750
750
  const y = new URL(`${this.url}/${r}`);
751
751
  p && p !== "any" && (f["x-region"] = p, y.searchParams.set("forceFunctionRegion", p));
752
- let m;
753
- u && (l && !Object.prototype.hasOwnProperty.call(l, "Content-Type") || !l) ? typeof Blob < "u" && u instanceof Blob || u instanceof ArrayBuffer ? (f["Content-Type"] = "application/octet-stream", m = u) : typeof u == "string" ? (f["Content-Type"] = "text/plain", m = u) : typeof FormData < "u" && u instanceof FormData ? m = u : (f["Content-Type"] = "application/json", m = JSON.stringify(u)) : u && typeof u != "string" && !(typeof Blob < "u" && u instanceof Blob) && !(u instanceof ArrayBuffer) && !(typeof FormData < "u" && u instanceof FormData) ? m = JSON.stringify(u) : m = u;
752
+ let b;
753
+ u && (l && !Object.prototype.hasOwnProperty.call(l, "Content-Type") || !l) ? typeof Blob < "u" && u instanceof Blob || u instanceof ArrayBuffer ? (f["Content-Type"] = "application/octet-stream", b = u) : typeof u == "string" ? (f["Content-Type"] = "text/plain", b = u) : typeof FormData < "u" && u instanceof FormData ? b = u : (f["Content-Type"] = "application/json", b = JSON.stringify(u)) : u && typeof u != "string" && !(typeof Blob < "u" && u instanceof Blob) && !(u instanceof ArrayBuffer) && !(typeof FormData < "u" && u instanceof FormData) ? b = JSON.stringify(u) : b = u;
754
754
  let g = d;
755
755
  h && (a = new AbortController(), i = setTimeout(() => a.abort(), h), d ? (g = a.signal, d.addEventListener("abort", () => a.abort())) : g = a.signal);
756
- const b = yield this.fetch(y.toString(), {
756
+ const m = yield this.fetch(y.toString(), {
757
757
  method: c || "POST",
758
758
  // headers priority is (high to low):
759
759
  // 1. invoke-level headers
760
760
  // 2. client-level headers
761
761
  // 3. default Content-Type header
762
762
  headers: Object.assign(Object.assign(Object.assign({}, f), this.headers), l),
763
- body: m,
763
+ body: b,
764
764
  signal: g
765
765
  }).catch((S) => {
766
766
  throw new $a(S);
767
- }), x = b.headers.get("x-relay-error");
767
+ }), x = m.headers.get("x-relay-error");
768
768
  if (x && x === "true")
769
- throw new Yn(b);
770
- if (!b.ok)
771
- throw new Xn(b);
772
- let _ = ((n = b.headers.get("Content-Type")) !== null && n !== void 0 ? n : "text/plain").split(";")[0].trim(), v;
773
- return _ === "application/json" ? v = yield b.json() : _ === "application/octet-stream" || _ === "application/pdf" ? v = yield b.blob() : _ === "text/event-stream" ? v = b : _ === "multipart/form-data" ? v = yield b.formData() : v = yield b.text(), { data: v, error: null, response: b };
769
+ throw new Yn(m);
770
+ if (!m.ok)
771
+ throw new Xn(m);
772
+ let _ = ((n = m.headers.get("Content-Type")) !== null && n !== void 0 ? n : "text/plain").split(";")[0].trim(), v;
773
+ return _ === "application/json" ? v = yield m.json() : _ === "application/octet-stream" || _ === "application/pdf" ? v = yield m.blob() : _ === "text/event-stream" ? v = m : _ === "multipart/form-data" ? v = yield m.formData() : v = yield m.text(), { data: v, error: null, response: m };
774
774
  } catch (l) {
775
775
  return {
776
776
  data: null,
@@ -848,11 +848,11 @@ var Ua = class extends Error {
848
848
  var h, f;
849
849
  if (r.method !== "HEAD") {
850
850
  var p;
851
- const b = await i.text();
852
- b === "" || (r.headers.get("Accept") === "text/csv" || r.headers.get("Accept") && (!((p = r.headers.get("Accept")) === null || p === void 0) && p.includes("application/vnd.pgrst.plan+text")) ? l = b : l = JSON.parse(b));
851
+ const m = await i.text();
852
+ m === "" || (r.headers.get("Accept") === "text/csv" || r.headers.get("Accept") && (!((p = r.headers.get("Accept")) === null || p === void 0) && p.includes("application/vnd.pgrst.plan+text")) ? l = m : l = JSON.parse(m));
853
853
  }
854
- const m = (h = r.headers.get("Prefer")) === null || h === void 0 ? void 0 : h.match(/count=(exact|planned|estimated)/), g = (f = i.headers.get("content-range")) === null || f === void 0 ? void 0 : f.split("/");
855
- m && g && g.length > 1 && (c = parseInt(g[1])), r.isMaybeSingle && r.method === "GET" && Array.isArray(l) && (l.length > 1 ? (a = {
854
+ const b = (h = r.headers.get("Prefer")) === null || h === void 0 ? void 0 : h.match(/count=(exact|planned|estimated)/), g = (f = i.headers.get("content-range")) === null || f === void 0 ? void 0 : f.split("/");
855
+ b && g && g.length > 1 && (c = parseInt(g[1])), r.isMaybeSingle && r.method === "GET" && Array.isArray(l) && (l.length > 1 ? (a = {
856
856
  code: "PGRST116",
857
857
  details: `Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,
858
858
  hint: null,
@@ -860,11 +860,11 @@ var Ua = class extends Error {
860
860
  }, l = null, c = null, u = 406, d = "Not Acceptable") : l.length === 1 ? l = l[0] : l = null);
861
861
  } else {
862
862
  var y;
863
- const m = await i.text();
863
+ const b = await i.text();
864
864
  try {
865
- a = JSON.parse(m), Array.isArray(a) && i.status === 404 && (l = [], a = null, u = 200, d = "OK");
865
+ a = JSON.parse(b), Array.isArray(a) && i.status === 404 && (l = [], a = null, u = 200, d = "OK");
866
866
  } catch {
867
- i.status === 404 && m === "" ? (u = 204, d = "No Content") : a = { message: m };
867
+ i.status === 404 && b === "" ? (u = 204, d = "No Content") : a = { message: b };
868
868
  }
869
869
  if (a && r.isMaybeSingle && (!(a == null || (y = a.details) === null || y === void 0) && y.includes("0 rows")) && (a = null, u = 200, d = "OK"), a && r.shouldThrowOnError) throw new Ua(a);
870
870
  }
@@ -882,14 +882,14 @@ var Ua = class extends Error {
882
882
  const d = i == null ? void 0 : i.cause;
883
883
  if (d) {
884
884
  var h, f, p, y;
885
- const b = (h = d == null ? void 0 : d.message) !== null && h !== void 0 ? h : "", x = (f = d == null ? void 0 : d.code) !== null && f !== void 0 ? f : "";
885
+ const m = (h = d == null ? void 0 : d.message) !== null && h !== void 0 ? h : "", x = (f = d == null ? void 0 : d.code) !== null && f !== void 0 ? f : "";
886
886
  l = `${(p = i == null ? void 0 : i.name) !== null && p !== void 0 ? p : "FetchError"}: ${i == null ? void 0 : i.message}`, l += `
887
887
 
888
- Caused by: ${(y = d == null ? void 0 : d.name) !== null && y !== void 0 ? y : "Error"}: ${b}`, x && (l += ` (${x})`), d != null && d.stack && (l += `
888
+ Caused by: ${(y = d == null ? void 0 : d.name) !== null && y !== void 0 ? y : "Error"}: ${m}`, x && (l += ` (${x})`), d != null && d.stack && (l += `
889
889
  ${d.stack}`);
890
890
  } else {
891
- var m;
892
- l = (m = i == null ? void 0 : i.stack) !== null && m !== void 0 ? m : "";
891
+ var b;
892
+ l = (b = i == null ? void 0 : i.stack) !== null && b !== void 0 ? b : "";
893
893
  }
894
894
  const g = this.url.toString().length;
895
895
  return (i == null ? void 0 : i.name) === "AbortError" || (i == null ? void 0 : i.code) === "ABORT_ERR" ? (u = "", c = "Request was aborted (timeout or manual cancellation)", g > this.urlLengthLimit && (c += `. Note: Your request URL is ${g} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)) : ((d == null ? void 0 : d.name) === "HeadersOverflowError" || (d == null ? void 0 : d.code) === "UND_ERR_HEADERS_OVERFLOW") && (u = "", c = "HTTP headers exceeded server limits (typically 16KB)", g > this.urlLengthLimit && (c += `. Your request URL is ${g} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)), {
@@ -2065,8 +2065,8 @@ class eo {
2065
2065
  if (h.length > 255)
2066
2066
  throw new Error(`metadata length ${h.length} exceeds maximum of 255`);
2067
2067
  const f = this.USER_BROADCAST_PUSH_META_LENGTH + c.length + l.length + a.length + u.length + h.length, p = new ArrayBuffer(this.HEADER_LENGTH + f);
2068
- let y = new DataView(p), m = 0;
2069
- y.setUint8(m++, this.KINDS.userBroadcastPush), y.setUint8(m++, c.length), y.setUint8(m++, l.length), y.setUint8(m++, a.length), y.setUint8(m++, u.length), y.setUint8(m++, h.length), y.setUint8(m++, r), Array.from(c, (b) => y.setUint8(m++, b.charCodeAt(0))), Array.from(l, (b) => y.setUint8(m++, b.charCodeAt(0))), Array.from(a, (b) => y.setUint8(m++, b.charCodeAt(0))), Array.from(u, (b) => y.setUint8(m++, b.charCodeAt(0))), Array.from(h, (b) => y.setUint8(m++, b.charCodeAt(0)));
2068
+ let y = new DataView(p), b = 0;
2069
+ y.setUint8(b++, this.KINDS.userBroadcastPush), y.setUint8(b++, c.length), y.setUint8(b++, l.length), y.setUint8(b++, a.length), y.setUint8(b++, u.length), y.setUint8(b++, h.length), y.setUint8(b++, r), Array.from(c, (m) => y.setUint8(b++, m.charCodeAt(0))), Array.from(l, (m) => y.setUint8(b++, m.charCodeAt(0))), Array.from(a, (m) => y.setUint8(b++, m.charCodeAt(0))), Array.from(u, (m) => y.setUint8(b++, m.charCodeAt(0))), Array.from(h, (m) => y.setUint8(b++, m.charCodeAt(0)));
2070
2070
  var g = new Uint8Array(p.byteLength + s.byteLength);
2071
2071
  return g.set(new Uint8Array(p), 0), g.set(new Uint8Array(s), p.byteLength), g.buffer;
2072
2072
  }
@@ -2355,8 +2355,8 @@ class is {
2355
2355
  }), this.map(a, (u, d) => {
2356
2356
  const h = i[u];
2357
2357
  if (h) {
2358
- const f = d.map((g) => g.presence_ref), p = h.map((g) => g.presence_ref), y = d.filter((g) => p.indexOf(g.presence_ref) < 0), m = h.filter((g) => f.indexOf(g.presence_ref) < 0);
2359
- y.length > 0 && (l[u] = y), m.length > 0 && (c[u] = m);
2358
+ const f = d.map((g) => g.presence_ref), p = h.map((g) => g.presence_ref), y = d.filter((g) => p.indexOf(g.presence_ref) < 0), b = h.filter((g) => f.indexOf(g.presence_ref) < 0);
2359
+ y.length > 0 && (l[u] = y), b.length > 0 && (c[u] = b);
2360
2360
  } else
2361
2361
  l[u] = d;
2362
2362
  }), this.syncDiff(i, { joins: l, leaves: c }, s, n);
@@ -2514,17 +2514,17 @@ class Ir {
2514
2514
  e == null || e(St.SUBSCRIBED);
2515
2515
  return;
2516
2516
  } else {
2517
- const m = this.bindings.postgres_changes, g = (y = m == null ? void 0 : m.length) !== null && y !== void 0 ? y : 0, b = [];
2517
+ const b = this.bindings.postgres_changes, g = (y = b == null ? void 0 : b.length) !== null && y !== void 0 ? y : 0, m = [];
2518
2518
  for (let x = 0; x < g; x++) {
2519
- const _ = m[x], { filter: { event: v, schema: S, table: A, filter: F } } = _, P = p && p[x];
2519
+ const _ = b[x], { filter: { event: v, schema: S, table: A, filter: F } } = _, P = p && p[x];
2520
2520
  if (P && P.event === v && Ir.isFilterValueEqual(P.schema, S) && Ir.isFilterValueEqual(P.table, A) && Ir.isFilterValueEqual(P.filter, F))
2521
- b.push(Object.assign(Object.assign({}, _), { id: P.id }));
2521
+ m.push(Object.assign(Object.assign({}, _), { id: P.id }));
2522
2522
  else {
2523
2523
  this.unsubscribe(), this.state = Le.errored, e == null || e(St.CHANNEL_ERROR, new Error("mismatch between server and client bindings for postgres changes"));
2524
2524
  return;
2525
2525
  }
2526
2526
  }
2527
- this.bindings.postgres_changes = b, e && e(St.SUBSCRIBED);
2527
+ this.bindings.postgres_changes = m, e && e(St.SUBSCRIBED);
2528
2528
  return;
2529
2529
  }
2530
2530
  }).receive("error", (p) => {
@@ -2747,27 +2747,27 @@ class Ir {
2747
2747
  if (r && !f)
2748
2748
  throw "channel onMessage callbacks must return the payload, modified or unmodified";
2749
2749
  ["insert", "update", "delete"].includes(a) ? (n = this.bindings.postgres_changes) === null || n === void 0 || n.filter((p) => {
2750
- var y, m, g;
2751
- return ((y = p.filter) === null || y === void 0 ? void 0 : y.event) === "*" || ((g = (m = p.filter) === null || m === void 0 ? void 0 : m.event) === null || g === void 0 ? void 0 : g.toLocaleLowerCase()) === a;
2750
+ var y, b, g;
2751
+ return ((y = p.filter) === null || y === void 0 ? void 0 : y.event) === "*" || ((g = (b = p.filter) === null || b === void 0 ? void 0 : b.event) === null || g === void 0 ? void 0 : g.toLocaleLowerCase()) === a;
2752
2752
  }).map((p) => p.callback(f, s)) : (i = this.bindings[a]) === null || i === void 0 || i.filter((p) => {
2753
- var y, m, g, b, x, _;
2753
+ var y, b, g, m, x, _;
2754
2754
  if (["broadcast", "presence", "postgres_changes"].includes(a))
2755
2755
  if ("id" in p) {
2756
2756
  const v = p.id, S = (y = p.filter) === null || y === void 0 ? void 0 : y.event;
2757
- return v && ((m = r.ids) === null || m === void 0 ? void 0 : m.includes(v)) && (S === "*" || (S == null ? void 0 : S.toLocaleLowerCase()) === ((g = r.data) === null || g === void 0 ? void 0 : g.type.toLocaleLowerCase()));
2757
+ return v && ((b = r.ids) === null || b === void 0 ? void 0 : b.includes(v)) && (S === "*" || (S == null ? void 0 : S.toLocaleLowerCase()) === ((g = r.data) === null || g === void 0 ? void 0 : g.type.toLocaleLowerCase()));
2758
2758
  } else {
2759
- const v = (x = (b = p == null ? void 0 : p.filter) === null || b === void 0 ? void 0 : b.event) === null || x === void 0 ? void 0 : x.toLocaleLowerCase();
2759
+ const v = (x = (m = p == null ? void 0 : p.filter) === null || m === void 0 ? void 0 : m.event) === null || x === void 0 ? void 0 : x.toLocaleLowerCase();
2760
2760
  return v === "*" || v === ((_ = r == null ? void 0 : r.event) === null || _ === void 0 ? void 0 : _.toLocaleLowerCase());
2761
2761
  }
2762
2762
  else
2763
2763
  return p.type.toLocaleLowerCase() === a;
2764
2764
  }).map((p) => {
2765
2765
  if (typeof f == "object" && "ids" in f) {
2766
- const y = f.data, { schema: m, table: g, commit_timestamp: b, type: x, errors: _ } = y;
2766
+ const y = f.data, { schema: b, table: g, commit_timestamp: m, type: x, errors: _ } = y;
2767
2767
  f = Object.assign(Object.assign({}, {
2768
- schema: m,
2768
+ schema: b,
2769
2769
  table: g,
2770
- commit_timestamp: b,
2770
+ commit_timestamp: m,
2771
2771
  eventType: x,
2772
2772
  new: {},
2773
2773
  old: {},
@@ -3394,7 +3394,7 @@ Option 2: Install and provide the "ws" package:
3394
3394
  var r, s, n, i, a, l, c, u, d, h, f, p;
3395
3395
  switch (this.transport = (r = e == null ? void 0 : e.transport) !== null && r !== void 0 ? r : null, this.timeout = (s = e == null ? void 0 : e.timeout) !== null && s !== void 0 ? s : un, this.heartbeatIntervalMs = (n = e == null ? void 0 : e.heartbeatIntervalMs) !== null && n !== void 0 ? n : As.HEARTBEAT_INTERVAL, this.worker = (i = e == null ? void 0 : e.worker) !== null && i !== void 0 ? i : !1, this.accessToken = (a = e == null ? void 0 : e.accessToken) !== null && a !== void 0 ? a : null, this.heartbeatCallback = (l = e == null ? void 0 : e.heartbeatCallback) !== null && l !== void 0 ? l : Xs, this.vsn = (c = e == null ? void 0 : e.vsn) !== null && c !== void 0 ? c : ti, e != null && e.params && (this.params = e.params), e != null && e.logger && (this.logger = e.logger), (e != null && e.logLevel || e != null && e.log_level) && (this.logLevel = e.logLevel || e.log_level, this.params = Object.assign(Object.assign({}, this.params), { log_level: this.logLevel })), this.reconnectAfterMs = (u = e == null ? void 0 : e.reconnectAfterMs) !== null && u !== void 0 ? u : (y) => oo[y - 1] || lo, this.vsn) {
3396
3396
  case Ya:
3397
- this.encode = (d = e == null ? void 0 : e.encode) !== null && d !== void 0 ? d : (y, m) => m(JSON.stringify(y)), this.decode = (h = e == null ? void 0 : e.decode) !== null && h !== void 0 ? h : (y, m) => m(JSON.parse(y));
3397
+ this.encode = (d = e == null ? void 0 : e.encode) !== null && d !== void 0 ? d : (y, b) => b(JSON.stringify(y)), this.decode = (h = e == null ? void 0 : e.decode) !== null && h !== void 0 ? h : (y, b) => b(JSON.parse(y));
3398
3398
  break;
3399
3399
  case Qi:
3400
3400
  this.encode = (f = e == null ? void 0 : e.encode) !== null && f !== void 0 ? f : this.serializer.encode.bind(this.serializer), this.decode = (p = e == null ? void 0 : e.decode) !== null && p !== void 0 ? p : this.serializer.decode.bind(this.serializer);
@@ -3543,7 +3543,7 @@ var go = class {
3543
3543
  function _r(t) {
3544
3544
  return t.join("");
3545
3545
  }
3546
- var mo = class {
3546
+ var bo = class {
3547
3547
  constructor(t, e = "", r) {
3548
3548
  this.client = t, this.prefix = e, this.accessDelegation = r;
3549
3549
  }
@@ -3612,7 +3612,7 @@ var mo = class {
3612
3612
  throw r;
3613
3613
  }
3614
3614
  }
3615
- }, bo = class {
3615
+ }, mo = class {
3616
3616
  /**
3617
3617
  * Creates a new Iceberg REST Catalog client.
3618
3618
  *
@@ -3627,7 +3627,7 @@ var mo = class {
3627
3627
  baseUrl: r,
3628
3628
  auth: t.auth,
3629
3629
  fetchImpl: t.fetch
3630
- }), this.accessDelegation = (s = t.accessDelegation) == null ? void 0 : s.join(","), this.namespaceOps = new go(this.client, e), this.tableOps = new mo(this.client, e, this.accessDelegation);
3630
+ }), this.accessDelegation = (s = t.accessDelegation) == null ? void 0 : s.join(","), this.namespaceOps = new go(this.client, e), this.tableOps = new bo(this.client, e, this.accessDelegation);
3631
3631
  }
3632
3632
  /**
3633
3633
  * Lists all namespaces in the catalog.
@@ -5375,7 +5375,7 @@ var Po = class extends Kr {
5375
5375
  from(t) {
5376
5376
  var e = this;
5377
5377
  if (!wo(t)) throw new zs("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");
5378
- const r = new bo({
5378
+ const r = new mo({
5379
5379
  baseUrl: this.url,
5380
5380
  catalogName: t,
5381
5381
  auth: {
@@ -6030,7 +6030,7 @@ var Po = class extends Kr {
6030
6030
  return new No(this.url + "/iceberg", this.headers, this.fetch);
6031
6031
  }
6032
6032
  };
6033
- const sa = "2.95.3", Or = 30 * 1e3, gn = 3, Zs = gn * Or, Wo = "http://localhost:9999", qo = "supabase.auth.token", zo = { "X-Client-Info": `gotrue-js/${sa}` }, mn = "X-Supabase-Api-Version", na = {
6033
+ const sa = "2.95.3", Or = 30 * 1e3, gn = 3, Zs = gn * Or, Wo = "http://localhost:9999", qo = "supabase.auth.token", zo = { "X-Client-Info": `gotrue-js/${sa}` }, bn = "X-Supabase-Api-Version", na = {
6034
6034
  "2024-01-01": {
6035
6035
  timestamp: Date.parse("2024-01-01T00:00:00.0Z"),
6036
6036
  name: "2024-01-01"
@@ -6114,7 +6114,7 @@ class Qo extends Rt {
6114
6114
  super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.", "AuthPKCECodeVerifierMissingError", 400, "pkce_code_verifier_not_found");
6115
6115
  }
6116
6116
  }
6117
- class bn extends Rt {
6117
+ class mn extends Rt {
6118
6118
  constructor(e, r) {
6119
6119
  super(e, "AuthRetryableFetchError", r, void 0);
6120
6120
  }
@@ -6387,7 +6387,7 @@ async function Sr(t, e, r = !1) {
6387
6387
  }
6388
6388
  const hl = /^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;
6389
6389
  function fl(t) {
6390
- const e = t.headers.get(mn);
6390
+ const e = t.headers.get(bn);
6391
6391
  if (!e || !e.match(hl))
6392
6392
  return null;
6393
6393
  try {
@@ -6420,9 +6420,9 @@ function gl(t) {
6420
6420
  throw new Error("Invalid alg claim");
6421
6421
  }
6422
6422
  }
6423
- const ml = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
6423
+ const bl = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
6424
6424
  function Er(t) {
6425
- if (!ml.test(t))
6425
+ if (!bl.test(t))
6426
6426
  throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not");
6427
6427
  }
6428
6428
  function rn() {
@@ -6446,7 +6446,7 @@ function rn() {
6446
6446
  }
6447
6447
  });
6448
6448
  }
6449
- function bl(t, e) {
6449
+ function ml(t, e) {
6450
6450
  return new Proxy(t, {
6451
6451
  get: (r, s, n) => {
6452
6452
  if (s === "__isInsecureUserWarningProxy")
@@ -6467,9 +6467,9 @@ const rr = (t) => t.msg || t.message || t.error_description || t.error || JSON.s
6467
6467
  async function pi(t) {
6468
6468
  var e;
6469
6469
  if (!il(t))
6470
- throw new bn(rr(t), 0);
6470
+ throw new mn(rr(t), 0);
6471
6471
  if (yl.includes(t.status))
6472
- throw new bn(rr(t), t.status);
6472
+ throw new mn(rr(t), t.status);
6473
6473
  let r;
6474
6474
  try {
6475
6475
  r = await t.json();
@@ -6494,7 +6494,7 @@ const vl = (t, e, r, s) => {
6494
6494
  async function ie(t, e, r, s) {
6495
6495
  var n;
6496
6496
  const i = Object.assign({}, s == null ? void 0 : s.headers);
6497
- i[mn] || (i[mn] = na["2024-01-01"].name), s != null && s.jwt && (i.Authorization = `Bearer ${s.jwt}`);
6497
+ i[bn] || (i[bn] = na["2024-01-01"].name), s != null && s.jwt && (i.Authorization = `Bearer ${s.jwt}`);
6498
6498
  const a = (n = s == null ? void 0 : s.query) !== null && n !== void 0 ? n : {};
6499
6499
  s != null && s.redirectTo && (a.redirect_to = s.redirectTo);
6500
6500
  const l = Object.keys(a).length ? "?" + new URLSearchParams(a).toString() : "", c = await wl(t, e, r + l, {
@@ -6509,7 +6509,7 @@ async function wl(t, e, r, s, n, i) {
6509
6509
  try {
6510
6510
  l = await t(r, Object.assign({}, a));
6511
6511
  } catch (c) {
6512
- throw console.error(c), new bn(rr(c), 0);
6512
+ throw console.error(c), new mn(rr(c), 0);
6513
6513
  }
6514
6514
  if (l.ok || await pi(l), s != null && s.noResolveJson)
6515
6515
  return l;
@@ -6553,7 +6553,7 @@ function _l(t) {
6553
6553
  error: null
6554
6554
  };
6555
6555
  }
6556
- function mi(t) {
6556
+ function bi(t) {
6557
6557
  return t;
6558
6558
  }
6559
6559
  function kl(t) {
@@ -6688,14 +6688,14 @@ class Sl {
6688
6688
  page: (s = (r = e == null ? void 0 : e.page) === null || r === void 0 ? void 0 : r.toString()) !== null && s !== void 0 ? s : "",
6689
6689
  per_page: (i = (n = e == null ? void 0 : e.perPage) === null || n === void 0 ? void 0 : n.toString()) !== null && i !== void 0 ? i : ""
6690
6690
  },
6691
- xform: mi
6691
+ xform: bi
6692
6692
  });
6693
6693
  if (d.error)
6694
6694
  throw d.error;
6695
6695
  const h = await d.json(), f = (a = d.headers.get("x-total-count")) !== null && a !== void 0 ? a : 0, p = (c = (l = d.headers.get("link")) === null || l === void 0 ? void 0 : l.split(",")) !== null && c !== void 0 ? c : [];
6696
6696
  return p.length > 0 && (p.forEach((y) => {
6697
- const m = parseInt(y.split(";")[0].split("=")[1].substring(0, 1)), g = JSON.parse(y.split(";")[1].split("=")[1]);
6698
- u[`${g}Page`] = m;
6697
+ const b = parseInt(y.split(";")[0].split("=")[1].substring(0, 1)), g = JSON.parse(y.split(";")[1].split("=")[1]);
6698
+ u[`${g}Page`] = b;
6699
6699
  }), u.total = parseInt(f)), { data: Object.assign(Object.assign({}, h), u), error: null };
6700
6700
  } catch (u) {
6701
6701
  if (J(u))
@@ -6811,14 +6811,14 @@ class Sl {
6811
6811
  page: (s = (r = e == null ? void 0 : e.page) === null || r === void 0 ? void 0 : r.toString()) !== null && s !== void 0 ? s : "",
6812
6812
  per_page: (i = (n = e == null ? void 0 : e.perPage) === null || n === void 0 ? void 0 : n.toString()) !== null && i !== void 0 ? i : ""
6813
6813
  },
6814
- xform: mi
6814
+ xform: bi
6815
6815
  });
6816
6816
  if (d.error)
6817
6817
  throw d.error;
6818
6818
  const h = await d.json(), f = (a = d.headers.get("x-total-count")) !== null && a !== void 0 ? a : 0, p = (c = (l = d.headers.get("link")) === null || l === void 0 ? void 0 : l.split(",")) !== null && c !== void 0 ? c : [];
6819
6819
  return p.length > 0 && (p.forEach((y) => {
6820
- const m = parseInt(y.split(";")[0].split("=")[1].substring(0, 1)), g = JSON.parse(y.split(";")[1].split("=")[1]);
6821
- u[`${g}Page`] = m;
6820
+ const b = parseInt(y.split(";")[0].split("=")[1].substring(0, 1)), g = JSON.parse(y.split(";")[1].split("=")[1]);
6821
+ u[`${g}Page`] = b;
6822
6822
  }), u.total = parseInt(f)), { data: Object.assign(Object.assign({}, h), u), error: null };
6823
6823
  } catch (u) {
6824
6824
  if (J(u))
@@ -6919,7 +6919,7 @@ class Sl {
6919
6919
  }
6920
6920
  }
6921
6921
  }
6922
- function bi(t = {}) {
6922
+ function mi(t = {}) {
6923
6923
  return {
6924
6924
  getItem: (e) => t[e] || null,
6925
6925
  setItem: (e, r) => {
@@ -7019,19 +7019,19 @@ function Ol(t) {
7019
7019
  `))
7020
7020
  throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`);
7021
7021
  }
7022
- const p = ca(t.address), y = d ? `${d}://${s}` : s, m = t.statement ? `${t.statement}
7022
+ const p = ca(t.address), y = d ? `${d}://${s}` : s, b = t.statement ? `${t.statement}
7023
7023
  ` : "", g = `${y} wants you to sign in with your Ethereum account:
7024
7024
  ${p}
7025
7025
 
7026
- ${m}`;
7027
- let b = `URI: ${h}
7026
+ ${b}`;
7027
+ let m = `URI: ${h}
7028
7028
  Version: ${f}
7029
7029
  Chain ID: ${r}${a ? `
7030
7030
  Nonce: ${a}` : ""}
7031
7031
  Issued At: ${i.toISOString()}`;
7032
- if (n && (b += `
7033
- Expiration Time: ${n.toISOString()}`), l && (b += `
7034
- Not Before: ${l.toISOString()}`), c && (b += `
7032
+ if (n && (m += `
7033
+ Expiration Time: ${n.toISOString()}`), l && (m += `
7034
+ Not Before: ${l.toISOString()}`), c && (m += `
7035
7035
  Request ID: ${c}`), u) {
7036
7036
  let x = `
7037
7037
  Resources:`;
@@ -7041,10 +7041,10 @@ Resources:`;
7041
7041
  x += `
7042
7042
  - ${_}`;
7043
7043
  }
7044
- b += x;
7044
+ m += x;
7045
7045
  }
7046
7046
  return `${g}
7047
- ${b}`;
7047
+ ${m}`;
7048
7048
  }
7049
7049
  class Be extends Error {
7050
7050
  constructor({ message: e, code: r, cause: s, name: n }) {
@@ -7719,7 +7719,7 @@ class fs {
7719
7719
  denyAuthorization: this._denyAuthorization.bind(this),
7720
7720
  listGrants: this._listOAuthGrants.bind(this),
7721
7721
  revokeGrant: this._revokeOAuthGrant.bind(this)
7722
- }, this.persistSession ? (i.storage ? this.storage = i.storage : aa() ? this.storage = globalThis.localStorage : (this.memoryStorage = {}, this.storage = bi(this.memoryStorage)), i.userStorage && (this.userStorage = i.userStorage)) : (this.memoryStorage = {}, this.storage = bi(this.memoryStorage)), We() && globalThis.BroadcastChannel && this.persistSession && this.storageKey) {
7722
+ }, this.persistSession ? (i.storage ? this.storage = i.storage : aa() ? this.storage = globalThis.localStorage : (this.memoryStorage = {}, this.storage = mi(this.memoryStorage)), i.userStorage && (this.userStorage = i.userStorage)) : (this.memoryStorage = {}, this.storage = mi(this.memoryStorage)), We() && globalThis.BroadcastChannel && this.persistSession && this.storageKey) {
7723
7723
  try {
7724
7724
  this.broadcastChannel = new globalThis.BroadcastChannel(this.storageKey);
7725
7725
  } catch (a) {
@@ -7979,7 +7979,7 @@ class fs {
7979
7979
  if ("message" in e)
7980
7980
  p = e.message, y = e.signature;
7981
7981
  else {
7982
- const { chain: m, wallet: g, statement: b, options: x } = e;
7982
+ const { chain: b, wallet: g, statement: m, options: x } = e;
7983
7983
  let _;
7984
7984
  if (We())
7985
7985
  if (typeof g == "object")
@@ -8014,7 +8014,7 @@ class fs {
8014
8014
  const P = {
8015
8015
  domain: v.host,
8016
8016
  address: A,
8017
- statement: b,
8017
+ statement: m,
8018
8018
  uri: v.href,
8019
8019
  version: "1",
8020
8020
  chainId: F,
@@ -8031,7 +8031,7 @@ class fs {
8031
8031
  });
8032
8032
  }
8033
8033
  try {
8034
- const { data: m, error: g } = await ie(this.fetch, "POST", `${this.url}/token?grant_type=web3`, {
8034
+ const { data: b, error: g } = await ie(this.fetch, "POST", `${this.url}/token?grant_type=web3`, {
8035
8035
  headers: this.headers,
8036
8036
  body: Object.assign({
8037
8037
  chain: "ethereum",
@@ -8042,28 +8042,28 @@ class fs {
8042
8042
  });
8043
8043
  if (g)
8044
8044
  throw g;
8045
- if (!m || !m.session || !m.user) {
8046
- const b = new kr();
8047
- return this._returnResult({ data: { user: null, session: null }, error: b });
8048
- }
8049
- return m.session && (await this._saveSession(m.session), await this._notifyAllSubscribers("SIGNED_IN", m.session)), this._returnResult({ data: Object.assign({}, m), error: g });
8050
- } catch (m) {
8051
- if (J(m))
8045
+ if (!b || !b.session || !b.user) {
8046
+ const m = new kr();
8052
8047
  return this._returnResult({ data: { user: null, session: null }, error: m });
8053
- throw m;
8048
+ }
8049
+ return b.session && (await this._saveSession(b.session), await this._notifyAllSubscribers("SIGNED_IN", b.session)), this._returnResult({ data: Object.assign({}, b), error: g });
8050
+ } catch (b) {
8051
+ if (J(b))
8052
+ return this._returnResult({ data: { user: null, session: null }, error: b });
8053
+ throw b;
8054
8054
  }
8055
8055
  }
8056
8056
  async signInWithSolana(e) {
8057
8057
  var r, s, n, i, a, l, c, u, d, h, f, p;
8058
- let y, m;
8058
+ let y, b;
8059
8059
  if ("message" in e)
8060
- y = e.message, m = e.signature;
8060
+ y = e.message, b = e.signature;
8061
8061
  else {
8062
- const { chain: g, wallet: b, statement: x, options: _ } = e;
8062
+ const { chain: g, wallet: m, statement: x, options: _ } = e;
8063
8063
  let v;
8064
8064
  if (We())
8065
- if (typeof b == "object")
8066
- v = b;
8065
+ if (typeof m == "object")
8066
+ v = m;
8067
8067
  else {
8068
8068
  const A = window;
8069
8069
  if ("solana" in A && typeof A.solana == "object" && ("signIn" in A.solana && typeof A.solana.signIn == "function" || "signMessage" in A.solana && typeof A.solana.signMessage == "function"))
@@ -8072,9 +8072,9 @@ class fs {
8072
8072
  throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.");
8073
8073
  }
8074
8074
  else {
8075
- if (typeof b != "object" || !(_ != null && _.url))
8075
+ if (typeof m != "object" || !(_ != null && _.url))
8076
8076
  throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");
8077
- v = b;
8077
+ v = m;
8078
8078
  }
8079
8079
  const S = new URL((r = _ == null ? void 0 : _.url) !== null && r !== void 0 ? r : window.location.href);
8080
8080
  if ("signIn" in v && v.signIn) {
@@ -8092,7 +8092,7 @@ class fs {
8092
8092
  else
8093
8093
  throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");
8094
8094
  if ("signedMessage" in F && "signature" in F && (typeof F.signedMessage == "string" || F.signedMessage instanceof Uint8Array) && F.signature instanceof Uint8Array)
8095
- y = typeof F.signedMessage == "string" ? F.signedMessage : new TextDecoder().decode(F.signedMessage), m = F.signature;
8095
+ y = typeof F.signedMessage == "string" ? F.signedMessage : new TextDecoder().decode(F.signedMessage), b = F.signature;
8096
8096
  else
8097
8097
  throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields");
8098
8098
  } else {
@@ -8119,22 +8119,22 @@ class fs {
8119
8119
  const A = await v.signMessage(new TextEncoder().encode(y), "utf8");
8120
8120
  if (!A || !(A instanceof Uint8Array))
8121
8121
  throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");
8122
- m = A;
8122
+ b = A;
8123
8123
  }
8124
8124
  }
8125
8125
  try {
8126
- const { data: g, error: b } = await ie(this.fetch, "POST", `${this.url}/token?grant_type=web3`, {
8126
+ const { data: g, error: m } = await ie(this.fetch, "POST", `${this.url}/token?grant_type=web3`, {
8127
8127
  headers: this.headers,
8128
- body: Object.assign({ chain: "solana", message: y, signature: ir(m) }, !((f = e.options) === null || f === void 0) && f.captchaToken ? { gotrue_meta_security: { captcha_token: (p = e.options) === null || p === void 0 ? void 0 : p.captchaToken } } : null),
8128
+ body: Object.assign({ chain: "solana", message: y, signature: ir(b) }, !((f = e.options) === null || f === void 0) && f.captchaToken ? { gotrue_meta_security: { captcha_token: (p = e.options) === null || p === void 0 ? void 0 : p.captchaToken } } : null),
8129
8129
  xform: ct
8130
8130
  });
8131
- if (b)
8132
- throw b;
8131
+ if (m)
8132
+ throw m;
8133
8133
  if (!g || !g.session || !g.user) {
8134
8134
  const x = new kr();
8135
8135
  return this._returnResult({ data: { user: null, session: null }, error: x });
8136
8136
  }
8137
- return g.session && (await this._saveSession(g.session), await this._notifyAllSubscribers("SIGNED_IN", g.session)), this._returnResult({ data: Object.assign({}, g), error: b });
8137
+ return g.session && (await this._saveSession(g.session), await this._notifyAllSubscribers("SIGNED_IN", g.session)), this._returnResult({ data: Object.assign({}, g), error: m });
8138
8138
  } catch (g) {
8139
8139
  if (J(g))
8140
8140
  return this._returnResult({ data: { user: null, session: null }, error: g });
@@ -8473,7 +8473,7 @@ class fs {
8473
8473
  }
8474
8474
  if (this.storage.isServer && e.user && !e.user.__isUserNotAvailableProxy) {
8475
8475
  const a = { value: this.suppressGetSessionWarning };
8476
- e.user = bl(e.user, a), a.value && (this.suppressGetSessionWarning = !0);
8476
+ e.user = ml(e.user, a), a.value && (this.suppressGetSessionWarning = !0);
8477
8477
  }
8478
8478
  return { data: { session: e }, error: null };
8479
8479
  }
@@ -8668,10 +8668,10 @@ class fs {
8668
8668
  p * 1e3 <= Or && console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${h}s`);
8669
8669
  const y = f - h;
8670
8670
  d - y >= 120 ? console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale", y, f, d) : d - y < 0 && console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew", y, f, d);
8671
- const { data: m, error: g } = await this._getUser(i);
8671
+ const { data: b, error: g } = await this._getUser(i);
8672
8672
  if (g)
8673
8673
  throw g;
8674
- const b = {
8674
+ const m = {
8675
8675
  provider_token: s,
8676
8676
  provider_refresh_token: n,
8677
8677
  access_token: i,
@@ -8679,9 +8679,9 @@ class fs {
8679
8679
  expires_at: f,
8680
8680
  refresh_token: a,
8681
8681
  token_type: u,
8682
- user: m.user
8682
+ user: b.user
8683
8683
  };
8684
- return window.location.hash = "", this._debug("#_getSessionFromURL()", "clearing window.location.hash"), this._returnResult({ data: { session: b, redirectType: e.type }, error: null });
8684
+ return window.location.hash = "", this._debug("#_getSessionFromURL()", "clearing window.location.hash"), this._returnResult({ data: { session: m, redirectType: e.type }, error: null });
8685
8685
  } catch (s) {
8686
8686
  if (J(s))
8687
8687
  return this._returnResult({ data: { session: null, redirectType: null }, error: s });
@@ -9347,13 +9347,13 @@ class fs {
9347
9347
  const { payload: p } = Ns(e);
9348
9348
  let y = null;
9349
9349
  p.aal && (y = p.aal);
9350
- let m = y;
9351
- const { data: { user: g }, error: b } = await this.getUser(e);
9352
- if (b)
9353
- return this._returnResult({ data: null, error: b });
9354
- ((s = (r = g == null ? void 0 : g.factors) === null || r === void 0 ? void 0 : r.filter((v) => v.status === "verified")) !== null && s !== void 0 ? s : []).length > 0 && (m = "aal2");
9350
+ let b = y;
9351
+ const { data: { user: g }, error: m } = await this.getUser(e);
9352
+ if (m)
9353
+ return this._returnResult({ data: null, error: m });
9354
+ ((s = (r = g == null ? void 0 : g.factors) === null || r === void 0 ? void 0 : r.filter((v) => v.status === "verified")) !== null && s !== void 0 ? s : []).length > 0 && (b = "aal2");
9355
9355
  const _ = p.amr || [];
9356
- return { data: { currentLevel: y, nextLevel: m, currentAuthenticationMethods: _ }, error: null };
9356
+ return { data: { currentLevel: y, nextLevel: b, currentAuthenticationMethods: _ }, error: null };
9357
9357
  } catch (p) {
9358
9358
  if (J(p))
9359
9359
  return this._returnResult({ data: null, error: p });
@@ -9888,7 +9888,7 @@ var ks = class {
9888
9888
  clearTimeout: (t) => clearTimeout(t),
9889
9889
  setInterval: (t, e) => setInterval(t, e),
9890
9890
  clearInterval: (t) => clearInterval(t)
9891
- }, bt, or, Di, fc = (Di = class {
9891
+ }, mt, or, Di, fc = (Di = class {
9892
9892
  constructor() {
9893
9893
  // We cannot have TimeoutManager<T> as we must instantiate it with a concrete
9894
9894
  // type at app boot; and if we leave that type, then any new timer provider
@@ -9896,28 +9896,28 @@ var ks = class {
9896
9896
  //
9897
9897
  // We settle for type safety for the TimeoutProvider type, and accept that
9898
9898
  // this class is unsafe internally to allow for extension.
9899
- ne(this, bt, hc);
9899
+ ne(this, mt, hc);
9900
9900
  ne(this, or, !1);
9901
9901
  }
9902
9902
  setTimeoutProvider(t) {
9903
- process.env.NODE_ENV !== "production" && k(this, or) && t !== k(this, bt) && console.error(
9903
+ process.env.NODE_ENV !== "production" && k(this, or) && t !== k(this, mt) && console.error(
9904
9904
  "[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",
9905
- { previous: k(this, bt), provider: t }
9906
- ), W(this, bt, t), process.env.NODE_ENV !== "production" && W(this, or, !1);
9905
+ { previous: k(this, mt), provider: t }
9906
+ ), W(this, mt, t), process.env.NODE_ENV !== "production" && W(this, or, !1);
9907
9907
  }
9908
9908
  setTimeout(t, e) {
9909
- return process.env.NODE_ENV !== "production" && W(this, or, !0), k(this, bt).setTimeout(t, e);
9909
+ return process.env.NODE_ENV !== "production" && W(this, or, !0), k(this, mt).setTimeout(t, e);
9910
9910
  }
9911
9911
  clearTimeout(t) {
9912
- k(this, bt).clearTimeout(t);
9912
+ k(this, mt).clearTimeout(t);
9913
9913
  }
9914
9914
  setInterval(t, e) {
9915
- return process.env.NODE_ENV !== "production" && W(this, or, !0), k(this, bt).setInterval(t, e);
9915
+ return process.env.NODE_ENV !== "production" && W(this, or, !0), k(this, mt).setInterval(t, e);
9916
9916
  }
9917
9917
  clearInterval(t) {
9918
- k(this, bt).clearInterval(t);
9918
+ k(this, mt).clearInterval(t);
9919
9919
  }
9920
- }, bt = new WeakMap(), or = new WeakMap(), Di), ar = new fc();
9920
+ }, mt = new WeakMap(), or = new WeakMap(), Di), ar = new fc();
9921
9921
  function pc(t) {
9922
9922
  setTimeout(t, 0);
9923
9923
  }
@@ -9952,7 +9952,7 @@ function xi(t, e) {
9952
9952
  if (s) {
9953
9953
  if (e.queryHash !== Un(a, e.options))
9954
9954
  return !1;
9955
- } else if (!ms(e.queryKey, a))
9955
+ } else if (!bs(e.queryKey, a))
9956
9956
  return !1;
9957
9957
  }
9958
9958
  if (r !== "all") {
@@ -9970,7 +9970,7 @@ function _i(t, e) {
9970
9970
  if (r) {
9971
9971
  if (gs(e.options.mutationKey) !== gs(i))
9972
9972
  return !1;
9973
- } else if (!ms(e.options.mutationKey, i))
9973
+ } else if (!bs(e.options.mutationKey, i))
9974
9974
  return !1;
9975
9975
  }
9976
9976
  return !(s && e.state.status !== s || n && !n(e));
@@ -9984,10 +9984,10 @@ function gs(t) {
9984
9984
  (e, r) => kn(r) ? Object.keys(r).sort().reduce((s, n) => (s[n] = r[n], s), {}) : r
9985
9985
  );
9986
9986
  }
9987
- function ms(t, e) {
9988
- return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((r) => ms(t[r], e[r])) : !1;
9987
+ function bs(t, e) {
9988
+ return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((r) => bs(t[r], e[r])) : !1;
9989
9989
  }
9990
- var mc = Object.prototype.hasOwnProperty;
9990
+ var bc = Object.prototype.hasOwnProperty;
9991
9991
  function xn(t, e, r = 0) {
9992
9992
  if (t === e)
9993
9993
  return t;
@@ -9999,7 +9999,7 @@ function xn(t, e, r = 0) {
9999
9999
  for (let d = 0; d < l; d++) {
10000
10000
  const h = s ? d : a[d], f = t[h], p = e[h];
10001
10001
  if (f === p) {
10002
- c[h] = f, (s ? d < i : mc.call(t, h)) && u++;
10002
+ c[h] = f, (s ? d < i : bc.call(t, h)) && u++;
10003
10003
  continue;
10004
10004
  }
10005
10005
  if (f === null || p === null || typeof f != "object" || typeof p != "object") {
@@ -10034,7 +10034,7 @@ function kn(t) {
10034
10034
  function Si(t) {
10035
10035
  return Object.prototype.toString.call(t) === "[object Object]";
10036
10036
  }
10037
- function bc(t) {
10037
+ function mc(t) {
10038
10038
  return new Promise((e) => {
10039
10039
  ar.setTimeout(e, t);
10040
10040
  });
@@ -10251,49 +10251,49 @@ var jn = class extends Error {
10251
10251
  };
10252
10252
  function ga(t) {
10253
10253
  let e = !1, r = 0, s;
10254
- const n = En(), i = () => n.status !== "pending", a = (m) => {
10254
+ const n = En(), i = () => n.status !== "pending", a = (b) => {
10255
10255
  var g;
10256
10256
  if (!i()) {
10257
- const b = new jn(m);
10258
- f(b), (g = t.onCancel) == null || g.call(t, b);
10257
+ const m = new jn(b);
10258
+ f(m), (g = t.onCancel) == null || g.call(t, m);
10259
10259
  }
10260
10260
  }, l = () => {
10261
10261
  e = !0;
10262
10262
  }, c = () => {
10263
10263
  e = !1;
10264
- }, u = () => Mn.isFocused() && (t.networkMode === "always" || Ms.isOnline()) && t.canRun(), d = () => pa(t.networkMode) && t.canRun(), h = (m) => {
10265
- i() || (s == null || s(), n.resolve(m));
10266
- }, f = (m) => {
10267
- i() || (s == null || s(), n.reject(m));
10268
- }, p = () => new Promise((m) => {
10264
+ }, u = () => Mn.isFocused() && (t.networkMode === "always" || Ms.isOnline()) && t.canRun(), d = () => pa(t.networkMode) && t.canRun(), h = (b) => {
10265
+ i() || (s == null || s(), n.resolve(b));
10266
+ }, f = (b) => {
10267
+ i() || (s == null || s(), n.reject(b));
10268
+ }, p = () => new Promise((b) => {
10269
10269
  var g;
10270
- s = (b) => {
10271
- (i() || u()) && m(b);
10270
+ s = (m) => {
10271
+ (i() || u()) && b(m);
10272
10272
  }, (g = t.onPause) == null || g.call(t);
10273
10273
  }).then(() => {
10274
- var m;
10275
- s = void 0, i() || (m = t.onContinue) == null || m.call(t);
10274
+ var b;
10275
+ s = void 0, i() || (b = t.onContinue) == null || b.call(t);
10276
10276
  }), y = () => {
10277
10277
  if (i())
10278
10278
  return;
10279
- let m;
10279
+ let b;
10280
10280
  const g = r === 0 ? t.initialPromise : void 0;
10281
10281
  try {
10282
- m = g ?? t.fn();
10283
- } catch (b) {
10284
- m = Promise.reject(b);
10282
+ b = g ?? t.fn();
10283
+ } catch (m) {
10284
+ b = Promise.reject(m);
10285
10285
  }
10286
- Promise.resolve(m).then(h).catch((b) => {
10286
+ Promise.resolve(b).then(h).catch((m) => {
10287
10287
  var A;
10288
10288
  if (i())
10289
10289
  return;
10290
- const x = t.retry ?? (yr ? 0 : 3), _ = t.retryDelay ?? Ec, v = typeof _ == "function" ? _(r, b) : _, S = x === !0 || typeof x == "number" && r < x || typeof x == "function" && x(r, b);
10290
+ const x = t.retry ?? (yr ? 0 : 3), _ = t.retryDelay ?? Ec, v = typeof _ == "function" ? _(r, m) : _, S = x === !0 || typeof x == "number" && r < x || typeof x == "function" && x(r, m);
10291
10291
  if (e || !S) {
10292
- f(b);
10292
+ f(m);
10293
10293
  return;
10294
10294
  }
10295
- r++, (A = t.onFail) == null || A.call(t, r, b), bc(v).then(() => u() ? void 0 : p()).then(() => {
10296
- e ? f(b) : y();
10295
+ r++, (A = t.onFail) == null || A.call(t, r, m), mc(v).then(() => u() ? void 0 : p()).then(() => {
10296
+ e ? f(m) : y();
10297
10297
  });
10298
10298
  });
10299
10299
  };
@@ -10308,7 +10308,7 @@ function ga(t) {
10308
10308
  start: () => (d() ? y() : p().then(y), n)
10309
10309
  };
10310
10310
  }
10311
- var cr, Wi, ma = (Wi = class {
10311
+ var cr, Wi, ba = (Wi = class {
10312
10312
  constructor() {
10313
10313
  ne(this, cr);
10314
10314
  }
@@ -10329,7 +10329,7 @@ var cr, Wi, ma = (Wi = class {
10329
10329
  clearGcTimeout() {
10330
10330
  k(this, cr) && (ar.clearTimeout(k(this, cr)), W(this, cr, void 0));
10331
10331
  }
10332
- }, cr = new WeakMap(), Wi), ur, Lr, nt, dr, Ue, bs, hr, dt, kt, qi, jc = (qi = class extends ma {
10332
+ }, cr = new WeakMap(), Wi), ur, Lr, nt, dr, Ue, ms, hr, dt, kt, qi, jc = (qi = class extends ba {
10333
10333
  constructor(e) {
10334
10334
  super();
10335
10335
  ne(this, dt);
@@ -10338,9 +10338,9 @@ var cr, Wi, ma = (Wi = class {
10338
10338
  ne(this, nt);
10339
10339
  ne(this, dr);
10340
10340
  ne(this, Ue);
10341
- ne(this, bs);
10341
+ ne(this, ms);
10342
10342
  ne(this, hr);
10343
- W(this, hr, !1), W(this, bs, e.defaultOptions), this.setOptions(e.options), this.observers = [], W(this, dr, e.client), W(this, nt, k(this, dr).getQueryCache()), this.queryKey = e.queryKey, this.queryHash = e.queryHash, W(this, ur, ji(this.options)), this.state = e.state ?? k(this, ur), this.scheduleGc();
10343
+ W(this, hr, !1), W(this, ms, e.defaultOptions), this.setOptions(e.options), this.observers = [], W(this, dr, e.client), W(this, nt, k(this, dr).getQueryCache()), this.queryKey = e.queryKey, this.queryHash = e.queryHash, W(this, ur, ji(this.options)), this.state = e.state ?? k(this, ur), this.scheduleGc();
10344
10344
  }
10345
10345
  get meta() {
10346
10346
  return this.options.meta;
@@ -10350,7 +10350,7 @@ var cr, Wi, ma = (Wi = class {
10350
10350
  return (e = k(this, Ue)) == null ? void 0 : e.promise;
10351
10351
  }
10352
10352
  setOptions(e) {
10353
- if (this.options = { ...k(this, bs), ...e }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
10353
+ if (this.options = { ...k(this, ms), ...e }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
10354
10354
  const r = ji(this.options);
10355
10355
  r.data !== void 0 && (this.setState(
10356
10356
  Ei(r.data, r.dataUpdatedAt)
@@ -10427,7 +10427,7 @@ var cr, Wi, ma = (Wi = class {
10427
10427
  this.state.isInvalidated || fe(this, dt, kt).call(this, { type: "invalidate" });
10428
10428
  }
10429
10429
  async fetch(e, r) {
10430
- var c, u, d, h, f, p, y, m, g, b, x, _;
10430
+ var c, u, d, h, f, p, y, b, g, m, x, _;
10431
10431
  if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely
10432
10432
  // re-start the fetch; there is a chance that the query is still in a
10433
10433
  // pending state when that happens
@@ -10503,7 +10503,7 @@ var cr, Wi, ma = (Wi = class {
10503
10503
  throw process.env.NODE_ENV !== "production" && console.error(
10504
10504
  `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
10505
10505
  ), new Error(`${this.queryHash} data is undefined`);
10506
- return this.setData(v), (p = (f = k(this, nt).config).onSuccess) == null || p.call(f, v, this), (m = (y = k(this, nt).config).onSettled) == null || m.call(
10506
+ return this.setData(v), (p = (f = k(this, nt).config).onSuccess) == null || p.call(f, v, this), (b = (y = k(this, nt).config).onSettled) == null || b.call(
10507
10507
  y,
10508
10508
  v,
10509
10509
  this.state.error,
@@ -10522,7 +10522,7 @@ var cr, Wi, ma = (Wi = class {
10522
10522
  throw fe(this, dt, kt).call(this, {
10523
10523
  type: "error",
10524
10524
  error: v
10525
- }), (b = (g = k(this, nt).config).onError) == null || b.call(
10525
+ }), (m = (g = k(this, nt).config).onError) == null || m.call(
10526
10526
  g,
10527
10527
  v,
10528
10528
  this
@@ -10536,7 +10536,7 @@ var cr, Wi, ma = (Wi = class {
10536
10536
  this.scheduleGc();
10537
10537
  }
10538
10538
  }
10539
- }, ur = new WeakMap(), Lr = new WeakMap(), nt = new WeakMap(), dr = new WeakMap(), Ue = new WeakMap(), bs = new WeakMap(), hr = new WeakMap(), dt = new WeakSet(), kt = function(e) {
10539
+ }, ur = new WeakMap(), Lr = new WeakMap(), nt = new WeakMap(), dr = new WeakMap(), Ue = new WeakMap(), ms = new WeakMap(), hr = new WeakMap(), dt = new WeakSet(), kt = function(e) {
10540
10540
  const r = (s) => {
10541
10541
  switch (e.type) {
10542
10542
  case "failed":
@@ -10558,7 +10558,7 @@ var cr, Wi, ma = (Wi = class {
10558
10558
  case "fetch":
10559
10559
  return {
10560
10560
  ...s,
10561
- ...ba(s.data, this.options),
10561
+ ...ma(s.data, this.options),
10562
10562
  fetchMeta: e.meta ?? null
10563
10563
  };
10564
10564
  case "success":
@@ -10606,7 +10606,7 @@ var cr, Wi, ma = (Wi = class {
10606
10606
  }), k(this, nt).notify({ query: this, type: "updated", action: e });
10607
10607
  });
10608
10608
  }, qi);
10609
- function ba(t, e) {
10609
+ function ma(t, e) {
10610
10610
  return {
10611
10611
  fetchFailureCount: 0,
10612
10612
  fetchFailureReason: null,
@@ -10758,15 +10758,15 @@ var Je, pe, ys, Ve, fr, $r, Et, Wt, vs, Dr, Ur, pr, gr, qt, Mr, ye, ns, Tn, Rn,
10758
10758
  const E = this.hasListeners(), T = !E && Ti(e, r), j = E && Ri(e, s, r, n);
10759
10759
  (T || j) && (h = {
10760
10760
  ...h,
10761
- ...ba(d.data, e.options)
10761
+ ...ma(d.data, e.options)
10762
10762
  }), r._optimisticResults === "isRestoring" && (h.fetchStatus = "idle");
10763
10763
  }
10764
- let { error: y, errorUpdatedAt: m, status: g } = h;
10764
+ let { error: y, errorUpdatedAt: b, status: g } = h;
10765
10765
  p = h.data;
10766
- let b = !1;
10766
+ let m = !1;
10767
10767
  if (r.placeholderData !== void 0 && p === void 0 && g === "pending") {
10768
10768
  let E;
10769
- i != null && i.isPlaceholderData && r.placeholderData === (l == null ? void 0 : l.placeholderData) ? (E = i.data, b = !0) : E = typeof r.placeholderData == "function" ? r.placeholderData(
10769
+ i != null && i.isPlaceholderData && r.placeholderData === (l == null ? void 0 : l.placeholderData) ? (E = i.data, m = !0) : E = typeof r.placeholderData == "function" ? r.placeholderData(
10770
10770
  (D = k(this, Ur)) == null ? void 0 : D.state.data,
10771
10771
  k(this, Ur)
10772
10772
  ) : r.placeholderData, E !== void 0 && (g = "success", p = Sn(
@@ -10775,7 +10775,7 @@ var Je, pe, ys, Ve, fr, $r, Et, Wt, vs, Dr, Ur, pr, gr, qt, Mr, ye, ns, Tn, Rn,
10775
10775
  r
10776
10776
  ), f = !0);
10777
10777
  }
10778
- if (r.select && p !== void 0 && !b)
10778
+ if (r.select && p !== void 0 && !m)
10779
10779
  if (i && p === (a == null ? void 0 : a.data) && r.select === k(this, vs))
10780
10780
  p = k(this, Dr);
10781
10781
  else
@@ -10784,7 +10784,7 @@ var Je, pe, ys, Ve, fr, $r, Et, Wt, vs, Dr, Ur, pr, gr, qt, Mr, ye, ns, Tn, Rn,
10784
10784
  } catch (E) {
10785
10785
  W(this, Wt, E);
10786
10786
  }
10787
- k(this, Wt) && (y = k(this, Wt), p = k(this, Dr), m = Date.now(), g = "error");
10787
+ k(this, Wt) && (y = k(this, Wt), p = k(this, Dr), b = Date.now(), g = "error");
10788
10788
  const x = h.fetchStatus === "fetching", _ = g === "pending", v = g === "error", S = _ && x, A = p !== void 0, P = {
10789
10789
  status: g,
10790
10790
  fetchStatus: h.fetchStatus,
@@ -10796,7 +10796,7 @@ var Je, pe, ys, Ve, fr, $r, Et, Wt, vs, Dr, Ur, pr, gr, qt, Mr, ye, ns, Tn, Rn,
10796
10796
  data: p,
10797
10797
  dataUpdatedAt: h.dataUpdatedAt,
10798
10798
  error: y,
10799
- errorUpdatedAt: m,
10799
+ errorUpdatedAt: b,
10800
10800
  failureCount: h.fetchFailureCount,
10801
10801
  failureReason: h.fetchFailureReason,
10802
10802
  errorUpdateCount: h.errorUpdateCount,
@@ -10934,15 +10934,15 @@ function Ai(t) {
10934
10934
  const s = e.options, n = (f = (h = (d = e.fetchOptions) == null ? void 0 : d.meta) == null ? void 0 : h.fetchMore) == null ? void 0 : f.direction, i = ((p = e.state.data) == null ? void 0 : p.pages) || [], a = ((y = e.state.data) == null ? void 0 : y.pageParams) || [];
10935
10935
  let l = { pages: [], pageParams: [] }, c = 0;
10936
10936
  const u = async () => {
10937
- let m = !1;
10937
+ let b = !1;
10938
10938
  const g = (_) => {
10939
10939
  wc(
10940
10940
  _,
10941
10941
  () => e.signal,
10942
- () => m = !0
10942
+ () => b = !0
10943
10943
  );
10944
- }, b = ha(e.options, e.fetchOptions), x = async (_, v, S) => {
10945
- if (m)
10944
+ }, m = ha(e.options, e.fetchOptions), x = async (_, v, S) => {
10945
+ if (b)
10946
10946
  return Promise.reject();
10947
10947
  if (v == null && _.pages.length)
10948
10948
  return Promise.resolve(_);
@@ -10955,7 +10955,7 @@ function Ai(t) {
10955
10955
  meta: e.options.meta
10956
10956
  };
10957
10957
  return g(T), T;
10958
- })(), P = await b(F), { maxPages: D } = e.options, E = S ? vc : yc;
10958
+ })(), P = await m(F), { maxPages: D } = e.options, E = S ? vc : yc;
10959
10959
  return {
10960
10960
  pages: E(_.pages, P, D),
10961
10961
  pageParams: E(_.pageParams, v, D)
@@ -10979,9 +10979,9 @@ function Ai(t) {
10979
10979
  return l;
10980
10980
  };
10981
10981
  e.options.persister ? e.fetchFn = () => {
10982
- var m, g;
10983
- return (g = (m = e.options).persister) == null ? void 0 : g.call(
10984
- m,
10982
+ var b, g;
10983
+ return (g = (b = e.options).persister) == null ? void 0 : g.call(
10984
+ b,
10985
10985
  u,
10986
10986
  {
10987
10987
  client: e.client,
@@ -11008,14 +11008,14 @@ function Oc(t, { pages: e, pageParams: r }) {
11008
11008
  var s;
11009
11009
  return e.length > 0 ? (s = t.getPreviousPageParam) == null ? void 0 : s.call(t, e[0], e, r[0], r) : void 0;
11010
11010
  }
11011
- var ws, yt, He, mr, vt, Lt, Hi, Cc = (Hi = class extends ma {
11011
+ var ws, yt, He, br, vt, Lt, Hi, Cc = (Hi = class extends ba {
11012
11012
  constructor(e) {
11013
11013
  super();
11014
11014
  ne(this, vt);
11015
11015
  ne(this, ws);
11016
11016
  ne(this, yt);
11017
11017
  ne(this, He);
11018
- ne(this, mr);
11018
+ ne(this, br);
11019
11019
  W(this, ws, e.client), this.mutationId = e.mutationId, W(this, He, e.mutationCache), W(this, yt, []), this.state = e.state || Ic(), this.setOptions(e.options), this.scheduleGc();
11020
11020
  }
11021
11021
  setOptions(e) {
@@ -11043,11 +11043,11 @@ var ws, yt, He, mr, vt, Lt, Hi, Cc = (Hi = class extends ma {
11043
11043
  }
11044
11044
  continue() {
11045
11045
  var e;
11046
- return ((e = k(this, mr)) == null ? void 0 : e.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
11046
+ return ((e = k(this, br)) == null ? void 0 : e.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
11047
11047
  this.execute(this.state.variables);
11048
11048
  }
11049
11049
  async execute(e) {
11050
- var a, l, c, u, d, h, f, p, y, m, g, b, x, _, v, S, A, F;
11050
+ var a, l, c, u, d, h, f, p, y, b, g, m, x, _, v, S, A, F;
11051
11051
  const r = () => {
11052
11052
  fe(this, vt, Lt).call(this, { type: "continue" });
11053
11053
  }, s = {
@@ -11055,7 +11055,7 @@ var ws, yt, He, mr, vt, Lt, Hi, Cc = (Hi = class extends ma {
11055
11055
  meta: this.options.meta,
11056
11056
  mutationKey: this.options.mutationKey
11057
11057
  };
11058
- W(this, mr, ga({
11058
+ W(this, br, ga({
11059
11059
  fn: () => this.options.mutationFn ? this.options.mutationFn(e, s) : Promise.reject(new Error("No mutationFn found")),
11060
11060
  onFail: (P, D) => {
11061
11061
  fe(this, vt, Lt).call(this, { type: "failed", failureCount: P, error: D });
@@ -11069,7 +11069,7 @@ var ws, yt, He, mr, vt, Lt, Hi, Cc = (Hi = class extends ma {
11069
11069
  networkMode: this.options.networkMode,
11070
11070
  canRun: () => k(this, He).canRun(this)
11071
11071
  }));
11072
- const n = this.state.status === "pending", i = !k(this, mr).canStart();
11072
+ const n = this.state.status === "pending", i = !k(this, br).canStart();
11073
11073
  try {
11074
11074
  if (n)
11075
11075
  r();
@@ -11091,7 +11091,7 @@ var ws, yt, He, mr, vt, Lt, Hi, Cc = (Hi = class extends ma {
11091
11091
  isPaused: i
11092
11092
  });
11093
11093
  }
11094
- const P = await k(this, mr).start();
11094
+ const P = await k(this, br).start();
11095
11095
  return await ((u = (c = k(this, He).config).onSuccess) == null ? void 0 : u.call(
11096
11096
  c,
11097
11097
  P,
@@ -11113,7 +11113,7 @@ var ws, yt, He, mr, vt, Lt, Hi, Cc = (Hi = class extends ma {
11113
11113
  this.state.context,
11114
11114
  this,
11115
11115
  s
11116
- )), await ((m = (y = this.options).onSettled) == null ? void 0 : m.call(
11116
+ )), await ((b = (y = this.options).onSettled) == null ? void 0 : b.call(
11117
11117
  y,
11118
11118
  P,
11119
11119
  null,
@@ -11123,7 +11123,7 @@ var ws, yt, He, mr, vt, Lt, Hi, Cc = (Hi = class extends ma {
11123
11123
  )), fe(this, vt, Lt).call(this, { type: "success", data: P }), P;
11124
11124
  } catch (P) {
11125
11125
  try {
11126
- await ((b = (g = k(this, He).config).onError) == null ? void 0 : b.call(
11126
+ await ((m = (g = k(this, He).config).onError) == null ? void 0 : m.call(
11127
11127
  g,
11128
11128
  P,
11129
11129
  e,
@@ -11175,7 +11175,7 @@ var ws, yt, He, mr, vt, Lt, Hi, Cc = (Hi = class extends ma {
11175
11175
  k(this, He).runNext(this);
11176
11176
  }
11177
11177
  }
11178
- }, ws = new WeakMap(), yt = new WeakMap(), He = new WeakMap(), mr = new WeakMap(), vt = new WeakSet(), Lt = function(e) {
11178
+ }, ws = new WeakMap(), yt = new WeakMap(), He = new WeakMap(), br = new WeakMap(), vt = new WeakSet(), Lt = function(e) {
11179
11179
  const r = (s) => {
11180
11180
  switch (e.type) {
11181
11181
  case "failed":
@@ -11589,7 +11589,7 @@ var wt, Vi, Nc = (Vi = class extends ks {
11589
11589
  getQueryDefaults(t) {
11590
11590
  const e = [...k(this, Wr).values()], r = {};
11591
11591
  return e.forEach((s) => {
11592
- ms(t, s.queryKey) && Object.assign(r, s.defaultOptions);
11592
+ bs(t, s.queryKey) && Object.assign(r, s.defaultOptions);
11593
11593
  }), r;
11594
11594
  }
11595
11595
  setMutationDefaults(t, e) {
@@ -11601,7 +11601,7 @@ var wt, Vi, Nc = (Vi = class extends ks {
11601
11601
  getMutationDefaults(t) {
11602
11602
  const e = [...k(this, qr).values()], r = {};
11603
11603
  return e.forEach((s) => {
11604
- ms(t, s.mutationKey) && Object.assign(r, s.defaultOptions);
11604
+ bs(t, s.mutationKey) && Object.assign(r, s.defaultOptions);
11605
11605
  }), r;
11606
11606
  }
11607
11607
  defaultQueryOptions(t) {
@@ -11680,7 +11680,7 @@ var Dc = at.createContext($c()), Uc = () => at.useContext(Dc), Mc = (t, e, r) =>
11680
11680
  r.clearReset();
11681
11681
  });
11682
11682
  function Vc(t, e, r) {
11683
- var f, p, y, m;
11683
+ var f, p, y, b;
11684
11684
  if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
11685
11685
  throw new Error(
11686
11686
  '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'
@@ -11703,8 +11703,8 @@ function Vc(t, e, r) {
11703
11703
  if (at.useSyncExternalStore(
11704
11704
  at.useCallback(
11705
11705
  (g) => {
11706
- const b = h ? u.subscribe(qe.batchCalls(g)) : Qe;
11707
- return u.updateResult(), b;
11706
+ const m = h ? u.subscribe(qe.batchCalls(g)) : Qe;
11707
+ return u.updateResult(), m;
11708
11708
  },
11709
11709
  [u, h]
11710
11710
  ),
@@ -11722,7 +11722,7 @@ function Vc(t, e, r) {
11722
11722
  suspense: a.suspense
11723
11723
  }))
11724
11724
  throw d.error;
11725
- if ((m = (y = i.getDefaultOptions().queries) == null ? void 0 : y._experimental_afterQuery) == null || m.call(
11725
+ if ((b = (y = i.getDefaultOptions().queries) == null ? void 0 : y._experimental_afterQuery) == null || b.call(
11726
11726
  y,
11727
11727
  a,
11728
11728
  d
@@ -11750,7 +11750,7 @@ function Jc({
11750
11750
  callbacks: r,
11751
11751
  enabled: s = !0
11752
11752
  }) {
11753
- const n = ee(Gc()), i = ee(!1), a = V(
11753
+ const n = te(Gc()), i = te(!1), a = V(
11754
11754
  (_, v) => {
11755
11755
  if (!(!(t != null && t.measurementId) || typeof window > "u") && window.gtag) {
11756
11756
  const S = {
@@ -11847,7 +11847,7 @@ function Jc({
11847
11847
  });
11848
11848
  },
11849
11849
  [l]
11850
- ), m = V(
11850
+ ), b = V(
11851
11851
  (_, v) => {
11852
11852
  l("bob_checkout_started", {
11853
11853
  cart_value: _,
@@ -11864,7 +11864,7 @@ function Jc({
11864
11864
  });
11865
11865
  },
11866
11866
  [l]
11867
- ), b = V(
11867
+ ), m = V(
11868
11868
  (_) => {
11869
11869
  l("bob_speech_failed", {
11870
11870
  text_length: _
@@ -11892,9 +11892,9 @@ function Jc({
11892
11892
  trackProductClicked: f,
11893
11893
  trackProductViewed: p,
11894
11894
  trackAddToCart: y,
11895
- trackCheckoutStarted: m,
11895
+ trackCheckoutStarted: b,
11896
11896
  trackSpeechPlayed: g,
11897
- trackSpeechFailed: b,
11897
+ trackSpeechFailed: m,
11898
11898
  trackError: x
11899
11899
  };
11900
11900
  }
@@ -11925,16 +11925,16 @@ function _a({
11925
11925
  he(() => {
11926
11926
  console.log(`[BobWidget] v${Gt} initialized`), console.log(`[BobWidget] QueryClient: ${f ? "external (shared)" : "internal"}`), console.log(`[BobWidget] Analytics: ${l ? "enabled" : "disabled"}`), a != null && a.measurementId && console.log(`[BobWidget] GA4: ${a.measurementId}`);
11927
11927
  }, [f, l, a == null ? void 0 : a.measurementId]);
11928
- const p = Tt(() => vn(e.supabaseUrl, e.supabaseKey), [e.supabaseUrl, e.supabaseKey]), [y, m] = br.useState(s);
11929
- br.useEffect(() => {
11930
- m(s);
11928
+ const p = Tt(() => vn(e.supabaseUrl, e.supabaseKey), [e.supabaseUrl, e.supabaseKey]), [y, b] = mr.useState(s);
11929
+ mr.useEffect(() => {
11930
+ b(s);
11931
11931
  }, [s]);
11932
- const g = br.useCallback((x) => {
11933
- m((_) => ({
11932
+ const g = mr.useCallback((x) => {
11933
+ b((_) => ({
11934
11934
  ..._,
11935
11935
  ...x
11936
11936
  }));
11937
- }, []), b = Tt(
11937
+ }, []), m = Tt(
11938
11938
  () => ({
11939
11939
  bobSupabase: p,
11940
11940
  bobConfig: e,
@@ -11949,7 +11949,7 @@ function _a({
11949
11949
  }),
11950
11950
  [p, e, r, y, n, g, a, l, c, u]
11951
11951
  );
11952
- return /* @__PURE__ */ o.jsx(Bc, { client: h, children: /* @__PURE__ */ o.jsx(Vs.Provider, { value: b, children: t }) });
11952
+ return /* @__PURE__ */ o.jsx(Bc, { client: h, children: /* @__PURE__ */ o.jsx(Vs.Provider, { value: m, children: t }) });
11953
11953
  }
11954
11954
  function Jt() {
11955
11955
  const t = Ln(Vs);
@@ -11998,15 +11998,15 @@ const Qc = 15e3, Yc = {
11998
11998
  onEnd: e,
11999
11999
  onFailed: r
12000
12000
  } = {}) => {
12001
- const { bobConfig: s, bobSupabase: n } = Jt(), [i, a] = H(!1), l = ee(null), c = ee(null), u = ee(!1), d = ee([]), h = ee(!1), f = ee(!1), p = ee(null), y = ee(null), m = ee(t), g = ee(e), b = ee(r);
12001
+ const { bobConfig: s, bobSupabase: n } = Jt(), [i, a] = H(!1), l = te(null), c = te(null), u = te(!1), d = te([]), h = te(!1), f = te(!1), p = te(null), y = te(null), b = te(t), g = te(e), m = te(r);
12002
12002
  he(() => {
12003
- m.current = t, g.current = e, b.current = r;
12003
+ b.current = t, g.current = e, m.current = r;
12004
12004
  }, [t, e, r]);
12005
12005
  const x = V(() => {
12006
12006
  c.current && (clearTimeout(c.current), c.current = null);
12007
12007
  }, []), _ = V(() => {
12008
12008
  var j;
12009
- u.current || (u.current = !0, console.log("[BobWidget TTS] Fallback: triggering onStart without audio"), (j = m.current) == null || j.call(m));
12009
+ u.current || (u.current = !0, console.log("[BobWidget TTS] Fallback: triggering onStart without audio"), (j = b.current) == null || j.call(b));
12010
12010
  }, []), v = V(async (j) => {
12011
12011
  if (ts.has(j)) {
12012
12012
  const R = ts.get(j);
@@ -12029,7 +12029,7 @@ const Qc = 15e3, Yc = {
12029
12029
  }
12030
12030
  return null;
12031
12031
  }, [v]), A = V(async () => {
12032
- var K, se, re;
12032
+ var K, X, se;
12033
12033
  if (h.current || d.current.length === 0)
12034
12034
  return;
12035
12035
  h.current = !0;
@@ -12041,7 +12041,7 @@ const Qc = 15e3, Yc = {
12041
12041
  const { text: R, isGreeting: N } = j;
12042
12042
  N && (f.current = !0), u.current = !1, x(), l.current && (l.current.pause(), l.current = null), c.current = setTimeout(() => {
12043
12043
  var L, U;
12044
- console.warn("[BobWidget TTS] Timeout - triggering fallback callbacks"), _(), a(!1), f.current = !1, (L = g.current) == null || L.call(g), (U = b.current) == null || U.call(b), l.current = null, h.current = !1, A();
12044
+ console.warn("[BobWidget TTS] Timeout - triggering fallback callbacks"), _(), a(!1), f.current = !1, (L = g.current) == null || L.call(g), (U = m.current) == null || U.call(m), l.current = null, h.current = !1, A();
12045
12045
  }, Qc);
12046
12046
  try {
12047
12047
  let L = null;
@@ -12049,7 +12049,7 @@ const Qc = 15e3, Yc = {
12049
12049
  console.log("[BobWidget TTS] Using pre-recorded audio (fast path)");
12050
12050
  else {
12051
12051
  console.log("[BobWidget TTS] No pre-recorded clip, using ElevenLabs TTS");
12052
- const Z = Xc(R), ce = await fetch(
12052
+ const Q = Xc(R), ce = await fetch(
12053
12053
  `${s.supabaseUrl}/functions/v1/bob-tts-elevenlabs`,
12054
12054
  {
12055
12055
  method: "POST",
@@ -12057,34 +12057,34 @@ const Qc = 15e3, Yc = {
12057
12057
  "Content-Type": "application/json",
12058
12058
  Authorization: `Bearer ${s.supabaseKey}`
12059
12059
  },
12060
- body: JSON.stringify({ text: Z })
12060
+ body: JSON.stringify({ text: Q })
12061
12061
  }
12062
12062
  );
12063
12063
  if (!ce.ok) {
12064
12064
  const C = await ce.json().catch(() => ({}));
12065
12065
  throw console.error("[BobWidget TTS] Request failed:", C), new Error("TTS request failed");
12066
12066
  }
12067
- const Y = await ce.blob();
12068
- L = URL.createObjectURL(Y);
12067
+ const Z = await ce.blob();
12068
+ L = URL.createObjectURL(Z);
12069
12069
  }
12070
12070
  const U = new Audio(L);
12071
12071
  l.current = U, U.onplay = () => {
12072
- var Z;
12073
- x(), p.current = null, u.current || (u.current = !0, a(!0), console.log("[BobWidget TTS] Audio playing, triggering onStart (animation: TALKING)"), (Z = m.current) == null || Z.call(m));
12072
+ var Q;
12073
+ x(), p.current = null, u.current || (u.current = !0, a(!0), console.log("[BobWidget TTS] Audio playing, triggering onStart (animation: TALKING)"), (Q = b.current) == null || Q.call(b));
12074
12074
  }, U.onended = () => {
12075
- var Z;
12076
- x(), a(!1), f.current = !1, console.log("[BobWidget TTS] Audio ended, triggering onEnd (animation: COMPLETE/IDLE)"), (Z = g.current) == null || Z.call(g), l.current = null, h.current = !1, A();
12077
- }, U.onerror = (Z) => {
12078
- var ce, Y;
12079
- x(), console.warn("[BobWidget TTS] Audio playback error:", Z), _(), a(!1), f.current = !1, (ce = g.current) == null || ce.call(g), (Y = b.current) == null || Y.call(b), l.current = null, h.current = !1, A();
12075
+ var Q;
12076
+ x(), a(!1), f.current = !1, console.log("[BobWidget TTS] Audio ended, triggering onEnd (animation: COMPLETE/IDLE)"), (Q = g.current) == null || Q.call(g), l.current = null, h.current = !1, A();
12077
+ }, U.onerror = (Q) => {
12078
+ var ce, Z;
12079
+ x(), console.warn("[BobWidget TTS] Audio playback error:", Q), _(), a(!1), f.current = !1, (ce = g.current) == null || ce.call(g), (Z = m.current) == null || Z.call(m), l.current = null, h.current = !1, A();
12080
12080
  };
12081
12081
  try {
12082
12082
  await U.play();
12083
- } catch (Z) {
12084
- console.warn("[BobWidget TTS] Audio play() failed (autoplay policy):", Z), x(), N && (p.current = R, console.log("[BobWidget TTS] Greeting stored for retry on user interaction")), _(), a(!1), f.current = !1, (K = g.current) == null || K.call(g), h.current = !1, A();
12083
+ } catch (Q) {
12084
+ console.warn("[BobWidget TTS] Audio play() failed (autoplay policy):", Q), x(), N && (p.current = R, console.log("[BobWidget TTS] Greeting stored for retry on user interaction")), _(), a(!1), f.current = !1, (K = g.current) == null || K.call(g), h.current = !1, A();
12085
12085
  }
12086
12086
  } catch (L) {
12087
- x(), console.error("[BobWidget TTS] Speech synthesis error:", L), _(), a(!1), f.current = !1, (se = g.current) == null || se.call(g), (re = b.current) == null || re.call(b), h.current = !1, A();
12087
+ x(), console.error("[BobWidget TTS] Speech synthesis error:", L), _(), a(!1), f.current = !1, (X = g.current) == null || X.call(g), (se = m.current) == null || se.call(m), h.current = !1, A();
12088
12088
  }
12089
12089
  }, [s.supabaseUrl, s.supabaseKey, x, _, S]), F = V((j, R = !1) => {
12090
12090
  if (j.trim()) {
@@ -12288,54 +12288,54 @@ const Fn = (t) => {
12288
12288
  onHighlightPart: f,
12289
12289
  onHighlightProduct: p,
12290
12290
  onNoPartsFound: y,
12291
- onAutoFetchComplete: m,
12291
+ onAutoFetchComplete: b,
12292
12292
  onVariantSelectionRequired: g
12293
12293
  }) => {
12294
12294
  var Gr, Jr, Qr, Es;
12295
- const { bobConfig: b, hostApiConfig: x, hostContext: _, callbacks: v, ga4Config: S, analyticsEnabled: A } = Jt(), F = Jc({
12295
+ const { bobConfig: m, hostApiConfig: x, hostContext: _, callbacks: v, ga4Config: S, analyticsEnabled: A } = Jt(), F = Jc({
12296
12296
  ga4Config: S,
12297
12297
  hostContext: _,
12298
12298
  callbacks: v,
12299
12299
  enabled: A
12300
- }), { isReturningUser: P } = tu(), [D, E] = H([]), [T, j] = H(""), [R, N] = H(!1), [K, se] = H(!1), [re, L] = H(null), U = ee(null), Z = ee(!1), ce = ee(!1), Y = ee(""), C = ee(!1), $ = ee(null);
12301
- ee(null);
12302
- const G = ee({
12300
+ }), { isReturningUser: P } = tu(), [D, E] = H([]), [T, j] = H(""), [R, N] = H(!1), [K, X] = H(!1), [se, L] = H(null), U = te(null), Q = te(!1), ce = te(!1), Z = te(""), C = te(!1), $ = te(null);
12301
+ te(null);
12302
+ const G = te({
12303
12303
  source: "none",
12304
12304
  isPlaying: !1,
12305
12305
  hasCannedAudio: !1,
12306
12306
  cannedUrl: null,
12307
12307
  currentAudio: null,
12308
12308
  searchingQueue: []
12309
- }), Q = ee([]), Ee = ee("AWAITING_REGO"), Oe = () => {
12309
+ }), Y = te([]), Ee = te("AWAITING_REGO"), Oe = () => {
12310
12310
  const q = G.current;
12311
12311
  if (q.currentAudio) {
12312
12312
  try {
12313
12313
  q.currentAudio.pause(), q.currentAudio.currentTime = 0;
12314
- } catch (me) {
12315
- console.warn("[BobWidget] Error stopping audio:", me);
12314
+ } catch (be) {
12315
+ console.warn("[BobWidget] Error stopping audio:", be);
12316
12316
  }
12317
12317
  q.currentAudio = null;
12318
12318
  }
12319
12319
  q.isPlaying = !1, q.source = "none", q.searchingQueue = [], Xe();
12320
- }, Pe = (q, me, xe) => {
12321
- const be = G.current;
12322
- if (be.isPlaying) {
12323
- if (me === "canned" || me === "searching" && be.source === "tts")
12320
+ }, Pe = (q, be, xe) => {
12321
+ const me = G.current;
12322
+ if (me.isPlaying) {
12323
+ if (be === "canned" || be === "searching" && me.source === "tts")
12324
12324
  Oe();
12325
- else if (be.source === "canned") {
12325
+ else if (me.source === "canned") {
12326
12326
  console.log("[BobWidget Audio] Skipping lower priority audio while canned is playing");
12327
12327
  return;
12328
12328
  }
12329
12329
  }
12330
12330
  const Ge = new Audio(q);
12331
- be.currentAudio = Ge, be.source = me, be.isPlaying = !0, Ge.onplay = () => {
12332
- console.log(`[BobWidget Audio] ${me} STARTED:`, q.split("/").pop()), e || te(r);
12331
+ me.currentAudio = Ge, me.source = be, me.isPlaying = !0, Ge.onplay = () => {
12332
+ console.log(`[BobWidget Audio] ${be} STARTED:`, q.split("/").pop()), e || re(r);
12333
12333
  }, Ge.onended = () => {
12334
- console.log(`[BobWidget Audio] ${me} ENDED`), be.currentAudio = null, be.isPlaying = !1, be.source = "none", xe == null || xe();
12334
+ console.log(`[BobWidget Audio] ${be} ENDED`), me.currentAudio = null, me.isPlaying = !1, me.source = "none", xe == null || xe();
12335
12335
  }, Ge.onerror = () => {
12336
- console.warn(`[BobWidget Audio] ${me} FAILED:`, q), be.currentAudio = null, be.isPlaying = !1, be.source = "none", xe == null || xe();
12336
+ console.warn(`[BobWidget Audio] ${be} FAILED:`, q), me.currentAudio = null, me.isPlaying = !1, me.source = "none", xe == null || xe();
12337
12337
  }, Ge.play().catch((Qt) => {
12338
- console.warn(`[BobWidget Audio] ${me} autoplay blocked:`, Qt), be.currentAudio = null, be.isPlaying = !1, be.source = "none", xe == null || xe();
12338
+ console.warn(`[BobWidget Audio] ${be} autoplay blocked:`, Qt), me.currentAudio = null, me.isPlaying = !1, me.source = "none", xe == null || xe();
12339
12339
  });
12340
12340
  }, $e = () => {
12341
12341
  const q = G.current;
@@ -12344,39 +12344,39 @@ const Fn = (t) => {
12344
12344
  return;
12345
12345
  }
12346
12346
  if (q.searchingQueue.length === 0) {
12347
- !e && q.source === "searching" && te(s);
12347
+ !e && q.source === "searching" && re(s);
12348
12348
  return;
12349
12349
  }
12350
- const me = q.searchingQueue.shift();
12351
- Pe(me, "searching", () => {
12350
+ const be = q.searchingQueue.shift();
12351
+ Pe(be, "searching", () => {
12352
12352
  $e();
12353
12353
  });
12354
12354
  }, Ye = () => {
12355
12355
  $.current && (clearTimeout($.current), $.current = null);
12356
12356
  }, { speak: Ke, stop: Xe, isSpeaking: ot, retryPendingGreeting: O } = Zc({
12357
12357
  onStart: () => {
12358
- Ye(), C.current = !0, console.log("[BobWidget STATE] Speech STARTED - transitioning to TALK state"), F.trackSpeechPlayed(Y.current.length), h == null || h(), e || (console.log("[BobWidget STATE] Setting state to:", r), te(r));
12358
+ Ye(), C.current = !0, console.log("[BobWidget STATE] Speech STARTED - transitioning to TALK state"), F.trackSpeechPlayed(Z.current.length), h == null || h(), e || (console.log("[BobWidget STATE] Setting state to:", r), re(r));
12359
12359
  },
12360
12360
  onEnd: () => {
12361
12361
  Ye(), console.log("[BobWidget STATE] Speech ENDED - transitioning out of TALK state");
12362
12362
  const q = nn.some(
12363
- (me) => Y.current.toLowerCase().includes(me.toLowerCase())
12363
+ (be) => Z.current.toLowerCase().includes(be.toLowerCase())
12364
12364
  );
12365
- e || (q && u ? (console.log("[BobWidget STATE] Has products - calling onShowingProduct"), u()) : c ? (console.log("[BobWidget STATE] Calling onStreamComplete"), c()) : (console.log("[BobWidget STATE] Setting state to:", n), te(n), setTimeout(() => {
12366
- console.log("[BobWidget STATE] Post-complete transition to:", a), te(a);
12365
+ e || (q && u ? (console.log("[BobWidget STATE] Has products - calling onShowingProduct"), u()) : c ? (console.log("[BobWidget STATE] Calling onStreamComplete"), c()) : (console.log("[BobWidget STATE] Setting state to:", n), re(n), setTimeout(() => {
12366
+ console.log("[BobWidget STATE] Post-complete transition to:", a), re(a);
12367
12367
  }, 2e3)));
12368
12368
  },
12369
12369
  onFailed: () => {
12370
- console.warn("[BobWidget] Speech synthesis failed - fallback triggered"), F.trackSpeechFailed(Y.current.length);
12370
+ console.warn("[BobWidget] Speech synthesis failed - fallback triggered"), F.trackSpeechFailed(Z.current.length);
12371
12371
  }
12372
12372
  });
12373
12373
  he(() => {
12374
12374
  var q;
12375
12375
  (q = U.current) == null || q.scrollIntoView({ behavior: "smooth" });
12376
12376
  }, [D]), he(() => {
12377
- var me, xe;
12378
- const q = (me = _.vehicle) == null ? void 0 : me.selectedVehicle;
12379
- q && !re && (console.log("[BobWidget] Setting vehicle from host context:", q), L(q), (xe = v.onVehicleIdentified) == null || xe.call(v, q), F.trackVehicleIdentified({
12377
+ var be, xe;
12378
+ const q = (be = _.vehicle) == null ? void 0 : be.selectedVehicle;
12379
+ q && !se && (console.log("[BobWidget] Setting vehicle from host context:", q), L(q), (xe = v.onVehicleIdentified) == null || xe.call(v, q), F.trackVehicleIdentified({
12380
12380
  make: q.make,
12381
12381
  model: q.model,
12382
12382
  year: q.year,
@@ -12386,9 +12386,9 @@ const Fn = (t) => {
12386
12386
  var q;
12387
12387
  if (D.length === 0 && !ce.current) {
12388
12388
  ce.current = !0;
12389
- const me = (q = _.vehicle) == null ? void 0 : q.selectedVehicle;
12389
+ const be = (q = _.vehicle) == null ? void 0 : q.selectedVehicle;
12390
12390
  let xe;
12391
- P ? (xe = "Ah hey... you again! What you after this time?", console.log("[BobWidget] Using returning user greeting")) : me ? xe = `G'day! Saw you've got the ${`${me.year} ${me.make} ${me.model}`} - choice wagon! What can I help you find for it today?` : xe = "G'day! Bob from CARFIX here. How can I help ya today?", E([{ role: "assistant", content: xe }]), K || setTimeout(() => {
12391
+ P ? (xe = "Ah hey... you again! What you after this time?", console.log("[BobWidget] Using returning user greeting")) : be ? xe = `G'day! Saw you've got the ${`${be.year} ${be.make} ${be.model}`} - choice wagon! What can I help you find for it today?` : xe = "G'day! Bob from CARFIX here. How can I help ya today?", E([{ role: "assistant", content: xe }]), K || setTimeout(() => {
12392
12392
  console.log("[BobWidget] Speaking initial greeting (priority)"), Ke(xe, !0);
12393
12393
  }, 500);
12394
12394
  }
@@ -12402,27 +12402,27 @@ const Fn = (t) => {
12402
12402
  }, [O]), he(() => {
12403
12403
  var Yt, Xt;
12404
12404
  const q = (Yt = _.vehicle) == null ? void 0 : Yt.selectedVehicle;
12405
- if (!q || Z.current) return;
12406
- const me = q.vehicle_id ?? q.id, xe = Number.parseInt(String(me), 10);
12405
+ if (!q || Q.current) return;
12406
+ const be = q.vehicle_id ?? q.id, xe = Number.parseInt(String(be), 10);
12407
12407
  if (!Number.isFinite(xe)) {
12408
12408
  console.warn("[BobWidget] Vehicle has invalid vehicle_id, cannot auto-fetch:", q);
12409
12409
  return;
12410
12410
  }
12411
- Z.current = !0;
12412
- const be = { ...q, vehicle_id: String(xe) }, Ge = (Xt = _.user) == null ? void 0 : Xt.email;
12411
+ Q.current = !0;
12412
+ const me = { ...q, vehicle_id: String(xe) }, Ge = (Xt = _.user) == null ? void 0 : Xt.email;
12413
12413
  (async () => {
12414
12414
  var xt, At;
12415
- const vr = `${b.supabaseUrl}/functions/v1/bob-chat`;
12415
+ const vr = `${m.supabaseUrl}/functions/v1/bob-chat`;
12416
12416
  try {
12417
12417
  const ze = await fetch(vr, {
12418
12418
  method: "POST",
12419
12419
  headers: {
12420
12420
  "Content-Type": "application/json",
12421
- Authorization: `Bearer ${b.supabaseKey}`
12421
+ Authorization: `Bearer ${m.supabaseKey}`
12422
12422
  },
12423
12423
  body: JSON.stringify({
12424
12424
  messages: [],
12425
- vehicleContext: be,
12425
+ vehicleContext: me,
12426
12426
  customerEmail: Ge,
12427
12427
  autoFetchParts: !0,
12428
12428
  hostConfig: x,
@@ -12456,28 +12456,28 @@ const Fn = (t) => {
12456
12456
  }
12457
12457
  }
12458
12458
  }
12459
- m == null || m();
12459
+ b == null || b();
12460
12460
  } catch (ze) {
12461
12461
  console.error("[BobWidget] Auto-fetch error:", ze);
12462
12462
  }
12463
12463
  })();
12464
12464
  }, [(Qr = _.vehicle) == null ? void 0 : Qr.selectedVehicle, (Es = _.user) == null ? void 0 : Es.email]);
12465
- const te = (q) => {
12465
+ const re = (q) => {
12466
12466
  try {
12467
12467
  t(q);
12468
12468
  } catch {
12469
12469
  console.warn(`[BobWidget] State "${q}" not available`);
12470
12470
  }
12471
12471
  }, Ne = async (q) => {
12472
- var be, Ge, Qt, Yt, Xt, vr, xt, At, ze, Ot, Ct, lt, wr, Zt, It, Ze, Pt;
12473
- const me = `${b.supabaseUrl}/functions/v1/bob-chat`, xe = (be = _.user) == null ? void 0 : be.email;
12474
- if (re && !K) {
12472
+ var me, Ge, Qt, Yt, Xt, vr, xt, At, ze, Ot, Ct, lt, wr, Zt, It, Ze, Pt;
12473
+ const be = `${m.supabaseUrl}/functions/v1/bob-chat`, xe = (me = _.user) == null ? void 0 : me.email;
12474
+ if (se && !K) {
12475
12475
  const Te = q.content.toLowerCase();
12476
12476
  if (nn.some((gt) => Te.includes(gt.toLowerCase()))) {
12477
12477
  console.log("[useBobChat] 🎵 Playing optimistic searching audio");
12478
12478
  const gt = G.current;
12479
12479
  if (!gt.hasCannedAudio && gt.source !== "canned") {
12480
- const xr = `${b.supabaseUrl}/storage/v1/object/public/bob-audio/parts_searching.mp3`;
12480
+ const xr = `${m.supabaseUrl}/storage/v1/object/public/bob-audio/parts_searching.mp3`;
12481
12481
  gt.searchingQueue.push(xr), $e();
12482
12482
  }
12483
12483
  }
@@ -12488,15 +12488,15 @@ const Fn = (t) => {
12488
12488
  hostConfig: x,
12489
12489
  hostContext: _
12490
12490
  };
12491
- re && (Te.vehicleContext = re), xe && (Te.customerEmail = xe), console.log(
12491
+ se && (Te.vehicleContext = se), xe && (Te.customerEmail = xe), console.log(
12492
12492
  "[useBobChat DEBUG] vehicleCandidatesRef.current:",
12493
- JSON.stringify((Ge = Q.current) == null ? void 0 : Ge.slice(0, 2))
12494
- ), console.log("[useBobChat DEBUG] vehicleCandidatesRef.current.length:", (Qt = Q.current) == null ? void 0 : Qt.length), console.log("[useBobChat DEBUG] conversationStateRef.current:", Ee.current), Q.current && Q.current.length > 0 ? (Te.vehicleCandidates = Q.current, console.log("[useBobChat] ✅ Including", Q.current.length, "vehicle candidates in request")) : console.log("[useBobChat] ⚠️ No vehicle candidates to include - ref is empty");
12495
- const st = await fetch(me, {
12493
+ JSON.stringify((Ge = Y.current) == null ? void 0 : Ge.slice(0, 2))
12494
+ ), console.log("[useBobChat DEBUG] vehicleCandidatesRef.current.length:", (Qt = Y.current) == null ? void 0 : Qt.length), console.log("[useBobChat DEBUG] conversationStateRef.current:", Ee.current), Y.current && Y.current.length > 0 ? (Te.vehicleCandidates = Y.current, console.log("[useBobChat] ✅ Including", Y.current.length, "vehicle candidates in request")) : console.log("[useBobChat] ⚠️ No vehicle candidates to include - ref is empty");
12495
+ const st = await fetch(be, {
12496
12496
  method: "POST",
12497
12497
  headers: {
12498
12498
  "Content-Type": "application/json",
12499
- Authorization: `Bearer ${b.supabaseKey}`
12499
+ Authorization: `Bearer ${m.supabaseKey}`
12500
12500
  },
12501
12501
  body: JSON.stringify(Te)
12502
12502
  });
@@ -12531,7 +12531,7 @@ const Fn = (t) => {
12531
12531
  try {
12532
12532
  const B = JSON.parse(De);
12533
12533
  if (B.type === "conversation_state") {
12534
- console.log("[useBobChat] 🔄 conversation_state event received:", B.state), Ee.current = B.state, B.candidates && Array.isArray(B.candidates) ? (Q.current = B.candidates, console.log("[useBobChat] ✅ Stored", B.candidates.length, "vehicle candidates from state event"), console.log("[useBobChat] First candidate:", JSON.stringify(B.candidates[0]))) : console.log("[useBobChat] ⚠️ conversation_state had no candidates array");
12534
+ console.log("[useBobChat] 🔄 conversation_state event received:", B.state), Ee.current = B.state, B.candidates && Array.isArray(B.candidates) ? (Y.current = B.candidates, console.log("[useBobChat] ✅ Stored", B.candidates.length, "vehicle candidates from state event"), console.log("[useBobChat] First candidate:", JSON.stringify(B.candidates[0]))) : console.log("[useBobChat] ⚠️ conversation_state had no candidates array");
12535
12535
  continue;
12536
12536
  }
12537
12537
  if (B.type === "variant_selection_required") {
@@ -12544,7 +12544,7 @@ const Fn = (t) => {
12544
12544
  continue;
12545
12545
  }
12546
12546
  if (B.type === "vehicle_identified" && B.vehicle) {
12547
- L(B.vehicle), Q.current = [], Ee.current = "VEHICLE_CONFIRMED", (vr = v.onVehicleIdentified) == null || vr.call(v, B.vehicle), F.trackVehicleIdentified({
12547
+ L(B.vehicle), Y.current = [], Ee.current = "VEHICLE_CONFIRMED", (vr = v.onVehicleIdentified) == null || vr.call(v, B.vehicle), F.trackVehicleIdentified({
12548
12548
  make: B.vehicle.make,
12549
12549
  model: B.vehicle.model,
12550
12550
  year: B.vehicle.year,
@@ -12553,7 +12553,7 @@ const Fn = (t) => {
12553
12553
  continue;
12554
12554
  }
12555
12555
  if (B.type === "vehicle_candidates_found" && B.candidates) {
12556
- console.log("[useBobChat] 📦 vehicle_candidates_found event received:", B.candidates.length, "candidates"), Q.current = B.candidates, console.log("[useBobChat] ✅ Candidates stored in ref. First:", JSON.stringify(B.candidates[0]));
12556
+ console.log("[useBobChat] 📦 vehicle_candidates_found event received:", B.candidates.length, "candidates"), Y.current = B.candidates, console.log("[useBobChat] ✅ Candidates stored in ref. First:", JSON.stringify(B.candidates[0]));
12557
12557
  continue;
12558
12558
  }
12559
12559
  if (B.type === "service_packages_found" && B.packages) {
@@ -12563,7 +12563,7 @@ const Fn = (t) => {
12563
12563
  if (B.type === "parts_found" && B.parts) {
12564
12564
  console.log("[useBobChat] Received parts_found event:", B.parts.length, "parts"), (At = v.onPartsFound) == null || At.call(v, B.parts), F.trackPartsViewed(
12565
12565
  Array.isArray(B.parts) ? B.parts.length : 0,
12566
- (ze = re == null ? void 0 : re.vehicle_id) == null ? void 0 : ze.toString()
12566
+ (ze = se == null ? void 0 : se.vehicle_id) == null ? void 0 : ze.toString()
12567
12567
  );
12568
12568
  continue;
12569
12569
  }
@@ -12623,7 +12623,7 @@ const Fn = (t) => {
12623
12623
  }
12624
12624
  }
12625
12625
  let Yr = Nt.replace(/\[VEHICLE_CONFIRMED:\{[\s\S]*?\}\]/g, "");
12626
- Yr = Fn(Yr), Y.current = Yr;
12626
+ Yr = Fn(Yr), Z.current = Yr;
12627
12627
  const w = nn.some(
12628
12628
  (ue) => Nt.toLowerCase().includes(ue.toLowerCase())
12629
12629
  ), I = Nt.toLowerCase();
@@ -12638,43 +12638,43 @@ const Fn = (t) => {
12638
12638
  const [, ue, ge] = M;
12639
12639
  p == null || p({ brand: ue, price: parseFloat(ge) });
12640
12640
  }
12641
- const X = G.current;
12642
- if (!K && Y.current.trim()) {
12643
- if (C.current = !1, Ye(), X.hasCannedAudio && X.cannedUrl)
12644
- console.log("[BobWidget] Playing canned audio (priority):", X.cannedUrl), Oe(), Pe(X.cannedUrl, "canned", () => {
12645
- X.hasCannedAudio = !1, X.cannedUrl = null, Ye(), e || (w && u ? u() : c ? c() : (te(n), setTimeout(() => te(a), 3e3)));
12641
+ const ee = G.current;
12642
+ if (!K && Z.current.trim()) {
12643
+ if (C.current = !1, Ye(), ee.hasCannedAudio && ee.cannedUrl)
12644
+ console.log("[BobWidget] Playing canned audio (priority):", ee.cannedUrl), Oe(), Pe(ee.cannedUrl, "canned", () => {
12645
+ ee.hasCannedAudio = !1, ee.cannedUrl = null, Ye(), e || (w && u ? u() : c ? c() : (re(n), setTimeout(() => re(a), 3e3)));
12646
12646
  }), C.current = !0, h == null || h();
12647
- else if (X.isPlaying)
12648
- console.log("[BobWidget] Skipping TTS - audio already playing:", X.source);
12647
+ else if (ee.isPlaying)
12648
+ console.log("[BobWidget] Skipping TTS - audio already playing:", ee.source);
12649
12649
  else {
12650
- const ue = ru(Y.current);
12650
+ const ue = ru(Z.current);
12651
12651
  console.log("[BobWidget] Playing TTS (no canned audio)"), Ke(ue);
12652
12652
  }
12653
12653
  $.current = setTimeout(() => {
12654
- C.current || (console.warn("[BobWidget] Speech fallback after 5s"), h == null || h(), e || (w && u ? u() : c ? c() : (te(n), setTimeout(() => te(a), 3e3))));
12654
+ C.current || (console.warn("[BobWidget] Speech fallback after 5s"), h == null || h(), e || (w && u ? u() : c ? c() : (re(n), setTimeout(() => re(a), 3e3))));
12655
12655
  }, 5e3);
12656
12656
  } else
12657
- h == null || h(), e || (w && u ? u() : c ? c() : (te(n), setTimeout(() => te(a), 3e3)));
12657
+ h == null || h(), e || (w && u ? u() : c ? c() : (re(n), setTimeout(() => re(a), 3e3)));
12658
12658
  } catch (Te) {
12659
12659
  console.error("[BobWidget] Chat error:", Te);
12660
12660
  const st = Te instanceof Error ? Te : new Error("Unknown error");
12661
12661
  (Pt = v.onError) == null || Pt.call(v, st), F.trackError(
12662
12662
  st.name || "ChatError",
12663
12663
  st.message || "Unknown chat error"
12664
- ), e || te(i);
12664
+ ), e || re(i);
12665
12665
  }
12666
12666
  }, ke = async () => {
12667
12667
  if (!T.trim() || R) return;
12668
12668
  O(), Xe();
12669
12669
  const q = { role: "user", content: T };
12670
- E((be) => [...be, q]), j(""), F.trackMessageSent(T.length, !!re);
12671
- const me = T.toLowerCase();
12672
- if (su.some((be) => me.includes(be))) {
12673
- const be = `G'day mate! I'm running Bob v${Gt} - she's running sweet as! Anything else I can help ya with?`;
12674
- E((Ge) => [...Ge, { role: "assistant", content: be }]), K || Ke(be);
12670
+ E((me) => [...me, q]), j(""), F.trackMessageSent(T.length, !!se);
12671
+ const be = T.toLowerCase();
12672
+ if (su.some((me) => be.includes(me))) {
12673
+ const me = `G'day mate! I'm running Bob v${Gt} - she's running sweet as! Anything else I can help ya with?`;
12674
+ E((Ge) => [...Ge, { role: "assistant", content: me }]), K || Ke(me);
12675
12675
  return;
12676
12676
  }
12677
- N(!0), console.log("[BobWidget STATE] User sent message - switching to RESEARCH state:", s), d == null || d(), e || te(s), await Ne(q), N(!1);
12677
+ N(!0), console.log("[BobWidget STATE] User sent message - switching to RESEARCH state:", s), d == null || d(), e || re(s), await Ne(q), N(!1);
12678
12678
  };
12679
12679
  return {
12680
12680
  messages: D,
@@ -12699,10 +12699,10 @@ const Fn = (t) => {
12699
12699
  },
12700
12700
  isMuted: K,
12701
12701
  toggleMute: () => {
12702
- se((q) => !q), K || Xe();
12702
+ X((q) => !q), K || Xe();
12703
12703
  },
12704
12704
  isSpeaking: ot,
12705
- identifiedVehicle: re,
12705
+ identifiedVehicle: se,
12706
12706
  clearVehicle: () => {
12707
12707
  L(null);
12708
12708
  }
@@ -12762,20 +12762,20 @@ const Fn = (t) => {
12762
12762
  return !h.some((A) => S.includes(A));
12763
12763
  });
12764
12764
  p.length > 0 && console.warn(`[BobAnimation] ⚠️ Missing critical states: ${p.join(", ")}`);
12765
- const y = new Set(h), m = (u || []).filter((v) => y.has(v.animation_state));
12766
- console.log(`[BobAnimation] Loaded ${m.length} animation frames`);
12767
- const { data: g, error: b } = await r.storage.from("bob-images").list();
12768
- if (b) throw b;
12765
+ const y = new Set(h), b = (u || []).filter((v) => y.has(v.animation_state));
12766
+ console.log(`[BobAnimation] Loaded ${b.length} animation frames`);
12767
+ const { data: g, error: m } = await r.storage.from("bob-images").list();
12768
+ if (m) throw m;
12769
12769
  const x = (g || []).map((v) => {
12770
12770
  const { data: S } = r.storage.from("bob-images").getPublicUrl(v.name);
12771
12771
  return S.publicUrl;
12772
12772
  });
12773
- return m.forEach((v) => {
12773
+ return b.forEach((v) => {
12774
12774
  const S = new Image();
12775
12775
  S.src = v.image_url;
12776
12776
  }), {
12777
12777
  states: l || [],
12778
- configs: m,
12778
+ configs: b,
12779
12779
  uploadedImages: x,
12780
12780
  looks: s || [],
12781
12781
  activeLookId: a
@@ -12785,8 +12785,8 @@ const Fn = (t) => {
12785
12785
  gcTime: 5 * 60 * 1e3
12786
12786
  });
12787
12787
  }, lu = (t = {}) => {
12788
- const { isSpeaking: e = !1 } = t, [r, s] = H(""), [n, i] = H(0), [a, l] = H(400), [c, u] = H(!1), d = ee(null), h = ee(0), f = ee(e), p = ee(0), y = ee(0), m = ee(!1), g = ee(0), { data: b, isLoading: x } = ou(), _ = ee({}), { imageUrlsMap: v, alternateImages: S, offsetsMap: A, scalesMap: F, availableStates: P } = Tt(() => {
12789
- if (!b)
12788
+ const { isSpeaking: e = !1 } = t, [r, s] = H(""), [n, i] = H(0), [a, l] = H(400), [c, u] = H(!1), d = te(null), h = te(0), f = te(e), p = te(0), y = te(0), b = te(!1), g = te(0), { data: m, isLoading: x } = ou(), _ = te({}), { imageUrlsMap: v, alternateImages: S, offsetsMap: A, scalesMap: F, availableStates: P } = Tt(() => {
12789
+ if (!m)
12790
12790
  return {
12791
12791
  imageUrlsMap: {},
12792
12792
  alternateImages: {},
@@ -12794,26 +12794,26 @@ const Fn = (t) => {
12794
12794
  scalesMap: {},
12795
12795
  availableStates: []
12796
12796
  };
12797
- const R = {}, N = {}, K = {}, se = {}, re = b.states.map((L) => L.state_key);
12798
- return re.forEach((L) => {
12799
- const U = b.configs.filter((C) => C.animation_state === L), Z = U.map((C) => C.image_url), ce = U.map((C) => C.vertical_offset || 0), Y = U.map((C) => C.scale || 100);
12800
- if (Z.length > 0) {
12801
- const C = b.states.find(($) => $.state_key === L);
12797
+ const R = {}, N = {}, K = {}, X = {}, se = m.states.map((L) => L.state_key);
12798
+ return se.forEach((L) => {
12799
+ const U = m.configs.filter((C) => C.animation_state === L), Q = U.map((C) => C.image_url), ce = U.map((C) => C.vertical_offset || 0), Z = U.map((C) => C.scale || 100);
12800
+ if (Q.length > 0) {
12801
+ const C = m.states.find(($) => $.state_key === L);
12802
12802
  R[L] = {
12803
- url: Z[0],
12803
+ url: Q[0],
12804
12804
  animation_speed: (C == null ? void 0 : C.animation_speed) || 400,
12805
12805
  pause_duration: (C == null ? void 0 : C.pause_duration) || 0,
12806
12806
  loop_count: (C == null ? void 0 : C.loop_count) || 0
12807
- }, N[L] = Z, K[L] = ce, se[L] = Y;
12807
+ }, N[L] = Q, K[L] = ce, X[L] = Z;
12808
12808
  }
12809
12809
  }), {
12810
12810
  imageUrlsMap: R,
12811
12811
  alternateImages: N,
12812
12812
  offsetsMap: K,
12813
- scalesMap: se,
12814
- availableStates: re
12813
+ scalesMap: X,
12814
+ availableStates: se
12815
12815
  };
12816
- }, [b]);
12816
+ }, [m]);
12817
12817
  he(() => {
12818
12818
  _.current = v;
12819
12819
  }, [v]), he(() => {
@@ -12824,23 +12824,23 @@ const Fn = (t) => {
12824
12824
  }
12825
12825
  }, [e, r]);
12826
12826
  const D = V((R) => {
12827
- s((N) => N === R ? N : (p.current = 0, y.current = 0, m.current = !1, i(0), R));
12827
+ s((N) => N === R ? N : (p.current = 0, y.current = 0, b.current = !1, i(0), R));
12828
12828
  }, []);
12829
12829
  he(() => {
12830
12830
  P.length > 0 && !r && s(P[0]);
12831
12831
  }, [P, r]), he(() => {
12832
12832
  const R = S[r];
12833
- if (d.current !== null && (cancelAnimationFrame(d.current), d.current = null), p.current = 0, y.current = 0, m.current = !1, h.current = 0, i(0), !R || R.length <= 1)
12833
+ if (d.current !== null && (cancelAnimationFrame(d.current), d.current = null), p.current = 0, y.current = 0, b.current = !1, h.current = 0, i(0), !R || R.length <= 1)
12834
12834
  return;
12835
- const N = _.current[r], K = (N == null ? void 0 : N.animation_speed) || a || 400, se = (N == null ? void 0 : N.loop_count) || 0, re = (N == null ? void 0 : N.pause_duration) || 0, L = r.toLowerCase().includes("talk"), U = (Z) => {
12836
- if (h.current === 0 && (h.current = Z), m.current) {
12837
- Z - g.current >= re && (m.current = !1, y.current = 0, h.current = Z), d.current = requestAnimationFrame(U);
12835
+ const N = _.current[r], K = (N == null ? void 0 : N.animation_speed) || a || 400, X = (N == null ? void 0 : N.loop_count) || 0, se = (N == null ? void 0 : N.pause_duration) || 0, L = r.toLowerCase().includes("talk"), U = (Q) => {
12836
+ if (h.current === 0 && (h.current = Q), b.current) {
12837
+ Q - g.current >= se && (b.current = !1, y.current = 0, h.current = Q), d.current = requestAnimationFrame(U);
12838
12838
  return;
12839
12839
  }
12840
- if (Z - h.current >= K) {
12841
- h.current = Z;
12842
- const Y = (p.current + 1) % R.length;
12843
- Y === 0 ? (y.current++, L && f.current ? (p.current = Y, i(Y)) : se > 0 && y.current >= se ? re > 0 && (m.current = !0, g.current = Z) : (p.current = Y, i(Y))) : (p.current = Y, i(Y));
12840
+ if (Q - h.current >= K) {
12841
+ h.current = Q;
12842
+ const Z = (p.current + 1) % R.length;
12843
+ Z === 0 ? (y.current++, L && f.current ? (p.current = Z, i(Z)) : X > 0 && y.current >= X ? se > 0 && (b.current = !0, g.current = Q) : (p.current = Z, i(Z))) : (p.current = Z, i(Z));
12844
12844
  }
12845
12845
  d.current = requestAnimationFrame(U);
12846
12846
  };
@@ -12852,8 +12852,8 @@ const Fn = (t) => {
12852
12852
  const R = S[r];
12853
12853
  if (!R || R.length === 0) {
12854
12854
  const N = P.find((K) => {
12855
- var se;
12856
- return ((se = S[K]) == null ? void 0 : se.length) > 0;
12855
+ var X;
12856
+ return ((X = S[K]) == null ? void 0 : X.length) > 0;
12857
12857
  });
12858
12858
  return N ? (console.warn(`[useBobAnimation] No images for "${r}", using fallback: ${N}`), S[N][0]) : (console.error("[useBobAnimation] No valid images found for any state!"), "");
12859
12859
  }
@@ -12862,8 +12862,8 @@ const Fn = (t) => {
12862
12862
  const R = A[r];
12863
12863
  if (!R || R.length === 0) {
12864
12864
  const N = P.find((K) => {
12865
- var se;
12866
- return ((se = A[K]) == null ? void 0 : se.length) > 0;
12865
+ var X;
12866
+ return ((X = A[K]) == null ? void 0 : X.length) > 0;
12867
12867
  });
12868
12868
  return N ? A[N][0] : 0;
12869
12869
  }
@@ -12872,8 +12872,8 @@ const Fn = (t) => {
12872
12872
  const R = F[r];
12873
12873
  if (!R || R.length === 0) {
12874
12874
  const N = P.find((K) => {
12875
- var se;
12876
- return ((se = F[K]) == null ? void 0 : se.length) > 0;
12875
+ var X;
12876
+ return ((X = F[K]) == null ? void 0 : X.length) > 0;
12877
12877
  });
12878
12878
  return N ? F[N][0] : 100;
12879
12879
  }
@@ -13076,7 +13076,7 @@ const Fn = (t) => {
13076
13076
  border: "#BFDBFE",
13077
13077
  label: "Pair"
13078
13078
  }
13079
- }, mt = {
13079
+ }, bt = {
13080
13080
  packageTitle: { fontSize: "20px", fontWeight: 700 },
13081
13081
  partslotName: { fontSize: "14px", fontWeight: 600 },
13082
13082
  productName: { fontSize: "14px", fontWeight: 500 },
@@ -13170,8 +13170,8 @@ const Bs = ({
13170
13170
  {
13171
13171
  style: {
13172
13172
  marginBottom: "12px",
13173
- fontSize: mt.partslotName.fontSize,
13174
- fontWeight: mt.partslotName.fontWeight,
13173
+ fontSize: bt.partslotName.fontSize,
13174
+ fontWeight: bt.partslotName.fontWeight,
13175
13175
  color: z.foreground,
13176
13176
  display: "flex",
13177
13177
  alignItems: "center",
@@ -13225,11 +13225,11 @@ const Bs = ({
13225
13225
  onAddToCart: r,
13226
13226
  isRecommended: s = !1
13227
13227
  }) => {
13228
- const [n, i] = br.useState(!1), [a, l] = br.useState(!1), c = t.image_url || t.image || (t.sku ? Ws.productImage(t.sku) : null), u = t.brand ? Ws.brandLogo(t.brand) : null, d = t.brand || "Quality Part", h = t.name || "Product", f = t.price ?? 0, p = t.partNumber || t.part_number, y = fu({
13228
+ const [n, i] = mr.useState(!1), [a, l] = mr.useState(!1), c = t.image_url || t.image || (t.sku ? Ws.productImage(t.sku) : null), u = t.brand ? Ws.brandLogo(t.brand) : null, d = t.brand || "Quality Part", h = t.name || "Product", f = t.price ?? 0, p = t.partNumber || t.part_number, y = fu({
13229
13229
  name: t.name,
13230
13230
  partslotDescription: t.partslotDescription,
13231
13231
  per_car_qty: t.quantity
13232
- }), { displayPrice: m, unitPriceLabel: g } = pu(f, y);
13232
+ }), { displayPrice: b, unitPriceLabel: g } = pu(f, y);
13233
13233
  return /* @__PURE__ */ o.jsxs(
13234
13234
  "div",
13235
13235
  {
@@ -13242,11 +13242,11 @@ const Bs = ({
13242
13242
  transition: "all 0.2s ease"
13243
13243
  },
13244
13244
  onClick: () => e == null ? void 0 : e(t),
13245
- onMouseEnter: (b) => {
13246
- b.currentTarget.style.borderColor = `${z.primary}80`, b.currentTarget.style.boxShadow = "0 10px 25px rgba(0,0,0,0.1)";
13245
+ onMouseEnter: (m) => {
13246
+ m.currentTarget.style.borderColor = `${z.primary}80`, m.currentTarget.style.boxShadow = "0 10px 25px rgba(0,0,0,0.1)";
13247
13247
  },
13248
- onMouseLeave: (b) => {
13249
- b.currentTarget.style.borderColor = z.border, b.currentTarget.style.boxShadow = "none";
13248
+ onMouseLeave: (m) => {
13249
+ m.currentTarget.style.borderColor = z.border, m.currentTarget.style.boxShadow = "none";
13250
13250
  },
13251
13251
  children: [
13252
13252
  t.partslotDescription && /* @__PURE__ */ o.jsxs(
@@ -13265,8 +13265,8 @@ const Bs = ({
13265
13265
  "span",
13266
13266
  {
13267
13267
  style: {
13268
- fontSize: mt.partslotName.fontSize,
13269
- fontWeight: mt.partslotName.fontWeight,
13268
+ fontSize: bt.partslotName.fontSize,
13269
+ fontWeight: bt.partslotName.fontWeight,
13270
13270
  color: z.foreground
13271
13271
  },
13272
13272
  children: t.partslotDescription
@@ -13359,8 +13359,8 @@ const Bs = ({
13359
13359
  "div",
13360
13360
  {
13361
13361
  style: {
13362
- fontSize: mt.productName.fontSize,
13363
- fontWeight: mt.productName.fontWeight,
13362
+ fontSize: bt.productName.fontSize,
13363
+ fontWeight: bt.productName.fontWeight,
13364
13364
  color: z.foreground,
13365
13365
  overflow: "hidden",
13366
13366
  textOverflow: "ellipsis",
@@ -13419,18 +13419,18 @@ const Bs = ({
13419
13419
  "div",
13420
13420
  {
13421
13421
  style: {
13422
- fontSize: mt.priceMain.fontSize,
13423
- fontWeight: mt.priceMain.fontWeight,
13422
+ fontSize: bt.priceMain.fontSize,
13423
+ fontWeight: bt.priceMain.fontWeight,
13424
13424
  color: z.foreground
13425
13425
  },
13426
- children: tt(m)
13426
+ children: tt(b)
13427
13427
  }
13428
13428
  ),
13429
13429
  g && /* @__PURE__ */ o.jsx(
13430
13430
  "div",
13431
13431
  {
13432
13432
  style: {
13433
- fontSize: mt.priceSecondary.fontSize,
13433
+ fontSize: bt.priceSecondary.fontSize,
13434
13434
  color: z.mutedForeground
13435
13435
  },
13436
13436
  children: g
@@ -13440,7 +13440,7 @@ const Bs = ({
13440
13440
  "div",
13441
13441
  {
13442
13442
  style: {
13443
- fontSize: mt.priceSecondary.fontSize,
13443
+ fontSize: bt.priceSecondary.fontSize,
13444
13444
  color: z.mutedForeground
13445
13445
  },
13446
13446
  children: "inc GST"
@@ -13450,8 +13450,8 @@ const Bs = ({
13450
13450
  r && /* @__PURE__ */ o.jsx(
13451
13451
  "button",
13452
13452
  {
13453
- onClick: (b) => {
13454
- b.stopPropagation(), r(t);
13453
+ onClick: (m) => {
13454
+ m.stopPropagation(), r(t);
13455
13455
  },
13456
13456
  style: {
13457
13457
  background: z.primary,
@@ -13465,17 +13465,17 @@ const Bs = ({
13465
13465
  transition: "all 0.2s ease",
13466
13466
  whiteSpace: "nowrap"
13467
13467
  },
13468
- onMouseEnter: (b) => {
13469
- b.currentTarget.style.background = z.primaryHover;
13468
+ onMouseEnter: (m) => {
13469
+ m.currentTarget.style.background = z.primaryHover;
13470
13470
  },
13471
- onMouseLeave: (b) => {
13472
- b.currentTarget.style.background = z.primary;
13471
+ onMouseLeave: (m) => {
13472
+ m.currentTarget.style.background = z.primary;
13473
13473
  },
13474
- onMouseDown: (b) => {
13475
- b.currentTarget.style.transform = "scale(0.98)";
13474
+ onMouseDown: (m) => {
13475
+ m.currentTarget.style.transform = "scale(0.98)";
13476
13476
  },
13477
- onMouseUp: (b) => {
13478
- b.currentTarget.style.transform = "scale(1)";
13477
+ onMouseUp: (m) => {
13478
+ m.currentTarget.style.transform = "scale(1)";
13479
13479
  },
13480
13480
  children: "Add to Cart"
13481
13481
  }
@@ -13489,7 +13489,7 @@ const Bs = ({
13489
13489
  ]
13490
13490
  }
13491
13491
  );
13492
- }, mu = ({
13492
+ }, bu = ({
13493
13493
  messages: t,
13494
13494
  input: e,
13495
13495
  setInput: r,
@@ -13521,7 +13521,7 @@ const Bs = ({
13521
13521
  "input",
13522
13522
  {
13523
13523
  value: e,
13524
- onChange: (m) => r(m.target.value),
13524
+ onChange: (b) => r(b.target.value),
13525
13525
  onKeyPress: i,
13526
13526
  onFocus: a,
13527
13527
  onBlur: l,
@@ -13588,33 +13588,33 @@ const Bs = ({
13588
13588
  height: "400px",
13589
13589
  background: "rgba(0,0,0,0.1)"
13590
13590
  }, children: [
13591
- [...t].reverse().map((m, g) => {
13592
- var b;
13591
+ [...t].reverse().map((b, g) => {
13592
+ var m;
13593
13593
  return /* @__PURE__ */ o.jsx(
13594
13594
  "div",
13595
13595
  {
13596
- style: { display: "flex", flexDirection: "column", alignItems: m.role === "user" ? "flex-end" : "flex-start" },
13596
+ style: { display: "flex", flexDirection: "column", alignItems: b.role === "user" ? "flex-end" : "flex-start" },
13597
13597
  children: /* @__PURE__ */ o.jsxs(
13598
13598
  "div",
13599
13599
  {
13600
13600
  style: {
13601
- maxWidth: (b = m.suggestedProducts) != null && b.length ? "100%" : "80%",
13601
+ maxWidth: (m = b.suggestedProducts) != null && m.length ? "100%" : "80%",
13602
13602
  borderRadius: "16px",
13603
13603
  padding: "12px 16px",
13604
13604
  fontSize: "14px",
13605
- backgroundColor: m.role === "user" ? "linear-gradient(135deg, rgba(0, 102, 204, 0.9), rgba(0, 73, 153, 1))" : "rgba(255,255,255,0.1)",
13606
- background: m.role === "user" ? "linear-gradient(135deg, rgba(0, 102, 204, 0.9), rgba(0, 73, 153, 1))" : "rgba(255,255,255,0.08)",
13605
+ backgroundColor: b.role === "user" ? "linear-gradient(135deg, rgba(0, 102, 204, 0.9), rgba(0, 73, 153, 1))" : "rgba(255,255,255,0.1)",
13606
+ background: b.role === "user" ? "linear-gradient(135deg, rgba(0, 102, 204, 0.9), rgba(0, 73, 153, 1))" : "rgba(255,255,255,0.08)",
13607
13607
  color: "white",
13608
13608
  border: "1px solid rgba(255,255,255,0.15)",
13609
13609
  boxShadow: "0 2px 8px rgba(0,0,0,0.2)"
13610
13610
  },
13611
13611
  children: [
13612
- m.content,
13613
- m.role === "assistant" && m.suggestedProducts && m.suggestedProducts.length > 0 && /* @__PURE__ */ o.jsx(
13612
+ b.content,
13613
+ b.role === "assistant" && b.suggestedProducts && b.suggestedProducts.length > 0 && /* @__PURE__ */ o.jsx(
13614
13614
  Ea,
13615
13615
  {
13616
- products: m.suggestedProducts,
13617
- title: m.suggestionsTitle,
13616
+ products: b.suggestedProducts,
13617
+ title: b.suggestionsTitle,
13618
13618
  onAddToCart: p,
13619
13619
  onProductClick: y
13620
13620
  }
@@ -13628,13 +13628,13 @@ const Bs = ({
13628
13628
  }),
13629
13629
  /* @__PURE__ */ o.jsx("div", { ref: c })
13630
13630
  ] })
13631
- ] }) }), bu = 768, yu = 1024;
13631
+ ] }) }), mu = 768, yu = 1024;
13632
13632
  function Gs() {
13633
13633
  const [t, e] = H("mobile");
13634
13634
  return he(() => {
13635
13635
  const r = () => {
13636
13636
  const s = window.innerWidth;
13637
- s >= yu ? e("desktop") : s >= bu ? e("tablet") : e("mobile");
13637
+ s >= yu ? e("desktop") : s >= mu ? e("tablet") : e("mobile");
13638
13638
  };
13639
13639
  return r(), window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
13640
13640
  }, []), t;
@@ -13707,7 +13707,7 @@ const zn = ({
13707
13707
  default:
13708
13708
  return "50%";
13709
13709
  }
13710
- }, p = () => i === "center" ? "translateX(-50%)" : "translateX(0)", y = s + a, m = () => i === "hidden" ? "all 0.35s cubic-bezier(0.4, 0, 0.2, 1)" : "all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1)";
13710
+ }, p = () => i === "center" ? "translateX(-50%)" : "translateX(0)", y = s + a, b = () => i === "hidden" ? "all 0.35s cubic-bezier(0.4, 0, 0.2, 1)" : "all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1)";
13711
13711
  return /* @__PURE__ */ o.jsxs("div", { className: "absolute inset-0 pointer-events-none", style: { overflow: "visible" }, children: [
13712
13712
  /* @__PURE__ */ o.jsx(
13713
13713
  "div",
@@ -13720,7 +13720,7 @@ const zn = ({
13720
13720
  transform: p(),
13721
13721
  width: `${d}%`,
13722
13722
  maxWidth: `${h}px`,
13723
- transition: m() + ", opacity 0.6s ease-out",
13723
+ transition: b() + ", opacity 0.6s ease-out",
13724
13724
  willChange: "transform, left, opacity",
13725
13725
  opacity: l ? 1 : 0
13726
13726
  },
@@ -14016,24 +14016,24 @@ const Ni = (t, e) => {
14016
14016
  pendingVariants: f,
14017
14017
  pendingVariantMake: p,
14018
14018
  pendingVariantModel: y,
14019
- onVariantSelect: m
14019
+ onVariantSelect: b
14020
14020
  }) => {
14021
- const g = h || "Bob's Shelf", b = Gs();
14021
+ const g = h || "Bob's Shelf", m = Gs();
14022
14022
  qn();
14023
- const x = ee(null), _ = ee({}), v = ee(null), [S, A] = H(null), [F, P] = H({}), [D, E] = H({}), T = Tt(() => {
14023
+ const x = te(null), _ = te({}), v = te(null), [S, A] = H(null), [F, P] = H({}), [D, E] = H({}), T = Tt(() => {
14024
14024
  const C = {};
14025
14025
  return t.forEach((G) => {
14026
- const Q = G.partslotDescription || "Other Parts";
14027
- C[Q] || (C[Q] = []), C[Q].push(G);
14028
- }), Object.keys(C).sort((G, Q) => G.localeCompare(Q)).map((G) => ({ name: G, products: C[G] }));
14026
+ const Y = G.partslotDescription || "Other Parts";
14027
+ C[Y] || (C[Y] = []), C[Y].push(G);
14028
+ }), Object.keys(C).sort((G, Y) => G.localeCompare(Y)).map((G) => ({ name: G, products: C[G] }));
14029
14029
  }, [t]);
14030
14030
  he(() => {
14031
14031
  if (!r) return;
14032
14032
  const C = setTimeout(() => {
14033
14033
  const $ = Object.entries(_.current);
14034
- for (const [G, Q] of $)
14035
- if (Q && Ni(G, r)) {
14036
- Q.scrollIntoView({ behavior: "smooth", block: "start" });
14034
+ for (const [G, Y] of $)
14035
+ if (Y && Ni(G, r)) {
14036
+ Y.scrollIntoView({ behavior: "smooth", block: "start" });
14037
14037
  break;
14038
14038
  }
14039
14039
  }, 300);
@@ -14042,12 +14042,12 @@ const Ni = (t, e) => {
14042
14042
  const [j, R] = H(0), N = (C) => {
14043
14043
  const $ = C.currentTarget, G = $.scrollHeight - $.clientHeight;
14044
14044
  if (G > 0) {
14045
- const Q = $.scrollTop / G;
14046
- R(Math.max(0, Math.min(1, Q)));
14045
+ const Y = $.scrollTop / G;
14046
+ R(Math.max(0, Math.min(1, Y)));
14047
14047
  }
14048
- }, K = ((f == null ? void 0 : f.length) ?? 0) > 0, se = t.length > 0 || e.length > 0 || K, re = a && !se, L = se && !re, U = l || se, Z = b === "mobile" ? 92 : b === "tablet" ? 65 : 70, ce = b === "desktop" ? "900px" : b === "tablet" ? "500px" : "100%", Y = b === "mobile" ? "calc(8px + env(safe-area-inset-top, 4px))" : "6px";
14048
+ }, K = ((f == null ? void 0 : f.length) ?? 0) > 0, X = t.length > 0 || e.length > 0 || K, se = a && !X, L = X && !se, U = l || X, Q = m === "mobile" ? 92 : m === "tablet" ? 65 : 70, ce = m === "desktop" ? "900px" : m === "tablet" ? "500px" : "100%", Z = m === "mobile" ? "calc(8px + env(safe-area-inset-top, 4px))" : "6px";
14049
14049
  return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
14050
- se && l && /* @__PURE__ */ o.jsx(
14050
+ X && l && /* @__PURE__ */ o.jsx(
14051
14051
  "div",
14052
14052
  {
14053
14053
  style: {
@@ -14070,12 +14070,12 @@ const Ni = (t, e) => {
14070
14070
  className: `absolute overflow-y-auto overflow-x-hidden flex flex-col gap-3 md:gap-4 transition-all duration-400 ease-out product-scroll ${U ? "opacity-100 translate-x-0" : "opacity-0 translate-x-12 pointer-events-none"}`,
14071
14071
  style: {
14072
14072
  // Right-aligned, responsive width
14073
- width: `${Z}%`,
14073
+ width: `${Q}%`,
14074
14074
  maxWidth: ce,
14075
14075
  right: "0",
14076
14076
  left: "auto",
14077
- top: Y,
14078
- bottom: b === "mobile" ? "calc(100px + env(safe-area-inset-bottom, 0px))" : "52px",
14077
+ top: Z,
14078
+ bottom: m === "mobile" ? "calc(100px + env(safe-area-inset-bottom, 0px))" : "52px",
14079
14079
  paddingTop: "4px",
14080
14080
  paddingRight: "16px",
14081
14081
  paddingLeft: "16px",
@@ -14107,8 +14107,8 @@ const Ni = (t, e) => {
14107
14107
  },
14108
14108
  children: /* @__PURE__ */ o.jsxs("div", { className: "flex items-center justify-between", children: [
14109
14109
  /* @__PURE__ */ o.jsxs("div", { className: "flex items-center gap-2", children: [
14110
- a && se ? /* @__PURE__ */ o.jsx("div", { className: "w-6 h-6 rounded-full flex items-center justify-center", style: { background: "rgba(255,255,255,0.2)" }, children: /* @__PURE__ */ o.jsx("div", { className: "w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) : /* @__PURE__ */ o.jsx("div", { className: "w-6 h-6 rounded-full flex items-center justify-center", style: { background: "rgba(255,255,255,0.2)" }, children: /* @__PURE__ */ o.jsx("svg", { className: "w-3.5 h-3.5 text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" }) }) }),
14111
- /* @__PURE__ */ o.jsx("span", { style: { ...os.primary, fontWeight: 700, fontSize: "14px", letterSpacing: "0.025em" }, children: a && se ? "Updating..." : g })
14110
+ a && X ? /* @__PURE__ */ o.jsx("div", { className: "w-6 h-6 rounded-full flex items-center justify-center", style: { background: "rgba(255,255,255,0.2)" }, children: /* @__PURE__ */ o.jsx("div", { className: "w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) : /* @__PURE__ */ o.jsx("div", { className: "w-6 h-6 rounded-full flex items-center justify-center", style: { background: "rgba(255,255,255,0.2)" }, children: /* @__PURE__ */ o.jsx("svg", { className: "w-3.5 h-3.5 text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" }) }) }),
14111
+ /* @__PURE__ */ o.jsx("span", { style: { ...os.primary, fontWeight: 700, fontSize: "14px", letterSpacing: "0.025em" }, children: a && X ? "Updating..." : g })
14112
14112
  ] }),
14113
14113
  /* @__PURE__ */ o.jsxs("span", { style: { color: "rgba(255,255,255,0.8)", fontSize: "12px", fontWeight: 500 }, children: [
14114
14114
  t.length + e.length,
@@ -14118,14 +14118,14 @@ const Ni = (t, e) => {
14118
14118
  ] })
14119
14119
  }
14120
14120
  ),
14121
- re && /* @__PURE__ */ o.jsx("div", { className: "p-5", children: /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [
14121
+ se && /* @__PURE__ */ o.jsx("div", { className: "p-5", children: /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [
14122
14122
  /* @__PURE__ */ o.jsx("div", { className: "w-10 h-10 rounded-full flex items-center justify-center", style: { background: "rgba(0, 102, 204, 0.3)" }, children: /* @__PURE__ */ o.jsx("div", { className: "w-6 h-6 border-2 border-t-transparent rounded-full animate-spin", style: { borderColor: "rgba(255,255,255,0.8)", borderTopColor: "transparent" } }) }),
14123
14123
  /* @__PURE__ */ o.jsxs("div", { children: [
14124
14124
  /* @__PURE__ */ o.jsx("p", { style: { ...os.primary, fontWeight: 600, fontSize: "14px" }, children: "Searching shelves..." }),
14125
14125
  /* @__PURE__ */ o.jsx("p", { style: { color: "rgba(255,255,255,0.6)", fontSize: "12px", marginTop: "2px" }, children: "Finding the best parts for you" })
14126
14126
  ] })
14127
14127
  ] }) }),
14128
- K && f && m && /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col gap-3", children: [
14128
+ K && f && b && /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col gap-3", children: [
14129
14129
  /* @__PURE__ */ o.jsx(
14130
14130
  "div",
14131
14131
  {
@@ -14159,14 +14159,14 @@ const Ni = (t, e) => {
14159
14159
  G.kw ? `${G.kw}kW` : null,
14160
14160
  G.ccDisplay || (G.cc ? `${G.cc}cc` : null),
14161
14161
  G.fuelType
14162
- ].filter(Boolean).join(" · ") || G.displayTitle), $ = C.reduce((G, Q) => (G[Q] = (G[Q] || 0) + 1, G), {});
14163
- return (f || []).map((G, Q) => {
14164
- const Ee = C[Q], Pe = $[Ee] > 1 && G.displaySubtitle ? G.displaySubtitle : Ee;
14162
+ ].filter(Boolean).join(" · ") || G.displayTitle), $ = C.reduce((G, Y) => (G[Y] = (G[Y] || 0) + 1, G), {});
14163
+ return (f || []).map((G, Y) => {
14164
+ const Ee = C[Y], Pe = $[Ee] > 1 && G.displaySubtitle ? G.displaySubtitle : Ee;
14165
14165
  return /* @__PURE__ */ o.jsx(
14166
14166
  "button",
14167
14167
  {
14168
14168
  type: "button",
14169
- onClick: () => m(G),
14169
+ onClick: () => b(G),
14170
14170
  className: "w-full text-left transition-all duration-200 cursor-pointer rounded-2xl overflow-hidden focus:outline-none focus:ring-2 focus:ring-blue-400 focus:ring-offset-2 active:scale-[0.98]",
14171
14171
  style: {
14172
14172
  background: "linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.85) 100%)",
@@ -14194,7 +14194,7 @@ const Ni = (t, e) => {
14194
14194
  });
14195
14195
  })() })
14196
14196
  ] }),
14197
- !re && !se && /* @__PURE__ */ o.jsx("div", { className: "p-5", children: /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [
14197
+ !se && !X && /* @__PURE__ */ o.jsx("div", { className: "p-5", children: /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [
14198
14198
  /* @__PURE__ */ o.jsx("div", { className: "w-10 h-10 rounded-full flex items-center justify-center", style: { background: "rgba(255, 149, 0, 0.3)" }, children: /* @__PURE__ */ o.jsx("svg", { className: "w-5 h-5", style: { color: "#FF9500" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }),
14199
14199
  /* @__PURE__ */ o.jsxs("div", { children: [
14200
14200
  /* @__PURE__ */ o.jsx("p", { style: { ...os.primary, fontWeight: 600, fontSize: "14px" }, children: "No products to display" }),
@@ -14209,12 +14209,12 @@ const Ni = (t, e) => {
14209
14209
  L && e.length > 0 && /* @__PURE__ */ o.jsx("div", { className: "space-y-4", children: e.map((C) => {
14210
14210
  var Xe, ot;
14211
14211
  const $ = Ta(C), G = D[C.id] || "disc";
14212
- let Q = (C.preparedTiers || []).filter((O) => !O.isHidden);
14213
- $ && (Q = Q.map((O) => {
14214
- const te = Ra(O.products, G);
14215
- return { ...O, products: te, totalPrice: Aa(te), productCount: te.length };
14212
+ let Y = (C.preparedTiers || []).filter((O) => !O.isHidden);
14213
+ $ && (Y = Y.map((O) => {
14214
+ const re = Ra(O.products, G);
14215
+ return { ...O, products: re, totalPrice: Aa(re), productCount: re.length };
14216
14216
  }));
14217
- const Ee = ((Xe = Q.find((O) => O.isRecommended)) == null ? void 0 : Xe.tierName) || ((ot = Q[0]) == null ? void 0 : ot.tierName) || "", Oe = F[C.id] || Ee, Pe = Q.find((O) => O.tierName === Oe), Ye = Sa(C.title).split(".")[0] + ".", Ke = S === C.id;
14217
+ const Ee = ((Xe = Y.find((O) => O.isRecommended)) == null ? void 0 : Xe.tierName) || ((ot = Y[0]) == null ? void 0 : ot.tierName) || "", Oe = F[C.id] || Ee, Pe = Y.find((O) => O.tierName === Oe), Ye = Sa(C.title).split(".")[0] + ".", Ke = S === C.id;
14218
14218
  return /* @__PURE__ */ o.jsxs(
14219
14219
  "div",
14220
14220
  {
@@ -14277,17 +14277,17 @@ const Ni = (t, e) => {
14277
14277
  ] })
14278
14278
  ] })
14279
14279
  ] }),
14280
- Q.length > 0 && /* @__PURE__ */ o.jsxs("div", { className: "p-3", children: [
14280
+ Y.length > 0 && /* @__PURE__ */ o.jsxs("div", { className: "p-3", children: [
14281
14281
  /* @__PURE__ */ o.jsx("p", { className: "text-xs font-semibold uppercase tracking-wide mb-2 px-1", style: { color: z.mutedForeground }, children: "Choose Your Value Level" }),
14282
- /* @__PURE__ */ o.jsx("div", { className: "grid gap-2", style: { gridTemplateColumns: `repeat(${Math.min(Q.length, 4)}, 1fr)` }, children: Q.map((O) => {
14283
- const te = Bn[O.tierName], Ne = O.tierName === Oe;
14282
+ /* @__PURE__ */ o.jsx("div", { className: "grid gap-2", style: { gridTemplateColumns: `repeat(${Math.min(Y.length, 4)}, 1fr)` }, children: Y.map((O) => {
14283
+ const re = Bn[O.tierName], Ne = O.tierName === Oe;
14284
14284
  return /* @__PURE__ */ o.jsxs(
14285
14285
  "div",
14286
14286
  {
14287
14287
  onClick: () => P((ke) => ({ ...ke, [C.id]: O.tierName })),
14288
14288
  className: "relative rounded-xl text-center transition-all cursor-pointer",
14289
14289
  style: {
14290
- padding: Q.length >= 4 ? "6px 4px" : "8px",
14290
+ padding: Y.length >= 4 ? "6px 4px" : "8px",
14291
14291
  background: O.isRecommended ? `${z.primary}10` : Ne ? `${z.primary}05` : z.background,
14292
14292
  border: `2px solid ${O.isRecommended ? z.primary : Ne ? z.primary + "80" : z.border}`
14293
14293
  },
@@ -14300,20 +14300,20 @@ const Ni = (t, e) => {
14300
14300
  children: "Carfix Value"
14301
14301
  }
14302
14302
  ),
14303
- /* @__PURE__ */ o.jsxs("p", { className: "text-sm font-bold mt-1", style: { color: (te == null ? void 0 : te.textColor) || z.foreground }, children: [
14304
- te == null ? void 0 : te.emoji,
14303
+ /* @__PURE__ */ o.jsxs("p", { className: "text-sm font-bold mt-1", style: { color: (re == null ? void 0 : re.textColor) || z.foreground }, children: [
14304
+ re == null ? void 0 : re.emoji,
14305
14305
  " ",
14306
14306
  O.displayName
14307
14307
  ] }),
14308
- /* @__PURE__ */ o.jsx("div", { className: "flex flex-col items-center gap-1 mt-2", style: { minHeight: Q.length >= 4 ? "40px" : "48px" }, children: O.brands.slice(0, 1).map((ke, we) => {
14308
+ /* @__PURE__ */ o.jsx("div", { className: "flex flex-col items-center gap-1 mt-2", style: { minHeight: Y.length >= 4 ? "40px" : "48px" }, children: O.brands.slice(0, 1).map((ke, we) => {
14309
14309
  const oe = `https://flpzjbasdsfwoeruyxgp.supabase.co/storage/v1/object/public/brand_images/${ke.fullName.replace(/\s+/g, "")}.jpg`;
14310
14310
  return /* @__PURE__ */ o.jsx(
14311
14311
  "div",
14312
14312
  {
14313
14313
  className: "w-full bg-white rounded-lg flex items-center justify-center overflow-hidden",
14314
14314
  style: {
14315
- height: Q.length >= 4 ? "36px" : "44px",
14316
- maxWidth: Q.length >= 4 ? "64px" : "80px",
14315
+ height: Y.length >= 4 ? "36px" : "44px",
14316
+ maxWidth: Y.length >= 4 ? "64px" : "80px",
14317
14317
  boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
14318
14318
  border: "1px solid #F1F5F9"
14319
14319
  },
@@ -14323,7 +14323,7 @@ const Ni = (t, e) => {
14323
14323
  src: ke.imageUrl,
14324
14324
  alt: ke.fullName,
14325
14325
  className: "w-auto object-contain",
14326
- style: { height: Q.length >= 4 ? "26px" : "32px" },
14326
+ style: { height: Y.length >= 4 ? "26px" : "32px" },
14327
14327
  onError: (pt) => {
14328
14328
  const je = pt.target;
14329
14329
  je.src !== oe ? je.src = oe : (je.style.display = "none", je.parentElement.innerHTML = `<span class="text-[10px] font-semibold text-gray-600 truncate px-1">${ke.fullName}</span>`);
@@ -14464,8 +14464,8 @@ const Ni = (t, e) => {
14464
14464
  return /* @__PURE__ */ o.jsxs(
14465
14465
  "section",
14466
14466
  {
14467
- ref: (Q) => {
14468
- _.current[C] = Q;
14467
+ ref: (Y) => {
14468
+ _.current[C] = Y;
14469
14469
  },
14470
14470
  className: "transition-all duration-300",
14471
14471
  style: {
@@ -14524,18 +14524,18 @@ const Ni = (t, e) => {
14524
14524
  ]
14525
14525
  }
14526
14526
  ),
14527
- /* @__PURE__ */ o.jsx("div", { className: "flex flex-col gap-3", children: $.map((Q, Ee) => {
14528
- const Oe = !!(s && Tu(Q, s));
14527
+ /* @__PURE__ */ o.jsx("div", { className: "flex flex-col gap-3", children: $.map((Y, Ee) => {
14528
+ const Oe = !!(s && Tu(Y, s));
14529
14529
  return /* @__PURE__ */ o.jsx("div", { "data-testid": "partslot-product", children: /* @__PURE__ */ o.jsx(
14530
14530
  Ru,
14531
14531
  {
14532
- product: Q,
14532
+ product: Y,
14533
14533
  isSpotlighted: Oe,
14534
14534
  spotlightedRef: v,
14535
14535
  onProductClick: n,
14536
- viewportSize: b
14536
+ viewportSize: m
14537
14537
  }
14538
- ) }, `${Q.id}-${Ee}`);
14538
+ ) }, `${Y.id}-${Ee}`);
14539
14539
  }) })
14540
14540
  ]
14541
14541
  },
@@ -14553,9 +14553,9 @@ const Ni = (t, e) => {
14553
14553
  language: r = "en-NZ",
14554
14554
  mode: s = "toggle"
14555
14555
  } = {}) => {
14556
- const [n, i] = H(!1), [a, l] = H(""), [c, u] = H(""), [d, h] = H(null), [f, p] = H(!1), y = ee(null), m = ee(""), g = ee(t), b = ee(e), x = ee(null), _ = 15e3;
14556
+ const [n, i] = H(!1), [a, l] = H(""), [c, u] = H(""), [d, h] = H(null), [f, p] = H(!1), y = te(null), b = te(""), g = te(t), m = te(e), x = te(null), _ = 15e3;
14557
14557
  he(() => {
14558
- g.current = t, b.current = e;
14558
+ g.current = t, m.current = e;
14559
14559
  }, [t, e]), he(() => {
14560
14560
  if (typeof window < "u" && window.location.protocol !== "https:" && window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1") {
14561
14561
  console.warn("[BobWidget] Speech recognition requires HTTPS. PTT will not work on HTTP."), h("Voice input requires a secure connection (HTTPS)"), p(!1);
@@ -14573,7 +14573,7 @@ const Ni = (t, e) => {
14573
14573
  const R = D.results[j][0].transcript;
14574
14574
  D.results[j].isFinal ? T += R : E += R;
14575
14575
  }
14576
- T && (m.current = T, l(T), g.current && g.current(T)), u(E);
14576
+ T && (b.current = T, l(T), g.current && g.current(T)), u(E);
14577
14577
  }, P.onerror = (D) => {
14578
14578
  switch (i(!1), D.error) {
14579
14579
  case "no-speech":
@@ -14589,7 +14589,7 @@ const Ni = (t, e) => {
14589
14589
  h("Speech recognition error. Please try again.");
14590
14590
  }
14591
14591
  }, P.onend = () => {
14592
- x.current && (clearTimeout(x.current), x.current = null), i(!1), u(""), m.current && b.current && b.current(m.current), m.current = "";
14592
+ x.current && (clearTimeout(x.current), x.current = null), i(!1), u(""), b.current && m.current && m.current(b.current), b.current = "";
14593
14593
  }, y.current = P;
14594
14594
  }
14595
14595
  return () => {
@@ -14632,8 +14632,8 @@ const Ni = (t, e) => {
14632
14632
  onProductClick: p,
14633
14633
  counterHeightPercent: y = 22
14634
14634
  }) => {
14635
- var Y;
14636
- const [m, g] = H(!1), b = ee(null), x = ee(!1), { bottomOffset: _, zIndexBase: v } = ka(), {
14635
+ var Z;
14636
+ const [b, g] = H(!1), m = te(null), x = te(!1), { bottomOffset: _, zIndexBase: v } = ka(), {
14637
14637
  isListening: S,
14638
14638
  interimTranscript: A,
14639
14639
  error: F,
@@ -14654,7 +14654,7 @@ const Ni = (t, e) => {
14654
14654
  x.current && (x.current = !1, navigator.vibrate && navigator.vibrate([20, 50, 20]), E(), setTimeout(() => {
14655
14655
  n();
14656
14656
  }, 150));
14657
- }, [E, n]), R = [...t].reverse().find((C) => C.role === "assistant"), N = ((Y = R == null ? void 0 : R.suggestedProducts) == null ? void 0 : Y.length) || 0, K = R != null && R.content ? R.content.length > 50 ? R.content.slice(0, 50) + "..." : R.content : "Ask Bob about car parts...", se = N > 0 ? ` (${N} products)` : "", re = {
14657
+ }, [E, n]), R = [...t].reverse().find((C) => C.role === "assistant"), N = ((Z = R == null ? void 0 : R.suggestedProducts) == null ? void 0 : Z.length) || 0, K = R != null && R.content ? R.content.length > 50 ? R.content.slice(0, 50) + "..." : R.content : "Ask Bob about car parts...", X = N > 0 ? ` (${N} products)` : "", se = {
14658
14658
  idle: {
14659
14659
  background: "linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(22, 163, 74, 0.95) 100%)",
14660
14660
  backdropFilter: "blur(16px) saturate(180%)",
@@ -14679,10 +14679,10 @@ const Ni = (t, e) => {
14679
14679
  borderRadius: "32px",
14680
14680
  boxShadow: "0 4px 16px rgba(0, 0, 0, 0.2)"
14681
14681
  }
14682
- }, L = h ? "speaking" : s ? "processing" : S ? "listening" : "idle", Z = {
14683
- idle: re.idle,
14684
- listening: re.active,
14685
- processing: re.disabled,
14682
+ }, L = h ? "speaking" : s ? "processing" : S ? "listening" : "idle", Q = {
14683
+ idle: se.idle,
14684
+ listening: se.active,
14685
+ processing: se.disabled,
14686
14686
  speaking: {
14687
14687
  background: "linear-gradient(135deg, rgba(34, 197, 94, 0.95) 0%, rgba(22, 163, 74, 1) 100%)",
14688
14688
  backdropFilter: "blur(16px) saturate(180%)",
@@ -14700,7 +14700,7 @@ const Ni = (t, e) => {
14700
14700
  return /* @__PURE__ */ o.jsxs(
14701
14701
  "div",
14702
14702
  {
14703
- ref: b,
14703
+ ref: m,
14704
14704
  style: {
14705
14705
  position: "fixed",
14706
14706
  // v3.1.15: Position at bottom for fixed variant (includes bottomOffset for host nav)
@@ -14713,7 +14713,7 @@ const Ni = (t, e) => {
14713
14713
  transition: "all 0.3s ease-out",
14714
14714
  boxShadow: "0 -10px 40px rgba(0, 0, 0, 0.3)",
14715
14715
  // v3.1.15: Increased collapsed height
14716
- height: m ? "55vh" : "90px",
14716
+ height: b ? "55vh" : "90px",
14717
14717
  zIndex: v + 80,
14718
14718
  paddingBottom: "env(safe-area-inset-bottom, 8px)"
14719
14719
  },
@@ -14721,7 +14721,7 @@ const Ni = (t, e) => {
14721
14721
  /* @__PURE__ */ o.jsx(
14722
14722
  "button",
14723
14723
  {
14724
- onClick: () => g(!m),
14724
+ onClick: () => g(!b),
14725
14725
  style: {
14726
14726
  position: "absolute",
14727
14727
  top: "-20px",
@@ -14739,11 +14739,11 @@ const Ni = (t, e) => {
14739
14739
  minHeight: "unset",
14740
14740
  minWidth: "unset"
14741
14741
  },
14742
- "aria-label": m ? "Collapse chat" : "Expand chat",
14743
- children: m ? /* @__PURE__ */ o.jsx("svg", { style: { height: "16px", width: "16px", color: "rgba(255,255,255,0.8)" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) : /* @__PURE__ */ o.jsx("svg", { style: { height: "16px", width: "16px", color: "rgba(255,255,255,0.8)" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 15l7-7 7 7" }) })
14742
+ "aria-label": b ? "Collapse chat" : "Expand chat",
14743
+ children: b ? /* @__PURE__ */ o.jsx("svg", { style: { height: "16px", width: "16px", color: "rgba(255,255,255,0.8)" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) : /* @__PURE__ */ o.jsx("svg", { style: { height: "16px", width: "16px", color: "rgba(255,255,255,0.8)" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 15l7-7 7 7" }) })
14744
14744
  }
14745
14745
  ),
14746
- !m && /* @__PURE__ */ o.jsx(
14746
+ !b && /* @__PURE__ */ o.jsx(
14747
14747
  "div",
14748
14748
  {
14749
14749
  onClick: () => g(!0),
@@ -14758,11 +14758,11 @@ const Ni = (t, e) => {
14758
14758
  whiteSpace: "nowrap"
14759
14759
  }, children: [
14760
14760
  K,
14761
- se && /* @__PURE__ */ o.jsx("span", { style: { color: "rgba(255,200,0,0.9)", fontWeight: 600 }, children: se })
14761
+ X && /* @__PURE__ */ o.jsx("span", { style: { color: "rgba(255,200,0,0.9)", fontWeight: 600 }, children: X })
14762
14762
  ] })
14763
14763
  }
14764
14764
  ),
14765
- m && /* @__PURE__ */ o.jsxs("div", { style: { height: "calc(100% - 100px)", overflowY: "auto", padding: "16px", display: "flex", flexDirection: "column", gap: "8px" }, className: "glass-scroll", children: [
14765
+ b && /* @__PURE__ */ o.jsxs("div", { style: { height: "calc(100% - 100px)", overflowY: "auto", padding: "16px", display: "flex", flexDirection: "column", gap: "8px" }, className: "glass-scroll", children: [
14766
14766
  [...t].reverse().map((C, $) => {
14767
14767
  var G;
14768
14768
  return /* @__PURE__ */ o.jsx("div", { style: { display: "flex", flexDirection: "column", alignItems: C.role === "user" ? "flex-end" : "flex-start" }, children: /* @__PURE__ */ o.jsxs("div", { style: {
@@ -14848,7 +14848,7 @@ const Ni = (t, e) => {
14848
14848
  onClick: S ? j : void 0,
14849
14849
  disabled: L === "processing",
14850
14850
  "aria-label": "Hold to talk to Bob",
14851
- className: "glass-button",
14851
+ className: "glass-button bob-ptt-btn",
14852
14852
  style: {
14853
14853
  width: "200px",
14854
14854
  height: "64px",
@@ -14863,7 +14863,12 @@ const Ni = (t, e) => {
14863
14863
  opacity: L === "processing" ? 0.6 : 1,
14864
14864
  transform: L === "listening" ? "scale(1.04)" : "scale(1)",
14865
14865
  transition: "transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.3s ease",
14866
- ...Z
14866
+ backdropFilter: Q.backdropFilter,
14867
+ WebkitBackdropFilter: Q.WebkitBackdropFilter,
14868
+ "--bob-ptt-bg": Q.background,
14869
+ "--bob-ptt-shadow": Q.boxShadow,
14870
+ "--bob-ptt-border": Q.border,
14871
+ "--bob-ptt-radius": "32px"
14867
14872
  },
14868
14873
  title: "Hold to talk",
14869
14874
  children: /* @__PURE__ */ o.jsx("span", { style: {
@@ -14922,7 +14927,7 @@ const Ni = (t, e) => {
14922
14927
  onBlur: l,
14923
14928
  placeholder: "Message Bob...",
14924
14929
  disabled: L !== "idle",
14925
- className: "high-contrast-input",
14930
+ className: "high-contrast-input bob-chat-input",
14926
14931
  style: {
14927
14932
  width: "100%",
14928
14933
  height: "40px",
@@ -14938,7 +14943,7 @@ const Ni = (t, e) => {
14938
14943
  }
14939
14944
  }
14940
14945
  ),
14941
- L !== "idle" && /* @__PURE__ */ o.jsxs("div", { style: {
14946
+ L !== "idle" && /* @__PURE__ */ o.jsxs("div", { className: "bob-state-overlay", style: {
14942
14947
  position: "absolute",
14943
14948
  inset: 0,
14944
14949
  background: "#FFFFFF",
@@ -15009,9 +15014,9 @@ const Ni = (t, e) => {
15009
15014
  onInputBlur: f,
15010
15015
  chatEndRef: p,
15011
15016
  isMuted: y,
15012
- onToggleMute: m,
15017
+ onToggleMute: b,
15013
15018
  isSpeaking: g,
15014
- products: b,
15019
+ products: m,
15015
15020
  servicePackages: x,
15016
15021
  highlightedPartType: _,
15017
15022
  highlightedProduct: v,
@@ -15026,15 +15031,15 @@ const Ni = (t, e) => {
15026
15031
  onVariantSelect: R,
15027
15032
  bobOffset: N = 0,
15028
15033
  bobScale: K = 100,
15029
- embedded: se = !1
15034
+ embedded: X = !1
15030
15035
  }) => {
15031
15036
  console.log("[MobileBobLayout] Rendering with:", {
15032
15037
  currentImage: (t == null ? void 0 : t.substring(0, 50)) || "EMPTY",
15033
15038
  backdropUrl: (r == null ? void 0 : r.substring(0, 50)) || "NONE",
15034
15039
  counterOverlayUrl: (s == null ? void 0 : s.substring(0, 50)) || "NONE"
15035
15040
  });
15036
- const re = Gs(), [L, U] = H("center"), [Z, ce] = H("hidden"), Y = b.length > 0 || x.length > 0, C = ((E == null ? void 0 : E.length) ?? 0) > 0, $ = Y || C, Ee = (() => {
15037
- switch (re) {
15041
+ const se = Gs(), [L, U] = H("center"), [Q, ce] = H("hidden"), Z = m.length > 0 || x.length > 0, C = ((E == null ? void 0 : E.length) ?? 0) > 0, $ = Z || C, Ee = (() => {
15042
+ switch (se) {
15038
15043
  case "desktop":
15039
15044
  return 70;
15040
15045
  case "tablet":
@@ -15046,9 +15051,9 @@ const Ni = (t, e) => {
15046
15051
  }
15047
15052
  })() * K / 100;
15048
15053
  he(() => {
15049
- if (F && Z !== "loading" && Z !== "visible")
15054
+ if (F && Q !== "loading" && Q !== "visible")
15050
15055
  ce("loading"), L === "center" && U("partial-left");
15051
- else if ($ && Z !== "visible")
15056
+ else if ($ && Q !== "visible")
15052
15057
  if (L === "center") {
15053
15058
  U("partial-left"), ce("transitioning");
15054
15059
  const Pe = setTimeout(() => {
@@ -15057,15 +15062,15 @@ const Ni = (t, e) => {
15057
15062
  return () => clearTimeout(Pe);
15058
15063
  } else
15059
15064
  ce("visible");
15060
- else !$ && !F && Z !== "hidden" && (ce("hidden"), U("center"));
15061
- }, [$, F, Z, L]);
15062
- const Oe = Z !== "hidden";
15065
+ else !$ && !F && Q !== "hidden" && (ce("hidden"), U("center"));
15066
+ }, [$, F, Q, L]);
15067
+ const Oe = Q !== "hidden";
15063
15068
  return /* @__PURE__ */ o.jsxs(
15064
15069
  "div",
15065
15070
  {
15066
- className: se ? "absolute inset-0 overflow-hidden" : "fixed inset-0 overflow-hidden",
15071
+ className: X ? "absolute inset-0 overflow-hidden" : "fixed inset-0 overflow-hidden",
15067
15072
  style: {
15068
- height: se ? "100%" : "100dvh",
15073
+ height: X ? "100%" : "100dvh",
15069
15074
  touchAction: "manipulation"
15070
15075
  },
15071
15076
  children: [
@@ -15110,7 +15115,7 @@ const Ni = (t, e) => {
15110
15115
  /* @__PURE__ */ o.jsx(
15111
15116
  Hn,
15112
15117
  {
15113
- products: b,
15118
+ products: m,
15114
15119
  servicePackages: x,
15115
15120
  highlightedPartType: _,
15116
15121
  highlightedProduct: v,
@@ -15139,7 +15144,7 @@ const Ni = (t, e) => {
15139
15144
  onInputBlur: f,
15140
15145
  chatEndRef: p,
15141
15146
  isMuted: y,
15142
- onToggleMute: m,
15147
+ onToggleMute: b,
15143
15148
  isSpeaking: g,
15144
15149
  onAddToCart: S,
15145
15150
  onProductClick: S,
@@ -15164,7 +15169,7 @@ const Ni = (t, e) => {
15164
15169
  isSpeaking: h = !1,
15165
15170
  counterHeightPercent: f = 22
15166
15171
  }) => {
15167
- const [p, y] = H(!1), m = ee(null), g = ee(!1), { bottomOffset: b, zIndexBase: x } = ka(), {
15172
+ const [p, y] = H(!1), b = te(null), g = te(!1), { bottomOffset: m, zIndexBase: x } = ka(), {
15168
15173
  isListening: _,
15169
15174
  interimTranscript: v,
15170
15175
  error: S,
@@ -15210,7 +15215,7 @@ const Ni = (t, e) => {
15210
15215
  borderRadius: "50%",
15211
15216
  boxShadow: "0 4px 16px rgba(0, 0, 0, 0.2)"
15212
15217
  }
15213
- }, N = h ? "speaking" : s ? "processing" : _ ? "listening" : "idle", se = {
15218
+ }, N = h ? "speaking" : s ? "processing" : _ ? "listening" : "idle", X = {
15214
15219
  idle: R.idle,
15215
15220
  listening: R.active,
15216
15221
  processing: R.disabled,
@@ -15222,7 +15227,7 @@ const Ni = (t, e) => {
15222
15227
  borderRadius: "50%",
15223
15228
  boxShadow: "0 12px 48px rgba(34, 197, 94, 0.4), inset 0 1px 0 rgba(255,255,255,0.3)"
15224
15229
  }
15225
- }[N], re = {
15230
+ }[N], se = {
15226
15231
  idle: { border: "2px solid rgba(34, 197, 94, 0.5)", animation: "ring-breathe 2s ease-in-out infinite" },
15227
15232
  listening: null,
15228
15233
  // uses existing ptt-wave rings
@@ -15232,7 +15237,7 @@ const Ni = (t, e) => {
15232
15237
  return /* @__PURE__ */ o.jsxs(
15233
15238
  "div",
15234
15239
  {
15235
- ref: m,
15240
+ ref: b,
15236
15241
  style: {
15237
15242
  position: "absolute",
15238
15243
  bottom: 0,
@@ -15365,7 +15370,7 @@ const Ni = (t, e) => {
15365
15370
  onBlur: l,
15366
15371
  placeholder: "Message Bob...",
15367
15372
  disabled: N !== "idle",
15368
- className: "high-contrast-input",
15373
+ className: "high-contrast-input bob-chat-input",
15369
15374
  style: {
15370
15375
  width: "100%",
15371
15376
  height: "40px",
@@ -15381,7 +15386,7 @@ const Ni = (t, e) => {
15381
15386
  }
15382
15387
  }
15383
15388
  ),
15384
- N !== "idle" && /* @__PURE__ */ o.jsxs("div", { style: {
15389
+ N !== "idle" && /* @__PURE__ */ o.jsxs("div", { className: "bob-state-overlay", style: {
15385
15390
  position: "absolute",
15386
15391
  inset: 0,
15387
15392
  background: "#FFFFFF",
@@ -15466,16 +15471,16 @@ const Ni = (t, e) => {
15466
15471
  pointerEvents: "none"
15467
15472
  } })
15468
15473
  ] }),
15469
- N !== "listening" && re[N] && /* @__PURE__ */ o.jsx("div", { style: {
15474
+ N !== "listening" && se[N] && /* @__PURE__ */ o.jsx("div", { style: {
15470
15475
  position: "absolute",
15471
15476
  top: "50%",
15472
15477
  left: "50%",
15473
15478
  width: "84px",
15474
15479
  height: "84px",
15475
15480
  borderRadius: "50%",
15476
- border: re[N].border,
15481
+ border: se[N].border,
15477
15482
  transform: "translate(-50%, -50%)",
15478
- animation: re[N].animation,
15483
+ animation: se[N].animation,
15479
15484
  pointerEvents: "none"
15480
15485
  } }),
15481
15486
  /* @__PURE__ */ o.jsxs(
@@ -15489,7 +15494,7 @@ const Ni = (t, e) => {
15489
15494
  onMouseLeave: E,
15490
15495
  disabled: N === "processing",
15491
15496
  "aria-label": "Hold to talk to Bob",
15492
- className: "glass-button",
15497
+ className: "glass-button bob-ptt-btn",
15493
15498
  style: {
15494
15499
  position: "relative",
15495
15500
  flexShrink: 0,
@@ -15497,20 +15502,23 @@ const Ni = (t, e) => {
15497
15502
  width: "72px",
15498
15503
  minHeight: "unset",
15499
15504
  minWidth: "unset",
15500
- borderRadius: "50%",
15501
15505
  display: "flex",
15502
15506
  alignItems: "center",
15503
15507
  justifyContent: "center",
15504
15508
  userSelect: "none",
15505
15509
  touchAction: "none",
15506
15510
  color: "white",
15507
- border: "none",
15508
15511
  cursor: N === "processing" ? "not-allowed" : "pointer",
15509
15512
  opacity: N === "processing" ? 0.6 : 1,
15510
15513
  transform: N === "listening" ? "scale(1.08)" : "scale(1)",
15511
15514
  transition: "transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.3s ease",
15512
15515
  zIndex: x + 45,
15513
- ...se
15516
+ backdropFilter: X.backdropFilter,
15517
+ WebkitBackdropFilter: X.WebkitBackdropFilter,
15518
+ "--bob-ptt-bg": X.background,
15519
+ "--bob-ptt-shadow": X.boxShadow,
15520
+ "--bob-ptt-border": X.border,
15521
+ "--bob-ptt-radius": "50%"
15514
15522
  },
15515
15523
  title: "Hold to talk",
15516
15524
  children: [
@@ -15640,25 +15648,25 @@ const Ni = (t, e) => {
15640
15648
  onAddToCart: r,
15641
15649
  onNavigateToProductPage: s
15642
15650
  }) => {
15643
- var m;
15651
+ var b;
15644
15652
  const [n, i] = H(!1), [a, l] = H("disc"), c = Tt(() => Ta(t), [t.id, t.title]), u = Tt(() => {
15645
15653
  if (!t.preparedTiers || t.preparedTiers.length === 0) return [];
15646
- const g = t.preparedTiers.filter((b) => !b.isHidden);
15647
- return c ? g.map((b) => {
15648
- const x = Ra(b.products, a);
15649
- return { ...b, products: x, totalPrice: Aa(x), productCount: x.length };
15654
+ const g = t.preparedTiers.filter((m) => !m.isHidden);
15655
+ return c ? g.map((m) => {
15656
+ const x = Ra(m.products, a);
15657
+ return { ...m, products: x, totalPrice: Aa(x), productCount: x.length };
15650
15658
  }) : g;
15651
15659
  }, [t.preparedTiers, c, a]), d = u.length > 0, h = (g) => {
15652
- const b = g.bundleDiscountPercentage || 0;
15653
- if (b > 0) {
15654
- const x = 1 - b / 100, _ = g.products.map((v) => ({
15660
+ const m = g.bundleDiscountPercentage || 0;
15661
+ if (m > 0) {
15662
+ const x = 1 - m / 100, _ = g.products.map((v) => ({
15655
15663
  ...v,
15656
15664
  displayPrice: Math.round(v.displayPrice * x * 100) / 100
15657
15665
  }));
15658
15666
  r == null || r(_);
15659
15667
  } else
15660
15668
  r == null || r(g.products);
15661
- }, f = (g) => g === 2 ? "grid-cols-2" : g === 3 ? "grid-cols-3" : "grid-cols-2", p = Sa(t.title), y = ((m = u[0]) == null ? void 0 : m.productCount) || 0;
15669
+ }, f = (g) => g === 2 ? "grid-cols-2" : g === 3 ? "grid-cols-3" : "grid-cols-2", p = Sa(t.title), y = ((b = u[0]) == null ? void 0 : b.productCount) || 0;
15662
15670
  return /* @__PURE__ */ o.jsxs("div", { className: "absolute inset-0 z-35 flex flex-col bg-[#FAFAFA] overflow-hidden", children: [
15663
15671
  /* @__PURE__ */ o.jsx("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-[#E2E8F0] bg-white shadow-sm", children: /* @__PURE__ */ o.jsxs(
15664
15672
  "button",
@@ -15738,7 +15746,7 @@ const Ni = (t, e) => {
15738
15746
  /* @__PURE__ */ o.jsx("span", { className: "text-[#64748B] text-xs cursor-help", title: "Select the quality tier that suits your needs", children: "ⓘ" })
15739
15747
  ] }),
15740
15748
  /* @__PURE__ */ o.jsx("div", { className: "p-4", children: d ? /* @__PURE__ */ o.jsx("div", { className: `grid ${f(u.length)} gap-3`, children: u.map((g) => {
15741
- const b = Bn[g.tierName];
15749
+ const m = Bn[g.tierName];
15742
15750
  return /* @__PURE__ */ o.jsxs(
15743
15751
  "div",
15744
15752
  {
@@ -15757,17 +15765,17 @@ const Ni = (t, e) => {
15757
15765
  ),
15758
15766
  /* @__PURE__ */ o.jsxs("div", { className: `p-3 flex-1 flex flex-col ${g.isRecommended ? "pt-7" : ""}`, children: [
15759
15767
  /* @__PURE__ */ o.jsxs("div", { className: "flex items-center gap-1.5 mb-2", children: [
15760
- /* @__PURE__ */ o.jsx("span", { className: "text-lg", children: b == null ? void 0 : b.emoji }),
15768
+ /* @__PURE__ */ o.jsx("span", { className: "text-lg", children: m == null ? void 0 : m.emoji }),
15761
15769
  /* @__PURE__ */ o.jsxs("div", { children: [
15762
15770
  /* @__PURE__ */ o.jsx(
15763
15771
  "span",
15764
15772
  {
15765
15773
  className: "font-bold text-sm block",
15766
- style: { color: (b == null ? void 0 : b.textColor) || z.foreground },
15774
+ style: { color: (m == null ? void 0 : m.textColor) || z.foreground },
15767
15775
  children: g.displayName
15768
15776
  }
15769
15777
  ),
15770
- /* @__PURE__ */ o.jsx("span", { className: "text-[10px] text-[#64748B] hidden md:block", children: g.description || (b == null ? void 0 : b.description) })
15778
+ /* @__PURE__ */ o.jsx("span", { className: "text-[10px] text-[#64748B] hidden md:block", children: g.description || (m == null ? void 0 : m.description) })
15771
15779
  ] })
15772
15780
  ] }),
15773
15781
  /* @__PURE__ */ o.jsx("div", { className: "flex items-center gap-1.5 mb-3 min-h-[42px] flex-wrap", children: g.brands.slice(0, 3).map((x) => /* @__PURE__ */ o.jsx(
@@ -15870,15 +15878,15 @@ const Ni = (t, e) => {
15870
15878
  ),
15871
15879
  n && /* @__PURE__ */ o.jsx("div", { className: "mt-3 space-y-4 bg-white rounded-xl border border-[#E2E8F0] p-3", children: u.map((g) => {
15872
15880
  if (g.products.length === 0) return null;
15873
- const b = Bn[g.tierName];
15881
+ const m = Bn[g.tierName];
15874
15882
  return /* @__PURE__ */ o.jsxs("div", { className: "space-y-2", children: [
15875
15883
  /* @__PURE__ */ o.jsxs("div", { className: "flex items-center gap-2 pb-1 border-b border-[#E2E8F0]", children: [
15876
- /* @__PURE__ */ o.jsx("span", { className: "text-lg", children: b == null ? void 0 : b.emoji }),
15884
+ /* @__PURE__ */ o.jsx("span", { className: "text-lg", children: m == null ? void 0 : m.emoji }),
15877
15885
  /* @__PURE__ */ o.jsx(
15878
15886
  "span",
15879
15887
  {
15880
15888
  className: "font-semibold text-sm",
15881
- style: { color: b == null ? void 0 : b.textColor },
15889
+ style: { color: m == null ? void 0 : m.textColor },
15882
15890
  children: g.displayName
15883
15891
  }
15884
15892
  ),
@@ -16001,9 +16009,9 @@ const Ni = (t, e) => {
16001
16009
  onInputBlur: f,
16002
16010
  chatEndRef: p,
16003
16011
  isMuted: y,
16004
- onToggleMute: m,
16012
+ onToggleMute: b,
16005
16013
  isSpeaking: g,
16006
- products: b,
16014
+ products: m,
16007
16015
  servicePackages: x,
16008
16016
  highlightedPartType: _,
16009
16017
  highlightedProduct: v,
@@ -16018,14 +16026,14 @@ const Ni = (t, e) => {
16018
16026
  pendingVariantMake: R,
16019
16027
  pendingVariantModel: N,
16020
16028
  onVariantSelect: K,
16021
- bobOffset: se = 0,
16022
- bobScale: re = 100
16029
+ bobOffset: X = 0,
16030
+ bobScale: se = 100
16023
16031
  }) => {
16024
- const [L, U] = H("center"), [Z, ce] = H("hidden"), [Y, C] = H("products"), [$, G] = H(null), [Q, Ee] = H(null), Oe = b.length > 0 || x.length > 0, Pe = ((j == null ? void 0 : j.length) ?? 0) > 0, $e = Oe || Pe, Xe = (Y === "productDetail" ? 70 : L === "center" && !$e ? 140 : 98) * re / 100;
16032
+ const [L, U] = H("center"), [Q, ce] = H("hidden"), [Z, C] = H("products"), [$, G] = H(null), [Y, Ee] = H(null), Oe = m.length > 0 || x.length > 0, Pe = ((j == null ? void 0 : j.length) ?? 0) > 0, $e = Oe || Pe, Xe = (Z === "productDetail" ? 70 : L === "center" && !$e ? 140 : 98) * se / 100;
16025
16033
  he(() => {
16026
- if (F && Z !== "loading" && Z !== "visible")
16034
+ if (F && Q !== "loading" && Q !== "visible")
16027
16035
  ce("loading"), L === "center" && U("partial-left");
16028
- else if ($e && Z !== "visible")
16036
+ else if ($e && Q !== "visible")
16029
16037
  if (L === "center") {
16030
16038
  U("partial-left"), ce("transitioning");
16031
16039
  const we = setTimeout(() => {
@@ -16034,8 +16042,8 @@ const Ni = (t, e) => {
16034
16042
  return () => clearTimeout(we);
16035
16043
  } else
16036
16044
  ce("visible");
16037
- else !$e && !F && Z !== "hidden" && (ce("hidden"), U("center"));
16038
- }, [$e, F, Z, L]);
16045
+ else !$e && !F && Q !== "hidden" && (ce("hidden"), U("center"));
16046
+ }, [$e, F, Q, L]);
16039
16047
  const ot = (we) => {
16040
16048
  if (D) {
16041
16049
  D(we), S == null || S(we);
@@ -16044,9 +16052,9 @@ const Ni = (t, e) => {
16044
16052
  G(we), C("productDetail"), S == null || S(we);
16045
16053
  }, O = () => {
16046
16054
  G(null), Ee(null), C("products");
16047
- }, te = (we) => {
16055
+ }, re = (we) => {
16048
16056
  console.log("[ContainedMobileBobLayout] Package selected:", we.title), Ee(we), C("packageDetail"), A == null || A(we);
16049
- }, Ne = Z !== "hidden" && Y === "products", ke = Z !== "hidden";
16057
+ }, Ne = Q !== "hidden" && Z === "products", ke = Q !== "hidden";
16050
16058
  return /* @__PURE__ */ o.jsxs(
16051
16059
  "div",
16052
16060
  {
@@ -16082,18 +16090,18 @@ const Ni = (t, e) => {
16082
16090
  counterHeightPercent: n,
16083
16091
  scale: Xe,
16084
16092
  position: L,
16085
- verticalOffset: se
16093
+ verticalOffset: X
16086
16094
  }
16087
16095
  ),
16088
16096
  /* @__PURE__ */ o.jsx(
16089
16097
  Hn,
16090
16098
  {
16091
- products: b,
16099
+ products: m,
16092
16100
  servicePackages: x,
16093
16101
  highlightedPartType: _,
16094
16102
  highlightedProduct: v,
16095
16103
  onProductClick: ot,
16096
- onPackageSelect: te,
16104
+ onPackageSelect: re,
16097
16105
  isResearching: F,
16098
16106
  visible: Ne,
16099
16107
  counterHeightPercent: n,
@@ -16105,7 +16113,7 @@ const Ni = (t, e) => {
16105
16113
  onVariantSelect: K
16106
16114
  }
16107
16115
  ),
16108
- Y === "productDetail" && $ && /* @__PURE__ */ o.jsx(
16116
+ Z === "productDetail" && $ && /* @__PURE__ */ o.jsx(
16109
16117
  Iu,
16110
16118
  {
16111
16119
  product: $,
@@ -16114,18 +16122,18 @@ const Ni = (t, e) => {
16114
16122
  onNavigateToProductPage: D
16115
16123
  }
16116
16124
  ),
16117
- Y === "packageDetail" && Q && /* @__PURE__ */ o.jsx(
16125
+ Z === "packageDetail" && Y && /* @__PURE__ */ o.jsx(
16118
16126
  Pu,
16119
16127
  {
16120
- package: Q,
16128
+ package: Y,
16121
16129
  onBack: O,
16122
16130
  onNavigateToProductPage: (we) => {
16123
- const oe = b.find((pt) => pt.sku === we);
16131
+ const oe = m.find((pt) => pt.sku === we);
16124
16132
  oe && D && D(oe);
16125
16133
  }
16126
16134
  }
16127
16135
  ),
16128
- Y === "products" && /* @__PURE__ */ o.jsx(
16136
+ Z === "products" && /* @__PURE__ */ o.jsx(
16129
16137
  Cu,
16130
16138
  {
16131
16139
  messages: i,
@@ -16138,7 +16146,7 @@ const Ni = (t, e) => {
16138
16146
  onInputBlur: f,
16139
16147
  chatEndRef: p,
16140
16148
  isMuted: y,
16141
- onToggleMute: m,
16149
+ onToggleMute: b,
16142
16150
  isSpeaking: g,
16143
16151
  counterHeightPercent: n
16144
16152
  }
@@ -16162,21 +16170,21 @@ const Ni = (t, e) => {
16162
16170
  }) => {
16163
16171
  var Xe, ot;
16164
16172
  const { callbacks: f } = Jt(), [p, y] = H(!1), {
16165
- animationState: m,
16173
+ animationState: b,
16166
16174
  setAnimationState: g,
16167
- getCurrentImage: b,
16175
+ getCurrentImage: m,
16168
16176
  getCurrentOffset: x,
16169
16177
  getCurrentScale: _,
16170
16178
  availableStates: v
16171
- } = lu({ isSpeaking: p }), { activeBackdrop: S } = cu(), [A, F] = H([]), [P, D] = H([]), [E, T] = H(null), [j, R] = H(null), [N, K] = H(!1), [se, re] = H([]), [L, U] = H(""), [Z, ce] = H(""), Y = ee(null), C = ee(null);
16179
+ } = lu({ isSpeaking: p }), { activeBackdrop: S } = cu(), [A, F] = H([]), [P, D] = H([]), [E, T] = H(null), [j, R] = H(null), [N, K] = H(!1), [X, se] = H([]), [L, U] = H(""), [Q, ce] = H(""), Z = te(null), C = te(null);
16172
16180
  he(() => {
16173
- Y.current = (O) => {
16181
+ Z.current = (O) => {
16174
16182
  if (K(!1), !O || O.length === 0) {
16175
16183
  console.log("[Bob] Clearing products (empty array received)"), F([]);
16176
16184
  return;
16177
16185
  }
16178
- const te = O[0];
16179
- console.log("[Bob] First part raw keys:", Object.keys(te));
16186
+ const re = O[0];
16187
+ console.log("[Bob] First part raw keys:", Object.keys(re));
16180
16188
  const Ne = O.map((oe, pt) => {
16181
16189
  const je = oe.Brand || oe.brand || "";
16182
16190
  return {
@@ -16216,10 +16224,10 @@ const Ni = (t, e) => {
16216
16224
  g(v.find((O) => O.includes("idle")) || "idle");
16217
16225
  },
16218
16226
  onResearchStart: () => {
16219
- K(!0), re([]), U(""), ce("");
16227
+ K(!0), se([]), U(""), ce("");
16220
16228
  },
16221
- onVariantSelectionRequired: (O, te, Ne) => {
16222
- K(!1), re(O), U(te), ce(Ne);
16229
+ onVariantSelectionRequired: (O, re, Ne) => {
16230
+ K(!1), se(O), U(re), ce(Ne);
16223
16231
  },
16224
16232
  onHighlightPart: (O) => {
16225
16233
  T(O), setTimeout(() => T(null), 8e3);
@@ -16232,35 +16240,35 @@ const Ni = (t, e) => {
16232
16240
  }
16233
16241
  });
16234
16242
  he(() => {
16235
- $.identifiedVehicle && (re([]), U(""), ce(""));
16243
+ $.identifiedVehicle && (se([]), U(""), ce(""));
16236
16244
  }, [(Xe = $.identifiedVehicle) == null ? void 0 : Xe.vehicle_id, (ot = $.identifiedVehicle) == null ? void 0 : ot.id]);
16237
16245
  const G = (O) => {
16238
- re([]), $.setInput(`Option ${O.optionNumber}`), setTimeout(() => {
16246
+ se([]), $.setInput(`Option ${O.optionNumber}`), setTimeout(() => {
16239
16247
  $.handleSend();
16240
16248
  }, 80);
16241
16249
  };
16242
16250
  he(() => {
16243
16251
  y($.isSpeaking);
16244
16252
  }, [$.isSpeaking]), he(() => {
16245
- const O = f.onPartsFound, te = f.onServicePackagesFound;
16253
+ const O = f.onPartsFound, re = f.onServicePackagesFound;
16246
16254
  return f.onPartsFound = (Ne) => {
16247
16255
  var ke;
16248
- (ke = Y.current) == null || ke.call(Y, Ne), O == null || O(Ne);
16256
+ (ke = Z.current) == null || ke.call(Z, Ne), O == null || O(Ne);
16249
16257
  }, f.onServicePackagesFound = (Ne) => {
16250
16258
  var ke;
16251
- (ke = C.current) == null || ke.call(C, Ne), te == null || te(Ne);
16259
+ (ke = C.current) == null || ke.call(C, Ne), re == null || re(Ne);
16252
16260
  }, () => {
16253
- f.onPartsFound = O, f.onServicePackagesFound = te;
16261
+ f.onPartsFound = O, f.onServicePackagesFound = re;
16254
16262
  };
16255
16263
  }, [f]);
16256
- const Q = n || (S == null ? void 0 : S.image_url), Ee = i || (S == null ? void 0 : S.counter_overlay_url) || void 0, Oe = a || (S == null ? void 0 : S.counter_height_percent) || 12, Pe = b() || l || "", $e = x(), Ye = _();
16264
+ const Y = n || (S == null ? void 0 : S.image_url), Ee = i || (S == null ? void 0 : S.counter_overlay_url) || void 0, Oe = a || (S == null ? void 0 : S.counter_height_percent) || 12, Pe = m() || l || "", $e = x(), Ye = _();
16257
16265
  if (t === "mobile" || t === "fullscreen")
16258
16266
  return /* @__PURE__ */ o.jsx(
16259
16267
  Ou,
16260
16268
  {
16261
16269
  currentImage: Pe,
16262
- animationState: m,
16263
- backdropUrl: Q,
16270
+ animationState: b,
16271
+ backdropUrl: Y,
16264
16272
  counterOverlayUrl: Ee,
16265
16273
  counterHeightPercent: Oe,
16266
16274
  bobOffset: $e,
@@ -16283,8 +16291,8 @@ const Ni = (t, e) => {
16283
16291
  highlightedPartType: E,
16284
16292
  highlightedProduct: j,
16285
16293
  onAddToCart: (O) => {
16286
- var te;
16287
- return (te = f.onAddToCart) == null ? void 0 : te.call(f, {
16294
+ var re;
16295
+ return (re = f.onAddToCart) == null ? void 0 : re.call(f, {
16288
16296
  product_id: O.id,
16289
16297
  product_name: O.name,
16290
16298
  quantity: 1,
@@ -16294,15 +16302,15 @@ const Ni = (t, e) => {
16294
16302
  });
16295
16303
  },
16296
16304
  onNavigateToProductPage: (O) => {
16297
- var te;
16298
- return (te = f.onNavigateToProductPage) == null ? void 0 : te.call(f, O);
16305
+ var re;
16306
+ return (re = f.onNavigateToProductPage) == null ? void 0 : re.call(f, O);
16299
16307
  },
16300
16308
  onPackageSelect: (O) => console.log("[BobWidget] Package selected:", O),
16301
16309
  isResearching: N,
16302
16310
  vehicle: $.identifiedVehicle,
16303
- pendingVariants: se,
16311
+ pendingVariants: X,
16304
16312
  pendingVariantMake: L,
16305
- pendingVariantModel: Z,
16313
+ pendingVariantModel: Q,
16306
16314
  onVariantSelect: G
16307
16315
  }
16308
16316
  );
@@ -16311,8 +16319,8 @@ const Ni = (t, e) => {
16311
16319
  Nu,
16312
16320
  {
16313
16321
  currentImage: Pe,
16314
- animationState: m,
16315
- backdropUrl: Q,
16322
+ animationState: b,
16323
+ backdropUrl: Y,
16316
16324
  counterOverlayUrl: Ee,
16317
16325
  counterHeightPercent: Oe,
16318
16326
  bobOffset: $e,
@@ -16334,8 +16342,8 @@ const Ni = (t, e) => {
16334
16342
  highlightedPartType: E,
16335
16343
  highlightedProduct: j,
16336
16344
  onAddToCart: (O) => {
16337
- var te;
16338
- return (te = f.onAddToCart) == null ? void 0 : te.call(f, {
16345
+ var re;
16346
+ return (re = f.onAddToCart) == null ? void 0 : re.call(f, {
16339
16347
  product_id: O.id,
16340
16348
  product_name: O.name,
16341
16349
  quantity: 1,
@@ -16345,15 +16353,15 @@ const Ni = (t, e) => {
16345
16353
  });
16346
16354
  },
16347
16355
  onNavigateToProductPage: (O) => {
16348
- var te;
16349
- return (te = f.onNavigateToProductPage) == null ? void 0 : te.call(f, O);
16356
+ var re;
16357
+ return (re = f.onNavigateToProductPage) == null ? void 0 : re.call(f, O);
16350
16358
  },
16351
16359
  onPackageSelect: (O) => console.log("[BobWidget] Package selected:", O),
16352
16360
  isResearching: N,
16353
16361
  vehicle: $.identifiedVehicle,
16354
- pendingVariants: se,
16362
+ pendingVariants: X,
16355
16363
  pendingVariantMake: L,
16356
- pendingVariantModel: Z,
16364
+ pendingVariantModel: Q,
16357
16365
  onVariantSelect: G
16358
16366
  }
16359
16367
  ) });
@@ -16366,8 +16374,8 @@ const Ni = (t, e) => {
16366
16374
  uu,
16367
16375
  {
16368
16376
  currentImage: Pe,
16369
- animationState: m,
16370
- backdropUrl: Q,
16377
+ animationState: b,
16378
+ backdropUrl: Y,
16371
16379
  counterOverlayUrl: Ee,
16372
16380
  counterHeightPercent: Oe,
16373
16381
  verticalOffset: $e,
@@ -16375,7 +16383,7 @@ const Ni = (t, e) => {
16375
16383
  }
16376
16384
  ),
16377
16385
  r && /* @__PURE__ */ o.jsx(
16378
- mu,
16386
+ bu,
16379
16387
  {
16380
16388
  messages: $.messages,
16381
16389
  input: $.input,
@@ -16408,21 +16416,21 @@ const Ni = (t, e) => {
16408
16416
  verticalOffset: f,
16409
16417
  scale: p,
16410
16418
  ga4Config: y,
16411
- analyticsEnabled: m = !0,
16419
+ analyticsEnabled: b = !0,
16412
16420
  bottomOffset: g = 0,
16413
- zIndexBase: b = 50,
16421
+ zIndexBase: m = 50,
16414
16422
  embedded: x = !1
16415
16423
  }) => (he(() => {
16416
16424
  console.log("[BobWidget] Initialized", {
16417
16425
  version: Gt,
16418
16426
  variant: n,
16419
16427
  bottomOffset: g,
16420
- zIndexBase: b,
16428
+ zIndexBase: m,
16421
16429
  bobConfigUrl: t.supabaseUrl,
16422
16430
  hostApiBaseUrl: e.baseUrl,
16423
- analyticsEnabled: m
16431
+ analyticsEnabled: b
16424
16432
  });
16425
- }, [n, g, b, t.supabaseUrl, e.baseUrl, m]), /* @__PURE__ */ o.jsx("div", { className: "bob-widget-root", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ o.jsx(
16433
+ }, [n, g, m, t.supabaseUrl, e.baseUrl, b]), /* @__PURE__ */ o.jsx("div", { className: "bob-widget-root", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ o.jsx(
16426
16434
  _a,
16427
16435
  {
16428
16436
  bobConfig: t,
@@ -16430,9 +16438,9 @@ const Ni = (t, e) => {
16430
16438
  hostContext: r,
16431
16439
  callbacks: s,
16432
16440
  ga4Config: y,
16433
- analyticsEnabled: m,
16441
+ analyticsEnabled: b,
16434
16442
  bottomOffset: g,
16435
- zIndexBase: b,
16443
+ zIndexBase: m,
16436
16444
  children: /* @__PURE__ */ o.jsx(
16437
16445
  Ca,
16438
16446
  {
@@ -16634,27 +16642,27 @@ function Du(t) {
16634
16642
  throw new Error(`Failed to load partner config: ${y.message}`);
16635
16643
  if (!p)
16636
16644
  throw new Error(`Partner "${t}" not found or inactive`);
16637
- const m = p, g = typeof window < "u" ? window.location.origin : "", b = $u(m.allowed_origins || [], g);
16638
- !b && g && (console.warn(`[BobWidget] Origin "${g}" not in allowed origins for ${t}`), console.warn("[BobWidget] Allowed origins:", m.allowed_origins));
16645
+ const b = p, g = typeof window < "u" ? window.location.origin : "", m = $u(b.allowed_origins || [], g);
16646
+ !m && g && (console.warn(`[BobWidget] Origin "${g}" not in allowed origins for ${t}`), console.warn("[BobWidget] Allowed origins:", b.allowed_origins));
16639
16647
  const x = vn(
16640
- m.bob_supabase_url || Fi,
16641
- m.bob_supabase_key || Bi,
16648
+ b.bob_supabase_url || Fi,
16649
+ b.bob_supabase_key || Bi,
16642
16650
  {
16643
16651
  auth: {
16644
- storageKey: `bobwidget_${m.partner_code.toLowerCase()}`,
16652
+ storageKey: `bobwidget_${b.partner_code.toLowerCase()}`,
16645
16653
  persistSession: !1,
16646
16654
  autoRefreshToken: !1
16647
16655
  }
16648
16656
  }
16649
16657
  );
16650
16658
  console.log("[BobWidget] Partner config loaded:", {
16651
- partner: m.partner_code,
16652
- displayName: m.display_name,
16653
- bottomOffset: m.default_bottom_offset,
16654
- blurIntensity: m.backdrop_blur_intensity,
16655
- features: m.feature_flags,
16656
- originAllowed: b
16657
- }), r(m), c(b), d(x);
16659
+ partner: b.partner_code,
16660
+ displayName: b.display_name,
16661
+ bottomOffset: b.default_bottom_offset,
16662
+ blurIntensity: b.backdrop_blur_intensity,
16663
+ features: b.feature_flags,
16664
+ originAllowed: m
16665
+ }), r(b), c(m), d(x);
16658
16666
  } catch (f) {
16659
16667
  const p = f instanceof Error ? f : new Error("Unknown error loading partner config");
16660
16668
  console.error("[BobWidget] Partner config error:", p), a(p);
@@ -16749,7 +16757,7 @@ const Mu = () => /* @__PURE__ */ o.jsxs("div", { className: "bob-widget-root", s
16749
16757
  debug: d = !1,
16750
16758
  className: h = ""
16751
16759
  }) => {
16752
- const { config: f, isLoading: p, error: y, supabaseClient: m } = Du(t);
16760
+ const { config: f, isLoading: p, error: y, supabaseClient: b } = Du(t);
16753
16761
  he(() => {
16754
16762
  console.log("[BobStandalone] Initialized", {
16755
16763
  version: Gt,
@@ -16766,10 +16774,10 @@ const Mu = () => /* @__PURE__ */ o.jsxs("div", { className: "bob-widget-root", s
16766
16774
  const A = S;
16767
16775
  A != null && A.sku && l(`/product/${A.sku}`);
16768
16776
  } : void 0
16769
- }), [a, l, c, u]), b = Tt(() => ({}), []);
16777
+ }), [a, l, c, u]), m = Tt(() => ({}), []);
16770
16778
  if (p)
16771
16779
  return /* @__PURE__ */ o.jsx(Mu, {});
16772
- if (y || !f || !m) {
16780
+ if (y || !f || !b) {
16773
16781
  const S = y || new Error("Failed to initialize Bob");
16774
16782
  return u == null || u(S), /* @__PURE__ */ o.jsx(Wu, { error: S, partner: t });
16775
16783
  }
@@ -16799,7 +16807,7 @@ const Mu = () => /* @__PURE__ */ o.jsxs("div", { className: "bob-widget-root", s
16799
16807
  // API key is handled server-side via config.api_key_secret_name
16800
16808
  partnerCode: f.partner_code
16801
16809
  },
16802
- hostContext: b,
16810
+ hostContext: m,
16803
16811
  callbacks: g,
16804
16812
  bottomOffset: x,
16805
16813
  zIndexBase: _,
@@ -16831,17 +16839,17 @@ const Mu = () => /* @__PURE__ */ o.jsxs("div", { className: "bob-widget-root", s
16831
16839
  onPositionChange: n,
16832
16840
  currentPosition: i = "center"
16833
16841
  }) => {
16834
- const [a, l] = H(!1), [c, u] = H(0), d = ee(null), h = ee(0), f = ee(0), p = ee(!1), y = 0.25;
16842
+ const [a, l] = H(!1), [c, u] = H(0), d = te(null), h = te(0), f = te(0), p = te(!1), y = 0.25;
16835
16843
  he(() => {
16836
16844
  e && i === "hidden" && (n == null || n("partial-left"), s == null || s(!0));
16837
16845
  }, [e, i, n, s]);
16838
- const m = V((v) => {
16846
+ const b = V((v) => {
16839
16847
  h.current = v.touches[0].clientX, f.current = v.touches[0].clientY, p.current = !1, l(!0);
16840
16848
  }, []), g = V((v) => {
16841
16849
  if (!a) return;
16842
16850
  const S = v.touches[0].clientX, A = v.touches[0].clientY, F = S - h.current, P = A - f.current;
16843
16851
  !p.current && Math.abs(F) > 10 && (p.current = Math.abs(F) > Math.abs(P)), p.current && (v.preventDefault(), u(F));
16844
- }, [a]), b = V(() => {
16852
+ }, [a]), m = V(() => {
16845
16853
  var P;
16846
16854
  if (!a) return;
16847
16855
  l(!1);
@@ -16864,9 +16872,9 @@ const Mu = () => /* @__PURE__ */ o.jsxs("div", { className: "bob-widget-root", s
16864
16872
  transition: a ? "none" : "transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)",
16865
16873
  willChange: "transform"
16866
16874
  },
16867
- onTouchStart: m,
16875
+ onTouchStart: b,
16868
16876
  onTouchMove: g,
16869
- onTouchEnd: b,
16877
+ onTouchEnd: m,
16870
16878
  children: [
16871
16879
  t,
16872
16880
  i === "center" && !a && /* @__PURE__ */ o.jsx(
@@ -16971,7 +16979,7 @@ function qu() {
16971
16979
  return Ss({
16972
16980
  queryKey: ["bob-theme-settings"],
16973
16981
  queryFn: async () => {
16974
- var d, h, f, p, y, m, g, b, x, _, v;
16982
+ var d, h, f, p, y, b, g, m, x, _, v;
16975
16983
  if (!t)
16976
16984
  return console.log("[useThemeSettings] No supabase client, using defaults"), Bt;
16977
16985
  const { data: e, error: r } = await t.from("bob_theme_settings").select("setting_key, color_value, hex_preview").in("setting_key", [
@@ -16986,7 +16994,7 @@ function qu() {
16986
16994
  return console.error("[useThemeSettings] Error fetching:", r), Bt;
16987
16995
  if (!e || e.length === 0)
16988
16996
  return Bt;
16989
- const s = new Map(e.map((S) => [S.setting_key, S])), n = ((d = s.get("matrix_primary")) == null ? void 0 : d.color_value) || Bt.primary, i = ((h = s.get("matrix_secondary")) == null ? void 0 : h.color_value) || Bt.secondary, a = ((f = s.get("matrix_success")) == null ? void 0 : f.color_value) || Bt.success, l = ((p = s.get("matrix_background")) == null ? void 0 : p.color_value) || Bt.background, c = ((y = s.get("matrix_spark_deal_color")) == null ? void 0 : y.color_value) || Bt.sparkDealColor, u = ((m = s.get("matrix_background_mode")) == null ? void 0 : m.color_value) || "dark";
16997
+ const s = new Map(e.map((S) => [S.setting_key, S])), n = ((d = s.get("matrix_primary")) == null ? void 0 : d.color_value) || Bt.primary, i = ((h = s.get("matrix_secondary")) == null ? void 0 : h.color_value) || Bt.secondary, a = ((f = s.get("matrix_success")) == null ? void 0 : f.color_value) || Bt.success, l = ((p = s.get("matrix_background")) == null ? void 0 : p.color_value) || Bt.background, c = ((y = s.get("matrix_spark_deal_color")) == null ? void 0 : y.color_value) || Bt.sparkDealColor, u = ((b = s.get("matrix_background_mode")) == null ? void 0 : b.color_value) || "dark";
16990
16998
  return {
16991
16999
  primary: n,
16992
17000
  secondary: i,
@@ -16995,7 +17003,7 @@ function qu() {
16995
17003
  backgroundMode: u,
16996
17004
  sparkDealColor: c,
16997
17005
  primaryHex: ((g = s.get("matrix_primary")) == null ? void 0 : g.hex_preview) || rs(n),
16998
- secondaryHex: ((b = s.get("matrix_secondary")) == null ? void 0 : b.hex_preview) || rs(i),
17006
+ secondaryHex: ((m = s.get("matrix_secondary")) == null ? void 0 : m.hex_preview) || rs(i),
16999
17007
  successHex: ((x = s.get("matrix_success")) == null ? void 0 : x.hex_preview) || rs(a),
17000
17008
  backgroundHex: ((_ = s.get("matrix_background")) == null ? void 0 : _.hex_preview) || rs(l),
17001
17009
  sparkDealHex: ((v = s.get("matrix_spark_deal_color")) == null ? void 0 : v.hex_preview) || rs(c)
@@ -17088,16 +17096,16 @@ const Vu = ({
17088
17096
  he(() => {
17089
17097
  if (!d) return;
17090
17098
  l(!0), u(100);
17091
- const m = setTimeout(() => {
17099
+ const b = setTimeout(() => {
17092
17100
  u(0);
17093
17101
  }, 50), g = setTimeout(() => {
17094
17102
  u(-100);
17095
- }, n - 500), b = setTimeout(() => {
17103
+ }, n - 500), m = setTimeout(() => {
17096
17104
  const x = (e + 1) % t.length;
17097
17105
  r(x), l(!1);
17098
17106
  }, n);
17099
17107
  return () => {
17100
- clearTimeout(m), clearTimeout(g), clearTimeout(b);
17108
+ clearTimeout(b), clearTimeout(g), clearTimeout(m);
17101
17109
  };
17102
17110
  }, [e, d, n, t.length, r]);
17103
17111
  const p = V(() => {
@@ -17224,7 +17232,7 @@ const Vu = ({
17224
17232
  )
17225
17233
  }
17226
17234
  ),
17227
- t.length > 1 && /* @__PURE__ */ o.jsx("div", { className: "absolute bottom-1 left-0 right-0 flex justify-center gap-1.5", children: t.map((m, g) => /* @__PURE__ */ o.jsx(
17235
+ t.length > 1 && /* @__PURE__ */ o.jsx("div", { className: "absolute bottom-1 left-0 right-0 flex justify-center gap-1.5", children: t.map((b, g) => /* @__PURE__ */ o.jsx(
17228
17236
  "div",
17229
17237
  {
17230
17238
  className: "w-1.5 h-1.5 rounded-full transition-all",
@@ -17329,7 +17337,7 @@ const Vu = ({
17329
17337
  onSparkDealClick: s,
17330
17338
  subliminalBrands: n = []
17331
17339
  }) => {
17332
- const i = ee(null), a = ee(), l = ee([]), c = ee(0), [u, d] = H(0), [h, f] = H(!1), [p, y] = H(0), { data: m } = qu(), { data: g } = zu(), { data: b } = Hu(t !== "hidden" && (g == null ? void 0 : g.enabled)), x = m || {
17340
+ const i = te(null), a = te(), l = te([]), c = te(0), [u, d] = H(0), [h, f] = H(!1), [p, y] = H(0), { data: b } = qu(), { data: g } = zu(), { data: m } = Hu(t !== "hidden" && (g == null ? void 0 : g.enabled)), x = b || {
17333
17341
  primaryHex: "#0066CC",
17334
17342
  // CARFIX Blue
17335
17343
  secondaryHex: "#004999",
@@ -17350,22 +17358,22 @@ const Vu = ({
17350
17358
  scrollSpeed: 5e3,
17351
17359
  maxPerSession: 3,
17352
17360
  minResearchTime: 1500
17353
- }, v = b && _.inRain ? [...Ku(b), ...n] : n, S = 0.08, A = V(() => v.length > 0 && Math.random() < S ? { char: v[Math.floor(Math.random() * v.length)], isSubliminal: !0 } : Math.random() < 0.15 ? { char: $i[Math.floor(Math.random() * $i.length)], isSubliminal: !1 } : {
17361
+ }, v = m && _.inRain ? [...Ku(m), ...n] : n, S = 0.08, A = V(() => v.length > 0 && Math.random() < S ? { char: v[Math.floor(Math.random() * v.length)], isSubliminal: !0 } : Math.random() < 0.15 ? { char: $i[Math.floor(Math.random() * $i.length)], isSubliminal: !1 } : {
17354
17362
  char: Li[Math.floor(Math.random() * Li.length)],
17355
17363
  isSubliminal: !1
17356
17364
  }, [v]), F = V((T, j) => T.isSubliminal ? x.sparkDealHex : t === "success" ? x.successHex : Math.sin(j * 2 + T.x * 0.01) * 0.5 + 0.5 > 0.5 ? x.primaryHex : x.secondaryHex, [t, x]), P = V((T, j) => {
17357
17365
  const R = [], N = Math.floor(T / 25);
17358
17366
  for (let K = 0; K < N; K++) {
17359
- const { char: se, isSubliminal: re } = A();
17367
+ const { char: X, isSubliminal: se } = A();
17360
17368
  R.push({
17361
17369
  x: K * 25 + 12,
17362
17370
  y: Math.random() * j,
17363
17371
  speed: 1.5 + Math.random() * 3.5,
17364
- char: se,
17365
- isSubliminal: re,
17372
+ char: X,
17373
+ isSubliminal: se,
17366
17374
  opacity: 0.2 + Math.random() * 0.6,
17367
- size: re ? 13 : 9 + Math.random() * 3,
17368
- glowIntensity: re ? 0.6 : 0,
17375
+ size: se ? 13 : 9 + Math.random() * 3,
17376
+ glowIntensity: se ? 0.6 : 0,
17369
17377
  changeCounter: Math.floor(Math.random() * 30)
17370
17378
  // When to change character
17371
17379
  });
@@ -17386,20 +17394,20 @@ const Vu = ({
17386
17394
  };
17387
17395
  R(), c.current = Date.now();
17388
17396
  const N = () => {
17389
- const K = T.offsetWidth, se = T.offsetHeight, L = (Date.now() - c.current) / 1e3;
17390
- if (j.clearRect(0, 0, K, se), l.current.forEach((U) => {
17391
- const Z = F(U, L);
17392
- if (j.font = `bold ${U.size}px monospace`, j.fillStyle = Z, j.globalAlpha = U.opacity, U.isSubliminal && U.glowIntensity > 0 ? (j.shadowColor = x.sparkDealHex, j.shadowBlur = 8 * U.glowIntensity) : j.shadowBlur = 0, j.fillText(U.char, U.x, U.y), U.y += U.speed, U.changeCounter++, U.changeCounter > 20 + Math.random() * 40) {
17393
- const { char: ce, isSubliminal: Y } = A();
17394
- U.char = ce, U.isSubliminal = Y, U.size = Y ? 13 : 9 + Math.random() * 3, U.glowIntensity = Y ? 0.6 : 0, U.changeCounter = 0;
17397
+ const K = T.offsetWidth, X = T.offsetHeight, L = (Date.now() - c.current) / 1e3;
17398
+ if (j.clearRect(0, 0, K, X), l.current.forEach((U) => {
17399
+ const Q = F(U, L);
17400
+ if (j.font = `bold ${U.size}px monospace`, j.fillStyle = Q, j.globalAlpha = U.opacity, U.isSubliminal && U.glowIntensity > 0 ? (j.shadowColor = x.sparkDealHex, j.shadowBlur = 8 * U.glowIntensity) : j.shadowBlur = 0, j.fillText(U.char, U.x, U.y), U.y += U.speed, U.changeCounter++, U.changeCounter > 20 + Math.random() * 40) {
17401
+ const { char: ce, isSubliminal: Z } = A();
17402
+ U.char = ce, U.isSubliminal = Z, U.size = Z ? 13 : 9 + Math.random() * 3, U.glowIntensity = Z ? 0.6 : 0, U.changeCounter = 0;
17395
17403
  }
17396
- if (U.y > se + 20) {
17397
- const { char: ce, isSubliminal: Y } = A();
17398
- U.y = -20, U.char = ce, U.isSubliminal = Y, U.speed = 1.5 + Math.random() * 3.5, U.opacity = 0.2 + Math.random() * 0.6, U.size = Y ? 13 : 9 + Math.random() * 3, U.glowIntensity = Y ? 0.6 : 0, U.changeCounter = 0;
17404
+ if (U.y > X + 20) {
17405
+ const { char: ce, isSubliminal: Z } = A();
17406
+ U.y = -20, U.char = ce, U.isSubliminal = Z, U.speed = 1.5 + Math.random() * 3.5, U.opacity = 0.2 + Math.random() * 0.6, U.size = Z ? 13 : 9 + Math.random() * 3, U.glowIntensity = Z ? 0.6 : 0, U.changeCounter = 0;
17399
17407
  }
17400
17408
  }), j.globalAlpha = 1, j.shadowBlur = 0, t === "success") {
17401
17409
  const U = Math.max(0, 1 - L * 2);
17402
- U > 0 && (j.fillStyle = `rgba(255, 149, 0, ${U * 0.3})`, j.fillRect(0, 0, K, se)), L > 0.5 && r && r();
17410
+ U > 0 && (j.fillStyle = `rgba(255, 149, 0, ${U * 0.3})`, j.fillRect(0, 0, K, X)), L > 0.5 && r && r();
17403
17411
  }
17404
17412
  a.current = requestAnimationFrame(N);
17405
17413
  };
@@ -17407,7 +17415,7 @@ const Vu = ({
17407
17415
  a.current && cancelAnimationFrame(a.current), window.removeEventListener("resize", R);
17408
17416
  };
17409
17417
  }, [t, x, A, F, P, r]), he(() => {
17410
- if (t === "hidden" || !b || b.length === 0 || !_.bannerEnabled) {
17418
+ if (t === "hidden" || !m || m.length === 0 || !_.bannerEnabled) {
17411
17419
  f(!1);
17412
17420
  return;
17413
17421
  }
@@ -17417,7 +17425,7 @@ const Vu = ({
17417
17425
  f(!0);
17418
17426
  }, _.delayMs);
17419
17427
  return () => clearTimeout(T);
17420
- }, [t, b, _, p]);
17428
+ }, [t, m, _, p]);
17421
17429
  const D = V((T) => {
17422
17430
  d(T), y((j) => j + 1);
17423
17431
  }, []), E = V((T) => {
@@ -17437,10 +17445,10 @@ const Vu = ({
17437
17445
  style: { opacity: 0.85 }
17438
17446
  }
17439
17447
  ),
17440
- h && b && b.length > 0 && /* @__PURE__ */ o.jsx(
17448
+ h && m && m.length > 0 && /* @__PURE__ */ o.jsx(
17441
17449
  Vu,
17442
17450
  {
17443
- deals: b.slice(0, _.maxPerSession),
17451
+ deals: m.slice(0, _.maxPerSession),
17444
17452
  currentDealIndex: u,
17445
17453
  onDealChange: D,
17446
17454
  onDealClick: E,
@@ -17467,9 +17475,9 @@ const Vu = ({
17467
17475
  vehicle: f,
17468
17476
  onChangeVehicle: p,
17469
17477
  bobOffset: y = 0,
17470
- bobScale: m = 100,
17478
+ bobScale: b = 100,
17471
17479
  bobHasArrived: g = !0,
17472
- externalBobPosition: b,
17480
+ externalBobPosition: m,
17473
17481
  onBobPositionChange: x,
17474
17482
  // NEW: Variant selection props
17475
17483
  pendingVariants: _,
@@ -17477,9 +17485,9 @@ const Vu = ({
17477
17485
  pendingVariantModel: S,
17478
17486
  onVariantSelect: A
17479
17487
  }) => {
17480
- const F = Gs(), P = qn(), [D, E] = H("center"), [T, j] = H("hidden"), R = b ?? D, N = V((C) => {
17488
+ const F = Gs(), P = qn(), [D, E] = H("center"), [T, j] = H("hidden"), R = m ?? D, N = V((C) => {
17481
17489
  E(C), x == null || x(C);
17482
- }, [x]), K = i.length > 0 || a.length > 0, se = ((_ == null ? void 0 : _.length) ?? 0) > 0, re = K || se, Z = (() => {
17490
+ }, [x]), K = i.length > 0 || a.length > 0, X = ((_ == null ? void 0 : _.length) ?? 0) > 0, se = K || X, Q = (() => {
17483
17491
  switch (F) {
17484
17492
  case "desktop":
17485
17493
  return 80 * P.uiScale;
@@ -17490,11 +17498,11 @@ const Vu = ({
17490
17498
  default:
17491
17499
  return 140;
17492
17500
  }
17493
- })() * m / 100;
17501
+ })() * b / 100;
17494
17502
  he(() => {
17495
17503
  if (h && T !== "loading" && T !== "visible")
17496
17504
  j("loading"), R === "center" && N("partial-left");
17497
- else if (re && T !== "visible")
17505
+ else if (se && T !== "visible")
17498
17506
  if (R === "center") {
17499
17507
  N("partial-left"), j("transitioning");
17500
17508
  const C = setTimeout(() => {
@@ -17503,9 +17511,9 @@ const Vu = ({
17503
17511
  return () => clearTimeout(C);
17504
17512
  } else
17505
17513
  j("visible");
17506
- else !re && !h && T !== "hidden" && (j("hidden"), N("center"));
17507
- }, [re, h, T, R, N]);
17508
- const ce = T !== "hidden", Y = ce && re;
17514
+ else !se && !h && T !== "hidden" && (j("hidden"), N("center"));
17515
+ }, [se, h, T, R, N]);
17516
+ const ce = T !== "hidden", Z = ce && se;
17509
17517
  return /* @__PURE__ */ o.jsxs(
17510
17518
  "div",
17511
17519
  {
@@ -17527,8 +17535,8 @@ const Vu = ({
17527
17535
  className: "absolute inset-0 z-0 w-full h-full object-cover object-center transition-all duration-500",
17528
17536
  style: {
17529
17537
  pointerEvents: "none",
17530
- filter: Y ? "blur(var(--bob-blur-intensity, 0px))" : "none",
17531
- transform: Y ? "scale(1.02)" : "scale(1)",
17538
+ filter: Z ? "blur(var(--bob-blur-intensity, 0px))" : "none",
17539
+ transform: Z ? "scale(1.02)" : "scale(1)",
17532
17540
  WebkitTouchCallout: "none",
17533
17541
  WebkitUserSelect: "none",
17534
17542
  userSelect: "none"
@@ -17542,7 +17550,7 @@ const Vu = ({
17542
17550
  className: "absolute inset-0 z-[1] transition-opacity duration-500 pointer-events-none",
17543
17551
  style: {
17544
17552
  background: "rgba(0, 0, 0, var(--bob-overlay-opacity, 0.1))",
17545
- opacity: Y ? 1 : 0
17553
+ opacity: Z ? 1 : 0
17546
17554
  }
17547
17555
  }
17548
17556
  )
@@ -17554,7 +17562,7 @@ const Vu = ({
17554
17562
  animationState: e,
17555
17563
  counterOverlayUrl: s,
17556
17564
  counterHeightPercent: n,
17557
- scale: Z,
17565
+ scale: Q,
17558
17566
  position: R,
17559
17567
  verticalOffset: y,
17560
17568
  hasArrived: g
@@ -17587,7 +17595,7 @@ const Vu = ({
17587
17595
  setAnimationState: e,
17588
17596
  manualMode: r
17589
17597
  }) => {
17590
- const [s, n] = H("page_load"), [i, a] = H(!1), l = ee(null), c = V((E) => {
17598
+ const [s, n] = H("page_load"), [i, a] = H(!1), l = te(null), c = V((E) => {
17591
17599
  const T = t.find((j) => j.chat_trigger === E && j.is_active);
17592
17600
  return console.log(`[StateTransitions] Looking for trigger: "${E}" -> found:`, (T == null ? void 0 : T.state_key) || "none"), T;
17593
17601
  }, [t]), u = V(() => t.find(
@@ -17613,14 +17621,14 @@ const Vu = ({
17613
17621
  pauseDuration: (T == null ? void 0 : T.pause_duration) || 0,
17614
17622
  loopCount: (T == null ? void 0 : T.loop_count) || 0
17615
17623
  };
17616
- }, [t]), m = V(() => {
17624
+ }, [t]), b = V(() => {
17617
17625
  l.current && (clearTimeout(l.current), l.current = null);
17618
17626
  }, []), g = V(() => {
17619
- m(), !r && (l.current = setTimeout(() => {
17627
+ b(), !r && (l.current = setTimeout(() => {
17620
17628
  const E = p();
17621
17629
  E && (n("idle"), e(E.state_key));
17622
17630
  }, Gu));
17623
- }, [r, p, e, m]), b = V((E) => {
17631
+ }, [r, p, e, b]), m = V((E) => {
17624
17632
  if (r) return;
17625
17633
  const T = c(E);
17626
17634
  T && e(T.state_key);
@@ -17629,28 +17637,28 @@ const Vu = ({
17629
17637
  const E = h();
17630
17638
  E && (n("awaiting_input"), e(E.state_key), g());
17631
17639
  }, [r, h, e, g]), _ = V(() => {
17632
- i || r || (a(!0), n("page_load"), b("page_load"), setTimeout(() => {
17640
+ i || r || (a(!0), n("page_load"), m("page_load"), setTimeout(() => {
17633
17641
  x();
17634
17642
  }, 3e3));
17635
- }, [i, r, b, x]), v = V(() => {
17643
+ }, [i, r, m, x]), v = V(() => {
17636
17644
  if (r) return;
17637
- m(), n("processing_input");
17645
+ b(), n("processing_input");
17638
17646
  const E = u();
17639
- console.log("[StateTransitions] User input - switching to RESEARCH:", E == null ? void 0 : E.state_key), E ? e(E.state_key) : b("processing_input");
17640
- }, [r, m, u, e, b]), S = V(() => {
17647
+ console.log("[StateTransitions] User input - switching to RESEARCH:", E == null ? void 0 : E.state_key), E ? e(E.state_key) : m("processing_input");
17648
+ }, [r, b, u, e, m]), S = V(() => {
17641
17649
  if (r) return;
17642
- m(), n("streaming_response");
17650
+ b(), n("streaming_response");
17643
17651
  const E = d();
17644
17652
  console.log("[StateTransitions] Speech started - switching to TALK:", E == null ? void 0 : E.state_key), E && e(E.state_key);
17645
- }, [r, m, d, e]), A = V(() => {
17653
+ }, [r, b, d, e]), A = V(() => {
17646
17654
  if (r) return;
17647
17655
  const E = f();
17648
17656
  console.log("[StateTransitions] Speech ended - switching to COMPLETE:", E == null ? void 0 : E.state_key), E && e(E.state_key), setTimeout(() => {
17649
17657
  r || x();
17650
17658
  }, 2e3);
17651
17659
  }, [r, f, e, x]), F = V(() => {
17652
- m(), n("streaming_response"), console.log("[StateTransitions] Stream started (API response)");
17653
- }, [m]), P = V(() => {
17660
+ b(), n("streaming_response"), console.log("[StateTransitions] Stream started (API response)");
17661
+ }, [b]), P = V(() => {
17654
17662
  n("response_complete"), console.log("[StateTransitions] Stream complete (API finished)");
17655
17663
  const E = f();
17656
17664
  E && e(E.state_key), setTimeout(() => {
@@ -17666,7 +17674,7 @@ const Vu = ({
17666
17674
  x();
17667
17675
  }, 3e3);
17668
17676
  }, [r, t, e, x]);
17669
- return he(() => () => m(), [m]), {
17677
+ return he(() => () => b(), [b]), {
17670
17678
  chatStage: s,
17671
17679
  initialize: _,
17672
17680
  onUserInput: v,
@@ -17723,8 +17731,8 @@ const Vu = ({
17723
17731
  frameCount: 0
17724
17732
  };
17725
17733
  const l = (i == null ? void 0 : i.map((y) => y.state_key)) || [], u = ["idle", "talking", "listening"].filter((y) => {
17726
- const m = [y, y.replace("ing", ""), y + "ing"];
17727
- return !l.some((g) => m.includes(g));
17734
+ const b = [y, y.replace("ing", ""), y + "ing"];
17735
+ return !l.some((g) => b.includes(g));
17728
17736
  }), { data: d, error: h } = await t.from("bob_animations").select("id").eq("is_active", !0).eq("look_id", n.id), f = h ? 0 : (d == null ? void 0 : d.length) || 0, p = l.length >= 4 && f > 0 && u.length === 0;
17729
17737
  return {
17730
17738
  healthy: p,
@@ -17760,7 +17768,7 @@ export {
17760
17768
  Ea as BobSuggestions,
17761
17769
  sd as BobWidget,
17762
17770
  z as CARFIX_COLORS,
17763
- mu as ChatInterface,
17771
+ bu as ChatInterface,
17764
17772
  Cu as ContainedChatDrawer,
17765
17773
  Nu as ContainedMobileBobLayout,
17766
17774
  Ws as IMAGE_URLS,
@@ -17776,7 +17784,7 @@ export {
17776
17784
  Pu as ServicePackageDetailView,
17777
17785
  Vu as SparkDealBanner,
17778
17786
  id as SwipeableBob,
17779
- mt as TYPOGRAPHY,
17787
+ bt as TYPOGRAPHY,
17780
17788
  tt as formatNZD,
17781
17789
  Yu as getBobVersion,
17782
17790
  pu as getDisplayPrice,