@gengage/assistant-fe 0.6.50 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/chat/api.d.ts +1 -1
  2. package/dist/chat/components/ChatDrawer.d.ts +4 -1
  3. package/dist/chat/features/beauty-consulting/mode-controller.d.ts +1 -1
  4. package/dist/chat/features/beauty-consulting/stream-handler.d.ts +7 -1
  5. package/dist/chat/history-storage.d.ts +36 -4
  6. package/dist/chat/runtime.d.ts +2 -2
  7. package/dist/chat/utils/chat-presentation-debug.d.ts +0 -14
  8. package/dist/chat-runtime.js +1 -1
  9. package/dist/chat.iife.js +56 -56
  10. package/dist/chat.js +1 -1
  11. package/dist/common/connection-warning.d.ts +10 -0
  12. package/dist/common/indexed-db.d.ts +35 -2
  13. package/dist/common/native-webview.d.ts +1 -1
  14. package/dist/common/streaming.d.ts +6 -1
  15. package/dist/common/transport.d.ts +2 -1
  16. package/dist/common/types.d.ts +16 -0
  17. package/dist/{common-DJFI5t11.js → common-CW6814pZ.js} +61 -65
  18. package/dist/common.js +30 -30
  19. package/dist/{connection-warning-TXqyeFaf.js → connection-warning-C0e2byq5.js} +31 -25
  20. package/dist/{fastIntent-539wPavr.js → fastIntent-CJGhUTpS.js} +2 -2
  21. package/dist/global-error-toast-DvaKvPNA.js +798 -0
  22. package/dist/index.js +29 -29
  23. package/dist/native-webview-CHKpwixw.js +303 -0
  24. package/dist/native.iife.js +27 -27
  25. package/dist/native.js +1 -1
  26. package/dist/{overlay-BPZEIyo_.js → overlay-C3XzoSKd.js} +51 -32
  27. package/dist/overlay.js +6 -6
  28. package/dist/{price-formatter-CHUmYq8I.js → price-formatter-Q3wUKrl1.js} +2 -1
  29. package/dist/qna/runtime.d.ts +1 -0
  30. package/dist/qna-runtime.js +1 -1
  31. package/dist/qna.iife.js +32 -32
  32. package/dist/qna.js +1 -1
  33. package/dist/{request-response-cache-DwADBDeB.js → request-response-cache-DItrp4fO.js} +478 -454
  34. package/dist/{runtime-9f9SB4WE.js → runtime-B9m0kyTB.js} +2796 -2697
  35. package/dist/{runtime-Do3qShrH.js → runtime-CZ363BP8.js} +231 -219
  36. package/dist/{runtime-rTw1jMhB.js → runtime-DKkw_dca.js} +230 -212
  37. package/dist/{simbut-DlWvDoPI.js → simbut-D_j8YgHS.js} +5 -5
  38. package/dist/simbut.iife.js +2 -2
  39. package/dist/simbut.js +1 -1
  40. package/dist/simrel/components/GroupTabs.d.ts +6 -0
  41. package/dist/simrel/runtime.d.ts +8 -0
  42. package/dist/{simrel-BFPU2n5p.js → simrel-BkAtQjNa.js} +15 -15
  43. package/dist/simrel-runtime.js +1 -1
  44. package/dist/simrel.iife.js +22 -22
  45. package/dist/simrel.js +2 -2
  46. package/dist/widget-base-BnUjuCt7.js +141 -0
  47. package/package.json +1 -1
  48. package/dist/context-UTzCGyR9.js +0 -543
  49. package/dist/native-webview-CYX30O3Q.js +0 -273
  50. package/dist/widget-base-BwU6SI2o.js +0 -365
package/dist/chat.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, c as t, d as r, f as s, i as n, l as c, n as i, o as l, r as o, s as h, t as C, u as d } from "./runtime-9f9SB4WE.js";
1
+ import { a as e, c as t, d as r, f as s, i as n, l as c, n as i, o as l, r as o, s as h, t as C, u as d } from "./runtime-B9m0kyTB.js";
2
2
  import { t as S } from "./chat-CAGCU8UV.js";
