@syra.fm/sdk 0.4.0 → 0.6.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 (317) hide show
  1. package/README.md +33 -4
  2. package/lib/commonjs/client.js +268 -0
  3. package/lib/commonjs/client.js.map +1 -0
  4. package/lib/commonjs/errors.js +22 -0
  5. package/lib/commonjs/errors.js.map +1 -0
  6. package/lib/commonjs/index.js +63 -0
  7. package/lib/commonjs/index.js.map +1 -0
  8. package/lib/commonjs/index.native.js +28 -0
  9. package/lib/commonjs/index.native.js.map +1 -0
  10. package/lib/commonjs/live/assets/icons/spaces-icon.js +42 -0
  11. package/lib/commonjs/live/assets/icons/spaces-icon.js.map +1 -0
  12. package/lib/commonjs/live/assets/icons/syra-icon.js +43 -0
  13. package/lib/commonjs/live/assets/icons/syra-icon.js.map +1 -0
  14. package/lib/commonjs/live/colors.js +54 -0
  15. package/lib/commonjs/live/colors.js.map +1 -0
  16. package/lib/commonjs/live/components/AnimatedPulse.js +38 -0
  17. package/lib/commonjs/live/components/AnimatedPulse.js.map +1 -0
  18. package/lib/commonjs/live/components/AnimatedSpeakerRing.js +90 -0
  19. package/lib/commonjs/live/components/AnimatedSpeakerRing.js.map +1 -0
  20. package/lib/commonjs/live/components/CreateRoomSheet.js +688 -0
  21. package/lib/commonjs/live/components/CreateRoomSheet.js.map +1 -0
  22. package/lib/commonjs/live/components/InsightsPanel.js +333 -0
  23. package/lib/commonjs/live/components/InsightsPanel.js.map +1 -0
  24. package/lib/commonjs/live/components/LiveRoomSheet.js +1196 -0
  25. package/lib/commonjs/live/components/LiveRoomSheet.js.map +1 -0
  26. package/lib/commonjs/live/components/MiniRoomBar.js +162 -0
  27. package/lib/commonjs/live/components/MiniRoomBar.js.map +1 -0
  28. package/lib/commonjs/live/components/PanelHeader.js +57 -0
  29. package/lib/commonjs/live/components/PanelHeader.js.map +1 -0
  30. package/lib/commonjs/live/components/PodcastStreamPicker.js +1190 -0
  31. package/lib/commonjs/live/components/PodcastStreamPicker.js.map +1 -0
  32. package/lib/commonjs/live/components/RecordingCard.js +192 -0
  33. package/lib/commonjs/live/components/RecordingCard.js.map +1 -0
  34. package/lib/commonjs/live/components/RecordingsPanel.js +305 -0
  35. package/lib/commonjs/live/components/RecordingsPanel.js.map +1 -0
  36. package/lib/commonjs/live/components/RoomCard.js +349 -0
  37. package/lib/commonjs/live/components/RoomCard.js.map +1 -0
  38. package/lib/commonjs/live/components/StreamConfigModal.js +656 -0
  39. package/lib/commonjs/live/components/StreamConfigModal.js.map +1 -0
  40. package/lib/commonjs/live/components/StreamConfigPanel.js +822 -0
  41. package/lib/commonjs/live/components/StreamConfigPanel.js.map +1 -0
  42. package/lib/commonjs/live/context/LiveConfigContext.js +46 -0
  43. package/lib/commonjs/live/context/LiveConfigContext.js.map +1 -0
  44. package/lib/commonjs/live/context/LiveRoomContext.js +195 -0
  45. package/lib/commonjs/live/context/LiveRoomContext.js.map +1 -0
  46. package/lib/commonjs/live/hooks/useActiveSpeakers.js +35 -0
  47. package/lib/commonjs/live/hooks/useActiveSpeakers.js.map +1 -0
  48. package/lib/commonjs/live/hooks/useRoomAudio.js +129 -0
  49. package/lib/commonjs/live/hooks/useRoomAudio.js.map +1 -0
  50. package/lib/commonjs/live/hooks/useRoomConnection.js +177 -0
  51. package/lib/commonjs/live/hooks/useRoomConnection.js.map +1 -0
  52. package/lib/commonjs/live/hooks/useRoomManager.js +37 -0
  53. package/lib/commonjs/live/hooks/useRoomManager.js.map +1 -0
  54. package/lib/commonjs/live/hooks/useRoomUsers.js +52 -0
  55. package/lib/commonjs/live/hooks/useRoomUsers.js.map +1 -0
  56. package/lib/commonjs/live/index.js +341 -0
  57. package/lib/commonjs/live/index.js.map +1 -0
  58. package/lib/commonjs/live/services/livekitService.js +20 -0
  59. package/lib/commonjs/live/services/livekitService.js.map +1 -0
  60. package/lib/commonjs/live/services/spaceSocketService.js +181 -0
  61. package/lib/commonjs/live/services/spaceSocketService.js.map +1 -0
  62. package/lib/commonjs/live/services/spacesService.js +642 -0
  63. package/lib/commonjs/live/services/spacesService.js.map +1 -0
  64. package/lib/commonjs/live/types.js +6 -0
  65. package/lib/commonjs/live/types.js.map +1 -0
  66. package/lib/commonjs/live/validation.js +238 -0
  67. package/lib/commonjs/live/validation.js.map +1 -0
  68. package/lib/commonjs/package.json +1 -0
  69. package/{dist/cjs → lib/commonjs}/schema.js +55 -47
  70. package/lib/commonjs/schema.js.map +1 -0
  71. package/lib/module/client.js +264 -0
  72. package/lib/module/client.js.map +1 -0
  73. package/lib/module/errors.js +17 -0
  74. package/lib/module/errors.js.map +1 -0
  75. package/lib/module/index.js +6 -0
  76. package/lib/module/index.js.map +1 -0
  77. package/lib/module/index.native.js +5 -0
  78. package/lib/module/index.native.js.map +1 -0
  79. package/lib/module/live/assets/icons/spaces-icon.js +34 -0
  80. package/lib/module/live/assets/icons/spaces-icon.js.map +1 -0
  81. package/lib/module/live/assets/icons/syra-icon.js +36 -0
  82. package/lib/module/live/assets/icons/syra-icon.js.map +1 -0
  83. package/lib/module/live/colors.js +49 -0
  84. package/lib/module/live/colors.js.map +1 -0
  85. package/lib/module/live/components/AnimatedPulse.js +33 -0
  86. package/lib/module/live/components/AnimatedPulse.js.map +1 -0
  87. package/lib/module/live/components/AnimatedSpeakerRing.js +85 -0
  88. package/lib/module/live/components/AnimatedSpeakerRing.js.map +1 -0
  89. package/lib/module/live/components/CreateRoomSheet.js +682 -0
  90. package/lib/module/live/components/CreateRoomSheet.js.map +1 -0
  91. package/lib/module/live/components/InsightsPanel.js +327 -0
  92. package/lib/module/live/components/InsightsPanel.js.map +1 -0
  93. package/lib/module/live/components/LiveRoomSheet.js +1190 -0
  94. package/lib/module/live/components/LiveRoomSheet.js.map +1 -0
  95. package/lib/module/live/components/MiniRoomBar.js +155 -0
  96. package/lib/module/live/components/MiniRoomBar.js.map +1 -0
  97. package/lib/module/live/components/PanelHeader.js +52 -0
  98. package/lib/module/live/components/PanelHeader.js.map +1 -0
  99. package/lib/module/live/components/PodcastStreamPicker.js +1183 -0
  100. package/lib/module/live/components/PodcastStreamPicker.js.map +1 -0
  101. package/lib/module/live/components/RecordingCard.js +187 -0
  102. package/lib/module/live/components/RecordingCard.js.map +1 -0
  103. package/lib/module/live/components/RecordingsPanel.js +299 -0
  104. package/lib/module/live/components/RecordingsPanel.js.map +1 -0
  105. package/lib/module/live/components/RoomCard.js +343 -0
  106. package/lib/module/live/components/RoomCard.js.map +1 -0
  107. package/lib/module/live/components/StreamConfigModal.js +650 -0
  108. package/lib/module/live/components/StreamConfigModal.js.map +1 -0
  109. package/lib/module/live/components/StreamConfigPanel.js +816 -0
  110. package/lib/module/live/components/StreamConfigPanel.js.map +1 -0
  111. package/lib/module/live/context/LiveConfigContext.js +40 -0
  112. package/lib/module/live/context/LiveConfigContext.js.map +1 -0
  113. package/lib/module/live/context/LiveRoomContext.js +189 -0
  114. package/lib/module/live/context/LiveRoomContext.js.map +1 -0
  115. package/lib/module/live/hooks/useActiveSpeakers.js +31 -0
  116. package/lib/module/live/hooks/useActiveSpeakers.js.map +1 -0
  117. package/lib/module/live/hooks/useRoomAudio.js +125 -0
  118. package/lib/module/live/hooks/useRoomAudio.js.map +1 -0
  119. package/lib/module/live/hooks/useRoomConnection.js +173 -0
  120. package/lib/module/live/hooks/useRoomConnection.js.map +1 -0
  121. package/lib/module/live/hooks/useRoomManager.js +32 -0
  122. package/lib/module/live/hooks/useRoomManager.js.map +1 -0
  123. package/lib/module/live/hooks/useRoomUsers.js +46 -0
  124. package/lib/module/live/hooks/useRoomUsers.js.map +1 -0
  125. package/lib/module/live/index.js +42 -0
  126. package/lib/module/live/index.js.map +1 -0
  127. package/lib/module/live/services/livekitService.js +16 -0
  128. package/lib/module/live/services/livekitService.js.map +1 -0
  129. package/lib/module/live/services/spaceSocketService.js +176 -0
  130. package/lib/module/live/services/spaceSocketService.js.map +1 -0
  131. package/lib/module/live/services/spacesService.js +639 -0
  132. package/lib/module/live/services/spacesService.js.map +1 -0
  133. package/lib/module/live/types.js +4 -0
  134. package/lib/module/live/types.js.map +1 -0
  135. package/lib/module/live/validation.js +229 -0
  136. package/lib/module/live/validation.js.map +1 -0
  137. package/lib/module/package.json +1 -0
  138. package/{dist/esm → lib/module}/schema.js +47 -39
  139. package/lib/module/schema.js.map +1 -0
  140. package/{dist/types → lib/typescript/commonjs}/client.d.ts +1 -0
  141. package/lib/typescript/commonjs/client.d.ts.map +1 -0
  142. package/{dist/types → lib/typescript/commonjs}/errors.d.ts +1 -0
  143. package/lib/typescript/commonjs/errors.d.ts.map +1 -0
  144. package/{dist/types → lib/typescript/commonjs}/index.d.ts +1 -0
  145. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  146. package/lib/typescript/commonjs/index.native.d.ts +3 -0
  147. package/lib/typescript/commonjs/index.native.d.ts.map +1 -0
  148. package/lib/typescript/commonjs/live/assets/icons/spaces-icon.d.ts +13 -0
  149. package/lib/typescript/commonjs/live/assets/icons/spaces-icon.d.ts.map +1 -0
  150. package/lib/typescript/commonjs/live/assets/icons/syra-icon.d.ts +13 -0
  151. package/lib/typescript/commonjs/live/assets/icons/syra-icon.d.ts.map +1 -0
  152. package/lib/typescript/commonjs/live/colors.d.ts +35 -0
  153. package/lib/typescript/commonjs/live/colors.d.ts.map +1 -0
  154. package/lib/typescript/commonjs/live/components/AnimatedPulse.d.ts +8 -0
  155. package/lib/typescript/commonjs/live/components/AnimatedPulse.d.ts.map +1 -0
  156. package/lib/typescript/commonjs/live/components/AnimatedSpeakerRing.d.ts +10 -0
  157. package/lib/typescript/commonjs/live/components/AnimatedSpeakerRing.d.ts.map +1 -0
  158. package/lib/typescript/commonjs/live/components/CreateRoomSheet.d.ts +26 -0
  159. package/lib/typescript/commonjs/live/components/CreateRoomSheet.d.ts.map +1 -0
  160. package/lib/typescript/commonjs/live/components/InsightsPanel.d.ts +11 -0
  161. package/lib/typescript/commonjs/live/components/InsightsPanel.d.ts.map +1 -0
  162. package/lib/typescript/commonjs/live/components/LiveRoomSheet.d.ts +11 -0
  163. package/lib/typescript/commonjs/live/components/LiveRoomSheet.d.ts.map +1 -0
  164. package/lib/typescript/commonjs/live/components/MiniRoomBar.d.ts +15 -0
  165. package/lib/typescript/commonjs/live/components/MiniRoomBar.d.ts.map +1 -0
  166. package/lib/typescript/commonjs/live/components/PanelHeader.d.ts +10 -0
  167. package/lib/typescript/commonjs/live/components/PanelHeader.d.ts.map +1 -0
  168. package/lib/typescript/commonjs/live/components/PodcastStreamPicker.d.ts +54 -0
  169. package/lib/typescript/commonjs/live/components/PodcastStreamPicker.d.ts.map +1 -0
  170. package/lib/typescript/commonjs/live/components/RecordingCard.d.ts +11 -0
  171. package/lib/typescript/commonjs/live/components/RecordingCard.d.ts.map +1 -0
  172. package/lib/typescript/commonjs/live/components/RecordingsPanel.d.ts +12 -0
  173. package/lib/typescript/commonjs/live/components/RecordingsPanel.d.ts.map +1 -0
  174. package/lib/typescript/commonjs/live/components/RoomCard.d.ts +38 -0
  175. package/lib/typescript/commonjs/live/components/RoomCard.d.ts.map +1 -0
  176. package/lib/typescript/commonjs/live/components/StreamConfigModal.d.ts +11 -0
  177. package/lib/typescript/commonjs/live/components/StreamConfigModal.d.ts.map +1 -0
  178. package/lib/typescript/commonjs/live/components/StreamConfigPanel.d.ts +13 -0
  179. package/lib/typescript/commonjs/live/components/StreamConfigPanel.d.ts.map +1 -0
  180. package/lib/typescript/commonjs/live/context/LiveConfigContext.d.ts +78 -0
  181. package/lib/typescript/commonjs/live/context/LiveConfigContext.d.ts.map +1 -0
  182. package/lib/typescript/commonjs/live/context/LiveRoomContext.d.ts +12 -0
  183. package/lib/typescript/commonjs/live/context/LiveRoomContext.d.ts.map +1 -0
  184. package/lib/typescript/commonjs/live/hooks/useActiveSpeakers.d.ts +3 -0
  185. package/lib/typescript/commonjs/live/hooks/useActiveSpeakers.d.ts.map +1 -0
  186. package/lib/typescript/commonjs/live/hooks/useRoomAudio.d.ts +16 -0
  187. package/lib/typescript/commonjs/live/hooks/useRoomAudio.d.ts.map +1 -0
  188. package/lib/typescript/commonjs/live/hooks/useRoomConnection.d.ts +29 -0
  189. package/lib/typescript/commonjs/live/hooks/useRoomConnection.d.ts.map +1 -0
  190. package/lib/typescript/commonjs/live/hooks/useRoomManager.d.ts +11 -0
  191. package/lib/typescript/commonjs/live/hooks/useRoomManager.d.ts.map +1 -0
  192. package/lib/typescript/commonjs/live/hooks/useRoomUsers.d.ts +5 -0
  193. package/lib/typescript/commonjs/live/hooks/useRoomUsers.d.ts.map +1 -0
  194. package/lib/typescript/commonjs/live/index.d.ts +25 -0
  195. package/lib/typescript/commonjs/live/index.d.ts.map +1 -0
  196. package/lib/typescript/commonjs/live/services/livekitService.d.ts +7 -0
  197. package/lib/typescript/commonjs/live/services/livekitService.d.ts.map +1 -0
  198. package/lib/typescript/commonjs/live/services/spaceSocketService.d.ts +69 -0
  199. package/lib/typescript/commonjs/live/services/spaceSocketService.d.ts.map +1 -0
  200. package/lib/typescript/commonjs/live/services/spacesService.d.ts +181 -0
  201. package/lib/typescript/commonjs/live/services/spacesService.d.ts.map +1 -0
  202. package/lib/typescript/commonjs/live/types.d.ts +100 -0
  203. package/lib/typescript/commonjs/live/types.d.ts.map +1 -0
  204. package/lib/typescript/commonjs/live/validation.d.ts +658 -0
  205. package/lib/typescript/commonjs/live/validation.d.ts.map +1 -0
  206. package/lib/typescript/commonjs/package.json +1 -0
  207. package/{dist/types → lib/typescript/commonjs}/schema.d.ts +1 -0
  208. package/lib/typescript/commonjs/schema.d.ts.map +1 -0
  209. package/lib/typescript/module/client.d.ts +141 -0
  210. package/lib/typescript/module/client.d.ts.map +1 -0
  211. package/lib/typescript/module/errors.d.ts +9 -0
  212. package/lib/typescript/module/errors.d.ts.map +1 -0
  213. package/lib/typescript/module/index.d.ts +6 -0
  214. package/lib/typescript/module/index.d.ts.map +1 -0
  215. package/lib/typescript/module/index.native.d.ts +3 -0
  216. package/lib/typescript/module/index.native.d.ts.map +1 -0
  217. package/lib/typescript/module/live/assets/icons/spaces-icon.d.ts +13 -0
  218. package/lib/typescript/module/live/assets/icons/spaces-icon.d.ts.map +1 -0
  219. package/lib/typescript/module/live/assets/icons/syra-icon.d.ts +13 -0
  220. package/lib/typescript/module/live/assets/icons/syra-icon.d.ts.map +1 -0
  221. package/lib/typescript/module/live/colors.d.ts +35 -0
  222. package/lib/typescript/module/live/colors.d.ts.map +1 -0
  223. package/lib/typescript/module/live/components/AnimatedPulse.d.ts +8 -0
  224. package/lib/typescript/module/live/components/AnimatedPulse.d.ts.map +1 -0
  225. package/lib/typescript/module/live/components/AnimatedSpeakerRing.d.ts +10 -0
  226. package/lib/typescript/module/live/components/AnimatedSpeakerRing.d.ts.map +1 -0
  227. package/lib/typescript/module/live/components/CreateRoomSheet.d.ts +26 -0
  228. package/lib/typescript/module/live/components/CreateRoomSheet.d.ts.map +1 -0
  229. package/lib/typescript/module/live/components/InsightsPanel.d.ts +11 -0
  230. package/lib/typescript/module/live/components/InsightsPanel.d.ts.map +1 -0
  231. package/lib/typescript/module/live/components/LiveRoomSheet.d.ts +11 -0
  232. package/lib/typescript/module/live/components/LiveRoomSheet.d.ts.map +1 -0
  233. package/lib/typescript/module/live/components/MiniRoomBar.d.ts +15 -0
  234. package/lib/typescript/module/live/components/MiniRoomBar.d.ts.map +1 -0
  235. package/lib/typescript/module/live/components/PanelHeader.d.ts +10 -0
  236. package/lib/typescript/module/live/components/PanelHeader.d.ts.map +1 -0
  237. package/lib/typescript/module/live/components/PodcastStreamPicker.d.ts +54 -0
  238. package/lib/typescript/module/live/components/PodcastStreamPicker.d.ts.map +1 -0
  239. package/lib/typescript/module/live/components/RecordingCard.d.ts +11 -0
  240. package/lib/typescript/module/live/components/RecordingCard.d.ts.map +1 -0
  241. package/lib/typescript/module/live/components/RecordingsPanel.d.ts +12 -0
  242. package/lib/typescript/module/live/components/RecordingsPanel.d.ts.map +1 -0
  243. package/lib/typescript/module/live/components/RoomCard.d.ts +38 -0
  244. package/lib/typescript/module/live/components/RoomCard.d.ts.map +1 -0
  245. package/lib/typescript/module/live/components/StreamConfigModal.d.ts +11 -0
  246. package/lib/typescript/module/live/components/StreamConfigModal.d.ts.map +1 -0
  247. package/lib/typescript/module/live/components/StreamConfigPanel.d.ts +13 -0
  248. package/lib/typescript/module/live/components/StreamConfigPanel.d.ts.map +1 -0
  249. package/lib/typescript/module/live/context/LiveConfigContext.d.ts +78 -0
  250. package/lib/typescript/module/live/context/LiveConfigContext.d.ts.map +1 -0
  251. package/lib/typescript/module/live/context/LiveRoomContext.d.ts +12 -0
  252. package/lib/typescript/module/live/context/LiveRoomContext.d.ts.map +1 -0
  253. package/lib/typescript/module/live/hooks/useActiveSpeakers.d.ts +3 -0
  254. package/lib/typescript/module/live/hooks/useActiveSpeakers.d.ts.map +1 -0
  255. package/lib/typescript/module/live/hooks/useRoomAudio.d.ts +16 -0
  256. package/lib/typescript/module/live/hooks/useRoomAudio.d.ts.map +1 -0
  257. package/lib/typescript/module/live/hooks/useRoomConnection.d.ts +29 -0
  258. package/lib/typescript/module/live/hooks/useRoomConnection.d.ts.map +1 -0
  259. package/lib/typescript/module/live/hooks/useRoomManager.d.ts +11 -0
  260. package/lib/typescript/module/live/hooks/useRoomManager.d.ts.map +1 -0
  261. package/lib/typescript/module/live/hooks/useRoomUsers.d.ts +5 -0
  262. package/lib/typescript/module/live/hooks/useRoomUsers.d.ts.map +1 -0
  263. package/lib/typescript/module/live/index.d.ts +25 -0
  264. package/lib/typescript/module/live/index.d.ts.map +1 -0
  265. package/lib/typescript/module/live/services/livekitService.d.ts +7 -0
  266. package/lib/typescript/module/live/services/livekitService.d.ts.map +1 -0
  267. package/lib/typescript/module/live/services/spaceSocketService.d.ts +69 -0
  268. package/lib/typescript/module/live/services/spaceSocketService.d.ts.map +1 -0
  269. package/lib/typescript/module/live/services/spacesService.d.ts +181 -0
  270. package/lib/typescript/module/live/services/spacesService.d.ts.map +1 -0
  271. package/lib/typescript/module/live/types.d.ts +100 -0
  272. package/lib/typescript/module/live/types.d.ts.map +1 -0
  273. package/lib/typescript/module/live/validation.d.ts +658 -0
  274. package/lib/typescript/module/live/validation.d.ts.map +1 -0
  275. package/lib/typescript/module/package.json +1 -0
  276. package/lib/typescript/module/schema.d.ts +1072 -0
  277. package/lib/typescript/module/schema.d.ts.map +1 -0
  278. package/package.json +123 -21
  279. package/src/index.native.ts +2 -0
  280. package/src/live/assets/icons/spaces-icon.tsx +15 -0
  281. package/src/live/assets/icons/syra-icon.tsx +13 -0
  282. package/src/live/assets/sounds/intro.mp3 +0 -0
  283. package/src/live/colors.ts +57 -0
  284. package/src/live/components/AnimatedPulse.tsx +52 -0
  285. package/src/live/components/AnimatedSpeakerRing.tsx +101 -0
  286. package/src/live/components/CreateRoomSheet.tsx +654 -0
  287. package/src/live/components/InsightsPanel.tsx +202 -0
  288. package/src/live/components/LiveRoomSheet.tsx +970 -0
  289. package/src/live/components/MiniRoomBar.tsx +167 -0
  290. package/src/live/components/PanelHeader.tsx +36 -0
  291. package/src/live/components/PodcastStreamPicker.tsx +1155 -0
  292. package/src/live/components/RecordingCard.tsx +154 -0
  293. package/src/live/components/RecordingsPanel.tsx +252 -0
  294. package/src/live/components/RoomCard.tsx +343 -0
  295. package/src/live/components/StreamConfigModal.tsx +600 -0
  296. package/src/live/components/StreamConfigPanel.tsx +729 -0
  297. package/src/live/context/LiveConfigContext.tsx +96 -0
  298. package/src/live/context/LiveRoomContext.tsx +235 -0
  299. package/src/live/hooks/useActiveSpeakers.ts +39 -0
  300. package/src/live/hooks/useRoomAudio.ts +103 -0
  301. package/src/live/hooks/useRoomConnection.ts +162 -0
  302. package/src/live/hooks/useRoomManager.ts +17 -0
  303. package/src/live/hooks/useRoomUsers.ts +52 -0
  304. package/src/live/index.ts +104 -0
  305. package/src/live/services/livekitService.ts +11 -0
  306. package/src/live/services/spaceSocketService.ts +136 -0
  307. package/src/live/services/spacesService.ts +692 -0
  308. package/src/live/types.ts +119 -0
  309. package/src/live/validation.ts +279 -0
  310. package/dist/cjs/client.js +0 -244
  311. package/dist/cjs/errors.js +0 -16
  312. package/dist/cjs/index.js +0 -15
  313. package/dist/cjs/package.json +0 -3
  314. package/dist/esm/client.js +0 -240
  315. package/dist/esm/errors.js +0 -12
  316. package/dist/esm/index.js +0 -3
  317. package/dist/esm/package.json +0 -3
