@chat21/chat21-web-widget 5.1.32-rc8 → 5.1.33-rc11

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 (246) hide show
  1. package/.angular-mcp-cache/package.json +1 -0
  2. package/.cursor/angular18-accessibility-auditor-skill.md +442 -0
  3. package/.cursor/mcp.json +15 -0
  4. package/.github/workflows/playwright.yml +27 -0
  5. package/.playwright-mcp/console-2026-05-08T15-31-09-000Z.log +17 -0
  6. package/.playwright-mcp/console-2026-05-08T15-32-19-412Z.log +89 -0
  7. package/.playwright-mcp/console-2026-05-08T16-18-48-424Z.log +133 -0
  8. package/.playwright-mcp/console-2026-05-11T12-54-06-869Z.log +13 -0
  9. package/.playwright-mcp/console-2026-05-11T12-54-56-229Z.log +147 -0
  10. package/.playwright-mcp/console-2026-05-11T12-55-47-174Z.log +183 -0
  11. package/.playwright-mcp/console-2026-05-11T15-34-03-590Z.log +210 -0
  12. package/.playwright-mcp/console-2026-05-12T15-07-31-880Z.log +118 -0
  13. package/.playwright-mcp/page-2026-05-08T15-32-19-900Z.yml +851 -0
  14. package/.playwright-mcp/page-2026-05-08T15-32-47-264Z.yml +857 -0
  15. package/.playwright-mcp/page-2026-05-08T15-33-17-089Z.yml +1110 -0
  16. package/.playwright-mcp/page-2026-05-08T15-33-23-486Z.yml +1069 -0
  17. package/.playwright-mcp/page-2026-05-08T15-33-45-390Z.yml +1076 -0
  18. package/.playwright-mcp/page-2026-05-08T15-33-52-666Z.yml +1072 -0
  19. package/.playwright-mcp/page-2026-05-08T15-34-01-338Z.yml +1085 -0
  20. package/.playwright-mcp/page-2026-05-08T15-34-07-227Z.yml +1072 -0
  21. package/.playwright-mcp/page-2026-05-08T15-34-13-875Z.yml +1072 -0
  22. package/.playwright-mcp/page-2026-05-08T15-34-21-885Z.yml +1109 -0
  23. package/.playwright-mcp/page-2026-05-08T15-34-32-755Z.yml +1109 -0
  24. package/.playwright-mcp/page-2026-05-08T15-35-09-607Z.yml +1119 -0
  25. package/.playwright-mcp/page-2026-05-08T15-35-14-242Z.yml +1109 -0
  26. package/.playwright-mcp/page-2026-05-08T16-18-48-671Z.yml +44 -0
  27. package/.playwright-mcp/page-2026-05-08T16-18-52-753Z.png +0 -0
  28. package/.playwright-mcp/page-2026-05-08T16-19-13-919Z.yml +68 -0
  29. package/.playwright-mcp/page-2026-05-08T16-19-17-977Z.png +0 -0
  30. package/.playwright-mcp/page-2026-05-08T16-19-25-733Z.yml +120 -0
  31. package/.playwright-mcp/page-2026-05-08T16-19-29-252Z.png +0 -0
  32. package/.playwright-mcp/page-2026-05-08T16-19-39-269Z.yml +80 -0
  33. package/.playwright-mcp/page-2026-05-08T16-19-43-915Z.png +0 -0
  34. package/.playwright-mcp/page-2026-05-08T16-20-04-407Z.yml +81 -0
  35. package/.playwright-mcp/page-2026-05-08T16-20-08-984Z.png +0 -0
  36. package/.playwright-mcp/page-2026-05-08T16-20-32-397Z.png +0 -0
  37. package/.playwright-mcp/page-2026-05-08T16-20-58-658Z.png +0 -0
  38. package/.playwright-mcp/page-2026-05-08T16-21-12-320Z.yml +86 -0
  39. package/.playwright-mcp/page-2026-05-08T16-21-39-154Z.yml +91 -0
  40. package/.playwright-mcp/page-2026-05-08T16-21-45-420Z.png +0 -0
  41. package/.playwright-mcp/page-2026-05-08T16-22-21-062Z.yml +0 -0
  42. package/.playwright-mcp/page-2026-05-08T16-22-58-232Z.yml +91 -0
  43. package/.playwright-mcp/page-2026-05-08T16-23-36-520Z.yml +0 -0
  44. package/.playwright-mcp/page-2026-05-08T16-23-46-805Z.yml +100 -0
  45. package/.playwright-mcp/page-2026-05-08T16-23-55-169Z.png +0 -0
  46. package/.playwright-mcp/page-2026-05-08T16-24-26-574Z.yml +91 -0
  47. package/.playwright-mcp/page-2026-05-08T16-25-34-414Z.png +0 -0
  48. package/.playwright-mcp/page-2026-05-08T16-25-59-831Z.png +0 -0
  49. package/.playwright-mcp/page-2026-05-08T16-26-21-809Z.yml +91 -0
  50. package/.playwright-mcp/page-2026-05-08T16-26-47-443Z.yml +105 -0
  51. package/.playwright-mcp/page-2026-05-08T16-26-56-136Z.png +0 -0
  52. package/.playwright-mcp/page-2026-05-08T16-27-59-610Z.yml +48 -0
  53. package/.playwright-mcp/page-2026-05-11T12-54-07-180Z.yml +44 -0
  54. package/.playwright-mcp/page-2026-05-11T12-54-56-946Z.yml +4 -0
  55. package/.playwright-mcp/page-2026-05-11T12-55-47-503Z.yml +24 -0
  56. package/.playwright-mcp/page-2026-05-11T12-56-00-766Z.yml +28 -0
  57. package/.playwright-mcp/page-2026-05-11T12-56-06-438Z.yml +90 -0
  58. package/.playwright-mcp/page-2026-05-11T12-57-56-838Z.yml +106 -0
  59. package/.playwright-mcp/page-2026-05-11T12-58-00-124Z.yml +106 -0
  60. package/.playwright-mcp/page-2026-05-11T12-59-08-836Z.yml +61 -0
  61. package/.playwright-mcp/page-2026-05-11T12-59-12-088Z.yml +61 -0
  62. package/.playwright-mcp/page-2026-05-11T12-59-26-215Z.yml +69 -0
  63. package/.playwright-mcp/page-2026-05-11T12-59-29-519Z.yml +69 -0
  64. package/.playwright-mcp/page-2026-05-11T12-59-37-309Z.yml +0 -0
  65. package/.playwright-mcp/page-2026-05-11T12-59-39-968Z.yml +79 -0
  66. package/.playwright-mcp/page-2026-05-11T12-59-45-983Z.yml +78 -0
  67. package/.playwright-mcp/page-2026-05-11T12-59-49-951Z.yml +78 -0
  68. package/.playwright-mcp/page-2026-05-11T15-34-04-515Z.yml +0 -0
  69. package/.playwright-mcp/page-2026-05-12T15-07-32-171Z.yml +44 -0
  70. package/.playwright-mcp/page-2026-05-12T15-08-09-820Z.yml +119 -0
  71. package/CHANGELOG.md +68 -3
  72. package/angular.json +20 -3
  73. package/deploy_amazon_beta.sh +7 -17
  74. package/deploy_amazon_prod.sh +41 -0
  75. package/docs/TILEDESK_WIDGET_ACCESSIBILITY_STATEMENT_COMPLETE.md +379 -0
  76. package/env.sample +3 -2
  77. package/mocks/voice-websocket-mock/server.cjs +245 -0
  78. package/package.json +7 -3
  79. package/playwright.config.ts +41 -0
  80. package/src/app/app.component.html +2 -2
  81. package/src/app/app.component.scss +25 -14
  82. package/src/app/app.component.spec.ts +21 -6
  83. package/src/app/app.module.ts +4 -0
  84. package/src/app/component/conversation-detail/conversation/conversation.component.html +19 -11
  85. package/src/app/component/conversation-detail/conversation/conversation.component.scss +28 -0
  86. package/src/app/component/conversation-detail/conversation/conversation.component.spec.ts +644 -75
  87. package/src/app/component/conversation-detail/conversation/conversation.component.ts +63 -17
  88. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +25 -13
  89. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.spec.ts +123 -5
  90. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.ts +1 -0
  91. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +22 -9
  92. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +23 -1
  93. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.spec.ts +242 -149
  94. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +7 -6
  95. package/src/app/component/conversation-detail/conversation-emojii/conversation-emojii.component.spec.ts +53 -3
  96. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component copy.html +172 -0
  97. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +112 -61
  98. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +133 -16
  99. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.spec.ts +452 -78
  100. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +199 -79
  101. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +113 -53
  102. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +12 -4
  103. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.spec.ts +274 -29
  104. package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.html +23 -9
  105. package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.spec.ts +80 -8
  106. package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.html +29 -23
  107. package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.spec.ts +185 -16
  108. package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.ts +34 -14
  109. package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.html +46 -19
  110. package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.scss +67 -10
  111. package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.ts +142 -12
  112. package/src/app/component/error-alert/error-alert.component.spec.ts +65 -5
  113. package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.html +16 -7
  114. package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.scss +21 -0
  115. package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.spec.ts +89 -7
  116. package/src/app/component/form/form-builder/form-builder.component.html +1 -1
  117. package/src/app/component/form/form-builder/form-builder.component.spec.ts +163 -21
  118. package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.html +8 -4
  119. package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.scss +10 -5
  120. package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.spec.ts +90 -16
  121. package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.ts +26 -0
  122. package/src/app/component/form/inputs/form-label/form-label.component.spec.ts +45 -11
  123. package/src/app/component/form/inputs/form-radio-button/form-radio-button.component.spec.ts +24 -6
  124. package/src/app/component/form/inputs/form-select/form-select.component.spec.ts +14 -5
  125. package/src/app/component/form/inputs/form-text/form-text.component.html +14 -12
  126. package/src/app/component/form/inputs/form-text/form-text.component.scss +11 -1
  127. package/src/app/component/form/inputs/form-text/form-text.component.spec.ts +113 -17
  128. package/src/app/component/form/inputs/form-text/form-text.component.ts +35 -3
  129. package/src/app/component/form/inputs/form-textarea/form-textarea.component.html +13 -11
  130. package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +6 -5
  131. package/src/app/component/form/inputs/form-textarea/form-textarea.component.spec.ts +149 -13
  132. package/src/app/component/form/inputs/form-textarea/form-textarea.component.ts +26 -0
  133. package/src/app/component/form/prechat-form/prechat-form.component.html +14 -11
  134. package/src/app/component/form/prechat-form/prechat-form.component.spec.ts +102 -10
  135. package/src/app/component/form/prechat-form/prechat-form.component.ts +8 -1
  136. package/src/app/component/form/prechat-form-test-mock.ts +35 -0
  137. package/src/app/component/home/home.component.html +38 -31
  138. package/src/app/component/home/home.component.scss +4 -2
  139. package/src/app/component/home/home.component.spec.ts +226 -11
  140. package/src/app/component/home-conversations/home-conversations.component.html +30 -26
  141. package/src/app/component/home-conversations/home-conversations.component.scss +3 -0
  142. package/src/app/component/home-conversations/home-conversations.component.spec.ts +212 -36
  143. package/src/app/component/last-message/last-message.component.html +15 -9
  144. package/src/app/component/last-message/last-message.component.scss +16 -2
  145. package/src/app/component/last-message/last-message.component.spec.ts +204 -23
  146. package/src/app/component/launcher-button/launcher-button.component.html +8 -13
  147. package/src/app/component/launcher-button/launcher-button.component.spec.ts +104 -8
  148. package/src/app/component/list-all-conversations/list-all-conversations.component.html +12 -17
  149. package/src/app/component/list-all-conversations/list-all-conversations.component.scss +2 -0
  150. package/src/app/component/list-conversations/list-conversations.component.html +22 -22
  151. package/src/app/component/menu-options/menu-options.component.html +30 -20
  152. package/src/app/component/menu-options/menu-options.component.spec.ts +125 -9
  153. package/src/app/component/message/audio/audio.component.html +13 -15
  154. package/src/app/component/message/audio/audio.component.spec.ts +140 -5
  155. package/src/app/component/message/audio/audio.component.ts +1 -0
  156. package/src/app/component/message/audio-sync/audio-sync.component.scss +1 -1
  157. package/src/app/component/message/audio-sync/audio-sync.component.spec.ts +81 -1
  158. package/src/app/component/message/audio-sync/audio-sync.component.ts +134 -24
  159. package/src/app/component/message/avatar/avatar.component.html +2 -2
  160. package/src/app/component/message/avatar/avatar.component.spec.ts +99 -7
  161. package/src/app/component/message/bubble-message/bubble-message.component.html +39 -52
  162. package/src/app/component/message/bubble-message/bubble-message.component.scss +59 -1
  163. package/src/app/component/message/bubble-message/bubble-message.component.spec.ts +154 -57
  164. package/src/app/component/message/bubble-message/bubble-message.component.ts +152 -110
  165. package/src/app/component/message/buttons/action-button/action-button.component.html +3 -4
  166. package/src/app/component/message/buttons/action-button/action-button.component.spec.ts +49 -5
  167. package/src/app/component/message/buttons/link-button/link-button.component.scss +5 -8
  168. package/src/app/component/message/buttons/link-button/link-button.component.spec.ts +50 -5
  169. package/src/app/component/message/buttons/text-button/text-button.component.spec.ts +44 -5
  170. package/src/app/component/message/carousel/carousel.component.html +29 -16
  171. package/src/app/component/message/carousel/carousel.component.scss +20 -8
  172. package/src/app/component/message/carousel/carousel.component.spec.ts +80 -3
  173. package/src/app/component/message/carousel/carousel.component.ts +16 -0
  174. package/src/app/component/message/frame/frame.component.html +9 -4
  175. package/src/app/component/message/frame/frame.component.spec.ts +34 -15
  176. package/src/app/component/message/frame/frame.component.ts +7 -2
  177. package/src/app/component/message/html/html.component.html +1 -1
  178. package/src/app/component/message/html/html.component.scss +1 -1
  179. package/src/app/component/message/html/html.component.spec.ts +24 -7
  180. package/src/app/component/message/image/image.component.html +12 -10
  181. package/src/app/component/message/image/image.component.scss +16 -0
  182. package/src/app/component/message/image/image.component.spec.ts +101 -15
  183. package/src/app/component/message/image/image.component.ts +90 -51
  184. package/src/app/component/message/info-message/info-message.component.spec.ts +26 -14
  185. package/src/app/component/message/json-sources/json-sources.component.html +38 -0
  186. package/src/app/component/message/json-sources/json-sources.component.scss +201 -0
  187. package/src/app/component/message/json-sources/json-sources.component.ts +89 -0
  188. package/src/app/component/message/like-unlike/like-unlike.component.html +7 -9
  189. package/src/app/component/message/like-unlike/like-unlike.component.spec.ts +31 -3
  190. package/src/app/component/message/return-receipt/return-receipt.component.spec.ts +38 -17
  191. package/src/app/component/message/text/text.component.html +3 -3
  192. package/src/app/component/message/text/text.component.scss +80 -86
  193. package/src/app/component/message/text/text.component.spec.ts +106 -13
  194. package/src/app/component/message-attachment/message-attachment.component.spec.ts +134 -13
  195. package/src/app/component/selection-department/selection-department.component.html +21 -23
  196. package/src/app/component/selection-department/selection-department.component.spec.ts +159 -14
  197. package/src/app/component/selection-department/selection-department.component.ts +8 -1
  198. package/src/app/component/send-button/send-button.component.html +5 -13
  199. package/src/app/component/send-button/send-button.component.spec.ts +2 -2
  200. package/src/app/component/star-rating-widget/star-rating-widget.component.html +51 -81
  201. package/src/app/directives/tooltip.directive.spec.ts +8 -4
  202. package/src/app/modals/confirm-close/confirm-close.component.html +20 -8
  203. package/src/app/modals/confirm-close/confirm-close.component.scss +3 -0
  204. package/src/app/modals/confirm-close/confirm-close.component.spec.ts +13 -4
  205. package/src/app/modals/confirm-close/confirm-close.component.ts +8 -1
  206. package/src/app/pipe/html-entites-encode.pipe.spec.ts +35 -2
  207. package/src/app/pipe/marked.pipe.spec.ts +38 -2
  208. package/src/app/pipe/marked.pipe.ts +51 -41
  209. package/src/app/providers/app-config.service.ts +4 -2
  210. package/src/app/providers/brand.service.spec.ts +23 -2
  211. package/src/app/providers/brand.service.ts +1 -1
  212. package/src/app/providers/global-settings.service.spec.ts +1009 -14
  213. package/src/app/providers/global-settings.service.ts +59 -2
  214. package/src/app/providers/json-sources-parser.service.ts +175 -0
  215. package/src/app/providers/translator.service.ts +24 -6
  216. package/src/app/providers/tts-audio-playback-coordinator.service.spec.ts +117 -0
  217. package/src/app/providers/tts-audio-playback-coordinator.service.ts +45 -7
  218. package/src/app/providers/url-preview.service.ts +82 -0
  219. package/src/app/providers/voice/audio.types.ts +6 -0
  220. package/src/app/providers/voice/voice-streaming.service.spec.ts +23 -0
  221. package/src/app/providers/voice/voice-streaming.service.ts +702 -0
  222. package/src/app/providers/voice/voice-streaming.types.ts +112 -0
  223. package/src/app/providers/voice/voice.service.spec.ts +170 -3
  224. package/src/app/providers/voice/voice.service.ts +695 -16
  225. package/src/app/sass/_variables.scss +1 -1
  226. package/src/app/sass/animations.scss +19 -1
  227. package/src/app/utils/globals.ts +14 -0
  228. package/src/app/utils/json-sources-utils.ts +27 -0
  229. package/src/app/utils/url-utils.ts +98 -0
  230. package/src/app/utils/utils-resources.ts +1 -1
  231. package/src/assets/i18n/en.json +106 -100
  232. package/src/assets/i18n/es.json +107 -101
  233. package/src/assets/i18n/fr.json +107 -101
  234. package/src/assets/i18n/it.json +107 -99
  235. package/src/assets/sounds/keyboard.mp3 +0 -0
  236. package/src/assets/twp/index-dev.html +18 -0
  237. package/src/assets/twp/tiledesk_widget_files/widget-css-override-example.css +14 -0
  238. package/src/chat21-core/providers/chat-manager.spec.ts +72 -0
  239. package/src/chat21-core/providers/scripts/script.service.spec.ts +12 -2
  240. package/src/chat21-core/utils/constants.ts +4 -0
  241. package/src/chat21-core/utils/utils-message.ts +23 -1
  242. package/src/widget-config-template.json +3 -1
  243. package/src/widget-config.json +28 -27
  244. package/tests/widget-form-rich.spec.ts +67 -0
  245. package/tests/widget-index-dev-settings.spec.ts +52 -0
  246. package/tests/widget-twp-iframe.spec.ts +39 -0