3
3
  export {
4
4
  d as CHAT_SCROLL_ELEMENT_ID,
@@ -5,4 +5,14 @@ export interface ConnectionWarningRequestOptions {
5
5
  source: 'chat' | 'qna' | 'simrel';
6
6
  locale?: string | undefined;
7
7
  }
8
+ /**
9
+ * Remove the online/offline window listeners, clear pending timers, dismiss any
10
+ * visible warning toast, and fully reset internal state so the subsystem can be
11
+ * cleanly re-registered later. Intended for teardown (e.g. overlay destroy / SPA
12
+ * unmount) to avoid leaking listeners across mounts. Must be a FULL reset: if a
13
+ * warning is showing when this runs, leaving `warningVisible` set would wedge
14
+ * scheduleDelayedCheck() (its guard early-returns while warningVisible) and the
15
+ * subsystem would stay permanently inert on the next mount.
16
+ */
17
+ export declare function destroyConnectionWarning(): void;
8
18
  export declare function trackConnectionWarningRequest(options: ConnectionWarningRequestOptions): () => void;
@@ -1,10 +1,15 @@
1
1
  /**
2
- * IndexedDB persistence for chat sessions, backend context, and message payloads.
2
+ * IndexedDB persistence for chat sessions, backend context, message payloads,
3
+ * favorites, and the chat-history archive.
3
4
  *
4
- * Three stores:
5
+ * Stores:
5
6
  * - `sessions` — full session state (messages, thread cursors, timestamps)
6
7
  * - `context` — per-thread backend context snapshots (compound key)
7
8
  * - `payload` — message UISpec payloads (lean message pattern)
9
+ * - `favorites` — saved products
10
+ * - `history` — the chat-history archive (past sessions); replaces the
11
+ * previous localStorage backend so bulk history no longer
12
+ * lives in the origin-shared localStorage.
8
13
  *
9
14
  * All operations are best-effort: IndexedDB unavailability is non-fatal.
10
15
  */
@@ -57,6 +62,19 @@ export interface FavoriteData {
57
62
  price?: string | undefined;
58
63
  savedAt: string;
59
64
  }
65
+ /**
66
+ * Minimal shape the history store needs for its compound key and scope index.
67
+ * The full record (ChatHistorySessionRecord, owned by chat/history-storage.ts)
68
+ * is stored opaquely on top of these fields — defined here to avoid a circular
69
+ * import (history-storage imports this module).
70
+ */
71
+ export interface HistoryRecordBase {
72
+ appId: string;
73
+ userId: string;
74
+ /** The history record id (historyId). */
75
+ id: string;
76
+ updatedAt: string;
77
+ }
60
78
  export declare class GengageIndexedDB {
61
79
  private _db;
62
80
  private _dbName;
@@ -88,5 +106,20 @@ export declare class GengageIndexedDB {
88
106
  removeFavorite(userId: string, appId: string, sku: string): Promise<void>;
89
107
  loadFavorites(userId: string, appId: string): Promise<FavoriteData[]>;
90
108
  isFavorite(userId: string, appId: string, sku: string): Promise<boolean>;
109
+ saveHistory(record: HistoryRecordBase): Promise<void>;
110
+ loadHistory<T extends HistoryRecordBase>(appId: string, userId: string, id: string): Promise<T | null>;
111
+ deleteHistory(appId: string, userId: string, id: string): Promise<void>;
112
+ /** All history records for one app+user scope (used to hydrate the in-memory index and to migrate). */
113
+ loadHistoryByScope<T extends HistoryRecordBase>(appId: string, userId: string): Promise<T[]>;
91
114
  private _requireDb;
115
+ /**
116
+ * Cap the payload store at MAX_PAYLOAD_ENTRIES by pruning the oldest entries.
117
+ *
118
+ * Self-contained: relies only on the payload store's compound key
119
+ * `[threadId, messageId]`. Because threadId is a UUIDv7, the default
120
+ * primary-key cursor visits oldest threads first, so we count, then delete
121
+ * from the front until the store is back under the cap. Best-effort — any
122
+ * failure (db absent, transaction error) is swallowed.
123
+ */
124
+ _prunePayloadStore(): Promise<void>;
92
125
  }
@@ -16,7 +16,7 @@ export interface NativeWebViewBridgeOptions {
16
16
  androidInterfaceName?: string;
17
17
  reactNativeInterfaceName?: string;
18
18
  trackedEvents?: NativeTrackedEvent[] | string[];
19
- /** Log unhandled inbound message types to console in addition to forwarding to postMessage. */
19
+ /** Log unhandled inbound message types to the console (warn). */
20
20
  logUnhandled?: boolean;
21
21
  /** Injected for tests; defaults to global window. */
22
22
  win?: Window;
@@ -27,7 +27,12 @@ export interface StreamOptions {
27
27
  /**
28
28
  * Max milliseconds to wait between chunks before treating the stream as dead.
29
29
  * Prevents the UI from hanging indefinitely when the backend stops sending
30
- * data without closing the connection. Default: 60_000 (60 s).
30
+ * data without closing the connection. Default: 120_000 (120 s).
31
+ *
32
+ * The backend has no heartbeat and legitimately goes silent for long
33
+ * stretches during blocking multi-round LLM turns, so this is deliberately
34
+ * generous. The idle branch only surfaces an error when NO data was ever
35
+ * received (a truly dead connection); see consumeStream for the rationale.
31
36
  */
32
37
  idleTimeoutMs?: number;
33
38
  }
@@ -51,7 +51,7 @@ export interface ProcessActionRequest {
51
51
  };
52
52
  }
53
53
  export type InjectorBridgeEndpoint = 'process_action' | 'launcher_action' | 'similar_products' | 'product_groupings';
54
- export interface InjectorEndpointContext {
54
+ interface InjectorEndpointContext {
55
55
  accountId: string;
56
56
  endpoint: InjectorBridgeEndpoint;
57
57
  signal: AbortSignal;
@@ -82,3 +82,4 @@ export interface StreamCallbacks {
82
82
  onDone: () => void;
83
83
  }
84
84
  export type InjectorAdapter = (request: ProcessActionRequest, callbacks: StreamCallbacks, signal: AbortSignal, attachment?: File) => void | Promise<void>;
85
+ export {};
@@ -372,6 +372,22 @@ declare global {
372
372
  chat?: import('./widget-base').ChatPublicAPI;
373
373
  /** Overlay orchestration API, available after initOverlayWidgets(). */
374
374
  overlay?: import('./overlay.js').OverlayWidgetsController;
375
+ /**
376
+ * @internal Diagnostic/runtime state. Kept under the single `gengage`
377
+ * namespace (rather than scattered `window.__gengage*` globals) so the SDK
378
+ * does not pollute the host page's global scope.
379
+ */
380
+ __internal?: {
381
+ cpDebugLog?: Array<{
382
+ seq: number;
383
+ time: string;
384
+ scope: string;
385
+ message: string;
386
+ payload?: unknown;
387
+ }>;
388
+ cpDebugSeq?: number;
389
+ sdkRuntimeInfoLogged?: boolean;
390
+ };
375
391
  };
376
392
  /** @internal Legacy compat — do not use in new integrations. */
377
393
  __gengageSessionId?: string;
@@ -1,26 +1,26 @@
1
- import { i as g } from "./widget-base-BwU6SI2o.js";
2
- import { c as l, i as p, o as u, r as c, t as y } from "./schemas-BnYUhYSy.js";
3
- import { a as w, i as v } from "./overlay-BPZEIyo_.js";
1
+ import { i as m } from "./widget-base-BnUjuCt7.js";
2
+ import { c as s, i as f, o as u, r as c, t as p } from "./schemas-BnYUhYSy.js";
3
+ import { a as w, i as y } from "./overlay-C3XzoSKd.js";
4
4
  var d = u({ enabled: c().default(!0) }), h = u({
5
- chat: l().optional(),
6
- qna: l().optional(),
7
- simrel: l().optional(),
8
- simbut: l().optional()
9
- }), b = u({}), S = u({
10
- idempotencyKey: l().default(w),
5
+ chat: s().optional(),
6
+ qna: s().optional(),
7
+ simrel: s().optional(),
8
+ simbut: s().optional()
9
+ }), v = u({}), b = u({
10
+ idempotencyKey: s().default(w),
11
11
  requireDomReady: c().default(!0)
12
- }), T = y([
12
+ }), S = p([
13
13
  "log-and-ignore",
14
14
  "throw",
15
15
  "delegate"
16
- ]), U = u({
17
- unknownActionPolicy: T.default("log-and-ignore"),
16
+ ]), T = u({
17
+ unknownActionPolicy: S.default("log-and-ignore"),
18
18
  allowScriptCall: c().default(!1)
19
- }), f = u({
20
- version: p("1", { error: 'version must be "1"' }),
21
- accountId: l({ error: "accountId must be a non-empty string" }).min(1, { error: "accountId must be a non-empty string" }),
22
- middlewareUrl: l({ error: 'middlewareUrl must be a valid URL (e.g. "https://your-backend.example.com")' }).url({ error: 'middlewareUrl must be a valid URL (e.g. "https://your-backend.example.com")' }),
23
- locale: l().optional(),
19
+ }), g = u({
20
+ version: f("1", { error: 'version must be "1"' }),
21
+ accountId: s({ error: "accountId must be a non-empty string" }).min(1, { error: "accountId must be a non-empty string" }),
22
+ middlewareUrl: s({ error: 'middlewareUrl must be a valid URL (e.g. "https://your-backend.example.com")' }).url({ error: 'middlewareUrl must be a valid URL (e.g. "https://your-backend.example.com")' }),
23
+ locale: s().optional(),
24
24
  widgets: u({
25
25
  chat: d.default({ enabled: !0 }),
26
26
  qna: d.default({ enabled: !0 }),
@@ -28,29 +28,29 @@ var d = u({ enabled: c().default(!0) }), h = u({
28
28
  simbut: d.default({ enabled: !1 })
29
29
  }),
30
30
  mounts: h.default({}),
31
- transport: b.default({}),
32
- gtm: S.default({
31
+ transport: v.default({}),
32
+ gtm: b.default({
33
33
  idempotencyKey: "__gengageWidgetsInit",
34
34
  requireDomReady: !0
35
35
  }),
36
- actionHandling: U.default({
36
+ actionHandling: T.default({
37
37
  unknownActionPolicy: "log-and-ignore",
38
38
  allowScriptCall: !1
39
39
  })
40
40
  });
41
- function C(e) {
42
- g("config", "parsing account runtime config", e);
43
- const r = f.parse(e);
44
- return g("config", "config resolved", {
41
+ function U(e) {
42
+ m("config", "parsing account runtime config", e);
43
+ const r = g.parse(e);
44
+ return m("config", "config resolved", {
45
45
  accountId: r.accountId,
46
46
  middlewareUrl: r.middlewareUrl
47
47
  }), r;
48
48
  }
49
- function P(e) {
50
- return f.safeParse(e);
49
+ function C(e) {
50
+ return g.safeParse(e);
51
51
  }
52
- function $(e) {
53
- return C({
52
+ function _(e) {
53
+ return U({
54
54
  version: "1",
55
55
  accountId: e.accountId,
56
56
  middlewareUrl: e.middlewareUrl,
@@ -62,22 +62,22 @@ function $(e) {
62
62
  }
63
63
  });
64
64
  }
65
- function R(e) {
65
+ function P(e) {
66
66
  try {
67
67
  return document.querySelector(e), !0;
68
68
  } catch {
69
69
  return !1;
70
70
  }
71
71
  }
72
- function E(e, r) {
72
+ function R(e, r) {
73
73
  const n = [], t = e.mounts, i = [
74
74
  ["qna", t.qna],
75
75
  ["simrel", t.simrel],
76
76
  ["simbut", t.simbut],
77
77
  ["chat", t.chat]
78
78
  ];
79
- for (const [a, s] of i)
80
- if (s !== void 0) {
79
+ for (const [a, l] of i)
80
+ if (l !== void 0) {
81
81
  if (a === "simrel" && e.widgets.simrel === void 0) {
82
82
  n.push({
83
83
  code: "SIMREL_MOUNT_IGNORED",
@@ -86,17 +86,17 @@ function E(e, r) {
86
86
  });
87
87
  continue;
88
88
  }
89
- if (!R(s)) {
89
+ if (!P(l)) {
90
90
  n.push({
91
91
  code: "INVALID_SELECTOR",
92
- message: `[gengage preflight] ${a} mount selector is invalid CSS: "${s}"`,
92
+ message: `[gengage preflight] ${a} mount selector is invalid CSS: "${l}"`,
93
93
  severity: "error"
94
94
  });
95
95
  continue;
96
96
  }
97
- document.querySelector(s) || n.push({
97
+ document.querySelector(l) || n.push({
98
98
  code: "MOUNT_NOT_FOUND",
99
- message: `[gengage preflight] ${a} mount target not found: "${s}" — widget will skip or wait for DOM`,
99
+ message: `[gengage preflight] ${a} mount target not found: "${l}" — widget will skip or wait for DOM`,
100
100
  severity: "warn"
101
101
  });
102
102
  }
@@ -115,10 +115,6 @@ function E(e, r) {
115
115
  severity: "warn"
116
116
  }), !r?.skipCspCheck) {
117
117
  let a = !1;
118
- const s = (m) => {
119
- m.blockedURI && e.middlewareUrl.startsWith(m.blockedURI) && (a = !0);
120
- };
121
- document.addEventListener("securitypolicyviolation", s);
122
118
  try {
123
119
  fetch(e.middlewareUrl, {
124
120
  method: "HEAD",
@@ -128,7 +124,7 @@ function E(e, r) {
128
124
  } catch {
129
125
  a = !0;
130
126
  }
131
- document.removeEventListener("securitypolicyviolation", s), a && n.push({
127
+ a && n.push({
132
128
  code: "CSP_BLOCKED",
133
129
  message: `[gengage preflight] middleware URL may be blocked by Content-Security-Policy: "${e.middlewareUrl}". Add it to connect-src.`,
134
130
  severity: "warn"
@@ -140,15 +136,15 @@ function E(e, r) {
140
136
  warnings: n
141
137
  };
142
138
  }
143
- function k(e) {
144
- const r = P(e);
139
+ function E(e) {
140
+ const r = C(e);
145
141
  if (!r.success) {
146
142
  const n = r.error.issues.map((t) => `${t.path.join(".")}: ${t.message}`).join("; ");
147
143
  throw new Error(`[gengage] Invalid runtime config: ${n}`);
148
144
  }
149
145
  return r.data;
150
146
  }
151
- function I(e, r, n) {
147
+ function k(e, r, n) {
152
148
  const t = {
153
149
  accountId: e.accountId,
154
150
  middlewareUrl: e.middlewareUrl,
@@ -159,20 +155,20 @@ function I(e, r, n) {
159
155
  ...e.mounts.simrel !== void 0 ? { mountTarget: e.mounts.simrel } : {}
160
156
  }), t.simbut = { enabled: e.widgets.simbut.enabled }, e.mounts.simbut !== void 0 && (t.simbut.mountTarget = e.mounts.simbut), r?.onAddToCart !== void 0 && (t.onAddToCart = r.onAddToCart), r?.onProductNavigate !== void 0 && (t.onProductNavigate = r.onProductNavigate), r?.onFindSimilar !== void 0 && (t.simbut.onFindSimilar = r.onFindSimilar), r?.onScriptCall !== void 0 && (t.onScriptCall = r.onScriptCall), t;
161
157
  }
162
- async function A(e) {
163
- const r = k(e.runtimeConfig);
158
+ async function $(e) {
159
+ const r = E(e.runtimeConfig);
164
160
  if (e.preflight !== !1) {
165
- const i = E(r);
161
+ const i = R(r);
166
162
  if (!i.ok) {
167
163
  const o = i.warnings.filter((a) => a.severity === "error");
168
164
  throw new Error(`[gengage] Preflight failed: ${o.map((a) => a.message).join("; ")}`);
169
165
  }
170
166
  }
171
- const n = e.contextResolver?.(), t = await v(I(r, e.hostActions, n));
167
+ const n = e.contextResolver?.(), t = await y(k(r, e.hostActions, n));
172
168
  if (e.contextResolver !== void 0) {
173
169
  const i = e.contextResolver, o = () => {
174
- const s = i();
175
- t.updateContext(s);
170
+ const l = i();
171
+ t.updateContext(l);
176
172
  };
177
173
  window.addEventListener("gengage:context:update", o);
178
174
  const a = t.destroy.bind(t);
@@ -230,7 +226,7 @@ var q = [
230
226
  ]
231
227
  }
232
228
  ];
233
- function D(e, r) {
229
+ function I(e, r) {
234
230
  const n = r ?? (typeof window < "u" ? new URL(window.location.href) : null);
235
231
  if (!n) return "other";
236
232
  const t = e ?? q, i = n.pathname;
@@ -245,7 +241,7 @@ function D(e, r) {
245
241
  return o.pageType;
246
242
  return "other";
247
243
  }
248
- function L(e) {
244
+ function D(e) {
249
245
  const r = e ?? (typeof window < "u" ? new URL(window.location.href) : null);
250
246
  if (!r) return;
251
247
  const n = r.pathname, t = n.match(/\/(?:p|urun|product)\/([^/?#]+)/i);
@@ -253,23 +249,23 @@ function L(e) {
253
249
  const i = n.match(/-p-(\d+)/i);
254
250
  if (i?.[1]) return i[1];
255
251
  }
256
- function M(e) {
257
- const r = D(e), n = { pageType: r };
252
+ function A(e) {
253
+ const r = I(e), n = { pageType: r };
258
254
  if (r === "pdp") {
259
- const t = L();
255
+ const t = D();
260
256
  t && (n.sku = t);
261
257
  }
262
258
  return typeof window < "u" && (n.url = window.location.href), n;
263
259
  }
264
260
  export {
265
- E as a,
266
- $ as c,
267
- A as i,
268
- C as l,
269
- D as n,
270
- f as o,
271
- L as r,
272
- T as s,
273
- M as t,
274
- P as u
261
+ R as a,
262
+ _ as c,
263
+ $ as i,
264
+ U as l,
265
+ I as n,
266
+ g as o,
267
+ D as r,
268
+ S as s,
269
+ A as t,
270
+ C as u
275
271
  };
package/dist/common.js CHANGED
@@ -1,25 +1,25 @@
1
- import { a, d as t, f as s, g as r, h as i, i as o, m as n, n as c, o as m, p as g, r as l, s as d, t as p, u } from "./request-response-cache-DwADBDeB.js";
2
- import { N as E, a as S, c as h, i as C, k as T, n as y, o as A, r as G, s as I, t as w } from "./context-UTzCGyR9.js";
3
- import { a as W, c as v, d as N, f as P, l as U, n as O, o as D, p as _, r as L, t as b, u as k } from "./widget-base-BwU6SI2o.js";
4
- import { a as x, c as B, f as z, i as M, l as V, n as K, o as H, r as Q, s as q, t as Z } from "./fastIntent-539wPavr.js";
5
- import { n as J, t as X } from "./connection-warning-TXqyeFaf.js";
6
- import { i as $, n as ee, r as ae, t as te } from "./overlay-BPZEIyo_.js";
7
- import { a as re, i as ie, n as oe, r as ne } from "./native-webview-CYX30O3Q.js";
8
- import { a as me, c as ge, i as le, l as de, n as pe, o as ue, r as fe, s as Ee, t as Se, u as he } from "./common-DJFI5t11.js";
1
+ import { a, d as t, f as s, g as r, h as i, i as o, m as n, n as c, o as m, p as g, r as l, s as d, t as p, u } from "./request-response-cache-DItrp4fO.js";
2
+ import { B as E, I as S, a as h, c as C, d as T, f as y, h as A, i as G, l as I, m as w, n as R, o as W, p as v, s as P, t as U, u as N } from "./global-error-toast-DvaKvPNA.js";
3
+ import { a as D, n as _, o as L, r as b, t as B } from "./widget-base-BnUjuCt7.js";
4
+ import { a as k, c as x, f as z, i as M, l as V, n as K, o as H, r as Q, s as q, t as Z } from "./fastIntent-CJGhUTpS.js";
5
+ import { r as J, t as X } from "./connection-warning-C0e2byq5.js";
6
+ import { i as $, n as ee, r as ae, t as te } from "./overlay-C3XzoSKd.js";
7
+ import { a as re, i as ie, n as oe, r as ne } from "./native-webview-CHKpwixw.js";
8
+ import { a as me, c as ge, i as le, l as de, n as pe, o as ue, r as fe, s as Ee, t as Se, u as he } from "./common-CW6814pZ.js";
9
9
  export {
10
10
  ue as AccountRuntimeConfigSchema,
11
- k as BASE_WIDGET_THEME,
12
- b as BaseWidget,
13
- x as DEFAULT_CUSTOMIZATION_LOCALE,
14
- P as DEFAULT_WIDGET_THEME_TOKENS,
15
- O as GENGAGE_BUILD_FLAVOR,
16
- L as GENGAGE_VERSION,
11
+ W as BASE_WIDGET_THEME,
12
+ B as BaseWidget,
13
+ k as DEFAULT_CUSTOMIZATION_LOCALE,
14
+ D as DEFAULT_WIDGET_THEME_TOKENS,
15
+ _ as GENGAGE_BUILD_FLAVOR,
16
+ b as GENGAGE_VERSION,
17
17
  Ee as UnknownActionPolicySchema,
18
18
  Q as VoiceInput,
19
19
  o as adaptBackendEvent,
20
20
  oe as applyNativeSession,
21
21
  Se as autoDetectPageContext,
22
- w as bootstrapSession,
22
+ C as bootstrapSession,
23
23
  c as buildChatEndpointUrl,
24
24
  te as buildOverlayIdempotencyKey,
25
25
  p as cachedFetch,
@@ -29,26 +29,26 @@ export {
29
29
  ge as createDefaultAccountRuntimeConfig,
30
30
  q as createFloatingChatConfig,
31
31
  ne as createNativeWebViewBridge,
32
- B as createPdpQnaConfig,
32
+ x as createPdpQnaConfig,
33
33
  V as createPdpSimRelConfig,
34
34
  i as defaultUnknownUISpecRenderer,
35
35
  ee as destroyOverlayWidgets,
36
36
  Z as detectFastIntent,
37
37
  ie as detectNativeEnvironment,
38
38
  pe as detectPageType,
39
- W as dismissGlobalErrorToast,
40
- S as dispatch,
39
+ U as dismissGlobalErrorToast,
40
+ y as dispatch,
41
41
  fe as extractSkuFromUrl,
42
- D as getGlobalErrorMessage,
42
+ R as getGlobalErrorMessage,
43
43
  ae as getOverlayWidgets,
44
44
  u as getSuggestedSearchKeywords,
45
45
  t as getSuggestedSearchKeywordsText,
46
- y as getWindowPageContext,
46
+ I as getWindowPageContext,
47
47
  le as initGengageClient,
48
48
  re as initNativeOverlayWidgets,
49
49
  $ as initOverlayWidgets,
50
50
  M as isVoiceInputSupported,
51
- A as listen,
51
+ v as listen,
52
52
  K as makePillLauncher,
53
53
  n as mergeUISpecRegistry,
54
54
  l as normalizeMiddlewareUrl,
@@ -57,19 +57,19 @@ export {
57
57
  de as parseAccountRuntimeConfig,
58
58
  me as preflightDiagnostics,
59
59
  d as productToNormalized,
60
- v as registerGlobalErrorToastListener,
60
+ G as registerGlobalErrorToastListener,
61
61
  r as renderUISpecWithRegistry,
62
- G as resolveSession,
62
+ N as resolveSession,
63
63
  z as routeStreamAction,
64
64
  he as safeParseAccountRuntimeConfig,
65
65
  E as sanitizeHtml,
66
- U as showGlobalErrorToast,
66
+ h as showGlobalErrorToast,
67
67
  g as streamPost,
68
68
  J as trackConnectionWarningRequest,
69
- C as updatePageContext,
70
- T as wireGADataLayer,
71
- I as wireQNAToChat,
72
- h as wireSimilarToChat,
73
- N as withBaseTheme,
74
- _ as withDefaultWidgetTheme
69
+ T as updatePageContext,
70
+ S as wireGADataLayer,
71
+ w as wireQNAToChat,
72
+ A as wireSimilarToChat,
73
+ P as withBaseTheme,
74
+ L as withDefaultWidgetTheme
75
75
  };
@@ -1,14 +1,14 @@
1
- import { a as y, l as d } from "./widget-base-BwU6SI2o.js";
2
- var h = 8e3, m = 5e3, g = "https://www.google.com/favicon.ico";
1
+ import { a as d, t as m } from "./global-error-toast-DvaKvPNA.js";
2
+ var C = 8e3, L = 5e3, v = "https://www.google.com/favicon.ico";
3
3
  function b(e) {
4
- e.probeUrl && (g = e.probeUrl);
4
+ e.probeUrl && (v = e.probeUrl);
5
5
  }
6
6
  var n = /* @__PURE__ */ new Map(), u = !1, i = null, a = null, t = !1;
7
- function C(e) {
7
+ function T(e) {
8
8
  return typeof e == "string" && e.toLowerCase().startsWith("tr");
9
9
  }
10
- function v(e) {
11
- return C(e) ? "İnternet bağlantısında sorun var gibi görünüyor. İstek sürerken yeniden deneyeceğiz." : "Your internet connection looks unstable. We'll keep retrying while this request is active.";
10
+ function g(e) {
11
+ return T(e) ? "İnternet bağlantısında sorun var gibi görünüyor. İstek sürerken yeniden deneyeceğiz." : "Your internet connection looks unstable. We'll keep retrying while this request is active.";
12
12
  }
13
13
  function w() {
14
14
  let e;
@@ -18,7 +18,7 @@ function w() {
18
18
  function l() {
19
19
  i && (clearTimeout(i), i = null);
20
20
  }
21
- function T() {
21
+ function k() {
22
22
  a && (clearInterval(a), a = null);
23
23
  }
24
24
  async function f() {
@@ -26,11 +26,11 @@ async function f() {
26
26
  if (typeof navigator < "u" && navigator.onLine === !1) return !1;
27
27
  if (typeof window < "u") {
28
28
  const o = window.location.hostname;
29
- if (o === "localhost" || o === "127.0.0.1") return navigator.onLine;
29
+ if (o === "localhost" || o === "127.0.0.1") return typeof navigator < "u" ? navigator.onLine : !0;
30
30
  }
31
31
  const e = new AbortController(), r = setTimeout(() => e.abort(), 3e3);
32
32
  try {
33
- return await fetch(g, {
33
+ return await fetch(v, {
34
34
  method: "HEAD",
35
35
  mode: "no-cors",
36
36
  cache: "no-cache",
@@ -46,13 +46,13 @@ async function f() {
46
46
  }
47
47
  }
48
48
  function s() {
49
- t = !1, T(), y();
49
+ t = !1, k(), m();
50
50
  }
51
51
  function c() {
52
52
  i || t || n.size === 0 || (i = setTimeout(async () => {
53
53
  i = null, !(t || n.size === 0) && !await f() && n.size > 0 && (t = !0, d({
54
54
  source: "sdk",
55
- message: v(w()),
55
+ message: g(w()),
56
56
  sticky: !0
57
57
  }), a || (a = setInterval(async () => {
58
58
  if (n.size === 0) {
@@ -60,22 +60,27 @@ function c() {
60
60
  return;
61
61
  }
62
62
  await f() && (s(), c());
63
- }, m)));
64
- }, h));
63
+ }, L)));
64
+ }, C));
65
65
  }
66
- function k() {
67
- u || typeof window > "u" || (u = !0, window.addEventListener("online", () => {
68
- s(), c();
69
- }), window.addEventListener("offline", () => {
70
- n.size === 0 || t || (t = !0, l(), d({
71
- source: "sdk",
72
- message: v(w()),
73
- sticky: !0
74
- }));
66
+ function y() {
67
+ s(), c();
68
+ }
69
+ function h() {
70
+ n.size === 0 || t || (t = !0, l(), d({
71
+ source: "sdk",
72
+ message: g(w()),
73
+ sticky: !0
75
74
  }));
76
75
  }
77
- function E(e) {
78
- k();
76
+ function E() {
77
+ u || typeof window > "u" || (u = !0, window.addEventListener("online", y), window.addEventListener("offline", h));
78
+ }
79
+ function z() {
80
+ typeof window < "u" && (window.removeEventListener("online", y), window.removeEventListener("offline", h)), u = !1, l(), s(), n.clear();
81
+ }
82
+ function I(e) {
83
+ E();
79
84
  const r = Symbol(e.source);
80
85
  n.set(r, e.locale), c();
81
86
  let o = !1;
@@ -90,6 +95,7 @@ function E(e) {
90
95
  };
91
96
  }
92
97
  export {
93
- E as n,
98
+ z as n,
99
+ I as r,
94
100
  b as t
95
101
  };
@@ -1,5 +1,5 @@
1
- import { j as S } from "./context-UTzCGyR9.js";
2
- import { i as E } from "./widget-base-BwU6SI2o.js";
1
+ import { R as S } from "./global-error-toast-DvaKvPNA.js";
2
+ import { i as E } from "./widget-base-BnUjuCt7.js";
3
3
  function $(t, r) {
4
4
  if (typeof window > "u" || !S(t)) return !1;
5
5
  const e = new CustomEvent("gengage:navigate", {