@gengage/assistant-fe 0.4.20 → 0.5.0
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/README.md +1 -1
- package/dist/{api-paths-CReMDZWg.js → api-paths-y5nkfEBG.js} +1 -1
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +43 -43
- package/dist/chat.js +1 -1
- package/dist/common-BKPSOoIP.js +324 -0
- package/dist/common.js +64 -81
- package/dist/{connection-warning-C_4e7ahZ.js → connection-warning-DJiyLM46.js} +1 -1
- package/dist/{fastIntent-DMNzXOSI.js → fastIntent-1T2g9art.js} +2 -2
- package/dist/index.js +49 -52
- package/dist/{native-webview-Bbcvvi_5.js → native-webview-y3a9R9hH.js} +1 -1
- package/dist/native.iife.js +23 -23
- package/dist/native.js +1 -1
- package/dist/{overlay-O4nlUrzw.js → overlay-v3nvcGlE.js} +2 -5
- package/dist/overlay.js +2 -2
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.iife.js +36 -36
- package/dist/qna.js +1 -1
- package/dist/{runtime-C51WykbJ.js → runtime-BMNOS2Mq.js} +176 -196
- package/dist/runtime-DOS9yRRx.js +650 -0
- package/dist/{runtime-DBh8899B.js → runtime-DsP6go8z.js} +2194 -2225
- package/dist/{simbut-CO1rLVM9.js → simbut-BwxzoBcY.js} +7 -7
- package/dist/simbut.iife.js +12 -12
- package/dist/simbut.js +1 -1
- package/dist/{simrel-zCDlCrqG.js → simrel-C07wZN8Q.js} +2 -2
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +35 -35
- package/dist/simrel.js +2 -2
- package/dist/widget-base-Dliq3QAf.js +362 -0
- package/package.json +8 -6
- package/dist/chat/api.d.ts +0 -88
- package/dist/chat/assistant-mode.d.ts +0 -19
- package/dist/chat/attachment-utils.d.ts +0 -9
- package/dist/chat/catalog.d.ts +0 -826
- package/dist/chat/chat-presentation-state.d.ts +0 -53
- package/dist/chat/components/AIGroupingCards.d.ts +0 -3
- package/dist/chat/components/AISuggestedSearchCards.d.ts +0 -3
- package/dist/chat/components/AITopPicks.d.ts +0 -3
- package/dist/chat/components/BeautyPhotoStep.d.ts +0 -16
- package/dist/chat/components/CategoriesContainer.d.ts +0 -3
- package/dist/chat/components/ChatDrawer.d.ts +0 -360
- package/dist/chat/components/ChoicePrompter.d.ts +0 -21
- package/dist/chat/components/ComparisonTable.d.ts +0 -57
- package/dist/chat/components/ConsultingStylePicker.d.ts +0 -34
- package/dist/chat/components/FloatingComparisonButton.d.ts +0 -2
- package/dist/chat/components/FloatingLauncher.d.ts +0 -79
- package/dist/chat/components/GroundingReviewCard.d.ts +0 -3
- package/dist/chat/components/HandoffNotice.d.ts +0 -4
- package/dist/chat/components/KvkkBanner.d.ts +0 -6
- package/dist/chat/components/Launcher.d.ts +0 -28
- package/dist/chat/components/PanelRestoreCard.d.ts +0 -4
- package/dist/chat/components/PanelTopBar.d.ts +0 -32
- package/dist/chat/components/PhotoAnalysisCard.d.ts +0 -20
- package/dist/chat/components/ProductSummaryCard.d.ts +0 -3
- package/dist/chat/components/ProsAndCons.d.ts +0 -8
- package/dist/chat/components/ReviewHighlights.d.ts +0 -9
- package/dist/chat/components/actionClassifier.d.ts +0 -12
- package/dist/chat/components/product-price-layout.d.ts +0 -18
- package/dist/chat/components/productMentionLinker.d.ts +0 -25
- package/dist/chat/components/renderUISpec.d.ts +0 -11
- package/dist/chat/components/typewriter.d.ts +0 -24
- package/dist/chat/extendedModeManager.d.ts +0 -32
- package/dist/chat/features/beauty-consulting/consulting-grid.d.ts +0 -31
- package/dist/chat/features/beauty-consulting/drawer-extensions.d.ts +0 -20
- package/dist/chat/features/beauty-consulting/mode-controller.d.ts +0 -53
- package/dist/chat/features/beauty-consulting/registry.d.ts +0 -3
- package/dist/chat/features/beauty-consulting/stream-handler.d.ts +0 -38
- package/dist/chat/history-storage.d.ts +0 -85
- package/dist/chat/index.d.ts +0 -5
- package/dist/chat/kvkk.d.ts +0 -20
- package/dist/chat/locales/en.d.ts +0 -2
- package/dist/chat/locales/index.d.ts +0 -5
- package/dist/chat/locales/tr.d.ts +0 -2
- package/dist/chat/panel-manager.d.ts +0 -126
- package/dist/chat/runtime.d.ts +0 -400
- package/dist/chat/session-persistence.d.ts +0 -65
- package/dist/chat/stream-error-display.d.ts +0 -6
- package/dist/chat/types.d.ts +0 -543
- package/dist/chat/utils/chat-presentation-debug.d.ts +0 -19
- package/dist/chat/utils/get-chat-scroll-element.d.ts +0 -10
- package/dist/chat/utils/ui.d.ts +0 -10
- package/dist/common/action-router.d.ts +0 -26
- package/dist/common/activity-tracker.d.ts +0 -37
- package/dist/common/analytics-events.d.ts +0 -91
- package/dist/common/analytics.d.ts +0 -61
- package/dist/common/api-paths.d.ts +0 -15
- package/dist/common/client.d.ts +0 -27
- package/dist/common/communication-bridge.d.ts +0 -51
- package/dist/common/config-constants.d.ts +0 -1
- package/dist/common/config-schema.d.ts +0 -81
- package/dist/common/connection-warning.d.ts +0 -8
- package/dist/common/consulting-sources.d.ts +0 -9
- package/dist/common/context.d.ts +0 -27
- package/dist/common/css-escape.d.ts +0 -1
- package/dist/common/customization-factories.d.ts +0 -62
- package/dist/common/debug.d.ts +0 -13
- package/dist/common/events.d.ts +0 -46
- package/dist/common/fastIntent.d.ts +0 -1
- package/dist/common/find-similar-payload.d.ts +0 -3
- package/dist/common/ga-datalayer.d.ts +0 -89
- package/dist/common/global-error-toast.d.ts +0 -6
- package/dist/common/index.d.ts +0 -50
- package/dist/common/indexed-db.d.ts +0 -79
- package/dist/common/locale.d.ts +0 -1
- package/dist/common/native-webview.d.ts +0 -60
- package/dist/common/navigation.d.ts +0 -5
- package/dist/common/overlay.d.ts +0 -168
- package/dist/common/page-detect.d.ts +0 -30
- package/dist/common/pill-launcher.d.ts +0 -51
- package/dist/common/preflight.d.ts +0 -13
- package/dist/common/price-formatter.d.ts +0 -35
- package/dist/common/product-utils.d.ts +0 -35
- package/dist/common/protocol-adapter.d.ts +0 -105
- package/dist/common/renderer/dom.d.ts +0 -3
- package/dist/common/renderer/index.d.ts +0 -4
- package/dist/common/renderer/overrides.d.ts +0 -23
- package/dist/common/renderer/registry.d.ts +0 -2
- package/dist/common/renderer/types.d.ts +0 -19
- package/dist/common/safe-html.d.ts +0 -22
- package/dist/common/sdk-version.d.ts +0 -3
- package/dist/common/skeleton.d.ts +0 -8
- package/dist/common/streaming.d.ts +0 -37
- package/dist/common/suggested-search-keywords.d.ts +0 -18
- package/dist/common/theme-utils.d.ts +0 -15
- package/dist/common/tts-player.d.ts +0 -13
- package/dist/common/types.d.ts +0 -381
- package/dist/common/ui-theme.d.ts +0 -9
- package/dist/common/uuidv7.d.ts +0 -7
- package/dist/common/voice-input.d.ts +0 -74
- package/dist/common/widget-base.d.ts +0 -97
- package/dist/common-BM2ZsSLI.js +0 -491
- package/dist/index.d.ts +0 -25
- package/dist/native/index.d.ts +0 -2
- package/dist/overlay.d.ts +0 -4
- package/dist/qna/api.d.ts +0 -23
- package/dist/qna/catalog.d.ts +0 -73
- package/dist/qna/components/ButtonRow.d.ts +0 -15
- package/dist/qna/components/TextInput.d.ts +0 -11
- package/dist/qna/components/renderUISpec.d.ts +0 -7
- package/dist/qna/index.d.ts +0 -3
- package/dist/qna/locales/en.d.ts +0 -2
- package/dist/qna/locales/index.d.ts +0 -5
- package/dist/qna/locales/tr.d.ts +0 -2
- package/dist/qna/normalize-ui-specs.d.ts +0 -15
- package/dist/qna/runtime.d.ts +0 -62
- package/dist/qna/types.d.ts +0 -98
- package/dist/runtime-bbMljGVG.js +0 -688
- package/dist/simbut/index.d.ts +0 -22
- package/dist/simbut/locales.d.ts +0 -3
- package/dist/simbut/types.d.ts +0 -43
- package/dist/simrel/api.d.ts +0 -25
- package/dist/simrel/catalog.d.ts +0 -110
- package/dist/simrel/components/GroupTabs.d.ts +0 -24
- package/dist/simrel/components/ProductCard.d.ts +0 -19
- package/dist/simrel/components/ProductGrid.d.ts +0 -17
- package/dist/simrel/components/renderUISpec.d.ts +0 -7
- package/dist/simrel/index.d.ts +0 -5
- package/dist/simrel/locales/en.d.ts +0 -2
- package/dist/simrel/locales/index.d.ts +0 -5
- package/dist/simrel/locales/tr.d.ts +0 -2
- package/dist/simrel/renderers/default.d.ts +0 -40
- package/dist/simrel/runtime.d.ts +0 -59
- package/dist/simrel/types.d.ts +0 -141
- package/dist/widget-base-Cf9ofZhh.js +0 -589
- /package/dist/{context-DGz5F81j.js → context-BBuSsXZ9.js} +0 -0
package/dist/chat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, c as t, d as r, i as s, l as n, n as i, o as c, r as l, s as o, t as C, u as h } from "./runtime-
|
|
1
|
+
import { a as e, c as t, d as r, i as s, l as n, n as i, o as c, r as l, s as o, t as C, u as h } from "./runtime-DsP6go8z.js";
|
|
2
2
|
import { t as p } from "./chat-BRKK63lt.js";
|
|
3
3
|
export {
|
|
4
4
|
n as CHAT_SCROLL_ELEMENT_ID,
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { i as g } from "./widget-base-Dliq3QAf.js";
|
|
2
|
+
import { c as l, i as p, o as d, r as u, t as w } from "./schemas-CLo8wCjs.js";
|
|
3
|
+
import { a as y, i as h } from "./overlay-v3nvcGlE.js";
|
|
4
|
+
var c = d({ enabled: u().default(!0) }), v = d({
|
|
5
|
+
chat: l().optional(),
|
|
6
|
+
qna: l().optional(),
|
|
7
|
+
simrel: l().optional(),
|
|
8
|
+
simbut: l().optional()
|
|
9
|
+
}), b = d({}), U = d({
|
|
10
|
+
idempotencyKey: l().default(y),
|
|
11
|
+
requireDomReady: u().default(!0)
|
|
12
|
+
}), I = w([
|
|
13
|
+
"log-and-ignore",
|
|
14
|
+
"throw",
|
|
15
|
+
"delegate"
|
|
16
|
+
]), T = d({
|
|
17
|
+
unknownActionPolicy: I.default("log-and-ignore"),
|
|
18
|
+
allowScriptCall: u().default(!1)
|
|
19
|
+
}), f = d({
|
|
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(),
|
|
24
|
+
widgets: d({
|
|
25
|
+
chat: c.default({ enabled: !0 }),
|
|
26
|
+
qna: c.default({ enabled: !0 }),
|
|
27
|
+
simrel: c.optional(),
|
|
28
|
+
simbut: c.default({ enabled: !1 })
|
|
29
|
+
}),
|
|
30
|
+
mounts: v.default({}),
|
|
31
|
+
transport: b.default({}),
|
|
32
|
+
gtm: U.default({
|
|
33
|
+
idempotencyKey: "__gengageWidgetsInit",
|
|
34
|
+
requireDomReady: !0
|
|
35
|
+
}),
|
|
36
|
+
actionHandling: T.default({
|
|
37
|
+
unknownActionPolicy: "log-and-ignore",
|
|
38
|
+
allowScriptCall: !1
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
function C(e) {
|
|
42
|
+
g("config", "parsing account runtime config", e);
|
|
43
|
+
const n = f.parse(e);
|
|
44
|
+
return g("config", "config resolved", {
|
|
45
|
+
accountId: n.accountId,
|
|
46
|
+
middlewareUrl: n.middlewareUrl
|
|
47
|
+
}), n;
|
|
48
|
+
}
|
|
49
|
+
function S(e) {
|
|
50
|
+
return f.safeParse(e);
|
|
51
|
+
}
|
|
52
|
+
function x(e) {
|
|
53
|
+
return C({
|
|
54
|
+
version: "1",
|
|
55
|
+
accountId: e.accountId,
|
|
56
|
+
middlewareUrl: e.middlewareUrl,
|
|
57
|
+
locale: e.locale,
|
|
58
|
+
widgets: {
|
|
59
|
+
chat: { enabled: !0 },
|
|
60
|
+
qna: { enabled: !0 },
|
|
61
|
+
simbut: { enabled: !1 }
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
var M = "tr";
|
|
66
|
+
function N(e) {
|
|
67
|
+
return {
|
|
68
|
+
ACCOUNT_ID: e.accountId,
|
|
69
|
+
MIDDLEWARE_URL: e.middlewareUrl,
|
|
70
|
+
LOCALE: e.locale ?? "tr"
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function $(e, n = {}) {
|
|
74
|
+
const t = {
|
|
75
|
+
accountId: e.accountId,
|
|
76
|
+
middlewareUrl: e.middlewareUrl,
|
|
77
|
+
session: { sessionId: e.sessionId },
|
|
78
|
+
variant: "floating",
|
|
79
|
+
locale: e.locale ?? "tr",
|
|
80
|
+
...n
|
|
81
|
+
};
|
|
82
|
+
return e.theme !== void 0 && (t.theme = e.theme), t;
|
|
83
|
+
}
|
|
84
|
+
function F(e, n = {}) {
|
|
85
|
+
const t = {
|
|
86
|
+
accountId: e.accountId,
|
|
87
|
+
middlewareUrl: e.middlewareUrl,
|
|
88
|
+
session: { sessionId: e.sessionId },
|
|
89
|
+
pageContext: {
|
|
90
|
+
pageType: "pdp",
|
|
91
|
+
sku: e.sku
|
|
92
|
+
},
|
|
93
|
+
mountTarget: e.mountTarget,
|
|
94
|
+
...n
|
|
95
|
+
};
|
|
96
|
+
return e.theme !== void 0 && (t.theme = e.theme), t;
|
|
97
|
+
}
|
|
98
|
+
function K(e, n = {}) {
|
|
99
|
+
const t = {
|
|
100
|
+
accountId: e.accountId,
|
|
101
|
+
middlewareUrl: e.middlewareUrl,
|
|
102
|
+
session: { sessionId: e.sessionId },
|
|
103
|
+
sku: e.sku,
|
|
104
|
+
mountTarget: e.mountTarget,
|
|
105
|
+
...n
|
|
106
|
+
};
|
|
107
|
+
return e.theme !== void 0 && (t.theme = e.theme), t;
|
|
108
|
+
}
|
|
109
|
+
function E(e) {
|
|
110
|
+
try {
|
|
111
|
+
return document.querySelector(e), !0;
|
|
112
|
+
} catch {
|
|
113
|
+
return !1;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function P(e, n) {
|
|
117
|
+
const t = [], r = e.mounts, i = [
|
|
118
|
+
["qna", r.qna],
|
|
119
|
+
["simrel", r.simrel],
|
|
120
|
+
["simbut", r.simbut],
|
|
121
|
+
["chat", r.chat]
|
|
122
|
+
];
|
|
123
|
+
for (const [a, s] of i)
|
|
124
|
+
if (s !== void 0) {
|
|
125
|
+
if (a === "simrel" && e.widgets.simrel === void 0) {
|
|
126
|
+
t.push({
|
|
127
|
+
code: "SIMREL_MOUNT_IGNORED",
|
|
128
|
+
message: "[gengage preflight] mounts.simrel is set but widgets.simrel is not declared — SimRel will not initialize. Add widgets.simrel: { enabled: true } to enable it.",
|
|
129
|
+
severity: "warn"
|
|
130
|
+
});
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (!E(s)) {
|
|
134
|
+
t.push({
|
|
135
|
+
code: "INVALID_SELECTOR",
|
|
136
|
+
message: `[gengage preflight] ${a} mount selector is invalid CSS: "${s}"`,
|
|
137
|
+
severity: "error"
|
|
138
|
+
});
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
document.querySelector(s) || t.push({
|
|
142
|
+
code: "MOUNT_NOT_FOUND",
|
|
143
|
+
message: `[gengage preflight] ${a} mount target not found: "${s}" — widget will skip or wait for DOM`,
|
|
144
|
+
severity: "warn"
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
if (e.widgets.simbut.enabled && r.simbut === void 0) {
|
|
148
|
+
const a = "#gengage-simbut";
|
|
149
|
+
document.querySelector(a) || t.push({
|
|
150
|
+
code: "SIMBUT_MOUNT_REQUIRED",
|
|
151
|
+
message: `[gengage preflight] SimBut is enabled but no mount target is configured. Set mounts.simbut to your product image wrapper selector (e.g. "#product-gallery"). The default "${a}" was not found in the DOM.`,
|
|
152
|
+
severity: "error"
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
const o = e.gtm.idempotencyKey;
|
|
156
|
+
if (window[o] !== void 0 && t.push({
|
|
157
|
+
code: "DUPLICATE_IDEMPOTENCY",
|
|
158
|
+
message: `[gengage preflight] window["${o}"] already exists — widgets may have already initialized`,
|
|
159
|
+
severity: "warn"
|
|
160
|
+
}), !n?.skipCspCheck) {
|
|
161
|
+
let a = !1;
|
|
162
|
+
const s = (m) => {
|
|
163
|
+
m.blockedURI && e.middlewareUrl.startsWith(m.blockedURI) && (a = !0);
|
|
164
|
+
};
|
|
165
|
+
document.addEventListener("securitypolicyviolation", s);
|
|
166
|
+
try {
|
|
167
|
+
fetch(e.middlewareUrl, {
|
|
168
|
+
method: "HEAD",
|
|
169
|
+
mode: "no-cors"
|
|
170
|
+
}).catch(() => {
|
|
171
|
+
});
|
|
172
|
+
} catch {
|
|
173
|
+
a = !0;
|
|
174
|
+
}
|
|
175
|
+
document.removeEventListener("securitypolicyviolation", s), a && t.push({
|
|
176
|
+
code: "CSP_BLOCKED",
|
|
177
|
+
message: `[gengage preflight] middleware URL may be blocked by Content-Security-Policy: "${e.middlewareUrl}". Add it to connect-src.`,
|
|
178
|
+
severity: "warn"
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
for (const a of t) a.severity === "error" ? console.error(a.message) : console.warn(a.message);
|
|
182
|
+
return {
|
|
183
|
+
ok: t.every((a) => a.severity !== "error"),
|
|
184
|
+
warnings: t
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function R(e) {
|
|
188
|
+
const n = S(e);
|
|
189
|
+
if (!n.success) {
|
|
190
|
+
const t = n.error.issues.map((r) => `${r.path.join(".")}: ${r.message}`).join("; ");
|
|
191
|
+
throw new Error(`[gengage] Invalid runtime config: ${t}`);
|
|
192
|
+
}
|
|
193
|
+
return n.data;
|
|
194
|
+
}
|
|
195
|
+
function k(e, n, t) {
|
|
196
|
+
const r = {
|
|
197
|
+
accountId: e.accountId,
|
|
198
|
+
middlewareUrl: e.middlewareUrl,
|
|
199
|
+
idempotencyKey: e.gtm.idempotencyKey
|
|
200
|
+
};
|
|
201
|
+
return e.locale !== void 0 && (r.locale = e.locale), t !== void 0 && (r.pageContext = t, t.sku !== void 0 && (r.sku = t.sku)), r.chat = { enabled: e.widgets.chat.enabled }, e.mounts.chat !== void 0 && (r.chat.mountTarget = e.mounts.chat), r.qna = { enabled: e.widgets.qna.enabled }, e.mounts.qna !== void 0 && (r.qna.mountTarget = e.mounts.qna), e.widgets.simrel !== void 0 && (r.simrel = {
|
|
202
|
+
enabled: e.widgets.simrel.enabled,
|
|
203
|
+
...e.mounts.simrel !== void 0 ? { mountTarget: e.mounts.simrel } : {}
|
|
204
|
+
}), r.simbut = { enabled: e.widgets.simbut.enabled }, e.mounts.simbut !== void 0 && (r.simbut.mountTarget = e.mounts.simbut), n?.onAddToCart !== void 0 && (r.onAddToCart = n.onAddToCart), n?.onProductNavigate !== void 0 && (r.onProductNavigate = n.onProductNavigate), n?.onFindSimilar !== void 0 && (r.simbut.onFindSimilar = n.onFindSimilar), n?.onScriptCall !== void 0 && (r.onScriptCall = n.onScriptCall), r;
|
|
205
|
+
}
|
|
206
|
+
async function B(e) {
|
|
207
|
+
const n = R(e.runtimeConfig);
|
|
208
|
+
if (e.preflight !== !1) {
|
|
209
|
+
const i = P(n);
|
|
210
|
+
if (!i.ok) {
|
|
211
|
+
const o = i.warnings.filter((a) => a.severity === "error");
|
|
212
|
+
throw new Error(`[gengage] Preflight failed: ${o.map((a) => a.message).join("; ")}`);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
const t = e.contextResolver?.(), r = await h(k(n, e.hostActions, t));
|
|
216
|
+
if (e.contextResolver !== void 0) {
|
|
217
|
+
const i = e.contextResolver, o = () => {
|
|
218
|
+
const s = i();
|
|
219
|
+
r.updateContext(s);
|
|
220
|
+
};
|
|
221
|
+
window.addEventListener("gengage:context:update", o);
|
|
222
|
+
const a = r.destroy.bind(r);
|
|
223
|
+
r.destroy = () => {
|
|
224
|
+
window.removeEventListener("gengage:context:update", o), a();
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
return r;
|
|
228
|
+
}
|
|
229
|
+
var L = [
|
|
230
|
+
{
|
|
231
|
+
pageType: "home",
|
|
232
|
+
urlPatterns: [
|
|
233
|
+
"^/$",
|
|
234
|
+
"^/index\\.html?$",
|
|
235
|
+
"^/anasayfa$"
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
pageType: "search",
|
|
240
|
+
urlPatterns: [
|
|
241
|
+
"/arama",
|
|
242
|
+
"/search",
|
|
243
|
+
"/ara\\?"
|
|
244
|
+
],
|
|
245
|
+
queryParam: "q"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
pageType: "cart",
|
|
249
|
+
urlPatterns: [
|
|
250
|
+
"/sepet",
|
|
251
|
+
"/cart",
|
|
252
|
+
"/basket",
|
|
253
|
+
"/sepetim"
|
|
254
|
+
]
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
pageType: "plp",
|
|
258
|
+
urlPatterns: [
|
|
259
|
+
"/kategori/",
|
|
260
|
+
"/category/",
|
|
261
|
+
"/c/",
|
|
262
|
+
"/koleksiyon/",
|
|
263
|
+
"/collection/"
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
pageType: "pdp",
|
|
268
|
+
urlPatterns: [
|
|
269
|
+
"/urun/",
|
|
270
|
+
"/product/",
|
|
271
|
+
"/p/",
|
|
272
|
+
"/-p-",
|
|
273
|
+
"/-pm-"
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
];
|
|
277
|
+
function D(e, n) {
|
|
278
|
+
const t = n ?? (typeof window < "u" ? new URL(window.location.href) : null);
|
|
279
|
+
if (!t) return "other";
|
|
280
|
+
const r = e ?? L, i = t.pathname;
|
|
281
|
+
for (const o of r)
|
|
282
|
+
if (!(o.urlPatterns && !o.urlPatterns.some((a) => {
|
|
283
|
+
try {
|
|
284
|
+
return new RegExp(a, "i").test(i);
|
|
285
|
+
} catch {
|
|
286
|
+
return !1;
|
|
287
|
+
}
|
|
288
|
+
})) && !(o.queryParam && !t.searchParams.has(o.queryParam)) && !(o.selector && typeof document < "u" && !document.querySelector(o.selector)))
|
|
289
|
+
return o.pageType;
|
|
290
|
+
return "other";
|
|
291
|
+
}
|
|
292
|
+
function q(e) {
|
|
293
|
+
const n = e ?? (typeof window < "u" ? new URL(window.location.href) : null);
|
|
294
|
+
if (!n) return;
|
|
295
|
+
const t = n.pathname, r = t.match(/\/(?:p|urun|product)\/([^/?#]+)/i);
|
|
296
|
+
if (r?.[1]) return r[1];
|
|
297
|
+
const i = t.match(/-p-(\d+)/i);
|
|
298
|
+
if (i?.[1]) return i[1];
|
|
299
|
+
}
|
|
300
|
+
function W(e) {
|
|
301
|
+
const n = D(e), t = { pageType: n };
|
|
302
|
+
if (n === "pdp") {
|
|
303
|
+
const r = q();
|
|
304
|
+
r && (t.sku = r);
|
|
305
|
+
}
|
|
306
|
+
return typeof window < "u" && (t.url = window.location.href), t;
|
|
307
|
+
}
|
|
308
|
+
export {
|
|
309
|
+
P as a,
|
|
310
|
+
$ as c,
|
|
311
|
+
f as d,
|
|
312
|
+
I as f,
|
|
313
|
+
S as h,
|
|
314
|
+
B as i,
|
|
315
|
+
F as l,
|
|
316
|
+
C as m,
|
|
317
|
+
D as n,
|
|
318
|
+
M as o,
|
|
319
|
+
x as p,
|
|
320
|
+
q as r,
|
|
321
|
+
N as s,
|
|
322
|
+
W as t,
|
|
323
|
+
K as u
|
|
324
|
+
};
|
package/dist/common.js
CHANGED
|
@@ -1,91 +1,74 @@
|
|
|
1
|
-
import { a, d as t, f as s, h as r, i
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { i as
|
|
5
|
-
import { n as
|
|
6
|
-
import { i as
|
|
7
|
-
import { a as
|
|
8
|
-
import {
|
|
1
|
+
import { a, d as t, f as s, h as r, i, l as o, m as n, n as c, o as m, p as l, r as d, t as g, u as p } from "./api-paths-y5nkfEBG.js";
|
|
2
|
+
import { N as f, a as E, c as S, i as h, k as C, n as T, o as y, r as A, s as G, t as I } from "./context-BBuSsXZ9.js";
|
|
3
|
+
import { a as R, c as W, d as v, f as N, l as P, n as U, o as O, p as D, r as _, t as L, u as b } from "./widget-base-Dliq3QAf.js";
|
|
4
|
+
import { i as x, n as B, o as F, r as z, t as M } from "./fastIntent-1T2g9art.js";
|
|
5
|
+
import { n as K, t as H } from "./connection-warning-DJiyLM46.js";
|
|
6
|
+
import { i as q, n as Z, r as j, t as J } from "./overlay-v3nvcGlE.js";
|
|
7
|
+
import { a as Y, i as $, n as ee, r as ae } from "./native-webview-y3a9R9hH.js";
|
|
8
|
+
import { a as se, c as re, d as ie, f as oe, h as ne, i as ce, l as me, m as le, n as de, o as ge, p as pe, r as ue, s as fe, t as Ee, u as Se } from "./common-BKPSOoIP.js";
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
ee as
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
d as buildChatEndpointUrl,
|
|
27
|
-
me as buildOverlayIdempotencyKey,
|
|
28
|
-
I as chatHistorySnapshotEvent,
|
|
29
|
-
G as checkoutCompleteEvent,
|
|
30
|
-
f as checkoutStartEvent,
|
|
31
|
-
re as configureConnectionWarning,
|
|
10
|
+
ie as AccountRuntimeConfigSchema,
|
|
11
|
+
b as BASE_WIDGET_THEME,
|
|
12
|
+
L as BaseWidget,
|
|
13
|
+
ge as DEFAULT_CUSTOMIZATION_LOCALE,
|
|
14
|
+
N as DEFAULT_WIDGET_THEME_TOKENS,
|
|
15
|
+
U as GENGAGE_BUILD_FLAVOR,
|
|
16
|
+
_ as GENGAGE_VERSION,
|
|
17
|
+
oe as UnknownActionPolicySchema,
|
|
18
|
+
z as VoiceInput,
|
|
19
|
+
d as adaptBackendEvent,
|
|
20
|
+
ee as applyNativeSession,
|
|
21
|
+
Ee as autoDetectPageContext,
|
|
22
|
+
I as bootstrapSession,
|
|
23
|
+
g as buildChatEndpointUrl,
|
|
24
|
+
J as buildOverlayIdempotencyKey,
|
|
25
|
+
H as configureConnectionWarning,
|
|
32
26
|
t as consumeStream,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
ce as getOverlayWidgets,
|
|
51
|
-
i as getSuggestedSearchKeywords,
|
|
27
|
+
fe as createAccountIdentity,
|
|
28
|
+
pe as createDefaultAccountRuntimeConfig,
|
|
29
|
+
re as createFloatingChatConfig,
|
|
30
|
+
ae as createNativeWebViewBridge,
|
|
31
|
+
me as createPdpQnaConfig,
|
|
32
|
+
Se as createPdpSimRelConfig,
|
|
33
|
+
n as defaultUnknownUISpecRenderer,
|
|
34
|
+
Z as destroyOverlayWidgets,
|
|
35
|
+
M as detectFastIntent,
|
|
36
|
+
$ as detectNativeEnvironment,
|
|
37
|
+
de as detectPageType,
|
|
38
|
+
R as dismissGlobalErrorToast,
|
|
39
|
+
E as dispatch,
|
|
40
|
+
ue as extractSkuFromUrl,
|
|
41
|
+
O as getGlobalErrorMessage,
|
|
42
|
+
j as getOverlayWidgets,
|
|
43
|
+
o as getSuggestedSearchKeywords,
|
|
52
44
|
p as getSuggestedSearchKeywordsText,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Y as makePillLauncher,
|
|
45
|
+
T as getWindowPageContext,
|
|
46
|
+
ce as initGengageClient,
|
|
47
|
+
Y as initNativeOverlayWidgets,
|
|
48
|
+
q as initOverlayWidgets,
|
|
49
|
+
x as isVoiceInputSupported,
|
|
50
|
+
y as listen,
|
|
51
|
+
B as makePillLauncher,
|
|
61
52
|
l as mergeUISpecRegistry,
|
|
62
|
-
x as meteringIncrementEvent,
|
|
63
|
-
C as meteringSummaryEvent,
|
|
64
53
|
c as normalizeMiddlewareUrl,
|
|
65
|
-
|
|
54
|
+
i as normalizeProductGroupingsResponse,
|
|
66
55
|
a as normalizeSimilarProductsResponse,
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
le as parseAccountRuntimeConfig,
|
|
57
|
+
se as preflightDiagnostics,
|
|
69
58
|
m as productToNormalized,
|
|
70
|
-
|
|
59
|
+
W as registerGlobalErrorToastListener,
|
|
71
60
|
r as renderUISpecWithRegistry,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
L as streamChunkEvent,
|
|
78
|
-
h as streamDoneEvent,
|
|
79
|
-
E as streamErrorEvent,
|
|
61
|
+
A as resolveSession,
|
|
62
|
+
F as routeStreamAction,
|
|
63
|
+
ne as safeParseAccountRuntimeConfig,
|
|
64
|
+
f as sanitizeHtml,
|
|
65
|
+
P as showGlobalErrorToast,
|
|
80
66
|
s as streamPost,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
S as
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
z as wireSimilarToChat,
|
|
89
|
-
T as withBaseTheme,
|
|
90
|
-
N as withDefaultWidgetTheme
|
|
67
|
+
K as trackConnectionWarningRequest,
|
|
68
|
+
h as updatePageContext,
|
|
69
|
+
C as wireGADataLayer,
|
|
70
|
+
G as wireQNAToChat,
|
|
71
|
+
S as wireSimilarToChat,
|
|
72
|
+
v as withBaseTheme,
|
|
73
|
+
D as withDefaultWidgetTheme
|
|
91
74
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { j as S } from "./context-BBuSsXZ9.js";
|
|
2
|
+
import { i as I } from "./widget-base-Dliq3QAf.js";
|
|
3
3
|
function E(t, n) {
|
|
4
4
|
if (typeof window > "u" || !S(t)) return !1;
|
|
5
5
|
const r = new CustomEvent("gengage:navigate", {
|
package/dist/index.js
CHANGED
|
@@ -1,83 +1,80 @@
|
|
|
1
|
-
import { d as a, f as t, h as r, m as i, n as s, t as n } from "./api-paths-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { c as
|
|
5
|
-
import { i as w, n as N, o as
|
|
6
|
-
import { t as P } from "./connection-warning-
|
|
7
|
-
import { a as L, i as Q, n as B, r as F, t as
|
|
8
|
-
import { a as
|
|
9
|
-
import { n as j } from "./simrel-
|
|
10
|
-
import { n as J, t as X } from "./simbut-
|
|
11
|
-
import { i as $, n as ee, r as ae, t as te } from "./overlay-
|
|
12
|
-
import { a as ie, i as se, n as ne, r as oe } from "./native-webview-
|
|
13
|
-
import {
|
|
1
|
+
import { d as a, f as t, h as r, m as i, n as s, t as n } from "./api-paths-y5nkfEBG.js";
|
|
2
|
+
import { a as c, c as m, i as p, k as d, o as g, s as l, t as f } from "./context-BBuSsXZ9.js";
|
|
3
|
+
import { d as S, f as U, n as C, p as I, r as R, u as h } from "./widget-base-Dliq3QAf.js";
|
|
4
|
+
import { c as E, n as y, o as G, s as T, t as W } from "./runtime-DsP6go8z.js";
|
|
5
|
+
import { i as w, n as N, o as O, r as v } from "./fastIntent-1T2g9art.js";
|
|
6
|
+
import { t as P } from "./connection-warning-DJiyLM46.js";
|
|
7
|
+
import { a as L, i as Q, n as B, r as F, t as V } from "./runtime-BMNOS2Mq.js";
|
|
8
|
+
import { a as x, i as M, n as H, r as K, t as z } from "./runtime-DOS9yRRx.js";
|
|
9
|
+
import { n as j } from "./simrel-C07wZN8Q.js";
|
|
10
|
+
import { n as J, t as X } from "./simbut-BwxzoBcY.js";
|
|
11
|
+
import { i as $, n as ee, r as ae, t as te } from "./overlay-v3nvcGlE.js";
|
|
12
|
+
import { a as ie, i as se, n as ne, r as oe } from "./native-webview-y3a9R9hH.js";
|
|
13
|
+
import { a as me, c as pe, d as de, f as ge, h as le, i as fe, l as ue, m as Se, n as Ue, o as Ce, p as Ie, r as Re, s as he, t as Ae, u as Ee } from "./common-BKPSOoIP.js";
|
|
14
14
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
M as GengageQNA,
|
|
15
|
+
de as AccountRuntimeConfigSchema,
|
|
16
|
+
h as BASE_WIDGET_THEME,
|
|
17
|
+
Ce as DEFAULT_CUSTOMIZATION_LOCALE,
|
|
18
|
+
U as DEFAULT_WIDGET_THEME_TOKENS,
|
|
19
|
+
C as GENGAGE_BUILD_FLAVOR,
|
|
20
|
+
R as GENGAGE_VERSION,
|
|
21
|
+
W as GengageChat,
|
|
22
|
+
V as GengageQNA,
|
|
24
23
|
X as GengageSimBut,
|
|
25
24
|
z as GengageSimRel,
|
|
26
25
|
ge as UnknownActionPolicySchema,
|
|
27
|
-
|
|
26
|
+
v as VoiceInput,
|
|
28
27
|
ne as applyNativeSession,
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
Ae as autoDetectPageContext,
|
|
29
|
+
f as bootstrapSession,
|
|
31
30
|
n as buildChatEndpointUrl,
|
|
32
31
|
te as buildOverlayIdempotencyKey,
|
|
33
32
|
P as configureConnectionWarning,
|
|
34
33
|
a as consumeStream,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
de as createDefaultAnalyticsConfig,
|
|
40
|
-
D as createDefaultChatUISpecRegistry,
|
|
34
|
+
he as createAccountIdentity,
|
|
35
|
+
y as createChatWidget,
|
|
36
|
+
Ie as createDefaultAccountRuntimeConfig,
|
|
37
|
+
G as createDefaultChatUISpecRegistry,
|
|
41
38
|
F as createDefaultQnaUISpecRegistry,
|
|
42
39
|
K as createDefaultSimRelUISpecRegistry,
|
|
43
|
-
|
|
40
|
+
pe as createFloatingChatConfig,
|
|
44
41
|
oe as createNativeWebViewBridge,
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
ue as createPdpQnaConfig,
|
|
43
|
+
Ee as createPdpSimRelConfig,
|
|
47
44
|
B as createQNAWidget,
|
|
48
45
|
J as createSimButWidget,
|
|
49
46
|
j as createSimRelRenderer,
|
|
50
47
|
H as createSimRelWidget,
|
|
51
|
-
|
|
48
|
+
T as defaultChatUnknownUISpecRenderer,
|
|
52
49
|
Q as defaultQnaUnknownUISpecRenderer,
|
|
53
|
-
|
|
50
|
+
M as defaultSimRelUnknownUISpecRenderer,
|
|
54
51
|
i as defaultUnknownUISpecRenderer,
|
|
55
52
|
ee as destroyOverlayWidgets,
|
|
56
53
|
se as detectNativeEnvironment,
|
|
57
54
|
Ue as detectPageType,
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
c as dispatch,
|
|
56
|
+
Re as extractSkuFromUrl,
|
|
60
57
|
ae as getOverlayWidgets,
|
|
61
|
-
|
|
58
|
+
fe as initGengageClient,
|
|
62
59
|
ie as initNativeOverlayWidgets,
|
|
63
60
|
$ as initOverlayWidgets,
|
|
64
61
|
w as isVoiceInputSupported,
|
|
65
|
-
|
|
62
|
+
g as listen,
|
|
66
63
|
N as makePillLauncher,
|
|
67
64
|
s as normalizeMiddlewareUrl,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
Se as parseAccountRuntimeConfig,
|
|
66
|
+
me as preflightDiagnostics,
|
|
67
|
+
E as renderChatUISpec,
|
|
71
68
|
L as renderQnaUISpec,
|
|
72
|
-
|
|
69
|
+
x as renderSimRelUISpec,
|
|
73
70
|
r as renderUISpecWithRegistry,
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
O as routeStreamAction,
|
|
72
|
+
le as safeParseAccountRuntimeConfig,
|
|
76
73
|
t as streamPost,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
p as updatePageContext,
|
|
75
|
+
d as wireGADataLayer,
|
|
76
|
+
l as wireQNAToChat,
|
|
77
|
+
m as wireSimilarToChat,
|
|
78
|
+
S as withBaseTheme,
|
|
79
|
+
I as withDefaultWidgetTheme
|
|
83
80
|
};
|