@gengage/assistant-fe 0.6.27 → 0.6.29

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.
Files changed (42) hide show
  1. package/dist/agent-ui-steps-WKbTVOS4.js +3197 -0
  2. package/dist/agentic/context/context-store.d.ts +25 -0
  3. package/dist/agentic/index.d.ts +15 -1
  4. package/dist/agentic/index.js +164 -150
  5. package/dist/agentic/types.d.ts +31 -3
  6. package/dist/agentic/worker/agent-ui-steps.d.ts +43 -0
  7. package/dist/agentic/worker/agent-ui.d.ts +44 -0
  8. package/dist/agentic/worker/be-client.d.ts +16 -4
  9. package/dist/agentic/worker/coalesce.d.ts +25 -0
  10. package/dist/agentic/worker/compaction.d.ts +12 -0
  11. package/dist/agentic/worker/pdp-hydrate.d.ts +30 -0
  12. package/dist/agentic/worker/rpc.d.ts +4 -1
  13. package/dist/agentic/worker/tool-schema.d.ts +19 -0
  14. package/dist/agentic/worker.d.ts +15 -1
  15. package/dist/agentic/worker.js +292 -264
  16. package/dist/agentic.iife.js +9 -9
  17. package/dist/{api-paths-C9NwnH29.js → api-paths-DdJr0XJ-.js} +1 -1
  18. package/dist/chat-runtime.js +1 -1
  19. package/dist/chat.iife.js +1 -1
  20. package/dist/chat.js +1 -1
  21. package/dist/{common-Bhl1mzk2.js → common-DlxPSm8-.js} +1 -1
  22. package/dist/common.js +5 -5
  23. package/dist/{connection-warning-D-0Mxk-A.js → connection-warning-B5i-GYl3.js} +1 -1
  24. package/dist/{fastIntent-bAlwVoje.js → fastIntent-BXTc79jM.js} +1 -1
  25. package/dist/index.js +10 -10
  26. package/dist/native.iife.js +1 -1
  27. package/dist/qna-runtime.js +1 -1
  28. package/dist/qna.iife.js +1 -1
  29. package/dist/qna.js +1 -1
  30. package/dist/{runtime-BAFZ7iOP.js → runtime-2RYLgot8.js} +3 -3
  31. package/dist/{runtime-oEtmgT4U.js → runtime-BMBmZgp7.js} +3 -3
  32. package/dist/{runtime-CUNLK1KR.js → runtime-DzSiJPPm.js} +3 -3
  33. package/dist/{simbut-Dt8e5uSk.js → simbut-Bwpt8E03.js} +1 -1
  34. package/dist/simbut.iife.js +1 -1
  35. package/dist/simbut.js +1 -1
  36. package/dist/{simrel-txr23_xG.js → simrel-D0G7CUSn.js} +1 -1
  37. package/dist/simrel-runtime.js +1 -1
  38. package/dist/simrel.iife.js +1 -1
  39. package/dist/simrel.js +2 -2
  40. package/dist/{widget-base-56tkaZZB.js → widget-base-XYJ0Ou6y.js} +1 -1
  41. package/package.json +1 -1
  42. package/dist/route-params-5K4Du1Xa.js +0 -2476
@@ -1,10 +1,10 @@
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 Co, A as Ao, B as ft, C as Ro, D as Po, E as Lo, F as jo, G as No, H as Io, I as Uo, J as qo, K as Bo, L as Oo, M as $o, N as Mo, O as Fo, P as Do, Q as Go, R as zo, S as Ho, T as Wo, U as Vo, V as Ko, W as ue, X as Jo, Y as Yo, Z as Zo, _ as Qo, _t as Xo, a as ei, at as pt, b as ti, c as mt, d as ri, dt as ni, et as oi, f as ii, ft as ai, g as si, gt, h as ci, ht, i as li, it as ui, j as di, k as fi, l as pi, lt as bt, m as mi, mt as Oe, n as gi, nt as yt, o as hi, ot as bi, p as yi, q as wi, r as vi, rt as xi, s as ki, st as $e, t as _i, tt as Si, u as Ei, ut as Ti, v as Ci, vt as Ai, w as Ri, x as Pi, y as Li, z as wt } from "../route-params-5K4Du1Xa.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-WKbTVOS4.js";
3
3
  var vt = 512, xt = 0.74;
