ai12z 3.16.2 → 3.17.1-alpha.2

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 (195) hide show
  1. package/dist/cjs/ai12z-beacon.cjs.entry.js +2 -2
  2. package/dist/cjs/ai12z-bot.cjs.entry.js +50 -41
  3. package/dist/cjs/ai12z-category_2.cjs.entry.js +21 -13
  4. package/dist/cjs/ai12z-chat-message.cjs.entry.js +4 -4
  5. package/dist/cjs/ai12z-chat_2.cjs.entry.js +21 -21
  6. package/dist/cjs/ai12z-container.cjs.entry.js +4 -4
  7. package/dist/cjs/ai12z-cta.cjs.entry.js +8 -9
  8. package/dist/cjs/ai12z-form.cjs.entry.js +3 -3
  9. package/dist/cjs/ai12z-inline-search.cjs.entry.js +5 -5
  10. package/dist/cjs/ai12z-knowledge-box.cjs.entry.js +14 -11
  11. package/dist/cjs/ai12z-search-panel.cjs.entry.js +1 -1
  12. package/dist/cjs/ai12z-spinner.cjs.entry.js +1 -1
  13. package/dist/cjs/{beacon-Bhd49ADQ.js → beacon-DwOvY6Ne.js} +26 -36
  14. package/dist/cjs/chat-avatar_6.cjs.entry.js +12 -12
  15. package/dist/cjs/chatbot-history_2.cjs.entry.js +1 -1
  16. package/dist/cjs/{ctaHelpers-DL-PGlAx.js → ctaHelpers-CdztrD6A.js} +1 -1
  17. package/dist/cjs/dynamic-form.cjs.entry.js +2 -2
  18. package/dist/cjs/image-uploader_2.cjs.entry.js +1 -1
  19. package/dist/cjs/{index-CHyfwy-h.js → index-B6xfVjPU.js} +1 -1
  20. package/dist/cjs/index.cjs.js +11 -11
  21. package/dist/cjs/item-list.cjs.entry.js +2 -2
  22. package/dist/cjs/{keyboard-shortcuts-BfEhZKK-.js → keyboard-shortcuts-CBUd9KfQ.js} +2 -2
  23. package/dist/cjs/library.cjs.js +1 -1
  24. package/dist/cjs/loader.cjs.js +1 -1
  25. package/dist/cjs/{parseHelper-B8pslVtS.js → parseHelper-BuoIRCbd.js} +1 -1
  26. package/dist/cjs/{processCarouselData-DVJtwUsv.js → processCarouselData-BXglENd8.js} +1 -1
  27. package/dist/cjs/{reCaptchaHelpers-Djq71pt4.js → reCaptchaHelpers-DIDQT22p.js} +1 -1
  28. package/dist/cjs/search-results-page.cjs.entry.js +32 -36
  29. package/dist/cjs/{socket-service-Dqfi4_qU.js → socket-service-j9VBg1pS.js} +1 -1
  30. package/dist/cjs/{styleSheetRegistry-CsHfoS0d.js → styleSheetRegistry-kcL2qS1d.js} +1 -1
  31. package/dist/cjs/{surveyHelpers-D0AfNAN8.js → surveyHelpers-B9t5lxy4.js} +1 -1
  32. package/dist/cjs/{utils-BsCPba57.js → utils-DZMolZh2.js} +3 -0
  33. package/dist/collection/components/ai12z-bot/ai12z-bot.js +41 -32
  34. package/dist/collection/components/ai12z-bot/chat-history.js +1 -1
  35. package/dist/collection/components/ai12z-bot/components/hamburger-menu/hamburger-menu.js +4 -4
  36. package/dist/collection/components/ai12z-bot/components/interaction-buttons/interaction-buttons.js +5 -5
  37. package/dist/collection/components/ai12z-bot/components/liveagent-chat/liveagent-chat.js +1 -1
  38. package/dist/collection/components/ai12z-bot/components/typing-indicator/typing-indicator.js +1 -1
  39. package/dist/collection/components/ai12z-container/ai12z-container.js +1 -1
  40. package/dist/collection/components/ai12z-cta/ai12z-cta.js +3 -4
  41. package/dist/collection/components/ai12z-cta/components/Category.js +12 -4
  42. package/dist/collection/components/ai12z-cta/components/Chat.js +3 -3
  43. package/dist/collection/components/ai12z-cta/components/DynamicForm.js +1 -1
  44. package/dist/collection/components/ai12z-cta/components/audiorecorder/audio-recorder.js +7 -6
  45. package/dist/collection/components/ai12z-form/ai12z-form.js +1 -1
  46. package/dist/collection/components/ai12z-inline-search/ai12z-inline-search.js +3 -3
  47. package/dist/collection/components/ai12z-knowledge-box/ai12z-knowledge-box.js +8 -5
  48. package/dist/collection/components/ai12z-knowledge-box/components/ai12z-chat-message.js +2 -2
  49. package/dist/collection/components/ai12z-search-panel/search-results-view.js +27 -31
  50. package/dist/collection/components/input/ImageUploader.js +1 -1
  51. package/dist/collection/components/input/Input.js +9 -9
  52. package/dist/collection/components/spinner/Spinner.js +1 -1
  53. package/dist/collection/utils/beacon.js +25 -35
  54. package/dist/collection/utils/utils.js +3 -0
  55. package/dist/components/ai12z-beacon.js +1 -1
  56. package/dist/components/ai12z-bot.js +1 -1
  57. package/dist/components/ai12z-category.js +1 -1
  58. package/dist/components/ai12z-chat-message.js +1 -1
  59. package/dist/components/ai12z-chat.js +1 -1
  60. package/dist/components/ai12z-container.js +1 -1
  61. package/dist/components/ai12z-cta.js +1 -1
  62. package/dist/components/ai12z-form.js +1 -1
  63. package/dist/components/ai12z-inline-search.js +1 -1
  64. package/dist/components/ai12z-input-form.js +1 -1
  65. package/dist/components/ai12z-knowledge-box.js +1 -1
  66. package/dist/components/ai12z-search-panel.js +1 -1
  67. package/dist/components/ai12z-spinner.js +1 -1
  68. package/dist/components/audio-recorder.js +1 -1
  69. package/dist/components/chatbot-history.js +1 -1
  70. package/dist/components/dynamic-form.js +1 -1
  71. package/dist/components/hamburger-menu.js +1 -1
  72. package/dist/components/image-uploader.js +1 -1
  73. package/dist/components/index.js +1 -1
  74. package/dist/components/interaction-buttons.js +1 -1
  75. package/dist/components/item-list.js +1 -1
  76. package/dist/components/live-agent-chat.js +1 -1
  77. package/dist/components/{p-c6Z5KXDQ.js → p--Lo7lrbl.js} +1 -1
  78. package/dist/components/p-4jDAiNAG.js +1 -0
  79. package/dist/components/{p-BRLTYejK.js → p-6PVjY_1U.js} +1 -1
  80. package/dist/components/{p-fVj5IyS0.js → p-B2V-wD9o.js} +1 -1
  81. package/dist/components/{p-Cywgam3s.js → p-BJOnT4k4.js} +1 -1
  82. package/dist/components/p-BL-11f6q.js +1 -0
  83. package/dist/components/{p-Dcj3Mokc.js → p-BO_7DTeV.js} +1 -1
  84. package/dist/components/{p-9LYL2tKU.js → p-BSf2OXiK.js} +1 -1
  85. package/dist/components/p-Bt_KWVYc.js +1 -0
  86. package/dist/components/p-Buj5Gn09.js +1 -0
  87. package/dist/components/p-C01IHdTU.js +1 -0
  88. package/dist/components/p-C0ycOUZ8.js +1 -0
  89. package/dist/components/{p-CWoExQML.js → p-C7OMI_aS.js} +1 -1
  90. package/dist/components/p-C92f-4Xe.js +1 -0
  91. package/dist/components/{p-DOynMJxg.js → p-CNxI_jB-.js} +1 -1
  92. package/dist/components/{p-BeRVlX-3.js → p-CW_iO9zy.js} +1 -1
  93. package/dist/components/p-CaMH5wYq.js +1 -0
  94. package/dist/components/{p-BO2WmSX3.js → p-CtGazkHl.js} +1 -1
  95. package/dist/components/{p-D_3pXSAZ.js → p-D0PteXe-.js} +1 -1
  96. package/dist/components/{p-UVgSZ7fz.js → p-D338smYm.js} +1 -1
  97. package/dist/components/p-DMdu_2Pr.js +2 -0
  98. package/dist/components/p-DVE50Spy.js +1 -0
  99. package/dist/components/{p-Dc7unp-V.js → p-DjI5tnxC.js} +1 -1
  100. package/dist/components/p-Ds7D6ZCB.js +1 -0
  101. package/dist/components/p-Dx_iq8hO.js +1 -0
  102. package/dist/components/{p-BjX5cCOG.js → p-HK5PYpCA.js} +1 -1
  103. package/dist/components/{p-DURIlC18.js → p-M51H23z5.js} +1 -1
  104. package/dist/components/{p-ClSkLu41.js → p-ZASkuPTc.js} +1 -1
  105. package/dist/components/privacy-modal.js +1 -1
  106. package/dist/components/search-results-page.js +1 -1
  107. package/dist/components/typing-indicator.js +1 -1
  108. package/dist/esm/ai12z-beacon.entry.js +2 -2
  109. package/dist/esm/ai12z-bot.entry.js +50 -41
  110. package/dist/esm/ai12z-category_2.entry.js +21 -13
  111. package/dist/esm/ai12z-chat-message.entry.js +4 -4
  112. package/dist/esm/ai12z-chat_2.entry.js +21 -21
  113. package/dist/esm/ai12z-container.entry.js +4 -4
  114. package/dist/esm/ai12z-cta.entry.js +8 -9
  115. package/dist/esm/ai12z-form.entry.js +3 -3
  116. package/dist/esm/ai12z-inline-search.entry.js +5 -5
  117. package/dist/esm/ai12z-knowledge-box.entry.js +14 -11
  118. package/dist/esm/ai12z-search-panel.entry.js +1 -1
  119. package/dist/esm/ai12z-spinner.entry.js +1 -1
  120. package/dist/esm/{beacon-BLOfGU2-.js → beacon-DOd-Eyt3.js} +26 -36
  121. package/dist/esm/chat-avatar_6.entry.js +12 -12
  122. package/dist/esm/chatbot-history_2.entry.js +1 -1
  123. package/dist/esm/{ctaHelpers-GH6upqgA.js → ctaHelpers-CA0BowjW.js} +1 -1
  124. package/dist/esm/dynamic-form.entry.js +2 -2
  125. package/dist/esm/image-uploader_2.entry.js +1 -1
  126. package/dist/esm/{index-CjSLTZFw.js → index-DhYLboA_.js} +1 -1
  127. package/dist/esm/index.js +11 -11
  128. package/dist/esm/item-list.entry.js +2 -2
  129. package/dist/esm/{keyboard-shortcuts-DNhwh88a.js → keyboard-shortcuts-IO5j9uXN.js} +2 -2
  130. package/dist/esm/library.js +1 -1
  131. package/dist/esm/loader.js +1 -1
  132. package/dist/esm/{parseHelper-B4cZLEeX.js → parseHelper-DD7WYvgn.js} +1 -1
  133. package/dist/esm/{processCarouselData-CgoPoIF_.js → processCarouselData-CAknSAMc.js} +1 -1
  134. package/dist/esm/{reCaptchaHelpers-O2ugKpWf.js → reCaptchaHelpers-CaQ3SVz2.js} +1 -1
  135. package/dist/esm/search-results-page.entry.js +32 -36
  136. package/dist/esm/{socket-service-B6aew9Me.js → socket-service-BOJYqySQ.js} +1 -1
  137. package/dist/esm/{styleSheetRegistry-DxStYIoa.js → styleSheetRegistry-CN6-rDNE.js} +1 -1
  138. package/dist/esm/{surveyHelpers-Cbq2vpWj.js → surveyHelpers-Bz38XWys.js} +1 -1
  139. package/dist/esm/{utils-qg8o2dBJ.js → utils-BRjWPcMA.js} +3 -0
  140. package/dist/library/index.esm.js +1 -1
  141. package/dist/library/library.esm.js +1 -1
  142. package/dist/library/{p-9f812fb1.entry.js → p-0111358b.entry.js} +1 -1
  143. package/dist/library/{p-eb4f0ea7.entry.js → p-0be2c23a.entry.js} +1 -1
  144. package/dist/library/{p-751e9420.entry.js → p-1f95c06c.entry.js} +1 -1
  145. package/dist/library/{p-4e8c0e1b.entry.js → p-221d7e46.entry.js} +1 -1
  146. package/dist/library/{p-DPxJK7tl.js → p-2OHqjSAB.js} +1 -1
  147. package/dist/library/{p-516bf868.entry.js → p-460007fb.entry.js} +1 -1
  148. package/dist/library/{p-2d8497d9.entry.js → p-47c7c1b3.entry.js} +1 -1
  149. package/dist/library/{p-bb534b71.entry.js → p-4f2bd961.entry.js} +1 -1
  150. package/dist/library/{p-f5bb347f.entry.js → p-51299820.entry.js} +1 -1
  151. package/dist/library/p-57010a13.entry.js +1 -0
  152. package/dist/library/{p-ad825010.entry.js → p-5b35b8ce.entry.js} +1 -1
  153. package/dist/library/{p-64e9659d.entry.js → p-7ffdb912.entry.js} +1 -1
  154. package/dist/library/p-880947da.entry.js +1 -0
  155. package/dist/library/{p-25f8585a.entry.js → p-8b1e5b00.entry.js} +1 -1
  156. package/dist/library/p-8f1bffc1.entry.js +1 -0
  157. package/dist/library/{p-4a41a902.entry.js → p-99cde2a6.entry.js} +2 -2
  158. package/dist/library/{p-FOOni1Nh.js → p-BBdGlaiy.js} +1 -1
  159. package/dist/library/{p-CrPwKEk_.js → p-BdxoiM8M.js} +1 -1
  160. package/dist/library/{p-DkZf86Si.js → p-CliFNIj3.js} +1 -1
  161. package/dist/library/{p-TJudQcMS.js → p-DKkcidUt.js} +2 -2
  162. package/dist/library/p-De893Lcf.js +1 -0
  163. package/dist/library/{p-DheNz53W.js → p-G2JbXetS.js} +1 -1
  164. package/dist/library/{p-CZBOULiw.js → p-NAZgDh2j.js} +1 -1
  165. package/dist/library/p-bbcbf218.entry.js +1 -0
  166. package/dist/library/p-f680df18.entry.js +1 -0
  167. package/dist/library/p-f9ae5fb0.entry.js +1 -0
  168. package/dist/library/{p-Cwv5wtEw.js → p-hl4njVg0.js} +1 -1
  169. package/dist/library/{p-CzTa5Msf.js → p-usGJJG-Q.js} +1 -1
  170. package/dist/types/components/ai12z-bot/ai12z-bot.d.ts +3 -0
  171. package/dist/types/components/ai12z-cta/components/Category.d.ts +2 -1
  172. package/dist/types/components/ai12z-search-panel/search-results-view.d.ts +1 -0
  173. package/package.json +2 -2
  174. package/readme.md +0 -2
  175. package/dist/components/p-7D8UwFfY.js +0 -1
  176. package/dist/components/p-B_GRAsXZ.js +0 -1
  177. package/dist/components/p-CAK1__lu.js +0 -2
  178. package/dist/components/p-CMc63lZp.js +0 -1
  179. package/dist/components/p-CO7OM6cu.js +0 -1
  180. package/dist/components/p-CYh3so8v.js +0 -1
  181. package/dist/components/p-CnIXGAt8.js +0 -1
  182. package/dist/components/p-DBojmc3T.js +0 -1
  183. package/dist/components/p-DKF8ThBg.js +0 -1
  184. package/dist/components/p-DxKyMupy.js +0 -1
  185. package/dist/components/p-HTPyCRCK.js +0 -1
  186. package/dist/components/p-kJpnWRAF.js +0 -1
  187. package/dist/library/p-03851cc8.entry.js +0 -1
  188. package/dist/library/p-65d17a5b.entry.js +0 -1
  189. package/dist/library/p-CTRVp5uQ.js +0 -1
  190. package/dist/library/p-b01d3dff.entry.js +0 -1
  191. package/dist/library/p-d45bc8fa.entry.js +0 -1
  192. package/dist/library/p-d4e410ff.entry.js +0 -1
  193. package/dist/library/p-f1b93099.entry.js +0 -1
  194. /package/dist/components/{p-CHrTVomR.js → p-djQQf6su.js} +0 -0
  195. /package/dist/library/{p-D5HnlfHT.js → p-OGzQSgcP.js} +0 -0
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-v8T1EJAJ.js');
4
- var beacon = require('./beacon-Bhd49ADQ.js');
5
- require('./utils-BsCPba57.js');
4
+ var beacon = require('./beacon-DwOvY6Ne.js');
5
+ require('./utils-DZMolZh2.js');
6
6
 
