ai12z 3.3.1-alpha.0 → 3.3.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 (192) hide show
  1. package/dist/cjs/{ai12z-bot-787aa8c7.js → ai12z-bot-0eeb5af8.js} +866 -35
  2. package/dist/cjs/ai12z-bot-0eeb5af8.js.map +1 -0
  3. package/dist/cjs/ai12z-bot.cjs.entry.js +4 -3
  4. package/dist/cjs/ai12z-bot.cjs.entry.js.map +1 -1
  5. package/dist/cjs/ai12z-category_2.cjs.entry.js +4 -4
  6. package/dist/cjs/ai12z-chat_3.cjs.entry.js +15 -15
  7. package/dist/cjs/{ai12z-cta-5a652c6f.js → ai12z-cta-c37aad80.js} +3 -3
  8. package/dist/cjs/{ai12z-cta-5a652c6f.js.map → ai12z-cta-c37aad80.js.map} +1 -1
  9. package/dist/cjs/ai12z-cta.cjs.entry.js +3 -3
  10. package/dist/cjs/{ai12z-inline-search-8cda9f0e.js → ai12z-inline-search-f505a267.js} +3 -3
  11. package/dist/cjs/{ai12z-inline-search-8cda9f0e.js.map → ai12z-inline-search-f505a267.js.map} +1 -1
  12. package/dist/cjs/ai12z-inline-search.cjs.entry.js +3 -3
  13. package/dist/cjs/{ai12z-knowledge-box-89d1bb04.js → ai12z-knowledge-box-9eefec1a.js} +2 -2
  14. package/dist/cjs/{ai12z-knowledge-box-89d1bb04.js.map → ai12z-knowledge-box-9eefec1a.js.map} +1 -1
  15. package/dist/cjs/ai12z-knowledge-box.cjs.entry.js +2 -2
  16. package/dist/cjs/ai12z-mic.cjs.entry.js +5 -5
  17. package/dist/cjs/{ai12z-search-panel-018e2941.js → ai12z-search-panel-96b3e545.js} +2 -2
  18. package/dist/cjs/{ai12z-search-panel-018e2941.js.map → ai12z-search-panel-96b3e545.js.map} +1 -1
  19. package/dist/cjs/ai12z-search-panel.cjs.entry.js +2 -2
  20. package/dist/cjs/ai12z-spinner.cjs.entry.js +1 -1
  21. package/dist/cjs/{bot-popover_4.cjs.entry.js → bot-popover_7.cjs.entry.js} +145 -1
  22. package/dist/cjs/bot-popover_7.cjs.entry.js.map +1 -0
  23. package/dist/cjs/dynamic-form.cjs.entry.js +2 -2
  24. package/dist/cjs/{index-5f933fd6.js → index-0d034972.js} +2 -2
  25. package/dist/cjs/{index-5f933fd6.js.map → index-0d034972.js.map} +1 -1
  26. package/dist/cjs/index.cjs.js +10 -9
  27. package/dist/cjs/index.cjs.js.map +1 -1
  28. package/dist/cjs/item-list.cjs.entry.js +37 -4
  29. package/dist/cjs/item-list.cjs.entry.js.map +1 -1
  30. package/dist/cjs/library.cjs.js +1 -1
  31. package/dist/cjs/loader.cjs.js +1 -1
  32. package/dist/cjs/logger-63779020.js +101 -0
  33. package/dist/cjs/logger-63779020.js.map +1 -0
  34. package/dist/cjs/search-results-page.cjs.entry.js +3 -3
  35. package/dist/cjs/{search-results-view-b6838da0.js → search-results-view-e90fa43d.js} +3 -3
  36. package/dist/cjs/{search-results-view-b6838da0.js.map → search-results-view-e90fa43d.js.map} +1 -1
  37. package/dist/cjs/{socket-service-d39cb1aa.js → socket-service-10673435.js} +2 -2
  38. package/dist/cjs/{socket-service-d39cb1aa.js.map → socket-service-10673435.js.map} +1 -1
  39. package/dist/cjs/{utils-4ead6c2d.js → utils-028477b7.js} +4 -2
  40. package/dist/{esm/utils-101e63da.js.map → cjs/utils-028477b7.js.map} +1 -1
  41. package/dist/collection/collection-manifest.json +3 -0
  42. package/dist/collection/components/ai12z-bot/ai12z-bot.css +4 -4
  43. package/dist/collection/components/ai12z-bot/ai12z-bot.js +235 -31
  44. package/dist/collection/components/ai12z-bot/ai12z-bot.js.map +1 -1
  45. package/dist/collection/components/ai12z-bot/components/chat-avatar/chat-avatar.js +56 -0
  46. package/dist/collection/components/ai12z-bot/components/chat-avatar/chat-avatar.js.map +1 -0
  47. package/dist/collection/components/ai12z-bot/components/liveagent-chat/liveagent-chat.js +154 -0
  48. package/dist/collection/components/ai12z-bot/components/liveagent-chat/liveagent-chat.js.map +1 -0
  49. package/dist/collection/components/ai12z-bot/components/typing-indicator/typing-indicator.css +24 -0
  50. package/dist/collection/components/ai12z-bot/components/typing-indicator/typing-indicator.js +89 -0
  51. package/dist/collection/components/ai12z-bot/components/typing-indicator/typing-indicator.js.map +1 -0
  52. package/dist/collection/components/ai12z-cta/components/Chat.js +2 -2
  53. package/dist/collection/components/ai12z-cta/components/DynamicForm.js +1 -1
  54. package/dist/collection/components/ai12z-cta/components/audiorecorder/audio-recorder.js +4 -4
  55. package/dist/collection/components/ai12z-cta/components/itemlist/item-list.js +69 -2
  56. package/dist/collection/components/ai12z-cta/components/itemlist/item-list.js.map +1 -1
  57. package/dist/collection/components/ai12z-cta/components/voicetotext/ai12z-mic.js +5 -5
  58. package/dist/collection/components/input/ImageUploader.js +1 -1
  59. package/dist/collection/components/input/Input.js +9 -9
  60. package/dist/collection/components/spinner/Spinner.js +1 -1
  61. package/dist/collection/utils/liveagents/chateventbus.js +21 -0
  62. package/dist/collection/utils/liveagents/chateventbus.js.map +1 -0
  63. package/dist/collection/utils/liveagents/liveagent-event-handler.js +85 -0
  64. package/dist/collection/utils/liveagents/liveagent-event-handler.js.map +1 -0
  65. package/dist/collection/utils/liveagents/liveagent-factory-services.js +16 -0
  66. package/dist/collection/utils/liveagents/liveagent-factory-services.js.map +1 -0
  67. package/dist/collection/utils/liveagents/liveagent-types.js +7 -0
  68. package/dist/collection/utils/liveagents/liveagent-types.js.map +1 -0
  69. package/dist/collection/utils/liveagents/providers/salesforce.js +514 -0
  70. package/dist/collection/utils/liveagents/providers/salesforce.js.map +1 -0
  71. package/dist/collection/utils/utils.js +3 -1
  72. package/dist/collection/utils/utils.js.map +1 -1
  73. package/dist/esm/{ai12z-bot-2fef6a69.js → ai12z-bot-be1ed1d2.js} +867 -36
  74. package/dist/esm/ai12z-bot-be1ed1d2.js.map +1 -0
  75. package/dist/esm/ai12z-bot.entry.js +4 -3
  76. package/dist/esm/ai12z-bot.entry.js.map +1 -1
  77. package/dist/esm/ai12z-category_2.entry.js +4 -4
  78. package/dist/esm/ai12z-chat_3.entry.js +15 -15
  79. package/dist/esm/{ai12z-cta-3ad5ae27.js → ai12z-cta-6053340d.js} +3 -3
  80. package/dist/esm/{ai12z-cta-3ad5ae27.js.map → ai12z-cta-6053340d.js.map} +1 -1
  81. package/dist/esm/ai12z-cta.entry.js +3 -3
  82. package/dist/esm/{ai12z-inline-search-e32c5d7c.js → ai12z-inline-search-b8eafc1e.js} +3 -3
  83. package/dist/esm/{ai12z-inline-search-e32c5d7c.js.map → ai12z-inline-search-b8eafc1e.js.map} +1 -1
  84. package/dist/esm/ai12z-inline-search.entry.js +3 -3
  85. package/dist/esm/{ai12z-knowledge-box-02aab09f.js → ai12z-knowledge-box-911c3a4d.js} +2 -2
  86. package/dist/esm/{ai12z-knowledge-box-02aab09f.js.map → ai12z-knowledge-box-911c3a4d.js.map} +1 -1
  87. package/dist/esm/ai12z-knowledge-box.entry.js +2 -2
  88. package/dist/esm/ai12z-mic.entry.js +5 -5
  89. package/dist/esm/{ai12z-search-panel-05e41d81.js → ai12z-search-panel-0c405ec7.js} +2 -2
  90. package/dist/esm/{ai12z-search-panel-05e41d81.js.map → ai12z-search-panel-0c405ec7.js.map} +1 -1
  91. package/dist/esm/ai12z-search-panel.entry.js +2 -2
  92. package/dist/esm/ai12z-spinner.entry.js +1 -1
  93. package/dist/esm/{bot-popover_4.entry.js → bot-popover_7.entry.js} +143 -2
  94. package/dist/esm/bot-popover_7.entry.js.map +1 -0
  95. package/dist/esm/dynamic-form.entry.js +2 -2
  96. package/dist/esm/{index-70268273.js → index-bb9461c6.js} +2 -2
  97. package/dist/esm/{index-70268273.js.map → index-bb9461c6.js.map} +1 -1
  98. package/dist/esm/index.js +10 -9
  99. package/dist/esm/index.js.map +1 -1
  100. package/dist/esm/item-list.entry.js +37 -4
  101. package/dist/esm/item-list.entry.js.map +1 -1
  102. package/dist/esm/library.js +1 -1
  103. package/dist/esm/loader.js +1 -1
  104. package/dist/esm/logger-2e094dec.js +99 -0
  105. package/dist/esm/logger-2e094dec.js.map +1 -0
  106. package/dist/esm/search-results-page.entry.js +3 -3
  107. package/dist/esm/{search-results-view-08a64a74.js → search-results-view-189ae99a.js} +3 -3
  108. package/dist/esm/{search-results-view-08a64a74.js.map → search-results-view-189ae99a.js.map} +1 -1
  109. package/dist/esm/{socket-service-a1d81c7c.js → socket-service-47814453.js} +2 -2
  110. package/dist/esm/{socket-service-a1d81c7c.js.map → socket-service-47814453.js.map} +1 -1
  111. package/dist/esm/{utils-101e63da.js → utils-32328158.js} +5 -3
  112. package/dist/esm/utils-32328158.js.map +1 -0
  113. package/dist/library/index.esm.js +1 -1
  114. package/dist/library/library.css +1 -8
  115. package/dist/library/library.esm.js +1 -1
  116. package/dist/library/library.esm.js.map +1 -1
  117. package/dist/library/{p-ee53a0f9.js → p-0bd40dab.js} +2 -2
  118. package/dist/library/{p-114edb95.js → p-10bc78e6.js} +2 -2
  119. package/dist/library/{p-658b11ec.entry.js → p-127293b1.entry.js} +2 -2
  120. package/dist/library/p-2b2ba56d.entry.js +2 -0
  121. package/dist/library/p-2e23634f.js +2 -0
  122. package/dist/library/p-2e23634f.js.map +1 -0
  123. package/dist/library/{p-a6c3d299.entry.js → p-33346f7a.entry.js} +2 -2
  124. package/dist/library/{p-13a1f744.js → p-417259ec.js} +2 -2
  125. package/dist/library/{p-df52b110.entry.js → p-4a03f562.entry.js} +2 -2
  126. package/dist/library/p-6f98c734.entry.js +2 -0
  127. package/dist/library/p-6fc19ca8.entry.js +2 -0
  128. package/dist/library/{p-d3f170a0.js → p-7ff15478.js} +2 -2
  129. package/dist/library/p-8757c7c1.entry.js +2 -0
  130. package/dist/library/p-8757c7c1.entry.js.map +1 -0
  131. package/dist/library/p-8f9e1950.entry.js +2 -0
  132. package/dist/library/{p-ca41e087.entry.js → p-990791a4.entry.js} +2 -2
  133. package/dist/library/p-a3194d55.entry.js +2 -0
  134. package/dist/library/p-aa6f4b43.js +2 -0
  135. package/dist/library/p-aa6f4b43.js.map +1 -0
  136. package/dist/library/{p-08f27fee.js → p-b2c17c2e.js} +2 -2
  137. package/dist/library/{p-d19a1156.js → p-d6592376.js} +2 -2
  138. package/dist/library/{p-cc8b7cf7.entry.js → p-eb6e2296.entry.js} +2 -2
  139. package/dist/library/p-ecd10df0.entry.js +2 -0
  140. package/dist/library/{p-deb7adfa.entry.js → p-ef2b5422.entry.js} +2 -2
  141. package/dist/library/p-ef2b5422.entry.js.map +1 -0
  142. package/dist/library/{p-090767a4.js → p-f0af3eb0.js} +2 -2
  143. package/dist/library/p-f8a593f0.js +2 -0
  144. package/dist/library/p-f8a593f0.js.map +1 -0
  145. package/dist/types/components/ai12z-bot/ai12z-bot.d.ts +14 -4
  146. package/dist/types/components/ai12z-bot/components/chat-avatar/chat-avatar.d.ts +5 -0
  147. package/dist/types/components/ai12z-bot/components/liveagent-chat/liveagent-chat.d.ts +36 -0
  148. package/dist/types/components/ai12z-bot/components/typing-indicator/typing-indicator.d.ts +9 -0
  149. package/dist/types/components/ai12z-cta/components/itemlist/item-list.d.ts +4 -1
  150. package/dist/types/components.d.ts +74 -0
  151. package/dist/types/utils/liveagents/chateventbus.d.ts +9 -0
  152. package/dist/types/utils/liveagents/liveagent-event-handler.d.ts +25 -0
  153. package/dist/types/utils/liveagents/liveagent-factory-services.d.ts +8 -0
  154. package/dist/types/utils/liveagents/liveagent-types.d.ts +30 -0
  155. package/dist/types/utils/liveagents/providers/salesforce.d.ts +100 -0
  156. package/package.json +2 -2
  157. package/dist/cjs/ai12z-bot-787aa8c7.js.map +0 -1
  158. package/dist/cjs/bot-popover_4.cjs.entry.js.map +0 -1
  159. package/dist/cjs/utils-4ead6c2d.js.map +0 -1
  160. package/dist/esm/ai12z-bot-2fef6a69.js.map +0 -1
  161. package/dist/esm/bot-popover_4.entry.js.map +0 -1
  162. package/dist/library/p-10ebae39.entry.js +0 -2
  163. package/dist/library/p-1b060cba.js +0 -2
  164. package/dist/library/p-1b060cba.js.map +0 -1
  165. package/dist/library/p-29109fde.entry.js +0 -2
  166. package/dist/library/p-93e7d505.entry.js +0 -2
  167. package/dist/library/p-9d3ce3e4.entry.js +0 -2
  168. package/dist/library/p-a3e23c65.entry.js +0 -2
  169. package/dist/library/p-a3e23c65.entry.js.map +0 -1
  170. package/dist/library/p-b96dcdaf.entry.js +0 -2
  171. package/dist/library/p-cd0da4e6.entry.js +0 -2
  172. package/dist/library/p-deb7adfa.entry.js.map +0 -1
  173. package/dist/library/p-e6b2119a.js +0 -2
  174. package/dist/library/p-e6b2119a.js.map +0 -1
  175. /package/dist/library/{p-ee53a0f9.js.map → p-0bd40dab.js.map} +0 -0
  176. /package/dist/library/{p-114edb95.js.map → p-10bc78e6.js.map} +0 -0
  177. /package/dist/library/{p-658b11ec.entry.js.map → p-127293b1.entry.js.map} +0 -0
  178. /package/dist/library/{p-10ebae39.entry.js.map → p-2b2ba56d.entry.js.map} +0 -0
  179. /package/dist/library/{p-a6c3d299.entry.js.map → p-33346f7a.entry.js.map} +0 -0
  180. /package/dist/library/{p-13a1f744.js.map → p-417259ec.js.map} +0 -0
  181. /package/dist/library/{p-df52b110.entry.js.map → p-4a03f562.entry.js.map} +0 -0
  182. /package/dist/library/{p-29109fde.entry.js.map → p-6f98c734.entry.js.map} +0 -0
  183. /package/dist/library/{p-93e7d505.entry.js.map → p-6fc19ca8.entry.js.map} +0 -0
  184. /package/dist/library/{p-d3f170a0.js.map → p-7ff15478.js.map} +0 -0
  185. /package/dist/library/{p-9d3ce3e4.entry.js.map → p-8f9e1950.entry.js.map} +0 -0
  186. /package/dist/library/{p-ca41e087.entry.js.map → p-990791a4.entry.js.map} +0 -0
  187. /package/dist/library/{p-b96dcdaf.entry.js.map → p-a3194d55.entry.js.map} +0 -0
  188. /package/dist/library/{p-08f27fee.js.map → p-b2c17c2e.js.map} +0 -0
  189. /package/dist/library/{p-d19a1156.js.map → p-d6592376.js.map} +0 -0
  190. /package/dist/library/{p-cc8b7cf7.entry.js.map → p-eb6e2296.entry.js.map} +0 -0
  191. /package/dist/library/{p-cd0da4e6.entry.js.map → p-ecd10df0.entry.js.map} +0 -0
  192. /package/dist/library/{p-090767a4.js.map → p-f0af3eb0.js.map} +0 -0
