@gengage/assistant-fe 0.6.31 → 0.6.33

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,41 +1,41 @@
1
1
  import { buildPhotoSimilarityProfile as yo, buildProductSimilarityProfile as wo, buildSimilarityQueries as vo, normalizeSimilarityText as xo, rankSimilarProducts as ko, rankSimilarProductsAsync as _o, scoreSimilarityCandidate as So, tokenizeSimilarityText as Eo } from "./algos/similarity.js";
2
- import { $ as ft, A as Co, At as pt, B as Ao, C as Ro, Ct as mt, D as Po, E as Lo, Et as jo, F as No, G as Io, H as Uo, I as qo, J as Bo, K as Oo, L as Fo, M as $o, Mt as Mo, N as Do, O as Go, Ot as Oe, P as zo, Q as gt, R as Ho, S as Wo, T as Vo, Tt as Ko, U as Jo, V as Yo, W as Zo, X as Qo, Y as Xo, Z as ei, _ as ti, _t as ri, a as ni, at as oi, b as ii, bt as ai, c as si, ct as ci, d as li, dt as ui, et as di, f as fi, ft as pi, g as mi, gt as ht, h as gi, ht as hi, i as bi, it as ue, j as yi, jt as wi, k as vi, kt as bt, l as xi, lt as ki, m as _i, mt as Si, n as Ei, nt as Ti, o as Ci, ot as Ai, p as Ri, pt as Pi, q as Li, r as ji, rt as Ni, s as Ii, st as Ui, t as qi, tt as Bi, u as Oi, ut as Fi, v as $i, vt as Mi, w as Di, wt as Gi, x as yt, xt as Fe, y as zi, yt as wt, z as Hi } from "../agent-ui-steps-DIWmTMuV.js";
2
+ import { $ as pt, A as Co, At as ft, B as Ao, C as Ro, Ct as mt, D as Po, E as Lo, Et as jo, F as No, G as Io, H as Uo, I as qo, J as Fo, K as Bo, L as Oo, M as Mo, Mt as $o, N as Do, O as Go, Ot as Be, P as zo, Q as gt, R as Ho, S as Wo, T as Vo, Tt as Ko, U as Jo, V as Yo, W as Zo, X as Qo, Y as Xo, Z as ei, _ as ti, _t as ri, a as ni, at as oi, b as ii, bt as ai, c as si, ct as ci, d as li, dt as ui, et as di, f as pi, ft as fi, g as mi, gt as ht, h as gi, ht as hi, i as bi, it as ue, j as yi, jt as wi, k as vi, kt as bt, l as xi, lt as ki, m as _i, mt as Si, n as Ei, nt as Ti, o as Ci, ot as Ai, p as Ri, pt as Pi, q as Li, r as ji, rt as Ni, s as Ii, st as Ui, t as qi, tt as Fi, u as Bi, ut as Oi, v as Mi, vt as $i, w as Di, wt as Gi, x as yt, xt as Oe, y as zi, yt as wt, z as Hi } from "../agent-ui-steps-DIWmTMuV.js";
3
3
  var vt = 512, xt = 0.74;
