@gengage/assistant-fe 0.6.0 → 0.6.1

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.
@@ -1,11 +1,11 @@
1
- import { C as L, D as j, M as q, O as le, S as de, T as O, _ as fe, a as ge, b as $, c as pe, d as C, f as D, g as me, h as we, i as he, j as M, k as ye, l as be, m as Se, n as Ee, o as Ae, p as Re, r as ve, s as Te, t as Ue, u as xe, v as Pe, w as _e, x as Le, y as je } from "../beauty-consulting-turn-BmPXbkQg.js";
2
- function B({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl: o, tokenBrokerAudience: c, defaultLocale: i, tools: g = {}, beacon: w }) {
3
- let m = 1;
1
+ import { C as j, D as q, M as _, O as ue, S as le, T as D, _ as de, a as fe, b as O, c as ge, d as $, f as C, g as pe, h as we, i as me, j as M, k as he, l as ye, m as be, n as Se, o as Ee, p as Re, r as Ae, s as ve, t as Te, u as Ue, v as xe, w as Pe, x as Le, y as je } from "../beauty-consulting-turn-BmPXbkQg.js";
2
+ function B({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl: o, tokenBrokerAudience: i, defaultLocale: c, tools: g = {}, beacon: m }) {
3
+ let w = 1;
4
4
  const d = /* @__PURE__ */ new Map();
5
5
  return M({
6
6
  worker: t,
7
7
  tools: g,
8
- beacon: (u) => w?.({
8
+ beacon: (u) => m?.({
9
9
  ...u,
10
10
  accountId: u.accountId || e
11
11
  }),
@@ -26,7 +26,7 @@ function B({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl:
26
26
  a.type === "end" && d.delete(s);
27
27
  }
28
28
  }), (u, a, s) => {
29
- const l = m++;
29
+ const l = w++;
30
30
  d.set(l, a);
31
31
  const p = () => {
32
32
  d.delete(l), t.postMessage({
@@ -45,42 +45,42 @@ function B({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl:
45
45
  beUrl: r,
46
46
  devJwtSecret: n,
47
47
  tokenBrokerUrl: o,
48
- tokenBrokerAudience: c,
49
- defaultLocale: i,
48
+ tokenBrokerAudience: i,
49
+ defaultLocale: c,
50
50
  request: u,
51
51
  parentUrl: window.location.href
52
52
  });
53
53
  };
54
54
  }
55
- function F({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl: o, tokenBrokerAudience: c, defaultLocale: i, tools: g = {}, beacon: w }) {
56
- let m = null;
57
- const d = k({
55
+ function k({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl: o, tokenBrokerAudience: i, defaultLocale: c, tools: g = {}, beacon: m }) {
56
+ let w = null;
57
+ const d = F({
58
58
  accountId: e,
59
59
  tools: g,
60
- beacon: w
61
- }), u = C(d), a = O({
60
+ beacon: m
61
+ }), u = $(d), a = D({
62
62
  accountId: e,
63
63
  ...n ? { devJwtSecret: n } : {},
64
64
  ...o ? { tokenBrokerUrl: o } : {},
65
- ...c ? { tokenBrokerAudience: c } : {}
65
+ ...i ? { tokenBrokerAudience: i } : {}
66
66
  });
67
67
  return async (s, l, p) => {
68
- m ||= new j({
68
+ w ||= new q({
69
69
  accountId: e,
70
- locale: s?.locale || i,
70
+ locale: s?.locale || c,
71
71
  parentUrl: window.location.href,
72
72
  rpc: d
73
73
  });
74
74
  try {
75
- await D({
75
+ await C({
76
76
  request: s || {},
77
77
  accountModule: {
78
78
  ...t,
79
79
  accountId: e
80
80
  },
81
- contextStore: m,
81
+ contextStore: w,
82
82
  beClient: { invoke({ op: f, input: y, signal: h }) {
83
- return $({
83
+ return O({
84
84
  beUrl: r,
85
85
  accountId: e,
86
86
  jwtProvider: a,
@@ -96,16 +96,16 @@ function F({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBro
96
96
  signal: p
97
97
  });
98
98
  } catch (f) {
99
- p?.aborted || (b(l, L(f)), l.onDone());
99
+ p?.aborted || (b(l, j(f)), l.onDone());
100
100
  }
101
101
  };
102
102
  }
103
- function k({ accountId: e, tools: t, beacon: r }) {
103
+ function F({ accountId: e, tools: t, beacon: r }) {
104
104
  const n = (o) => r?.({
105
105
  ...o,
106
106
  accountId: o.accountId || e
107
107
  });
108
- return ((o, c) => q(o, c, {
108
+ return ((o, i) => _(o, i, {
109
109
  tools: t,
110
110
  beacon: n,
111
111
  memory: sessionStorage
@@ -162,9 +162,9 @@ function G() {
162
162
  routes: /* @__PURE__ */ new Map(),
163
163
  originalFetch: r
164
164
  };
165
- return e.fetch = (o, c) => {
166
- const i = I(o), g = n.routes.get(i);
167
- return g ? V(g, o, c) : r(o, c);
165
+ return e.fetch = (o, i) => {
166
+ const c = I(o), g = n.routes.get(c);
167
+ return g ? K(g, o, i) : r(o, i);
168
168
  }, e[v] = n, n;
169
169
  }
170
170
  function I(e) {
@@ -180,25 +180,25 @@ function W(e, t) {
180
180
  async function H(e, t) {
181
181
  const r = W(e, t);
182
182
  if (r instanceof FormData) {
183
- const o = r.get("request"), c = r.get("attachment");
183
+ const o = r.get("request"), i = r.get("attachment");
184
184
  return {
185
185
  request: JSON.parse(String(o || "{}")),
186
- ...c instanceof File ? { attachment: c } : {}
186
+ ...i instanceof File ? { attachment: i } : {}
187
187
  };
188
188
  }
189
189
  const n = await Promise.resolve(r);
190
190
  return typeof n == "string" ? { request: JSON.parse(n || "{}") } : { request: {} };
191
191
  }
192
- function V(e, t, r) {
193
- const n = new TextEncoder(), o = new AbortController(), c = J(t, r);
194
- let i = !1, g = null;
195
- const w = new ReadableStream({
196
- async start(m) {
192
+ function K(e, t, r) {
193
+ const n = new TextEncoder(), o = new AbortController(), i = J(t, r);
194
+ let c = !1, g = null;
195
+ const m = new ReadableStream({
196
+ async start(w) {
197
197
  const d = (s) => {
198
- i || m.enqueue(n.encode(`${JSON.stringify(s)}
198
+ c || w.enqueue(n.encode(`${JSON.stringify(s)}
199
199
  `));
200
200
  }, u = () => {
201
- i || (i = !0, g?.(), m.close());
201
+ c || (c = !0, g?.(), w.close());
202
202
  }, a = (s) => {
203
203
  d({
204
204
  type: "error",
@@ -206,15 +206,15 @@ function V(e, t, r) {
206
206
  message: s instanceof Error ? s.message : String(s)
207
207
  }), d({ type: "done" }), u();
208
208
  };
209
- if (c) {
209
+ if (i) {
210
210
  const s = () => {
211
- o.abort(), i || (i = !0, g?.(), m.error(new DOMException("Aborted", "AbortError")));
211
+ o.abort(), c || (c = !0, g?.(), w.error(new DOMException("Aborted", "AbortError")));
212
212
  };
213
- if (c.aborted) {
213
+ if (i.aborted) {
214
214
  s();
215
215
  return;
216
216
  }
217
- c.addEventListener("abort", s, { once: !0 }), g = () => c.removeEventListener("abort", s);
217
+ i.addEventListener("abort", s, { once: !0 }), g = () => i.removeEventListener("abort", s);
218
218
  }
219
219
  try {
220
220
  const { request: s, attachment: l } = await H(t, r), p = e.streamTransport(s, {
@@ -224,12 +224,12 @@ function V(e, t, r) {
224
224
  final: y === !0,
225
225
  ...h
226
226
  }),
227
- onUISpec: (f, y, h, _) => d({
227
+ onUISpec: (f, y, h, L) => d({
228
228
  type: "ui_spec",
229
229
  spec: f,
230
230
  widget: y,
231
231
  ...h ? { panelHint: h } : {},
232
- ..._ ? { clearPanel: !0 } : {}
232
+ ...L ? { clearPanel: !0 } : {}
233
233
  }),
234
234
  onAction: (f) => {
235
235
  d(f?.type === "action" ? f : {
@@ -248,28 +248,30 @@ function V(e, t, r) {
248
248
  d({ type: "done" }), u();
249
249
  }
250
250
  }, o.signal, l);
251
- Y(p) && (await p, o.signal.aborted || (d({ type: "done" }), u()));
251
+ V(p) && (await p, o.signal.aborted || (d({ type: "done" }), u()));
252
252
  } catch (s) {
253
253
  o.signal.aborted || a(s);
254
254
  }
255
255
  },
256
256
  cancel() {
257
- o.abort(), g?.(), i = !0;
257
+ o.abort(), g?.(), c = !0;
258
258
  }
259
259
  });
260
- return Promise.resolve(new Response(w, {
260
+ return Promise.resolve(new Response(m, {
261
261
  status: 200,
262
262
  headers: { "Content-Type": "application/x-ndjson" }
263
263
  }));
264
264
  }
265
- function Y(e) {
265
+ function V(e) {
266
266
  return e !== null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
267
267
  }
268
- function Oe({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenBrokerAudience: o, workerUrl: c, defaultLocale: i = "en-GB", accountModule: g, tools: w = {}, beacon: m, allowBlobWorker: d = !1 }) {
268
+ function _e({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenBrokerAudience: o, workerUrl: i, defaultLocale: c = "en-GB", accountModule: g, tools: m = {}, beacon: w, allowBlobWorker: d = !1 }) {
269
269
  if (!e) throw new Error("accountId is required.");
270
+ if (!t) throw new Error("beUrl is required. The injector owns backend URLs; the SDK has no default.");
271
+ if (!i) throw new Error("workerUrl is required.");
270
272
  const u = window, a = u.GengageAssistantInjector || (u.GengageAssistantInjector = {}), s = a[e] || (a[e] = {});
271
273
  if (s.agentController) return s.agentController;
272
- const l = P(c) || d ? z(c, `gengage-${e}-agent`, { allowBlobWorker: d }) : null;
274
+ const l = P(i) || d ? Y(i, `gengage-${e}-agent`, { allowBlobWorker: d }) : null;
273
275
  s.streamTransport = l ? B({
274
276
  accountId: e,
275
277
  worker: l.worker,
@@ -277,19 +279,19 @@ function Oe({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenB
277
279
  ...r ? { devJwtSecret: r } : {},
278
280
  ...n ? { tokenBrokerUrl: n } : {},
279
281
  ...o ? { tokenBrokerAudience: o } : {},
280
- defaultLocale: i,
281
- tools: w,
282
- ...m ? { beacon: m } : {}
283
- }) : F({
282
+ defaultLocale: c,
283
+ tools: m,
284
+ ...w ? { beacon: w } : {}
285
+ }) : k({
284
286
  accountId: e,
285
287
  accountModule: g,
286
288
  beUrl: t,
287
289
  ...r ? { devJwtSecret: r } : {},
288
290
  ...n ? { tokenBrokerUrl: n } : {},
289
291
  ...o ? { tokenBrokerAudience: o } : {},
290
- defaultLocale: i,
291
- tools: w,
292
- ...m ? { beacon: m } : {}
292
+ defaultLocale: c,
293
+ tools: m,
294
+ ...w ? { beacon: w } : {}
293
295
  });
294
296
  const p = {
295
297
  type: "agent",
@@ -300,7 +302,7 @@ function Oe({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenB
300
302
  return {
301
303
  accountId: e,
302
304
  beUrl: t,
303
- workerUrl: c,
305
+ workerUrl: i,
304
306
  mounted: !0,
305
307
  transport: l ? "worker" : "main-thread",
306
308
  flows: Object.keys(g?.flows || {})
@@ -313,7 +315,7 @@ function P(e) {
313
315
  const t = new URL(e, window.location.href);
314
316
  return t.origin === window.location.origin || t.protocol === "blob:";
315
317
  }
316
- function z(e, t, r = {}) {
318
+ function Y(e, t, r = {}) {
317
319
  const n = new URL(e, window.location.href);
318
320
  if (P(e)) return {
319
321
  worker: new Worker(n.href, {
@@ -325,36 +327,38 @@ function z(e, t, r = {}) {
325
327
  };
326
328
  if (!r.allowBlobWorker) throw new Error("Cross-origin agent workers require allowBlobWorker=true or a same-origin workerUrl.");
327
329
  const o = new Blob([`import ${JSON.stringify(n.href)};
328
- `], { type: "text/javascript" }), c = URL.createObjectURL(o);
330
+ `], { type: "text/javascript" }), i = URL.createObjectURL(o);
329
331
  try {
330
332
  return {
331
- worker: new Worker(c, {
333
+ worker: new Worker(i, {
332
334
  type: "module",
333
335
  name: t
334
336
  }),
335
337
  cleanup() {
336
- URL.revokeObjectURL(c);
338
+ URL.revokeObjectURL(i);
337
339
  }
338
340
  };
339
- } catch (i) {
340
- throw URL.revokeObjectURL(c), i;
341
+ } catch (c) {
342
+ throw URL.revokeObjectURL(i), c;
341
343
  }
342
344
  }
343
- function K(e) {
345
+ function z(e) {
344
346
  const t = (e?.chat || e?._chat)?.root || e?._chat?.root;
345
347
  return t ? t.getRootNode?.()?.host || t : Array.from(document.querySelectorAll("*")).find((r) => r.shadowRoot?.querySelector?.(".gengage-chat-root, .gengage-chat-launcher-container"));
346
348
  }
347
- function $e(e, t) {
348
- const r = K(e);
349
+ function De(e, t) {
350
+ const r = z(e);
349
351
  r?.style && (t ? r.style.removeProperty("display") : r.style.setProperty("display", "none", "important")), t || (e?.chat || e?._chat)?.close?.();
350
352
  }
351
- var Q = "https://be.gengage.ai", X = "nd_be_url";
352
- function Ce(e = {}, t = Q) {
353
- return Z() || e.beUrl || t;
353
+ var Q = "nd_be_url";
354
+ function Oe(e, t) {
355
+ const r = X() || e.beUrl || t;
356
+ if (!r) throw new Error("resolveBeUrl: backend URL is required. The injector must supply a fallback URL; the SDK has no default.");
357
+ return r;
354
358
  }
355
- function Z() {
359
+ function X() {
356
360
  try {
357
- const e = new URLSearchParams(window.location.search).get(X)?.trim();
361
+ const e = new URLSearchParams(window.location.search).get(Q)?.trim();
358
362
  if (!e) return null;
359
363
  const t = new URL(e);
360
364
  return t.protocol !== "https:" && t.protocol !== "http:" ? null : t.toString().replace(/\/+$/u, "");
@@ -362,7 +366,7 @@ function Z() {
362
366
  return null;
363
367
  }
364
368
  }
365
- var ee = "entries", te = 1, re = {
369
+ var Z = "entries", ee = 1, te = {
366
370
  volatile: "Hot per-page state and sensitive request context.",
367
371
  session: "Current-visit tool context without raw tokens or PII-heavy payloads.",
368
372
  local: "Small, non-sensitive capability facts or user preferences.",
@@ -371,34 +375,34 @@ var ee = "entries", te = 1, re = {
371
375
  function S() {
372
376
  return Date.now();
373
377
  }
374
- function A(e) {
378
+ function R(e) {
375
379
  return e?.expiresAt != null && e.expiresAt <= S();
376
380
  }
377
- function R(e, t) {
381
+ function A(e, t) {
378
382
  return {
379
383
  value: e,
380
384
  createdAt: S(),
381
385
  expiresAt: t ? S() + t : null
382
386
  };
383
387
  }
384
- function ne(e, t, r) {
388
+ function re(e, t, r) {
385
389
  try {
386
390
  const n = e.getItem(`${t}${r}`);
387
391
  if (!n) return null;
388
392
  const o = JSON.parse(n);
389
- return A(o) ? (e.removeItem(`${t}${r}`), null) : o.value;
393
+ return R(o) ? (e.removeItem(`${t}${r}`), null) : o.value;
390
394
  } catch {
391
395
  return null;
392
396
  }
393
397
  }
394
- function oe(e, t, r, n, o) {
398
+ function ne(e, t, r, n, o) {
395
399
  try {
396
- return e.setItem(`${t}${r}`, JSON.stringify(R(n, o))), !0;
400
+ return e.setItem(`${t}${r}`, JSON.stringify(A(n, o))), !0;
397
401
  } catch {
398
402
  return !1;
399
403
  }
400
404
  }
401
- function se(e, t, r) {
405
+ function oe(e, t, r) {
402
406
  try {
403
407
  e.removeItem(`${t}${r}`);
404
408
  } catch {
@@ -413,9 +417,9 @@ function U(e) {
413
417
  }
414
418
  function x(e, t) {
415
419
  return e ? {
416
- get: (r) => ne(e, t, r),
417
- set: (r, n, o = {}) => oe(e, t, r, n, o.ttlMs),
418
- remove: (r) => se(e, t, r)
420
+ get: (r) => re(e, t, r),
421
+ set: (r, n, o = {}) => ne(e, t, r, n, o.ttlMs),
422
+ remove: (r) => oe(e, t, r)
419
423
  } : {
420
424
  get: () => null,
421
425
  set: () => !1,
@@ -431,31 +435,31 @@ function E(e) {
431
435
  }
432
436
  return JSON.stringify(e);
433
437
  }
434
- function ae(e) {
438
+ function se(e) {
435
439
  let t = 2166136261;
436
440
  const r = E(e);
437
441
  for (let n = 0; n < r.length; n += 1)
438
442
  t ^= r.charCodeAt(n), t = Math.imul(t, 16777619);
439
443
  return (t >>> 0).toString(36);
440
444
  }
441
- function ie(e, t) {
442
- const r = t.dbName || `gengage-${e}`, n = t.dbStore || ee, o = t.dbVersion || te, c = /* @__PURE__ */ new Map();
443
- let i = null;
444
- const g = () => "indexedDB" in window ? i || (i = new Promise((u) => {
445
+ function ae(e, t) {
446
+ const r = t.dbName || `gengage-${e}`, n = t.dbStore || Z, o = t.dbVersion || ee, i = /* @__PURE__ */ new Map();
447
+ let c = null;
448
+ const g = () => "indexedDB" in window ? c || (c = new Promise((u) => {
445
449
  const a = indexedDB.open(r, o);
446
450
  a.onupgradeneeded = () => {
447
451
  a.result.createObjectStore(n, { keyPath: "key" });
448
452
  }, a.onsuccess = () => u(a.result), a.onerror = () => u(null), a.onblocked = () => u(null);
449
- }), i) : Promise.resolve(null);
453
+ }), c) : Promise.resolve(null);
450
454
  return {
451
- volatileEntries: c,
455
+ volatileEntries: i,
452
456
  idbGet: async (u) => {
453
457
  const a = await g();
454
458
  return a ? new Promise((s) => {
455
459
  const l = a.transaction(n, "readwrite").objectStore(n), p = l.get(u);
456
460
  p.onsuccess = () => {
457
461
  const f = p.result;
458
- if (!f || A(f)) {
462
+ if (!f || R(f)) {
459
463
  f && l.delete(u), s(null);
460
464
  return;
461
465
  }
@@ -469,7 +473,7 @@ function ie(e, t) {
469
473
  const f = l.transaction(n, "readwrite");
470
474
  f.oncomplete = () => p(!0), f.onerror = () => p(!1), f.objectStore(n).put({
471
475
  key: u,
472
- ...R(a, s.ttlMs)
476
+ ...A(a, s.ttlMs)
473
477
  });
474
478
  }) : !1;
475
479
  },
@@ -479,34 +483,34 @@ function ie(e, t) {
479
483
  }
480
484
  };
481
485
  }
482
- function De(e, t = {}) {
483
- const r = window, n = r.gengage || (r.gengage = {}), o = n.memory || (n.memory = {}), c = o[e];
484
- if (c) return c;
485
- const i = T.get(e) || ie(e, t);
486
- T.set(e, i);
487
- const g = t.sessionPrefix || `gengage:${e}:session:`, w = t.localPrefix || `gengage:${e}:local:`, d = {
486
+ function $e(e, t = {}) {
487
+ const r = window, n = r.gengage || (r.gengage = {}), o = n.memory || (n.memory = {}), i = o[e];
488
+ if (i) return i;
489
+ const c = T.get(e) || ae(e, t);
490
+ T.set(e, c);
491
+ const g = t.sessionPrefix || `gengage:${e}:session:`, m = t.localPrefix || `gengage:${e}:local:`, d = {
488
492
  get: (s) => {
489
- const l = i.volatileEntries.get(s);
490
- return l ? A(l) ? (i.volatileEntries.delete(s), null) : l.value : null;
493
+ const l = c.volatileEntries.get(s);
494
+ return l ? R(l) ? (c.volatileEntries.delete(s), null) : l.value : null;
491
495
  },
492
- set: (s, l, p = {}) => (i.volatileEntries.set(s, R(l, p.ttlMs)), !0),
496
+ set: (s, l, p = {}) => (c.volatileEntries.set(s, A(l, p.ttlMs)), !0),
493
497
  remove: (s) => {
494
- i.volatileEntries.delete(s);
498
+ c.volatileEntries.delete(s);
495
499
  },
496
- clear: () => i.volatileEntries.clear()
500
+ clear: () => c.volatileEntries.clear()
497
501
  }, u = {
498
- get: i.idbGet,
499
- set: i.idbSet,
500
- remove: i.idbRemove
502
+ get: c.idbGet,
503
+ set: c.idbSet,
504
+ remove: c.idbRemove
501
505
  }, a = {
502
506
  accountId: e,
503
507
  volatile: d,
504
508
  session: x(U("sessionStorage"), g),
505
- local: x(U("localStorage"), w),
509
+ local: x(U("localStorage"), m),
506
510
  indexedDb: u,
507
- stableKey: ae,
511
+ stableKey: se,
508
512
  policy: {
509
- ...re,
513
+ ...te,
510
514
  ...t.policy || {}
511
515
  }
512
516
  };
@@ -514,7 +518,7 @@ function De(e, t = {}) {
514
518
  for (const s of t.aliases || []) o[s] = a;
515
519
  return a;
516
520
  }
517
- var ce = [
521
+ var ie = [
518
522
  "addToCart",
519
523
  "search",
520
524
  "searchKeyword",
@@ -522,17 +526,17 @@ var ce = [
522
526
  "searchGiftOptions",
523
527
  "similaritySearch"
524
528
  ];
525
- function Me(e, t, r = {}) {
526
- const n = window, o = n.gengage || (n.gengage = {}), c = o.tools || (o.tools = {});
527
- c[e] = t;
528
- for (const i of r.accountAliases || []) c[i] = t;
529
- if (r.exposeStandardAliases !== !1) for (const i of r.standardAliases || ce) {
530
- const g = t[i];
531
- typeof g == "function" && (c[i] = c[i] || g);
529
+ function Ce(e, t, r = {}) {
530
+ const n = window, o = n.gengage || (n.gengage = {}), i = o.tools || (o.tools = {});
531
+ i[e] = t;
532
+ for (const c of r.accountAliases || []) i[c] = t;
533
+ if (r.exposeStandardAliases !== !1) for (const c of r.standardAliases || ie) {
534
+ const g = t[c];
535
+ typeof g == "function" && (i[c] = i[c] || g);
532
536
  }
533
537
  return t;
534
538
  }
535
- function Be({ getPageType: e, getProduct: t }) {
539
+ function Me({ getPageType: e, getProduct: t }) {
536
540
  return () => ({
537
541
  url: window.location.href,
538
542
  title: document.title,
@@ -540,7 +544,7 @@ function Be({ getPageType: e, getProduct: t }) {
540
544
  product: t()
541
545
  });
542
546
  }
543
- function Fe({ accountId: e, getPageType: t, getProduct: r, getToolNames: n, getSearchCapabilities: o, getMemory: c }) {
547
+ function Be({ accountId: e, getPageType: t, getProduct: r, getToolNames: n, getSearchCapabilities: o, getMemory: i }) {
544
548
  return async () => ({
545
549
  accountId: e,
546
550
  url: window.location.href,
@@ -548,31 +552,31 @@ function Fe({ accountId: e, getPageType: t, getProduct: r, getToolNames: n, getS
548
552
  productSku: r()?.sku ?? null,
549
553
  toolNames: n(),
550
554
  ...o ? { searchCapabilities: o() } : {},
551
- ...c ? { memoryPolicy: c().policy } : {},
555
+ ...i ? { memoryPolicy: i().policy } : {},
552
556
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
553
557
  });
554
558
  }
555
559
  function ke({ accountId: e, runtimeFile: t = "runtime.js", startExport: r = "start", globalBaseUrlKey: n, errorLabel: o } = {}) {
556
560
  if (!e) throw new Error("accountId is required.");
557
- const c = o || e, i = window, g = () => {
558
- const u = i.GengageInjectorConfig || {}, a = u[e] || {};
561
+ const i = o || e, c = window, g = () => {
562
+ const u = c.GengageInjectorConfig || {}, a = u[e] || {};
559
563
  return {
560
564
  ...u,
561
565
  ...a
562
566
  };
563
- }, w = () => {
567
+ }, m = () => {
564
568
  const u = g();
565
569
  if (u.runtimeUrl) return u.runtimeUrl;
566
- const a = u.assetBaseUrl || u.baseUrl || document.currentScript?.getAttribute("src") || (n ? i[n] : null);
567
- if (!a) throw new Error(`${c} runtime URL cannot be resolved.`);
570
+ const a = u.assetBaseUrl || u.baseUrl || document.currentScript?.getAttribute("src") || (n ? c[n] : null);
571
+ if (!a) throw new Error(`${i} runtime URL cannot be resolved.`);
568
572
  return new URL(t, a).href;
569
- }, m = i.GengageAssistantInjector || (i.GengageAssistantInjector = {}), d = m[e] || (m[e] = {});
573
+ }, w = c.GengageAssistantInjector || (c.GengageAssistantInjector = {}), d = w[e] || (w[e] = {});
570
574
  return d.loaderPromise || (d.loaderPromise = import(
571
575
  /* @vite-ignore */
572
- w()
576
+ m()
573
577
  ).then((u) => {
574
578
  const a = u[r];
575
- if (typeof a != "function") throw new Error(`${c} runtime export ${r} is unavailable.`);
579
+ if (typeof a != "function") throw new Error(`${i} runtime export ${r} is unavailable.`);
576
580
  return a();
577
581
  }).catch((u) => {
578
582
  throw console.error(`[Gengage][${e}] runtime load failed`, u), u;
@@ -580,41 +584,41 @@ function ke({ accountId: e, runtimeFile: t = "runtime.js", startExport: r = "sta
580
584
  }
581
585
  export {
582
586
  Le as AgentError,
583
- j as ContextStore,
584
- Se as action,
585
- he as actionButtonsUiSpec,
586
- de as beErrorToAgentError,
587
- Ue as beautyConsultingTurnFlow,
587
+ q as ContextStore,
588
+ be as action,
589
+ me as actionButtonsUiSpec,
590
+ le as beErrorToAgentError,
591
+ Te as beautyConsultingTurnFlow,
588
592
  P as canUseModuleWorker,
589
- L as caughtToStreamError,
590
- ge as comparisonUiSpec,
591
- De as createBrowserMemory,
592
- Fe as createDiagnosticsTool,
593
- Ee as createFlow,
593
+ j as caughtToStreamError,
594
+ fe as comparisonUiSpec,
595
+ $e as createBrowserMemory,
596
+ Be as createDiagnosticsTool,
597
+ Se as createFlow,
594
598
  B as createInjectorAdapter,
595
- F as createMainThreadInjectorAdapter,
596
- z as createModuleWorker,
597
- Be as createReadPageTool,
599
+ k as createMainThreadInjectorAdapter,
600
+ Y as createModuleWorker,
601
+ Me as createReadPageTool,
598
602
  we as done,
599
- le as elapsedMs,
600
- me as error,
601
- _e as httpErrorToAgentError,
602
- Me as installBrowserTools,
603
+ ue as elapsedMs,
604
+ pe as error,
605
+ Pe as httpErrorToAgentError,
606
+ Ce as installBrowserTools,
603
607
  qe as installFetchTransportBridge,
604
- fe as metadata,
605
- Oe as mountAccount,
606
- pe as normalizeProduct,
607
- ye as nowIso,
608
- Ae as productDetailsUiSpec,
609
- Te as productsUiSpec,
610
- ve as requestText,
611
- Ce as resolveBeUrl,
608
+ de as metadata,
609
+ _e as mountAccount,
610
+ ge as normalizeProduct,
611
+ he as nowIso,
612
+ Ee as productDetailsUiSpec,
613
+ ve as productsUiSpec,
614
+ Ae as requestText,
615
+ Oe as resolveBeUrl,
612
616
  Re as resolveFlow,
613
- $e as setAssistantHostVisible,
614
- ae as stableKey,
617
+ De as setAssistantHostVisible,
618
+ se as stableKey,
615
619
  ke as startLazyRuntimeLoader,
616
- Pe as textChunk,
617
- be as trimProductFactsCore,
618
- xe as trimProductFactsListCore,
620
+ xe as textChunk,
621
+ ye as trimProductFactsCore,
622
+ Ue as trimProductFactsListCore,
619
623
  je as uiSpec
620
624
  };
@@ -1,4 +1,4 @@
1
1
  export interface BeUrlOverrides {
2
2
  beUrl?: string;
3
3
  }
4
- export declare function resolveBeUrl(overrides?: BeUrlOverrides, fallbackUrl?: string): string;
4
+ export declare function resolveBeUrl(overrides: BeUrlOverrides, fallbackUrl: string): string;