@@ -4,11 +4,644 @@ const index = require('./index-171f7ecf.js');
4
4
  const index$3 = require('./index-286c64af.js');
5
5
  const showdown = require('./showdown-f472e772.js');
6
6
  const index$2 = require('./index-8a74626f.js');
7
- const utils = require('./utils-4ead6c2d.js');
8
- const index$1 = require('./index-5f933fd6.js');
7
+ const logger$1 = require('./logger-63779020.js');
8
+ const utils = require('./utils-028477b7.js');
9
+ const index$1 = require('./index-0d034972.js');
9
10
  const globalStore = require('./global-store-1279b6b4.js');
10
11
 
11
- const ai12zBotCss = ":host{font-family:var(--ai12z-bot-font-family) !important;font-size:var(--ai12z-bot-font-size) !important}.floating-icon{position:fixed;cursor:pointer;top:90%;transform:translateY(-50%);background-color:var(--ai12z-bot-primary-bgcolor);color:var(--ai12z-bot-primary-color);padding:10px;border-radius:50%;box-shadow:0 2px 5px rgba(0, 0, 0, 0.2);z-index:1000;}.custom-floating-icon{position:fixed;cursor:pointer;top:90%;transform:translateY(-50%);z-index:1000}.left{left:10px}.right{right:10px}.minimizebtn{margin:10px}.chat-window.minimized{width:350px;height:50px;overflow:hidden}.chat-window{position:fixed;bottom:20px;background-color:var(--ai12z-bot-primary-color);border:1px solid #ccc;box-shadow:0 2px 10px rgba(0, 0, 0, 0.2);display:flex;flex-direction:column;border-radius:10px;z-index:1000;opacity:0;transform:translateY(20px);transition:opacity 0.3s ease,\n transform 0.3s ease}.chat-left{left:70px}.chat-right{right:70px}@keyframes fadeInSlideUp{0%{opacity:0;transform:translateY(20px) scale(0.9)}100%{opacity:1;transform:translateY(0) scale(1)}}@keyframes fadeOutSlideDown{0%{opacity:1;transform:translateY(0) scale(1)}100%{opacity:0;transform:translateY(20px) scale(0.9)}}.chat-window-open{animation:fadeInSlideUp 0.4s ease-out forwards;pointer-events:auto}.chat-window-close{pointer-events:none;animation:fadeOutSlideDown 0.3s ease-in forwards}.chat-header{background-color:var(--ai12z-bot-primary-bgcolor);color:var(--ai12z-bot-primary-color);padding:10px;display:flex;align-items:center;border-top-left-radius:10px;border-top-right-radius:10px;height:56px}.chat-name{flex-grow:1}.avatar{width:30px;height:30px;border-radius:50%;margin-right:10px}.header-title{margin:0 0 0 14px;padding:1px 0;font-size:14px;line-height:14px}.chat-body{height:100%;overflow-y:auto;display:flex;flex-direction:column;gap:10px;overflow-x:hidden;}.chat-body::-webkit-scrollbar{width:5px;height:5px;}.chat-body::-webkit-scrollbar-thumb{background-color:#888;border-radius:10px;}.message{padding:10px;border-radius:15px;font-size:14px;line-height:1.4;word-wrap:break-word}.message-user{align-self:flex-end;color:var(--ai12z-bot-primary-color);}.message-text{max-width:100%;display:inline-block;position:relative}.message-bot{align-self:flex-start;background-color:var(--ai12z-bot-secondary-bgcolor);color:var(--ai12z-bot-secondary-color);border-top-left-radius:0;flex-direction:row;border-radius:7px}.msg-wrapper{display:flex}.bot-avatar{width:30px;height:30px;border-radius:50%;margin-right:10px}.message-content{display:flex;flex-direction:column;align-items:flex-start;max-width:fit-content}.message-timestamp{font-size:0.75rem;color:var(--ai12z-bot-text-mute);margin-top:2px;align-self:flex-end;}.chat-footer{flex-direction:column;padding:10px;display:flex;border-bottom-left-radius:10px;border-bottom-right-radius:10px;border-top:1px solid var(--ai12z-bot-primary-bgcolor)}.chat-footer textarea{flex-grow:1;padding:5px;border-radius:6px;margin-right:5px;resize:none;scrollbar-width:thin;overflow:hidden}.chat-footer textarea:focus{outline:none;border-color:var(--ai12z-bot-primary-bgcolor)}.chat-footer button{color:var(--ai12z-bot-primary-bgcolor)}.chat-footers button{color:var(--ai12z-bot-primary-color);border:none;padding:5px 10px;border-radius:3px;cursor:pointer}.close-btn{background:none;border:none;color:var(--ai12z-bot-primary-color);font-size:20px;cursor:pointer}.timestamp{font-size:10px;color:var(--ai12z-bot-text-mute);margin:14px 0;text-align:center;text-transform:uppercase}span.prose{font-size:14px;}.message-user span.prose{color:var(--ai12z-bot-primary-color);background-color:var(--ai12z-bot-primary-bgcolor);padding:10px;border-radius:6px}#fileInput{display:none}.custom-attachment{cursor:pointer;display:flex;align-items:center;justify-content:center}.image-Container{position:relative;display:inline-block;margin-right:10px}.delete-image{opacity:3;position:absolute;right:3px;top:0;cursor:pointer;line-height:10px}.ai12zBtn{background-color:var(--ai12z-bot-primary-bgcolor) !important;color:var(--ai12z-bot-primary-color);padding:5px 10px;border:none;border-radius:5px;cursor:pointer;text-decoration:none;margin:5px}.hamburger{font-size:30px;background:none;border:none;color:white;cursor:pointer;padding-right:12px}@keyframes zoomIn{0%{transform:scale(0);opacity:0}100%{transform:scale(1);opacity:1}}@keyframes zoomOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0);opacity:0}}.menu{position:absolute;top:55px;left:0;width:200px;background-color:var(--ai12z-bot-nav-bgcolor);color:var(--ai12z-bot-primary-color);overflow:hidden;transform-origin:top left}.menu.open{animation:zoomIn 0.5s forwards;}.menu.closed{animation:zoomOut 0.5s forwards;}.menu ul{list-style-type:none;padding:10px}.custom-privacy{color:var(--ai12z-bot-privacy-color);padding-bottom:10px;padding-left:5px;margin-top:auto;}.menu ul li{padding:10px;cursor:pointer}@media (max-width: 768px){.hide-chatbot{display:none}.chat-window{width:100% !important;height:100% !important;right:0%;bottom:0%}.pagination-controls button{padding:5px 5px}}.follow-up{display:flex;cursor:pointer;gap:0.5rem;color:var(--ai12z-bot-followup-color);font-size:var(--ai12z-bot-followup-font-size)}.custom-svg-checkbox{margin-top:0.25rem;width:1rem;height:1rem;position:absolute}.follow-up-input{appearance:none;width:1rem;height:1rem;border-width:2px;flex-shrink:0;margin-top:0.25rem;border-radius:0.125rem;border-color:rgb(59 130 246)}.follow-up-input:checked{background-color:var(--ai12z-bot-followup-bg-color);border-width:0px}.bubble-width{width:90%}";
12
+ // ILiveAgentProvider.ts
13
+ const envMode = index.Env.DATA_MODE ;
14
+ // Additional methods can be added as needed for more functionality
15
+ // This interface defines the contract for a Live Agent provider, allowing for chat management and message handling.
16
+ // Implementations of this interface would handle the specifics of interacting with a live chat service.
17
+
18
+ class EventBus {
19
+ constructor() {
20
+ this.events = new Map();
21
+ }
22
+ on(event, listener) {
23
+ if (!this.events.has(event)) {
24
+ this.events.set(event, new Set());
25
+ }
26
+ this.events.get(event).add(listener);
27
+ }
28
+ off(event, listener) {
29
+ var _a;
30
+ (_a = this.events.get(event)) === null || _a === void 0 ? void 0 : _a.delete(listener);
31
+ }
32
+ emit(event, data) {
33
+ var _a;
34
+ (_a = this.events.get(event)) === null || _a === void 0 ? void 0 : _a.forEach(listener => listener(data));
35
+ }
36
+ }
37
+ const ChatEventBus = new EventBus();
38
+
39
+ const logger = new logger$1.Logger("SalesforceLiveAgentProvider", {
40
+ logLevel: logger$1.LogLevel.Info, // Set to Debug for detailed logs",
41
+ remoteLoggingUrl: "",
42
+ });
43
+ /**
44
+ * Refactor the salesforce implementation with the Messaging for In-App and Web REST API instead of chatter
45
+ */
46
+ class SalesforceLiveAgentProvider {
47
+ constructor() {
48
+ this.configSettings = null;
49
+ this.sessionContext = null;
50
+ this.endpointSSE = "";
51
+ this.configSettings = null;
52
+ this.sessionContext = null;
53
+ this.endpointSSE = utils.getEndpoint(envMode);
54
+ }
55
+ /**
56
+ * Authenticates with Salesforce MIAW and retrieves an access token.
57
+ * This method should be called before starting a chat session.
58
+ * @throws {Error} If authentication fails.
59
+ * @returns {Promise<void>}
60
+ * @memberof SalesforceLiveAgentProvider
61
+ * @description This method sends a POST request to the Salesforce MIAW authorization endpoint to obtain an access token.
62
+ * The access token is stored in the session context for subsequent API calls.
63
+ */
64
+ async authenticate() {
65
+ var _a, _b, _c;
66
+ const response = await fetch(`${(_a = this.configSettings) === null || _a === void 0 ? void 0 : _a.instanceUrl}/iamessage/api/v2/authorization/unauthenticated/access-token`, {
67
+ method: "POST",
68
+ headers: { "Content-Type": "application/json" },
69
+ body: JSON.stringify({
70
+ orgId: (_b = this.configSettings) === null || _b === void 0 ? void 0 : _b.orgId,
71
+ esDeveloperName: (_c = this.configSettings) === null || _c === void 0 ? void 0 : _c.messagingChannelId,
72
+ capabilitiesVersion: "1",
73
+ platform: "Web",
74
+ context: {
75
+ appName: "DemoMessagingClient",
76
+ clientVersion: "1.0.0",
77
+ },
78
+ }),
79
+ });
80
+ if (!response.ok) {
81
+ throw new Error(`Failed to authenticate with Salesforce MIAW: [error]: ${response.status} ${response.statusText}`);
82
+ }
83
+ const data = await response.json();
84
+ if (!this.sessionContext)
85
+ this.sessionContext = {};
86
+ this.sessionContext.accessToken = data.accessToken;
87
+ this.sessionContext.sessionId = data.lastEventId;
88
+ }
89
+ /**
90
+ * Starts a new chat session with Salesforce Live Agent.
91
+ * This method should be called after authentication to initiate a chat session.
92
+ * @throws {Error} If starting the chat session fails.
93
+ * @returns {Promise<void>}
94
+ * @memberof SalesforceLiveAgentProvider
95
+ * @description This method creates a new conversation in Salesforce and sets up the session context.
96
+ * It emits a "liveAgentReady" event when the session is successfully started.
97
+ */
98
+ async startSession() {
99
+ var _a, _b, _c, _d, _e, _f, _g, _h;
100
+ const conversationId = crypto.randomUUID().toLowerCase();
101
+ const conversationResponse = await fetch(`${(_a = this.configSettings) === null || _a === void 0 ? void 0 : _a.instanceUrl}/iamessage/api/v2/conversation`, {
102
+ method: "POST",
103
+ headers: {
104
+ "Content-Type": "application/json",
105
+ "Authorization": `Bearer ${(_b = this.sessionContext) === null || _b === void 0 ? void 0 : _b.accessToken}`,
106
+ },
107
+ body: JSON.stringify({
108
+ conversationId: conversationId,
109
+ esDeveloperName: (_c = this.configSettings) === null || _c === void 0 ? void 0 : _c.messagingChannelId,
110
+ routingAttributes: {
111
+ recordId: (_d = this.sessionContext) === null || _d === void 0 ? void 0 : _d.conversationId,
112
+ },
113
+ }),
114
+ });
115
+ if (!conversationResponse.ok) {
116
+ throw new Error(`Conversation start failed: ${conversationResponse.status} ${conversationResponse.statusText}`);
117
+ }
118
+ // const conversationData: any = await conversationResponse.json()
119
+ if (conversationResponse.ok) {
120
+ // console.log("Conversation started successfully", conversationResponse)
121
+ this.sessionContext.conversationId = conversationId;
122
+ ChatEventBus.emit("liveAgentReady", undefined);
123
+ // console.log(this.sessionContext?.initialMessages)
124
+ // Send initial message to the agent here need to format the message properly
125
+ // Iterate the initialmessages and create a user friendly display message with contact user: for user input and bot: as bot response
126
+ let formatInitialMessages = "";
127
+ if (((_e = this.sessionContext) === null || _e === void 0 ? void 0 : _e.initialMessages) && ((_f = this.sessionContext) === null || _f === void 0 ? void 0 : _f.initialMessages.length) > 0) {
128
+ (_g = this.sessionContext.initialMessages[0]) === null || _g === void 0 ? void 0 : _g.messages.forEach((message) => {
129
+ if (!(message === null || message === void 0 ? void 0 : message.text))
130
+ return;
131
+ // strip the <p> </p> tags from the message
132
+ message.text = message.text.replace(/<\/?p>/g, "");
133
+ if (message === null || message === void 0 ? void 0 : message.isUser) {
134
+ formatInitialMessages += `User: ${message.text}\n`;
135
+ }
136
+ else {
137
+ formatInitialMessages += `Bot: ${message.text}\n`;
138
+ }
139
+ });
140
+ }
141
+ // console.log("Formatted Initial Messages", formatInitialMessages)
142
+ if (formatInitialMessages) {
143
+ this.sendMessage({ isNewSession: true, sessionId: ((_h = this.sessionContext) === null || _h === void 0 ? void 0 : _h.sessionId) || "", message: formatInitialMessages });
144
+ }
145
+ // await this.pollMessages("")
146
+ this.listenToMessages();
147
+ }
148
+ }
149
+ /**
150
+ * Initializes the Salesforce Live Agent provider and starts listening for messages.
151
+ * This should be called after the user has authenticated and is ready to start a chat session.
152
+ */
153
+ async initialize(startChatOptions) {
154
+ var _a, _b, _c;
155
+ logger.debug("Initializing Salesforce Live Agent Provider");
156
+ if (!this.configSettings) {
157
+ this.configSettings = (startChatOptions === null || startChatOptions === void 0 ? void 0 : startChatOptions.config) || this.configSettings;
158
+ }
159
+ if (!((_a = this.configSettings) === null || _a === void 0 ? void 0 : _a.instanceUrl) || !((_b = this.configSettings) === null || _b === void 0 ? void 0 : _b.orgId) || !((_c = this.configSettings) === null || _c === void 0 ? void 0 : _c.messagingChannelId)) {
160
+ throw new Error("Missing required configuration settings for Salesforce Live Agent Provider");
161
+ }
162
+ if (!this.sessionContext) {
163
+ this.sessionContext = {
164
+ accessToken: "",
165
+ lastMessageReadTime: 0,
166
+ sessionId: "",
167
+ initialMessages: (startChatOptions === null || startChatOptions === void 0 ? void 0 : startChatOptions.messageHistory) || [],
168
+ isActive: false,
169
+ conversationId: (startChatOptions === null || startChatOptions === void 0 ? void 0 : startChatOptions.conversationId) || crypto.randomUUID().toLowerCase(),
170
+ userId: (startChatOptions === null || startChatOptions === void 0 ? void 0 : startChatOptions.userId) || "",
171
+ };
172
+ }
173
+ try {
174
+ await this.authenticate();
175
+ await this.startSession();
176
+ }
177
+ catch (error) {
178
+ logger.error("Error initializing Salesforce Live Agent Provider:", error);
179
+ throw error;
180
+ }
181
+ }
182
+ parseMessageEntries(entries) {
183
+ const filteredEntries = entries.filter(entry => {
184
+ var _a, _b, _c, _d;
185
+ return entry.entryType === "Message" && ((_c = (_b = (_a = entry.entryPayload) === null || _a === void 0 ? void 0 : _a.abstractMessage) === null || _b === void 0 ? void 0 : _b.staticContent) === null || _c === void 0 ? void 0 : _c.text) && ((_d = entry.sender) === null || _d === void 0 ? void 0 : _d.role) != "EndUser";
186
+ });
187
+ const mappedEntries = filteredEntries.map(entry => {
188
+ const result = {
189
+ id: entry.entryPayload.abstractMessage.id,
190
+ content: entry.entryPayload.abstractMessage.staticContent.text,
191
+ sender: {
192
+ role: this.mapSenderRole(entry.sender.role),
193
+ displayName: entry.senderDisplayName || "Unknown",
194
+ },
195
+ timestamp: entry.clientTimestamp,
196
+ };
197
+ return result;
198
+ });
199
+ return mappedEntries;
200
+ }
201
+ handleParticipantChange(event) {
202
+ try {
203
+ logger.debug("Participant change event received:", event.data);
204
+ if (!event.data)
205
+ return;
206
+ // Parse the event data
207
+ const data = JSON.parse(event.data);
208
+ const entries = JSON.parse(data.conversationEntry.entryPayload).entries;
209
+ let entryAddEventMessage = [];
210
+ entries.forEach((entry) => {
211
+ var _a, _b;
212
+ const conId = crypto.randomUUID();
213
+ if (entry.operation === "add" && entry.participant.role.toLowerCase() === "agent") {
214
+ entryAddEventMessage.push({
215
+ id: conId,
216
+ isUser: false,
217
+ conversationId: conId,
218
+ type: "system",
219
+ text: `${entry.displayName} has joined the chat`,
220
+ timestamp: new Date(),
221
+ sender: {
222
+ role: "agent",
223
+ displayName: (_a = entry === null || entry === void 0 ? void 0 : entry.displayName) !== null && _a !== void 0 ? _a : "System",
224
+ },
225
+ });
226
+ }
227
+ if (entry.operation === "remove" && entry.participant.role.toLowerCase() === "agent") {
228
+ entryAddEventMessage.push({
229
+ id: conId,
230
+ type: "system",
231
+ text: `${entry.displayName} has left the chat`,
232
+ conversationId: conId,
233
+ isUser: false,
234
+ timestamp: new Date(),
235
+ sender: {
236
+ role: "agent",
237
+ displayName: (_b = entry === null || entry === void 0 ? void 0 : entry.displayName) !== null && _b !== void 0 ? _b : "System",
238
+ },
239
+ });
240
+ }
241
+ });
242
+ // return entryAddEventMessage ?? []
243
+ if ((entryAddEventMessage === null || entryAddEventMessage === void 0 ? void 0 : entryAddEventMessage.length) > 0) {
244
+ // Emit the event to notify the parent component
245
+ ChatEventBus.emit("AGENT_EVENT", entryAddEventMessage);
246
+ }
247
+ }
248
+ catch (error) {
249
+ logger.error("Error handling participant change event:", error);
250
+ // Handle error appropriately, e.g., log it or notify the user
251
+ }
252
+ }
253
+ mapEntriesToMessages(entries) {
254
+ const mappedEntries = entries.map((entry) => ({
255
+ id: entry.entryPayload.abstractMessage.id,
256
+ text: entry.entryPayload.abstractMessage.staticContent.text,
257
+ sender: {
258
+ role: this.mapSenderRole(entry.sender.role),
259
+ displayName: entry.senderDisplayName || "Unknown",
260
+ },
261
+ type: entry.sender.role === "endUser" ? "user" : "ai",
262
+ timestamp: new Date(entry.timestamp),
263
+ isUser: false,
264
+ conversationId: entry.entryPayload.abstractMessage.id,
265
+ }));
266
+ return mappedEntries;
267
+ }
268
+ handleParticipantMessage(event) {
269
+ var _a, _b;
270
+ try {
271
+ if (!event.data)
272
+ return;
273
+ // Parse the event data
274
+ const data = JSON.parse(event.data);
275
+ /**
276
+ * Ignore messages from EndUser role
277
+ * This is to prevent processing messages that are not relevant to the agent's response
278
+ */
279
+ if (((_b = (_a = data === null || data === void 0 ? void 0 : data.conversationEntry) === null || _a === void 0 ? void 0 : _a.sender) === null || _b === void 0 ? void 0 : _b.role) === "EndUser") {
280
+ logger.debug("Ignoring message from EndUser role");
281
+ return;
282
+ }
283
+ const entryPayload = JSON.parse(data.conversationEntry.entryPayload);
284
+ data.conversationEntry.entryPayload = entryPayload;
285
+ const messageEntries = this.mapEntriesToMessages([data.conversationEntry]);
286
+ if ((messageEntries === null || messageEntries === void 0 ? void 0 : messageEntries.length) > 0) {
287
+ // Emit the event to notify the parent component
288
+ ChatEventBus.emit("AGENT_MESSAGE", messageEntries);
289
+ }
290
+ }
291
+ catch (error) {
292
+ logger.error("Error handling participant message event:", error);
293
+ // Handle error appropriately, e.g., log it or notify the user
294
+ }
295
+ }
296
+ mapSenderRole(role) {
297
+ const normalizedRole = role.toLowerCase();
298
+ if (normalizedRole === "chatbot")
299
+ return "agent";
300
+ if (normalizedRole === "enduser")
301
+ return "endUser";
302
+ return "unknown";
303
+ }
304
+ listenToMessages() {
305
+ var _a, _b, _c;
306
+ logger.debug("Listening to messages from Salesforce Live Agent");
307
+ // this.endpointSSE = "http://localhost:5050"
308
+ const eventSource = new EventSource(`${this.endpointSSE}/bot/liveagent/sse?token=${(_a = this.sessionContext) === null || _a === void 0 ? void 0 : _a.accessToken}&org_id=${(_b = this.configSettings) === null || _b === void 0 ? void 0 : _b.orgId}&sse_url=${(_c = this.configSettings) === null || _c === void 0 ? void 0 : _c.instanceUrl}`, {
309
+ withCredentials: true,
310
+ });
311
+ if (!eventSource) {
312
+ logger.error("Failed to create EventSource");
313
+ throw new Error("Failed to create EventSource");
314
+ }
315
+ eventSource.onerror = () => {
316
+ logger.error("❌ SSE Error: Connection lost or error occurred");
317
+ // Handle error, e.g., retry connection or notify user
318
+ ChatEventBus.emit("AGENT_ERROR", true);
319
+ // Optionally, you can close the EventSource if needed
320
+ eventSource.close();
321
+ };
322
+ eventSource.onopen = () => {
323
+ logger.debug("✅ SSE Connection Established");
324
+ // ChatEventBus.emit("liveAgentReady", undefined)
325
+ };
326
+ eventSource.onmessage = event => {
327
+ var _a, _b;
328
+ try {
329
+ const parsedEventData = JSON.parse(event.data);
330
+ logger.debug("📡 Message Received on entrytype:", (_a = parsedEventData === null || parsedEventData === void 0 ? void 0 : parsedEventData.conversationEntry) === null || _a === void 0 ? void 0 : _a.entryType, " --- ", event.data);
331
+ // Handle incoming messages if needed
332
+ switch ((_b = parsedEventData === null || parsedEventData === void 0 ? void 0 : parsedEventData.conversationEntry) === null || _b === void 0 ? void 0 : _b.entryType) {
333
+ case "RoutingResult":
334
+ case "RoutingWorkResult":
335
+ logger.debug("Conversation Routing Result:", event.data);
336
+ // Handle conversation routing result if needed
337
+ ChatEventBus.emit("AGENT_SESSION_CREATED", true);
338
+ ChatEventBus.emit("AGENT_EVENT", []);
339
+ break;
340
+ case "ParticipantChanged":
341
+ logger.debug("Conversation ParticipantChanged event received:", event === null || event === void 0 ? void 0 : event.data);
342
+ this.handleParticipantChange(event);
343
+ break;
344
+ case "Message":
345
+ this.handleParticipantMessage(event);
346
+ break;
347
+ case "CloseConversation":
348
+ ChatEventBus.emit("CONVERSATION_CLOSED", true);
349
+ eventSource.close();
350
+ break;
351
+ case "DeliveryAcknowledgement":
352
+ case "ReadAcknowledgement":
353
+ logger.debug("Conversation event received:", event === null || event === void 0 ? void 0 : event.data);
354
+ // Handle conversation close if needed
355
+ // ChatEventBus.emit("AGENT_EVENT", event.data)
356
+ break;
357
+ case "TypingStartedIndicator":
358
+ ChatEventBus.emit("TYPING_STARTED", true);
359
+ break;
360
+ case "TypingStoppedIndicator":
361
+ logger.debug("Typing indicator received:", event.data);
362
+ // Handle typing indicator if needed
363
+ ChatEventBus.emit("TYPING_STOPPED", true);
364
+ break;
365
+ case "StreamingToken":
366
+ logger.debug("Streaming token received", event.data);
367
+ // Handle streaming token if needed
368
+ // ChatEventBus.emit("streamingTokenReceived", event.data)
369
+ break;
370
+ case "ProgressIndicator":
371
+ logger.debug("Progress indicator received", event.data);
372
+ // Handle progress indicator if needed
373
+ // ChatEventBus.emit("progressIndicatorReceived", event.data)
374
+ break;
375
+ }
376
+ }
377
+ catch (e) {
378
+ logger.error("Failed to parse event data:", e);
379
+ return;
380
+ }
381
+ };
382
+ }
383
+ /** Interface Implementation */
384
+ /**
385
+ * @param startChatOptions
386
+ * @description This method initializes the Salesforce Live Agent provider and starts a chat session.
387
+ * It authenticates with Salesforce, starts a new conversation, and sets up the session context.
388
+ * It emits a "liveAgentReady" event when the session is successfully started.
389
+ * @throws {Error} If initialization fails.
390
+ * @returns {Promise<void>}
391
+ * @memberof SalesforceLiveAgentProvider
392
+ *
393
+ *
394
+ */
395
+ async startChat(startChatOptions) {
396
+ this.initialize(startChatOptions);
397
+ }
398
+ /**
399
+ *
400
+ * @param sendMessageOptions
401
+ * @description This method sends a message to the Salesforce Live Agent.
402
+ * It constructs a POST request to the Salesforce MIAW API to send the message.
403
+ * @throws {Error} If sending the message fails.
404
+ * @returns {Promise<void>}
405
+ * @memberof SalesforceLiveAgentProvider
406
+ *
407
+ */
408
+ async sendMessage(sendMessageOptions) {
409
+ var _a, _b, _c, _d;
410
+ const res = await fetch(`${(_a = this.configSettings) === null || _a === void 0 ? void 0 : _a.instanceUrl}/iamessage/api/v2/conversation/${(_b = this.sessionContext) === null || _b === void 0 ? void 0 : _b.conversationId}/message`, {
411
+ method: "POST",
412
+ headers: {
413
+ "Authorization": `Bearer ${(_c = this.sessionContext) === null || _c === void 0 ? void 0 : _c.accessToken}`,
414
+ "Content-Type": "application/json",
415
+ },
416
+ body: JSON.stringify({
417
+ message: {
418
+ id: crypto.randomUUID(),
419
+ messageType: "StaticContentMessage",
420
+ staticContent: {
421
+ formatType: "Text",
422
+ text: sendMessageOptions === null || sendMessageOptions === void 0 ? void 0 : sendMessageOptions.message,
423
+ },
424
+ },
425
+ esDeveloperName: (_d = this.configSettings) === null || _d === void 0 ? void 0 : _d.messagingChannelId,
426
+ isNewMessagingSession: (sendMessageOptions === null || sendMessageOptions === void 0 ? void 0 : sendMessageOptions.isNewSession) || false,
427
+ language: "",
428
+ }),
429
+ });
430
+ if (!res.ok)
431
+ throw new Error("Failed to send message");
432
+ }
433
+ /**
434
+ *
435
+ * @param _sessionId
436
+ * @returns
437
+ * @description This method polls for new messages in the Salesforce Live Agent conversation.
438
+ * It sends a GET request to the Salesforce MIAW API to retrieve conversation entries.
439
+ * It processes the entries and emits a "messageReceived" event with the new messages.
440
+ * @throws {Error} If polling fails.
441
+ * @returns {Promise<string[] | any>}
442
+ * @memberof SalesforceLiveAgentProvider
443
+ */
444
+ async pollMessages(_sessionId) {
445
+ return new Promise(async (resolve, reject) => {
446
+ this.sessionContext.lastMessageReadTime = 0;
447
+ const poll = async () => {
448
+ var _a, _b, _c;
449
+ try {
450
+ const url = new URL(`${(_a = this.configSettings) === null || _a === void 0 ? void 0 : _a.instanceUrl}/iamessage/api/v2/conversation/${(_b = this.sessionContext) === null || _b === void 0 ? void 0 : _b.conversationId}/entries`);
451
+ url.searchParams.append("limit", "50");
452
+ url.searchParams.append("direction", "FromEnd");
453
+ url.searchParams.append("startTimestamp", `${this.sessionContext.lastMessageReadTime}`);
454
+ const response = await fetch(url.toString(), {
455
+ method: "GET",
456
+ headers: {
457
+ Authorization: `Bearer ${(_c = this.sessionContext) === null || _c === void 0 ? void 0 : _c.accessToken}`,
458
+ },
459
+ });
460
+ const data = await response.json();
461
+ const unsortedEntries = this.parseMessageEntries(data.conversationEntries);
462
+ const sortedEntries = unsortedEntries.sort((a, b) => a.timestamp - b.timestamp);
463
+ const entries = sortedEntries.map(entry => {
464
+ var _a;
465
+ return ({
466
+ text: entry.content,
467
+ isUser: false,
468
+ id: entry.id,
469
+ timestamp: new Date(entry.timestamp),
470
+ images: [],
471
+ conversationId: entry.id,
472
+ formModel: "",
473
+ surveyDomId: "",
474
+ sender: {
475
+ role: entry.sender.role === "endUser" ? "user" : "ai",
476
+ displayName: (_a = entry === null || entry === void 0 ? void 0 : entry.sender) === null || _a === void 0 ? void 0 : _a.displayName,
477
+ },
478
+ });
479
+ });
480
+ if ((entries === null || entries === void 0 ? void 0 : entries.length) > 0) {
481
+ this.sessionContext.lastMessageReadTime = new Date().getTime();
482
+ ChatEventBus.emit("messageReceived", entries);
483
+ }
484
+ resolve(entries);
485
+ // No messages yet, poll again after delay
486
+ setTimeout(poll, 5000);
487
+ }
488
+ catch (err) {
489
+ logger.error("Error on Polling", err.toString());
490
+ reject(err);
491
+ }
492
+ };
493
+ await poll();
494
+ });
495
+ }
496
+ /**
497
+ *
498
+ * @param sessionId
499
+ * @returns
500
+ * @description This method checks if the chat session is active.
501
+ * It checks the session context to determine if the session is active.
502
+ */
503
+ async isChatActive(sessionId) {
504
+ logger.debug("sessionId", sessionId);
505
+ if (!this.sessionContext)
506
+ return false;
507
+ return this.sessionContext.isActive;
508
+ }
509
+ /**
510
+ *
511
+ * @param sessionId
512
+ * @description This method ends the chat session with Salesforce Live Agent.
513
+ * It sends a POST request to the Salesforce MIAW API to close the conversation.
514
+ */
515
+ async endChat(_sessionId) {
516
+ var _a, _b, _c, _d, _e;
517
+ // console.log("this.sessionContext?.conversationId", this.sessionContext?.conversationId)
518
+ if ((_a = this.sessionContext) === null || _a === void 0 ? void 0 : _a.conversationId) {
519
+ const res = await fetch(`${(_b = this.configSettings) === null || _b === void 0 ? void 0 : _b.instanceUrl}/iamessage/api/v2/conversation/${(_c = this.sessionContext) === null || _c === void 0 ? void 0 : _c.conversationId}?esDeveloperName=${(_d = this.configSettings) === null || _d === void 0 ? void 0 : _d.messagingChannelId}`, {
520
+ method: "DELETE",
521
+ headers: {
522
+ "Authorization": `Bearer ${(_e = this.sessionContext) === null || _e === void 0 ? void 0 : _e.accessToken}`,
523
+ "Content-Type": "application/json",
524
+ },
525
+ });
526
+ if (!(res === null || res === void 0 ? void 0 : res.ok)) {
527
+ logger.warn(`Failed to end the chat`);
528
+ }
529
+ }
530
+ }
531
+ /**
532
+ *
533
+ * @param sessionId
534
+ * @returns
535
+ * @description This method retrieves the chat transcript for the given session ID.
536
+ * It returns an array of messages from the session context.
537
+ */
538
+ async getTranscript(sessionId) {
539
+ logger.debug("sessionId", sessionId);
540
+ if (!this.sessionContext)
541
+ return [];
542
+ return this.sessionContext.initialMessages || [];
543
+ }
544
+ }
545
+
546
+ class LiveAgentProvider {
547
+ constructor() { }
548
+ static getProvider(provider) {
549
+ switch (provider !== null && provider !== void 0 ? provider : this.provider) {
550
+ case "salesforce":
551
+ this.providerInstance = new SalesforceLiveAgentProvider();
552
+ break;
553
+ default:
554
+ throw new Error("Unsupported Live Agent provider");
555
+ }
556
+ return this.providerInstance;
557
+ }
558
+ }
559
+ LiveAgentProvider.provider = "salesforce";
560
+
561
+ /** Refactor the below to code to handle the liveagent events and integrate with the chat system ai12z-bot.tsx */
562
+ class LiveAgentEventHandler {
563
+ constructor() {
564
+ this.logger = new logger$1.Logger("LiveAgentEventHandler", {
565
+ logLevel: logger$1.LogLevel.Warn, // Set log level based on environment or configuration
566
+ });
567
+ /**
568
+ * Called when the `messageReceived` event is emitted.
569
+ * Adds the new message to our state, triggering a UI update.
570
+ */
571
+ this.handleAgentMessage = (message) => {
572
+ let combinesMessage = "";
573
+ if ((message === null || message === void 0 ? void 0 : message.length) > 0) {
574
+ for (const msg of message) {
575
+ combinesMessage += (msg === null || msg === void 0 ? void 0 : msg.text) + "\n\n";
576
+ }
577
+ }
578
+ return combinesMessage;
579
+ };
580
+ this.sendMessage = (sendMessage) => {
581
+ if (this.liveAgentProvider) {
582
+ this.logger.debug("Sending message to Live Agent:", sendMessage.message);
583
+ this.liveAgentProvider.sendMessage(sendMessage);
584
+ }
585
+ else {
586
+ this.logger.warn("Live Agent provider is not initialized. Cannot send message.");
587
+ }
588
+ };
589
+ this.disconnectLiveAgent = () => {
590
+ if (this.liveAgentProvider) {
591
+ this.logger.debug("Disconnecting from Live Agent");
592
+ this.liveAgentProvider.endChat("");
593
+ }
594
+ else {
595
+ this.logger.warn("Live Agent provider is not initialized. Cannot disconnect.");
596
+ }
597
+ };
598
+ }
599
+ addAgentEventMessage(eventMessages) {
600
+ // I have to return a div element with the agent events as a list
601
+ const entryParent = document.createElement("div");
602
+ eventMessages.forEach((eventMsg) => {
603
+ // this.addAgentDivEvent(eventMsg, currentDomId)
604
+ const entry = document.createElement("div");
605
+ entry.className = "py-2 border-b border-gray-200 text-center";
606
+ const label = document.createElement("span");
607
+ label.className = "text-[10px] font-medium text-gray-500 tracking-wide"; // "text-xs font-semibold text-gray-600"
608
+ label.textContent = (eventMsg === null || eventMsg === void 0 ? void 0 : eventMsg.text) || "Agent event";
609
+ entry.appendChild(label);
610
+ entryParent.appendChild(entry);
611
+ });
612
+ return entryParent;
613
+ }
614
+ /**
615
+ * Connects to the specified Live Agent provider and sets up event listeners.
616
+ * @param name - The name of the Live Agent provider (e.g., "salesforce", "custom", "ldesk").
617
+ * @param chatOptions - Options for starting the chat session.
618
+ */
619
+ async connectToLiveAgent(name = "salesforce", chatOptions) {
620
+ try {
621
+ this.logger.debug("Connected to Live Agent", name, " --- ", chatOptions);
622
+ switch (name) {
623
+ case "salesforce":
624
+ this.logger.debug("Using Salesforce Live Agent Provider");
625
+ this.liveAgentProvider = LiveAgentProvider.getProvider(name);
626
+ this.liveAgentProvider.startChat(chatOptions);
627
+ break;
628
+ case "custom":
629
+ this.logger.debug("Using Custom Live Agent Provider");
630
+ break;
631
+ case "liveagent":
632
+ this.logger.debug("Using LiveAgent Live Agent Provider");
633
+ break;
634
+ default:
635
+ throw new Error(`Unsupported Live Agent provider: ${name}`);
636
+ }
637
+ }
638
+ catch (error) {
639
+ this.logger.error("Error connecting to Live Agent:", error);
640
+ }
641
+ }
642
+ }
643
+
644
+ const ai12zBotCss = ":host{font-family:var(--ai12zBot-v2-font-family) !important;font-size:var(--ai12zBot-v2-font-size) !important}.floating-icon{position:fixed;cursor:pointer;top:90%;transform:translateY(-50%);background-color:var(--ai12z-bot-primary-bgcolor);color:var(--ai12z-bot-primary-color);padding:10px;border-radius:50%;box-shadow:0 2px 5px rgba(0, 0, 0, 0.2);z-index:1000;}.custom-floating-icon{position:fixed;cursor:pointer;top:90%;transform:translateY(-50%);z-index:1000}.left{left:10px}.right{right:10px}.minimizebtn{margin:10px}.chat-window.minimized{width:350px;height:50px;overflow:hidden}.chat-window{position:fixed;bottom:20px;background-color:var(--ai12z-bot-primary-color);border:1px solid #ccc;box-shadow:0 2px 10px rgba(0, 0, 0, 0.2);display:flex;flex-direction:column;border-radius:10px;z-index:1000;opacity:0;transform:translateY(20px);transition:opacity 0.3s ease,\n transform 0.3s ease}.chat-left{left:70px}.chat-right{right:70px}@keyframes fadeInSlideUp{0%{opacity:0;transform:translateY(20px) scale(0.9)}100%{opacity:1;transform:translateY(0) scale(1)}}@keyframes fadeOutSlideDown{0%{opacity:1;transform:translateY(0) scale(1)}100%{opacity:0;transform:translateY(20px) scale(0.9)}}.chat-window-open{animation:fadeInSlideUp 0.4s ease-out forwards;pointer-events:auto}.chat-window-close{pointer-events:none;animation:fadeOutSlideDown 0.3s ease-in forwards}.chat-header{background-color:var(--ai12z-bot-primary-bgcolor);color:var(--ai12z-bot-primary-color);padding:10px;display:flex;align-items:center;border-top-left-radius:10px;border-top-right-radius:10px;height:56px}.chat-name{flex-grow:1}.avatar{width:30px;height:30px;border-radius:50%;margin-right:10px}.header-title{margin:0 0 0 14px;padding:1px 0;font-size:14px;line-height:14px}.chat-body{height:100%;overflow-y:auto;display:flex;flex-direction:column;gap:10px;overflow-x:hidden;}.chat-body::-webkit-scrollbar{width:5px;height:5px;}.chat-body::-webkit-scrollbar-thumb{background-color:#888;border-radius:10px;}.message{padding:10px;border-radius:15px;font-size:14px;line-height:1.4;word-wrap:break-word}.message-user{align-self:flex-end;color:var(--ai12z-bot-primary-color);}.message-text{max-width:100%;display:inline-block;position:relative}.message-bot{align-self:flex-start;background-color:var(--ai12z-bot-secondary-bgcolor);color:var(--ai12z-bot-secondary-color);border-top-left-radius:0;flex-direction:row;border-radius:7px}.msg-wrapper{display:flex}.bot-avatar{width:30px;height:30px;border-radius:50%;margin-right:10px}.message-content{display:flex;flex-direction:column;align-items:flex-start;max-width:fit-content}.message-timestamp{font-size:0.75rem;color:var(--ai12z-bot-text-mute);margin-top:2px;align-self:flex-end;}.chat-footer{flex-direction:column;padding:10px;display:flex;border-bottom-left-radius:10px;border-bottom-right-radius:10px;border-top:1px solid var(--ai12z-bot-primary-bgcolor)}.chat-footer textarea{flex-grow:1;padding:5px;border-radius:6px;margin-right:5px;resize:none;scrollbar-width:thin;overflow:hidden}.chat-footer textarea:focus{outline:none;border-color:var(--ai12z-bot-primary-bgcolor)}.chat-footer button{color:var(--ai12z-bot-primary-bgcolor)}.chat-footers button{color:var(--ai12z-bot-primary-color);border:none;padding:5px 10px;border-radius:3px;cursor:pointer}.close-btn{background:none;border:none;color:var(--ai12z-bot-primary-color);font-size:20px;cursor:pointer}.timestamp{font-size:10px;color:var(--ai12z-bot-text-mute);margin:14px 0;text-align:center;text-transform:uppercase}span.prose{font-size:14px;}.message-user span.prose{color:var(--ai12z-bot-primary-color);background-color:var(--ai12z-bot-primary-bgcolor);padding:10px;border-radius:6px}#fileInput{display:none}.custom-attachment{cursor:pointer;display:flex;align-items:center;justify-content:center}.image-Container{position:relative;display:inline-block;margin-right:10px}.delete-image{opacity:3;position:absolute;right:3px;top:0;cursor:pointer;line-height:10px}.ai12zBtn{background-color:var(--ai12zBot-v2-button-background) !important;color:var(--ai12zBot-v2-button-font-color);padding:5px 10px;border:none;border-radius:5px;cursor:pointer;text-decoration:none;margin:5px}.hamburger{font-size:30px;background:none;border:none;color:white;cursor:pointer;padding-right:12px}@keyframes zoomIn{0%{transform:scale(0);opacity:0}100%{transform:scale(1);opacity:1}}@keyframes zoomOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0);opacity:0}}.menu{position:absolute;top:55px;left:0;width:200px;background-color:var(--ai12z-bot-nav-bgcolor);color:var(--ai12z-bot-primary-color);overflow:hidden;transform-origin:top left}.menu.open{animation:zoomIn 0.5s forwards;}.menu.closed{animation:zoomOut 0.5s forwards;}.menu ul{list-style-type:none;padding:10px}.custom-privacy{color:var(--ai12z-bot-privacy-color);padding-bottom:10px;padding-left:5px;margin-top:auto;}.menu ul li{padding:10px;cursor:pointer}@media (max-width: 768px){.hide-chatbot{display:none}.chat-window{width:100% !important;height:100% !important;right:0%;bottom:0%}.pagination-controls button{padding:5px 5px}}.follow-up{display:flex;cursor:pointer;gap:0.5rem;color:var(--ai12z-bot-followup-color);font-size:var(--ai12z-bot-followup-font-size)}.custom-svg-checkbox{margin-top:0.25rem;width:1rem;height:1rem;position:absolute}.follow-up-input{appearance:none;width:1rem;height:1rem;border-width:2px;flex-shrink:0;margin-top:0.25rem;border-radius:0.125rem;border-color:rgb(59 130 246)}.follow-up-input:checked{background-color:var(--ai12z-bot-followup-bg-color);border-width:0px}.bubble-width{width:90%}";
12
645
  const Ai12zBotStyle0 = ai12zBotCss;
