@gengage/assistant-fe 0.4.19 → 0.4.21
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/api-paths-Bg6iwO5w.js +1250 -0
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +17 -17
- package/dist/chat.js +1 -1
- package/dist/{common-Bpp43wr0.js → common-DDJSeQhg.js} +2 -2
- package/dist/common.js +79 -77
- package/dist/{connection-warning-C7ehvQxx.js → connection-warning-BeD-B0Ec.js} +1 -1
- package/dist/{fastIntent-CINRmM8r.js → fastIntent-BeeDIwd2.js} +1 -1
- package/dist/index.js +75 -73
- package/dist/native.iife.js +18 -18
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.iife.js +22 -22
- package/dist/qna.js +1 -1
- package/dist/{runtime-B0hDHRlN.js → runtime-C8ZBidd2.js} +13 -13
- package/dist/{runtime-CLcYqzoA.js → runtime-CRSFPLku.js} +17 -17
- package/dist/{runtime-DhdfOJEN.js → runtime-Ct1qOl8V.js} +855 -848
- package/dist/{simbut-3kqLW3SM.js → simbut-BrAeZ6SH.js} +19 -22
- package/dist/simbut.iife.js +9 -9
- package/dist/simbut.js +1 -1
- package/dist/{simrel-fQg2EIB8.js → simrel-Cha5de6P.js} +1 -1
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +7 -7
- package/dist/simrel.js +2 -2
- package/dist/{widget-base-bdJaGJYi.js → widget-base-BtBl_PCR.js} +91 -83
- package/package.json +9 -5
- package/dist/api-paths-BX3Lea3A.js +0 -1213
- 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 -399
- 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/ga-datalayer.d.ts +0 -89
- package/dist/common/global-error-toast.d.ts +0 -6
- package/dist/common/index.d.ts +0 -49
- 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/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/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/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/qna.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { d as Q, h as N, p as H, r as O, t as U } from "./api-paths-Bg6iwO5w.js";
|
|
2
|
+
import { C as j, E as M, S as D, o as F, t as W, w as z } from "./widget-base-BtBl_PCR.js";
|
|
3
3
|
import { A as $, D as G, E as J, a as E, v as V } from "./context-DGz5F81j.js";
|
|
4
4
|
import { t as T } from "./locale-CfqNifrU.js";
|
|
5
|
-
import { n as Y } from "./connection-warning-
|
|
5
|
+
import { n as Y } from "./connection-warning-BeD-B0Ec.js";
|
|
6
6
|
async function Z(e, t, n) {
|
|
7
|
-
const o =
|
|
7
|
+
const o = U("launcher_action", t), i = {
|
|
8
8
|
uiSpecs: [],
|
|
9
9
|
actions: []
|
|
10
10
|
}, a = {
|
|
@@ -16,7 +16,7 @@ async function Z(e, t, n) {
|
|
|
16
16
|
const l = await fetch(o, a);
|
|
17
17
|
if (!l.ok) throw new Error(`HTTP ${l.status}: ${l.statusText}`);
|
|
18
18
|
const r = { onEvent: (c) => {
|
|
19
|
-
const s =
|
|
19
|
+
const s = O(c);
|
|
20
20
|
if (s && (s.type === "ui_spec" && i.uiSpecs.push(s.spec), s.type === "ui_spec" && s.spec.elements)) {
|
|
21
21
|
for (const d of Object.values(s.spec.elements)) if (d.type === "ActionButton" && d.props?.action) {
|
|
22
22
|
const b = d.props.action;
|
|
@@ -24,7 +24,7 @@ async function Z(e, t, n) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
} };
|
|
27
|
-
return n !== void 0 && (r.signal = n), await
|
|
27
|
+
return n !== void 0 && (r.signal = n), await Q(l, r), i;
|
|
28
28
|
}
|
|
29
29
|
function C(e) {
|
|
30
30
|
const t = document.createElement("div");
|
|
@@ -387,7 +387,7 @@ function ct(e) {
|
|
|
387
387
|
function dt(e) {
|
|
388
388
|
return ct(e) === "en" ? lt : R;
|
|
389
389
|
}
|
|
390
|
-
var ut = class extends
|
|
390
|
+
var ut = class extends W {
|
|
391
391
|
constructor(...e) {
|
|
392
392
|
super(...e), this._abortController = null, this._debounceTimer = null, this._contentEl = null, this._i18n = R, this._actionHandler = this._handleAction.bind(this), this._openChatHandler = this._handleOpenChat.bind(this);
|
|
393
393
|
}
|
|
@@ -440,7 +440,7 @@ var ut = class extends F {
|
|
|
440
440
|
source: "qna",
|
|
441
441
|
locale: this.config.locale
|
|
442
442
|
});
|
|
443
|
-
this.track(
|
|
443
|
+
this.track(z(this.analyticsContext(), {
|
|
444
444
|
endpoint: "launcher_action",
|
|
445
445
|
request_id: o,
|
|
446
446
|
widget: "qna"
|
|
@@ -457,12 +457,12 @@ var ut = class extends F {
|
|
|
457
457
|
const c = this.config.pageContext?.pageType;
|
|
458
458
|
c !== void 0 && (r.page_type = c);
|
|
459
459
|
const s = await Z(r, n, this._abortController.signal);
|
|
460
|
-
if (this.track(
|
|
460
|
+
if (this.track(D(this.analyticsContext(), {
|
|
461
461
|
request_id: o,
|
|
462
462
|
latency_ms: Date.now() - i,
|
|
463
463
|
chunk_count: s.actions.length,
|
|
464
464
|
widget: "qna"
|
|
465
|
-
})), this.track(
|
|
465
|
+
})), this.track(M(this.analyticsContext(), {
|
|
466
466
|
message_count: s.actions.length,
|
|
467
467
|
history_ref: o,
|
|
468
468
|
redaction_level: "none",
|
|
@@ -499,8 +499,8 @@ var ut = class extends F {
|
|
|
499
499
|
if (E("gengage:global:error", {
|
|
500
500
|
source: "qna",
|
|
501
501
|
code: "FETCH_ERROR",
|
|
502
|
-
message:
|
|
503
|
-
}), this.track(
|
|
502
|
+
message: F(this.config.locale, l)
|
|
503
|
+
}), this.track(j(this.analyticsContext(), {
|
|
504
504
|
request_id: o,
|
|
505
505
|
error_code: "FETCH_ERROR",
|
|
506
506
|
error_message: l instanceof Error ? l.message : String(l),
|
|
@@ -562,7 +562,7 @@ var ut = class extends F {
|
|
|
562
562
|
return r.children.length === 0 ? null : r;
|
|
563
563
|
}
|
|
564
564
|
_resolveUISpecRegistry() {
|
|
565
|
-
return
|
|
565
|
+
return H(X(), this.config.renderer?.registry);
|
|
566
566
|
}
|
|
567
567
|
_renderUISpec(e, t) {
|
|
568
568
|
const n = this._resolveUISpecRegistry(), o = this.config.renderer?.unknownRenderer ?? P, i = (l, r) => tt(l, r, n, o), a = this.config.renderer?.renderUISpec;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as D,
|
|
2
|
-
import {
|
|
1
|
+
import { a as D, d as N, h as j, i as F, p as H, r as R, t as U } from "./api-paths-Bg6iwO5w.js";
|
|
2
|
+
import { C as z, E as T, S as w, m as $, o as W, t as J, w as Q } from "./widget-base-BtBl_PCR.js";
|
|
3
3
|
import { A as Y, E as A, N as V, a as S, l as K, v as X } from "./context-DGz5F81j.js";
|
|
4
4
|
import { t as Z } from "./locale-CfqNifrU.js";
|
|
5
5
|
import { a as ee, n as te, r as re, t as P } from "./price-formatter-xI3g9Cd4.js";
|
|
6
|
-
import { n as ne } from "./connection-warning-
|
|
6
|
+
import { n as ne } from "./connection-warning-BeD-B0Ec.js";
|
|
7
7
|
function M(e) {
|
|
8
8
|
const t = [];
|
|
9
9
|
for (const r of Object.values(e)) if (r.type === "ProductCard" && r.props) {
|
|
@@ -18,13 +18,13 @@ function G(e) {
|
|
|
18
18
|
}
|
|
19
19
|
async function ie(e, t) {
|
|
20
20
|
const r = [], n = { onEvent: (i) => {
|
|
21
|
-
const s =
|
|
21
|
+
const s = R(i);
|
|
22
22
|
!s || s.type !== "ui_spec" || r.push(...M(s.spec.elements));
|
|
23
23
|
} };
|
|
24
|
-
return t !== void 0 && (n.signal = t), await
|
|
24
|
+
return t !== void 0 && (n.signal = t), await N(e, n), r;
|
|
25
25
|
}
|
|
26
26
|
async function se(e, t, r) {
|
|
27
|
-
const n =
|
|
27
|
+
const n = U("similar_products", t), i = {
|
|
28
28
|
method: "POST",
|
|
29
29
|
headers: { "Content-Type": "application/json" },
|
|
30
30
|
body: JSON.stringify(e)
|
|
@@ -45,7 +45,7 @@ async function oe(e, t) {
|
|
|
45
45
|
const r = [];
|
|
46
46
|
let n = null;
|
|
47
47
|
const i = { onEvent: (s) => {
|
|
48
|
-
const c =
|
|
48
|
+
const c = R(s);
|
|
49
49
|
if (c) {
|
|
50
50
|
if (c.type === "metadata" && c.meta) {
|
|
51
51
|
const d = c.meta.group_name;
|
|
@@ -61,10 +61,10 @@ async function oe(e, t) {
|
|
|
61
61
|
c.type === "ui_spec" && n && n.products.push(...M(c.spec.elements));
|
|
62
62
|
}
|
|
63
63
|
} };
|
|
64
|
-
return t !== void 0 && (i.signal = t), await
|
|
64
|
+
return t !== void 0 && (i.signal = t), await N(e, i), r;
|
|
65
65
|
}
|
|
66
66
|
async function ae(e, t, r) {
|
|
67
|
-
const n =
|
|
67
|
+
const n = U("product_groupings", t), i = {
|
|
68
68
|
method: "POST",
|
|
69
69
|
headers: { "Content-Type": "application/json" },
|
|
70
70
|
body: JSON.stringify(e)
|
|
@@ -384,7 +384,7 @@ function ge() {
|
|
|
384
384
|
return { ...O };
|
|
385
385
|
}
|
|
386
386
|
function ue(e, t, r = O, n = B) {
|
|
387
|
-
return
|
|
387
|
+
return j({
|
|
388
388
|
spec: e,
|
|
389
389
|
context: t,
|
|
390
390
|
registry: r,
|
|
@@ -515,7 +515,7 @@ var Ce = class extends J {
|
|
|
515
515
|
source: "simrel",
|
|
516
516
|
locale: this.config.locale
|
|
517
517
|
});
|
|
518
|
-
this.track(
|
|
518
|
+
this.track(Q(this.analyticsContext(), {
|
|
519
519
|
endpoint: "similar_products",
|
|
520
520
|
request_id: g,
|
|
521
521
|
widget: "simrel"
|
|
@@ -545,12 +545,12 @@ var Ce = class extends J {
|
|
|
545
545
|
})).filter((a) => a.products.length > 0);
|
|
546
546
|
if (o.length > 0 && this._contentEl) {
|
|
547
547
|
const a = this._buildGroupsSpec(o), u = this._renderUISpec(a);
|
|
548
|
-
this._contentEl.appendChild(u), A("simrel"), this.track(
|
|
548
|
+
this._contentEl.appendChild(u), A("simrel"), this.track(w(this.analyticsContext(), {
|
|
549
549
|
request_id: g,
|
|
550
550
|
latency_ms: Date.now() - l,
|
|
551
551
|
chunk_count: o.reduce((_, E) => _ + E.products.length, 0),
|
|
552
552
|
widget: "simrel"
|
|
553
|
-
})), this.track(
|
|
553
|
+
})), this.track(T(this.analyticsContext(), {
|
|
554
554
|
message_count: o.reduce((_, E) => _ + E.products.length, 0),
|
|
555
555
|
history_ref: g,
|
|
556
556
|
redaction_level: "none",
|
|
@@ -565,12 +565,12 @@ var Ce = class extends J {
|
|
|
565
565
|
const y = this._buildProductsSpec(p), b = this._renderUISpec(y);
|
|
566
566
|
this._contentEl.appendChild(b);
|
|
567
567
|
}
|
|
568
|
-
p.length > 0 && A("simrel"), this.track(
|
|
568
|
+
p.length > 0 && A("simrel"), this.track(w(this.analyticsContext(), {
|
|
569
569
|
request_id: g,
|
|
570
570
|
latency_ms: Date.now() - l,
|
|
571
571
|
chunk_count: p.length,
|
|
572
572
|
widget: "simrel"
|
|
573
|
-
})), this.track(
|
|
573
|
+
})), this.track(T(this.analyticsContext(), {
|
|
574
574
|
message_count: p.length,
|
|
575
575
|
history_ref: g,
|
|
576
576
|
redaction_level: "none",
|
|
@@ -584,7 +584,7 @@ var Ce = class extends J {
|
|
|
584
584
|
source: "simrel",
|
|
585
585
|
code: y,
|
|
586
586
|
message: W(this.config.locale, m)
|
|
587
|
-
}), this.track(
|
|
587
|
+
}), this.track(z(this.analyticsContext(), {
|
|
588
588
|
request_id: g,
|
|
589
589
|
error_code: y,
|
|
590
590
|
error_message: b,
|
|
@@ -615,7 +615,7 @@ var Ce = class extends J {
|
|
|
615
615
|
};
|
|
616
616
|
}
|
|
617
617
|
_resolveUISpecRegistry() {
|
|
618
|
-
return
|
|
618
|
+
return H(ge(), this.config.renderer?.registry);
|
|
619
619
|
}
|
|
620
620
|
_buildRenderContext() {
|
|
621
621
|
const e = this.config.renderCard, t = {
|