isometrik-plugin-chat-sdk 2.0.15 → 2.0.17

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 (238) hide show
  1. package/dist/cjs/{app-globals-95486d77.js → app-globals-170f9e71.js} +3 -3
  2. package/dist/cjs/{app-globals-95486d77.js.map → app-globals-170f9e71.js.map} +1 -1
  3. package/dist/cjs/attachment-preview_22.cjs.entry.js +137 -48
  4. package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
  5. package/dist/cjs/contracts-dfc84075.js.map +1 -1
  6. package/dist/cjs/{drawer-960b3f5d.js → drawer-00a2323a.js} +2 -2
  7. package/dist/cjs/{drawer-960b3f5d.js.map → drawer-00a2323a.js.map} +1 -1
  8. package/dist/cjs/forward-memebers.cjs.entry.js +15 -9
  9. package/dist/cjs/forward-memebers.cjs.entry.js.map +1 -1
  10. package/dist/cjs/{group-members-1205fc4c.js → group-members-b3bea06e.js} +5 -5
  11. package/dist/cjs/{group-members-1205fc4c.js.map → group-members-b3bea06e.js.map} +1 -1
  12. package/dist/cjs/{groupcast-c93d4a7d.js → groupcast-3cb44a25.js} +16 -16
  13. package/dist/cjs/{groupcast-c93d4a7d.js.map → groupcast-3cb44a25.js.map} +1 -1
  14. package/dist/cjs/{groupcast-5e3d49c4.js → groupcast-4239cbfc.js} +7 -7
  15. package/dist/cjs/{groupcast-5e3d49c4.js.map → groupcast-4239cbfc.js.map} +1 -1
  16. package/dist/cjs/{index-66f98408.js → index-3411923c.js} +2 -1
  17. package/dist/cjs/index-3411923c.js.map +1 -0
  18. package/dist/cjs/index.cjs.js +7 -6
  19. package/dist/cjs/index.cjs.js.map +1 -1
  20. package/dist/cjs/isometrik-webchat.cjs.js +9 -8
  21. package/dist/cjs/isometrik-webchat.cjs.js.map +1 -1
  22. package/dist/cjs/loader.cjs.js +9 -8
  23. package/dist/cjs/loader.cjs.js.map +1 -1
  24. package/dist/cjs/local-notification-bdd04d7a.js +259 -0
  25. package/dist/cjs/local-notification-bdd04d7a.js.map +1 -0
  26. package/dist/cjs/login-page_3.cjs.entry.js +62 -28
  27. package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
  28. package/dist/cjs/media-gallery.cjs.entry.js +1 -1
  29. package/dist/cjs/member-add.cjs.entry.js +5 -6
  30. package/dist/cjs/member-add.cjs.entry.js.map +1 -1
  31. package/dist/cjs/{message-reaction-8f93a048.js → message-reaction-82a4f93c.js} +5 -5
  32. package/dist/cjs/{message-reaction-8f93a048.js.map → message-reaction-82a4f93c.js.map} +1 -1
  33. package/dist/cjs/reaction-container.cjs.entry.js +3 -4
  34. package/dist/cjs/reaction-container.cjs.entry.js.map +1 -1
  35. package/dist/cjs/{runtime-controls-959fe6ed.js → runtime-controls-99f378d4.js} +9 -4
  36. package/dist/cjs/runtime-controls-99f378d4.js.map +1 -0
  37. package/dist/cjs/{send-media-2dadbb03.js → send-media-7c865c19.js} +13 -11
  38. package/dist/cjs/send-media-7c865c19.js.map +1 -0
  39. package/dist/cjs/signup-page.cjs.entry.js +2 -2
  40. package/dist/cjs/spinner-loader.cjs.entry.js +1 -1
  41. package/dist/cjs/{index.m-ff115b26.js → toast-91093c84.js} +156 -1
  42. package/dist/cjs/{index.m-ff115b26.js.map → toast-91093c84.js.map} +1 -1
  43. package/dist/cjs/toast-notification.cjs.entry.js +3 -3
  44. package/dist/collection/collection-manifest.json +1 -1
  45. package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +2 -2
  46. package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
  47. package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +22 -8
  48. package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
  49. package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js +10 -4
  50. package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js.map +1 -1
  51. package/dist/collection/components/ChatUIComponent/shared/chat-tile/chat-tile.js +1 -1
  52. package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +64 -3
  53. package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
  54. package/dist/collection/components/ChatUIComponent/shared/new chat/new-chat.js +1 -1
  55. package/dist/collection/components/ChatUIComponent/shared/spinner-loader/spinner-loader.js +1 -1
  56. package/dist/collection/components/ChatUIComponent/shared/toast-notification/toast-notification.js +3 -3
  57. package/dist/collection/components/Login.js +1 -1
  58. package/dist/collection/components/Signup.js +2 -2
  59. package/dist/collection/components/my-component/web-chat/WebChat.js +61 -2
  60. package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
  61. package/dist/collection/components/my-component/web-chat/offline-host.js +11 -0
  62. package/dist/collection/components/my-component/web-chat/offline-host.js.map +1 -1
  63. package/dist/collection/components/my-component/web-chat/public-send.js +10 -0
  64. package/dist/collection/components/my-component/web-chat/public-send.js.map +1 -1
  65. package/dist/collection/components/theme-provider.js +1 -1
  66. package/dist/collection/lib/chat/conversation-notifications.js +26 -0
  67. package/dist/collection/lib/chat/conversation-notifications.js.map +1 -0
  68. package/dist/collection/lib/chat/index.js +3 -0
  69. package/dist/collection/lib/chat/index.js.map +1 -1
  70. package/dist/collection/lib/chat/local-notification.js +118 -0
  71. package/dist/collection/lib/chat/local-notification.js.map +1 -0
  72. package/dist/collection/lib/chat/message-notification.js +134 -0
  73. package/dist/collection/lib/chat/message-notification.js.map +1 -0
  74. package/dist/collection/lib/chat/send-media.js +3 -1
  75. package/dist/collection/lib/chat/send-media.js.map +1 -1
  76. package/dist/collection/lib/custom-ui/contracts.js.map +1 -1
  77. package/dist/collection/lib/custom-ui/index.js.map +1 -1
  78. package/dist/collection/lib/mqtt/dispatch.js +17 -1
  79. package/dist/collection/lib/mqtt/dispatch.js.map +1 -1
  80. package/dist/collection/sdk/init.js +5 -0
  81. package/dist/collection/sdk/init.js.map +1 -1
  82. package/dist/components/ChatFooter.js +21 -8
  83. package/dist/components/ChatFooter.js.map +1 -1
  84. package/dist/components/ChatSidebar.js +2 -2
  85. package/dist/components/ChatSidebar.js.map +1 -1
  86. package/dist/components/GroupCast2.js +1 -1
  87. package/dist/components/Login.js +1 -1
  88. package/dist/components/WebChat.js +39 -1
  89. package/dist/components/WebChat.js.map +1 -1
  90. package/dist/components/contact-info2.js +87 -5
  91. package/dist/components/contact-info2.js.map +1 -1
  92. package/dist/components/context-menu2.js +1 -1
  93. package/dist/components/contracts.js.map +1 -1
  94. package/dist/components/forward-memebers.js +10 -4
  95. package/dist/components/forward-memebers.js.map +1 -1
  96. package/dist/components/index.js +5 -0
  97. package/dist/components/index.js.map +1 -1
  98. package/dist/components/index2.js +1 -1
  99. package/dist/components/index2.js.map +1 -1
  100. package/dist/components/local-notification.js +254 -0
  101. package/dist/components/local-notification.js.map +1 -0
  102. package/dist/components/media-gallery.js +1 -1
  103. package/dist/components/send-media.js +3 -1
  104. package/dist/components/send-media.js.map +1 -1
  105. package/dist/components/signup-page.js +2 -2
  106. package/dist/components/spinner-loader2.js +1 -1
  107. package/dist/components/theme-provider2.js +1 -1
  108. package/dist/components/toast-notification.js +3 -3
  109. package/dist/esm/{app-globals-879c137f.js → app-globals-15a6ef50.js} +3 -3
  110. package/dist/esm/{app-globals-879c137f.js.map → app-globals-15a6ef50.js.map} +1 -1
  111. package/dist/esm/attachment-preview_22.entry.js +109 -20
  112. package/dist/esm/attachment-preview_22.entry.js.map +1 -1
  113. package/dist/esm/contracts-50f4ddae.js.map +1 -1
  114. package/dist/esm/{drawer-d54c2f10.js → drawer-7de04622.js} +2 -2
  115. package/dist/esm/{drawer-d54c2f10.js.map → drawer-7de04622.js.map} +1 -1
  116. package/dist/esm/forward-memebers.entry.js +13 -7
  117. package/dist/esm/forward-memebers.entry.js.map +1 -1
  118. package/dist/esm/{group-members-d603f29f.js → group-members-36cf9395.js} +2 -2
  119. package/dist/esm/{group-members-d603f29f.js.map → group-members-36cf9395.js.map} +1 -1
  120. package/dist/esm/{groupcast-9c7d2a32.js → groupcast-cc10c6a4.js} +2 -2
  121. package/dist/esm/{groupcast-9c7d2a32.js.map → groupcast-cc10c6a4.js.map} +1 -1
  122. package/dist/esm/{groupcast-58a59d64.js → groupcast-ea2466c8.js} +3 -3
  123. package/dist/esm/{groupcast-58a59d64.js.map → groupcast-ea2466c8.js.map} +1 -1
  124. package/dist/esm/{index-4c865e34.js → index-142896ce.js} +2 -2
  125. package/dist/esm/index-142896ce.js.map +1 -0
  126. package/dist/esm/index.js +8 -7
  127. package/dist/esm/index.js.map +1 -1
  128. package/dist/esm/isometrik-webchat.js +9 -8
  129. package/dist/esm/isometrik-webchat.js.map +1 -1
  130. package/dist/esm/loader.js +9 -8
  131. package/dist/esm/loader.js.map +1 -1
  132. package/dist/esm/local-notification-4c1e166d.js +254 -0
  133. package/dist/esm/local-notification-4c1e166d.js.map +1 -0
  134. package/dist/esm/login-page_3.entry.js +45 -11
  135. package/dist/esm/login-page_3.entry.js.map +1 -1
  136. package/dist/esm/media-gallery.entry.js +1 -1
  137. package/dist/esm/member-add.entry.js +5 -6
  138. package/dist/esm/member-add.entry.js.map +1 -1
  139. package/dist/esm/{message-reaction-0a2bb115.js → message-reaction-0d2ef75f.js} +2 -2
  140. package/dist/esm/{message-reaction-0a2bb115.js.map → message-reaction-0d2ef75f.js.map} +1 -1
  141. package/dist/esm/reaction-container.entry.js +3 -4
  142. package/dist/esm/reaction-container.entry.js.map +1 -1
  143. package/dist/esm/{runtime-controls-6b7c852a.js → runtime-controls-8a22625e.js} +9 -4
  144. package/dist/esm/runtime-controls-8a22625e.js.map +1 -0
  145. package/dist/esm/{send-media-ac360d8e.js → send-media-5527ee9f.js} +5 -3
  146. package/dist/esm/send-media-5527ee9f.js.map +1 -0
  147. package/dist/esm/signup-page.entry.js +2 -2
  148. package/dist/esm/spinner-loader.entry.js +1 -1
  149. package/dist/esm/{index.m-8c70037f.js → toast-a1531088.js} +156 -2
  150. package/dist/esm/{index.m-8c70037f.js.map → toast-a1531088.js.map} +1 -1
  151. package/dist/esm/toast-notification.entry.js +3 -3
  152. package/dist/isometrik-webchat/index.esm.js +1 -1
  153. package/dist/isometrik-webchat/index.esm.js.map +1 -1
  154. package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
  155. package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -1
  156. package/dist/isometrik-webchat/{p-586f6978.entry.js → p-08ba6153.entry.js} +2 -2
  157. package/dist/isometrik-webchat/p-1db79cfb.js +2 -0
  158. package/dist/isometrik-webchat/p-343f50b4.js +7 -0
  159. package/dist/isometrik-webchat/p-343f50b4.js.map +1 -0
  160. package/dist/isometrik-webchat/{p-5d98a8a0.js → p-4671fe73.js} +2 -2
  161. package/dist/isometrik-webchat/{p-ca47d693.entry.js → p-52a575c0.entry.js} +2 -2
  162. package/dist/isometrik-webchat/{p-b1330793.js → p-54267fe0.js} +2 -2
  163. package/dist/isometrik-webchat/p-54267fe0.js.map +1 -0
  164. package/dist/isometrik-webchat/p-5b965e04.js +2 -0
  165. package/dist/isometrik-webchat/p-5b965e04.js.map +1 -0
  166. package/dist/isometrik-webchat/p-5d1877d1.entry.js +2 -0
  167. package/dist/isometrik-webchat/{p-ba6de4e2.entry.js.map → p-5d1877d1.entry.js.map} +1 -1
  168. package/dist/isometrik-webchat/p-643457b8.js +2 -0
  169. package/dist/isometrik-webchat/p-643457b8.js.map +1 -0
  170. package/dist/isometrik-webchat/p-6fc95e0e.js +2 -0
  171. package/dist/isometrik-webchat/p-6fc95e0e.js.map +1 -0
  172. package/dist/isometrik-webchat/{p-d6fd2dd7.entry.js → p-925da2c0.entry.js} +2 -2
  173. package/dist/isometrik-webchat/{p-1dc52239.js → p-925decda.js} +2 -2
  174. package/dist/isometrik-webchat/p-adc45831.js.map +1 -1
  175. package/dist/isometrik-webchat/p-bf71ce5e.entry.js +2 -0
  176. package/dist/isometrik-webchat/p-bf71ce5e.entry.js.map +1 -0
  177. package/dist/isometrik-webchat/{p-1953573d.js → p-c08055fe.js} +2 -2
  178. package/dist/isometrik-webchat/p-c49de274.entry.js +2 -0
  179. package/dist/isometrik-webchat/{p-6024bf2a.entry.js.map → p-c49de274.entry.js.map} +1 -1
  180. package/dist/isometrik-webchat/{p-04fdbd0a.js → p-c591fa45.js} +2 -2
  181. package/dist/isometrik-webchat/{p-9db196a4.entry.js → p-cbb1179b.entry.js} +2 -2
  182. package/dist/isometrik-webchat/{p-46e0048e.js → p-dab06d54.js} +2 -2
  183. package/dist/isometrik-webchat/p-e5ffe038.entry.js +2 -0
  184. package/dist/isometrik-webchat/p-e5ffe038.entry.js.map +1 -0
  185. package/dist/isometrik-webchat/p-ffbbe278.entry.js +2 -0
  186. package/dist/isometrik-webchat/p-ffbbe278.entry.js.map +1 -0
  187. package/dist/types/components/ChatUIComponent/shared/contact-info/contact-info.d.ts +5 -0
  188. package/dist/types/components/my-component/web-chat/WebChat.d.ts +21 -0
  189. package/dist/types/components.d.ts +36 -0
  190. package/dist/types/lib/chat/conversation-notifications.d.ts +12 -0
  191. package/dist/types/lib/chat/index.d.ts +3 -0
  192. package/dist/types/lib/chat/local-notification.d.ts +39 -0
  193. package/dist/types/lib/chat/message-notification.d.ts +37 -0
  194. package/dist/types/lib/chat/send-media.d.ts +3 -0
  195. package/dist/types/lib/custom-ui/contracts.d.ts +10 -0
  196. package/dist/types/lib/custom-ui/index.d.ts +6 -1
  197. package/dist/types/sdk/init.d.ts +21 -0
  198. package/docs/CUSTOMIZATION.md +30 -0
  199. package/docs/INTEGRATION.md +20 -4
  200. package/package.json +1 -1
  201. package/dist/cjs/index-66f98408.js.map +0 -1
  202. package/dist/cjs/runtime-controls-959fe6ed.js.map +0 -1
  203. package/dist/cjs/send-media-2dadbb03.js.map +0 -1
  204. package/dist/cjs/toast-75ef0607.js +0 -159
  205. package/dist/cjs/toast-75ef0607.js.map +0 -1
  206. package/dist/esm/index-4c865e34.js.map +0 -1
  207. package/dist/esm/runtime-controls-6b7c852a.js.map +0 -1
  208. package/dist/esm/send-media-ac360d8e.js.map +0 -1
  209. package/dist/esm/toast-45ac7913.js +0 -157
  210. package/dist/esm/toast-45ac7913.js.map +0 -1
  211. package/dist/isometrik-webchat/p-0c06a021.js +0 -2
  212. package/dist/isometrik-webchat/p-0c06a021.js.map +0 -1
  213. package/dist/isometrik-webchat/p-217b9dc2.js +0 -2
  214. package/dist/isometrik-webchat/p-217b9dc2.js.map +0 -1
  215. package/dist/isometrik-webchat/p-2c87c3fd.entry.js +0 -2
  216. package/dist/isometrik-webchat/p-2c87c3fd.entry.js.map +0 -1
  217. package/dist/isometrik-webchat/p-30855ba7.js +0 -2
  218. package/dist/isometrik-webchat/p-30855ba7.js.map +0 -1
  219. package/dist/isometrik-webchat/p-57d958b8.entry.js +0 -2
  220. package/dist/isometrik-webchat/p-57d958b8.entry.js.map +0 -1
  221. package/dist/isometrik-webchat/p-6024bf2a.entry.js +0 -2
  222. package/dist/isometrik-webchat/p-79d1a171.js +0 -2
  223. package/dist/isometrik-webchat/p-7af9a7f3.entry.js +0 -2
  224. package/dist/isometrik-webchat/p-7af9a7f3.entry.js.map +0 -1
  225. package/dist/isometrik-webchat/p-8f17345f.js +0 -7
  226. package/dist/isometrik-webchat/p-8f17345f.js.map +0 -1
  227. package/dist/isometrik-webchat/p-b1330793.js.map +0 -1
  228. package/dist/isometrik-webchat/p-ba6de4e2.entry.js +0 -2
  229. /package/dist/isometrik-webchat/{p-586f6978.entry.js.map → p-08ba6153.entry.js.map} +0 -0
  230. /package/dist/isometrik-webchat/{p-79d1a171.js.map → p-1db79cfb.js.map} +0 -0
  231. /package/dist/isometrik-webchat/{p-5d98a8a0.js.map → p-4671fe73.js.map} +0 -0
  232. /package/dist/isometrik-webchat/{p-ca47d693.entry.js.map → p-52a575c0.entry.js.map} +0 -0
  233. /package/dist/isometrik-webchat/{p-d6fd2dd7.entry.js.map → p-925da2c0.entry.js.map} +0 -0
  234. /package/dist/isometrik-webchat/{p-1dc52239.js.map → p-925decda.js.map} +0 -0
  235. /package/dist/isometrik-webchat/{p-1953573d.js.map → p-c08055fe.js.map} +0 -0
  236. /package/dist/isometrik-webchat/{p-04fdbd0a.js.map → p-c591fa45.js.map} +0 -0
  237. /package/dist/isometrik-webchat/{p-9db196a4.entry.js.map → p-cbb1179b.entry.js.map} +0 -0
  238. /package/dist/isometrik-webchat/{p-46e0048e.js.map → p-dab06d54.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{r as n,h as e}from"./p-17a96a2a.js";import{M as i}from"./p-343f50b4.js";import{d as r}from"./p-dab06d54.js";import{w as t}from"./p-5b965e04.js";import{C as a}from"./p-8fea0c86.js";import{S as o,a as s}from"./p-a5707f12.js";import"./p-54267fe0.js";const d=class{constructor(e){n(this,e);this.close=()=>{if(typeof this.onClose==="function")this.onClose();else r.closeDialog("forward-memebers")};this.nameOf=n=>{var e;return((e=n===null||n===void 0?void 0:n.opponentDetails)===null||e===void 0?void 0:e.userName)||(n===null||n===void 0?void 0:n.userName)||(n===null||n===void 0?void 0:n.conversationTitle)||"Unknown"};this.idOf=n=>{var e;return((e=n===null||n===void 0?void 0:n.opponentDetails)===null||e===void 0?void 0:e.userId)||(n===null||n===void 0?void 0:n.userId)||(n===null||n===void 0?void 0:n.conversationId)||this.nameOf(n)};this.imageOf=n=>{var e;return((e=n===null||n===void 0?void 0:n.opponentDetails)===null||e===void 0?void 0:e.userProfileImageUrl)||(n===null||n===void 0?void 0:n.userProfileImageUrl)||(n===null||n===void 0?void 0:n.conversationImageUrl)};this.subOf=n=>{var e;return((e=n===null||n===void 0?void 0:n.lastMessageDetails)===null||e===void 0?void 0:e.body)||(n===null||n===void 0?void 0:n.messagingUnavailableReason)||((n===null||n===void 0?void 0:n.isGroup)?"Group":(n===null||n===void 0?void 0:n.userIdentifier)||"")};this.items=()=>{var n;return this.searchText.trim()?this.nonBlockedContacts||[]:((n=this.dialogData)===null||n===void 0?void 0:n.conversationList)||this.nonBlockedContacts||[]};this.isSelected=n=>this.selected.some((e=>this.idOf(e)===this.idOf(n)));this.toggle=n=>{const e=this.idOf(n);this.selected=this.isSelected(n)?this.selected.filter((n=>this.idOf(n)!==e)):[...this.selected,n]};this.clearSelected=()=>{this.selected=[]};this.onSearch=n=>{const e=n.target.value;this.searchText=e;clearTimeout(this.debounceTimer);this.debounceTimer=setTimeout((()=>this.getForwardMessageMemberList(e||null,0)),400)};this.onScroll=n=>{const e=n.target;if(e.scrollHeight-e.scrollTop<=e.clientHeight+10&&this.hasMore&&!this.paginationLoading){this.getForwardMessageMemberList(this.searchText||null,(this.skip||0)+20)}};this.getForwardMessageMemberList=async(n,e)=>{var r,t;if(e===0){this.isLoading=true;this.nonBlockedContacts=[]}if(e>=20){this.paginationLoading=true}this.hasMore=true;try{if(n!==undefined&&e===undefined){this.nonBlockedContacts=[];this.skip=0}const a={sort:1,limit:20,skip:e||this.skip,context:"new_chat"};if(n===null||n===void 0?void 0:n.trim()){a.searchTag=n}const o=await i.getInstance().user.getUserNonblock(a);if(!(o===null||o===void 0?void 0:o.users)||o.users.length===0){this.isNoContactsFound=(n===null||n===void 0?void 0:n.trim())?true:false}else{this.isNoContactsFound=false;const n=(r=o===null||o===void 0?void 0:o.users)===null||r===void 0?void 0:r.filter((n=>!this.nonBlockedContacts.some((e=>e.userId===n.userId))));this.nonBlockedContacts=[...this.nonBlockedContacts,...n];this.skip+=o.users.length}if(((t=o===null||o===void 0?void 0:o.users)===null||t===void 0?void 0:t.length)<a.limit){this.hasMore=false}}catch(e){if((e===null||e===void 0?void 0:e.status)===404||(e===null||e===void 0?void 0:e.statusCode)===404){this.hasMore=false}if(((e===null||e===void 0?void 0:e.status)===404||(e===null||e===void 0?void 0:e.statusCode)===404)&&n!=null){this.nonBlockedContacts=[]}}finally{this.isLoading=false;this.paginationLoading=false}};this.postMessageForward=async(n,e,a,o,s)=>{var d,l,c;try{const r=t({messageType:1,showInConversation:true,encrypted:false,body:n,attachments:o,deviceId:this.dialogData.deviceId,customType:s},{senderName:((l=(d=this.dialogData)===null||d===void 0?void 0:d.userMetaData)===null||l===void 0?void 0:l.userName)||((c=this.dialogData)===null||c===void 0?void 0:c.userName)||""});if((e===null||e===void 0?void 0:e.length)>0){r.userIds=e}if((a===null||a===void 0?void 0:a.length)>0){r.conversationIds=a}await i.getInstance().message.postMessagesForward(r)}catch(n){console.error("Error forwarding the message",n)}finally{r.closeDialog("forward-memebers")}};this.nonBlockedContacts=[];this.skip=0;this.isNoContactsFound=false;this.hasMore=false;this.isLoading=false;this.paginationLoading=false;this.searchText="";this.selected=[];this.dialogData={};this.onClose=undefined}async componentDidLoad(){await this.getForwardMessageMemberList(null,0)}async sendMessageHandler(){var n,e,i,r,t,a,o,s;const d=[];const l=[];this.selected.forEach((n=>{var e;const i=(n===null||n===void 0?void 0:n.userId)||((e=n===null||n===void 0?void 0:n.opponentDetails)===null||e===void 0?void 0:e.userId);const r=(n===null||n===void 0?void 0:n.conversationId)||(n===null||n===void 0?void 0:n.contactConversationId);if(r)l.push(r);else if(i)d.push(i)}));if((n=this.dialogData)===null||n===void 0?void 0:n.message){const n=typeof((i=(e=this.dialogData)===null||e===void 0?void 0:e.message)===null||i===void 0?void 0:i.body)==="string"?(r=this.dialogData.message)===null||r===void 0?void 0:r.body:(a=(t=this.dialogData.message)===null||t===void 0?void 0:t.body)===null||a===void 0?void 0:a.messageBody;if(d.length>0||l.length>0){await this.postMessageForward(n,d.length>0?d:null,l.length>0?l:null,(o=this.dialogData.message)===null||o===void 0?void 0:o.attachments,(s=this.dialogData.message)===null||s===void 0?void 0:s.customType)}}}render(){const n=this.items();const i=this.selected.length;return e("div",{key:"f08ace213ef9376aac569c7113e82f86b6062c15",class:"panel"},e("div",{key:"2e6bf0d8f52ccafe342f84589c9cb37c6ba835ee",class:"header"},e("button",{key:"c7a9ac540c95782f71a9498eb79ddcade7bfbaeb",class:"close-btn",type:"button","aria-label":"Close",onClick:this.close},e("img",{key:"641fac4a50a4043f2577aa88b71dabf934da9d82",class:"theme-icon",src:a,alt:""})),e("h2",{key:"c1d045b69d421dfaa6aa0e88bf38375e27ff74f8",class:"title"},"Forward message to")),e("div",{key:"b5c1c046cd45003b1b60ad742ed4464dad69a081",class:"search-wrap"},e("div",{key:"36077407268555ae3d17700a4bd3e5ea54619d50",class:"search-bar"},e("img",{key:"a346c943e2367c5698d3dbb333feb0a9857b8f19",class:"theme-icon search-icon",src:s,alt:""}),e("input",{key:"db48b2b11376bfe0743dc7f56e3f7bf6ae9cd9dd",type:"text",placeholder:"Search name",value:this.searchText,onInput:this.onSearch}))),this.isLoading?e("div",{class:"empty"},e("spinner-loader",{height:"24px",width:"24px"})):n.length===0?e("div",{class:"empty"},"No results"):e("div",{class:"list",onScroll:this.onScroll},!this.searchText.trim()?e("div",{class:"section-label"},"Recent chats"):null,n.map((n=>{const i=this.isSelected(n);return e("div",{class:`row ${i?"selected":""}`,onClick:()=>this.toggle(n)},e("div",{class:"row-left"},e("profile-avatar",{src:this.imageOf(n)||"",name:this.nameOf(n),size:"2.5rem"}),e("div",{class:"row-meta"},e("p",{class:"row-name"},this.nameOf(n)),this.subOf(n)?e("p",{class:"row-sub"},this.subOf(n)):null)),e("div",{class:"check"},i?e("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},e("path",{d:"M5 13l4 4L19 7",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"})):null))})),this.paginationLoading?e("div",{class:"empty"},e("spinner-loader",{height:"20px",width:"20px"})):null),e("div",{key:"f8def1571ba31208e9d7f3b482c49040cd87c8f3",class:`footer ${i?"":"hidden"}`},e("div",{key:"b2eb0e04f6e85df980a9c21e78cd71323784ab3f",class:"chip"},e("span",{key:"8481ce20a0e0af10e30e9097504a75e63e2b0895",class:"chip-dot"}),e("span",{key:"20db7ab1e718589e16a7e302d8822255e4b1bb9e"},i," selected"),e("button",{key:"7fa20808ad529dadd22320cccc3ff7b2c6656eb7",class:"chip-clear",type:"button","aria-label":"Clear selection",onClick:this.clearSelected},e("img",{key:"6f5dd3fd87c11e39c3ba29ce2ab7967346d15b04",class:"theme-icon",src:a,alt:""}))),e("button",{key:"3954a99040d4175ec0d785180118e4d8550db206",class:"send-btn",type:"button","aria-label":"Send",onClick:()=>this.sendMessageHandler()},e("img",{key:"2b10860560318ba48baa6435155012eb47b7aa03",src:o,alt:""}))))}};d.style=":host {\n display: block;\n width: 100%;\n text-align: left;\n font-family: var(--font-primary);\n color: var(--text-primary);\n }\n .panel {\n display: flex;\n flex-direction: column;\n max-height: 85vh;\n overflow: hidden;\n background: var(--bg-primary);\n border-radius: var(--rounded-12);\n border: 1px solid var(--border-subtle);\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n }\n .header {\n display: flex;\n align-items: center;\n gap: var(--gap-12);\n padding: var(--space-16) 1.25rem var(--space-12);\n border-bottom: 1px solid var(--border-subtle);\n }\n .close-btn {\n width: 2.25rem;\n height: 2.25rem;\n border: none;\n border-radius: var(--rounded-full);\n background: transparent;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n color: var(--icon);\n }\n .close-btn:hover { background: var(--hover-overlay); }\n .close-btn img {\n width: var(--icon-sm);\n height: var(--icon-sm);\n display: block;\n }\n .title {\n margin: 0;\n font-size: var(--text-16);\n font-weight: var(--fw-600);\n color: var(--text-primary);\n }\n .search-wrap { padding: var(--space-16) var(--space-16) var(--space-8); }\n .search-bar {\n position: relative;\n display: flex;\n align-items: center;\n }\n .search-icon {\n position: absolute;\n left: 0.875rem;\n width: 1.125rem;\n height: 1.125rem;\n opacity: 0.55;\n pointer-events: none;\n }\n .search-bar input {\n width: 100%;\n box-sizing: border-box;\n border: 1px solid transparent;\n outline: none;\n border-radius: var(--rounded-12);\n background: var(--bg-input);\n color: var(--text-primary);\n font-size: var(--text-14);\n font-family: var(--font-primary);\n padding: var(--gap-8) var(--space-16) var(--gap-8) 2.5rem;\n }\n .search-bar input::placeholder { color: var(--text-tertiary); }\n .search-bar input:focus {\n background: var(--bg-primary);\n border-color: var(--focus-ring);\n box-shadow: 0 0 0 2px var(--focus-ring);\n }\n .list {\n flex: 1;\n min-height: 0;\n max-height: 50vh;\n overflow-y: auto;\n }\n .section-label {\n padding: var(--space-8) 1.25rem;\n font-size: var(--text-10);\n font-weight: var(--fw-600);\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--text-tertiary);\n background: color-mix(in srgb, var(--bg-input) 60%, transparent);\n }\n .row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--gap-12);\n padding: var(--space-12) 1.25rem;\n cursor: pointer;\n border-bottom: 1px solid var(--border-subtle);\n }\n .row:hover { background: var(--hover-overlay); }\n .row.selected { background: var(--brand-muted); }\n .row-left {\n display: flex;\n align-items: center;\n gap: 0.875rem;\n min-width: 0;\n }\n .row-meta { min-width: 0; }\n .row-name {\n margin: 0;\n font-size: var(--text-14);\n font-weight: var(--fw-600);\n color: var(--text-primary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .row-sub {\n margin: 0.125rem 0 0;\n font-size: var(--text-12);\n color: var(--text-secondary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .check {\n width: 1.25rem;\n height: 1.25rem;\n flex-shrink: 0;\n border-radius: var(--rounded-6);\n border: 2px solid var(--text-tertiary);\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .row.selected .check {\n border-color: var(--brand);\n background: var(--brand);\n color: var(--text-on-brand);\n }\n .check svg { width: 0.75rem; height: 0.75rem; display: block; }\n .empty {\n padding: var(--space-16);\n text-align: center;\n color: var(--text-secondary);\n font-size: var(--text-14);\n }\n .footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--gap-12);\n padding: 0.875rem 1.25rem;\n background: var(--bg-input);\n border-top: 1px solid var(--border-subtle);\n }\n .footer.hidden { display: none; }\n .chip {\n display: inline-flex;\n align-items: center;\n gap: var(--gap-6);\n padding: var(--gap-4) 0.625rem;\n border-radius: var(--rounded-full);\n background: var(--bg-primary);\n border: 1px solid var(--border);\n font-size: var(--text-12);\n font-weight: var(--fw-600);\n color: var(--text-primary);\n }\n .chip-dot {\n width: 0.5rem;\n height: 0.5rem;\n border-radius: var(--rounded-full);\n background: var(--brand);\n }\n .chip-clear {\n border: none;\n background: transparent;\n cursor: pointer;\n padding: 0;\n display: flex;\n line-height: 0;\n }\n .chip-clear img { width: 0.875rem; height: 0.875rem; display: block; }\n .send-btn {\n width: 2.75rem;\n height: 2.75rem;\n border: none;\n border-radius: var(--rounded-full);\n background: var(--brand);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n }\n .send-btn:active { transform: scale(0.95); }\n .send-btn img {\n width: var(--icon-sm);\n height: var(--icon-sm);\n display: block;\n filter: brightness(0) invert(1);\n }\n .theme-icon { filter: var(--svg-icon-filter); }";export{d as forward_memebers};