13
646
 
14
647
  const tailwindMinCss = "/*! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:\"\"}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose]*)){margin-bottom:1.25em;margin-top:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose]*)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-bottom:1.2em;margin-top:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose]*)){color:var(--tw-prose-links);font-weight:500;text-decoration:underline}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose]*)){color:var(--tw-prose-bold);font-weight:600}.prose :where(astrong):not(:where([class~=not-prose],[class~=not-prose]*)){color:inherit}.prose :where(blockquotestrong):not(:where([class~=not-prose],[class~=not-prose]*)){color:inherit}.prose :where(theadthstrong):not(:where([class~=not-prose],[class~=not-prose]*)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose]*)){list-style-type:decimal;margin-bottom:1.25em;margin-top:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose]*)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose]*)){list-style-type:lower-alpha}.prose :where(ol[type=As]):not(:where([class~=not-prose],[class~=not-prose]*)){list-style-type:upper-alpha}.prose :where(ol[type=as]):not(:where([class~=not-prose],[class~=not-prose]*)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose]*)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose]*)){list-style-type:lower-roman}.prose :where(ol[type=Is]):not(:where([class~=not-prose],[class~=not-prose]*)){list-style-type:upper-roman}.prose :where(ol[type=is]):not(:where([class~=not-prose],[class~=not-prose]*)){list-style-type:lower-roman}.prose :where(ol[type=\"1\"]):not(:where([class~=not-prose],[class~=not-prose]*)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose]*)){list-style-type:disc;margin-bottom:1.25em;margin-top:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose]*))::marker{color:var(--tw-prose-counters);font-weight:400}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose]*))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose]*)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose]*)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-bottom:3em;margin-top:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose]*)){border-inline-start-color:var(--tw-prose-quote-borders);border-inline-start-width:.25rem;color:var(--tw-prose-quotes);font-style:italic;font-weight:500;margin-bottom:1.6em;margin-top:1.6em;padding-inline-start:1em;quotes:\"\\201C\"\"\\201D\"\"\\2018\"\"\\2019\"}.prose :where(blockquotep:first-of-type):not(:where([class~=not-prose],[class~=not-prose]*)):before{content:open-quote}.prose :where(blockquotep:last-of-type):not(:where([class~=not-prose],[class~=not-prose]*)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose]*)){color:var(--tw-prose-headings);font-size:2.25em;font-weight:800;line-height:1.1111111;margin-bottom:.8888889em;margin-top:0}.prose :where(h1strong):not(:where([class~=not-prose],[class~=not-prose]*)){color:inherit;font-weight:900}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose]*)){color:var(--tw-prose-headings);font-size:1.5em;font-weight:700;line-height:1.3333333;margin-bottom:1em;margin-top:2em}.prose :where(h2strong):not(:where([class~=not-prose],[class~=not-prose]*)){color:inherit;font-weight:800}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose]*)){color:var(--tw-prose-headings);font-size:1.25em;font-weight:600;line-height:1.6;margin-bottom:.6em;margin-top:1.6em}.prose :where(h3strong):not(:where([class~=not-prose],[class~=not-prose]*)){color:inherit;font-weight:700}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose]*)){color:var(--tw-prose-headings);font-weight:600;line-height:1.5;margin-bottom:.5em;margin-top:1.5em}.prose :where(h4strong):not(:where([class~=not-prose],[class~=not-prose]*)){color:inherit;font-weight:700}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose]*)){margin-bottom:2em;margin-top:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose]*)){display:block;margin-bottom:2em;margin-top:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose]*)){margin-bottom:2em;margin-top:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose]*)){border-radius:.3125rem;box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows)/10%),0 3px 0 rgb(var(--tw-prose-kbd-shadows)/10%);color:var(--tw-prose-kbd);font-family:inherit;font-size:.875em;font-weight:500;padding-inline-end:.375em;padding-bottom:.1875em;padding-top:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose]*)){color:var(--tw-prose-code);font-size:.875em;font-weight:600}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose]*)):before{content:\"`\"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose]*)):after{content:\"`\"}.prose :where(acode):not(:where([class~=not-prose],[class~=not-prose]*)){color:inherit}.prose :where(h1code):not(:where([class~=not-prose],[class~=not-prose]*)){color:inherit}.prose :where(h2code):not(:where([class~=not-prose],[class~=not-prose]*)){color:inherit;font-size:.875em}.prose :where(h3code):not(:where([class~=not-prose],[class~=not-prose]*)){color:inherit;font-size:.9em}.prose :where(h4code):not(:where([class~=not-prose],[class~=not-prose]*)){color:inherit}.prose :where(blockquotecode):not(:where([class~=not-prose],[class~=not-prose]*)){color:inherit}.prose :where(theadthcode):not(:where([class~=not-prose],[class~=not-prose]*)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose]*)){background-color:var(--tw-prose-pre-bg);border-radius:.375rem;color:var(--tw-prose-pre-code);font-size:.875em;font-weight:400;line-height:1.7142857;margin-bottom:1.7142857em;margin-top:1.7142857em;overflow-x:auto;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-top:.8571429em;padding-inline-start:1.1428571em}.prose :where(precode):not(:where([class~=not-prose],[class~=not-prose]*)){background-color:transparent;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;padding:0}.prose :where(precode):not(:where([class~=not-prose],[class~=not-prose]*)):before{content:none}.prose :where(precode):not(:where([class~=not-prose],[class~=not-prose]*)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose]*)){font-size:.875em;line-height:1.7142857;margin-bottom:2em;margin-top:2em;table-layout:auto;text-align:start;width:100%}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose]*)){border-bottom-color:var(--tw-prose-th-borders);border-bottom-width:1px}.prose :where(theadth):not(:where([class~=not-prose],[class~=not-prose]*)){color:var(--tw-prose-headings);font-weight:600;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em;vertical-align:bottom}.prose :where(tbodytr):not(:where([class~=not-prose],[class~=not-prose]*)){border-bottom-color:var(--tw-prose-td-borders);border-bottom-width:1px}.prose :where(tbodytr:last-child):not(:where([class~=not-prose],[class~=not-prose]*)){border-bottom-width:0}.prose :where(tbodytd):not(:where([class~=not-prose],[class~=not-prose]*)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose]*)){border-top-color:var(--tw-prose-th-borders);border-top-width:1px}.prose :where(tfoottd):not(:where([class~=not-prose],[class~=not-prose]*)){vertical-align:top}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose]*)){margin-bottom:0;margin-top:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose]*)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body:#374151;--tw-prose-headings:#111827;--tw-prose-lead:#4b5563;--tw-prose-links:#111827;--tw-prose-bold:#111827;--tw-prose-counters:#6b7280;--tw-prose-bullets:#d1d5db;--tw-prose-hr:#e5e7eb;--tw-prose-quotes:#111827;--tw-prose-quote-borders:#e5e7eb;--tw-prose-captions:#6b7280;--tw-prose-kbd:#111827;--tw-prose-kbd-shadows:17 24 39;--tw-prose-code:#111827;--tw-prose-pre-code:#e5e7eb;--tw-prose-pre-bg:#1f2937;--tw-prose-th-borders:#d1d5db;--tw-prose-td-borders:#e5e7eb;--tw-prose-invert-body:#d1d5db;--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:#9ca3af;--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:#9ca3af;--tw-prose-invert-bullets:#4b5563;--tw-prose-invert-hr:#374151;--tw-prose-invert-quotes:#f3f4f6;--tw-prose-invert-quote-borders:#374151;--tw-prose-invert-captions:#9ca3af;--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:255 255 255;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:#d1d5db;--tw-prose-invert-pre-bg:rgba(0,0,0,.5);--tw-prose-invert-th-borders:#4b5563;--tw-prose-invert-td-borders:#374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose]*)){margin-bottom:0;margin-top:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose]*)){margin-bottom:.5em;margin-top:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose]*)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose]*)){padding-inline-start:.375em}.prose :where(.prose>ul>lip):not(:where([class~=not-prose],[class~=not-prose]*)){margin-bottom:.75em;margin-top:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose]*)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose]*)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose]*)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose]*)){margin-bottom:1.25em}.prose :where(ulul,ulol,olul,olol):not(:where([class~=not-prose],[class~=not-prose]*)){margin-bottom:.75em;margin-top:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose]*)){margin-bottom:1.25em;margin-top:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose]*)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose]*)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose]*)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose]*)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose]*)){margin-top:0}.prose :where(theadth:first-child):not(:where([class~=not-prose],[class~=not-prose]*)){padding-inline-start:0}.prose :where(theadth:last-child):not(:where([class~=not-prose],[class~=not-prose]*)){padding-inline-end:0}.prose :where(tbodytd,tfoottd):not(:where([class~=not-prose],[class~=not-prose]*)){padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-top:.5714286em;padding-inline-start:.5714286em}.prose :where(tbodytd:first-child,tfoottd:first-child):not(:where([class~=not-prose],[class~=not-prose]*)){padding-inline-start:0}.prose :where(tbodytd:last-child,tfoottd:last-child):not(:where([class~=not-prose],[class~=not-prose]*)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose]*)){margin-bottom:2em;margin-top:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose]*)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose]*)){margin-bottom:0}.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.bottom-0{bottom:0}.bottom-12{bottom:3rem}.bottom-4{bottom:1rem}.bottom-5{bottom:1.25rem}.bottom-6{bottom:1.5rem}.bottom-\\[-2px\\]{bottom:-2px}.left-0{left:0}.left-1\\/2{left:50%}.left-4{left:1rem}.left-5{left:1.25rem}.left-\\[3px\\]{left:3px}.right-0{right:0}.right-4{right:1rem}.right-7{right:1.75rem}.right-8{right:2rem}.top-0{top:0}.z-10{z-index:10}.z-30{z-index:30}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.m-\\[-1px\\]{margin:-1px}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-bottom:1rem;margin-top:1rem}.-ml-1{margin-left:-.25rem}.mb-1{margin-bottom:.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-0{margin-right:0}.mr-0\\.5{margin-right:.125rem}.mr-1{margin-right:.25rem}.mr-3{margin-right:.75rem}.ms-2{margin-inline-start:.5rem}.mt-0{margin-top:0}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-2\\.5{margin-top:.625rem}.mt-4{margin-top:1rem}.mt-px{margin-top:1px}.box-border{box-sizing:border-box}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.size-10{height:2.5rem;width:2.5rem}.size-6{height:1.5rem;width:1.5rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-2\\.5{height:.625rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-8{height:2rem}.h-96{height:24rem}.h-\\[1px\\]{height:1px}.h-auto{height:auto}.h-fit{height:fit-content}.h-full{height:100%}.h-px{height:1px}.max-h-80{max-height:20rem}.min-h-\\[calc\\(100\\%-1px\\)\\]{min-height:calc(100% - 1px)}.min-h-fit{min-height:fit-content}.w-1\\/2{width:50%}.w-10{width:2.5rem}.w-11\\/12{width:91.666667%}.w-12{width:3rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-40{width:10rem}.w-44{width:11rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-\\[1px\\]{width:1px}.w-auto{width:auto}.w-full{width:100%}.min-w-\\[200px\\]{min-width:200px}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-full{max-width:100%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-\\[1_1_0\\]{flex:1 1 0}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.translate-y-\\[0\\.5px\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[0\\.5px\\]{--tw-translate-y:0.5px}.rotate-45{--tw-rotate:45deg}.rotate-45,.scale-100{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x:1;--tw-scale-y:1}.scale-110{--tw-scale-x:1.1;--tw-scale-y:1.1}.scale-110,.scale-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-90{--tw-scale-x:.9;--tw-scale-y:.9}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize{resize:both}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-x-2{column-gap:.5rem}.gap-y-1{row-gap:.25rem}.gap-y-3{row-gap:.75rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.25rem*var(--tw-space-x-reverse))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.75rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.75rem*var(--tw-space-x-reverse))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-scroll{overflow-y:scroll}.overscroll-contain{overscroll-behavior:contain}.truncate{overflow:hidden;white-space:nowrap}.text-ellipsis,.truncate{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-b-2xl{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}.border{border-width:1px}.border-0{border-width:0}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-solid{border-style:solid}.border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity))}.bg-blue-700{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.bg-inherit{background-color:inherit}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-60{--tw-bg-opacity:0.6}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-green-400{--tw-gradient-from:#4ade80 var(--tw-gradient-from-position);--tw-gradient-to:rgba(74,222,128,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.to-teal-500{--tw-gradient-to:#14b8a6 var(--tw-gradient-to-position)}.object-cover{object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-\\[10px\\]{padding:10px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-0{padding-left:0}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pr-2{padding-right:.5rem}.pr-\\[14px\\]{padding-right:14px}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-1\\.5{padding-top:.375rem}.pt-2{padding-top:.5rem}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-bottom{vertical-align:bottom}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-2xl{font-size:1.5rem;line-height:2rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-normal{line-height:1.5}.tracking-tight{letter-spacing:-.025em}.text-\\[\\#001E5B\\]{--tw-text-opacity:1;color:rgb(0 30 91/var(--tw-text-opacity))}.text-\\[\\#0344D1\\]{--tw-text-opacity:1;color:rgb(3 68 209/var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-slate-300{--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.no-underline{text-decoration-line:none}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-md,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring,.ring-1{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-slate-900\\/10{--tw-ring-color:rgba(15,23,42,.1)}.blur{--tw-blur:blur(8px)}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-shadow{transition-duration:.15s;transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.\\[ko_memo\\:\\\"\\+n\\+\\\"\\]{ko_memo:\"+n+\"}.after\\:invisible:after{content:var(--tw-content);visibility:hidden}.after\\:whitespace-pre-wrap:after{content:var(--tw-content);white-space:pre-wrap}.hover\\:bg-blue-800:hover{--tw-bg-opacity:1;background-color:rgb(30 64 175/var(--tw-bg-opacity))}.hover\\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.hover\\:bg-indigo-300:hover{--tw-bg-opacity:1;background-color:rgb(165 180 252/var(--tw-bg-opacity))}.hover\\:bg-opacity-80:hover{--tw-bg-opacity:0.8}.hover\\:bg-gradient-to-t:hover{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.hover\\:text-blue-700:hover{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity))}.hover\\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:ring-slate-300:hover{--tw-ring-opacity:1;--tw-ring-color:rgb(203 213 225/var(--tw-ring-opacity))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:outline:focus{outline-style:solid}.focus\\:outline-2:focus{outline-width:2px}.focus\\:outline-offset-2:focus{outline-offset:2px}.focus\\:ring-0:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\\:ring-0:focus,.focus\\:ring-2:focus{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\\:ring-4:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:ring-blue-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(147 197 253/var(--tw-ring-opacity))}.focus\\:ring-sky-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(14 165 233/var(--tw-ring-opacity))}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-transparent:disabled,.disabled\\:hover\\:bg-transparent:hover:disabled{background-color:transparent}.peer:checked~.peer-checked\\:block{display:block}:is(.dark.dark\\:border-gray-700){--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity))}:is(.dark.dark\\:bg-blue-600){--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity))}:is(.dark.dark\\:text-gray-100){--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}:is(.dark.dark\\:text-gray-400){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark.dark\\:text-gray-800){--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}:is(.dark.dark\\:text-slate-400){--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity))}:is(.dark.dark\\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark.dark\\:hover\\:bg-blue-700:hover){--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity))}:is(.dark.dark\\:focus\\:ring-blue-800:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(30 64 175/var(--tw-ring-opacity))}@media (min-width:640px){.sm\\:h-3{height:.75rem}.sm\\:w-3{width:.75rem}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem}}@media (min-width:768px){.md\\:right-0{right:0}.md\\:col-span-2{grid-column:span 2/span 2}.md\\:ml-2{margin-left:.5rem}.md\\:mt-6{margin-top:1.5rem}.md\\:block{display:block}.md\\:flex{display:flex}.md\\:grid{display:grid}.md\\:h-4{height:1rem}.md\\:h-96{height:24rem}.md\\:h-auto{height:auto}.md\\:w-1\\/2{width:50%}.md\\:w-1\\/3{width:33.333333%}.md\\:w-2\\/3{width:66.666667%}.md\\:w-4{width:1rem}.md\\:max-w-xl{max-width:36rem}.md\\:flex-none{flex:none}.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:flex-row{flex-direction:row}.md\\:gap-4{gap:1rem}.md\\:gap-x-3{column-gap:.75rem}.md\\:rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.md\\:p-2{padding:.5rem}.md\\:p-2\\.5{padding:.625rem}.md\\:p-4{padding:1rem}.md\\:pl-0{padding-left:0}.md\\:pl-3{padding-left:.75rem}.md\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width:1024px){.lg\\:px-8{padding-left:2rem;padding-right:2rem}}.rtl\\:rotate-180:where([dir=rtl],[dir=rtl]*){--tw-rotate:180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rtl\\:space-x-reverse:where([dir=rtl],[dir=rtl]*)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}";
