@syra.fm/sdk 0.4.0 → 0.5.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 (307) hide show
  1. package/lib/commonjs/client.js +268 -0
  2. package/lib/commonjs/client.js.map +1 -0
  3. package/lib/commonjs/errors.js +22 -0
  4. package/lib/commonjs/errors.js.map +1 -0
  5. package/lib/commonjs/index.js +63 -0
  6. package/lib/commonjs/index.js.map +1 -0
  7. package/lib/commonjs/index.native.js +28 -0
  8. package/lib/commonjs/index.native.js.map +1 -0
  9. package/lib/commonjs/live/assets/icons/spaces-icon.js +42 -0
  10. package/lib/commonjs/live/assets/icons/spaces-icon.js.map +1 -0
  11. package/lib/commonjs/live/assets/icons/syra-icon.js +43 -0
  12. package/lib/commonjs/live/assets/icons/syra-icon.js.map +1 -0
  13. package/lib/commonjs/live/components/AnimatedPulse.js +38 -0
  14. package/lib/commonjs/live/components/AnimatedPulse.js.map +1 -0
  15. package/lib/commonjs/live/components/AnimatedSpeakerRing.js +90 -0
  16. package/lib/commonjs/live/components/AnimatedSpeakerRing.js.map +1 -0
  17. package/lib/commonjs/live/components/CreateRoomSheet.js +688 -0
  18. package/lib/commonjs/live/components/CreateRoomSheet.js.map +1 -0
  19. package/lib/commonjs/live/components/InsightsPanel.js +333 -0
  20. package/lib/commonjs/live/components/InsightsPanel.js.map +1 -0
  21. package/lib/commonjs/live/components/LiveRoomSheet.js +1195 -0
  22. package/lib/commonjs/live/components/LiveRoomSheet.js.map +1 -0
  23. package/lib/commonjs/live/components/MiniRoomBar.js +161 -0
  24. package/lib/commonjs/live/components/MiniRoomBar.js.map +1 -0
  25. package/lib/commonjs/live/components/PanelHeader.js +57 -0
  26. package/lib/commonjs/live/components/PanelHeader.js.map +1 -0
  27. package/lib/commonjs/live/components/PodcastStreamPicker.js +1190 -0
  28. package/lib/commonjs/live/components/PodcastStreamPicker.js.map +1 -0
  29. package/lib/commonjs/live/components/RecordingCard.js +192 -0
  30. package/lib/commonjs/live/components/RecordingCard.js.map +1 -0
  31. package/lib/commonjs/live/components/RecordingsPanel.js +304 -0
  32. package/lib/commonjs/live/components/RecordingsPanel.js.map +1 -0
  33. package/lib/commonjs/live/components/RoomCard.js +553 -0
  34. package/lib/commonjs/live/components/RoomCard.js.map +1 -0
  35. package/lib/commonjs/live/components/StreamConfigModal.js +656 -0
  36. package/lib/commonjs/live/components/StreamConfigModal.js.map +1 -0
  37. package/lib/commonjs/live/components/StreamConfigPanel.js +822 -0
  38. package/lib/commonjs/live/components/StreamConfigPanel.js.map +1 -0
  39. package/lib/commonjs/live/context/LiveConfigContext.js +46 -0
  40. package/lib/commonjs/live/context/LiveConfigContext.js.map +1 -0
  41. package/lib/commonjs/live/context/LiveRoomContext.js +195 -0
  42. package/lib/commonjs/live/context/LiveRoomContext.js.map +1 -0
  43. package/lib/commonjs/live/hooks/useActiveSpeakers.js +35 -0
  44. package/lib/commonjs/live/hooks/useActiveSpeakers.js.map +1 -0
  45. package/lib/commonjs/live/hooks/useRoomAudio.js +129 -0
  46. package/lib/commonjs/live/hooks/useRoomAudio.js.map +1 -0
  47. package/lib/commonjs/live/hooks/useRoomConnection.js +177 -0
  48. package/lib/commonjs/live/hooks/useRoomConnection.js.map +1 -0
  49. package/lib/commonjs/live/hooks/useRoomManager.js +37 -0
  50. package/lib/commonjs/live/hooks/useRoomManager.js.map +1 -0
  51. package/lib/commonjs/live/hooks/useRoomUsers.js +52 -0
  52. package/lib/commonjs/live/hooks/useRoomUsers.js.map +1 -0
  53. package/lib/commonjs/live/index.js +310 -0
  54. package/lib/commonjs/live/index.js.map +1 -0
  55. package/lib/commonjs/live/services/livekitService.js +20 -0
  56. package/lib/commonjs/live/services/livekitService.js.map +1 -0
  57. package/lib/commonjs/live/services/spaceSocketService.js +181 -0
  58. package/lib/commonjs/live/services/spaceSocketService.js.map +1 -0
  59. package/lib/commonjs/live/services/spacesService.js +642 -0
  60. package/lib/commonjs/live/services/spacesService.js.map +1 -0
  61. package/lib/commonjs/live/types.js +6 -0
  62. package/lib/commonjs/live/types.js.map +1 -0
  63. package/lib/commonjs/live/validation.js +238 -0
  64. package/lib/commonjs/live/validation.js.map +1 -0
  65. package/lib/commonjs/package.json +1 -0
  66. package/{dist/cjs → lib/commonjs}/schema.js +55 -47
  67. package/lib/commonjs/schema.js.map +1 -0
  68. package/lib/module/client.js +264 -0
  69. package/lib/module/client.js.map +1 -0
  70. package/lib/module/errors.js +17 -0
  71. package/lib/module/errors.js.map +1 -0
  72. package/lib/module/index.js +6 -0
  73. package/lib/module/index.js.map +1 -0
  74. package/lib/module/index.native.js +5 -0
  75. package/lib/module/index.native.js.map +1 -0
  76. package/lib/module/live/assets/icons/spaces-icon.js +34 -0
  77. package/lib/module/live/assets/icons/spaces-icon.js.map +1 -0
  78. package/lib/module/live/assets/icons/syra-icon.js +36 -0
  79. package/lib/module/live/assets/icons/syra-icon.js.map +1 -0
  80. package/lib/module/live/components/AnimatedPulse.js +33 -0
  81. package/lib/module/live/components/AnimatedPulse.js.map +1 -0
  82. package/lib/module/live/components/AnimatedSpeakerRing.js +85 -0
  83. package/lib/module/live/components/AnimatedSpeakerRing.js.map +1 -0
  84. package/lib/module/live/components/CreateRoomSheet.js +682 -0
  85. package/lib/module/live/components/CreateRoomSheet.js.map +1 -0
  86. package/lib/module/live/components/InsightsPanel.js +327 -0
  87. package/lib/module/live/components/InsightsPanel.js.map +1 -0
  88. package/lib/module/live/components/LiveRoomSheet.js +1189 -0
  89. package/lib/module/live/components/LiveRoomSheet.js.map +1 -0
  90. package/lib/module/live/components/MiniRoomBar.js +154 -0
  91. package/lib/module/live/components/MiniRoomBar.js.map +1 -0
  92. package/lib/module/live/components/PanelHeader.js +52 -0
  93. package/lib/module/live/components/PanelHeader.js.map +1 -0
  94. package/lib/module/live/components/PodcastStreamPicker.js +1183 -0
  95. package/lib/module/live/components/PodcastStreamPicker.js.map +1 -0
  96. package/lib/module/live/components/RecordingCard.js +187 -0
  97. package/lib/module/live/components/RecordingCard.js.map +1 -0
  98. package/lib/module/live/components/RecordingsPanel.js +298 -0
  99. package/lib/module/live/components/RecordingsPanel.js.map +1 -0
  100. package/lib/module/live/components/RoomCard.js +548 -0
  101. package/lib/module/live/components/RoomCard.js.map +1 -0
  102. package/lib/module/live/components/StreamConfigModal.js +650 -0
  103. package/lib/module/live/components/StreamConfigModal.js.map +1 -0
  104. package/lib/module/live/components/StreamConfigPanel.js +816 -0
  105. package/lib/module/live/components/StreamConfigPanel.js.map +1 -0
  106. package/lib/module/live/context/LiveConfigContext.js +40 -0
  107. package/lib/module/live/context/LiveConfigContext.js.map +1 -0
  108. package/lib/module/live/context/LiveRoomContext.js +189 -0
  109. package/lib/module/live/context/LiveRoomContext.js.map +1 -0
  110. package/lib/module/live/hooks/useActiveSpeakers.js +31 -0
  111. package/lib/module/live/hooks/useActiveSpeakers.js.map +1 -0
  112. package/lib/module/live/hooks/useRoomAudio.js +125 -0
  113. package/lib/module/live/hooks/useRoomAudio.js.map +1 -0
  114. package/lib/module/live/hooks/useRoomConnection.js +173 -0
  115. package/lib/module/live/hooks/useRoomConnection.js.map +1 -0
  116. package/lib/module/live/hooks/useRoomManager.js +32 -0
  117. package/lib/module/live/hooks/useRoomManager.js.map +1 -0
  118. package/lib/module/live/hooks/useRoomUsers.js +46 -0
  119. package/lib/module/live/hooks/useRoomUsers.js.map +1 -0
  120. package/lib/module/live/index.js +38 -0
  121. package/lib/module/live/index.js.map +1 -0
  122. package/lib/module/live/services/livekitService.js +16 -0
  123. package/lib/module/live/services/livekitService.js.map +1 -0
  124. package/lib/module/live/services/spaceSocketService.js +176 -0
  125. package/lib/module/live/services/spaceSocketService.js.map +1 -0
  126. package/lib/module/live/services/spacesService.js +639 -0
  127. package/lib/module/live/services/spacesService.js.map +1 -0
  128. package/lib/module/live/types.js +4 -0
  129. package/lib/module/live/types.js.map +1 -0
  130. package/lib/module/live/validation.js +229 -0
  131. package/lib/module/live/validation.js.map +1 -0
  132. package/lib/module/package.json +1 -0
  133. package/{dist/esm → lib/module}/schema.js +47 -39
  134. package/lib/module/schema.js.map +1 -0
  135. package/{dist/types → lib/typescript/commonjs}/client.d.ts +1 -0
  136. package/lib/typescript/commonjs/client.d.ts.map +1 -0
  137. package/{dist/types → lib/typescript/commonjs}/errors.d.ts +1 -0
  138. package/lib/typescript/commonjs/errors.d.ts.map +1 -0
  139. package/{dist/types → lib/typescript/commonjs}/index.d.ts +1 -0
  140. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/index.native.d.ts +3 -0
  142. package/lib/typescript/commonjs/index.native.d.ts.map +1 -0
  143. package/lib/typescript/commonjs/live/assets/icons/spaces-icon.d.ts +13 -0
  144. package/lib/typescript/commonjs/live/assets/icons/spaces-icon.d.ts.map +1 -0
  145. package/lib/typescript/commonjs/live/assets/icons/syra-icon.d.ts +13 -0
  146. package/lib/typescript/commonjs/live/assets/icons/syra-icon.d.ts.map +1 -0
  147. package/lib/typescript/commonjs/live/components/AnimatedPulse.d.ts +8 -0
  148. package/lib/typescript/commonjs/live/components/AnimatedPulse.d.ts.map +1 -0
  149. package/lib/typescript/commonjs/live/components/AnimatedSpeakerRing.d.ts +10 -0
  150. package/lib/typescript/commonjs/live/components/AnimatedSpeakerRing.d.ts.map +1 -0
  151. package/lib/typescript/commonjs/live/components/CreateRoomSheet.d.ts +26 -0
  152. package/lib/typescript/commonjs/live/components/CreateRoomSheet.d.ts.map +1 -0
  153. package/lib/typescript/commonjs/live/components/InsightsPanel.d.ts +11 -0
  154. package/lib/typescript/commonjs/live/components/InsightsPanel.d.ts.map +1 -0
  155. package/lib/typescript/commonjs/live/components/LiveRoomSheet.d.ts +11 -0
  156. package/lib/typescript/commonjs/live/components/LiveRoomSheet.d.ts.map +1 -0
  157. package/lib/typescript/commonjs/live/components/MiniRoomBar.d.ts +15 -0
  158. package/lib/typescript/commonjs/live/components/MiniRoomBar.d.ts.map +1 -0
  159. package/lib/typescript/commonjs/live/components/PanelHeader.d.ts +10 -0
  160. package/lib/typescript/commonjs/live/components/PanelHeader.d.ts.map +1 -0
  161. package/lib/typescript/commonjs/live/components/PodcastStreamPicker.d.ts +54 -0
  162. package/lib/typescript/commonjs/live/components/PodcastStreamPicker.d.ts.map +1 -0
  163. package/lib/typescript/commonjs/live/components/RecordingCard.d.ts +11 -0
  164. package/lib/typescript/commonjs/live/components/RecordingCard.d.ts.map +1 -0
  165. package/lib/typescript/commonjs/live/components/RecordingsPanel.d.ts +12 -0
  166. package/lib/typescript/commonjs/live/components/RecordingsPanel.d.ts.map +1 -0
  167. package/lib/typescript/commonjs/live/components/RoomCard.d.ts +38 -0
  168. package/lib/typescript/commonjs/live/components/RoomCard.d.ts.map +1 -0
  169. package/lib/typescript/commonjs/live/components/StreamConfigModal.d.ts +11 -0
  170. package/lib/typescript/commonjs/live/components/StreamConfigModal.d.ts.map +1 -0
  171. package/lib/typescript/commonjs/live/components/StreamConfigPanel.d.ts +13 -0
  172. package/lib/typescript/commonjs/live/components/StreamConfigPanel.d.ts.map +1 -0
  173. package/lib/typescript/commonjs/live/context/LiveConfigContext.d.ts +78 -0
  174. package/lib/typescript/commonjs/live/context/LiveConfigContext.d.ts.map +1 -0
  175. package/lib/typescript/commonjs/live/context/LiveRoomContext.d.ts +12 -0
  176. package/lib/typescript/commonjs/live/context/LiveRoomContext.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/live/hooks/useActiveSpeakers.d.ts +3 -0
  178. package/lib/typescript/commonjs/live/hooks/useActiveSpeakers.d.ts.map +1 -0
  179. package/lib/typescript/commonjs/live/hooks/useRoomAudio.d.ts +16 -0
  180. package/lib/typescript/commonjs/live/hooks/useRoomAudio.d.ts.map +1 -0
  181. package/lib/typescript/commonjs/live/hooks/useRoomConnection.d.ts +29 -0
  182. package/lib/typescript/commonjs/live/hooks/useRoomConnection.d.ts.map +1 -0
  183. package/lib/typescript/commonjs/live/hooks/useRoomManager.d.ts +11 -0
  184. package/lib/typescript/commonjs/live/hooks/useRoomManager.d.ts.map +1 -0
  185. package/lib/typescript/commonjs/live/hooks/useRoomUsers.d.ts +5 -0
  186. package/lib/typescript/commonjs/live/hooks/useRoomUsers.d.ts.map +1 -0
  187. package/lib/typescript/commonjs/live/index.d.ts +24 -0
  188. package/lib/typescript/commonjs/live/index.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/live/services/livekitService.d.ts +7 -0
  190. package/lib/typescript/commonjs/live/services/livekitService.d.ts.map +1 -0
  191. package/lib/typescript/commonjs/live/services/spaceSocketService.d.ts +69 -0
  192. package/lib/typescript/commonjs/live/services/spaceSocketService.d.ts.map +1 -0
  193. package/lib/typescript/commonjs/live/services/spacesService.d.ts +181 -0
  194. package/lib/typescript/commonjs/live/services/spacesService.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/live/types.d.ts +100 -0
  196. package/lib/typescript/commonjs/live/types.d.ts.map +1 -0
  197. package/lib/typescript/commonjs/live/validation.d.ts +658 -0
  198. package/lib/typescript/commonjs/live/validation.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/package.json +1 -0
  200. package/{dist/types → lib/typescript/commonjs}/schema.d.ts +1 -0
  201. package/lib/typescript/commonjs/schema.d.ts.map +1 -0
  202. package/lib/typescript/module/client.d.ts +141 -0
  203. package/lib/typescript/module/client.d.ts.map +1 -0
  204. package/lib/typescript/module/errors.d.ts +9 -0
  205. package/lib/typescript/module/errors.d.ts.map +1 -0
  206. package/lib/typescript/module/index.d.ts +6 -0
  207. package/lib/typescript/module/index.d.ts.map +1 -0
  208. package/lib/typescript/module/index.native.d.ts +3 -0
  209. package/lib/typescript/module/index.native.d.ts.map +1 -0
  210. package/lib/typescript/module/live/assets/icons/spaces-icon.d.ts +13 -0
  211. package/lib/typescript/module/live/assets/icons/spaces-icon.d.ts.map +1 -0
  212. package/lib/typescript/module/live/assets/icons/syra-icon.d.ts +13 -0
  213. package/lib/typescript/module/live/assets/icons/syra-icon.d.ts.map +1 -0
  214. package/lib/typescript/module/live/components/AnimatedPulse.d.ts +8 -0
  215. package/lib/typescript/module/live/components/AnimatedPulse.d.ts.map +1 -0
  216. package/lib/typescript/module/live/components/AnimatedSpeakerRing.d.ts +10 -0
  217. package/lib/typescript/module/live/components/AnimatedSpeakerRing.d.ts.map +1 -0
  218. package/lib/typescript/module/live/components/CreateRoomSheet.d.ts +26 -0
  219. package/lib/typescript/module/live/components/CreateRoomSheet.d.ts.map +1 -0
  220. package/lib/typescript/module/live/components/InsightsPanel.d.ts +11 -0
  221. package/lib/typescript/module/live/components/InsightsPanel.d.ts.map +1 -0
  222. package/lib/typescript/module/live/components/LiveRoomSheet.d.ts +11 -0
  223. package/lib/typescript/module/live/components/LiveRoomSheet.d.ts.map +1 -0
  224. package/lib/typescript/module/live/components/MiniRoomBar.d.ts +15 -0
  225. package/lib/typescript/module/live/components/MiniRoomBar.d.ts.map +1 -0
  226. package/lib/typescript/module/live/components/PanelHeader.d.ts +10 -0
  227. package/lib/typescript/module/live/components/PanelHeader.d.ts.map +1 -0
  228. package/lib/typescript/module/live/components/PodcastStreamPicker.d.ts +54 -0
  229. package/lib/typescript/module/live/components/PodcastStreamPicker.d.ts.map +1 -0
  230. package/lib/typescript/module/live/components/RecordingCard.d.ts +11 -0
  231. package/lib/typescript/module/live/components/RecordingCard.d.ts.map +1 -0
  232. package/lib/typescript/module/live/components/RecordingsPanel.d.ts +12 -0
  233. package/lib/typescript/module/live/components/RecordingsPanel.d.ts.map +1 -0
  234. package/lib/typescript/module/live/components/RoomCard.d.ts +38 -0
  235. package/lib/typescript/module/live/components/RoomCard.d.ts.map +1 -0
  236. package/lib/typescript/module/live/components/StreamConfigModal.d.ts +11 -0
  237. package/lib/typescript/module/live/components/StreamConfigModal.d.ts.map +1 -0
  238. package/lib/typescript/module/live/components/StreamConfigPanel.d.ts +13 -0
  239. package/lib/typescript/module/live/components/StreamConfigPanel.d.ts.map +1 -0
  240. package/lib/typescript/module/live/context/LiveConfigContext.d.ts +78 -0
  241. package/lib/typescript/module/live/context/LiveConfigContext.d.ts.map +1 -0
  242. package/lib/typescript/module/live/context/LiveRoomContext.d.ts +12 -0
  243. package/lib/typescript/module/live/context/LiveRoomContext.d.ts.map +1 -0
  244. package/lib/typescript/module/live/hooks/useActiveSpeakers.d.ts +3 -0
  245. package/lib/typescript/module/live/hooks/useActiveSpeakers.d.ts.map +1 -0
  246. package/lib/typescript/module/live/hooks/useRoomAudio.d.ts +16 -0
  247. package/lib/typescript/module/live/hooks/useRoomAudio.d.ts.map +1 -0
  248. package/lib/typescript/module/live/hooks/useRoomConnection.d.ts +29 -0
  249. package/lib/typescript/module/live/hooks/useRoomConnection.d.ts.map +1 -0
  250. package/lib/typescript/module/live/hooks/useRoomManager.d.ts +11 -0
  251. package/lib/typescript/module/live/hooks/useRoomManager.d.ts.map +1 -0
  252. package/lib/typescript/module/live/hooks/useRoomUsers.d.ts +5 -0
  253. package/lib/typescript/module/live/hooks/useRoomUsers.d.ts.map +1 -0
  254. package/lib/typescript/module/live/index.d.ts +24 -0
  255. package/lib/typescript/module/live/index.d.ts.map +1 -0
  256. package/lib/typescript/module/live/services/livekitService.d.ts +7 -0
  257. package/lib/typescript/module/live/services/livekitService.d.ts.map +1 -0
  258. package/lib/typescript/module/live/services/spaceSocketService.d.ts +69 -0
  259. package/lib/typescript/module/live/services/spaceSocketService.d.ts.map +1 -0
  260. package/lib/typescript/module/live/services/spacesService.d.ts +181 -0
  261. package/lib/typescript/module/live/services/spacesService.d.ts.map +1 -0
  262. package/lib/typescript/module/live/types.d.ts +100 -0
  263. package/lib/typescript/module/live/types.d.ts.map +1 -0
  264. package/lib/typescript/module/live/validation.d.ts +658 -0
  265. package/lib/typescript/module/live/validation.d.ts.map +1 -0
  266. package/lib/typescript/module/package.json +1 -0
  267. package/lib/typescript/module/schema.d.ts +1072 -0
  268. package/lib/typescript/module/schema.d.ts.map +1 -0
  269. package/package.json +133 -21
  270. package/src/index.native.ts +2 -0
  271. package/src/live/assets/icons/spaces-icon.tsx +15 -0
  272. package/src/live/assets/icons/syra-icon.tsx +13 -0
  273. package/src/live/assets/sounds/intro.mp3 +0 -0
  274. package/src/live/components/AnimatedPulse.tsx +52 -0
  275. package/src/live/components/AnimatedSpeakerRing.tsx +101 -0
  276. package/src/live/components/CreateRoomSheet.tsx +654 -0
  277. package/src/live/components/InsightsPanel.tsx +202 -0
  278. package/src/live/components/LiveRoomSheet.tsx +969 -0
  279. package/src/live/components/MiniRoomBar.tsx +166 -0
  280. package/src/live/components/PanelHeader.tsx +36 -0
  281. package/src/live/components/PodcastStreamPicker.tsx +1155 -0
  282. package/src/live/components/RecordingCard.tsx +154 -0
  283. package/src/live/components/RecordingsPanel.tsx +251 -0
  284. package/src/live/components/RoomCard.tsx +494 -0
  285. package/src/live/components/StreamConfigModal.tsx +600 -0
  286. package/src/live/components/StreamConfigPanel.tsx +729 -0
  287. package/src/live/context/LiveConfigContext.tsx +96 -0
  288. package/src/live/context/LiveRoomContext.tsx +235 -0
  289. package/src/live/hooks/useActiveSpeakers.ts +39 -0
  290. package/src/live/hooks/useRoomAudio.ts +103 -0
  291. package/src/live/hooks/useRoomConnection.ts +162 -0
  292. package/src/live/hooks/useRoomManager.ts +17 -0
  293. package/src/live/hooks/useRoomUsers.ts +52 -0
  294. package/src/live/index.ts +92 -0
  295. package/src/live/services/livekitService.ts +11 -0
  296. package/src/live/services/spaceSocketService.ts +136 -0
  297. package/src/live/services/spacesService.ts +692 -0
  298. package/src/live/types.ts +119 -0
  299. package/src/live/validation.ts +279 -0
  300. package/dist/cjs/client.js +0 -244
  301. package/dist/cjs/errors.js +0 -16
  302. package/dist/cjs/index.js +0 -15
  303. package/dist/cjs/package.json +0 -3
  304. package/dist/esm/client.js +0 -240
  305. package/dist/esm/errors.js +0 -12
  306. package/dist/esm/index.js +0 -3
  307. package/dist/esm/package.json +0 -3
