@camera.ui/server 2.2.7 → 2.3.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 (958) hide show
  1. package/LICENSE.md +8 -1
  2. package/dist/interface/assets/404-C0X5UBF4.js +1 -0
  3. package/dist/interface/assets/About-Ctp_u5qK.js +1 -0
  4. package/dist/interface/assets/Assistant-Bj2bAUHD.css +1 -0
  5. package/dist/interface/assets/Assistant-CDrBV_mg.js +1 -0
  6. package/dist/interface/assets/Automation-Dp6V80Iz.js +3 -0
  7. package/dist/interface/assets/Automation-R5o9sXYY.css +1 -0
  8. package/dist/interface/assets/AutomationImport-DKgg7atE.js +2 -0
  9. package/dist/interface/assets/AutomationStore-CU-m5VC8.js +2 -0
  10. package/dist/interface/assets/AutomationStoreDetail-CiyIs8Iu.js +2 -0
  11. package/dist/interface/assets/Automations-Dljh-sWu.js +2 -0
  12. package/dist/interface/assets/Camera-0p0P_mbp.css +1 -0
  13. package/dist/interface/assets/Camera-Bvovab-8.js +2 -0
  14. package/dist/interface/assets/CameraConsole-D_Fv-MAi.js +7 -0
  15. package/dist/interface/assets/Cameras-Cq7Gw-fk.js +651 -0
  16. package/dist/interface/assets/Camview-Bs2VvmUS.css +1 -0
  17. package/dist/interface/assets/Camview-CP6PA20C.js +1 -0
  18. package/dist/interface/assets/CertificateUpload-DjzNMFc3.js +1 -0
  19. package/dist/interface/assets/Config-Dl2TlyFe.js +2 -0
  20. package/dist/interface/assets/ConfigActionAssistant-DCkJ_Iqq.js +1 -0
  21. package/dist/interface/assets/ConfigActionCameraControl-2pzl59gR.js +1 -0
  22. package/dist/interface/assets/ConfigActionDelay-BAp1dr0N.js +1 -0
  23. package/dist/interface/assets/ConfigActionHttp-_kqgEuun.js +1 -0
  24. package/dist/interface/assets/ConfigActionImageInput-BgtACnCm.js +1 -0
  25. package/dist/interface/assets/ConfigActionMqtt-z7UzccW5.js +1 -0
  26. package/dist/interface/assets/ConfigActionNotification-bhbb5AqU.js +1 -0
  27. package/dist/interface/assets/ConfigActionNotificationControl-BbvX8MFu.js +1 -0
  28. package/dist/interface/assets/ConfigActionOutput-DdgSg3FU.js +1 -0
  29. package/dist/interface/assets/ConfigActionPlugin-DGjZd1L0.js +1 -0
  30. package/dist/interface/assets/ConfigActionSensor-DmImWFAo.js +1 -0
  31. package/dist/interface/assets/ConfigActionSnapshot-hVHSfdtS.js +1 -0
  32. package/dist/interface/assets/ConfigActionVariable-BIpruwsx.js +1 -0
  33. package/dist/interface/assets/ConfigConditionIfElse-DRSpsoR4.js +1 -0
  34. package/dist/interface/assets/ConfigConditionSensorState-C2SNARH7.js +1 -0
  35. package/dist/interface/assets/ConfigConditionSwitch-4SbQcU7N.js +1 -0
  36. package/dist/interface/assets/ConfigConditionTime-ESX3shbg.js +1 -0
  37. package/dist/interface/assets/ConfigSensorValueInput-CTUdAA-R.js +1 -0
  38. package/dist/interface/assets/ConfigTriggerDetection-BRr6ixxQ.js +1 -0
  39. package/dist/interface/assets/ConfigTriggerGeofence-D-xRMGrT.js +1 -0
  40. package/dist/interface/assets/ConfigTriggerManual-aXD6k1qa.js +1 -0
  41. package/dist/interface/assets/ConfigTriggerMqtt-pjHW4yOL.js +1 -0
  42. package/dist/interface/assets/ConfigTriggerSchedule-CYOt57qg.js +1 -0
  43. package/dist/interface/assets/ConfigTriggerSensor-BwJ_cAqd.js +1 -0
  44. package/dist/interface/assets/ConfigTriggerSystem-DBXIrjzU.js +1 -0
  45. package/dist/interface/assets/ConfigTriggerWebhook-CccBmMCb.js +1 -0
  46. package/dist/interface/assets/Console-DWAaz1C6.js +1 -0
  47. package/dist/interface/assets/CuiAssistantConversation-B3xEiNNt.js +5 -0
  48. package/dist/interface/assets/CuiAssistantConversation-C5ca1lgX.css +1 -0
  49. package/dist/interface/assets/CuiAutomationRunsDialog-CfylVPLI.js +1 -0
  50. package/dist/interface/assets/CuiBottomSheet-ACN23VLS.js +1 -0
  51. package/dist/interface/assets/CuiBottomSheet-DEVNeDqa.js +1 -0
  52. package/dist/interface/assets/CuiCameraPipCard-TYTCfwXf.css +1 -0
  53. package/dist/interface/assets/CuiCameraPipCard-rR_FW9zq.js +1 -0
  54. package/dist/interface/assets/CuiCameraRecordings-CnorhPhf.js +1 -0
  55. package/dist/interface/assets/CuiCameraShares-BxUgedC_.js +1 -0
  56. package/dist/interface/assets/CuiCameraTable-C3GB4Q2y.js +2 -0
  57. package/dist/interface/assets/CuiCameraTable-MHfnZSyK.js +1 -0
  58. package/dist/interface/assets/CuiChartTable-TAzZgetO.js +1 -0
  59. package/dist/interface/assets/CuiConsole-Cf5lOCE1.js +5 -0
  60. package/dist/interface/assets/CuiDataTable-DfjXa0C1.js +1 -0
  61. package/dist/interface/assets/CuiLightControl-ChK-SvJp.js +1 -0
  62. package/dist/interface/assets/CuiList-C4fxd9lD.js +1 -0
  63. package/dist/interface/assets/CuiMarkdownContent-Do04YgHe.js +1 -0
  64. package/dist/interface/assets/CuiMarkdownContent-qOPm3VEi.js +1 -0
  65. package/dist/interface/assets/CuiPluginCard-DMpANIQj.js +2 -0
  66. package/dist/interface/assets/CuiPluginCategoryChip-BKxJMid7.js +1 -0
  67. package/dist/interface/assets/CuiPluginOAuthButton-DnQ838JJ.js +2 -0
  68. package/dist/interface/assets/CuiPluginTrustBadge-DyYDUWV6.js +1 -0
  69. package/dist/interface/assets/CuiQRCode-S9fPi0_l.js +1 -0
  70. package/dist/interface/assets/CuiSchema-DScmDQsh.js +1 -0
  71. package/dist/interface/assets/CuiTopNavbarItem-CT10aAlO.js +1 -0
  72. package/dist/interface/assets/Faces-Coy-tUVM.js +1 -0
  73. package/dist/interface/assets/FirstSteps-CrMJC049.js +1 -0
  74. package/dist/interface/assets/Floorplan-Bj_mVrxp.js +1 -0
  75. package/dist/interface/assets/Floorplan-CT5TrMSD.css +1 -0
  76. package/dist/interface/assets/Instances-B_mpKAng.js +1 -0
  77. package/dist/interface/assets/Logs-fY1dpQk4.js +6 -0
  78. package/dist/interface/assets/Menu-Bgi-NLdg.js +1 -0
  79. package/dist/interface/assets/Metrics-DnMeIrkf.css +1 -0
  80. package/dist/interface/assets/Metrics-k9KACiwh.js +12 -0
  81. package/dist/interface/assets/OAuthDeviceFlow-xTh83xmc.js +1 -0
  82. package/dist/interface/assets/Plugin-BB7x7UHw.css +1 -0
  83. package/dist/interface/assets/Plugin-VWq7sONB.js +1 -0
  84. package/dist/interface/assets/PluginConsole-LnnDOVBL.js +7 -0
  85. package/dist/interface/assets/PluginDetail-CKD9sbDx.js +2 -0
  86. package/dist/interface/assets/PluginSchema-BnB0_6Sk.js +1 -0
  87. package/dist/interface/assets/PluginSearch-BoBZLLbr.js +1 -0
  88. package/dist/interface/assets/PluginSearch-kGhweU1J.js +2 -0
  89. package/dist/interface/assets/PluginUpdateProgress-DMx0QlgE.js +1 -0
  90. package/dist/interface/assets/Plugins-Ekmr6aVa.js +1 -0
  91. package/dist/interface/assets/RecentEventsFilter-StLJNuks.js +1 -0
  92. package/dist/interface/assets/Recordings-8PqxJOI3.css +1 -0
  93. package/dist/interface/assets/Recordings-Bvkuk_TV.js +1 -0
  94. package/dist/interface/assets/SensorEdit-CAf9Nb01.js +1 -0
  95. package/dist/interface/assets/SensorHistory-il8bDErX.js +1 -0
  96. package/dist/interface/assets/Sensors-sxQ6HLKo.js +2 -0
  97. package/dist/interface/assets/Settings-Bu0G7Ebx.js +1 -0
  98. package/dist/interface/assets/Settings-DtCSaLPb.css +1 -0
  99. package/dist/interface/assets/SettingsAccount-8OZJLQi-.js +1 -0
  100. package/dist/interface/assets/SettingsAccount-bSfFi9YH.js +1 -0
  101. package/dist/interface/assets/SettingsAppearance-CnvN_Tzr.js +1 -0
  102. package/dist/interface/assets/SettingsAppearance-EvPWgF4c.js +1 -0
  103. package/dist/interface/assets/SettingsAssistant-B6s6pHCx.js +1 -0
  104. package/dist/interface/assets/SettingsBackup-Dd2FaUcN.js +1 -0
  105. package/dist/interface/assets/SettingsList-SvCO_gfG.js +1 -0
  106. package/dist/interface/assets/SettingsMqtt-BXBzHX84.js +1 -0
  107. package/dist/interface/assets/SettingsNotifications-CV-jJwFV.js +1 -0
  108. package/dist/interface/assets/SettingsPermissions-GchFaWjz.js +1 -0
  109. package/dist/interface/assets/SettingsRecordings-C4Ch_jmV.js +1 -0
  110. package/dist/interface/assets/SettingsRemote-CsIGx-LU.css +1 -0
  111. package/dist/interface/assets/SettingsRemote-OZHDJKSq.js +2 -0
  112. package/dist/interface/assets/SettingsSystem-BJlHXwVs.js +2 -0
  113. package/dist/interface/assets/SettingsUsers-RGOkOzx0.js +1 -0
  114. package/dist/interface/assets/Terminal-DX-ECC91.js +4 -0
  115. package/dist/interface/assets/Training-B8my7vka.js +1 -0
  116. package/dist/interface/assets/Training-D1DDjCCD.css +1 -0
  117. package/dist/interface/assets/Updates-DmavyhAn.js +2 -0
  118. package/dist/interface/assets/VariableInput-DQJle67Y.js +1 -0
  119. package/dist/interface/assets/VariableSuggestions-D8V739dF.js +1 -0
  120. package/dist/interface/assets/VersionsHandler-B41TJhgY.js +7 -0
  121. package/dist/interface/assets/VirtualSensorCreate-MfLh-LpH.js +1 -0
  122. package/dist/interface/assets/Workers-CafDeRhH.js +2 -0
  123. package/dist/interface/assets/Workers-Dey1snI4.css +1 -0
  124. package/dist/interface/assets/account-DjBQulDn.js +1 -0
  125. package/dist/interface/assets/ace-BPAekgyf.js +1 -0
  126. package/dist/interface/assets/ace.config-CvKE-yp1.js +1 -0
  127. package/dist/interface/assets/alert-circle-B-JCMbb9.js +1 -0
  128. package/dist/interface/assets/alert-outline-B4ZZowEj.js +1 -0
  129. package/dist/interface/assets/api-By0v6EeA.css +2 -0
  130. package/dist/interface/assets/api-D1iULsSy.js +4 -0
  131. package/dist/interface/assets/api-DbUdfXO_.js +1 -0
  132. package/dist/interface/assets/arrow-left-PeaVwpHd.js +1 -0
  133. package/dist/interface/assets/assistant-7hqP6OpA.js +1 -0
  134. package/dist/interface/assets/assistantModels-D3ncWWu0.js +1 -0
  135. package/dist/interface/assets/auth-CDxrn7fe.js +1 -0
  136. package/dist/interface/assets/automations-CTTQlGCW.js +1 -0
  137. package/dist/interface/assets/back-filled-CJoz7Gkl.js +1 -0
  138. package/dist/interface/assets/bell-ring-CBf0Yn3H.js +1 -0
  139. package/dist/interface/assets/brain-uZ03n3LW.js +1 -0
  140. package/dist/interface/assets/cameraSources-MOiE_1-W.js +1 -0
  141. package/dist/interface/assets/cctv-VgKQ-dBV.js +1 -0
  142. package/dist/interface/assets/check-circle-BU-KNgPB.js +1 -0
  143. package/dist/interface/assets/check-circle-outline-BsxzAMed.js +1 -0
  144. package/dist/interface/assets/chevron-down-CxK4Sfjs.js +1 -0
  145. package/dist/interface/assets/chevron-up-DWfNH8va.js +1 -0
  146. package/dist/interface/assets/clock-outline-BtWx4GaF.js +1 -0
  147. package/dist/interface/assets/close-Be7oB7d_.js +1 -0
  148. package/dist/interface/assets/close-circle-D7Jmhp_7.js +1 -0
  149. package/dist/interface/assets/cloud-check-zCGJxpWI.js +1 -0
  150. package/dist/interface/assets/cloudHandoff-CJzFH7CW.js +1 -0
  151. package/dist/interface/assets/config-6EiGxiYm.js +1 -0
  152. package/dist/interface/assets/content-copy-BcYlfuFc.js +1 -0
  153. package/dist/interface/assets/copy-DuY-M96E.js +1 -0
  154. package/dist/interface/assets/cube-scan-Cae03i_N.js +1 -0
  155. package/dist/interface/assets/database-refresh-outline-B3OEQFF7.js +1 -0
  156. package/dist/interface/assets/delete-BWgOAzKl.js +1 -0
  157. package/dist/interface/assets/dist-DmpuuM9s.js +1 -0
  158. package/dist/interface/assets/dots-vertical-Kby1GY8_.js +1 -0
  159. package/dist/interface/assets/download-C291Yq7I.js +1 -0
  160. package/dist/interface/assets/esm-B2TVBF3B.js +1 -0
  161. package/dist/interface/assets/esm-BEntuCG7.js +1 -0
  162. package/dist/interface/assets/esm-BRnyrFH8.js +1 -0
  163. package/dist/interface/assets/esm-CCwXzd_8.js +1 -0
  164. package/dist/interface/assets/esm-CEjwTsuD.js +1 -0
  165. package/dist/interface/assets/esm-CGGV9tC4.js +1 -0
  166. package/dist/interface/assets/esm-CI2tTOc5.js +1 -0
  167. package/dist/interface/assets/esm-CgxZmMYv.js +1 -0
  168. package/dist/interface/assets/esm-Csc6f5Fy.js +1 -0
  169. package/dist/interface/assets/esm-Qzx3d-Ie.js +1 -0
  170. package/dist/interface/assets/esm-a_w7mTdx.js +1 -0
  171. package/dist/interface/assets/esm-iKfsu7-H.js +1 -0
  172. package/dist/interface/assets/esm-ks5kvk_e.js +1 -0
  173. package/dist/interface/assets/esm-nJfTguKF.js +1 -0
  174. package/dist/interface/assets/eventLabels-idFWh3Y_.js +1 -0
  175. package/dist/interface/assets/eye-off-zGCIHKOK.js +1 -0
  176. package/dist/interface/assets/flowSchema-Dp_-p9WA.js +1 -0
  177. package/dist/interface/assets/help-circle-outline-DXFepDAG.js +1 -0
  178. package/dist/interface/assets/history-D-FlZdKD.js +1 -0
  179. package/dist/interface/assets/home-DPdzRxcM.js +1 -0
  180. package/dist/interface/assets/information-outline-ChOM9qgI.js +1 -0
  181. package/dist/interface/assets/intercomService-BQYzjnAi.js +1 -0
  182. package/dist/interface/assets/lan-DvYEO83l.js +1 -0
  183. package/dist/interface/assets/main-0oXl_8v7.js +3 -0
  184. package/dist/interface/assets/main-CdvAniEp.css +1 -0
  185. package/dist/interface/assets/microphone-D-T9xga4.js +1 -0
  186. package/dist/interface/assets/minus-4T4INuO4.js +1 -0
  187. package/dist/interface/assets/mqtt-ChvXxMhR.js +1 -0
  188. package/dist/interface/assets/native-CtfXrwj5.js +1 -0
  189. package/dist/interface/assets/native-JMtkOkIV.js +1 -0
  190. package/dist/interface/assets/nodeDefinitions-Dp8cnne1.js +1 -0
  191. package/dist/interface/assets/notifications-CbL-1oMs.js +1 -0
  192. package/dist/interface/assets/pause-DHqHYA3V.js +1 -0
  193. package/dist/interface/assets/pencil-outline-D-GmPf8M.js +1 -0
  194. package/dist/interface/assets/pencil-vACi-JzY.js +1 -0
  195. package/dist/interface/assets/plugin-Dt5Xetfz.js +1 -0
  196. package/dist/interface/assets/plugins-lsoAntRQ.js +1 -0
  197. package/dist/interface/assets/plus-BBUb8_uL.js +1 -0
  198. package/dist/interface/assets/plus-BJb7U4bN.js +1 -0
  199. package/dist/interface/assets/power-Dm_aNIz-.js +1 -0
  200. package/dist/interface/assets/radar-Dcvdz--e.js +1 -0
  201. package/dist/interface/assets/refresh-CO4F18Je.js +1 -0
  202. package/dist/interface/assets/restore-xRBt3Grb.js +1 -0
  203. package/dist/interface/assets/rooms-P8WrRIco.js +1 -0
  204. package/dist/interface/assets/round-alt-arrow-left-bold-CZHXzGS5.js +1 -0
  205. package/dist/interface/assets/search-D75YW08B.js +1 -0
  206. package/dist/interface/assets/sensorIcons-BRTtoaHX.js +1 -0
  207. package/dist/interface/assets/sensorSlots-BTj-IM7z.js +1 -0
  208. package/dist/interface/assets/sensors-Dxc7HgjZ.js +1 -0
  209. package/dist/interface/assets/server-DlK8gUoE.js +1 -0
  210. package/dist/interface/assets/settings-DDOgc5BX.js +1 -0
  211. package/dist/interface/assets/source-branch-DVHuYlkZ.js +1 -0
  212. package/dist/interface/assets/theme-BOppzzar.js +1 -0
  213. package/dist/interface/assets/trash-2-DDKPtl2x.js +1 -0
  214. package/dist/interface/assets/trash-can-outline-DVH3zgo0.js +1 -0
  215. package/dist/interface/assets/trash-fill-C_IJ4Vu2.js +1 -0
  216. package/dist/interface/assets/trash2-DY0XTaJD.js +1 -0
  217. package/dist/interface/assets/types-CeruGCb8.js +1 -0
  218. package/dist/interface/assets/types-J1Drrxo1.js +1 -0
  219. package/dist/interface/assets/types-U4AuTNLR.js +1 -0
  220. package/dist/interface/assets/undo-YRkBYCnf.js +1 -0
  221. package/dist/interface/assets/ungrouped-ING_JAuK.js +1 -0
  222. package/dist/interface/assets/updates-DtVp84Y0.js +1 -0
  223. package/dist/interface/assets/upload-2WcHRjTq.js +1 -0
  224. package/dist/interface/assets/upload-BiE7VzTj.js +1 -0
  225. package/dist/interface/assets/useAppVersion-BGgCk5GD.js +1 -0
  226. package/dist/interface/assets/useAssistantActions-C13O5EHU.js +1 -0
  227. package/dist/interface/assets/useBackupRestore-vrhmc9i-.js +1 -0
  228. package/dist/interface/assets/useCameraOptions-CI1baRmm.js +1 -0
  229. package/dist/interface/assets/useKeyboardInset-CvgJp091.js +1 -0
  230. package/dist/interface/assets/useLogsSocket-Bf0BI8ET.js +1 -0
  231. package/dist/interface/assets/useNavLayout-6zM1Y-7B.js +1 -0
  232. package/dist/interface/assets/usePermissions-DZitFsBQ.js +1 -0
  233. package/dist/interface/assets/usePluginUpdates-VZdpJ_Ax.js +1 -0
  234. package/dist/interface/assets/usePushRegistration-vcbMrTxZ.js +2 -0
  235. package/dist/interface/assets/useServerRestart-DrpuNbIu.js +1 -0
  236. package/dist/interface/assets/useStreamStatus-l3Pfk1H4.js +1 -0
  237. package/dist/interface/assets/useTabSwipe-BSpi25WV.js +1 -0
  238. package/dist/interface/assets/useUpdateChannel-kAl-5UNY.js +1 -0
  239. package/dist/interface/assets/useUpdatesSocket-CaFz_fEb.js +1 -0
  240. package/dist/interface/assets/useUserOptions-BKteXnmU.js +1 -0
  241. package/dist/interface/assets/variable-Cp8o-q8t.js +1 -0
  242. package/dist/interface/assets/vendor-Df81FCJz.js +29 -0
  243. package/dist/interface/assets/vendor-ace-QSsGUspX.js +1085 -0
  244. package/dist/interface/assets/vendor-cameraui-K1Nw4PvF.js +2326 -0
  245. package/dist/interface/assets/vendor-capacitor-t5EIN1GG.js +2 -0
  246. package/dist/interface/assets/vendor-chart-BiJYkx5_.js +3 -0
  247. package/dist/interface/assets/vendor-core-CJdfpB0I.js +1 -0
  248. package/dist/interface/assets/vendor-dnd-C1kMh9_t.js +2 -0
  249. package/dist/interface/assets/vendor-draggabilly-Cw1oJ6qc.js +1 -0
  250. package/dist/interface/assets/vendor-leaflet-OSZlONe5.js +1 -0
  251. package/dist/interface/assets/vendor-markdown-DTWiWKBj.js +14 -0
  252. package/dist/interface/assets/vendor-primevue-DoA2Rwcb.js +3942 -0
  253. package/dist/interface/assets/vendor-vueflow-DWU_IzGe.js +26 -0
  254. package/dist/interface/assets/walk-B8FNhXuj.js +1 -0
  255. package/dist/interface/assets/web-B98ahwoP.js +1 -0
  256. package/dist/interface/assets/web-BSsSrRZf.js +1 -0
  257. package/dist/interface/assets/web-BiNRDta4.js +1 -0
  258. package/dist/interface/assets/web-BjKL51lK-CZKmYhby.js +1 -0
  259. package/dist/interface/assets/web-BjtOcquy.js +1 -0
  260. package/dist/interface/assets/web-CkTE9nCG.js +1 -0
  261. package/dist/interface/assets/web-Cvogq5S5.js +1 -0
  262. package/dist/interface/assets/web-D-A4EBKj.js +1 -0
  263. package/dist/interface/assets/web-DVGMBduz.js +1 -0
  264. package/dist/interface/assets/web-SpWB7I6X.js +1 -0
  265. package/dist/interface/assets/web-k0ihT_qK.js +1 -0
  266. package/dist/interface/assets/web-ovBpm7Dl.js +1 -0
  267. package/dist/interface/assets/web-z5Xz9tOQ.js +1 -0
  268. package/dist/interface/assets/web-zfhkFevT.js +1 -0
  269. package/dist/interface/assets/webhook-DIjChTrs.js +1 -0
  270. package/dist/interface/assets/workbox-window.prod.es5-DRKojI0e.js +1 -0
  271. package/dist/interface/assets/zoom-in-rMB152Uz.js +1 -0
  272. package/dist/interface/ha/404-RtgPpD9N.js +60 -0
  273. package/dist/interface/ha/About-0PRv9bU0.js +55 -0
  274. package/dist/interface/ha/Assistant-DbwxVfpl.js +9853 -0
  275. package/dist/interface/ha/Automation-D3HomdH7.js +2029 -0
  276. package/dist/interface/ha/AutomationImport-nQUUvZcv.js +206 -0
  277. package/dist/interface/ha/AutomationStore-BXDD92wZ.js +336 -0
  278. package/dist/interface/ha/AutomationStoreDetail-BYeq7FID.js +122 -0
  279. package/dist/interface/ha/Automations-CJlGqmSP.js +424 -0
  280. package/dist/interface/ha/Camera-Ai4BxVh_.js +747 -0
  281. package/dist/interface/ha/CameraConsole-UMNOX3dE.js +52 -0
  282. package/dist/interface/ha/Cameras-BW-AEXYi.js +1971 -0
  283. package/dist/interface/ha/Camview-jikpVEE0.js +1336 -0
  284. package/dist/interface/ha/Config-BOxwBH2D.js +356 -0
  285. package/dist/interface/ha/ConfigActionAssistant--3iWk9sq.js +182 -0
  286. package/dist/interface/ha/ConfigActionCameraControl-DbVXWTeA.js +152 -0
  287. package/dist/interface/ha/ConfigActionHttp-Du3n2Yj0.js +134 -0
  288. package/dist/interface/ha/ConfigActionImageInput-BrJrTZTY.js +171 -0
  289. package/dist/interface/ha/ConfigActionMqtt-DZd1BNUt.js +81 -0
  290. package/dist/interface/ha/ConfigActionNotification-CJWW10gt.js +199 -0
  291. package/dist/interface/ha/ConfigActionNotificationControl-Bl41AVv1.js +111 -0
  292. package/dist/interface/ha/ConfigActionOutput-OTj7Lwgq.js +98 -0
  293. package/dist/interface/ha/ConfigActionPlugin-B790PEk0.js +172 -0
  294. package/dist/interface/ha/ConfigActionSensor-BG3jZxge.js +139 -0
  295. package/dist/interface/ha/ConfigActionSnapshot-fGmLl6jb.js +48 -0
  296. package/dist/interface/ha/ConfigActionVariable-CK3vYDsr.js +88 -0
  297. package/dist/interface/ha/ConfigConditionIfElse-DyFLGg3y.js +124 -0
  298. package/dist/interface/ha/ConfigConditionSensorState-BUTfeFO2.js +192 -0
  299. package/dist/interface/ha/ConfigConditionSwitch-iDG_ubif.js +128 -0
  300. package/dist/interface/ha/ConfigSensorValueInput-BmRIGUKB.js +170 -0
  301. package/dist/interface/ha/ConfigTriggerDetection-DyPQGt9M.js +241 -0
  302. package/dist/interface/ha/ConfigTriggerGeofence-CGE-bH_t.js +4888 -0
  303. package/dist/interface/ha/ConfigTriggerMqtt-CM3KZqBc.js +134 -0
  304. package/dist/interface/ha/ConfigTriggerSensor-DoHMcwP4.js +73 -0
  305. package/dist/interface/ha/ConfigTriggerSystem-BYKbW4Zr.js +192 -0
  306. package/dist/interface/ha/ConfigTriggerWebhook-5PBAadG8.js +94 -0
  307. package/dist/interface/ha/Console-BEXzl4p1.js +348 -0
  308. package/dist/interface/ha/CuiAutomationRunsDialog-DkK_ar5G.js +130 -0
  309. package/dist/interface/ha/CuiBottomSheet-CYNvQV4T.js +270 -0
  310. package/dist/interface/ha/CuiCameraRecordings-DYjecmE_.js +533 -0
  311. package/dist/interface/ha/CuiCameraShares-C0H60nZS.js +121 -0
  312. package/dist/interface/ha/CuiCameraTable-CQNMyBaq.js +169 -0
  313. package/dist/interface/ha/CuiChartTable-Bhv1p9zj.js +6801 -0
  314. package/dist/interface/ha/CuiConsole-DtXorGF5.js +244 -0
  315. package/dist/interface/ha/CuiDataTable-Cy8EjCk9.js +8732 -0
  316. package/dist/interface/ha/CuiList-DnW6Q5m2.js +57 -0
  317. package/dist/interface/ha/CuiPluginCard-B4SCUblV.js +769 -0
  318. package/dist/interface/ha/CuiPluginOAuthButton-BKg9SftQ.js +79 -0
  319. package/dist/interface/ha/CuiPluginTrustBadge-CEtUJhCJ.js +123 -0
  320. package/dist/interface/ha/CuiQRCode-gp-9hqyk.js +86 -0
  321. package/dist/interface/ha/CuiSchema-CYpr_dD7.js +963 -0
  322. package/dist/interface/ha/CuiTopNavbarItem-CM-1oPxf.js +140 -0
  323. package/dist/interface/ha/Faces-pa60ySng.js +1575 -0
  324. package/dist/interface/ha/FirstSteps-D42yZm7R.js +251 -0
  325. package/dist/interface/ha/Floorplan-BvE546pE.js +3657 -0
  326. package/dist/interface/ha/Instances-CAGCyfbB.js +680 -0
  327. package/dist/interface/ha/Logs-RB3Ba8WM.js +418 -0
  328. package/dist/interface/ha/Menu-hAnHu_jq.js +156 -0
  329. package/dist/interface/ha/Metrics-ChYTebkX.js +1448 -0
  330. package/dist/interface/ha/OAuthDeviceFlow-C05pH-9o.js +112 -0
  331. package/dist/interface/ha/Plugin-D7XwcXkW.js +1752 -0
  332. package/dist/interface/ha/PluginConsole-DphEIOlL.js +56 -0
  333. package/dist/interface/ha/PluginDetail-DfMl-yCl.js +805 -0
  334. package/dist/interface/ha/PluginSearch-BPN4Opg5.js +462 -0
  335. package/dist/interface/ha/PluginUpdateProgress-ByJ0R5sW.js +34 -0
  336. package/dist/interface/ha/Plugins-BhKmjjNn.js +692 -0
  337. package/dist/interface/ha/RecentEventsFilter-BkLMlGVJ.js +78 -0
  338. package/dist/interface/ha/Recordings-BaU7M1OW.js +1836 -0
  339. package/dist/interface/ha/SensorEdit-DWxcCJ0F.js +1462 -0
  340. package/dist/interface/ha/SensorHistory-DuA9E9wT.js +54 -0
  341. package/dist/interface/ha/Sensors-CVpIHcgG.js +1402 -0
  342. package/dist/interface/ha/Settings-BO2eBGEn.js +218 -0
  343. package/dist/interface/ha/SettingsAccount-BQZZfoSM.js +971 -0
  344. package/dist/interface/ha/SettingsAppearance-B_yGl89u.js +220 -0
  345. package/dist/interface/ha/SettingsAssistant-kMOixl9g.js +2025 -0
  346. package/dist/interface/ha/SettingsBackup-BpG-W4j-.js +556 -0
  347. package/dist/interface/ha/SettingsList-Btnkzu94.js +40 -0
  348. package/dist/interface/ha/SettingsMqtt-C4DX9cNC.js +526 -0
  349. package/dist/interface/ha/SettingsNotifications-DI6ImggH.js +529 -0
  350. package/dist/interface/ha/SettingsPermissions-BCDyCFcb.js +84 -0
  351. package/dist/interface/ha/SettingsRecordings-Bq5NkJhd.js +152 -0
  352. package/dist/interface/ha/SettingsRemote-CtncaPIA.js +1813 -0
  353. package/dist/interface/ha/SettingsSystem-BJXuA7xA.js +376 -0
  354. package/dist/interface/ha/SettingsUsers-BF0rDluv.js +379 -0
  355. package/dist/interface/ha/Terminal-kTCe2jP3.js +612 -0
  356. package/dist/interface/ha/Training-BM2Xb8Ef.js +1754 -0
  357. package/dist/interface/ha/Updates-Cv1EY_T0.js +343 -0
  358. package/dist/interface/ha/VariableInput-BO2zZu4N.js +52 -0
  359. package/dist/interface/ha/VersionsHandler-CRnT9-K7.js +216 -0
  360. package/dist/interface/ha/VirtualSensorCreate-6dVRxPjw.js +101 -0
  361. package/dist/interface/ha/Workers-MHia86lu.js +814 -0
  362. package/dist/interface/ha/ace-C9MtBQVV.js +13236 -0
  363. package/dist/interface/ha/ace.config-CSXnaIzV.js +1429 -0
  364. package/dist/interface/ha/api-CH_Y8Hee.js +65411 -0
  365. package/dist/interface/ha/api-DylRa66V.js +29 -0
  366. package/dist/interface/ha/assistant-smRQYA6p.js +349 -0
  367. package/dist/interface/ha/auth-BXj5Fm6s.js +271 -0
  368. package/dist/interface/ha/automationBlueprint-DGjftXFC.js +250 -0
  369. package/dist/interface/ha/cameraui-cards.js +1 -1
  370. package/dist/interface/ha/cards-E0zw1UVg.js +13477 -0
  371. package/dist/interface/ha/config-dG_DA6XL.js +116 -0
  372. package/dist/interface/ha/dist-BQf9ANPx.js +3257 -0
  373. package/dist/interface/ha/dist-euRmladF.js +287 -0
  374. package/dist/interface/ha/eventLabels-B5GrM5jO.js +734 -0
  375. package/dist/interface/ha/intercomService-BtJ_zUNd.js +1400 -0
  376. package/dist/interface/ha/mqtt-CP3vVkRJ.js +56 -0
  377. package/dist/interface/ha/notifications-CZNwSXTg.js +159 -0
  378. package/dist/interface/ha/pinia-CVnHHb-s.js +7696 -0
  379. package/dist/interface/ha/plugins--eatOIaI.js +592 -0
  380. package/dist/interface/ha/protocol-BB4jdtUC-BhEwymva.js +789 -0
  381. package/dist/interface/ha/rooms-D5E6K75d.js +45 -0
  382. package/dist/interface/ha/server-D1BqEY7i.js +239 -0
  383. package/dist/interface/ha/types-CWogEoya.js +1073 -0
  384. package/dist/interface/ha/ungrouped-Ch4UX4dy.js +58 -0
  385. package/dist/interface/ha/updates-B48Owi1w.js +341 -0
  386. package/dist/interface/ha/useAppVersion-D95sKTJR.js +22 -0
  387. package/dist/interface/ha/useAssistantActions-kDwiO-u5.js +29 -0
  388. package/dist/interface/ha/useKeyboardInset-C2R51vsC.js +27 -0
  389. package/dist/interface/ha/useLogsSocket-BzNWa2y2.js +59 -0
  390. package/dist/interface/ha/useNavLayout-228cwwqA.js +125 -0
  391. package/dist/interface/ha/usePermissions-CfA5x7Df.js +72 -0
  392. package/dist/interface/ha/useServerRestart-B0c40zs5.js +23 -0
  393. package/dist/interface/ha/useTabSwipe-CfZg5hWj.js +45 -0
  394. package/dist/interface/ha/useUpdateChannel-DQxI7FrD.js +22 -0
  395. package/dist/interface/ha/useUpdatesSocket-B8LqBBd3.js +34 -0
  396. package/dist/interface/ha/useUserOptions-dZf6ejlz.js +15 -0
  397. package/dist/interface/ha/walk-CsSXaeJw.js +33 -0
  398. package/dist/interface/index.html +71 -72
  399. package/dist/interface/sw.js +1 -1
  400. package/dist/interface/workbox-5f52ac45.js +1 -0
  401. package/dist/server/package.json +23 -23
  402. package/dist/server/requirements.txt +2 -2
  403. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/__init__.py +22 -0
  404. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/camera/config.py +12 -0
  405. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/camera/device.py +5 -1
  406. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/internal/camera_config_internal.py +5 -1
  407. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/manager/__init__.py +2 -1
  408. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/plugin/__init__.py +10 -0
  409. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/plugin/contract.py +6 -0
  410. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/plugin/interfaces.py +92 -4
  411. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/sensor/__init__.py +16 -0
  412. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/sensor/base.py +4 -0
  413. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/sensor/face_embedder.py +1 -1
  414. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/sensor/object.py +3 -3
  415. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/sensor/person_embedder.py +65 -0
  416. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/sensor/segmenter.py +81 -0
  417. package/dist/server/src/api/controllers/plugins.controller.js +1 -0
  418. package/dist/server/src/api/controllers/plugins.controller.js.map +1 -1
  419. package/dist/server/src/api/controllers/workers.controller.d.ts +2 -2
  420. package/dist/server/src/api/controllers/workers.controller.js +8 -2
  421. package/dist/server/src/api/controllers/workers.controller.js.map +1 -1
  422. package/dist/server/src/api/database/index.d.ts +2 -1
  423. package/dist/server/src/api/database/index.js +31 -7
  424. package/dist/server/src/api/database/index.js.map +1 -1
  425. package/dist/server/src/api/database/migrations/v2-2-9.d.ts +3 -0
  426. package/dist/server/src/api/database/migrations/v2-2-9.js +28 -0
  427. package/dist/server/src/api/database/migrations/v2-2-9.js.map +1 -0
  428. package/dist/server/src/api/database/record-schemas.d.ts +4 -1
  429. package/dist/server/src/api/database/record-schemas.js +1 -0
  430. package/dist/server/src/api/database/record-schemas.js.map +1 -1
  431. package/dist/server/src/api/database/types.d.ts +21 -1
  432. package/dist/server/src/api/routes/workers.routes.js +4 -4
  433. package/dist/server/src/api/routes/workers.routes.js.map +1 -1
  434. package/dist/server/src/api/schemas/assistant.schema.d.ts +1 -1
  435. package/dist/server/src/api/schemas/cameras.schema.d.ts +178 -76
  436. package/dist/server/src/api/schemas/cameras.schema.js +26 -2
  437. package/dist/server/src/api/schemas/cameras.schema.js.map +1 -1
  438. package/dist/server/src/api/schemas/training.schema.d.ts +15 -3
  439. package/dist/server/src/api/schemas/training.schema.js +4 -1
  440. package/dist/server/src/api/schemas/training.schema.js.map +1 -1
  441. package/dist/server/src/api/schemas/users.schema.d.ts +12 -0
  442. package/dist/server/src/api/schemas/users.schema.js +4 -0
  443. package/dist/server/src/api/schemas/users.schema.js.map +1 -1
  444. package/dist/server/src/api/schemas/workers.schema.d.ts +5 -4
  445. package/dist/server/src/api/schemas/workers.schema.js +6 -3
  446. package/dist/server/src/api/schemas/workers.schema.js.map +1 -1
  447. package/dist/server/src/api/services/cameras.service.d.ts +3 -0
  448. package/dist/server/src/api/services/cameras.service.js +47 -2
  449. package/dist/server/src/api/services/cameras.service.js.map +1 -1
  450. package/dist/server/src/api/services/plugins.service.d.ts +1 -0
  451. package/dist/server/src/api/services/plugins.service.js +5 -1
  452. package/dist/server/src/api/services/plugins.service.js.map +1 -1
  453. package/dist/server/src/api/services/workers.service.d.ts +2 -0
  454. package/dist/server/src/api/services/workers.service.js +15 -0
  455. package/dist/server/src/api/services/workers.service.js.map +1 -1
  456. package/dist/server/src/api/types/index.d.ts +3 -2
  457. package/dist/server/src/api/websocket/nsp/worker-perf.js +2 -0
  458. package/dist/server/src/api/websocket/nsp/worker-perf.js.map +1 -1
  459. package/dist/server/src/api/websocket/types.d.ts +1 -0
  460. package/dist/server/src/assistant/pricing.js +39 -10
  461. package/dist/server/src/assistant/pricing.js.map +1 -1
  462. package/dist/server/src/assistant/providers.js +9 -1
  463. package/dist/server/src/assistant/providers.js.map +1 -1
  464. package/dist/server/src/assistant/search.d.ts +17 -0
  465. package/dist/server/src/assistant/search.js +10 -2
  466. package/dist/server/src/assistant/search.js.map +1 -1
  467. package/dist/server/src/assistant/tools/plugins.js +7 -3
  468. package/dist/server/src/assistant/tools/plugins.js.map +1 -1
  469. package/dist/server/src/assistant/types.d.ts +2 -0
  470. package/dist/server/src/automations/actions/plugin.js +5 -9
  471. package/dist/server/src/automations/actions/plugin.js.map +1 -1
  472. package/dist/server/src/automations/pluginMethodRegistry.d.ts +6 -0
  473. package/dist/server/src/automations/pluginMethodRegistry.js +39 -0
  474. package/dist/server/src/automations/pluginMethodRegistry.js.map +1 -1
  475. package/dist/server/src/automations/segment-picture.d.ts +16 -0
  476. package/dist/server/src/automations/segment-picture.js +152 -0
  477. package/dist/server/src/automations/segment-picture.js.map +1 -0
  478. package/dist/server/src/camera/decoder/detection-coordinator.d.ts +5 -2
  479. package/dist/server/src/camera/decoder/detection-coordinator.js +45 -22
  480. package/dist/server/src/camera/decoder/detection-coordinator.js.map +1 -1
  481. package/dist/server/src/camera/decoder/detection-pipeline.d.ts +30 -2
  482. package/dist/server/src/camera/decoder/detection-pipeline.js +81 -21
  483. package/dist/server/src/camera/decoder/detection-pipeline.js.map +1 -1
  484. package/dist/server/src/camera/decoder/event-manager.d.ts +13 -4
  485. package/dist/server/src/camera/decoder/event-manager.js +108 -128
  486. package/dist/server/src/camera/decoder/event-manager.js.map +1 -1
  487. package/dist/server/src/camera/decoder/event-trace.d.ts +41 -1
  488. package/dist/server/src/camera/decoder/event-trace.js +63 -8
  489. package/dist/server/src/camera/decoder/event-trace.js.map +1 -1
  490. package/dist/server/src/camera/decoder/face-tracks.d.ts +26 -0
  491. package/dist/server/src/camera/decoder/face-tracks.js +199 -0
  492. package/dist/server/src/camera/decoder/face-tracks.js.map +1 -0
  493. package/dist/server/src/camera/decoder/frame-scaler.d.ts +3 -1
  494. package/dist/server/src/camera/decoder/frame-scaler.js +36 -8
  495. package/dist/server/src/camera/decoder/frame-scaler.js.map +1 -1
  496. package/dist/server/src/camera/decoder/nvr-sink.d.ts +6 -0
  497. package/dist/server/src/camera/decoder/nvr-sink.js +1 -1
  498. package/dist/server/src/camera/decoder/nvr-sink.js.map +1 -1
  499. package/dist/server/src/camera/decoder/perf-tracker.d.ts +2 -0
  500. package/dist/server/src/camera/decoder/perf-tracker.js +4 -0
  501. package/dist/server/src/camera/decoder/perf-tracker.js.map +1 -1
  502. package/dist/server/src/camera/decoder/ptz/autotracker.d.ts +6 -1
  503. package/dist/server/src/camera/decoder/ptz/autotracker.js +107 -25
  504. package/dist/server/src/camera/decoder/ptz/autotracker.js.map +1 -1
  505. package/dist/server/src/camera/decoder/secondary-stage.d.ts +10 -8
  506. package/dist/server/src/camera/decoder/secondary-stage.js +145 -125
  507. package/dist/server/src/camera/decoder/secondary-stage.js.map +1 -1
  508. package/dist/server/src/camera/decoder/training-sink.d.ts +5 -2
  509. package/dist/server/src/camera/decoder/training-sink.js +30 -6
  510. package/dist/server/src/camera/decoder/training-sink.js.map +1 -1
  511. package/dist/server/src/camera/decoder/types.d.ts +6 -2
  512. package/dist/server/src/camera/decoder/types.js +4 -2
  513. package/dist/server/src/camera/decoder/types.js.map +1 -1
  514. package/dist/server/src/manager/coreManager.d.ts +2 -1
  515. package/dist/server/src/manager/coreManager.js +9 -2
  516. package/dist/server/src/manager/coreManager.js.map +1 -1
  517. package/dist/server/src/manager/trainingCandidateManager.d.ts +2 -1
  518. package/dist/server/src/manager/trainingCandidateManager.js +25 -3
  519. package/dist/server/src/manager/trainingCandidateManager.js.map +1 -1
  520. package/dist/server/src/manager/trainingSubmission.d.ts +5 -0
  521. package/dist/server/src/manager/trainingSubmission.js +73 -0
  522. package/dist/server/src/manager/trainingSubmission.js.map +1 -0
  523. package/dist/server/src/manager/types.d.ts +8 -2
  524. package/dist/server/src/manager/types.js.map +1 -1
  525. package/dist/server/src/plugins/runtime/node/proxy/coreManager.js +1 -1
  526. package/dist/server/src/plugins/runtime/node/proxy/coreManager.js.map +1 -1
  527. package/dist/server/src/plugins/runtime/python/proxy/camera_device.py +3 -0
  528. package/dist/server/src/plugins/runtime/python/proxy/core_manager.py +1 -1
  529. package/dist/server/src/plugins/runtime/python/proxy/sensor.py +2 -0
  530. package/dist/server/src/plugins/runtime/python/rpc/typings.py +1 -1
  531. package/dist/server/src/remote/api/routes/train.d.ts +44 -3
  532. package/dist/server/src/remote/api/routes/train.js +2 -2
  533. package/dist/server/src/remote/api/routes/train.js.map +1 -1
  534. package/dist/server/src/rpc/interfaces/core.d.ts +7 -3
  535. package/dist/server/src/rpc/interfaces/detection.d.ts +20 -3
  536. package/dist/server/src/rpc/server.d.ts +2 -0
  537. package/dist/server/src/rpc/server.js +8 -5
  538. package/dist/server/src/rpc/server.js.map +1 -1
  539. package/dist/server/src/sensors/registry.d.ts +3 -0
  540. package/dist/server/src/sensors/registry.js +44 -11
  541. package/dist/server/src/sensors/registry.js.map +1 -1
  542. package/dist/server/src/sensors/types.d.ts +1 -0
  543. package/dist/server/src/sensors/types.js +3 -0
  544. package/dist/server/src/sensors/types.js.map +1 -1
  545. package/dist/server/src/services/config/index.d.ts +1 -0
  546. package/dist/server/src/services/config/index.js +2 -0
  547. package/dist/server/src/services/config/index.js.map +1 -1
  548. package/dist/server/src/utils/image.d.ts +6 -0
  549. package/dist/server/src/utils/image.js +58 -22
  550. package/dist/server/src/utils/image.js.map +1 -1
  551. package/dist/server/src/workers/agent.js +2 -0
  552. package/dist/server/src/workers/agent.js.map +1 -1
  553. package/dist/server/src/workers/manager.d.ts +1 -0
  554. package/dist/server/src/workers/manager.js +22 -0
  555. package/dist/server/src/workers/manager.js.map +1 -1
  556. package/dist/server/src/workers/types.d.ts +5 -0
  557. package/dist/server/src/workers/types.js.map +1 -1
  558. package/npm-shrinkwrap.json +212 -171
  559. package/package.json +23 -23
  560. package/dist/interface/assets/404-C8EoOtBl.js +0 -1
  561. package/dist/interface/assets/About-Q7ZmOGgl.js +0 -1
  562. package/dist/interface/assets/Assistant-BQ6Ld-bt.css +0 -1
  563. package/dist/interface/assets/Assistant-DFLgklVe.js +0 -1
  564. package/dist/interface/assets/Automation-BSicfOGF.css +0 -1
  565. package/dist/interface/assets/Automation-D__qvx8c.js +0 -3
  566. package/dist/interface/assets/AutomationImport-CLQSdqg9.js +0 -2
  567. package/dist/interface/assets/AutomationStore-Dt6yTQDb.js +0 -2
  568. package/dist/interface/assets/AutomationStoreDetail-DqBrBhUI.js +0 -2
  569. package/dist/interface/assets/Automations-BH_7lYR7.js +0 -2
  570. package/dist/interface/assets/Camera-BW9ikKqh.css +0 -1
  571. package/dist/interface/assets/Camera-aquPHFwb.js +0 -2
  572. package/dist/interface/assets/CameraConsole-rhle_cfW.js +0 -7
  573. package/dist/interface/assets/Cameras-Bzy3P0xN.js +0 -651
  574. package/dist/interface/assets/Camview-Bri_T7Tq.css +0 -1
  575. package/dist/interface/assets/Camview-CjcQbtTl.js +0 -1
  576. package/dist/interface/assets/CertificateUpload-CWVu_52v.js +0 -1
  577. package/dist/interface/assets/Config-Dc1zKIPq.js +0 -2
  578. package/dist/interface/assets/ConfigActionAssistant-AfQfSqHZ.js +0 -1
  579. package/dist/interface/assets/ConfigActionCameraControl-BKQdHxqe.js +0 -1
  580. package/dist/interface/assets/ConfigActionDelay-B52HeJGb.js +0 -1
  581. package/dist/interface/assets/ConfigActionHttp-BP5gvpQc.js +0 -1
  582. package/dist/interface/assets/ConfigActionImageInput-DE2mSost.js +0 -1
  583. package/dist/interface/assets/ConfigActionMqtt-CYgnZjAE.js +0 -1
  584. package/dist/interface/assets/ConfigActionNotification-C3q53I4n.js +0 -1
  585. package/dist/interface/assets/ConfigActionNotificationControl-eDJ8r5ao.js +0 -1
  586. package/dist/interface/assets/ConfigActionOutput-DgYSYvy-.js +0 -1
  587. package/dist/interface/assets/ConfigActionPlugin-utolgAXk.js +0 -1
  588. package/dist/interface/assets/ConfigActionSensor-CmEKQPqs.js +0 -1
  589. package/dist/interface/assets/ConfigActionSnapshot-D7XucxVV.js +0 -1
  590. package/dist/interface/assets/ConfigActionVariable-C-Mjm3gr.js +0 -1
  591. package/dist/interface/assets/ConfigConditionIfElse-B24Rqb8y.js +0 -1
  592. package/dist/interface/assets/ConfigConditionSensorState-42-yFDmK.js +0 -1
  593. package/dist/interface/assets/ConfigConditionSwitch-DezH_nwm.js +0 -1
  594. package/dist/interface/assets/ConfigConditionTime-Cg2Lwznd.js +0 -1
  595. package/dist/interface/assets/ConfigSensorValueInput-YHBDCTZm.js +0 -1
  596. package/dist/interface/assets/ConfigTriggerDetection-DxEpodjG.js +0 -1
  597. package/dist/interface/assets/ConfigTriggerGeofence-Bye8syxc.js +0 -1
  598. package/dist/interface/assets/ConfigTriggerManual-s_lEDTV9.js +0 -1
  599. package/dist/interface/assets/ConfigTriggerMqtt-DqdZj7TU.js +0 -1
  600. package/dist/interface/assets/ConfigTriggerSchedule-Q559hn6g.js +0 -1
  601. package/dist/interface/assets/ConfigTriggerSensor-DIKkdbTF.js +0 -1
  602. package/dist/interface/assets/ConfigTriggerSystem-CwNZ4xEg.js +0 -1
  603. package/dist/interface/assets/ConfigTriggerWebhook-9ZC6X4mK.js +0 -1
  604. package/dist/interface/assets/Console-BqIDZ5vq.js +0 -1
  605. package/dist/interface/assets/CuiAssistantConversation-BmBhwrNh.css +0 -1
  606. package/dist/interface/assets/CuiAssistantConversation-CM7KdaX2.js +0 -5
  607. package/dist/interface/assets/CuiAutomationRunsDialog-CVjCLiVW.js +0 -1
  608. package/dist/interface/assets/CuiBottomSheet-CFohFiO2.js +0 -1
  609. package/dist/interface/assets/CuiBottomSheet-D75L0Zny.js +0 -1
  610. package/dist/interface/assets/CuiCameraPipCard-BQKk4fxY.css +0 -1
  611. package/dist/interface/assets/CuiCameraPipCard-eiJjYZ5W.js +0 -1
  612. package/dist/interface/assets/CuiCameraRecordings-DdEWkJrO.js +0 -1
  613. package/dist/interface/assets/CuiCameraShares-8mtgFsQ_.js +0 -1
  614. package/dist/interface/assets/CuiCameraTable-CmCT-XQF.js +0 -2
  615. package/dist/interface/assets/CuiCameraTable-DHrKoD9s.js +0 -1
  616. package/dist/interface/assets/CuiChartTable-v8sGY6PD.js +0 -1
  617. package/dist/interface/assets/CuiConsole-DYV-FUE0.js +0 -5
  618. package/dist/interface/assets/CuiDataTable-C0gsYYpg.js +0 -1
  619. package/dist/interface/assets/CuiLightControl-CFIwBj3C.js +0 -1
  620. package/dist/interface/assets/CuiList-9TVV8SB6.js +0 -1
  621. package/dist/interface/assets/CuiMarkdownContent-BYBQX_aF.js +0 -1
  622. package/dist/interface/assets/CuiMarkdownContent-DTAm-EDR.js +0 -1
  623. package/dist/interface/assets/CuiPluginCard-DEfqwUhQ.js +0 -2
  624. package/dist/interface/assets/CuiPluginCategoryChip-DhnIBJHa.js +0 -1
  625. package/dist/interface/assets/CuiPluginOAuthButton-DAuzNRAA.js +0 -2
  626. package/dist/interface/assets/CuiPluginTrustBadge-Bz710WwC.js +0 -1
  627. package/dist/interface/assets/CuiQRCode-B8-4GHSY.js +0 -1
  628. package/dist/interface/assets/CuiSchema-C_CHuKuf.js +0 -1
  629. package/dist/interface/assets/CuiTopNavbarItem-CNEnOPSh.js +0 -1
  630. package/dist/interface/assets/Faces-DRHMrrxh.js +0 -1
  631. package/dist/interface/assets/FirstSteps-Ci2Iqbe2.js +0 -1
  632. package/dist/interface/assets/Floorplan-Ci63Zd8W.css +0 -1
  633. package/dist/interface/assets/Floorplan-CqWIbDbh.js +0 -1
  634. package/dist/interface/assets/Instances-gzKFKB1l.js +0 -1
  635. package/dist/interface/assets/Logs-DL1yw_Pe.js +0 -6
  636. package/dist/interface/assets/Menu-C0GQ63aj.js +0 -1
  637. package/dist/interface/assets/Metrics-BYnnb7M0.js +0 -12
  638. package/dist/interface/assets/Metrics-DsHBab6t.css +0 -1
  639. package/dist/interface/assets/OAuthDeviceFlow-Zd6r9IHU.js +0 -1
  640. package/dist/interface/assets/Plugin-DJIrYUnZ.js +0 -1
  641. package/dist/interface/assets/Plugin-Qr_Q_Qfi.css +0 -1
  642. package/dist/interface/assets/PluginConsole-ag0jPZQ_.js +0 -7
  643. package/dist/interface/assets/PluginDetail-DmElwUuV.js +0 -2
  644. package/dist/interface/assets/PluginSchema-CxUujnVs.js +0 -1
  645. package/dist/interface/assets/PluginSearch-B-2zH2Xy.js +0 -1
  646. package/dist/interface/assets/PluginSearch-BqzngVRL.js +0 -2
  647. package/dist/interface/assets/PluginUpdateProgress-CFut0RAe.js +0 -1
  648. package/dist/interface/assets/Plugins-ZFcB_j6v.js +0 -1
  649. package/dist/interface/assets/RecentEventsFilter-CqeHhECT.js +0 -1
  650. package/dist/interface/assets/Recordings-BEKAn6QK.css +0 -1
  651. package/dist/interface/assets/Recordings-BJrtW9eG.js +0 -1
  652. package/dist/interface/assets/SensorEdit-Bi0gg-CL.js +0 -1
  653. package/dist/interface/assets/SensorHistory-q0UR3qMG.js +0 -1
  654. package/dist/interface/assets/Sensors-C_InhcHA.js +0 -2
  655. package/dist/interface/assets/Settings-Cv38rGWn.js +0 -1
  656. package/dist/interface/assets/Settings-D7495zbV.css +0 -1
  657. package/dist/interface/assets/SettingsAccount-B05739dn.js +0 -1
  658. package/dist/interface/assets/SettingsAccount-gm28wtbl.js +0 -1
  659. package/dist/interface/assets/SettingsAppearance-DdyYUgmV.js +0 -1
  660. package/dist/interface/assets/SettingsAppearance-DwUknDPV.js +0 -1
  661. package/dist/interface/assets/SettingsAssistant-ChHfkUKk.js +0 -1
  662. package/dist/interface/assets/SettingsBackup-DKwlPQhD.js +0 -1
  663. package/dist/interface/assets/SettingsList-D6hqnvUo.js +0 -1
  664. package/dist/interface/assets/SettingsMqtt-C01fgLY0.js +0 -1
  665. package/dist/interface/assets/SettingsNotifications-D47cIquQ.js +0 -1
  666. package/dist/interface/assets/SettingsPermissions-BeTCTrAf.js +0 -1
  667. package/dist/interface/assets/SettingsRecordings-mwL6Dalr.js +0 -1
  668. package/dist/interface/assets/SettingsRemote-CtP6Gz9C.css +0 -1
  669. package/dist/interface/assets/SettingsRemote-MhaShPIf.js +0 -2
  670. package/dist/interface/assets/SettingsSystem-BXnzXgqm.js +0 -2
  671. package/dist/interface/assets/SettingsUsers-D2mVlJin.js +0 -1
  672. package/dist/interface/assets/Terminal-C1UoXDRK.js +0 -4
  673. package/dist/interface/assets/Training-A5ynOv_l.js +0 -1
  674. package/dist/interface/assets/Training-C-ToeAl4.css +0 -1
  675. package/dist/interface/assets/Updates-kS_Tm8HD.js +0 -2
  676. package/dist/interface/assets/VariableInput-D9PfI8Ut.js +0 -1
  677. package/dist/interface/assets/VariableSuggestions-DArWzQuE.js +0 -1
  678. package/dist/interface/assets/VersionsHandler-BZVMpB2v.js +0 -7
  679. package/dist/interface/assets/VirtualSensorCreate-Cz-QFo4R.js +0 -1
  680. package/dist/interface/assets/Workers-2sc4VMi9.js +0 -2
  681. package/dist/interface/assets/Workers-DH59zE1C.css +0 -1
  682. package/dist/interface/assets/account-DwW7pBOb.js +0 -1
  683. package/dist/interface/assets/ace-DzzM-RlW.js +0 -1
  684. package/dist/interface/assets/ace.config-CCyX_Ohk.js +0 -1
  685. package/dist/interface/assets/alert-circle-BdUVAt1B.js +0 -1
  686. package/dist/interface/assets/alert-outline-IRxYbw0j.js +0 -1
  687. package/dist/interface/assets/api-CGfJbsTz.css +0 -2
  688. package/dist/interface/assets/api-CzwdnGAH.js +0 -1
  689. package/dist/interface/assets/api-DOpXVpef.js +0 -4
  690. package/dist/interface/assets/arrow-left-Bk-ZrOVr.js +0 -1
  691. package/dist/interface/assets/assistant-hGCAgv-f.js +0 -1
  692. package/dist/interface/assets/assistantModels-BsSgRsws.js +0 -1
  693. package/dist/interface/assets/auth-By-S-WEr.js +0 -1
  694. package/dist/interface/assets/automations-vwIwb2PQ.js +0 -1
  695. package/dist/interface/assets/back-filled-D-X19YMO.js +0 -1
  696. package/dist/interface/assets/bell-ring-DreEHgoT.js +0 -1
  697. package/dist/interface/assets/brain-DuDAg544.js +0 -1
  698. package/dist/interface/assets/cameraSources-BMhXvtFt.js +0 -1
  699. package/dist/interface/assets/cctv-DM-C_8_6.js +0 -1
  700. package/dist/interface/assets/check-circle-Bevuw8-0.js +0 -1
  701. package/dist/interface/assets/check-circle-outline-aMxkvksr.js +0 -1
  702. package/dist/interface/assets/chevron-down-CCFn9Z56.js +0 -1
  703. package/dist/interface/assets/chevron-up-CSImUM3_.js +0 -1
  704. package/dist/interface/assets/clock-outline-DH3WIEJt.js +0 -1
  705. package/dist/interface/assets/close-CMxyM4v9.js +0 -1
  706. package/dist/interface/assets/close-circle-CfgJCZ9A.js +0 -1
  707. package/dist/interface/assets/cloud-check-CbdFLIdR.js +0 -1
  708. package/dist/interface/assets/cloudHandoff-BnzjCpJ2.js +0 -1
  709. package/dist/interface/assets/config-BQxEwrK6.js +0 -1
  710. package/dist/interface/assets/content-copy-Bz49QPOI.js +0 -1
  711. package/dist/interface/assets/copy-DA6QQHRt.js +0 -1
  712. package/dist/interface/assets/cube-scan-IiH8zwm2.js +0 -1
  713. package/dist/interface/assets/database-refresh-outline-CIUDpcuq.js +0 -1
  714. package/dist/interface/assets/delete-Btu-UVx9.js +0 -1
  715. package/dist/interface/assets/dist-D_qWDAKp.js +0 -1
  716. package/dist/interface/assets/dots-vertical-D496SIss.js +0 -1
  717. package/dist/interface/assets/download-BSC7lwq_.js +0 -1
  718. package/dist/interface/assets/esm-Bn9gXwX4.js +0 -1
  719. package/dist/interface/assets/esm-BzM6y2-F.js +0 -1
  720. package/dist/interface/assets/esm-CP3JWrtj.js +0 -1
  721. package/dist/interface/assets/esm-CjAXkqCf.js +0 -1
  722. package/dist/interface/assets/esm-Cqxk-j1S.js +0 -1
  723. package/dist/interface/assets/esm-DFHd3JNU.js +0 -1
  724. package/dist/interface/assets/esm-DfMLJtug.js +0 -1
  725. package/dist/interface/assets/esm-DhDrpq7a.js +0 -1
  726. package/dist/interface/assets/esm-DvhM-SOd.js +0 -1
  727. package/dist/interface/assets/esm-G63bqygQ.js +0 -1
  728. package/dist/interface/assets/esm-Gn-Y59hU.js +0 -1
  729. package/dist/interface/assets/esm-KJSOz2vj.js +0 -1
  730. package/dist/interface/assets/esm-Ryfc94Tm.js +0 -1
  731. package/dist/interface/assets/esm-rSfI5Poy.js +0 -1
  732. package/dist/interface/assets/eventIcons-UQutPG3p.js +0 -1
  733. package/dist/interface/assets/eventLabels-BsPoPWS9.js +0 -1
  734. package/dist/interface/assets/eye-off-CSU0U8g7.js +0 -1
  735. package/dist/interface/assets/eye-off-outline-DCxLRGo_.js +0 -1
  736. package/dist/interface/assets/flowSchema-BPq6iHks.js +0 -1
  737. package/dist/interface/assets/help-circle-outline-Cr_yNhPi.js +0 -1
  738. package/dist/interface/assets/history-anuCbp1T.js +0 -1
  739. package/dist/interface/assets/home-N3bDR1vX.js +0 -1
  740. package/dist/interface/assets/information-outline-CMWIvLNB.js +0 -1
  741. package/dist/interface/assets/intercomService-CXcjcPa9.js +0 -1
  742. package/dist/interface/assets/lan-CYXjdk7L.js +0 -1
  743. package/dist/interface/assets/main-By4L33Im.js +0 -3
  744. package/dist/interface/assets/main-DVa5U7UB.css +0 -1
  745. package/dist/interface/assets/microphone-BB2pATI_.js +0 -1
  746. package/dist/interface/assets/minus-BCp3ZNKO.js +0 -1
  747. package/dist/interface/assets/mqtt-DE1KQ8Td.js +0 -1
  748. package/dist/interface/assets/native-CZJE8bTs.js +0 -1
  749. package/dist/interface/assets/native-DKZwialB.js +0 -1
  750. package/dist/interface/assets/nodeDefinitions-ByrqsENY.js +0 -1
  751. package/dist/interface/assets/notifications-BCyiD-TP.js +0 -1
  752. package/dist/interface/assets/pause-BQlxwAW2.js +0 -1
  753. package/dist/interface/assets/pencil-CDsNnEXi.js +0 -1
  754. package/dist/interface/assets/pencil-outline-CIQL5Kui.js +0 -1
  755. package/dist/interface/assets/plugin-DSEMkqaK.js +0 -1
  756. package/dist/interface/assets/plugins-BJPCV1YL.js +0 -1
  757. package/dist/interface/assets/plus-Bp4q9G7S.js +0 -1
  758. package/dist/interface/assets/plus-CySoovdr.js +0 -1
  759. package/dist/interface/assets/power-WmBLDR0-.js +0 -1
  760. package/dist/interface/assets/radar-CyYAmume.js +0 -1
  761. package/dist/interface/assets/refresh-CHTA3jVN.js +0 -1
  762. package/dist/interface/assets/restore-C8RNM5yX.js +0 -1
  763. package/dist/interface/assets/rooms-Dr4yiakO.js +0 -1
  764. package/dist/interface/assets/round-alt-arrow-left-bold-Gh5mi_yR.js +0 -1
  765. package/dist/interface/assets/search-BajCVmOI.js +0 -1
  766. package/dist/interface/assets/sensorIcons-DofElQ3w.js +0 -1
  767. package/dist/interface/assets/sensorSlots-D2KJGvPw.js +0 -1
  768. package/dist/interface/assets/sensors-3llrL7s3.js +0 -1
  769. package/dist/interface/assets/server-Dw5DD473.js +0 -1
  770. package/dist/interface/assets/settings-DnksaK7m.js +0 -1
  771. package/dist/interface/assets/source-branch-CzqIPffP.js +0 -1
  772. package/dist/interface/assets/theme-C85LJhOY.js +0 -1
  773. package/dist/interface/assets/trash-2-DJeEhHf4.js +0 -1
  774. package/dist/interface/assets/trash-can-outline-DrT6iw7I.js +0 -1
  775. package/dist/interface/assets/trash-fill-Bb_-UicM.js +0 -1
  776. package/dist/interface/assets/trash2-Dsl8gfxq.js +0 -1
  777. package/dist/interface/assets/types-CPhy0Ovw.js +0 -1
  778. package/dist/interface/assets/types-DYKmSGl4.js +0 -1
  779. package/dist/interface/assets/types-i1kTodPP.js +0 -1
  780. package/dist/interface/assets/undo-DoqJW-k7.js +0 -1
  781. package/dist/interface/assets/ungrouped-BlheTJCh.css +0 -1
  782. package/dist/interface/assets/ungrouped-C2CWO39a.js +0 -1
  783. package/dist/interface/assets/updates-C2LhMkNR.js +0 -1
  784. package/dist/interface/assets/upload-C3w1XH-o.js +0 -1
  785. package/dist/interface/assets/upload-DtIcwiNC.js +0 -1
  786. package/dist/interface/assets/useAppVersion-DkazK9Vu.js +0 -1
  787. package/dist/interface/assets/useAssistantActions-BZP6NL18.js +0 -1
  788. package/dist/interface/assets/useBackupRestore-DMQW_CVC.js +0 -1
  789. package/dist/interface/assets/useCameraOptions-DnI0xLrX.js +0 -1
  790. package/dist/interface/assets/useKeyboardInset-Cr7SxKGN.js +0 -1
  791. package/dist/interface/assets/useLogsSocket-C3Y8S0Ar.js +0 -1
  792. package/dist/interface/assets/useNavLayout-C9pcDuVP.js +0 -1
  793. package/dist/interface/assets/usePermissions-CCTxwXF0.js +0 -1
  794. package/dist/interface/assets/usePluginUpdates-DBhLWAua.js +0 -1
  795. package/dist/interface/assets/usePushRegistration-CPRVdLAx.js +0 -2
  796. package/dist/interface/assets/useServerRestart-bScBLJ9r.js +0 -1
  797. package/dist/interface/assets/useStreamStatus-Bfh-WmLH.js +0 -1
  798. package/dist/interface/assets/useTabSwipe-C_QOrvSW.js +0 -1
  799. package/dist/interface/assets/useUpdateChannel-g0h_4c55.js +0 -1
  800. package/dist/interface/assets/useUpdatesSocket-CxrLRETs.js +0 -1
  801. package/dist/interface/assets/useUserOptions-DN0t3gBr.js +0 -1
  802. package/dist/interface/assets/variable-ywTlRfo5.js +0 -1
  803. package/dist/interface/assets/vendor-ace-CvEoip98.js +0 -1085
  804. package/dist/interface/assets/vendor-cameraui-B28aGJJD.js +0 -2326
  805. package/dist/interface/assets/vendor-capacitor-Bs_WzL0Q.js +0 -2
  806. package/dist/interface/assets/vendor-chart-DBK083Hu.js +0 -3
  807. package/dist/interface/assets/vendor-core-DIa0tPNH.js +0 -1
  808. package/dist/interface/assets/vendor-dnd-DGQLvX6Y.js +0 -2
  809. package/dist/interface/assets/vendor-draggabilly-D8CK6M-y.js +0 -1
  810. package/dist/interface/assets/vendor-gFkr2qsZ.js +0 -23
  811. package/dist/interface/assets/vendor-leaflet-DkAk6mAj.js +0 -1
  812. package/dist/interface/assets/vendor-markdown-qHIinIUE.js +0 -14
  813. package/dist/interface/assets/vendor-primevue-CZKUAkMA.js +0 -3942
  814. package/dist/interface/assets/vendor-vueflow-bSwRZ9X8.js +0 -26
  815. package/dist/interface/assets/web-BDNQnMmA.js +0 -1
  816. package/dist/interface/assets/web-B_9Qyt8E.js +0 -1
  817. package/dist/interface/assets/web-BhJykCtq.js +0 -1
  818. package/dist/interface/assets/web-BjKL51lK-wWFeZlLg.js +0 -1
  819. package/dist/interface/assets/web-C7nJwIOa.js +0 -1
  820. package/dist/interface/assets/web-CGJsJQDb.js +0 -1
  821. package/dist/interface/assets/web-CJwASxrl.js +0 -1
  822. package/dist/interface/assets/web-CLe0L31Y.js +0 -1
  823. package/dist/interface/assets/web-DEv1hAn1.js +0 -1
  824. package/dist/interface/assets/web-DaeQvsXT.js +0 -1
  825. package/dist/interface/assets/web-H3-wNunW.js +0 -1
  826. package/dist/interface/assets/web-LCdyqJq1.js +0 -1
  827. package/dist/interface/assets/web-XZWYTK65.js +0 -1
  828. package/dist/interface/assets/web-rU5hlxxW.js +0 -1
  829. package/dist/interface/assets/webhook-CWKf2Qxu.js +0 -1
  830. package/dist/interface/assets/workbox-window.prod.es5-BEYAF-e-.js +0 -1
  831. package/dist/interface/assets/zoom-in-CHkXAWHy.js +0 -1
  832. package/dist/interface/ha/404-tl2VQ3qy.js +0 -60
  833. package/dist/interface/ha/About-Cn7KOblU.js +0 -55
  834. package/dist/interface/ha/Assistant-DG2GGda0.js +0 -9361
  835. package/dist/interface/ha/Automation-D0_WpXx4.js +0 -2025
  836. package/dist/interface/ha/AutomationImport-DdC3dEaC.js +0 -206
  837. package/dist/interface/ha/AutomationStore-BrLn4oBx.js +0 -336
  838. package/dist/interface/ha/AutomationStoreDetail-DoppNsNc.js +0 -122
  839. package/dist/interface/ha/Automations-BaUJ9pVq.js +0 -424
  840. package/dist/interface/ha/Camera-Cj5ImvZG.js +0 -657
  841. package/dist/interface/ha/CameraConsole-7MhlS2VK.js +0 -52
  842. package/dist/interface/ha/Cameras-vHYz8uSO.js +0 -1969
  843. package/dist/interface/ha/Camview-BEglAx26.js +0 -1331
  844. package/dist/interface/ha/Config-CHiK--zP.js +0 -356
  845. package/dist/interface/ha/ConfigActionAssistant-DynduZYV.js +0 -182
  846. package/dist/interface/ha/ConfigActionCameraControl-BEYePssz.js +0 -152
  847. package/dist/interface/ha/ConfigActionHttp-h0vRWqZ5.js +0 -134
  848. package/dist/interface/ha/ConfigActionImageInput-B9GMZYAR.js +0 -171
  849. package/dist/interface/ha/ConfigActionMqtt-BEQpHBgf.js +0 -81
  850. package/dist/interface/ha/ConfigActionNotification-BYsz8_aS.js +0 -199
  851. package/dist/interface/ha/ConfigActionNotificationControl-BxmIWVE8.js +0 -111
  852. package/dist/interface/ha/ConfigActionOutput-DTOQSa1S.js +0 -98
  853. package/dist/interface/ha/ConfigActionPlugin-NOsUs3QI.js +0 -172
  854. package/dist/interface/ha/ConfigActionSensor-YWnsH_LV.js +0 -139
  855. package/dist/interface/ha/ConfigActionSnapshot-DHJnTvin.js +0 -48
  856. package/dist/interface/ha/ConfigActionVariable-C7UFnvW0.js +0 -88
  857. package/dist/interface/ha/ConfigConditionIfElse-CAHbuhH3.js +0 -124
  858. package/dist/interface/ha/ConfigConditionSensorState-CE6okUeb.js +0 -192
  859. package/dist/interface/ha/ConfigConditionSwitch-D5FULaTy.js +0 -128
  860. package/dist/interface/ha/ConfigSensorValueInput-mo6Gs_aZ.js +0 -170
  861. package/dist/interface/ha/ConfigTriggerDetection-Bt-OhHtM.js +0 -241
  862. package/dist/interface/ha/ConfigTriggerGeofence-Cw3jV5qD.js +0 -4888
  863. package/dist/interface/ha/ConfigTriggerMqtt-BXeV82UG.js +0 -134
  864. package/dist/interface/ha/ConfigTriggerSensor-Baqq--nJ.js +0 -73
  865. package/dist/interface/ha/ConfigTriggerSystem-braUVGzW.js +0 -192
  866. package/dist/interface/ha/ConfigTriggerWebhook-Dm45r-1C.js +0 -94
  867. package/dist/interface/ha/Console-q3TCsxYo.js +0 -348
  868. package/dist/interface/ha/CuiAutomationRunsDialog-DO6h5Tc4.js +0 -130
  869. package/dist/interface/ha/CuiBottomSheet-B7ldz0xi.js +0 -270
  870. package/dist/interface/ha/CuiCameraRecordings-Dq1Vh3qA.js +0 -551
  871. package/dist/interface/ha/CuiCameraShares-DBqcpevG.js +0 -121
  872. package/dist/interface/ha/CuiCameraTable-kL8rK-Uv.js +0 -169
  873. package/dist/interface/ha/CuiChartTable-BrFyiSt_.js +0 -6801
  874. package/dist/interface/ha/CuiConsole-DpeXZmJd.js +0 -244
  875. package/dist/interface/ha/CuiDataTable-BtqzIz0o.js +0 -8732
  876. package/dist/interface/ha/CuiList-CU2NJ1K6.js +0 -57
  877. package/dist/interface/ha/CuiPluginCard-lBLypaN4.js +0 -769
  878. package/dist/interface/ha/CuiPluginOAuthButton-CuGauZJA.js +0 -79
  879. package/dist/interface/ha/CuiPluginTrustBadge-BofBmRYc.js +0 -123
  880. package/dist/interface/ha/CuiQRCode-CdK9bwKb.js +0 -86
  881. package/dist/interface/ha/CuiSchema-DqkCLv9Y.js +0 -963
  882. package/dist/interface/ha/CuiTopNavbarItem-C2VZB7WV.js +0 -140
  883. package/dist/interface/ha/Faces-Crfi-75Z.js +0 -1441
  884. package/dist/interface/ha/FirstSteps-CKVG86pf.js +0 -251
  885. package/dist/interface/ha/Floorplan-CH9_-6hk.js +0 -3657
  886. package/dist/interface/ha/Instances-5gZdPPDA.js +0 -680
  887. package/dist/interface/ha/Logs-BkzEM70F.js +0 -418
  888. package/dist/interface/ha/Menu-BuT3_Ggx.js +0 -156
  889. package/dist/interface/ha/Metrics-BGrzu0bu.js +0 -1447
  890. package/dist/interface/ha/OAuthDeviceFlow-BEJtegqy.js +0 -112
  891. package/dist/interface/ha/Plugin-Bnp2jiC2.js +0 -1544
  892. package/dist/interface/ha/PluginConsole-CmsuPVMz.js +0 -56
  893. package/dist/interface/ha/PluginDetail-BCNx7vHr.js +0 -805
  894. package/dist/interface/ha/PluginSearch-DOdhuxgM.js +0 -462
  895. package/dist/interface/ha/PluginUpdateProgress-CwkKc8Tr.js +0 -34
  896. package/dist/interface/ha/Plugins-BrFowCdC.js +0 -692
  897. package/dist/interface/ha/RecentEventsFilter-9ZkDHD1g.js +0 -79
  898. package/dist/interface/ha/Recordings-BZhf39pJ.js +0 -1539
  899. package/dist/interface/ha/SensorEdit-Ds6WbN4A.js +0 -1462
  900. package/dist/interface/ha/SensorHistory-CoTIYTJx.js +0 -54
  901. package/dist/interface/ha/Sensors-DZ2MKdlh.js +0 -1400
  902. package/dist/interface/ha/Settings-D3JKr430.js +0 -218
  903. package/dist/interface/ha/SettingsAccount-cvtlSKZw.js +0 -971
  904. package/dist/interface/ha/SettingsAppearance-CaKuOHRu.js +0 -220
  905. package/dist/interface/ha/SettingsAssistant-vWVjAUqQ.js +0 -2025
  906. package/dist/interface/ha/SettingsBackup-CvzL_bVf.js +0 -556
  907. package/dist/interface/ha/SettingsList-C0Ec8x-H.js +0 -40
  908. package/dist/interface/ha/SettingsMqtt-COnq-QM5.js +0 -526
  909. package/dist/interface/ha/SettingsNotifications-BZ68bQzO.js +0 -529
  910. package/dist/interface/ha/SettingsPermissions-Jh0FuIF7.js +0 -84
  911. package/dist/interface/ha/SettingsRecordings-BPtNNpDa.js +0 -152
  912. package/dist/interface/ha/SettingsRemote-BXG8IYjf.js +0 -1810
  913. package/dist/interface/ha/SettingsSystem-_jHBUhws.js +0 -376
  914. package/dist/interface/ha/SettingsUsers-CzGj_RJN.js +0 -379
  915. package/dist/interface/ha/Terminal-BP3b8IBP.js +0 -612
  916. package/dist/interface/ha/Training-C2-6DgY0.js +0 -1699
  917. package/dist/interface/ha/Updates-BMZsEhmy.js +0 -343
  918. package/dist/interface/ha/VariableInput-DmI7skCD.js +0 -52
  919. package/dist/interface/ha/VersionsHandler-DJd4NqtD.js +0 -216
  920. package/dist/interface/ha/VirtualSensorCreate-DmtGYvAn.js +0 -101
  921. package/dist/interface/ha/Workers-2HTPHgKV.js +0 -765
  922. package/dist/interface/ha/ace-B3bPzJu9.js +0 -13236
  923. package/dist/interface/ha/ace.config-Dt55Nqby.js +0 -1429
  924. package/dist/interface/ha/api-BelbnLQO.js +0 -62346
  925. package/dist/interface/ha/api-sy4rqV2N.js +0 -29
  926. package/dist/interface/ha/assistant-C6KYXJfi.js +0 -349
  927. package/dist/interface/ha/auth-Da66mVEd.js +0 -271
  928. package/dist/interface/ha/automationBlueprint-hlqqM17r.js +0 -250
  929. package/dist/interface/ha/cards-BFRRfuM7.js +0 -13436
  930. package/dist/interface/ha/config-Cd7JNMpD.js +0 -116
  931. package/dist/interface/ha/dist-BIngHzHx.js +0 -287
  932. package/dist/interface/ha/dist-BybVYMVs.js +0 -3248
  933. package/dist/interface/ha/eventIcons-BFNUgeGr.js +0 -676
  934. package/dist/interface/ha/eventLabels-B4C1_4vT.js +0 -42
  935. package/dist/interface/ha/eye-off-outline-ACbzsGuK.js +0 -19
  936. package/dist/interface/ha/intercomService-B7HkLs6z.js +0 -1414
  937. package/dist/interface/ha/mqtt-UZfptWJl.js +0 -56
  938. package/dist/interface/ha/notifications-DTHM8fS-.js +0 -159
  939. package/dist/interface/ha/pinia-BokSpDzj.js +0 -7656
  940. package/dist/interface/ha/plugins-Bwp_GfaX.js +0 -592
  941. package/dist/interface/ha/protocol-BB4jdtUC-DW3jl2tV.js +0 -708
  942. package/dist/interface/ha/rooms-BvaD0r0q.js +0 -45
  943. package/dist/interface/ha/server-OWdtITVa.js +0 -239
  944. package/dist/interface/ha/types-BFJjyMZe.js +0 -1073
  945. package/dist/interface/ha/ungrouped-x00DHNHO.js +0 -1311
  946. package/dist/interface/ha/updates-C03Qf3Il.js +0 -341
  947. package/dist/interface/ha/useAppVersion-CrMd9CC9.js +0 -22
  948. package/dist/interface/ha/useAssistantActions-S1FrNe9b.js +0 -29
  949. package/dist/interface/ha/useKeyboardInset-DwUQCWHC.js +0 -27
  950. package/dist/interface/ha/useLogsSocket-C6k217mW.js +0 -59
  951. package/dist/interface/ha/useNavLayout-DhuQE024.js +0 -125
  952. package/dist/interface/ha/usePermissions-DaE_wFch.js +0 -72
  953. package/dist/interface/ha/useServerRestart-CYaen2r6.js +0 -23
  954. package/dist/interface/ha/useTabSwipe-DAmCFlgg.js +0 -45
  955. package/dist/interface/ha/useUpdateChannel-Dr1EoU2X.js +0 -22
  956. package/dist/interface/ha/useUpdatesSocket-C8Gmhemh.js +0 -34
  957. package/dist/interface/ha/useUserOptions-BB5wk3Bq.js +0 -15
  958. package/dist/interface/workbox-778a14ff.js +0 -1