2
+ //# sourceMappingURL=p-ffbbe278.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MemberAdd","this","close","onClose","drawerDialogService","closeDialog","nameOf","item","_a","opponentDetails","userName","conversationTitle","idOf","userId","conversationId","imageOf","userProfileImageUrl","conversationImageUrl","subOf","lastMessageDetails","body","messagingUnavailableReason","isGroup","userIdentifier","items","searchText","trim","nonBlockedContacts","dialogData","conversationList","isSelected","selected","some","s","toggle","id","filter","clearSelected","onSearch","e","value","target","clearTimeout","debounceTimer","setTimeout","getForwardMessageMemberList","onScroll","el","scrollHeight","scrollTop","clientHeight","hasMore","paginationLoading","skip","async","searchTag","isLoading","undefined","paramsForNonBlockedContacts","sort","limit","context","res","ChatSDK","getInstance","user","getUserNonblock","users","length","isNoContactsFound","uniqueContacts","newContact","existingContact","_b","error","status","statusCode","postMessageForward","messageBody","userIds","conversationIds","attachments","customType","requestBody","withHostMessagePushFields","messageType","showInConversation","encrypted","deviceId","senderName","userMetaData","_c","message","postMessagesForward","console","componentDidLoad","sendMessageHandler","allUserIds","allConversationIds","forEach","contact","contactConversationId","push","parsedMessageBody","_d","_f","_e","_g","_h","render","count","h","key","class","type","onClick","src","CancelIcon","alt","Search","placeholder","onInput","height","width","map","name","size","viewBox","fill","d","stroke","Send"],"sources":["src/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.tsx"],"sourcesContent":["import { Component, h, State, Prop } from '@stencil/core';\nimport ChatSDK from 'test-iso-chat-sdk';\nimport { drawerDialogService } from '../../../../lib/drawer';\nimport { withHostMessagePushFields } from '../../../../lib/chat/local-notification';\nimport CancelIcon from '../../../../assets/svg/cancel.svg';\nimport { Search, Send } from '../../../../constants/chat-assets';\nimport '../spinner-loader/spinner-loader';\nimport '../profile-avatar/profile-avatar';\n\n@Component({\n tag: 'forward-memebers',\n shadow: true,\n styles: `\n :host {\n display: block;\n width: 100%;\n text-align: left;\n font-family: var(--font-primary);\n color: var(--text-primary);\n }\n .panel {\n display: flex;\n flex-direction: column;\n max-height: 85vh;\n overflow: hidden;\n background: var(--bg-primary);\n border-radius: var(--rounded-12);\n border: 1px solid var(--border-subtle);\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n }\n .header {\n display: flex;\n align-items: center;\n gap: var(--gap-12);\n padding: var(--space-16) 1.25rem var(--space-12);\n border-bottom: 1px solid var(--border-subtle);\n }\n .close-btn {\n width: 2.25rem;\n height: 2.25rem;\n border: none;\n border-radius: var(--rounded-full);\n background: transparent;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n color: var(--icon);\n }\n .close-btn:hover { background: var(--hover-overlay); }\n .close-btn img {\n width: var(--icon-sm);\n height: var(--icon-sm);\n display: block;\n }\n .title {\n margin: 0;\n font-size: var(--text-16);\n font-weight: var(--fw-600);\n color: var(--text-primary);\n }\n .search-wrap { padding: var(--space-16) var(--space-16) var(--space-8); }\n .search-bar {\n position: relative;\n display: flex;\n align-items: center;\n }\n .search-icon {\n position: absolute;\n left: 0.875rem;\n width: 1.125rem;\n height: 1.125rem;\n opacity: 0.55;\n pointer-events: none;\n }\n .search-bar input {\n width: 100%;\n box-sizing: border-box;\n border: 1px solid transparent;\n outline: none;\n border-radius: var(--rounded-12);\n background: var(--bg-input);\n color: var(--text-primary);\n font-size: var(--text-14);\n font-family: var(--font-primary);\n padding: var(--gap-8) var(--space-16) var(--gap-8) 2.5rem;\n }\n .search-bar input::placeholder { color: var(--text-tertiary); }\n .search-bar input:focus {\n background: var(--bg-primary);\n border-color: var(--focus-ring);\n box-shadow: 0 0 0 2px var(--focus-ring);\n }\n .list {\n flex: 1;\n min-height: 0;\n max-height: 50vh;\n overflow-y: auto;\n }\n .section-label {\n padding: var(--space-8) 1.25rem;\n font-size: var(--text-10);\n font-weight: var(--fw-600);\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--text-tertiary);\n background: color-mix(in srgb, var(--bg-input) 60%, transparent);\n }\n .row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--gap-12);\n padding: var(--space-12) 1.25rem;\n cursor: pointer;\n border-bottom: 1px solid var(--border-subtle);\n }\n .row:hover { background: var(--hover-overlay); }\n .row.selected { background: var(--brand-muted); }\n .row-left {\n display: flex;\n align-items: center;\n gap: 0.875rem;\n min-width: 0;\n }\n .row-meta { min-width: 0; }\n .row-name {\n margin: 0;\n font-size: var(--text-14);\n font-weight: var(--fw-600);\n color: var(--text-primary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .row-sub {\n margin: 0.125rem 0 0;\n font-size: var(--text-12);\n color: var(--text-secondary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .check {\n width: 1.25rem;\n height: 1.25rem;\n flex-shrink: 0;\n border-radius: var(--rounded-6);\n border: 2px solid var(--text-tertiary);\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .row.selected .check {\n border-color: var(--brand);\n background: var(--brand);\n color: var(--text-on-brand);\n }\n .check svg { width: 0.75rem; height: 0.75rem; display: block; }\n .empty {\n padding: var(--space-16);\n text-align: center;\n color: var(--text-secondary);\n font-size: var(--text-14);\n }\n .footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--gap-12);\n padding: 0.875rem 1.25rem;\n background: var(--bg-input);\n border-top: 1px solid var(--border-subtle);\n }\n .footer.hidden { display: none; }\n .chip {\n display: inline-flex;\n align-items: center;\n gap: var(--gap-6);\n padding: var(--gap-4) 0.625rem;\n border-radius: var(--rounded-full);\n background: var(--bg-primary);\n border: 1px solid var(--border);\n font-size: var(--text-12);\n font-weight: var(--fw-600);\n color: var(--text-primary);\n }\n .chip-dot {\n width: 0.5rem;\n height: 0.5rem;\n border-radius: var(--rounded-full);\n background: var(--brand);\n }\n .chip-clear {\n border: none;\n background: transparent;\n cursor: pointer;\n padding: 0;\n display: flex;\n line-height: 0;\n }\n .chip-clear img { width: 0.875rem; height: 0.875rem; display: block; }\n .send-btn {\n width: 2.75rem;\n height: 2.75rem;\n border: none;\n border-radius: var(--rounded-full);\n background: var(--brand);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n }\n .send-btn:active { transform: scale(0.95); }\n .send-btn img {\n width: var(--icon-sm);\n height: var(--icon-sm);\n display: block;\n filter: brightness(0) invert(1);\n }\n .theme-icon { filter: var(--svg-icon-filter); }\n `,\n})\nexport class MemberAdd {\n @State() nonBlockedContacts: any[] = [];\n @State() skip: number = 0;\n @State() isNoContactsFound: boolean = false;\n @State() hasMore: any = false;\n @State() isLoading: boolean = false;\n @State() paginationLoading: boolean = false;\n @State() searchText: string = '';\n @State() selected: any[] = [];\n @Prop() dialogData: any = {};\n @Prop() onClose: () => void;\n private debounceTimer: any;\n\n async componentDidLoad() {\n await this.getForwardMessageMemberList(null, 0);\n }\n\n private close = () => {\n if (typeof this.onClose === 'function') this.onClose();\n else drawerDialogService.closeDialog('forward-memebers');\n };\n\n private nameOf = (item: any) =>\n item?.opponentDetails?.userName || item?.userName || item?.conversationTitle || 'Unknown';\n\n private idOf = (item: any) =>\n item?.opponentDetails?.userId || item?.userId || item?.conversationId || this.nameOf(item);\n\n private imageOf = (item: any) =>\n item?.opponentDetails?.userProfileImageUrl || item?.userProfileImageUrl || item?.conversationImageUrl;\n\n private subOf = (item: any) =>\n item?.lastMessageDetails?.body ||\n item?.messagingUnavailableReason ||\n (item?.isGroup ? 'Group' : item?.userIdentifier || '');\n\n private items = () =>\n this.searchText.trim() ? this.nonBlockedContacts || [] : this.dialogData?.conversationList || this.nonBlockedContacts || [];\n\n private isSelected = (item: any) => this.selected.some(s => this.idOf(s) === this.idOf(item));\n\n private toggle = (item: any) => {\n const id = this.idOf(item);\n this.selected = this.isSelected(item)\n ? this.selected.filter(s => this.idOf(s) !== id)\n : [...this.selected, item];\n };\n\n private clearSelected = () => {\n this.selected = [];\n };\n\n private onSearch = (e: Event) => {\n const value = (e.target as HTMLInputElement).value;\n this.searchText = value;\n clearTimeout(this.debounceTimer);\n this.debounceTimer = setTimeout(() => this.getForwardMessageMemberList(value || null, 0), 400);\n };\n\n private onScroll = (e: Event) => {\n const el = e.target as HTMLElement;\n if (el.scrollHeight - el.scrollTop <= el.clientHeight + 10 && this.hasMore && !this.paginationLoading) {\n this.getForwardMessageMemberList(this.searchText || null, (this.skip || 0) + 20);\n }\n };\n\n getForwardMessageMemberList = async (searchTag?: string, skip?: number) => {\n if (skip === 0) {\n this.isLoading = true;\n this.nonBlockedContacts = [];\n }\n\n if (skip >= 20) {\n this.paginationLoading = true;\n }\n this.hasMore = true;\n try {\n if (searchTag !== undefined && skip === undefined) {\n this.nonBlockedContacts = [];\n this.skip = 0;\n }\n\n const paramsForNonBlockedContacts = {\n sort: 1,\n limit: 20,\n skip: skip || this.skip,\n context: 'new_chat',\n };\n\n if (searchTag?.trim()) {\n // @ts-ignore\n paramsForNonBlockedContacts.searchTag = searchTag;\n }\n\n const res = await ChatSDK.getInstance().user.getUserNonblock(paramsForNonBlockedContacts);\n\n if (!res?.users || res.users.length === 0) {\n this.isNoContactsFound = searchTag?.trim() ? true : false;\n } else {\n this.isNoContactsFound = false;\n const uniqueContacts = res?.users?.filter(\n newContact => !this.nonBlockedContacts.some(existingContact => existingContact.userId === newContact.userId),\n );\n this.nonBlockedContacts = [...this.nonBlockedContacts, ...uniqueContacts];\n this.skip += res.users.length;\n }\n if (res?.users?.length < paramsForNonBlockedContacts.limit) {\n this.hasMore = false;\n }\n } catch (error) {\n if (error?.status === 404 || error?.statusCode === 404) {\n this.hasMore = false;\n }\n if ((error?.status === 404 || error?.statusCode === 404) && searchTag != null) {\n this.nonBlockedContacts = [];\n }\n } finally {\n this.isLoading = false;\n this.paginationLoading = false;\n }\n };\n\n postMessageForward = async (\n messageBody: any,\n userIds?: string[],\n conversationIds?: string[],\n attachments?: any,\n customType?: string,\n ) => {\n try {\n const requestBody: any = withHostMessagePushFields(\n {\n messageType: 1,\n showInConversation: true,\n encrypted: false,\n body: messageBody,\n attachments: attachments,\n deviceId: this.dialogData.deviceId,\n customType: customType,\n },\n {\n senderName:\n this.dialogData?.userMetaData?.userName ||\n this.dialogData?.userName ||\n '',\n },\n );\n\n if (userIds?.length > 0) {\n requestBody.userIds = userIds;\n }\n\n if (conversationIds?.length > 0) {\n requestBody.conversationIds = conversationIds;\n }\n\n await ChatSDK.getInstance().message.postMessagesForward(requestBody);\n } catch (error) {\n console.error('Error forwarding the message', error);\n } finally {\n drawerDialogService.closeDialog('forward-memebers');\n }\n };\n\n async sendMessageHandler() {\n const allUserIds: string[] = [];\n const allConversationIds: string[] = [];\n\n this.selected.forEach(contact => {\n const userId = contact?.userId || contact?.opponentDetails?.userId;\n const conversationId = contact?.conversationId || contact?.contactConversationId;\n if (conversationId) allConversationIds.push(conversationId);\n else if (userId) allUserIds.push(userId);\n });\n\n if (this.dialogData?.message) {\n const parsedMessageBody =\n typeof this.dialogData?.message?.body === 'string'\n ? this.dialogData.message?.body\n : this.dialogData.message?.body?.messageBody;\n if (allUserIds.length > 0 || allConversationIds.length > 0) {\n await this.postMessageForward(\n parsedMessageBody,\n allUserIds.length > 0 ? allUserIds : null,\n allConversationIds.length > 0 ? allConversationIds : null,\n this.dialogData.message?.attachments,\n this.dialogData.message?.customType,\n );\n }\n }\n }\n\n render() {\n const items = this.items();\n const count = this.selected.length;\n\n return (\n <div class=\"panel\">\n <div class=\"header\">\n <button class=\"close-btn\" type=\"button\" aria-label=\"Close\" onClick={this.close}>\n <img class=\"theme-icon\" src={CancelIcon} alt=\"\" />\n </button>\n <h2 class=\"title\">Forward message to</h2>\n </div>\n\n <div class=\"search-wrap\">\n <div class=\"search-bar\">\n <img class=\"theme-icon search-icon\" src={Search} alt=\"\" />\n <input type=\"text\" placeholder=\"Search name\" value={this.searchText} onInput={this.onSearch} />\n </div>\n </div>\n\n {this.isLoading ? (\n <div class=\"empty\">\n <spinner-loader height=\"24px\" width=\"24px\" />\n </div>\n ) : items.length === 0 ? (\n <div class=\"empty\">No results</div>\n ) : (\n <div class=\"list\" onScroll={this.onScroll}>\n {!this.searchText.trim() ? <div class=\"section-label\">Recent chats</div> : null}\n {items.map(item => {\n const selected = this.isSelected(item);\n return (\n <div class={`row ${selected ? 'selected' : ''}`} onClick={() => this.toggle(item)}>\n <div class=\"row-left\">\n <profile-avatar src={this.imageOf(item) || ''} name={this.nameOf(item)} size=\"2.5rem\" />\n <div class=\"row-meta\">\n <p class=\"row-name\">{this.nameOf(item)}</p>\n {this.subOf(item) ? <p class=\"row-sub\">{this.subOf(item)}</p> : null}\n </div>\n </div>\n <div class=\"check\">\n {selected ? (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M5 13l4 4L19 7\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n ) : null}\n </div>\n </div>\n );\n })}\n {this.paginationLoading ? (\n <div class=\"empty\">\n <spinner-loader height=\"20px\" width=\"20px\" />\n </div>\n ) : null}\n </div>\n )}\n\n <div class={`footer ${count ? '' : 'hidden'}`}>\n <div class=\"chip\">\n <span class=\"chip-dot\" />\n <span>\n {count} selected\n </span>\n <button class=\"chip-clear\" type=\"button\" aria-label=\"Clear selection\" onClick={this.clearSelected}>\n <img class=\"theme-icon\" src={CancelIcon} alt=\"\" />\n </button>\n </div>\n <button class=\"send-btn\" type=\"button\" aria-label=\"Send\" onClick={() => this.sendMessageHandler()}>\n <img src={Send} alt=\"\" />\n </button>\n </div>\n </div>\n );\n }\n}\n"],"mappings":"oQAkOaA,EAAS,M,yBAiBZC,KAAAC,MAAQ,KACd,UAAWD,KAAKE,UAAY,WAAYF,KAAKE,eACxCC,EAAoBC,YAAY,mBAAmB,EAGlDJ,KAAAK,OAAUC,IAAS,IAAAC,EACzB,QAAAA,EAAAD,IAAI,MAAJA,SAAI,SAAJA,EAAME,mBAAe,MAAAD,SAAA,SAAAA,EAAEE,YAAYH,IAAI,MAAJA,SAAI,SAAJA,EAAMG,YAAYH,IAAI,MAAJA,SAAI,SAAJA,EAAMI,oBAAqB,SAAS,EAEnFV,KAAAW,KAAQL,IAAS,IAAAC,EACvB,QAAAA,EAAAD,IAAI,MAAJA,SAAI,SAAJA,EAAME,mBAAe,MAAAD,SAAA,SAAAA,EAAEK,UAAUN,IAAI,MAAJA,SAAI,SAAJA,EAAMM,UAAUN,IAAI,MAAJA,SAAI,SAAJA,EAAMO,iBAAkBb,KAAKK,OAAOC,EAAK,EAEpFN,KAAAc,QAAWR,IAAS,IAAAC,EAC1B,QAAAA,EAAAD,IAAI,MAAJA,SAAI,SAAJA,EAAME,mBAAe,MAAAD,SAAA,SAAAA,EAAEQ,uBAAuBT,IAAI,MAAJA,SAAI,SAAJA,EAAMS,uBAAuBT,IAAI,MAAJA,SAAI,SAAJA,EAAMU,qBAAoB,EAE/FhB,KAAAiB,MAASX,I,MACf,QAAAC,EAAAD,IAAI,MAAJA,SAAI,SAAJA,EAAMY,sBAAkB,MAAAX,SAAA,SAAAA,EAAEY,QAC1Bb,IAAI,MAAJA,SAAI,SAAJA,EAAMc,+BACLd,IAAI,MAA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M,aACZF,EAAA,QAAAC,IAAA,4CACGF,EAAK,aAERC,EAAA,UAAAC,IAAA,2CAAQC,MAAM,aAAaC,KAAK,SAAQ,aAAY,kBAAkBC,QAASlH,KAAKoC,eAClF0E,EAAA,OAAAC,IAAA,2CAAKC,MAAM,aAAaG,IAAKC,EAAYC,IAAI,OAGjDP,EAAA,UAAAC,IAAA,2CAAQC,MAAM,WAAWC,KAAK,SAAQ,aAAY,OAAOC,QAAS,IAAMlH,KAAK+F,sBAC3Ee,EAAA,OAAAC,IAAA,2CAAKI,IAAKe,EAAMb,IAAI,O","ignoreList":[]}
@@ -65,12 +65,17 @@ export declare class ContactInfo {
65
65
  titleEditing: boolean;
66
66
  titleDraft: string;
67
67
  imageUploading: boolean;
68
+ pushNotificationsEnabled: boolean;
69
+ pushNotificationsSaving: boolean;
68
70
  private imageFileInput?;
69
71
  closeRightSidebar: EventEmitter<{
70
72
  type: string;
71
73
  }>;
72
74
  onAttachmentsChange(): void;
73
75
  componentWillLoad(): void;
76
+ onConversationMetaForPush(): void;
77
+ private syncPushNotificationsFromMeta;
78
+ private togglePushNotifications;
74
79
  private close;
75
80
  private emitAction;
76
81
  private confirmClearChat;
@@ -70,6 +70,27 @@ export declare class WebChat {
70
70
  * Default true so hosts/users can verify realtime without digging into logs.
71
71
  */
72
72
  showMqttStatus: boolean;
73
+ /**
74
+ * When false, outbound `events.sendPushNotification` is forced false.
75
+ * Default true.
76
+ */
77
+ enablePushNotifications: boolean;
78
+ /**
79
+ * When false, skip inbound local message alerts.
80
+ * Default true.
81
+ */
82
+ enableLocalNotifications: boolean;
83
+ /**
84
+ * Host callback for inbound local alerts (Flutter showNotification parity).
85
+ * Wins over customParts.messageNotification / default toast.
86
+ */
87
+ onLocalNotification?: (detail: {
88
+ title: string;
89
+ body: string;
90
+ conversationId: string;
91
+ messageId?: string;
92
+ data: Record<string, any>;
93
+ }) => void;
73
94
  unreadConversations: any;
74
95
  allLinks: any;
75
96
  allLinksCount: any;
@@ -941,6 +941,14 @@ export namespace Components {
941
941
  */
942
942
  "customParts"?: WebChatCustomParts;
943
943
  "defaultTheme": string;
944
+ /**
945
+ * When false, skip inbound local message alerts. Default true.
946
+ */
947
+ "enableLocalNotifications": boolean;
948
+ /**
949
+ * When false, outbound `events.sendPushNotification` is forced false. Default true.
950
+ */
951
+ "enablePushNotifications": boolean;
944
952
  /**
945
953
  * Public: snapshot of current SDK UI state.
946
954
  */
@@ -966,6 +974,16 @@ export namespace Components {
966
974
  */
967
975
  "loadMoreMessages": () => Promise<void>;
968
976
  "name": string;
977
+ /**
978
+ * Host callback for inbound local alerts (Flutter showNotification parity). Wins over customParts.messageNotification / default toast.
979
+ */
980
+ "onLocalNotification"?: (detail: {
981
+ title: string;
982
+ body: string;
983
+ conversationId: string;
984
+ messageId?: string;
985
+ data: Record<string, any>;
986
+ }) => void;
969
987
  "projectId": string;
970
988
  /**
971
989
  * Public: open a conversation (or clear with null).
@@ -2923,6 +2941,14 @@ declare namespace LocalJSX {
2923
2941
  */
2924
2942
  "customParts"?: WebChatCustomParts;
2925
2943
  "defaultTheme"?: string;
2944
+ /**
2945
+ * When false, skip inbound local message alerts. Default true.
2946
+ */
2947
+ "enableLocalNotifications"?: boolean;
2948
+ /**
2949
+ * When false, outbound `events.sendPushNotification` is forced false. Default true.
2950
+ */
2951
+ "enablePushNotifications"?: boolean;
2926
2952
  /**
2927
2953
  * When false, groupcast entry points are disabled. Default true.
2928
2954
  */
@@ -2953,6 +2979,16 @@ declare namespace LocalJSX {
2953
2979
  * Conversation list updates (REST + MQTT).
2954
2980
  */
2955
2981
  "onConversationsChange"?: (event: WebChatCustomEvent<ConversationsChangeDetail>) => void;
2982
+ /**
2983
+ * Host callback for inbound local alerts (Flutter showNotification parity). Wins over customParts.messageNotification / default toast.
2984
+ */
2985
+ "onLocalNotification"?: (detail: {
2986
+ title: string;
2987
+ body: string;
2988
+ conversationId: string;
2989
+ messageId?: string;
2990
+ data: Record<string, any>;
2991
+ }) => void;
2956
2992
  "onMessageReadStatusUpdated"?: (event: WebChatCustomEvent<any>) => void;
2957
2993
  /**
2958
2994
  * Active thread messages updates.
@@ -0,0 +1,12 @@
1
+ export type ConversationNotificationsPatch = {
2
+ conversationId: string;
3
+ pushNotifications: boolean;
4
+ typingEvents?: boolean;
5
+ readEvents?: boolean;
6
+ };
7
+ /** Pure — body shape for ChatSDK.conversation.patchSettings. */
8
+ export declare function buildConversationNotificationsPatch(args: ConversationNotificationsPatch): ConversationNotificationsPatch;
9
+ /** Mute / unmute remote + local push for a conversation (member setting). */
10
+ export declare function updateConversationNotifications(conversationId: string, pushNotifications: boolean): Promise<unknown>;
11
+ /** Merge pushNotifications into a conversation / details object. */
12
+ export declare function withConversationPushFlag<T extends Record<string, any>>(conversation: T, pushNotifications: boolean): T;
@@ -12,3 +12,6 @@ export { filesToOutboxMedia, outboxMediaToFiles, MAX_OUTBOX_MEDIA_BYTES } from '
12
12
  export { isPdfAttachment, previewKindFromAttachment, deliveryUiState } from './preview-kind';
13
13
  export { toMentionedUsersPayload, type MentionedUserPayload, } from './mentioned-users';
14
14
  export { normalizeGroupTitle } from './group-title';
15
+ export { senderDisplayName, messagePushContextFrom, findConversationForPush, resolveNotificationBody, resolveNotificationTitle, withMessagePushFields, type MessagePushContext, } from './message-notification';
16
+ export { isPushNotificationsEnabled, isLocalNotificationsEnabled, withHostMessagePushFields, showLocalMessageNotification, buildLocalNotificationDetail, type LocalNotificationDetail, } from './local-notification';
17
+ export { buildConversationNotificationsPatch, updateConversationNotifications, withConversationPushFlag, type ConversationNotificationsPatch, } from './conversation-notifications';
@@ -0,0 +1,39 @@
1
+ import { type MessagePushContext } from './message-notification';
2
+ export type LocalNotificationDetail = {
3
+ title: string;
4
+ body: string;
5
+ conversationId: string;
6
+ messageId?: string;
7
+ /** Full MQTT / message map for tap handlers. */
8
+ data: Record<string, any>;
9
+ };
10
+ type WebChatNotificationHost = HTMLElement & {
11
+ enablePushNotifications?: boolean;
12
+ enableLocalNotifications?: boolean;
13
+ onLocalNotification?: (detail: LocalNotificationDetail) => void;
14
+ selectedConversationId?: string | null;
15
+ customParts?: {
16
+ messageNotification?: string;
17
+ toast?: string;
18
+ };
19
+ };
20
+ export declare function resolveNotificationHost(from?: Element | null): WebChatNotificationHost | null;
21
+ /** Outbound FCM fields — default on. */
22
+ export declare function isPushNotificationsEnabled(host?: Element | null): boolean;
23
+ /** Apply push title/body/events, honoring host `enablePushNotifications`. */
24
+ export declare function withHostMessagePushFields<T extends Record<string, any>>(payload: T, ctx?: MessagePushContext, host?: Element | null): T;
25
+ /** Inbound local UI alerts — default on. */
26
+ export declare function isLocalNotificationsEnabled(host?: Element | null): boolean;
27
+ export declare function buildLocalNotificationDetail(message: Record<string, any>, pushCtx?: MessagePushContext): LocalNotificationDetail;
28
+ /**
29
+ * Show (or skip) a local inbound message alert.
30
+ * Returns true when something was shown / handed to the host.
31
+ */
32
+ export declare function showLocalMessageNotification(message: Record<string, any>, opts?: {
33
+ host?: Element | null;
34
+ pushCtx?: MessagePushContext;
35
+ /** Skip when this conversation is already open (default true). */
36
+ suppressWhenActiveChat?: boolean;
37
+ conversationPushEnabled?: boolean;
38
+ }): boolean;
39
+ export {};
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Flutter / iOS parity for remote push (FCM/APNs).
3
+ *
4
+ * Isometrik message APIs use `notificationTitle` + `notificationBody` (+
5
+ * `events.sendPushNotification`) so the backend can build the push payload.
6
+ * Title: group conversationTitle, else sender display name.
7
+ * Body: plaintext preview or media label (never ciphertext).
8
+ */
9
+ export type MessagePushContext = {
10
+ senderName?: string;
11
+ conversationTitle?: string | null;
12
+ isGroup?: boolean;
13
+ /** Conversation config — false mutes outbound push (Flutter parity). */
14
+ sendPushNotification?: boolean;
15
+ };
16
+ /** Sender label for 1:1 notification titles. */
17
+ export declare function senderDisplayName(user: any): string;
18
+ /** Build push context from live chat host / conversation details. */
19
+ export declare function messagePushContextFrom(opts: {
20
+ userMetaData?: any;
21
+ conversation?: any;
22
+ }): MessagePushContext;
23
+ /** Resolve conversation from list / open details by id. */
24
+ export declare function findConversationForPush(conversationId: string | null | undefined, list?: any[] | null, open?: any | null): any | null;
25
+ /** Pure — FCM body preview. */
26
+ export declare function resolveNotificationBody(payload: Record<string, any>): string;
27
+ /** Pure — FCM title. */
28
+ export declare function resolveNotificationTitle(payload: Record<string, any>, ctx: MessagePushContext): string;
29
+ /**
30
+ * Attach notificationTitle / notificationBody / events onto a message payload
31
+ * (mutates + returns same object for call-site convenience).
32
+ *
33
+ * Host `enablePushNotifications: false` forces `sendPushNotification: false`.
34
+ */
35
+ export declare function withMessagePushFields<T extends Record<string, any>>(payload: T, ctx?: MessagePushContext, opts?: {
36
+ enablePushNotifications?: boolean;
37
+ }): T;
@@ -1,3 +1,4 @@
1
+ import type { MessagePushContext } from './message-notification';
1
2
  export declare const ATTACHMENT_BODY_PLACEHOLDER = "AttachmentMessage:Multiple";
2
3
  export declare function mediaTypeFromMime(mime: string): number;
3
4
  export declare function customTypeFromMime(mime: string): string;
@@ -32,6 +33,8 @@ export type UploadAndPostMediaArgs = {
32
33
  replyMessage?: any | null;
33
34
  caption?: string;
34
35
  mentionedUsers?: any[];
36
+ /** Flutter parity — title/body for FCM when posting the media message. */
37
+ pushContext?: MessagePushContext;
35
38
  };
36
39
  /**
37
40
  * Grab a JPEG frame from a local video File for thumbnailPresignedUrl upload.
@@ -128,3 +128,13 @@ export type ToastPartProps = {
128
128
  type?: 'success' | 'error' | 'warning' | 'info';
129
129
  position?: string;
130
130
  };
131
+ /** customParts.messageNotification — inbound MQTT / local alert. */
132
+ export type MessageNotificationPartProps = {
133
+ title: string;
134
+ body: string;
135
+ conversationId?: string;
136
+ messageId?: string;
137
+ data?: Record<string, any>;
138
+ onOpen?: () => void;
139
+ onDismiss?: () => void;
140
+ };
@@ -24,6 +24,11 @@ export type WebChatCustomParts = {
24
24
  contextMenu?: string;
25
25
  blockList?: string;
26
26
  toast?: string;
27
+ /**
28
+ * Inbound message alert UI. Props: title, body, data, conversationId,
29
+ * messageId, onOpen, onDismiss. Used when `onLocalNotification` is unset.
30
+ */
31
+ messageNotification?: string;
27
32
  };
28
33
  export declare function hasNamedSlot(host: HTMLElement, name: string): boolean;
29
34
  /** Walk up (incl. shadow hosts) to the owning <web-chat>. */
@@ -43,6 +48,6 @@ export declare function createCustomPartElement(part: keyof WebChatCustomParts,
43
48
  export declare function resolveOverlayElement(slotName: WebChatSlotName, partKey: keyof WebChatCustomParts, props?: Record<string, unknown>, host?: Element | null): HTMLElement | null;
44
49
  export type { ChatReadyDetail, ConversationsChangeDetail, MessagesChangeDetail, SelectionChangeDetail, ReplyChangeDetail, ChatErrorDetail, WebChatPublicEvent, WebChatPublicMethod, } from './public-api';
45
50
  export { WEB_CHAT_PUBLIC_EVENTS, WEB_CHAT_PUBLIC_METHODS } from './public-api';
46
- export type { MessageDeliveryStatus, MessageBubbleProps, ChatTileProps, GroupcastTileProps, MessageDatePillProps, SearchResultProps, MemberRowProps, ContactRowProps, OverlayDialogProps, MediaGalleryProps, ContextMenuProps, BlockListProps, ToastPartProps, } from './contracts';
51
+ export type { MessageDeliveryStatus, MessageBubbleProps, ChatTileProps, GroupcastTileProps, MessageDatePillProps, SearchResultProps, MemberRowProps, ContactRowProps, OverlayDialogProps, MediaGalleryProps, ContextMenuProps, BlockListProps, ToastPartProps, MessageNotificationPartProps, } from './contracts';
47
52
  export { deriveMessageStatus } from './contracts';
48
53
  export { defineReactiveCustomPart } from './define-part';
@@ -49,6 +49,27 @@ export type IsometrikWebchatInitProps = {
49
49
  * Default true.
50
50
  */
51
51
  showMqttStatus?: boolean;
52
+ /**
53
+ * When false, outbound messages set `events.sendPushNotification: false`
54
+ * (backend will not FCM/APNs). Default true.
55
+ */
56
+ enablePushNotifications?: boolean;
57
+ /**
58
+ * When false, skip inbound MQTT local alerts (toast / customParts / callback).
59
+ * Default true.
60
+ */
61
+ enableLocalNotifications?: boolean;
62
+ /**
63
+ * Flutter `showNotification` parity — host owns the UI when set.
64
+ * Called for inbound messages when local notifications are enabled.
65
+ */
66
+ onLocalNotification?: (detail: {
67
+ title: string;
68
+ body: string;
69
+ conversationId: string;
70
+ messageId?: string;
71
+ data: Record<string, any>;
72
+ }) => void;
52
73
  };
53
74
  /** @deprecated Use IsometrikWebchatInitProps */
54
75
  export type InitializeChatProps = IsometrikWebchatInitProps;
@@ -82,6 +82,36 @@ const { chatComponent } = initializeChat({
82
82
  | `contextMenu` | `ContextMenuProps` | Right-click menu |
83
83
  | `blockList` | `BlockListProps` | Blocked users |
84
84
  | `toast` | `ToastPartProps` | Toasts via `showToast` |
85
+ | `messageNotification` | `MessageNotificationPartProps` | Inbound message alert UI (when `onLocalNotification` unset) |
86
+
87
+ ### Notifications (push + local alerts)
88
+
89
+ ```js
90
+ initializeIsometrikWebchat({
91
+ // …creds
92
+ // Remote FCM/APNs fields on send — set false to never ask backend to push
93
+ enablePushNotifications: true,
94
+ // In-app alert when MQTT delivers a message while another chat is open
95
+ enableLocalNotifications: true,
96
+ // Host owns UI (Flutter showNotification parity) — highest priority
97
+ onLocalNotification: ({ title, body, conversationId, data }) => {
98
+ // your banner / Notification API / etc.
99
+ },
100
+ // Or paint with a custom element instead of the callback / default toast
101
+ customParts: {
102
+ messageNotification: 'my-message-notification',
103
+ },
104
+ });
105
+ ```
106
+
107
+ | Want | Set |
108
+ |------|-----|
109
+ | No notifications at all | `enablePushNotifications: false` **and** `enableLocalNotifications: false` |
110
+ | Remote push only (no in-app banner) | `enableLocalNotifications: false` |
111
+ | Custom banner UI | `onLocalNotification` **or** `customParts.messageNotification` |
112
+ | Mute one chat | Contact / Group info → **Notifications** toggle (`updateConversationNotifications`) |
113
+
114
+ `messageNotification` CE props: `title`, `body`, `data`, `conversationId`, `messageId`, `onOpen`, `onDismiss`.
85
115
 
86
116
  ### Message bubble callbacks (SDK owns behavior)
87
117
 
@@ -113,7 +113,23 @@ initializeIsometrikWebchat({
113
113
 
114
114
  ---
115
115
 
116
- ## 4. APIs for custom UI
116
+ ## 4. Notifications (optional)
117
+
118
+ ```js
119
+ initializeIsometrikWebchat({
120
+ /* creds */,
121
+ enablePushNotifications: true, // false → never ask backend to FCM/APNs
122
+ enableLocalNotifications: true, // false → no in-app inbound banners
123
+ onLocalNotification: ({ title, body, conversationId, data }) => { /* your UI */ },
124
+ // or: customParts: { messageNotification: 'my-msg-notice' }
125
+ });
126
+ ```
127
+
128
+ See [CUSTOMIZATION.md](./CUSTOMIZATION.md#notifications-push--local-alerts).
129
+
130
+ ---
131
+
132
+ ## 5. APIs for custom UI
117
133
 
118
134
  ### Live instance (`chat.api`)
119
135
 
@@ -141,7 +157,7 @@ const msgs = await isometrikWebchatApi.messages.list({ conversationId: id });
141
157
 
142
158
  ---
143
159
 
144
- ## 5. Framework snippets
160
+ ## 6. Framework snippets
145
161
 
146
162
  ### Vanilla
147
163
 
@@ -263,7 +279,7 @@ onBeforeUnmount(() => instance?.destroy());
263
279
 
264
280
  ---
265
281
 
266
- ## 6. Rules that prevent bugs
282
+ ## 7. Rules that prevent bugs
267
283
 
268
284
  1. Mount **client-side only** (no SSR init).
269
285
  2. Call `destroy()` on unmount / logout.
@@ -272,7 +288,7 @@ onBeforeUnmount(() => instance?.destroy());
272
288
  5. Prefer `chat.api` / `resolveWebChat(el)` over bare `document.querySelector('web-chat')`.
273
289
  6. Theme is **scoped** to `theme-provider` (does not restyle `<html>` unless `mirrorToDocument`).
274
290
 
275
- ## 7. Local demos (`npm start`)
291
+ ## 8. Local demos (`npm start`)
276
292
 
277
293
  | URL | What it proves |
278
294
  |-----|----------------|
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isometrik-plugin-chat-sdk",
3
- "version": "2.0.15",
3
+ "version": "2.0.17",
4
4
  "description": "Isometrik WebChat SDK — embeddable real-time chat web components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- {"file":"index-66f98408.js","mappings":";;AAAA;;;;;;;MAQa,cAAc,GAA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,QAAyB,EACzB,OAAiC,EACjC,KAA+B,EAC/B,IAAqB;IAErB,MAAM,QAAQ,GAAG,uBAAuB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/D,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAE9B,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,iBAAiB,EAAE,GAAG,IAAI,CAAC,CAAC;IAC9E,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC/C,IAAI,IAAI,IAAI,YAAY,WAAW,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO,KAAK,MAAM,CAC9E,CAAC;IAC7B,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAgB,CAAC;IACrD,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC9B,OAAO,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC5C;;;;;;;;;;","names":[],"sources":["src/lib/custom-ui/index.ts"],"sourcesContent":["/**\n * Custom UI contract for <web-chat>.\n *\n * PRIMARY: customParts — host CE tags; SDK passes props + callbacks.\n * SECONDARY: named slots — layout panels only (no per-row props).\n * ADVANCED: events/methods — headless / full custom chrome.\n */\n\nexport const WEB_CHAT_SLOTS = [\n // shell / panels\n 'sidebar',\n 'profile-rail',\n 'conversation-list',\n 'profile-page',\n 'group-cast',\n 'header',\n 'messages',\n 'composer',\n 'composer-input',\n 'reply-preview',\n 'attachment-preview',\n 'empty',\n 'right-panel',\n 'contact-info',\n 'profile-info',\n 'message-search',\n 'boot-loader',\n // overlays\n 'forward-dialog',\n 'message-info',\n 'media-gallery',\n 'add-member',\n 'context-menu',\n 'block-list',\n 'toast',\n] as const;\n\nexport type WebChatSlotName = (typeof WEB_CHAT_SLOTS)[number];\n\n/** Custom element tags for repeating rows / drawer dialogs. */\nexport type WebChatCustomParts = {\n messageBubble?: string;\n chatTile?: string;\n groupcastTile?: string;\n messageDatePill?: string;\n searchResult?: string;\n memberRow?: string;\n /** New Chat / contact picker row. */\n contactRow?: string;\n /** Drawer dialogs (render outside <web-chat> shadow) */\n forwardDialog?: string;\n addMember?: string;\n mediaGallery?: string;\n contextMenu?: string;\n blockList?: string;\n toast?: string;\n};\n\nexport function hasNamedSlot(host: HTMLElement, name: string): boolean {\n return Array.from(host.children).some(node => {\n // Avoid `instanceof HTMLElement` — fails across jsdom realms in Jest.\n if (!node || node.nodeType !== 1) return false;\n const el = node as HTMLElement;\n if (el.getAttribute('slot') !== name) return false;\n if (el.tagName === 'SLOT') {\n return (el as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n return true;\n });\n}\n\n/** Walk up (incl. shadow hosts) to the owning <web-chat>. */\nexport function findWebChatHost(from?: Element | null): HTMLElement | null {\n let node: Element | null = from || null;\n while (node) {\n if (node.tagName === 'WEB-CHAT') return node as HTMLElement;\n const root = node.getRootNode?.();\n if (root instanceof ShadowRoot) {\n node = root.host;\n continue;\n }\n node = node.parentElement;\n }\n return null;\n}\n\n/** Fallback only — prefer findWebChatHost(from) for multi-instance safety. */\nexport function getWebChatElement(): HTMLElement | null {\n if (typeof document === 'undefined') return null;\n return document.querySelector('web-chat');\n}\n\nexport function getCustomPartTag(\n part: keyof WebChatCustomParts,\n host?: Element | null,\n): string | undefined {\n const webChat = (findWebChatHost(host) || (!host ? getWebChatElement() : null)) as any;\n return webChat?.customParts?.[part];\n}\n\n/** Assign props and nudge CE to re-paint (calls `.render()` if present). */\nexport function applyCustomPartProps(el: HTMLElement, props?: Record<string, unknown>): HTMLElement {\n if (props) Object.assign(el, props);\n const anyEl = el as any;\n if (typeof anyEl.render === 'function') {\n try {\n anyEl.render();\n } catch {\n /* host CE render is best-effort */\n }\n }\n el.dispatchEvent(new CustomEvent('custompart-props', { detail: props, bubbles: false }));\n return el;\n}\n\n/** Create a host-registered CE for a customPart, or null. */\nexport function createCustomPartElement(\n part: keyof WebChatCustomParts,\n props?: Record<string, unknown>,\n host?: Element | null,\n): HTMLElement | null {\n const tag = getCustomPartTag(part, host);\n if (!tag || typeof document === 'undefined') return null;\n return applyCustomPartProps(document.createElement(tag), props);\n}\n\n/**\n * Resolve overlay UI for drawers / deep trees:\n * 1) customParts tag\n * 2) clone of light-DOM [slot=\"…\"] on <web-chat>\n */\nexport function resolveOverlayElement(\n slotName: WebChatSlotName,\n partKey: keyof WebChatCustomParts,\n props?: Record<string, unknown>,\n host?: Element | null,\n): HTMLElement | null {\n const fromPart = createCustomPartElement(partKey, props, host);\n if (fromPart) return fromPart;\n\n const webChat = findWebChatHost(host) || (!host ? getWebChatElement() : null);\n if (!webChat) return null;\n const slotted = Array.from(webChat.children).find(\n node => node instanceof HTMLElement && node.getAttribute('slot') === slotName && node.tagName !== 'SLOT',\n ) as HTMLElement | undefined;\n if (!slotted) return null;\n\n const clone = slotted.cloneNode(true) as HTMLElement;\n clone.removeAttribute('slot');\n return applyCustomPartProps(clone, props);\n}\n\nexport type {\n ChatReadyDetail,\n ConversationsChangeDetail,\n MessagesChangeDetail,\n SelectionChangeDetail,\n ReplyChangeDetail,\n ChatErrorDetail,\n WebChatPublicEvent,\n WebChatPublicMethod,\n} from './public-api';\nexport { WEB_CHAT_PUBLIC_EVENTS, WEB_CHAT_PUBLIC_METHODS } from './public-api';\nexport type {\n MessageDeliveryStatus,\n MessageBubbleProps,\n ChatTileProps,\n GroupcastTileProps,\n MessageDatePillProps,\n SearchResultProps,\n MemberRowProps,\n ContactRowProps,\n OverlayDialogProps,\n MediaGalleryProps,\n ContextMenuProps,\n BlockListProps,\n ToastPartProps,\n} from './contracts';\nexport { deriveMessageStatus } from './contracts';\nexport { defineRe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alizeThemeObject","destroyChatDom","resolveShowProfileRailProp","initializeChatSdk","fetchUserDetails","fetchConversationsPage","fetchConversationDetails","sortConversationsByLatestMessage","mergeUniqueConversations","fetchMessagesPage","markConversationRead","mergeMessagesById","searchMessages","fetchLinkMessages","fetchMediaCount","fetchMediaAttachments","filterMediaMessages","fetchGroupcastDetails","fetchGroupcastMembersPage","fetchGroupcastContactsPage","mediaTypeFromMime","customTypeFromMime","prepareMediaAttachments","buildReplyMetaData"],"sources":["src/lib/custom-ui/public-api.ts","src/sdk/webchat-api.ts","src/sdk/slots.ts","src/sdk/instance.ts","src/sdk/init.ts","src/sdk/headless-api.ts","src/sdk/react-bridge.ts","src/sdk/runtime-controls.ts"],"sourcesContent":["/**\n * Public host-facing events + method contract for <web-chat>.\n * Slots/customParts = UI. These = data + actions (fully functional custom UI).\n */\n\nexport type ChatReadyDetail = {\n userMetaData: any;\n conversations: any[];\n};\n\nexport type ConversationsChangeDetail = {\n conversations: any[];\n};\n\nexport type MessagesChangeDetail = {\n conversationId: string | null;\n messages: any[];\n};\n\nexport type SelectionChangeDetail = {\n conversationId: string | null;\n conversation: any | null;\n};\n\nexport type ReplyChangeDetail = {\n replyMessage: any | null;\n};\n\nexport type ChatErrorDetail = {\n code: string;\n message: string;\n cause?: unknown;\n};\n\nexport const WEB_CHAT_PUBLIC_EVENTS = [\n 'chatReady',\n 'conversationsChange',\n 'messagesChange',\n 'conversationSelect',\n 'replyChange',\n 'chatError',\n 'unreadMessageCountUpdated',\n 'conversationNotFound',\n 'messageReadStatusUpdated',\n] as const;\n\nexport type WebChatPublicEvent = (typeof WEB_CHAT_PUBLIC_EVENTS)[number];\n\n/** Documented public @Method names on <web-chat>. */\nexport const WEB_CHAT_PUBLIC_METHODS = [\n 'selectConversation',\n 'sendText',\n 'sendMedia',\n 'setReply',\n 'clearReply',\n 'loadMoreMessages',\n 'loadMoreConversations',\n 'getChatState',\n 'setCustomParts',\n] as const;\n\nexport type WebChatPublicMethod = (typeof WEB_CHAT_PUBLIC_METHODS)[number];\n","/**\n * Bound actions/events for a live <web-chat> instance.\n * No REST imports — safe for unit tests without ChatSDK.\n */\n\nimport { WEB_CHAT_PUBLIC_EVENTS, WEB_CHAT_PUBLIC_METHODS } from '../lib/custom-ui';\nimport type { WebChatPublicEvent, WebChatPublicMethod } from '../lib/custom-ui';\n\nexport type WebChatApi = {\n selectConversation: (conversationId: string | null) => Promise<void>;\n sendText: (body: string, conversationId?: string) => Promise<unknown>;\n sendMedia: (files: File[] | FileList, conversationId?: string, caption?: string) => Promise<unknown>;\n setReply: (message: any | null) => Promise<void>;\n clearReply: () => Promise<void>;\n loadMoreMessages: () => Promise<void>;\n loadMoreConversations: () => Promise<void>;\n getChatState: () => Promise<Record<string, unknown>>;\n setCustomParts: (parts: Record<string, string>) => Promise<unknown>;\n on: (event: WebChatPublicEvent, handler: (ev: Event) => void) => () => void;\n methods: typeof WEB_CHAT_PUBLIC_METHODS;\n events: typeof WEB_CHAT_PUBLIC_EVENTS;\n};\n\nfunction callMethod(el: any, name: WebChatPublicMethod | 'setCustomParts', ...args: any[]) {\n const fn = el?.[name];\n if (typeof fn !== 'function') {\n return Promise.reject(new Error(`[isometrik-webchat] method \"${name}\" is not available`));\n }\n return Promise.resolve(fn.apply(el, args));\n}\n\n/** Bind public methods/events to a mounted <web-chat> element. */\nexport function createWebChatApi(chatComponent: HTMLElement | null | undefined): WebChatApi | null {\n if (!chatComponent) return null;\n const el = chatComponent as any;\n\n return {\n selectConversation: id => callMethod(el, 'selectConversation', id),\n sendText: (body, conversationId) => callMethod(el, 'sendText', body, conversationId),\n sendMedia: (files, conversationId, caption) => callMethod(el, 'sendMedia', files, conversationId, caption),\n setReply: message => callMethod(el, 'setReply', message),\n clearReply: () => callMethod(el, 'clearReply'),\n loadMoreMessages: () => callMethod(el, 'loadMoreMessages'),\n loadMoreConversations: () => callMethod(el, 'loadMoreConversations'),\n getChatState: () => callMethod(el, 'getChatState'),\n setCustomParts: parts => callMethod(el, 'setCustomParts', parts),\n on(event, handler) {\n el.addEventListener(event, handler);\n return () => el.removeEventListener(event, handler);\n },\n methods: WEB_CHAT_PUBLIC_METHODS,\n events: WEB_CHAT_PUBLIC_EVENTS,\n };\n}\n","/**\n * Framework-agnostic slot helpers.\n * React / Angular / Vue / vanilla all end up calling these with real HTMLElements.\n *\n * Note: avoid `instanceof HTMLElement` — it fails across jsdom realms in Jest.\n */\n\nimport type { WebChatSlotName } from '../lib/custom-ui';\n\nfunction isElement(node: ChildNode | null | undefined): node is HTMLElement {\n return !!node && node.nodeType === 1;\n}\n\nfunction slotNameOf(el: HTMLElement): string | null {\n return el.getAttribute('slot') || el.slot || null;\n}\n\n/** Attach (or replace) a named slot on <web-chat>. */\nexport function setWebChatSlot(\n chatComponent: HTMLElement | null | undefined,\n slotName: WebChatSlotName,\n element: HTMLElement,\n): HTMLElement | null {\n if (!chatComponent || !element) return null;\n clearWebChatSlot(chatComponent, slotName);\n element.slot = slotName;\n element.setAttribute('slot', slotName);\n chatComponent.appendChild(element);\n return element;\n}\n\n/** Remove host content for a named slot. */\nexport function clearWebChatSlot(\n chatComponent: HTMLElement | null | undefined,\n slotName: WebChatSlotName,\n): void {\n if (!chatComponent) return;\n Array.from(chatComponent.children).forEach(node => {\n if (!isElement(node)) return;\n if (slotNameOf(node) === slotName) {\n node.remove();\n }\n });\n}\n\n/** Create a plain wrapper element ready to receive framework content (e.g. React portal target). */\nexport function createSlotHost(slotName: WebChatSlotName, className?: string): HTMLElement {\n const el = document.createElement('div');\n el.slot = slotName;\n el.setAttribute('slot', slotName);\n el.setAttribute('data-isometrik-slot', slotName);\n if (className) el.className = className;\n el.style.height = '100%';\n el.style.width = '100%';\n el.style.display = 'contents';\n return el;\n}\n\n/** Attach many slots at once (same shape as initialize props.slots). */\nexport function setWebChatSlots(\n chatComponent: HTMLElement | null | undefined,\n slots?: Partial<Record<WebChatSlotName, HTMLElement>>,\n): void {\n if (!chatComponent || !slots) return;\n (Object.entries(slots) as [WebChatSlotName, HTMLElement | undefined][]).forEach(([name, el]) => {\n if (el) setWebChatSlot(chatComponent, name, el);\n });\n}\n","/**\n * Last-mounted chat instance registry + resolvers.\n * Prefer explicit elements; fall back to store; querySelector is last resort.\n */\n\nimport { findWebChatHost } from '../lib/custom-ui';\n\nexport type StoredChatComponents = {\n themeProvider?: HTMLElement;\n chatComponent?: HTMLElement;\n};\n\nexport function getChatStore(): StoredChatComponents {\n if (typeof window === 'undefined') return {};\n (window as any).__isometrikChatComponents = (window as any).__isometrikChatComponents || {};\n return (window as any).__isometrikChatComponents;\n}\n\nexport function setChatStore(partial: StoredChatComponents): void {\n const store = getChatStore();\n if (partial.themeProvider !== undefined) store.themeProvider = partial.themeProvider;\n if (partial.chatComponent !== undefined) store.chatComponent = partial.chatComponent;\n}\n\nexport function clearChatStore(): void {\n if (typeof window === 'undefined') return;\n (window as any).__isometrikChatComponents = {};\n}\n\n/** Resolve <theme-provider> from an explicit node, store, or (last) DOM. */\nexport function resolveThemeProvider(from?: Element | null): HTMLElement | null {\n if (from) {\n const el = from as HTMLElement;\n if (el.tagName === 'THEME-PROVIDER') return el;\n const closest = el.closest?.('theme-provider');\n if (closest) return closest as HTMLElement;\n const host = findWebChatHost(el);\n if (host?.parentElement?.tagName === 'THEME-PROVIDER') {\n return host.parentElement;\n }\n }\n const stored = getChatStore().themeProvider;\n if (stored) return stored;\n if (typeof document === 'undefined') return null;\n return document.querySelector('theme-provider');\n}\n\n/** Resolve <web-chat> from an explicit node, store, or (last) DOM. */\nexport function resolveWebChat(from?: Element | null): HTMLElement | null {\n if (from) {\n const el = from as HTMLElement;\n if (el.tagName === 'WEB-CHAT') return el;\n const host = findWebChatHost(el);\n if (host) return host;\n }\n const stored = getChatStore().chatComponent;\n if (stored) return stored;\n if (typeof document === 'undefined') return null;\n return document.querySelector('web-chat');\n}\n","import { destroyChatDom } from '../lib/destroy-chat';\nimport type { WebChatSlotName, WebChatCustomParts } from '../lib/custom-ui';\nimport type { ThemeTokenMap } from './theme-tokens';\nimport { normalizeThemeObject } from './theme-tokens';\nimport { resolveShowProfileRailProp } from './composition';\nimport { createWebChatApi, type WebChatApi } from './webchat-api';\nimport { setWebChatSlots } from './slots';\nimport { clearChatStore, getChatStore, setChatStore } from './instance';\n\nconst DEFAULT_THEME_URL =\n 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css';\n\nexport type IsometrikWebchatInitProps = {\n baseUrl?: string;\n hostUrl?: string;\n licenseKey: string;\n appSecret: string;\n userSecret: string;\n userToken: string;\n isometrikUserId: string;\n projectId: string;\n keysetId: string;\n accountId: string;\n defaultTheme?: 'dark' | 'light';\n /** CSS file from CDN or same-origin path. */\n themeUrl?: string;\n /** Inline CSS variable overrides (wins over themeUrl for same keys). */\n theme?: ThemeTokenMap;\n /** @deprecated Use `theme`. Kept for applyCustomTheme / older hosts. */\n themeObject?: Record<string, string>;\n containerId?: string;\n /** Optional custom UI nodes — each gets `slot=\"<name>\"` and is appended to <web-chat>. */\n slots?: Partial<Record<WebChatSlotName, HTMLElement>>;\n /** Custom element tags for list rows / dialogs. */\n customParts?: WebChatCustomParts;\n /** When false, hide the left profile icon rail. Default true. */\n showProfileRail?: boolean;\n /** Alias of showProfileRail for clearer host DX. Default true. */\n showProfileSidebar?: boolean;\n /** When false, no doodle wallpaper behind messages. Default true. */\n showChatWallpaper?: boolean;\n /** When false, hide groupcast entry points. Default true. */\n groupcastEnabled?: boolean;\n /** When false, hide conversation header. Default true. */\n showHeader?: boolean;\n /** When false, hide composer. Default true. */\n showComposer?: boolean;\n /** When false, hide empty state. Default true. */\n showEmptyState?: boolean;\n /** When false, hide conversation list. Default true. */\n showConversationList?: boolean;\n /** When false, never show right info panel. Default true. */\n showRightPanel?: boolean;\n /** When false, hide conversation-list search. Default true. */\n isSidebarHeaderSearch?: boolean;\n /**\n * When false, hide the MQTT green/red status dot in the conversation list header.\n * Default true.\n */\n showMqttStatus?: boolean;\n};\n\n/** @deprecated Use IsometrikWebchatInitProps */\nexport type InitializeChatProps = IsometrikWebchatInitProps;\n\nexport type IsometrikWebchatInstance = {\n themeProvider: HTMLElement;\n chatComponent: HTMLElement;\n /** Bound actions/events for the live instance. */\n api: WebChatApi;\n /** Session key used by ensure/retain. */\n sessionKey: string;\n destroy: () => void;\n};\n\n/** Identity for reuse — same user + project + mount target → skip re-bootstrap. */\nexport function buildWebchatSessionKey(props: IsometrikWebchatInitProps): string {\n return [\n props.containerId || '__body__',\n props.isometrikUserId,\n props.userToken,\n props.projectId,\n props.accountId,\n props.keysetId,\n ].join('|');\n}\n\ntype RetainState = {\n count: number;\n sessionKey: string;\n instance: IsometrikWebchatInstance | null;\n pendingDestroy: ReturnType<typeof setTimeout> | null;\n};\n\nfunction getRetainState(): RetainState {\n if (typeof window === 'undefined') {\n return { count: 0, sessionKey: '', instance: null, pendingDestroy: null };\n }\n const w = window as any;\n if (!w.__isometrikChatRetain) {\n w.__isometrikChatRetain = {\n count: 0,\n sessionKey: '',\n instance: null,\n pendingDestroy: null,\n } as RetainState;\n }\n return w.__isometrikChatRetain;\n}\n\nfunction resolveThemeObject(props: IsometrikWebchatInitProps): Record<string, string> | undefined {\n const merged = { ...(props.themeObject || {}), ...(props.theme || {}) };\n const normalized = normalizeThemeObject(merged as Record<string, string>);\n return Object.keys(normalized).length ? normalized : undefined;\n}\n\nfunction applyOptionalBool(el: any, key: string, value: boolean | undefined) {\n if (value !== undefined) el[key] = value;\n}\n\nfunction isLiveInstance(instance: IsometrikWebchatInstance | null): boolean {\n if (!instance) return false;\n const { themeProvider, chatComponent } = instance;\n if (!themeProvider || !chatComponent) return false;\n // isConnected may be false in some test envs; also accept store match\n const store = getChatStore();\n return store.chatComponent === chatComponent && store.themeProvider === themeProvider;\n}\n\n/** Tear down existing chat instance (MQTT via disconnectedCallback, DOM). */\nexport function destroyIsometrikWebchat(): void {\n const retain = getRetainState();\n if (retain.pendingDestroy) {\n clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = null;\n }\n retain.count = 0;\n retain.sessionKey = '';\n retain.instance = null;\n\n destroyChatDom();\n document.querySelectorAll('theme-provider').forEach(el => {\n if (!el.querySelector('web-chat') && el.childNodes.length === 0) {\n el.remove();\n }\n });\n clearChatStore();\n}\n\n/** @deprecated Use destroyIsometrikWebchat */\nexport const destroyChat = destroyIsometrikWebchat;\n\n/**\n * Force mount: always tears down previous instance then creates a new one.\n * Prefer `retainIsometrikWebchat` / `ensureIsometrikWebchat` in React/SPA hosts\n * to avoid double bootstrap (Strict Mode / remount).\n */\nexport function initializeIsometrikWebchat(\n props: IsometrikWebchatInitProps,\n): IsometrikWebchatInstance | null {\n if (\n !props.licenseKey ||\n !props.appSecret ||\n !props.userSecret ||\n !props.userToken ||\n !props.isometrikUserId ||\n !props.projectId ||\n !props.keysetId ||\n !props.accountId\n ) {\n console.error('Missing required props to Initialize chat!');\n return null;\n }\n\n destroyIsometrikWebchat();\n\n const sessionKey = buildWebchatSessionKey(props);\n const themeProvider = document.createElement('theme-provider') as any;\n const themeUrl = props.themeUrl || DEFAULT_THEME_URL;\n const themeObject = resolveThemeObject(props);\n\n if (props.defaultTheme) {\n themeProvider.setAttribute('mode', props.defaultTheme);\n }\n themeProvider.setAttribute('theme-path', themeUrl);\n if (themeObject) {\n themeProvider.themeObject = themeObject;\n }\n\n const chatComponent = document.createElement('web-chat') as any;\n\n chatComponent.baseUrl = props.baseUrl || 'https://apis.isometrik.io';\n chatComponent.hostUrl = props.hostUrl || 'wss://connections.isometrik.io:2053/mqtt';\n chatComponent.licenseKey = props.licenseKey;\n chatComponent.appSecret = props.appSecret;\n chatComponent.userSecret = props.userSecret;\n chatComponent.userToken = props.userToken;\n chatComponent.isometrikUserId = props.isometrikUserId;\n chatComponent.projectId = props.projectId;\n chatComponent.keysetId = props.keysetId;\n chatComponent.accountId = props.accountId;\n chatComponent.defaultTheme = props.defaultTheme || 'light';\n chatComponent.themeUrl = themeUrl;\n\n chatComponent.style.width = '100%';\n chatComponent.style.height = '100%';\n\n if (props.customParts) {\n chatComponent.customParts = props.customParts;\n }\n\n applyOptionalBool(chatComponent, 'showProfileRail', resolveShowProfileRailProp(props));\n applyOptionalBool(chatComponent, 'showChatWallpaper', props.showChatWallpaper);\n applyOptionalBool(chatComponent, 'groupcastEnabled', props.groupcastEnabled);\n applyOptionalBool(chatComponent, 'showHeader', props.showHeader);\n applyOptionalBool(chatComponent, 'showComposer', props.showComposer);\n applyOptionalBool(chatComponent, 'showEmptyState', props.showEmptyState);\n applyOptionalBool(chatComponent, 'showConversationList', props.showConversationList);\n applyOptionalBool(chatComponent, 'showRightPanel', props.showRightPanel);\n applyOptionalBool(chatComponent, 'isSidebarHeaderSearch', props.isSidebarHeaderSearch);\n applyOptionalBool(chatComponent, 'showMqttStatus', props.showMqttStatus);\n\n setWebChatSlots(chatComponent, props.slots);\n\n themeProvider.appendChild(chatComponent);\n themeProvider.style.width = '100%';\n themeProvider.style.height = '100%';\n themeProvider.style.display = 'block';\n\n const container = props.containerId ? document.getElementById(props.containerId) : document.body;\n if (container) {\n container.appendChild(themeProvider);\n } else {\n console.error('Container with the specified ID not found. Appending to body instead.');\n document.body.appendChild(themeProvider);\n }\n\n setChatStore({ themeProvider, chatComponent });\n\n const api = createWebChatApi(chatComponent)!;\n const instance: IsometrikWebchatInstance = {\n themeProvider,\n chatComponent,\n api,\n sessionKey,\n destroy: destroyIsometrikWebchat,\n };\n\n const retain = getRetainState();\n retain.instance = instance;\n retain.sessionKey = sessionKey;\n retain.count = Math.max(retain.count, 1);\n\n return instance;\n}\n\n/**\n * Reuse live instance when session key matches (same user/token/container).\n * Otherwise mounts fresh. Does not bump retain count — use `retainIsometrikWebchat` in React.\n */\nexport function ensureIsometrikWebchat(\n props: IsometrikWebchatInitProps,\n): IsometrikWebchatInstance | null {\n const retain = getRetainState();\n if (retain.pendingDestroy) {\n clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = null;\n }\n\n const key = buildWebchatSessionKey(props);\n if (retain.sessionKey === key && isLiveInstance(retain.instance)) {\n return retain.instance;\n }\n return initializeIsometrikWebchat(props);\n}\n\n/**\n * React / SPA friendly: acquire a chat instance.\n * Pair with `releaseIsometrikWebchat` in effect cleanup.\n * Survives React 18 Strict Mode double-mount without a second bootstrap.\n */\nexport function retainIsometrikWebchat(\n props: IsometrikWebchatInitProps,\n): IsometrikWebchatInstance | null {\n const retain = getRetainState();\n if (retain.pendingDestroy) {\n clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = null;\n }\n retain.count += 1;\n return ensureIsometrikWebchat(props);\n}\n\n/**\n * Release a retain from `retainIsometrikWebchat`.\n * Destroy is deferred so Strict Mode remount can cancel it.\n * @param delayMs default 0 (macrotask) — enough for React 18 Strict Mode\n */\nexport function releaseIsometrikWebchat(delayMs: number = 0): void {\n const retain = getRetainState();\n retain.count = Math.max(0, retain.count - 1);\n if (retain.count > 0) return;\n\n if (retain.pendingDestroy) clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = setTimeout(() => {\n retain.pendingDestroy = null;\n if (retain.count > 0) return;\n destroyIsometrikWebchat();\n }, delayMs);\n}\n\n/** @deprecated Use initializeIsometrikWebchat */\nexport const initializeChat = initializeIsometrikWebchat;\n","/**\n * Headless REST helpers — same paths the shell uses.\n * Call session.init before other methods when not mounting <web-chat>.\n */\n\nimport {\n fetchConversationsPage,\n fetchConversationDetails,\n sortConversationsByLatestMessage,\n mergeUniqueConversations,\n fetchMessagesPage,\n markConversationRead,\n mergeMessagesById,\n searchMessages,\n fetchLinkMessages,\n fetchMediaCount,\n fetchMediaAttachments,\n filterMediaMessages,\n initializeChatSdk,\n fetchUserDetails,\n fetchGroupcastDetails,\n fetchGroupcastMembersPage,\n fetchGroupcastContactsPage,\n mediaTypeFromMime,\n customTypeFromMime,\n prepareMediaAttachments,\n buildReplyMetaData,\n type ChatSdkInitConfig,\n} from '../lib/chat';\n\nexport const isometrikWebchatApi = {\n session: {\n init: (config: ChatSdkInitConfig) => initializeChatSdk(config),\n fetchUserDetails,\n },\n conversations: {\n list: fetchConversationsPage,\n details: fetchConversationDetails,\n sortByLatest: sortConversationsByLatestMessage,\n mergeUnique: mergeUniqueConversations,\n },\n messages: {\n list: fetchMessagesPage,\n markRead: markConversationRead,\n mergeById: mergeMessagesById,\n search: searchMessages,\n links: fetchLinkMessages,\n mediaCount: fetchMediaCount,\n mediaAttachments: fetchMediaAttachments,\n filterMedia: filterMediaMessages,\n },\n groupcast: {\n details: fetchGroupcastDetails,\n members: fetchGroupcastMembersPage,\n contacts: fetchGroupcastContactsPage,\n },\n media: {\n mediaTypeFromMime,\n customTypeFromMime,\n prepareMediaAttachments,\n buildReplyMetaData,\n },\n};\n\nexport type IsometrikWebchatApi = typeof isometrikWebchatApi;\n","/**\n * React → WebChat bridge (no React dependency in this package).\n *\n * Hosts pass their own `createElement` + `createRoot` so the core SDK stays\n * framework-agnostic.\n *\n * 1) Panels (slots): mountReactInSlot → HTMLElement for `slots['profile-rail']`\n * 2) Rows/overlays (customParts): defineReactCustomPart → CE tag for customParts\n */\n\nimport type { WebChatSlotName } from '../lib/custom-ui';\nimport { createSlotHost } from './slots';\n\nexport type ReactLike = {\n createElement: (type: any, props: any, ...children: any[]) => any;\n};\n\nexport type ReactRootLike = {\n render: (node: any) => void;\n unmount: () => void;\n};\n\nexport type CreateRootLike = (container: Element) => ReactRootLike;\n\ntype BridgeRootStore = {\n root: ReactRootLike;\n Component: any;\n extraProps?: Record<string, unknown>;\n};\n\nconst ROOT_KEY = '__isometrikReactBridge';\n\nfunction paint(store: BridgeRootStore, react: ReactLike, propsFromHost: Record<string, unknown>) {\n store.root.render(\n react.createElement(store.Component, {\n ...(store.extraProps || {}),\n ...propsFromHost,\n }),\n );\n}\n\n/**\n * Wrap a React component as a custom element for `customParts`.\n * SDK assigns props (conversation, onSelect, …); we re-render React.\n *\n * @example\n * import { createElement } from 'react';\n * import { createRoot } from 'react-dom/client';\n * defineReactCustomPart('app-chat-tile', MyTile, {\n * react: { createElement },\n * createRoot,\n * propKeys: ['conversation', 'isSelected', 'unreadCount', 'previewText', 'onSelect'],\n * });\n * initializeIsometrikWebchat({ customParts: { chatTile: 'app-chat-tile' }, … });\n */\nexport function defineReactCustomPart(\n tag: string,\n Component: any,\n opts: {\n react: ReactLike;\n createRoot: CreateRootLike;\n /** Prop names the SDK writes on the CE (see lib/custom-ui/contracts.ts). */\n propKeys: string[];\n /** Static props merged into every render. */\n extraProps?: Record<string, unknown>;\n },\n): string {\n if (typeof customElements === 'undefined') return tag;\n if (customElements.get(tag)) return tag;\n\n const { react, createRoot, propKeys, extraProps } = opts;\n\n class ReactPart extends HTMLElement {\n private _store: BridgeRootStore | null = null;\n\n connectedCallback() {\n if (!this._store) {\n this._store = { root: createRoot(this), Component, extraProps };\n }\n this.render();\n }\n\n disconnectedCallback() {\n try {\n this._store?.root.unmount();\n } catch {\n /* unmount is best-effort */\n }\n this._store = null;\n }\n\n /** Called by applyCustomPartProps after Object.assign. */\n render() {\n if (!this._store || !this.isConnected) return;\n const fromSetters: Record<string, unknown> = {};\n propKeys.forEach(key => {\n fromSetters[key] = (this as any)[`_${key}`];\n });\n paint(this._store, react, fromSetters);\n }\n }\n\n propKeys.forEach(key => {\n const store = `_${key}`;\n Object.defineProperty(ReactPart.prototype, key, {\n get() {\n return (this as any)[store];\n },\n set(value) {\n if ((this as any)[store] === value) return;\n (this as any)[store] = value;\n if (this.isConnected) (this as HTMLElement & { render: () => void }).render();\n },\n configurable: true,\n });\n });\n\n customElements.define(tag, ReactPart);\n return tag;\n}\n\nexport type ReactSlotHost = HTMLElement & {\n updateProps: (props: Record<string, unknown>) => void;\n unmount: () => void;\n};\n\n/**\n * Mount a React component into a slot host for panel overrides.\n * Pass the returned element in `slots: { 'profile-rail': el }`.\n *\n * @example\n * const rail = mountReactInSlot('profile-rail', MyProfileRail, {\n * react: { createElement },\n * createRoot,\n * props: { userId: '…' },\n * });\n * initializeIsometrikWebchat({ slots: { 'profile-rail': rail }, … });\n * // later: rail.updateProps({ badge: 3 }); rail.unmount();\n */\nexport function mountReactInSlot(\n slotName: WebChatSlotName,\n Component: any,\n opts: {\n react: ReactLike;\n createRoot: CreateRootLike;\n props?: Record<string, unknown>;\n className?: string;\n },\n): ReactSlotHost {\n const host = createSlotHost(slotName, opts.className) as ReactSlotHost;\n // display:contents can break React roots — use block for React mounts.\n host.style.display = 'block';\n host.style.height = '100%';\n\n const store: BridgeRootStore = {\n root: opts.createRoot(host),\n Component,\n extraProps: opts.props,\n };\n (host as any)[ROOT_KEY] = store;\n paint(store, opts.react, {});\n\n host.updateProps = (next: Record<string, unknown>) => {\n store.extraProps = { ...(store.extraProps || {}), ...next };\n paint(store, opts.react, {});\n };\n host.unmount = () => {\n try {\n store.root.unmount();\n } catch {\n /* ignore */\n }\n delete (host as any)[ROOT_KEY];\n };\n return host;\n}\n\nexport function unmountReactSlot(host: HTMLElement | null | undefined): void {\n if (!host) return;\n const anyHost = host as ReactSlotHost;\n if (typeof anyHost.unmount === 'function') {\n anyHost.unmount();\n return;\n }\n const store = (host as any)[ROOT_KEY] as BridgeRootStore | undefined;\n if (!store) return;\n try {\n store.root.unmount();\n } catch {\n /* ignore */\n }\n delete (host as any)[ROOT_KEY];\n}\n","/**\n * Theme / sidebar controls — instance-first (no bare querySelector in happy path).\n */\n\nimport { normalizeThemeObject } from './theme-tokens';\nimport { resolveThemeProvider, resolveWebChat } from './instance';\n\nexport function customChatSidebar(\n props: { isChatFilter?: boolean },\n from?: Element | null,\n): void {\n const chatComponent = resolveWebChat(from) as any;\n if (!chatComponent) {\n console.error('Isometrik chat is not initialized');\n return;\n }\n if (props.isChatFilter !== undefined) {\n chatComponent.isChatFilter = props.isChatFilter;\n }\n}\n\nexport function switchChatTheme(theme: 'dark' | 'light', from?: Element | null): void {\n const themeProvider = resolveThemeProvider(from) as any;\n const chat = resolveWebChat(from) as any;\n\n if (chat) {\n chat.defaultTheme = theme;\n }\n if (themeProvider) {\n themeProvider.setAttribute('mode', theme);\n if (typeof themeProvider.setTheme === 'function') {\n themeProvider.setTheme(theme);\n }\n return;\n }\n console.error('Theme provider is not initialized');\n}\n\nexport function applyCustomTheme(\n customTheme: {\n themePath?: string;\n themeObject?: { [key: string]: string };\n },\n from?: Element | null,\n): void {\n const themeProvider = resolveThemeProvider(from) as any;\n if (!themeProvider) {\n console.error('Theme provider is not initialized');\n return;\n }\n\n if (customTheme.themePath) {\n themeProvider.setAttribute('theme-path', customTheme.themePath);\n }\n\n if (customTheme.themeObject) {\n themeProvider.themeObject = normalizeThemeObject(customTheme.themeObject);\n }\n}\n\nexport function toggleTheme(from?: Element | null): void {\n const themeProvider = resolveThemeProvider(from) as any;\n if (!themeProvider) {\n console.error('Theme provider is not initialized');\n return;\n }\n if (typeof themeProvider.toggleTheme === 'function') {\n themeProvider.toggleTheme();\n }\n}\n"],"version":3}