@@ -0,0 +1,822 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StreamConfigPanel = StreamConfigPanel;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _MaterialCommunityIcons = _interopRequireDefault(require("@expo/vector-icons/MaterialCommunityIcons"));
10
+ var ImagePicker = _interopRequireWildcard(require("expo-image-picker"));
11
+ var _LiveConfigContext = require("../context/LiveConfigContext.js");
12
+ var _PanelHeader = require("./PanelHeader.js");
13
+ var _PodcastStreamPicker = require("./PodcastStreamPicker.js");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
17
+ function appendNativeFile(formData, file) {
18
+ const nativeFormData = formData;
19
+ nativeFormData.append('file', file);
20
+ }
21
+ function StreamConfigPanel({
22
+ roomId,
23
+ roomStatus,
24
+ initialStreamUrl,
25
+ initialRtmpUrl,
26
+ initialStreamKey,
27
+ onClose,
28
+ onStreamStarted
29
+ }) {
30
+ const {
31
+ useTheme,
32
+ roomsService,
33
+ toast,
34
+ onRoomChanged
35
+ } = (0, _LiveConfigContext.useLiveConfig)();
36
+ const theme = useTheme();
37
+ const initialUrl = initialStreamUrl?.trim() ?? '';
38
+ const hasExistingKey = !!initialStreamKey;
39
+ const isEditingUrlStream = roomStatus === 'live' && initialUrl.length > 0;
40
+ const [mode, setMode] = (0, _react.useState)(hasExistingKey ? 'rtmp' : 'url');
41
+ const [loading, setLoading] = (0, _react.useState)(false);
42
+ const [streamUrl, setStreamUrl] = (0, _react.useState)(initialUrl);
43
+ const [rtmpUrl, setRtmpUrl] = (0, _react.useState)(initialRtmpUrl || null);
44
+ const [streamKey, setStreamKey] = (0, _react.useState)(initialStreamKey || null);
45
+ const [generatingKey, setGeneratingKey] = (0, _react.useState)(false);
46
+ const [title, setTitle] = (0, _react.useState)('');
47
+ const [description, setDescription] = (0, _react.useState)('');
48
+ const [imageCdnUrl, setImageCdnUrl] = (0, _react.useState)(null);
49
+ const [imagePreviewUri, setImagePreviewUri] = (0, _react.useState)(null);
50
+ const [uploadingImage, setUploadingImage] = (0, _react.useState)(false);
51
+ const resetState = () => {
52
+ setStreamUrl('');
53
+ setRtmpUrl(null);
54
+ setStreamKey(null);
55
+ setTitle('');
56
+ setDescription('');
57
+ setImageCdnUrl(null);
58
+ setImagePreviewUri(null);
59
+ setMode('url');
60
+ };
61
+ const handlePickImage = async () => {
62
+ try {
63
+ const result = await ImagePicker.launchImageLibraryAsync({
64
+ mediaTypes: ['images'],
65
+ quality: 0.8,
66
+ allowsEditing: true,
67
+ aspect: [16, 9]
68
+ });
69
+ if (result.canceled || !result.assets?.[0]) return;
70
+ const asset = result.assets[0];
71
+ setImagePreviewUri(asset.uri);
72
+ setUploadingImage(true);
73
+ try {
74
+ const formData = new FormData();
75
+ if (_reactNative.Platform.OS === 'web') {
76
+ const response = await fetch(asset.uri);
77
+ const blob = await response.blob();
78
+ formData.append('file', new File([blob], 'stream-cover.jpg', {
79
+ type: asset.mimeType || 'image/jpeg'
80
+ }));
81
+ } else {
82
+ const nativeFile = {
83
+ uri: asset.uri,
84
+ name: 'stream-cover.jpg',
85
+ type: asset.mimeType || 'image/jpeg'
86
+ };
87
+ appendNativeFile(formData, nativeFile);
88
+ }
89
+ const cdnUrl = await roomsService.uploadRoomImage(roomId, formData);
90
+ if (cdnUrl) {
91
+ setImageCdnUrl(cdnUrl);
92
+ } else {
93
+ toast.error('Failed to upload image');
94
+ setImagePreviewUri(null);
95
+ }
96
+ } catch (err) {
97
+ console.error('Image upload error:', err);
98
+ toast.error('Failed to upload image');
99
+ setImagePreviewUri(null);
100
+ } finally {
101
+ setUploadingImage(false);
102
+ }
103
+ } catch (err) {
104
+ console.error('Image picker error:', err);
105
+ toast.error('Could not open image picker');
106
+ }
107
+ };
108
+ const ensureRoomLive = async () => {
109
+ if (roomStatus === 'live') return true;
110
+ if (roomStatus === 'scheduled') {
111
+ const started = await roomsService.startRoom(roomId);
112
+ if (!started) {
113
+ toast.error('Failed to start room');
114
+ return false;
115
+ }
116
+ onRoomChanged?.(roomId);
117
+ return true;
118
+ }
119
+ toast.error('Room cannot be started');
120
+ return false;
121
+ };
122
+ const handleStartUrlStream = async () => {
123
+ if (!streamUrl.trim() || loading) return;
124
+ setLoading(true);
125
+ try {
126
+ if (!(await ensureRoomLive())) return;
127
+ const result = await roomsService.startStream(roomId, {
128
+ url: streamUrl.trim(),
129
+ title: title.trim() || undefined,
130
+ image: imageCdnUrl || undefined,
131
+ description: description.trim() || undefined
132
+ });
133
+ if (result) {
134
+ toast.success('Stream started');
135
+ resetState();
136
+ onStreamStarted();
137
+ onClose();
138
+ } else {
139
+ toast.error('Failed to start stream');
140
+ }
141
+ } catch {
142
+ toast.error('Failed to start stream');
143
+ } finally {
144
+ setLoading(false);
145
+ }
146
+ };
147
+ const handleStartPodcast = async (syraPodcastId, episodeId) => {
148
+ if (loading) return;
149
+ setLoading(true);
150
+ try {
151
+ if (!(await ensureRoomLive())) return;
152
+ const result = await roomsService.startPodcastStream(roomId, {
153
+ syraPodcastId,
154
+ episodeId
155
+ });
156
+ if (result) {
157
+ toast.success('Stream started');
158
+ resetState();
159
+ onStreamStarted();
160
+ onClose();
161
+ } else {
162
+ toast.error('Failed to start stream');
163
+ }
164
+ } catch {
165
+ toast.error('Failed to start stream');
166
+ } finally {
167
+ setLoading(false);
168
+ }
169
+ };
170
+
171
+ // Start a multi-episode session: the first episode plays now, the rest are
172
+ // persisted as the room's up-next queue.
173
+ const handleStartPodcastQueue = async items => {
174
+ if (loading || items.length === 0) return;
175
+ const [first, ...rest] = items;
176
+ setLoading(true);
177
+ try {
178
+ if (!(await ensureRoomLive())) return;
179
+ const result = await roomsService.startPodcastStream(roomId, {
180
+ syraPodcastId: first.syraPodcastId,
181
+ episodeId: first.episodeId,
182
+ queue: rest
183
+ });
184
+ if (result) {
185
+ toast.success('Stream started');
186
+ resetState();
187
+ onStreamStarted();
188
+ onClose();
189
+ } else {
190
+ toast.error('Failed to start stream');
191
+ }
192
+ } catch {
193
+ toast.error('Failed to start stream');
194
+ } finally {
195
+ setLoading(false);
196
+ }
197
+ };
198
+
199
+ // Stream a single Syra track into the room (a "listening party").
200
+ const handleStartTrack = async trackId => {
201
+ if (loading) return;
202
+ setLoading(true);
203
+ try {
204
+ if (!(await ensureRoomLive())) return;
205
+ const result = await roomsService.startTrackStream(roomId, {
206
+ trackId
207
+ });
208
+ if (result) {
209
+ toast.success('Stream started');
210
+ resetState();
211
+ onStreamStarted();
212
+ onClose();
213
+ } else {
214
+ toast.error('Failed to start stream');
215
+ }
216
+ } catch {
217
+ toast.error('Failed to start stream');
218
+ } finally {
219
+ setLoading(false);
220
+ }
221
+ };
222
+
223
+ // Start a multi-track session: the first track plays now, the rest are
224
+ // persisted as the room's up-next queue.
225
+ const handleStartTrackQueue = async trackIds => {
226
+ if (loading || trackIds.length === 0) return;
227
+ const [first, ...rest] = trackIds;
228
+ setLoading(true);
229
+ try {
230
+ if (!(await ensureRoomLive())) return;
231
+ const result = await roomsService.startTrackStream(roomId, {
232
+ trackId: first,
233
+ queue: rest.map(trackId => ({
234
+ trackId
235
+ }))
236
+ });
237
+ if (result) {
238
+ toast.success('Stream started');
239
+ resetState();
240
+ onStreamStarted();
241
+ onClose();
242
+ } else {
243
+ toast.error('Failed to start stream');
244
+ }
245
+ } catch {
246
+ toast.error('Failed to start stream');
247
+ } finally {
248
+ setLoading(false);
249
+ }
250
+ };
251
+ const generatingRef = (0, _react.useRef)(false);
252
+ const generateKey = async () => {
253
+ if (generatingRef.current) return;
254
+ generatingRef.current = true;
255
+ setGeneratingKey(true);
256
+ try {
257
+ if (!(await ensureRoomLive())) return;
258
+ const result = await roomsService.generateStreamKey(roomId, {
259
+ title: title.trim() || undefined,
260
+ image: imageCdnUrl || undefined,
261
+ description: description.trim() || undefined
262
+ });
263
+ if (result?.streamKey) {
264
+ setRtmpUrl(result.rtmpUrl || '');
265
+ setStreamKey(result.streamKey);
266
+ } else {
267
+ console.error('Generate stream key response:', JSON.stringify(result, null, 2));
268
+ toast.error('Failed to generate stream key');
269
+ }
270
+ } catch (err) {
271
+ console.error('Generate stream key error:', err);
272
+ const msg = err instanceof Error ? err.message : 'Unknown error';
273
+ toast.error(`Stream key error: ${msg}`);
274
+ } finally {
275
+ setGeneratingKey(false);
276
+ generatingRef.current = false;
277
+ }
278
+ };
279
+
280
+ // Auto-generate RTMP credentials when switching to the External App tab
281
+ (0, _react.useEffect)(() => {
282
+ if (mode === 'rtmp' && !streamKey && !generatingRef.current) {
283
+ generateKey();
284
+ }
285
+ // eslint-disable-next-line react-hooks/exhaustive-deps
286
+ }, [mode]);
287
+ const handleUpdateMetadata = async () => {
288
+ if (loading) return;
289
+ const trimmedUrl = streamUrl.trim();
290
+ if (mode === 'url' && !trimmedUrl) {
291
+ toast.error('Stream URL is required');
292
+ return;
293
+ }
294
+ setLoading(true);
295
+ try {
296
+ const success = await roomsService.updateStreamMetadata(roomId, {
297
+ ...(mode === 'url' ? {
298
+ url: trimmedUrl
299
+ } : {}),
300
+ title: title.trim() || undefined,
301
+ image: imageCdnUrl || undefined,
302
+ description: description.trim() || undefined
303
+ });
304
+ if (success) {
305
+ toast.success('Stream info updated');
306
+ onStreamStarted();
307
+ } else {
308
+ toast.error('Failed to update stream info');
309
+ }
310
+ } catch {
311
+ toast.error('Failed to update stream info');
312
+ } finally {
313
+ setLoading(false);
314
+ }
315
+ };
316
+ const copyToClipboard = async (text, label) => {
317
+ try {
318
+ if (_reactNative.Platform.OS === 'web') {
319
+ await navigator.clipboard.writeText(text);
320
+ } else {
321
+ const {
322
+ Clipboard
323
+ } = require('react-native');
324
+ Clipboard.setString(text);
325
+ }
326
+ toast.success(`${label} copied`);
327
+ } catch {
328
+ toast.error('Failed to copy');
329
+ }
330
+ };
331
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
332
+ style: styles.container,
333
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PanelHeader.PanelHeader, {
334
+ title: "Stream Setup",
335
+ theme: theme,
336
+ onBack: onClose
337
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
338
+ style: styles.modeSelector,
339
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
340
+ style: [styles.modeTab, {
341
+ borderColor: theme.colors.border
342
+ }, mode === 'url' && {
343
+ backgroundColor: theme.colors.primary,
344
+ borderColor: theme.colors.primary
345
+ }],
346
+ onPress: () => setMode('url'),
347
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_MaterialCommunityIcons.default, {
348
+ name: "link",
349
+ size: 16,
350
+ color: mode === 'url' ? '#FFFFFF' : theme.colors.text
351
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
352
+ style: [styles.modeTabText, {
353
+ color: mode === 'url' ? '#FFFFFF' : theme.colors.text
354
+ }],
355
+ children: "Stream URL"
356
+ })]
357
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
358
+ style: [styles.modeTab, {
359
+ borderColor: theme.colors.border
360
+ }, mode === 'rtmp' && {
361
+ backgroundColor: theme.colors.primary,
362
+ borderColor: theme.colors.primary
363
+ }],
364
+ onPress: () => setMode('rtmp'),
365
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_MaterialCommunityIcons.default, {
366
+ name: "key",
367
+ size: 16,
368
+ color: mode === 'rtmp' ? '#FFFFFF' : theme.colors.text
369
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
370
+ style: [styles.modeTabText, {
371
+ color: mode === 'rtmp' ? '#FFFFFF' : theme.colors.text
372
+ }],
373
+ children: "External App"
374
+ })]
375
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
376
+ style: [styles.modeTab, {
377
+ borderColor: theme.colors.border
378
+ }, mode === 'podcast' && {
379
+ backgroundColor: theme.colors.primary,
380
+ borderColor: theme.colors.primary
381
+ }],
382
+ onPress: () => setMode('podcast'),
383
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_MaterialCommunityIcons.default, {
384
+ name: "podcast",
385
+ size: 16,
386
+ color: mode === 'podcast' ? '#FFFFFF' : theme.colors.text
387
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
388
+ style: [styles.modeTabText, {
389
+ color: mode === 'podcast' ? '#FFFFFF' : theme.colors.text
390
+ }],
391
+ children: "Podcast"
392
+ })]
393
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
394
+ style: [styles.modeTab, {
395
+ borderColor: theme.colors.border
396
+ }, mode === 'music' && {
397
+ backgroundColor: theme.colors.primary,
398
+ borderColor: theme.colors.primary
399
+ }],
400
+ onPress: () => setMode('music'),
401
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_MaterialCommunityIcons.default, {
402
+ name: "music",
403
+ size: 16,
404
+ color: mode === 'music' ? '#FFFFFF' : theme.colors.text
405
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
406
+ style: [styles.modeTabText, {
407
+ color: mode === 'music' ? '#FFFFFF' : theme.colors.text
408
+ }],
409
+ children: "Music"
410
+ })]
411
+ })]
412
+ }), mode === 'podcast' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_PodcastStreamPicker.PodcastStreamPicker, {
413
+ onSelectEpisode: handleStartPodcast,
414
+ onStartQueue: handleStartPodcastQueue
415
+ }) : mode === 'music' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_PodcastStreamPicker.MusicPicker, {
416
+ onSelectTrack: handleStartTrack,
417
+ onStartQueue: handleStartTrackQueue
418
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
419
+ style: {
420
+ flex: 1
421
+ },
422
+ contentContainerStyle: styles.scrollContent,
423
+ showsVerticalScrollIndicator: false,
424
+ keyboardShouldPersistTaps: "handled",
425
+ children: [mode === 'url' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
426
+ style: styles.section,
427
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
428
+ style: [styles.input, {
429
+ backgroundColor: `${theme.colors.card}80`,
430
+ borderColor: theme.colors.border,
431
+ color: theme.colors.text
432
+ }],
433
+ placeholder: "Stream URL (m3u8, Icecast, etc.)",
434
+ placeholderTextColor: theme.colors.textSecondary,
435
+ value: streamUrl,
436
+ onChangeText: setStreamUrl,
437
+ autoCapitalize: "none",
438
+ autoCorrect: false,
439
+ keyboardType: "url"
440
+ })
441
+ }), mode === 'rtmp' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
442
+ style: styles.section,
443
+ children: !streamKey ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
444
+ style: styles.loadingBox,
445
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
446
+ size: "small",
447
+ color: theme.colors.primary
448
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
449
+ style: [styles.loadingText, {
450
+ color: theme.colors.textSecondary
451
+ }],
452
+ children: "Generating stream key..."
453
+ })]
454
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
455
+ style: styles.credentialsBox,
456
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
457
+ style: [styles.credLabel, {
458
+ color: theme.colors.textSecondary
459
+ }],
460
+ children: "RTMP URL"
461
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
462
+ style: [styles.credRow, {
463
+ backgroundColor: `${theme.colors.card}80`,
464
+ borderColor: theme.colors.border
465
+ }],
466
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
467
+ style: [styles.credValue, {
468
+ color: theme.colors.text
469
+ }],
470
+ numberOfLines: 1,
471
+ children: rtmpUrl
472
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
473
+ onPress: () => copyToClipboard(rtmpUrl ?? '', 'RTMP URL'),
474
+ style: styles.copyBtn,
475
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MaterialCommunityIcons.default, {
476
+ name: "content-copy",
477
+ size: 18,
478
+ color: theme.colors.primary
479
+ })
480
+ })]
481
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
482
+ style: [styles.credLabel, {
483
+ color: theme.colors.textSecondary,
484
+ marginTop: 12
485
+ }],
486
+ children: "Stream Key"
487
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
488
+ style: [styles.credRow, {
489
+ backgroundColor: `${theme.colors.card}80`,
490
+ borderColor: theme.colors.border
491
+ }],
492
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
493
+ style: [styles.credValue, {
494
+ color: theme.colors.text
495
+ }],
496
+ numberOfLines: 1,
497
+ children: streamKey
498
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
499
+ onPress: () => {
500
+ if (streamKey) copyToClipboard(streamKey, 'Stream key');
501
+ },
502
+ style: styles.copyBtn,
503
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MaterialCommunityIcons.default, {
504
+ name: "content-copy",
505
+ size: 18,
506
+ color: theme.colors.primary
507
+ })
508
+ })]
509
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
510
+ style: styles.infoRow,
511
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_MaterialCommunityIcons.default, {
512
+ name: "information",
513
+ size: 16,
514
+ color: theme.colors.textSecondary
515
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
516
+ style: [styles.infoText, {
517
+ color: theme.colors.textSecondary
518
+ }],
519
+ children: "Use these in OBS or your streaming app. Audio will play in the room once you start streaming."
520
+ })]
521
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
522
+ style: styles.regenerateBtn,
523
+ onPress: () => {
524
+ setStreamKey(null);
525
+ setRtmpUrl(null);
526
+ generateKey();
527
+ },
528
+ disabled: generatingKey,
529
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_MaterialCommunityIcons.default, {
530
+ name: "refresh",
531
+ size: 16,
532
+ color: theme.colors.textSecondary
533
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
534
+ style: [styles.regenerateText, {
535
+ color: theme.colors.textSecondary
536
+ }],
537
+ children: "Regenerate key"
538
+ })]
539
+ })]
540
+ })
541
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
542
+ style: styles.section,
543
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
544
+ style: [styles.sectionLabel, {
545
+ color: theme.colors.textSecondary
546
+ }],
547
+ children: "Stream Info (optional)"
548
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
549
+ style: [styles.input, {
550
+ backgroundColor: `${theme.colors.card}80`,
551
+ borderColor: theme.colors.border,
552
+ color: theme.colors.text
553
+ }],
554
+ placeholder: "Title",
555
+ placeholderTextColor: theme.colors.textSecondary,
556
+ value: title,
557
+ onChangeText: setTitle,
558
+ maxLength: 200
559
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
560
+ style: [styles.imagePicker, {
561
+ backgroundColor: `${theme.colors.card}80`,
562
+ borderColor: theme.colors.border
563
+ }],
564
+ onPress: handlePickImage,
565
+ disabled: uploadingImage,
566
+ children: [imagePreviewUri ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
567
+ source: {
568
+ uri: imagePreviewUri
569
+ },
570
+ style: styles.imagePreview
571
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
572
+ style: styles.imagePickerPlaceholder,
573
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_MaterialCommunityIcons.default, {
574
+ name: "image",
575
+ size: 24,
576
+ color: theme.colors.textSecondary
577
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
578
+ style: [styles.imagePickerText, {
579
+ color: theme.colors.textSecondary
580
+ }],
581
+ children: "Cover image"
582
+ })]
583
+ }), uploadingImage && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
584
+ style: styles.imageOverlay,
585
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
586
+ size: "small",
587
+ color: "#FFFFFF"
588
+ })
589
+ })]
590
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
591
+ style: [styles.input, styles.inputMultiline, {
592
+ backgroundColor: `${theme.colors.card}80`,
593
+ borderColor: theme.colors.border,
594
+ color: theme.colors.text
595
+ }],
596
+ placeholder: "Description",
597
+ placeholderTextColor: theme.colors.textSecondary,
598
+ value: description,
599
+ onChangeText: setDescription,
600
+ maxLength: 500,
601
+ multiline: true,
602
+ numberOfLines: 2
603
+ })]
604
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
605
+ style: styles.footer,
606
+ children: [mode === 'url' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
607
+ style: [styles.startBtn, {
608
+ backgroundColor: streamUrl.trim() ? theme.colors.primary : theme.colors.backgroundSecondary,
609
+ opacity: loading ? 0.6 : 1
610
+ }],
611
+ onPress: isEditingUrlStream ? handleUpdateMetadata : handleStartUrlStream,
612
+ disabled: !streamUrl.trim() || loading,
613
+ children: [loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
614
+ size: "small",
615
+ color: "#FFFFFF"
616
+ }) : isEditingUrlStream ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_MaterialCommunityIcons.default, {
617
+ name: "content-save",
618
+ size: 18,
619
+ color: streamUrl.trim() ? '#FFFFFF' : theme.colors.textSecondary
620
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_MaterialCommunityIcons.default, {
621
+ name: "play",
622
+ size: 18,
623
+ color: streamUrl.trim() ? '#FFFFFF' : theme.colors.textSecondary
624
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
625
+ style: {
626
+ color: streamUrl.trim() ? '#FFFFFF' : theme.colors.textSecondary,
627
+ fontWeight: '600',
628
+ fontSize: 16
629
+ },
630
+ children: isEditingUrlStream ? 'Save Stream Info' : 'Start Stream'
631
+ })]
632
+ }), mode === 'rtmp' && streamKey && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
633
+ style: [styles.startBtn, {
634
+ backgroundColor: theme.colors.primary,
635
+ opacity: loading ? 0.6 : 1
636
+ }],
637
+ onPress: handleUpdateMetadata,
638
+ disabled: loading,
639
+ children: [loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
640
+ size: "small",
641
+ color: "#FFFFFF"
642
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_MaterialCommunityIcons.default, {
643
+ name: "content-save",
644
+ size: 18,
645
+ color: "#FFFFFF"
646
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
647
+ style: {
648
+ color: '#FFFFFF',
649
+ fontWeight: '600',
650
+ fontSize: 16
651
+ },
652
+ children: "Save Stream Info"
653
+ })]
654
+ })]
655
+ })]
656
+ })]
657
+ });
658
+ }
659
+ const styles = _reactNative.StyleSheet.create({
660
+ container: {
661
+ flex: 1
662
+ },
663
+ scrollContent: {
664
+ paddingBottom: 32
665
+ },
666
+ modeSelector: {
667
+ flexDirection: 'row',
668
+ gap: 10,
669
+ paddingHorizontal: 16,
670
+ paddingTop: 16,
671
+ paddingBottom: 8
672
+ },
673
+ modeTab: {
674
+ flex: 1,
675
+ flexDirection: 'row',
676
+ alignItems: 'center',
677
+ justifyContent: 'center',
678
+ gap: 6,
679
+ paddingVertical: 10,
680
+ borderRadius: 10,
681
+ borderWidth: 1
682
+ },
683
+ modeTabText: {
684
+ fontSize: 14,
685
+ fontWeight: '600'
686
+ },
687
+ section: {
688
+ paddingHorizontal: 16,
689
+ paddingTop: 12,
690
+ gap: 10
691
+ },
692
+ sectionLabel: {
693
+ fontSize: 13,
694
+ fontWeight: '600',
695
+ textTransform: 'uppercase',
696
+ letterSpacing: 0.5,
697
+ marginBottom: 2
698
+ },
699
+ input: {
700
+ borderWidth: 1,
701
+ borderRadius: 10,
702
+ paddingHorizontal: 14,
703
+ paddingVertical: 12,
704
+ fontSize: 15
705
+ },
706
+ inputMultiline: {
707
+ minHeight: 60,
708
+ textAlignVertical: 'top'
709
+ },
710
+ imagePicker: {
711
+ borderWidth: 1,
712
+ borderRadius: 10,
713
+ overflow: 'hidden',
714
+ height: 100
715
+ },
716
+ imagePreview: {
717
+ width: '100%',
718
+ height: '100%',
719
+ resizeMode: 'cover'
720
+ },
721
+ imagePickerPlaceholder: {
722
+ flex: 1,
723
+ alignItems: 'center',
724
+ justifyContent: 'center',
725
+ gap: 4
726
+ },
727
+ imagePickerText: {
728
+ fontSize: 13,
729
+ fontWeight: '500'
730
+ },
731
+ imageOverlay: {
732
+ ..._reactNative.StyleSheet.absoluteFill,
733
+ backgroundColor: 'rgba(0,0,0,0.4)',
734
+ alignItems: 'center',
735
+ justifyContent: 'center'
736
+ },
737
+ generateBtn: {
738
+ flexDirection: 'row',
739
+ alignItems: 'center',
740
+ justifyContent: 'center',
741
+ gap: 8,
742
+ paddingVertical: 14,
743
+ borderRadius: 10
744
+ },
745
+ generateBtnText: {
746
+ color: '#FFFFFF',
747
+ fontSize: 16,
748
+ fontWeight: '600'
749
+ },
750
+ loadingBox: {
751
+ alignItems: 'center',
752
+ justifyContent: 'center',
753
+ gap: 10,
754
+ paddingVertical: 24
755
+ },
756
+ loadingText: {
757
+ fontSize: 14
758
+ },
759
+ credentialsBox: {
760
+ gap: 4
761
+ },
762
+ regenerateBtn: {
763
+ flexDirection: 'row',
764
+ alignItems: 'center',
765
+ justifyContent: 'center',
766
+ gap: 6,
767
+ marginTop: 12,
768
+ paddingVertical: 8
769
+ },
770
+ regenerateText: {
771
+ fontSize: 13,
772
+ fontWeight: '500'
773
+ },
774
+ credLabel: {
775
+ fontSize: 12,
776
+ fontWeight: '600',
777
+ textTransform: 'uppercase',
778
+ letterSpacing: 0.5
779
+ },
780
+ credRow: {
781
+ flexDirection: 'row',
782
+ alignItems: 'center',
783
+ borderWidth: 1,
784
+ borderRadius: 10,
785
+ paddingLeft: 14,
786
+ paddingRight: 4,
787
+ paddingVertical: 4
788
+ },
789
+ credValue: {
790
+ flex: 1,
791
+ fontSize: 13,
792
+ fontFamily: _reactNative.Platform.OS === 'ios' ? 'Menlo' : 'monospace'
793
+ },
794
+ copyBtn: {
795
+ padding: 10
796
+ },
797
+ infoRow: {
798
+ flexDirection: 'row',
799
+ alignItems: 'flex-start',
800
+ gap: 6,
801
+ marginTop: 10
802
+ },
803
+ infoText: {
804
+ flex: 1,
805
+ fontSize: 13,
806
+ lineHeight: 18
807
+ },
808
+ footer: {
809
+ paddingHorizontal: 16,
810
+ paddingTop: 20,
811
+ paddingBottom: 40
812
+ },
813
+ startBtn: {
814
+ flexDirection: 'row',
815
+ alignItems: 'center',
816
+ justifyContent: 'center',
817
+ gap: 8,
818
+ paddingVertical: 14,
819
+ borderRadius: 12
820
+ }
821
+ });
822
+ //# sourceMappingURL=StreamConfigPanel.js.map