@@ -38,7 +38,7 @@
38
38
  --chat-footer-logo-height: 30px;
39
39
  --chat-footer-close-button-height: 30px;
40
40
  --chat-footer-border-radius: 16px;
41
- --chat-footer-stream-button-height: 96px;
41
+ --chat-footer-stream-button-height: 72px;
42
42
  --chat-footer-stream-button-padding: 10px 0;
43
43
  --chat-footer-background-color: #f6f7fb;
44
44
  --chat-footer-color: #1a1a1a;
@@ -1,4 +1,22 @@
1
- @import 'variables';
1
+ $trasp-black: rgba(0, 0, 0, 0.8);
2
+
3
+ /**
4
+ * Respect the user's reduced-motion preference (WCAG 2.3.3 Animation from Interactions).
5
+ * When `prefers-reduced-motion: reduce` is active, neutralize all CSS animations and transitions
6
+ * inside the widget so users do not experience non-essential motion.
7
+ */
8
+ @media (prefers-reduced-motion: reduce) {
9
+ chat-root *,
10
+ chat-root *::before,
11
+ chat-root *::after {
12
+ animation-duration: 0.001ms !important;
13
+ animation-iteration-count: 1 !important;
14
+ animation-delay: 0ms !important;
15
+ transition-duration: 0.001ms !important;
16
+ transition-delay: 0ms !important;
17
+ scroll-behavior: auto !important;
18
+ }
19
+ }
2
20
 
