@mrksbnc/livekit-vue 0.0.2 → 1.0.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 (514) hide show
  1. package/README.md +46 -30
  2. package/dist/background/BackgroundEffectSelect.vue.d.cts +55 -0
  3. package/dist/background/BackgroundEffectSelect.vue.d.mts +55 -0
  4. package/dist/background/index.d.cts +3 -0
  5. package/dist/background/index.d.mts +3 -0
  6. package/dist/background.cjs +2 -0
  7. package/dist/background.cjs.map +1 -0
  8. package/dist/background.js +239 -0
  9. package/dist/background.js.map +1 -0
  10. package/dist/components/chat/ChatEntry.vue.d.cts +16 -0
  11. package/dist/components/chat/ChatEntry.vue.d.mts +16 -0
  12. package/dist/components/chat/chat.utils.d.cts +3 -0
  13. package/dist/components/chat/chat.utils.d.mts +3 -0
  14. package/dist/components/chat/index.d.cts +3 -0
  15. package/dist/components/chat/index.d.mts +3 -0
  16. package/dist/components/chat/render-node.d.cts +8 -0
  17. package/dist/components/chat/render-node.d.mts +8 -0
  18. package/dist/components/context/ParticipantContextProvider.vue.d.cts +16 -0
  19. package/dist/components/context/ParticipantContextProvider.vue.d.mts +16 -0
  20. package/dist/components/context/RoomContextProvider.vue.d.cts +16 -0
  21. package/dist/components/context/RoomContextProvider.vue.d.mts +16 -0
  22. package/dist/components/context/SessionProvider.vue.d.cts +16 -0
  23. package/dist/components/context/SessionProvider.vue.d.mts +16 -0
  24. package/dist/components/context/TrackRefContextProvider.vue.d.cts +16 -0
  25. package/dist/components/context/TrackRefContextProvider.vue.d.mts +16 -0
  26. package/dist/components/context/index.d.cts +4 -0
  27. package/dist/components/context/index.d.mts +4 -0
  28. package/dist/components/controls/ChatToggle.vue.d.cts +17 -0
  29. package/dist/components/controls/ChatToggle.vue.d.mts +17 -0
  30. package/dist/components/controls/ClearPinButton.vue.d.cts +22 -0
  31. package/dist/components/controls/ClearPinButton.vue.d.mts +22 -0
  32. package/dist/components/controls/DisconnectButton.vue.d.cts +18 -0
  33. package/dist/components/controls/DisconnectButton.vue.d.mts +18 -0
  34. package/dist/components/controls/FocusToggle.vue.d.cts +19 -0
  35. package/dist/components/controls/FocusToggle.vue.d.mts +19 -0
  36. package/dist/components/controls/MediaDeviceSelect.vue.d.cts +45 -0
  37. package/dist/components/controls/MediaDeviceSelect.vue.d.mts +45 -0
  38. package/dist/components/controls/PaginationControl.vue.d.cts +18 -0
  39. package/dist/components/controls/PaginationControl.vue.d.mts +18 -0
  40. package/dist/components/controls/PaginationIndicator.vue.d.cts +8 -0
  41. package/dist/components/controls/PaginationIndicator.vue.d.mts +8 -0
  42. package/dist/components/controls/SettingsMenuToggle.vue.d.cts +16 -0
  43. package/dist/components/controls/SettingsMenuToggle.vue.d.mts +16 -0
  44. package/dist/components/controls/StartAudio.vue.d.cts +21 -0
  45. package/dist/components/controls/StartAudio.vue.d.mts +21 -0
  46. package/dist/components/controls/StartMediaButton.vue.d.cts +24 -0
  47. package/dist/components/controls/StartMediaButton.vue.d.mts +24 -0
  48. package/dist/components/controls/TrackToggle.vue.d.cts +43 -0
  49. package/dist/components/controls/TrackToggle.vue.d.mts +43 -0
  50. package/dist/components/controls/VideoQualitySelect.vue.d.cts +33 -0
  51. package/dist/components/controls/VideoQualitySelect.vue.d.mts +33 -0
  52. package/dist/components/controls/index.d.cts +24 -0
  53. package/dist/components/controls/index.d.mts +24 -0
  54. package/dist/components/icons/CameraDisabledIcon.vue.d.cts +3 -0
  55. package/dist/components/icons/CameraDisabledIcon.vue.d.mts +3 -0
  56. package/dist/components/icons/CameraIcon.vue.d.cts +3 -0
  57. package/dist/components/icons/CameraIcon.vue.d.mts +3 -0
  58. package/dist/components/icons/ChatCloseIcon.vue.d.cts +3 -0
  59. package/dist/components/icons/ChatCloseIcon.vue.d.mts +3 -0
  60. package/dist/components/icons/ChatIcon.vue.d.cts +3 -0
  61. package/dist/components/icons/ChatIcon.vue.d.mts +3 -0
  62. package/dist/components/icons/ChevronIcon.vue.d.cts +3 -0
  63. package/dist/components/icons/ChevronIcon.vue.d.mts +3 -0
  64. package/dist/components/icons/FocusToggleIcon.vue.d.cts +3 -0
  65. package/dist/components/icons/FocusToggleIcon.vue.d.mts +3 -0
  66. package/dist/components/icons/GearIcon.vue.d.cts +3 -0
  67. package/dist/components/icons/GearIcon.vue.d.mts +3 -0
  68. package/dist/components/icons/LeaveIcon.vue.d.cts +3 -0
  69. package/dist/components/icons/LeaveIcon.vue.d.mts +3 -0
  70. package/dist/components/icons/LockLockedIcon.vue.d.cts +3 -0
  71. package/dist/components/icons/LockLockedIcon.vue.d.mts +3 -0
  72. package/dist/components/icons/MicDisabledIcon.vue.d.cts +3 -0
  73. package/dist/components/icons/MicDisabledIcon.vue.d.mts +3 -0
  74. package/dist/components/icons/MicIcon.vue.d.cts +3 -0
  75. package/dist/components/icons/MicIcon.vue.d.mts +3 -0
  76. package/dist/components/icons/ParticipantPlaceholder.vue.d.cts +3 -0
  77. package/dist/components/icons/ParticipantPlaceholder.vue.d.mts +3 -0
  78. package/dist/components/icons/QualityExcellentIcon.vue.d.cts +3 -0
  79. package/dist/components/icons/QualityExcellentIcon.vue.d.mts +3 -0
  80. package/dist/components/icons/QualityGoodIcon.vue.d.cts +3 -0
  81. package/dist/components/icons/QualityGoodIcon.vue.d.mts +3 -0
  82. package/dist/components/icons/QualityPoorIcon.vue.d.cts +3 -0
  83. package/dist/components/icons/QualityPoorIcon.vue.d.mts +3 -0
  84. package/dist/components/icons/QualityUnknownIcon.vue.d.cts +3 -0
  85. package/dist/components/icons/QualityUnknownIcon.vue.d.mts +3 -0
  86. package/dist/components/icons/ScreenShareIcon.vue.d.cts +3 -0
  87. package/dist/components/icons/ScreenShareIcon.vue.d.mts +3 -0
  88. package/dist/components/icons/ScreenShareStopIcon.vue.d.cts +3 -0
  89. package/dist/components/icons/ScreenShareStopIcon.vue.d.mts +3 -0
  90. package/dist/components/icons/SpinnerIcon.vue.d.cts +3 -0
  91. package/dist/components/icons/SpinnerIcon.vue.d.mts +3 -0
  92. package/dist/components/icons/UnfocusToggleIcon.vue.d.cts +3 -0
  93. package/dist/components/icons/UnfocusToggleIcon.vue.d.mts +3 -0
  94. package/dist/components/icons/index.d.cts +21 -0
  95. package/dist/components/icons/index.d.mts +21 -0
  96. package/dist/components/icons/utils.d.cts +4 -0
  97. package/dist/components/icons/utils.d.mts +4 -0
  98. package/dist/components/index.d.cts +9 -0
  99. package/dist/components/index.d.mts +9 -0
  100. package/dist/components/layout/CarouselLayout.vue.d.cts +24 -0
  101. package/dist/components/layout/CarouselLayout.vue.d.mts +24 -0
  102. package/dist/components/layout/FocusLayout.vue.d.cts +16 -0
  103. package/dist/components/layout/FocusLayout.vue.d.mts +16 -0
  104. package/dist/components/layout/FocusLayoutContainer.vue.d.cts +14 -0
  105. package/dist/components/layout/FocusLayoutContainer.vue.d.mts +14 -0
  106. package/dist/components/layout/GridLayout.vue.d.cts +24 -0
  107. package/dist/components/layout/GridLayout.vue.d.mts +24 -0
  108. package/dist/components/layout/LayoutContextProvider.vue.d.cts +27 -0
  109. package/dist/components/layout/LayoutContextProvider.vue.d.mts +27 -0
  110. package/dist/components/layout/index.d.cts +10 -0
  111. package/dist/components/layout/index.d.mts +10 -0
  112. package/dist/components/participant/AudioTrack.vue.d.cts +17 -0
  113. package/dist/components/participant/AudioTrack.vue.d.mts +17 -0
  114. package/dist/components/participant/AudioVisualizer.vue.d.cts +10 -0
  115. package/dist/components/participant/AudioVisualizer.vue.d.mts +10 -0
  116. package/dist/components/participant/BarVisualizer.vue.d.cts +46 -0
  117. package/dist/components/participant/BarVisualizer.vue.d.mts +46 -0
  118. package/dist/components/participant/ConnectionQualityIndicator.vue.d.cts +19 -0
  119. package/dist/components/participant/ConnectionQualityIndicator.vue.d.mts +19 -0
  120. package/dist/components/participant/ParticipantAudioTile.vue.d.cts +23 -0
  121. package/dist/components/participant/ParticipantAudioTile.vue.d.mts +23 -0
  122. package/dist/components/participant/ParticipantAvatar.vue.d.cts +10 -0
  123. package/dist/components/participant/ParticipantAvatar.vue.d.mts +10 -0
  124. package/dist/components/participant/ParticipantName.vue.d.cts +17 -0
  125. package/dist/components/participant/ParticipantName.vue.d.mts +17 -0
  126. package/dist/components/participant/ParticipantTile.vue.d.cts +27 -0
  127. package/dist/components/participant/ParticipantTile.vue.d.mts +27 -0
  128. package/dist/components/participant/TrackMutedIndicator.vue.d.cts +22 -0
  129. package/dist/components/participant/TrackMutedIndicator.vue.d.mts +22 -0
  130. package/dist/components/participant/VideoTrack.vue.d.cts +17 -0
  131. package/dist/components/participant/VideoTrack.vue.d.mts +17 -0
  132. package/dist/components/participant/index.d.cts +19 -0
  133. package/dist/components/participant/index.d.mts +19 -0
  134. package/dist/components/prefabs/AudioConference.vue.d.cts +26 -0
  135. package/dist/components/prefabs/AudioConference.vue.d.mts +26 -0
  136. package/dist/components/prefabs/Chat.vue.d.cts +36 -0
  137. package/dist/components/prefabs/Chat.vue.d.mts +36 -0
  138. package/dist/components/prefabs/ControlBar.vue.d.cts +52 -0
  139. package/dist/components/prefabs/ControlBar.vue.d.mts +52 -0
  140. package/dist/components/prefabs/MediaDeviceMenu.vue.d.cts +46 -0
  141. package/dist/components/prefabs/MediaDeviceMenu.vue.d.mts +46 -0
  142. package/dist/components/prefabs/PreJoin.vue.d.cts +45 -0
  143. package/dist/components/prefabs/PreJoin.vue.d.mts +45 -0
  144. package/dist/components/prefabs/VideoConference.vue.d.cts +28 -0
  145. package/dist/components/prefabs/VideoConference.vue.d.mts +28 -0
  146. package/dist/components/prefabs/VoiceAssistantControlBar.vue.d.cts +33 -0
  147. package/dist/components/prefabs/VoiceAssistantControlBar.vue.d.mts +33 -0
  148. package/dist/components/prefabs/index.d.cts +14 -0
  149. package/dist/components/prefabs/index.d.mts +14 -0
  150. package/dist/components/room/ConnectionStateToast.vue.d.cts +8 -0
  151. package/dist/components/room/ConnectionStateToast.vue.d.mts +8 -0
  152. package/dist/components/room/ConnectionStatus.vue.d.cts +19 -0
  153. package/dist/components/room/ConnectionStatus.vue.d.mts +19 -0
  154. package/dist/components/room/LiveKitRoom.vue.d.cts +47 -0
  155. package/dist/components/room/LiveKitRoom.vue.d.mts +47 -0
  156. package/dist/components/room/ParticipantLoop.vue.d.cts +18 -0
  157. package/dist/components/room/ParticipantLoop.vue.d.mts +18 -0
  158. package/dist/components/room/RoomAudioRenderer.vue.d.cts +13 -0
  159. package/dist/components/room/RoomAudioRenderer.vue.d.mts +13 -0
  160. package/dist/components/room/RoomName.vue.d.cts +20 -0
  161. package/dist/components/room/RoomName.vue.d.mts +20 -0
  162. package/dist/components/room/Toast.vue.d.cts +14 -0
  163. package/dist/components/room/Toast.vue.d.mts +14 -0
  164. package/dist/components/room/TrackLoop.vue.d.cts +18 -0
  165. package/dist/components/room/TrackLoop.vue.d.mts +18 -0
  166. package/dist/components/room/index.d.cts +16 -0
  167. package/dist/components/room/index.d.mts +16 -0
  168. package/dist/components/style.d.cts +11 -0
  169. package/dist/components/style.d.mts +11 -0
  170. package/dist/composables/index.d.cts +66 -0
  171. package/dist/composables/index.d.mts +66 -0
  172. package/dist/composables/useAgent.d.cts +67 -0
  173. package/dist/composables/useAgent.d.mts +67 -0
  174. package/dist/composables/useAgentExpression.d.cts +20 -0
  175. package/dist/composables/useAgentExpression.d.mts +20 -0
  176. package/dist/composables/useAudioPlayback.d.cts +10 -0
  177. package/dist/composables/useAudioPlayback.d.mts +10 -0
  178. package/dist/composables/useBackgroundEffect.d.cts +43 -0
  179. package/dist/composables/useBackgroundEffect.d.mts +43 -0
  180. package/dist/composables/useBarAnimator.d.cts +11 -0
  181. package/dist/composables/useBarAnimator.d.mts +11 -0
  182. package/dist/composables/useChat.d.cts +13 -0
  183. package/dist/composables/useChat.d.mts +13 -0
  184. package/dist/composables/useChatToggle.d.cts +13 -0
  185. package/dist/composables/useChatToggle.d.mts +13 -0
  186. package/dist/composables/useClearPinButton.d.cts +14 -0
  187. package/dist/composables/useClearPinButton.d.mts +14 -0
  188. package/dist/composables/useConnectionQualityIndicator.d.cts +9 -0
  189. package/dist/composables/useConnectionQualityIndicator.d.mts +9 -0
  190. package/dist/composables/useConnectionState.d.cts +13 -0
  191. package/dist/composables/useConnectionState.d.mts +13 -0
  192. package/dist/composables/useConnectionStatus.d.cts +16 -0
  193. package/dist/composables/useConnectionStatus.d.mts +16 -0
  194. package/dist/composables/useDataChannel.d.cts +14 -0
  195. package/dist/composables/useDataChannel.d.mts +14 -0
  196. package/dist/composables/useDisconnectButton.d.cts +9 -0
  197. package/dist/composables/useDisconnectButton.d.mts +9 -0
  198. package/dist/composables/useEvents.d.cts +15 -0
  199. package/dist/composables/useEvents.d.mts +15 -0
  200. package/dist/composables/useFacingMode.d.cts +17 -0
  201. package/dist/composables/useFacingMode.d.mts +17 -0
  202. package/dist/composables/useFocusToggle.d.cts +14 -0
  203. package/dist/composables/useFocusToggle.d.mts +14 -0
  204. package/dist/composables/useGridLayout.d.cts +13 -0
  205. package/dist/composables/useGridLayout.d.mts +13 -0
  206. package/dist/composables/useIsEncrypted.d.cts +10 -0
  207. package/dist/composables/useIsEncrypted.d.mts +10 -0
  208. package/dist/composables/useIsMuted.d.cts +11 -0
  209. package/dist/composables/useIsMuted.d.mts +11 -0
  210. package/dist/composables/useIsRecording.d.cts +9 -0
  211. package/dist/composables/useIsRecording.d.mts +9 -0
  212. package/dist/composables/useIsSpeaking.d.cts +9 -0
  213. package/dist/composables/useIsSpeaking.d.mts +9 -0
  214. package/dist/composables/useKrispNoiseFilter.d.cts +16 -0
  215. package/dist/composables/useKrispNoiseFilter.d.mts +16 -0
  216. package/dist/composables/useLiveKitRoom.d.cts +15 -0
  217. package/dist/composables/useLiveKitRoom.d.mts +15 -0
  218. package/dist/composables/useLocalParticipant.d.cts +16 -0
  219. package/dist/composables/useLocalParticipant.d.mts +16 -0
  220. package/dist/composables/useLocalParticipantPermissions.d.cts +13 -0
  221. package/dist/composables/useLocalParticipantPermissions.d.mts +13 -0
  222. package/dist/composables/useMediaDeviceSelect.d.cts +16 -0
  223. package/dist/composables/useMediaDeviceSelect.d.mts +16 -0
  224. package/dist/composables/useMediaDevices.d.cts +12 -0
  225. package/dist/composables/useMediaDevices.d.mts +12 -0
  226. package/dist/composables/useMediaTrackBySourceOrName.d.cts +30 -0
  227. package/dist/composables/useMediaTrackBySourceOrName.d.mts +30 -0
  228. package/dist/composables/usePagination.d.cts +26 -0
  229. package/dist/composables/usePagination.d.mts +26 -0
  230. package/dist/composables/useParticipantAttributes.d.cts +14 -0
  231. package/dist/composables/useParticipantAttributes.d.mts +14 -0
  232. package/dist/composables/useParticipantAvatar.d.cts +17 -0
  233. package/dist/composables/useParticipantAvatar.d.mts +17 -0
  234. package/dist/composables/useParticipantInfo.d.cts +14 -0
  235. package/dist/composables/useParticipantInfo.d.mts +14 -0
  236. package/dist/composables/useParticipantPermissions.d.cts +10 -0
  237. package/dist/composables/useParticipantPermissions.d.mts +10 -0
  238. package/dist/composables/useParticipantTile.d.cts +22 -0
  239. package/dist/composables/useParticipantTile.d.mts +22 -0
  240. package/dist/composables/useParticipantTracks.d.cts +12 -0
  241. package/dist/composables/useParticipantTracks.d.mts +12 -0
  242. package/dist/composables/useParticipants.d.cts +11 -0
  243. package/dist/composables/useParticipants.d.mts +11 -0
  244. package/dist/composables/usePersistentUserChoices.d.cts +16 -0
  245. package/dist/composables/usePersistentUserChoices.d.mts +16 -0
  246. package/dist/composables/usePinnedTracks.d.cts +10 -0
  247. package/dist/composables/usePinnedTracks.d.mts +10 -0
  248. package/dist/composables/usePreviewTracks.d.cts +15 -0
  249. package/dist/composables/usePreviewTracks.d.mts +15 -0
  250. package/dist/composables/useRemoteParticipant.d.cts +14 -0
  251. package/dist/composables/useRemoteParticipant.d.mts +14 -0
  252. package/dist/composables/useRemoteParticipants.d.cts +10 -0
  253. package/dist/composables/useRemoteParticipants.d.mts +10 -0
  254. package/dist/composables/useRoomInfo.d.cts +13 -0
  255. package/dist/composables/useRoomInfo.d.mts +13 -0
  256. package/dist/composables/useRpc.d.cts +18 -0
  257. package/dist/composables/useRpc.d.mts +18 -0
  258. package/dist/composables/useSequentialRoomConnectDisconnect.d.cts +10 -0
  259. package/dist/composables/useSequentialRoomConnectDisconnect.d.mts +10 -0
  260. package/dist/composables/useSession.d.cts +83 -0
  261. package/dist/composables/useSession.d.mts +83 -0
  262. package/dist/composables/useSessionMessages.d.cts +22 -0
  263. package/dist/composables/useSessionMessages.d.mts +22 -0
  264. package/dist/composables/useSettingsToggle.d.cts +10 -0
  265. package/dist/composables/useSettingsToggle.d.mts +10 -0
  266. package/dist/composables/useSortedParticipants.d.cts +9 -0
  267. package/dist/composables/useSortedParticipants.d.mts +9 -0
  268. package/dist/composables/useSpeakingParticipants.d.cts +6 -0
  269. package/dist/composables/useSpeakingParticipants.d.mts +6 -0
  270. package/dist/composables/useStartAudio.d.cts +10 -0
  271. package/dist/composables/useStartAudio.d.mts +10 -0
  272. package/dist/composables/useStartVideo.d.cts +10 -0
  273. package/dist/composables/useStartVideo.d.mts +10 -0
  274. package/dist/composables/useSwipe.d.cts +16 -0
  275. package/dist/composables/useSwipe.d.mts +16 -0
  276. package/dist/composables/useTextStream.d.cts +27 -0
  277. package/dist/composables/useTextStream.d.mts +27 -0
  278. package/dist/composables/useToast.d.cts +9 -0
  279. package/dist/composables/useToast.d.mts +9 -0
  280. package/dist/composables/useToken.d.cts +23 -0
  281. package/dist/composables/useToken.d.mts +23 -0
  282. package/dist/composables/useTrack.d.cts +12 -0
  283. package/dist/composables/useTrack.d.mts +12 -0
  284. package/dist/composables/useTrackByName.d.cts +11 -0
  285. package/dist/composables/useTrackByName.d.mts +11 -0
  286. package/dist/composables/useTrackMutedIndicator.d.cts +9 -0
  287. package/dist/composables/useTrackMutedIndicator.d.mts +9 -0
  288. package/dist/composables/useTrackRefBySource.d.cts +9 -0
  289. package/dist/composables/useTrackRefBySource.d.mts +9 -0
  290. package/dist/composables/useTrackRefBySourceOrName.d.cts +7 -0
  291. package/dist/composables/useTrackRefBySourceOrName.d.mts +7 -0
  292. package/dist/composables/useTrackSyncTime.d.cts +13 -0
  293. package/dist/composables/useTrackSyncTime.d.mts +13 -0
  294. package/dist/composables/useTrackToggle.d.cts +28 -0
  295. package/dist/composables/useTrackToggle.d.mts +28 -0
  296. package/dist/composables/useTrackTranscription.d.cts +15 -0
  297. package/dist/composables/useTrackTranscription.d.mts +15 -0
  298. package/dist/composables/useTrackVolume.d.cts +39 -0
  299. package/dist/composables/useTrackVolume.d.mts +39 -0
  300. package/dist/composables/useTracks.d.cts +18 -0
  301. package/dist/composables/useTracks.d.mts +18 -0
  302. package/dist/composables/useTranscriptions.d.cts +12 -0
  303. package/dist/composables/useTranscriptions.d.mts +12 -0
  304. package/dist/composables/useVideoQuality.d.cts +29 -0
  305. package/dist/composables/useVideoQuality.d.mts +29 -0
  306. package/dist/composables/useVisualStableUpdate.d.cts +13 -0
  307. package/dist/composables/useVisualStableUpdate.d.mts +13 -0
  308. package/dist/composables/useVoiceAssistant.d.cts +16 -0
  309. package/dist/composables/useVoiceAssistant.d.mts +16 -0
  310. package/dist/context/connection-state.context.d.cts +18 -0
  311. package/dist/context/connection-state.context.d.mts +18 -0
  312. package/dist/context/error.d.cts +3 -0
  313. package/dist/context/error.d.mts +3 -0
  314. package/dist/context/feature.context.d.cts +8 -0
  315. package/dist/context/feature.context.d.mts +8 -0
  316. package/dist/context/index.d.cts +9 -0
  317. package/dist/context/index.d.mts +9 -0
  318. package/dist/context/layout.context.d.cts +15 -0
  319. package/dist/context/layout.context.d.mts +15 -0
  320. package/dist/context/participant.context.d.cts +8 -0
  321. package/dist/context/participant.context.d.mts +8 -0
  322. package/dist/context/pin.context.d.cts +21 -0
  323. package/dist/context/pin.context.d.mts +21 -0
  324. package/dist/context/room.context.d.cts +8 -0
  325. package/dist/context/room.context.d.mts +8 -0
  326. package/dist/context/session.context.d.cts +8 -0
  327. package/dist/context/session.context.d.mts +8 -0
  328. package/dist/context/toast.context.d.cts +17 -0
  329. package/dist/context/toast.context.d.mts +17 -0
  330. package/dist/context/track-reference.context.d.cts +8 -0
  331. package/dist/context/track-reference.context.d.mts +8 -0
  332. package/dist/context/widget.context.d.cts +21 -0
  333. package/dist/context/widget.context.d.mts +21 -0
  334. package/dist/index.d.cts +6 -0
  335. package/dist/index.d.mts +6 -0
  336. package/dist/internal/emitter.d.cts +17 -0
  337. package/dist/internal/emitter.d.mts +17 -0
  338. package/dist/internal/index.d.cts +4 -0
  339. package/dist/internal/index.d.mts +4 -0
  340. package/dist/internal/observable.d.cts +3 -0
  341. package/dist/internal/observable.d.mts +3 -0
  342. package/dist/internal/permissions.d.cts +4 -0
  343. package/dist/internal/permissions.d.mts +4 -0
  344. package/dist/internal/refs.d.cts +1 -0
  345. package/dist/internal/refs.d.mts +1 -0
  346. package/dist/krisp/index.d.cts +1 -0
  347. package/dist/krisp/index.d.mts +1 -0
  348. package/dist/krisp.cjs +2 -0
  349. package/dist/krisp.cjs.map +1 -0
  350. package/dist/krisp.js +62 -0
  351. package/dist/krisp.js.map +1 -0
  352. package/dist/livekit-vue.cjs +2 -0
  353. package/dist/livekit-vue.cjs.map +1 -0
  354. package/dist/livekit-vue.js +5101 -20542
  355. package/dist/livekit-vue.js.map +1 -0
  356. package/dist/livekit-vue.umd.js +4 -0
  357. package/dist/livekit-vue.umd.js.map +1 -0
  358. package/dist/style-CDggj9VO.js +14 -0
  359. package/dist/style-CDggj9VO.js.map +1 -0
  360. package/dist/style-CkQyDSsh.cjs +2 -0
  361. package/dist/style-CkQyDSsh.cjs.map +1 -0
  362. package/dist/styles.css +2 -0
  363. package/dist/types/agent.types.d.cts +2 -0
  364. package/dist/types/agent.types.d.mts +2 -0
  365. package/dist/types/index.d.cts +3 -0
  366. package/dist/types/index.d.mts +3 -0
  367. package/dist/types/livekit-room.types.d.cts +19 -0
  368. package/dist/types/livekit-room.types.d.mts +19 -0
  369. package/dist/types/participant.types.d.cts +2 -0
  370. package/dist/types/participant.types.d.mts +2 -0
  371. package/dist/useLocalParticipant-ByBAgL8i.js +50 -0
  372. package/dist/useLocalParticipant-ByBAgL8i.js.map +1 -0
  373. package/dist/useLocalParticipant-Dn5NE_KM.cjs +2 -0
  374. package/dist/useLocalParticipant-Dn5NE_KM.cjs.map +1 -0
  375. package/dist/utils/media-choices.utils.d.cts +7 -0
  376. package/dist/utils/media-choices.utils.d.mts +7 -0
  377. package/dist/{src/utils/room.utils.d.ts → utils/room.utils.d.cts} +1 -1
  378. package/dist/utils/room.utils.d.mts +1 -0
  379. package/package.json +103 -66
  380. package/dist/favicon.ico +0 -0
  381. package/dist/index.css +0 -1
  382. package/dist/livekit-vue.umd.cjs +0 -62
  383. package/dist/src/assets/index.d.ts +0 -0
  384. package/dist/src/components/controls/TrackToggle.vue.d.ts +0 -15
  385. package/dist/src/components/controls/buttons.d.ts +0 -4
  386. package/dist/src/components/controls/index.d.ts +0 -3
  387. package/dist/src/components/controls/track_toggle.d.ts +0 -12
  388. package/dist/src/components/icons/ParticipantPlaceholderIcon.vue.d.ts +0 -2
  389. package/dist/src/components/icons/TrackIcon.vue.d.ts +0 -7
  390. package/dist/src/components/index.d.ts +0 -3
  391. package/dist/src/components/participant/audio_track.d.ts +0 -7
  392. package/dist/src/composables/index.d.ts +0 -37
  393. package/dist/src/composables/private/useObservableState.d.ts +0 -8
  394. package/dist/src/composables/useAudioPlayback.d.ts +0 -11
  395. package/dist/src/composables/useClearPinButton.d.ts +0 -5
  396. package/dist/src/composables/useConnectionQualityIndicator.d.ts +0 -10
  397. package/dist/src/composables/useConnectionState.d.ts +0 -3
  398. package/dist/src/composables/useDataChannel.d.ts +0 -15
  399. package/dist/src/composables/useDisconnectButton.d.ts +0 -5
  400. package/dist/src/composables/useFacingMode.d.ts +0 -10
  401. package/dist/src/composables/useFocusToggle.d.ts +0 -11
  402. package/dist/src/composables/useGridLayout.d.ts +0 -10
  403. package/dist/src/composables/useIsEncrypted.d.ts +0 -8
  404. package/dist/src/composables/useIsMuted.d.ts +0 -7
  405. package/dist/src/composables/useIsRecording.d.ts +0 -5
  406. package/dist/src/composables/useIsSpeaking.d.ts +0 -5
  407. package/dist/src/composables/useLiveKitRoom.d.ts +0 -8
  408. package/dist/src/composables/useLocalParticipant.d.ts +0 -16
  409. package/dist/src/composables/useParticipantTile.d.ts +0 -11
  410. package/dist/src/composables/useParticipantTracks.d.ts +0 -4
  411. package/dist/src/composables/useParticipants.d.ts +0 -7
  412. package/dist/src/composables/usePersistentUserChoices.d.ts +0 -16
  413. package/dist/src/composables/usePinnedTracks.d.ts +0 -4
  414. package/dist/src/composables/useRemoteParticipant.d.ts +0 -7
  415. package/dist/src/composables/useRemoteParticipants.d.ts +0 -7
  416. package/dist/src/composables/useRoomInfo.d.ts +0 -13
  417. package/dist/src/composables/useSortedParticipants.d.ts +0 -3
  418. package/dist/src/composables/useSpeakingParticipants.d.ts +0 -3
  419. package/dist/src/composables/useStartAudio.d.ts +0 -11
  420. package/dist/src/composables/useStartVideo.d.ts +0 -11
  421. package/dist/src/composables/useToken.d.ts +0 -10
  422. package/dist/src/composables/useTrack.d.ts +0 -3
  423. package/dist/src/composables/useTrackByName.d.ts +0 -3
  424. package/dist/src/composables/useTrackMutedIndicator.d.ts +0 -6
  425. package/dist/src/composables/useTrackRefBySourceOrName.d.ts +0 -4
  426. package/dist/src/composables/useTrackSyncTime.d.ts +0 -6
  427. package/dist/src/composables/useTrackToggle.d.ts +0 -21
  428. package/dist/src/composables/useTrackVolume.d.ts +0 -28
  429. package/dist/src/composables/useTracks.d.ts +0 -10
  430. package/dist/src/composables/useVisualStableUpdate.d.ts +0 -8
  431. package/dist/src/context/index.d.ts +0 -6
  432. package/dist/src/context/layout.context.d.ts +0 -28
  433. package/dist/src/context/participant.context.d.ts +0 -9
  434. package/dist/src/context/pin.context.d.ts +0 -26
  435. package/dist/src/context/room.context.d.ts +0 -9
  436. package/dist/src/context/track_reference.context.d.ts +0 -6
  437. package/dist/src/context/widget.context.d.ts +0 -7
  438. package/dist/src/index.d.ts +0 -3
  439. package/dist/src/types/livekit_room.types.d.ts +0 -68
  440. package/src/assets/icons/chevron-down.svg +0 -4
  441. package/src/assets/icons/chevron-up.svg +0 -4
  442. package/src/assets/icons/frown.svg +0 -7
  443. package/src/assets/icons/heart.svg +0 -6
  444. package/src/assets/icons/mic-off.svg +0 -8
  445. package/src/assets/icons/mic.svg +0 -7
  446. package/src/assets/icons/phone-hang-up.svg +0 -9
  447. package/src/assets/icons/share-screen-off.svg +0 -6
  448. package/src/assets/icons/share-screen.svg +0 -7
  449. package/src/assets/icons/smile.svg +0 -7
  450. package/src/assets/icons/thumbs-down.svg +0 -6
  451. package/src/assets/icons/thumbs-up.svg +0 -6
  452. package/src/assets/icons/video-off.svg +0 -5
  453. package/src/assets/icons/video.svg +0 -5
  454. package/src/assets/index.ts +0 -1
  455. package/src/assets/placeholders/participant.svg +0 -8
  456. package/src/components/controls/TrackToggle.vue +0 -27
  457. package/src/components/controls/buttons.ts +0 -5
  458. package/src/components/controls/index.ts +0 -3
  459. package/src/components/controls/track_toggle.ts +0 -13
  460. package/src/components/icons/ParticipantPlaceholderIcon.vue +0 -7
  461. package/src/components/icons/TrackIcon.vue +0 -55
  462. package/src/components/index.ts +0 -3
  463. package/src/components/participant/AudioTrack.vue +0 -17
  464. package/src/components/participant/audio_track.ts +0 -8
  465. package/src/composables/index.ts +0 -89
  466. package/src/composables/private/useObservableState.ts +0 -44
  467. package/src/composables/useAudioPlayback.ts +0 -42
  468. package/src/composables/useClearPinButton.ts +0 -41
  469. package/src/composables/useConnectionQualityIndicator.ts +0 -39
  470. package/src/composables/useConnectionState.ts +0 -21
  471. package/src/composables/useDataChannel.ts +0 -56
  472. package/src/composables/useDisconnectButton.ts +0 -28
  473. package/src/composables/useFacingMode.ts +0 -28
  474. package/src/composables/useFocusToggle.ts +0 -38
  475. package/src/composables/useGridLayout.ts +0 -44
  476. package/src/composables/useIsEncrypted.ts +0 -34
  477. package/src/composables/useIsMuted.ts +0 -56
  478. package/src/composables/useIsRecording.ts +0 -30
  479. package/src/composables/useIsSpeaking.ts +0 -23
  480. package/src/composables/useLiveKitRoom.ts +0 -219
  481. package/src/composables/useLocalParticipant.ts +0 -64
  482. package/src/composables/useParticipantTile.ts +0 -68
  483. package/src/composables/useParticipantTracks.ts +0 -36
  484. package/src/composables/useParticipants.ts +0 -25
  485. package/src/composables/usePersistentUserChoices.ts +0 -64
  486. package/src/composables/usePinnedTracks.ts +0 -16
  487. package/src/composables/useRemoteParticipant.ts +0 -42
  488. package/src/composables/useRemoteParticipants.ts +0 -27
  489. package/src/composables/useRoomInfo.ts +0 -42
  490. package/src/composables/useSortedParticipants.ts +0 -21
  491. package/src/composables/useSpeakingParticipants.ts +0 -22
  492. package/src/composables/useStartAudio.ts +0 -53
  493. package/src/composables/useStartVideo.ts +0 -53
  494. package/src/composables/useToken.ts +0 -40
  495. package/src/composables/useTrack.ts +0 -11
  496. package/src/composables/useTrackByName.ts +0 -11
  497. package/src/composables/useTrackMutedIndicator.ts +0 -34
  498. package/src/composables/useTrackRefBySourceOrName.ts +0 -39
  499. package/src/composables/useTrackSyncTime.ts +0 -32
  500. package/src/composables/useTrackToggle.ts +0 -113
  501. package/src/composables/useTrackVolume.ts +0 -268
  502. package/src/composables/useTracks.ts +0 -122
  503. package/src/composables/useVisualStableUpdate.ts +0 -57
  504. package/src/context/index.ts +0 -6
  505. package/src/context/layout.context.ts +0 -46
  506. package/src/context/participant.context.ts +0 -33
  507. package/src/context/pin.context.ts +0 -50
  508. package/src/context/room.context.ts +0 -31
  509. package/src/context/track_reference.context.ts +0 -29
  510. package/src/context/widget.context.ts +0 -17
  511. package/src/index.css +0 -1
  512. package/src/index.ts +0 -5
  513. package/src/types/livekit_room.types.ts +0 -78
  514. package/src/utils/room.utils.ts +0 -9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"livekit-vue.umd.js","names":["computePosition","flip","offset","shift","getComputedStyle","noop","noop","Symbol_observable","Symbol_observable","Symbol_iterator","Symbol_observable","iterator","Symbol_iterator","noop","noop","RoomEvent","ParticipantEvent","loglevel","setClientSdkLogLevel","LogLevelEnum","setClientSdkLogExtension","Track4","startWith2","RoomEvent2","map2","Room","Observable2","startWith3","ParticipantEvent2","map3","Track6","RoomEvent3","Track7","map4","startWith4","getBrowser","Track8","Track9","filter2","map5","BehaviorSubject2","compareVersions","Subject2","RoomEvent4","map6","filter3","BehaviorSubject3","RoomEvent5","map7","startWith5","Observable3","TrackEvent","of2","map8","concat2","Subject3","from2","scan2","h","computed","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","shallowRef","computed","watch","_openBlock","_createElementBlock","_mergeProps","_unref","_toDisplayString","_Fragment","_createTextVNode","_createElementVNode","_createVNode","_renderList","getCurrentScope","onScopeDispose","getCurrentInstance","hasInjectionContext","inject","provide","shallowRef","toValue","shallowReadonly","ref","watch","onMounted","nextTick","isRef","toValue","computed","unref","shallowRef","getCurrentInstance","onMounted","watch","shallowRef","watch","_renderSlot","shallowRef","watch","_renderSlot","shallowRef","watch","_renderSlot","shallowRef","watch","_renderSlot","shallowRef","shallowRef","shallowRef","computed","computed","_openBlock","_createElementBlock","_mergeProps","_unref","_renderSlot","computed","_openBlock","_createElementBlock","_mergeProps","_unref","_renderSlot","ref","ConnectionState","computed","computed","watchEffect","computed","ConnectionState","_openBlock","_createElementBlock","_mergeProps","_unref","_renderSlot","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","computed","_openBlock","_createElementBlock","_mergeProps","_unref","_renderSlot","_createBlock","UnfocusToggleIcon","FocusToggleIcon","shallowRef","ref","shallowRef","computed","Room","ref","watchEffect","_hoisted_2","_useModel","computed","RoomEvent","watch","onMounted","_openBlock","_createElementBlock","_mergeProps","_unref","_Fragment","_renderList","_renderSlot","_createElementVNode","_toDisplayString","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_2","shallowRef","watchEffect","toValue","_openBlock","_createElementBlock","_mergeProps","_unref","_createElementVNode","_createVNode","ChevronIcon","_toDisplayString","props","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_unref","_Fragment","_renderList","computed","_openBlock","_createElementBlock","_mergeProps","_unref","_renderSlot","ref","computed","watchEffect","_unref","_openBlock","_createElementBlock","_mergeProps","_renderSlot","_createTextVNode","_toDisplayString","ref","computed","watchEffect","computed","_unref","_openBlock","_createElementBlock","_mergeProps","_renderSlot","_createTextVNode","_toDisplayString","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createElementBlock","_hoisted_1","_openBlock","_createElementBlock","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","Track","MicIcon","MicDisabledIcon","CameraIcon","CameraDisabledIcon","ScreenShareStopIcon","ScreenShareIcon","ConnectionQuality","QualityExcellentIcon","QualityGoodIcon","QualityPoorIcon","QualityUnknownIcon","ref","computed","watchEffect","watch","_useModel","watch","_openBlock","_createElementBlock","_mergeProps","_unref","_createBlock","_resolveDynamicComponent","_renderSlot","shallowRef","ref","watchEffect","VideoQuality","VideoPresets","ref","Track","RoomEvent","onScopeDispose","_hoisted_3","computed","_openBlock","_createElementBlock","_mergeProps","_unref","_Fragment","_renderList","_renderSlot","_createElementVNode","_toDisplayString","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createElementBlock","LocalParticipant","ref","computed","watchEffect","computed","Track","LocalTrackPublication","facingModeFromLocalTrack","computed","ref","watchEffect","ref","computed","watchEffect","computed","Track","shallowRef","ref","computed","Track","watch","watchEffect","unref","useTemplateRef","computed","watch","RemoteAudioTrack","RemoteTrackPublication","_openBlock","_createElementBlock","_mergeProps","_unref","ref","ConnectionQuality","computed","watchEffect","_openBlock","_createElementBlock","_mergeProps","_unref","_renderSlot","_createBlock","_resolveDynamicComponent","ref","watchEffect","shallowRef","shallowRef","ref","watchEffect","computed","_hoisted_3","ref","computed","_openBlock","_createElementBlock","_mergeProps","_unref","_toDisplayString","_createBlock","ParticipantPlaceholder","computed","_openBlock","_createElementBlock","_mergeProps","_unref","_createTextVNode","_toDisplayString","_renderSlot","ref","computed","watchEffect","computed","_openBlock","_createElementBlock","_mergeProps","_unref","_renderSlot","_createBlock","_resolveDynamicComponent","useTemplateRef","shallowRef","computed","RemoteTrackPublication","watch","onBeforeUnmount","_openBlock","_createElementBlock","_mergeProps","_unref","_hoisted_1","_hoisted_2","_hoisted_3","computed","Track","_openBlock","_createElementBlock","_mergeProps","_unref","_createVNode","TrackRefContextProvider","_withCtx","ParticipantContextProvider","_renderSlot","_createBlock","VideoTrack","AudioTrack","_createElementVNode","ParticipantAvatar","_Fragment","LockLockedIcon","TrackMutedIndicator","ParticipantName","ScreenShareIcon","_createTextVNode","ConnectionQualityIndicator","FocusToggle","_openBlock","_createElementBlock","_Fragment","_renderList","_createBlock","TrackRefContextProvider","_unref","_withCtx","_renderSlot","ref","shallowRef","computed","watchEffect","watch","useTemplateRef","ref","computed","watch","_openBlock","_createElementBlock","_mergeProps","_unref","_createVNode","TrackLoop","_withCtx","_renderSlot","ParticipantTile","_openBlock","_createBlock","ParticipantTile","props","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_unref","_renderSlot","computed","toValue","watchEffect","computed","toValue","ref","watchEffect","ref","toValue","useTemplateRef","watch","_openBlock","_createElementBlock","_mergeProps","_unref","_createVNode","TrackLoop","_withCtx","_renderSlot","ParticipantTile","_Fragment","PaginationIndicator","PaginationControl","watch","_renderSlot","_unref","Track","ref","computed","toValue","watchEffect","createAudioAnalyser","computed","_openBlock","_createElementBlock","_mergeProps","_unref","_createElementVNode","_Fragment","_renderList","ref","computed","toValue","watch","getCurrentScope","onScopeDispose","computed","_openBlock","_createElementBlock","_mergeProps","_unref","_Fragment","_renderList","_renderSlot","_createElementVNode","_hoisted_1","_hoisted_2","computed","_openBlock","_createElementBlock","_mergeProps","_unref","_createVNode","TrackRefContextProvider","_withCtx","ParticipantContextProvider","_renderSlot","_createBlock","AudioTrack","BarVisualizer","_createElementVNode","TrackMutedIndicator","ParticipantName","ConnectionQualityIndicator","props","_openBlock","_createElementBlock","_mergeProps","_unref","_renderSlot","props","computed","ConnectionState","_openBlock","_createBlock","Toast","_normalizeClass","_unref","_withCtx","SpinnerIcon","_createTextVNode","_toDisplayString","Track","shallowRef","computed","watchEffect","ConnectionState","computed","ref","shallowRef","computed","ConnectionState","watchEffect","_hoisted_1","_hoisted_2","useTemplateRef","ref","nextTick","watch","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_unref","_createElementVNode","_renderSlot","_createTextVNode","_createBlock","ChatToggle","_withCtx","_createVNode","ChatCloseIcon","_Fragment","_renderList","ChatEntry","_withModifiers","_withDirectives","_vModelText","shallowRef","watchEffect","ParticipantEvent","ref","watchEffect","$attrs","_useModel","useTemplateRef","ref","watch","watchEffect","_openBlock","_createElementBlock","_Fragment","_createElementVNode","_mergeProps","_unref","_renderSlot","_createBlock","MediaDeviceSelect","_createVNode","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_useSlots","ref","computed","LocalAudioTrack","LocalVideoTrack","Track","_openBlock","_createElementBlock","_mergeProps","_unref","_createVNode","TrackToggle","_withCtx","_Fragment","_createTextVNode","_createElementVNode","MediaDeviceMenu","_renderSlot","_createBlock","_toDisplayString","ChatToggle","ChatIcon","SettingsMenuToggle","GearIcon","DisconnectButton","LeaveIcon","StartMediaButton","_hoisted_1","_hoisted_2","_useSlots","Track","ref","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_unref","_createVNode","LayoutContextProvider","_withCtx","_createElementVNode","TrackLoop","ParticipantAudioTile","ControlBar","_createSlots","_renderSlot","Chat","ConnectionStateToast","Track","ref","shallowRef","computed","watch","createLocalTracks","getCurrentScope","onScopeDispose","_hoisted_1","_hoisted_3","_useSlots","useTemplateRef","ref","computed","facingModeFromLocalTrack","watch","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_unref","_createElementVNode","_renderSlot","_createVNode","ParticipantAvatar","TrackToggle","Track","_withCtx","_createTextVNode","_toDisplayString","MediaDeviceMenu","_withModifiers","_withDirectives","_vModelText","_Fragment","_hoisted_1","Track","computed","_openBlock","_createElementBlock","_Fragment","_renderList","_createBlock","AudioTrack","_unref","computed","_hoisted_1","_hoisted_2","_useSlots","Track","RoomEvent","ref","shallowRef","computed","watch","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_unref","_createBlock","LayoutContextProvider","_withCtx","_createElementVNode","_createVNode","GridLayout","FocusLayoutContainer","CarouselLayout","FocusLayout","ControlBar","_renderSlot","_normalizeStyle","_withKeys","Chat","RoomAudioRenderer","ConnectionStateToast","_hoisted_1","computed","Track","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_unref","_createVNode","TrackToggle","_withCtx","BarVisualizer","_createElementVNode","MediaDeviceMenu","_createBlock","DisconnectButton","_createTextVNode","StartMediaButton","_renderSlot","_openBlock","_createElementBlock","_mergeProps","_unref","_renderSlot","_createTextVNode","_toDisplayString","Track","ref","shallowRef","watch","Room","MediaDeviceFailure","ParticipantEvent","RoomEvent","watchEffect","getCurrentInstance","onBeforeUnmount","_openBlock","_createElementBlock","_mergeProps","_unref","_createBlock","RoomContextProvider","_withCtx","_renderSlot","_openBlock","_createElementBlock","_Fragment","_renderList","_createBlock","ParticipantContextProvider","_withCtx","_renderSlot","ref","watchEffect","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_unref","_renderSlot","_createTextVNode","_toDisplayString","shallowRef","shallowReadonly","watch","toValue","getCurrentScope","onScopeDispose","watch","toValue","getCurrentScope","onScopeDispose","shallowRef","watchEffect","AGENT_SOURCES","Track","isAgentSdkState","isTrackReference","isAgent","ParticipantKind","findTrack","ref","getCurrentScope","onScopeDispose","readonly","shallowRef","computed","ConnectionState","RoomEvent","ParticipantEvent","watch","ref","shallowRef","computed","ConnectionState","watch","getCurrentScope","onScopeDispose","computed","toValue","shallowRef","toValue","watch","ref","computed","watchEffect","ref","shallowRef","computed","watchEffect","ref","computed","watchEffect","shallowRef","ref","watchEffect","computed","shallowRef","computed","watchEffect","shallowRef","computed","watchEffect","RpcError","serializers","getCurrentScope","onScopeDispose","Mutex","toValue","watch","Room","toValue","ExternalE2EEKeyProvider","shallowRef","computed","ConnectionState","TokenSourceConfigurable","decodeTokenPayload","RoomEvent","ParticipantEvent","watch","getCurrentScope","onScopeDispose","Track","readonly","computed","watch","nextTick","shallowRef","watchEffect","shallowRef","watch","toValue","computed","computed","ref","watchEffect","shallowRef","computed","watchEffect","Track","computed","shallowRef","computed","watchEffect","Track","ref","computed","watchEffect","ref","addTimestampsToTranscription","watchEffect","Track","ParticipantKind","computed","ConnectionState","global","factory","exports","livekit_client","vue","__create","__defProp$1","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp$1","__commonJSMin","cb","mod","__copyProps","to","from","except","desc","key","__toESM","isNodeMode","target","min","max","round","floor","createCoords","v","oppositeSideMap","clamp","start","value","end","evaluate","param","getSide","placement","getAlignment","getOppositeAxis","axis","getAxisLength","getSideAxis","firstChar","getAlignmentAxis","getAlignmentSides","rects","rtl","alignment","alignmentAxis","length","mainAlignmentSide","getOppositePlacement","getExpandedPlacements","oppositePlacement","getOppositeAlignmentPlacement","lrPlacement","rlPlacement","tbPlacement","btPlacement","getSideList","side","isStart","getOppositeAxisPlacements","flipAlignment","direction","list","expandPaddingObject","padding","getPaddingObject","rectToClientRect","rect","x","y","width","height","computeCoordsFromPlacement","_ref","reference","floating","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","detectOverflow","state","options","platform","elements","strategy","boundary","rootBoundary","elementContext","altBoundary","paddingObject","element","clippingClientRect","offsetParent","offsetScale","elementClientRect","MAX_RESET_COUNT","computePosition$1","config","middleware","platformWithDetectOverflow","statefulPlacement","resetCount","middlewareData","i","currentMiddleware","name","fn","nextX","nextY","data","reset","flip$1","_middlewareData$arrow","initialPlacement","checkMainAxis","checkCrossAxis","specifiedFallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","detectOverflowOptions","initialSideAxis","isBasePlacement","fallbackPlacements","hasFallbackAxisSideDirection","placements","overflow","overflows","overflowsData","sides","nextIndex","nextPlacement","d","resetPlacement","a","b","currentSideAxis","acc","originSides","convertValueToCoords","mainAxisMulti","crossAxisMulti","rawValue","mainAxis","crossAxis","offset$1","diffCoords","shift$1","limiter","mainAxisCoord","crossAxisCoord","clampCoord","coord","limitedCoords","hasWindow","getNodeName","node","isNode","getWindow","_node$ownerDocument","getDocumentElement","isElement","isHTMLElement","isShadowRoot","isOverflowElement","overflowX","overflowY","display","getComputedStyle$1","isTableElement","isTopLayer","willChangeRe","containRe","isNotNone","isWebKitValue","isContainingBlock","elementOrCss","css","isWebKit","getContainingBlock","currentNode","getParentNode","isLastTraversableNode","getNodeScroll","result","getNearestOverflowAncestor","parentNode","getOverflowAncestors","traverseIframes","scrollableAncestor","isBody","win","frameElement","getFrameElement","getCssDimensions","hasOffset","offsetWidth","offsetHeight","shouldFallback","unwrapElement","getScale","domElement","$","noOffsets","getVisualOffsets","shouldAddVisualOffsets","isFixed","floatingOffsetParent","getBoundingClientRect","includeScale","isFixedStrategy","clientRect","scale","visualOffsets","offsetWin","currentWin","currentIFrame","iframeScale","iframeRect","left","top","getWindowScrollBarX","leftScroll","getHTMLOffset","documentElement","scroll","htmlRect","convertOffsetParentRelativeRectToViewportRelativeRect","topLayer","offsets","isOffsetParentAnElement","offsetRect","htmlOffset","getClientRects","getDocumentRect","html","body","SCROLLBAR_MAX","getViewportRect","isLayoutViewport","visualViewport","layoutRelativeClientCoords","doc","bodyStyles","bodyMarginInline","reservedWidth","gutter","getInnerBoundingClientRect","getClientRectFromClippingAncestor","clippingAncestor","getClippingElementAncestors","cache","cachedResult","el","lastKeptComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","lastPosition","ancestor","getClippingRect","clippingAncestors","firstRect","right","bottom","getDimensions","getRectRelativeToOffsetParent","isStaticPositioned","getTrueOffsetParent","polyfill","rawOffsetParent","getOffsetParent","svgOffsetParent","getElementRects","getOffsetParentFn","floatingDimensions","isRTL","rectsAreEqual","observeMove","onMove","ancestorResize","io","timeoutId","root","cleanup","_io","refresh","skip","threshold","elementRectForRootMargin","insetTop","insetRight","insetBottom","insetLeft","isFirstUpdate","handleObserve","entries","ratio","handleResize","autoUpdate","update","ancestorScroll","elementResize","layoutShift","animationFrame","referenceEl","ancestors","cleanupIo","reobserveFrame","resizeObserver","firstEntry","_resizeObserver","frameId","prevRefRect","frameLoop","nextRefRect","_resizeObserver2","offset","shift","flip","computePosition","mergedOptions","platformWithCache","require_loglevel","module","this$1","define","definition","noop","undefinedType","isIE","logMethods","_loggersByName","defaultLogger","bindMethod","obj","methodName","method","traceForIE","realMethod","replaceLoggingMethods","level","enableLoggingWhenConsoleArrives","defaultMethodFactory","_level","_loggerName","Logger","self","inheritedLevel","defaultLevel","userLevel","storageKey","persistLevelIfPossible","levelNum","levelName","getPersistedLevel","storedLevel","cookie","cookieName","location","clearPersistedLevel","normalizeLevel","input","\"TRACE\"","\"DEBUG\"","\"INFO\"","\"WARN\"","\"ERROR\"","\"SILENT\"","persist","childName","initialLevel","logger","_log","\"default\"","extendStatics","p","__extends","__","__awaiter","thisArg","_arguments","P","generator","adopt","resolve","reject","fulfilled","step","rejected","\"throw\"","__generator","_","t","f","g","verb","\"return\"","n","op","__values","o","s","m","__read","r","ar","e","error","__spreadArray","pack","l","__await","__asyncGenerator","q","awaitReturn","resume","settle","fulfill","__asyncValues","isFunction","createErrorClass","createImpl","ctorFunc","instance","UnsubscriptionError","_super","errors","err","arrRemove","arr","item","index","Subscription","initialTeardown","e_1","_a","e_2","_b","_parentage","_parentage_1","_parentage_1_1","e_1_1","initialFinalizer","_finalizers","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","e_2_1","teardown","parent","empty","EMPTY_SUBSCRIPTION","isSubscription","timeoutProvider","handler","timeout","args","_i","delegate","handle","reportUnhandledError","onUnhandledError","noop$1","COMPLETE_NOTIFICATION","createNotification","errorNotification","nextNotification","kind","context","errorContext","isRoot","errorThrown","captureError","Subscriber","destination","_this","EMPTY_OBSERVER","next","complete","SafeSubscriber","handleStoppedNotification","_bind","bind","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","context_1","defaultErrorHandler","notification","subscriber","onStoppedNotification","observable","identity","pipeFromArray","fns","prev","Observable","subscribe","operator","isSubscriber","source","sink","promiseCtor","getPromiseCtor","operations","isObserver","hasLift","operate","init","liftedSource","createOperatorSubscriber","onNext","onComplete","onError","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","ObjectUnsubscribedError","Subject","subject","AnonymousSubject","_c","observers","hasError","isStopped","thrownError","BehaviorSubject","_value","subscription","dateTimestampProvider","Action","scheduler","work","delay","intervalProvider","AsyncAction","id","_id","_scheduler","_delay","errored","errorValue","actions","Scheduler","schedulerActionCtor","now","asyncScheduler","AsyncScheduler","SchedulerAction","action","isScheduler","last","popScheduler","isArrayLike","isPromise","isInteropObservable","isAsyncIterable","createInvalidObservableTypeError","getSymbolIterator","iterator","isIterable","readableStreamLikeToAsyncGenerator","readableStream","reader","done","isReadableStreamLike","innerFrom","fromInteropObservable","fromArrayLike","fromPromise","fromAsyncIterable","fromIterable","fromReadableStreamLike","obs","array","promise","iterable","iterable_1","iterable_1_1","asyncIterable","process","asyncIterable_1","asyncIterable_1_1","executeSchedule","parentSubscription","repeat","scheduleSubscription","observeOn","subscribeOn","scheduleObservable","schedulePromise","scheduleArray","scheduleIterable","iterator$1","scheduleAsyncIterable","scheduleReadableStreamLike","scheduled","of","isValidDate","TimeoutError","info","schedulerArg","first","each","_with","timeoutErrorFactory","_d","meta","originalSourceSubscription","timerSubscription","lastValue","seen","startTimer","map","project","isArray","callOrApply","mapOneOrManyArgs","mergeInternals","concurrent","onBeforeNext","expand","innerSubScheduler","additionalFinalizer","buffer","active","isComplete","checkComplete","outerNext","doInnerSub","innerComplete","innerValue","_loop_1","bufferedValue","mergeMap","resultSelector","ii","mergeAll","concatAll","concat","nodeEventEmitterMethods","eventTargetMethods","jqueryMethods","fromEvent","eventName","isEventTarget","isNodeStyleEventEmitter","toCommonHandlerRegistry","isJQueryStyleEventEmitter","add","remove","subTarget","filter","predicate","scanInternals","accumulator","seed","hasSeed","emitOnNext","emitBeforeComplete","hasState","concatMap","distinctUntilChanged","comparator","keySelector","defaultCompare","previousKey","currentKey","finalize","callback","scan","share","connector","resetOnError","resetOnComplete","resetOnRefCountZero","wrapperSource","connection","resetConnection","refCount","hasCompleted","hasErrored","cancelReset","resetAndUnsubscribe","conn","dest","handleReset","on","onSubscriber","skipUntil","notifier","taking","skipSubscriber","startWith","values","switchMap","innerSubscriber","innerIndex","outerIndex","takeUntil","tap","tapObserver","isUnsub","import_loglevel","__defProp","__defProps","__getOwnPropDescs","__getOwnPropSymbols","__hasOwnProp","__propIsEnum","__knownSymbol","symbol","__defNormalProp","__spreadValues","prop","__spreadProps","__async","__this","__arguments","__forAwait","it","arg","yes","no","isTrackReference","trackReference","isTrackReferenceSubscribed","isTrackReferencePublished","isTrackReferencePlaceholder","getTrackReferenceId","isEqualTrackRef","isTrackReferencePinned","pinState","pinnedTrackReference","isPlaceholderReplacement","currentTrackRef","nextTrackRef","getScrollBarWidth","inner","outer","w1","w2","isWeb","createUrlRegExp","ip","parens","pathBody","regex2","regex","createEmailRegExp","exact","computeMenuPosition","button","menu","onUpdate","wasClickOutside","insideElement","event","createDefaultGrammar","tokenize","grammar","lastEnd","matches","type","rx","weight","content","tokens","pos","allParticipantRoomEvents","participantTrackEvents","allParticipantEvents","log","GRID_LAYOUTS","selectGridLayout","layoutDefinitions","participantCount","layouts","expandAndSortLayoutDefinitions","currentLayoutIndex","containerOrientation","layout","layout_","allLayouts","isBiggerLayoutAvailable","fitsOrientation","layoutIsBiggerThanCurrent","layoutFitsSameAmountOfParticipants","smallerLayout","supportsScreenSharing","addMediaTimestampToTranscription","segment","timestamps","dedupeSegments","prevSegments","newSegments","windowSize","val","ParticipantAgentAttributes","ParticipantAgentAttributes2","\"AgentState\"","\"PublishOnBehalf\"","\"TranscriptionFinal\"","\"TranscriptionSegmentId\"","\"TranscribedTrackId\"","\"Expression\"","isSourceWitOptions","isSourcesWithOptions","sources","sortParticipantsByAudioLevel","sortParticipantsByIsSpeaking","sortParticipantsByLastSpokenAT","sortParticipantsByJoinedAt","sortParticipants","participants","sortedParticipants","aVideo","localParticipant","localIdx","chunk","size","idx","zip","a1","a2","resultLength","_val","differenceBy","by","c","flatTrackReferenceArray","visualPageChange","listNeedsUpdating","changes","findIndex","trackReferences","indexToReplace","trackReference_","swapItems","moveForward","moveBack","indexReplaceWith","dropItem","itemToDrop","indexOfElementToDrop","addItem","itemToAdd","divideIntoPages","maxElementsOnPage","updatePages","currentList","nextList","maxItemsOnPage","updatedList","refreshList","addedItems","currentPage","nextPage","pageIndex","added","dropped","missingItems","currentItem","newItem_","prefixClass","unprefixedClassName","setupMediaTrack","trackIdentifier","initialPub","getTrackByIdentifier","trackObserver","observeParticipantMedia","participant","pub","observeRoomEvents","room","events","onRoomUpdate","evt","roomEventSelector","params","connectionStateObserver","connectionState","roomInfoObserver","activeSpeakerObserver","speakers","createMediaDeviceObserver","requestPermissions","devices","onDeviceChange","newDevices","_a2","createDataObserver","roomAudioPlaybackAllowedObservable","room2","roomVideoPlaybackAllowedObservable","createActiveDeviceObservable","kindOfDevice","kind2","deviceId","encryptionStatusObservable","encrypted","recordingStatusObservable","recording","observeParticipantEvents","onParticipantUpdate","isMicrophoneEnabled","isCameraEnabled","isScreenShareEnabled","microphoneTrack","participantInfoObserver","metadata","createConnectionQualityObserver","participantEventSelector","quality","mutedObserver","trackRef","createIsSpeakingObserver","isSpeaking","connectedParticipantsObserver","sub","listener","additionalRoomEvents","connectedParticipantObserver","additionalEvents","participantByIdentifierObserver","matchesIdentifier","isMatch","participantAttributesObserver","changedAttributes","setupMediaToggle","publishOptions","getSourceEnabled","source2","localParticipant2","isEnabled","enabledObserver","media","pendingSubject","forceState","captureOptions","setupManualToggle","enabledSubject","setupDeviceSelector","localTrack","activeDeviceSubject","activeDeviceObservable","_0","_1","actualId","browser","actualDeviceId","targetTrack","useDefault","setupDisconnectButton","stopTracks","setupConnectionQualityIndicator","setupTrackMutedIndicator","classForSource","DataTopic","LegacyDataTopic","sendMessage","payload","reliable","destinationIdentities","topic","setupDataMessageHandler","onMessage","topics","messageObservable","messageTopic","msg","isSending$","pendingSends","Future","futureBase","onFinally","topicSubjectMap","streamIdToAttachments","isIgnorableChatMessage","decodeLegacyMsg","message","encodeLegacyMsg","setupChat","serverSupportsDataStreams","legacyTopic","isFirstTopicForRoom","topicMap","needsSetup","topicState","messageSubject","onDestroyObservable","onDestroy","chatTopic","finalMessageDecoder","participantInfo","timestamp","attributes","attachedStreamIds","attachments","id2","chunk2","attachment","attachedFiles","_b2","attachmentStreamId","foundStreamAttachmentPair","streamId","bufferList","iter","more","temp","parsedMessage","messagesObservable","replaceIndex","originalMsg","finalMessageEncoder","options2","legacyChatMsg","receivedChatMsg","encodedLegacyMsg","setupStartAudio","setupStartVideo","getTrackReferences","onlySubscribedTracks","allParticipants","sourceReferences","track","getParticipantTrackRefs","identifier","trackReferencesObservable","participantTracksObservable","participant2","trackEventSelector","publication","trackTranscriptionObserver","trackSyncTimeObserver","timeUpdate","createInteractingObservable","htmlElement","inactiveAfter","move$","moveAndStop$","saveToLocalStorage","nonEmptySettings","value2","loadFromLocalStorage","createLocalStorageInterface","USER_CHOICES_KEY","defaultUserChoices","load","save","saveUserChoices","userChoices","preventSave","loadUserChoices","defaults","preventLoad","fallback","maybeLoadedObject","observableCache","getTopicCache","topicCache","setupTextStream","existingObservable","textStreamsSubject","textStreams","segmentAttribute","sharedObservable","streamObservable","isTranscription","accumulatedText","stream","PROTOCOL_PATTERN","linkHref","isClassName","useStyleAttrs","props","classes","RenderNode","_hoisted_1$50","_hoisted_2$14","_hoisted_3$8","_hoisted_4$3","_hoisted_5$2","_hoisted_6$1","_hoisted_7$1","ChatEntry_default","__props","locale","styleAttrs","images","hasBeenEdited","time","participantName","files","_previous","onCleanup","created","file","image","_ctx","_cache","tryOnScopeDispose","failSilently","localProvidedStateMap","injectLocal","owner","provideLocal","localProvidedState","createInjectionState","composable","defaultValue","isClient","notNullish","toString","isObject","createFilterWrapper","wrapper","debounceFilter","ms","timer","maxTimer","lastRejector","lastResolve","_pending","_clearTimeout","lastInvoker","invoke","duration","maxDuration","toArray","getLifeCycleTarget","useDebounceFn","refDebounced","debounced","updater","tryOnMounted","sync","useIntervalFn","interval","immediate","immediateCallback","isActive","clean","pause","intervalValue","watchImmediate","defaultWindow","unrefElement","elRef","plain","useEventListener","register","firstParamTargets","test","raw_targets","raw_events","raw_listeners","raw_options","optionsClone","cleanups","useMounted","isMounted","useSupported","useResizeObserver","window","observerOptions","observer","isSupported","targets","_targets","stopWatch","els","_el","stop","useElementSize","initialSize","box","isSVG","_unrefElement","stop1","entry","boxSize","$elem","formatBoxSize","inlineSize","blockSize","measure","ele","cs","padX","padY","bdX","bdY","stop2","useIntersectionObserver","rootMargin","NoContextDataProvidedError","useProvideParticipantContext","useParticipantContextRaw","initialValue","useMaybeParticipantContext","useParticipantContext","useEnsureParticipant","ParticipantContextProvider_default","useProvideRoomContext","useRoomContextRaw","useMaybeRoomContext","useRoomContext","useEnsureRoomContext","RoomContextProvider_default","useProvideSessionContext","useSessionContextRaw","useMaybeSessionContext","useSessionContext","useEnsureSession","session","SessionProvider_default","sessionContext","roomContext","useProvideTrackRefContext","useTrackRefContextRaw","ref","useMaybeTrackRefContext","useTrackRefContext","useEnsureTrackRef","TrackRefContextProvider_default","pinReducer","_state","createPinContext","dispatch","useProvidePinContext","usePinContextRaw","usePinContext","DEFAULT_WIDGET_STATE","widgetReducer","createWidgetContext","useProvideWidgetContext","useWidgetContextRaw","useWidgetContext","useProvideLayoutContext","useLayoutContextRaw","initialState","createLayoutContext","useLayoutContext","useMaybeLayoutContext","useEnsureLayoutContext","layoutContext","useChatToggle","isVisible","unreadCount","toggle","show","hide","_hoisted_1$49","ChatToggle_default","unreadLabel","useClearPinButton","handleClick","_hoisted_1$48","ClearPinButton_default","__emit","emits","buttonProps","createConnectionStateContext","isConnecting","isConnected","isReconnecting","isDisconnected","setConnectionState","useProvideConnectionStateContext","useConnectionStateContextRaw","useMaybeConnectionStateContext","useConnectionState","roomEnsured","connectionStateContext","useDisconnectButton","setup","disabled","onClick","_hoisted_1$47","DisconnectButton_default","_plugin_vue_export_helper_default","sfc","_sfc_main$19","_hoisted_1$46","_sfc_render$19","FocusToggleIcon_default","_sfc_main$18","_hoisted_1$45","_sfc_render$18","UnfocusToggleIcon_default","useFocusToggle","inFocus","_hoisted_1$44","FocusToggle_default","useProvideFeatureContext","useFeatureContextRaw","useMaybeFeatureContext","createToastContext","messages","clear","useProvideToastContext","useToastContextRaw","useMaybeToastContext","useToastContext","getMediaDevices","useMediaDeviceSelect","activeDeviceId","deviceSelector","refreshDevices","mediaDevices","setActiveMediaDevice","deviceList","_hoisted_1$43","_hoisted_2$13","MediaDeviceSelect_default","\"activeDeviceId\"","\"activeDeviceIdModifiers\"","activeDeviceModel","handleError","hasDefault","select","initial","device","$event","_sfc_main$17","_hoisted_1$42","_sfc_render$17","ChevronIcon_default","_hoisted_1$41","_hoisted_2$12","PaginationControl_default","interactive","_hoisted_1$40","PaginationIndicator_default","page","useSettingsToggle","_hoisted_1$39","SettingsMenuToggle_default","useStartAudio","canPlayAudio","setupStartAudioResult","StartAudio_default","useStartVideo","canPlayVideo","setupStartVideoResult","StartMediaButton_default","audio","video","text","_sfc_main$16","_hoisted_1$38","_sfc_render$16","CameraDisabledIcon_default","_sfc_main$15","_hoisted_1$37","_sfc_render$15","CameraIcon_default","_sfc_main$14","_hoisted_1$36","_sfc_render$14","MicDisabledIcon_default","_sfc_main$13","_hoisted_1$35","_sfc_render$13","MicIcon_default","_sfc_main$12","_hoisted_1$34","_sfc_render$12","QualityExcellentIcon_default","_sfc_main$11","_hoisted_1$33","_sfc_render$11","QualityGoodIcon_default","_sfc_main$10","_hoisted_1$32","_sfc_render$10","QualityPoorIcon_default","_sfc_main$9","_hoisted_1$31","_sfc_render$9","QualityUnknownIcon_default","_sfc_main$8","_hoisted_1$30","_sfc_render$8","ScreenShareIcon_default","_sfc_main$7","_hoisted_1$29","_sfc_render$7","ScreenShareStopIcon_default","SOURCE_ICONS","CONNECTION_QUALITY_ICONS","getSourceIcon","enabled","icons","getConnectionQualityIcon","useTrackToggle","pending","userInteraction","mediaToggle","current","_hoisted_1$28","TrackToggle_default","\"enabled\"","\"enabledModifiers\"","enabledModel","isUserInitiated","useLocalParticipant","initialParticipant","lastMicrophoneError","lastCameraError","cameraTrack","handleUpdate","RECEIVE_QUALITY","SEND_RESOLUTION","VIDEO_QUALITY_KIND","RECEIVE_LAYERS","SEND_PRESETS","states","sendResolutionOf","resolution","stateOf","existing","useVideoQuality","apply","onTrackSubscribed","_track","setReceiveQuality","setSendResolution","_hoisted_1$27","_hoisted_2$11","_hoisted_3$7","VideoQualitySelect_default","RECEIVE_OPTIONS","SEND_OPTIONS","receiveQuality","sendResolution","isSend","activeValue","isReceiveQuality","option","_sfc_main$6","_hoisted_1$26","_sfc_render$6","ChatCloseIcon_default","_sfc_main$5","_hoisted_1$25","_sfc_render$5","ChatIcon_default","_sfc_main$4","_hoisted_1$24","_sfc_render$4","GearIcon_default","_sfc_main$3","_hoisted_1$23","_sfc_render$3","LeaveIcon_default","_sfc_main$2","_hoisted_1$22","_sfc_render$2","LockLockedIcon_default","_sfc_main$1","_hoisted_1$21","_sfc_render$1","ParticipantPlaceholder_default","_sfc_main","_hoisted_1$20","_sfc_render","SpinnerIcon_default","initialEncryption","useIsEncrypted","isEncrypted","FACING_MODE","useFacingMode","trackFacingMode","useIsMuted","isMuted","muted","useIsSpeaking","speaking","useParticipantTile","micRef","isVideoMuted","isAudioMuted","facingMode","TRACK_ORIENTATION","detachTrack","useMediaTrackBySourceOrName","isSubscribed","orientation","previousElement","deps","trackSid","mediaTrack","currentMediaTrack","currentTrack","dimensions","AudioTrack_default","contextTrackRef","subscribed","volume","useConnectionQualityIndicator","_hoisted_1$19","ConnectionQualityIndicator_default","useParticipantAttributes","participantContext","attr","getParticipantInfo","useParticipantInfo","contextParticipant","newInfo","PARTICIPANT_AVATAR_KEYS","IMAGE_URL","WORD_SEPARATOR","HUE_STEPS","FNV_OFFSET","FNV_PRIME","imageUrl","url","isRecord","avatarFromRecord","record","avatarFromMetadata","parsed","firstLetter","word","getInitials","words","avatarHue","hash","char","useParticipantAvatar","src","displayName","candidate","_hoisted_1$18","_hoisted_2$10","_hoisted_3$6","ParticipantAvatar_default","AVATAR_KIND","initials","hue","failedSrc","_hoisted_1$17","ParticipantName_default","getInitialMuted","useTrackMutedIndicator","mutedIndicator","_hoisted_1$16","TrackMutedIndicator_default","visible","VideoTrack_default","isIntersecting","debouncedIntersecting","remotePublication","settled","_hoisted_1$15","_hoisted_2$9","_hoisted_3$5","ParticipantTile_default","featureContext","autoSubscription","microphoneRef","handleSubscribe","pin","TrackLoop_default","useVisualStableUpdate","lastMaxItemsOnPage","lastTrackRefs","isLayoutChanged","sortedTrackReferences","updatedTrackReferences","updateTrackReferences","_hoisted_1$14","MIN_HEIGHT","MIN_WIDTH","MIN_VISIBLE_TILES","ASPECT_RATIO","CarouselLayout_default","aside","features","previousTiles","carouselOrientation","tilesThatFit","scrollBarWidth","tileSpan","maxVisibleTiles","tiles","FocusLayout_default","FocusLayoutContainer_default","useGridLayout","gridLayouts","PAGINATION_DIRECTION","usePagination","itemPerPage","perPage","totalItems","totalPageCount","lastItemIndex","firstItemIndex","hasNextPage","hasPrevPage","tracksOnPage","maxPage","prevPage","setPage","num","DEFAULT_MIN_SWIPE_DISTANCE","getClientX","useSwipe","touchEnd","touchStart","minSwipeDistance","onTouchStart","onTouchMove","onTouchEnd","distance","getElement","_hoisted_1$13","GridLayout_default","grid","tracks","LayoutContextProvider_default","MULTIBAND_DEFAULTS","WAVEFORM_DEFAULTS","MIN_DB","MAX_DB","VOLUME_UPDATE_INTERVAL_MS","isAudioTrack","getAudioTrack","normalizeDb","normalizeFrequencies","frequencies","getPow2Ceil","remaining","power","getFFTSizeValue","getSum","sum","filterData","audioData","numSamples","filteredData","blockStart","j","getFrequencyBands","dataArray","opts","normalizedFrequencies","chunkSize","chunks","closeAnalyser","useMultibandTrackVolume","frequencyBands","analyser","_hoisted_1$12","_hoisted_2$8","_hoisted_3$4","svgWidth","svgHeight","barWidth","volMultiplier","barCount","AudioVisualizer_default","connectingSequence","columns","listeningSequence","sequenceFor","useBarAnimator","sequence","highlightedIndices","frame","startTime","animate","_hoisted_1$11","BarVisualizer_default","sequencerInterval","bars","minHeight","maxHeight","highlighted","bar","_hoisted_1$10","_hoisted_2$7","ParticipantAudioTile_default","Toast_default","ConnectionStateToast_default","DEFAULT_SOURCES","difference","setA","setB","elem","hasTrackReference","addPlaceholders","placeholder","requiredPlaceholders","placeholderMap","sourcesThatNeedPlaceholder","sourceWithOption","sourcesOfSubscribedTracks","trackSource","placeholderNeededForThisParticipant","useTracks","computedSources","requirePlaceholder","references","sourcesToAddPlaceholder","DEFAULT_STATUS_MESSAGES","useConnectionStatus","currentState","statusText","useChat","isSendingRef","chatMessagesRef","chatSetup","messagesSub","sendingSub","isSending","send","_hoisted_1$9","_hoisted_2$6","_hoisted_3$3","_hoisted_4$2","Chat_default","emit","lastReadAt","form","chatMessages","draft","hideName","previous","hideTimestamp","handleSubmit","onKeydown","fitDraft","showChat","lastMessage","unread","widget","usePermissionsOf","permissions","useLocalParticipantPermissions","getInitialChoices","usePersistentUserChoices","saveAudioInputDeviceId","saveVideoInputDeviceId","saveAudioInputEnabled","saveVideoInputEnabled","saveUsername","username","_hoisted_1$8","_hoisted_2$5","MediaDeviceMenu_default","\"open\"","\"openModifiers\"","open","menuAttrs","needPermissions","close","handleActiveDeviceChange","isOpen","_hoisted_1$7","_hoisted_2$4","_hoisted_3$2","_hoisted_4$1","_hoisted_5$1","ControlBar_default","slots","browserSupportsScreenSharing","localMicrophoneTrack","localCameraTrack","showIcon","showText","screenShareLabel","iconLabel","label","visibleControls","local","canPublish","trackSourceToProtocol","onMicrophoneChange","onCameraChange","_kind","_hoisted_1$6","_hoisted_2$3","AudioConference_default","audioTracks","widgetState","isLocalAudioTrack","isLocalVideoTrack","getProcessorName","replaceProcessor","stopAll","usePreviewTracks","isLoading","audioTrack","videoTrack","_options","canceled","createError","_hoisted_1$5","_hoisted_2$2","_hoisted_3$1","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","PreJoin_default","initialUserChoices","audioEnabled","videoEnabled","audioDeviceId","videoDeviceId","isValid","_hoisted_1$4","RoomAudioRenderer_default","usePinnedTracks","_hoisted_1$3","_hoisted_2$1","_hoisted_3","VideoConference_default","web","pinnedTracks","lastAutoFocusedScreenShare","focusTrack","carouselTracks","screenShareTracks","closeSettings","followScreenShare","shares","firstShare","followFocusTrack","focus","updated","_hoisted_1$2","_hoisted_2","VoiceAssistantControlBar_default","microphoneTrackRef","_hoisted_1$1","ConnectionStatus_default","CHOICE_KEYS","ALL_ENABLED","loadRememberedMediaState","choices","rememberMediaState","roomOptionsStringifyReplacer","ROOM_CONNECTION_STATE","toError","NOTHING_REMEMBERED","shouldPersist","isNonEmpty","simulate","count","useLiveKitRoom","contextRoom","shouldConnect","handleMediaDeviceError","handleEncryptionError","handleLocalMediaChange","handleDisconnected","reason","handleConnected","setupEventHandlers","onSignalConnected","localP","screen","remembered","disconnectRoom","currentRoom","effectState","connectRoom","token","serverUrl","simulateCount","_hoisted_1","LiveKitRoom_default","failure","ParticipantLoop_default","useRoomInfo","roomInfo","RoomName_default","TypedEmitter","set","waitForValue","accept","abortMessage","signal","stops","onAbort","onValue","isBrowser","useObservableState","resetWhenObservableChanges","useEvents","emitter","useRemoteParticipants","participantList","AGENT_EVENT","DEFAULT_AGENT_CONNECT_TIMEOUT_MILLISECONDS","AGENT_SOURCES$1","NOT_JOINED_STATES","isAgentSdkState$1","isTrackReference$1","isAgent$1","isWorkerOf","agent","findTrack$1","localMicrophoneOf","agentStateFlags","createAgentTimeoutStore","failureReason","agentState","participantExists","onTimeout","timeoutMilliseconds","clearFailureReason","updateState","updateParticipantExists","exists","setupAgent","agentTimeout","lastAgentIdentity","disconnectedFailureReason","localMicrophone","agentParticipant","workerParticipant","attributeState","agentTracks","workerTracks","anyCameraTrack","anyMicrophoneTrack","reasons","reported","flags","hasJoined","failureReasons","canListen","isFinished","isPending","untilState","untilTrack","waitUntilConnected","waitUntilCouldBeListening","waitUntilFinished","waitUntilCamera","waitUntilMicrophone","disconnected","useTextStream","sending","activeStreamWriter","activeWriter","closeActiveStream","sendText","streamText","writer","originalClose","registerHandler","unregisterHandler","currentTopic","matchesFilters","identities","trackSids","matchesIdentity","transcribedTrackId","matchesTrack","useTranscriptions","EXPRESSION_ATTRIBUTE","DEFAULT_MOOD_TTL_TURNS","AGENT_MOODS","EXPRESSION_SETTLE_INTERVAL_MILLISECONDS","EXPRESSION_SETTLE_TICKS","NO_EXPRESSION","isAgentMood","mood","sameExpression","second","readPayload","raw","parseExpression","rawExpression","rawMood","expression","currentExpression","segments","ttlTurns","trailingIdentities","speaker","turnsSince","stopStream","useParticipantTracks","errorMessage","applicationError","CONNECT_DISCONNECT_WARNING_THRESHOLD_QUANTITY","CONNECT_DISCONNECT_WARNING_THRESHOLD_MS","ROOM_CHANGE_WARNING_THRESHOLD_QUANTITY","ROOM_CHANGE_WARNING_THRESHOLD_MS","countWithin","times","windowMs","kept","executeRequest","request","runItem","SESSION_EVENT","DEFAULT_TRACKS","roomEncryption","encryption","createKeyProvider","worker","createRoom","enabledPublishOptions","publishTracks","microphone","camera","screenShare","fetchOptionsOf","_room","_encryption","_agentConnectTimeoutMilliseconds","fetchOptions","isEncryptionKey","MESSAGES_EVENT","useSpeakingParticipants","activeSpeakers","DEFAULT_TOAST_TIMEOUT_MS","getAccessToken","useTrackRefBySourceOrName","mediaTrackSetup","useTrackSyncTime","currentObservable","TRACK_TRANSCRIPTION_DEFAULTS","useTrackTranscription","syncTimestamps","handleSegmentMessage","AGENT_SDK_STATES","AGENT_SOURCES","isAgentSdkState","isAgent","findTrack","href","extension","originalFactory","configLevel","loggerName","rawMethod","logLevel","needLog","transcriptions","ticks","startAudio","aggregateWave","timeRef","updates","wave","flushWave","newData","aggregate","fftSize","topicOrCallbackOrProps","dataHandler","msgSub","receivedMsg","sendSub","status","pinContext","widgetContext","isRecording","canSelectAudioOutput","requestPermission","permissionKind","constraints","attribute","remoteParticipants","remoteParticipant","serializer","perform","performWith","response","lock","roomChangeTimes","enqueueTimes","queue","drainQueue","processQueue","unlock","enqueue","connect","disconnect","tokenSource","initialOptions","externalKeyProvider","wasEndCalled","localPublications","refreshLocalPublications","waitUntilConnectionState","waitUntilDisconnected","fetchToken","force","refreshToken","onDisconnected","setEncryptionEnabled","roomConnectOptions","participantToken","connectOptions","stopAbortListener","dispatchesAgent","prepareConnection","internal","firstReceivedAt","announced","chat","sender","toMessage","transcription","common","arrivalOf","announce","merged","sorted","toastContext","addToast","removeToast","clearToasts","userInfo","res","getToken","amplitude","agentTranscriptions"],"sources":["../../../node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../../node_modules/.pnpm/@floating-ui+core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../../node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../node_modules/.pnpm/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../../node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/lib/loglevel.js","../../../node_modules/.pnpm/tslib@2.9.1/node_modules/tslib/tslib.es6.mjs","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Subscription.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/config.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/noop.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/errorContext.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Subscriber.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/symbol/observable.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/identity.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/pipe.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Observable.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/lift.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Subject.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/BehaviorSubject.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/Action.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Scheduler.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/async.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isScheduler.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/args.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isPromise.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/symbol/iterator.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isIterable.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/observeOn.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/subscribeOn.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduled/schedulePromise.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduled/scheduled.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/observable/from.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/observable/of.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isDate.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/timeout.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/map.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/mapOneOrManyArgs.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/mergeAll.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/concatAll.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/observable/concat.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/observable/fromEvent.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/filter.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/scanInternals.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/concatMap.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/distinctUntilChanged.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/finalize.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/scan.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/share.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/skipUntil.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/startWith.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/switchMap.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/tap.js","../../../node_modules/.pnpm/@livekit+components-core@0.12.17_livekit-client@2.26.2_@types+dom-mediacapture-record@1.0.22__tslib@2.9.1/node_modules/@livekit/components-core/dist/index.mjs","../src/components/chat/chat.utils.ts","../src/components/style.ts","../src/components/chat/render-node.ts","../src/components/chat/ChatEntry.vue","../../../node_modules/.pnpm/@vueuse+shared@15.1.0_vue@3.5.46_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js","../../../node_modules/.pnpm/@vueuse+core@15.1.0_vue@3.5.46_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js","../src/context/error.ts","../src/context/participant.context.ts","../src/components/context/ParticipantContextProvider.vue","../src/context/room.context.ts","../src/components/context/RoomContextProvider.vue","../src/context/session.context.ts","../src/components/context/SessionProvider.vue","../src/context/track-reference.context.ts","../src/components/context/TrackRefContextProvider.vue","../src/context/pin.context.ts","../src/context/widget.context.ts","../src/context/layout.context.ts","../src/composables/useChatToggle.ts","../src/components/controls/ChatToggle.vue","../src/composables/useClearPinButton.ts","../src/components/controls/ClearPinButton.vue","../src/context/connection-state.context.ts","../src/composables/useConnectionState.ts","../src/composables/useDisconnectButton.ts","../src/components/controls/DisconnectButton.vue","../src/components/icons/FocusToggleIcon.vue","../src/components/icons/UnfocusToggleIcon.vue","../src/composables/useFocusToggle.ts","../src/components/controls/FocusToggle.vue","../src/context/feature.context.ts","../src/context/toast.context.ts","../src/composables/useMediaDeviceSelect.ts","../src/components/controls/MediaDeviceSelect.vue","../src/components/icons/ChevronIcon.vue","../src/components/controls/PaginationControl.vue","../src/components/controls/PaginationIndicator.vue","../src/composables/useSettingsToggle.ts","../src/components/controls/SettingsMenuToggle.vue","../src/composables/useStartAudio.ts","../src/components/controls/StartAudio.vue","../src/composables/useStartVideo.ts","../src/components/controls/StartMediaButton.vue","../src/components/icons/CameraDisabledIcon.vue","../src/components/icons/CameraIcon.vue","../src/components/icons/MicDisabledIcon.vue","../src/components/icons/MicIcon.vue","../src/components/icons/QualityExcellentIcon.vue","../src/components/icons/QualityGoodIcon.vue","../src/components/icons/QualityPoorIcon.vue","../src/components/icons/QualityUnknownIcon.vue","../src/components/icons/ScreenShareIcon.vue","../src/components/icons/ScreenShareStopIcon.vue","../src/components/icons/utils.ts","../src/composables/useTrackToggle.ts","../src/components/controls/TrackToggle.vue","../src/composables/useLocalParticipant.ts","../src/composables/useVideoQuality.ts","../src/components/controls/VideoQualitySelect.vue","../src/components/icons/ChatCloseIcon.vue","../src/components/icons/ChatIcon.vue","../src/components/icons/GearIcon.vue","../src/components/icons/LeaveIcon.vue","../src/components/icons/LockLockedIcon.vue","../src/components/icons/ParticipantPlaceholder.vue","../src/components/icons/SpinnerIcon.vue","../src/composables/useIsEncrypted.ts","../src/composables/useFacingMode.ts","../src/composables/useIsMuted.ts","../src/composables/useIsSpeaking.ts","../src/composables/useParticipantTile.ts","../src/composables/useMediaTrackBySourceOrName.ts","../src/components/participant/AudioTrack.vue","../src/composables/useConnectionQualityIndicator.ts","../src/components/participant/ConnectionQualityIndicator.vue","../src/composables/useParticipantAttributes.ts","../src/composables/useParticipantInfo.ts","../src/composables/useParticipantAvatar.ts","../src/components/participant/ParticipantAvatar.vue","../src/components/participant/ParticipantName.vue","../src/composables/useTrackMutedIndicator.ts","../src/components/participant/TrackMutedIndicator.vue","../src/components/participant/VideoTrack.vue","../src/components/participant/ParticipantTile.vue","../src/components/room/TrackLoop.vue","../src/composables/useVisualStableUpdate.ts","../src/components/layout/CarouselLayout.vue","../src/components/layout/FocusLayout.vue","../src/components/layout/FocusLayoutContainer.vue","../src/composables/useGridLayout.ts","../src/composables/usePagination.ts","../src/composables/useSwipe.ts","../src/components/layout/GridLayout.vue","../src/components/layout/LayoutContextProvider.vue","../src/composables/useTrackVolume.ts","../src/components/participant/AudioVisualizer.vue","../src/composables/useBarAnimator.ts","../src/components/participant/BarVisualizer.vue","../src/components/participant/ParticipantAudioTile.vue","../src/components/room/Toast.vue","../src/components/room/ConnectionStateToast.vue","../src/composables/useTracks.ts","../src/composables/useConnectionStatus.ts","../src/composables/useChat.ts","../src/components/prefabs/Chat.vue","../src/internal/permissions.ts","../src/composables/useLocalParticipantPermissions.ts","../src/composables/usePersistentUserChoices.ts","../src/components/prefabs/MediaDeviceMenu.vue","../src/components/prefabs/ControlBar.vue","../src/components/prefabs/AudioConference.vue","../src/composables/usePreviewTracks.ts","../src/components/prefabs/PreJoin.vue","../src/components/room/RoomAudioRenderer.vue","../src/composables/usePinnedTracks.ts","../src/components/prefabs/VideoConference.vue","../src/components/prefabs/VoiceAssistantControlBar.vue","../src/components/room/ConnectionStatus.vue","../src/utils/media-choices.utils.ts","../src/utils/room.utils.ts","../src/composables/useLiveKitRoom.ts","../src/components/room/LiveKitRoom.vue","../src/components/room/ParticipantLoop.vue","../src/composables/useRoomInfo.ts","../src/components/room/RoomName.vue","../src/internal/emitter.ts","../src/internal/refs.ts","../src/internal/observable.ts","../src/composables/useEvents.ts","../src/composables/useRemoteParticipants.ts","../src/composables/useAgent.ts","../src/composables/useTextStream.ts","../src/composables/useTranscriptions.ts","../src/composables/useAgentExpression.ts","../src/composables/useAudioPlayback.ts","../src/composables/useDataChannel.ts","../src/composables/useIsRecording.ts","../src/composables/useMediaDevices.ts","../src/composables/useParticipantPermissions.ts","../src/composables/useParticipants.ts","../src/composables/useParticipantTracks.ts","../src/composables/useRemoteParticipant.ts","../src/composables/useRpc.ts","../src/composables/useSequentialRoomConnectDisconnect.ts","../src/composables/useSession.ts","../src/composables/useSessionMessages.ts","../src/composables/useSpeakingParticipants.ts","../src/composables/useSortedParticipants.ts","../src/composables/useToast.ts","../src/composables/useToken.ts","../src/composables/useTrackRefBySourceOrName.ts","../src/composables/useTrack.ts","../src/composables/useTrackByName.ts","../src/composables/useTrackRefBySource.ts","../src/composables/useTrackSyncTime.ts","../src/composables/useTrackTranscription.ts","../src/composables/useVoiceAssistant.ts"],"sourcesContent":["/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n const firstChar = placement[0];\n return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n const side = getSide(placement);\n return oppositeSideMap[side] + placement.slice(side.length);\n}\nfunction expandPaddingObject(padding) {\n var _padding$top, _padding$right, _padding$bottom, _padding$left;\n return {\n top: (_padding$top = padding.top) != null ? _padding$top : 0,\n right: (_padding$right = padding.right) != null ? _padding$right : 0,\n bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,\n left: (_padding$left = padding.left) != null ? _padding$left : 0\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n const alignment = getAlignment(placement);\n if (alignment) {\n coords[alignmentAxis] += commonAlign * (alignment === 'end' ? 1 : -1) * (rtl && isVertical ? -1 : 1);\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) && (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n// Maximum number of resets that can occur before bailing to avoid infinite reset loops.\nconst MAX_RESET_COUNT = 50;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const platformWithDetectOverflow = platform.detectOverflow ? platform : {\n ...platform,\n detectOverflow\n };\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let resetCount = 0;\n const middlewareData = {};\n for (let i = 0; i < middleware.length; i++) {\n const currentMiddleware = middleware[i];\n if (!currentMiddleware) {\n continue;\n }\n const {\n name,\n fn\n } = currentMiddleware;\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platformWithDetectOverflow,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData[name] = {\n ...middlewareData[name],\n ...data\n };\n if (reset && resetCount < MAX_RESET_COUNT) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(minPadding, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n\n // No rects (e.g. a hidden or detached reference, or a collapsed range) —\n // keep the existing reference rect rather than resetting to an invalid\n // one with non-finite values.\n if (!nativeClientRects.length) {\n return {};\n }\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && (clientRects[0].left > clientRects[1].right || clientRects[1].left > clientRects[0].right) && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n return rectToClientRect({\n x: left,\n y: top,\n width: right - left,\n height: bottom - top\n });\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n return rectToClientRect({\n x: minLeft,\n y: top,\n width: maxRight - minLeft,\n height: bottom - top\n });\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const clampCoord = (axis, coord) => clamp(coord + overflow[axis === 'y' ? 'top' : 'left'], coord, coord - overflow[axis === 'y' ? 'bottom' : 'right']);\n if (checkMainAxis) {\n mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);\n }\n if (checkCrossAxis) {\n crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n var _rawOffset$mainAxis, _rawOffset$crossAxis;\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,\n crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n// Method syntax keeps callback parameters bivariant, but expressing the\n// explicit `| undefined` required by `exactOptionalPropertyTypes` needs\n// property syntax, which is contravariant under `strictFunctionTypes`.\n// Extracting the function from a method position restores that bivariance so\n// consumers can still assign callbacks with narrower parameter types.\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const shiftData = state.middlewareData.shift;\n const noShift = !shiftData;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if (shiftData != null && shiftData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if (shiftData != null && shiftData.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n if (isYAxis) {\n availableWidth = width - 2 * max(overflow.left, overflow.right);\n } else {\n availableHeight = height - 2 * max(overflow.top, overflow.bottom);\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return (node.ownerDocument || node).body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement && offsetParent) {\n const win = getWindow(domElement);\n const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return element.getClientRects ? Array.from(element.getClientRects()) : [];\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(html) {\n const scroll = getNodeScroll(html);\n const body = html.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(html);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy, rootBoundary) {\n if (rootBoundary === void 0) {\n rootBoundary = 'viewport';\n }\n const isLayoutViewport = rootBoundary === 'layoutViewport';\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n // Client coordinates are relative to the layout viewport, except in\n // WebKit with an `absolute` strategy, where they are relative to the\n // visual viewport.\n const layoutRelativeClientCoords = !isWebKit() || strategy === 'fixed';\n if (isLayoutViewport) {\n if (!layoutRelativeClientCoords) {\n x = -visualViewport.offsetLeft;\n y = -visualViewport.offsetTop;\n }\n } else {\n width = visualViewport.width;\n height = visualViewport.height;\n if (layoutRelativeClientCoords) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // `scrollbar-gutter: stable` on the <html> reserves gutter space that shrinks\n // the visual width but isn't reflected in `html.clientWidth`, so subtract it.\n // Only the inline-end (right) gutter can hold the scrollbar; `both-edges` also\n // reserves an empty inline-start gutter that clips nothing, so exclude just\n // the one scrollbar-side gutter — halve the measured (two-gutter) total. A\n // left-side scrollbar (`windowScrollbarX > 0`) is already handled by\n // `getHTMLOffset`/`visualViewport.width`; skip it here.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n const gutter = getComputedStyle(html).scrollbarGutter === 'stable both-edges' ? reservedWidth / 2 : reservedWidth;\n if (gutter <= SCROLLBAR_MAX) {\n width -= gutter;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = getScale(element);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') {\n rect = getViewportRect(element, strategy, clippingAncestor);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let lastKeptComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n // Position of the containing block chain below the current node. A fixed\n // element whose containing block hasn't been found yet is a fixed chain.\n const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? 'fixed' : '';\n\n // A non-containing ancestor does not clip the element when the chain\n // below it escapes it: a fixed chain escapes all ancestors up to the\n // next containing block, an absolute chain escapes static ancestors.\n const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === 'fixed' || lastPosition === 'absolute' && computedStyle.position === 'static');\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // The kept node carries the chain position for the next iteration.\n lastKeptComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);\n let top = firstRect.top;\n let right = firstRect.right;\n let bottom = firstRect.bottom;\n let left = firstRect.left;\n for (let i = 1; i < clippingAncestors.length; i++) {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);\n top = max(rect.top, top);\n right = min(rect.right, right);\n bottom = min(rect.bottom, bottom);\n left = max(rect.left, left);\n }\n return {\n width: right - left,\n height: bottom - top,\n x: left,\n y: top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n if (!isOffsetParentAnElement && documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove, ancestorResize) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n\n // The entry is a snapshot, so the reference may have moved since the\n // intersection was computed (under performance constraints, or between\n // consecutive frames of a multi-frame layout shift). The reported ratio\n // and the observed area are stale in that case and cannot be trusted to\n // detect subsequent movement, so refresh regardless of the ratio.\n if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n return refresh();\n }\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped in place, the ratio is 0. Throttle\n // the refresh to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n const win = getWindow(element);\n // The window is a resize ancestor, so when `ancestorResize` is enabled its\n // listener already runs the update on resize. Here we only need to rebuild\n // the `IntersectionObserver` for the new root size, skipping a redundant\n // update. When `ancestorResize` is disabled, this becomes the sole update.\n const handleResize = () => refresh(ancestorResize);\n win.addEventListener('resize', handleResize);\n refresh(true);\n return () => {\n win.removeEventListener('resize', handleResize);\n cleanup();\n };\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update);\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n if (floating) {\n resizeObserver.observe(floating);\n }\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = options != null ? options : {};\n const platformWithCache = {\n ...platform,\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n \"use strict\";\n if (typeof define === 'function' && define.amd) {\n define(definition);\n } else if (typeof module === 'object' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n \"use strict\";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = \"undefined\";\n var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (\n /Trident\\/|MSIE /.test(window.navigator.userAgent)\n );\n\n var logMethods = [\n \"trace\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\"\n ];\n\n var _loggersByName = {};\n var defaultLogger = null;\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === 'function') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Trace() doesn't print the message in IE, so for that case we need to wrap it\n function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods() {\n /*jshint validthis:true */\n var level = this.getLevel();\n\n // Replace the actual methods.\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, this.name);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n\n // Return any important warnings.\n if (typeof console === undefinedType && level < this.levels.SILENT) {\n return \"No console available for logging\";\n }\n }\n\n // In old IE versions, the console isn't present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, _level, _loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, factory) {\n // Private instance variables.\n var self = this;\n /**\n * The level inherited from a parent logger (or a global default). We\n * cache this here rather than delegating to the parent so that it stays\n * in sync with the actual logging methods that we have installed (the\n * parent could change levels but we might not have rebuilt the loggers\n * in this child yet).\n * @type {number}\n */\n var inheritedLevel;\n /**\n * The default level for this logger, if any. If set, this overrides\n * `inheritedLevel`.\n * @type {number|null}\n */\n var defaultLevel;\n /**\n * A user-specific level for this logger. If set, this overrides\n * `defaultLevel`.\n * @type {number|null}\n */\n var userLevel;\n\n var storageKey = \"loglevel\";\n if (typeof name === \"string\") {\n storageKey += \":\" + name;\n } else if (typeof name === \"symbol\") {\n storageKey = undefined;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || 'silent').toUpperCase();\n\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=\" + levelName + \";\";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType || !storageKey) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var cookieName = encodeURIComponent(storageKey);\n var location = cookie.indexOf(cookieName + \"=\");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(\n cookie.slice(location + cookieName.length + 1)\n )[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n function clearPersistedLevel() {\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage.removeItem(storageKey);\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n } catch (ignore) {}\n }\n\n function normalizeLevel(input) {\n var level = input;\n if (typeof level === \"string\" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === \"number\" && level >= 0 && level <= self.levels.SILENT) {\n return level;\n } else {\n throw new TypeError(\"log.setLevel() called with invalid level: \" + input);\n }\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { \"TRACE\": 0, \"DEBUG\": 1, \"INFO\": 2, \"WARN\": 3,\n \"ERROR\": 4, \"SILENT\": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n if (userLevel != null) {\n return userLevel;\n } else if (defaultLevel != null) {\n return defaultLevel;\n } else {\n return inheritedLevel;\n }\n };\n\n self.setLevel = function (level, persist) {\n userLevel = normalizeLevel(level);\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(userLevel);\n }\n\n // NOTE: in v2, this should call rebuild(), which updates children.\n return replaceLoggingMethods.call(self);\n };\n\n self.setDefaultLevel = function (level) {\n defaultLevel = normalizeLevel(level);\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.resetLevel = function () {\n userLevel = null;\n clearPersistedLevel();\n replaceLoggingMethods.call(self);\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n self.rebuild = function () {\n if (defaultLogger !== self) {\n inheritedLevel = normalizeLevel(defaultLogger.getLevel());\n }\n replaceLoggingMethods.call(self);\n\n if (defaultLogger === self) {\n for (var childName in _loggersByName) {\n _loggersByName[childName].rebuild();\n }\n }\n };\n\n // Initialize all the internal levels.\n inheritedLevel = normalizeLevel(\n defaultLogger ? defaultLogger.getLevel() : \"WARN\"\n );\n var initialLevel = getPersistedLevel();\n if (initialLevel != null) {\n userLevel = normalizeLevel(initialLevel);\n }\n replaceLoggingMethods.call(self);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n defaultLogger = new Logger();\n\n defaultLogger.getLogger = function getLogger(name) {\n if ((typeof name !== \"symbol\" && typeof name !== \"string\") || name === \"\") {\n throw new TypeError(\"You must supply a name when creating a logger.\");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name,\n defaultLogger.methodFactory\n );\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n // ES6 default export, for compatibility\n defaultLogger['default'] = defaultLogger;\n\n return defaultLogger;\n}));\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx, extraExtensions, ignoreCase) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n if (extraExtensions) {\n for (var extension in extraExtensions) {\n var suffix = path.slice(-extension.length);\n if (suffix === extension || ignoreCase && suffix.toLowerCase() === extension.toLowerCase()) {\n var output = extraExtensions[extension];\n return output === extension ? path : path.slice(0, -extension.length) + output;\n }\n }\n }\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","export var COMPLETE_NOTIFICATION = (function () { return createNotification('C', undefined, undefined); })();\nexport function errorNotification(error) {\n return createNotification('E', undefined, error);\n}\nexport function nextNotification(value) {\n return createNotification('N', value, undefined);\n}\nexport function createNotification(kind, value, error) {\n return {\n kind: kind,\n value: value,\n error: error,\n };\n}\n//# sourceMappingURL=NotificationFactories.js.map","import { config } from '../config';\nvar context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n var isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n var _a = context, errorThrown = _a.errorThrown, error = _a.error;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","export var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nvar Observable = (function () {\n function Observable(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var _this = this;\n var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(function () {\n var _a = _this, operator = _a.operator, source = _a.source;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n _this._subscribe(subscriber)\n :\n _this._trySubscribe(subscriber));\n });\n return subscriber;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n _this.subscribe(subscriber);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { isFunction } from './isFunction';\nexport function hasLift(source) {\n return isFunction(source === null || source === void 0 ? void 0 : source.lift);\n}\nexport function operate(init) {\n return function (source) {\n if (hasLift(source)) {\n return source.lift(function (liftedSource) {\n try {\n return init(liftedSource, this);\n }\n catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n//# sourceMappingURL=lift.js.map","import { __extends } from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\nvar OperatorSubscriber = (function (_super) {\n __extends(OperatorSubscriber, _super);\n function OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {\n var _this = _super.call(this, destination) || this;\n _this.onFinalize = onFinalize;\n _this.shouldUnsubscribe = shouldUnsubscribe;\n _this._next = onNext\n ? function (value) {\n try {\n onNext(value);\n }\n catch (err) {\n destination.error(err);\n }\n }\n : _super.prototype._next;\n _this._error = onError\n ? function (err) {\n try {\n onError(err);\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._error;\n _this._complete = onComplete\n ? function () {\n try {\n onComplete();\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._complete;\n return _this;\n }\n OperatorSubscriber.prototype.unsubscribe = function () {\n var _a;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var closed_1 = this.closed;\n _super.prototype.unsubscribe.call(this);\n !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));\n }\n };\n return OperatorSubscriber;\n}(Subscriber));\nexport { OperatorSubscriber };\n//# sourceMappingURL=OperatorSubscriber.js.map","import { createErrorClass } from './createErrorClass';\nexport var ObjectUnsubscribedError = createErrorClass(function (_super) {\n return function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n };\n});\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","import { __extends, __values } from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.closed = false;\n _this.currentObservers = null;\n _this.observers = [];\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype._throwIfClosed = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n };\n Subject.prototype.next = function (value) {\n var _this = this;\n errorContext(function () {\n var e_1, _a;\n _this._throwIfClosed();\n if (!_this.isStopped) {\n if (!_this.currentObservers) {\n _this.currentObservers = Array.from(_this.observers);\n }\n try {\n for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {\n var observer = _c.value;\n observer.next(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n });\n };\n Subject.prototype.error = function (err) {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.hasError = _this.isStopped = true;\n _this.thrownError = err;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n };\n Subject.prototype.complete = function () {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.isStopped = true;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n };\n Object.defineProperty(Subject.prototype, \"observed\", {\n get: function () {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n },\n enumerable: false,\n configurable: true\n });\n Subject.prototype._trySubscribe = function (subscriber) {\n this._throwIfClosed();\n return _super.prototype._trySubscribe.call(this, subscriber);\n };\n Subject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n };\n Subject.prototype._innerSubscribe = function (subscriber) {\n var _this = this;\n var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(function () {\n _this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n };\n Subject.prototype._checkFinalizedStatuses = function (subscriber) {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;\n if (hasError) {\n subscriber.error(thrownError);\n }\n else if (isStopped) {\n subscriber.complete();\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n };\n AnonymousSubject.prototype.error = function (err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n };\n AnonymousSubject.prototype.complete = function () {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n//# sourceMappingURL=Subject.js.map","import { __extends } from \"tslib\";\nimport { Subject } from './Subject';\nvar BehaviorSubject = (function (_super) {\n __extends(BehaviorSubject, _super);\n function BehaviorSubject(_value) {\n var _this = _super.call(this) || this;\n _this._value = _value;\n return _this;\n }\n Object.defineProperty(BehaviorSubject.prototype, \"value\", {\n get: function () {\n return this.getValue();\n },\n enumerable: false,\n configurable: true\n });\n BehaviorSubject.prototype._subscribe = function (subscriber) {\n var subscription = _super.prototype._subscribe.call(this, subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n };\n BehaviorSubject.prototype.getValue = function () {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, _value = _a._value;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n };\n BehaviorSubject.prototype.next = function (value) {\n _super.prototype.next.call(this, (this._value = value));\n };\n return BehaviorSubject;\n}(Subject));\nexport { BehaviorSubject };\n//# sourceMappingURL=BehaviorSubject.js.map","export var dateTimestampProvider = {\n now: function () {\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n//# sourceMappingURL=dateTimestampProvider.js.map","import { __extends } from \"tslib\";\nimport { Subscription } from '../Subscription';\nvar Action = (function (_super) {\n __extends(Action, _super);\n function Action(scheduler, work) {\n return _super.call(this) || this;\n }\n Action.prototype.schedule = function (state, delay) {\n if (delay === void 0) { delay = 0; }\n return this;\n };\n return Action;\n}(Subscription));\nexport { Action };\n//# sourceMappingURL=Action.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var intervalProvider = {\n setInterval: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = intervalProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {\n return delegate.setInterval.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setInterval.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearInterval: function (handle) {\n var delegate = intervalProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=intervalProvider.js.map","import { __extends } from \"tslib\";\nimport { Action } from './Action';\nimport { intervalProvider } from './intervalProvider';\nimport { arrRemove } from '../util/arrRemove';\nvar AsyncAction = (function (_super) {\n __extends(AsyncAction, _super);\n function AsyncAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n _this.pending = false;\n return _this;\n }\n AsyncAction.prototype.schedule = function (state, delay) {\n var _a;\n if (delay === void 0) { delay = 0; }\n if (this.closed) {\n return this;\n }\n this.state = state;\n var id = this.id;\n var scheduler = this.scheduler;\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.pending = true;\n this.delay = delay;\n this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);\n return this;\n };\n AsyncAction.prototype.requestAsyncId = function (scheduler, _id, delay) {\n if (delay === void 0) { delay = 0; }\n return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);\n };\n AsyncAction.prototype.recycleAsyncId = function (_scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n if (delay != null && this.delay === delay && this.pending === false) {\n return id;\n }\n if (id != null) {\n intervalProvider.clearInterval(id);\n }\n return undefined;\n };\n AsyncAction.prototype.execute = function (state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n var error = this._execute(state, delay);\n if (error) {\n return error;\n }\n else if (this.pending === false && this.id != null) {\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n };\n AsyncAction.prototype._execute = function (state, _delay) {\n var errored = false;\n var errorValue;\n try {\n this.work(state);\n }\n catch (e) {\n errored = true;\n errorValue = e ? e : new Error('Scheduled action threw falsy error');\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n };\n AsyncAction.prototype.unsubscribe = function () {\n if (!this.closed) {\n var _a = this, id = _a.id, scheduler = _a.scheduler;\n var actions = scheduler.actions;\n this.work = this.state = this.scheduler = null;\n this.pending = false;\n arrRemove(actions, this);\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n _super.prototype.unsubscribe.call(this);\n }\n };\n return AsyncAction;\n}(Action));\nexport { AsyncAction };\n//# sourceMappingURL=AsyncAction.js.map","import { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nvar Scheduler = (function () {\n function Scheduler(schedulerActionCtor, now) {\n if (now === void 0) { now = Scheduler.now; }\n this.schedulerActionCtor = schedulerActionCtor;\n this.now = now;\n }\n Scheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) { delay = 0; }\n return new this.schedulerActionCtor(this, work).schedule(state, delay);\n };\n Scheduler.now = dateTimestampProvider.now;\n return Scheduler;\n}());\nexport { Scheduler };\n//# sourceMappingURL=Scheduler.js.map","import { __extends } from \"tslib\";\nimport { Scheduler } from '../Scheduler';\nvar AsyncScheduler = (function (_super) {\n __extends(AsyncScheduler, _super);\n function AsyncScheduler(SchedulerAction, now) {\n if (now === void 0) { now = Scheduler.now; }\n var _this = _super.call(this, SchedulerAction, now) || this;\n _this.actions = [];\n _this._active = false;\n return _this;\n }\n AsyncScheduler.prototype.flush = function (action) {\n var actions = this.actions;\n if (this._active) {\n actions.push(action);\n return;\n }\n var error;\n this._active = true;\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions.shift()));\n this._active = false;\n if (error) {\n while ((action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsyncScheduler;\n}(Scheduler));\nexport { AsyncScheduler };\n//# sourceMappingURL=AsyncScheduler.js.map","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport var asyncScheduler = new AsyncScheduler(AsyncAction);\nexport var async = asyncScheduler;\n//# sourceMappingURL=async.js.map","import { isFunction } from './isFunction';\nexport function isScheduler(value) {\n return value && isFunction(value.schedule);\n}\n//# sourceMappingURL=isScheduler.js.map","import { isFunction } from './isFunction';\nimport { isScheduler } from './isScheduler';\nfunction last(arr) {\n return arr[arr.length - 1];\n}\nexport function popResultSelector(args) {\n return isFunction(last(args)) ? args.pop() : undefined;\n}\nexport function popScheduler(args) {\n return isScheduler(last(args)) ? args.pop() : undefined;\n}\nexport function popNumber(args, defaultValue) {\n return typeof last(args) === 'number' ? args.pop() : defaultValue;\n}\n//# sourceMappingURL=args.js.map","export var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });\n//# sourceMappingURL=isArrayLike.js.map","import { isFunction } from \"./isFunction\";\nexport function isPromise(value) {\n return isFunction(value === null || value === void 0 ? void 0 : value.then);\n}\n//# sourceMappingURL=isPromise.js.map","import { observable as Symbol_observable } from '../symbol/observable';\nimport { isFunction } from './isFunction';\nexport function isInteropObservable(input) {\n return isFunction(input[Symbol_observable]);\n}\n//# sourceMappingURL=isInteropObservable.js.map","import { isFunction } from './isFunction';\nexport function isAsyncIterable(obj) {\n return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);\n}\n//# sourceMappingURL=isAsyncIterable.js.map","export function createInvalidObservableTypeError(input) {\n return new TypeError(\"You provided \" + (input !== null && typeof input === 'object' ? 'an invalid object' : \"'\" + input + \"'\") + \" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.\");\n}\n//# sourceMappingURL=throwUnobservableError.js.map","export function getSymbolIterator() {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator';\n }\n return Symbol.iterator;\n}\nexport var iterator = getSymbolIterator();\n//# sourceMappingURL=iterator.js.map","import { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from './isFunction';\nexport function isIterable(input) {\n return isFunction(input === null || input === void 0 ? void 0 : input[Symbol_iterator]);\n}\n//# sourceMappingURL=isIterable.js.map","import { __asyncGenerator, __await, __generator } from \"tslib\";\nimport { isFunction } from './isFunction';\nexport function readableStreamLikeToAsyncGenerator(readableStream) {\n return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {\n var reader, _a, value, done;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n reader = readableStream.getReader();\n _b.label = 1;\n case 1:\n _b.trys.push([1, , 9, 10]);\n _b.label = 2;\n case 2:\n if (!true) return [3, 8];\n return [4, __await(reader.read())];\n case 3:\n _a = _b.sent(), value = _a.value, done = _a.done;\n if (!done) return [3, 5];\n return [4, __await(void 0)];\n case 4: return [2, _b.sent()];\n case 5: return [4, __await(value)];\n case 6: return [4, _b.sent()];\n case 7:\n _b.sent();\n return [3, 2];\n case 8: return [3, 10];\n case 9:\n reader.releaseLock();\n return [7];\n case 10: return [2];\n }\n });\n });\n}\nexport function isReadableStreamLike(obj) {\n return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);\n}\n//# sourceMappingURL=isReadableStreamLike.js.map","import { __asyncValues, __awaiter, __generator, __values } from \"tslib\";\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isPromise } from '../util/isPromise';\nimport { Observable } from '../Observable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isIterable } from '../util/isIterable';\nimport { isReadableStreamLike, readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nimport { isFunction } from '../util/isFunction';\nimport { reportUnhandledError } from '../util/reportUnhandledError';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function innerFrom(input) {\n if (input instanceof Observable) {\n return input;\n }\n if (input != null) {\n if (isInteropObservable(input)) {\n return fromInteropObservable(input);\n }\n if (isArrayLike(input)) {\n return fromArrayLike(input);\n }\n if (isPromise(input)) {\n return fromPromise(input);\n }\n if (isAsyncIterable(input)) {\n return fromAsyncIterable(input);\n }\n if (isIterable(input)) {\n return fromIterable(input);\n }\n if (isReadableStreamLike(input)) {\n return fromReadableStreamLike(input);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\nexport function fromInteropObservable(obj) {\n return new Observable(function (subscriber) {\n var obs = obj[Symbol_observable]();\n if (isFunction(obs.subscribe)) {\n return obs.subscribe(subscriber);\n }\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n });\n}\nexport function fromArrayLike(array) {\n return new Observable(function (subscriber) {\n for (var i = 0; i < array.length && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n });\n}\nexport function fromPromise(promise) {\n return new Observable(function (subscriber) {\n promise\n .then(function (value) {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) { return subscriber.error(err); })\n .then(null, reportUnhandledError);\n });\n}\nexport function fromIterable(iterable) {\n return new Observable(function (subscriber) {\n var e_1, _a;\n try {\n for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {\n var value = iterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n subscriber.complete();\n });\n}\nexport function fromAsyncIterable(asyncIterable) {\n return new Observable(function (subscriber) {\n process(asyncIterable, subscriber).catch(function (err) { return subscriber.error(err); });\n });\n}\nexport function fromReadableStreamLike(readableStream) {\n return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));\n}\nfunction process(asyncIterable, subscriber) {\n var asyncIterable_1, asyncIterable_1_1;\n var e_2, _a;\n return __awaiter(this, void 0, void 0, function () {\n var value, e_2_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 5, 6, 11]);\n asyncIterable_1 = __asyncValues(asyncIterable);\n _b.label = 1;\n case 1: return [4, asyncIterable_1.next()];\n case 2:\n if (!(asyncIterable_1_1 = _b.sent(), !asyncIterable_1_1.done)) return [3, 4];\n value = asyncIterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return [2];\n }\n _b.label = 3;\n case 3: return [3, 1];\n case 4: return [3, 11];\n case 5:\n e_2_1 = _b.sent();\n e_2 = { error: e_2_1 };\n return [3, 11];\n case 6:\n _b.trys.push([6, , 9, 10]);\n if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return))) return [3, 8];\n return [4, _a.call(asyncIterable_1)];\n case 7:\n _b.sent();\n _b.label = 8;\n case 8: return [3, 10];\n case 9:\n if (e_2) throw e_2.error;\n return [7];\n case 10: return [7];\n case 11:\n subscriber.complete();\n return [2];\n }\n });\n });\n}\n//# sourceMappingURL=innerFrom.js.map","export function executeSchedule(parentSubscription, scheduler, work, delay, repeat) {\n if (delay === void 0) { delay = 0; }\n if (repeat === void 0) { repeat = false; }\n var scheduleSubscription = scheduler.schedule(function () {\n work();\n if (repeat) {\n parentSubscription.add(this.schedule(null, delay));\n }\n else {\n this.unsubscribe();\n }\n }, delay);\n parentSubscription.add(scheduleSubscription);\n if (!repeat) {\n return scheduleSubscription;\n }\n}\n//# sourceMappingURL=executeSchedule.js.map","import { executeSchedule } from '../util/executeSchedule';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function observeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return operate(function (source, subscriber) {\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return executeSchedule(subscriber, scheduler, function () { return subscriber.next(value); }, delay); }, function () { return executeSchedule(subscriber, scheduler, function () { return subscriber.complete(); }, delay); }, function (err) { return executeSchedule(subscriber, scheduler, function () { return subscriber.error(err); }, delay); }));\n });\n}\n//# sourceMappingURL=observeOn.js.map","import { operate } from '../util/lift';\nexport function subscribeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return operate(function (source, subscriber) {\n subscriber.add(scheduler.schedule(function () { return source.subscribe(subscriber); }, delay));\n });\n}\n//# sourceMappingURL=subscribeOn.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { observeOn } from '../operators/observeOn';\nimport { subscribeOn } from '../operators/subscribeOn';\nexport function scheduleObservable(input, scheduler) {\n return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));\n}\n//# sourceMappingURL=scheduleObservable.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { observeOn } from '../operators/observeOn';\nimport { subscribeOn } from '../operators/subscribeOn';\nexport function schedulePromise(input, scheduler) {\n return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));\n}\n//# sourceMappingURL=schedulePromise.js.map","import { Observable } from '../Observable';\nexport function scheduleArray(input, scheduler) {\n return new Observable(function (subscriber) {\n var i = 0;\n return scheduler.schedule(function () {\n if (i === input.length) {\n subscriber.complete();\n }\n else {\n subscriber.next(input[i++]);\n if (!subscriber.closed) {\n this.schedule();\n }\n }\n });\n });\n}\n//# sourceMappingURL=scheduleArray.js.map","import { Observable } from '../Observable';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from '../util/isFunction';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleIterable(input, scheduler) {\n return new Observable(function (subscriber) {\n var iterator;\n executeSchedule(subscriber, scheduler, function () {\n iterator = input[Symbol_iterator]();\n executeSchedule(subscriber, scheduler, function () {\n var _a;\n var value;\n var done;\n try {\n (_a = iterator.next(), value = _a.value, done = _a.done);\n }\n catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n }\n else {\n subscriber.next(value);\n }\n }, 0, true);\n });\n return function () { return isFunction(iterator === null || iterator === void 0 ? void 0 : iterator.return) && iterator.return(); };\n });\n}\n//# sourceMappingURL=scheduleIterable.js.map","import { Observable } from '../Observable';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleAsyncIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable(function (subscriber) {\n executeSchedule(subscriber, scheduler, function () {\n var iterator = input[Symbol.asyncIterator]();\n executeSchedule(subscriber, scheduler, function () {\n iterator.next().then(function (result) {\n if (result.done) {\n subscriber.complete();\n }\n else {\n subscriber.next(result.value);\n }\n });\n }, 0, true);\n });\n });\n}\n//# sourceMappingURL=scheduleAsyncIterable.js.map","import { scheduleAsyncIterable } from './scheduleAsyncIterable';\nimport { readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nexport function scheduleReadableStreamLike(input, scheduler) {\n return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);\n}\n//# sourceMappingURL=scheduleReadableStreamLike.js.map","import { scheduleObservable } from './scheduleObservable';\nimport { schedulePromise } from './schedulePromise';\nimport { scheduleArray } from './scheduleArray';\nimport { scheduleIterable } from './scheduleIterable';\nimport { scheduleAsyncIterable } from './scheduleAsyncIterable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isPromise } from '../util/isPromise';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isIterable } from '../util/isIterable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isReadableStreamLike } from '../util/isReadableStreamLike';\nimport { scheduleReadableStreamLike } from './scheduleReadableStreamLike';\nexport function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n if (isArrayLike(input)) {\n return scheduleArray(input, scheduler);\n }\n if (isPromise(input)) {\n return schedulePromise(input, scheduler);\n }\n if (isAsyncIterable(input)) {\n return scheduleAsyncIterable(input, scheduler);\n }\n if (isIterable(input)) {\n return scheduleIterable(input, scheduler);\n }\n if (isReadableStreamLike(input)) {\n return scheduleReadableStreamLike(input, scheduler);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\n//# sourceMappingURL=scheduled.js.map","import { scheduled } from '../scheduled/scheduled';\nimport { innerFrom } from './innerFrom';\nexport function from(input, scheduler) {\n return scheduler ? scheduled(input, scheduler) : innerFrom(input);\n}\n//# sourceMappingURL=from.js.map","import { popScheduler } from '../util/args';\nimport { from } from './from';\nexport function of() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = popScheduler(args);\n return from(args, scheduler);\n}\n//# sourceMappingURL=of.js.map","export function isValidDate(value) {\n return value instanceof Date && !isNaN(value);\n}\n//# sourceMappingURL=isDate.js.map","import { asyncScheduler } from '../scheduler/async';\nimport { isValidDate } from '../util/isDate';\nimport { operate } from '../util/lift';\nimport { innerFrom } from '../observable/innerFrom';\nimport { createErrorClass } from '../util/createErrorClass';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { executeSchedule } from '../util/executeSchedule';\nexport var TimeoutError = createErrorClass(function (_super) {\n return function TimeoutErrorImpl(info) {\n if (info === void 0) { info = null; }\n _super(this);\n this.message = 'Timeout has occurred';\n this.name = 'TimeoutError';\n this.info = info;\n };\n});\nexport function timeout(config, schedulerArg) {\n var _a = (isValidDate(config) ? { first: config } : typeof config === 'number' ? { each: config } : config), first = _a.first, each = _a.each, _b = _a.with, _with = _b === void 0 ? timeoutErrorFactory : _b, _c = _a.scheduler, scheduler = _c === void 0 ? schedulerArg !== null && schedulerArg !== void 0 ? schedulerArg : asyncScheduler : _c, _d = _a.meta, meta = _d === void 0 ? null : _d;\n if (first == null && each == null) {\n throw new TypeError('No timeout provided.');\n }\n return operate(function (source, subscriber) {\n var originalSourceSubscription;\n var timerSubscription;\n var lastValue = null;\n var seen = 0;\n var startTimer = function (delay) {\n timerSubscription = executeSchedule(subscriber, scheduler, function () {\n try {\n originalSourceSubscription.unsubscribe();\n innerFrom(_with({\n meta: meta,\n lastValue: lastValue,\n seen: seen,\n })).subscribe(subscriber);\n }\n catch (err) {\n subscriber.error(err);\n }\n }, delay);\n };\n originalSourceSubscription = source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();\n seen++;\n subscriber.next((lastValue = value));\n each > 0 && startTimer(each);\n }, undefined, undefined, function () {\n if (!(timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.closed)) {\n timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();\n }\n lastValue = null;\n }));\n !seen && startTimer(first != null ? (typeof first === 'number' ? first : +first - scheduler.now()) : each);\n });\n}\nfunction timeoutErrorFactory(info) {\n throw new TimeoutError(info);\n}\n//# sourceMappingURL=timeout.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function map(project, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n subscriber.next(project.call(thisArg, value, index++));\n }));\n });\n}\n//# sourceMappingURL=map.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { map } from \"../operators/map\";\nvar isArray = Array.isArray;\nfunction callOrApply(fn, args) {\n return isArray(args) ? fn.apply(void 0, __spreadArray([], __read(args))) : fn(args);\n}\nexport function mapOneOrManyArgs(fn) {\n return map(function (args) { return callOrApply(fn, args); });\n}\n//# sourceMappingURL=mapOneOrManyArgs.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { executeSchedule } from '../util/executeSchedule';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {\n var buffer = [];\n var active = 0;\n var index = 0;\n var isComplete = false;\n var checkComplete = function () {\n if (isComplete && !buffer.length && !active) {\n subscriber.complete();\n }\n };\n var outerNext = function (value) { return (active < concurrent ? doInnerSub(value) : buffer.push(value)); };\n var doInnerSub = function (value) {\n expand && subscriber.next(value);\n active++;\n var innerComplete = false;\n innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, function (innerValue) {\n onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);\n if (expand) {\n outerNext(innerValue);\n }\n else {\n subscriber.next(innerValue);\n }\n }, function () {\n innerComplete = true;\n }, undefined, function () {\n if (innerComplete) {\n try {\n active--;\n var _loop_1 = function () {\n var bufferedValue = buffer.shift();\n if (innerSubScheduler) {\n executeSchedule(subscriber, innerSubScheduler, function () { return doInnerSub(bufferedValue); });\n }\n else {\n doInnerSub(bufferedValue);\n }\n };\n while (buffer.length && active < concurrent) {\n _loop_1();\n }\n checkComplete();\n }\n catch (err) {\n subscriber.error(err);\n }\n }\n }));\n };\n source.subscribe(createOperatorSubscriber(subscriber, outerNext, function () {\n isComplete = true;\n checkComplete();\n }));\n return function () {\n additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();\n };\n}\n//# sourceMappingURL=mergeInternals.js.map","import { map } from './map';\nimport { innerFrom } from '../observable/innerFrom';\nimport { operate } from '../util/lift';\nimport { mergeInternals } from './mergeInternals';\nimport { isFunction } from '../util/isFunction';\nexport function mergeMap(project, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Infinity; }\n if (isFunction(resultSelector)) {\n return mergeMap(function (a, i) { return map(function (b, ii) { return resultSelector(a, b, i, ii); })(innerFrom(project(a, i))); }, concurrent);\n }\n else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return operate(function (source, subscriber) { return mergeInternals(source, subscriber, project, concurrent); });\n}\n//# sourceMappingURL=mergeMap.js.map","import { mergeMap } from './mergeMap';\nimport { identity } from '../util/identity';\nexport function mergeAll(concurrent) {\n if (concurrent === void 0) { concurrent = Infinity; }\n return mergeMap(identity, concurrent);\n}\n//# sourceMappingURL=mergeAll.js.map","import { mergeAll } from './mergeAll';\nexport function concatAll() {\n return mergeAll(1);\n}\n//# sourceMappingURL=concatAll.js.map","import { concatAll } from '../operators/concatAll';\nimport { popScheduler } from '../util/args';\nimport { from } from './from';\nexport function concat() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return concatAll()(from(args, popScheduler(args)));\n}\n//# sourceMappingURL=concat.js.map","import { __read } from \"tslib\";\nimport { innerFrom } from '../observable/innerFrom';\nimport { Observable } from '../Observable';\nimport { mergeMap } from '../operators/mergeMap';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isFunction } from '../util/isFunction';\nimport { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';\nvar nodeEventEmitterMethods = ['addListener', 'removeListener'];\nvar eventTargetMethods = ['addEventListener', 'removeEventListener'];\nvar jqueryMethods = ['on', 'off'];\nexport function fromEvent(target, eventName, options, resultSelector) {\n if (isFunction(options)) {\n resultSelector = options;\n options = undefined;\n }\n if (resultSelector) {\n return fromEvent(target, eventName, options).pipe(mapOneOrManyArgs(resultSelector));\n }\n var _a = __read(isEventTarget(target)\n ? eventTargetMethods.map(function (methodName) { return function (handler) { return target[methodName](eventName, handler, options); }; })\n :\n isNodeStyleEventEmitter(target)\n ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName))\n : isJQueryStyleEventEmitter(target)\n ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName))\n : [], 2), add = _a[0], remove = _a[1];\n if (!add) {\n if (isArrayLike(target)) {\n return mergeMap(function (subTarget) { return fromEvent(subTarget, eventName, options); })(innerFrom(target));\n }\n }\n if (!add) {\n throw new TypeError('Invalid event target');\n }\n return new Observable(function (subscriber) {\n var handler = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return subscriber.next(1 < args.length ? args : args[0]);\n };\n add(handler);\n return function () { return remove(handler); };\n });\n}\nfunction toCommonHandlerRegistry(target, eventName) {\n return function (methodName) { return function (handler) { return target[methodName](eventName, handler); }; };\n}\nfunction isNodeStyleEventEmitter(target) {\n return isFunction(target.addListener) && isFunction(target.removeListener);\n}\nfunction isJQueryStyleEventEmitter(target) {\n return isFunction(target.on) && isFunction(target.off);\n}\nfunction isEventTarget(target) {\n return isFunction(target.addEventListener) && isFunction(target.removeEventListener);\n}\n//# sourceMappingURL=fromEvent.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function filter(predicate, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return predicate.call(thisArg, value, index++) && subscriber.next(value); }));\n });\n}\n//# sourceMappingURL=filter.js.map","import { createOperatorSubscriber } from './OperatorSubscriber';\nexport function scanInternals(accumulator, seed, hasSeed, emitOnNext, emitBeforeComplete) {\n return function (source, subscriber) {\n var hasState = hasSeed;\n var state = seed;\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var i = index++;\n state = hasState\n ?\n accumulator(state, value, i)\n :\n ((hasState = true), value);\n emitOnNext && subscriber.next(state);\n }, emitBeforeComplete &&\n (function () {\n hasState && subscriber.next(state);\n subscriber.complete();\n })));\n };\n}\n//# sourceMappingURL=scanInternals.js.map","import { mergeMap } from './mergeMap';\nimport { isFunction } from '../util/isFunction';\nexport function concatMap(project, resultSelector) {\n return isFunction(resultSelector) ? mergeMap(project, resultSelector, 1) : mergeMap(project, 1);\n}\n//# sourceMappingURL=concatMap.js.map","import { identity } from '../util/identity';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function distinctUntilChanged(comparator, keySelector) {\n if (keySelector === void 0) { keySelector = identity; }\n comparator = comparator !== null && comparator !== void 0 ? comparator : defaultCompare;\n return operate(function (source, subscriber) {\n var previousKey;\n var first = true;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var currentKey = keySelector(value);\n if (first || !comparator(previousKey, currentKey)) {\n first = false;\n previousKey = currentKey;\n subscriber.next(value);\n }\n }));\n });\n}\nfunction defaultCompare(a, b) {\n return a === b;\n}\n//# sourceMappingURL=distinctUntilChanged.js.map","import { operate } from '../util/lift';\nexport function finalize(callback) {\n return operate(function (source, subscriber) {\n try {\n source.subscribe(subscriber);\n }\n finally {\n subscriber.add(callback);\n }\n });\n}\n//# sourceMappingURL=finalize.js.map","import { operate } from '../util/lift';\nimport { scanInternals } from './scanInternals';\nexport function scan(accumulator, seed) {\n return operate(scanInternals(accumulator, seed, arguments.length >= 2, true));\n}\n//# sourceMappingURL=scan.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { innerFrom } from '../observable/innerFrom';\nimport { Subject } from '../Subject';\nimport { SafeSubscriber } from '../Subscriber';\nimport { operate } from '../util/lift';\nexport function share(options) {\n if (options === void 0) { options = {}; }\n var _a = options.connector, connector = _a === void 0 ? function () { return new Subject(); } : _a, _b = options.resetOnError, resetOnError = _b === void 0 ? true : _b, _c = options.resetOnComplete, resetOnComplete = _c === void 0 ? true : _c, _d = options.resetOnRefCountZero, resetOnRefCountZero = _d === void 0 ? true : _d;\n return function (wrapperSource) {\n var connection;\n var resetConnection;\n var subject;\n var refCount = 0;\n var hasCompleted = false;\n var hasErrored = false;\n var cancelReset = function () {\n resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();\n resetConnection = undefined;\n };\n var reset = function () {\n cancelReset();\n connection = subject = undefined;\n hasCompleted = hasErrored = false;\n };\n var resetAndUnsubscribe = function () {\n var conn = connection;\n reset();\n conn === null || conn === void 0 ? void 0 : conn.unsubscribe();\n };\n return operate(function (source, subscriber) {\n refCount++;\n if (!hasErrored && !hasCompleted) {\n cancelReset();\n }\n var dest = (subject = subject !== null && subject !== void 0 ? subject : connector());\n subscriber.add(function () {\n refCount--;\n if (refCount === 0 && !hasErrored && !hasCompleted) {\n resetConnection = handleReset(resetAndUnsubscribe, resetOnRefCountZero);\n }\n });\n dest.subscribe(subscriber);\n if (!connection &&\n refCount > 0) {\n connection = new SafeSubscriber({\n next: function (value) { return dest.next(value); },\n error: function (err) {\n hasErrored = true;\n cancelReset();\n resetConnection = handleReset(reset, resetOnError, err);\n dest.error(err);\n },\n complete: function () {\n hasCompleted = true;\n cancelReset();\n resetConnection = handleReset(reset, resetOnComplete);\n dest.complete();\n },\n });\n innerFrom(source).subscribe(connection);\n }\n })(wrapperSource);\n };\n}\nfunction handleReset(reset, on) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n if (on === true) {\n reset();\n return;\n }\n if (on === false) {\n return;\n }\n var onSubscriber = new SafeSubscriber({\n next: function () {\n onSubscriber.unsubscribe();\n reset();\n },\n });\n return innerFrom(on.apply(void 0, __spreadArray([], __read(args)))).subscribe(onSubscriber);\n}\n//# sourceMappingURL=share.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { innerFrom } from '../observable/innerFrom';\nimport { noop } from '../util/noop';\nexport function skipUntil(notifier) {\n return operate(function (source, subscriber) {\n var taking = false;\n var skipSubscriber = createOperatorSubscriber(subscriber, function () {\n skipSubscriber === null || skipSubscriber === void 0 ? void 0 : skipSubscriber.unsubscribe();\n taking = true;\n }, noop);\n innerFrom(notifier).subscribe(skipSubscriber);\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return taking && subscriber.next(value); }));\n });\n}\n//# sourceMappingURL=skipUntil.js.map","import { concat } from '../observable/concat';\nimport { popScheduler } from '../util/args';\nimport { operate } from '../util/lift';\nexport function startWith() {\n var values = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n values[_i] = arguments[_i];\n }\n var scheduler = popScheduler(values);\n return operate(function (source, subscriber) {\n (scheduler ? concat(values, source, scheduler) : concat(values, source)).subscribe(subscriber);\n });\n}\n//# sourceMappingURL=startWith.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function switchMap(project, resultSelector) {\n return operate(function (source, subscriber) {\n var innerSubscriber = null;\n var index = 0;\n var isComplete = false;\n var checkComplete = function () { return isComplete && !innerSubscriber && subscriber.complete(); };\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n innerSubscriber === null || innerSubscriber === void 0 ? void 0 : innerSubscriber.unsubscribe();\n var innerIndex = 0;\n var outerIndex = index++;\n innerFrom(project(value, outerIndex)).subscribe((innerSubscriber = createOperatorSubscriber(subscriber, function (innerValue) { return subscriber.next(resultSelector ? resultSelector(value, innerValue, outerIndex, innerIndex++) : innerValue); }, function () {\n innerSubscriber = null;\n checkComplete();\n })));\n }, function () {\n isComplete = true;\n checkComplete();\n }));\n });\n}\n//# sourceMappingURL=switchMap.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { innerFrom } from '../observable/innerFrom';\nimport { noop } from '../util/noop';\nexport function takeUntil(notifier) {\n return operate(function (source, subscriber) {\n innerFrom(notifier).subscribe(createOperatorSubscriber(subscriber, function () { return subscriber.complete(); }, noop));\n !subscriber.closed && source.subscribe(subscriber);\n });\n}\n//# sourceMappingURL=takeUntil.js.map","import { isFunction } from '../util/isFunction';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { identity } from '../util/identity';\nexport function tap(observerOrNext, error, complete) {\n var tapObserver = isFunction(observerOrNext) || error || complete\n ?\n { next: observerOrNext, error: error, complete: complete }\n : observerOrNext;\n return tapObserver\n ? operate(function (source, subscriber) {\n var _a;\n (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n var isUnsub = true;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var _a;\n (_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);\n subscriber.next(value);\n }, function () {\n var _a;\n isUnsub = false;\n (_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n subscriber.complete();\n }, function (err) {\n var _a;\n isUnsub = false;\n (_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);\n subscriber.error(err);\n }, function () {\n var _a, _b;\n if (isUnsub) {\n (_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n }\n (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);\n }));\n })\n :\n identity;\n}\n//# sourceMappingURL=tap.js.map","var __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for(\"Symbol.\" + name);\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n};\nvar __forAwait = (obj, it, method) => (it = obj[__knownSymbol(\"asyncIterator\")]) ? it.call(obj) : (obj = obj[__knownSymbol(\"iterator\")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method(\"next\"), method(\"return\"), it);\n\n// src/constants.ts\nvar cssPrefix = \"lk\";\n\n// src/track-reference/track-reference.types.ts\nfunction isTrackReference(trackReference) {\n if (typeof trackReference === \"undefined\") {\n return false;\n }\n return isTrackReferenceSubscribed(trackReference) || isTrackReferencePublished(trackReference);\n}\nfunction isTrackReferenceSubscribed(trackReference) {\n var _a;\n if (!trackReference) {\n return false;\n }\n return trackReference.hasOwnProperty(\"participant\") && trackReference.hasOwnProperty(\"source\") && trackReference.hasOwnProperty(\"track\") && typeof ((_a = trackReference.publication) == null ? void 0 : _a.track) !== \"undefined\";\n}\nfunction isTrackReferencePublished(trackReference) {\n if (!trackReference) {\n return false;\n }\n return trackReference.hasOwnProperty(\"participant\") && trackReference.hasOwnProperty(\"source\") && trackReference.hasOwnProperty(\"publication\") && typeof trackReference.publication !== \"undefined\";\n}\nfunction isTrackReferencePlaceholder(trackReference) {\n if (!trackReference) {\n return false;\n }\n return trackReference.hasOwnProperty(\"participant\") && trackReference.hasOwnProperty(\"source\") && typeof trackReference.publication === \"undefined\";\n}\n\n// src/track-reference/track-reference.utils.ts\nfunction getTrackReferenceId(trackReference) {\n if (typeof trackReference === \"string\" || typeof trackReference === \"number\") {\n return `${trackReference}`;\n } else if (isTrackReferencePlaceholder(trackReference)) {\n return `${trackReference.participant.identity}_${trackReference.source}_placeholder`;\n } else if (isTrackReference(trackReference)) {\n return `${trackReference.participant.identity}_${trackReference.publication.source}_${trackReference.publication.trackSid}`;\n } else {\n throw new Error(`Can't generate a id for the given track reference: ${trackReference}`);\n }\n}\nfunction getTrackReferenceSource(trackReference) {\n if (isTrackReference(trackReference)) {\n return trackReference.publication.source;\n } else {\n return trackReference.source;\n }\n}\nfunction isEqualTrackRef(a, b) {\n if (a === void 0 || b === void 0) {\n return false;\n }\n if (isTrackReference(a) && isTrackReference(b)) {\n return a.publication.trackSid === b.publication.trackSid;\n } else {\n return getTrackReferenceId(a) === getTrackReferenceId(b);\n }\n}\nfunction isTrackReferencePinned(trackReference, pinState) {\n if (typeof pinState === \"undefined\") {\n return false;\n }\n if (isTrackReference(trackReference)) {\n return pinState.some(\n (pinnedTrackReference) => pinnedTrackReference.participant.identity === trackReference.participant.identity && isTrackReference(pinnedTrackReference) && pinnedTrackReference.publication.trackSid === trackReference.publication.trackSid\n );\n } else if (isTrackReferencePlaceholder(trackReference)) {\n return pinState.some(\n (pinnedTrackReference) => pinnedTrackReference.participant.identity === trackReference.participant.identity && isTrackReferencePlaceholder(pinnedTrackReference) && pinnedTrackReference.source === trackReference.source\n );\n } else {\n return false;\n }\n}\nfunction isPlaceholderReplacement(currentTrackRef, nextTrackRef) {\n return isTrackReferencePlaceholder(currentTrackRef) && isTrackReference(nextTrackRef) && nextTrackRef.participant.identity === currentTrackRef.participant.identity && nextTrackRef.source === currentTrackRef.source;\n}\n\n// src/utils.ts\nfunction isLocal(p) {\n return p.isLocal;\n}\nfunction isRemote(p) {\n return !p.isLocal;\n}\nvar attachIfSubscribed = (publication, element) => {\n if (!publication) return;\n const { isSubscribed, track } = publication;\n if (element && track) {\n if (isSubscribed) {\n track.attach(element);\n } else {\n track.detach(element);\n }\n }\n};\nfunction isParticipantTrackReferencePinned(trackRef, pinState) {\n if (pinState === void 0) {\n return false;\n }\n return pinState.some((pinnedTrackRef) => isEqualTrackRef(pinnedTrackRef, trackRef));\n}\nfunction getScrollBarWidth() {\n const inner = document.createElement(\"p\");\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n const outer = document.createElement(\"div\");\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n document.body.appendChild(outer);\n const w1 = inner.offsetWidth;\n outer.style.overflow = \"scroll\";\n let w2 = inner.offsetWidth;\n if (w1 === w2) {\n w2 = outer.clientWidth;\n }\n document.body.removeChild(outer);\n const scrollBarWidth = w1 - w2;\n return scrollBarWidth;\n}\n\n// src/helper/detectMobileBrowser.ts\nfunction isWeb() {\n return typeof document !== \"undefined\";\n}\nfunction isMobileBrowser() {\n return isWeb() ? /Mobi/i.test(window.navigator.userAgent) : false;\n}\n\n// src/helper/url-regex.ts\nfunction createUrlRegExp(options) {\n options = __spreadValues({}, options);\n const protocol = `(?:(?:[a-z]+:)?//)?`;\n const auth = \"(?:\\\\S+@)?\";\n const ip = new RegExp(\n \"(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]\\\\d|\\\\d)(?:\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]\\\\d|\\\\d)){3}\",\n \"g\"\n ).source;\n const host = \"(?:[a-z\\\\u00a1-\\\\uffff0-9]+(?:[-_]+[a-z\\\\u00a1-\\\\uffff0-9]+)*)\";\n const domain = \"(?:\\\\.[a-z\\\\u00a1-\\\\uffff0-9]+(?:-+[a-z\\\\u00a1-\\\\uffff0-9]+)*)*\";\n const tld = `(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff]{2,}))(?:\\\\.(?=[:/?#]))?`;\n const port = \"(?::\\\\d{2,5})?\";\n const parens = '\\\\([^\\\\s\"()]*\\\\)';\n const pathBody = `(?:[^\\\\s\"()]|${parens})*(?:[^\\\\s\"().,;:!?']|${parens})`;\n const path = `(?:/(?:${pathBody})?|[?#]${pathBody})?`;\n const regex2 = `(?:${protocol}|www\\\\.)${auth}(?:localhost|${ip}|${host}${domain}${tld})${port}${path}`;\n return options.exact ? new RegExp(`(?:^${regex2}$)`, \"i\") : new RegExp(regex2, \"ig\");\n}\n\n// src/helper/emailRegex.ts\nvar regex = \"[^\\\\.\\\\s@:](?:[^\\\\s@:]{0,254}[^\\\\s@:\\\\.])?@[^\\\\.\\\\s@]+(?:\\\\.[^\\\\.\\\\s@]+)*\";\nfunction createEmailRegExp({ exact } = {}) {\n return exact ? new RegExp(`^${regex}$`) : new RegExp(regex, \"g\");\n}\n\n// src/helper/floating-menu.ts\nimport { autoUpdate, computePosition, flip, offset, shift } from \"@floating-ui/dom\";\nfunction computeMenuPosition(button, menu, onUpdate) {\n const cleanup = autoUpdate(button, menu, () => __async(null, null, function* () {\n const { x, y } = yield computePosition(button, menu, {\n placement: \"top\",\n middleware: [offset(6), flip(), shift({ padding: 5 })]\n });\n onUpdate == null ? void 0 : onUpdate(x, y);\n }));\n return cleanup;\n}\nfunction wasClickOutside(insideElement, event) {\n const isOutside = !insideElement.contains(event.target);\n return isOutside;\n}\n\n// src/helper/tokenizer.ts\nvar createDefaultGrammar = () => {\n return {\n email: createEmailRegExp(),\n url: createUrlRegExp({})\n };\n};\nfunction tokenize(input, grammar) {\n let lastEnd = 0;\n const matches = Object.entries(grammar).map(\n ([type, rx], weight) => Array.from(input.matchAll(rx)).map(({ index, 0: content }) => ({\n type,\n weight,\n content,\n index: index != null ? index : 0\n }))\n ).flat().sort((a, b) => {\n const d = a.index - b.index;\n return d !== 0 ? d : a.weight - b.weight;\n }).filter(({ index, content }) => {\n if (index < lastEnd) return false;\n lastEnd = index + content.length;\n return true;\n });\n const tokens = [];\n let pos = 0;\n for (const { type, content, index } of matches) {\n if (index > pos) tokens.push(input.substring(pos, index));\n tokens.push({ type, content });\n pos = index + content.length;\n }\n if (input.length > pos) tokens.push(input.substring(pos));\n return tokens;\n}\n\n// src/helper/eventGroups.ts\nimport { ParticipantEvent, RoomEvent } from \"livekit-client\";\nvar allRemoteParticipantRoomEvents = [\n RoomEvent.ConnectionStateChanged,\n RoomEvent.RoomMetadataChanged,\n RoomEvent.ActiveSpeakersChanged,\n RoomEvent.ConnectionQualityChanged,\n RoomEvent.ParticipantConnected,\n RoomEvent.ParticipantDisconnected,\n RoomEvent.ParticipantPermissionsChanged,\n RoomEvent.ParticipantMetadataChanged,\n RoomEvent.ParticipantNameChanged,\n RoomEvent.ParticipantAttributesChanged,\n RoomEvent.TrackMuted,\n RoomEvent.TrackUnmuted,\n RoomEvent.TrackPublished,\n RoomEvent.TrackUnpublished,\n RoomEvent.TrackStreamStateChanged,\n RoomEvent.TrackSubscriptionFailed,\n RoomEvent.TrackSubscriptionPermissionChanged,\n RoomEvent.TrackSubscriptionStatusChanged\n];\nvar allParticipantRoomEvents = [\n ...allRemoteParticipantRoomEvents,\n RoomEvent.LocalTrackPublished,\n RoomEvent.LocalTrackUnpublished\n];\nvar participantTrackEvents = [\n ParticipantEvent.TrackPublished,\n ParticipantEvent.TrackUnpublished,\n ParticipantEvent.TrackMuted,\n ParticipantEvent.TrackUnmuted,\n ParticipantEvent.TrackStreamStateChanged,\n ParticipantEvent.TrackSubscribed,\n ParticipantEvent.TrackUnsubscribed,\n ParticipantEvent.TrackSubscriptionPermissionChanged,\n ParticipantEvent.TrackSubscriptionFailed,\n ParticipantEvent.LocalTrackPublished,\n ParticipantEvent.LocalTrackUnpublished\n];\nvar allRemoteParticipantEvents = [\n ParticipantEvent.ConnectionQualityChanged,\n ParticipantEvent.IsSpeakingChanged,\n ParticipantEvent.ParticipantMetadataChanged,\n ParticipantEvent.ParticipantPermissionsChanged,\n ParticipantEvent.TrackMuted,\n ParticipantEvent.TrackUnmuted,\n ParticipantEvent.TrackPublished,\n ParticipantEvent.TrackUnpublished,\n ParticipantEvent.TrackStreamStateChanged,\n ParticipantEvent.TrackSubscriptionFailed,\n ParticipantEvent.TrackSubscriptionPermissionChanged,\n ParticipantEvent.TrackSubscriptionStatusChanged\n];\nvar allParticipantEvents = [\n ...allRemoteParticipantEvents,\n ParticipantEvent.LocalTrackPublished,\n ParticipantEvent.LocalTrackUnpublished\n];\n\n// src/logger.ts\nimport {\n setLogLevel as setClientSdkLogLevel,\n setLogExtension as setClientSdkLogExtension,\n LogLevel as LogLevelEnum\n} from \"livekit-client\";\nimport loglevel from \"loglevel\";\nvar log = loglevel.getLogger(\"lk-components-js\");\nlog.setDefaultLevel(\"WARN\");\nfunction setLogLevel(level, options = {}) {\n var _a;\n log.setLevel(level);\n setClientSdkLogLevel((_a = options.liveKitClientLogLevel) != null ? _a : level);\n}\nfunction setLogExtension(extension, options = {}) {\n var _a;\n const originalFactory = log.methodFactory;\n log.methodFactory = (methodName, configLevel, loggerName) => {\n const rawMethod = originalFactory(methodName, configLevel, loggerName);\n const logLevel = LogLevelEnum[methodName];\n const needLog = logLevel >= configLevel && logLevel < LogLevelEnum.silent;\n return (msg, context) => {\n if (context) rawMethod(msg, context);\n else rawMethod(msg);\n if (needLog) {\n extension(logLevel, msg, context);\n }\n };\n };\n log.setLevel(log.getLevel());\n setClientSdkLogExtension((_a = options.liveKitClientLogExtension) != null ? _a : extension);\n}\n\n// src/helper/grid-layouts.ts\nvar GRID_LAYOUTS = [\n {\n columns: 1,\n rows: 1\n },\n {\n columns: 1,\n rows: 2,\n orientation: \"portrait\"\n },\n {\n columns: 2,\n rows: 1,\n orientation: \"landscape\"\n },\n {\n columns: 2,\n rows: 2,\n minWidth: 560\n },\n {\n columns: 3,\n rows: 3,\n minWidth: 700\n },\n {\n columns: 4,\n rows: 4,\n minWidth: 960\n },\n {\n columns: 5,\n rows: 5,\n minWidth: 1100\n }\n];\nfunction selectGridLayout(layoutDefinitions, participantCount, width, height) {\n if (layoutDefinitions.length < 1) {\n throw new Error(\"At least one grid layout definition must be provided.\");\n }\n const layouts = expandAndSortLayoutDefinitions(layoutDefinitions);\n if (width <= 0 || height <= 0) {\n return layouts[0];\n }\n let currentLayoutIndex = 0;\n const containerOrientation = width / height > 1 ? \"landscape\" : \"portrait\";\n let layout = layouts.find((layout_, index, allLayouts) => {\n currentLayoutIndex = index;\n const isBiggerLayoutAvailable = allLayouts.findIndex((l, i) => {\n const fitsOrientation = !l.orientation || l.orientation === containerOrientation;\n const layoutIsBiggerThanCurrent = i > index;\n const layoutFitsSameAmountOfParticipants = l.maxTiles === layout_.maxTiles;\n return layoutIsBiggerThanCurrent && layoutFitsSameAmountOfParticipants && fitsOrientation;\n }) !== -1;\n return layout_.maxTiles >= participantCount && !isBiggerLayoutAvailable;\n });\n if (layout === void 0) {\n layout = layouts[layouts.length - 1];\n if (layout) {\n log.warn(\n `No layout found for: participantCount: ${participantCount}, width/height: ${width}/${height} fallback to biggest available layout (${layout}).`\n );\n } else {\n throw new Error(`No layout or fallback layout found.`);\n }\n }\n if (width < layout.minWidth || height < layout.minHeight) {\n if (currentLayoutIndex > 0) {\n const smallerLayout = layouts[currentLayoutIndex - 1];\n layout = selectGridLayout(\n layouts.slice(0, currentLayoutIndex),\n smallerLayout.maxTiles,\n width,\n height\n );\n }\n }\n return layout;\n}\nfunction expandAndSortLayoutDefinitions(layouts) {\n return [...layouts].map((layout) => {\n var _a, _b;\n return {\n name: `${layout.columns}x${layout.rows}`,\n columns: layout.columns,\n rows: layout.rows,\n maxTiles: layout.columns * layout.rows,\n minWidth: (_a = layout.minWidth) != null ? _a : 0,\n minHeight: (_b = layout.minHeight) != null ? _b : 0,\n orientation: layout.orientation\n };\n }).sort((a, b) => {\n if (a.maxTiles !== b.maxTiles) {\n return a.maxTiles - b.maxTiles;\n } else if (a.minWidth !== 0 || b.minWidth !== 0) {\n return a.minWidth - b.minWidth;\n } else if (a.minHeight !== 0 || b.minHeight !== 0) {\n return a.minHeight - b.minHeight;\n } else {\n return 0;\n }\n });\n}\n\n// src/helper/set-helper.ts\nfunction setDifference(setA, setB) {\n const _difference = new Set(setA);\n for (const elem of setB) {\n _difference.delete(elem);\n }\n return _difference;\n}\n\n// src/helper/featureDetection.ts\nfunction supportsScreenSharing() {\n return typeof navigator !== \"undefined\" && navigator.mediaDevices && !!navigator.mediaDevices.getDisplayMedia;\n}\n\n// src/helper/transcriptions.ts\nfunction getActiveTranscriptionSegments(segments, syncTimes, maxAge = 0) {\n return segments.filter((segment) => {\n var _a;\n const hasTrackSync = !!syncTimes.rtpTimestamp;\n const currentTrackTime = (_a = syncTimes.rtpTimestamp) != null ? _a : performance.timeOrigin + performance.now();\n const displayStartTime = hasTrackSync ? Math.max(segment.receivedAtMediaTimestamp, segment.startTime) : segment.receivedAt;\n const segmentDuration = maxAge + segment.endTime - segment.startTime;\n return currentTrackTime >= displayStartTime && currentTrackTime <= displayStartTime + segmentDuration;\n });\n}\nfunction addMediaTimestampToTranscription(segment, timestamps) {\n var _a;\n return __spreadProps(__spreadValues({}, segment), {\n receivedAtMediaTimestamp: (_a = timestamps.rtpTimestamp) != null ? _a : 0,\n receivedAt: timestamps.timestamp\n });\n}\nfunction dedupeSegments(prevSegments, newSegments, windowSize) {\n return [...prevSegments, ...newSegments].reduceRight((acc, segment) => {\n if (!acc.find((val) => val.id === segment.id)) {\n acc.unshift(segment);\n }\n return acc;\n }, []).slice(0 - windowSize);\n}\nfunction didActiveSegmentsChange(prevActive, newActive) {\n if (newActive.length !== prevActive.length) {\n return true;\n }\n return !newActive.every((newSegment) => {\n return prevActive.find(\n (prevSegment) => prevSegment.id === newSegment.id && prevSegment.text === newSegment.text && prevSegment.final === newSegment.final && prevSegment.language === newSegment.language && prevSegment.startTime === newSegment.startTime && prevSegment.endTime === newSegment.endTime\n );\n });\n}\n\n// src/helper/participant-attributes.ts\nvar ParticipantAgentAttributes = /* @__PURE__ */ ((ParticipantAgentAttributes2) => {\n ParticipantAgentAttributes2[\"AgentState\"] = \"lk.agent.state\";\n ParticipantAgentAttributes2[\"PublishOnBehalf\"] = \"lk.publish_on_behalf\";\n ParticipantAgentAttributes2[\"TranscriptionFinal\"] = \"lk.transcription_final\";\n ParticipantAgentAttributes2[\"TranscriptionSegmentId\"] = \"lk.segment_id\";\n ParticipantAgentAttributes2[\"TranscribedTrackId\"] = \"lk.transcribed_track_id\";\n ParticipantAgentAttributes2[\"Expression\"] = \"lk.expression\";\n return ParticipantAgentAttributes2;\n})(ParticipantAgentAttributes || {});\n\n// src/types.ts\nvar PIN_DEFAULT_STATE = [];\nvar WIDGET_DEFAULT_STATE = {\n showChat: false,\n unreadMessages: 0,\n showSettings: false\n};\nfunction isSourceWitOptions(source) {\n return typeof source === \"object\";\n}\nfunction isSourcesWithOptions(sources) {\n return Array.isArray(sources) && sources.filter(isSourceWitOptions).length > 0;\n}\n\n// src/sorting/sort-track-bundles.ts\nimport { Track as Track2 } from \"livekit-client\";\n\n// src/sorting/base-sort-functions.ts\nimport { Track } from \"livekit-client\";\nfunction sortParticipantsByAudioLevel(a, b) {\n return b.audioLevel - a.audioLevel;\n}\nfunction sortParticipantsByIsSpeaking(a, b) {\n if (a.isSpeaking === b.isSpeaking) {\n return 0;\n } else {\n return a.isSpeaking ? -1 : 1;\n }\n}\nfunction sortParticipantsByLastSpokenAT(a, b) {\n var _a, _b, _c, _d;\n if (a.lastSpokeAt !== void 0 || b.lastSpokeAt !== void 0) {\n return ((_b = (_a = b.lastSpokeAt) == null ? void 0 : _a.getTime()) != null ? _b : 0) - ((_d = (_c = a.lastSpokeAt) == null ? void 0 : _c.getTime()) != null ? _d : 0);\n } else {\n return 0;\n }\n}\nfunction sortParticipantsByJoinedAt(a, b) {\n var _a, _b, _c, _d;\n return ((_b = (_a = a.joinedAt) == null ? void 0 : _a.getTime()) != null ? _b : 0) - ((_d = (_c = b.joinedAt) == null ? void 0 : _c.getTime()) != null ? _d : 0);\n}\nfunction sortTrackReferencesByType(a, b) {\n if (isTrackReference(a)) {\n if (isTrackReference(b)) {\n return 0;\n } else {\n return -1;\n }\n } else if (isTrackReference(b)) {\n return 1;\n } else {\n return 0;\n }\n}\nfunction sortTrackRefsByIsCameraEnabled(a, b) {\n const aVideo = a.participant.isCameraEnabled;\n const bVideo = b.participant.isCameraEnabled;\n if (aVideo !== bVideo) {\n if (aVideo) {\n return -1;\n } else {\n return 1;\n }\n } else {\n return 0;\n }\n}\n\n// src/sorting/sort-track-bundles.ts\nfunction sortTrackReferences(tracks) {\n const localTracks = [];\n const screenShareTracks = [];\n const cameraTracks = [];\n const undefinedTracks = [];\n tracks.forEach((trackRef) => {\n if (trackRef.participant.isLocal && trackRef.source === Track2.Source.Camera) {\n localTracks.push(trackRef);\n } else if (trackRef.source === Track2.Source.ScreenShare) {\n screenShareTracks.push(trackRef);\n } else if (trackRef.source === Track2.Source.Camera) {\n cameraTracks.push(trackRef);\n } else {\n undefinedTracks.push(trackRef);\n }\n });\n const sortedScreenShareTracks = sortScreenShareTracks(screenShareTracks);\n const sortedCameraTracks = sortCameraTracks(cameraTracks);\n return [...localTracks, ...sortedScreenShareTracks, ...sortedCameraTracks, ...undefinedTracks];\n}\nfunction sortScreenShareTracks(screenShareTracks) {\n const localScreenShares = [];\n const remoteScreenShares = [];\n screenShareTracks.forEach((trackRef) => {\n if (trackRef.participant.isLocal) {\n localScreenShares.push(trackRef);\n } else {\n remoteScreenShares.push(trackRef);\n }\n });\n localScreenShares.sort((a, b) => sortParticipantsByJoinedAt(a.participant, b.participant));\n remoteScreenShares.sort((a, b) => sortParticipantsByJoinedAt(a.participant, b.participant));\n const sortedScreenShareTrackRefs = [...remoteScreenShares, ...localScreenShares];\n return sortedScreenShareTrackRefs;\n}\nfunction sortCameraTracks(cameraTrackReferences) {\n const localCameraTracks = [];\n const remoteCameraTracks = [];\n cameraTrackReferences.forEach((trackRef) => {\n if (trackRef.participant.isLocal) {\n localCameraTracks.push(trackRef);\n } else {\n remoteCameraTracks.push(trackRef);\n }\n });\n remoteCameraTracks.sort((a, b) => {\n if (a.participant.isSpeaking && b.participant.isSpeaking) {\n return sortParticipantsByAudioLevel(a.participant, b.participant);\n }\n if (a.participant.isSpeaking !== b.participant.isSpeaking) {\n return sortParticipantsByIsSpeaking(a.participant, b.participant);\n }\n if (a.participant.lastSpokeAt !== b.participant.lastSpokeAt) {\n return sortParticipantsByLastSpokenAT(a.participant, b.participant);\n }\n if (isTrackReference(a) !== isTrackReference(b)) {\n return sortTrackReferencesByType(a, b);\n }\n if (a.participant.isCameraEnabled !== b.participant.isCameraEnabled) {\n return sortTrackRefsByIsCameraEnabled(a, b);\n }\n return sortParticipantsByJoinedAt(a.participant, b.participant);\n });\n return [...localCameraTracks, ...remoteCameraTracks];\n}\n\n// src/sorting/sort-participants.ts\nfunction sortParticipants(participants) {\n const sortedParticipants = [...participants];\n sortedParticipants.sort((a, b) => {\n if (a.isSpeaking && b.isSpeaking) {\n return sortParticipantsByAudioLevel(a, b);\n }\n if (a.isSpeaking !== b.isSpeaking) {\n return sortParticipantsByIsSpeaking(a, b);\n }\n if (a.lastSpokeAt !== b.lastSpokeAt) {\n return sortParticipantsByLastSpokenAT(a, b);\n }\n const aVideo = a.videoTrackPublications.size > 0;\n const bVideo = b.videoTrackPublications.size > 0;\n if (aVideo !== bVideo) {\n if (aVideo) {\n return -1;\n } else {\n return 1;\n }\n }\n return sortParticipantsByJoinedAt(a, b);\n });\n const localParticipant = sortedParticipants.find((p) => p.isLocal);\n if (localParticipant) {\n const localIdx = sortedParticipants.indexOf(localParticipant);\n if (localIdx >= 0) {\n sortedParticipants.splice(localIdx, 1);\n if (sortedParticipants.length > 0) {\n sortedParticipants.splice(0, 0, localParticipant);\n } else {\n sortedParticipants.push(localParticipant);\n }\n }\n }\n return sortedParticipants;\n}\n\n// src/helper/array-helper.ts\nfunction chunk(input, size) {\n return input.reduce(\n (arr, item, idx) => {\n return idx % size === 0 ? [...arr, [item]] : [...arr.slice(0, -1), [...arr.slice(-1)[0], item]];\n },\n []\n );\n}\nfunction zip(a1, a2) {\n const resultLength = Math.max(a1.length, a2.length);\n return new Array(resultLength).fill([]).map((_val, idx) => [a1[idx], a2[idx]]);\n}\nfunction differenceBy(a1, a2, by) {\n return a1.filter((c) => !a2.map((v) => by(v)).includes(by(c)));\n}\n\n// src/track-reference/test-utils.ts\nimport { Participant, RemoteTrackPublication, Track as Track3 } from \"livekit-client\";\nimport { TrackInfo } from \"@livekit/protocol\";\nfunction flatTrackReferenceArray(list) {\n return list.map((item) => {\n if (typeof item === \"string\" || typeof item === \"number\") {\n return `${item}`;\n } else {\n return getTrackReferenceId(item);\n }\n });\n}\n\n// src/sorting/tile-array-update.ts\nfunction visualPageChange(state, next) {\n return {\n dropped: differenceBy(state, next, getTrackReferenceId),\n added: differenceBy(next, state, getTrackReferenceId)\n };\n}\nfunction listNeedsUpdating(changes) {\n return changes.added.length !== 0 || changes.dropped.length !== 0;\n}\nfunction findIndex(trackReference, trackReferences) {\n const indexToReplace = trackReferences.findIndex(\n (trackReference_) => getTrackReferenceId(trackReference_) === getTrackReferenceId(trackReference)\n );\n if (indexToReplace === -1) {\n throw new Error(\n `Element not part of the array: ${getTrackReferenceId(\n trackReference\n )} not in ${flatTrackReferenceArray(trackReferences)}`\n );\n }\n return indexToReplace;\n}\nfunction swapItems(moveForward, moveBack, trackReferences) {\n const indexToReplace = findIndex(moveForward, trackReferences);\n const indexReplaceWith = findIndex(moveBack, trackReferences);\n trackReferences.splice(indexToReplace, 1, moveBack);\n trackReferences.splice(indexReplaceWith, 1, moveForward);\n return trackReferences;\n}\nfunction dropItem(itemToDrop, list) {\n const indexOfElementToDrop = findIndex(itemToDrop, list);\n list.splice(indexOfElementToDrop, 1);\n return list;\n}\nfunction addItem(itemToAdd, list) {\n return [...list, itemToAdd];\n}\nfunction divideIntoPages(list, maxElementsOnPage) {\n const pages = chunk(list, maxElementsOnPage);\n return pages;\n}\nfunction updatePages(currentList, nextList, maxItemsOnPage) {\n let updatedList = refreshList(currentList, nextList);\n const addedItems = differenceBy(nextList, updatedList, getTrackReferenceId);\n updatedList = [...updatedList, ...addedItems];\n const currentPages = divideIntoPages(updatedList, maxItemsOnPage);\n const nextPages = divideIntoPages(nextList, maxItemsOnPage);\n zip(currentPages, nextPages).forEach(([currentPage, nextPage], pageIndex) => {\n if (currentPage && nextPage) {\n const updatedPage = divideIntoPages(updatedList, maxItemsOnPage)[pageIndex];\n const changes = visualPageChange(updatedPage, nextPage);\n if (listNeedsUpdating(changes)) {\n log.debug(\n `Detected visual changes on page: ${pageIndex}, current: ${flatTrackReferenceArray(\n currentPage\n )}, next: ${flatTrackReferenceArray(nextPage)}`,\n { changes }\n );\n if (changes.added.length === changes.dropped.length) {\n zip(changes.added, changes.dropped).forEach(([added, dropped]) => {\n if (added && dropped) {\n updatedList = swapItems(added, dropped, updatedList);\n } else {\n throw new Error(\n `For a swap action we need a addition and a removal one is missing: ${added}, ${dropped}`\n );\n }\n });\n }\n if (changes.added.length === 0 && changes.dropped.length > 0) {\n changes.dropped.forEach((item) => {\n updatedList = dropItem(item, updatedList);\n });\n }\n if (changes.added.length > 0 && changes.dropped.length === 0) {\n changes.added.forEach((item) => {\n updatedList = addItem(item, updatedList);\n });\n }\n }\n }\n });\n if (updatedList.length > nextList.length) {\n const missingItems = differenceBy(updatedList, nextList, getTrackReferenceId);\n updatedList = updatedList.filter(\n (item) => !missingItems.map(getTrackReferenceId).includes(getTrackReferenceId(item))\n );\n }\n return updatedList;\n}\nfunction refreshList(currentList, nextList) {\n return currentList.map((currentItem) => {\n const updateForCurrentItem = nextList.find(\n (newItem_) => (\n // If the IDs match or ..\n getTrackReferenceId(currentItem) === getTrackReferenceId(newItem_) || // ... if the current item is a placeholder and the new item is the track reference can replace it.\n typeof currentItem !== \"number\" && isTrackReferencePlaceholder(currentItem) && isTrackReference(newItem_) && isPlaceholderReplacement(currentItem, newItem_)\n )\n );\n return updateForCurrentItem != null ? updateForCurrentItem : currentItem;\n });\n}\n\n// src/components/mediaToggle.ts\nimport { Track as Track7 } from \"livekit-client\";\nimport { Subject, map as map4, startWith as startWith4 } from \"rxjs\";\n\n// src/observables/participant.ts\nimport {\n ParticipantEvent as ParticipantEvent2,\n RoomEvent as RoomEvent3,\n Track as Track6\n} from \"livekit-client\";\nimport { Observable as Observable2, map as map3, startWith as startWith3, switchMap } from \"rxjs\";\n\n// src/components/mediaTrack.ts\nimport { Track as Track4 } from \"livekit-client\";\nimport { map, startWith } from \"rxjs\";\n\n// src/styles-interface/class-prefixer.ts\nfunction prefixClass(unprefixedClassName) {\n return `${cssPrefix}-${unprefixedClassName}`;\n}\n\n// src/components/mediaTrack.ts\nfunction setupMediaTrack(trackIdentifier) {\n const initialPub = getTrackByIdentifier(trackIdentifier);\n const trackObserver = observeParticipantMedia(trackIdentifier.participant).pipe(\n map(() => {\n return getTrackByIdentifier(trackIdentifier);\n }),\n startWith(initialPub)\n );\n const className = prefixClass(\n trackIdentifier.source === Track4.Source.Camera || trackIdentifier.source === Track4.Source.ScreenShare ? \"participant-media-video\" : \"participant-media-audio\"\n );\n return { className, trackObserver };\n}\nfunction getTrackByIdentifier(options) {\n if (isTrackReference(options)) {\n return options.publication;\n } else {\n const { source, name, participant } = options;\n if (source && name) {\n return participant.getTrackPublications().find((pub) => pub.source === source && pub.trackName === name);\n } else if (name) {\n return participant.getTrackPublicationByName(name);\n } else if (source) {\n return participant.getTrackPublication(source);\n } else {\n throw new Error(\"At least one of source and name needs to be defined\");\n }\n }\n}\n\n// src/observables/room.ts\nimport {\n Room,\n RoomEvent as RoomEvent2,\n Track as Track5\n} from \"livekit-client\";\nimport { concat, filter, map as map2, Observable, startWith as startWith2 } from \"rxjs\";\nfunction observeRoomEvents(room, ...events) {\n const observable = new Observable((subscribe) => {\n const onRoomUpdate = () => {\n subscribe.next(room);\n };\n events.forEach((evt) => {\n room.on(evt, onRoomUpdate);\n });\n const unsubscribe = () => {\n events.forEach((evt) => {\n room.off(evt, onRoomUpdate);\n });\n };\n return unsubscribe;\n }).pipe(startWith2(room));\n return observable;\n}\nfunction roomEventSelector(room, event) {\n const observable = new Observable((subscribe) => {\n const update = (...params) => {\n subscribe.next(params);\n };\n room.on(event, update);\n const unsubscribe = () => {\n room.off(event, update);\n };\n return unsubscribe;\n });\n return observable;\n}\nfunction roomObserver(room) {\n const observable = observeRoomEvents(\n room,\n RoomEvent2.ParticipantConnected,\n RoomEvent2.ParticipantDisconnected,\n RoomEvent2.ActiveSpeakersChanged,\n RoomEvent2.TrackSubscribed,\n RoomEvent2.TrackUnsubscribed,\n RoomEvent2.LocalTrackPublished,\n RoomEvent2.LocalTrackUnpublished,\n RoomEvent2.AudioPlaybackStatusChanged,\n RoomEvent2.ConnectionStateChanged\n );\n return observable;\n}\nfunction connectionStateObserver(room) {\n return roomEventSelector(room, RoomEvent2.ConnectionStateChanged).pipe(\n map2(([connectionState]) => connectionState),\n startWith2(room.state)\n );\n}\nfunction screenShareObserver(room) {\n let screenShareSubscriber;\n const observers = [];\n const observable = new Observable((subscriber) => {\n screenShareSubscriber = subscriber;\n return () => {\n observers.forEach((observer) => {\n observer.unsubscribe();\n });\n };\n });\n const screenShareTracks = [];\n const handleSub = (publication, participant) => {\n if (publication.source !== Track5.Source.ScreenShare && publication.source !== Track5.Source.ScreenShareAudio) {\n return;\n }\n let trackMap = screenShareTracks.find((tr) => tr.participant.identity === participant.identity);\n const getScreenShareTracks = (participant2) => {\n return participant2.getTrackPublications().filter(\n (track) => (track.source === Track5.Source.ScreenShare || track.source === Track5.Source.ScreenShareAudio) && track.track\n );\n };\n if (!trackMap) {\n trackMap = {\n participant,\n tracks: getScreenShareTracks(participant)\n };\n } else {\n const index = screenShareTracks.indexOf(trackMap);\n screenShareTracks.splice(index, 1);\n trackMap.tracks = getScreenShareTracks(participant);\n }\n if (trackMap.tracks.length > 0) {\n screenShareTracks.push(trackMap);\n }\n screenShareSubscriber.next(screenShareTracks);\n };\n observers.push(\n roomEventSelector(room, RoomEvent2.TrackSubscribed).subscribe(\n ([, ...args]) => handleSub(...args)\n )\n );\n observers.push(\n roomEventSelector(room, RoomEvent2.TrackUnsubscribed).subscribe(\n ([, ...args]) => handleSub(...args)\n )\n );\n observers.push(\n roomEventSelector(room, RoomEvent2.LocalTrackPublished).subscribe((args) => handleSub(...args))\n );\n observers.push(\n roomEventSelector(room, RoomEvent2.LocalTrackUnpublished).subscribe((args) => {\n handleSub(...args);\n })\n );\n observers.push(\n roomEventSelector(room, RoomEvent2.TrackMuted).subscribe((args) => {\n handleSub(...args);\n })\n );\n observers.push(\n roomEventSelector(room, RoomEvent2.TrackUnmuted).subscribe((args) => {\n handleSub(...args);\n })\n );\n setTimeout(() => {\n for (const p of room.remoteParticipants.values()) {\n p.getTrackPublications().forEach((track) => {\n handleSub(track, p);\n });\n }\n }, 1);\n return observable;\n}\nfunction roomInfoObserver(room) {\n const observer = observeRoomEvents(\n room,\n RoomEvent2.RoomMetadataChanged,\n RoomEvent2.ConnectionStateChanged\n ).pipe(\n map2((r) => {\n return { name: r.name, metadata: r.metadata };\n })\n );\n return observer;\n}\nfunction activeSpeakerObserver(room) {\n return roomEventSelector(room, RoomEvent2.ActiveSpeakersChanged).pipe(\n map2(([speakers]) => speakers)\n );\n}\nfunction createMediaDeviceObserver(kind, onError, requestPermissions = true) {\n const initialDevices$ = new Observable((subscriber) => {\n Room.getLocalDevices(kind, requestPermissions).then((devices) => {\n subscriber.next(devices);\n subscriber.complete();\n }).catch((e) => {\n onError == null ? void 0 : onError(e);\n subscriber.next([]);\n subscriber.complete();\n });\n });\n const deviceChanges$ = new Observable((subscriber) => {\n var _a;\n const onDeviceChange = () => __async(null, null, function* () {\n try {\n const newDevices = yield Room.getLocalDevices(kind, requestPermissions);\n subscriber.next(newDevices);\n } catch (e) {\n onError == null ? void 0 : onError(e);\n }\n });\n if (typeof window !== \"undefined\") {\n if (!window.isSecureContext) {\n throw new Error(\n `Accessing media devices is available only in secure contexts (HTTPS and localhost), in some or all supporting browsers. See: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaDevices`\n );\n }\n (_a = navigator == null ? void 0 : navigator.mediaDevices) == null ? void 0 : _a.addEventListener(\"devicechange\", onDeviceChange);\n }\n return () => {\n var _a2;\n (_a2 = navigator == null ? void 0 : navigator.mediaDevices) == null ? void 0 : _a2.removeEventListener(\"devicechange\", onDeviceChange);\n };\n });\n return concat(initialDevices$, deviceChanges$);\n}\nfunction createDataObserver(room) {\n return roomEventSelector(room, RoomEvent2.DataReceived);\n}\nfunction createChatObserver(room) {\n return roomEventSelector(room, RoomEvent2.ChatMessage);\n}\nfunction roomAudioPlaybackAllowedObservable(room) {\n const observable = observeRoomEvents(room, RoomEvent2.AudioPlaybackStatusChanged).pipe(\n map2((room2) => {\n return { canPlayAudio: room2.canPlaybackAudio };\n })\n );\n return observable;\n}\nfunction roomVideoPlaybackAllowedObservable(room) {\n const observable = observeRoomEvents(room, RoomEvent2.VideoPlaybackStatusChanged).pipe(\n map2((room2) => {\n return { canPlayVideo: room2.canPlaybackVideo };\n })\n );\n return observable;\n}\nfunction createActiveDeviceObservable(room, kind) {\n return roomEventSelector(room, RoomEvent2.ActiveDeviceChanged).pipe(\n filter(([kindOfDevice]) => kindOfDevice === kind),\n map2(([kind2, deviceId]) => {\n log.debug(\"activeDeviceObservable | RoomEvent.ActiveDeviceChanged\", { kind: kind2, deviceId });\n return deviceId;\n })\n );\n}\nfunction encryptionStatusObservable(room, participant) {\n return roomEventSelector(room, RoomEvent2.ParticipantEncryptionStatusChanged).pipe(\n filter(\n ([, p]) => (participant == null ? void 0 : participant.identity) === (p == null ? void 0 : p.identity) || !p && (participant == null ? void 0 : participant.identity) === room.localParticipant.identity\n ),\n map2(([encrypted]) => encrypted),\n startWith2(\n (participant == null ? void 0 : participant.isLocal) ? participant.isE2EEEnabled : !!(participant == null ? void 0 : participant.isEncrypted)\n )\n );\n}\nfunction recordingStatusObservable(room) {\n return roomEventSelector(room, RoomEvent2.RecordingStatusChanged).pipe(\n map2(([recording]) => recording),\n startWith2(room.isRecording)\n );\n}\n\n// src/observables/participant.ts\nfunction observeParticipantEvents(participant, ...events) {\n const observable = new Observable2((subscribe) => {\n const onParticipantUpdate = () => {\n subscribe.next(participant);\n };\n events.forEach((evt) => {\n participant.on(evt, onParticipantUpdate);\n });\n const unsubscribe = () => {\n events.forEach((evt) => {\n participant.off(evt, onParticipantUpdate);\n });\n };\n return unsubscribe;\n }).pipe(startWith3(participant));\n return observable;\n}\nfunction observeParticipantMedia(participant) {\n const participantObserver = observeParticipantEvents(\n participant,\n ParticipantEvent2.TrackMuted,\n ParticipantEvent2.TrackUnmuted,\n ParticipantEvent2.ParticipantPermissionsChanged,\n // ParticipantEvent.IsSpeakingChanged,\n ParticipantEvent2.TrackPublished,\n ParticipantEvent2.TrackUnpublished,\n ParticipantEvent2.LocalTrackPublished,\n ParticipantEvent2.LocalTrackUnpublished,\n ParticipantEvent2.MediaDevicesError,\n ParticipantEvent2.TrackSubscriptionStatusChanged\n // ParticipantEvent.ConnectionQualityChanged,\n ).pipe(\n map3((p) => {\n const { isMicrophoneEnabled, isCameraEnabled, isScreenShareEnabled } = p;\n const microphoneTrack = p.getTrackPublication(Track6.Source.Microphone);\n const cameraTrack = p.getTrackPublication(Track6.Source.Camera);\n const participantMedia = {\n isCameraEnabled,\n isMicrophoneEnabled,\n isScreenShareEnabled,\n cameraTrack,\n microphoneTrack,\n participant: p\n };\n return participantMedia;\n })\n );\n return participantObserver;\n}\nfunction createTrackObserver(participant, options) {\n return observeParticipantMedia(participant).pipe(\n map3(() => {\n return { publication: getTrackByIdentifier(options) };\n })\n );\n}\nfunction participantInfoObserver(participant) {\n if (!participant) {\n return void 0;\n }\n const observer = observeParticipantEvents(\n participant,\n ParticipantEvent2.ParticipantMetadataChanged,\n ParticipantEvent2.ParticipantNameChanged\n ).pipe(\n map3(({ name, identity, metadata }) => {\n return {\n name,\n identity,\n metadata\n };\n }),\n startWith3({\n name: participant.name,\n identity: participant.identity,\n metadata: participant.metadata\n })\n );\n return observer;\n}\nfunction createConnectionQualityObserver(participant) {\n const observer = participantEventSelector(\n participant,\n ParticipantEvent2.ConnectionQualityChanged\n ).pipe(\n map3(([quality]) => quality),\n startWith3(participant.connectionQuality)\n );\n return observer;\n}\nfunction participantEventSelector(participant, event) {\n const observable = new Observable2((subscribe) => {\n const update = (...params) => {\n subscribe.next(params);\n };\n participant.on(event, update);\n const unsubscribe = () => {\n participant.off(event, update);\n };\n return unsubscribe;\n });\n return observable;\n}\nfunction mutedObserver(trackRef) {\n var _a, _b, _c, _d;\n return observeParticipantEvents(\n trackRef.participant,\n ParticipantEvent2.TrackMuted,\n ParticipantEvent2.TrackUnmuted,\n ParticipantEvent2.TrackSubscribed,\n ParticipantEvent2.TrackUnsubscribed,\n ParticipantEvent2.LocalTrackPublished,\n ParticipantEvent2.LocalTrackUnpublished\n ).pipe(\n map3((participant) => {\n var _a2, _b2;\n const pub = (_a2 = trackRef.publication) != null ? _a2 : participant.getTrackPublication(trackRef.source);\n return (_b2 = pub == null ? void 0 : pub.isMuted) != null ? _b2 : true;\n }),\n startWith3(\n (_d = (_c = (_a = trackRef.publication) == null ? void 0 : _a.isMuted) != null ? _c : (_b = trackRef.participant.getTrackPublication(trackRef.source)) == null ? void 0 : _b.isMuted) != null ? _d : true\n )\n );\n}\nfunction createIsSpeakingObserver(participant) {\n return participantEventSelector(participant, ParticipantEvent2.IsSpeakingChanged).pipe(\n map3(([isSpeaking]) => isSpeaking)\n );\n}\nfunction connectedParticipantsObserver(room, options = {}) {\n var _a;\n let subscriber;\n const observable = new Observable2((sub) => {\n subscriber = sub;\n return () => listener.unsubscribe();\n }).pipe(startWith3(Array.from(room.remoteParticipants.values())));\n const additionalRoomEvents = (_a = options.additionalRoomEvents) != null ? _a : allParticipantRoomEvents;\n const roomEvents = Array.from(\n /* @__PURE__ */ new Set([\n RoomEvent3.ParticipantConnected,\n RoomEvent3.ParticipantDisconnected,\n RoomEvent3.ConnectionStateChanged,\n ...additionalRoomEvents\n ])\n );\n const listener = observeRoomEvents(room, ...roomEvents).subscribe(\n (r) => subscriber == null ? void 0 : subscriber.next(Array.from(r.remoteParticipants.values()))\n );\n if (room.remoteParticipants.size > 0) {\n subscriber == null ? void 0 : subscriber.next(Array.from(room.remoteParticipants.values()));\n }\n return observable;\n}\nfunction connectedParticipantObserver(room, identity, options = {}) {\n var _a;\n const additionalEvents = (_a = options.additionalEvents) != null ? _a : allParticipantEvents;\n const observable = observeRoomEvents(\n room,\n RoomEvent3.ParticipantConnected,\n RoomEvent3.ParticipantDisconnected,\n RoomEvent3.ConnectionStateChanged\n ).pipe(\n switchMap((r) => {\n const participant = r.getParticipantByIdentity(identity);\n if (participant) {\n return observeParticipantEvents(participant, ...additionalEvents);\n } else {\n return new Observable2((subscribe) => subscribe.next(void 0));\n }\n }),\n startWith3(room.getParticipantByIdentity(identity))\n );\n return observable;\n}\nfunction participantPermissionObserver(participant) {\n const observer = participantEventSelector(\n participant,\n ParticipantEvent2.ParticipantPermissionsChanged\n ).pipe(\n map3(() => participant.permissions),\n startWith3(participant.permissions)\n );\n return observer;\n}\nfunction participantByIdentifierObserver(room, { kind, identity }, options = {}) {\n var _a;\n const additionalEvents = (_a = options.additionalEvents) != null ? _a : allParticipantEvents;\n const matchesIdentifier = (participant) => {\n let isMatch = true;\n if (kind) {\n isMatch = isMatch && participant.kind === kind;\n }\n if (identity) {\n isMatch = isMatch && participant.identity === identity;\n }\n return isMatch;\n };\n const observable = observeRoomEvents(\n room,\n RoomEvent3.ParticipantConnected,\n RoomEvent3.ParticipantDisconnected,\n RoomEvent3.ConnectionStateChanged\n ).pipe(\n switchMap((r) => {\n const participant = Array.from(r.remoteParticipants.values()).find(\n (p) => matchesIdentifier(p)\n );\n if (participant) {\n return observeParticipantEvents(participant, ...additionalEvents);\n } else {\n return new Observable2((subscribe) => subscribe.next(void 0));\n }\n }),\n startWith3(Array.from(room.remoteParticipants.values()).find((p) => matchesIdentifier(p)))\n );\n return observable;\n}\nfunction participantAttributesObserver(participant) {\n if (typeof participant === \"undefined\") {\n return new Observable2();\n }\n return participantEventSelector(participant, ParticipantEvent2.AttributesChanged).pipe(\n map3(([changedAttributes]) => {\n return {\n changed: changedAttributes,\n attributes: participant.attributes\n };\n }),\n startWith3({ changed: participant.attributes, attributes: participant.attributes })\n );\n}\n\n// src/components/mediaToggle.ts\nfunction setupMediaToggle(source, room, options, publishOptions, onError) {\n const { localParticipant } = room;\n const getSourceEnabled = (source2, localParticipant2) => {\n let isEnabled = false;\n switch (source2) {\n case Track7.Source.Camera:\n isEnabled = localParticipant2.isCameraEnabled;\n break;\n case Track7.Source.Microphone:\n isEnabled = localParticipant2.isMicrophoneEnabled;\n break;\n case Track7.Source.ScreenShare:\n isEnabled = localParticipant2.isScreenShareEnabled;\n break;\n default:\n break;\n }\n return isEnabled;\n };\n const enabledObserver = observeParticipantMedia(localParticipant).pipe(\n map4((media) => {\n return getSourceEnabled(source, media.participant);\n }),\n startWith4(getSourceEnabled(source, localParticipant))\n );\n const pendingSubject = new Subject();\n const toggle = (forceState, captureOptions) => __async(null, null, function* () {\n try {\n captureOptions != null ? captureOptions : captureOptions = options;\n pendingSubject.next(true);\n switch (source) {\n case Track7.Source.Camera:\n yield localParticipant.setCameraEnabled(\n forceState != null ? forceState : !localParticipant.isCameraEnabled,\n captureOptions,\n publishOptions\n );\n return localParticipant.isCameraEnabled;\n case Track7.Source.Microphone:\n yield localParticipant.setMicrophoneEnabled(\n forceState != null ? forceState : !localParticipant.isMicrophoneEnabled,\n captureOptions,\n publishOptions\n );\n return localParticipant.isMicrophoneEnabled;\n case Track7.Source.ScreenShare:\n yield localParticipant.setScreenShareEnabled(\n forceState != null ? forceState : !localParticipant.isScreenShareEnabled,\n captureOptions,\n publishOptions\n );\n return localParticipant.isScreenShareEnabled;\n default:\n throw new TypeError(\"Tried to toggle unsupported source\");\n }\n } catch (e) {\n if (onError && e instanceof Error) {\n onError == null ? void 0 : onError(e);\n return void 0;\n } else {\n throw e;\n }\n } finally {\n pendingSubject.next(false);\n }\n });\n const className = prefixClass(\"button\");\n return {\n className,\n toggle,\n enabledObserver,\n pendingObserver: pendingSubject.asObservable()\n };\n}\nfunction setupManualToggle() {\n let state = false;\n const enabledSubject = new Subject();\n const pendingSubject = new Subject();\n const toggle = (forceState) => __async(null, null, function* () {\n pendingSubject.next(true);\n state = forceState != null ? forceState : !state;\n enabledSubject.next(state);\n pendingSubject.next(false);\n });\n const className = prefixClass(\"button\");\n return {\n className,\n toggle,\n enabledObserver: enabledSubject.asObservable(),\n pendingObserver: pendingSubject.asObservable()\n };\n}\n\n// src/components/mediaDeviceSelect.ts\nimport {\n Track as Track8,\n getBrowser\n} from \"livekit-client\";\nimport { BehaviorSubject } from \"rxjs\";\nfunction setupDeviceSelector(kind, room, localTrack) {\n const activeDeviceSubject = new BehaviorSubject(void 0);\n const activeDeviceObservable = createActiveDeviceObservable(room, kind);\n const setActiveMediaDevice = (_0, ..._1) => __async(null, [_0, ..._1], function* (id, options = {}) {\n var _a, _b, _c;\n if (localTrack) {\n yield localTrack.setDeviceId(options.exact ? { exact: id } : id);\n const actualId = yield localTrack.getDeviceId(false);\n activeDeviceSubject.next(\n id === \"default\" && localTrack.mediaStreamTrack.label.startsWith(\"Default\") ? id : actualId\n );\n } else if (room) {\n const browser = getBrowser();\n if (kind === \"audiooutput\" && ((browser == null ? void 0 : browser.name) === \"Safari\" || (browser == null ? void 0 : browser.os) === \"iOS\")) {\n log.warn(`Switching audio output device is not supported on Safari and iOS.`);\n return;\n }\n log.debug(`Switching active device of kind \"${kind}\" with id ${id}.`);\n yield room.switchActiveDevice(kind, id, options.exact);\n const actualDeviceId = (_a = room.getActiveDevice(kind)) != null ? _a : id;\n if (actualDeviceId !== id && id !== \"default\") {\n log.info(\n `We tried to select the device with id (${id}), but the browser decided to select the device with id (${actualDeviceId}) instead.`\n );\n }\n let targetTrack = void 0;\n if (kind === \"audioinput\")\n targetTrack = (_b = room.localParticipant.getTrackPublication(Track8.Source.Microphone)) == null ? void 0 : _b.track;\n else if (kind === \"videoinput\") {\n targetTrack = (_c = room.localParticipant.getTrackPublication(Track8.Source.Camera)) == null ? void 0 : _c.track;\n }\n const useDefault = id === \"default\" && !targetTrack || id === \"default\" && (targetTrack == null ? void 0 : targetTrack.mediaStreamTrack.label.startsWith(\"Default\"));\n activeDeviceSubject.next(useDefault ? id : actualDeviceId);\n }\n });\n const className = prefixClass(\"media-device-select\");\n return {\n className,\n activeDeviceObservable,\n setActiveMediaDevice\n };\n}\n\n// src/components/disconnectButton.ts\nfunction setupDisconnectButton(room) {\n const disconnect = (stopTracks) => {\n room.disconnect(stopTracks);\n };\n const className = prefixClass(\"disconnect-button\");\n return { className, disconnect };\n}\n\n// src/components/connectionQualityIndicator.ts\nfunction setupConnectionQualityIndicator(participant) {\n const className = prefixClass(\"connection-quality\");\n const connectionQualityObserver = createConnectionQualityObserver(participant);\n return { className, connectionQualityObserver };\n}\n\n// src/components/trackMutedIndicator.ts\nimport { Track as Track9 } from \"livekit-client\";\nfunction setupTrackMutedIndicator(trackRef) {\n let classForSource = \"track-muted-indicator-camera\";\n switch (trackRef.source) {\n case Track9.Source.Camera:\n classForSource = \"track-muted-indicator-camera\";\n break;\n case Track9.Source.Microphone:\n classForSource = \"track-muted-indicator-microphone\";\n break;\n default:\n break;\n }\n const className = prefixClass(classForSource);\n const mediaMutedObserver = mutedObserver(trackRef);\n return { className, mediaMutedObserver };\n}\n\n// src/components/participantName.ts\nfunction setupParticipantName(participant) {\n const infoObserver = participantInfoObserver(participant);\n return { className: \"lk-participant-name\", infoObserver };\n}\n\n// src/components/participantTile.ts\nfunction setupParticipantTile() {\n const className = prefixClass(\"participant-tile\");\n return {\n className\n };\n}\n\n// src/components/chat.ts\nimport { compareVersions, RoomEvent as RoomEvent4 } from \"livekit-client\";\nimport {\n BehaviorSubject as BehaviorSubject3,\n Subject as Subject2,\n scan,\n map as map6,\n takeUntil,\n from,\n filter as filter3,\n concatMap,\n mergeMap,\n finalize,\n of\n} from \"rxjs\";\n\n// src/observables/dataChannel.ts\nimport { BehaviorSubject as BehaviorSubject2, filter as filter2, map as map5 } from \"rxjs\";\nvar DataTopic = {\n CHAT: \"lk.chat\",\n TRANSCRIPTION: \"lk.transcription\"\n};\nvar LegacyDataTopic = {\n CHAT: \"lk-chat-topic\"\n};\nfunction sendMessage(_0, _1) {\n return __async(this, arguments, function* (localParticipant, payload, options = {}) {\n const { reliable, destinationIdentities, topic } = options;\n yield localParticipant.publishData(payload, {\n destinationIdentities,\n topic,\n reliable\n });\n });\n}\nfunction setupDataMessageHandler(room, topic, onMessage) {\n const topics = Array.isArray(topic) ? topic : [topic];\n const messageObservable = createDataObserver(room).pipe(\n filter2(\n ([, , , messageTopic]) => topic === void 0 || messageTopic !== void 0 && topics.includes(messageTopic)\n ),\n map5(([payload, participant, , messageTopic]) => {\n const msg = {\n payload,\n topic: messageTopic,\n from: participant\n };\n onMessage == null ? void 0 : onMessage(msg);\n return msg;\n })\n );\n const isSending$ = new BehaviorSubject2(false);\n let pendingSends = 0;\n const send = (_0, ..._1) => __async(null, [_0, ..._1], function* (payload, options = {}) {\n pendingSends += 1;\n isSending$.next(true);\n try {\n yield sendMessage(room.localParticipant, payload, __spreadValues({ topic: topics[0] }, options));\n } finally {\n pendingSends -= 1;\n isSending$.next(pendingSends > 0);\n }\n });\n return { messageObservable, isSendingObservable: isSending$.asObservable(), send };\n}\nfunction setupChatMessageHandler(room) {\n const chatObservable = createChatObserver(room);\n const send = (text, options) => __async(null, null, function* () {\n const msg = yield room.localParticipant.sendChatMessage(text, options);\n yield room.localParticipant.sendText(text, options);\n return __spreadProps(__spreadValues({}, msg), {\n type: \"chatMessage\",\n from: room.localParticipant,\n attachedFiles: options.attachments\n });\n });\n const edit = (text, originalMsg) => __async(null, null, function* () {\n const msg = yield room.localParticipant.editChatMessage(text, originalMsg);\n return msg;\n });\n return { chatObservable, send, edit };\n}\n\n// src/helper/future.ts\nvar Future = class {\n constructor(futureBase, onFinally) {\n this._isResolved = false;\n this.onFinally = onFinally;\n this.promise = new Promise((resolve, reject) => __async(this, null, function* () {\n this.resolve = resolve;\n this.reject = reject;\n if (futureBase) {\n yield futureBase(resolve, reject);\n }\n })).finally(() => {\n var _a;\n this._isResolved = true;\n (_a = this.onFinally) == null ? void 0 : _a.call(this);\n });\n }\n get isResolved() {\n return this._isResolved;\n }\n};\n\n// src/components/chat.ts\nvar topicSubjectMap = /* @__PURE__ */ new WeakMap();\nvar streamIdToAttachments = /* @__PURE__ */ new Map();\nfunction isIgnorableChatMessage(msg) {\n return msg.ignoreLegacy == true;\n}\nvar decodeLegacyMsg = (message) => JSON.parse(new TextDecoder().decode(message));\nvar encodeLegacyMsg = (message) => new TextEncoder().encode(JSON.stringify(message));\nfunction setupChat(room, options) {\n var _a, _b, _c, _d, _e, _f;\n const serverSupportsDataStreams = () => {\n var _a2, _b2, _c2;\n return ((_a2 = room.serverInfo) == null ? void 0 : _a2.edition) === 1 || !!((_b2 = room.serverInfo) == null ? void 0 : _b2.version) && compareVersions((_c2 = room.serverInfo) == null ? void 0 : _c2.version, \"1.8.2\") > 0;\n };\n const topic = (_a = options == null ? void 0 : options.channelTopic) != null ? _a : DataTopic.CHAT;\n const legacyTopic = (_b = options == null ? void 0 : options.channelTopic) != null ? _b : LegacyDataTopic.CHAT;\n const isFirstTopicForRoom = !topicSubjectMap.has(room);\n const topicMap = (_c = topicSubjectMap.get(room)) != null ? _c : /* @__PURE__ */ new Map();\n const needsSetup = !topicMap.has(topic);\n const topicState = (_d = topicMap.get(topic)) != null ? _d : {\n messageSubject: new Subject2(),\n onDestroyObservable: new Subject2()\n };\n const { messageSubject, onDestroyObservable } = topicState;\n topicMap.set(topic, topicState);\n topicSubjectMap.set(room, topicMap);\n if (isFirstTopicForRoom) {\n room.once(RoomEvent4.Disconnected, () => {\n const topics = topicSubjectMap.get(room);\n topicSubjectMap.delete(room);\n topics == null ? void 0 : topics.forEach(({ messageSubject: subject, onDestroyObservable: onDestroy }, chatTopic) => {\n onDestroy.next();\n onDestroy.complete();\n subject.complete();\n room.unregisterTextStreamHandler(chatTopic);\n room.unregisterByteStreamHandler(chatTopic);\n });\n });\n }\n const finalMessageDecoder = (_e = options == null ? void 0 : options.messageDecoder) != null ? _e : decodeLegacyMsg;\n if (needsSetup) {\n room.registerTextStreamHandler(topic, (reader, participantInfo) => __async(null, null, function* () {\n const { id, timestamp, attributes, attachedStreamIds } = reader.info;\n const attachments = new Map(\n (attachedStreamIds != null ? attachedStreamIds : []).map((id2) => [\n id2,\n new Future()\n ])\n );\n streamIdToAttachments.set(id, attachments);\n const streamObservable = from(reader).pipe(\n scan((acc, chunk2) => {\n return acc + chunk2;\n }),\n mergeMap((chunk2) => {\n if (attachments.size === 0) {\n return of({ chunk: chunk2, attachedFiles: [] });\n } else {\n return from(attachments.values()).pipe(\n // `concatMap`, not `mergeMap`: `attachments` is built from `attachedStreamIds`, so it is\n // already in the sender's order, but `mergeMap` emits each promise as it RESOLVES — which\n // ordered `attachedFiles` by download completion (i.e. smallest file first). All the\n // promises are in flight either way; `concatMap` only sequences the emissions.\n concatMap((attachment) => from(attachment.promise)),\n scan(\n (acc, attachment) => [\n ...acc,\n // Preserve the MIME type: `new File(buffer, name)` leaves `File.type` empty, and\n // consumers (including `ChatEntry`) test `file.type.startsWith('image/')`, which could\n // never be true for a received attachment.\n new File(attachment.buffer, attachment.fileName, { type: attachment.mimeType })\n ],\n []\n ),\n map6((attachedFiles) => ({ chunk: chunk2, attachedFiles }))\n );\n }\n }),\n map6(({ chunk: chunk2, attachedFiles }) => {\n return {\n id,\n timestamp,\n message: chunk2,\n from: room.getParticipantByIdentity(participantInfo.identity),\n type: \"chatMessage\",\n attributes,\n attachedFiles\n // editTimestamp: type === 'update' ? timestamp : undefined,\n };\n }),\n finalize(() => streamIdToAttachments.delete(id))\n );\n streamObservable.subscribe({\n next: (value) => messageSubject.next(value)\n });\n }));\n room.registerByteStreamHandler(topic, (reader) => __async(null, null, function* () {\n var _a2, _b2;\n const { id: attachmentStreamId } = reader.info;\n const foundStreamAttachmentPair = Array.from(streamIdToAttachments).find(\n ([, attachments]) => attachments.has(attachmentStreamId)\n );\n if (!foundStreamAttachmentPair) {\n return;\n }\n const streamId = foundStreamAttachmentPair[0];\n const bufferList = [];\n try {\n for (var iter = __forAwait(reader), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {\n const buffer = temp.value;\n bufferList.push(buffer);\n }\n } catch (temp) {\n error = [temp];\n } finally {\n try {\n more && (temp = iter.return) && (yield temp.call(iter));\n } finally {\n if (error)\n throw error[0];\n }\n }\n const attachment = (_a2 = streamIdToAttachments.get(streamId)) == null ? void 0 : _a2.get(attachmentStreamId);\n if (!attachment) {\n return;\n }\n (_b2 = attachment.resolve) == null ? void 0 : _b2.call(attachment, {\n fileName: reader.info.name,\n mimeType: reader.info.mimeType,\n buffer: bufferList\n });\n }));\n const { messageObservable } = setupDataMessageHandler(room, [legacyTopic]);\n messageObservable.pipe(\n map6((msg) => {\n const parsedMessage = finalMessageDecoder(msg.payload);\n if (isIgnorableChatMessage(parsedMessage)) {\n return void 0;\n }\n const newMessage = __spreadProps(__spreadValues({}, parsedMessage), {\n type: \"chatMessage\",\n from: msg.from\n });\n return newMessage;\n }),\n filter3((msg) => !!msg),\n takeUntil(onDestroyObservable)\n ).subscribe(messageSubject);\n }\n const messagesObservable = messageSubject.pipe(\n scan((acc, value) => {\n if (\"id\" in value && acc.find((msg) => {\n var _a2, _b2;\n return ((_a2 = msg.from) == null ? void 0 : _a2.identity) === ((_b2 = value.from) == null ? void 0 : _b2.identity) && msg.id === value.id;\n })) {\n const replaceIndex = acc.findIndex((msg) => msg.id === value.id);\n if (replaceIndex > -1) {\n const originalMsg = acc[replaceIndex];\n acc[replaceIndex] = __spreadProps(__spreadValues({}, value), {\n timestamp: originalMsg.timestamp,\n editTimestamp: value.timestamp\n });\n }\n return [...acc];\n }\n return [...acc, value];\n }, []),\n takeUntil(onDestroyObservable)\n );\n const isSending$ = new BehaviorSubject3(false);\n let pendingSends = 0;\n const finalMessageEncoder = (_f = options == null ? void 0 : options.messageEncoder) != null ? _f : encodeLegacyMsg;\n const send = (message, options2) => __async(null, null, function* () {\n var _a2;\n if (!options2) {\n options2 = {};\n }\n (_a2 = options2.topic) != null ? _a2 : options2.topic = topic;\n pendingSends += 1;\n isSending$.next(true);\n try {\n const info = yield room.localParticipant.sendText(message, options2);\n const legacyChatMsg = {\n id: info.id,\n timestamp: Date.now(),\n message\n };\n const chatMsg = __spreadProps(__spreadValues({}, legacyChatMsg), {\n attachedFiles: options2.attachments\n });\n const receivedChatMsg = __spreadProps(__spreadValues({}, chatMsg), {\n type: \"chatMessage\",\n from: room.localParticipant,\n attributes: options2.attributes\n });\n messageSubject.next(receivedChatMsg);\n const encodedLegacyMsg = finalMessageEncoder(__spreadProps(__spreadValues({}, legacyChatMsg), {\n ignoreLegacy: serverSupportsDataStreams()\n }));\n try {\n yield sendMessage(room.localParticipant, encodedLegacyMsg, {\n reliable: true,\n topic: legacyTopic\n });\n } catch (error) {\n log.info(\"could not send message in legacy chat format\", error);\n }\n return receivedChatMsg;\n } finally {\n pendingSends -= 1;\n isSending$.next(pendingSends > 0);\n }\n });\n return {\n messageObservable: messagesObservable,\n isSendingObservable: isSending$,\n send\n };\n}\n\n// src/components/startAudio.ts\nfunction setupStartAudio() {\n const handleStartAudioPlayback = (room) => __async(null, null, function* () {\n log.info(\"Start Audio for room: \", room);\n yield room.startAudio();\n });\n const className = prefixClass(\"start-audio-button\");\n return { className, roomAudioPlaybackAllowedObservable, handleStartAudioPlayback };\n}\n\n// src/components/startVideo.ts\nfunction setupStartVideo() {\n const handleStartVideoPlayback = (room) => __async(null, null, function* () {\n log.info(\"Start Video for room: \", room);\n yield room.startVideo();\n });\n const className = prefixClass(\"start-audio-button\");\n return { className, roomVideoPlaybackAllowedObservable, handleStartVideoPlayback };\n}\n\n// src/components/chatToggle.ts\nfunction setupChatToggle() {\n const className = [prefixClass(\"button\"), prefixClass(\"chat-toggle\")].join(\" \");\n return { className };\n}\n\n// src/components/focusToggle.ts\nfunction setupFocusToggle() {\n const className = [prefixClass(\"button\"), prefixClass(\"focus-toggle-button\")].join(\" \");\n return { className };\n}\n\n// src/components/clearPinButton.ts\nfunction setupClearPinButton() {\n const className = \"lk-clear-pin-button lk-button\";\n return { className };\n}\n\n// src/components/room.ts\nfunction setupLiveKitRoom() {\n const className = \"lk-room-container\";\n return { className };\n}\n\n// src/observables/track.ts\nimport { RoomEvent as RoomEvent5, TrackEvent } from \"livekit-client\";\nimport { map as map7, Observable as Observable3, startWith as startWith5 } from \"rxjs\";\nfunction trackObservable(track) {\n const trackObserver = observeTrackEvents(\n track,\n TrackEvent.Muted,\n TrackEvent.Unmuted,\n TrackEvent.Subscribed,\n TrackEvent.Unsubscribed\n );\n return trackObserver;\n}\nfunction observeTrackEvents(track, ...events) {\n const observable = new Observable3((subscribe) => {\n const onTrackUpdate = () => {\n subscribe.next(track);\n };\n events.forEach((evt) => {\n track.on(evt, onTrackUpdate);\n });\n const unsubscribe = () => {\n events.forEach((evt) => {\n track.off(evt, onTrackUpdate);\n });\n };\n return unsubscribe;\n }).pipe(startWith5(track));\n return observable;\n}\nfunction getTrackReferences(room, sources, onlySubscribedTracks = true) {\n const localParticipant = room.localParticipant;\n const allParticipants = [localParticipant, ...Array.from(room.remoteParticipants.values())];\n const trackReferences = [];\n allParticipants.forEach((participant) => {\n sources.forEach((source) => {\n const sourceReferences = Array.from(\n participant.trackPublications.values()\n ).filter(\n (track) => track.source === source && // either return all or only the ones that are subscribed\n (!onlySubscribedTracks || track.track)\n ).map((track) => {\n return {\n participant,\n publication: track,\n source: track.source\n };\n });\n trackReferences.push(...sourceReferences);\n });\n });\n return { trackReferences, participants: allParticipants };\n}\nfunction getParticipantTrackRefs(participant, identifier, onlySubscribedTracks = false) {\n const { sources, kind, name } = identifier;\n const sourceReferences = Array.from(participant.trackPublications.values()).filter(\n (pub) => (!sources || sources.includes(pub.source)) && (!kind || pub.kind === kind) && (!name || pub.trackName === name) && // either return all or only the ones that are subscribed\n (!onlySubscribedTracks || pub.track)\n ).map((track) => {\n return {\n participant,\n publication: track,\n source: track.source\n };\n });\n return sourceReferences;\n}\nfunction trackReferencesObservable(room, sources, options) {\n var _a, _b;\n const additionalRoomEvents = (_a = options.additionalRoomEvents) != null ? _a : allParticipantRoomEvents;\n const onlySubscribedTracks = (_b = options.onlySubscribed) != null ? _b : true;\n const roomEvents = Array.from(\n (/* @__PURE__ */ new Set([\n RoomEvent5.ParticipantConnected,\n RoomEvent5.ParticipantDisconnected,\n RoomEvent5.ConnectionStateChanged,\n RoomEvent5.LocalTrackPublished,\n RoomEvent5.LocalTrackUnpublished,\n RoomEvent5.TrackPublished,\n RoomEvent5.TrackUnpublished,\n RoomEvent5.TrackSubscriptionStatusChanged,\n ...additionalRoomEvents\n ])).values()\n );\n const observable = observeRoomEvents(room, ...roomEvents).pipe(\n map7((room2) => {\n const data = getTrackReferences(room2, sources, onlySubscribedTracks);\n log.debug(`TrackReference[] was updated. (length ${data.trackReferences.length})`, data);\n return data;\n }),\n startWith5(getTrackReferences(room, sources, onlySubscribedTracks))\n );\n return observable;\n}\nfunction participantTracksObservable(participant, trackIdentifier) {\n const observable = observeParticipantEvents(participant, ...participantTrackEvents).pipe(\n map7((participant2) => {\n const data = getParticipantTrackRefs(participant2, trackIdentifier);\n log.debug(`TrackReference[] was updated. (length ${data.length})`, data);\n return data;\n }),\n startWith5(getParticipantTrackRefs(participant, trackIdentifier))\n );\n return observable;\n}\nfunction trackEventSelector(publication, event) {\n const observable = new Observable3((subscribe) => {\n const update = (...params) => {\n subscribe.next(params);\n };\n publication.on(event, update);\n const unsubscribe = () => {\n publication.off(event, update);\n };\n return unsubscribe;\n });\n return observable;\n}\nfunction trackTranscriptionObserver(publication) {\n return trackEventSelector(publication, TrackEvent.TranscriptionReceived);\n}\nfunction trackSyncTimeObserver(track) {\n return trackEventSelector(track, TrackEvent.TimeSyncUpdate).pipe(\n map7(([timeUpdate]) => timeUpdate)\n );\n}\n\n// src/observables/dom-event.ts\nimport { concat as concat2, distinctUntilChanged, fromEvent, map as map8, of as of2, skipUntil, timeout } from \"rxjs\";\nfunction createInteractingObservable(htmlElement, inactiveAfter = 1e3) {\n if (htmlElement === null) return of2(false);\n const move$ = fromEvent(htmlElement, \"mousemove\", { passive: true }).pipe(map8(() => true));\n const moveAndStop$ = move$.pipe(\n timeout({\n each: inactiveAfter,\n with: () => concat2(of2(false), moveAndStop$.pipe(skipUntil(move$)))\n }),\n distinctUntilChanged()\n );\n return moveAndStop$;\n}\n\n// src/persistent-storage/local-storage-helpers.ts\nfunction saveToLocalStorage(key, value) {\n if (typeof localStorage === \"undefined\") {\n log.error(\"Local storage is not available.\");\n return;\n }\n try {\n if (value) {\n const nonEmptySettings = Object.fromEntries(\n Object.entries(value).filter(([, value2]) => value2 !== \"\")\n );\n localStorage.setItem(key, JSON.stringify(nonEmptySettings));\n }\n } catch (error) {\n log.error(`Error setting item to local storage: ${error}`);\n }\n}\nfunction loadFromLocalStorage(key) {\n if (typeof localStorage === \"undefined\") {\n log.error(\"Local storage is not available.\");\n return void 0;\n }\n try {\n const item = localStorage.getItem(key);\n if (!item) {\n log.warn(`Item with key ${key} does not exist in local storage.`);\n return void 0;\n }\n return JSON.parse(item);\n } catch (error) {\n log.error(`Error getting item from local storage: ${error}`);\n return void 0;\n }\n}\nfunction createLocalStorageInterface(key) {\n return {\n load: () => loadFromLocalStorage(key),\n save: (value) => saveToLocalStorage(key, value)\n };\n}\n\n// src/persistent-storage/user-choices.ts\nvar USER_CHOICES_KEY = `${cssPrefix}-user-choices`;\nvar defaultUserChoices = {\n videoEnabled: true,\n audioEnabled: true,\n videoDeviceId: \"default\",\n audioDeviceId: \"default\",\n username: \"\"\n};\nvar { load, save } = createLocalStorageInterface(USER_CHOICES_KEY);\nfunction saveUserChoices(userChoices, preventSave = false) {\n if (preventSave === true) {\n return;\n }\n save(userChoices);\n}\nfunction loadUserChoices(defaults, preventLoad = false) {\n var _a, _b, _c, _d, _e;\n const fallback = {\n videoEnabled: (_a = defaults == null ? void 0 : defaults.videoEnabled) != null ? _a : defaultUserChoices.videoEnabled,\n audioEnabled: (_b = defaults == null ? void 0 : defaults.audioEnabled) != null ? _b : defaultUserChoices.audioEnabled,\n videoDeviceId: (_c = defaults == null ? void 0 : defaults.videoDeviceId) != null ? _c : defaultUserChoices.videoDeviceId,\n audioDeviceId: (_d = defaults == null ? void 0 : defaults.audioDeviceId) != null ? _d : defaultUserChoices.audioDeviceId,\n username: (_e = defaults == null ? void 0 : defaults.username) != null ? _e : defaultUserChoices.username\n };\n if (preventLoad) {\n return fallback;\n } else {\n const maybeLoadedObject = load();\n const result = __spreadValues(__spreadValues({}, fallback), maybeLoadedObject != null ? maybeLoadedObject : {});\n return result;\n }\n}\n\n// src/components/textStream.ts\nimport { from as from2, scan as scan2, Subject as Subject3 } from \"rxjs\";\nimport { share, tap } from \"rxjs/operators\";\nvar observableCache = /* @__PURE__ */ new WeakMap();\nfunction getTopicCache(room) {\n let topicCache = observableCache.get(room);\n if (!topicCache) {\n topicCache = /* @__PURE__ */ new Map();\n observableCache.set(room, topicCache);\n }\n return topicCache;\n}\nfunction setupTextStream(room, topic) {\n const topicCache = getTopicCache(room);\n const existingObservable = topicCache.get(topic);\n if (existingObservable) {\n return existingObservable;\n }\n const textStreamsSubject = new Subject3();\n let textStreams = [];\n const segmentAttribute = \"lk.segment_id\" /* TranscriptionSegmentId */;\n const sharedObservable = textStreamsSubject.pipe(\n tap({\n subscribe: () => {\n textStreams = [];\n room.registerTextStreamHandler(topic, (reader, participantInfo) => __async(null, null, function* () {\n var _a;\n const streamObservable = from2(reader).pipe(\n scan2((acc, chunk2) => {\n return acc + chunk2;\n }, \"\")\n );\n const isTranscription = !!((_a = reader.info.attributes) == null ? void 0 : _a[segmentAttribute]);\n streamObservable.subscribe((accumulatedText) => {\n const index = textStreams.findIndex(\n (stream) => {\n var _a2, _b;\n return stream.streamInfo.id === reader.info.id || isTranscription && ((_a2 = stream.streamInfo.attributes) == null ? void 0 : _a2[segmentAttribute]) === ((_b = reader.info.attributes) == null ? void 0 : _b[segmentAttribute]);\n }\n );\n if (index !== -1) {\n textStreams[index] = __spreadProps(__spreadValues({}, textStreams[index]), {\n text: accumulatedText,\n // Carry the latest streamInfo forward. Transcription updates for a\n // segment arrive as separate streams sharing the same lk.segment_id;\n // keeping the original streamInfo would freeze attributes that change\n // over the segment's lifetime — notably lk.transcription_final flipping\n // \"false\" -> \"true\" on the final user STT result.\n streamInfo: reader.info\n });\n textStreamsSubject.next([...textStreams]);\n } else {\n textStreams.push({\n text: accumulatedText,\n participantInfo,\n streamInfo: reader.info\n });\n textStreamsSubject.next([...textStreams]);\n }\n });\n }));\n },\n finalize: () => {\n room.unregisterTextStreamHandler(topic);\n }\n }),\n share()\n );\n topicCache.set(topic, sharedObservable);\n return sharedObservable;\n}\nexport {\n DataTopic,\n GRID_LAYOUTS,\n LegacyDataTopic,\n PIN_DEFAULT_STATE,\n ParticipantAgentAttributes,\n WIDGET_DEFAULT_STATE,\n activeSpeakerObserver,\n addMediaTimestampToTranscription,\n allParticipantEvents,\n allParticipantRoomEvents,\n allRemoteParticipantEvents,\n allRemoteParticipantRoomEvents,\n attachIfSubscribed,\n computeMenuPosition,\n connectedParticipantObserver,\n connectedParticipantsObserver,\n connectionStateObserver,\n createActiveDeviceObservable,\n createChatObserver,\n createConnectionQualityObserver,\n createDataObserver,\n createDefaultGrammar,\n createEmailRegExp,\n createInteractingObservable,\n createIsSpeakingObserver,\n createMediaDeviceObserver,\n createTrackObserver,\n createUrlRegExp,\n cssPrefix,\n dedupeSegments,\n defaultUserChoices,\n didActiveSegmentsChange,\n encryptionStatusObservable,\n getActiveTranscriptionSegments,\n getScrollBarWidth,\n getTrackByIdentifier,\n getTrackReferenceId,\n getTrackReferenceSource,\n isEqualTrackRef,\n isLocal,\n isMobileBrowser,\n isParticipantTrackReferencePinned,\n isPlaceholderReplacement,\n isRemote,\n isSourceWitOptions,\n isSourcesWithOptions,\n isTrackReference,\n isTrackReferencePinned,\n isTrackReferencePlaceholder,\n isWeb,\n loadUserChoices,\n log,\n mutedObserver,\n observeParticipantEvents,\n observeParticipantMedia,\n observeRoomEvents,\n observeTrackEvents,\n participantAttributesObserver,\n participantByIdentifierObserver,\n participantEventSelector,\n participantInfoObserver,\n participantPermissionObserver,\n participantTrackEvents,\n participantTracksObservable,\n recordingStatusObservable,\n roomAudioPlaybackAllowedObservable,\n roomEventSelector,\n roomInfoObserver,\n roomObserver,\n roomVideoPlaybackAllowedObservable,\n saveUserChoices,\n screenShareObserver,\n selectGridLayout,\n sendMessage,\n setDifference,\n setLogExtension,\n setLogLevel,\n setupChat,\n setupChatMessageHandler,\n setupChatToggle,\n setupClearPinButton,\n setupConnectionQualityIndicator,\n setupDataMessageHandler,\n setupDeviceSelector,\n setupDisconnectButton,\n setupFocusToggle,\n setupLiveKitRoom,\n setupManualToggle,\n setupMediaToggle,\n setupMediaTrack,\n setupParticipantName,\n setupParticipantTile,\n setupStartAudio,\n setupStartVideo,\n setupTextStream,\n setupTrackMutedIndicator,\n sortParticipants,\n sortTrackReferences,\n supportsScreenSharing,\n tokenize,\n trackEventSelector,\n trackObservable,\n trackReferencesObservable,\n trackSyncTimeObserver,\n trackTranscriptionObserver,\n updatePages,\n wasClickOutside\n};\n//# sourceMappingURL=index.mjs.map","import { createDefaultGrammar, tokenize } from '@livekit/components-core';\nimport { h, type VNodeChild } from 'vue';\n\nexport type MessageFormatter = (message: string) => VNodeChild;\n\nconst PROTOCOL_PATTERN = /^https?:\\/\\//iu;\n\nfunction linkHref(type: string, content: string): string {\n\tif (type !== 'url') {\n\t\treturn `mailto:${content}`;\n\t}\n\n\tif (PROTOCOL_PATTERN.test(content)) {\n\t\treturn content;\n\t}\n\n\treturn `https://${content}`;\n}\n\nexport function formatChatMessageLinks(message: string): VNodeChild {\n\treturn tokenize(message, createDefaultGrammar()).map((token) => {\n\t\tif (typeof token === 'string') {\n\t\t\treturn token;\n\t\t}\n\n\t\tconst content = token.content;\n\t\tconst href = linkHref(token.type, content);\n\n\t\treturn h('a', { class: 'lk-chat-link', href, target: '_blank', rel: 'noreferrer' }, content);\n\t});\n}\n","import { computed, type ComputedRef } from 'vue';\n\nexport type LkSize = 'sm' | 'md' | 'lg';\n\nexport interface LkStyleProps {\n\treadonly size?: LkSize;\n\treadonly unstyled?: boolean;\n}\n\nexport interface LkStyleAttrs {\n\treadonly class: string[];\n\treadonly 'data-lk-size': LkSize | undefined;\n}\n\nfunction isClassName(value: string | false | undefined): value is string {\n\treturn typeof value === 'string' && value !== '';\n}\n\nexport function useStyleAttrs(\n\tprops: LkStyleProps,\n\tclasses: () => (string | false | undefined)[],\n): ComputedRef<LkStyleAttrs> {\n\treturn computed<LkStyleAttrs>(() => {\n\t\tconst attrs: LkStyleAttrs = {\n\t\t\tclass: props.unstyled === true ? [] : classes().filter(isClassName),\n\t\t\t'data-lk-size': props.size,\n\t\t};\n\n\t\treturn attrs;\n\t});\n}\n","import type { VNodeChild } from 'vue';\n\nexport interface RenderNodeProps {\n\treadonly node?: VNodeChild;\n}\n\nexport function RenderNode(props: RenderNodeProps): VNodeChild {\n\treturn props.node;\n}\n\nRenderNode.props = ['node'];\n","<template>\n\t<li\n\t\tv-bind=\"styleAttrs\"\n\t\t:title=\"time.toLocaleTimeString(locale, { timeStyle: 'full' })\"\n\t\t:data-lk-message-origin=\"entry.from?.isLocal ? 'local' : 'remote'\"\n\t>\n\t\t<span\n\t\t\tv-if=\"!hideTimestamp || !hideName || hasBeenEdited\"\n\t\t\tclass=\"lk-meta-data\"\n\t\t>\n\t\t\t<strong\n\t\t\t\tv-if=\"!hideName\"\n\t\t\t\tclass=\"lk-participant-name\"\n\t\t\t\t>{{ name }}</strong\n\t\t\t>\n\t\t\t<span\n\t\t\t\tv-if=\"!hideTimestamp || hasBeenEdited\"\n\t\t\t\tclass=\"lk-timestamp\"\n\t\t\t>\n\t\t\t\t<template v-if=\"hasBeenEdited\">edited </template>\n\t\t\t\t{{ time.toLocaleTimeString(locale, { timeStyle: 'short' }) }}\n\t\t\t</span>\n\t\t</span>\n\t\t<span class=\"lk-message-body\"><RenderNode :node=\"body\" /></span>\n\t\t<span\n\t\t\tv-if=\"images.length > 0\"\n\t\t\tclass=\"lk-message-attachments\"\n\t\t>\n\t\t\t<img\n\t\t\t\tv-for=\"image in images\"\n\t\t\t\t:key=\"image.url\"\n\t\t\t\t:src=\"image.url\"\n\t\t\t\t:alt=\"image.name\"\n\t\t\t/>\n\t\t</span>\n\t</li>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { ReceivedChatMessage } from '@livekit/components-core';\n\timport { computed, shallowRef, watch, type VNodeChild } from 'vue';\n\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\n\timport type { MessageFormatter } from './chat.utils';\n\timport { RenderNode } from './render-node';\n\n\texport interface ChatEntryProps extends LkStyleProps {\n\t\tentry: ReceivedChatMessage;\n\t\thideName?: boolean;\n\t\thideTimestamp?: boolean;\n\t\tmessageFormatter?: MessageFormatter;\n\t}\n\n\tinterface ImageAttachment {\n\t\treadonly name: string;\n\t\treadonly url: string;\n\t}\n\n\tconst props = withDefaults(defineProps<ChatEntryProps>(), {\n\t\thideName: false,\n\t\thideTimestamp: false,\n\t\tmessageFormatter: undefined,\n\t});\n\n\tconst locale = typeof navigator !== 'undefined' ? navigator.language : 'en-US';\n\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-chat-entry']);\n\n\tconst images = shallowRef<ImageAttachment[]>([]);\n\n\tconst body = computed<VNodeChild>(() => {\n\t\treturn props.messageFormatter === undefined\n\t\t\t? props.entry.message\n\t\t\t: props.messageFormatter(props.entry.message);\n\t});\n\n\tconst hasBeenEdited = computed<boolean>(() => {\n\t\treturn props.entry.editTimestamp !== undefined;\n\t});\n\n\tconst time = computed<Date>(() => {\n\t\treturn new Date(props.entry.timestamp);\n\t});\n\n\tconst name = computed<string | undefined>(() => {\n\t\tconst participantName = props.entry.from?.name;\n\n\t\tif (participantName !== undefined && participantName !== '') {\n\t\t\treturn participantName;\n\t\t}\n\n\t\treturn props.entry.from?.identity;\n\t});\n\n\twatch(\n\t\t() => props.entry.attachedFiles,\n\t\t(files, _previous, onCleanup) => {\n\t\t\tconst created = (files ?? [])\n\t\t\t\t.filter((file) => file.type.startsWith('image/'))\n\t\t\t\t.map((file) => ({ name: file.name, url: URL.createObjectURL(file) }));\n\n\t\t\timages.value = created;\n\n\t\t\tonCleanup(() => {\n\t\t\t\tfor (const image of created) {\n\t\t\t\t\tURL.revokeObjectURL(image.url);\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\t{ immediate: true },\n\t);\n</script>\n","import { computed, customRef, effectScope, getCurrentInstance, getCurrentScope, hasInjectionContext, inject, isReactive, isReadonly, isRef, nextTick, onBeforeMount, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, provide, reactive, readonly, ref, shallowReadonly, shallowRef, toRef as toRef$1, toRefs as toRefs$1, toValue, unref, watch, watchEffect } from \"vue\";\n// computedEager/index.ts\n/**\n*\n* @deprecated This function will be removed in future version.\n*\n* Note: If you are using Vue 3.4+, you can straight use computed instead.\n* Because in Vue 3.4+, if computed new value does not change,\n* computed, effect, watch, watchEffect, render dependencies will not be triggered.\n* refer: https://github.com/vuejs/core/pull/5912\n*\n* @param fn effect function\n* @param options WatchOptionsBase\n* @returns readonly shallowRef\n*/\nfunction computedEager(fn, options) {\n\tvar _options$flush;\n\tconst result = shallowRef();\n\twatchEffect(() => {\n\t\tresult.value = fn();\n\t}, {\n\t\t...options,\n\t\tflush: (_options$flush = options === null || options === void 0 ? void 0 : options.flush) !== null && _options$flush !== void 0 ? _options$flush : \"sync\"\n\t});\n\treturn readonly(result);\n}\n/** @deprecated use `computedEager` instead */\nconst eagerComputed = computedEager;\n// computedWithControl/index.ts\n/**\n* Explicitly define the deps of computed.\n*\n* @param source\n* @param fn\n*/\nfunction computedWithControl(source, fn, options = {}) {\n\tlet v = void 0;\n\tlet track;\n\tlet trigger;\n\tlet dirty = true;\n\tconst update = () => {\n\t\tdirty = true;\n\t\ttrigger();\n\t};\n\twatch(source, update, {\n\t\tflush: \"sync\",\n\t\t...options\n\t});\n\tconst get = typeof fn === \"function\" ? fn : fn.get;\n\tconst set = typeof fn === \"function\" ? void 0 : fn.set;\n\tconst result = customRef((_track, _trigger) => {\n\t\ttrack = _track;\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\tif (dirty) {\n\t\t\t\t\tv = get(v);\n\t\t\t\t\tdirty = false;\n\t\t\t\t}\n\t\t\t\ttrack();\n\t\t\t\treturn v;\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\tset === null || set === void 0 || set(v);\n\t\t\t}\n\t\t};\n\t});\n\tresult.trigger = update;\n\treturn result;\n}\n/** @deprecated use `computedWithControl` instead */\nconst controlledComputed = computedWithControl;\n// createDisposableDirective/index.ts\n/**\n* Utility for authoring disposable directives. Reactive effects created within `mounted` directive hook will be tracked and automatically disposed when directive is unmounted.\n*\n* @see https://vueuse.org/createDisposableDirective\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createDisposableDirective(origin = {}) {\n\tfunction isFunc(fn) {\n\t\treturn typeof fn === \"function\";\n\t}\n\tconst normalisedOrigin = isFunc(origin) ? {\n\t\tmounted: origin,\n\t\tupdated: origin\n\t} : origin;\n\tconst { mounted, unmounted } = normalisedOrigin;\n\tif (!isFunc(mounted)) return origin;\n\tconst scopeWeakMap = /* @__PURE__ */ new WeakMap();\n\treturn {\n\t\t...normalisedOrigin,\n\t\tmounted(el, binding, vNode, prevNode) {\n\t\t\tvar _scopeWeakMap$get;\n\t\t\tconst scope = (_scopeWeakMap$get = scopeWeakMap.get(el)) !== null && _scopeWeakMap$get !== void 0 ? _scopeWeakMap$get : effectScope();\n\t\t\tscopeWeakMap.set(el, scope);\n\t\t\tscope.run(() => {\n\t\t\t\tmounted === null || mounted === void 0 || mounted(el, binding, vNode, prevNode);\n\t\t\t});\n\t\t},\n\t\tunmounted(el, binding, vNode, prevNode) {\n\t\t\tvar _scopeWeakMap$get2;\n\t\t\t(_scopeWeakMap$get2 = scopeWeakMap.get(el)) === null || _scopeWeakMap$get2 === void 0 || _scopeWeakMap$get2.stop();\n\t\t\tscopeWeakMap.delete(el);\n\t\t\tif (isFunc(unmounted)) unmounted(el, binding, vNode, prevNode);\n\t\t}\n\t};\n}\n// tryOnScopeDispose/index.ts\n/**\n* Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing\n*\n* @param fn\n*/\nfunction tryOnScopeDispose(fn, failSilently) {\n\tif (getCurrentScope()) {\n\t\tonScopeDispose(fn, failSilently);\n\t\treturn true;\n\t}\n\treturn false;\n}\n// createEventHook/index.ts\n/**\n* Utility for creating event hooks\n*\n* @see https://vueuse.org/createEventHook\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createEventHook() {\n\tconst fns = /* @__PURE__ */ new Set();\n\tconst off = (fn) => {\n\t\tfns.delete(fn);\n\t};\n\tconst clear = () => {\n\t\tfns.clear();\n\t};\n\tconst on = (fn) => {\n\t\tfns.add(fn);\n\t\tconst offFn = () => off(fn);\n\t\ttryOnScopeDispose(offFn);\n\t\treturn { off: offFn };\n\t};\n\tconst trigger = (...args) => {\n\t\treturn Promise.all(Array.from(fns).map((fn) => fn(...args)));\n\t};\n\treturn {\n\t\ton,\n\t\toff,\n\t\ttrigger,\n\t\tclear\n\t};\n}\n// createGlobalState/index.ts\n/**\n* Keep states in the global scope to be reusable across Vue instances.\n*\n* @see https://vueuse.org/createGlobalState\n* @param stateFactory A factory function to create the state\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createGlobalState(stateFactory) {\n\tlet initialized = false;\n\tlet state;\n\tconst scope = effectScope(true);\n\treturn ((...args) => {\n\t\tif (!initialized) {\n\t\t\tstate = scope.run(() => stateFactory(...args));\n\t\t\tinitialized = true;\n\t\t}\n\t\treturn state;\n\t});\n}\n// provideLocal/map.ts\nconst localProvidedStateMap = /* @__PURE__ */ new WeakMap();\n// injectLocal/index.ts\n/**\n* On the basis of `inject`, it is allowed to directly call inject to obtain the value after call provide in the same component.\n*\n* @example\n* ```ts\n* injectLocal('MyInjectionKey', 1)\n* const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1\n* ```\n*\n* @NO_SIDE_EFFECTS\n*/\nconst injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...args) => {\n\tvar _getCurrentInstance;\n\tconst key = args[0];\n\tconst instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;\n\tconst owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();\n\tif (owner == null && !hasInjectionContext()) throw new Error(\"injectLocal must be called in setup\");\n\tif (owner && localProvidedStateMap.has(owner) && key in localProvidedStateMap.get(owner)) return localProvidedStateMap.get(owner)[key];\n\treturn inject(...args);\n};\n// provideLocal/index.ts\n/**\n* On the basis of `provide`, it is allowed to directly call inject to obtain the value after call provide in the same component.\n*\n* @example\n* ```ts\n* provideLocal('MyInjectionKey', 1)\n* const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1\n* ```\n*/\nfunction provideLocal(key, value) {\n\tvar _getCurrentInstance;\n\tconst instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;\n\tconst owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();\n\tif (owner == null) throw new Error(\"provideLocal must be called in setup\");\n\tif (!localProvidedStateMap.has(owner)) localProvidedStateMap.set(owner, Object.create(null));\n\tconst localProvidedState = localProvidedStateMap.get(owner);\n\tlocalProvidedState[key] = value;\n\treturn provide(key, value);\n}\n// createInjectionState/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction createInjectionState(composable, options) {\n\tconst key = (options === null || options === void 0 ? void 0 : options.injectionKey) || Symbol(composable.name || \"InjectionState\");\n\tconst defaultValue = options === null || options === void 0 ? void 0 : options.defaultValue;\n\tconst useProvidingState = (...args) => {\n\t\tconst state = composable(...args);\n\t\tprovideLocal(key, state);\n\t\treturn state;\n\t};\n\tconst useInjectedState = () => /* @__PURE__ */ injectLocal(key, defaultValue);\n\treturn [useProvidingState, useInjectedState];\n}\n// createRef/index.ts\n/**\n* Returns a `deepRef` or `shallowRef` depending on the `deep` param.\n*\n* @example createRef(1) // ShallowRef<number>\n* @example createRef(1, false) // ShallowRef<number>\n* @example createRef(1, true) // Ref<number>\n* @example createRef(\"string\") // ShallowRef<string>\n* @example createRef<\"A\"|\"B\">(\"A\", true) // Ref<\"A\"|\"B\">\n*\n* @param value\n* @param deep\n* @returns the `deepRef` or `shallowRef`\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createRef(value, deep) {\n\tif (deep === true) return ref(value);\n\telse return shallowRef(value);\n}\n// utils/is.ts\nconst isClient = typeof window !== \"undefined\" && typeof document !== \"undefined\";\nconst isWorker = typeof WorkerGlobalScope !== \"undefined\" && globalThis instanceof WorkerGlobalScope;\nconst isDef = (val) => typeof val !== \"undefined\";\nconst notNullish = (val) => val != null;\nconst assert = (condition, ...infos) => {\n\tif (!condition) console.warn(...infos);\n};\nconst toString = Object.prototype.toString;\nconst isObject = (val) => toString.call(val) === \"[object Object]\";\nconst now = () => Date.now();\nconst timestamp = () => +Date.now();\nconst clamp = (n, min, max) => Math.min(max, Math.max(min, n));\nconst noop = () => {};\nconst rand = (min, max) => {\n\tmin = Math.ceil(min);\n\tmax = Math.floor(max);\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n};\nconst hasOwn = (val, key) => Object.hasOwn(val, key);\nconst isIOS = /* #__PURE__ */ getIsIOS();\nfunction getIsIOS() {\n\tvar _window, _window2, _window3;\n\treturn isClient && !!((_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.navigator) === null || _window2 === void 0 ? void 0 : _window2.maxTouchPoints) > 2 && /iPad|Macintosh/.test((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.navigator.userAgent));\n}\n// toRef/index.ts\nfunction toRef(...args) {\n\tif (args.length !== 1) return toRef$1(...args);\n\tconst r = args[0];\n\treturn typeof r === \"function\" ? readonly(customRef(() => ({\n\t\tget: r,\n\t\tset: noop\n\t}))) : ref(r);\n}\n// utils/filters.ts\nfunction createFilterWrapper(filter, fn) {\n\tfunction wrapper(...args) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tPromise.resolve(filter(() => fn.apply(this, args), {\n\t\t\t\tfn,\n\t\t\t\tthisArg: this,\n\t\t\t\targs\n\t\t\t})).then(resolve).catch(reject);\n\t\t});\n\t}\n\tif (\"cancel\" in filter) Object.assign(wrapper, {\n\t\tcancel: filter.cancel,\n\t\tflush: filter.flush,\n\t\tisPending: filter.isPending\n\t});\n\treturn wrapper;\n}\nconst bypassFilter = (invoke) => {\n\treturn invoke();\n};\n/**\n* Create an EventFilter that debounce the events\n*/\nfunction debounceFilter(ms, options = {}) {\n\tlet timer;\n\tlet maxTimer;\n\tlet lastRejector = noop;\n\tlet lastResolve = noop;\n\tconst _pending = shallowRef(false);\n\tconst _clearTimeout = (timer) => {\n\t\tclearTimeout(timer);\n\t\tlastRejector();\n\t\tlastRejector = noop;\n\t};\n\tlet lastInvoker;\n\tconst handler = (invoke) => {\n\t\tconst duration = toValue(ms);\n\t\tconst maxDuration = toValue(options.maxWait);\n\t\tif (timer) _clearTimeout(timer);\n\t\tif (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {\n\t\t\tif (maxTimer) {\n\t\t\t\t_clearTimeout(maxTimer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t}\n\t\t\t_pending.value = false;\n\t\t\treturn Promise.resolve(invoke());\n\t\t}\n\t\t_pending.value = true;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlastRejector = options.rejectOnCancel ? reject : resolve;\n\t\t\tlastResolve = resolve;\n\t\t\tlastInvoker = invoke;\n\t\t\tif (maxDuration && !maxTimer) maxTimer = setTimeout(() => {\n\t\t\t\tif (timer) _clearTimeout(timer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t\t_pending.value = false;\n\t\t\t\tresolve(lastInvoker());\n\t\t\t}, maxDuration);\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tif (maxTimer) _clearTimeout(maxTimer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t\t_pending.value = false;\n\t\t\t\tresolve(invoke());\n\t\t\t}, duration);\n\t\t});\n\t};\n\treturn Object.assign(handler, {\n\t\tcancel: () => {\n\t\t\tif (timer) {\n\t\t\t\t_clearTimeout(timer);\n\t\t\t\ttimer = void 0;\n\t\t\t}\n\t\t\tif (maxTimer) {\n\t\t\t\t_clearTimeout(maxTimer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t}\n\t\t\t_pending.value = false;\n\t\t\tlastResolve = noop;\n\t\t},\n\t\tflush: () => {\n\t\t\tif (_pending.value) {\n\t\t\t\tif (timer) {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\ttimer = void 0;\n\t\t\t\t}\n\t\t\t\tif (maxTimer) {\n\t\t\t\t\tclearTimeout(maxTimer);\n\t\t\t\t\tmaxTimer = void 0;\n\t\t\t\t}\n\t\t\t\t_pending.value = false;\n\t\t\t\tconst resolve = lastResolve;\n\t\t\t\tlastRejector = noop;\n\t\t\t\tlastResolve = noop;\n\t\t\t\tresolve(lastInvoker());\n\t\t\t}\n\t\t},\n\t\tisPending: shallowReadonly(_pending)\n\t});\n}\nfunction throttleFilter(...args) {\n\tlet lastExec = 0;\n\tlet timer;\n\tlet isLeading = true;\n\tlet lastRejector = noop;\n\tlet lastValue;\n\tlet ms;\n\tlet trailing;\n\tlet leading;\n\tlet rejectOnCancel;\n\tif (!isRef(args[0]) && typeof args[0] === \"object\") ({delay: ms, trailing = true, leading = true, rejectOnCancel = false} = args[0]);\n\telse [ms, trailing = true, leading = true, rejectOnCancel = false] = args;\n\tconst clear = () => {\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t\tlastRejector();\n\t\t\tlastRejector = noop;\n\t\t}\n\t};\n\tconst filter = (_invoke) => {\n\t\tconst duration = toValue(ms);\n\t\tconst elapsed = Date.now() - lastExec;\n\t\tconst invoke = () => {\n\t\t\treturn lastValue = _invoke();\n\t\t};\n\t\tclear();\n\t\tif (duration <= 0) {\n\t\t\tlastExec = Date.now();\n\t\t\treturn invoke();\n\t\t}\n\t\tif (elapsed > duration) {\n\t\t\tlastExec = Date.now();\n\t\t\tif (leading || !isLeading) invoke();\n\t\t} else if (trailing) lastValue = new Promise((resolve, reject) => {\n\t\t\tlastRejector = rejectOnCancel ? reject : resolve;\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tlastExec = Date.now();\n\t\t\t\tisLeading = true;\n\t\t\t\tresolve(invoke());\n\t\t\t\tclear();\n\t\t\t}, Math.max(0, duration - elapsed));\n\t\t});\n\t\tif (!leading && !timer) timer = setTimeout(() => isLeading = true, duration);\n\t\tisLeading = false;\n\t\treturn lastValue;\n\t};\n\treturn filter;\n}\n/**\n* EventFilter that gives extra controls to pause and resume the filter\n*\n* @param extendFilter Extra filter to apply when the PausableFilter is active, default to none\n* @param options Options to configure the filter\n*/\nfunction pausableFilter(extendFilter = bypassFilter, options = {}) {\n\tconst { initialState = \"active\" } = options;\n\tconst isActive = toRef(initialState === \"active\");\n\tfunction pause() {\n\t\tisActive.value = false;\n\t}\n\tfunction resume() {\n\t\tisActive.value = true;\n\t}\n\tconst eventFilter = (...args) => {\n\t\tif (isActive.value) extendFilter(...args);\n\t};\n\treturn {\n\t\tisActive: shallowReadonly(isActive),\n\t\tpause,\n\t\tresume,\n\t\teventFilter\n\t};\n}\n// utils/general.ts\nfunction promiseTimeout(ms, throwOnTimeout = false, reason = \"Timeout\") {\n\treturn new Promise((resolve, reject) => {\n\t\tif (throwOnTimeout) setTimeout(reject, ms, reason);\n\t\telse setTimeout(resolve, ms);\n\t});\n}\nfunction identity(arg) {\n\treturn arg;\n}\n/**\n* Create singleton promise function\n*\n* @example\n* ```\n* const promise = createSingletonPromise(async () => { ... })\n*\n* await promise()\n* await promise() // all of them will be bind to a single promise instance\n* await promise() // and be resolved together\n* ```\n*/\nfunction createSingletonPromise(fn) {\n\tlet _promise;\n\tfunction wrapper() {\n\t\tif (!_promise) _promise = fn();\n\t\treturn _promise;\n\t}\n\twrapper.reset = async () => {\n\t\tconst _prev = _promise;\n\t\t_promise = void 0;\n\t\tif (_prev) await _prev;\n\t};\n\treturn wrapper;\n}\nfunction invoke(fn) {\n\treturn fn();\n}\nfunction containsProp(obj, ...props) {\n\treturn props.some((k) => k in obj);\n}\nfunction increaseWithUnit(target, delta) {\n\tvar _target$match;\n\tif (typeof target === \"number\") return target + delta;\n\tconst value = ((_target$match = target.match(/^-?\\d+\\.?\\d*/)) === null || _target$match === void 0 ? void 0 : _target$match[0]) || \"\";\n\tconst unit = target.slice(value.length);\n\tconst result = Number.parseFloat(value) + delta;\n\tif (Number.isNaN(result)) return target;\n\treturn result + unit;\n}\n/**\n* Get a px value for SSR use, do not rely on this method outside of SSR as REM unit is assumed at 16px, which might not be the case on the client\n*/\nfunction pxValue(px) {\n\treturn px.endsWith(\"rem\") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);\n}\n/**\n* Create a new subset object by giving keys\n*/\nfunction objectPick(obj, keys, omitUndefined = false) {\n\treturn keys.reduce((n, k) => {\n\t\tif (k in obj) {\n\t\t\tif (!omitUndefined || obj[k] !== void 0) n[k] = obj[k];\n\t\t}\n\t\treturn n;\n\t}, {});\n}\n/**\n* Create a new subset object by omit giving keys\n*/\nfunction objectOmit(obj, keys, omitUndefined = false) {\n\treturn Object.fromEntries(Object.entries(obj).filter(([key, value]) => {\n\t\treturn (!omitUndefined || value !== void 0) && !keys.includes(key);\n\t}));\n}\nfunction objectEntries(obj) {\n\treturn Object.entries(obj);\n}\nfunction toArray(value) {\n\treturn Array.isArray(value) ? value : [value];\n}\n// utils/port.ts\nfunction cacheStringFunction(fn) {\n\tconst cache = Object.create(null);\n\treturn ((str) => {\n\t\treturn cache[str] || (cache[str] = fn(str));\n\t});\n}\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = /* #__PURE__ */ cacheStringFunction((str) => str.replace(hyphenateRE, \"-$1\").toLowerCase());\nconst camelizeRE = /-(\\w)/g;\nconst camelize = /* #__PURE__ */ cacheStringFunction((str) => {\n\treturn str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n});\n// utils/vue.ts\nfunction getLifeCycleTarget(target) {\n\treturn target || getCurrentInstance();\n}\n// createSharedComposable/index.ts\n/**\n* Make a composable function usable with multiple Vue instances.\n*\n* @see https://vueuse.org/createSharedComposable\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createSharedComposable(composable) {\n\tif (!isClient) return composable;\n\tlet subscribers = 0;\n\tlet state;\n\tlet scope;\n\tconst dispose = () => {\n\t\tsubscribers -= 1;\n\t\tif (scope && subscribers <= 0) {\n\t\t\tscope.stop();\n\t\t\tstate = void 0;\n\t\t\tscope = void 0;\n\t\t}\n\t};\n\treturn ((...args) => {\n\t\tsubscribers += 1;\n\t\tif (!scope) {\n\t\t\tscope = effectScope(true);\n\t\t\tstate = scope.run(() => composable(...args));\n\t\t}\n\t\ttryOnScopeDispose(dispose);\n\t\treturn state;\n\t});\n}\n// extendRef/index.ts\nfunction extendRef(ref, extend, { enumerable = false, unwrap = true } = {}) {\n\tfor (const [key, value] of Object.entries(extend)) {\n\t\tif (key === \"value\") continue;\n\t\tif (isRef(value) && unwrap) Object.defineProperty(ref, key, {\n\t\t\tget() {\n\t\t\t\treturn value.value;\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\tvalue.value = v;\n\t\t\t},\n\t\t\tenumerable\n\t\t});\n\t\telse Object.defineProperty(ref, key, {\n\t\t\tvalue,\n\t\t\tenumerable\n\t\t});\n\t}\n\treturn ref;\n}\n// get/index.ts\nfunction get(obj, key) {\n\tif (key == null) return unref(obj);\n\treturn unref(obj)[key];\n}\n// isDefined/index.ts\nfunction isDefined(v) {\n\treturn unref(v) != null;\n}\n// makeDestructurable/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction makeDestructurable(obj, arr) {\n\tif (typeof Symbol !== \"undefined\") {\n\t\tconst clone = { ...obj };\n\t\tObject.defineProperty(clone, Symbol.iterator, {\n\t\t\tenumerable: false,\n\t\t\tvalue() {\n\t\t\t\tlet index = 0;\n\t\t\t\treturn { next: () => ({\n\t\t\t\t\tvalue: arr[index++],\n\t\t\t\t\tdone: index > arr.length\n\t\t\t\t}) };\n\t\t\t}\n\t\t});\n\t\treturn clone;\n\t} else return Object.assign([...arr], obj);\n}\n// reactify/index.ts\n/**\n* Converts plain function into a reactive function.\n* The converted function accepts refs as it's arguments\n* and returns a ComputedRef, with proper typing.\n*\n* @param fn - Source function\n* @param options - Options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction reactify(fn, options) {\n\tconst unrefFn = (options === null || options === void 0 ? void 0 : options.computedGetter) === false ? unref : toValue;\n\treturn function(...args) {\n\t\treturn computed(() => fn.apply(this, args.map((i) => unrefFn(i))));\n\t};\n}\n/** @deprecated use `reactify` instead */\nconst createReactiveFn = reactify;\n// reactifyObject/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction reactifyObject(obj, optionsOrKeys = {}) {\n\tlet keys = [];\n\tlet options;\n\tif (Array.isArray(optionsOrKeys)) keys = optionsOrKeys;\n\telse {\n\t\toptions = optionsOrKeys;\n\t\tconst { includeOwnProperties = true } = optionsOrKeys;\n\t\tkeys.push(...Object.keys(obj));\n\t\tif (includeOwnProperties) keys.push(...Object.getOwnPropertyNames(obj));\n\t}\n\treturn Object.fromEntries(keys.map((key) => {\n\t\tconst value = obj[key];\n\t\treturn [key, typeof value === \"function\" ? reactify(value.bind(obj), options) : value];\n\t}));\n}\n// toReactive/index.ts\n/**\n* Converts ref to reactive.\n*\n* @see https://vueuse.org/toReactive\n* @param objectRef A ref of object\n*/\nfunction toReactive(objectRef) {\n\tif (!isRef(objectRef)) return reactive(objectRef);\n\tconst proxy = new Proxy({}, {\n\t\tget(_, p, receiver) {\n\t\t\treturn unref(Reflect.get(objectRef.value, p, receiver));\n\t\t},\n\t\tset(_, p, value) {\n\t\t\tif (isRef(objectRef.value[p]) && !isRef(value)) objectRef.value[p].value = value;\n\t\t\telse objectRef.value[p] = value;\n\t\t\treturn true;\n\t\t},\n\t\tdeleteProperty(_, p) {\n\t\t\treturn Reflect.deleteProperty(objectRef.value, p);\n\t\t},\n\t\thas(_, p) {\n\t\t\treturn Reflect.has(objectRef.value, p);\n\t\t},\n\t\townKeys() {\n\t\t\treturn Object.keys(objectRef.value);\n\t\t},\n\t\tgetOwnPropertyDescriptor() {\n\t\t\treturn {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true\n\t\t\t};\n\t\t}\n\t});\n\treturn reactive(proxy);\n}\n// reactiveComputed/index.ts\n/**\n* Computed reactive object.\n*/\nfunction reactiveComputed(fn) {\n\treturn toReactive(computed(fn));\n}\n// reactiveOmit/index.ts\nfunction createOmitView(source, omitted, isRawView) {\n\tconst isOmitted = (key) => typeof key === \"symbol\" || omitted.includes(key);\n\tconst hasOwnProperty = (key) => {\n\t\tkey = typeof key === \"symbol\" ? key : String(key);\n\t\treturn !isOmitted(key) && source.hasOwnProperty(key);\n\t};\n\tlet rawView;\n\treturn new Proxy({}, {\n\t\tget(_, key) {\n\t\t\tvar _rawView;\n\t\t\tif (isOmitted(key)) return void 0;\n\t\t\tif (key === \"__v_raw\") return isRawView ? void 0 : (_rawView = rawView) !== null && _rawView !== void 0 ? _rawView : rawView = createOmitView(isReadonly(source) ? source.__v_raw : source, omitted, true);\n\t\t\tif (key === \"hasOwnProperty\") return hasOwnProperty;\n\t\t\tconst value = source[key];\n\t\t\treturn isRef(value) ? value.value : value;\n\t\t},\n\t\tset(_, key, value) {\n\t\t\tif (isOmitted(key)) return true;\n\t\t\tconst oldValue = source[key];\n\t\t\tif (isRef(oldValue) && !isRef(value)) oldValue.value = value;\n\t\t\telse source[key] = value;\n\t\t\treturn true;\n\t\t},\n\t\tdeleteProperty(_, key) {\n\t\t\treturn isOmitted(key) || Reflect.deleteProperty(source, key);\n\t\t},\n\t\tdefineProperty(_, key, descriptor) {\n\t\t\tif (descriptor.configurable === false) return false;\n\t\t\treturn isOmitted(key) || Reflect.defineProperty(source, key, descriptor);\n\t\t},\n\t\thas(_, key) {\n\t\t\treturn !isOmitted(key) && key in source;\n\t\t},\n\t\townKeys() {\n\t\t\treturn Reflect.ownKeys(source).filter((key) => !isOmitted(key));\n\t\t},\n\t\tgetOwnPropertyDescriptor(_, key) {\n\t\t\tif (isOmitted(key)) return void 0;\n\t\t\tconst descriptor = Reflect.getOwnPropertyDescriptor(source, key);\n\t\t\tif (descriptor) descriptor.configurable = true;\n\t\t\treturn descriptor;\n\t\t}\n\t});\n}\n/**\n* Reactively omit fields from a reactive object\n*\n* @see https://vueuse.org/reactiveOmit\n*/\nfunction reactiveOmit(obj, ...keys) {\n\tconst flatKeys = keys.flat();\n\tconst predicate = flatKeys[0];\n\tif (typeof predicate !== \"function\") return createOmitView(obj, flatKeys.map((key) => typeof key === \"number\" ? String(key) : key), false);\n\treturn reactiveComputed(() => Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => !predicate(toValue(v), k))));\n}\n// reactivePick/index.ts\n/**\n* Reactively pick fields from a reactive object\n*\n* @see https://vueuse.org/reactivePick\n*/\nfunction reactivePick(obj, ...keys) {\n\tconst flatKeys = keys.flat();\n\tconst predicate = flatKeys[0];\n\treturn reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => predicate(toValue(v), k))) : Object.fromEntries(flatKeys.map((k) => [k, toRef(obj, k)])));\n}\n// refAutoReset/index.ts\n/**\n* Create a ref which will be reset to the default value after some time.\n*\n* @see https://vueuse.org/refAutoReset\n* @param defaultValue The value which will be set.\n* @param afterMs A zero-or-greater delay in milliseconds.\n*/\nfunction refAutoReset(defaultValue, afterMs = 1e4) {\n\treturn customRef((track, trigger) => {\n\t\tlet value = toValue(defaultValue);\n\t\tlet timer;\n\t\tconst resetAfter = () => setTimeout(() => {\n\t\t\tvalue = toValue(defaultValue);\n\t\t\ttrigger();\n\t\t}, toValue(afterMs));\n\t\ttryOnScopeDispose(() => {\n\t\t\tclearTimeout(timer);\n\t\t});\n\t\treturn {\n\t\t\tget() {\n\t\t\t\ttrack();\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\tset(newValue) {\n\t\t\t\tvalue = newValue;\n\t\t\t\ttrigger();\n\t\t\t\tclearTimeout(timer);\n\t\t\t\ttimer = resetAfter();\n\t\t\t}\n\t\t};\n\t});\n}\n/** @deprecated use `refAutoReset` instead */\nconst autoResetRef = refAutoReset;\n// useDebounceFn/index.ts\n/**\n* Debounce execution of a function.\n*\n* @see https://vueuse.org/useDebounceFn\n* @param fn A function to be executed after delay milliseconds debounced.\n* @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* @param options Options\n*\n* @return A new, debounced, function with isPending, cancel, and flush properties.\n*/\nfunction useDebounceFn(fn, ms = 200, options = {}) {\n\treturn createFilterWrapper(debounceFilter(ms, options), fn);\n}\n// refDebounced/index.ts\n/**\n* Debounce updates of a ref.\n*\n* @return A new debounced ref.\n*/\nfunction refDebounced(value, ms = 200, options = {}) {\n\tconst debounced = ref(toValue(value));\n\tconst updater = useDebounceFn(() => {\n\t\tdebounced.value = value.value;\n\t}, ms, options);\n\twatch(value, () => updater());\n\treturn shallowReadonly(debounced);\n}\n/** @deprecated use `refDebounced` instead */\nconst debouncedRef = refDebounced;\n/** @deprecated use `refDebounced` instead */\nconst useDebounce = refDebounced;\n// refDefault/index.ts\n/**\n* Apply default value to a ref.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction refDefault(source, defaultValue) {\n\treturn computed({\n\t\tget() {\n\t\t\tvar _source$value;\n\t\t\treturn (_source$value = source.value) !== null && _source$value !== void 0 ? _source$value : defaultValue;\n\t\t},\n\t\tset(value) {\n\t\t\tsource.value = value;\n\t\t}\n\t});\n}\n// refManualReset/index.ts\n/**\n* Create a ref with manual reset functionality.\n*\n* @see https://vueuse.org/refManualReset\n* @param defaultValue The value which will be set.\n*/\nfunction refManualReset(defaultValue) {\n\tlet value = toValue(defaultValue);\n\tlet trigger;\n\tconst reset = () => {\n\t\tvalue = toValue(defaultValue);\n\t\ttrigger();\n\t};\n\tconst refValue = customRef((track, _trigger) => {\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\ttrack();\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\tset(newValue) {\n\t\t\t\tvalue = newValue;\n\t\t\t\ttrigger();\n\t\t\t}\n\t\t};\n\t});\n\trefValue.reset = reset;\n\treturn refValue;\n}\n// useThrottleFn/index.ts\n/**\n* Throttle execution of a function. Especially useful for rate limiting\n* execution of handlers on events like resize and scroll.\n*\n* @param fn A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,\n* to `callback` when the throttled-function is executed.\n* @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* (default value: 200)\n*\n* @param [trailing] if true, call fn again after the time is up (default value: true)\n*\n* @param [leading] if true, call fn on the leading edge of the ms timeout (default value: true)\n*\n* @param [rejectOnCancel] if true, reject the last call if it's been cancel (default value: false)\n*\n* @return A new, throttled, function.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useThrottleFn(fn, ms = 200, trailing = true, leading = true, rejectOnCancel = false) {\n\treturn createFilterWrapper(throttleFilter(ms, trailing, leading, rejectOnCancel), fn);\n}\n// refThrottled/index.ts\n/**\n* Throttle execution of a function. Especially useful for rate limiting\n* execution of handlers on events like resize and scroll.\n*\n* @param value Ref value to be watched with throttle effect\n* @param delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* @param trailing if true, update the value again after the delay time is up\n* @param leading if true, update the value on the leading edge of the ms timeout\n*/\nfunction refThrottled(value, delay = 200, trailing = true, leading = true) {\n\tif (delay <= 0) return value;\n\tconst throttled = ref(toValue(value));\n\tconst updater = useThrottleFn(() => {\n\t\tthrottled.value = value.value;\n\t}, delay, trailing, leading);\n\twatch(value, () => updater());\n\treturn throttled;\n}\n/** @deprecated use `refThrottled` instead */\nconst throttledRef = refThrottled;\n/** @deprecated use `refThrottled` instead */\nconst useThrottle = refThrottled;\n// refWithControl/index.ts\n/**\n* Fine-grained controls over ref and its reactivity.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction refWithControl(initial, options = {}) {\n\tlet source = initial;\n\tlet track;\n\tlet trigger;\n\tconst ref = customRef((_track, _trigger) => {\n\t\ttrack = _track;\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\treturn get();\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\tset(v);\n\t\t\t}\n\t\t};\n\t});\n\tfunction get(tracking = true) {\n\t\tif (tracking) track();\n\t\treturn source;\n\t}\n\tfunction set(value, triggering = true) {\n\t\tvar _options$onBeforeChan, _options$onChanged;\n\t\tif (value === source) return;\n\t\tconst old = source;\n\t\tif (((_options$onBeforeChan = options.onBeforeChange) === null || _options$onBeforeChan === void 0 ? void 0 : _options$onBeforeChan.call(options, value, old)) === false) return;\n\t\tsource = value;\n\t\t(_options$onChanged = options.onChanged) === null || _options$onChanged === void 0 || _options$onChanged.call(options, value, old);\n\t\tif (triggering) trigger();\n\t}\n\t/**\n\t* Get the value without tracked in the reactivity system\n\t*/\n\tconst untrackedGet = () => get(false);\n\t/**\n\t* Set the value without triggering the reactivity system\n\t*/\n\tconst silentSet = (v) => set(v, false);\n\t/**\n\t* Get the value without tracked in the reactivity system.\n\t*\n\t* Alias for `untrackedGet()`\n\t*/\n\tconst peek = () => get(false);\n\t/**\n\t* Set the value without triggering the reactivity system\n\t*\n\t* Alias for `silentSet(v)`\n\t*/\n\tconst lay = (v) => set(v, false);\n\treturn extendRef(ref, {\n\t\tget,\n\t\tset,\n\t\tuntrackedGet,\n\t\tsilentSet,\n\t\tpeek,\n\t\tlay\n\t}, { enumerable: true });\n}\n/** @deprecated use `refWithControl` instead */\nconst controlledRef = refWithControl;\n// set/index.ts\n/**\n* Shorthand for `ref.value = x`\n*/\nfunction set(...args) {\n\tif (args.length === 2) {\n\t\tconst [ref, value] = args;\n\t\tref.value = value;\n\t}\n\tif (args.length === 3) {\n\t\tconst [target, key, value] = args;\n\t\ttarget[key] = value;\n\t}\n}\n// watchWithFilter/index.ts\nfunction watchWithFilter(source, cb, options = {}) {\n\tconst { eventFilter = bypassFilter, ...watchOptions } = options;\n\treturn watch(source, createFilterWrapper(eventFilter, cb), watchOptions);\n}\n// watchPausable/index.ts\n/** @deprecated Use Vue's built-in `watch` instead. This function will be removed in future version. */\nfunction watchPausable(source, cb, options = {}) {\n\tconst { eventFilter: filter, initialState = \"active\", ...watchOptions } = options;\n\tconst { eventFilter, pause, resume, isActive } = pausableFilter(filter, { initialState });\n\treturn {\n\t\tstop: watchWithFilter(source, cb, {\n\t\t\t...watchOptions,\n\t\t\teventFilter\n\t\t}),\n\t\tpause,\n\t\tresume,\n\t\tisActive\n\t};\n}\n/** @deprecated Use Vue's built-in `watch` instead. This function will be removed in future version. */\nconst pausableWatch = watchPausable;\n// syncRef/index.ts\n/**\n* Two-way refs synchronization.\n* From the set theory perspective to restrict the option's type\n* Check in the following order:\n* 1. L = R\n* 2. L ∩ R ≠ ∅\n* 3. L ⊆ R\n* 4. L ∩ R = ∅\n*/\nfunction syncRef(left, right, ...[options]) {\n\tconst { flush = \"sync\", deep = false, immediate = true, direction = \"both\", transform = {} } = options || {};\n\tconst watchers = [];\n\tconst transformLTR = \"ltr\" in transform && transform.ltr || ((v) => v);\n\tconst transformRTL = \"rtl\" in transform && transform.rtl || ((v) => v);\n\tif (direction === \"both\" || direction === \"ltr\") watchers.push(watchPausable(left, (newValue) => {\n\t\twatchers.forEach((w) => w.pause());\n\t\tright.value = transformLTR(newValue);\n\t\twatchers.forEach((w) => w.resume());\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t}));\n\tif (direction === \"both\" || direction === \"rtl\") watchers.push(watchPausable(right, (newValue) => {\n\t\twatchers.forEach((w) => w.pause());\n\t\tleft.value = transformRTL(newValue);\n\t\twatchers.forEach((w) => w.resume());\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t}));\n\tconst stop = () => {\n\t\twatchers.forEach((w) => w.stop());\n\t};\n\treturn stop;\n}\n// syncRefs/index.ts\n/**\n* Keep target ref(s) in sync with the source ref\n*\n* @param source source ref\n* @param targets\n*/\nfunction syncRefs(source, targets, options = {}) {\n\tconst { flush = \"sync\", deep = false, immediate = true } = options;\n\tconst targetsArray = toArray(targets);\n\treturn watch(source, (newValue) => targetsArray.forEach((target) => target.value = newValue), {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t});\n}\n// toRefs/index.ts\n/**\n* Extended `toRefs` that also accepts refs of an object.\n*\n* @see https://vueuse.org/toRefs\n* @param objectRef A ref or normal object or array.\n* @param options Options\n*/\nfunction toRefs(objectRef, options = {}) {\n\tif (!isRef(objectRef)) return toRefs$1(objectRef);\n\tconst result = Array.isArray(objectRef.value) ? Array.from({ length: objectRef.value.length }) : {};\n\tfor (const key in objectRef.value) result[key] = customRef(() => ({\n\t\tget() {\n\t\t\treturn objectRef.value[key];\n\t\t},\n\t\tset(v) {\n\t\t\tvar _toValue;\n\t\t\tif ((_toValue = toValue(options.replaceRef)) !== null && _toValue !== void 0 ? _toValue : true) {\n\t\t\t\tif (Array.isArray(objectRef.value)) {\n\t\t\t\t\tconst copy = [...objectRef.value];\n\t\t\t\t\tcopy[key] = v;\n\t\t\t\t\tobjectRef.value = copy;\n\t\t\t\t} else {\n\t\t\t\t\tconst newObject = {\n\t\t\t\t\t\t...objectRef.value,\n\t\t\t\t\t\t[key]: v\n\t\t\t\t\t};\n\t\t\t\t\tObject.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));\n\t\t\t\t\tobjectRef.value = newObject;\n\t\t\t\t}\n\t\t\t} else objectRef.value[key] = v;\n\t\t}\n\t}));\n\treturn result;\n}\n// tryOnBeforeMount/index.ts\n/**\n* Call onBeforeMount() if it's inside a component lifecycle, if not, just call the function\n*\n* @param fn\n* @param sync if set to false, it will run in the nextTick() of Vue\n* @param target\n*/\nfunction tryOnBeforeMount(fn, sync = true, target) {\n\tif (getLifeCycleTarget(target)) onBeforeMount(fn, target);\n\telse if (sync) fn();\n\telse nextTick(fn);\n}\n// tryOnBeforeUnmount/index.ts\n/**\n* Call onBeforeUnmount() if it's inside a component lifecycle, if not, do nothing\n*\n* @param fn\n* @param target\n*/\nfunction tryOnBeforeUnmount(fn, target) {\n\tif (getLifeCycleTarget(target)) onBeforeUnmount(fn, target);\n}\n// tryOnMounted/index.ts\n/**\n* Call onMounted() if it's inside a component lifecycle, if not, just call the function\n*\n* @param fn\n* @param sync if set to false, it will run in the nextTick() of Vue\n* @param target\n*/\nfunction tryOnMounted(fn, sync = true, target) {\n\tif (getLifeCycleTarget(target)) onMounted(fn, target);\n\telse if (sync) fn();\n\telse nextTick(fn);\n}\n// tryOnUnmounted/index.ts\n/**\n* Call onUnmounted() if it's inside a component lifecycle, if not, do nothing\n*\n* @param fn\n* @param target\n*/\nfunction tryOnUnmounted(fn, target) {\n\tif (getLifeCycleTarget(target)) onUnmounted(fn, target);\n}\n// until/index.ts\nfunction createUntil(r, isNot = false) {\n\tfunction toMatch(condition, { flush = \"sync\", deep = false, timeout, throwOnTimeout } = {}) {\n\t\tlet stop = null;\n\t\tconst promises = [new Promise((resolve) => {\n\t\t\tstop = watch(r, (v) => {\n\t\t\t\tif (condition(v) !== isNot) {\n\t\t\t\t\tif (stop) stop();\n\t\t\t\t\telse nextTick(() => stop === null || stop === void 0 ? void 0 : stop());\n\t\t\t\t\tresolve(v);\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tflush,\n\t\t\t\tdeep,\n\t\t\t\timmediate: true\n\t\t\t});\n\t\t})];\n\t\tif (timeout != null) promises.push(promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop === null || stop === void 0 ? void 0 : stop()));\n\t\treturn Promise.race(promises);\n\t}\n\tfunction toBe(value, options) {\n\t\tif (!isRef(value)) return toMatch((v) => v === value, options);\n\t\tconst { flush = \"sync\", deep = false, timeout, throwOnTimeout } = options !== null && options !== void 0 ? options : {};\n\t\tlet stop = null;\n\t\tconst promises = [new Promise((resolve) => {\n\t\t\tstop = watch([r, value], ([v1, v2]) => {\n\t\t\t\tif (isNot !== (v1 === v2)) {\n\t\t\t\t\tif (stop) stop();\n\t\t\t\t\telse nextTick(() => stop === null || stop === void 0 ? void 0 : stop());\n\t\t\t\t\tresolve(v1);\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tflush,\n\t\t\t\tdeep,\n\t\t\t\timmediate: true\n\t\t\t});\n\t\t})];\n\t\tif (timeout != null) promises.push(promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => {\n\t\t\tstop === null || stop === void 0 || stop();\n\t\t\treturn toValue(r);\n\t\t}));\n\t\treturn Promise.race(promises);\n\t}\n\tfunction toBeTruthy(options) {\n\t\treturn toMatch((v) => Boolean(v), options);\n\t}\n\tfunction toBeNull(options) {\n\t\treturn toBe(null, options);\n\t}\n\tfunction toBeUndefined(options) {\n\t\treturn toBe(void 0, options);\n\t}\n\tfunction toBeNaN(options) {\n\t\treturn toMatch(Number.isNaN, options);\n\t}\n\tfunction toContains(value, options) {\n\t\treturn toMatch((v) => {\n\t\t\tconst array = Array.from(v);\n\t\t\treturn array.includes(value) || array.includes(toValue(value));\n\t\t}, options);\n\t}\n\tfunction changed(options) {\n\t\treturn changedTimes(1, options);\n\t}\n\tfunction changedTimes(n = 1, options) {\n\t\tlet count = -1;\n\t\treturn toMatch(() => {\n\t\t\tcount += 1;\n\t\t\treturn count >= n;\n\t\t}, options);\n\t}\n\tif (Array.isArray(toValue(r))) return {\n\t\ttoMatch,\n\t\ttoContains,\n\t\tchanged,\n\t\tchangedTimes,\n\t\tget not() {\n\t\t\treturn createUntil(r, !isNot);\n\t\t}\n\t};\n\telse return {\n\t\ttoMatch,\n\t\ttoBe,\n\t\ttoBeTruthy,\n\t\ttoBeNull,\n\t\ttoBeNaN,\n\t\ttoBeUndefined,\n\t\tchanged,\n\t\tchangedTimes,\n\t\tget not() {\n\t\t\treturn createUntil(r, !isNot);\n\t\t}\n\t};\n}\nfunction until(r) {\n\treturn createUntil(r);\n}\n// useArrayDifference/index.ts\nfunction defaultComparator(value, othVal) {\n\treturn value === othVal;\n}\n/**\n* Reactive get array difference of two array\n* @see https://vueuse.org/useArrayDifference\n* @returns - the difference of two array\n* @param args\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayDifference(...args) {\n\tvar _args$, _args$2;\n\tconst list = args[0];\n\tconst values = args[1];\n\tlet compareFn = (_args$ = args[2]) !== null && _args$ !== void 0 ? _args$ : defaultComparator;\n\tconst { symmetric = false } = (_args$2 = args[3]) !== null && _args$2 !== void 0 ? _args$2 : {};\n\tif (typeof compareFn !== \"function\") {\n\t\tconst key = compareFn;\n\t\tcompareFn = (value, othVal) => value[key] === othVal[key];\n\t}\n\tconst diff1 = computed(() => toValue(list).filter((x) => toValue(values).findIndex((y) => compareFn(x, y)) === -1));\n\tif (symmetric) {\n\t\tconst diff2 = computed(() => toValue(values).filter((x) => toValue(list).findIndex((y) => compareFn(x, y)) === -1));\n\t\treturn computed(() => symmetric ? [...toValue(diff1), ...toValue(diff2)] : toValue(diff1));\n\t} else return diff1;\n}\n// useArrayEvery/index.ts\n/**\n* Reactive `Array.every`\n*\n* @see https://vueuse.org/useArrayEvery\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns **true** if the `fn` function returns a **truthy** value for every element from the array. Otherwise, **false**.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayEvery(list, fn) {\n\treturn computed(() => toValue(list).every((element, index, array) => fn(toValue(element), index, array)));\n}\n// useArrayFilter/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useArrayFilter(list, fn) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).filter(fn));\n}\n// useArrayFind/index.ts\n/**\n* Reactive `Array.find`\n*\n* @see https://vueuse.org/useArrayFind\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the first element in the array that satisfies the provided testing function. Otherwise, undefined is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFind(list, fn) {\n\treturn computed(() => toValue(toValue(list).find((element, index, array) => fn(toValue(element), index, array))));\n}\n// useArrayFindIndex/index.ts\n/**\n* Reactive `Array.findIndex`\n*\n* @see https://vueuse.org/useArrayFindIndex\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the index of the first element in the array that passes the test. Otherwise, \"-1\".\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFindIndex(list, fn) {\n\treturn computed(() => toValue(list).findIndex((element, index, array) => fn(toValue(element), index, array)));\n}\n// useArrayFindLast/index.ts\nfunction findLast(arr, cb) {\n\tlet index = arr.length;\n\twhile (index-- > 0) if (cb(arr[index], index, arr)) return arr[index];\n}\n/**\n* Reactive `Array.findLast`\n*\n* @see https://vueuse.org/useArrayFindLast\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the last element in the array that satisfies the provided testing function. Otherwise, undefined is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFindLast(list, fn) {\n\treturn computed(() => toValue(!Array.prototype.findLast ? findLast(toValue(list), (element, index, array) => fn(toValue(element), index, array)) : toValue(list).findLast((element, index, array) => fn(toValue(element), index, array))));\n}\n// useArrayIncludes/index.ts\nfunction isArrayIncludesOptions(obj) {\n\treturn isObject(obj) && containsProp(obj, \"formIndex\", \"comparator\");\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction useArrayIncludes(...args) {\n\tvar _comparator;\n\tconst list = args[0];\n\tconst value = args[1];\n\tlet comparator = args[2];\n\tlet formIndex = 0;\n\tif (isArrayIncludesOptions(comparator)) {\n\t\tvar _comparator$fromIndex;\n\t\tformIndex = (_comparator$fromIndex = comparator.fromIndex) !== null && _comparator$fromIndex !== void 0 ? _comparator$fromIndex : 0;\n\t\tcomparator = comparator.comparator;\n\t}\n\tif (typeof comparator === \"string\") {\n\t\tconst key = comparator;\n\t\tcomparator = (element, value) => element[key] === toValue(value);\n\t}\n\tcomparator = (_comparator = comparator) !== null && _comparator !== void 0 ? _comparator : ((element, value) => element === toValue(value));\n\treturn computed(() => toValue(list).slice(formIndex).some((element, index, array) => comparator(toValue(element), toValue(value), index, toValue(array))));\n}\n// useArrayJoin/index.ts\n/**\n* Reactive `Array.join`\n*\n* @see https://vueuse.org/useArrayJoin\n* @param list - the array was called upon.\n* @param separator - a string to separate each pair of adjacent elements of the array. If omitted, the array elements are separated with a comma (\",\").\n*\n* @returns a string with all array elements joined. If arr.length is 0, the empty string is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayJoin(list, separator) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).join(toValue(separator)));\n}\n// useArrayMap/index.ts\n/**\n* Reactive `Array.map`\n*\n* @see https://vueuse.org/useArrayMap\n* @param list - the array was called upon.\n* @param fn - a function that is called for every element of the given `list`. Each time `fn` executes, the returned value is added to the new array.\n*\n* @returns a new array with each element being the result of the callback function.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayMap(list, fn) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).map(fn));\n}\n// useArrayReduce/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useArrayReduce(list, reducer, ...args) {\n\tconst reduceCallback = (sum, value, index) => reducer(toValue(sum), toValue(value), index);\n\treturn computed(() => {\n\t\tconst resolved = toValue(list);\n\t\treturn args.length ? resolved.reduce(reduceCallback, typeof args[0] === \"function\" ? toValue(args[0]()) : toValue(args[0])) : resolved.reduce(reduceCallback);\n\t});\n}\n// useArraySome/index.ts\n/**\n* Reactive `Array.some`\n*\n* @see https://vueuse.org/useArraySome\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns **true** if the `fn` function returns a **truthy** value for any element from the array. Otherwise, **false**.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArraySome(list, fn) {\n\treturn computed(() => toValue(list).some((element, index, array) => fn(toValue(element), index, array)));\n}\n// useArrayUnique/index.ts\nfunction uniq(array) {\n\treturn Array.from(new Set(array));\n}\nfunction uniqueElementsBy(array, fn) {\n\treturn array.reduce((acc, v) => {\n\t\tif (!acc.some((x) => fn(v, x, array))) acc.push(v);\n\t\treturn acc;\n\t}, []);\n}\n/**\n* reactive unique array\n* @see https://vueuse.org/useArrayUnique\n* @param list - the array was called upon.\n* @param compareFn\n* @returns A computed ref that returns a unique array of items.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayUnique(list, compareFn) {\n\treturn computed(() => {\n\t\tconst resolvedList = toValue(list).map((element) => toValue(element));\n\t\treturn compareFn ? uniqueElementsBy(resolvedList, compareFn) : uniq(resolvedList);\n\t});\n}\n// useCounter/index.ts\n/**\n* Basic counter with utility functions.\n*\n* @see https://vueuse.org/useCounter\n* @param [initialValue]\n* @param options\n*/\nfunction useCounter(initialValue = 0, options = {}) {\n\tlet _initialValue = unref(initialValue);\n\tconst count = shallowRef(initialValue);\n\tconst { max = Number.POSITIVE_INFINITY, min = Number.NEGATIVE_INFINITY } = options;\n\tconst inc = (delta = 1) => count.value = Math.max(Math.min(max, count.value + delta), min);\n\tconst dec = (delta = 1) => count.value = Math.min(Math.max(min, count.value - delta), max);\n\tconst get = () => count.value;\n\tconst set = (val) => count.value = Math.max(min, Math.min(max, val));\n\tconst reset = (val = _initialValue) => {\n\t\t_initialValue = val;\n\t\treturn set(val);\n\t};\n\treturn {\n\t\tcount: shallowReadonly(count),\n\t\tinc,\n\t\tdec,\n\t\tget,\n\t\tset,\n\t\treset\n\t};\n}\n// useDateFormat/index.ts\nconst REGEX_PARSE = /^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[T\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/i;\nconst REGEX_FORMAT = /[YMDHhms]o|\\[([^\\]]+)\\]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|z{1,4}|SSS/g;\nfunction defaultMeridiem(hours, minutes, isLowercase, hasPeriod) {\n\tlet m = hours < 12 ? \"AM\" : \"PM\";\n\tif (hasPeriod) m = m.split(\"\").reduce((acc, curr) => acc += `${curr}.`, \"\");\n\treturn isLowercase ? m.toLowerCase() : m;\n}\nfunction formatOrdinal(num) {\n\tconst suffixes = [\n\t\t\"th\",\n\t\t\"st\",\n\t\t\"nd\",\n\t\t\"rd\"\n\t];\n\tconst v = num % 100;\n\treturn num + (suffixes[(v - 20) % 10] || suffixes[v] || suffixes[0]);\n}\nfunction formatDate(date, formatStr, options = {}) {\n\tvar _options$customMeridi;\n\tconst years = date.getFullYear();\n\tconst month = date.getMonth();\n\tconst days = date.getDate();\n\tconst hours = date.getHours();\n\tconst minutes = date.getMinutes();\n\tconst seconds = date.getSeconds();\n\tconst milliseconds = date.getMilliseconds();\n\tconst day = date.getDay();\n\tconst meridiem = (_options$customMeridi = options.customMeridiem) !== null && _options$customMeridi !== void 0 ? _options$customMeridi : defaultMeridiem;\n\tconst stripTimeZone = (dateString) => {\n\t\tvar _dateString$split$;\n\t\treturn (_dateString$split$ = dateString.split(\" \")[1]) !== null && _dateString$split$ !== void 0 ? _dateString$split$ : \"\";\n\t};\n\tconst matches = {\n\t\tYo: () => formatOrdinal(years),\n\t\tYY: () => String(years).slice(-2),\n\t\tYYYY: () => years,\n\t\tM: () => month + 1,\n\t\tMo: () => formatOrdinal(month + 1),\n\t\tMM: () => `${month + 1}`.padStart(2, \"0\"),\n\t\tMMM: () => date.toLocaleDateString(toValue(options.locales), { month: \"short\" }),\n\t\tMMMM: () => date.toLocaleDateString(toValue(options.locales), { month: \"long\" }),\n\t\tD: () => String(days),\n\t\tDo: () => formatOrdinal(days),\n\t\tDD: () => `${days}`.padStart(2, \"0\"),\n\t\tH: () => String(hours),\n\t\tHo: () => formatOrdinal(hours),\n\t\tHH: () => `${hours}`.padStart(2, \"0\"),\n\t\th: () => `${hours % 12 || 12}`.padStart(1, \"0\"),\n\t\tho: () => formatOrdinal(hours % 12 || 12),\n\t\thh: () => `${hours % 12 || 12}`.padStart(2, \"0\"),\n\t\tm: () => String(minutes),\n\t\tmo: () => formatOrdinal(minutes),\n\t\tmm: () => `${minutes}`.padStart(2, \"0\"),\n\t\ts: () => String(seconds),\n\t\tso: () => formatOrdinal(seconds),\n\t\tss: () => `${seconds}`.padStart(2, \"0\"),\n\t\tSSS: () => `${milliseconds}`.padStart(3, \"0\"),\n\t\td: () => day,\n\t\tdd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"narrow\" }),\n\t\tddd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"short\" }),\n\t\tdddd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"long\" }),\n\t\tA: () => meridiem(hours, minutes),\n\t\tAA: () => meridiem(hours, minutes, false, true),\n\t\ta: () => meridiem(hours, minutes, true),\n\t\taa: () => meridiem(hours, minutes, true, true),\n\t\tz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzzzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"longOffset\" }))\n\t};\n\treturn formatStr.replace(REGEX_FORMAT, (match, $1) => {\n\t\tvar _ref, _matches$match;\n\t\treturn (_ref = $1 !== null && $1 !== void 0 ? $1 : (_matches$match = matches[match]) === null || _matches$match === void 0 ? void 0 : _matches$match.call(matches)) !== null && _ref !== void 0 ? _ref : match;\n\t});\n}\nfunction normalizeDate(date) {\n\tif (date === null) return /* @__PURE__ */ new Date(NaN);\n\tif (date === void 0) return /* @__PURE__ */ new Date();\n\tif (date instanceof Date) return new Date(date);\n\tif (typeof date === \"string\" && !/Z$/i.test(date)) {\n\t\tconst d = date.match(REGEX_PARSE);\n\t\tif (d) {\n\t\t\tconst m = d[2] - 1 || 0;\n\t\t\tconst ms = (d[7] || \"0\").substring(0, 3);\n\t\t\treturn new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);\n\t\t}\n\t}\n\treturn new Date(date);\n}\n/**\n* Get the formatted date according to the string of tokens passed in.\n*\n* @see https://vueuse.org/useDateFormat\n* @param date - The date to format, can either be a `Date` object, a timestamp, or a string\n* @param formatStr - The combination of tokens to format the date\n* @param options - UseDateFormatOptions\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDateFormat(date, formatStr = \"HH:mm:ss\", options = {}) {\n\treturn computed(() => formatDate(normalizeDate(toValue(date)), toValue(formatStr), options));\n}\n// useIntervalFn/index.ts\n/**\n* Wrapper for `setInterval` with controls\n*\n* @see https://vueuse.org/useIntervalFn\n* @param cb\n* @param interval\n* @param options\n*/\nfunction useIntervalFn(cb, interval = 1e3, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tlet timer = null;\n\tconst isActive = shallowRef(false);\n\tfunction clean() {\n\t\tif (timer) {\n\t\t\tclearInterval(timer);\n\t\t\ttimer = null;\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t\tclean();\n\t}\n\tfunction resume() {\n\t\tconst intervalValue = toValue(interval);\n\t\tif (intervalValue <= 0) return;\n\t\tisActive.value = true;\n\t\tif (immediateCallback) cb();\n\t\tclean();\n\t\tif (isActive.value) timer = setInterval(cb, intervalValue);\n\t}\n\tif (immediate && isClient) resume();\n\tif (isRef(interval) || typeof interval === \"function\") tryOnScopeDispose(watch(interval, () => {\n\t\tif (isActive.value && isClient) resume();\n\t}));\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive: shallowReadonly(isActive),\n\t\tpause,\n\t\tresume\n\t};\n}\n// useInterval/index.ts\nfunction useInterval(interval = 1e3, options = {}) {\n\tconst { controls: exposeControls = false, immediate = true, callback } = options;\n\tconst counter = shallowRef(0);\n\tconst update = () => counter.value += 1;\n\tconst reset = () => {\n\t\tcounter.value = 0;\n\t};\n\tconst controls = useIntervalFn(callback ? () => {\n\t\tupdate();\n\t\tcallback(counter.value);\n\t} : update, interval, { immediate });\n\tif (exposeControls) return {\n\t\tcounter: shallowReadonly(counter),\n\t\treset,\n\t\t...controls\n\t};\n\telse return shallowReadonly(counter);\n}\n// useLastChanged/index.ts\nfunction useLastChanged(source, options = {}) {\n\tvar _options$initialValue;\n\tconst ms = shallowRef((_options$initialValue = options.initialValue) !== null && _options$initialValue !== void 0 ? _options$initialValue : null);\n\twatch(source, () => ms.value = timestamp(), options);\n\treturn shallowReadonly(ms);\n}\n// useTimeoutFn/index.ts\n/**\n* Wrapper for `setTimeout` with controls.\n*\n* @param cb\n* @param interval\n* @param options\n*/\nfunction useTimeoutFn(cb, interval, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tconst isPending = shallowRef(false);\n\tlet timer;\n\tfunction clear() {\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t}\n\t}\n\tfunction stop() {\n\t\tisPending.value = false;\n\t\tclear();\n\t}\n\tfunction start(...args) {\n\t\tif (immediateCallback) cb();\n\t\tclear();\n\t\tisPending.value = true;\n\t\ttimer = setTimeout(() => {\n\t\t\tisPending.value = false;\n\t\t\ttimer = void 0;\n\t\t\tcb(...args);\n\t\t}, toValue(interval));\n\t}\n\tif (immediate) {\n\t\tisPending.value = true;\n\t\tif (isClient) start();\n\t}\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisPending: shallowReadonly(isPending),\n\t\tstart,\n\t\tstop\n\t};\n}\n// useTimeout/index.ts\nfunction useTimeout(interval = 1e3, options = {}) {\n\tconst { controls: exposeControls = false, callback } = options;\n\tconst controls = useTimeoutFn(callback !== null && callback !== void 0 ? callback : noop, interval, options);\n\tconst ready = computed(() => !controls.isPending.value);\n\tif (exposeControls) return {\n\t\tready,\n\t\t...controls\n\t};\n\telse return ready;\n}\n// useToNumber/index.ts\n/**\n* Reactively convert a string ref to number.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToNumber(value, options = {}) {\n\tconst { method = \"parseFloat\", radix, nanToZero } = options;\n\treturn computed(() => {\n\t\tlet resolved = toValue(value);\n\t\tif (typeof method === \"function\") resolved = method(resolved);\n\t\telse if (typeof resolved === \"string\") resolved = Number[method](resolved, radix);\n\t\tif (nanToZero && Number.isNaN(resolved)) resolved = 0;\n\t\treturn resolved;\n\t});\n}\n// useToString/index.ts\n/**\n* Reactively convert a ref to string.\n*\n* @see https://vueuse.org/useToString\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToString(value) {\n\treturn computed(() => `${toValue(value)}`);\n}\n// useToggle/index.ts\n/**\n* A boolean ref with a toggler\n*\n* @see https://vueuse.org/useToggle\n* @param [initialValue]\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToggle(initialValue = false, options = {}) {\n\tconst { truthyValue = true, falsyValue = false } = options;\n\tconst valueIsRef = isRef(initialValue);\n\tconst _value = shallowRef(initialValue);\n\tfunction toggle(value) {\n\t\tif (arguments.length) {\n\t\t\t_value.value = value;\n\t\t\treturn _value.value;\n\t\t} else {\n\t\t\tconst truthy = toValue(truthyValue);\n\t\t\t_value.value = _value.value === truthy ? toValue(falsyValue) : truthy;\n\t\t\treturn _value.value;\n\t\t}\n\t}\n\tif (valueIsRef) return toggle;\n\telse return [_value, toggle];\n}\n// watchArray/index.ts\n/**\n* Watch for an array with additions and removals.\n*\n* @see https://vueuse.org/watchArray\n*/\nfunction watchArray(source, cb, options) {\n\tlet oldList = (options === null || options === void 0 ? void 0 : options.immediate) ? [] : [...typeof source === \"function\" ? source() : Array.isArray(source) ? source : toValue(source)];\n\treturn watch(source, (newList, _, onCleanup) => {\n\t\tconst oldListRemains = Array.from({ length: oldList.length });\n\t\tconst added = [];\n\t\tfor (const obj of newList) {\n\t\t\tlet found = false;\n\t\t\tfor (let i = 0; i < oldList.length; i++) if (!oldListRemains[i] && obj === oldList[i]) {\n\t\t\t\toldListRemains[i] = true;\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!found) added.push(obj);\n\t\t}\n\t\tconst removed = oldList.filter((_, i) => !oldListRemains[i]);\n\t\tcb(newList, oldList, added, removed, onCleanup);\n\t\toldList = [...newList];\n\t}, options);\n}\n// watchAtMost/index.ts\nfunction watchAtMost(source, cb, options) {\n\tconst { count, ...watchOptions } = options;\n\tconst current = shallowRef(0);\n\tconst { stop, resume, pause } = watchWithFilter(source, (...args) => {\n\t\tcurrent.value += 1;\n\t\tif (current.value >= toValue(count)) nextTick(() => stop());\n\t\tcb(...args);\n\t}, watchOptions);\n\treturn {\n\t\tcount: current,\n\t\tstop,\n\t\tresume,\n\t\tpause\n\t};\n}\n// watchDebounced/index.ts\nfunction watchDebounced(source, cb, options = {}) {\n\tconst { debounce = 0, maxWait = void 0, ...watchOptions } = options;\n\treturn watchWithFilter(source, cb, {\n\t\t...watchOptions,\n\t\teventFilter: debounceFilter(debounce, { maxWait })\n\t});\n}\n/** @deprecated use `watchDebounced` instead */\nconst debouncedWatch = watchDebounced;\n// watchDeep/index.ts\n/**\n* Shorthand for watching value with {deep: true}\n*\n* @see https://vueuse.org/watchDeep\n*/\nfunction watchDeep(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\tdeep: true\n\t});\n}\n// watchIgnorable/index.ts\nfunction watchIgnorable(source, cb, options = {}) {\n\tconst { eventFilter = bypassFilter, ...watchOptions } = options;\n\tconst filteredCb = createFilterWrapper(eventFilter, cb);\n\tlet ignoreUpdates;\n\tlet ignorePrevAsyncUpdates;\n\tlet stop;\n\tif (watchOptions.flush === \"sync\") {\n\t\tlet ignore = false;\n\t\tignorePrevAsyncUpdates = () => {};\n\t\tignoreUpdates = (updater) => {\n\t\t\tignore = true;\n\t\t\tupdater();\n\t\t\tignore = false;\n\t\t};\n\t\tstop = watch(source, (...args) => {\n\t\t\tif (!ignore) filteredCb(...args);\n\t\t}, watchOptions);\n\t} else {\n\t\tconst disposables = [];\n\t\tlet ignoreCounter = 0;\n\t\tlet syncCounter = 0;\n\t\tignorePrevAsyncUpdates = () => {\n\t\t\tignoreCounter = syncCounter;\n\t\t};\n\t\tconst { onTrack, onTrigger, ...countingWatchOptions } = watchOptions;\n\t\tdisposables.push(watch(source, () => {\n\t\t\tsyncCounter++;\n\t\t}, {\n\t\t\t...countingWatchOptions,\n\t\t\tflush: \"sync\"\n\t\t}));\n\t\tignoreUpdates = (updater) => {\n\t\t\tconst syncCounterPrev = syncCounter;\n\t\t\tupdater();\n\t\t\tignoreCounter += syncCounter - syncCounterPrev;\n\t\t};\n\t\tdisposables.push(watch(source, (...args) => {\n\t\t\tconst ignore = ignoreCounter > 0 && ignoreCounter === syncCounter;\n\t\t\tignoreCounter = 0;\n\t\t\tsyncCounter = 0;\n\t\t\tif (ignore) return;\n\t\t\tfilteredCb(...args);\n\t\t}, watchOptions));\n\t\tstop = () => {\n\t\t\tdisposables.forEach((fn) => fn());\n\t\t};\n\t}\n\treturn {\n\t\tstop,\n\t\tignoreUpdates,\n\t\tignorePrevAsyncUpdates\n\t};\n}\n/** @deprecated use `watchIgnorable` instead */\nconst ignorableWatch = watchIgnorable;\n// watchImmediate/index.ts\n/**\n* Shorthand for watching value with {immediate: true}\n*\n* @see https://vueuse.org/watchImmediate\n*/\nfunction watchImmediate(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\timmediate: true\n\t});\n}\n// watchOnce/index.ts\n/**\n* Shorthand for watching value with { once: true }\n*\n* @see https://vueuse.org/watchOnce\n*/\nfunction watchOnce(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\tonce: true\n\t});\n}\n// watchThrottled/index.ts\nfunction watchThrottled(source, cb, options = {}) {\n\tconst { throttle = 0, trailing = true, leading = true, ...watchOptions } = options;\n\treturn watchWithFilter(source, cb, {\n\t\t...watchOptions,\n\t\teventFilter: throttleFilter(throttle, trailing, leading)\n\t});\n}\n/** @deprecated use `watchThrottled` instead */\nconst throttledWatch = watchThrottled;\n// watchTriggerable/index.ts\nfunction watchTriggerable(source, cb, options = {}) {\n\tlet cleanupFn;\n\tfunction onEffect() {\n\t\tif (!cleanupFn) return;\n\t\tconst fn = cleanupFn;\n\t\tcleanupFn = void 0;\n\t\tfn();\n\t}\n\t/** Register the function `cleanupFn` */\n\tfunction onCleanup(callback) {\n\t\tcleanupFn = callback;\n\t}\n\tconst _cb = (value, oldValue) => {\n\t\tonEffect();\n\t\treturn cb(value, oldValue, onCleanup);\n\t};\n\tconst res = watchIgnorable(source, _cb, options);\n\tconst { ignoreUpdates } = res;\n\tconst trigger = () => {\n\t\tlet res;\n\t\tignoreUpdates(() => {\n\t\t\tres = _cb(getWatchSources(source), getOldValue(source));\n\t\t});\n\t\treturn res;\n\t};\n\treturn {\n\t\t...res,\n\t\ttrigger\n\t};\n}\nfunction getWatchSources(sources) {\n\tif (isReactive(sources)) return sources;\n\tif (Array.isArray(sources)) return sources.map((item) => toValue(item));\n\treturn toValue(sources);\n}\nfunction getOldValue(source) {\n\treturn Array.isArray(source) ? source.map(() => void 0) : void 0;\n}\n// whenever/index.ts\nfunction whenever(source, cb, options) {\n\tconst stop = watch(source, (v, ov, onInvalidate) => {\n\t\tif (v) {\n\t\t\tif (options === null || options === void 0 ? void 0 : options.once) nextTick(() => stop());\n\t\t\tcb(v, ov, onInvalidate);\n\t\t}\n\t}, {\n\t\t...options,\n\t\tonce: false\n\t});\n\treturn stop;\n}\nexport { assert, autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, controlledComputed, controlledRef, createDisposableDirective, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, createReactiveFn, createRef, createSharedComposable, createSingletonPromise, debounceFilter, debouncedRef, debouncedWatch, eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, pausableWatch, promiseTimeout, provideLocal, pxValue, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refManualReset, refThrottled, refWithControl, set, syncRef, syncRefs, throttleFilter, throttledRef, throttledWatch, timestamp, toArray, toReactive, toRef, toRefs, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };\n","import { bypassFilter, camelize, clamp, computedWithControl, containsProp, createEventHook, createFilterWrapper, createRef, createSingletonPromise, debounceFilter, hasOwn, identity, increaseWithUnit, injectLocal, isClient, isDef, isIOS, isObject, isWorker, makeDestructurable, noop, notNullish, objectEntries, objectOmit, objectPick, pausableFilter, promiseTimeout, provideLocal, pxValue, syncRef, throttleFilter, timestamp, toArray, toRef, toRefs, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useDebounceFn, useIntervalFn, useThrottleFn, useTimeoutFn, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchWithFilter, whenever } from \"@vueuse/shared\";\nimport { Fragment, TransitionGroup, computed, defineComponent, getCurrentInstance, h, hasInjectionContext, inject, isReadonly, isRef, markRaw, nextTick, onBeforeUpdate, onMounted, onUpdated, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, toRaw, toValue, unref, watch, watchEffect } from \"vue\";\nexport * from \"@vueuse/shared\";\n// computedAsync/index.ts\nfunction computedAsync(evaluationCallback, initialState, optionsOrRef) {\n\tvar _globalThis$reportErr;\n\tlet options;\n\tif (isRef(optionsOrRef)) options = { evaluating: optionsOrRef };\n\telse options = optionsOrRef || {};\n\tconst { lazy = false, flush = \"sync\", evaluating = void 0, shallow = true, onError = (_globalThis$reportErr = globalThis.reportError) !== null && _globalThis$reportErr !== void 0 ? _globalThis$reportErr : noop } = options;\n\tconst started = shallowRef(!lazy);\n\tconst current = shallow ? shallowRef(initialState) : ref(initialState);\n\tlet counter = 0;\n\twatchEffect(async (onInvalidate) => {\n\t\tif (!started.value) return;\n\t\tcounter++;\n\t\tconst counterAtBeginning = counter;\n\t\tlet hasFinished = false;\n\t\tif (evaluating) Promise.resolve().then(() => {\n\t\t\tevaluating.value = true;\n\t\t});\n\t\ttry {\n\t\t\tconst result = await evaluationCallback((cancelCallback) => {\n\t\t\t\tonInvalidate(() => {\n\t\t\t\t\tif (evaluating) evaluating.value = false;\n\t\t\t\t\tif (!hasFinished) cancelCallback();\n\t\t\t\t});\n\t\t\t});\n\t\t\tif (counterAtBeginning === counter) current.value = result;\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t} finally {\n\t\t\tif (evaluating && counterAtBeginning === counter) evaluating.value = false;\n\t\t\thasFinished = true;\n\t\t}\n\t}, { flush });\n\tif (lazy) return computed(() => {\n\t\tstarted.value = true;\n\t\treturn current.value;\n\t});\n\telse return current;\n}\n/** @deprecated use `computedAsync` instead */\nconst asyncComputed = computedAsync;\n// computedInject/index.ts\nfunction computedInject(key, options, defaultSource, treatDefaultAsFactory) {\n\tlet source = inject(key);\n\tif (defaultSource) source = inject(key, defaultSource);\n\tif (treatDefaultAsFactory) source = inject(key, defaultSource, treatDefaultAsFactory);\n\tif (typeof options === \"function\") return computed((oldValue) => options(source, oldValue));\n\telse return computed({\n\t\tget: (oldValue) => options.get(source, oldValue),\n\t\tset: options.set\n\t});\n}\n// createReusableTemplate/index.ts\n/**\n* This function creates `define` and `reuse` components in pair,\n* It also allow to pass a generic to bind with type.\n*\n* @see https://vueuse.org/createReusableTemplate\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createReusableTemplate(options = {}) {\n\tconst { inheritAttrs = true, name = \"ReusableTemplate\" } = options;\n\tconst render = shallowRef();\n\tconst define = defineComponent({\n\t\tname: `${name}.define`,\n\t\tsetup(_, { slots }) {\n\t\t\treturn () => {\n\t\t\t\trender.value = slots.default;\n\t\t\t};\n\t\t}\n\t});\n\tconst reuse = defineComponent({\n\t\tinheritAttrs,\n\t\tname: `${name}.reuse`,\n\t\tprops: options.props,\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () => {\n\t\t\t\tvar _render$value;\n\t\t\t\tif (!render.value && true) throw new Error(\"[VueUse] Failed to find the definition of reusable template\");\n\t\t\t\tconst vnode = (_render$value = render.value) === null || _render$value === void 0 ? void 0 : _render$value.call(render, {\n\t\t\t\t\t...options.props == null ? keysToCamelKebabCase(attrs) : props,\n\t\t\t\t\t$slots: slots\n\t\t\t\t});\n\t\t\t\treturn inheritAttrs && (vnode === null || vnode === void 0 ? void 0 : vnode.length) === 1 ? vnode[0] : vnode;\n\t\t\t};\n\t\t}\n\t});\n\treturn makeDestructurable({\n\t\tdefine,\n\t\treuse\n\t}, [define, reuse]);\n}\nfunction keysToCamelKebabCase(obj) {\n\tconst newObj = {};\n\tfor (const key in obj) newObj[camelize(key)] = obj[key];\n\treturn newObj;\n}\n// createTemplatePromise/index.ts\n/**\n* Creates a template promise component.\n*\n* @see https://vueuse.org/createTemplatePromise\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createTemplatePromise(options = {}) {\n\tlet index = 0;\n\tconst instances = ref([]);\n\tfunction create(...args) {\n\t\tconst props = shallowReactive({\n\t\t\tkey: index++,\n\t\t\targs,\n\t\t\tpromise: void 0,\n\t\t\tresolve: () => {},\n\t\t\treject: () => {},\n\t\t\tisResolving: false,\n\t\t\toptions\n\t\t});\n\t\tinstances.value.push(props);\n\t\tprops.promise = new Promise((_resolve, _reject) => {\n\t\t\tprops.resolve = (v) => {\n\t\t\t\tprops.isResolving = true;\n\t\t\t\treturn _resolve(v);\n\t\t\t};\n\t\t\tprops.reject = _reject;\n\t\t}).finally(() => {\n\t\t\tprops.promise = void 0;\n\t\t\tconst index = instances.value.indexOf(props);\n\t\t\tif (index !== -1) instances.value.splice(index, 1);\n\t\t});\n\t\treturn props.promise;\n\t}\n\tfunction start(...args) {\n\t\tif (options.singleton && instances.value.length > 0) return instances.value[0].promise;\n\t\treturn create(...args);\n\t}\n\tconst component = defineComponent((_, { slots }) => {\n\t\tconst renderList = () => instances.value.map((props) => {\n\t\t\tvar _slots$default;\n\t\t\treturn h(Fragment, { key: props.key }, (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots, props));\n\t\t});\n\t\tif (options.transition) return () => h(TransitionGroup, options.transition, renderList);\n\t\treturn renderList;\n\t});\n\tcomponent.start = start;\n\treturn component;\n}\n// createUnrefFn/index.ts\n/**\n* Make a plain function accepting ref and raw values as arguments.\n* Returns the same value the unconverted function returns, with proper typing.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createUnrefFn(fn) {\n\treturn function(...args) {\n\t\treturn fn.apply(this, args.map((i) => toValue(i)));\n\t};\n}\n// _configurable.ts\nconst defaultWindow = isClient ? window : void 0;\nconst defaultDocument = isClient ? window.document : void 0;\nconst defaultNavigator = isClient ? window.navigator : void 0;\nconst defaultLocation = isClient ? window.location : void 0;\n// unrefElement/index.ts\n/**\n* Get the dom element of a ref of element or Vue component instance\n*\n* @param elRef\n*/\nfunction unrefElement(elRef) {\n\tvar _$el;\n\tconst plain = toValue(elRef);\n\treturn (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;\n}\n// useEventListener/index.ts\nfunction useEventListener(...args) {\n\tconst register = (el, event, listener, options) => {\n\t\tel.addEventListener(event, listener, options);\n\t\treturn () => el.removeEventListener(event, listener, options);\n\t};\n\tconst firstParamTargets = computed(() => {\n\t\tconst test = toArray(toValue(args[0])).filter((e) => e != null);\n\t\treturn test.every((e) => typeof e !== \"string\") ? test : void 0;\n\t});\n\treturn watchImmediate(() => {\n\t\tvar _firstParamTargets$va, _firstParamTargets$va2;\n\t\treturn [\n\t\t\t(_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null),\n\t\t\ttoArray(toValue(firstParamTargets.value ? args[1] : args[0])),\n\t\t\ttoArray(unref(firstParamTargets.value ? args[2] : args[1])),\n\t\t\ttoValue(firstParamTargets.value ? args[3] : args[2])\n\t\t];\n\t}, ([raw_targets, raw_events, raw_listeners, raw_options], _, onCleanup) => {\n\t\tif (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;\n\t\tconst optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;\n\t\tconst cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))));\n\t\tonCleanup(() => {\n\t\t\tcleanups.forEach((fn) => fn());\n\t\t});\n\t}, { flush: \"post\" });\n}\n// onClickOutside/index.ts\nlet _iOSWorkaround = false;\nfunction onClickOutside(target, handler, options = {}) {\n\tconst { window = defaultWindow, ignore = [], capture = true, detectIframe = false, controls = false } = options;\n\tif (!window) return controls ? {\n\t\tstop: noop,\n\t\tcancel: noop,\n\t\ttrigger: noop\n\t} : noop;\n\tif (isIOS && !_iOSWorkaround) {\n\t\t_iOSWorkaround = true;\n\t\tconst listenerOptions = { passive: true };\n\t\tArray.from(window.document.body.children).forEach((el) => el.addEventListener(\"click\", noop, listenerOptions));\n\t\twindow.document.documentElement.addEventListener(\"click\", noop, listenerOptions);\n\t}\n\tlet shouldListen = true;\n\tconst shouldIgnore = (event) => {\n\t\treturn toValue(ignore).some((target) => {\n\t\t\tif (typeof target === \"string\") return Array.from(window.document.querySelectorAll(target)).some((el) => el === event.target || event.composedPath().includes(el));\n\t\t\telse {\n\t\t\t\tconst el = unrefElement(target);\n\t\t\t\treturn el && (event.target === el || event.composedPath().includes(el));\n\t\t\t}\n\t\t});\n\t};\n\t/**\n\t* Determines if the given target has multiple root elements.\n\t* Referenced from: https://github.com/vuejs/test-utils/blob/ccb460be55f9f6be05ab708500a41ec8adf6f4bc/src/vue-wrapper.ts#L21\n\t*/\n\tfunction hasMultipleRoots(target) {\n\t\tconst vm = toValue(target);\n\t\treturn vm && vm.$.subTree.shapeFlag === 16;\n\t}\n\tfunction checkMultipleRoots(target, event) {\n\t\tconst vm = toValue(target);\n\t\tconst children = vm.$.subTree && vm.$.subTree.children;\n\t\tif (children == null || !Array.isArray(children)) return false;\n\t\treturn children.some((child) => child.el === event.target || event.composedPath().includes(child.el));\n\t}\n\tconst listener = (event) => {\n\t\tconst el = unrefElement(target);\n\t\tif (event.target == null) return;\n\t\tif (!(el instanceof Element) && hasMultipleRoots(target) && checkMultipleRoots(target, event)) return;\n\t\tif (!el || el === event.target || event.composedPath().includes(el)) return;\n\t\tif (\"detail\" in event && event.detail === 0) shouldListen = !shouldIgnore(event);\n\t\tif (!shouldListen) {\n\t\t\tshouldListen = true;\n\t\t\treturn;\n\t\t}\n\t\thandler(event);\n\t};\n\tlet isProcessingClick = false;\n\tconst cleanup = [\n\t\tuseEventListener(window, \"click\", (event) => {\n\t\t\tif (!isProcessingClick) {\n\t\t\t\tisProcessingClick = true;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tisProcessingClick = false;\n\t\t\t\t}, 0);\n\t\t\t\tlistener(event);\n\t\t\t}\n\t\t}, {\n\t\t\tpassive: true,\n\t\t\tcapture\n\t\t}),\n\t\tuseEventListener(window, \"pointerdown\", (e) => {\n\t\t\tconst el = unrefElement(target);\n\t\t\tshouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));\n\t\t}, { passive: true }),\n\t\tdetectIframe && useEventListener(window, \"blur\", (event) => {\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst el = unrefElement(target);\n\t\t\t\tlet activeEl = window.document.activeElement;\n\t\t\t\twhile (activeEl === null || activeEl === void 0 ? void 0 : activeEl.shadowRoot) activeEl = activeEl.shadowRoot.activeElement;\n\t\t\t\tif ((activeEl === null || activeEl === void 0 ? void 0 : activeEl.tagName) === \"IFRAME\" && !(el === null || el === void 0 ? void 0 : el.contains(window.document.activeElement))) handler(event);\n\t\t\t}, 0);\n\t\t}, { passive: true })\n\t].filter(Boolean);\n\tconst stop = () => cleanup.forEach((fn) => fn());\n\tif (controls) return {\n\t\tstop,\n\t\tcancel: () => {\n\t\t\tshouldListen = false;\n\t\t},\n\t\ttrigger: (event) => {\n\t\t\tshouldListen = true;\n\t\t\tlistener(event);\n\t\t\tshouldListen = false;\n\t\t}\n\t};\n\treturn stop;\n}\n// useMounted/index.ts\n/**\n* Mounted state in ref.\n*\n* @see https://vueuse.org/useMounted\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMounted() {\n\tconst isMounted = shallowRef(false);\n\tconst instance = getCurrentInstance();\n\tif (instance) onMounted(() => {\n\t\tisMounted.value = true;\n\t}, instance);\n\treturn isMounted;\n}\n// useSupported/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useSupported(callback) {\n\tconst isMounted = useMounted();\n\treturn computed(() => {\n\t\tisMounted.value;\n\t\treturn Boolean(callback());\n\t});\n}\n// useMutationObserver/index.ts\n/**\n* Watch for changes being made to the DOM tree.\n*\n* @see https://vueuse.org/useMutationObserver\n* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver MutationObserver MDN\n* @param target\n* @param callback\n* @param options\n*/\nfunction useMutationObserver(target, callback, options = {}) {\n\tconst { window = defaultWindow, ...mutationOptions } = options;\n\tlet observer;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"MutationObserver\" in window);\n\tconst cleanup = () => {\n\t\tif (observer) {\n\t\t\tobserver.disconnect();\n\t\t\tobserver = void 0;\n\t\t}\n\t};\n\tconst targets = computed(() => {\n\t\tconst value = toValue(target);\n\t\tconst items = toArray(value).map(unrefElement).filter(notNullish);\n\t\treturn new Set(items);\n\t});\n\tconst stopWatch = watch(targets, (newTargets) => {\n\t\tcleanup();\n\t\tif (isSupported.value && newTargets.size) {\n\t\t\tobserver = new MutationObserver(callback);\n\t\t\tnewTargets.forEach((el) => observer.observe(el, mutationOptions));\n\t\t}\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\tconst takeRecords = () => {\n\t\treturn observer === null || observer === void 0 ? void 0 : observer.takeRecords();\n\t};\n\tconst stop = () => {\n\t\tstopWatch();\n\t\tcleanup();\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tstop,\n\t\ttakeRecords\n\t};\n}\n// onElementRemoval/index.ts\n/**\n* Fires when the element or any element containing it is removed.\n*\n* @param target\n* @param callback\n* @param options\n*/\nfunction onElementRemoval(target, callback, options = {}) {\n\tconst { window = defaultWindow, document = window === null || window === void 0 ? void 0 : window.document, flush = \"sync\" } = options;\n\tif (!window || !document) return noop;\n\tlet stopFn;\n\tconst cleanupAndUpdate = (fn) => {\n\t\tstopFn === null || stopFn === void 0 || stopFn();\n\t\tstopFn = fn;\n\t};\n\tconst stopWatch = watchEffect(() => {\n\t\tconst el = unrefElement(target);\n\t\tif (el) {\n\t\t\tconst { stop } = useMutationObserver(document, (mutationsList) => {\n\t\t\t\tif (mutationsList.map((mutation) => [...mutation.removedNodes]).flat().some((node) => node === el || node.contains(el))) callback(mutationsList);\n\t\t\t}, {\n\t\t\t\twindow,\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: true\n\t\t\t});\n\t\t\tcleanupAndUpdate(stop);\n\t\t}\n\t}, { flush });\n\tconst stopHandle = () => {\n\t\tstopWatch();\n\t\tcleanupAndUpdate();\n\t};\n\ttryOnScopeDispose(stopHandle);\n\treturn stopHandle;\n}\n// onKeyStroke/index.ts\nfunction createKeyPredicate(keyFilter) {\n\tif (typeof keyFilter === \"function\") return keyFilter;\n\telse if (typeof keyFilter === \"string\") return (event) => event.key === keyFilter;\n\telse if (Array.isArray(keyFilter)) return (event) => keyFilter.includes(event.key);\n\treturn () => true;\n}\nfunction onKeyStroke(...args) {\n\tlet key;\n\tlet handler;\n\tlet options = {};\n\tif (args.length === 3) {\n\t\tkey = args[0];\n\t\thandler = args[1];\n\t\toptions = args[2];\n\t} else if (args.length === 2) {\n\t\tif (typeof args[1] === \"object\") {\n\t\t\tkey = true;\n\t\t\thandler = args[0];\n\t\t\toptions = args[1];\n\t\t} else {\n\t\t\tkey = args[0];\n\t\t\thandler = args[1];\n\t\t}\n\t} else {\n\t\tkey = true;\n\t\thandler = args[0];\n\t}\n\tconst { target = defaultWindow, eventName = \"keydown\", passive = false, dedupe = false } = options;\n\tconst predicate = createKeyPredicate(key);\n\tconst listener = (e) => {\n\t\tif (e.repeat && toValue(dedupe)) return;\n\t\tif (predicate(e)) handler(e);\n\t};\n\treturn useEventListener(target, eventName, listener, passive);\n}\n/**\n* Listen to the keydown event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyDown(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keydown\"\n\t});\n}\n/**\n* Listen to the keypress event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyPressed(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keypress\"\n\t});\n}\n/**\n* Listen to the keyup event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyUp(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keyup\"\n\t});\n}\n// onLongPress/index.ts\nconst DEFAULT_DELAY = 500;\nconst DEFAULT_THRESHOLD = 10;\nfunction onLongPress(target, handler, options) {\n\tvar _options$modifiers10, _options$modifiers11;\n\tconst elementRef = computed(() => unrefElement(target));\n\tlet timeout;\n\tlet posStart;\n\tlet startTimestamp;\n\tlet hasLongPressed = false;\n\tfunction clear() {\n\t\tif (timeout) {\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = void 0;\n\t\t}\n\t\tposStart = void 0;\n\t\tstartTimestamp = void 0;\n\t\thasLongPressed = false;\n\t}\n\tfunction getDelay(ev) {\n\t\tconst delay = options === null || options === void 0 ? void 0 : options.delay;\n\t\tif (typeof delay === \"function\") return delay(ev);\n\t\treturn delay !== null && delay !== void 0 ? delay : DEFAULT_DELAY;\n\t}\n\tfunction onRelease(ev) {\n\t\tvar _options$modifiers, _options$modifiers2, _options$modifiers3;\n\t\tconst [_startTimestamp, _posStart, _hasLongPressed] = [\n\t\t\tstartTimestamp,\n\t\t\tposStart,\n\t\t\thasLongPressed\n\t\t];\n\t\tclear();\n\t\tif (!(options === null || options === void 0 ? void 0 : options.onMouseUp) || !_posStart || !_startTimestamp) return;\n\t\tif ((options === null || options === void 0 || (_options$modifiers = options.modifiers) === null || _options$modifiers === void 0 ? void 0 : _options$modifiers.self) && ev.target !== elementRef.value) return;\n\t\tif (options === null || options === void 0 || (_options$modifiers2 = options.modifiers) === null || _options$modifiers2 === void 0 ? void 0 : _options$modifiers2.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers3 = options.modifiers) === null || _options$modifiers3 === void 0 ? void 0 : _options$modifiers3.stop) ev.stopPropagation();\n\t\tconst dx = ev.x - _posStart.x;\n\t\tconst dy = ev.y - _posStart.y;\n\t\tconst distance = Math.sqrt(dx * dx + dy * dy);\n\t\toptions.onMouseUp(ev.timeStamp - _startTimestamp, distance, _hasLongPressed, ev);\n\t}\n\tfunction onDown(ev) {\n\t\tvar _options$modifiers4, _options$modifiers5, _options$modifiers6;\n\t\tif ((options === null || options === void 0 || (_options$modifiers4 = options.modifiers) === null || _options$modifiers4 === void 0 ? void 0 : _options$modifiers4.self) && ev.target !== elementRef.value) return;\n\t\tclear();\n\t\tif (options === null || options === void 0 || (_options$modifiers5 = options.modifiers) === null || _options$modifiers5 === void 0 ? void 0 : _options$modifiers5.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers6 = options.modifiers) === null || _options$modifiers6 === void 0 ? void 0 : _options$modifiers6.stop) ev.stopPropagation();\n\t\tposStart = {\n\t\t\tx: ev.x,\n\t\t\ty: ev.y\n\t\t};\n\t\tstartTimestamp = ev.timeStamp;\n\t\ttimeout = setTimeout(() => {\n\t\t\thasLongPressed = true;\n\t\t\thandler(ev);\n\t\t}, getDelay(ev));\n\t}\n\tfunction onMove(ev) {\n\t\tvar _options$modifiers7, _options$modifiers8, _options$modifiers9, _options$distanceThre;\n\t\tif ((options === null || options === void 0 || (_options$modifiers7 = options.modifiers) === null || _options$modifiers7 === void 0 ? void 0 : _options$modifiers7.self) && ev.target !== elementRef.value) return;\n\t\tif (!posStart || (options === null || options === void 0 ? void 0 : options.distanceThreshold) === false) return;\n\t\tif (options === null || options === void 0 || (_options$modifiers8 = options.modifiers) === null || _options$modifiers8 === void 0 ? void 0 : _options$modifiers8.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers9 = options.modifiers) === null || _options$modifiers9 === void 0 ? void 0 : _options$modifiers9.stop) ev.stopPropagation();\n\t\tconst dx = ev.x - posStart.x;\n\t\tconst dy = ev.y - posStart.y;\n\t\tif (Math.sqrt(dx * dx + dy * dy) >= ((_options$distanceThre = options === null || options === void 0 ? void 0 : options.distanceThreshold) !== null && _options$distanceThre !== void 0 ? _options$distanceThre : DEFAULT_THRESHOLD)) clear();\n\t}\n\tconst listenerOptions = {\n\t\tcapture: options === null || options === void 0 || (_options$modifiers10 = options.modifiers) === null || _options$modifiers10 === void 0 ? void 0 : _options$modifiers10.capture,\n\t\tonce: options === null || options === void 0 || (_options$modifiers11 = options.modifiers) === null || _options$modifiers11 === void 0 ? void 0 : _options$modifiers11.once\n\t};\n\tconst cleanup = [\n\t\tuseEventListener(elementRef, \"pointerdown\", onDown, listenerOptions),\n\t\tuseEventListener(elementRef, \"pointermove\", onMove, listenerOptions),\n\t\tuseEventListener(elementRef, [\n\t\t\t\"pointerup\",\n\t\t\t\"pointerleave\",\n\t\t\t\"pointercancel\"\n\t\t], onRelease, listenerOptions)\n\t];\n\tconst stop = () => cleanup.forEach((fn) => fn());\n\treturn stop;\n}\n// onStartTyping/index.ts\nfunction isFocusedElementEditable() {\n\tconst { activeElement, body } = document;\n\tif (!activeElement) return false;\n\tif (activeElement === body) return false;\n\tswitch (activeElement.tagName) {\n\t\tcase \"INPUT\":\n\t\tcase \"TEXTAREA\": return true;\n\t}\n\treturn activeElement.hasAttribute(\"contenteditable\");\n}\nfunction isTypedCharValid({ keyCode, metaKey, ctrlKey, altKey }) {\n\tif (metaKey || ctrlKey || altKey) return false;\n\tif (keyCode >= 48 && keyCode <= 57 || keyCode >= 96 && keyCode <= 105) return true;\n\tif (keyCode >= 65 && keyCode <= 90) return true;\n\treturn false;\n}\n/**\n* Fires when users start typing on non-editable elements.\n*\n* @see https://vueuse.org/onStartTyping\n* @param callback\n* @param options\n*/\nfunction onStartTyping(callback, options = {}) {\n\tconst { document = defaultDocument, isTypedCharValid: isTypedCharValidFn = isTypedCharValid, isFocusedElementEditable: isFocusedElementEditableFn = isFocusedElementEditable } = options;\n\tconst keydown = (event) => {\n\t\tif (!isFocusedElementEditableFn() && isTypedCharValidFn(event)) callback(event);\n\t};\n\tif (document) useEventListener(document, \"keydown\", keydown, { passive: true });\n}\n// useActiveElement/index.ts\n/**\n* Reactive `document.activeElement`\n*\n* @see https://vueuse.org/useActiveElement\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useActiveElement(options = {}) {\n\tvar _options$document;\n\tconst { window = defaultWindow, deep = true, triggerOnRemoval = false } = options;\n\tconst document = (_options$document = options.document) !== null && _options$document !== void 0 ? _options$document : window === null || window === void 0 ? void 0 : window.document;\n\tconst getDeepActiveElement = () => {\n\t\tlet element = document === null || document === void 0 ? void 0 : document.activeElement;\n\t\tif (deep) {\n\t\t\tvar _element$shadowRoot;\n\t\t\twhile (element === null || element === void 0 ? void 0 : element.shadowRoot) element = element === null || element === void 0 || (_element$shadowRoot = element.shadowRoot) === null || _element$shadowRoot === void 0 ? void 0 : _element$shadowRoot.activeElement;\n\t\t}\n\t\treturn element;\n\t};\n\tconst activeElement = shallowRef();\n\tconst trigger = () => {\n\t\tactiveElement.value = getDeepActiveElement();\n\t};\n\tif (window) {\n\t\tconst listenerOptions = {\n\t\t\tcapture: true,\n\t\t\tpassive: true\n\t\t};\n\t\tuseEventListener(window, \"blur\", (event) => {\n\t\t\tif (event.relatedTarget !== null) return;\n\t\t\ttrigger();\n\t\t}, listenerOptions);\n\t\tuseEventListener(window, \"focus\", trigger, listenerOptions);\n\t}\n\tif (triggerOnRemoval) onElementRemoval(activeElement, trigger, { document });\n\ttrigger();\n\treturn activeElement;\n}\n// useRafFn/index.ts\n/**\n* Call function on every `requestAnimationFrame`. With controls of pausing and resuming.\n*\n* @see https://vueuse.org/useRafFn\n* @param fn\n* @param options\n*/\nfunction useRafFn(fn, options = {}) {\n\tconst { immediate = true, fpsLimit = null, window = defaultWindow, once = false } = options;\n\tconst isActive = shallowRef(false);\n\tconst intervalLimit = computed(() => {\n\t\tconst limit = toValue(fpsLimit);\n\t\treturn limit ? 1e3 / limit : null;\n\t});\n\tlet previousFrameTimestamp = 0;\n\tlet rafId = null;\n\tfunction loop(timestamp) {\n\t\tif (!isActive.value || !window) return;\n\t\tif (!previousFrameTimestamp) previousFrameTimestamp = timestamp;\n\t\tconst delta = timestamp - previousFrameTimestamp;\n\t\tif (intervalLimit.value && delta < intervalLimit.value) {\n\t\t\trafId = window.requestAnimationFrame(loop);\n\t\t\treturn;\n\t\t}\n\t\tpreviousFrameTimestamp = timestamp;\n\t\tfn({\n\t\t\tdelta,\n\t\t\ttimestamp\n\t\t});\n\t\tif (once) {\n\t\t\tisActive.value = false;\n\t\t\trafId = null;\n\t\t\treturn;\n\t\t}\n\t\trafId = window.requestAnimationFrame(loop);\n\t}\n\tfunction resume() {\n\t\tif (!isActive.value && window) {\n\t\t\tisActive.value = true;\n\t\t\tpreviousFrameTimestamp = 0;\n\t\t\trafId = window.requestAnimationFrame(loop);\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t\tif (rafId != null && window) {\n\t\t\twindow.cancelAnimationFrame(rafId);\n\t\t\trafId = null;\n\t\t}\n\t}\n\tif (immediate) resume();\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive: shallowReadonly(isActive),\n\t\tpause,\n\t\tresume\n\t};\n}\n// useAnimate/index.ts\n/**\n* Reactive Web Animations API\n*\n* @see https://vueuse.org/useAnimate\n* @param target\n* @param keyframes\n* @param options\n*/\nfunction useAnimate(target, keyframes, options) {\n\tlet config;\n\tlet animateOptions;\n\tif (isObject(options)) {\n\t\tconfig = options;\n\t\tanimateOptions = objectOmit(options, [\n\t\t\t\"window\",\n\t\t\t\"immediate\",\n\t\t\t\"commitStyles\",\n\t\t\t\"persist\",\n\t\t\t\"onReady\",\n\t\t\t\"onError\"\n\t\t]);\n\t} else {\n\t\tconfig = { duration: options };\n\t\tanimateOptions = options;\n\t}\n\tconst { window = defaultWindow, immediate = true, commitStyles, persist, playbackRate: _playbackRate = 1, onReady, onError = (e) => {\n\t\tconsole.error(e);\n\t} } = config;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && HTMLElement && \"animate\" in HTMLElement.prototype);\n\tconst animate = shallowRef(void 0);\n\tconst store = shallowReactive({\n\t\tstartTime: null,\n\t\tcurrentTime: null,\n\t\ttimeline: null,\n\t\tplaybackRate: _playbackRate,\n\t\tpending: false,\n\t\tplayState: immediate ? \"idle\" : \"paused\",\n\t\treplaceState: \"active\"\n\t});\n\tconst pending = computed(() => store.pending);\n\tconst playState = computed(() => store.playState);\n\tconst replaceState = computed(() => store.replaceState);\n\tconst startTime = computed({\n\t\tget() {\n\t\t\treturn store.startTime;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.startTime = value;\n\t\t\tif (animate.value) animate.value.startTime = value;\n\t\t}\n\t});\n\tconst currentTime = computed({\n\t\tget() {\n\t\t\treturn store.currentTime;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.currentTime = value;\n\t\t\tif (animate.value) {\n\t\t\t\tanimate.value.currentTime = value;\n\t\t\t\tsyncResume();\n\t\t\t}\n\t\t}\n\t});\n\tconst timeline = computed({\n\t\tget() {\n\t\t\treturn store.timeline;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.timeline = value;\n\t\t\tif (animate.value) animate.value.timeline = value;\n\t\t}\n\t});\n\tconst playbackRate = computed({\n\t\tget() {\n\t\t\treturn store.playbackRate;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.playbackRate = value;\n\t\t\tif (animate.value) animate.value.playbackRate = value;\n\t\t}\n\t});\n\tconst play = () => {\n\t\tif (animate.value) try {\n\t\t\tanimate.value.play();\n\t\t\tsyncResume();\n\t\t} catch (e) {\n\t\t\tsyncPause();\n\t\t\tonError(e);\n\t\t}\n\t\telse update();\n\t};\n\tconst pause = () => {\n\t\ttry {\n\t\t\tvar _animate$value;\n\t\t\t(_animate$value = animate.value) === null || _animate$value === void 0 || _animate$value.pause();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst reverse = () => {\n\t\tif (!animate.value) update();\n\t\ttry {\n\t\t\tvar _animate$value2;\n\t\t\t(_animate$value2 = animate.value) === null || _animate$value2 === void 0 || _animate$value2.reverse();\n\t\t\tsyncResume();\n\t\t} catch (e) {\n\t\t\tsyncPause();\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst finish = () => {\n\t\ttry {\n\t\t\tvar _animate$value3;\n\t\t\t(_animate$value3 = animate.value) === null || _animate$value3 === void 0 || _animate$value3.finish();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst cancel = () => {\n\t\ttry {\n\t\t\tvar _animate$value4;\n\t\t\t(_animate$value4 = animate.value) === null || _animate$value4 === void 0 || _animate$value4.cancel();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\twatch(() => unrefElement(target), (el) => {\n\t\tif (el) update(true);\n\t\telse animate.value = void 0;\n\t});\n\twatch(() => keyframes, (value) => {\n\t\tif (animate.value) {\n\t\t\tupdate();\n\t\t\tconst targetEl = unrefElement(target);\n\t\t\tif (targetEl) animate.value.effect = new KeyframeEffect(targetEl, toValue(value), animateOptions);\n\t\t}\n\t}, { deep: true });\n\ttryOnMounted(() => update(true), false);\n\ttryOnScopeDispose(cancel);\n\tfunction update(init) {\n\t\tconst el = unrefElement(target);\n\t\tif (!isSupported.value || !el) return;\n\t\tif (!animate.value) animate.value = el.animate(toValue(keyframes), animateOptions);\n\t\tif (persist) animate.value.persist();\n\t\tif (_playbackRate !== 1) animate.value.playbackRate = _playbackRate;\n\t\tif (init && !immediate) animate.value.pause();\n\t\telse syncResume();\n\t\tonReady === null || onReady === void 0 || onReady(animate.value);\n\t}\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(animate, [\n\t\t\"cancel\",\n\t\t\"finish\",\n\t\t\"remove\"\n\t], syncPause, listenerOptions);\n\tuseEventListener(animate, \"finish\", () => {\n\t\tvar _animate$value5;\n\t\tif (commitStyles) (_animate$value5 = animate.value) === null || _animate$value5 === void 0 || _animate$value5.commitStyles();\n\t}, listenerOptions);\n\tconst { resume: resumeRef, pause: pauseRef } = useRafFn(() => {\n\t\tif (!animate.value) return;\n\t\tstore.pending = animate.value.pending;\n\t\tstore.playState = animate.value.playState;\n\t\tstore.replaceState = animate.value.replaceState;\n\t\tstore.startTime = animate.value.startTime;\n\t\tstore.currentTime = animate.value.currentTime;\n\t\tstore.timeline = animate.value.timeline;\n\t\tstore.playbackRate = animate.value.playbackRate;\n\t}, { immediate: false });\n\tfunction syncResume() {\n\t\tif (isSupported.value) resumeRef();\n\t}\n\tfunction syncPause() {\n\t\tif (isSupported.value && window) window.requestAnimationFrame(pauseRef);\n\t}\n\treturn {\n\t\tisSupported,\n\t\tanimate,\n\t\tplay,\n\t\tpause,\n\t\treverse,\n\t\tfinish,\n\t\tcancel,\n\t\tpending,\n\t\tplayState,\n\t\treplaceState,\n\t\tstartTime,\n\t\tcurrentTime,\n\t\ttimeline,\n\t\tplaybackRate\n\t};\n}\n// useAsyncQueue/index.ts\n/**\n* Asynchronous queue task controller.\n*\n* @see https://vueuse.org/useAsyncQueue\n* @param tasks\n* @param options\n*/\nfunction useAsyncQueue(tasks, options) {\n\tconst { interrupt = true, onError = noop, onFinished = noop, signal } = options || {};\n\tconst promiseState = {\n\t\taborted: \"aborted\",\n\t\tfulfilled: \"fulfilled\",\n\t\tpending: \"pending\",\n\t\trejected: \"rejected\"\n\t};\n\tconst initialResult = Array.from(Array.from({ length: tasks.length }), () => ({\n\t\tstate: promiseState.pending,\n\t\tdata: null\n\t}));\n\tconst result = reactive(initialResult);\n\tconst activeIndex = shallowRef(-1);\n\tif (!tasks || tasks.length === 0) {\n\t\tonFinished();\n\t\treturn {\n\t\t\tactiveIndex,\n\t\t\tresult\n\t\t};\n\t}\n\tfunction updateResult(state, res) {\n\t\tactiveIndex.value++;\n\t\tresult[activeIndex.value].data = res;\n\t\tresult[activeIndex.value].state = state;\n\t}\n\ttasks.reduce((prev, curr) => {\n\t\treturn prev.then((prevRes) => {\n\t\t\tvar _result$activeIndex$v;\n\t\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n\t\t\t\tupdateResult(promiseState.aborted, /* @__PURE__ */ new Error(\"aborted\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (((_result$activeIndex$v = result[activeIndex.value]) === null || _result$activeIndex$v === void 0 ? void 0 : _result$activeIndex$v.state) === promiseState.rejected && interrupt) {\n\t\t\t\tonFinished();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst done = curr(prevRes).then((currentRes) => {\n\t\t\t\tupdateResult(promiseState.fulfilled, currentRes);\n\t\t\t\tif (activeIndex.value === tasks.length - 1) onFinished();\n\t\t\t\treturn currentRes;\n\t\t\t});\n\t\t\tif (!signal) return done;\n\t\t\treturn Promise.race([done, whenAborted(signal)]);\n\t\t}).catch((e) => {\n\t\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n\t\t\t\tupdateResult(promiseState.aborted, e);\n\t\t\t\treturn e;\n\t\t\t}\n\t\t\tupdateResult(promiseState.rejected, e);\n\t\t\tonError();\n\t\t\tif (activeIndex.value === tasks.length - 1) onFinished();\n\t\t\treturn e;\n\t\t});\n\t}, Promise.resolve());\n\treturn {\n\t\tactiveIndex,\n\t\tresult\n\t};\n}\nfunction whenAborted(signal) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst error = /* @__PURE__ */ new Error(\"aborted\");\n\t\tif (signal.aborted) reject(error);\n\t\telse signal.addEventListener(\"abort\", () => reject(error), { once: true });\n\t});\n}\n// useAsyncState/index.ts\n/**\n* Reactive async state. Will not block your setup function and will trigger changes once\n* the promise is ready.\n*\n* @see https://vueuse.org/useAsyncState\n* @param promise The promise / async function to be resolved\n* @param initialState The initial state, used until the first evaluation finishes\n* @param options\n*/\nfunction useAsyncState(promise, initialState, options) {\n\tvar _globalThis$reportErr;\n\tconst { immediate = true, delay = 0, onError = (_globalThis$reportErr = globalThis.reportError) !== null && _globalThis$reportErr !== void 0 ? _globalThis$reportErr : noop, onSuccess = noop, resetOnExecute = true, shallow = true, throwError } = options !== null && options !== void 0 ? options : {};\n\tconst state = shallow ? shallowRef(initialState) : ref(initialState);\n\tconst isReady = shallowRef(false);\n\tconst isLoading = shallowRef(false);\n\tconst error = shallowRef(void 0);\n\tlet executionsCount = 0;\n\tasync function execute(delay = 0, ...args) {\n\t\tconst executionId = executionsCount += 1;\n\t\tif (resetOnExecute) state.value = toValue(initialState);\n\t\terror.value = void 0;\n\t\tisReady.value = false;\n\t\tisLoading.value = true;\n\t\tif (delay > 0) await promiseTimeout(delay);\n\t\tconst _promise = typeof promise === \"function\" ? promise(...args) : promise;\n\t\ttry {\n\t\t\tconst data = await _promise;\n\t\t\tif (executionId === executionsCount) {\n\t\t\t\tstate.value = data;\n\t\t\t\tisReady.value = true;\n\t\t\t}\n\t\t\tonSuccess(data);\n\t\t\treturn data;\n\t\t} catch (e) {\n\t\t\tif (executionId === executionsCount) error.value = e;\n\t\t\tonError(e);\n\t\t\tif (throwError) throw e;\n\t\t} finally {\n\t\t\tif (executionId === executionsCount) isLoading.value = false;\n\t\t}\n\t}\n\tif (immediate) execute(delay);\n\tconst shell = {\n\t\tstate,\n\t\tisReady,\n\t\tisLoading,\n\t\terror,\n\t\texecute,\n\t\texecuteImmediate: (...args) => execute(0, ...args)\n\t};\n\tfunction waitUntilIsLoaded() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuntil(isLoading).toBe(false).then(() => resolve(shell)).catch(reject);\n\t\t});\n\t}\n\treturn {\n\t\t...shell,\n\t\tthen(onFulfilled, onRejected) {\n\t\t\treturn waitUntilIsLoaded().then(onFulfilled, onRejected);\n\t\t}\n\t};\n}\n// useBase64/serialization.ts\nconst defaults = {\n\tarray: (v) => JSON.stringify(v),\n\tobject: (v) => JSON.stringify(v),\n\tset: (v) => JSON.stringify(Array.from(v)),\n\tmap: (v) => JSON.stringify(Object.fromEntries(v)),\n\tnull: () => \"\"\n};\nfunction getDefaultSerialization(target) {\n\tif (!target) return defaults.null;\n\tif (target instanceof Map) return defaults.map;\n\telse if (target instanceof Set) return defaults.set;\n\telse if (Array.isArray(target)) return defaults.array;\n\telse return defaults.object;\n}\n// useBase64/index.ts\nfunction useBase64(target, options) {\n\tconst base64 = shallowRef(\"\");\n\tconst promise = shallowRef();\n\tfunction execute() {\n\t\tif (!isClient) return;\n\t\tpromise.value = new Promise((resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tconst _target = toValue(target);\n\t\t\t\tif (_target == null) resolve(\"\");\n\t\t\t\telse if (typeof _target === \"string\") resolve(blobToBase64(new Blob([_target], { type: \"text/plain\" })));\n\t\t\t\telse if (_target instanceof Blob) resolve(blobToBase64(_target));\n\t\t\t\telse if (_target instanceof ArrayBuffer) resolve(window.btoa(String.fromCharCode(...new Uint8Array(_target))));\n\t\t\t\telse if (_target instanceof HTMLCanvasElement) resolve(_target.toDataURL(options === null || options === void 0 ? void 0 : options.type, options === null || options === void 0 ? void 0 : options.quality));\n\t\t\t\telse if (_target instanceof HTMLImageElement) {\n\t\t\t\t\tconst img = _target.cloneNode(false);\n\t\t\t\t\timg.crossOrigin = \"Anonymous\";\n\t\t\t\t\timgLoaded(img).then(() => {\n\t\t\t\t\t\tconst canvas = document.createElement(\"canvas\");\n\t\t\t\t\t\tconst ctx = canvas.getContext(\"2d\");\n\t\t\t\t\t\tcanvas.width = img.width;\n\t\t\t\t\t\tcanvas.height = img.height;\n\t\t\t\t\t\tctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n\t\t\t\t\t\tresolve(canvas.toDataURL(options === null || options === void 0 ? void 0 : options.type, options === null || options === void 0 ? void 0 : options.quality));\n\t\t\t\t\t}).catch(reject);\n\t\t\t\t} else if (typeof _target === \"object\") {\n\t\t\t\t\tconst serialized = ((options === null || options === void 0 ? void 0 : options.serializer) || getDefaultSerialization(_target))(_target);\n\t\t\t\t\treturn resolve(blobToBase64(new Blob([serialized], { type: \"application/json\" })));\n\t\t\t\t} else reject(/* @__PURE__ */ new Error(\"target is unsupported types\"));\n\t\t\t} catch (error) {\n\t\t\t\treject(error);\n\t\t\t}\n\t\t});\n\t\tpromise.value.then((res) => {\n\t\t\tbase64.value = (options === null || options === void 0 ? void 0 : options.dataUrl) === false ? res.replace(/^data:.*?;base64,/, \"\") : res;\n\t\t});\n\t\treturn promise.value;\n\t}\n\tif (isRef(target) || typeof target === \"function\") watch(target, execute, { immediate: true });\n\telse execute();\n\treturn {\n\t\tbase64,\n\t\tpromise,\n\t\texecute\n\t};\n}\nfunction imgLoaded(img) {\n\treturn new Promise((resolve, reject) => {\n\t\tif (!img.complete) {\n\t\t\timg.onload = () => {\n\t\t\t\tresolve();\n\t\t\t};\n\t\t\timg.onerror = reject;\n\t\t} else resolve();\n\t});\n}\nfunction blobToBase64(blob) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst fr = new FileReader();\n\t\tfr.onload = (e) => {\n\t\t\tresolve(e.target.result);\n\t\t};\n\t\tfr.onerror = reject;\n\t\tfr.readAsDataURL(blob);\n\t});\n}\n// useBattery/index.ts\n/**\n* Reactive Battery Status API.\n*\n* @see https://vueuse.org/useBattery\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBattery(options = {}) {\n\tconst { navigator = defaultNavigator } = options;\n\tconst events = [\n\t\t\"chargingchange\",\n\t\t\"chargingtimechange\",\n\t\t\"dischargingtimechange\",\n\t\t\"levelchange\"\n\t];\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"getBattery\" in navigator && typeof navigator.getBattery === \"function\");\n\tconst charging = shallowRef(false);\n\tconst chargingTime = shallowRef(0);\n\tconst dischargingTime = shallowRef(0);\n\tconst level = shallowRef(1);\n\tlet battery;\n\tfunction updateBatteryInfo() {\n\t\tcharging.value = this.charging;\n\t\tchargingTime.value = this.chargingTime || 0;\n\t\tdischargingTime.value = this.dischargingTime || 0;\n\t\tlevel.value = this.level;\n\t}\n\tif (isSupported.value) navigator.getBattery().then((_battery) => {\n\t\tbattery = _battery;\n\t\tupdateBatteryInfo.call(battery);\n\t\tuseEventListener(battery, events, updateBatteryInfo, { passive: true });\n\t});\n\treturn {\n\t\tisSupported,\n\t\tcharging: shallowReadonly(charging),\n\t\tchargingTime: shallowReadonly(chargingTime),\n\t\tdischargingTime: shallowReadonly(dischargingTime),\n\t\tlevel: shallowReadonly(level)\n\t};\n}\n// useBluetooth/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useBluetooth(options) {\n\tlet { acceptAllDevices = false } = options || {};\n\tconst { filters = void 0, optionalServices = void 0, navigator = defaultNavigator } = options || {};\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"bluetooth\" in navigator);\n\tconst device = shallowRef();\n\tconst error = shallowRef(null);\n\twatch(device, () => {\n\t\tconnectToBluetoothGATTServer();\n\t});\n\tasync function requestDevice() {\n\t\tif (!isSupported.value) return;\n\t\terror.value = null;\n\t\tif (filters && filters.length > 0) acceptAllDevices = false;\n\t\ttry {\n\t\t\tdevice.value = await (navigator === null || navigator === void 0 ? void 0 : navigator.bluetooth.requestDevice({\n\t\t\t\tacceptAllDevices,\n\t\t\t\tfilters,\n\t\t\t\toptionalServices\n\t\t\t}));\n\t\t} catch (err) {\n\t\t\terror.value = err;\n\t\t}\n\t}\n\tconst server = shallowRef();\n\tconst isConnected = shallowRef(false);\n\tfunction reset() {\n\t\tisConnected.value = false;\n\t\tdevice.value = void 0;\n\t\tserver.value = void 0;\n\t}\n\tasync function connectToBluetoothGATTServer() {\n\t\terror.value = null;\n\t\tif (device.value && device.value.gatt) try {\n\t\t\tserver.value = await device.value.gatt.connect();\n\t\t\tisConnected.value = server.value.connected;\n\t\t} catch (err) {\n\t\t\terror.value = err;\n\t\t}\n\t}\n\ttryOnMounted(() => {\n\t\tuseEventListener(device, \"gattserverdisconnected\", reset, {\n\t\t\tpassive: true,\n\t\t\tonce: true\n\t\t});\n\t\tconnectToBluetoothGATTServer();\n\t});\n\ttryOnScopeDispose(() => {\n\t\tvar _device$value$gatt;\n\t\tif (device.value) (_device$value$gatt = device.value.gatt) === null || _device$value$gatt === void 0 || _device$value$gatt.disconnect();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisConnected: shallowReadonly(isConnected),\n\t\tdevice,\n\t\trequestDevice,\n\t\tserver,\n\t\terror\n\t};\n}\n// useSSRWidth/index.ts\nconst ssrWidthSymbol = Symbol(\"vueuse-ssr-width\");\n/* @__NO_SIDE_EFFECTS__ */\nfunction useSSRWidth() {\n\tconst ssrWidth = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;\n\treturn typeof ssrWidth === \"number\" ? ssrWidth : void 0;\n}\nfunction provideSSRWidth(width, app) {\n\tif (app !== void 0) app.provide(ssrWidthSymbol, width);\n\telse provideLocal(ssrWidthSymbol, width);\n}\n// useMediaQuery/index.ts\n/**\n* Reactive Media Query.\n*\n* @see https://vueuse.org/useMediaQuery\n* @param query\n* @param options\n*/\nfunction useMediaQuery(query, options = {}) {\n\tconst { window = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"matchMedia\" in window && typeof window.matchMedia === \"function\");\n\tconst ssrSupport = shallowRef(typeof ssrWidth === \"number\");\n\tconst mediaQuery = shallowRef();\n\tconst matches = shallowRef(false);\n\tconst handler = (event) => {\n\t\tmatches.value = event.matches;\n\t};\n\twatchEffect(() => {\n\t\tif (ssrSupport.value) {\n\t\t\tssrSupport.value = !isSupported.value;\n\t\t\tconst queryStrings = toValue(query).split(\",\");\n\t\t\tmatches.value = queryStrings.some((queryString) => {\n\t\t\t\tconst not = queryString.includes(\"not all\");\n\t\t\t\tconst minWidth = queryString.match(/\\(\\s*min-width:\\s*(-?\\d+(?:\\.\\d*)?[a-z]+\\s*)\\)/);\n\t\t\t\tconst maxWidth = queryString.match(/\\(\\s*max-width:\\s*(-?\\d+(?:\\.\\d*)?[a-z]+\\s*)\\)/);\n\t\t\t\tlet res = Boolean(minWidth || maxWidth);\n\t\t\t\tif (minWidth && res) res = ssrWidth >= pxValue(minWidth[1]);\n\t\t\t\tif (maxWidth && res) res = ssrWidth <= pxValue(maxWidth[1]);\n\t\t\t\treturn not ? !res : res;\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (!isSupported.value) return;\n\t\tmediaQuery.value = window.matchMedia(toValue(query));\n\t\tmatches.value = mediaQuery.value.matches;\n\t});\n\tuseEventListener(mediaQuery, \"change\", handler, { passive: true });\n\treturn computed(() => matches.value);\n}\n// useBreakpoints/breakpoints.ts\n/**\n* Breakpoints from Tailwind V2\n*\n* @see https://tailwindcss.com/docs/breakpoints\n*/\nconst breakpointsTailwind = {\n\t\"sm\": 640,\n\t\"md\": 768,\n\t\"lg\": 1024,\n\t\"xl\": 1280,\n\t\"2xl\": 1536\n};\n/**\n* Breakpoints from Bootstrap V5\n*\n* @see https://getbootstrap.com/docs/5.0/layout/breakpoints\n*/\nconst breakpointsBootstrapV5 = {\n\txs: 0,\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200,\n\txxl: 1400\n};\n/**\n* Breakpoints from Vuetify V2\n*\n* @see https://v2.vuetifyjs.com/en/features/breakpoints/\n*/\nconst breakpointsVuetifyV2 = {\n\txs: 0,\n\tsm: 600,\n\tmd: 960,\n\tlg: 1264,\n\txl: 1904\n};\n/**\n* Breakpoints from Vuetify V3\n*\n* @see https://vuetifyjs.com/en/styles/float/#overview\n*/\nconst breakpointsVuetifyV3 = {\n\txs: 0,\n\tsm: 600,\n\tmd: 960,\n\tlg: 1280,\n\txl: 1920,\n\txxl: 2560\n};\n/**\n* Alias to `breakpointsVuetifyV2`\n*\n* @deprecated explictly use `breakpointsVuetifyV2` or `breakpointsVuetifyV3` instead\n*/\nconst breakpointsVuetify = breakpointsVuetifyV2;\n/**\n* Breakpoints from Ant Design\n*\n* @see https://ant.design/components/layout/#breakpoint-width\n*/\nconst breakpointsAntDesign = {\n\txs: 480,\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200,\n\txxl: 1600\n};\n/**\n* Breakpoints from Quasar V2\n*\n* @see https://quasar.dev/style/breakpoints\n*/\nconst breakpointsQuasar = {\n\txs: 0,\n\tsm: 600,\n\tmd: 1024,\n\tlg: 1440,\n\txl: 1920\n};\n/**\n* Sematic Breakpoints\n*/\nconst breakpointsSematic = {\n\tmobileS: 320,\n\tmobileM: 375,\n\tmobileL: 425,\n\ttablet: 768,\n\tlaptop: 1024,\n\tlaptopL: 1440,\n\tdesktop4K: 2560\n};\n/**\n* Breakpoints from Master CSS\n*\n* @see https://docs.master.co/css/breakpoints\n*/\nconst breakpointsMasterCss = {\n\t\"3xs\": 360,\n\t\"2xs\": 480,\n\t\"xs\": 600,\n\t\"sm\": 768,\n\t\"md\": 1024,\n\t\"lg\": 1280,\n\t\"xl\": 1440,\n\t\"2xl\": 1600,\n\t\"3xl\": 1920,\n\t\"4xl\": 2560\n};\n/**\n* Breakpoints from PrimeFlex\n*\n* @see https://primeflex.org/installation\n*/\nconst breakpointsPrimeFlex = {\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200\n};\n/**\n* Breakpoints from ElementUI/ElementPlus\n*\n* @see https://element.eleme.io/#/en-US/component/layout\n* @see https://element-plus.org/en-US/component/layout.html\n*/\nconst breakpointsElement = {\n\txs: 0,\n\tsm: 768,\n\tmd: 992,\n\tlg: 1200,\n\txl: 1920\n};\n// useBreakpoints/index.ts\n/**\n* Reactively viewport breakpoints\n*\n* @see https://vueuse.org/useBreakpoints\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBreakpoints(breakpoints, options = {}) {\n\tfunction getValue(k, delta) {\n\t\tlet v = toValue(breakpoints[toValue(k)]);\n\t\tif (delta != null) v = increaseWithUnit(v, delta);\n\t\tif (typeof v === \"number\") v = `${v}px`;\n\t\treturn v;\n\t}\n\tconst { window = defaultWindow, strategy = \"min-width\", ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;\n\tconst ssrSupport = typeof ssrWidth === \"number\";\n\tconst mounted = ssrSupport ? shallowRef(false) : { value: true };\n\tif (ssrSupport) tryOnMounted(() => mounted.value = !!window);\n\tfunction match(query, size) {\n\t\tif (!mounted.value && ssrSupport) return query === \"min\" ? ssrWidth >= pxValue(size) : ssrWidth <= pxValue(size);\n\t\tif (!window) return false;\n\t\treturn window.matchMedia(`(${query}-width: ${size})`).matches;\n\t}\n\tconst greaterOrEqual = (k) => {\n\t\treturn useMediaQuery(() => `(min-width: ${getValue(k)})`, options);\n\t};\n\tconst smallerOrEqual = (k) => {\n\t\treturn useMediaQuery(() => `(max-width: ${getValue(k)})`, options);\n\t};\n\tconst shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {\n\t\tObject.defineProperty(shortcuts, k, {\n\t\t\tget: () => strategy === \"min-width\" ? greaterOrEqual(k) : smallerOrEqual(k),\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true\n\t\t});\n\t\treturn shortcuts;\n\t}, {});\n\tfunction current() {\n\t\tconst points = Object.keys(breakpoints).map((k) => [\n\t\t\tk,\n\t\t\tshortcutMethods[k],\n\t\t\tpxValue(getValue(k))\n\t\t]).sort((a, b) => a[2] - b[2]);\n\t\treturn computed(() => points.filter(([, v]) => v.value).map(([k]) => k));\n\t}\n\treturn Object.assign(shortcutMethods, {\n\t\tgreaterOrEqual,\n\t\tsmallerOrEqual,\n\t\tgreater(k) {\n\t\t\treturn useMediaQuery(() => `(min-width: ${getValue(k, .1)})`, options);\n\t\t},\n\t\tsmaller(k) {\n\t\t\treturn useMediaQuery(() => `(max-width: ${getValue(k, -.1)})`, options);\n\t\t},\n\t\tbetween(a, b) {\n\t\t\treturn useMediaQuery(() => `(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -.1)})`, options);\n\t\t},\n\t\tisGreater(k) {\n\t\t\treturn match(\"min\", getValue(k, .1));\n\t\t},\n\t\tisGreaterOrEqual(k) {\n\t\t\treturn match(\"min\", getValue(k));\n\t\t},\n\t\tisSmaller(k) {\n\t\t\treturn match(\"max\", getValue(k, -.1));\n\t\t},\n\t\tisSmallerOrEqual(k) {\n\t\t\treturn match(\"max\", getValue(k));\n\t\t},\n\t\tisInBetween(a, b) {\n\t\t\treturn match(\"min\", getValue(a)) && match(\"max\", getValue(b, -.1));\n\t\t},\n\t\tcurrent,\n\t\tactive() {\n\t\t\tconst bps = current();\n\t\t\treturn computed(() => bps.value.length === 0 ? \"\" : bps.value.at(strategy === \"min-width\" ? -1 : 0));\n\t\t}\n\t});\n}\n// useBroadcastChannel/index.ts\n/**\n* Reactive BroadcastChannel\n*\n* @see https://vueuse.org/useBroadcastChannel\n* @see https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel\n* @param options\n*\n*/\nfunction useBroadcastChannel(options) {\n\tconst { name, window = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"BroadcastChannel\" in window);\n\tconst isClosed = shallowRef(false);\n\tconst channel = shallowRef();\n\tconst data = shallowRef();\n\tconst error = shallowRef(null);\n\tconst post = (data) => {\n\t\tif (channel.value) channel.value.postMessage(data);\n\t};\n\tconst close = () => {\n\t\tif (channel.value) channel.value.close();\n\t\tisClosed.value = true;\n\t};\n\tif (isSupported.value) tryOnMounted(() => {\n\t\terror.value = null;\n\t\tchannel.value = new BroadcastChannel(name);\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(channel, \"message\", (e) => {\n\t\t\tdata.value = e.data;\n\t\t}, listenerOptions);\n\t\tuseEventListener(channel, \"messageerror\", (e) => {\n\t\t\terror.value = e;\n\t\t}, listenerOptions);\n\t\tuseEventListener(channel, \"close\", () => {\n\t\t\tisClosed.value = true;\n\t\t}, listenerOptions);\n\t});\n\ttryOnScopeDispose(() => {\n\t\tclose();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tchannel,\n\t\tdata,\n\t\tpost,\n\t\tclose,\n\t\terror,\n\t\tisClosed\n\t};\n}\n// useBrowserLocation/index.ts\nconst WRITABLE_PROPERTIES = [\n\t\"hash\",\n\t\"host\",\n\t\"hostname\",\n\t\"href\",\n\t\"pathname\",\n\t\"port\",\n\t\"protocol\",\n\t\"search\"\n];\n/**\n* Reactive browser location.\n*\n* @see https://vueuse.org/useBrowserLocation\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBrowserLocation(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst refs = Object.fromEntries(WRITABLE_PROPERTIES.map((key) => [key, ref()]));\n\tconst buildState = (trigger) => {\n\t\tvar _window$location;\n\t\tconst { state, length } = (window === null || window === void 0 ? void 0 : window.history) || {};\n\t\tconst { origin } = (window === null || window === void 0 ? void 0 : window.location) || {};\n\t\tfor (const key of WRITABLE_PROPERTIES) refs[key].value = window === null || window === void 0 || (_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location[key];\n\t\treturn reactive({\n\t\t\ttrigger,\n\t\t\tstate,\n\t\t\tlength,\n\t\t\torigin,\n\t\t\t...refs\n\t\t});\n\t};\n\tconst state = ref(buildState(\"load\"));\n\tfor (const [key, ref] of objectEntries(refs)) watch(ref, (value) => {\n\t\tif (!(window === null || window === void 0 ? void 0 : window.location) || window.location[key] === value) return;\n\t\twindow.location[key] = value;\n\t});\n\tif (window) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(window, \"popstate\", () => state.value = buildState(\"popstate\"), listenerOptions);\n\t\tuseEventListener(window, \"hashchange\", () => state.value = buildState(\"hashchange\"), listenerOptions);\n\t}\n\treturn state;\n}\n// useCached/index.ts\nfunction useCached(refValue, comparator = (newSourceValue, cachedValue) => newSourceValue === cachedValue, options) {\n\tconst { deepRefs = true, ...watchOptions } = options || {};\n\tconst cachedValue = createRef(refValue.value, deepRefs);\n\twatch(() => refValue.value, (value) => {\n\t\tif (!comparator(value, cachedValue.value)) cachedValue.value = value;\n\t}, watchOptions);\n\treturn cachedValue;\n}\n// usePermission/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction usePermission(permissionDesc, options = {}) {\n\tconst { controls = false, navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"permissions\" in navigator);\n\tconst permissionStatus = shallowRef();\n\tconst desc = typeof permissionDesc === \"string\" ? { name: permissionDesc } : permissionDesc;\n\tconst state = shallowRef();\n\tconst update = () => {\n\t\tvar _permissionStatus$val, _permissionStatus$val2;\n\t\tstate.value = (_permissionStatus$val = (_permissionStatus$val2 = permissionStatus.value) === null || _permissionStatus$val2 === void 0 ? void 0 : _permissionStatus$val2.state) !== null && _permissionStatus$val !== void 0 ? _permissionStatus$val : \"prompt\";\n\t};\n\tuseEventListener(permissionStatus, \"change\", update, { passive: true });\n\tconst query = createSingletonPromise(async () => {\n\t\tif (!isSupported.value) return;\n\t\tif (!permissionStatus.value) try {\n\t\t\tpermissionStatus.value = await navigator.permissions.query(desc);\n\t\t} catch (_unused) {\n\t\t\tpermissionStatus.value = void 0;\n\t\t} finally {\n\t\t\tupdate();\n\t\t}\n\t\tif (controls) return toRaw(permissionStatus.value);\n\t});\n\tquery();\n\tif (controls) return {\n\t\tstate,\n\t\tisSupported,\n\t\tquery\n\t};\n\telse return state;\n}\n// useClipboard/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useClipboard(options = {}) {\n\tconst { navigator = defaultNavigator, read = false, source, copiedDuring = 1500, legacy = false } = options;\n\tconst isClipboardApiSupported = /* @__PURE__ */ useSupported(() => navigator && \"clipboard\" in navigator);\n\tconst permissionRead = /* @__PURE__ */ usePermission(\"clipboard-read\");\n\tconst permissionWrite = /* @__PURE__ */ usePermission(\"clipboard-write\");\n\tconst isSupported = computed(() => isClipboardApiSupported.value || legacy);\n\tconst text = shallowRef(\"\");\n\tconst copied = shallowRef(false);\n\tconst copyPending = shallowRef(false);\n\tconst timeout = useTimeoutFn(() => copied.value = false, copiedDuring, { immediate: false });\n\tlet lastLegacyId = 0;\n\tasync function updateText() {\n\t\tlet useLegacy = !(isClipboardApiSupported.value && isAllowed(permissionRead.value));\n\t\tif (!useLegacy) try {\n\t\t\ttext.value = await navigator.clipboard.readText();\n\t\t} catch (_unused) {\n\t\t\tuseLegacy = true;\n\t\t}\n\t\tif (useLegacy) text.value = legacyRead();\n\t}\n\tif (isSupported.value && read) useEventListener([\"copy\", \"cut\"], updateText, { passive: true });\n\tasync function copy(value) {\n\t\tconst resolvedValue = value !== null && value !== void 0 ? value : toValue(source);\n\t\tif (isSupported.value && resolvedValue != null) {\n\t\t\tcopyPending.value = true;\n\t\t\tlet useLegacy = !(isClipboardApiSupported.value && isAllowed(permissionWrite.value));\n\t\t\tif (!useLegacy) try {\n\t\t\t\tconst clipboardItem = createClipboardItem(resolvedValue);\n\t\t\t\tawait navigator.clipboard.write([clipboardItem]);\n\t\t\t} catch (_unused2) {\n\t\t\t\tuseLegacy = true;\n\t\t\t}\n\t\t\tif (useLegacy) {\n\t\t\t\tif (typeof resolvedValue === \"string\") {\n\t\t\t\t\ttext.value = resolvedValue;\n\t\t\t\t\tlegacyCopy(resolvedValue);\n\t\t\t\t} else {\n\t\t\t\t\tconst currentId = ++lastLegacyId;\n\t\t\t\t\tconst resolvedText = await resolvedValue();\n\t\t\t\t\tif (resolvedText != null && currentId === lastLegacyId) {\n\t\t\t\t\t\ttext.value = resolvedText;\n\t\t\t\t\t\tlegacyCopy(resolvedText);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcopied.value = true;\n\t\t\ttimeout.start();\n\t\t\tcopyPending.value = false;\n\t\t}\n\t}\n\tfunction createClipboardItem(value) {\n\t\tif (typeof value === \"string\") {\n\t\t\ttext.value = value;\n\t\t\treturn new ClipboardItem({ \"text/plain\": value });\n\t\t} else return new ClipboardItem({ \"text/plain\": value().then((resolvedText = \"\") => {\n\t\t\ttext.value = resolvedText;\n\t\t\treturn new Blob([resolvedText], { type: \"text/plain\" });\n\t\t}) });\n\t}\n\tfunction legacyCopy(value) {\n\t\tconst ta = document.createElement(\"textarea\");\n\t\tta.value = value;\n\t\tta.style.position = \"absolute\";\n\t\tta.style.opacity = \"0\";\n\t\tta.setAttribute(\"readonly\", \"\");\n\t\tdocument.body.appendChild(ta);\n\t\tta.select();\n\t\tdocument.execCommand(\"copy\");\n\t\tta.remove();\n\t}\n\tfunction legacyRead() {\n\t\tvar _document$getSelectio, _document, _document$getSelectio2;\n\t\treturn (_document$getSelectio = (_document = document) === null || _document === void 0 || (_document$getSelectio2 = _document.getSelection) === null || _document$getSelectio2 === void 0 || (_document$getSelectio2 = _document$getSelectio2.call(_document)) === null || _document$getSelectio2 === void 0 ? void 0 : _document$getSelectio2.toString()) !== null && _document$getSelectio !== void 0 ? _document$getSelectio : \"\";\n\t}\n\tfunction isAllowed(status) {\n\t\treturn status === \"granted\" || status === \"prompt\";\n\t}\n\treturn {\n\t\tcopyPending: shallowReadonly(copyPending),\n\t\tisSupported,\n\t\ttext: shallowReadonly(text),\n\t\tcopied: shallowReadonly(copied),\n\t\tcopy\n\t};\n}\n// useClipboardItems/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useClipboardItems(options = {}) {\n\tconst { navigator = defaultNavigator, read = false, source, copiedDuring = 1500 } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"clipboard\" in navigator);\n\tconst content = shallowRef([]);\n\tconst copied = shallowRef(false);\n\tconst timeout = useTimeoutFn(() => copied.value = false, copiedDuring, { immediate: false });\n\tfunction updateContent() {\n\t\tif (isSupported.value) navigator.clipboard.read().then((items) => {\n\t\t\tcontent.value = items;\n\t\t});\n\t}\n\tif (isSupported.value && read) useEventListener([\"copy\", \"cut\"], updateContent, { passive: true });\n\tasync function copy(value = toValue(source)) {\n\t\tif (isSupported.value && value != null) {\n\t\t\tawait navigator.clipboard.write(value);\n\t\t\tcontent.value = value;\n\t\t\tcopied.value = true;\n\t\t\ttimeout.start();\n\t\t}\n\t}\n\treturn {\n\t\tisSupported,\n\t\tcontent: shallowReadonly(content),\n\t\tcopied: shallowReadonly(copied),\n\t\tcopy,\n\t\tread: updateContent\n\t};\n}\n// useCloned/index.ts\nfunction cloneFnJSON(source) {\n\treturn JSON.parse(JSON.stringify(source));\n}\nfunction useCloned(source, options = {}) {\n\tconst cloned = ref({});\n\tconst isModified = shallowRef(false);\n\tlet _lastSync = false;\n\tconst { manual, clone = cloneFnJSON, deep = true, immediate = true } = options;\n\twatch(cloned, () => {\n\t\tif (_lastSync) {\n\t\t\t_lastSync = false;\n\t\t\treturn;\n\t\t}\n\t\tisModified.value = true;\n\t}, {\n\t\tdeep: true,\n\t\tflush: \"sync\"\n\t});\n\tfunction sync() {\n\t\t_lastSync = true;\n\t\tisModified.value = false;\n\t\tcloned.value = clone(toValue(source));\n\t}\n\tif (!manual && (isRef(source) || typeof source === \"function\")) watch(source, sync, {\n\t\t...options,\n\t\tdeep,\n\t\timmediate\n\t});\n\telse sync();\n\treturn {\n\t\tcloned,\n\t\tisModified,\n\t\tsync\n\t};\n}\n// ssr-handlers.ts\nconst _global = typeof globalThis !== \"undefined\" ? globalThis : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : {};\nconst globalKey = \"__vueuse_ssr_handlers__\";\nconst handlers = /* #__PURE__ */ getHandlers();\nfunction getHandlers() {\n\tif (!(globalKey in _global)) _global[globalKey] = _global[globalKey] || {};\n\treturn _global[globalKey];\n}\nfunction getSSRHandler(key, fallback) {\n\treturn handlers[key] || fallback;\n}\nfunction setSSRHandler(key, fn) {\n\thandlers[key] = fn;\n}\n// usePreferredDark/index.ts\n/**\n* Reactive dark theme preference.\n*\n* @see https://vueuse.org/usePreferredDark\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredDark(options) {\n\treturn useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n}\n// useStorage/guess.ts\nfunction guessSerializerType(rawInit) {\n\treturn rawInit == null ? \"any\" : rawInit instanceof Set ? \"set\" : rawInit instanceof Map ? \"map\" : rawInit instanceof Date ? \"date\" : typeof rawInit === \"boolean\" ? \"boolean\" : typeof rawInit === \"string\" ? \"string\" : typeof rawInit === \"object\" ? \"object\" : !Number.isNaN(rawInit) ? \"number\" : \"any\";\n}\n// useStorage/index.ts\nconst StorageSerializers = {\n\tboolean: {\n\t\tread: (v) => v === \"true\",\n\t\twrite: (v) => String(v)\n\t},\n\tobject: {\n\t\tread: (v) => JSON.parse(v),\n\t\twrite: (v) => JSON.stringify(v)\n\t},\n\tnumber: {\n\t\tread: (v) => Number.parseFloat(v),\n\t\twrite: (v) => String(v)\n\t},\n\tany: {\n\t\tread: (v) => v,\n\t\twrite: (v) => String(v)\n\t},\n\tstring: {\n\t\tread: (v) => v,\n\t\twrite: (v) => String(v)\n\t},\n\tmap: {\n\t\tread: (v) => new Map(JSON.parse(v)),\n\t\twrite: (v) => JSON.stringify(Array.from(v.entries()))\n\t},\n\tset: {\n\t\tread: (v) => new Set(JSON.parse(v)),\n\t\twrite: (v) => JSON.stringify(Array.from(v))\n\t},\n\tdate: {\n\t\tread: (v) => new Date(v),\n\t\twrite: (v) => v.toISOString()\n\t}\n};\nconst customStorageEventName = \"vueuse-storage\";\n/**\n* Reactive LocalStorage/SessionStorage.\n*\n* @see https://vueuse.org/useStorage\n*/\nfunction useStorage(key, defaults, storage, options = {}) {\n\tvar _options$serializer;\n\tconst { flush = \"pre\", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window = defaultWindow, eventFilter, onError = (e) => {\n\t\tconsole.error(e);\n\t}, initOnMounted } = options;\n\tconst data = (shallow ? shallowRef : ref)(typeof defaults === \"function\" ? defaults() : defaults);\n\tconst keyComputed = computed(() => toValue(key));\n\tif (!storage) try {\n\t\tstorage = getSSRHandler(\"getDefaultStorage\", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();\n\t} catch (e) {\n\t\tonError(e);\n\t}\n\tif (!storage) return data;\n\tconst rawInit = toValue(defaults);\n\tconst type = guessSerializerType(rawInit);\n\tconst serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];\n\tconst { pause: pauseWatch, resume: resumeWatch } = watchPausable(data, (newValue) => write(newValue), {\n\t\tflush,\n\t\tdeep,\n\t\teventFilter\n\t});\n\twatch(keyComputed, () => update(), { flush });\n\tlet firstMounted = false;\n\tconst onStorageEvent = (ev) => {\n\t\tif (initOnMounted && !firstMounted) return;\n\t\tupdate(ev);\n\t};\n\tconst onStorageCustomEvent = (ev) => {\n\t\tif (initOnMounted && !firstMounted) return;\n\t\tupdateFromCustomEvent(ev);\n\t};\n\t/**\n\t* The custom event is needed for same-document syncing when using custom\n\t* storage backends, but it doesn't work across different documents.\n\t*\n\t* TODO: Consider implementing a BroadcastChannel-based solution that fixes this.\n\t*/\n\tif (window && listenToStorageChanges) {\n\t\tif (storage instanceof Storage) useEventListener(window, \"storage\", onStorageEvent, { passive: true });\n\t\telse useEventListener(window, customStorageEventName, onStorageCustomEvent);\n\t}\n\tif (initOnMounted) tryOnMounted(() => {\n\t\tfirstMounted = true;\n\t\tupdate();\n\t});\n\telse update();\n\tfunction dispatchWriteEvent(oldValue, newValue) {\n\t\tif (window) {\n\t\t\tconst payload = {\n\t\t\t\tkey: keyComputed.value,\n\t\t\t\toldValue,\n\t\t\t\tnewValue,\n\t\t\t\tstorageArea: storage\n\t\t\t};\n\t\t\twindow.dispatchEvent(storage instanceof Storage ? new StorageEvent(\"storage\", payload) : new CustomEvent(customStorageEventName, { detail: payload }));\n\t\t}\n\t}\n\tfunction write(v) {\n\t\ttry {\n\t\t\tconst oldValue = storage.getItem(keyComputed.value);\n\t\t\tif (v == null) {\n\t\t\t\tdispatchWriteEvent(oldValue, null);\n\t\t\t\tstorage.removeItem(keyComputed.value);\n\t\t\t} else {\n\t\t\t\tconst serialized = serializer.write(v);\n\t\t\t\tif (oldValue !== serialized) {\n\t\t\t\t\tstorage.setItem(keyComputed.value, serialized);\n\t\t\t\t\tdispatchWriteEvent(oldValue, serialized);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}\n\tfunction read(event) {\n\t\tconst rawValue = event ? event.newValue : storage.getItem(keyComputed.value);\n\t\tif (rawValue == null) {\n\t\t\tif (writeDefaults && rawInit != null) storage.setItem(keyComputed.value, serializer.write(rawInit));\n\t\t\treturn rawInit;\n\t\t} else if (!event && mergeDefaults) {\n\t\t\tconst value = serializer.read(rawValue);\n\t\t\tif (typeof mergeDefaults === \"function\") return mergeDefaults(value, rawInit);\n\t\t\telse if (type === \"object\" && !Array.isArray(value)) return {\n\t\t\t\t...rawInit,\n\t\t\t\t...value\n\t\t\t};\n\t\t\treturn value;\n\t\t} else if (typeof rawValue !== \"string\") return rawValue;\n\t\telse return serializer.read(rawValue);\n\t}\n\tfunction update(event) {\n\t\tif (event && event.storageArea !== storage) return;\n\t\tif (event && event.key == null) {\n\t\t\tdata.value = rawInit;\n\t\t\treturn;\n\t\t}\n\t\tif (event && event.key !== keyComputed.value) return;\n\t\tpauseWatch();\n\t\ttry {\n\t\t\tconst serializedData = serializer.write(data.value);\n\t\t\tif (event === void 0 || (event === null || event === void 0 ? void 0 : event.newValue) !== serializedData) data.value = read(event);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t} finally {\n\t\t\tif (event) nextTick(resumeWatch);\n\t\t\telse resumeWatch();\n\t\t}\n\t}\n\tfunction updateFromCustomEvent(event) {\n\t\tupdate(event.detail);\n\t}\n\treturn data;\n}\n// useColorMode/index.ts\nconst CSS_DISABLE_TRANS = \"*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\";\n/**\n* Reactive color mode with auto data persistence.\n*\n* @see https://vueuse.org/useColorMode\n* @param options\n*/\nfunction useColorMode(options = {}) {\n\tconst { selector = \"html\", attribute = \"class\", initialValue = \"auto\", window = defaultWindow, storage, storageKey = \"vueuse-color-scheme\", listenToStorageChanges = true, storageRef, emitAuto, disableTransition = true } = options;\n\tconst modes = {\n\t\tauto: \"\",\n\t\tlight: \"light\",\n\t\tdark: \"dark\",\n\t\t...options.modes || {}\n\t};\n\tconst preferredDark = usePreferredDark({ window });\n\tconst system = computed(() => preferredDark.value ? \"dark\" : \"light\");\n\tconst store = storageRef || (storageKey == null ? toRef(initialValue) : useStorage(storageKey, initialValue, storage, {\n\t\twindow,\n\t\tlistenToStorageChanges\n\t}));\n\tconst state = computed(() => store.value === \"auto\" ? system.value : store.value);\n\tconst updateHTMLAttrs = getSSRHandler(\"updateHTMLAttrs\", (selector, attribute, value) => {\n\t\tconst el = typeof selector === \"string\" ? window === null || window === void 0 ? void 0 : window.document.querySelector(selector) : unrefElement(selector);\n\t\tif (!el) return;\n\t\tconst classesToAdd = /* @__PURE__ */ new Set();\n\t\tconst classesToRemove = /* @__PURE__ */ new Set();\n\t\tlet attributeToChange = null;\n\t\tif (attribute === \"class\") {\n\t\t\tconst current = value.split(/\\s/g);\n\t\t\tObject.values(modes).flatMap((i) => (i || \"\").split(/\\s/g)).filter(Boolean).forEach((v) => {\n\t\t\t\tif (current.includes(v)) classesToAdd.add(v);\n\t\t\t\telse classesToRemove.add(v);\n\t\t\t});\n\t\t} else attributeToChange = {\n\t\t\tkey: attribute,\n\t\t\tvalue\n\t\t};\n\t\tif (classesToAdd.size === 0 && classesToRemove.size === 0 && attributeToChange === null) return;\n\t\tlet style;\n\t\tif (disableTransition) {\n\t\t\tstyle = window.document.createElement(\"style\");\n\t\t\tstyle.appendChild(document.createTextNode(CSS_DISABLE_TRANS));\n\t\t\twindow.document.head.appendChild(style);\n\t\t}\n\t\tfor (const c of classesToAdd) el.classList.add(c);\n\t\tfor (const c of classesToRemove) el.classList.remove(c);\n\t\tif (attributeToChange) el.setAttribute(attributeToChange.key, attributeToChange.value);\n\t\tif (disableTransition) {\n\t\t\twindow.getComputedStyle(style).opacity;\n\t\t\tdocument.head.removeChild(style);\n\t\t}\n\t});\n\tfunction defaultOnChanged(mode) {\n\t\tvar _modes$mode;\n\t\tupdateHTMLAttrs(selector, attribute, (_modes$mode = modes[mode]) !== null && _modes$mode !== void 0 ? _modes$mode : mode);\n\t}\n\tfunction onChanged(mode) {\n\t\tif (options.onChanged) options.onChanged(mode, defaultOnChanged);\n\t\telse defaultOnChanged(mode);\n\t}\n\twatch(state, onChanged, {\n\t\tflush: \"post\",\n\t\timmediate: true\n\t});\n\ttryOnMounted(() => onChanged(state.value));\n\tconst auto = computed({\n\t\tget() {\n\t\t\treturn emitAuto ? store.value : state.value;\n\t\t},\n\t\tset(v) {\n\t\t\tstore.value = v;\n\t\t}\n\t});\n\treturn Object.assign(auto, {\n\t\tstore,\n\t\tsystem,\n\t\tstate\n\t});\n}\n// useConfirmDialog/index.ts\n/**\n* Hooks for creating confirm dialogs. Useful for modal windows, popups and logins.\n*\n* @see https://vueuse.org/useConfirmDialog/\n* @param revealed `boolean` `ref` that handles a modal window\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useConfirmDialog(revealed = shallowRef(false)) {\n\tconst confirmHook = createEventHook();\n\tconst cancelHook = createEventHook();\n\tconst revealHook = createEventHook();\n\tlet _resolve = noop;\n\tconst reveal = (data) => {\n\t\trevealHook.trigger(data);\n\t\trevealed.value = true;\n\t\treturn new Promise((resolve) => {\n\t\t\t_resolve = resolve;\n\t\t});\n\t};\n\tconst confirm = (data) => {\n\t\trevealed.value = false;\n\t\tconfirmHook.trigger(data);\n\t\t_resolve({\n\t\t\tdata,\n\t\t\tisCanceled: false\n\t\t});\n\t};\n\tconst cancel = (data) => {\n\t\trevealed.value = false;\n\t\tcancelHook.trigger(data);\n\t\t_resolve({\n\t\t\tdata,\n\t\t\tisCanceled: true\n\t\t});\n\t};\n\treturn {\n\t\tisRevealed: computed(() => revealed.value),\n\t\treveal,\n\t\tconfirm,\n\t\tcancel,\n\t\tonReveal: revealHook.on,\n\t\tonConfirm: confirmHook.on,\n\t\tonCancel: cancelHook.on\n\t};\n}\n// useCountdown/index.ts\n/**\n* Reactive countdown timer in seconds.\n*\n* @param initialCountdown\n* @param options\n*\n* @see https://vueuse.org/useCountdown\n*/\nfunction useCountdown(initialCountdown, options = {}) {\n\tconst remaining = shallowRef(toValue(initialCountdown));\n\tconst { scheduler = (cb) => useIntervalFn(cb, 1e3, { immediate: false }), onTick, onComplete } = options;\n\tconst controls = scheduler(() => {\n\t\tconst value = remaining.value - 1;\n\t\tremaining.value = value < 0 ? 0 : value;\n\t\tonTick === null || onTick === void 0 || onTick(remaining.value);\n\t\tif (remaining.value <= 0) {\n\t\t\tcontrols.pause();\n\t\t\tonComplete === null || onComplete === void 0 || onComplete();\n\t\t}\n\t});\n\tconst reset = (countdown) => {\n\t\tvar _toValue;\n\t\tremaining.value = (_toValue = toValue(countdown)) !== null && _toValue !== void 0 ? _toValue : toValue(initialCountdown);\n\t};\n\tconst stop = () => {\n\t\tcontrols.pause();\n\t\treset();\n\t};\n\tconst resume = () => {\n\t\tif (!controls.isActive.value) {\n\t\t\tif (remaining.value > 0) controls.resume();\n\t\t}\n\t};\n\tconst start = (countdown) => {\n\t\treset(countdown);\n\t\tcontrols.resume();\n\t};\n\treturn {\n\t\tremaining,\n\t\treset,\n\t\tstop,\n\t\tstart,\n\t\tpause: controls.pause,\n\t\tresume,\n\t\tisActive: controls.isActive\n\t};\n}\n// useCssSupports/index.ts\nfunction useCssSupports(...args) {\n\tlet options = {};\n\tif (typeof toValue(args.at(-1)) === \"object\") options = args.pop();\n\tconst [prop, value] = args;\n\tconst { window = defaultWindow, ssrValue = false } = options;\n\tconst isMounted = useMounted();\n\treturn { isSupported: computed(() => {\n\t\tif (!isClient || !isMounted.value) return ssrValue;\n\t\treturn args.length === 2 ? window === null || window === void 0 ? void 0 : window.CSS.supports(toValue(prop), toValue(value)) : window === null || window === void 0 ? void 0 : window.CSS.supports(toValue(prop));\n\t}) };\n}\n// useCssVar/index.ts\n/**\n* Manipulate CSS variables.\n*\n* @see https://vueuse.org/useCssVar\n* @param prop\n* @param target\n* @param options\n*/\nfunction useCssVar(prop, target, options = {}) {\n\tconst { window = defaultWindow, initialValue, observe = false } = options;\n\tconst variable = shallowRef(initialValue);\n\tconst elRef = computed(() => {\n\t\tvar _window$document;\n\t\treturn unrefElement(target) || (window === null || window === void 0 || (_window$document = window.document) === null || _window$document === void 0 ? void 0 : _window$document.documentElement);\n\t});\n\tfunction updateCssVar() {\n\t\tconst key = toValue(prop);\n\t\tconst el = toValue(elRef);\n\t\tif (el && window && key) {\n\t\t\tvar _window$getComputedSt;\n\t\t\tconst value = (_window$getComputedSt = window.getComputedStyle(el).getPropertyValue(key)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.trim();\n\t\t\tvariable.value = value || variable.value || initialValue;\n\t\t}\n\t}\n\tif (observe) useMutationObserver(elRef, updateCssVar, {\n\t\tattributeFilter: [\"style\", \"class\"],\n\t\twindow\n\t});\n\twatch([elRef, () => toValue(prop)], (_, old) => {\n\t\tif (old[0] && old[1]) old[0].style.removeProperty(old[1]);\n\t\tupdateCssVar();\n\t}, { immediate: true });\n\twatch([variable, elRef], ([val, el]) => {\n\t\tconst raw_prop = toValue(prop);\n\t\tif ((el === null || el === void 0 ? void 0 : el.style) && raw_prop) {\n\t\t\tif (val == null) el.style.removeProperty(raw_prop);\n\t\t\telse el.style.setProperty(raw_prop, val);\n\t\t}\n\t}, { immediate: true });\n\treturn variable;\n}\n// useCurrentElement/index.ts\nfunction useCurrentElement(rootComponent) {\n\tconst vm = getCurrentInstance();\n\tconst currentElement = computedWithControl(() => null, () => rootComponent ? unrefElement(rootComponent) : vm.proxy.$el);\n\tonUpdated(currentElement.trigger);\n\tonMounted(currentElement.trigger);\n\treturn currentElement;\n}\n// useCycleList/index.ts\n/**\n* Cycle through a list of items\n*\n* @see https://vueuse.org/useCycleList\n*/\nfunction useCycleList(list, options) {\n\tconst state = shallowRef(getInitialValue());\n\tconst listRef = toRef(list);\n\tconst index = computed({\n\t\tget() {\n\t\t\tvar _options$fallbackInde;\n\t\t\tconst targetList = listRef.value;\n\t\t\tlet index = (options === null || options === void 0 ? void 0 : options.getIndexOf) ? options.getIndexOf(state.value, targetList) : targetList.indexOf(state.value);\n\t\t\tif (index < 0) index = (_options$fallbackInde = options === null || options === void 0 ? void 0 : options.fallbackIndex) !== null && _options$fallbackInde !== void 0 ? _options$fallbackInde : 0;\n\t\t\treturn index;\n\t\t},\n\t\tset(v) {\n\t\t\tset(v);\n\t\t}\n\t});\n\tfunction set(i) {\n\t\tconst targetList = listRef.value;\n\t\tconst length = targetList.length;\n\t\tconst value = targetList[(i % length + length) % length];\n\t\tstate.value = value;\n\t\treturn value;\n\t}\n\tfunction shift(delta = 1) {\n\t\treturn set(index.value + delta);\n\t}\n\tfunction next(n = 1) {\n\t\treturn shift(n);\n\t}\n\tfunction prev(n = 1) {\n\t\treturn shift(-n);\n\t}\n\tfunction getInitialValue() {\n\t\tvar _toValue, _options$initialValue;\n\t\treturn (_toValue = toValue((_options$initialValue = options === null || options === void 0 ? void 0 : options.initialValue) !== null && _options$initialValue !== void 0 ? _options$initialValue : toValue(list)[0])) !== null && _toValue !== void 0 ? _toValue : void 0;\n\t}\n\twatch(listRef, () => set(index.value));\n\treturn {\n\t\tstate,\n\t\tindex,\n\t\tnext,\n\t\tprev,\n\t\tgo: set\n\t};\n}\n// useDark/index.ts\n/**\n* Reactive dark mode with auto data persistence.\n*\n* @see https://vueuse.org/useDark\n* @param options\n*/\nfunction useDark(options = {}) {\n\tconst { valueDark = \"dark\", valueLight = \"\" } = options;\n\tconst mode = useColorMode({\n\t\t...options,\n\t\tonChanged: (mode, defaultHandler) => {\n\t\t\tvar _options$onChanged;\n\t\t\tif (options.onChanged) (_options$onChanged = options.onChanged) === null || _options$onChanged === void 0 || _options$onChanged.call(options, mode === \"dark\", defaultHandler, mode);\n\t\t\telse defaultHandler(mode);\n\t\t},\n\t\tmodes: {\n\t\t\tdark: valueDark,\n\t\t\tlight: valueLight\n\t\t}\n\t});\n\tconst system = computed(() => mode.system.value);\n\treturn computed({\n\t\tget() {\n\t\t\treturn mode.value === \"dark\";\n\t\t},\n\t\tset(v) {\n\t\t\tconst modeVal = v ? \"dark\" : \"light\";\n\t\t\tif (system.value === modeVal) mode.value = \"auto\";\n\t\t\telse mode.value = modeVal;\n\t\t}\n\t});\n}\n// useManualRefHistory/index.ts\nfunction fnBypass(v) {\n\treturn v;\n}\nfunction fnSetSource(source, value) {\n\treturn source.value = value;\n}\nfunction defaultDump(clone) {\n\treturn clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\nfunction defaultParse(clone) {\n\treturn clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\n/**\n* Track the change history of a ref, also provides undo and redo functionality.\n*\n* @see https://vueuse.org/useManualRefHistory\n* @param source\n* @param options\n*/\nfunction useManualRefHistory(source, options = {}) {\n\tconst { clone = false, dump = defaultDump(clone), parse = defaultParse(clone), setSource = fnSetSource } = options;\n\tfunction _createHistoryRecord() {\n\t\treturn markRaw({\n\t\t\tsnapshot: dump(source.value),\n\t\t\ttimestamp: timestamp()\n\t\t});\n\t}\n\tconst last = ref(_createHistoryRecord());\n\tconst undoStack = ref([]);\n\tconst redoStack = ref([]);\n\tconst _setSource = (record) => {\n\t\tsetSource(source, parse(record.snapshot));\n\t\tlast.value = record;\n\t};\n\tconst commit = () => {\n\t\tundoStack.value.unshift(last.value);\n\t\tlast.value = _createHistoryRecord();\n\t\tif (options.capacity && undoStack.value.length > options.capacity) undoStack.value.splice(options.capacity, Number.POSITIVE_INFINITY);\n\t\tif (redoStack.value.length) redoStack.value.splice(0, redoStack.value.length);\n\t};\n\tconst clear = () => {\n\t\tundoStack.value.splice(0, undoStack.value.length);\n\t\tredoStack.value.splice(0, redoStack.value.length);\n\t};\n\tconst undo = () => {\n\t\tconst state = undoStack.value.shift();\n\t\tif (state) {\n\t\t\tredoStack.value.unshift(last.value);\n\t\t\t_setSource(state);\n\t\t}\n\t};\n\tconst redo = () => {\n\t\tconst state = redoStack.value.shift();\n\t\tif (state) {\n\t\t\tundoStack.value.unshift(last.value);\n\t\t\t_setSource(state);\n\t\t}\n\t};\n\tconst reset = () => {\n\t\t_setSource(last.value);\n\t};\n\treturn {\n\t\tsource,\n\t\tundoStack,\n\t\tredoStack,\n\t\tlast,\n\t\thistory: computed(() => [last.value, ...undoStack.value]),\n\t\tcanUndo: computed(() => undoStack.value.length > 0),\n\t\tcanRedo: computed(() => redoStack.value.length > 0),\n\t\tclear,\n\t\tcommit,\n\t\treset,\n\t\tundo,\n\t\tredo\n\t};\n}\n// useRefHistory/index.ts\n/**\n* Track the change history of a ref, also provides undo and redo functionality.\n*\n* @see https://vueuse.org/useRefHistory\n* @param source\n* @param options\n*/\nfunction useRefHistory(source, options = {}) {\n\tconst { deep = false, flush = \"pre\", eventFilter, shouldCommit = () => true } = options;\n\tconst { eventFilter: composedFilter, pause, resume: resumeTracking, isActive: isTracking } = pausableFilter(eventFilter);\n\tlet lastRawValue = source.value;\n\tconst { ignoreUpdates, ignorePrevAsyncUpdates, stop } = watchIgnorable(source, commit, {\n\t\tdeep,\n\t\tflush,\n\t\teventFilter: composedFilter\n\t});\n\tfunction setSource(source, value) {\n\t\tignorePrevAsyncUpdates();\n\t\tignoreUpdates(() => {\n\t\t\tsource.value = value;\n\t\t\tlastRawValue = value;\n\t\t});\n\t}\n\tconst manualHistory = useManualRefHistory(source, {\n\t\t...options,\n\t\tclone: options.clone || deep,\n\t\tsetSource\n\t});\n\tconst { clear, commit: manualCommit } = manualHistory;\n\tfunction commit() {\n\t\tignorePrevAsyncUpdates();\n\t\tif (!shouldCommit(lastRawValue, source.value)) return;\n\t\tlastRawValue = source.value;\n\t\tmanualCommit();\n\t}\n\tfunction resume(commitNow) {\n\t\tresumeTracking();\n\t\tif (commitNow) commit();\n\t}\n\tfunction batch(fn) {\n\t\tlet canceled = false;\n\t\tconst cancel = () => canceled = true;\n\t\tignoreUpdates(() => {\n\t\t\tfn(cancel);\n\t\t});\n\t\tif (!canceled) commit();\n\t}\n\tfunction dispose() {\n\t\tstop();\n\t\tclear();\n\t}\n\treturn {\n\t\t...manualHistory,\n\t\tisTracking,\n\t\tpause,\n\t\tresume,\n\t\tcommit,\n\t\tbatch,\n\t\tdispose\n\t};\n}\n// useDebouncedRefHistory/index.ts\n/**\n* Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with debounce filter.\n*\n* @see https://vueuse.org/useDebouncedRefHistory\n* @param source\n* @param options\n*/\nfunction useDebouncedRefHistory(source, options = {}) {\n\tconst filter = options.debounce ? debounceFilter(options.debounce) : void 0;\n\treturn { ...useRefHistory(source, {\n\t\t...options,\n\t\teventFilter: filter\n\t}) };\n}\n// useDeviceMotion/index.ts\n/**\n* Reactive DeviceMotionEvent.\n*\n* @see https://vueuse.org/useDeviceMotion\n* @param options\n*/\nfunction useDeviceMotion(options = {}) {\n\tconst { window = defaultWindow, requestPermissions = false, eventFilter = bypassFilter } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof DeviceMotionEvent !== \"undefined\");\n\tconst requirePermissions = /* @__PURE__ */ useSupported(() => isSupported.value && \"requestPermission\" in DeviceMotionEvent && typeof DeviceMotionEvent.requestPermission === \"function\");\n\tconst permissionGranted = shallowRef(false);\n\tconst acceleration = ref({\n\t\tx: null,\n\t\ty: null,\n\t\tz: null\n\t});\n\tconst rotationRate = ref({\n\t\talpha: null,\n\t\tbeta: null,\n\t\tgamma: null\n\t});\n\tconst interval = shallowRef(0);\n\tconst accelerationIncludingGravity = ref({\n\t\tx: null,\n\t\ty: null,\n\t\tz: null\n\t});\n\tfunction init() {\n\t\tif (window) {\n\t\t\tconst onDeviceMotion = createFilterWrapper(eventFilter, (event) => {\n\t\t\t\tvar _event$acceleration, _event$acceleration2, _event$acceleration3, _event$accelerationIn, _event$accelerationIn2, _event$accelerationIn3, _event$rotationRate, _event$rotationRate2, _event$rotationRate3;\n\t\t\t\tacceleration.value = {\n\t\t\t\t\tx: ((_event$acceleration = event.acceleration) === null || _event$acceleration === void 0 ? void 0 : _event$acceleration.x) || null,\n\t\t\t\t\ty: ((_event$acceleration2 = event.acceleration) === null || _event$acceleration2 === void 0 ? void 0 : _event$acceleration2.y) || null,\n\t\t\t\t\tz: ((_event$acceleration3 = event.acceleration) === null || _event$acceleration3 === void 0 ? void 0 : _event$acceleration3.z) || null\n\t\t\t\t};\n\t\t\t\taccelerationIncludingGravity.value = {\n\t\t\t\t\tx: ((_event$accelerationIn = event.accelerationIncludingGravity) === null || _event$accelerationIn === void 0 ? void 0 : _event$accelerationIn.x) || null,\n\t\t\t\t\ty: ((_event$accelerationIn2 = event.accelerationIncludingGravity) === null || _event$accelerationIn2 === void 0 ? void 0 : _event$accelerationIn2.y) || null,\n\t\t\t\t\tz: ((_event$accelerationIn3 = event.accelerationIncludingGravity) === null || _event$accelerationIn3 === void 0 ? void 0 : _event$accelerationIn3.z) || null\n\t\t\t\t};\n\t\t\t\trotationRate.value = {\n\t\t\t\t\talpha: ((_event$rotationRate = event.rotationRate) === null || _event$rotationRate === void 0 ? void 0 : _event$rotationRate.alpha) || null,\n\t\t\t\t\tbeta: ((_event$rotationRate2 = event.rotationRate) === null || _event$rotationRate2 === void 0 ? void 0 : _event$rotationRate2.beta) || null,\n\t\t\t\t\tgamma: ((_event$rotationRate3 = event.rotationRate) === null || _event$rotationRate3 === void 0 ? void 0 : _event$rotationRate3.gamma) || null\n\t\t\t\t};\n\t\t\t\tinterval.value = event.interval;\n\t\t\t});\n\t\t\tuseEventListener(window, \"devicemotion\", onDeviceMotion, { passive: true });\n\t\t}\n\t}\n\tconst ensurePermissions = async () => {\n\t\tif (!requirePermissions.value) permissionGranted.value = true;\n\t\tif (permissionGranted.value) return;\n\t\tif (requirePermissions.value) {\n\t\t\tconst requestPermission = DeviceMotionEvent.requestPermission;\n\t\t\ttry {\n\t\t\t\tif (await requestPermission() === \"granted\") {\n\t\t\t\t\tpermissionGranted.value = true;\n\t\t\t\t\tinit();\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t}\n\t};\n\tif (isSupported.value) {\n\t\tif (requestPermissions && requirePermissions.value) ensurePermissions().then(() => init());\n\t\telse init();\n\t}\n\treturn {\n\t\tacceleration,\n\t\taccelerationIncludingGravity,\n\t\trotationRate,\n\t\tinterval,\n\t\tisSupported,\n\t\trequirePermissions,\n\t\tensurePermissions,\n\t\tpermissionGranted\n\t};\n}\n// useDeviceOrientation/index.ts\n/**\n* Reactive DeviceOrientationEvent.\n*\n* @see https://vueuse.org/useDeviceOrientation\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDeviceOrientation(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"DeviceOrientationEvent\" in window);\n\tconst isAbsolute = shallowRef(false);\n\tconst alpha = shallowRef(null);\n\tconst beta = shallowRef(null);\n\tconst gamma = shallowRef(null);\n\tif (window && isSupported.value) useEventListener(window, \"deviceorientation\", (event) => {\n\t\tisAbsolute.value = event.absolute;\n\t\talpha.value = event.alpha;\n\t\tbeta.value = event.beta;\n\t\tgamma.value = event.gamma;\n\t}, { passive: true });\n\treturn {\n\t\tisSupported,\n\t\tisAbsolute,\n\t\talpha,\n\t\tbeta,\n\t\tgamma\n\t};\n}\n// useDevicePixelRatio/index.ts\n/**\n* Reactively track `window.devicePixelRatio`.\n*\n* @see https://vueuse.org/useDevicePixelRatio\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDevicePixelRatio(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst pixelRatio = shallowRef(1);\n\tconst query = useMediaQuery(() => `(resolution: ${pixelRatio.value}dppx)`, options);\n\tlet stop = noop;\n\tif (window) stop = watchImmediate(query, () => pixelRatio.value = window.devicePixelRatio);\n\treturn {\n\t\tpixelRatio: shallowReadonly(pixelRatio),\n\t\tstop\n\t};\n}\n// useDevicesList/index.ts\n/**\n* Reactive `enumerateDevices` listing available input/output devices\n*\n* @see https://vueuse.org/useDevicesList\n* @param options\n*/\nfunction useDevicesList(options = {}) {\n\tconst { navigator = defaultNavigator, requestPermissions = false, constraints = {\n\t\taudio: true,\n\t\tvideo: true\n\t}, onUpdated } = options;\n\tconst devices = shallowRef([]);\n\tconst videoInputs = computed(() => devices.value.filter((i) => i.kind === \"videoinput\"));\n\tconst audioInputs = computed(() => devices.value.filter((i) => i.kind === \"audioinput\"));\n\tconst audioOutputs = computed(() => devices.value.filter((i) => i.kind === \"audiooutput\"));\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && navigator.mediaDevices && navigator.mediaDevices.enumerateDevices);\n\tconst permissionGranted = shallowRef(false);\n\tlet stream;\n\tasync function update() {\n\t\tif (!isSupported.value) return;\n\t\tdevices.value = await navigator.mediaDevices.enumerateDevices();\n\t\tonUpdated === null || onUpdated === void 0 || onUpdated(devices.value);\n\t\tif (stream) {\n\t\t\tstream.getTracks().forEach((t) => t.stop());\n\t\t\tstream = null;\n\t\t}\n\t}\n\tasync function ensurePermissions() {\n\t\tconst deviceName = constraints.video ? \"camera\" : \"microphone\";\n\t\tif (!isSupported.value) return false;\n\t\tif (permissionGranted.value) return true;\n\t\tconst { state, query } = /* @__PURE__ */ usePermission(deviceName, { controls: true });\n\t\tawait query();\n\t\tif (state.value !== \"granted\") {\n\t\t\tlet granted = true;\n\t\t\ttry {\n\t\t\t\tconst allDevices = await navigator.mediaDevices.enumerateDevices();\n\t\t\t\tconst hasCamera = allDevices.some((device) => device.kind === \"videoinput\");\n\t\t\t\tconst hasMicrophone = allDevices.some((device) => device.kind === \"audioinput\" || device.kind === \"audiooutput\");\n\t\t\t\tconstraints.video = hasCamera ? constraints.video : false;\n\t\t\t\tconstraints.audio = hasMicrophone ? constraints.audio : false;\n\t\t\t\tstream = await navigator.mediaDevices.getUserMedia(constraints);\n\t\t\t} catch (_unused) {\n\t\t\t\tstream = null;\n\t\t\t\tgranted = false;\n\t\t\t}\n\t\t\tupdate();\n\t\t\tpermissionGranted.value = granted;\n\t\t} else permissionGranted.value = true;\n\t\treturn permissionGranted.value;\n\t}\n\tif (isSupported.value) {\n\t\tif (requestPermissions) ensurePermissions();\n\t\tuseEventListener(navigator.mediaDevices, \"devicechange\", update, { passive: true });\n\t\tupdate();\n\t}\n\treturn {\n\t\tdevices,\n\t\tensurePermissions,\n\t\tpermissionGranted,\n\t\tvideoInputs,\n\t\taudioInputs,\n\t\taudioOutputs,\n\t\tisSupported\n\t};\n}\n// useDisplayMedia/index.ts\n/**\n* Reactive `mediaDevices.getDisplayMedia` streaming\n*\n* @see https://vueuse.org/useDisplayMedia\n* @param options\n*/\nfunction useDisplayMedia(options = {}) {\n\tvar _options$enabled;\n\tconst enabled = shallowRef((_options$enabled = options.enabled) !== null && _options$enabled !== void 0 ? _options$enabled : false);\n\tconst video = options.video;\n\tconst audio = options.audio;\n\tconst { navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tvar _navigator$mediaDevic;\n\t\treturn navigator === null || navigator === void 0 || (_navigator$mediaDevic = navigator.mediaDevices) === null || _navigator$mediaDevic === void 0 ? void 0 : _navigator$mediaDevic.getDisplayMedia;\n\t});\n\tconst constraint = {\n\t\taudio,\n\t\tvideo\n\t};\n\tconst stream = shallowRef();\n\tasync function _start() {\n\t\tvar _stream$value;\n\t\tif (!isSupported.value || stream.value) return;\n\t\tstream.value = await navigator.mediaDevices.getDisplayMedia(constraint);\n\t\t(_stream$value = stream.value) === null || _stream$value === void 0 || _stream$value.getTracks().forEach((t) => useEventListener(t, \"ended\", stop, { passive: true }));\n\t\treturn stream.value;\n\t}\n\tasync function _stop() {\n\t\tvar _stream$value2;\n\t\t(_stream$value2 = stream.value) === null || _stream$value2 === void 0 || _stream$value2.getTracks().forEach((t) => t.stop());\n\t\tstream.value = void 0;\n\t}\n\tfunction stop() {\n\t\t_stop();\n\t\tenabled.value = false;\n\t}\n\tasync function start() {\n\t\tawait _start();\n\t\tif (stream.value) enabled.value = true;\n\t\treturn stream.value;\n\t}\n\twatch(enabled, (v) => {\n\t\tif (v) _start();\n\t\telse _stop();\n\t}, { immediate: true });\n\treturn {\n\t\tisSupported,\n\t\tstream,\n\t\tstart,\n\t\tstop,\n\t\tenabled\n\t};\n}\n// useDocumentVisibility/index.ts\n/**\n* Reactively track `document.visibilityState`.\n*\n* @see https://vueuse.org/useDocumentVisibility\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDocumentVisibility(options = {}) {\n\tconst { document = defaultDocument } = options;\n\tif (!document) return shallowRef(\"visible\");\n\tconst visibility = shallowRef(document.visibilityState);\n\tuseEventListener(document, \"visibilitychange\", () => {\n\t\tvisibility.value = document.visibilityState;\n\t}, { passive: true });\n\treturn visibility;\n}\n// useDraggable/index.ts\nconst defaultScrollConfig = {\n\tspeed: 2,\n\tmargin: 30,\n\tdirection: \"both\"\n};\nfunction clampContainerScroll(container) {\n\tif (container.scrollLeft > container.scrollWidth - container.clientWidth) container.scrollLeft = Math.max(0, container.scrollWidth - container.clientWidth);\n\tif (container.scrollTop > container.scrollHeight - container.clientHeight) container.scrollTop = Math.max(0, container.scrollHeight - container.clientHeight);\n}\n/**\n* Make elements draggable.\n*\n* @see https://vueuse.org/useDraggable\n* @param target\n* @param options\n*/\nfunction useDraggable(target, options = {}) {\n\tvar _toValue, _toValue2, _toValue3, _scrollConfig$directi;\n\tconst { pointerTypes, preventDefault, stopPropagation, exact, onMove, onEnd, onStart, initialValue, axis = \"both\", draggingElement = defaultWindow, containerElement, handle: draggingHandle = target, buttons = [0], restrictInView, autoScroll = false } = options;\n\tconst position = ref((_toValue = toValue(initialValue)) !== null && _toValue !== void 0 ? _toValue : {\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst pressedDelta = ref();\n\tconst filterEvent = (e) => {\n\t\tif (pointerTypes) return pointerTypes.includes(e.pointerType);\n\t\treturn true;\n\t};\n\tconst handleEvent = (e) => {\n\t\tif (toValue(preventDefault)) e.preventDefault();\n\t\tif (toValue(stopPropagation)) e.stopPropagation();\n\t};\n\tconst scrollConfig = toValue(autoScroll);\n\tconst scrollSettings = typeof scrollConfig === \"object\" ? {\n\t\tspeed: (_toValue2 = toValue(scrollConfig.speed)) !== null && _toValue2 !== void 0 ? _toValue2 : defaultScrollConfig.speed,\n\t\tmargin: (_toValue3 = toValue(scrollConfig.margin)) !== null && _toValue3 !== void 0 ? _toValue3 : defaultScrollConfig.margin,\n\t\tdirection: (_scrollConfig$directi = scrollConfig.direction) !== null && _scrollConfig$directi !== void 0 ? _scrollConfig$directi : defaultScrollConfig.direction\n\t} : defaultScrollConfig;\n\tconst getScrollAxisValues = (value) => typeof value === \"number\" ? [value, value] : [value.x, value.y];\n\tconst handleAutoScroll = (container, targetRect, position) => {\n\t\tconst { clientWidth, clientHeight, scrollLeft, scrollTop, scrollWidth, scrollHeight } = container;\n\t\tconst [marginX, marginY] = getScrollAxisValues(scrollSettings.margin);\n\t\tconst [speedX, speedY] = getScrollAxisValues(scrollSettings.speed);\n\t\tlet deltaX = 0;\n\t\tlet deltaY = 0;\n\t\tif (scrollSettings.direction === \"x\" || scrollSettings.direction === \"both\") {\n\t\t\tif (position.x < marginX && scrollLeft > 0) deltaX = -speedX;\n\t\t\telse if (position.x + targetRect.width > clientWidth - marginX && scrollLeft < scrollWidth - clientWidth) deltaX = speedX;\n\t\t}\n\t\tif (scrollSettings.direction === \"y\" || scrollSettings.direction === \"both\") {\n\t\t\tif (position.y < marginY && scrollTop > 0) deltaY = -speedY;\n\t\t\telse if (position.y + targetRect.height > clientHeight - marginY && scrollTop < scrollHeight - clientHeight) deltaY = speedY;\n\t\t}\n\t\tif (deltaX || deltaY) container.scrollBy({\n\t\t\tleft: deltaX,\n\t\t\ttop: deltaY,\n\t\t\tbehavior: \"auto\"\n\t\t});\n\t};\n\tlet autoScrollInterval = null;\n\tconst startAutoScroll = () => {\n\t\tconst container = toValue(containerElement);\n\t\tif (container && !autoScrollInterval) autoScrollInterval = setInterval(() => {\n\t\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\t\tconst { x, y } = position.value;\n\t\t\tconst relativePosition = {\n\t\t\t\tx: x - container.scrollLeft,\n\t\t\t\ty: y - container.scrollTop\n\t\t\t};\n\t\t\tif (relativePosition.x >= 0 && relativePosition.y >= 0) {\n\t\t\t\thandleAutoScroll(container, targetRect, relativePosition);\n\t\t\t\trelativePosition.x += container.scrollLeft;\n\t\t\t\trelativePosition.y += container.scrollTop;\n\t\t\t\tposition.value = relativePosition;\n\t\t\t}\n\t\t}, 1e3 / 60);\n\t};\n\tconst stopAutoScroll = () => {\n\t\tif (autoScrollInterval) {\n\t\t\tclearInterval(autoScrollInterval);\n\t\t\tautoScrollInterval = null;\n\t\t}\n\t};\n\tconst isPointerNearEdge = (pointer, container, margin, targetRect) => {\n\t\tconst [marginX, marginY] = typeof margin === \"number\" ? [margin, margin] : [margin.x, margin.y];\n\t\tconst { clientWidth, clientHeight } = container;\n\t\treturn pointer.x < marginX || pointer.x + targetRect.width > clientWidth - marginX || pointer.y < marginY || pointer.y + targetRect.height > clientHeight - marginY;\n\t};\n\tconst checkAutoScroll = () => {\n\t\tif (toValue(options.disabled) || !pressedDelta.value) return;\n\t\tconst container = toValue(containerElement);\n\t\tif (!container) return;\n\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\tconst { x, y } = position.value;\n\t\tconst relativePosition = {\n\t\t\tx: x - container.scrollLeft,\n\t\t\ty: y - container.scrollTop\n\t\t};\n\t\tif (isPointerNearEdge(relativePosition, container, scrollSettings.margin, targetRect)) startAutoScroll();\n\t\telse stopAutoScroll();\n\t};\n\tif (toValue(autoScroll)) watch(position, checkAutoScroll);\n\tconst start = (e) => {\n\t\tvar _container$getBoundin;\n\t\tif (!toValue(buttons).includes(e.button)) return;\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (toValue(exact) && e.target !== toValue(target)) return;\n\t\tconst container = toValue(containerElement);\n\t\tconst containerRect = container === null || container === void 0 || (_container$getBoundin = container.getBoundingClientRect) === null || _container$getBoundin === void 0 ? void 0 : _container$getBoundin.call(container);\n\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\tconst pos = {\n\t\t\tx: e.clientX - (container ? targetRect.left - containerRect.left + (autoScroll ? 0 : container.scrollLeft) : targetRect.left),\n\t\t\ty: e.clientY - (container ? targetRect.top - containerRect.top + (autoScroll ? 0 : container.scrollTop) : targetRect.top)\n\t\t};\n\t\tif ((onStart === null || onStart === void 0 ? void 0 : onStart(pos, e)) === false) return;\n\t\tpressedDelta.value = pos;\n\t\thandleEvent(e);\n\t};\n\tconst move = (e) => {\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (!pressedDelta.value) return;\n\t\tconst container = toValue(containerElement);\n\t\tif (container instanceof HTMLElement) clampContainerScroll(container);\n\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\tlet { x, y } = position.value;\n\t\tif (axis === \"x\" || axis === \"both\") {\n\t\t\tx = e.clientX - pressedDelta.value.x;\n\t\t\tif (container) x = Math.min(Math.max(0, x), container.scrollWidth - targetRect.width);\n\t\t}\n\t\tif (axis === \"y\" || axis === \"both\") {\n\t\t\ty = e.clientY - pressedDelta.value.y;\n\t\t\tif (container) y = Math.min(Math.max(0, y), container.scrollHeight - targetRect.height);\n\t\t}\n\t\tif (toValue(autoScroll) && container) {\n\t\t\tif (autoScrollInterval === null) handleAutoScroll(container, targetRect, {\n\t\t\t\tx,\n\t\t\t\ty\n\t\t\t});\n\t\t\tx += container.scrollLeft;\n\t\t\ty += container.scrollTop;\n\t\t}\n\t\tif (container && (restrictInView || autoScroll)) {\n\t\t\tif (axis !== \"y\") {\n\t\t\t\tconst relativeX = x - container.scrollLeft;\n\t\t\t\tif (relativeX < 0) x = container.scrollLeft;\n\t\t\t\telse if (relativeX > container.clientWidth - targetRect.width) x = container.clientWidth - targetRect.width + container.scrollLeft;\n\t\t\t}\n\t\t\tif (axis !== \"x\") {\n\t\t\t\tconst relativeY = y - container.scrollTop;\n\t\t\t\tif (relativeY < 0) y = container.scrollTop;\n\t\t\t\telse if (relativeY > container.clientHeight - targetRect.height) y = container.clientHeight - targetRect.height + container.scrollTop;\n\t\t\t}\n\t\t}\n\t\tposition.value = {\n\t\t\tx,\n\t\t\ty\n\t\t};\n\t\tonMove === null || onMove === void 0 || onMove(position.value, e);\n\t\thandleEvent(e);\n\t};\n\tconst end = (e) => {\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (!pressedDelta.value) return;\n\t\tpressedDelta.value = void 0;\n\t\tif (autoScroll) stopAutoScroll();\n\t\tonEnd === null || onEnd === void 0 || onEnd(position.value, e);\n\t\thandleEvent(e);\n\t};\n\tif (isClient) {\n\t\tconst config = () => {\n\t\t\tvar _options$capture;\n\t\t\treturn {\n\t\t\t\tcapture: (_options$capture = options.capture) !== null && _options$capture !== void 0 ? _options$capture : true,\n\t\t\t\tpassive: !toValue(preventDefault)\n\t\t\t};\n\t\t};\n\t\tuseEventListener(draggingHandle, \"pointerdown\", start, config);\n\t\tuseEventListener(draggingElement, \"pointermove\", move, config);\n\t\tuseEventListener(draggingElement, [\"pointerup\", \"pointercancel\"], end, config);\n\t}\n\treturn {\n\t\t...toRefs(position),\n\t\tposition,\n\t\tisDragging: computed(() => !!pressedDelta.value),\n\t\tstyle: computed(() => `\n left: ${position.value.x}px;\n top: ${position.value.y}px;\n ${autoScroll ? \"text-wrap: nowrap;\" : \"\"}\n `)\n\t};\n}\n// useDropZone/index.ts\nfunction useDropZone(target, options = {}) {\n\tconst isOverDropZone = shallowRef(false);\n\tconst files = shallowRef(null);\n\tlet counter = 0;\n\tlet isValid = true;\n\tif (isClient) {\n\t\tvar _options$multiple, _options$preventDefau;\n\t\tconst _options = typeof options === \"function\" ? { onDrop: options } : options;\n\t\tconst multiple = (_options$multiple = _options.multiple) !== null && _options$multiple !== void 0 ? _options$multiple : true;\n\t\tconst preventDefaultForUnhandled = (_options$preventDefau = _options.preventDefaultForUnhandled) !== null && _options$preventDefau !== void 0 ? _options$preventDefau : false;\n\t\tconst getFiles = (event) => {\n\t\t\tvar _event$dataTransfer$f, _event$dataTransfer;\n\t\t\tconst list = Array.from((_event$dataTransfer$f = (_event$dataTransfer = event.dataTransfer) === null || _event$dataTransfer === void 0 ? void 0 : _event$dataTransfer.files) !== null && _event$dataTransfer$f !== void 0 ? _event$dataTransfer$f : []);\n\t\t\treturn list.length === 0 ? null : multiple ? list : [list[0]];\n\t\t};\n\t\tconst checkDataTypes = (types) => {\n\t\t\tconst dataTypes = unref(_options.dataTypes);\n\t\t\tif (typeof dataTypes === \"function\") return dataTypes(types);\n\t\t\tif (!(dataTypes === null || dataTypes === void 0 ? void 0 : dataTypes.length)) return true;\n\t\t\tif (types.length === 0) return false;\n\t\t\treturn types.every((type) => dataTypes.some((allowedType) => type.includes(allowedType)));\n\t\t};\n\t\tconst checkValidity = (items) => {\n\t\t\tif (_options.checkValidity) return _options.checkValidity(items);\n\t\t\tconst types = Array.from(items !== null && items !== void 0 ? items : []).map((item) => item.type);\n\t\t\tconst dataTypesValid = checkDataTypes(types);\n\t\t\tconst multipleFilesValid = multiple || items.length <= 1;\n\t\t\treturn dataTypesValid && multipleFilesValid;\n\t\t};\n\t\tconst isSafari = () => /^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent) && !(\"chrome\" in window);\n\t\tconst handleDragEvent = (event, eventType) => {\n\t\t\tvar _event$dataTransfer2, _ref;\n\t\t\tconst dataTransferItemList = (_event$dataTransfer2 = event.dataTransfer) === null || _event$dataTransfer2 === void 0 ? void 0 : _event$dataTransfer2.items;\n\t\t\tisValid = (_ref = dataTransferItemList && checkValidity(dataTransferItemList)) !== null && _ref !== void 0 ? _ref : false;\n\t\t\tif (preventDefaultForUnhandled) event.preventDefault();\n\t\t\tif (!isSafari() && !isValid) {\n\t\t\t\tif (event.dataTransfer) event.dataTransfer.dropEffect = \"none\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tif (event.dataTransfer) event.dataTransfer.dropEffect = \"copy\";\n\t\t\tconst currentFiles = getFiles(event);\n\t\t\tswitch (eventType) {\n\t\t\t\tcase \"enter\":\n\t\t\t\t\tvar _options$onEnter;\n\t\t\t\t\tcounter += 1;\n\t\t\t\t\tisOverDropZone.value = true;\n\t\t\t\t\t(_options$onEnter = _options.onEnter) === null || _options$onEnter === void 0 || _options$onEnter.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"over\":\n\t\t\t\t\tvar _options$onOver;\n\t\t\t\t\t(_options$onOver = _options.onOver) === null || _options$onOver === void 0 || _options$onOver.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"leave\":\n\t\t\t\t\tvar _options$onLeave;\n\t\t\t\t\tcounter -= 1;\n\t\t\t\t\tif (counter === 0) isOverDropZone.value = false;\n\t\t\t\t\t(_options$onLeave = _options.onLeave) === null || _options$onLeave === void 0 || _options$onLeave.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"drop\":\n\t\t\t\t\tcounter = 0;\n\t\t\t\t\tisOverDropZone.value = false;\n\t\t\t\t\tif (isValid) {\n\t\t\t\t\t\tvar _options$onDrop;\n\t\t\t\t\t\tfiles.value = currentFiles;\n\t\t\t\t\t\t(_options$onDrop = _options.onDrop) === null || _options$onDrop === void 0 || _options$onDrop.call(_options, currentFiles, event);\n\t\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tuseEventListener(target, \"dragenter\", (event) => handleDragEvent(event, \"enter\"));\n\t\tuseEventListener(target, \"dragover\", (event) => handleDragEvent(event, \"over\"));\n\t\tuseEventListener(target, \"dragleave\", (event) => handleDragEvent(event, \"leave\"));\n\t\tuseEventListener(target, \"drop\", (event) => handleDragEvent(event, \"drop\"));\n\t}\n\treturn {\n\t\tfiles,\n\t\tisOverDropZone\n\t};\n}\n// useResizeObserver/index.ts\n/**\n* Reports changes to the dimensions of an Element's content or the border-box\n*\n* @see https://vueuse.org/useResizeObserver\n* @param target\n* @param callback\n* @param options\n*/\nfunction useResizeObserver(target, callback, options = {}) {\n\tconst { window = defaultWindow, ...observerOptions } = options;\n\tlet observer;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"ResizeObserver\" in window);\n\tconst cleanup = () => {\n\t\tif (observer) {\n\t\t\tobserver.disconnect();\n\t\t\tobserver = void 0;\n\t\t}\n\t};\n\tconst targets = computed(() => {\n\t\tconst _targets = toValue(target);\n\t\treturn Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];\n\t});\n\tconst stopWatch = watch(targets, (els) => {\n\t\tcleanup();\n\t\tif (isSupported.value && window) {\n\t\t\tobserver = new ResizeObserver(callback);\n\t\t\tfor (const _el of els) if (_el instanceof Element) observer.observe(_el, observerOptions);\n\t\t}\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\tconst stop = () => {\n\t\tcleanup();\n\t\tstopWatch();\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tstop\n\t};\n}\n// useElementBounding/index.ts\n/**\n* Reactive bounding box of an HTML element.\n*\n* @see https://vueuse.org/useElementBounding\n* @param target\n*/\nfunction useElementBounding(target, options = {}) {\n\tconst { reset = true, windowResize = true, windowScroll = true, immediate = true, updateTiming = \"sync\" } = options;\n\tconst height = shallowRef(0);\n\tconst bottom = shallowRef(0);\n\tconst left = shallowRef(0);\n\tconst right = shallowRef(0);\n\tconst top = shallowRef(0);\n\tconst width = shallowRef(0);\n\tconst x = shallowRef(0);\n\tconst y = shallowRef(0);\n\tfunction recalculate() {\n\t\tconst el = unrefElement(target);\n\t\tif (!el) {\n\t\t\tif (reset) {\n\t\t\t\theight.value = 0;\n\t\t\t\tbottom.value = 0;\n\t\t\t\tleft.value = 0;\n\t\t\t\tright.value = 0;\n\t\t\t\ttop.value = 0;\n\t\t\t\twidth.value = 0;\n\t\t\t\tx.value = 0;\n\t\t\t\ty.value = 0;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst rect = el.getBoundingClientRect();\n\t\theight.value = rect.height;\n\t\tbottom.value = rect.bottom;\n\t\tleft.value = rect.left;\n\t\tright.value = rect.right;\n\t\ttop.value = rect.top;\n\t\twidth.value = rect.width;\n\t\tx.value = rect.x;\n\t\ty.value = rect.y;\n\t}\n\tfunction update() {\n\t\tif (updateTiming === \"sync\") recalculate();\n\t\telse if (updateTiming === \"next-frame\") requestAnimationFrame(() => recalculate());\n\t}\n\tuseResizeObserver(target, update);\n\twatch(() => unrefElement(target), (ele) => !ele && update());\n\tuseMutationObserver(target, update, { attributeFilter: [\"style\", \"class\"] });\n\tif (windowScroll) useEventListener(\"scroll\", update, {\n\t\tcapture: true,\n\t\tpassive: true\n\t});\n\tif (windowResize) useEventListener(\"resize\", update, { passive: true });\n\ttryOnMounted(() => {\n\t\tif (immediate) update();\n\t});\n\treturn {\n\t\theight,\n\t\tbottom,\n\t\tleft,\n\t\tright,\n\t\ttop,\n\t\twidth,\n\t\tx,\n\t\ty,\n\t\tupdate\n\t};\n}\n// useElementByPoint/index.ts\n/**\n* Reactive element by point.\n*\n* @see https://vueuse.org/useElementByPoint\n* @param options - UseElementByPointOptions\n*/\nfunction useElementByPoint(options) {\n\tconst { x, y, document = defaultDocument, multiple, scheduler = useRafFn } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tif (toValue(multiple)) return document && \"elementsFromPoint\" in document;\n\t\treturn document && \"elementFromPoint\" in document;\n\t});\n\tconst element = shallowRef(null);\n\treturn {\n\t\tisSupported,\n\t\telement,\n\t\t...scheduler(() => {\n\t\t\tvar _document$elementsFro, _document$elementFrom;\n\t\t\telement.value = toValue(multiple) ? (_document$elementsFro = document === null || document === void 0 ? void 0 : document.elementsFromPoint(toValue(x), toValue(y))) !== null && _document$elementsFro !== void 0 ? _document$elementsFro : [] : (_document$elementFrom = document === null || document === void 0 ? void 0 : document.elementFromPoint(toValue(x), toValue(y))) !== null && _document$elementFrom !== void 0 ? _document$elementFrom : null;\n\t\t})\n\t};\n}\n// useElementHover/index.ts\nfunction useElementHover(el, options = {}) {\n\tconst { delayEnter = 0, delayLeave = 0, triggerOnRemoval = false, window = defaultWindow } = options;\n\tconst isHovered = shallowRef(false);\n\tlet timer;\n\tconst toggle = (entering) => {\n\t\tconst delay = entering ? delayEnter : delayLeave;\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t}\n\t\tif (delay) timer = setTimeout(() => isHovered.value = entering, delay);\n\t\telse isHovered.value = entering;\n\t};\n\tif (!window) return isHovered;\n\tuseEventListener(el, \"mouseenter\", () => toggle(true), { passive: true });\n\tuseEventListener(el, \"mouseleave\", () => toggle(false), { passive: true });\n\tif (triggerOnRemoval) onElementRemoval(computed(() => unrefElement(el)), () => toggle(false));\n\treturn isHovered;\n}\n// useElementOverflow/index.ts\n/**\n* react a dom's overflow state\n* @see https://vueuse.org/useElementOverflow\n* @param target\n* @param option\n*/\nfunction useElementOverflow(target, option = {}) {\n\tconst { observeMutation = false, onUpdated, window = defaultWindow } = option;\n\tconst isXOverflowed = shallowRef(false);\n\tconst isYOverflowed = shallowRef(false);\n\tfunction update(htmlEl) {\n\t\tisXOverflowed.value = htmlEl.scrollWidth > htmlEl.offsetWidth;\n\t\tisYOverflowed.value = htmlEl.scrollHeight > htmlEl.offsetHeight;\n\t}\n\tconst onResizeUpdated = onUpdated;\n\tconst targetEl = computed(() => {\n\t\tconst el = unrefElement(target);\n\t\tif (!el || el instanceof SVGElement) return void 0;\n\t\treturn el;\n\t});\n\tconst targets = () => {\n\t\tconst el = targetEl.value;\n\t\tif (!el || el instanceof SVGElement) return [];\n\t\treturn [el, ...Array.from(el.children).filter((i) => i instanceof HTMLElement)];\n\t};\n\tconst { stop: stopResizeObserver } = useResizeObserver(targets, (entries, observer) => {\n\t\tconst el = targetEl.value;\n\t\tif (el) update(el);\n\t\tonResizeUpdated === null || onResizeUpdated === void 0 || onResizeUpdated(entries, observer);\n\t}, { window });\n\tlet stopMutationObserver;\n\tif (observeMutation) {\n\t\tconst onMutationUpdated = onUpdated;\n\t\tstopMutationObserver = useMutationObserver(targets, (entries, observer) => {\n\t\t\tconst el = targetEl.value;\n\t\t\tif (el) update(el);\n\t\t\tonMutationUpdated === null || onMutationUpdated === void 0 || onMutationUpdated(entries, observer);\n\t\t}, {\n\t\t\twindow,\n\t\t\t...typeof observeMutation === \"object\" ? observeMutation : {\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: true,\n\t\t\t\tcharacterData: true\n\t\t\t}\n\t\t}).stop;\n\t}\n\tfunction stop() {\n\t\tstopResizeObserver();\n\t\tstopMutationObserver === null || stopMutationObserver === void 0 || stopMutationObserver();\n\t}\n\treturn {\n\t\tisXOverflowed: shallowReadonly(isXOverflowed),\n\t\tisYOverflowed: shallowReadonly(isYOverflowed),\n\t\tstop,\n\t\tupdate: () => {\n\t\t\tconst el = targetEl.value;\n\t\t\tif (el && window) update(el);\n\t\t}\n\t};\n}\n// useElementSize/index.ts\n/**\n* Reactive size of an HTML element.\n*\n* @see https://vueuse.org/useElementSize\n*/\nfunction useElementSize(target, initialSize = {\n\twidth: 0,\n\theight: 0\n}, options = {}) {\n\tconst { window = defaultWindow, box = \"content-box\" } = options;\n\tconst isSVG = computed(() => {\n\t\tvar _unrefElement;\n\t\treturn (_unrefElement = unrefElement(target)) === null || _unrefElement === void 0 || (_unrefElement = _unrefElement.namespaceURI) === null || _unrefElement === void 0 ? void 0 : _unrefElement.includes(\"svg\");\n\t});\n\tconst width = shallowRef(initialSize.width);\n\tconst height = shallowRef(initialSize.height);\n\tconst { stop: stop1 } = useResizeObserver(target, ([entry]) => {\n\t\tconst boxSize = box === \"border-box\" ? entry.borderBoxSize : box === \"content-box\" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;\n\t\tif (window && isSVG.value) {\n\t\t\tconst $elem = unrefElement(target);\n\t\t\tif ($elem) {\n\t\t\t\tconst rect = $elem.getBoundingClientRect();\n\t\t\t\twidth.value = rect.width;\n\t\t\t\theight.value = rect.height;\n\t\t\t}\n\t\t} else if (boxSize) {\n\t\t\tconst formatBoxSize = toArray(boxSize);\n\t\t\twidth.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);\n\t\t\theight.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);\n\t\t} else {\n\t\t\twidth.value = entry.contentRect.width;\n\t\t\theight.value = entry.contentRect.height;\n\t\t}\n\t}, options);\n\tfunction measure() {\n\t\tconst ele = unrefElement(target);\n\t\tif (ele && \"offsetWidth\" in ele) {\n\t\t\tif (box === \"content-box\" && window) {\n\t\t\t\tconst cs = window.getComputedStyle(ele);\n\t\t\t\tconst padX = Number.parseFloat(cs.paddingLeft) + Number.parseFloat(cs.paddingRight);\n\t\t\t\tconst padY = Number.parseFloat(cs.paddingTop) + Number.parseFloat(cs.paddingBottom);\n\t\t\t\tconst bdX = Number.parseFloat(cs.borderLeftWidth) + Number.parseFloat(cs.borderRightWidth);\n\t\t\t\tconst bdY = Number.parseFloat(cs.borderTopWidth) + Number.parseFloat(cs.borderBottomWidth);\n\t\t\t\twidth.value = Math.max(0, ele.offsetWidth - padX - bdX);\n\t\t\t\theight.value = Math.max(0, ele.offsetHeight - padY - bdY);\n\t\t\t} else {\n\t\t\t\twidth.value = ele.offsetWidth;\n\t\t\t\theight.value = ele.offsetHeight;\n\t\t\t}\n\t\t} else if (ele) {\n\t\t\twidth.value = initialSize.width;\n\t\t\theight.value = initialSize.height;\n\t\t}\n\t}\n\ttryOnMounted(measure);\n\tconst stop2 = watch(() => unrefElement(target), (ele) => {\n\t\tif (ele) measure();\n\t\telse {\n\t\t\twidth.value = 0;\n\t\t\theight.value = 0;\n\t\t}\n\t});\n\tfunction stop() {\n\t\tstop1();\n\t\tstop2();\n\t}\n\treturn {\n\t\twidth,\n\t\theight,\n\t\tstop\n\t};\n}\n// useIntersectionObserver/index.ts\n/**\n* Detects changes to a target element's visibility.\n*\n* @see https://vueuse.org/useIntersectionObserver\n* @param target\n* @param callback\n* @param options\n*/\nfunction useIntersectionObserver(target, callback, options = {}) {\n\tconst { root, rootMargin, threshold = 0, window = defaultWindow, immediate = true } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"IntersectionObserver\" in window);\n\tconst targets = computed(() => {\n\t\tconst _target = toValue(target);\n\t\treturn toArray(_target).map(unrefElement).filter(notNullish);\n\t});\n\tlet cleanup = noop;\n\tconst isActive = shallowRef(immediate);\n\tconst stopWatch = isSupported.value ? watch(() => [\n\t\ttargets.value,\n\t\tunrefElement(root),\n\t\ttoValue(rootMargin),\n\t\tisActive.value\n\t], ([targets, root, rootMargin]) => {\n\t\tcleanup();\n\t\tif (!isActive.value) return;\n\t\tif (!targets.length) return;\n\t\tconst observer = new IntersectionObserver(callback, {\n\t\t\troot: unrefElement(root),\n\t\t\trootMargin,\n\t\t\tthreshold\n\t\t});\n\t\ttargets.forEach((el) => el && observer.observe(el));\n\t\tcleanup = () => {\n\t\t\tobserver.disconnect();\n\t\t\tcleanup = noop;\n\t\t};\n\t}, {\n\t\timmediate,\n\t\tflush: \"post\"\n\t}) : noop;\n\tconst stop = () => {\n\t\tcleanup();\n\t\tstopWatch();\n\t\tisActive.value = false;\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tisActive,\n\t\tpause() {\n\t\t\tcleanup();\n\t\t\tisActive.value = false;\n\t\t},\n\t\tresume() {\n\t\t\tisActive.value = true;\n\t\t},\n\t\tstop\n\t};\n}\n// useElementVisibility/index.ts\nfunction useElementVisibility(element, options = {}) {\n\tconst { window = defaultWindow, scrollTarget, threshold = 0, rootMargin, once = false, initialValue = false } = options;\n\tconst isVisible = shallowRef(initialValue);\n\tconst observerController = useIntersectionObserver(element, (intersectionObserverEntries) => {\n\t\tlet isIntersecting = isVisible.value;\n\t\tlet latestTime = 0;\n\t\tfor (const entry of intersectionObserverEntries) if (entry.time >= latestTime) {\n\t\t\tlatestTime = entry.time;\n\t\t\tisIntersecting = entry.isIntersecting;\n\t\t}\n\t\tisVisible.value = isIntersecting;\n\t\tif (once) watchOnce(isVisible, () => {\n\t\t\tobserverController.stop();\n\t\t});\n\t}, {\n\t\troot: scrollTarget,\n\t\twindow,\n\t\tthreshold,\n\t\trootMargin\n\t});\n\treturn options.controls ? {\n\t\t...observerController,\n\t\tisVisible\n\t} : isVisible;\n}\n// useEventBus/internal.ts\nconst events = /* @__PURE__ */ new Map();\n// useEventBus/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useEventBus(key) {\n\tfunction on(listener) {\n\t\tconst listeners = events.get(key) || /* @__PURE__ */ new Set();\n\t\tlisteners.add(listener);\n\t\tevents.set(key, listeners);\n\t\tconst _off = () => off(listener);\n\t\ttryOnScopeDispose(_off);\n\t\treturn _off;\n\t}\n\tfunction once(listener) {\n\t\tfunction _listener(...args) {\n\t\t\toff(_listener);\n\t\t\tlistener(...args);\n\t\t}\n\t\treturn on(_listener);\n\t}\n\tfunction off(listener) {\n\t\tconst listeners = events.get(key);\n\t\tif (!listeners) return;\n\t\tlisteners.delete(listener);\n\t\tif (!listeners.size) reset();\n\t}\n\tfunction reset() {\n\t\tevents.delete(key);\n\t}\n\tfunction emit(event, payload) {\n\t\tvar _events$get;\n\t\t(_events$get = events.get(key)) === null || _events$get === void 0 || _events$get.forEach((v) => v(event, payload));\n\t}\n\treturn {\n\t\ton,\n\t\tonce,\n\t\toff,\n\t\temit,\n\t\treset\n\t};\n}\n// useEventSource/index.ts\nfunction resolveNestedOptions$1(options) {\n\tif (options === true) return {};\n\treturn options;\n}\nconst DEFAULT_EVENT = \"message\";\n/**\n* Reactive wrapper for EventSource.\n*\n* @see https://vueuse.org/useEventSource\n* @see https://developer.mozilla.org/en-US/docs/Web/API/EventSource/EventSource EventSource\n* @param url\n* @param events\n* @param options\n*/\nfunction useEventSource(url, events = [], options = {}) {\n\tconst event = shallowRef(null);\n\tconst data = shallowRef(null);\n\tconst status = shallowRef(\"CONNECTING\");\n\tconst eventSource = shallowRef(null);\n\tconst error = shallowRef(null);\n\tconst urlRef = toRef(url);\n\tconst lastEventId = shallowRef(null);\n\tlet explicitlyClosed = false;\n\tlet retried = 0;\n\tconst { withCredentials = false, immediate = true, autoConnect = true, autoReconnect, serializer = { read: (v) => v } } = options;\n\tconst close = () => {\n\t\tif (isClient && eventSource.value) {\n\t\t\teventSource.value.close();\n\t\t\teventSource.value = null;\n\t\t\tstatus.value = \"CLOSED\";\n\t\t\texplicitlyClosed = true;\n\t\t}\n\t};\n\tconst _init = () => {\n\t\tif (explicitlyClosed || typeof urlRef.value === \"undefined\") return;\n\t\tconst es = new EventSource(urlRef.value, { withCredentials });\n\t\tstatus.value = \"CONNECTING\";\n\t\teventSource.value = es;\n\t\tes.onopen = () => {\n\t\t\tif (eventSource.value !== es) return;\n\t\t\tstatus.value = \"OPEN\";\n\t\t\terror.value = null;\n\t\t};\n\t\tes.onerror = (e) => {\n\t\t\tif (eventSource.value !== es) return;\n\t\t\tstatus.value = \"CLOSED\";\n\t\t\terror.value = e;\n\t\t\tif (es.readyState === 2 && !explicitlyClosed && autoReconnect) {\n\t\t\t\tes.close();\n\t\t\t\tconst { retries = -1, delay = 1e3, onFailed } = resolveNestedOptions$1(autoReconnect);\n\t\t\t\tretried += 1;\n\t\t\t\tif (typeof retries === \"number\" && (retries < 0 || retried < retries)) setTimeout(_init, delay);\n\t\t\t\telse if (typeof retries === \"function\" && retries()) setTimeout(_init, delay);\n\t\t\t\telse onFailed === null || onFailed === void 0 || onFailed();\n\t\t\t}\n\t\t};\n\t\tevents = events.length > 0 ? events : [DEFAULT_EVENT];\n\t\tfor (const event_name of events) useEventListener(es, event_name, (e) => {\n\t\t\tvar _serializer$read, _e$lastEventId;\n\t\t\tif (eventSource.value !== es) return;\n\t\t\tevent.value = event_name;\n\t\t\tdata.value = (_serializer$read = serializer.read(e.data)) !== null && _serializer$read !== void 0 ? _serializer$read : null;\n\t\t\tlastEventId.value = (_e$lastEventId = e.lastEventId) !== null && _e$lastEventId !== void 0 ? _e$lastEventId : null;\n\t\t}, { passive: true });\n\t};\n\tconst open = () => {\n\t\tif (!isClient) return;\n\t\tclose();\n\t\texplicitlyClosed = false;\n\t\tretried = 0;\n\t\t_init();\n\t};\n\tif (immediate) open();\n\tif (autoConnect) watch(urlRef, open);\n\ttryOnScopeDispose(close);\n\treturn {\n\t\teventSource,\n\t\tevent,\n\t\tdata,\n\t\tstatus,\n\t\terror,\n\t\topen,\n\t\tclose,\n\t\tlastEventId\n\t};\n}\n// useEyeDropper/index.ts\n/**\n* Reactive [EyeDropper API](https://developer.mozilla.org/en-US/docs/Web/API/EyeDropper_API)\n*\n* @see https://vueuse.org/useEyeDropper\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useEyeDropper(options = {}) {\n\tconst { initialValue = \"\" } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof window !== \"undefined\" && \"EyeDropper\" in window);\n\tconst sRGBHex = shallowRef(initialValue);\n\tasync function open(openOptions) {\n\t\tif (!isSupported.value) return;\n\t\tconst result = await new window.EyeDropper().open(openOptions);\n\t\tsRGBHex.value = result.sRGBHex;\n\t\treturn result;\n\t}\n\treturn {\n\t\tisSupported,\n\t\tsRGBHex,\n\t\topen\n\t};\n}\n// useFavicon/index.ts\nfunction useFavicon(newIcon = null, options = {}) {\n\tconst { baseUrl = \"\", rel = \"icon\", document = defaultDocument } = options;\n\tconst favicon = toRef(newIcon);\n\tconst applyIcon = (icon) => {\n\t\tconst elements = document === null || document === void 0 ? void 0 : document.head.querySelectorAll(`link[rel*=\"${rel}\"]`);\n\t\tif (!elements || elements.length === 0) {\n\t\t\tconst link = document === null || document === void 0 ? void 0 : document.createElement(\"link\");\n\t\t\tif (link) {\n\t\t\t\tlink.rel = rel;\n\t\t\t\tlink.href = `${baseUrl}${icon}`;\n\t\t\t\tlink.type = `image/${icon.split(\".\").pop()}`;\n\t\t\t\tdocument === null || document === void 0 || document.head.append(link);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\telements === null || elements === void 0 || elements.forEach((el) => el.href = `${baseUrl}${icon}`);\n\t};\n\twatch(favicon, (i, o) => {\n\t\tif (typeof i === \"string\" && i !== o) applyIcon(i);\n\t}, { immediate: true });\n\treturn favicon;\n}\n// useFetch/index.ts\nconst payloadMapping = {\n\tjson: \"application/json\",\n\ttext: \"text/plain\"\n};\n/**\n* !!!IMPORTANT!!!\n*\n* If you update the UseFetchOptions interface, be sure to update this object\n* to include the new options\n*/\nfunction isFetchOptions(obj) {\n\treturn obj && containsProp(obj, \"immediate\", \"refetch\", \"initialData\", \"timeout\", \"beforeFetch\", \"afterFetch\", \"onFetchError\", \"fetch\", \"updateDataOnError\");\n}\nconst reAbsolute = /^(?:[a-z][a-z\\d+\\-.]*:)?\\/\\//i;\nfunction isAbsoluteURL(url) {\n\treturn reAbsolute.test(url);\n}\nfunction headersToObject(headers) {\n\tif (typeof Headers !== \"undefined\" && headers instanceof Headers) return Object.fromEntries(headers.entries());\n\treturn headers;\n}\nfunction combineCallbacks(combination, ...callbacks) {\n\tif (combination === \"overwrite\") return async (ctx) => {\n\t\tlet callback;\n\t\tfor (let i = callbacks.length - 1; i >= 0; i--) if (callbacks[i] != null) {\n\t\t\tcallback = callbacks[i];\n\t\t\tbreak;\n\t\t}\n\t\tif (callback) return {\n\t\t\t...ctx,\n\t\t\t...await callback(ctx)\n\t\t};\n\t\treturn ctx;\n\t};\n\telse return async (ctx) => {\n\t\tfor (const callback of callbacks) if (callback) ctx = {\n\t\t\t...ctx,\n\t\t\t...await callback(ctx)\n\t\t};\n\t\treturn ctx;\n\t};\n}\nfunction createFetch(config = {}) {\n\tconst _combination = config.combination || \"chain\";\n\tconst _options = config.options || {};\n\tconst _fetchOptions = config.fetchOptions || {};\n\tfunction useFactoryFetch(url, ...args) {\n\t\tconst computedUrl = computed(() => {\n\t\t\tconst baseUrl = toValue(config.baseUrl);\n\t\t\tconst targetUrl = toValue(url);\n\t\t\treturn baseUrl && !isAbsoluteURL(targetUrl) ? joinPaths(baseUrl, targetUrl) : targetUrl;\n\t\t});\n\t\tlet options = _options;\n\t\tlet fetchOptions = _fetchOptions;\n\t\tif (args.length > 0) {\n\t\t\tif (isFetchOptions(args[0])) options = {\n\t\t\t\t...options,\n\t\t\t\t...args[0],\n\t\t\t\tbeforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[0].beforeFetch),\n\t\t\t\tafterFetch: combineCallbacks(_combination, _options.afterFetch, args[0].afterFetch),\n\t\t\t\tonFetchError: combineCallbacks(_combination, _options.onFetchError, args[0].onFetchError)\n\t\t\t};\n\t\t\telse fetchOptions = {\n\t\t\t\t...fetchOptions,\n\t\t\t\t...args[0],\n\t\t\t\theaders: {\n\t\t\t\t\t...headersToObject(fetchOptions.headers) || {},\n\t\t\t\t\t...headersToObject(args[0].headers) || {}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tif (args.length > 1 && isFetchOptions(args[1])) options = {\n\t\t\t...options,\n\t\t\t...args[1],\n\t\t\tbeforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[1].beforeFetch),\n\t\t\tafterFetch: combineCallbacks(_combination, _options.afterFetch, args[1].afterFetch),\n\t\t\tonFetchError: combineCallbacks(_combination, _options.onFetchError, args[1].onFetchError)\n\t\t};\n\t\treturn useFetch(computedUrl, fetchOptions, options);\n\t}\n\treturn useFactoryFetch;\n}\nfunction useFetch(url, ...args) {\n\tvar _defaultWindow$fetch, _globalThis;\n\tconst supportsAbort = typeof AbortController === \"function\";\n\tlet fetchOptions = {};\n\tlet options = {\n\t\timmediate: true,\n\t\trefetch: false,\n\t\ttimeout: 0,\n\t\tupdateDataOnError: false\n\t};\n\tconst config = {\n\t\tmethod: \"GET\",\n\t\ttype: \"text\",\n\t\tpayload: void 0\n\t};\n\tif (args.length > 0) {\n\t\tif (isFetchOptions(args[0])) options = {\n\t\t\t...options,\n\t\t\t...args[0]\n\t\t};\n\t\telse fetchOptions = args[0];\n\t}\n\tif (args.length > 1) {\n\t\tif (isFetchOptions(args[1])) options = {\n\t\t\t...options,\n\t\t\t...args[1]\n\t\t};\n\t}\n\tconst { fetch = (_defaultWindow$fetch = defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.fetch) !== null && _defaultWindow$fetch !== void 0 ? _defaultWindow$fetch : (_globalThis = globalThis) === null || _globalThis === void 0 ? void 0 : _globalThis.fetch, initialData, timeout } = options;\n\tconst responseEvent = createEventHook();\n\tconst errorEvent = createEventHook();\n\tconst finallyEvent = createEventHook();\n\tconst isFinished = shallowRef(false);\n\tconst isFetching = shallowRef(false);\n\tconst aborted = shallowRef(false);\n\tconst statusCode = shallowRef(null);\n\tconst response = shallowRef(null);\n\tconst error = shallowRef(null);\n\tconst data = shallowRef(initialData || null);\n\tconst canAbort = computed(() => supportsAbort && isFetching.value);\n\tlet controller;\n\tlet timer;\n\tconst abort = (reason) => {\n\t\tif (supportsAbort) {\n\t\t\tcontroller === null || controller === void 0 || controller.abort(reason);\n\t\t\tcontroller = new AbortController();\n\t\t\tcontroller.signal.onabort = () => aborted.value = true;\n\t\t\tfetchOptions = {\n\t\t\t\t...fetchOptions,\n\t\t\t\tsignal: controller.signal\n\t\t\t};\n\t\t}\n\t};\n\tconst loading = (isLoading) => {\n\t\tisFetching.value = isLoading;\n\t\tisFinished.value = !isLoading;\n\t};\n\tif (timeout) timer = useTimeoutFn(abort, timeout, { immediate: false });\n\tlet executeCounter = 0;\n\tconst execute = async (throwOnFailed = false) => {\n\t\tvar _context$options;\n\t\tabort();\n\t\tloading(true);\n\t\terror.value = null;\n\t\tstatusCode.value = null;\n\t\taborted.value = false;\n\t\texecuteCounter += 1;\n\t\tconst currentExecuteCounter = executeCounter;\n\t\tconst defaultFetchOptions = {\n\t\t\tmethod: config.method,\n\t\t\theaders: {}\n\t\t};\n\t\tconst payload = toValue(config.payload);\n\t\tif (payload) {\n\t\t\tvar _payloadMapping$confi;\n\t\t\tconst headers = headersToObject(defaultFetchOptions.headers);\n\t\t\tconst proto = Object.getPrototypeOf(payload);\n\t\t\tif (!config.payloadType && payload && (proto === Object.prototype || Array.isArray(proto)) && !(payload instanceof FormData)) config.payloadType = \"json\";\n\t\t\tif (config.payloadType) headers[\"Content-Type\"] = (_payloadMapping$confi = payloadMapping[config.payloadType]) !== null && _payloadMapping$confi !== void 0 ? _payloadMapping$confi : config.payloadType;\n\t\t\tdefaultFetchOptions.body = config.payloadType === \"json\" ? JSON.stringify(payload) : payload;\n\t\t}\n\t\tlet isCanceled = false;\n\t\tconst context = {\n\t\t\turl: toValue(url),\n\t\t\toptions: {\n\t\t\t\t...defaultFetchOptions,\n\t\t\t\t...fetchOptions\n\t\t\t},\n\t\t\tcancel: () => {\n\t\t\t\tisCanceled = true;\n\t\t\t}\n\t\t};\n\t\tif (options.beforeFetch) Object.assign(context, await options.beforeFetch(context));\n\t\tif (isCanceled || !fetch) {\n\t\t\tloading(false);\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\t\tlet responseData = null;\n\t\tif (timer) timer.start();\n\t\treturn fetch(context.url, {\n\t\t\t...defaultFetchOptions,\n\t\t\t...context.options,\n\t\t\theaders: {\n\t\t\t\t...headersToObject(defaultFetchOptions.headers),\n\t\t\t\t...headersToObject((_context$options = context.options) === null || _context$options === void 0 ? void 0 : _context$options.headers)\n\t\t\t}\n\t\t}).then(async (fetchResponse) => {\n\t\t\tif (currentExecuteCounter === executeCounter) {\n\t\t\t\tresponse.value = fetchResponse;\n\t\t\t\tstatusCode.value = fetchResponse.status;\n\t\t\t}\n\t\t\tresponseData = await fetchResponse.clone()[config.type]();\n\t\t\tif (!fetchResponse.ok) {\n\t\t\t\tif (currentExecuteCounter === executeCounter) data.value = initialData || null;\n\t\t\t\tthrow new Error(fetchResponse.statusText);\n\t\t\t}\n\t\t\tif (options.afterFetch) ({data: responseData} = await options.afterFetch({\n\t\t\t\tdata: responseData,\n\t\t\t\tresponse: fetchResponse,\n\t\t\t\tcontext,\n\t\t\t\texecute\n\t\t\t}));\n\t\t\tif (currentExecuteCounter === executeCounter) data.value = responseData;\n\t\t\tresponseEvent.trigger(fetchResponse);\n\t\t\treturn fetchResponse;\n\t\t}).catch(async (fetchError) => {\n\t\t\tlet errorData = fetchError.message || fetchError.name;\n\t\t\tif (options.onFetchError) ({error: errorData, data: responseData} = await options.onFetchError({\n\t\t\t\tdata: responseData,\n\t\t\t\terror: fetchError,\n\t\t\t\tresponse: response.value,\n\t\t\t\tcontext,\n\t\t\t\texecute\n\t\t\t}));\n\t\t\tif (currentExecuteCounter === executeCounter) {\n\t\t\t\terror.value = errorData;\n\t\t\t\tif (options.updateDataOnError) data.value = responseData;\n\t\t\t}\n\t\t\terrorEvent.trigger(fetchError);\n\t\t\tif (throwOnFailed) throw fetchError;\n\t\t\treturn null;\n\t\t}).finally(() => {\n\t\t\tif (currentExecuteCounter === executeCounter) loading(false);\n\t\t\tif (timer) timer.stop();\n\t\t\tfinallyEvent.trigger(null);\n\t\t});\n\t};\n\tconst refetch = toRef(options.refetch);\n\twatch([refetch, toRef(url)], ([refetch]) => refetch && execute(), { deep: true });\n\tconst shell = {\n\t\tisFinished: shallowReadonly(isFinished),\n\t\tisFetching: shallowReadonly(isFetching),\n\t\tstatusCode,\n\t\tresponse,\n\t\terror,\n\t\tdata,\n\t\tcanAbort,\n\t\taborted,\n\t\tabort,\n\t\texecute,\n\t\tonFetchResponse: responseEvent.on,\n\t\tonFetchError: errorEvent.on,\n\t\tonFetchFinally: finallyEvent.on,\n\t\tget: setMethod(\"GET\"),\n\t\tput: setMethod(\"PUT\"),\n\t\tpost: setMethod(\"POST\"),\n\t\tdelete: setMethod(\"DELETE\"),\n\t\tpatch: setMethod(\"PATCH\"),\n\t\thead: setMethod(\"HEAD\"),\n\t\toptions: setMethod(\"OPTIONS\"),\n\t\tquery: setMethod(\"QUERY\"),\n\t\tjson: setType(\"json\"),\n\t\ttext: setType(\"text\"),\n\t\tblob: setType(\"blob\"),\n\t\tarrayBuffer: setType(\"arrayBuffer\"),\n\t\tformData: setType(\"formData\")\n\t};\n\tfunction setMethod(method) {\n\t\treturn (payload, payloadType) => {\n\t\t\tif (!isFetching.value) {\n\t\t\t\tconfig.method = method;\n\t\t\t\tconfig.payload = payload;\n\t\t\t\tconfig.payloadType = payloadType;\n\t\t\t\tif (isRef(config.payload)) watch([refetch, toRef(config.payload)], ([refetch]) => refetch && execute(), { deep: true });\n\t\t\t\treturn {\n\t\t\t\t\t...shell,\n\t\t\t\t\tthen(onFulfilled, onRejected) {\n\t\t\t\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tfunction waitUntilFinished() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuntil(isFinished).toBe(true).then(() => resolve(shell)).catch(reject);\n\t\t});\n\t}\n\tfunction setType(type) {\n\t\treturn () => {\n\t\t\tif (!isFetching.value) {\n\t\t\t\tconfig.type = type;\n\t\t\t\treturn {\n\t\t\t\t\t...shell,\n\t\t\t\t\tthen(onFulfilled, onRejected) {\n\t\t\t\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tif (options.immediate) Promise.resolve().then(() => execute());\n\treturn {\n\t\t...shell,\n\t\tthen(onFulfilled, onRejected) {\n\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t}\n\t};\n}\nfunction joinPaths(start, end) {\n\tif (!start.endsWith(\"/\") && !end.startsWith(\"/\")) return `${start}/${end}`;\n\tif (start.endsWith(\"/\") && end.startsWith(\"/\")) return `${start.slice(0, -1)}${end}`;\n\treturn `${start}${end}`;\n}\n// useFileDialog/index.ts\nconst DEFAULT_OPTIONS = {\n\tmultiple: true,\n\taccept: \"*\",\n\treset: false,\n\tdirectory: false\n};\nfunction prepareInitialFiles(files) {\n\tif (!files) return null;\n\tif (files instanceof FileList) return files;\n\tconst dt = new DataTransfer();\n\tfor (const file of files) dt.items.add(file);\n\treturn dt.files;\n}\n/**\n* Open file dialog with ease.\n*\n* @see https://vueuse.org/useFileDialog\n* @param options\n*/\nfunction useFileDialog(options = {}) {\n\tconst { document = defaultDocument } = options;\n\tconst files = ref(prepareInitialFiles(options.initialFiles));\n\tconst { on: onChange, trigger: changeTrigger } = createEventHook();\n\tconst { on: onCancel, trigger: cancelTrigger } = createEventHook();\n\tconst inputRef = computed(() => {\n\t\tvar _unrefElement;\n\t\tconst input = (_unrefElement = unrefElement(options.input)) !== null && _unrefElement !== void 0 ? _unrefElement : document ? document.createElement(\"input\") : void 0;\n\t\tif (input) {\n\t\t\tinput.type = \"file\";\n\t\t\tinput.onchange = (event) => {\n\t\t\t\tconst result = event.target;\n\t\t\t\tfiles.value = result.files;\n\t\t\t\tchangeTrigger(files.value);\n\t\t\t};\n\t\t\tinput.oncancel = () => {\n\t\t\t\tcancelTrigger();\n\t\t\t};\n\t\t}\n\t\treturn input;\n\t});\n\tconst reset = () => {\n\t\tfiles.value = null;\n\t\tif (inputRef.value && inputRef.value.value) {\n\t\t\tinputRef.value.value = \"\";\n\t\t\tchangeTrigger(null);\n\t\t}\n\t};\n\tconst applyOptions = (options) => {\n\t\tconst el = inputRef.value;\n\t\tif (!el) return;\n\t\tel.multiple = toValue(options.multiple);\n\t\tel.accept = toValue(options.accept);\n\t\tel.webkitdirectory = toValue(options.directory);\n\t\tif (hasOwn(options, \"capture\")) el.capture = toValue(options.capture);\n\t};\n\tconst open = (localOptions) => {\n\t\tconst el = inputRef.value;\n\t\tif (!el) return;\n\t\tconst mergedOptions = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t\t...options,\n\t\t\t...localOptions\n\t\t};\n\t\tapplyOptions(mergedOptions);\n\t\tif (toValue(mergedOptions.reset)) reset();\n\t\tel.click();\n\t};\n\twatchEffect(() => {\n\t\tapplyOptions(options);\n\t});\n\treturn {\n\t\tfiles: readonly(files),\n\t\topen,\n\t\treset,\n\t\tonCancel,\n\t\tonChange\n\t};\n}\n// useFileSystemAccess/index.ts\nfunction useFileSystemAccess(options = {}) {\n\tconst { window: _window = defaultWindow, dataType = \"Text\" } = options;\n\tconst window = _window;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"showSaveFilePicker\" in window && \"showOpenFilePicker\" in window);\n\tconst fileHandle = shallowRef();\n\tconst data = shallowRef();\n\tconst file = shallowRef();\n\tconst fileName = computed(() => {\n\t\tvar _file$value$name, _file$value;\n\t\treturn (_file$value$name = (_file$value = file.value) === null || _file$value === void 0 ? void 0 : _file$value.name) !== null && _file$value$name !== void 0 ? _file$value$name : \"\";\n\t});\n\tconst fileMIME = computed(() => {\n\t\tvar _file$value$type, _file$value2;\n\t\treturn (_file$value$type = (_file$value2 = file.value) === null || _file$value2 === void 0 ? void 0 : _file$value2.type) !== null && _file$value$type !== void 0 ? _file$value$type : \"\";\n\t});\n\tconst fileSize = computed(() => {\n\t\tvar _file$value$size, _file$value3;\n\t\treturn (_file$value$size = (_file$value3 = file.value) === null || _file$value3 === void 0 ? void 0 : _file$value3.size) !== null && _file$value$size !== void 0 ? _file$value$size : 0;\n\t});\n\tconst fileLastModified = computed(() => {\n\t\tvar _file$value$lastModif, _file$value4;\n\t\treturn (_file$value$lastModif = (_file$value4 = file.value) === null || _file$value4 === void 0 ? void 0 : _file$value4.lastModified) !== null && _file$value$lastModif !== void 0 ? _file$value$lastModif : 0;\n\t});\n\tasync function open(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tconst [handle] = await window.showOpenFilePicker({\n\t\t\t...toValue(options),\n\t\t\t..._options\n\t\t});\n\t\tfileHandle.value = handle;\n\t\tawait updateData();\n\t}\n\tasync function create(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tfileHandle.value = await window.showSaveFilePicker({\n\t\t\t...options,\n\t\t\t..._options\n\t\t});\n\t\tdata.value = void 0;\n\t\tawait updateData();\n\t}\n\tasync function save(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tif (!fileHandle.value) return saveAs(_options);\n\t\tif (data.value) {\n\t\t\tconst writableStream = await fileHandle.value.createWritable();\n\t\t\tawait writableStream.write(data.value);\n\t\t\tawait writableStream.close();\n\t\t}\n\t\tawait updateFile();\n\t}\n\tasync function saveAs(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tfileHandle.value = await window.showSaveFilePicker({\n\t\t\t...options,\n\t\t\t..._options\n\t\t});\n\t\tif (data.value) {\n\t\t\tconst writableStream = await fileHandle.value.createWritable();\n\t\t\tawait writableStream.write(data.value);\n\t\t\tawait writableStream.close();\n\t\t}\n\t\tawait updateFile();\n\t}\n\tasync function updateFile() {\n\t\tvar _fileHandle$value;\n\t\tfile.value = await ((_fileHandle$value = fileHandle.value) === null || _fileHandle$value === void 0 ? void 0 : _fileHandle$value.getFile());\n\t}\n\tasync function updateData() {\n\t\tvar _file$value5, _file$value6;\n\t\tawait updateFile();\n\t\tconst type = toValue(dataType);\n\t\tif (type === \"Text\") data.value = await ((_file$value5 = file.value) === null || _file$value5 === void 0 ? void 0 : _file$value5.text());\n\t\telse if (type === \"ArrayBuffer\") data.value = await ((_file$value6 = file.value) === null || _file$value6 === void 0 ? void 0 : _file$value6.arrayBuffer());\n\t\telse if (type === \"Blob\") data.value = file.value;\n\t}\n\twatch(() => toValue(dataType), updateData);\n\treturn {\n\t\tisSupported,\n\t\tdata,\n\t\tfile,\n\t\tfileName,\n\t\tfileMIME,\n\t\tfileSize,\n\t\tfileLastModified,\n\t\topen,\n\t\tcreate,\n\t\tsave,\n\t\tsaveAs,\n\t\tupdateData\n\t};\n}\n// useFocus/index.ts\n/**\n* Track or set the focus state of a DOM element.\n*\n* @see https://vueuse.org/useFocus\n* @param target The target element for the focus and blur events.\n* @param options\n*/\nfunction useFocus(target, options = {}) {\n\tconst { initialValue = false, focusVisible = false, preventScroll = false } = options;\n\tconst innerFocused = shallowRef(false);\n\tconst targetElement = computed(() => unrefElement(target));\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(targetElement, \"focus\", (event) => {\n\t\tvar _matches, _ref;\n\t\tif (!focusVisible || ((_matches = (_ref = event.target).matches) === null || _matches === void 0 ? void 0 : _matches.call(_ref, \":focus-visible\"))) innerFocused.value = true;\n\t}, listenerOptions);\n\tuseEventListener(targetElement, \"blur\", () => innerFocused.value = false, listenerOptions);\n\tconst focused = computed({\n\t\tget: () => innerFocused.value,\n\t\tset(value) {\n\t\t\tvar _targetElement$value, _targetElement$value2;\n\t\t\tif (!value && innerFocused.value) (_targetElement$value = targetElement.value) === null || _targetElement$value === void 0 || _targetElement$value.blur();\n\t\t\telse if (value && !innerFocused.value) (_targetElement$value2 = targetElement.value) === null || _targetElement$value2 === void 0 || _targetElement$value2.focus({ preventScroll });\n\t\t}\n\t});\n\twatch(targetElement, () => {\n\t\tfocused.value = initialValue;\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\treturn { focused };\n}\n// useFocusWithin/index.ts\nconst EVENT_FOCUS_IN = \"focusin\";\nconst EVENT_FOCUS_OUT = \"focusout\";\nconst PSEUDO_CLASS_FOCUS_WITHIN = \":focus-within\";\n/**\n* Track if focus is contained within the target element\n*\n* @see https://vueuse.org/useFocusWithin\n* @param target The target element to track\n* @param options Focus within options\n*/\nfunction useFocusWithin(target, options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst targetElement = computed(() => unrefElement(target));\n\tconst _focused = shallowRef(false);\n\tconst focused = computed(() => _focused.value);\n\tconst activeElement = useActiveElement(options);\n\tif (!window || !activeElement.value) return { focused };\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(targetElement, EVENT_FOCUS_IN, () => _focused.value = true, listenerOptions);\n\tuseEventListener(targetElement, EVENT_FOCUS_OUT, () => {\n\t\tvar _targetElement$value$, _targetElement$value, _targetElement$value$2;\n\t\treturn _focused.value = (_targetElement$value$ = (_targetElement$value = targetElement.value) === null || _targetElement$value === void 0 || (_targetElement$value$2 = _targetElement$value.matches) === null || _targetElement$value$2 === void 0 ? void 0 : _targetElement$value$2.call(_targetElement$value, PSEUDO_CLASS_FOCUS_WITHIN)) !== null && _targetElement$value$ !== void 0 ? _targetElement$value$ : false;\n\t}, listenerOptions);\n\treturn { focused };\n}\n// useFps/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useFps(options) {\n\tvar _options$every;\n\tconst fps = shallowRef(0);\n\tif (typeof performance === \"undefined\") return fps;\n\tconst every = (_options$every = options === null || options === void 0 ? void 0 : options.every) !== null && _options$every !== void 0 ? _options$every : 10;\n\tlet last = performance.now();\n\tlet ticks = 0;\n\tuseRafFn(() => {\n\t\tticks += 1;\n\t\tif (ticks >= every) {\n\t\t\tconst now = performance.now();\n\t\t\tconst diff = now - last;\n\t\t\tfps.value = Math.round(1e3 / (diff / ticks));\n\t\t\tlast = now;\n\t\t\tticks = 0;\n\t\t}\n\t});\n\treturn fps;\n}\n// useFullscreen/index.ts\nconst eventHandlers = [\n\t\"fullscreenchange\",\n\t\"webkitfullscreenchange\",\n\t\"webkitendfullscreen\",\n\t\"mozfullscreenchange\",\n\t\"MSFullscreenChange\"\n];\n/**\n* Reactive Fullscreen API.\n*\n* @see https://vueuse.org/useFullscreen\n* @param target\n* @param options\n*/\nfunction useFullscreen(target, options = {}) {\n\tconst { document = defaultDocument, autoExit = false } = options;\n\tconst targetRef = computed(() => {\n\t\tvar _unrefElement;\n\t\treturn (_unrefElement = unrefElement(target)) !== null && _unrefElement !== void 0 ? _unrefElement : document === null || document === void 0 ? void 0 : document.documentElement;\n\t});\n\tconst isFullscreen = shallowRef(false);\n\tconst requestMethod = computed(() => {\n\t\treturn [\n\t\t\t\"requestFullscreen\",\n\t\t\t\"webkitRequestFullscreen\",\n\t\t\t\"webkitEnterFullscreen\",\n\t\t\t\"webkitEnterFullScreen\",\n\t\t\t\"webkitRequestFullScreen\",\n\t\t\t\"mozRequestFullScreen\",\n\t\t\t\"msRequestFullscreen\"\n\t\t].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n\t});\n\tconst exitMethod = computed(() => {\n\t\treturn [\n\t\t\t\"exitFullscreen\",\n\t\t\t\"webkitExitFullscreen\",\n\t\t\t\"webkitExitFullScreen\",\n\t\t\t\"webkitCancelFullScreen\",\n\t\t\t\"mozCancelFullScreen\",\n\t\t\t\"msExitFullscreen\"\n\t\t].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n\t});\n\tconst fullscreenEnabled = computed(() => {\n\t\treturn [\n\t\t\t\"fullScreen\",\n\t\t\t\"webkitIsFullScreen\",\n\t\t\t\"webkitDisplayingFullscreen\",\n\t\t\t\"mozFullScreen\",\n\t\t\t\"msFullscreenElement\"\n\t\t].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n\t});\n\tconst fullscreenElementMethod = [\n\t\t\"fullscreenElement\",\n\t\t\"webkitFullscreenElement\",\n\t\t\"mozFullScreenElement\",\n\t\t\"msFullscreenElement\"\n\t].find((m) => document && m in document);\n\tconst isSupported = /* @__PURE__ */ useSupported(() => targetRef.value && document && requestMethod.value !== void 0 && exitMethod.value !== void 0 && fullscreenEnabled.value !== void 0);\n\tconst isCurrentElementFullScreen = () => {\n\t\tif (fullscreenElementMethod) return (document === null || document === void 0 ? void 0 : document[fullscreenElementMethod]) === targetRef.value;\n\t\treturn false;\n\t};\n\tconst isElementFullScreen = () => {\n\t\tif (fullscreenEnabled.value) {\n\t\t\tif (document && document[fullscreenEnabled.value] != null) return document[fullscreenEnabled.value];\n\t\t\telse {\n\t\t\t\tconst target = targetRef.value;\n\t\t\t\tif ((target === null || target === void 0 ? void 0 : target[fullscreenEnabled.value]) != null) return Boolean(target[fullscreenEnabled.value]);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t};\n\tasync function exit() {\n\t\tif (!isSupported.value || !isFullscreen.value) return;\n\t\tif (exitMethod.value) {\n\t\t\tif ((document === null || document === void 0 ? void 0 : document[exitMethod.value]) != null) await document[exitMethod.value]();\n\t\t\telse {\n\t\t\t\tconst target = targetRef.value;\n\t\t\t\tif ((target === null || target === void 0 ? void 0 : target[exitMethod.value]) != null) await target[exitMethod.value]();\n\t\t\t}\n\t\t}\n\t\tisFullscreen.value = false;\n\t}\n\tasync function enter() {\n\t\tif (!isSupported.value || isFullscreen.value) return;\n\t\tif (isElementFullScreen()) await exit();\n\t\tconst target = targetRef.value;\n\t\tif (requestMethod.value && (target === null || target === void 0 ? void 0 : target[requestMethod.value]) != null) {\n\t\t\tawait target[requestMethod.value]();\n\t\t\tisFullscreen.value = true;\n\t\t}\n\t}\n\tasync function toggle() {\n\t\tawait (isFullscreen.value ? exit() : enter());\n\t}\n\tconst handlerCallback = () => {\n\t\tconst isElementFullScreenValue = isElementFullScreen();\n\t\tif (!isElementFullScreenValue || isElementFullScreenValue && isCurrentElementFullScreen()) isFullscreen.value = isElementFullScreenValue;\n\t};\n\tconst listenerOptions = {\n\t\tcapture: false,\n\t\tpassive: true\n\t};\n\tuseEventListener(document, eventHandlers, handlerCallback, listenerOptions);\n\tuseEventListener(() => unrefElement(targetRef), eventHandlers, handlerCallback, listenerOptions);\n\ttryOnMounted(handlerCallback, false);\n\tif (autoExit) tryOnScopeDispose(exit);\n\treturn {\n\t\tisSupported,\n\t\tisFullscreen,\n\t\tenter,\n\t\texit,\n\t\ttoggle\n\t};\n}\n// useGamepad/index.ts\n/**\n* Maps a standard standard gamepad to an Xbox 360 Controller.\n*/\nfunction mapGamepadToXbox360Controller(gamepad) {\n\treturn computed(() => {\n\t\tif (gamepad.value) return {\n\t\t\tbuttons: {\n\t\t\t\ta: gamepad.value.buttons[0],\n\t\t\t\tb: gamepad.value.buttons[1],\n\t\t\t\tx: gamepad.value.buttons[2],\n\t\t\t\ty: gamepad.value.buttons[3]\n\t\t\t},\n\t\t\tbumper: {\n\t\t\t\tleft: gamepad.value.buttons[4],\n\t\t\t\tright: gamepad.value.buttons[5]\n\t\t\t},\n\t\t\ttriggers: {\n\t\t\t\tleft: gamepad.value.buttons[6],\n\t\t\t\tright: gamepad.value.buttons[7]\n\t\t\t},\n\t\t\tstick: {\n\t\t\t\tleft: {\n\t\t\t\t\thorizontal: gamepad.value.axes[0],\n\t\t\t\t\tvertical: gamepad.value.axes[1],\n\t\t\t\t\tbutton: gamepad.value.buttons[10]\n\t\t\t\t},\n\t\t\t\tright: {\n\t\t\t\t\thorizontal: gamepad.value.axes[2],\n\t\t\t\t\tvertical: gamepad.value.axes[3],\n\t\t\t\t\tbutton: gamepad.value.buttons[11]\n\t\t\t\t}\n\t\t\t},\n\t\t\tdpad: {\n\t\t\t\tup: gamepad.value.buttons[12],\n\t\t\t\tdown: gamepad.value.buttons[13],\n\t\t\t\tleft: gamepad.value.buttons[14],\n\t\t\t\tright: gamepad.value.buttons[15]\n\t\t\t},\n\t\t\tback: gamepad.value.buttons[8],\n\t\t\tstart: gamepad.value.buttons[9]\n\t\t};\n\t\treturn null;\n\t});\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction useGamepad(options = {}) {\n\tconst { navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"getGamepads\" in navigator);\n\tconst gamepads = ref([]);\n\tconst onConnectedHook = createEventHook();\n\tconst onDisconnectedHook = createEventHook();\n\tconst stateFromGamepad = (gamepad) => {\n\t\tconst hapticActuators = [];\n\t\tconst vibrationActuator = \"vibrationActuator\" in gamepad ? gamepad.vibrationActuator : null;\n\t\tif (vibrationActuator) hapticActuators.push(vibrationActuator);\n\t\tif (gamepad.hapticActuators) hapticActuators.push(...gamepad.hapticActuators);\n\t\treturn {\n\t\t\tid: gamepad.id,\n\t\t\tindex: gamepad.index,\n\t\t\tconnected: gamepad.connected,\n\t\t\tmapping: gamepad.mapping,\n\t\t\ttimestamp: gamepad.timestamp,\n\t\t\tvibrationActuator: gamepad.vibrationActuator,\n\t\t\thapticActuators,\n\t\t\taxes: gamepad.axes.map((axes) => axes),\n\t\t\tbuttons: gamepad.buttons.map((button) => ({\n\t\t\t\tpressed: button.pressed,\n\t\t\t\ttouched: button.touched,\n\t\t\t\tvalue: button.value\n\t\t\t}))\n\t\t};\n\t};\n\tconst updateGamepadState = () => {\n\t\tconst _gamepads = (navigator === null || navigator === void 0 ? void 0 : navigator.getGamepads()) || [];\n\t\tfor (const gamepad of _gamepads) {\n\t\t\tif (!gamepad) continue;\n\t\t\tconst index = gamepads.value.findIndex((x) => x.index === gamepad.index);\n\t\t\tif (index > -1) gamepads.value[index] = stateFromGamepad(gamepad);\n\t\t}\n\t};\n\tconst { isActive, pause, resume } = useRafFn(updateGamepadState);\n\tconst onGamepadConnected = (gamepad) => {\n\t\tif (!gamepads.value.some(({ index }) => index === gamepad.index)) {\n\t\t\tgamepads.value.push(stateFromGamepad(gamepad));\n\t\t\tonConnectedHook.trigger(gamepad.index);\n\t\t}\n\t\tresume();\n\t};\n\tconst onGamepadDisconnected = (gamepad) => {\n\t\tgamepads.value = gamepads.value.filter((x) => x.index !== gamepad.index);\n\t\tonDisconnectedHook.trigger(gamepad.index);\n\t};\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(\"gamepadconnected\", (e) => onGamepadConnected(e.gamepad), listenerOptions);\n\tuseEventListener(\"gamepaddisconnected\", (e) => onGamepadDisconnected(e.gamepad), listenerOptions);\n\ttryOnMounted(() => {\n\t\tconst _gamepads = (navigator === null || navigator === void 0 ? void 0 : navigator.getGamepads()) || [];\n\t\tfor (const gamepad of _gamepads) if (gamepad && gamepads.value[gamepad.index]) onGamepadConnected(gamepad);\n\t});\n\tpause();\n\treturn {\n\t\tisSupported,\n\t\tonConnected: onConnectedHook.on,\n\t\tonDisconnected: onDisconnectedHook.on,\n\t\tgamepads,\n\t\tpause,\n\t\tresume,\n\t\tisActive\n\t};\n}\n// useGeolocation/index.ts\n/**\n* Reactive Geolocation API.\n*\n* @see https://vueuse.org/useGeolocation\n* @param options\n*/\nfunction useGeolocation(options = {}) {\n\tconst { enableHighAccuracy = true, maximumAge = 3e4, timeout = 27e3, navigator = defaultNavigator, immediate = true } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"geolocation\" in navigator);\n\tconst locatedAt = shallowRef(null);\n\tconst error = shallowRef(null);\n\tconst coords = shallowRef({\n\t\taccuracy: 0,\n\t\tlatitude: Number.POSITIVE_INFINITY,\n\t\tlongitude: Number.POSITIVE_INFINITY,\n\t\taltitude: null,\n\t\taltitudeAccuracy: null,\n\t\theading: null,\n\t\tspeed: null\n\t});\n\tfunction updatePosition(position) {\n\t\tlocatedAt.value = position.timestamp;\n\t\tcoords.value = position.coords;\n\t\terror.value = null;\n\t}\n\tlet watcher;\n\tfunction resume() {\n\t\tif (isSupported.value) watcher = navigator.geolocation.watchPosition(updatePosition, (err) => error.value = err, {\n\t\t\tenableHighAccuracy,\n\t\t\tmaximumAge,\n\t\t\ttimeout\n\t\t});\n\t}\n\tif (immediate) resume();\n\tfunction pause() {\n\t\tif (watcher && navigator) navigator.geolocation.clearWatch(watcher);\n\t}\n\ttryOnScopeDispose(() => {\n\t\tpause();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tcoords,\n\t\tlocatedAt,\n\t\terror,\n\t\tresume,\n\t\tpause\n\t};\n}\n// useIdle/index.ts\nconst defaultEvents$1 = [\n\t\"mousemove\",\n\t\"mousedown\",\n\t\"resize\",\n\t\"keydown\",\n\t\"touchstart\",\n\t\"wheel\"\n];\nconst oneMinute = 6e4;\n/**\n* Tracks whether the user is being inactive.\n*\n* @see https://vueuse.org/useIdle\n* @param timeout default to 1 minute\n* @param options IdleOptions\n*/\nfunction useIdle(timeout = oneMinute, options = {}) {\n\tconst { initialState = false, listenForVisibilityChange = true, events = defaultEvents$1, window = defaultWindow, eventFilter = throttleFilter(50) } = options;\n\tconst idle = shallowRef(initialState);\n\tconst lastActive = shallowRef(timestamp());\n\tconst isPending = shallowRef(false);\n\tlet timer;\n\tconst reset = (resetLastActive = false) => {\n\t\tif (resetLastActive) lastActive.value = timestamp();\n\t\tidle.value = false;\n\t\tclearTimeout(timer);\n\t\ttimer = setTimeout(() => idle.value = true, timeout);\n\t};\n\tconst onEvent = createFilterWrapper(eventFilter, () => reset(true));\n\tif (window) {\n\t\tconst document = window.document;\n\t\tconst listenerOptions = { passive: true };\n\t\tfor (const event of events) useEventListener(window, event, () => {\n\t\t\tif (!isPending.value) return;\n\t\t\tonEvent();\n\t\t}, listenerOptions);\n\t\tif (listenForVisibilityChange) useEventListener(document, \"visibilitychange\", () => {\n\t\t\tif (document.hidden || !isPending.value) return;\n\t\t\tonEvent();\n\t\t}, listenerOptions);\n\t\tstart();\n\t}\n\tfunction start() {\n\t\tif (isPending.value) return;\n\t\tisPending.value = true;\n\t\tif (!initialState) reset();\n\t}\n\tfunction stop() {\n\t\tidle.value = initialState;\n\t\tclearTimeout(timer);\n\t\tisPending.value = false;\n\t}\n\treturn {\n\t\tidle,\n\t\tlastActive,\n\t\treset,\n\t\tstop,\n\t\tstart,\n\t\tisPending: shallowReadonly(isPending)\n\t};\n}\n// useImage/index.ts\nasync function loadImage(options) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst img = new Image();\n\t\tconst { src, srcset, sizes, class: clazz, loading, crossorigin, referrerPolicy, width, height, decoding, fetchPriority, ismap, usemap } = options;\n\t\timg.src = src;\n\t\tif (srcset != null) img.srcset = srcset;\n\t\tif (sizes != null) img.sizes = sizes;\n\t\tif (clazz != null) img.className = clazz;\n\t\tif (loading != null) img.loading = loading;\n\t\tif (crossorigin != null) img.crossOrigin = crossorigin;\n\t\tif (referrerPolicy != null) img.referrerPolicy = referrerPolicy;\n\t\tif (width != null) img.width = width;\n\t\tif (height != null) img.height = height;\n\t\tif (decoding != null) img.decoding = decoding;\n\t\tif (fetchPriority != null) img.fetchPriority = fetchPriority;\n\t\tif (ismap != null) img.isMap = ismap;\n\t\tif (usemap != null) img.useMap = usemap;\n\t\timg.onload = () => resolve(img);\n\t\timg.onerror = reject;\n\t});\n}\n/**\n* Reactive load an image in the browser, you can wait the result to display it or show a fallback.\n*\n* @see https://vueuse.org/useImage\n* @param options Image attributes, as used in the <img> tag\n* @param asyncStateOptions\n*/\nfunction useImage(options, asyncStateOptions = {}) {\n\tconst state = useAsyncState(() => loadImage(toValue(options)), void 0, {\n\t\tresetOnExecute: true,\n\t\t...asyncStateOptions\n\t});\n\twatch(() => toValue(options), () => state.execute(asyncStateOptions.delay), { deep: true });\n\treturn state;\n}\n// _resolve-element.ts\n/**\n* Resolves an element from a given element, window, or document.\n*\n* @internal\n*/\nfunction resolveElement(el) {\n\tif (typeof Window !== \"undefined\" && el instanceof Window) return el.document.documentElement;\n\tif (typeof Document !== \"undefined\" && el instanceof Document) return el.documentElement;\n\treturn el;\n}\n// useScroll/index.ts\n/**\n* We have to check if the scroll amount is close enough to some threshold in order to\n* more accurately calculate arrivedState. This is because scrollTop/scrollLeft are non-rounded\n* numbers, while scrollHeight/scrollWidth and clientHeight/clientWidth are rounded.\n* https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#determine_if_an_element_has_been_totally_scrolled\n*/\nconst ARRIVED_STATE_THRESHOLD_PIXELS = 1;\n/**\n* Reactive scroll.\n*\n* @see https://vueuse.org/useScroll\n* @param element\n* @param options\n*/\nfunction useScroll(element, options = {}) {\n\tconst { throttle = 0, idle = 200, onStop = noop, onScroll = noop, offset = {\n\t\tleft: 0,\n\t\tright: 0,\n\t\ttop: 0,\n\t\tbottom: 0\n\t}, observe: _observe = { mutation: false }, eventListenerOptions = {\n\t\tcapture: false,\n\t\tpassive: true\n\t}, behavior = \"auto\", window = defaultWindow, onError = (e) => {\n\t\tconsole.error(e);\n\t} } = options;\n\tconst observe = typeof _observe === \"boolean\" ? { mutation: _observe } : _observe;\n\tconst internalX = shallowRef(0);\n\tconst internalY = shallowRef(0);\n\tconst x = computed({\n\t\tget() {\n\t\t\treturn internalX.value;\n\t\t},\n\t\tset(x) {\n\t\t\tscrollTo(x, void 0);\n\t\t}\n\t});\n\tconst y = computed({\n\t\tget() {\n\t\t\treturn internalY.value;\n\t\t},\n\t\tset(y) {\n\t\t\tscrollTo(void 0, y);\n\t\t}\n\t});\n\tfunction scrollTo(_x, _y) {\n\t\tvar _ref, _toValue, _toValue2, _document;\n\t\tif (!window) return;\n\t\tconst _element = toValue(element);\n\t\tif (!_element) return;\n\t\t(_ref = _element instanceof Document ? window.document.body : _element) === null || _ref === void 0 || _ref.scrollTo({\n\t\t\ttop: (_toValue = toValue(_y)) !== null && _toValue !== void 0 ? _toValue : y.value,\n\t\t\tleft: (_toValue2 = toValue(_x)) !== null && _toValue2 !== void 0 ? _toValue2 : x.value,\n\t\t\tbehavior: toValue(behavior)\n\t\t});\n\t\tconst scrollContainer = (_element === null || _element === void 0 || (_document = _element.document) === null || _document === void 0 ? void 0 : _document.documentElement) || (_element === null || _element === void 0 ? void 0 : _element.documentElement) || _element;\n\t\tif (x != null) internalX.value = scrollContainer.scrollLeft;\n\t\tif (y != null) internalY.value = scrollContainer.scrollTop;\n\t}\n\tconst isScrolling = shallowRef(false);\n\tconst arrivedState = reactive({\n\t\tleft: true,\n\t\tright: false,\n\t\ttop: true,\n\t\tbottom: false\n\t});\n\tconst directions = reactive({\n\t\tleft: false,\n\t\tright: false,\n\t\ttop: false,\n\t\tbottom: false\n\t});\n\tconst onScrollEnd = (e) => {\n\t\tif (!isScrolling.value) return;\n\t\tisScrolling.value = false;\n\t\tdirections.left = false;\n\t\tdirections.right = false;\n\t\tdirections.top = false;\n\t\tdirections.bottom = false;\n\t\tonStop(e);\n\t};\n\tconst onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle + idle);\n\tconst setArrivedState = (target) => {\n\t\tvar _document2;\n\t\tif (!window) return;\n\t\tconst el = (target === null || target === void 0 || (_document2 = target.document) === null || _document2 === void 0 ? void 0 : _document2.documentElement) || (target === null || target === void 0 ? void 0 : target.documentElement) || unrefElement(target);\n\t\tconst { display, flexDirection, direction } = window.getComputedStyle(el);\n\t\tconst directionMultipler = direction === \"rtl\" ? -1 : 1;\n\t\tconst scrollLeft = el.scrollLeft;\n\t\tdirections.left = scrollLeft < internalX.value;\n\t\tdirections.right = scrollLeft > internalX.value;\n\t\tconst left = Math.abs(scrollLeft * directionMultipler) <= (offset.left || 0);\n\t\tconst right = Math.abs(scrollLeft * directionMultipler) + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n\t\tif (display === \"flex\" && flexDirection === \"row-reverse\") {\n\t\t\tarrivedState.left = right;\n\t\t\tarrivedState.right = left;\n\t\t} else {\n\t\t\tarrivedState.left = left;\n\t\t\tarrivedState.right = right;\n\t\t}\n\t\tinternalX.value = scrollLeft;\n\t\tlet scrollTop = el.scrollTop;\n\t\tif (target === window.document && !scrollTop) scrollTop = window.document.body.scrollTop;\n\t\tdirections.top = scrollTop < internalY.value;\n\t\tdirections.bottom = scrollTop > internalY.value;\n\t\tconst top = Math.abs(scrollTop) <= (offset.top || 0);\n\t\tconst bottom = Math.abs(scrollTop) + el.clientHeight >= el.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n\t\t/**\n\t\t* reverse columns and rows behave exactly the other way around,\n\t\t* bottom is treated as top and top is treated as the negative version of bottom\n\t\t*/\n\t\tif (display === \"flex\" && flexDirection === \"column-reverse\") {\n\t\t\tarrivedState.top = bottom;\n\t\t\tarrivedState.bottom = top;\n\t\t} else {\n\t\t\tarrivedState.top = top;\n\t\t\tarrivedState.bottom = bottom;\n\t\t}\n\t\tinternalY.value = scrollTop;\n\t};\n\tconst onScrollHandler = (e) => {\n\t\tvar _documentElement;\n\t\tif (!window) return;\n\t\tconst eventTarget = (_documentElement = e.target.documentElement) !== null && _documentElement !== void 0 ? _documentElement : e.target;\n\t\tsetArrivedState(eventTarget);\n\t\tisScrolling.value = true;\n\t\tonScrollEndDebounced(e);\n\t\tonScroll(e);\n\t};\n\tuseEventListener(element, \"scroll\", throttle ? useThrottleFn(onScrollHandler, throttle, true, false) : onScrollHandler, eventListenerOptions);\n\ttryOnMounted(() => {\n\t\ttry {\n\t\t\tconst _element = toValue(element);\n\t\t\tif (!_element) return;\n\t\t\tsetArrivedState(_element);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t});\n\tif ((observe === null || observe === void 0 ? void 0 : observe.mutation) && element != null && element !== window && element !== document) useMutationObserver(element, () => {\n\t\tconst _element = toValue(element);\n\t\tif (!_element) return;\n\t\tsetArrivedState(_element);\n\t}, {\n\t\tattributes: true,\n\t\tchildList: true,\n\t\tsubtree: true\n\t});\n\tuseEventListener(element, \"scrollend\", onScrollEnd, eventListenerOptions);\n\treturn {\n\t\tx,\n\t\ty,\n\t\tisScrolling,\n\t\tarrivedState,\n\t\tdirections,\n\t\tmeasure() {\n\t\t\tconst _element = toValue(element);\n\t\t\tif (window && _element) setArrivedState(_element);\n\t\t}\n\t};\n}\n// useInfiniteScroll/index.ts\n/**\n* Reactive infinite scroll.\n*\n* @see https://vueuse.org/useInfiniteScroll\n*/\nfunction useInfiniteScroll(element, onLoadMore, options = {}) {\n\tvar _options$distance;\n\tconst { direction = \"bottom\", interval = 100, canLoadMore = () => true } = options;\n\tconst state = reactive(useScroll(element, {\n\t\t...options,\n\t\toffset: {\n\t\t\t[direction]: (_options$distance = options.distance) !== null && _options$distance !== void 0 ? _options$distance : 0,\n\t\t\t...options.offset\n\t\t}\n\t}));\n\tconst promise = shallowRef();\n\tconst isLoading = computed(() => !!promise.value);\n\tconst observedElement = computed(() => {\n\t\treturn resolveElement(toValue(element));\n\t});\n\tconst isElementVisible = useElementVisibility(observedElement);\n\tconst canLoad = computed(() => {\n\t\tif (!observedElement.value) return false;\n\t\treturn canLoadMore(observedElement.value);\n\t});\n\tfunction checkAndLoad() {\n\t\tstate.measure();\n\t\tif (!observedElement.value || !isElementVisible.value || !canLoad.value || promise.value) return;\n\t\tconst { scrollHeight, clientHeight, scrollWidth, clientWidth } = observedElement.value;\n\t\tconst isNarrower = direction === \"bottom\" || direction === \"top\" ? scrollHeight <= clientHeight : scrollWidth <= clientWidth;\n\t\tif (state.arrivedState[direction] || isNarrower) promise.value = Promise.all([onLoadMore(state), new Promise((resolve) => setTimeout(resolve, interval))]).finally(() => {\n\t\t\tpromise.value = null;\n\t\t\tnextTick(() => checkAndLoad());\n\t\t});\n\t}\n\tconst stop = watch(() => [\n\t\tstate.arrivedState[direction],\n\t\tisElementVisible.value,\n\t\tcanLoad.value\n\t], checkAndLoad, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\ttryOnUnmounted(stop);\n\treturn {\n\t\tisLoading,\n\t\treset() {\n\t\t\tnextTick(() => checkAndLoad());\n\t\t}\n\t};\n}\n// useKeyModifier/index.ts\nconst defaultEvents = [\n\t\"mousedown\",\n\t\"mouseup\",\n\t\"keydown\",\n\t\"keyup\"\n];\n/* @__NO_SIDE_EFFECTS__ */\nfunction useKeyModifier(modifier, options = {}) {\n\tconst { events = defaultEvents, document = defaultDocument, initial = null } = options;\n\tconst state = shallowRef(initial);\n\tif (document) events.forEach((listenerEvent) => {\n\t\tuseEventListener(document, listenerEvent, (evt) => {\n\t\t\tif (typeof evt.getModifierState === \"function\") state.value = evt.getModifierState(modifier);\n\t\t}, { passive: true });\n\t});\n\treturn state;\n}\n// useLiveAnnouncer/index.ts\nlet announcerMap;\nfunction getAnnouncerMap() {\n\tvar _announcerMap;\n\treturn (_announcerMap = announcerMap) !== null && _announcerMap !== void 0 ? _announcerMap : announcerMap = /* @__PURE__ */ new Map();\n}\nfunction cleanup(idPrefix, document) {\n\tconst map = getAnnouncerMap();\n\tconst count = map.get(idPrefix) || 0;\n\tif (count <= 1) {\n\t\tconst container = document.getElementById(`${idPrefix}-container`);\n\t\tif (container) container.remove();\n\t\tmap.delete(idPrefix);\n\t} else map.set(idPrefix, count - 1);\n}\nfunction useLiveAnnouncer(options = {}) {\n\tconst { idPrefix = \"vueuse-live-announcer\", window = defaultWindow } = options;\n\tconst document = window === null || window === void 0 ? void 0 : window.document;\n\tconst timers = /* @__PURE__ */ new Map();\n\tif (window && document) {\n\t\tconst map = getAnnouncerMap();\n\t\tconst count = map.get(idPrefix) || 0;\n\t\tmap.set(idPrefix, count + 1);\n\t\ttryOnScopeDispose(() => {\n\t\t\ttimers.forEach((timer) => window.clearTimeout(timer));\n\t\t\ttimers.clear();\n\t\t\tcleanup(idPrefix, document);\n\t\t});\n\t}\n\tfunction ensureAnnouncer() {\n\t\tif (!document) return;\n\t\tlet container = document.getElementById(`${idPrefix}-container`);\n\t\tif (!container) {\n\t\t\tcontainer = document.createElement(\"div\");\n\t\t\tcontainer.id = `${idPrefix}-container`;\n\t\t\tcontainer.style.position = \"absolute\";\n\t\t\tcontainer.style.width = \"1px\";\n\t\t\tcontainer.style.height = \"1px\";\n\t\t\tcontainer.style.padding = \"0\";\n\t\t\tcontainer.style.margin = \"-1px\";\n\t\t\tcontainer.style.overflow = \"hidden\";\n\t\t\tcontainer.style.clip = \"rect(0, 0, 0, 0)\";\n\t\t\tcontainer.style.whiteSpace = \"nowrap\";\n\t\t\tcontainer.style.border = \"0\";\n\t\t\tcontainer.style.wordWrap = \"normal\";\n\t\t\tcontainer.style.clipPath = \"inset(50%)\";\n\t\t\tdocument.body.appendChild(container);\n\t\t}\n\t\tif (!document.getElementById(`${idPrefix}-polite`)) {\n\t\t\tconst polite = document.createElement(\"div\");\n\t\t\tpolite.id = `${idPrefix}-polite`;\n\t\t\tpolite.setAttribute(\"role\", \"status\");\n\t\t\tpolite.setAttribute(\"aria-live\", \"polite\");\n\t\t\tpolite.setAttribute(\"aria-atomic\", \"true\");\n\t\t\tcontainer.appendChild(polite);\n\t\t}\n\t\tif (!document.getElementById(`${idPrefix}-assertive`)) {\n\t\t\tconst assertive = document.createElement(\"div\");\n\t\t\tassertive.id = `${idPrefix}-assertive`;\n\t\t\tassertive.setAttribute(\"role\", \"alert\");\n\t\t\tassertive.setAttribute(\"aria-live\", \"assertive\");\n\t\t\tassertive.setAttribute(\"aria-atomic\", \"true\");\n\t\t\tcontainer.appendChild(assertive);\n\t\t}\n\t}\n\tensureAnnouncer();\n\tfunction announce(message, mode = \"polite\", timeout) {\n\t\tif (!window || !document) return;\n\t\tensureAnnouncer();\n\t\tconst element = document.getElementById(`${idPrefix}-${mode}`);\n\t\tif (element) {\n\t\t\tconst pending = timers.get(mode);\n\t\t\tif (pending != null) {\n\t\t\t\twindow.clearTimeout(pending);\n\t\t\t\ttimers.delete(mode);\n\t\t\t}\n\t\t\telement.textContent = \"\";\n\t\t\tnextTick(() => element.textContent = message);\n\t\t\tif (timeout && timeout > 0) {\n\t\t\t\tconst timer = window.setTimeout(() => {\n\t\t\t\t\ttimers.delete(mode);\n\t\t\t\t\telement.textContent = \"\";\n\t\t\t\t}, timeout);\n\t\t\t\ttimers.set(mode, timer);\n\t\t\t}\n\t\t}\n\t}\n\tfunction polite(message, timeout) {\n\t\tannounce(message, \"polite\", timeout);\n\t}\n\tfunction assertive(message, timeout) {\n\t\tannounce(message, \"assertive\", timeout);\n\t}\n\treturn {\n\t\tannounce,\n\t\tpolite,\n\t\tassertive\n\t};\n}\n// useLocalStorage/index.ts\n/**\n* Reactive LocalStorage.\n*\n* @see https://vueuse.org/useLocalStorage\n* @param key\n* @param initialValue\n* @param options\n*/\nfunction useLocalStorage(key, initialValue, options = {}) {\n\tconst { window = defaultWindow } = options;\n\treturn useStorage(key, initialValue, window === null || window === void 0 ? void 0 : window.localStorage, options);\n}\n// useMagicKeys/aliasMap.ts\nconst DefaultMagicKeysAliasMap = {\n\tctrl: \"control\",\n\tcommand: \"meta\",\n\tcmd: \"meta\",\n\toption: \"alt\",\n\tup: \"arrowup\",\n\tdown: \"arrowdown\",\n\tleft: \"arrowleft\",\n\tright: \"arrowright\"\n};\n// useMagicKeys/index.ts\n/**\n* Reactive keys pressed state, with magical keys combination support.\n*\n* @see https://vueuse.org/useMagicKeys\n*/\nfunction useMagicKeys(options = {}) {\n\tconst { reactive: useReactive = false, target = defaultWindow, aliasMap = DefaultMagicKeysAliasMap, passive = true, onEventFired = noop } = options;\n\tconst current = reactive(/* @__PURE__ */ new Set());\n\tconst obj = {\n\t\ttoJSON() {\n\t\t\treturn {};\n\t\t},\n\t\tcurrent\n\t};\n\tconst refs = useReactive ? reactive(obj) : obj;\n\tconst metaDeps = /* @__PURE__ */ new Set();\n\tconst depsMap = /* @__PURE__ */ new Map([\n\t\t[\"Meta\", metaDeps],\n\t\t[\"Shift\", /* @__PURE__ */ new Set()],\n\t\t[\"Alt\", /* @__PURE__ */ new Set()]\n\t]);\n\tconst usedKeys = /* @__PURE__ */ new Set();\n\tfunction setRefs(key, value) {\n\t\tif (key in refs) {\n\t\t\tif (useReactive) refs[key] = value;\n\t\t\telse refs[key].value = value;\n\t\t}\n\t}\n\tfunction reset() {\n\t\tcurrent.clear();\n\t\tfor (const key of usedKeys) setRefs(key, false);\n\t}\n\tfunction updateDeps(value, e, keys) {\n\t\tif (!value || typeof e.getModifierState !== \"function\") return;\n\t\tfor (const [modifier, depsSet] of depsMap) if (e.getModifierState(modifier)) {\n\t\t\tkeys.forEach((key) => depsSet.add(key));\n\t\t\tbreak;\n\t\t}\n\t}\n\tfunction clearDeps(value, key) {\n\t\tif (value) return;\n\t\tconst depsMapKey = `${key[0].toUpperCase()}${key.slice(1)}`;\n\t\tconst deps = depsMap.get(depsMapKey);\n\t\tif (![\"shift\", \"alt\"].includes(key) || !deps) return;\n\t\tconst depsArray = Array.from(deps);\n\t\tconst depsIndex = depsArray.indexOf(key);\n\t\tdepsArray.forEach((key, index) => {\n\t\t\tif (index >= depsIndex) {\n\t\t\t\tcurrent.delete(key);\n\t\t\t\tsetRefs(key, false);\n\t\t\t}\n\t\t});\n\t\tdeps.clear();\n\t}\n\tfunction updateRefs(e, value) {\n\t\tvar _e$key, _e$code;\n\t\tconst key = (_e$key = e.key) === null || _e$key === void 0 ? void 0 : _e$key.toLowerCase();\n\t\tconst values = [(_e$code = e.code) === null || _e$code === void 0 ? void 0 : _e$code.toLowerCase(), key].filter(Boolean);\n\t\tif (!key) return;\n\t\tif (key) {\n\t\t\tif (value) current.add(key);\n\t\t\telse current.delete(key);\n\t\t}\n\t\tfor (const key of values) {\n\t\t\tusedKeys.add(key);\n\t\t\tsetRefs(key, value);\n\t\t}\n\t\tupdateDeps(value, e, [...current, ...values]);\n\t\tclearDeps(value, key);\n\t\tif (key === \"meta\" && !value) {\n\t\t\tmetaDeps.forEach((key) => {\n\t\t\t\tcurrent.delete(key);\n\t\t\t\tsetRefs(key, false);\n\t\t\t});\n\t\t\tmetaDeps.clear();\n\t\t}\n\t}\n\tuseEventListener(target, \"keydown\", (e) => {\n\t\tupdateRefs(e, true);\n\t\treturn onEventFired(e);\n\t}, { passive });\n\tuseEventListener(target, \"keyup\", (e) => {\n\t\tupdateRefs(e, false);\n\t\treturn onEventFired(e);\n\t}, { passive });\n\tuseEventListener(\"blur\", reset, { passive });\n\tuseEventListener(\"focus\", reset, { passive });\n\tconst proxy = new Proxy(refs, { get(target, prop, rec) {\n\t\tif (typeof prop !== \"string\") return Reflect.get(target, prop, rec);\n\t\tprop = prop.toLowerCase();\n\t\tif (prop in aliasMap) prop = aliasMap[prop];\n\t\tif (!(prop in refs)) {\n\t\t\tif (/[+_-]/.test(prop)) {\n\t\t\t\tconst keys = prop.split(/[+_-]/g).map((i) => i.trim());\n\t\t\t\trefs[prop] = computed(() => keys.map((key) => toValue(proxy[key])).every(Boolean));\n\t\t\t} else refs[prop] = shallowRef(false);\n\t\t}\n\t\tconst r = Reflect.get(target, prop, rec);\n\t\treturn useReactive ? toValue(r) : r;\n\t} });\n\treturn proxy;\n}\n// useMediaControls/index.ts\n/**\n* Automatically check if the ref exists and if it does run the cb fn\n*/\nfunction usingElRef(source, cb) {\n\tif (toValue(source)) cb(toValue(source));\n}\n/**\n* Converts a TimeRange object to an array\n*/\nfunction timeRangeToArray(timeRanges) {\n\tlet ranges = [];\n\tfor (let i = 0; i < timeRanges.length; ++i) ranges = [...ranges, [timeRanges.start(i), timeRanges.end(i)]];\n\treturn ranges;\n}\n/**\n* Converts a TextTrackList object to an array of `UseMediaTextTrack`\n*/\nfunction tracksToArray(tracks) {\n\treturn Array.from(tracks).map(({ label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }, id) => ({\n\t\tid,\n\t\tlabel,\n\t\tkind,\n\t\tlanguage,\n\t\tmode,\n\t\tactiveCues,\n\t\tcues,\n\t\tinBandMetadataTrackDispatchType\n\t}));\n}\nconst defaultOptions = {\n\tsrc: \"\",\n\ttracks: []\n};\nfunction useMediaControls(target, options = {}) {\n\ttarget = toRef(target);\n\toptions = {\n\t\t...defaultOptions,\n\t\t...options\n\t};\n\tconst { document = defaultDocument } = options;\n\tconst listenerOptions = { passive: true };\n\tconst currentTime = shallowRef(0);\n\tconst duration = shallowRef(0);\n\tconst seeking = shallowRef(false);\n\tconst volume = shallowRef(1);\n\tconst waiting = shallowRef(false);\n\tconst ended = shallowRef(false);\n\tconst playing = shallowRef(false);\n\tconst rate = shallowRef(1);\n\tconst stalled = shallowRef(false);\n\tconst buffered = shallowRef([]);\n\tconst tracks = shallowRef([]);\n\tconst selectedTrack = shallowRef(-1);\n\tconst isPictureInPicture = shallowRef(false);\n\tconst muted = shallowRef(false);\n\tconst supportsPictureInPicture = Boolean(document && \"pictureInPictureEnabled\" in document);\n\tconst sourceErrorEvent = createEventHook();\n\tconst playbackErrorEvent = createEventHook();\n\t/**\n\t* Disables the specified track. If no track is specified then\n\t* all tracks will be disabled\n\t*\n\t* @param track The id of the track to disable\n\t*/\n\tconst disableTrack = (track) => {\n\t\tusingElRef(target, (el) => {\n\t\t\tif (track) {\n\t\t\t\tconst id = typeof track === \"number\" ? track : track.id;\n\t\t\t\tel.textTracks[id].mode = \"disabled\";\n\t\t\t} else for (let i = 0; i < el.textTracks.length; ++i) el.textTracks[i].mode = \"disabled\";\n\t\t\tselectedTrack.value = -1;\n\t\t});\n\t};\n\t/**\n\t* Enables the specified track and disables the\n\t* other tracks unless otherwise specified\n\t*\n\t* @param track The track of the id of the track to enable\n\t* @param disableTracks Disable all other tracks\n\t*/\n\tconst enableTrack = (track, disableTracks = true) => {\n\t\tusingElRef(target, (el) => {\n\t\t\tconst id = typeof track === \"number\" ? track : track.id;\n\t\t\tif (disableTracks) disableTrack();\n\t\t\tel.textTracks[id].mode = \"showing\";\n\t\t\tselectedTrack.value = id;\n\t\t});\n\t};\n\t/**\n\t* Toggle picture in picture mode for the player.\n\t*/\n\tconst togglePictureInPicture = () => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tusingElRef(target, async (el) => {\n\t\t\t\tif (supportsPictureInPicture) {\n\t\t\t\t\tif (!isPictureInPicture.value) el.requestPictureInPicture().then(resolve).catch(reject);\n\t\t\t\t\telse document.exitPictureInPicture().then(resolve).catch(reject);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t};\n\t/**\n\t* This will automatically inject sources to the media element. The sources will be\n\t* appended as children to the media element as `<source>` elements.\n\t*/\n\twatchEffect(() => {\n\t\tif (!document) return;\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tconst src = toValue(options.src);\n\t\tlet sources = [];\n\t\tif (!src) return;\n\t\tif (typeof src === \"string\") sources = [{ src }];\n\t\telse if (Array.isArray(src)) sources = src;\n\t\telse if (isObject(src)) sources = [src];\n\t\tel.querySelectorAll(\"source\").forEach((e) => {\n\t\t\te.remove();\n\t\t});\n\t\tsources.forEach(({ src, type, media }) => {\n\t\t\tconst source = document.createElement(\"source\");\n\t\t\tsource.setAttribute(\"src\", src);\n\t\t\tsource.setAttribute(\"type\", type || \"\");\n\t\t\tsource.setAttribute(\"media\", media || \"\");\n\t\t\tuseEventListener(source, \"error\", sourceErrorEvent.trigger, listenerOptions);\n\t\t\tel.appendChild(source);\n\t\t});\n\t\tel.load();\n\t});\n\t/**\n\t* Apply composable state to the element, also when element is changed\n\t*/\n\twatch([target, volume], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.volume = volume.value;\n\t});\n\twatch([target, muted], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.muted = muted.value;\n\t});\n\twatch([target, rate], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.playbackRate = rate.value;\n\t});\n\t/**\n\t* Load Tracks\n\t*/\n\twatchEffect(() => {\n\t\tif (!document) return;\n\t\tconst textTracks = toValue(options.tracks);\n\t\tconst el = toValue(target);\n\t\tif (!textTracks || !textTracks.length || !el) return;\n\t\t/**\n\t\t* The MediaAPI provides an API for adding text tracks, but they don't currently\n\t\t* have an API for removing text tracks, so instead we will just create and remove\n\t\t* the tracks manually using the HTML api.\n\t\t*/\n\t\tel.querySelectorAll(\"track\").forEach((e) => e.remove());\n\t\ttextTracks.forEach(({ default: isDefault, kind, label, src, srcLang }, i) => {\n\t\t\tconst track = document.createElement(\"track\");\n\t\t\ttrack.default = isDefault || false;\n\t\t\ttrack.kind = kind;\n\t\t\ttrack.label = label;\n\t\t\ttrack.src = src;\n\t\t\ttrack.srclang = srcLang;\n\t\t\tif (track.default) selectedTrack.value = i;\n\t\t\tel.appendChild(track);\n\t\t});\n\t});\n\t/**\n\t* This will allow us to update the current time from the timeupdate event\n\t* without setting the medias current position, but if the user changes the\n\t* current time via the ref, then the media will seek.\n\t*\n\t* If we did not use an ignorable watch, then the current time update from\n\t* the timeupdate event would cause the media to stutter.\n\t*/\n\tconst { ignoreUpdates: ignoreCurrentTimeUpdates } = watchIgnorable(currentTime, (time) => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.currentTime = time;\n\t});\n\t/**\n\t* Using an ignorable watch so we can control the play state using a ref and not\n\t* a function\n\t*/\n\tconst { ignoreUpdates: ignorePlayingUpdates } = watchIgnorable(playing, (isPlaying) => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tif (isPlaying) el.play().catch((e) => {\n\t\t\tplaybackErrorEvent.trigger(e);\n\t\t\tthrow e;\n\t\t});\n\t\telse el.pause();\n\t});\n\tuseEventListener(target, \"timeupdate\", () => ignoreCurrentTimeUpdates(() => currentTime.value = toValue(target).currentTime), listenerOptions);\n\tuseEventListener(target, \"durationchange\", () => duration.value = toValue(target).duration, listenerOptions);\n\tuseEventListener(target, \"progress\", () => buffered.value = timeRangeToArray(toValue(target).buffered), listenerOptions);\n\tuseEventListener(target, \"seeking\", () => seeking.value = true, listenerOptions);\n\tuseEventListener(target, \"seeked\", () => seeking.value = false, listenerOptions);\n\tuseEventListener(target, [\"waiting\", \"loadstart\"], () => {\n\t\twaiting.value = true;\n\t\tignorePlayingUpdates(() => playing.value = false);\n\t}, listenerOptions);\n\tuseEventListener(target, \"loadeddata\", () => waiting.value = false, listenerOptions);\n\tuseEventListener(target, \"playing\", () => {\n\t\twaiting.value = false;\n\t\tended.value = false;\n\t\tignorePlayingUpdates(() => playing.value = true);\n\t}, listenerOptions);\n\tuseEventListener(target, \"ratechange\", () => rate.value = toValue(target).playbackRate, listenerOptions);\n\tuseEventListener(target, \"stalled\", () => stalled.value = true, listenerOptions);\n\tuseEventListener(target, \"ended\", () => ended.value = true, listenerOptions);\n\tuseEventListener(target, \"pause\", () => ignorePlayingUpdates(() => playing.value = false), listenerOptions);\n\tuseEventListener(target, \"play\", () => ignorePlayingUpdates(() => playing.value = true), listenerOptions);\n\tuseEventListener(target, \"enterpictureinpicture\", () => isPictureInPicture.value = true, listenerOptions);\n\tuseEventListener(target, \"leavepictureinpicture\", () => isPictureInPicture.value = false, listenerOptions);\n\tuseEventListener(target, \"volumechange\", () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tvolume.value = el.volume;\n\t\tmuted.value = el.muted;\n\t}, listenerOptions);\n\t/**\n\t* The following listeners need to listen to a nested\n\t* object on the target, so we will have to use a nested\n\t* watch and manually remove the listeners\n\t*/\n\tconst listeners = [];\n\tconst stop = watch([target], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tstop();\n\t\tlisteners[0] = useEventListener(el.textTracks, \"addtrack\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t\tlisteners[1] = useEventListener(el.textTracks, \"removetrack\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t\tlisteners[2] = useEventListener(el.textTracks, \"change\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t});\n\ttryOnScopeDispose(() => listeners.forEach((listener) => listener()));\n\treturn {\n\t\tcurrentTime,\n\t\tduration,\n\t\twaiting,\n\t\tseeking,\n\t\tended,\n\t\tstalled,\n\t\tbuffered,\n\t\tplaying,\n\t\trate,\n\t\tvolume,\n\t\tmuted,\n\t\ttracks,\n\t\tselectedTrack,\n\t\tenableTrack,\n\t\tdisableTrack,\n\t\tsupportsPictureInPicture,\n\t\ttogglePictureInPicture,\n\t\tisPictureInPicture,\n\t\tonSourceError: sourceErrorEvent.on,\n\t\tonPlaybackError: playbackErrorEvent.on\n\t};\n}\n// useMemoize/index.ts\n/**\n* Reactive function result cache based on arguments\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMemoize(resolver, options) {\n\tconst initCache = () => {\n\t\tif (options === null || options === void 0 ? void 0 : options.cache) return shallowReactive(options.cache);\n\t\treturn shallowReactive(/* @__PURE__ */ new Map());\n\t};\n\tconst cache = initCache();\n\t/**\n\t* Generate key from args\n\t*/\n\tconst generateKey = (...args) => (options === null || options === void 0 ? void 0 : options.getKey) ? options.getKey(...args) : JSON.stringify(args);\n\t/**\n\t* Load data and save in cache\n\t*/\n\tconst _loadData = (key, ...args) => {\n\t\tcache.set(key, resolver(...args));\n\t\treturn cache.get(key);\n\t};\n\tconst loadData = (...args) => _loadData(generateKey(...args), ...args);\n\t/**\n\t* Delete key from cache\n\t*/\n\tconst deleteData = (...args) => {\n\t\tcache.delete(generateKey(...args));\n\t};\n\t/**\n\t* Clear cached data\n\t*/\n\tconst clearData = () => {\n\t\tcache.clear();\n\t};\n\tconst memoized = (...args) => {\n\t\tconst key = generateKey(...args);\n\t\tif (cache.has(key)) return cache.get(key);\n\t\treturn _loadData(key, ...args);\n\t};\n\tmemoized.load = loadData;\n\tmemoized.delete = deleteData;\n\tmemoized.clear = clearData;\n\tmemoized.generateKey = generateKey;\n\tmemoized.cache = cache;\n\treturn memoized;\n}\n// useMemory/index.ts\n/**\n* Reactive Memory Info.\n*\n* @see https://vueuse.org/useMemory\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMemory(options = {}) {\n\tconst memory = shallowRef();\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof performance !== \"undefined\" && \"memory\" in performance);\n\tif (isSupported.value) {\n\t\tconst { scheduler = useIntervalFn } = options;\n\t\tscheduler(() => {\n\t\t\tmemory.value = performance.memory;\n\t\t});\n\t}\n\treturn {\n\t\tisSupported,\n\t\tmemory\n\t};\n}\n// useMouse/index.ts\nconst UseMouseBuiltinExtractors = {\n\tpage: (event) => [event.pageX, event.pageY],\n\tclient: (event) => [event.clientX, event.clientY],\n\tscreen: (event) => [event.screenX, event.screenY],\n\tmovement: (event) => event instanceof MouseEvent ? [event.movementX, event.movementY] : null\n};\n/**\n* Reactive mouse position.\n*\n* @see https://vueuse.org/useMouse\n* @param options\n*/\nfunction useMouse(options = {}) {\n\tconst { type = \"page\", touch = true, resetOnTouchEnds = false, initialValue = {\n\t\tx: 0,\n\t\ty: 0\n\t}, window = defaultWindow, target = window, scroll = true, eventFilter } = options;\n\tlet _prevMouseEvent = null;\n\tlet _prevScrollX = 0;\n\tlet _prevScrollY = 0;\n\tconst x = shallowRef(initialValue.x);\n\tconst y = shallowRef(initialValue.y);\n\tconst sourceType = shallowRef(null);\n\tconst extractor = typeof type === \"function\" ? type : UseMouseBuiltinExtractors[type];\n\tconst mouseHandler = (event) => {\n\t\tconst result = extractor(event);\n\t\t_prevMouseEvent = event;\n\t\tif (result) {\n\t\t\t[x.value, y.value] = result;\n\t\t\tsourceType.value = \"mouse\";\n\t\t}\n\t\tif (window) {\n\t\t\t_prevScrollX = window.scrollX;\n\t\t\t_prevScrollY = window.scrollY;\n\t\t}\n\t};\n\tconst touchHandler = (event) => {\n\t\tif (event.touches.length > 0) {\n\t\t\tconst result = extractor(event.touches[0]);\n\t\t\tif (result) {\n\t\t\t\t[x.value, y.value] = result;\n\t\t\t\tsourceType.value = \"touch\";\n\t\t\t}\n\t\t}\n\t};\n\tconst scrollHandler = () => {\n\t\tif (!_prevMouseEvent || !window) return;\n\t\tconst pos = extractor(_prevMouseEvent);\n\t\tif (_prevMouseEvent instanceof MouseEvent && pos) {\n\t\t\tx.value = pos[0] + window.scrollX - _prevScrollX;\n\t\t\ty.value = pos[1] + window.scrollY - _prevScrollY;\n\t\t}\n\t};\n\tconst reset = () => {\n\t\tx.value = initialValue.x;\n\t\ty.value = initialValue.y;\n\t};\n\tconst mouseHandlerWrapper = eventFilter ? (event) => eventFilter(() => mouseHandler(event), {}) : (event) => mouseHandler(event);\n\tconst touchHandlerWrapper = eventFilter ? (event) => eventFilter(() => touchHandler(event), {}) : (event) => touchHandler(event);\n\tconst scrollHandlerWrapper = eventFilter ? () => eventFilter(() => scrollHandler(), {}) : () => scrollHandler();\n\tif (target) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(target, [\"mousemove\", \"dragover\"], mouseHandlerWrapper, listenerOptions);\n\t\tif (touch && type !== \"movement\") {\n\t\t\tuseEventListener(target, [\"touchstart\", \"touchmove\"], touchHandlerWrapper, listenerOptions);\n\t\t\tif (resetOnTouchEnds) useEventListener(target, [\"touchend\", \"touchcancel\"], reset, listenerOptions);\n\t\t}\n\t\tif (scroll && type === \"page\") useEventListener(window, \"scroll\", scrollHandlerWrapper, listenerOptions);\n\t}\n\treturn {\n\t\tx,\n\t\ty,\n\t\tsourceType\n\t};\n}\n// useMouseInElement/index.ts\n/**\n* Reactive mouse position related to an element.\n*\n* @see https://vueuse.org/useMouseInElement\n* @param target\n* @param options\n*/\nfunction useMouseInElement(target, options = {}) {\n\tconst { windowResize = true, windowScroll = true, handleOutside = true, window = defaultWindow } = options;\n\tconst type = options.type || \"page\";\n\tconst { x, y, sourceType } = useMouse(options);\n\tconst targetRef = shallowRef(target !== null && target !== void 0 ? target : window === null || window === void 0 ? void 0 : window.document.body);\n\tconst elementX = shallowRef(0);\n\tconst elementY = shallowRef(0);\n\tconst elementPositionX = shallowRef(0);\n\tconst elementPositionY = shallowRef(0);\n\tconst elementHeight = shallowRef(0);\n\tconst elementWidth = shallowRef(0);\n\tconst isOutside = shallowRef(true);\n\tfunction update() {\n\t\tif (!window) return;\n\t\tconst el = unrefElement(targetRef);\n\t\tif (!el || !(el instanceof Element)) return;\n\t\tfor (const rect of el.getClientRects()) {\n\t\t\tconst { left, top, width, height } = rect;\n\t\t\telementPositionX.value = left + (type === \"page\" ? window.pageXOffset : 0);\n\t\t\telementPositionY.value = top + (type === \"page\" ? window.pageYOffset : 0);\n\t\t\telementHeight.value = height;\n\t\t\telementWidth.value = width;\n\t\t\tconst elX = x.value - elementPositionX.value;\n\t\t\tconst elY = y.value - elementPositionY.value;\n\t\t\tisOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;\n\t\t\tif (handleOutside || !isOutside.value) {\n\t\t\t\telementX.value = elX;\n\t\t\t\telementY.value = elY;\n\t\t\t}\n\t\t\tif (!isOutside.value) break;\n\t\t}\n\t}\n\tconst stopFnList = [];\n\tfunction stop() {\n\t\tstopFnList.forEach((fn) => fn());\n\t\tstopFnList.length = 0;\n\t}\n\ttryOnMounted(() => {\n\t\tupdate();\n\t});\n\tif (window) {\n\t\tconst { stop: stopResizeObserver } = useResizeObserver(targetRef, update);\n\t\tconst { stop: stopMutationObserver } = useMutationObserver(targetRef, update, { attributeFilter: [\"style\", \"class\"] });\n\t\tconst stopWatch = watch([\n\t\t\ttargetRef,\n\t\t\tx,\n\t\t\ty\n\t\t], update);\n\t\tstopFnList.push(stopResizeObserver, stopMutationObserver, stopWatch);\n\t\tuseEventListener(document, \"mouseleave\", () => isOutside.value = true, { passive: true });\n\t\tif (windowScroll) stopFnList.push(useEventListener(\"scroll\", update, {\n\t\t\tcapture: true,\n\t\t\tpassive: true\n\t\t}));\n\t\tif (windowResize) stopFnList.push(useEventListener(\"resize\", update, { passive: true }));\n\t}\n\treturn {\n\t\tx,\n\t\ty,\n\t\tsourceType,\n\t\telementX,\n\t\telementY,\n\t\telementPositionX,\n\t\telementPositionY,\n\t\telementHeight,\n\t\telementWidth,\n\t\tisOutside,\n\t\tstop\n\t};\n}\n// useMousePressed/index.ts\n/**\n* Reactive mouse pressing state.\n*\n* @see https://vueuse.org/useMousePressed\n* @param options\n*/\nfunction useMousePressed(options = {}) {\n\tconst { touch = true, drag = true, capture = false, initialValue = false, window = defaultWindow } = options;\n\tconst pressed = shallowRef(initialValue);\n\tconst sourceType = shallowRef(null);\n\tif (!window) return {\n\t\tpressed,\n\t\tsourceType\n\t};\n\tconst onPressed = (srcType) => (event) => {\n\t\tvar _options$onPressed;\n\t\tpressed.value = true;\n\t\tsourceType.value = srcType;\n\t\t(_options$onPressed = options.onPressed) === null || _options$onPressed === void 0 || _options$onPressed.call(options, event);\n\t};\n\tconst onReleased = (event) => {\n\t\tvar _options$onReleased;\n\t\tpressed.value = false;\n\t\tsourceType.value = null;\n\t\t(_options$onReleased = options.onReleased) === null || _options$onReleased === void 0 || _options$onReleased.call(options, event);\n\t};\n\tconst target = computed(() => unrefElement(options.target) || window);\n\tconst listenerOptions = {\n\t\tpassive: true,\n\t\tcapture\n\t};\n\tuseEventListener(target, \"mousedown\", onPressed(\"mouse\"), listenerOptions);\n\tuseEventListener(window, \"mouseleave\", onReleased, listenerOptions);\n\tuseEventListener(window, \"mouseup\", onReleased, listenerOptions);\n\tif (drag) {\n\t\tuseEventListener(target, \"dragstart\", onPressed(\"mouse\"), listenerOptions);\n\t\tuseEventListener(window, \"drop\", onReleased, listenerOptions);\n\t\tuseEventListener(window, \"dragend\", onReleased, listenerOptions);\n\t}\n\tif (touch) {\n\t\tuseEventListener(target, \"touchstart\", onPressed(\"touch\"), listenerOptions);\n\t\tuseEventListener(window, \"touchend\", onReleased, listenerOptions);\n\t\tuseEventListener(window, \"touchcancel\", onReleased, listenerOptions);\n\t}\n\treturn {\n\t\tpressed,\n\t\tsourceType\n\t};\n}\n// useNavigatorLanguage/index.ts\n/**\n*\n* Reactive useNavigatorLanguage\n*\n* Detects the currently selected user language and returns a reactive language\n* @see https://vueuse.org/useNavigatorLanguage\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useNavigatorLanguage(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst navigator = window === null || window === void 0 ? void 0 : window.navigator;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"language\" in navigator);\n\tconst language = shallowRef(navigator === null || navigator === void 0 ? void 0 : navigator.language);\n\tuseEventListener(window, \"languagechange\", () => {\n\t\tif (navigator) language.value = navigator.language;\n\t}, { passive: true });\n\treturn {\n\t\tisSupported,\n\t\tlanguage\n\t};\n}\n// useNetwork/index.ts\n/**\n* Reactive Network status.\n*\n* @see https://vueuse.org/useNetwork\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useNetwork(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst navigator = window === null || window === void 0 ? void 0 : window.navigator;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"connection\" in navigator);\n\tconst isOnline = shallowRef(true);\n\tconst saveData = shallowRef(false);\n\tconst offlineAt = shallowRef(void 0);\n\tconst onlineAt = shallowRef(void 0);\n\tconst downlink = shallowRef(void 0);\n\tconst downlinkMax = shallowRef(void 0);\n\tconst rtt = shallowRef(void 0);\n\tconst effectiveType = shallowRef(void 0);\n\tconst type = shallowRef(\"unknown\");\n\tconst connection = isSupported.value && navigator.connection;\n\tfunction updateNetworkInformation() {\n\t\tif (!navigator) return;\n\t\tisOnline.value = navigator.onLine;\n\t\tofflineAt.value = isOnline.value ? void 0 : Date.now();\n\t\tonlineAt.value = isOnline.value ? Date.now() : void 0;\n\t\tif (connection) {\n\t\t\tdownlink.value = connection.downlink;\n\t\t\tdownlinkMax.value = connection.downlinkMax;\n\t\t\teffectiveType.value = connection.effectiveType;\n\t\t\trtt.value = connection.rtt;\n\t\t\tsaveData.value = connection.saveData;\n\t\t\ttype.value = connection.type;\n\t\t}\n\t}\n\tconst listenerOptions = { passive: true };\n\tif (window) {\n\t\tuseEventListener(window, \"offline\", () => {\n\t\t\tisOnline.value = false;\n\t\t\tofflineAt.value = Date.now();\n\t\t}, listenerOptions);\n\t\tuseEventListener(window, \"online\", () => {\n\t\t\tisOnline.value = true;\n\t\t\tonlineAt.value = Date.now();\n\t\t}, listenerOptions);\n\t}\n\tif (connection) useEventListener(connection, \"change\", updateNetworkInformation, listenerOptions);\n\tupdateNetworkInformation();\n\treturn {\n\t\tisSupported,\n\t\tisOnline: shallowReadonly(isOnline),\n\t\tsaveData: shallowReadonly(saveData),\n\t\tofflineAt: shallowReadonly(offlineAt),\n\t\tonlineAt: shallowReadonly(onlineAt),\n\t\tdownlink: shallowReadonly(downlink),\n\t\tdownlinkMax: shallowReadonly(downlinkMax),\n\t\teffectiveType: shallowReadonly(effectiveType),\n\t\trtt: shallowReadonly(rtt),\n\t\ttype: shallowReadonly(type)\n\t};\n}\n// useNow/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useNow(options = {}) {\n\tconst { controls: exposeControls = false, scheduler = useRafFn } = options;\n\tconst now = shallowRef(/* @__PURE__ */ new Date());\n\tconst update = () => now.value = /* @__PURE__ */ new Date();\n\tconst controls = scheduler(update);\n\tif (exposeControls) return {\n\t\tnow,\n\t\t...controls\n\t};\n\telse return now;\n}\n// useObjectUrl/index.ts\n/**\n* Reactive URL representing an object.\n*\n* @see https://vueuse.org/useObjectUrl\n* @param object\n*/\nfunction useObjectUrl(object) {\n\tconst url = shallowRef();\n\tconst release = () => {\n\t\tif (url.value) URL.revokeObjectURL(url.value);\n\t\turl.value = void 0;\n\t};\n\twatch(() => toValue(object), (newObject) => {\n\t\trelease();\n\t\tif (newObject) url.value = URL.createObjectURL(newObject);\n\t}, { immediate: true });\n\ttryOnScopeDispose(release);\n\treturn shallowReadonly(url);\n}\n// ../math/useClamp/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useClamp(value, min, max) {\n\tif (typeof value === \"function\" || isReadonly(value)) return computed(() => clamp(toValue(value), toValue(min), toValue(max)));\n\tconst _value = ref(value);\n\treturn computed({\n\t\tget() {\n\t\t\treturn _value.value = clamp(_value.value, toValue(min), toValue(max));\n\t\t},\n\t\tset(value) {\n\t\t\t_value.value = clamp(value, toValue(min), toValue(max));\n\t\t}\n\t});\n}\n// useOffsetPagination/index.ts\nfunction useOffsetPagination(options) {\n\tconst { total = Number.POSITIVE_INFINITY, pageSize = 10, page = 1, onPageChange = noop, onPageSizeChange = noop, onPageCountChange = noop } = options;\n\tconst currentPageSize = /* @__PURE__ */ useClamp(pageSize, 1, Number.POSITIVE_INFINITY);\n\tconst pageCount = computed(() => Math.max(1, Math.ceil(toValue(total) / toValue(currentPageSize))));\n\tconst currentPage = /* @__PURE__ */ useClamp(page, 1, pageCount);\n\tconst isFirstPage = computed(() => currentPage.value === 1);\n\tconst isLastPage = computed(() => currentPage.value === pageCount.value);\n\tif (isRef(page)) syncRef(page, currentPage, { direction: isReadonly(page) ? \"ltr\" : \"both\" });\n\tif (isRef(pageSize)) syncRef(pageSize, currentPageSize, { direction: isReadonly(pageSize) ? \"ltr\" : \"both\" });\n\tfunction prev() {\n\t\tcurrentPage.value--;\n\t}\n\tfunction next() {\n\t\tcurrentPage.value++;\n\t}\n\tconst returnValue = {\n\t\tcurrentPage,\n\t\tcurrentPageSize,\n\t\tpageCount,\n\t\tisFirstPage,\n\t\tisLastPage,\n\t\tprev,\n\t\tnext\n\t};\n\twatch(currentPage, () => {\n\t\tonPageChange(reactive(returnValue));\n\t});\n\twatch(currentPageSize, () => {\n\t\tonPageSizeChange(reactive(returnValue));\n\t});\n\twatch(pageCount, () => {\n\t\tonPageCountChange(reactive(returnValue));\n\t});\n\treturn returnValue;\n}\n// useOnline/index.ts\n/**\n* Reactive online state.\n*\n* @see https://vueuse.org/useOnline\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useOnline(options = {}) {\n\tconst { isOnline } = useNetwork(options);\n\treturn isOnline;\n}\n// usePageLeave/index.ts\n/**\n* Reactive state to show whether mouse leaves the page.\n*\n* @see https://vueuse.org/usePageLeave\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePageLeave(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst isLeft = shallowRef(false);\n\tconst handler = (event) => {\n\t\tif (!window) return;\n\t\tevent = event || window.event;\n\t\tconst from = event.relatedTarget || event.toElement;\n\t\tisLeft.value = !from;\n\t};\n\tif (window) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(window, \"mouseout\", handler, listenerOptions);\n\t\tuseEventListener(window.document, \"mouseleave\", handler, listenerOptions);\n\t\tuseEventListener(window.document, \"mouseenter\", handler, listenerOptions);\n\t}\n\treturn isLeft;\n}\n// useScreenOrientation/index.ts\n/**\n* Reactive screen orientation\n*\n* @see https://vueuse.org/useScreenOrientation\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useScreenOrientation(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"screen\" in window && \"orientation\" in window.screen);\n\tconst screenOrientation = isSupported.value ? window.screen.orientation : {};\n\tconst orientation = shallowRef(screenOrientation.type);\n\tconst angle = shallowRef(screenOrientation.angle || 0);\n\tif (isSupported.value) useEventListener(window, \"orientationchange\", () => {\n\t\torientation.value = screenOrientation.type;\n\t\tangle.value = screenOrientation.angle;\n\t}, { passive: true });\n\tconst lockOrientation = (type) => {\n\t\tif (isSupported.value && typeof screenOrientation.lock === \"function\") return screenOrientation.lock(type);\n\t\treturn Promise.reject(/* @__PURE__ */ new Error(\"Not supported\"));\n\t};\n\tconst unlockOrientation = () => {\n\t\tif (isSupported.value && typeof screenOrientation.unlock === \"function\") screenOrientation.unlock();\n\t};\n\treturn {\n\t\tisSupported,\n\t\torientation,\n\t\tangle,\n\t\tlockOrientation,\n\t\tunlockOrientation\n\t};\n}\n// useParallax/index.ts\n/**\n* Create parallax effect easily. It uses `useDeviceOrientation` and fallback to `useMouse`\n* if orientation is not supported.\n*\n* @param target\n* @param options\n*/\nfunction useParallax(target, options = {}) {\n\tconst { deviceOrientationTiltAdjust = (i) => i, deviceOrientationRollAdjust = (i) => i, mouseTiltAdjust = (i) => i, mouseRollAdjust = (i) => i, window = defaultWindow } = options;\n\tconst orientation = reactive(useDeviceOrientation({ window }));\n\tconst screenOrientation = reactive(useScreenOrientation({ window }));\n\tconst { elementX: x, elementY: y, elementWidth: width, elementHeight: height } = useMouseInElement(target, {\n\t\thandleOutside: false,\n\t\twindow\n\t});\n\tconst source = computed(() => {\n\t\tif (orientation.isSupported && (orientation.alpha != null && orientation.alpha !== 0 || orientation.gamma != null && orientation.gamma !== 0)) return \"deviceOrientation\";\n\t\treturn \"mouse\";\n\t});\n\treturn {\n\t\troll: computed(() => {\n\t\t\tif (source.value === \"deviceOrientation\") {\n\t\t\t\tlet value;\n\t\t\t\tswitch (screenOrientation.orientation) {\n\t\t\t\t\tcase \"landscape-primary\":\n\t\t\t\t\t\tvalue = orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"landscape-secondary\":\n\t\t\t\t\t\tvalue = -orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-primary\":\n\t\t\t\t\t\tvalue = -orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-secondary\":\n\t\t\t\t\t\tvalue = orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: value = -orientation.beta / 90;\n\t\t\t\t}\n\t\t\t\treturn deviceOrientationRollAdjust(value);\n\t\t\t} else {\n\t\t\t\tconst value = -(y.value - height.value / 2) / height.value;\n\t\t\t\treturn mouseRollAdjust(value);\n\t\t\t}\n\t\t}),\n\t\ttilt: computed(() => {\n\t\t\tif (source.value === \"deviceOrientation\") {\n\t\t\t\tlet value;\n\t\t\t\tswitch (screenOrientation.orientation) {\n\t\t\t\t\tcase \"landscape-primary\":\n\t\t\t\t\t\tvalue = orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"landscape-secondary\":\n\t\t\t\t\t\tvalue = -orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-primary\":\n\t\t\t\t\t\tvalue = orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-secondary\":\n\t\t\t\t\t\tvalue = -orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: value = orientation.gamma / 90;\n\t\t\t\t}\n\t\t\t\treturn deviceOrientationTiltAdjust(value);\n\t\t\t} else {\n\t\t\t\tconst value = (x.value - width.value / 2) / width.value;\n\t\t\t\treturn mouseTiltAdjust(value);\n\t\t\t}\n\t\t}),\n\t\tsource\n\t};\n}\n// useParentElement/index.ts\nfunction useParentElement(element = useCurrentElement()) {\n\tconst parentElement = shallowRef();\n\tconst update = () => {\n\t\tconst el = unrefElement(element);\n\t\tif (el) parentElement.value = el.parentElement;\n\t};\n\ttryOnMounted(update);\n\twatch(() => toValue(element), update);\n\treturn parentElement;\n}\n// usePerformanceObserver/index.ts\n/**\n* Observe performance metrics.\n*\n* @see https://vueuse.org/usePerformanceObserver\n* @param options\n*/\nfunction usePerformanceObserver(options, callback) {\n\tconst { window = defaultWindow, immediate = true, ...performanceOptions } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"PerformanceObserver\" in window);\n\tlet observer;\n\tconst stop = () => {\n\t\tobserver === null || observer === void 0 || observer.disconnect();\n\t};\n\tconst start = () => {\n\t\tif (isSupported.value) {\n\t\t\tstop();\n\t\t\tobserver = new PerformanceObserver(callback);\n\t\t\tobserver.observe(performanceOptions);\n\t\t}\n\t};\n\ttryOnScopeDispose(stop);\n\tif (immediate) start();\n\treturn {\n\t\tisSupported,\n\t\tstart,\n\t\tstop\n\t};\n}\n// usePointer/index.ts\nconst defaultState = {\n\tx: 0,\n\ty: 0,\n\tpointerId: 0,\n\tpressure: 0,\n\ttiltX: 0,\n\ttiltY: 0,\n\twidth: 0,\n\theight: 0,\n\ttwist: 0,\n\tpointerType: null\n};\nconst keys = /* #__PURE__ */ Object.keys(defaultState);\n/**\n* Reactive pointer state.\n*\n* @see https://vueuse.org/usePointer\n* @param options\n*/\nfunction usePointer(options = {}) {\n\tconst { target = defaultWindow } = options;\n\tconst isInside = shallowRef(false);\n\tconst state = shallowRef(options.initialValue || {});\n\tObject.assign(state.value, defaultState, state.value);\n\tconst handler = (event) => {\n\t\tisInside.value = true;\n\t\tif (options.pointerTypes && !options.pointerTypes.includes(event.pointerType)) return;\n\t\tstate.value = objectPick(event, keys, false);\n\t};\n\tif (target) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(target, [\n\t\t\t\"pointerdown\",\n\t\t\t\"pointermove\",\n\t\t\t\"pointerup\"\n\t\t], handler, listenerOptions);\n\t\tuseEventListener(target, [\"pointerleave\", \"pointercancel\"], () => isInside.value = false, listenerOptions);\n\t}\n\treturn {\n\t\t...toRefs(state),\n\t\tisInside\n\t};\n}\n// usePointerLock/index.ts\n/**\n* Reactive pointer lock.\n*\n* @see https://vueuse.org/usePointerLock\n* @param target\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePointerLock(target, options = {}) {\n\tconst { document = defaultDocument } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => document && \"pointerLockElement\" in document);\n\tconst element = shallowRef();\n\tconst triggerElement = shallowRef();\n\tlet targetElement;\n\tif (isSupported.value) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(document, \"pointerlockchange\", () => {\n\t\t\tvar _pointerLockElement;\n\t\t\tconst currentElement = (_pointerLockElement = document.pointerLockElement) !== null && _pointerLockElement !== void 0 ? _pointerLockElement : element.value;\n\t\t\tif (targetElement && currentElement === targetElement) {\n\t\t\t\telement.value = document.pointerLockElement;\n\t\t\t\tif (!element.value) targetElement = triggerElement.value = null;\n\t\t\t}\n\t\t}, listenerOptions);\n\t\tuseEventListener(document, \"pointerlockerror\", () => {\n\t\t\tvar _pointerLockElement2;\n\t\t\tconst currentElement = (_pointerLockElement2 = document.pointerLockElement) !== null && _pointerLockElement2 !== void 0 ? _pointerLockElement2 : element.value;\n\t\t\tif (targetElement && currentElement === targetElement) {\n\t\t\t\tconst action = document.pointerLockElement ? \"release\" : \"acquire\";\n\t\t\t\tthrow new Error(`Failed to ${action} pointer lock.`);\n\t\t\t}\n\t\t}, listenerOptions);\n\t}\n\tasync function lock(e) {\n\t\tvar _unrefElement;\n\t\tif (!isSupported.value) throw new Error(\"Pointer Lock API is not supported by your browser.\");\n\t\ttriggerElement.value = e instanceof Event ? e.currentTarget : null;\n\t\ttargetElement = e instanceof Event ? (_unrefElement = unrefElement(target)) !== null && _unrefElement !== void 0 ? _unrefElement : triggerElement.value : unrefElement(e);\n\t\tif (!targetElement) throw new Error(\"Target element undefined.\");\n\t\ttargetElement.requestPointerLock();\n\t\treturn await until(element).toBe(targetElement);\n\t}\n\tasync function unlock() {\n\t\tif (!element.value) return false;\n\t\tdocument.exitPointerLock();\n\t\tawait until(element).toBeNull();\n\t\treturn true;\n\t}\n\treturn {\n\t\tisSupported,\n\t\telement,\n\t\ttriggerElement,\n\t\tlock,\n\t\tunlock\n\t};\n}\n// usePointerSwipe/index.ts\n/**\n* Reactive swipe detection based on PointerEvents.\n*\n* @see https://vueuse.org/usePointerSwipe\n* @param target\n* @param options\n*/\nfunction usePointerSwipe(target, options = {}) {\n\tconst targetRef = toRef(target);\n\tconst { threshold = 50, onSwipe, onSwipeEnd, onSwipeStart, disableTextSelect = false } = options;\n\tconst posStart = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst updatePosStart = (x, y) => {\n\t\tposStart.x = x;\n\t\tposStart.y = y;\n\t};\n\tconst posEnd = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst updatePosEnd = (x, y) => {\n\t\tposEnd.x = x;\n\t\tposEnd.y = y;\n\t};\n\tconst distanceX = computed(() => posStart.x - posEnd.x);\n\tconst distanceY = computed(() => posStart.y - posEnd.y);\n\tconst { max, abs } = Math;\n\tconst isThresholdExceeded = computed(() => max(abs(distanceX.value), abs(distanceY.value)) >= threshold);\n\tconst isSwiping = shallowRef(false);\n\tconst isPointerDown = shallowRef(false);\n\tconst direction = computed(() => {\n\t\tif (!isThresholdExceeded.value) return \"none\";\n\t\tif (abs(distanceX.value) > abs(distanceY.value)) return distanceX.value > 0 ? \"left\" : \"right\";\n\t\telse return distanceY.value > 0 ? \"up\" : \"down\";\n\t});\n\tconst eventIsAllowed = (e) => {\n\t\tvar _ref, _options$pointerTypes, _options$pointerTypes2;\n\t\tconst isReleasingButton = e.buttons === 0;\n\t\tconst isPrimaryButton = e.buttons === 1;\n\t\treturn (_ref = (_options$pointerTypes = (_options$pointerTypes2 = options.pointerTypes) === null || _options$pointerTypes2 === void 0 ? void 0 : _options$pointerTypes2.includes(e.pointerType)) !== null && _options$pointerTypes !== void 0 ? _options$pointerTypes : isReleasingButton || isPrimaryButton) !== null && _ref !== void 0 ? _ref : true;\n\t};\n\tconst listenerOptions = { passive: true };\n\tconst stops = [\n\t\tuseEventListener(target, \"pointerdown\", (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tisPointerDown.value = true;\n\t\t\tconst eventTarget = e.target;\n\t\t\teventTarget === null || eventTarget === void 0 || eventTarget.setPointerCapture(e.pointerId);\n\t\t\tconst { clientX: x, clientY: y } = e;\n\t\t\tupdatePosStart(x, y);\n\t\t\tupdatePosEnd(x, y);\n\t\t\tonSwipeStart === null || onSwipeStart === void 0 || onSwipeStart(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, \"pointermove\", (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tif (!isPointerDown.value) return;\n\t\t\tconst { clientX: x, clientY: y } = e;\n\t\t\tupdatePosEnd(x, y);\n\t\t\tif (!isSwiping.value && isThresholdExceeded.value) isSwiping.value = true;\n\t\t\tif (isSwiping.value) onSwipe === null || onSwipe === void 0 || onSwipe(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, [\"pointerup\", \"pointercancel\"], (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tif (isSwiping.value) onSwipeEnd === null || onSwipeEnd === void 0 || onSwipeEnd(e, direction.value);\n\t\t\tisPointerDown.value = false;\n\t\t\tisSwiping.value = false;\n\t\t}, listenerOptions)\n\t];\n\ttryOnMounted(() => {\n\t\tvar _targetRef$value;\n\t\t(_targetRef$value = targetRef.value) === null || _targetRef$value === void 0 || (_targetRef$value = _targetRef$value.style) === null || _targetRef$value === void 0 || _targetRef$value.setProperty(\"touch-action\", \"pan-y\");\n\t\tif (disableTextSelect) {\n\t\t\tvar _targetRef$value2, _targetRef$value3, _targetRef$value4;\n\t\t\t(_targetRef$value2 = targetRef.value) === null || _targetRef$value2 === void 0 || (_targetRef$value2 = _targetRef$value2.style) === null || _targetRef$value2 === void 0 || _targetRef$value2.setProperty(\"-webkit-user-select\", \"none\");\n\t\t\t(_targetRef$value3 = targetRef.value) === null || _targetRef$value3 === void 0 || (_targetRef$value3 = _targetRef$value3.style) === null || _targetRef$value3 === void 0 || _targetRef$value3.setProperty(\"-ms-user-select\", \"none\");\n\t\t\t(_targetRef$value4 = targetRef.value) === null || _targetRef$value4 === void 0 || (_targetRef$value4 = _targetRef$value4.style) === null || _targetRef$value4 === void 0 || _targetRef$value4.setProperty(\"user-select\", \"none\");\n\t\t}\n\t});\n\tconst stop = () => stops.forEach((s) => s());\n\treturn {\n\t\tisSwiping: shallowReadonly(isSwiping),\n\t\tdirection: shallowReadonly(direction),\n\t\tposStart: readonly(posStart),\n\t\tposEnd: readonly(posEnd),\n\t\tdistanceX,\n\t\tdistanceY,\n\t\tstop\n\t};\n}\n// usePreferredColorScheme/index.ts\n/**\n* Reactive prefers-color-scheme media query.\n*\n* @see https://vueuse.org/usePreferredColorScheme\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredColorScheme(options) {\n\tconst isLight = useMediaQuery(\"(prefers-color-scheme: light)\", options);\n\tconst isDark = useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n\treturn computed(() => {\n\t\tif (isDark.value) return \"dark\";\n\t\tif (isLight.value) return \"light\";\n\t\treturn \"no-preference\";\n\t});\n}\n// usePreferredContrast/index.ts\n/**\n* Reactive prefers-contrast media query.\n*\n* @see https://vueuse.org/usePreferredContrast\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredContrast(options) {\n\tconst isMore = useMediaQuery(\"(prefers-contrast: more)\", options);\n\tconst isLess = useMediaQuery(\"(prefers-contrast: less)\", options);\n\tconst isCustom = useMediaQuery(\"(prefers-contrast: custom)\", options);\n\treturn computed(() => {\n\t\tif (isMore.value) return \"more\";\n\t\tif (isLess.value) return \"less\";\n\t\tif (isCustom.value) return \"custom\";\n\t\treturn \"no-preference\";\n\t});\n}\n// usePreferredLanguages/index.ts\n/**\n* Reactive Navigator Languages.\n*\n* @see https://vueuse.org/usePreferredLanguages\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredLanguages(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tif (!window) return shallowRef([\"en\"]);\n\tconst navigator = window.navigator;\n\tconst value = shallowRef(navigator.languages);\n\tuseEventListener(window, \"languagechange\", () => {\n\t\tvalue.value = navigator.languages;\n\t}, { passive: true });\n\treturn value;\n}\n// usePreferredReducedMotion/index.ts\n/**\n* Reactive prefers-reduced-motion media query.\n*\n* @see https://vueuse.org/usePreferredReducedMotion\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredReducedMotion(options) {\n\tconst isReduced = useMediaQuery(\"(prefers-reduced-motion: reduce)\", options);\n\treturn computed(() => {\n\t\tif (isReduced.value) return \"reduce\";\n\t\treturn \"no-preference\";\n\t});\n}\n// usePreferredReducedTransparency/index.ts\n/**\n* Reactive prefers-reduced-transparency media query.\n*\n* @see https://vueuse.org/usePreferredReducedTransparency\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredReducedTransparency(options) {\n\tconst isReduced = useMediaQuery(\"(prefers-reduced-transparency: reduce)\", options);\n\treturn computed(() => {\n\t\tif (isReduced.value) return \"reduce\";\n\t\treturn \"no-preference\";\n\t});\n}\n// usePrevious/index.ts\nfunction usePrevious(value, initialValue) {\n\tconst previous = shallowRef(initialValue);\n\twatch(toRef(value), (_, oldValue) => {\n\t\tprevious.value = oldValue;\n\t}, { flush: \"sync\" });\n\treturn readonly(previous);\n}\n// useScreenSafeArea/index.ts\nconst topVarName = \"--vueuse-safe-area-top\";\nconst rightVarName = \"--vueuse-safe-area-right\";\nconst bottomVarName = \"--vueuse-safe-area-bottom\";\nconst leftVarName = \"--vueuse-safe-area-left\";\n/**\n* Reactive `env(safe-area-inset-*)`\n*\n* @see https://vueuse.org/useScreenSafeArea\n*/\nfunction useScreenSafeArea() {\n\tconst top = shallowRef(\"\");\n\tconst right = shallowRef(\"\");\n\tconst bottom = shallowRef(\"\");\n\tconst left = shallowRef(\"\");\n\tif (isClient) {\n\t\tconst topCssVar = useCssVar(topVarName);\n\t\tconst rightCssVar = useCssVar(rightVarName);\n\t\tconst bottomCssVar = useCssVar(bottomVarName);\n\t\tconst leftCssVar = useCssVar(leftVarName);\n\t\ttopCssVar.value = \"env(safe-area-inset-top, 0px)\";\n\t\trightCssVar.value = \"env(safe-area-inset-right, 0px)\";\n\t\tbottomCssVar.value = \"env(safe-area-inset-bottom, 0px)\";\n\t\tleftCssVar.value = \"env(safe-area-inset-left, 0px)\";\n\t\ttryOnMounted(update);\n\t\tuseEventListener(\"resize\", useDebounceFn(update), { passive: true });\n\t}\n\tfunction update() {\n\t\ttop.value = getValue(topVarName);\n\t\tright.value = getValue(rightVarName);\n\t\tbottom.value = getValue(bottomVarName);\n\t\tleft.value = getValue(leftVarName);\n\t}\n\treturn {\n\t\ttop,\n\t\tright,\n\t\tbottom,\n\t\tleft,\n\t\tupdate\n\t};\n}\nfunction getValue(position) {\n\treturn getComputedStyle(document.documentElement).getPropertyValue(position);\n}\n// useScriptTag/index.ts\n/**\n* Async script tag loading.\n*\n* @see https://vueuse.org/useScriptTag\n* @param src\n* @param onLoaded\n* @param options\n*/\nfunction useScriptTag(src, onLoaded = noop, options = {}) {\n\tconst { immediate = true, manual = false, type = \"text/javascript\", async = true, crossOrigin, referrerPolicy, noModule, defer, document = defaultDocument, attrs = {}, nonce = void 0 } = options;\n\tconst scriptTag = shallowRef(null);\n\tlet _promise = null;\n\t/**\n\t* Load the script specified via `src`.\n\t*\n\t* @param waitForScriptLoad Whether if the Promise should resolve once the \"load\" event is emitted by the <script> attribute, or right after appending it to the DOM.\n\t* @returns Promise<HTMLScriptElement>\n\t*/\n\tconst loadScript = (waitForScriptLoad) => new Promise((resolve, reject) => {\n\t\tconst resolveWithElement = (el) => {\n\t\t\tscriptTag.value = el;\n\t\t\tresolve(el);\n\t\t\treturn el;\n\t\t};\n\t\tif (!document) {\n\t\t\tresolve(false);\n\t\t\treturn;\n\t\t}\n\t\tlet shouldAppend = false;\n\t\tlet el = document.querySelector(`script[src=\"${toValue(src)}\"]`);\n\t\tif (!el) {\n\t\t\tel = document.createElement(\"script\");\n\t\t\tel.type = type;\n\t\t\tel.async = async;\n\t\t\tel.src = toValue(src);\n\t\t\tif (defer) el.defer = defer;\n\t\t\tif (crossOrigin) el.crossOrigin = crossOrigin;\n\t\t\tif (noModule) el.noModule = noModule;\n\t\t\tif (referrerPolicy) el.referrerPolicy = referrerPolicy;\n\t\t\tif (nonce) el.nonce = nonce;\n\t\t\tObject.entries(attrs).forEach(([name, value]) => el === null || el === void 0 ? void 0 : el.setAttribute(name, value));\n\t\t\tshouldAppend = true;\n\t\t} else if (el.hasAttribute(\"data-loaded\")) resolveWithElement(el);\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(el, \"error\", (event) => reject(event), listenerOptions);\n\t\tuseEventListener(el, \"abort\", (event) => reject(event), listenerOptions);\n\t\tuseEventListener(el, \"load\", () => {\n\t\t\tel.setAttribute(\"data-loaded\", \"true\");\n\t\t\tonLoaded(el);\n\t\t\tresolveWithElement(el);\n\t\t}, listenerOptions);\n\t\tif (shouldAppend) el = document.head.appendChild(el);\n\t\tif (!waitForScriptLoad) resolveWithElement(el);\n\t});\n\t/**\n\t* Exposed singleton wrapper for `loadScript`, avoiding calling it twice.\n\t*\n\t* @param waitForScriptLoad Whether if the Promise should resolve once the \"load\" event is emitted by the <script> attribute, or right after appending it to the DOM.\n\t* @returns Promise<HTMLScriptElement>\n\t*/\n\tconst load = (waitForScriptLoad = true) => {\n\t\tif (!_promise) _promise = loadScript(waitForScriptLoad);\n\t\treturn _promise;\n\t};\n\t/**\n\t* Unload the script specified by `src`.\n\t*/\n\tconst unload = () => {\n\t\tif (!document) return;\n\t\t_promise = null;\n\t\tif (scriptTag.value) scriptTag.value = null;\n\t\tconst el = document.querySelector(`script[src=\"${toValue(src)}\"]`);\n\t\tif (el) document.head.removeChild(el);\n\t};\n\tif (immediate && !manual) tryOnMounted(load);\n\tif (!manual) tryOnUnmounted(unload);\n\treturn {\n\t\tscriptTag,\n\t\tload,\n\t\tunload\n\t};\n}\n// useScrollLock/index.ts\nfunction checkOverflowScroll(ele) {\n\tconst style = window.getComputedStyle(ele);\n\tif (style.overflowX === \"scroll\" || style.overflowY === \"scroll\" || style.overflowX === \"auto\" && ele.clientWidth < ele.scrollWidth || style.overflowY === \"auto\" && ele.clientHeight < ele.scrollHeight) return true;\n\telse {\n\t\tconst parent = ele.parentNode;\n\t\tif (!parent || parent.tagName === \"BODY\") return false;\n\t\treturn checkOverflowScroll(parent);\n\t}\n}\nfunction preventDefault(rawEvent) {\n\tconst e = rawEvent || window.event;\n\tconst _target = e.target;\n\tif (checkOverflowScroll(_target)) return false;\n\tif (e.touches.length > 1) return true;\n\tif (e.preventDefault) e.preventDefault();\n\treturn false;\n}\nconst elInitialOverflow = /* @__PURE__ */ new WeakMap();\n/**\n* Lock scrolling of the element.\n*\n* @see https://vueuse.org/useScrollLock\n* @param element\n*/\nfunction useScrollLock(element, initialState = false) {\n\tconst isLocked = shallowRef(initialState);\n\tlet stopTouchMoveListener = null;\n\tlet initialOverflow = \"\";\n\twatch(toRef(element), (el) => {\n\t\tconst target = resolveElement(toValue(el));\n\t\tif (target) {\n\t\t\tconst ele = target;\n\t\t\tif (!elInitialOverflow.get(ele)) elInitialOverflow.set(ele, ele.style.overflow);\n\t\t\tif (ele.style.overflow !== \"hidden\") initialOverflow = ele.style.overflow;\n\t\t\tif (ele.style.overflow === \"hidden\") return isLocked.value = true;\n\t\t\tif (isLocked.value) return ele.style.overflow = \"hidden\";\n\t\t}\n\t}, { immediate: true });\n\tconst lock = () => {\n\t\tconst el = resolveElement(toValue(element));\n\t\tif (!el || isLocked.value) return;\n\t\tif (isIOS) stopTouchMoveListener = useEventListener(el, \"touchmove\", (e) => {\n\t\t\tpreventDefault(e);\n\t\t}, { passive: false });\n\t\tel.style.overflow = \"hidden\";\n\t\tisLocked.value = true;\n\t};\n\tconst unlock = () => {\n\t\tconst el = resolveElement(toValue(element));\n\t\tif (!el || !isLocked.value) return;\n\t\tif (isIOS) stopTouchMoveListener === null || stopTouchMoveListener === void 0 || stopTouchMoveListener();\n\t\tel.style.overflow = initialOverflow;\n\t\telInitialOverflow.delete(el);\n\t\tisLocked.value = false;\n\t};\n\ttryOnScopeDispose(unlock);\n\treturn computed({\n\t\tget() {\n\t\t\treturn isLocked.value;\n\t\t},\n\t\tset(v) {\n\t\t\tif (v) lock();\n\t\t\telse unlock();\n\t\t}\n\t});\n}\n// useSessionStorage/index.ts\n/**\n* Reactive SessionStorage.\n*\n* @see https://vueuse.org/useSessionStorage\n* @param key\n* @param initialValue\n* @param options\n*/\nfunction useSessionStorage(key, initialValue, options = {}) {\n\tconst { window = defaultWindow } = options;\n\treturn useStorage(key, initialValue, window === null || window === void 0 ? void 0 : window.sessionStorage, options);\n}\n// useShare/index.ts\n/**\n* Reactive Web Share API.\n*\n* @see https://vueuse.org/useShare\n* @param shareOptions\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useShare(shareOptions = {}, options = {}) {\n\tconst { navigator = defaultNavigator } = options;\n\tconst _navigator = navigator;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => _navigator && \"canShare\" in _navigator);\n\tconst share = async (overrideOptions = {}) => {\n\t\tif (isSupported.value) {\n\t\t\tconst data = {\n\t\t\t\t...toValue(shareOptions),\n\t\t\t\t...toValue(overrideOptions)\n\t\t\t};\n\t\t\tlet granted = false;\n\t\t\tif (_navigator.canShare) granted = _navigator.canShare(data);\n\t\t\tif (granted) return _navigator.share(data);\n\t\t}\n\t};\n\treturn {\n\t\tisSupported,\n\t\tshare\n\t};\n}\n// useSorted/index.ts\nconst defaultSortFn = (source, compareFn) => source.sort(compareFn);\nconst defaultCompare = (a, b) => a - b;\nfunction useSorted(...args) {\n\tconst [source] = args;\n\tlet compareFn = defaultCompare;\n\tlet options = {};\n\tif (args.length === 2) {\n\t\tif (typeof args[1] === \"object\") {\n\t\t\tvar _options$compareFn;\n\t\t\toptions = args[1];\n\t\t\tcompareFn = (_options$compareFn = options.compareFn) !== null && _options$compareFn !== void 0 ? _options$compareFn : defaultCompare;\n\t\t} else {\n\t\t\tvar _args$;\n\t\t\tcompareFn = (_args$ = args[1]) !== null && _args$ !== void 0 ? _args$ : defaultCompare;\n\t\t}\n\t} else if (args.length > 2) {\n\t\tvar _args$2, _args$3;\n\t\tcompareFn = (_args$2 = args[1]) !== null && _args$2 !== void 0 ? _args$2 : defaultCompare;\n\t\toptions = (_args$3 = args[2]) !== null && _args$3 !== void 0 ? _args$3 : {};\n\t}\n\tconst { dirty = false, sortFn = defaultSortFn } = options;\n\tif (!dirty) return computed(() => sortFn([...toValue(source)], compareFn));\n\twatchEffect(() => {\n\t\tconst result = sortFn(toValue(source), compareFn);\n\t\tif (isRef(source)) source.value = result;\n\t\telse source.splice(0, source.length, ...result);\n\t});\n\treturn source;\n}\n// useSpeechRecognition/index.ts\n/**\n* Reactive SpeechRecognition.\n*\n* @see https://vueuse.org/useSpeechRecognition\n* @see https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition SpeechRecognition\n* @param options\n*/\nfunction useSpeechRecognition(options = {}) {\n\tconst { interimResults = true, continuous = true, maxAlternatives = 1, window = defaultWindow } = options;\n\tconst lang = toRef(options.lang || \"en-US\");\n\tconst isListening = shallowRef(false);\n\tconst isFinal = shallowRef(false);\n\tconst result = shallowRef(\"\");\n\tconst confidence = shallowRef(0);\n\tconst error = shallowRef(void 0);\n\tlet recognition;\n\tconst start = () => {\n\t\tisListening.value = true;\n\t};\n\tconst stop = () => {\n\t\tisListening.value = false;\n\t};\n\tconst toggle = (value = !isListening.value) => {\n\t\tif (value) start();\n\t\telse stop();\n\t};\n\tconst SpeechRecognition = window && (window.SpeechRecognition || window.webkitSpeechRecognition);\n\tconst isSupported = /* @__PURE__ */ useSupported(() => SpeechRecognition);\n\tif (isSupported.value) {\n\t\trecognition = new SpeechRecognition();\n\t\trecognition.continuous = continuous;\n\t\trecognition.interimResults = interimResults;\n\t\trecognition.lang = toValue(lang);\n\t\trecognition.maxAlternatives = maxAlternatives;\n\t\trecognition.onstart = () => {\n\t\t\tisListening.value = true;\n\t\t\tisFinal.value = false;\n\t\t};\n\t\twatch(lang, (lang) => {\n\t\t\tif (recognition && !isListening.value) recognition.lang = lang;\n\t\t});\n\t\trecognition.onresult = (event) => {\n\t\t\tconst currentResult = event.results[event.resultIndex];\n\t\t\tconst { transcript, confidence: alternativeConfidence } = currentResult[0];\n\t\t\tisFinal.value = currentResult.isFinal;\n\t\t\tresult.value = transcript;\n\t\t\tconfidence.value = alternativeConfidence;\n\t\t\terror.value = void 0;\n\t\t};\n\t\trecognition.onerror = (event) => {\n\t\t\terror.value = event;\n\t\t};\n\t\trecognition.onend = () => {\n\t\t\tisListening.value = false;\n\t\t\trecognition.lang = toValue(lang);\n\t\t};\n\t\twatch(isListening, (newValue, oldValue) => {\n\t\t\tif (newValue === oldValue) return;\n\t\t\ttry {\n\t\t\t\tif (newValue) recognition.start();\n\t\t\t\telse recognition.stop();\n\t\t\t} catch (err) {\n\t\t\t\terror.value = err;\n\t\t\t}\n\t\t});\n\t}\n\ttryOnScopeDispose(() => {\n\t\tstop();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisListening,\n\t\tisFinal: shallowReadonly(isFinal),\n\t\trecognition,\n\t\tresult: shallowReadonly(result),\n\t\tconfidence: shallowReadonly(confidence),\n\t\terror,\n\t\ttoggle,\n\t\tstart,\n\t\tstop\n\t};\n}\n// useSpeechSynthesis/index.ts\n/**\n* Reactive SpeechSynthesis.\n*\n* @see https://vueuse.org/useSpeechSynthesis\n* @see https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis SpeechSynthesis\n*/\nfunction useSpeechSynthesis(text, options = {}) {\n\tconst { pitch = 1, rate = 1, volume = 1, window = defaultWindow, onBoundary } = options;\n\tconst synth = window && window.speechSynthesis;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => synth);\n\tconst isPlaying = shallowRef(false);\n\tconst status = shallowRef(\"init\");\n\tconst spokenText = toRef(text || \"\");\n\tconst lang = toRef(options.lang || \"en-US\");\n\tconst error = shallowRef(void 0);\n\tconst toggle = (value = !isPlaying.value) => {\n\t\tisPlaying.value = value;\n\t};\n\tconst bindEventsForUtterance = (utterance) => {\n\t\tutterance.lang = toValue(lang);\n\t\tutterance.voice = toValue(options.voice) || null;\n\t\tutterance.pitch = toValue(pitch);\n\t\tutterance.rate = toValue(rate);\n\t\tutterance.volume = toValue(volume);\n\t\tutterance.onstart = () => {\n\t\t\tisPlaying.value = true;\n\t\t\tstatus.value = \"play\";\n\t\t};\n\t\tutterance.onpause = () => {\n\t\t\tisPlaying.value = false;\n\t\t\tstatus.value = \"pause\";\n\t\t};\n\t\tutterance.onresume = () => {\n\t\t\tisPlaying.value = true;\n\t\t\tstatus.value = \"play\";\n\t\t};\n\t\tutterance.onend = () => {\n\t\t\tisPlaying.value = false;\n\t\t\tstatus.value = \"end\";\n\t\t};\n\t\tutterance.onerror = (event) => {\n\t\t\terror.value = event;\n\t\t};\n\t\tutterance.onboundary = (event) => {\n\t\t\tonBoundary === null || onBoundary === void 0 || onBoundary(event);\n\t\t};\n\t};\n\tconst utterance = computed(() => {\n\t\tisPlaying.value = false;\n\t\tstatus.value = \"init\";\n\t\tconst newUtterance = new SpeechSynthesisUtterance(spokenText.value);\n\t\tbindEventsForUtterance(newUtterance);\n\t\treturn newUtterance;\n\t});\n\tconst speak = () => {\n\t\tsynth.cancel();\n\t\tif (utterance) synth.speak(utterance.value);\n\t};\n\tconst stop = () => {\n\t\tsynth.cancel();\n\t\tisPlaying.value = false;\n\t};\n\tif (isSupported.value) {\n\t\tbindEventsForUtterance(utterance.value);\n\t\twatch(lang, (lang) => {\n\t\t\tif (utterance.value && !isPlaying.value) utterance.value.lang = lang;\n\t\t});\n\t\tif (options.voice) watch(options.voice, () => {\n\t\t\tsynth.cancel();\n\t\t});\n\t\twatch(isPlaying, () => {\n\t\t\tif (isPlaying.value) synth.resume();\n\t\t\telse synth.pause();\n\t\t});\n\t}\n\ttryOnScopeDispose(() => {\n\t\tisPlaying.value = false;\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisPlaying,\n\t\tstatus,\n\t\tutterance,\n\t\terror,\n\t\tstop,\n\t\ttoggle,\n\t\tspeak\n\t};\n}\n// useStepper/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useStepper(steps, initialStep) {\n\tconst stepsRef = ref(steps);\n\tconst stepNames = computed(() => Array.isArray(stepsRef.value) ? stepsRef.value : Object.keys(stepsRef.value));\n\tconst index = ref(stepNames.value.indexOf(initialStep !== null && initialStep !== void 0 ? initialStep : stepNames.value[0]));\n\tconst current = computed(() => at(index.value));\n\tconst isFirst = computed(() => index.value === 0);\n\tconst isLast = computed(() => index.value === stepNames.value.length - 1);\n\tconst next = computed(() => stepNames.value[index.value + 1]);\n\tconst previous = computed(() => stepNames.value[index.value - 1]);\n\tfunction at(index) {\n\t\tif (Array.isArray(stepsRef.value)) return stepsRef.value[index];\n\t\treturn stepsRef.value[stepNames.value[index]];\n\t}\n\tfunction get(step) {\n\t\tif (!stepNames.value.includes(step)) return;\n\t\treturn at(stepNames.value.indexOf(step));\n\t}\n\tfunction goTo(step) {\n\t\tif (stepNames.value.includes(step)) index.value = stepNames.value.indexOf(step);\n\t}\n\tfunction goToNext() {\n\t\tif (isLast.value) return;\n\t\tindex.value++;\n\t}\n\tfunction goToPrevious() {\n\t\tif (isFirst.value) return;\n\t\tindex.value--;\n\t}\n\tfunction goBackTo(step) {\n\t\tif (isAfter(step)) goTo(step);\n\t}\n\tfunction isNext(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value + 1;\n\t}\n\tfunction isPrevious(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value - 1;\n\t}\n\tfunction isCurrent(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value;\n\t}\n\tfunction isBefore(step) {\n\t\treturn index.value < stepNames.value.indexOf(step);\n\t}\n\tfunction isAfter(step) {\n\t\treturn index.value > stepNames.value.indexOf(step);\n\t}\n\treturn {\n\t\tsteps: stepsRef,\n\t\tstepNames,\n\t\tindex,\n\t\tcurrent,\n\t\tnext,\n\t\tprevious,\n\t\tisFirst,\n\t\tisLast,\n\t\tat,\n\t\tget,\n\t\tgoTo,\n\t\tgoToNext,\n\t\tgoToPrevious,\n\t\tgoBackTo,\n\t\tisNext,\n\t\tisPrevious,\n\t\tisCurrent,\n\t\tisBefore,\n\t\tisAfter\n\t};\n}\n// useStorageAsync/index.ts\n/**\n* Reactive Storage with async support.\n*\n* @see https://vueuse.org/useStorageAsync\n* @param key\n* @param initialValue\n* @param storage\n* @param options\n*/\nfunction useStorageAsync(key, initialValue, storage, options = {}) {\n\tvar _options$serializer;\n\tconst { flush = \"pre\", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window = defaultWindow, eventFilter, onError = (e) => {\n\t\tconsole.error(e);\n\t}, onReady } = options;\n\tconst rawInit = toValue(initialValue);\n\tconst type = guessSerializerType(rawInit);\n\tconst data = (shallow ? shallowRef : ref)(toValue(initialValue));\n\tconst serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];\n\tif (!storage) try {\n\t\tstorage = getSSRHandler(\"getDefaultStorageAsync\", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();\n\t} catch (e) {\n\t\tonError(e);\n\t}\n\tasync function read(event) {\n\t\tif (!storage || event && event.key !== key) return;\n\t\ttry {\n\t\t\tconst rawValue = event ? event.newValue : await storage.getItem(key);\n\t\t\tif (rawValue == null) {\n\t\t\t\tdata.value = rawInit;\n\t\t\t\tif (writeDefaults && rawInit !== null) await storage.setItem(key, await serializer.write(rawInit));\n\t\t\t} else if (mergeDefaults) {\n\t\t\t\tconst value = await serializer.read(rawValue);\n\t\t\t\tif (typeof mergeDefaults === \"function\") data.value = mergeDefaults(value, rawInit);\n\t\t\t\telse if (type === \"object\" && !Array.isArray(value)) data.value = {\n\t\t\t\t\t...rawInit,\n\t\t\t\t\t...value\n\t\t\t\t};\n\t\t\t\telse data.value = value;\n\t\t\t} else data.value = await serializer.read(rawValue);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}\n\tconst promise = new Promise((resolve) => {\n\t\tread().then(() => {\n\t\t\tonReady === null || onReady === void 0 || onReady(data.value);\n\t\t\tresolve(data);\n\t\t});\n\t});\n\tif (window && listenToStorageChanges) useEventListener(window, \"storage\", (e) => Promise.resolve().then(() => read(e)), { passive: true });\n\tif (storage) watchWithFilter(data, async () => {\n\t\ttry {\n\t\t\tif (data.value == null) await storage.removeItem(key);\n\t\t\telse await storage.setItem(key, await serializer.write(data.value));\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\teventFilter\n\t});\n\tObject.assign(data, {\n\t\tthen: promise.then.bind(promise),\n\t\tcatch: promise.catch.bind(promise)\n\t});\n\treturn data;\n}\n// useStyleTag/index.ts\nlet _id = 0;\nconst _refCount = /* @__PURE__ */ new WeakMap();\n/**\n* Inject <style> element in head.\n*\n* Overload: Omitted id\n*\n* @see https://vueuse.org/useStyleTag\n* @param css\n* @param options\n*/\nfunction useStyleTag(css, options = {}) {\n\tconst isLoaded = shallowRef(false);\n\tconst { document = defaultDocument, immediate = true, manual = false, id = `vueuse_styletag_${++_id}` } = options;\n\tconst cssRef = shallowRef(css);\n\tlet stop = () => {};\n\tconst load = () => {\n\t\tvar _refCount$get;\n\t\tif (!document) return;\n\t\tconst el = document.getElementById(id) || document.createElement(\"style\");\n\t\tif (!el.isConnected) {\n\t\t\tel.id = id;\n\t\t\tif (options.nonce) el.nonce = options.nonce;\n\t\t\tif (options.media) el.media = options.media;\n\t\t\tdocument.head.appendChild(el);\n\t\t}\n\t\tif (isLoaded.value) return;\n\t\t_refCount.set(el, ((_refCount$get = _refCount.get(el)) !== null && _refCount$get !== void 0 ? _refCount$get : 0) + 1);\n\t\tstop = watch(cssRef, (value) => {\n\t\t\tel.textContent = value;\n\t\t}, { immediate: true });\n\t\tisLoaded.value = true;\n\t};\n\tconst unload = () => {\n\t\tif (!document || !isLoaded.value) return;\n\t\tstop();\n\t\tconst el = document.getElementById(id);\n\t\tif (el) {\n\t\t\tvar _refCount$get2;\n\t\t\tconst count = ((_refCount$get2 = _refCount.get(el)) !== null && _refCount$get2 !== void 0 ? _refCount$get2 : 1) - 1;\n\t\t\tif (count <= 0) {\n\t\t\t\t_refCount.delete(el);\n\t\t\t\tdocument.head.removeChild(el);\n\t\t\t} else _refCount.set(el, count);\n\t\t}\n\t\tisLoaded.value = false;\n\t};\n\tif (immediate && !manual) tryOnMounted(load);\n\tif (!manual) tryOnScopeDispose(unload);\n\treturn {\n\t\tid,\n\t\tcss: cssRef,\n\t\tunload,\n\t\tload,\n\t\tisLoaded: shallowReadonly(isLoaded)\n\t};\n}\n// useSwipe/index.ts\n/**\n* Reactive swipe detection.\n*\n* @see https://vueuse.org/useSwipe\n* @param target\n* @param options\n*/\nfunction useSwipe(target, options = {}) {\n\tconst { threshold = 50, onSwipe, onSwipeEnd, onSwipeStart, passive = true } = options;\n\tconst coordsStart = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst coordsEnd = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst diffX = computed(() => coordsStart.x - coordsEnd.x);\n\tconst diffY = computed(() => coordsStart.y - coordsEnd.y);\n\tconst { max, abs } = Math;\n\tconst isThresholdExceeded = computed(() => max(abs(diffX.value), abs(diffY.value)) >= threshold);\n\tconst isSwiping = shallowRef(false);\n\tconst direction = computed(() => {\n\t\tif (!isThresholdExceeded.value) return \"none\";\n\t\tif (abs(diffX.value) > abs(diffY.value)) return diffX.value > 0 ? \"left\" : \"right\";\n\t\telse return diffY.value > 0 ? \"up\" : \"down\";\n\t});\n\tconst getTouchEventCoords = (e) => [e.touches[0].clientX, e.touches[0].clientY];\n\tconst updateCoordsStart = (x, y) => {\n\t\tcoordsStart.x = x;\n\t\tcoordsStart.y = y;\n\t};\n\tconst updateCoordsEnd = (x, y) => {\n\t\tcoordsEnd.x = x;\n\t\tcoordsEnd.y = y;\n\t};\n\tconst listenerOptions = {\n\t\tpassive,\n\t\tcapture: !passive\n\t};\n\tconst onTouchEnd = (e) => {\n\t\tif (isSwiping.value) onSwipeEnd === null || onSwipeEnd === void 0 || onSwipeEnd(e, direction.value);\n\t\tisSwiping.value = false;\n\t};\n\tconst stops = [\n\t\tuseEventListener(target, \"touchstart\", (e) => {\n\t\t\tif (e.touches.length !== 1) return;\n\t\t\tconst [x, y] = getTouchEventCoords(e);\n\t\t\tupdateCoordsStart(x, y);\n\t\t\tupdateCoordsEnd(x, y);\n\t\t\tonSwipeStart === null || onSwipeStart === void 0 || onSwipeStart(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, \"touchmove\", (e) => {\n\t\t\tif (e.touches.length !== 1) return;\n\t\t\tconst [x, y] = getTouchEventCoords(e);\n\t\t\tupdateCoordsEnd(x, y);\n\t\t\tif (listenerOptions.capture && !listenerOptions.passive && Math.abs(diffX.value) > Math.abs(diffY.value)) e.preventDefault();\n\t\t\tif (!isSwiping.value && isThresholdExceeded.value) isSwiping.value = true;\n\t\t\tif (isSwiping.value) onSwipe === null || onSwipe === void 0 || onSwipe(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, [\"touchend\", \"touchcancel\"], onTouchEnd, listenerOptions)\n\t];\n\tconst stop = () => stops.forEach((s) => s());\n\treturn {\n\t\tisSwiping,\n\t\tdirection,\n\t\tcoordsStart,\n\t\tcoordsEnd,\n\t\tlengthX: diffX,\n\t\tlengthY: diffY,\n\t\tstop\n\t};\n}\n// useTemplateRefsList/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useTemplateRefsList() {\n\tconst refs = ref([]);\n\trefs.value.set = (el) => {\n\t\tif (el) refs.value.push(el);\n\t};\n\tonBeforeUpdate(() => {\n\t\trefs.value.length = 0;\n\t});\n\treturn refs;\n}\n// useTemporalNow/index.ts\nfunction resolveTemporal(custom) {\n\tif (custom) return custom;\n\treturn typeof Temporal === \"undefined\" ? void 0 : Temporal;\n}\nfunction assertTemporal(impl) {\n\tif (!impl) throw new Error(\"[VueUse] No `Temporal` implementation found. See https://vueuse.org/useTemporalNow for details.\");\n\treturn impl;\n}\n/**\n* Reactive Temporal API with timezone and calendar support.\n*\n* @see https://vueuse.org/useTemporalNow\n* @param options - Configuration options\n*/\nfunction useTemporalNow(options = {}) {\n\tconst { timezone: initialTimezone = \"UTC\", calendar: initialCalendar = \"gregory\", scheduler = useRafFn, temporal: customTemporal } = options;\n\tconst TemporalImpl = assertTemporal(resolveTemporal(customTemporal));\n\tconst timezone = shallowRef(initialTimezone);\n\tconst calendar = shallowRef(initialCalendar);\n\tconst now = shallowRef(TemporalImpl.Now.zonedDateTimeISO(timezone.value).withCalendar(calendar.value));\n\tfunction updateNow() {\n\t\tnow.value = TemporalImpl.Now.zonedDateTimeISO(timezone.value).withCalendar(calendar.value);\n\t}\n\tconst { isActive, pause, resume } = scheduler(updateNow);\n\twatch([timezone, calendar], updateNow);\n\tconst toTimezone = (tz) => now.value.withTimeZone(tz);\n\tconst toCalendar = (cal) => now.value.withCalendar(cal);\n\tconst toPlainDate = () => now.value.toPlainDate();\n\tconst toPlainTime = () => now.value.toPlainTime();\n\tconst toPlainDateTime = () => now.value.toPlainDateTime();\n\tconst format = (formatOptions) => now.value.toLocaleString(void 0, formatOptions);\n\tconst add = (duration) => now.value.add(duration);\n\tconst subtract = (duration) => now.value.subtract(duration);\n\tconst compare = (other) => TemporalImpl.ZonedDateTime.compare(now.value, other);\n\treturn {\n\t\tnow,\n\t\ttimezone,\n\t\tcalendar,\n\t\ttoTimezone,\n\t\ttoCalendar,\n\t\ttoPlainDate,\n\t\ttoPlainTime,\n\t\ttoPlainDateTime,\n\t\tformat,\n\t\tadd,\n\t\tsubtract,\n\t\tcompare,\n\t\tisActive,\n\t\tpause,\n\t\tresume\n\t};\n}\n// useTextDirection/index.ts\n/**\n* Reactive dir of the element's text.\n*\n* @see https://vueuse.org/useTextDirection\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useTextDirection(options = {}) {\n\tconst { document = defaultDocument, selector = \"html\", observe = false, initialValue = \"ltr\" } = options;\n\tfunction getValue() {\n\t\tvar _ref, _document$querySelect;\n\t\treturn (_ref = document === null || document === void 0 || (_document$querySelect = document.querySelector(selector)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.getAttribute(\"dir\")) !== null && _ref !== void 0 ? _ref : initialValue;\n\t}\n\tconst dir = shallowRef(getValue());\n\ttryOnMounted(() => dir.value = getValue());\n\tif (observe && document) useMutationObserver(document.querySelector(selector), () => dir.value = getValue(), { attributes: true });\n\treturn computed({\n\t\tget() {\n\t\t\treturn dir.value;\n\t\t},\n\t\tset(v) {\n\t\t\tvar _document$querySelect2, _document$querySelect3;\n\t\t\tdir.value = v;\n\t\t\tif (!document) return;\n\t\t\tif (dir.value) (_document$querySelect2 = document.querySelector(selector)) === null || _document$querySelect2 === void 0 || _document$querySelect2.setAttribute(\"dir\", dir.value);\n\t\t\telse (_document$querySelect3 = document.querySelector(selector)) === null || _document$querySelect3 === void 0 || _document$querySelect3.removeAttribute(\"dir\");\n\t\t}\n\t});\n}\n// useTextSelection/index.ts\nfunction getRangesFromSelection(selection) {\n\tvar _selection$rangeCount;\n\tconst rangeCount = (_selection$rangeCount = selection.rangeCount) !== null && _selection$rangeCount !== void 0 ? _selection$rangeCount : 0;\n\treturn Array.from({ length: rangeCount }, (_, i) => selection.getRangeAt(i));\n}\n/**\n* Reactively track user text selection based on [`Window.getSelection`](https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection).\n*\n* @see https://vueuse.org/useTextSelection\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useTextSelection(options = {}) {\n\tvar _window$getSelection;\n\tconst { window = defaultWindow } = options;\n\tconst selection = shallowRef((_window$getSelection = window === null || window === void 0 ? void 0 : window.getSelection()) !== null && _window$getSelection !== void 0 ? _window$getSelection : null);\n\tconst text = computed(() => {\n\t\tvar _selection$value$toSt, _selection$value;\n\t\treturn (_selection$value$toSt = (_selection$value = selection.value) === null || _selection$value === void 0 ? void 0 : _selection$value.toString()) !== null && _selection$value$toSt !== void 0 ? _selection$value$toSt : \"\";\n\t});\n\tconst ranges = computed(() => selection.value ? getRangesFromSelection(selection.value) : []);\n\tconst rects = computed(() => ranges.value.map((range) => range.getBoundingClientRect()));\n\tfunction onSelectionChange() {\n\t\tselection.value = null;\n\t\tif (window) selection.value = window.getSelection();\n\t}\n\tif (window) useEventListener(window.document, \"selectionchange\", onSelectionChange, { passive: true });\n\treturn {\n\t\ttext,\n\t\trects,\n\t\tranges,\n\t\tselection\n\t};\n}\n// useTextareaAutosize/index.ts\n/**\n* Call window.requestAnimationFrame(), if not available, just call the function\n*\n* @param window\n* @param fn\n*/\nfunction tryRequestAnimationFrame(window = defaultWindow, fn) {\n\tif (window && typeof window.requestAnimationFrame === \"function\") window.requestAnimationFrame(fn);\n\telse fn();\n}\n/**\n* @deprecated Use CSS `field-sizing: content` instead when supported by target browsers.\n*/\nfunction useTextareaAutosize(options = {}) {\n\tvar _options$input, _options$styleProp;\n\tconst { window = defaultWindow } = options;\n\tconst textarea = toRef(options === null || options === void 0 ? void 0 : options.element);\n\tconst input = toRef((_options$input = options === null || options === void 0 ? void 0 : options.input) !== null && _options$input !== void 0 ? _options$input : \"\");\n\tconst styleProp = (_options$styleProp = options === null || options === void 0 ? void 0 : options.styleProp) !== null && _options$styleProp !== void 0 ? _options$styleProp : \"height\";\n\tconst textareaScrollHeight = shallowRef(1);\n\tconst textareaOldWidth = shallowRef(0);\n\tfunction triggerResize() {\n\t\tvar _textarea$value;\n\t\tif (!textarea.value) return;\n\t\tlet height = \"\";\n\t\tconst maxHeight = options === null || options === void 0 ? void 0 : options.maxHeight;\n\t\ttextarea.value.style[styleProp] = \"1px\";\n\t\ttextareaScrollHeight.value = (_textarea$value = textarea.value) === null || _textarea$value === void 0 ? void 0 : _textarea$value.scrollHeight;\n\t\tconst _styleTarget = toValue(options === null || options === void 0 ? void 0 : options.styleTarget);\n\t\tconst styleHeight = maxHeight != null ? `${Math.min(textareaScrollHeight.value, maxHeight)}px` : `${textareaScrollHeight.value}px`;\n\t\tif (_styleTarget) _styleTarget.style[styleProp] = styleHeight;\n\t\telse height = styleHeight;\n\t\ttextarea.value.style[styleProp] = height;\n\t}\n\twatch([input, textarea], () => nextTick(triggerResize), { immediate: true });\n\twatch(textareaScrollHeight, () => {\n\t\tvar _options$onResize;\n\t\treturn options === null || options === void 0 || (_options$onResize = options.onResize) === null || _options$onResize === void 0 ? void 0 : _options$onResize.call(options);\n\t});\n\tuseResizeObserver(textarea, ([{ contentRect }]) => {\n\t\tif (textareaOldWidth.value === contentRect.width) return;\n\t\ttryRequestAnimationFrame(window, () => {\n\t\t\ttextareaOldWidth.value = contentRect.width;\n\t\t\ttriggerResize();\n\t\t});\n\t});\n\tif (options === null || options === void 0 ? void 0 : options.watch) watch(options.watch, triggerResize, {\n\t\timmediate: true,\n\t\tdeep: true\n\t});\n\treturn {\n\t\ttextarea,\n\t\tinput,\n\t\ttriggerResize\n\t};\n}\n// useThrottledRefHistory/index.ts\n/**\n* Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with throttled filter.\n*\n* @see https://vueuse.org/useThrottledRefHistory\n* @param source\n* @param options\n*/\nfunction useThrottledRefHistory(source, options = {}) {\n\tconst { throttle = 200, trailing = true } = options;\n\tconst filter = throttleFilter(throttle, trailing);\n\treturn { ...useRefHistory(source, {\n\t\t...options,\n\t\teventFilter: filter\n\t}) };\n}\n// useTimeAgo/index.ts\nconst DEFAULT_UNITS = [\n\t{\n\t\tmax: 6e4,\n\t\tvalue: 1e3,\n\t\tname: \"second\"\n\t},\n\t{\n\t\tmax: 276e4,\n\t\tvalue: 6e4,\n\t\tname: \"minute\"\n\t},\n\t{\n\t\tmax: 72e6,\n\t\tvalue: 36e5,\n\t\tname: \"hour\"\n\t},\n\t{\n\t\tmax: 5184e5,\n\t\tvalue: 864e5,\n\t\tname: \"day\"\n\t},\n\t{\n\t\tmax: 24192e5,\n\t\tvalue: 6048e5,\n\t\tname: \"week\"\n\t},\n\t{\n\t\tmax: 28512e6,\n\t\tvalue: 2592e6,\n\t\tname: \"month\"\n\t},\n\t{\n\t\tmax: Number.POSITIVE_INFINITY,\n\t\tvalue: 31536e6,\n\t\tname: \"year\"\n\t}\n];\nconst DEFAULT_MESSAGES = {\n\tjustNow: \"just now\",\n\tpast: (n) => /\\d/.test(n) ? `${n} ago` : n,\n\tfuture: (n) => /\\d/.test(n) ? `in ${n}` : n,\n\tmonth: (n, past) => n === 1 ? past ? \"last month\" : \"next month\" : `${n} month${n > 1 ? \"s\" : \"\"}`,\n\tyear: (n, past) => n === 1 ? past ? \"last year\" : \"next year\" : `${n} year${n > 1 ? \"s\" : \"\"}`,\n\tday: (n, past) => n === 1 ? past ? \"yesterday\" : \"tomorrow\" : `${n} day${n > 1 ? \"s\" : \"\"}`,\n\tweek: (n, past) => n === 1 ? past ? \"last week\" : \"next week\" : `${n} week${n > 1 ? \"s\" : \"\"}`,\n\thour: (n) => `${n} hour${n > 1 ? \"s\" : \"\"}`,\n\tminute: (n) => `${n} minute${n > 1 ? \"s\" : \"\"}`,\n\tsecond: (n) => `${n} second${n > 1 ? \"s\" : \"\"}`,\n\tinvalid: \"\"\n};\nfunction DEFAULT_FORMATTER(date) {\n\treturn date.toISOString().slice(0, 10);\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction useTimeAgo(time, options = {}) {\n\tconst { controls: exposeControls = false, scheduler = (cb) => useIntervalFn(cb, 3e4) } = options;\n\tconst { now, ...controls } = /* @__PURE__ */ useNow({\n\t\tscheduler,\n\t\tcontrols: true\n\t});\n\tconst timeAgo = computed(() => formatTimeAgo(new Date(toValue(time)), options, toValue(now)));\n\tif (exposeControls) return {\n\t\ttimeAgo,\n\t\t...controls\n\t};\n\telse return timeAgo;\n}\nfunction formatTimeAgo(from, options = {}, now = Date.now()) {\n\tconst { max, messages = DEFAULT_MESSAGES, fullDateFormatter = DEFAULT_FORMATTER, units = DEFAULT_UNITS, showSecond = false, rounding = \"round\" } = options;\n\tconst roundFn = typeof rounding === \"number\" ? (n) => +n.toFixed(rounding) : Math[rounding];\n\tconst diff = +now - +from;\n\tconst absDiff = Math.abs(diff);\n\tfunction getValue(diff, unit) {\n\t\treturn roundFn(Math.abs(diff) / unit.value);\n\t}\n\tfunction format(diff, unit) {\n\t\tconst val = getValue(diff, unit);\n\t\tconst past = diff > 0;\n\t\tconst str = applyFormat(unit.name, val, past);\n\t\treturn applyFormat(past ? \"past\" : \"future\", str, past);\n\t}\n\tfunction applyFormat(name, val, isPast) {\n\t\tconst formatter = messages[name];\n\t\tif (typeof formatter === \"function\") return formatter(val, isPast);\n\t\treturn formatter.replace(\"{0}\", val.toString());\n\t}\n\tif (absDiff < 6e4 && !showSecond) return messages.justNow;\n\tif (typeof max === \"number\" && absDiff > max) return fullDateFormatter(new Date(from));\n\tif (typeof max === \"string\") {\n\t\tvar _units$find;\n\t\tconst unitMax = (_units$find = units.find((i) => i.name === max)) === null || _units$find === void 0 ? void 0 : _units$find.max;\n\t\tif (unitMax && absDiff > unitMax) return fullDateFormatter(new Date(from));\n\t}\n\tfor (const [idx, unit] of units.entries()) {\n\t\tif (getValue(diff, unit) <= 0 && units[idx - 1]) return format(diff, units[idx - 1]);\n\t\tif (absDiff < unit.max) return format(diff, unit);\n\t}\n\treturn messages.invalid;\n}\n// useTimeAgoIntl/index.ts\nconst UNITS = [\n\t{\n\t\tname: \"year\",\n\t\tms: 31536e6\n\t},\n\t{\n\t\tname: \"month\",\n\t\tms: 2592e6\n\t},\n\t{\n\t\tname: \"week\",\n\t\tms: 6048e5\n\t},\n\t{\n\t\tname: \"day\",\n\t\tms: 864e5\n\t},\n\t{\n\t\tname: \"hour\",\n\t\tms: 36e5\n\t},\n\t{\n\t\tname: \"minute\",\n\t\tms: 6e4\n\t},\n\t{\n\t\tname: \"second\",\n\t\tms: 1e3\n\t}\n];\nfunction useTimeAgoIntl(time, options = {}) {\n\tconst { controls: exposeControls = false, scheduler = (cb) => useIntervalFn(cb, 3e4) } = options;\n\tconst { now, ...controls } = /* @__PURE__ */ useNow({\n\t\tscheduler,\n\t\tcontrols: true\n\t});\n\tconst result = computed(() => getTimeAgoIntlResult(new Date(toValue(time)), options, toValue(now)));\n\tconst parts = computed(() => result.value.parts);\n\tconst timeAgoIntl = computed(() => formatTimeAgoIntlParts(parts.value, {\n\t\t...options,\n\t\tlocale: result.value.resolvedLocale\n\t}));\n\treturn exposeControls ? {\n\t\ttimeAgoIntl,\n\t\tparts,\n\t\t...controls\n\t} : timeAgoIntl;\n}\n/**\n* Non-reactive version of useTimeAgoIntl\n*/\nfunction formatTimeAgoIntl(from, options = {}, now = Date.now()) {\n\tconst { parts, resolvedLocale } = getTimeAgoIntlResult(from, options, now);\n\treturn formatTimeAgoIntlParts(parts, {\n\t\t...options,\n\t\tlocale: resolvedLocale\n\t});\n}\n/**\n* Get parts from `Intl.RelativeTimeFormat.formatToParts`.\n*/\nfunction getTimeAgoIntlResult(from, options = {}, now = Date.now()) {\n\tvar _options$units;\n\tconst { locale, relativeTimeFormatOptions = { numeric: \"auto\" } } = options;\n\tconst rtf = new Intl.RelativeTimeFormat(locale, relativeTimeFormatOptions);\n\tconst { locale: resolvedLocale } = rtf.resolvedOptions();\n\tconst diff = +from - +now;\n\tconst absDiff = Math.abs(diff);\n\tconst units = (_options$units = options.units) !== null && _options$units !== void 0 ? _options$units : UNITS;\n\tfor (const { name, ms } of units) if (absDiff >= ms) return {\n\t\tresolvedLocale,\n\t\tparts: rtf.formatToParts(Math.round(diff / ms), name)\n\t};\n\treturn {\n\t\tresolvedLocale,\n\t\tparts: rtf.formatToParts(0, units[units.length - 1].name)\n\t};\n}\n/**\n* Format parts into a string\n*/\nfunction formatTimeAgoIntlParts(parts, options = {}) {\n\tconst { insertSpace = true, joinParts, locale } = options;\n\tif (typeof joinParts === \"function\") return joinParts(parts, locale);\n\tif (!insertSpace) return parts.map((part) => part.value).join(\"\");\n\treturn parts.map((part) => part.value.trim()).join(\" \");\n}\n// useTimeoutPoll/index.ts\nfunction useTimeoutPoll(fn, interval, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tconst { start } = useTimeoutFn(loop, interval, { immediate });\n\tconst isActive = shallowRef(false);\n\tasync function loop() {\n\t\tif (!isActive.value) return;\n\t\tawait fn();\n\t\tstart();\n\t}\n\tfunction resume() {\n\t\tif (!isActive.value) {\n\t\t\tisActive.value = true;\n\t\t\tif (immediateCallback) fn();\n\t\t\tstart();\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t}\n\tif (immediate && isClient) resume();\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive,\n\t\tpause,\n\t\tresume\n\t};\n}\n// useTimestamp/index.ts\nfunction useTimestamp(options = {}) {\n\tconst { controls: exposeControls = false, offset = 0, scheduler = useRafFn, callback } = options;\n\tconst ts = shallowRef(timestamp() + offset);\n\tconst update = () => ts.value = timestamp() + offset;\n\tconst controls = scheduler(callback ? () => {\n\t\tupdate();\n\t\tcallback(ts.value);\n\t} : update);\n\tif (exposeControls) return {\n\t\ttimestamp: ts,\n\t\t...controls\n\t};\n\telse return ts;\n}\n// useTitle/index.ts\nfunction useTitle(newTitle = null, options = {}) {\n\tvar _document$title, _ref;\n\tconst { document = defaultDocument, restoreOnUnmount = (t) => t } = options;\n\tconst originalTitle = (_document$title = document === null || document === void 0 ? void 0 : document.title) !== null && _document$title !== void 0 ? _document$title : \"\";\n\tconst title = toRef((_ref = newTitle !== null && newTitle !== void 0 ? newTitle : document === null || document === void 0 ? void 0 : document.title) !== null && _ref !== void 0 ? _ref : null);\n\tconst isReadonly = !!(newTitle && typeof newTitle === \"function\");\n\tfunction format(t) {\n\t\tif (!(\"titleTemplate\" in options)) return t;\n\t\tconst template = options.titleTemplate || \"%s\";\n\t\treturn typeof template === \"function\" ? template(t) : toValue(template).replace(/%s/g, t);\n\t}\n\twatch(title, (newValue, oldValue) => {\n\t\tif (newValue !== oldValue && document) document.title = format(newValue !== null && newValue !== void 0 ? newValue : \"\");\n\t}, { immediate: true });\n\tif (options.observe && !options.titleTemplate && document && !isReadonly) {\n\t\tvar _document$head;\n\t\tuseMutationObserver((_document$head = document.head) === null || _document$head === void 0 ? void 0 : _document$head.querySelector(\"title\"), () => {\n\t\t\tif (document && document.title !== title.value) title.value = format(document.title);\n\t\t}, { childList: true });\n\t}\n\ttryOnScopeDispose(() => {\n\t\tif (restoreOnUnmount) {\n\t\t\tconst restoredTitle = restoreOnUnmount(originalTitle, title.value || \"\");\n\t\t\tif (restoredTitle != null && document) document.title = restoredTitle;\n\t\t}\n\t});\n\treturn title;\n}\n/**\n* Common transitions\n*\n* @see https://easings.net\n*/\nconst TransitionPresets = /* #__PURE__ */ Object.assign({}, { linear: identity }, {\n\teaseInSine: [\n\t\t.12,\n\t\t0,\n\t\t.39,\n\t\t0\n\t],\n\teaseOutSine: [\n\t\t.61,\n\t\t1,\n\t\t.88,\n\t\t1\n\t],\n\teaseInOutSine: [\n\t\t.37,\n\t\t0,\n\t\t.63,\n\t\t1\n\t],\n\teaseInQuad: [\n\t\t.11,\n\t\t0,\n\t\t.5,\n\t\t0\n\t],\n\teaseOutQuad: [\n\t\t.5,\n\t\t1,\n\t\t.89,\n\t\t1\n\t],\n\teaseInOutQuad: [\n\t\t.45,\n\t\t0,\n\t\t.55,\n\t\t1\n\t],\n\teaseInCubic: [\n\t\t.32,\n\t\t0,\n\t\t.67,\n\t\t0\n\t],\n\teaseOutCubic: [\n\t\t.33,\n\t\t1,\n\t\t.68,\n\t\t1\n\t],\n\teaseInOutCubic: [\n\t\t.65,\n\t\t0,\n\t\t.35,\n\t\t1\n\t],\n\teaseInQuart: [\n\t\t.5,\n\t\t0,\n\t\t.75,\n\t\t0\n\t],\n\teaseOutQuart: [\n\t\t.25,\n\t\t1,\n\t\t.5,\n\t\t1\n\t],\n\teaseInOutQuart: [\n\t\t.76,\n\t\t0,\n\t\t.24,\n\t\t1\n\t],\n\teaseInQuint: [\n\t\t.64,\n\t\t0,\n\t\t.78,\n\t\t0\n\t],\n\teaseOutQuint: [\n\t\t.22,\n\t\t1,\n\t\t.36,\n\t\t1\n\t],\n\teaseInOutQuint: [\n\t\t.83,\n\t\t0,\n\t\t.17,\n\t\t1\n\t],\n\teaseInExpo: [\n\t\t.7,\n\t\t0,\n\t\t.84,\n\t\t0\n\t],\n\teaseOutExpo: [\n\t\t.16,\n\t\t1,\n\t\t.3,\n\t\t1\n\t],\n\teaseInOutExpo: [\n\t\t.87,\n\t\t0,\n\t\t.13,\n\t\t1\n\t],\n\teaseInCirc: [\n\t\t.55,\n\t\t0,\n\t\t1,\n\t\t.45\n\t],\n\teaseOutCirc: [\n\t\t0,\n\t\t.55,\n\t\t.45,\n\t\t1\n\t],\n\teaseInOutCirc: [\n\t\t.85,\n\t\t0,\n\t\t.15,\n\t\t1\n\t],\n\teaseInBack: [\n\t\t.36,\n\t\t0,\n\t\t.66,\n\t\t-.56\n\t],\n\teaseOutBack: [\n\t\t.34,\n\t\t1.56,\n\t\t.64,\n\t\t1\n\t],\n\teaseInOutBack: [\n\t\t.68,\n\t\t-.6,\n\t\t.32,\n\t\t1.6\n\t]\n});\n/**\n* Create an easing function from cubic bezier points.\n*/\nfunction createEasingFunction([p0, p1, p2, p3]) {\n\tconst a = (a1, a2) => 1 - 3 * a2 + 3 * a1;\n\tconst b = (a1, a2) => 3 * a2 - 6 * a1;\n\tconst c = (a1) => 3 * a1;\n\tconst calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t;\n\tconst getSlope = (t, a1, a2) => 3 * a(a1, a2) * t * t + 2 * b(a1, a2) * t + c(a1);\n\tconst getTforX = (x) => {\n\t\tlet aGuessT = x;\n\t\tfor (let i = 0; i < 4; ++i) {\n\t\t\tconst currentSlope = getSlope(aGuessT, p0, p2);\n\t\t\tif (currentSlope === 0) return aGuessT;\n\t\t\tconst currentX = calcBezier(aGuessT, p0, p2) - x;\n\t\t\taGuessT -= currentX / currentSlope;\n\t\t}\n\t\treturn aGuessT;\n\t};\n\treturn (x) => p0 === p1 && p2 === p3 ? x : calcBezier(getTforX(x), p1, p3);\n}\nfunction lerp(a, b, alpha) {\n\treturn a + alpha * (b - a);\n}\nfunction defaultInterpolation(a, b, t) {\n\tconst aVal = toValue(a);\n\tconst bVal = toValue(b);\n\tif (typeof aVal === \"number\" && typeof bVal === \"number\") return lerp(aVal, bVal, t);\n\tif (Array.isArray(aVal) && Array.isArray(bVal)) return aVal.map((v, i) => lerp(v, toValue(bVal[i]), t));\n\tthrow new TypeError(\"Unknown transition type, specify an interpolation function.\");\n}\nfunction normalizeEasing(easing) {\n\tvar _toValue;\n\treturn typeof easing === \"function\" ? easing : (_toValue = toValue(easing)) !== null && _toValue !== void 0 ? _toValue : identity;\n}\n/**\n* Transition from one value to another.\n*\n* @param source\n* @param from\n* @param to\n* @param options\n*/\nfunction transition(source, from, to, options = {}) {\n\tvar _toValue2;\n\tconst { window = defaultWindow } = options;\n\tconst fromVal = toValue(from);\n\tconst toVal = toValue(to);\n\tconst duration = (_toValue2 = toValue(options.duration)) !== null && _toValue2 !== void 0 ? _toValue2 : 1e3;\n\tconst startedAt = Date.now();\n\tconst endAt = Date.now() + duration;\n\tconst interpolation = typeof options.interpolation === \"function\" ? options.interpolation : defaultInterpolation;\n\tconst trans = typeof options.easing !== \"undefined\" ? normalizeEasing(options.easing) : normalizeEasing(options.transition);\n\tconst ease = typeof trans === \"function\" ? trans : createEasingFunction(trans);\n\treturn new Promise((resolve) => {\n\t\tsource.value = fromVal;\n\t\tconst tick = () => {\n\t\t\tvar _options$abort;\n\t\t\tif ((_options$abort = options.abort) === null || _options$abort === void 0 ? void 0 : _options$abort.call(options)) {\n\t\t\t\tresolve();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst now = Date.now();\n\t\t\tconst alpha = ease((now - startedAt) / duration);\n\t\t\tsource.value = interpolation(fromVal, toVal, alpha);\n\t\t\tif (now < endAt) window === null || window === void 0 || window.requestAnimationFrame(tick);\n\t\t\telse {\n\t\t\t\tsource.value = toVal;\n\t\t\t\tresolve();\n\t\t\t}\n\t\t};\n\t\ttick();\n\t});\n}\n/**\n* Transition from one value to another.\n* @deprecated The `executeTransition` function is deprecated, use `transition` instead.\n*\n* @param source\n* @param from\n* @param to\n* @param options\n*/\nfunction executeTransition(source, from, to, options = {}) {\n\treturn transition(source, from, to, options);\n}\n/**\n* Follow value with a transition.\n*\n* @see https://vueuse.org/useTransition\n* @param source\n* @param options\n*/\nfunction useTransition(source, options = {}) {\n\tlet currentId = 0;\n\tconst sourceVal = () => {\n\t\tconst v = toValue(source);\n\t\treturn typeof options.interpolation === \"undefined\" && Array.isArray(v) ? v.map(toValue) : v;\n\t};\n\tconst outputRef = shallowRef(sourceVal());\n\twatch(sourceVal, async (to) => {\n\t\tvar _options$onStarted, _options$onFinished;\n\t\tif (toValue(options.disabled)) return;\n\t\tconst id = ++currentId;\n\t\tif (options.delay) await promiseTimeout(toValue(options.delay));\n\t\tif (id !== currentId) return;\n\t\t(_options$onStarted = options.onStarted) === null || _options$onStarted === void 0 || _options$onStarted.call(options);\n\t\tawait transition(outputRef, outputRef.value, to, {\n\t\t\t...options,\n\t\t\tabort: () => {\n\t\t\t\tvar _options$abort2;\n\t\t\t\treturn id !== currentId || ((_options$abort2 = options.abort) === null || _options$abort2 === void 0 ? void 0 : _options$abort2.call(options));\n\t\t\t}\n\t\t});\n\t\t(_options$onFinished = options.onFinished) === null || _options$onFinished === void 0 || _options$onFinished.call(options);\n\t}, { deep: true });\n\twatch(() => toValue(options.disabled), (disabled) => {\n\t\tif (disabled) {\n\t\t\tcurrentId++;\n\t\t\toutputRef.value = sourceVal();\n\t\t}\n\t});\n\ttryOnScopeDispose(() => {\n\t\tcurrentId++;\n\t});\n\treturn computed(() => toValue(options.disabled) ? sourceVal() : outputRef.value);\n}\n// useUrlSearchParams/index.ts\n/**\n* Reactive URLSearchParams\n*\n* @see https://vueuse.org/useUrlSearchParams\n* @param mode\n* @param options\n*/\nfunction useUrlSearchParams(mode = \"history\", options = {}) {\n\tconst { initialValue = {}, removeNullishValues = true, removeFalsyValues = false, write: enableWrite = true, writeMode = \"replace\", window = defaultWindow, stringify = (params) => params.toString() } = options;\n\tif (!window) return reactive(initialValue);\n\tconst state = reactive({});\n\tfunction getRawParams() {\n\t\tif (mode === \"history\") return window.location.search || \"\";\n\t\telse if (mode === \"hash\") {\n\t\t\tconst hash = window.location.hash || \"\";\n\t\t\tconst index = hash.indexOf(\"?\");\n\t\t\treturn index > 0 ? hash.slice(index) : \"\";\n\t\t} else return (window.location.hash || \"\").replace(/^#/, \"\");\n\t}\n\tfunction constructQuery(params) {\n\t\tconst stringified = stringify(params);\n\t\tif (mode === \"history\") return `${stringified ? `?${stringified}` : \"\"}${window.location.hash || \"\"}`;\n\t\tif (mode === \"hash-params\") return `${window.location.search || \"\"}${stringified ? `#${stringified}` : \"\"}`;\n\t\tconst hash = window.location.hash || \"#\";\n\t\tconst index = hash.indexOf(\"?\");\n\t\tif (index > 0) return `${window.location.search || \"\"}${hash.slice(0, index)}${stringified ? `?${stringified}` : \"\"}`;\n\t\treturn `${window.location.search || \"\"}${hash}${stringified ? `?${stringified}` : \"\"}`;\n\t}\n\tfunction read() {\n\t\treturn new URLSearchParams(getRawParams());\n\t}\n\tfunction updateState(params) {\n\t\tconst unusedKeys = new Set(Object.keys(state));\n\t\tfor (const key of params.keys()) {\n\t\t\tconst paramsForKey = params.getAll(key);\n\t\t\tstate[key] = paramsForKey.length > 1 ? paramsForKey : params.get(key) || \"\";\n\t\t\tunusedKeys.delete(key);\n\t\t}\n\t\tArray.from(unusedKeys).forEach((key) => delete state[key]);\n\t}\n\tconst { pause, resume } = watchPausable(state, () => {\n\t\tconst params = new URLSearchParams(\"\");\n\t\tObject.keys(state).forEach((key) => {\n\t\t\tconst mapEntry = state[key];\n\t\t\tif (Array.isArray(mapEntry)) mapEntry.forEach((value) => params.append(key, value));\n\t\t\telse if (removeNullishValues && mapEntry == null) params.delete(key);\n\t\t\telse if (removeFalsyValues && !mapEntry) params.delete(key);\n\t\t\telse params.set(key, mapEntry);\n\t\t});\n\t\twrite(params, false);\n\t}, { deep: true });\n\tfunction write(params, shouldUpdate, shouldWriteHistory = true) {\n\t\tpause();\n\t\tif (shouldUpdate) updateState(params);\n\t\tif (writeMode === \"replace\") window.history.replaceState(window.history.state, window.document.title, window.location.pathname + constructQuery(params));\n\t\telse if (shouldWriteHistory) window.history.pushState(window.history.state, window.document.title, window.location.pathname + constructQuery(params));\n\t\tnextTick(() => resume());\n\t}\n\tfunction onChanged() {\n\t\tif (!enableWrite) return;\n\t\twrite(read(), true, false);\n\t}\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(window, \"popstate\", onChanged, listenerOptions);\n\tif (mode !== \"history\") useEventListener(window, \"hashchange\", onChanged, listenerOptions);\n\tconst initial = read();\n\tif (initial.keys().next().value) updateState(initial);\n\telse Object.assign(state, initialValue);\n\treturn state;\n}\n// useUserMedia/index.ts\n/**\n* Reactive `mediaDevices.getUserMedia` streaming\n*\n* @see https://vueuse.org/useUserMedia\n* @param options\n*/\nfunction useUserMedia(options = {}) {\n\tvar _options$enabled, _options$autoSwitch;\n\tconst enabled = shallowRef((_options$enabled = options.enabled) !== null && _options$enabled !== void 0 ? _options$enabled : false);\n\tconst autoSwitch = shallowRef((_options$autoSwitch = options.autoSwitch) !== null && _options$autoSwitch !== void 0 ? _options$autoSwitch : true);\n\tconst constraints = ref(options.constraints);\n\tconst { navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tvar _navigator$mediaDevic;\n\t\treturn navigator === null || navigator === void 0 || (_navigator$mediaDevic = navigator.mediaDevices) === null || _navigator$mediaDevic === void 0 ? void 0 : _navigator$mediaDevic.getUserMedia;\n\t});\n\tconst stream = shallowRef();\n\tfunction getDeviceOptions(type) {\n\t\tswitch (type) {\n\t\t\tcase \"video\":\n\t\t\t\tif (constraints.value) return constraints.value.video || false;\n\t\t\t\tbreak;\n\t\t\tcase \"audio\": if (constraints.value) return constraints.value.audio || false;\n\t\t}\n\t}\n\tasync function _start() {\n\t\tif (!isSupported.value || stream.value) return;\n\t\tstream.value = await navigator.mediaDevices.getUserMedia({\n\t\t\tvideo: getDeviceOptions(\"video\"),\n\t\t\taudio: getDeviceOptions(\"audio\")\n\t\t});\n\t\treturn stream.value;\n\t}\n\tfunction _stop() {\n\t\tvar _stream$value;\n\t\t(_stream$value = stream.value) === null || _stream$value === void 0 || _stream$value.getTracks().forEach((t) => t.stop());\n\t\tstream.value = void 0;\n\t}\n\tfunction stop() {\n\t\t_stop();\n\t\tenabled.value = false;\n\t}\n\tasync function start() {\n\t\tawait _start();\n\t\tif (stream.value) enabled.value = true;\n\t\treturn stream.value;\n\t}\n\tasync function restart() {\n\t\t_stop();\n\t\treturn await start();\n\t}\n\twatch(enabled, (v) => {\n\t\tif (v) _start();\n\t\telse _stop();\n\t}, { immediate: true });\n\twatch(constraints, () => {\n\t\tif (autoSwitch.value && stream.value) restart();\n\t}, {\n\t\timmediate: true,\n\t\tdeep: true\n\t});\n\ttryOnScopeDispose(() => {\n\t\tstop();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tstream,\n\t\tstart,\n\t\tstop,\n\t\trestart,\n\t\tconstraints,\n\t\tenabled,\n\t\tautoSwitch\n\t};\n}\n// useVModel/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useVModel(props, key, emit, options = {}) {\n\tvar _vm$$emit, _vm$proxy;\n\tconst { clone = false, passive = false, eventName, deep = false, defaultValue, shouldEmit } = options;\n\tconst vm = getCurrentInstance();\n\tconst _emit = emit || (vm === null || vm === void 0 ? void 0 : vm.emit) || (vm === null || vm === void 0 || (_vm$$emit = vm.$emit) === null || _vm$$emit === void 0 ? void 0 : _vm$$emit.bind(vm)) || (vm === null || vm === void 0 || (_vm$proxy = vm.proxy) === null || _vm$proxy === void 0 || (_vm$proxy = _vm$proxy.$emit) === null || _vm$proxy === void 0 ? void 0 : _vm$proxy.bind(vm === null || vm === void 0 ? void 0 : vm.proxy));\n\tlet event = eventName;\n\tif (!key) key = \"modelValue\";\n\tevent = event || `update:${key.toString()}`;\n\tconst cloneFn = (val) => !clone ? val : typeof clone === \"function\" ? clone(val) : cloneFnJSON(val);\n\tconst getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;\n\tconst triggerEmit = (value) => {\n\t\tif (shouldEmit) {\n\t\t\tif (shouldEmit(value)) _emit(event, value);\n\t\t} else _emit(event, value);\n\t};\n\tif (passive) {\n\t\tconst initialValue = getValue();\n\t\tconst proxy = ref(initialValue);\n\t\tlet isUpdating = false;\n\t\twatch(() => props[key], (v) => {\n\t\t\tif (!isUpdating) {\n\t\t\t\tisUpdating = true;\n\t\t\t\tproxy.value = cloneFn(v);\n\t\t\t\tnextTick(() => isUpdating = false);\n\t\t\t}\n\t\t});\n\t\twatch(proxy, (v) => {\n\t\t\tif (!isUpdating && (v !== props[key] || deep)) triggerEmit(v);\n\t\t}, { deep });\n\t\treturn proxy;\n\t} else return computed({\n\t\tget() {\n\t\t\treturn getValue();\n\t\t},\n\t\tset(value) {\n\t\t\ttriggerEmit(value);\n\t\t}\n\t});\n}\n// useVModels/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useVModels(props, emit, options = {}) {\n\tconst ret = {};\n\tfor (const key in props) ret[key] = /* @__PURE__ */ useVModel(props, key, emit, options);\n\treturn ret;\n}\n// useVibrate/index.ts\n/**\n* Reactive vibrate\n*\n* @see https://vueuse.org/useVibrate\n* @see https://developer.mozilla.org/en-US/docs/Web/API/Vibration_API\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useVibrate(options) {\n\tconst { pattern = [], scheduler, navigator = defaultNavigator } = options || {};\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof navigator !== \"undefined\" && \"vibrate\" in navigator);\n\tconst patternRef = toRef(pattern);\n\tconst vibrate = (pattern = patternRef.value) => {\n\t\tif (isSupported.value) navigator.vibrate(pattern);\n\t};\n\tconst intervalControls = scheduler === null || scheduler === void 0 ? void 0 : scheduler(vibrate);\n\tconst stop = () => {\n\t\tif (isSupported.value) navigator.vibrate(0);\n\t\tintervalControls === null || intervalControls === void 0 || intervalControls.pause();\n\t};\n\treturn {\n\t\tisSupported,\n\t\tpattern,\n\t\tintervalControls,\n\t\tvibrate,\n\t\tstop\n\t};\n}\n// useVirtualList/index.ts\n/**\n* Please consider using [`vue-virtual-scroller`](https://github.com/Akryum/vue-virtual-scroller) if you are looking for more features.\n*/\nfunction useVirtualList(list, options) {\n\tconst { containerStyle, wrapperProps, scrollTo, calculateRange, currentList, containerRef } = \"itemHeight\" in options ? useVerticalVirtualList(options, list) : useHorizontalVirtualList(options, list);\n\treturn {\n\t\tlist: currentList,\n\t\tscrollTo,\n\t\tcontainerProps: {\n\t\t\tref: containerRef,\n\t\t\tonScroll: () => {\n\t\t\t\tcalculateRange();\n\t\t\t},\n\t\t\tstyle: containerStyle\n\t\t},\n\t\twrapperProps\n\t};\n}\nfunction useVirtualListResources(list) {\n\tconst containerRef = shallowRef(null);\n\tconst size = useElementSize(containerRef);\n\tconst currentList = ref([]);\n\tconst source = shallowRef(list);\n\treturn {\n\t\tstate: ref({\n\t\t\tstart: 0,\n\t\t\tend: 10\n\t\t}),\n\t\tsource,\n\t\tcurrentList,\n\t\tsize,\n\t\tcontainerRef\n\t};\n}\nfunction createGetViewCapacity(state, source, itemSize) {\n\treturn (containerSize) => {\n\t\tif (typeof itemSize === \"number\") return Math.ceil(containerSize / itemSize);\n\t\tconst { start = 0 } = state.value;\n\t\tlet sum = 0;\n\t\tlet capacity = 0;\n\t\tfor (let i = start; i < source.value.length; i++) {\n\t\t\tconst size = itemSize(i);\n\t\t\tsum += size;\n\t\t\tcapacity = i;\n\t\t\tif (sum > containerSize) break;\n\t\t}\n\t\treturn capacity - start;\n\t};\n}\nfunction createGetOffset(source, itemSize) {\n\treturn (scrollDirection) => {\n\t\tif (typeof itemSize === \"number\") return Math.floor(scrollDirection / itemSize) + 1;\n\t\tlet sum = 0;\n\t\tlet offset = 0;\n\t\tfor (let i = 0; i < source.value.length; i++) {\n\t\t\tconst size = itemSize(i);\n\t\t\tsum += size;\n\t\t\tif (sum >= scrollDirection) {\n\t\t\t\toffset = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn offset + 1;\n\t};\n}\nfunction createCalculateRange(type, overscan, getOffset, getViewCapacity, { containerRef, state, currentList, source }) {\n\treturn () => {\n\t\tconst element = containerRef.value;\n\t\tif (element) {\n\t\t\tconst offset = getOffset(type === \"vertical\" ? element.scrollTop : element.scrollLeft);\n\t\t\tconst viewCapacity = getViewCapacity(type === \"vertical\" ? element.clientHeight : element.clientWidth);\n\t\t\tconst from = offset - overscan;\n\t\t\tconst to = offset + viewCapacity + overscan;\n\t\t\tstate.value = {\n\t\t\t\tstart: from < 0 ? 0 : from,\n\t\t\t\tend: to > source.value.length ? source.value.length : to\n\t\t\t};\n\t\t\tcurrentList.value = source.value.slice(state.value.start, state.value.end).map((ele, index) => ({\n\t\t\t\tdata: ele,\n\t\t\t\tindex: index + state.value.start\n\t\t\t}));\n\t\t}\n\t};\n}\nfunction createGetDistance(itemSize, source) {\n\treturn (index) => {\n\t\tif (typeof itemSize === \"number\") return index * itemSize;\n\t\treturn source.value.slice(0, index).reduce((sum, _, i) => sum + itemSize(i), 0);\n\t};\n}\nfunction useWatchForSizes(size, listRef, totalSize, containerRef, calculateRange) {\n\twatch([\n\t\tsize.width,\n\t\tsize.height,\n\t\tlistRef,\n\t\ttotalSize,\n\t\tcontainerRef\n\t], () => {\n\t\tcalculateRange();\n\t});\n}\nfunction createComputedTotalSize(itemSize, source) {\n\treturn computed(() => {\n\t\tif (typeof itemSize === \"number\") return source.value.length * itemSize;\n\t\treturn source.value.reduce((sum, _, index) => sum + itemSize(index), 0);\n\t});\n}\nconst scrollToDictionaryForElementScrollKey = {\n\thorizontal: \"scrollLeft\",\n\tvertical: \"scrollTop\"\n};\nconst scrollToDictionaryForElementScrollToKey = {\n\thorizontal: \"left\",\n\tvertical: \"top\"\n};\nconst defaultScrollToOptions = {\n\tbehavior: \"auto\",\n\tblock: \"start\",\n\tinline: \"nearest\"\n};\nfunction createScrollTo(type, calculateRange, getDistance, containerRef, itemSize) {\n\treturn (index, options = defaultScrollToOptions) => {\n\t\tif (!containerRef.value) return;\n\t\toptions = {\n\t\t\t...defaultScrollToOptions,\n\t\t\t...options\n\t\t};\n\t\tlet offset = 0;\n\t\tconst axisToCheck = options[type === \"horizontal\" ? \"inline\" : \"block\"];\n\t\tif (axisToCheck) {\n\t\t\tconst containerSize = type === \"horizontal\" ? containerRef.value.clientWidth : containerRef.value.clientHeight;\n\t\t\tconst fullItemSize = typeof itemSize === \"number\" ? itemSize : itemSize(index);\n\t\t\tif (axisToCheck === \"center\") offset = containerSize / 2 - fullItemSize / 2;\n\t\t\telse if (axisToCheck === \"end\") offset = containerSize - fullItemSize;\n\t\t\telse if (axisToCheck === \"nearest\") {\n\t\t\t\tconst containerScrollPosition = containerRef.value[scrollToDictionaryForElementScrollKey[type]];\n\t\t\t\tif (getDistance(index) > containerScrollPosition + containerSize / 2) offset = containerSize - fullItemSize;\n\t\t\t}\n\t\t}\n\t\tcontainerRef.value.scrollTo({\n\t\t\t[scrollToDictionaryForElementScrollToKey[type]]: getDistance(index) - offset,\n\t\t\tbehavior: options.behavior\n\t\t});\n\t\tcalculateRange();\n\t};\n}\nfunction useHorizontalVirtualList(options, list) {\n\tconst resources = useVirtualListResources(list);\n\tconst { state, source, currentList, size, containerRef } = resources;\n\tconst containerStyle = { overflowX: \"auto\" };\n\tconst { itemWidth, overscan = 5 } = options;\n\tconst getViewCapacity = createGetViewCapacity(state, source, itemWidth);\n\tconst calculateRange = createCalculateRange(\"horizontal\", overscan, createGetOffset(source, itemWidth), getViewCapacity, resources);\n\tconst getDistanceLeft = createGetDistance(itemWidth, source);\n\tconst offsetLeft = computed(() => getDistanceLeft(state.value.start));\n\tconst totalWidth = createComputedTotalSize(itemWidth, source);\n\tuseWatchForSizes(size, source, totalWidth, containerRef, calculateRange);\n\treturn {\n\t\tscrollTo: createScrollTo(\"horizontal\", calculateRange, getDistanceLeft, containerRef, itemWidth),\n\t\tcalculateRange,\n\t\twrapperProps: computed(() => {\n\t\t\treturn { style: {\n\t\t\t\theight: \"100%\",\n\t\t\t\twidth: `${totalWidth.value - offsetLeft.value}px`,\n\t\t\t\tmarginLeft: `${offsetLeft.value}px`,\n\t\t\t\tdisplay: \"flex\"\n\t\t\t} };\n\t\t}),\n\t\tcontainerStyle,\n\t\tcurrentList,\n\t\tcontainerRef\n\t};\n}\nfunction useVerticalVirtualList(options, list) {\n\tconst resources = useVirtualListResources(list);\n\tconst { state, source, currentList, size, containerRef } = resources;\n\tconst containerStyle = { overflowY: \"auto\" };\n\tconst { itemHeight, overscan = 5 } = options;\n\tconst getViewCapacity = createGetViewCapacity(state, source, itemHeight);\n\tconst calculateRange = createCalculateRange(\"vertical\", overscan, createGetOffset(source, itemHeight), getViewCapacity, resources);\n\tconst getDistanceTop = createGetDistance(itemHeight, source);\n\tconst offsetTop = computed(() => getDistanceTop(state.value.start));\n\tconst totalHeight = createComputedTotalSize(itemHeight, source);\n\tuseWatchForSizes(size, source, totalHeight, containerRef, calculateRange);\n\treturn {\n\t\tcalculateRange,\n\t\tscrollTo: createScrollTo(\"vertical\", calculateRange, getDistanceTop, containerRef, itemHeight),\n\t\tcontainerStyle,\n\t\twrapperProps: computed(() => {\n\t\t\treturn { style: {\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: `${totalHeight.value - offsetTop.value}px`,\n\t\t\t\tmarginTop: `${offsetTop.value}px`\n\t\t\t} };\n\t\t}),\n\t\tcurrentList,\n\t\tcontainerRef\n\t};\n}\n// useWakeLock/index.ts\n/**\n* Reactive Screen Wake Lock API.\n*\n* @see https://vueuse.org/useWakeLock\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWakeLock(options = {}) {\n\tconst { navigator = defaultNavigator, document = defaultDocument } = options;\n\tconst requestedType = shallowRef(false);\n\tconst sentinel = shallowRef(null);\n\tconst documentVisibility = useDocumentVisibility({ document });\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"wakeLock\" in navigator);\n\tconst isActive = computed(() => !!sentinel.value && documentVisibility.value === \"visible\");\n\tif (isSupported.value) {\n\t\tuseEventListener(sentinel, \"release\", () => {\n\t\t\tvar _sentinel$value$type, _sentinel$value;\n\t\t\trequestedType.value = (_sentinel$value$type = (_sentinel$value = sentinel.value) === null || _sentinel$value === void 0 ? void 0 : _sentinel$value.type) !== null && _sentinel$value$type !== void 0 ? _sentinel$value$type : false;\n\t\t}, { passive: true });\n\t\twhenever(() => documentVisibility.value === \"visible\" && (document === null || document === void 0 ? void 0 : document.visibilityState) === \"visible\" && requestedType.value, (type) => {\n\t\t\trequestedType.value = false;\n\t\t\tforceRequest(type);\n\t\t});\n\t}\n\tasync function forceRequest(type) {\n\t\tvar _sentinel$value2;\n\t\tawait ((_sentinel$value2 = sentinel.value) === null || _sentinel$value2 === void 0 ? void 0 : _sentinel$value2.release());\n\t\tsentinel.value = isSupported.value ? await navigator.wakeLock.request(type) : null;\n\t}\n\tasync function request(type) {\n\t\tif (documentVisibility.value === \"visible\") await forceRequest(type);\n\t\telse requestedType.value = type;\n\t}\n\tasync function release() {\n\t\trequestedType.value = false;\n\t\tconst s = sentinel.value;\n\t\tsentinel.value = null;\n\t\tawait (s === null || s === void 0 ? void 0 : s.release());\n\t}\n\ttryOnScopeDispose(() => {\n\t\trelease();\n\t});\n\treturn {\n\t\tsentinel,\n\t\tisSupported,\n\t\tisActive,\n\t\trequest,\n\t\tforceRequest,\n\t\trelease\n\t};\n}\n// useWebMCP/index.ts\nfunction safeStringify(value) {\n\ttry {\n\t\treturn JSON.stringify(value);\n\t} catch (_unused) {\n\t\treturn String(value);\n\t}\n}\nfunction toToolResponse(value) {\n\tif (value && typeof value === \"object\" && Array.isArray(value.content)) return value;\n\tif (value === void 0 || value === null) return { content: [] };\n\tif (typeof value === \"string\") return { content: [{\n\t\ttype: \"text\",\n\t\ttext: value\n\t}] };\n\treturn { content: [{\n\t\ttype: \"text\",\n\t\ttext: safeStringify(value)\n\t}] };\n}\nfunction toErrorResponse(error) {\n\treturn {\n\t\tcontent: [{\n\t\t\ttype: \"text\",\n\t\t\ttext: error instanceof Error ? error.message : typeof error === \"string\" ? error : safeStringify(error)\n\t\t}],\n\t\tisError: true\n\t};\n}\n/**\n* Register a [WebMCP](https://github.com/webmachinelearning/webmcp) tool and\n* tie its lifecycle to the current scope.\n*\n* The tool is registered when the composable runs (and whenever a discoverable\n* part — `name`, `description`, `inputSchema`, `annotations` or `enabled` —\n* changes) and unregistered automatically on scope dispose, so the tools an\n* agent sees stay in lockstep with what is on screen. Call it multiple times to\n* register multiple tools.\n*\n* The API is experimental (`document.modelContext`), so this feature-detects\n* and degrades to a no-op wherever it is absent.\n*\n* @see https://vueuse.org/useWebMCP\n* @see https://github.com/webmachinelearning/webmcp\n*/\nfunction useWebMCP(options) {\n\tconst { document = defaultDocument, enabled = true } = options;\n\tconst doc = document;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tvar _doc$modelContext;\n\t\treturn typeof (doc === null || doc === void 0 || (_doc$modelContext = doc.modelContext) === null || _doc$modelContext === void 0 ? void 0 : _doc$modelContext.registerTool) === \"function\";\n\t});\n\tconst isRegistered = shallowRef(false);\n\tconst error = shallowRef(null);\n\tlet controller;\n\tfunction cleanup() {\n\t\tcontroller === null || controller === void 0 || controller.abort();\n\t\tcontroller = void 0;\n\t\tisRegistered.value = false;\n\t}\n\tfunction register() {\n\t\tcleanup();\n\t\terror.value = null;\n\t\tif (!isSupported.value || !toValue(enabled)) return;\n\t\tcontroller = new AbortController();\n\t\ttry {\n\t\t\tdoc.modelContext.registerTool({\n\t\t\t\tname: toValue(options.name),\n\t\t\t\tdescription: toValue(options.description),\n\t\t\t\tinputSchema: toValue(options.inputSchema),\n\t\t\t\tannotations: toValue(options.annotations),\n\t\t\t\tasync execute(args) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = await options.execute(args);\n\t\t\t\t\t\tconst shaped = options.formatOutput ? options.formatOutput(result, args) : result;\n\t\t\t\t\t\tif (shaped instanceof Error) throw shaped;\n\t\t\t\t\t\treturn toToolResponse(shaped);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvar _options$onError;\n\t\t\t\t\t\t\t(_options$onError = options.onError) === null || _options$onError === void 0 || _options$onError.call(options, err);\n\t\t\t\t\t\t} catch (_unused2) {}\n\t\t\t\t\t\treturn toErrorResponse(err);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, { signal: controller.signal });\n\t\t\tisRegistered.value = true;\n\t\t} catch (err) {\n\t\t\terror.value = err instanceof Error ? err : new Error(safeStringify(err));\n\t\t\tisRegistered.value = false;\n\t\t}\n\t}\n\twatch([\n\t\tisSupported,\n\t\t() => toValue(options.name),\n\t\t() => toValue(options.description),\n\t\t() => toValue(options.inputSchema) ? safeStringify(toValue(options.inputSchema)) : \"\",\n\t\t() => toValue(options.annotations) ? safeStringify(toValue(options.annotations)) : \"\",\n\t\t() => toValue(enabled)\n\t], register, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\ttryOnScopeDispose(cleanup);\n\treturn {\n\t\tisSupported,\n\t\tisRegistered,\n\t\terror\n\t};\n}\n// useWebNotification/index.ts\n/**\n* Reactive useWebNotification\n*\n* @see https://vueuse.org/useWebNotification\n* @see https://developer.mozilla.org/en-US/docs/Web/API/notification\n*/\nfunction useWebNotification(options = {}) {\n\tconst { window = defaultWindow, requestPermissions: _requestForPermissions = true } = options;\n\tconst defaultWebNotificationOptions = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tif (!window || !(\"Notification\" in window)) return false;\n\t\tif (Notification.permission === \"granted\") return true;\n\t\ttry {\n\t\t\tconst notification = new Notification(\"\");\n\t\t\tnotification.onshow = () => {\n\t\t\t\tnotification.close();\n\t\t\t};\n\t\t} catch (e) {\n\t\t\tif (e.name === \"TypeError\") return false;\n\t\t}\n\t\treturn true;\n\t});\n\tconst permissionGranted = shallowRef(isSupported.value && \"permission\" in Notification && Notification.permission === \"granted\");\n\tconst notification = shallowRef(null);\n\tconst ensurePermissions = async () => {\n\t\tif (!isSupported.value) return;\n\t\tif (!permissionGranted.value && Notification.permission !== \"denied\") {\n\t\t\tif (await Notification.requestPermission() === \"granted\") permissionGranted.value = true;\n\t\t}\n\t\treturn permissionGranted.value;\n\t};\n\tconst { on: onClick, trigger: clickTrigger } = createEventHook();\n\tconst { on: onShow, trigger: showTrigger } = createEventHook();\n\tconst { on: onError, trigger: errorTrigger } = createEventHook();\n\tconst { on: onClose, trigger: closeTrigger } = createEventHook();\n\tconst show = async (overrides) => {\n\t\tif (!isSupported.value || !permissionGranted.value) return;\n\t\tconst options = Object.assign({}, defaultWebNotificationOptions, overrides);\n\t\tnotification.value = new Notification(options.title || \"\", options);\n\t\tnotification.value.onclick = clickTrigger;\n\t\tnotification.value.onshow = showTrigger;\n\t\tnotification.value.onerror = errorTrigger;\n\t\tnotification.value.onclose = closeTrigger;\n\t\treturn notification.value;\n\t};\n\tconst close = () => {\n\t\tif (notification.value) notification.value.close();\n\t\tnotification.value = null;\n\t};\n\tif (_requestForPermissions) tryOnMounted(ensurePermissions);\n\ttryOnScopeDispose(close);\n\tif (isSupported.value && window) {\n\t\tconst document = window.document;\n\t\tuseEventListener(document, \"visibilitychange\", (e) => {\n\t\t\te.preventDefault();\n\t\t\tif (document.visibilityState === \"visible\") close();\n\t\t});\n\t}\n\treturn {\n\t\tisSupported,\n\t\tnotification,\n\t\tensurePermissions,\n\t\tpermissionGranted,\n\t\tshow,\n\t\tclose,\n\t\tonClick,\n\t\tonShow,\n\t\tonError,\n\t\tonClose\n\t};\n}\n// useWebSocket/index.ts\nconst DEFAULT_PING_MESSAGE = \"ping\";\nfunction resolveNestedOptions(options) {\n\tif (options === true) return {};\n\treturn options;\n}\n/**\n* Reactive WebSocket client.\n*\n* @see https://vueuse.org/useWebSocket\n* @param url\n*/\nfunction useWebSocket(url, options = {}) {\n\tconst { onConnected, onDisconnected, onError, onMessage, immediate = true, autoConnect = true, autoClose = true, protocols = [] } = options;\n\tconst data = shallowRef(null);\n\tconst status = shallowRef(\"CLOSED\");\n\tconst wsRef = shallowRef();\n\tconst urlRef = toRef(url);\n\tlet heartbeatPause;\n\tlet heartbeatResume;\n\tlet explicitlyClosed = false;\n\tlet retried = 0;\n\tlet bufferedData = [];\n\tlet retryTimeout;\n\tlet pongTimeoutWait;\n\tconst _sendBuffer = () => {\n\t\tif (bufferedData.length && wsRef.value && status.value === \"OPEN\") {\n\t\t\tfor (const buffer of bufferedData) wsRef.value.send(buffer);\n\t\t\tbufferedData = [];\n\t\t}\n\t};\n\tconst resetRetry = () => {\n\t\tif (retryTimeout != null) {\n\t\t\tclearTimeout(retryTimeout);\n\t\t\tretryTimeout = void 0;\n\t\t}\n\t};\n\tconst resetHeartbeat = () => {\n\t\tclearTimeout(pongTimeoutWait);\n\t\tpongTimeoutWait = void 0;\n\t};\n\tconst close = (code = 1e3, reason) => {\n\t\tresetRetry();\n\t\tif (!isClient && !isWorker || !wsRef.value) return;\n\t\texplicitlyClosed = true;\n\t\tresetHeartbeat();\n\t\theartbeatPause === null || heartbeatPause === void 0 || heartbeatPause();\n\t\twsRef.value.close(code, reason);\n\t\twsRef.value = void 0;\n\t\tstatus.value = \"CLOSED\";\n\t};\n\tconst send = (data, useBuffer = true) => {\n\t\tif (!wsRef.value || status.value !== \"OPEN\") {\n\t\t\tif (useBuffer) bufferedData.push(data);\n\t\t\treturn false;\n\t\t}\n\t\t_sendBuffer();\n\t\twsRef.value.send(data);\n\t\treturn true;\n\t};\n\tconst _init = () => {\n\t\tif (explicitlyClosed || typeof urlRef.value === \"undefined\") return;\n\t\tconst ws = new WebSocket(urlRef.value, protocols);\n\t\twsRef.value = ws;\n\t\tstatus.value = \"CONNECTING\";\n\t\tws.onopen = () => {\n\t\t\tif (wsRef.value !== ws) return;\n\t\t\tstatus.value = \"OPEN\";\n\t\t\tretried = 0;\n\t\t\tonConnected === null || onConnected === void 0 || onConnected(ws);\n\t\t\theartbeatResume === null || heartbeatResume === void 0 || heartbeatResume();\n\t\t\t_sendBuffer();\n\t\t};\n\t\tws.onclose = (ev) => {\n\t\t\tif (wsRef.value === ws) status.value = \"CLOSED\";\n\t\t\tif (!wsRef.value || wsRef.value === ws) {\n\t\t\t\tresetHeartbeat();\n\t\t\t\theartbeatPause === null || heartbeatPause === void 0 || heartbeatPause();\n\t\t\t}\n\t\t\tonDisconnected === null || onDisconnected === void 0 || onDisconnected(ws, ev);\n\t\t\tif (!explicitlyClosed && options.autoReconnect && (wsRef.value == null || ws === wsRef.value)) {\n\t\t\t\tconst { retries = -1, delay = 1e3, onFailed } = resolveNestedOptions(options.autoReconnect);\n\t\t\t\tif ((typeof retries === \"function\" ? retries : () => typeof retries === \"number\" && (retries < 0 || retried < retries))(retried)) {\n\t\t\t\t\tretried += 1;\n\t\t\t\t\tconst delayTime = typeof delay === \"function\" ? delay(retried) : delay;\n\t\t\t\t\tretryTimeout = setTimeout(_init, delayTime);\n\t\t\t\t} else onFailed === null || onFailed === void 0 || onFailed();\n\t\t\t}\n\t\t};\n\t\tws.onerror = (e) => {\n\t\t\tonError === null || onError === void 0 || onError(ws, e);\n\t\t};\n\t\tws.onmessage = (e) => {\n\t\t\tif (wsRef.value !== ws) return;\n\t\t\tif (options.heartbeat) {\n\t\t\t\tresetHeartbeat();\n\t\t\t\tconst { message = DEFAULT_PING_MESSAGE, responseMessage = message } = resolveNestedOptions(options.heartbeat);\n\t\t\t\tif (e.data === toValue(responseMessage)) return;\n\t\t\t}\n\t\t\tdata.value = e.data;\n\t\t\tonMessage === null || onMessage === void 0 || onMessage(ws, e);\n\t\t};\n\t};\n\tif (options.heartbeat) {\n\t\tconst { message = DEFAULT_PING_MESSAGE, scheduler = (cb) => useIntervalFn(cb, 1e3, { immediate: false }), pongTimeout = 1e3 } = resolveNestedOptions(options.heartbeat);\n\t\tconst { pause, resume } = scheduler(() => {\n\t\t\tsend(toValue(message), false);\n\t\t\tif (pongTimeoutWait != null) return;\n\t\t\tpongTimeoutWait = setTimeout(() => {\n\t\t\t\tclose();\n\t\t\t\texplicitlyClosed = false;\n\t\t\t}, pongTimeout);\n\t\t});\n\t\theartbeatPause = pause;\n\t\theartbeatResume = resume;\n\t}\n\tif (autoClose) {\n\t\tif (isClient) useEventListener(\"beforeunload\", () => close(), { passive: true });\n\t\ttryOnScopeDispose(close);\n\t}\n\tconst open = () => {\n\t\tif (!isClient && !isWorker) return;\n\t\tclose();\n\t\texplicitlyClosed = false;\n\t\tretried = 0;\n\t\t_init();\n\t};\n\tif (immediate) open();\n\tif (autoConnect) watch(urlRef, open);\n\treturn {\n\t\tdata,\n\t\tstatus,\n\t\tclose,\n\t\tsend,\n\t\topen,\n\t\tws: wsRef\n\t};\n}\n// useWebWorker/index.ts\nfunction useWebWorker(arg0, workerOptions, options) {\n\tconst { window = defaultWindow } = options !== null && options !== void 0 ? options : {};\n\tconst data = shallowRef(null);\n\tconst worker = shallowRef();\n\tconst post = (...args) => {\n\t\tif (!worker.value) return;\n\t\tworker.value.postMessage(...args);\n\t};\n\tconst terminate = function terminate() {\n\t\tif (!worker.value) return;\n\t\tworker.value.terminate();\n\t};\n\tif (window) {\n\t\tif (typeof arg0 === \"string\") worker.value = new Worker(arg0, workerOptions);\n\t\telse if (typeof arg0 === \"function\") worker.value = arg0();\n\t\telse worker.value = arg0;\n\t\tworker.value.onmessage = (e) => {\n\t\t\tdata.value = e.data;\n\t\t};\n\t\ttryOnScopeDispose(() => {\n\t\t\tif (worker.value) worker.value.terminate();\n\t\t});\n\t}\n\treturn {\n\t\tdata,\n\t\tpost,\n\t\tterminate,\n\t\tworker\n\t};\n}\n// useWebWorkerFn/lib/depsParser.ts\n/**\n*\n* Concatenates the dependencies into a comma separated string.\n* this string will then be passed as an argument to the \"importScripts\" function\n*\n* @param deps array of string\n* @param localDeps array of function\n* @returns a string composed by the concatenation of the array\n* elements \"deps\" and \"importScripts\".\n*\n* @example\n* depsParser(['demo1', 'demo2']) // return importScripts('demo1', 'demo2')\n*/\nfunction depsParser(deps, localDeps) {\n\tif (deps.length === 0 && localDeps.length === 0) return \"\";\n\tconst depsString = deps.map((dep) => `'${dep}'`).toString();\n\tconst depsFunctionString = localDeps.filter((dep) => typeof dep === \"function\").map((fn) => {\n\t\tconst str = fn.toString();\n\t\tif (str.trim().startsWith(\"function\")) return str;\n\t\telse return `const ${fn.name} = ${str}`;\n\t}).join(\";\");\n\tconst importString = `importScripts(${depsString});`;\n\treturn `${depsString.trim() === \"\" ? \"\" : importString} ${depsFunctionString}`;\n}\n// useWebWorkerFn/lib/jobRunner.ts\n/**\n* This function accepts as a parameter a function \"userFunc\"\n* And as a result returns an anonymous function.\n* This anonymous function, accepts as arguments,\n* the parameters to pass to the function \"useArgs\" and returns a Promise\n* This function can be used as a wrapper, only inside a Worker\n* because it depends by \"postMessage\".\n*\n* @param userFunc {Function} fn the function to run with web worker\n*\n* @returns returns a function that accepts the parameters\n* to be passed to the \"userFunc\" function\n*/\nfunction jobRunner(userFunc) {\n\treturn (e) => {\n\t\tconst userFuncArgs = e.data[0];\n\t\treturn Promise.resolve(userFunc.apply(void 0, userFuncArgs)).then((result) => {\n\t\t\tpostMessage([\"SUCCESS\", result]);\n\t\t}).catch((error) => {\n\t\t\tpostMessage([\"ERROR\", error]);\n\t\t});\n\t};\n}\n// useWebWorkerFn/lib/createWorkerBlobUrl.ts\n/**\n* Converts the \"fn\" function into the syntax needed to be executed within a web worker\n*\n* @param fn the function to run with web worker\n* @param deps array of strings, imported into the worker through \"importScripts\"\n* @param localDeps array of function, local dependencies\n*\n* @returns a blob url, containing the code of \"fn\" as a string\n*\n* @example\n* createWorkerBlobUrl((a,b) => a+b, [])\n* // return \"onmessage=return Promise.resolve((a,b) => a + b)\n* .then(postMessage(['SUCCESS', result]))\n* .catch(postMessage(['ERROR', error])\"\n*/\nfunction createWorkerBlobUrl(fn, deps, localDeps) {\n\tconst blobCode = `${depsParser(deps, localDeps)}; onmessage=(${jobRunner})(${fn})`;\n\tconst blob = new Blob([blobCode], { type: \"text/javascript\" });\n\treturn URL.createObjectURL(blob);\n}\n// useWebWorkerFn/index.ts\n/**\n* Run expensive function without blocking the UI, using a simple syntax that makes use of Promise.\n*\n* @see https://vueuse.org/useWebWorkerFn\n* @param fn\n* @param options\n*/\nfunction useWebWorkerFn(fn, options = {}) {\n\tconst { dependencies = [], localDependencies = [], timeout, window = defaultWindow } = options;\n\tlet worker;\n\tconst workerStatus = shallowRef(\"PENDING\");\n\tconst promise = shallowRef({});\n\tconst timeoutId = shallowRef();\n\tconst workerTerminate = (status = \"PENDING\") => {\n\t\tif (worker && worker._url && window) {\n\t\t\tworker.terminate();\n\t\t\tURL.revokeObjectURL(worker._url);\n\t\t\tpromise.value = {};\n\t\t\tworker = void 0;\n\t\t\twindow.clearTimeout(timeoutId.value);\n\t\t\tworkerStatus.value = status;\n\t\t}\n\t};\n\tworkerTerminate();\n\ttryOnScopeDispose(workerTerminate);\n\tconst generateWorker = () => {\n\t\tconst blobUrl = createWorkerBlobUrl(fn, dependencies, localDependencies);\n\t\tconst newWorker = new Worker(blobUrl);\n\t\tnewWorker._url = blobUrl;\n\t\tnewWorker.onmessage = (e) => {\n\t\t\tconst { resolve = () => {}, reject = () => {} } = promise.value;\n\t\t\tconst [status, result] = e.data;\n\t\t\tswitch (status) {\n\t\t\t\tcase \"SUCCESS\":\n\t\t\t\t\tresolve(result);\n\t\t\t\t\tworkerTerminate(status);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treject(result);\n\t\t\t\t\tworkerTerminate(\"ERROR\");\n\t\t\t}\n\t\t};\n\t\tnewWorker.onerror = (e) => {\n\t\t\tconst { reject = () => {} } = promise.value;\n\t\t\te.preventDefault();\n\t\t\treject(e);\n\t\t\tworkerTerminate(\"ERROR\");\n\t\t};\n\t\tif (timeout) timeoutId.value = setTimeout(workerTerminate, timeout, \"TIMEOUT_EXPIRED\");\n\t\treturn newWorker;\n\t};\n\tconst callWorker = (...fnArgs) => new Promise((resolve, reject) => {\n\t\tpromise.value = {\n\t\t\tresolve,\n\t\t\treject\n\t\t};\n\t\tworker === null || worker === void 0 || worker.postMessage([[...fnArgs]]);\n\t\tworkerStatus.value = \"RUNNING\";\n\t});\n\tconst workerFn = (...fnArgs) => {\n\t\tif (workerStatus.value === \"RUNNING\") {\n\t\t\tconsole.error(\"[useWebWorkerFn] You can only run one instance of the worker at a time.\");\n\t\t\treturn Promise.reject();\n\t\t}\n\t\tworker = generateWorker();\n\t\treturn callWorker(...fnArgs);\n\t};\n\treturn {\n\t\tworkerFn,\n\t\tworkerStatus,\n\t\tworkerTerminate\n\t};\n}\n// useWindowFocus/index.ts\n/**\n* Reactively track window focus with `window.onfocus` and `window.onblur`.\n*\n* @see https://vueuse.org/useWindowFocus\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWindowFocus(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tif (!window) return shallowRef(false);\n\tconst focused = shallowRef(window.document.hasFocus());\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(window, \"blur\", () => {\n\t\tfocused.value = false;\n\t}, listenerOptions);\n\tuseEventListener(window, \"focus\", () => {\n\t\tfocused.value = true;\n\t}, listenerOptions);\n\treturn focused;\n}\n// useWindowScroll/index.ts\n/**\n* Reactive window scroll.\n*\n* @see https://vueuse.org/useWindowScroll\n* @param options\n*/\nfunction useWindowScroll(options = {}) {\n\tconst { window = defaultWindow, ...rest } = options;\n\treturn useScroll(window, rest);\n}\n// useWindowSize/index.ts\n/**\n* Reactive window size.\n*\n* @see https://vueuse.org/useWindowSize\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWindowSize(options = {}) {\n\tconst { window = defaultWindow, initialWidth = Number.POSITIVE_INFINITY, initialHeight = Number.POSITIVE_INFINITY, listenOrientation = true, includeScrollbar = true, type = \"inner\" } = options;\n\tconst width = shallowRef(initialWidth);\n\tconst height = shallowRef(initialHeight);\n\tconst update = () => {\n\t\tif (window) {\n\t\t\tif (type === \"outer\") {\n\t\t\t\twidth.value = window.outerWidth;\n\t\t\t\theight.value = window.outerHeight;\n\t\t\t} else if (type === \"visual\" && window.visualViewport) {\n\t\t\t\tconst { width: visualViewportWidth, height: visualViewportHeight, scale } = window.visualViewport;\n\t\t\t\twidth.value = Math.round(visualViewportWidth * scale);\n\t\t\t\theight.value = Math.round(visualViewportHeight * scale);\n\t\t\t} else if (includeScrollbar) {\n\t\t\t\twidth.value = window.innerWidth;\n\t\t\t\theight.value = window.innerHeight;\n\t\t\t} else {\n\t\t\t\twidth.value = window.document.documentElement.clientWidth;\n\t\t\t\theight.value = window.document.documentElement.clientHeight;\n\t\t\t}\n\t\t}\n\t};\n\tupdate();\n\ttryOnMounted(update);\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(\"resize\", update, listenerOptions);\n\tif (window && type === \"visual\" && window.visualViewport) useEventListener(window.visualViewport, \"resize\", update, listenerOptions);\n\tif (listenOrientation) {\n\t\tconst matches = useMediaQuery(\"(orientation: portrait)\");\n\t\twatch(matches, () => update());\n\t}\n\treturn {\n\t\twidth,\n\t\theight\n\t};\n}\nexport { DefaultMagicKeysAliasMap, StorageSerializers, TransitionPresets, asyncComputed, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsElement, breakpointsMasterCss, breakpointsPrimeFlex, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, breakpointsVuetifyV2, breakpointsVuetifyV3, cloneFnJSON, computedAsync, computedInject, createFetch, createReusableTemplate, createTemplatePromise, createUnrefFn, customStorageEventName, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, executeTransition, formatTimeAgo, formatTimeAgoIntl, formatTimeAgoIntlParts, getSSRHandler, isFocusedElementEditable, isTypedCharValid, mapGamepadToXbox360Controller, onClickOutside, onElementRemoval, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, provideSSRWidth, setSSRHandler, transition, unrefElement, useActiveElement, useAnimate, useAsyncQueue, useAsyncState, useBase64, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useBrowserLocation, useCached, useClipboard, useClipboardItems, useCloned, useColorMode, useConfirmDialog, useCountdown, useCssSupports, useCssVar, useCurrentElement, useCycleList, useDark, useDebouncedRefHistory, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDisplayMedia, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementOverflow, useElementSize, useElementVisibility, useEventBus, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useFps, useFullscreen, useGamepad, useGeolocation, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useKeyModifier, useLiveAnnouncer, useLocalStorage, useMagicKeys, useManualRefHistory, useMediaControls, useMediaQuery, useMemoize, useMemory, useMounted, useMouse, useMouseInElement, useMousePressed, useMutationObserver, useNavigatorLanguage, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParallax, useParentElement, usePerformanceObserver, usePermission, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePreferredReducedTransparency, usePrevious, useRafFn, useRefHistory, useResizeObserver, useSSRWidth, useScreenOrientation, useScreenSafeArea, useScriptTag, useScroll, useScrollLock, useSessionStorage, useShare, useSorted, useSpeechRecognition, useSpeechSynthesis, useStepper, useStorage, useStorageAsync, useStyleTag, useSupported, useSwipe, useTemplateRefsList, useTemporalNow, useTextDirection, useTextSelection, useTextareaAutosize, useThrottledRefHistory, useTimeAgo, useTimeAgoIntl, useTimeoutPoll, useTimestamp, useTitle, useTransition, useUrlSearchParams, useUserMedia, useVModel, useVModels, useVibrate, useVirtualList, useWakeLock, useWebMCP, useWebNotification, useWebSocket, useWebWorker, useWebWorkerFn, useWindowFocus, useWindowScroll, useWindowSize };\n","export class NoContextDataProvidedError extends Error {\n\tconstructor(msg: string) {\n\t\tsuper(msg);\n\t\tthis.name = 'NoContextDataProvidedError';\n\t}\n}\n","import { createInjectionState } from '@vueuse/core';\nimport type { Participant } from 'livekit-client';\nimport { shallowRef, type ShallowRef } from 'vue';\n\nimport { NoContextDataProvidedError } from './error';\n\nexport type ParticipantContext = ShallowRef<Participant>;\n\nconst [useProvideParticipantContext, useParticipantContextRaw] = createInjectionState(\n\t(initialValue: Participant): ParticipantContext => {\n\t\treturn shallowRef(initialValue);\n\t},\n);\n\nexport { useParticipantContextRaw, useProvideParticipantContext };\n\nexport function useMaybeParticipantContext(): ParticipantContext | undefined {\n\treturn useParticipantContextRaw();\n}\n\nexport function useParticipantContext(): ParticipantContext {\n\tconst context = useMaybeParticipantContext();\n\n\tif (context === undefined) {\n\t\tthrow new NoContextDataProvidedError(\n\t\t\t'Please call `useProvideParticipantContext` on the appropriate parent component',\n\t\t);\n\t}\n\n\treturn context;\n}\n\nexport function useEnsureParticipant(participant?: Participant): ParticipantContext {\n\tif (participant !== undefined) {\n\t\treturn shallowRef(participant);\n\t}\n\n\treturn useParticipantContext();\n}\n","<template>\n\t<slot />\n</template>\n\n<script setup lang=\"ts\">\n\timport type { Participant } from 'livekit-client';\n\timport { watch } from 'vue';\n\n\timport { useProvideParticipantContext } from '@/context/participant.context';\n\n\tinterface ParticipantContextProviderProps {\n\t\tparticipant: Participant;\n\t}\n\n\tconst props = defineProps<ParticipantContextProviderProps>();\n\n\tdefineSlots<{ default?: () => unknown }>();\n\n\tconst context = useProvideParticipantContext(props.participant);\n\n\twatch(\n\t\t() => props.participant,\n\t\t(participant) => {\n\t\t\tcontext.value = participant;\n\t\t},\n\t);\n</script>\n","import { createInjectionState } from '@vueuse/core';\nimport type { Room } from 'livekit-client';\nimport { shallowRef, type ShallowRef } from 'vue';\n\nimport { NoContextDataProvidedError } from './error';\n\nexport type RoomContext = ShallowRef<Room>;\n\nconst [useProvideRoomContext, useRoomContextRaw] = createInjectionState(\n\t(initialValue: Room): RoomContext => {\n\t\treturn shallowRef(initialValue);\n\t},\n);\n\nexport { useProvideRoomContext, useRoomContextRaw };\n\nexport function useMaybeRoomContext(): RoomContext | undefined {\n\treturn useRoomContextRaw();\n}\n\nexport function useRoomContext(): RoomContext {\n\tconst context = useMaybeRoomContext();\n\n\tif (context === undefined) {\n\t\tthrow new NoContextDataProvidedError(\n\t\t\t'Please call `useProvideRoomContext` on the appropriate parent component',\n\t\t);\n\t}\n\n\treturn context;\n}\n\nexport function useEnsureRoomContext(room?: Room): RoomContext {\n\tif (room !== undefined) {\n\t\treturn shallowRef(room);\n\t}\n\n\treturn useRoomContext();\n}\n","<template>\n\t<slot />\n</template>\n\n<script setup lang=\"ts\">\n\timport type { Room } from 'livekit-client';\n\timport { watch } from 'vue';\n\n\timport { useProvideRoomContext } from '@/context/room.context';\n\n\tinterface RoomContextProviderProps {\n\t\troom: Room;\n\t}\n\n\tconst props = defineProps<RoomContextProviderProps>();\n\n\tdefineSlots<{ default?: () => unknown }>();\n\n\tconst context = useProvideRoomContext(props.room);\n\n\twatch(\n\t\t() => props.room,\n\t\t(room) => {\n\t\t\tcontext.value = room;\n\t\t},\n\t);\n</script>\n","import { createInjectionState } from '@vueuse/core';\nimport { shallowRef, type ShallowRef } from 'vue';\n\nimport type { UseSession } from '@/composables/useSession';\n\nimport { NoContextDataProvidedError } from './error';\n\nexport type SessionContext = ShallowRef<UseSession>;\n\nconst [useProvideSessionContext, useSessionContextRaw] = createInjectionState(\n\t(initialValue: UseSession): SessionContext => {\n\t\treturn shallowRef(initialValue);\n\t},\n);\n\nexport { useProvideSessionContext, useSessionContextRaw };\n\nexport function useMaybeSessionContext(): SessionContext | undefined {\n\treturn useSessionContextRaw();\n}\n\nexport function useSessionContext(): SessionContext {\n\tconst context = useMaybeSessionContext();\n\n\tif (context === undefined) {\n\t\tthrow new NoContextDataProvidedError(\n\t\t\t'Please wrap the component in a `SessionProvider`, or pass the session explicitly',\n\t\t);\n\t}\n\n\treturn context;\n}\n\nexport function useEnsureSession(session?: UseSession): SessionContext {\n\tif (session !== undefined) {\n\t\treturn shallowRef(session);\n\t}\n\n\treturn useSessionContext();\n}\n","<template>\n\t<slot />\n</template>\n\n<script setup lang=\"ts\">\n\timport { watch } from 'vue';\n\n\timport type { UseSession } from '@/composables/useSession';\n\timport { useProvideRoomContext } from '@/context/room.context';\n\timport { useProvideSessionContext } from '@/context/session.context';\n\n\tinterface SessionProviderProps {\n\t\tsession: UseSession;\n\t}\n\n\tconst props = defineProps<SessionProviderProps>();\n\n\tdefineSlots<{ default?: () => unknown }>();\n\n\tconst sessionContext = useProvideSessionContext(props.session);\n\tconst roomContext = useProvideRoomContext(props.session.room);\n\n\twatch(\n\t\t() => props.session,\n\t\t(session) => {\n\t\t\tsessionContext.value = session;\n\t\t\troomContext.value = session.room;\n\t\t},\n\t);\n</script>\n","import type { TrackReference, TrackReferenceOrPlaceholder } from '@livekit/components-core';\nimport { createInjectionState } from '@vueuse/core';\nimport { shallowRef, type ShallowRef } from 'vue';\n\nimport { NoContextDataProvidedError } from './error';\n\nexport type TrackRefContext = ShallowRef<TrackReferenceOrPlaceholder>;\n\nconst [useProvideTrackRefContext, useTrackRefContextRaw] = createInjectionState(\n\t(ref: TrackReference | TrackReferenceOrPlaceholder): TrackRefContext => {\n\t\treturn shallowRef(ref);\n\t},\n);\n\nexport { useProvideTrackRefContext, useTrackRefContextRaw };\n\nexport function useMaybeTrackRefContext(): TrackRefContext | undefined {\n\treturn useTrackRefContextRaw();\n}\n\nexport function useTrackRefContext(): TrackRefContext {\n\tconst context = useMaybeTrackRefContext();\n\n\tif (context === undefined) {\n\t\tthrow new NoContextDataProvidedError(\n\t\t\t'Please call `useProvideTrackRefContext` on the appropriate parent component',\n\t\t);\n\t}\n\n\treturn context;\n}\n\nexport function useEnsureTrackRef(trackRef?: TrackReferenceOrPlaceholder): TrackRefContext {\n\tif (trackRef !== undefined) {\n\t\treturn shallowRef(trackRef);\n\t}\n\n\treturn useTrackRefContext();\n}\n","<template>\n\t<slot />\n</template>\n\n<script setup lang=\"ts\">\n\timport type { TrackReferenceOrPlaceholder } from '@livekit/components-core';\n\timport { watch } from 'vue';\n\n\timport { useProvideTrackRefContext } from '@/context/track-reference.context';\n\n\tinterface TrackRefContextProviderProps {\n\t\ttrackRef: TrackReferenceOrPlaceholder;\n\t}\n\n\tconst props = defineProps<TrackRefContextProviderProps>();\n\n\tdefineSlots<{ default?: () => unknown }>();\n\n\tconst context = useProvideTrackRefContext(props.trackRef);\n\n\twatch(\n\t\t() => props.trackRef,\n\t\t(trackRef) => {\n\t\t\tcontext.value = trackRef;\n\t\t},\n\t);\n</script>\n","import type { PinState, TrackReferenceOrPlaceholder } from '@livekit/components-core';\nimport { createInjectionState } from '@vueuse/core';\nimport { shallowRef, type ShallowRef } from 'vue';\n\nexport interface SetPinAction {\n\treadonly msg: 'set_pin';\n\treadonly trackReference: TrackReferenceOrPlaceholder;\n}\n\nexport interface ClearPinAction {\n\treadonly msg: 'clear_pin';\n}\n\nexport type PinContextAction = SetPinAction | ClearPinAction;\n\nexport interface PinContext {\n\treadonly state: ShallowRef<PinState>;\n\treadonly dispatch: (action: PinContextAction) => void;\n}\n\nexport function pinReducer(_state: PinState, action: PinContextAction): PinState {\n\tif (action.msg === 'set_pin') {\n\t\treturn [action.trackReference];\n\t}\n\n\treturn [];\n}\n\nexport function createPinContext(initialValue?: PinState): PinContext {\n\tconst state = shallowRef<PinState>(initialValue ?? []);\n\n\tfunction dispatch(action: PinContextAction): void {\n\t\tstate.value = pinReducer(state.value, action);\n\t}\n\n\tconst context: PinContext = {\n\t\tstate,\n\t\tdispatch,\n\t};\n\n\treturn context;\n}\n\nconst [useProvidePinContext, usePinContextRaw] = createInjectionState(createPinContext);\n\nexport { usePinContextRaw, useProvidePinContext };\n\nexport function usePinContext(): PinContext {\n\tconst context = usePinContextRaw();\n\n\tif (context === undefined) {\n\t\tthrow new Error(\n\t\t\t'Pin context not found. Make sure you have a PinContextProvider in your component tree.',\n\t\t);\n\t}\n\n\treturn context;\n}\n\nexport function useMaybePinContext(): PinContext | undefined {\n\treturn usePinContextRaw();\n}\n\nexport function useEnsurePinContext(pinContext?: PinContext): PinContext {\n\tif (pinContext !== undefined) {\n\t\treturn pinContext;\n\t}\n\n\treturn usePinContext();\n}\n","import type { WidgetState } from '@livekit/components-core';\nimport { createInjectionState } from '@vueuse/core';\nimport { shallowRef, type ShallowRef } from 'vue';\n\nexport interface WidgetMessageAction {\n\treadonly msg: 'show_chat' | 'hide_chat' | 'toggle_chat' | 'toggle_settings';\n}\n\nexport interface UnreadMessagesAction {\n\treadonly msg: 'unread_msg';\n\treadonly count: number;\n}\n\nexport type WidgetContextAction = WidgetMessageAction | UnreadMessagesAction;\n\nexport interface WidgetContext {\n\treadonly state: ShallowRef<WidgetState>;\n\treadonly dispatch: (action: WidgetContextAction) => void;\n}\n\nconst DEFAULT_WIDGET_STATE: WidgetState = {\n\tshowSettings: false,\n\tshowChat: false,\n\tunreadMessages: 0,\n};\n\nexport function widgetReducer(state: WidgetState, action: WidgetContextAction): WidgetState {\n\tif (action.msg === 'unread_msg') {\n\t\treturn { ...state, unreadMessages: action.count };\n\t}\n\n\tif (action.msg === 'toggle_settings') {\n\t\treturn { ...state, showSettings: state.showSettings !== true };\n\t}\n\n\tif (action.msg === 'hide_chat' || (action.msg === 'toggle_chat' && state.showChat)) {\n\t\treturn { ...state, showChat: false };\n\t}\n\n\treturn { ...state, showChat: true, unreadMessages: 0 };\n}\n\nexport function createWidgetContext(initialValue?: WidgetState): WidgetContext {\n\tconst state = shallowRef<WidgetState>(initialValue ?? DEFAULT_WIDGET_STATE);\n\n\tfunction dispatch(action: WidgetContextAction): void {\n\t\tstate.value = widgetReducer(state.value, action);\n\t}\n\n\tconst context: WidgetContext = {\n\t\tstate,\n\t\tdispatch,\n\t};\n\n\treturn context;\n}\n\nconst [useProvideWidgetContext, useWidgetContextRaw] = createInjectionState(createWidgetContext);\n\nexport { useProvideWidgetContext };\n\nexport function useWidgetContext(): WidgetContext {\n\tconst context = useWidgetContextRaw();\n\n\tif (context === undefined) {\n\t\tthrow new Error(\n\t\t\t'Widget context not found. Make sure you have a WidgetContextProvider in your component tree.',\n\t\t);\n\t}\n\n\treturn context;\n}\n\nexport function useMaybeWidgetContext(): WidgetContext | undefined {\n\treturn useWidgetContextRaw();\n}\n\nexport function useEnsureWidgetContext(widgetContext?: WidgetContext): WidgetContext {\n\tif (widgetContext !== undefined) {\n\t\treturn widgetContext;\n\t}\n\n\treturn useWidgetContext();\n}\n","import { createInjectionState } from '@vueuse/core';\nimport { shallowRef, type ShallowRef } from 'vue';\n\nimport { createPinContext, type PinContext } from './pin.context';\nimport { createWidgetContext, type WidgetContext } from './widget.context';\n\nexport interface LayoutContext {\n\tpin: PinContext;\n\twidget: WidgetContext;\n}\n\nconst [useProvideLayoutContext, useLayoutContextRaw] = createInjectionState(\n\t(initialState?: LayoutContext): ShallowRef<LayoutContext> => {\n\t\treturn shallowRef<LayoutContext>(initialState ?? createLayoutContext());\n\t},\n);\n\nexport function useLayoutContext(): ShallowRef<LayoutContext> {\n\tconst context = useLayoutContextRaw();\n\n\tif (context === undefined) {\n\t\tthrow new Error(\n\t\t\t'Layout context not found. Make sure you have a LayoutContextProvider in your component tree.',\n\t\t);\n\t}\n\n\treturn context;\n}\n\nexport { useLayoutContextRaw, useProvideLayoutContext };\n\nexport function useMaybeLayoutContext(): ShallowRef<LayoutContext> | undefined {\n\treturn useLayoutContextRaw();\n}\n\nexport function useEnsureLayoutContext(layoutContext?: LayoutContext): ShallowRef<LayoutContext> {\n\tif (layoutContext !== undefined) {\n\t\treturn shallowRef<LayoutContext>(layoutContext);\n\t}\n\n\treturn useLayoutContext();\n}\n\nexport function createLayoutContext(): LayoutContext {\n\treturn {\n\t\tpin: createPinContext(),\n\t\twidget: createWidgetContext(),\n\t};\n}\n\nexport function useCreateLayoutContext(): LayoutContext {\n\treturn createLayoutContext();\n}\n\nexport function useEnsureCreateLayoutContext(\n\tlayoutContext?: LayoutContext,\n): ShallowRef<LayoutContext> {\n\treturn shallowRef<LayoutContext>(layoutContext ?? createLayoutContext());\n}\n","import { computed, type ComputedRef } from 'vue';\n\nimport { useEnsureLayoutContext } from '@/context/layout.context';\n\nexport interface ChatToggleAttributes {\n\treadonly 'aria-pressed': string;\n}\n\nexport interface UseChatToggle {\n\treadonly isVisible: ComputedRef<boolean>;\n\treadonly toggle: () => void;\n\treadonly show: () => void;\n\treadonly hide: () => void;\n\treadonly unreadCount: ComputedRef<number>;\n\treadonly attributes: ComputedRef<ChatToggleAttributes>;\n}\n\nexport function useChatToggle(): UseChatToggle {\n\tconst layoutContext = useEnsureLayoutContext();\n\n\tconst isVisible = computed<boolean>(() => {\n\t\treturn layoutContext.value.widget.state.value.showChat;\n\t});\n\n\tconst unreadCount = computed<number>(() => {\n\t\treturn layoutContext.value.widget.state.value.unreadMessages;\n\t});\n\n\tconst attributes = computed<ChatToggleAttributes>(() => {\n\t\treturn {\n\t\t\t'aria-pressed': `${isVisible.value}`,\n\t\t};\n\t});\n\n\tfunction toggle(): void {\n\t\tlayoutContext.value.widget.dispatch({ msg: 'toggle_chat' });\n\t}\n\n\tfunction show(): void {\n\t\tlayoutContext.value.widget.dispatch({ msg: 'show_chat' });\n\t}\n\n\tfunction hide(): void {\n\t\tlayoutContext.value.widget.dispatch({ msg: 'hide_chat' });\n\t}\n\n\tconst chatToggle: UseChatToggle = {\n\t\tisVisible,\n\t\ttoggle,\n\t\tshow,\n\t\thide,\n\t\tunreadCount,\n\t\tattributes,\n\t};\n\n\treturn chatToggle;\n}\n","<template>\n\t<button\n\t\ttype=\"button\"\n\t\tv-bind=\"styleAttrs\"\n\t\t:aria-pressed=\"isVisible\"\n\t\t:data-lk-unread-msgs=\"unreadLabel\"\n\t\t@click=\"toggle\"\n\t>\n\t\t<slot\n\t\t\t:is-visible=\"isVisible\"\n\t\t\t:unread-count=\"unreadCount\"\n\t\t/>\n\t</button>\n</template>\n\n<script setup lang=\"ts\">\n\timport { computed } from 'vue';\n\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useChatToggle } from '@/composables/useChatToggle';\n\n\texport type ChatToggleProps = LkStyleProps;\n\n\tconst props = defineProps<ChatToggleProps>();\n\n\tdefineSlots<{ default?: (props: { isVisible: boolean; unreadCount: number }) => unknown }>();\n\n\tconst { isVisible, unreadCount, toggle } = useChatToggle();\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-button', 'lk-chat-toggle']);\n\n\tconst unreadLabel = computed<string>(() => {\n\t\treturn unreadCount.value > 9 ? '9+' : String(unreadCount.value);\n\t});\n</script>\n","import { computed, type Ref } from 'vue';\n\nimport { useEnsureLayoutContext } from '@/context/layout.context';\n\nexport interface ClearPinButtonProps {\n\treadonly className?: string;\n\treadonly disabled?: boolean;\n\treadonly onClick?: () => void;\n}\n\nexport interface ClearPinButtonAttributes {\n\treadonly disabled: boolean;\n\treadonly onClick: () => void;\n}\n\nexport interface UseClearPinButton {\n\treadonly buttonProps: Ref<ClearPinButtonAttributes>;\n}\n\nexport function useClearPinButton(props: ClearPinButtonProps = {}): UseClearPinButton {\n\tconst layoutContext = useEnsureLayoutContext();\n\n\tfunction handleClick(): void {\n\t\tlayoutContext.value.pin.dispatch({ msg: 'clear_pin' });\n\t\tprops.onClick?.();\n\t}\n\n\tconst buttonProps = computed<ClearPinButtonAttributes>(() => {\n\t\tconst isDisabled = layoutContext.value.pin.state.value.length === 0 || props.disabled === true;\n\n\t\treturn {\n\t\t\tdisabled: isDisabled,\n\t\t\tonClick: handleClick,\n\t\t};\n\t});\n\n\tconst clearPinButton: UseClearPinButton = {\n\t\tbuttonProps,\n\t};\n\n\treturn clearPinButton;\n}\n","<template>\n\t<button\n\t\ttype=\"button\"\n\t\tv-bind=\"styleAttrs\"\n\t\t:disabled=\"buttonProps.disabled\"\n\t\t@click=\"buttonProps.onClick\"\n\t>\n\t\t<slot />\n\t</button>\n</template>\n\n<script setup lang=\"ts\">\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useClearPinButton } from '@/composables/useClearPinButton';\n\n\texport interface ClearPinButtonComponentProps extends LkStyleProps {\n\t\tdisabled?: boolean;\n\t}\n\n\tconst props = withDefaults(defineProps<ClearPinButtonComponentProps>(), { disabled: undefined });\n\n\tconst emits = defineEmits<{ click: [] }>();\n\n\tdefineSlots<{ default?: () => unknown }>();\n\n\tconst { buttonProps } = useClearPinButton({\n\t\tget disabled() {\n\t\t\treturn props.disabled;\n\t\t},\n\t\tonClick: () => emits('click'),\n\t});\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-button', 'lk-clear-pin-button']);\n</script>\n","import { createInjectionState } from '@vueuse/core';\nimport { ConnectionState } from 'livekit-client';\nimport { computed, ref, type ComputedRef, type Ref } from 'vue';\n\nimport { NoContextDataProvidedError } from './error';\n\nexport interface ConnectionStateContextState {\n\treadonly connectionState: Ref<ConnectionState>;\n}\n\nexport interface ConnectionStateContext {\n\treadonly state: ConnectionStateContextState;\n\treadonly isConnecting: ComputedRef<boolean>;\n\treadonly isConnected: ComputedRef<boolean>;\n\treadonly isReconnecting: ComputedRef<boolean>;\n\treadonly isDisconnected: ComputedRef<boolean>;\n\treadonly setConnectionState: (state: ConnectionState) => void;\n}\n\nexport function createConnectionStateContext(\n\tinitialState?: Partial<ConnectionStateContextState>,\n): ConnectionStateContext {\n\tconst state: ConnectionStateContextState = {\n\t\tconnectionState:\n\t\t\tinitialState?.connectionState ?? ref<ConnectionState>(ConnectionState.Disconnected),\n\t};\n\n\tconst isConnecting = computed<boolean>(() => {\n\t\treturn state.connectionState.value === ConnectionState.Connecting;\n\t});\n\n\tconst isConnected = computed<boolean>(() => {\n\t\treturn state.connectionState.value === ConnectionState.Connected;\n\t});\n\n\tconst isReconnecting = computed<boolean>(() => {\n\t\treturn state.connectionState.value === ConnectionState.Reconnecting;\n\t});\n\n\tconst isDisconnected = computed<boolean>(() => {\n\t\treturn state.connectionState.value === ConnectionState.Disconnected;\n\t});\n\n\tfunction setConnectionState(connectionState: ConnectionState): void {\n\t\tstate.connectionState.value = connectionState;\n\t}\n\n\tconst context: ConnectionStateContext = {\n\t\tstate,\n\t\tisConnecting,\n\t\tisConnected,\n\t\tisReconnecting,\n\t\tisDisconnected,\n\t\tsetConnectionState,\n\t};\n\n\treturn context;\n}\n\nconst [useProvideConnectionStateContext, useConnectionStateContextRaw] = createInjectionState(\n\tcreateConnectionStateContext,\n);\n\nexport { useConnectionStateContextRaw, useProvideConnectionStateContext };\n\nexport function useMaybeConnectionStateContext(): ConnectionStateContext | undefined {\n\treturn useConnectionStateContextRaw();\n}\n\nexport function useConnectionStateContext(): ConnectionStateContext {\n\tconst context = useMaybeConnectionStateContext();\n\n\tif (context === undefined) {\n\t\tthrow new NoContextDataProvidedError(\n\t\t\t'Please call `useProvideConnectionStateContext` on the appropriate parent component',\n\t\t);\n\t}\n\n\treturn context;\n}\n","import { connectionStateObserver, log } from '@livekit/components-core';\nimport type { ConnectionState, Room } from 'livekit-client';\nimport { computed, watchEffect, type ComputedRef, type Ref } from 'vue';\n\nimport {\n\tcreateConnectionStateContext,\n\tuseMaybeConnectionStateContext,\n} from '@/context/connection-state.context';\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nexport interface ConnectionStateProps {\n\treadonly room?: Room;\n}\n\nexport interface UseConnectionState {\n\treadonly connectionState: Ref<ConnectionState>;\n\treadonly isConnecting: ComputedRef<boolean>;\n\treadonly isConnected: ComputedRef<boolean>;\n\treadonly isReconnecting: ComputedRef<boolean>;\n\treadonly isDisconnected: ComputedRef<boolean>;\n}\n\nexport function useConnectionState(props: ConnectionStateProps = {}): UseConnectionState {\n\tconst roomEnsured = useEnsureRoomContext(props.room);\n\tconst connectionStateContext = useMaybeConnectionStateContext() ?? createConnectionStateContext();\n\n\tconst observable = computed<ReturnType<typeof connectionStateObserver>>(() => {\n\t\treturn connectionStateObserver(roomEnsured.value);\n\t});\n\n\twatchEffect((onCleanup): void => {\n\t\tconnectionStateContext.setConnectionState(roomEnsured.value.state);\n\n\t\tconst subscription = observable.value.subscribe({\n\t\t\tnext: (state: ConnectionState): void => {\n\t\t\t\tconnectionStateContext.setConnectionState(state);\n\t\t\t},\n\t\t\terror: (err: unknown): void => {\n\t\t\t\tlog.error('Connection state observer error:', err);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup((): void => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst connectionState: UseConnectionState = {\n\t\tconnectionState: connectionStateContext.state.connectionState,\n\t\tisConnecting: connectionStateContext.isConnecting,\n\t\tisConnected: connectionStateContext.isConnected,\n\t\tisReconnecting: connectionStateContext.isReconnecting,\n\t\tisDisconnected: connectionStateContext.isDisconnected,\n\t};\n\n\treturn connectionState;\n}\n","import { setupDisconnectButton } from '@livekit/components-core';\nimport { ConnectionState } from 'livekit-client';\nimport { computed, type ComputedRef } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nimport { useConnectionState } from './useConnectionState';\n\nexport interface UseDisconnectButtonProps {\n\treadonly stopTracks?: boolean;\n}\n\nexport interface UseDisconnectButton {\n\treadonly disabled: ComputedRef<boolean>;\n\treadonly onClick: () => void;\n}\n\nexport function useDisconnectButton(props: UseDisconnectButtonProps = {}): UseDisconnectButton {\n\tconst room = useEnsureRoomContext();\n\tconst { connectionState } = useConnectionState({\n\t\troom: room.value,\n\t});\n\n\tconst setup = computed<ReturnType<typeof setupDisconnectButton>>(() => {\n\t\treturn setupDisconnectButton(room.value);\n\t});\n\n\tconst disabled = computed<boolean>(() => {\n\t\treturn connectionState.value === ConnectionState.Disconnected;\n\t});\n\n\tfunction onClick(): void {\n\t\tsetup.value.disconnect(props.stopTracks ?? true);\n\t}\n\n\tconst disconnectButton: UseDisconnectButton = {\n\t\tdisabled,\n\t\tonClick,\n\t};\n\n\treturn disconnectButton;\n}\n","<template>\n\t<button\n\t\ttype=\"button\"\n\t\tv-bind=\"styleAttrs\"\n\t\t:disabled=\"disabled\"\n\t\t@click=\"onClick\"\n\t>\n\t\t<slot />\n\t</button>\n</template>\n\n<script setup lang=\"ts\">\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useDisconnectButton } from '@/composables/useDisconnectButton';\n\n\texport interface DisconnectButtonProps extends LkStyleProps {\n\t\tstopTracks?: boolean;\n\t}\n\n\tconst props = withDefaults(defineProps<DisconnectButtonProps>(), { stopTracks: true });\n\n\tdefineSlots<{ default?: () => unknown }>();\n\n\tconst { disabled, onClick } = useDisconnectButton({\n\t\tget stopTracks() {\n\t\t\treturn props.stopTracks;\n\t\t},\n\t});\n\tconst styleAttrs = useStyleAttrs(props, () => [\n\t\t'lk-button',\n\t\t'lk-button--danger',\n\t\t'lk-disconnect-button',\n\t]);\n</script>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"none\"\n\t>\n\t\t<g\n\t\t\tstroke=\"currentColor\"\n\t\t\tstroke-linecap=\"round\"\n\t\t\tstroke-linejoin=\"round\"\n\t\t\tstroke-width=\"1.5\"\n\t\t>\n\t\t\t<path d=\"M10 1.75h4.25m0 0V6m0-4.25L9 7M6 14.25H1.75m0 0V10m0 4.25L7 9\" />\n\t\t</g>\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"none\"\n\t>\n\t\t<g\n\t\t\tstroke=\"currentColor\"\n\t\t\tstroke-linecap=\"round\"\n\t\t\tstroke-linejoin=\"round\"\n\t\t\tstroke-width=\"1.5\"\n\t\t>\n\t\t\t<path d=\"M13.25 7H9m0 0V2.75M9 7l5.25-5.25M2.75 9H7m0 0v4.25M7 9l-5.25 5.25\" />\n\t\t</g>\n\t</svg>\n</template>\n","import { isTrackReferencePinned, type TrackReferenceOrPlaceholder } from '@livekit/components-core';\nimport { computed, type ComputedRef } from 'vue';\n\nimport { useMaybeLayoutContext } from '@/context/layout.context';\nimport { useEnsureTrackRef } from '@/context/track-reference.context';\n\nexport interface FocusToggleAttributes {\n\treadonly 'data-lk-toggle-focused'?: boolean;\n}\n\nexport interface FocusToggleProps {\n\treadonly trackRef?: TrackReferenceOrPlaceholder;\n}\n\nexport interface UseFocusToggle {\n\treadonly inFocus: ComputedRef<boolean>;\n\treadonly attributes: ComputedRef<FocusToggleAttributes>;\n\treadonly onClick: () => void;\n}\n\nexport function useFocusToggle(props: FocusToggleProps): UseFocusToggle {\n\tconst trackReference = useEnsureTrackRef(props.trackRef);\n\tconst layoutContext = useMaybeLayoutContext();\n\n\tconst inFocus = computed<boolean>(() => {\n\t\tconst pinState = layoutContext?.value.pin.state.value;\n\n\t\treturn isTrackReferencePinned(trackReference.value, pinState);\n\t});\n\n\tconst attributes = computed<FocusToggleAttributes>(() => {\n\t\treturn {\n\t\t\t'data-lk-toggle-focused': inFocus.value,\n\t\t};\n\t});\n\n\tfunction onClick(): void {\n\t\tif (inFocus.value) {\n\t\t\tlayoutContext?.value.pin.dispatch({\n\t\t\t\tmsg: 'clear_pin',\n\t\t\t});\n\t\t} else {\n\t\t\tlayoutContext?.value.pin.dispatch({\n\t\t\t\tmsg: 'set_pin',\n\t\t\t\ttrackReference: trackReference.value,\n\t\t\t});\n\t\t}\n\t}\n\n\tconst focusToggle: UseFocusToggle = {\n\t\tinFocus,\n\t\tattributes,\n\t\tonClick,\n\t};\n\n\treturn focusToggle;\n}\n","<template>\n\t<button\n\t\ttype=\"button\"\n\t\tv-bind=\"{ ...styleAttrs, ...attributes }\"\n\t\t:aria-pressed=\"inFocus\"\n\t\t:aria-label=\"inFocus ? 'Leave focus' : 'Focus'\"\n\t\t@click=\"onClick\"\n\t>\n\t\t<slot :in-focus=\"inFocus\">\n\t\t\t<UnfocusToggleIcon v-if=\"inFocus\" />\n\t\t\t<FocusToggleIcon v-else />\n\t\t</slot>\n\t</button>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { TrackReferenceOrPlaceholder } from '@livekit/components-core';\n\n\timport FocusToggleIcon from '@/components/icons/FocusToggleIcon.vue';\n\timport UnfocusToggleIcon from '@/components/icons/UnfocusToggleIcon.vue';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useFocusToggle } from '@/composables/useFocusToggle';\n\n\texport interface FocusToggleComponentProps extends LkStyleProps {\n\t\ttrackRef?: TrackReferenceOrPlaceholder;\n\t}\n\n\tconst props = defineProps<FocusToggleComponentProps>();\n\n\tdefineSlots<{ default?: (props: { inFocus: boolean }) => unknown }>();\n\n\tconst { inFocus, attributes, onClick } = useFocusToggle({ trackRef: props.trackRef });\n\tconst styleAttrs = useStyleAttrs(props, () => [\n\t\t'lk-button',\n\t\t'lk-button--icon',\n\t\t'lk-focus-toggle',\n\t]);\n</script>\n","import { createInjectionState } from '@vueuse/core';\nimport { shallowRef, type ShallowRef } from 'vue';\n\nexport interface FeatureFlags {\n\tautoSubscription?: boolean;\n}\n\nexport type FeatureContext = ShallowRef<FeatureFlags>;\n\nconst [useProvideFeatureContext, useFeatureContextRaw] = createInjectionState(\n\t(initialValue: FeatureFlags): FeatureContext => {\n\t\treturn shallowRef(initialValue);\n\t},\n);\n\nexport { useFeatureContextRaw, useProvideFeatureContext };\n\nexport function useMaybeFeatureContext(): FeatureContext | undefined {\n\treturn useFeatureContextRaw();\n}\n","import { createInjectionState } from '@vueuse/core';\nimport { ref, type Ref } from 'vue';\n\nimport { NoContextDataProvidedError } from './error';\n\nexport interface ToastMessage {\n\treadonly id: string;\n\treadonly message: string;\n\treadonly type: 'info' | 'success' | 'warning' | 'error';\n\treadonly timeout?: number;\n}\n\nexport interface ToastContext {\n\treadonly messages: Ref<ToastMessage[]>;\n\treadonly add: (message: Omit<ToastMessage, 'id'>) => string;\n\treadonly remove: (id: string) => void;\n\treadonly clear: () => void;\n}\n\nfunction createToastContext(): ToastContext {\n\tconst messages = ref<ToastMessage[]>([]);\n\n\tfunction remove(id: string): void {\n\t\tmessages.value = messages.value.filter((message) => message.id !== id);\n\t}\n\n\tfunction add(message: Omit<ToastMessage, 'id'>): string {\n\t\tconst id = crypto.randomUUID();\n\n\t\tmessages.value = [...messages.value, { ...message, id }];\n\n\t\tif (message.timeout !== undefined && message.timeout > 0) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tremove(id);\n\t\t\t}, message.timeout);\n\t\t}\n\n\t\treturn id;\n\t}\n\n\tfunction clear(): void {\n\t\tmessages.value = [];\n\t}\n\n\tconst context: ToastContext = {\n\t\tmessages,\n\t\tadd,\n\t\tremove,\n\t\tclear,\n\t};\n\n\treturn context;\n}\n\nconst [useProvideToastContext, useToastContextRaw] = createInjectionState(createToastContext);\n\nexport { useProvideToastContext, useToastContextRaw };\n\nexport function useMaybeToastContext(): ToastContext | undefined {\n\treturn useToastContextRaw();\n}\n\nexport function useToastContext(): ToastContext {\n\tconst context = useMaybeToastContext();\n\n\tif (context === undefined) {\n\t\tthrow new NoContextDataProvidedError(\n\t\t\t'Please call `useProvideToastContext` on the appropriate parent component',\n\t\t);\n\t}\n\n\treturn context;\n}\n","import {\n\tcreateMediaDeviceObserver,\n\tlog,\n\tsetupDeviceSelector,\n\ttype SetMediaDeviceOptions,\n} from '@livekit/components-core';\nimport { useEventListener } from '@vueuse/core';\nimport { Room, type LocalAudioTrack, type LocalVideoTrack } from 'livekit-client';\nimport { computed, ref, shallowRef, watchEffect, type Ref } from 'vue';\n\nimport { useMaybeRoomContext } from '@/context';\n\nexport interface UseMediaDeviceSelectProps {\n\treadonly kind: MediaDeviceKind;\n\treadonly room?: Room;\n\treadonly track?: LocalAudioTrack | LocalVideoTrack;\n\treadonly requestPermissions?: boolean;\n\treadonly onError?: (e: Error) => void;\n}\n\nexport interface UseMediaDeviceSelect {\n\treadonly devices: Ref<MediaDeviceInfo[]>;\n\treadonly activeDeviceId: Ref<string | undefined>;\n\treadonly setActiveMediaDevice: (\n\t\tdeviceId: string,\n\t\toptions?: SetMediaDeviceOptions,\n\t) => Promise<void>;\n}\n\nfunction getMediaDevices(): MediaDevices | undefined {\n\treturn typeof navigator === 'undefined' ? undefined : navigator.mediaDevices;\n}\n\nexport function useMediaDeviceSelect(props: UseMediaDeviceSelectProps): UseMediaDeviceSelect {\n\tconst { kind } = props;\n\tconst roomContext = useMaybeRoomContext();\n\n\tconst devices = shallowRef<MediaDeviceInfo[]>([]);\n\n\tconst room = computed<Room>(() => {\n\t\treturn props.room ?? roomContext?.value ?? new Room();\n\t});\n\n\tconst activeDeviceId = ref<string | undefined>(room.value.getActiveDevice(kind) ?? 'default');\n\n\tconst deviceSelector = computed<ReturnType<typeof setupDeviceSelector>>(() => {\n\t\treturn setupDeviceSelector(kind, room.value, props.track);\n\t});\n\n\tfunction onError(error: Error): void {\n\t\tprops.onError?.(error);\n\t}\n\n\tfunction refreshDevices(): void {\n\t\tconst mediaDevices = getMediaDevices();\n\n\t\tif (mediaDevices === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tmediaDevices.enumerateDevices().catch((error: unknown) => {\n\t\t\tonError(error instanceof Error ? error : new Error(String(error)));\n\t\t});\n\t}\n\n\tasync function setActiveMediaDevice(\n\t\tdeviceId: string,\n\t\toptions?: SetMediaDeviceOptions,\n\t): Promise<void> {\n\t\tawait deviceSelector.value.setActiveMediaDevice(deviceId, options);\n\t}\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = createMediaDeviceObserver(\n\t\t\tkind,\n\t\t\tonError,\n\t\t\tprops.requestPermissions,\n\t\t).subscribe({\n\t\t\tnext: (deviceList: MediaDeviceInfo[]) => {\n\t\t\t\tdevices.value = deviceList;\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in media device observer:', error);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = deviceSelector.value.activeDeviceObservable.subscribe({\n\t\t\tnext: (deviceId) => {\n\t\t\t\tif (deviceId !== '') {\n\t\t\t\t\tactiveDeviceId.value = deviceId;\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in media device observer:', error);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tuseEventListener(getMediaDevices(), 'devicechange', refreshDevices);\n\n\tconst result: UseMediaDeviceSelect = {\n\t\tdevices,\n\t\tactiveDeviceId,\n\t\tsetActiveMediaDevice,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<ul\n\t\tv-bind=\"styleAttrs\"\n\t\trole=\"listbox\"\n\t>\n\t\t<li\n\t\t\tv-for=\"(device, index) in devices\"\n\t\t\t:id=\"device.deviceId\"\n\t\t\t:key=\"device.deviceId\"\n\t\t\t:data-lk-active=\"isActive(device.deviceId, index)\"\n\t\t\t:aria-selected=\"isActive(device.deviceId, index)\"\n\t\t\trole=\"option\"\n\t\t>\n\t\t\t<slot\n\t\t\t\t:device=\"device\"\n\t\t\t\t:active=\"isActive(device.deviceId, index)\"\n\t\t\t\t:select=\"() => select(device.deviceId)\"\n\t\t\t>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"lk-button\"\n\t\t\t\t\t@click=\"select(device.deviceId)\"\n\t\t\t\t>\n\t\t\t\t\t{{ device.label }}\n\t\t\t\t</button>\n\t\t\t</slot>\n\t\t</li>\n\t</ul>\n</template>\n\n<script setup lang=\"ts\">\n\timport { RoomEvent, type LocalAudioTrack, type LocalVideoTrack } from 'livekit-client';\n\timport { computed, onMounted, watch } from 'vue';\n\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useMediaDeviceSelect } from '@/composables/useMediaDeviceSelect';\n\timport { useMaybeRoomContext } from '@/context/room.context';\n\n\texport interface MediaDeviceSelectProps extends LkStyleProps {\n\t\tkind: MediaDeviceKind;\n\t\tinitialSelection?: string;\n\t\texactMatch?: boolean;\n\t\ttrack?: LocalAudioTrack | LocalVideoTrack;\n\t\trequestPermissions?: boolean;\n\t}\n\n\tconst props = withDefaults(defineProps<MediaDeviceSelectProps>(), {\n\t\tinitialSelection: undefined,\n\t\texactMatch: true,\n\t\ttrack: undefined,\n\t\trequestPermissions: undefined,\n\t});\n\n\tconst emits = defineEmits<{\n\t\tdeviceListChange: [devices: MediaDeviceInfo[]];\n\t\tdeviceSelectError: [error: Error];\n\t\terror: [error: Error];\n\t}>();\n\n\tconst activeDeviceModel = defineModel<string | undefined>('activeDeviceId');\n\n\tdefineSlots<{\n\t\tdefault?: (props: { device: MediaDeviceInfo; active: boolean; select: () => void }) => unknown;\n\t}>();\n\n\tconst room = useMaybeRoomContext();\n\tconst { devices, activeDeviceId, setActiveMediaDevice } = useMediaDeviceSelect({\n\t\tkind: props.kind,\n\t\troom: room?.value,\n\t\tget track() {\n\t\t\treturn props.track;\n\t\t},\n\t\tget requestPermissions() {\n\t\t\treturn props.requestPermissions;\n\t\t},\n\t\tonError: handleError,\n\t});\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-list', 'lk-media-device-select']);\n\n\tconst hasDefault = computed<boolean>(() => {\n\t\treturn devices.value.some((info) => info.label.toLowerCase().startsWith('default'));\n\t});\n\n\tfunction handleError(error: Error): void {\n\t\troom?.value?.emit(RoomEvent.MediaDevicesError, error);\n\t\temits('error', error);\n\t}\n\n\tfunction select(deviceId: string): void {\n\t\tsetActiveMediaDevice(deviceId, { exact: props.exactMatch }).catch((error: unknown) => {\n\t\t\temits('deviceSelectError', error instanceof Error ? error : new Error(String(error)));\n\t\t});\n\t}\n\n\tfunction isActive(deviceId: string, index: number): boolean {\n\t\treturn (\n\t\t\tdeviceId === activeDeviceId.value ||\n\t\t\t(!hasDefault.value && index === 0 && activeDeviceId.value === 'default')\n\t\t);\n\t}\n\n\twatch(devices, (list) => emits('deviceListChange', list));\n\n\twatch(activeDeviceId, (deviceId) => {\n\t\tactiveDeviceModel.value = deviceId;\n\t});\n\n\twatch(activeDeviceModel, (deviceId) => {\n\t\tif (deviceId !== undefined && deviceId !== activeDeviceId.value) {\n\t\t\tselect(deviceId);\n\t\t}\n\t});\n\n\tonMounted(() => {\n\t\tconst initial = props.initialSelection ?? activeDeviceModel.value;\n\n\t\tif (initial !== undefined) {\n\t\t\tselect(initial);\n\t\t}\n\t});\n</script>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"none\"\n\t>\n\t\t<path\n\t\t\tfill=\"currentcolor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M5.293 2.293a1 1 0 0 1 1.414 0l4.823 4.823a1.25 1.25 0 0 1 0 1.768l-4.823 4.823a1 1 0 0 1-1.414-1.414L9.586 8 5.293 3.707a1 1 0 0 1 0-1.414\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t/>\n\t</svg>\n</template>\n","<template>\n\t<div\n\t\tv-bind=\"styleAttrs\"\n\t\t:data-lk-user-interaction=\"interactive\"\n\t>\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclass=\"lk-button\"\n\t\t\taria-label=\"Previous page\"\n\t\t\t@click=\"emits('prev')\"\n\t\t>\n\t\t\t<ChevronIcon />\n\t\t</button>\n\t\t<span class=\"lk-pagination-count\">{{ `${currentPage} of ${totalPageCount}` }}</span>\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclass=\"lk-button\"\n\t\t\taria-label=\"Next page\"\n\t\t\t@click=\"emits('next')\"\n\t\t>\n\t\t\t<ChevronIcon />\n\t\t</button>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport { createInteractingObservable } from '@livekit/components-core';\n\timport { shallowRef, toValue, watchEffect, type MaybeRefOrGetter } from 'vue';\n\n\timport ChevronIcon from '@/components/icons/ChevronIcon.vue';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\n\texport interface PaginationControlProps extends LkStyleProps {\n\t\ttotalPageCount: number;\n\t\tcurrentPage: number;\n\t\tpagesContainer?: MaybeRefOrGetter<HTMLElement | null | undefined>;\n\t}\n\n\tconst props = withDefaults(defineProps<PaginationControlProps>(), { pagesContainer: undefined });\n\n\tconst emits = defineEmits<{ next: []; prev: [] }>();\n\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-pagination-control']);\n\n\tconst interactive = shallowRef<boolean>(false);\n\n\twatchEffect((onCleanup) => {\n\t\tconst element = toValue(props.pagesContainer);\n\n\t\tif (element === null || element === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst subscription = createInteractingObservable(element, 2000).subscribe((value) => {\n\t\t\tinteractive.value = value;\n\t\t});\n\n\t\tonCleanup(() => subscription.unsubscribe());\n\t});\n</script>\n","<template>\n\t<div v-bind=\"styleAttrs\">\n\t\t<span\n\t\t\tv-for=\"page in totalPageCount\"\n\t\t\t:key=\"page\"\n\t\t\t:data-lk-active=\"page === currentPage ? true : undefined\"\n\t\t/>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\n\texport interface PaginationIndicatorProps extends LkStyleProps {\n\t\ttotalPageCount: number;\n\t\tcurrentPage: number;\n\t}\n\n\tconst props = defineProps<PaginationIndicatorProps>();\n\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-pagination-indicator']);\n</script>\n","import { computed, type ComputedRef } from 'vue';\n\nimport { useEnsureLayoutContext } from '@/context/layout.context';\n\nexport interface SettingsToggleAttributes {\n\treadonly 'aria-pressed': string;\n}\n\nexport interface UseSettingsToggle {\n\treadonly isVisible: ComputedRef<boolean>;\n\treadonly toggle: () => void;\n\treadonly attributes: ComputedRef<SettingsToggleAttributes>;\n}\n\nexport function useSettingsToggle(): UseSettingsToggle {\n\tconst layoutContext = useEnsureLayoutContext();\n\n\tconst isVisible = computed<boolean>(() => {\n\t\treturn layoutContext.value.widget.state.value.showSettings === true;\n\t});\n\n\tconst attributes = computed<SettingsToggleAttributes>(() => {\n\t\treturn {\n\t\t\t'aria-pressed': `${isVisible.value}`,\n\t\t};\n\t});\n\n\tfunction toggle(): void {\n\t\tlayoutContext.value.widget.dispatch({ msg: 'toggle_settings' });\n\t}\n\n\tconst result: UseSettingsToggle = {\n\t\tisVisible,\n\t\ttoggle,\n\t\tattributes,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<button\n\t\ttype=\"button\"\n\t\tv-bind=\"styleAttrs\"\n\t\t:aria-pressed=\"isVisible\"\n\t\t@click=\"toggle\"\n\t>\n\t\t<slot :is-visible=\"isVisible\" />\n\t</button>\n</template>\n\n<script setup lang=\"ts\">\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useSettingsToggle } from '@/composables/useSettingsToggle';\n\n\texport type SettingsMenuToggleProps = LkStyleProps;\n\n\tconst props = defineProps<SettingsMenuToggleProps>();\n\n\tdefineSlots<{ default?: (props: { isVisible: boolean }) => unknown }>();\n\n\tconst { isVisible, toggle } = useSettingsToggle();\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-button', 'lk-settings-toggle']);\n</script>\n","import { log, setupStartAudio } from '@livekit/components-core';\nimport type { Room } from 'livekit-client';\nimport { computed, ref, watchEffect, type Ref } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nexport interface UseStartAudioProps {\n\treadonly room?: Room;\n}\n\nexport interface UseStartAudio {\n\treadonly canPlayAudio: Ref<boolean>;\n\treadonly onClick: () => Promise<void>;\n}\n\nexport function useStartAudio(props: UseStartAudioProps = {}): UseStartAudio {\n\tconst roomEnsured = useEnsureRoomContext(props.room);\n\n\tconst canPlayAudio = ref<boolean>(roomEnsured.value.canPlaybackAudio);\n\n\tconst setupStartAudioResult = computed<ReturnType<typeof setupStartAudio>>(() => {\n\t\treturn setupStartAudio();\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = setupStartAudioResult.value\n\t\t\t.roomAudioPlaybackAllowedObservable(roomEnsured.value)\n\t\t\t.subscribe({\n\t\t\t\tnext: (evt) => {\n\t\t\t\t\tcanPlayAudio.value = evt.canPlayAudio;\n\t\t\t\t},\n\t\t\t\terror: (error: unknown) => {\n\t\t\t\t\tlog.error('Error in room audio playback allowed observer:', error);\n\t\t\t\t},\n\t\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tasync function onClick(): Promise<void> {\n\t\tawait setupStartAudioResult.value.handleStartAudioPlayback(roomEnsured.value);\n\t}\n\n\tconst result: UseStartAudio = {\n\t\tcanPlayAudio,\n\t\tonClick,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<button\n\t\tv-if=\"!canPlayAudio\"\n\t\ttype=\"button\"\n\t\tv-bind=\"styleAttrs\"\n\t\t@click=\"onClick\"\n\t>\n\t\t<slot>{{ label }}</slot>\n\t</button>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { Room } from 'livekit-client';\n\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useStartAudio } from '@/composables/useStartAudio';\n\n\texport interface StartAudioProps extends LkStyleProps {\n\t\tlabel?: string;\n\t\troom?: Room;\n\t}\n\n\tconst props = withDefaults(defineProps<StartAudioProps>(), {\n\t\tlabel: 'Allow Audio',\n\t\troom: undefined,\n\t});\n\n\tdefineSlots<{ default?: () => unknown }>();\n\n\tconst { canPlayAudio, onClick } = useStartAudio({ room: props.room });\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-button', 'lk-start-audio-button']);\n</script>\n","import { log, setupStartVideo } from '@livekit/components-core';\nimport type { Room } from 'livekit-client';\nimport { computed, ref, watchEffect, type Ref } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nexport interface UseStartVideoProps {\n\treadonly room?: Room;\n}\n\nexport interface UseStartVideo {\n\treadonly canPlayVideo: Ref<boolean>;\n\treadonly onClick: () => Promise<void>;\n}\n\nexport function useStartVideo(props: UseStartVideoProps = {}): UseStartVideo {\n\tconst roomEnsured = useEnsureRoomContext(props.room);\n\n\tconst canPlayVideo = ref<boolean>(roomEnsured.value.canPlaybackVideo);\n\n\tconst setupStartVideoResult = computed<ReturnType<typeof setupStartVideo>>(() => {\n\t\treturn setupStartVideo();\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = setupStartVideoResult.value\n\t\t\t.roomVideoPlaybackAllowedObservable(roomEnsured.value)\n\t\t\t.subscribe({\n\t\t\t\tnext: (evt) => {\n\t\t\t\t\tcanPlayVideo.value = evt.canPlayVideo;\n\t\t\t\t},\n\t\t\t\terror: (error: unknown) => {\n\t\t\t\t\tlog.error('Error in room video playback allowed observer:', error);\n\t\t\t\t},\n\t\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tasync function onClick(): Promise<void> {\n\t\tawait setupStartVideoResult.value.handleStartVideoPlayback(roomEnsured.value);\n\t}\n\n\tconst result: UseStartVideo = {\n\t\tcanPlayVideo,\n\t\tonClick,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<button\n\t\tv-if=\"!canPlayAudio || !canPlayVideo\"\n\t\ttype=\"button\"\n\t\tv-bind=\"styleAttrs\"\n\t\t@click=\"onClick\"\n\t>\n\t\t<slot\n\t\t\t:can-play-audio=\"canPlayAudio\"\n\t\t\t:can-play-video=\"canPlayVideo\"\n\t\t\t>{{ text }}</slot\n\t\t>\n\t</button>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { Room } from 'livekit-client';\n\timport { computed } from 'vue';\n\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useStartAudio } from '@/composables/useStartAudio';\n\timport { useStartVideo } from '@/composables/useStartVideo';\n\n\texport interface StartMediaButtonProps extends LkStyleProps {\n\t\tlabel?: string;\n\t\troom?: Room;\n\t}\n\n\tconst props = withDefaults(defineProps<StartMediaButtonProps>(), {\n\t\tlabel: undefined,\n\t\troom: undefined,\n\t});\n\n\tdefineSlots<{ default?: (props: { canPlayAudio: boolean; canPlayVideo: boolean }) => unknown }>();\n\n\tconst audio = useStartAudio({ room: props.room });\n\tconst video = useStartVideo({ room: props.room });\n\tconst canPlayAudio = audio.canPlayAudio;\n\tconst canPlayVideo = video.canPlayVideo;\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-button', 'lk-start-media-button']);\n\n\tconst text = computed<string>(() => {\n\t\treturn props.label ?? `Start ${canPlayAudio.value ? 'Video' : 'Audio'}`;\n\t});\n\n\tasync function onClick(): Promise<void> {\n\t\tawait audio.onClick();\n\t\tawait video.onClick();\n\t}\n</script>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"currentColor\"\n\t>\n\t\t<path\n\t\t\td=\"M1.354.646a.5.5 0 1 0-.708.708l14 14a.5.5 0 0 0 .708-.708L11 10.293V4.5A1.5 1.5 0 0 0 9.5 3H3.707zM0 4.5a1.5 1.5 0 0 1 .943-1.393l9.532 9.533c-.262.224-.603.36-.975.36h-8A1.5 1.5 0 0 1 0 11.5z\"\n\t\t/>\n\t\t<path\n\t\t\td=\"m15.2 3.6-2.8 2.1a1 1 0 0 0-.4.8v3a1 1 0 0 0 .4.8l2.8 2.1a.5.5 0 0 0 .8-.4V4a.5.5 0 0 0-.8-.4\"\n\t\t/>\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"currentColor\"\n\t>\n\t\t<path\n\t\t\td=\"M0 4.5A1.5 1.5 0 0 1 1.5 3h8A1.5 1.5 0 0 1 11 4.5v7A1.5 1.5 0 0 1 9.5 13h-8A1.5 1.5 0 0 1 0 11.5zM15.2 3.6l-2.8 2.1a1 1 0 0 0-.4.8v3a1 1 0 0 0 .4.8l2.8 2.1a.5.5 0 0 0 .8-.4V4a.5.5 0 0 0-.8-.4\"\n\t\t/>\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"currentColor\"\n\t>\n\t\t<path\n\t\t\td=\"M12.227 11.52a5.48 5.48 0 0 0 1.246-2.97.5.5 0 0 0-.995-.1 4.5 4.5 0 0 1-.962 2.359l-1.07-1.07C10.794 9.247 11 8.647 11 8V3a3 3 0 0 0-6 0v1.293L1.354.646a.5.5 0 1 0-.708.708l14 14a.5.5 0 0 0 .708-.708zM8 12.5c.683 0 1.33-.152 1.911-.425l.743.743c-.649.359-1.378.59-2.154.66V15h2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2v-1.522a5.5 5.5 0 0 1-4.973-4.929.5.5 0 0 1 .995-.098A4.5 4.5 0 0 0 8 12.5\"\n\t\t/>\n\t\t<path d=\"M8.743 10.907 5 7.164V8a3 3 0 0 0 3.743 2.907\" />\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"currentColor\"\n\t>\n\t\t<path\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M2.975 8.002a.5.5 0 0 1 .547.449 4.5 4.5 0 0 0 8.956 0 .5.5 0 1 1 .995.098A5.5 5.5 0 0 1 8.5 13.478V15h2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2v-1.522a5.5 5.5 0 0 1-4.973-4.929.5.5 0 0 1 .448-.547\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t/>\n\t\t<path d=\"M5 3a3 3 0 1 1 6 0v5a3 3 0 0 1-6 0z\" />\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"currentcolor\"\n\t>\n\t\t<path\n\t\t\td=\"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z\"\n\t\t/>\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"currentcolor\"\n\t>\n\t\t<path\n\t\t\td=\"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z\"\n\t\t/>\n\t\t<g opacity=\"0.25\">\n\t\t\t<path d=\"M12 .5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z\" />\n\t\t\t<path d=\"M12 .5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z\" />\n\t\t</g>\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"currentcolor\"\n\t>\n\t\t<path d=\"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z\" />\n\t\t<path d=\"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z\" />\n\t\t<g opacity=\"0.25\">\n\t\t\t<path d=\"M6 6.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z\" />\n\t\t\t<path\n\t\t\t\td=\"M6 6.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z\"\n\t\t\t/>\n\t\t\t<path d=\"M12 .5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z\" />\n\t\t</g>\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"currentColor\"\n\t>\n\t\t<g opacity=\"0.25\">\n\t\t\t<path\n\t\t\t\td=\"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z\"\n\t\t\t/>\n\t\t</g>\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 20 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"20\"\n\t\theight=\"16\"\n\t\tfill=\"none\"\n\t>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M0 2.75A2.75 2.75 0 0 1 2.75 0h14.5A2.75 2.75 0 0 1 20 2.75v10.5A2.75 2.75 0 0 1 17.25 16H2.75A2.75 2.75 0 0 1 0 13.25zM2.75 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h14.5c.69 0 1.25-.56 1.25-1.25V2.75c0-.69-.56-1.25-1.25-1.25z\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t/>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M9.47 4.22a.75.75 0 0 1 1.06 0l2.25 2.25a.75.75 0 0 1-1.06 1.06l-.97-.97v4.69a.75.75 0 0 1-1.5 0V6.56l-.97.97a.75.75 0 0 1-1.06-1.06z\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t/>\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 20 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"20\"\n\t\theight=\"16\"\n\t\tfill=\"none\"\n\t>\n\t\t<g fill=\"currentColor\">\n\t\t\t<path\n\t\t\t\td=\"M7.28 4.22a.75.75 0 0 0-1.06 1.06L8.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L10 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L11.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L10 6.94z\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfill-rule=\"evenodd\"\n\t\t\t\td=\"M2.75 0A2.75 2.75 0 0 0 0 2.75v10.5A2.75 2.75 0 0 0 2.75 16h14.5A2.75 2.75 0 0 0 20 13.25V2.75A2.75 2.75 0 0 0 17.25 0zM1.5 2.75c0-.69.56-1.25 1.25-1.25h14.5c.69 0 1.25.56 1.25 1.25v10.5c0 .69-.56 1.25-1.25 1.25H2.75c-.69 0-1.25-.56-1.25-1.25z\"\n\t\t\t\tclip-rule=\"evenodd\"\n\t\t\t/>\n\t\t</g>\n\t</svg>\n</template>\n","import { ConnectionQuality, Track } from 'livekit-client';\nimport type { Component } from 'vue';\n\nimport CameraDisabledIcon from './CameraDisabledIcon.vue';\nimport CameraIcon from './CameraIcon.vue';\nimport MicDisabledIcon from './MicDisabledIcon.vue';\nimport MicIcon from './MicIcon.vue';\nimport QualityExcellentIcon from './QualityExcellentIcon.vue';\nimport QualityGoodIcon from './QualityGoodIcon.vue';\nimport QualityPoorIcon from './QualityPoorIcon.vue';\nimport QualityUnknownIcon from './QualityUnknownIcon.vue';\nimport ScreenShareIcon from './ScreenShareIcon.vue';\nimport ScreenShareStopIcon from './ScreenShareStopIcon.vue';\n\ninterface SourceIcons {\n\treadonly enabled: Component;\n\treadonly disabled: Component;\n}\n\nconst SOURCE_ICONS: Partial<Record<Track.Source, SourceIcons>> = {\n\t[Track.Source.Microphone]: { enabled: MicIcon, disabled: MicDisabledIcon },\n\t[Track.Source.Camera]: { enabled: CameraIcon, disabled: CameraDisabledIcon },\n\t[Track.Source.ScreenShare]: { enabled: ScreenShareStopIcon, disabled: ScreenShareIcon },\n};\n\nconst CONNECTION_QUALITY_ICONS: Partial<Record<ConnectionQuality, Component>> = {\n\t[ConnectionQuality.Excellent]: QualityExcellentIcon,\n\t[ConnectionQuality.Good]: QualityGoodIcon,\n\t[ConnectionQuality.Poor]: QualityPoorIcon,\n};\n\nexport function getSourceIcon(source: Track.Source, enabled: boolean): Component | undefined {\n\tconst icons = SOURCE_ICONS[source];\n\n\tif (icons === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn enabled ? icons.enabled : icons.disabled;\n}\n\nexport function getConnectionQualityIcon(quality: ConnectionQuality): Component {\n\treturn CONNECTION_QUALITY_ICONS[quality] ?? QualityUnknownIcon;\n}\n","import {\n\tlog,\n\tsetupManualToggle,\n\tsetupMediaToggle,\n\ttype CaptureOptionsBySource,\n\ttype ToggleSource,\n} from '@livekit/components-core';\nimport type {\n\tAudioCaptureOptions,\n\tLocalTrackPublication,\n\tScreenShareCaptureOptions,\n\tTrackPublishOptions,\n\tVideoCaptureOptions,\n} from 'livekit-client';\nimport { computed, ref, watch, watchEffect, type ComputedRef, type Ref } from 'vue';\n\nimport { useMaybeRoomContext } from '@/context/room.context';\n\nexport interface UseTrackToggleProps {\n\treadonly source: ToggleSource;\n\treadonly initialState?: boolean;\n\treadonly captureOptions?: CaptureOptionsBySource<ToggleSource>;\n\treadonly publishOptions?: TrackPublishOptions;\n\treadonly onChange?: (enabled: boolean, isUserInitiated: boolean) => void;\n\treadonly onDeviceError?: (error: unknown) => void;\n\treadonly customOnClickHandler?: (evt: MouseEvent) => void;\n}\n\nexport interface ToggleButtonAttributes {\n\treadonly 'aria-pressed': boolean;\n\treadonly 'data-lk-source': ToggleSource;\n\treadonly 'data-lk-enabled': boolean;\n}\n\nexport type ToggleFunction = (\n\tforceState?: boolean,\n\tcaptureOptions?: VideoCaptureOptions | AudioCaptureOptions | ScreenShareCaptureOptions,\n) => Promise<boolean | undefined | void>;\n\nexport interface UseTrackToggle {\n\treadonly toggle?: ToggleFunction;\n\treadonly enabled: Ref<boolean>;\n\treadonly pending: Ref<boolean>;\n\treadonly track: ComputedRef<LocalTrackPublication | undefined>;\n\treadonly attributes: ComputedRef<ToggleButtonAttributes>;\n\treadonly disabled: ComputedRef<boolean>;\n\treadonly onClick: (evt: MouseEvent) => void;\n}\n\ntype MediaToggle = ReturnType<typeof setupMediaToggle | typeof setupManualToggle>;\n\nexport function useTrackToggle(props: UseTrackToggleProps): UseTrackToggle {\n\tconst room = useMaybeRoomContext();\n\n\tconst enabled = ref<boolean>(props.initialState ?? false);\n\tconst pending = ref<boolean>(false);\n\tconst userInteraction = ref<boolean>(false);\n\n\tconst track = computed<LocalTrackPublication | undefined>(() => {\n\t\treturn room?.value.localParticipant.getTrackPublication(props.source);\n\t});\n\n\tconst mediaToggle = computed<MediaToggle>(() => {\n\t\tif (room === undefined) {\n\t\t\treturn setupManualToggle();\n\t\t}\n\n\t\ttry {\n\t\t\treturn setupMediaToggle(\n\t\t\t\tprops.source,\n\t\t\t\troom.value,\n\t\t\t\tprops.captureOptions,\n\t\t\t\tprops.publishOptions,\n\t\t\t\tprops.onDeviceError,\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tlog.error('Failed to set up media toggle:', error);\n\n\t\t\treturn setupManualToggle();\n\t\t}\n\t});\n\n\tconst attributes = computed<ToggleButtonAttributes>(() => {\n\t\treturn {\n\t\t\t'aria-pressed': enabled.value,\n\t\t\t'data-lk-source': props.source,\n\t\t\t'data-lk-enabled': enabled.value,\n\t\t};\n\t});\n\n\tconst disabled = computed<boolean>(() => {\n\t\treturn pending.value;\n\t});\n\n\tfunction onClick(evt: MouseEvent): void {\n\t\tuserInteraction.value = true;\n\n\t\tmediaToggle.value.toggle().catch((error: unknown) => {\n\t\t\tlog.error('Failed to toggle track:', error);\n\t\t\tuserInteraction.value = false;\n\t\t});\n\n\t\tprops.customOnClickHandler?.(evt);\n\t}\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = mediaToggle.value.enabledObserver.subscribe({\n\t\t\tnext: (value) => {\n\t\t\t\tenabled.value = value;\n\n\t\t\t\tif (props.onChange !== undefined) {\n\t\t\t\t\tprops.onChange(value, userInteraction.value);\n\t\t\t\t\tuserInteraction.value = false;\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in enabled state observer:', error);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = mediaToggle.value.pendingObserver.subscribe({\n\t\t\tnext: (value) => {\n\t\t\t\tpending.value = value;\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in pending state observer:', error);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\twatch(\n\t\tmediaToggle,\n\t\t(current) => {\n\t\t\tif (props.initialState === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcurrent.toggle(props.initialState).catch((error: unknown) => {\n\t\t\t\tlog.error('Failed to set initial state:', error);\n\t\t\t\tuserInteraction.value = false;\n\t\t\t});\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\tconst result: UseTrackToggle = {\n\t\ttoggle: mediaToggle.value.toggle,\n\t\tenabled,\n\t\tpending,\n\t\ttrack,\n\t\tattributes,\n\t\tonClick,\n\t\tdisabled,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<button\n\t\ttype=\"button\"\n\t\tv-bind=\"{ ...styleAttrs, ...attributes }\"\n\t\t:disabled=\"disabled\"\n\t\t@click=\"onClick\"\n\t>\n\t\t<component\n\t\t\t:is=\"getSourceIcon(source, enabled)\"\n\t\t\tv-if=\"showIcon\"\n\t\t/>\n\t\t<slot\n\t\t\t:enabled=\"enabled\"\n\t\t\t:pending=\"pending\"\n\t\t/>\n\t</button>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { CaptureOptionsBySource, ToggleSource } from '@livekit/components-core';\n\timport type { TrackPublishOptions } from 'livekit-client';\n\timport { watch } from 'vue';\n\n\timport { getSourceIcon } from '@/components/icons/utils';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useTrackToggle } from '@/composables/useTrackToggle';\n\n\texport interface TrackToggleProps extends LkStyleProps {\n\t\tsource: ToggleSource;\n\t\tshowIcon?: boolean;\n\t\tinitialState?: boolean;\n\t\tcaptureOptions?: CaptureOptionsBySource<ToggleSource>;\n\t\tpublishOptions?: TrackPublishOptions;\n\t}\n\n\tconst props = withDefaults(defineProps<TrackToggleProps>(), {\n\t\tshowIcon: true,\n\t\tinitialState: undefined,\n\t\tcaptureOptions: undefined,\n\t\tpublishOptions: undefined,\n\t});\n\n\tconst enabledModel = defineModel<boolean | undefined>('enabled', { default: undefined });\n\n\tconst emits = defineEmits<{\n\t\tchange: [enabled: boolean, isUserInitiated: boolean];\n\t\tdeviceError: [error: unknown];\n\t}>();\n\n\tdefineSlots<{ default?: (props: { enabled: boolean; pending: boolean }) => unknown }>();\n\n\tconst { enabled, pending, attributes, disabled, onClick, toggle } = useTrackToggle({\n\t\tsource: props.source,\n\t\tinitialState: props.initialState ?? enabledModel.value,\n\t\tget captureOptions() {\n\t\t\treturn props.captureOptions;\n\t\t},\n\t\tget publishOptions() {\n\t\t\treturn props.publishOptions;\n\t\t},\n\t\tonChange: (value, isUserInitiated) => {\n\t\t\tenabledModel.value = value;\n\t\t\temits('change', value, isUserInitiated);\n\t\t},\n\t\tonDeviceError: (error) => emits('deviceError', error),\n\t});\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-button', 'lk-track-toggle']);\n\n\twatch(enabledModel, (value) => {\n\t\tif (value !== undefined && value !== enabled.value) {\n\t\t\ttoggle?.(value)?.catch((error: unknown) => emits('deviceError', error));\n\t\t}\n\t});\n</script>\n","import { log, observeParticipantMedia, type ParticipantMedia } from '@livekit/components-core';\nimport type { LocalParticipant, Room, TrackPublication } from 'livekit-client';\nimport { ref, shallowRef, watchEffect, type Ref, type ShallowRef } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nexport interface UseLocalParticipantProps {\n\treadonly room?: Room;\n}\n\nexport interface UseLocalParticipant {\n\treadonly isMicrophoneEnabled: Ref<boolean>;\n\treadonly isScreenShareEnabled: Ref<boolean>;\n\treadonly isCameraEnabled: Ref<boolean>;\n\treadonly microphoneTrack: ShallowRef<TrackPublication | undefined>;\n\treadonly cameraTrack: ShallowRef<TrackPublication | undefined>;\n\treadonly lastMicrophoneError: Ref<Error | undefined>;\n\treadonly lastCameraError: Ref<Error | undefined>;\n\treadonly localParticipant: ShallowRef<LocalParticipant | undefined>;\n}\n\nexport function useLocalParticipant(props: UseLocalParticipantProps = {}): UseLocalParticipant {\n\tconst room = useEnsureRoomContext(props.room);\n\tconst initialParticipant = room.value.localParticipant;\n\n\tconst localParticipant = shallowRef<LocalParticipant | undefined>(initialParticipant);\n\tconst isMicrophoneEnabled = ref<boolean>(initialParticipant.isMicrophoneEnabled);\n\tconst isCameraEnabled = ref<boolean>(initialParticipant.isCameraEnabled);\n\tconst isScreenShareEnabled = ref<boolean>(initialParticipant.isScreenShareEnabled);\n\tconst lastMicrophoneError = ref<Error | undefined>(initialParticipant.lastMicrophoneError);\n\tconst lastCameraError = ref<Error | undefined>(initialParticipant.lastCameraError);\n\tconst microphoneTrack = shallowRef<TrackPublication | undefined>(undefined);\n\tconst cameraTrack = shallowRef<TrackPublication | undefined>(undefined);\n\n\tfunction handleUpdate(media: ParticipantMedia<LocalParticipant>): void {\n\t\tisCameraEnabled.value = media.isCameraEnabled;\n\t\tisMicrophoneEnabled.value = media.isMicrophoneEnabled;\n\t\tisScreenShareEnabled.value = media.isScreenShareEnabled;\n\t\tcameraTrack.value = media.cameraTrack;\n\t\tmicrophoneTrack.value = media.microphoneTrack;\n\t\tlastMicrophoneError.value = media.participant.lastMicrophoneError;\n\t\tlastCameraError.value = media.participant.lastCameraError;\n\t\tlocalParticipant.value = media.participant;\n\t}\n\n\twatchEffect((onCleanup) => {\n\t\tconst mediaObservable = observeParticipantMedia(room.value.localParticipant);\n\n\t\tconst subscription = mediaObservable.subscribe({\n\t\t\tnext: handleUpdate,\n\t\t\terror: (err: unknown) => {\n\t\t\t\tlog.error('Error in participant media observable:', err);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst result: UseLocalParticipant = {\n\t\tisMicrophoneEnabled,\n\t\tisScreenShareEnabled,\n\t\tisCameraEnabled,\n\t\tmicrophoneTrack,\n\t\tcameraTrack,\n\t\tlastMicrophoneError,\n\t\tlastCameraError,\n\t\tlocalParticipant,\n\t};\n\n\treturn result;\n}\n","import {\n\tRoomEvent,\n\tTrack,\n\tVideoPresets,\n\tVideoQuality,\n\ttype RemoteTrack,\n\ttype RemoteTrackPublication,\n\ttype Room,\n\ttype VideoPreset,\n} from 'livekit-client';\nimport { onScopeDispose, ref, type Ref } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nexport const RECEIVE_QUALITY = {\n\tHIGH: 'high',\n\tMEDIUM: 'medium',\n\tLOW: 'low',\n} as const;\n\nexport type ReceiveQuality = (typeof RECEIVE_QUALITY)[keyof typeof RECEIVE_QUALITY];\n\nexport const SEND_RESOLUTION = {\n\tFULL_HD: '1080p',\n\tHD: '720p',\n\tSD: '360p',\n} as const;\n\nexport type SendResolution = (typeof SEND_RESOLUTION)[keyof typeof SEND_RESOLUTION];\n\nexport const VIDEO_QUALITY_KIND = {\n\tRECEIVE: 'receive',\n\tSEND: 'send',\n} as const;\n\nexport type VideoQualityKind = (typeof VIDEO_QUALITY_KIND)[keyof typeof VIDEO_QUALITY_KIND];\n\nexport interface UseVideoQualityProps {\n\treadonly room?: Room;\n}\n\nexport interface UseVideoQuality {\n\treadonly receiveQuality: Ref<ReceiveQuality>;\n\treadonly sendResolution: Ref<SendResolution | undefined>;\n\treadonly setReceiveQuality: (quality: ReceiveQuality) => void;\n\treadonly setSendResolution: (resolution: SendResolution) => Promise<void>;\n}\n\ninterface VideoQualityState {\n\treadonly receive: Ref<ReceiveQuality>;\n\treadonly send: Ref<SendResolution | undefined>;\n}\n\nconst RECEIVE_LAYERS: Record<ReceiveQuality, VideoQuality> = {\n\t[RECEIVE_QUALITY.HIGH]: VideoQuality.HIGH,\n\t[RECEIVE_QUALITY.MEDIUM]: VideoQuality.MEDIUM,\n\t[RECEIVE_QUALITY.LOW]: VideoQuality.LOW,\n};\n\nconst SEND_PRESETS: Record<SendResolution, VideoPreset> = {\n\t[SEND_RESOLUTION.FULL_HD]: VideoPresets.h1080,\n\t[SEND_RESOLUTION.HD]: VideoPresets.h720,\n\t[SEND_RESOLUTION.SD]: VideoPresets.h360,\n};\n\nconst states = new WeakMap<Room, VideoQualityState>();\n\nfunction sendResolutionOf(room: Room): SendResolution | undefined {\n\tconst height = room.options.videoCaptureDefaults?.resolution?.height;\n\n\treturn Object.values(SEND_RESOLUTION).find(\n\t\t(resolution) => SEND_PRESETS[resolution].resolution.height === height,\n\t);\n}\n\nfunction stateOf(room: Room): VideoQualityState {\n\tconst existing = states.get(room);\n\n\tif (existing !== undefined) {\n\t\treturn existing;\n\t}\n\n\tconst state: VideoQualityState = {\n\t\treceive: ref<ReceiveQuality>(RECEIVE_QUALITY.HIGH),\n\t\tsend: ref<SendResolution | undefined>(sendResolutionOf(room)),\n\t};\n\tstates.set(room, state);\n\n\treturn state;\n}\n\nexport function useVideoQuality(props: UseVideoQualityProps = {}): UseVideoQuality {\n\tconst room = useEnsureRoomContext(props.room).value;\n\tconst state = stateOf(room);\n\n\tfunction apply(publication: RemoteTrackPublication): void {\n\t\tif (publication.source === Track.Source.Camera && publication.isSubscribed) {\n\t\t\tpublication.setVideoQuality(RECEIVE_LAYERS[state.receive.value]);\n\t\t}\n\t}\n\n\tfunction onTrackSubscribed(_track: RemoteTrack, publication: RemoteTrackPublication): void {\n\t\tapply(publication);\n\t}\n\n\tfunction setReceiveQuality(quality: ReceiveQuality): void {\n\t\tstate.receive.value = quality;\n\n\t\tfor (const participant of room.remoteParticipants.values()) {\n\t\t\tfor (const publication of participant.videoTrackPublications.values()) {\n\t\t\t\tapply(publication);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync function setSendResolution(resolution: SendResolution): Promise<void> {\n\t\tconst size = SEND_PRESETS[resolution].resolution;\n\t\troom.options.videoCaptureDefaults = { ...room.options.videoCaptureDefaults, resolution: size };\n\t\tstate.send.value = resolution;\n\n\t\tconst track = room.localParticipant.getTrackPublication(Track.Source.Camera)?.videoTrack;\n\n\t\tif (track === undefined || track.isMuted) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst deviceId = await track.getDeviceId();\n\t\tawait track.restartTrack({ ...room.options.videoCaptureDefaults, deviceId, resolution: size });\n\t}\n\n\troom.on(RoomEvent.TrackSubscribed, onTrackSubscribed);\n\n\tonScopeDispose(() => {\n\t\troom.off(RoomEvent.TrackSubscribed, onTrackSubscribed);\n\t});\n\n\tconst videoQuality: UseVideoQuality = {\n\t\treceiveQuality: state.receive,\n\t\tsendResolution: state.send,\n\t\tsetReceiveQuality,\n\t\tsetSendResolution,\n\t};\n\n\treturn videoQuality;\n}\n","<template>\n\t<ul\n\t\tv-bind=\"styleAttrs\"\n\t\trole=\"listbox\"\n\t\t:aria-label=\"kind === VIDEO_QUALITY_KIND.SEND ? 'Send resolution' : 'Receive quality'\"\n\t>\n\t\t<li\n\t\t\tv-for=\"option in options\"\n\t\t\t:key=\"option.value\"\n\t\t\trole=\"option\"\n\t\t\t:aria-selected=\"option.value === activeValue\"\n\t\t\t:aria-disabled=\"disabled\"\n\t\t\t:data-lk-active=\"option.value === activeValue\"\n\t\t>\n\t\t\t<slot\n\t\t\t\t:value=\"option.value\"\n\t\t\t\t:label=\"option.label\"\n\t\t\t\t:active=\"option.value === activeValue\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:select=\"() => select(option.value)\"\n\t\t\t>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"lk-button\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t@click=\"select(option.value)\"\n\t\t\t\t>\n\t\t\t\t\t{{ option.label }}\n\t\t\t\t</button>\n\t\t\t</slot>\n\t\t</li>\n\t</ul>\n</template>\n\n<script setup lang=\"ts\">\n\timport { computed } from 'vue';\n\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useLocalParticipant } from '@/composables/useLocalParticipant';\n\timport {\n\t\tRECEIVE_QUALITY,\n\t\tSEND_RESOLUTION,\n\t\tuseVideoQuality,\n\t\tVIDEO_QUALITY_KIND,\n\t\ttype ReceiveQuality,\n\t\ttype SendResolution,\n\t\ttype VideoQualityKind,\n\t} from '@/composables/useVideoQuality';\n\n\texport interface VideoQualitySelectProps extends LkStyleProps {\n\t\tkind?: VideoQualityKind;\n\t}\n\n\texport interface VideoQualityOption {\n\t\treadonly value: ReceiveQuality | SendResolution;\n\t\treadonly label: string;\n\t}\n\n\tconst RECEIVE_OPTIONS: readonly VideoQualityOption[] = [\n\t\t{ value: RECEIVE_QUALITY.HIGH, label: 'High' },\n\t\t{ value: RECEIVE_QUALITY.MEDIUM, label: 'Medium' },\n\t\t{ value: RECEIVE_QUALITY.LOW, label: 'Low' },\n\t];\n\n\tconst SEND_OPTIONS: readonly VideoQualityOption[] = [\n\t\t{ value: SEND_RESOLUTION.FULL_HD, label: '1080p' },\n\t\t{ value: SEND_RESOLUTION.HD, label: '720p' },\n\t\t{ value: SEND_RESOLUTION.SD, label: '360p' },\n\t];\n\n\tconst props = withDefaults(defineProps<VideoQualitySelectProps>(), {\n\t\tkind: VIDEO_QUALITY_KIND.RECEIVE,\n\t});\n\n\tconst emits = defineEmits<{\n\t\terror: [error: Error];\n\t}>();\n\n\tdefineSlots<{\n\t\tdefault?: (props: {\n\t\t\tvalue: ReceiveQuality | SendResolution;\n\t\t\tlabel: string;\n\t\t\tactive: boolean;\n\t\t\tdisabled: boolean;\n\t\t\tselect: () => void;\n\t\t}) => unknown;\n\t}>();\n\n\tconst { receiveQuality, sendResolution, setReceiveQuality, setSendResolution } =\n\t\tuseVideoQuality();\n\tconst { isCameraEnabled } = useLocalParticipant();\n\tconst styleAttrs = useStyleAttrs(props, () => [\n\t\t'lk-list',\n\t\t'lk-media-device-select',\n\t\t'lk-video-quality-select',\n\t]);\n\n\tconst isSend = computed<boolean>(() => props.kind === VIDEO_QUALITY_KIND.SEND);\n\n\tconst options = computed<readonly VideoQualityOption[]>(() => {\n\t\treturn isSend.value ? SEND_OPTIONS : RECEIVE_OPTIONS;\n\t});\n\n\tconst activeValue = computed<ReceiveQuality | SendResolution | undefined>(() => {\n\t\treturn isSend.value ? sendResolution.value : receiveQuality.value;\n\t});\n\n\tconst disabled = computed<boolean>(() => isSend.value && !isCameraEnabled.value);\n\n\tfunction isReceiveQuality(value: ReceiveQuality | SendResolution): value is ReceiveQuality {\n\t\treturn Object.values(RECEIVE_QUALITY).some((quality) => quality === value);\n\t}\n\n\tfunction select(value: ReceiveQuality | SendResolution): void {\n\t\tif (isReceiveQuality(value)) {\n\t\t\tsetReceiveQuality(value);\n\n\t\t\treturn;\n\t\t}\n\n\t\tsetSendResolution(value).catch((error: unknown) => {\n\t\t\temits('error', error instanceof Error ? error : new Error(String(error)));\n\t\t});\n\t}\n</script>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tviewBox=\"0 0 24 24\"\n\t>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\td=\"M4.99 3.99a1 1 0 0 0-.697 1.717L10.586 12l-6.293 6.293a1 1 0 1 0 1.414 1.414L12 13.414l6.293 6.293a1 1 0 1 0 1.414-1.414L13.414 12l6.293-6.293a1 1 0 0 0-.727-1.717 1 1 0 0 0-.687.303L12 10.586 5.707 4.293a1 1 0 0 0-.717-.303\"\n\t\t/>\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 18\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"18\"\n\t\tfill=\"none\"\n\t>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M0 2.75A2.75 2.75 0 0 1 2.75 0h10.5A2.75 2.75 0 0 1 16 2.75v13.594a.75.75 0 0 1-1.234.572l-3.691-3.12a1.25 1.25 0 0 0-.807-.296H2.75A2.75 2.75 0 0 1 0 10.75zM2.75 1.5c-.69 0-1.25.56-1.25 1.25v8c0 .69.56 1.25 1.25 1.25h7.518c.65 0 1.279.23 1.775.65l2.457 2.077V2.75c0-.69-.56-1.25-1.25-1.25z\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t/>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M3 4.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0 2a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0 2a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t/>\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"none\"\n\t>\n\t\t<path\n\t\t\tfill=\"currentcolor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M8.961.894C8.875-.298 7.125-.298 7.04.894c-.066.912-1.246 1.228-1.76.472-.67-.99-2.186-.115-1.664.96.399.824-.465 1.688-1.288 1.289-1.076-.522-1.95.994-.961 1.665.756.513.44 1.693-.472 1.759-1.192.086-1.192 1.836 0 1.922.912.066 1.228 1.246.472 1.76-.99.67-.115 2.186.96 1.664.824-.399 1.688.465 1.289 1.288-.522 1.076.994 1.95 1.665.961.513-.756 1.693-.44 1.759.472.086 1.192 1.836 1.192 1.922 0 .066-.912 1.246-1.228 1.76-.472.67.99 2.186.115 1.664-.96-.399-.824.465-1.687 1.288-1.289 1.076.522 1.95-.994.961-1.665-.756-.513-.44-1.693.472-1.759 1.192-.086 1.192-1.836 0-1.922-.912-.066-1.228-1.246-.472-1.76.99-.67.115-2.186-.96-1.664-.824.399-1.687-.465-1.289-1.288.522-1.076-.994-1.95-1.665-.961-.513.756-1.693.44-1.759-.472M8 13A5 5 0 1 0 8 3a5 5 0 0 0 0 10\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t/>\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"none\"\n\t>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M2 2.75A2.75 2.75 0 0 1 4.75 0h6.5A2.75 2.75 0 0 1 14 2.75v10.5A2.75 2.75 0 0 1 11.25 16h-6.5A2.75 2.75 0 0 1 2 13.25v-.5a.75.75 0 0 1 1.5 0v.5c0 .69.56 1.25 1.25 1.25h6.5c.69 0 1.25-.56 1.25-1.25V2.75c0-.69-.56-1.25-1.25-1.25h-6.5c-.69 0-1.25.56-1.25 1.25v.5a.75.75 0 0 1-1.5 0z\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t/>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M8.78 7.47a.75.75 0 0 1 0 1.06l-2.25 2.25a.75.75 0 1 1-1.06-1.06l.97-.97H1.75a.75.75 0 0 1 0-1.5h4.69l-.97-.97a.75.75 0 0 1 1.06-1.06z\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t/>\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"none\"\n\t>\n\t\t<path\n\t\t\tfill=\"currentcolor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M4 6.104V4a4 4 0 1 1 8 0v2.104c1.154.326 2 1.387 2 2.646v4.5A2.75 2.75 0 0 1 11.25 16h-6.5A2.75 2.75 0 0 1 2 13.25v-4.5c0-1.259.846-2.32 2-2.646M5.5 4a2.5 2.5 0 0 1 5 0v2h-5z\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t/>\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-participant-placeholder-icon\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\twidth=\"320\"\n\t\theight=\"320\"\n\t\tviewBox=\"0 0 320 320\"\n\t\tpreserveAspectRatio=\"xMidYMid meet\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t>\n\t\t<path\n\t\t\td=\"M160 180C204.182 180 240 144.183 240 100C240 55.8172 204.182 20 160 20C115.817 20 79.9997 55.8172 79.9997 100C79.9997 144.183 115.817 180 160 180Z\"\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-opacity=\"0.2\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M97.6542 194.614C103.267 191.818 109.841 192.481 115.519 195.141C129.025 201.466 144.1 205 159.999 205C175.899 205 190.973 201.466 204.48 195.141C210.158 192.481 216.732 191.818 222.345 194.614C262.703 214.719 291.985 253.736 298.591 300.062C300.15 310.997 291.045 320 280 320H39.9997C28.954 320 19.8495 310.997 21.4087 300.062C28.014 253.736 57.2966 214.72 97.6542 194.614Z\"\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-opacity=\"0.2\"\n\t\t/>\n\t</svg>\n</template>\n","<template>\n\t<svg\n\t\tclass=\"lk-icon lk-spinner\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t\tviewBox=\"0 0 16 16\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"none\"\n\t>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M8 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0V.75A.75.75 0 0 1 8 0\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t/>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M8 12a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5A.75.75 0 0 1 8 12\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t\topacity=\"0.7\"\n\t\t/>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M12 1.072a.75.75 0 0 1 .274 1.024l-1.25 2.165a.75.75 0 0 1-1.299-.75l1.25-2.165A.75.75 0 0 1 12 1.072\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t/>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M6 11.464a.75.75 0 0 1 .274 1.025l-1.25 2.165a.75.75 0 0 1-1.299-.75l1.25-2.165A.75.75 0 0 1 6 11.464\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t\topacity=\"0.6\"\n\t\t/>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M14.928 4a.75.75 0 0 1-.274 1.025l-2.165 1.25a.75.75 0 1 1-.75-1.3l2.165-1.25A.75.75 0 0 1 14.928 4\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t/>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M4.536 10a.75.75 0 0 1-.275 1.024l-2.165 1.25a.75.75 0 0 1-.75-1.298l2.165-1.25A.75.75 0 0 1 4.536 10\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t\topacity=\"0.5\"\n\t\t/>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M16 8a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h2.5A.75.75 0 0 1 16 8\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t/>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M4 8a.75.75 0 0 1-.75.75H.75a.75.75 0 0 1 0-1.5h2.5A.75.75 0 0 1 4 8\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t\topacity=\"0.4\"\n\t\t/>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M14.928 12a.75.75 0 0 1-1.024.274l-2.165-1.25a.75.75 0 0 1 .75-1.299l2.165 1.25A.75.75 0 0 1 14.928 12\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t\topacity=\"0.9\"\n\t\t/>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M4.536 6a.75.75 0 0 1-1.025.275l-2.165-1.25a.75.75 0 1 1 .75-1.3l2.165 1.25A.75.75 0 0 1 4.536 6\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t\topacity=\"0.3\"\n\t\t/>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M12 14.928a.75.75 0 0 1-1.024-.274l-1.25-2.165a.75.75 0 0 1 1.298-.75l1.25 2.165A.75.75 0 0 1 12 14.928\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t\topacity=\"0.8\"\n\t\t/>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\tfill-rule=\"evenodd\"\n\t\t\td=\"M6 4.536a.75.75 0 0 1-1.024-.275l-1.25-2.165a.75.75 0 1 1 1.299-.75l1.25 2.165A.75.75 0 0 1 6 4.536\"\n\t\t\tclip-rule=\"evenodd\"\n\t\t\topacity=\"0.2\"\n\t\t/>\n\t</svg>\n</template>\n","import { encryptionStatusObservable, log } from '@livekit/components-core';\nimport { LocalParticipant, type Participant, type Room } from 'livekit-client';\nimport { computed, ref, watchEffect, type Ref } from 'vue';\n\nimport { useEnsureParticipant } from '@/context/participant.context';\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nexport interface UseIsEncryptedProps {\n\treadonly room?: Room;\n\treadonly participant?: Participant;\n}\n\nexport interface UseIsEncrypted {\n\treadonly isEncrypted: Ref<boolean>;\n}\n\nfunction initialEncryption(participant: Participant): boolean {\n\tif (participant instanceof LocalParticipant) {\n\t\treturn participant.isE2EEEnabled;\n\t}\n\n\treturn participant.isEncrypted;\n}\n\nexport function useIsEncrypted(props: UseIsEncryptedProps): UseIsEncrypted {\n\tconst room = useEnsureRoomContext(props.room);\n\tconst participant = useEnsureParticipant(props.participant);\n\n\tconst isEncrypted = ref<boolean>(initialEncryption(participant.value));\n\n\tconst observable = computed<ReturnType<typeof encryptionStatusObservable>>(() => {\n\t\treturn encryptionStatusObservable(room.value, participant.value);\n\t});\n\n\twatchEffect((onCleanup): void => {\n\t\tconst subscription = observable.value.subscribe({\n\t\t\tnext: (encrypted: boolean): void => {\n\t\t\t\tisEncrypted.value = encrypted;\n\t\t\t},\n\t\t\terror: (err: unknown): void => {\n\t\t\t\tlog.error('Encryption status observable error:', err);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup((): void => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst encryption: UseIsEncrypted = {\n\t\tisEncrypted,\n\t};\n\n\treturn encryption;\n}\n","import type { TrackReferenceOrPlaceholder } from '@livekit/components-core';\nimport { facingModeFromLocalTrack, LocalTrackPublication, Track } from 'livekit-client';\nimport { computed, type ComputedRef } from 'vue';\n\nexport type FacingMode = (typeof FACING_MODE)[keyof typeof FACING_MODE];\n\nexport interface UseFacingMode {\n\treadonly facingMode: ComputedRef<FacingMode>;\n}\n\nexport interface FacingModeProps {\n\treadonly trackReference: TrackReferenceOrPlaceholder;\n}\n\nexport const FACING_MODE = {\n\tUSER: 'user',\n\tENVIRONMENT: 'environment',\n\tLEFT: 'left',\n\tRIGHT: 'right',\n\tUNDEFINED: 'undefined',\n} as const;\n\nexport function useFacingMode(props: FacingModeProps): UseFacingMode {\n\tconst facingMode = computed<FacingMode>(() => {\n\t\tconst { trackReference } = props;\n\n\t\tif (\n\t\t\ttrackReference.source === Track.Source.Camera &&\n\t\t\ttrackReference.publication instanceof LocalTrackPublication\n\t\t) {\n\t\t\tconst localTrack = trackReference.publication.track;\n\n\t\t\tif (localTrack !== undefined) {\n\t\t\t\tconst { facingMode: trackFacingMode } = facingModeFromLocalTrack(localTrack);\n\n\t\t\t\treturn trackFacingMode;\n\t\t\t}\n\t\t}\n\n\t\treturn FACING_MODE.UNDEFINED;\n\t});\n\n\tconst facingModeResult: UseFacingMode = {\n\t\tfacingMode,\n\t};\n\n\treturn facingModeResult;\n}\n","import {\n\tlog,\n\tmutedObserver,\n\ttype TrackReference,\n\ttype TrackReferenceOrPlaceholder,\n\ttype TrackReferencePlaceholder,\n} from '@livekit/components-core';\nimport type { Participant, Track } from 'livekit-client';\nimport { computed, ref, watchEffect, type Ref } from 'vue';\n\nimport { useEnsureParticipant } from '@/context/participant.context';\n\nexport interface UseIsMutedProps {\n\treadonly participant?: Participant;\n\treadonly sourceOrTrackRef: TrackReferenceOrPlaceholder | Track.Source;\n}\n\nexport interface UseIsMuted {\n\treadonly isMuted: Ref<boolean>;\n}\n\nexport function useIsMuted(props: UseIsMutedProps): UseIsMuted {\n\tconst passedParticipant =\n\t\ttypeof props.sourceOrTrackRef === 'string'\n\t\t\t? props.participant\n\t\t\t: props.sourceOrTrackRef.participant;\n\n\tconst p = useEnsureParticipant(passedParticipant);\n\n\tconst trackReference = computed<TrackReference | TrackReferencePlaceholder>(() => {\n\t\treturn typeof props.sourceOrTrackRef === 'string'\n\t\t\t? { participant: p.value, source: props.sourceOrTrackRef }\n\t\t\t: props.sourceOrTrackRef;\n\t});\n\n\tconst isMuted = ref<boolean>(\n\t\ttrackReference.value.publication?.isMuted === true ||\n\t\t\tp.value.getTrackPublication(trackReference.value.source)?.isMuted === true,\n\t);\n\n\tconst observable = computed<ReturnType<typeof mutedObserver>>(() => {\n\t\treturn mutedObserver(trackReference.value);\n\t});\n\n\twatchEffect((onCleanup): void => {\n\t\tconst subscription = observable.value.subscribe({\n\t\t\tnext: (muted: boolean): void => {\n\t\t\t\tisMuted.value = muted;\n\t\t\t},\n\t\t\terror: (err: unknown): void => {\n\t\t\t\tlog.error('Muted state observer error:', err);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup((): void => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst muted: UseIsMuted = {\n\t\tisMuted,\n\t};\n\n\treturn muted;\n}\n","import { createIsSpeakingObserver, log } from '@livekit/components-core';\nimport type { Participant } from 'livekit-client';\nimport { computed, ref, watchEffect, type Ref } from 'vue';\n\nimport { useEnsureParticipant } from '@/context/participant.context';\n\nexport interface UseIsSpeaking {\n\treadonly isSpeaking: Ref<boolean>;\n}\n\nexport interface UseIsSpeakingProps {\n\treadonly participant: Participant;\n}\n\nexport function useIsSpeaking(props: UseIsSpeakingProps): UseIsSpeaking {\n\tconst p = useEnsureParticipant(props.participant);\n\n\tconst isSpeaking = ref<boolean>(p.value.isSpeaking);\n\n\tconst observable = computed<ReturnType<typeof createIsSpeakingObserver>>(() => {\n\t\treturn createIsSpeakingObserver(p.value);\n\t});\n\n\twatchEffect((onCleanup): void => {\n\t\tconst subscription = observable.value.subscribe({\n\t\t\tnext: (speaking: boolean): void => {\n\t\t\t\tisSpeaking.value = speaking;\n\t\t\t},\n\t\t\terror: (err: unknown): void => {\n\t\t\t\tlog.error('Speaking state observer error:', err);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup((): void => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst speaking: UseIsSpeaking = {\n\t\tisSpeaking,\n\t};\n\n\treturn speaking;\n}\n","import type { ParticipantClickEvent, TrackReferenceOrPlaceholder } from '@livekit/components-core';\nimport { Track } from 'livekit-client';\nimport { computed, type ComputedRef } from 'vue';\n\nimport { useEnsureTrackRef } from '@/context/track-reference.context';\n\nimport { useFacingMode, type FacingMode } from './useFacingMode';\nimport { useIsMuted } from './useIsMuted';\nimport { useIsSpeaking } from './useIsSpeaking';\n\nexport interface ParticipantTileAttributes {\n\treadonly 'data-lk-audio-muted': boolean;\n\treadonly 'data-lk-video-muted': boolean;\n\treadonly 'data-lk-speaking': boolean;\n\treadonly 'data-lk-local-participant': boolean;\n\treadonly 'data-lk-source': Track.Source;\n\treadonly 'data-lk-facing-mode': FacingMode;\n}\n\nexport interface UseParticipantTileProps {\n\treadonly trackRef?: TrackReferenceOrPlaceholder;\n\treadonly disableSpeakingIndicator?: boolean;\n\treadonly onParticipantClick?: (event: ParticipantClickEvent) => void;\n}\n\nexport interface UseParticipantTile {\n\treadonly attributes: ComputedRef<ParticipantTileAttributes>;\n\treadonly onClick: () => void;\n}\n\nexport function useParticipantTile(props: UseParticipantTileProps): UseParticipantTile {\n\tconst trackReference = useEnsureTrackRef(props.trackRef);\n\n\tconst micRef = computed<TrackReferenceOrPlaceholder>(() => {\n\t\treturn {\n\t\t\tparticipant: trackReference.value.participant,\n\t\t\tsource: Track.Source.Microphone,\n\t\t\tpublication: trackReference.value.participant.getTrackPublication(Track.Source.Microphone),\n\t\t};\n\t});\n\n\tconst { isMuted: isVideoMuted } = useIsMuted({\n\t\tsourceOrTrackRef: trackReference.value,\n\t\tparticipant: trackReference.value.participant,\n\t});\n\tconst { isMuted: isAudioMuted } = useIsMuted({\n\t\tsourceOrTrackRef: micRef.value,\n\t\tparticipant: trackReference.value.participant,\n\t});\n\tconst { isSpeaking } = useIsSpeaking({ participant: trackReference.value.participant });\n\tconst { facingMode } = useFacingMode({ trackReference: trackReference.value });\n\n\tconst attributes = computed<ParticipantTileAttributes>(() => {\n\t\treturn {\n\t\t\t'data-lk-audio-muted': isAudioMuted.value,\n\t\t\t'data-lk-video-muted': isVideoMuted.value,\n\t\t\t'data-lk-speaking': props.disableSpeakingIndicator === true ? false : isSpeaking.value,\n\t\t\t'data-lk-local-participant': trackReference.value.participant.isLocal,\n\t\t\t'data-lk-source': trackReference.value.source,\n\t\t\t'data-lk-facing-mode': facingMode.value,\n\t\t};\n\t});\n\n\tfunction onClick(): void {\n\t\tif (props.onParticipantClick === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst track =\n\t\t\ttrackReference.value.publication ??\n\t\t\ttrackReference.value.participant.getTrackPublication(trackReference.value.source);\n\n\t\tprops.onParticipantClick({\n\t\t\tparticipant: trackReference.value.participant,\n\t\t\ttrack,\n\t\t});\n\t}\n\n\tconst result: UseParticipantTile = {\n\t\tattributes,\n\t\tonClick,\n\t};\n\n\treturn result;\n}\n","import {\n\tgetTrackByIdentifier,\n\tisTrackReference,\n\tlog,\n\tsetupMediaTrack,\n\ttype TrackIdentifier,\n} from '@livekit/components-core';\nimport { Track, type TrackPublication } from 'livekit-client';\nimport {\n\tcomputed,\n\tref,\n\tshallowRef,\n\tunref,\n\twatch,\n\twatchEffect,\n\ttype HTMLAttributes,\n\ttype MaybeRef,\n\ttype Ref,\n\ttype ShallowRef,\n} from 'vue';\n\nexport interface UseMediaTrackOptions {\n\treadonly element?: MaybeRef<HTMLMediaElement | null | undefined>;\n\treadonly props?: HTMLAttributes;\n}\n\nexport const TRACK_ORIENTATION = {\n\tLANDSCAPE: 'landscape',\n\tPORTRAIT: 'portrait',\n\tUNKNOWN: 'unknown',\n} as const;\n\nexport type TrackOrientation = (typeof TRACK_ORIENTATION)[keyof typeof TRACK_ORIENTATION];\n\nexport interface MediaTrackAttributes {\n\treadonly 'data-lk-local-participant': boolean;\n\treadonly 'data-lk-source': Track.Source;\n\treadonly 'data-lk-orientation': TrackOrientation;\n}\n\nexport interface UseMediaTrackBySourceOrName {\n\treadonly publication: ShallowRef<TrackPublication | undefined>;\n\treadonly isMuted: Ref<boolean>;\n\treadonly isSubscribed: Ref<boolean>;\n\treadonly track: ShallowRef<Track | undefined>;\n\treadonly attributes: Ref<MediaTrackAttributes>;\n}\n\nexport interface UseMediaTrackBySourceOrNameProps {\n\treadonly observerOptions: TrackIdentifier;\n\treadonly options: UseMediaTrackOptions;\n}\n\nfunction detachTrack(track: Track, element: HTMLMediaElement): void {\n\ttry {\n\t\ttrack.detach(element);\n\t} catch (error) {\n\t\tlog.error('Error detaching track from element:', error);\n\t}\n}\n\nexport function useMediaTrackBySourceOrName(\n\tprops: UseMediaTrackBySourceOrNameProps,\n): UseMediaTrackBySourceOrName {\n\tconst publication = shallowRef<TrackPublication | undefined>(\n\t\tgetTrackByIdentifier(props.observerOptions),\n\t);\n\tconst isMuted = ref<boolean>(publication.value?.isMuted ?? false);\n\tconst isSubscribed = ref<boolean>(publication.value?.isSubscribed ?? false);\n\tconst track = shallowRef<Track | undefined>(publication.value?.track);\n\tconst orientation = ref<TrackOrientation>(TRACK_ORIENTATION.LANDSCAPE);\n\tconst previousElement = ref<HTMLMediaElement | null>(null);\n\n\tconst deps = computed<(string | undefined)[]>(() => {\n\t\tconst { participant, source } = props.observerOptions;\n\t\tconst trackSid = isTrackReference(props.observerOptions)\n\t\t\t? props.observerOptions.publication.trackSid\n\t\t\t: undefined;\n\n\t\treturn [participant.sid, participant.identity, source, trackSid];\n\t});\n\n\tconst mediaTrack = computed<ReturnType<typeof setupMediaTrack>>(() => {\n\t\treturn setupMediaTrack(props.observerOptions);\n\t});\n\n\tconst attributes = computed<MediaTrackAttributes>(() => {\n\t\treturn {\n\t\t\t'data-lk-local-participant': props.observerOptions.participant.isLocal,\n\t\t\t'data-lk-source': publication.value?.source ?? Track.Source.Unknown,\n\t\t\t'data-lk-orientation':\n\t\t\t\tpublication.value?.kind === Track.Kind.Video\n\t\t\t\t\t? orientation.value\n\t\t\t\t\t: TRACK_ORIENTATION.UNKNOWN,\n\t\t};\n\t});\n\n\twatch(\n\t\t[deps, mediaTrack],\n\t\t([, currentMediaTrack], _previous, onCleanup) => {\n\t\t\tconst subscription = currentMediaTrack.trackObserver.subscribe((pub) => {\n\t\t\t\tpublication.value = pub;\n\t\t\t\tisMuted.value = pub?.isMuted ?? false;\n\t\t\t\tisSubscribed.value = pub?.isSubscribed ?? false;\n\t\t\t\ttrack.value = pub?.track;\n\t\t\t});\n\n\t\t\tonCleanup(() => {\n\t\t\t\tsubscription.unsubscribe();\n\t\t\t});\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\twatchEffect((onCleanup) => {\n\t\tconst currentTrack = track.value;\n\t\tconst element = unref(props.options.element) ?? null;\n\n\t\tif (currentTrack !== undefined) {\n\t\t\tif (previousElement.value !== null) {\n\t\t\t\tdetachTrack(currentTrack, previousElement.value);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\telement !== null &&\n\t\t\t\t!(props.observerOptions.participant.isLocal && currentTrack.kind === Track.Kind.Audio)\n\t\t\t) {\n\t\t\t\tcurrentTrack.attach(element);\n\t\t\t}\n\t\t}\n\n\t\tpreviousElement.value = element;\n\n\t\tonCleanup(() => {\n\t\t\tif (previousElement.value !== null && currentTrack !== undefined) {\n\t\t\t\tdetachTrack(currentTrack, previousElement.value);\n\t\t\t}\n\t\t});\n\t});\n\n\twatchEffect(() => {\n\t\tconst dimensions = publication.value?.dimensions;\n\n\t\tif (dimensions === undefined || dimensions.width === 0 || dimensions.height === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\torientation.value =\n\t\t\tdimensions.width > dimensions.height\n\t\t\t\t? TRACK_ORIENTATION.LANDSCAPE\n\t\t\t\t: TRACK_ORIENTATION.PORTRAIT;\n\t});\n\n\tconst result: UseMediaTrackBySourceOrName = {\n\t\tpublication,\n\t\tisMuted,\n\t\tisSubscribed,\n\t\ttrack,\n\t\tattributes,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<audio\n\t\tref=\"element\"\n\t\tv-bind=\"attributes\"\n\t/>\n</template>\n\n<script setup lang=\"ts\">\n\timport {\n\t\tlog,\n\t\ttype TrackReference,\n\t\ttype TrackReferenceOrPlaceholder,\n\t} from '@livekit/components-core';\n\timport { RemoteAudioTrack, RemoteTrackPublication } from 'livekit-client';\n\timport { computed, useTemplateRef, watch } from 'vue';\n\n\timport { useMediaTrackBySourceOrName } from '@/composables/useMediaTrackBySourceOrName';\n\timport { useMaybeTrackRefContext } from '@/context/track-reference.context';\n\n\texport interface AudioTrackProps {\n\t\ttrackRef?: TrackReference;\n\t\tvolume?: number;\n\t\tmuted?: boolean;\n\t}\n\n\tconst props = withDefaults(defineProps<AudioTrackProps>(), {\n\t\ttrackRef: undefined,\n\t\tvolume: undefined,\n\t\tmuted: undefined,\n\t});\n\n\tconst emits = defineEmits<{\n\t\tsubscriptionStatusChanged: [subscribed: boolean];\n\t}>();\n\n\tconst contextTrackRef = useMaybeTrackRefContext();\n\tconst element = useTemplateRef<HTMLAudioElement>('element');\n\n\tconst trackReference = computed<TrackReferenceOrPlaceholder>(() => {\n\t\tconst trackRef = props.trackRef ?? contextTrackRef?.value;\n\n\t\tif (trackRef === undefined) {\n\t\t\tthrow new Error('AudioTrack needs a trackRef prop or a track reference context.');\n\t\t}\n\n\t\treturn trackRef;\n\t});\n\n\tconst { isSubscribed, track, publication, attributes } = useMediaTrackBySourceOrName({\n\t\tget observerOptions() {\n\t\t\treturn trackReference.value;\n\t\t},\n\t\toptions: { element },\n\t});\n\n\twatch(isSubscribed, (subscribed) => emits('subscriptionStatusChanged', subscribed), {\n\t\timmediate: true,\n\t});\n\n\twatch(\n\t\t[track, () => props.volume],\n\t\t([currentTrack, volume]) => {\n\t\t\tif (currentTrack === undefined || volume === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (currentTrack instanceof RemoteAudioTrack) {\n\t\t\t\tcurrentTrack.setVolume(volume);\n\t\t\t} else {\n\t\t\t\tlog.warn('AudioTrack: the volume can only be set on a remote audio track.');\n\t\t\t}\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\twatch(\n\t\t[publication, () => props.muted],\n\t\t([pub, muted]) => {\n\t\t\tif (pub === undefined || muted === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (pub instanceof RemoteTrackPublication) {\n\t\t\t\tpub.setEnabled(!muted);\n\t\t\t} else {\n\t\t\t\tlog.warn('AudioTrack: only a remote track can be muted.');\n\t\t\t}\n\t\t},\n\t\t{ immediate: true },\n\t);\n</script>\n","import { log, setupConnectionQualityIndicator } from '@livekit/components-core';\nimport { ConnectionQuality, type Participant } from 'livekit-client';\nimport { computed, ref, watchEffect, type Ref } from 'vue';\n\nimport { useEnsureParticipant } from '@/context/participant.context';\n\nexport interface ConnectionQualityIndicatorProps {\n\treadonly participant?: Participant;\n}\n\nexport interface UseConnectionQualityIndicator {\n\treadonly quality: Ref<ConnectionQuality>;\n}\n\nexport function useConnectionQualityIndicator(\n\tprops: ConnectionQualityIndicatorProps = {},\n): UseConnectionQualityIndicator {\n\tconst participant = useEnsureParticipant(props.participant);\n\n\tconst quality = ref<ConnectionQuality>(ConnectionQuality.Unknown);\n\n\tconst setup = computed<ReturnType<typeof setupConnectionQualityIndicator>>(() => {\n\t\treturn setupConnectionQualityIndicator(participant.value);\n\t});\n\n\twatchEffect((onCleanup): void => {\n\t\tconst subscription = setup.value.connectionQualityObserver.subscribe({\n\t\t\tnext: (q: ConnectionQuality): void => {\n\t\t\t\tquality.value = q;\n\t\t\t},\n\t\t\terror: (err: unknown): void => {\n\t\t\t\tlog.error('Connection quality observer error:', err);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup((): void => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst connectionQualityIndicator: UseConnectionQualityIndicator = {\n\t\tquality,\n\t};\n\n\treturn connectionQualityIndicator;\n}\n","<template>\n\t<div\n\t\tv-bind=\"styleAttrs\"\n\t\t:data-lk-quality=\"quality\"\n\t\t:title=\"`Connection quality: ${quality}`\"\n\t>\n\t\t<slot :quality=\"quality\">\n\t\t\t<component :is=\"getConnectionQualityIcon(quality)\" />\n\t\t</slot>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { ConnectionQuality, Participant } from 'livekit-client';\n\n\timport { getConnectionQualityIcon } from '@/components/icons/utils';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useConnectionQualityIndicator } from '@/composables/useConnectionQualityIndicator';\n\n\texport interface ConnectionQualityIndicatorComponentProps extends LkStyleProps {\n\t\tparticipant?: Participant;\n\t}\n\n\tconst props = defineProps<ConnectionQualityIndicatorComponentProps>();\n\n\tdefineSlots<{ default?: (props: { quality: ConnectionQuality }) => unknown }>();\n\n\tconst { quality } = useConnectionQualityIndicator({ participant: props.participant });\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-connection-quality']);\n</script>\n","import { log, participantAttributesObserver } from '@livekit/components-core';\nimport type { Participant } from 'livekit-client';\nimport { ref, shallowRef, watchEffect, type Ref } from 'vue';\n\nimport { useEnsureParticipant, useMaybeParticipantContext } from '@/context';\n\nexport interface UseParticipantAttributesProps {\n\treadonly participant?: Participant;\n\treadonly attributeKey?: string;\n}\n\nexport interface UseParticipantAttribute {\n\treadonly attribute: Ref<string | undefined>;\n}\n\nexport interface UseParticipantAttributes {\n\treadonly attributes: Ref<Readonly<Record<string, string>> | undefined>;\n}\n\nexport function useParticipantAttribute(\n\tprops: UseParticipantAttributesProps = {},\n): UseParticipantAttribute {\n\tconst participant = useEnsureParticipant(props.participant);\n\tconst attribute = ref<string | undefined>(\n\t\tprops.attributeKey === undefined || props.attributeKey === ''\n\t\t\t? undefined\n\t\t\t: participant.value.attributes[props.attributeKey],\n\t);\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = participantAttributesObserver(participant.value).subscribe({\n\t\t\tnext: (attr) => {\n\t\t\t\tconst key = props.attributeKey;\n\n\t\t\t\tif (key !== undefined && key !== '' && attr.changed[key] !== undefined) {\n\t\t\t\t\tattribute.value = attr.attributes[key];\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in attribute observer:', error);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst result: UseParticipantAttribute = {\n\t\tattribute,\n\t};\n\n\treturn result;\n}\n\nexport function useParticipantAttributes(\n\tprops: UseParticipantAttributesProps = {},\n): UseParticipantAttributes {\n\tconst participantContext = useMaybeParticipantContext();\n\tconst participant =\n\t\tprops.participant === undefined ? participantContext : shallowRef(props.participant);\n\tconst attributes = ref<Readonly<Record<string, string>> | undefined>(\n\t\tparticipant?.value.attributes,\n\t);\n\n\twatchEffect((onCleanup) => {\n\t\tif (participant === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst subscription = participantAttributesObserver(participant.value).subscribe({\n\t\t\tnext: (attr) => {\n\t\t\t\tattributes.value = attr.attributes;\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in attributes observer:', error);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst result: UseParticipantAttributes = {\n\t\tattributes,\n\t};\n\n\treturn result;\n}\n","import { log, participantInfoObserver } from '@livekit/components-core';\nimport type { Participant } from 'livekit-client';\nimport { ref, shallowRef, watchEffect, type Ref } from 'vue';\n\nimport { useMaybeParticipantContext } from '@/context';\n\nexport interface UseParticipantInfoProps {\n\treadonly participant?: Participant;\n}\n\nexport interface ParticipantInfo {\n\treadonly name: string | undefined;\n\treadonly identity: string;\n\treadonly metadata: string | undefined;\n}\n\nexport interface UseParticipantInfo {\n\treadonly info: Ref<ParticipantInfo | undefined>;\n}\n\nfunction getParticipantInfo(participant: Participant | undefined): ParticipantInfo | undefined {\n\tif (participant === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst info: ParticipantInfo = {\n\t\tname: participant.name,\n\t\tidentity: participant.identity,\n\t\tmetadata: participant.metadata,\n\t};\n\n\treturn info;\n}\n\nexport function useParticipantInfo(props: UseParticipantInfoProps = {}): UseParticipantInfo {\n\tconst contextParticipant = useMaybeParticipantContext();\n\tconst participant =\n\t\tprops.participant === undefined ? contextParticipant : shallowRef(props.participant);\n\n\tconst info = ref<ParticipantInfo | undefined>(getParticipantInfo(participant?.value));\n\n\twatchEffect((onCleanup) => {\n\t\tif (participant === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst observer = participantInfoObserver(participant.value);\n\n\t\tif (observer === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst subscription = observer.subscribe({\n\t\t\tnext: (newInfo) => {\n\t\t\t\tinfo.value = newInfo;\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in participant info observer:', error);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst result: UseParticipantInfo = {\n\t\tinfo,\n\t};\n\n\treturn result;\n}\n","import type { Participant } from 'livekit-client';\nimport { computed, type ComputedRef } from 'vue';\n\nimport { useParticipantAttributes } from './useParticipantAttributes';\nimport { useParticipantInfo } from './useParticipantInfo';\n\nexport interface UseParticipantAvatarProps {\n\treadonly participant?: Participant;\n\treadonly src?: string;\n\treadonly name?: string;\n}\n\nexport interface UseParticipantAvatar {\n\treadonly src: ComputedRef<string | undefined>;\n\treadonly initials: ComputedRef<string>;\n\treadonly hue: ComputedRef<number>;\n}\n\nexport const PARTICIPANT_AVATAR_KEYS = ['avatar', 'avatarUrl', 'avatar_url', 'picture'] as const;\n\nconst IMAGE_URL = /^(?:https?:\\/\\/|\\/|data:image\\/|blob:)/iu;\n\nconst WORD_SEPARATOR = /[\\s._-]+/u;\n\nconst HUE_STEPS = 360;\n\nconst FNV_OFFSET = 0x81_1c_9d_c5;\n\nconst FNV_PRIME = 0x01_00_01_93;\n\nfunction imageUrl(value: unknown): string | undefined {\n\tif (typeof value !== 'string') {\n\t\treturn undefined;\n\t}\n\n\tconst url = value.trim();\n\n\treturn IMAGE_URL.test(url) ? url : undefined;\n}\n\nfunction isRecord(value: unknown): value is Readonly<Record<string, unknown>> {\n\treturn typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction avatarFromRecord(record: Readonly<Record<string, unknown>>): string | undefined {\n\tfor (const key of PARTICIPANT_AVATAR_KEYS) {\n\t\tconst url = imageUrl(record[key]);\n\n\t\tif (url !== undefined) {\n\t\t\treturn url;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport function avatarFromMetadata(metadata: string | undefined): string | undefined {\n\tif (metadata === undefined || metadata === '') {\n\t\treturn undefined;\n\t}\n\n\ttry {\n\t\tconst parsed: unknown = JSON.parse(metadata);\n\n\t\treturn isRecord(parsed) ? avatarFromRecord(parsed) : undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nfunction firstLetter(word: string | undefined): string {\n\treturn word === undefined ? '' : (Array.from(word).at(0) ?? '');\n}\n\nexport function getInitials(name: string): string {\n\tconst local = name.trim().split('@').at(0) ?? '';\n\tconst words = local.split(WORD_SEPARATOR).filter((word) => word !== '');\n\tconst last = words.length > 1 ? words.at(-1) : undefined;\n\n\treturn `${firstLetter(words.at(0))}${firstLetter(last)}`.toLocaleUpperCase();\n}\n\nexport function avatarHue(identity: string): number {\n\tlet hash = FNV_OFFSET;\n\n\tfor (const char of identity) {\n\t\thash = Math.imul(hash ^ (char.codePointAt(0) ?? 0), FNV_PRIME);\n\t}\n\n\treturn (hash >>> 0) % HUE_STEPS;\n}\n\nexport function useParticipantAvatar(props: UseParticipantAvatarProps = {}): UseParticipantAvatar {\n\tconst { info } = useParticipantInfo({ participant: props.participant });\n\tconst { attributes } = useParticipantAttributes({ participant: props.participant });\n\n\tconst src = computed<string | undefined>(() => {\n\t\treturn (\n\t\t\timageUrl(props.src) ??\n\t\t\tavatarFromRecord(attributes.value ?? {}) ??\n\t\t\tavatarFromMetadata(info.value?.metadata)\n\t\t);\n\t});\n\n\tconst displayName = computed<string>(() => {\n\t\tconst candidates = [props.name, info.value?.name, info.value?.identity];\n\n\t\treturn candidates.find((candidate) => candidate !== undefined && candidate.trim() !== '') ?? '';\n\t});\n\n\tconst initials = computed<string>(() => getInitials(displayName.value));\n\n\tconst hue = computed<number>(() => avatarHue(info.value?.identity ?? displayName.value));\n\n\tconst result: UseParticipantAvatar = {\n\t\tsrc,\n\t\tinitials,\n\t\thue,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<span\n\t\tv-bind=\"styleAttrs\"\n\t\t:data-lk-avatar=\"kind\"\n\t\t:style=\"{ '--vlk-avatar-hue': hue }\"\n\t>\n\t\t<img\n\t\t\tv-if=\"kind === AVATAR_KIND.image\"\n\t\t\tclass=\"lk-participant-avatar-image\"\n\t\t\t:src=\"src\"\n\t\t\talt=\"\"\n\t\t\treferrerpolicy=\"no-referrer\"\n\t\t\tdraggable=\"false\"\n\t\t\t@error=\"failedSrc = src\"\n\t\t/>\n\t\t<span\n\t\t\tv-else-if=\"kind === AVATAR_KIND.initials\"\n\t\t\tclass=\"lk-participant-avatar-initials\"\n\t\t\taria-hidden=\"true\"\n\t\t\t>{{ initials }}</span\n\t\t>\n\t\t<ParticipantPlaceholder v-else />\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { Participant } from 'livekit-client';\n\timport { computed, ref } from 'vue';\n\n\timport ParticipantPlaceholder from '@/components/icons/ParticipantPlaceholder.vue';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useParticipantAvatar } from '@/composables/useParticipantAvatar';\n\n\texport interface ParticipantAvatarProps extends LkStyleProps {\n\t\tparticipant?: Participant;\n\t\tsrc?: string;\n\t\tname?: string;\n\t}\n\n\tconst props = defineProps<ParticipantAvatarProps>();\n\n\tconst AVATAR_KIND = {\n\t\timage: 'image',\n\t\tinitials: 'initials',\n\t\ticon: 'icon',\n\t} as const;\n\n\ttype AvatarKind = (typeof AVATAR_KIND)[keyof typeof AVATAR_KIND];\n\n\tconst { src, initials, hue } = useParticipantAvatar(props);\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-participant-avatar']);\n\tconst failedSrc = ref<string | undefined>(undefined);\n\n\tconst kind = computed<AvatarKind>(() => {\n\t\tif (src.value !== undefined && src.value !== failedSrc.value) {\n\t\t\treturn AVATAR_KIND.image;\n\t\t}\n\n\t\treturn initials.value === '' ? AVATAR_KIND.icon : AVATAR_KIND.initials;\n\t});\n</script>\n","<template>\n\t<span\n\t\tv-bind=\"styleAttrs\"\n\t\t:data-lk-participant-name=\"info?.name\"\n\t\t>{{ name }}<slot\n\t/></span>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { Participant } from 'livekit-client';\n\timport { computed } from 'vue';\n\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useParticipantInfo } from '@/composables/useParticipantInfo';\n\n\texport interface ParticipantNameProps extends LkStyleProps {\n\t\tparticipant?: Participant;\n\t}\n\n\tconst props = defineProps<ParticipantNameProps>();\n\n\tdefineSlots<{ default?: () => unknown }>();\n\n\tconst { info } = useParticipantInfo({ participant: props.participant });\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-participant-name']);\n\n\tconst name = computed<string>(() => {\n\t\tconst participantName = info.value?.name;\n\n\t\tif (participantName !== undefined && participantName !== '') {\n\t\t\treturn participantName;\n\t\t}\n\n\t\treturn info.value?.identity ?? '';\n\t});\n</script>\n","import {\n\tlog,\n\tsetupTrackMutedIndicator,\n\ttype TrackReferenceOrPlaceholder,\n} from '@livekit/components-core';\nimport { computed, ref, watchEffect, type Ref } from 'vue';\n\nimport { useEnsureTrackRef } from '@/context/track-reference.context';\n\nexport interface UseTrackMutedIndicator {\n\treadonly isMuted: Ref<boolean>;\n}\n\nexport interface UseTrackMutedIndicatorProps {\n\treadonly trackRef: TrackReferenceOrPlaceholder;\n}\n\nfunction getInitialMuted(trackReference: TrackReferenceOrPlaceholder): boolean {\n\tif (trackReference.publication?.isMuted === true) {\n\t\treturn true;\n\t}\n\n\treturn trackReference.participant.getTrackPublication(trackReference.source)?.isMuted === true;\n}\n\nexport function useTrackMutedIndicator(props: UseTrackMutedIndicatorProps): UseTrackMutedIndicator {\n\tconst trackReference = useEnsureTrackRef(props.trackRef);\n\n\tconst isMuted = ref<boolean>(getInitialMuted(trackReference.value));\n\n\tconst mutedIndicator = computed<ReturnType<typeof setupTrackMutedIndicator>>(() => {\n\t\treturn setupTrackMutedIndicator(trackReference.value);\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = mutedIndicator.value.mediaMutedObserver.subscribe({\n\t\t\tnext: (muted) => {\n\t\t\t\tisMuted.value = muted;\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in media muted observer:', error);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst result: UseTrackMutedIndicator = {\n\t\tisMuted,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<div\n\t\tv-if=\"visible\"\n\t\tv-bind=\"styleAttrs\"\n\t\t:data-lk-muted=\"isMuted\"\n\t\t:data-lk-source=\"trackRef.source\"\n\t>\n\t\t<slot :is-muted=\"isMuted\">\n\t\t\t<component :is=\"getSourceIcon(trackRef.source, !isMuted)\" />\n\t\t</slot>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { TrackReferenceOrPlaceholder } from '@livekit/components-core';\n\timport { computed } from 'vue';\n\n\timport { getSourceIcon } from '@/components/icons/utils';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useTrackMutedIndicator } from '@/composables/useTrackMutedIndicator';\n\n\texport interface TrackMutedIndicatorProps extends LkStyleProps {\n\t\ttrackRef: TrackReferenceOrPlaceholder;\n\t\tshow?: 'always' | 'muted' | 'unmuted';\n\t}\n\n\tconst props = withDefaults(defineProps<TrackMutedIndicatorProps>(), { show: 'always' });\n\n\tdefineSlots<{ default?: (props: { isMuted: boolean }) => unknown }>();\n\n\tconst { isMuted } = useTrackMutedIndicator({ trackRef: props.trackRef });\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-track-muted-indicator']);\n\n\tconst visible = computed<boolean>(() => {\n\t\treturn (\n\t\t\tprops.show === 'always' ||\n\t\t\t(props.show === 'muted' && isMuted.value) ||\n\t\t\t(props.show === 'unmuted' && !isMuted.value)\n\t\t);\n\t});\n</script>\n","<template>\n\t<video\n\t\tref=\"element\"\n\t\tv-bind=\"attributes\"\n\t\tmuted\n\t\tplaysinline\n\t\t@click=\"handleClick\"\n\t/>\n</template>\n\n<script setup lang=\"ts\">\n\timport type {\n\t\tParticipantClickEvent,\n\t\tTrackReference,\n\t\tTrackReferenceOrPlaceholder,\n\t} from '@livekit/components-core';\n\timport { refDebounced, useIntersectionObserver } from '@vueuse/core';\n\timport { RemoteTrackPublication } from 'livekit-client';\n\timport { computed, onBeforeUnmount, shallowRef, useTemplateRef, watch } from 'vue';\n\n\timport { useMediaTrackBySourceOrName } from '@/composables/useMediaTrackBySourceOrName';\n\timport { useMaybeTrackRefContext } from '@/context/track-reference.context';\n\n\texport interface VideoTrackProps {\n\t\ttrackRef?: TrackReference;\n\t\tmanageSubscription?: boolean;\n\t}\n\n\tconst props = withDefaults(defineProps<VideoTrackProps>(), {\n\t\ttrackRef: undefined,\n\t\tmanageSubscription: false,\n\t});\n\n\tconst emits = defineEmits<{\n\t\ttrackClick: [event: ParticipantClickEvent];\n\t\tsubscriptionStatusChanged: [subscribed: boolean];\n\t}>();\n\n\tconst contextTrackRef = useMaybeTrackRefContext();\n\tconst element = useTemplateRef<HTMLVideoElement>('element');\n\n\tconst isIntersecting = shallowRef<boolean | undefined>(undefined);\n\n\tconst debouncedIntersecting = refDebounced(isIntersecting, 3000);\n\n\tconst trackReference = computed<TrackReferenceOrPlaceholder>(() => {\n\t\tconst trackRef = props.trackRef ?? contextTrackRef?.value;\n\n\t\tif (trackRef === undefined) {\n\t\t\tthrow new Error('VideoTrack needs a trackRef prop or a track reference context.');\n\t\t}\n\n\t\treturn trackRef;\n\t});\n\n\tconst { isSubscribed, publication, attributes } = useMediaTrackBySourceOrName({\n\t\tget observerOptions() {\n\t\t\treturn trackReference.value;\n\t\t},\n\t\toptions: { element },\n\t});\n\n\tfunction remotePublication(): RemoteTrackPublication | undefined {\n\t\tconst pub = trackReference.value.publication;\n\n\t\treturn pub instanceof RemoteTrackPublication ? pub : undefined;\n\t}\n\n\tfunction handleClick(): void {\n\t\temits('trackClick', {\n\t\t\tparticipant: trackReference.value.participant,\n\t\t\ttrack: publication.value,\n\t\t});\n\t}\n\n\tuseIntersectionObserver(element, ([entry]) => {\n\t\tisIntersecting.value = entry?.isIntersecting;\n\t});\n\n\twatch(isSubscribed, (subscribed) => emits('subscriptionStatusChanged', subscribed), {\n\t\timmediate: true,\n\t});\n\n\twatch([isIntersecting, debouncedIntersecting], ([now, settled]) => {\n\t\tconst pub = remotePublication();\n\n\t\tif (!props.manageSubscription || pub === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (now === true) {\n\t\t\tpub.setSubscribed(true);\n\t\t} else if (now === false && settled === false) {\n\t\t\tpub.setSubscribed(false);\n\t\t}\n\t});\n\n\tonBeforeUnmount(() => {\n\t\tif (props.manageSubscription) {\n\t\t\tremotePublication()?.setSubscribed(false);\n\t\t}\n\t});\n</script>\n","<template>\n\t<div\n\t\tv-bind=\"{ ...styleAttrs, ...attributes }\"\n\t\t@click=\"onClick\"\n\t>\n\t\t<TrackRefContextProvider :track-ref=\"trackReference\">\n\t\t\t<ParticipantContextProvider :participant=\"trackReference.participant\">\n\t\t\t\t<slot :track-ref=\"trackReference\">\n\t\t\t\t\t<VideoTrack\n\t\t\t\t\t\tv-if=\"media === 'video' && isTrackReference(trackReference)\"\n\t\t\t\t\t\t:track-ref=\"trackReference\"\n\t\t\t\t\t\t:manage-subscription=\"autoSubscription\"\n\t\t\t\t\t\t@subscription-status-changed=\"handleSubscribe\"\n\t\t\t\t\t/>\n\t\t\t\t\t<AudioTrack\n\t\t\t\t\t\tv-else-if=\"media === 'audio' && isTrackReference(trackReference)\"\n\t\t\t\t\t\t:track-ref=\"trackReference\"\n\t\t\t\t\t\t@subscription-status-changed=\"handleSubscribe\"\n\t\t\t\t\t/>\n\t\t\t\t\t<div class=\"lk-participant-placeholder\">\n\t\t\t\t\t\t<ParticipantAvatar />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"lk-participant-metadata\">\n\t\t\t\t\t\t<div class=\"lk-participant-metadata-item\">\n\t\t\t\t\t\t\t<template v-if=\"trackReference.source === Track.Source.Camera\">\n\t\t\t\t\t\t\t\t<LockLockedIcon\n\t\t\t\t\t\t\t\t\tv-if=\"isEncrypted\"\n\t\t\t\t\t\t\t\t\tclass=\"lk-participant-encrypted\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<TrackMutedIndicator\n\t\t\t\t\t\t\t\t\t:track-ref=\"microphoneRef\"\n\t\t\t\t\t\t\t\t\tshow=\"muted\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<ParticipantName />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t\t<ScreenShareIcon class=\"lk-participant-screen-share\" />\n\t\t\t\t\t\t\t\t<ParticipantName>&apos;s screen</ParticipantName>\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<ConnectionQualityIndicator class=\"lk-participant-metadata-item\" />\n\t\t\t\t\t</div>\n\t\t\t\t</slot>\n\t\t\t\t<FocusToggle :track-ref=\"trackReference\" />\n\t\t\t</ParticipantContextProvider>\n\t\t</TrackRefContextProvider>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport {\n\t\tisTrackReference,\n\t\tisTrackReferencePinned,\n\t\ttype ParticipantClickEvent,\n\t\ttype TrackReferenceOrPlaceholder,\n\t} from '@livekit/components-core';\n\timport { Track } from 'livekit-client';\n\timport { computed } from 'vue';\n\n\timport ParticipantContextProvider from '@/components/context/ParticipantContextProvider.vue';\n\timport TrackRefContextProvider from '@/components/context/TrackRefContextProvider.vue';\n\timport FocusToggle from '@/components/controls/FocusToggle.vue';\n\timport LockLockedIcon from '@/components/icons/LockLockedIcon.vue';\n\timport ScreenShareIcon from '@/components/icons/ScreenShareIcon.vue';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useIsEncrypted } from '@/composables/useIsEncrypted';\n\timport { useParticipantTile } from '@/composables/useParticipantTile';\n\timport { useMaybeFeatureContext } from '@/context/feature.context';\n\timport { useMaybeLayoutContext } from '@/context/layout.context';\n\timport { useMaybeTrackRefContext } from '@/context/track-reference.context';\n\n\timport AudioTrack from './AudioTrack.vue';\n\timport ConnectionQualityIndicator from './ConnectionQualityIndicator.vue';\n\timport ParticipantAvatar from './ParticipantAvatar.vue';\n\timport ParticipantName from './ParticipantName.vue';\n\timport TrackMutedIndicator from './TrackMutedIndicator.vue';\n\timport VideoTrack from './VideoTrack.vue';\n\n\texport interface ParticipantTileProps extends LkStyleProps {\n\t\ttrackRef?: TrackReferenceOrPlaceholder;\n\t\tdisableSpeakingIndicator?: boolean;\n\t}\n\n\tconst props = withDefaults(defineProps<ParticipantTileProps>(), {\n\t\ttrackRef: undefined,\n\t\tdisableSpeakingIndicator: undefined,\n\t});\n\n\tconst emits = defineEmits<{ participantClick: [event: ParticipantClickEvent] }>();\n\n\tdefineSlots<{\n\t\tdefault?: (props: { trackRef: TrackReferenceOrPlaceholder }) => unknown;\n\t}>();\n\n\tconst contextTrackRef = useMaybeTrackRefContext();\n\tconst layoutContext = useMaybeLayoutContext();\n\tconst featureContext = useMaybeFeatureContext();\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-participant-tile']);\n\n\tconst trackReference = computed<TrackReferenceOrPlaceholder>(() => {\n\t\tconst trackRef = props.trackRef ?? contextTrackRef?.value;\n\n\t\tif (trackRef === undefined) {\n\t\t\tthrow new Error('ParticipantTile needs a trackRef prop or a track reference context.');\n\t\t}\n\n\t\treturn trackRef;\n\t});\n\n\tconst autoSubscription = computed<boolean>(() => {\n\t\treturn featureContext?.value.autoSubscription ?? false;\n\t});\n\n\tconst media = computed<'video' | 'audio' | undefined>(() => {\n\t\tconst trackRef = trackReference.value;\n\n\t\tif (!isTrackReference(trackRef)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst isVideo =\n\t\t\ttrackRef.publication?.kind === 'video' ||\n\t\t\ttrackRef.source === Track.Source.Camera ||\n\t\t\ttrackRef.source === Track.Source.ScreenShare;\n\n\t\treturn isVideo ? 'video' : 'audio';\n\t});\n\n\tconst microphoneRef = computed<TrackReferenceOrPlaceholder>(() => {\n\t\treturn {\n\t\t\tparticipant: trackReference.value.participant,\n\t\t\tsource: Track.Source.Microphone,\n\t\t};\n\t});\n\n\tconst { attributes, onClick } = useParticipantTile({\n\t\ttrackRef: trackReference.value,\n\t\tget disableSpeakingIndicator() {\n\t\t\treturn props.disableSpeakingIndicator;\n\t\t},\n\t\tonParticipantClick: (event) => emits('participantClick', event),\n\t});\n\tconst { isEncrypted } = useIsEncrypted({ participant: trackReference.value.participant });\n\n\tfunction handleSubscribe(subscribed: boolean): void {\n\t\tconst pin = layoutContext?.value?.pin;\n\n\t\tif (\n\t\t\t!subscribed &&\n\t\t\tpin !== undefined &&\n\t\t\tisTrackReferencePinned(trackReference.value, pin.state.value)\n\t\t) {\n\t\t\tpin.dispatch({ msg: 'clear_pin' });\n\t\t}\n\t}\n</script>\n","<template>\n\t<TrackRefContextProvider\n\t\tv-for=\"trackRef in tracks\"\n\t\t:key=\"getTrackReferenceId(trackRef)\"\n\t\t:track-ref=\"trackRef\"\n\t>\n\t\t<slot :track-ref=\"trackRef\" />\n\t</TrackRefContextProvider>\n</template>\n\n<script setup lang=\"ts\">\n\timport { getTrackReferenceId, type TrackReferenceOrPlaceholder } from '@livekit/components-core';\n\n\timport TrackRefContextProvider from '@/components/context/TrackRefContextProvider.vue';\n\n\texport interface TrackLoopProps {\n\t\ttracks: TrackReferenceOrPlaceholder[];\n\t}\n\n\tdefineProps<TrackLoopProps>();\n\n\tdefineSlots<{ default?: (props: { trackRef: TrackReferenceOrPlaceholder }) => unknown }>();\n</script>\n","import { log, updatePages, type TrackReferenceOrPlaceholder } from '@livekit/components-core';\nimport {\n\tcomputed,\n\tref,\n\tshallowRef,\n\twatch,\n\twatchEffect,\n\ttype ComputedRef,\n\ttype MaybeRef,\n\ttype ShallowRef,\n} from 'vue';\n\nexport interface UseVisualStableUpdateProps {\n\treadonly trackReferences: TrackReferenceOrPlaceholder[] | MaybeRef<TrackReferenceOrPlaceholder[]>;\n\treadonly maxItemsOnPage: number;\n\treadonly customSortFunction?: (\n\t\ttrackReferences: TrackReferenceOrPlaceholder[],\n\t) => TrackReferenceOrPlaceholder[];\n}\n\nexport interface UseVisualStableUpdate {\n\treadonly isLayoutChanged: ComputedRef<boolean>;\n\treadonly sortedTrackReferences: ComputedRef<TrackReferenceOrPlaceholder[]>;\n\treadonly updatedTrackReferences: ShallowRef<TrackReferenceOrPlaceholder[]>;\n}\n\nexport function useVisualStableUpdate(props: UseVisualStableUpdateProps): UseVisualStableUpdate {\n\tconst lastMaxItemsOnPage = ref<number>(-1);\n\tconst lastTrackRefs = shallowRef<TrackReferenceOrPlaceholder[]>([]);\n\n\tconst trackReferences = computed<TrackReferenceOrPlaceholder[]>(() => {\n\t\treturn 'value' in props.trackReferences ? props.trackReferences.value : props.trackReferences;\n\t});\n\n\tconst isLayoutChanged = computed<boolean>(() => {\n\t\treturn props.maxItemsOnPage !== lastMaxItemsOnPage.value;\n\t});\n\n\tconst sortedTrackReferences = computed<TrackReferenceOrPlaceholder[]>(() => {\n\t\treturn props.customSortFunction === undefined\n\t\t\t? trackReferences.value\n\t\t\t: props.customSortFunction(trackReferences.value);\n\t});\n\n\tconst updatedTrackReferences = shallowRef<TrackReferenceOrPlaceholder[]>([\n\t\t...sortedTrackReferences.value,\n\t]);\n\n\tfunction updateTrackReferences(): void {\n\t\tif (!isLayoutChanged.value) {\n\t\t\ttry {\n\t\t\t\tupdatedTrackReferences.value = updatePages(\n\t\t\t\t\tlastTrackRefs.value,\n\t\t\t\t\tsortedTrackReferences.value,\n\t\t\t\t\tprops.maxItemsOnPage,\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\tlog.error('Error while running updatePages(): ', error);\n\t\t\t}\n\t\t}\n\n\t\tif (isLayoutChanged.value) {\n\t\t\tlastTrackRefs.value = sortedTrackReferences.value;\n\t\t} else {\n\t\t\tlastTrackRefs.value = updatedTrackReferences.value;\n\t\t}\n\n\t\tlastMaxItemsOnPage.value = props.maxItemsOnPage;\n\t}\n\n\twatchEffect(() => {\n\t\tif (isLayoutChanged.value) {\n\t\t\tupdateTrackReferences();\n\t\t}\n\t});\n\n\twatch([() => props.maxItemsOnPage, trackReferences], () => {\n\t\tupdateTrackReferences();\n\t});\n\n\tconst result: UseVisualStableUpdate = {\n\t\tisLayoutChanged,\n\t\tsortedTrackReferences,\n\t\tupdatedTrackReferences,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<aside\n\t\tref=\"aside\"\n\t\tv-bind=\"styleAttrs\"\n\t\t:data-lk-orientation=\"carouselOrientation\"\n\t\t:style=\"{ '--vlk-max-visible-tiles': maxVisibleTiles }\"\n\t>\n\t\t<TrackLoop :tracks=\"updatedTrackReferences\">\n\t\t\t<template #default=\"{ trackRef }\">\n\t\t\t\t<slot :track-ref=\"trackRef\">\n\t\t\t\t\t<ParticipantTile />\n\t\t\t\t</slot>\n\t\t\t</template>\n\t\t</TrackLoop>\n\t</aside>\n</template>\n\n<script setup lang=\"ts\">\n\timport { getScrollBarWidth, type TrackReferenceOrPlaceholder } from '@livekit/components-core';\n\timport { useElementSize } from '@vueuse/core';\n\timport { computed, ref, useTemplateRef, watch } from 'vue';\n\n\timport ParticipantTile from '@/components/participant/ParticipantTile.vue';\n\timport TrackLoop from '@/components/room/TrackLoop.vue';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useVisualStableUpdate } from '@/composables/useVisualStableUpdate';\n\timport { useProvideFeatureContext } from '@/context/feature.context';\n\n\texport interface CarouselLayoutProps extends LkStyleProps {\n\t\ttracks: TrackReferenceOrPlaceholder[];\n\t\torientation?: 'vertical' | 'horizontal';\n\t\tmanageSubscription?: boolean;\n\t}\n\n\tconst props = withDefaults(defineProps<CarouselLayoutProps>(), {\n\t\torientation: undefined,\n\t\tmanageSubscription: false,\n\t});\n\n\tdefineSlots<{\n\t\tdefault?: (props: { trackRef: TrackReferenceOrPlaceholder }) => unknown;\n\t}>();\n\n\tconst MIN_HEIGHT = 130;\n\tconst MIN_WIDTH = 140;\n\tconst MIN_VISIBLE_TILES = 1;\n\tconst ASPECT_RATIO = 16 / 10;\n\tconst ASPECT_RATIO_INVERT = (1 - ASPECT_RATIO) * -1;\n\n\tconst aside = useTemplateRef<HTMLElement>('aside');\n\tconst { width, height } = useElementSize(aside);\n\tconst features = useProvideFeatureContext({ autoSubscription: props.manageSubscription });\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-carousel']);\n\n\tconst previousTiles = ref<number>(0);\n\n\tconst carouselOrientation = computed<'vertical' | 'horizontal'>(() => {\n\t\treturn props.orientation ?? (height.value >= width.value ? 'vertical' : 'horizontal');\n\t});\n\n\tconst tilesThatFit = computed<number>(() => {\n\t\tconst scrollBarWidth = getScrollBarWidth();\n\n\t\tif (carouselOrientation.value === 'vertical') {\n\t\t\tconst tileSpan = Math.max(width.value * ASPECT_RATIO_INVERT, MIN_HEIGHT);\n\n\t\t\treturn Math.max((height.value - scrollBarWidth) / tileSpan, MIN_VISIBLE_TILES);\n\t\t}\n\n\t\tconst tileSpan = Math.max(height.value * ASPECT_RATIO, MIN_WIDTH);\n\n\t\treturn Math.max((width.value - scrollBarWidth) / tileSpan, MIN_VISIBLE_TILES);\n\t});\n\n\tconst maxVisibleTiles = computed<number>(() => {\n\t\treturn Math.abs(tilesThatFit.value - previousTiles.value) < 0.5\n\t\t\t? Math.round(previousTiles.value)\n\t\t\t: Math.round(tilesThatFit.value);\n\t});\n\n\tconst { updatedTrackReferences } = useVisualStableUpdate({\n\t\ttrackReferences: computed<TrackReferenceOrPlaceholder[]>(() => {\n\t\t\treturn props.tracks;\n\t\t}),\n\t\tget maxItemsOnPage() {\n\t\t\treturn maxVisibleTiles.value;\n\t\t},\n\t});\n\n\twatch(tilesThatFit, (tiles) => {\n\t\tif (Math.abs(tiles - previousTiles.value) >= 0.5) {\n\t\t\tpreviousTiles.value = tiles;\n\t\t}\n\t});\n\n\twatch(\n\t\t() => props.manageSubscription,\n\t\t(autoSubscription) => {\n\t\t\tfeatures.value = { autoSubscription };\n\t\t},\n\t);\n</script>\n","<template>\n\t<ParticipantTile\n\t\t:track-ref=\"trackRef\"\n\t\t:size=\"size\"\n\t\t:unstyled=\"unstyled\"\n\t\t@participant-click=\"emits('participantClick', $event)\"\n\t/>\n</template>\n\n<script setup lang=\"ts\">\n\timport type {\n\t\tParticipantClickEvent,\n\t\tTrackReferenceOrPlaceholder,\n\t} from '@livekit/components-core';\n\n\timport ParticipantTile from '@/components/participant/ParticipantTile.vue';\n\timport type { LkStyleProps } from '@/components/style';\n\n\texport interface FocusLayoutProps extends LkStyleProps {\n\t\ttrackRef?: TrackReferenceOrPlaceholder;\n\t}\n\n\twithDefaults(defineProps<FocusLayoutProps>(), {\n\t\ttrackRef: undefined,\n\t\tsize: undefined,\n\t\tunstyled: undefined,\n\t});\n\n\tconst emits = defineEmits<{ participantClick: [event: ParticipantClickEvent] }>();\n</script>\n","<template>\n\t<div v-bind=\"styleAttrs\">\n\t\t<slot />\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\n\texport type FocusLayoutContainerProps = LkStyleProps;\n\n\tconst props = defineProps<FocusLayoutContainerProps>();\n\n\tdefineSlots<{ default?: () => unknown }>();\n\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-focus-layout']);\n</script>\n","import {\n\tGRID_LAYOUTS,\n\tselectGridLayout,\n\ttype GridLayoutDefinition,\n\ttype GridLayoutInfo,\n} from '@livekit/components-core';\nimport { useElementSize } from '@vueuse/core';\nimport {\n\tcomputed,\n\ttoValue,\n\twatchEffect,\n\ttype ComputedRef,\n\ttype MaybeRefOrGetter,\n\ttype Ref,\n} from 'vue';\n\nexport interface UseGridLayoutProps {\n\treadonly trackCount: MaybeRefOrGetter<number>;\n\treadonly layouts?: GridLayoutDefinition[];\n\treadonly gridElement: MaybeRefOrGetter<HTMLElement | null | undefined>;\n}\n\nexport interface UseGridLayout {\n\treadonly layout: ComputedRef<GridLayoutInfo>;\n\treadonly containerWidth: Ref<number>;\n\treadonly containerHeight: Ref<number>;\n}\n\nexport function useGridLayout(props: UseGridLayoutProps): UseGridLayout {\n\tconst { width, height } = useElementSize(props.gridElement);\n\n\tconst gridLayouts = computed<GridLayoutDefinition[]>(() => {\n\t\treturn props.layouts ?? GRID_LAYOUTS;\n\t});\n\n\tconst layout = computed<GridLayoutInfo>(() => {\n\t\treturn selectGridLayout(\n\t\t\tgridLayouts.value,\n\t\t\ttoValue(props.trackCount),\n\t\t\twidth.value,\n\t\t\theight.value,\n\t\t);\n\t});\n\n\twatchEffect(() => {\n\t\tconst element = toValue(props.gridElement);\n\n\t\tif (element !== null && element !== undefined) {\n\t\t\telement.style.setProperty('--vlk-col-count', layout.value.columns.toString());\n\t\t\telement.style.setProperty('--vlk-row-count', layout.value.rows.toString());\n\t\t}\n\t});\n\n\tconst gridLayout: UseGridLayout = {\n\t\tlayout,\n\t\tcontainerWidth: width,\n\t\tcontainerHeight: height,\n\t};\n\n\treturn gridLayout;\n}\n","import type { TrackReferenceOrPlaceholder } from '@livekit/components-core';\nimport {\n\tcomputed,\n\tref,\n\ttoValue,\n\twatchEffect,\n\ttype ComputedRef,\n\ttype MaybeRefOrGetter,\n\ttype Ref,\n} from 'vue';\n\nimport { useVisualStableUpdate, type UseVisualStableUpdateProps } from './useVisualStableUpdate';\n\nexport interface UsePaginationOptions {\n\treadonly customSortFunction?: UseVisualStableUpdateProps['customSortFunction'];\n\treadonly initialPage?: number;\n}\n\nexport type PaginationDirection = (typeof PAGINATION_DIRECTION)[keyof typeof PAGINATION_DIRECTION];\n\nexport interface UsePagination {\n\treadonly totalPageCount: Ref<number>;\n\treadonly firstItemIndex: Ref<number>;\n\treadonly lastItemIndex: Ref<number>;\n\treadonly tracks: ComputedRef<TrackReferenceOrPlaceholder[]>;\n\treadonly currentPage: Ref<number>;\n\treadonly nextPage: () => void;\n\treadonly prevPage: () => void;\n\treadonly setPage: (num: number) => void;\n\treadonly hasNextPage: ComputedRef<boolean>;\n\treadonly hasPrevPage: ComputedRef<boolean>;\n\treadonly totalItems: ComputedRef<number>;\n}\n\nexport const PAGINATION_DIRECTION = {\n\tNEXT: 'next',\n\tPREVIOUS: 'previous',\n} as const;\n\nexport function usePagination(\n\titemPerPage: MaybeRefOrGetter<number>,\n\ttrackReferences: MaybeRefOrGetter<TrackReferenceOrPlaceholder[]>,\n\toptions: UsePaginationOptions = {},\n): UsePagination {\n\tconst perPage = computed<number>(() => {\n\t\treturn Math.max(1, toValue(itemPerPage));\n\t});\n\n\tconst currentPage = ref<number>(Math.max(1, options.initialPage ?? 1));\n\n\tconst getTrackReferences = computed<TrackReferenceOrPlaceholder[]>(() => {\n\t\treturn toValue(trackReferences);\n\t});\n\n\tconst totalItems = computed<number>(() => {\n\t\treturn getTrackReferences.value.length;\n\t});\n\n\tconst totalPageCount = computed<number>(() => {\n\t\treturn Math.max(Math.ceil(totalItems.value / perPage.value), 1);\n\t});\n\n\tconst lastItemIndex = computed<number>(() => {\n\t\treturn Math.min(currentPage.value * perPage.value, totalItems.value);\n\t});\n\n\tconst firstItemIndex = computed<number>(() => {\n\t\treturn Math.min((currentPage.value - 1) * perPage.value, totalItems.value);\n\t});\n\n\tconst hasNextPage = computed<boolean>(() => {\n\t\treturn currentPage.value < totalPageCount.value;\n\t});\n\n\tconst hasPrevPage = computed<boolean>(() => {\n\t\treturn currentPage.value > 1;\n\t});\n\n\tconst { updatedTrackReferences } = useVisualStableUpdate({\n\t\ttrackReferences: getTrackReferences,\n\t\tget maxItemsOnPage() {\n\t\t\treturn perPage.value;\n\t\t},\n\t\tcustomSortFunction: options.customSortFunction,\n\t});\n\n\tconst tracksOnPage = computed<TrackReferenceOrPlaceholder[]>(() => {\n\t\treturn updatedTrackReferences.value.slice(firstItemIndex.value, lastItemIndex.value);\n\t});\n\n\twatchEffect(() => {\n\t\tconst maxPage = totalPageCount.value;\n\n\t\tif (currentPage.value > maxPage) {\n\t\t\tcurrentPage.value = maxPage;\n\t\t} else if (currentPage.value < 1) {\n\t\t\tcurrentPage.value = 1;\n\t\t}\n\t});\n\n\tfunction nextPage(): void {\n\t\tif (hasNextPage.value) {\n\t\t\tcurrentPage.value += 1;\n\t\t}\n\t}\n\n\tfunction prevPage(): void {\n\t\tif (hasPrevPage.value) {\n\t\t\tcurrentPage.value -= 1;\n\t\t}\n\t}\n\n\tfunction setPage(num: number): void {\n\t\tcurrentPage.value = Math.min(Math.max(1, num), totalPageCount.value);\n\t}\n\n\tconst result: UsePagination = {\n\t\ttotalPageCount,\n\t\tnextPage,\n\t\tprevPage,\n\t\tsetPage,\n\t\tfirstItemIndex,\n\t\tlastItemIndex,\n\t\ttracks: tracksOnPage,\n\t\tcurrentPage,\n\t\thasNextPage,\n\t\thasPrevPage,\n\t\ttotalItems,\n\t};\n\n\treturn result;\n}\n","import { useEventListener } from '@vueuse/core';\nimport { ref, toValue, type MaybeRefOrGetter } from 'vue';\n\nexport interface UseSwipeOptions {\n\treadonly minSwipeDistance?: number;\n\treadonly onLeftSwipe?: () => void;\n\treadonly onRightSwipe?: () => void;\n}\n\nexport interface UseSwipeProps {\n\treadonly element: MaybeRefOrGetter<HTMLElement | null | undefined>;\n\treadonly options: UseSwipeOptions;\n}\n\nexport interface UseSwipe {\n\treadonly onTouchStart: (event: TouchEvent) => void;\n\treadonly onTouchMove: (event: TouchEvent) => void;\n\treadonly onTouchEnd: () => void;\n}\n\nconst DEFAULT_MIN_SWIPE_DISTANCE = 50;\n\nfunction getClientX(event: TouchEvent): number | null {\n\treturn event.targetTouches[0]?.clientX ?? null;\n}\n\nexport function useSwipe(props: UseSwipeProps): UseSwipe {\n\tconst touchEnd = ref<number | null>(null);\n\tconst touchStart = ref<number | null>(null);\n\tconst minSwipeDistance = props.options.minSwipeDistance ?? DEFAULT_MIN_SWIPE_DISTANCE;\n\n\tfunction onTouchStart(event: TouchEvent): void {\n\t\ttouchEnd.value = null;\n\t\ttouchStart.value = getClientX(event);\n\t}\n\n\tfunction onTouchMove(event: TouchEvent): void {\n\t\ttouchEnd.value = getClientX(event);\n\t}\n\n\tfunction onTouchEnd(): void {\n\t\tif (\n\t\t\ttouchStart.value === null ||\n\t\t\ttouchEnd.value === null ||\n\t\t\ttouchStart.value === 0 ||\n\t\t\ttouchEnd.value === 0\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst distance = touchStart.value - touchEnd.value;\n\n\t\tif (distance > minSwipeDistance) {\n\t\t\tprops.options.onLeftSwipe?.();\n\t\t}\n\n\t\tif (distance < -minSwipeDistance) {\n\t\t\tprops.options.onRightSwipe?.();\n\t\t}\n\t}\n\n\tfunction getElement(): HTMLElement | null | undefined {\n\t\treturn toValue(props.element);\n\t}\n\n\tuseEventListener(getElement, 'touchstart', onTouchStart, { passive: true });\n\tuseEventListener(getElement, 'touchmove', onTouchMove, { passive: true });\n\tuseEventListener(getElement, 'touchend', onTouchEnd, { passive: true });\n\n\tconst result: UseSwipe = {\n\t\tonTouchStart,\n\t\tonTouchMove,\n\t\tonTouchEnd,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<div\n\t\tref=\"grid\"\n\t\tv-bind=\"styleAttrs\"\n\t\t:data-lk-pagination=\"totalPageCount > 1\"\n\t>\n\t\t<TrackLoop :tracks=\"tracks\">\n\t\t\t<template #default=\"{ trackRef }\">\n\t\t\t\t<slot :track-ref=\"trackRef\">\n\t\t\t\t\t<ParticipantTile />\n\t\t\t\t</slot>\n\t\t\t</template>\n\t\t</TrackLoop>\n\t\t<template v-if=\"props.tracks.length > layout.maxTiles\">\n\t\t\t<PaginationIndicator\n\t\t\t\t:total-page-count=\"totalPageCount\"\n\t\t\t\t:current-page=\"currentPage\"\n\t\t\t/>\n\t\t\t<PaginationControl\n\t\t\t\t:total-page-count=\"totalPageCount\"\n\t\t\t\t:current-page=\"currentPage\"\n\t\t\t\t:pages-container=\"grid\"\n\t\t\t\t@next=\"nextPage\"\n\t\t\t\t@prev=\"prevPage\"\n\t\t\t/>\n\t\t</template>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { GridLayoutDefinition, TrackReferenceOrPlaceholder } from '@livekit/components-core';\n\timport { useTemplateRef, watch } from 'vue';\n\n\timport PaginationControl from '@/components/controls/PaginationControl.vue';\n\timport PaginationIndicator from '@/components/controls/PaginationIndicator.vue';\n\timport ParticipantTile from '@/components/participant/ParticipantTile.vue';\n\timport TrackLoop from '@/components/room/TrackLoop.vue';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useGridLayout } from '@/composables/useGridLayout';\n\timport { usePagination } from '@/composables/usePagination';\n\timport { useSwipe } from '@/composables/useSwipe';\n\timport { useProvideFeatureContext } from '@/context/feature.context';\n\n\texport interface GridLayoutProps extends LkStyleProps {\n\t\ttracks: TrackReferenceOrPlaceholder[];\n\t\tlayouts?: GridLayoutDefinition[];\n\t\tmanageSubscription?: boolean;\n\t}\n\n\tconst props = withDefaults(defineProps<GridLayoutProps>(), {\n\t\tlayouts: undefined,\n\t\tmanageSubscription: false,\n\t});\n\n\tdefineSlots<{\n\t\tdefault?: (props: { trackRef: TrackReferenceOrPlaceholder }) => unknown;\n\t}>();\n\n\tconst grid = useTemplateRef<HTMLDivElement>('grid');\n\n\tconst { layout } = useGridLayout({\n\t\tgridElement: grid,\n\t\ttrackCount: () => props.tracks.length,\n\t\tget layouts() {\n\t\t\treturn props.layouts;\n\t\t},\n\t});\n\tconst { tracks, totalPageCount, currentPage, nextPage, prevPage } = usePagination(\n\t\t() => layout.value.maxTiles,\n\t\t() => props.tracks,\n\t);\n\n\tuseSwipe({ element: grid, options: { onLeftSwipe: nextPage, onRightSwipe: prevPage } });\n\tconst features = useProvideFeatureContext({ autoSubscription: props.manageSubscription });\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-grid-layout']);\n\n\twatch(\n\t\t() => props.manageSubscription,\n\t\t(autoSubscription) => {\n\t\t\tfeatures.value = { autoSubscription };\n\t\t},\n\t);\n</script>\n","<template>\n\t<slot :layout=\"context\" />\n</template>\n\n<script setup lang=\"ts\">\n\timport type { PinState, WidgetState } from '@livekit/components-core';\n\timport { watch } from 'vue';\n\n\timport { useProvideLayoutContext, type LayoutContext } from '@/context/layout.context';\n\n\texport interface LayoutContextProviderProps {\n\t\tvalue?: LayoutContext;\n\t}\n\n\tconst props = withDefaults(defineProps<LayoutContextProviderProps>(), { value: undefined });\n\n\tconst emits = defineEmits<{\n\t\tpinChange: [state: PinState];\n\t\twidgetChange: [state: WidgetState];\n\t}>();\n\n\tdefineSlots<{ default?: (props: { layout: LayoutContext }) => unknown }>();\n\n\tconst context = useProvideLayoutContext(props.value);\n\n\twatch(\n\t\t() => props.value,\n\t\t(value) => {\n\t\t\tif (value !== undefined) {\n\t\t\t\tcontext.value = value;\n\t\t\t}\n\t\t},\n\t);\n\n\twatch(\n\t\t() => context.value.pin.state.value,\n\t\t(state) => emits('pinChange', state),\n\t);\n\n\twatch(\n\t\t() => context.value.widget.state.value,\n\t\t(state) => emits('widgetChange', state),\n\t);\n</script>\n","import {\n\tisTrackReference,\n\tlog,\n\ttype TrackReference,\n\ttype TrackReferenceOrPlaceholder,\n} from '@livekit/components-core';\nimport {\n\tcreateAudioAnalyser,\n\tTrack,\n\ttype AudioAnalyserOptions,\n\ttype LocalAudioTrack,\n\ttype RemoteAudioTrack,\n} from 'livekit-client';\nimport { computed, ref, toValue, watchEffect, type MaybeRef, type Ref } from 'vue';\n\nexport interface MultiBandTrackVolumeOptions {\n\treadonly bands?: number;\n\treadonly loPass?: number;\n\treadonly hiPass?: number;\n\treadonly updateInterval?: number;\n\treadonly analyserOptions?: AnalyserOptions;\n}\n\nexport interface AudioWaveformOptions {\n\treadonly barCount?: number;\n\treadonly volMultiplier?: number;\n\treadonly updateInterval?: number;\n}\n\nexport interface UseTrackVolume {\n\treadonly volume: Ref<number>;\n}\n\nexport interface UseMultibandTrackVolume {\n\treadonly frequencyBands: Ref<number[]>;\n}\n\nexport interface UseAudioWaveform {\n\treadonly bars: Ref<number[]>;\n}\n\nexport interface UseTrackVolumeProps {\n\treadonly trackOrTrackReference?: MaybeRef<\n\t\tLocalAudioTrack | RemoteAudioTrack | TrackReference | undefined\n\t>;\n\treadonly options?: AudioAnalyserOptions;\n}\n\nexport interface UseMultibandTrackVolumeProps {\n\treadonly trackOrTrackReference?: MaybeRef<\n\t\tLocalAudioTrack | RemoteAudioTrack | TrackReferenceOrPlaceholder | undefined\n\t>;\n\treadonly options?: MultiBandTrackVolumeOptions;\n}\n\nexport interface UseAudioWaveformProps {\n\treadonly trackOrTrackReference?: MaybeRef<\n\t\tLocalAudioTrack | RemoteAudioTrack | TrackReferenceOrPlaceholder | undefined\n\t>;\n\treadonly options?: AudioWaveformOptions;\n}\n\ntype AudioTrack = LocalAudioTrack | RemoteAudioTrack;\n\ntype AudioTrackInput = AudioTrack | TrackReferenceOrPlaceholder | undefined;\n\nconst MULTIBAND_DEFAULTS = {\n\tbands: 5,\n\tloPass: 100,\n\thiPass: 600,\n\tupdateInterval: 32,\n\tanalyserOptions: { fftSize: 2048 },\n} as const satisfies MultiBandTrackVolumeOptions;\n\nconst WAVEFORM_DEFAULTS = {\n\tbarCount: 120,\n\tvolMultiplier: 5,\n\tupdateInterval: 20,\n} as const satisfies AudioWaveformOptions;\n\nconst MIN_DB = -100;\n\nconst MAX_DB = -10;\n\nconst VOLUME_UPDATE_INTERVAL_MS = 1000 / 30;\n\nfunction isAudioTrack(track: Track | undefined): track is AudioTrack {\n\treturn track?.kind === Track.Kind.Audio;\n}\n\nfunction getAudioTrack(input: AudioTrackInput): AudioTrack | undefined {\n\tif (input === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst track = input instanceof Track ? input : input.publication?.track;\n\n\treturn isAudioTrack(track) ? track : undefined;\n}\n\nfunction normalizeDb(value: number): number {\n\treturn Math.sqrt(1 - (Math.max(MIN_DB, Math.min(MAX_DB, value)) * -1) / 100);\n}\n\nfunction normalizeFrequencies(frequencies: Float32Array): Float32Array<ArrayBuffer> {\n\treturn frequencies.map((value) => (value === -Infinity ? 0 : normalizeDb(value)));\n}\n\nfunction getPow2Ceil(value: number): number {\n\tlet remaining = value;\n\tlet power = 2;\n\n\twhile ((remaining >>= 1) > 0) {\n\t\tpower <<= 1;\n\t}\n\n\treturn power;\n}\n\nfunction getFFTSizeValue(value: number): number {\n\tif (value < 32) {\n\t\treturn 32;\n\t}\n\n\treturn getPow2Ceil(value);\n}\n\nfunction getSum(values: Float32Array): number {\n\tlet sum = 0;\n\n\tfor (const value of values) {\n\t\tsum += value;\n\t}\n\n\treturn sum;\n}\n\nfunction filterData(audioData: Float32Array, numSamples: number): Float32Array {\n\tconst blockSize = Math.floor(audioData.length / numSamples);\n\tconst filteredData = new Float32Array(numSamples);\n\n\tfor (let i = 0; i < numSamples; i++) {\n\t\tconst blockStart = blockSize * i;\n\t\tlet sum = 0;\n\n\t\tfor (let j = 0; j < blockSize; j++) {\n\t\t\tsum += Math.abs(audioData[blockStart + j] ?? 0);\n\t\t}\n\n\t\tfilteredData[i] = sum / blockSize;\n\t}\n\n\treturn filteredData;\n}\n\nfunction getFrequencyBands(\n\tdataArray: Float32Array,\n\topts: Required<MultiBandTrackVolumeOptions>,\n): number[] {\n\tconst normalizedFrequencies = normalizeFrequencies(dataArray.slice(opts.loPass, opts.hiPass));\n\tconst chunkSize = Math.ceil(normalizedFrequencies.length / opts.bands);\n\tconst chunks: number[] = [];\n\n\tfor (let i = 0; i < opts.bands; i++) {\n\t\tchunks.push(\n\t\t\tgetSum(normalizedFrequencies.slice(i * chunkSize, (i + 1) * chunkSize)) / chunkSize,\n\t\t);\n\t}\n\n\treturn chunks;\n}\n\nfunction closeAnalyser(cleanup: () => Promise<void>): void {\n\tcleanup().catch((error: unknown) => {\n\t\tlog.error('Error closing the audio analyser:', error);\n\t});\n}\n\nexport function useTrackVolume(props: UseTrackVolumeProps): UseTrackVolume {\n\tconst volume = ref<number>(0);\n\n\tconst track = computed<AudioTrack | undefined>(() => {\n\t\tconst input = toValue(props.trackOrTrackReference);\n\n\t\tif (input === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn isTrackReference(input) ? getAudioTrack(input) : input;\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\tconst currentTrack = track.value;\n\n\t\tif (currentTrack?.mediaStream === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst { cleanup, analyser } = createAudioAnalyser(currentTrack, props.options);\n\t\t\tconst dataArray = new Uint8Array(analyser.frequencyBinCount);\n\n\t\t\tconst interval = setInterval(() => {\n\t\t\t\tanalyser.getByteFrequencyData(dataArray);\n\t\t\t\tlet sum = 0;\n\n\t\t\t\tfor (const amplitude of dataArray) {\n\t\t\t\t\tsum += amplitude * amplitude;\n\t\t\t\t}\n\n\t\t\t\tvolume.value = Math.sqrt(sum / dataArray.length) / 255;\n\t\t\t}, VOLUME_UPDATE_INTERVAL_MS);\n\n\t\t\tonCleanup(() => {\n\t\t\t\tcloseAnalyser(cleanup);\n\t\t\t\tclearInterval(interval);\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tlog.error('Error setting up audio analyzer:', error);\n\t\t}\n\t});\n\n\tconst result: UseTrackVolume = {\n\t\tvolume,\n\t};\n\n\treturn result;\n}\n\nexport function useMultibandTrackVolume(\n\tprops: UseMultibandTrackVolumeProps,\n): UseMultibandTrackVolume {\n\tconst opts = { ...MULTIBAND_DEFAULTS, ...props.options };\n\tconst frequencyBands = ref<number[]>(Array.from({ length: opts.bands }, () => 0));\n\n\tconst track = computed<AudioTrack | undefined>(() => {\n\t\treturn getAudioTrack(toValue(props.trackOrTrackReference));\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\tconst currentTrack = track.value;\n\n\t\tif (currentTrack?.mediaStream === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst { analyser, cleanup } = createAudioAnalyser(currentTrack, opts.analyserOptions);\n\t\t\tconst dataArray = new Float32Array(analyser.frequencyBinCount);\n\n\t\t\tconst interval = setInterval(() => {\n\t\t\t\tanalyser.getFloatFrequencyData(dataArray);\n\t\t\t\tfrequencyBands.value = getFrequencyBands(dataArray, opts);\n\t\t\t}, opts.updateInterval);\n\n\t\t\tonCleanup(() => {\n\t\t\t\tcloseAnalyser(cleanup);\n\t\t\t\tclearInterval(interval);\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tlog.error('Error setting up multiband audio analyzer:', error);\n\t\t}\n\t});\n\n\tconst result: UseMultibandTrackVolume = {\n\t\tfrequencyBands,\n\t};\n\n\treturn result;\n}\n\nexport function useAudioWaveform(props: UseAudioWaveformProps): UseAudioWaveform {\n\tconst opts = { ...WAVEFORM_DEFAULTS, ...props.options };\n\n\tconst aggregateWave = ref<Float32Array>(new Float32Array());\n\tconst timeRef = ref<number>(performance.now());\n\tconst updates = ref<number>(0);\n\tconst bars = ref<number[]>([]);\n\n\tconst track = computed<AudioTrack | undefined>(() => {\n\t\treturn getAudioTrack(toValue(props.trackOrTrackReference));\n\t});\n\n\tfunction onUpdate(wave: Float32Array): void {\n\t\tbars.value = Array.from(\n\t\t\tfilterData(wave, opts.barCount).map((value) => Math.sqrt(value) * opts.volMultiplier),\n\t\t);\n\t}\n\n\tfunction flushWave(length: number): void {\n\t\tconst newData = new Float32Array(length);\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tnewData[i] = (aggregateWave.value[i] ?? 0) / updates.value;\n\t\t\taggregateWave.value[i] = 0;\n\t\t}\n\n\t\tonUpdate(newData);\n\t\ttimeRef.value = performance.now();\n\t\tupdates.value = 0;\n\t}\n\n\tfunction aggregate(dataArray: Float32Array): void {\n\t\tif (aggregateWave.value.length !== dataArray.length) {\n\t\t\taggregateWave.value = new Float32Array(dataArray.length);\n\t\t}\n\n\t\tfor (let i = 0; i < dataArray.length; i++) {\n\t\t\taggregateWave.value[i] = (aggregateWave.value[i] ?? 0) + (dataArray[i] ?? 0);\n\t\t}\n\n\t\tupdates.value += 1;\n\n\t\tif (performance.now() - timeRef.value >= opts.updateInterval) {\n\t\t\tflushWave(dataArray.length);\n\t\t}\n\t}\n\n\twatchEffect((onCleanup) => {\n\t\tconst currentTrack = track.value;\n\n\t\tif (currentTrack?.mediaStream === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst fftSize = getFFTSizeValue(opts.barCount);\n\t\t\tconst { analyser, cleanup } = createAudioAnalyser(currentTrack, { fftSize });\n\t\t\tconst dataArray = new Float32Array(fftSize);\n\t\t\tlet animationFrame = 0;\n\n\t\t\tfunction update(): void {\n\t\t\t\tanimationFrame = requestAnimationFrame(update);\n\t\t\t\tanalyser.getFloatTimeDomainData(dataArray);\n\t\t\t\taggregate(dataArray);\n\t\t\t}\n\n\t\t\tanimationFrame = requestAnimationFrame(update);\n\n\t\t\tonCleanup(() => {\n\t\t\t\tcloseAnalyser(cleanup);\n\t\t\t\tcancelAnimationFrame(animationFrame);\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tlog.error('Error setting up audio waveform analyzer:', error);\n\t\t}\n\t});\n\n\tconst result: UseAudioWaveform = {\n\t\tbars,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<svg\n\t\tv-bind=\"styleAttrs\"\n\t\twidth=\"100%\"\n\t\theight=\"100%\"\n\t\t:viewBox=\"`0 0 ${svgWidth} ${svgHeight}`\"\n\t>\n\t\t<rect\n\t\t\tx=\"0\"\n\t\t\ty=\"0\"\n\t\t\twidth=\"100%\"\n\t\t\theight=\"100%\"\n\t\t/>\n\t\t<g :transform=\"`translate(${offsetX}, 0)`\">\n\t\t\t<rect\n\t\t\t\tv-for=\"(volume, index) in frequencyBands\"\n\t\t\t\t:key=\"index\"\n\t\t\t\t:x=\"index * (barWidth + barSpacing)\"\n\t\t\t\t:y=\"svgHeight / 2 - (volume * volMultiplier) / 2\"\n\t\t\t\t:width=\"barWidth\"\n\t\t\t\t:height=\"volume * volMultiplier\"\n\t\t\t/>\n\t\t</g>\n\t</svg>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { TrackReferenceOrPlaceholder } from '@livekit/components-core';\n\timport { computed } from 'vue';\n\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useMultibandTrackVolume } from '@/composables/useTrackVolume';\n\timport { useMaybeTrackRefContext } from '@/context/track-reference.context';\n\n\texport interface AudioVisualizerProps extends LkStyleProps {\n\t\ttrackRef?: TrackReferenceOrPlaceholder;\n\t}\n\n\tconst props = withDefaults(defineProps<AudioVisualizerProps>(), { trackRef: undefined });\n\n\tconst svgWidth = 200;\n\tconst svgHeight = 90;\n\tconst barWidth = 6;\n\tconst barSpacing = 4;\n\tconst volMultiplier = 50;\n\tconst barCount = 7;\n\tconst offsetX = (svgWidth - barCount * (barWidth + barSpacing)) / 2;\n\n\tconst contextTrackRef = useMaybeTrackRefContext();\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-audio-visualizer']);\n\n\tconst target = computed<TrackReferenceOrPlaceholder | undefined>(() => {\n\t\treturn props.trackRef ?? contextTrackRef?.value;\n\t});\n\n\tconst { frequencyBands } = useMultibandTrackVolume({\n\t\ttrackOrTrackReference: target,\n\t\toptions: { bands: barCount, loPass: 300 },\n\t});\n</script>\n","import {\n\tcomputed,\n\tgetCurrentScope,\n\tonScopeDispose,\n\tref,\n\ttoValue,\n\twatch,\n\ttype ComputedRef,\n\ttype MaybeRefOrGetter,\n} from 'vue';\n\nimport type { AgentState } from '@/types/agent.types';\n\nexport interface UseBarAnimatorProps {\n\treadonly state: MaybeRefOrGetter<AgentState | undefined>;\n\treadonly columns: MaybeRefOrGetter<number>;\n\treadonly interval: MaybeRefOrGetter<number>;\n}\n\nexport interface UseBarAnimator {\n\treadonly highlightedIndices: ComputedRef<number[]>;\n}\n\nfunction connectingSequence(columns: number): number[][] {\n\treturn Array.from({ length: columns }, (_, x) => [x, columns - 1 - x]);\n}\n\nfunction listeningSequence(columns: number): number[][] {\n\treturn [[Math.floor(columns / 2)], [-1]];\n}\n\nfunction sequenceFor(state: AgentState | undefined, columns: number): number[][] {\n\tswitch (state) {\n\t\tcase 'thinking':\n\t\tcase 'listening':\n\t\t\treturn listeningSequence(columns);\n\t\tcase 'connecting':\n\t\tcase 'initializing':\n\t\t\treturn connectingSequence(columns);\n\t\tcase undefined:\n\t\tcase 'speaking':\n\t\t\treturn [Array.from({ length: columns }, (_, idx) => idx)];\n\t\tcase 'disconnected':\n\t\tcase 'failed':\n\t\tcase 'idle':\n\t\tcase 'pre-connect-buffering':\n\t\t\tbreak;\n\t}\n\n\treturn [[]];\n}\n\nexport function useBarAnimator(props: UseBarAnimatorProps): UseBarAnimator {\n\tconst index = ref<number>(0);\n\n\tconst sequence = computed<number[][]>(() => {\n\t\treturn sequenceFor(toValue(props.state), toValue(props.columns));\n\t});\n\n\tconst highlightedIndices = computed<number[]>(() => {\n\t\treturn sequence.value[index.value % sequence.value.length] ?? [];\n\t});\n\n\tlet frame: number | null = null;\n\n\tfunction stop(): void {\n\t\tif (frame !== null && typeof cancelAnimationFrame !== 'undefined') {\n\t\t\tcancelAnimationFrame(frame);\n\t\t}\n\n\t\tframe = null;\n\t}\n\n\twatch(\n\t\t[sequence, () => toValue(props.interval)],\n\t\t([, interval]) => {\n\t\t\tstop();\n\t\t\tindex.value = 0;\n\n\t\t\tif (typeof requestAnimationFrame === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet startTime = performance.now();\n\n\t\t\tfunction animate(time: DOMHighResTimeStamp): void {\n\t\t\t\tif (time - startTime >= interval) {\n\t\t\t\t\tindex.value += 1;\n\t\t\t\t\tstartTime = time;\n\t\t\t\t}\n\n\t\t\t\tframe = requestAnimationFrame(animate);\n\t\t\t}\n\n\t\t\tframe = requestAnimationFrame(animate);\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\tif (getCurrentScope() !== undefined) {\n\t\tonScopeDispose(stop);\n\t}\n\n\tconst barAnimator: UseBarAnimator = {\n\t\thighlightedIndices,\n\t};\n\n\treturn barAnimator;\n}\n","<template>\n\t<div\n\t\tv-bind=\"styleAttrs\"\n\t\t:data-lk-va-state=\"state\"\n\t>\n\t\t<template\n\t\t\tv-for=\"(bar, index) in bars\"\n\t\t\t:key=\"index\"\n\t\t>\n\t\t\t<slot\n\t\t\t\t:index=\"index\"\n\t\t\t\t:volume=\"bar.volume\"\n\t\t\t\t:highlighted=\"bar.attrs['data-lk-highlighted']\"\n\t\t\t\t:attrs=\"bar.attrs\"\n\t\t\t>\n\t\t\t\t<span v-bind=\"bar.attrs\" />\n\t\t\t</slot>\n\t\t</template>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { TrackReferenceOrPlaceholder } from '@livekit/components-core';\n\timport type { LocalAudioTrack, RemoteAudioTrack } from 'livekit-client';\n\timport { computed } from 'vue';\n\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useBarAnimator } from '@/composables/useBarAnimator';\n\timport { useMultibandTrackVolume } from '@/composables/useTrackVolume';\n\timport { useMaybeTrackRefContext } from '@/context/track-reference.context';\n\timport type { AgentState } from '@/types/agent.types';\n\n\texport interface BarVisualizerOptions {\n\t\tmaxHeight?: number;\n\t\tminHeight?: number;\n\t}\n\n\texport interface BarVisualizerProps extends LkStyleProps {\n\t\tstate?: AgentState;\n\t\tbarCount?: number;\n\t\ttrackRef?: TrackReferenceOrPlaceholder;\n\t\ttrack?: LocalAudioTrack | RemoteAudioTrack;\n\t\toptions?: BarVisualizerOptions;\n\t}\n\n\texport interface BarVisualizerBarAttrs {\n\t\tclass: string[];\n\t\tstyle: { height: string };\n\t\t'data-lk-highlighted': boolean;\n\t\t'data-lk-bar-index': number;\n\t}\n\n\tconst props = withDefaults(defineProps<BarVisualizerProps>(), {\n\t\tstate: undefined,\n\t\tbarCount: 15,\n\t\ttrackRef: undefined,\n\t\ttrack: undefined,\n\t\toptions: undefined,\n\t});\n\n\tdefineSlots<{\n\t\tdefault?: (props: {\n\t\t\tindex: number;\n\t\t\tvolume: number;\n\t\t\thighlighted: boolean;\n\t\t\tattrs: BarVisualizerBarAttrs;\n\t\t}) => unknown;\n\t}>();\n\n\tconst contextTrackRef = useMaybeTrackRefContext();\n\tconst { highlightedIndices } = useBarAnimator({\n\t\tstate: () => props.state,\n\t\tcolumns: () => props.barCount,\n\t\tinterval: () => sequencerInterval(props.state, props.barCount),\n\t});\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-audio-bar-visualizer']);\n\n\tconst target = computed<\n\t\tTrackReferenceOrPlaceholder | LocalAudioTrack | RemoteAudioTrack | undefined\n\t>(() => {\n\t\treturn props.trackRef ?? props.track ?? contextTrackRef?.value;\n\t});\n\n\tconst { frequencyBands } = useMultibandTrackVolume({\n\t\ttrackOrTrackReference: target,\n\t\toptions: { bands: props.barCount, loPass: 100, hiPass: 200 },\n\t});\n\n\tconst bars = computed<{ volume: number; attrs: BarVisualizerBarAttrs }[]>(() => {\n\t\tconst minHeight = props.options?.minHeight ?? 20;\n\t\tconst maxHeight = props.options?.maxHeight ?? 100;\n\n\t\treturn frequencyBands.value.map((volume, index) => {\n\t\t\tconst highlighted = highlightedIndices.value.includes(index);\n\n\t\t\treturn {\n\t\t\t\tvolume,\n\t\t\t\tattrs: {\n\t\t\t\t\tclass: highlighted ? ['lk-audio-bar', 'lk-highlighted'] : ['lk-audio-bar'],\n\t\t\t\t\tstyle: { height: `${Math.min(maxHeight, Math.max(minHeight, volume * 100 + 5))}%` },\n\t\t\t\t\t'data-lk-highlighted': highlighted,\n\t\t\t\t\t'data-lk-bar-index': index,\n\t\t\t\t},\n\t\t\t};\n\t\t});\n\t});\n\n\tfunction sequencerInterval(state: AgentState | undefined, barCount: number): number {\n\t\tswitch (state) {\n\t\t\tcase 'connecting':\n\t\t\t\treturn 2000 / barCount;\n\t\t\tcase 'initializing':\n\t\t\t\treturn 2000;\n\t\t\tcase 'listening':\n\t\t\t\treturn 500;\n\t\t\tcase 'thinking':\n\t\t\t\treturn 150;\n\t\t\tdefault:\n\t\t\t\treturn 1000;\n\t\t}\n\t}\n</script>\n","<template>\n\t<div\n\t\tv-bind=\"{ ...styleAttrs, ...attributes }\"\n\t\t@click=\"onClick\"\n\t>\n\t\t<TrackRefContextProvider :track-ref=\"trackReference\">\n\t\t\t<ParticipantContextProvider :participant=\"trackReference.participant\">\n\t\t\t\t<slot :track-ref=\"trackReference\">\n\t\t\t\t\t<AudioTrack\n\t\t\t\t\t\tv-if=\"isTrackReference(trackReference)\"\n\t\t\t\t\t\t:track-ref=\"trackReference\"\n\t\t\t\t\t/>\n\t\t\t\t\t<BarVisualizer\n\t\t\t\t\t\t:bar-count=\"7\"\n\t\t\t\t\t\t:options=\"{ minHeight: 8 }\"\n\t\t\t\t\t/>\n\t\t\t\t\t<div class=\"lk-participant-metadata\">\n\t\t\t\t\t\t<div class=\"lk-participant-metadata-item\">\n\t\t\t\t\t\t\t<TrackMutedIndicator :track-ref=\"trackReference\" />\n\t\t\t\t\t\t\t<ParticipantName />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<ConnectionQualityIndicator class=\"lk-participant-metadata-item\" />\n\t\t\t\t\t</div>\n\t\t\t\t</slot>\n\t\t\t</ParticipantContextProvider>\n\t\t</TrackRefContextProvider>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport {\n\t\tisTrackReference,\n\t\ttype ParticipantClickEvent,\n\t\ttype TrackReferenceOrPlaceholder,\n\t} from '@livekit/components-core';\n\timport { computed } from 'vue';\n\n\timport ParticipantContextProvider from '@/components/context/ParticipantContextProvider.vue';\n\timport TrackRefContextProvider from '@/components/context/TrackRefContextProvider.vue';\n\timport { useStyleAttrs } from '@/components/style';\n\timport { useParticipantTile } from '@/composables/useParticipantTile';\n\timport { useMaybeTrackRefContext } from '@/context/track-reference.context';\n\n\timport AudioTrack from './AudioTrack.vue';\n\timport BarVisualizer from './BarVisualizer.vue';\n\timport ConnectionQualityIndicator from './ConnectionQualityIndicator.vue';\n\timport ParticipantName from './ParticipantName.vue';\n\timport type { ParticipantTileProps } from './ParticipantTile.vue';\n\timport TrackMutedIndicator from './TrackMutedIndicator.vue';\n\n\tconst props = withDefaults(defineProps<ParticipantTileProps>(), {\n\t\ttrackRef: undefined,\n\t\tdisableSpeakingIndicator: undefined,\n\t});\n\n\tconst emits = defineEmits<{ participantClick: [event: ParticipantClickEvent] }>();\n\n\tdefineSlots<{\n\t\tdefault?: (props: { trackRef: TrackReferenceOrPlaceholder }) => unknown;\n\t}>();\n\n\tconst contextTrackRef = useMaybeTrackRefContext();\n\tconst styleAttrs = useStyleAttrs(props, () => [\n\t\t'lk-participant-tile',\n\t\t'lk-participant-audio-tile',\n\t]);\n\n\tconst trackReference = computed<TrackReferenceOrPlaceholder>(() => {\n\t\tconst trackRef = props.trackRef ?? contextTrackRef?.value;\n\n\t\tif (trackRef === undefined) {\n\t\t\tthrow new Error('ParticipantAudioTile needs a trackRef prop or a track reference context.');\n\t\t}\n\n\t\treturn trackRef;\n\t});\n\n\tconst { attributes, onClick } = useParticipantTile({\n\t\ttrackRef: trackReference.value,\n\t\tget disableSpeakingIndicator() {\n\t\t\treturn props.disableSpeakingIndicator;\n\t\t},\n\t\tonParticipantClick: (event) => emits('participantClick', event),\n\t});\n</script>\n","<template>\n\t<div\n\t\tv-bind=\"styleAttrs\"\n\t\trole=\"status\"\n\t\taria-live=\"polite\"\n\t>\n\t\t<slot />\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\n\texport type ToastProps = LkStyleProps;\n\n\tconst props = defineProps<ToastProps>();\n\n\tdefineSlots<{ default?: () => unknown }>();\n\n\tdefineOptions({ name: 'LkToast' });\n\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-toast']);\n</script>\n","<template>\n\t<Toast\n\t\tv-if=\"notification !== undefined\"\n\t\t:size=\"size\"\n\t\t:unstyled=\"unstyled\"\n\t\t:class=\"{ 'lk-toast-connection-state': !unstyled }\"\n\t\t:data-lk-connection-state=\"connectionState\"\n\t>\n\t\t<SpinnerIcon v-if=\"notification.busy\" />\n\t\t{{ notification.label }}\n\t</Toast>\n</template>\n\n<script setup lang=\"ts\">\n\timport { ConnectionState, type Room } from 'livekit-client';\n\timport { computed } from 'vue';\n\n\timport SpinnerIcon from '@/components/icons/SpinnerIcon.vue';\n\timport type { LkStyleProps } from '@/components/style';\n\timport { useConnectionState } from '@/composables/useConnectionState';\n\n\timport Toast from './Toast.vue';\n\n\texport interface ConnectionStateToastProps extends LkStyleProps {\n\t\troom?: Room;\n\t}\n\n\tconst props = defineProps<ConnectionStateToastProps>();\n\n\tconst { connectionState } = useConnectionState({ room: props.room });\n\n\tconst notification = computed<{ label: string; busy: boolean } | undefined>(() => {\n\t\tswitch (connectionState.value) {\n\t\t\tcase ConnectionState.Reconnecting:\n\t\t\tcase ConnectionState.SignalReconnecting:\n\t\t\t\treturn { label: 'Reconnecting', busy: true };\n\t\t\tcase ConnectionState.Connecting:\n\t\t\t\treturn { label: 'Connecting', busy: true };\n\t\t\tcase ConnectionState.Disconnected:\n\t\t\t\treturn { label: 'Disconnected', busy: false };\n\t\t\tdefault:\n\t\t\t\treturn undefined;\n\t\t}\n\t});\n</script>\n","import {\n\tisSourcesWithOptions,\n\tisSourceWitOptions,\n\tlog,\n\ttrackReferencesObservable,\n\ttype SourcesArray,\n\ttype TrackReference,\n\ttype TrackReferenceOrPlaceholder,\n\ttype TrackReferencePlaceholder,\n\ttype TrackSourceWithOptions,\n} from '@livekit/components-core';\nimport { Track, type Participant, type Room, type RoomEvent } from 'livekit-client';\nimport { computed, shallowRef, watchEffect, type ComputedRef, type ShallowRef } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nexport interface UseTracksOptions {\n\treadonly updateOnlyOn?: RoomEvent[];\n\treadonly onlySubscribed?: boolean;\n\treadonly room?: Room;\n}\n\nexport interface UseTracks<T extends SourcesArray = Track.Source[]> {\n\treadonly trackReferences: T extends Track.Source[]\n\t\t? ShallowRef<TrackReference[]>\n\t\t: T extends TrackSourceWithOptions[]\n\t\t\t? ComputedRef<TrackReferenceOrPlaceholder[]>\n\t\t\t: never;\n}\n\nexport interface RequiredPlaceholdersProps {\n\treadonly sources: SourcesArray;\n\treadonly participants: Participant[];\n}\n\nconst DEFAULT_SOURCES: Track.Source[] = [\n\tTrack.Source.Camera,\n\tTrack.Source.Microphone,\n\tTrack.Source.ScreenShare,\n\tTrack.Source.ScreenShareAudio,\n\tTrack.Source.Unknown,\n];\n\nfunction difference<T>(setA: Set<T>, setB: Set<T>): Set<T> {\n\tconst result = new Set(setA);\n\n\tfor (const elem of setB) {\n\t\tresult.delete(elem);\n\t}\n\n\treturn result;\n}\n\nfunction hasTrackReference(\n\ttrackReferences: TrackReferenceOrPlaceholder[],\n\tparticipant: Participant,\n\tsource: Track.Source,\n): boolean {\n\treturn trackReferences.some(({ participant: p, publication }) => {\n\t\treturn participant.identity === p.identity && publication?.source === source;\n\t});\n}\n\nfunction addPlaceholders(\n\ttrackReferences: TrackReferenceOrPlaceholder[],\n\tparticipant: Participant,\n\tsources: Track.Source[],\n): void {\n\tfor (const source of sources) {\n\t\tif (hasTrackReference(trackReferences, participant, source)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlog.debug(`Add ${source} placeholder for participant ${participant.identity}.`);\n\n\t\tconst placeholder: TrackReferencePlaceholder = {\n\t\t\tparticipant,\n\t\t\tsource,\n\t\t};\n\n\t\ttrackReferences.push(placeholder);\n\t}\n}\n\nexport function requiredPlaceholders(\n\tprops: RequiredPlaceholdersProps,\n): Map<Participant['identity'], Track.Source[]> {\n\tconst placeholderMap = new Map<Participant['identity'], Track.Source[]>();\n\n\tif (!isSourcesWithOptions(props.sources)) {\n\t\treturn placeholderMap;\n\t}\n\n\tconst sourcesThatNeedPlaceholder = props.sources\n\t\t.filter((sourceWithOption) => sourceWithOption.withPlaceholder)\n\t\t.map((sourceWithOption) => sourceWithOption.source);\n\n\tfor (const participant of props.participants) {\n\t\tconst sourcesOfSubscribedTracks = participant\n\t\t\t.getTrackPublications()\n\t\t\t.map((pub) => pub.track?.source)\n\t\t\t.filter((trackSource): trackSource is Track.Source => trackSource !== undefined);\n\t\tconst placeholderNeededForThisParticipant = Array.from(\n\t\t\tdifference(new Set(sourcesThatNeedPlaceholder), new Set(sourcesOfSubscribedTracks)),\n\t\t);\n\n\t\tif (placeholderNeededForThisParticipant.length > 0) {\n\t\t\tplaceholderMap.set(participant.identity, placeholderNeededForThisParticipant);\n\t\t}\n\t}\n\n\treturn placeholderMap;\n}\n\nexport function useTracks(sources?: undefined, options?: UseTracksOptions): UseTracks;\nexport function useTracks<T extends SourcesArray>(\n\tsources: T,\n\toptions?: UseTracksOptions,\n): UseTracks<T>;\nexport function useTracks(\n\tsources: SourcesArray = DEFAULT_SOURCES,\n\toptions: UseTracksOptions = {},\n): UseTracks | UseTracks<TrackSourceWithOptions[]> {\n\tconst room = useEnsureRoomContext(options.room);\n\tconst participants = shallowRef<Participant[]>([]);\n\tconst trackReferences = shallowRef<TrackReference[]>([]);\n\n\tconst computedSources = computed<Track.Source[]>(() => {\n\t\treturn sources.map((s) => (isSourceWitOptions(s) ? s.source : s));\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = trackReferencesObservable(room.value, computedSources.value, {\n\t\t\tadditionalRoomEvents: options.updateOnlyOn,\n\t\t\tonlySubscribed: options.onlySubscribed,\n\t\t}).subscribe({\n\t\t\tnext: (data) => {\n\t\t\t\tlog.debug('Updating track references:', data);\n\t\t\t\ttrackReferences.value = data.trackReferences;\n\t\t\t\tparticipants.value = data.participants;\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in track references subscription:', error);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tif (!isSourcesWithOptions(sources)) {\n\t\tconst result: UseTracks = {\n\t\t\ttrackReferences,\n\t\t};\n\n\t\treturn result;\n\t}\n\n\tconst trackReferencesWithPlaceholders = computed<TrackReferenceOrPlaceholder[]>(() => {\n\t\tconst requirePlaceholder = requiredPlaceholders({\n\t\t\tsources,\n\t\t\tparticipants: participants.value,\n\t\t});\n\t\tconst references: TrackReferenceOrPlaceholder[] = [...trackReferences.value];\n\n\t\tfor (const participant of participants.value) {\n\t\t\tconst sourcesToAddPlaceholder = requirePlaceholder.get(participant.identity);\n\n\t\t\tif (sourcesToAddPlaceholder !== undefined) {\n\t\t\t\taddPlaceholders(references, participant, sourcesToAddPlaceholder);\n\t\t\t}\n\t\t}\n\n\t\treturn references;\n\t});\n\n\tconst result: UseTracks<TrackSourceWithOptions[]> = {\n\t\ttrackReferences: trackReferencesWithPlaceholders,\n\t};\n\n\treturn result;\n}\n","import { ConnectionState } from 'livekit-client';\nimport { computed, type ComputedRef } from 'vue';\n\nimport { useConnectionState, type ConnectionStateProps } from './useConnectionState';\n\nexport interface UseConnectionStatus {\n\treadonly connectionState: ComputedRef<ConnectionState>;\n\treadonly statusText: ComputedRef<string>;\n\treadonly isConnecting: ComputedRef<boolean>;\n\treadonly isConnected: ComputedRef<boolean>;\n\treadonly isReconnecting: ComputedRef<boolean>;\n\treadonly isDisconnected: ComputedRef<boolean>;\n\treadonly attributes: ComputedRef<Record<string, unknown>>;\n}\n\nexport interface ConnectionStatusProps extends ConnectionStateProps {\n\treadonly statusMessages?: Partial<Record<ConnectionState, string>>;\n}\n\nconst DEFAULT_STATUS_MESSAGES: Readonly<Record<ConnectionState, string>> = {\n\t[ConnectionState.Connecting]: 'Connecting...',\n\t[ConnectionState.Connected]: 'Connected',\n\t[ConnectionState.Disconnected]: 'Disconnected',\n\t[ConnectionState.Reconnecting]: 'Reconnecting...',\n\t[ConnectionState.SignalReconnecting]: 'Reconnecting to signal...',\n};\n\nexport function useConnectionStatus(props: ConnectionStatusProps = {}): UseConnectionStatus {\n\tconst { connectionState } = useConnectionState({ room: props.room });\n\n\tconst currentState = computed<ConnectionState>(() => {\n\t\treturn connectionState.value;\n\t});\n\n\tconst statusText = computed<string>(() => {\n\t\tconst customMessage = props.statusMessages?.[connectionState.value];\n\n\t\treturn customMessage ?? DEFAULT_STATUS_MESSAGES[connectionState.value];\n\t});\n\n\tconst isConnecting = computed<boolean>(() => {\n\t\treturn connectionState.value === ConnectionState.Connecting;\n\t});\n\n\tconst isConnected = computed<boolean>(() => {\n\t\treturn connectionState.value === ConnectionState.Connected;\n\t});\n\n\tconst isReconnecting = computed<boolean>(() => {\n\t\treturn connectionState.value === ConnectionState.Reconnecting;\n\t});\n\n\tconst isDisconnected = computed<boolean>(() => {\n\t\treturn connectionState.value === ConnectionState.Disconnected;\n\t});\n\n\tconst attributes = computed<Record<string, unknown>>(() => {\n\t\treturn {\n\t\t\t'lk-connection-connected': isConnected.value,\n\t\t\t'lk-connection-connecting': isConnecting.value,\n\t\t\t'lk-connection-disconnected': isDisconnected.value,\n\t\t\t'lk-connection-reconnecting': isReconnecting.value,\n\t\t};\n\t});\n\n\tconst connectionStatus: UseConnectionStatus = {\n\t\tconnectionState: currentState,\n\t\tstatusText,\n\t\tisConnecting,\n\t\tisConnected,\n\t\tisReconnecting,\n\t\tisDisconnected,\n\t\tattributes,\n\t};\n\n\treturn connectionStatus;\n}\n","import {\n\tlog,\n\tsetupChat,\n\ttype ChatOptions,\n\ttype ReceivedChatMessage,\n} from '@livekit/components-core';\nimport { ConnectionState, type Room, type SendTextOptions } from 'livekit-client';\nimport { computed, ref, shallowRef, watchEffect, type Ref } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nimport { useConnectionStatus } from './useConnectionStatus';\n\nexport interface UseChat {\n\treadonly chatMessages: Ref<ReceivedChatMessage[]>;\n\treadonly isSending: Ref<boolean>;\n\treadonly send: (message: string, options?: SendTextOptions) => Promise<ReceivedChatMessage>;\n}\n\nexport interface UseChatProps {\n\treadonly options?: ChatOptions;\n\treadonly room?: Room;\n}\n\nexport function useChat(props: UseChatProps = {}): UseChat {\n\tconst room = useEnsureRoomContext(props.room);\n\tconst { connectionState } = useConnectionStatus({ room: room.value });\n\n\tconst isSendingRef = ref<boolean>(false);\n\tconst chatMessagesRef = shallowRef<ReceivedChatMessage[]>([]);\n\n\tconst isDisconnected = computed<boolean>(() => {\n\t\treturn connectionState.value === ConnectionState.Disconnected;\n\t});\n\n\tconst chatSetup = computed<ReturnType<typeof setupChat>>(() => {\n\t\treturn setupChat(room.value, props.options);\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\tconst messagesSub = chatSetup.value.messageObservable.subscribe({\n\t\t\tnext: (messages: ReceivedChatMessage[]) => {\n\t\t\t\tchatMessagesRef.value = messages;\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error subscribing to chat messages:', error);\n\t\t\t},\n\t\t});\n\n\t\tconst sendingSub = chatSetup.value.isSendingObservable.subscribe({\n\t\t\tnext: (isSending: boolean) => {\n\t\t\t\tisSendingRef.value = isSending;\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error subscribing to chat sending state:', error);\n\t\t\t},\n\t\t});\n\n\t\tif (isDisconnected.value) {\n\t\t\tchatMessagesRef.value = [];\n\t\t}\n\n\t\tonCleanup(() => {\n\t\t\tmessagesSub.unsubscribe();\n\t\t\tsendingSub.unsubscribe();\n\t\t});\n\t});\n\n\tfunction send(message: string, options?: SendTextOptions): Promise<ReceivedChatMessage> {\n\t\treturn chatSetup.value.send(message, options);\n\t}\n\n\tconst chat: UseChat = {\n\t\tisSending: isSendingRef,\n\t\tchatMessages: chatMessagesRef,\n\t\tsend,\n\t};\n\n\treturn chat;\n}\n","<template>\n\t<div v-bind=\"styleAttrs\">\n\t\t<div class=\"lk-chat-header\">\n\t\t\t<slot name=\"header\">Messages</slot>\n\t\t\t<ChatToggle\n\t\t\t\tv-if=\"layout !== undefined\"\n\t\t\t\tclass=\"lk-close-button\"\n\t\t\t\taria-label=\"Close chat\"\n\t\t\t>\n\t\t\t\t<ChatCloseIcon />\n\t\t\t</ChatToggle>\n\t\t</div>\n\t\t<ul\n\t\t\tv-if=\"chatMessages.length > 0\"\n\t\t\tref=\"list\"\n\t\t\tclass=\"lk-list lk-chat-messages\"\n\t\t>\n\t\t\t<template\n\t\t\t\tv-for=\"(entry, index) in chatMessages\"\n\t\t\t\t:key=\"entry.id ?? index\"\n\t\t\t>\n\t\t\t\t<slot\n\t\t\t\t\t:entry=\"entry\"\n\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t:hide-name=\"hideName(index)\"\n\t\t\t\t\t:hide-timestamp=\"hideTimestamp(index)\"\n\t\t\t\t>\n\t\t\t\t\t<ChatEntry\n\t\t\t\t\t\t:entry=\"entry\"\n\t\t\t\t\t\t:hide-name=\"hideName(index)\"\n\t\t\t\t\t\t:hide-timestamp=\"hideTimestamp(index)\"\n\t\t\t\t\t\t:message-formatter=\"messageFormatter\"\n\t\t\t\t\t/>\n\t\t\t\t</slot>\n\t\t\t</template>\n\t\t</ul>\n\t\t<div\n\t\t\tv-else\n\t\t\tclass=\"lk-chat-empty\"\n\t\t>\n\t\t\t<slot name=\"empty\">\n\t\t\t\t<span class=\"lk-chat-empty-icon\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclass=\"lk-icon\"\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tfocusable=\"false\"\n\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\twidth=\"24\"\n\t\t\t\t\t\theight=\"24\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\td=\"M4 5.5A1.5 1.5 0 0 1 5.5 4h13A1.5 1.5 0 0 1 20 5.5v9a1.5 1.5 0 0 1-1.5 1.5H9l-5 4z\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<path d=\"M8 8.5h8M8 12h5\" />\n\t\t\t\t\t</svg>\n\t\t\t\t</span>\n\t\t\t\t<p class=\"lk-chat-empty-title\">No messages yet</p>\n\t\t\t\t<p class=\"lk-chat-empty-hint\">\n\t\t\t\t\tEveryone in the room sees what you send. Press Enter to send, Shift+Enter for a new line.\n\t\t\t\t</p>\n\t\t\t</slot>\n\t\t</div>\n\t\t<form\n\t\t\tref=\"form\"\n\t\t\tclass=\"lk-chat-form\"\n\t\t\t@submit.prevent=\"handleSubmit\"\n\t\t>\n\t\t\t<textarea\n\t\t\t\tref=\"input\"\n\t\t\t\tv-model=\"draft\"\n\t\t\t\tclass=\"lk-form-control lk-chat-form-input\"\n\t\t\t\trows=\"1\"\n\t\t\t\taria-label=\"Message\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:disabled=\"isSending\"\n\t\t\t\t@keydown=\"onKeydown\"\n\t\t\t\t@keyup.stop\n\t\t\t\t@input.stop\n\t\t\t/>\n\t\t\t<button\n\t\t\t\ttype=\"submit\"\n\t\t\t\tclass=\"lk-button lk-chat-form-button\"\n\t\t\t\taria-label=\"Send\"\n\t\t\t\ttitle=\"Send\"\n\t\t\t\t:disabled=\"isSending || draft.trim() === ''\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\tclass=\"lk-icon\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tfocusable=\"false\"\n\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\twidth=\"16\"\n\t\t\t\t\theight=\"16\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"1.75\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path d=\"M8 13V3M3.5 7.5 8 3l4.5 4.5\" />\n\t\t\t\t</svg>\n\t\t\t</button>\n\t\t</form>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { ChatOptions, ReceivedChatMessage } from '@livekit/components-core';\n\timport { nextTick, ref, useTemplateRef, watch } from 'vue';\n\n\timport type { MessageFormatter } from '@/components/chat/chat.utils';\n\timport ChatEntry from '@/components/chat/ChatEntry.vue';\n\timport ChatToggle from '@/components/controls/ChatToggle.vue';\n\timport ChatCloseIcon from '@/components/icons/ChatCloseIcon.vue';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useChat } from '@/composables/useChat';\n\timport { useMaybeLayoutContext } from '@/context/layout.context';\n\n\texport interface ChatProps extends LkStyleProps, ChatOptions {\n\t\tmessageFormatter?: MessageFormatter;\n\t\tplaceholder?: string;\n\t}\n\n\tconst props = withDefaults(defineProps<ChatProps>(), {\n\t\tmessageFormatter: undefined,\n\t\tmessageDecoder: undefined,\n\t\tmessageEncoder: undefined,\n\t\tchannelTopic: undefined,\n\t\tplaceholder: 'Enter a message...',\n\t});\n\n\tdefineSlots<{\n\t\tdefault?: (props: {\n\t\t\tentry: ReceivedChatMessage;\n\t\t\tindex: number;\n\t\t\thideName: boolean;\n\t\t\thideTimestamp: boolean;\n\t\t}) => unknown;\n\t\theader?: () => unknown;\n\t\tempty?: () => unknown;\n\t}>();\n\n\tconst emit = defineEmits<{\n\t\tsendError: [error: unknown];\n\t}>();\n\n\tdefineOptions({ name: 'LkChat' });\n\n\tlet lastReadAt: number = 0;\n\n\tconst list = useTemplateRef<HTMLUListElement>('list');\n\tconst input = useTemplateRef<HTMLTextAreaElement>('input');\n\tconst form = useTemplateRef<HTMLFormElement>('form');\n\tconst { chatMessages, send, isSending } = useChat({\n\t\toptions: {\n\t\t\tmessageDecoder: props.messageDecoder,\n\t\t\tmessageEncoder: props.messageEncoder,\n\t\t\tchannelTopic: props.channelTopic,\n\t\t},\n\t});\n\tconst layout = useMaybeLayoutContext();\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-chat']);\n\n\tconst draft = ref<string>('');\n\n\tfunction hideName(index: number): boolean {\n\t\tconst previous = chatMessages.value[index - 1];\n\t\tconst current = chatMessages.value[index];\n\n\t\treturn previous !== undefined && current !== undefined && previous.from === current.from;\n\t}\n\n\tfunction hideTimestamp(index: number): boolean {\n\t\tconst previous = chatMessages.value[index - 1];\n\t\tconst current = chatMessages.value[index];\n\n\t\tif (previous === undefined || current === undefined || !hideName(index)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn current.timestamp - previous.timestamp < 60_000;\n\t}\n\n\tasync function handleSubmit(): Promise<void> {\n\t\tconst message = draft.value.trim();\n\n\t\tif (message === '') {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tawait send(message);\n\t\t} catch (error) {\n\t\t\temit('sendError', error);\n\t\t\treturn;\n\t\t}\n\n\t\tdraft.value = '';\n\t\tawait nextTick();\n\t\tinput.value?.focus();\n\t}\n\n\tfunction onKeydown(event: KeyboardEvent): void {\n\t\tevent.stopPropagation();\n\n\t\tif (event.key !== 'Enter' || event.shiftKey || event.isComposing) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tform.value?.requestSubmit();\n\t}\n\n\tfunction fitDraft(): void {\n\t\tconst element = input.value;\n\n\t\tif (element === null) {\n\t\t\treturn;\n\t\t}\n\n\t\telement.style.blockSize = 'auto';\n\t\telement.style.blockSize = `${element.scrollHeight + element.offsetHeight - element.clientHeight}px`;\n\t\telement.style.overflowY = element.scrollHeight > element.clientHeight ? 'auto' : 'hidden';\n\t}\n\n\twatch(draft, fitDraft, { flush: 'post' });\n\n\twatch(\n\t\tchatMessages,\n\t\tasync () => {\n\t\t\tawait nextTick();\n\n\t\t\tif (list.value !== null) {\n\t\t\t\tlist.value.scrollTop = list.value.scrollHeight;\n\t\t\t}\n\t\t},\n\t\t{ flush: 'post' },\n\t);\n\n\twatch(\n\t\t() => [chatMessages.value, layout?.value.widget.state.value.showChat] as const,\n\t\t([messages, showChat]) => {\n\t\t\tif (layout === undefined || messages.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst lastMessage = messages.at(-1);\n\n\t\t\tif (lastMessage === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (showChat === true) {\n\t\t\t\tlastReadAt = lastMessage.timestamp;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst unread = messages.filter((msg) => msg.timestamp > lastReadAt).length;\n\t\t\tconst { widget } = layout.value;\n\n\t\t\tif (unread > 0 && widget.state.value.unreadMessages !== unread) {\n\t\t\t\twidget.dispatch({ msg: 'unread_msg', count: unread });\n\t\t\t}\n\t\t},\n\t\t{ immediate: true },\n\t);\n</script>\n","import { ParticipantEvent, type Participant } from 'livekit-client';\nimport { shallowRef, watchEffect, type ShallowRef } from 'vue';\n\nimport type { ParticipantPermission } from '@/types/participant.types';\n\nexport function usePermissionsOf(\n\tparticipant: () => Participant,\n): ShallowRef<ParticipantPermission | undefined> {\n\tconst permissions = shallowRef<ParticipantPermission | undefined>(undefined);\n\n\twatchEffect((onCleanup) => {\n\t\tconst current = participant();\n\n\t\tfunction update(): void {\n\t\t\tpermissions.value = current.permissions;\n\t\t}\n\n\t\tupdate();\n\t\tcurrent.on(ParticipantEvent.ParticipantPermissionsChanged, update);\n\n\t\tonCleanup(() => {\n\t\t\tcurrent.off(ParticipantEvent.ParticipantPermissionsChanged, update);\n\t\t});\n\t});\n\n\treturn permissions;\n}\n","import type { Room } from 'livekit-client';\nimport type { ShallowRef } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\nimport { usePermissionsOf } from '@/internal/permissions';\nimport type { ParticipantPermission } from '@/types/participant.types';\n\nexport interface UseLocalParticipantPermissionsOptions {\n\treadonly room?: Room;\n}\n\nexport interface UseLocalParticipantPermissions {\n\treadonly permissions: ShallowRef<ParticipantPermission | undefined>;\n}\n\nexport interface UseLocalParticipantPermissionsProps {\n\treadonly options: UseLocalParticipantPermissionsOptions;\n}\n\nexport function useLocalParticipantPermissions(\n\tprops: UseLocalParticipantPermissionsProps,\n): UseLocalParticipantPermissions {\n\tconst room = useEnsureRoomContext(props.options.room);\n\n\tconst permissions = usePermissionsOf(() => room.value.localParticipant);\n\n\tconst result: UseLocalParticipantPermissions = {\n\t\tpermissions,\n\t};\n\n\treturn result;\n}\n","import {\n\tdefaultUserChoices,\n\tloadUserChoices,\n\tlog,\n\tsaveUserChoices,\n\ttype LocalUserChoices,\n} from '@livekit/components-core';\nimport { ref, watchEffect, type Ref } from 'vue';\n\nexport interface UsePersistentUserChoicesProps {\n\treadonly defaults?: Partial<LocalUserChoices>;\n\treadonly preventSave?: boolean;\n\treadonly preventLoad?: boolean;\n}\n\nexport interface UsePersistentUserChoices {\n\treadonly userChoices: Ref<LocalUserChoices>;\n\treadonly saveAudioInputEnabled: (enabled: boolean) => void;\n\treadonly saveVideoInputEnabled: (enabled: boolean) => void;\n\treadonly saveAudioInputDeviceId: (deviceId: string) => void;\n\treadonly saveVideoInputDeviceId: (deviceId: string) => void;\n\treadonly saveUsername: (username: string) => void;\n}\n\nfunction getInitialChoices(props: UsePersistentUserChoicesProps): LocalUserChoices {\n\ttry {\n\t\treturn loadUserChoices(props.defaults, props.preventLoad ?? false);\n\t} catch (error) {\n\t\tlog.error('Error loading user choices:', error);\n\n\t\treturn { ...defaultUserChoices, ...props.defaults };\n\t}\n}\n\nexport function usePersistentUserChoices(\n\tprops: UsePersistentUserChoicesProps = {},\n): UsePersistentUserChoices {\n\tconst userChoices = ref<LocalUserChoices>(getInitialChoices(props));\n\n\tfunction saveAudioInputDeviceId(deviceId: string): void {\n\t\tuserChoices.value = { ...userChoices.value, audioDeviceId: deviceId };\n\t}\n\n\tfunction saveVideoInputDeviceId(deviceId: string): void {\n\t\tuserChoices.value = { ...userChoices.value, videoDeviceId: deviceId };\n\t}\n\n\tfunction saveAudioInputEnabled(enabled: boolean): void {\n\t\tuserChoices.value = { ...userChoices.value, audioEnabled: enabled };\n\t}\n\n\tfunction saveVideoInputEnabled(enabled: boolean): void {\n\t\tuserChoices.value = { ...userChoices.value, videoEnabled: enabled };\n\t}\n\n\tfunction saveUsername(username: string): void {\n\t\tuserChoices.value = { ...userChoices.value, username };\n\t}\n\n\twatchEffect(() => {\n\t\ttry {\n\t\t\tsaveUserChoices(userChoices.value, props.preventSave ?? false);\n\t\t} catch (error) {\n\t\t\tlog.error('Error saving user choices:', error);\n\t\t}\n\t});\n\n\tconst result: UsePersistentUserChoices = {\n\t\tuserChoices,\n\t\tsaveAudioInputEnabled,\n\t\tsaveVideoInputEnabled,\n\t\tsaveAudioInputDeviceId,\n\t\tsaveVideoInputDeviceId,\n\t\tsaveUsername,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<button\n\t\tref=\"button\"\n\t\ttype=\"button\"\n\t\tv-bind=\"$attrs\"\n\t\t:class=\"styleAttrs.class\"\n\t\t:data-lk-size=\"styleAttrs['data-lk-size']\"\n\t\t:aria-pressed=\"open\"\n\t\taria-haspopup=\"listbox\"\n\t\t:disabled=\"disabled\"\n\t\t@click=\"open = !open\"\n\t>\n\t\t<slot :open=\"open\" />\n\t</button>\n\t<div\n\t\tv-if=\"!disabled\"\n\t\tref=\"menu\"\n\t\tv-bind=\"menuAttrs\"\n\t\t:data-lk-open=\"open\"\n\t\t:style=\"{ visibility: open ? 'visible' : 'hidden' }\"\n\t>\n\t\t<slot\n\t\t\tname=\"prepend\"\n\t\t\t:kind=\"kind\"\n\t\t\t:close=\"close\"\n\t\t/>\n\t\t<MediaDeviceSelect\n\t\t\tv-if=\"kind !== undefined\"\n\t\t\t:kind=\"kind\"\n\t\t\t:initial-selection=\"initialSelection\"\n\t\t\t:track=\"tracks?.[kind]\"\n\t\t\t:request-permissions=\"needPermissions\"\n\t\t\t:unstyled=\"unstyled\"\n\t\t\t@update:active-device-id=\"handleActiveDeviceChange(kind, $event)\"\n\t\t/>\n\t\t<template v-else>\n\t\t\t<div class=\"lk-device-menu-heading\">Audio inputs</div>\n\t\t\t<MediaDeviceSelect\n\t\t\t\tkind=\"audioinput\"\n\t\t\t\t:track=\"tracks?.audioinput\"\n\t\t\t\t:request-permissions=\"needPermissions\"\n\t\t\t\t:unstyled=\"unstyled\"\n\t\t\t\t@update:active-device-id=\"handleActiveDeviceChange('audioinput', $event)\"\n\t\t\t/>\n\t\t\t<div class=\"lk-device-menu-heading\">Video inputs</div>\n\t\t\t<MediaDeviceSelect\n\t\t\t\tkind=\"videoinput\"\n\t\t\t\t:track=\"tracks?.videoinput\"\n\t\t\t\t:request-permissions=\"needPermissions\"\n\t\t\t\t:unstyled=\"unstyled\"\n\t\t\t\t@update:active-device-id=\"handleActiveDeviceChange('videoinput', $event)\"\n\t\t\t/>\n\t\t</template>\n\t\t<slot\n\t\t\tname=\"append\"\n\t\t\t:kind=\"kind\"\n\t\t\t:close=\"close\"\n\t\t/>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport { computeMenuPosition, wasClickOutside } from '@livekit/components-core';\n\timport { useEventListener } from '@vueuse/core';\n\timport type { LocalAudioTrack, LocalVideoTrack } from 'livekit-client';\n\timport { ref, useTemplateRef, watch, watchEffect } from 'vue';\n\n\timport MediaDeviceSelect from '@/components/controls/MediaDeviceSelect.vue';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\n\texport interface MediaDeviceMenuProps extends LkStyleProps {\n\t\tkind?: MediaDeviceKind;\n\t\tinitialSelection?: string;\n\t\ttracks?: Partial<Record<MediaDeviceKind, LocalAudioTrack | LocalVideoTrack | undefined>>;\n\t\trequestPermissions?: boolean;\n\t\tdisabled?: boolean;\n\t}\n\n\tconst props = withDefaults(defineProps<MediaDeviceMenuProps>(), {\n\t\tkind: undefined,\n\t\tinitialSelection: undefined,\n\t\ttracks: undefined,\n\t\trequestPermissions: false,\n\t\tdisabled: false,\n\t});\n\n\texport interface MediaDeviceMenuSlotProps {\n\t\tkind: MediaDeviceKind | undefined;\n\t\tclose: () => void;\n\t}\n\n\tconst emits = defineEmits<{ activeDeviceChange: [kind: MediaDeviceKind, deviceId: string] }>();\n\n\tconst open = defineModel<boolean>('open', { default: false });\n\n\tdefineSlots<{\n\t\tdefault?: (props: { open: boolean }) => unknown;\n\t\tprepend?: (props: MediaDeviceMenuSlotProps) => unknown;\n\t\tappend?: (props: MediaDeviceMenuSlotProps) => unknown;\n\t}>();\n\n\tdefineOptions({ inheritAttrs: false });\n\n\tconst button = useTemplateRef<HTMLButtonElement>('button');\n\tconst menu = useTemplateRef<HTMLDivElement>('menu');\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-button', 'lk-button-menu']);\n\tconst menuAttrs = useStyleAttrs(props, () => ['lk-device-menu']);\n\n\tconst needPermissions = ref<boolean>(props.requestPermissions);\n\n\tfunction close(): void {\n\t\topen.value = false;\n\t}\n\n\tfunction handleActiveDeviceChange(kind: MediaDeviceKind, deviceId: string | undefined): void {\n\t\tif (deviceId === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\topen.value = false;\n\t\temits('activeDeviceChange', kind, deviceId);\n\t}\n\n\tuseEventListener(\n\t\t() => (typeof document === 'undefined' ? undefined : document),\n\t\t'click',\n\t\t(event: MouseEvent) => {\n\t\t\tif (!open.value || menu.value === null || button.value === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.target instanceof Node && button.value.contains(event.target)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (wasClickOutside(menu.value, event)) {\n\t\t\t\topen.value = false;\n\t\t\t}\n\t\t},\n\t);\n\n\twatch(\n\t\topen,\n\t\t(isOpen) => {\n\t\t\tif (isOpen) {\n\t\t\t\tneedPermissions.value = true;\n\t\t\t}\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\twatchEffect((onCleanup) => {\n\t\tif (!open.value || button.value === null || menu.value === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst target = menu.value;\n\t\tconst cleanup = computeMenuPosition(button.value, target, (x, y) => {\n\t\t\tObject.assign(target.style, { left: `${x}px`, top: `${y}px` });\n\t\t});\n\n\t\tonCleanup(cleanup);\n\t});\n</script>\n","<template>\n\t<div\n\t\tv-bind=\"styleAttrs\"\n\t\t:data-lk-variation=\"variation\"\n\t>\n\t\t<div\n\t\t\tv-if=\"visibleControls.microphone\"\n\t\t\tclass=\"lk-button-group\"\n\t\t>\n\t\t\t<TrackToggle\n\t\t\t\t:source=\"Track.Source.Microphone\"\n\t\t\t\t:show-icon=\"showIcon\"\n\t\t\t\t:aria-label=\"iconLabel('Microphone')\"\n\t\t\t\t:title=\"iconLabel('Microphone')\"\n\t\t\t\t@change=\"onMicrophoneChange\"\n\t\t\t\t@device-error=\"emits('deviceError', { source: Track.Source.Microphone, error: $event })\"\n\t\t\t>\n\t\t\t\t<template v-if=\"showText\">Microphone</template>\n\t\t\t</TrackToggle>\n\t\t\t<div class=\"lk-button-group-menu\">\n\t\t\t\t<MediaDeviceMenu\n\t\t\t\t\tkind=\"audioinput\"\n\t\t\t\t\taria-label=\"Choose a microphone\"\n\t\t\t\t\t@active-device-change=\"(_kind, deviceId) => saveAudioInputDeviceId(deviceId ?? 'default')\"\n\t\t\t\t>\n\t\t\t\t\t<template\n\t\t\t\t\t\tv-if=\"slots['microphone-menu'] !== undefined\"\n\t\t\t\t\t\t#append=\"{ close }\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname=\"microphone-menu\"\n\t\t\t\t\t\t\t:track=\"localMicrophoneTrack\"\n\t\t\t\t\t\t\t:close=\"close\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</template>\n\t\t\t\t</MediaDeviceMenu>\n\t\t\t</div>\n\t\t</div>\n\t\t<div\n\t\t\tv-if=\"visibleControls.camera\"\n\t\t\tclass=\"lk-button-group\"\n\t\t>\n\t\t\t<TrackToggle\n\t\t\t\t:source=\"Track.Source.Camera\"\n\t\t\t\t:show-icon=\"showIcon\"\n\t\t\t\t:aria-label=\"iconLabel('Camera')\"\n\t\t\t\t:title=\"iconLabel('Camera')\"\n\t\t\t\t@change=\"onCameraChange\"\n\t\t\t\t@device-error=\"emits('deviceError', { source: Track.Source.Camera, error: $event })\"\n\t\t\t>\n\t\t\t\t<template v-if=\"showText\">Camera</template>\n\t\t\t</TrackToggle>\n\t\t\t<div class=\"lk-button-group-menu\">\n\t\t\t\t<MediaDeviceMenu\n\t\t\t\t\tkind=\"videoinput\"\n\t\t\t\t\taria-label=\"Choose a camera\"\n\t\t\t\t\t@active-device-change=\"(_kind, deviceId) => saveVideoInputDeviceId(deviceId ?? 'default')\"\n\t\t\t\t>\n\t\t\t\t\t<template\n\t\t\t\t\t\tv-if=\"slots['camera-menu'] !== undefined\"\n\t\t\t\t\t\t#append=\"{ close }\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname=\"camera-menu\"\n\t\t\t\t\t\t\t:track=\"localCameraTrack\"\n\t\t\t\t\t\t\t:close=\"close\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</template>\n\t\t\t\t</MediaDeviceMenu>\n\t\t\t</div>\n\t\t</div>\n\t\t<TrackToggle\n\t\t\tv-if=\"visibleControls.screenShare && browserSupportsScreenSharing\"\n\t\t\t:source=\"Track.Source.ScreenShare\"\n\t\t\t:capture-options=\"{ audio: true, selfBrowserSurface: 'include' }\"\n\t\t\t:show-icon=\"showIcon\"\n\t\t\t:aria-label=\"iconLabel(screenShareLabel)\"\n\t\t\t:title=\"iconLabel(screenShareLabel)\"\n\t\t\t@change=\"(enabled: boolean) => (isScreenShareEnabled = enabled)\"\n\t\t\t@device-error=\"emits('deviceError', { source: Track.Source.ScreenShare, error: $event })\"\n\t\t>\n\t\t\t<template v-if=\"showText\">{{ screenShareLabel }}</template>\n\t\t</TrackToggle>\n\t\t<ChatToggle\n\t\t\tv-if=\"visibleControls.chat\"\n\t\t\t:aria-label=\"iconLabel('Chat')\"\n\t\t\t:title=\"iconLabel('Chat')\"\n\t\t>\n\t\t\t<ChatIcon v-if=\"showIcon\" />\n\t\t\t<template v-if=\"showText\">Chat</template>\n\t\t</ChatToggle>\n\t\t<SettingsMenuToggle\n\t\t\tv-if=\"visibleControls.settings\"\n\t\t\t:aria-label=\"iconLabel('Settings')\"\n\t\t\t:title=\"iconLabel('Settings')\"\n\t\t>\n\t\t\t<GearIcon v-if=\"showIcon\" />\n\t\t\t<template v-if=\"showText\">Settings</template>\n\t\t</SettingsMenuToggle>\n\t\t<DisconnectButton\n\t\t\tv-if=\"visibleControls.leave\"\n\t\t\t:aria-label=\"iconLabel('Leave')\"\n\t\t\t:title=\"iconLabel('Leave')\"\n\t\t>\n\t\t\t<LeaveIcon v-if=\"showIcon\" />\n\t\t\t<template v-if=\"showText\">Leave</template>\n\t\t</DisconnectButton>\n\t\t<StartMediaButton />\n\t\t<slot />\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport { supportsScreenSharing } from '@livekit/components-core';\n\timport { LocalAudioTrack, LocalVideoTrack, Track } from 'livekit-client';\n\timport { computed, ref } from 'vue';\n\n\timport ChatToggle from '@/components/controls/ChatToggle.vue';\n\timport DisconnectButton from '@/components/controls/DisconnectButton.vue';\n\timport SettingsMenuToggle from '@/components/controls/SettingsMenuToggle.vue';\n\timport StartMediaButton from '@/components/controls/StartMediaButton.vue';\n\timport TrackToggle from '@/components/controls/TrackToggle.vue';\n\timport ChatIcon from '@/components/icons/ChatIcon.vue';\n\timport GearIcon from '@/components/icons/GearIcon.vue';\n\timport LeaveIcon from '@/components/icons/LeaveIcon.vue';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useLocalParticipant } from '@/composables/useLocalParticipant';\n\timport { useLocalParticipantPermissions } from '@/composables/useLocalParticipantPermissions';\n\timport { usePersistentUserChoices } from '@/composables/usePersistentUserChoices';\n\n\timport MediaDeviceMenu from './MediaDeviceMenu.vue';\n\n\texport interface ControlBarControls {\n\t\tmicrophone?: boolean;\n\t\tcamera?: boolean;\n\t\tchat?: boolean;\n\t\tscreenShare?: boolean;\n\t\tleave?: boolean;\n\t\tsettings?: boolean;\n\t}\n\n\texport interface CameraMenuSlotProps {\n\t\ttrack: LocalVideoTrack | undefined;\n\t\tclose: () => void;\n\t}\n\n\texport interface MicrophoneMenuSlotProps {\n\t\ttrack: LocalAudioTrack | undefined;\n\t\tclose: () => void;\n\t}\n\n\texport type ControlBarVariation = 'minimal' | 'verbose' | 'textOnly';\n\n\texport interface ControlBarProps extends LkStyleProps {\n\t\tvariation?: ControlBarVariation;\n\t\tcontrols?: ControlBarControls;\n\t\tsaveUserChoices?: boolean;\n\t}\n\n\tconst props = withDefaults(defineProps<ControlBarProps>(), {\n\t\tvariation: 'minimal',\n\t\tcontrols: undefined,\n\t\tsaveUserChoices: true,\n\t});\n\n\tconst emits = defineEmits<{ deviceError: [payload: { source: Track.Source; error: unknown }] }>();\n\n\tconst slots = defineSlots<{\n\t\tdefault?: () => unknown;\n\t\t'microphone-menu'?: (props: MicrophoneMenuSlotProps) => unknown;\n\t\t'camera-menu'?: (props: CameraMenuSlotProps) => unknown;\n\t}>();\n\n\tconst browserSupportsScreenSharing = supportsScreenSharing();\n\n\tconst { permissions } = useLocalParticipantPermissions({ options: {} });\n\tconst { microphoneTrack, cameraTrack } = useLocalParticipant();\n\tconst {\n\t\tsaveAudioInputEnabled,\n\t\tsaveVideoInputEnabled,\n\t\tsaveAudioInputDeviceId,\n\t\tsaveVideoInputDeviceId,\n\t} = usePersistentUserChoices({ preventSave: !props.saveUserChoices });\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-control-bar']);\n\n\tconst isScreenShareEnabled = ref<boolean>(false);\n\n\tconst localMicrophoneTrack = computed<LocalAudioTrack | undefined>(() => {\n\t\tconst track = microphoneTrack.value?.track;\n\n\t\treturn track instanceof LocalAudioTrack ? track : undefined;\n\t});\n\n\tconst localCameraTrack = computed<LocalVideoTrack | undefined>(() => {\n\t\tconst track = cameraTrack.value?.track;\n\n\t\treturn track instanceof LocalVideoTrack ? track : undefined;\n\t});\n\n\tconst showIcon = computed<boolean>(() => {\n\t\treturn props.variation !== 'textOnly';\n\t});\n\n\tconst showText = computed<boolean>(() => {\n\t\treturn props.variation !== 'minimal';\n\t});\n\n\tconst screenShareLabel = computed<string>(() => {\n\t\treturn isScreenShareEnabled.value ? 'Stop screen share' : 'Share screen';\n\t});\n\n\tfunction iconLabel(label: string): string | undefined {\n\t\treturn showText.value ? undefined : label;\n\t}\n\n\tconst visibleControls = computed<ControlBarControls>(() => {\n\t\tconst visible: ControlBarControls = { leave: true, ...props.controls };\n\t\tconst local = permissions.value;\n\n\t\tif (local === undefined) {\n\t\t\treturn { ...visible, camera: false, chat: false, microphone: false, screenShare: false };\n\t\t}\n\n\t\tfunction canPublish(source: Track.Source): boolean {\n\t\t\tif (local === undefined || !local.canPublish) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\tlocal.canPublishSources.length === 0 ||\n\t\t\t\tlocal.canPublishSources.includes(trackSourceToProtocol(source))\n\t\t\t);\n\t\t}\n\n\t\tvisible.camera ??= canPublish(Track.Source.Camera);\n\t\tvisible.microphone ??= canPublish(Track.Source.Microphone);\n\t\tvisible.screenShare ??= canPublish(Track.Source.ScreenShare);\n\t\tvisible.chat ??= local.canPublishData && props.controls?.chat;\n\n\t\treturn visible;\n\t});\n\n\tfunction trackSourceToProtocol(source: Track.Source): number {\n\t\tswitch (source) {\n\t\t\tcase Track.Source.Camera:\n\t\t\t\treturn 1;\n\t\t\tcase Track.Source.Microphone:\n\t\t\t\treturn 2;\n\t\t\tcase Track.Source.ScreenShare:\n\t\t\t\treturn 3;\n\t\t\tdefault:\n\t\t\t\treturn 0;\n\t\t}\n\t}\n\n\tfunction onMicrophoneChange(enabled: boolean, isUserInitiated: boolean): void {\n\t\tif (isUserInitiated) {\n\t\t\tsaveAudioInputEnabled(enabled);\n\t\t}\n\t}\n\n\tfunction onCameraChange(enabled: boolean, isUserInitiated: boolean): void {\n\t\tif (isUserInitiated) {\n\t\t\tsaveVideoInputEnabled(enabled);\n\t\t}\n\t}\n</script>\n","<template>\n\t<div v-bind=\"styleAttrs\">\n\t\t<LayoutContextProvider @widget-change=\"(state) => (widgetState = state)\">\n\t\t\t<div class=\"lk-audio-conference-inner\">\n\t\t\t\t<div class=\"lk-audio-conference-stage\">\n\t\t\t\t\t<TrackLoop :tracks=\"audioTracks\">\n\t\t\t\t\t\t<ParticipantAudioTile />\n\t\t\t\t\t</TrackLoop>\n\t\t\t\t</div>\n\t\t\t\t<ControlBar :controls=\"{ microphone: true, camera: false, screenShare: false, chat: true }\">\n\t\t\t\t\t<template\n\t\t\t\t\t\tv-if=\"slots['microphone-menu'] !== undefined\"\n\t\t\t\t\t\t#microphone-menu=\"menu\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname=\"microphone-menu\"\n\t\t\t\t\t\t\tv-bind=\"menu\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</template>\n\t\t\t\t\t<slot name=\"controls\" />\n\t\t\t\t</ControlBar>\n\t\t\t</div>\n\t\t\t<Chat\n\t\t\t\t:data-lk-open=\"widgetState.showChat\"\n\t\t\t\t:message-formatter=\"chatMessageFormatter\"\n\t\t\t\t:message-encoder=\"chatMessageEncoder\"\n\t\t\t\t:message-decoder=\"chatMessageDecoder\"\n\t\t\t/>\n\t\t</LayoutContextProvider>\n\t\t<ConnectionStateToast />\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { MessageDecoder, MessageEncoder, WidgetState } from '@livekit/components-core';\n\timport { Track } from 'livekit-client';\n\timport { ref } from 'vue';\n\n\timport type { MessageFormatter } from '@/components/chat/chat.utils';\n\timport LayoutContextProvider from '@/components/layout/LayoutContextProvider.vue';\n\timport ParticipantAudioTile from '@/components/participant/ParticipantAudioTile.vue';\n\timport ConnectionStateToast from '@/components/room/ConnectionStateToast.vue';\n\timport TrackLoop from '@/components/room/TrackLoop.vue';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useTracks } from '@/composables/useTracks';\n\n\timport Chat from './Chat.vue';\n\timport ControlBar, { type MicrophoneMenuSlotProps } from './ControlBar.vue';\n\n\texport interface AudioConferenceProps extends LkStyleProps {\n\t\tchatMessageFormatter?: MessageFormatter;\n\t\tchatMessageEncoder?: MessageEncoder;\n\t\tchatMessageDecoder?: MessageDecoder;\n\t}\n\n\tconst props = withDefaults(defineProps<AudioConferenceProps>(), {\n\t\tchatMessageFormatter: undefined,\n\t\tchatMessageEncoder: undefined,\n\t\tchatMessageDecoder: undefined,\n\t});\n\n\tconst slots = defineSlots<{\n\t\tcontrols?: () => unknown;\n\t\t'microphone-menu'?: (props: MicrophoneMenuSlotProps) => unknown;\n\t}>();\n\n\tconst { trackReferences: audioTracks } = useTracks([Track.Source.Microphone]);\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-audio-conference']);\n\n\tconst widgetState = ref<WidgetState>({ showChat: false, unreadMessages: 0 });\n</script>\n","import {\n\tcreateLocalTracks,\n\tTrack,\n\ttype AudioCaptureOptions,\n\ttype LocalAudioTrack,\n\ttype LocalTrack,\n\ttype LocalVideoTrack,\n\ttype VideoCaptureOptions,\n} from 'livekit-client';\nimport {\n\tcomputed,\n\tgetCurrentScope,\n\tonScopeDispose,\n\tref,\n\tshallowRef,\n\twatch,\n\ttype ComputedRef,\n\ttype Ref,\n\ttype ShallowRef,\n} from 'vue';\n\nexport interface UsePreviewTracksProps {\n\treadonly audio?: boolean | AudioCaptureOptions;\n\treadonly video?: boolean | VideoCaptureOptions;\n\treadonly onError?: (error: Error) => void;\n}\n\nexport interface UsePreviewTracks {\n\treadonly tracks: ShallowRef<LocalTrack[]>;\n\treadonly audioTrack: ComputedRef<LocalAudioTrack | undefined>;\n\treadonly videoTrack: ComputedRef<LocalVideoTrack | undefined>;\n\treadonly isLoading: Ref<boolean>;\n\treadonly error: Ref<Error | null>;\n}\n\nfunction isLocalAudioTrack(track: LocalTrack): track is LocalAudioTrack {\n\treturn track.kind === Track.Kind.Audio;\n}\n\nfunction isLocalVideoTrack(track: LocalTrack): track is LocalVideoTrack {\n\treturn track.kind === Track.Kind.Video;\n}\n\nfunction getProcessorName(value: unknown): unknown {\n\tif (typeof value !== 'object' || value === null || !('name' in value)) {\n\t\treturn undefined;\n\t}\n\n\treturn value.name;\n}\n\nfunction replaceProcessor(key: string, value: unknown): unknown {\n\treturn key === 'processor' ? getProcessorName(value) : value;\n}\n\nfunction stopAll(tracks: LocalTrack[]): void {\n\tfor (const track of tracks) {\n\t\ttrack.stop();\n\t}\n}\n\nexport function usePreviewTracks(props: UsePreviewTracksProps = {}): UsePreviewTracks {\n\tconst isLoading = ref<boolean>(false);\n\tconst error = ref<Error | null>(null);\n\tconst tracks = shallowRef<LocalTrack[]>([]);\n\n\tconst audioTrack = computed<LocalAudioTrack | undefined>(() => {\n\t\treturn tracks.value.find(isLocalAudioTrack);\n\t});\n\n\tconst videoTrack = computed<LocalVideoTrack | undefined>(() => {\n\t\treturn tracks.value.find(isLocalVideoTrack);\n\t});\n\n\tfunction stopTracks(): void {\n\t\tstopAll(tracks.value);\n\t\ttracks.value = [];\n\t}\n\n\twatch(\n\t\t() => {\n\t\t\treturn JSON.stringify(\n\t\t\t\t{ audio: props.audio ?? true, video: props.video ?? true },\n\t\t\t\treplaceProcessor,\n\t\t\t);\n\t\t},\n\t\t(_options, _previous, onCleanup) => {\n\t\t\tlet canceled = false;\n\n\t\t\tonCleanup(() => {\n\t\t\t\tcanceled = true;\n\t\t\t});\n\n\t\t\tstopTracks();\n\n\t\t\tconst audio = props.audio ?? true;\n\t\t\tconst video = props.video ?? true;\n\n\t\t\tif (audio === false && video === false) {\n\t\t\t\tisLoading.value = false;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tisLoading.value = true;\n\t\t\terror.value = null;\n\n\t\t\tcreateLocalTracks({ audio, video })\n\t\t\t\t.then((created) => {\n\t\t\t\t\tif (canceled) {\n\t\t\t\t\t\tstopAll(created);\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\ttracks.value = created;\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tif (canceled) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst createError =\n\t\t\t\t\t\terr instanceof Error ? err : new Error('Unknown error creating local tracks');\n\t\t\t\t\terror.value = createError;\n\t\t\t\t\tprops.onError?.(createError);\n\t\t\t\t})\n\t\t\t\t.finally(() => {\n\t\t\t\t\tif (!canceled) {\n\t\t\t\t\t\tisLoading.value = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\tif (getCurrentScope() !== undefined) {\n\t\tonScopeDispose(stopTracks);\n\t}\n\n\tconst result: UsePreviewTracks = {\n\t\ttracks,\n\t\taudioTrack,\n\t\tvideoTrack,\n\t\tisLoading,\n\t\terror,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<div v-bind=\"styleAttrs\">\n\t\t<div class=\"lk-video-container\">\n\t\t\t<video\n\t\t\t\tv-if=\"videoTrack !== undefined\"\n\t\t\t\tref=\"video\"\n\t\t\t\twidth=\"1280\"\n\t\t\t\theight=\"720\"\n\t\t\t\tmuted\n\t\t\t\tplaysinline\n\t\t\t\t:data-lk-facing-mode=\"facingMode\"\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tv-if=\"videoTrack === undefined || !videoEnabled\"\n\t\t\t\tclass=\"lk-camera-off-note\"\n\t\t\t>\n\t\t\t\t<slot name=\"placeholder\">\n\t\t\t\t\t<ParticipantAvatar :name=\"username\" />\n\t\t\t\t</slot>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"lk-button-group-container\">\n\t\t\t<div\n\t\t\t\tclass=\"lk-button-group\"\n\t\t\t\tdata-lk-kind=\"audio\"\n\t\t\t>\n\t\t\t\t<TrackToggle\n\t\t\t\t\t:source=\"Track.Source.Microphone\"\n\t\t\t\t\t:initial-state=\"audioEnabled\"\n\t\t\t\t\t@change=\"(enabled: boolean) => (audioEnabled = enabled)\"\n\t\t\t\t>\n\t\t\t\t\t{{ micLabel }}\n\t\t\t\t</TrackToggle>\n\t\t\t\t<div class=\"lk-button-group-menu\">\n\t\t\t\t\t<MediaDeviceMenu\n\t\t\t\t\t\tkind=\"audioinput\"\n\t\t\t\t\t\taria-label=\"Choose a microphone\"\n\t\t\t\t\t\t:initial-selection=\"audioDeviceId\"\n\t\t\t\t\t\t:disabled=\"audioTrack === undefined\"\n\t\t\t\t\t\t:tracks=\"{ audioinput: audioTrack }\"\n\t\t\t\t\t\t@active-device-change=\"(_kind, id) => (audioDeviceId = id)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<template\n\t\t\t\t\t\t\tv-if=\"slots['microphone-menu'] !== undefined\"\n\t\t\t\t\t\t\t#append=\"{ close }\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\tname=\"microphone-menu\"\n\t\t\t\t\t\t\t\t:track=\"audioTrack\"\n\t\t\t\t\t\t\t\t:close=\"close\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</MediaDeviceMenu>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclass=\"lk-button-group\"\n\t\t\t\tdata-lk-kind=\"video\"\n\t\t\t>\n\t\t\t\t<TrackToggle\n\t\t\t\t\t:source=\"Track.Source.Camera\"\n\t\t\t\t\t:initial-state=\"videoEnabled\"\n\t\t\t\t\t@change=\"(enabled: boolean) => (videoEnabled = enabled)\"\n\t\t\t\t>\n\t\t\t\t\t{{ camLabel }}\n\t\t\t\t</TrackToggle>\n\t\t\t\t<div class=\"lk-button-group-menu\">\n\t\t\t\t\t<MediaDeviceMenu\n\t\t\t\t\t\tkind=\"videoinput\"\n\t\t\t\t\t\taria-label=\"Choose a camera\"\n\t\t\t\t\t\t:initial-selection=\"videoDeviceId\"\n\t\t\t\t\t\t:disabled=\"videoTrack === undefined\"\n\t\t\t\t\t\t:tracks=\"{ videoinput: videoTrack }\"\n\t\t\t\t\t\t@active-device-change=\"(_kind, id) => (videoDeviceId = id)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<template\n\t\t\t\t\t\t\tv-if=\"slots['camera-menu'] !== undefined\"\n\t\t\t\t\t\t\t#append=\"{ close }\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\tname=\"camera-menu\"\n\t\t\t\t\t\t\t\t:track=\"videoTrack\"\n\t\t\t\t\t\t\t\t:close=\"close\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</MediaDeviceMenu>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<form\n\t\t\tclass=\"lk-username-container\"\n\t\t\t@submit.prevent=\"handleSubmit\"\n\t\t>\n\t\t\t<input\n\t\t\t\tv-model=\"username\"\n\t\t\t\tclass=\"lk-form-control\"\n\t\t\t\tname=\"username\"\n\t\t\t\ttype=\"text\"\n\t\t\t\tautocomplete=\"off\"\n\t\t\t\t:aria-label=\"userLabel\"\n\t\t\t\t:placeholder=\"userLabel\"\n\t\t\t/>\n\t\t\t<button\n\t\t\t\tclass=\"lk-button lk-join-button\"\n\t\t\t\ttype=\"submit\"\n\t\t\t\t:disabled=\"!isValid\"\n\t\t\t>\n\t\t\t\t{{ joinLabel }}\n\t\t\t</button>\n\t\t</form>\n\t\t<template v-if=\"debug\">\n\t\t\t<strong>User Choices:</strong>\n\t\t\t<ul class=\"lk-list lk-prejoin-debug\">\n\t\t\t\t<li>Username: {{ userChoices.username }}</li>\n\t\t\t\t<li>Video Enabled: {{ userChoices.videoEnabled }}</li>\n\t\t\t\t<li>Audio Enabled: {{ userChoices.audioEnabled }}</li>\n\t\t\t\t<li>Video Device: {{ userChoices.videoDeviceId }}</li>\n\t\t\t\t<li>Audio Device: {{ userChoices.audioDeviceId }}</li>\n\t\t\t</ul>\n\t\t</template>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { LocalUserChoices } from '@livekit/components-core';\n\timport { facingModeFromLocalTrack, Track, type TrackProcessor } from 'livekit-client';\n\timport { computed, ref, useTemplateRef, watch } from 'vue';\n\n\timport TrackToggle from '@/components/controls/TrackToggle.vue';\n\timport ParticipantAvatar from '@/components/participant/ParticipantAvatar.vue';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { usePersistentUserChoices } from '@/composables/usePersistentUserChoices';\n\timport { usePreviewTracks } from '@/composables/usePreviewTracks';\n\n\timport type { CameraMenuSlotProps, MicrophoneMenuSlotProps } from './ControlBar.vue';\n\timport MediaDeviceMenu from './MediaDeviceMenu.vue';\n\n\texport interface PreJoinProps extends LkStyleProps {\n\t\tdefaults?: Partial<LocalUserChoices>;\n\t\tvalidate?: (values: LocalUserChoices) => boolean;\n\t\tdebug?: boolean;\n\t\tjoinLabel?: string;\n\t\tmicLabel?: string;\n\t\tcamLabel?: string;\n\t\tuserLabel?: string;\n\t\tpersistUserChoices?: boolean;\n\t\tvideoProcessor?: TrackProcessor<Track.Kind.Video>;\n\t}\n\n\tconst props = withDefaults(defineProps<PreJoinProps>(), {\n\t\tdefaults: () => ({}),\n\t\tvalidate: undefined,\n\t\tdebug: false,\n\t\tjoinLabel: 'Join Room',\n\t\tmicLabel: 'Microphone',\n\t\tcamLabel: 'Camera',\n\t\tuserLabel: 'Username',\n\t\tpersistUserChoices: true,\n\t\tvideoProcessor: undefined,\n\t});\n\n\tconst emits = defineEmits<{\n\t\tsubmit: [values: LocalUserChoices];\n\t\terror: [error: Error];\n\t}>();\n\n\tconst slots = defineSlots<{\n\t\tplaceholder?: () => unknown;\n\t\t'microphone-menu'?: (props: MicrophoneMenuSlotProps) => unknown;\n\t\t'camera-menu'?: (props: CameraMenuSlotProps) => unknown;\n\t}>();\n\n\tconst {\n\t\tuserChoices: initialUserChoices,\n\t\tsaveAudioInputDeviceId,\n\t\tsaveAudioInputEnabled,\n\t\tsaveVideoInputDeviceId,\n\t\tsaveVideoInputEnabled,\n\t\tsaveUsername,\n\t} = usePersistentUserChoices({\n\t\tdefaults: props.defaults,\n\t\tpreventSave: !props.persistUserChoices,\n\t\tpreventLoad: !props.persistUserChoices,\n\t});\n\tconst initial = initialUserChoices.value;\n\tconst video = useTemplateRef<HTMLVideoElement>('video');\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-prejoin']);\n\n\tconst audioEnabled = ref<boolean>(initial.audioEnabled);\n\tconst videoEnabled = ref<boolean>(initial.videoEnabled);\n\tconst audioDeviceId = ref<string>(initial.audioDeviceId);\n\tconst videoDeviceId = ref<string>(initial.videoDeviceId);\n\tconst username = ref<string>(initial.username);\n\n\tconst { audioTrack, videoTrack } = usePreviewTracks({\n\t\tget audio() {\n\t\t\treturn audioEnabled.value ? { deviceId: initial.audioDeviceId } : false;\n\t\t},\n\t\tget video() {\n\t\t\treturn videoEnabled.value\n\t\t\t\t? { deviceId: initial.videoDeviceId, processor: props.videoProcessor }\n\t\t\t\t: false;\n\t\t},\n\t\tonError: (error) => emits('error', error),\n\t});\n\n\tconst facingMode = computed<string>(() => {\n\t\treturn videoTrack.value === undefined\n\t\t\t? 'undefined'\n\t\t\t: facingModeFromLocalTrack(videoTrack.value).facingMode;\n\t});\n\n\tconst userChoices = computed<LocalUserChoices>(() => {\n\t\treturn {\n\t\t\tusername: username.value,\n\t\t\tvideoEnabled: videoEnabled.value,\n\t\t\tvideoDeviceId: videoDeviceId.value,\n\t\t\taudioEnabled: audioEnabled.value,\n\t\t\taudioDeviceId: audioDeviceId.value,\n\t\t};\n\t});\n\n\tconst isValid = computed<boolean>(() => {\n\t\treturn props.validate === undefined\n\t\t\t? userChoices.value.username !== ''\n\t\t\t: props.validate(userChoices.value);\n\t});\n\n\tfunction handleSubmit(): void {\n\t\tif (isValid.value) {\n\t\t\temits('submit', userChoices.value);\n\t\t}\n\t}\n\n\twatch(audioEnabled, saveAudioInputEnabled);\n\n\twatch(videoEnabled, saveVideoInputEnabled);\n\n\twatch(audioDeviceId, saveAudioInputDeviceId);\n\n\twatch(videoDeviceId, saveVideoInputDeviceId);\n\n\twatch(username, saveUsername);\n\n\twatch(\n\t\t[videoTrack, video],\n\t\t([track, element], _previous, onCleanup) => {\n\t\t\tif (track === undefined || element === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttrack.unmute().catch((error: unknown) => {\n\t\t\t\temits('error', error instanceof Error ? error : new Error(String(error)));\n\t\t\t});\n\n\t\t\ttrack.attach(element);\n\n\t\t\tonCleanup(() => track.detach(element));\n\t\t},\n\t\t{ flush: 'post' },\n\t);\n</script>\n","<template>\n\t<div\n\t\tclass=\"lk-room-audio-renderer\"\n\t\thidden\n\t>\n\t\t<AudioTrack\n\t\t\tv-for=\"trackRef in audioTracks\"\n\t\t\t:key=\"getTrackReferenceId(trackRef)\"\n\t\t\t:track-ref=\"trackRef\"\n\t\t\t:volume=\"volume\"\n\t\t\t:muted=\"muted\"\n\t\t/>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport {\n\t\tgetTrackReferenceId,\n\t\tisTrackReference,\n\t\ttype TrackReference,\n\t} from '@livekit/components-core';\n\timport { Track, type Room } from 'livekit-client';\n\timport { computed } from 'vue';\n\n\timport AudioTrack from '@/components/participant/AudioTrack.vue';\n\timport { useTracks } from '@/composables/useTracks';\n\n\texport interface RoomAudioRendererProps {\n\t\troom?: Room;\n\t\tvolume?: number;\n\t\tmuted?: boolean;\n\t}\n\n\tconst props = withDefaults(defineProps<RoomAudioRendererProps>(), {\n\t\troom: undefined,\n\t\tvolume: undefined,\n\t\tmuted: undefined,\n\t});\n\n\tconst { trackReferences } = useTracks(\n\t\t[Track.Source.Microphone, Track.Source.ScreenShareAudio, Track.Source.Unknown],\n\t\t{ updateOnlyOn: [], onlySubscribed: true, room: props.room },\n\t);\n\n\tconst audioTracks = computed<TrackReference[]>(() => {\n\t\treturn trackReferences.value\n\t\t\t.filter(isTrackReference)\n\t\t\t.filter((ref) => !ref.participant.isLocal && ref.publication.kind === Track.Kind.Audio);\n\t});\n</script>\n","import type { TrackReferenceOrPlaceholder } from '@livekit/components-core';\nimport { computed, type ComputedRef } from 'vue';\n\nimport { useEnsureLayoutContext, type LayoutContext } from '@/context/layout.context';\n\nexport interface UsePinnedTracks {\n\treadonly pinnedTracks: ComputedRef<TrackReferenceOrPlaceholder[]>;\n}\n\nexport interface UsePinnedTracksProps {\n\treadonly context?: LayoutContext;\n}\n\nexport function usePinnedTracks(props: UsePinnedTracksProps): UsePinnedTracks {\n\tconst layoutContext = useEnsureLayoutContext(props.context);\n\n\tconst pinnedTracks = computed<TrackReferenceOrPlaceholder[]>(() => {\n\t\treturn layoutContext.value.pin.state.value;\n\t});\n\n\tconst result: UsePinnedTracks = {\n\t\tpinnedTracks,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<div v-bind=\"styleAttrs\">\n\t\t<LayoutContextProvider\n\t\t\tv-if=\"web\"\n\t\t\t:value=\"layoutContext\"\n\t\t\t@widget-change=\"(state) => (widgetState = state)\"\n\t\t>\n\t\t\t<div class=\"lk-video-conference-inner\">\n\t\t\t\t<div\n\t\t\t\t\tv-if=\"focusTrack === undefined\"\n\t\t\t\t\tclass=\"lk-grid-layout-wrapper\"\n\t\t\t\t>\n\t\t\t\t\t<GridLayout :tracks=\"tracks\" />\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tv-else\n\t\t\t\t\tclass=\"lk-focus-layout-wrapper\"\n\t\t\t\t>\n\t\t\t\t\t<FocusLayoutContainer>\n\t\t\t\t\t\t<CarouselLayout :tracks=\"carouselTracks\" />\n\t\t\t\t\t\t<FocusLayout :track-ref=\"focusTrack\" />\n\t\t\t\t\t</FocusLayoutContainer>\n\t\t\t\t</div>\n\t\t\t\t<ControlBar :controls=\"{ chat: true, settings: slots.settings !== undefined }\">\n\t\t\t\t\t<template\n\t\t\t\t\t\tv-if=\"slots['microphone-menu'] !== undefined\"\n\t\t\t\t\t\t#microphone-menu=\"menu\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname=\"microphone-menu\"\n\t\t\t\t\t\t\tv-bind=\"menu\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</template>\n\t\t\t\t\t<template\n\t\t\t\t\t\tv-if=\"slots['camera-menu'] !== undefined\"\n\t\t\t\t\t\t#camera-menu=\"menu\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname=\"camera-menu\"\n\t\t\t\t\t\t\tv-bind=\"menu\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</template>\n\t\t\t\t\t<slot name=\"controls\" />\n\t\t\t\t</ControlBar>\n\t\t\t\t<div\n\t\t\t\t\tv-if=\"slots.settings !== undefined\"\n\t\t\t\t\tclass=\"lk-settings-menu-modal\"\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\taria-label=\"Settings\"\n\t\t\t\t\t:style=\"{ display: widgetState.showSettings ? 'block' : 'none' }\"\n\t\t\t\t\t@keydown.esc=\"closeSettings\"\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"settings\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<Chat\n\t\t\t\t:data-lk-open=\"widgetState.showChat\"\n\t\t\t\t:message-formatter=\"chatMessageFormatter\"\n\t\t\t\t:message-encoder=\"chatMessageEncoder\"\n\t\t\t\t:message-decoder=\"chatMessageDecoder\"\n\t\t\t/>\n\t\t</LayoutContextProvider>\n\t\t<RoomAudioRenderer />\n\t\t<ConnectionStateToast />\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport {\n\t\tisEqualTrackRef,\n\t\tisTrackReference,\n\t\tisWeb,\n\t\ttype MessageDecoder,\n\t\ttype MessageEncoder,\n\t\ttype TrackReference,\n\t\ttype TrackReferenceOrPlaceholder,\n\t\ttype WidgetState,\n\t} from '@livekit/components-core';\n\timport { RoomEvent, Track } from 'livekit-client';\n\timport { computed, ref, shallowRef, watch } from 'vue';\n\n\timport type { MessageFormatter } from '@/components/chat/chat.utils';\n\timport CarouselLayout from '@/components/layout/CarouselLayout.vue';\n\timport FocusLayout from '@/components/layout/FocusLayout.vue';\n\timport FocusLayoutContainer from '@/components/layout/FocusLayoutContainer.vue';\n\timport GridLayout from '@/components/layout/GridLayout.vue';\n\timport LayoutContextProvider from '@/components/layout/LayoutContextProvider.vue';\n\timport ConnectionStateToast from '@/components/room/ConnectionStateToast.vue';\n\timport RoomAudioRenderer from '@/components/room/RoomAudioRenderer.vue';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { usePinnedTracks } from '@/composables/usePinnedTracks';\n\timport { useTracks } from '@/composables/useTracks';\n\timport { createLayoutContext } from '@/context/layout.context';\n\n\timport Chat from './Chat.vue';\n\timport ControlBar, {\n\t\ttype CameraMenuSlotProps,\n\t\ttype MicrophoneMenuSlotProps,\n\t} from './ControlBar.vue';\n\n\texport interface VideoConferenceProps extends LkStyleProps {\n\t\tchatMessageFormatter?: MessageFormatter;\n\t\tchatMessageEncoder?: MessageEncoder;\n\t\tchatMessageDecoder?: MessageDecoder;\n\t}\n\n\tconst props = withDefaults(defineProps<VideoConferenceProps>(), {\n\t\tchatMessageFormatter: undefined,\n\t\tchatMessageEncoder: undefined,\n\t\tchatMessageDecoder: undefined,\n\t});\n\n\tconst slots = defineSlots<{\n\t\tsettings?: () => unknown;\n\t\tcontrols?: () => unknown;\n\t\t'microphone-menu'?: (props: MicrophoneMenuSlotProps) => unknown;\n\t\t'camera-menu'?: (props: CameraMenuSlotProps) => unknown;\n\t}>();\n\n\tconst web = isWeb();\n\n\tconst { trackReferences: tracks } = useTracks(\n\t\t[\n\t\t\t{ source: Track.Source.Camera, withPlaceholder: true },\n\t\t\t{ source: Track.Source.ScreenShare, withPlaceholder: false },\n\t\t],\n\t\t{ updateOnlyOn: [RoomEvent.ActiveSpeakersChanged], onlySubscribed: false },\n\t);\n\tconst layoutContext = createLayoutContext();\n\tconst { pinnedTracks } = usePinnedTracks({ context: layoutContext });\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-video-conference']);\n\n\tconst widgetState = ref<WidgetState>({ showChat: false, unreadMessages: 0, showSettings: false });\n\tconst lastAutoFocusedScreenShare = shallowRef<TrackReference | null>(null);\n\n\tconst focusTrack = computed<TrackReferenceOrPlaceholder | undefined>(() => {\n\t\treturn pinnedTracks.value[0];\n\t});\n\n\tconst carouselTracks = computed<TrackReferenceOrPlaceholder[]>(() => {\n\t\treturn tracks.value.filter((track) => !isEqualTrackRef(track, focusTrack.value));\n\t});\n\n\tconst screenShareTracks = computed<TrackReference[]>(() => {\n\t\treturn tracks.value\n\t\t\t.filter(isTrackReference)\n\t\t\t.filter((track) => track.publication.source === Track.Source.ScreenShare);\n\t});\n\n\tfunction closeSettings(): void {\n\t\tlayoutContext.widget.dispatch({ msg: 'toggle_settings' });\n\t}\n\n\tfunction followScreenShare(): void {\n\t\tconst shares = screenShareTracks.value;\n\t\tconst firstShare = shares[0];\n\t\tconst { pin } = layoutContext;\n\n\t\tif (\n\t\t\tfirstShare !== undefined &&\n\t\t\tshares.some((track) => track.publication.isSubscribed) &&\n\t\t\tlastAutoFocusedScreenShare.value === null\n\t\t) {\n\t\t\tpin.dispatch({ msg: 'set_pin', trackReference: firstShare });\n\t\t\tlastAutoFocusedScreenShare.value = firstShare;\n\t\t} else if (\n\t\t\tlastAutoFocusedScreenShare.value !== null &&\n\t\t\t!shares.some(\n\t\t\t\t(track) =>\n\t\t\t\t\ttrack.publication.trackSid === lastAutoFocusedScreenShare.value?.publication.trackSid,\n\t\t\t)\n\t\t) {\n\t\t\tpin.dispatch({ msg: 'clear_pin' });\n\t\t\tlastAutoFocusedScreenShare.value = null;\n\t\t}\n\t}\n\n\tfunction followFocusTrack(): void {\n\t\tconst focus = focusTrack.value;\n\n\t\tif (focus === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { pin } = layoutContext;\n\t\tconst updated = tracks.value.find(\n\t\t\t(track) =>\n\t\t\t\ttrack.participant.identity === focus.participant.identity && track.source === focus.source,\n\t\t);\n\n\t\tif (updated === undefined) {\n\t\t\tpin.dispatch({ msg: 'clear_pin' });\n\t\t} else if (!isTrackReference(focus) && updated !== focus && isTrackReference(updated)) {\n\t\t\tpin.dispatch({ msg: 'set_pin', trackReference: updated });\n\t\t}\n\t}\n\n\twatch(\n\t\t() =>\n\t\t\t[\n\t\t\t\tscreenShareTracks.value\n\t\t\t\t\t.map((track) => `${track.publication.trackSid}_${track.publication.isSubscribed}`)\n\t\t\t\t\t.join(),\n\t\t\t\tfocusTrack.value?.publication?.trackSid,\n\t\t\t\ttracks.value,\n\t\t\t] as const,\n\t\t() => {\n\t\t\tfollowScreenShare();\n\t\t\tfollowFocusTrack();\n\t\t},\n\t\t{ immediate: true },\n\t);\n</script>\n","<template>\n\t<div v-bind=\"styleAttrs\">\n\t\t<div\n\t\t\tv-if=\"visibleControls.microphone\"\n\t\t\tclass=\"lk-button-group\"\n\t\t>\n\t\t\t<TrackToggle\n\t\t\t\t:source=\"Track.Source.Microphone\"\n\t\t\t\t:show-icon=\"false\"\n\t\t\t\t@change=\"onMicrophoneChange\"\n\t\t\t\t@device-error=\"emits('deviceError', { source: Track.Source.Microphone, error: $event })\"\n\t\t\t>\n\t\t\t\t<BarVisualizer\n\t\t\t\t\t:track-ref=\"microphoneTrackRef\"\n\t\t\t\t\t:bar-count=\"7\"\n\t\t\t\t\t:options=\"{ minHeight: 5 }\"\n\t\t\t\t/>\n\t\t\t</TrackToggle>\n\t\t\t<div class=\"lk-button-group-menu\">\n\t\t\t\t<MediaDeviceMenu\n\t\t\t\t\tkind=\"audioinput\"\n\t\t\t\t\taria-label=\"Choose a microphone\"\n\t\t\t\t\t@active-device-change=\"(_kind, deviceId) => saveAudioInputDeviceId(deviceId ?? 'default')\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t\t<DisconnectButton v-if=\"visibleControls.leave\">Disconnect</DisconnectButton>\n\t\t<StartMediaButton />\n\t\t<slot />\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { TrackReferenceOrPlaceholder } from '@livekit/components-core';\n\timport { Track } from 'livekit-client';\n\timport { computed } from 'vue';\n\n\timport DisconnectButton from '@/components/controls/DisconnectButton.vue';\n\timport StartMediaButton from '@/components/controls/StartMediaButton.vue';\n\timport TrackToggle from '@/components/controls/TrackToggle.vue';\n\timport BarVisualizer from '@/components/participant/BarVisualizer.vue';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useLocalParticipant } from '@/composables/useLocalParticipant';\n\timport { useLocalParticipantPermissions } from '@/composables/useLocalParticipantPermissions';\n\timport { usePersistentUserChoices } from '@/composables/usePersistentUserChoices';\n\n\timport MediaDeviceMenu from './MediaDeviceMenu.vue';\n\n\texport interface VoiceAssistantControlBarControls {\n\t\tmicrophone?: boolean;\n\t\tleave?: boolean;\n\t}\n\n\texport interface VoiceAssistantControlBarProps extends LkStyleProps {\n\t\tcontrols?: VoiceAssistantControlBarControls;\n\t\tsaveUserChoices?: boolean;\n\t}\n\n\texport interface VoiceAssistantControlBarDeviceError {\n\t\tsource: Track.Source;\n\t\terror: unknown;\n\t}\n\n\tconst props = withDefaults(defineProps<VoiceAssistantControlBarProps>(), {\n\t\tcontrols: undefined,\n\t\tsaveUserChoices: true,\n\t});\n\n\tconst emits = defineEmits<{ deviceError: [payload: VoiceAssistantControlBarDeviceError] }>();\n\n\tdefineSlots<{\n\t\tdefault?: () => unknown;\n\t}>();\n\n\tconst { localParticipant, microphoneTrack } = useLocalParticipant();\n\tconst { permissions } = useLocalParticipantPermissions({ options: {} });\n\tconst { saveAudioInputEnabled, saveAudioInputDeviceId } = usePersistentUserChoices({\n\t\tpreventSave: !props.saveUserChoices,\n\t});\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-agent-control-bar']);\n\n\tconst microphoneTrackRef = computed<TrackReferenceOrPlaceholder | undefined>(() => {\n\t\tif (localParticipant.value === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst trackRef: TrackReferenceOrPlaceholder = {\n\t\t\tparticipant: localParticipant.value,\n\t\t\tsource: Track.Source.Microphone,\n\t\t\tpublication: microphoneTrack.value,\n\t\t};\n\n\t\treturn trackRef;\n\t});\n\n\tconst visibleControls = computed<VoiceAssistantControlBarControls>(() => {\n\t\tconst visible: VoiceAssistantControlBarControls = {\n\t\t\tleave: true,\n\t\t\tmicrophone: true,\n\t\t\t...props.controls,\n\t\t};\n\n\t\treturn {\n\t\t\t...visible,\n\t\t\tmicrophone: visible.microphone === true && permissions.value?.canPublish === true,\n\t\t};\n\t});\n\n\tfunction onMicrophoneChange(enabled: boolean, isUserInitiated: boolean): void {\n\t\tif (isUserInitiated) {\n\t\t\tsaveAudioInputEnabled(enabled);\n\t\t}\n\t}\n</script>\n","<template>\n\t<div\n\t\tv-bind=\"styleAttrs\"\n\t\t:data-lk-connection-state=\"connectionState\"\n\t>\n\t\t<slot :connection-state=\"connectionState\">{{ connectionState }}</slot>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { ConnectionState, Room } from 'livekit-client';\n\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useConnectionState } from '@/composables/useConnectionState';\n\n\texport interface ConnectionStatusComponentProps extends LkStyleProps {\n\t\troom?: Room;\n\t}\n\n\tconst props = defineProps<ConnectionStatusComponentProps>();\n\n\tdefineSlots<{ default?: (props: { connectionState: ConnectionState }) => unknown }>();\n\n\tconst { connectionState } = useConnectionState({ room: props.room });\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-connection-status']);\n</script>\n","import {\n\tloadUserChoices,\n\tlog,\n\tsaveUserChoices,\n\ttype LocalUserChoices,\n} from '@livekit/components-core';\nimport { Track, type TrackPublication } from 'livekit-client';\n\nexport interface RememberedMediaState {\n\treadonly audioEnabled: boolean;\n\treadonly videoEnabled: boolean;\n}\n\ntype MediaChoice = Pick<LocalUserChoices, 'audioEnabled' | 'videoEnabled'>;\n\nconst CHOICE_KEYS: Partial<Record<Track.Source, keyof MediaChoice>> = {\n\t[Track.Source.Camera]: 'videoEnabled',\n\t[Track.Source.Microphone]: 'audioEnabled',\n};\n\nconst ALL_ENABLED: RememberedMediaState = { audioEnabled: true, videoEnabled: true };\n\nexport function loadRememberedMediaState(): RememberedMediaState {\n\ttry {\n\t\tconst choices = loadUserChoices(ALL_ENABLED);\n\n\t\treturn { audioEnabled: choices.audioEnabled, videoEnabled: choices.videoEnabled };\n\t} catch (error) {\n\t\tlog.error('Error loading user choices:', error);\n\n\t\treturn ALL_ENABLED;\n\t}\n}\n\nexport function rememberMediaState(publication: TrackPublication): void {\n\tconst key = CHOICE_KEYS[publication.source];\n\n\tif (key === undefined) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tsaveUserChoices({ ...loadUserChoices(), [key]: !publication.isMuted });\n\t} catch (error) {\n\t\tlog.error('Error saving user choices:', error);\n\t}\n}\n","export function roomOptionsStringifyReplacer(key: string, value: unknown): unknown {\n\tif (key === 'processor' && typeof value === 'object' && value !== null && 'name' in value) {\n\t\treturn value.name;\n\t}\n\n\tif (key === 'e2ee' && value !== undefined && value !== null && value !== false) {\n\t\treturn 'e2ee-enabled';\n\t}\n\n\treturn value;\n}\n","import { log } from '@livekit/components-core';\nimport {\n\tMediaDeviceFailure,\n\tParticipantEvent,\n\tRoom,\n\tRoomEvent,\n\ttype AudioCaptureOptions,\n\ttype DisconnectReason,\n\ttype ScreenShareCaptureOptions,\n\ttype TrackPublication,\n\ttype VideoCaptureOptions,\n} from 'livekit-client';\nimport {\n\tgetCurrentInstance,\n\tonBeforeUnmount,\n\tref,\n\tshallowRef,\n\twatch,\n\twatchEffect,\n\ttype Ref,\n\ttype ShallowRef,\n} from 'vue';\n\nimport { useMaybeRoomContext } from '@/context/room.context';\nimport type { LiveKitRoomProps } from '@/types/livekit-room.types';\nimport {\n\tloadRememberedMediaState,\n\trememberMediaState,\n\ttype RememberedMediaState,\n} from '@/utils/media-choices.utils';\nimport { roomOptionsStringifyReplacer } from '@/utils/room.utils';\n\nexport type RoomConnectionState =\n\t(typeof ROOM_CONNECTION_STATE)[keyof typeof ROOM_CONNECTION_STATE];\n\nexport interface UseLiveKitRoom {\n\treadonly room: ShallowRef<Room | undefined>;\n\treadonly connectionState: Ref<RoomConnectionState>;\n}\n\ninterface EffectState {\n\tcanceled: boolean;\n}\n\nexport const ROOM_CONNECTION_STATE = {\n\tDISCONNECTED: 'disconnected',\n\tCONNECTING: 'connecting',\n\tCONNECTED: 'connected',\n\tFAILED: 'failed',\n} as const;\n\nfunction toError(error: unknown): Error {\n\treturn error instanceof Error ? error : new Error(String(error));\n}\n\nfunction captureOptions<\n\tT extends AudioCaptureOptions | VideoCaptureOptions | ScreenShareCaptureOptions,\n>(value: T | boolean): T | undefined {\n\treturn typeof value === 'boolean' ? undefined : value;\n}\n\nconst NOTHING_REMEMBERED: RememberedMediaState = { audioEnabled: true, videoEnabled: true };\n\nfunction shouldPersist(props: LiveKitRoomProps): boolean {\n\treturn props.persistUserChoices !== false;\n}\n\nfunction isNonEmpty(value: string | undefined): value is string {\n\treturn value !== undefined && value !== '';\n}\n\nasync function simulate(room: Room, count: number): Promise<void> {\n\tawait room.simulateParticipants({\n\t\tparticipants: { count },\n\t\tpublish: { audio: true, useRealTracks: true },\n\t});\n}\n\nexport function useLiveKitRoom(props: LiveKitRoomProps): UseLiveKitRoom {\n\tconst contextRoom = useMaybeRoomContext();\n\n\tconst connectionState = ref<RoomConnectionState>(ROOM_CONNECTION_STATE.DISCONNECTED);\n\tconst room = shallowRef<Room | undefined>(undefined);\n\tconst shouldConnect = ref<boolean>(false);\n\n\twatch(\n\t\t() => [props.room, JSON.stringify(props.options ?? {}, roomOptionsStringifyReplacer)],\n\t\t() => {\n\t\t\troom.value = props.room ?? contextRoom?.value ?? new Room(props.options);\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\tif (props.options !== undefined && (props.room !== undefined || contextRoom !== undefined)) {\n\t\tlog.warn(\n\t\t\t'useLiveKitRoom: options are ignored for a room created outside. Set them when you create the room.',\n\t\t);\n\t}\n\n\tfunction handleMediaDeviceError(e: Error): void {\n\t\tprops.onMediaDeviceFailure?.(MediaDeviceFailure.getFailure(e));\n\t}\n\n\tfunction handleEncryptionError(e: Error): void {\n\t\tprops.onEncryptionError?.(e);\n\t}\n\n\tfunction handleLocalMediaChange(publication: TrackPublication): void {\n\t\tif (shouldPersist(props)) {\n\t\t\trememberMediaState(publication);\n\t\t}\n\t}\n\n\tfunction handleDisconnected(reason?: DisconnectReason): void {\n\t\tconnectionState.value = ROOM_CONNECTION_STATE.DISCONNECTED;\n\t\tprops.onDisconnected?.(reason);\n\t}\n\n\tfunction handleConnected(): void {\n\t\tconnectionState.value = ROOM_CONNECTION_STATE.CONNECTED;\n\t\tprops.onConnected?.();\n\t}\n\n\tfunction setupEventHandlers(r: Room): () => void {\n\t\tfunction onSignalConnected(): void {\n\t\t\tconst localP = r.localParticipant;\n\t\t\tconst audio = props.audio ?? false;\n\t\t\tconst video = props.video ?? false;\n\t\t\tconst screen = props.screen ?? false;\n\t\t\tconst remembered = shouldPersist(props) ? loadRememberedMediaState() : NOTHING_REMEMBERED;\n\n\t\t\tPromise.all([\n\t\t\t\tlocalP.setMicrophoneEnabled(\n\t\t\t\t\taudio !== false && remembered.audioEnabled,\n\t\t\t\t\tcaptureOptions(audio),\n\t\t\t\t),\n\t\t\t\tlocalP.setCameraEnabled(video !== false && remembered.videoEnabled, captureOptions(video)),\n\t\t\t\tlocalP.setScreenShareEnabled(screen !== false, captureOptions(screen)),\n\t\t\t]).catch((e: unknown) => {\n\t\t\t\tlog.warn(e);\n\t\t\t\tprops.onError?.(toError(e));\n\t\t\t});\n\t\t}\n\n\t\tr.localParticipant\n\t\t\t.on(ParticipantEvent.LocalTrackPublished, handleLocalMediaChange)\n\t\t\t.on(ParticipantEvent.TrackMuted, handleLocalMediaChange)\n\t\t\t.on(ParticipantEvent.TrackUnmuted, handleLocalMediaChange);\n\n\t\tr.on(RoomEvent.SignalConnected, onSignalConnected)\n\t\t\t.on(RoomEvent.MediaDevicesError, handleMediaDeviceError)\n\t\t\t.on(RoomEvent.EncryptionError, handleEncryptionError)\n\t\t\t.on(RoomEvent.Disconnected, handleDisconnected)\n\t\t\t.on(RoomEvent.Connected, handleConnected);\n\n\t\treturn (): void => {\n\t\t\tr.localParticipant\n\t\t\t\t.off(ParticipantEvent.LocalTrackPublished, handleLocalMediaChange)\n\t\t\t\t.off(ParticipantEvent.TrackMuted, handleLocalMediaChange)\n\t\t\t\t.off(ParticipantEvent.TrackUnmuted, handleLocalMediaChange);\n\t\t\tr.off(RoomEvent.SignalConnected, onSignalConnected)\n\t\t\t\t.off(RoomEvent.MediaDevicesError, handleMediaDeviceError)\n\t\t\t\t.off(RoomEvent.EncryptionError, handleEncryptionError)\n\t\t\t\t.off(RoomEvent.Disconnected, handleDisconnected)\n\t\t\t\t.off(RoomEvent.Connected, handleConnected);\n\t\t};\n\t}\n\n\tfunction disconnectRoom(currentRoom: Room, effectState: EffectState): void {\n\t\tshouldConnect.value = false;\n\n\t\tcurrentRoom\n\t\t\t.disconnect()\n\t\t\t.catch(() => undefined)\n\t\t\t.finally(() => {\n\t\t\t\tif (!effectState.canceled) {\n\t\t\t\t\tconnectionState.value = ROOM_CONNECTION_STATE.DISCONNECTED;\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tfunction connectRoom(currentRoom: Room, effectState: EffectState): void {\n\t\tconst token = props.token;\n\t\tconst serverUrl = props.serverUrl;\n\n\t\tif (!isNonEmpty(token)) {\n\t\t\tconnectionState.value = ROOM_CONNECTION_STATE.DISCONNECTED;\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isNonEmpty(serverUrl)) {\n\t\t\tconnectionState.value = ROOM_CONNECTION_STATE.FAILED;\n\t\t\tprops.onError?.(new Error('no livekit url provided'));\n\n\t\t\treturn;\n\t\t}\n\n\t\tshouldConnect.value = true;\n\t\tconnectionState.value = ROOM_CONNECTION_STATE.CONNECTING;\n\n\t\tcurrentRoom.connect(serverUrl, token, props.connectOptions).then(\n\t\t\t() => {\n\t\t\t\tif (!effectState.canceled && shouldConnect.value) {\n\t\t\t\t\tconnectionState.value = ROOM_CONNECTION_STATE.CONNECTED;\n\t\t\t\t}\n\t\t\t},\n\t\t\t(e: unknown) => {\n\t\t\t\tif (!effectState.canceled && shouldConnect.value) {\n\t\t\t\t\tlog.warn('Connection error:', e);\n\t\t\t\t\tconnectionState.value = ROOM_CONNECTION_STATE.FAILED;\n\t\t\t\t\tprops.onError?.(toError(e));\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\t}\n\n\twatchEffect((onCleanup) => {\n\t\tif (room.value === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tonCleanup(setupEventHandlers(room.value));\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\tconst currentRoom = room.value;\n\n\t\tif (currentRoom === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst effectState: EffectState = { canceled: false };\n\t\tconst simulateCount = props.simulateParticipants ?? 0;\n\n\t\tif (simulateCount > 0) {\n\t\t\tsimulate(currentRoom, simulateCount).catch((error: unknown) => {\n\t\t\t\tlog.error('Failed to simulate participants:', error);\n\t\t\t});\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (props.connect === false) {\n\t\t\tdisconnectRoom(currentRoom, effectState);\n\n\t\t\tonCleanup(() => {\n\t\t\t\teffectState.canceled = true;\n\t\t\t});\n\n\t\t\treturn;\n\t\t}\n\n\t\tconnectRoom(currentRoom, effectState);\n\n\t\tonCleanup(() => {\n\t\t\teffectState.canceled = true;\n\n\t\t\tif (shouldConnect.value) {\n\t\t\t\tshouldConnect.value = false;\n\t\t\t\tcurrentRoom.disconnect().catch(() => undefined);\n\t\t\t}\n\t\t});\n\t});\n\n\tif (getCurrentInstance() !== null) {\n\t\tonBeforeUnmount(() => {\n\t\t\troom.value?.disconnect().catch((e: unknown) => {\n\t\t\t\tlog.warn('Error during disconnection:', e);\n\t\t\t});\n\t\t});\n\t}\n\n\tconst liveKitRoom: UseLiveKitRoom = {\n\t\troom,\n\t\tconnectionState,\n\t};\n\n\treturn liveKitRoom;\n}\n","<template>\n\t<div\n\t\tv-bind=\"styleAttrs\"\n\t\t:data-lk-connection-state=\"connectionState\"\n\t>\n\t\t<RoomContextProvider\n\t\t\tv-if=\"room !== undefined\"\n\t\t\t:room=\"room\"\n\t\t>\n\t\t\t<slot :room=\"room\" />\n\t\t</RoomContextProvider>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\n\timport type {\n\t\tAudioCaptureOptions,\n\t\tDisconnectReason,\n\t\tMediaDeviceFailure,\n\t\tRoom,\n\t\tRoomConnectOptions,\n\t\tRoomOptions,\n\t\tScreenShareCaptureOptions,\n\t\tVideoCaptureOptions,\n\t} from 'livekit-client';\n\n\timport RoomContextProvider from '@/components/context/RoomContextProvider.vue';\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useLiveKitRoom } from '@/composables/useLiveKitRoom';\n\n\texport interface LiveKitRoomComponentProps extends LkStyleProps {\n\t\tserverUrl?: string;\n\t\ttoken?: string;\n\t\taudio?: AudioCaptureOptions | boolean;\n\t\tvideo?: VideoCaptureOptions | boolean;\n\t\tscreen?: ScreenShareCaptureOptions | boolean;\n\t\tpersistUserChoices?: boolean;\n\t\tconnect?: boolean;\n\t\toptions?: RoomOptions;\n\t\tconnectOptions?: RoomConnectOptions;\n\t\troom?: Room;\n\t\tsimulateParticipants?: number;\n\t}\n\n\tconst props = withDefaults(defineProps<LiveKitRoomComponentProps>(), {\n\t\taudio: false,\n\t\tvideo: false,\n\t\tscreen: false,\n\t\tpersistUserChoices: true,\n\t\tconnect: true,\n\t});\n\n\tconst emits = defineEmits<{\n\t\tconnected: [];\n\t\tdisconnected: [reason?: DisconnectReason];\n\t\terror: [error: Error];\n\t\tmediaDeviceFailure: [failure?: MediaDeviceFailure];\n\t\tencryptionError: [error: Error];\n\t}>();\n\n\tdefineSlots<{ default?: (props: { room: Room }) => unknown }>();\n\n\tconst { room, connectionState } = useLiveKitRoom({\n\t\tget serverUrl() {\n\t\t\treturn props.serverUrl;\n\t\t},\n\t\tget token() {\n\t\t\treturn props.token;\n\t\t},\n\t\tget audio() {\n\t\t\treturn props.audio;\n\t\t},\n\t\tget video() {\n\t\t\treturn props.video;\n\t\t},\n\t\tget screen() {\n\t\t\treturn props.screen;\n\t\t},\n\t\tget persistUserChoices() {\n\t\t\treturn props.persistUserChoices;\n\t\t},\n\t\tget connect() {\n\t\t\treturn props.connect;\n\t\t},\n\t\tget options() {\n\t\t\treturn props.options;\n\t\t},\n\t\tget connectOptions() {\n\t\t\treturn props.connectOptions;\n\t\t},\n\t\tget room() {\n\t\t\treturn props.room;\n\t\t},\n\t\tget simulateParticipants() {\n\t\t\treturn props.simulateParticipants;\n\t\t},\n\t\tonConnected: () => emits('connected'),\n\t\tonDisconnected: (reason) => emits('disconnected', reason),\n\t\tonError: (error) => emits('error', error),\n\t\tonMediaDeviceFailure: (failure) => emits('mediaDeviceFailure', failure),\n\t\tonEncryptionError: (error) => emits('encryptionError', error),\n\t});\n\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-root', 'lk-room-container']);\n</script>\n","<template>\n\t<ParticipantContextProvider\n\t\tv-for=\"participant in participants\"\n\t\t:key=\"participant.identity\"\n\t\t:participant=\"participant\"\n\t>\n\t\t<slot :participant=\"participant\" />\n\t</ParticipantContextProvider>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { Participant } from 'livekit-client';\n\n\timport ParticipantContextProvider from '@/components/context/ParticipantContextProvider.vue';\n\n\texport interface ParticipantLoopProps {\n\t\tparticipants: Participant[];\n\t}\n\n\tdefineProps<ParticipantLoopProps>();\n\n\tdefineSlots<{ default?: (props: { participant: Participant }) => unknown }>();\n</script>\n","import { log, roomInfoObserver } from '@livekit/components-core';\nimport type { Room } from 'livekit-client';\nimport { ref, watchEffect, type Ref } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nexport interface UseRoomInfoProps {\n\treadonly room?: Room;\n}\n\nexport interface RoomInfo {\n\treadonly name: string;\n\treadonly metadata: string | undefined;\n}\n\nexport interface UseRoomInfo {\n\treadonly info: Ref<RoomInfo>;\n}\n\nexport function useRoomInfo(props: UseRoomInfoProps = {}): UseRoomInfo {\n\tconst room = useEnsureRoomContext(props.room);\n\n\tconst info = ref<RoomInfo>({\n\t\tname: room.value.name,\n\t\tmetadata: room.value.metadata,\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = roomInfoObserver(room.value).subscribe({\n\t\t\tnext: (roomInfo) => {\n\t\t\t\tinfo.value = roomInfo;\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in room info observer:', error);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst result: UseRoomInfo = {\n\t\tinfo,\n\t};\n\n\treturn result;\n}\n","<template>\n\t<span v-bind=\"styleAttrs\">\n\t\t<slot v-if=\"childrenPosition === 'before'\" />{{ info.name\n\t\t}}<slot v-if=\"childrenPosition === 'after'\" />\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\n\timport type { Room } from 'livekit-client';\n\n\timport { useStyleAttrs, type LkStyleProps } from '@/components/style';\n\timport { useRoomInfo } from '@/composables/useRoomInfo';\n\n\texport interface RoomNameProps extends LkStyleProps {\n\t\troom?: Room;\n\t\tchildrenPosition?: 'before' | 'after';\n\t}\n\n\tconst props = withDefaults(defineProps<RoomNameProps>(), { childrenPosition: 'before' });\n\n\tdefineSlots<{ default?: () => unknown }>();\n\n\tconst { info } = useRoomInfo({ room: props.room });\n\tconst styleAttrs = useStyleAttrs(props, () => ['lk-room-name']);\n</script>\n","import { useEventListener } from '@vueuse/core';\n\ntype Listener = (...args: never[]) => void;\n\nexport type EventMap<Events> = { readonly [K in keyof Events]: Listener };\n\nexport class TypedEmitter<Events extends EventMap<Events>> {\n\tdeclare public readonly events?: Events;\n\n\tprivate readonly listeners = new Map<keyof Events, Set<Listener>>();\n\n\tprivate readonly onceListeners = new WeakSet<Listener>();\n\n\tpublic on<E extends keyof Events>(event: E, listener: Events[E]): this {\n\t\tconst set = this.listeners.get(event) ?? new Set<Listener>();\n\n\t\tset.add(listener);\n\t\tthis.listeners.set(event, set);\n\n\t\treturn this;\n\t}\n\n\tpublic off<E extends keyof Events>(event: E, listener: Events[E]): this {\n\t\tthis.listeners.get(event)?.delete(listener);\n\n\t\treturn this;\n\t}\n\n\tpublic once<E extends keyof Events>(event: E, listener: Events[E]): this {\n\t\tthis.onceListeners.add(listener);\n\n\t\treturn this.on(event, listener);\n\t}\n\n\tpublic emit<E extends keyof Events>(event: E, ...args: Parameters<Events[E]>): boolean {\n\t\tconst set = this.listeners.get(event);\n\n\t\tif (set === undefined || set.size === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (const listener of Array.from(set)) {\n\t\t\tif (this.onceListeners.has(listener)) {\n\t\t\t\tset.delete(listener);\n\t\t\t}\n\n\t\t\tReflect.apply(listener, undefined, args);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic removeAllListeners(event?: keyof Events): this {\n\t\tif (event === undefined) {\n\t\t\tthis.listeners.clear();\n\t\t} else {\n\t\t\tthis.listeners.delete(event);\n\t\t}\n\n\t\treturn this;\n\t}\n}\n\nexport function waitForValue<T, U extends T>(\n\tsubscribe: (listener: (value: T) => void) => () => void,\n\taccept: (value: T) => value is U,\n\tabortMessage: string,\n\tsignal?: AbortSignal,\n): Promise<U>;\nexport function waitForValue<T>(\n\tsubscribe: (listener: (value: T) => void) => () => void,\n\taccept: (value: T) => boolean,\n\tabortMessage: string,\n\tsignal?: AbortSignal,\n): Promise<T>;\nexport function waitForValue<T>(\n\tsubscribe: (listener: (value: T) => void) => () => void,\n\taccept: (value: T) => boolean,\n\tabortMessage: string,\n\tsignal?: AbortSignal,\n): Promise<T> {\n\treturn new Promise<T>((resolve, reject) => {\n\t\tif (signal?.aborted === true) {\n\t\t\treject(new Error(abortMessage));\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst stops: (() => void)[] = [];\n\n\t\tfunction cleanup(): void {\n\t\t\tfor (const stop of stops.splice(0)) {\n\t\t\t\tstop();\n\t\t\t}\n\t\t}\n\n\t\tfunction onAbort(): void {\n\t\t\tcleanup();\n\t\t\treject(new Error(abortMessage));\n\t\t}\n\n\t\tfunction onValue(value: T): void {\n\t\t\tif (!accept(value)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcleanup();\n\t\t\tresolve(value);\n\t\t}\n\n\t\tstops.push(subscribe(onValue));\n\n\t\tif (signal !== undefined) {\n\t\t\tstops.push(useEventListener(signal, 'abort', onAbort));\n\t\t}\n\t});\n}\n","export function isBrowser(): boolean {\n\treturn typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n","import type { Observable } from 'rxjs';\nimport {\n\tgetCurrentScope,\n\tonScopeDispose,\n\tshallowReadonly,\n\tshallowRef,\n\ttoValue,\n\twatch,\n\ttype MaybeRefOrGetter,\n\ttype ShallowRef,\n} from 'vue';\n\nimport { isBrowser } from './refs';\n\nexport function useObservableState<T>(\n\tsource: MaybeRefOrGetter<Observable<T> | undefined>,\n\tstartWith: T,\n\tresetWhenObservableChanges = true,\n): Readonly<ShallowRef<T>> {\n\tconst state = shallowRef<T>(startWith);\n\n\tif (!isBrowser()) {\n\t\treturn shallowReadonly(state);\n\t}\n\n\tconst stop = watch(\n\t\t() => toValue(source),\n\t\t(observable, _previous, onCleanup) => {\n\t\t\tif (resetWhenObservableChanges) {\n\t\t\t\tstate.value = startWith;\n\t\t\t}\n\n\t\t\tif (observable === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst subscription = observable.subscribe((value) => {\n\t\t\t\tstate.value = value;\n\t\t\t});\n\n\t\t\tonCleanup(() => {\n\t\t\t\tsubscription.unsubscribe();\n\t\t\t});\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\tif (getCurrentScope() !== undefined) {\n\t\tonScopeDispose(stop);\n\t}\n\n\treturn shallowReadonly(state);\n}\n","import type {\n\tParticipant,\n\tParticipantEventCallbacks,\n\tRoom,\n\tRoomEventCallbacks,\n} from 'livekit-client';\nimport {\n\tgetCurrentScope,\n\tonScopeDispose,\n\ttoValue,\n\twatch,\n\ttype MaybeRefOrGetter,\n\ttype WatchStopHandle,\n} from 'vue';\n\nimport type { EventMap, TypedEmitter } from '@/internal/emitter';\n\nexport interface InternalEmitterHolder<Events extends EventMap<Events>> {\n\treadonly internal: {\n\t\treadonly emitter: TypedEmitter<Events>;\n\t};\n}\n\nexport type EmitterTarget<Events extends EventMap<Events>> =\n\t| TypedEmitter<Events>\n\t| InternalEmitterHolder<Events>;\n\nexport interface UseEvents {\n\treadonly stop: WatchStopHandle;\n}\n\ninterface Listening {\n\ton(event: string, listener: (...args: never[]) => void): unknown;\n\toff(event: string, listener: (...args: never[]) => void): unknown;\n}\n\ninterface InternalListening {\n\treadonly internal: {\n\t\treadonly emitter: Listening;\n\t};\n}\n\nexport function useEvents<E extends keyof RoomEventCallbacks>(\n\ttarget: MaybeRefOrGetter<Room | null | undefined>,\n\tevent: E,\n\thandler: RoomEventCallbacks[E],\n): UseEvents;\nexport function useEvents<E extends keyof ParticipantEventCallbacks>(\n\ttarget: MaybeRefOrGetter<Participant | null | undefined>,\n\tevent: E,\n\thandler: ParticipantEventCallbacks[E],\n): UseEvents;\nexport function useEvents<Events extends EventMap<Events>, E extends keyof Events>(\n\ttarget: MaybeRefOrGetter<EmitterTarget<Events> | null | undefined>,\n\tevent: E,\n\thandler: Events[E],\n): UseEvents;\nexport function useEvents(\n\ttarget: MaybeRefOrGetter<Listening | InternalListening | null | undefined>,\n\tevent: string,\n\thandler: (...args: never[]) => void,\n): UseEvents {\n\tconst stop = watch(\n\t\t() => {\n\t\t\tconst value = toValue(target);\n\n\t\t\tif (value === null || value === undefined) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn 'internal' in value ? value.internal.emitter : value;\n\t\t},\n\t\t(emitter, _previous, onCleanup) => {\n\t\t\tif (emitter === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\temitter.on(event, handler);\n\n\t\t\tonCleanup(() => {\n\t\t\t\temitter.off(event, handler);\n\t\t\t});\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\tif (getCurrentScope() !== undefined) {\n\t\tonScopeDispose(stop);\n\t}\n\n\tconst events: UseEvents = {\n\t\tstop,\n\t};\n\n\treturn events;\n}\n","import { connectedParticipantsObserver, log } from '@livekit/components-core';\nimport type { RemoteParticipant, Room, RoomEvent } from 'livekit-client';\nimport { shallowRef, watchEffect, type ShallowRef } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nexport interface UseRemoteParticipantsProps {\n\treadonly updateOnlyOn?: RoomEvent[];\n\treadonly room?: Room;\n}\n\nexport interface UseRemoteParticipants {\n\treadonly participants: ShallowRef<RemoteParticipant[]>;\n}\n\nexport function useRemoteParticipants(\n\tprops: UseRemoteParticipantsProps = {},\n): UseRemoteParticipants {\n\tconst room = useEnsureRoomContext(props.room);\n\tconst participants = shallowRef<RemoteParticipant[]>([]);\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = connectedParticipantsObserver(room.value, {\n\t\t\tadditionalRoomEvents: props.updateOnlyOn,\n\t\t}).subscribe({\n\t\t\tnext: (participantList) => {\n\t\t\t\tparticipants.value = participantList;\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in remote participants observer:', error);\n\t\t\t\tparticipants.value = [];\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst result: UseRemoteParticipants = {\n\t\tparticipants,\n\t};\n\n\treturn result;\n}\n","import {\n\tParticipantAgentAttributes,\n\tparticipantAttributesObserver,\n\tparticipantInfoObserver,\n\tparticipantTracksObservable,\n\ttype TrackReference,\n} from '@livekit/components-core';\nimport {\n\tConnectionState,\n\tParticipantEvent,\n\tParticipantKind,\n\tRoomEvent,\n\tTrack,\n\ttype LocalTrackPublication,\n\ttype Participant,\n\ttype RemoteParticipant,\n\ttype Room,\n\ttype TrackPublication,\n} from 'livekit-client';\nimport {\n\tcomputed,\n\tgetCurrentScope,\n\tonScopeDispose,\n\treadonly,\n\tref,\n\tshallowRef,\n\twatch,\n\ttype ComputedRef,\n\ttype Ref,\n} from 'vue';\n\nimport { useEnsureSession } from '@/context/session.context';\nimport { TypedEmitter, useObservableState, waitForValue } from '@/internal';\nimport type { AgentSdkState, AgentState } from '@/types';\n\nimport { useEvents } from './useEvents';\nimport { useRemoteParticipants } from './useRemoteParticipants';\nimport type { UseSession } from './useSession';\n\nexport type AgentEvent = (typeof AGENT_EVENT)[keyof typeof AGENT_EVENT];\n\nexport interface AgentCallbacks {\n\treadonly cameraChanged: (track: TrackReference | undefined) => void;\n\treadonly microphoneChanged: (track: TrackReference | undefined) => void;\n\treadonly stateChanged: (state: AgentState) => void;\n}\n\nexport interface AgentStateFlags {\n\treadonly isConnected: boolean;\n\treadonly canListen: boolean;\n\treadonly isFinished: boolean;\n\treadonly isPending: boolean;\n}\n\nexport interface AgentTimeoutStore {\n\treadonly failureReason: Readonly<Ref<string | null>>;\n\treadonly start: (timeoutMilliseconds?: number) => void;\n\treadonly clear: () => void;\n\treadonly clearFailureReason: () => void;\n\treadonly updateState: (state: AgentState) => void;\n\treadonly updateParticipantExists: (exists: boolean) => void;\n}\n\nexport interface UseAgentInternal {\n\treadonly emitter: TypedEmitter<AgentCallbacks>;\n\treadonly agentParticipant: ComputedRef<RemoteParticipant | null>;\n\treadonly workerParticipant: ComputedRef<RemoteParticipant | null>;\n}\n\nexport interface UseAgent {\n\treadonly state: ComputedRef<AgentState>;\n\treadonly failureReasons: ComputedRef<string[] | null>;\n\treadonly identity: ComputedRef<string | undefined>;\n\treadonly name: ComputedRef<string | undefined>;\n\treadonly metadata: ComputedRef<string | undefined>;\n\treadonly attributes: ComputedRef<Readonly<Record<string, string>>>;\n\treadonly isConnected: ComputedRef<boolean>;\n\treadonly canListen: ComputedRef<boolean>;\n\treadonly isFinished: ComputedRef<boolean>;\n\treadonly isPending: ComputedRef<boolean>;\n\treadonly cameraTrack: ComputedRef<TrackReference | undefined>;\n\treadonly microphoneTrack: ComputedRef<TrackReference | undefined>;\n\treadonly internal: UseAgentInternal;\n\treadonly waitUntilConnected: (signal?: AbortSignal) => Promise<void>;\n\treadonly waitUntilCouldBeListening: (signal?: AbortSignal) => Promise<void>;\n\treadonly waitUntilFinished: (signal?: AbortSignal) => Promise<void>;\n\treadonly waitUntilCamera: (signal?: AbortSignal) => Promise<TrackReference>;\n\treadonly waitUntilMicrophone: (signal?: AbortSignal) => Promise<TrackReference>;\n}\n\nexport interface AgentSessionStub {\n\treadonly room: Room;\n\treadonly connectionState: Readonly<Ref<ConnectionState>>;\n\treadonly agentTimeout: AgentTimeoutStore;\n\treadonly agentConnectTimeoutMilliseconds: () => number | undefined;\n}\n\ntype AgentTrackEvent = typeof AGENT_EVENT.CAMERA_CHANGED | typeof AGENT_EVENT.MICROPHONE_CHANGED;\n\nexport const AGENT_EVENT = {\n\tCAMERA_CHANGED: 'cameraChanged',\n\tMICROPHONE_CHANGED: 'microphoneChanged',\n\tSTATE_CHANGED: 'stateChanged',\n} as const;\n\nexport const DEFAULT_AGENT_CONNECT_TIMEOUT_MILLISECONDS = 20_000;\n\nconst AGENT_SOURCES = { sources: [Track.Source.Camera, Track.Source.Microphone] };\n\nconst NOT_JOINED_STATES: ReadonlySet<AgentState> = new Set<AgentState>([\n\t'disconnected',\n\t'connecting',\n\t'failed',\n]);\n\nfunction isAgentSdkState(value: string): value is AgentSdkState {\n\treturn (\n\t\tvalue === 'initializing' ||\n\t\tvalue === 'idle' ||\n\t\tvalue === 'listening' ||\n\t\tvalue === 'thinking' ||\n\t\tvalue === 'speaking'\n\t);\n}\n\nfunction isTrackReference(track: TrackReference | undefined): track is TrackReference {\n\treturn track !== undefined;\n}\n\nfunction isAgent(participant: Participant): boolean {\n\treturn (\n\t\tparticipant.kind === ParticipantKind.AGENT &&\n\t\t!(ParticipantAgentAttributes.PublishOnBehalf in participant.attributes)\n\t);\n}\n\nfunction isWorkerOf(participant: Participant, agent: Participant): boolean {\n\treturn (\n\t\tparticipant.kind === ParticipantKind.AGENT &&\n\t\tparticipant.attributes[ParticipantAgentAttributes.PublishOnBehalf] === agent.identity\n\t);\n}\n\nfunction findTrack(\n\ttracks: readonly TrackReference[],\n\tsource: Track.Source,\n): TrackReference | undefined {\n\treturn tracks.find((track) => {\n\t\treturn track.source === source;\n\t});\n}\n\nfunction localMicrophoneOf(room: Room): LocalTrackPublication | null {\n\treturn room.localParticipant.getTrackPublication(Track.Source.Microphone) ?? null;\n}\n\nexport function agentStateFlags(state: AgentState): AgentStateFlags {\n\tconst isConnected = state === 'listening' || state === 'thinking' || state === 'speaking';\n\n\tconst flags: AgentStateFlags = {\n\t\tisConnected,\n\t\tcanListen: isConnected || state === 'pre-connect-buffering',\n\t\tisFinished: state === 'disconnected' || state === 'failed',\n\t\tisPending: state === 'connecting' || state === 'initializing' || state === 'idle',\n\t};\n\n\treturn flags;\n}\n\nexport function createAgentTimeoutStore(): AgentTimeoutStore {\n\tconst failureReason = ref<string | null>(null);\n\n\tlet timeoutId: ReturnType<typeof setTimeout> | null = null;\n\tlet agentState: AgentState = 'connecting';\n\tlet participantExists = false;\n\n\tfunction clear(): void {\n\t\tif (timeoutId !== null) {\n\t\t\tclearTimeout(timeoutId);\n\t\t\ttimeoutId = null;\n\t\t}\n\n\t\tfailureReason.value = null;\n\t\tagentState = 'connecting';\n\t\tparticipantExists = false;\n\t}\n\n\tfunction onTimeout(): void {\n\t\ttimeoutId = null;\n\n\t\tif (!participantExists) {\n\t\t\tfailureReason.value = 'Agent did not join the room.';\n\t\t} else if (!agentStateFlags(agentState).isConnected) {\n\t\t\tfailureReason.value = 'Agent joined the room but did not complete initializing.';\n\t\t}\n\t}\n\n\tfunction start(timeoutMilliseconds = DEFAULT_AGENT_CONNECT_TIMEOUT_MILLISECONDS): void {\n\t\tclear();\n\t\ttimeoutId = setTimeout(onTimeout, timeoutMilliseconds);\n\t}\n\n\tfunction clearFailureReason(): void {\n\t\tfailureReason.value = null;\n\t}\n\n\tfunction updateState(state: AgentState): void {\n\t\tagentState = state;\n\t}\n\n\tfunction updateParticipantExists(exists: boolean): void {\n\t\tparticipantExists = exists;\n\t}\n\n\tif (getCurrentScope() !== undefined) {\n\t\tonScopeDispose(clear);\n\t}\n\n\tconst store: AgentTimeoutStore = {\n\t\tfailureReason: readonly(failureReason),\n\t\tstart,\n\t\tclear,\n\t\tclearFailureReason,\n\t\tupdateState,\n\t\tupdateParticipantExists,\n\t};\n\n\treturn store;\n}\n\nexport function setupAgent(session: AgentSessionStub): UseAgent {\n\tconst { room, connectionState, agentTimeout } = session;\n\tconst emitter = new TypedEmitter<AgentCallbacks>();\n\n\tlet lastAgentIdentity: string | undefined;\n\n\tconst { participants } = useRemoteParticipants({ room });\n\n\tconst disconnectedFailureReason = ref<string | null>(null);\n\tconst localMicrophone = shallowRef<LocalTrackPublication | null>(localMicrophoneOf(room));\n\n\tconst agentParticipant = computed<RemoteParticipant | null>(() => {\n\t\treturn participants.value.find(isAgent) ?? null;\n\t});\n\n\tconst workerParticipant = computed<RemoteParticipant | null>(() => {\n\t\tconst agent = agentParticipant.value;\n\n\t\tif (agent === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\tparticipants.value.find((participant) => {\n\t\t\t\treturn isWorkerOf(participant, agent);\n\t\t\t}) ?? null\n\t\t);\n\t});\n\n\tconst attributeState = useObservableState(() => {\n\t\treturn agentParticipant.value === null\n\t\t\t? undefined\n\t\t\t: participantAttributesObserver(agentParticipant.value);\n\t}, undefined);\n\n\tconst info = useObservableState(() => {\n\t\treturn agentParticipant.value === null\n\t\t\t? undefined\n\t\t\t: participantInfoObserver(agentParticipant.value);\n\t}, undefined);\n\n\tconst agentTracks = useObservableState<TrackReference[]>(() => {\n\t\treturn agentParticipant.value === null\n\t\t\t? undefined\n\t\t\t: participantTracksObservable(agentParticipant.value, AGENT_SOURCES);\n\t}, []);\n\n\tconst workerTracks = useObservableState<TrackReference[]>(() => {\n\t\treturn workerParticipant.value === null\n\t\t\t? undefined\n\t\t\t: participantTracksObservable(workerParticipant.value, AGENT_SOURCES);\n\t}, []);\n\n\tconst attributes = computed<Readonly<Record<string, string>>>(() => {\n\t\treturn attributeState.value?.attributes ?? agentParticipant.value?.attributes ?? {};\n\t});\n\n\tconst anyCameraTrack = computed<TrackReference | undefined>(() => {\n\t\treturn (\n\t\t\tfindTrack(agentTracks.value, Track.Source.Camera) ??\n\t\t\tfindTrack(workerTracks.value, Track.Source.Camera)\n\t\t);\n\t});\n\n\tconst anyMicrophoneTrack = computed<TrackReference | undefined>(() => {\n\t\treturn (\n\t\t\tfindTrack(agentTracks.value, Track.Source.Microphone) ??\n\t\t\tfindTrack(workerTracks.value, Track.Source.Microphone)\n\t\t);\n\t});\n\n\tconst reasons = computed<string[]>(() => {\n\t\treturn [agentTimeout.failureReason.value, disconnectedFailureReason.value].filter(\n\t\t\t(reason): reason is string => {\n\t\t\t\treturn reason !== null;\n\t\t\t},\n\t\t);\n\t});\n\n\tconst state = computed<AgentState>(() => {\n\t\tif (reasons.value.length > 0) {\n\t\t\treturn 'failed';\n\t\t}\n\n\t\tconst reported = attributes.value[ParticipantAgentAttributes.AgentState];\n\n\t\tif (agentParticipant.value !== null && reported !== undefined && isAgentSdkState(reported)) {\n\t\t\treturn reported;\n\t\t}\n\n\t\tif (localMicrophone.value !== null) {\n\t\t\treturn 'pre-connect-buffering';\n\t\t}\n\n\t\treturn connectionState.value === ConnectionState.Disconnected ? 'disconnected' : 'connecting';\n\t});\n\n\tconst flags = computed<AgentStateFlags>(() => {\n\t\treturn agentStateFlags(state.value);\n\t});\n\n\tconst hasJoined = computed<boolean>(() => {\n\t\treturn !NOT_JOINED_STATES.has(state.value);\n\t});\n\n\tconst failureReasons = computed<string[] | null>(() => {\n\t\treturn state.value === 'failed' ? reasons.value : null;\n\t});\n\n\tconst identity = computed<string | undefined>(() => {\n\t\treturn hasJoined.value ? info.value?.identity : undefined;\n\t});\n\n\tconst name = computed<string | undefined>(() => {\n\t\treturn hasJoined.value ? info.value?.name : undefined;\n\t});\n\n\tconst metadata = computed<string | undefined>(() => {\n\t\treturn hasJoined.value ? info.value?.metadata : undefined;\n\t});\n\n\tconst isConnected = computed<boolean>(() => {\n\t\treturn flags.value.isConnected;\n\t});\n\n\tconst canListen = computed<boolean>(() => {\n\t\treturn flags.value.canListen;\n\t});\n\n\tconst isFinished = computed<boolean>(() => {\n\t\treturn flags.value.isFinished;\n\t});\n\n\tconst isPending = computed<boolean>(() => {\n\t\treturn flags.value.isPending;\n\t});\n\n\tconst cameraTrack = computed<TrackReference | undefined>(() => {\n\t\treturn hasJoined.value ? anyCameraTrack.value : undefined;\n\t});\n\n\tconst microphoneTrack = computed<TrackReference | undefined>(() => {\n\t\treturn hasJoined.value ? anyMicrophoneTrack.value : undefined;\n\t});\n\n\tfunction untilState(\n\t\taccept: (flags: AgentStateFlags) => boolean,\n\t\tmethod: string,\n\t\tsignal?: AbortSignal,\n\t): Promise<void> {\n\t\tif (accept(flags.value)) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\treturn waitForValue<AgentState>(\n\t\t\t(listener) => {\n\t\t\t\temitter.on(AGENT_EVENT.STATE_CHANGED, listener);\n\n\t\t\t\treturn () => {\n\t\t\t\t\temitter.off(AGENT_EVENT.STATE_CHANGED, listener);\n\t\t\t\t};\n\t\t\t},\n\t\t\t(next) => {\n\t\t\t\treturn accept(agentStateFlags(next));\n\t\t\t},\n\t\t\t`useAgent().${method} - signal aborted`,\n\t\t\tsignal,\n\t\t).then(() => undefined);\n\t}\n\n\tfunction untilTrack(\n\t\tevent: AgentTrackEvent,\n\t\tcurrent: TrackReference | undefined,\n\t\tmethod: string,\n\t\tsignal?: AbortSignal,\n\t): Promise<TrackReference> {\n\t\tif (current !== undefined) {\n\t\t\treturn Promise.resolve(current);\n\t\t}\n\n\t\treturn waitForValue<TrackReference | undefined, TrackReference>(\n\t\t\t(listener) => {\n\t\t\t\temitter.on(event, listener);\n\n\t\t\t\treturn () => {\n\t\t\t\t\temitter.off(event, listener);\n\t\t\t\t};\n\t\t\t},\n\t\t\tisTrackReference,\n\t\t\t`useAgent().${method} - signal aborted`,\n\t\t\tsignal,\n\t\t);\n\t}\n\n\tfunction waitUntilConnected(signal?: AbortSignal): Promise<void> {\n\t\treturn untilState(\n\t\t\t(next) => {\n\t\t\t\treturn next.isConnected;\n\t\t\t},\n\t\t\t'waitUntilConnected',\n\t\t\tsignal,\n\t\t);\n\t}\n\n\tfunction waitUntilCouldBeListening(signal?: AbortSignal): Promise<void> {\n\t\treturn untilState(\n\t\t\t(next) => {\n\t\t\t\treturn next.canListen;\n\t\t\t},\n\t\t\t'waitUntilCouldBeListening',\n\t\t\tsignal,\n\t\t);\n\t}\n\n\tfunction waitUntilFinished(signal?: AbortSignal): Promise<void> {\n\t\treturn untilState(\n\t\t\t(next) => {\n\t\t\t\treturn next.isFinished;\n\t\t\t},\n\t\t\t'waitUntilFinished',\n\t\t\tsignal,\n\t\t);\n\t}\n\n\tfunction waitUntilCamera(signal?: AbortSignal): Promise<TrackReference> {\n\t\treturn untilTrack(AGENT_EVENT.CAMERA_CHANGED, anyCameraTrack.value, 'waitUntilCamera', signal);\n\t}\n\n\tfunction waitUntilMicrophone(signal?: AbortSignal): Promise<TrackReference> {\n\t\treturn untilTrack(\n\t\t\tAGENT_EVENT.MICROPHONE_CHANGED,\n\t\t\tanyMicrophoneTrack.value,\n\t\t\t'waitUntilMicrophone',\n\t\t\tsignal,\n\t\t);\n\t}\n\n\tuseEvents(room, RoomEvent.ParticipantDisconnected, (participant) => {\n\t\tif (lastAgentIdentity !== undefined && participant.identity === lastAgentIdentity) {\n\t\t\tdisconnectedFailureReason.value = 'Agent left the room unexpectedly.';\n\t\t}\n\t});\n\n\tuseEvents(room.localParticipant, ParticipantEvent.LocalTrackPublished, () => {\n\t\tlocalMicrophone.value = localMicrophoneOf(room);\n\t});\n\n\tuseEvents(\n\t\troom.localParticipant,\n\t\tParticipantEvent.LocalTrackUnpublished,\n\t\t(publication: TrackPublication) => {\n\t\t\tif (publication.source === Track.Source.Microphone) {\n\t\t\t\tlocalMicrophone.value = null;\n\t\t\t}\n\t\t},\n\t);\n\n\twatch(anyCameraTrack, (track) => {\n\t\temitter.emit(AGENT_EVENT.CAMERA_CHANGED, track);\n\t});\n\n\twatch(anyMicrophoneTrack, (track) => {\n\t\temitter.emit(AGENT_EVENT.MICROPHONE_CHANGED, track);\n\t});\n\n\twatch(agentParticipant, (participant) => {\n\t\tif (participant !== null) {\n\t\t\tagentTimeout.clearFailureReason();\n\t\t}\n\t});\n\n\twatch(\n\t\tagentParticipant,\n\t\t(participant) => {\n\t\t\tif (participant !== null) {\n\t\t\t\tlastAgentIdentity = participant.identity;\n\t\t\t}\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\twatch(connectionState, (next) => {\n\t\tif (next !== ConnectionState.Disconnected) {\n\t\t\treturn;\n\t\t}\n\n\t\tdisconnectedFailureReason.value = null;\n\t\tlastAgentIdentity = undefined;\n\t});\n\n\twatch(\n\t\tstate,\n\t\t(next) => {\n\t\t\temitter.emit(AGENT_EVENT.STATE_CHANGED, next);\n\t\t\tagentTimeout.updateState(next);\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\twatch(\n\t\tagentParticipant,\n\t\t(participant) => {\n\t\t\tagentTimeout.updateParticipantExists(participant !== null);\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\twatch(\n\t\t() => {\n\t\t\treturn connectionState.value === ConnectionState.Disconnected;\n\t\t},\n\t\t(disconnected, _previous, onCleanup) => {\n\t\t\tif (disconnected) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tagentTimeout.start(session.agentConnectTimeoutMilliseconds());\n\t\t\tagentTimeout.updateState(state.value);\n\t\t\tagentTimeout.updateParticipantExists(agentParticipant.value !== null);\n\n\t\t\tonCleanup(() => {\n\t\t\t\tagentTimeout.clear();\n\t\t\t});\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\tconst internal: UseAgentInternal = {\n\t\temitter,\n\t\tagentParticipant,\n\t\tworkerParticipant,\n\t};\n\n\tconst agent: UseAgent = {\n\t\tstate,\n\t\tfailureReasons,\n\t\tidentity,\n\t\tname,\n\t\tmetadata,\n\t\tattributes,\n\t\tisConnected,\n\t\tcanListen,\n\t\tisFinished,\n\t\tisPending,\n\t\tcameraTrack,\n\t\tmicrophoneTrack,\n\t\tinternal,\n\t\twaitUntilConnected,\n\t\twaitUntilCouldBeListening,\n\t\twaitUntilFinished,\n\t\twaitUntilCamera,\n\t\twaitUntilMicrophone,\n\t};\n\n\treturn agent;\n}\n\nexport function useAgent(session?: UseSession): UseAgent {\n\treturn useEnsureSession(session).value.internal.agent;\n}\n","import { log, setupTextStream, type TextStreamData } from '@livekit/components-core';\nimport {\n\tConnectionState,\n\ttype Room,\n\ttype TextStreamHandler,\n\ttype TextStreamWriter,\n} from 'livekit-client';\nimport {\n\tcomputed,\n\tgetCurrentScope,\n\tonScopeDispose,\n\tref,\n\tshallowRef,\n\twatch,\n\ttype ComputedRef,\n\ttype ShallowRef,\n} from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\nimport { useObservableState } from '@/internal';\n\nimport { useConnectionState } from './useConnectionState';\n\nexport interface TextStreamInfo {\n\treadonly id: string;\n\treadonly topic: string;\n\treadonly timestamp: number;\n\treadonly size?: number;\n}\n\nexport interface UseTextStreamProps {\n\treadonly topic: string;\n\treadonly room?: Room;\n\treadonly onMessage?: TextStreamHandler;\n\treadonly autoCloseStreams?: boolean;\n}\n\nexport interface UseTextStream {\n\treadonly textStreams: Readonly<ShallowRef<TextStreamData[]>>;\n\treadonly isSending: ComputedRef<boolean>;\n\treadonly activeWriter: ComputedRef<TextStreamWriter | null>;\n\treadonly topic: ComputedRef<string>;\n\treadonly sendText: (text: string) => Promise<TextStreamInfo>;\n\treadonly streamText: () => Promise<TextStreamWriter>;\n\treadonly registerHandler: (handler: TextStreamHandler) => void;\n\treadonly unregisterHandler: () => void;\n\treadonly closeActiveStream: () => Promise<void>;\n}\n\nexport function useTextStream(props: UseTextStreamProps): UseTextStream {\n\tconst room = useEnsureRoomContext(props.room);\n\tconst { connectionState } = useConnectionState({ room: room.value });\n\n\tconst sending = ref<boolean>(false);\n\tconst activeStreamWriter = shallowRef<TextStreamWriter | null>(null);\n\n\tconst topic = computed<string>(() => {\n\t\treturn props.topic;\n\t});\n\n\tconst isSending = computed<boolean>(() => {\n\t\treturn sending.value;\n\t});\n\n\tconst activeWriter = computed<TextStreamWriter | null>(() => {\n\t\treturn activeStreamWriter.value;\n\t});\n\n\tconst textStreams = useObservableState<TextStreamData[]>(() => {\n\t\treturn props.onMessage !== undefined || connectionState.value === ConnectionState.Disconnected\n\t\t\t? undefined\n\t\t\t: setupTextStream(room.value, props.topic);\n\t}, []);\n\n\tasync function closeActiveStream(): Promise<void> {\n\t\tif (activeStreamWriter.value === null) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tawait activeStreamWriter.value.close();\n\t\t\tactiveStreamWriter.value = null;\n\t\t} catch (error) {\n\t\t\tlog.error('Error closing text stream writer', error);\n\t\t}\n\t}\n\n\tasync function sendText(text: string): Promise<TextStreamInfo> {\n\t\tif (text.trim() === '') {\n\t\t\tthrow new Error('Cannot send empty text');\n\t\t}\n\n\t\tsending.value = true;\n\n\t\ttry {\n\t\t\treturn await room.value.localParticipant.sendText(text, { topic: props.topic });\n\t\t} finally {\n\t\t\tsending.value = false;\n\t\t}\n\t}\n\n\tasync function streamText(): Promise<TextStreamWriter> {\n\t\tsending.value = true;\n\n\t\tif ((props.autoCloseStreams ?? true) && activeStreamWriter.value !== null) {\n\t\t\tawait closeActiveStream();\n\t\t}\n\n\t\tconst writer = await room.value.localParticipant.streamText({ topic: props.topic });\n\t\tactiveStreamWriter.value = writer;\n\n\t\tconst originalClose = writer.close.bind(writer);\n\n\t\twriter.close = async (): Promise<void> => {\n\t\t\tawait originalClose();\n\t\t\tsending.value = false;\n\t\t\tactiveStreamWriter.value = null;\n\t\t};\n\n\t\treturn writer;\n\t}\n\n\tfunction registerHandler(handler: TextStreamHandler): void {\n\t\troom.value.registerTextStreamHandler(props.topic, handler);\n\t}\n\n\tfunction unregisterHandler(): void {\n\t\troom.value.unregisterTextStreamHandler(props.topic);\n\t}\n\n\tconst stop = watch(\n\t\t() => [room.value, props.topic, props.onMessage] as const,\n\t\t([currentRoom, currentTopic, handler], _previous, onCleanup) => {\n\t\t\tif (handler === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcurrentRoom.registerTextStreamHandler(currentTopic, handler);\n\n\t\t\tonCleanup(() => {\n\t\t\t\tcurrentRoom.unregisterTextStreamHandler(currentTopic);\n\t\t\t});\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\tif (getCurrentScope() !== undefined) {\n\t\tonScopeDispose(() => {\n\t\t\tstop();\n\t\t\tcloseActiveStream().catch((error: unknown) => {\n\t\t\t\tlog.error('Error closing text stream writer', error);\n\t\t\t});\n\t\t});\n\t}\n\n\tconst result: UseTextStream = {\n\t\ttextStreams,\n\t\ttopic,\n\t\tisSending,\n\t\tactiveWriter,\n\t\tsendText,\n\t\tstreamText,\n\t\tregisterHandler,\n\t\tunregisterHandler,\n\t\tcloseActiveStream,\n\t};\n\n\treturn result;\n}\n","import {\n\tDataTopic,\n\tParticipantAgentAttributes,\n\ttype TextStreamData,\n} from '@livekit/components-core';\nimport type { Room } from 'livekit-client';\nimport { computed, toValue, type ComputedRef, type MaybeRefOrGetter } from 'vue';\n\nimport { useTextStream } from './useTextStream';\n\nexport interface UseTranscriptionsProps {\n\treadonly room?: Room;\n\treadonly participantIdentities?: MaybeRefOrGetter<string[] | undefined>;\n\treadonly trackSids?: MaybeRefOrGetter<string[] | undefined>;\n}\n\nexport interface UseTranscriptions {\n\treadonly transcriptions: ComputedRef<TextStreamData[]>;\n}\n\nfunction matchesFilters(\n\tstream: TextStreamData,\n\tidentities: string[] | undefined,\n\ttrackSids: string[] | undefined,\n): boolean {\n\tconst matchesIdentity =\n\t\tidentities === undefined || identities.includes(stream.participantInfo.identity);\n\tconst transcribedTrackId =\n\t\tstream.streamInfo.attributes?.[ParticipantAgentAttributes.TranscribedTrackId] ?? '';\n\tconst matchesTrack = trackSids === undefined || trackSids.includes(transcribedTrackId);\n\n\treturn matchesIdentity && matchesTrack;\n}\n\nexport function useTranscriptions(props: UseTranscriptionsProps = {}): UseTranscriptions {\n\tconst { textStreams } = useTextStream({ topic: DataTopic.TRANSCRIPTION, room: props.room });\n\n\tconst transcriptions = computed<TextStreamData[]>(() => {\n\t\tconst identities = toValue(props.participantIdentities);\n\t\tconst trackSids = toValue(props.trackSids);\n\n\t\treturn textStreams.value.filter((stream) => {\n\t\t\treturn matchesFilters(stream, identities, trackSids);\n\t\t});\n\t});\n\n\tconst result: UseTranscriptions = {\n\t\ttranscriptions,\n\t};\n\n\treturn result;\n}\n","import { ParticipantAgentAttributes, type TextStreamData } from '@livekit/components-core';\nimport { useIntervalFn } from '@vueuse/core';\nimport { shallowRef, toValue, watch, type MaybeRefOrGetter, type ShallowRef } from 'vue';\n\nimport { useTranscriptions, type UseTranscriptionsProps } from './useTranscriptions';\n\nexport const EXPRESSION_ATTRIBUTE = ParticipantAgentAttributes.Expression;\n\nexport const DEFAULT_MOOD_TTL_TURNS = 2;\n\nexport const AGENT_MOODS = [\n\t'excited',\n\t'happy',\n\t'playful',\n\t'curious',\n\t'surprised',\n\t'hopeful',\n\t'empathetic',\n\t'sad',\n\t'angry',\n\t'anxious',\n\t'calm',\n] as const;\n\nexport type AgentMood = (typeof AGENT_MOODS)[number];\n\nexport interface AgentExpression {\n\treadonly mood: AgentMood | null;\n\treadonly expression: string | null;\n}\n\nexport interface UseAgentExpressionProps extends UseTranscriptionsProps {\n\treadonly ttlTurns?: MaybeRefOrGetter<number | undefined>;\n}\n\nexport interface UseAgentExpression {\n\treadonly expression: Readonly<ShallowRef<AgentExpression>>;\n}\n\nconst EXPRESSION_SETTLE_INTERVAL_MILLISECONDS = 150;\n\nconst EXPRESSION_SETTLE_TICKS = 20;\n\nconst NO_EXPRESSION: AgentExpression = { mood: null, expression: null };\n\nfunction isAgentMood(value: unknown): value is AgentMood {\n\treturn AGENT_MOODS.some((mood) => mood === value);\n}\n\nfunction sameExpression(first: AgentExpression, second: AgentExpression): boolean {\n\treturn first.mood === second.mood && first.expression === second.expression;\n}\n\nfunction readPayload(raw: string | undefined): object | null {\n\tif (raw === undefined || raw === '') {\n\t\treturn null;\n\t}\n\n\tlet parsed: unknown;\n\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\treturn null;\n\t}\n\n\treturn typeof parsed === 'object' && parsed !== null ? parsed : null;\n}\n\nexport function parseExpression(segment: TextStreamData): AgentExpression | null {\n\tconst payload = readPayload(segment.streamInfo.attributes?.[EXPRESSION_ATTRIBUTE]);\n\n\tif (payload === null) {\n\t\treturn null;\n\t}\n\n\tconst rawExpression: unknown = Reflect.get(payload, 'expression');\n\tconst rawMood: unknown = Reflect.get(payload, 'mood');\n\tconst expression = typeof rawExpression === 'string' ? rawExpression.trim() : '';\n\tconst mood = isAgentMood(rawMood) ? rawMood : null;\n\n\tif (expression === '' && mood === null) {\n\t\treturn null;\n\t}\n\n\tconst result: AgentExpression = {\n\t\tmood,\n\t\texpression: expression === '' ? null : expression,\n\t};\n\n\treturn result;\n}\n\nexport function currentExpression(segments: TextStreamData[], ttlTurns: number): AgentExpression {\n\tconst trailingIdentities: string[] = [];\n\n\tfor (const segment of segments.toReversed()) {\n\t\tconst parsed = parseExpression(segment);\n\t\tconst speaker = segment.participantInfo.identity;\n\n\t\tif (parsed === null) {\n\t\t\ttrailingIdentities.push(speaker);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst turnsSince = trailingIdentities.filter((identity) => identity === speaker).length;\n\n\t\tif (ttlTurns > 0 && turnsSince >= ttlTurns) {\n\t\t\treturn NO_EXPRESSION;\n\t\t}\n\n\t\treturn parsed;\n\t}\n\n\treturn NO_EXPRESSION;\n}\n\nexport function useAgentExpression(props: UseAgentExpressionProps = {}): UseAgentExpression {\n\tconst { transcriptions } = useTranscriptions(props);\n\n\tconst expression = shallowRef<AgentExpression>(NO_EXPRESSION);\n\n\tlet ticks = 0;\n\n\tfunction update(): void {\n\t\tconst ttlTurns = toValue(props.ttlTurns) ?? DEFAULT_MOOD_TTL_TURNS;\n\t\tconst next = currentExpression(transcriptions.value, ttlTurns);\n\n\t\tif (!sameExpression(next, expression.value)) {\n\t\t\texpression.value = next;\n\t\t}\n\t}\n\n\tconst { pause, resume } = useIntervalFn(\n\t\t() => {\n\t\t\tupdate();\n\t\t\tticks += 1;\n\n\t\t\tif (ticks >= EXPRESSION_SETTLE_TICKS) {\n\t\t\t\tpause();\n\t\t\t}\n\t\t},\n\t\tEXPRESSION_SETTLE_INTERVAL_MILLISECONDS,\n\t\t{ immediate: false },\n\t);\n\n\twatch(\n\t\t[transcriptions, (): number | undefined => toValue(props.ttlTurns)],\n\t\t() => {\n\t\t\tupdate();\n\t\t\tticks = 0;\n\t\t\tresume();\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\tconst agentExpression: UseAgentExpression = {\n\t\texpression,\n\t};\n\n\treturn agentExpression;\n}\n","import { log, roomAudioPlaybackAllowedObservable } from '@livekit/components-core';\nimport type { Room } from 'livekit-client';\nimport { computed, ref, watchEffect, type Ref } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nexport interface UseAudioPlayback {\n\treadonly canPlayAudio: Ref<boolean>;\n\treadonly startAudio: () => Promise<void>;\n}\n\nexport interface UseAudioPlaybackProps {\n\treadonly room?: Room;\n}\n\nexport function useAudioPlayback(props: UseAudioPlaybackProps): UseAudioPlayback {\n\tconst roomEnsured = useEnsureRoomContext(props.room);\n\n\tconst canPlayAudio = ref<boolean>(roomEnsured.value.canPlaybackAudio);\n\n\tconst observable = computed<ReturnType<typeof roomAudioPlaybackAllowedObservable>>(() => {\n\t\treturn roomAudioPlaybackAllowedObservable(roomEnsured.value);\n\t});\n\n\tasync function startAudio(): Promise<void> {\n\t\ttry {\n\t\t\tawait roomEnsured.value.startAudio();\n\t\t} catch (error) {\n\t\t\tlog.error('Failed to start audio playback:', error);\n\t\t}\n\t}\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = observable.value.subscribe({\n\t\t\tnext: (evt) => {\n\t\t\t\tcanPlayAudio.value = evt.canPlayAudio;\n\t\t\t},\n\t\t\terror: (err: unknown) => {\n\t\t\t\tlog.error('Audio playback observable error:', err);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst audioPlayback: UseAudioPlayback = {\n\t\tcanPlayAudio,\n\t\tstartAudio,\n\t};\n\n\treturn audioPlayback;\n}\n","import { setupDataMessageHandler, type ReceivedDataMessage } from '@livekit/components-core';\nimport type { DataPublishOptions } from 'livekit-client';\nimport { computed, ref, shallowRef, watchEffect, type Ref, type ShallowRef } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nexport interface UseDataChannelProps<T extends string | undefined = undefined> {\n\treadonly topic?: T;\n\treadonly onMessage?: (msg: ReceivedDataMessage<T>) => void;\n}\n\nexport interface UseDataChannel<T extends string | undefined = undefined> {\n\treadonly isSending: Ref<boolean>;\n\treadonly send: (payload: Uint8Array, options?: DataPublishOptions) => Promise<void>;\n\treadonly message: ShallowRef<ReceivedDataMessage<T> | undefined>;\n}\n\nexport function useDataChannel<T extends string>(props: UseDataChannelProps<T>): UseDataChannel<T>;\nexport function useDataChannel(onMessage?: (msg: ReceivedDataMessage) => void): UseDataChannel;\nexport function useDataChannel<T extends string>(\n\ttopicOrCallbackOrProps?: T | ((msg: ReceivedDataMessage) => void) | UseDataChannelProps<T>,\n\tcallback?: (msg: ReceivedDataMessage<T>) => void,\n): UseDataChannel<T> {\n\tlet onMessage: ((msg: ReceivedDataMessage<T>) => void) | undefined;\n\tlet topic: T | undefined;\n\n\tif (typeof topicOrCallbackOrProps === 'function') {\n\t\tonMessage = topicOrCallbackOrProps;\n\t} else if (typeof topicOrCallbackOrProps === 'object') {\n\t\ttopic = topicOrCallbackOrProps.topic;\n\t\tonMessage = topicOrCallbackOrProps.onMessage;\n\t} else {\n\t\ttopic = topicOrCallbackOrProps;\n\t\tonMessage = callback;\n\t}\n\n\tconst room = useEnsureRoomContext();\n\n\tconst isSending = ref<boolean>(false);\n\tconst message = shallowRef<ReceivedDataMessage<T> | undefined>(undefined);\n\n\tconst dataHandler = computed<ReturnType<typeof setupDataMessageHandler<T>>>(() => {\n\t\treturn setupDataMessageHandler(room.value, topic, onMessage);\n\t});\n\n\tasync function send(payload: Uint8Array, options?: DataPublishOptions): Promise<void> {\n\t\tawait dataHandler.value.send(payload, options);\n\t}\n\n\twatchEffect((onCleanup) => {\n\t\tconst handler = dataHandler.value;\n\n\t\tconst msgSub = handler.messageObservable.subscribe((receivedMsg) => {\n\t\t\tmessage.value = receivedMsg;\n\t\t});\n\n\t\tconst sendSub = handler.isSendingObservable.subscribe((status) => {\n\t\t\tisSending.value = status;\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tmsgSub.unsubscribe();\n\t\t\tsendSub.unsubscribe();\n\t\t});\n\t});\n\n\tconst dataChannel: UseDataChannel<T> = {\n\t\tmessage,\n\t\tsend,\n\t\tisSending,\n\t};\n\n\treturn dataChannel;\n}\n","import { log, recordingStatusObservable } from '@livekit/components-core';\nimport type { Room } from 'livekit-client';\nimport { computed, ref, watchEffect, type Ref } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nimport { useConnectionState } from './useConnectionState';\n\nexport interface UseIsRecording {\n\treadonly isRecording: Ref<boolean>;\n}\n\nexport interface UseIsRecordingProps {\n\treadonly room?: Room;\n}\n\nexport function useIsRecording(props: UseIsRecordingProps): UseIsRecording {\n\tconst r = useEnsureRoomContext(props.room);\n\n\tconst { connectionState } = useConnectionState({ room: r.value });\n\n\tconst isRecording = ref<boolean>(r.value.isRecording);\n\n\tconst observable = computed<ReturnType<typeof recordingStatusObservable>>(() => {\n\t\tlog.debug('Connection state:', connectionState.value);\n\n\t\treturn recordingStatusObservable(r.value);\n\t});\n\n\twatchEffect((onCleanup): void => {\n\t\tconst subscription = observable.value.subscribe({\n\t\t\tnext: (recording: boolean): void => {\n\t\t\t\tisRecording.value = recording;\n\t\t\t},\n\t\t\terror: (err: unknown): void => {\n\t\t\t\tlog.error('Recording status observer error:', err);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup((): void => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst recording: UseIsRecording = {\n\t\tisRecording,\n\t};\n\n\treturn recording;\n}\n","import { createMediaDeviceObserver } from '@livekit/components-core';\nimport { useEventListener } from '@vueuse/core';\nimport { ref, shallowRef, watchEffect, type Ref } from 'vue';\n\nexport interface UseMediaDevicesProps {\n\treadonly kind: MediaDeviceKind;\n\treadonly onError?: (e: Error) => void;\n\treadonly requestPermissions?: boolean;\n}\n\nexport interface UseMediaDevices {\n\treadonly devices: Ref<MediaDeviceInfo[]>;\n\treadonly canSelectAudioOutput: Ref<boolean>;\n\treadonly requestPermission: (kind: 'audio' | 'video' | 'both') => Promise<boolean>;\n}\n\nfunction stopStream(stream: MediaStream): void {\n\tfor (const track of stream.getTracks()) {\n\t\ttrack.stop();\n\t}\n}\n\nexport function useMediaDevices(props: UseMediaDevicesProps): UseMediaDevices {\n\tconst { kind, onError, requestPermissions = false } = props;\n\n\tconst devices = shallowRef<MediaDeviceInfo[]>([]);\n\n\tconst canSelectAudioOutput = ref<boolean>('setSinkId' in HTMLAudioElement.prototype);\n\n\tfunction handleError(error: unknown): void {\n\t\tonError?.(error instanceof Error ? error : new Error(String(error)));\n\t}\n\n\tfunction refreshDevices(): void {\n\t\tnavigator.mediaDevices.enumerateDevices().catch(handleError);\n\t}\n\n\tasync function requestPermission(permissionKind: 'audio' | 'video' | 'both'): Promise<boolean> {\n\t\ttry {\n\t\t\tconst constraints: MediaStreamConstraints = {\n\t\t\t\taudio: permissionKind === 'audio' || permissionKind === 'both',\n\t\t\t\tvideo: permissionKind === 'video' || permissionKind === 'both',\n\t\t\t};\n\n\t\t\tconst stream = await navigator.mediaDevices.getUserMedia(constraints);\n\t\t\tstopStream(stream);\n\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\thandleError(error);\n\n\t\t\treturn false;\n\t\t}\n\t}\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = createMediaDeviceObserver(kind, onError, requestPermissions).subscribe({\n\t\t\tnext: (deviceList: MediaDeviceInfo[]) => {\n\t\t\t\tdevices.value = deviceList;\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tuseEventListener(navigator.mediaDevices, 'devicechange', refreshDevices);\n\n\tconst result: UseMediaDevices = {\n\t\tdevices,\n\t\tcanSelectAudioOutput,\n\t\trequestPermission,\n\t};\n\n\treturn result;\n}\n","import type { Participant } from 'livekit-client';\nimport type { ShallowRef } from 'vue';\n\nimport { useEnsureParticipant } from '@/context';\nimport { usePermissionsOf } from '@/internal/permissions';\nimport type { ParticipantPermission } from '@/types/participant.types';\n\nexport interface UseParticipantPermissionsProps {\n\treadonly participant?: Participant;\n}\n\nexport interface UseParticipantPermissions {\n\treadonly permissions: ShallowRef<ParticipantPermission | undefined>;\n}\n\nexport function useParticipantPermissions(\n\tprops: UseParticipantPermissionsProps = {},\n): UseParticipantPermissions {\n\tconst participant = useEnsureParticipant(props.participant);\n\n\tconst permissions = usePermissionsOf(() => participant.value);\n\n\tconst result: UseParticipantPermissions = {\n\t\tpermissions,\n\t};\n\n\treturn result;\n}\n","import type { LocalParticipant, RemoteParticipant, Room, RoomEvent } from 'livekit-client';\nimport { computed, type ComputedRef } from 'vue';\n\nimport { useLocalParticipant } from './useLocalParticipant';\nimport { useRemoteParticipants } from './useRemoteParticipants';\n\nexport interface UseParticipantsProps {\n\treadonly updateOnlyOn?: RoomEvent[];\n\treadonly room?: Room;\n}\n\nexport type MixedParticipantArray = (RemoteParticipant | LocalParticipant)[];\n\nexport interface UseParticipants {\n\treadonly participants: ComputedRef<MixedParticipantArray>;\n}\n\nexport function useParticipants(props: UseParticipantsProps = {}): UseParticipants {\n\tconst { participants: remoteParticipants } = useRemoteParticipants({\n\t\tupdateOnlyOn: props.updateOnlyOn,\n\t\troom: props.room,\n\t});\n\n\tconst { localParticipant } = useLocalParticipant({\n\t\troom: props.room,\n\t});\n\n\tconst participants = computed<MixedParticipantArray>(() => {\n\t\tif (localParticipant.value === undefined) {\n\t\t\treturn [...remoteParticipants.value];\n\t\t}\n\n\t\treturn [localParticipant.value, ...remoteParticipants.value];\n\t});\n\n\tconst result: UseParticipants = {\n\t\tparticipants,\n\t};\n\n\treturn result;\n}\n","import { log, participantTracksObservable, type TrackReference } from '@livekit/components-core';\nimport type { Participant, Track } from 'livekit-client';\nimport { computed, shallowRef, watchEffect, type ShallowRef } from 'vue';\n\nimport { useMaybeParticipantContext } from '@/context/participant.context';\nimport { useMaybeRoomContext } from '@/context/room.context';\n\nexport interface UseParticipantTracksProps {\n\treadonly sources: Track.Source[];\n\treadonly participantIdentity?: string;\n\treadonly participant?: Participant;\n}\n\nexport interface UseParticipantTracks {\n\treadonly trackReferences: ShallowRef<TrackReference[]>;\n}\n\nexport function useParticipantTracks(props: UseParticipantTracksProps): UseParticipantTracks {\n\tconst room = useMaybeRoomContext();\n\tconst participantContext = useMaybeParticipantContext();\n\tconst trackReferences = shallowRef<TrackReference[]>([]);\n\n\tconst participant = computed<Participant | undefined>(() => {\n\t\tif (props.participant !== undefined) {\n\t\t\treturn props.participant;\n\t\t}\n\n\t\tif (\n\t\t\tprops.participantIdentity !== undefined &&\n\t\t\tprops.participantIdentity !== '' &&\n\t\t\troom !== undefined\n\t\t) {\n\t\t\treturn room.value.getParticipantByIdentity(props.participantIdentity);\n\t\t}\n\n\t\treturn participantContext?.value;\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\tif (participant.value === undefined) {\n\t\t\ttrackReferences.value = [];\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst subscription = participantTracksObservable(participant.value, {\n\t\t\tsources: props.sources,\n\t\t}).subscribe({\n\t\t\tnext: (tracks) => {\n\t\t\t\ttrackReferences.value = tracks;\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in participant tracks observable:', error);\n\t\t\t\ttrackReferences.value = [];\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst result: UseParticipantTracks = {\n\t\ttrackReferences,\n\t};\n\n\treturn result;\n}\n","import {\n\tconnectedParticipantObserver,\n\tlog,\n\tparticipantByIdentifierObserver,\n\ttype ParticipantIdentifier,\n} from '@livekit/components-core';\nimport type { ParticipantEvent, RemoteParticipant } from 'livekit-client';\nimport { computed, shallowRef, watchEffect, type Ref } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nexport interface UseRemoteParticipantOptions {\n\treadonly updateOnlyOn?: ParticipantEvent[];\n}\n\nexport interface UseRemoteParticipantProps {\n\treadonly identityOrIdentifier: string | ParticipantIdentifier;\n\treadonly options: UseRemoteParticipantOptions;\n}\n\nexport interface UseRemoteParticipant {\n\treadonly participant: Ref<RemoteParticipant | undefined>;\n}\n\nexport function useRemoteParticipant(props: UseRemoteParticipantProps): UseRemoteParticipant {\n\tconst room = useEnsureRoomContext();\n\tconst participant = shallowRef<RemoteParticipant | undefined>(undefined);\n\n\tconst observable = computed<ReturnType<typeof connectedParticipantObserver>>(() => {\n\t\tconst additionalEvents = props.options.updateOnlyOn ?? [];\n\n\t\treturn typeof props.identityOrIdentifier === 'string'\n\t\t\t? connectedParticipantObserver(room.value, props.identityOrIdentifier, {\n\t\t\t\t\tadditionalEvents,\n\t\t\t\t})\n\t\t\t: participantByIdentifierObserver(room.value, props.identityOrIdentifier, {\n\t\t\t\t\tadditionalEvents,\n\t\t\t\t});\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = observable.value.subscribe({\n\t\t\tnext: (remoteParticipant) => {\n\t\t\t\tparticipant.value = remoteParticipant;\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in remote participant observer:', error);\n\t\t\t\tparticipant.value = undefined;\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst result: UseRemoteParticipant = {\n\t\tparticipant,\n\t};\n\n\treturn result;\n}\n","import {\n\tRpcError,\n\tserializers,\n\ttype PerformRpcParams,\n\ttype RpcInvocationData,\n\ttype Serializer,\n} from 'livekit-client';\nimport { getCurrentScope, onScopeDispose } from 'vue';\n\nimport { useEnsureSession } from '@/context/session.context';\n\nimport type { UseSession } from './useSession';\n\nexport type RpcHandler<Input, Output> = (\n\tpayload: Input,\n\tdata: RpcInvocationData,\n) => Promise<Output>;\n\nexport interface RpcCallParams<Payload> extends Omit<PerformRpcParams, 'payload'> {\n\treadonly payload: Payload;\n}\n\nexport interface UseRpcProps<Input = unknown, Output = unknown> {\n\treadonly session?: UseSession;\n\treadonly method?: string;\n\treadonly handler?: RpcHandler<Input, Output>;\n\treadonly fromIdentity?: string;\n\treadonly serializer?: Serializer<Input, Output>;\n}\n\nexport interface UseRpc {\n\treadonly perform: (params: PerformRpcParams) => Promise<string>;\n\treadonly performWith: <Response, Payload>(\n\t\tparams: RpcCallParams<Payload>,\n\t\tserializer: Serializer<Response, Payload>,\n\t) => Promise<Response>;\n}\n\nfunction errorMessage(error: unknown): string {\n\treturn error instanceof Error ? error.message : String(error);\n}\n\nfunction applicationError(message: string, error: unknown): RpcError {\n\treturn RpcError.builtIn('APPLICATION_ERROR', `${message}: ${errorMessage(error)}`);\n}\n\nexport function useRpc<Input = unknown, Output = unknown>(\n\tprops: UseRpcProps<Input, Output> = {},\n): UseRpc {\n\tconst { room } = useEnsureSession(props.session).value;\n\n\tasync function handle(data: RpcInvocationData): Promise<string> {\n\t\tif (props.fromIdentity !== undefined && data.callerIdentity !== props.fromIdentity) {\n\t\t\tthrow RpcError.builtIn(\n\t\t\t\t'UNSUPPORTED_METHOD',\n\t\t\t\t`Method not available for caller ${data.callerIdentity}`,\n\t\t\t);\n\t\t}\n\n\t\tconst serializer = props.serializer ?? serializers.json<Input, Output>();\n\t\tlet payload: Input;\n\n\t\ttry {\n\t\t\tpayload = serializer.parse(data.payload);\n\t\t} catch (error) {\n\t\t\tthrow applicationError('Failed to parse RPC payload', error);\n\t\t}\n\n\t\tif (props.handler === undefined) {\n\t\t\tthrow RpcError.builtIn('UNSUPPORTED_METHOD');\n\t\t}\n\n\t\tconst result = await props.handler(payload, data);\n\n\t\ttry {\n\t\t\treturn serializer.serialize(result);\n\t\t} catch (error) {\n\t\t\tthrow applicationError('Failed to serialize RPC response', error);\n\t\t}\n\t}\n\n\tfunction perform(params: PerformRpcParams): Promise<string> {\n\t\treturn room.localParticipant.performRpc(params);\n\t}\n\n\tasync function performWith<Response, Payload>(\n\t\tparams: RpcCallParams<Payload>,\n\t\tserializer: Serializer<Response, Payload>,\n\t): Promise<Response> {\n\t\tlet payload: string;\n\n\t\ttry {\n\t\t\tpayload = serializer.serialize(params.payload);\n\t\t} catch (error) {\n\t\t\tthrow applicationError('Failed to serialize RPC payload', error);\n\t\t}\n\n\t\tconst response = await room.localParticipant.performRpc({\n\t\t\tdestinationIdentity: params.destinationIdentity,\n\t\t\tmethod: params.method,\n\t\t\tpayload,\n\t\t\tresponseTimeout: params.responseTimeout,\n\t\t});\n\n\t\ttry {\n\t\t\treturn serializer.parse(response);\n\t\t} catch (error) {\n\t\t\tthrow applicationError('Failed to parse RPC response', error);\n\t\t}\n\t}\n\n\tconst method = props.method;\n\n\tif (method !== undefined && props.handler !== undefined) {\n\t\troom.registerRpcMethod(method, handle);\n\n\t\tif (getCurrentScope() !== undefined) {\n\t\t\tonScopeDispose(() => {\n\t\t\t\troom.unregisterRpcMethod(method);\n\t\t\t});\n\t\t}\n\t}\n\n\tconst rpc: UseRpc = {\n\t\tperform,\n\t\tperformWith,\n\t};\n\n\treturn rpc;\n}\n","import { log } from '@livekit/components-core';\nimport { Mutex, type Room } from 'livekit-client';\nimport { toValue, watch, type MaybeRefOrGetter } from 'vue';\n\ntype ConnectArgs = Parameters<Room['connect']>;\n\ntype DisconnectArgs = Parameters<Room['disconnect']>;\n\ninterface ConnectRequest {\n\treadonly type: 'connect';\n\treadonly args: ConnectArgs;\n}\n\ninterface DisconnectRequest {\n\treadonly type: 'disconnect';\n\treadonly args: DisconnectArgs;\n}\n\ntype QueueRequest = ConnectRequest | DisconnectRequest;\n\ninterface QueueItem {\n\treadonly request: QueueRequest;\n\treadonly room: Room;\n\treadonly resolve: () => void;\n\treadonly reject: (error: unknown) => void;\n}\n\nexport interface UseSequentialRoomConnectDisconnect {\n\treadonly connect: (...args: ConnectArgs) => Promise<void>;\n\treadonly disconnect: (...args: DisconnectArgs) => Promise<void>;\n}\n\nconst CONNECT_DISCONNECT_WARNING_THRESHOLD_QUANTITY = 2;\n\nconst CONNECT_DISCONNECT_WARNING_THRESHOLD_MS = 400;\n\nconst ROOM_CHANGE_WARNING_THRESHOLD_QUANTITY = 3;\n\nconst ROOM_CHANGE_WARNING_THRESHOLD_MS = 1000;\n\nfunction countWithin(times: Date[], now: Date, windowMs: number): number {\n\tconst kept = times.filter((time) => now.getTime() - time.getTime() < windowMs);\n\ttimes.splice(0, times.length, ...kept);\n\n\treturn kept.length;\n}\n\nasync function executeRequest(room: Room, request: QueueRequest): Promise<void> {\n\tif (request.type === 'connect') {\n\t\tawait room.connect(...request.args);\n\n\t\treturn;\n\t}\n\n\tawait room.disconnect(...request.args);\n}\n\nasync function runItem(item: QueueItem): Promise<void> {\n\ttry {\n\t\tawait executeRequest(item.room, item.request);\n\t\titem.resolve();\n\t} catch (error) {\n\t\titem.reject(error);\n\t}\n}\n\nexport function useSequentialRoomConnectDisconnect(\n\troom: MaybeRefOrGetter<Room | undefined>,\n): UseSequentialRoomConnectDisconnect {\n\tconst lock = new Mutex();\n\tconst roomChangeTimes: Date[] = [];\n\tconst enqueueTimes: Date[] = [];\n\tlet queue: QueueItem[] = [];\n\n\tasync function drainQueue(): Promise<void> {\n\t\tconst item = queue.shift();\n\n\t\tif (item === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tawait runItem(item);\n\t\tawait drainQueue();\n\t}\n\n\tasync function processQueue(): Promise<void> {\n\t\tconst unlock = await lock.lock();\n\n\t\ttry {\n\t\t\tawait drainQueue();\n\t\t} finally {\n\t\t\tunlock();\n\t\t}\n\t}\n\n\tfunction enqueue(request: QueueRequest): Promise<void> {\n\t\tconst current = toValue(room);\n\n\t\tif (current === undefined) {\n\t\t\treturn Promise.reject(new Error(`Called ${request.type}(), but the room is not set`));\n\t\t}\n\n\t\tconst now = new Date();\n\t\tenqueueTimes.push(now);\n\n\t\tif (\n\t\t\tcountWithin(enqueueTimes, now, CONNECT_DISCONNECT_WARNING_THRESHOLD_MS) >\n\t\t\tCONNECT_DISCONNECT_WARNING_THRESHOLD_QUANTITY\n\t\t) {\n\t\t\tlog.warn(\n\t\t\t\t`useSequentialRoomConnectDisconnect: more than ${CONNECT_DISCONNECT_WARNING_THRESHOLD_QUANTITY} connects or disconnects in ${CONNECT_DISCONNECT_WARNING_THRESHOLD_MS}ms. A watcher that fires on every change can cause this.`,\n\t\t\t);\n\t\t}\n\n\t\treturn new Promise<void>((resolve, reject) => {\n\t\t\tqueue.push({ request, room: current, resolve, reject });\n\t\t\tprocessQueue().catch((error: unknown) => {\n\t\t\t\tlog.error('useSequentialRoomConnectDisconnect: failed to process the queue', error);\n\t\t\t});\n\t\t});\n\t}\n\n\tfunction connect(...args: ConnectArgs): Promise<void> {\n\t\treturn enqueue({ type: 'connect', args });\n\t}\n\n\tfunction disconnect(...args: DisconnectArgs): Promise<void> {\n\t\treturn enqueue({ type: 'disconnect', args });\n\t}\n\n\twatch(\n\t\t() => toValue(room),\n\t\t() => {\n\t\t\tqueue = [];\n\t\t\tconst now = new Date();\n\t\t\troomChangeTimes.push(now);\n\n\t\t\tif (\n\t\t\t\tcountWithin(roomChangeTimes, now, ROOM_CHANGE_WARNING_THRESHOLD_MS) >\n\t\t\t\tROOM_CHANGE_WARNING_THRESHOLD_QUANTITY\n\t\t\t) {\n\t\t\t\tlog.warn(\n\t\t\t\t\t`useSequentialRoomConnectDisconnect: the room changed more than ${ROOM_CHANGE_WARNING_THRESHOLD_QUANTITY} times in ${ROOM_CHANGE_WARNING_THRESHOLD_MS}ms.`,\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t);\n\n\tconst result: UseSequentialRoomConnectDisconnect = {\n\t\tconnect,\n\t\tdisconnect,\n\t};\n\n\treturn result;\n}\n","import { log, type TrackReference } from '@livekit/components-core';\nimport { useEventListener } from '@vueuse/core';\nimport {\n\tConnectionState,\n\tdecodeTokenPayload,\n\tExternalE2EEKeyProvider,\n\tParticipantEvent,\n\tRoom,\n\tRoomEvent,\n\tTokenSourceConfigurable,\n\tTrack,\n\ttype BaseE2EEManager,\n\ttype BaseKeyProvider,\n\ttype E2EEOptions,\n\ttype LocalParticipant,\n\ttype RoomConnectOptions,\n\ttype TokenSourceFetchOptions,\n\ttype TokenSourceFixed,\n\ttype TokenSourceResponseObject,\n\ttype TrackPublication,\n\ttype TrackPublishOptions,\n} from 'livekit-client';\nimport {\n\tcomputed,\n\tgetCurrentScope,\n\tonScopeDispose,\n\treadonly,\n\tshallowRef,\n\ttoValue,\n\twatch,\n\ttype ComputedRef,\n\ttype MaybeRefOrGetter,\n\ttype Ref,\n} from 'vue';\n\nimport { useMaybeRoomContext } from '@/context/room.context';\nimport { isBrowser, TypedEmitter, waitForValue } from '@/internal';\n\nimport {\n\tcreateAgentTimeoutStore,\n\tsetupAgent,\n\ttype AgentTimeoutStore,\n\ttype UseAgent,\n} from './useAgent';\nimport { useEvents } from './useEvents';\n\nexport type SessionEvent = (typeof SESSION_EVENT)[keyof typeof SESSION_EVENT];\n\nexport interface SessionCallbacks {\n\treadonly connectionStateChanged: (state: ConnectionState) => void;\n\treadonly mediaDevicesError: (error: Error) => void;\n\treadonly encryptionError: (error: Error) => void;\n}\n\nexport interface SessionTrackOptions {\n\treadonly enabled?: boolean;\n\treadonly publishOptions?: TrackPublishOptions;\n}\n\nexport interface SessionTracks {\n\treadonly microphone?: SessionTrackOptions;\n\treadonly camera?: SessionTrackOptions;\n\treadonly screenShare?: SessionTrackOptions;\n}\n\nexport interface SessionConnectOptions {\n\treadonly signal?: AbortSignal;\n\treadonly tracks?: SessionTracks;\n\treadonly roomConnectOptions?: RoomConnectOptions;\n}\n\nexport interface UseSessionKeyEncryptionOptions {\n\treadonly key: string | ArrayBuffer | BaseKeyProvider;\n\treadonly worker: Worker;\n\treadonly e2eeManager?: undefined;\n}\n\nexport interface UseSessionManagerEncryptionOptions {\n\treadonly key?: undefined;\n\treadonly worker?: undefined;\n\treadonly e2eeManager: BaseE2EEManager;\n}\n\nexport type UseSessionEncryptionOptions =\n\t| UseSessionKeyEncryptionOptions\n\t| UseSessionManagerEncryptionOptions;\n\nexport interface UseSessionCommonOptions {\n\treadonly agentConnectTimeoutMilliseconds?: number;\n}\n\nexport interface UseSessionGivenRoomOptions {\n\treadonly room: Room;\n\treadonly encryption?: never;\n}\n\nexport interface UseSessionCreatedRoomOptions {\n\treadonly room?: never;\n\treadonly encryption?: UseSessionEncryptionOptions;\n}\n\nexport type UseSessionRoomOptions = UseSessionGivenRoomOptions | UseSessionCreatedRoomOptions;\n\nexport type UseSessionConfigurableOptions = UseSessionCommonOptions &\n\tUseSessionRoomOptions &\n\tTokenSourceFetchOptions;\n\nexport type UseSessionFixedOptions = UseSessionCommonOptions & UseSessionRoomOptions;\n\nexport type UseSessionOptions = UseSessionConfigurableOptions | UseSessionFixedOptions;\n\nexport interface SessionInternal {\n\treadonly emitter: TypedEmitter<SessionCallbacks>;\n\treadonly tokenSource: TokenSourceConfigurable | TokenSourceFixed;\n\treadonly agentTimeout: AgentTimeoutStore;\n\treadonly agent: UseAgent;\n}\n\nexport interface UseSessionLocalTracks {\n\treadonly cameraTrack: ComputedRef<TrackReference | undefined>;\n\treadonly microphoneTrack: ComputedRef<TrackReference | undefined>;\n\treadonly screenShareTrack: ComputedRef<TrackReference | undefined>;\n}\n\nexport interface UseSession {\n\treadonly room: Room;\n\treadonly connectionState: Readonly<Ref<ConnectionState>>;\n\treadonly isConnected: ComputedRef<boolean>;\n\treadonly local: UseSessionLocalTracks;\n\treadonly internal: SessionInternal;\n\treadonly waitUntilConnected: (signal?: AbortSignal) => Promise<void>;\n\treadonly waitUntilDisconnected: (signal?: AbortSignal) => Promise<void>;\n\treadonly prepareConnection: () => Promise<void>;\n\treadonly start: (options?: SessionConnectOptions) => Promise<void>;\n\treadonly end: () => Promise<void>;\n\treadonly setEncryptionEnabled: (enabled: boolean) => Promise<void>;\n}\n\nexport const SESSION_EVENT = {\n\tCONNECTION_STATE_CHANGED: 'connectionStateChanged',\n\tMEDIA_DEVICES_ERROR: 'mediaDevicesError',\n\tENCRYPTION_ERROR: 'encryptionError',\n} as const;\n\nconst DEFAULT_TRACKS: SessionTracks = {\n\tmicrophone: { enabled: true, publishOptions: { preConnectBuffer: true } },\n};\n\nfunction roomEncryption(\n\tencryption: UseSessionEncryptionOptions,\n\tcreateKeyProvider: () => ExternalE2EEKeyProvider,\n): E2EEOptions {\n\tif (encryption.e2eeManager !== undefined) {\n\t\treturn { e2eeManager: encryption.e2eeManager };\n\t}\n\n\tconst { key, worker } = encryption;\n\tconst keyProvider =\n\t\ttypeof key === 'string' || key instanceof ArrayBuffer ? createKeyProvider() : key;\n\n\treturn { keyProvider, worker };\n}\n\nfunction createRoom(\n\tencryption: UseSessionEncryptionOptions | undefined,\n\tcreateKeyProvider: () => ExternalE2EEKeyProvider,\n): Room {\n\tif (encryption === undefined) {\n\t\treturn new Room();\n\t}\n\n\tconst room = new Room({ encryption: roomEncryption(encryption, createKeyProvider) });\n\n\troom.setE2EEEnabled(true).catch((error: unknown) => {\n\t\tlog.error(error);\n\t});\n\n\treturn room;\n}\n\nfunction enabledPublishOptions(\n\ttrack: SessionTrackOptions | undefined,\n): TrackPublishOptions | undefined {\n\tif (track?.enabled !== true) {\n\t\treturn undefined;\n\t}\n\n\treturn track.publishOptions ?? {};\n}\n\nfunction publishTracks(participant: LocalParticipant, tracks: SessionTracks): Promise<unknown>[] {\n\tconst microphone = enabledPublishOptions(tracks.microphone);\n\tconst camera = enabledPublishOptions(tracks.camera);\n\tconst screenShare = enabledPublishOptions(tracks.screenShare);\n\tconst pending: Promise<unknown>[] = [];\n\n\tif (microphone !== undefined) {\n\t\tpending.push(participant.setMicrophoneEnabled(true, undefined, microphone));\n\t}\n\n\tif (camera !== undefined) {\n\t\tpending.push(participant.setCameraEnabled(true, undefined, camera));\n\t}\n\n\tif (screenShare !== undefined) {\n\t\tpending.push(participant.setScreenShareEnabled(true, undefined, screenShare));\n\t}\n\n\treturn pending;\n}\n\nfunction fetchOptionsOf(options: UseSessionOptions): TokenSourceFetchOptions {\n\tconst {\n\t\troom: _room,\n\t\tencryption: _encryption,\n\t\tagentConnectTimeoutMilliseconds: _agentConnectTimeoutMilliseconds,\n\t\t...fetchOptions\n\t} = options;\n\n\treturn fetchOptions;\n}\n\nfunction isEncryptionKey(key: unknown): key is string | ArrayBuffer {\n\treturn typeof key === 'string' || key instanceof ArrayBuffer;\n}\n\nexport function isUseSession(value: unknown): value is UseSession {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t'room' in value &&\n\t\t'connectionState' in value &&\n\t\t'internal' in value\n\t);\n}\n\nexport function useSession(\n\ttokenSource: TokenSourceConfigurable,\n\toptions?: MaybeRefOrGetter<UseSessionConfigurableOptions>,\n): UseSession;\nexport function useSession(\n\ttokenSource: TokenSourceFixed,\n\toptions?: MaybeRefOrGetter<UseSessionFixedOptions>,\n): UseSession;\nexport function useSession(\n\ttokenSource: TokenSourceConfigurable | TokenSourceFixed,\n\toptions: MaybeRefOrGetter<UseSessionOptions> = {},\n): UseSession {\n\tconst initialOptions = toValue(options);\n\tconst roomContext = useMaybeRoomContext();\n\tconst emitter = new TypedEmitter<SessionCallbacks>();\n\n\tlet externalKeyProvider: ExternalE2EEKeyProvider | undefined;\n\tlet wasEndCalled = false;\n\n\tfunction createKeyProvider(): ExternalE2EEKeyProvider {\n\t\texternalKeyProvider = new ExternalE2EEKeyProvider();\n\n\t\treturn externalKeyProvider;\n\t}\n\n\tconst room =\n\t\tinitialOptions.room ??\n\t\troomContext?.value ??\n\t\tcreateRoom(initialOptions.encryption, createKeyProvider);\n\n\tconst agentTimeout = createAgentTimeoutStore();\n\n\tconst connectionState = shallowRef<ConnectionState>(room.state);\n\tconst localPublications = shallowRef<TrackPublication[]>(\n\t\troom.localParticipant.getTrackPublications(),\n\t);\n\n\tconst isConnected = computed<boolean>(() => {\n\t\treturn (\n\t\t\tconnectionState.value === ConnectionState.Connected ||\n\t\t\tconnectionState.value === ConnectionState.Reconnecting ||\n\t\t\tconnectionState.value === ConnectionState.SignalReconnecting\n\t\t);\n\t});\n\n\tconst agent = setupAgent({\n\t\troom,\n\t\tconnectionState,\n\t\tagentTimeout,\n\t\tagentConnectTimeoutMilliseconds: () => {\n\t\t\treturn toValue(options).agentConnectTimeoutMilliseconds;\n\t\t},\n\t});\n\n\tfunction localTrack(source: Track.Source): ComputedRef<TrackReference | undefined> {\n\t\treturn computed<TrackReference | undefined>(() => {\n\t\t\tif (!isConnected.value) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst publication = localPublications.value.find((candidate) => {\n\t\t\t\treturn candidate.source === source;\n\t\t\t});\n\n\t\t\tif (publication === undefined) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn { participant: room.localParticipant, publication, source };\n\t\t});\n\t}\n\n\tfunction refreshLocalPublications(): void {\n\t\tlocalPublications.value = room.localParticipant.getTrackPublications();\n\t}\n\n\tfunction waitUntilConnectionState(state: ConnectionState, signal?: AbortSignal): Promise<void> {\n\t\tif (connectionState.value === state) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\treturn waitForValue<ConnectionState>(\n\t\t\t(listener) => {\n\t\t\t\temitter.on(SESSION_EVENT.CONNECTION_STATE_CHANGED, listener);\n\n\t\t\t\treturn () => {\n\t\t\t\t\temitter.off(SESSION_EVENT.CONNECTION_STATE_CHANGED, listener);\n\t\t\t\t};\n\t\t\t},\n\t\t\t(next) => {\n\t\t\t\treturn next === state;\n\t\t\t},\n\t\t\t`useSession().waitUntilConnectionState(${state}) - signal aborted`,\n\t\t\tsignal,\n\t\t).then(() => undefined);\n\t}\n\n\tfunction waitUntilConnected(signal?: AbortSignal): Promise<void> {\n\t\treturn waitUntilConnectionState(ConnectionState.Connected, signal);\n\t}\n\n\tfunction waitUntilDisconnected(signal?: AbortSignal): Promise<void> {\n\t\treturn waitUntilConnectionState(ConnectionState.Disconnected, signal);\n\t}\n\n\tfunction fetchToken(force?: boolean): Promise<TokenSourceResponseObject> {\n\t\tif (tokenSource instanceof TokenSourceConfigurable) {\n\t\t\treturn tokenSource.fetch(fetchOptionsOf(toValue(options)), force);\n\t\t}\n\n\t\treturn tokenSource.fetch();\n\t}\n\n\tfunction refreshToken(): void {\n\t\tfetchToken(true).catch((error: unknown) => {\n\t\t\tlog.warn('useSession: token refresh failed', error);\n\t\t});\n\t}\n\n\tfunction disconnect(): void {\n\t\troom.disconnect().catch((error: unknown) => {\n\t\t\tlog.warn('useSession: Room.disconnect failed', error);\n\t\t});\n\t}\n\n\tfunction onDisconnected(): void {\n\t\tif (!wasEndCalled) {\n\t\t\trefreshToken();\n\t\t}\n\t}\n\n\tfunction setEncryptionEnabled(enabled: boolean): Promise<void> {\n\t\treturn room.setE2EEEnabled(enabled);\n\t}\n\n\tasync function connect(roomConnectOptions?: RoomConnectOptions): Promise<boolean> {\n\t\tconst { serverUrl, participantToken } = await fetchToken();\n\t\tconst payload = decodeTokenPayload(participantToken);\n\n\t\tawait room.connect(serverUrl, participantToken, roomConnectOptions);\n\n\t\treturn (payload.roomConfig?.agents?.length ?? 0) > 0;\n\t}\n\n\tasync function start(connectOptions: SessionConnectOptions = {}): Promise<void> {\n\t\tconst { signal, tracks = DEFAULT_TRACKS, roomConnectOptions } = connectOptions;\n\n\t\tawait waitUntilDisconnected(signal);\n\t\twasEndCalled = false;\n\n\t\tconst stopAbortListener =\n\t\t\tsignal === undefined ? undefined : useEventListener(signal, 'abort', disconnect);\n\n\t\troom.once(RoomEvent.Disconnected, onDisconnected);\n\n\t\ttry {\n\t\t\tconst [dispatchesAgent] = await Promise.all([\n\t\t\t\tconnect(roomConnectOptions),\n\t\t\t\t...publishTracks(room.localParticipant, tracks),\n\t\t\t]);\n\n\t\t\tawait waitUntilConnected(signal);\n\n\t\t\tif (dispatchesAgent) {\n\t\t\t\tawait agent.waitUntilConnected(signal);\n\t\t\t}\n\t\t} finally {\n\t\t\tstopAbortListener?.();\n\t\t}\n\t}\n\n\tasync function end(): Promise<void> {\n\t\twasEndCalled = true;\n\t\trefreshToken();\n\t\tawait room.disconnect();\n\t}\n\n\tasync function prepareConnection(): Promise<void> {\n\t\tconst { serverUrl, participantToken } = await fetchToken();\n\n\t\tawait room.prepareConnection(serverUrl, participantToken);\n\t}\n\n\tuseEvents(room, RoomEvent.ConnectionStateChanged, (state) => {\n\t\tconnectionState.value = state;\n\t\temitter.emit(SESSION_EVENT.CONNECTION_STATE_CHANGED, state);\n\t});\n\n\tuseEvents(room, RoomEvent.MediaDevicesError, (error) => {\n\t\temitter.emit(SESSION_EVENT.MEDIA_DEVICES_ERROR, error);\n\t});\n\n\tuseEvents(room, RoomEvent.EncryptionError, (error) => {\n\t\temitter.emit(SESSION_EVENT.ENCRYPTION_ERROR, error);\n\t});\n\n\tuseEvents(room.localParticipant, ParticipantEvent.LocalTrackPublished, refreshLocalPublications);\n\n\tuseEvents(\n\t\troom.localParticipant,\n\t\tParticipantEvent.LocalTrackUnpublished,\n\t\trefreshLocalPublications,\n\t);\n\n\twatch(\n\t\t() => {\n\t\t\treturn toValue(options).encryption?.key;\n\t\t},\n\t\t(key) => {\n\t\t\tif (externalKeyProvider !== undefined && isEncryptionKey(key)) {\n\t\t\t\texternalKeyProvider.setKey(key).catch((error: unknown) => {\n\t\t\t\t\tlog.error(error);\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t{ immediate: true },\n\t);\n\n\tif (isBrowser()) {\n\t\tprepareConnection().catch((error: unknown) => {\n\t\t\tlog.warn('useSession: Room.prepareConnection failed', error);\n\t\t});\n\t}\n\n\tif (getCurrentScope() !== undefined) {\n\t\tonScopeDispose(disconnect);\n\t}\n\n\tconst local: UseSessionLocalTracks = {\n\t\tcameraTrack: localTrack(Track.Source.Camera),\n\t\tmicrophoneTrack: localTrack(Track.Source.Microphone),\n\t\tscreenShareTrack: localTrack(Track.Source.ScreenShare),\n\t};\n\n\tconst internal: SessionInternal = {\n\t\temitter,\n\t\ttokenSource,\n\t\tagentTimeout,\n\t\tagent,\n\t};\n\n\tconst session: UseSession = {\n\t\troom,\n\t\tconnectionState: readonly(connectionState),\n\t\tisConnected,\n\t\tlocal,\n\t\tinternal,\n\t\twaitUntilConnected,\n\t\twaitUntilDisconnected,\n\t\tprepareConnection,\n\t\tstart,\n\t\tend,\n\t\tsetEncryptionEnabled,\n\t};\n\n\treturn session;\n}\n","import type {\n\tReceivedAgentTranscriptionMessage,\n\tReceivedChatMessage,\n\tReceivedMessage,\n\tReceivedUserTranscriptionMessage,\n\tTextStreamData,\n} from '@livekit/components-core';\nimport type { Participant, SendTextOptions } from 'livekit-client';\nimport { computed, nextTick, watch, type ComputedRef, type Ref } from 'vue';\n\nimport { useEnsureSession } from '@/context/session.context';\nimport { TypedEmitter } from '@/internal/emitter';\n\nimport { useChat } from './useChat';\nimport type { UseSession } from './useSession';\nimport { useTranscriptions } from './useTranscriptions';\n\nexport const MESSAGES_EVENT = {\n\tMESSAGE_RECEIVED: 'messageReceived',\n} as const;\n\nexport type MessagesEvent = (typeof MESSAGES_EVENT)[keyof typeof MESSAGES_EVENT];\n\nexport interface MessagesCallbacks {\n\treadonly messageReceived: (message: ReceivedMessage) => void;\n}\n\nexport interface UseSessionMessagesInternal {\n\treadonly emitter: TypedEmitter<MessagesCallbacks>;\n}\n\nexport interface UseSessionMessages {\n\treadonly messages: ComputedRef<ReceivedMessage[]>;\n\treadonly isSending: Ref<boolean>;\n\treadonly send: (message: string, options?: SendTextOptions) => Promise<ReceivedChatMessage>;\n\treadonly internal: UseSessionMessagesInternal;\n}\n\nexport function useSessionMessages(session?: UseSession): UseSessionMessages {\n\tconst { room, internal } = useEnsureSession(session).value;\n\tconst { agent } = internal;\n\tconst emitter = new TypedEmitter<MessagesCallbacks>();\n\tconst firstReceivedAt = new Map<string, number>();\n\tconst announced = new Set<string>();\n\n\tconst { transcriptions } = useTranscriptions({ room });\n\tconst chat = useChat({ room });\n\n\tfunction sender(identity: string): Participant | undefined {\n\t\tconst agentParticipants = [\n\t\t\tagent.internal.agentParticipant.value,\n\t\t\tagent.internal.workerParticipant.value,\n\t\t];\n\n\t\tconst known = agentParticipants.find((participant) => {\n\t\t\treturn participant?.identity === identity;\n\t\t});\n\n\t\tif (known !== undefined && known !== null) {\n\t\t\treturn known;\n\t\t}\n\n\t\treturn Array.from(room.remoteParticipants.values()).find((participant) => {\n\t\t\treturn participant.identity === identity;\n\t\t});\n\t}\n\n\tfunction toMessage(\n\t\ttranscription: TextStreamData,\n\t): ReceivedUserTranscriptionMessage | ReceivedAgentTranscriptionMessage {\n\t\tconst { identity } = transcription.participantInfo;\n\t\tconst common = {\n\t\t\tmessage: transcription.text,\n\t\t\tid: transcription.streamInfo.id,\n\t\t\ttimestamp: transcription.streamInfo.timestamp,\n\t\t\tattributes: transcription.streamInfo.attributes,\n\t\t};\n\n\t\tif (identity === room.localParticipant.identity) {\n\t\t\treturn { ...common, type: 'userTranscript', from: room.localParticipant };\n\t\t}\n\n\t\treturn { ...common, type: 'agentTranscript', from: sender(identity) };\n\t}\n\n\tfunction arrivalOf(message: ReceivedMessage): number {\n\t\treturn firstReceivedAt.get(message.id) ?? 0;\n\t}\n\n\tfunction announce(list: ReceivedMessage[]): void {\n\t\tfor (const message of list) {\n\t\t\tif (announced.has(message.id)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tannounced.add(message.id);\n\t\t\temitter.emit(MESSAGES_EVENT.MESSAGE_RECEIVED, message);\n\t\t}\n\t}\n\n\tconst messages = computed<ReceivedMessage[]>(() => {\n\t\tconst merged: ReceivedMessage[] = [\n\t\t\t...transcriptions.value.map(toMessage),\n\t\t\t...chat.chatMessages.value,\n\t\t];\n\t\tconst now = Date.now();\n\n\t\tfor (const message of merged) {\n\t\t\tif (!firstReceivedAt.has(message.id)) {\n\t\t\t\tfirstReceivedAt.set(message.id, now);\n\t\t\t}\n\t\t}\n\n\t\treturn merged.toSorted((a, b) => {\n\t\t\treturn arrivalOf(a) - arrivalOf(b);\n\t\t});\n\t});\n\n\twatch(messages, announce);\n\n\tnextTick(() => {\n\t\tannounce(messages.value);\n\t}).catch(() => undefined);\n\n\tconst sessionMessages: UseSessionMessages = {\n\t\tmessages,\n\t\tisSending: chat.isSending,\n\t\tsend: chat.send,\n\t\tinternal: { emitter },\n\t};\n\n\treturn sessionMessages;\n}\n","import { activeSpeakerObserver, log } from '@livekit/components-core';\nimport type { Participant } from 'livekit-client';\nimport { shallowRef, watchEffect, type ShallowRef } from 'vue';\n\nimport { useEnsureRoomContext } from '@/context/room.context';\n\nexport interface UseSpeakingParticipants {\n\treadonly activeSpeakers: ShallowRef<Participant[]>;\n}\n\nexport function useSpeakingParticipants(): UseSpeakingParticipants {\n\tconst room = useEnsureRoomContext();\n\tconst activeSpeakers = shallowRef<Participant[]>(room.value.activeSpeakers);\n\n\twatchEffect((onCleanup) => {\n\t\tconst subscription = activeSpeakerObserver(room.value).subscribe({\n\t\t\tnext: (speakers) => {\n\t\t\t\tactiveSpeakers.value = speakers;\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in active speaker observer:', error);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst result: UseSpeakingParticipants = {\n\t\tactiveSpeakers,\n\t};\n\n\treturn result;\n}\n","import { sortParticipants } from '@livekit/components-core';\nimport type { Participant } from 'livekit-client';\nimport { computed, shallowRef, toValue, watch, type ComputedRef, type MaybeRefOrGetter } from 'vue';\n\nimport { useSpeakingParticipants } from './useSpeakingParticipants';\n\nexport interface UseSortedParticipants {\n\treadonly sortedParticipants: ComputedRef<Participant[]>;\n}\n\nexport interface UseSortedParticipantsProps {\n\treadonly participants: MaybeRefOrGetter<Participant[]>;\n}\n\nexport function useSortedParticipants(props: UseSortedParticipantsProps): UseSortedParticipants {\n\tconst { activeSpeakers } = useSpeakingParticipants();\n\tconst sorted = shallowRef<Participant[]>([]);\n\n\twatch(\n\t\t[activeSpeakers, () => [...toValue(props.participants)]],\n\t\t([, participants]) => {\n\t\t\tsorted.value = sortParticipants(participants);\n\t\t},\n\t\t{ immediate: true, flush: 'sync' },\n\t);\n\n\tconst sortedParticipants = computed<Participant[]>(() => {\n\t\treturn sorted.value;\n\t});\n\n\tconst result: UseSortedParticipants = {\n\t\tsortedParticipants,\n\t};\n\n\treturn result;\n}\n","import { computed, type ComputedRef } from 'vue';\n\nimport { useToastContext, type ToastMessage } from '@/context/toast.context';\n\nexport interface UseToast {\n\treadonly messages: ComputedRef<ToastMessage[]>;\n\treadonly addToast: (message: string, type?: ToastMessage['type'], timeout?: number) => string;\n\treadonly removeToast: (id: string) => void;\n\treadonly clearToasts: () => void;\n}\n\nconst DEFAULT_TOAST_TIMEOUT_MS = 5000;\n\nexport function useToast(): UseToast {\n\tconst toastContext = useToastContext();\n\n\tconst messages = computed<ToastMessage[]>(() => {\n\t\treturn toastContext.messages.value;\n\t});\n\n\tfunction addToast(\n\t\tmessage: string,\n\t\ttype: ToastMessage['type'] = 'info',\n\t\ttimeout: number = DEFAULT_TOAST_TIMEOUT_MS,\n\t): string {\n\t\treturn toastContext.add({\n\t\t\tmessage,\n\t\t\ttype,\n\t\t\ttimeout,\n\t\t});\n\t}\n\n\tfunction removeToast(id: string): void {\n\t\ttoastContext.remove(id);\n\t}\n\n\tfunction clearToasts(): void {\n\t\ttoastContext.clear();\n\t}\n\n\tconst result: UseToast = {\n\t\tmessages,\n\t\taddToast,\n\t\tremoveToast,\n\t\tclearToasts,\n\t};\n\n\treturn result;\n}\n","import { log } from '@livekit/components-core';\nimport { ref, watchEffect, type Ref } from 'vue';\n\nexport interface UserInfo {\n\treadonly identity?: string;\n\treadonly name?: string;\n\treadonly metadata?: string;\n}\n\nexport interface UseTokenProps {\n\treadonly identity?: string;\n\treadonly metadata?: string;\n}\n\nexport interface UseTokenOptions {\n\treadonly userInfo?: UserInfo;\n}\n\nexport interface UseTokenArgs {\n\treadonly tokenEndpoint: string | undefined;\n\treadonly roomName: string;\n\treadonly options?: UseTokenOptions;\n}\n\nexport interface UseToken {\n\treadonly token: Ref<string | undefined>;\n\treadonly getToken: (refreshToken?: boolean) => Promise<string | undefined>;\n}\n\nfunction getAccessToken(data: unknown): string | undefined {\n\tif (typeof data !== 'object' || data === null || !('accessToken' in data)) {\n\t\treturn undefined;\n\t}\n\n\treturn typeof data.accessToken === 'string' ? data.accessToken : undefined;\n}\n\nexport function useToken(props: UseTokenArgs): UseToken {\n\tconst token = ref<string | undefined>(undefined);\n\n\tasync function fetchToken(): Promise<string | undefined> {\n\t\tconst userInfo = props.options?.userInfo;\n\n\t\tif (\n\t\t\tprops.tokenEndpoint === undefined ||\n\t\t\tprops.tokenEndpoint === '' ||\n\t\t\tuserInfo?.identity === undefined ||\n\t\t\tuserInfo.identity === ''\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\ttry {\n\t\t\tconst params = new URLSearchParams({\n\t\t\t\t...userInfo,\n\t\t\t\troomName: props.roomName,\n\t\t\t});\n\n\t\t\tconst res = await fetch(`${props.tokenEndpoint}?${params.toString()}`);\n\n\t\t\tif (!res.ok) {\n\t\t\t\tlog.error(`Token fetch failed: ${res.status} ${res.statusText}`);\n\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst data: unknown = await res.json();\n\n\t\t\treturn getAccessToken(data);\n\t\t} catch (error) {\n\t\t\tlog.error('Token fetch error:', error);\n\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tasync function getToken(refreshToken?: boolean): Promise<string | undefined> {\n\t\tif (refreshToken === true || token.value === undefined) {\n\t\t\ttoken.value = await fetchToken();\n\t\t}\n\n\t\treturn token.value;\n\t}\n\n\twatchEffect(() => {\n\t\tif (token.value !== undefined && token.value !== '') {\n\t\t\treturn;\n\t\t}\n\n\t\tgetToken(true).catch((error: unknown) => {\n\t\t\tlog.error('Token fetch error:', error);\n\t\t});\n\t});\n\n\tconst result: UseToken = {\n\t\ttoken,\n\t\tgetToken,\n\t};\n\n\treturn result;\n}\n","import {\n\tgetTrackByIdentifier,\n\tlog,\n\tsetupMediaTrack,\n\ttype TrackSource,\n\ttype TrackReference,\n\ttype TrackReferenceOrPlaceholder,\n\ttype TrackReferencePlaceholder,\n} from '@livekit/components-core';\nimport { Track, type TrackPublication } from 'livekit-client';\nimport { computed, shallowRef, watchEffect, type ComputedRef } from 'vue';\n\nexport interface UseTrackRefBySourceOrName {\n\treadonly trackReference: ComputedRef<TrackReferenceOrPlaceholder>;\n}\n\nexport function useTrackRefBySourceOrName(\n\tsource: TrackSource<Track.Source>,\n): UseTrackRefBySourceOrName {\n\tconst publication = shallowRef<TrackPublication | undefined>(getTrackByIdentifier(source));\n\n\tconst mediaTrackSetup = computed<ReturnType<typeof setupMediaTrack>>(() => {\n\t\treturn setupMediaTrack(source);\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\ttry {\n\t\t\tconst subscription = mediaTrackSetup.value.trackObserver.subscribe({\n\t\t\t\tnext: (pub) => {\n\t\t\t\t\tpublication.value = pub;\n\t\t\t\t},\n\t\t\t\terror: (error: unknown) => {\n\t\t\t\t\tlog.error('Error in track observer:', error);\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tonCleanup(() => {\n\t\t\t\tsubscription.unsubscribe();\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tlog.error('Failed to subscribe to track observer:', error);\n\t\t}\n\t});\n\n\tconst trackReference = computed<TrackReferenceOrPlaceholder>(() => {\n\t\tconst participant = source.participant;\n\t\tconst trackSource = source.source ?? Track.Source.Unknown;\n\n\t\tif (publication.value === undefined) {\n\t\t\tconst placeholder: TrackReferencePlaceholder = {\n\t\t\t\tparticipant,\n\t\t\t\tsource: trackSource,\n\t\t\t};\n\n\t\t\treturn placeholder;\n\t\t}\n\n\t\tconst reference: TrackReference = {\n\t\t\tparticipant,\n\t\t\tsource: trackSource,\n\t\t\tpublication: publication.value,\n\t\t};\n\n\t\treturn reference;\n\t});\n\n\tconst result: UseTrackRefBySourceOrName = {\n\t\ttrackReference,\n\t};\n\n\treturn result;\n}\n","import type { TrackReferenceOrPlaceholder } from '@livekit/components-core';\nimport type { Participant, Track } from 'livekit-client';\nimport { computed, type ComputedRef, type Ref } from 'vue';\n\nimport { useEnsureParticipant } from '@/context/participant.context';\n\nimport { useTrackRefBySourceOrName } from './useTrackRefBySourceOrName';\n\nexport interface UseTrack {\n\treadonly trackReference: Ref<TrackReferenceOrPlaceholder>;\n\treadonly isTrackAvailable: ComputedRef<boolean>;\n}\n\nexport interface UseTrackProps {\n\treadonly source: Track.Source;\n\treadonly participant?: Participant;\n}\n\nexport function useTrack(props: UseTrackProps): UseTrack {\n\tconst participant = useEnsureParticipant(props.participant);\n\n\tconst { trackReference } = useTrackRefBySourceOrName({\n\t\tsource: props.source,\n\t\tparticipant: participant.value,\n\t});\n\n\tconst isTrackAvailable = computed<boolean>(() => {\n\t\tconst publication = trackReference.value.publication;\n\n\t\treturn publication?.track !== undefined && !publication.isMuted;\n\t});\n\n\tconst result: UseTrack = {\n\t\ttrackReference,\n\t\tisTrackAvailable,\n\t};\n\n\treturn result;\n}\n","import type { TrackReferenceOrPlaceholder } from '@livekit/components-core';\nimport type { Participant } from 'livekit-client';\nimport type { Ref } from 'vue';\n\nimport { useEnsureParticipant } from '@/context/participant.context';\n\nimport { useTrackRefBySourceOrName } from './useTrackRefBySourceOrName';\n\nexport interface UseTrackByName {\n\treadonly trackReference: Ref<TrackReferenceOrPlaceholder>;\n}\n\nexport interface UseTrackByNameProps {\n\treadonly name: string;\n\treadonly participant?: Participant;\n}\n\nexport function useTrackByName(props: UseTrackByNameProps): UseTrackByName {\n\tconst participant = useEnsureParticipant(props.participant);\n\n\tconst { trackReference } = useTrackRefBySourceOrName({\n\t\tname: props.name,\n\t\tparticipant: participant.value,\n\t});\n\n\tconst result: UseTrackByName = {\n\t\ttrackReference,\n\t};\n\n\treturn result;\n}\n","import {\n\tgetTrackByIdentifier,\n\tlog,\n\tsetupMediaTrack,\n\ttype TrackIdentifier,\n\ttype TrackReference,\n\ttype TrackReferenceOrPlaceholder,\n\ttype TrackReferencePlaceholder,\n} from '@livekit/components-core';\nimport { Track, type TrackPublication } from 'livekit-client';\nimport { computed, shallowRef, watchEffect, type ComputedRef } from 'vue';\n\nexport interface UseTrackRefBySourceOrName {\n\treadonly trackReference: ComputedRef<TrackReferenceOrPlaceholder>;\n}\n\nexport interface UseTrackRefBySourceOrNameProps {\n\treadonly options: TrackIdentifier;\n}\n\nexport function useTrackRefBySource(\n\tprops: UseTrackRefBySourceOrNameProps,\n): UseTrackRefBySourceOrName {\n\tconst publication = shallowRef<TrackPublication | undefined>(getTrackByIdentifier(props.options));\n\n\tconst mediaTrackSetup = computed<ReturnType<typeof setupMediaTrack>>(() => {\n\t\treturn setupMediaTrack(props.options);\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\ttry {\n\t\t\tconst subscription = mediaTrackSetup.value.trackObserver.subscribe({\n\t\t\t\tnext: (pub) => {\n\t\t\t\t\tpublication.value = pub;\n\t\t\t\t},\n\t\t\t\terror: (error: unknown) => {\n\t\t\t\t\tlog.error('Error in track observer:', error);\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tonCleanup(() => {\n\t\t\t\tsubscription.unsubscribe();\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tlog.error('Failed to subscribe to track observer:', error);\n\t\t}\n\t});\n\n\tconst trackReference = computed<TrackReferenceOrPlaceholder>(() => {\n\t\tconst participant = props.options.participant;\n\t\tconst trackSource = props.options.source ?? Track.Source.Unknown;\n\n\t\tif (publication.value === undefined) {\n\t\t\tconst placeholder: TrackReferencePlaceholder = {\n\t\t\t\tparticipant,\n\t\t\t\tsource: trackSource,\n\t\t\t};\n\n\t\t\treturn placeholder;\n\t\t}\n\n\t\tconst reference: TrackReference = {\n\t\t\tparticipant,\n\t\t\tsource: trackSource,\n\t\t\tpublication: publication.value,\n\t\t};\n\n\t\treturn reference;\n\t});\n\n\tconst result: UseTrackRefBySourceOrName = {\n\t\ttrackReference,\n\t};\n\n\treturn result;\n}\n","import {\n\tlog,\n\ttrackSyncTimeObserver,\n\ttype TrackReferenceOrPlaceholder,\n} from '@livekit/components-core';\nimport { computed, ref, watchEffect, type Ref } from 'vue';\n\nexport interface UseTrackSyncTimeData {\n\treadonly timestamp: number;\n\treadonly rtpTimestamp: number | undefined;\n}\n\nexport interface UseTrackSyncTime {\n\treadonly data: Ref<UseTrackSyncTimeData>;\n}\n\nexport interface UseTrackSyncTimeProps {\n\treadonly trackRef: TrackReferenceOrPlaceholder | undefined;\n}\n\nexport function useTrackSyncTime(props: UseTrackSyncTimeProps): UseTrackSyncTime {\n\tconst data = ref<UseTrackSyncTimeData>({\n\t\ttimestamp: Date.now(),\n\t\trtpTimestamp: props.trackRef?.publication?.track?.rtpTimestamp,\n\t});\n\n\tconst observable = computed<ReturnType<typeof trackSyncTimeObserver> | undefined>(() => {\n\t\tconst track = props.trackRef?.publication?.track;\n\n\t\tif (track === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\ttry {\n\t\t\treturn trackSyncTimeObserver(track);\n\t\t} catch (error) {\n\t\t\tlog.error('Failed to create track sync time observer:', error);\n\n\t\t\treturn undefined;\n\t\t}\n\t});\n\n\twatchEffect((onCleanup) => {\n\t\tconst currentObservable = observable.value;\n\n\t\tif (currentObservable === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst subscription = currentObservable.subscribe({\n\t\t\t\tnext: (timestamp) => {\n\t\t\t\t\tdata.value = {\n\t\t\t\t\t\ttimestamp,\n\t\t\t\t\t\trtpTimestamp: props.trackRef?.publication?.track?.rtpTimestamp,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\terror: (error: unknown) => {\n\t\t\t\t\tlog.error('Error in track sync time subscription:', error);\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tonCleanup(() => {\n\t\t\t\tsubscription.unsubscribe();\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tlog.error('Failed to subscribe to track sync time:', error);\n\t\t}\n\t});\n\n\tconst result: UseTrackSyncTime = {\n\t\tdata,\n\t};\n\n\treturn result;\n}\n","import {\n\taddMediaTimestampToTranscription as addTimestampsToTranscription,\n\tdedupeSegments,\n\tlog,\n\ttrackTranscriptionObserver,\n\ttype ReceivedTranscriptionSegment,\n\ttype TrackReferenceOrPlaceholder,\n} from '@livekit/components-core';\nimport type { TranscriptionSegment } from 'livekit-client';\nimport { ref, watchEffect, type Ref } from 'vue';\n\nimport { useTrackSyncTime } from './useTrackSyncTime';\n\nexport interface TrackTranscriptionOptions {\n\treadonly bufferSize?: number;\n\t// oxlint-disable-next-line typescript/no-deprecated\n\treadonly onTranscription?: (newSegments: TranscriptionSegment[]) => void;\n}\n\nexport interface UseTrackTranscription {\n\treadonly segments: Ref<ReceivedTranscriptionSegment[]>;\n}\n\nexport interface UseTrackTranscriptionProps {\n\treadonly trackRef: TrackReferenceOrPlaceholder | undefined;\n\treadonly options?: TrackTranscriptionOptions;\n}\n\nconst TRACK_TRANSCRIPTION_DEFAULTS = {\n\tbufferSize: 100,\n} as const satisfies TrackTranscriptionOptions;\n\nexport function useTrackTranscription(props: UseTrackTranscriptionProps): UseTrackTranscription {\n\tconst opts = { ...TRACK_TRANSCRIPTION_DEFAULTS, ...props.options };\n\n\tconst segments = ref<ReceivedTranscriptionSegment[]>([]);\n\n\tconst { data: syncTimestamps } = useTrackSyncTime({\n\t\ttrackRef: props.trackRef,\n\t});\n\n\t// oxlint-disable-next-line typescript/no-deprecated\n\tfunction handleSegmentMessage(newSegments: TranscriptionSegment[]): void {\n\t\ttry {\n\t\t\topts.onTranscription?.(newSegments);\n\n\t\t\tsegments.value = dedupeSegments(\n\t\t\t\tsegments.value,\n\t\t\t\tnewSegments.map((segment) => addTimestampsToTranscription(segment, syncTimestamps.value)),\n\t\t\t\topts.bufferSize,\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tlog.error('Error handling transcription segments:', error);\n\t\t}\n\t}\n\n\twatchEffect((onCleanup) => {\n\t\tconst publication = props.trackRef?.publication;\n\n\t\tif (publication === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst subscription = trackTranscriptionObserver(publication).subscribe({\n\t\t\tnext: (evt) => {\n\t\t\t\thandleSegmentMessage(...evt);\n\t\t\t},\n\t\t\terror: (error: unknown) => {\n\t\t\t\tlog.error('Error in track transcription subscription:', error);\n\t\t\t},\n\t\t});\n\n\t\tonCleanup(() => {\n\t\t\tsubscription.unsubscribe();\n\t\t});\n\t});\n\n\tconst result: UseTrackTranscription = {\n\t\tsegments,\n\t};\n\n\treturn result;\n}\n","import {\n\tParticipantAgentAttributes,\n\ttype ReceivedTranscriptionSegment,\n\ttype TrackReference,\n} from '@livekit/components-core';\nimport {\n\tConnectionState,\n\tParticipantKind,\n\tTrack,\n\ttype RemoteParticipant,\n\ttype Room,\n} from 'livekit-client';\nimport { computed, type ComputedRef, type Ref, type ShallowRef } from 'vue';\n\nimport type { AgentSdkState, AgentState } from '@/types/agent.types';\n\nimport { useConnectionState } from './useConnectionState';\nimport { useParticipantAttributes } from './useParticipantAttributes';\nimport { useParticipantTracks } from './useParticipantTracks';\nimport { useRemoteParticipants } from './useRemoteParticipants';\nimport { useTrackTranscription } from './useTrackTranscription';\n\nexport interface UseVoiceAssistantProps {\n\treadonly room?: Room;\n}\n\nexport interface UseVoiceAssistant {\n\treadonly agent: ComputedRef<RemoteParticipant | undefined>;\n\treadonly state: ComputedRef<AgentState>;\n\treadonly audioTrack: ComputedRef<TrackReference | undefined>;\n\treadonly videoTrack: ComputedRef<TrackReference | undefined>;\n\treadonly agentTranscriptions: Ref<ReceivedTranscriptionSegment[]>;\n\treadonly agentAttributes: Ref<Readonly<Record<string, string>> | undefined>;\n}\n\nconst AGENT_SDK_STATES: ReadonlySet<string> = new Set<AgentSdkState>([\n\t'initializing',\n\t'idle',\n\t'listening',\n\t'thinking',\n\t'speaking',\n]);\n\nconst AGENT_SOURCES: Track.Source[] = [Track.Source.Microphone, Track.Source.Camera];\n\nfunction isAgentSdkState(value: string): value is AgentSdkState {\n\treturn AGENT_SDK_STATES.has(value);\n}\n\nfunction isAgent(participant: RemoteParticipant): boolean {\n\treturn participant.kind === ParticipantKind.AGENT;\n}\n\nfunction findTrack(\n\ttracks: ShallowRef<TrackReference[]>,\n\tfallback: ShallowRef<TrackReference[]>,\n\tsource: Track.Source,\n): TrackReference | undefined {\n\treturn (\n\t\ttracks.value.find((track) => track.source === source) ??\n\t\tfallback.value.find((track) => track.source === source)\n\t);\n}\n\nexport function useVoiceAssistant(props: UseVoiceAssistantProps = {}): UseVoiceAssistant {\n\tconst { participants } = useRemoteParticipants({ room: props.room });\n\tconst { connectionState } = useConnectionState({ room: props.room });\n\n\tconst agent = computed<RemoteParticipant | undefined>(() => {\n\t\treturn participants.value.find((participant) => {\n\t\t\treturn (\n\t\t\t\tisAgent(participant) &&\n\t\t\t\t!(ParticipantAgentAttributes.PublishOnBehalf in participant.attributes)\n\t\t\t);\n\t\t});\n\t});\n\n\tconst worker = computed<RemoteParticipant | undefined>(() => {\n\t\treturn participants.value.find((participant) => {\n\t\t\treturn (\n\t\t\t\tisAgent(participant) &&\n\t\t\t\tparticipant.attributes[ParticipantAgentAttributes.PublishOnBehalf] === agent.value?.identity\n\t\t\t);\n\t\t});\n\t});\n\n\tconst { trackReferences: agentTracks } = useParticipantTracks({\n\t\tsources: AGENT_SOURCES,\n\t\tget participant() {\n\t\t\treturn agent.value;\n\t\t},\n\t});\n\n\tconst { trackReferences: workerTracks } = useParticipantTracks({\n\t\tsources: AGENT_SOURCES,\n\t\tget participant() {\n\t\t\treturn worker.value;\n\t\t},\n\t});\n\n\tconst audioTrack = computed<TrackReference | undefined>(() => {\n\t\treturn findTrack(agentTracks, workerTracks, Track.Source.Microphone);\n\t});\n\n\tconst videoTrack = computed<TrackReference | undefined>(() => {\n\t\treturn findTrack(agentTracks, workerTracks, Track.Source.Camera);\n\t});\n\n\tconst { segments: agentTranscriptions } = useTrackTranscription({\n\t\tget trackRef() {\n\t\t\treturn audioTrack.value;\n\t\t},\n\t});\n\n\tconst { attributes } = useParticipantAttributes({\n\t\tget participant() {\n\t\t\treturn agent.value;\n\t\t},\n\t});\n\n\tconst state = computed<AgentState>(() => {\n\t\tif (connectionState.value === ConnectionState.Disconnected) {\n\t\t\treturn 'disconnected';\n\t\t}\n\n\t\tconst value = attributes.value?.[ParticipantAgentAttributes.AgentState];\n\n\t\tif (\n\t\t\tconnectionState.value === ConnectionState.Connecting ||\n\t\t\tagent.value === undefined ||\n\t\t\tvalue === undefined ||\n\t\t\t!isAgentSdkState(value)\n\t\t) {\n\t\t\treturn 'connecting';\n\t\t}\n\n\t\treturn value;\n\t});\n\n\tconst voiceAssistant: UseVoiceAssistant = {\n\t\tagent,\n\t\tstate,\n\t\taudioTrack,\n\t\tvideoTrack,\n\t\tagentTranscriptions,\n\t\tagentAttributes: attributes,\n\t};\n\n\treturn voiceAssistant;\n}\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,84,85],"mappings":"C,m6BAQMy8B,EAAM,KAAK,IACXC,EAAM,KAAK,IACXC,EAAQ,KAAK,MAC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