@gengage/assistant-fe 0.3.19 → 0.3.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.
Files changed (319) hide show
  1. package/dist/chat/api.d.ts +0 -1
  2. package/dist/chat/assistant-mode.d.ts +0 -1
  3. package/dist/chat/attachment-utils.d.ts +0 -1
  4. package/dist/chat/catalog.d.ts +0 -1
  5. package/dist/chat/chat-presentation-state.d.ts +0 -1
  6. package/dist/chat/components/AIGroupingCards.d.ts +0 -1
  7. package/dist/chat/components/AISuggestedSearchCards.d.ts +0 -1
  8. package/dist/chat/components/AITopPicks.d.ts +0 -1
  9. package/dist/chat/components/BeautyPhotoStep.d.ts +0 -1
  10. package/dist/chat/components/CategoriesContainer.d.ts +0 -1
  11. package/dist/chat/components/ChatDrawer.d.ts +0 -1
  12. package/dist/chat/components/ChoicePrompter.d.ts +0 -1
  13. package/dist/chat/components/ComparisonTable.d.ts +0 -1
  14. package/dist/chat/components/ConsultingStylePicker.d.ts +0 -1
  15. package/dist/chat/components/FloatingComparisonButton.d.ts +0 -1
  16. package/dist/chat/components/GroundingReviewCard.d.ts +0 -1
  17. package/dist/chat/components/HandoffNotice.d.ts +0 -1
  18. package/dist/chat/components/KvkkBanner.d.ts +0 -1
  19. package/dist/chat/components/Launcher.d.ts +0 -1
  20. package/dist/chat/components/PanelTopBar.d.ts +0 -1
  21. package/dist/chat/components/PhotoAnalysisCard.d.ts +0 -1
  22. package/dist/chat/components/ProductSummaryCard.d.ts +0 -1
  23. package/dist/chat/components/ProsAndCons.d.ts +0 -1
  24. package/dist/chat/components/ReviewHighlights.d.ts +0 -1
  25. package/dist/chat/components/ThumbnailsColumn.d.ts +0 -1
  26. package/dist/chat/components/actionClassifier.d.ts +0 -1
  27. package/dist/chat/components/product-price-layout.d.ts +0 -1
  28. package/dist/chat/components/productMentionLinker.d.ts +0 -1
  29. package/dist/chat/components/renderUISpec.d.ts +0 -1
  30. package/dist/chat/components/typewriter.d.ts +0 -1
  31. package/dist/chat/extendedModeManager.d.ts +0 -1
  32. package/dist/chat/features/beauty-consulting/consulting-grid.d.ts +0 -1
  33. package/dist/chat/features/beauty-consulting/drawer-extensions.d.ts +0 -1
  34. package/dist/chat/features/beauty-consulting/mode-controller.d.ts +0 -1
  35. package/dist/chat/features/beauty-consulting/registry.d.ts +0 -1
  36. package/dist/chat/features/beauty-consulting/stream-handler.d.ts +0 -1
  37. package/dist/chat/index.d.ts +0 -1
  38. package/dist/chat/kvkk.d.ts +0 -1
  39. package/dist/chat/locales/en.d.ts +0 -1
  40. package/dist/chat/locales/index.d.ts +0 -1
  41. package/dist/chat/locales/tr.d.ts +0 -1
  42. package/dist/chat/panel-manager.d.ts +0 -1
  43. package/dist/chat/session-persistence.d.ts +0 -1
  44. package/dist/chat/stream-error-display.d.ts +0 -1
  45. package/dist/chat/types.d.ts +0 -1
  46. package/dist/chat/utils/chat-presentation-debug.d.ts +0 -1
  47. package/dist/chat/utils/get-chat-scroll-element.d.ts +0 -1
  48. package/dist/chat/utils/ui.d.ts +0 -1
  49. package/dist/chat-CuPO9t-Z.cjs +93 -0
  50. package/dist/chat-yAf9OADM.js +7111 -0
  51. package/dist/chat.cjs +1 -1
  52. package/dist/chat.iife.js +48 -49
  53. package/dist/chat.js +13 -2
  54. package/dist/common/action-router.d.ts +0 -1
  55. package/dist/common/activity-tracker.d.ts +0 -1
  56. package/dist/common/analytics-events.d.ts +0 -1
  57. package/dist/common/analytics.d.ts +0 -1
  58. package/dist/common/api-paths.d.ts +0 -1
  59. package/dist/common/client.d.ts +0 -1
  60. package/dist/common/communication-bridge.d.ts +0 -1
  61. package/dist/common/config-schema.d.ts +0 -1
  62. package/dist/common/connection-warning.d.ts +0 -1
  63. package/dist/common/consulting-sources.d.ts +0 -1
  64. package/dist/common/context.d.ts +0 -1
  65. package/dist/common/customization-factories.d.ts +0 -1
  66. package/dist/common/debug.d.ts +0 -1
  67. package/dist/common/events.d.ts +0 -1
  68. package/dist/common/ga-datalayer.d.ts +0 -1
  69. package/dist/common/global-error-toast.d.ts +0 -1
  70. package/dist/common/index.d.ts +0 -1
  71. package/dist/common/indexed-db.d.ts +0 -1
  72. package/dist/common/native-webview.d.ts +0 -1
  73. package/dist/common/overlay.d.ts +0 -1
  74. package/dist/common/page-detect.d.ts +0 -1
  75. package/dist/common/pill-launcher.d.ts +0 -1
  76. package/dist/common/preflight.d.ts +0 -1
  77. package/dist/common/price-formatter.d.ts +0 -1
  78. package/dist/common/product-utils.d.ts +0 -1
  79. package/dist/common/protocol-adapter.d.ts +0 -1
  80. package/dist/common/renderer/dom.d.ts +0 -1
  81. package/dist/common/renderer/index.d.ts +0 -1
  82. package/dist/common/renderer/overrides.d.ts +0 -1
  83. package/dist/common/renderer/registry.d.ts +0 -1
  84. package/dist/common/renderer/types.d.ts +0 -1
  85. package/dist/common/safe-html.d.ts +0 -1
  86. package/dist/common/skeleton.d.ts +0 -1
  87. package/dist/common/streaming.d.ts +0 -1
  88. package/dist/common/suggested-search-keywords.d.ts +0 -1
  89. package/dist/common/theme-utils.d.ts +0 -1
  90. package/dist/common/tts-player.d.ts +0 -1
  91. package/dist/common/types.d.ts +0 -1
  92. package/dist/common/ui-theme.d.ts +0 -1
  93. package/dist/common/uuidv7.d.ts +0 -1
  94. package/dist/common/voice-input.d.ts +0 -1
  95. package/dist/common/widget-base.d.ts +0 -1
  96. package/dist/common-BzegEdJs.cjs +1 -0
  97. package/dist/common-C8NRcP7O.js +367 -0
  98. package/dist/common.cjs +1 -1
  99. package/dist/common.js +86 -7
  100. package/dist/connection-warning-CL1CReZo.cjs +1 -0
  101. package/dist/connection-warning-CVZzlGJt.js +95 -0
  102. package/dist/ga-datalayer-CgI6Kb_i.js +1044 -0
  103. package/dist/ga-datalayer-DkfsAHf9.cjs +47 -0
  104. package/dist/index.cjs +1 -1
  105. package/dist/index.d.ts +0 -1
  106. package/dist/index.js +76 -10
  107. package/dist/native/index.d.ts +0 -1
  108. package/dist/native-webview-B8vOoxns.js +571 -0
  109. package/dist/native-webview-D2lDXTh3.cjs +1 -0
  110. package/dist/native.cjs +1 -1
  111. package/dist/native.iife.js +51 -52
  112. package/dist/native.js +8 -2
  113. package/dist/product-utils-Bm3aiAlJ.js +46 -0
  114. package/dist/product-utils-DLXQQJbh.cjs +1 -0
  115. package/dist/qna/api.d.ts +0 -1
  116. package/dist/qna/catalog.d.ts +0 -1
  117. package/dist/qna/components/ButtonRow.d.ts +0 -1
  118. package/dist/qna/components/TextInput.d.ts +0 -1
  119. package/dist/qna/components/renderUISpec.d.ts +0 -1
  120. package/dist/qna/index.d.ts +0 -1
  121. package/dist/qna/locales/en.d.ts +0 -1
  122. package/dist/qna/locales/index.d.ts +0 -1
  123. package/dist/qna/locales/tr.d.ts +0 -1
  124. package/dist/qna/normalize-ui-specs.d.ts +0 -1
  125. package/dist/qna/types.d.ts +0 -1
  126. package/dist/qna-KizG_W1J.cjs +1 -0
  127. package/dist/qna-YSaIDxjs.js +663 -0
  128. package/dist/qna.cjs +1 -1
  129. package/dist/qna.iife.js +35 -36
  130. package/dist/qna.js +9 -2
  131. package/dist/schemas-B6RjqKrg.cjs +40 -0
  132. package/dist/schemas-PkedCk_-.js +4047 -0
  133. package/dist/simbut/index.d.ts +0 -1
  134. package/dist/simbut/locales.d.ts +0 -1
  135. package/dist/simbut/types.d.ts +0 -1
  136. package/dist/simbut-B2jXtckF.cjs +1 -0
  137. package/dist/simbut-BI054QK0.js +71 -0
  138. package/dist/simbut.cjs +1 -1
  139. package/dist/simbut.iife.js +15 -16
  140. package/dist/simbut.js +5 -2
  141. package/dist/simrel/api.d.ts +0 -1
  142. package/dist/simrel/catalog.d.ts +0 -1
  143. package/dist/simrel/components/GroupTabs.d.ts +0 -1
  144. package/dist/simrel/components/ProductCard.d.ts +0 -1
  145. package/dist/simrel/components/ProductGrid.d.ts +0 -1
  146. package/dist/simrel/components/renderUISpec.d.ts +0 -1
  147. package/dist/simrel/index.d.ts +0 -1
  148. package/dist/simrel/locales/en.d.ts +0 -1
  149. package/dist/simrel/locales/index.d.ts +0 -1
  150. package/dist/simrel/locales/tr.d.ts +0 -1
  151. package/dist/simrel/types.d.ts +0 -1
  152. package/dist/simrel-C-DKpfVB.js +694 -0
  153. package/dist/simrel-vL0woDkE.cjs +1 -0
  154. package/dist/simrel.cjs +1 -1
  155. package/dist/simrel.iife.js +35 -36
  156. package/dist/simrel.js +9 -2
  157. package/package.json +1 -1
  158. package/dist/chat/api.d.ts.map +0 -1
  159. package/dist/chat/assistant-mode.d.ts.map +0 -1
  160. package/dist/chat/attachment-utils.d.ts.map +0 -1
  161. package/dist/chat/catalog.d.ts.map +0 -1
  162. package/dist/chat/chat-presentation-state.d.ts.map +0 -1
  163. package/dist/chat/components/AIGroupingCards.d.ts.map +0 -1
  164. package/dist/chat/components/AISuggestedSearchCards.d.ts.map +0 -1
  165. package/dist/chat/components/AITopPicks.d.ts.map +0 -1
  166. package/dist/chat/components/BeautyPhotoStep.d.ts.map +0 -1
  167. package/dist/chat/components/CategoriesContainer.d.ts.map +0 -1
  168. package/dist/chat/components/ChatDrawer.d.ts.map +0 -1
  169. package/dist/chat/components/ChoicePrompter.d.ts.map +0 -1
  170. package/dist/chat/components/ComparisonTable.d.ts.map +0 -1
  171. package/dist/chat/components/ConsultingStylePicker.d.ts.map +0 -1
  172. package/dist/chat/components/FloatingComparisonButton.d.ts.map +0 -1
  173. package/dist/chat/components/GroundingReviewCard.d.ts.map +0 -1
  174. package/dist/chat/components/HandoffNotice.d.ts.map +0 -1
  175. package/dist/chat/components/KvkkBanner.d.ts.map +0 -1
  176. package/dist/chat/components/Launcher.d.ts.map +0 -1
  177. package/dist/chat/components/PanelTopBar.d.ts.map +0 -1
  178. package/dist/chat/components/PhotoAnalysisCard.d.ts.map +0 -1
  179. package/dist/chat/components/ProductSummaryCard.d.ts.map +0 -1
  180. package/dist/chat/components/ProsAndCons.d.ts.map +0 -1
  181. package/dist/chat/components/ReviewHighlights.d.ts.map +0 -1
  182. package/dist/chat/components/ThumbnailsColumn.d.ts.map +0 -1
  183. package/dist/chat/components/actionClassifier.d.ts.map +0 -1
  184. package/dist/chat/components/product-price-layout.d.ts.map +0 -1
  185. package/dist/chat/components/productMentionLinker.d.ts.map +0 -1
  186. package/dist/chat/components/renderUISpec.d.ts.map +0 -1
  187. package/dist/chat/components/typewriter.d.ts.map +0 -1
  188. package/dist/chat/extendedModeManager.d.ts.map +0 -1
  189. package/dist/chat/features/beauty-consulting/consulting-grid.d.ts.map +0 -1
  190. package/dist/chat/features/beauty-consulting/drawer-extensions.d.ts.map +0 -1
  191. package/dist/chat/features/beauty-consulting/mode-controller.d.ts.map +0 -1
  192. package/dist/chat/features/beauty-consulting/registry.d.ts.map +0 -1
  193. package/dist/chat/features/beauty-consulting/stream-handler.d.ts.map +0 -1
  194. package/dist/chat/index.d.ts.map +0 -1
  195. package/dist/chat/kvkk.d.ts.map +0 -1
  196. package/dist/chat/locales/en.d.ts.map +0 -1
  197. package/dist/chat/locales/index.d.ts.map +0 -1
  198. package/dist/chat/locales/tr.d.ts.map +0 -1
  199. package/dist/chat/panel-manager.d.ts.map +0 -1
  200. package/dist/chat/session-persistence.d.ts.map +0 -1
  201. package/dist/chat/stream-error-display.d.ts.map +0 -1
  202. package/dist/chat/types.d.ts.map +0 -1
  203. package/dist/chat/utils/chat-presentation-debug.d.ts.map +0 -1
  204. package/dist/chat/utils/get-chat-scroll-element.d.ts.map +0 -1
  205. package/dist/chat/utils/ui.d.ts.map +0 -1
  206. package/dist/chat-CtfmY7kp.js +0 -7047
  207. package/dist/chat-CtfmY7kp.js.map +0 -1
  208. package/dist/chat-sSkxxKuL.cjs +0 -94
  209. package/dist/chat-sSkxxKuL.cjs.map +0 -1
  210. package/dist/chat.iife.js.map +0 -1
  211. package/dist/common/action-router.d.ts.map +0 -1
  212. package/dist/common/activity-tracker.d.ts.map +0 -1
  213. package/dist/common/analytics-events.d.ts.map +0 -1
  214. package/dist/common/analytics.d.ts.map +0 -1
  215. package/dist/common/api-paths.d.ts.map +0 -1
  216. package/dist/common/client.d.ts.map +0 -1
  217. package/dist/common/communication-bridge.d.ts.map +0 -1
  218. package/dist/common/config-schema.d.ts.map +0 -1
  219. package/dist/common/connection-warning.d.ts.map +0 -1
  220. package/dist/common/consulting-sources.d.ts.map +0 -1
  221. package/dist/common/context.d.ts.map +0 -1
  222. package/dist/common/customization-factories.d.ts.map +0 -1
  223. package/dist/common/debug.d.ts.map +0 -1
  224. package/dist/common/events.d.ts.map +0 -1
  225. package/dist/common/ga-datalayer.d.ts.map +0 -1
  226. package/dist/common/global-error-toast.d.ts.map +0 -1
  227. package/dist/common/index.d.ts.map +0 -1
  228. package/dist/common/indexed-db.d.ts.map +0 -1
  229. package/dist/common/native-webview.d.ts.map +0 -1
  230. package/dist/common/overlay.d.ts.map +0 -1
  231. package/dist/common/page-detect.d.ts.map +0 -1
  232. package/dist/common/pill-launcher.d.ts.map +0 -1
  233. package/dist/common/preflight.d.ts.map +0 -1
  234. package/dist/common/price-formatter.d.ts.map +0 -1
  235. package/dist/common/product-utils.d.ts.map +0 -1
  236. package/dist/common/protocol-adapter.d.ts.map +0 -1
  237. package/dist/common/renderer/dom.d.ts.map +0 -1
  238. package/dist/common/renderer/index.d.ts.map +0 -1
  239. package/dist/common/renderer/overrides.d.ts.map +0 -1
  240. package/dist/common/renderer/registry.d.ts.map +0 -1
  241. package/dist/common/renderer/types.d.ts.map +0 -1
  242. package/dist/common/safe-html.d.ts.map +0 -1
  243. package/dist/common/skeleton.d.ts.map +0 -1
  244. package/dist/common/streaming.d.ts.map +0 -1
  245. package/dist/common/suggested-search-keywords.d.ts.map +0 -1
  246. package/dist/common/theme-utils.d.ts.map +0 -1
  247. package/dist/common/tts-player.d.ts.map +0 -1
  248. package/dist/common/types.d.ts.map +0 -1
  249. package/dist/common/ui-theme.d.ts.map +0 -1
  250. package/dist/common/uuidv7.d.ts.map +0 -1
  251. package/dist/common/voice-input.d.ts.map +0 -1
  252. package/dist/common/widget-base.d.ts.map +0 -1
  253. package/dist/common-C9GYMjJY.js +0 -357
  254. package/dist/common-C9GYMjJY.js.map +0 -1
  255. package/dist/common-CSWRku57.cjs +0 -2
  256. package/dist/common-CSWRku57.cjs.map +0 -1
  257. package/dist/connection-warning-BF8r3_5W.js +0 -96
  258. package/dist/connection-warning-BF8r3_5W.js.map +0 -1
  259. package/dist/connection-warning-Dlirb_Pi.cjs +0 -2
  260. package/dist/connection-warning-Dlirb_Pi.cjs.map +0 -1
  261. package/dist/ga-datalayer-DSVuycfp.cjs +0 -48
  262. package/dist/ga-datalayer-DSVuycfp.cjs.map +0 -1
  263. package/dist/ga-datalayer-DygUbUWr.js +0 -915
  264. package/dist/ga-datalayer-DygUbUWr.js.map +0 -1
  265. package/dist/index.d.ts.map +0 -1
  266. package/dist/native/index.d.ts.map +0 -1
  267. package/dist/native-webview-BHewgko1.js +0 -547
  268. package/dist/native-webview-BHewgko1.js.map +0 -1
  269. package/dist/native-webview-C_gxZA79.cjs +0 -2
  270. package/dist/native-webview-C_gxZA79.cjs.map +0 -1
  271. package/dist/native.iife.js.map +0 -1
  272. package/dist/product-utils-BEnINMdx.cjs +0 -2
  273. package/dist/product-utils-BEnINMdx.cjs.map +0 -1
  274. package/dist/product-utils-BUalkWz3.js +0 -45
  275. package/dist/product-utils-BUalkWz3.js.map +0 -1
  276. package/dist/qna/api.d.ts.map +0 -1
  277. package/dist/qna/catalog.d.ts.map +0 -1
  278. package/dist/qna/components/ButtonRow.d.ts.map +0 -1
  279. package/dist/qna/components/TextInput.d.ts.map +0 -1
  280. package/dist/qna/components/renderUISpec.d.ts.map +0 -1
  281. package/dist/qna/index.d.ts.map +0 -1
  282. package/dist/qna/locales/en.d.ts.map +0 -1
  283. package/dist/qna/locales/index.d.ts.map +0 -1
  284. package/dist/qna/locales/tr.d.ts.map +0 -1
  285. package/dist/qna/normalize-ui-specs.d.ts.map +0 -1
  286. package/dist/qna/types.d.ts.map +0 -1
  287. package/dist/qna-BBZogvdp.js +0 -672
  288. package/dist/qna-BBZogvdp.js.map +0 -1
  289. package/dist/qna-d7DnJ0pP.cjs +0 -2
  290. package/dist/qna-d7DnJ0pP.cjs.map +0 -1
  291. package/dist/qna.iife.js.map +0 -1
  292. package/dist/schemas-C-flaqAd.cjs +0 -41
  293. package/dist/schemas-C-flaqAd.cjs.map +0 -1
  294. package/dist/schemas-CKfd_Bqh.js +0 -3941
  295. package/dist/schemas-CKfd_Bqh.js.map +0 -1
  296. package/dist/simbut/index.d.ts.map +0 -1
  297. package/dist/simbut/locales.d.ts.map +0 -1
  298. package/dist/simbut/types.d.ts.map +0 -1
  299. package/dist/simbut-DG48EcoU.js +0 -68
  300. package/dist/simbut-DG48EcoU.js.map +0 -1
  301. package/dist/simbut-DHZFpGIA.cjs +0 -2
  302. package/dist/simbut-DHZFpGIA.cjs.map +0 -1
  303. package/dist/simbut.iife.js.map +0 -1
  304. package/dist/simrel/api.d.ts.map +0 -1
  305. package/dist/simrel/catalog.d.ts.map +0 -1
  306. package/dist/simrel/components/GroupTabs.d.ts.map +0 -1
  307. package/dist/simrel/components/ProductCard.d.ts.map +0 -1
  308. package/dist/simrel/components/ProductGrid.d.ts.map +0 -1
  309. package/dist/simrel/components/renderUISpec.d.ts.map +0 -1
  310. package/dist/simrel/index.d.ts.map +0 -1
  311. package/dist/simrel/locales/en.d.ts.map +0 -1
  312. package/dist/simrel/locales/index.d.ts.map +0 -1
  313. package/dist/simrel/locales/tr.d.ts.map +0 -1
  314. package/dist/simrel/types.d.ts.map +0 -1
  315. package/dist/simrel-BwZFl03Z.cjs +0 -2
  316. package/dist/simrel-BwZFl03Z.cjs.map +0 -1
  317. package/dist/simrel-D74BsZbA.js +0 -699
  318. package/dist/simrel-D74BsZbA.js.map +0 -1
  319. package/dist/simrel.iife.js.map +0 -1
