@gengage/assistant-fe 0.3.35 → 0.3.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat/components/ChatDrawer.d.ts +17 -10
- package/dist/chat/components/ComparisonTable.d.ts +2 -1
- package/dist/chat/features/beauty-consulting/consulting-grid.d.ts +10 -0
- package/dist/chat/index.d.ts +4 -1
- package/dist/chat/session-persistence.d.ts +2 -1
- package/dist/chat/types.d.ts +1 -0
- package/dist/{chat-BVxo08xS.js → chat-BJu5cvMq.js} +2042 -1981
- package/dist/chat.iife.js +39 -39
- package/dist/chat.js +11 -10
- package/dist/common/action-router.d.ts +1 -0
- package/dist/common/locale.d.ts +1 -0
- package/dist/common/navigation.d.ts +5 -0
- package/dist/{common-dxI9x9_U.js → common-C50zU8bu.js} +2 -2
- package/dist/common.js +41 -41
- package/dist/{connection-warning-CHHi3BAf.js → connection-warning-nm_yulO-.js} +9 -9
- package/dist/{ga-datalayer-BwxWX-cr.js → ga-datalayer-BUM5z5Pq.js} +65 -60
- package/dist/index.js +31 -31
- package/dist/{native-webview-CMsUMLah.js → native-webview-CrnoI_JS.js} +31 -31
- package/dist/native.iife.js +36 -36
- package/dist/native.js +1 -1
- package/dist/{product-utils-Bm3aiAlJ.js → price-formatter-CR6VT5z4.js} +27 -27
- package/dist/{qna-BuBvAr2H.js → qna-6_XrdLG_.js} +85 -85
- package/dist/qna.iife.js +6 -6
- package/dist/qna.js +1 -1
- package/dist/{schemas-DBRIy5NT.js → schemas-ZYhTx11k.js} +1 -1
- package/dist/{simbut-BBXTlzOg.js → simbut--wBhTxId.js} +29 -29
- package/dist/simbut.iife.js +7 -7
- package/dist/simbut.js +1 -1
- package/dist/{simrel-BRh5eB2K.js → simrel-5I3yDyyo.js} +65 -65
- package/dist/simrel.iife.js +5 -5
- package/dist/simrel.js +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as k, c as h, i as D, o as f, r as m, t as A } from "./schemas-
|
|
2
|
-
import {
|
|
3
|
-
import { t as V } from "./chat-
|
|
4
|
-
import { t as $ } from "./qna-
|
|
5
|
-
import { t as j } from "./simrel-
|
|
6
|
-
import { t as G } from "./simbut
|
|
1
|
+
import { a as k, c as h, i as D, o as f, r as m, t as A } from "./schemas-ZYhTx11k.js";
|
|
2
|
+
import { B as H, L as Q, N as K, x as M } from "./ga-datalayer-BUM5z5Pq.js";
|
|
3
|
+
import { t as V } from "./chat-BJu5cvMq.js";
|
|
4
|
+
import { t as $ } from "./qna-6_XrdLG_.js";
|
|
5
|
+
import { t as j } from "./simrel-5I3yDyyo.js";
|
|
6
|
+
import { t as G } from "./simbut--wBhTxId.js";
|
|
7
7
|
var b = f({ enabled: m().default(!0) }), Y = f({
|
|
8
8
|
chat: h().optional(),
|
|
9
9
|
qna: h().optional(),
|
|
@@ -31,8 +31,8 @@ var b = f({ enabled: m().default(!0) }), Y = f({
|
|
|
31
31
|
keepaliveFetch: m().default(!0),
|
|
32
32
|
timeoutMs: k().int().positive().default(4e3),
|
|
33
33
|
maxRetries: k().int().min(0).max(5).default(1)
|
|
34
|
-
}),
|
|
35
|
-
idempotencyKey: h().default(
|
|
34
|
+
}), L = "__gengageWidgetsInit", ee = f({
|
|
35
|
+
idempotencyKey: h().default(L),
|
|
36
36
|
requireDomReady: m().default(!0)
|
|
37
37
|
}), te = A([
|
|
38
38
|
"log-and-ignore",
|
|
@@ -41,7 +41,7 @@ var b = f({ enabled: m().default(!0) }), Y = f({
|
|
|
41
41
|
]), ie = f({
|
|
42
42
|
unknownActionPolicy: te.default("log-and-ignore"),
|
|
43
43
|
allowScriptCall: m().default(!1)
|
|
44
|
-
}),
|
|
44
|
+
}), R = f({
|
|
45
45
|
version: D("1", { error: 'version must be "1"' }),
|
|
46
46
|
accountId: h({ error: "accountId must be a non-empty string" }).min(1, { error: "accountId must be a non-empty string" }),
|
|
47
47
|
middlewareUrl: h({ 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")' }),
|
|
@@ -78,16 +78,16 @@ var b = f({ enabled: m().default(!0) }), Y = f({
|
|
|
78
78
|
});
|
|
79
79
|
function ne(e) {
|
|
80
80
|
M("config", "parsing account runtime config", e);
|
|
81
|
-
const t =
|
|
81
|
+
const t = R.parse(e);
|
|
82
82
|
return M("config", "config resolved", {
|
|
83
83
|
accountId: t.accountId,
|
|
84
84
|
middlewareUrl: t.middlewareUrl
|
|
85
85
|
}), t;
|
|
86
86
|
}
|
|
87
87
|
function qe(e) {
|
|
88
|
-
return
|
|
88
|
+
return R.safeParse(e);
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function Ne(e) {
|
|
91
91
|
return ne({
|
|
92
92
|
version: "1",
|
|
93
93
|
accountId: e.accountId,
|
|
@@ -101,7 +101,7 @@ function Se(e) {
|
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
-
var
|
|
104
|
+
var B = `${L}_overlay_`, se = "#gengage-qna", oe = "#gengage-simrel", ae = "#gengage-simbut";
|
|
105
105
|
function q() {
|
|
106
106
|
const e = window;
|
|
107
107
|
return e.__gengageOverlayRegistry || (e.__gengageOverlayRegistry = {
|
|
@@ -124,12 +124,12 @@ function de(e, t) {
|
|
|
124
124
|
function I(e) {
|
|
125
125
|
return e instanceof HTMLElement || document.querySelector(e) ? e : null;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
return e.idempotencyKey ?? `${
|
|
127
|
+
function P(e) {
|
|
128
|
+
return e.idempotencyKey ?? `${B}${e.accountId}`;
|
|
129
129
|
}
|
|
130
130
|
var le = class {
|
|
131
131
|
constructor(e, t) {
|
|
132
|
-
this.options = e, this.onDestroy = t, this._chat = null, this._qna = null, this._simrel = null, this._simbut = null, this._analyticsClient = null, this._offQnaWire = null, this._destroyed = !1, this._queue = Promise.resolve(), this._warnedQnaMountMissing = !1, this._warnedSimRelMountMissing = !1, this._warnedSimButMountMissing = !1, this._warnedSimButNoChat = !1, this.idempotencyKey =
|
|
132
|
+
this.options = e, this.onDestroy = t, this._chat = null, this._qna = null, this._simrel = null, this._simbut = null, this._analyticsClient = null, this._offQnaWire = null, this._destroyed = !1, this._queue = Promise.resolve(), this._warnedQnaMountMissing = !1, this._warnedSimRelMountMissing = !1, this._warnedSimButMountMissing = !1, this._warnedSimButNoChat = !1, this.idempotencyKey = P(e), this.session = K(e.session), this._pageContext = re(e);
|
|
133
133
|
}
|
|
134
134
|
get chat() {
|
|
135
135
|
return this._chat;
|
|
@@ -147,7 +147,7 @@ var le = class {
|
|
|
147
147
|
return this._analyticsClient;
|
|
148
148
|
}
|
|
149
149
|
async init() {
|
|
150
|
-
window.gengage || (window.gengage = {}), window.gengage.sessionId = this.session.sessionId, window.gengage.pageContext = this._pageContext, await this._initChat(), this.options.wireQnaToChat !== !1 && (this._offQnaWire =
|
|
150
|
+
window.gengage || (window.gengage = {}), window.gengage.sessionId = this.session.sessionId, window.gengage.pageContext = this._pageContext, await this._initChat(), this.options.wireQnaToChat !== !1 && (this._offQnaWire = Q()), await this._syncPdpWidgets(), window.gengage.overlay = this;
|
|
151
151
|
}
|
|
152
152
|
openChat(e) {
|
|
153
153
|
this._chat?.open(e);
|
|
@@ -238,7 +238,7 @@ var le = class {
|
|
|
238
238
|
mountTarget: s
|
|
239
239
|
};
|
|
240
240
|
this.options.theme !== void 0 && (n.theme = this.options.theme), this.options.pricing !== void 0 && (n.pricing = this.options.pricing), this.options.simrel?.discountType !== void 0 && (n.discountType = this.options.simrel.discountType), this.options.simrel?.renderCardElement !== void 0 && (n.renderCardElement = this.options.simrel.renderCardElement), this.options.simrel?.renderer !== void 0 && (n.renderer = this.options.simrel.renderer), this.options.onAddToCart !== void 0 && (n.onAddToCart = this.options.onAddToCart), this.options.onProductNavigate !== void 0 ? n.onProductNavigate = this.options.onProductNavigate : n.onProductNavigate = (d, c, a) => {
|
|
241
|
-
|
|
241
|
+
H(d) && (this._chat?.saveSession(a ?? this.session.sessionId, c), window.location.href = d);
|
|
242
242
|
}, await o.init(n), this._simrel = o;
|
|
243
243
|
}
|
|
244
244
|
else
|
|
@@ -279,7 +279,7 @@ var le = class {
|
|
|
279
279
|
}
|
|
280
280
|
};
|
|
281
281
|
async function ue(e) {
|
|
282
|
-
const t =
|
|
282
|
+
const t = P(e), i = q(), s = i.instances[t];
|
|
283
283
|
if (s) return s;
|
|
284
284
|
const o = i.pending[t];
|
|
285
285
|
if (o) return o;
|
|
@@ -294,11 +294,11 @@ async function ue(e) {
|
|
|
294
294
|
function ce(e) {
|
|
295
295
|
return q().instances[e] ?? null;
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function Se(e) {
|
|
298
298
|
ce(e)?.destroy();
|
|
299
299
|
}
|
|
300
300
|
function ke(e) {
|
|
301
|
-
return `${
|
|
301
|
+
return `${B}${e}`;
|
|
302
302
|
}
|
|
303
303
|
var ge = [
|
|
304
304
|
"gengage:chat:open",
|
|
@@ -356,11 +356,11 @@ function fe(e) {
|
|
|
356
356
|
}
|
|
357
357
|
return null;
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function N(e, t) {
|
|
360
360
|
return t instanceof HTMLElement ? !0 : typeof t != "string" ? !1 : e.document.querySelector(t) !== null;
|
|
361
361
|
}
|
|
362
362
|
function E(e, t, i) {
|
|
363
|
-
if (t instanceof HTMLElement ||
|
|
363
|
+
if (t instanceof HTMLElement || N(e, t) || typeof t != "string") return t;
|
|
364
364
|
if (t.startsWith("#")) {
|
|
365
365
|
const n = t.slice(1);
|
|
366
366
|
if (n.length > 0) {
|
|
@@ -455,8 +455,8 @@ function ye(e = {}) {
|
|
|
455
455
|
}, W = () => {
|
|
456
456
|
if (!a || u.length === 0) return;
|
|
457
457
|
const l = u.splice(0, u.length);
|
|
458
|
-
for (const r of l)
|
|
459
|
-
},
|
|
458
|
+
for (const r of l) S(r);
|
|
459
|
+
}, S = (l) => {
|
|
460
460
|
const r = pe(l);
|
|
461
461
|
if (!r || typeof r.type != "string") {
|
|
462
462
|
console.warn("[gengage:native-bridge] Invalid message:", l);
|
|
@@ -500,7 +500,7 @@ function ye(e = {}) {
|
|
|
500
500
|
}, C = {
|
|
501
501
|
env: c,
|
|
502
502
|
sendToNative: v,
|
|
503
|
-
receive:
|
|
503
|
+
receive: S,
|
|
504
504
|
setController(l) {
|
|
505
505
|
a = l, W();
|
|
506
506
|
},
|
|
@@ -536,7 +536,7 @@ async function Me(e) {
|
|
|
536
536
|
enabled: !0,
|
|
537
537
|
mountTarget: u
|
|
538
538
|
};
|
|
539
|
-
} else
|
|
539
|
+
} else N(window, x) || (n.qna = { enabled: !1 });
|
|
540
540
|
const c = n.simrel?.enabled === !0 || n.simrel?.mountTarget !== void 0;
|
|
541
541
|
if (n.simrel?.enabled !== !1)
|
|
542
542
|
if (c) {
|
|
@@ -546,7 +546,7 @@ async function Me(e) {
|
|
|
546
546
|
enabled: !0,
|
|
547
547
|
mountTarget: u
|
|
548
548
|
};
|
|
549
|
-
} else
|
|
549
|
+
} else N(window, U) || (n.simrel = { enabled: !1 });
|
|
550
550
|
const a = await ue(n);
|
|
551
551
|
return o.setController(a), i && o.sendToNative("ready", {
|
|
552
552
|
sessionId: a.session.sessionId,
|
|
@@ -574,9 +574,9 @@ export {
|
|
|
574
574
|
ne as m,
|
|
575
575
|
ve as n,
|
|
576
576
|
ke as o,
|
|
577
|
-
|
|
577
|
+
Ne as p,
|
|
578
578
|
ye as r,
|
|
579
|
-
|
|
579
|
+
Se as s,
|
|
580
580
|
ge as t,
|
|
581
|
-
|
|
581
|
+
R as u
|
|
582
582
|
};
|