@gengage/assistant-fe 0.3.22 → 0.3.23
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/catalog.d.ts +11 -1
- package/dist/chat/components/ChatDrawer.d.ts +5 -0
- package/dist/chat/components/PhotoAnalysisCard.d.ts +14 -7
- package/dist/chat/types.d.ts +14 -1
- package/dist/chat-BOkLnT1i.cjs +93 -0
- package/dist/{chat-CHAi6Xej.js → chat-DBJ8ZWch.js} +1509 -1435
- package/dist/chat.cjs +1 -1
- package/dist/chat.iife.js +20 -20
- package/dist/chat.js +1 -1
- package/dist/{common-DXdLT4e0.cjs → common-0GWnpStO.cjs} +1 -1
- package/dist/{common-Ct6r0F2s.js → common-BJZB1LIH.js} +1 -1
- package/dist/common.cjs +1 -1
- package/dist/common.js +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/{native-webview-Cf5WtlIH.js → native-webview-111Or6o1.js} +1 -1
- package/dist/{native-webview-BaW1H_nZ.cjs → native-webview-BePZBK3U.cjs} +1 -1
- package/dist/native.cjs +1 -1
- package/dist/native.iife.js +10 -10
- package/dist/native.js +1 -1
- package/package.json +1 -1
- package/dist/chat-BF5pt6iX.cjs +0 -93
package/dist/chat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, c as t, d as r, f as s, n, o as C, p as c, r as h, s as l, t as o } from "./chat-
|
|
1
|
+
import { a as e, c as t, d as r, f as s, n, o as C, p as c, r as h, s as l, t as o } from "./chat-DBJ8ZWch.js";
|
|
2
2
|
export {
|
|
3
3
|
r as CHAT_SCROLL_ELEMENT_ID,
|
|
4
4
|
e as ChatPresentationState,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const y=require("./schemas-B7jnyzQI.cjs"),l=require("./native-webview-
|
|
1
|
+
const y=require("./schemas-B7jnyzQI.cjs"),l=require("./native-webview-BePZBK3U.cjs");var p={enabled:!0,endpoint:"/analytics",fireAndForget:!0,useBeacon:!0,keepaliveFetch:!0,timeoutMs:4e3,maxRetries:0,batchSize:10,flushIntervalMs:250},b={mode:"none",key:"",headerName:"X-API-Key",bodyField:"api_key"},f=class{constructor(e){this.queue=[],this.flushTimer=null,this.config={...p,...e,auth:{...b,...e.auth??{}}},this.onPageHideBound=()=>{this.queue.length!==0&&this.flushAllSync()},typeof window<"u"&&window.addEventListener("pagehide",this.onPageHideBound)}track(e){if(!this.config.enabled)return;const t=w(e);if(this.queue.push(t),this.queue.length>=this.config.batchSize){this.scheduleImmediateFlush();return}this.scheduleFlush()}flush(){if(!this.config.enabled||this.queue.length===0)return;const e=this.queue.splice(0,this.config.batchSize),t=this.buildTransportBody(e),r=c(this.config.endpoint,this.config.middlewareUrl);this.send(r,t)}flushAll(){for(;this.queue.length>0;)this.flush()}destroy(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.queue.length>0&&this.flushAllSync(),typeof window<"u"&&window.removeEventListener("pagehide",this.onPageHideBound)}scheduleFlush(){this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flushTimer=null,this.flush()},this.config.flushIntervalMs))}scheduleImmediateFlush(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.flush()}buildTransportBody(e){const t={events:e};return this.config.auth.mode==="body-api-key"&&this.config.auth.key&&(t[this.config.auth.bodyField]=this.config.auth.key),t}send(e,t){try{const r=JSON.stringify(t);if(this.config.useBeacon&&this.config.auth.mode!=="x-api-key-header"&&this.config.auth.mode!=="bearer-header"&&d()){const o=new Blob([r],{type:"application/json"});navigator.sendBeacon(e,o);return}if(typeof fetch>"u")return;const n={"Content-Type":"application/json"};this.config.auth.mode==="x-api-key-header"&&this.config.auth.key&&(n[this.config.auth.headerName]=this.config.auth.key),this.config.auth.mode==="bearer-header"&&this.config.auth.key&&(n.Authorization=`Bearer ${this.config.auth.key}`),fetch(e,{method:"POST",headers:n,body:r,keepalive:!0}).catch(()=>{})}catch{}}flushAllSync(){if(!this.config.enabled)return;const e=c(this.config.endpoint,this.config.middlewareUrl);for(;this.queue.length>0;){const t=this.queue.splice(0,this.config.batchSize),r=this.buildTransportBody(t);try{const n=JSON.stringify(r);if(d()){const o=new Blob([n],{type:"application/json"});navigator.sendBeacon(e,o)}}catch{}}}};function v(e){return new f(e)}function w(e){const t={event_name:e.event_name,event_version:e.event_version??"1",timestamp_ms:e.timestamp_ms??Date.now(),account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:e.payload};return e.view_id!==void 0&&(t.view_id=e.view_id),e.user_id!==void 0&&(t.user_id=e.user_id),e.widget!==void 0&&(t.widget=e.widget),e.page_type!==void 0&&(t.page_type=e.page_type),e.sku!==void 0&&(t.sku=e.sku),t}function c(e,t){return/^https?:\/\//i.test(e)?e:`${y.normalizeMiddlewareUrl(t)}${e.startsWith("/")?e:`/${e}`}`}function d(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}var T="tr";function C(e){return{ACCOUNT_ID:e.accountId,MIDDLEWARE_URL:e.middlewareUrl,LOCALE:e.locale??"tr"}}function P(e,t={}){const r={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},variant:"floating",locale:e.locale??"tr",...t};return e.theme!==void 0&&(r.theme=e.theme),r}function _(e,t={}){const r={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},pageContext:{pageType:"pdp",sku:e.sku},mountTarget:e.mountTarget,...t};return e.theme!==void 0&&(r.theme=e.theme),r}function k(e,t={}){const r={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},sku:e.sku,mountTarget:e.mountTarget,...t};return e.theme!==void 0&&(r.theme=e.theme),r}function I(e,t={}){return{enabled:!0,middlewareUrl:e,endpoint:"/analytics",fireAndForget:!0,useBeacon:!0,...t}}function S(e){try{return document.querySelector(e),!0}catch{return!1}}function h(e,t){const r=[],n=e.mounts,o=[["qna",n.qna],["simrel",n.simrel],["simbut",n.simbut],["chat",n.chat]];for(const[i,s]of o)if(s!==void 0){if(!S(s)){r.push({code:"INVALID_SELECTOR",message:`[gengage preflight] ${i} mount selector is invalid CSS: "${s}"`,severity:"error"});continue}document.querySelector(s)||r.push({code:"MOUNT_NOT_FOUND",message:`[gengage preflight] ${i} mount target not found: "${s}" — widget will skip or wait for DOM`,severity:"warn"})}if(e.widgets.simbut.enabled&&n.simbut===void 0){const i="#gengage-simbut";document.querySelector(i)||r.push({code:"SIMBUT_MOUNT_REQUIRED",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 "${i}" was not found in the DOM.`,severity:"error"})}const a=e.gtm.idempotencyKey;if(window[a]!==void 0&&r.push({code:"DUPLICATE_IDEMPOTENCY",message:`[gengage preflight] window["${a}"] already exists — widgets may have already initialized`,severity:"warn"}),!t?.skipCspCheck){let i=!1;const s=u=>{u.blockedURI&&e.middlewareUrl.startsWith(u.blockedURI)&&(i=!0)};document.addEventListener("securitypolicyviolation",s);try{fetch(e.middlewareUrl,{method:"HEAD",mode:"no-cors"}).catch(()=>{})}catch{i=!0}document.removeEventListener("securitypolicyviolation",s),i&&r.push({code:"CSP_BLOCKED",message:`[gengage preflight] middleware URL may be blocked by Content-Security-Policy: "${e.middlewareUrl}". Add it to connect-src.`,severity:"warn"})}for(const i of r)i.severity==="error"?console.error(i.message):console.warn(i.message);return{ok:r.every(i=>i.severity!=="error"),warnings:r}}function U(e){const t=l.safeParseAccountRuntimeConfig(e);if(!t.success){const r=t.error.issues.map(n=>`${n.path.join(".")}: ${n.message}`).join("; ");throw new Error(`[gengage] Invalid runtime config: ${r}`)}return t.data}function O(e,t,r){const n={accountId:e.accountId,middlewareUrl:e.middlewareUrl,idempotencyKey:e.gtm.idempotencyKey};return e.locale!==void 0&&(n.locale=e.locale),r!==void 0&&(n.pageContext=r,r.sku!==void 0&&(n.sku=r.sku)),n.chat={enabled:e.widgets.chat.enabled},e.mounts.chat!==void 0&&(n.chat.mountTarget=e.mounts.chat),n.qna={enabled:e.widgets.qna.enabled},e.mounts.qna!==void 0&&(n.qna.mountTarget=e.mounts.qna),n.simrel={enabled:e.widgets.simrel.enabled},e.mounts.simrel!==void 0&&(n.simrel.mountTarget=e.mounts.simrel),n.simbut={enabled:e.widgets.simbut.enabled},e.mounts.simbut!==void 0&&(n.simbut.mountTarget=e.mounts.simbut),t?.onAddToCart!==void 0&&(n.onAddToCart=t.onAddToCart),t?.onProductNavigate!==void 0&&(n.onProductNavigate=t.onProductNavigate),t?.onFindSimilar!==void 0&&(n.simbut.onFindSimilar=t.onFindSimilar),t?.onScriptCall!==void 0&&(n.onScriptCall=t.onScriptCall),n}async function A(e){const t=U(e.runtimeConfig);if(e.preflight!==!1){const o=h(t);if(!o.ok){const a=o.warnings.filter(i=>i.severity==="error");throw new Error(`[gengage] Preflight failed: ${a.map(i=>i.message).join("; ")}`)}}const r=e.contextResolver?.(),n=await l.initOverlayWidgets(O(t,e.hostActions,r));if(e.contextResolver!==void 0){const o=e.contextResolver,a=()=>{const s=o();n.updateContext(s)};window.addEventListener("gengage:context:update",a);const i=n.destroy.bind(n);n.destroy=()=>{window.removeEventListener("gengage:context:update",a),i()}}return n}var E=[{pageType:"home",urlPatterns:["^/$","^/index\\.html?$","^/anasayfa$"]},{pageType:"search",urlPatterns:["/arama","/search","/ara\\?"],queryParam:"q"},{pageType:"cart",urlPatterns:["/sepet","/cart","/basket","/sepetim"]},{pageType:"plp",urlPatterns:["/kategori/","/category/","/c/","/koleksiyon/","/collection/"]},{pageType:"pdp",urlPatterns:["/urun/","/product/","/p/","/-p-","/-pm-"]}];function m(e,t){const r=t??(typeof window<"u"?new URL(window.location.href):null);if(!r)return"other";const n=e??E,o=r.pathname;for(const a of n)if(!(a.urlPatterns&&!a.urlPatterns.some(i=>{try{return new RegExp(i,"i").test(o)}catch{return!1}}))&&!(a.queryParam&&!r.searchParams.has(a.queryParam))&&!(a.selector&&typeof document<"u"&&!document.querySelector(a.selector)))return a.pageType;return"other"}function g(e){const t=e??(typeof window<"u"?new URL(window.location.href):null);if(!t)return;const r=t.pathname,n=r.match(/\/(?:p|urun|product)\/([^/?#]+)/i);if(n?.[1])return n[1];const o=r.match(/-p-(\d+)/i);if(o?.[1])return o[1]}function q(e){const t=m(e),r={pageType:t};if(t==="pdp"){const n=g();n&&(r.sku=n)}return typeof window<"u"&&(r.url=window.location.href),r}Object.defineProperty(exports,"AnalyticsClient",{enumerable:!0,get:function(){return f}});Object.defineProperty(exports,"DEFAULT_CUSTOMIZATION_LOCALE",{enumerable:!0,get:function(){return T}});Object.defineProperty(exports,"autoDetectPageContext",{enumerable:!0,get:function(){return q}});Object.defineProperty(exports,"createAccountIdentity",{enumerable:!0,get:function(){return C}});Object.defineProperty(exports,"createAnalyticsClient",{enumerable:!0,get:function(){return v}});Object.defineProperty(exports,"createDefaultAnalyticsConfig",{enumerable:!0,get:function(){return I}});Object.defineProperty(exports,"createFloatingChatConfig",{enumerable:!0,get:function(){return P}});Object.defineProperty(exports,"createPdpQnaConfig",{enumerable:!0,get:function(){return _}});Object.defineProperty(exports,"createPdpSimRelConfig",{enumerable:!0,get:function(){return k}});Object.defineProperty(exports,"detectPageType",{enumerable:!0,get:function(){return m}});Object.defineProperty(exports,"extractSkuFromUrl",{enumerable:!0,get:function(){return g}});Object.defineProperty(exports,"initGengageClient",{enumerable:!0,get:function(){return A}});Object.defineProperty(exports,"preflightDiagnostics",{enumerable:!0,get:function(){return h}});
|
package/dist/common.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./schemas-B7jnyzQI.cjs"),e=require("./ga-datalayer-BVppFxqk.cjs"),i=require("./chat-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./schemas-B7jnyzQI.cjs"),e=require("./ga-datalayer-BVppFxqk.cjs"),i=require("./chat-BOkLnT1i.cjs"),a=require("./connection-warning-YQiIRXrz.cjs"),t=require("./native-webview-BePZBK3U.cjs"),r=require("./common-0GWnpStO.cjs");exports.AccountRuntimeConfigSchema=t.AccountRuntimeConfigSchema;exports.AnalyticsAuthModeSchema=t.AnalyticsAuthModeSchema;exports.AnalyticsClient=r.AnalyticsClient;exports.BASE_WIDGET_THEME=e.BASE_WIDGET_THEME;exports.BaseWidget=e.BaseWidget;exports.DEFAULT_CUSTOMIZATION_LOCALE=r.DEFAULT_CUSTOMIZATION_LOCALE;exports.DEFAULT_WIDGET_THEME_TOKENS=e.DEFAULT_WIDGET_THEME_TOKENS;exports.UnknownActionPolicySchema=t.UnknownActionPolicySchema;exports.VoiceInput=i.VoiceInput;exports.adaptBackendEvent=n.adaptBackendEvent;exports.applyNativeSession=t.applyNativeSession;exports.autoDetectPageContext=r.autoDetectPageContext;exports.basketAddEvent=e.basketAddEvent;exports.bootstrapSession=e.bootstrapSession;exports.buildChatEndpointUrl=n.buildChatEndpointUrl;exports.buildOverlayIdempotencyKey=t.buildOverlayIdempotencyKey;exports.chatHistorySnapshotEvent=e.chatHistorySnapshotEvent;exports.checkoutCompleteEvent=e.checkoutCompleteEvent;exports.checkoutStartEvent=e.checkoutStartEvent;exports.configureConnectionWarning=a.configureConnectionWarning;exports.consumeStream=n.consumeStream;exports.createAccountIdentity=r.createAccountIdentity;exports.createAnalyticsClient=r.createAnalyticsClient;exports.createDefaultAccountRuntimeConfig=t.createDefaultAccountRuntimeConfig;exports.createDefaultAnalyticsConfig=r.createDefaultAnalyticsConfig;exports.createFloatingChatConfig=r.createFloatingChatConfig;exports.createNativeWebViewBridge=t.createNativeWebViewBridge;exports.createPdpQnaConfig=r.createPdpQnaConfig;exports.createPdpSimRelConfig=r.createPdpSimRelConfig;exports.defaultUnknownUISpecRenderer=n.defaultUnknownUISpecRenderer;exports.destroyOverlayWidgets=t.destroyOverlayWidgets;exports.detectNativeEnvironment=t.detectNativeEnvironment;exports.detectPageType=r.detectPageType;exports.dismissGlobalErrorToast=e.dismissGlobalErrorToast;exports.dispatch=e.dispatch;exports.extractSkuFromUrl=r.extractSkuFromUrl;exports.getGlobalErrorMessage=e.getGlobalErrorMessage;exports.getOverlayWidgets=t.getOverlayWidgets;exports.getSuggestedSearchKeywords=n.getSuggestedSearchKeywords;exports.getSuggestedSearchKeywordsText=n.getSuggestedSearchKeywordsText;exports.getWindowPageContext=e.getWindowPageContext;exports.initGengageClient=r.initGengageClient;exports.initNativeOverlayWidgets=t.initNativeOverlayWidgets;exports.initOverlayWidgets=t.initOverlayWidgets;exports.isVoiceInputSupported=i.isVoiceInputSupported;exports.listen=e.listen;exports.llmUsageEvent=e.llmUsageEvent;exports.makePillLauncher=i.makePillLauncher;exports.mergeUISpecRegistry=n.mergeUISpecRegistry;exports.meteringIncrementEvent=e.meteringIncrementEvent;exports.meteringSummaryEvent=e.meteringSummaryEvent;exports.normalizeMiddlewareUrl=n.normalizeMiddlewareUrl;exports.normalizeProductGroupingsResponse=n.normalizeProductGroupingsResponse;exports.normalizeSimilarProductsResponse=n.normalizeSimilarProductsResponse;exports.parseAccountRuntimeConfig=t.parseAccountRuntimeConfig;exports.preflightDiagnostics=r.preflightDiagnostics;exports.productToNormalized=n.productToNormalized;exports.registerGlobalErrorToastListener=e.registerGlobalErrorToastListener;exports.renderUISpecWithRegistry=n.renderUISpecWithRegistry;exports.resolveSession=e.resolveSession;exports.routeStreamAction=i.routeStreamAction;exports.safeParseAccountRuntimeConfig=t.safeParseAccountRuntimeConfig;exports.sanitizeHtml=e.sanitizeHtml;exports.showGlobalErrorToast=e.showGlobalErrorToast;exports.streamChunkEvent=e.streamChunkEvent;exports.streamDoneEvent=e.streamDoneEvent;exports.streamErrorEvent=e.streamErrorEvent;exports.streamPost=n.streamPost;exports.streamStartEvent=e.streamStartEvent;exports.streamUiSpecEvent=e.streamUiSpecEvent;exports.trackConnectionWarningRequest=a.trackConnectionWarningRequest;exports.updatePageContext=e.updatePageContext;exports.widgetHistorySnapshotEvent=e.widgetHistorySnapshotEvent;exports.wireGADataLayer=e.wireGADataLayer;exports.wireQNAToChat=e.wireQNAToChat;exports.wireSimilarToChat=e.wireSimilarToChat;exports.withBaseTheme=e.withBaseTheme;exports.withDefaultWidgetTheme=e.withDefaultWidgetTheme;
|
package/dist/common.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { C as a, S as t, b as s, d as r, f as n, g as i, h as o, m as c, p as m, v as l, w as g, x as d, y as u } from "./schemas-CTbgsvNJ.js";
|
|
2
2
|
import { $ as E, A as S, D as h, E as v, F as y, G as C, H as f, I as A, J as T, K as w, L as U, M as W, N as I, O as P, P as D, Q as k, S as R, T as b, U as G, V as O, W as N, X as x, Y as L, Z as M, et as _, j as H, k as z, q as B, v as F, w as K, x as V, y as Q } from "./ga-datalayer-BwxWX-cr.js";
|
|
3
|
-
import { i as Z, l as j, m as J, u as X } from "./chat-
|
|
3
|
+
import { i as Z, l as j, m as J, u as X } from "./chat-DBJ8ZWch.js";
|
|
4
4
|
import { n as $, t as ee } from "./connection-warning-CHHi3BAf.js";
|
|
5
|
-
import { a as te, c as se, d as re, f as ne, h as ie, i as oe, l as ce, m as me, n as le, o as ge, p as de, r as ue, s as pe, u as Ee } from "./native-webview-
|
|
6
|
-
import { a as he, c as ve, d as ye, f as Ce, i as fe, l as Ae, n as Te, o as we, p as Ue, r as We, s as Ie, t as Pe, u as De } from "./common-
|
|
5
|
+
import { a as te, c as se, d as re, f as ne, h as ie, i as oe, l as ce, m as me, n as le, o as ge, p as de, r as ue, s as pe, u as Ee } from "./native-webview-111Or6o1.js";
|
|
6
|
+
import { a as he, c as ve, d as ye, f as Ce, i as fe, l as Ae, n as Te, o as we, p as Ue, r as We, s as Ie, t as Pe, u as De } from "./common-BJZB1LIH.js";
|
|
7
7
|
export {
|
|
8
8
|
Ee as AccountRuntimeConfigSchema,
|
|
9
9
|
re as AnalyticsAuthModeSchema,
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./schemas-B7jnyzQI.cjs"),i=require("./ga-datalayer-BVppFxqk.cjs"),n=require("./chat-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./schemas-B7jnyzQI.cjs"),i=require("./ga-datalayer-BVppFxqk.cjs"),n=require("./chat-BOkLnT1i.cjs"),u=require("./connection-warning-YQiIRXrz.cjs"),r=require("./qna-DwG8AJJf.cjs"),c=require("./simrel-DdP4lur9.cjs"),o=require("./simbut-D_ycY_MQ.cjs"),e=require("./native-webview-BePZBK3U.cjs"),t=require("./common-0GWnpStO.cjs");exports.AccountRuntimeConfigSchema=e.AccountRuntimeConfigSchema;exports.AnalyticsAuthModeSchema=e.AnalyticsAuthModeSchema;exports.BASE_WIDGET_THEME=i.BASE_WIDGET_THEME;exports.DEFAULT_CUSTOMIZATION_LOCALE=t.DEFAULT_CUSTOMIZATION_LOCALE;exports.DEFAULT_WIDGET_THEME_TOKENS=i.DEFAULT_WIDGET_THEME_TOKENS;exports.GengageChat=n.GengageChat;exports.GengageQNA=r.GengageQNA;exports.GengageSimBut=o.GengageSimBut;exports.GengageSimRel=c.GengageSimRel;exports.UnknownActionPolicySchema=e.UnknownActionPolicySchema;exports.VoiceInput=n.VoiceInput;exports.applyNativeSession=e.applyNativeSession;exports.autoDetectPageContext=t.autoDetectPageContext;exports.bootstrapSession=i.bootstrapSession;exports.buildChatEndpointUrl=a.buildChatEndpointUrl;exports.buildOverlayIdempotencyKey=e.buildOverlayIdempotencyKey;exports.configureConnectionWarning=u.configureConnectionWarning;exports.consumeStream=a.consumeStream;exports.createAccountIdentity=t.createAccountIdentity;exports.createAnalyticsClient=t.createAnalyticsClient;exports.createChatWidget=n.createChatWidget;exports.createDefaultAccountRuntimeConfig=e.createDefaultAccountRuntimeConfig;exports.createDefaultAnalyticsConfig=t.createDefaultAnalyticsConfig;exports.createDefaultChatUISpecRegistry=n.createDefaultChatUISpecRegistry;exports.createDefaultQnaUISpecRegistry=r.createDefaultQnaUISpecRegistry;exports.createDefaultSimRelUISpecRegistry=c.createDefaultSimRelUISpecRegistry;exports.createFloatingChatConfig=t.createFloatingChatConfig;exports.createNativeWebViewBridge=e.createNativeWebViewBridge;exports.createPdpQnaConfig=t.createPdpQnaConfig;exports.createPdpSimRelConfig=t.createPdpSimRelConfig;exports.createQNAWidget=r.createQNAWidget;exports.createSimButWidget=o.createSimButWidget;exports.createSimRelWidget=c.createSimRelWidget;exports.defaultChatUnknownUISpecRenderer=n.defaultChatUnknownUISpecRenderer;exports.defaultQnaUnknownUISpecRenderer=r.defaultQnaUnknownUISpecRenderer;exports.defaultSimRelUnknownUISpecRenderer=c.defaultSimRelUnknownUISpecRenderer;exports.defaultUnknownUISpecRenderer=a.defaultUnknownUISpecRenderer;exports.destroyOverlayWidgets=e.destroyOverlayWidgets;exports.detectNativeEnvironment=e.detectNativeEnvironment;exports.detectPageType=t.detectPageType;exports.dispatch=i.dispatch;exports.extractSkuFromUrl=t.extractSkuFromUrl;exports.getOverlayWidgets=e.getOverlayWidgets;exports.initGengageClient=t.initGengageClient;exports.initNativeOverlayWidgets=e.initNativeOverlayWidgets;exports.initOverlayWidgets=e.initOverlayWidgets;exports.isVoiceInputSupported=n.isVoiceInputSupported;exports.listen=i.listen;exports.makePillLauncher=n.makePillLauncher;exports.normalizeMiddlewareUrl=a.normalizeMiddlewareUrl;exports.parseAccountRuntimeConfig=e.parseAccountRuntimeConfig;exports.preflightDiagnostics=t.preflightDiagnostics;exports.renderChatUISpec=n.renderUISpec;exports.renderQnaUISpec=r.renderQnaUISpec;exports.renderSimRelUISpec=c.renderSimRelUISpec;exports.renderUISpecWithRegistry=a.renderUISpecWithRegistry;exports.routeStreamAction=n.routeStreamAction;exports.safeParseAccountRuntimeConfig=e.safeParseAccountRuntimeConfig;exports.streamPost=a.streamPost;exports.updatePageContext=i.updatePageContext;exports.wireGADataLayer=i.wireGADataLayer;exports.wireQNAToChat=i.wireQNAToChat;exports.wireSimilarToChat=i.wireSimilarToChat;exports.withBaseTheme=i.withBaseTheme;exports.withDefaultWidgetTheme=i.withDefaultWidgetTheme;
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { C as a, b as t, d as s, f as i, w as n, x as r } from "./schemas-CTbgsvNJ.js";
|
|
2
2
|
import { A as c, D as m, E as l, F as d, I as g, L as p, N as u, O as S, P as f, k as C, v as U } from "./ga-datalayer-BwxWX-cr.js";
|
|
3
|
-
import { c as A, i as I, l as y, m as R, n as D, o as E, s as T, t as W, u as w } from "./chat-
|
|
3
|
+
import { c as A, i as I, l as y, m as R, n as D, o as E, s as T, t as W, u as w } from "./chat-DBJ8ZWch.js";
|
|
4
4
|
import { t as N } from "./connection-warning-CHHi3BAf.js";
|
|
5
5
|
import { a as P, i as k, n as G, o as L, t as Q } from "./qna-DXCQtwLq.js";
|
|
6
6
|
import { a as b, i as x, n as B, o as F, t as M } from "./simrel-DP2EMyua.js";
|
|
7
7
|
import { n as H, t as K } from "./simbut-BBXTlzOg.js";
|
|
8
|
-
import { a as Z, c as j, d as q, f as J, h as X, i as Y, l as $, m as ee, n as ae, o as te, p as se, r as ie, s as ne, u as re } from "./native-webview-
|
|
9
|
-
import { a as ce, c as me, d as le, i as de, l as ge, n as pe, o as ue, p as Se, r as fe, s as Ce, t as Ue, u as he } from "./common-
|
|
8
|
+
import { a as Z, c as j, d as q, f as J, h as X, i as Y, l as $, m as ee, n as ae, o as te, p as se, r as ie, s as ne, u as re } from "./native-webview-111Or6o1.js";
|
|
9
|
+
import { a as ce, c as me, d as le, i as de, l as ge, n as pe, o as ue, p as Se, r as fe, s as Ce, t as Ue, u as he } from "./common-BJZB1LIH.js";
|
|
10
10
|
export {
|
|
11
11
|
re as AccountRuntimeConfigSchema,
|
|
12
12
|
q as AnalyticsAuthModeSchema,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as M, c as h, i as D, o as f, r as m, t as x } from "./schemas-CTbgsvNJ.js";
|
|
2
2
|
import { I as H, M as Q, b as k, z as K } from "./ga-datalayer-BwxWX-cr.js";
|
|
3
|
-
import { t as V } from "./chat-
|
|
3
|
+
import { t as V } from "./chat-DBJ8ZWch.js";
|
|
4
4
|
import { t as j } from "./qna-DXCQtwLq.js";
|
|
5
5
|
import { t as $ } from "./simrel-DP2EMyua.js";
|
|
6
6
|
import { t as G } from "./simbut-BBXTlzOg.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a=require("./schemas-B7jnyzQI.cjs"),m=require("./ga-datalayer-BVppFxqk.cjs"),K=require("./chat-BF5pt6iX.cjs"),$=require("./qna-DwG8AJJf.cjs"),G=require("./simrel-DdP4lur9.cjs"),Y=require("./simbut-D_ycY_MQ.cjs");var b=a.object({enabled:a.boolean().default(!0)}),J=a.object({chat:a.string().optional(),qna:a.string().optional(),simrel:a.string().optional(),simbut:a.string().optional()}),X=a.object({}),k=a._enum(["none","x-api-key-header","bearer-header","body-api-key"]),z=a.object({mode:k.default("none"),key:a.string().optional(),headerName:a.string().optional(),bodyField:a.string().default("api_key")}),Z=a.object({enabled:a.boolean().default(!0),endpoint:a.string().default("/analytics"),auth:z.default({mode:"none",bodyField:"api_key"}),fireAndForget:a.boolean().default(!0),useBeacon:a.boolean().default(!0),keepaliveFetch:a.boolean().default(!0),timeoutMs:a.number().int().positive().default(4e3),maxRetries:a.number().int().min(0).max(5).default(1)}),U="__gengageWidgetsInit",ee=a.object({idempotencyKey:a.string().default(U),requireDomReady:a.boolean().default(!0)}),O=a._enum(["log-and-ignore","throw","delegate"]),te=a.object({unknownActionPolicy:O.default("log-and-ignore"),allowScriptCall:a.boolean().default(!1)}),N=a.object({version:a.literal("1",{error:'version must be "1"'}),accountId:a.string({error:"accountId must be a non-empty string"}).min(1,{error:"accountId must be a non-empty string"}),middlewareUrl:a.string({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")'}),locale:a.string().optional(),widgets:a.object({chat:b.default({enabled:!0}),qna:b.default({enabled:!0}),simrel:b.default({enabled:!0}),simbut:b.default({enabled:!1})}),mounts:J.default({}),transport:X.default({}),analytics:Z.default({enabled:!0,endpoint:"/analytics",auth:{mode:"none",bodyField:"api_key"},fireAndForget:!0,useBeacon:!0,keepaliveFetch:!0,timeoutMs:4e3,maxRetries:1}),gtm:ee.default({idempotencyKey:"__gengageWidgetsInit",requireDomReady:!0}),actionHandling:te.default({unknownActionPolicy:"log-and-ignore",allowScriptCall:!1})});function P(e){m.debugLog("config","parsing account runtime config",e);const t=N.parse(e);return m.debugLog("config","config resolved",{accountId:t.accountId,middlewareUrl:t.middlewareUrl}),t}function ie(e){return N.safeParse(e)}function ne(e){return P({version:"1",accountId:e.accountId,middlewareUrl:e.middlewareUrl,locale:e.locale,widgets:{chat:{enabled:!0},qna:{enabled:!0},simrel:{enabled:!0},simbut:{enabled:!1}}})}var x=`${U}_overlay_`,se="#gengage-qna",oe="#gengage-simrel",ae="#gengage-simbut";function q(){const e=window;return e.__gengageOverlayRegistry||(e.__gengageOverlayRegistry={instances:{},pending:{}}),e.__gengageOverlayRegistry}function re(e){const t={pageType:e.pageContext?.pageType??(e.sku!==void 0?"pdp":"other")},i=e.pageContext;return i?.sku!==void 0&&(t.sku=i.sku),i?.price!==void 0&&(t.price=i.price),i?.categoryTree!==void 0&&(t.categoryTree=i.categoryTree),i?.url!==void 0&&(t.url=i.url),i?.extra!==void 0&&(t.extra=i.extra),e.sku!==void 0&&(t.sku=e.sku),t}function de(e,t){const i={...e,...t,pageType:t.pageType??e.pageType};return t.sku===void 0&&e.sku!==void 0&&(i.sku=e.sku),i}function T(e){return e instanceof HTMLElement||document.querySelector(e)?e:null}function R(e){return e.idempotencyKey??`${x}${e.accountId}`}var ue=class{constructor(e,t){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=R(e),this.session=m.resolveSession(e.session),this._pageContext=re(e)}get chat(){return this._chat}get qna(){return this._qna}get simrel(){return this._simrel}get simbut(){return this._simbut}get analyticsClient(){return this._analyticsClient}async init(){window.gengage||(window.gengage={}),window.gengage.sessionId=this.session.sessionId,window.gengage.pageContext=this._pageContext,await this._initChat(),this.options.wireQnaToChat!==!1&&(this._offQnaWire=m.wireQNAToChat()),await this._syncPdpWidgets(),window.gengage.overlay=this}openChat(e){this._chat?.open(e)}closeChat(){this._chat?.close()}async updateContext(e){this._destroyed||await this._enqueue(async()=>{this._pageContext=de(this._pageContext,e),window.gengage||(window.gengage={}),window.gengage.pageContext=this._pageContext,this._chat?.update(e),this._qna?.update(e),this._simrel?.update(e),this._simbut?.update(e),await this._syncPdpWidgets()})}async updateSku(e,t="pdp"){await this.updateContext({sku:e,pageType:t})}destroy(){this._destroyed||(this._destroyed=!0,this._offQnaWire?.(),this._offQnaWire=null,this._chat?.destroy(),this._qna?.destroy(),this._simrel?.destroy(),this._simbut?.destroy(),this._chat=null,this._qna=null,this._simrel=null,this._simbut=null,window.gengage?.overlay===this&&delete window.gengage.overlay,this.onDestroy())}async _initChat(){if(this.options.chat?.enabled===!1)return;const e=this.options.middlewareUrl,t=this.options.chat?.productDetailsExtended??this.options.productDetailsExtended,i=this.options.chat?.isDemoWebsite??this.options.isDemoWebsite,s={accountId:this.options.accountId,middlewareUrl:e,session:this.session,pageContext:this._pageContext,variant:this.options.chat?.variant??"floating"};this.options.theme!==void 0&&(s.theme=this.options.theme),this.options.locale!==void 0&&(s.locale=this.options.locale),this.options.pricing!==void 0&&(s.pricing=this.options.pricing),this.options.chat?.mountTarget!==void 0&&(s.mountTarget=this.options.chat.mountTarget),this.options.chat?.pillLauncher!==void 0&&(s.pillLauncher=this.options.chat.pillLauncher),this.options.chat?.launcherImageUrl!==void 0?s.launcherImageUrl=this.options.chat.launcherImageUrl:this.options.chat?.launcherSvg!==void 0&&(s.launcherSvg=this.options.chat.launcherSvg),this.options.chat?.headerTitle!==void 0&&(s.headerTitle=this.options.chat.headerTitle),this.options.chat?.headerAvatarUrl!==void 0&&(s.headerAvatarUrl=this.options.chat.headerAvatarUrl),this.options.chat?.headerBadge!==void 0&&(s.headerBadge=this.options.chat.headerBadge),this.options.chat?.headerCartUrl!==void 0&&(s.headerCartUrl=this.options.chat.headerCartUrl),this.options.chat?.headerFavoritesToggle!==void 0&&(s.headerFavoritesToggle=this.options.chat.headerFavoritesToggle),this.options.chat?.onFavoritesClick!==void 0&&(s.onFavoritesClick=this.options.chat.onFavoritesClick),this.options.chat?.hideMobileLauncher!==void 0&&(s.hideMobileLauncher=this.options.chat.hideMobileLauncher),this.options.chat?.mobileBreakpoint!==void 0&&(s.mobileBreakpoint=this.options.chat.mobileBreakpoint),this.options.chat?.mobileInitialState!==void 0&&(s.mobileInitialState=this.options.chat.mobileInitialState),this.options.chat?.i18n!==void 0&&(s.i18n=this.options.chat.i18n),this.options.chat?.actionHandling!==void 0&&(s.actionHandling=this.options.chat.actionHandling),this.options.chat?.renderer!==void 0&&(s.renderer=this.options.chat.renderer),t!==void 0&&(s.productDetailsExtended=t),i!==void 0&&(s.isDemoWebsite=i),this.options.chat?.productPriceUi!==void 0&&(s.productPriceUi=this.options.chat.productPriceUi),this.options.onScriptCall!==void 0&&(s.onScriptCall=this.options.onScriptCall),this.options.onAddToCart!==void 0&&(s.onAddToCart=this.options.onAddToCart),this.options.chat?.onOpen!==void 0&&(s.onOpen=this.options.chat.onOpen),this.options.chat?.onClose!==void 0&&(s.onClose=this.options.chat.onClose),this._chat=new K.GengageChat,await this._chat.init(s)}async _syncPdpWidgets(){if(this._destroyed)return;const e=this._pageContext.sku;if(!(this._pageContext.pageType==="pdp"&&e!==void 0&&e.length>0)){this._qna?.hide(),this._simrel?.hide(),this._simbut?.hide();return}const t=this.options.middlewareUrl;if(this.options.qna?.enabled!==!1){const i=this.options.qna?.mountTarget??se,s=T(i);if(s)if(this._warnedQnaMountMissing=!1,this._qna)this._qna.show(),this._qna.update({pageType:"pdp",sku:e});else{const o=new $.GengageQNA,n={accountId:this.options.accountId,middlewareUrl:t,session:this.session,pageContext:{pageType:"pdp",sku:e},mountTarget:s};this.options.theme!==void 0&&(n.theme=this.options.theme),this.options.qna?.ctaText!==void 0&&(n.ctaText=this.options.qna.ctaText),this.options.qna?.hideButtonRowCta!==void 0&&(n.hideButtonRowCta=this.options.qna.hideButtonRowCta),this.options.qna?.inputPlaceholder!==void 0&&(n.inputPlaceholder=this.options.qna.inputPlaceholder),this.options.qna?.i18n!==void 0&&(n.i18n=this.options.qna.i18n),this.options.qna?.renderer!==void 0&&(n.renderer=this.options.qna.renderer);const u=this.options.qna?.headerTitle??this.options.qna?.headingTitle;u!==void 0&&(n.headerTitle=u),await o.init(n),this._qna=o}else this._qna?.destroy(),this._qna=null,this._warnedQnaMountMissing||(console.warn(`[gengage] QNA mount target not found: ${i}`),this._warnedQnaMountMissing=!0)}else this._qna?.destroy(),this._qna=null;if(this.options.simrel?.enabled!==!1){const i=this.options.simrel?.mountTarget??oe,s=T(i);if(s)if(this._warnedSimRelMountMissing=!1,this._simrel)this._simrel.show(),this._simrel.update({pageType:"pdp",sku:e});else{const o=new G.GengageSimRel,n={accountId:this.options.accountId,middlewareUrl:t,session:this.session,sku:e,mountTarget:s};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=(u,g,r)=>{m.isSafeUrl(u)&&(this._chat?.saveSession(r??this.session.sessionId,g),window.location.href=u)},await o.init(n),this._simrel=o}else this._simrel?.destroy(),this._simrel=null,this._warnedSimRelMountMissing||(console.warn(`[gengage] SimRel mount target not found: ${i}`),this._warnedSimRelMountMissing=!0)}else this._simrel?.destroy(),this._simrel=null;if(this.options.simbut&&this.options.simbut.enabled!==!1){const i=this.options.simbut.mountTarget??ae,s=T(i),o=this._chat??this.options.simbut.onFindSimilar;if(s&&o)if(this._warnedSimButMountMissing=!1,this._warnedSimButNoChat=!1,this._simbut)this._simbut.show(),this._simbut.setChat(this._chat),this._simbut.update({pageType:"pdp",sku:e});else{const n=new Y.GengageSimBut,u={accountId:this.options.accountId,middlewareUrl:t,session:this.session,pageContext:{pageType:"pdp",sku:e},mountTarget:s,chat:this._chat};this.options.theme!==void 0&&(u.theme=this.options.theme),this.options.locale!==void 0&&(u.locale=this.options.locale),this.options.simbut.imageUrl!==void 0&&(u.imageUrl=this.options.simbut.imageUrl),this.options.simbut.i18n!==void 0&&(u.i18n=this.options.simbut.i18n),this.options.simbut.onFindSimilar!==void 0&&(u.onFindSimilar=this.options.simbut.onFindSimilar),await n.init(u),this._simbut=n}else this._simbut?.destroy(),this._simbut=null,!s&&!this._warnedSimButMountMissing?(console.warn(`[gengage] SimBut mount target not found: ${i}`),this._warnedSimButMountMissing=!0):!o&&!this._warnedSimButNoChat&&(console.warn("[gengage] SimBut requires chat to be enabled or simbut.onFindSimilar"),this._warnedSimButNoChat=!0)}else this._simbut?.destroy(),this._simbut=null}_enqueue(e){const t=this._queue.then(e);return this._queue=t.catch(i=>{}),t}};async function B(e){const t=R(e),i=q(),s=i.instances[t];if(s)return s;const o=i.pending[t];if(o)return o;const n=new ue(e,()=>{const g=q();delete g.instances[t],delete g.pending[t]}),u=n.init().then(()=>(i.instances[t]=n,delete i.pending[t],n)).catch(g=>{throw delete i.pending[t],g});return i.pending[t]=u,u}function W(e){return q().instances[e]??null}function le(e){W(e)?.destroy()}function ce(e){return`${x}${e}`}var j=["gengage:chat:open","gengage:chat:close","gengage:chat:ready","gengage:chat:add-to-cart","gengage:qna:action","gengage:qna:open-chat","gengage:similar:product-click","gengage:similar:add-to-cart","gengage:global:error","gengage:context:update"],ge=32,M="#gengage-qna",A="#gengage-simrel";function he(e){let t=e;if(typeof e=="string"){const n=e.trim();if(n.length===0)return null;if(!n.startsWith("{")&&!n.startsWith("["))return{type:n};try{t=JSON.parse(n)}catch{return null}}if(!t||typeof t!="object")return null;const i=t,s=[i.type,i.command,i.action,i.event].find(n=>typeof n=="string"&&n.length>0);if(!s)return null;let o=i.payload;if(o===void 0&&"data"in i&&(o=i.data),s==="setSession"&&o===void 0){const n={};typeof i.sessionId=="string"&&(n.sessionId=i.sessionId),typeof i.userId=="string"&&(n.userId=i.userId),(n.sessionId!==void 0||n.userId!==void 0)&&(o=n)}return o===void 0?{type:s}:{type:s,payload:o}}function fe(e){if(typeof e=="string"&&e.length>0)return{sku:e};if(e&&typeof e=="object"&&"sku"in e){const t=e.sku;if(typeof t=="string"&&t.length>0){const i=e.pageType;return i!==void 0?{sku:t,pageType:i}:{sku:t}}}return null}function I(e,t){return t instanceof HTMLElement?!0:typeof t!="string"?!1:e.document.querySelector(t)!==null}function E(e,t,i){if(t instanceof HTMLElement||I(e,t)||typeof t!="string")return t;if(t.startsWith("#")){const n=t.slice(1);if(n.length>0){const u=e.document.getElementById(n);if(u)return u;const g=e.document.createElement("div");return g.id=n,e.document.body.appendChild(g),g}}const s=e.document.getElementById(i);if(s)return s;const o=e.document.createElement("div");return o.id=i,e.document.body.appendChild(o),o}function L(e,t){const i=e.webkit?.messageHandlers?.[t];return i&&typeof i.postMessage=="function"?i.postMessage.bind(i):null}function _(e,t){const i=e[t];return i&&typeof i=="object"&&typeof i.postMessage=="function"?i:null}function D(e={}){const t=e.win??window,i=e.iosHandlerName??"gengage",s=e.androidInterfaceName??"GengageNative",o=e.reactNativeInterfaceName??"ReactNativeWebView";return L(t,i)?"ios":_(t,s)?"android":_(t,o)?"react-native":"browser"}function F(e,t={}){const i=t.win??window;if(e.sessionId!==void 0){i.__gengageSessionId=e.sessionId,i.gengage||(i.gengage={}),i.gengage.sessionId=e.sessionId;try{i.sessionStorage.setItem("gengage_session_id",e.sessionId)}catch{}}if(e.userId!==void 0){i.gengage||(i.gengage={});const s=i.gengage,o=s.session??{};o.userId=e.userId,s.session=o}}function H(e={}){const t=e.win??window,i=t;if(i.gengageNative)return i.gengageNative;const s=e.iosHandlerName??"gengage",o=e.androidInterfaceName??"GengageNative",n=e.reactNativeInterfaceName??"ReactNativeWebView",u=e.trackedEvents??[...j],g=D({win:t,iosHandlerName:s,androidInterfaceName:o,reactNativeInterfaceName:n});let r=t.gengage?.overlay??null;const c=[],p=(l,d)=>{const f=d===void 0?{type:l}:{type:l,payload:d};if(g==="ios"){L(t,s)?.(f);return}if(g==="android"){_(t,o)?.postMessage(JSON.stringify(f));return}if(g==="react-native"){_(t,n)?.postMessage(JSON.stringify(f));return}},v=l=>{const d=l.detail;!d||typeof d.namespace!="string"||typeof d.type!="string"||p("bridge_message",{namespace:d.namespace,type:d.type,payload:d.payload})};t.addEventListener("gengage:bridge:message",v);const Q=u.map(l=>{const d=f=>{const h=f.detail;p("widget_event",{event:l,detail:h})};return t.addEventListener(l,d),{event:l,handler:d}}),y=l=>{c.length>=ge&&c.shift(),c.push(l)},V=()=>{if(!r||c.length===0)return;const l=c.splice(0,c.length);for(const d of l)S(d)},S=l=>{const d=he(l);if(!d||typeof d.type!="string"){console.warn("[gengage:native-bridge] Invalid message:",l);return}const f=d.type,h=d.payload;switch(f){case"openChat":r?r.openChat(h&&typeof h=="object"?h:h==="half"||h==="full"?{state:h}:void 0):y(d);return;case"closeChat":r?r.closeChat():y(d);return;case"updateContext":r&&h&&typeof h=="object"?r.updateContext(h):r?console.warn("[gengage:native-bridge] updateContext: missing payload"):y(d);return;case"updateSku":{const C=fe(h);if(r&&C){r.updateSku(C.sku,C.pageType);return}r?console.warn("[gengage:native-bridge] updateSku: missing sku"):y(d);return}case"setSession":h&&typeof h=="object"&&F(h,{win:t});return;case"destroy":r?.destroy();return;default:t.postMessage({gengage:"native",type:f,payload:h},t.location.origin),e.logUnhandled&&console.warn("[gengage:native-bridge] Unhandled inbound type forwarded:",f)}},w={env:g,sendToNative:p,receive:S,setController(l){r=l,V()},destroy(){t.removeEventListener("gengage:bridge:message",v);for(const l of Q)t.removeEventListener(l.event,l.handler);c.splice(0,c.length),t.gengageNative===w&&delete t.gengageNative}};return i.gengageNative=w,w}async function pe(e){const{nativeBridge:t,emitReadyEvent:i=!0,...s}=e,o=H(t),n={...s};n.onAddToCart||(n.onAddToCart=c=>{o.sendToNative("addToCart",{sku:c.sku,quantity:c.quantity,cartCode:c.cartCode})}),n.onProductNavigate||(n.onProductNavigate=(c,p,v)=>{o.sendToNative("productNavigate",{url:c,sku:p,sessionId:v})});const u=n.qna?.enabled===!0||n.qna?.mountTarget!==void 0;if(n.qna?.enabled!==!1)if(u){const c=E(window,n.qna?.mountTarget??M,"gengage-qna");n.qna={...n.qna,enabled:!0,mountTarget:c}}else I(window,M)||(n.qna={enabled:!1});const g=n.simrel?.enabled===!0||n.simrel?.mountTarget!==void 0;if(n.simrel?.enabled!==!1)if(g){const c=E(window,n.simrel?.mountTarget??A,"gengage-simrel");n.simrel={...n.simrel,enabled:!0,mountTarget:c}}else I(window,A)||(n.simrel={enabled:!1});const r=await B(n);return o.setController(r),i&&o.sendToNative("ready",{sessionId:r.session.sessionId,widgets:{chat:r.chat!==null,qna:r.qna!==null,simrel:r.simrel!==null}}),{controller:r,bridge:o,destroy(){r.destroy(),o.destroy()}}}Object.defineProperty(exports,"AccountRuntimeConfigSchema",{enumerable:!0,get:function(){return N}});Object.defineProperty(exports,"AnalyticsAuthModeSchema",{enumerable:!0,get:function(){return k}});Object.defineProperty(exports,"DEFAULT_NATIVE_TRACKED_EVENTS",{enumerable:!0,get:function(){return j}});Object.defineProperty(exports,"UnknownActionPolicySchema",{enumerable:!0,get:function(){return O}});Object.defineProperty(exports,"applyNativeSession",{enumerable:!0,get:function(){return F}});Object.defineProperty(exports,"buildOverlayIdempotencyKey",{enumerable:!0,get:function(){return ce}});Object.defineProperty(exports,"createDefaultAccountRuntimeConfig",{enumerable:!0,get:function(){return ne}});Object.defineProperty(exports,"createNativeWebViewBridge",{enumerable:!0,get:function(){return H}});Object.defineProperty(exports,"destroyOverlayWidgets",{enumerable:!0,get:function(){return le}});Object.defineProperty(exports,"detectNativeEnvironment",{enumerable:!0,get:function(){return D}});Object.defineProperty(exports,"getOverlayWidgets",{enumerable:!0,get:function(){return W}});Object.defineProperty(exports,"initNativeOverlayWidgets",{enumerable:!0,get:function(){return pe}});Object.defineProperty(exports,"initOverlayWidgets",{enumerable:!0,get:function(){return B}});Object.defineProperty(exports,"parseAccountRuntimeConfig",{enumerable:!0,get:function(){return P}});Object.defineProperty(exports,"safeParseAccountRuntimeConfig",{enumerable:!0,get:function(){return ie}});
|
|
1
|
+
const a=require("./schemas-B7jnyzQI.cjs"),m=require("./ga-datalayer-BVppFxqk.cjs"),K=require("./chat-BOkLnT1i.cjs"),$=require("./qna-DwG8AJJf.cjs"),G=require("./simrel-DdP4lur9.cjs"),Y=require("./simbut-D_ycY_MQ.cjs");var b=a.object({enabled:a.boolean().default(!0)}),J=a.object({chat:a.string().optional(),qna:a.string().optional(),simrel:a.string().optional(),simbut:a.string().optional()}),X=a.object({}),k=a._enum(["none","x-api-key-header","bearer-header","body-api-key"]),z=a.object({mode:k.default("none"),key:a.string().optional(),headerName:a.string().optional(),bodyField:a.string().default("api_key")}),Z=a.object({enabled:a.boolean().default(!0),endpoint:a.string().default("/analytics"),auth:z.default({mode:"none",bodyField:"api_key"}),fireAndForget:a.boolean().default(!0),useBeacon:a.boolean().default(!0),keepaliveFetch:a.boolean().default(!0),timeoutMs:a.number().int().positive().default(4e3),maxRetries:a.number().int().min(0).max(5).default(1)}),U="__gengageWidgetsInit",ee=a.object({idempotencyKey:a.string().default(U),requireDomReady:a.boolean().default(!0)}),O=a._enum(["log-and-ignore","throw","delegate"]),te=a.object({unknownActionPolicy:O.default("log-and-ignore"),allowScriptCall:a.boolean().default(!1)}),N=a.object({version:a.literal("1",{error:'version must be "1"'}),accountId:a.string({error:"accountId must be a non-empty string"}).min(1,{error:"accountId must be a non-empty string"}),middlewareUrl:a.string({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")'}),locale:a.string().optional(),widgets:a.object({chat:b.default({enabled:!0}),qna:b.default({enabled:!0}),simrel:b.default({enabled:!0}),simbut:b.default({enabled:!1})}),mounts:J.default({}),transport:X.default({}),analytics:Z.default({enabled:!0,endpoint:"/analytics",auth:{mode:"none",bodyField:"api_key"},fireAndForget:!0,useBeacon:!0,keepaliveFetch:!0,timeoutMs:4e3,maxRetries:1}),gtm:ee.default({idempotencyKey:"__gengageWidgetsInit",requireDomReady:!0}),actionHandling:te.default({unknownActionPolicy:"log-and-ignore",allowScriptCall:!1})});function P(e){m.debugLog("config","parsing account runtime config",e);const t=N.parse(e);return m.debugLog("config","config resolved",{accountId:t.accountId,middlewareUrl:t.middlewareUrl}),t}function ie(e){return N.safeParse(e)}function ne(e){return P({version:"1",accountId:e.accountId,middlewareUrl:e.middlewareUrl,locale:e.locale,widgets:{chat:{enabled:!0},qna:{enabled:!0},simrel:{enabled:!0},simbut:{enabled:!1}}})}var x=`${U}_overlay_`,se="#gengage-qna",oe="#gengage-simrel",ae="#gengage-simbut";function q(){const e=window;return e.__gengageOverlayRegistry||(e.__gengageOverlayRegistry={instances:{},pending:{}}),e.__gengageOverlayRegistry}function re(e){const t={pageType:e.pageContext?.pageType??(e.sku!==void 0?"pdp":"other")},i=e.pageContext;return i?.sku!==void 0&&(t.sku=i.sku),i?.price!==void 0&&(t.price=i.price),i?.categoryTree!==void 0&&(t.categoryTree=i.categoryTree),i?.url!==void 0&&(t.url=i.url),i?.extra!==void 0&&(t.extra=i.extra),e.sku!==void 0&&(t.sku=e.sku),t}function de(e,t){const i={...e,...t,pageType:t.pageType??e.pageType};return t.sku===void 0&&e.sku!==void 0&&(i.sku=e.sku),i}function T(e){return e instanceof HTMLElement||document.querySelector(e)?e:null}function R(e){return e.idempotencyKey??`${x}${e.accountId}`}var ue=class{constructor(e,t){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=R(e),this.session=m.resolveSession(e.session),this._pageContext=re(e)}get chat(){return this._chat}get qna(){return this._qna}get simrel(){return this._simrel}get simbut(){return this._simbut}get analyticsClient(){return this._analyticsClient}async init(){window.gengage||(window.gengage={}),window.gengage.sessionId=this.session.sessionId,window.gengage.pageContext=this._pageContext,await this._initChat(),this.options.wireQnaToChat!==!1&&(this._offQnaWire=m.wireQNAToChat()),await this._syncPdpWidgets(),window.gengage.overlay=this}openChat(e){this._chat?.open(e)}closeChat(){this._chat?.close()}async updateContext(e){this._destroyed||await this._enqueue(async()=>{this._pageContext=de(this._pageContext,e),window.gengage||(window.gengage={}),window.gengage.pageContext=this._pageContext,this._chat?.update(e),this._qna?.update(e),this._simrel?.update(e),this._simbut?.update(e),await this._syncPdpWidgets()})}async updateSku(e,t="pdp"){await this.updateContext({sku:e,pageType:t})}destroy(){this._destroyed||(this._destroyed=!0,this._offQnaWire?.(),this._offQnaWire=null,this._chat?.destroy(),this._qna?.destroy(),this._simrel?.destroy(),this._simbut?.destroy(),this._chat=null,this._qna=null,this._simrel=null,this._simbut=null,window.gengage?.overlay===this&&delete window.gengage.overlay,this.onDestroy())}async _initChat(){if(this.options.chat?.enabled===!1)return;const e=this.options.middlewareUrl,t=this.options.chat?.productDetailsExtended??this.options.productDetailsExtended,i=this.options.chat?.isDemoWebsite??this.options.isDemoWebsite,s={accountId:this.options.accountId,middlewareUrl:e,session:this.session,pageContext:this._pageContext,variant:this.options.chat?.variant??"floating"};this.options.theme!==void 0&&(s.theme=this.options.theme),this.options.locale!==void 0&&(s.locale=this.options.locale),this.options.pricing!==void 0&&(s.pricing=this.options.pricing),this.options.chat?.mountTarget!==void 0&&(s.mountTarget=this.options.chat.mountTarget),this.options.chat?.pillLauncher!==void 0&&(s.pillLauncher=this.options.chat.pillLauncher),this.options.chat?.launcherImageUrl!==void 0?s.launcherImageUrl=this.options.chat.launcherImageUrl:this.options.chat?.launcherSvg!==void 0&&(s.launcherSvg=this.options.chat.launcherSvg),this.options.chat?.headerTitle!==void 0&&(s.headerTitle=this.options.chat.headerTitle),this.options.chat?.headerAvatarUrl!==void 0&&(s.headerAvatarUrl=this.options.chat.headerAvatarUrl),this.options.chat?.headerBadge!==void 0&&(s.headerBadge=this.options.chat.headerBadge),this.options.chat?.headerCartUrl!==void 0&&(s.headerCartUrl=this.options.chat.headerCartUrl),this.options.chat?.headerFavoritesToggle!==void 0&&(s.headerFavoritesToggle=this.options.chat.headerFavoritesToggle),this.options.chat?.onFavoritesClick!==void 0&&(s.onFavoritesClick=this.options.chat.onFavoritesClick),this.options.chat?.hideMobileLauncher!==void 0&&(s.hideMobileLauncher=this.options.chat.hideMobileLauncher),this.options.chat?.mobileBreakpoint!==void 0&&(s.mobileBreakpoint=this.options.chat.mobileBreakpoint),this.options.chat?.mobileInitialState!==void 0&&(s.mobileInitialState=this.options.chat.mobileInitialState),this.options.chat?.i18n!==void 0&&(s.i18n=this.options.chat.i18n),this.options.chat?.actionHandling!==void 0&&(s.actionHandling=this.options.chat.actionHandling),this.options.chat?.renderer!==void 0&&(s.renderer=this.options.chat.renderer),t!==void 0&&(s.productDetailsExtended=t),i!==void 0&&(s.isDemoWebsite=i),this.options.chat?.productPriceUi!==void 0&&(s.productPriceUi=this.options.chat.productPriceUi),this.options.onScriptCall!==void 0&&(s.onScriptCall=this.options.onScriptCall),this.options.onAddToCart!==void 0&&(s.onAddToCart=this.options.onAddToCart),this.options.chat?.onOpen!==void 0&&(s.onOpen=this.options.chat.onOpen),this.options.chat?.onClose!==void 0&&(s.onClose=this.options.chat.onClose),this._chat=new K.GengageChat,await this._chat.init(s)}async _syncPdpWidgets(){if(this._destroyed)return;const e=this._pageContext.sku;if(!(this._pageContext.pageType==="pdp"&&e!==void 0&&e.length>0)){this._qna?.hide(),this._simrel?.hide(),this._simbut?.hide();return}const t=this.options.middlewareUrl;if(this.options.qna?.enabled!==!1){const i=this.options.qna?.mountTarget??se,s=T(i);if(s)if(this._warnedQnaMountMissing=!1,this._qna)this._qna.show(),this._qna.update({pageType:"pdp",sku:e});else{const o=new $.GengageQNA,n={accountId:this.options.accountId,middlewareUrl:t,session:this.session,pageContext:{pageType:"pdp",sku:e},mountTarget:s};this.options.theme!==void 0&&(n.theme=this.options.theme),this.options.qna?.ctaText!==void 0&&(n.ctaText=this.options.qna.ctaText),this.options.qna?.hideButtonRowCta!==void 0&&(n.hideButtonRowCta=this.options.qna.hideButtonRowCta),this.options.qna?.inputPlaceholder!==void 0&&(n.inputPlaceholder=this.options.qna.inputPlaceholder),this.options.qna?.i18n!==void 0&&(n.i18n=this.options.qna.i18n),this.options.qna?.renderer!==void 0&&(n.renderer=this.options.qna.renderer);const u=this.options.qna?.headerTitle??this.options.qna?.headingTitle;u!==void 0&&(n.headerTitle=u),await o.init(n),this._qna=o}else this._qna?.destroy(),this._qna=null,this._warnedQnaMountMissing||(console.warn(`[gengage] QNA mount target not found: ${i}`),this._warnedQnaMountMissing=!0)}else this._qna?.destroy(),this._qna=null;if(this.options.simrel?.enabled!==!1){const i=this.options.simrel?.mountTarget??oe,s=T(i);if(s)if(this._warnedSimRelMountMissing=!1,this._simrel)this._simrel.show(),this._simrel.update({pageType:"pdp",sku:e});else{const o=new G.GengageSimRel,n={accountId:this.options.accountId,middlewareUrl:t,session:this.session,sku:e,mountTarget:s};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=(u,g,r)=>{m.isSafeUrl(u)&&(this._chat?.saveSession(r??this.session.sessionId,g),window.location.href=u)},await o.init(n),this._simrel=o}else this._simrel?.destroy(),this._simrel=null,this._warnedSimRelMountMissing||(console.warn(`[gengage] SimRel mount target not found: ${i}`),this._warnedSimRelMountMissing=!0)}else this._simrel?.destroy(),this._simrel=null;if(this.options.simbut&&this.options.simbut.enabled!==!1){const i=this.options.simbut.mountTarget??ae,s=T(i),o=this._chat??this.options.simbut.onFindSimilar;if(s&&o)if(this._warnedSimButMountMissing=!1,this._warnedSimButNoChat=!1,this._simbut)this._simbut.show(),this._simbut.setChat(this._chat),this._simbut.update({pageType:"pdp",sku:e});else{const n=new Y.GengageSimBut,u={accountId:this.options.accountId,middlewareUrl:t,session:this.session,pageContext:{pageType:"pdp",sku:e},mountTarget:s,chat:this._chat};this.options.theme!==void 0&&(u.theme=this.options.theme),this.options.locale!==void 0&&(u.locale=this.options.locale),this.options.simbut.imageUrl!==void 0&&(u.imageUrl=this.options.simbut.imageUrl),this.options.simbut.i18n!==void 0&&(u.i18n=this.options.simbut.i18n),this.options.simbut.onFindSimilar!==void 0&&(u.onFindSimilar=this.options.simbut.onFindSimilar),await n.init(u),this._simbut=n}else this._simbut?.destroy(),this._simbut=null,!s&&!this._warnedSimButMountMissing?(console.warn(`[gengage] SimBut mount target not found: ${i}`),this._warnedSimButMountMissing=!0):!o&&!this._warnedSimButNoChat&&(console.warn("[gengage] SimBut requires chat to be enabled or simbut.onFindSimilar"),this._warnedSimButNoChat=!0)}else this._simbut?.destroy(),this._simbut=null}_enqueue(e){const t=this._queue.then(e);return this._queue=t.catch(i=>{}),t}};async function B(e){const t=R(e),i=q(),s=i.instances[t];if(s)return s;const o=i.pending[t];if(o)return o;const n=new ue(e,()=>{const g=q();delete g.instances[t],delete g.pending[t]}),u=n.init().then(()=>(i.instances[t]=n,delete i.pending[t],n)).catch(g=>{throw delete i.pending[t],g});return i.pending[t]=u,u}function W(e){return q().instances[e]??null}function le(e){W(e)?.destroy()}function ce(e){return`${x}${e}`}var j=["gengage:chat:open","gengage:chat:close","gengage:chat:ready","gengage:chat:add-to-cart","gengage:qna:action","gengage:qna:open-chat","gengage:similar:product-click","gengage:similar:add-to-cart","gengage:global:error","gengage:context:update"],ge=32,M="#gengage-qna",A="#gengage-simrel";function he(e){let t=e;if(typeof e=="string"){const n=e.trim();if(n.length===0)return null;if(!n.startsWith("{")&&!n.startsWith("["))return{type:n};try{t=JSON.parse(n)}catch{return null}}if(!t||typeof t!="object")return null;const i=t,s=[i.type,i.command,i.action,i.event].find(n=>typeof n=="string"&&n.length>0);if(!s)return null;let o=i.payload;if(o===void 0&&"data"in i&&(o=i.data),s==="setSession"&&o===void 0){const n={};typeof i.sessionId=="string"&&(n.sessionId=i.sessionId),typeof i.userId=="string"&&(n.userId=i.userId),(n.sessionId!==void 0||n.userId!==void 0)&&(o=n)}return o===void 0?{type:s}:{type:s,payload:o}}function fe(e){if(typeof e=="string"&&e.length>0)return{sku:e};if(e&&typeof e=="object"&&"sku"in e){const t=e.sku;if(typeof t=="string"&&t.length>0){const i=e.pageType;return i!==void 0?{sku:t,pageType:i}:{sku:t}}}return null}function I(e,t){return t instanceof HTMLElement?!0:typeof t!="string"?!1:e.document.querySelector(t)!==null}function E(e,t,i){if(t instanceof HTMLElement||I(e,t)||typeof t!="string")return t;if(t.startsWith("#")){const n=t.slice(1);if(n.length>0){const u=e.document.getElementById(n);if(u)return u;const g=e.document.createElement("div");return g.id=n,e.document.body.appendChild(g),g}}const s=e.document.getElementById(i);if(s)return s;const o=e.document.createElement("div");return o.id=i,e.document.body.appendChild(o),o}function L(e,t){const i=e.webkit?.messageHandlers?.[t];return i&&typeof i.postMessage=="function"?i.postMessage.bind(i):null}function _(e,t){const i=e[t];return i&&typeof i=="object"&&typeof i.postMessage=="function"?i:null}function D(e={}){const t=e.win??window,i=e.iosHandlerName??"gengage",s=e.androidInterfaceName??"GengageNative",o=e.reactNativeInterfaceName??"ReactNativeWebView";return L(t,i)?"ios":_(t,s)?"android":_(t,o)?"react-native":"browser"}function F(e,t={}){const i=t.win??window;if(e.sessionId!==void 0){i.__gengageSessionId=e.sessionId,i.gengage||(i.gengage={}),i.gengage.sessionId=e.sessionId;try{i.sessionStorage.setItem("gengage_session_id",e.sessionId)}catch{}}if(e.userId!==void 0){i.gengage||(i.gengage={});const s=i.gengage,o=s.session??{};o.userId=e.userId,s.session=o}}function H(e={}){const t=e.win??window,i=t;if(i.gengageNative)return i.gengageNative;const s=e.iosHandlerName??"gengage",o=e.androidInterfaceName??"GengageNative",n=e.reactNativeInterfaceName??"ReactNativeWebView",u=e.trackedEvents??[...j],g=D({win:t,iosHandlerName:s,androidInterfaceName:o,reactNativeInterfaceName:n});let r=t.gengage?.overlay??null;const c=[],p=(l,d)=>{const f=d===void 0?{type:l}:{type:l,payload:d};if(g==="ios"){L(t,s)?.(f);return}if(g==="android"){_(t,o)?.postMessage(JSON.stringify(f));return}if(g==="react-native"){_(t,n)?.postMessage(JSON.stringify(f));return}},v=l=>{const d=l.detail;!d||typeof d.namespace!="string"||typeof d.type!="string"||p("bridge_message",{namespace:d.namespace,type:d.type,payload:d.payload})};t.addEventListener("gengage:bridge:message",v);const Q=u.map(l=>{const d=f=>{const h=f.detail;p("widget_event",{event:l,detail:h})};return t.addEventListener(l,d),{event:l,handler:d}}),y=l=>{c.length>=ge&&c.shift(),c.push(l)},V=()=>{if(!r||c.length===0)return;const l=c.splice(0,c.length);for(const d of l)S(d)},S=l=>{const d=he(l);if(!d||typeof d.type!="string"){console.warn("[gengage:native-bridge] Invalid message:",l);return}const f=d.type,h=d.payload;switch(f){case"openChat":r?r.openChat(h&&typeof h=="object"?h:h==="half"||h==="full"?{state:h}:void 0):y(d);return;case"closeChat":r?r.closeChat():y(d);return;case"updateContext":r&&h&&typeof h=="object"?r.updateContext(h):r?console.warn("[gengage:native-bridge] updateContext: missing payload"):y(d);return;case"updateSku":{const C=fe(h);if(r&&C){r.updateSku(C.sku,C.pageType);return}r?console.warn("[gengage:native-bridge] updateSku: missing sku"):y(d);return}case"setSession":h&&typeof h=="object"&&F(h,{win:t});return;case"destroy":r?.destroy();return;default:t.postMessage({gengage:"native",type:f,payload:h},t.location.origin),e.logUnhandled&&console.warn("[gengage:native-bridge] Unhandled inbound type forwarded:",f)}},w={env:g,sendToNative:p,receive:S,setController(l){r=l,V()},destroy(){t.removeEventListener("gengage:bridge:message",v);for(const l of Q)t.removeEventListener(l.event,l.handler);c.splice(0,c.length),t.gengageNative===w&&delete t.gengageNative}};return i.gengageNative=w,w}async function pe(e){const{nativeBridge:t,emitReadyEvent:i=!0,...s}=e,o=H(t),n={...s};n.onAddToCart||(n.onAddToCart=c=>{o.sendToNative("addToCart",{sku:c.sku,quantity:c.quantity,cartCode:c.cartCode})}),n.onProductNavigate||(n.onProductNavigate=(c,p,v)=>{o.sendToNative("productNavigate",{url:c,sku:p,sessionId:v})});const u=n.qna?.enabled===!0||n.qna?.mountTarget!==void 0;if(n.qna?.enabled!==!1)if(u){const c=E(window,n.qna?.mountTarget??M,"gengage-qna");n.qna={...n.qna,enabled:!0,mountTarget:c}}else I(window,M)||(n.qna={enabled:!1});const g=n.simrel?.enabled===!0||n.simrel?.mountTarget!==void 0;if(n.simrel?.enabled!==!1)if(g){const c=E(window,n.simrel?.mountTarget??A,"gengage-simrel");n.simrel={...n.simrel,enabled:!0,mountTarget:c}}else I(window,A)||(n.simrel={enabled:!1});const r=await B(n);return o.setController(r),i&&o.sendToNative("ready",{sessionId:r.session.sessionId,widgets:{chat:r.chat!==null,qna:r.qna!==null,simrel:r.simrel!==null}}),{controller:r,bridge:o,destroy(){r.destroy(),o.destroy()}}}Object.defineProperty(exports,"AccountRuntimeConfigSchema",{enumerable:!0,get:function(){return N}});Object.defineProperty(exports,"AnalyticsAuthModeSchema",{enumerable:!0,get:function(){return k}});Object.defineProperty(exports,"DEFAULT_NATIVE_TRACKED_EVENTS",{enumerable:!0,get:function(){return j}});Object.defineProperty(exports,"UnknownActionPolicySchema",{enumerable:!0,get:function(){return O}});Object.defineProperty(exports,"applyNativeSession",{enumerable:!0,get:function(){return F}});Object.defineProperty(exports,"buildOverlayIdempotencyKey",{enumerable:!0,get:function(){return ce}});Object.defineProperty(exports,"createDefaultAccountRuntimeConfig",{enumerable:!0,get:function(){return ne}});Object.defineProperty(exports,"createNativeWebViewBridge",{enumerable:!0,get:function(){return H}});Object.defineProperty(exports,"destroyOverlayWidgets",{enumerable:!0,get:function(){return le}});Object.defineProperty(exports,"detectNativeEnvironment",{enumerable:!0,get:function(){return D}});Object.defineProperty(exports,"getOverlayWidgets",{enumerable:!0,get:function(){return W}});Object.defineProperty(exports,"initNativeOverlayWidgets",{enumerable:!0,get:function(){return pe}});Object.defineProperty(exports,"initOverlayWidgets",{enumerable:!0,get:function(){return B}});Object.defineProperty(exports,"parseAccountRuntimeConfig",{enumerable:!0,get:function(){return P}});Object.defineProperty(exports,"safeParseAccountRuntimeConfig",{enumerable:!0,get:function(){return ie}});
|
package/dist/native.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./native-webview-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./native-webview-BePZBK3U.cjs");exports.DEFAULT_NATIVE_TRACKED_EVENTS=e.DEFAULT_NATIVE_TRACKED_EVENTS;exports.applyNativeSession=e.applyNativeSession;exports.createNativeWebViewBridge=e.createNativeWebViewBridge;exports.detectNativeEnvironment=e.detectNativeEnvironment;exports.initNativeOverlayWidgets=e.initNativeOverlayWidgets;
|