@sendbird/uikit-react 3.0.2-beta.1 → 3.1.0-rc.0

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 (441) hide show
  1. package/App.js +32 -32
  2. package/CHANGELOG.md +13 -2
  3. package/Channel/components/ChannelHeader.js +17 -17
  4. package/Channel/components/ChannelUI.js +24 -24
  5. package/Channel/components/FileViewer.js +16 -16
  6. package/Channel/components/FrozenNotification.js +5 -5
  7. package/Channel/components/Message.js +21 -21
  8. package/Channel/components/MessageInput.js +18 -18
  9. package/Channel/components/MessageList.js +23 -23
  10. package/Channel/components/RemoveMessageModal.js +19 -19
  11. package/Channel/components/SuggestedMentionList.js +17 -17
  12. package/Channel/components/TypingIndicator.js +16 -16
  13. package/Channel/components/UnreadCount.js +5 -5
  14. package/Channel/context.js +15 -15
  15. package/Channel.js +24 -24
  16. package/ChannelList/components/AddChannel.js +14 -14
  17. package/ChannelList/components/ChannelListHeader.js +7 -7
  18. package/ChannelList/components/ChannelListUI.js +28 -28
  19. package/ChannelList/components/ChannelPreview.js +21 -21
  20. package/ChannelList/components/ChannelPreviewAction.js +16 -16
  21. package/ChannelList/context.js +10 -10
  22. package/ChannelList.js +28 -28
  23. package/{ChannelListProvider-551b956e.js → ChannelListProvider-98290ccf.js} +9 -9
  24. package/{ChannelListProvider-551b956e.js.map → ChannelListProvider-98290ccf.js.map} +1 -1
  25. package/{ChannelProvider-f2229414.js → ChannelProvider-38147c7b.js} +11 -11
  26. package/{ChannelProvider-f2229414.js.map → ChannelProvider-38147c7b.js.map} +1 -1
  27. package/ChannelSettings/components/ChannelProfile.js +13 -13
  28. package/ChannelSettings/components/ChannelSettingsUI.js +20 -18
  29. package/ChannelSettings/components/ChannelSettingsUI.js.map +1 -1
  30. package/ChannelSettings/components/EditDetailsModal.js +13 -13
  31. package/ChannelSettings/components/LeaveChannel.js +10 -10
  32. package/ChannelSettings/components/ModerationPanel.js +29 -26
  33. package/ChannelSettings/components/ModerationPanel.js.map +1 -1
  34. package/ChannelSettings/components/UserListItem.js +14 -14
  35. package/ChannelSettings/components/UserListItem.js.map +1 -1
  36. package/ChannelSettings/components/UserPanel.js +14 -14
  37. package/ChannelSettings/context.js +3 -3
  38. package/ChannelSettings.js +20 -18
  39. package/ChannelSettings.js.map +1 -1
  40. package/CreateChannel/components/CreateChannelUI.js +14 -14
  41. package/CreateChannel/components/InviteUsers.js +17 -19
  42. package/CreateChannel/components/InviteUsers.js.map +1 -1
  43. package/CreateChannel/components/SelectChannelType.js +10 -10
  44. package/CreateChannel/context.js +4 -4
  45. package/CreateChannel.js +14 -14
  46. package/{CreateChannelProvider-15dfa1af.js → CreateChannelProvider-c929328e.js} +1 -1
  47. package/{CreateChannelProvider-15dfa1af.js.map → CreateChannelProvider-c929328e.js.map} +1 -1
  48. package/EditUserProfile/components/EditUserProfileUI.js +13 -13
  49. package/EditUserProfile.js +13 -13
  50. package/{LocalizationContext-cf80416c.js → LocalizationContext-bed38f81.js} +3 -3
  51. package/{LocalizationContext-cf80416c.js.map → LocalizationContext-bed38f81.js.map} +1 -1
  52. package/{MemberList-f79c33ff.js → MemberList-db090735.js} +25 -22
  53. package/MemberList-db090735.js.map +1 -0
  54. package/MessageSearch/components/MessageSearchUI.js +11 -11
  55. package/MessageSearch/context.js +2 -2
  56. package/MessageSearch.js +11 -11
  57. package/OpenChannel/components/FrozenChannelNotification.js +5 -5
  58. package/OpenChannel/components/OpenChannelHeader.js +14 -14
  59. package/OpenChannel/components/OpenChannelInput.js +18 -18
  60. package/OpenChannel/components/OpenChannelMessage.js +40 -28
  61. package/OpenChannel/components/OpenChannelMessage.js.map +1 -1
  62. package/OpenChannel/components/OpenChannelMessageList.js +26 -26
  63. package/OpenChannel/components/OpenChannelMessageList.js.map +1 -1
  64. package/OpenChannel/components/OpenChannelUI.js +25 -25
  65. package/OpenChannel/context.js +11 -11
  66. package/OpenChannel.js +25 -25
  67. package/{OpenChannelProvider-e5364b83.js → OpenChannelProvider-5b45f840.js} +42 -15
  68. package/OpenChannelProvider-5b45f840.js.map +1 -0
  69. package/OpenChannelSettings/components/EditDetailsModal.js +13 -13
  70. package/OpenChannelSettings/components/OpenChannelProfile.js +13 -13
  71. package/OpenChannelSettings/components/OpenChannelSettingsUI.js +21 -21
  72. package/OpenChannelSettings/components/OpenChannelSettingsUI.js.map +1 -1
  73. package/OpenChannelSettings/components/OperatorUI.js +776 -27
  74. package/OpenChannelSettings/components/OperatorUI.js.map +1 -1
  75. package/OpenChannelSettings/components/ParticipantUI.js +28 -139
  76. package/OpenChannelSettings/components/ParticipantUI.js.map +1 -1
  77. package/OpenChannelSettings/context.js +48 -4
  78. package/OpenChannelSettings/context.js.map +1 -1
  79. package/OpenChannelSettings.js +22 -22
  80. package/SendbirdProvider.js +12 -12
  81. package/SendbirdProvider.js.map +1 -1
  82. package/{UserProfileContext-977db3ff.js → UserProfileContext-5bc5ff98.js} +1 -1
  83. package/{UserProfileContext-977db3ff.js.map → UserProfileContext-5bc5ff98.js.map} +1 -1
  84. package/__bundle-7dfccc8c-dc566919.js +24 -0
  85. package/__bundle-7dfccc8c-dc566919.js.map +1 -0
  86. package/{_rollupPluginBabelHelpers-fdcfbfcc.js → _rollupPluginBabelHelpers-51451000.js} +1 -1
  87. package/{_rollupPluginBabelHelpers-fdcfbfcc.js.map → _rollupPluginBabelHelpers-51451000.js.map} +1 -1
  88. package/{actionTypes-6075fcef.js → actionTypes-03571cf1.js} +1 -1
  89. package/{actionTypes-6075fcef.js.map → actionTypes-03571cf1.js.map} +1 -1
  90. package/cjs/App.js +32 -32
  91. package/cjs/Channel/components/ChannelHeader.js +17 -17
  92. package/cjs/Channel/components/ChannelUI.js +24 -24
  93. package/cjs/Channel/components/FileViewer.js +16 -16
  94. package/cjs/Channel/components/FrozenNotification.js +5 -5
  95. package/cjs/Channel/components/Message.js +21 -21
  96. package/cjs/Channel/components/MessageInput.js +18 -18
  97. package/cjs/Channel/components/MessageList.js +23 -23
  98. package/cjs/Channel/components/RemoveMessageModal.js +19 -19
  99. package/cjs/Channel/components/SuggestedMentionList.js +17 -17
  100. package/cjs/Channel/components/TypingIndicator.js +16 -16
  101. package/cjs/Channel/components/UnreadCount.js +5 -5
  102. package/cjs/Channel/context.js +15 -15
  103. package/cjs/Channel.js +24 -24
  104. package/cjs/ChannelList/components/AddChannel.js +14 -14
  105. package/cjs/ChannelList/components/ChannelListHeader.js +7 -7
  106. package/cjs/ChannelList/components/ChannelListUI.js +28 -28
  107. package/cjs/ChannelList/components/ChannelPreview.js +21 -21
  108. package/cjs/ChannelList/components/ChannelPreviewAction.js +16 -16
  109. package/cjs/ChannelList/context.js +10 -10
  110. package/cjs/ChannelList.js +28 -28
  111. package/cjs/{ChannelListProvider-a78dcace.js → ChannelListProvider-50cf9211.js} +9 -9
  112. package/cjs/{ChannelListProvider-a78dcace.js.map → ChannelListProvider-50cf9211.js.map} +1 -1
  113. package/cjs/{ChannelProvider-1c64ff8e.js → ChannelProvider-669b5e88.js} +11 -11
  114. package/cjs/{ChannelProvider-1c64ff8e.js.map → ChannelProvider-669b5e88.js.map} +1 -1
  115. package/cjs/ChannelSettings/components/ChannelProfile.js +13 -13
  116. package/cjs/ChannelSettings/components/ChannelSettingsUI.js +20 -18
  117. package/cjs/ChannelSettings/components/ChannelSettingsUI.js.map +1 -1
  118. package/cjs/ChannelSettings/components/EditDetailsModal.js +13 -13
  119. package/cjs/ChannelSettings/components/LeaveChannel.js +10 -10
  120. package/cjs/ChannelSettings/components/ModerationPanel.js +28 -25
  121. package/cjs/ChannelSettings/components/ModerationPanel.js.map +1 -1
  122. package/cjs/ChannelSettings/components/UserListItem.js +14 -14
  123. package/cjs/ChannelSettings/components/UserListItem.js.map +1 -1
  124. package/cjs/ChannelSettings/components/UserPanel.js +14 -14
  125. package/cjs/ChannelSettings/context.js +3 -3
  126. package/cjs/ChannelSettings.js +20 -18
  127. package/cjs/ChannelSettings.js.map +1 -1
  128. package/cjs/CreateChannel/components/CreateChannelUI.js +14 -14
  129. package/cjs/CreateChannel/components/InviteUsers.js +17 -19
  130. package/cjs/CreateChannel/components/InviteUsers.js.map +1 -1
  131. package/cjs/CreateChannel/components/SelectChannelType.js +10 -10
  132. package/cjs/CreateChannel/context.js +4 -4
  133. package/cjs/CreateChannel.js +14 -14
  134. package/cjs/{CreateChannelProvider-d3305abc.js → CreateChannelProvider-3ee8c3d8.js} +1 -1
  135. package/cjs/{CreateChannelProvider-d3305abc.js.map → CreateChannelProvider-3ee8c3d8.js.map} +1 -1
  136. package/cjs/EditUserProfile/components/EditUserProfileUI.js +13 -13
  137. package/cjs/EditUserProfile.js +13 -13
  138. package/cjs/{LocalizationContext-baf1fe9b.js → LocalizationContext-458c4425.js} +3 -3
  139. package/cjs/{LocalizationContext-baf1fe9b.js.map → LocalizationContext-458c4425.js.map} +1 -1
  140. package/cjs/{MemberList-95fc8f1a.js → MemberList-3c0d7503.js} +24 -21
  141. package/cjs/MemberList-3c0d7503.js.map +1 -0
  142. package/cjs/MessageSearch/components/MessageSearchUI.js +11 -11
  143. package/cjs/MessageSearch/context.js +2 -2
  144. package/cjs/MessageSearch.js +11 -11
  145. package/cjs/OpenChannel/components/FrozenChannelNotification.js +5 -5
  146. package/cjs/OpenChannel/components/OpenChannelHeader.js +14 -14
  147. package/cjs/OpenChannel/components/OpenChannelInput.js +18 -18
  148. package/cjs/OpenChannel/components/OpenChannelMessage.js +40 -28
  149. package/cjs/OpenChannel/components/OpenChannelMessage.js.map +1 -1
  150. package/cjs/OpenChannel/components/OpenChannelMessageList.js +26 -26
  151. package/cjs/OpenChannel/components/OpenChannelMessageList.js.map +1 -1
  152. package/cjs/OpenChannel/components/OpenChannelUI.js +25 -25
  153. package/cjs/OpenChannel/context.js +11 -11
  154. package/cjs/OpenChannel.js +25 -25
  155. package/cjs/{OpenChannelProvider-cc9ee134.js → OpenChannelProvider-0f1ece78.js} +42 -15
  156. package/cjs/OpenChannelProvider-0f1ece78.js.map +1 -0
  157. package/cjs/OpenChannelSettings/components/EditDetailsModal.js +13 -13
  158. package/cjs/OpenChannelSettings/components/OpenChannelProfile.js +13 -13
  159. package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js +21 -21
  160. package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js.map +1 -1
  161. package/cjs/OpenChannelSettings/components/OperatorUI.js +775 -26
  162. package/cjs/OpenChannelSettings/components/OperatorUI.js.map +1 -1
  163. package/cjs/OpenChannelSettings/components/ParticipantUI.js +29 -140
  164. package/cjs/OpenChannelSettings/components/ParticipantUI.js.map +1 -1
  165. package/cjs/OpenChannelSettings/context.js +48 -4
  166. package/cjs/OpenChannelSettings/context.js.map +1 -1
  167. package/cjs/OpenChannelSettings.js +22 -22
  168. package/cjs/SendbirdProvider.js +12 -12
  169. package/cjs/SendbirdProvider.js.map +1 -1
  170. package/cjs/{UserProfileContext-d4c230c3.js → UserProfileContext-f582734c.js} +1 -1
  171. package/cjs/{UserProfileContext-d4c230c3.js.map → UserProfileContext-f582734c.js.map} +1 -1
  172. package/cjs/__bundle-7dfccc8c-1748a942.js +151 -0
  173. package/cjs/__bundle-7dfccc8c-1748a942.js.map +1 -0
  174. package/cjs/{_rollupPluginBabelHelpers-29633c69.js → _rollupPluginBabelHelpers-7a2f7ed5.js} +1 -1
  175. package/cjs/{_rollupPluginBabelHelpers-29633c69.js.map → _rollupPluginBabelHelpers-7a2f7ed5.js.map} +1 -1
  176. package/cjs/{actionTypes-27fdf504.js → actionTypes-344731c5.js} +1 -1
  177. package/cjs/{actionTypes-27fdf504.js.map → actionTypes-344731c5.js.map} +1 -1
  178. package/cjs/{color-10db49db.js → color-7ac0d13b.js} +1 -1
  179. package/cjs/{color-10db49db.js.map → color-7ac0d13b.js.map} +1 -1
  180. package/cjs/{compareIds-b6c1549b.js → compareIds-8bbbef9c.js} +1 -1
  181. package/cjs/{compareIds-b6c1549b.js.map → compareIds-8bbbef9c.js.map} +1 -1
  182. package/cjs/{const-216f25a9.js → const-290e012b.js} +1 -1
  183. package/cjs/{const-216f25a9.js.map → const-290e012b.js.map} +1 -1
  184. package/cjs/{const-7cba20e4.js → const-496c4e96.js} +1 -1
  185. package/cjs/{const-7cba20e4.js.map → const-496c4e96.js.map} +1 -1
  186. package/cjs/{context-1bb3f131.js → context-16c8fda9.js} +2 -2
  187. package/cjs/{context-1bb3f131.js.map → context-16c8fda9.js.map} +1 -1
  188. package/cjs/dist/index.css +154 -105
  189. package/cjs/dist/index.css.map +1 -1
  190. package/cjs/groupChannel-fab057aa.js +9 -0
  191. package/cjs/groupChannel-fab057aa.js.map +1 -0
  192. package/cjs/{index-f457d792.js → index-0913b626.js} +3 -3
  193. package/cjs/{index-f457d792.js.map → index-0913b626.js.map} +1 -1
  194. package/cjs/{index-d4396be3.js → index-0d759d2f.js} +1 -1
  195. package/cjs/{index-d4396be3.js.map → index-0d759d2f.js.map} +1 -1
  196. package/cjs/{index-885e6586.js → index-1e767390.js} +2 -2
  197. package/cjs/{index-885e6586.js.map → index-1e767390.js.map} +1 -1
  198. package/cjs/{index-8a02c34e.js → index-74826500.js} +2 -2
  199. package/cjs/{index-8a02c34e.js.map → index-74826500.js.map} +1 -1
  200. package/cjs/{index-802a624a.js → index-7efec35e.js} +2 -2
  201. package/cjs/{index-802a624a.js.map → index-7efec35e.js.map} +1 -1
  202. package/cjs/{index-fdfc8df4.js → index-911094d4.js} +1 -1
  203. package/cjs/{index-fdfc8df4.js.map → index-911094d4.js.map} +1 -1
  204. package/cjs/{index-c5e7bc6f.js → index-a29feec3.js} +6 -6
  205. package/cjs/{index-c5e7bc6f.js.map → index-a29feec3.js.map} +1 -1
  206. package/cjs/{index-4aac2260.js → index-c1aa0d36.js} +4 -4
  207. package/cjs/{index-4aac2260.js.map → index-c1aa0d36.js.map} +1 -1
  208. package/cjs/index-dac29bc6.js +357 -0
  209. package/cjs/index-dac29bc6.js.map +1 -0
  210. package/cjs/{index-31de37a9.js → index-e61b5129.js} +3 -3
  211. package/cjs/{index-31de37a9.js.map → index-e61b5129.js.map} +1 -1
  212. package/cjs/{index-9f277fa2.js → index-fcee945f.js} +4 -4
  213. package/cjs/{index-9f277fa2.js.map → index-fcee945f.js.map} +1 -1
  214. package/cjs/index.js +36 -36
  215. package/cjs/openChannel-e4e021c5.js +13 -0
  216. package/cjs/openChannel-e4e021c5.js.map +1 -0
  217. package/cjs/{openChannelUtils-3b8eec58.js → openChannelUtils-c190487b.js} +1 -2
  218. package/cjs/{openChannelUtils-3b8eec58.js.map → openChannelUtils-c190487b.js.map} +1 -1
  219. package/cjs/sendbirdSelectors.js +2 -2
  220. package/cjs/{stringSet-f932274f.js → stringSet-1e20a383.js} +28 -3
  221. package/cjs/stringSet-1e20a383.js.map +1 -0
  222. package/cjs/{topics-e0269931.js → topics-fae1bf42.js} +1 -1
  223. package/cjs/{topics-e0269931.js.map → topics-fae1bf42.js.map} +1 -1
  224. package/cjs/{tslib.es6-592b36e8.js → tslib.es6-94adc177.js} +1 -1
  225. package/cjs/{tslib.es6-592b36e8.js.map → tslib.es6-94adc177.js.map} +1 -1
  226. package/cjs/ui/Accordion.js +4 -4
  227. package/cjs/ui/AccordionGroup.js +2 -2
  228. package/cjs/ui/AdminMessage.js +3 -3
  229. package/cjs/ui/Avatar.js +3 -3
  230. package/cjs/ui/Badge.js +5 -5
  231. package/cjs/ui/Button.js +4 -4
  232. package/cjs/ui/ChannelAvatar.js +4 -4
  233. package/cjs/ui/ChannelPreview.js +12 -12
  234. package/cjs/ui/ChatHeader.js +8 -8
  235. package/cjs/ui/Checkbox.js +12 -24
  236. package/cjs/ui/Checkbox.js.map +1 -1
  237. package/cjs/ui/ConnectionStatus.js +5 -5
  238. package/cjs/ui/ContextMenu.js +5 -5
  239. package/cjs/ui/DateSeparator.js +4 -4
  240. package/cjs/ui/Dropdown.js +3 -3
  241. package/cjs/ui/EmojiReactions.js +7 -7
  242. package/cjs/ui/FileMessageItemBody.js +6 -6
  243. package/cjs/ui/FileViewer.js +7 -7
  244. package/cjs/ui/Icon.js +1 -1
  245. package/cjs/ui/IconButton.js +1 -1
  246. package/cjs/ui/ImageRenderer.js +1 -1
  247. package/cjs/ui/Input.js +3 -3
  248. package/cjs/ui/Label.js +3 -3
  249. package/cjs/ui/LinkLabel.js +3 -3
  250. package/cjs/ui/Loader.js +1 -1
  251. package/cjs/ui/MentionLabel.js +11 -11
  252. package/cjs/ui/MessageContent.js +14 -14
  253. package/cjs/ui/MessageInput.js +10 -10
  254. package/cjs/ui/MessageItemMenu.js +7 -7
  255. package/cjs/ui/MessageItemReactionMenu.js +5 -5
  256. package/cjs/ui/MessageSearchFileItem.js +10 -10
  257. package/cjs/ui/MessageSearchItem.js +10 -10
  258. package/cjs/ui/MessageStatus.js +8 -8
  259. package/cjs/ui/Modal.js +12 -9
  260. package/cjs/ui/Modal.js.map +1 -1
  261. package/cjs/ui/MutedAvatarOverlay.js +1 -1
  262. package/cjs/ui/OGMessageItemBody.js +11 -11
  263. package/cjs/ui/OpenChannelAdminMessage.js +4 -4
  264. package/cjs/ui/OpenChannelAvatar.js +7 -7
  265. package/cjs/ui/OpenchannelConversationHeader.js +7 -7
  266. package/cjs/ui/OpenchannelFileMessage.js +17 -17
  267. package/cjs/ui/OpenchannelFileMessage.js.map +1 -1
  268. package/cjs/ui/OpenchannelOGMessage.js +17 -17
  269. package/cjs/ui/OpenchannelOGMessage.js.map +1 -1
  270. package/cjs/ui/OpenchannelThumbnailMessage.js +16 -16
  271. package/cjs/ui/OpenchannelThumbnailMessage.js.map +1 -1
  272. package/cjs/ui/OpenchannelUserMessage.js +17 -17
  273. package/cjs/ui/OpenchannelUserMessage.js.map +1 -1
  274. package/cjs/ui/PlaceHolder.js +6 -6
  275. package/cjs/ui/QuoteMessage.js +7 -7
  276. package/cjs/ui/QuoteMessageInput.js +7 -7
  277. package/cjs/ui/ReactionBadge.js +3 -3
  278. package/cjs/ui/ReactionButton.js +1 -1
  279. package/cjs/ui/SortByRow.js +1 -1
  280. package/cjs/ui/TextButton.js +2 -2
  281. package/cjs/ui/TextMessageItemBody.js +11 -11
  282. package/cjs/ui/ThumbnailMessageItemBody.js +3 -3
  283. package/cjs/ui/Tooltip.js +3 -3
  284. package/cjs/ui/TooltipWrapper.js +1 -1
  285. package/cjs/ui/UnknownMessageItemBody.js +7 -7
  286. package/cjs/ui/UserListItem.js +34 -62
  287. package/cjs/ui/UserListItem.js.map +1 -1
  288. package/cjs/ui/UserProfile.js +10 -10
  289. package/cjs/ui/Word.js +11 -11
  290. package/cjs/useSendbirdStateContext.js +1 -1
  291. package/cjs/{utils-01d5bf79.js → utils-50f39987.js} +1 -1
  292. package/cjs/{utils-01d5bf79.js.map → utils-50f39987.js.map} +1 -1
  293. package/cjs/{utils-352cb0a5.js → utils-985f99f7.js} +1 -1
  294. package/cjs/{utils-352cb0a5.js.map → utils-985f99f7.js.map} +1 -1
  295. package/cjs/{utils-762f2f61.js → utils-a765f200.js} +1 -1
  296. package/cjs/{utils-762f2f61.js.map → utils-a765f200.js.map} +1 -1
  297. package/cjs/{uuid-5ffba0f8.js → uuid-54ad2cc3.js} +1 -1
  298. package/cjs/{uuid-5ffba0f8.js.map → uuid-54ad2cc3.js.map} +1 -1
  299. package/cjs/withSendbird.js +1 -1
  300. package/{color-24138028.js → color-04ed392d.js} +1 -1
  301. package/{color-24138028.js.map → color-04ed392d.js.map} +1 -1
  302. package/{compareIds-286831ea.js → compareIds-7eaf62a5.js} +1 -1
  303. package/{compareIds-286831ea.js.map → compareIds-7eaf62a5.js.map} +1 -1
  304. package/{const-725e6443.js → const-5ab9bb9f.js} +1 -1
  305. package/{const-725e6443.js.map → const-5ab9bb9f.js.map} +1 -1
  306. package/{const-9ccaba50.js → const-db8ec16d.js} +1 -1
  307. package/{const-9ccaba50.js.map → const-db8ec16d.js.map} +1 -1
  308. package/{context-482c87f7.js → context-4ca94848.js} +2 -2
  309. package/{context-482c87f7.js.map → context-4ca94848.js.map} +1 -1
  310. package/dist/index.css +154 -105
  311. package/dist/index.css.map +1 -1
  312. package/{groupChannel-4ad208bd.js → groupChannel-5c43b7c1.js} +3 -3
  313. package/groupChannel-5c43b7c1.js.map +1 -0
  314. package/{index-78302d10.js → index-1984c852.js} +2 -2
  315. package/{index-78302d10.js.map → index-1984c852.js.map} +1 -1
  316. package/{index-25339141.js → index-2a999130.js} +4 -4
  317. package/{index-25339141.js.map → index-2a999130.js.map} +1 -1
  318. package/{index-8d874712.js → index-33456100.js} +3 -3
  319. package/{index-8d874712.js.map → index-33456100.js.map} +1 -1
  320. package/{index-e53b04fa.js → index-49108fb4.js} +2 -2
  321. package/{index-e53b04fa.js.map → index-49108fb4.js.map} +1 -1
  322. package/index-525b68d4.js +350 -0
  323. package/index-525b68d4.js.map +1 -0
  324. package/{index-35ab7b97.js → index-6e02fc15.js} +1 -1
  325. package/{index-35ab7b97.js.map → index-6e02fc15.js.map} +1 -1
  326. package/{index-072521c3.js → index-7ed67f3f.js} +1 -1
  327. package/{index-072521c3.js.map → index-7ed67f3f.js.map} +1 -1
  328. package/{index-8a388ae7.js → index-a3d218da.js} +3 -3
  329. package/{index-8a388ae7.js.map → index-a3d218da.js.map} +1 -1
  330. package/{index-f6b6701e.js → index-c67f2f3b.js} +2 -2
  331. package/{index-f6b6701e.js.map → index-c67f2f3b.js.map} +1 -1
  332. package/{index-e9e40be7.js → index-dfc65ccf.js} +4 -4
  333. package/{index-e9e40be7.js.map → index-dfc65ccf.js.map} +1 -1
  334. package/{index-e63d152e.js → index-edc23b4f.js} +6 -6
  335. package/{index-e63d152e.js.map → index-edc23b4f.js.map} +1 -1
  336. package/index.d.ts +1 -1
  337. package/index.js +36 -36
  338. package/openChannel-92ffb0b5.js +8 -0
  339. package/openChannel-92ffb0b5.js.map +1 -0
  340. package/{openChannelUtils-d9065b0b.js → openChannelUtils-e69f8484.js} +2 -2
  341. package/{openChannelUtils-d9065b0b.js.map → openChannelUtils-e69f8484.js.map} +1 -1
  342. package/package.json +1 -1
  343. package/sendbirdSelectors.js +2 -2
  344. package/{stringSet-f697bfff.js → stringSet-07d51930.js} +28 -3
  345. package/stringSet-07d51930.js.map +1 -0
  346. package/{topics-b6afa630.js → topics-a5f3f0e9.js} +1 -1
  347. package/{topics-b6afa630.js.map → topics-a5f3f0e9.js.map} +1 -1
  348. package/{tslib.es6-42c9ba76.js → tslib.es6-7a52c497.js} +1 -1
  349. package/{tslib.es6-42c9ba76.js.map → tslib.es6-7a52c497.js.map} +1 -1
  350. package/ui/Accordion.js +4 -4
  351. package/ui/AccordionGroup.js +2 -2
  352. package/ui/AdminMessage.js +3 -3
  353. package/ui/Avatar.js +3 -3
  354. package/ui/Badge.js +5 -5
  355. package/ui/Button.js +4 -4
  356. package/ui/ChannelAvatar.js +4 -4
  357. package/ui/ChannelPreview.js +12 -12
  358. package/ui/ChatHeader.js +8 -8
  359. package/ui/Checkbox.js +12 -23
  360. package/ui/Checkbox.js.map +1 -1
  361. package/ui/ConnectionStatus.js +5 -5
  362. package/ui/ContextMenu.js +5 -5
  363. package/ui/DateSeparator.js +4 -4
  364. package/ui/Dropdown.js +3 -3
  365. package/ui/EmojiReactions.js +7 -7
  366. package/ui/FileMessageItemBody.js +6 -6
  367. package/ui/FileViewer.js +7 -7
  368. package/ui/Icon.js +1 -1
  369. package/ui/IconButton.js +1 -1
  370. package/ui/ImageRenderer.js +1 -1
  371. package/ui/Input.js +3 -3
  372. package/ui/Label.js +3 -3
  373. package/ui/LinkLabel.js +3 -3
  374. package/ui/Loader.js +1 -1
  375. package/ui/MentionLabel.js +11 -11
  376. package/ui/MessageContent.js +14 -14
  377. package/ui/MessageInput.js +10 -10
  378. package/ui/MessageItemMenu.js +7 -7
  379. package/ui/MessageItemReactionMenu.js +5 -5
  380. package/ui/MessageSearchFileItem.js +10 -10
  381. package/ui/MessageSearchItem.js +10 -10
  382. package/ui/MessageStatus.js +8 -8
  383. package/ui/Modal.js +12 -9
  384. package/ui/Modal.js.map +1 -1
  385. package/ui/MutedAvatarOverlay.js +1 -1
  386. package/ui/OGMessageItemBody.js +11 -11
  387. package/ui/OpenChannelAdminMessage.js +4 -4
  388. package/ui/OpenChannelAvatar.js +7 -7
  389. package/ui/OpenchannelConversationHeader.js +7 -7
  390. package/ui/OpenchannelFileMessage.js +17 -17
  391. package/ui/OpenchannelFileMessage.js.map +1 -1
  392. package/ui/OpenchannelOGMessage.js +17 -17
  393. package/ui/OpenchannelOGMessage.js.map +1 -1
  394. package/ui/OpenchannelThumbnailMessage.js +16 -16
  395. package/ui/OpenchannelThumbnailMessage.js.map +1 -1
  396. package/ui/OpenchannelUserMessage.js +17 -17
  397. package/ui/OpenchannelUserMessage.js.map +1 -1
  398. package/ui/PlaceHolder.js +6 -6
  399. package/ui/QuoteMessage.js +7 -7
  400. package/ui/QuoteMessageInput.js +7 -7
  401. package/ui/ReactionBadge.js +3 -3
  402. package/ui/ReactionButton.js +1 -1
  403. package/ui/SortByRow.js +1 -1
  404. package/ui/TextButton.js +2 -2
  405. package/ui/TextMessageItemBody.js +11 -11
  406. package/ui/ThumbnailMessageItemBody.js +3 -3
  407. package/ui/Tooltip.js +3 -3
  408. package/ui/TooltipWrapper.js +1 -1
  409. package/ui/UnknownMessageItemBody.js +7 -7
  410. package/ui/UserListItem.js +34 -61
  411. package/ui/UserListItem.js.map +1 -1
  412. package/ui/UserProfile.js +10 -10
  413. package/ui/Word.js +11 -11
  414. package/useSendbirdStateContext.js +1 -1
  415. package/{utils-02eaadb8.js → utils-43a00393.js} +1 -1
  416. package/{utils-02eaadb8.js.map → utils-43a00393.js.map} +1 -1
  417. package/{utils-fb8d9bf1.js → utils-af217adb.js} +1 -1
  418. package/{utils-fb8d9bf1.js.map → utils-af217adb.js.map} +1 -1
  419. package/{utils-78b45bd0.js → utils-cf75b861.js} +1 -1
  420. package/{utils-78b45bd0.js.map → utils-cf75b861.js.map} +1 -1
  421. package/{uuid-d61c5d2d.js → uuid-b7da2ddf.js} +1 -1
  422. package/{uuid-d61c5d2d.js.map → uuid-b7da2ddf.js.map} +1 -1
  423. package/withSendbird.js +1 -1
  424. package/MemberList-f79c33ff.js.map +0 -1
  425. package/OpenChannelProvider-e5364b83.js.map +0 -1
  426. package/__bundle-7dfccc8c-db2ded0f.js +0 -4396
  427. package/__bundle-7dfccc8c-db2ded0f.js.map +0 -1
  428. package/cjs/MemberList-95fc8f1a.js.map +0 -1
  429. package/cjs/OpenChannelProvider-cc9ee134.js.map +0 -1
  430. package/cjs/__bundle-7dfccc8c-e40d0934.js +0 -4523
  431. package/cjs/__bundle-7dfccc8c-e40d0934.js.map +0 -1
  432. package/cjs/groupChannel-7c2201a9.js +0 -9
  433. package/cjs/groupChannel-7c2201a9.js.map +0 -1
  434. package/cjs/openChannel-1f1f5648.js +0 -5251
  435. package/cjs/openChannel-1f1f5648.js.map +0 -1
  436. package/cjs/stringSet-f932274f.js.map +0 -1
  437. package/groupChannel-4ad208bd.js.map +0 -1
  438. package/openChannel-6f350123.js +0 -5246
  439. package/openChannel-6f350123.js.map +0 -1
  440. package/package-lock.json +0 -26318
  441. package/stringSet-f697bfff.js.map +0 -1
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var __bundle7dfccc8c = require('./__bundle-7dfccc8c-1748a942.js');
4
+
5
+ var yt;!function(e){e.NONE="none",e.JOINED="joined",e.INVITED="invited";}(yt||(yt={}));var Ct,Nt,bt,Mt,St;exports.At = void 0;var Tt,Ut,It=function(i){function a(e,r){var s=i.call(this,e,r)||this;return s.state=null,s.role=null,s.isMuted=!1,s.isBlockedByMe=!1,s.isBlockingMe=!1,s.state=__bundle7dfccc8c.m(yt,r.state)?r.state:null,s.role=__bundle7dfccc8c.m(__bundle7dfccc8c.re$1,r.role)?r.role:null,r.hasOwnProperty("is_muted")&&(s.isMuted=r.is_muted),r.hasOwnProperty("is_blocked_by_me")&&(s.isBlockedByMe=r.is_blocked_by_me),r.hasOwnProperty("is_blocking_me")&&(s.isBlockingMe=r.is_blocking_me),s}return __bundle7dfccc8c.t(a,i),a.payloadify=function(e){return e?__bundle7dfccc8c.U(__bundle7dfccc8c.n(__bundle7dfccc8c.n({},i.payloadify.call(this,e)),{state:e.state,role:e.role,is_muted:e.isMuted,is_blocked_by_me:e.isBlockedByMe,is_blocking_me:e.isBlockingMe})):null},a}(__bundle7dfccc8c.Ue$1),wt=function(t){function n(e,n){var r,s,o=this;return (o=t.call(this,e)||this).channelUrl=null!==(r=n.channel_url)&&void 0!==r?r:"",o.channelType=null!==(s=n.channel_type)&&void 0!==s?s:__bundle7dfccc8c.ne.GROUP,o.reader=new __bundle7dfccc8c.ct(o._iid,n.user),o.readAt=n.ts,o}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.Le);!function(e){e.ALL="all",e.PUBLIC="public",e.PRIVATE="private";}(Ct||(Ct={})),function(e){e.ALL="all",e.JOINED="joined_only",e.INVITED="invited_only",e.INVITED_BY_FRIEND="invited_by_friend",e.INVITED_BY_NON_FRIEND="invited_by_non_friend";}(Nt||(Nt={})),function(e){e.ALL="all",e.SUPER="super",e.NON_SUPER="nonsuper",e.BROADCAST_ONLY="broadcast_only",e.EXCLUSIVE_ONLY="exclusive_only";}(bt||(bt={})),function(e){e.ALL="all",e.UNREAD_MESSAGE="unread_message";}(Mt||(Mt={})),function(e){e.ALL="all",e.UNHIDDEN="unhidden_only",e.HIDDEN="hidden_only",e.HIDDEN_ALLOW_AUTO_UNHIDE="hidden_allow_auto_unhide",e.HIDDEN_PREVENT_AUTO_UNHIDE="hidden_prevent_auto_unhide";}(St||(St={})),function(e){e.ALL="all",e.OPERATOR="operator",e.NONOPERATOR="nonoperator";}(exports.At||(exports.At={})),function(e){e.AND="AND",e.OR="OR";}(Tt||(Tt={})),function(e){e.MEMBER_NICKNAME="member_nickname",e.CHANNEL_NAME="channel_name";}(Ut||(Ut={}));var Dt,Lt=function(){function e(){this._searchFilter=null,this._userIdsFilter=null,this.includeEmpty=!1,this.nicknameContainsFilter="",this.channelNameContainsFilter="",this.myMemberStateFilter=Nt.ALL,this.customTypesFilter=null,this.channelUrlsFilter=null,this.superChannelFilter=bt.ALL,this.publicChannelFilter=Ct.ALL,this.customTypeStartsWithFilter=null,this.unreadChannelFilter=Mt.ALL,this.hiddenChannelFilter=St.UNHIDDEN,this.includeFrozen=!0;}return e.prototype._isFriend=function(e){return !!e.friendDiscoveryKey||!!e.friendName},Object.defineProperty(e.prototype,"searchFilter",{get:function(){return this._searchFilter},enumerable:!1,configurable:!0}),e.prototype.setSearchFilter=function(e,t){Array.isArray(e)&&0!==e.length&&"string"==typeof t&&t&&(this._searchFilter={query:t,fields:e});},Object.defineProperty(e.prototype,"userIdsFilter",{get:function(){return this._userIdsFilter},enumerable:!1,configurable:!0}),e.prototype.setUserIdsFilter=function(e,t,n){void 0===n&&(n=Tt.AND),this._userIdsFilter={userIds:e,includeMode:t,queryType:n};},e.prototype.clone=function(){var t=new e;this.searchFilter&&t.setSearchFilter(this.searchFilter.fields,this.searchFilter.query),this.userIdsFilter&&t.setUserIdsFilter(this.userIdsFilter.userIds,this.userIdsFilter.includeMode,this.userIdsFilter.queryType);var n=JSON.parse(JSON.stringify(this));return Object.keys(n).forEach((function(e){t[e]=n[e];})),t},e.prototype.match=function(e,t){if(this._searchFilter){var n=this._searchFilter,r=n.query,s=n.fields;if(r&&s&&s.length>0&&!s.some((function(t){switch(t){case Ut.CHANNEL_NAME:return e.name.toLowerCase().includes(r.toLowerCase());case Ut.MEMBER_NICKNAME:return e.members.some((function(e){return e.nickname.toLowerCase().includes(r.toLowerCase())}));default:return !0}})))return !1}if(this._userIdsFilter){var i=this._userIdsFilter,a=i.userIds,o=i.includeMode,u=i.queryType,l=e.members.map((function(e){return e.userId}));if(o){if(a.length>0)switch(u){case Tt.AND:if(a.some((function(e){return !l.includes(e)})))return !1;break;case Tt.OR:if(a.every((function(e){return !l.includes(e)})))return !1}}else {if(a.includes(t)||a.push(t),e.members.length>a.length)return !1;if(!__bundle7dfccc8c.T$1(a,l))return !1}}if(!this.includeEmpty&&!e.lastMessage)return !1;if(!this.includeFrozen&&e.isFrozen)return !1;if(this.customTypesFilter&&this.customTypesFilter.length>0&&!this.customTypesFilter.includes(e.customType))return !1;if(this.customTypeStartsWithFilter&&!new RegExp("^".concat(this.customTypeStartsWithFilter)).test(e.customType))return !1;if(this.channelNameContainsFilter&&!e.name.toLowerCase().includes(this.channelNameContainsFilter.toLowerCase()))return !1;if(this.nicknameContainsFilter){var h=this.nicknameContainsFilter.toLowerCase();if(e.members.every((function(e){return !e.nickname.toLowerCase().includes(h)})))return !1}if(this.channelUrlsFilter&&this.channelUrlsFilter.length>0&&!this.channelUrlsFilter.includes(e.url))return !1;if(this.myMemberStateFilter)switch(this.myMemberStateFilter){case Nt.JOINED:if("joined"!==e.myMemberState)return !1;break;case Nt.INVITED:if("invited"!==e.myMemberState)return !1;break;case Nt.INVITED_BY_FRIEND:if("invited"!==e.myMemberState||!this._isFriend(e.inviter))return !1;break;case Nt.INVITED_BY_NON_FRIEND:if("invited"!==e.myMemberState||this._isFriend(e.inviter))return !1;break;case Nt.ALL:if("none"===e.myMemberState)return !1}if(this.hiddenChannelFilter)switch(this.hiddenChannelFilter){case St.UNHIDDEN:if(e.isHidden||"unhidden"!==e.hiddenState)return !1;break;case St.HIDDEN:if(!e.isHidden)return !1;break;case St.HIDDEN_ALLOW_AUTO_UNHIDE:if(!e.isHidden||"hidden_allow_auto_unhide"!==e.hiddenState)return !1;break;case St.HIDDEN_PREVENT_AUTO_UNHIDE:if(!e.isHidden||"hidden_prevent_auto_unhide"!==e.hiddenState)return !1}if(this.unreadChannelFilter&&this.unreadChannelFilter===Mt.UNREAD_MESSAGE)if(0===e.unreadMessageCount)return !1;if(this.publicChannelFilter)switch(this.publicChannelFilter){case Ct.PUBLIC:if(!e.isPublic)return !1;break;case Ct.PRIVATE:if(e.isPublic)return !1}if(this.superChannelFilter)switch(this.superChannelFilter){case bt.SUPER:if(!e.isSuper)return !1;break;case bt.NON_SUPER:if(e.isSuper)return !1}return !0},e}(),Rt=function(t){function n(e,n){var r=n.sdkState,s=n.cacheContext,i=t.call(this,e)||this;return i._channels=new Map,i._sdkState=r,i._cacheContext=s,i}return __bundle7dfccc8c.t(n,t),Object.defineProperty(n.prototype,"collection",{get:function(){var e=this._cacheContext.nestdb;return e?e.collection(__bundle7dfccc8c.W):null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localCacheEnabled",{get:function(){return this._cacheContext.localCacheEnabled&&!!this.collection},enumerable:!1,configurable:!0}),n.prototype._serialize=function(e,t){return void 0===t&&(t=0),__bundle7dfccc8c.n(__bundle7dfccc8c.n({},e.serialize()),{lastMessageUpdatedAt:e.lastMessage?e.lastMessage.createdAt:0,syncIndex:t})},n.prototype._deserialize=function(e){return Bn.of(this._iid).buildGroupChannelFromSerializedData(e)},Object.defineProperty(n.prototype,"channels",{get:function(){return __bundle7dfccc8c.a([],__bundle7dfccc8c.o(this._channels.values()),!1)},enumerable:!1,configurable:!0}),n.prototype.isCachedInMemory=function(e){return this._channels.has(e)},n.prototype.get=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return this._channels.has(e)?[3,3]:this.localCacheEnabled?[4,this.collection.getByKey(e)]:[3,2];case 1:if(t=r.sent())return n=this._deserialize(t),this._channels.set(e,n),[2,n];r.label=2;case 2:return [2,null];case 3:return [2,this._channels.get(e)]}}))}))},n.prototype.fetch=function(e){var t=e.token,n=e.limit,r=void 0===n?__bundle7dfccc8c.j$1:n,s=e.backward,i=void 0!==s&&s,a=e.filter,o=void 0===a?new Lt:a,u=e.order,c=void 0===u?__bundle7dfccc8c.K.LATEST_LAST_MESSAGE:u;return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,n,s,a,u=this;return __bundle7dfccc8c.i(this,(function(l){switch(l.label){case 0:return this.localCacheEnabled?(e=__bundle7dfccc8c.$$1(c),n={where:function(e){if(t)switch(c){case __bundle7dfccc8c.K.CHANNEL_NAME_ALPHABETICAL:if(!i&&e.name.localeCompare(t)<0||i&&e.name.localeCompare(t)>0)return !1;break;case __bundle7dfccc8c.K.CHRONOLOGICAL:if(!i&&e.createdAt>t||i&&e.createdAt<t)return !1;break;case __bundle7dfccc8c.K.LATEST_LAST_MESSAGE:if(!i&&e.lastMessageUpdatedAt>t||i&&e.lastMessageUpdatedAt<t)return !1}return o.match(u._deserialize(e),u._sdkState.userId)},index:e,backward:i},[4,this.collection.query(n)]):[3,3];case 1:return [4,l.sent().fetch({limit:r})];case 2:return s=l.sent(),(a=s.map((function(e){return u._deserialize(e)}))).forEach((function(e){u._channels.has(e.url)||u._channels.set(e.url,e);})),[2,a];case 3:return [2,[]]}}))}))},n.prototype.upsert=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r=this;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:if(e.forEach((function(e){if(r._channels.has(e.url)){var t=r._channels.get(e.url);Object.assign(t,e,{_iid:r._iid});}else r._channels.set(e.url,e);})),!this.localCacheEnabled)return [3,2];for(n in t=[],e)t.push(this._serialize(e[n],parseInt(n)));return [4,this.collection.upsertMany(t)];case 1:s.sent(),s.label=2;case 2:return [2]}}))}))},n.prototype.remove=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,s,i,a;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:o.trys.push([0,5,6,7]),t=__bundle7dfccc8c.s(e),n=t.next(),o.label=1;case 1:return n.done?[3,4]:(r=n.value,this._channels.delete(r),this.localCacheEnabled?[4,this.collection.remove(r)]:[3,3]);case 2:o.sent(),o.label=3;case 3:return n=t.next(),[3,1];case 4:return [3,7];case 5:return s=o.sent(),i={error:s},[3,7];case 6:try{n&&!n.done&&(a=t.return)&&a.call(t);}finally{if(i)throw i.error}return [7];case 7:return [2]}}))}))},n.prototype.clear=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return this.clearMemoryCache(),this.localCacheEnabled?[4,this.collection.clear()]:[3,2];case 1:e.sent(),e.label=2;case 2:return [2]}}))}))},n.prototype.clearMemoryCache=function(){this._channels.clear();},n.prototype._setBlockStateOfAllChannels=function(e,t,n){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var r,s,i,a,o,u,c,l,h,d,p,m,v,g,E,y,C,N,b;return __bundle7dfccc8c.i(this,(function(_){switch(_.label){case 0:if(r=[],e===this._sdkState.userId)try{for(s=__bundle7dfccc8c.s(this._channels.values()),i=s.next();!i.done;i=s.next()){l=i.value;try{for(g=void 0,a=__bundle7dfccc8c.s(l.members),o=a.next();!o.done;o=a.next())if((p=o.value).userId===t){p.isBlockedByMe=n,r.push(l);break}}catch(e){g={error:e};}finally{try{o&&!o.done&&(E=a.return)&&E.call(a);}finally{if(g)throw g.error}}}}catch(e){m={error:e};}finally{try{i&&!i.done&&(v=s.return)&&v.call(s);}finally{if(m)throw m.error}}else if(t===this._sdkState.userId)try{for(u=__bundle7dfccc8c.s(this._channels.values()),c=u.next();!c.done;c=u.next()){l=c.value;try{for(N=void 0,h=__bundle7dfccc8c.s(l.members),d=h.next();!d.done;d=h.next())if((p=d.value).userId===e){p.isBlockingMe=n,r.push(l);break}}catch(e){N={error:e};}finally{try{d&&!d.done&&(b=h.return)&&b.call(h);}finally{if(N)throw N.error}}}}catch(e){y={error:e};}finally{try{c&&!c.done&&(C=u.return)&&C.call(u);}finally{if(y)throw y.error}}return r.length>0?[4,this.upsert(r)]:[3,2];case 1:_.sent(),_.label=2;case 2:return [2]}}))}))},n.prototype.block=function(e,t){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return [4,this._setBlockStateOfAllChannels(e,t,!0)];case 1:return n.sent(),[2]}}))}))},n.prototype.unblock=function(e,t){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return [4,this._setBlockStateOfAllChannels(e,t,!1)];case 1:return n.sent(),[2]}}))}))},n.prototype.markAsRead=function(e,t){return void 0===t&&(t=__bundle7dfccc8c.a([],__bundle7dfccc8c.o(this._channels.keys()),!1)),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,s,i,a,o,u,c;return __bundle7dfccc8c.i(this,(function(l){switch(l.label){case 0:n=[],l.label=1;case 1:l.trys.push([1,6,7,8]),r=__bundle7dfccc8c.s(t),s=r.next(),l.label=2;case 2:return s.done?[3,5]:(i=s.value,[4,this.get(i)]);case 3:(a=l.sent())._updateUnreadMemberState(this._sdkState.userId,e)&&(a._updateUnreadCount(0,0),n.push(a)),l.label=4;case 4:return s=r.next(),[3,2];case 5:return [3,8];case 6:return o=l.sent(),u={error:o},[3,8];case 7:try{s&&!s.done&&(c=r.return)&&c.call(r);}finally{if(u)throw u.error}return [7];case 8:return n.length>0?[4,this.upsert(n)]:[3,10];case 9:l.sent(),l.label=10;case 10:return [2]}}))}))},n}(__bundle7dfccc8c.Le),Ot={invitedUserIds:null,channelUrl:null,coverUrl:null,coverImage:null,isDistinct:null,isSuper:null,isBroadcast:null,isExclusive:null,isPublic:null,isDiscoverable:null,isStrict:null,isEphemeral:null,accessCode:null,name:null,data:null,customType:null,operatorUserIds:null,messageSurvivalSeconds:null},kt=function(e){return __bundle7dfccc8c.E("string",e.invitedUserIds,!0)&&__bundle7dfccc8c.y("string",e.channelUrl,!0)&&__bundle7dfccc8c.y("string",e.coverUrl,!0)&&(__bundle7dfccc8c.S(e.coverImage)||__bundle7dfccc8c.y("string",e.coverImage)||null===e.coverImage)&&__bundle7dfccc8c.y("boolean",e.isDistinct,!0)&&__bundle7dfccc8c.y("boolean",e.isSuper,!0)&&__bundle7dfccc8c.y("boolean",e.isBroadcast,!0)&&__bundle7dfccc8c.y("boolean",e.isExclusive,!0)&&__bundle7dfccc8c.y("boolean",e.isPublic,!0)&&__bundle7dfccc8c.y("boolean",e.isStrict,!0)&&__bundle7dfccc8c.y("boolean",e.isDiscoverable,!0)&&__bundle7dfccc8c.y("boolean",e.isEphemeral,!0)&&__bundle7dfccc8c.y("string",e.accessCode,!0)&&__bundle7dfccc8c.y("string",e.name,!0)&&__bundle7dfccc8c.y("string",e.data,!0)&&__bundle7dfccc8c.y("string",e.customType,!0)&&__bundle7dfccc8c.E("string",e.operatorUserIds,!0)&&__bundle7dfccc8c.y("number",e.messageSurvivalSeconds,!0)},Ft={customTypes:null,includeEmpty:!1,includeFrozen:!0},Pt=function(e){return __bundle7dfccc8c.E("string",e.customTypes,!0)&&__bundle7dfccc8c.y("boolean",e.includeEmpty)&&__bundle7dfccc8c.y("boolean",e.includeFrozen)},xt={myMemberStateFilter:Nt.ALL},Ht=function(e){return __bundle7dfccc8c.m(Nt,e.myMemberStateFilter)};!function(e){e.GROUP_CHANNEL_UNREAD_MENTION_COUNT="group_channel_unread_mention_count",e.NONSUPER_UNREAD_MENTION_COUNT="non_super_group_channel_unread_mention_count",e.SUPER_UNREAD_MENTION_COUNT="super_group_channel_unread_mention_count",e.GROUP_CHANNEL_UNREAD_MESSAGE_COUNT="group_channel_unread_message_count",e.NONSUPER_UNREAD_MESSAGE_COUNT="non_super_group_channel_unread_message_count",e.SUPER_UNREAD_MESSAGE_COUNT="super_group_channel_unread_message_count",e.GROUP_CHANNEL_INVITATION_COUNT="group_channel_invitation_count",e.NONSUPER_INVITATION_COUNT="non_super_group_channel_invitation_count",e.SUPER_INVITATION_COUNT="super_group_channel_invitation_count";}(Dt||(Dt={}));var Vt,Gt={keys:[]},qt={channelCustomTypesFilter:null,superChannelFilter:bt.ALL},Bt={channelUrl:null,scheduledStatus:null,messageTypeFilter:__bundle7dfccc8c.se$1.ALL};!function(e){e.UNKNOWN="UNKNOWN",e.EVENT_CHANNEL_CREATED="EVENT_CHANNEL_CREATED",e.EVENT_CHANNEL_UPDATED="EVENT_CHANNEL_UPDATED",e.EVENT_CHANNEL_DELETED="EVENT_CHANNEL_DELETED",e.EVENT_CHANNEL_READ="EVENT_CHANNEL_READ",e.EVENT_CHANNEL_DELIVERED="EVENT_CHANNEL_DELIVERED",e.EVENT_CHANNEL_INVITED="EVENT_CHANNEL_INVITED",e.EVENT_CHANNEL_JOINED="EVENT_CHANNEL_JOINED",e.EVENT_CHANNEL_LEFT="EVENT_CHANNEL_LEFT",e.EVENT_CHANNEL_ACCEPTED_INVITE="EVENT_CHANNEL_ACCEPTED_INVITE",e.EVENT_CHANNEL_DECLINED_INVITE="EVENT_CHANNEL_DECLINED_INVITE",e.EVENT_CHANNEL_OPERATOR_UPDATED="EVENT_CHANNEL_OPERATOR_UPDATED",e.EVENT_CHANNEL_MUTED="EVENT_CHANNEL_MUTED",e.EVENT_CHANNEL_UNMUTED="EVENT_CHANNEL_UNMUTED",e.EVENT_CHANNEL_FROZEN="EVENT_CHANNEL_FROZEN",e.EVENT_CHANNEL_UNFROZEN="EVENT_CHANNEL_UNFROZEN",e.EVENT_CHANNEL_HIDDEN="EVENT_CHANNEL_HIDDEN",e.EVENT_CHANNEL_UNHIDDEN="EVENT_CHANNEL_UNHIDDEN",e.EVENT_CHANNEL_RESET_HISTORY="EVENT_CHANNEL_RESET_HISTORY",e.EVENT_CHANNEL_TYPING_STATUS_UPDATE="EVENT_CHANNEL_TYPING_STATUS_UPDATE",e.EVENT_CHANNEL_MEMBER_COUNT_UPDATED="EVENT_CHANNEL_MEMBER_COUNT_UPDATED",e.EVENT_MESSAGE_SENT="EVENT_MESSAGE_SENT",e.EVENT_MESSAGE_RECEIVED="EVENT_MESSAGE_RECEIVED",e.EVENT_MESSAGE_UPDATED="EVENT_MESSAGE_UPDATED",e.REQUEST_CHANNEL="REQUEST_CHANNEL",e.REQUEST_CHANNEL_CHANGELOGS="REQUEST_CHANNEL_CHANGELOGS",e.SYNC_CHANNEL_BACKGROUND="SYNC_CHANNEL_BACKGROUND",e.SYNC_CHANNEL_CHANGELOGS="SYNC_CHANNEL_CHANGELOGS";}(Vt||(Vt={}));var Kt=function(e){return e.startsWith("EVENT_")||e===Vt.SYNC_CHANNEL_BACKGROUND||e===Vt.SYNC_CHANNEL_CHANGELOGS},jt=function(t){function n(e){var n=e.channels,r=e.source,s=t.call(this)||this;return s.channels=n,s.source=r,s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.L),zt=function(t){function n(e){var n=e.channelUrls,r=e.source,s=t.call(this)||this;return s.channelUrls=n,s.source=r,s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.L),Qt=function(){function e(e){var t=e.groupChannelCache,n=e.messageCache,r=e.unsentMessageCache,s=e.dispatcher,i=this;this._observers=new Map,s.on((function(e){return __bundle7dfccc8c.r(i,void 0,void 0,(function(){var s,i,a,o,u=this;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:return e instanceof jt?(s=e.channels,o=e.source,i=s.filter((function(e){return e instanceof Vr})),[4,t.upsert(i)]):[3,2];case 1:return c.sent(),this._broadcastUpdateEvent(i,o),[3,7];case 2:return e instanceof zt?(a=e.channelUrls,o=e.source,[4,t.remove(a)]):[3,5];case 3:return c.sent(),[4,__bundle7dfccc8c.Se((function(){return __bundle7dfccc8c.r(u,void 0,void 0,(function(){var e,t,s,i,o,u;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:c.trys.push([0,6,7,8]),e=__bundle7dfccc8c.s(a),t=e.next(),c.label=1;case 1:return t.done?[3,5]:(s=t.value,[4,n.removeMessagesOfChannel(s)]);case 2:return c.sent(),[4,r.removeMessagesOfChannel(s)];case 3:c.sent(),c.label=4;case 4:return t=e.next(),[3,1];case 5:return [3,8];case 6:return i=c.sent(),o={error:i},[3,8];case 7:try{t&&!t.done&&(u=e.return)&&u.call(e);}finally{if(o)throw o.error}return [7];case 8:return [2]}}))}))}))];case 4:return c.sent(),this._broadcastRemoveEvent(a,o),[3,7];case 5:return e instanceof __bundle7dfccc8c.ve?[4,t.fetch({token:Number.MAX_SAFE_INTEGER,limit:Number.MAX_SAFE_INTEGER})]:[3,7];case 6:c.sent(),c.label=7;case 7:return [2]}}))}))}));}return e.prototype._broadcastUpdateEvent=function(e,t){var n,r;try{for(var s=__bundle7dfccc8c.s(this._observers.values()),i=s.next();!i.done;i=s.next()){i.value.onUpdate(e,t);}}catch(e){n={error:e};}finally{try{i&&!i.done&&(r=s.return)&&r.call(s);}finally{if(n)throw n.error}}},e.prototype._broadcastRemoveEvent=function(e,t){var n,r;try{for(var s=__bundle7dfccc8c.s(this._observers.values()),i=s.next();!i.done;i=s.next()){i.value.onRemove(e,t);}}catch(e){n={error:e};}finally{try{i&&!i.done&&(r=s.return)&&r.call(s);}finally{if(n)throw n.error}}},e.prototype.subscribe=function(e,t){this._observers.set(e,t);},e.prototype.unsubscribe=function(e){this._observers.delete(e);},e}(),Wt=function(){function e(e){var t=e.messageCache,n=e.unsentMessageCache,r=e.dispatcher,s=e.logger,i=this;this._observers=new Map,this._logger=null,this._logger=s,r.on((function(e){return __bundle7dfccc8c.r(i,void 0,void 0,(function(){var r,s,i,a,o,u,c=this;return __bundle7dfccc8c.i(this,(function(l){switch(l.label){case 0:return e instanceof __bundle7dfccc8c.un?(r=e.messages,u=e.source,s=r.filter((function(e){return e.messageId>0})),i=r.filter((function(e){return 0===e.messageId})),s.length>0?[4,__bundle7dfccc8c.Se((function(){return __bundle7dfccc8c.r(c,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return [4,t.upsert(s)];case 1:return e.sent(),[4,n.remove(s.map((function(e){return e instanceof __bundle7dfccc8c.xt?e.reqId:null})).filter((function(e){return null!==e})))];case 2:return e.sent(),[2]}}))}))}))]:[3,2]):[3,5];case 1:l.sent(),this._broadcastUpdateEvent(s,u),l.label=2;case 2:return i.length>0?[4,__bundle7dfccc8c.Se((function(){return __bundle7dfccc8c.r(c,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return [4,n.upsert(i)];case 1:return e.sent(),[2]}}))}))}))]:[3,4];case 3:l.sent(),this._broadcastUpdateEvent(i,u),l.label=4;case 4:return [3,9];case 5:return e instanceof __bundle7dfccc8c.cn?(a=e.messageIds,u=e.source,[4,__bundle7dfccc8c.Se((function(){return __bundle7dfccc8c.r(c,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return [4,t.remove(a)];case 1:return e.sent(),[2]}}))}))}))]):[3,7];case 6:return l.sent(),this._broadcastRemoveEvent(a,u),[3,9];case 7:return e instanceof __bundle7dfccc8c.ln?(o=e.reqId,u=e.source,[4,__bundle7dfccc8c.Se((function(){return __bundle7dfccc8c.r(c,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return [4,n.remove([o])];case 1:return e.sent(),[2]}}))}))}))]):[3,9];case 8:l.sent(),this._broadcastRemoveUnsentEvent(o,u),l.label=9;case 9:return [2]}}))}))}));}return e.prototype._broadcastUpdateEvent=function(e,t){var n,r;try{for(var s=__bundle7dfccc8c.s(this._observers.values()),i=s.next();!i.done;i=s.next()){i.value.onUpdate(e,t);}}catch(e){n={error:e};}finally{try{i&&!i.done&&(r=s.return)&&r.call(s);}finally{if(n)throw n.error}}},e.prototype._broadcastRemoveEvent=function(e,t){var n,r;try{for(var s=__bundle7dfccc8c.s(this._observers.values()),i=s.next();!i.done;i=s.next()){i.value.onRemove(e,t);}}catch(e){n={error:e};}finally{try{i&&!i.done&&(r=s.return)&&r.call(s);}finally{if(n)throw n.error}}},e.prototype._broadcastRemoveUnsentEvent=function(e,t){var n,r;try{for(var s=__bundle7dfccc8c.s(this._observers.values()),i=s.next();!i.done;i=s.next()){i.value.onRemoveUnsent(e,t);}}catch(e){n={error:e};}finally{try{i&&!i.done&&(r=s.return)&&r.call(s);}finally{if(n)throw n.error}}},e.prototype.subscribe=function(e,t){this._observers.set(e,t);},e.prototype.unsubscribe=function(e){this._observers.delete(e);},e}(),Yt=function(t){function n(e){var n=e.userId,i=e.ts,a=e.token,o=e.filter,u=t.call(this)||this,c=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},Ft),o),l=c.customTypes,h=c.includeEmpty,d=c.includeFrozen;return u.method=__bundle7dfccc8c.d.GET,u.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/my_group_channels/changelogs"),u.params=__bundle7dfccc8c.U({show_delivery_receipt:!0,show_member:!0,show_read_receipt:!0,change_ts:i,token:a,custom_types:l,show_empty:h,show_frozen:d}),u}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),Jt=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.updatedChannels=n.updated.map((function(t){return new Vr(e,t)})),r.deletedChannelUrls=n.deleted,r.hasMore=n.has_more,r.token=n.next,r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),Xt=function(t){function n(e){var n=e.channelUrl,r=e.isInternalCall,s=t.call(this)||this;return s.method=__bundle7dfccc8c.d.GET,s.path="".concat(r?__bundle7dfccc8c.Fe:__bundle7dfccc8c.qe,"/").concat(encodeURIComponent(n)),s.params={show_member:!0,show_read_receipt:!0,show_delivery_receipt:!0},s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),Zt=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.channel=null,r.channel=new Vr(e,n),r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),$t=function(t){function n(e){var n=this,s=e.userId,i=e.token,a=e.limit,o=e.order,u=e.includeEmpty,c=e.myMemberStateFilter,l=e.superChannelFilter,h=e.publicChannelFilter,d=e.unreadChannelFilter,_=e.nicknameContainsFilter,f=e.channelNameContainsFilter,p=e.channelUrlsFilter,m=e.customTypesFilter,v=e.customTypeStartsWithFilter,g=e.hiddenChannelFilter,E=e.metadataOrderKeyFilter,y=e.metadataKey,C=e.metadataValues,N=e.metadataValueStartsWith,b=e.includeFrozen,M=e.includeMetaData,S=e.searchFilter,U=e.userIdsFilter;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.GET,n.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(s),"/my_group_channels"),n.params=__bundle7dfccc8c.U({token:i,limit:a,order:o,show_member:!0,show_read_receipt:!0,show_delivery_receipt:!0,show_empty:u,member_state_filter:c,super_mode:l,public_mode:h,unread_filter:d,members_nickname_contains:_,name_contains:f,channel_urls:p,custom_types:m,custom_type_startswith:v,hidden_mode:g,metadata_order_key:E,metadata_key:y,metadata_values:C,metadata_value_startswith:N,show_frozen:b,show_metadata:M}),S&&S.query&&S.fields&&(n.params.search_query=S.query,n.params.search_fields=S.fields),U&&U.userIds&&U.userIds.length>0&&(U.includeMode?(n.params.members_include_in=U.userIds,n.params.query_type=U.queryType.toUpperCase()):n.params.members_exactly_in=U.userIds),n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),en=function(t){function n(e,n){var r=t.call(this,e,n)||this;r.token=null,r.channels=[],r.ts=null;var s=n.next,i=n.channels,a=n.ts;return r.token=s,i&&i.length>0&&(r.channels=i.map((function(t){return t.ts=a,new Vr(e,t)}))),r.ts=null!=a?a:null,r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),tn=function(t){function n(e){var n=e.userId,r=e.filter,s=t.call(this)||this,i=r.myMemberStateFilter;return s.method=__bundle7dfccc8c.d.GET,s.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/group_channel_count"),s.params={state:null!=i?i:Nt.ALL},s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),nn=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.groupChannelCount=n.group_channel_count,r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),rn=function(t){function n(e){var n=e.userId,r=e.filter,s=t.call(this)||this,i=r.keys;return s.method=__bundle7dfccc8c.d.GET,s.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/unread_item_count"),s.params={item_keys:i},s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),sn=function(t){function n(e,n){var r=t.call(this,e,n)||this;return "number"==typeof n[Dt.GROUP_CHANNEL_UNREAD_MENTION_COUNT]&&(r.groupChannelUnreadMentionCount=n[Dt.GROUP_CHANNEL_UNREAD_MENTION_COUNT]),"number"==typeof n[Dt.GROUP_CHANNEL_UNREAD_MESSAGE_COUNT]&&(r.groupChannelUnreadMessageCount=n[Dt.GROUP_CHANNEL_UNREAD_MESSAGE_COUNT]),"number"==typeof n[Dt.GROUP_CHANNEL_INVITATION_COUNT]&&(r.groupChannelInvitationCount=n[Dt.GROUP_CHANNEL_INVITATION_COUNT]),"number"==typeof n[Dt.SUPER_UNREAD_MENTION_COUNT]&&(r.superGroupChannelUnreadMentionCount=n[Dt.SUPER_UNREAD_MENTION_COUNT]),"number"==typeof n[Dt.SUPER_UNREAD_MESSAGE_COUNT]&&(r.superGroupChannelUnreadMessageCount=n[Dt.SUPER_UNREAD_MESSAGE_COUNT]),"number"==typeof n[Dt.SUPER_INVITATION_COUNT]&&(r.superGroupChannelInvitationCount=n[Dt.SUPER_INVITATION_COUNT]),"number"==typeof n[Dt.NONSUPER_UNREAD_MENTION_COUNT]&&(r.nonSuperGroupChannelUnreadMentionCount=n[Dt.NONSUPER_UNREAD_MENTION_COUNT]),"number"==typeof n[Dt.NONSUPER_UNREAD_MESSAGE_COUNT]&&(r.nonSuperGroupChannelUnreadMessageCount=n[Dt.NONSUPER_UNREAD_MESSAGE_COUNT]),"number"==typeof n[Dt.NONSUPER_INVITATION_COUNT]&&(r.nonSuperGroupChannelInvitationCount=n[Dt.NONSUPER_INVITATION_COUNT]),r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),an=function(t){function n(e){var n=e.userId,r=t.call(this)||this;return r.method=__bundle7dfccc8c.d.GET,r.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/unread_channel_count"),r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),on=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.unreadCount=n.unread_count,r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),un=function(t){function n(e){var n=e.userId,r=e.filter,s=t.call(this)||this,i=r.channelCustomTypesFilter,a=r.superChannelFilter;return s.method=__bundle7dfccc8c.d.GET,s.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/unread_message_count"),s.params={super_mode:null!=a?a:bt.ALL,custom_types:i},s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),cn=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.unreadCount=n.unread_count,r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),ln=function(t){function n(e){var n=e.channelUrl,r=e.scheduledStatus,s=e.messageTypeFilter,i=t.call(this)||this;return i.method=__bundle7dfccc8c.d.GET,i.path="".concat(__bundle7dfccc8c.Ve,"/count"),i.params={channel_url:n,status:dn(r)},s&&(i.params.message_type=s),i}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),hn=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.count=n.count,r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),dn=function(e){if(e){var t=[];e.forEach((function(e){switch(e){case __bundle7dfccc8c.Ct.PENDING:t.push(__bundle7dfccc8c.Ot.PENDING);break;case __bundle7dfccc8c.Ct.SENT:t.push(__bundle7dfccc8c.Ot.IN_QUEUE),t.push(__bundle7dfccc8c.Ot.SENT);break;case __bundle7dfccc8c.Ct.CANCELED:t.push(__bundle7dfccc8c.Ot.CANCELED);break;case __bundle7dfccc8c.Ct.FAILED:t.push(__bundle7dfccc8c.Ot.FAILED);}}));}},_n=function(t){function n(e){var n=this,s=e.userId,i=e.channelUrl,a=e.coverUrl,o=e.coverImage,u=e.isDistinct,c=e.isSuper,d=e.isBroadcast,_=e.isPublic,f=e.isExclusive,p=e.isDiscoverable,m=e.isStrict,v=e.isEphemeral,g=e.accessCode,E=e.name,y=e.data,C=e.customType,N=e.messageSurvivalSeconds,b=e.invitedUserIds,M=e.operatorUserIds;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.POST,n.path=__bundle7dfccc8c.qe,n.params=__bundle7dfccc8c.U({user_ids:__bundle7dfccc8c.a([s],__bundle7dfccc8c.o(null!=b?b:[]),!1).filter((function(e,t,n){return t===n.indexOf(e)})),channel_url:i,cover_url:a,cover_file:o,is_distinct:u,is_super:c,is_broadcast:d,is_exclusive:f,is_public:_,is_discoverable:p,strict:m,is_ephemeral:v,access_code:g,name:E,data:y,custom_type:C,operator_ids:M,message_survival_seconds:N}),n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),fn=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.channel=new Vr(e,n),r.isCreated=n.is_created,r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),pn=function(t){function n(e){var n=e.userId,r=e.channelUrls,s=t.call(this)||this;return s.method=__bundle7dfccc8c.d.PUT,s.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/mark_as_read_all"),s.params={channel_urls:r},s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q);!function(t){function n(){return null!==t&&t.apply(this,arguments)||this}__bundle7dfccc8c.t(n,t);}(__bundle7dfccc8c.F);var mn=function(t){function n(e){var n=this,r=e.channelUrl,s=e.userId,i=e.accessCode;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.PUT,n.path="".concat(__bundle7dfccc8c.qe,"/").concat(encodeURIComponent(r),"/join"),n.params={user_id:s,access_code:i},n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),vn=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.channel=new Vr(e,n),r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),gn=function(t){function n(e,n,r){var s=t.call(this,e,n,r)||this,i=r.data,a=i.member_count,o=void 0===a?null:a,u=i.joined_member_count,c=void 0===u?null:u,l=i.users,h=void 0===l?null:l;return s.memberCount=o,s.joinedMemberCount=c,s.members=Array.isArray(h)?h.map((function(t){return new It(e,t)})):[new It(e,r.data)],s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.C),En=function(t){function n(e){var n=this,r=e.channelUrl,s=e.userId,i=e.shouldRemoveOperatorStatus;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.PUT,n.path="".concat(__bundle7dfccc8c.qe,"/").concat(encodeURIComponent(r),"/leave"),n.params={user_id:s,should_remove_operator_status:i},n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q);!function(t){function n(e,n){return t.call(this,e,n)||this}__bundle7dfccc8c.t(n,t);}(__bundle7dfccc8c.F);var yn=function(t){function n(e,n,r){var s=t.call(this,e,n,r)||this,i=r.data,a=i.member_count,o=void 0===a?null:a,u=i.joined_member_count,c=void 0===u?null:u;return s.memberCount=o,s.joinedMemberCount=c,s.member=new It(s._iid,r.data),s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.C),Cn=function(t){function n(e){var n=this,r=e.channelUrl,s=e.userIds;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.POST,n.path="".concat(__bundle7dfccc8c.qe,"/").concat(encodeURIComponent(r),"/invite"),n.params={user_ids:s},n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),Nn=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.channel=new Vr(e,n),r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),bn=function(t){function n(e,n,r){var s=t.call(this,e,n,r)||this,i=r.data,o=i.member_count,u=void 0===o?null:o,c=i.joined_member_count,l=void 0===c?null:c,h=i.inviter,d=void 0===h?null:h,_=i.invitees,f=void 0===_?[]:_;return s.memberCount=u,s.joinedMemberCount=l,s.inviter=d?new __bundle7dfccc8c.ct(e,d):null,s.invitees=f.map((function(t){return new It(e,t)})),s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.C),Mn=function(t){function n(e){var n=this,r=e.channelUrl,s=e.userId;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.PUT,n.path="".concat(__bundle7dfccc8c.qe,"/").concat(encodeURIComponent(r),"/decline"),n.params={user_id:s},n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),Sn=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.channel=new Vr(e,n),r.channel.myMemberState=yt.NONE,r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),An=function(t){function n(e,n,r){var s=t.call(this,e,n,r)||this,i=r.data,o=i.member_count,u=void 0===o?null:o,c=i.joined_member_count,l=void 0===c?null:c,h=i.inviter,d=void 0===h?null:h,_=i.invitee,f=void 0===_?null:_;return s.memberCount=u,s.joinedMemberCount=l,s.inviter=d?new __bundle7dfccc8c.ct(e,d):null,s.invitee=f?new It(e,f):null,s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.C),Tn=function(t){function n(e){var n=e.channelUrl;return t.call(this,{code:"READ",ackRequired:!0,payload:{channel_url:n}})||this}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.H$1),Un=function(t){function n(e,n,r){var s=t.call(this,e,"READ",r)||this;return s.readStatus=new wt(e,r),s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.B),In=function(t){function n(e){var n=e.channelUrl,s=e.userId,i=t.call(this)||this;return (i=t.call(this)||this).method=__bundle7dfccc8c.d.PUT,i.path="".concat(__bundle7dfccc8c.qe,"/").concat(encodeURIComponent(n),"/messages/mark_as_delivered"),i.params=__bundle7dfccc8c.U({userId:s}),i}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q);!function(t){function n(){return null!==t&&t.apply(this,arguments)||this}__bundle7dfccc8c.t(n,t);}(__bundle7dfccc8c.F);var wn,Dn=function(t){function n(e,n,r){var s=t.call(this,e,"DLVR",r)||this;return s.channelUrl=r.channel_url,s.deliveredStateUpdate=r.updated,s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.B),Ln=function(t){function n(e){var n=this,r=e.channelUrl,s=e.userId,i=e.hidePreviousMessages,a=e.allowAutoUnhide;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.PUT,n.path="".concat(__bundle7dfccc8c.qe,"/").concat(encodeURIComponent(r),"/hide"),n.params={user_id:s,hide_previous_messages:i,allow_auto_unhide:a},n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),Rn=function(t){function n(e,n){var r=t.call(this,e,n)||this;r.messageOffsetTimestamp=null;var s=n.ts_message_offset;return r.messageOffsetTimestamp=null!=s?s:null,r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),On=function(t){function n(e,n,r){var s=t.call(this,e,"SYEV",r)||this;return s.allowAutoUnhide=null,s.hidePreviousMessages=null,s.messageOffsetTimestamp=null,r.data&&(s.allowAutoUnhide=r.data.allow_auto_unhide,s.hidePreviousMessages=r.data.hide_previous_messages),s.messageOffsetTimestamp=r.ts_message_offset,s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.B),kn=function(t){function n(e){var n=e.channelUrl,r=e.time;return t.call(this,{code:"TPST",ackRequired:!1,payload:{channel_url:n,time:r}})||this}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.H$1),Fn=function(t){function n(e,n,r){var s=t.call(this,e,"SYEV",r)||this;return s.user=new __bundle7dfccc8c.ct(e,r.data),s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.B),Pn=function(t){function n(e){var n=e.channelUrl,r=e.time;return t.call(this,{code:"TPEN",ackRequired:!1,payload:{channel_url:n,time:r}})||this}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.H$1),xn=function(t){function n(e,n,r){var s=t.call(this,e,"SYEV",r)||this;return s.user=new __bundle7dfccc8c.ct(e,r.data),s}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.B),Hn=function(t){function n(e){var n=e.channelUrl,r=e.messageId;return t.call(this,{code:"MACK",ackRequired:!1,payload:{channel_url:n,msg_id:r}})||this}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.H$1),Vn=function(n){function r(e,t){var r,s,i,a,o,u,c,l,h,d,_,f,p,m,v,g,E,y,C,N,b=this;return (b=n.call(this,e,t)||this).includeEmpty=!1,b.includeFrozen=!0,b.includeMetaData=!0,b.channelUrlsFilter=null,b.customTypesFilter=null,b.customTypeStartsWithFilter=null,b.nicknameContainsFilter="",b.channelNameContainsFilter="",b.myMemberStateFilter=Nt.ALL,b.unreadChannelFilter=Mt.ALL,b.superChannelFilter=bt.ALL,b.publicChannelFilter=Ct.ALL,b.hiddenChannelFilter=St.UNHIDDEN,b.searchFilter={fields:[],query:null},b.userIdsFilter={userIds:[],includeMode:!0,queryType:Tt.AND},b.metadataKey=null,b.metadataValues=null,b.metadataOrderKeyFilter=null,b.metadataValueStartsWith=null,b.order=__bundle7dfccc8c.K.LATEST_LAST_MESSAGE,b.includeEmpty=null!==(r=t.includeEmpty)&&void 0!==r&&r,b.includeFrozen=null===(s=t.includeFrozen)||void 0===s||s,b.includeMetaData=null===(i=t.includeMetaData)||void 0===i||i,b.channelUrlsFilter=null!==(a=t.channelUrlsFilter)&&void 0!==a?a:null,b.customTypesFilter=null!==(o=t.customTypesFilter)&&void 0!==o?o:null,b.customTypeStartsWithFilter=null!==(u=t.customTypeStartsWithFilter)&&void 0!==u?u:"",b.nicknameContainsFilter=null!==(c=t.nicknameContainsFilter)&&void 0!==c?c:"",b.channelNameContainsFilter=null!==(l=t.channelNameContainsFilter)&&void 0!==l?l:"",b.myMemberStateFilter=null!==(h=t.myMemberStateFilter)&&void 0!==h?h:Nt.ALL,b.unreadChannelFilter=null!==(d=t.unreadChannelFilter)&&void 0!==d?d:Mt.ALL,b.superChannelFilter=null!==(_=t.superChannelFilter)&&void 0!==_?_:bt.ALL,b.publicChannelFilter=null!==(f=t.publicChannelFilter)&&void 0!==f?f:Ct.ALL,b.hiddenChannelFilter=null!==(p=t.hiddenChannelFilter)&&void 0!==p?p:St.UNHIDDEN,b.searchFilter=null!==(m=t.searchFilter)&&void 0!==m?m:{fields:[],query:null},b.userIdsFilter=null!==(v=t.userIdsFilter)&&void 0!==v?v:{userIds:[],includeMode:!0,queryType:Tt.AND},b.metadataKey=null!==(g=t.metadataKey)&&void 0!==g?g:null,b.metadataValues=null!==(E=t.metadataValues)&&void 0!==E?E:null,b.metadataOrderKeyFilter=null!==(y=t.metadataOrderKeyFilter)&&void 0!==y?y:null,b.metadataValueStartsWith=null!==(C=t.metadataValueStartsWith)&&void 0!==C?C:null,b.order=null!==(N=t.order)&&void 0!==N?N:__bundle7dfccc8c.K.LATEST_LAST_MESSAGE,b}return __bundle7dfccc8c.t(r,n),r.prototype._validate=function(){return n.prototype._validate.call(this)&&__bundle7dfccc8c.y("boolean",this.includeEmpty)&&__bundle7dfccc8c.y("boolean",this.includeFrozen)&&__bundle7dfccc8c.y("boolean",this.includeMetaData)&&__bundle7dfccc8c.y("string",this.channelNameContainsFilter)&&__bundle7dfccc8c.E("string",this.channelUrlsFilter,!0)&&__bundle7dfccc8c.E("string",this.customTypesFilter,!0)&&__bundle7dfccc8c.y("string",this.customTypeStartsWithFilter)&&__bundle7dfccc8c.y("string",this.nicknameContainsFilter)&&__bundle7dfccc8c.m(Nt,this.myMemberStateFilter)&&__bundle7dfccc8c.m(bt,this.superChannelFilter)&&__bundle7dfccc8c.m(Ct,this.publicChannelFilter)&&__bundle7dfccc8c.m(Mt,this.unreadChannelFilter)&&__bundle7dfccc8c.m(St,this.hiddenChannelFilter)&&__bundle7dfccc8c.E(Ut,this.searchFilter.fields)&&__bundle7dfccc8c.y("string",this.searchFilter.query,!0)&&__bundle7dfccc8c.E("string",this.userIdsFilter.userIds)&&__bundle7dfccc8c.y("boolean",this.userIdsFilter.includeMode)&&__bundle7dfccc8c.m(Tt,this.userIdsFilter.queryType)&&__bundle7dfccc8c.m(__bundle7dfccc8c.K,this.order)&&__bundle7dfccc8c.y("string",this.metadataOrderKeyFilter,!0)&&__bundle7dfccc8c.y("string",this.metadataKey,!0)&&__bundle7dfccc8c.E("string",this.metadataValues,!0)&&__bundle7dfccc8c.y("string",this.metadataValueStartsWith,!0)},r.prototype.serialize=function(){return __bundle7dfccc8c.st(this)},r.prototype.next=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,[4,Bn.of(this._iid).getMyGroupChannels(this._token,this,this.limit)]):[3,2]:[3,5];case 1:return e=r.sent(),t=e.channels,n=e.token,this._token=n,this._hasNext=!!n,this._isLoading=!1,[2,t];case 2:return [2,[]];case 3:throw __bundle7dfccc8c.p.queryInProgress;case 4:return [3,6];case 5:throw __bundle7dfccc8c.p.invalidParameters;case 6:return [2]}}))}))},r}(__bundle7dfccc8c.bn),Gn=function(){function e(e){var t=e.top,n=void 0===t?Number.MAX_SAFE_INTEGER:t,r=e.bottom,s=void 0===r?0:r;this.top=n,this.bottom=s;}return e.prototype.includes=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.every((function(t){return e.top<=t&&t<=e.bottom}))},e.prototype.overlap=function(e){return this.includes(e.top)||this.includes(e.bottom)},e.prototype.extends=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.top=Math.min.apply(Math,__bundle7dfccc8c.a([this.top],__bundle7dfccc8c.o(e),!1)),this.bottom=Math.max.apply(Math,__bundle7dfccc8c.a([this.bottom],__bundle7dfccc8c.o(e),!1));},e}(),qn={},Bn=function(){function e(e,t){var n=t.sdkState,r=t.cacheContext,s=t.dispatcher,i=t.sessionManager,a=t.requestQueue,o=t.logger,u=this;this._leftChannels=new Map,this._markAsReadAllLastSentAt=0,this._iid=e,this._sdkState=n,this._sessionManager=i,this._requestQueue=a,this._dispatcher=s,this._logger=o,this._groupChannelHandlers=new Map,this._groupChannelCache=new Rt(this._iid,{sdkState:n,cacheContext:r}),this._unsentMessageCache=new __bundle7dfccc8c.ue$1(this._iid,{sdkState:n,cacheContext:r}),this._messageCache=new __bundle7dfccc8c.he(this._iid,{sdkState:n,cacheContext:r,unsentMessageCache:this._unsentMessageCache}),this._groupChannelBroadcast=new Qt({groupChannelCache:this._groupChannelCache,messageCache:this._messageCache,unsentMessageCache:this._unsentMessageCache,dispatcher:s}),this._messageBroadcast=new Wt({messageCache:this._messageCache,unsentMessageCache:this._unsentMessageCache,dispatcher:s,logger:o}),setInterval((function(){var e,t,n=function(e){e.invalidateTypingStatus()&&(u._dispatcher.dispatch(new jt({channels:[e],source:Vt.EVENT_CHANNEL_TYPING_STATUS_UPDATE})),u._groupChannelHandlers.forEach((function(t){t.onTypingStatusUpdated(e);})));};try{for(var r=__bundle7dfccc8c.s(u._groupChannelCache.channels),s=r.next();!s.done;s=r.next()){n(s.value);}}catch(t){e={error:t};}finally{try{s&&!s.done&&(t=r.return)&&t.call(r);}finally{if(e)throw e.error}}}),1e3),this._dispatcher.on((function(e){e instanceof __bundle7dfccc8c.B?u._handleEvent(e):e instanceof __bundle7dfccc8c.fe&&__bundle7dfccc8c.r(u,void 0,void 0,(function(){var t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return t=e.message,[4,this.getChannel(t.channelUrl,!0)];case 1:return n=r.sent(),t instanceof __bundle7dfccc8c.Vt?n._autoResendUserMessage(t):t instanceof __bundle7dfccc8c.Wt&&n._autoResendFileMessage(t),[2]}}))}));})),qn[e]=this;}return e.of=function(e){return qn[e]},Object.defineProperty(e.prototype,"handlers",{get:function(){return __bundle7dfccc8c.a([],__bundle7dfccc8c.o(this._groupChannelHandlers.values()),!1)},enumerable:!1,configurable:!0}),e.prototype.buildGroupChannelFromSerializedData=function(e){var t=__bundle7dfccc8c.ot(e);return new Vr(this._iid,Vr.payloadify(t))},e.prototype.buildGroupChannelListQueryFromSerializedData=function(e){var t=__bundle7dfccc8c.ot(e);return new Vn(this._iid,t)},e.prototype.buildMemberFromSerializedData=function(e){var t=__bundle7dfccc8c.ot(e);return new It(this._iid,It.payloadify(t))},e.prototype.getChannelFromCache=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,this._groupChannelCache.get(e)];case 1:return [2,t.sent()]}}))}))},e.prototype.getChannelsFromCache=function(e,t,n){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return [4,this._groupChannelCache.fetch({token:e,filter:t,order:n})];case 1:return [2,r.sent()]}}))}))},e.prototype._handleEvent=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,r,s,a,o,u,c,l,h,p,m,v,g,E,y,N,A,T,U,I,w,D,L,R,O,k,F,P,x,H,G,q,B,z,Y,J,X,Z,$,ee,te,ne,re,se,ie,ae,oe,ue,ce,le,he,de,_e,fe,pe,me,ve,ge,Ee,ye,Ce,Ne,be,Me,Se,Ae,Te,Ue,Le,Re,Oe,ke,Fe,Pe,xe,He,Ve,Ge,qe,Be,Ke,je,ze,st,it,at,ot,ut,ct,lt,Et,Ct,Nt,bt,Mt,St,At,Tt,Ut,It,wt,Dt,Lt,Rt,Ot,kt,Ft,Pt,xt,Ht,Gt,qt,Bt,Kt,Qt,Wt,Yt,Jt,Xt,Zt,$t,en,tn=this;return __bundle7dfccc8c.i(this,(function(nn){switch(nn.label){case 0:switch(nn.trys.push([0,72,,73]),e.code){case"MESG":case"FILE":case"ADMM":case"BRDM":return [3,1];case"MEDI":case"FEDI":case"AEDI":return [3,4];case"DELM":return [3,7];case"READ":return [3,10];case"DLVR":return [3,13];case"MRCT":return [3,15];case"MTHD":return [3,19];case"MCNT":return [3,23];case"SYEV":return [3,32];case"USEV":return [3,70]}return [3,71];case 1:return l=null,"MESG"===e.code?l=e.as(__bundle7dfccc8c.gt):"FILE"===e.code?l=e.as(__bundle7dfccc8c.Jt):"ADMM"!==e.code&&"BRDM"!=e.code||(l=e.as(__bundle7dfccc8c.A$1)),l?(t=l.message,r=l.isMentioned,s=l.forceUpdateLastMessage,t.channelType!==__bundle7dfccc8c.ne.GROUP?[3,3]:(__bundle7dfccc8c.Se((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(n){return e=new Hn(t),this._requestQueue.send(e),[2]}))}))})),L=this._groupChannelCache.isCachedInMemory(t.channelUrl),v=t instanceof __bundle7dfccc8c.xt&&t.sender.userId===this._sdkState.userId,[4,this.getChannel(t.channelUrl,!0)])):[3,3];case 2:if((a=nn.sent()).hiddenState=Fr.UNHIDDEN,t instanceof __bundle7dfccc8c.xt){o=__bundle7dfccc8c.St.of(this._iid).useMemberInfoInMessage;try{for(u=__bundle7dfccc8c.s(a.members),c=u.next();!c.done;c=u.next())if((Be=c.value).userId===t.sender.userId){o?(t.sender.nickname=Be.nickname,t.sender.plainProfileUrl=Be.plainProfileUrl,t.sender.metaData=Be.metaData,t.sender.isBlockedByMe=Be.isBlockedByMe):(Be.nickname=t.sender.nickname,Be.plainProfileUrl=t.sender.plainProfileUrl,Be.metaData=t.sender.metaData,Be.isBlockedByMe=t.sender.isBlockedByMe);break}}catch(e){Bt={error:e};}finally{try{c&&!c.done&&(Kt=u.return)&&Kt.call(u);}finally{if(Bt)throw Bt.error}}o&&r&&t.mentionedUsers.forEach((function(e){var t,n;try{for(var r=__bundle7dfccc8c.s(a.members),s=r.next();!s.done;s=r.next()){var i=s.value;if(e.userId===i.userId){e.nickname=i.nickname,e.plainProfileUrl=i.plainProfileUrl,e.metaData=i.metaData;break}}}catch(e){t={error:e};}finally{try{s&&!s.done&&(n=r.return)&&n.call(r);}finally{if(t)throw t.error}}})),v&&(E=this._sessionManager.currentUser)&&(E.nickname=t.sender.nickname,E.plainProfileUrl=t.sender.plainProfileUrl,E.metaData=t.sender.metaData);}t.silent&&!v||(a.isEphemeral||L)&&((!a.lastMessage||a.lastMessage.createdAt<t.createdAt)&&(a.lastMessage=t),v||a._updateUnreadCount(a.unreadMessageCount+1,a.unreadMentionCount+(r?1:0))),s&&(!a.lastMessage||a.lastMessage.createdAt<t.createdAt)&&(a.lastMessage=t),this._dispatcher.dispatch(new jt({channels:[a],source:Vt.EVENT_MESSAGE_RECEIVED})),t.silent&&!v||__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(s){try{for(e=__bundle7dfccc8c.s(this._groupChannelHandlers.values()),t=e.next();!t.done;t=e.next())t.value.onChannelChanged(a);}catch(e){n={error:e};}finally{try{t&&!t.done&&(r=e.return)&&r.call(e);}finally{if(n)throw n.error}}return [2]}))}))})),this._dispatcher.dispatch(new __bundle7dfccc8c.un({messages:[t],source:__bundle7dfccc8c.$t.EVENT_MESSAGE_RECEIVED})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){var e,n,s,i,o;return __bundle7dfccc8c.i(this,(function(u){try{for(e=__bundle7dfccc8c.s(this._groupChannelHandlers.values()),n=e.next();!n.done;n=e.next())(s=n.value).onMessageReceived(a,t),r&&s.onMentionReceived(a,t);}catch(e){i={error:e};}finally{try{n&&!n.done&&(o=e.return)&&o.call(e);}finally{if(i)throw i.error}}return [2]}))}))})),nn.label=3;case 3:return [3,71];case 4:return l=null,"MEDI"===e.code?l=e.as(__bundle7dfccc8c.Tt$1):"FEDI"===e.code?l=e.as(__bundle7dfccc8c.It):"AEDI"===e.code&&(l=e.as(__bundle7dfccc8c.c$1)),l?(h=l.message,p=l.mentionCountChange,h.channelType!==__bundle7dfccc8c.ne.GROUP?[3,6]:(L=this._groupChannelCache.isCachedInMemory(h.channelUrl),[4,this.getChannel(h.channelUrl,!0)])):[3,6];case 5:m=nn.sent(),v=h instanceof __bundle7dfccc8c.xt&&h.sender.userId===this._sdkState.userId,g=!1,v?(E=this._sessionManager.currentUser)&&(E.nickname=h.sender.nickname,E.plainProfileUrl=h.sender.plainProfileUrl,E.metaData=h.sender.metaData):m.isReadMessage(h)&&0!==p&&!h.silent&&L&&(m._updateUnreadCount(m.unreadMessageCount,m.unreadMentionCount+p),g=!0),!m.lastMessage||m.lastMessage.createdAt<h.createdAt?(m.lastMessage=h,g=!0):m.lastMessage.isIdentical(h)&&(L?m.lastMessage.updatedAt<h.updatedAt&&(m.lastMessage=h,g=!0):g=!0),g&&(this._dispatcher.dispatch(new jt({channels:[m],source:Vt.EVENT_MESSAGE_UPDATED})),h.silent&&!v||__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(s){try{for(e=__bundle7dfccc8c.s(this._groupChannelHandlers.values()),t=e.next();!t.done;t=e.next())t.value.onChannelChanged(m);}catch(e){n={error:e};}finally{try{t&&!t.done&&(r=e.return)&&r.call(e);}finally{if(n)throw n.error}}return [2]}))}))}))),this._dispatcher.dispatch(new __bundle7dfccc8c.un({messages:[h],source:__bundle7dfccc8c.$t.EVENT_MESSAGE_UPDATED})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){var e,t,n,r,s;return __bundle7dfccc8c.i(this,(function(i){try{for(e=__bundle7dfccc8c.s(this._groupChannelHandlers.values()),t=e.next();!t.done;t=e.next())(n=t.value).onMessageUpdated(m,h),0!==p&&n.onMentionReceived(m,h);}catch(e){r={error:e};}finally{try{t&&!t.done&&(s=e.return)&&s.call(e);}finally{if(r)throw r.error}}return [2]}))}))})),nn.label=6;case 6:return [3,71];case 7:return y=e.as(__bundle7dfccc8c.wt),Z=y.channelUrl,F=y.channelType,N=y.messageId,F!==__bundle7dfccc8c.ne.GROUP?[3,9]:[4,this.getChannel(Z,!0)];case 8:A=nn.sent(),this._dispatcher.dispatch(new __bundle7dfccc8c.cn({messageIds:[N],source:__bundle7dfccc8c.$t.EVENT_MESSAGE_DELETED})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(s){try{for(e=__bundle7dfccc8c.s(this._groupChannelHandlers.values()),t=e.next();!t.done;t=e.next())t.value.onMessageDeleted(A,N);}catch(e){n={error:e};}finally{try{t&&!t.done&&(r=e.return)&&r.call(e);}finally{if(n)throw n.error}}return [2]}))}))})),nn.label=9;case 9:return [3,71];case 10:return (T=e.as(Un).readStatus).channelType!==__bundle7dfccc8c.ne.GROUP?[3,12]:(L=this._groupChannelCache.isCachedInMemory(T.channelUrl),[4,this.getChannel(T.channelUrl,!0)]);case 11:U=nn.sent(),L&&U._updateUnreadMemberState(T.reader.userId,T.readAt),T.reader.userId===this._sdkState.userId?L?(U.unreadMessageCount>0||U.unreadMentionCount>0)&&(U._updateUnreadCount(0,0),this._dispatcher.dispatch(new jt({channels:[U],source:Vt.EVENT_CHANNEL_READ})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(s){try{for(e=__bundle7dfccc8c.s(this._groupChannelHandlers.values()),t=e.next();!t.done;t=e.next())t.value.onChannelChanged(U);}catch(e){n={error:e};}finally{try{t&&!t.done&&(r=e.return)&&r.call(e);}finally{if(n)throw n.error}}return [2]}))}))}))):0!==U.unreadMessageCount&&0!==U.unreadMentionCount||(this._dispatcher.dispatch(new jt({channels:[U],source:Vt.EVENT_CHANNEL_READ})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(s){try{for(e=__bundle7dfccc8c.s(this._groupChannelHandlers.values()),t=e.next();!t.done;t=e.next())t.value.onChannelChanged(U);}catch(e){n={error:e};}finally{try{t&&!t.done&&(r=e.return)&&r.call(e);}finally{if(n)throw n.error}}return [2]}))}))}))):(this._dispatcher.dispatch(new jt({channels:[U],source:Vt.EVENT_CHANNEL_READ})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(s){try{for(e=__bundle7dfccc8c.s(this._groupChannelHandlers.values()),t=e.next();!t.done;t=e.next())t.value.onUnreadMemberStatusUpdated(U);}catch(e){n={error:e};}finally{try{t&&!t.done&&(r=e.return)&&r.call(e);}finally{if(n)throw n.error}}return [2]}))}))}))),nn.label=12;case 12:return [3,71];case 13:return I=e.as(Dn),Z=I.channelUrl,w=I.deliveredStateUpdate,D=void 0===w?{}:w,L=this._groupChannelCache.isCachedInMemory(Z),[4,this.getChannel(Z,!0)];case 14:if(R=nn.sent(),L)for(O in D)R._updateUndeliveredMemberState(O,D[O]);return this._dispatcher.dispatch(new jt({channels:[R],source:Vt.EVENT_CHANNEL_DELIVERED})),Object.keys(D).some((function(e){return e!==tn._sdkState.userId}))&&__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(s){try{for(e=__bundle7dfccc8c.s(this._groupChannelHandlers.values()),t=e.next();!t.done;t=e.next())t.value.onUndeliveredMemberStatusUpdated(R);}catch(e){n={error:e};}finally{try{t&&!t.done&&(r=e.return)&&r.call(e);}finally{if(n)throw n.error}}return [2]}))}))})),[3,71];case 15:return k=e.as(__bundle7dfccc8c.H$2),Z=k.channelUrl,F=k.channelType,P=k.event,F!==__bundle7dfccc8c.ne.GROUP?[3,18]:[4,this.getChannel(Z,!0)];case 16:return x=nn.sent(),[4,this.getMessageFromCache(P.messageId)];case 17:(q=nn.sent())&&(q.applyReactionEvent(P),this._dispatcher.dispatch(new __bundle7dfccc8c.un({messages:[q],source:__bundle7dfccc8c.$t.EVENT_MESSAGE_REACTION_UPDATED}))),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(s){try{for(e=__bundle7dfccc8c.s(this._groupChannelHandlers.values()),t=e.next();!t.done;t=e.next())t.value.onReactionUpdated(x,P);}catch(e){n={error:e};}finally{try{t&&!t.done&&(r=e.return)&&r.call(e);}finally{if(n)throw n.error}}return [2]}))}))})),nn.label=18;case 18:return [3,71];case 19:return (H=e.as(__bundle7dfccc8c.T).event).channelType!==__bundle7dfccc8c.ne.GROUP?[3,22]:[4,this.getChannel(H.channelUrl,!0)];case 20:return G=nn.sent(),[4,this.getMessageFromCache(H.targetMessageId)];case 21:(q=nn.sent())&&(q.applyThreadInfoUpdateEvent(H),this._dispatcher.dispatch(new __bundle7dfccc8c.un({messages:[q],source:__bundle7dfccc8c.$t.EVENT_MESSAGE_THREADINFO_UPDATED}))),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(s){try{for(e=__bundle7dfccc8c.s(this._groupChannelHandlers.values()),t=e.next();!t.done;t=e.next())t.value.onThreadInfoUpdated(G,H);}catch(e){n={error:e};}finally{try{t&&!t.done&&(r=e.return)&&r.call(e);}finally{if(n)throw n.error}}return [2]}))}))})),nn.label=22;case 22:return [3,71];case 23:B=e.as(__bundle7dfccc8c.h$1).groupChannelMemberCounts,z=[],nn.label=24;case 24:nn.trys.push([24,29,30,31]),Y=__bundle7dfccc8c.s(B),J=Y.next(),nn.label=25;case 25:return J.done?[3,28]:(X=J.value,Z=X.channelUrl,Ue=X.memberCount,Le=X.joinedMemberCount,$=X.updatedAt,[4,this.getChannelFromCache(Z)]);case 26:(ee=nn.sent())&&ee._setLatestMemberCount(Ue,Le,$)&&z.push(ee),nn.label=27;case 27:return J=Y.next(),[3,25];case 28:return [3,31];case 29:return te=nn.sent(),Qt={error:te},[3,31];case 30:try{J&&!J.done&&(Wt=Y.return)&&Wt.call(Y);}finally{if(Qt)throw Qt.error}return [7];case 31:return z.length>0&&(this._dispatcher.dispatch(new jt({channels:z,source:Vt.EVENT_CHANNEL_MEMBER_COUNT_UPDATED})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(s){try{for(e=__bundle7dfccc8c.s(this._groupChannelHandlers.values()),t=e.next();!t.done;t=e.next())t.value.onChannelMemberCountChanged(z);}catch(e){n={error:e};}finally{try{t&&!t.done&&(r=e.return)&&r.call(e);}finally{if(n)throw n.error}}return [2]}))}))}))),[3,71];case 32:if(!(ne=e.as(__bundle7dfccc8c.C).event).isGroupChannelEvent)return [3,69];switch(ne.category){case __bundle7dfccc8c._.CHANNEL_JOIN:return [3,33];case __bundle7dfccc8c._.CHANNEL_LEAVE:return [3,35];case __bundle7dfccc8c._.CHANNEL_OPERATOR_UPDATE:return [3,39];case __bundle7dfccc8c._.CHANNEL_INVITE:return [3,41];case __bundle7dfccc8c._.CHANNEL_DECLINE_INVITE:return [3,43];case __bundle7dfccc8c._.TYPING_START:case __bundle7dfccc8c._.TYPING_END:return [3,45];case __bundle7dfccc8c._.USER_CHANNEL_MUTE:case __bundle7dfccc8c._.USER_CHANNEL_UNMUTE:return [3,47];case __bundle7dfccc8c._.USER_CHANNEL_BAN:return [3,49];case __bundle7dfccc8c._.USER_CHANNEL_UNBAN:return [3,53];case __bundle7dfccc8c._.CHANNEL_FREEZE:case __bundle7dfccc8c._.CHANNEL_UNFREEZE:return [3,55];case __bundle7dfccc8c._.CHANNEL_HIDE:return [3,57];case __bundle7dfccc8c._.CHANNEL_UNHIDE:return [3,59];case __bundle7dfccc8c._.CHANNEL_DELETED:return [3,61];case __bundle7dfccc8c._.CHANNEL_PROP_CHANGED:return [3,63];case __bundle7dfccc8c._.CHANNEL_META_DATA_CHANGED:return [3,65];case __bundle7dfccc8c._.CHANNEL_META_COUNTERS_CHANGED:return [3,67]}return [3,69];case 33:return [4,this.getChannel(ne.channelUrl,!0)];case 34:return re=nn.sent(),se=e.as(gn),ie=se.memberCount,ae=se.joinedMemberCount,oe=se.members,ue=!1,oe.forEach((function(e){re.isExclusive||re.isSuper||re.isBroadcast?ue=ue||re._setLatestMemberCount(ie,ae,ne.ts):(e.state=yt.JOINED,re.addMember(e,ne.ts),tn._updateJoinedMemberCount(re)),e.userId===tn._sdkState.userId&&(re.myMemberState=yt.JOINED);})),this._dispatcher.dispatch(new jt({channels:[re],source:Vt.EVENT_CHANNEL_JOINED})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){var t,n;try{for(var r=__bundle7dfccc8c.s(oe),s=r.next();!s.done;s=r.next()){var i=s.value;e.onUserJoined(re,i);}}catch(e){t={error:e};}finally{try{s&&!s.done&&(n=r.return)&&n.call(r);}finally{if(t)throw t.error}}re.isBroadcast&&ue&&e.onChannelMemberCountChanged([re]);})),[2]}))}))})),[3,69];case 35:return (Ke=this._leftChannels.get(ne.channelUrl))?(le=Ke.channel,[3,38]):[3,36];case 36:return [4,this.getChannel(ne.channelUrl,!0)];case 37:le=nn.sent(),nn.label=38;case 38:return ce=le,he=e.as(yn),Ue=he.memberCount,Le=he.joinedMemberCount,de=he.member,_e=!1,ce.isExclusive||ce.isSuper||ce.isBroadcast?_e=ce._setLatestMemberCount(Ue,Le,ne.ts):(ce.removeMember(de),this._updateJoinedMemberCount(ce)),de.userId===this._sdkState.userId?ce.isPublic?(ce.myMemberState=yt.NONE,ce.invitedAt=0,ce.joinedAt=0,ce._updateUnreadCount(0,0),this._dispatcher.dispatch(new jt({channels:[ce],source:Vt.EVENT_CHANNEL_LEFT}))):(this._markAsLeave(ce),this._dispatcher.dispatch(new zt({channelUrls:[ce.url],source:Vt.EVENT_CHANNEL_LEFT}))):this._dispatcher.dispatch(new jt({channels:[ce],source:Vt.EVENT_CHANNEL_LEFT})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){e.onUserLeft(ce,de),ce.isBroadcast&&_e&&e.onChannelMemberCountChanged([ce]);})),[2]}))}))})),[3,69];case 39:return [4,this.getChannel(ne.channelUrl,!0)];case 40:fe=nn.sent(),pe=e.as(__bundle7dfccc8c.d$1).operators,me=pe.map((function(e){return e.userId}));try{for(ve=__bundle7dfccc8c.s(fe.members),ge=ve.next();!ge.done;ge=ve.next())(Be=ge.value).role=me.includes(Be.userId)?__bundle7dfccc8c.re$1.OPERATOR:__bundle7dfccc8c.re$1.NONE;}catch(e){Yt={error:e};}finally{try{ge&&!ge.done&&(Jt=ve.return)&&Jt.call(ve);}finally{if(Yt)throw Yt.error}}return fe.myRole=me.includes(this._sdkState.userId)?__bundle7dfccc8c.re$1.OPERATOR:__bundle7dfccc8c.re$1.NONE,this._dispatcher.dispatch(new jt({channels:[fe],source:Vt.EVENT_CHANNEL_OPERATOR_UPDATED})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){e.onOperatorUpdated(fe,pe);})),[2]}))}))})),[3,69];case 41:return [4,this.getChannel(ne.channelUrl,!0)];case 42:Ee=nn.sent(),ye=e.as(bn),Ue=ye.memberCount,Le=ye.joinedMemberCount,Ce=ye.inviter,(Ne=ye.invitees).forEach((function(e){return e.state=yt.INVITED}));try{for(be=__bundle7dfccc8c.s(Ne),Me=be.next();!Me.done;Me=be.next())Se=Me.value,Ee.isExclusive||Ee.isSuper||Ee.isBroadcast?Ee._setLatestMemberCount(Ue,Le,ne.ts):Ee.addMember(Se,ne.ts),this._sdkState.userId===Se.userId&&(Ee.hiddenState=Fr.UNHIDDEN,Ee.myMemberState!==yt.JOINED&&(Ee.myMemberState=yt.INVITED),Ee.invitedAt=ne.ts);}catch(e){Xt={error:e};}finally{try{Me&&!Me.done&&(Zt=be.return)&&Zt.call(be);}finally{if(Xt)throw Xt.error}}return this._dispatcher.dispatch(new jt({channels:[Ee],source:Vt.EVENT_CHANNEL_INVITED})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){e.onUserReceivedInvitation(Ee,Ce,Ne);})),[2]}))}))})),[3,69];case 43:return [4,this.getChannel(ne.channelUrl,!0)];case 44:return Ae=nn.sent(),Te=e.as(An),Ue=Te.memberCount,Le=Te.joinedMemberCount,Re=Te.inviter,Oe=Te.invitee,Ae.isExclusive||Ae.isSuper||Ae.isBroadcast?Ae._setLatestMemberCount(Ue,Le,ne.ts):Ae.removeMember(Oe),this._sdkState.userId===Oe.userId?(Ae.invitedAt=0,Ae.myMemberState=yt.NONE,Ae.isPublic?this._dispatcher.dispatch(new jt({channels:[Ae],source:Vt.EVENT_CHANNEL_DECLINED_INVITE})):this._dispatcher.dispatch(new zt({channelUrls:[Ae.url],source:Vt.EVENT_CHANNEL_DECLINED_INVITE}))):this._dispatcher.dispatch(new jt({channels:[Ae],source:Vt.EVENT_CHANNEL_DECLINED_INVITE})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){e.onUserDeclinedInvitation(Ae,Re,Oe);})),[2]}))}))})),[3,69];case 45:return [4,this.getChannel(ne.channelUrl,!0)];case 46:return ke=nn.sent(),Fe=ne.category===__bundle7dfccc8c._.TYPING_START,Pe=e.as(Fe?Fn:xn).user,ke._updateTypingStatus(Pe,Fe?ne.ts:0),this._dispatcher.dispatch(new jt({channels:[ke],source:Vt.EVENT_CHANNEL_TYPING_STATUS_UPDATE})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){e.onTypingStatusUpdated(ke);})),[2]}))}))})),[3,69];case 47:return [4,this.getChannel(ne.channelUrl,!0)];case 48:xe=nn.sent(),He=ne.category===__bundle7dfccc8c._.USER_CHANNEL_MUTE,(Ve=e.as(He?__bundle7dfccc8c.at$1:__bundle7dfccc8c.ot$1).user).userId===this._sdkState.userId&&(xe.myMutedState=He?kr.MUTED:kr.UNMUTED);try{for(Ge=__bundle7dfccc8c.s(xe.members),qe=Ge.next();!qe.done;qe=Ge.next())if((Be=qe.value).userId===Ve.userId){Be.isMuted=He;break}}catch(e){$t={error:e};}finally{try{qe&&!qe.done&&(en=Ge.return)&&en.call(Ge);}finally{if($t)throw $t.error}}return this._dispatcher.dispatch(new jt({channels:[xe],source:He?Vt.EVENT_CHANNEL_MUTED:Vt.EVENT_CHANNEL_UNMUTED})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){He?e.onUserMuted(xe,Ve):e.onUserUnmuted(xe,Ve);})),[2]}))}))})),[3,69];case 49:return (Ke=this._leftChannels.get(ne.channelUrl))?(ze=Ke.channel,[3,52]):[3,50];case 50:return [4,this.getChannel(ne.channelUrl,!0)];case 51:ze=nn.sent(),nn.label=52;case 52:return je=ze,this._markAsLeave(je),st=e.as(__bundle7dfccc8c.ct$1).user,__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){e.onUserBanned(je,st);})),[2]}))}))})),[3,69];case 53:return [4,this.getChannel(ne.channelUrl,!0)];case 54:return it=nn.sent(),at=e.as(__bundle7dfccc8c.dt$1).user,__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){e.onUserUnbanned(it,at);})),[2]}))}))})),[3,69];case 55:return [4,this.getChannel(ne.channelUrl,!0)];case 56:return ot=nn.sent(),ut=e.as(__bundle7dfccc8c.pt).freeze,ot.isFrozen=ut,this._dispatcher.dispatch(new jt({channels:[ot],source:ut?Vt.EVENT_CHANNEL_FROZEN:Vt.EVENT_CHANNEL_UNFROZEN})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){ut?e.onChannelFrozen(ot):e.onChannelUnfrozen(ot);})),[2]}))}))})),[3,69];case 57:return [4,this.getChannel(ne.channelUrl,!0)];case 58:return ct=nn.sent(),lt=e.as(On),Et=lt.allowAutoUnhide,Ct=lt.hidePreviousMessages,Nt=lt.messageOffsetTimestamp,null!==Et&&(ct.hiddenState=Et?Fr.HIDDEN_ALLOW_AUTO_UNHIDE:Fr.HIDDEN_PREVENT_AUTO_UNHIDE),null!==Ct&&Ct&&ct._updateUnreadCount(0,0),null!==Nt&&(ct.messageOffsetTimestamp=Nt),this._dispatcher.dispatch(new jt({channels:[ct],source:Vt.EVENT_CHANNEL_HIDDEN})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){e.onChannelHidden(ct);})),[2]}))}))})),[3,69];case 59:return [4,this.getChannel(ne.channelUrl,!0)];case 60:return (bt=nn.sent()).hiddenState=Fr.UNHIDDEN,this._dispatcher.dispatch(new jt({channels:[bt],source:Vt.EVENT_CHANNEL_UNHIDDEN})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){e.onChannelChanged(bt);})),[2]}))}))})),[3,69];case 61:return [4,this.getChannel(ne.channelUrl,!0)];case 62:return Mt=nn.sent(),this._dispatcher.dispatch(new zt({channelUrls:[ne.channelUrl],source:Vt.EVENT_CHANNEL_DELETED})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){e.onChannelDeleted(Mt.url,Mt.channelType);})),[2]}))}))})),[3,69];case 63:return [4,this.getChannelWithoutCache(ne.channelUrl,!0)];case 64:return St=nn.sent(),this._dispatcher.dispatch(new jt({channels:[St],source:Vt.EVENT_CHANNEL_UPDATED})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){e.onChannelChanged(St);})),[2]}))}))})),[3,69];case 65:return [4,this.getChannel(ne.channelUrl,!0)];case 66:return At=nn.sent(),Tt=e.as(__bundle7dfccc8c.je),Ut=Tt.created,It=Tt.updated,wt=Tt.deleted,Ut&&At._upsertCachedMetaData(Ut,ne.ts),It&&At._upsertCachedMetaData(It,ne.ts),wt&&At._removeFromCachedMetaData(wt,ne.ts),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){Ut&&e.onMetaDataCreated(At,Ut),It&&e.onMetaDataUpdated(At,It),wt&&e.onMetaDataDeleted(At,wt);})),[2]}))}))})),[3,69];case 67:return [4,this.getChannel(ne.channelUrl,!0)];case 68:return Dt=nn.sent(),Lt=e.as(__bundle7dfccc8c.tt),Rt=Lt.created,Ot=Lt.updated,kt=Lt.deleted,__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(tn,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._groupChannelHandlers.forEach((function(e){Rt&&e.onMetaCounterCreated(Dt,Rt),Ot&&e.onMetaCounterUpdated(Dt,Ot),kt&&e.onMetaCounterDeleted(Dt,kt);})),[2]}))}))})),[3,69];case 69:return [3,71];case 70:switch((Ft=e.as(__bundle7dfccc8c.be).event).category){case __bundle7dfccc8c.te.USER_BLOCK:Pt=__bundle7dfccc8c.me.getDataAsUserBlockEvent(this._iid,Ft),Ht=Pt.blocker,Gt=Pt.blockee,this._groupChannelCache.block(Ht.userId,Gt.userId);break;case __bundle7dfccc8c.te.USER_UNBLOCK:xt=__bundle7dfccc8c.me.getDataAsUserBlockEvent(this._iid,Ft),Ht=xt.blocker,Gt=xt.blockee,this._groupChannelCache.unblock(Ht.userId,Gt.userId);}return [3,71];case 71:return [3,73];case 72:if(qt=nn.sent(),__bundle7dfccc8c.h(qt))throw qt;return [3,73];case 73:return [2]}}))}))},e.prototype._markAsLeave=function(e){var t,n=this,r=null!==(t=this._leftChannels.get(e.url))&&void 0!==t?t:{channel:e,ref:0};r.ref++,this._leftChannels.set(e.url,r),setTimeout((function(){r.ref--,0===r.ref&&n._leftChannels.delete(e.url);}),1e4);},e.prototype.addHandler=function(e,t){this._groupChannelHandlers.set(e,t);},e.prototype.removeHandler=function(e){this._groupChannelHandlers.delete(e);},e.prototype.clearHandler=function(){this._groupChannelHandlers.clear();},e.prototype.subscribeGroupChannelEvent=function(e,t){this._groupChannelBroadcast.subscribe(e,t);},e.prototype.unsubscribeGroupChannelEvent=function(e){this._groupChannelBroadcast.unsubscribe(e);},e.prototype.subscribeMessageEvent=function(e,t){this._messageBroadcast.subscribe(e,t);},e.prototype.unsubscribeMessageEvent=function(e){this._messageBroadcast.unsubscribe(e);},e.prototype._updateJoinedMemberCount=function(e){e.joinedMemberCount=e.members.filter((function(e){return e.state===yt.JOINED})).length;},e.prototype.getChannel=function(e,t){return void 0===t&&(t=!1),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:__bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.getChannelFromCache(e)];case 2:return (n=r.sent())?[2,n]:[3,4];case 3:return r.sent(),[3,4];case 4:return [4,this.getChannelWithoutCache(e,t)];case 5:return [2,r.sent()]}}))}))},e.prototype.getChannelWithoutCache=function(e,t){return void 0===t&&(t=!1),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,s,i,a;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),n=new Xt({channelUrl:e,isInternalCall:t}),[4,this._requestQueue.send(n)];case 1:switch(r=o.sent(),s=r.as(Zt).channel,i=s.unreadMessageCount,a=s.unreadMentionCount,s.myCountPreference){case Or.UNREAD_MESSAGE_COUNT_ONLY:a=0;break;case Or.UNREAD_MENTION_COUNT_ONLY:i=0;break;case Or.OFF:i=0,a=0;}return s._updateUnreadCount(i,a),[4,this._groupChannelCache.upsert([s])];case 2:return o.sent(),[2,s]}}))}))},e.prototype.getMyGroupChannels=function(e,t,n,r){return void 0===r&&(r=Vt.REQUEST_CHANNEL),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var i,a,o,u,c;return __bundle7dfccc8c.i(this,(function(l){switch(l.label){case 0:return i=new $t(__bundle7dfccc8c.n(__bundle7dfccc8c.n({},t),{userId:this._sdkState.userId,token:e,limit:n})),[4,this._requestQueue.send(i)];case 1:return a=l.sent(),o=a.as(en),u=o.channels,c=o.token,this._dispatcher.dispatch(new jt({channels:u,source:r})),[2,{channels:u,token:c}]}}))}))},e.prototype.getMessageFromCache=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,this._messageCache.get(e)];case 1:return [2,t.sent()]}}))}))},e.prototype.getMessagesFromCache=function(e,t,n,r,s){return void 0===s&&(s=__bundle7dfccc8c.Y$1),__bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return [4,this._messageCache.fetch({channelUrl:e,token:t,limit:s,filter:r,backward:"next"===n})];case 1:return [2,i.sent()]}}))}))},e.prototype.getAllFailedMessagesFromCache=function(e,t){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return [4,this._unsentMessageCache.fetch({channelUrl:e,filter:t,sendingStatus:__bundle7dfccc8c.le.FAILED})];case 1:return [2,n.sent()]}}))}))},e.prototype.removeFailedMessageFromCache=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,this._unsentMessageCache.remove([e])];case 1:return t.sent(),[2]}}))}))},e.prototype.getCachedMessageCountBetween=function(e,t,n,r){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return [4,this._messageCache.countBetween(e,t,new Gn({top:n,bottom:r}))];case 1:return [2,s.sent()]}}))}))},e.prototype.getMyGroupChannelChangeLogs=function(e,t,n){return void 0===n&&(n=Vt.REQUEST_CHANNEL_CHANGELOGS),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var i,a,o,u,c;return __bundle7dfccc8c.i(this,(function(l){switch(l.label){case 0:return t=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},Ft),t),__bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)&&Pt(t)).throw(__bundle7dfccc8c.p.invalidParameters),i=new Yt(__bundle7dfccc8c.U({userId:this._sdkState.userId,ts:"number"==typeof e?e:null,token:"string"==typeof e?e:null,filter:t})),[4,this._requestQueue.send(i)];case 1:return a=l.sent(),o=a.as(Jt),u=o.updatedChannels,c=o.deletedChannelUrls,u.length>0&&this._dispatcher.dispatch(new jt({channels:u,source:n})),c.length>0&&this._dispatcher.dispatch(new zt({channelUrls:c,source:n})),[2,o]}}))}))},e.prototype.getGroupChannelCount=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return e=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},xt),e),__bundle7dfccc8c.at(Ht(e)).throw(__bundle7dfccc8c.p.invalidParameters),t=new tn({userId:this._sdkState.userId,filter:e}),[4,this._requestQueue.send(t)];case 1:return n=r.sent(),[2,n.as(nn).groupChannelCount]}}))}))},e.prototype.getUnreadItemCount=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return e=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},Gt),e),__bundle7dfccc8c.at(function(e){return __bundle7dfccc8c.E(Dt,e.keys)}(e)).throw(__bundle7dfccc8c.p.invalidParameters),t=__bundle7dfccc8c.St.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new rn({userId:n.userId,filter:e}),[4,r.send(i)];case 1:return [2,a.sent().as(sn)]}}))}))},e.prototype.getTotalUnreadChannelCount=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,s;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new an({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,s.as(on).unreadCount]}}))}))},e.prototype.getTotalUnreadMessageCount=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,a,o;return __bundle7dfccc8c.i(this,(function(u){switch(u.label){case 0:return e=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},qt),e),__bundle7dfccc8c.at(function(e){return __bundle7dfccc8c.E("string",e.channelCustomTypesFilter)&&__bundle7dfccc8c.m(bt,e.superChannelFilter)}(e)).throw(__bundle7dfccc8c.p.invalidParameters),n=__bundle7dfccc8c.St.of(this._iid),r=n.sdkState,i=n.requestQueue,a=new un({userId:r.userId,filter:e}),[4,i.send(a)];case 1:return o=u.sent(),[2,o.as(cn).unreadCount]}}))}))},e.prototype.getTotalScheduledMessageCount=function(e){return void 0===e&&(e={}),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return e=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},Bt),e),__bundle7dfccc8c.at(function(e){return __bundle7dfccc8c.y("string",e.channelUrl,!0)&&__bundle7dfccc8c.E(__bundle7dfccc8c.Ct,e.scheduledStatus,!0)&&__bundle7dfccc8c.m(__bundle7dfccc8c.se$1,e.messageTypeFilter)}(e)).throw(__bundle7dfccc8c.p.invalidParameters),n=__bundle7dfccc8c.St.of(this._iid).requestQueue,r=new ln(e),[4,n.send(r)];case 1:return i=a.sent(),[2,i.as(hn).count]}}))}))},e.prototype.getSubscribedTotalUnreadMessageCount=function(){var e=__bundle7dfccc8c.St.of(this._iid).subscribedUnreadMessageCount;return e.all>=0?e.all:0},e.prototype.getSubscribedCustomTypeTotalUnreadMessageCount=function(){var e=0,t=__bundle7dfccc8c.St.of(this._iid).subscribedUnreadMessageCount;for(var n in t.customTypes)e+=t.customTypes[n];return e},e.prototype.getSubscribedCustomTypeUnreadMessageCount=function(e){var t;return null!==(t=__bundle7dfccc8c.St.of(this._iid).subscribedUnreadMessageCount.customTypes[e])&&void 0!==t?t:0},e.prototype.createChannel=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return e=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},Ot),e),__bundle7dfccc8c.at(kt(e)).throw(__bundle7dfccc8c.p.invalidParameters),e.isPublic||(e.accessCode=null),t=new _n(__bundle7dfccc8c.n({userId:this._sdkState.userId},e)),[4,this._requestQueue.send(t)];case 1:return n=i.sent(),r=n.as(fn).channel,[4,this._groupChannelCache.upsert([r])];case 2:return i.sent(),[2,r]}}))}))},e.prototype.markAsReadAll=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,s,i,a,o;return __bundle7dfccc8c.i(this,(function(u){switch(u.label){case 0:return e=Date.now(),__bundle7dfccc8c.at(e-this._markAsReadAllLastSentAt>=1e3).throw(__bundle7dfccc8c.p.markAsReadAllRateLimitExceeded),this._markAsReadAllLastSentAt=e,t=new pn({userId:this._sdkState.userId}),[4,this._requestQueue.send(t)];case 1:u.sent(),n=this._groupChannelCache.channels;try{for(r=__bundle7dfccc8c.s(n),s=r.next();!s.done;s=r.next())(i=s.value)._updateUnreadMemberState(this._sdkState.userId,e),i._updateUnreadCount(0,0);}catch(e){a={error:e};}finally{try{s&&!s.done&&(o=r.return)&&o.call(r);}finally{if(a)throw a.error}}return n.length>0?[4,this._groupChannelCache.upsert(n)]:[3,3];case 2:u.sent(),u.label=3;case 3:return [2]}}))}))},e.prototype.markAsReadWithChannelUrls=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,s,i,a,o,u,c;return __bundle7dfccc8c.i(this,(function(l){switch(l.label){case 0:return t=Date.now(),__bundle7dfccc8c.at(__bundle7dfccc8c.E("string",e)&&t-this._markAsReadAllLastSentAt>=1e3).throw(__bundle7dfccc8c.p.markAsReadAllRateLimitExceeded),this._markAsReadAllLastSentAt=t,n=new pn({userId:this._sdkState.userId,channelUrls:e}),[4,this._requestQueue.send(n)];case 1:l.sent(),r=this._groupChannelCache.channels,s=[];try{for(i=__bundle7dfccc8c.s(r),a=i.next();!a.done;a=i.next())o=a.value,e.includes(o.url)&&(o._updateUnreadMemberState(this._sdkState.userId,t),o._updateUnreadCount(0,0),s.push(o));}catch(e){u={error:e};}finally{try{a&&!a.done&&(c=i.return)&&c.call(i);}finally{if(u)throw u.error}}return s.length>0?[4,this._groupChannelCache.upsert(s)]:[3,3];case 2:l.sent(),l.label=3;case 3:return [2]}}))}))},e.prototype.markAsDelivered=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,this.getChannel(e)];case 1:return [4,t.sent().markAsDelivered()];case 2:return t.sent(),[2]}}))}))},e}(),Kn=new Map,jn=new Map,zn=new Map,Qn=function(){function e(t){var n=t.key,r=t.concurrentCallLimit,s=void 0===r?2:r,i=t.backOffDelay,a=void 0===i?0:i,o=this;this._holdersKey=e.createSemaphoreHoldersKey(n),this._resolversKey=e.createSemaphoreResolversKey(n),this._chainProcessStateKey=e.createChainProcessStateKey(n),this._numLocks=s,this._backOffDelay=a,this._localAcquiredKeys=[],this._localResolversData=[],__bundle7dfccc8c.z$1()?(Kn[this._holdersKey]||(Kn[this._holdersKey]=[]),jn[this._resolversKey]||(jn[this._resolversKey]=[])):(window.addEventListener("storage",(function(e){return __bundle7dfccc8c.r(o,void 0,void 0,(function(){var t,n;return __bundle7dfccc8c.i(this,(function(r){if(this._localResolversData.length>0&&this.numLocksAvailable>0&&!this._isProcessChainAcquireRunning()&&this._hasHighestPriorityResolver())switch(e.key){case this._holdersKey:if(t=JSON.parse(e.oldValue),n=JSON.parse(e.newValue),!t||!n||n.length>=t.length)return [2];this._processChainResolve();break;case this._chainProcessStateKey:if(JSON.parse(e.newValue))return [2];this._processChainResolve();break;default:return [2]}return [2]}))}))})),window.addEventListener("beforeunload",(function(){var e=o._getLocalResolversData(),t=o._localResolversData.map((function(e){return e.key})),n=e.filter((function(e){return t.indexOf(e.key)<0}));window.localStorage.setItem(o._resolversKey,JSON.stringify(n)),o._localAcquiredKeys.forEach((function(e){return o.release(e)}));})));}return e.createSemaphoreHoldersKey=function(e){return "collection@semaphore_holders_for:"+e},e.createSemaphoreResolversKey=function(e){return "collection@semaphore_resolvers_for:"+e},e.createChainProcessStateKey=function(e){return "collection@semaphore_chain_process_state_for:"+e},Object.defineProperty(e.prototype,"numLocks",{get:function(){return this._numLocks},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backOffDelay",{get:function(){return this._backOffDelay},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"numLocksAvailable",{get:function(){if(__bundle7dfccc8c.z$1())return this.numLocks-Kn[this._holdersKey].length;var e=this._getLocalHoldersData();return this.numLocks-e.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"waitCount",{get:function(){return __bundle7dfccc8c.z$1()?jn[this._resolversKey].length:this._getLocalResolversData().length},enumerable:!1,configurable:!0}),e.prototype._hasHighestPriorityResolver=function(){var e=this._getLocalResolversData();return e.length>0&&this._localResolversData.map((function(e){return e.key})).indexOf(e[0].key)>=0},e.prototype._isProcessChainAcquireRunning=function(){if(__bundle7dfccc8c.z$1())return zn[this._chainProcessStateKey];var e=window.localStorage[this._chainProcessStateKey];return void 0!==e&&JSON.parse(e)},e.prototype._setProcessChainAcquireRunning=function(e){__bundle7dfccc8c.z$1()?zn[this._chainProcessStateKey]=e:e?window.localStorage.setItem(this._chainProcessStateKey,JSON.stringify(e)):window.localStorage.removeItem(this._chainProcessStateKey);},e.prototype._processChainResolve=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return this.waitCount>0&&this.numLocksAvailable>0&&!this._isProcessChainAcquireRunning()?(this._setProcessChainAcquireRunning(!0),this._tryResolve()?[4,__bundle7dfccc8c.me$1(this._backOffDelay)]:[3,2]):[3,3];case 1:t.sent(),t.label=2;case 2:this._setProcessChainAcquireRunning(!1),__bundle7dfccc8c.z$1()?this._processChainResolve():(e=new StorageEvent("storage",{key:this._chainProcessStateKey,oldValue:JSON.stringify(!0),newValue:JSON.stringify(!1)}),dispatchEvent(e)),t.label=3;case 3:return [2]}}))}))},e.prototype.acquire=function(e){return void 0===e&&(e=0),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n=this;return __bundle7dfccc8c.i(this,(function(r){return __bundle7dfccc8c.z$1()?[2,new Promise((function(t){for(var r={key:__bundle7dfccc8c.R(),resolver:function(e){return t(e)},priority:e},s=jn[n._resolversKey],i=-1,a=0;a<s.length;a++)if(e>s[a].priority){i=a;break}i>=0?jn[n._resolversKey].splice(i,0,r):jn[n._resolversKey].push(r),n._processChainResolve();}))]:(t=this._getLocalResolversData(),[2,new Promise((function(r){for(var s=__bundle7dfccc8c.R(),i={key:s,priority:e},a={key:s,resolver:function(e){return r(e)},priority:e},o=-1,u=0;u<t.length;u++)if(e>t[u].priority){o=u;break}o>=0?(t.splice(o,0,i),n._localResolversData.splice(o,0,a)):(t.push(i),n._localResolversData.push(a)),window.localStorage.setItem(n._resolversKey,JSON.stringify(t)),n._processChainResolve();}))])}))}))},e.prototype.release=function(e){if(__bundle7dfccc8c.z$1()){if((t=Kn[this._holdersKey].indexOf(e))>=0)return Kn[this._holdersKey].splice(t,1),this._processChainResolve(),!0}else if(window.localStorage[this._holdersKey]){var t,n=JSON.parse(window.localStorage[this._holdersKey]),r=__bundle7dfccc8c.a([],__bundle7dfccc8c.o(n),!1);if((t=n.indexOf(e))>=0){n.splice(t,1),window.localStorage.setItem(this._holdersKey,JSON.stringify(n)),this._localAcquiredKeys.splice(this._localAcquiredKeys.indexOf(e),1);var s=new StorageEvent("storage",{key:this._holdersKey,oldValue:JSON.stringify(r),newValue:JSON.stringify(n)});return dispatchEvent(s),!0}}return !1},e.prototype._tryResolve=function(){if(__bundle7dfccc8c.z$1()){if(Kn[this._holdersKey].length<this.numLocks){var e=__bundle7dfccc8c.R();return Kn[this._holdersKey]=__bundle7dfccc8c.a(__bundle7dfccc8c.a([],__bundle7dfccc8c.o(Kn[this._holdersKey]),!1),[e],!1),(n=jn[this._resolversKey].shift()).resolver(e),!0}}else {var t=this._getLocalHoldersData();if(t.length<this.numLocks){e=__bundle7dfccc8c.R();var n=this._localResolversData.shift(),r=this._getLocalResolversData(),s=r.map((function(e){return e.key})).indexOf(n.key);r.splice(s,1),window.localStorage.setItem(this._resolversKey,JSON.stringify(r)),window.localStorage.setItem(this._holdersKey,JSON.stringify(__bundle7dfccc8c.a(__bundle7dfccc8c.a([],__bundle7dfccc8c.o(t),!1),[e],!1))),this._localAcquiredKeys.push(e);var i=new StorageEvent("storage",{key:this._holdersKey,oldValue:JSON.stringify(__bundle7dfccc8c.a([],__bundle7dfccc8c.o(t),!1)),newValue:JSON.stringify(__bundle7dfccc8c.a(__bundle7dfccc8c.a([],__bundle7dfccc8c.o(t),!1),[e],!1))});return dispatchEvent(i),(0, n.resolver)(e),!0}}return !1},e.prototype._getLocalHoldersData=function(){var e=window.localStorage[this._holdersKey];return void 0!==e?JSON.parse(e):[]},e.prototype._getLocalResolversData=function(){var e=window.localStorage[this._resolversKey];return void 0!==e?JSON.parse(e):[]},e}();!function(e){e[e.IDLE=0]="IDLE",e[e.RUNNING=1]="RUNNING",e[e.END=2]="END";}(wn||(wn={}));var Wn,Yn=function(t){function n(e,n,r,s){void 0===r&&(r=2),void 0===s&&(s=10);var i=t.call(this)||this;return i._worker=null,i._state=wn.IDLE,i._semaphore=null,i._retryCount=0,i._retryLimit=3,i.priority=0,i._worker=n,i._semaphore=new Qn({key:e,concurrentCallLimit:r,backOffDelay:s}),i}return __bundle7dfccc8c.t(n,t),Object.defineProperty(n.prototype,"isIdle",{get:function(){return this._state===wn.IDLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRunning",{get:function(){return this._state===wn.RUNNING},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDone",{get:function(){return this._state===wn.END},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"retryCount",{get:function(){return this._retryCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"retryLimit",{get:function(){return this._retryLimit},enumerable:!1,configurable:!0}),n.prototype._run=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:if(!this.isRunning)return [3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._worker(e)];case 2:return t=r.sent(),this._retryCount=0,this.dispatch("progress",t),t.hasNext?this._run(t.nextToken):this.end(),[3,4];case 3:return n=r.sent(),this.dispatch("error",n),this._retryCount<this._retryLimit?(this._retryCount++,this._run(e)):this.stop(),[3,4];case 4:return [2]}}))}))},n.prototype.start=function(e){this.isIdle&&(this._state=wn.RUNNING,this._run(e));},n.prototype.stop=function(){this._state=wn.IDLE,this.dispatch("stop");},n.prototype.end=function(){this._state=wn.END,this.dispatch("end");},n}(__bundle7dfccc8c.M),Jn=function(e){this.source=e;},Xn=function(e){this.source=e;},Zn={},$n=function(){function e(e){var t=e._iid,n=e.channel,r=this;this._prevSync=null,this._nextSync=null,this._metadata=null,this._iid=t,this._channel=n;var s,i,a=__bundle7dfccc8c.St.of(this._iid),o=a.sdkState,u=a.logger;this._metadataKey=(s=o.userId,i=n.url,"sendbird:".concat(s,"@groupchannel/").concat(i,"/message/sync.meta"));var c=function(e,t){return "sendbird:".concat(e,"@groupchannel/").concat(t,"/message/sync")}(o.userId,n.url);this._prevSync=new Yn(c,(function(e){return __bundle7dfccc8c.r(r,void 0,void 0,(function(){var t,n,r,s,i,a;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:return t={hasNext:!0,nextToken:0},[4,this.loadMetadata()];case 1:if(o.sent(),u.debug("message background prev sync from",null===(s=this._metadata)||void 0===s?void 0:s.range.top),this._metadata.previousComplete)return [3,9];o.label=2;case 2:return o.trys.push([2,5,,8]),[4,__bundle7dfccc8c.En.of(this._iid).getMessagesByTimestamp(this._channel.url,this._channel.channelType,null!==(a=null===(i=this._metadata.range)||void 0===i?void 0:i.top)&&void 0!==a?a:e,{prevResultSize:100,nextResultSize:0,replyType:__bundle7dfccc8c.ue.ALL,includeReactions:!0,includeMetaArray:!0,includeParentMessageInfo:!0,includeThreadInfo:!0},__bundle7dfccc8c.$t.SYNC_MESSAGE_BACKGROUND)];case 3:return n=o.sent(),this.extendRange(n),t.hasNext=n.length>=100,t.nextToken=this._metadata.range.top,this._metadata.previousComplete=!t.hasNext,u.debug("message background prev sync progress",t),[4,this.saveMetadata()];case 4:return o.sent(),[3,8];case 5:return (r=o.sent())instanceof __bundle7dfccc8c.p&&r.isInvalidTokenError?[4,this.clearMetadata()]:[3,7];case 6:o.sent(),o.label=7;case 7:return t.hasNext=!1,t.nextToken=0,[3,8];case 8:return [3,10];case 9:t.hasNext=!1,o.label=10;case 10:return [2,t]}}))}))})),this._nextSync=new Yn(c,(function(e){return __bundle7dfccc8c.r(r,void 0,void 0,(function(){var t,n,r,s,i;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return t={hasNext:!0,nextToken:0},[4,this.loadMetadata()];case 1:return a.sent(),u.debug("message background next sync from",null===(r=this._metadata)||void 0===r?void 0:r.range.bottom),[4,__bundle7dfccc8c.En.of(this._iid).getMessagesByTimestamp(this._channel.url,this._channel.channelType,null!==(i=null===(s=this._metadata.range)||void 0===s?void 0:s.bottom)&&void 0!==i?i:e,{prevResultSize:0,nextResultSize:100,replyType:__bundle7dfccc8c.ue.ALL,includeReactions:!0,includeMetaArray:!0,includeParentMessageInfo:!0,includeThreadInfo:!0},__bundle7dfccc8c.$t.SYNC_MESSAGE_BACKGROUND)];case 2:return n=a.sent(),this.extendRange(n),t.hasNext=n.length>=100,t.nextToken=this._metadata.range.bottom,u.debug("message background next sync progress",t),[4,this.saveMetadata()];case 3:return a.sent(),[2,t]}}))}))}));}return e.of=function(t,n){if(Zn[t]||(Zn[t]={}),!Zn[t][n.url]){var r=Zn[t][n.url]=new e({_iid:t,channel:n});__bundle7dfccc8c.St.of(t).dispatcher.on((function(e){if(e instanceof __bundle7dfccc8c.de)if(e.stateType===__bundle7dfccc8c.J$1.CONNECTED)r.resume();else r.pause();}));}return Zn[t][n.url]},Object.defineProperty(e.prototype,"range",{get:function(){var e;return null===(e=this._metadata)||void 0===e?void 0:e.range},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousComplete",{get:function(){var e;return !!(null===(e=this._metadata)||void 0===e?void 0:e.previousComplete)},enumerable:!1,configurable:!0}),e.prototype.isWrappingMessages=function(e){var t;return null===(t=this.range)||void 0===t?void 0:t.includes.apply(t,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(e.map((function(e){return e.createdAt}))),!1))},e.prototype.extendRange=function(e){var t;this._metadata&&(t=this._metadata.range).extends.apply(t,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(e.map((function(e){return e.createdAt}))),!1));},e.prototype.loadMetadata=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return this._metadata?[3,2]:[4,__bundle7dfccc8c.St.of(this._iid).cacheContext.preference.get(this._metadataKey)];case 1:e=t.sent(),this._metadata={range:new Gn(e?e.range:{top:Number.MAX_SAFE_INTEGER,bottom:Number.MAX_SAFE_INTEGER}),previousComplete:!!e&&e.previousComplete},t.label=2;case 2:return [2]}}))}))},e.prototype.saveMetadata=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return this._metadata?[4,__bundle7dfccc8c.St.of(this._iid).cacheContext.preference.set(this._metadataKey,this._metadata)]:[3,2];case 1:e.sent(),e.label=2;case 2:return [2]}}))}))},e.prototype.clearMetadata=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return __bundle7dfccc8c.St.of(this._iid).cacheContext.preference.remove(this._metadataKey),[2]}))}))},e.prototype.resume=function(){var e,t,n,r;__bundle7dfccc8c.St.of(this._iid).logger.debug("message background sync resume()"),this._metadata&&this._metadata.previousComplete||this._prevSync.start(null!==(t=null===(e=this._metadata)||void 0===e?void 0:e.range.top)&&void 0!==t?t:Date.now()),this._nextSync.start(null!==(r=null===(n=this._metadata)||void 0===n?void 0:n.range.bottom)&&void 0!==r?r:Date.now());},e.prototype.pause=function(){__bundle7dfccc8c.St.of(this._iid).logger.debug("message background sync stop()"),this._prevSync.stop(),this._nextSync.stop();},e}(),er={},tr=function(){function e(e){var t=e._iid,n=e.channel,r=this;this._sync=null,this._metadata=null,this._iid=t,this._channel=n;var s,i,a=__bundle7dfccc8c.St.of(this._iid).sdkState;this._metadataKey=(s=a.userId,i=n.url,"sendbird:".concat(s,"@groupchannel/").concat(i,"/message/changelogs.meta"));var o=function(e,t){return "sendbird:".concat(e,"@groupchannel/").concat(t,"/message/changelogs")}(a.userId,this._channel.url);this._sync=new Yn(o,(function(){return __bundle7dfccc8c.r(r,void 0,void 0,(function(){var e,t,n,r,s;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return e={hasNext:!0,nextToken:0},[4,this.loadMetadata()];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,5,,8]),[4,__bundle7dfccc8c.En.of(this._iid).getMessageChangelogs(this._channel.url,this._channel.channelType,this._metadata.token,{replyType:__bundle7dfccc8c.ue.ALL,includeReactions:!0,includeThreadInfo:!0,includeMetaArray:!0,includeParentMessageInfo:!0,includePollDetails:!0},__bundle7dfccc8c.$t.SYNC_MESSAGE_CHANGELOGS)];case 3:return t=i.sent(),n=t.hasMore,r=t.token,e.hasNext=n,e.nextToken=r,this._metadata.token=r,[4,this.saveMetadata()];case 4:return i.sent(),[3,8];case 5:return (s=i.sent())instanceof __bundle7dfccc8c.p&&s.isInvalidTokenError?[4,this.clearMetadata()]:[3,7];case 6:i.sent(),i.label=7;case 7:return e.hasNext=!1,e.nextToken="",[3,8];case 8:return [2,e]}}))}))}));}return e.of=function(t,n){if(er[t]||(er[t]={}),!er[t][n.url]){var r=er[t][n.url]=new e({_iid:t,channel:n});__bundle7dfccc8c.St.of(t).dispatcher.on((function(e){if(e instanceof __bundle7dfccc8c.de)if(e.stateType===__bundle7dfccc8c.J$1.CONNECTED)r.resume();else r.pause();}));}return er[t][n.url]},e.prototype.loadMetadata=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return this._metadata?[3,2]:(e=__bundle7dfccc8c.St.of(this._iid),t=e.cacheContext,n=e.firstConnectedAt,[4,t.preference.get(this._metadataKey)]);case 1:r=s.sent(),this._metadata={token:r?r.token:n/1e3},s.label=2;case 2:return [2]}}))}))},e.prototype.saveMetadata=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return this._metadata?[4,__bundle7dfccc8c.St.of(this._iid).cacheContext.preference.set(this._metadataKey,this._metadata)]:[3,2];case 1:e.sent(),e.label=2;case 2:return [2]}}))}))},e.prototype.clearMetadata=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return __bundle7dfccc8c.St.of(this._iid).cacheContext.preference.remove(this._metadataKey),[2]}))}))},e.prototype.resume=function(){this._sync.start(0);},e.prototype.pause=function(){this._sync.stop();},e}(),nr=function(t){function n(e){var n,s,i,a,o,u,c=this;return (c=t.call(this)||this).method=__bundle7dfccc8c.d.GET,c.path="".concat(__bundle7dfccc8c.We(e.channelType),"/").concat(e.channelUrl,"/messages_gap"),c.params=__bundle7dfccc8c.U({prev_start_ts:e.prevStart,prev_end_ts:e.prevEnd,prev_cache_count:e.prevCount,next_start_ts:e.nextStart,next_end_ts:e.nextEnd,next_cache_count:e.nextCount,huge_gap_threshold:null!==(n=e.threshold)&&void 0!==n?n:null,reverse:!0,custom_types:null!==(s=e.customTypes)&&void 0!==s?s:["*"],message_type:null!==(i=e.messageType)&&void 0!==i?i:null,include_reactions:null===(a=e.includeReactions)||void 0===a||a,with_sorted_meta_array:null===(o=e.includeMetaArray)||void 0===o||o,show_subchannel_messages_only:null!==(u=e.showSubchannelMessagesOnly)&&void 0!==u&&u}),c}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),rr=function(t){function n(e,n){var r,s,i,a,o=this;return (o=t.call(this,e,n)||this).isHugeGap=n.is_huge_gap,o.prevMessages=(null!==(r=n.prev_messages)&&void 0!==r?r:[]).map((function(t){return __bundle7dfccc8c.Ht(e,t)})),o.prevHasMore=null!==(s=n.prev_hasmore)&&void 0!==s&&s,o.nextMessages=(null!==(i=n.next_messages)&&void 0!==i?i:[]).map((function(t){return __bundle7dfccc8c.Ht(e,t)})),o.nextHasmore=null!==(a=n.next_hasmore)&&void 0!==a&&a,o}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),sr=function(e,t){return e.findIndex((function(e){return e.isIdentical(t)}))},ir=function(e,t,n){if(e.length>0){var r=sr(e,t);if(r<0){for(var s=0,i=e.length-1,a=Math.floor((s+i)/2);s<i;){var o=ar(e[a],t,n);if(o>0)i=a,a=Math.floor((s+i)/2);else {if(!(o<0))return {place:a,contains:e[a].isIdentical(t)};s=a+1,a=Math.floor((s+i)/2);}}return {place:ar(e[a],t,n)>0?a:a+1,contains:!1}}return {place:r,contains:!0}}return {place:e.length,contains:!1}},ar=function(e,t,n){switch(n){case __bundle7dfccc8c.K.LATEST_LAST_MESSAGE:return e.lastMessage&&t.lastMessage?t.lastMessage.createdAt-e.lastMessage.createdAt:e.lastMessage?-1:t.lastMessage?1:t.createdAt-e.createdAt;case __bundle7dfccc8c.K.CHRONOLOGICAL:return t.createdAt-e.createdAt;case __bundle7dfccc8c.K.CHANNEL_NAME_ALPHABETICAL:return e.name.localeCompare(t.name)}},or=function(e,t){if(t instanceof __bundle7dfccc8c.xt)return e.findIndex((function(e){return e instanceof __bundle7dfccc8c.xt&&t.isIdentical(e)}));e.findIndex((function(e){return e.isIdentical(t)}));},ur=function(e,t){if(e.length>0){for(var n=0,r=e.length-1,s=Math.floor((n+r)/2);n<r;){var i=e[s].createdAt-t.createdAt;if(i>0)r=s,s=Math.floor((n+r)/2);else {if(!(i<0))return s;n=s+1,s=Math.floor((n+r)/2);}}return e[s].createdAt>t.createdAt?s:s+1}return e.length};!function(e){e.CACHE_AND_REPLACE_BY_API="cache_and_replace_by_api";}(Wn||(Wn={}));var cr,lr,hr,dr=function(){function e(){}return e.prototype._invokeResponse=function(e,t,n){var r=this;__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(r,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(r){switch(e){case"local":this._onCacheResult(t,n);break;case"remote":this._onApiResult(t,n);}return [2]}))}))}));},e.prototype.onCacheResult=function(e){return this._onCacheResult=e,this},e.prototype.onApiResult=function(e){return this._onApiResult=e,this},e}(),_r=function(){function e(e,t){var n=t.channel,r=t.filter,s=t.startingPoint,i=t.limit,a=this;this._channel=null,this._messages=[],this._unsentMessages=[],this._readReceiptMap=new Map,this._deliveryReceiptMap=new Map,this._iid=e,this._key="mc-".concat(__bundle7dfccc8c.R()),this.filter=null!=r?r:new __bundle7dfccc8c.ee,this._channel=n,this._syncRange=new Gn({}),this._hasPrevious=!0,this._hasNext=!0,this._startingPoint=s||Date.now()+6e5,this._limit=i||__bundle7dfccc8c.Y$1;var o=Bn.of(this._iid);o.subscribeGroupChannelEvent(this._key,{onUpdate:function(e,t){var n,r,s,i,o=sr(e,a._channel);if(o>=0)switch(__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(a,void 0,void 0,(function(){var n;return __bundle7dfccc8c.i(this,(function(r){return n=new Jn(t),this._channel=e[o],this._handler.onChannelUpdated(n,this.channel),[2]}))}))})),t){case Vt.EVENT_CHANNEL_UPDATED:var u=!1;for(var c in a._messages){if((g=a._messages[c]).createdAt>=a._channel.messageOffsetTimestamp){u=!0;var l=parseInt(c);if(l>0){var h=a._messages.splice(0,l);a._removeMessagesFromView(h.map((function(e){return e.messageId})),__bundle7dfccc8c.$t.EVENT_MESSAGE_OFFSET_UPDATED);}break}}!u&&a._messages.length>0&&a._removeMessagesFromView(a._messages.map((function(e){return e.messageId})),__bundle7dfccc8c.$t.EVENT_MESSAGE_OFFSET_UPDATED);break;case Vt.EVENT_CHANNEL_READ:var p=[];try{for(var m=__bundle7dfccc8c.s(a._messages),v=m.next();!v.done;v=m.next()){var g=v.value;if((C=a._readReceiptMap.get(g.messageId))>0)C!==a._channel.getUnreadMemberCount(g)&&p.push(g);}}catch(e){n={error:e};}finally{try{v&&!v.done&&(r=m.return)&&r.call(m);}finally{if(n)throw n.error}}p.length>0&&a._updateMessagesToView(p,__bundle7dfccc8c.$t.EVENT_MESSAGE_READ);break;case Vt.EVENT_CHANNEL_DELIVERED:p=[];try{for(var E=__bundle7dfccc8c.s(a._messages),y=E.next();!y.done;y=E.next()){var C;g=y.value;if((C=a._deliveryReceiptMap.get(g.messageId))>0)C!==a._channel.getUndeliveredMemberCount(g)&&p.push(g);}}catch(e){s={error:e};}finally{try{y&&!y.done&&(i=E.return)&&i.call(E);}finally{if(s)throw s.error}}p.length>0&&a._updateMessagesToView(p,__bundle7dfccc8c.$t.EVENT_MESSAGE_READ);}},onRemove:function(e,t){e.indexOf(a.channel.url)>=0&&__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(a,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(n){return e=new Jn(t),this._handler.onChannelDeleted(e,this.channel.url),[2]}))}))}));}}),o.subscribeMessageEvent(this._key,{onUpdate:function(e,t){var n,r,s=[],i=[];try{for(var o=__bundle7dfccc8c.s(e),u=o.next();!u.done;u=o.next()){var c=u.value;c.channelUrl===a._channel.url&&(a.filter.match(c)?s.push(c):i.push(c.messageId));}}catch(e){n={error:e};}finally{try{u&&!u.done&&(r=o.return)&&r.call(o);}finally{if(n)throw n.error}}if(__bundle7dfccc8c.an(t)){if(s.length>0)switch(t){case __bundle7dfccc8c.$t.EVENT_MESSAGE_SENT_FAILED:case __bundle7dfccc8c.$t.EVENT_MESSAGE_SENT_SUCCESS:case __bundle7dfccc8c.$t.EVENT_MESSAGE_UPDATED:case __bundle7dfccc8c.$t.EVENT_MESSAGE_THREADINFO_UPDATED:case __bundle7dfccc8c.$t.EVENT_MESSAGE_REACTION_UPDATED:case __bundle7dfccc8c.$t.SYNC_MESSAGE_CHANGELOGS:a._updateMessagesToView(s,t);break;case __bundle7dfccc8c.$t.EVENT_MESSAGE_SENT_PENDING:case __bundle7dfccc8c.$t.EVENT_MESSAGE_RECEIVED:case __bundle7dfccc8c.$t.SYNC_MESSAGE_FILL:a._addMessagesToView(s,t);}i.length>0&&a._removeMessagesFromView(i,t);}},onRemove:function(e,t){a._removeMessagesFromView(e,t);},onRemoveUnsent:function(e,t){a._removeUnsentMessageFromView(e,t);}});var u=__bundle7dfccc8c.St.of(this._iid).cacheContext;!this._channel.isSuper&&u.localCacheEnabled&&$n.of(this._iid,this._channel).resume(),tr.of(this._iid,this._channel).resume(),this._prevFill=new Yn(this._key,(function(e){return __bundle7dfccc8c.r(a,void 0,void 0,(function(){var t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return [4,this._getRemoteMessages(e,{prevLimit:this._limit,source:__bundle7dfccc8c.$t.SYNC_MESSAGE_FILL})];case 1:return (t=r.sent()).length>0?(n=Math.min.apply(Math,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(t.map((function(e){return e.createdAt}))),!1)),this._syncRange.extends(n),[2,{hasNext:t.length>=this._limit&&this.viewTop<n,nextToken:this._syncRange.top}]):[2,{hasNext:!1,nextToken:0}]}}))}))})),this._nextFill=new Yn(this._key,(function(e){return __bundle7dfccc8c.r(a,void 0,void 0,(function(){var t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return [4,this._getRemoteMessages(e,{nextLimit:this._limit,source:__bundle7dfccc8c.$t.SYNC_MESSAGE_FILL})];case 1:return (t=r.sent()).length>0?(n=Math.max.apply(Math,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(t.map((function(e){return e.createdAt}))),!1)),this._syncRange.extends(n),[2,{hasNext:!(t.length>=this._limit&&this._hasNext)||this.viewBottom>n,nextToken:this._syncRange.bottom}]):[2,{hasNext:!1,nextToken:0}]}}))}))}));var c=__bundle7dfccc8c.St.of(this._iid),p=c.dispatcher,m=c.logger;p.on((function(e){if(e instanceof __bundle7dfccc8c.de)if(e.stateType===__bundle7dfccc8c.J$1.CONNECTED)m.debug("check huge gap"),a._checkHugeGap();else a._prevFill.stop(),a._nextFill.stop();}));}return Object.defineProperty(e.prototype,"channel",{get:function(){return this._channel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"succeededMessages",{get:function(){return __bundle7dfccc8c.a([],__bundle7dfccc8c.o(this._messages),!1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"failedMessages",{get:function(){return this._unsentMessages.filter((function(e){return e.sendingStatus===__bundle7dfccc8c.le.FAILED}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pendingMessages",{get:function(){return this._unsentMessages.filter((function(e){return e.sendingStatus===__bundle7dfccc8c.le.PENDING}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasPrevious",{get:function(){return this._hasPrevious},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasNext",{get:function(){return this._hasNext},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewTop",{get:function(){return Math.min.apply(Math,__bundle7dfccc8c.a(__bundle7dfccc8c.a([],__bundle7dfccc8c.o(this._messages.map((function(e){return e.createdAt}))),!1),[Number.MAX_SAFE_INTEGER],!1))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewBottom",{get:function(){return Math.max.apply(Math,__bundle7dfccc8c.a(__bundle7dfccc8c.a([],__bundle7dfccc8c.o(this._messages.map((function(e){return e.createdAt}))),!1),[0],!1))},enumerable:!1,configurable:!0}),e.prototype.setMessageCollectionHandler=function(e){this._handler=e;},e.prototype._filterUnderOffsetMessage=function(e){var t=this;return e.filter((function(e){return e.createdAt>=t._channel.messageOffsetTimestamp}))},e.prototype._addMessagesToView=function(e,t){var n,r,s=this,i=this._filterUnderOffsetMessage(e),a=[],o=[];try{for(var u=__bundle7dfccc8c.s(i),c=u.next();!c.done;c=u.next()){var p=c.value;if(p.messageId>0){if((E=or(this._messages,p))<0){var m=or(this._unsentMessages,p);m<0?a.push(p):(this._unsentMessages.splice(m,1),o.push(p));var v=ur(this._messages,p);this._messages.splice(v,0,p);}else o.push(p),this._messages[E]=p;if(this._readReceiptMap.set(p.messageId,this._channel.getUnreadMemberCount(p)),this._deliveryReceiptMap.set(p.messageId,this._channel.getUndeliveredMemberCount(p)),p.updatedAt>0){var g=this._updateChildMessagesInView(p);o.push.apply(o,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(g),!1));}}else {var E;if(p instanceof __bundle7dfccc8c.xt)(E=or(this._unsentMessages,p))<0?or(this._messages,p)<0&&(this._unsentMessages.push(p),a.push(p)):(o.push(p),this._unsentMessages[E]=p);}}}catch(e){n={error:e};}finally{try{c&&!c.done&&(r=u.return)&&r.call(u);}finally{if(n)throw n.error}}__bundle7dfccc8c.an(t)&&__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(s,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(n){return e=new Xn(t),a.length>0&&this._handler.onMessagesAdded(e,this.channel,a),o.length>0&&this._handler.onMessagesUpdated(e,this.channel,o),[2]}))}))}));},e.prototype._updateChildMessagesInView=function(e){var t=[];return this._messages.forEach((function(n){n.applyParentMessage(e)&&t.push(n);})),t},e.prototype._updateMessagesToView=function(e,t){var n,r,s=this,i=[];try{for(var a=__bundle7dfccc8c.s(e),o=a.next();!o.done;o=a.next()){var u,c=o.value;if(c.messageId>0)if((u=or(this._messages,c))>=0)i.push(c),this._messages[u]=c;else {var l=or(this._unsentMessages,c);if(l>=0){i.push(c),this._unsentMessages.splice(l,1);var h=ur(this._messages,c);this._messages.splice(h,0,c);}}else if(c instanceof __bundle7dfccc8c.xt)(u=or(this._unsentMessages,c))>=0&&(i.push(c),this._unsentMessages[u]=c);}}catch(e){n={error:e};}finally{try{o&&!o.done&&(r=a.return)&&r.call(a);}finally{if(n)throw n.error}}return __bundle7dfccc8c.an(t)&&__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(s,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(n){return e=new Xn(t),i.length>0&&this._handler.onMessagesUpdated(e,this.channel,i),[2]}))}))})),i},e.prototype._removeMessagesFromView=function(e,t){var n,r,s=this,i=[],a=function(e){var t=o._messages.findIndex((function(t){return t.messageId===e}));t>=0&&(i.push(o._messages[t].messageId),o._messages.splice(t,1));},o=this;try{for(var u=__bundle7dfccc8c.s(e),c=u.next();!c.done;c=u.next()){a(c.value);}}catch(e){n={error:e};}finally{try{c&&!c.done&&(r=u.return)&&r.call(u);}finally{if(n)throw n.error}}return __bundle7dfccc8c.an(t)&&i.length>0&&__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(s,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(n){return e=new Xn(t),i.length>0&&this._handler.onMessagesDeleted(e,this.channel,i),[2]}))}))})),i},e.prototype._removeUnsentMessageFromView=function(e,t){var n=this._unsentMessages.findIndex((function(t){return t.reqId===e}));n>=0&&this._unsentMessages.splice(n,1);},e.prototype._getLocalMessages=function(e,t){var n=t.prevLimit,r=void 0===n?0:n,s=t.nextLimit,i=void 0===s?0:s;return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,s,a,o,u,c;return __bundle7dfccc8c.i(this,(function(d){switch(d.label){case 0:return t=Bn.of(this._iid),r>0?[4,t.getMessagesFromCache(this._channel.url,e,"prev",this.filter,this._limit)]:[3,2];case 1:return s=d.sent(),[3,3];case 2:s=[],d.label=3;case 3:return n=s,i>0?[4,t.getMessagesFromCache(this._channel.url,e,"next",this.filter,this._limit)]:[3,5];case 4:return o=d.sent(),[3,6];case 5:o=[],d.label=6;case 6:if(a=o,n.length>0&&a.length)for(c in u=n.map((function(e){return e.messageId})),a)if(u.includes(a[c].messageId)){a.splice(parseInt(c),1);break}return [2,__bundle7dfccc8c.a(__bundle7dfccc8c.a([],__bundle7dfccc8c.o(n),!1),__bundle7dfccc8c.o(a),!1).sort((function(e,t){return t.createdAt-e.createdAt}))]}}))}))},e.prototype._getRemoteMessages=function(e,t){var n=t.prevLimit,r=void 0===n?0:n,i=t.nextLimit,a=void 0===i?0:i,o=t.source,u=void 0===o?__bundle7dfccc8c.$t.REQUEST_MESSAGE:o;return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return t=__bundle7dfccc8c.En.of(this._iid),r>0||a>0?[4,t.getMessagesByTimestamp(this._channel.url,this._channel.channelType,e,__bundle7dfccc8c.n(__bundle7dfccc8c.n({},this.filter),{prevResultSize:r,nextResultSize:a,includeMetaArray:!0,includeReactions:!0,includeThreadInfo:!0}),u)]:[3,2];case 1:return n=i.sent(),[3,3];case 2:n=[],i.label=3;case 3:return [2,n]}}))}))},e.prototype._checkHugeGap=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i,a,o,u,c,f,p=this;return __bundle7dfccc8c.i(this,(function(m){switch(m.label){case 0:return this._messages.length>0?(e=this.viewTop,t=this._syncRange.top,n=this._syncRange.bottom,r=this.hasNext?this.viewBottom:Number.MAX_SAFE_INTEGER,[4,(i=Bn.of(this._iid)).getCachedMessageCountBetween(this._channel.url,this.filter,e,t)]):[3,4];case 1:return a=m.sent(),[4,i.getCachedMessageCountBetween(this._channel.url,this.filter,n,r)];case 2:return o=m.sent(),[4,__bundle7dfccc8c.Ee$1((function(){return __bundle7dfccc8c.r(p,void 0,void 0,(function(){var i,u,c,f,p,m,v,g,E,y,C,N,b,S,A,T,U,I=this;return __bundle7dfccc8c.i(this,(function(w){switch(w.label){case 0:return i=__bundle7dfccc8c.St.of(this._iid),u=i.dispatcher,c=i.requestQueue,f=new nr(__bundle7dfccc8c.n({channelUrl:this._channel.url,channelType:this._channel.channelType,prevStart:e,prevEnd:t,prevCount:a,nextStart:n,nextEnd:r,nextCount:o},this.filter)),[4,c.send(f)];case 1:return p=w.sent(),m=p.as(rr),v=m.isHugeGap,g=m.prevMessages,E=void 0===g?[]:g,y=m.prevHasMore,C=m.nextMessages,N=void 0===C?[]:C,b=m.nextHasmore,v?__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(I,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._handler.onHugeGapDetected(),[2]}))}))})):(this._hasPrevious=y,this._hasNext=b,S=this.viewTop,A=this.viewBottom,T=Math.min.apply(Math,__bundle7dfccc8c.a([Number.MAX_SAFE_INTEGER],__bundle7dfccc8c.o(E.map((function(e){return e.createdAt}))),!1)),U=Math.max.apply(Math,__bundle7dfccc8c.a([0],__bundle7dfccc8c.o(N.map((function(e){return e.createdAt}))),!1)),u.dispatch(new __bundle7dfccc8c.un({messages:E,source:__bundle7dfccc8c.$t.SYNC_MESSAGE_FILL})),u.dispatch(new __bundle7dfccc8c.un({messages:N,source:__bundle7dfccc8c.$t.SYNC_MESSAGE_FILL})),this._syncRange.extends(T,U),S<T&&this._prevFill.start(T),A>U&&this._nextFill.start(U)),[2]}}))}))}),1)];case 3:return m.sent(),[3,6];case 4:return u=Math.floor(this._limit/2),[4,this._getRemoteMessages(Date.now(),{prevLimit:u,nextLimit:u,source:__bundle7dfccc8c.$t.SYNC_MESSAGE_FILL})];case 5:(c=m.sent()).length>0&&((f=this._syncRange).extends.apply(f,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(c.map((function(e){return e.createdAt}))),!1)),c.length<u&&(this._hasPrevious=!1,this._hasNext=!1)),m.label=6;case 6:return [2]}}))}))},e.prototype._loadAllFailedMessages=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,Bn.of(this._iid).getAllFailedMessagesFromCache(this._channel.url,this.filter)];case 1:return e=t.sent(),this._unsentMessages=e,[2,e]}}))}))},e.prototype.initialize=function(e){var t=this,n=new dr;this._messages=[],this._unsentMessages=[],this._syncRange=new Gn({}),this._hasNext=!0,this._hasPrevious=!0;var r=Math.floor(this._limit/2);if(e===Wn.CACHE_AND_REPLACE_BY_API)this._getLocalMessages(this._startingPoint,{prevLimit:r,nextLimit:r}).then((function(e){var r=t._filterUnderOffsetMessage(e);t._addMessagesToView(r,__bundle7dfccc8c.$t.REQUEST_MESSAGE),n._invokeResponse("local",null,r);})).catch((function(e){if(__bundle7dfccc8c.h(e))throw e;n._invokeResponse("local",e,null);})).finally((function(){t._loadAllFailedMessages(),t._getRemoteMessages(t._startingPoint,{prevLimit:r,nextLimit:r}).then((function(e){var s;t._messages=[];var i=t._filterUnderOffsetMessage(e);i.length<r&&(t._hasPrevious=!1,t._hasNext=!1),i.length>0&&((s=t._syncRange).extends.apply(s,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(i.map((function(e){return e.createdAt}))),!1)),t._addMessagesToView(i,__bundle7dfccc8c.$t.REQUEST_MESSAGE)),n._invokeResponse("remote",null,i);})).catch((function(e){if(__bundle7dfccc8c.h(e))throw e;n._invokeResponse("remote",e,null);}));}));return n},e.prototype.loadPrevious=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,s=this;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return this._hasPrevious?(e=this.viewTop,t=[],[4,__bundle7dfccc8c.Se((function(){return __bundle7dfccc8c.r(s,void 0,void 0,(function(){var n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return n=this._filterUnderOffsetMessage,[4,this._getLocalMessages(e,{prevLimit:this._limit})];case 1:return t=n.apply(this,[r.sent()]),[2]}}))}))}))]):[3,5];case 1:return i.sent(),n=$n.of(this._iid,this._channel),0!==t.length&&n.isWrappingMessages(t)?[3,3]:[4,__bundle7dfccc8c.Se((function(){return __bundle7dfccc8c.r(s,void 0,void 0,(function(){var r,s;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return r=this._filterUnderOffsetMessage,[4,this._getRemoteMessages(e,{prevLimit:this._limit})];case 1:return t=r.apply(this,[i.sent()]),this._hasPrevious=t.length>=this._limit,t.length>0&&((s=this._syncRange).extends.apply(s,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(t.map((function(e){return e.createdAt}))),!1)),n.range.overlap(this._syncRange)&&n.range.extends(this._syncRange.top)),[2]}}))}))}))];case 2:return i.sent(),this._addMessagesToView(t,__bundle7dfccc8c.$t.REQUEST_MESSAGE),[3,4];case 3:this._hasPrevious=t.length>=this._limit,t.length>0&&((r=this._syncRange).extends.apply(r,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(t.map((function(e){return e.createdAt}))),!1)),this._addMessagesToView(t,__bundle7dfccc8c.$t.REQUEST_MESSAGE)),i.label=4;case 4:return [2,t];case 5:return [2,[]]}}))}))},e.prototype.loadNext=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,s=this;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return e=this.viewBottom,t=[],[4,__bundle7dfccc8c.Se((function(){return __bundle7dfccc8c.r(s,void 0,void 0,(function(){var n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return n=this._filterUnderOffsetMessage,[4,this._getLocalMessages(e,{nextLimit:this._limit})];case 1:return t=n.apply(this,[r.sent()]),[2]}}))}))}))];case 1:return i.sent(),n=$n.of(this._iid,this._channel),0!==t.length&&n.isWrappingMessages(t)?[3,3]:[4,__bundle7dfccc8c.Se((function(){return __bundle7dfccc8c.r(s,void 0,void 0,(function(){var r,s;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return r=this._filterUnderOffsetMessage,[4,this._getRemoteMessages(e,{nextLimit:this._limit})];case 1:return t=r.apply(this,[i.sent()]),this._hasNext=t.length>=this._limit,t.length>0&&((s=this._syncRange).extends.apply(s,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(t.map((function(e){return e.createdAt}))),!1)),n.range.overlap(this._syncRange)&&n.range.extends(this._syncRange.bottom)),[2]}}))}))}))];case 2:return i.sent(),this._addMessagesToView(t,__bundle7dfccc8c.$t.REQUEST_MESSAGE),[3,4];case 3:this._hasNext=t.length>=this._limit,t.length>0&&((r=this._syncRange).extends.apply(r,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(t.map((function(e){return e.createdAt}))),!1)),this._addMessagesToView(t,__bundle7dfccc8c.$t.REQUEST_MESSAGE)),i.label=4;case 4:return [2,t]}}))}))},e.prototype.removeFailedMessage=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return [4,Bn.of(this._iid).removeFailedMessageFromCache(e)];case 1:return n.sent(),(t=this._unsentMessages.findIndex((function(t){return t.reqId===e})))>-1&&this._unsentMessages.splice(t,1),[2]}}))}))},e.prototype.dispose=function(){var e=Bn.of(this._iid);e.unsubscribeGroupChannelEvent(this._key),e.unsubscribeMessageEvent(this._key);},e}(),fr={coverUrl:null,coverImage:null,isDistinct:null,isPublic:null,isDiscoverable:null,accessCode:null,name:null,data:null,customType:null,operatorUserIds:null,messageSurvivalSeconds:null},pr={hidePreviousMessages:!1,allowAutoUnhide:!0},mr=function(t){function n(e){var n=this,r=e.channelUrl,s=e.token,i=e.limit,a=e.order,o=e.mutedMemberFilter,u=e.memberStateFilter,c=e.nicknameStartsWithFilter,l=e.operatorFilter;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.GET,n.path="".concat(__bundle7dfccc8c.qe,"/").concat(encodeURIComponent(r),"/members"),n.params={token:s,limit:i,order:a,muted_member_filter:o,member_state_filter:u,nickname_startswith:c,operator_filter:l,show_member_is_muted:!0,show_read_receipt:!0,show_delivery_receipt:!0},n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),vr=function(t){function n(e,n){var r=t.call(this,e,n)||this;r.token=null,r.members=[];var s=n.next,i=n.members;return r.token=s,i&&i.length>0&&(r.members=i.map((function(t){return new It(e,t)}))),r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F);!function(e){e.ALL="all",e.MUTED="muted",e.UNMUTED="unmuted";}(cr||(cr={})),function(e){e.MEMBER_NICKNAME_ALPHABETICAL="member_nickname_alphabetical",e.OPERATOR_THEN_MEMBER_ALPHABETICAL="operator_then_member_alphabetical";}(lr||(lr={})),function(e){e.ALL="all",e.JOINED="joined_only",e.INVITED="invited_only",e.INVITED_BY_FRIEND="invited_by_friend",e.INVITED_BY_NON_FRIEND="invited_by_non_friend";}(hr||(hr={}));var gr=function(n){function r(e,t,r){var s,a,o,u,c=this;return (c=n.call(this,e,t,__bundle7dfccc8c.ne.GROUP,r)||this).mutedMemberFilter=cr.ALL,c.memberStateFilter=hr.ALL,c.nicknameStartsWithFilter=null,c.operatorFilter=exports.At.ALL,c.order=lr.MEMBER_NICKNAME_ALPHABETICAL,c.mutedMemberFilter=null!==(s=r.mutedMemberFilter)&&void 0!==s?s:cr.ALL,c.memberStateFilter=null!==(a=r.memberStateFilter)&&void 0!==a?a:hr.ALL,c.nicknameStartsWithFilter=null!==(o=r.nicknameStartsWithFilter)&&void 0!==o?o:null,c.order=null!==(u=r.order)&&void 0!==u?u:lr.MEMBER_NICKNAME_ALPHABETICAL,c}return __bundle7dfccc8c.t(r,n),r.prototype._validate=function(){return n.prototype._validate.call(this)&&__bundle7dfccc8c.m(cr,this.mutedMemberFilter)&&__bundle7dfccc8c.m(hr,this.memberStateFilter)&&(__bundle7dfccc8c.y("string",this.nicknameStartsWithFilter)||null===this.nicknameStartsWithFilter)&&__bundle7dfccc8c.m(exports.At,this.operatorFilter)&&__bundle7dfccc8c.m(lr,this.order)},r.prototype.next=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i,a;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,e=__bundle7dfccc8c.St.of(this._iid).requestQueue,t=new mr(__bundle7dfccc8c.n(__bundle7dfccc8c.n({},this),{token:this._token})),[4,e.send(t)]):[3,2]:[3,5];case 1:return n=o.sent(),r=n.as(vr),i=r.members,a=r.token,this._token=a,this._hasNext=!!a,this._isLoading=!1,[2,i];case 2:return [2,[]];case 3:throw __bundle7dfccc8c.p.queryInProgress;case 4:return [3,6];case 5:throw __bundle7dfccc8c.p.invalidParameters;case 6:return [2]}}))}))},r}(__bundle7dfccc8c.On),Er=function(t){function n(e){var n=this,r=e.channelUrl,s=e.userId,i=e.accessCode;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.PUT,n.path="".concat(__bundle7dfccc8c.qe,"/").concat(encodeURIComponent(r),"/accept"),n.params={user_id:s,access_code:i},n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),yr=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.channel=new Vr(e,n),r.channel.myMemberState=yt.JOINED,r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),Cr=function(t){function n(e){var n=this,s=e.channelUrl,i=e.isDistinct,a=e.isPublic,o=e.isDiscoverable,u=e.coverUrl,c=e.coverImage,l=e.accessCode,h=e.name,d=e.data,_=e.customType,f=e.operatorUserIds,p=e.messageSurvivalSeconds;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.PUT,n.path="".concat(__bundle7dfccc8c.qe,"/").concat(encodeURIComponent(s)),n.params=__bundle7dfccc8c.U({is_distinct:i,is_public:a,is_discoverable:o,name:h,data:d,custom_type:_,cover_url:u,cover_file:c,access_code:l,operator_ids:f,message_survival_seconds:p}),n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),Nr=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.channel=new Vr(e,n),r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),br=function(t){function n(e){var n=this,r=e.channelUrl;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.DELETE,n.path="".concat(__bundle7dfccc8c.qe,"/").concat(encodeURIComponent(r)),n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q);!function(t){function n(e,n){return t.call(this,e,n)||this}__bundle7dfccc8c.t(n,t);}(__bundle7dfccc8c.F);var Mr=function(t){function n(e){var n=this,r=e.channelUrl;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.DELETE,n.path="".concat(__bundle7dfccc8c.qe,"/").concat(encodeURIComponent(r),"/hide"),n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q);!function(t){function n(){return null!==t&&t.apply(this,arguments)||this}__bundle7dfccc8c.t(n,t);}(__bundle7dfccc8c.F);var Sr=function(t){function n(e){var n=e.userId,r=e.channelUrl,s=e.countPreference,i=t.call(this)||this;return i.method=__bundle7dfccc8c.d.PUT,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/count_preference/").concat(encodeURIComponent(r)),i.params={count_preference:s},i}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),Ar=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.countPreference=Or[n.count_preference],r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),Tr=function(t){function n(e){var n=this,r=e.channelUrl;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.PUT,n.path="".concat(__bundle7dfccc8c.qe,"/").concat(encodeURIComponent(r),"/reset_user_history"),n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),Ur=function(t){function n(e,n){var r=t.call(this,e,n)||this;r.messageOffsetTimestamp=null;var s=n.ts_message_offset;return r.messageOffsetTimestamp=null!=s?s:null,r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),Ir=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},__bundle7dfccc8c.Ie$1),{scheduledAt:null,file:null,fileUrl:null,fileName:null,mimeType:null,fileSize:null,thumbnailSizes:null,requireAuth:!1}),wr=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},__bundle7dfccc8c.we),{scheduledAt:null}),Dr=function(t){function n(e){var n,r=this;r=t.call(this)||this;var s=[];e.mentionType===__bundle7dfccc8c.ae$1.USERS&&(e.mentionedUserIds?s=e.mentionedUserIds:e.mentionedUsers&&(s=e.mentionedUsers.map((function(e){return e.userId}))));var i=e.channelType,a=e.channelUrl,o=e.scheduledMessageId;return r.method=__bundle7dfccc8c.d.PUT,r.path="".concat(__bundle7dfccc8c.We(i),"/").concat(encodeURIComponent(a),"/scheduled_messages/").concat(encodeURIComponent(o)),r.params={req_id:e.reqId,scheduled_at:e.scheduledAt,message_type:__bundle7dfccc8c.oe$1.FILE,url:e.fileUrl,file_name:e.fileName,file_size:e.fileSize,file_type:e.mimeType,thumbnails:e.thumbnailSizes?e.thumbnailSizes.map((function(e){return __bundle7dfccc8c.Gt.payloadify(e)})):[],custom_type:e.customType,data:e.data,require_auth:e.requireAuth,mention_type:e.mentionType,mentioned_user_ids:s,sorted_metaarray:null===(n=e.metaArrays)||void 0===n?void 0:n.map((function(e){return __bundle7dfccc8c.Dt.payloadify(e)})),apple_critical_alert_options:__bundle7dfccc8c.Lt.payloadify(e.appleCriticalAlertOptions),push_option:e.pushNotificationDeliveryOption},r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),Lr=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.message=new __bundle7dfccc8c.Wt(e,n),r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),Rr=function(t){function n(e){var n,r=this;r=t.call(this)||this;var s=[];e.mentionType===__bundle7dfccc8c.ae$1.USERS&&(e.mentionedUserIds?s=e.mentionedUserIds:e.mentionedUsers&&(s=e.mentionedUsers.map((function(e){return e.userId}))));var i=e.channelType,a=e.channelUrl,o=e.scheduledMessageId;return r.method=__bundle7dfccc8c.d.PUT,r.path="".concat(__bundle7dfccc8c.We(i),"/").concat(encodeURIComponent(a),"/scheduled_messages/").concat(encodeURIComponent(o)),r.params={req_id:e.reqId,scheduled_at:e.scheduledAt,message_type:__bundle7dfccc8c.oe$1.USER,message:e.message,custom_type:e.customType,data:e.data,mention_type:e.mentionType,mentioned_user_ids:s,sorted_metaarray:null===(n=e.metaArrays)||void 0===n?void 0:n.map((function(e){return __bundle7dfccc8c.Dt.payloadify(e)})),apple_critical_alert_options:__bundle7dfccc8c.Lt.payloadify(e.appleCriticalAlertOptions),target_langs:e.translationTargetLanguages,push_option:e.pushNotificationDeliveryOption},r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q);!function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.message=new __bundle7dfccc8c.Vt(e,n),r}__bundle7dfccc8c.t(n,t);}(__bundle7dfccc8c.F);var Or,kr,Fr,Pr=function(t){function n(e){var n=t.call(this)||this,r=e.channelType,s=e.channelUrl,i=e.scheduledMessageId;return n.method=__bundle7dfccc8c.d.DELETE,n.path="".concat(__bundle7dfccc8c.We(r),"/").concat(encodeURIComponent(s),"/scheduled_messages/").concat(encodeURIComponent(i)),n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),xr=function(t){function n(e){var n=t.call(this)||this,r=e.channelType,s=e.channelUrl,i=e.scheduledMessageId;return n.method=__bundle7dfccc8c.d.POST,n.path="".concat(__bundle7dfccc8c.We(r),"/").concat(encodeURIComponent(s),"/scheduled_messages/").concat(encodeURIComponent(i),"/send_now"),n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q);!function(e){e.ALL="all",e.UNREAD_MESSAGE_COUNT_ONLY="unread_message_count_only",e.UNREAD_MENTION_COUNT_ONLY="unread_mention_count_only",e.OFF="off";}(Or||(Or={})),function(e){e.MUTED="muted",e.UNMUTED="unmuted";}(kr||(kr={})),function(e){e.UNHIDDEN="unhidden",e.HIDDEN_ALLOW_AUTO_UNHIDE="hidden_allow_auto_unhide",e.HIDDEN_PREVENT_AUTO_UNHIDE="hidden_prevent_auto_unhide";}(Fr||(Fr={}));var Hr,Vr=function(o){function u(e,r){var u,c,d,_,f,p,v,g,E,y,C,N,b,M,S,A,T,U,I=this;return (I=o.call(this,e,r)||this)._unreadMemberStateMap=new Map,I._undeliveredMemberStateMap=new Map,I._typingStatus=new Map,I._lastMemberCountUpdated=0,I._typingStarted=0,I._typingEnded=0,I.isDistinct=!1,I.isSuper=!1,I.isBroadcast=!1,I.isExclusive=!1,I.isPublic=!1,I.isDiscoverable=!0,I.isAccessCodeRequired=!1,I.isPushEnabled=!1,I.unreadMessageCount=0,I.unreadMentionCount=0,I.members=[],I.memberCount=0,I.joinedMemberCount=0,I.hiddenState=Fr.UNHIDDEN,I.lastMessage=null,I.messageOffsetTimestamp=0,I.messageSurvivalSeconds=-1,I.myMemberState=yt.NONE,I.myRole=__bundle7dfccc8c.re$1.NONE,I.myMutedState=kr.UNMUTED,I.myLastRead=0,I.myCountPreference=Or.ALL,I.myPushTriggerOption=__bundle7dfccc8c.H.DEFAULT,I.inviter=null,I.invitedAt=0,I.joinedAt=0,I.channelType=__bundle7dfccc8c.ne.GROUP,I.isDistinct=null!==(c=r.is_distinct)&&void 0!==c&&c,I.isSuper=null!==(d=r.is_super)&&void 0!==d&&d,I.isBroadcast=null!==(_=r.is_broadcast)&&void 0!==_&&_,I.isExclusive=null!==(f=r.is_exclusive)&&void 0!==f&&f,I.isPublic=null!==(p=r.is_public)&&void 0!==p&&p,I.isDiscoverable=null!==(v=r.is_discoverable)&&void 0!==v?v:I.isPublic,I.isAccessCodeRequired=null!==(g=r.is_access_code_required)&&void 0!==g&&g,I.isPushEnabled=null!==(E=r.is_push_enabled)&&void 0!==E&&E,Array.isArray(r.members)&&(u=I.members).push.apply(u,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(r.members.map((function(e){return new It(I._iid,e)}))),!1)),I.memberCount=null!==(y=r.member_count)&&void 0!==y?y:0,I.joinedMemberCount=null!==(C=r.joined_member_count)&&void 0!==C?C:0,I.hiddenState=__bundle7dfccc8c.m(Fr,r.hidden_state)?r.hidden_state:Fr.UNHIDDEN,I.messageOffsetTimestamp=null!==(N=r.ts_message_offset)&&void 0!==N?N:0,I.messageSurvivalSeconds=null!==(b=r.message_survival_seconds)&&void 0!==b?b:-1,I.lastMessage=r.last_message?__bundle7dfccc8c.Ht(I._iid,__bundle7dfccc8c.n({channel_type:I.channelType},r.last_message)):null,r.read_receipt&&Object.keys(r.read_receipt).forEach((function(e){__bundle7dfccc8c.y("number",r.read_receipt[e])&&I._updateUnreadMemberState(e,r.read_receipt[e]);})),r.delivery_receipt&&Object.keys(r.delivery_receipt).forEach((function(e){__bundle7dfccc8c.y("number",r.delivery_receipt[e])&&I._updateUndeliveredMemberState(e,r.delivery_receipt[e]);})),I.myMemberState=__bundle7dfccc8c.m(yt,r.member_state)?r.member_state:yt.NONE,I.myRole=__bundle7dfccc8c.m(__bundle7dfccc8c.re$1,r.my_role)?r.my_role:__bundle7dfccc8c.re$1.NONE,__bundle7dfccc8c.m(kr,r.is_muted)?I.myMutedState=r.is_muted:__bundle7dfccc8c.y("boolean",r.is_muted)?I.myMutedState=r.is_muted?kr.MUTED:kr.UNMUTED:I.myMutedState=kr.UNMUTED,I.myCountPreference=__bundle7dfccc8c.m(Or,r.count_preference)?r.count_preference:Or.ALL,I.myPushTriggerOption=__bundle7dfccc8c.m(__bundle7dfccc8c.H,r.push_trigger_option)?r.push_trigger_option:__bundle7dfccc8c.H.ALL,I.myLastRead=null!==(M=r.user_last_read)&&void 0!==M?M:0,I.inviter=r.inviter?new __bundle7dfccc8c.ct(I._iid,r.inviter):null,I.invitedAt=null!==(S=r.invited_at)&&void 0!==S?S:0,I.joinedAt=null!==(A=r.joined_ts)&&void 0!==A?A:0,I._updateUnreadCount(null!==(T=r.unread_message_count)&&void 0!==T?T:0,null!==(U=r.unread_mention_count)&&void 0!==U?U:0),I}return __bundle7dfccc8c.t(u,o),Object.defineProperty(u.prototype,"isHidden",{get:function(){return this.hiddenState!==Fr.UNHIDDEN},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"isTyping",{get:function(){return Object.keys(this._typingStatus).length>0},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"cachedUnreadMemberState",{get:function(){var e,t,n={};try{for(var r=__bundle7dfccc8c.s(this._unreadMemberStateMap),s=r.next();!s.done;s=r.next()){var i=__bundle7dfccc8c.o(s.value,2),a=i[0],o=i[1];n[a]=o;}}catch(t){e={error:t};}finally{try{s&&!s.done&&(t=r.return)&&t.call(r);}finally{if(e)throw e.error}}return n},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"cachedUndeliveredMemberState",{get:function(){var e,t,n={};try{for(var r=__bundle7dfccc8c.s(this._undeliveredMemberStateMap),s=r.next();!s.done;s=r.next()){var i=__bundle7dfccc8c.o(s.value,2),a=i[0],o=i[1];n[a]=o;}}catch(t){e={error:t};}finally{try{s&&!s.done&&(t=r.return)&&t.call(r);}finally{if(e)throw e.error}}return n},enumerable:!1,configurable:!0}),u.payloadify=function(e){return e?__bundle7dfccc8c.U(__bundle7dfccc8c.n(__bundle7dfccc8c.n({},o.payloadify.call(this,e)),{is_access_code_required:e.isAccessCodeRequired,is_distinct:e.isDistinct,is_super:e.isSuper,is_broadcast:e.isBroadcast,is_exclusive:e.isExclusive,is_public:e.isPublic,is_discoverable:e.isDiscoverable,is_muted:e.myMutedState,is_push_enabled:e.isPushEnabled,unread_message_count:e.unreadMessageCount,unread_mention_count:e.unreadMentionCount,push_trigger_option:e.myPushTriggerOption,count_preference:e.myCountPreference,hidden_state:e.hiddenState,member_count:e.memberCount,joined_member_count:e.joinedMemberCount,member_state:e.myMemberState,my_role:e.myRole,user_last_read:e.myLastRead,ts_message_offset:e.messageOffsetTimestamp,message_survival_seconds:e.messageSurvivalSeconds,read_receipt:e.cachedUnreadMemberState,delivery_receipt:e.cachedUndeliveredMemberState,members:e.members.map((function(e){return It.payloadify(e)})),last_message:__bundle7dfccc8c.Bt(e.lastMessage),inviter:e.inviter?__bundle7dfccc8c.ct.payloadify(e.inviter):null,invited_at:e.invitedAt,joined_ts:e.joinedAt})):null},u.prototype._updateUnreadCount=function(e,t){if("number"==typeof e&&e>=0)if(this.myCountPreference===Or.ALL||this.myCountPreference===Or.UNREAD_MESSAGE_COUNT_ONLY)if(this.isExclusive||this.isSuper||this.isBroadcast){var n=__bundle7dfccc8c.St.of(this._iid).maxSuperGroupChannelUnreadCount;this.unreadMessageCount=n&&e>=n?n:e;}else this.unreadMessageCount=e;else this.unreadMessageCount=0;else this.unreadMessageCount=0;"number"==typeof t&&t>=0&&(this.myCountPreference===Or.ALL||this.myCountPreference===Or.UNREAD_MENTION_COUNT_ONLY)?this.unreadMentionCount=t:this.unreadMentionCount=0;},u.prototype._updateUnreadMemberState=function(e,t){var n=this._unreadMemberStateMap.get(e);return (!n||n<t)&&(this._unreadMemberStateMap.set(e,t),__bundle7dfccc8c.St.of(this._iid).sdkState.userId===e&&(this.myLastRead=t),!0)},u.prototype._updateUndeliveredMemberState=function(e,t){var n=this._undeliveredMemberStateMap.get(e);(!n||n<t)&&this._undeliveredMemberStateMap.set(e,t);},u.prototype._updateTypingStatus=function(e,t){void 0===t&&(t=(new Date).getTime()),t>0?this._typingStatus[e.userId]={user:e,ts:t}:delete this._typingStatus[e.userId];},u.prototype._invalidateTypingStatus=function(){var e=(new Date).getTime(),t=!1;for(var n in this._typingStatus){e-this._typingStatus[n].ts>=1e4&&(delete this._typingStatus[n],t=!0);}return t},u.prototype._setLatestMemberCount=function(e,t,n){var r=!1;return n>=this._lastMemberCountUpdated&&(this._lastMemberCountUpdated=n,r=e!==this.memberCount||t!==this.joinedMemberCount,this.memberCount=e,this.joinedMemberCount=t),r},u.prototype.isReadMessage=function(e){var t=__bundle7dfccc8c.St.of(this._iid).sdkState,n=this._unreadMemberStateMap.get(t.userId);return n&&n>=e.createdAt},u.prototype.serialize=function(){var e=this;return __bundle7dfccc8c.st(this,(function(t){t.cachedUnreadMemberState=e.cachedUnreadMemberState,t.cachedUndeliveredMemberState=e.cachedUndeliveredMemberState;}))},u.prototype.createMessageCollection=function(e){return void 0===e&&(e={}),new _r(this._iid,__bundle7dfccc8c.n({channel:this},e))},u.prototype.createMemberListQuery=function(e){return void 0===e&&(e={}),new gr(this._iid,this.url,e)},u.prototype.addMember=function(e,t){if(void 0===t&&(t=0),!this.isExclusive&&!this.isSuper&&!this.isBroadcast){var n=this.members.findIndex((function(t){return t.userId===e.userId}));if(n>-1){var r=this.members[n];r.state===yt.JOINED&&(e.state=r.state),this.members.splice(n,1),this.memberCount--;}this.members.push(e),this.memberCount++,this._updateUnreadMemberState(e.userId,t),this._updateUndeliveredMemberState(e.userId,t);}},u.prototype.removeMember=function(e){if(!this.isExclusive&&!this.isSuper&&!this.isBroadcast){var t=this.members.findIndex((function(t){return t.userId===e.userId}));if(t>-1)return this.members.splice(t,1),this.memberCount--,!0}return !1},u.prototype.getUnreadMemberCount=function(e){var t,n;if(e instanceof __bundle7dfccc8c.xt&&!this.isExclusive&&!this.isSuper&&!this.isBroadcast){var r=__bundle7dfccc8c.St.of(this._iid).sdkState,s=e.createdAt,i=0;try{for(var a=__bundle7dfccc8c.s(this.members),o=a.next();!o.done;o=a.next()){var u=o.value;if(r.userId!==u.userId&&u.state===yt.JOINED&&e.sender.userId!==u.userId)(this.cachedUnreadMemberState[u.userId]||0)<s&&i++;}}catch(e){t={error:e};}finally{try{o&&!o.done&&(n=a.return)&&n.call(a);}finally{if(t)throw t.error}}return i}return 0},u.prototype.getUndeliveredMemberCount=function(e){var t,n;if(e instanceof __bundle7dfccc8c.xt&&!this.isExclusive&&!this.isSuper&&!this.isBroadcast){var r=__bundle7dfccc8c.St.of(this._iid).sdkState,s=e.createdAt,i=0;try{for(var a=__bundle7dfccc8c.s(this.members),o=a.next();!o.done;o=a.next()){var u=o.value;if(r.userId!==u.userId&&u.state===yt.JOINED&&e.sender.userId!==u.userId)(this.cachedUndeliveredMemberState[u.userId]||0)<s&&i++;}}catch(e){t={error:e};}finally{try{o&&!o.done&&(n=a.return)&&n.call(a);}finally{if(t)throw t.error}}return i}return 0},u.prototype.getReadMembers=function(e,t){var n=this;void 0===t&&(t=!1);var r=__bundle7dfccc8c.St.of(this._iid).sdkState;if(!r.userId||this.isExclusive||this.isSuper||this.isBroadcast)return [];var s=[];return this.members.forEach((function(i){(t||i.userId!==r.userId&&i.userId!==e.sender.userId)&&(n._unreadMemberStateMap.get(i.userId)>=e.createdAt&&s.push(i));})),s},u.prototype.getUnreadMembers=function(e,t){var n=this;void 0===t&&(t=!1);var r=__bundle7dfccc8c.St.of(this._iid).sdkState;if(!r.userId||this.isExclusive||this.isSuper||this.isBroadcast)return [];var s=[];return this.members.forEach((function(i){(t||i.userId!==r.userId&&i.userId!==e.sender.userId)&&(n._unreadMemberStateMap.get(i.userId)<e.createdAt&&s.push(i));})),s},u.prototype.getReadStatus=function(e){var t=this;void 0===e&&(e=!1);var n=__bundle7dfccc8c.St.of(this._iid).sdkState;if(!n.userId||this.isExclusive||this.isSuper||this.isBroadcast)return null;var r={};return this.members.forEach((function(s){if(e||s.userId!==n.userId){var i=t._unreadMemberStateMap.get(s.userId);r[s.userId]=new wt(t._iid,{channel_url:t.url,channel_type:t.channelType,user:It.payloadify(s),ts:i});}})),r},u.prototype.getTypingUsers=function(){var e=[];for(var t in this._typingStatus){var n=this._typingStatus[t].user;e.push(n);}return e},u.prototype.invalidateTypingStatus=function(){var e=__bundle7dfccc8c.St.of(this._iid).typingIndicatorInvalidateTime,t=(new Date).getTime(),n=!1;for(var r in this._typingStatus){t-this._typingStatus[r].ts>=e&&(delete this._typingStatus[r],n=!0);}return n},u.prototype.refresh=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,s,i;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.requestQueue,n=e.dispatcher,r=new Xt({channelUrl:this.url}),[4,t.send(r)];case 1:return s=a.sent(),i=s.as(Zt).channel,n.dispatch(new jt({channels:[i],source:Vt.REQUEST_CHANNEL})),[2,i]}}))}))},u.prototype.freeze=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return [4,o.prototype.freeze.call(this)];case 1:return e.sent(),__bundle7dfccc8c.St.of(this._iid).dispatcher.dispatch(new jt({channels:[this],source:Vt.EVENT_CHANNEL_HIDDEN})),[2]}}))}))},u.prototype.unfreeze=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return [4,o.prototype.unfreeze.call(this)];case 1:return e.sent(),__bundle7dfccc8c.St.of(this._iid).dispatcher.dispatch(new jt({channels:[this],source:Vt.EVENT_CHANNEL_UNHIDDEN})),[2]}}))}))},u.prototype.updateChannel=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,a,o;return __bundle7dfccc8c.i(this,(function(u){switch(u.label){case 0:return e=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},fr),e),__bundle7dfccc8c.at(function(e){return __bundle7dfccc8c.y("string",e.coverUrl,!0)&&(__bundle7dfccc8c.S(e.coverImage)||__bundle7dfccc8c.y("string",e.coverImage)||null===e.coverImage)&&__bundle7dfccc8c.y("boolean",e.isDistinct,!0)&&__bundle7dfccc8c.y("boolean",e.isPublic,!0)&&__bundle7dfccc8c.y("boolean",e.isDiscoverable,!0)&&__bundle7dfccc8c.y("string",e.accessCode,!0)&&__bundle7dfccc8c.y("string",e.name,!0)&&__bundle7dfccc8c.y("string",e.data,!0)&&__bundle7dfccc8c.y("string",e.customType,!0)&&__bundle7dfccc8c.E("string",e.operatorUserIds,!0)&&__bundle7dfccc8c.y("number",e.messageSurvivalSeconds,!0)}(e)).throw(__bundle7dfccc8c.p.invalidParameters),t=__bundle7dfccc8c.St.of(this._iid),n=t.dispatcher,r=t.requestQueue,i=new Cr(__bundle7dfccc8c.n({channelUrl:this.url},e)),[4,r.send(i)];case 1:return a=u.sent(),o=a.as(Nr).channel,n.dispatch(new jt({channels:[o],source:Vt.EVENT_CHANNEL_UPDATED})),[2,o]}}))}))},u.prototype.invite=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){return __bundle7dfccc8c.at(e.every((function(e){return e instanceof __bundle7dfccc8c.ct}))).throw(__bundle7dfccc8c.p.invalidParameters),[2,this.inviteWithUserIds(e.map((function(e){return e.userId})))]}))}))},u.prototype.inviteWithUserIds=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,s,i,a;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.E("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),t=__bundle7dfccc8c.St.of(this._iid),n=t.dispatcher,r=t.requestQueue,s=new Cn({channelUrl:this.url,userIds:e}),[4,r.send(s)];case 1:return i=o.sent(),a=i.as(Nn).channel,n.dispatch(new jt({channels:[a],source:Vt.EVENT_CHANNEL_INVITED})),[2,a]}}))}))},u.prototype.join=function(e){return void 0===e&&(e=null),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,s,i,a,o;return __bundle7dfccc8c.i(this,(function(u){switch(u.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)||null===e).throw(__bundle7dfccc8c.p.invalidParameters),t=__bundle7dfccc8c.St.of(this._iid),n=t.dispatcher,r=t.sdkState,s=t.requestQueue,i=new mn({channelUrl:this.url,userId:r.userId,accessCode:e}),[4,s.send(i)];case 1:return a=u.sent(),(o=a.as(vn).channel).myMemberState=yt.JOINED,n.dispatch(new jt({channels:[o],source:Vt.EVENT_CHANNEL_JOINED})),[2,this]}}))}))},u.prototype.leave=function(e){return void 0===e&&(e=!1),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,s;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return t=__bundle7dfccc8c.St.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new En({channelUrl:this.url,userId:n.userId,shouldRemoveOperatorStatus:e}),[4,r.send(s)];case 1:return i.sent(),[2]}}))}))},u.prototype.acceptInvitation=function(e){return void 0===e&&(e=null),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,s,i,a,o;return __bundle7dfccc8c.i(this,(function(u){switch(u.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)||null===e).throw(__bundle7dfccc8c.p.invalidParameters),t=__bundle7dfccc8c.St.of(this._iid),n=t.dispatcher,r=t.sdkState,s=t.requestQueue,i=new Er({channelUrl:this.url,userId:r.userId,accessCode:e}),[4,s.send(i)];case 1:return a=u.sent(),(o=a.as(yr).channel).myMemberState=yt.JOINED,n.dispatch(new jt({channels:[o],source:Vt.EVENT_CHANNEL_ACCEPTED_INVITE})),[2,o]}}))}))},u.prototype.declineInvitation=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,s,i;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Mn({channelUrl:this.url,userId:t.userId}),[4,n.send(r)];case 1:return s=a.sent(),(i=s.as(Sn).channel).myMemberState=yt.NONE,[2,i]}}))}))},u.prototype.sendUserMessage=function(e){var t=this,n=new __bundle7dfccc8c.In,r=__bundle7dfccc8c.St.of(this._iid).dispatcher,s=__bundle7dfccc8c.pe.of(this._iid);return o.prototype.sendUserMessage.call(this,e).onPending((function(e){s.completeCurrentAndProcessNextAutoResend(e),n._trigger(null,e);})).onFailed((function(e,t){t&&s.completeCurrentAndProcessNextAutoResend(t),n._trigger(e,t);})).onSucceeded((function(e){var i=Bn.of(t._iid);s.completeCurrentAndProcessNextAutoResend(e),t.lastMessage=e,i.handlers.map((function(e){return e.onChannelChanged(t)})),r.dispatch(new jt({channels:[t],source:Vt.EVENT_MESSAGE_SENT})),n._trigger(null,e);})),n},u.prototype._autoResendUserMessage=function(e){var t=this,n=new __bundle7dfccc8c.In,r=__bundle7dfccc8c.St.of(this._iid).dispatcher,s=__bundle7dfccc8c.pe.of(this._iid);return o.prototype._autoResendUserMessage.call(this,e).onPending((function(e){s.completeCurrentAndProcessNextAutoResend(e),n._trigger(null,e);})).onFailed((function(e,t){s.completeCurrentAndProcessNextAutoResend(t),n._trigger(e,t);})).onSucceeded((function(e){var i=Bn.of(t._iid);s.completeCurrentAndProcessNextAutoResend(e),t.lastMessage=e,i.handlers.map((function(e){return e.onChannelChanged(t)})),r.dispatch(new jt({channels:[t],source:Vt.EVENT_MESSAGE_SENT})),n._trigger(null,e);})),n},u.prototype.sendFileMessage=function(e){var t=this,n=new __bundle7dfccc8c.In,r=__bundle7dfccc8c.St.of(this._iid).dispatcher,s=__bundle7dfccc8c.pe.of(this._iid);return o.prototype.sendFileMessage.call(this,e).onPending((function(e){s.completeCurrentAndProcessNextAutoResend(e),n._trigger(null,e);})).onFailed((function(e,t){t&&s.completeCurrentAndProcessNextAutoResend(t),n._trigger(e,t);})).onSucceeded((function(e){var i=Bn.of(t._iid);s.completeCurrentAndProcessNextAutoResend(e),t.lastMessage=e,i.handlers.map((function(e){return e.onChannelChanged(t)})),r.dispatch(new jt({channels:[t],source:Vt.EVENT_MESSAGE_SENT})),n._trigger(null,e);})),n},u.prototype._autoResendFileMessage=function(e){var t=this,n=new __bundle7dfccc8c.In,r=__bundle7dfccc8c.St.of(this._iid).dispatcher,s=__bundle7dfccc8c.pe.of(this._iid);return o.prototype._autoResendFileMessage.call(this,e).onPending((function(e){s.completeCurrentAndProcessNextAutoResend(e),n._trigger(null,e);})).onFailed((function(e,t){s.completeCurrentAndProcessNextAutoResend(t),n._trigger(e,t);})).onSucceeded((function(e){var i=Bn.of(t._iid);s.completeCurrentAndProcessNextAutoResend(e),t.lastMessage=e,i.handlers.map((function(e){return e.onChannelChanged(t)})),r.dispatch(new jt({channels:[t],source:Vt.EVENT_MESSAGE_SENT})),n._trigger(null,e);})),n},u.prototype.deleteMessage=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,o.prototype.deleteMessage.call(this,e)];case 1:return t.sent(),0===e.messageId&&__bundle7dfccc8c.St.of(this._iid).dispatcher.dispatch(new __bundle7dfccc8c.ln({reqId:e.reqId,source:__bundle7dfccc8c.$t.EVENT_MESSAGE_DELETED})),[2]}}))}))},u.prototype.hide=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,a,o,u;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:return e=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},pr),e),__bundle7dfccc8c.at(function(e){return __bundle7dfccc8c.y("boolean",e.hidePreviousMessages)&&__bundle7dfccc8c.y("boolean",e.allowAutoUnhide)}(e)).throw(__bundle7dfccc8c.p.invalidParameters),t=__bundle7dfccc8c.St.of(this._iid),n=t.dispatcher,r=t.sdkState,i=t.requestQueue,a=new Ln(__bundle7dfccc8c.n({channelUrl:this.url,userId:r.userId},e)),[4,i.send(a)];case 1:return o=c.sent(),u=o.as(Rn).messageOffsetTimestamp,this.hiddenState=e.allowAutoUnhide?Fr.HIDDEN_ALLOW_AUTO_UNHIDE:Fr.HIDDEN_PREVENT_AUTO_UNHIDE,e.hidePreviousMessages&&this._updateUnreadCount(0,0),u&&(this.messageOffsetTimestamp=u),n.dispatch(new jt({channels:[this],source:Vt.EVENT_CHANNEL_HIDDEN})),[2,this]}}))}))},u.prototype.unhide=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.dispatcher,n=e.requestQueue,r=new Mr({channelUrl:this.url}),[4,n.send(r)];case 1:return s.sent(),this.hiddenState=Fr.UNHIDDEN,t.dispatch(new jt({channels:[this],source:Vt.EVENT_CHANNEL_UNHIDDEN})),[2,this]}}))}))},u.prototype.delete=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid).requestQueue,t=new br({channelUrl:this.url}),[4,e.send(t)];case 1:return n.sent(),[2]}}))}))},u.prototype.markAsRead=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,s,i,a,o=this;return __bundle7dfccc8c.i(this,(function(u){switch(u.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.dispatcher,r=e.requestQueue,s=new Tn({channelUrl:this.url}),[4,r.send(s)];case 1:return i=u.sent(),a=i.as(Un).readStatus,this._updateUnreadMemberState(t.userId,a.readAt),(this.unreadMessageCount>0||this.unreadMentionCount>0)&&(this._updateUnreadCount(0,0),Bn.of(this._iid).handlers.map((function(e){return e.onChannelChanged(o)}))),n.dispatch(new jt({channels:[this],source:Vt.EVENT_CHANNEL_READ})),[2]}}))}))},u.prototype.markAsDelivered=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new In({channelUrl:this.url,userId:t.userId}),[4,n.send(r)];case 1:return s.sent(),[2]}}))}))},u.prototype.startTyping=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,s;return __bundle7dfccc8c.i(this,(function(i){return e=__bundle7dfccc8c.St.of(this._iid),t=e.requestQueue,n=e.typingIndicatorThrottle,(r=(new Date).getTime())-this._typingStarted>=n&&(this._typingStarted=r,this._typingEnded=0,s=new kn({channelUrl:this.url,time:this._typingStarted}),t.send(s)),[2]}))}))},u.prototype.endTyping=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,s;return __bundle7dfccc8c.i(this,(function(i){return e=__bundle7dfccc8c.St.of(this._iid),t=e.requestQueue,n=e.typingIndicatorThrottle,(r=(new Date).getTime())-this._typingEnded>=n&&(this._typingStarted=0,this._typingEnded=r,s=new Pn({channelUrl:this.url,time:this._typingStarted}),t.send(s)),[2]}))}))},u.prototype.createScheduledUserMessage=function(e){e=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},__bundle7dfccc8c.ne$1),e),__bundle7dfccc8c.at(__bundle7dfccc8c.re(e)).throw(__bundle7dfccc8c.p.invalidParameters);var t=new __bundle7dfccc8c.In;return this._createScheduledUserMessage(e,t),t},u.prototype.updateScheduledUserMessage=function(e,t){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return t=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},wr),t),__bundle7dfccc8c.at(function(e){return __bundle7dfccc8c.Me$1(e)&&__bundle7dfccc8c.y("number",e.scheduledAt,!0)}(t)).throw(__bundle7dfccc8c.p.invalidParameters),n=__bundle7dfccc8c.St.of(this._iid).requestQueue,r=new Rr(__bundle7dfccc8c.n({reqId:this._generateRequestId(),scheduledMessageId:e,channelType:this.channelType,channelUrl:this.url},t)),[4,n.send(r)];case 1:return i=a.sent(),[2,i.as(__bundle7dfccc8c.Rt).message]}}))}))},u.prototype.createScheduledFileMessage=function(e){var t=this;e=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},__bundle7dfccc8c.ae),e),__bundle7dfccc8c.at(__bundle7dfccc8c.ie(e)).throw(__bundle7dfccc8c.p.invalidParameters);var n=__bundle7dfccc8c.St.of(this._iid).dispatcher,r=Date.now(),i=this._generateRequestId(),a=new __bundle7dfccc8c.In;return __bundle7dfccc8c.me$1(__bundle7dfccc8c.Ot$1).then((function(){var s=t._createPendingScheduledFileMessage(e,i,r);n.dispatch(new __bundle7dfccc8c.un({messages:[s],source:__bundle7dfccc8c.$t.EVENT_MESSAGE_SENT_PENDING})),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(t,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return [2,a._trigger(null,s)]}))}))}));})),__bundle7dfccc8c.S(e.file)?this._uploadFileAndUpdateParams(e).then((function(){return t._createScheduledFileMessage(e,a,i,r)})):this._createScheduledFileMessage(e,a,i,r),a},u.prototype.updateScheduledFileMessage=function(e,t){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return t=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},Ir),t),__bundle7dfccc8c.at(function(e){return __bundle7dfccc8c.Ee$2(e)&&__bundle7dfccc8c.y("number",e.scheduledAt,!0)&&(__bundle7dfccc8c.S(e.file)||__bundle7dfccc8c.y("string",e.fileUrl))&&__bundle7dfccc8c.y("string",e.fileName,!0)&&__bundle7dfccc8c.y("string",e.mimeType,!0)&&__bundle7dfccc8c.y("number",e.fileSize,!0)&&(null===e.thumbnailSizes||e.thumbnailSizes.every((function(e){return __bundle7dfccc8c.y("object",e)&&e.maxWidth>0&&e.maxHeight>0})))}(t)).throw(__bundle7dfccc8c.p.invalidParameters),__bundle7dfccc8c.S(t.file)?[4,this._uploadFileAndUpdateParams(t)]:[3,2];case 1:i.sent(),i.label=2;case 2:return n=new Dr(__bundle7dfccc8c.n(__bundle7dfccc8c.n({reqId:this._generateRequestId(),scheduledMessageId:e,channelType:this.channelType,channelUrl:this.url},t),{fileUrl:t.fileUrl,requireAuth:t.requireAuth})),[4,__bundle7dfccc8c.St.of(this._iid).requestQueue.send(n)];case 3:return r=i.sent(),[2,r.as(Lr).message]}}))}))},u.prototype.cancelScheduledMessage=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return t=new Pr({scheduledMessageId:e,channelType:this.channelType,channelUrl:this.url}),[4,__bundle7dfccc8c.St.of(this._iid).requestQueue.send(t)];case 1:return n.sent(),[2]}}))}))},u.prototype.sendScheduledMessageNow=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return t=new xr({scheduledMessageId:e,channelType:this.channelType,channelUrl:this.url}),[4,__bundle7dfccc8c.St.of(this._iid).requestQueue.send(t)];case 1:return n.sent(),[2]}}))}))},u.prototype.getMyPushTriggerOption=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,s;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new __bundle7dfccc8c._e({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,s.as(__bundle7dfccc8c.Ee).pushTriggerOption]}}))}))},u.prototype.setMyPushTriggerOption=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,s,i,a;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.m(__bundle7dfccc8c.H,e)).throw(__bundle7dfccc8c.p.invalidParameters),n=__bundle7dfccc8c.St.of(this._iid),r=n.sdkState,s=n.requestQueue,i=new __bundle7dfccc8c.Ae({userId:r.userId,pushTriggerOption:e}),[4,s.send(i)];case 1:return a=o.sent(),[2,a.as(__bundle7dfccc8c.ye).pushTriggerOption]}}))}))},u.prototype.setMyCountPreference=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,s,i,a,o,u;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.m(Or,e)).throw(__bundle7dfccc8c.p.invalidParameters),n=__bundle7dfccc8c.St.of(this._iid),r=n.dispatcher,s=n.sdkState,i=n.requestQueue,a=new Sr({channelUrl:this.url,userId:s.userId,countPreference:e}),[4,i.send(a)];case 1:return o=c.sent(),u=o.as(Ar).countPreference,this.myCountPreference=u,this._updateUnreadCount(this.unreadMessageCount,this.unreadMentionCount),r.dispatch(new jt({channels:[this],source:Vt.EVENT_CHANNEL_CREATED})),[2,u]}}))}))},u.prototype.resetMyHistory=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,s,i;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.dispatcher,n=e.requestQueue,r=new Tr({channelUrl:this.url}),[4,n.send(r)];case 1:return s=a.sent(),i=s.as(Ur).messageOffsetTimestamp,this.messageOffsetTimestamp=i,t.dispatch(new jt({channels:[this],source:Vt.EVENT_CHANNEL_RESET_HISTORY})),[2,this]}}))}))},u.prototype._uploadFileAndUpdateParams=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,s,i,a,o,u,c,l,h;return __bundle7dfccc8c.i(this,(function(d){switch(d.label){case 0:return __bundle7dfccc8c.S(e.file)?(t=__bundle7dfccc8c.St.of(this._iid).requestQueue,n=new __bundle7dfccc8c.bt({file:e.file,channelUrl:this.url,thumbnailSizes:e.thumbnailSizes,requestId:this._generateRequestId()}),[4,t.send(n)]):[3,2];case 1:r=d.sent(),s=r.as(__bundle7dfccc8c.Nt),i=s.url,a=s.fileSize,o=void 0===a?e.fileSize:a,u=s.thumbnailSizes,c=void 0===u?e.thumbnailSizes:u,l=s.requireAuth,h=void 0!==l&&l,e.fileUrl=i,e.fileSize=o,e.thumbnailSizes=c,e.requireAuth=h,d.label=2;case 2:return [2]}}))}))},u}(__bundle7dfccc8c.kt),Gr={},qr=function(){function e(e){var t=e._iid,n=this;this._sync=null,this._metadata=null,this._iid=t;var r,s=__bundle7dfccc8c.St.of(this._iid),i=s.sdkState,a=s.logger;this._metadataKey=(r=i.userId,"sendbird:".concat(r,"@groupchannel/sync.meta"));var o=function(e){return "sendbird:".concat(e,"@groupchannel/sync")}(i.userId);this._sync=new Yn(o,(function(){return __bundle7dfccc8c.r(n,void 0,void 0,(function(){var e,t,n,r,s,i;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:return e={hasNext:!0,nextToken:""},[4,this.loadMetadata()];case 1:if(o.sent(),a.debug("channel background sync from",this._metadata.token),this._metadata.completed)return [3,9];o.label=2;case 2:return o.trys.push([2,5,,8]),[4,Bn.of(this._iid).getMyGroupChannels(this._metadata.token,{includeEmpty:!0,order:__bundle7dfccc8c.K.CHRONOLOGICAL},100,Vt.SYNC_CHANNEL_BACKGROUND)];case 3:return t=o.sent(),n=t.channels,r=t.token,e.hasNext=n.length>=100&&!!r,e.nextToken=r,this._metadata.token=r,(i=this._metadata.range).extends.apply(i,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(n.map((function(e){return e.createdAt}))),!1)),this._metadata.completed=!e.hasNext,a.debug("channel background sync progress",e),[4,this.saveMetadata()];case 4:return o.sent(),[3,8];case 5:return (s=o.sent())instanceof __bundle7dfccc8c.p&&s.isInvalidTokenError?[4,this.clearMetaData()]:[3,7];case 6:o.sent(),o.label=7;case 7:return e.hasNext=!1,e.nextToken="",[3,8];case 8:return [3,10];case 9:e.hasNext=!1,e.nextToken="",o.label=10;case 10:return [2,e]}}))}))}));}return e.of=function(t){if(!Gr[t]){var n=Gr[t]=new e({_iid:t});__bundle7dfccc8c.St.of(t).dispatcher.on((function(e){if(e instanceof __bundle7dfccc8c.de)if(e.stateType===__bundle7dfccc8c.J$1.CONNECTED)n.resume();else n.pause();}));}return Gr[t]},Object.defineProperty(e.prototype,"range",{get:function(){var e;return null===(e=this._metadata)||void 0===e?void 0:e.range},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"completed",{get:function(){var e;return !!(null===(e=this._metadata)||void 0===e?void 0:e.completed)},enumerable:!1,configurable:!0}),e.prototype.loadMetadata=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return this._metadata?[3,2]:[4,__bundle7dfccc8c.St.of(this._iid).cacheContext.preference.get(this._metadataKey)];case 1:e=t.sent(),this._metadata={token:e?e.token:"",range:new Gn(e?e.range:{top:Number.MAX_SAFE_INTEGER,bottom:0}),completed:!!e&&e.completed},t.label=2;case 2:return [2]}}))}))},e.prototype.saveMetadata=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return this._metadata?[4,__bundle7dfccc8c.St.of(this._iid).cacheContext.preference.set(this._metadataKey,this._metadata)]:[3,2];case 1:e.sent(),e.label=2;case 2:return [2]}}))}))},e.prototype.clearMetaData=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return [4,__bundle7dfccc8c.St.of(this._iid).cacheContext.preference.remove(this._metadataKey)];case 1:return e.sent(),[2]}}))}))},e.prototype.resume=function(){var e,t;__bundle7dfccc8c.St.of(this._iid).logger.debug("channel background sync resume()"),this._sync.start(null!==(t=null===(e=this._metadata)||void 0===e?void 0:e.token)&&void 0!==t?t:"");},e.prototype.pause=function(){__bundle7dfccc8c.St.of(this._iid).logger.debug("channel background sync stop()"),this._sync.stop();},e}(),Br={},Kr=function(){function e(e){var t=e._iid,n=this;this._sync=null,this._metadataKey=null,this._metadata=null,this._iid=t;var r,s=__bundle7dfccc8c.St.of(this._iid).sdkState;this._metadataKey=(r=s.userId,"sendbird:".concat(r,"@groupchannel/changelogs.meta"));var i=function(e){return "sendbird:".concat(e,"@groupchannel/changelogs")}(s.userId);this._sync=new Yn(i,(function(){return __bundle7dfccc8c.r(n,void 0,void 0,(function(){var e,t,n,r,s;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return e={hasNext:!0,nextToken:0},[4,this.loadMetadata()];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,5,,8]),[4,Bn.of(this._iid).getMyGroupChannelChangeLogs(this._metadata.token,{},Vt.SYNC_CHANNEL_CHANGELOGS)];case 3:return t=i.sent(),n=t.hasMore,r=t.token,e.hasNext=n,e.nextToken=r,this._metadata.token=r,[4,this.saveMetadata()];case 4:return i.sent(),[3,8];case 5:return (s=i.sent())instanceof __bundle7dfccc8c.p&&s.isInvalidTokenError?[4,this.clearMetadata()]:[3,7];case 6:i.sent(),i.label=7;case 7:return e.hasNext=!1,e.nextToken="",[3,8];case 8:return [2,e]}}))}))}));}return e.of=function(t){if(!Br[t]){var n=Br[t]=new e({_iid:t});__bundle7dfccc8c.St.of(t).dispatcher.on((function(e){if(e instanceof __bundle7dfccc8c.de)if(e.stateType===__bundle7dfccc8c.J$1.CONNECTED)n.resume();else n.pause();}));}return Br[t]},e.prototype.loadMetadata=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return this._metadata?[3,2]:(e=__bundle7dfccc8c.St.of(this._iid),t=e.cacheContext,n=e.firstConnectedAt,[4,t.preference.get(this._metadataKey)]);case 1:r=s.sent(),this._metadata={token:r?r.token:n/1e3},s.label=2;case 2:return [2]}}))}))},e.prototype.saveMetadata=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return this._metadata?[4,__bundle7dfccc8c.St.of(this._iid).cacheContext.preference.set(this._metadataKey,this._metadata)]:[3,2];case 1:e.sent(),e.label=2;case 2:return [2]}}))}))},e.prototype.clearMetadata=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return __bundle7dfccc8c.St.of(this._iid).cacheContext.preference.remove(this._metadataKey),[2]}))}))},e.prototype.resume=function(){this._sync.start(0);},e.prototype.pause=function(){this._sync.stop();},e}(),jr=function(){function e(e,t){var n=t.filter,r=t.order,s=t.limit,i=this;this.channels=[],this._iid=e,this._key="gcc-".concat(__bundle7dfccc8c.R()),this.filter=null!=n?n:new Lt,this.order=null!=r?r:__bundle7dfccc8c.K.LATEST_LAST_MESSAGE,this._hasMore=!0,this._token="",this._limit=null!=s?s:__bundle7dfccc8c.j$1;var a=__bundle7dfccc8c.St.of(this._iid),o=a.sdkState;a.cacheContext.localCacheEnabled&&qr.of(e).resume(),Kr.of(e).resume(),Bn.of(this._iid).subscribeGroupChannelEvent(this._key,{onUpdate:function(e,t){var n=e.filter((function(e){return i.filter.match(e,o.userId)})),r=e.filter((function(e){return !i.filter.match(e,o.userId)})).map((function(e){return e.url}));n.length>0&&i._addChannelsToView(n,t),r.length>0&&i._removeChannelsFromView(r,t);},onRemove:function(e,t){i._removeChannelsFromView(e,t);}});}return Object.defineProperty(e.prototype,"hasMore",{get:function(){return this._hasMore},enumerable:!1,configurable:!0}),e.prototype.setGroupChannelCollectionHandler=function(e){this._handler=e;},e.prototype._addChannelsToView=function(e,t,n){var r,s,i=this;void 0===n&&(n=!1);var a=[],o=[];try{for(var u=__bundle7dfccc8c.s(e),c=u.next();!c.done;c=u.next()){var l=c.value,h=ir(this.channels,l,this.order),p=h.place;if(h.contains)switch(o.push(l),t){case Vt.EVENT_CHANNEL_UPDATED:case Vt.EVENT_MESSAGE_RECEIVED:this.channels.splice(p,1);var m=ir(this.channels,l,this.order).place;this.channels.splice(m,0,l);break;default:this.channels[p]=l;}else if(p===this.channels.length){var v=qr.of(this._iid);(n||v.completed)&&(a.push(l),this.channels.push(l));}else a.push(l),this.channels.splice(p,0,l);}}catch(e){r={error:e};}finally{try{c&&!c.done&&(s=u.return)&&s.call(u);}finally{if(r)throw r.error}}Kt(t)&&__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(i,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(n){return e=new Jn(t),a.length>0&&this._handler.onChannelsAdded(e,a),o.length>0&&this._handler.onChannelsUpdated(e,o),[2]}))}))}));},e.prototype._removeChannelsFromView=function(e,t){var n,r,s=this,i=[],a=function(e){var t=o.channels.findIndex((function(t){return t.url===e}));t>=0&&(i.push(o.channels[t].url),o.channels.splice(t,1));},o=this;try{for(var u=__bundle7dfccc8c.s(e),c=u.next();!c.done;c=u.next()){a(c.value);}}catch(e){n={error:e};}finally{try{c&&!c.done&&(r=u.return)&&r.call(u);}finally{if(n)throw n.error}}return Kt(t)&&i.length>0&&__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(s,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(n){return e=new Jn(t),this._handler.onChannelsDeleted(e,i),[2]}))}))})),i},e.prototype._getLocalChannels=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return [4,Bn.of(this._iid).getChannelsFromCache(this._token,this.filter,this.order)];case 1:return [2,e.sent()]}}))}))},e.prototype._getRemoteChannels=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return [4,Bn.of(this._iid).getMyGroupChannels(this._token,__bundle7dfccc8c.n(__bundle7dfccc8c.n({},this.filter),{order:this.order}),this._limit)];case 1:return e=r.sent(),t=e.channels,n=e.token,this._token=n,[2,t]}}))}))},e.prototype.loadMore=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t=this;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return this._hasMore?(e=[],[4,__bundle7dfccc8c.Se((function(){return __bundle7dfccc8c.r(t,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,this._getLocalChannels()];case 1:return e=t.sent(),[2]}}))}))}))]):[3,3];case 1:return n.sent(),[4,__bundle7dfccc8c.Se((function(){return __bundle7dfccc8c.r(t,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,this._getRemoteChannels()];case 1:return e=t.sent(),[2]}}))}))}))];case 2:return n.sent(),this._addChannelsToView(e,Vt.REQUEST_CHANNEL,!0),[2,e];case 3:return [2,[]]}}))}))},e.prototype.dispose=function(){Bn.of(this._iid).unsubscribeGroupChannelEvent(this._key);},e}(),zr=function(t){function n(e){var n=this,s=e.token,i=e.limit,a=e.order,o=e.includeEmpty,u=e.membershipFilter,c=e.channelNameContainsFilter,l=e.channelUrlsFilter,h=e.customTypesFilter,d=e.customTypeStartsWithFilter,_=e.superChannelFilter,f=e.metadataOrderKeyFilter,p=e.metadataKey,m=e.metadataValues,v=e.metadataValueStartsWith,g=e.includeFrozen,E=e.includeMetaData;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.GET,n.path=__bundle7dfccc8c.qe,n.params=__bundle7dfccc8c.U({token:s,limit:i,order:a,show_member:!0,show_read_receipt:!0,show_delivery_receipt:!0,show_empty:o,public_mode:Ct.PUBLIC,public_membership_mode:u,name_contains:c,channel_urls:l,custom_types:h,custom_type_startswith:d,super_mode:_,metadata_order_key:f,metadata_key:p,metadata_values:m,metadata_value_startswith:v,show_frozen:g,show_metadata:E}),n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),Qr=function(t){function n(e,n){var r=t.call(this,e,n)||this;r.token=null,r.channels=[],r.ts=null;var s=n.next,i=n.channels,a=n.ts;return r.token=s,i&&i.length>0&&(r.channels=i.map((function(t){return t.ts=a,new Vr(e,t)}))),r.ts="number"==typeof a?a:null,r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F);!function(e){e.ALL="all",e.JOINED="joined";}(Hr||(Hr={}));var Wr=function(n){function r(e,t){var r,s,i,a,o,u,c,l,h,d,_,f,p,m,v=this;return (v=n.call(this,e,t)||this).includeEmpty=!1,v.includeFrozen=!0,v.includeMetaData=!0,v.channelUrlsFilter=null,v.customTypesFilter=null,v.customTypeStartsWithFilter=null,v.nicknameContainsFilter=null,v.channelNameContainsFilter=null,v.membershipFilter=Hr.ALL,v.superChannelFilter=bt.ALL,v.metadataKey=null,v.metadataValues=null,v.metadataOrderKeyFilter=null,v.metadataValueStartsWith=null,v.order=__bundle7dfccc8c.G.CHRONOLOGICAL,v.includeEmpty=null!==(r=t.includeEmpty)&&void 0!==r&&r,v.includeFrozen=null===(s=t.includeFrozen)||void 0===s||s,v.includeMetaData=null===(i=t.includeMetaData)||void 0===i||i,v.channelUrlsFilter=null!==(a=t.channelUrlsFilter)&&void 0!==a?a:null,v.customTypesFilter=null!==(o=t.customTypesFilter)&&void 0!==o?o:null,v.customTypeStartsWithFilter=null!==(u=t.customTypeStartsWithFilter)&&void 0!==u?u:null,v.channelNameContainsFilter=null!==(c=t.channelNameContainsFilter)&&void 0!==c?c:null,v.membershipFilter=null!==(l=t.membershipFilter)&&void 0!==l?l:Hr.ALL,v.superChannelFilter=null!==(h=t.superChannelFilter)&&void 0!==h?h:bt.ALL,v.metadataKey=null!==(d=t.metadataKey)&&void 0!==d?d:null,v.metadataValues=null!==(_=t.metadataValues)&&void 0!==_?_:null,v.metadataOrderKeyFilter=null!==(f=t.metadataOrderKeyFilter)&&void 0!==f?f:null,v.metadataValueStartsWith=null!==(p=t.metadataValueStartsWith)&&void 0!==p?p:null,v.order=null!==(m=t.order)&&void 0!==m?m:__bundle7dfccc8c.G.CHRONOLOGICAL,v}return __bundle7dfccc8c.t(r,n),r.prototype._validate=function(){return n.prototype._validate.call(this)&&__bundle7dfccc8c.y("boolean",this.includeEmpty)&&__bundle7dfccc8c.y("boolean",this.includeFrozen)&&__bundle7dfccc8c.y("boolean",this.includeMetaData)&&__bundle7dfccc8c.y("string",this.channelNameContainsFilter,!0)&&__bundle7dfccc8c.E("string",this.channelUrlsFilter,!0)&&__bundle7dfccc8c.E("string",this.customTypesFilter,!0)&&__bundle7dfccc8c.y("string",this.customTypeStartsWithFilter,!0)&&__bundle7dfccc8c.m(Hr,this.membershipFilter)&&__bundle7dfccc8c.m(bt,this.superChannelFilter)&&__bundle7dfccc8c.m(__bundle7dfccc8c.G,this.order)&&__bundle7dfccc8c.y("string",this.metadataOrderKeyFilter,!0)&&__bundle7dfccc8c.y("string",this.metadataKey,!0)&&__bundle7dfccc8c.E("string",this.metadataValues,!0)&&__bundle7dfccc8c.y("string",this.metadataValueStartsWith,!0)},r.prototype.next=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i,a,o,u,c;return __bundle7dfccc8c.i(this,(function(l){switch(l.label){case 0:return this._validate()?this._isLoading?[3,3]:(e=[],this._hasNext?(this._isLoading=!0,t=__bundle7dfccc8c.St.of(this._iid),n=t.requestQueue,r=t.dispatcher,i=new zr(__bundle7dfccc8c.n(__bundle7dfccc8c.n({},this),{token:this._token})),[4,n.send(i)]):[3,2]):[3,5];case 1:return a=l.sent(),o=a.as(Qr),u=o.channels,c=o.token,this._token=c,this._hasNext=!!c,r.dispatch(new jt({channels:u,source:Vt.REQUEST_CHANNEL})),this._isLoading=!1,[2,u];case 2:return [2,e];case 3:throw __bundle7dfccc8c.p.queryInProgress;case 4:return [3,6];case 5:throw __bundle7dfccc8c.p.invalidParameters;case 6:return [2]}}))}))},r}(__bundle7dfccc8c.bn),Yr=function(t){function n(e){void 0===e&&(e={});var n=t.call(this)||this;return Object.keys(e).forEach((function(t){n.hasOwnProperty(t)&&(n[t]=e[t]);})),n}return __bundle7dfccc8c.t(n,t),n}(function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.onUserJoined=__bundle7dfccc8c.Y,e.onUserLeft=__bundle7dfccc8c.Y,e.onUserReceivedInvitation=__bundle7dfccc8c.Y,e.onUserDeclinedInvitation=__bundle7dfccc8c.Y,e.onChannelHidden=__bundle7dfccc8c.Y,e.onUnreadMemberStatusUpdated=__bundle7dfccc8c.Y,e.onUndeliveredMemberStatusUpdated=__bundle7dfccc8c.Y,e.onTypingStatusUpdated=__bundle7dfccc8c.Y,e}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.U$1)),Jr=function(t){function n(e){var n=this,s=e.token,i=e.limit,a=e.order,o=e.reverse,u=e.channelUrl,c=e.messageTypeFilter,l=e.scheduledStatus;return (n=t.call(this)||this).method=__bundle7dfccc8c.d.GET,n.path="".concat(__bundle7dfccc8c.Ve),n.params=__bundle7dfccc8c.U({limit:i,reverse:o,channel_url:u,order:a,status:l}),s&&(n.params.token=s),c&&(n.params.message_type_filter=c),n}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.q),Xr=function(t){function n(e,n){var r=t.call(this,e,n)||this;r.token=null,r.scheduledMessages=[];var s=n.next,i=n.scheduled_messages;return r.token=s,r.scheduledMessages=i.map((function(t){return __bundle7dfccc8c.Ht(e,t)})),r}return __bundle7dfccc8c.t(n,t),n}(__bundle7dfccc8c.F),Zr=function(n){function r(e,t){var r,s,i,a,o,u=this;return (u=n.call(this,e,t)||this).channelUrl=null,u.order=null,u.reverse=!1,u.scheduledStatus=null,u.messageTypeFilter=__bundle7dfccc8c.se$1.ALL,u.channelUrl=null!==(r=t.channelUrl)&&void 0!==r?r:null,u.order=null!==(s=t.order)&&void 0!==s?s:null,u.reverse=null!==(i=t.reverse)&&void 0!==i&&i,u.scheduledStatus=null!==(a=t.scheduledStatus)&&void 0!==a?a:null,u.messageTypeFilter=null!==(o=t.messageTypeFilter)&&void 0!==o?o:__bundle7dfccc8c.se$1.ALL,u}return __bundle7dfccc8c.t(r,n),r.prototype._validate=function(){return n.prototype._validate.call(this)&&__bundle7dfccc8c.y("string",this.channelUrl,!0)&&(__bundle7dfccc8c.m(__bundle7dfccc8c.Q,this.order)||null===this.order)&&__bundle7dfccc8c.y("boolean",this.reverse)&&(__bundle7dfccc8c.E(__bundle7dfccc8c.Ct,this.scheduledStatus)||null===this.scheduledStatus)&&__bundle7dfccc8c.m(__bundle7dfccc8c.se$1,this.messageTypeFilter)},r.prototype.next=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i,a;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,e=__bundle7dfccc8c.St.of(this._iid).requestQueue,t=new Jr(__bundle7dfccc8c.n(__bundle7dfccc8c.n({},this),{token:this._token})),[4,e.send(t)]):[3,2]:[3,5];case 1:return n=o.sent(),r=n.as(Xr),i=r.scheduledMessages,a=r.token,this._token=a,this._hasNext=!!a,this._isLoading=!1,[2,i];case 2:return [2,[]];case 3:throw __bundle7dfccc8c.p.queryInProgress;case 4:return [3,6];case 5:throw __bundle7dfccc8c.p.invalidParameters;case 6:return [2]}}))}))},r}(__bundle7dfccc8c.bn),$r=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="groupChannel",e}return __bundle7dfccc8c.t(n,t),n.prototype.init=function(e,n){var r=n.sdkState,s=n.dispatcher,i=n.sessionManager,a=n.requestQueue,o=n.logger,u=n.onlineDetector,c=n.cacheContext;t.prototype.init.call(this,e,{sdkState:r,dispatcher:s,sessionManager:i,requestQueue:a,logger:o,onlineDetector:u,cacheContext:c}),this._manager=new Bn(e,{sdkState:r,cacheContext:c,dispatcher:s,sessionManager:i,requestQueue:a,logger:o});},n.prototype.createGroupChannelCollection=function(e){return void 0===e&&(e={}),new jr(this._iid,e)},n.prototype.createMyGroupChannelListQuery=function(e){return void 0===e&&(e={}),new Vn(this._iid,e)},n.prototype.createPublicGroupChannelListQuery=function(e){return void 0===e&&(e={}),new Wr(this._iid,e)},n.prototype.createScheduledMessageListQuery=function(e){return void 0===e&&(e={}),new Zr(this._iid,e)},n.prototype.addGroupChannelHandler=function(e,t){__bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)&&t instanceof Yr).throw(__bundle7dfccc8c.p.invalidParameters),this._manager.addHandler(e,t);},n.prototype.removeGroupChannelHandler=function(e){__bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),this._manager.removeHandler(e);},n.prototype.removeAllGroupChannelHandlers=function(){this._manager.clearHandler();},n.prototype.buildGroupChannelFromSerializedData=function(e){return this._manager.buildGroupChannelFromSerializedData(e)},n.prototype.buildGroupChannelListQueryFromSerializedData=function(e){return this._manager.buildGroupChannelListQueryFromSerializedData(e)},n.prototype.buildMemberFromSerializedData=function(e){return this._manager.buildMemberFromSerializedData(e)},n.prototype.getChannel=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){return __bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),[2,this._manager.getChannel(e)]}))}))},n.prototype.getChannelWithoutCache=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){return __bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),[2,this._manager.getChannelWithoutCache(e)]}))}))},n.prototype.getMyGroupChannelChangeLogsByToken=function(e,t){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return t=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},Ft),t),__bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)&&Pt(t)).throw(__bundle7dfccc8c.p.invalidParameters),[4,this._manager.getMyGroupChannelChangeLogs(e,t)];case 1:return [2,n.sent()]}}))}))},n.prototype.getMyGroupChannelChangeLogsByTimestamp=function(e,t){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return t=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},Ft),t),__bundle7dfccc8c.at(__bundle7dfccc8c.y("number",e)&&Pt(t)).throw(__bundle7dfccc8c.p.invalidParameters),[4,this._manager.getMyGroupChannelChangeLogs(e,t)];case 1:return [2,n.sent()]}}))}))},n.prototype.getGroupChannelCount=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){return e=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},xt),e),__bundle7dfccc8c.at(Ht(e)).throw(__bundle7dfccc8c.p.invalidParameters),[2,this._manager.getGroupChannelCount(e)]}))}))},n.prototype.getUnreadItemCount=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,this._manager.getUnreadItemCount(e)];case 1:return [2,t.sent()]}}))}))},n.prototype.getTotalUnreadChannelCount=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return [4,this._manager.getTotalUnreadChannelCount()];case 1:return [2,e.sent()]}}))}))},n.prototype.getTotalUnreadMessageCount=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,this._manager.getTotalUnreadMessageCount(e)];case 1:return [2,t.sent()]}}))}))},n.prototype.getTotalScheduledMessageCount=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,this._manager.getTotalScheduledMessageCount(e)];case 1:return [2,t.sent()]}}))}))},n.prototype.getSubscribedTotalUnreadMessageCount=function(){return this._manager.getSubscribedTotalUnreadMessageCount()},n.prototype.getSubscribedCustomTypeTotalUnreadMessageCount=function(){return this._manager.getSubscribedCustomTypeTotalUnreadMessageCount()},n.prototype.getSubscribedCustomTypeUnreadMessageCount=function(e){return this._manager.getSubscribedCustomTypeUnreadMessageCount(e)},n.prototype.createChannel=function(e){return void 0===e&&(e={}),__bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){return e=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},Ot),e),__bundle7dfccc8c.at(kt(e)).throw(__bundle7dfccc8c.p.invalidParameters),[2,this._manager.createChannel(e)]}))}))},n.prototype.createDistinctChannelIfNotExist=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){return e=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},Ot),e),__bundle7dfccc8c.at(kt(e)).throw(__bundle7dfccc8c.p.invalidParameters),e&&(e.isDistinct=!0),[2,this.createChannel(e)]}))}))},n.prototype.createChannelWithUserIds=function(e,t,n,r,i,a){return void 0===t&&(t=!1),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=""),void 0===a&&(a=""),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var o;return __bundle7dfccc8c.i(this,(function(u){return o=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},Ot),{invitedUserIds:e,isDistinct:t,name:n,data:i,customType:a}),"string"==typeof r?o.coverUrl=r:o.coverImage=r,[2,this.createChannel(o)]}))}))},n.prototype.markAsReadAll=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._manager.markAsReadAll(),[2]}))}))},n.prototype.markAsReadWithChannelUrls=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){return __bundle7dfccc8c.at(__bundle7dfccc8c.E("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),this._manager.markAsReadWithChannelUrls(e),[2]}))}))},n.prototype.markAsDelivered=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),[4,this.getChannel(e)];case 1:return [4,t.sent().markAsDelivered()];case 2:return t.sent(),[2]}}))}))},n}(__bundle7dfccc8c.Tt);
6
+
7
+ exports.$r = $r;
8
+ exports.Yr = Yr;
9
+ //# sourceMappingURL=groupChannel-fab057aa.js.map