@@ -37,6 +670,7 @@ const Ai12zBot = class {
37
670
  // `${this.cdnPath}/v1/survey-core.min.css`,
38
671
  `https://unpkg.com/@highlightjs/cdn-assets@11.9.0/styles/default.min.css`,
39
672
  ];
673
+ this.liveAgentEventHandler = new LiveAgentEventHandler();
40
674
  this.customStyle = "";
41
675
  this.customJS = "";
42
676
  this.dataOverrideFunction = null;
@@ -266,7 +900,17 @@ const Ai12zBot = class {
266
900
  }
267
901
  else {
268
902
  this.currentDomId = this.messages[this.messages.length - 1].id;
269
- this.invokeSocket();
903
+ if (this.isLiveAgent) {
904
+ this.liveAgentEventHandler.sendMessage({ sessionId: "", message: this.inputEl.value });
905
+ if (this.inputEl.value) {
906
+ this.inputEl.value = "";
907
+ }
908
+ this.query = "";
909
+ }
910
+ else {
911
+ this.checkLiveAgentMode();
912
+ this.invokeSocket();
913
+ }
270
914
  }
271
915
  // this.invokeSocket()
272
916
  const parent = this.el.shadowRoot.querySelector("#previewContainer");
@@ -278,6 +922,9 @@ const Ai12zBot = class {
278
922
  this.showSubmit = false;
279
923
  // }
280
924
  };