3
21
  /**
4
22
  * ----------------------------------------
@@ -36,6 +36,14 @@ export class Globals {
36
36
  isMobile: boolean;
37
37
  isLogged: boolean;
38
38
  soundEnabled: boolean;
39
+ /** Volume for the keyboard typing-indicator sound during voice sessions. Range 0.0–1.0. */
40
+ keyboardSoundVolume: number;
41
+ /**
42
+ * Filename (local) or absolute URL (remote) for the keyboard typing-indicator sound.
43
+ * Local: bare filename resolved against `baseLocation + '/assets/sounds/'` (e.g. `'keyboard.mp3'`).
44
+ * Remote: full URL starting with `http://` or `https://`.
45
+ */
46
+ keyboardSoundFile: string;
39
47
  BUILD_VERSION: String;
40
48
  baseLocation: string;
41
49
  availableAgents: Array<UserAgent> = [];
@@ -117,6 +125,7 @@ export class Globals {
117
125
  WAITING_TIME_NOT_FOUND: string;
118
126
  CLOSED: string;
119
127
  LABEL_PREVIEW: string;
128
+ BUTTON_OPEN_CHAT: string;
120
129
 
121
130
  // ============ BEGIN: EXTERNAL PARAMETERS ==============//
122
131
  autoStart: boolean;
@@ -226,6 +235,7 @@ export class Globals {
226
235
  hasCalloutInWidgetConfig: boolean; // ******* new ********
227
236
 
228
237
  fontFamilySource: string; // ******* new ********
238
+ cssSource: string; // ******* new ********
229
239
 
230
240
  size: 'min' | 'max' | 'top'; // ******* new ********
231
241
 
@@ -448,6 +458,8 @@ export class Globals {
448
458
  this.hasCalloutInWidgetConfig = false;
449
459
  /** set widget size from 3 different positions: min, max, top */
450
460
  this.size = 'min';
461
+ /** remote CSS override URL (from window.tiledeskSettings.cssSource only) */
462
+ this.cssSource = '';
451
463
  /** enable to close the chat in conversation */
452
464
  this.closeChatInConversation = false;
453
465
  // ============ END: SET EXTERNAL PARAMETERS ==============//
@@ -468,6 +480,8 @@ export class Globals {
468
480
  this.BUILD_VERSION = 'v.' + environment.version;
469
481
 
470
482
  this.soundEnabled = true;
483
+ this.keyboardSoundVolume = 0.3;
484
+ this.keyboardSoundFile = 'keyboard.mp3';
471
485
 
472
486
  this.conversationsBadge = 0;
473
487
 
@@ -0,0 +1,27 @@
1
+ import { JsonSourceItem } from 'src/app/component/message/json-sources/json-sources.component';
2
+
3
+ export function extractUrlsFromJsonSources(sources: JsonSourceItem[] | null | undefined): string[] {
4
+ return (sources || [])
5
+ .map((s) => (s?.link || '').trim())
6
+ .filter(Boolean);
7
+ }
8
+
9
+ export function mergeJsonSourcesMissingFields(
10
+ base: JsonSourceItem[],
11
+ previews: JsonSourceItem[]
12
+ ): JsonSourceItem[] {
13
+ const byUrl = new Map(previews.map((p) => [p.link, p]));
14
+ return base.map((cur) => {
15
+ const p = cur?.link ? byUrl.get(cur.link) : undefined;
16
+ if (!p) return cur;
17
+ return {
18
+ ...cur,
19
+ title: cur.title || p.title,
20
+ description: cur.description || p.description,
21
+ image: cur.image || p.image,
22
+ favicon: cur.favicon || p.favicon,
23
+ favicon_hd: cur.favicon_hd || p.favicon_hd
24
+ };
25
+ });
26
+ }
27
+
@@ -0,0 +1,98 @@
1
+ export function extractUrlsFromText(text?: string, maxUrls = 20): string[] {
2
+ if (!text) return [];
3
+ const input = text.toString();
4
+ // Match candidates:
5
+ // - https?://...
6
+ // - www....
7
+ // - naked domains like google.it/path
8
+ // We later normalize + validate.
9
+ const candidateRegex =
10
+ /\b(?:https?:\/\/[^\s<>"'`)\]]+|www\.[^\s<>"'`)\]]+|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+[^\s<>"'`)\]]*)/gi;
11
+ const matches = input.match(candidateRegex) || [];
12
+
13
+ const seen = new Set<string>();
14
+ const out: string[] = [];
15
+ for (const raw of matches) {
16
+ const normalized = normalizeAndValidateUrlCandidate(raw);
17
+ if (!normalized) continue;
18
+ if (seen.has(normalized)) continue;
19
+ seen.add(normalized);
20
+ out.push(normalized);
21
+ if (out.length >= maxUrls) break;
22
+ }
23
+ return out;
24
+ }
25
+
26
+ function normalizeAndValidateUrlCandidate(candidate: string): string | null {
27
+ if (!candidate) return null;
28
+ let s = candidate.trim();
29
+
30
+ // Drop surrounding punctuation/brackets commonly attached in text
31
+ s = s.replace(/^[("'<\[]+/, '').replace(/[)"'>\]]+$/, '');
32
+ // Drop trailing punctuation
33
+ s = s.replace(/[.,;:!?]+$/g, '').trim();
34
+ if (!s) return null;
35
+
36
+ // Reject emails quickly
37
+ if (s.includes('@')) return null;
38
+
39
+ // Add scheme if missing
40
+ if (/^www\./i.test(s)) {
41
+ s = `https://${s}`;
42
+ } else if (!/^https?:\/\//i.test(s)) {
43
+ s = `https://${s}`;
44
+ }
45
+
46
+ try {
47
+ const url = new URL(s);
48
+ const hostname = url.hostname.toLowerCase();
49
+
50
+ // must look like a real domain: contain a dot and a plausible TLD
51
+ if (!hostname.includes('.')) return null;
52
+ const tld = hostname.split('.').pop() || '';
53
+ if (tld.length < 2) return null;
54
+ if (!/^[a-z0-9-]+$/.test(tld)) return null;
55
+
56
+ // normalize: remove default port and trailing slash when path is '/'
57
+ url.hash = ''; // do not include fragments in "identity"
58
+ if (url.pathname === '/') url.pathname = '';
59
+ return url.toString();
60
+ } catch {
61
+ return null;
62
+ }
63
+ }
64
+
65
+ /**
66
+ * Best-effort "registrable domain" extractor.
67
+ * Examples:
68
+ * - "docs.example.com" -> "example.com"
69
+ * - "www.example.co.uk" -> "example.co.uk"
70
+ *
71
+ * This is a heuristic (no publicsuffix list) but works well for common cases.
72
+ */
73
+ export function getTopLevelDomainFromHostname(hostname: string): string {
74
+ const host = (hostname || '').trim().toLowerCase().replace(/\.+$/, '');
75
+ const parts = host.split('.').filter(Boolean);
76
+ if (parts.length <= 2) return host;
77
+
78
+ const tld = parts[parts.length - 1];
79
+ const sld = parts[parts.length - 2];
80
+
81
+ // Heuristic for common ccTLD second-level domains (co.uk, com.au, etc.)
82
+ const commonSecondLevel = new Set(['co', 'com', 'org', 'net', 'gov', 'ac', 'edu']);
83
+ const isCcTld = tld.length === 2;
84
+ if (isCcTld && commonSecondLevel.has(sld) && parts.length >= 3) {
85
+ return parts.slice(-3).join('.');
86
+ }
87
+ return parts.slice(-2).join('.');
88
+ }
89
+
90
+ export function getTopLevelDomainFromUrl(url: string): string {
91
+ try {
92
+ const hostname = new URL(url).hostname.replace(/^www\./, '');
93
+ return getTopLevelDomainFromHostname(hostname);
94
+ } catch {
95
+ return '';
96
+ }
97
+ }
98
+
@@ -7,7 +7,7 @@ export const BRAND_BASE_INFO: { [key: string] : string} ={
7
7
  FAVICON: "https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v13-300x300.png",
8
8
  META_TITLE:"Design Studio",
9
9
  LOGO_CHAT:"https://widget.tiledesk.com/v2/assets/images/tiledesk_logo_white_small.svg",
10
- POWERED_BY:"<a tabindex='-1' target='_blank' ref='https://www.tiledesk.com/?utm_source=widget'><img src='https://support-pre.tiledesk.com/dashboard/assets/img/logos/tiledesk-solo_logo_new_gray.svg'/><span>Powered by Tiledesk</span></a>",
10
+ POWERED_BY:"<a target='_blank' rel='noopener noreferrer' href='https://www.tiledesk.com/?utm_source=widget'><img src='https://support-pre.tiledesk.com/dashboard/assets/img/logos/tiledesk-solo_logo_new_gray.svg' alt=''/><span>Powered by Tiledesk</span></a>",
11
11
  }
12
12
 
13
13
  export const LOGOS_ITEMS: { [key: string] : { label: string, icon: string }} ={
@@ -1,102 +1,108 @@
1
1
  {
2
- "LABEL_PLACEHOLDER": "Type your message..",
3
- "LABEL_START_NW_CONV": "New conversation",
4
- "LABEL_WHATSAPP": "Message us",
5
- "LABEL_SELECT_TOPIC": "Select a topic",
6
- "LABEL_COMPLETE_FORM": "Complete the form to start a conversation with the next available agent.",
7
- "LABEL_FIELD_NAME": "Name",
8
- "LABEL_ERROR_FIELD_NAME": "Required field (minimum 5 characters).",
9
- "LABEL_FIELD_EMAIL": "Email",
10
- "LABEL_ERROR_FIELD_EMAIL": "Enter a valid email address.",
11
- "LABEL_ERROR_FIELD_REQUIRED":"Required field",
12
- "LABEL_WRITING": "is writing...",
13
- "LABEL_SEND_NEW_MESSAGE": "Send a new message",
14
- "AGENT_NOT_AVAILABLE": " Offline",
15
- "AGENT_AVAILABLE": " Online",
16
- "GUEST_LABEL": "Guest",
17
- "ALL_AGENTS_OFFLINE_LABEL": "All operators are offline at the moment",
18
- "LABEL_LOADING": "Loading...",
19
- "LABEL_THINKING": "thinking",
20
- "CALLOUT_TITLE_PLACEHOLDER": "🖐 Need Help?",
21
- "CALLOUT_MSG_PLACEHOLDER": "Click here and start chatting with us!",
22
- "CUSTOMER_SATISFACTION": "Customer satisfaction",
23
- "YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE": "your opinion on our customer service",
24
- "DOWNLOAD_TRANSCRIPT": "Download transcript",
25
- "BACK": "Back",
26
- "CONTINUE": "Continue",
27
- "YOUR_RATING": "your rating",
28
- "WRITE_YOUR_OPINION": "Write your opinion ... (optional)",
29
- "SUBMIT": "Submit",
30
- "THANK_YOU_FOR_YOUR_EVALUATION": "Thank you for your evaluation",
31
- "YOUR_RATING_HAS_BEEN_RECEIVED": "your rating has been received",
32
- "ALERT_LEAVE_CHAT": "Do you want to leave the chat?",
33
- "YES": "Yes",
34
- "NO": "No",
35
- "BUTTON_CLOSE_TO_ICON": "Minimize chat",
36
- "BUTTON_EDIT_PROFILE": "Update profile",
37
- "RATE_CHAT": "Rate chat",
38
- "WELCOME_TITLE": "Hi, welcome to Tiledesk 👋",
39
- "WELCOME_MSG": "How can we help?",
40
- "WELCOME": "Welcome",
41
- "OPTIONS": "options",
42
- "SOUND_OFF": "Sound off",
43
- "SOUND_ON": "Sound on",
44
- "LOGOUT": "Logout",
45
- "CLOSE": "Close",
46
- "RESTART":"Restart",
47
- "PREV_CONVERSATIONS": "Your conversations",
48
- "YOU": "You",
49
- "SHOW_ALL_CONV": "show all",
50
- "START_A_CONVERSATION": "Start a conversation",
51
- "NO_CONVERSATION": "No conversation",
52
- "SEE_PREVIOUS": "see previous",
53
- "WAITING_TIME_FOUND": "The team typically replies in $reply_time",
54
- "WAITING_TIME_NOT_FOUND": "The team will reply as soon as possible",
55
- "CLOSED": "CLOSED",
56
- "CLOSE_CHAT": "Close chat",
57
- "MINIMIZE":"Minimize window",
58
- "MAXIMIZE":"Expand window",
59
- "CENTER":"Center",
60
- "CONFIRM_CLOSE_CHAT":"Are you sure you want to close this chat?",
61
-
62
- "INFO_SUPPORT_USER_ADDED_SUBJECT":"you",
63
- "INFO_SUPPORT_USER_ADDED_YOU_VERB":"have been added to ",
64
- "INFO_SUPPORT_USER_ADDED_COMPLEMENT":"joined",
65
- "INFO_SUPPORT_USER_ADDED_VERB":"the chat",
66
- "INFO_SUPPORT_CHAT_REOPENED":"Chat reopened",
67
- "INFO_SUPPORT_CHAT_CLOSED":"Chat closed",
68
- "INFO_SUPPORT_LEAD_UPDATED":"Lead updated",
69
- "INFO_SUPPORT_MEMBER_LEFT_GROUP":"removed from group",
70
- "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"has left the conversation",
71
- "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "A new support request has been assigned to you",
72
-
73
- "LABEL_PRECHAT_USER_FULLNAME": "Full name",
74
- "LABEL_PRECHAT_USER_EMAIL": "Email",
75
- "LABEL_PRECHAT_USER_EMAIL_ERROR": "Invalid email address",
76
- "LABEL_PRECHAT_USER_PHONE": "Phone",
77
- "LABEL_PRECHAT_USER_PHONE_ERROR": "Phone is required",
78
- "LABEL_PRECHAT_FIRST_MESSAGE": "Your message for the support team",
79
- "LABEL_PRECHAT_STATIC_TERMS_PRIVACY": "Before proceeding in the conversation please agree to our <a href='https://tiledesk.com/termsofservice/' target='_blank'>Terms</a> and <a href='https://tiledesk.com/privacy.html' target='_blank'>Privacy Policy</a>",
80
- "LABEL_PRECHAT_ACCEPT_TERMS_PRIVACY": "I agree",
81
- "PRECHAT_REQUIRED_ERROR": "This field is required",
82
-
83
- "TICKET_TAKING":"The request has been received and the assistance staff is dealing with it.\nTo add more comments, reply to this email.",
84
-
85
- "LABEL_TODAY": "today",
86
- "LABEL_TOMORROW": "yesterday",
87
- "LABEL_LAST_ACCESS": "last access",
88
- "LABEL_TO": "at",
89
- "ARRAY_DAYS": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
90
-
91
- "SENT_AN_ATTACHMENT": "sent an attachment",
92
- "SENT_AN_IMAGE":"sent an image",
93
-
94
- "LABEL_PREVIEW": "Preview",
95
- "SWITCH_TO": "Or switch to:",
96
- "CONNECTION_NETWORK_ERROR": "Our apologies. There was some trouble connecting to network",
97
- "EMOJI_NOT_ELLOWED":"Emoji not allowed",
98
- "DOMAIN_NOT_ALLOWED":"URL contains a non-allowed domain",
99
- "MAX_ATTACHMENT": "Max allowed size {{FILE_SIZE_LIMIT}}Mb",
100
- "MAX_ATTACHMENT_ERROR": "The file exceeds the maximum allowed size",
101
- "EMOJI": "Emoji"
2
+ "LABEL_PLACEHOLDER": "Type your message..",
3
+ "LABEL_START_NW_CONV": "New conversation",
4
+ "LABEL_WHATSAPP": "Message us",
5
+ "LABEL_SELECT_TOPIC": "Select a topic",
6
+ "LABEL_COMPLETE_FORM": "Complete the form to start a conversation with the next available agent.",
7
+ "LABEL_FIELD_NAME": "Name",
8
+ "LABEL_ERROR_FIELD_NAME": "Required field (minimum 5 characters).",
9
+ "LABEL_FIELD_EMAIL": "Email",
10
+ "LABEL_ERROR_FIELD_EMAIL": "Enter a valid email address.",
11
+ "LABEL_ERROR_FIELD_REQUIRED": "Required field",
12
+ "LABEL_WRITING": "is writing...",
13
+ "LABEL_SEND_NEW_MESSAGE": "Send a new message",
14
+ "AGENT_NOT_AVAILABLE": " Offline",
15
+ "AGENT_AVAILABLE": " Online",
16
+ "GUEST_LABEL": "Guest",
17
+ "ALL_AGENTS_OFFLINE_LABEL": "All operators are offline at the moment",
18
+ "LABEL_LOADING": "Loading...",
19
+ "LABEL_THINKING": "thinking",
20
+ "CALLOUT_TITLE_PLACEHOLDER": "🖐 Need Help?",
21
+ "CALLOUT_MSG_PLACEHOLDER": "Click here and start chatting with us!",
22
+ "CUSTOMER_SATISFACTION": "Customer satisfaction",
23
+ "YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE": "your opinion on our customer service",
24
+ "DOWNLOAD_TRANSCRIPT": "Download transcript",
25
+ "BACK": "Back",
26
+ "CONTINUE": "Continue",
27
+ "YOUR_RATING": "your rating",
28
+ "WRITE_YOUR_OPINION": "Write your opinion ... (optional)",
29
+ "SUBMIT": "Submit",
30
+ "THANK_YOU_FOR_YOUR_EVALUATION": "Thank you for your evaluation",
31
+ "YOUR_RATING_HAS_BEEN_RECEIVED": "your rating has been received",
32
+ "ALERT_LEAVE_CHAT": "Do you want to leave the chat?",
33
+ "YES": "Yes",
34
+ "NO": "No",
35
+ "BUTTON_CLOSE_TO_ICON": "Minimize chat",
36
+ "BUTTON_EDIT_PROFILE": "Update profile",
37
+ "RATE_CHAT": "Rate chat",
38
+ "WELCOME_TITLE": "Hi, welcome to Tiledesk 👋",
39
+ "WELCOME_MSG": "How can we help?",
40
+ "WELCOME": "Welcome",
41
+ "OPTIONS": "options",
42
+ "SOUND_OFF": "Sound off",
43
+ "SOUND_ON": "Sound on",
44
+ "LOGOUT": "Logout",
45
+ "CLOSE": "Close",
46
+ "RESTART": "Restart",
47
+ "PREV_CONVERSATIONS": "Your conversations",
48
+ "YOU": "You",
49
+ "SHOW_ALL_CONV": "show all",
50
+ "START_A_CONVERSATION": "Start a conversation",
51
+ "NO_CONVERSATION": "No conversation",
52
+ "SEE_PREVIOUS": "see previous",
53
+ "WAITING_TIME_FOUND": "The team typically replies in $reply_time",
54
+ "WAITING_TIME_NOT_FOUND": "The team will reply as soon as possible",
55
+ "CLOSED": "CLOSED",
56
+ "CLOSE_CHAT": "Close chat",
57
+ "MINIMIZE": "Minimize window",
58
+ "MAXIMIZE": "Expand window",
59
+ "CENTER": "Center",
60
+ "CONFIRM_CLOSE_CHAT": "Are you sure you want to close this chat?",
61
+ "INFO_SUPPORT_USER_ADDED_SUBJECT": "you",
62
+ "INFO_SUPPORT_USER_ADDED_YOU_VERB": "have been added to ",
63
+ "INFO_SUPPORT_USER_ADDED_COMPLEMENT": "joined",
64
+ "INFO_SUPPORT_USER_ADDED_VERB": "the chat",
65
+ "INFO_SUPPORT_CHAT_REOPENED": "Chat reopened",
66
+ "INFO_SUPPORT_CHAT_CLOSED": "Chat closed",
67
+ "INFO_SUPPORT_LEAD_UPDATED": "Lead updated",
68
+ "INFO_SUPPORT_MEMBER_LEFT_GROUP": "removed from group",
69
+ "INFO_SUPPORT_MEMBER_ABANDONED_GROUP": "has left the conversation",
70
+ "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "A new support request has been assigned to you",
71
+ "LABEL_PRECHAT_USER_FULLNAME": "Full name",
72
+ "LABEL_PRECHAT_USER_EMAIL": "Email",
73
+ "LABEL_PRECHAT_USER_EMAIL_ERROR": "Invalid email address",
74
+ "LABEL_PRECHAT_USER_PHONE": "Phone",
75
+ "LABEL_PRECHAT_USER_PHONE_ERROR": "Phone is required",
76
+ "LABEL_PRECHAT_FIRST_MESSAGE": "Your message for the support team",
77
+ "LABEL_PRECHAT_STATIC_TERMS_PRIVACY": "Before proceeding in the conversation please agree to our <a href='https://tiledesk.com/termsofservice/' target='_blank'>Terms</a> and <a href='https://tiledesk.com/privacy.html' target='_blank'>Privacy Policy</a>",
78
+ "LABEL_PRECHAT_ACCEPT_TERMS_PRIVACY": "I agree",
79
+ "PRECHAT_REQUIRED_ERROR": "This field is required",
80
+ "TICKET_TAKING": "The request has been received and the assistance staff is dealing with it.\nTo add more comments, reply to this email.",
81
+ "LABEL_TODAY": "today",
82
+ "LABEL_TOMORROW": "yesterday",
83
+ "LABEL_LAST_ACCESS": "last access",
84
+ "LABEL_TO": "at",
85
+ "ARRAY_DAYS": [
86
+ "Monday",
87
+ "Tuesday",
88
+ "Wednesday",
89
+ "Thursday",
90
+ "Friday",
91
+ "Saturday",
92
+ "Sunday"
93
+ ],
94
+ "SENT_AN_ATTACHMENT": "sent an attachment",
95
+ "SENT_AN_IMAGE": "sent an image",
96
+ "LABEL_PREVIEW": "Preview",
97
+ "SWITCH_TO": "Or switch to:",
98
+ "CONNECTION_NETWORK_ERROR": "Our apologies. There was some trouble connecting to network",
99
+ "EMOJI_NOT_ELLOWED": "Emoji not allowed",
100
+ "DOMAIN_NOT_ALLOWED": "URL contains a non-allowed domain",
101
+ "MAX_ATTACHMENT": "Max allowed size {{FILE_SIZE_LIMIT}}Mb",
102
+ "MAX_ATTACHMENT_ERROR": "The file exceeds the maximum allowed size",
103
+ "EMOJI": "Emoji",
104
+ "STREAM_AUDIO": "Use voice mode",
105
+ "VOICE_CONNECTING": "Connecting...",
106
+ "VOICE_LISTENING": "Listening...",
107
+ "VOICE_PROCESSING": "Processing..."
102
108
  }