4
- function kt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl: o, tokenBrokerAudience: i, defaultLocale: a, tools: s = {}, beacon: c, confirmation: d, memory: f = Oe() }) {
4
+ function kt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl: o, tokenBrokerAudience: i, defaultLocale: a, tools: s = {}, beacon: d, confirmation: c, memory: p = Be() }) {
5
5
  let b = 1;
6
6
  const m = /* @__PURE__ */ new Map();
7
7
  return bt({
8
8
  worker: t,
9
9
  tools: s,
10
- beacon: (l) => c?.({
11
- ...l,
12
- accountId: l.accountId || e
10
+ beacon: (u) => d?.({
11
+ ...u,
12
+ accountId: u.accountId || e
13
13
  }),
14
- ...d ? { confirmation: d } : {},
15
- memory: f
16
- }), t.addEventListener("message", (l) => {
17
- const p = l.data || {};
18
- if (p.type === "activity" && p.entry) {
19
- $e(p.entry);
14
+ ...c ? { confirmation: c } : {},
15
+ memory: p
16
+ }), t.addEventListener("message", (u) => {
17
+ const f = u.data || {};
18
+ if (f.type === "activity" && f.entry) {
19
+ Me(f.entry);
20
20
  return;
21
21
  }
22
- const g = typeof p.id == "number" ? p.id : null;
22
+ const g = typeof f.id == "number" ? f.id : null;
23
23
  if (g == null) return;
24
- const u = m.get(g);
25
- if (u) {
26
- if (p.type === "event" && p.event) {
27
- oe(u, p.event);
24
+ const l = m.get(g);
25
+ if (l) {
26
+ if (f.type === "event" && f.event) {
27
+ oe(l, f.event);
28
28
  return;
29
29
  }
30
- if (p.type === "error") {
31
- u.onError(new Error(p.message || "Agent worker failed")), m.delete(g);
30
+ if (f.type === "error") {
31
+ l.onError(new Error(f.message || "Agent worker failed")), m.delete(g);
32
32
  return;
33
33
  }
34
- p.type === "end" && m.delete(g);
34
+ f.type === "end" && m.delete(g);
35
35
  }
36
- }), (l, p, g, u) => {
36
+ }), (u, f, g, l) => {
37
37
  const h = b++;
38
- m.set(h, p);
38
+ m.set(h, f);
39
39
  const w = () => {
40
40
  m.delete(h), t.postMessage({
41
41
  id: h,
@@ -64,16 +64,16 @@ function kt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl
64
64
  w();
65
65
  return;
66
66
  }
67
- if (g.addEventListener("abort", w, { once: !0 }), u) {
68
- Me(l, u).then(k).catch((v) => {
69
- m.delete(h), p.onError(v instanceof Error ? v : /* @__PURE__ */ new Error("Failed to read image attachment"));
67
+ if (g.addEventListener("abort", w, { once: !0 }), l) {
68
+ $e(u, l).then(k).catch((v) => {
69
+ m.delete(h), f.onError(v instanceof Error ? v : /* @__PURE__ */ new Error("Failed to read image attachment"));
70
70
  });
71
71
  return;
72
72
  }
73
- k(l);
73
+ k(u);
74
74
  };
75
75
  }
76
- function $e(e) {
76
+ function Me(e) {
77
77
  const t = window;
78
78
  (t.__GENGAGE_AGENTIC_DEBUG_RECORD__ || t.__GENGAGE_AGENTIC_DEBUG_RECORD_BE__)?.(e);
79
79
  }
@@ -81,22 +81,22 @@ function _t() {
81
81
  const e = window;
82
82
  return typeof (e.__GENGAGE_AGENTIC_DEBUG_RECORD__ || e.__GENGAGE_AGENTIC_DEBUG_RECORD_BE__) == "function";
83
83
  }
84
- function St({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl: o, tokenBrokerAudience: i, defaultLocale: a, tools: s = {}, beacon: c, confirmation: d, memory: f }) {
84
+ function St({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl: o, tokenBrokerAudience: i, defaultLocale: a, tools: s = {}, beacon: d, confirmation: c, memory: p }) {
85
85
  let b = null;
86
86
  const m = Et({
87
87
  accountId: e,
88
88
  tools: s,
89
- beacon: c,
90
- confirmation: d,
91
- memory: f ?? Oe()
92
- }), l = gt(m), p = Fe({
89
+ beacon: d,
90
+ confirmation: c,
91
+ memory: p ?? Be()
92
+ }), u = gt(m), f = Oe({
93
93
  accountId: e,
94
94
  ...n ? { devJwtSecret: n } : {},
95
95
  ...o ? { tokenBrokerUrl: o } : {},
96
96
  ...i ? { tokenBrokerAudience: i } : {}
97
97
  });
98
- return async (g, u, h, w) => {
99
- const k = await Me(g || {}, w);
98
+ return async (g, l, h, w) => {
99
+ const k = await $e(g || {}, w);
100
100
  b ||= new mt({
101
101
  accountId: e,
102
102
  locale: k?.locale || a,
@@ -109,40 +109,40 @@ function St({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBr
109
109
  threadTtlMs: t.contextPersistence?.threadTtlMs
110
110
  });
111
111
  try {
112
- await ft({
112
+ await pt({
113
113
  request: k,
114
114
  accountModule: {
115
115
  ...t,
116
116
  accountId: e,
117
117
  trace: async (v) => {
118
- $e({
118
+ Me({
119
119
  kind: "flow/trace",
120
120
  event: v
121
121
  }), await t.trace?.(v);
122
122
  }
123
123
  },
124
124
  contextStore: b,
125
- beClient: { invoke({ op: v, input: T, signal: x, cacheTtlS: C, cacheKey: $, browserCache: z }) {
125
+ beClient: { invoke({ op: v, input: T, signal: x, cacheTtlS: C, cacheKey: M, browserCache: H }) {
126
126
  return ht({
127
127
  beUrl: r,
128
128
  accountId: e,
129
- jwtProvider: p,
129
+ jwtProvider: f,
130
130
  parentUrl: window.location.href,
131
131
  op: v,
132
132
  input: T,
133
133
  cacheTtlS: C,
134
- cacheKey: $,
135
- browserCache: z,
134
+ cacheKey: M,
135
+ browserCache: H,
136
136
  ...x ? { signal: x } : {}
137
137
  });
138
138
  } },
139
- toolBridge: l,
140
- emit: (v) => oe(u, v),
139
+ toolBridge: u,
140
+ emit: (v) => oe(l, v),
141
141
  rpc: m,
142
142
  signal: h
143
143
  });
144
144
  } catch (v) {
145
- h?.aborted || (oe(u, wt(v)), u.onDone());
145
+ h?.aborted || (oe(l, wt(v)), l.onDone());
146
146
  }
147
147
  };
148
148
  }
@@ -151,14 +151,14 @@ function Et({ accountId: e, tools: t, beacon: r, confirmation: n, memory: o }) {
151
151
  ...a,
152
152
  accountId: a.accountId || e
153
153
  });
154
- return ((a, s) => pt(a, s, {
154
+ return ((a, s) => ft(a, s, {
155
155
  tools: t,
156
156
  beacon: i,
157
157
  confirmation: n,
158
158
  memory: o
159
159
  }));
160
160
  }
161
- async function Me(e, t) {
161
+ async function $e(e, t) {
162
162
  if (!t || !t.type?.startsWith("image/")) return e;
163
163
  const r = await At(t), n = {
164
164
  ...Tt(e.payload ?? e.action?.payload),
@@ -197,7 +197,7 @@ async function Rt(e) {
197
197
  const a = i.getContext("2d");
198
198
  if (!a) return null;
199
199
  a.drawImage(t, 0, 0, n, o);
200
- const s = await new Promise((c) => i.toBlob(c, "image/jpeg", xt));
200
+ const s = await new Promise((d) => i.toBlob(d, "image/jpeg", xt));
201
201
  return s ? {
202
202
  dataUrl: await De(s),
203
203
  mime: s.type || "image/jpeg"
@@ -328,56 +328,56 @@ function Te(e, t) {
328
328
  }
329
329
  };
330
330
  }
331
- function Bt(e, t) {
331
+ function Ft(e, t) {
332
332
  const r = t.dbName || `gengage-${e}`, n = t.dbStore || Lt, o = t.dbVersion || jt, i = /* @__PURE__ */ new Map();
333
333
  let a = null;
334
334
  const s = () => "indexedDB" in window ? a || (a = new Promise((m) => {
335
- const l = indexedDB.open(r, o);
336
- l.onupgradeneeded = () => {
337
- l.result.createObjectStore(n, { keyPath: "key" });
338
- }, l.onsuccess = () => m(l.result), l.onerror = () => m(null), l.onblocked = () => m(null);
335
+ const u = indexedDB.open(r, o);
336
+ u.onupgradeneeded = () => {
337
+ u.result.createObjectStore(n, { keyPath: "key" });
338
+ }, u.onsuccess = () => m(u.result), u.onerror = () => m(null), u.onblocked = () => m(null);
339
339
  }), a) : Promise.resolve(null);
340
340
  return {
341
341
  volatileEntries: i,
342
342
  idbGet: async (m) => {
343
- const l = await s();
344
- return l ? new Promise((p) => {
345
- const g = l.transaction(n, "readwrite").objectStore(n), u = g.get(m);
346
- u.onsuccess = () => {
347
- const h = u.result;
343
+ const u = await s();
344
+ return u ? new Promise((f) => {
345
+ const g = u.transaction(n, "readwrite").objectStore(n), l = g.get(m);
346
+ l.onsuccess = () => {
347
+ const h = l.result;
348
348
  if (!h || U(h)) {
349
- h && g.delete(m), p(null);
349
+ h && g.delete(m), f(null);
350
350
  return;
351
351
  }
352
- p(h.value);
353
- }, u.onerror = () => p(null);
352
+ f(h.value);
353
+ }, l.onerror = () => f(null);
354
354
  }) : null;
355
355
  },
356
- idbSet: async (m, l, p = {}) => {
356
+ idbSet: async (m, u, f = {}) => {
357
357
  const g = await s();
358
- return g ? new Promise((u) => {
358
+ return g ? new Promise((l) => {
359
359
  const h = g.transaction(n, "readwrite");
360
- h.oncomplete = () => u(!0), h.onerror = () => u(!1), h.objectStore(n).put({
360
+ h.oncomplete = () => l(!0), h.onerror = () => l(!1), h.objectStore(n).put({
361
361
  key: m,
362
- ...de(l, p.ttlMs)
362
+ ...de(u, f.ttlMs)
363
363
  });
364
364
  }) : !1;
365
365
  },
366
366
  idbRemove: async (m) => {
367
- const l = await s();
368
- l && l.transaction(n, "readwrite").objectStore(n).delete(m);
367
+ const u = await s();
368
+ u && u.transaction(n, "readwrite").objectStore(n).delete(m);
369
369
  },
370
370
  idbGc: async () => {
371
371
  const m = await s();
372
- return m ? new Promise((l) => {
373
- let p = 0;
374
- const g = m.transaction(n, "readwrite"), u = g.objectStore(n).openCursor();
375
- u.onsuccess = () => {
376
- const h = u.result;
372
+ return m ? new Promise((u) => {
373
+ let f = 0;
374
+ const g = m.transaction(n, "readwrite"), l = g.objectStore(n).openCursor();
375
+ l.onsuccess = () => {
376
+ const h = l.result;
377
377
  if (!h) return;
378
378
  const w = h.value;
379
- (!w || U(w)) && (h.delete(), p += 1), h.continue();
380
- }, g.oncomplete = () => l(p), g.onerror = () => l(p), u.onerror = () => l(p);
379
+ (!w || U(w)) && (h.delete(), f += 1), h.continue();
380
+ }, g.oncomplete = () => u(f), g.onerror = () => u(f), l.onerror = () => u(f);
381
381
  }) : 0;
382
382
  }
383
383
  };
@@ -385,29 +385,29 @@ function Bt(e, t) {
385
385
  function Ge(e, t = {}) {
386
386
  const r = window, n = r.gengage || (r.gengage = {}), o = n.memory || (n.memory = {}), i = o[e];
387
387
  if (i) return i;
388
- const a = _e.get(e) || Bt(e, t);
388
+ const a = _e.get(e) || Ft(e, t);
389
389
  _e.set(e, a);
390
- const s = t.sessionPrefix || `gengage:${e}:session:`, c = t.localPrefix || `gengage:${e}:local:`, d = Ee("sessionStorage"), f = Ee("localStorage"), m = {
391
- get: (u) => {
392
- const h = a.volatileEntries.get(u);
393
- return h ? U(h) ? (a.volatileEntries.delete(u), null) : h.value : null;
390
+ const s = t.sessionPrefix || `gengage:${e}:session:`, d = t.localPrefix || `gengage:${e}:local:`, c = Ee("sessionStorage"), p = Ee("localStorage"), m = {
391
+ get: (l) => {
392
+ const h = a.volatileEntries.get(l);
393
+ return h ? U(h) ? (a.volatileEntries.delete(l), null) : h.value : null;
394
394
  },
395
- set: (u, h, w = {}) => (a.volatileEntries.set(u, de(h, w.ttlMs)), !0),
396
- remove: (u) => {
397
- a.volatileEntries.delete(u);
395
+ set: (l, h, w = {}) => (a.volatileEntries.set(l, de(h, w.ttlMs)), !0),
396
+ remove: (l) => {
397
+ a.volatileEntries.delete(l);
398
398
  },
399
399
  clear: () => a.volatileEntries.clear()
400
- }, l = {
400
+ }, u = {
401
401
  get: a.idbGet,
402
402
  set: a.idbSet,
403
403
  remove: a.idbRemove
404
- }, p = async () => {
405
- let u = 0;
404
+ }, f = async () => {
405
+ let l = 0;
406
406
  for (const [v, T] of a.volatileEntries)
407
- U(T) && (a.volatileEntries.delete(v), u += 1);
408
- const h = Se(d, s), w = Se(f, c), k = await a.idbGc();
407
+ U(T) && (a.volatileEntries.delete(v), l += 1);
408
+ const h = Se(c, s), w = Se(p, d), k = await a.idbGc();
409
409
  return {
410
- volatile: u,
410
+ volatile: l,
411
411
  session: h,
412
412
  local: w,
413
413
  indexedDb: k
@@ -415,10 +415,10 @@ function Ge(e, t = {}) {
415
415
  }, g = {
416
416
  accountId: e,
417
417
  volatile: m,
418
- session: Te(d, s),
419
- local: Te(f, c),
420
- indexedDb: l,
421
- gc: p,
418
+ session: Te(c, s),
419
+ local: Te(p, d),
420
+ indexedDb: u,
421
+ gc: f,
422
422
  stableKey: ue,
423
423
  policy: {
424
424
  ...Nt,
@@ -426,10 +426,10 @@ function Ge(e, t = {}) {
426
426
  }
427
427
  };
428
428
  o[e] = g;
429
- for (const u of t.aliases || []) o[u] = g;
430
- return Ot(g), g;
429
+ for (const l of t.aliases || []) o[l] = g;
430
+ return Bt(g), g;
431
431
  }
432
- function Ot(e) {
432
+ function Bt(e) {
433
433
  const t = window, r = () => {
434
434
  e.gc().catch(() => {
435
435
  });
@@ -440,34 +440,34 @@ function Ot(e) {
440
440
  }
441
441
  setTimeout(r, 5e3);
442
442
  }
443
- var V = "__gengageAgentFetchBridge", Ft = 1e3 * 60 * 60 * 24 * 14;
443
+ var V = "__gengageAgentFetchBridge", Ot = 1e3 * 60 * 60 * 24 * 14;
444
444
  function Wi({ accountId: e, streamTransport: t, endpoints: r = {}, endpointCache: n }) {
445
445
  if (!e) throw new Error("accountId is required.");
446
446
  if (typeof t != "function") throw new Error("streamTransport is required.");
447
- const o = $t(), i = `https://gengage-injector.invalid/${encodeURIComponent(e)}`, a = /* @__PURE__ */ new Set(), s = n ? Wt({
447
+ const o = Mt(), i = `https://gengage-injector.invalid/${encodeURIComponent(e)}`, a = /* @__PURE__ */ new Set(), s = n ? Wt({
448
448
  accountId: e,
449
449
  endpointCache: n,
450
450
  fetchImpl: o.originalFetch
451
- }) : void 0, c = (d) => {
452
- const f = `${i}/chat/${d}`;
453
- a.add(f);
454
- const b = r[d], m = {
451
+ }) : void 0, d = (c) => {
452
+ const p = `${i}/chat/${c}`;
453
+ a.add(p);
454
+ const b = r[c], m = {
455
455
  streamTransport: t,
456
- endpoint: d
456
+ endpoint: c
457
457
  };
458
- b && (m.endpointHandler = b), s && (m.endpointCache = s), o.routes.set(f, m);
458
+ b && (m.endpointHandler = b), s && (m.endpointCache = s), o.routes.set(p, m);
459
459
  };
460
- c("process_action");
461
- for (const d of Object.keys(r)) d !== "process_action" && c(d);
460
+ d("process_action");
461
+ for (const c of Object.keys(r)) c !== "process_action" && d(c);
462
462
  return {
463
463
  middlewareUrl: i,
464
464
  stop() {
465
- for (const d of a) o.routes.delete(d);
466
- Mt(o);
465
+ for (const c of a) o.routes.delete(c);
466
+ $t(o);
467
467
  }
468
468
  };
469
469
  }
470
- function $t() {
470
+ function Mt() {
471
471
  const e = window, t = e[V];
472
472
  if (t) return t;
473
473
  const r = e.fetch.bind(e), n = {
@@ -480,7 +480,7 @@ function $t() {
480
480
  return s ? Gt(s, o, i) : r(o, i);
481
481
  }, e.fetch = n.installedFetch, e[V] = n, n;
482
482
  }
483
- function Mt(e) {
483
+ function $t(e) {
484
484
  if (e.routes.size > 0) return;
485
485
  const t = window;
486
486
  t.fetch === e.installedFetch && (t.fetch = e.originalFetch), t[V] === e && delete t[V];
@@ -509,96 +509,96 @@ async function Dt(e, t) {
509
509
  }
510
510
  async function Gt(e, t, r) {
511
511
  if (e.endpoint && e.endpoint !== "process_action" && e.endpointHandler) {
512
- const d = new AbortController(), f = Ce(t, r);
512
+ const c = new AbortController(), p = Ce(t, r);
513
513
  let b = null;
514
- if (f) {
515
- const m = () => d.abort();
516
- f.aborted && m(), f.addEventListener("abort", m, { once: !0 }), b = () => f.removeEventListener("abort", m);
514
+ if (p) {
515
+ const m = () => c.abort();
516
+ p.aborted && m(), p.addEventListener("abort", m, { once: !0 }), b = () => p.removeEventListener("abort", m);
517
517
  }
518
518
  try {
519
- const m = await zt(t, r), l = {
519
+ const m = await zt(t, r), u = {
520
520
  accountId: Ht(t),
521
521
  endpoint: e.endpoint,
522
- signal: d.signal
523
- }, p = Vt(e.endpointCache, e.endpoint, m, l.accountId);
524
- if (p) {
525
- const u = await Kt(e.endpointCache, p, d.signal);
526
- if (u) return er(u);
522
+ signal: c.signal
523
+ }, f = Vt(e.endpointCache, e.endpoint, m, u.accountId);
524
+ if (f) {
525
+ const l = await Kt(e.endpointCache, f, c.signal);
526
+ if (l) return er(l);
527
527
  }
528
- const g = await e.endpointHandler(m, l);
529
- return p && g.ok && await Jt(e.endpointCache, p, g.clone(), d.signal), g;
528
+ const g = await e.endpointHandler(m, u);
529
+ return f && g.ok && await Jt(e.endpointCache, f, g.clone(), c.signal), g;
530
530
  } finally {
531
531
  b?.();
532
532
  }
533
533
  }
534
534
  const n = new TextEncoder(), o = new AbortController(), i = Ce(t, r);
535
535
  let a = !1, s = null;
536
- const c = new ReadableStream({
537
- async start(d) {
538
- const f = (l) => {
539
- a || d.enqueue(n.encode(`${JSON.stringify(l)}
536
+ const d = new ReadableStream({
537
+ async start(c) {
538
+ const p = (u) => {
539
+ a || c.enqueue(n.encode(`${JSON.stringify(u)}
540
540
  `));
541
541
  }, b = () => {
542
- a || (a = !0, s?.(), d.close());
543
- }, m = (l) => {
544
- f({
542
+ a || (a = !0, s?.(), c.close());
543
+ }, m = (u) => {
544
+ p({
545
545
  type: "error",
546
- code: l?.code || "agent_bridge_error",
547
- message: l instanceof Error ? l.message : String(l)
548
- }), f({ type: "done" }), b();
546
+ code: u?.code || "agent_bridge_error",
547
+ message: u instanceof Error ? u.message : String(u)
548
+ }), p({ type: "done" }), b();
549
549
  };
550
550
  if (i) {
551
- const l = () => {
552
- o.abort(), a || (a = !0, s?.(), d.error(new DOMException("Aborted", "AbortError")));
551
+ const u = () => {
552
+ o.abort(), a || (a = !0, s?.(), c.error(new DOMException("Aborted", "AbortError")));
553
553
  };
554
554
  if (i.aborted) {
555
- l();
555
+ u();
556
556
  return;
557
557
  }
558
- i.addEventListener("abort", l, { once: !0 }), s = () => i.removeEventListener("abort", l);
558
+ i.addEventListener("abort", u, { once: !0 }), s = () => i.removeEventListener("abort", u);
559
559
  }
560
560
  try {
561
- const { request: l, attachment: p } = await Dt(t, r), g = e.streamTransport(l, {
562
- onTextChunk: (u, h, w = {}) => f({
561
+ const { request: u, attachment: f } = await Dt(t, r), g = e.streamTransport(u, {
562
+ onTextChunk: (l, h, w = {}) => p({
563
563
  type: "text_chunk",
564
- content: u,
564
+ content: l,
565
565
  final: h === !0,
566
566
  ...w
567
567
  }),
568
- onUISpec: (u, h, w, k) => f({
568
+ onUISpec: (l, h, w, k) => p({
569
569
  type: "ui_spec",
570
- spec: u,
570
+ spec: l,
571
571
  widget: h,
572
572
  ...w ? { panelHint: w } : {},
573
573
  ...k ? { clearPanel: !0 } : {}
574
574
  }),
575
- onAction: (u) => {
576
- f(u?.type === "action" ? u : {
575
+ onAction: (l) => {
576
+ p(l?.type === "action" ? l : {
577
577
  type: "action",
578
- action: u
578
+ action: l
579
579
  });
580
580
  },
581
- onMetadata: (u) => {
582
- f(u?.type === "metadata" ? u : {
581
+ onMetadata: (l) => {
582
+ p(l?.type === "metadata" ? l : {
583
583
  type: "metadata",
584
- ...u
584
+ ...l
585
585
  });
586
586
  },
587
587
  onError: m,
588
588
  onDone: () => {
589
- f({ type: "done" }), b();
589
+ p({ type: "done" }), b();
590
590
  }
591
- }, o.signal, p);
592
- or(g) && (await g, o.signal.aborted || (f({ type: "done" }), b()));
593
- } catch (l) {
594
- o.signal.aborted || m(l);
591
+ }, o.signal, f);
592
+ or(g) && (await g, o.signal.aborted || (p({ type: "done" }), b()));
593
+ } catch (u) {
594
+ o.signal.aborted || m(u);
595
595
  }
596
596
  },
597
597
  cancel() {
598
598
  o.abort(), s?.(), a = !0;
599
599
  }
600
600
  });
601
- return new Response(c, {
601
+ return new Response(d, {
602
602
  status: 200,
603
603
  headers: { "Content-Type": "application/x-ndjson" }
604
604
  });
@@ -620,10 +620,10 @@ function Wt({ accountId: e, endpointCache: t, fetchImpl: r }) {
620
620
  accountId: e,
621
621
  beUrl: t.beUrl,
622
622
  ...t.parentUrl ? { parentUrl: t.parentUrl } : {},
623
- ttlMs: t.ttlMs ?? Ft,
623
+ ttlMs: t.ttlMs ?? Ot,
624
624
  policies: t.policies,
625
625
  fetchImpl: r,
626
- jwtProvider: Fe({
626
+ jwtProvider: Oe({
627
627
  accountId: e,
628
628
  ...t.devJwtSecret ? { devJwtSecret: t.devJwtSecret } : {},
629
629
  ...t.tokenBrokerUrl ? { tokenBrokerUrl: t.tokenBrokerUrl } : {},
@@ -759,20 +759,20 @@ function nr(e) {
759
759
  function or(e) {
760
760
  return e !== null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
761
761
  }
762
- function Vi({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenBrokerAudience: o, workerUrl: i, defaultLocale: a = "en-GB", accountModule: s, tools: c = {}, beacon: d, confirmation: f, memory: b, allowBlobWorker: m = !1, signal: l }) {
762
+ function Vi({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenBrokerAudience: o, workerUrl: i, defaultLocale: a = "en-GB", accountModule: s, tools: d = {}, beacon: c, confirmation: p, memory: b, allowBlobWorker: m = !1, signal: u }) {
763
763
  if (!e) throw new Error("accountId is required.");
764
764
  if (!t) throw new Error("beUrl is required. The injector owns backend URLs; the SDK has no default.");
765
765
  if (!i) throw new Error("workerUrl is required.");
766
- const p = window, g = p.GengageAssistantInjector || (p.GengageAssistantInjector = {}), u = g[e] || (g[e] = {});
767
- if (u.agentController) return u.agentController;
766
+ const f = window, g = f.GengageAssistantInjector || (f.GengageAssistantInjector = {}), l = g[e] || (g[e] = {});
767
+ if (l.agentController) return l.agentController;
768
768
  const h = Ze(i) || m ? ir(i, `gengage-${e}-agent`, { allowBlobWorker: m }) : null;
769
- h || d?.({
769
+ h || c?.({
770
770
  type: "agentRuntime",
771
771
  accountId: e,
772
772
  transport: "main-thread",
773
773
  reason: "cross-origin-worker-url",
774
774
  workerUrl: i
775
- }), u.streamTransport = h ? kt({
775
+ }), l.streamTransport = h ? kt({
776
776
  accountId: e,
777
777
  worker: h.worker,
778
778
  beUrl: t,
@@ -780,9 +780,9 @@ function Vi({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenB
780
780
  ...n ? { tokenBrokerUrl: n } : {},
781
781
  ...o ? { tokenBrokerAudience: o } : {},
782
782
  defaultLocale: a,
783
- tools: c,
784
- ...d ? { beacon: d } : {},
785
- ...f ? { confirmation: f } : {},
783
+ tools: d,
784
+ ...c ? { beacon: c } : {},
785
+ ...p ? { confirmation: p } : {},
786
786
  ...b ? { memory: b } : {}
787
787
  }) : St({
788
788
  accountId: e,
@@ -792,9 +792,9 @@ function Vi({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenB
792
792
  ...n ? { tokenBrokerUrl: n } : {},
793
793
  ...o ? { tokenBrokerAudience: o } : {},
794
794
  defaultLocale: a,
795
- tools: c,
796
- ...d ? { beacon: d } : {},
797
- ...f ? { confirmation: f } : {},
795
+ tools: d,
796
+ ...c ? { beacon: c } : {},
797
+ ...p ? { confirmation: p } : {},
798
798
  ...b ? { memory: b } : {}
799
799
  });
800
800
  const w = new AbortController(), k = [], v = () => {
@@ -806,9 +806,9 @@ function Vi({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenB
806
806
  }
807
807
  }
808
808
  }, T = () => {
809
- w.signal.aborted || (w.abort(), l?.removeEventListener("abort", T), delete u.streamTransport, h?.worker.terminate(), h?.cleanup(), v(), delete u.agentController);
809
+ w.signal.aborted || (w.abort(), u?.removeEventListener("abort", T), delete l.streamTransport, h?.worker.terminate(), h?.cleanup(), v(), delete l.agentController);
810
810
  };
811
- l?.addEventListener("abort", T, { once: !0 });
811
+ u?.addEventListener("abort", T, { once: !0 });
812
812
  const x = {
813
813
  type: "agent",
814
814
  signal: w.signal,
@@ -834,7 +834,7 @@ function Vi({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenB
834
834
  };
835
835
  }
836
836
  };
837
- return u.agentController = x, x;
837
+ return l.agentController = x, x;
838
838
  }
839
839
  function Ze(e) {
840
840
  const t = new URL(e, window.location.href);
@@ -972,38 +972,38 @@ function ra({ accountId: e, getPageType: t, getProduct: r, getToolNames: n, getS
972
972
  }
973
973
  function na({ accountId: e, runtimeFile: t = "runtime.js", startExport: r = "start", globalBaseUrlKey: n, errorLabel: o, trustedRuntimeOrigins: i } = {}) {
974
974
  if (!e) throw new Error("accountId is required.");
975
- const a = o || e, s = window, c = () => {
976
- const l = s.GengageInjectorConfig || {}, p = l[e] || {};
975
+ const a = o || e, s = window, d = () => {
976
+ const u = s.GengageInjectorConfig || {}, f = u[e] || {};
977
977
  return {
978
- ...l,
979
- ...p
978
+ ...u,
979
+ ...f
980
980
  };
981
- }, d = () => {
982
- const l = c();
983
- if (l.runtimeUrl) return l.runtimeUrl;
984
- const p = l.assetBaseUrl || l.baseUrl || document.currentScript?.getAttribute("src") || (n ? s[n] : null);
985
- if (!p) throw new Error(`${a} runtime URL cannot be resolved.`);
986
- return new URL(t, p).href;
987
- }, f = (l) => {
988
- if (i === !0) return l;
989
- const p = new URL(l, window.location.href).origin, g = /* @__PURE__ */ new Set([window.location.origin]), u = c();
990
- M(g, document.currentScript?.getAttribute("src")), M(g, u.assetBaseUrl), M(g, u.baseUrl), M(g, n ? s[n] : void 0);
991
- for (const h of i || []) M(g, h);
992
- if (!g.has(p)) throw new Error(`${a} runtime origin ${p} is not trusted.`);
993
- return l;
981
+ }, c = () => {
982
+ const u = d();
983
+ if (u.runtimeUrl) return u.runtimeUrl;
984
+ const f = u.assetBaseUrl || u.baseUrl || document.currentScript?.getAttribute("src") || (n ? s[n] : null);
985
+ if (!f) throw new Error(`${a} runtime URL cannot be resolved.`);
986
+ return new URL(t, f).href;
987
+ }, p = (u) => {
988
+ if (i === !0) return u;
989
+ const f = new URL(u, window.location.href).origin, g = /* @__PURE__ */ new Set([window.location.origin]), l = d();
990
+ $(g, document.currentScript?.getAttribute("src")), $(g, l.assetBaseUrl), $(g, l.baseUrl), $(g, n ? s[n] : void 0);
991
+ for (const h of i || []) $(g, h);
992
+ if (!g.has(f)) throw new Error(`${a} runtime origin ${f} is not trusted.`);
993
+ return u;
994
994
  }, b = s.GengageAssistantInjector || (s.GengageAssistantInjector = {}), m = b[e] || (b[e] = {});
995
995
  return m.loaderPromise || (m.loaderPromise = import(
996
996
  /* @vite-ignore */
997
- f(d())
998
- ).then((l) => {
999
- const p = l[r];
1000
- if (typeof p != "function") throw new Error(`${a} runtime export ${r} is unavailable.`);
1001
- return p();
1002
- }).catch((l) => {
1003
- throw delete m.loaderPromise, console.error(`[Gengage][${e}] runtime load failed`, l), l;
997
+ p(c())
998
+ ).then((u) => {
999
+ const f = u[r];
1000
+ if (typeof f != "function") throw new Error(`${a} runtime export ${r} is unavailable.`);
1001
+ return f();
1002
+ }).catch((u) => {
1003
+ throw delete m.loaderPromise, console.error(`[Gengage][${e}] runtime load failed`, u), u;
1004
1004
  })), m.loaderPromise;
1005
1005
  }
1006
- function M(e, t) {
1006
+ function $(e, t) {
1007
1007
  if (t)
1008
1008
  try {
1009
1009
  const r = new URL(t, window.location.href);
@@ -1013,7 +1013,7 @@ function M(e, t) {
1013
1013
  }
1014
1014
  }
1015
1015
  var dr = 500, Ae = "__GENGAGE_AGENTIC_ACTIVITY__";
1016
- function fr({ accountId: e, clock: t = () => Date.now() } = {}) {
1016
+ function pr({ accountId: e, clock: t = () => Date.now() } = {}) {
1017
1017
  const r = /* @__PURE__ */ new Set();
1018
1018
  let n = 1;
1019
1019
  const o = {
@@ -1028,7 +1028,7 @@ function fr({ accountId: e, clock: t = () => Date.now() } = {}) {
1028
1028
  ...a
1029
1029
  });
1030
1030
  o.entries.push(s), o.entries.length > dr && (o.entries = o.entries.slice(-500));
1031
- for (const c of r) c(s, o.entries);
1031
+ for (const d of r) d(s, o.entries);
1032
1032
  return s;
1033
1033
  }
1034
1034
  return {
@@ -1047,10 +1047,10 @@ function fr({ accountId: e, clock: t = () => Date.now() } = {}) {
1047
1047
  }
1048
1048
  };
1049
1049
  }
1050
- function pr(e) {
1050
+ function fr(e) {
1051
1051
  const t = window[Ae];
1052
1052
  if (t?.accountId === e && typeof t.record == "function") return t;
1053
- const r = fr({ accountId: e });
1053
+ const r = pr({ accountId: e });
1054
1054
  return window[Ae] = r, r;
1055
1055
  }
1056
1056
  function mr(e) {
@@ -1107,7 +1107,7 @@ function yr(e) {
1107
1107
  }
1108
1108
  return t === "flow/ui" ? e?.widget ? `UI: ${e.widget}` : "UI" : t.startsWith("flow/") ? "Flow lifecycle" : t.startsWith("intent/") ? e?.intent?.kind ? `Intent: ${e.intent.kind}` : "Intent" : t === "beacon" ? e?.payload?.type ? `Beacon: ${e.payload.type}` : "Beacon" : e?.section || "Runtime";
1109
1109
  }
1110
- var wr = 8, fe = 120;
1110
+ var wr = 8, pe = 120;
1111
1111
  function vr(e = []) {
1112
1112
  const t = Array.isArray(e) ? e : [], r = {
1113
1113
  status: "idle",
@@ -1149,7 +1149,7 @@ function Y(e, t = "") {
1149
1149
  pageProduct: Ur(e.product || e.page?.product),
1150
1150
  products: I(e.products || e.last_search_products || e.items),
1151
1151
  ui: Qe(e.spec),
1152
- intent: pe(e.intent),
1152
+ intent: fe(e.intent),
1153
1153
  route: Q({
1154
1154
  searchParams: e.searchParams || e.search_params,
1155
1155
  flowParams: e.flowParams || e.flow_params
@@ -1183,7 +1183,7 @@ function Qe(e, t = "", r = "") {
1183
1183
  productCount: i?.count,
1184
1184
  productSkus: i?.skus,
1185
1185
  buttonCount: a.length || void 0,
1186
- buttonLabels: a.length ? q(a.map((c) => c.label || c.title)) : void 0,
1186
+ buttonLabels: a.length ? q(a.map((d) => d.label || d.title)) : void 0,
1187
1187
  comparisonRows: s
1188
1188
  });
1189
1189
  }
@@ -1203,7 +1203,7 @@ function xr(e, t, r = {}) {
1203
1203
  Sr(e, t, r);
1204
1204
  break;
1205
1205
  case "flow/text-final":
1206
- t.lastText = y(r.content, fe), S(e, r, "Text", t.lastText, "done");
1206
+ t.lastText = y(r.content, pe), S(e, r, "Text", t.lastText, "done");
1207
1207
  break;
1208
1208
  case "flow/done":
1209
1209
  e.status = e.status === "error" ? "error" : "done", e.current = "Done", S(e, r, "Done", "Flow completed", "done");
@@ -1229,7 +1229,7 @@ function xr(e, t, r = {}) {
1229
1229
  e.beOps.push(r.op || r.result?.op || "unknown"), Cr(t, r.result), S(e, r, "BE", r.op || r.result?.intent?.kind || "response", r.severity || "done");
1230
1230
  break;
1231
1231
  case "intent/selected":
1232
- t.intent = pe(r.intent), t.route = Q({
1232
+ t.intent = fe(r.intent), t.route = Q({
1233
1233
  searchParams: r.searchParams,
1234
1234
  flowParams: r.flowParams
1235
1235
  }), e.current = `Intent: ${t.intent?.kind || "selected"}`, S(e, r, "Intent", t.intent?.kind || "selected", "done");
@@ -1256,7 +1256,7 @@ function Sr(e, t, r) {
1256
1256
  }
1257
1257
  function Er(e, t) {
1258
1258
  const r = t.event || {}, n = y(r.type || "trace"), o = y(r.stepName || r.stepKind || "");
1259
- e.sessionId = y(r.sessionId || e.sessionId), e.current = o ? `${n}: ${o}` : n, S(e, t, "Trace", [n, o].filter(Boolean).join(" / ") || "trace", Br(n));
1259
+ e.sessionId = y(r.sessionId || e.sessionId), e.current = o ? `${n}: ${o}` : n, S(e, t, "Trace", [n, o].filter(Boolean).join(" / ") || "trace", Fr(n));
1260
1260
  }
1261
1261
  function Tr(e, t) {
1262
1262
  const r = t.params || {};
@@ -1269,7 +1269,7 @@ function Tr(e, t) {
1269
1269
  }
1270
1270
  function Cr(e, t) {
1271
1271
  if (!t || typeof t != "object") return;
1272
- t.intent && (e.intent = pe(t.intent));
1272
+ t.intent && (e.intent = fe(t.intent));
1273
1273
  const r = Q({
1274
1274
  searchParams: t.search_params,
1275
1275
  flowParams: t.flow_params
@@ -1293,12 +1293,12 @@ function S(e, t, r, n, o = "done") {
1293
1293
  id: t.id,
1294
1294
  at: t.at,
1295
1295
  label: r,
1296
- detail: y(n, fe),
1296
+ detail: y(n, pe),
1297
1297
  status: o === "info" ? "done" : o,
1298
1298
  kind: t.kind
1299
1299
  }));
1300
1300
  }
1301
- function pe(e) {
1301
+ function fe(e) {
1302
1302
  return !e || typeof e != "object" ? null : E({
1303
1303
  kind: y(e.kind || e.intent || e.type),
1304
1304
  target: y(e.target),
@@ -1394,17 +1394,17 @@ function te(e) {
1394
1394
  function me(e) {
1395
1395
  return Number.isFinite(Number(e)) ? Number(e) : void 0;
1396
1396
  }
1397
- function Br(e) {
1397
+ function Fr(e) {
1398
1398
  return /error$/u.test(e) ? "error" : /start$/u.test(e) ? "running" : "done";
1399
1399
  }
1400
- function y(e, t = fe) {
1400
+ function y(e, t = pe) {
1401
1401
  const r = String(e ?? "").replace(/\s+/gu, " ").trim();
1402
1402
  return r.length > t ? `${r.slice(0, t - 1)}...` : r;
1403
1403
  }
1404
1404
  function E(e) {
1405
1405
  return Object.fromEntries(Object.entries(e || {}).filter(([, t]) => t == null || t === "" ? !1 : Array.isArray(t) ? t.length > 0 : typeof t == "object" ? Object.keys(t).length > 0 : !0));
1406
1406
  }
1407
- function Or(e, t) {
1407
+ function Br(e, t) {
1408
1408
  if (!e || typeof e != "object" || !t) return e;
1409
1409
  const r = { ...e };
1410
1410
  for (const [n, o] of Object.entries(e))
@@ -1415,55 +1415,55 @@ function Or(e, t) {
1415
1415
  params: a
1416
1416
  });
1417
1417
  try {
1418
- const c = await o.call(this, a, ...s);
1418
+ const d = await o.call(this, a, ...s);
1419
1419
  return t.record({
1420
1420
  kind: "tool/done",
1421
1421
  tool: n,
1422
1422
  params: a,
1423
- result: Zr(c),
1424
- state: Y(c, `tool:${n}`)
1425
- }), c;
1426
- } catch (c) {
1423
+ result: Zr(d),
1424
+ state: Y(d, `tool:${n}`)
1425
+ }), d;
1426
+ } catch (d) {
1427
1427
  throw t.record({
1428
1428
  kind: "tool/error",
1429
1429
  tool: n,
1430
1430
  params: a,
1431
- error: B(c)
1432
- }), c;
1431
+ error: F(d)
1432
+ }), d;
1433
1433
  }
1434
1434
  }, Object.defineProperty(r[n], "__gengageActivityWrapped", { value: !0 }));
1435
1435
  return r;
1436
1436
  }
1437
- function Fr(e, t) {
1437
+ function Or(e, t) {
1438
1438
  return t ? (r) => (t.record({
1439
1439
  kind: "beacon",
1440
1440
  payload: r
1441
1441
  }), e?.(r)) : e;
1442
1442
  }
1443
- function $r(e, t) {
1443
+ function Mr(e, t) {
1444
1444
  if (!t) return !1;
1445
1445
  const r = window.GengageAssistantInjector?.[e], n = r?.streamTransport;
1446
1446
  if (typeof n != "function" || n.__gengageActivityWrapped) return !1;
1447
- const o = function(a, s, c, d) {
1447
+ const o = function(a, s, d, c) {
1448
1448
  t.record({
1449
1449
  kind: "flow/request",
1450
1450
  request: a
1451
1451
  });
1452
1452
  try {
1453
- const f = n.call(this, a, Dr(s, t), c, d);
1454
- return f && typeof f.then == "function" ? f.catch((b) => {
1453
+ const p = n.call(this, a, Dr(s, t), d, c);
1454
+ return p && typeof p.then == "function" ? p.catch((b) => {
1455
1455
  throw t.record({
1456
1456
  kind: "flow/rejected",
1457
1457
  requestType: a?.type,
1458
- error: B(b)
1458
+ error: F(b)
1459
1459
  }), b;
1460
- }) : f;
1461
- } catch (f) {
1460
+ }) : p;
1461
+ } catch (p) {
1462
1462
  throw t.record({
1463
1463
  kind: "flow/thrown",
1464
1464
  requestType: a?.type,
1465
- error: B(f)
1466
- }), f;
1465
+ error: F(p)
1466
+ }), p;
1467
1467
  }
1468
1468
  };
1469
1469
  return Object.defineProperty(o, "__gengageActivityWrapped", { value: !0 }), r.streamTransport = o, t.record({
@@ -1471,49 +1471,49 @@ function $r(e, t) {
1471
1471
  title: "streamTransport wrapped"
1472
1472
  }), !0;
1473
1473
  }
1474
- function Mr({ accountId: e, collector: t, promptBaseUrl: r } = {}) {
1474
+ function $r({ accountId: e, collector: t, promptBaseUrl: r } = {}) {
1475
1475
  if (!t || window.__GENGAGE_ACTIVITY_FETCH_PATCHED__) return;
1476
1476
  window.__GENGAGE_ACTIVITY_FETCH_PATCHED__ = !0;
1477
1477
  const n = window.fetch?.bind(window);
1478
1478
  typeof n == "function" && (window.fetch = async (o, i) => {
1479
1479
  const a = Vr(o, i), s = Jr(a.url);
1480
- let c = "";
1481
- s && (c = a.body?.op_name || a.body?.op || "unknown", t.record({
1480
+ let d = "";
1481
+ s && (d = a.body?.op_name || a.body?.op || "unknown", t.record({
1482
1482
  kind: "be/request",
1483
1483
  source: "main-thread-fetch",
1484
1484
  url: a.url,
1485
- op: c,
1485
+ op: d,
1486
1486
  opDomain: a.body?.op_domain || "",
1487
1487
  prompt: await Gr({
1488
1488
  accountId: e,
1489
- opName: c,
1489
+ opName: d,
1490
1490
  promptBaseUrl: r
1491
1491
  }),
1492
1492
  params: a.body?.op_payload || {},
1493
1493
  rawBody: a.body
1494
1494
  }));
1495
- const d = await n(o, i);
1496
- return s && d.clone().text().then((f) => {
1497
- const b = Yr(f);
1495
+ const c = await n(o, i);
1496
+ return s && c.clone().text().then((p) => {
1497
+ const b = Yr(p);
1498
1498
  t.record({
1499
1499
  kind: "be/response",
1500
1500
  source: "main-thread-fetch",
1501
1501
  url: a.url,
1502
- status: d.status,
1503
- op: c,
1502
+ status: c.status,
1503
+ op: d,
1504
1504
  result: b,
1505
- rawText: f
1505
+ rawText: p
1506
1506
  }), et(t, b);
1507
- }).catch((f) => {
1507
+ }).catch((p) => {
1508
1508
  t.record({
1509
1509
  kind: "be/response",
1510
1510
  source: "main-thread-fetch",
1511
1511
  url: a.url,
1512
- status: d.status,
1513
- op: c,
1514
- error: B(f)
1512
+ status: c.status,
1513
+ op: d,
1514
+ error: F(p)
1515
1515
  });
1516
- }), d;
1516
+ }), c;
1517
1517
  });
1518
1518
  }
1519
1519
  function Dr(e, t) {
@@ -1546,7 +1546,7 @@ function Dr(e, t) {
1546
1546
  extra: o[2]
1547
1547
  }) : n === "onError" ? t.record({
1548
1548
  kind: "flow/error",
1549
- error: B(o[0])
1549
+ error: F(o[0])
1550
1550
  }) : n === "onDone" && t.record({ kind: "flow/done" }), e[n](...o)));
1551
1551
  return r;
1552
1552
  }
@@ -1571,7 +1571,7 @@ async function Gr({ accountId: e, opName: t, promptBaseUrl: r }) {
1571
1571
  error: `HTTP ${i.status}`
1572
1572
  };
1573
1573
  } catch (o) {
1574
- return { error: B(o) };
1574
+ return { error: F(o) };
1575
1575
  }
1576
1576
  }
1577
1577
  function zr({ accountId: e, baseId: t, promptBaseUrl: r }) {
@@ -1662,10 +1662,10 @@ function Zr(e) {
1662
1662
  } : t[r] = n;
1663
1663
  return t;
1664
1664
  }
1665
- function B(e) {
1665
+ function F(e) {
1666
1666
  return e?.message || String(e);
1667
1667
  }
1668
- var Pe = "gengage-agentic-activity-overlay", G = "all", se = "all", Le = [
1668
+ var Pe = "gengage-agentic-activity-overlay", z = "all", se = "all", Le = [
1669
1669
  "Flow",
1670
1670
  "Tools",
1671
1671
  "Backend",
@@ -1682,15 +1682,15 @@ function Qr(e) {
1682
1682
  const t = document.getElementById(Pe);
1683
1683
  if (t?.shadowRoot) return t;
1684
1684
  const r = document.createElement("div");
1685
- r.id = Pe, r.style.cssText = "position:fixed;left:10px;top:10px;z-index:2147483647;";
1685
+ r.id = Pe, r.style.cssText = "position:fixed;left:10px;top:10px;bottom:10px;z-index:2147483647;";
1686
1686
  const n = r.attachShadow({ mode: "open" });
1687
1687
  n.innerHTML = Sn(e.accountId), document.documentElement.appendChild(r);
1688
1688
  const o = {
1689
1689
  entries: [],
1690
- section: G,
1690
+ section: z,
1691
1691
  severity: se,
1692
1692
  search: "",
1693
- grouped: !0,
1693
+ grouped: !1,
1694
1694
  follow: !0,
1695
1695
  stateVisible: !0,
1696
1696
  verbose: !1
@@ -1709,17 +1709,23 @@ function Qr(e) {
1709
1709
  verboseToggle: n.querySelector('[data-action="verbose"]')
1710
1710
  };
1711
1711
  Xr(r, i.list);
1712
- const a = () => tn(i, o);
1713
- return n.querySelector('[data-action="clear"]')?.addEventListener("click", () => e.clear()), n.querySelector('[data-action="toggle"]')?.addEventListener("click", (s) => {
1714
- i.panel.classList.toggle("is-minimized"), s.currentTarget.textContent = i.panel.classList.contains("is-minimized") ? "Open" : "Min";
1712
+ const a = () => tn(i, o), s = n.querySelector('[data-role="filters-popup"]'), d = n.querySelector('[data-action="filters-toggle"]');
1713
+ return d?.addEventListener("click", () => {
1714
+ const c = s.classList.toggle("is-hidden") === !1;
1715
+ d.setAttribute("aria-pressed", String(c));
1716
+ }), n.addEventListener("click", (c) => {
1717
+ s.classList.contains("is-hidden") || s.contains(c.target) || d.contains(c.target) || (s.classList.add("is-hidden"), d.setAttribute("aria-pressed", "false"));
1718
+ }), n.querySelector('[data-action="clear"]')?.addEventListener("click", () => e.clear()), n.querySelector('[data-action="toggle"]')?.addEventListener("click", (c) => {
1719
+ const p = i.panel.classList.toggle("is-minimized");
1720
+ c.currentTarget.textContent = p ? "Open" : "Min", r.style.bottom = p ? "auto" : "10px";
1715
1721
  }), i.search?.addEventListener("input", () => {
1716
1722
  o.search = i.search.value || "", a();
1717
- }), i.sections?.addEventListener("click", (s) => {
1718
- const c = s.target?.closest?.("[data-section-filter]")?.dataset?.sectionFilter;
1719
- c && (o.section = c, a());
1720
- }), i.severities?.addEventListener("click", (s) => {
1721
- const c = s.target?.closest?.("[data-severity-filter]")?.dataset?.severityFilter;
1722
- c && (o.severity = c, a());
1723
+ }), i.sections?.addEventListener("click", (c) => {
1724
+ const p = c.target?.closest?.("[data-section-filter]")?.dataset?.sectionFilter;
1725
+ p && (o.section = p, a());
1726
+ }), i.severities?.addEventListener("click", (c) => {
1727
+ const p = c.target?.closest?.("[data-severity-filter]")?.dataset?.severityFilter;
1728
+ p && (o.severity = p, a());
1723
1729
  }), i.groupToggle?.addEventListener("click", () => {
1724
1730
  o.grouped = !o.grouped, i.groupToggle.setAttribute("aria-pressed", String(o.grouped)), i.groupToggle.textContent = o.grouped ? "Grouped" : "Flat", a();
1725
1731
  }), i.followToggle?.addEventListener("click", () => {
@@ -1729,20 +1735,20 @@ function Qr(e) {
1729
1735
  }), i.verboseToggle?.addEventListener("click", () => {
1730
1736
  o.verbose = !o.verbose, i.verboseToggle.setAttribute("aria-pressed", String(o.verbose)), i.verboseToggle.textContent = o.verbose ? "Verbose" : "Concise", a();
1731
1737
  }), n.querySelector('[data-action="expand-all"]')?.addEventListener("click", () => {
1732
- i.list?.querySelectorAll("details").forEach((s) => {
1733
- s.open = !0;
1738
+ i.list?.querySelectorAll("details").forEach((c) => {
1739
+ c.open = !0;
1734
1740
  });
1735
1741
  }), n.querySelector('[data-action="collapse-all"]')?.addEventListener("click", () => {
1736
- i.list?.querySelectorAll("details").forEach((s) => {
1737
- s.open = !1;
1742
+ i.list?.querySelectorAll("details").forEach((c) => {
1743
+ c.open = !1;
1738
1744
  });
1739
- }), i.list?.addEventListener("click", (s) => {
1740
- const c = s.target?.closest?.('[data-action="copy-json"]');
1741
- if (!c) return;
1742
- const d = Number(c.dataset.entryId || 0);
1743
- xn(o.entries.find((f) => f.id === d), c);
1744
- }), e.subscribe((s, c) => {
1745
- o.entries = c.slice(), a();
1745
+ }), i.list?.addEventListener("click", (c) => {
1746
+ const p = c.target?.closest?.('[data-action="copy-json"]');
1747
+ if (!p) return;
1748
+ const b = Number(p.dataset.entryId || 0);
1749
+ xn(o.entries.find((m) => m.id === b), p);
1750
+ }), e.subscribe((c, p) => {
1751
+ o.entries = p.slice(), a();
1746
1752
  }), r;
1747
1753
  }
1748
1754
  function Xr(e, t) {
@@ -1764,21 +1770,21 @@ function Ne(e) {
1764
1770
  return !!(e && (e.scrollHeight > e.clientHeight + 1 || e.scrollWidth > e.clientWidth + 1) && getComputedStyle(e).overflow !== "hidden");
1765
1771
  }
1766
1772
  function tn(e, t) {
1767
- const r = rn(t.entries, t), n = r.slice(-260);
1773
+ const r = rn(t.entries, t), n = r.slice(-260).reverse();
1768
1774
  Ie(e.sections, t.entries, t.section, "section"), Ie(e.severities, t.entries, t.severity, "severity"), e.count && (e.count.textContent = String(t.entries.length)), e.visibleCount && (e.visibleCount.textContent = String(r.length)), sn(e.stateView, vr(t.entries), t.stateVisible), an(e.list, n, t);
1769
1775
  }
1770
1776
  function rn(e, t = {}) {
1771
- const r = t.section || G, n = t.severity || se, o = nt(t.search), i = t.verbose === !0;
1772
- return (Array.isArray(e) ? e : []).filter((a) => !i && a.noise === !0 || r !== G && a.section !== r || n !== se && a.severity !== n ? !1 : o ? _n(a).includes(o) : !0);
1777
+ const r = t.section || z, n = t.severity || se, o = nt(t.search), i = t.verbose === !0;
1778
+ return (Array.isArray(e) ? e : []).filter((a) => !i && a.noise === !0 || r !== z && a.section !== r || n !== se && a.severity !== n ? !1 : o ? _n(a).includes(o) : !0);
1773
1779
  }
1774
1780
  function Ie(e, t, r, n) {
1775
1781
  if (!e) return;
1776
1782
  e.textContent = "";
1777
1783
  const o = n === "section" ? nn(t) : on(t), i = document.createElement("button");
1778
- i.type = "button", i.dataset[`${n}Filter`] = G, i.className = r === G ? "chip is-active" : "chip", i.textContent = `All ${t.length}`, e.appendChild(i);
1784
+ i.type = "button", i.dataset[`${n}Filter`] = z, i.className = r === z ? "chip is-active" : "chip", i.textContent = `All ${t.length}`, e.appendChild(i);
1779
1785
  for (const a of o) {
1780
- const s = t.filter((d) => d[n] === a).length, c = document.createElement("button");
1781
- c.type = "button", c.dataset[`${n}Filter`] = a, c.className = r === a ? `chip is-active ${n}-${O(a)}` : `chip ${n}-${O(a)}`, c.textContent = `${at(a)} ${s}`, e.appendChild(c);
1786
+ const s = t.filter((c) => c[n] === a).length, d = document.createElement("button");
1787
+ d.type = "button", d.dataset[`${n}Filter`] = a, d.className = r === a ? `chip is-active ${n}-${B(a)}` : `chip ${n}-${B(a)}`, d.textContent = `${at(a)} ${s}`, e.appendChild(d);
1782
1788
  }
1783
1789
  }
1784
1790
  function nn(e) {
@@ -1799,7 +1805,7 @@ function an(e, t, r) {
1799
1805
  const n = document.createDocumentFragment();
1800
1806
  if (r.grouped) for (const o of yn(t)) n.appendChild(wn(o));
1801
1807
  else for (const o of t) n.appendChild(rt(o));
1802
- e.appendChild(n), r.follow && requestAnimationFrame(() => e.scrollTop = e.scrollHeight);
1808
+ e.appendChild(n), r.follow && requestAnimationFrame(() => e.scrollTop = 0);
1803
1809
  }
1804
1810
  function sn(e, t, r) {
1805
1811
  if (!e || (e.textContent = "", e.classList.toggle("is-hidden", !r), !r)) return;
@@ -1808,7 +1814,7 @@ function sn(e, t, r) {
1808
1814
  }
1809
1815
  function cn(e) {
1810
1816
  const t = document.createElement("section");
1811
- return t.className = `viz-card flow-card status-${O(e.status)}`, t.appendChild(ge("Flow State", e.status)), tt(t, [
1817
+ return t.className = `viz-card flow-card status-${B(e.status)}`, t.appendChild(ge("Flow State", e.status)), tt(t, [
1812
1818
  ["Current", e.current],
1813
1819
  ["Session", e.sessionId],
1814
1820
  ["Request", [e.requestType, e.actionType].filter(Boolean).join(" / ")],
@@ -1822,8 +1828,8 @@ function cn(e) {
1822
1828
  function ln(e) {
1823
1829
  const t = document.createElement("section");
1824
1830
  return t.className = "viz-card context-card", t.appendChild(ge("Context State", e.panel?.screenType || e.ui?.rootType || "empty")), tt(t, [
1825
- ["Intent", fn(e.intent)],
1826
- ["Route", pn(e.route)],
1831
+ ["Intent", pn(e.intent)],
1832
+ ["Route", fn(e.route)],
1827
1833
  ["Screen", mn(e)],
1828
1834
  ["Last search", gn(e.panel?.lastSearch)],
1829
1835
  ["Products", hn(e.panel, e.products)],
@@ -1839,7 +1845,7 @@ function un(e) {
1839
1845
  if (r.className = "timeline", e.length)
1840
1846
  for (const n of e) {
1841
1847
  const o = document.createElement("li");
1842
- o.className = `timeline-step step-${O(n.status || "done")}`;
1848
+ o.className = `timeline-step step-${B(n.status || "done")}`;
1843
1849
  const i = document.createElement("span");
1844
1850
  i.className = "timeline-time", i.textContent = it(n.at);
1845
1851
  const a = document.createElement("span");
@@ -1875,14 +1881,14 @@ function tt(e, t) {
1875
1881
  function dn(e) {
1876
1882
  return !e.errors && !e.warnings ? "clean" : `${e.errors || 0} errors, ${e.warnings || 0} warnings`;
1877
1883
  }
1878
- function fn(e) {
1884
+ function pn(e) {
1879
1885
  return e ? [
1880
1886
  e.kind,
1881
1887
  e.target,
1882
1888
  e.confidence != null ? `conf ${e.confidence}` : ""
1883
1889
  ].filter(Boolean).join(" / ") : "";
1884
1890
  }
1885
- function pn(e) {
1891
+ function fn(e) {
1886
1892
  return e ? [e.search ? [
1887
1893
  e.search.query,
1888
1894
  e.search.category,
@@ -1939,7 +1945,7 @@ function yn(e) {
1939
1945
  }
1940
1946
  function wn(e) {
1941
1947
  const t = document.createElement("section");
1942
- t.className = `group group-${O(e.severity)}`, t.dataset.section = e.section;
1948
+ t.className = `group group-${B(e.severity)}`, t.dataset.section = e.section;
1943
1949
  const r = document.createElement("div");
1944
1950
  r.className = "group-head";
1945
1951
  const n = document.createElement("span");
@@ -1953,38 +1959,48 @@ function wn(e) {
1953
1959
  }
1954
1960
  function rt(e) {
1955
1961
  const t = document.createElement("details");
1956
- t.dataset.entryId = String(e.id || ""), t.dataset.section = e.section || "Runtime", t.dataset.severity = e.severity || "info", t.className = `entry entry-${O(e.severity || "info")}`, t.open = e.severity === "error";
1957
- const r = document.createElement("summary"), n = document.createElement("span");
1958
- n.className = "time", n.textContent = it(e.at);
1962
+ t.dataset.entryId = String(e.id || ""), t.dataset.section = e.section || "Runtime", t.dataset.severity = e.severity || "info", t.className = `entry entry-${B(e.severity || "info")}`, t.open = e.severity === "error";
1963
+ const r = document.createElement("summary"), n = document.createElement("div");
1964
+ n.className = "entry-meta";
1959
1965
  const o = document.createElement("span");
1960
- o.className = "section", o.textContent = e.section || "Runtime";
1966
+ o.className = "sev-dot";
1961
1967
  const i = document.createElement("span");
1962
- i.className = "severity", i.textContent = at(e.severity || "info");
1968
+ i.className = "time", i.textContent = it(e.at);
1963
1969
  const a = document.createElement("span");
1964
- a.className = "title", a.textContent = ot(e), r.append(n, o, i, a);
1965
- const s = document.createElement("div");
1966
- s.className = "entry-body";
1967
- const c = document.createElement("div");
1968
- c.className = "entry-toolbar";
1969
- const d = document.createElement("span");
1970
- d.className = "kind", d.textContent = e.kind;
1971
- const f = document.createElement("span");
1972
- f.className = "kind", f.textContent = e.group || "";
1973
- const b = document.createElement("button");
1974
- b.type = "button", b.dataset.action = "copy-json", b.dataset.entryId = String(e.id || ""), b.textContent = "Copy JSON", c.append(d, f, b);
1975
- const m = document.createElement("pre"), l = document.createElement("code");
1976
- return l.innerHTML = vn(e), m.appendChild(l), s.append(c, m), t.append(r, s), t;
1970
+ a.className = "section", a.textContent = e.section || "Runtime";
1971
+ const s = document.createElement("span");
1972
+ if (s.className = "kind-chip", s.textContent = e.kind || "", n.append(o, i, a, s), e.severity === "warn" || e.severity === "error") {
1973
+ const l = document.createElement("span");
1974
+ l.className = "severity", l.textContent = at(e.severity), n.append(l);
1975
+ }
1976
+ const d = document.createElement("div");
1977
+ d.className = "entry-title-row";
1978
+ const c = document.createElement("span");
1979
+ c.className = "caret", c.textContent = "";
1980
+ const p = document.createElement("span");
1981
+ p.className = "title", p.textContent = ot(e), d.append(c, p), r.append(n, d);
1982
+ const b = document.createElement("div");
1983
+ b.className = "entry-body";
1984
+ const m = document.createElement("div");
1985
+ if (m.className = "entry-toolbar", e.group) {
1986
+ const l = document.createElement("span");
1987
+ l.className = "kind", l.textContent = e.group, m.append(l);
1988
+ }
1989
+ const u = document.createElement("button");
1990
+ u.type = "button", u.dataset.action = "copy-json", u.dataset.entryId = String(e.id || ""), u.textContent = "Copy JSON", m.append(u);
1991
+ const f = document.createElement("pre"), g = document.createElement("code");
1992
+ return g.innerHTML = vn(e), f.appendChild(g), b.append(m, f), t.append(r, b), t;
1977
1993
  }
1978
1994
  function vn(e) {
1979
1995
  const t = he(e), r = /("(?:\\u[\da-fA-F]{4}|\\[^u]|[^\\"])*"(?:\s*:)?|\btrue\b|\bfalse\b|\bnull\b|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/gu;
1980
1996
  let n = "", o = 0;
1981
1997
  for (const i of t.matchAll(r)) {
1982
1998
  const a = i[0];
1983
- n += H(t.slice(o, i.index));
1999
+ n += G(t.slice(o, i.index));
1984
2000
  let s = "json-number";
1985
- a.startsWith('"') ? s = a.endsWith(":") ? "json-key" : "json-string" : a === "true" || a === "false" ? s = "json-boolean" : a === "null" && (s = "json-null"), n += `<span class="${s}">${H(a)}</span>`, o = i.index + a.length;
2001
+ a.startsWith('"') ? s = a.endsWith(":") ? "json-key" : "json-string" : a === "true" || a === "false" ? s = "json-boolean" : a === "null" && (s = "json-null"), n += `<span class="${s}">${G(a)}</span>`, o = i.index + a.length;
1986
2002
  }
1987
- return n + H(t.slice(o));
2003
+ return n + G(t.slice(o));
1988
2004
  }
1989
2005
  function xn(e, t) {
1990
2006
  if (!e) return;
@@ -2055,9 +2071,10 @@ function Sn(e) {
2055
2071
  <style>
2056
2072
  :host { all: initial; }
2057
2073
  .panel {
2058
- width: 560px;
2074
+ width: 460px;
2059
2075
  max-width: calc(100vw - 20px);
2060
- max-height: min(82vh, 820px);
2076
+ height: 100%;
2077
+ max-height: 100%;
2061
2078
  display: flex;
2062
2079
  flex-direction: column;
2063
2080
  overflow: hidden;
@@ -2069,6 +2086,7 @@ function Sn(e) {
2069
2086
  font: 12px/1.4 Inter, Arial, sans-serif;
2070
2087
  }
2071
2088
  .head {
2089
+ position: relative;
2072
2090
  display: flex;
2073
2091
  align-items: center;
2074
2092
  justify-content: space-between;
@@ -2078,6 +2096,34 @@ function Sn(e) {
2078
2096
  color: #fff;
2079
2097
  font-weight: 700;
2080
2098
  }
2099
+ .filters-popup {
2100
+ position: absolute;
2101
+ top: calc(100% + 4px);
2102
+ right: 8px;
2103
+ left: 8px;
2104
+ z-index: 5;
2105
+ display: flex;
2106
+ flex-direction: column;
2107
+ gap: 10px;
2108
+ padding: 10px;
2109
+ background: #fff;
2110
+ color: #1f2937;
2111
+ border: 1px solid #cbd5e1;
2112
+ border-radius: 8px;
2113
+ box-shadow: 0 14px 36px rgba(17, 24, 39, 0.28);
2114
+ }
2115
+ .filters-popup.is-hidden { display: none; }
2116
+ .popup-group { display: flex; flex-direction: column; gap: 5px; }
2117
+ .popup-label {
2118
+ font-size: 10px;
2119
+ font-weight: 800;
2120
+ letter-spacing: 0.04em;
2121
+ text-transform: uppercase;
2122
+ color: #64748b;
2123
+ }
2124
+ .actions button[data-action="filters-toggle"][aria-pressed="true"] {
2125
+ background: rgba(255, 255, 255, 0.28);
2126
+ }
2081
2127
  .meta { display: flex; gap: 7px; align-items: center; min-width: 0; }
2082
2128
  .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
2083
2129
  .count { color: #d1d5db; font-weight: 600; white-space: nowrap; }
@@ -2094,9 +2140,7 @@ function Sn(e) {
2094
2140
  }
2095
2141
  button:hover { filter: brightness(1.08); }
2096
2142
  .controls {
2097
- display: grid;
2098
- gap: 7px;
2099
- padding: 8px;
2143
+ padding: 7px 8px;
2100
2144
  background: #f8fafc;
2101
2145
  border-bottom: 1px solid #d9dee7;
2102
2146
  }
@@ -2135,7 +2179,7 @@ function Sn(e) {
2135
2179
  .severity-warn { border-color: #f59e0b; }
2136
2180
  .severity-error { border-color: #ef4444; }
2137
2181
  .list {
2138
- flex: 1 1 auto;
2182
+ flex: 1.4 1 0;
2139
2183
  min-height: 0;
2140
2184
  overflow: auto;
2141
2185
  overscroll-behavior: contain;
@@ -2143,26 +2187,34 @@ function Sn(e) {
2143
2187
  padding: 8px;
2144
2188
  background: #f1f5f9;
2145
2189
  }
2190
+ /* The state dashboard (flow + context + timeline) is the most valuable
2191
+ trace surface, so it gets a real vertical share of the rail — a single
2192
+ column (full width, nothing squeezed) that scrolls internally and is
2193
+ capped to ~45% of the panel so the log below always stays visible. */
2146
2194
  .state-view {
2147
- display: grid;
2148
- grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
2195
+ display: flex;
2196
+ flex-direction: column;
2149
2197
  gap: 8px;
2150
2198
  padding: 8px;
2151
2199
  background: #eef4fb;
2152
2200
  border-bottom: 1px solid #d9dee7;
2153
- max-height: 280px;
2201
+ flex: 1 1 0;
2202
+ min-height: 120px;
2154
2203
  overflow: auto;
2155
2204
  overscroll-behavior: contain;
2156
2205
  }
2157
2206
  .state-view.is-hidden { display: none; }
2158
2207
  .viz-card {
2159
2208
  min-width: 0;
2209
+ /* In the flex-column state-view, keep each card at its natural content
2210
+ height — never let flex shrink it to its title. The state-view
2211
+ itself scrolls when the cards together exceed its cap. */
2212
+ flex: none;
2160
2213
  border: 1px solid #cbd5e1;
2161
2214
  border-radius: 7px;
2162
2215
  background: #fff;
2163
2216
  overflow: hidden;
2164
2217
  }
2165
- .timeline-card { grid-column: 1 / -1; }
2166
2218
  .viz-title {
2167
2219
  display: flex;
2168
2220
  justify-content: space-between;
@@ -2194,16 +2246,18 @@ function Sn(e) {
2194
2246
  gap: 6px;
2195
2247
  padding: 5px 8px;
2196
2248
  border-top: 1px solid #eef2f7;
2249
+ align-items: baseline;
2197
2250
  }
2198
2251
  .viz-key {
2199
2252
  color: #64748b;
2200
2253
  font-weight: 750;
2201
2254
  }
2255
+ /* Wrap rather than ellipsis so no state value is silently clipped. */
2202
2256
  .viz-value {
2203
2257
  color: #111827;
2204
- overflow: hidden;
2205
- text-overflow: ellipsis;
2206
- white-space: nowrap;
2258
+ min-width: 0;
2259
+ word-break: break-word;
2260
+ overflow-wrap: anywhere;
2207
2261
  }
2208
2262
  .timeline {
2209
2263
  list-style: none;
@@ -2214,9 +2268,9 @@ function Sn(e) {
2214
2268
  }
2215
2269
  .timeline-step, .timeline-empty {
2216
2270
  display: grid;
2217
- grid-template-columns: 70px 70px minmax(0, 1fr);
2271
+ grid-template-columns: 64px auto minmax(0, 1fr);
2218
2272
  gap: 7px;
2219
- align-items: center;
2273
+ align-items: baseline;
2220
2274
  padding: 5px 8px;
2221
2275
  border-top: 1px solid #eef2f7;
2222
2276
  }
@@ -2226,21 +2280,17 @@ function Sn(e) {
2226
2280
  }
2227
2281
  .timeline-label {
2228
2282
  width: fit-content;
2229
- max-width: 70px;
2230
- overflow: hidden;
2231
- text-overflow: ellipsis;
2232
- white-space: nowrap;
2233
2283
  border-radius: 999px;
2234
- padding: 1px 6px;
2284
+ padding: 1px 7px;
2235
2285
  background: #e2e8f0;
2236
2286
  color: #334155;
2237
2287
  font-weight: 750;
2288
+ white-space: nowrap;
2238
2289
  }
2239
2290
  .timeline-detail {
2240
2291
  min-width: 0;
2241
- overflow: hidden;
2242
- text-overflow: ellipsis;
2243
- white-space: nowrap;
2292
+ word-break: break-word;
2293
+ overflow-wrap: anywhere;
2244
2294
  }
2245
2295
  .step-running .timeline-label { background: #dbeafe; color: #1d4ed8; }
2246
2296
  .step-warn .timeline-label { background: #fef3c7; color: #92400e; }
@@ -2277,10 +2327,12 @@ function Sn(e) {
2277
2327
  border: 1px solid #d6dce6;
2278
2328
  border-left-width: 4px;
2279
2329
  border-radius: 6px;
2280
- margin: 0 0 7px;
2330
+ margin: 0 0 6px;
2281
2331
  background: #fff;
2282
2332
  overflow: hidden;
2283
2333
  }
2334
+ details.entry:hover { border-color: #b6c2d4; }
2335
+ details.entry[open] { box-shadow: 0 1px 4px rgba(17, 24, 39, 0.1); }
2284
2336
  .group details.entry {
2285
2337
  border-left-width: 4px;
2286
2338
  border-right-width: 0;
@@ -2288,40 +2340,79 @@ function Sn(e) {
2288
2340
  border-radius: 0;
2289
2341
  margin: 0;
2290
2342
  }
2291
- details[data-severity="info"] { border-left-color: #64748b; }
2343
+ details[data-severity="info"] { border-left-color: #94a3b8; }
2292
2344
  details[data-severity="warn"] { border-left-color: #f59e0b; }
2293
2345
  details[data-severity="error"] { border-left-color: #ef4444; }
2294
2346
  summary {
2295
2347
  cursor: pointer;
2296
- padding: 7px 8px;
2297
- display: grid;
2298
- grid-template-columns: 70px 86px 54px minmax(0, 1fr);
2299
- gap: 7px;
2300
- align-items: center;
2348
+ padding: 6px 9px;
2349
+ display: flex;
2350
+ flex-direction: column;
2351
+ gap: 3px;
2301
2352
  color: #1f2937;
2353
+ list-style: none;
2302
2354
  }
2303
- .time { color: #64748b; font-variant-numeric: tabular-nums; }
2355
+ summary::-webkit-details-marker { display: none; }
2356
+ .entry-meta {
2357
+ display: flex;
2358
+ align-items: center;
2359
+ gap: 7px;
2360
+ flex-wrap: wrap;
2361
+ }
2362
+ .sev-dot {
2363
+ width: 7px;
2364
+ height: 7px;
2365
+ border-radius: 50%;
2366
+ background: #94a3b8;
2367
+ flex: none;
2368
+ }
2369
+ [data-severity="warn"] .sev-dot { background: #f59e0b; }
2370
+ [data-severity="error"] .sev-dot { background: #ef4444; }
2371
+ .time { color: #64748b; font-variant-numeric: tabular-nums; font-size: 11px; }
2304
2372
  .section, .severity {
2305
- width: fit-content;
2306
- max-width: 86px;
2307
- overflow: hidden;
2308
- text-overflow: ellipsis;
2309
- white-space: nowrap;
2310
- padding: 2px 6px;
2373
+ padding: 1px 7px;
2311
2374
  border-radius: 999px;
2312
2375
  background: #eef2f7;
2313
2376
  color: #334155;
2314
- font-weight: 750;
2377
+ font-weight: 700;
2378
+ font-size: 11px;
2379
+ letter-spacing: 0.01em;
2380
+ }
2381
+ .kind-chip {
2382
+ color: #64748b;
2383
+ font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
2384
+ background: #f1f5f9;
2385
+ border-radius: 4px;
2386
+ padding: 1px 5px;
2315
2387
  }
2316
2388
  [data-section="Flow"] .section { background: #e0f2fe; color: #075985; }
2317
2389
  [data-section="Tools"] .section { background: #dcfce7; color: #166534; }
2318
2390
  [data-section="Backend"] .section { background: #ffedd5; color: #9a3412; }
2319
2391
  [data-section="Intent"] .section { background: #ede9fe; color: #5b21b6; }
2320
2392
  [data-section="Telemetry"] .section { background: #ccfbf1; color: #115e59; }
2321
- [data-severity="info"] .severity { background: #e2e8f0; color: #334155; }
2322
2393
  [data-severity="warn"] .severity { background: #fef3c7; color: #92400e; }
2323
2394
  [data-severity="error"] .severity { background: #fee2e2; color: #991b1b; }
2324
- .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
2395
+ .entry-title-row {
2396
+ display: flex;
2397
+ gap: 6px;
2398
+ align-items: baseline;
2399
+ }
2400
+ .caret {
2401
+ color: #94a3b8;
2402
+ flex: none;
2403
+ transition: transform 0.12s ease;
2404
+ font-size: 10px;
2405
+ line-height: 1.5;
2406
+ }
2407
+ details[open] .caret { transform: rotate(90deg); }
2408
+ /* Title wraps to full width — no truncation, no information loss. */
2409
+ .title {
2410
+ color: #1f2937;
2411
+ font-weight: 600;
2412
+ word-break: break-word;
2413
+ overflow-wrap: anywhere;
2414
+ }
2415
+ details[data-severity="error"] .title { color: #991b1b; }
2325
2416
  .entry-body { border-top: 1px solid #d6dce6; background: #0b1020; }
2326
2417
  .entry-toolbar {
2327
2418
  display: flex;
@@ -2362,37 +2453,53 @@ function Sn(e) {
2362
2453
  .json-number { color: #fbbf24; }
2363
2454
  .json-boolean { color: #f0abfc; }
2364
2455
  .json-null { color: #cbd5e1; }
2456
+ /* Minimized: collapse to just the header. The body sections are hidden
2457
+ AND the panel/host stop reserving full viewport height (the host's
2458
+ inline bottom offset is released in JS), so only the title bar remains
2459
+ and the page underneath is clickable again. */
2460
+ .is-minimized { height: auto; max-height: none; }
2365
2461
  .is-minimized .controls, .is-minimized .list { display: none; }
2366
2462
  .is-minimized .state-view { display: none; }
2463
+ .is-minimized .filters-popup { display: none; }
2367
2464
  @media (max-width: 620px) {
2368
2465
  .panel { width: calc(100vw - 20px); }
2369
- .state-view { grid-template-columns: 1fr; max-height: 240px; }
2370
- summary { grid-template-columns: 62px 76px 50px minmax(0, 1fr); }
2371
2466
  }
2372
2467
  </style>
2373
2468
  <div class="panel" data-role="panel">
2374
2469
  <div class="head">
2375
2470
  <div class="meta">
2376
- <span class="name">Agentic Activity - ${H(e)}</span>
2471
+ <span class="name" title="${G(e)}">${G(e)}</span>
2377
2472
  <span class="count"><span data-role="visible-count">0</span>/<span data-role="count">0</span></span>
2378
2473
  </div>
2379
2474
  <div class="actions">
2475
+ <button type="button" data-action="filters-toggle" aria-pressed="false" title="Filters & view options">Filters ▾</button>
2380
2476
  <button type="button" data-action="clear">Clear</button>
2381
2477
  <button type="button" data-action="toggle">Min</button>
2382
2478
  </div>
2479
+ <div class="filters-popup is-hidden" data-role="filters-popup">
2480
+ <div class="popup-group">
2481
+ <div class="popup-label">Section</div>
2482
+ <div class="filters" data-role="section-filters"></div>
2483
+ </div>
2484
+ <div class="popup-group">
2485
+ <div class="popup-label">Severity</div>
2486
+ <div class="filters" data-role="severity-filters"></div>
2487
+ </div>
2488
+ <div class="popup-group">
2489
+ <div class="popup-label">View</div>
2490
+ <div class="toggles">
2491
+ <button type="button" data-action="state" aria-pressed="true">State</button>
2492
+ <button type="button" data-action="group" aria-pressed="false">Flat</button>
2493
+ <button type="button" data-action="follow" aria-pressed="true">Follow</button>
2494
+ <button type="button" data-action="verbose" aria-pressed="false">Concise</button>
2495
+ <button type="button" data-action="expand-all">Expand all</button>
2496
+ <button type="button" data-action="collapse-all">Collapse all</button>
2497
+ </div>
2498
+ </div>
2499
+ </div>
2383
2500
  </div>
2384
2501
  <div class="controls">
2385
2502
  <input class="search" type="search" data-role="search" placeholder="Filter by tool, op, kind, title, or JSON value" />
2386
- <div class="filters" data-role="section-filters"></div>
2387
- <div class="filters" data-role="severity-filters"></div>
2388
- <div class="toggles">
2389
- <button type="button" data-action="state" aria-pressed="true">State</button>
2390
- <button type="button" data-action="group" aria-pressed="true">Grouped</button>
2391
- <button type="button" data-action="follow" aria-pressed="true">Follow</button>
2392
- <button type="button" data-action="verbose" aria-pressed="false">Concise</button>
2393
- <button type="button" data-action="expand-all">Expand all</button>
2394
- <button type="button" data-action="collapse-all">Collapse all</button>
2395
- </div>
2396
2503
  </div>
2397
2504
  <div class="state-view" data-role="state-view"></div>
2398
2505
  <div class="list" data-role="list"></div>
@@ -2421,10 +2528,10 @@ function at(e) {
2421
2528
  const t = String(e || "");
2422
2529
  return t ? `${t.slice(0, 1).toLocaleUpperCase("en-US")}${t.slice(1)}` : "";
2423
2530
  }
2424
- function O(e) {
2531
+ function B(e) {
2425
2532
  return String(e || "").toLocaleLowerCase("en-US").replace(/[^a-z0-9]+/gu, "-").replace(/^-|-$/gu, "");
2426
2533
  }
2427
- function H(e) {
2534
+ function G(e) {
2428
2535
  return String(e).replace(/[&<>"']/gu, (t) => t === "&" ? "&amp;" : t === "<" ? "&lt;" : t === ">" ? "&gt;" : t === '"' ? "&quot;" : "&#39;");
2429
2536
  }
2430
2537
  function oa({ accountId: e, config: t = {}, tools: r, beacon: n } = {}) {
@@ -2437,8 +2544,8 @@ function oa({ accountId: e, config: t = {}, tools: r, beacon: n } = {}) {
2437
2544
  wrapTransport() {
2438
2545
  }
2439
2546
  };
2440
- const o = pr(e);
2441
- return window.__GENGAGE_AGENTIC_DEBUG_RECORD__ = (i) => Re(o, i), window.__GENGAGE_AGENTIC_DEBUG_RECORD_BE__ = (i) => Re(o, i), Qr(o), Mr({
2547
+ const o = fr(e);
2548
+ return window.__GENGAGE_AGENTIC_DEBUG_RECORD__ = (i) => Re(o, i), window.__GENGAGE_AGENTIC_DEBUG_RECORD_BE__ = (i) => Re(o, i), Qr(o), $r({
2442
2549
  accountId: e,
2443
2550
  collector: o,
2444
2551
  promptBaseUrl: t.agenticActivityPromptBaseUrl
@@ -2448,10 +2555,10 @@ function oa({ accountId: e, config: t = {}, tools: r, beacon: n } = {}) {
2448
2555
  }), {
2449
2556
  enabled: !0,
2450
2557
  collector: o,
2451
- tools: Or(r, o),
2452
- beacon: Fr(n, o),
2558
+ tools: Br(r, o),
2559
+ beacon: Or(n, o),
2453
2560
  record: (i) => o.record(i),
2454
- wrapTransport: () => $r(e, o)
2561
+ wrapTransport: () => Mr(e, o)
2455
2562
  };
2456
2563
  }
2457
2564
  function Tn(e, t = {}) {
@@ -2520,10 +2627,10 @@ var An = [
2520
2627
  "count",
2521
2628
  "privacy"
2522
2629
  ];
2523
- function ia({ accountId: e, search: t, facetedSearch: r, similaritySearch: n, searchGiftOptions: o, filters: i = {}, resultContract: a = {}, limitations: s = [], extraTools: c = [] } = {}) {
2630
+ function ia({ accountId: e, search: t, facetedSearch: r, similaritySearch: n, searchGiftOptions: o, filters: i = {}, resultContract: a = {}, limitations: s = [], extraTools: d = [] } = {}) {
2524
2631
  return {
2525
- searchKeyword: async (f = {}, b = {}) => t(In(f, b)),
2526
- facetedSearch: typeof r == "function" ? (f = {}, b = {}) => r(qe(f, b)) : async (f = {}, b = {}) => t(qe(f, b)),
2632
+ searchKeyword: async (p = {}, b = {}) => t(In(p, b)),
2633
+ facetedSearch: typeof r == "function" ? (p = {}, b = {}) => r(qe(p, b)) : async (p = {}, b = {}) => t(qe(p, b)),
2527
2634
  getSearchCapabilities: () => Nn({
2528
2635
  accountId: e,
2529
2636
  hasSimilarity: typeof n == "function",
@@ -2531,7 +2638,7 @@ function ia({ accountId: e, search: t, facetedSearch: r, similaritySearch: n, se
2531
2638
  filters: i,
2532
2639
  resultContract: a,
2533
2640
  limitations: s,
2534
- extraTools: c
2641
+ extraTools: d
2535
2642
  })
2536
2643
  };
2537
2644
  }
@@ -2617,24 +2724,24 @@ function Un(e) {
2617
2724
  function ce(e) {
2618
2725
  return Object.fromEntries(Object.entries(e || {}).filter(([, t]) => t != null && t !== "" && (!Array.isArray(t) || t.length)));
2619
2726
  }
2620
- var qn = 15e3, Bn = "glov_agentic_iframe", On = "position:absolute;width:1px;height:1px;left:-9999px;top:-9999px;opacity:0;pointer-events:none;";
2621
- function aa({ markerParam: e = Bn, markerValue: t = "agentic-scraper", frameName: r = t, sandbox: n = "allow-same-origin", timeoutMs: o = qn, hiddenStyle: i = On, messageType: a, parser: s, isBlockedDocument: c } = {}) {
2622
- const d = a || `gengage:agentic-iframe-scraper:${t}`;
2623
- function f(p, g = {}) {
2624
- const u = new URL(String(p), re());
2625
- for (const [h, w] of Object.entries(g || {})) w != null && w !== "" && u.searchParams.set(h, String(w));
2626
- return u.searchParams.set(e, t), u.href;
2727
+ var qn = 15e3, Fn = "glov_agentic_iframe", Bn = "position:absolute;width:1px;height:1px;left:-9999px;top:-9999px;opacity:0;pointer-events:none;";
2728
+ function aa({ markerParam: e = Fn, markerValue: t = "agentic-scraper", frameName: r = t, sandbox: n = "allow-same-origin", timeoutMs: o = qn, hiddenStyle: i = Bn, messageType: a, parser: s, isBlockedDocument: d } = {}) {
2729
+ const c = a || `gengage:agentic-iframe-scraper:${t}`;
2730
+ function p(f, g = {}) {
2731
+ const l = new URL(String(f), re());
2732
+ for (const [h, w] of Object.entries(g || {})) w != null && w !== "" && l.searchParams.set(h, String(w));
2733
+ return l.searchParams.set(e, t), l.href;
2627
2734
  }
2628
- function b(p = globalThis.window?.location, g = globalThis.window?.name || "") {
2735
+ function b(f = globalThis.window?.location, g = globalThis.window?.name || "") {
2629
2736
  if (g === r || g === t) return !0;
2630
2737
  try {
2631
- return new URL(p?.href || String(p || ""), re()).searchParams.get(e) === t;
2738
+ return new URL(f?.href || String(f || ""), re()).searchParams.get(e) === t;
2632
2739
  } catch {
2633
2740
  return !1;
2634
2741
  }
2635
2742
  }
2636
- async function m(p, g = {}, u = {}) {
2637
- const h = u.parser || s, w = u.isBlockedDocument || c, k = globalThis.document, v = globalThis.window;
2743
+ async function m(f, g = {}, l = {}) {
2744
+ const h = l.parser || s, w = l.isBlockedDocument || d, k = globalThis.document, v = globalThis.window;
2638
2745
  if (!k?.body || typeof k.createElement != "function" || typeof k.body.appendChild != "function") return {
2639
2746
  attempted: !1,
2640
2747
  doc: null,
@@ -2643,15 +2750,15 @@ function aa({ markerParam: e = Bn, markerValue: t = "agentic-scraper", frameName
2643
2750
  timedOut: !1,
2644
2751
  via: "unavailable"
2645
2752
  };
2646
- const T = f(p), x = k.createElement("iframe");
2753
+ const T = p(f), x = k.createElement("iframe");
2647
2754
  x.name = r;
2648
2755
  try {
2649
2756
  x.sandbox = n;
2650
2757
  } catch {
2651
2758
  }
2652
2759
  return x.style && (x.style.cssText = i), new Promise((C) => {
2653
- let $ = !1;
2654
- const z = typeof v?.addEventListener == "function" && typeof v?.removeEventListener == "function", ut = v.setTimeout(() => {
2760
+ let M = !1;
2761
+ const H = typeof v?.addEventListener == "function" && typeof v?.removeEventListener == "function", ut = v.setTimeout(() => {
2655
2762
  ee({
2656
2763
  attempted: !0,
2657
2764
  doc: null,
@@ -2662,15 +2769,15 @@ function aa({ markerParam: e = Bn, markerValue: t = "agentic-scraper", frameName
2662
2769
  });
2663
2770
  }, o);
2664
2771
  function dt() {
2665
- v.clearTimeout(ut), z && v.removeEventListener("message", ke), typeof x.remove == "function" && x.remove();
2772
+ v.clearTimeout(ut), H && v.removeEventListener("message", ke), typeof x.remove == "function" && x.remove();
2666
2773
  }
2667
2774
  function ee(A) {
2668
- $ || ($ = !0, dt(), C(A));
2775
+ M || (M = !0, dt(), C(A));
2669
2776
  }
2670
2777
  function ke(A) {
2671
2778
  if (A.source && x.contentWindow && A.source !== x.contentWindow) return;
2672
2779
  const L = A.data;
2673
- !L || L.type !== d || L.marker !== t || ee({
2780
+ !L || L.type !== c || L.marker !== t || ee({
2674
2781
  attempted: !0,
2675
2782
  doc: null,
2676
2783
  result: L.payload || null,
@@ -2696,18 +2803,18 @@ function aa({ markerParam: e = Bn, markerValue: t = "agentic-scraper", frameName
2696
2803
  });
2697
2804
  } catch {
2698
2805
  }
2699
- }), z && v.addEventListener("message", ke), k.body.appendChild(x), x.src = T;
2806
+ }), H && v.addEventListener("message", ke), k.body.appendChild(x), x.src = T;
2700
2807
  });
2701
2808
  }
2702
- function l(p = s, { targetOrigin: g = re() } = {}) {
2703
- const u = globalThis.window;
2704
- if (!u?.parent || !b(u.location, u.name)) return !1;
2705
- const h = typeof p == "function" ? p(globalThis.document, {
2706
- url: u.location?.href || "",
2809
+ function u(f = s, { targetOrigin: g = re() } = {}) {
2810
+ const l = globalThis.window;
2811
+ if (!l?.parent || !b(l.location, l.name)) return !1;
2812
+ const h = typeof f == "function" ? f(globalThis.document, {
2813
+ url: l.location?.href || "",
2707
2814
  input: {}
2708
- }) : p;
2709
- return u.parent.postMessage({
2710
- type: d,
2815
+ }) : f;
2816
+ return l.parent.postMessage({
2817
+ type: c,
2711
2818
  marker: t,
2712
2819
  payload: h
2713
2820
  }, g || "*"), !0;
@@ -2716,11 +2823,11 @@ function aa({ markerParam: e = Bn, markerValue: t = "agentic-scraper", frameName
2716
2823
  markerParam: e,
2717
2824
  markerValue: t,
2718
2825
  frameName: r,
2719
- messageType: d,
2720
- decorateUrl: f,
2826
+ messageType: c,
2827
+ decorateUrl: p,
2721
2828
  isScraperFrame: b,
2722
2829
  load: m,
2723
- postCurrentDocument: l
2830
+ postCurrentDocument: u
2724
2831
  };
2725
2832
  }
2726
2833
  function sa(e, { accountId: t, type: r = "agenticSearchFrame" } = {}) {
@@ -2732,29 +2839,29 @@ function re() {
2732
2839
  function ca({ rootUrl: e, successMessage: t, alreadyCurrentPageMessage: r = t, missingUrlMessage: n = "Ürün sayfasını açmak için ürün bağlantısı gerekiyor." } = {}) {
2733
2840
  const o = new URL(e).origin;
2734
2841
  return async function(a = {}) {
2735
- const s = a.product || {}, c = Fn(a.url || a.productUrl || s.url, e, o), d = a.sku || s.sku || null;
2736
- return c ? Mn(c) ? {
2842
+ const s = a.product || {}, d = On(a.url || a.productUrl || s.url, e, o), c = a.sku || s.sku || null;
2843
+ return d ? $n(d) ? {
2737
2844
  ok: !0,
2738
- sku: d,
2739
- url: c,
2845
+ sku: c,
2846
+ url: d,
2740
2847
  method: "already-current-page",
2741
2848
  alreadyCurrentPage: !0,
2742
2849
  message: r || t
2743
- } : ($n(c), {
2850
+ } : (Mn(d), {
2744
2851
  ok: !0,
2745
- sku: d,
2746
- url: c,
2852
+ sku: c,
2853
+ url: d,
2747
2854
  method: "browser-navigation",
2748
2855
  message: t
2749
2856
  }) : {
2750
2857
  ok: !1,
2751
- sku: d,
2858
+ sku: c,
2752
2859
  reason: "missing-url",
2753
2860
  message: n
2754
2861
  };
2755
2862
  };
2756
2863
  }
2757
- function Fn(e, t, r = new URL(t).origin) {
2864
+ function On(e, t, r = new URL(t).origin) {
2758
2865
  if (!e) return "";
2759
2866
  try {
2760
2867
  const n = new URL(e, t);
@@ -2763,7 +2870,7 @@ function Fn(e, t, r = new URL(t).origin) {
2763
2870
  return "";
2764
2871
  }
2765
2872
  }
2766
- function $n(e) {
2873
+ function Mn(e) {
2767
2874
  if (typeof document > "u") {
2768
2875
  window.location.href = e;
2769
2876
  return;
@@ -2773,7 +2880,7 @@ function $n(e) {
2773
2880
  window.location.href !== e && window.location.assign(e);
2774
2881
  }, 0);
2775
2882
  }
2776
- function Mn(e) {
2883
+ function $n(e) {
2777
2884
  try {
2778
2885
  const t = new URL(globalThis.window?.location?.href || "", e), r = new URL(e, t.href);
2779
2886
  return t.hash = "", r.hash = "", t.href === r.href;
@@ -2782,17 +2889,17 @@ function Mn(e) {
2782
2889
  }
2783
2890
  }
2784
2891
  function Dn({ accountId: e, supplied: t = [], pageProduct: r = null, listingProducts: n = [], skus: o = [], limit: i = 4, storedProducts: a = [], getStoredPanelProducts: s } = {}) {
2785
- const c = st(o), d = Array.isArray(n) ? n : [], f = typeof s == "function" ? s({
2892
+ const d = st(o), c = Array.isArray(n) ? n : [], p = typeof s == "function" ? s({
2786
2893
  accountId: e,
2787
- visibleProducts: d
2894
+ visibleProducts: c
2788
2895
  }) : a;
2789
2896
  return Gn([
2790
2897
  ...K(t),
2791
- ...K(f),
2898
+ ...K(p),
2792
2899
  r,
2793
- ...d
2900
+ ...c
2794
2901
  ], {
2795
- skus: c,
2902
+ skus: d,
2796
2903
  limit: i
2797
2904
  });
2798
2905
  }
@@ -2819,8 +2926,8 @@ function Gn(e, { skus: t = [], limit: r = 4 } = {}) {
2819
2926
  if (!a) continue;
2820
2927
  const s = W(a?.sku);
2821
2928
  if (n.size && !n.has(s)) continue;
2822
- const c = s || W(a?.url) || W(a?.name || a?.title);
2823
- if (!(c && o.has(c)) && (c && o.add(c), i.push(a), i.length >= r))
2929
+ const d = s || W(a?.url) || W(a?.name || a?.title);
2930
+ if (!(d && o.has(d)) && (d && o.add(d), i.push(a), i.length >= r))
2824
2931
  break;
2825
2932
  }
2826
2933
  return i;
@@ -2870,15 +2977,15 @@ function ua({ accountId: e, getPageType: t, getProduct: r, getProducts: n, norma
2870
2977
  };
2871
2978
  }
2872
2979
  function Vn({ accountId: e, getPageType: t, getProduct: r, getProducts: n, normalizeProduct: o, input: i }) {
2873
- const a = _(i.query || i.text || ""), s = ve(i), c = ne(r), d = ne(n) || [];
2980
+ const a = _(i.query || i.text || ""), s = ve(i), d = ne(r), c = ne(n) || [];
2874
2981
  return xe({
2875
2982
  accountId: e,
2876
2983
  url: mo(),
2877
2984
  title: P(document.title || ""),
2878
2985
  pageType: ne(t) || "other",
2879
2986
  viewport: go(),
2880
- product: Be(o(c)),
2881
- products: d.map(o).map(Be).filter(Boolean).slice(0, s.products),
2987
+ product: Fe(o(d)),
2988
+ products: c.map(o).map(Fe).filter(Boolean).slice(0, s.products),
2882
2989
  content: i.includeContent === !1 ? void 0 : ct(i, e).items,
2883
2990
  headings: eo(s.headings),
2884
2991
  controls: i.includeControls === !1 ? void 0 : to(s.controls),
@@ -2965,7 +3072,7 @@ function Zn(e) {
2965
3072
  }), {
2966
3073
  ok: !0,
2967
3074
  command: "scroll_to_text",
2968
- label: F(r),
3075
+ label: O(r),
2969
3076
  message: "Scrolled to the matching page area.",
2970
3077
  privacy: R()
2971
3078
  }) : {
@@ -2994,7 +3101,7 @@ function Qn(e) {
2994
3101
  command: "click_visible_text",
2995
3102
  message: "No safe visible clickable control found."
2996
3103
  };
2997
- const n = F(r);
3104
+ const n = O(r);
2998
3105
  return J.test(n) ? {
2999
3106
  ok: !1,
3000
3107
  blocked: !0,
@@ -3043,16 +3150,16 @@ function eo(e) {
3043
3150
  }
3044
3151
  function to(e) {
3045
3152
  return [...document.querySelectorAll('button,a,[role="button"],summary,input[type="button"],input[type="submit"]')].filter(j).map((t) => ({
3046
- label: F(t),
3153
+ label: O(t),
3047
3154
  tag: t.tagName?.toLowerCase(),
3048
3155
  role: t.getAttribute?.("role") || null,
3049
3156
  href: lt(t),
3050
- safeClick: !J.test(F(t))
3157
+ safeClick: !J.test(O(t))
3051
3158
  })).filter((t) => t.label).filter(X((t) => `${t.tag}:${t.label}:${t.href || ""}`)).slice(0, e);
3052
3159
  }
3053
3160
  function ro(e) {
3054
3161
  return [...document.querySelectorAll('a[href],button,[role="button"],summary')].filter(j).map((t) => {
3055
- const r = F(t), n = lt(t), o = no([
3162
+ const r = O(t), n = lt(t), o = no([
3056
3163
  r,
3057
3164
  n,
3058
3165
  le(t)
@@ -3079,7 +3186,7 @@ function be(e, t) {
3079
3186
  node: n,
3080
3187
  text: _(n.nodeValue || "")
3081
3188
  })).filter(({ text: n }) => n && n.toLocaleLowerCase("tr-TR").includes(r)).map(({ node: n, text: o }) => ({
3082
- snippet: fo(o, e, t.snippetChars),
3189
+ snippet: po(o, e, t.snippetChars),
3083
3190
  tag: n.parentElement?.tagName?.toLowerCase() || "",
3084
3191
  heading: le(n.parentElement)
3085
3192
  })).filter((n) => n.snippet).filter(X((n) => n.snippet)).slice(0, t.textMatches);
@@ -3108,7 +3215,7 @@ function co(e) {
3108
3215
  if (!e) return [];
3109
3216
  const t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode(n) {
3110
3217
  const o = n.parentElement;
3111
- return !o || !j(o) || /^(script|style|noscript|template|svg)$/iu.test(o.tagName || "") || po(o) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
3218
+ return !o || !j(o) || /^(script|style|noscript|template|svg)$/iu.test(o.tagName || "") || fo(o) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
3112
3219
  } }), r = [];
3113
3220
  for (; r.length < 500; ) {
3114
3221
  const n = t.nextNode();
@@ -3118,7 +3225,7 @@ function co(e) {
3118
3225
  return r;
3119
3226
  }
3120
3227
  function lo(e) {
3121
- return [...document.querySelectorAll('button,a,[role="button"],summary,input[type="button"],input[type="submit"]')].filter(j).find((t) => F(t).toLocaleLowerCase("tr-TR").includes(e.toLocaleLowerCase("tr-TR")));
3228
+ return [...document.querySelectorAll('button,a,[role="button"],summary,input[type="button"],input[type="submit"]')].filter(j).find((t) => O(t).toLocaleLowerCase("tr-TR").includes(e.toLocaleLowerCase("tr-TR")));
3122
3229
  }
3123
3230
  function uo(e) {
3124
3231
  const t = be(e, {
@@ -3127,7 +3234,7 @@ function uo(e) {
3127
3234
  })[0];
3128
3235
  return t ? [...document.querySelectorAll("body *")].filter(j).find((r) => _(r.textContent).includes(t.snippet.slice(0, 24))) : null;
3129
3236
  }
3130
- function F(e) {
3237
+ function O(e) {
3131
3238
  return e ? P(_(e.getAttribute?.("aria-label") || e.getAttribute?.("title") || e.getAttribute?.("alt") || e.value || e.textContent || "")).slice(0, 90) : "";
3132
3239
  }
3133
3240
  function le(e) {
@@ -3139,7 +3246,7 @@ function le(e) {
3139
3246
  }
3140
3247
  return "";
3141
3248
  }
3142
- function Be(e) {
3249
+ function Fe(e) {
3143
3250
  return e ? xe({
3144
3251
  sku: _(e.sku || e.id || ""),
3145
3252
  name: _(e.name || e.title || ""),
@@ -3151,7 +3258,7 @@ function Be(e) {
3151
3258
  category: _(e.category || "")
3152
3259
  }) : null;
3153
3260
  }
3154
- function fo(e, t, r) {
3261
+ function po(e, t, r) {
3155
3262
  const n = P(e), o = n.toLocaleLowerCase("tr-TR").indexOf(t.toLocaleLowerCase("tr-TR")), i = Math.max(0, o - Math.floor(r / 3));
3156
3263
  return n.slice(i, i + r).trim();
3157
3264
  }
@@ -3162,7 +3269,7 @@ function j(e) {
3162
3269
  const r = window.getComputedStyle(e);
3163
3270
  return r.visibility !== "hidden" && r.display !== "none" && Number(r.opacity || 1) > 0;
3164
3271
  }
3165
- function po(e) {
3272
+ function fo(e) {
3166
3273
  return !!e.closest?.('input,textarea,select,[contenteditable="true"]');
3167
3274
  }
3168
3275
  function lt(e) {
@@ -3254,12 +3361,12 @@ export {
3254
3361
  Co as FALLBACK_STATUS,
3255
3362
  li as __resetAllCartCoalescersForTesting,
3256
3363
  xi as __resetAllPdpHydratorsForTesting,
3257
- Fi as action,
3364
+ Oi as action,
3258
3365
  Zo as actionButtonsUiSpec,
3259
- Bo as alignProductsToTable,
3366
+ Fo as alignProductsToTable,
3260
3367
  Ho as anonymousRequestText,
3261
3368
  ji as applyCompactionResult,
3262
- Mi as beErrorToAgentError,
3369
+ $i as beErrorToAgentError,
3263
3370
  vr as buildActivityVisualization,
3264
3371
  bi as buildCompactionRequest,
3265
3372
  qi as buildPdpFollowupSteps,
@@ -3269,14 +3376,14 @@ export {
3269
3376
  Ei as buildToolUiSteps,
3270
3377
  Ze as canUseModuleWorker,
3271
3378
  wt as caughtToStreamError,
3272
- fi as coalesceAddToCart,
3379
+ pi as coalesceAddToCart,
3273
3380
  qo as compactAccountConfig,
3274
3381
  ei as compactContextProducts,
3275
3382
  Go as compactObject,
3276
3383
  ii as compactProductSurfaceForLlm,
3277
3384
  Xo as comparisonResultForUi,
3278
3385
  Io as comparisonUiSpec,
3279
- fr as createActivityCollector,
3386
+ pr as createActivityCollector,
3280
3387
  Ge as createBrowserMemory,
3281
3388
  ra as createDiagnosticsTool,
3282
3389
  Ki as createEndpointCachePolicies,
@@ -3301,42 +3408,42 @@ export {
3301
3408
  ui as done,
3302
3409
  Ko as elapsedMs,
3303
3410
  ar as endpointStableKey,
3304
- pi as error,
3411
+ fi as error,
3305
3412
  yi as fallbackStatus,
3306
3413
  rn as filterActivityEntries,
3307
3414
  _i as firstArrayValue,
3308
3415
  vn as formatJsonHtml,
3309
- pr as getOrCreateActivityCollector,
3416
+ fr as getOrCreateActivityCollector,
3310
3417
  yr as groupForEntry,
3311
3418
  Nn as gssSearchCapabilities,
3312
3419
  Po as homePanelReset,
3313
3420
  ai as httpErrorToAgentError,
3314
3421
  zo as inputHashCachePolicy,
3315
3422
  Wo as inspectProductSurface,
3316
- Mr as installActivityFetchPatch,
3423
+ $r as installActivityFetchPatch,
3317
3424
  ea as installBrowserTools,
3318
3425
  Wi as installFetchTransportBridge,
3319
3426
  sa as installIframeScraperBypass,
3320
3427
  oa as installLocalAgenticActivityDebug,
3321
- $o as isFallbackStatus,
3322
- Mo as isRef,
3428
+ Mo as isFallbackStatus,
3429
+ $o as isRef,
3323
3430
  Zi as jsonResponse,
3324
- Bi as llmCacheKey,
3431
+ Fi as llmCacheKey,
3325
3432
  Ro as mergeProductSurfaceEvidence,
3326
3433
  Ci as mergeRoundProducts,
3327
3434
  Pi as metadata,
3328
3435
  Vi as mountAccount,
3329
3436
  Qr as mountActivityOverlay,
3330
- $n as navigateSameTab,
3437
+ Mn as navigateSameTab,
3331
3438
  Yi as ndjsonResponse,
3332
3439
  Qo as normalizeComparisonTable,
3333
3440
  mr as normalizeEntry,
3334
3441
  Ai as normalizeProduct,
3335
- Fn as normalizeSameOriginUrl,
3442
+ On as normalizeSameOriginUrl,
3336
3443
  xo as normalizeSimilarityText,
3337
3444
  jo as nowIso,
3338
3445
  Lo as plainMessageContent,
3339
- Oo as productDetailsUiSpec,
3446
+ Bo as productDetailsUiSpec,
3340
3447
  Ti as productFactsKey,
3341
3448
  Ni as productSkuKey,
3342
3449
  Di as productSurfaceReviewText,
@@ -3350,7 +3457,7 @@ export {
3350
3457
  ki as resolveFlow,
3351
3458
  Dn as resolveProductCandidates,
3352
3459
  ti as retailAnonymizeMessages,
3353
- $i as retailAnonymousRequestText,
3460
+ Mi as retailAnonymousRequestText,
3354
3461
  zi as retailRedactPii,
3355
3462
  gi as routeFlowParams,
3356
3463
  mi as routeSkuList,
@@ -3376,11 +3483,11 @@ export {
3376
3483
  hi as uiSpec,
3377
3484
  Gn as uniqueProductsBySku,
3378
3485
  di as validateToolArgs,
3379
- Fo as withAccountConfig,
3486
+ Oo as withAccountConfig,
3380
3487
  No as withDeclarativeBeOpCache,
3381
3488
  si as withSimilarsAppend,
3382
- Fr as wrapActivityBeacon,
3383
- Or as wrapActivityTools,
3384
- $r as wrapActivityTransport,
3385
- Oi as wrapResolveProductsWithPdpHydration
3489
+ Or as wrapActivityBeacon,
3490
+ Br as wrapActivityTools,
3491
+ Mr as wrapActivityTransport,
3492
+ Bi as wrapResolveProductsWithPdpHydration
3386
3493
  };