isometrik-plugin-chat-sdk 2.0.5 → 2.0.8

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 (282) hide show
  1. package/dist/cjs/admin-transfer-dialog.cjs.entry.js +44 -0
  2. package/dist/cjs/admin-transfer-dialog.cjs.entry.js.map +1 -0
  3. package/dist/cjs/{app-globals-dba84d07.js → app-globals-c433d8a6.js} +2 -2
  4. package/dist/cjs/{app-globals-dba84d07.js.map → app-globals-c433d8a6.js.map} +1 -1
  5. package/dist/cjs/attachment-preview_22.cjs.entry.js +201 -61
  6. package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
  7. package/dist/cjs/audio-bubble_4.cjs.entry.js +9 -9
  8. package/dist/cjs/chat-app.cjs.entry.js +1 -1
  9. package/dist/cjs/chat-document-message-bubble.cjs.entry.js +1 -1
  10. package/dist/cjs/chat-image-message-bubble.cjs.entry.js +1 -1
  11. package/dist/cjs/chat-video-message-bubble.cjs.entry.js +1 -1
  12. package/dist/cjs/delete-message.cjs.entry.js +1 -1
  13. package/dist/cjs/{drawer-811d2ce8.js → drawer-960b3f5d.js} +3 -1
  14. package/dist/cjs/drawer-960b3f5d.js.map +1 -0
  15. package/dist/cjs/forward-memebers.cjs.entry.js +3 -3
  16. package/dist/cjs/forward-message.cjs.entry.js +2 -2
  17. package/dist/cjs/group-admin-leave-b5cfdb33.js +55 -0
  18. package/dist/cjs/group-admin-leave-b5cfdb33.js.map +1 -0
  19. package/dist/cjs/index.cjs.js +2 -2
  20. package/dist/cjs/isometrik-webchat.cjs.js +4 -4
  21. package/dist/cjs/link-preview.cjs.entry.js +1 -1
  22. package/dist/cjs/loader.cjs.js +4 -4
  23. package/dist/cjs/login-page_3.cjs.entry.js +30 -11
  24. package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
  25. package/dist/cjs/member-add.cjs.entry.js +4 -4
  26. package/dist/cjs/message-bubble.cjs.entry.js +2 -2
  27. package/dist/cjs/my-component.cjs.entry.js +1 -1
  28. package/dist/cjs/{profile-avatar_2.cjs.entry.js → profile-avatar.cjs.entry.js} +1 -25
  29. package/dist/cjs/profile-avatar.cjs.entry.js.map +1 -0
  30. package/dist/cjs/reaction-container.cjs.entry.js +2 -2
  31. package/dist/cjs/{runtime-controls-b5a3836e.js → runtime-controls-95f6cb3b.js} +4 -2
  32. package/dist/cjs/runtime-controls-95f6cb3b.js.map +1 -0
  33. package/dist/cjs/{send-media-2c02bba7.js → send-media-37e09e83.js} +39 -1
  34. package/dist/cjs/send-media-37e09e83.js.map +1 -0
  35. package/dist/cjs/share-popup.cjs.entry.js +1 -1
  36. package/dist/cjs/spinner-loader.cjs.entry.js +32 -0
  37. package/dist/cjs/spinner-loader.cjs.entry.js.map +1 -0
  38. package/dist/collection/collection-manifest.json +1 -0
  39. package/dist/collection/components/ChatUIComponent/AddMember.js +3 -3
  40. package/dist/collection/components/ChatUIComponent/ChatDocumentMessageBubble.js +1 -1
  41. package/dist/collection/components/ChatUIComponent/ChatImageMessageBubble.js +1 -1
  42. package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +20 -0
  43. package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
  44. package/dist/collection/components/ChatUIComponent/ChatVideoMessageBubble.js +1 -1
  45. package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +1 -1
  46. package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +41 -8
  47. package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -1
  48. package/dist/collection/components/ChatUIComponent/ReactionContainer.js +2 -2
  49. package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +44 -23
  50. package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
  51. package/dist/collection/components/ChatUIComponent/shared/AudioBubble/AudioBubble.js +3 -3
  52. package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js +2 -2
  53. package/dist/collection/components/ChatUIComponent/shared/admin-transfer-dialog/admin-transfer-dialog.js +101 -0
  54. package/dist/collection/components/ChatUIComponent/shared/admin-transfer-dialog/admin-transfer-dialog.js.map +1 -0
  55. package/dist/collection/components/ChatUIComponent/shared/attachment-preview/attachment-preview.js +1 -1
  56. package/dist/collection/components/ChatUIComponent/shared/block chatlist/BlockChatList.js +1 -1
  57. package/dist/collection/components/ChatUIComponent/shared/chat-loading-placeholder/chat-loading-placeholder.js +1 -1
  58. package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +20 -5
  59. package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
  60. package/dist/collection/components/ChatUIComponent/shared/delete-message/delete-message.js +1 -1
  61. package/dist/collection/components/ChatUIComponent/shared/document-message/document-message.js +3 -3
  62. package/dist/collection/components/ChatUIComponent/shared/forward-message/forward-message.js +2 -2
  63. package/dist/collection/components/ChatUIComponent/shared/image-message/image-message.js +1 -1
  64. package/dist/collection/components/ChatUIComponent/shared/incoming-text-message-bubble/incoming-text-message-bubble.js +1 -1
  65. package/dist/collection/components/ChatUIComponent/shared/index.js +1 -0
  66. package/dist/collection/components/ChatUIComponent/shared/index.js.map +1 -1
  67. package/dist/collection/components/ChatUIComponent/shared/link-preview/link-preview.js +1 -1
  68. package/dist/collection/components/ChatUIComponent/shared/message-bubble/message-bubble.js +2 -2
  69. package/dist/collection/components/ChatUIComponent/shared/message-date-pill/message-date-pill.js +1 -1
  70. package/dist/collection/components/ChatUIComponent/shared/message-info/message-info.js +1 -1
  71. package/dist/collection/components/ChatUIComponent/shared/message-search/message-search.js +1 -1
  72. package/dist/collection/components/ChatUIComponent/shared/outgoing-text-message-bubble/outgoing-text-message-bubble.js +1 -1
  73. package/dist/collection/components/ChatUIComponent/shared/profile sidebar/profile-sidebar.js +1 -1
  74. package/dist/collection/components/ChatUIComponent/shared/profile-info/profile-info.js +2 -2
  75. package/dist/collection/components/ChatUIComponent/shared/reply-block/reply-block.js +1 -1
  76. package/dist/collection/components/ChatUIComponent/shared/reply-message-container/reply-message-container.js +1 -1
  77. package/dist/collection/components/ChatUIComponent/shared/share-popup/share-popup.js +1 -1
  78. package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js +2 -2
  79. package/dist/collection/components/chat-main.js +1 -1
  80. package/dist/collection/components/my-component/my-component.js +1 -1
  81. package/dist/collection/components/my-component/web-chat/event-handlers.js +5 -0
  82. package/dist/collection/components/my-component/web-chat/event-handlers.js.map +1 -1
  83. package/dist/collection/components/my-component/web-chat/mqtt-host.js +24 -9
  84. package/dist/collection/components/my-component/web-chat/mqtt-host.js.map +1 -1
  85. package/dist/collection/lib/chat/index.js +1 -1
  86. package/dist/collection/lib/chat/index.js.map +1 -1
  87. package/dist/collection/lib/chat/messages.js +36 -0
  88. package/dist/collection/lib/chat/messages.js.map +1 -1
  89. package/dist/collection/lib/drawer.js +3 -0
  90. package/dist/collection/lib/drawer.js.map +1 -1
  91. package/dist/collection/lib/group-admin-leave.js +47 -0
  92. package/dist/collection/lib/group-admin-leave.js.map +1 -0
  93. package/dist/collection/lib/prompt-exit-group.js +59 -0
  94. package/dist/collection/lib/prompt-exit-group.js.map +1 -0
  95. package/dist/collection/sdk/headless-api.js +3 -1
  96. package/dist/collection/sdk/headless-api.js.map +1 -1
  97. package/dist/components/AudioBubble.js +3 -3
  98. package/dist/components/BlockChatList.js +1 -1
  99. package/dist/components/ChatFooter.js +1 -1
  100. package/dist/components/ChatSidebar.js +21 -1
  101. package/dist/components/ChatSidebar.js.map +1 -1
  102. package/dist/components/WebChat.js +32 -13
  103. package/dist/components/WebChat.js.map +1 -1
  104. package/dist/components/WebChatBody.js +44 -23
  105. package/dist/components/WebChatBody.js.map +1 -1
  106. package/dist/components/WebChatHeader.js +42 -9
  107. package/dist/components/WebChatHeader.js.map +1 -1
  108. package/dist/components/WebchatRightSide.js +4 -35
  109. package/dist/components/WebchatRightSide.js.map +1 -1
  110. package/dist/components/admin-transfer-dialog.d.ts +11 -0
  111. package/dist/components/admin-transfer-dialog.js +69 -0
  112. package/dist/components/admin-transfer-dialog.js.map +1 -0
  113. package/dist/components/attachment-preview2.js +1 -1
  114. package/dist/components/chat-app.js +1 -1
  115. package/dist/components/chat-document-message-bubble.js +1 -1
  116. package/dist/components/chat-image-message-bubble.js +1 -1
  117. package/dist/components/chat-loading-placeholder2.js +1 -1
  118. package/dist/components/chat-video-message-bubble.js +1 -1
  119. package/dist/components/contact-info2.js +22 -6
  120. package/dist/components/contact-info2.js.map +1 -1
  121. package/dist/components/conversation.js +2 -283
  122. package/dist/components/conversation.js.map +1 -1
  123. package/dist/components/delete-message.js +1 -1
  124. package/dist/components/document-message2.js +3 -3
  125. package/dist/components/drawer.js +2 -0
  126. package/dist/components/drawer.js.map +1 -1
  127. package/dist/components/forward-memebers.js +2 -2
  128. package/dist/components/forward-message.js +2 -2
  129. package/dist/components/group-admin-leave.js +50 -0
  130. package/dist/components/group-admin-leave.js.map +1 -0
  131. package/dist/components/group-members.js +298 -26
  132. package/dist/components/group-members.js.map +1 -1
  133. package/dist/components/group-members2.js +37 -0
  134. package/dist/components/group-members2.js.map +1 -0
  135. package/dist/components/image-message2.js +1 -1
  136. package/dist/components/incoming-text-message-bubble2.js +1 -1
  137. package/dist/components/index.js +3 -1
  138. package/dist/components/index.js.map +1 -1
  139. package/dist/components/link-preview2.js +1 -1
  140. package/dist/components/member-add.js +4 -4
  141. package/dist/components/message-bubble2.js +2 -2
  142. package/dist/components/message-date-pill2.js +1 -1
  143. package/dist/components/message-info2.js +1 -1
  144. package/dist/components/message-search2.js +1 -1
  145. package/dist/components/messages.js +37 -1
  146. package/dist/components/messages.js.map +1 -1
  147. package/dist/components/my-component.js +1 -1
  148. package/dist/components/outgoing-text-message-bubble2.js +1 -1
  149. package/dist/components/profile-info2.js +2 -2
  150. package/dist/components/profile-sidebar2.js +1 -1
  151. package/dist/components/prompt-exit-group.js +73 -0
  152. package/dist/components/prompt-exit-group.js.map +1 -0
  153. package/dist/components/reaction-container.js +2 -2
  154. package/dist/components/reply-block2.js +1 -1
  155. package/dist/components/reply-message-container2.js +1 -1
  156. package/dist/components/share-popup.js +1 -1
  157. package/dist/components/video-message2.js +2 -2
  158. package/dist/esm/admin-transfer-dialog.entry.js +40 -0
  159. package/dist/esm/admin-transfer-dialog.entry.js.map +1 -0
  160. package/dist/esm/{app-globals-8fea092d.js → app-globals-dfce8a5b.js} +2 -2
  161. package/dist/esm/{app-globals-8fea092d.js.map → app-globals-dfce8a5b.js.map} +1 -1
  162. package/dist/esm/attachment-preview_22.entry.js +202 -62
  163. package/dist/esm/attachment-preview_22.entry.js.map +1 -1
  164. package/dist/esm/audio-bubble_4.entry.js +9 -9
  165. package/dist/esm/chat-app.entry.js +1 -1
  166. package/dist/esm/chat-document-message-bubble.entry.js +1 -1
  167. package/dist/esm/chat-image-message-bubble.entry.js +1 -1
  168. package/dist/esm/chat-video-message-bubble.entry.js +1 -1
  169. package/dist/esm/delete-message.entry.js +1 -1
  170. package/dist/esm/{drawer-74c188f1.js → drawer-d54c2f10.js} +3 -1
  171. package/dist/esm/drawer-d54c2f10.js.map +1 -0
  172. package/dist/esm/forward-memebers.entry.js +3 -3
  173. package/dist/esm/forward-message.entry.js +2 -2
  174. package/dist/esm/group-admin-leave-a60b9b1a.js +50 -0
  175. package/dist/esm/group-admin-leave-a60b9b1a.js.map +1 -0
  176. package/dist/esm/index.js +3 -3
  177. package/dist/esm/isometrik-webchat.js +4 -4
  178. package/dist/esm/link-preview.entry.js +1 -1
  179. package/dist/esm/loader.js +4 -4
  180. package/dist/esm/login-page_3.entry.js +30 -11
  181. package/dist/esm/login-page_3.entry.js.map +1 -1
  182. package/dist/esm/member-add.entry.js +4 -4
  183. package/dist/esm/message-bubble.entry.js +2 -2
  184. package/dist/esm/my-component.entry.js +1 -1
  185. package/dist/esm/{profile-avatar_2.entry.js → profile-avatar.entry.js} +2 -25
  186. package/dist/esm/profile-avatar.entry.js.map +1 -0
  187. package/dist/esm/reaction-container.entry.js +2 -2
  188. package/dist/esm/{runtime-controls-c5ba5009.js → runtime-controls-ec6d5c75.js} +4 -2
  189. package/dist/esm/runtime-controls-ec6d5c75.js.map +1 -0
  190. package/dist/esm/{send-media-588837c7.js → send-media-a946c6dd.js} +38 -2
  191. package/dist/esm/send-media-a946c6dd.js.map +1 -0
  192. package/dist/esm/share-popup.entry.js +1 -1
  193. package/dist/esm/spinner-loader.entry.js +28 -0
  194. package/dist/esm/spinner-loader.entry.js.map +1 -0
  195. package/dist/isometrik-webchat/index.esm.js +1 -1
  196. package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
  197. package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -1
  198. package/dist/isometrik-webchat/{p-a876991d.entry.js → p-0ccfbe90.entry.js} +2 -2
  199. package/dist/isometrik-webchat/{p-1854b156.entry.js → p-161fcb35.entry.js} +2 -2
  200. package/dist/isometrik-webchat/{p-a43ad157.entry.js → p-1eecc7c5.entry.js} +2 -2
  201. package/dist/isometrik-webchat/{p-fdd327f5.entry.js → p-2195b0c0.entry.js} +2 -2
  202. package/dist/isometrik-webchat/p-2e9974e1.entry.js +2 -0
  203. package/dist/isometrik-webchat/p-30dc94e0.js +2 -0
  204. package/dist/isometrik-webchat/p-30dc94e0.js.map +1 -0
  205. package/dist/isometrik-webchat/p-35d9ecdc.entry.js +2 -0
  206. package/dist/isometrik-webchat/p-35d9ecdc.entry.js.map +1 -0
  207. package/dist/isometrik-webchat/{p-c1e8c38e.entry.js → p-3664e0ad.entry.js} +2 -2
  208. package/dist/isometrik-webchat/p-3f355f9e.js +2 -0
  209. package/dist/isometrik-webchat/p-3f355f9e.js.map +1 -0
  210. package/dist/isometrik-webchat/p-46dcd38f.js +2 -0
  211. package/dist/isometrik-webchat/p-46dcd38f.js.map +1 -0
  212. package/dist/isometrik-webchat/p-46e0048e.js +2 -0
  213. package/dist/isometrik-webchat/p-46e0048e.js.map +1 -0
  214. package/dist/isometrik-webchat/p-48ce4dca.entry.js +2 -0
  215. package/dist/isometrik-webchat/{p-d720cf14.entry.js → p-76341adb.entry.js} +2 -2
  216. package/dist/isometrik-webchat/{p-2d3e8cd4.entry.js → p-7af9a7f3.entry.js} +2 -2
  217. package/dist/isometrik-webchat/p-7b25f234.entry.js +2 -0
  218. package/dist/isometrik-webchat/p-7b25f234.entry.js.map +1 -0
  219. package/dist/isometrik-webchat/p-86be30fe.js +2 -0
  220. package/dist/isometrik-webchat/p-9db196a4.entry.js +2 -0
  221. package/dist/isometrik-webchat/p-9db196a4.entry.js.map +1 -0
  222. package/dist/isometrik-webchat/p-a119be75.entry.js +2 -0
  223. package/dist/isometrik-webchat/p-a119be75.entry.js.map +1 -0
  224. package/dist/isometrik-webchat/p-ad02a8ca.entry.js +2 -0
  225. package/dist/isometrik-webchat/p-c5bff6a1.entry.js +2 -0
  226. package/dist/isometrik-webchat/p-c5bff6a1.entry.js.map +1 -0
  227. package/dist/isometrik-webchat/p-c83e2d5d.entry.js +2 -0
  228. package/dist/isometrik-webchat/{p-fb705915.entry.js → p-cc5b86e6.entry.js} +2 -2
  229. package/dist/isometrik-webchat/{p-f1fbf3be.entry.js → p-d8b65cf4.entry.js} +2 -2
  230. package/dist/isometrik-webchat/p-e48a1217.entry.js +2 -0
  231. package/dist/types/components/ChatUIComponent/Header/WebChatHeader.d.ts +1 -0
  232. package/dist/types/components/ChatUIComponent/shared/admin-transfer-dialog/admin-transfer-dialog.d.ts +13 -0
  233. package/dist/types/components/ChatUIComponent/shared/contact-info/contact-info.d.ts +1 -0
  234. package/dist/types/components/ChatUIComponent/shared/index.d.ts +1 -0
  235. package/dist/types/components.d.ts +27 -0
  236. package/dist/types/lib/chat/index.d.ts +1 -1
  237. package/dist/types/lib/drawer.d.ts +1 -0
  238. package/dist/types/lib/group-admin-leave.d.ts +20 -0
  239. package/dist/types/lib/prompt-exit-group.d.ts +9 -0
  240. package/dist/types/sdk/headless-api.d.ts +3 -1
  241. package/package.json +1 -1
  242. package/dist/cjs/drawer-811d2ce8.js.map +0 -1
  243. package/dist/cjs/profile-avatar_2.cjs.entry.js.map +0 -1
  244. package/dist/cjs/runtime-controls-b5a3836e.js.map +0 -1
  245. package/dist/cjs/send-media-2c02bba7.js.map +0 -1
  246. package/dist/esm/drawer-74c188f1.js.map +0 -1
  247. package/dist/esm/profile-avatar_2.entry.js.map +0 -1
  248. package/dist/esm/runtime-controls-c5ba5009.js.map +0 -1
  249. package/dist/esm/send-media-588837c7.js.map +0 -1
  250. package/dist/isometrik-webchat/p-0392c7be.entry.js +0 -2
  251. package/dist/isometrik-webchat/p-1a6e6524.js +0 -2
  252. package/dist/isometrik-webchat/p-1a6e6524.js.map +0 -1
  253. package/dist/isometrik-webchat/p-3c70c22c.entry.js +0 -2
  254. package/dist/isometrik-webchat/p-5d243250.entry.js +0 -2
  255. package/dist/isometrik-webchat/p-70f66001.js +0 -2
  256. package/dist/isometrik-webchat/p-70f66001.js.map +0 -1
  257. package/dist/isometrik-webchat/p-8816acc1.js +0 -2
  258. package/dist/isometrik-webchat/p-92eec03b.entry.js +0 -2
  259. package/dist/isometrik-webchat/p-92eec03b.entry.js.map +0 -1
  260. package/dist/isometrik-webchat/p-b16c3db0.entry.js +0 -2
  261. package/dist/isometrik-webchat/p-b16c3db0.entry.js.map +0 -1
  262. package/dist/isometrik-webchat/p-b857775d.entry.js +0 -2
  263. package/dist/isometrik-webchat/p-c0c19621.entry.js +0 -2
  264. package/dist/isometrik-webchat/p-dd62bd69.js +0 -2
  265. package/dist/isometrik-webchat/p-dd62bd69.js.map +0 -1
  266. package/dist/isometrik-webchat/p-ed4699a0.entry.js +0 -2
  267. package/dist/isometrik-webchat/p-ed4699a0.entry.js.map +0 -1
  268. /package/dist/isometrik-webchat/{p-a876991d.entry.js.map → p-0ccfbe90.entry.js.map} +0 -0
  269. /package/dist/isometrik-webchat/{p-1854b156.entry.js.map → p-161fcb35.entry.js.map} +0 -0
  270. /package/dist/isometrik-webchat/{p-a43ad157.entry.js.map → p-1eecc7c5.entry.js.map} +0 -0
  271. /package/dist/isometrik-webchat/{p-fdd327f5.entry.js.map → p-2195b0c0.entry.js.map} +0 -0
  272. /package/dist/isometrik-webchat/{p-3c70c22c.entry.js.map → p-2e9974e1.entry.js.map} +0 -0
  273. /package/dist/isometrik-webchat/{p-c1e8c38e.entry.js.map → p-3664e0ad.entry.js.map} +0 -0
  274. /package/dist/isometrik-webchat/{p-b857775d.entry.js.map → p-48ce4dca.entry.js.map} +0 -0
  275. /package/dist/isometrik-webchat/{p-d720cf14.entry.js.map → p-76341adb.entry.js.map} +0 -0
  276. /package/dist/isometrik-webchat/{p-2d3e8cd4.entry.js.map → p-7af9a7f3.entry.js.map} +0 -0
  277. /package/dist/isometrik-webchat/{p-8816acc1.js.map → p-86be30fe.js.map} +0 -0
  278. /package/dist/isometrik-webchat/{p-5d243250.entry.js.map → p-ad02a8ca.entry.js.map} +0 -0
  279. /package/dist/isometrik-webchat/{p-c0c19621.entry.js.map → p-c83e2d5d.entry.js.map} +0 -0
  280. /package/dist/isometrik-webchat/{p-fb705915.entry.js.map → p-cc5b86e6.entry.js.map} +0 -0
  281. /package/dist/isometrik-webchat/{p-f1fbf3be.entry.js.map → p-d8b65cf4.entry.js.map} +0 -0
  282. /package/dist/isometrik-webchat/{p-0392c7be.entry.js.map → p-e48a1217.entry.js.map} +0 -0