7
7
  const Ai12zBeacon = class {
8
8
  constructor(hostRef) {
@@ -2,20 +2,20 @@
2
2
 
3
3
  var index = require('./index-v8T1EJAJ.js');
4
4
  var responseAdapter = require('./response-adapter-CKKyyhMj.js');
5
- var processCarouselData = require('./processCarouselData-DVJtwUsv.js');
5
+ var processCarouselData = require('./processCarouselData-BXglENd8.js');
6
6
  var logger$2 = require('./logger-2ZBZCKdM.js');
7
- var utils = require('./utils-BsCPba57.js');
8
- var index$1 = require('./index-CHyfwy-h.js');
7
+ var utils = require('./utils-DZMolZh2.js');
8
+ var index$1 = require('./index-B6xfVjPU.js');
9
9
  var globalStore = require('./global-store-R6x06KvJ.js');
10
- var reCaptchaHelpers = require('./reCaptchaHelpers-Djq71pt4.js');
10
+ var reCaptchaHelpers = require('./reCaptchaHelpers-DIDQT22p.js');
11
11
  var botHelpers = require('./botHelpers-D5Dj7TRA.js');
12
- var surveyHelpers = require('./surveyHelpers-D0AfNAN8.js');
12
+ var surveyHelpers = require('./surveyHelpers-B9t5lxy4.js');
13
13
  var scriptStyleLoader = require('./scriptStyleLoader-D-bqKqSb.js');
14
- var keyboardShortcuts = require('./keyboard-shortcuts-BfEhZKK-.js');
15
- var ctaHelpers = require('./ctaHelpers-DL-PGlAx.js');
14
+ var keyboardShortcuts = require('./keyboard-shortcuts-CBUd9KfQ.js');
15
+ var ctaHelpers = require('./ctaHelpers-CdztrD6A.js');
16
16
  var appStore = require('./app-store-BtkiHvcw.js');
17
- var parseHelper = require('./parseHelper-B8pslVtS.js');
18
- var beacon = require('./beacon-Bhd49ADQ.js');
17
+ var parseHelper = require('./parseHelper-BuoIRCbd.js');
18
+ var beacon = require('./beacon-DwOvY6Ne.js');
19
19
  var bodyScrollLock = require('./bodyScrollLock-C7gKTAfx.js');
20
20
  require('./_commonjsHelpers-MBWFX2dn.js');
21
21
 
@@ -1092,6 +1092,7 @@ const Ai12zBot = class {
1092
1092
  // finding-agent placeholder is tracked via data-finding-agent attribute in the DOM
1093
1093
  // private originalTitle: string = document.title
1094
1094
  this.unreadCount = 0;
1095
+ this.hasPersistedConversationId = false;
1095
1096
  this.liveAgentButtonText = "Talk to a Live Agent";
1096
1097
  this.isLiveAgentEnabled = false;
1097
1098
  this.isTypingIndicatorVisible = false;
@@ -1807,7 +1808,9 @@ const Ai12zBot = class {
1807
1808
  this.timestamp = utils.formatTimestamp(new Date());
1808
1809
  this.updateScreenSize();
1809
1810
  await this.configBot();
1810
- beacon.initBeacon(this.dataKey, this.dataMode);
1811
+ if (!this.botSettings.disableBeacon) {
1812
+ void beacon.initBeacon(this.dataKey, this.dataMode);
1813
+ }
1811
1814
  this.visitorID = "ai12z-" + localStorage.getItem(`ai12z-visitorId`);
1812
1815
  // Now safely read state with valid pId
1813
1816
  this.hydrateStateFromStorage();
@@ -1835,6 +1838,7 @@ const Ai12zBot = class {
1835
1838
  }
1836
1839
  this.isExpanded = botState.isExpanded;
1837
1840
  this.conversationId = botState.conversationId;
1841
+ this.hasPersistedConversationId = Boolean(botState.conversationId);
1838
1842
  if (!botState.newChat) {
1839
1843
  this.messages = [...(botState.messages || [])];
1840
1844
  }
@@ -2019,6 +2023,9 @@ const Ai12zBot = class {
2019
2023
  this.announceMessage = "";
2020
2024
  }, 1000);
2021
2025
  }
2026
+ isFirstExchange() {
2027
+ return !this.hasPersistedConversationId;
2028
+ }
2022
2029
  syncBodyScrollLock(shouldOpen, wasOpen = this.isOpened) {
2023
2030
  if (shouldOpen && !wasOpen) {
2024
2031
  bodyScrollLock.bodyScrollLock.acquire("ai12z-bot");
@@ -2261,10 +2268,12 @@ const Ai12zBot = class {
2261
2268
  this.currentDomId = id;
2262
2269
  if (idChanged)
2263
2270
  this.messages = [...this.messages];
2264
- // capture once, before handleEndResponse mutates this.messages
2265
- const isFirstExchange = this.messages.length === 2;
2266
- if (isFirstExchange) {
2271
+ // capture once, before handleEndResponse mutates this.messages and the submit flow advances.
2272
+ const isFirstExchange = this.isFirstExchange();
2273
+ if (isFirstExchange && !this.botSettings.disableBeacon) {
2274
+ // Persist before emitting so downstream listeners see the conversation id as already stored.
2267
2275
  beacon.setConversationId(this.dataKey, this.dataMode, data.conversationId);
2276
+ this.hasPersistedConversationId = true;
2268
2277
  }
2269
2278
  if (!orphaned) {
2270
2279
  this.messageReceived.emit({ data, domId: this.currentDomId });
@@ -2732,8 +2741,14 @@ const Ai12zBot = class {
2732
2741
  clearTimeout(this.autoScrollTimer);
2733
2742
  this.autoScrollTimer = setTimeout(() => this.scrollToBottom(), 60);
2734
2743
  }
2744
+ checkLiveAgentBusinessHours() {
2745
+ var _a, _b, _c, _d, _f, _g;
2746
+ const businessHours = (_c = (_b = (_a = this.botSettings) === null || _a === void 0 ? void 0 : _a.liveagent) === null || _b === void 0 ? void 0 : _b.businessHours) !== null && _c !== void 0 ? _c : null;
2747
+ const timezone = (_g = (_f = (_d = this.botSettings) === null || _d === void 0 ? void 0 : _d.liveagent) === null || _f === void 0 ? void 0 : _f.timezone) !== null && _g !== void 0 ? _g : null;
2748
+ return businessHours && timezone ? botHelpers.checkBusinessHours(businessHours, timezone) : true;
2749
+ }
2735
2750
  checkLiveAgentMode() {
2736
- var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l;
2751
+ var _a, _b, _c, _d;
2737
2752
  const isLiveAgentConfigured = ((_b = (_a = this.botSettings) === null || _a === void 0 ? void 0 : _a.liveagent) === null || _b === void 0 ? void 0 : _b.providers) && Object.keys((_d = (_c = this.botSettings) === null || _c === void 0 ? void 0 : _c.liveagent) === null || _d === void 0 ? void 0 : _d.providers).length > 0;
2738
2753
  /**
2739
2754
  * Check if live agent is enabled
@@ -2743,9 +2758,7 @@ const Ai12zBot = class {
2743
2758
  * and there is a conversation history to refer to.
2744
2759
  * This prevents the live agent from being connected immediately when the chat is opened.
2745
2760
  */
2746
- const bh = (_h = (_g = (_f = this.botSettings) === null || _f === void 0 ? void 0 : _f.liveagent) === null || _g === void 0 ? void 0 : _g.businessHours) !== null && _h !== void 0 ? _h : null;
2747
- const tz = (_l = (_k = (_j = this.botSettings) === null || _j === void 0 ? void 0 : _j.liveagent) === null || _k === void 0 ? void 0 : _k.timezone) !== null && _l !== void 0 ? _l : null;
2748
- const withinHours = bh && tz ? botHelpers.checkBusinessHours(bh, tz) : true;
2761
+ const withinHours = this.checkLiveAgentBusinessHours();
2749
2762
  this.isLiveAgentEnabled = isLiveAgentConfigured && this.messages.length > 1 && withinHours;
2750
2763
  }
2751
2764
  openEndLiveAgentDialog() {
@@ -2818,7 +2831,7 @@ const Ai12zBot = class {
2818
2831
  ChatEventBus.off("AGENT_SESSION_INFO", this.handleAgentSessionInfo);
2819
2832
  }
2820
2833
  async connectLiveChat() {
2821
- var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
2834
+ var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o;
2822
2835
  this.announce("Connecting to live agent");
2823
2836
  this.clearEvents();
2824
2837
  const liveAgentProviderNames = Object.keys((_c = (_b = (_a = this.botSettings) === null || _a === void 0 ? void 0 : _a.liveagent) === null || _b === void 0 ? void 0 : _b.providers) !== null && _c !== void 0 ? _c : {});
@@ -2831,8 +2844,6 @@ const Ai12zBot = class {
2831
2844
  console.warn("Multiple live agent providers found, using the first one");
2832
2845
  }
2833
2846
  let liveAgentSettings = (_h = (_g = (_f = (_d = this.botSettings) === null || _d === void 0 ? void 0 : _d.liveagent) === null || _f === void 0 ? void 0 : _f.providers) === null || _g === void 0 ? void 0 : _g[liveAgentProviderNames[0]]) !== null && _h !== void 0 ? _h : null;
2834
- let liveAgentBusinessHours = (_l = (_k = (_j = this.botSettings) === null || _j === void 0 ? void 0 : _j.liveagent) === null || _k === void 0 ? void 0 : _k.businessHours) !== null && _l !== void 0 ? _l : null;
2835
- let liveAgentTimezone = (_p = (_o = (_m = this.botSettings) === null || _m === void 0 ? void 0 : _m.liveagent) === null || _o === void 0 ? void 0 : _o.timezone) !== null && _p !== void 0 ? _p : null;
2836
2847
  if (!liveAgentSettings) {
2837
2848
  console.error("No live agent settings found for the provider", liveAgentProviderNames[0]);
2838
2849
  this.announce("Live agent settings are unavailable");
@@ -2856,25 +2867,23 @@ const Ai12zBot = class {
2856
2867
  extraPrechatFormDetails,
2857
2868
  };
2858
2869
  this.liveAgentProviderName = liveAgentProviderNames[0];
2859
- if (liveAgentBusinessHours && liveAgentTimezone) {
2860
- let isWithinBusinessHours;
2861
- try {
2862
- isWithinBusinessHours = botHelpers.checkBusinessHours(liveAgentBusinessHours, liveAgentTimezone);
2863
- }
2864
- catch (e) {
2865
- console.error("AI12Z: unexpected error evaluating business hours — blocking live agent connection", e);
2866
- this.announce("Unexpected error evaluating business hours. Live agent connection blocked.");
2867
- this.addEventMessage("Unexpected error evaluating business hours. Please try again later.");
2868
- this.isTypingIndicatorVisible = false;
2869
- return;
2870
- }
2871
- if (!isWithinBusinessHours) {
2872
- const outsideHoursMsg = (_r = (_q = liveAgentSettings.config) === null || _q === void 0 ? void 0 : _q.outsideBusinessHoursMessage) !== null && _r !== void 0 ? _r : "Our live agents are currently offline. Please try again during our business hours.";
2873
- this.addEventMessage(outsideHoursMsg);
2874
- this.announce("Live agents are currently offline");
2875
- this.isTypingIndicatorVisible = false;
2876
- return;
2877
- }
2870
+ let isWithinBusinessHours;
2871
+ try {
2872
+ isWithinBusinessHours = this.checkLiveAgentBusinessHours();
2873
+ }
2874
+ catch (e) {
2875
+ console.error("AI12Z: unexpected error evaluating business hours — blocking live agent connection", e);
2876
+ this.announce("Unexpected error evaluating business hours. Live agent connection blocked.");
2877
+ this.addEventMessage("Unexpected error evaluating business hours. Please try again later.");
2878
+ this.isTypingIndicatorVisible = false;
2879
+ return;
2880
+ }
2881
+ if (!isWithinBusinessHours) {
2882
+ const outsideHoursMsg = (_k = (_j = liveAgentSettings.config) === null || _j === void 0 ? void 0 : _j.outsideBusinessHoursMessage) !== null && _k !== void 0 ? _k : "Our live agents are currently offline. Please try again during our business hours.";
2883
+ this.addEventMessage(outsideHoursMsg);
2884
+ this.announce("Live agents are currently offline");
2885
+ this.isTypingIndicatorVisible = false;
2886
+ return;
2878
2887
  }
2879
2888
  if (liveAgentProviderNames[0] === "liveagent") {
2880
2889
  if (!this.liveAgentRef) {
@@ -2891,7 +2900,7 @@ const Ai12zBot = class {
2891
2900
  else {
2892
2901
  // Coerce to number; enforce minimum of 5 s to prevent misconfigured values;
2893
2902
  // fall back to 30 s when unset, non-numeric, or below the minimum.
2894
- const rawWait = Number((_s = liveAgentSettings === null || liveAgentSettings === void 0 ? void 0 : liveAgentSettings.config) === null || _s === void 0 ? void 0 : _s.maxWaitTime);
2903
+ const rawWait = Number((_l = liveAgentSettings === null || liveAgentSettings === void 0 ? void 0 : liveAgentSettings.config) === null || _l === void 0 ? void 0 : _l.maxWaitTime);
2895
2904
  const waitSeconds = Number.isFinite(rawWait) && rawWait >= 5 ? rawWait : 300;
2896
2905
  const timeoutMs = waitSeconds * 1000;
2897
2906
  // Step 1: register all listeners before connecting so no events are missed
@@ -2933,7 +2942,7 @@ const Ai12zBot = class {
2933
2942
  this.liveAgentConversationId = "";
2934
2943
  this.isLiveAgent = false;
2935
2944
  this.isTypingIndicatorVisible = false;
2936
- const timeoutMsg = (_u = (_t = liveAgentSettings.config) === null || _t === void 0 ? void 0 : _t.maxWaitMessage) !== null && _u !== void 0 ? _u : "Sorry, no agents are available at the moment.";
2945
+ const timeoutMsg = (_o = (_m = liveAgentSettings.config) === null || _m === void 0 ? void 0 : _m.maxWaitMessage) !== null && _o !== void 0 ? _o : "Sorry, no agents are available at the moment.";
2937
2946
  this.removeFindingAgentPlaceholder();
2938
2947
  this.addEventMessage(timeoutMsg);
2939
2948
  this.liveAgentEventHandler.disconnectLiveAgent();
@@ -2,11 +2,11 @@
2
2
 
3
3
  var index = require('./index-v8T1EJAJ.js');
4
4
  var SearchResult = require('./SearchResult-CvTJr55G.js');
5
- var utils = require('./utils-BsCPba57.js');
5
+ var utils = require('./utils-DZMolZh2.js');
6
6
  var _commonjsHelpers = require('./_commonjsHelpers-MBWFX2dn.js');
7
7
  var appStore = require('./app-store-BtkiHvcw.js');
8
- var parseHelper = require('./parseHelper-B8pslVtS.js');
9
- require('./ctaHelpers-DL-PGlAx.js');
8
+ var parseHelper = require('./parseHelper-BuoIRCbd.js');
9
+ require('./ctaHelpers-CdztrD6A.js');
10
10
  require('./logger-2ZBZCKdM.js');
11
11
 
12
12
  const categoryCss = () => `ai12z-category{font-family:var(--ai12z-font-family) !important;font-size:var(--ai12z-search-font-size, var(--ai12z-font-size)) !important}.custom-title{font-size:var(--ai12z-category-font-size);color:var(--ai12z-category-font-color)}`;
@@ -19,11 +19,10 @@ const Category = class {
19
19
  clearResultsHandler(_state) {
20
20
  this.categories = {};
21
21
  }
22
- componentShouldUpdate() {
23
- // console.log("componentShouldUpdate", this.categoryList)
24
- if (this.categoryList && this.categoryList.length > 0) {
22
+ watchCategoryList(newValue) {
23
+ if (newValue && newValue.length > 0) {
25
24
  /*group by category*/
26
- let grouped = this.categoryList.reduce((result, currentValue) => {
25
+ let grouped = newValue.reduce((result, currentValue) => {
27
26
  (result[currentValue["category"]] = result[currentValue["category"]] || []).push(currentValue);
28
27
  return result;
29
28
  }, {});
@@ -33,11 +32,19 @@ const Category = class {
33
32
  this.categories = {};
34
33
  }
35
34
  }
35
+ componentWillLoad() {
36
+ this.watchCategoryList(this.categoryList);
37
+ }
36
38
  render() {
37
39
  return Object.entries(this.categories).map(([key, value], _index) => {
38
40
  return (index.h(index.Fragment, null, index.h("div", null, index.h("h1", { class: "custom-title" }, key)), index.h(SearchResult.SearchResult, { results: value, linkTarget: this.linkTarget })));
39
41
  });
40
42
  }
43
+ static get watchers() { return {
44
+ "categoryList": [{
45
+ "watchCategoryList": 0
46
+ }]
47
+ }; }
41
48
  };
42
49
  Category.style = categoryCss();
43
50
 
@@ -6543,8 +6550,9 @@ const AudioRecorder = class {
6543
6550
  this.record = this.wavesurfer.registerPlugin(n.create({
6544
6551
  renderRecordedAudio: false,
6545
6552
  scrollingWaveform: true,
6546
- continuousWaveform: true,
6547
- continuousWaveformDuration: 30, // optional
6553
+ // continuousWaveform: true,
6554
+ continuousWaveform: false,
6555
+ // continuousWaveformDuration: 30, // optional
6548
6556
  mimeType: "audio/wav",
6549
6557
  }));
6550
6558
  // Render recorded audio
@@ -6669,17 +6677,17 @@ const AudioRecorder = class {
6669
6677
  render() {
6670
6678
  const minutes = Math.floor(this.time / 60);
6671
6679
  const seconds = this.time % 60;
6672
- return (index.h("div", { key: '5626c6e1b72ed0acfc37fbf49f42ee1f623b5386', class: "flex w-full" }, (this.isRecording || this.isProcessing) && (index.h("div", { key: '7eadd53123bab1262c427f7f2e22d62b150dcac0', class: `relative flex items-center w-full rounded-full` }, this.isRecording && (index.h("button", { key: 'f42b43d4c6c613d7739e1048d319913e12aa6333', "aria-label": "Cancel Recording", onClick: e => {
6680
+ return (index.h("div", { key: '3a61fd0cccae8abbf374222a23165af7c0a2946f', class: "flex w-full" }, (this.isRecording || this.isProcessing) && (index.h("div", { key: 'a463fefecfdd3ef0b1255a033a7ec75cfb3b9405', class: `relative flex items-center w-full rounded-full` }, this.isRecording && (index.h("button", { key: '38bc942c1430cb6d2e8c17c1729e3739e44ef1de', "aria-label": "Cancel Recording", onClick: e => {
6673
6681
  e.preventDefault();
6674
6682
  this.stopRecording("cancel");
6675
- }, class: "w-10 h-10 rounded-full flex items-center justify-center text-white" }, "\u274C")), index.h("div", { key: '7884f7722100fe4284d5557b3c234b0cb2dae5a8', id: "mic", style: { width: "100%" } }), this.isRecording && !this.isProcessing ? (index.h("div", { class: "ml-auto text-blue-600 font-semibold" }, String(minutes).padStart(2, "0"), ":", String(seconds).padStart(2, "0"))) : null, (this.isRecording || this.isProcessing) && (index.h("button", { key: 'b3d675595adc6c7d0bc8efa2f6cd09e7493dffde', "aria-label": "Confirm Recording", disabled: this.isProcessing, onClick: e => {
6683
+ }, class: "w-10 h-10 rounded-full flex items-center justify-center text-white" }, "\u274C")), index.h("div", { key: 'ca74d03882f73b309ac2e7b5385818fd924c6254', id: "mic", style: { width: "100%" } }), this.isRecording && !this.isProcessing ? (index.h("div", { class: "ml-auto text-blue-600 font-semibold" }, String(minutes).padStart(2, "0"), ":", String(seconds).padStart(2, "0"))) : null, (this.isRecording || this.isProcessing) && (index.h("button", { key: '7391ecfdc0574a8ddf5e10f13ade8e244a2014a2', "aria-label": "Confirm Recording", disabled: this.isProcessing, onClick: e => {
6676
6684
  e.preventDefault();
6677
6685
  if (!this.isProcessing)
6678
6686
  this.stopRecording("stop");
6679
- }, class: `w-10 h-10 ml-2 rounded-full flex items-center justify-center ${this.isProcessing ? "cursor-not-allowed" : "text-blue-600"}` }, this.isProcessing ? (index.h("svg", { class: "activity-spinner", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("line", { x1: "12", y1: "2", x2: "12", y2: "5", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "0" } }), index.h("line", { x1: "16.24", y1: "3.76", x2: "14.12", y2: "5.88", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "1" } }), index.h("line", { x1: "19", y1: "7.76", x2: "16.24", y2: "9.24", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "2" } }), index.h("line", { x1: "20", y1: "12", x2: "17", y2: "12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "3" } }), index.h("line", { x1: "19", y1: "16.24", x2: "16.24", y2: "14.76", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "4" } }), index.h("line", { x1: "16.24", y1: "20.24", x2: "14.12", y2: "18.12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "5" } }), index.h("line", { x1: "12", y1: "22", x2: "12", y2: "19", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "6" } }), index.h("line", { x1: "7.76", y1: "20.24", x2: "9.88", y2: "18.12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "7" } }), index.h("line", { x1: "5", y1: "16.24", x2: "7.76", y2: "14.76", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "8" } }), index.h("line", { x1: "4", y1: "12", x2: "7", y2: "12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "9" } }), index.h("line", { x1: "5", y1: "7.76", x2: "7.76", y2: "9.24", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "10" } }), index.h("line", { x1: "7.76", y1: "3.76", x2: "9.88", y2: "5.88", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "11" } }))) : (index.h("span", { class: "text-blue-600 font-sans" }, "\u2714")))))), !this.isRecording && !this.isProcessing && (index.h("button", { key: '411d1cda58be052173e846d685a6c45196443d71', "aria-label": "Start Recording", title: "Start Recording", onClick: e => {
6687
+ }, class: `w-10 h-10 ml-2 rounded-full flex items-center justify-center ${this.isProcessing ? "cursor-not-allowed" : "text-blue-600"}` }, this.isProcessing ? (index.h("svg", { class: "activity-spinner", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("line", { x1: "12", y1: "2", x2: "12", y2: "5", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "0" } }), index.h("line", { x1: "16.24", y1: "3.76", x2: "14.12", y2: "5.88", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "1" } }), index.h("line", { x1: "19", y1: "7.76", x2: "16.24", y2: "9.24", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "2" } }), index.h("line", { x1: "20", y1: "12", x2: "17", y2: "12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "3" } }), index.h("line", { x1: "19", y1: "16.24", x2: "16.24", y2: "14.76", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "4" } }), index.h("line", { x1: "16.24", y1: "20.24", x2: "14.12", y2: "18.12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "5" } }), index.h("line", { x1: "12", y1: "22", x2: "12", y2: "19", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "6" } }), index.h("line", { x1: "7.76", y1: "20.24", x2: "9.88", y2: "18.12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "7" } }), index.h("line", { x1: "5", y1: "16.24", x2: "7.76", y2: "14.76", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "8" } }), index.h("line", { x1: "4", y1: "12", x2: "7", y2: "12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "9" } }), index.h("line", { x1: "5", y1: "7.76", x2: "7.76", y2: "9.24", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "10" } }), index.h("line", { x1: "7.76", y1: "3.76", x2: "9.88", y2: "5.88", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "11" } }))) : (index.h("span", { class: "text-blue-600 font-sans" }, "\u2714")))))), !this.isRecording && !this.isProcessing && (index.h("button", { key: '074a9ae606bc564537fac0666f143d2464ea3fcd', "aria-label": "Start Recording", title: "Start Recording", onClick: e => {
6680
6688
  e.preventDefault();
6681
6689
  this.startRecording();
6682
- }, class: `flex ${this.componentType === "search" || this.componentType === "cta" ? "p-1.5 mr-0.5 self-center mt-0.5" : "w-10 h-8 p-0 mt-4"}` }, index.h("svg", { key: '6de627834c92b3a29ef269eb8dd381dbb4bcb48b', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", class: `w-5 h-5 translate-y-[0.5px] ${this.componentType === "search" || this.componentType === "cta" ? "mic-icon" : "mic-botIcon"}` }, index.h("path", { key: '194062cca39e2828f6bfd5fc21aec8a88d67b64f', d: "M7 4a3 3 0 016 0v6a3 3 0 11-6 0V4z" }), index.h("path", { key: 'aad6fd0e90339c57ade1ffd7f394a5cff3390aaa', d: "M5.5 9.643a.75.75 0 00-1.5 0V10c0 3.06 2.29 5.585 5.25 5.954V17.5h-1.5a.75.75 0 000 1.5h4.5a.75.75 0 000-1.5h-1.5v-1.546A6.001 6.001 0 0016 10v-.357a.75.75 0 00-1.5 0V10a4.5 4.5 0 01-9 0v-.357z" }))))));
6690
+ }, class: `flex ${this.componentType === "search" || this.componentType === "cta" ? "p-1.5 mr-0.5 self-center mt-0.5" : "w-10 h-8 p-0 mt-4"}` }, index.h("svg", { key: '93ad9e4839efd9b6a29b3e2a7d1f83340b50a89e', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", class: `w-5 h-5 translate-y-[0.5px] ${this.componentType === "search" || this.componentType === "cta" ? "mic-icon" : "mic-botIcon"}` }, index.h("path", { key: '6672944fcf0ba983b344a857b1bc8b704c4322c9', d: "M7 4a3 3 0 016 0v6a3 3 0 11-6 0V4z" }), index.h("path", { key: '85ef503991add4f986e84fbed3e5f79ba1e162ed', d: "M5.5 9.643a.75.75 0 00-1.5 0V10c0 3.06 2.29 5.585 5.25 5.954V17.5h-1.5a.75.75 0 000 1.5h4.5a.75.75 0 000-1.5h-1.5v-1.546A6.001 6.001 0 0016 10v-.357a.75.75 0 00-1.5 0V10a4.5 4.5 0 01-9 0v-.357z" }))))));
6683
6691
  }
6684
6692
  get element() { return index.getElement(this); }
6685
6693
  };
@@ -2,8 +2,8 @@
2
2
 
3
3
  var index = require('./index-v8T1EJAJ.js');
4
4
  var botHelpers = require('./botHelpers-D5Dj7TRA.js');
5
- var styleSheetRegistry = require('./styleSheetRegistry-CsHfoS0d.js');
6
- require('./utils-BsCPba57.js');
5
+ var styleSheetRegistry = require('./styleSheetRegistry-kcL2qS1d.js');
6
+ require('./utils-DZMolZh2.js');
7
7
 
8
8
  const ai12zChatMessageCss = () => `.show-more-btn{background:none;color:var(--ai12z-knowledge-box-show-more-color, #4a8aff);font-size:16px;cursor:pointer;font-weight:500;border-radius:6px;transition:color 0.2s ease, background 0.2s ease;border:1px solid var(--ai12z-knowledge-box-show-more-border, blue);padding:10px;border-radius:20px;align-items:center;justify-content:center;margin:auto;display:block;z-index:20;position:relative;width:30%}.show-more-btn:hover{color:var(--ai12z-knowledge-box-show-more-hover-color, #1a73e8);background:rgba(74, 138, 255, 0.08)}.show-more-btn:active{background:rgba(74, 138, 255, 0.15)}.show-more-btn svg{vertical-align:middle;gap:5px;transition:transform 0.3s ease-in-out;display:inline-block;margin-left:10px;font-size:20}.message-text{line-height:1.55;font-size:15px;color:var(--ai12z-knowledge-box-text-color, #1e1e1e);transition:max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden}.fade-overlay{position:absolute;bottom:0;left:0;right:0;height:100px;z-index:10;pointer-events:none;opacity:1;transition:opacity 0.3s ease-in-out;background:linear-gradient( to bottom, rgba(255, 255, 255, 0) 0%, var(--ai12z-knowledge-box-bg-color, #ffffff) 85% )}.chat-message{position:relative;}.custom-line-clamp{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--line-clamp);line-clamp:var(--line-clamp)}.ai12z-form-honeypot{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.ai12zBtn{background-color:var(--ai12z-knowledge-box-primary-color);color:white;padding:5px 10px;border:none;border-radius:5px;cursor:pointer;text-decoration:none;margin:5px}`;
9
9
 
@@ -156,9 +156,9 @@ const Ai12zChatMessage = class {
156
156
  render() {
157
157
  var _a, _b, _c, _d;
158
158
  const lineClamp = (_b = (_a = this.kbSettings) === null || _a === void 0 ? void 0 : _a.numberOfLines) !== null && _b !== void 0 ? _b : 10;
159
- return (index.h("div", { key: '678e7290618485a7a59f60642a2a7774c84ff87e', class: "chat-message" }, index.h("div", { key: '6b47a9bfeec40b41d1dcbbe026f3553f5950815e', ref: (el) => this.messageRef = el, class: { 'message-text': true, "custom-line-clamp": !this.isExpanded && !this.isCollapsing && this.showButton }, style: {
159
+ return (index.h("div", { key: '54f51ffb7c06bbb20fc1088c0fb63a8669d7ba45', class: "chat-message" }, index.h("div", { key: '281bc75361bcfadb4611eefeb9697d525b9e2d27', ref: (el) => this.messageRef = el, class: { 'message-text': true, "custom-line-clamp": !this.isExpanded && !this.isCollapsing && this.showButton }, style: {
160
160
  "--line-clamp": `${lineClamp}`,
161
- }, innerHTML: this.text, onClick: this.showButton ? this.toggleExpand : undefined }), !this.isExpanded && this.showButton && this.canExpand && index.h("div", { key: 'dc643873c5d998735c11d318dd65adf974abf4be', class: "fade-overlay" }), this.showButton && this.canExpand && index.h("button", { key: '7bbd87c7c71796a4b7e43d290536c13fc39254cc', class: "show-more-btn", onClick: this.toggleExpand }, this.isExpanded ? (((_c = this.kbSettings) === null || _c === void 0 ? void 0 : _c.showLessButtonLabel) || "Show less") : (((_d = this.kbSettings) === null || _d === void 0 ? void 0 : _d.showMoreButtonLabel) || "Show more"), this.isExpanded ? index.h("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("polyline", { points: "6 9 12 15 18 9" })) : index.h("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("polyline", { points: "18 15 12 9 6 15" })))));
161
+ }, innerHTML: this.text, onClick: this.showButton ? this.toggleExpand : undefined }), !this.isExpanded && this.showButton && this.canExpand && index.h("div", { key: 'd6e262dbca0934b97fafb3dd7723b3b9333d8e10', class: "fade-overlay" }), this.showButton && this.canExpand && index.h("button", { key: 'e1e711b71656763ecdeb1cb6f73166528f023914', class: "show-more-btn", onClick: this.toggleExpand }, this.isExpanded ? (((_c = this.kbSettings) === null || _c === void 0 ? void 0 : _c.showLessButtonLabel) || "Show less") : (((_d = this.kbSettings) === null || _d === void 0 ? void 0 : _d.showMoreButtonLabel) || "Show more"), this.isExpanded ? index.h("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("polyline", { points: "6 9 12 15 18 9" })) : index.h("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("polyline", { points: "18 15 12 9 6 15" })))));
162
162
  }
163
163
  get el() { return index.getElement(this); }
164
164
  static get watchers() { return {
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-v8T1EJAJ.js');
4
- var processCarouselData = require('./processCarouselData-DVJtwUsv.js');
5
- var parseHelper = require('./parseHelper-B8pslVtS.js');
6
- var utils = require('./utils-BsCPba57.js');
7
- var ctaHelpers = require('./ctaHelpers-DL-PGlAx.js');
8
- var index$1 = require('./index-CHyfwy-h.js');
9
- var socketService = require('./socket-service-Dqfi4_qU.js');
10
- var surveyHelpers = require('./surveyHelpers-D0AfNAN8.js');
11
- var keyboardShortcuts = require('./keyboard-shortcuts-BfEhZKK-.js');
4
+ var processCarouselData = require('./processCarouselData-BXglENd8.js');
5
+ var parseHelper = require('./parseHelper-BuoIRCbd.js');
6
+ var utils = require('./utils-DZMolZh2.js');
7
+ var ctaHelpers = require('./ctaHelpers-CdztrD6A.js');
8
+ var index$1 = require('./index-B6xfVjPU.js');
9
+ var socketService = require('./socket-service-j9VBg1pS.js');
10
+ var surveyHelpers = require('./surveyHelpers-B9t5lxy4.js');
11
+ var keyboardShortcuts = require('./keyboard-shortcuts-CBUd9KfQ.js');
12
12
  var analyticsService = require('./analyticsService-CkAva47S.js');
13
13
  var botHelpers = require('./botHelpers-D5Dj7TRA.js');
14
- var beacon = require('./beacon-Bhd49ADQ.js');
14
+ var beacon = require('./beacon-DwOvY6Ne.js');
15
15
  require('./_commonjsHelpers-MBWFX2dn.js');
16
16
  require('./logger-2ZBZCKdM.js');
17
17
  require('./response-adapter-CKKyyhMj.js');
@@ -400,7 +400,7 @@ const MyChat = class {
400
400
  }
401
401
  this.scrollToLatestBubble();
402
402
  this.isProcessingEndResponse = true;
403
- if (this.chats.length === 2) {
403
+ if (this.chats.length === 2 && !this.settings.disableBeacon) {
404
404
  beacon.setConversationId(this.apiKey, this.env, event.detail.conversationId);
405
405
  }
406
406
  // const idx = this.chats.findIndex(item => item.id === this.aiMessageId)
@@ -1142,7 +1142,7 @@ const MyChat = class {
1142
1142
  render() {
1143
1143
  var _a;
1144
1144
  const email = "";
1145
- return (index.h("div", { key: '0ffe4268143c465bfd5b0ef098680d355aa49527' }, index.h("ul", { key: '2ca1aaa847f8cd9a184a70bbd833f75d148cbd18', id: "main-content", tabindex: "-1", class: {
1145
+ return (index.h("div", { key: '19726973405085efbdf60798ceae80d8b0c8d1d9' }, index.h("ul", { key: '75a7be393d0b66ed126bbb945b6161de9426e3fb', id: "main-content", tabindex: "-1", class: {
1146
1146
  "chat-list": true,
1147
1147
  "custom-list": this.componentType === "search",
1148
1148
  // "custom-chat-top-height": this.componentType === "search",
@@ -1209,7 +1209,7 @@ const MyChat = class {
1209
1209
  projectId: this.getProjectId(),
1210
1210
  questionText: analyticsService.getQuestionText(this.chats, chat.insightId) || "",
1211
1211
  }), class: "chat-thumbs-up", "aria-label": "Thumbs Down", tabindex: "0" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", class: "w-6 h-6" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M7.498 15.25H4.372c-1.026 0-1.945-.694-2.054-1.715a12.137 12.137 0 0 1-.068-1.285c0-2.848.992-5.464 2.649-7.521C5.287 4.247 5.886 4 6.504 4h4.016a4.5 4.5 0 0 1 1.423.23l3.114 1.04a4.5 4.5 0 0 0 1.423.23h1.294M7.498 15.25c.618 0 .991.724.725 1.282A7.471 7.471 0 0 0 7.5 19.75 2.25 2.25 0 0 0 9.75 22a.75.75 0 0 0 .75-.75v-.633c0-.573.11-1.14.322-1.672.304-.76.93-1.33 1.653-1.715a9.04 9.04 0 0 0 2.86-2.4c.498-.634 1.226-1.08 2.032-1.08h.384m-10.253 1.5H9.7m8.075-9.75c.01.05.027.1.05.148.593 1.2.925 2.55.925 3.977 0 1.487-.36 2.89-.999 4.125m.023-8.25c-.076-.365.183-.75.575-.75h.908c.889 0 1.713.518 1.972 1.368.339 1.11.521 2.287.521 3.507 0 1.553-.295 3.036-.831 4.398-.306.774-1.086 1.227-1.918 1.227h-1.053c-.472 0-.745-.556-.5-.96a8.95 8.95 0 0 0 .303-.54" }))), index.h("button", { class: "copy-btn", tabindex: "0", "aria-label": "Send Email" }, index.h("a", { href: `mailto:${email}?subject=${encodeURIComponent((_e = this.chats[idx - 1]) === null || _e === void 0 ? void 0 : _e.message)}&body=${encodeURIComponent(this.removeHtmlTags(chat.clipboard))}`, target: "_blank", "aria-label": "Send Email" }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "currentColor", "stroke-width": "0.3", class: "w-6 h-6" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M3.75 5.25L3 6V18L3.75 18.75H20.25L21 18V6L20.25 5.25H3.75ZM4.5 7.6955V17.25H19.5V7.69525L11.9999 14.5136L4.5 7.6955ZM18.3099 6.75H5.68986L11.9999 12.4864L18.3099 6.75Z", fill: "currentColor" }), " "))))))));
1212
- }), index.h("div", { key: '9786756a0b61d0f64e57dd3518dd48f6531345ae', class: "scroll-bottom" }))));
1212
+ }), index.h("div", { key: 'f4204e65c85c358653d91d74ce47c77f03382d12', class: "scroll-bottom" }))));
1213
1213
  }
1214
1214
  get element() { return index.getElement(this); }
1215
1215
  static get watchers() { return {
@@ -1567,21 +1567,21 @@ const InputForm = class {
1567
1567
  // this.icon_width = url.searchParams.get("w") || "28"
1568
1568
  // this.icon_height = url.searchParams.get("h") || "28"
1569
1569
  // }
1570
- return (index.h("div", { key: 'c59679b3a11b641402f5c2b328356ad114b43833' }, index.h("form", { key: 'a804577f24fc37e7da8fbec9fae402122c72ac89', class: "w-full flex flex-col gap-1.5 sticky", onSubmit: this.handleFormSubmit }, index.h("div", { key: 'a4f7f67ea5dd97304c37063449e3016e9325cff4', class: `flex-1 flex flex-col relative w-full rounded-3xl px-1 ${this.componentType === "inline" ? "inline-searchbar-bgcolor" : "searchbar-bgcolor"}`, dir: "LTR", ref: el => (this.searchFormElem = el) }, index.h("div", { key: '5f6c83186194cdf41dcd0c70c15b4d08dbcfa8c7', class: "flex items-center" }, index.h("div", { key: '181e649b6e7c6e6a733e04138f1b5701e26c39fe', class: "ml-1 self-center flex space-x-1" }, !this.hideAllButtons && (index.h("div", { key: 'edf78436e60151de6667d9c7f49d127a3712c79d', class: "ai12z-plus-anchor relative inline-block", style: { width: "5%" } }, index.h("button", { key: 'fb754f5f59db7558fcbac0e291b644e3783f4c73', class: "plus-icon", "aria-label": "Options", title: "Add images or capture screen", tabindex: "0", "aria-haspopup": "menu", "aria-expanded": this.isOpen ? "true" : "false", "aria-controls": `ai12z-options-menu-${this.instanceId}`, ref: el => (this.plusButtonElem = el), onKeyDown: this.handleTriggerKeyDown, onClick: e => {
1570
+ return (index.h("div", { key: '7c42e9070f1c5d7cc138693c1ddcb587684a6c70' }, index.h("form", { key: 'dc2169e6d3f3a7c44eed880d29a69d3616c64280', class: "w-full flex flex-col gap-1.5 sticky", onSubmit: this.handleFormSubmit }, index.h("div", { key: 'b8ba078963ce77b650e2d3f1f8ccfbdd397ee8b7', class: `flex-1 flex flex-col relative w-full rounded-3xl px-1 ${this.componentType === "inline" ? "inline-searchbar-bgcolor" : "searchbar-bgcolor"}`, dir: "LTR", ref: el => (this.searchFormElem = el) }, index.h("div", { key: '79b20c40c94bc652ddd6f5f372fa97a2f3646d1a', class: "flex items-center" }, index.h("div", { key: '48f6dc8ead7b4297d18725d5fc13525eeebb4b08', class: "ml-1 self-center flex space-x-1" }, !this.hideAllButtons && (index.h("div", { key: '4f44318b1fe3b4a9a360d51721e1ebaf80f8817f', class: "ai12z-plus-anchor relative inline-block", style: { width: "5%" } }, index.h("button", { key: '226ab1dde47a5cd76cb515caad6653a626d9f4eb', class: "plus-icon", "aria-label": "Options", title: "Add images or capture screen", tabindex: "0", "aria-haspopup": "menu", "aria-expanded": this.isOpen ? "true" : "false", "aria-controls": `ai12z-options-menu-${this.instanceId}`, ref: el => (this.plusButtonElem = el), onKeyDown: this.handleTriggerKeyDown, onClick: e => {
1571
1571
  e.stopPropagation();
1572
1572
  this.toggleBox(e);
1573
- } }, index.h("svg", { key: 'd3bbddad1e48e53347e7296ef4ffe6d1f4da79d3', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", width: "20", height: "20" }, index.h("path", { key: 'cde6032d137abaff123b533a7f939cdfe33f0b24', d: "M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z" }))), index.h("div", { key: '4ee0895730f92471a0f4936c3bea12da4942c9d8', class: "ai12z-plus-menu", id: `ai12z-options-menu-${this.instanceId}`, "data-open": this.isOpen ? "true" : "false", role: "menu", "aria-orientation": "vertical", "aria-label": "Input options", onKeyDown: this.handleMenuKeyDown, ref: el => (this.menuElem = el) }, index.h("ul", { key: 'bfd324d5fe04b12c1511163ca8c6f07ba27aff3f', class: "ai12z-menu-list" }, this.isImageUpload && (index.h("li", { key: 'f51da79f9d2e311e1b51ba16940219f861117532', role: "none", class: "ai12z-menu-item--uploader" }, index.h("image-uploader", { key: 'd85e868285e40437f7c3c66409091ce384037de8', maxImages: 10, images: this.imagesBase64List, targetElement: this.searchInputElem, onImagesChange: this.handleImageChange, onError: this.handleImageError, ref: el => (this.imageUploaderRef = el) }))), index.h("li", { key: '26a0f104f9542ae583046266281312539aaf8e92', role: "none" }, index.h("button", { key: '88e04508a9e7455f3bed682fa11c86b75144fcaf', type: "button", role: "menuitem", tabindex: -1, class: "ai12z-menu-item", "aria-label": "Capture screen", onClick: () => {
1573
+ } }, index.h("svg", { key: '58a5e1a2fa3419e101b0fb73065145af4fe2f283', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", width: "20", height: "20" }, index.h("path", { key: '84444d3d1f7436456d2d0004ee1f2ec6371fca08', d: "M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z" }))), index.h("div", { key: '382ce6992a13ba4e9db4a854044863702dab4c7f', class: "ai12z-plus-menu", id: `ai12z-options-menu-${this.instanceId}`, "data-open": this.isOpen ? "true" : "false", role: "menu", "aria-orientation": "vertical", "aria-label": "Input options", onKeyDown: this.handleMenuKeyDown, ref: el => (this.menuElem = el) }, index.h("ul", { key: 'ca290a730cb52512440929d5115c80a8c2f8e403', class: "ai12z-menu-list" }, this.isImageUpload && (index.h("li", { key: 'fe7ba6eb4663da261cc50bbdb8fdaf9f78284548', role: "none", class: "ai12z-menu-item--uploader" }, index.h("image-uploader", { key: '8552b458871e39417131a20aac81df027560c992', maxImages: 10, images: this.imagesBase64List, targetElement: this.searchInputElem, onImagesChange: this.handleImageChange, onError: this.handleImageError, ref: el => (this.imageUploaderRef = el) }))), index.h("li", { key: '566f3aa616e36b58fd8bcb515222bc79811b1ad9', role: "none" }, index.h("button", { key: '66662889c49e4261caf3d0f25bed7b7d711b8484', type: "button", role: "menuitem", tabindex: -1, class: "ai12z-menu-item", "aria-label": "Capture screen", onClick: () => {
1574
1574
  this.captureScreen();
1575
1575
  this.closeMenu(true);
1576
- } }, index.h("span", { key: '501845e1bf7e056ee0ce01efec34d77008a173d3', class: "ai12z-menu-item__icon" }, index.h("svg", { key: 'd28860ca91c219f0b44054957cdcc7d3fab362e9', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20" }, index.h("path", { key: '362d5bead2a93cda0b6ceaa5ee2b542de15250be', d: "M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z" }), index.h("path", { key: 'bebcf2f170a160102ae6ae934b04bf46dd00cd2e', "fill-rule": "evenodd", d: "M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3h-15a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z", "clip-rule": "evenodd" }))), index.h("span", { key: '8a3f37c7234e6924e7b346ab5174b82ff5e79c9c', class: "ai12z-menu-item__label" }, "Capture"))), index.h("li", { key: '078c1e2b8eeaf8f99b411783d1220cf2d4e8fd1e', role: "none" }, index.h("button", { key: '351d09656ee0b89e50cae13303f3af5cfeb78182', type: "button", role: "menuitem", tabindex: -1, class: "ai12z-menu-item", "aria-label": "Start Over", "aria-disabled": this.chatLength === 0 ? "true" : "false", onClick: e => {
1576
+ } }, index.h("span", { key: 'e52ccaaea1c2a073b5a8c8001078c7f6ad54e1da', class: "ai12z-menu-item__icon" }, index.h("svg", { key: 'e20629230e327c40eb099f93445bdc33ceb744de', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20" }, index.h("path", { key: '82b207ca09ca982100faba929365544930592c3b', d: "M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z" }), index.h("path", { key: '9de2f9701c7e2f2519bd9874d05c1756abf08b35', "fill-rule": "evenodd", d: "M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3h-15a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z", "clip-rule": "evenodd" }))), index.h("span", { key: '1107d24b22754416215ebf0487d4d5531744ad7b', class: "ai12z-menu-item__label" }, "Capture"))), index.h("li", { key: '941057003ca2b61f602076a2fcfcca852c594b22', role: "none" }, index.h("button", { key: '2d953a40091bc1163c239730acb3e56e7d761947', type: "button", role: "menuitem", tabindex: -1, class: "ai12z-menu-item", "aria-label": "Start Over", "aria-disabled": this.chatLength === 0 ? "true" : "false", onClick: e => {
1577
1577
  if (this.chatLength === 0)
1578
1578
  return;
1579
1579
  this.handleFollowUp(e);
1580
1580
  this.closeMenu(true);
1581
- } }, index.h("span", { key: 'f93f061c42f5bde3c3c415d83b532728fee76632', class: "ai12z-menu-item__icon" }, index.h("svg", { key: '6f3f2f768b6606e1dfcf74b7a3ddd82dfd91776e', width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("path", { key: '0930d675d2c39a26663575fb36b1487f3ae0d637', d: "M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.2" }))), index.h("span", { key: '242ba220f66a1e933c5ab6f989f80d3222965cb1', class: "ai12z-menu-item__label" }, "Start Over"))), index.h("li", { key: 'd24d0f8d45cb36aec05903d84633f4cd0affe40d', role: "none" }, index.h("button", { key: '41c7adcc5378248b686b67ab5d0439752f0c0e61', type: "button", role: "menuitem", tabindex: -1, class: "ai12z-menu-item", "aria-label": "View Recent Chat", onClick: e => {
1581
+ } }, index.h("span", { key: '89bf46b6102b75ac998f8592dd081b3d7ac80e30', class: "ai12z-menu-item__icon" }, index.h("svg", { key: '9a4624eafe2563d792232a7040f799a4c90f0743', width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("path", { key: '857d6181fc1252bcaff8986348766903f7145db8', d: "M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.2" }))), index.h("span", { key: '4342314590af5c52dee8dd8cc9c37da5f890bc2c', class: "ai12z-menu-item__label" }, "Start Over"))), index.h("li", { key: 'ff2793104059d88ea8ccd580794b9bfee25cffbc', role: "none" }, index.h("button", { key: '1ae65047698825425967ae6217ae96ae8ce0af01', type: "button", role: "menuitem", tabindex: -1, class: "ai12z-menu-item", "aria-label": "View Recent Chat", onClick: e => {
1582
1582
  this.handleRecentChat(e);
1583
1583
  this.closeMenu(true);
1584
- } }, index.h("span", { key: '15135c5061642e51af5c900f29a68bd8d0718fb1', class: "ai12z-menu-item__icon" }, index.h("svg", { key: 'fb7f8f9fdb4b26e3da650a68d8d19774bc932c78', xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("path", { key: '86b827ea8735c233f2638c3d07f8a39803fca8b6', d: "M21 15a4 4 0 0 1-4 4H7l-4 4V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z" }), index.h("path", { key: '654543de6686773be76bc683a22564b6cbd74a16', d: "M12 7v5l3 2" }))), index.h("span", { key: '935e612bc16debc5648b49736cc2a0542b6f09e7', class: "ai12z-menu-item__label" }, "View Recent Chat")))))))), !this.hideAllButtons && (index.h("div", { key: '9c57a1b9a0d588b18621afd3036c6c6a1b394acc', class: "scrollbar-hidden text-left bg-transparent dark:text-gray-100 outline-none w-full rounded-xl resize-none h-fit max-h-80 overflow-auto" }, index.h("div", { key: 'f9e62ead50cdb64610843c7a4b00105f4b509482', class: "relative w-full min-w-full h-full min-h-fit flex items-center input-prose" }, index.h("div", { key: '783c6a4e828e9b62e7035176d37c895a9ae2e323', id: `previewContainer-${this.instanceId}`, draggable: true }), index.h("label", { key: '26c177e01fea3199f94851ba565a38f0f8e7e5ce', htmlFor: `searchInput-${this.instanceId}`, class: "sr-only" }, "Your message"), index.h("textarea", { key: '4c2a9b868335a5da7c73eccbba9f1b217b8698ec', readOnly: this.submitted, "aria-describedby": this.emptyMessageError ? `message-error-${this.instanceId} search-hint-${this.instanceId}` : `search-hint-${this.instanceId}`, "aria-invalid": this.emptyMessageError, id: `searchInput-${this.instanceId}`, ref: el => {
1584
+ } }, index.h("span", { key: '7ddc54280e621560399fbce8fb9b827c8fb42abb', class: "ai12z-menu-item__icon" }, index.h("svg", { key: '9d1876b8331a59e4b49fb96dd5cf263d8c2e1cad', xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("path", { key: '185bb67ad4cdf45749d2eff12a059b980a1a8052', d: "M21 15a4 4 0 0 1-4 4H7l-4 4V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z" }), index.h("path", { key: 'd22013e8057604e4d73c253c34408e3576430e58', d: "M12 7v5l3 2" }))), index.h("span", { key: 'e2453013820e91872f19efd4f840796366d46c77', class: "ai12z-menu-item__label" }, "View Recent Chat")))))))), !this.hideAllButtons && (index.h("div", { key: 'befa212132aa56e7c83aee675c62a8e26e65036c', class: "scrollbar-hidden text-left bg-transparent dark:text-gray-100 outline-none w-full rounded-xl resize-none h-fit max-h-80 overflow-auto" }, index.h("div", { key: '1ba4a975f882d789d913a43a175808d8d39d38d1', class: "relative w-full min-w-full h-full min-h-fit flex items-center input-prose" }, index.h("div", { key: '936c01b9fc7e998800517cd8c84203888be85e90', id: `previewContainer-${this.instanceId}`, draggable: true }), index.h("label", { key: 'f724dc8a7ecedfb3b0744b9640298805edf03e82', htmlFor: `searchInput-${this.instanceId}`, class: "sr-only" }, "Your message"), index.h("textarea", { key: '7e29fb0e770efe7f2d1522b9132c5198c4f14fa1', readOnly: this.submitted, "aria-describedby": this.emptyMessageError ? `message-error-${this.instanceId} search-hint-${this.instanceId}` : `search-hint-${this.instanceId}`, "aria-invalid": this.emptyMessageError, id: `searchInput-${this.instanceId}`, ref: el => {
1585
1585
  this.searchInputElem = el;
1586
1586
  // Autofocus once on first mount, and never while the
1587
1587
  // options menu is open — otherwise unrelated re-renders
@@ -1593,7 +1593,7 @@ const InputForm = class {
1593
1593
  }
1594
1594
  }, placeholder: this.placeholder, autoComplete: "off", class: "w-full p-1 custom-input", value: this.searchInput, rows: 1, onInput: utils.debounce(e => this.handleInputChange(e), 500), onKeyUp: this.adjustHeight, onKeyDown: this.handleKeyDown, onFocus: () => this.searchFormElem.classList.add("input-focus-color"), onBlur: () => this.searchFormElem.classList.remove("input-focus-color"), onPaste: e => {
1595
1595
  this.handlePaste(e);
1596
- } }), index.h("div", { key: 'f5363f4a1db7284bce15a2d585a3837cd3b1c2e8', role: "status", "aria-live": "polite", "aria-atomic": "true", class: "sr-only" }, this.announceMessage), index.h("span", { key: '3342654330f342a027ddc12b458968496816a2ee', id: `search-hint-${this.instanceId}`, class: "sr-only" }, "Press Enter to send, Shift+Enter for new line")))), index.h("div", { key: 'b1778e8eda74184d30bdd52bca4b8615e69ca117', class: "p-1 self-end flex space-x-1 flex-row", style: { width: this.hideAllButtons ? "100%" : "auto" } }, index.h("div", { key: 'ae77103f8726fa24c390930eaa7c5589000db22c', "aria-label": "Record voice", class: "flex self-center", style: { width: this.hideAllButtons ? "100%" : "auto" } }, this.isEnableMic && (index.h("audio-recorder", { key: '6e1f7bb56486dee11d4d34cdd8d434480459ce19', "component-type": "cta", onStartRecord: _ev => {
1596
+ } }), index.h("div", { key: 'afc7aaa56b3522d9c8669f00ff4825f063b5383e', role: "status", "aria-live": "polite", "aria-atomic": "true", class: "sr-only" }, this.announceMessage), index.h("span", { key: 'f75e54c74c0c4ec11a623d039e561b0f5d884260', id: `search-hint-${this.instanceId}`, class: "sr-only" }, "Press Enter to send, Shift+Enter for new line")))), index.h("div", { key: 'b2c706fd8ec405d7b2e2627638ba13a8c00ddb2a', class: "p-1 self-end flex space-x-1 flex-row", style: { width: this.hideAllButtons ? "100%" : "auto" } }, index.h("div", { key: 'a32b1ffc262aa2682e7a661ffb1d33bf75cbea57', "aria-label": "Record voice", class: "flex self-center", style: { width: this.hideAllButtons ? "100%" : "auto" } }, this.isEnableMic && (index.h("audio-recorder", { key: '15b4fa7e527dc01d3b5ee4c5578dd8f535fec6c8', "component-type": "cta", onStartRecord: _ev => {
1597
1597
  // console.log("test", ev)
1598
1598
  this.hideAllButtons = true;
1599
1599
  }, onStopRecord: _ev => {
@@ -1611,14 +1611,14 @@ const InputForm = class {
1611
1611
  });
1612
1612
  }
1613
1613
  }, 1000);
1614
- }, style: { width: "100%" } }))), " ", !this.hideAllButtons && (index.h("div", { key: '16148cb1ab92798a41cf4e962ef13902ecb54813', class: "flex items-center" }, index.h("div", { key: '420045449b1356b9396f8e3e57aa062014adfc03', "aria-label": "Send message", class: "flex" }, index.h("button", { key: 'a5541ab413d33af01f3f38cd7c37875e813e44b0', id: `send-message-button-${this.instanceId}`, class: "btn-bg-color text-white transition rounded-full p-1.5 self-center",
1614
+ }, style: { width: "100%" } }))), " ", !this.hideAllButtons && (index.h("div", { key: '818c0dc10014f80b7606a73789ca067ec4860ae5', class: "flex items-center" }, index.h("div", { key: '4e9f59fc6c4c7d424ddb46563b447a241a1b998d', "aria-label": "Send message", class: "flex" }, index.h("button", { key: 'a19da51b9119cda37555c66420ba79f73843f832', id: `send-message-button-${this.instanceId}`, class: "btn-bg-color text-white transition rounded-full p-1.5 self-center",
1615
1615
  // type="submit"
1616
- disabled: this.submitted, onClick: this.handleAskAI, tabindex: "0", "aria-label": "Send Message", title: "Send Message" }, index.h("svg", { key: '0dbb11a7181f3c9ba01cd3590a82638989671525', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor", class: "size-6" }, index.h("path", { key: '6e9065e4a5c6fc43a9c7e9781463bd8c64a91796', "fill-rule": "evenodd", d: "M8 14a.75.75 0 0 1-.75-.75V4.56L4.03 7.78a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.75 4.56v8.69A.75.75 0 0 1 8 14Z", "clip-rule": "evenodd" })))))))), this.imagesBase64List.length > 0 && (index.h("div", { key: 'adeb8fb85f6d64701a491d1edddc29192c2f88de', class: "flex flex-wrap gap-2 mx-1 mt-2.5 mb-1" }, this.imagesBase64List.map((img, idx) => (index.h("div", { class: "image-Container sc-ai12z-input-form", key: idx }, index.h("img", { src: img, style: { width: "70px", height: "50px", borderRadius: "12px" } }), index.h("span", { class: "delete-image sc-ai12z-input-form cursor-pointer ml-1", onClick: () => {
1616
+ disabled: this.submitted, onClick: this.handleAskAI, tabindex: "0", "aria-label": "Send Message", title: "Send Message" }, index.h("svg", { key: '69e383d261ffb92f93aed72be1daad0f8573db23', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor", class: "size-6" }, index.h("path", { key: '6c3eb5a3055dfe9a3056f23e5d408150b63b30ed', "fill-rule": "evenodd", d: "M8 14a.75.75 0 0 1-.75-.75V4.56L4.03 7.78a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.75 4.56v8.69A.75.75 0 0 1 8 14Z", "clip-rule": "evenodd" })))))))), this.imagesBase64List.length > 0 && (index.h("div", { key: 'a6e55fc7c0eeae9a3350e84e3bd7fcc3eea5e06e', class: "flex flex-wrap gap-2 mx-1 mt-2.5 mb-1" }, this.imagesBase64List.map((img, idx) => (index.h("div", { class: "image-Container sc-ai12z-input-form", key: idx }, index.h("img", { src: img, style: { width: "70px", height: "50px", borderRadius: "12px" } }), index.h("span", { class: "delete-image sc-ai12z-input-form cursor-pointer ml-1", onClick: () => {
1617
1617
  this.imagesBase64List = this.imagesBase64List.filter((_, i) => i !== idx);
1618
1618
  if (this.imageUploaderRef && typeof this.imageUploaderRef.removeImageAtIndex === "function") {
1619
1619
  this.imageUploaderRef.removeImageAtIndex(idx);
1620
1620
  }
1621
- } }, "\u00D7"))))))), this.showErrorMessage && (index.h("div", { key: '196052af3d5b7e7e6a42e35110389ad2b4dbf19b', class: "flex" }, " ", index.h("p", { key: '0945d62e1cb8be174cb15c10aac0d85f27df5275', class: "error-msg", innerHTML: this.errorMessage }))), this.emptyMessageError && (index.h("div", { key: '866e6097d5702b07e732336a88d1270e18c519d5', class: "flex" }, index.h("p", { key: '2c69fbb67aa29cefd47d0eb946a5759a718d1650', id: `message-error-${this.instanceId}`, class: "error-msg", role: "alert" }, "Message cannot be empty. Please enter a message to send."))), this.chatLength === 0 && (index.h("div", { key: 'e0875b87186c4e1563fc4fba2e8402bc14bff56c', class: "enter-tip", role: "tooltip" }, "Tip: Press Enter to send, Shift+Enter for new line", " ", index.h("button", { key: '82a1b8c0e8fc21371bbdf6b3e87a98780f675f92', onClick: () => (this.showShortcutsDialog = true), class: "keyboard-shortcuts-btn", "aria-label": "Show keyboard shortcuts", title: "Keyboard shortcuts (?)", tabindex: "0" }, index.h("svg", { key: 'b87b8836fa6dd0ee32c5119c2a7d513ce6753ca6', width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("circle", { key: '35bbcd699ca8d24b0ebb0329d152e325cf40b9d9', cx: "12", cy: "12", r: "10" }), index.h("path", { key: '41f746e74e99d75c86cc12428cc1ce7ed365e517', d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }), index.h("line", { key: 'f3a017805a0dce706d2ec090e819e8e3cf470ed1', x1: "12", y1: "17", x2: "12.01", y2: "17" })))))), this.showShortcutsDialog && (index.h("keyboard-shortcuts-dialog", { key: 'a743e9d555fc1ac52bd00d333f22eab1356c1711', show: this.showShortcutsDialog, shortcuts: this.shortcuts, onCloseDialog: () => (this.showShortcutsDialog = false) }))));
1621
+ } }, "\u00D7"))))))), this.showErrorMessage && (index.h("div", { key: '703e617f0e374c0c9d83c3d744b258b43f49c540', class: "flex" }, " ", index.h("p", { key: '5224231ef0d8bcaf4f39b6a3ac100c6b4a0959f2', class: "error-msg", innerHTML: this.errorMessage }))), this.emptyMessageError && (index.h("div", { key: '3d933dbf56bde332066f40a838b2903314e73c52', class: "flex" }, index.h("p", { key: '98423eb51cbc01287e2ed3104b1eb3951c388a8f', id: `message-error-${this.instanceId}`, class: "error-msg", role: "alert" }, "Message cannot be empty. Please enter a message to send."))), this.chatLength === 0 && (index.h("div", { key: '3eaca3f631eb04755fa9e6623a7c5814878f1254', class: "enter-tip", role: "tooltip" }, "Tip: Press Enter to send, Shift+Enter for new line", " ", index.h("button", { key: 'cfdc4b2eb43641a781585e3e999ac54302da0d44', onClick: () => (this.showShortcutsDialog = true), class: "keyboard-shortcuts-btn", "aria-label": "Show keyboard shortcuts", title: "Keyboard shortcuts (?)", tabindex: "0" }, index.h("svg", { key: 'fa85440cb0fcdd8ca01e6ceccb06af38ffad8fd7', width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("circle", { key: '847f62af182e0f12ded557395ea99f132314f4d3', cx: "12", cy: "12", r: "10" }), index.h("path", { key: '275bd98694c58a21f2e481a9128a3c6c1b9de7cd', d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }), index.h("line", { key: '6bac5d6dd7180ca06b68c631cc22c52e6cba556a', x1: "12", y1: "17", x2: "12.01", y2: "17" })))))), this.showShortcutsDialog && (index.h("keyboard-shortcuts-dialog", { key: 'd3b4532e028a0e69c34681fc80c2c8b6afe219c5', show: this.showShortcutsDialog, shortcuts: this.shortcuts, onCloseDialog: () => (this.showShortcutsDialog = false) }))));
1622
1622
  }
1623
1623
  get el() { return index.getElement(this); }
1624
1624
  };
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-v8T1EJAJ.js');
4
- var utils = require('./utils-BsCPba57.js');
5
- var processCarouselData = require('./processCarouselData-DVJtwUsv.js');
4
+ var utils = require('./utils-DZMolZh2.js');
5
+ var processCarouselData = require('./processCarouselData-BXglENd8.js');
6
6
  var botHelpers = require('./botHelpers-D5Dj7TRA.js');
7
- var index$1 = require('./index-CHyfwy-h.js');
7
+ var index$1 = require('./index-B6xfVjPU.js');
8
8
  require('./_commonjsHelpers-MBWFX2dn.js');
9
9
 
10
10
  /*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */
@@ -1644,7 +1644,7 @@ const Ai12zContainer = class {
1644
1644
  }
1645
1645
  }
1646
1646
  render() {
1647
- return (index.h("div", { key: 'cb2a89a750b861e8dda860f6b57dbd4c96ee3516', class: "ai12z-container-root" }, this.isLoading && index.h("div", { key: 'b5d57f7ba858802c2824bd6376e7f23429c61a48', class: "state-message" }, "Loading..."), !this.isLoading && this.error && index.h("div", { key: '1c8fac0c0693d2009df5dfb18add74f7aab8b4cb', class: "state-message error" }, this.error), !this.isLoading && !this.error && this.renderByType()));
1647
+ return (index.h("div", { key: 'ec7c4261c505fb29882acf30d0c9c10a8703dc51', class: "ai12z-container-root" }, this.isLoading && index.h("div", { key: 'ab3899fe20a637293b1fa5c24b40edf9cc20f333', class: "state-message" }, "Loading..."), !this.isLoading && this.error && index.h("div", { key: 'd70e83ff89ab6df1b090e7034f021c71466796c6', class: "state-message error" }, this.error), !this.isLoading && !this.error && this.renderByType()));
1648
1648
  }
1649
1649
  get el() { return index.getElement(this); }
1650
1650
  static get watchers() { return {
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-v8T1EJAJ.js');
4
- var utils = require('./utils-BsCPba57.js');
4
+ var utils = require('./utils-DZMolZh2.js');
5
5
  var SearchResult = require('./SearchResult-CvTJr55G.js');
6
- var socketService = require('./socket-service-Dqfi4_qU.js');
6
+ var socketService = require('./socket-service-j9VBg1pS.js');
7
7
  var globalStore = require('./global-store-R6x06KvJ.js');
8
- var reCaptchaHelpers = require('./reCaptchaHelpers-Djq71pt4.js');
9
- var ctaHelpers = require('./ctaHelpers-DL-PGlAx.js');
10
- var beacon = require('./beacon-Bhd49ADQ.js');
8
+ var reCaptchaHelpers = require('./reCaptchaHelpers-DIDQT22p.js');
9
+ var ctaHelpers = require('./ctaHelpers-CdztrD6A.js');
10
+ var beacon = require('./beacon-DwOvY6Ne.js');
11
11
  var appStore = require('./app-store-BtkiHvcw.js');
12
12
  var bodyScrollLock = require('./bodyScrollLock-C7gKTAfx.js');
13
13
  require('./response-adapter-CKKyyhMj.js');
@@ -344,10 +344,9 @@ const Ai12zCta = class {
344
344
  appStore.setParentComponentState("cta", this.dataKey, this.dataMode);
345
345
  await this.configCtaSettings();
346
346
  // Initialize global beacon for session tracking
347
- beacon.initBeacon(this.dataKey, this.dataMode);
348
- // console.log("componentWillLoad ai12z-cta.tsx")
349
- // this.socket = this.socketService.getSocket()
350
- // this.socketService = SocketService.createInstance(this.dataMode)
347
+ if (!this.ctaSettings.disableBeacon) {
348
+ beacon.initBeacon(this.dataKey, this.dataMode);
349
+ }
351
350
  const slot = this.el["children"];
352
351
  let slotHasContent = slot && slot.length > 0;
353
352
  this.detectTextByLang();
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-v8T1EJAJ.js');
4
- var utils = require('./utils-BsCPba57.js');
5
- var surveyHelpers = require('./surveyHelpers-D0AfNAN8.js');
4
+ var utils = require('./utils-DZMolZh2.js');
5
+ var surveyHelpers = require('./surveyHelpers-B9t5lxy4.js');
6
6
  var scriptStyleLoader = require('./scriptStyleLoader-D-bqKqSb.js');
7
7
 
8
8
  const ai12zFormCss = () => `.ai12z-form-wrapper{width:100%}.ai12z-form-status,.ai12z-form-error{font-size:14px;margin-bottom:8px}.ai12z-form-error{color:#b91c1c}.ai12z-form-container{width:100%}.ai12z-form-honeypot{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}@keyframes ai12z-form-spin{to{transform:rotate(360deg)}}@keyframes ai12z-form-bounce{0%,80%,100%{opacity:0.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}`;
@@ -132,7 +132,7 @@ const Ai12zForm = class {
132
132
  this.errored.emit(message);
133
133
  }
134
134
  render() {
135
- return (index.h("div", { key: '6a47bf7230f5a9753ae5661985077e9f7c8b0d5d', class: "ai12z-form-wrapper" }, this.error && !this.isLoading && index.h("div", { key: 'a6957e39dffc640b288ee421bf79051fa6788655', class: "ai12z-form-error" }, this.error), index.h("div", { key: '7bdb939214057db6711e1d4433aa6c6a5e14b7e3', id: this.surveyDomId, class: "ai12z-form-container" })));
135
+ return (index.h("div", { key: '2b49de90588bc33436f1f2ce894a880fa103f281', class: "ai12z-form-wrapper" }, this.error && !this.isLoading && index.h("div", { key: '334057ac67847dd8cb5b57d8fb97dceeeb2fa98d', class: "ai12z-form-error" }, this.error), index.h("div", { key: 'b39da12b6265fad1f5025880187e16c9156db140', id: this.surveyDomId, class: "ai12z-form-container" })));
136
136
  }
137
137
  get el() { return index.getElement(this); }
138
138
  static get watchers() { return {