@@ -0,0 +1,1190 @@
1
+ "use strict";
2
+
3
+ import React, { useCallback, useEffect, useState, useMemo } from 'react';
4
+ import { View, Text, Image, StyleSheet, TouchableOpacity, ScrollView } from 'react-native';
5
+ import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';
6
+ import { useAuth } from '@oxyhq/services';
7
+ import { useLiveConfig } from "../context/LiveConfigContext.js";
8
+ import { MiniRoomBar } from "./MiniRoomBar.js";
9
+ import { StreamConfigPanel } from "./StreamConfigPanel.js";
10
+ import { InsightsPanel } from "./InsightsPanel.js";
11
+ import { PanelHeader } from "./PanelHeader.js";
12
+ import { AnimatedSpeakerRing } from "./AnimatedSpeakerRing.js";
13
+ import { AnimatedPulse } from "./AnimatedPulse.js";
14
+ import { useRoomConnection } from "../hooks/useRoomConnection.js";
15
+ import { useRoomAudio } from "../hooks/useRoomAudio.js";
16
+ import { useActiveSpeakers } from "../hooks/useActiveSpeakers.js";
17
+ import { useRoomUsers, getDisplayName, getAvatarUrl } from "../hooks/useRoomUsers.js";
18
+ import { LIVE_COLOR, LIVE_TINT_COLOR } from "../colors.js";
19
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
20
+ /**
21
+ * English source copy for the podcast host-control strings added to the stream
22
+ * card. Hosts with an i18n layer inject `t`; hosts without one fall back here.
23
+ * Keys mirror the `agora.podcastStream.*` entries in the app locale files.
24
+ */
25
+ const LIVE_ROOM_STRINGS = {
26
+ 'agora.podcastStream.skipNext': 'Skip to next episode',
27
+ 'agora.podcastStream.skipped': 'Skipped to the next episode',
28
+ 'agora.podcastStream.queueEnded': 'Podcast queue finished',
29
+ 'agora.podcastStream.skipFailed': "Couldn't skip to the next episode"
30
+ };
31
+
32
+ /** Format a second count as `m:ss` (or `h:mm:ss` when hours are relevant). */
33
+ function formatClock(totalSeconds, withHours) {
34
+ const s = Math.max(0, Math.floor(totalSeconds));
35
+ const hours = Math.floor(s / 3600);
36
+ const minutes = Math.floor(s % 3600 / 60);
37
+ const secs = s % 60;
38
+ const pad = n => String(n).padStart(2, '0');
39
+ return withHours ? `${hours}:${pad(minutes)}:${pad(secs)}` : `${minutes}:${pad(secs)}`;
40
+ }
41
+ const RoleBadge = ({
42
+ role,
43
+ theme
44
+ }) => {
45
+ if (role === 'host') {
46
+ return /*#__PURE__*/_jsx(View, {
47
+ style: [styles.roleBadge, {
48
+ backgroundColor: theme.colors.primary
49
+ }],
50
+ children: /*#__PURE__*/_jsx(Text, {
51
+ style: styles.roleBadgeText,
52
+ children: "Host"
53
+ })
54
+ });
55
+ }
56
+ if (role === 'speaker') {
57
+ return /*#__PURE__*/_jsx(View, {
58
+ style: [styles.roleBadge, {
59
+ backgroundColor: theme.colors.backgroundSecondary
60
+ }],
61
+ children: /*#__PURE__*/_jsx(Text, {
62
+ style: [styles.roleBadgeText, {
63
+ color: theme.colors.text
64
+ }],
65
+ children: "Speaker"
66
+ })
67
+ });
68
+ }
69
+ return null;
70
+ };
71
+ const SpeakerTile = ({
72
+ participant,
73
+ isCurrentUser,
74
+ isSpeaking,
75
+ theme,
76
+ userProfile,
77
+ oxyServices,
78
+ AvatarComponent,
79
+ getCachedFileDownloadUrlSync
80
+ }) => {
81
+ const displayName = getDisplayName(userProfile, participant.userId, isCurrentUser);
82
+ const avatarUri = getAvatarUrl(userProfile, oxyServices, getCachedFileDownloadUrlSync);
83
+ return /*#__PURE__*/_jsxs(View, {
84
+ style: styles.speakerTile,
85
+ children: [/*#__PURE__*/_jsxs(AnimatedSpeakerRing, {
86
+ isSpeaking: isSpeaking,
87
+ isMuted: participant.isMuted,
88
+ primaryColor: theme.colors.primary,
89
+ children: [/*#__PURE__*/_jsx(AvatarComponent, {
90
+ size: 64,
91
+ source: avatarUri,
92
+ shape: "squircle"
93
+ }), participant.isMuted && /*#__PURE__*/_jsx(View, {
94
+ style: [styles.muteIndicator, {
95
+ backgroundColor: LIVE_COLOR
96
+ }],
97
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
98
+ name: "microphone-off",
99
+ size: 12,
100
+ color: "#FFFFFF"
101
+ })
102
+ })]
103
+ }), /*#__PURE__*/_jsx(Text, {
104
+ style: [styles.speakerName, {
105
+ color: theme.colors.text
106
+ }],
107
+ numberOfLines: 1,
108
+ children: displayName
109
+ }), /*#__PURE__*/_jsx(RoleBadge, {
110
+ role: participant.role,
111
+ theme: theme
112
+ })]
113
+ });
114
+ };
115
+ const ListenerAvatar = ({
116
+ participant,
117
+ userProfile,
118
+ oxyServices,
119
+ AvatarComponent,
120
+ getCachedFileDownloadUrlSync
121
+ }) => {
122
+ return /*#__PURE__*/_jsx(View, {
123
+ style: styles.listenerItem,
124
+ children: /*#__PURE__*/_jsx(AvatarComponent, {
125
+ size: 40,
126
+ source: getAvatarUrl(userProfile, oxyServices, getCachedFileDownloadUrlSync),
127
+ shape: "squircle"
128
+ })
129
+ });
130
+ };
131
+ const ConnectedSpeakerTile = ({
132
+ participant,
133
+ isCurrentUser,
134
+ isSpeaking,
135
+ theme,
136
+ oxyServices,
137
+ AvatarComponent,
138
+ getCachedFileDownloadUrlSync,
139
+ useUserById
140
+ }) => {
141
+ const userProfile = useUserById(participant.userId);
142
+ return /*#__PURE__*/_jsx(SpeakerTile, {
143
+ participant: participant,
144
+ isCurrentUser: isCurrentUser,
145
+ isSpeaking: isSpeaking,
146
+ theme: theme,
147
+ userProfile: userProfile,
148
+ oxyServices: oxyServices,
149
+ AvatarComponent: AvatarComponent,
150
+ getCachedFileDownloadUrlSync: getCachedFileDownloadUrlSync
151
+ });
152
+ };
153
+ const ConnectedListenerAvatar = ({
154
+ participant,
155
+ oxyServices,
156
+ AvatarComponent,
157
+ getCachedFileDownloadUrlSync,
158
+ useUserById
159
+ }) => {
160
+ const userProfile = useUserById(participant.userId);
161
+ return /*#__PURE__*/_jsx(ListenerAvatar, {
162
+ participant: participant,
163
+ userProfile: userProfile,
164
+ oxyServices: oxyServices,
165
+ AvatarComponent: AvatarComponent,
166
+ getCachedFileDownloadUrlSync: getCachedFileDownloadUrlSync
167
+ });
168
+ };
169
+ const ConnectedRequestRow = ({
170
+ request,
171
+ theme,
172
+ oxyServices,
173
+ onApprove,
174
+ onDeny,
175
+ AvatarComponent,
176
+ getCachedFileDownloadUrlSync,
177
+ useUserById
178
+ }) => {
179
+ const userProfile = useUserById(request.userId);
180
+ const displayName = getDisplayName(userProfile, request.userId, false);
181
+ const avatarUri = getAvatarUrl(userProfile, oxyServices, getCachedFileDownloadUrlSync);
182
+ return /*#__PURE__*/_jsxs(View, {
183
+ style: [styles.requestRow, {
184
+ backgroundColor: `${theme.colors.card}80`,
185
+ borderColor: theme.colors.border
186
+ }],
187
+ children: [/*#__PURE__*/_jsx(AvatarComponent, {
188
+ size: 36,
189
+ source: avatarUri,
190
+ shape: "squircle"
191
+ }), /*#__PURE__*/_jsx(Text, {
192
+ style: [styles.requestName, {
193
+ color: theme.colors.text
194
+ }],
195
+ numberOfLines: 1,
196
+ children: displayName
197
+ }), /*#__PURE__*/_jsx(TouchableOpacity, {
198
+ onPress: () => onApprove(request.userId),
199
+ style: [styles.approveBtn, {
200
+ backgroundColor: theme.colors.primary
201
+ }],
202
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
203
+ name: "check",
204
+ size: 18,
205
+ color: "#FFFFFF"
206
+ })
207
+ }), /*#__PURE__*/_jsx(TouchableOpacity, {
208
+ onPress: () => onDeny(request.userId),
209
+ style: [styles.denyBtn, {
210
+ backgroundColor: theme.colors.backgroundSecondary
211
+ }],
212
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
213
+ name: "close",
214
+ size: 18,
215
+ color: theme.colors.text
216
+ })
217
+ })]
218
+ });
219
+ };
220
+ export function LiveRoomSheet({
221
+ roomId,
222
+ isExpanded,
223
+ onCollapse,
224
+ onExpand,
225
+ onLeave
226
+ }) {
227
+ const {
228
+ useTheme,
229
+ useUserById,
230
+ AvatarComponent,
231
+ roomsService,
232
+ toast,
233
+ getCachedFileDownloadUrl,
234
+ getCachedFileDownloadUrlSync,
235
+ onRoomChanged,
236
+ t
237
+ } = useLiveConfig();
238
+ const theme = useTheme();
239
+ const {
240
+ user,
241
+ oxyServices
242
+ } = useAuth();
243
+ const [room, setRoom] = useState(null);
244
+ const tr = useCallback(key => t ? t(key) : LIVE_ROOM_STRINGS[key] ?? key, [t]);
245
+ useEffect(() => {
246
+ if (roomId) {
247
+ roomsService.getRoom(roomId).then(setRoom);
248
+ }
249
+ }, [roomId]);
250
+ const {
251
+ isConnected,
252
+ participants,
253
+ myRole,
254
+ isMuted,
255
+ speakerRequests,
256
+ activeStream,
257
+ isRecording,
258
+ join,
259
+ leave,
260
+ toggleMute,
261
+ requestToSpeak,
262
+ approveSpeaker,
263
+ denySpeaker,
264
+ isRoomEnded
265
+ } = useRoomConnection({
266
+ roomId,
267
+ enabled: !!roomId
268
+ });
269
+ const isRoomLive = room?.status === 'live';
270
+ const {
271
+ isLiveKitConnected,
272
+ micPermissionDenied,
273
+ livekitRoom
274
+ } = useRoomAudio({
275
+ roomId,
276
+ isSpeaker: myRole === 'speaker' || myRole === 'host',
277
+ isMuted,
278
+ isConnected: isConnected && isRoomLive
279
+ });
280
+ const activeSpeakerIds = useActiveSpeakers(livekitRoom);
281
+ useEffect(() => {
282
+ if (isConnected && roomId) {
283
+ join();
284
+ }
285
+ }, [isConnected, roomId, join]);
286
+ useEffect(() => {
287
+ if (isRoomEnded) {
288
+ toast('Room ended');
289
+ leave();
290
+ onLeave();
291
+ }
292
+ }, [isRoomEnded]);
293
+ const handleLeave = () => {
294
+ leave();
295
+ onLeave();
296
+ };
297
+ const handleStopRoom = async () => {
298
+ if (!roomId) return;
299
+ const success = await roomsService.stopRoom(roomId);
300
+ if (success) {
301
+ onRoomChanged?.(roomId);
302
+ leave();
303
+ onLeave();
304
+ } else {
305
+ toast.error('Failed to stop session');
306
+ }
307
+ };
308
+ const handleDeleteRoom = async () => {
309
+ if (!roomId) return;
310
+ const success = await roomsService.deleteRoom(roomId);
311
+ if (success) {
312
+ onRoomChanged?.(roomId);
313
+ leave();
314
+ onLeave();
315
+ toast.success('Room deleted');
316
+ } else {
317
+ toast.error('Failed to delete room');
318
+ }
319
+ };
320
+ const [startingRoom, setStartingRoom] = useState(false);
321
+ const handleStartRoom = async () => {
322
+ if (!roomId || startingRoom) return;
323
+ setStartingRoom(true);
324
+ try {
325
+ const success = await roomsService.startRoom(roomId);
326
+ if (success) {
327
+ const updated = await roomsService.getRoom(roomId);
328
+ if (updated) setRoom(updated);
329
+ onRoomChanged?.(roomId);
330
+ toast.success('Room is now live!');
331
+ } else {
332
+ toast.error('Failed to start room');
333
+ }
334
+ } catch {
335
+ toast.error('Failed to start room');
336
+ } finally {
337
+ setStartingRoom(false);
338
+ }
339
+ };
340
+ const handleStartRecording = async () => {
341
+ if (!roomId) return;
342
+ const success = await roomsService.startRecording(roomId);
343
+ if (success) {
344
+ toast.success('Recording started');
345
+ } else {
346
+ toast.error('Failed to start recording');
347
+ }
348
+ };
349
+ const handleStopRecording = async () => {
350
+ if (!roomId) return;
351
+ const success = await roomsService.stopRecording(roomId);
352
+ if (success) {
353
+ toast.success('Recording saved');
354
+ } else {
355
+ toast.error('Failed to stop recording');
356
+ }
357
+ };
358
+ const [activePanel, setActivePanel] = useState(null);
359
+ const [streamLoading, setStreamLoading] = useState(false);
360
+ const effectiveStream = activeStream ?? (room?.streamTitle || room?.activeStreamUrl ? {
361
+ title: room.streamTitle ?? undefined,
362
+ image: room.streamImage ?? undefined,
363
+ description: room.streamDescription ?? undefined,
364
+ startedAt: room.streamStartedAt ?? undefined,
365
+ durationSec: room.streamDurationSec ?? undefined
366
+ } : null);
367
+ const [streamImageUrl, setStreamImageUrl] = useState(null);
368
+ useEffect(() => {
369
+ if (effectiveStream?.image) {
370
+ getCachedFileDownloadUrl(oxyServices, effectiveStream.image).then(setStreamImageUrl);
371
+ } else {
372
+ setStreamImageUrl(null);
373
+ }
374
+ }, [effectiveStream?.image, oxyServices]);
375
+
376
+ // Stream progress — only for length-known streams (e.g. podcast episodes).
377
+ const streamStartedAt = effectiveStream?.startedAt;
378
+ const streamDurationSec = effectiveStream?.durationSec ?? 0;
379
+ const hasProgress = !!streamStartedAt && streamDurationSec > 0;
380
+
381
+ // A lightweight 1s tick that advances the elapsed readout while a length-known
382
+ // stream plays. Runs only when there's progress to show; cleared on unmount
383
+ // and whenever the stream clears.
384
+ const [nowMs, setNowMs] = useState(() => Date.now());
385
+ useEffect(() => {
386
+ if (!hasProgress) return;
387
+ setNowMs(Date.now());
388
+ const id = setInterval(() => setNowMs(Date.now()), 1000);
389
+ return () => clearInterval(id);
390
+ }, [hasProgress]);
391
+ const elapsedSec = useMemo(() => {
392
+ if (!hasProgress || !streamStartedAt) return 0;
393
+ const startMs = new Date(streamStartedAt).getTime();
394
+ if (Number.isNaN(startMs)) return 0;
395
+ return Math.min(Math.max(Math.floor((nowMs - startMs) / 1000), 0), streamDurationSec);
396
+ }, [hasProgress, streamStartedAt, nowMs, streamDurationSec]);
397
+ const progressPct = hasProgress ? Math.min(Math.max(elapsedSec / streamDurationSec, 0), 1) * 100 : 0;
398
+ const progressFillStyle = {
399
+ backgroundColor: theme.colors.primary,
400
+ width: `${progressPct}%`
401
+ };
402
+ const withHours = streamDurationSec >= 3600;
403
+ const handleStopStream = async () => {
404
+ if (!roomId || streamLoading) return;
405
+ setStreamLoading(true);
406
+ try {
407
+ const success = await roomsService.stopStream(roomId);
408
+ if (success) {
409
+ toast.success('Stream stopped');
410
+ } else {
411
+ toast.error('Failed to stop stream');
412
+ }
413
+ } catch {
414
+ toast.error('Failed to stop stream');
415
+ } finally {
416
+ setStreamLoading(false);
417
+ }
418
+ };
419
+ const [skipLoading, setSkipLoading] = useState(false);
420
+ const handleSkipNext = async () => {
421
+ if (!roomId || skipLoading) return;
422
+ setSkipLoading(true);
423
+ try {
424
+ const result = await roomsService.skipPodcastNext(roomId);
425
+ if (!result) {
426
+ toast.error(tr('agora.podcastStream.skipFailed'));
427
+ } else {
428
+ toast.success(tr(result.ended ? 'agora.podcastStream.queueEnded' : 'agora.podcastStream.skipped'));
429
+ const updated = await roomsService.getRoom(roomId);
430
+ if (updated) setRoom(updated);
431
+ }
432
+ } catch {
433
+ toast.error(tr('agora.podcastStream.skipFailed'));
434
+ } finally {
435
+ setSkipLoading(false);
436
+ }
437
+ };
438
+ const participantIds = useMemo(() => participants.map(p => p.userId), [participants]);
439
+ useRoomUsers(participantIds);
440
+ const speakers = participants.filter(p => p.role === 'host' || p.role === 'speaker');
441
+ const listeners = participants.filter(p => p.role === 'listener');
442
+ const userId = user?.id;
443
+ const isHost = myRole === 'host' || !!userId && room?.host === userId;
444
+ const canSpeak = myRole === 'host' || myRole === 'speaker';
445
+ if (!isExpanded) {
446
+ return /*#__PURE__*/_jsx(MiniRoomBar, {
447
+ title: room?.title || 'Room',
448
+ participantCount: participants.length,
449
+ isMuted: isMuted,
450
+ canSpeak: canSpeak,
451
+ activeSpeakerCount: activeSpeakerIds.size,
452
+ onExpand: onExpand,
453
+ onToggleMute: toggleMute,
454
+ onLeave: handleLeave
455
+ });
456
+ }
457
+ if (activePanel === 'stream') {
458
+ return /*#__PURE__*/_jsx(StreamConfigPanel, {
459
+ roomId: roomId,
460
+ roomStatus: room?.status,
461
+ initialStreamUrl: room?.activeStreamUrl ?? undefined,
462
+ initialRtmpUrl: room?.rtmpUrl ?? undefined,
463
+ initialStreamKey: room?.rtmpStreamKey ?? undefined,
464
+ onClose: () => setActivePanel(null),
465
+ onStreamStarted: () => {
466
+ roomsService.getRoom(roomId).then(setRoom);
467
+ onRoomChanged?.(roomId);
468
+ setActivePanel(null);
469
+ }
470
+ });
471
+ }
472
+ if (activePanel === 'insights') {
473
+ return /*#__PURE__*/_jsx(InsightsPanel, {
474
+ room: room,
475
+ participants: participants,
476
+ theme: theme,
477
+ onClose: () => setActivePanel(null)
478
+ });
479
+ }
480
+ if (activePanel === 'settings') {
481
+ return /*#__PURE__*/_jsxs(View, {
482
+ style: styles.container,
483
+ children: [/*#__PURE__*/_jsx(PanelHeader, {
484
+ title: "Room Settings",
485
+ theme: theme,
486
+ onBack: () => setActivePanel(null)
487
+ }), /*#__PURE__*/_jsxs(View, {
488
+ style: styles.settingsContent,
489
+ children: [isRoomLive && /*#__PURE__*/_jsxs(View, {
490
+ style: styles.settingsItem,
491
+ children: [/*#__PURE__*/_jsx(MaterialCommunityIcons, {
492
+ name: isRecording ? 'record-circle' : 'record-circle-outline',
493
+ size: 22,
494
+ color: isRecording ? '#FF0000' : theme.colors.text
495
+ }), /*#__PURE__*/_jsxs(View, {
496
+ style: styles.settingsItemText,
497
+ children: [/*#__PURE__*/_jsx(Text, {
498
+ style: [styles.settingsItemTitle, {
499
+ color: theme.colors.text
500
+ }],
501
+ children: "Recording"
502
+ }), /*#__PURE__*/_jsx(Text, {
503
+ style: [styles.settingsItemDesc, {
504
+ color: theme.colors.textSecondary
505
+ }],
506
+ children: isRecording ? 'Currently recording (max 1h)' : 'Record room audio for replay'
507
+ })]
508
+ }), /*#__PURE__*/_jsx(TouchableOpacity, {
509
+ onPress: isRecording ? handleStopRecording : handleStartRecording,
510
+ style: [styles.recordingToggle, {
511
+ backgroundColor: isRecording ? LIVE_COLOR : theme.colors.primary
512
+ }],
513
+ children: /*#__PURE__*/_jsx(Text, {
514
+ style: {
515
+ color: '#FFFFFF',
516
+ fontWeight: '600',
517
+ fontSize: 13
518
+ },
519
+ children: isRecording ? 'Stop' : 'Start'
520
+ })
521
+ })]
522
+ }), /*#__PURE__*/_jsxs(TouchableOpacity, {
523
+ style: styles.settingsItem,
524
+ onPress: handleDeleteRoom,
525
+ children: [/*#__PURE__*/_jsx(MaterialCommunityIcons, {
526
+ name: "delete-outline",
527
+ size: 22,
528
+ color: LIVE_COLOR
529
+ }), /*#__PURE__*/_jsxs(View, {
530
+ style: styles.settingsItemText,
531
+ children: [/*#__PURE__*/_jsx(Text, {
532
+ style: [styles.settingsItemTitle, {
533
+ color: LIVE_COLOR
534
+ }],
535
+ children: "Delete Room"
536
+ }), /*#__PURE__*/_jsx(Text, {
537
+ style: [styles.settingsItemDesc, {
538
+ color: theme.colors.textSecondary
539
+ }],
540
+ children: "Permanently remove this room"
541
+ })]
542
+ })]
543
+ })]
544
+ })]
545
+ });
546
+ }
547
+ return /*#__PURE__*/_jsxs(View, {
548
+ style: styles.container,
549
+ children: [/*#__PURE__*/_jsxs(View, {
550
+ style: [styles.header, {
551
+ borderBottomColor: `${theme.colors.border}80`
552
+ }],
553
+ children: [/*#__PURE__*/_jsx(TouchableOpacity, {
554
+ onPress: onCollapse,
555
+ style: styles.headerButton,
556
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
557
+ name: "chevron-down",
558
+ size: 24,
559
+ color: theme.colors.text
560
+ })
561
+ }), /*#__PURE__*/_jsxs(View, {
562
+ style: styles.headerCenter,
563
+ children: [isRoomLive ? /*#__PURE__*/_jsxs(View, {
564
+ style: [styles.liveBadge, {
565
+ backgroundColor: LIVE_COLOR
566
+ }],
567
+ children: [/*#__PURE__*/_jsx(AnimatedPulse, {}), /*#__PURE__*/_jsx(Text, {
568
+ style: styles.liveText,
569
+ children: "LIVE"
570
+ })]
571
+ }) : /*#__PURE__*/_jsx(View, {
572
+ style: [styles.liveBadge, {
573
+ backgroundColor: theme.colors.textSecondary
574
+ }],
575
+ children: /*#__PURE__*/_jsx(Text, {
576
+ style: styles.liveText,
577
+ children: "SCHEDULED"
578
+ })
579
+ }), isRecording && /*#__PURE__*/_jsxs(View, {
580
+ style: [styles.liveBadge, {
581
+ backgroundColor: '#FF0000'
582
+ }],
583
+ children: [/*#__PURE__*/_jsx(AnimatedPulse, {}), /*#__PURE__*/_jsx(Text, {
584
+ style: styles.liveText,
585
+ children: "REC"
586
+ })]
587
+ }), /*#__PURE__*/_jsxs(Text, {
588
+ style: [styles.listenerCount, {
589
+ color: theme.colors.textSecondary
590
+ }],
591
+ children: [participants.length, " in room"]
592
+ })]
593
+ }), /*#__PURE__*/_jsxs(View, {
594
+ style: styles.headerRight,
595
+ children: [isHost && isRoomLive && /*#__PURE__*/_jsx(TouchableOpacity, {
596
+ onPress: handleStopRoom,
597
+ style: styles.endButton,
598
+ children: /*#__PURE__*/_jsx(Text, {
599
+ style: styles.endButtonText,
600
+ children: "End"
601
+ })
602
+ }), isHost && !isRoomLive && room?.status === 'scheduled' && /*#__PURE__*/_jsx(TouchableOpacity, {
603
+ onPress: handleStartRoom,
604
+ disabled: startingRoom,
605
+ style: [styles.endButton, {
606
+ backgroundColor: theme.colors.primary
607
+ }],
608
+ children: /*#__PURE__*/_jsx(Text, {
609
+ style: [styles.endButtonText, {
610
+ color: '#FFFFFF'
611
+ }],
612
+ children: startingRoom ? 'Starting...' : 'Go Live'
613
+ })
614
+ })]
615
+ })]
616
+ }), /*#__PURE__*/_jsxs(View, {
617
+ style: styles.roomInfo,
618
+ children: [/*#__PURE__*/_jsx(Text, {
619
+ style: [styles.roomTitle, {
620
+ color: theme.colors.text
621
+ }],
622
+ numberOfLines: 2,
623
+ children: room?.title || 'Room'
624
+ }), room?.topic && /*#__PURE__*/_jsx(Text, {
625
+ style: [styles.roomTopic, {
626
+ color: theme.colors.textSecondary
627
+ }],
628
+ children: room.topic
629
+ })]
630
+ }), micPermissionDenied && canSpeak && /*#__PURE__*/_jsxs(View, {
631
+ style: [styles.micBanner, {
632
+ backgroundColor: '#FFF3CD',
633
+ borderColor: '#FFE69C'
634
+ }],
635
+ children: [/*#__PURE__*/_jsx(MaterialCommunityIcons, {
636
+ name: "microphone-off",
637
+ size: 18,
638
+ color: "#856404"
639
+ }), /*#__PURE__*/_jsx(Text, {
640
+ style: styles.micBannerText,
641
+ children: "Microphone access denied. Allow mic permission in your browser settings to speak."
642
+ })]
643
+ }), effectiveStream && /*#__PURE__*/_jsxs(View, {
644
+ style: [styles.streamCard, {
645
+ backgroundColor: `${theme.colors.card}80`,
646
+ borderColor: theme.colors.border
647
+ }],
648
+ children: [/*#__PURE__*/_jsxs(View, {
649
+ style: styles.streamCardRow,
650
+ children: [streamImageUrl ? /*#__PURE__*/_jsx(Image, {
651
+ source: {
652
+ uri: streamImageUrl
653
+ },
654
+ style: styles.streamCardImage
655
+ }) : /*#__PURE__*/_jsx(View, {
656
+ style: [styles.streamCardIconBox, {
657
+ backgroundColor: '#E8F5E9'
658
+ }],
659
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
660
+ name: "radio",
661
+ size: 20,
662
+ color: "#2E7D32"
663
+ })
664
+ }), /*#__PURE__*/_jsxs(View, {
665
+ style: styles.streamCardContent,
666
+ children: [/*#__PURE__*/_jsx(Text, {
667
+ style: [styles.streamCardTitle, {
668
+ color: theme.colors.text
669
+ }],
670
+ numberOfLines: 1,
671
+ children: effectiveStream.title || 'Live Stream'
672
+ }), effectiveStream.description ? /*#__PURE__*/_jsx(Text, {
673
+ style: [styles.streamCardDesc, {
674
+ color: theme.colors.textSecondary
675
+ }],
676
+ numberOfLines: 2,
677
+ children: effectiveStream.description
678
+ }) : null]
679
+ }), isHost && /*#__PURE__*/_jsxs(View, {
680
+ style: styles.streamCardActions,
681
+ children: [(room?.podcastQueue?.length ?? 0) > 0 && /*#__PURE__*/_jsx(TouchableOpacity, {
682
+ onPress: handleSkipNext,
683
+ disabled: skipLoading,
684
+ style: styles.streamCardAction,
685
+ accessibilityRole: "button",
686
+ accessibilityLabel: tr('agora.podcastStream.skipNext'),
687
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
688
+ name: "skip-next-circle",
689
+ size: 22,
690
+ color: theme.colors.primary
691
+ })
692
+ }), /*#__PURE__*/_jsx(TouchableOpacity, {
693
+ onPress: handleStopStream,
694
+ disabled: streamLoading,
695
+ style: styles.streamCardAction,
696
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
697
+ name: "close-circle",
698
+ size: 22,
699
+ color: "#C62828"
700
+ })
701
+ })]
702
+ })]
703
+ }), hasProgress && /*#__PURE__*/_jsxs(View, {
704
+ style: styles.streamProgress,
705
+ children: [/*#__PURE__*/_jsx(View, {
706
+ style: [styles.progressTrack, {
707
+ backgroundColor: theme.colors.border
708
+ }],
709
+ children: /*#__PURE__*/_jsx(View, {
710
+ style: [styles.progressFill, progressFillStyle]
711
+ })
712
+ }), /*#__PURE__*/_jsxs(Text, {
713
+ style: [styles.progressTime, {
714
+ color: theme.colors.textSecondary
715
+ }],
716
+ children: [formatClock(elapsedSec, withHours), " / ", formatClock(streamDurationSec, withHours)]
717
+ })]
718
+ })]
719
+ }), /*#__PURE__*/_jsxs(ScrollView, {
720
+ style: {
721
+ flex: 1
722
+ },
723
+ contentContainerStyle: styles.scrollContent,
724
+ showsVerticalScrollIndicator: false,
725
+ children: [/*#__PURE__*/_jsx(View, {
726
+ style: styles.speakerGrid,
727
+ children: speakers.map(p => /*#__PURE__*/_jsx(ConnectedSpeakerTile, {
728
+ participant: p,
729
+ isCurrentUser: p.userId === userId,
730
+ isSpeaking: activeSpeakerIds.has(p.userId),
731
+ theme: theme,
732
+ oxyServices: oxyServices,
733
+ AvatarComponent: AvatarComponent,
734
+ getCachedFileDownloadUrlSync: getCachedFileDownloadUrlSync,
735
+ useUserById: useUserById
736
+ }, p.userId))
737
+ }), listeners.length > 0 && /*#__PURE__*/_jsxs(View, {
738
+ style: styles.listenerSection,
739
+ children: [/*#__PURE__*/_jsxs(Text, {
740
+ style: [styles.listenerHeader, {
741
+ color: theme.colors.textSecondary
742
+ }],
743
+ children: ["Listeners (", listeners.length, ")"]
744
+ }), /*#__PURE__*/_jsx(View, {
745
+ style: styles.listenerGrid,
746
+ children: listeners.map(p => /*#__PURE__*/_jsx(ConnectedListenerAvatar, {
747
+ participant: p,
748
+ oxyServices: oxyServices,
749
+ AvatarComponent: AvatarComponent,
750
+ getCachedFileDownloadUrlSync: getCachedFileDownloadUrlSync,
751
+ useUserById: useUserById
752
+ }, p.userId))
753
+ })]
754
+ }), isHost && speakerRequests.length > 0 && /*#__PURE__*/_jsxs(View, {
755
+ style: styles.requestsSection,
756
+ children: [/*#__PURE__*/_jsx(Text, {
757
+ style: [styles.requestsHeader, {
758
+ color: theme.colors.textSecondary
759
+ }],
760
+ children: "Requests to speak"
761
+ }), speakerRequests.map(r => /*#__PURE__*/_jsx(ConnectedRequestRow, {
762
+ request: r,
763
+ theme: theme,
764
+ oxyServices: oxyServices,
765
+ onApprove: approveSpeaker,
766
+ onDeny: denySpeaker,
767
+ AvatarComponent: AvatarComponent,
768
+ getCachedFileDownloadUrlSync: getCachedFileDownloadUrlSync,
769
+ useUserById: useUserById
770
+ }, r.userId))]
771
+ })]
772
+ }), /*#__PURE__*/_jsxs(View, {
773
+ style: [styles.controlBar, {
774
+ borderTopColor: theme.colors.border
775
+ }],
776
+ children: [canSpeak ? /*#__PURE__*/_jsxs(TouchableOpacity, {
777
+ style: styles.controlItem,
778
+ onPress: toggleMute,
779
+ children: [/*#__PURE__*/_jsx(View, {
780
+ style: [styles.controlCircle, {
781
+ backgroundColor: isMuted ? theme.colors.backgroundSecondary : theme.colors.primary
782
+ }],
783
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
784
+ name: isMuted ? 'microphone-off' : 'microphone',
785
+ size: 24,
786
+ color: isMuted ? theme.colors.text : '#FFFFFF'
787
+ })
788
+ }), /*#__PURE__*/_jsx(Text, {
789
+ style: [styles.controlLabel, {
790
+ color: theme.colors.textSecondary
791
+ }],
792
+ children: isMuted ? 'Unmute' : 'Mute'
793
+ })]
794
+ }) : /*#__PURE__*/_jsxs(TouchableOpacity, {
795
+ style: styles.controlItem,
796
+ onPress: requestToSpeak,
797
+ children: [/*#__PURE__*/_jsx(View, {
798
+ style: [styles.controlCircle, {
799
+ backgroundColor: theme.colors.backgroundSecondary
800
+ }],
801
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
802
+ name: "hand-back-left",
803
+ size: 24,
804
+ color: theme.colors.text
805
+ })
806
+ }), /*#__PURE__*/_jsx(Text, {
807
+ style: [styles.controlLabel, {
808
+ color: theme.colors.textSecondary
809
+ }],
810
+ children: "Request"
811
+ })]
812
+ }), /*#__PURE__*/_jsxs(TouchableOpacity, {
813
+ style: styles.controlItem,
814
+ onPress: () => setActivePanel('insights'),
815
+ children: [/*#__PURE__*/_jsx(View, {
816
+ style: [styles.controlCircle, {
817
+ backgroundColor: theme.colors.backgroundSecondary
818
+ }],
819
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
820
+ name: "chart-box-outline",
821
+ size: 24,
822
+ color: theme.colors.text
823
+ })
824
+ }), /*#__PURE__*/_jsx(Text, {
825
+ style: [styles.controlLabel, {
826
+ color: theme.colors.textSecondary
827
+ }],
828
+ children: "Insights"
829
+ })]
830
+ }), isHost && /*#__PURE__*/_jsxs(TouchableOpacity, {
831
+ style: styles.controlItem,
832
+ onPress: () => setActivePanel('stream'),
833
+ children: [/*#__PURE__*/_jsx(View, {
834
+ style: [styles.controlCircle, {
835
+ backgroundColor: theme.colors.backgroundSecondary
836
+ }],
837
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
838
+ name: "radio",
839
+ size: 24,
840
+ color: theme.colors.text
841
+ })
842
+ }), /*#__PURE__*/_jsx(Text, {
843
+ style: [styles.controlLabel, {
844
+ color: theme.colors.textSecondary
845
+ }],
846
+ children: "Stream"
847
+ })]
848
+ }), isHost && /*#__PURE__*/_jsxs(TouchableOpacity, {
849
+ style: styles.controlItem,
850
+ onPress: () => setActivePanel('settings'),
851
+ children: [/*#__PURE__*/_jsx(View, {
852
+ style: [styles.controlCircle, {
853
+ backgroundColor: theme.colors.backgroundSecondary
854
+ }],
855
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
856
+ name: "cog-outline",
857
+ size: 24,
858
+ color: theme.colors.text
859
+ })
860
+ }), /*#__PURE__*/_jsx(Text, {
861
+ style: [styles.controlLabel, {
862
+ color: theme.colors.textSecondary
863
+ }],
864
+ children: "Settings"
865
+ })]
866
+ }), /*#__PURE__*/_jsxs(TouchableOpacity, {
867
+ style: styles.controlItem,
868
+ onPress: handleLeave,
869
+ children: [/*#__PURE__*/_jsx(View, {
870
+ style: [styles.leaveCircle, {
871
+ backgroundColor: LIVE_COLOR
872
+ }],
873
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
874
+ name: "exit-run",
875
+ size: 24,
876
+ color: "#FFFFFF"
877
+ })
878
+ }), /*#__PURE__*/_jsx(Text, {
879
+ style: [styles.controlLabel, {
880
+ color: theme.colors.textSecondary
881
+ }],
882
+ children: "Leave"
883
+ })]
884
+ })]
885
+ })]
886
+ });
887
+ }
888
+ const styles = StyleSheet.create({
889
+ container: {
890
+ flex: 1
891
+ },
892
+ header: {
893
+ flexDirection: 'row',
894
+ alignItems: 'center',
895
+ paddingHorizontal: 16,
896
+ paddingVertical: 12,
897
+ borderBottomWidth: 1
898
+ },
899
+ headerButton: {
900
+ padding: 4
901
+ },
902
+ headerCenter: {
903
+ flex: 1,
904
+ flexDirection: 'row',
905
+ alignItems: 'center',
906
+ justifyContent: 'center',
907
+ gap: 8
908
+ },
909
+ headerRight: {
910
+ minWidth: 40,
911
+ alignItems: 'flex-end'
912
+ },
913
+ liveBadge: {
914
+ flexDirection: 'row',
915
+ alignItems: 'center',
916
+ paddingHorizontal: 10,
917
+ paddingVertical: 4,
918
+ borderRadius: 12,
919
+ gap: 5
920
+ },
921
+ liveText: {
922
+ fontSize: 12,
923
+ fontWeight: '700',
924
+ color: '#FFFFFF'
925
+ },
926
+ listenerCount: {
927
+ fontSize: 14,
928
+ fontWeight: '500'
929
+ },
930
+ endButton: {
931
+ paddingHorizontal: 16,
932
+ paddingVertical: 6,
933
+ borderRadius: 16,
934
+ backgroundColor: LIVE_TINT_COLOR
935
+ },
936
+ endButtonText: {
937
+ fontSize: 15,
938
+ fontWeight: '600',
939
+ color: LIVE_COLOR
940
+ },
941
+ roomInfo: {
942
+ paddingHorizontal: 16,
943
+ paddingTop: 16,
944
+ paddingBottom: 8
945
+ },
946
+ roomTitle: {
947
+ fontSize: 32,
948
+ fontWeight: 'bold',
949
+ lineHeight: 38
950
+ },
951
+ roomTopic: {
952
+ fontSize: 14,
953
+ marginTop: 4
954
+ },
955
+ micBanner: {
956
+ flexDirection: 'row',
957
+ alignItems: 'center',
958
+ gap: 8,
959
+ marginHorizontal: 16,
960
+ marginBottom: 4,
961
+ paddingHorizontal: 12,
962
+ paddingVertical: 10,
963
+ borderRadius: 8,
964
+ borderWidth: 1
965
+ },
966
+ micBannerText: {
967
+ flex: 1,
968
+ fontSize: 13,
969
+ fontWeight: '500',
970
+ color: '#856404'
971
+ },
972
+ scrollContent: {
973
+ paddingBottom: 120
974
+ },
975
+ speakerGrid: {
976
+ flexDirection: 'row',
977
+ flexWrap: 'wrap',
978
+ paddingHorizontal: 12,
979
+ paddingTop: 16
980
+ },
981
+ speakerTile: {
982
+ width: '25%',
983
+ alignItems: 'center',
984
+ marginBottom: 20
985
+ },
986
+ muteIndicator: {
987
+ position: 'absolute',
988
+ bottom: 0,
989
+ right: 0,
990
+ width: 22,
991
+ height: 22,
992
+ borderRadius: 11,
993
+ alignItems: 'center',
994
+ justifyContent: 'center',
995
+ borderWidth: 2,
996
+ borderColor: '#FFFFFF'
997
+ },
998
+ speakerName: {
999
+ fontSize: 12,
1000
+ fontWeight: '500',
1001
+ marginTop: 6,
1002
+ textAlign: 'center',
1003
+ maxWidth: 80
1004
+ },
1005
+ roleBadge: {
1006
+ paddingHorizontal: 6,
1007
+ paddingVertical: 2,
1008
+ borderRadius: 4,
1009
+ marginTop: 2
1010
+ },
1011
+ roleBadgeText: {
1012
+ fontSize: 10,
1013
+ fontWeight: '600',
1014
+ color: '#FFFFFF'
1015
+ },
1016
+ listenerSection: {
1017
+ paddingHorizontal: 16,
1018
+ marginTop: 8
1019
+ },
1020
+ listenerHeader: {
1021
+ fontSize: 14,
1022
+ fontWeight: '600',
1023
+ marginBottom: 12
1024
+ },
1025
+ listenerGrid: {
1026
+ flexDirection: 'row',
1027
+ flexWrap: 'wrap',
1028
+ gap: 12
1029
+ },
1030
+ listenerItem: {
1031
+ marginBottom: 4
1032
+ },
1033
+ requestsSection: {
1034
+ paddingHorizontal: 16,
1035
+ marginTop: 24
1036
+ },
1037
+ requestsHeader: {
1038
+ fontSize: 14,
1039
+ fontWeight: '600',
1040
+ marginBottom: 12
1041
+ },
1042
+ requestRow: {
1043
+ flexDirection: 'row',
1044
+ alignItems: 'center',
1045
+ padding: 12,
1046
+ borderRadius: 12,
1047
+ borderWidth: 1,
1048
+ marginBottom: 8,
1049
+ gap: 10
1050
+ },
1051
+ requestName: {
1052
+ flex: 1,
1053
+ fontSize: 14,
1054
+ fontWeight: '500'
1055
+ },
1056
+ approveBtn: {
1057
+ width: 32,
1058
+ height: 32,
1059
+ borderRadius: 16,
1060
+ alignItems: 'center',
1061
+ justifyContent: 'center'
1062
+ },
1063
+ denyBtn: {
1064
+ width: 32,
1065
+ height: 32,
1066
+ borderRadius: 16,
1067
+ alignItems: 'center',
1068
+ justifyContent: 'center'
1069
+ },
1070
+ controlBar: {
1071
+ flexDirection: 'row',
1072
+ justifyContent: 'center',
1073
+ alignItems: 'flex-start',
1074
+ paddingTop: 12,
1075
+ paddingBottom: 12,
1076
+ paddingHorizontal: 16,
1077
+ borderTopWidth: 1,
1078
+ gap: 20
1079
+ },
1080
+ controlItem: {
1081
+ alignItems: 'center',
1082
+ gap: 4
1083
+ },
1084
+ controlCircle: {
1085
+ width: 52,
1086
+ height: 52,
1087
+ borderRadius: 26,
1088
+ alignItems: 'center',
1089
+ justifyContent: 'center'
1090
+ },
1091
+ leaveCircle: {
1092
+ width: 52,
1093
+ height: 52,
1094
+ borderRadius: 26,
1095
+ alignItems: 'center',
1096
+ justifyContent: 'center'
1097
+ },
1098
+ controlLabel: {
1099
+ fontSize: 11,
1100
+ fontWeight: '500'
1101
+ },
1102
+ streamCard: {
1103
+ marginHorizontal: 16,
1104
+ marginBottom: 4,
1105
+ padding: 10,
1106
+ borderRadius: 12,
1107
+ borderWidth: 1,
1108
+ gap: 8
1109
+ },
1110
+ streamCardRow: {
1111
+ flexDirection: 'row',
1112
+ alignItems: 'center',
1113
+ gap: 10
1114
+ },
1115
+ streamCardImage: {
1116
+ width: 44,
1117
+ height: 44,
1118
+ borderRadius: 8
1119
+ },
1120
+ streamCardIconBox: {
1121
+ width: 44,
1122
+ height: 44,
1123
+ borderRadius: 8,
1124
+ alignItems: 'center',
1125
+ justifyContent: 'center'
1126
+ },
1127
+ streamCardContent: {
1128
+ flex: 1,
1129
+ gap: 2
1130
+ },
1131
+ streamCardTitle: {
1132
+ fontSize: 14,
1133
+ fontWeight: '600'
1134
+ },
1135
+ streamCardDesc: {
1136
+ fontSize: 12
1137
+ },
1138
+ streamCardActions: {
1139
+ flexDirection: 'row',
1140
+ alignItems: 'center',
1141
+ gap: 2
1142
+ },
1143
+ streamCardAction: {
1144
+ padding: 4
1145
+ },
1146
+ streamProgress: {
1147
+ gap: 4
1148
+ },
1149
+ progressTrack: {
1150
+ height: 4,
1151
+ borderRadius: 2,
1152
+ overflow: 'hidden'
1153
+ },
1154
+ progressFill: {
1155
+ height: 4,
1156
+ borderRadius: 2
1157
+ },
1158
+ progressTime: {
1159
+ fontSize: 11,
1160
+ fontWeight: '500',
1161
+ textAlign: 'right'
1162
+ },
1163
+ settingsContent: {
1164
+ paddingHorizontal: 16,
1165
+ paddingTop: 16
1166
+ },
1167
+ settingsItem: {
1168
+ flexDirection: 'row',
1169
+ alignItems: 'center',
1170
+ gap: 14,
1171
+ paddingVertical: 14
1172
+ },
1173
+ settingsItemText: {
1174
+ flex: 1
1175
+ },
1176
+ settingsItemTitle: {
1177
+ fontSize: 16,
1178
+ fontWeight: '600'
1179
+ },
1180
+ settingsItemDesc: {
1181
+ fontSize: 13,
1182
+ marginTop: 2
1183
+ },
1184
+ recordingToggle: {
1185
+ paddingHorizontal: 14,
1186
+ paddingVertical: 6,
1187
+ borderRadius: 14
1188
+ }
1189
+ });
1190
+ //# sourceMappingURL=LiveRoomSheet.js.map