@@ -3173,7 +3173,7 @@ const AudioBubble = class {
3173
3173
  }
3174
3174
  render() {
3175
3175
  const isLive = this.liveRecord;
3176
- return (h("div", { key: 'fcf59ce63746eac2c6b7bc88cd7a7e50e97fad4b', style: {
3176
+ return (h("div", { key: '670b82c67119d4d4c74867a94b4737c16dd8cf57', style: {
3177
3177
  background: isLive ? 'transparent' : this.bgColor || (this.isSelf ? 'var(--bg-outgoing-message)' : 'var(--bg-incoming-message)'),
3178
3178
  borderRadius: isLive ? '0' : this.borderRadius || '7.5px',
3179
3179
  color: this.textColor || 'inherit',
@@ -3181,13 +3181,13 @@ const AudioBubble = class {
3181
3181
  width: isLive ? '100%' : '336px',
3182
3182
  maxWidth: '100%',
3183
3183
  boxSizing: 'border-box',
3184
- } }, h("div", { key: '5d5c18d89fa32e40dfbdb8a04e38a00825fd74c4', style: { display: 'flex', alignItems: 'center', gap: isLive ? '0' : '10px', width: '100%' } }, isLive ? null : (h("button", { type: "button", "aria-label": this.isPlaying ? 'Pause' : 'Play', style: {
3184
+ } }, h("div", { key: 'b797e83c979987e4d1d616cfc1507bb5cf177333', style: { display: 'flex', alignItems: 'center', gap: isLive ? '0' : '10px', width: '100%' } }, isLive ? null : (h("button", { type: "button", "aria-label": this.isPlaying ? 'Pause' : 'Play', style: {
3185
3185
  border: 'none',
3186
3186
  background: 'transparent',
3187
3187
  cursor: 'pointer',
3188
3188
  fontSize: '18px',
3189
3189
  color: 'inherit',
3190
- }, onClick: () => (this.isPlaying ? this.pauseAudioHandler() : this.playAudioHandler()) }, this.isPlaying ? '❚❚' : '▶')), h("div", { key: 'e2b865bfc959a3cbd2493e84946867ad1aea045f', class: "wave-host", ref: el => {
3190
+ }, onClick: () => (this.isPlaying ? this.pauseAudioHandler() : this.playAudioHandler()) }, this.isPlaying ? '❚❚' : '▶')), h("div", { key: '8f0dc7991e61e5f534dff91d6c54e31d6287197b', class: "wave-host", ref: el => {
3191
3191
  this.waveformContainer = el;
3192
3192
  }, style: { flex: '1', height: isLive ? '28px' : '40px', minHeight: isLive ? '28px' : '40px', minWidth: '0' } })), isLive ? null : (h("div", { style: { display: 'flex', justifyContent: 'space-between', fontSize: '10px', marginTop: '4px' } }, h("span", null, this.audioDuration), this.showFooter ? (h("span", { style: { color: this.timeColor } }, this.time
3193
3193
  ? (() => {
@@ -3304,13 +3304,13 @@ const DocumentMessage = class {
3304
3304
  const parts = this.truncateDocName(this.docName || 'Document');
3305
3305
  const showCaption = this.message && !String(this.message).includes('AttachmentMessage:');
3306
3306
  const pdf = this.isPdf();
3307
- return (h("message-bubble", { key: '03f7d4227659a8f89c6e271cf350d6142b3a31cc', isSelf: !!this.isSelf, time: this.time, timeColor: this.timeColor, isRead: this.isRead, isDelivered: this.isDelivered, deliveryStatus: this.deliveryStatus, reactions: this.reactions, messageId: this.messageId, userMetaData: this.userMetaData, isForwarded: this.messageType === 1, backgroundColor: this.bgColor || 'var(--bg-secondary)', borderRadius: this.borderRadius || '6px', padding: this.padding || '10px', showReactionOnHover: this.showReactionOnHover }, h("div", { key: 'f4670abea7b3d0cdba79089e28a4344241920add', class: "doc-container", style: {
3307
+ return (h("message-bubble", { key: 'b6ace1cd0668f471bf64d89d3d7861955411c8ec', isSelf: !!this.isSelf, time: this.time, timeColor: this.timeColor, isRead: this.isRead, isDelivered: this.isDelivered, deliveryStatus: this.deliveryStatus, reactions: this.reactions, messageId: this.messageId, userMetaData: this.userMetaData, isForwarded: this.messageType === 1, backgroundColor: this.bgColor || 'var(--bg-secondary)', borderRadius: this.borderRadius || '6px', padding: this.padding || '10px', showReactionOnHover: this.showReactionOnHover }, h("div", { key: '96fefa9df08407f2df4be3b72af9dbf5873fe928', class: "doc-container", style: {
3308
3308
  backgroundColor: this.documentNameBg || 'var(--bg-tertiary)',
3309
3309
  width: this.width || 'auto',
3310
- } }, h("div", { key: 'a6b1bf6e7354be014c2ee122a616b8bf13c7f4dd', class: "document-name", style: { padding: this.documentNamePadding || '5px 10px 5px 0' }, onClick: this.openPreview, role: "button", tabIndex: 0, onKeyDown: (ev) => {
3310
+ } }, h("div", { key: 'e3c866721409745fe12168f5ae0fa53a31527b3b', class: "document-name", style: { padding: this.documentNamePadding || '5px 10px 5px 0' }, onClick: this.openPreview, role: "button", tabIndex: 0, onKeyDown: (ev) => {
3311
3311
  if (ev.key === 'Enter' || ev.key === ' ')
3312
3312
  this.openPreview(ev);
3313
- } }, h("span", { key: '0b4bd6d477243d58ec6528b1dda002d4c6f35f7d', class: "attachment-icon" }, h("img", { key: 'e3abbceeccbf3b68fbc6a6aade9307c9c0e06d81', src: this.iconSrc(), alt: "" })), h("span", { key: 'cb1532204f8ded8014805787cae84c4ec546bab0' }, parts.firstLine, h("br", { key: 'ab5957a89a9649645c8bb4ff408eb04a2876a755' }), parts.secondLine)), h("div", { key: 'a27aeb926e96aea8a7d003b67d78dae89c6c9321', class: "doc-actions" }, pdf && this.href ? (h("button", { class: "preview-btn", type: "button", onClick: this.openPreview, "aria-label": "Preview PDF" }, "View")) : null, h("a", { key: '39c6ff0165141c0d7c408c5ab48e0d623cd38b13', class: "download-btn", href: this.href, download: this.fileName, target: "_blank", rel: "noopener noreferrer", "aria-label": "Download" }, h("img", { key: '54f1f58c40c80855a029b4d552eaa2de161e7a12', src: DownloadIcon, alt: "" })))), showCaption ? (h("div", { style: { fontSize: '8px', color: this.textColor, marginTop: '4px' } }, renderMessageBody(this.message, this.mentionedUsers, u => emitTagUser(this.tagUserClick, u), !!this.isSelf))) : null, this.showPdfPreview && this.href ? (h("div", { class: "pdf-lightbox", onClick: this.closePreview }, h("div", { class: "pdf-lightbox-bar", onClick: e => e.stopPropagation() }, h("span", { class: "pdf-lightbox-title" }, this.docName || this.fileName || 'PDF'), h("div", { style: { display: 'flex', gap: '8px' } }, h("a", { href: this.href, download: this.fileName || this.docName, target: "_blank", rel: "noopener noreferrer", style: { color: '#fff', fontSize: '12px', fontWeight: '600', textDecoration: 'none', padding: '6px 12px', background: 'rgba(255,255,255,0.15)', borderRadius: '8px' } }, "Download"), h("button", { type: "button", onClick: this.closePreview }, "Close"))), h("iframe", { src: `${this.href}#toolbar=1`, title: this.docName || 'PDF preview', onClick: e => e.stopPropagation() }))) : null));
3313
+ } }, h("span", { key: '70247e85e8d862ed0f475650df7d3fd299d58c77', class: "attachment-icon" }, h("img", { key: '9d234ea89459c3385086fe17abfcfaa037753c2f', src: this.iconSrc(), alt: "" })), h("span", { key: '8c35191f12fbcd1ee972703296059c4ab1b666d9' }, parts.firstLine, h("br", { key: '4b206833e3181384fbeb683d0459b8a03a285be4' }), parts.secondLine)), h("div", { key: '0cb86e8a218cc577287e9be3589a1cd4441a685c', class: "doc-actions" }, pdf && this.href ? (h("button", { class: "preview-btn", type: "button", onClick: this.openPreview, "aria-label": "Preview PDF" }, "View")) : null, h("a", { key: '3351a7680f4f71cd0c05b8b4bb462bfdc4b6b948', class: "download-btn", href: this.href, download: this.fileName, target: "_blank", rel: "noopener noreferrer", "aria-label": "Download" }, h("img", { key: '30d9286c55c66a6944c46d68fdb9098cb1a31a75', src: DownloadIcon, alt: "" })))), showCaption ? (h("div", { style: { fontSize: '8px', color: this.textColor, marginTop: '4px' } }, renderMessageBody(this.message, this.mentionedUsers, u => emitTagUser(this.tagUserClick, u), !!this.isSelf))) : null, this.showPdfPreview && this.href ? (h("div", { class: "pdf-lightbox", onClick: this.closePreview }, h("div", { class: "pdf-lightbox-bar", onClick: e => e.stopPropagation() }, h("span", { class: "pdf-lightbox-title" }, this.docName || this.fileName || 'PDF'), h("div", { style: { display: 'flex', gap: '8px' } }, h("a", { href: this.href, download: this.fileName || this.docName, target: "_blank", rel: "noopener noreferrer", style: { color: '#fff', fontSize: '12px', fontWeight: '600', textDecoration: 'none', padding: '6px 12px', background: 'rgba(255,255,255,0.15)', borderRadius: '8px' } }, "Download"), h("button", { type: "button", onClick: this.closePreview }, "Close"))), h("iframe", { src: `${this.href}#toolbar=1`, title: this.docName || 'PDF preview', onClick: e => e.stopPropagation() }))) : null));
3314
3314
  }
3315
3315
  };
3316
3316
  DocumentMessage.style = ":host { display: block; }\n .doc-container {\n display: flex; align-items: center; justify-content: space-between; gap: 8px;\n border-radius: 8px; padding: 4px 8px;\n }\n .document-name {\n display: flex; align-items: center; gap: 8px; word-break: break-word;\n font-size: 12px; line-height: 1.35; min-width: 0; cursor: pointer;\n }\n .attachment-icon { display: flex; flex-shrink: 0; width: 24px; height: 30px; align-items: center; justify-content: center; }\n .attachment-icon img { width: 24px; height: 24px; object-fit: contain; display: block; }\n .doc-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }\n .download-btn, .preview-btn {\n display: flex; align-items: center; justify-content: center;\n flex-shrink: 0; line-height: 0; border: none; background: transparent; cursor: pointer; padding: 0;\n text-decoration: none; color: inherit; font: inherit;\n }\n .download-btn img, .preview-btn img {\n width: 28px; height: 28px; display: block;\n filter: var(--svg-icon-filter);\n }\n .preview-btn {\n font-size: 10px; font-weight: 700; letter-spacing: 0.04em;\n color: var(--brand, #2563eb); padding: 4px 6px; border-radius: 6px;\n background: color-mix(in srgb, var(--brand, #2563eb) 12%, transparent);\n }\n .pdf-lightbox {\n position: fixed; inset: 0; z-index: 9999;\n background: rgba(15, 23, 42, 0.72);\n display: flex; flex-direction: column;\n padding: 12px; box-sizing: border-box;\n }\n .pdf-lightbox-bar {\n display: flex; align-items: center; justify-content: space-between;\n gap: 12px; padding: 8px 4px 12px; color: #fff; flex-shrink: 0;\n }\n .pdf-lightbox-title {\n font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;\n }\n .pdf-lightbox-bar button {\n border: none; background: rgba(255,255,255,0.15); color: #fff;\n border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 12px; font-weight: 600;\n }\n .pdf-lightbox iframe {\n flex: 1; width: 100%; min-height: 0; border: 0; border-radius: 10px; background: #525659;\n }";
@@ -3357,7 +3357,7 @@ const ImageMessage = class {
3357
3357
  }
3358
3358
  render() {
3359
3359
  const showCaption = this.message && !String(this.message).includes('AttachmentMessage:');
3360
- return (h("div", { key: '5ac0d189d116d191de589a63f60a65de49a73ee2' }, h("message-bubble", { key: 'a6fb318c0f9107b144a323afa6af2a54712b1f57', isSelf: !!this.isSelf, time: this.time, timeColor: this.timeColor, isRead: this.isRead, isDelivered: this.isDelivered, deliveryStatus: this.deliveryStatus, reactions: this.reactions, messageId: this.messageId, userMetaData: this.userMetaData, isForwarded: this.messageType === 1, backgroundColor: this.bgColor, borderRadius: this.borderRadius || '10px', padding: this.padding || '10px', showReactionOnHover: this.showReactionOnHover }, h("div", { key: '7793a37c963cf7bc85c20dbf790b3d321e53fd92', class: "image-container", style: { width: this.width || '250px', height: this.height || '220px', borderRadius: this.borderRadius }, onClick: this.openGallery }, h("img", { key: 'cdd9792ff967c817e072a5eaa2a5835c76785cd9', src: this.imageSrc, alt: "image" }), this.totalMedia > 0 ? h("span", { class: "mediaCount" }, " + ", this.totalMedia) : null), showCaption ? (h("div", { style: { fontSize: '14px', color: this.textColor, marginTop: '4px' } }, renderMessageBody(this.message, this.mentionedUsers, u => emitTagUser(this.tagUserClick, u), !!this.isSelf))) : null), this.galleryOpen ? (h("div", { class: "gallery-overlay", onClick: () => (this.galleryOpen = false) }, h("button", { type: "button", class: "gallery-close", "aria-label": "Close" }, "\u00D7"), h("img", { src: this.imageSrc, alt: "full", onClick: e => e.stopPropagation() }))) : null));
3360
+ return (h("div", { key: 'b3c7b9f8e05923e0955bff3e8f71740baf5e42b7' }, h("message-bubble", { key: '7bca9fc47d0dde8e111bdc445a3fa65a90322def', isSelf: !!this.isSelf, time: this.time, timeColor: this.timeColor, isRead: this.isRead, isDelivered: this.isDelivered, deliveryStatus: this.deliveryStatus, reactions: this.reactions, messageId: this.messageId, userMetaData: this.userMetaData, isForwarded: this.messageType === 1, backgroundColor: this.bgColor, borderRadius: this.borderRadius || '10px', padding: this.padding || '10px', showReactionOnHover: this.showReactionOnHover }, h("div", { key: 'fb3cf820d1ba04c2e73024700016660ddcffee3a', class: "image-container", style: { width: this.width || '250px', height: this.height || '220px', borderRadius: this.borderRadius }, onClick: this.openGallery }, h("img", { key: '883f683d9833d06ae7c1c7a375ac3208385cc8c7', src: this.imageSrc, alt: "image" }), this.totalMedia > 0 ? h("span", { class: "mediaCount" }, " + ", this.totalMedia) : null), showCaption ? (h("div", { style: { fontSize: '14px', color: this.textColor, marginTop: '4px' } }, renderMessageBody(this.message, this.mentionedUsers, u => emitTagUser(this.tagUserClick, u), !!this.isSelf))) : null), this.galleryOpen ? (h("div", { class: "gallery-overlay", onClick: () => (this.galleryOpen = false) }, h("button", { type: "button", class: "gallery-close", "aria-label": "Close" }, "\u00D7"), h("img", { src: this.imageSrc, alt: "full", onClick: e => e.stopPropagation() }))) : null));
3361
3361
  }
3362
3362
  };
3363
3363
  ImageMessage.style = ":host { display: block; font-family: var(--font-primary); }\n .image-container { cursor: pointer; overflow: hidden; position: relative; }\n .image-container img { width: var(--w-full); height: var(--h-full); object-fit: cover; display: block; }\n .mediaCount {\n position: absolute; right: var(--space-8); bottom: var(--space-8);\n background: var(--overlay); color: var(--text-on-brand);\n padding: var(--gap-2) var(--gap-6); border-radius: var(--rounded-8); font-size: var(--text-12);\n }\n .gallery-overlay {\n position: fixed; inset: 0; background: var(--overlay); z-index: 9999;\n display: flex; align-items: center; justify-content: center;\n }\n .gallery-overlay img { max-width: 90vw; max-height: 90vh; object-fit: contain; }\n .gallery-close {\n position: absolute; top: var(--space-16); right: var(--space-16);\n color: var(--text-on-brand); font-size: var(--text-24);\n background: transparent; border: none; cursor: pointer;\n }";
@@ -3420,12 +3420,12 @@ const VideoMessage = class {
3420
3420
  }
3421
3421
  render() {
3422
3422
  const showCaption = this.message && !String(this.message).includes('AttachmentMessage:');
3423
- return (h("message-bubble", { key: '9f0fa5297ca5497b3f2c0714efb55a39c482927c', isSelf: !!this.isSelf, time: this.time, timeColor: this.timeColor, isRead: this.isRead, isDelivered: this.isDelivered, deliveryStatus: this.deliveryStatus, reactions: this.reactions, messageId: this.messageId, userMetaData: this.userMetaData, isForwarded: this.messageType === 1, backgroundColor: this.bgColor, borderRadius: this.borderRadius || '10px', padding: this.padding || '10px', showReactionOnHover: this.showReactionOnHover }, h("div", { key: '681f6418a84e5bd1df4c9994eb8008f0fde0a43b', class: "video-wrap" }, h("video", { key: '504c0a25514b3e46c67ba0072558499fb358d71c', style: {
3423
+ return (h("message-bubble", { key: '7b545b4022480c31b4e71a14d5e1bb61de4bd5c8', isSelf: !!this.isSelf, time: this.time, timeColor: this.timeColor, isRead: this.isRead, isDelivered: this.isDelivered, deliveryStatus: this.deliveryStatus, reactions: this.reactions, messageId: this.messageId, userMetaData: this.userMetaData, isForwarded: this.messageType === 1, backgroundColor: this.bgColor, borderRadius: this.borderRadius || '10px', padding: this.padding || '10px', showReactionOnHover: this.showReactionOnHover }, h("div", { key: '8295b66f4967e0ef5f34687cd6b7e524aba43b7f', class: "video-wrap" }, h("video", { key: 'a768a37cc340fabe46885fd33aaf8012f3d05dd3', style: {
3424
3424
  height: this.height || '150px',
3425
3425
  width: this.width || '150px',
3426
3426
  objectFit: 'cover',
3427
3427
  borderRadius: this.borderRadius || '8px',
3428
- }, onClick: this.toggle }, h("source", { key: '9c93cff4e3cfe4a83c37ed4d153c0941610deed4', src: this.videoSrc, type: this.videoType || 'video/mp4' })), h("div", { key: '8517818e65d6d9c63c9c2fe7949984958668cafd', class: "controls" }, !this.isPlaying ? (h("button", { type: "button", onClick: this.playVideo, "aria-label": "Play" }, "\u25B6")) : (h("button", { type: "button", onClick: this.pauseVideo, "aria-label": "Pause" }, "\u275A\u275A")), h("button", { key: 'a3ecc1c5aecdace8a7866a9ec10d72822446b009', type: "button", class: "video_fullscreen", onClick: this.fullscreen, "aria-label": "Fullscreen" }, "\u26F6"))), showCaption ? (h("div", { style: { fontSize: '14px', color: this.textColor, marginTop: '4px' } }, renderMessageBody(this.message, this.mentionedUsers, u => emitTagUser(this.tagUserClick, u), !!this.isSelf))) : null));
3428
+ }, onClick: this.toggle }, h("source", { key: '8a241e2002f7a857837d5ef83d91393e950fa4bd', src: this.videoSrc, type: this.videoType || 'video/mp4' })), h("div", { key: '24fb30b390b6a315a1dbc9a3651cc670d3419cbf', class: "controls" }, !this.isPlaying ? (h("button", { type: "button", onClick: this.playVideo, "aria-label": "Play" }, "\u25B6")) : (h("button", { type: "button", onClick: this.pauseVideo, "aria-label": "Pause" }, "\u275A\u275A")), h("button", { key: '190a151c404aabfebd7157e23bd3691e65ab678b', type: "button", class: "video_fullscreen", onClick: this.fullscreen, "aria-label": "Fullscreen" }, "\u26F6"))), showCaption ? (h("div", { style: { fontSize: '14px', color: this.textColor, marginTop: '4px' } }, renderMessageBody(this.message, this.mentionedUsers, u => emitTagUser(this.tagUserClick, u), !!this.isSelf))) : null));
3429
3429
  }
3430
3430
  get el() { return getElement(this); }
3431
3431
  };
@@ -231,7 +231,7 @@ const ChatApp = class {
231
231
  return this.changeTheme(newTheme);
232
232
  }
233
233
  render() {
234
- return (h("theme-provider", { key: '11470898a85e39a87999df2f41390f0ad8b199ac', ref: (el) => this.themeProviderRef = el, themePath: this.themePath, mode: this.mode }, !this.isLoggedIn ? (h("login-page", { onLoginSuccess: this.handleLoginSuccess })) : (h("web-chat", { toggleTheme: this.toggleTheme, defaultTheme: this.mode, customParts: this.demoCustomUi
234
+ return (h("theme-provider", { key: 'ccc80dfea2ef7de37d8fcc8ce9c728a8ff77c57e', ref: (el) => this.themeProviderRef = el, themePath: this.themePath, mode: this.mode }, !this.isLoggedIn ? (h("login-page", { onLoginSuccess: this.handleLoginSuccess })) : (h("web-chat", { toggleTheme: this.toggleTheme, defaultTheme: this.mode, customParts: this.demoCustomUi
235
235
  ? { chatTile: 'demo-chat-tile', messageBubble: 'demo-message-bubble' }
236
236
  : undefined, ref: el => {
237
237
  if (!el || !this.demoCustomUi)
@@ -5,7 +5,7 @@ const ChatDocumentMessageBubble = class {
5
5
  registerInstance(this, hostRef);
6
6
  }
7
7
  render() {
8
- return (h("div", { key: '12943166f7c980ff478e2ae877d1fd60b34c8673' }, h("document-message", { key: 'de6bb7aaac84434ae609378d2a50bd09367d4692', bgColor: '#EFF1FA', borderRadius: "6px", time: new Date().toISOString(), docName: 'Somesomsomesomesome', width: "200px", height: "80px", documentNamePadding: "10px 7px", padding: "10px" })));
8
+ return (h("div", { key: '566020d70d20c1ef1b4bb0f016432c69d5808812' }, h("document-message", { key: '9acc60f2ed92332bdf71343e699f382dbde3fcf2', bgColor: '#EFF1FA', borderRadius: "6px", time: new Date().toISOString(), docName: 'Somesomsomesomesome', width: "200px", height: "80px", documentNamePadding: "10px 7px", padding: "10px" })));
9
9
  }
10
10
  };
11
11
 
@@ -5,7 +5,7 @@ const ChatImageMessageBubble = class {
5
5
  registerInstance(this, hostRef);
6
6
  }
7
7
  render() {
8
- return (h("div", { key: 'fb1d964bc1b84f67ffb6012277abbac269fff9ba' }, h("image-message", { key: '30d46f44e582e130b4513bfdc72eec3a1567ad3a', bgColor: '#EFF1FA', imageSrc: 'https://i.etsystatic.com/7251436/r/il/4fc56c/5398499035/il_570xN.5398499035_rnzx.jpg', width: '200px', height: 'fit-content', padding: '10px 10px 15px 10px', borderRadius: "6px", time: new Date().toISOString() })));
8
+ return (h("div", { key: 'ed683102debbd0e984754be052b24ddc3d5ca92f' }, h("image-message", { key: '2a53b46313c0f17dbe41b4054e9b18ddc915fcea', bgColor: '#EFF1FA', imageSrc: 'https://i.etsystatic.com/7251436/r/il/4fc56c/5398499035/il_570xN.5398499035_rnzx.jpg', width: '200px', height: 'fit-content', padding: '10px 10px 15px 10px', borderRadius: "6px", time: new Date().toISOString() })));
9
9
  }
10
10
  };
11
11
 
@@ -5,7 +5,7 @@ const ChatVideoMessageBubble = class {
5
5
  registerInstance(this, hostRef);
6
6
  }
7
7
  render() {
8
- return (h("div", { key: '983f8e2b88efea8eb9d574c8ee58cf33337cae8b' }, h("video-message", { key: '1533f9afe653d258b4115557a23f572d98d53fb6', bgColor: "#EFF1FA", borderRadius: "6px", padding: "10px 10px 25px 10px", videoSrc: "https://www.w3schools.com/html/mov_bbb.mp4", time: new Date().toISOString() })));
8
+ return (h("div", { key: 'b06d51e9393039685998c416ddc61a4a1c09c5e0' }, h("video-message", { key: '5be830b128b45cec584fa1207f6ea7b4edbad236', bgColor: "#EFF1FA", borderRadius: "6px", padding: "10px 10px 25px 10px", videoSrc: "https://www.w3schools.com/html/mov_bbb.mp4", time: new Date().toISOString() })));
9
9
  }
10
10
  };
11
11
 
@@ -10,7 +10,7 @@ const DeleteMessageDialog = class {
10
10
  }
11
11
  render() {
12
12
  const d = this.dialogData || {};
13
- return (h("div", { key: '404914443ad5171ffbf98ec8ca6cecf0a4e4960e', class: "card" }, h("button", { key: 'ad36bed5122800e5bc1f8e6ac859c86d456c308c', class: "close-btn", type: "button", "aria-label": "Close", title: "Close", onClick: () => { var _a; return (_a = this.onClose) === null || _a === void 0 ? void 0 : _a.call(this); } }, h("img", { key: '07f684cfcfba142cf3971d2b2b9a801e447f3685', class: "theme-icon", src: CancelIcon, alt: "" })), h("h2", { key: 'ac99a0cbcec2b30f0060a500f6ddd24b568f456a' }, d.title || 'Delete message?'), h("div", { key: '98254f9e31e63ec5d5f4a0fac917260b9a0ab4ee', class: "actions" }, d.isSelf ? (h("button", { type: "button", class: "btn everyone", onClick: () => { var _a; return (_a = d.deleteMessageForEveryone) === null || _a === void 0 ? void 0 : _a.call(d); } }, "Delete for everyone")) : null, h("button", { key: '72325f72cca8d66160c7611854f86632292cb9ba', type: "button", class: "btn me", onClick: () => { var _a; return (_a = d.deleteMessageForSelf) === null || _a === void 0 ? void 0 : _a.call(d); } }, "Delete for me"), h("button", { key: 'c309bdcb44043c45794e81c315a6adcbdf45a590', type: "button", class: "btn cancel", onClick: () => { var _a; return (_a = this.onClose) === null || _a === void 0 ? void 0 : _a.call(this); } }, "Cancel"))));
13
+ return (h("div", { key: '971bfeba2496ea341fff76e820eb7072b6a790fe', class: "card" }, h("button", { key: 'b2788ff15d40e2ae42a40d5f24ae0d221f51cd9a', class: "close-btn", type: "button", "aria-label": "Close", title: "Close", onClick: () => { var _a; return (_a = this.onClose) === null || _a === void 0 ? void 0 : _a.call(this); } }, h("img", { key: '0d69849be5ed290338efc579eb550836867de0e2', class: "theme-icon", src: CancelIcon, alt: "" })), h("h2", { key: 'b113a684aa31747964953d3470bbd26f119d8fc9' }, d.title || 'Delete message?'), h("div", { key: '4cdef58f51f168c16b5328fa3c1b258038bad878', class: "actions" }, d.isSelf ? (h("button", { type: "button", class: "btn everyone", onClick: () => { var _a; return (_a = d.deleteMessageForEveryone) === null || _a === void 0 ? void 0 : _a.call(d); } }, "Delete for everyone")) : null, h("button", { key: 'cf8c791e3b2aea54c7fdc0688c3c0fc52386e8c7', type: "button", class: "btn me", onClick: () => { var _a; return (_a = d.deleteMessageForSelf) === null || _a === void 0 ? void 0 : _a.call(d); } }, "Delete for me"), h("button", { key: 'f3fa40cdb4e3f3d24b2db671c87ac73eca196566', type: "button", class: "btn cancel", onClick: () => { var _a; return (_a = this.onClose) === null || _a === void 0 ? void 0 : _a.call(this); } }, "Cancel"))));
14
14
  }
15
15
  };
16
16
  DeleteMessageDialog.style = ":host { display: block; width: 100%; }\n .card {\n background: var(--bg-primary);\n border-radius: var(--rounded-16, 1rem);\n box-shadow: 0 20px 25px -5px var(--overlay, rgba(0,0,0,0.1)), 0 8px 10px -6px var(--overlay, rgba(0,0,0,0.1));\n padding: var(--space-24, 1.5rem);\n width: 100%;\n max-width: 340px;\n margin: 0 auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n box-sizing: border-box;\n position: relative;\n }\n .close-btn {\n position: absolute;\n top: var(--space-12, 0.75rem);\n right: var(--space-12, 0.75rem);\n border: none;\n background: transparent;\n cursor: pointer;\n width: var(--control, 2.25rem);\n height: var(--control, 2.25rem);\n border-radius: var(--rounded-full);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n }\n .close-btn:hover { background: var(--hover-overlay); }\n .close-btn img {\n width: var(--icon-sm, 1rem);\n height: var(--icon-sm, 1rem);\n display: block;\n }\n h2 {\n margin: 0 0 var(--space-24, 1.5rem);\n font-size: var(--text-20, 1.25rem);\n font-weight: var(--fw-600, 600);\n color: var(--text-primary);\n }\n .actions {\n display: flex;\n flex-direction: column;\n gap: var(--gap-12, 0.75rem);\n width: 100%;\n }\n .btn {\n width: 100%;\n padding: 0.625rem 1.25rem;\n border-radius: var(--rounded-full);\n border: 1px solid var(--border, #cbd5e1);\n background: transparent;\n font-size: var(--text-14, 0.875rem);\n font-weight: 500;\n cursor: pointer;\n box-sizing: border-box;\n transition: background-color 0.15s, color 0.15s;\n }\n .btn.everyone {\n color: var(--danger, #ba1a1a);\n }\n .btn.everyone:hover {\n background: color-mix(in srgb, var(--danger, #ba1a1a) 12%, transparent);\n }\n .btn.me {\n color: var(--success, #059669);\n }\n .btn.me:hover {\n background: var(--hover-overlay, #f8fafc);\n }\n .btn.cancel {\n border: none;\n color: var(--success, #059669);\n padding: 0.5rem;\n margin-top: 0.25rem;\n }\n .btn.cancel:hover {\n color: color-mix(in srgb, var(--success, #059669) 85%, black);\n }\n .theme-icon { filter: var(--svg-icon-filter); }";
@@ -62,6 +62,8 @@ class DrawerDialogService {
62
62
  switch (dialog.name) {
63
63
  case 'confirm-dialog':
64
64
  return this.createChild('confirm-dialog', dialog);
65
+ case 'admin-transfer':
66
+ return this.createChild('admin-transfer-dialog', dialog);
65
67
  case 'delete-message':
66
68
  return this.createChild('delete-message', dialog);
67
69
  case 'share-popup':
@@ -177,4 +179,4 @@ const drawerDialogService = new DrawerDialogService();
177
179
 
178
180
  export { drawerDialogService as d };
179
181
 
180
- //# sourceMappingURL=drawer-74c188f1.js.map
182
+ //# sourceMappingURL=drawer-d54c2f10.js.map
@@ -0,0 +1 @@
1
+ {"file":"drawer-d54c2f10.js","mappings":";;AAAA;;;AAaA,MAAM,mBAAmB;IASvB;QARA,kBAAa,GAAiB,EAAE,CAAC;QACjC,kBAAa,GAAiB,EAAE,CAAC;QACjC,aAAQ,GAAG,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,CAAC,UAAU,IAAI,GAAG,GAAG,KAAK,CAAC;QAEpE,kBAAa,GAAG;YACtB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,UAAU,IAAI,GAAG,CAAC;SAC1C,CAAC;QAGA,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,oBAAoB,CAAC;QACpC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,CAAC,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AAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;gBACtE,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;aAC/B;YAED,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YACzC,IAAI,KAAK;gBAAE,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YACtC,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SAChC,CAAC,CAAC;QAEH,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KAChC;CACF;MAEY,mBAAmB,GAAG,IAAI,mBAAmB;;;;","names":[],"sources":["src/lib/drawer.ts"],"sourcesContent":["/**\n * Overlay dialog/drawer host — pure DOM, no Lit.\n */\nimport { resolveOverlayElement } from './custom-ui';\nimport '../components/ChatUIComponent/shared/confirm-dialog/confirm-dialog';\nimport '../components/ChatUIComponent/shared/admin-transfer-dialog/admin-transfer-dialog';\nimport '../components/ChatUIComponent/shared/delete-message/delete-message';\nimport '../components/ChatUIComponent/shared/share-popup/share-popup';\nimport '../components/ChatUIComponent/AddMember';\nimport '../components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList';\n\ntype DialogItem = { id: string; name: string; data: any; type: 'dialog' | 'drawer' };\n\nclass DrawerDialogService {\n activeDialogs: DialogItem[] = [];\n activeDrawers: DialogItem[] = [];\n isMobile = typeof window !== 'undefined' ? window.innerWidth <= 768 : false;\n private root: HTMLDivElement;\n private resizeHandler = () => {\n this.isMobile = window.innerWidth <= 768;\n };\n\n constructor() {\n this.root = document.createElement('div');\n this.root.id = 'drawer-dialog-root';\n document.body.appendChild(this.root);\n window.addEventListener('resize', this.resizeHandler);\n }\n\n openDialog(name: string, data: any = {}, options: { id?: string } = {}) {\n const dialogConfig: DialogItem = {\n id: options.id || `${name}-${Date.now()}`,\n name,\n data,\n type: 'dialog',\n };\n this.activeDialogs.push(dialogConfig);\n this.render();\n return dialogConfig.id;\n }\n\n openDrawer(name: string, data: any = {}, options: { id?: string } = {}) {\n const drawerConfig: DialogItem = {\n id: options.id || `${name}-${Date.now()}`,\n name,\n data,\n type: 'drawer',\n };\n this.activeDrawers.push(drawerConfig);\n this.render();\n return drawerConfig.id;\n }\n\n closeDialog(name?: string) {\n this.activeDialogs = name ? this.activeDialogs.filter(d => d.name !== name) : [];\n this.render();\n }\n\n closeDrawer(name?: string) {\n this.activeDrawers = name ? this.activeDrawers.filter(d => d.name !== name) : [];\n this.render();\n }\n\n closeAll() {\n this.closeDialog();\n this.closeDrawer();\n }\n\n private createChild(tag: string, dialog: DialogItem) {\n const el = document.createElement(tag) as any;\n el.dialogData = dialog.data;\n el.onClose = () => this.closeDialog(dialog.name);\n el.isMobile = this.isMobile;\n return el;\n }\n\n private resolveDialogEl(dialog: DialogItem): HTMLElement | null {\n const onClose = () => this.closeDialog(dialog.name);\n switch (dialog.name) {\n case 'confirm-dialog':\n return this.createChild('confirm-dialog', dialog);\n case 'admin-transfer':\n return this.createChild('admin-transfer-dialog', dialog);\n case 'delete-message':\n return this.createChild('delete-message', dialog);\n case 'share-popup':\n return this.createChild('share-popup', dialog);\n case 'member-add': {\n const custom = resolveOverlayElement(\n 'add-member',\n 'addMember',\n { dialogData: dialog.data, onClose, isMobile: this.isMobile },\n this.root,\n );\n return custom || this.createChild('member-add', dialog);\n }\n case 'forward-memebers': {\n const custom = resolveOverlayElement(\n 'forward-dialog',\n 'forwardDialog',\n { dialogData: dialog.data, onClose, isMobile: this.isMobile },\n this.root,\n );\n return custom || this.createChild('forward-memebers', dialog);\n }\n default:\n console.error(`No render method for dialog: ${dialog.name}`);\n return null;\n }\n }\n\n private render() {\n const items = [...this.activeDialogs, ...this.activeDrawers];\n this.root.innerHTML = '';\n if (!items.length) return;\n\n const overlay = document.createElement('div');\n Object.assign(overlay.style, {\n position: 'fixed',\n inset: '0',\n width: '100%',\n height: '100%',\n background: 'var(--popup-overlay, rgba(0,0,0,0.45))',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n zIndex: '999999',\n backdropFilter: 'blur(10px)',\n } as CSSStyleDeclaration);\n\n const container = document.createElement('div');\n Object.assign(container.style, {\n position: 'relative',\n width: '100%',\n height: '100%',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n } as CSSStyleDeclaration);\n container.addEventListener('click', () => this.closeAll());\n\n items.forEach(item => {\n const selfChrome =\n item.name === 'forward-memebers' || item.name === 'delete-message' || item.name === 'member-add';\n const wrapper = document.createElement('div');\n Object.assign(\n wrapper.style,\n selfChrome\n ? {\n background: 'transparent',\n padding: item.name === 'delete-message' ? '1rem' : '0',\n maxWidth:\n item.name === 'delete-message'\n ? '340px'\n : item.name === 'member-add'\n ? this.isMobile\n ? '92vw'\n : '440px'\n : this.isMobile\n ? '92vw'\n : '480px',\n width: '100%',\n boxSizing: 'border-box',\n position: this.isMobile && item.name !== 'delete-message' ? 'absolute' : 'relative',\n bottom: this.isMobile && item.name !== 'delete-message' ? '0' : 'auto',\n left: this.isMobile && item.name !== 'delete-message' ? '0' : 'auto',\n }\n : {\n background: 'var(--bg-primary-color, #fff)',\n borderRadius: this.isMobile ? '16px 16px 0 0' : '8px',\n boxShadow: '0px 2px 25px 0px #FFFFFF1A',\n textAlign: 'center',\n position: this.isMobile ? 'absolute' : 'relative',\n bottom: this.isMobile ? '0' : 'auto',\n left: this.isMobile ? '0' : 'auto',\n padding: '15px',\n maxWidth: this.isMobile ? 'none' : '400px',\n width: '100%',\n boxSizing: 'border-box',\n maxHeight: this.isMobile ? '80vh' : 'none',\n overflowY: this.isMobile ? 'auto' : 'visible',\n },\n );\n wrapper.addEventListener('click', e => e.stopPropagation());\n\n if (!selfChrome) {\n const closeBtn = document.createElement('button');\n closeBtn.type = 'button';\n closeBtn.setAttribute('aria-label', 'Close');\n closeBtn.textContent = '×';\n Object.assign(closeBtn.style, {\n position: 'absolute',\n top: '10px',\n right: '10px',\n background: 'none',\n border: 'none',\n fontSize: '28px',\n cursor: 'pointer',\n color: 'var(--bg-grey-color, #888)',\n lineHeight: '1',\n } as CSSStyleDeclaration);\n closeBtn.addEventListener('click', () => this.closeDialog(item.name));\n wrapper.appendChild(closeBtn);\n }\n\n const child = this.resolveDialogEl(item);\n if (child) wrapper.appendChild(child);\n container.appendChild(wrapper);\n });\n\n overlay.appendChild(container);\n this.root.appendChild(overlay);\n }\n}\n\nexport const drawerDialogService = new DrawerDialogService();\n"],"version":3}
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h } from './index-bc463197.js';
2
2
  import { M } from './index.m-8c70037f.js';
3
- import { d as drawerDialogService } from './drawer-74c188f1.js';
3
+ import { d as drawerDialogService } from './drawer-d54c2f10.js';
4
4
  import { C as CancelIcon } from './cancel-4f6541af.js';
5
5
  import { S as Send, a as Search } from './chat-assets-bb056958.js';
6
6
  import './index-4c865e34.js';
@@ -163,10 +163,10 @@ const MemberAdd = class {
163
163
  render() {
164
164
  const items = this.items();
165
165
  const count = this.selected.length;
166
- return (h("div", { key: 'ffb569d273106436c3c9e84e65c9e4e4a1432961', class: "panel" }, h("div", { key: '98e913f1a0b3afd174078d52acdfd58ce82c54a6', class: "header" }, h("button", { key: 'eb8561d240089e46e1b70b8d047274b8e3a66699', class: "close-btn", type: "button", "aria-label": "Close", onClick: this.close }, h("img", { key: '16f1dc20186ec79cb1d10b6ce740b7196fcb8896', class: "theme-icon", src: CancelIcon, alt: "" })), h("h2", { key: 'f3f231d5803fedd1c044497512f04271a4daac55', class: "title" }, "Forward message to")), h("div", { key: '876a28d169ee9e428c9895a1677975ccb06d0912', class: "search-wrap" }, h("div", { key: '581560a5b316854d4ef85df377b42dc46a42613d', class: "search-bar" }, h("img", { key: '6311486fc823028c25cee1e31654d4533cec7f07', class: "theme-icon search-icon", src: Search, alt: "" }), h("input", { key: '4e9b36496564c55e1ad763e4b61b363de60a93dc', type: "text", placeholder: "Search name", value: this.searchText, onInput: this.onSearch }))), this.isLoading ? (h("div", { class: "empty" }, h("spinner-loader", { height: "24px", width: "24px" }))) : items.length === 0 ? (h("div", { class: "empty" }, "No results")) : (h("div", { class: "list", onScroll: this.onScroll }, !this.searchText.trim() ? h("div", { class: "section-label" }, "Recent chats") : null, items.map(item => {
166
+ return (h("div", { key: 'b6f886d11b0a34cbb4428f01fc292bb9a6d05e91', class: "panel" }, h("div", { key: '1772f10659d41ab034a010165e747a6c6aea25a8', class: "header" }, h("button", { key: '65fc44b115e102882697225a650570735c36120a', class: "close-btn", type: "button", "aria-label": "Close", onClick: this.close }, h("img", { key: '2bdded80fd0c29c049badc833c03c6135d8af0a4', class: "theme-icon", src: CancelIcon, alt: "" })), h("h2", { key: 'd835fc53a29d2a05836a7bfa824dc22aa7a96d39', class: "title" }, "Forward message to")), h("div", { key: '9ece7c3ddb4f3517662a96aad19c795ca08e135f', class: "search-wrap" }, h("div", { key: '50296a7d7e6fa6bab3098ec0235c784966e8d94e', class: "search-bar" }, h("img", { key: '5155223afd1c1252060ac2c7c6d4254556e551af', class: "theme-icon search-icon", src: Search, alt: "" }), h("input", { key: '641a4e46861e3e54c573c844c0f72c3f9b7b049a', type: "text", placeholder: "Search name", value: this.searchText, onInput: this.onSearch }))), this.isLoading ? (h("div", { class: "empty" }, h("spinner-loader", { height: "24px", width: "24px" }))) : items.length === 0 ? (h("div", { class: "empty" }, "No results")) : (h("div", { class: "list", onScroll: this.onScroll }, !this.searchText.trim() ? h("div", { class: "section-label" }, "Recent chats") : null, items.map(item => {
167
167
  const selected = this.isSelected(item);
168
168
  return (h("div", { class: `row ${selected ? 'selected' : ''}`, onClick: () => this.toggle(item) }, h("div", { class: "row-left" }, h("profile-avatar", { src: this.imageOf(item) || '', name: this.nameOf(item), size: "2.5rem" }), h("div", { class: "row-meta" }, h("p", { class: "row-name" }, this.nameOf(item)), this.subOf(item) ? h("p", { class: "row-sub" }, this.subOf(item)) : null)), h("div", { class: "check" }, selected ? (h("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true" }, h("path", { d: "M5 13l4 4L19 7", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round", "stroke-linejoin": "round" }))) : null)));
169
- }), this.paginationLoading ? (h("div", { class: "empty" }, h("spinner-loader", { height: "20px", width: "20px" }))) : null)), h("div", { key: '4822877874d4308f402e7a07066c8de48d97c4fe', class: `footer ${count ? '' : 'hidden'}` }, h("div", { key: '990c6162bbe749e60eafcbb9bca86b310457c78e', class: "chip" }, h("span", { key: 'a3702dcb73a82d63e5382438d60bb6ff7bf6d20e', class: "chip-dot" }), h("span", { key: 'd37a2ad0c5da068a7142ecf45c0c667976b34a80' }, count, " selected"), h("button", { key: '6464a5b1873d0800b2e51964943e76636b0bdb9d', class: "chip-clear", type: "button", "aria-label": "Clear selection", onClick: this.clearSelected }, h("img", { key: '93b08885fe2f408c6736ac7b2e44d403f0074f17', class: "theme-icon", src: CancelIcon, alt: "" }))), h("button", { key: '85787906173f695d35b00f250bf1500e9a1bc18f', class: "send-btn", type: "button", "aria-label": "Send", onClick: () => this.sendMessageHandler() }, h("img", { key: 'aef688d0ce3475e4ba4603c15eb8de8a5ed96132', src: Send, alt: "" })))));
169
+ }), this.paginationLoading ? (h("div", { class: "empty" }, h("spinner-loader", { height: "20px", width: "20px" }))) : null)), h("div", { key: '8e00d1fb4eca07187f6cbb6c86547474ea535aff', class: `footer ${count ? '' : 'hidden'}` }, h("div", { key: 'f566fb2e064b40480edf7eadaeda98e65868ee06', class: "chip" }, h("span", { key: 'ebf54baa071d81f6e371abf8f3ff9625d13c70c4', class: "chip-dot" }), h("span", { key: '1ac4ec5a9e268fef88e3ff581f949b9eec70f3ee' }, count, " selected"), h("button", { key: '227f7ee56d6924a784e64176448e397806a08f5f', class: "chip-clear", type: "button", "aria-label": "Clear selection", onClick: this.clearSelected }, h("img", { key: 'fba7344bca88117aa7ea81046cfd9f4eb5cbcacc', class: "theme-icon", src: CancelIcon, alt: "" }))), h("button", { key: 'c6b8572f6c5116fbbe5ca9a3e36a461d30c90aca', class: "send-btn", type: "button", "aria-label": "Send", onClick: () => this.sendMessageHandler() }, h("img", { key: '89cc09585469647938e49b306e8bce4b2a27f7ee', src: Send, alt: "" })))));
170
170
  }
171
171
  };
172
172
  MemberAdd.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); }";
@@ -35,7 +35,7 @@ const ForwardMessage = class {
35
35
  }
36
36
  render() {
37
37
  const attachments = Array.isArray(this.messageAttachment) ? this.messageAttachment : [];
38
- return (h("div", { key: 'e6f1748eb0eefd6931f53bc8290bd1550c9bbffa', class: "forward-message-container", style: {
38
+ return (h("div", { key: '68f33029b38da69a7e00f68ea23cd382302188ef', class: "forward-message-container", style: {
39
39
  backgroundColor: this.bgColor || this.messageBodyBg || undefined,
40
40
  color: this.color,
41
41
  width: this.width,
@@ -45,7 +45,7 @@ const ForwardMessage = class {
45
45
  fontWeight: this.fontWeight,
46
46
  padding: this.padding || '8px 10px',
47
47
  alignSelf: this.isSelf ? 'flex-end' : 'flex-start',
48
- } }, h("div", { key: 'c48c44c96fd43648e6da6ce70fdd110ca20f7f4d', class: "forward-label" }, "\u21AA Forwarded"), this.messageBody ? h("div", { class: "body" }, this.messageBody) : null, attachments.length > 0 ? (h("div", { class: "attachment" }, attachments.length, " attachment", attachments.length > 1 ? 's' : '')) : null, h("div", { key: 'c8bd38b0a1f1cd0cd6617515920d98e893354e10', class: "meta" }, this.time ? h("span", null, this.time) : null, this.isSelf ? h("span", null, this.isRead ? '✓✓' : this.isDelivered ? '✓✓' : '✓') : null)));
48
+ } }, h("div", { key: '260c900688a75b08e154418c96bfef290565ede5', class: "forward-label" }, "\u21AA Forwarded"), this.messageBody ? h("div", { class: "body" }, this.messageBody) : null, attachments.length > 0 ? (h("div", { class: "attachment" }, attachments.length, " attachment", attachments.length > 1 ? 's' : '')) : null, h("div", { key: 'a38595a28c0d23148c68a0ee1ffe14f3d6967567', class: "meta" }, this.time ? h("span", null, this.time) : null, this.isSelf ? h("span", null, this.isRead ? '✓✓' : this.isDelivered ? '✓✓' : '✓') : null)));
49
49
  }
50
50
  };
51
51
  ForwardMessage.style = ":host { display: block; max-width: 72%; }\n .forward-message-container {\n display: flex; flex-direction: column; position: relative; width: fit-content;\n border-radius: 8px; padding: 8px 10px; background: var(--bg-secondary);\n color: var(--text-primary);\n }\n .forward-label { font-size: 11px; opacity: 0.7; margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }\n .body { white-space: pre-wrap; word-break: break-word; font-size: 14px; }\n .meta { display: flex; justify-content: flex-end; gap: 6px; font-size: 11px; opacity: 0.65; margin-top: 4px; }\n .attachment { font-size: 12px; opacity: 0.8; margin-top: 4px; }";
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Sole-admin leave gate: group admins must transfer admin before exiting
3
+ * when they are the only admin and other members remain.
4
+ */
5
+ function memberUserId(m) {
6
+ var _a;
7
+ const id = (_a = m.userId) !== null && _a !== void 0 ? _a : m.memberId;
8
+ return id == null ? '' : String(id);
9
+ }
10
+ function memberDisplayName(m) {
11
+ var _a;
12
+ const name = (_a = m.userName) !== null && _a !== void 0 ? _a : m.memberName;
13
+ const s = name == null ? '' : String(name).trim();
14
+ return s || 'Member';
15
+ }
16
+ function memberIsAdmin(m) {
17
+ return m.isAdmin === true || m.isAdmin === 'true';
18
+ }
19
+ function isSelfGroupAdmin(selfId, members) {
20
+ if (!selfId || members.length === 0)
21
+ return false;
22
+ const me = members.find(m => memberUserId(m) === selfId);
23
+ return me ? memberIsAdmin(me) : false;
24
+ }
25
+ /** Self is the only admin and at least one other member remains. */
26
+ function needsAdminTransferBeforeLeave(selfId, members) {
27
+ if (!isSelfGroupAdmin(selfId, members))
28
+ return false;
29
+ const adminCount = members.filter(memberIsAdmin).length;
30
+ if (adminCount !== 1)
31
+ return false;
32
+ return members.some(m => {
33
+ const id = memberUserId(m);
34
+ return !!id && id !== selfId;
35
+ });
36
+ }
37
+ /** Everyone except self — candidates to become the next admin. */
38
+ function adminTransferCandidates(selfId, members) {
39
+ const out = [];
40
+ for (const m of members) {
41
+ const id = memberUserId(m);
42
+ if (id && id !== selfId)
43
+ out.push(m);
44
+ }
45
+ return out;
46
+ }
47
+
48
+ export { memberUserId as a, adminTransferCandidates as b, memberDisplayName as m, needsAdminTransferBeforeLeave as n };
49
+
50
+ //# sourceMappingURL=group-admin-leave-a60b9b1a.js.map
@@ -0,0 +1 @@
1
+ {"file":"group-admin-leave-a60b9b1a.js","mappings":"AAAA;;;;SAcgB,YAAY,CAAC,CAAkB;;IAC7C,MAAM,EAAE,GAAG,MAAA,CAAC,CAAC,MAAM,mCAAI,CAAC,CAAC,QAAQ,CAAC;IAClC,OAAO,EAAE,IAAI,IAAI,GAAG,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AACtC,CAAC;SAEe,iBAAiB,CAAC,CAAkB;;IAClD,MAAM,IAAI,GAAG,MAAA,CAAC,CAAC,QAAQ,mCAAI,CAAC,CAAC,UAAU,CAAC;IACxC,MAAM,CAAC,GAAG,IAAI,IAAI,IAAI,GAAG,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IAClD,OAAO,CAAC,IAAI,QAAQ,CAAC;AACvB,CAAC;SAEe,aAAa,CAAC,CAAkB;IAC9C,OAAO,CAAC,CAAC,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC;AACpD,CAAC;SAEe,gBAAgB,CAAC,MAAc,EAAE,OAA0B;IACzE,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAClD,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC;IACzD,OAAO,EAAE,GAAG,aAAa,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;AACxC,CAAC;AAED;SACgB,6BAA6B,CAC3C,MAAc,EACd,OAA0B;IAE1B,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IACrD,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC;IACxD,IAAI,UAAU,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACnC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,MAAM,CAAC;KAC9B,CAAC,CAAC;AACL,CAAC;AAED;SACgB,uBAAuB,CACrC,MAAc,EACd,OAA0B;IAE1B,MAAM,GAAG,GAAsB,EAAE,CAAC;IAClC,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,MAAM,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,EAAE,IAAI,EAAE,KAAK,MAAM;YAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACtC;IACD,OAAO,GAAG,CAAC;AACb;;;;","names":[],"sources":["src/lib/group-admin-leave.ts"],"sourcesContent":["/**\n * Sole-admin leave gate: group admins must transfer admin before exiting\n * when they are the only admin and other members remain.\n */\n\nexport type GroupMemberLike = {\n userId?: unknown;\n memberId?: unknown;\n userName?: unknown;\n memberName?: unknown;\n userProfileImageUrl?: unknown;\n isAdmin?: unknown;\n};\n\nexport function memberUserId(m: GroupMemberLike): string {\n const id = m.userId ?? m.memberId;\n return id == null ? '' : String(id);\n}\n\nexport function memberDisplayName(m: GroupMemberLike): string {\n const name = m.userName ?? m.memberName;\n const s = name == null ? '' : String(name).trim();\n return s || 'Member';\n}\n\nexport function memberIsAdmin(m: GroupMemberLike): boolean {\n return m.isAdmin === true || m.isAdmin === 'true';\n}\n\nexport function isSelfGroupAdmin(selfId: string, members: GroupMemberLike[]): boolean {\n if (!selfId || members.length === 0) return false;\n const me = members.find(m => memberUserId(m) === selfId);\n return me ? memberIsAdmin(me) : false;\n}\n\n/** Self is the only admin and at least one other member remains. */\nexport function needsAdminTransferBeforeLeave(\n selfId: string,\n members: GroupMemberLike[],\n): boolean {\n if (!isSelfGroupAdmin(selfId, members)) return false;\n const adminCount = members.filter(memberIsAdmin).length;\n if (adminCount !== 1) return false;\n return members.some(m => {\n const id = memberUserId(m);\n return !!id && id !== selfId;\n });\n}\n\n/** Everyone except self — candidates to become the next admin. */\nexport function adminTransferCandidates(\n selfId: string,\n members: GroupMemberLike[],\n): GroupMemberLike[] {\n const out: GroupMemberLike[] = [];\n for (const m of members) {\n const id = memberUserId(m);\n if (id && id !== selfId) out.push(m);\n }\n return out;\n}\n"],"version":3}
package/dist/esm/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  export { W as WEB_CHAT_SLOTS, a as applyCustomPartProps, f as findWebChatHost } from './index-4c865e34.js';
2
2
  export { f as format } from './utils-11fcde98.js';
3
- import { i as initializeIsometrikWebchat, d as destroyIsometrikWebchat, b as isometrikWebchatApi, k as customChatSidebar, s as switchChatTheme, g as applyCustomTheme, t as toggleTheme } from './runtime-controls-c5ba5009.js';
4
- export { W as WEB_CHAT_PUBLIC_EVENTS, l as WEB_CHAT_PUBLIC_METHODS, g as applyCustomTheme, n as buildWebchatSessionKey, v as clearWebChatSlot, w as createSlotHost, c as createWebChatApi, k as customChatSidebar, f as defineReactCustomPart, p as destroyChat, d as destroyIsometrikWebchat, e as ensureIsometrikWebchat, y as getChatStore, o as initializeChat, i as initializeIsometrikWebchat, b as isometrikWebchatApi, m as mountReactInSlot, a as releaseIsometrikWebchat, h as resolveThemeProvider, j as resolveWebChat, r as retainIsometrikWebchat, q as setWebChatSlot, x as setWebChatSlots, s as switchChatTheme, t as toggleTheme, u as unmountReactSlot } from './runtime-controls-c5ba5009.js';
3
+ import { i as initializeIsometrikWebchat, d as destroyIsometrikWebchat, b as isometrikWebchatApi, k as customChatSidebar, s as switchChatTheme, g as applyCustomTheme, t as toggleTheme } from './runtime-controls-ec6d5c75.js';
4
+ export { W as WEB_CHAT_PUBLIC_EVENTS, l as WEB_CHAT_PUBLIC_METHODS, g as applyCustomTheme, n as buildWebchatSessionKey, v as clearWebChatSlot, w as createSlotHost, c as createWebChatApi, k as customChatSidebar, f as defineReactCustomPart, p as destroyChat, d as destroyIsometrikWebchat, e as ensureIsometrikWebchat, y as getChatStore, o as initializeChat, i as initializeIsometrikWebchat, b as isometrikWebchatApi, m as mountReactInSlot, a as releaseIsometrikWebchat, h as resolveThemeProvider, j as resolveWebChat, r as retainIsometrikWebchat, q as setWebChatSlot, x as setWebChatSlots, s as switchChatTheme, t as toggleTheme, u as unmountReactSlot } from './runtime-controls-ec6d5c75.js';
5
5
  export { d as deriveMessageStatus } from './contracts-50f4ddae.js';
6
6
  export { T as THEME_TOKEN_NAMES, g as applyThemeObjectToElement, n as normalizeThemeObject, j as resolveProfileRailMode, h as resolveRegionMode, r as resolveShowProfileRailProp } from './groupcast-58a59d64.js';
7
7
  export { c as canUseIndexedDb, g as getOfflineClient, i as isBrowserOnline, m as mergeMessagesById } from './client-4a3e00da.js';
8
8
  import './destroy-chat-d0ee28d6.js';
9
- import './send-media-588837c7.js';
9
+ import './send-media-a946c6dd.js';
10
10
  import './index.m-8c70037f.js';
11
11
  import './chat-creds-aafad4d0.js';
12
12
  import './groupcast-9c7d2a32.js';