925
+ this.liveAgentButtonText = "Talk to a liveagent";
926
+ this.isLiveAgentEnabled = false;
927
+ this.isTypingIndicatorVisible = false;
281
928
  this.dataKey = "";
282
929
  this.dataMode = index.Env.DATA_MODE // "local", "dev", or "prod"
283
930
  ;
@@ -294,6 +941,7 @@ const Ai12zBot = class {
294
941
  this.showMenu = false;
295
942
  this.isProse = true // Flag to track if prose mode is enabled
296
943
  ;
944
+ this.isLiveAgent = false;
297
945
  this.botlogo = this.cdnPath + `/v1/ai12z-bot/img/chatbot.jpg`;
298
946
  this.botAvatar = this.cdnPath + `/v1/ai12z-bot/img/chatbot.jpg`;
299
947
  this.showWelcomeScreen = true;
@@ -672,7 +1320,7 @@ const Ai12zBot = class {
672
1320
  configType: "bot",
673
1321
  };
674
1322
  utils.getConfig(payload, this.dataMode).then(data => {
675
- var _a, _b;
1323
+ var _a, _b, _c;
676
1324
  if (data) {
677
1325
  // console.log("bot settings", data)
678
1326
  this.botSettings = data;
@@ -683,11 +1331,41 @@ const Ai12zBot = class {
683
1331
  // this.botSettings.imageUpload = true
684
1332
  this.isMinimized = true;
685
1333
  }
1334
+ if (this.botSettings.theme) {
1335
+ let themeLink = "";
1336
+ if (this.botSettings.theme !== "custom") {
1337
+ themeLink = `${this.cdnPath}/v2/themes/theme-${this.botSettings.theme}.css`;
1338
+ }
1339
+ else {
1340
+ themeLink = this.botSettings.customTheme;
1341
+ }
1342
+ const linkEl = document.createElement("link");
1343
+ linkEl.setAttribute("rel", "stylesheet");
1344
+ linkEl.setAttribute("href", themeLink);
1345
+ document.head.appendChild(linkEl);
1346
+ }
1347
+ else {
1348
+ const linkEl = document.createElement("link");
1349
+ linkEl.setAttribute("rel", "stylesheet");
1350
+ linkEl.setAttribute("href", `${this.cdnPath}/v2/themes/theme-default.css`);
1351
+ document.head.appendChild(linkEl);
1352
+ }
1353
+ if (this.botSettings.welcome) {
1354
+ if (this.botSettings.welcome.styles) {
1355
+ this.insertStyles(this.botSettings.welcome.styles);
1356
+ }
1357
+ if (this.botSettings.welcome.scripts) {
1358
+ const scriptEl = document.createElement("script");
1359
+ scriptEl.setAttribute("type", "text/javascript");
1360
+ scriptEl.setAttribute("src", this.botSettings.welcome.scripts);
1361
+ (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(scriptEl);
1362
+ }
1363
+ }
686
1364
  // console.log("isbot", this.isBot)
687
1365
  if (this.botSettings.isExpanded && !this.isBot) {
688
1366
  this.isExpanded = true;
689
1367
  this.isMinimized = false;
690
- if ((_a = data.v3) === null || _a === void 0 ? void 0 : _a.siteKey) {
1368
+ if ((_b = data === null || data === void 0 ? void 0 : data.v3) === null || _b === void 0 ? void 0 : _b.siteKey) {
691
1369
  this.executeRecaptcha(data._id, data.v3.siteKey)
692
1370
  .then(response => {
693
1371
  if (response) {
@@ -723,7 +1401,7 @@ const Ai12zBot = class {
723
1401
  const scriptEl = document.createElement("script");
724
1402
  scriptEl.setAttribute("type", "text/javascript");
725
1403
  scriptEl.setAttribute("src", this.botSettings.customJS);
726
- (_b = this.el.shadowRoot) === null || _b === void 0 ? void 0 : _b.appendChild(scriptEl);
1404
+ (_c = this.el.shadowRoot) === null || _c === void 0 ? void 0 : _c.appendChild(scriptEl);
727
1405
  }
728
1406
  this.isRendered = true; // Set the flag to true after rendering
729
1407
  }
@@ -923,14 +1601,39 @@ const Ai12zBot = class {
923
1601
  }
924
1602
  }
925
1603
  // Helper function to detect when the target element is rendered
926
- waitForElementRender(element) {
927
- return new Promise(resolve => {
928
- const observer = new MutationObserver(_mutations => {
929
- resolve();
930
- observer.disconnect();
1604
+ waitForElementRender(element, timeout = 2000) {
1605
+ return new Promise((resolve, _reject) => {
1606
+ const checkReady = () => {
1607
+ // Customize your readiness check as needed
1608
+ if (element && element.childNodes.length > 0) {
1609
+ resolve();
1610
+ return true;
1611
+ }
1612
+ return false;
1613
+ };
1614
+ if (checkReady())
1615
+ return;
1616
+ const observer = new MutationObserver(() => {
1617
+ if (checkReady()) {
1618
+ observer.disconnect();
1619
+ }
1620
+ });
1621
+ observer.observe(element, {
1622
+ childList: true,
1623
+ subtree: true,
931
1624
  });
932
- observer.observe(element, { childList: true, subtree: true });
1625
+ // Fallback timeout to avoid infinite wait
1626
+ setTimeout(() => {
1627
+ observer.disconnect();
1628
+ resolve(); // or reject('Timeout') if you want to enforce it
1629
+ }, timeout);
933
1630
  });
1631
+ // const observer = new MutationObserver(_mutations => {
1632
+ // resolve()
1633
+ // observer.disconnect()
1634
+ // })
1635
+ // observer.observe(element, { childList: true, subtree: true })
1636
+ // })
934
1637
  }
935
1638
  handleBotMessages() {
936
1639
  // const domId = this.messages[this.messages.length - 1].id
@@ -1046,7 +1749,7 @@ const Ai12zBot = class {
1046
1749
  return doc.body.innerHTML;
1047
1750
  }
1048
1751
  updateConversations(finalHtml, data) {
1049
- var _a, _b, _c, _d;
1752
+ var _a, _b, _c, _d, _f;
1050
1753
  const updatedmsg = {
1051
1754
  id: this.currentDomId,
1052
1755
  text: finalHtml,
@@ -1056,6 +1759,7 @@ const Ai12zBot = class {
1056
1759
  conversationId: this.conversationId,
1057
1760
  formModel: (_d = (_c = (_b = (_a = data.controlData) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.source) !== null && _c !== void 0 ? _c : data.controlData) !== null && _d !== void 0 ? _d : {},
1058
1761
  surveyDomId: this.surveyDomId,
1762
+ sender: (_f = data === null || data === void 0 ? void 0 : data.sender) !== null && _f !== void 0 ? _f : null,
1059
1763
  };
1060
1764
  this.addEventListeners(`#${this.currentDomId}`);
1061
1765
  this.messages = this.messages.map(item => (item.id === this.currentDomId ? updatedmsg : item));
@@ -1519,8 +2223,132 @@ const Ai12zBot = class {
1519
2223
  // console.log("toggleTextarea2", this.showTextarea)
1520
2224
  }, 50); // Small delay ensures the element is fully unmounted
1521
2225
  }
2226
+ checkLiveAgentMode() {
2227
+ var _a, _b;
2228
+ const isLiveAgentConfigured = ((_a = this.botSettings) === null || _a === void 0 ? void 0 : _a.liveagent) && Object.keys((_b = this.botSettings) === null || _b === void 0 ? void 0 : _b.liveagent).length > 0;
2229
+ /**
2230
+ * Check if live agent is enabled
2231
+ * If live agent is configured and there are more than one messages in the chat,
2232
+ * then enable live agent mode.
2233
+ * This is to ensure that live agent mode is only enabled after the user has interacted with the bot
2234
+ * and there is a conversation history to refer to.
2235
+ * This prevents the live agent from being connected immediately when the chat is opened.
2236
+ */
2237
+ this.isLiveAgentEnabled = isLiveAgentConfigured && this.messages.length > 1;
2238
+ }
2239
+ disconnectLiveChat() {
2240
+ this.liveAgentEventHandler.disconnectLiveAgent();
2241
+ }
2242
+ async connectLiveChat() {
2243
+ var _a, _b, _c, _d;
2244
+ const liveAgentProviderNames = Object.keys((_b = (_a = this.botSettings) === null || _a === void 0 ? void 0 : _a.liveagent) !== null && _b !== void 0 ? _b : {});
2245
+ if (liveAgentProviderNames.length === 0) {
2246
+ console.error("No live agent provider found in bot settings");
2247
+ return;
2248
+ }
2249
+ if (liveAgentProviderNames.length > 1) {
2250
+ console.warn("Multiple live agent providers found, using the first one");
2251
+ }
2252
+ let liveAgentSettings = (_d = (_c = this.botSettings) === null || _c === void 0 ? void 0 : _c.liveagent[liveAgentProviderNames[0]]) !== null && _d !== void 0 ? _d : null;
2253
+ if (!liveAgentSettings) {
2254
+ console.error("No live agent settings found for the provider", liveAgentProviderNames[0]);
2255
+ return;
2256
+ }
2257
+ if (liveAgentSettings) {
2258
+ const conversationExists = this.getConversationHistory();
2259
+ let messageHistory = conversationExists.filter(item => { var _a; return item.conversationId === this.conversationId && item.projectId === ((_a = this.botSettings) === null || _a === void 0 ? void 0 : _a.pId); });
2260
+ this.isTypingIndicatorVisible = true;
2261
+ liveAgentSettings = {
2262
+ config: liveAgentSettings,
2263
+ userId: this.visitorID,
2264
+ conversationId: this.conversationId,
2265
+ messageHistory: messageHistory,
2266
+ };
2267
+ if (liveAgentProviderNames[0] === "liveagent") {
2268
+ if (!this.liveAgentRef) {
2269
+ this.isTypingIndicatorVisible = false;
2270
+ console.error("LiveAgent reference is not set");
2271
+ return;
2272
+ }
2273
+ await this.liveAgentRef.startChat();
2274
+ }
2275
+ else {
2276
+ this.liveAgentEventHandler.connectToLiveAgent(liveAgentProviderNames[0], liveAgentSettings);
2277
+ ChatEventBus.on("AGENT_SESSION_CREATED", () => {
2278
+ this.isLiveAgent = true;
2279
+ this.liveAgentButtonText = "End liveagent chat";
2280
+ });
2281
+ ChatEventBus.on("AGENT_EVENT", (event) => {
2282
+ this.isTypingIndicatorVisible = false;
2283
+ if ((event === null || event === void 0 ? void 0 : event.length) > 0) {
2284
+ const agentEventMessages = this.liveAgentEventHandler.addAgentEventMessage(event);
2285
+ if (agentEventMessages) {
2286
+ const currentDomElement = this.el.shadowRoot.querySelector(`#${this.currentDomId}`);
2287
+ if (currentDomElement) {
2288
+ // Append the agent event messages to the current message bubble
2289
+ currentDomElement.parentNode.appendChild(agentEventMessages);
2290
+ }
2291
+ if (this.inputEl) {
2292
+ this.inputEl.value = "";
2293
+ }
2294
+ }
2295
+ }
2296
+ });
2297
+ ChatEventBus.on("TYPING_STARTED", (status) => {
2298
+ this.isTypingIndicatorVisible = status;
2299
+ });
2300
+ ChatEventBus.on("TYPING_STOPPED", (_status) => {
2301
+ this.isTypingIndicatorVisible = false;
2302
+ });
2303
+ ChatEventBus.on("AGENT_MESSAGE", (message) => {
2304
+ var _a;
2305
+ const retMessage = this.liveAgentEventHandler.handleAgentMessage(message);
2306
+ if (retMessage) {
2307
+ const aiMessageBubble = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(`#${this.currentDomId}`);
2308
+ if (aiMessageBubble) {
2309
+ const converter = new showdown.showdown.Converter();
2310
+ let bubbleText = aiMessageBubble.getAttribute("data-bubbleText") || "";
2311
+ bubbleText = `${bubbleText} \n\n ${retMessage}`;
2312
+ aiMessageBubble.setAttribute("data-bubbleText", bubbleText);
2313
+ let html = converter.makeHtml(bubbleText);
2314
+ this.updateConversations(html, message[0]);
2315
+ }
2316
+ setTimeout(() => {
2317
+ this.scrollToBottom();
2318
+ }, 10);
2319
+ }
2320
+ });
2321
+ ChatEventBus.on("AGENT_ERROR", () => {
2322
+ addEventMessage("Something went wrong with liveagent");
2323
+ this.isLiveAgent = false;
2324
+ this.isTypingIndicatorVisible = false;
2325
+ this.liveAgentEventHandler.disconnectLiveAgent();
2326
+ });
2327
+ ChatEventBus.on("CONVERSATION_CLOSED", () => {
2328
+ addEventMessage("Conversation closed with liveagent");
2329
+ this.isLiveAgent = false;
2330
+ this.isTypingIndicatorVisible = false;
2331
+ this.liveAgentButtonText = "Talk to a liveagent";
2332
+ });
2333
+ }
2334
+ const addEventMessage = (_message) => {
2335
+ const agentEventMessages = this.liveAgentEventHandler.addAgentEventMessage([
2336
+ {
2337
+ text: _message,
2338
+ },
2339
+ ]);
2340
+ if (agentEventMessages) {
2341
+ const currentDomElement = this.el.shadowRoot.querySelector(`#${this.currentDomId}`);
2342
+ if (currentDomElement) {
2343
+ // Append the agent event messages to the current message bubble
2344
+ currentDomElement.parentNode.appendChild(agentEventMessages);
2345
+ }
2346
+ }
2347
+ };
2348
+ }
2349
+ }
1522
2350
  render() {
1523
- var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23;
2351
+ var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27;
1524
2352
  // const imageSrc = getAssetPath(`./assets/ai12z-bot/img/chatbot.jpg`)
1525
2353
  const style = {
1526
2354
  width: (_b = (_a = this.botSettings) === null || _a === void 0 ? void 0 : _a.botWidth) !== null && _b !== void 0 ? _b : "35%",
@@ -1582,7 +2410,7 @@ const Ai12zBot = class {
1582
2410
  display: this.isExpanded && this.isOpened ? "grid" : "none",
1583
2411
  opacity: this.isExpanded && this.isOpened ? "1" : "0",
1584
2412
  pointerEvents: this.isExpanded && this.isOpened ? "all" : "none",
1585
- } }), index.h("div", { class: "modal", "data-testid": "modal", "aria-hidden": "false", role: "dialog", "aria-modal": "true", tabindex: "-1", style: { display: this.isOpened ? "grid" : "none", opacity: this.isOpened ? "1" : "0", transform: this.isOpened ? "none" : "translateY(100%)" } }, index.h("div", { class: "flex bg-white overflow-hidden border-b border-gray-90 border-solid md:pl-3 pl-4 justify-end md:rounded-t-xl items-center toolbar" }, index.h("div", { class: "flex gap-1 toolbar-overflow-actions" }, !this.showHistory && (index.h("button", { class: "rounded-full flex items-center justify-center disabled:cursor-not-allowed bg-transparent hover:bg-blue-95 disabled:bg-transparent disabled:hover:bg-transparent h-6 w-6", tabindex: "0", "aria-label": "options menu", "aria-haspopup": "menu", "aria-expanded": "false", "aria-controls": "toolbar-dropdown-menu", onClick: e => {
2413
+ } }), index.h("div", { class: "modal", "data-testid": "modal", "aria-hidden": "false", role: "dialog", "aria-modal": "true", tabindex: "-1", style: { display: this.isOpened ? "grid" : "none", opacity: this.isOpened ? "1" : "0", transform: this.isOpened ? "none" : "translateY(100%)" } }, index.h("div", { class: "flex bg-white overflow-hidden border-b border-gray-90 border-solid md:pl-3 pl-4 justify-end md:rounded-t-xl items-center toolbar" }, index.h("div", { class: "flex gap-1 toolbar-overflow-actions" }, this.isLiveAgentEnabled && ((_14 = (_13 = this.botSettings) === null || _13 === void 0 ? void 0 : _13.liveagent) === null || _14 === void 0 ? void 0 : _14.liveagent) && (index.h("live-agent-chat", { config: (_16 = (_15 = this.botSettings) === null || _15 === void 0 ? void 0 : _15.liveagent) === null || _16 === void 0 ? void 0 : _16.liveagent, ref: el => (this.liveAgentRef = el) })), !this.showHistory && (index.h("button", { class: "rounded-full flex items-center justify-center disabled:cursor-not-allowed bg-transparent hover:bg-blue-95 disabled:bg-transparent disabled:hover:bg-transparent h-6 w-6", tabindex: "0", "aria-label": "options menu", "aria-haspopup": "menu", "aria-expanded": "false", "aria-controls": "toolbar-dropdown-menu", onClick: e => {
1586
2414
  e.preventDefault();
1587
2415
  e.stopPropagation();
1588
2416
  this.toggleBot(e);
@@ -1595,8 +2423,8 @@ const Ai12zBot = class {
1595
2423
  this.isOpened = true;
1596
2424
  this.isMinimized = false;
1597
2425
  this.isAnimated = true;
1598
- } }, index.h("i", null, index.h("svg", { viewBox: "0 0 200 200", "data-name": "Layer 1", id: "Layer_1", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20" }, index.h("g", { id: "SVGRepo_bgCarrier", "stroke-width": "0" }), index.h("g", { id: "SVGRepo_tracerCarrier", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("g", { id: "SVGRepo_iconCarrier" }, index.h("title", null), index.h("path", { d: "M160,89.75H56l53-53a9.67,9.67,0,0,0,0-14,9.67,9.67,0,0,0-14,0l-56,56a30.18,30.18,0,0,0-8.5,18.5c0,1-.5,1.5-.5,2.5a6.34,6.34,0,0,0,.5,3,31.47,31.47,0,0,0,8.5,18.5l56,56a9.9,9.9,0,0,0,14-14l-52.5-53.5H160a10,10,0,0,0,0-20Z" })))))), index.h("div", { id: "dropdown-menu", role: "menu", class: `flex flex-col gap-y-1 grow-wrap absolute bg-white border-b border-gray-80 border-solid rounded-lg shadow-lg p-2 mt-4 min-w-[200px] left-5 overflow-hidden ${this.isToggled ? "show" : ""} dropdown-menu`, style: { height: "auto" }, ref: el => (this.menuV2Ref = el) }, (_14 = (_13 = this.botSettings) === null || _13 === void 0 ? void 0 : _13.buttons) === null || _14 === void 0 ? void 0 :
1599
- _14.map(button => (index.h("div", { class: "w-full dropdown-item", role: "menuitem", tabindex: "-1" }, index.h("button", { class: "dropdown-item-button", onClick: e => {
2426
+ } }, index.h("i", null, index.h("svg", { viewBox: "0 0 200 200", "data-name": "Layer 1", id: "Layer_1", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20" }, index.h("g", { id: "SVGRepo_bgCarrier", "stroke-width": "0" }), index.h("g", { id: "SVGRepo_tracerCarrier", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("g", { id: "SVGRepo_iconCarrier" }, index.h("title", null), index.h("path", { d: "M160,89.75H56l53-53a9.67,9.67,0,0,0,0-14,9.67,9.67,0,0,0-14,0l-56,56a30.18,30.18,0,0,0-8.5,18.5c0,1-.5,1.5-.5,2.5a6.34,6.34,0,0,0,.5,3,31.47,31.47,0,0,0,8.5,18.5l56,56a9.9,9.9,0,0,0,14-14l-52.5-53.5H160a10,10,0,0,0,0-20Z" })))))), index.h("div", { id: "dropdown-menu", role: "menu", class: `flex flex-col gap-y-1 grow-wrap absolute bg-white border-b border-gray-80 border-solid rounded-lg shadow-lg p-2 mt-4 min-w-[200px] left-5 overflow-hidden ${this.isToggled ? "show" : ""} dropdown-menu`, style: { height: "auto" }, ref: el => (this.menuV2Ref = el) }, (_18 = (_17 = this.botSettings) === null || _17 === void 0 ? void 0 : _17.buttons) === null || _18 === void 0 ? void 0 :
2427
+ _18.map(button => (index.h("div", { class: "w-full dropdown-item", role: "menuitem", tabindex: "-1" }, index.h("button", { class: "dropdown-item-button", onClick: e => {
1600
2428
  this.toggleBot(e);
1601
2429
  this.showHistory = false;
1602
2430
  this.showWelcomeScreen = true;
@@ -1617,7 +2445,17 @@ const Ai12zBot = class {
1617
2445
  this.toggleBot(ev);
1618
2446
  this.showHistory = false;
1619
2447
  this.close.emit("close");
1620
- } }, "End conversation")))), ((_15 = this.botSettings) === null || _15 === void 0 ? void 0 : _15.botLogo) && index.h("img", { src: (_16 = this.botSettings) === null || _16 === void 0 ? void 0 : _16.botLogo, class: "w-8 h-8 rounded-lg" }), index.h("h2", { class: "flex-1 pl-2 heading text-body1" }, (_17 = this.botSettings) === null || _17 === void 0 ? void 0 : _17.botName), index.h("div", { class: "buttons flex gap-2 p-[10px]" }, index.h("button", { class: "rounded-full flex items-center justify-center disabled:cursor-not-allowed bg-transparent hover:bg-blue-95 disabled:bg-transparent disabled:hover:bg-transparent h-6 w-6 hidden md:flex", tabindex: "0", onClick: () => {
2448
+ } }, "End conversation")), index.h("div", { class: "w-full dropdown-item", role: "menuitem", tabindex: "-1" }, this.checkLiveAgentMode(), index.h("button", { class: `dropdown-item-button ${!this.isLiveAgentEnabled ? "opacity-50 cursor-not-allowed pointer-events-none" : "opacity-100 cursor-pointer"}`, style: { opacity: !this.isLiveAgentEnabled ? "0.5" : "1", cursor: !this.isLiveAgentEnabled ? "not-allowed" : "pointer" }, onClick: ev => {
2449
+ ev.preventDefault();
2450
+ if (!this.isLiveAgentEnabled)
2451
+ return;
2452
+ if (this.isLiveAgent) {
2453
+ this.disconnectLiveChat();
2454
+ }
2455
+ else {
2456
+ this.connectLiveChat();
2457
+ }
2458
+ } }, this.liveAgentButtonText)))), ((_19 = this.botSettings) === null || _19 === void 0 ? void 0 : _19.botLogo) && index.h("img", { src: (_20 = this.botSettings) === null || _20 === void 0 ? void 0 : _20.botLogo, class: "w-8 h-8 rounded-lg" }), index.h("h2", { class: "flex-1 pl-2 heading text-body1" }, (_21 = this.botSettings) === null || _21 === void 0 ? void 0 : _21.botName), index.h("div", { class: "buttons flex gap-2 p-[10px]" }, index.h("button", { class: "rounded-full flex items-center justify-center disabled:cursor-not-allowed bg-transparent hover:bg-blue-95 disabled:bg-transparent disabled:hover:bg-transparent h-6 w-6 hidden md:flex", tabindex: "0", onClick: () => {
1621
2459
  this.isExpanded = !this.isExpanded;
1622
2460
  this.isAnimated = true;
1623
2461
  }, "aria-label": "Collapse Agentforce to Side Panel" }, index.h("i", { class: "wes-block wes-icon--loading wes-text-body2 modal-toolbar-icon" }, this.isExpanded && (index.h("svg", { viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M18.215 14.7076H27.692C28.3074 14.7076 28.492 14.0307 27.9997 13.5383L24.9843 10.4614L30.5228 4.86149C30.8305 4.5538 30.8305 3.99995 30.5228 3.69226L28.2459 1.41536C27.9382 1.16921 27.4459 1.16921 27.0767 1.4769L21.5381 7.01532L18.3997 3.99995C17.9073 3.50765 17.2304 3.69226 17.2304 4.30764V13.7845C17.2304 14.2153 17.7843 14.7076 18.215 14.7076ZM13.7847 17.2308H4.30766C3.69227 17.2308 3.50765 17.9077 3.99996 18.4L7.01537 21.4769L1.47686 27.0769C1.16917 27.3846 1.16917 27.9384 1.47686 28.2461L3.75381 30.523C4.0615 30.8307 4.55381 30.8307 4.92305 30.523L10.5231 24.923L13.6616 27.9384C14.0924 28.4923 14.7693 28.3076 14.7693 27.6923V18.2769C14.7693 17.8462 14.2154 17.2308 13.7847 17.2308Z" }))), !this.isExpanded && (index.h("svg", { viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M30.0308 1.23071H20.4923C19.8769 1.23071 19.6923 1.78455 20.1846 2.27686L23.2 5.29222L17.6615 10.8306C17.3538 11.1383 17.3538 11.6306 17.6615 11.9999L19.9384 14.2768C20.2461 14.5845 20.7384 14.5845 21.1077 14.2768L26.7077 8.67681L29.7231 11.6922C30.2154 12.1845 30.7692 11.9999 30.7692 11.3845V1.90763C30.7692 1.5384 30.4 1.23071 30.0308 1.23071ZM2.15379 30.7692H11.6307C12.2461 30.7692 12.4307 30.0923 11.9384 29.6L8.92303 26.5231L14.4615 20.9231C14.7692 20.6154 14.7692 20.0616 14.4615 19.7539L12.1846 17.477C11.8769 17.1693 11.3846 17.1693 11.0153 17.477L5.47687 23.0154L2.39995 20C1.8461 19.5077 1.23071 19.6923 1.23071 20.3077V29.7846C1.23071 30.2153 1.72302 30.7692 2.15379 30.7692Z" }))))), index.h("button", { class: "rounded-full flex items-center justify-center disabled:cursor-not-allowed bg-transparent hover:bg-blue-95 disabled:bg-transparent disabled:hover:bg-transparent h-6 w-6", tabindex: "0", "data-testid": "modal-minimize", "aria-label": "Minimize", onClick: () => {
@@ -1628,23 +2466,16 @@ const Ai12zBot = class {
1628
2466
  this.isAnimated = false;
1629
2467
  this.updateScreenSize();
1630
2468
  this.minimize.emit("minimize");
1631
- } }, index.h("i", { class: "block wes-icon--loading text-body2 modal-toolbar-icon" }, index.h("svg", { viewBox: "0 0 26 26", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M25 24.25C25 24.65 24.65 25 24.25 25H1.75C1.35 25 1 24.65 1 24.25V22.75C1 22.35 1.35 22 1.75 22H24.25C24.65 22 25 22.35 25 22.75V24.25Z" })))))), index.h("div", { class: "flex-1 flex flex-col main" }, index.h("div", { class: "h-full flex flex-col chat-body" }, index.h("div", { class: "px-5 flex-[1_1_0] min-h-[calc(100%-1px)] flex flex-col gap-y-3 @md:px-3 messages-container", role: "region", "aria-label": "messages" }, this.showWelcomeScreen && index.h("div", { class: "@md:px-6 pb-3 @md:pb-7 @md:pt-8 pt-5 text-display5", innerHTML: (_19 = (_18 = this.botSettings) === null || _18 === void 0 ? void 0 : _18.welcome) === null || _19 === void 0 ? void 0 : _19.message }), this.messages.length > 0 &&
2469
+ } }, index.h("i", { class: "block wes-icon--loading text-body2 modal-toolbar-icon" }, index.h("svg", { viewBox: "0 0 26 26", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M25 24.25C25 24.65 24.65 25 24.25 25H1.75C1.35 25 1 24.65 1 24.25V22.75C1 22.35 1.35 22 1.75 22H24.25C24.65 22 25 22.35 25 22.75V24.25Z" })))))), index.h("div", { class: "flex-1 flex flex-col main" }, index.h("div", { class: "h-full flex flex-col chat-body" }, index.h("div", { class: "px-5 flex-[1_1_0] min-h-[calc(100%-1px)] flex flex-col gap-y-3 @md:px-3 messages-container", role: "region", "aria-label": "messages" }, this.showWelcomeScreen && index.h("div", { class: "@md:px-6 pb-3 @md:pb-7 @md:pt-8 pt-5 text-display5", innerHTML: (_23 = (_22 = this.botSettings) === null || _22 === void 0 ? void 0 : _22.welcome) === null || _23 === void 0 ? void 0 : _23.message }), this.messages.length > 0 &&
1632
2470
  !this.showHistory &&
1633
2471
  this.messages.map((message, _idx) => {
1634
2472
  // const showAvatar = !message.isUser && (idx === this.messages.length - 1 || this.messages[idx + 1]?.isUser === true)
1635
- var _a;
2473
+ var _a, _b;
1636
2474
  return (index.h("div", { class: `flex pb-3 gap-x-2 @md:gap-x-3
1637
2475
  ${message.isUser ? "self-end" : ""}
1638
2476
  ${message.isUser ? "justify-end" : ""} end-user-message message-item`, style: { opacity: "1", transform: "none" } }, message.isUser && (index.h("div", { class: "flex flex-col items-end" }, index.h("div", { "data-testid": "message", class: "break-words @md:text-body2 box-border @md:pr-4 flex-1 rounded-lg py-2 px-4 user-msg text-body3", innerHTML: message.text }, (_a = message === null || message === void 0 ? void 0 : message.images) === null || _a === void 0 ? void 0 : _a.map(img => {
1639
2477
  return index.h("img", { src: img, class: "thumbnail", alt: "thumbnail" });
1640
- })), index.h("div", { class: "text-gray-30 pt-2 text-right text-body4" }, "Sent ", message.timestamp))), !message.isUser && (index.h("div", { class: "avatar-column" }, index.h("div", { role: "img", "aria-label": "Agentforce said: ", class: "rounded-full h-6 w-6 p-2 grid bg-blue place-content-center" }, this.botSettings.botAvatar && index.h("img", { src: this.botSettings.botAvatar, class: "w-8 h-8 rounded-full" }), !this.botSettings.botAvatar && (
1641
- // <i class="_wes-icon_9ngz3_1 block text-body1" style={{ color: "rgb(2, 80, 217)" }}>
1642
- // <svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" width={20} height={20}>
1643
- // <path d="M19.3786 16.9969H19.3909C18.8863 17.04 18.437 17.1262 18.0493 17.2492C18.0493 17.2492 17.4832 17.4277 16.6155 17.5508C16.4124 17.5816 16.154 17.5816 16.0124 17.5816H15.9078C15.7663 17.5816 15.5017 17.5692 15.3047 17.5385C14.437 17.3969 13.877 17.2 13.877 17.2C13.4893 17.0769 13.0401 16.9846 12.5355 16.9292C9.77243 16.6462 8.57858 17.6985 8.51089 17.8954C8.4432 18.0923 8.74473 20.6523 8.96627 21.0585C9.18166 21.4585 9.51396 21.6923 9.8155 21.8216C10.1232 21.9508 12.6524 22.2031 13.4955 22.0862C14.3386 21.9692 14.4678 21.6862 14.6955 21.2554C14.8555 20.9477 15.2678 19.5569 15.4955 18.7385C15.5509 18.5785 15.557 18.2585 15.9447 18.2339C16.3324 18.2646 16.3386 18.5908 16.3878 18.7508C16.6093 19.5692 16.997 20.9723 17.1509 21.28C17.3663 21.7169 17.4955 22 18.3386 22.1354C19.1755 22.2646 21.7109 22.0616 22.0186 21.9385C22.3263 21.8154 22.6586 21.5877 22.8801 21.1877C23.1017 20.7877 23.4463 18.2339 23.3847 18.0369C23.3232 17.8339 22.1478 16.7631 19.3786 16.9969Z"></path>
1644
- // <path d="M28.0124 8.95386H28.0186C27.2494 7.9754 26.3386 7.10771 25.3294 6.36309C26.3755 6.17848 27.1694 5.26771 27.1694 4.17232C27.1694 2.94155 26.1724 1.93848 24.9355 1.93848C23.6986 1.93848 22.7017 2.9354 22.7017 4.17232C22.7017 4.41848 22.7509 4.65232 22.8247 4.87386C21.237 4.12309 19.5017 3.63078 17.6863 3.44002C14.6463 3.12002 11.7109 3.66155 9.18166 4.8554C9.24935 4.64001 9.29858 4.41232 9.29858 4.17232C9.29858 2.94155 8.30166 1.93848 7.06473 1.93848C5.82781 1.93848 4.83089 2.9354 4.83089 4.17232C4.83089 5.26771 5.61858 6.17232 6.65243 6.36309C3.78473 8.48001 1.78473 11.5631 1.32935 15.1385C0.904735 18.4431 1.84627 21.7539 3.98781 24.4616C6.41243 27.5262 10.1786 29.5385 14.314 29.9754C14.8924 30.0369 15.4647 30.0677 16.0309 30.0677C23.4094 30.0677 29.797 25.0585 30.6709 18.2769C31.0955 14.9723 30.154 11.6616 28.0124 8.95386ZM16.0124 26.2523H16.0063C10.4555 26.2462 5.93858 22.5416 5.93858 17.9877C5.93858 16.6154 6.35704 15.2985 7.11397 14.1292C7.18166 14.5477 7.30473 14.9108 7.44012 15.1816C7.62473 15.5508 7.99397 15.7662 8.38166 15.7662C8.5355 15.7662 8.6955 15.7354 8.8432 15.6616C9.36627 15.4092 9.58166 14.7816 9.34166 14.2585C9.21243 13.9816 8.88012 13.0646 9.68627 12.3631C10.4678 13.0708 11.5878 13.9016 12.8493 14.3077C15.2001 15.0523 16.9786 14.6154 17.0524 14.5969C17.4093 14.5046 17.6863 14.24 17.797 13.8892C17.9078 13.5385 17.8278 13.1569 17.5878 12.8862C16.4001 11.52 15.834 10.5231 15.5878 9.92002C20.4001 10.5723 21.3232 14.4062 21.3601 14.5785C21.4647 15.0708 21.9017 15.4092 22.3878 15.4092C22.4617 15.4092 22.5294 15.4031 22.6032 15.3846C23.1755 15.2677 23.5386 14.7077 23.4217 14.1354C23.274 13.4216 22.8863 12.4554 22.197 11.4892C24.554 13.0031 26.0801 15.3539 26.0801 17.9939C26.0801 22.5477 21.5632 26.2523 16.0124 26.2523Z"></path>
1645
- // </svg>
1646
- // </i>
1647
- index.h("i", { class: "block text-body1 default-botAvatar" }, index.h("svg", { stroke: "currentColor", fill: "currentColor", "stroke-width": "0", viewBox: "0 0 16 16", height: 20, width: 20, xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M8 1a5 5 0 0 0-5 5v1h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6a6 6 0 1 1 12 0v6a2.5 2.5 0 0 1-2.5 2.5H9.366a1 1 0 0 1-.866.5h-1a1 1 0 1 1 0-2h1a1 1 0 0 1 .866.5H11.5A1.5 1.5 0 0 0 13 12h-1a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h1V6a5 5 0 0 0-5-5" }))))))), !message.isUser && (index.h("div", { class: "flex flex-col", style: { width: "100%" } }, index.h("div", { "data-testid": "message", class: {
2478
+ })), index.h("div", { class: "text-gray-30 pt-2 text-right text-body4" }, "Sent ", message.timestamp))), !message.isUser && (index.h("div", { class: "avatar-column" }, index.h("chat-avatar", { id: `la${message.id}`, senderType: (message === null || message === void 0 ? void 0 : message.sender) ? "agent" : "bot", avatarUrl: (_b = this.botSettings) === null || _b === void 0 ? void 0 : _b.botAvatar }))), !message.isUser && (index.h("div", { class: "flex flex-col", style: { width: "100%" } }, index.h("div", { "data-testid": "message", class: {
1648
2479
  "prose": true,
1649
2480
  "transition-all": true,
1650
2481
  "duration-300": true,
@@ -1652,10 +2483,10 @@ const Ai12zBot = class {
1652
2483
  "opacity-90": !this.isProse,
1653
2484
  "max-w-full break-words @md:text-body2 box-border @md:pr-4 flex-1 rounded-lg text-gray-30 pr-2 text-body3": true,
1654
2485
  }, innerHTML: message.text, id: message.id }, message.text === "" && (index.h("div", { class: "w-full rounded-md", id: "spinner" }, index.h("div", { class: "flex animate-pulse space-x-4" }, index.h("div", { class: "flex-1 space-y-3 py-1" }, index.h("div", { class: "h-4 rounded bg-gray-200" }), index.h("div", { class: "space-y-3" }, index.h("div", { class: "grid grid-cols-3 gap-4" }, index.h("div", { class: "col-span-2 h-4 rounded bg-gray-200" }), index.h("div", { class: "col-span-1 h-4 rounded bg-gray-200" })), index.h("div", { class: "h-4 rounded bg-gray-200" }))))))), index.h("div", { class: "text-gray-30 pt-2 text-body4" }, this.botSettings.botName, " \u2022 ", message.timestamp)))));
1655
- }), this.showHistory && (index.h("chatbot-history", { chatList: this.conversationHistory, botName: (_20 = this.botSettings) === null || _20 === void 0 ? void 0 : _20.botName, styles: this.customStyle, scripts: this.customJS })), index.h("div", { class: "h-px pt-2px", style: { overflowAnchor: "auto" } })), index.h("div", { "aria-live": "polite", class: "absolute w-[1px] h-[1px] p-0 m-[-1px] overflow-hidden whitespace-nowrap border-0" })))), index.h("form", { "data-testid": "user-input", class: `relative pointer-events-auto ${this.isOpened ? "p-2.5" : ""} searchform user-input`, role: "region", "aria-label": "Message Area", "aria-hidden": "false", style: { opacity: !this.isMinimized ? "1" : "0", transform: "translateX(0)", pointerEvents: !this.isMinimized ? "auto" : "none" } }, !this.isOpened && (index.h("div", { class: `absolute right-4 md:right-0 border-2 border-white border-solid rounded-full ${this.isContent ? "" : "top-0"} minimize-input` }, index.h("button", { class: "rounded-full flex items-center justify-center disabled:cursor-not-allowed bg-gray-500 bg-opacity-60 hover:bg-opacity-80 h-5 w-5", tabindex: "0", onClick: e => {
2486
+ }), this.showHistory && (index.h("chatbot-history", { chatList: this.conversationHistory, botName: (_24 = this.botSettings) === null || _24 === void 0 ? void 0 : _24.botName, styles: this.customStyle, scripts: this.customJS })), index.h("div", { class: "h-px pt-2px", style: { overflowAnchor: "auto" } })), index.h("div", { "aria-live": "polite", class: "absolute w-[1px] h-[1px] p-0 m-[-1px] overflow-hidden whitespace-nowrap border-0" })))), index.h("form", { "data-testid": "user-input", class: `relative pointer-events-auto ${this.isOpened ? "p-2.5" : ""} searchform user-input`, role: "region", "aria-label": "Message Area", "aria-hidden": "false", style: { opacity: !this.isMinimized ? "1" : "0", transform: "translateX(0)", pointerEvents: !this.isMinimized ? "auto" : "none" } }, !this.isOpened && (index.h("div", { class: `absolute right-4 md:right-0 border-2 border-white border-solid rounded-full ${this.isContent ? "" : "top-0"} minimize-input` }, index.h("button", { class: "rounded-full flex items-center justify-center disabled:cursor-not-allowed bg-gray-500 bg-opacity-60 hover:bg-opacity-80 h-5 w-5", tabindex: "0", onClick: e => {
1656
2487
  e.preventDefault();
1657
2488
  this.isMinimized = !this.isMinimized;
1658
- } }, index.h("i", { class: "block ai-minimize-icon ai-text-caption" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "52", width: "52", viewBox: "0 0 520 520", fill: "#fff" }, index.h("path", { d: "M500 275c0 8-7 15-15 15H35c-8 0-15-7-15-15v-30c0-8 7-15 15-15h450c8 0 15 7 15 15z" })))))), index.h("fieldset", { class: `flex flex-col @md:mx-0 @md:rounded-t-xl transition-colors ${this.isMinimized && !this.isExpanded ? "" : "p-4 user-input-fieldset"}` }, !this.isExpanded && this.isOpened && this.messages.length === 0 && (index.h("privacy-modal", { show: this.showPrivacy, message: this.botSettings.privacyTemplate })), index.h("div", { class: "flex-1 align-bottom" }, index.h("div", { class: "grow-wrap show-grid after:whitespace-pre-wrap after:invisible relative", "data-replicated-value": "", "aria-disabled": "false" }, this.botSettings.imageUpload && (index.h("div", { "aria-disabled": "true", class: `absolute flex items-center left-0 bottom-0 h-full pl-4 pr-2 ${this.hideAllButtons ? "hidden" : ""} ${this.isContent ? "hidden" : ""} agent-input-icon` }, index.h("button", { class: "plus-icon", onClick: e => {
2489
+ } }, index.h("i", { class: "block ai-minimize-icon ai-text-caption" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "52", width: "52", viewBox: "0 0 520 520", fill: "#fff" }, index.h("path", { d: "M500 275c0 8-7 15-15 15H35c-8 0-15-7-15-15v-30c0-8 7-15 15-15h450c8 0 15 7 15 15z" })))))), index.h("fieldset", { class: `flex flex-col @md:mx-0 @md:rounded-t-xl transition-colors ${this.isMinimized && !this.isExpanded ? "" : "p-4 user-input-fieldset"}` }, !this.isExpanded && this.isOpened && this.messages.length === 0 && (index.h("privacy-modal", { show: this.showPrivacy, message: this.botSettings.privacyTemplate })), index.h("div", { class: "flex-1 align-bottom" }, this.isTypingIndicatorVisible && (index.h("div", { class: "flex items-center justify-center w-full h-12" }, index.h("typing-indicator", null))), index.h("div", { class: "grow-wrap show-grid after:whitespace-pre-wrap after:invisible relative", "data-replicated-value": "", "aria-disabled": "false" }, this.botSettings.imageUpload && (index.h("div", { "aria-disabled": "true", class: `absolute flex items-center left-0 bottom-0 h-full pl-4 pr-2 ${this.hideAllButtons ? "hidden" : ""} ${this.isContent ? "hidden" : ""} agent-input-icon` }, index.h("button", { class: "plus-icon", onClick: e => {
1659
2490
  e.stopPropagation();
1660
2491
  e.preventDefault();
1661
2492
  this.showMenu = !this.showMenu;
@@ -1667,7 +2498,7 @@ const Ai12zBot = class {
1667
2498
  } }, index.h("input", { type: "file", multiple: true, name: "files[]", id: "fileInput", accept: "image/*", class: "image-upload__input", onChange: ($event) => {
1668
2499
  // this.isImage = true
1669
2500
  this.onInputChange($event.target.files);
1670
- }, ref: el => (this.uploadElem = el) }), index.h("div", { class: "mr-1" }, index.h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: "h-5 w-5 shrink-0" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M18.0322 5.02393C17.7488 5.00078 17.3766 5 16.8 5H11.5002C11.3 6 11.0989 6.91141 10.8903 7.85409C10.7588 8.44955 10.6432 8.97304 10.3675 9.41399C10.1262 9.80009 9.80009 10.1262 9.41399 10.3675C8.97304 10.6432 8.44955 10.7588 7.85409 10.8903C7.81276 10.8994 7.77108 10.9086 7.72906 10.9179L5.21693 11.4762C5.1442 11.4924 5.07155 11.5001 5 11.5002V16.8C5 17.3766 5.00078 17.7488 5.02393 18.0322C5.04612 18.3038 5.0838 18.4045 5.109 18.454C5.20487 18.6422 5.35785 18.7951 5.54601 18.891C5.59546 18.9162 5.69617 18.9539 5.96784 18.9761C6.25118 18.9992 6.62345 19 7.2 19H10C10.5523 19 11 19.4477 11 20C11 20.5523 10.5523 21 10 21H7.16144C6.6343 21 6.17954 21 5.80497 20.9694C5.40963 20.9371 5.01641 20.8658 4.63803 20.673C4.07354 20.3854 3.6146 19.9265 3.32698 19.362C3.13419 18.9836 3.06287 18.5904 3.03057 18.195C2.99997 17.8205 2.99998 17.3657 3 16.8385L3 11C3 8.92477 4.02755 6.93324 5.4804 5.4804C6.93324 4.02755 8.92477 3 11 3L16.8385 3C17.3657 2.99998 17.8205 2.99997 18.195 3.03057C18.5904 3.06287 18.9836 3.13419 19.362 3.32698C19.9265 3.6146 20.3854 4.07354 20.673 4.63803C20.8658 5.01641 20.9371 5.40963 20.9694 5.80497C21 6.17954 21 6.6343 21 7.16144V10C21 10.5523 20.5523 11 20 11C19.4477 11 19 10.5523 19 10V7.2C19 6.62345 18.9992 6.25118 18.9761 5.96784C18.9539 5.69617 18.9162 5.59546 18.891 5.54601C18.7951 5.35785 18.6422 5.20487 18.454 5.109C18.4045 5.0838 18.3038 5.04612 18.0322 5.02393ZM5.28014 9.41336L7.2952 8.96556C8.08861 8.78925 8.24308 8.74089 8.35381 8.67166C8.48251 8.59121 8.59121 8.48251 8.67166 8.35381C8.74089 8.24308 8.78925 8.08861 8.96556 7.2952L9.41336 5.28014C8.51014 5.59289 7.63524 6.15398 6.89461 6.89461C6.15398 7.63524 5.59289 8.51014 5.28014 9.41336ZM17 15C17 14.4477 17.4477 14 18 14C18.5523 14 19 14.4477 19 15V17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H19V21C19 21.5523 18.5523 22 18 22C17.4477 22 17 21.5523 17 21V19H15C14.4477 19 14 18.5523 14 18C14 17.4477 14.4477 17 15 17H17V15Z", fill: "currentColor" }))), index.h("div", null, "Upload Images")))))), index.h("div", { class: `${this.isContent ? "hidden" : ""} textarea` }, index.h("div", { id: "previewContainer" }), this.showTextarea && (index.h("textarea", { class: `resize-none overflow-hidden text-ellipsis focus:outline-none w-full ${this.hideAllButtons ? "hidden" : ""}`, "data-testid": "user-input-textarea", rows: this.rowCount, name: "userMessage", placeholder: (_22 = (_21 = this.botSettings) === null || _21 === void 0 ? void 0 : _21.botPlaceholderText) !== null && _22 !== void 0 ? _22 : "Ask me anything",
2501
+ }, ref: el => (this.uploadElem = el) }), index.h("div", { class: "mr-1" }, index.h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: "h-5 w-5 shrink-0" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M18.0322 5.02393C17.7488 5.00078 17.3766 5 16.8 5H11.5002C11.3 6 11.0989 6.91141 10.8903 7.85409C10.7588 8.44955 10.6432 8.97304 10.3675 9.41399C10.1262 9.80009 9.80009 10.1262 9.41399 10.3675C8.97304 10.6432 8.44955 10.7588 7.85409 10.8903C7.81276 10.8994 7.77108 10.9086 7.72906 10.9179L5.21693 11.4762C5.1442 11.4924 5.07155 11.5001 5 11.5002V16.8C5 17.3766 5.00078 17.7488 5.02393 18.0322C5.04612 18.3038 5.0838 18.4045 5.109 18.454C5.20487 18.6422 5.35785 18.7951 5.54601 18.891C5.59546 18.9162 5.69617 18.9539 5.96784 18.9761C6.25118 18.9992 6.62345 19 7.2 19H10C10.5523 19 11 19.4477 11 20C11 20.5523 10.5523 21 10 21H7.16144C6.6343 21 6.17954 21 5.80497 20.9694C5.40963 20.9371 5.01641 20.8658 4.63803 20.673C4.07354 20.3854 3.6146 19.9265 3.32698 19.362C3.13419 18.9836 3.06287 18.5904 3.03057 18.195C2.99997 17.8205 2.99998 17.3657 3 16.8385L3 11C3 8.92477 4.02755 6.93324 5.4804 5.4804C6.93324 4.02755 8.92477 3 11 3L16.8385 3C17.3657 2.99998 17.8205 2.99997 18.195 3.03057C18.5904 3.06287 18.9836 3.13419 19.362 3.32698C19.9265 3.6146 20.3854 4.07354 20.673 4.63803C20.8658 5.01641 20.9371 5.40963 20.9694 5.80497C21 6.17954 21 6.6343 21 7.16144V10C21 10.5523 20.5523 11 20 11C19.4477 11 19 10.5523 19 10V7.2C19 6.62345 18.9992 6.25118 18.9761 5.96784C18.9539 5.69617 18.9162 5.59546 18.891 5.54601C18.7951 5.35785 18.6422 5.20487 18.454 5.109C18.4045 5.0838 18.3038 5.04612 18.0322 5.02393ZM5.28014 9.41336L7.2952 8.96556C8.08861 8.78925 8.24308 8.74089 8.35381 8.67166C8.48251 8.59121 8.59121 8.48251 8.67166 8.35381C8.74089 8.24308 8.78925 8.08861 8.96556 7.2952L9.41336 5.28014C8.51014 5.59289 7.63524 6.15398 6.89461 6.89461C6.15398 7.63524 5.59289 8.51014 5.28014 9.41336ZM17 15C17 14.4477 17.4477 14 18 14C18.5523 14 19 14.4477 19 15V17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H19V21C19 21.5523 18.5523 22 18 22C17.4477 22 17 21.5523 17 21V19H15C14.4477 19 14 18.5523 14 18C14 17.4477 14.4477 17 15 17H17V15Z", fill: "currentColor" }))), index.h("div", null, "Upload Images")))))), index.h("div", { class: `${this.isContent ? "hidden" : ""} textarea` }, index.h("div", { id: "previewContainer" }), this.showTextarea && (index.h("textarea", { class: `resize-none overflow-hidden text-ellipsis focus:outline-none w-full ${this.hideAllButtons ? "hidden" : ""}`, "data-testid": "user-input-textarea", rows: this.rowCount, name: "userMessage", placeholder: (_26 = (_25 = this.botSettings) === null || _25 === void 0 ? void 0 : _25.botPlaceholderText) !== null && _26 !== void 0 ? _26 : "Ask me anything",
1671
2502
  // aria-labelledby="message-submit"
1672
2503
  ref: el => (this.inputEl = el), onKeyUp: _e => {
1673
2504
  this.adjustHeight();
@@ -1719,8 +2550,8 @@ const Ai12zBot = class {
1719
2550
  }, onClick: () => {
1720
2551
  this.openChat();
1721
2552
  }
1722
- }, this.isBot && index.h("slot", { name: "bot" }), !this.isBot && (index.h("button", { class: "rounded-full flex cursor-pointer items-center pr-[14px] md:gap-x-3 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-blue-focused", tabindex: "0" }, index.h("div", { class: "w-10 h-10 flex items-center justify-center bg-white rounded-full border relative" }, this.botSettings.botLaunchIcon && index.h("img", { src: this.botSettings.botLaunchIcon, alt: "bot icon", class: "w-8 h-8 rounded-lg" }), !this.botSettings.botLaunchIcon && (index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "#2095ae" }, index.h("g", { "stroke-width": "0" }), index.h("g", { "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("g", null, " ", index.h("path", { d: "M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z", stroke: "#2095ae", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), " ")))), index.h("span", { class: "bot-name" }, "Ask ", (_23 = this.botSettings) === null || _23 === void 0 ? void 0 :
1723
- _23.botName))))))));
2553
+ }, this.isBot && index.h("slot", { name: "bot" }), !this.isBot && (index.h("button", { class: "rounded-full flex cursor-pointer items-center pr-[14px] md:gap-x-3 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-blue-focused", tabindex: "0" }, index.h("div", { class: "w-10 h-10 flex items-center justify-center bg-white rounded-full border relative" }, this.botSettings.botLaunchIcon && index.h("img", { src: this.botSettings.botLaunchIcon, alt: "bot icon", class: "w-8 h-8 rounded-lg" }), !this.botSettings.botLaunchIcon && (index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "#2095ae" }, index.h("g", { "stroke-width": "0" }), index.h("g", { "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("g", null, " ", index.h("path", { d: "M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z", stroke: "#2095ae", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), " ")))), index.h("span", { class: "bot-name" }, "Ask ", (_27 = this.botSettings) === null || _27 === void 0 ? void 0 :
2554
+ _27.botName))))))));
1724
2555
  }
1725
2556
  get el() { return index.getElement(this); }
1726
2557
  static get watchers() { return {
@@ -1732,4 +2563,4 @@ Ai12zBot.style = Ai12zBotStyle0 + (Ai12zBotStyle1 + (Ai12zBotStyle2 + Ai12zBotSt
1732
2563
 
1733
2564
  exports.Ai12zBot = Ai12zBot;
1734
2565
 
1735
- //# sourceMappingURL=ai12z-bot-787aa8c7.js.map
2566
+ //# sourceMappingURL=ai12z-bot-0eeb5af8.js.map