@@ -1,3248 +0,0 @@
1
- import { D as e, I as t, Ot as n, _t as r, bt as i, ft as a, l as o, ot as s, wt as c, xt as l, yt as u } from "./runtime-core.esm-bundler-_TfE0DWz.js";
2
- import { M as d, R as f, W as p, t as m } from "./protocol-BB4jdtUC-DW3jl2tV.js";
3
- import { D as h } from "./dist-BIngHzHx.js";
4
- //#region node_modules/@camera.ui/browser/dist/index.js
5
- function g(e = {}) {
6
- let { releaseDelay: t = 1e3, onRelease: n } = e, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
7
- function a(e) {
8
- let t = i.get(e);
9
- t && (clearTimeout(t), i.delete(e));
10
- }
11
- function o(e) {
12
- let t = r.get(e);
13
- if (t) {
14
- try {
15
- n?.(e, t.value);
16
- } catch {}
17
- r.delete(e);
18
- }
19
- i.delete(e);
20
- }
21
- function s(e, t) {
22
- a(e);
23
- let n = r.get(e);
24
- if (n) return n.refCount++, n.value;
25
- let i = t();
26
- return r.set(e, {
27
- value: i,
28
- refCount: 1
29
- }), i;
30
- }
31
- function c(e) {
32
- let n = r.get(e);
33
- if (n && (n.refCount--, n.refCount <= 0)) {
34
- let n = setTimeout(() => {
35
- let t = r.get(e);
36
- t && t.refCount <= 0 ? o(e) : i.delete(e);
37
- }, t);
38
- i.set(e, n);
39
- }
40
- }
41
- function l(e) {
42
- return r.get(e)?.value;
43
- }
44
- function u(e) {
45
- return r.has(e);
46
- }
47
- function d(e) {
48
- a(e), o(e);
49
- }
50
- function f() {
51
- for (let e of i.keys()) a(e);
52
- for (let e of r.keys()) o(e);
53
- }
54
- function p(e) {
55
- return r.get(e)?.refCount ?? 0;
56
- }
57
- function m(e) {
58
- for (let [t, n] of r) e(n.value, t);
59
- }
60
- return {
61
- acquire: s,
62
- release: c,
63
- get: l,
64
- has: u,
65
- forceRelease: d,
66
- clear: f,
67
- getRefCount: p,
68
- forEachValue: m
69
- };
70
- }
71
- function _() {
72
- let t = e(At);
73
- if (!t) throw Error("[camera.ui] useCameraUi() called without CameraUiPlugin installed. Make sure to call app.use(createCameraUiPlugin({ ... })) before using this composable.");
74
- return t;
75
- }
76
- function v(e) {
77
- return e.replace(/ /g, "_").toLowerCase();
78
- }
79
- function y(e, t) {
80
- return `cui_${v(e)}_${v(t)}`;
81
- }
82
- var b = class {
83
- static coreManagerNamespaces() {
84
- return {
85
- coreManagerSubject: "coreManager.subscriber",
86
- coreManagerRpc: "coreManager.rpc"
87
- };
88
- }
89
- static deviceManagerNamespaces() {
90
- return {
91
- deviceManagerSubject: "deviceManager.subscriber",
92
- deviceManagerRpc: "deviceManager.rpc"
93
- };
94
- }
95
- static sensorDiscoveryNamespaces() {
96
- return { sensorDiscoverySubject: "sensorDiscovery.subscriber" };
97
- }
98
- static discoveryManagerNamespaces() {
99
- return {
100
- discoveryManagerSubject: "discoveryManager.subscriber",
101
- discoveryManagerRpc: "discoveryManager.rpc"
102
- };
103
- }
104
- static pluginNamespaces(e) {
105
- return {
106
- pluginDeviceManagerSubject: `plugin.${e}.deviceManager.subscriber`,
107
- pluginChildRpc: `plugin.${e}.child.rpc`,
108
- pluginChild: `plugin.${e}.child`,
109
- pluginStorageRpc: `plugin.${e}.storage.rpc`,
110
- pluginConfigStoreRpc: `plugin.${e}.configstore.rpc`
111
- };
112
- }
113
- static pluginFileServeRpc(e) {
114
- return `plugin.${e}.fileserve.rpc`;
115
- }
116
- static cameraNamespaces(e) {
117
- return {
118
- cameraSubject: `camera.${e}.subscriber`,
119
- cameraControllerRpc: `camera.${e}.controller.rpc`
120
- };
121
- }
122
- static frameWorkerNamespaces(e) {
123
- return {
124
- frameWorkerChildRpc: `camera.${e}.frameWorker.child.rpc`,
125
- frameWorkerChild: `camera.${e}.frameWorker.child`
126
- };
127
- }
128
- static pluginCameraNamespaces(e, t) {
129
- return {
130
- cameraInterfacesRpc: `plugin.${e}.camera.${t}.cameraInterfaces.rpc`,
131
- cameraStorageRpc: `plugin.${e}.camera.${t}.cameraStorage.rpc`,
132
- cameraImplRpc: `plugin.${e}.camera.${t}.impl.rpc`
133
- };
134
- }
135
- static pluginSensorNamespaces(e, t) {
136
- return { sensorStorageRpc: `plugin.${e}.sensor.${t}.storage.rpc` };
137
- }
138
- static sensorRegistryNamespaces() {
139
- return {
140
- sensorsSubject: "sensors.subject",
141
- sensorsRpc: "sensors.rpc"
142
- };
143
- }
144
- static sensorCameraViewNamespaces(e) {
145
- return { sensorWriteSubject: `camera.${e}.sensors.writes` };
146
- }
147
- static sensorEventNamespaces(e) {
148
- return { sensorSubject: `sensor.${e}.subject` };
149
- }
150
- static sensorProviderNamespaces(e, t) {
151
- return { sensorRpc: `plugin.${e}.sensor.${t}.rpc` };
152
- }
153
- static frameWorkerDetectionNamespaces(e) {
154
- return { detectionRpc: `camera.${e}.frameWorker.detection.rpc` };
155
- }
156
- static detectionEventNamespaces(e) {
157
- return { detectionEventSubject: `camera.${e}.events.subject` };
158
- }
159
- static terminalManagerNamespaces() {
160
- return {
161
- terminalManagerSubject: "terminalManager.subscriber",
162
- terminalManagerRpc: "terminalManager.rpc"
163
- };
164
- }
165
- static downloadManagerNamespaces() {
166
- return { downloadManagerRpc: "downloadManager.rpc" };
167
- }
168
- static notificationManagerNamespaces() {
169
- return { notificationsPublishSubject: "notifications.publish" };
170
- }
171
- static workerAgentRpc(e) {
172
- return `worker.${e}.rpc`;
173
- }
174
- static workerManagerRpc() {
175
- return "workers.manager.rpc";
176
- }
177
- static workerSync(e) {
178
- return `worker.${e}.sync`;
179
- }
180
- static workerDisconnect() {
181
- return "workers.disconnect";
182
- }
183
- static workerLogs() {
184
- return "workers.logs";
185
- }
186
- }, x = 3, S = 3e4;
187
- async function C(e, t, n = {}) {
188
- let r = n.maxRetries ?? x, i = n.awaitConnect ?? !0, a = n.connectTimeoutMs ?? S, o = n.retryDelayMs ?? w, s = n.shouldRetry ?? T, c = n.signal, l;
189
- for (let n = 0; n <= r; n++) {
190
- if (c?.aborted) throw O();
191
- let u = e.value;
192
- if (!u) {
193
- if (!i) throw Error("rpc: not connected");
194
- u = await E(e, a, c);
195
- }
196
- try {
197
- return await t(u);
198
- } catch (e) {
199
- if (l = e, n >= r || !s(e, n)) throw e;
200
- await D(o(n), c);
201
- }
202
- }
203
- throw l ?? /* @__PURE__ */ Error("rpc: max retries exceeded");
204
- }
205
- function w(e) {
206
- return Math.min(100 * 2 ** e, 1e3);
207
- }
208
- function T(e) {
209
- if (!(e instanceof Error)) return !1;
210
- let t = e.code;
211
- if (t === "TIMEOUT" || t === "CONNECTION_CLOSED") return !0;
212
- let n = e.message.toLowerCase();
213
- return !!(n.includes("not connected") || n.includes("connection closed") || n.includes("no responders") || n.includes("connection refused") || n.includes("socket") || n.includes("timed out") || n.includes("timeout"));
214
- }
215
- async function E(e, t, n) {
216
- return e.value ? e.value : new Promise((r, i) => {
217
- let a = setTimeout(() => {
218
- c(), n?.removeEventListener("abort", o), i(/* @__PURE__ */ Error("rpc: connect timeout"));
219
- }, t), o = () => {
220
- clearTimeout(a), c(), i(O());
221
- };
222
- n?.addEventListener("abort", o, { once: !0 });
223
- let c = s(e, (e) => {
224
- e && (clearTimeout(a), c(), n?.removeEventListener("abort", o), r(e));
225
- });
226
- });
227
- }
228
- async function D(e, t) {
229
- return new Promise((n, r) => {
230
- if (t?.aborted) {
231
- r(O());
232
- return;
233
- }
234
- let i = setTimeout(() => {
235
- t?.removeEventListener("abort", a), n();
236
- }, e), a = () => {
237
- clearTimeout(i), r(O());
238
- };
239
- t?.addEventListener("abort", a, { once: !0 });
240
- });
241
- }
242
- function O() {
243
- if (typeof DOMException < "u") return new DOMException("Aborted", "AbortError");
244
- let e = /* @__PURE__ */ Error("Aborted");
245
- return e.name = "AbortError", e;
246
- }
247
- var ee = 5e3, k = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map();
248
- function P(e) {
249
- M.get(e)?.forEach((e) => e());
250
- }
251
- function F(e, t, n = !1) {
252
- let r = N.get(t);
253
- if (r) return r;
254
- let i = (async () => {
255
- let r = await le(e, t);
256
- try {
257
- return r ? await r.fetchSnapshot(void 0, n ? !0 : void 0) ?? void 0 : void 0;
258
- } finally {
259
- r && ue(t);
260
- }
261
- })().finally(() => N.delete(t));
262
- return N.set(t, i), i;
263
- }
264
- var te = !1;
265
- function ne(e, t) {
266
- te || (te = !0, e.on("reconnected", () => {
267
- setTimeout(() => {
268
- let e = 0;
269
- for (let n of M.keys()) {
270
- if ((M.get(n)?.size ?? 0) === 0) continue;
271
- let r = n;
272
- setTimeout(() => {
273
- (M.get(r)?.size ?? 0) !== 0 && F(t, r).catch(() => void 0);
274
- }, e), e += 150;
275
- }
276
- }, 0);
277
- }));
278
- }
279
- function re(e) {
280
- setTimeout(() => URL.revokeObjectURL(e), ee);
281
- }
282
- function I(e, t, n) {
283
- if (k.get(e) !== t) {
284
- let n = j.get(e);
285
- n && (re(n), j.delete(e)), k.set(e, t);
286
- }
287
- n !== void 0 && A.set(e, n), P(e);
288
- }
289
- function L(e) {
290
- return k.get(e);
291
- }
292
- function R(e, t) {
293
- return M.has(e) || M.set(e, /* @__PURE__ */ new Set()), M.get(e).add(t), () => {
294
- M.get(e)?.delete(t);
295
- };
296
- }
297
- function z(e) {
298
- let t = k.get(e);
299
- if (!t) return;
300
- let n = j.get(e);
301
- return n || (n = URL.createObjectURL(new Blob([t], { type: "image/jpeg" })), j.set(e, n)), n;
302
- }
303
- function ie() {
304
- for (let e of j.values()) URL.revokeObjectURL(e);
305
- j.clear(), k.clear(), A.clear();
306
- }
307
- function ae(e) {
308
- let t = _(), { isConnected: r } = t, i = se(), a = c(), u = l(!1), f = l(!1);
309
- ne(t, i);
310
- let p = o(() => {
311
- if (!a.value) return;
312
- let t = n(e);
313
- return z(typeof t == "string" ? t : t._id);
314
- }), m = o(() => {
315
- if (!a.value) return;
316
- let t = n(e), r = typeof t == "string" ? t : t._id;
317
- return A.get(r);
318
- });
319
- function h(e) {
320
- M.has(e) || M.set(e, /* @__PURE__ */ new Set());
321
- let t = () => {
322
- a.value = k.get(e);
323
- };
324
- return M.get(e).add(t), () => {
325
- M.get(e)?.delete(t);
326
- };
327
- }
328
- let g, v, y;
329
- async function b(t) {
330
- if (v !== t && y !== t) {
331
- y = t;
332
- try {
333
- if (!await le(i, t)) return;
334
- let r = n(e);
335
- if ((typeof r == "string" ? r : r._id) !== t || v === t) {
336
- ue(t);
337
- return;
338
- }
339
- x(), v = t;
340
- } catch {} finally {
341
- y = void 0;
342
- }
343
- }
344
- }
345
- function x() {
346
- v &&= (ue(v), void 0);
347
- }
348
- function S(e) {
349
- let t = k.get(e);
350
- return t ? (a.value = t, f.value = !0, !0) : !1;
351
- }
352
- async function C(e, t = !1) {
353
- if (r.value && e && (t || !S(e))) {
354
- u.value = !0;
355
- try {
356
- let t = await F(i, e);
357
- t && (a.value = t);
358
- } catch {} finally {
359
- u.value = !1, f.value = !0;
360
- }
361
- }
362
- }
363
- function w(e) {
364
- return typeof e == "object" && e?.disabled === !0;
365
- }
366
- async function T() {
367
- let t = n(e), o = typeof t == "string" ? t : t._id;
368
- if (o && r.value && !w(t)) {
369
- u.value = !0;
370
- try {
371
- let e = await F(i, o, !0);
372
- e && (a.value = e);
373
- } catch {} finally {
374
- u.value = !1, f.value = !0;
375
- }
376
- }
377
- }
378
- return s([
379
- r,
380
- () => n(e),
381
- () => w(n(e))
382
- ], async ([e, t, n]) => {
383
- g?.(), g = void 0;
384
- let r = typeof t == "string" ? t : t._id;
385
- e && r && !n ? (g = h(r), S(r), await b(r), await C(r)) : r ? (x(), a.value = k.get(r), f.value = !0) : (x(), a.value = void 0);
386
- }, { immediate: !0 }), d(() => {
387
- g?.(), x();
388
- }), {
389
- snapshot: a,
390
- snapshotSrc: p,
391
- snapshotTimestamp: m,
392
- isLoading: o(() => u.value || !f.value),
393
- refresh: T
394
- };
395
- }
396
- async function oe(e, t) {
397
- let n = b.cameraNamespaces(t._id), r = b.sensorRegistryNamespaces(), i = "rpc" in e && "value" in e.rpc ? e : void 0, a = i ? i.rpc : c(e), s, u, d = c(t), f = l(!1), p = l(!1), m = c(L(t._id)), g = l(!1), _ = l({}), v = R(t._id, () => {
398
- m.value = L(t._id);
399
- }), y = o(() => d.value.name), x = o(() => d.value.room), S = o(() => d.value.nativeId), w = o(() => d.value.disabled), T = o(() => d.value.detectionSettings?.snooze ?? !1), E = o(() => d.value.isCloud), D = o(() => JSON.parse(JSON.stringify(d.value.sources)).map((e) => ({
400
- ...e,
401
- snapshot: async (t) => oe(e._id, t),
402
- probeStream: async (t, n = !1) => se(e._id, t, n)
403
- }))), O = o(() => D.value.find((e) => e.role === "high-resolution")), ee = o(() => D.value.find((e) => e.role === "mid-resolution")), k = o(() => D.value.find((e) => e.role === "low-resolution")), A = o(() => O.value ?? ee.value ?? k.value), j = o(() => D.value.find((e) => e.role === "snapshot") ?? D.value.find((e) => e.useForSnapshot)), M = o(() => {
404
- let e = /* @__PURE__ */ new Set();
405
- for (let t of Object.values(_.value)) e.add(t.type);
406
- return e;
407
- }), N = o(() => Array.from(M.value)), P = o(() => M.value.has(h.Light)), F = o(() => M.value.has(h.Siren)), te = o(() => M.value.has(h.Doorbell)), ne = o(() => M.value.has(h.Battery)), re = o(() => M.value.has(h.Audio)), z = o(() => M.value.has(h.Motion)), ie = o(() => M.value.has(h.Object)), ae = o(() => M.value.has(h.PTZ));
408
- async function oe(e, r) {
409
- g.value = !0;
410
- try {
411
- try {
412
- let i = await C(a, (t) => t.createProxy(n.cameraControllerRpc).snapshotWithMeta(e, r));
413
- return i && i.data.byteLength > 0 ? (I(t._id, i.data, Date.now() - i.ageMs), i.data) : void 0;
414
- } catch {
415
- let i = await C(a, (t) => t.createProxy(n.cameraControllerRpc).snapshot(e, r));
416
- if (i && i.byteLength > 0) return I(t._id, i, r ? Date.now() : void 0), i;
417
- }
418
- } finally {
419
- g.value = !1;
420
- }
421
- }
422
- async function se(e, t, r = !1) {
423
- return C(a, (i) => i.createProxy(n.cameraControllerRpc).probeStream(e, t, r));
424
- }
425
- async function B(e) {
426
- return C(a, (t) => t.createProxy(n.cameraControllerRpc).streamUrl(e));
427
- }
428
- async function V() {
429
- let e = await C(a, (e) => e.createProxy(n.cameraControllerRpc).refreshStates());
430
- d.value = e.camera, f.value = e.cameraState, p.value = e.frameWorkerState, _.value = e.sensorStates;
431
- }
432
- async function ce(e) {
433
- switch (e.type) {
434
- case "removed":
435
- await de();
436
- break;
437
- case "updated":
438
- d.value = e.data;
439
- break;
440
- case "cameraState":
441
- f.value = e.data;
442
- break;
443
- case "frameWorkerState":
444
- p.value = e.data;
445
- break;
446
- case "snapshot:updated": I(t._id, e.data.snapshot, e.data.fetchedAt);
447
- }
448
- }
449
- function le(e) {
450
- if (e.type === "sensor:added") {
451
- let n = e.data;
452
- if (!n.sensor.assignedCameraIds.includes(t._id) || !n.sensor.connected) return;
453
- _.value = {
454
- ..._.value,
455
- [n.sensor.id]: n.state
456
- };
457
- } else if (e.type === "sensor:deleted") {
458
- let t = e.data, n = { ..._.value };
459
- delete n[t.sensorId], _.value = n;
460
- } else if (e.type === "sensor:connected:changed") {
461
- let t = e.data;
462
- if (t.connected) V().catch(() => {});
463
- else {
464
- let e = { ..._.value };
465
- delete e[t.sensorId], _.value = e;
466
- }
467
- } else if (e.type === "sensor:assignment:changed") {
468
- let n = e.data;
469
- if (n.cameraId !== t._id) return;
470
- if (n.assigned) V().catch(() => {});
471
- else {
472
- let e = { ..._.value };
473
- delete e[n.sensorId], _.value = e;
474
- }
475
- }
476
- }
477
- async function ue() {
478
- s?.(), u?.(), s = await C(a, (e) => e.subscribe(n.cameraSubject, ce)), u = await C(a, (e) => e.subscribe(r.sensorsSubject, le)), await V();
479
- }
480
- async function de() {
481
- s?.(), s = void 0, u?.(), u = void 0, v();
482
- }
483
- async function fe(e, t) {
484
- let n = D.value.find((e) => e.useForSnapshot), r = D.value.find((e) => e.role === "snapshot"), i = e ?? r?._id ?? n?._id ?? k.value?._id ?? ee.value?._id ?? O.value?._id ?? A.value?._id;
485
- return i ? oe(i, t) : Promise.resolve(void 0);
486
- }
487
- async function pe(e, t, n = !1) {
488
- let r = e ?? A.value?._id;
489
- return r ? se(r, t, n) : Promise.resolve(void 0);
490
- }
491
- return await ue(), {
492
- id: t._id,
493
- name: y,
494
- room: x,
495
- nativeId: S,
496
- disabled: w,
497
- snooze: T,
498
- isCloud: E,
499
- connected: f,
500
- frameWorkerConnected: p,
501
- sources: D,
502
- streamSource: A,
503
- snapshotSource: j,
504
- highResolutionSource: O,
505
- midResolutionSource: ee,
506
- lowResolutionSource: k,
507
- capabilities: N,
508
- hasLight: P,
509
- hasSiren: F,
510
- hasDoorbell: te,
511
- hasBattery: ne,
512
- hasAudioSensor: re,
513
- hasMotionSensor: z,
514
- hasObjectSensor: ie,
515
- hasPtz: ae,
516
- camera: d,
517
- snapshot: m,
518
- snapshotLoading: g,
519
- fetchSnapshot: fe,
520
- probeStream: pe,
521
- streamUrl: B,
522
- refreshStates: V,
523
- reconnect: ue,
524
- close: de
525
- };
526
- }
527
- function se() {
528
- let e = _(), t = b.deviceManagerNamespaces();
529
- async function n(n) {
530
- let r = await C(e.rpc, (e) => e.createProxy(t.deviceManagerRpc).getCamera(n, "@camera.ui/browser"));
531
- if (r) return oe(e, r);
532
- }
533
- return { getCamera: n };
534
- }
535
- var B = g({
536
- releaseDelay: 1e3,
537
- onRelease: (e, t) => t.close()
538
- }), V = /* @__PURE__ */ new Map();
539
- function ce() {
540
- B.clear(), V.clear();
541
- }
542
- async function le(e, t) {
543
- if (B.has(t)) return B.acquire(t, () => {
544
- throw Error("Should not create - already cached");
545
- });
546
- let n = V.get(t);
547
- if (n) {
548
- let e = await n;
549
- return e ? B.acquire(t, () => e) : void 0;
550
- }
551
- let r = e.getCamera(t);
552
- V.set(t, r);
553
- try {
554
- let e = await r;
555
- return e ? B.acquire(t, () => e) : void 0;
556
- } finally {
557
- V.delete(t);
558
- }
559
- }
560
- function ue(e) {
561
- B.release(e);
562
- }
563
- function de() {
564
- B.forEachValue((e) => {
565
- e.reconnect().catch(() => {});
566
- });
567
- }
568
- function fe(e) {
569
- let { isConnected: t } = _(), r = se(), i = c(), a = l(!1), u = l(!1), f = l(), p;
570
- async function m(o) {
571
- if (!t.value || !o) return;
572
- if (p && p !== o && (B.release(p), i.value = void 0, p = void 0), B.has(o)) {
573
- let e = B.acquire(o, () => {
574
- throw Error("Should not create - already cached");
575
- });
576
- p = o, i.value = e, u.value = !0;
577
- return;
578
- }
579
- let s = V.get(o);
580
- if (s) {
581
- a.value = !0;
582
- try {
583
- let t = await s;
584
- if (t && B.has(o) && n(e) === o) {
585
- let e = B.acquire(o, () => t);
586
- p = o, i.value = e;
587
- }
588
- } catch (e) {
589
- f.value = e instanceof Error ? e : Error(String(e));
590
- } finally {
591
- a.value = !1, u.value = !0;
592
- }
593
- return;
594
- }
595
- a.value = !0, f.value = void 0;
596
- let c = r.getCamera(o);
597
- V.set(o, c);
598
- try {
599
- let t = await c;
600
- if (t) {
601
- if (B.acquire(o, () => t), n(e) !== o) {
602
- B.release(o);
603
- return;
604
- }
605
- p = o, i.value = t;
606
- }
607
- } catch (e) {
608
- f.value = e instanceof Error ? e : Error(String(e));
609
- } finally {
610
- V.delete(o), a.value = !1, u.value = !0;
611
- }
612
- }
613
- async function h() {
614
- let t = n(e);
615
- t && (p &&= (B.getRefCount(p) <= 1 ? B.forceRelease(p) : B.release(p), i.value = void 0, void 0), await m(t));
616
- }
617
- return s([t, () => n(e)], async ([e, t]) => {
618
- e && t ? await m(t) : !e && p && (B.release(p), i.value = void 0, p = void 0);
619
- }, { immediate: !0 }), d(() => {
620
- p &&= (B.release(p), i.value = void 0, void 0);
621
- }), {
622
- camera: i,
623
- isLoading: o(() => a.value || !u.value),
624
- error: f,
625
- refresh: h
626
- };
627
- }
628
- var pe = 2e3, me = 3e4, H = g({ releaseDelay: 1e3 }), he = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Set(), _e = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), ye, be;
629
- function W() {
630
- H.clear(), he.clear();
631
- for (let e of ge) try {
632
- e();
633
- } catch {}
634
- }
635
- function xe(e) {
636
- for (let t of [..._e.get(e) ?? []]) t();
637
- }
638
- function Se(e) {
639
- let t = U.get(e);
640
- t && clearTimeout(t), U.delete(e), ve.delete(e);
641
- }
642
- function Ce(e) {
643
- if (U.has(e)) return;
644
- let t = ve.get(e) ?? 0;
645
- ve.set(e, t + 1);
646
- let n = setTimeout(() => {
647
- U.delete(e), xe(e);
648
- }, Math.min(pe * 2 ** t, me));
649
- U.set(e, n);
650
- }
651
- function we(e) {
652
- if (e?.type !== "pluginStatusChanged") return;
653
- let { pluginName: t, running: n } = e.data;
654
- n || H.forceRelease(t), Se(t), xe(t);
655
- }
656
- async function Te(e) {
657
- let t = e.value;
658
- if (t && t !== ye) {
659
- be?.(), be = void 0, ye = t;
660
- try {
661
- be = await t.subscribe(b.coreManagerNamespaces().coreManagerSubject, we);
662
- } catch {
663
- ye = void 0;
664
- }
665
- }
666
- }
667
- function Ee(e) {
668
- let { rpc: t, isConnected: r } = _(), i = c(), a = l(), u = l(!1), f = l(!1), p = l(), m, h;
669
- function g(e) {
670
- if (H.has(e)) return H.acquire(e, () => {
671
- throw Error("Should not create - already cached");
672
- });
673
- }
674
- function v(e) {
675
- H.release(e);
676
- }
677
- function y(e) {
678
- if (h === e) return;
679
- h && x(h);
680
- let t = _e.get(e) ?? /* @__PURE__ */ new Set();
681
- t.add(S), _e.set(e, t), h = e;
682
- }
683
- function x(e) {
684
- let t = _e.get(e);
685
- t && (t.delete(S), t.size === 0 && (_e.delete(e), Se(e))), h === e && (h = void 0);
686
- }
687
- function S() {
688
- let t = n(e);
689
- t && E(t, !0);
690
- }
691
- function w(e) {
692
- m &&= (v(m), void 0), i.value = void 0, a.value = void 0, Ce(e);
693
- }
694
- function T(e, t) {
695
- m = e, i.value = t.proxy, a.value = t.contract, p.value = void 0, Se(e);
696
- }
697
- async function E(o, s = !1) {
698
- if (!r.value || !o) return;
699
- if (m && m !== o && (x(m), v(m), i.value = void 0, a.value = void 0, m = void 0), y(o), Te(t), m === o && !H.has(o)) m = void 0, i.value = void 0, a.value = void 0;
700
- else if (m === o && i.value) return;
701
- let c = g(o);
702
- if (c) {
703
- T(o, c), f.value = !0;
704
- return;
705
- }
706
- let l = he.get(o);
707
- if (l) {
708
- s || (u.value = !0);
709
- try {
710
- let t = await l;
711
- if (n(e) !== o) return;
712
- if (t) {
713
- let e = g(o);
714
- e && T(o, e);
715
- } else w(o);
716
- } catch (e) {
717
- s || (p.value = e instanceof Error ? e : Error(String(e))), w(o);
718
- } finally {
719
- s || (u.value = !1), f.value = !0;
720
- }
721
- return;
722
- }
723
- s || (u.value = !0, p.value = void 0);
724
- let d = C(t, async (e) => {
725
- let t = b.coreManagerNamespaces(), n = await e.createProxy(t.coreManagerRpc).getPlugin(o);
726
- if (!n) throw Error(`Plugin "${o}" not found`);
727
- if (n.running === !1) return;
728
- let r = b.pluginNamespaces(n.id);
729
- return {
730
- proxy: e.createProxy(r.pluginChildRpc),
731
- contract: n.contract
732
- };
733
- });
734
- he.set(o, d);
735
- try {
736
- let t = await d;
737
- if (t) {
738
- if (H.acquire(o, () => t), n(e) !== o) {
739
- H.release(o);
740
- return;
741
- }
742
- T(o, t);
743
- } else n(e) === o && w(o);
744
- } catch (e) {
745
- s || (p.value = e instanceof Error ? e : Error(String(e))), w(o);
746
- } finally {
747
- he.delete(o), s || (u.value = !1), f.value = !0;
748
- }
749
- }
750
- async function D() {
751
- let t = n(e);
752
- t && (m &&= (H.getRefCount(m) <= 1 ? H.forceRelease(m) : H.release(m), i.value = void 0, a.value = void 0, void 0), await E(t));
753
- }
754
- let O = () => {
755
- m &&= (i.value = void 0, a.value = void 0, void 0);
756
- };
757
- return ge.add(O), s([
758
- r,
759
- () => n(e),
760
- t
761
- ], async ([e, t, n], r) => {
762
- let o = r?.[2];
763
- m && o && o !== n && (v(m), i.value = void 0, a.value = void 0, m = void 0), e && t && n ? await E(t) : (!e || !n) && m && (x(m), v(m), i.value = void 0, a.value = void 0, m = void 0);
764
- }, { immediate: !0 }), d(() => {
765
- ge.delete(O), x(n(e)), m &&= (x(m), v(m), i.value = void 0, a.value = void 0, void 0);
766
- }), {
767
- plugin: i,
768
- contract: a,
769
- isLoading: o(() => u.value || !f.value),
770
- error: p,
771
- refresh: D
772
- };
773
- }
774
- function G(e) {
775
- if (e) return typeof e == "string" ? e : e.id;
776
- }
777
- function K(e) {
778
- return (t) => t.type === e;
779
- }
780
- var De = K(h.Light), Oe = K(h.Siren), ke = K(h.Battery), Ae = K(h.Doorbell), je = K(h.Contact);
781
- h.Motion, h.Object, h.Audio, h.Face, h.LicensePlate, h.Classifier, h.PTZ;
782
- var Me = K(h.Switch), Ne = K(h.Lock), Pe = K(h.SecuritySystem), Fe = K(h.Temperature), Ie = K(h.Humidity), Le = K(h.Occupancy), Re = K(h.Smoke), ze = K(h.Leak);
783
- h.Gas, h.CarbonMonoxide, h.Heat, h.Cold, h.Vibration, h.Tamper, h.Problem, h.Power, h.Illuminance, h.CarbonDioxide;
784
- var Be = K(h.Garage);
785
- function Ve(e, t, n) {
786
- let r = l(t.displayName ?? e.displayName ?? e.name), i = l(t.capabilities ?? e.capabilities ?? []), a = l([...e.assignedCameraIds]), o = l(e.exposed), s = l(e.connected), c = u({ ...t.properties }), d = [];
787
- return {
788
- id: e.id,
789
- type: e.type,
790
- name: e.name,
791
- displayName: r,
792
- nativeId: e.nativeId,
793
- pluginId: e.pluginId,
794
- boundCameraId: e.boundCameraId,
795
- assignedCameraIds: a,
796
- exposed: o,
797
- connected: s,
798
- capabilities: i,
799
- properties: c,
800
- getProperty(e) {
801
- return c[e];
802
- },
803
- async setProperty(t, r) {
804
- let i = `plugin.${e.pluginId}.sensor.${e.id}.rpc`;
805
- await C(n, (e) => e.createProxy(i).updateValue(t, r));
806
- },
807
- async setDisplayName(t) {
808
- let r = b.sensorRegistryNamespaces();
809
- await C(n, (n) => n.createProxy(r.sensorsRpc).setDisplayName(e.id, t));
810
- },
811
- hasCapability(e) {
812
- return i.value.includes(e);
813
- },
814
- onCapabilitiesChanged(e) {
815
- return d.push(e), () => {
816
- let t = d.indexOf(e);
817
- t !== -1 && d.splice(t, 1);
818
- };
819
- },
820
- _notifyCapabilitiesChanged() {
821
- for (let e of d) e(i.value);
822
- }
823
- };
824
- }
825
- function He(e) {
826
- let { sensorsSubject: t, sensorsRpc: n } = b.sensorRegistryNamespaces(), r = "rpc" in e && "value" in e.rpc ? e : void 0, i = r ? r.rpc : c(e), a = c(/* @__PURE__ */ new Map()), s, u = /* @__PURE__ */ new Map(), d = l(!1), f;
827
- function p(e, t) {
828
- let n = a.value.get(e);
829
- if (n) {
830
- if (t.type === "property:changed") {
831
- let e = t.data;
832
- n.properties[e.property] = e.value;
833
- } else if (t.type === "sensor:displayName:changed") {
834
- let e = t.data;
835
- n.displayName.value = e.displayName;
836
- } else if (t.type === "sensor:capabilities:changed") {
837
- let e = t.data;
838
- n.capabilities.value = e.capabilities, n._notifyCapabilitiesChanged();
839
- }
840
- }
841
- }
842
- async function m(e) {
843
- if (u.has(e)) return;
844
- let t = b.sensorEventNamespaces(e), n = await C(i, (n) => n.subscribe(t.sensorSubject, (t) => p(e, t)));
845
- u.set(e, n);
846
- }
847
- function h(e) {
848
- let t = u.get(e);
849
- t && (t(), u.delete(e));
850
- }
851
- function g(e) {
852
- if (e.type === "sensor:added") {
853
- let t = e.data;
854
- if (a.value.has(t.sensor.id)) return;
855
- let n = Ve(t.sensor, t.state, i), r = new Map(a.value);
856
- r.set(t.sensor.id, n), a.value = r, m(t.sensor.id);
857
- } else if (e.type === "sensor:deleted") {
858
- let t = e.data;
859
- h(t.sensorId);
860
- let n = new Map(a.value);
861
- n.delete(t.sensorId), a.value = n;
862
- } else if (e.type === "sensor:connected:changed") {
863
- let t = e.data, n = a.value.get(t.sensorId);
864
- n && (n.connected.value = t.connected);
865
- } else if (e.type === "sensor:assignment:changed") {
866
- let t = e.data, n = a.value.get(t.sensorId);
867
- if (!n) return;
868
- let r = new Set(n.assignedCameraIds.value);
869
- t.assigned ? r.add(t.cameraId) : r.delete(t.cameraId), n.assignedCameraIds.value = [...r];
870
- } else if (e.type === "sensor:exposed:changed") {
871
- let t = e.data, n = a.value.get(t.sensorId);
872
- n && (n.exposed.value = t.exposed);
873
- }
874
- }
875
- async function _() {
876
- s?.(), s = void 0;
877
- for (let e of u.values()) e();
878
- u.clear(), a.value = /* @__PURE__ */ new Map();
879
- let e = [];
880
- s = await C(i, (n) => n.subscribe(t, (t) => {
881
- e ? e.push(t) : g(t);
882
- }));
883
- let [r, o] = await C(i, async (e) => {
884
- let t = e.createProxy(n);
885
- return Promise.all([t.getSensors(), t.getSensorStates()]);
886
- }), c = /* @__PURE__ */ new Map();
887
- for (let e of r) {
888
- let t = Ve(e, o[e.id] ?? {
889
- properties: {},
890
- capabilities: [],
891
- type: e.type
892
- }, i);
893
- c.set(e.id, t);
894
- }
895
- a.value = c;
896
- for (let e of c.keys()) await m(e);
897
- let l = e;
898
- e = void 0;
899
- for (let e of l) g(e);
900
- d.value = !0;
901
- }
902
- function v() {
903
- let e = _().finally(() => {
904
- f === e && (f = void 0);
905
- });
906
- return f = e, e;
907
- }
908
- async function y() {
909
- if (!d.value) return f || v(), f;
910
- }
911
- async function x() {
912
- if (d.value = !1, f) {
913
- let e = f.catch(() => {}).then(() => _()).finally(() => {
914
- f === e && (f = void 0);
915
- });
916
- return f = e, e;
917
- }
918
- return v();
919
- }
920
- function S() {
921
- s?.(), s = void 0;
922
- for (let e of u.values()) e();
923
- u.clear(), a.value.clear(), d.value = !1, f = void 0;
924
- }
925
- let w = o(() => Array.from(a.value.values()));
926
- return {
927
- sensors: w,
928
- isInitialized: o(() => d.value),
929
- getSensor(e) {
930
- return a.value.get(e);
931
- },
932
- getSensorsByType(e) {
933
- return w.value.filter((t) => t.type === e);
934
- },
935
- hasSensorType(e) {
936
- return w.value.some((t) => t.type === e);
937
- },
938
- async setDisplayName(e, t) {
939
- await C(i, (r) => r.createProxy(n).setDisplayName(e, t));
940
- },
941
- ensureInitialized: y,
942
- reconnect: x,
943
- close: S
944
- };
945
- }
946
- var Ue = g({
947
- releaseDelay: 1e3,
948
- onRelease: (e, t) => t.manager.close()
949
- });
950
- function We() {
951
- Ue.clear();
952
- }
953
- function Ge() {
954
- Ue.forEachValue((e) => {
955
- e.initPromise = e.manager.reconnect();
956
- });
957
- }
958
- var Ke = "sensors";
959
- function qe(e) {
960
- return Ue.acquire(Ke, () => ({ manager: He(e) }));
961
- }
962
- function Je() {
963
- Ue.release(Ke);
964
- }
965
- function Ye() {
966
- return {
967
- acquired: !1,
968
- cachedManager: void 0
969
- };
970
- }
971
- function q(e, t) {
972
- return e.sensors.value.filter((e) => e.assignedCameraIds.value.includes(t));
973
- }
974
- async function Xe(e, t, n, r, i) {
975
- if (t.rpc.value && n) {
976
- r.value = !0, i.value = void 0;
977
- try {
978
- let n = qe(t);
979
- return e.acquired = !0, e.cachedManager = n.manager, n.initPromise ||= n.manager.ensureInitialized(), await n.initPromise, n.manager;
980
- } catch (e) {
981
- i.value = e instanceof Error ? e : Error(String(e));
982
- return;
983
- } finally {
984
- r.value = !1;
985
- }
986
- }
987
- }
988
- function J(e) {
989
- e.acquired && (Je(), e.acquired = !1, e.cachedManager = void 0);
990
- }
991
- function Ze(e) {
992
- let t = _(), { isConnected: r } = t, i = c([]), a = c(), u = l(!1), f = l(!1), p = l(), m = Ye();
993
- s([r, () => G(n(e))], async ([e, n]) => {
994
- if (e && n) {
995
- let r = await Xe(m, t, e, u, p);
996
- a.value = r, i.value = r ? q(r, n) : [], f.value = !0;
997
- } else J(m), i.value = [], a.value = void 0;
998
- }, { immediate: !0 });
999
- let h = o(() => {
1000
- if (!a.value) return [];
1001
- let t = G(n(e));
1002
- return t ? q(a.value, t) : [];
1003
- });
1004
- return d(() => {
1005
- J(m), i.value = [];
1006
- }), {
1007
- sensors: h,
1008
- isLoading: o(() => u.value || !f.value),
1009
- error: p
1010
- };
1011
- }
1012
- function Qe() {
1013
- let e = _(), { isConnected: t } = e, n = c(), r = l(!1), i = l(!1), a = l(), u = Ye();
1014
- s([t], async ([t]) => {
1015
- t ? (n.value = await Xe(u, e, t, r, a), i.value = !0) : (J(u), n.value = void 0);
1016
- }, { immediate: !0 });
1017
- let f = o(() => n.value?.sensors.value ?? []);
1018
- return d(() => {
1019
- J(u);
1020
- }), {
1021
- sensors: f,
1022
- isLoading: o(() => r.value || !i.value),
1023
- error: a
1024
- };
1025
- }
1026
- function $e(e, t, n) {
1027
- let r = e.filter((e) => e.type === t);
1028
- if (n) {
1029
- let e = r.find((e) => e.pluginId === n);
1030
- if (e) return e;
1031
- }
1032
- return r[0];
1033
- }
1034
- function et(e, t, r) {
1035
- let i = _(), { isConnected: a } = i, u = c(), f = c(), p = l(!1), m = l(!1), h = l(), g = Ye();
1036
- return s([
1037
- a,
1038
- () => G(n(e)),
1039
- () => n(r)
1040
- ], async ([e, n, r]) => {
1041
- if (e && n) {
1042
- let a = await Xe(g, i, e, p, h);
1043
- f.value = a, u.value = a ? $e(q(a, n), t, r) : void 0, m.value = !0;
1044
- } else J(g), u.value = void 0;
1045
- }, { immediate: !0 }), s(() => {
1046
- if (!f.value) return;
1047
- let i = G(n(e));
1048
- if (i) return $e(q(f.value, i), t, n(r))?.id;
1049
- }, () => {
1050
- if (f.value) {
1051
- let i = G(n(e));
1052
- u.value = i ? $e(q(f.value, i), t, n(r)) : void 0;
1053
- }
1054
- }), d(() => {
1055
- J(g), u.value = void 0;
1056
- }), {
1057
- sensor: u,
1058
- isLoading: o(() => p.value || !m.value),
1059
- error: h
1060
- };
1061
- }
1062
- function tt(e, t) {
1063
- return et(e, h.Motion, t);
1064
- }
1065
- function nt(e, t) {
1066
- return et(e, h.Object, t);
1067
- }
1068
- function rt(e, t) {
1069
- return et(e, h.Face, t);
1070
- }
1071
- function it(e, t) {
1072
- return et(e, h.LicensePlate, t);
1073
- }
1074
- function at(e) {
1075
- return et(e, h.PTZ);
1076
- }
1077
- function ot(e) {
1078
- let t = _(), { isConnected: r } = t, i = c([]), a = c(), u = l(!1), f = l(!1), p = l(), m = Ye();
1079
- s([r, () => G(n(e))], async ([e, n]) => {
1080
- if (e && n) {
1081
- let r = await Xe(m, t, e, u, p);
1082
- a.value = r, i.value = r ? q(r, n).filter((e) => e.type === h.Classifier) : [], f.value = !0;
1083
- } else J(m), i.value = [], a.value = void 0;
1084
- }, { immediate: !0 });
1085
- let g = o(() => {
1086
- if (!a.value) return [];
1087
- let t = G(n(e));
1088
- return t ? q(a.value, t).filter((e) => e.type === h.Classifier) : [];
1089
- });
1090
- return d(() => {
1091
- J(m), i.value = [];
1092
- }), {
1093
- sensors: g,
1094
- isLoading: o(() => u.value || !f.value),
1095
- error: p
1096
- };
1097
- }
1098
- var st = /* @__PURE__ */ new Map(), ct = /* @__PURE__ */ new Map();
1099
- function lt() {
1100
- st.clear();
1101
- }
1102
- async function ut(e, t) {
1103
- let n = st.get(t);
1104
- if (n) return n;
1105
- let r = ct.get(t);
1106
- if (r) return r;
1107
- let i = (async () => {
1108
- let n = b.coreManagerNamespaces(), r = await C(e, (e) => e.createProxy(n.coreManagerRpc).getPlugin(t));
1109
- if (r) return st.set(t, r.id), r.id;
1110
- })().finally(() => ct.delete(t));
1111
- return ct.set(t, i), i;
1112
- }
1113
- function dt(e, t) {
1114
- let n = c(), r = l(!1), i = l(), a = null;
1115
- async function o() {
1116
- if (a) return a;
1117
- r.value = !0, i.value = void 0;
1118
- try {
1119
- return a = e.getConfig().finally(() => {
1120
- a = null;
1121
- }), n.value = await a, n.value;
1122
- } catch (e) {
1123
- i.value = e instanceof Error ? e : Error(String(e));
1124
- return;
1125
- } finally {
1126
- r.value = !1;
1127
- }
1128
- }
1129
- async function s(t, n) {
1130
- r.value = !0, i.value = void 0;
1131
- try {
1132
- await e.setValue(t, n), await o();
1133
- } catch (e) {
1134
- throw i.value = e instanceof Error ? e : Error(String(e)), e;
1135
- } finally {
1136
- r.value = !1;
1137
- }
1138
- }
1139
- async function u(t) {
1140
- r.value = !0, i.value = void 0;
1141
- try {
1142
- await e.setConfig(t), await o();
1143
- } catch (e) {
1144
- throw i.value = e instanceof Error ? e : Error(String(e)), e;
1145
- } finally {
1146
- r.value = !1;
1147
- }
1148
- }
1149
- async function d(t, n) {
1150
- r.value = !0, i.value = void 0;
1151
- try {
1152
- let r = await e.submitValue(t, n);
1153
- return (!r?.toast || r.toast.type !== "error") && await o(), r;
1154
- } catch (e) {
1155
- throw i.value = e instanceof Error ? e : Error(String(e)), e;
1156
- } finally {
1157
- r.value = !1;
1158
- }
1159
- }
1160
- return {
1161
- proxy: e,
1162
- client: t,
1163
- config: n,
1164
- isLoading: r,
1165
- error: i,
1166
- getConfig: o,
1167
- setValue: s,
1168
- setConfig: u,
1169
- submitValue: d
1170
- };
1171
- }
1172
- var ft = g({ releaseDelay: 1e3 });
1173
- function pt(e) {
1174
- return `plugin:${e}`;
1175
- }
1176
- function mt(e, t) {
1177
- return `plugin:${e}:camera:${t}`;
1178
- }
1179
- function ht(e, t) {
1180
- return `plugin:${e}:sensor:${t}`;
1181
- }
1182
- function gt(e, t, n) {
1183
- let r = ft.get(e);
1184
- return r && r.client !== t && ft.forceRelease(e), ft.acquire(e, () => dt(n(), t));
1185
- }
1186
- function _t(e) {
1187
- ft.release(e);
1188
- }
1189
- function vt() {
1190
- ft.clear(), lt();
1191
- }
1192
- function yt() {
1193
- return {
1194
- currentStorageKey: void 0,
1195
- cachedStorage: void 0
1196
- };
1197
- }
1198
- function bt(e, t, n) {
1199
- e.currentStorageKey &&= (_t(e.currentStorageKey), void 0), t.value = !1, e.cachedStorage = void 0, n.value = void 0;
1200
- }
1201
- function xt(e, t, n, r, i) {
1202
- (e.currentStorageKey !== t || e.cachedStorage?.client !== n) && (e.currentStorageKey && e.currentStorageKey !== t && (_t(e.currentStorageKey), r.value = void 0), e.currentStorageKey = t, e.cachedStorage = gt(t, n, i));
1203
- }
1204
- var St = [
1205
- 2e3,
1206
- 5e3,
1207
- 1e4,
1208
- 15e3,
1209
- 15e3,
1210
- 15e3,
1211
- 15e3,
1212
- 15e3
1213
- ];
1214
- function Ct(e) {
1215
- return new Promise((t) => setTimeout(t, e));
1216
- }
1217
- function wt(e, t, n, r) {
1218
- let i, a;
1219
- function o() {
1220
- if (!i || a !== e.cachedStorage) {
1221
- a = e.cachedStorage;
1222
- let t = s().finally(() => {
1223
- i === t && (i = void 0, a = void 0);
1224
- });
1225
- i = t;
1226
- }
1227
- return i;
1228
- }
1229
- async function s() {
1230
- let i = e.cachedStorage;
1231
- if (i) {
1232
- n.value = !0;
1233
- try {
1234
- let n = await i.getConfig();
1235
- for (let t of St) {
1236
- if (!i.error.value || e.cachedStorage !== i || (await Ct(t), e.cachedStorage !== i)) break;
1237
- n = await i.getConfig();
1238
- }
1239
- return e.cachedStorage === i ? (t.value = i.config.value, r.value = i.error.value, n) : n;
1240
- } finally {
1241
- n.value = !1;
1242
- }
1243
- }
1244
- }
1245
- async function c(i, a) {
1246
- let o = e.cachedStorage;
1247
- if (!o) throw Error("Storage not connected");
1248
- n.value = !0, r.value = void 0;
1249
- try {
1250
- await o.setValue(i, a), e.cachedStorage === o && (t.value = o.config.value);
1251
- } catch (e) {
1252
- throw r.value = e instanceof Error ? e : Error(String(e)), e;
1253
- } finally {
1254
- n.value = !1;
1255
- }
1256
- }
1257
- async function l(i) {
1258
- let a = e.cachedStorage;
1259
- if (!a) throw Error("Storage not connected");
1260
- n.value = !0, r.value = void 0;
1261
- try {
1262
- await a.setConfig(i), e.cachedStorage === a && (t.value = a.config.value);
1263
- } catch (e) {
1264
- throw r.value = e instanceof Error ? e : Error(String(e)), e;
1265
- } finally {
1266
- n.value = !1;
1267
- }
1268
- }
1269
- async function u(i, a) {
1270
- let o = e.cachedStorage;
1271
- if (!o) throw Error("Storage not connected");
1272
- n.value = !0, r.value = void 0;
1273
- try {
1274
- let n = await o.submitValue(i, a);
1275
- return e.cachedStorage === o && (t.value = o.config.value), n;
1276
- } catch (e) {
1277
- throw r.value = e instanceof Error ? e : Error(String(e)), e;
1278
- } finally {
1279
- n.value = !1;
1280
- }
1281
- }
1282
- return {
1283
- getConfig: o,
1284
- setValue: c,
1285
- setConfig: l,
1286
- submitValue: u
1287
- };
1288
- }
1289
- function Tt(e) {
1290
- let t = _(), { rpc: r, isConnected: i } = t, a = c(), u = l(!1), f = l(!1), p = l(), m = l(!1), h = yt(), g = wt(h, a, u, p);
1291
- async function v(e) {
1292
- let t = r.value;
1293
- if (!t || !i.value) return !1;
1294
- try {
1295
- let n = await ut(r, e);
1296
- if (!n) throw Error(`Plugin "${e}" not found`);
1297
- return xt(h, pt(n), t, a, () => {
1298
- let e = b.pluginNamespaces(n);
1299
- return t.createProxy(e.pluginStorageRpc);
1300
- }), m.value = !0, !0;
1301
- } catch (e) {
1302
- return p.value = e instanceof Error ? e : Error(String(e)), m.value = !1, !1;
1303
- }
1304
- }
1305
- async function y() {
1306
- let t = n(e);
1307
- if (t && await v(t)) return g.getConfig();
1308
- }
1309
- async function x() {
1310
- let t = n(e);
1311
- i.value && t ? (await v(t), g.getConfig()) : bt(h, m, a), f.value = !0;
1312
- }
1313
- return s([i, () => n(e)], x, { immediate: !0 }), t.on("reconnected", x), d(() => {
1314
- t.off("reconnected", x), bt(h, m, a);
1315
- }), {
1316
- config: a,
1317
- isLoading: o(() => u.value || !f.value),
1318
- error: p,
1319
- isConnected: m,
1320
- getConfig: y,
1321
- setValue: g.setValue,
1322
- setConfig: g.setConfig,
1323
- submitValue: g.submitValue
1324
- };
1325
- }
1326
- function Et(e, t) {
1327
- let r = _(), { rpc: i, isConnected: a } = r, u = c(), f = l(!1), p = l(!1), m = l(), h = l(!1), g = yt(), v = wt(g, u, f, m);
1328
- async function y(e, t) {
1329
- let n = i.value;
1330
- if (!n || !a.value) return !1;
1331
- try {
1332
- let r = await ut(i, t);
1333
- if (!r) throw Error(`Plugin "${t}" not found`);
1334
- return xt(g, mt(r, e), n, u, () => {
1335
- let t = b.pluginCameraNamespaces(r, e);
1336
- return n.createProxy(t.cameraStorageRpc);
1337
- }), h.value = !0, !0;
1338
- } catch (e) {
1339
- return m.value = e instanceof Error ? e : Error(String(e)), h.value = !1, !1;
1340
- }
1341
- }
1342
- async function x() {
1343
- let r = G(n(e)), i = n(t);
1344
- if (r && i && await y(r, i)) return v.getConfig();
1345
- }
1346
- async function S() {
1347
- let r = G(n(e)), i = n(t);
1348
- a.value && r && i ? (await y(r, i), v.getConfig()) : bt(g, h, u), p.value = !0;
1349
- }
1350
- return s([
1351
- a,
1352
- () => G(n(e)),
1353
- () => n(t)
1354
- ], S, { immediate: !0 }), r.on("reconnected", S), d(() => {
1355
- r.off("reconnected", S), bt(g, h, u);
1356
- }), {
1357
- config: u,
1358
- isLoading: o(() => f.value || !p.value),
1359
- error: m,
1360
- isConnected: h,
1361
- getConfig: x,
1362
- setValue: v.setValue,
1363
- setConfig: v.setConfig,
1364
- submitValue: v.submitValue
1365
- };
1366
- }
1367
- function Dt(e, t) {
1368
- let r = _(), { rpc: i, isConnected: a } = r, u = c(), f = l(!1), p = l(!1), m = l(), h = l(!1), g = yt(), v = wt(g, u, f, m);
1369
- function y(e, t) {
1370
- let n = i.value;
1371
- if (!n || !a.value) return !1;
1372
- try {
1373
- return xt(g, ht(t, e), n, u, () => {
1374
- let r = b.pluginSensorNamespaces(t, e);
1375
- return n.createProxy(r.sensorStorageRpc);
1376
- }), h.value = !0, !0;
1377
- } catch (e) {
1378
- return m.value = e instanceof Error ? e : Error(String(e)), h.value = !1, !1;
1379
- }
1380
- }
1381
- async function x() {
1382
- let r = n(e), i = n(t);
1383
- if (r && i && y(r, i)) return v.getConfig();
1384
- }
1385
- function S() {
1386
- let r = n(e), i = n(t);
1387
- a.value && r && i ? (y(r, i), v.getConfig()) : bt(g, h, u), p.value = !0;
1388
- }
1389
- return s([
1390
- a,
1391
- () => n(e),
1392
- () => n(t)
1393
- ], S, { immediate: !0 }), r.on("reconnected", S), d(() => {
1394
- r.off("reconnected", S), bt(g, h, u);
1395
- }), {
1396
- config: u,
1397
- isLoading: o(() => f.value || !p.value),
1398
- error: m,
1399
- isConnected: h,
1400
- getConfig: x,
1401
- setValue: v.setValue,
1402
- setConfig: v.setConfig,
1403
- submitValue: v.submitValue
1404
- };
1405
- }
1406
- function Ot() {
1407
- W(), ce(), vt(), We(), ie();
1408
- }
1409
- function kt() {
1410
- W(), de(), Ge();
1411
- }
1412
- var At = Symbol("camera-ui"), jt = new m("plugin");
1413
- function Mt(e) {
1414
- return "rpc" in e && "isConnected" in e;
1415
- }
1416
- var Nt = 4e3;
1417
- function Pt(e) {
1418
- let { natsTransport: t, target: n, wsTransport: a } = e, s = t.getClient() !== null, u = t.getClient(), d = null, f = !1, p = c(t.getClient() ?? void 0), m = l(t.getClient()?.isConnected ?? !1), h = l(void 0), g = o(() => n.value?.endpoint.url), _ = o(() => n.value?.tokens.access), v = o(() => {
1419
- let e = n.value;
1420
- if (e?.tokens.proxySession) return { session: e.tokens.proxySession };
1421
- }), y = /* @__PURE__ */ new Map();
1422
- function b(e, t) {
1423
- let n = y.get(e);
1424
- n || (n = /* @__PURE__ */ new Set(), y.set(e, n)), n.add(t);
1425
- }
1426
- function x(e, t) {
1427
- y.get(e)?.delete(t);
1428
- }
1429
- function S(e) {
1430
- let t = y.get(e);
1431
- if (t) for (let e of t) try {
1432
- e();
1433
- } catch (e) {
1434
- jt.warn("context listener threw:", e);
1435
- }
1436
- }
1437
- return t.subscribeClient((e) => {
1438
- if (e) {
1439
- d !== null && (clearTimeout(d), d = null);
1440
- let t = m.value, n = e !== u;
1441
- u = e, p.value = e, m.value = !0, h.value = void 0, !t || n ? (kt(), s && S("reconnected"), s = !0) : f && s && S("reconnected"), f = !1;
1442
- } else {
1443
- if (f = !0, p.value = void 0, d !== null || !m.value) return;
1444
- d = setTimeout(() => {
1445
- d = null, m.value = !1, S("disconnected");
1446
- }, Nt);
1447
- }
1448
- }), t.on("auth-error", (e) => {
1449
- h.value = Error(e.message ?? "auth-error");
1450
- }), t.on("down", (e) => {
1451
- h.value ||= Error(e.reason);
1452
- }), t.on("up", () => {
1453
- h.value = void 0;
1454
- }), r({
1455
- rpc: p,
1456
- target: i(n),
1457
- isConnected: i(m),
1458
- endpoint: g,
1459
- token: _,
1460
- extraProxyQuery: v,
1461
- error: i(h),
1462
- wsTransport: a,
1463
- on: b,
1464
- off: x
1465
- });
1466
- }
1467
- function Ft(e) {
1468
- return { install(t) {
1469
- let n = Mt(e) ? e : Pt(e);
1470
- t.provide(At, n);
1471
- } };
1472
- }
1473
- var It = {
1474
- standbyTimeout: 5e3,
1475
- activityTimeout: 5e3
1476
- };
1477
- function Lt(e) {
1478
- let { initialMode: t = "always-on", config: n = {}, onStreamStart: r, onStreamStop: i, isStreamPlaying: a } = e, o = {
1479
- ...It,
1480
- ...n
1481
- }, s = l(t), c = l(!1), u = l(!1), d, f;
1482
- function p() {
1483
- d &&= (clearTimeout(d), void 0);
1484
- }
1485
- function m() {
1486
- f &&= (clearTimeout(f), void 0);
1487
- }
1488
- function h() {
1489
- p(), m();
1490
- }
1491
- function g() {
1492
- c.value || (c.value = !0, i());
1493
- }
1494
- function _() {
1495
- c.value && (c.value = !1, r());
1496
- }
1497
- function v() {
1498
- switch (h(), s.value) {
1499
- case "always-on":
1500
- c.value = !1, a() || r();
1501
- break;
1502
- case "standby":
1503
- c.value || (a() || r(), y());
1504
- break;
1505
- case "activity": u.value ? (c.value = !1, a() || r()) : d = setTimeout(() => {
1506
- s.value === "activity" && !u.value && g();
1507
- }, o.activityTimeout);
1508
- }
1509
- }
1510
- function y() {
1511
- m(), f = setTimeout(() => {
1512
- s.value === "standby" && g();
1513
- }, o.standbyTimeout);
1514
- }
1515
- function b(e) {
1516
- s.value !== e && (s.value = e, v());
1517
- }
1518
- function x(e) {
1519
- s.value === "activity" && (e ? (u.value = !0, p(), (c.value || !a()) && _()) : (u.value = !1, p(), d = setTimeout(() => {
1520
- u.value || g();
1521
- }, o.activityTimeout)));
1522
- }
1523
- function S() {
1524
- if (c.value) switch (_(), s.value) {
1525
- case "standby":
1526
- y();
1527
- break;
1528
- case "activity": p(), u.value || (d = setTimeout(() => {
1529
- g();
1530
- }, o.activityTimeout));
1531
- }
1532
- }
1533
- function C() {
1534
- s.value === "standby" && !c.value && y();
1535
- }
1536
- function w() {
1537
- h();
1538
- }
1539
- return {
1540
- mode: s,
1541
- inStandby: c,
1542
- hasActivity: u,
1543
- setMode: b,
1544
- reportActivity: x,
1545
- resumeFromStandby: S,
1546
- resetIdleTimer: C,
1547
- dispose: w
1548
- };
1549
- }
1550
- var Rt = 3e4, Y = new m("TabVisibility"), zt = l(typeof document > "u" || document.visibilityState === "visible"), Bt = null, Vt = /* @__PURE__ */ new Set(), Ht = /* @__PURE__ */ new Set(), Ut = /* @__PURE__ */ new Set(), Wt = !1;
1551
- function Gt(e) {
1552
- Y.debug(`paused listener fired (delay ${e.delayMs}ms reached)`);
1553
- try {
1554
- e.cb();
1555
- } catch (e) {
1556
- Y.error("onTabPaused listener threw:", e);
1557
- }
1558
- }
1559
- function Kt(e) {
1560
- Y.debug(`paused listener scheduled in ${e.delayMs}ms`), e.timer = setTimeout(() => {
1561
- if (e.timer = null, zt.value) {
1562
- Y.debug("paused listener skipped — tab visible before delay");
1563
- return;
1564
- }
1565
- Gt(e);
1566
- }, e.delayMs);
1567
- }
1568
- function qt() {
1569
- for (let e of Ht) e.timer !== null && (clearTimeout(e.timer), e.timer = null);
1570
- }
1571
- function Jt() {
1572
- Wt || typeof document > "u" || (Wt = !0, document.addEventListener("visibilitychange", () => {
1573
- let e = document.visibilityState === "visible";
1574
- if (!e && zt.value) {
1575
- zt.value = !1, Bt = Date.now(), Y.debug(`tab → hidden (hidden=${Vt.size} paused=${Ht.size})`);
1576
- for (let e of Vt) try {
1577
- e.cb();
1578
- } catch (e) {
1579
- Y.error("onTabHidden listener threw:", e);
1580
- }
1581
- for (let e of Ht) Kt(e);
1582
- } else if (e && !zt.value) {
1583
- qt();
1584
- let e = Bt == null ? 0 : Date.now() - Bt;
1585
- Bt = null, zt.value = !0, Y.debug(`tab → visible (hiddenMs=${e}, visible-listeners=${Ut.size})`);
1586
- for (let { cb: t } of Ut) try {
1587
- t({ hiddenMs: e });
1588
- } catch (e) {
1589
- Y.error("onTabVisible listener threw:", e);
1590
- }
1591
- }
1592
- }));
1593
- }
1594
- function Yt() {
1595
- Jt();
1596
- let e = o(() => zt.value);
1597
- function t(e) {
1598
- let t = { cb: e };
1599
- Vt.add(t);
1600
- let n = () => {
1601
- Vt.delete(t);
1602
- };
1603
- return d(n), n;
1604
- }
1605
- function n(e, t = {}) {
1606
- let n = {
1607
- cb: e,
1608
- delayMs: t.delayMs ?? Rt,
1609
- timer: null
1610
- };
1611
- Ht.add(n);
1612
- let r = () => {
1613
- n.timer !== null && (clearTimeout(n.timer), n.timer = null), Ht.delete(n);
1614
- };
1615
- return d(r), r;
1616
- }
1617
- function r(e) {
1618
- let t = { cb: e };
1619
- Ut.add(t);
1620
- let n = () => {
1621
- Ut.delete(t);
1622
- };
1623
- return d(n), n;
1624
- }
1625
- return {
1626
- isVisible: e,
1627
- onTabHidden: t,
1628
- onTabPaused: n,
1629
- onTabVisible: r
1630
- };
1631
- }
1632
- var X = {
1633
- WEBRTC: {
1634
- RECONNECT_DELAY: 1e3,
1635
- CONNECT_TIMEOUT: 1e4,
1636
- WS_CONNECT_TIMEOUT: 5e3,
1637
- ICE_SERVERS: [{ urls: "stun:stun.l.google.com:19302" }]
1638
- },
1639
- MSE: {
1640
- BUFFER_SIZE: 2097152,
1641
- BUFFER_WINDOW: 5
1642
- },
1643
- CODECS: {
1644
- DEFAULT: [
1645
- "avc1.640029",
1646
- "avc1.64002A",
1647
- "avc1.640033",
1648
- "hvc1.1.6.L153.B0",
1649
- "mp4a.40.2",
1650
- "mp4a.40.5",
1651
- "flac",
1652
- "opus"
1653
- ],
1654
- WEBRTC_VIDEO: [
1655
- "H264",
1656
- "VP8",
1657
- "VP9"
1658
- ],
1659
- WEBRTC_AUDIO: [
1660
- "opus",
1661
- "G722",
1662
- "PCMU",
1663
- "PCMA"
1664
- ]
1665
- }
1666
- }, Xt = "hvc1.1.6.L153.B0";
1667
- function Zt() {
1668
- return navigator.userAgent.match(/version\/(\d+)/i);
1669
- }
1670
- function Qt() {
1671
- let e = [...X.CODECS.DEFAULT], t = Zt();
1672
- if (t?.[1]) {
1673
- let n = parseInt(t[1], 10);
1674
- if (n < 13) {
1675
- let t = e.indexOf("mp4a.40.2");
1676
- t > -1 && e.splice(t);
1677
- } else if (n < 14) {
1678
- let t = e.indexOf("flac");
1679
- t > -1 && e.splice(t);
1680
- } else {
1681
- let t = e.indexOf("opus");
1682
- t > -1 && e.splice(t);
1683
- }
1684
- }
1685
- return e;
1686
- }
1687
- function $t(e, t) {
1688
- return e.filter((e) => t(`video/mp4; codecs="${e}"`)).join(",");
1689
- }
1690
- function en(e) {
1691
- return X.CODECS.WEBRTC_AUDIO.includes(e);
1692
- }
1693
- function tn(e) {
1694
- return X.CODECS.WEBRTC_VIDEO.includes(e) ? !0 : e === "H265" && sn();
1695
- }
1696
- var nn, rn;
1697
- function an(e) {
1698
- if (e === "auto") return an("webrtc") || an("mse");
1699
- if (e === "mse") return nn === void 0 && (nn = !!un()?.isTypeSupported(`video/mp4; codecs="${Xt}"`)), nn;
1700
- if (rn === void 0) try {
1701
- rn = !!(RTCRtpReceiver?.getCapabilities("video")?.codecs)?.some((e) => e.mimeType.toLowerCase().includes("h265") || e.mimeType.toLowerCase().includes("hevc"));
1702
- } catch {
1703
- rn = !1;
1704
- }
1705
- return rn;
1706
- }
1707
- function on(e) {
1708
- e === "mse" ? nn = !1 : rn = !1;
1709
- }
1710
- function sn() {
1711
- return an("webrtc");
1712
- }
1713
- function cn(e) {
1714
- let t = e.audio.filter((e) => e.direction === "sendonly"), n = e.video.filter((e) => e.direction === "sendonly"), r = t.length === 0 || t.some((e) => en(e.codec)), i = n.length === 0 || n.some((e) => tn(e.codec)), a = [];
1715
- return r || a.push(...t.map((e) => e.codec)), i || a.push(...n.map((e) => e.codec)), {
1716
- compatible: r && i,
1717
- audioCompatible: r,
1718
- videoCompatible: i,
1719
- incompatibleCodecs: a
1720
- };
1721
- }
1722
- function ln() {
1723
- return "ManagedMediaSource" in window;
1724
- }
1725
- function un() {
1726
- if (ln()) return window.ManagedMediaSource;
1727
- if ("MediaSource" in window) return window.MediaSource;
1728
- }
1729
- function dn(e, t) {
1730
- return new Promise((n, r) => {
1731
- if (t.aborted) {
1732
- r(new DOMException("Aborted", "AbortError"));
1733
- return;
1734
- }
1735
- let i = setTimeout(n, e);
1736
- t.addEventListener("abort", () => {
1737
- clearTimeout(i), r(new DOMException("Aborted", "AbortError"));
1738
- }, { once: !0 });
1739
- });
1740
- }
1741
- function fn(e) {
1742
- let { videoElement: t, onReady: n, onFirstData: r, onError: i, signal: a } = e, o = null, s = null, c = null, l = !1, u = !1, d = new Uint8Array(X.MSE.BUFFER_SIZE), f = 0, p = [], m = Qt();
1743
- function h() {
1744
- if (a.aborted) return;
1745
- let e = un();
1746
- if (!e) {
1747
- i(/* @__PURE__ */ Error("MediaSource not supported"));
1748
- return;
1749
- }
1750
- o = new e();
1751
- let n = ln(), r = t.src;
1752
- return o.addEventListener("sourceopen", () => {
1753
- a.aborted || !n && r && r.startsWith("blob:") && r !== t.src && URL.revokeObjectURL(r);
1754
- }, { once: !0 }), n ? (t.disableRemotePlayback = !0, t.srcObject = o) : (c = URL.createObjectURL(o), t.src = c, t.srcObject = null), $t(m, e.isTypeSupported.bind(e));
1755
- }
1756
- function g(e) {
1757
- if (a.aborted || !o) return;
1758
- if (o.readyState !== "open") {
1759
- o.addEventListener("sourceopen", () => {
1760
- a.aborted || g(e);
1761
- }, { once: !0 });
1762
- return;
1763
- }
1764
- f = 0, d = new Uint8Array(X.MSE.BUFFER_SIZE);
1765
- let t = un();
1766
- if (t && !t.isTypeSupported(e)) {
1767
- i(/* @__PURE__ */ Error(`MIME type not supported: ${e}`));
1768
- return;
1769
- }
1770
- try {
1771
- if (s = o.addSourceBuffer(e), s.mode = "segments", s.addEventListener("updateend", _), l = !0, p.length > 0) {
1772
- for (let e of p) v(e);
1773
- p.length = 0;
1774
- }
1775
- n();
1776
- } catch (e) {
1777
- i(e instanceof Error ? e : Error(String(e)));
1778
- }
1779
- }
1780
- function _() {
1781
- if (!a.aborted && s && o) {
1782
- if (!s.updating && f > 0) try {
1783
- let e = d.slice(0, f);
1784
- s.appendBuffer(e), f = 0;
1785
- } catch (e) {
1786
- y(e) || i(e instanceof Error ? e : Error(String(e)));
1787
- }
1788
- if (!s.updating && s.buffered?.length) {
1789
- let e = s.buffered.end(s.buffered.length - 1), n = e - X.MSE.BUFFER_WINDOW, i = s.buffered.start(0);
1790
- if (u || (u = !0, r()), n > i) try {
1791
- s.remove(i, n), o.setLiveSeekableRange(n, e);
1792
- } catch {}
1793
- t.currentTime < n && (t.currentTime = n);
1794
- let a = e - t.currentTime;
1795
- a > 1 ? t.playbackRate = 1.1 : a < .1 ? t.playbackRate = .9 : t.playbackRate = 1;
1796
- }
1797
- }
1798
- }
1799
- function v(e) {
1800
- if (!a.aborted) {
1801
- if (!s) {
1802
- p.push(e);
1803
- return;
1804
- }
1805
- if (o?.readyState === "closed") {
1806
- i(/* @__PURE__ */ Error("MediaSource closed"));
1807
- return;
1808
- }
1809
- if (s.updating || f > 0) {
1810
- let t = new Uint8Array(e);
1811
- if (f + t.byteLength > d.byteLength) {
1812
- f = 0, i(/* @__PURE__ */ Error("MSE pending buffer overflow"));
1813
- return;
1814
- }
1815
- d.set(t, f), f += t.byteLength;
1816
- } else try {
1817
- s.appendBuffer(e);
1818
- } catch (t) {
1819
- if (y(t)) {
1820
- let t = new Uint8Array(e);
1821
- t.byteLength <= d.byteLength && (d.set(t, 0), f = t.byteLength);
1822
- }
1823
- }
1824
- }
1825
- }
1826
- function y(e) {
1827
- if (e?.name !== "QuotaExceededError" || !s || s.updating || !s.buffered?.length) return !1;
1828
- try {
1829
- let e = s.buffered.start(0), t = s.buffered.end(s.buffered.length - 1), n = Math.max(e + 1, t - X.MSE.BUFFER_WINDOW);
1830
- return n <= e ? !1 : (s.remove(e, n), !0);
1831
- } catch {
1832
- return !1;
1833
- }
1834
- }
1835
- function b() {
1836
- if (s) {
1837
- if (s.removeEventListener("updateend", _), o?.readyState === "open") try {
1838
- o.removeSourceBuffer(s);
1839
- } catch {}
1840
- s = null;
1841
- }
1842
- if (o?.readyState === "open") try {
1843
- o.endOfStream();
1844
- } catch {}
1845
- o = null, c &&= (URL.revokeObjectURL(c), null), l = !1, u = !1, f = 0, p.length = 0;
1846
- }
1847
- return a.addEventListener("abort", b, { once: !0 }), {
1848
- get mediaSource() {
1849
- return o;
1850
- },
1851
- get sourceBuffer() {
1852
- return s;
1853
- },
1854
- get isReady() {
1855
- return l;
1856
- },
1857
- setup: h,
1858
- initializeBuffer: g,
1859
- appendBuffer: v,
1860
- close: b
1861
- };
1862
- }
1863
- async function Z(e) {
1864
- try {
1865
- await e.play();
1866
- } catch {
1867
- e.muted || (e.muted = !0, await Z(e));
1868
- }
1869
- }
1870
- function pn(e, t, n) {
1871
- let r = new RTCPeerConnection({
1872
- bundlePolicy: "max-bundle",
1873
- iceServers: [...X.WEBRTC.ICE_SERVERS]
1874
- });
1875
- return r.onicecandidate = (r) => {
1876
- if (e.aborted || n && r.candidate?.protocol === "udp") return;
1877
- let i = r.candidate?.toJSON().candidate ?? "";
1878
- i && t(i);
1879
- }, r;
1880
- }
1881
- async function mn(e, t, n) {
1882
- !t.aborted && e && await e.setRemoteDescription({
1883
- type: "answer",
1884
- sdp: n
1885
- });
1886
- }
1887
- async function hn(e, t, n, r) {
1888
- !t.aborted && e && (r && n.includes(" udp ") || await e.addIceCandidate({
1889
- candidate: n,
1890
- sdpMid: "0"
1891
- }));
1892
- }
1893
- async function gn(e, t, n) {
1894
- if (!t.aborted && e) try {
1895
- await e.sender.replaceTrack(n);
1896
- } catch {}
1897
- }
1898
- function _n(e) {
1899
- e.micTransceiver &&= (e.micTransceiver.sender.replaceTrack(null).catch(() => {}), null), e.pc &&= (e.pc.getTransceivers().forEach((e) => e.sender?.track?.stop()), e.pc.close(), null), e.isConnected = !1;
1900
- }
1901
- function vn(e) {
1902
- let { mode: t, onConnected: n, onDisconnected: r, onFailed: i, onCandidate: a, signal: o } = e, s = {
1903
- pc: null,
1904
- micTransceiver: null,
1905
- isConnected: !1
1906
- }, c = t === "webrtc/tcp";
1907
- function l() {
1908
- let e = pn(o, a, c);
1909
- return e.onconnectionstatechange = () => {
1910
- if (o.aborted) return;
1911
- let t = e.connectionState;
1912
- if (t === "connected") {
1913
- s.isConnected = !0;
1914
- let t = new MediaStream(e.getTransceivers().filter((e) => e.currentDirection === "recvonly").map((e) => e.receiver.track));
1915
- n(t);
1916
- } else t === "failed" ? (s.isConnected = !1, i()) : t === "disconnected" && (s.isConnected = !1, r());
1917
- }, e.addTransceiver("video", { direction: "recvonly" }), e.addTransceiver("audio", { direction: "recvonly" }), s.micTransceiver = e.addTransceiver("audio", { direction: "sendonly" }), e;
1918
- }
1919
- async function u() {
1920
- if (o.aborted) return;
1921
- s.pc = l();
1922
- let e = await s.pc.createOffer();
1923
- return await s.pc.setLocalDescription(e), e.sdp;
1924
- }
1925
- function d() {
1926
- _n(s);
1927
- }
1928
- return o.addEventListener("abort", d, { once: !0 }), {
1929
- get pc() {
1930
- return s.pc;
1931
- },
1932
- get micTransceiver() {
1933
- return s.micTransceiver;
1934
- },
1935
- get isConnected() {
1936
- return s.isConnected;
1937
- },
1938
- createOffer: u,
1939
- handleAnswer: (e) => mn(s.pc, o, e),
1940
- handleCandidate: (e) => hn(s.pc, o, e, c),
1941
- setMicrophoneTrack: (e) => gn(s.micTransceiver, o, e),
1942
- close: d
1943
- };
1944
- }
1945
- function yn(e) {
1946
- let { onConnected: t, onDisconnected: n, onCandidate: r, signal: i } = e, a = {
1947
- pc: null,
1948
- micTransceiver: null,
1949
- isConnected: !1
1950
- };
1951
- function o() {
1952
- let e = pn(i, r, !1);
1953
- return e.onconnectionstatechange = () => {
1954
- if (i.aborted) return;
1955
- let r = e.connectionState;
1956
- r === "connected" ? (a.isConnected = !0, t()) : (r === "disconnected" || r === "failed") && (a.isConnected = !1, n());
1957
- }, a.micTransceiver = e.addTransceiver("audio", { direction: "sendonly" }), e;
1958
- }
1959
- async function s() {
1960
- if (i.aborted) return;
1961
- a.pc = o();
1962
- let e = await a.pc.createOffer();
1963
- return await a.pc.setLocalDescription(e), e.sdp;
1964
- }
1965
- function c() {
1966
- _n(a);
1967
- }
1968
- return i.addEventListener("abort", c, { once: !0 }), {
1969
- get isConnected() {
1970
- return a.isConnected;
1971
- },
1972
- createOffer: s,
1973
- handleAnswer: (e) => mn(a.pc, i, e),
1974
- handleCandidate: (e) => hn(a.pc, i, e, !1),
1975
- setMicrophoneTrack: (e) => gn(a.micTransceiver, i, e),
1976
- close: c
1977
- };
1978
- }
1979
- async function bn(e, t) {
1980
- switch (t.type) {
1981
- case "webrtc/answer":
1982
- await e.handleAnswer(t.value);
1983
- break;
1984
- case "webrtc/candidate": t.value && await e.handleCandidate(t.value);
1985
- }
1986
- }
1987
- var Q = new m("StreamConnection"), xn = /mp4a|opus|flac|mp3/i;
1988
- function Sn(e) {
1989
- return e ? typeof document < "u" && "pictureInPictureElement" in document && document.pictureInPictureElement === e || e.webkitPresentationMode === "picture-in-picture" : !1;
1990
- }
1991
- var Cn = class {
1992
- status;
1993
- activeMode;
1994
- requestedMode;
1995
- activeResolution;
1996
- requestedResolution;
1997
- degradedFrom;
1998
- degradeReason;
1999
- source;
2000
- hasVideo;
2001
- hasAudio;
2002
- hasBackchannel;
2003
- isPlaying;
2004
- error;
2005
- probeInfo;
2006
- muted;
2007
- paused;
2008
- nativeWidth;
2009
- nativeHeight;
2010
- camera;
2011
- videoElement;
2012
- containerElement;
2013
- target;
2014
- isReady;
2015
- triedSourceIds = /* @__PURE__ */ new Set();
2016
- options;
2017
- wsTransport;
2018
- scope = a(!0);
2019
- connectionGeneration = 0;
2020
- abortController = new AbortController();
2021
- probedSourceId;
2022
- wasPausedByVisibility = !1;
2023
- disarmPipWatch = null;
2024
- wsHandle;
2025
- webrtcHandler;
2026
- mseHandler;
2027
- firstFrameCallbackId;
2028
- backchannelHandler;
2029
- pendingMicTrack = null;
2030
- lastMediaStream = null;
2031
- stopWatchers = [];
2032
- mseMonitorInterval;
2033
- offTabVisible;
2034
- offTabPaused;
2035
- onVideoPauseBound;
2036
- onVideoPlayBound;
2037
- onVideoResizeBound;
2038
- startWsConnectTimeout;
2039
- stopWsConnectTimeout;
2040
- startConnectTimeout;
2041
- stopConnectTimeout;
2042
- startMseConnectTimeout;
2043
- stopMseConnectTimeout;
2044
- startReconnectTimeout;
2045
- stopReconnectTimeout;
2046
- constructor(e) {
2047
- this.options = e;
2048
- let t = _();
2049
- if (!t.wsTransport) throw Error("[camera.ui] StreamConnection requires a wsTransport on CameraUiContext — pass `wsTransport` to createCameraUiPlugin.");
2050
- this.target = t.target, this.wsTransport = t.wsTransport;
2051
- let { autoStart: r = !0 } = e;
2052
- this.status = l("idle"), this.activeMode = l("webrtc"), this.activeResolution = l("low-resolution"), this.degradedFrom = l(null), this.degradeReason = l(null), this.source = c(), this.hasVideo = l(!1), this.hasAudio = l(!1), this.hasBackchannel = l(!1), this.isPlaying = l(!1), this.error = l(), this.probeInfo = c(), this.muted = l(!0), this.paused = l(!1), this.nativeWidth = l(0), this.nativeHeight = l(0), this.requestedMode = l(n(e.mode) ?? "auto"), this.requestedResolution = l(n(e.resolution) ?? "high-resolution"), this.camera = o(() => n(e.camera)), this.videoElement = o(() => n(e.videoElement)), this.containerElement = o(() => n(e.containerElement)), this.isReady = o(() => !!this.camera.value && !!this.videoElement.value && !!this.target.value), this.scope.run(() => {
2053
- let { onTabPaused: e, onTabVisible: t } = Yt(), n = f(() => {
2054
- this.wsHandle?.readyState === WebSocket.CONNECTING && (this.disconnectWebSocket(), !this.abortController.signal.aborted && this.status.value !== "closed" && this.restart());
2055
- }, X.WEBRTC.WS_CONNECT_TIMEOUT, { immediate: !1 }), i = f(() => {
2056
- this.webrtcHandler && !this.webrtcHandler.isConnected ? this.requestedMode.value === "auto" ? (this.webrtcHandler.close(), this.webrtcHandler = void 0, this.activeMode.value = "mse", this.mseHandler?.isReady ? this.status.value = "connected" : this.startMSE()) : (this.markSourceUndecodable(), this.restart()) : this.status.value === "connected" && !this.isPlaying.value && !this.abortController.signal.aborted && this.handleNoFramesWhileConnected();
2057
- }, X.WEBRTC.CONNECT_TIMEOUT, { immediate: !1 }), a = f(() => {
2058
- this.abortController.signal.aborted || this.status.value === "connected" || this.status.value === "closed" || this.mseHandler && !this.mseHandler.isReady && (this.markSourceUndecodable(), this.restart());
2059
- }, X.WEBRTC.CONNECT_TIMEOUT, { immediate: !1 }), o = f(() => {
2060
- this.abortController.signal.aborted || this.restart();
2061
- }, X.WEBRTC.RECONNECT_DELAY, { immediate: !1 });
2062
- this.startWsConnectTimeout = n.start, this.stopWsConnectTimeout = n.stop, this.startConnectTimeout = i.start, this.stopConnectTimeout = i.stop, this.startMseConnectTimeout = a.start, this.stopMseConnectTimeout = a.stop, this.startReconnectTimeout = o.start, this.stopReconnectTimeout = o.stop, this.setupWatchers(), this.offTabPaused = e(() => {
2063
- if (Q.debug(`onTabPaused fired — status=${this.status.value}, isReady=${this.isReady.value}, target=${!!this.target.value}`), this.status.value === "idle" || this.status.value === "closed") {
2064
- Q.debug(`onTabPaused — already in ${this.status.value}, skipping stop()`);
2065
- return;
2066
- }
2067
- if (Sn(this.videoElement.value)) {
2068
- Q.debug("onTabPaused — video is in picture-in-picture, keeping the stream"), this.watchPipLeave();
2069
- return;
2070
- }
2071
- this.wasPausedByVisibility = !0, this.stop(), Q.debug("onTabPaused — stop() done, wasPausedByVisibility=true");
2072
- }), this.offTabVisible = t(() => {
2073
- if (Q.debug(`onTabVisible fired — wasPausedByVisibility=${this.wasPausedByVisibility}, status=${this.status.value}, isReady=${this.isReady.value}, target=${!!this.target.value}`), this.disarmPipWatch?.(), !this.wasPausedByVisibility) {
2074
- Q.debug("onTabVisible — not paused by visibility, no-op");
2075
- return;
2076
- }
2077
- this.wasPausedByVisibility = !1, this.startWhenReady();
2078
- }), r && p(this.isReady, () => {
2079
- (this.status.value === "idle" || this.status.value === "closed") && this.start();
2080
- }, { immediate: !0 });
2081
- });
2082
- }
2083
- watchPipLeave() {
2084
- if (this.disarmPipWatch) return;
2085
- let e = this.videoElement.value;
2086
- if (!e) return;
2087
- let t = () => {
2088
- Sn(e) || (this.disarmPipWatch?.(), !(typeof document < "u" && document.visibilityState === "visible") && this.status.value !== "idle" && this.status.value !== "closed" && (Q.debug("picture-in-picture closed while tab hidden — stopping the stream"), this.wasPausedByVisibility = !0, this.stop()));
2089
- };
2090
- e.addEventListener("leavepictureinpicture", t), e.addEventListener("webkitpresentationmodechanged", t), this.disarmPipWatch = () => {
2091
- e.removeEventListener("leavepictureinpicture", t), e.removeEventListener("webkitpresentationmodechanged", t), this.disarmPipWatch = null;
2092
- };
2093
- }
2094
- async start() {
2095
- if (Q.debug(`start() called — status=${this.status.value}, isReady=${this.isReady.value}`), this.status.value !== "idle" && this.status.value !== "closed") {
2096
- Q.debug(`start() — skipped, status is ${this.status.value}`);
2097
- return;
2098
- }
2099
- if (!this.isReady.value) {
2100
- Q.debug("start() — skipped, isReady=false");
2101
- return;
2102
- }
2103
- this.cleanup(), this.abortController = new AbortController();
2104
- let e = ++this.connectionGeneration;
2105
- this.triedSourceIds.clear(), this.status.value = "connecting", this.error.value = void 0, this.isPlaying.value = !1;
2106
- try {
2107
- let t = this.initializeSource();
2108
- if (t === "unsupported") {
2109
- Q.debug("start() — no source with a playable codec"), this.setUnsupported();
2110
- return;
2111
- }
2112
- if (!t) {
2113
- Q.debug("start() — no streaming source available"), this.error.value = /* @__PURE__ */ Error("No streaming source available"), this.status.value = "error";
2114
- return;
2115
- }
2116
- for (let t = 0; t < 3; t++) {
2117
- let t = this.source.value?._id, n = await this.probeStream();
2118
- if (e !== this.connectionGeneration) {
2119
- Q.debug("start() — generation stale after probe, aborting");
2120
- return;
2121
- }
2122
- n && t && this.probeSaysUnplayable(n) && this.triedSourceIds.add(t);
2123
- let r = this.initializeSource();
2124
- if (r === "unsupported") {
2125
- this.setUnsupported();
2126
- return;
2127
- }
2128
- if (!r) {
2129
- this.error.value = /* @__PURE__ */ Error("No streaming source available"), this.status.value = "error";
2130
- return;
2131
- }
2132
- if (!n || this.source.value?._id === t) break;
2133
- }
2134
- Q.debug("start() — connecting WebSocket"), this.connectWebSocket();
2135
- } catch (t) {
2136
- if (e !== this.connectionGeneration) return;
2137
- Q.debug("start() — error:", t), this.error.value = t instanceof Error ? t : Error(String(t)), this.status.value = "error";
2138
- }
2139
- }
2140
- stop() {
2141
- if (this.status.value === "closed") {
2142
- Q.debug("stop() — already closed, no-op");
2143
- return;
2144
- }
2145
- Q.debug(`stop() — was ${this.status.value}, transitioning to closed`), ++this.connectionGeneration, this.status.value = "closed", this.cleanup();
2146
- }
2147
- async setMode(e) {
2148
- if (this.requestedMode.value !== e) {
2149
- if (this.requestedMode.value = e, this.activeMode.value = e === "auto" ? "webrtc" : e, this.status.value === "unsupported") {
2150
- this.stop(), await this.start();
2151
- return;
2152
- }
2153
- this.status.value === "connected" && await this.restart();
2154
- }
2155
- }
2156
- async setResolution(e) {
2157
- if (this.requestedResolution.value === e) return;
2158
- if (this.requestedResolution.value = e, this.status.value === "unsupported") {
2159
- this.stop(), await this.start();
2160
- return;
2161
- }
2162
- let t = this.getSourceForResolution(e);
2163
- t && t !== "unsupported" && t.source._id !== this.source.value?._id && (this.source.value = t.source, this.activeResolution.value = t.effectiveResolution, this.degradedFrom.value = t.degradedFrom, this.degradeReason.value = t.degradedFrom ? "codec" : null, this.status.value === "connected" && await this.restart());
2164
- }
2165
- async setMicrophone(e) {
2166
- if (this.webrtcHandler) {
2167
- await this.webrtcHandler.setMicrophoneTrack(e);
2168
- return;
2169
- }
2170
- this.activeMode.value === "mse" && this.hasBackchannel.value && (this.pendingMicTrack = e, e && !this.backchannelHandler ? await this.startBackchannel() : !e && this.backchannelHandler ? this.closeBackchannel() : this.backchannelHandler?.isConnected && await this.backchannelHandler.setMicrophoneTrack(e));
2171
- }
2172
- setMuted(e) {
2173
- this.muted.value = e;
2174
- let t = this.videoElement.value;
2175
- t && (t.muted = e);
2176
- }
2177
- async play() {
2178
- this.paused.value = !1;
2179
- let e = this.videoElement.value;
2180
- if (e) try {
2181
- await e.play();
2182
- } catch {
2183
- if (!e.muted) {
2184
- e.muted = !0, this.muted.value = !0;
2185
- try {
2186
- await e.play();
2187
- } catch {}
2188
- }
2189
- }
2190
- }
2191
- pause() {
2192
- this.paused.value = !0;
2193
- let e = this.videoElement.value;
2194
- e && e.pause();
2195
- }
2196
- destroy() {
2197
- for (let e of this.stopWatchers) e();
2198
- this.stopWatchers = [], this.offTabVisible?.(), this.offTabVisible = void 0, this.offTabPaused?.(), this.offTabPaused = void 0, this.disarmPipWatch?.();
2199
- let e = this.videoElement.value;
2200
- e && (this.onVideoPauseBound && e.removeEventListener("pause", this.onVideoPauseBound), this.onVideoPlayBound && e.removeEventListener("play", this.onVideoPlayBound), this.onVideoResizeBound && e.removeEventListener("resize", this.onVideoResizeBound)), this.stop(), this.scope.stop();
2201
- }
2202
- async restart() {
2203
- this.status.value = "reconnecting", this.isPlaying.value = !1, this.cleanup(), this.abortController = new AbortController();
2204
- let e = ++this.connectionGeneration;
2205
- try {
2206
- await dn(1e3, this.abortController.signal);
2207
- } catch {
2208
- return;
2209
- }
2210
- if (e === this.connectionGeneration) {
2211
- if (!this.isReady.value) {
2212
- this.status.value = "idle";
2213
- return;
2214
- }
2215
- try {
2216
- let e = this.initializeSource();
2217
- if (e === "unsupported") {
2218
- this.setUnsupported();
2219
- return;
2220
- }
2221
- if (!e) {
2222
- this.error.value = /* @__PURE__ */ Error("No streaming source available"), this.status.value = "error";
2223
- return;
2224
- }
2225
- this.connectWebSocket();
2226
- } catch (t) {
2227
- if (e !== this.connectionGeneration) return;
2228
- this.error.value = t instanceof Error ? t : Error(String(t)), this.status.value = "error";
2229
- }
2230
- }
2231
- }
2232
- startWhenReady() {
2233
- if (this.isReady.value) {
2234
- Q.debug("startWhenReady — already ready, calling start() now"), this.start();
2235
- return;
2236
- }
2237
- Q.debug(`startWhenReady — not ready (camera=${!!this.camera.value}, video=${!!this.videoElement.value}, target=${!!this.target.value}), watching isReady`);
2238
- let e = s(this.isReady, (t) => {
2239
- t && (Q.debug("startWhenReady — isReady → true, calling start()"), e(), this.start());
2240
- });
2241
- this.stopWatchers.push(e);
2242
- }
2243
- setupWatchers() {
2244
- let e = s(() => this.target.value?.endpoint.url ?? null, (e, t) => {
2245
- e && t && e !== t && this.status.value !== "idle" && this.status.value !== "closed" && this.restart();
2246
- });
2247
- this.stopWatchers.push(e);
2248
- let t = s(() => this.camera.value?.sources.value, () => {
2249
- this.status.value === "unsupported" && (this.stop(), this.start());
2250
- });
2251
- this.stopWatchers.push(t);
2252
- let r = s(() => n(this.options.mode), (e) => {
2253
- e !== void 0 && e !== this.requestedMode.value && this.setMode(e);
2254
- });
2255
- this.stopWatchers.push(r);
2256
- let i = s(() => n(this.options.resolution), (e) => {
2257
- e !== void 0 && e !== this.requestedResolution.value && this.setResolution(e);
2258
- });
2259
- this.stopWatchers.push(i);
2260
- let a = s(this.videoElement, (e, t) => {
2261
- t && (this.onVideoPauseBound && t.removeEventListener("pause", this.onVideoPauseBound), this.onVideoPlayBound && t.removeEventListener("play", this.onVideoPlayBound), this.onVideoResizeBound && t.removeEventListener("resize", this.onVideoResizeBound)), e && (this.onVideoPauseBound = () => {
2262
- this.paused.value || e.play().catch(() => {});
2263
- }, this.onVideoPlayBound = () => {
2264
- this.paused.value = !1;
2265
- }, this.onVideoResizeBound = () => {
2266
- e.videoWidth > 0 && e.videoHeight > 0 && (this.nativeWidth.value = e.videoWidth, this.nativeHeight.value = e.videoHeight);
2267
- }, e.addEventListener("pause", this.onVideoPauseBound), e.addEventListener("play", this.onVideoPlayBound), e.addEventListener("resize", this.onVideoResizeBound), e.videoWidth > 0 && e.videoHeight > 0 && (this.nativeWidth.value = e.videoWidth, this.nativeHeight.value = e.videoHeight));
2268
- }, { immediate: !0 });
2269
- this.stopWatchers.push(a);
2270
- let o = s(this.activeMode, (e) => {
2271
- this.stopMseMonitor(), e === "mse" && (this.mseMonitorInterval = setInterval(() => this.monitorMseBuffer(), 1e3));
2272
- }, { immediate: !0 });
2273
- this.stopWatchers.push(o);
2274
- let c = s([
2275
- this.camera,
2276
- this.videoElement,
2277
- () => this.target.value
2278
- ], ([e, t, n], [r, i]) => {
2279
- if (e !== r) this.status.value === "connected" ? e && t && n && this.restart() : this.status.value === "unsupported" && e && t && n && (this.stop(), this.start());
2280
- else if (t !== i && t) {
2281
- if (t.srcObject instanceof MediaStream) {
2282
- let e = t.srcObject;
2283
- if (e.active && e.getTracks().some((e) => e.readyState === "live")) {
2284
- Z(t), this.lastMediaStream = e;
2285
- return;
2286
- }
2287
- }
2288
- if (this.status.value === "connected" && this.activeMode.value !== "mse") {
2289
- let e = this.lastMediaStream;
2290
- e?.active && e.getTracks().some((e) => e.readyState === "live") ? (t.srcObject = e, Z(t)) : this.restart();
2291
- } else if (this.status.value === "connected" && this.activeMode.value === "mse") this.restart();
2292
- else if (this.status.value === "connecting" || this.status.value === "reconnecting") {
2293
- let e = s(() => this.isPlaying.value, (t) => {
2294
- let n = this.videoElement.value;
2295
- t && n?.srcObject instanceof MediaStream ? (Z(n), e()) : t && n && !n.srcObject && this.lastMediaStream?.active && (n.srcObject = this.lastMediaStream, Z(n), e());
2296
- }, { immediate: !0 });
2297
- this.stopWatchers.push(e);
2298
- }
2299
- }
2300
- });
2301
- this.stopWatchers.push(c);
2302
- }
2303
- isSourcePlayable(e) {
2304
- if (this.triedSourceIds.has(e._id)) return !1;
2305
- if (e.videoCodec !== "H265") return !0;
2306
- let t = this.requestedMode.value;
2307
- return an(t === "auto" ? "auto" : t === "mse" ? "mse" : "webrtc");
2308
- }
2309
- getSourceForResolution(e) {
2310
- let t = this.camera.value;
2311
- if (!t) return;
2312
- let n = [
2313
- "high-resolution",
2314
- "mid-resolution",
2315
- "low-resolution"
2316
- ], r = Math.max(0, n.indexOf(e)), i = !1;
2317
- for (let a = r; a < n.length; a++) {
2318
- let r = t.sources.value.find((e) => e.role === n[a]);
2319
- if (r) {
2320
- if (!this.isSourcePlayable(r)) {
2321
- i = !0;
2322
- continue;
2323
- }
2324
- return {
2325
- source: r,
2326
- effectiveResolution: n[a],
2327
- degradedFrom: i ? e : null
2328
- };
2329
- }
2330
- }
2331
- let a = t.streamSource.value;
2332
- if (a && this.isSourcePlayable(a)) return {
2333
- source: a,
2334
- effectiveResolution: a.role ?? "low-resolution",
2335
- degradedFrom: i ? e : null
2336
- };
2337
- if (i || a) return "unsupported";
2338
- }
2339
- initializeSource() {
2340
- let e = this.getSourceForResolution(this.requestedResolution.value);
2341
- return e ? e === "unsupported" ? "unsupported" : (this.source.value = e.source, this.activeResolution.value = e.effectiveResolution, this.degradedFrom.value = e.degradedFrom, this.degradeReason.value = e.degradedFrom ? "codec" : null, this.probedSourceId && this.probedSourceId !== e.source._id && (this.probeInfo.value = void 0, this.probedSourceId = void 0, this.hasVideo.value = !1, this.hasAudio.value = !1, this.hasBackchannel.value = !1), !0) : !1;
2342
- }
2343
- setUnsupported() {
2344
- let e = this.camera.value?.sources.value.find((e) => e.videoCodec)?.videoCodec ?? "H265";
2345
- this.error.value = /* @__PURE__ */ Error(`${e} cannot be played on this device`), this.status.value = "unsupported";
2346
- }
2347
- probeSaysUnplayable(e) {
2348
- let t = e.video.filter((e) => e.direction === "sendonly");
2349
- if (!t.length || !t.every((e) => e.codec === "H265")) return !1;
2350
- let n = this.requestedMode.value;
2351
- return !an(n === "auto" ? "auto" : n === "mse" ? "mse" : "webrtc");
2352
- }
2353
- sourceLikelyH265() {
2354
- let e = this.source.value;
2355
- if (!e) return !1;
2356
- if (e.videoCodec === "H265") return !0;
2357
- if (e.videoCodec !== void 0) return !1;
2358
- let t = this.probeInfo.value?.video.filter((e) => e.direction === "sendonly") ?? [];
2359
- return t.length > 0 && t.every((e) => e.codec === "H265");
2360
- }
2361
- markSourceUndecodable() {
2362
- let e = this.source.value;
2363
- e && this.sourceLikelyH265() && this.triedSourceIds.add(e._id);
2364
- }
2365
- handleNoFramesWhileConnected() {
2366
- if (this.sourceLikelyH265() && on(this.activeMode.value === "mse" ? "mse" : "webrtc"), this.requestedMode.value === "auto" && this.activeMode.value !== "mse") {
2367
- this.webrtcHandler?.close(), this.webrtcHandler = void 0, this.activeMode.value = "mse", this.status.value = "reconnecting", this.startMSE();
2368
- return;
2369
- }
2370
- this.markSourceUndecodable(), this.restart();
2371
- }
2372
- noteDeliveredAudio(e) {
2373
- e && !this.hasAudio.value && (this.hasAudio.value = !0);
2374
- }
2375
- async probeStream() {
2376
- let e = this.camera.value, t = this.source.value;
2377
- if (e && t && !this.abortController.signal.aborted) try {
2378
- let n = await e.probeStream(t._id, {
2379
- video: !0,
2380
- audio: ["pcma", "opus"],
2381
- microphone: !0
2382
- });
2383
- return n && !this.abortController.signal.aborted && (this.probeInfo.value = n, this.probedSourceId = t._id, this.hasBackchannel.value = n.audio.some((e) => e.direction === "recvonly"), this.hasAudio.value = n.audio.filter((e) => e.direction === "sendonly").length > 0, this.hasVideo.value = n.video.filter((e) => e.direction === "sendonly").length > 0), n;
2384
- } catch {
2385
- return;
2386
- }
2387
- }
2388
- connectWebSocket() {
2389
- this.disconnectWebSocket();
2390
- let e = this.camera.value;
2391
- if (this.abortController.signal.aborted || !e || !this.source.value || !this.target.value) return;
2392
- let t = this.source.value.name ?? this.source.value.role ?? this.source.value._id, n = y(e.name.value, t);
2393
- this.startWsConnectTimeout(), this.wsHandle = this.wsTransport.open({
2394
- path: "/api/go2rtc",
2395
- query: { src: n },
2396
- binaryType: "arraybuffer"
2397
- }), this.wsHandle.on("open", () => this.handleWsOpen()), this.wsHandle.on("close", () => this.handleWsClose()), this.wsHandle.on("message", (e) => this.handleWsMessage(e)), this.wsHandle.on("error", () => {});
2398
- }
2399
- disconnectWebSocket() {
2400
- this.stopWsConnectTimeout(), this.wsHandle &&= (this.wsHandle.dispose(), void 0);
2401
- }
2402
- sendWsMessage(e) {
2403
- this.wsHandle?.readyState === WebSocket.OPEN && this.wsHandle.send(JSON.stringify(e));
2404
- }
2405
- handleWsOpen() {
2406
- if (this.abortController.signal.aborted) return;
2407
- this.stopWsConnectTimeout(), this.status.value = "connecting";
2408
- let e = this.requestedMode.value;
2409
- e === "auto" ? this.startAutoMode() : e === "webrtc" || e === "webrtc/tcp" ? this.startWebRTC(e) : e === "mse" && this.startMSE();
2410
- }
2411
- handleWsClose() {
2412
- this.status.value !== "closed" && !this.abortController.signal.aborted && this.startReconnectTimeout();
2413
- }
2414
- handleWsMessage(e) {
2415
- if (!this.abortController.signal.aborted) {
2416
- if (typeof e.data == "string") {
2417
- let t;
2418
- try {
2419
- t = JSON.parse(e.data);
2420
- } catch {
2421
- return;
2422
- }
2423
- this.handleMessage(t);
2424
- } else this.mseHandler && (this.mseHandler.appendBuffer(e.data), this.handleFirstFrame());
2425
- }
2426
- }
2427
- handleMessage(e) {
2428
- switch (e.type) {
2429
- case "webrtc/answer":
2430
- case "webrtc/candidate":
2431
- this.webrtcHandler ? bn(this.webrtcHandler, e) : this.backchannelHandler && bn(this.backchannelHandler, e);
2432
- break;
2433
- case "mse":
2434
- this.mseHandler && typeof e.value == "string" && (this.noteDeliveredAudio(xn.test(e.value)), this.mseHandler.initializeBuffer(e.value));
2435
- break;
2436
- case "error": this.requestedMode.value !== "auto" && (this.error.value = Error(e.value), this.status.value = "error");
2437
- }
2438
- }
2439
- async startWebRTC(e) {
2440
- if (this.abortController.signal.aborted) return;
2441
- this.startConnectTimeout(), this.webrtcHandler = vn({
2442
- mode: e,
2443
- signal: this.abortController.signal,
2444
- onConnected: (e) => this.handleWebRTCConnected(e),
2445
- onDisconnected: () => this.handleWebRTCDisconnected(),
2446
- onFailed: () => this.handleWebRTCFailed(),
2447
- onCandidate: (e) => this.sendWsMessage({
2448
- type: "webrtc/candidate",
2449
- value: e
2450
- })
2451
- });
2452
- let t = await this.webrtcHandler.createOffer();
2453
- t && !this.abortController.signal.aborted && this.sendWsMessage({
2454
- type: "webrtc/offer",
2455
- value: t
2456
- });
2457
- }
2458
- handleWebRTCConnected(e) {
2459
- if (this.abortController.signal.aborted) return;
2460
- let t = this.videoElement.value;
2461
- if (t) {
2462
- if (this.hasVideo.value && e.getVideoTracks().length === 0) {
2463
- this.handleWebRTCFailed();
2464
- return;
2465
- }
2466
- this.noteDeliveredAudio(e.getAudioTracks().length > 0), this.activeMode.value = this.requestedMode.value === "auto" ? "webrtc" : this.requestedMode.value, this.lastMediaStream = e, t.srcObject = e, t.muted = this.muted.value, Z(t), this.status.value = "connected", this.handleFirstFrameWebRTC(e), this.requestedMode.value === "auto" && this.mseHandler && (this.mseHandler.close(), this.mseHandler = void 0, this.stopMseConnectTimeout(), this.sendWsMessage({ type: "mse/stop" }));
2467
- }
2468
- }
2469
- handleWebRTCDisconnected() {
2470
- this.status.value !== "closed" && !this.abortController.signal.aborted && (this.status.value = "reconnecting", this.requestedMode.value === "auto" && this.mseHandler?.isReady ? (this.webrtcHandler?.close(), this.webrtcHandler = void 0, this.activeMode.value = "mse", this.status.value = "connected") : this.restart());
2471
- }
2472
- handleWebRTCFailed() {
2473
- this.abortController.signal.aborted || (this.stopConnectTimeout(), this.requestedMode.value === "auto" ? (this.webrtcHandler?.close(), this.webrtcHandler = void 0, this.activeMode.value = "mse", this.mseHandler?.isReady ? this.status.value = "connected" : this.startMSE()) : (this.error.value = /* @__PURE__ */ Error("WebRTC connection failed"), this.status.value = "error"));
2474
- }
2475
- startMSE() {
2476
- if (this.mseHandler) return;
2477
- let e = this.videoElement.value;
2478
- if (this.abortController.signal.aborted || !e) return;
2479
- this.mseHandler = fn({
2480
- videoElement: e,
2481
- signal: this.abortController.signal,
2482
- onReady: () => this.handleMSEReady(),
2483
- onFirstData: () => this.handleMSEFirstData(),
2484
- onError: (e) => {
2485
- this.requestedMode.value === "auto" ? this.activeMode.value === "mse" && this.status.value === "connected" && (Q.debug("MSE error while active in auto mode — restarting:", e), this.restart()) : (this.error.value = e, this.status.value = "error");
2486
- }
2487
- });
2488
- let t = this.mseHandler.setup();
2489
- t && (this.sendWsMessage({
2490
- type: "mse",
2491
- value: t
2492
- }), this.startMseConnectTimeout());
2493
- }
2494
- handleMSEReady() {
2495
- this.abortController.signal.aborted || (this.stopMseConnectTimeout(), this.requestedMode.value === "auto" && this.webrtcHandler?.isConnected || (this.activeMode.value = "mse", this.status.value = "connected"));
2496
- }
2497
- handleMSEFirstData() {
2498
- if (this.abortController.signal.aborted) return;
2499
- let e = this.videoElement.value;
2500
- e && Z(e);
2501
- }
2502
- async startAutoMode() {
2503
- if (this.abortController.signal.aborted) return;
2504
- let e = this.probeInfo.value ?? await this.probeStream();
2505
- if (e && !cn(e).compatible) {
2506
- this.activeMode.value = "mse", this.startMSE();
2507
- return;
2508
- }
2509
- this.startMSE(), this.startWebRTC("webrtc");
2510
- }
2511
- handleFirstFrame() {
2512
- !this.isPlaying.value && !this.abortController.signal.aborted && (this.stopConnectTimeout(), this.isPlaying.value = !0);
2513
- }
2514
- monitorMseBuffer() {
2515
- let e = this.videoElement.value;
2516
- if (e && this.activeMode.value === "mse" && this.isPlaying.value && e.buffered.length > 0) {
2517
- let t = e.buffered.end(e.buffered.length - 1);
2518
- t - e.currentTime > 1 && (e.currentTime = t);
2519
- }
2520
- }
2521
- stopMseMonitor() {
2522
- this.mseMonitorInterval !== void 0 && (clearInterval(this.mseMonitorInterval), this.mseMonitorInterval = void 0);
2523
- }
2524
- handleFirstFrameWebRTC(e) {
2525
- let t = this.videoElement.value;
2526
- if (this.isPlaying.value || this.abortController.signal.aborted || !t) return;
2527
- if (!e.getVideoTracks()[0]) {
2528
- this.handleFirstFrame();
2529
- return;
2530
- }
2531
- let n = t;
2532
- if (typeof n.requestVideoFrameCallback == "function") this.firstFrameCallbackId = n.requestVideoFrameCallback(() => {
2533
- this.abortController.signal.aborted || this.handleFirstFrame();
2534
- });
2535
- else {
2536
- let e = () => {
2537
- this.abortController.signal.aborted || (t.readyState >= 2 && t.videoWidth > 0 ? this.handleFirstFrame() : this.firstFrameCallbackId = requestAnimationFrame(e));
2538
- };
2539
- this.firstFrameCallbackId = requestAnimationFrame(e);
2540
- }
2541
- }
2542
- cleanup() {
2543
- this.abortController.abort(), this.stopConnectTimeout(), this.stopWsConnectTimeout(), this.stopMseConnectTimeout(), this.stopReconnectTimeout(), this.stopMseMonitor(), this.lastMediaStream = null, this.webrtcHandler?.close(), this.webrtcHandler = void 0, this.mseHandler?.close(), this.mseHandler = void 0, this.closeBackchannel(), this.disconnectWebSocket();
2544
- let e = this.videoElement.value;
2545
- this.firstFrameCallbackId !== void 0 && (e && "cancelVideoFrameCallback" in e ? e.cancelVideoFrameCallback(this.firstFrameCallbackId) : cancelAnimationFrame(this.firstFrameCallbackId), this.firstFrameCallbackId = void 0), e && (e.style.display = "", e.pause(), e.srcObject = null, e.removeAttribute("src"), e.load());
2546
- }
2547
- async startBackchannel() {
2548
- if (this.abortController.signal.aborted || !this.wsHandle || this.wsHandle.readyState !== WebSocket.OPEN) return;
2549
- this.backchannelHandler = yn({
2550
- signal: this.abortController.signal,
2551
- onCandidate: (e) => this.sendWsMessage({
2552
- type: "webrtc/candidate",
2553
- value: e
2554
- }),
2555
- onConnected: async () => {
2556
- this.pendingMicTrack && this.backchannelHandler && await this.backchannelHandler.setMicrophoneTrack(this.pendingMicTrack);
2557
- },
2558
- onDisconnected: () => {
2559
- this.backchannelHandler = void 0;
2560
- }
2561
- });
2562
- let e = await this.backchannelHandler.createOffer();
2563
- e && !this.abortController.signal.aborted && this.sendWsMessage({
2564
- type: "webrtc/offer",
2565
- value: e
2566
- });
2567
- }
2568
- closeBackchannel() {
2569
- this.backchannelHandler?.close(), this.backchannelHandler = void 0, this.pendingMicTrack = null;
2570
- }
2571
- };
2572
- function wn(e) {
2573
- return new Cn(e);
2574
- }
2575
- var Tn = class {
2576
- streams = /* @__PURE__ */ new Map();
2577
- releaseTimers = /* @__PURE__ */ new Map();
2578
- releaseDelay;
2579
- DEFAULT_RELEASE_DELAY = 2e3;
2580
- constructor(e = {}) {
2581
- this.releaseDelay = e.releaseDelay ?? this.DEFAULT_RELEASE_DELAY;
2582
- }
2583
- has(e) {
2584
- return this.streams.has(e);
2585
- }
2586
- getRefCount(e) {
2587
- return this.streams.get(e)?.refCount ?? 0;
2588
- }
2589
- get(e) {
2590
- return this.streams.get(e);
2591
- }
2592
- acquire(e, t) {
2593
- this.cancelRelease(e);
2594
- let n = this.streams.get(e);
2595
- if (n) return n.refCount++, t && n.consumerContainerRefs.add(t), n;
2596
- }
2597
- register(e, t, n, r, i, a) {
2598
- this.cancelRelease(e);
2599
- let o = {
2600
- stream: t,
2601
- videoElementRef: n,
2602
- cameraDeviceRef: r,
2603
- containerElementRef: i,
2604
- consumerContainerRefs: /* @__PURE__ */ new Set([i]),
2605
- sharedVideoElement: a,
2606
- mediaStream: null,
2607
- refCount: 1
2608
- };
2609
- return this.streams.set(e, o), o;
2610
- }
2611
- updateContainerElement(e, t) {
2612
- let n = this.streams.get(e);
2613
- n && (n.containerElementRef.value = t);
2614
- }
2615
- updateSharedVideoElement(e, t) {
2616
- let n = this.streams.get(e);
2617
- n && (n.sharedVideoElement = t);
2618
- }
2619
- updateMediaStream(e, t) {
2620
- let n = this.streams.get(e);
2621
- n && (n.mediaStream = t);
2622
- }
2623
- release(e, t, n) {
2624
- let r = this.streams.get(e);
2625
- if (r) {
2626
- if (r.refCount--, n) {
2627
- r.consumerContainerRefs.delete(n);
2628
- let e = r.sharedVideoElement, t = n.value, i = e?.parentElement ?? null;
2629
- if (r.refCount > 0 && e && (i === t || i === null || !i.isConnected)) {
2630
- let n = this.pickVisibleConsumer(r, t);
2631
- n && (r.containerElementRef = n.ref, e.parentElement !== n.el && (n.el.appendChild(e), e.play().catch(() => {})));
2632
- }
2633
- }
2634
- if (r.refCount <= 0) {
2635
- let t = setTimeout(() => {
2636
- this.doRelease(e);
2637
- }, this.releaseDelay);
2638
- this.releaseTimers.set(e, t);
2639
- }
2640
- }
2641
- }
2642
- forceRelease(e) {
2643
- this.cancelRelease(e), this.doRelease(e);
2644
- }
2645
- clear() {
2646
- for (let e of this.releaseTimers.values()) clearTimeout(e);
2647
- this.releaseTimers.clear();
2648
- for (let [e, t] of this.streams) En(t.stream), this.streams.delete(e);
2649
- }
2650
- getDebugInfo() {
2651
- return Array.from(this.streams.entries()).map(([e, t]) => ({
2652
- cameraName: e,
2653
- refCount: t.refCount,
2654
- mode: t.stream.activeMode.value,
2655
- resolution: t.stream.activeResolution.value
2656
- }));
2657
- }
2658
- pickVisibleConsumer(e, t) {
2659
- let n;
2660
- for (let r of e.consumerContainerRefs) {
2661
- let e = r.value;
2662
- if (e && e !== t && e.isConnected) {
2663
- if (e.checkVisibility?.() ?? e.offsetParent !== null) return {
2664
- ref: r,
2665
- el: e
2666
- };
2667
- n ??= {
2668
- ref: r,
2669
- el: e
2670
- };
2671
- }
2672
- }
2673
- return n;
2674
- }
2675
- cancelRelease(e) {
2676
- let t = this.releaseTimers.get(e);
2677
- t && (clearTimeout(t), this.releaseTimers.delete(e));
2678
- }
2679
- doRelease(e) {
2680
- let t = this.streams.get(e);
2681
- t && (t.refCount <= 0 && (En(t.stream), this.streams.delete(e)), this.releaseTimers.delete(e));
2682
- }
2683
- };
2684
- function En(e) {
2685
- let t = e;
2686
- typeof t.destroy == "function" ? t.destroy() : t.stop();
2687
- }
2688
- var $ = new Tn(), Dn = /* @__PURE__ */ new WeakMap(), On = null;
2689
- function kn(e) {
2690
- On = e;
2691
- }
2692
- var An = [], jn = c(null);
2693
- function Mn() {
2694
- jn.value = An[An.length - 1] ?? null;
2695
- }
2696
- function Nn() {
2697
- return o(() => jn.value);
2698
- }
2699
- function Pn(e, t = {}) {
2700
- let r = t.mode ?? "fit", i = l(!1), a = c(null);
2701
- s(() => n(e), (e) => {
2702
- a.value = e ?? null;
2703
- }, { immediate: !0 });
2704
- function u(e) {
2705
- e.key === "Escape" && i.value && p();
2706
- }
2707
- async function f() {
2708
- let e = a.value;
2709
- if (!e || i.value) return;
2710
- let t = document.createElement("div");
2711
- t.className = `cui-fullscreen cui-fullscreen-${r}`, Fn(t, r);
2712
- let n = {
2713
- wrapper: t,
2714
- parent: e.parentElement,
2715
- next: e.nextSibling,
2716
- bodyOverflow: document.body.style.overflow,
2717
- htmlOverflow: document.documentElement.style.overflow
2718
- };
2719
- Dn.set(e, n), e.setAttribute("data-cui-fullscreen", r), (On ?? document.body).appendChild(t), t.appendChild(e), document.body.style.overflow = "hidden", document.documentElement.style.overflow = "hidden", document.addEventListener("keydown", u), An.push(t), Mn(), i.value = !0;
2720
- }
2721
- async function p() {
2722
- let e = a.value;
2723
- if (!e || !i.value) return;
2724
- let t = Dn.get(e);
2725
- if (!t) return;
2726
- Dn.delete(e), e.removeAttribute("data-cui-fullscreen"), t.parent && (t.next && t.next.parentNode === t.parent ? t.parent.insertBefore(e, t.next) : t.parent.appendChild(e)), t.wrapper.remove(), document.body.style.overflow = t.bodyOverflow, document.documentElement.style.overflow = t.htmlOverflow, document.removeEventListener("keydown", u);
2727
- let n = An.indexOf(t.wrapper);
2728
- n !== -1 && An.splice(n, 1), Mn(), i.value = !1;
2729
- }
2730
- async function m() {
2731
- i.value ? await p() : await f();
2732
- }
2733
- return d(() => {
2734
- i.value && a.value && p(), document.removeEventListener("keydown", u);
2735
- }), {
2736
- isFullscreen: o(() => i.value),
2737
- isSupported: o(() => !0),
2738
- enter: f,
2739
- exit: p,
2740
- toggle: m
2741
- };
2742
- }
2743
- function Fn(e, t) {
2744
- let n = {
2745
- position: "fixed",
2746
- top: "0",
2747
- right: "0",
2748
- bottom: "0",
2749
- left: "0",
2750
- zIndex: "2147483647",
2751
- margin: "0",
2752
- background: "black",
2753
- paddingTop: "env(safe-area-inset-top)",
2754
- paddingRight: "env(safe-area-inset-right)",
2755
- paddingBottom: "env(safe-area-inset-bottom)",
2756
- paddingLeft: "env(safe-area-inset-left)",
2757
- boxSizing: "border-box"
2758
- };
2759
- t === "fit" ? Object.assign(e.style, n, {
2760
- display: "flex",
2761
- alignItems: "center",
2762
- justifyContent: "center",
2763
- overflow: "hidden"
2764
- }) : Object.assign(e.style, n, {
2765
- display: "block",
2766
- overflowY: "auto",
2767
- overflowX: "hidden",
2768
- WebkitOverflowScrolling: "touch",
2769
- overscrollBehavior: "contain"
2770
- });
2771
- }
2772
- var In = 75, Ln = 500, Rn = 0, zn = 0;
2773
- function Bn() {
2774
- let e = performance.now();
2775
- e - zn > Ln && (Rn = 0);
2776
- let t = Rn * In;
2777
- return Rn++, zn = e, t;
2778
- }
2779
- function Vn(e) {
2780
- return !e || !e.isConnected ? !1 : e.checkVisibility?.() ?? e.offsetParent !== null;
2781
- }
2782
- function Hn(e) {
2783
- let { activityConfig: r, autoStart: i = !0, isolated: a = !1 } = e, u = a, f, p = () => n(i), m = e.startDelay ?? Bn(), h = [], { isConnected: g } = _(), v = o(() => n(e.camera)), y = o(() => typeof v.value == "string"), b = o(() => {
2784
- let e = v.value;
2785
- return typeof e == "string" ? e : e.name.value;
2786
- }), { camera: x, isLoading: S } = fe(o(() => y.value ? b.value : "")), C = o(() => y.value && S.value), w = o(() => y.value ? x.value : v.value), T, E, D, O = c(), ee = c(), k = c(), A = c(), j = c(), M = c(), N = l(!1), P = l(!1), F = l(!1), te = l(0), ne = l(0), re = l(!1), I = l(m <= 0);
2787
- m > 0 && (T = setTimeout(() => {
2788
- I.value = !0;
2789
- }, m)), s(w, (e) => {
2790
- M.value = e;
2791
- }, { immediate: !0 });
2792
- let L = o(() => M.value?.disabled.value === !0), R = o(() => j.value?.status.value ?? "idle"), z = o(() => j.value?.isPlaying.value ?? !1), ie = o(() => j.value?.activeMode.value ?? "webrtc"), ae = o(() => j.value?.activeResolution.value ?? "low-resolution"), oe = o(() => j.value?.degradedFrom.value ?? null), se = o(() => R.value === "unsupported"), B = o(() => j.value?.hasAudio.value ?? !1), V = o(() => j.value?.hasBackchannel.value ?? !1), ce = o(() => j.value?.error.value), le = o(() => R.value === "reconnecting"), ue = o(() => C.value || !z.value && R.value !== "error" && R.value !== "unsupported"), de = o(() => B.value && R.value === "connected"), pe = o(() => !!(typeof navigator < "u" && navigator.mediaDevices) && V.value), me = o(() => j.value?.muted.value ?? !0), H = o(() => j.value?.paused.value ?? !1), he = o(() => typeof document < "u" && document.pictureInPictureEnabled && !!k.value), ge = o(() => k.value), _e = o(() => ee.value ?? O.value), U = Lt({
2793
- initialMode: n(e.activityMode) ?? "always-on",
2794
- config: r,
2795
- onStreamStart: () => {
2796
- L.value || j.value?.start();
2797
- },
2798
- onStreamStop: () => {
2799
- if (N.value) {
2800
- let e = D ?? b.value;
2801
- if (e && $.getRefCount(e) > 1) return;
2802
- }
2803
- j.value?.stop();
2804
- },
2805
- isStreamPlaying: () => z.value
2806
- }), { isFullscreen: ve, toggle: ye } = Pn(_e);
2807
- function be() {
2808
- return E = wn({
2809
- camera: M,
2810
- videoElement: A,
2811
- containerElement: O,
2812
- mode: o(() => n(e.mode) ?? "auto"),
2813
- resolution: o(() => n(e.resolution) ?? "high-resolution"),
2814
- autoStart: !1
2815
- }), E;
2816
- }
2817
- let W = be();
2818
- function xe() {
2819
- let e = document.createElement("video");
2820
- return e.autoplay = !0, e.playsInline = !0, e.muted = !0, e.disablePictureInPicture = !1, e.preload = "auto", e.poster = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=", e.style.position = "absolute", e.style.width = "100%", e.style.height = "100%", e.style.inset = "0", e.style.objectFit = "fill", e;
2821
- }
2822
- function Se(e, t) {
2823
- e.parentElement && e.parentElement !== t && e.parentElement.removeChild(e), e.parentElement !== t && t.appendChild(e);
2824
- }
2825
- function Ce() {
2826
- if (u) return;
2827
- let e = O.value, t = k.value;
2828
- if (!e || !t || t.parentElement === e || !Vn(e) || Vn(t.parentElement)) return;
2829
- Se(t, e), t.play().catch(() => {});
2830
- let n = b.value, r = n ? $.get(n) : void 0;
2831
- r && (r.containerElementRef = O);
2832
- }
2833
- function we() {
2834
- re.value = !0;
2835
- }
2836
- function Te() {
2837
- re.value = !1;
2838
- }
2839
- function Ee() {
2840
- if (P.value) return;
2841
- let e = O.value, t = w.value;
2842
- if (!e || !t || !g.value) return;
2843
- P.value = !0, N.value = !1, j.value = W;
2844
- let n = xe();
2845
- k.value = n, A.value = n, p() && I.value && U.mode.value === "always-on" && !L.value && W.start();
2846
- }
2847
- function G() {
2848
- if (P.value) return;
2849
- if (u) {
2850
- Ee();
2851
- return;
2852
- }
2853
- let e = O.value, t = b.value, n = w.value;
2854
- if (!e || !t || !g.value) return;
2855
- let r = $.get(t);
2856
- if (r && r.refCount > 0) {
2857
- let n = r.containerElementRef.value;
2858
- if (n && n !== e && Vn(n)) {
2859
- f || (f = setTimeout(() => {
2860
- if (f = void 0, F.value || P.value) return;
2861
- let e = $.get(t), n = e?.containerElementRef.value;
2862
- e && e.refCount > 0 && n && n !== O.value && Vn(n) && (u = !0), G();
2863
- }, 200), h.push(() => {
2864
- f && clearTimeout(f), f = void 0;
2865
- }));
2866
- return;
2867
- }
2868
- }
2869
- let i = $.acquire(t, O);
2870
- if (i) {
2871
- P.value = !0, D = t, N.value = !0, j.value = i.stream, n && i.cameraDeviceRef && (i.cameraDeviceRef.value = n);
2872
- let r = i.sharedVideoElement;
2873
- r || (r = xe(), i.sharedVideoElement = r, $.updateSharedVideoElement(t, r)), i.mediaStream?.active && (r.srcObject = i.mediaStream), e && (i.containerElementRef = O), k.value = r, i.videoElementRef.value = r, Oe(i.stream, r, t), p() && I.value && U.mode.value === "always-on" && !L.value && (i.stream.activeMode.value === "mse" ? r.play().catch(() => {}) : K(i, r, t));
2874
- } else if (n) {
2875
- P.value = !0, D = t, N.value = !1, j.value = W;
2876
- let e = xe();
2877
- k.value = e, A.value = e, $.register(t, W, A, M, O, e), p() && I.value && U.mode.value === "always-on" && !L.value && W.start();
2878
- let n = s(() => W.isPlaying.value, (n) => {
2879
- n && e.srcObject instanceof MediaStream && $.updateMediaStream(t, e.srcObject);
2880
- }, { immediate: !0 });
2881
- h.push(n);
2882
- let r = s(() => W.status.value, (n) => {
2883
- n === "connected" && e.srcObject instanceof MediaStream && $.updateMediaStream(t, e.srcObject);
2884
- });
2885
- h.push(r);
2886
- }
2887
- }
2888
- function K(e, t, n) {
2889
- if (!e) return;
2890
- let r = e.stream, i = r.activeMode.value, a = r.status.value, o = e.mediaStream?.active && e.mediaStream.getTracks().some((e) => e.readyState === "live");
2891
- i === "mse" ? ($.updateMediaStream(n, null), r.restart()) : o && e.mediaStream ? (t.srcObject = e.mediaStream, t.play().catch(() => {})) : a === "idle" || a === "closed" ? (r.start(), De(r, t, n)) : (a === "connected" && r.restart(), De(r, t, n));
2892
- }
2893
- function De(e, t, n) {
2894
- let r = s([() => e.isPlaying.value, () => e.status.value], ([e, i]) => {
2895
- if (i === "connected" || e) {
2896
- let e = $.get(n)?.mediaStream;
2897
- e?.active && e.getTracks().some((e) => e.readyState === "live") ? (t.srcObject = e, t.play().catch(() => {}), r()) : t.srcObject instanceof MediaStream && ($.updateMediaStream(n, t.srcObject), t.play().catch(() => {}), r());
2898
- }
2899
- }, { immediate: !0 });
2900
- h.push(r);
2901
- }
2902
- function Oe(e, t, n) {
2903
- let r = e.status.value !== "connected", i = s(() => e.status.value, (e) => {
2904
- e === "reconnecting" || e === "connecting" ? r = !0 : e === "connected" && r && (r = !1, setTimeout(() => {
2905
- t.srcObject instanceof MediaStream && ($.updateMediaStream(n, t.srcObject), t.play().catch(() => {}));
2906
- }, 100));
2907
- }, { immediate: !0 });
2908
- h.push(i);
2909
- let a = s(() => e.isPlaying.value, (r) => {
2910
- r && e.activeMode.value !== "mse" && t.srcObject instanceof MediaStream && ($.updateMediaStream(n, t.srcObject), t.play().catch(() => {}));
2911
- }, { immediate: !0 });
2912
- h.push(a);
2913
- }
2914
- async function ke() {
2915
- L.value || (U.inStandby.value ? U.resumeFromStandby() : await j.value?.start());
2916
- }
2917
- function Ae() {
2918
- j.value?.stop();
2919
- }
2920
- async function je() {
2921
- await j.value?.restart();
2922
- }
2923
- function Me() {
2924
- L.value || U.resumeFromStandby();
2925
- }
2926
- async function Ne(e) {
2927
- let t = b.value;
2928
- t && $.updateMediaStream(t, null), await j.value?.setMode(e);
2929
- }
2930
- async function Pe(e) {
2931
- await j.value?.setResolution(e);
2932
- }
2933
- async function Fe(e) {
2934
- await j.value?.setMicrophone(e);
2935
- }
2936
- function Ie(e) {
2937
- U.setMode(e);
2938
- }
2939
- function Le(e) {
2940
- U.reportActivity(e);
2941
- }
2942
- function Re(e) {
2943
- j.value?.setMuted(e);
2944
- let t = k.value;
2945
- t && (t.muted = e);
2946
- }
2947
- async function ze() {
2948
- await j.value?.play();
2949
- }
2950
- function Be() {
2951
- j.value?.pause();
2952
- }
2953
- function Ve() {
2954
- document.pictureInPictureElement ? document.exitPictureInPicture() : document.pictureInPictureEnabled && k.value && k.value.requestPictureInPicture();
2955
- }
2956
- function He() {
2957
- let e = k.value;
2958
- if (!e || e.videoWidth === 0) return null;
2959
- let t = document.createElement("canvas");
2960
- return t.width = e.videoWidth, t.height = e.videoHeight, t.getContext("2d")?.drawImage(e, 0, 0), t.toDataURL("image/png");
2961
- }
2962
- function Ue() {
2963
- if (F.value) return;
2964
- F.value = !0, T &&= (clearTimeout(T), void 0), j.value?.setMuted(!0);
2965
- let e = k.value;
2966
- e && (e.muted = !0);
2967
- for (let e of h) e();
2968
- if (h.length = 0, u) E?.destroy();
2969
- else {
2970
- let e = D, t = k.value;
2971
- e && P.value && $.release(e, t, O), (!P.value || j.value !== W) && E?.destroy();
2972
- }
2973
- U.dispose();
2974
- }
2975
- function We(t) {
2976
- let r = n(e.canvasStyle), i = n(e.canvasClass);
2977
- if (r) {
2978
- if (typeof r == "string") t.style.cssText += ";" + r;
2979
- else if (Array.isArray(r)) for (let e of r) typeof e == "string" ? t.style.cssText += ";" + e : e && Object.assign(t.style, e);
2980
- else Object.assign(t.style, r);
2981
- }
2982
- if (i) {
2983
- if (typeof i == "string") t.className = i;
2984
- else if (Array.isArray(i)) t.className = i.filter(Boolean).join(" ");
2985
- else for (let [e, n] of Object.entries(i)) t.classList.toggle(e, !!n);
2986
- }
2987
- }
2988
- if (!a && typeof IntersectionObserver < "u") {
2989
- let e, t = s(O, (t) => {
2990
- e?.disconnect(), e = void 0, t && (e = new IntersectionObserver((e) => {
2991
- e.some((e) => e.isIntersecting) && Ce();
2992
- }), e.observe(t));
2993
- }, { immediate: !0 });
2994
- h.push(() => {
2995
- t(), e?.disconnect();
2996
- });
2997
- }
2998
- if (e.canvasStyle !== void 0 || e.canvasClass !== void 0) {
2999
- let e, t = s(O, (t) => {
3000
- if (e?.(), e = void 0, !t) return;
3001
- Array.from(t.querySelectorAll("canvas")).forEach((e) => {
3002
- We(e);
3003
- });
3004
- let n = new MutationObserver((e) => {
3005
- for (let t of e) Array.from(t.addedNodes).forEach((e) => {
3006
- e instanceof HTMLCanvasElement ? We(e) : e instanceof HTMLElement && Array.from(e.querySelectorAll("canvas")).forEach((e) => We(e));
3007
- });
3008
- });
3009
- n.observe(t, {
3010
- childList: !0,
3011
- subtree: !0
3012
- }), e = () => n.disconnect();
3013
- }, { immediate: !0 });
3014
- h.push(() => {
3015
- t(), e?.();
3016
- });
3017
- }
3018
- if (e.videoStyle !== void 0 || e.videoClass !== void 0) {
3019
- let t = s([
3020
- k,
3021
- () => n(e.videoStyle),
3022
- () => n(e.videoClass)
3023
- ], ([e, t, n]) => {
3024
- if (e) {
3025
- if (t) {
3026
- if (typeof t == "string") e.style.cssText += ";" + t;
3027
- else if (Array.isArray(t)) for (let n of t) typeof n == "string" ? e.style.cssText += ";" + n : n && Object.assign(e.style, n);
3028
- else Object.assign(e.style, t);
3029
- }
3030
- if (n) {
3031
- if (typeof n == "string") e.className = n;
3032
- else if (Array.isArray(n)) e.className = n.filter(Boolean).join(" ");
3033
- else for (let [t, r] of Object.entries(n)) e.classList.toggle(t, r);
3034
- }
3035
- }
3036
- }, { immediate: !0 });
3037
- h.push(t);
3038
- }
3039
- let Ge = s([() => j.value?.nativeWidth.value, () => j.value?.nativeHeight.value], ([e, t]) => {
3040
- e && e > 0 && (te.value = e), t && t > 0 && (ne.value = t);
3041
- });
3042
- h.push(Ge);
3043
- let Ke = s(k, (e, t) => {
3044
- t && (t.removeEventListener("enterpictureinpicture", we), t.removeEventListener("leavepictureinpicture", Te)), e && (e.addEventListener("enterpictureinpicture", we), e.addEventListener("leavepictureinpicture", Te));
3045
- }, { immediate: !0 });
3046
- return h.push(Ke), s([O, k], ([e, t]) => {
3047
- e && t && Se(t, e);
3048
- }, { immediate: !0 }), s(() => n(e.activityMode), (e) => {
3049
- e && e !== U.mode.value && U.setMode(e);
3050
- }), s([
3051
- O,
3052
- w,
3053
- g,
3054
- I
3055
- ], () => {
3056
- P.value ? I.value && p() && U.mode.value === "always-on" && !z.value && R.value === "idle" && !L.value && j.value?.start() : G();
3057
- }, { immediate: !0 }), s(L, (e, t) => {
3058
- P.value && (!t && e ? j.value?.stop() : t && !e && p() && j.value?.restart());
3059
- }), t(Ue), d(Ue), {
3060
- status: R,
3061
- isPlaying: z,
3062
- activeMode: ie,
3063
- activeResolution: ae,
3064
- degradedFrom: oe,
3065
- unsupported: se,
3066
- hasAudio: B,
3067
- hasBackchannel: V,
3068
- error: ce,
3069
- isReconnecting: le,
3070
- activityMode: U.mode,
3071
- inStandby: U.inStandby,
3072
- hasActivity: U.hasActivity,
3073
- isBusy: ue,
3074
- hasSound: de,
3075
- hasIntercom: pe,
3076
- videoElement: k,
3077
- containerElement: O,
3078
- fullscreenElement: ee,
3079
- renderElement: ge,
3080
- stream: j,
3081
- muted: me,
3082
- paused: H,
3083
- nativeWidth: te,
3084
- nativeHeight: ne,
3085
- isPip: re,
3086
- supportsPip: he,
3087
- isFullscreen: ve,
3088
- start: ke,
3089
- stop: Ae,
3090
- restart: je,
3091
- resumeFromStandby: Me,
3092
- setMode: Ne,
3093
- setResolution: Pe,
3094
- setMicrophone: Fe,
3095
- setActivityMode: Ie,
3096
- reportActivity: Le,
3097
- setMuted: Re,
3098
- play: ze,
3099
- pause: Be,
3100
- togglePip: Ve,
3101
- isCameraDisabled: L,
3102
- toggleFullscreen: ye,
3103
- captureScreenshot: He
3104
- };
3105
- }
3106
- function Un() {
3107
- let e = _(), t = b.coreManagerNamespaces(), n = (e) => e.createProxy(t.coreManagerRpc);
3108
- return {
3109
- getFFmpegPath: () => C(e.rpc, (e) => n(e).getFFmpegPath()),
3110
- getServerAddresses: () => C(e.rpc, (e) => n(e).getServerAddresses()),
3111
- getPluginsByInterface: (t) => C(e.rpc, (e) => n(e).getPluginsByInterface(t)),
3112
- getCloudServerId: () => C(e.rpc, (e) => n(e).getCloudServerId())
3113
- };
3114
- }
3115
- var Wn = 1500, Gn = 3e4, Kn = /* @__PURE__ */ new Map();
3116
- function qn(e) {
3117
- let t = _(), n = l({ status: "disconnected" }), r = l(null), i = null, a = (n) => C(t.rpc, async (r) => {
3118
- let i = await ut(t.rpc, e);
3119
- if (!i) throw Error(`Plugin "${e}" not found`);
3120
- return n(r.createProxy(b.pluginNamespaces(i).pluginChildRpc));
3121
- });
3122
- async function o() {
3123
- n.value = await a((e) => e.getOAuthState()), r.value ||= await a((e) => e.getOAuthMetadata());
3124
- }
3125
- function c(e) {
3126
- i && clearInterval(i), i = setInterval(() => {
3127
- o().catch(() => void 0);
3128
- }, e);
3129
- }
3130
- return s(() => n.value.status, (e) => {
3131
- c(e === "awaiting_user" || e === "polling" ? Wn : Gn);
3132
- }, { immediate: !0 }), o().catch(() => void 0), {
3133
- state: n,
3134
- metadata: r,
3135
- call: a,
3136
- refresh: o
3137
- };
3138
- }
3139
- function Jn(e) {
3140
- Kn.has(e) || Kn.set(e, qn(e));
3141
- let { state: t, metadata: n, call: r, refresh: i } = Kn.get(e);
3142
- async function a(e) {
3143
- t.value = await r((t) => t.startDeviceFlow(e));
3144
- }
3145
- async function o(e) {
3146
- t.value = await r((t) => t.startAuthCodeFlow(e));
3147
- }
3148
- async function s() {
3149
- (t.value.status === "awaiting_user" || t.value.status === "polling") && await r((e) => e.cancelDeviceFlow?.() ?? e.cancelAuthCodeFlow?.() ?? Promise.resolve()), await i();
3150
- }
3151
- async function c() {
3152
- await r((e) => e.disconnect()), await i();
3153
- }
3154
- return {
3155
- state: t,
3156
- metadata: n,
3157
- startDeviceFlow: a,
3158
- startAuthCodeFlow: o,
3159
- cancel: s,
3160
- disconnect: c,
3161
- refresh: i
3162
- };
3163
- }
3164
- function Yn() {
3165
- let e = _(), { rpc: t, isConnected: n } = e, r = b.terminalManagerNamespaces(), a = c(), o = l(!1), s = l(!1), u = l(), f = l({
3166
- cols: 80,
3167
- rows: 24
3168
- }), p, m, h = 0, g = (e) => e.createProxy(r.terminalManagerRpc);
3169
- async function v(e) {
3170
- if (!(s.value || o.value)) {
3171
- s.value = !0, u.value = void 0, m = e;
3172
- try {
3173
- let n = await C(t, (t) => g(t).createSession({
3174
- cols: e?.cols ?? 80,
3175
- rows: e?.rows ?? 24,
3176
- cwd: e?.cwd,
3177
- shell: e?.shell,
3178
- env: e?.env
3179
- }));
3180
- a.value = n.sessionId, f.value = n.dimensions, o.value = !0, p = new AbortController();
3181
- let r = ++h;
3182
- y(n.sessionId, e, r);
3183
- } catch (t) {
3184
- u.value = t instanceof Error ? t : Error(String(t)), e?.onError?.(u.value);
3185
- } finally {
3186
- s.value = !1;
3187
- }
3188
- }
3189
- }
3190
- async function y(e, n, r) {
3191
- try {
3192
- let i = t.value;
3193
- if (!i) return;
3194
- for await (let t of g(i).generateOutput(e)) {
3195
- if (r !== h || p?.signal.aborted) break;
3196
- n?.onData?.(t);
3197
- }
3198
- } catch (e) {
3199
- r === h && !p?.signal.aborted && (u.value = e instanceof Error ? e : Error(String(e)), n?.onError?.(u.value));
3200
- } finally {
3201
- r === h && !p?.signal.aborted && (o.value = !1, n?.onClose?.());
3202
- }
3203
- }
3204
- async function x(e) {
3205
- if (a.value && o.value) try {
3206
- await C(t, (t) => g(t).writeInput(a.value, e));
3207
- } catch (e) {
3208
- u.value = e instanceof Error ? e : Error(String(e)), m?.onError?.(u.value);
3209
- }
3210
- }
3211
- async function S(e) {
3212
- if (a.value && o.value) try {
3213
- await C(t, (t) => g(t).resize(a.value, e)), f.value = e;
3214
- } catch (e) {
3215
- u.value = e instanceof Error ? e : Error(String(e)), m?.onError?.(u.value);
3216
- }
3217
- }
3218
- async function w() {
3219
- if (p?.abort(), h++, a.value) try {
3220
- await C(t, (e) => g(e).closeSession(a.value), {
3221
- awaitConnect: !1,
3222
- maxRetries: 0
3223
- });
3224
- } catch {}
3225
- a.value = void 0, o.value = !1, m = void 0;
3226
- }
3227
- function T() {
3228
- if (!a.value && !o.value) return;
3229
- let e = m;
3230
- p?.abort(), h++, a.value = void 0, o.value = !1, m = void 0, e?.onClose?.(), e && v(e);
3231
- }
3232
- return e.on("reconnected", T), d(() => {
3233
- e.off("reconnected", T), w();
3234
- }), {
3235
- sessionId: i(a),
3236
- isConnected: i(o),
3237
- isConnecting: i(s),
3238
- isClientConnected: i(n),
3239
- error: i(u),
3240
- dimensions: i(f),
3241
- connect: v,
3242
- write: x,
3243
- resize: S,
3244
- close: w
3245
- };
3246
- }
3247
- //#endregion
3248
- export { nt as A, ot as C, it as D, rt as E, Ze as F, ae as I, Yt as L, Ee as M, Tt as N, tt as O, Dt as P, Yn as R, _ as S, Pn as T, kn as _, Be as a, Et as b, De as c, Pe as d, Oe as f, Ot as g, Fe as h, Ae as i, at as j, Jn as k, Ne as l, Me as m, ke as n, Ie as o, Re as p, je as r, ze as s, Ft as t, Le as u, Qe as v, Un as w, Hn as x, fe as y, Nn as z };