4
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() }) {
5
5
  let b = 1;
6
6
  const m = /* @__PURE__ */ new Map();
7
- return ht({
7
+ return bt({
8
8
  worker: t,
9
9
  tools: s,
10
10
  beacon: (l) => c?.({
@@ -16,7 +16,7 @@ function kt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl
16
16
  }), t.addEventListener("message", (l) => {
17
17
  const p = l.data || {};
18
18
  if (p.type === "activity" && p.entry) {
19
- Me(p.entry);
19
+ $e(p.entry);
20
20
  return;
21
21
  }
22
22
  const g = typeof p.id == "number" ? p.id : null;
@@ -65,7 +65,7 @@ function kt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl
65
65
  return;
66
66
  }
67
67
  if (g.addEventListener("abort", w, { once: !0 }), u) {
68
- Fe(l, u).then(k).catch((v) => {
68
+ Me(l, u).then(k).catch((v) => {
69
69
  m.delete(h), p.onError(v instanceof Error ? v : /* @__PURE__ */ new Error("Failed to read image attachment"));
70
70
  });
71
71
  return;
@@ -73,7 +73,7 @@ function kt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl
73
73
  k(l);
74
74
  };
75
75
  }
76
- function Me(e) {
76
+ function $e(e) {
77
77
  const t = window;
78
78
  (t.__GENGAGE_AGENTIC_DEBUG_RECORD__ || t.__GENGAGE_AGENTIC_DEBUG_RECORD_BE__)?.(e);
79
79
  }
@@ -89,15 +89,15 @@ function St({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBr
89
89
  beacon: c,
90
90
  confirmation: d,
91
91
  memory: f ?? Oe()
92
- }), l = wt(m), p = $e({
92
+ }), l = gt(m), p = Fe({
93
93
  accountId: e,
94
94
  ...n ? { devJwtSecret: n } : {},
95
95
  ...o ? { tokenBrokerUrl: o } : {},
96
96
  ...i ? { tokenBrokerAudience: i } : {}
97
97
  });
98
98
  return async (g, u, h, w) => {
99
- const k = await Fe(g || {}, w);
100
- b ||= new bt({
99
+ const k = await Me(g || {}, w);
100
+ b ||= new mt({
101
101
  accountId: e,
102
102
  locale: k?.locale || a,
103
103
  parentUrl: window.location.href,
@@ -115,15 +115,15 @@ function St({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBr
115
115
  ...t,
116
116
  accountId: e,
117
117
  trace: async (v) => {
118
- Me({
118
+ $e({
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: M, browserCache: z }) {
126
- return yt({
125
+ beClient: { invoke({ op: v, input: T, signal: x, cacheTtlS: C, cacheKey: $, browserCache: z }) {
126
+ return ht({
127
127
  beUrl: r,
128
128
  accountId: e,
129
129
  jwtProvider: p,
@@ -131,7 +131,7 @@ function St({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBr
131
131
  op: v,
132
132
  input: T,
133
133
  cacheTtlS: C,
134
- cacheKey: M,
134
+ cacheKey: $,
135
135
  browserCache: z,
136
136
  ...x ? { signal: x } : {}
137
137
  });
@@ -142,7 +142,7 @@ function St({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBr
142
142
  signal: h
143
143
  });
144
144
  } catch (v) {
145
- h?.aborted || (oe(u, pt(v)), u.onDone());
145
+ h?.aborted || (oe(u, wt(v)), u.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) => gt(a, s, {
154
+ return ((a, s) => pt(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 Fe(e, t) {
161
+ async function Me(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),
@@ -440,11 +440,11 @@ function Ot(e) {
440
440
  }
441
441
  setTimeout(r, 5e3);
442
442
  }
443
- var V = "__gengageAgentFetchBridge", $t = 1e3 * 60 * 60 * 24 * 14;
444
- function ji({ accountId: e, streamTransport: t, endpoints: r = {}, endpointCache: n }) {
443
+ var V = "__gengageAgentFetchBridge", Ft = 1e3 * 60 * 60 * 24 * 14;
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 = Mt(), i = `https://gengage-injector.invalid/${encodeURIComponent(e)}`, a = /* @__PURE__ */ new Set(), s = n ? Wt({
447
+ const o = $t(), 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
@@ -463,11 +463,11 @@ function ji({ accountId: e, streamTransport: t, endpoints: r = {}, endpointCache
463
463
  middlewareUrl: i,
464
464
  stop() {
465
465
  for (const d of a) o.routes.delete(d);
466
- Ft(o);
466
+ Mt(o);
467
467
  }
468
468
  };
469
469
  }
470
- function Mt() {
470
+ function $t() {
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 Mt() {
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 Ft(e) {
483
+ function Mt(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];
@@ -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 ?? $t,
623
+ ttlMs: t.ttlMs ?? Ft,
624
624
  policies: t.policies,
625
625
  fetchImpl: r,
626
- jwtProvider: $e({
626
+ jwtProvider: Fe({
627
627
  accountId: e,
628
628
  ...t.devJwtSecret ? { devJwtSecret: t.devJwtSecret } : {},
629
629
  ...t.tokenBrokerUrl ? { tokenBrokerUrl: t.tokenBrokerUrl } : {},
@@ -759,7 +759,7 @@ 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 Ni({ 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: c = {}, beacon: d, confirmation: f, memory: b, allowBlobWorker: m = !1, signal: l }) {
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.");
@@ -873,7 +873,7 @@ function ar(e, t, r = "v1") {
873
873
  request: t
874
874
  })}`;
875
875
  }
876
- function Ii(e) {
876
+ function Ki(e) {
877
877
  const t = e.version || "v1", r = (n) => (o) => ({
878
878
  partition: `${e.partitionPrefix}/${n}`,
879
879
  key: ar(n, o, t),
@@ -885,10 +885,10 @@ function Ii(e) {
885
885
  product_groupings: r("product_groupings")
886
886
  };
887
887
  }
888
- function Ui(e) {
888
+ function Ji(e) {
889
889
  return { ...e };
890
890
  }
891
- function qi(e, t = {}) {
891
+ function Yi(e, t = {}) {
892
892
  return new Response(e.map((r) => JSON.stringify(r)).join(`
893
893
  `) + `
894
894
  `, {
@@ -899,7 +899,7 @@ function qi(e, t = {}) {
899
899
  }
900
900
  });
901
901
  }
902
- function Bi(e, t = {}) {
902
+ function Zi(e, t = {}) {
903
903
  return new Response(JSON.stringify(e), {
904
904
  ...t,
905
905
  headers: {
@@ -912,12 +912,12 @@ function sr(e) {
912
912
  const t = (e?.chat || e?._chat)?.root || e?._chat?.root;
913
913
  return t ? t.getRootNode?.()?.host || t : Array.from(document.querySelectorAll("*")).find((r) => r.shadowRoot?.querySelector?.(".gengage-chat-root, .gengage-chat-launcher-container"));
914
914
  }
915
- function Oi(e, t) {
915
+ function Qi(e, t) {
916
916
  const r = sr(e);
917
917
  r?.style && (t ? r.style.removeProperty("display") : r.style.setProperty("display", "none", "important")), t || (e?.chat || e?._chat)?.close?.();
918
918
  }
919
919
  var cr = "nd_be_url";
920
- function $i(e, t) {
920
+ function Xi(e, t) {
921
921
  const r = lr() || e.beUrl || t;
922
922
  if (!r) throw new Error("resolveBeUrl: backend URL is required. The injector must supply a fallback URL; the SDK has no default.");
923
923
  return r;
@@ -940,7 +940,7 @@ var ur = [
940
940
  "searchGiftOptions",
941
941
  "similaritySearch"
942
942
  ];
943
- function Mi(e, t, r = {}) {
943
+ function ea(e, t, r = {}) {
944
944
  const n = window, o = n.gengage || (n.gengage = {}), i = o.tools || (o.tools = {});
945
945
  i[e] = t;
946
946
  for (const a of r.accountAliases || []) i[a] = t;
@@ -950,7 +950,7 @@ function Mi(e, t, r = {}) {
950
950
  }
951
951
  return t;
952
952
  }
953
- function Fi({ getPageType: e, getProduct: t }) {
953
+ function ta({ getPageType: e, getProduct: t }) {
954
954
  return () => ({
955
955
  url: window.location.href,
956
956
  title: document.title,
@@ -958,7 +958,7 @@ function Fi({ getPageType: e, getProduct: t }) {
958
958
  product: t()
959
959
  });
960
960
  }
961
- function Di({ accountId: e, getPageType: t, getProduct: r, getToolNames: n, getSearchCapabilities: o, getMemory: i }) {
961
+ function ra({ accountId: e, getPageType: t, getProduct: r, getToolNames: n, getSearchCapabilities: o, getMemory: i }) {
962
962
  return async () => ({
963
963
  accountId: e,
964
964
  url: window.location.href,
@@ -970,7 +970,7 @@ function Di({ accountId: e, getPageType: t, getProduct: r, getToolNames: n, getS
970
970
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
971
971
  });
972
972
  }
973
- function Gi({ accountId: e, runtimeFile: t = "runtime.js", startExport: r = "start", globalBaseUrlKey: n, errorLabel: o, trustedRuntimeOrigins: i } = {}) {
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
975
  const a = o || e, s = window, c = () => {
976
976
  const l = s.GengageInjectorConfig || {}, p = l[e] || {};
@@ -987,8 +987,8 @@ function Gi({ accountId: e, runtimeFile: t = "runtime.js", startExport: r = "sta
987
987
  }, f = (l) => {
988
988
  if (i === !0) return l;
989
989
  const p = new URL(l, window.location.href).origin, g = /* @__PURE__ */ new Set([window.location.origin]), u = c();
990
- F(g, document.currentScript?.getAttribute("src")), F(g, u.assetBaseUrl), F(g, u.baseUrl), F(g, n ? s[n] : void 0);
991
- for (const h of i || []) F(g, h);
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
992
  if (!g.has(p)) throw new Error(`${a} runtime origin ${p} is not trusted.`);
993
993
  return l;
994
994
  }, b = s.GengageAssistantInjector || (s.GengageAssistantInjector = {}), m = b[e] || (b[e] = {});
@@ -1003,7 +1003,7 @@ function Gi({ accountId: e, runtimeFile: t = "runtime.js", startExport: r = "sta
1003
1003
  throw delete m.loaderPromise, console.error(`[Gengage][${e}] runtime load failed`, l), l;
1004
1004
  })), m.loaderPromise;
1005
1005
  }
1006
- function F(e, t) {
1006
+ function M(e, t) {
1007
1007
  if (t)
1008
1008
  try {
1009
1009
  const r = new URL(t, window.location.href);
@@ -1434,13 +1434,13 @@ function Or(e, t) {
1434
1434
  }, Object.defineProperty(r[n], "__gengageActivityWrapped", { value: !0 }));
1435
1435
  return r;
1436
1436
  }
1437
- function $r(e, t) {
1437
+ function Fr(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 Mr(e, t) {
1443
+ function $r(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;
@@ -1471,7 +1471,7 @@ function Mr(e, t) {
1471
1471
  title: "streamTransport wrapped"
1472
1472
  }), !0;
1473
1473
  }
1474
- function Fr({ accountId: e, collector: t, promptBaseUrl: r } = {}) {
1474
+ function Mr({ 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);
@@ -2427,7 +2427,7 @@ function O(e) {
2427
2427
  function H(e) {
2428
2428
  return String(e).replace(/[&<>"']/gu, (t) => t === "&" ? "&amp;" : t === "<" ? "&lt;" : t === ">" ? "&gt;" : t === '"' ? "&quot;" : "&#39;");
2429
2429
  }
2430
- function zi({ accountId: e, config: t = {}, tools: r, beacon: n } = {}) {
2430
+ function oa({ accountId: e, config: t = {}, tools: r, beacon: n } = {}) {
2431
2431
  if (!Tn(e, t)) return {
2432
2432
  enabled: !1,
2433
2433
  tools: r,
@@ -2438,7 +2438,7 @@ function zi({ accountId: e, config: t = {}, tools: r, beacon: n } = {}) {
2438
2438
  }
2439
2439
  };
2440
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), Fr({
2441
+ return window.__GENGAGE_AGENTIC_DEBUG_RECORD__ = (i) => Re(o, i), window.__GENGAGE_AGENTIC_DEBUG_RECORD_BE__ = (i) => Re(o, i), Qr(o), Mr({
2442
2442
  accountId: e,
2443
2443
  collector: o,
2444
2444
  promptBaseUrl: t.agenticActivityPromptBaseUrl
@@ -2449,9 +2449,9 @@ function zi({ accountId: e, config: t = {}, tools: r, beacon: n } = {}) {
2449
2449
  enabled: !0,
2450
2450
  collector: o,
2451
2451
  tools: Or(r, o),
2452
- beacon: $r(n, o),
2452
+ beacon: Fr(n, o),
2453
2453
  record: (i) => o.record(i),
2454
- wrapTransport: () => Mr(e, o)
2454
+ wrapTransport: () => $r(e, o)
2455
2455
  };
2456
2456
  }
2457
2457
  function Tn(e, t = {}) {
@@ -2520,7 +2520,7 @@ var An = [
2520
2520
  "count",
2521
2521
  "privacy"
2522
2522
  ];
2523
- function Hi({ accountId: e, search: t, facetedSearch: r, similaritySearch: n, searchGiftOptions: o, filters: i = {}, resultContract: a = {}, limitations: s = [], extraTools: c = [] } = {}) {
2523
+ function ia({ accountId: e, search: t, facetedSearch: r, similaritySearch: n, searchGiftOptions: o, filters: i = {}, resultContract: a = {}, limitations: s = [], extraTools: c = [] } = {}) {
2524
2524
  return {
2525
2525
  searchKeyword: async (f = {}, b = {}) => t(In(f, b)),
2526
2526
  facetedSearch: typeof r == "function" ? (f = {}, b = {}) => r(qe(f, b)) : async (f = {}, b = {}) => t(qe(f, b)),
@@ -2618,7 +2618,7 @@ function ce(e) {
2618
2618
  return Object.fromEntries(Object.entries(e || {}).filter(([, t]) => t != null && t !== "" && (!Array.isArray(t) || t.length)));
2619
2619
  }
2620
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 Wi({ 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 } = {}) {
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
2622
  const d = a || `gengage:agentic-iframe-scraper:${t}`;
2623
2623
  function f(p, g = {}) {
2624
2624
  const u = new URL(String(p), re());
@@ -2650,7 +2650,7 @@ function Wi({ markerParam: e = Bn, markerValue: t = "agentic-scraper", frameName
2650
2650
  } catch {
2651
2651
  }
2652
2652
  return x.style && (x.style.cssText = i), new Promise((C) => {
2653
- let M = !1;
2653
+ let $ = !1;
2654
2654
  const z = typeof v?.addEventListener == "function" && typeof v?.removeEventListener == "function", ut = v.setTimeout(() => {
2655
2655
  ee({
2656
2656
  attempted: !0,
@@ -2665,7 +2665,7 @@ function Wi({ markerParam: e = Bn, markerValue: t = "agentic-scraper", frameName
2665
2665
  v.clearTimeout(ut), z && v.removeEventListener("message", ke), typeof x.remove == "function" && x.remove();
2666
2666
  }
2667
2667
  function ee(A) {
2668
- M || (M = !0, dt(), C(A));
2668
+ $ || ($ = !0, dt(), C(A));
2669
2669
  }
2670
2670
  function ke(A) {
2671
2671
  if (A.source && x.contentWindow && A.source !== x.contentWindow) return;
@@ -2723,24 +2723,24 @@ function Wi({ markerParam: e = Bn, markerValue: t = "agentic-scraper", frameName
2723
2723
  postCurrentDocument: l
2724
2724
  };
2725
2725
  }
2726
- function Vi(e, { accountId: t, type: r = "agenticSearchFrame" } = {}) {
2726
+ function sa(e, { accountId: t, type: r = "agenticSearchFrame" } = {}) {
2727
2727
  return e?.isScraperFrame?.() ? (t && globalThis.window && (globalThis.window.GengageAssistantInjector ||= {}, globalThis.window.GengageAssistantInjector[t] ||= { type: r }), !0) : !1;
2728
2728
  }
2729
2729
  function re() {
2730
2730
  return globalThis.window?.location?.origin || globalThis.location?.origin || "https://example.invalid";
2731
2731
  }
2732
- function Ki({ rootUrl: e, successMessage: t, alreadyCurrentPageMessage: r = t, missingUrlMessage: n = "Ürün sayfasını açmak için ürün bağlantısı gerekiyor." } = {}) {
2732
+ 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
2733
  const o = new URL(e).origin;
2734
2734
  return async function(a = {}) {
2735
- const s = a.product || {}, c = $n(a.url || a.productUrl || s.url, e, o), d = a.sku || s.sku || null;
2736
- return c ? Fn(c) ? {
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) ? {
2737
2737
  ok: !0,
2738
2738
  sku: d,
2739
2739
  url: c,
2740
2740
  method: "already-current-page",
2741
2741
  alreadyCurrentPage: !0,
2742
2742
  message: r || t
2743
- } : (Mn(c), {
2743
+ } : ($n(c), {
2744
2744
  ok: !0,
2745
2745
  sku: d,
2746
2746
  url: c,
@@ -2754,7 +2754,7 @@ function Ki({ rootUrl: e, successMessage: t, alreadyCurrentPageMessage: r = t, m
2754
2754
  };
2755
2755
  };
2756
2756
  }
2757
- function $n(e, t, r = new URL(t).origin) {
2757
+ function Fn(e, t, r = new URL(t).origin) {
2758
2758
  if (!e) return "";
2759
2759
  try {
2760
2760
  const n = new URL(e, t);
@@ -2763,7 +2763,7 @@ function $n(e, t, r = new URL(t).origin) {
2763
2763
  return "";
2764
2764
  }
2765
2765
  }
2766
- function Mn(e) {
2766
+ function $n(e) {
2767
2767
  if (typeof document > "u") {
2768
2768
  window.location.href = e;
2769
2769
  return;
@@ -2773,7 +2773,7 @@ function Mn(e) {
2773
2773
  window.location.href !== e && window.location.assign(e);
2774
2774
  }, 0);
2775
2775
  }
2776
- function Fn(e) {
2776
+ function Mn(e) {
2777
2777
  try {
2778
2778
  const t = new URL(globalThis.window?.location?.href || "", e), r = new URL(e, t.href);
2779
2779
  return t.hash = "", r.hash = "", t.href === r.href;
@@ -2796,7 +2796,7 @@ function Dn({ accountId: e, supplied: t = [], pageProduct: r = null, listingProd
2796
2796
  limit: i
2797
2797
  });
2798
2798
  }
2799
- function Ji({ accountId: e, rootUrl: t, getProduct: r, getProducts: n, getStoredPanelProducts: o, limit: i = 4 } = {}) {
2799
+ function la({ accountId: e, rootUrl: t, getProduct: r, getProducts: n, getStoredPanelProducts: o, limit: i = 4 } = {}) {
2800
2800
  return async function(s = {}) {
2801
2801
  return {
2802
2802
  accountId: e,
@@ -2845,7 +2845,7 @@ var N = {
2845
2845
  blog: /\b(?:blog|journal|guide|article|editorial|inspiration|rehber|makale|ilham|icerik|içerik)\b/iu,
2846
2846
  category: /\b(?:category|collection|department|kategori|koleksiyon|reyon)\b/iu
2847
2847
  };
2848
- function Yi({ accountId: e, getPageType: t, getProduct: r, getProducts: n, normalizeProduct: o = (i) => i }) {
2848
+ function ua({ accountId: e, getPageType: t, getProduct: r, getProducts: n, normalizeProduct: o = (i) => i }) {
2849
2849
  return {
2850
2850
  scanSite: (i = {}) => Vn({
2851
2851
  accountId: e,
@@ -2859,7 +2859,7 @@ function Yi({ accountId: e, getPageType: t, getProduct: r, getProducts: n, norma
2859
2859
  discoverSiteContent: (i = {}) => ct(i, e),
2860
2860
  runSiteCommand: (i = {}) => Jn(i),
2861
2861
  describeVisualContext: (i = {}) => Yn(i, e),
2862
- inspectProductSurface: mt({
2862
+ inspectProductSurface: yt({
2863
2863
  accountId: e,
2864
2864
  getPageType: t,
2865
2865
  getProduct: r,
@@ -2965,7 +2965,7 @@ function Zn(e) {
2965
2965
  }), {
2966
2966
  ok: !0,
2967
2967
  command: "scroll_to_text",
2968
- label: $(r),
2968
+ label: F(r),
2969
2969
  message: "Scrolled to the matching page area.",
2970
2970
  privacy: R()
2971
2971
  }) : {
@@ -2994,7 +2994,7 @@ function Qn(e) {
2994
2994
  command: "click_visible_text",
2995
2995
  message: "No safe visible clickable control found."
2996
2996
  };
2997
- const n = $(r);
2997
+ const n = F(r);
2998
2998
  return J.test(n) ? {
2999
2999
  ok: !1,
3000
3000
  blocked: !0,
@@ -3043,16 +3043,16 @@ function eo(e) {
3043
3043
  }
3044
3044
  function to(e) {
3045
3045
  return [...document.querySelectorAll('button,a,[role="button"],summary,input[type="button"],input[type="submit"]')].filter(j).map((t) => ({
3046
- label: $(t),
3046
+ label: F(t),
3047
3047
  tag: t.tagName?.toLowerCase(),
3048
3048
  role: t.getAttribute?.("role") || null,
3049
3049
  href: lt(t),
3050
- safeClick: !J.test($(t))
3050
+ safeClick: !J.test(F(t))
3051
3051
  })).filter((t) => t.label).filter(X((t) => `${t.tag}:${t.label}:${t.href || ""}`)).slice(0, e);
3052
3052
  }
3053
3053
  function ro(e) {
3054
3054
  return [...document.querySelectorAll('a[href],button,[role="button"],summary')].filter(j).map((t) => {
3055
- const r = $(t), n = lt(t), o = no([
3055
+ const r = F(t), n = lt(t), o = no([
3056
3056
  r,
3057
3057
  n,
3058
3058
  le(t)
@@ -3118,7 +3118,7 @@ function co(e) {
3118
3118
  return r;
3119
3119
  }
3120
3120
  function lo(e) {
3121
- return [...document.querySelectorAll('button,a,[role="button"],summary,input[type="button"],input[type="submit"]')].filter(j).find((t) => $(t).toLocaleLowerCase("tr-TR").includes(e.toLocaleLowerCase("tr-TR")));
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")));
3122
3122
  }
3123
3123
  function uo(e) {
3124
3124
  const t = be(e, {
@@ -3127,7 +3127,7 @@ function uo(e) {
3127
3127
  })[0];
3128
3128
  return t ? [...document.querySelectorAll("body *")].filter(j).find((r) => _(r.textContent).includes(t.snippet.slice(0, 24))) : null;
3129
3129
  }
3130
- function $(e) {
3130
+ function F(e) {
3131
3131
  return e ? P(_(e.getAttribute?.("aria-label") || e.getAttribute?.("title") || e.getAttribute?.("alt") || e.value || e.textContent || "")).slice(0, 90) : "";
3132
3132
  }
3133
3133
  function le(e) {
@@ -3249,124 +3249,138 @@ function X(e) {
3249
3249
  };
3250
3250
  }
3251
3251
  export {
3252
- xi as AgentError,
3253
- bt as ContextStore,
3254
- Qo as FALLBACK_STATUS,
3255
- Jo as action,
3256
- di as actionButtonsUiSpec,
3257
- jo as alignProductsToTable,
3258
- Wo as anonymousRequestText,
3259
- ui as beErrorToAgentError,
3252
+ ri as AgentError,
3253
+ mt as ContextStore,
3254
+ Co as FALLBACK_STATUS,
3255
+ li as __resetAllCartCoalescersForTesting,
3256
+ xi as __resetAllPdpHydratorsForTesting,
3257
+ Fi as action,
3258
+ Zo as actionButtonsUiSpec,
3259
+ Bo as alignProductsToTable,
3260
+ Ho as anonymousRequestText,
3261
+ ji as applyCompactionResult,
3262
+ Mi as beErrorToAgentError,
3260
3263
  vr as buildActivityVisualization,
3264
+ bi as buildCompactionRequest,
3265
+ qi as buildPdpFollowupSteps,
3261
3266
  yo as buildPhotoSimilarityProfile,
3262
3267
  wo as buildProductSimilarityProfile,
3263
3268
  vo as buildSimilarityQueries,
3269
+ Ei as buildToolUiSteps,
3264
3270
  Ze as canUseModuleWorker,
3265
- pt as caughtToStreamError,
3266
- Ro as compactAccountConfig,
3267
- zo as compactContextProducts,
3268
- ci as compactObject,
3269
- ki as compactProductSurfaceForLlm,
3270
- Uo as comparisonResultForUi,
3271
- $o as comparisonUiSpec,
3271
+ wt as caughtToStreamError,
3272
+ fi as coalesceAddToCart,
3273
+ qo as compactAccountConfig,
3274
+ ei as compactContextProducts,
3275
+ Go as compactObject,
3276
+ ii as compactProductSurfaceForLlm,
3277
+ Xo as comparisonResultForUi,
3278
+ Io as comparisonUiSpec,
3272
3279
  fr as createActivityCollector,
3273
3280
  Ge as createBrowserMemory,
3274
- Di as createDiagnosticsTool,
3275
- Ii as createEndpointCachePolicies,
3276
- Ui as createEndpointHandlers,
3277
- Ao as createFlow,
3278
- Hi as createGssToolAliases,
3279
- Wi as createIframeScraper,
3281
+ ra as createDiagnosticsTool,
3282
+ Ki as createEndpointCachePolicies,
3283
+ Ji as createEndpointHandlers,
3284
+ Jo as createFlow,
3285
+ ia as createGssToolAliases,
3286
+ aa as createIframeScraper,
3280
3287
  kt as createInjectorAdapter,
3281
- Xo as createLocalRefStore,
3288
+ wi as createLocalRefStore,
3282
3289
  St as createMainThreadInjectorAdapter,
3283
3290
  ir as createModuleWorker,
3284
- Ki as createOpenProductPageTool,
3285
- ii as createPrivacyHelpers,
3286
- mt as createProductSurfaceInspector,
3287
- si as createReadPageStep,
3288
- Fi as createReadPageTool,
3289
- Ji as createResolveProductsTool,
3290
- Yi as createSiteAwarenessTools,
3291
- ti as declarativeBeOpCache,
3292
- Lo as defaultPiiPatternPack,
3293
- Po as defaultPiiPatterns,
3294
- Zo as done,
3295
- ni as elapsedMs,
3291
+ ca as createOpenProductPageTool,
3292
+ Vo as createPrivacyHelpers,
3293
+ yt as createProductSurfaceInspector,
3294
+ vi as createReadPageStep,
3295
+ ta as createReadPageTool,
3296
+ la as createResolveProductsTool,
3297
+ ua as createSiteAwarenessTools,
3298
+ Do as declarativeBeOpCache,
3299
+ Hi as defaultPiiPatternPack,
3300
+ Ao as defaultPiiPatterns,
3301
+ ui as done,
3302
+ Ko as elapsedMs,
3296
3303
  ar as endpointStableKey,
3297
- Go as error,
3298
- Ci as fallbackStatus,
3304
+ pi as error,
3305
+ yi as fallbackStatus,
3299
3306
  rn as filterActivityEntries,
3300
3307
  _i as firstArrayValue,
3301
3308
  vn as formatJsonHtml,
3302
3309
  pr as getOrCreateActivityCollector,
3303
3310
  yr as groupForEntry,
3304
3311
  Nn as gssSearchCapabilities,
3305
- mi as homePanelReset,
3306
- bi as httpErrorToAgentError,
3307
- Pi as inputHashCachePolicy,
3308
- pi as inspectProductSurface,
3309
- Fr as installActivityFetchPatch,
3310
- Mi as installBrowserTools,
3311
- ji as installFetchTransportBridge,
3312
- Vi as installIframeScraperBypass,
3313
- zi as installLocalAgenticActivityDebug,
3314
- Li as isFallbackStatus,
3315
- Ai as isRef,
3316
- Bi as jsonResponse,
3317
- Ko as llmCacheKey,
3318
- Ei as mergeProductSurfaceEvidence,
3319
- Co as metadata,
3320
- Ni as mountAccount,
3312
+ Po as homePanelReset,
3313
+ ai as httpErrorToAgentError,
3314
+ zo as inputHashCachePolicy,
3315
+ Wo as inspectProductSurface,
3316
+ Mr as installActivityFetchPatch,
3317
+ ea as installBrowserTools,
3318
+ Wi as installFetchTransportBridge,
3319
+ sa as installIframeScraperBypass,
3320
+ oa as installLocalAgenticActivityDebug,
3321
+ $o as isFallbackStatus,
3322
+ Mo as isRef,
3323
+ Zi as jsonResponse,
3324
+ Bi as llmCacheKey,
3325
+ Ro as mergeProductSurfaceEvidence,
3326
+ Ci as mergeRoundProducts,
3327
+ Pi as metadata,
3328
+ Vi as mountAccount,
3321
3329
  Qr as mountActivityOverlay,
3322
- Mn as navigateSameTab,
3323
- qi as ndjsonResponse,
3324
- Oo as normalizeComparisonTable,
3330
+ $n as navigateSameTab,
3331
+ Yi as ndjsonResponse,
3332
+ Qo as normalizeComparisonTable,
3325
3333
  mr as normalizeEntry,
3326
- Bo as normalizeProduct,
3327
- $n as normalizeSameOriginUrl,
3334
+ Ai as normalizeProduct,
3335
+ Fn as normalizeSameOriginUrl,
3328
3336
  xo as normalizeSimilarityText,
3329
- ai as nowIso,
3330
- yi as plainMessageContent,
3331
- Mo as productDetailsUiSpec,
3332
- Io as productFactsKey,
3333
- Vo as productSkuKey,
3334
- ri as productSurfaceReviewText,
3335
- Do as productsUiSpec,
3337
+ jo as nowIso,
3338
+ Lo as plainMessageContent,
3339
+ Oo as productDetailsUiSpec,
3340
+ Ti as productFactsKey,
3341
+ Ni as productSkuKey,
3342
+ Di as productSurfaceReviewText,
3343
+ Li as productsUiSpec,
3336
3344
  ko as rankSimilarProducts,
3337
3345
  _o as rankSimilarProductsAsync,
3338
3346
  Re as recordBeDebugPayload,
3339
- Fo as redactPii,
3340
- fi as requestText,
3341
- $i as resolveBeUrl,
3342
- Yo as resolveFlow,
3347
+ Yo as redactPii,
3348
+ Uo as requestText,
3349
+ Xi as resolveBeUrl,
3350
+ ki as resolveFlow,
3343
3351
  Dn as resolveProductCandidates,
3344
- li as retailAnonymizeMessages,
3345
- ei as retailAnonymousRequestText,
3346
- hi as retailRedactPii,
3352
+ ti as retailAnonymizeMessages,
3353
+ $i as retailAnonymousRequestText,
3354
+ zi as retailRedactPii,
3347
3355
  gi as routeFlowParams,
3348
- vi as routeSkuList,
3356
+ mi as routeSkuList,
3349
3357
  So as scoreSimilarityCandidate,
3358
+ Ii as searchFollowUpPills,
3350
3359
  hr as sectionForKind,
3351
- Oi as setAssistantHostVisible,
3360
+ Qi as setAssistantHostVisible,
3352
3361
  br as severityForEntry,
3362
+ ni as shouldCompact,
3353
3363
  Tn as shouldInstallActivityDebug,
3364
+ Ri as singleFlight,
3354
3365
  ue as stableKey,
3355
- Gi as startLazyRuntimeLoader,
3356
- Ti as stickyContextKey,
3366
+ na as startLazyRuntimeLoader,
3367
+ Gi as stickyContextKey,
3357
3368
  Y as summarizeDebugState,
3358
3369
  ae as summarizePanelState,
3359
3370
  Qe as summarizeUiSpec,
3360
- oi as textChunk,
3361
- No as textKey,
3371
+ Si as textChunk,
3372
+ oi as textKey,
3362
3373
  Eo as tokenizeSimilarityText,
3363
- wi as trimProductFactsCore,
3364
- qo as trimProductFactsListCore,
3365
- Si as uiSpec,
3374
+ Ui as trimProductFactsCore,
3375
+ ci as trimProductFactsListCore,
3376
+ hi as uiSpec,
3366
3377
  Gn as uniqueProductsBySku,
3367
- Ri as withAccountConfig,
3368
- Ho as withDeclarativeBeOpCache,
3369
- $r as wrapActivityBeacon,
3378
+ di as validateToolArgs,
3379
+ Fo as withAccountConfig,
3380
+ No as withDeclarativeBeOpCache,
3381
+ si as withSimilarsAppend,
3382
+ Fr as wrapActivityBeacon,
3370
3383
  Or as wrapActivityTools,
3371
- Mr as wrapActivityTransport
3384
+ $r as wrapActivityTransport,
3385
+ Oi as wrapResolveProductsWithPdpHydration
3372
3386
  };