@@ -1,547 +0,0 @@
1
- import { a as e, c as t, i as n, o as r, r as i, t as a } from "./schemas-CKfd_Bqh.js";
2
- import { I as o, M as s, b as c, z as l } from "./ga-datalayer-DygUbUWr.js";
3
- import { t as u } from "./chat-CtfmY7kp.js";
4
- import { t as d } from "./qna-BBZogvdp.js";
5
- import { t as f } from "./simrel-D74BsZbA.js";
6
- import { t as p } from "./simbut-DG48EcoU.js";
7
- //#region src/common/config-schema.ts
8
- var m = r({ enabled: i().default(!0) }), h = r({
9
- chat: t().optional(),
10
- qna: t().optional(),
11
- simrel: t().optional()
12
- }), g = r({}), _ = a([
13
- "none",
14
- "x-api-key-header",
15
- "bearer-header",
16
- "body-api-key"
17
- ]), ee = r({
18
- mode: _.default("none"),
19
- key: t().optional(),
20
- headerName: t().optional(),
21
- bodyField: t().default("api_key")
22
- }), v = r({
23
- enabled: i().default(!0),
24
- endpoint: t().default("/analytics"),
25
- auth: ee.default({
26
- mode: "none",
27
- bodyField: "api_key"
28
- }),
29
- fireAndForget: i().default(!0),
30
- useBeacon: i().default(!0),
31
- keepaliveFetch: i().default(!0),
32
- timeoutMs: e().int().positive().default(4e3),
33
- maxRetries: e().int().min(0).max(5).default(1)
34
- }), y = "__gengageWidgetsInit", b = r({
35
- idempotencyKey: t().default(y),
36
- requireDomReady: i().default(!0)
37
- }), x = a([
38
- "log-and-ignore",
39
- "throw",
40
- "delegate"
41
- ]), S = r({
42
- unknownActionPolicy: x.default("log-and-ignore"),
43
- allowScriptCall: i().default(!1)
44
- }), C = r({
45
- version: n("1", { error: "version must be \"1\"" }),
46
- accountId: t({ error: "accountId must be a non-empty string" }).min(1, { error: "accountId must be a non-empty string" }),
47
- middlewareUrl: t({ 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\")" }),
48
- locale: t().optional(),
49
- widgets: r({
50
- chat: m.default({ enabled: !0 }),
51
- qna: m.default({ enabled: !0 }),
52
- simrel: m.default({ enabled: !0 })
53
- }),
54
- mounts: h.default({}),
55
- transport: g.default({}),
56
- analytics: v.default({
57
- enabled: !0,
58
- endpoint: "/analytics",
59
- auth: {
60
- mode: "none",
61
- bodyField: "api_key"
62
- },
63
- fireAndForget: !0,
64
- useBeacon: !0,
65
- keepaliveFetch: !0,
66
- timeoutMs: 4e3,
67
- maxRetries: 1
68
- }),
69
- gtm: b.default({
70
- idempotencyKey: "__gengageWidgetsInit",
71
- requireDomReady: !0
72
- }),
73
- actionHandling: S.default({
74
- unknownActionPolicy: "log-and-ignore",
75
- allowScriptCall: !1
76
- })
77
- });
78
- function w(e) {
79
- c("config", "parsing account runtime config", e);
80
- let t = C.parse(e);
81
- return c("config", "config resolved", {
82
- accountId: t.accountId,
83
- middlewareUrl: t.middlewareUrl
84
- }), t;
85
- }
86
- function T(e) {
87
- return C.safeParse(e);
88
- }
89
- function E(e) {
90
- return w({
91
- version: "1",
92
- accountId: e.accountId,
93
- middlewareUrl: e.middlewareUrl,
94
- locale: e.locale,
95
- widgets: {
96
- chat: { enabled: !0 },
97
- qna: { enabled: !0 },
98
- simrel: { enabled: !0 }
99
- }
100
- });
101
- }
102
- //#endregion
103
- //#region src/common/overlay.ts
104
- var D = `${y}_overlay_`, te = "#gengage-qna", O = "#gengage-simrel", k = "#gengage-simbut";
105
- function A() {
106
- let e = window;
107
- return e.__gengageOverlayRegistry ||= {
108
- instances: {},
109
- pending: {}
110
- }, e.__gengageOverlayRegistry;
111
- }
112
- function j(e) {
113
- let t = { pageType: e.pageContext?.pageType ?? (e.sku === void 0 ? "other" : "pdp") }, n = e.pageContext;
114
- return n?.sku !== void 0 && (t.sku = n.sku), n?.price !== void 0 && (t.price = n.price), n?.categoryTree !== void 0 && (t.categoryTree = n.categoryTree), n?.url !== void 0 && (t.url = n.url), n?.extra !== void 0 && (t.extra = n.extra), e.sku !== void 0 && (t.sku = e.sku), t;
115
- }
116
- function M(e, t) {
117
- let n = {
118
- ...e,
119
- ...t,
120
- pageType: t.pageType ?? e.pageType
121
- };
122
- return t.sku === void 0 && e.sku !== void 0 && (n.sku = e.sku), n;
123
- }
124
- function N(e) {
125
- return e instanceof HTMLElement || document.querySelector(e) ? e : null;
126
- }
127
- function P(e) {
128
- return e.idempotencyKey ?? `${D}${e.accountId}`;
129
- }
130
- var F = class {
131
- constructor(e, t) {
132
- this.options = e, this.onDestroy = t, this._chat = null, this._qna = null, this._simrel = null, this._simbut = null, this._analyticsClient = null, this._offQnaWire = null, this._destroyed = !1, this._queue = Promise.resolve(), this._warnedQnaMountMissing = !1, this._warnedSimRelMountMissing = !1, this._warnedSimButMountMissing = !1, this._warnedSimButNoChat = !1, this.idempotencyKey = P(e), this.session = s(e.session), this._pageContext = j(e);
133
- }
134
- get chat() {
135
- return this._chat;
136
- }
137
- get qna() {
138
- return this._qna;
139
- }
140
- get simrel() {
141
- return this._simrel;
142
- }
143
- get simbut() {
144
- return this._simbut;
145
- }
146
- get analyticsClient() {
147
- return this._analyticsClient;
148
- }
149
- async init() {
150
- window.gengage || (window.gengage = {}), window.gengage.sessionId = this.session.sessionId, window.gengage.pageContext = this._pageContext, await this._initChat(), this.options.wireQnaToChat !== !1 && (this._offQnaWire = o()), await this._syncPdpWidgets(), window.gengage.overlay = this;
151
- }
152
- openChat(e) {
153
- this._chat?.open(e);
154
- }
155
- closeChat() {
156
- this._chat?.close();
157
- }
158
- async updateContext(e) {
159
- this._destroyed || await this._enqueue(async () => {
160
- this._pageContext = M(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();
161
- });
162
- }
163
- async updateSku(e, t = "pdp") {
164
- await this.updateContext({
165
- sku: e,
166
- pageType: t
167
- });
168
- }
169
- destroy() {
170
- 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());
171
- }
172
- async _initChat() {
173
- if (this.options.chat?.enabled === !1) return;
174
- let e = this.options.middlewareUrl, t = {
175
- accountId: this.options.accountId,
176
- middlewareUrl: e,
177
- session: this.session,
178
- pageContext: this._pageContext,
179
- variant: this.options.chat?.variant ?? "floating"
180
- };
181
- this.options.theme !== void 0 && (t.theme = this.options.theme), this.options.locale !== void 0 && (t.locale = this.options.locale), this.options.pricing !== void 0 && (t.pricing = this.options.pricing), this.options.chat?.mountTarget !== void 0 && (t.mountTarget = this.options.chat.mountTarget), this.options.chat?.pillLauncher !== void 0 && (t.pillLauncher = this.options.chat.pillLauncher), this.options.chat?.launcherImageUrl === void 0 ? this.options.chat?.launcherSvg !== void 0 && (t.launcherSvg = this.options.chat.launcherSvg) : t.launcherImageUrl = this.options.chat.launcherImageUrl, this.options.chat?.headerTitle !== void 0 && (t.headerTitle = this.options.chat.headerTitle), this.options.chat?.headerAvatarUrl !== void 0 && (t.headerAvatarUrl = this.options.chat.headerAvatarUrl), this.options.chat?.headerBadge !== void 0 && (t.headerBadge = this.options.chat.headerBadge), this.options.chat?.headerCartUrl !== void 0 && (t.headerCartUrl = this.options.chat.headerCartUrl), this.options.chat?.headerFavoritesToggle !== void 0 && (t.headerFavoritesToggle = this.options.chat.headerFavoritesToggle), this.options.chat?.onFavoritesClick !== void 0 && (t.onFavoritesClick = this.options.chat.onFavoritesClick), this.options.chat?.hideMobileLauncher !== void 0 && (t.hideMobileLauncher = this.options.chat.hideMobileLauncher), this.options.chat?.mobileBreakpoint !== void 0 && (t.mobileBreakpoint = this.options.chat.mobileBreakpoint), this.options.chat?.mobileInitialState !== void 0 && (t.mobileInitialState = this.options.chat.mobileInitialState), this.options.chat?.i18n !== void 0 && (t.i18n = this.options.chat.i18n), this.options.chat?.actionHandling !== void 0 && (t.actionHandling = this.options.chat.actionHandling), this.options.chat?.renderer !== void 0 && (t.renderer = this.options.chat.renderer), this.options.chat?.productDetailsExtended !== void 0 && (t.productDetailsExtended = this.options.chat.productDetailsExtended), this.options.chat?.isDemoWebsite !== void 0 && (t.isDemoWebsite = this.options.chat.isDemoWebsite), this.options.chat?.productPriceUi !== void 0 && (t.productPriceUi = this.options.chat.productPriceUi), this.options.onScriptCall !== void 0 && (t.onScriptCall = this.options.onScriptCall), this.options.onAddToCart !== void 0 && (t.onAddToCart = this.options.onAddToCart), this.options.chat?.onOpen !== void 0 && (t.onOpen = this.options.chat.onOpen), this.options.chat?.onClose !== void 0 && (t.onClose = this.options.chat.onClose), this._chat = new u(), await this._chat.init(t);
182
- }
183
- async _syncPdpWidgets() {
184
- if (this._destroyed) return;
185
- let e = this._pageContext.sku;
186
- if (!(this._pageContext.pageType === "pdp" && e !== void 0 && e.length > 0)) {
187
- this._qna?.hide(), this._simrel?.hide(), this._simbut?.hide();
188
- return;
189
- }
190
- let t = this.options.middlewareUrl;
191
- if (this.options.qna?.enabled !== !1) {
192
- let n = this.options.qna?.mountTarget ?? te, r = N(n);
193
- if (r) if (this._warnedQnaMountMissing = !1, this._qna) this._qna.show(), this._qna.update({
194
- pageType: "pdp",
195
- sku: e
196
- });
197
- else {
198
- let n = new d(), i = {
199
- accountId: this.options.accountId,
200
- middlewareUrl: t,
201
- session: this.session,
202
- pageContext: {
203
- pageType: "pdp",
204
- sku: e
205
- },
206
- mountTarget: r
207
- };
208
- this.options.theme !== void 0 && (i.theme = this.options.theme), this.options.qna?.ctaText !== void 0 && (i.ctaText = this.options.qna.ctaText), this.options.qna?.hideButtonRowCta !== void 0 && (i.hideButtonRowCta = this.options.qna.hideButtonRowCta), this.options.qna?.inputPlaceholder !== void 0 && (i.inputPlaceholder = this.options.qna.inputPlaceholder), this.options.qna?.i18n !== void 0 && (i.i18n = this.options.qna.i18n), this.options.qna?.renderer !== void 0 && (i.renderer = this.options.qna.renderer);
209
- let a = this.options.qna?.headerTitle ?? this.options.qna?.headingTitle;
210
- a !== void 0 && (i.headerTitle = a), await n.init(i), this._qna = n;
211
- }
212
- else this._qna?.destroy(), this._qna = null, this._warnedQnaMountMissing ||= (console.warn(`[gengage] QNA mount target not found: ${n}`), !0);
213
- } else this._qna?.destroy(), this._qna = null;
214
- if (this.options.simrel?.enabled !== !1) {
215
- let n = this.options.simrel?.mountTarget ?? O, r = N(n);
216
- if (r) if (this._warnedSimRelMountMissing = !1, this._simrel) this._simrel.show(), this._simrel.update({
217
- pageType: "pdp",
218
- sku: e
219
- });
220
- else {
221
- let n = new f(), i = {
222
- accountId: this.options.accountId,
223
- middlewareUrl: t,
224
- session: this.session,
225
- sku: e,
226
- mountTarget: r
227
- };
228
- this.options.theme !== void 0 && (i.theme = this.options.theme), this.options.pricing !== void 0 && (i.pricing = this.options.pricing), this.options.simrel?.discountType !== void 0 && (i.discountType = this.options.simrel.discountType), this.options.simrel?.renderCardElement !== void 0 && (i.renderCardElement = this.options.simrel.renderCardElement), this.options.simrel?.renderer !== void 0 && (i.renderer = this.options.simrel.renderer), this.options.onAddToCart !== void 0 && (i.onAddToCart = this.options.onAddToCart), this.options.onProductNavigate === void 0 ? i.onProductNavigate = (e, t, n) => {
229
- l(e) && (this._chat?.saveSession(n ?? this.session.sessionId, t), window.location.href = e);
230
- } : i.onProductNavigate = this.options.onProductNavigate, await n.init(i), this._simrel = n;
231
- }
232
- else this._simrel?.destroy(), this._simrel = null, this._warnedSimRelMountMissing ||= (console.warn(`[gengage] SimRel mount target not found: ${n}`), !0);
233
- } else this._simrel?.destroy(), this._simrel = null;
234
- if (this.options.simbut && this.options.simbut.enabled !== !1) {
235
- let n = this.options.simbut.mountTarget ?? k, r = N(n), i = this._chat ?? this.options.simbut.onFindSimilar;
236
- if (r && i) if (this._warnedSimButMountMissing = !1, this._warnedSimButNoChat = !1, this._simbut) this._simbut.show(), this._simbut.setChat(this._chat), this._simbut.update({
237
- pageType: "pdp",
238
- sku: e
239
- });
240
- else {
241
- let n = new p(), i = {
242
- accountId: this.options.accountId,
243
- middlewareUrl: t,
244
- session: this.session,
245
- pageContext: {
246
- pageType: "pdp",
247
- sku: e
248
- },
249
- mountTarget: r,
250
- chat: this._chat
251
- };
252
- this.options.theme !== void 0 && (i.theme = this.options.theme), this.options.locale !== void 0 && (i.locale = this.options.locale), this.options.simbut.imageUrl !== void 0 && (i.imageUrl = this.options.simbut.imageUrl), this.options.simbut.i18n !== void 0 && (i.i18n = this.options.simbut.i18n), this.options.simbut.onFindSimilar !== void 0 && (i.onFindSimilar = this.options.simbut.onFindSimilar), await n.init(i), this._simbut = n;
253
- }
254
- else this._simbut?.destroy(), this._simbut = null, !r && !this._warnedSimButMountMissing ? (console.warn(`[gengage] SimBut mount target not found: ${n}`), this._warnedSimButMountMissing = !0) : !i && !this._warnedSimButNoChat && (console.warn("[gengage] SimBut requires chat to be enabled or simbut.onFindSimilar"), this._warnedSimButNoChat = !0);
255
- } else this._simbut?.destroy(), this._simbut = null;
256
- }
257
- _enqueue(e) {
258
- let t = this._queue.then(e);
259
- return this._queue = t.catch((e) => {}), t;
260
- }
261
- };
262
- async function I(e) {
263
- let t = P(e), n = A(), r = n.instances[t];
264
- if (r) return r;
265
- let i = n.pending[t];
266
- if (i) return i;
267
- let a = new F(e, () => {
268
- let e = A();
269
- delete e.instances[t], delete e.pending[t];
270
- }), o = a.init().then(() => (n.instances[t] = a, delete n.pending[t], a)).catch((e) => {
271
- throw delete n.pending[t], e;
272
- });
273
- return n.pending[t] = o, o;
274
- }
275
- function L(e) {
276
- return A().instances[e] ?? null;
277
- }
278
- function R(e) {
279
- L(e)?.destroy();
280
- }
281
- function z(e) {
282
- return `${D}${e}`;
283
- }
284
- //#endregion
285
- //#region src/common/native-webview.ts
286
- var B = [
287
- "gengage:chat:open",
288
- "gengage:chat:close",
289
- "gengage:chat:ready",
290
- "gengage:chat:add-to-cart",
291
- "gengage:qna:action",
292
- "gengage:qna:open-chat",
293
- "gengage:similar:product-click",
294
- "gengage:similar:add-to-cart",
295
- "gengage:global:error",
296
- "gengage:context:update"
297
- ], V = 32, H = "#gengage-qna", U = "#gengage-simrel";
298
- function W(e) {
299
- return e;
300
- }
301
- function G(e) {
302
- let t = e;
303
- if (typeof e == "string") {
304
- let n = e.trim();
305
- if (n.length === 0) return null;
306
- if (!n.startsWith("{") && !n.startsWith("[")) return { type: n };
307
- try {
308
- t = JSON.parse(n);
309
- } catch {
310
- return null;
311
- }
312
- }
313
- if (!t || typeof t != "object") return null;
314
- let n = t, r = [
315
- n.type,
316
- n.command,
317
- n.action,
318
- n.event
319
- ].find((e) => typeof e == "string" && e.length > 0);
320
- if (!r) return null;
321
- let i = n.payload;
322
- if (i === void 0 && "data" in n && (i = n.data), r === "setSession" && i === void 0) {
323
- let e = {};
324
- typeof n.sessionId == "string" && (e.sessionId = n.sessionId), typeof n.userId == "string" && (e.userId = n.userId), (e.sessionId !== void 0 || e.userId !== void 0) && (i = e);
325
- }
326
- return i === void 0 ? { type: r } : {
327
- type: r,
328
- payload: i
329
- };
330
- }
331
- function K(e) {
332
- if (typeof e == "string" && e.length > 0) return { sku: e };
333
- if (e && typeof e == "object" && "sku" in e) {
334
- let t = e.sku;
335
- if (typeof t == "string" && t.length > 0) {
336
- let n = e.pageType;
337
- return n === void 0 ? { sku: t } : {
338
- sku: t,
339
- pageType: n
340
- };
341
- }
342
- }
343
- return null;
344
- }
345
- function q(e, t) {
346
- return t instanceof HTMLElement ? !0 : typeof t == "string" ? e.document.querySelector(t) !== null : !1;
347
- }
348
- function J(e, t, n) {
349
- if (t instanceof HTMLElement || q(e, t) || typeof t != "string") return t;
350
- if (t.startsWith("#")) {
351
- let n = t.slice(1);
352
- if (n.length > 0) {
353
- let t = e.document.getElementById(n);
354
- if (t) return t;
355
- let r = e.document.createElement("div");
356
- return r.id = n, e.document.body.appendChild(r), r;
357
- }
358
- }
359
- let r = e.document.getElementById(n);
360
- if (r) return r;
361
- let i = e.document.createElement("div");
362
- return i.id = n, e.document.body.appendChild(i), i;
363
- }
364
- function Y(e, t) {
365
- let n = W(e).webkit?.messageHandlers?.[t];
366
- return n && typeof n.postMessage == "function" ? n.postMessage.bind(n) : null;
367
- }
368
- function X(e, t) {
369
- let n = e[t];
370
- return n && typeof n == "object" && typeof n.postMessage == "function" ? n : null;
371
- }
372
- function Z(e = {}) {
373
- let t = e.win ?? window, n = e.iosHandlerName ?? "gengage", r = e.androidInterfaceName ?? "GengageNative", i = e.reactNativeInterfaceName ?? "ReactNativeWebView";
374
- return Y(t, n) ? "ios" : X(t, r) ? "android" : X(t, i) ? "react-native" : "browser";
375
- }
376
- function Q(e, t = {}) {
377
- let n = t.win ?? window;
378
- if (e.sessionId !== void 0) {
379
- n.__gengageSessionId = e.sessionId, n.gengage ||= {}, n.gengage.sessionId = e.sessionId;
380
- try {
381
- n.sessionStorage.setItem("gengage_session_id", e.sessionId);
382
- } catch {}
383
- }
384
- if (e.userId !== void 0) {
385
- n.gengage ||= {};
386
- let t = n.gengage, r = t.session ?? {};
387
- r.userId = e.userId, t.session = r;
388
- }
389
- }
390
- function $(e = {}) {
391
- let t = e.win ?? window, n = W(t);
392
- if (n.gengageNative) return n.gengageNative;
393
- let r = e.iosHandlerName ?? "gengage", i = e.androidInterfaceName ?? "GengageNative", a = e.reactNativeInterfaceName ?? "ReactNativeWebView", o = e.trackedEvents ?? [...B], s = Z({
394
- win: t,
395
- iosHandlerName: r,
396
- androidInterfaceName: i,
397
- reactNativeInterfaceName: a
398
- }), c = t.gengage?.overlay ?? null, l = [], u = (e, n) => {
399
- let o = n === void 0 ? { type: e } : {
400
- type: e,
401
- payload: n
402
- };
403
- if (s === "ios") {
404
- Y(t, r)?.(o);
405
- return;
406
- }
407
- if (s === "android") {
408
- X(t, i)?.postMessage(JSON.stringify(o));
409
- return;
410
- }
411
- if (s === "react-native") {
412
- X(t, a)?.postMessage(JSON.stringify(o));
413
- return;
414
- }
415
- }, d = (e) => {
416
- let t = e.detail;
417
- !t || typeof t.namespace != "string" || typeof t.type != "string" || u("bridge_message", {
418
- namespace: t.namespace,
419
- type: t.type,
420
- payload: t.payload
421
- });
422
- };
423
- t.addEventListener("gengage:bridge:message", d);
424
- let f = o.map((e) => {
425
- let n = (t) => {
426
- let n = t.detail;
427
- u("widget_event", {
428
- event: e,
429
- detail: n
430
- });
431
- };
432
- return t.addEventListener(e, n), {
433
- event: e,
434
- handler: n
435
- };
436
- }), p = (e) => {
437
- l.length >= V && l.shift(), l.push(e);
438
- }, m = () => {
439
- if (!c || l.length === 0) return;
440
- let e = l.splice(0, l.length);
441
- for (let t of e) h(t);
442
- }, h = (n) => {
443
- let r = G(n);
444
- if (!r || typeof r.type != "string") {
445
- console.warn("[gengage:native-bridge] Invalid message:", n);
446
- return;
447
- }
448
- let i = r.type, a = r.payload;
449
- switch (i) {
450
- case "openChat":
451
- c ? c.openChat(a && typeof a == "object" ? a : a === "half" || a === "full" ? { state: a } : void 0) : p(r);
452
- return;
453
- case "closeChat":
454
- c ? c.closeChat() : p(r);
455
- return;
456
- case "updateContext":
457
- c && a && typeof a == "object" ? c.updateContext(a) : c ? console.warn("[gengage:native-bridge] updateContext: missing payload") : p(r);
458
- return;
459
- case "updateSku": {
460
- let e = K(a);
461
- if (c && e) {
462
- c.updateSku(e.sku, e.pageType);
463
- return;
464
- }
465
- c ? console.warn("[gengage:native-bridge] updateSku: missing sku") : p(r);
466
- return;
467
- }
468
- case "setSession":
469
- a && typeof a == "object" && Q(a, { win: t });
470
- return;
471
- case "destroy":
472
- c?.destroy();
473
- return;
474
- default: t.postMessage({
475
- gengage: "native",
476
- type: i,
477
- payload: a
478
- }, t.location.origin), e.logUnhandled && console.warn("[gengage:native-bridge] Unhandled inbound type forwarded:", i);
479
- }
480
- }, g = {
481
- env: s,
482
- sendToNative: u,
483
- receive: h,
484
- setController(e) {
485
- c = e, m();
486
- },
487
- destroy() {
488
- t.removeEventListener("gengage:bridge:message", d);
489
- for (let e of f) t.removeEventListener(e.event, e.handler);
490
- l.splice(0, l.length), W(t).gengageNative === g && delete W(t).gengageNative;
491
- }
492
- };
493
- return n.gengageNative = g, g;
494
- }
495
- async function ne(e) {
496
- let { nativeBridge: t, emitReadyEvent: n = !0, ...r } = e, i = $(t), a = { ...r };
497
- a.onAddToCart ||= (e) => {
498
- i.sendToNative("addToCart", {
499
- sku: e.sku,
500
- quantity: e.quantity,
501
- cartCode: e.cartCode
502
- });
503
- }, a.onProductNavigate ||= (e, t, n) => {
504
- i.sendToNative("productNavigate", {
505
- url: e,
506
- sku: t,
507
- sessionId: n
508
- });
509
- };
510
- let o = a.qna?.enabled === !0 || a.qna?.mountTarget !== void 0;
511
- if (a.qna?.enabled !== !1) if (o) {
512
- let e = J(window, a.qna?.mountTarget ?? H, "gengage-qna");
513
- a.qna = {
514
- ...a.qna,
515
- enabled: !0,
516
- mountTarget: e
517
- };
518
- } else q(window, H) || (a.qna = { enabled: !1 });
519
- let s = a.simrel?.enabled === !0 || a.simrel?.mountTarget !== void 0;
520
- if (a.simrel?.enabled !== !1) if (s) {
521
- let e = J(window, a.simrel?.mountTarget ?? U, "gengage-simrel");
522
- a.simrel = {
523
- ...a.simrel,
524
- enabled: !0,
525
- mountTarget: e
526
- };
527
- } else q(window, U) || (a.simrel = { enabled: !1 });
528
- let c = await I(a);
529
- return i.setController(c), n && i.sendToNative("ready", {
530
- sessionId: c.session.sessionId,
531
- widgets: {
532
- chat: c.chat !== null,
533
- qna: c.qna !== null,
534
- simrel: c.simrel !== null
535
- }
536
- }), {
537
- controller: c,
538
- bridge: i,
539
- destroy() {
540
- c.destroy(), i.destroy();
541
- }
542
- };
543
- }
544
- //#endregion
545
- export { ne as a, L as c, _ as d, x as f, T as h, Z as i, I as l, w as m, Q as n, z as o, E as p, $ as r, R as s, B as t, C as u };
546
-
547
- //# sourceMappingURL=native-webview-BHewgko1.js.map