@camera.ui/server 2.2.5-beta.1 → 2.2.5-beta.2

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 (953) hide show
  1. package/dist/interface/assets/404-BDvtK1qR.js +1 -0
  2. package/dist/interface/assets/About-B4A35rRx.js +1 -0
  3. package/dist/interface/assets/Assistant-BKxssfw-.js +1 -0
  4. package/dist/interface/assets/Automation-CP59cgP7.js +3 -0
  5. package/dist/interface/assets/AutomationImport-CEJdhE_d.js +2 -0
  6. package/dist/interface/assets/AutomationStore-BZGR_5Xl.js +2 -0
  7. package/dist/interface/assets/AutomationStoreDetail-BenRMMtV.js +2 -0
  8. package/dist/interface/assets/Automations-BpXorYAS.js +2 -0
  9. package/dist/interface/assets/Camera-UBUfaR5a.js +2 -0
  10. package/dist/interface/assets/CameraConsole-D24yXOQn.js +7 -0
  11. package/dist/interface/assets/Cameras-B21Y8MdQ.js +651 -0
  12. package/dist/interface/assets/Camview-BySyPtU5.js +1 -0
  13. package/dist/interface/assets/CertificateUpload-26LAL4MY.js +1 -0
  14. package/dist/interface/assets/Config-BGyGmukb.js +2 -0
  15. package/dist/interface/assets/ConfigActionAssistant-Cl_kr3hp.js +1 -0
  16. package/dist/interface/assets/ConfigActionCameraControl-CL4vXcNe.js +1 -0
  17. package/dist/interface/assets/ConfigActionDelay-DtPgmqWh.js +1 -0
  18. package/dist/interface/assets/ConfigActionHttp-DnkZTP5l.js +1 -0
  19. package/dist/interface/assets/ConfigActionImageInput-3svn6YP9.js +1 -0
  20. package/dist/interface/assets/ConfigActionMqtt-BTsFTLgm.js +1 -0
  21. package/dist/interface/assets/ConfigActionNotification-Cr4xJrZp.js +1 -0
  22. package/dist/interface/assets/ConfigActionNotificationControl-Cxkb_g8p.js +1 -0
  23. package/dist/interface/assets/ConfigActionOutput-WTr7FGf_.js +1 -0
  24. package/dist/interface/assets/ConfigActionPlugin-BpcJepbD.js +1 -0
  25. package/dist/interface/assets/ConfigActionSensor-BgD_F-hD.js +1 -0
  26. package/dist/interface/assets/ConfigActionSnapshot-DjR-Z08N.js +1 -0
  27. package/dist/interface/assets/ConfigActionVariable-gPuPbjpm.js +1 -0
  28. package/dist/interface/assets/ConfigConditionIfElse-CUHKJmPx.js +1 -0
  29. package/dist/interface/assets/ConfigConditionSensorState-D-gPRqMu.js +1 -0
  30. package/dist/interface/assets/ConfigConditionSwitch-BRf1T5tJ.js +1 -0
  31. package/dist/interface/assets/ConfigConditionTime-BC0n6sWO.js +1 -0
  32. package/dist/interface/assets/ConfigSensorValueInput-BUHapx4M.js +1 -0
  33. package/dist/interface/assets/ConfigTriggerDetection-Byd6SLGg.js +1 -0
  34. package/dist/interface/assets/ConfigTriggerGeofence-CkzTFEZn.js +1 -0
  35. package/dist/interface/assets/ConfigTriggerManual-B2dWcFrl.js +1 -0
  36. package/dist/interface/assets/ConfigTriggerMqtt-B_aUDBu4.js +1 -0
  37. package/dist/interface/assets/ConfigTriggerSchedule-DAZo1PLj.js +1 -0
  38. package/dist/interface/assets/ConfigTriggerSensor-BCqAiPu4.js +1 -0
  39. package/dist/interface/assets/ConfigTriggerSystem-DuBydCiq.js +1 -0
  40. package/dist/interface/assets/ConfigTriggerWebhook-DDsnpwJr.js +1 -0
  41. package/dist/interface/assets/Console-HXmKYaK_.js +1 -0
  42. package/dist/interface/assets/CuiAssistantConversation-2qrRCsgw.js +5 -0
  43. package/dist/interface/assets/CuiAutomationRunsDialog-C_sMg7E1.js +1 -0
  44. package/dist/interface/assets/CuiBottomSheet-CTr-KHC8.js +1 -0
  45. package/dist/interface/assets/CuiBottomSheet-D_0LrjA_.js +1 -0
  46. package/dist/interface/assets/CuiCameraPipCard-BZCayhy_.js +1 -0
  47. package/dist/interface/assets/CuiCameraRecordings-BbaEL2ST.js +1 -0
  48. package/dist/interface/assets/CuiCameraShares-BIUB1xMa.js +1 -0
  49. package/dist/interface/assets/CuiCameraTable-C5tQHs63.js +1 -0
  50. package/dist/interface/assets/CuiCameraTable-D-UhqHk4.js +2 -0
  51. package/dist/interface/assets/CuiChartTable-CSK4Mzn3.js +1 -0
  52. package/dist/interface/assets/CuiConsole-DAbJXJBq.js +5 -0
  53. package/dist/interface/assets/CuiDataTable-DgcJsG-K.js +1 -0
  54. package/dist/interface/assets/CuiLightControl-v6k9hVGl.js +1 -0
  55. package/dist/interface/assets/CuiList-HdsA9vV1.js +1 -0
  56. package/dist/interface/assets/CuiMarkdownContent-BUYtK_wD.js +1 -0
  57. package/dist/interface/assets/CuiMarkdownContent-DSArmS0V.js +1 -0
  58. package/dist/interface/assets/CuiPluginCard-5MRYJcF2.js +2 -0
  59. package/dist/interface/assets/CuiPluginCategoryChip-C7R1jP7r.js +1 -0
  60. package/dist/interface/assets/CuiPluginOAuthButton-BJJw0IaC.js +2 -0
  61. package/dist/interface/assets/CuiPluginTrustBadge-Bmm1qYdC.js +1 -0
  62. package/dist/interface/assets/CuiQRCode-DTSEFMBt.js +1 -0
  63. package/dist/interface/assets/CuiSchema-BDXeXora.js +1 -0
  64. package/dist/interface/assets/CuiTopNavbarItem-BVknLbRO.js +1 -0
  65. package/dist/interface/assets/Faces-BEpYvbB0.js +1 -0
  66. package/dist/interface/assets/FirstSteps-U93RDOcP.js +1 -0
  67. package/dist/interface/assets/Floorplan-D8XoCNOB.js +1 -0
  68. package/dist/interface/assets/Instances-CFwZotvU.js +1 -0
  69. package/dist/interface/assets/Logs-BjcfuMQV.js +6 -0
  70. package/dist/interface/assets/Menu-BjjnSgdP.js +1 -0
  71. package/dist/interface/assets/Metrics-BUP_-7o7.css +1 -0
  72. package/dist/interface/assets/Metrics-Ca_d5CbP.js +12 -0
  73. package/dist/interface/assets/OAuthDeviceFlow-9v-Czy_u.js +1 -0
  74. package/dist/interface/assets/Plugin-BjLw46Sw.js +1 -0
  75. package/dist/interface/assets/PluginConsole-C7sO42RG.js +7 -0
  76. package/dist/interface/assets/PluginDetail-BuLW4lkN.js +2 -0
  77. package/dist/interface/assets/PluginSchema-D0eL9H-b.js +1 -0
  78. package/dist/interface/assets/PluginSearch--LLMEeyx.js +2 -0
  79. package/dist/interface/assets/PluginSearch-0akjE0ef.js +1 -0
  80. package/dist/interface/assets/PluginUpdateProgress--MM9D8hs.js +1 -0
  81. package/dist/interface/assets/Plugins-26O511gf.js +1 -0
  82. package/dist/interface/assets/RecentEventsFilter-CvIJS8Se.js +1 -0
  83. package/dist/interface/assets/Recordings-DQOGeSFm.js +1 -0
  84. package/dist/interface/assets/SensorEdit-DEW5D80x.js +1 -0
  85. package/dist/interface/assets/SensorHistory-Efw0bZ-X.js +1 -0
  86. package/dist/interface/assets/Sensors-C8yOyAwo.js +2 -0
  87. package/dist/interface/assets/Settings-B-RgMeVm.js +1 -0
  88. package/dist/interface/assets/SettingsAccount-B6aXFx3F.js +1 -0
  89. package/dist/interface/assets/SettingsAccount-_0ccrXYU.js +1 -0
  90. package/dist/interface/assets/SettingsAppearance-CkDwzx6f.js +1 -0
  91. package/dist/interface/assets/SettingsAppearance-DBFE3uVH.js +1 -0
  92. package/dist/interface/assets/SettingsAssistant-DN5OUJqt.js +1 -0
  93. package/dist/interface/assets/SettingsBackup-BqKBKis5.js +1 -0
  94. package/dist/interface/assets/SettingsList-BU191rmt.js +1 -0
  95. package/dist/interface/assets/SettingsMqtt-hsKZkU-o.js +1 -0
  96. package/dist/interface/assets/SettingsNotifications-DIeiUEAk.js +1 -0
  97. package/dist/interface/assets/SettingsPermissions-sI64FPZG.js +1 -0
  98. package/dist/interface/assets/SettingsRecordings-CghrKErw.js +1 -0
  99. package/dist/interface/assets/SettingsRemote-Doa0aBMC.js +2 -0
  100. package/dist/interface/assets/SettingsSystem-DP1p1Xns.js +2 -0
  101. package/dist/interface/assets/SettingsUsers-Dpej-he1.js +1 -0
  102. package/dist/interface/assets/Terminal-DPRPXCSt.js +4 -0
  103. package/dist/interface/assets/Training-DYlefOX1.js +1 -0
  104. package/dist/interface/assets/Updates-QTvCp1aS.js +2 -0
  105. package/dist/interface/assets/VariableInput-DhusSZPw.js +1 -0
  106. package/dist/interface/assets/VariableSuggestions-Bkzz4Mv3.js +1 -0
  107. package/dist/interface/assets/VersionsHandler-DjNSpSYy.js +7 -0
  108. package/dist/interface/assets/VirtualSensorCreate-soGT6h2c.js +1 -0
  109. package/dist/interface/assets/Workers-CUVvTuts.js +2 -0
  110. package/dist/interface/assets/account-Bu30He0P.js +1 -0
  111. package/dist/interface/assets/alert-circle-D2fAQwTX.js +1 -0
  112. package/dist/interface/assets/alert-outline-D7zaSJH_.js +1 -0
  113. package/dist/interface/assets/api-B0wYDGQj.css +2 -0
  114. package/dist/interface/assets/api-BNrZVfeD.js +4 -0
  115. package/dist/interface/assets/api-CK2tonlH.js +1 -0
  116. package/dist/interface/assets/arrow-left-BGLyEqqa.js +1 -0
  117. package/dist/interface/assets/assistant-BEe1ExZL.js +1 -0
  118. package/dist/interface/assets/assistantModels-D0soYqq7.js +1 -0
  119. package/dist/interface/assets/auth-QEpUGkWd.js +1 -0
  120. package/dist/interface/assets/automations-BBIBV4Uu.js +1 -0
  121. package/dist/interface/assets/back-filled-BPBVnQjx.js +1 -0
  122. package/dist/interface/assets/bell-ring-CyCFPUL_.js +1 -0
  123. package/dist/interface/assets/brain-CIJB1ree.js +1 -0
  124. package/dist/interface/assets/cameraSources-Cm18cW9L.js +1 -0
  125. package/dist/interface/assets/cctv-D6kxZ-lp.js +1 -0
  126. package/dist/interface/assets/check-circle-DHAAn6A6.js +1 -0
  127. package/dist/interface/assets/check-circle-outline-BbqeKfIK.js +1 -0
  128. package/dist/interface/assets/chevron-down-ZYTrU871.js +1 -0
  129. package/dist/interface/assets/chevron-up-LQXNz9CE.js +1 -0
  130. package/dist/interface/assets/clock-outline-CKTiLKoR.js +1 -0
  131. package/dist/interface/assets/close-BbEPZQqa.js +1 -0
  132. package/dist/interface/assets/close-circle-BSUSUs4K.js +1 -0
  133. package/dist/interface/assets/cloud-check-BTGbrAQ_.js +1 -0
  134. package/dist/interface/assets/cloudHandoff-Dnndt2el.js +1 -0
  135. package/dist/interface/assets/config-vwkU8aqP.js +1 -0
  136. package/dist/interface/assets/content-copy-V0DW9ZbH.js +1 -0
  137. package/dist/interface/assets/copy-DsmMEtSH.js +1 -0
  138. package/dist/interface/assets/cube-scan-DGhUFV1x.js +1 -0
  139. package/dist/interface/assets/delete-CY8fsIW6.js +1 -0
  140. package/dist/interface/assets/dist-DNyx_J8o.js +1 -0
  141. package/dist/interface/assets/dots-vertical-pP1vP0Qa.js +1 -0
  142. package/dist/interface/assets/download-CyjJ7yJW.js +1 -0
  143. package/dist/interface/assets/esm-4Hzzm93H.js +1 -0
  144. package/dist/interface/assets/esm-BrFPi5_4.js +1 -0
  145. package/dist/interface/assets/esm-C7pcdfXf.js +1 -0
  146. package/dist/interface/assets/esm-C8bsO829.js +1 -0
  147. package/dist/interface/assets/esm-CXzdnAMk.js +1 -0
  148. package/dist/interface/assets/esm-CZNGZkPu.js +1 -0
  149. package/dist/interface/assets/esm-D0iI7OVb.js +1 -0
  150. package/dist/interface/assets/esm-DKolm6KU.js +1 -0
  151. package/dist/interface/assets/esm-DTywI9gs.js +1 -0
  152. package/dist/interface/assets/esm-DifXcK9i.js +1 -0
  153. package/dist/interface/assets/esm-Dq5o-Xb4.js +1 -0
  154. package/dist/interface/assets/esm-IbQuUZ5l.js +1 -0
  155. package/dist/interface/assets/esm-Xre_AP5i.js +1 -0
  156. package/dist/interface/assets/esm-zYnXHhpH.js +1 -0
  157. package/dist/interface/assets/eventIcons-cdzqQc0W.js +1 -0
  158. package/dist/interface/assets/eye-off-JCu1iUer.js +1 -0
  159. package/dist/interface/assets/eye-off-outline-GErp76H2.js +1 -0
  160. package/dist/interface/assets/flowSchema-rzBroL0H.js +1 -0
  161. package/dist/interface/assets/help-circle-outline-G43EJuch.js +1 -0
  162. package/dist/interface/assets/history-CNJREqJG.js +1 -0
  163. package/dist/interface/assets/home-B-_OQpZ6.js +1 -0
  164. package/dist/interface/assets/information-outline-Blt4EtWJ.js +1 -0
  165. package/dist/interface/assets/intercomService-Du8V_HxF.js +1 -0
  166. package/dist/interface/assets/lan-C3jliANx.js +1 -0
  167. package/dist/interface/assets/main-CRlC4FBY.js +3 -0
  168. package/dist/interface/assets/microphone-B6xc9JQ2.js +1 -0
  169. package/dist/interface/assets/minus-BI5qXFwJ.js +1 -0
  170. package/dist/interface/assets/mqtt-BY6-Hrbv.js +1 -0
  171. package/dist/interface/assets/native-CAujTO6L.js +1 -0
  172. package/dist/interface/assets/native-sQ88qazf.js +1 -0
  173. package/dist/interface/assets/nodeDefinitions-Dop49tx8.js +1 -0
  174. package/dist/interface/assets/notifications-CN6eTJb_.js +1 -0
  175. package/dist/interface/assets/pause-DKzvPG2b.js +1 -0
  176. package/dist/interface/assets/pencil-DKbi9SsG.js +1 -0
  177. package/dist/interface/assets/pencil-outline-CD3Xv98d.js +1 -0
  178. package/dist/interface/assets/plugin-D7K50k_y.js +1 -0
  179. package/dist/interface/assets/plugins-DKtX7zQp.js +1 -0
  180. package/dist/interface/assets/plus--kDl8ben.js +1 -0
  181. package/dist/interface/assets/plus-CHPYoMO_.js +1 -0
  182. package/dist/interface/assets/power-C9wmNlFS.js +1 -0
  183. package/dist/interface/assets/radar-B3ra28GD.js +1 -0
  184. package/dist/interface/assets/refresh-DfqyhMOh.js +1 -0
  185. package/dist/interface/assets/restore-FMacmqd_.js +1 -0
  186. package/dist/interface/assets/ring-resize-DyqCo2UN.js +1 -0
  187. package/dist/interface/assets/rooms-BHP4q6yf.js +1 -0
  188. package/dist/interface/assets/round-alt-arrow-left-bold-56eF9Bol.js +1 -0
  189. package/dist/interface/assets/search-BXbDWhLk.js +1 -0
  190. package/dist/interface/assets/sensorIcons-ztqlMLDc.js +1 -0
  191. package/dist/interface/assets/sensorSlots-D-uxjuv3.js +1 -0
  192. package/dist/interface/assets/sensors-DV2Z0IJt.js +1 -0
  193. package/dist/interface/assets/server-CfZnIVzn.js +1 -0
  194. package/dist/interface/assets/settings-Cw63SIJl.js +1 -0
  195. package/dist/interface/assets/source-branch-oyzrlfCD.js +1 -0
  196. package/dist/interface/assets/theme-Bi7qdjBK.js +1 -0
  197. package/dist/interface/assets/trash-2-BQc04l9M.js +1 -0
  198. package/dist/interface/assets/trash-can-outline-Bk5eENNM.js +1 -0
  199. package/dist/interface/assets/trash-fill-CXk8BmtF.js +1 -0
  200. package/dist/interface/assets/trash2-2rUvghml.js +1 -0
  201. package/dist/interface/assets/types-CNLAvgyw.js +1 -0
  202. package/dist/interface/assets/types-DuwD8xp5.js +1 -0
  203. package/dist/interface/assets/types-DwbeYXvn.js +1 -0
  204. package/dist/interface/assets/undo-Dcf7vcsv.js +1 -0
  205. package/dist/interface/assets/ungrouped-DHLAmt__.js +1 -0
  206. package/dist/interface/assets/updates-BqCH6Vr8.js +1 -0
  207. package/dist/interface/assets/upload-B-ZYPekV.js +1 -0
  208. package/dist/interface/assets/upload-nnbfDypK.js +1 -0
  209. package/dist/interface/assets/useAppVersion-B-rmq3Bb.js +1 -0
  210. package/dist/interface/assets/useAssistantActions-Kf-5ijVf.js +1 -0
  211. package/dist/interface/assets/useBackupRestore-Dj-ZXODq.js +1 -0
  212. package/dist/interface/assets/useCameraOptions-Dt2J8sP_.js +1 -0
  213. package/dist/interface/assets/useKeyboardInset-DtD3I2WC.js +1 -0
  214. package/dist/interface/assets/useLogsSocket-CEhUQdiY.js +1 -0
  215. package/dist/interface/assets/useNavLayout-CtpYjS5W.js +1 -0
  216. package/dist/interface/assets/usePermissions-CJzuagwD.js +1 -0
  217. package/dist/interface/assets/usePluginUpdates-BwoWN5yb.js +1 -0
  218. package/dist/interface/assets/usePushRegistration-ANx4BS6_.js +2 -0
  219. package/dist/interface/assets/useServerRestart-7edyD8M0.js +1 -0
  220. package/dist/interface/assets/useStreamStatus-DCSWHdbW.js +1 -0
  221. package/dist/interface/assets/useTabSwipe-DfS3R3uP.js +1 -0
  222. package/dist/interface/assets/useUpdateChannel-Cr9mSIRC.js +1 -0
  223. package/dist/interface/assets/useUpdatesSocket-B5Rm9syb.js +1 -0
  224. package/dist/interface/assets/useUserOptions-CJjImz8V.js +1 -0
  225. package/dist/interface/assets/variable-CcE0ZwTr.js +1 -0
  226. package/dist/interface/assets/vendor-DGke_6M4.js +23 -0
  227. package/dist/interface/assets/vendor-cameraui-BbGOMenD.js +2326 -0
  228. package/dist/interface/assets/vendor-capacitor-COL6Kz75.js +2 -0
  229. package/dist/interface/assets/vendor-chart-80wrH3md.js +3 -0
  230. package/dist/interface/assets/vendor-core-tgH2YubJ.js +1 -0
  231. package/dist/interface/assets/vendor-dnd-CEJS9JKU.js +2 -0
  232. package/dist/interface/assets/vendor-draggabilly-BY7O1F_Z.js +1 -0
  233. package/dist/interface/assets/vendor-markdown-DD4teg2u.js +14 -0
  234. package/dist/interface/assets/vendor-primevue-DNJJiEZl.js +3942 -0
  235. package/dist/interface/assets/vendor-vueflow-Bmwd2les.js +26 -0
  236. package/dist/interface/assets/web-3M-ddn4G.js +1 -0
  237. package/dist/interface/assets/web-BY80VGyU.js +1 -0
  238. package/dist/interface/assets/web-B_tUYyM0.js +1 -0
  239. package/dist/interface/assets/web-BjKL51lK-Bb5NYhpJ.js +1 -0
  240. package/dist/interface/assets/web-Bv-4PJGI.js +1 -0
  241. package/dist/interface/assets/web-C3Pk8qeB.js +1 -0
  242. package/dist/interface/assets/web-CLcvGPH6.js +1 -0
  243. package/dist/interface/assets/web-DO8gTOVJ.js +1 -0
  244. package/dist/interface/assets/web-DR5q_DmI.js +1 -0
  245. package/dist/interface/assets/web-DRHbG4Te.js +1 -0
  246. package/dist/interface/assets/web-DaQ8d8yk.js +1 -0
  247. package/dist/interface/assets/web-EVRW5whF.js +1 -0
  248. package/dist/interface/assets/web-S6Dk3UWN.js +1 -0
  249. package/dist/interface/assets/web-pWIp0wf0.js +1 -0
  250. package/dist/interface/assets/webhook-oVbP79Yk.js +1 -0
  251. package/dist/interface/assets/workbox-window.prod.es5-Dz5rcO1z.js +1 -0
  252. package/dist/interface/assets/zoom-in-GKNy8xA7.js +1 -0
  253. package/dist/interface/ha/404-Dl6JtQWv.js +60 -0
  254. package/dist/interface/ha/About-wjv4kCO3.js +55 -0
  255. package/dist/interface/ha/Assistant-Dpb4IsDC.js +9209 -0
  256. package/dist/interface/ha/Automation-CqTPjCUh.js +2025 -0
  257. package/dist/interface/ha/AutomationImport-CvdeneoU.js +206 -0
  258. package/dist/interface/ha/AutomationStore-bVPE68io.js +336 -0
  259. package/dist/interface/ha/AutomationStoreDetail-BYaNUjoH.js +122 -0
  260. package/dist/interface/ha/Automations-BfsYh2A_.js +424 -0
  261. package/dist/interface/ha/Camera-C70onr_O.js +654 -0
  262. package/dist/interface/ha/CameraConsole-Dg3lV-wq.js +52 -0
  263. package/dist/interface/ha/Cameras-DpM6gt3G.js +1970 -0
  264. package/dist/interface/ha/Camview-CO_bHntH.js +1331 -0
  265. package/dist/interface/ha/CertificateUpload-PS47Kgbg.js +117 -0
  266. package/dist/interface/ha/Config-D-cpocuH.js +356 -0
  267. package/dist/interface/ha/ConfigActionAssistant-DVVVfVvT.js +182 -0
  268. package/dist/interface/ha/ConfigActionCameraControl-BPpzE9-F.js +152 -0
  269. package/dist/interface/ha/ConfigActionDelay-zU6H75hY.js +61 -0
  270. package/dist/interface/ha/ConfigActionHttp-BsNy03j4.js +134 -0
  271. package/dist/interface/ha/ConfigActionImageInput-JUvNYn0w.js +171 -0
  272. package/dist/interface/ha/ConfigActionMqtt-PZqAKfTo.js +81 -0
  273. package/dist/interface/ha/ConfigActionNotification-DIL7abEm.js +199 -0
  274. package/dist/interface/ha/ConfigActionNotificationControl-BQ2w5yeg.js +111 -0
  275. package/dist/interface/ha/ConfigActionOutput-DVilKhPV.js +98 -0
  276. package/dist/interface/ha/ConfigActionPlugin-BUfTEJQ_.js +172 -0
  277. package/dist/interface/ha/ConfigActionSensor-Dzp16VyX.js +139 -0
  278. package/dist/interface/ha/ConfigActionSnapshot-CRjD5AMC.js +48 -0
  279. package/dist/interface/ha/ConfigActionVariable-CR8g7gEh.js +88 -0
  280. package/dist/interface/ha/ConfigConditionIfElse-CHoSgzXF.js +124 -0
  281. package/dist/interface/ha/ConfigConditionSensorState-Dn8_OhQe.js +192 -0
  282. package/dist/interface/ha/ConfigConditionSwitch-Ds-nqWeU.js +128 -0
  283. package/dist/interface/ha/ConfigConditionTime-DWNfEluj.js +95 -0
  284. package/dist/interface/ha/ConfigSensorValueInput-DwXM9wP1.js +170 -0
  285. package/dist/interface/ha/ConfigTriggerDetection-D37OkR_u.js +241 -0
  286. package/dist/interface/ha/ConfigTriggerGeofence-EbXy_y3Q.js +4888 -0
  287. package/dist/interface/ha/ConfigTriggerManual-B0DDQtoz.js +14 -0
  288. package/dist/interface/ha/ConfigTriggerMqtt-BX6uNEZy.js +134 -0
  289. package/dist/interface/ha/ConfigTriggerSchedule-_ThdB8Bb.js +72 -0
  290. package/dist/interface/ha/ConfigTriggerSensor-BFGEtBVF.js +73 -0
  291. package/dist/interface/ha/ConfigTriggerSystem-fRnAgUGR.js +192 -0
  292. package/dist/interface/ha/ConfigTriggerWebhook-DegifRdj.js +94 -0
  293. package/dist/interface/ha/Console-Bo6S5psN.js +348 -0
  294. package/dist/interface/ha/CuiAutomationRunsDialog-DXpNJqDE.js +130 -0
  295. package/dist/interface/ha/CuiBottomSheet-DLkC2OmT.js +270 -0
  296. package/dist/interface/ha/CuiCameraRecordings-9tdkxXiT.js +552 -0
  297. package/dist/interface/ha/CuiCameraShares-BbqY_2b7.js +121 -0
  298. package/dist/interface/ha/CuiCameraTable-BmH1yAgl.js +169 -0
  299. package/dist/interface/ha/CuiChartTable-BjBBI7Fo.js +6786 -0
  300. package/dist/interface/ha/CuiConsole-By3m4UbE.js +244 -0
  301. package/dist/interface/ha/CuiDataTable-C_ndu5My.js +8732 -0
  302. package/dist/interface/ha/CuiList-CU2NJ1K6.js +57 -0
  303. package/dist/interface/ha/CuiMarkdownContent-CrkZwv5j.js +4724 -0
  304. package/dist/interface/ha/CuiPluginCard-BLQ1galy.js +769 -0
  305. package/dist/interface/ha/CuiPluginOAuthButton-BDghklSy.js +79 -0
  306. package/dist/interface/ha/CuiPluginTrustBadge-DolANNao.js +123 -0
  307. package/dist/interface/ha/CuiQRCode-CcjPngXI.js +86 -0
  308. package/dist/interface/ha/CuiSchema-D9JFf0dp.js +963 -0
  309. package/dist/interface/ha/CuiTopNavbarItem-DcUEq-4e.js +141 -0
  310. package/dist/interface/ha/Faces-DjXHzr77.js +1282 -0
  311. package/dist/interface/ha/FirstSteps-CQAP9Siw.js +251 -0
  312. package/dist/interface/ha/Floorplan-DyaPzlQO.js +3657 -0
  313. package/dist/interface/ha/Instances-DWjaU5gj.js +680 -0
  314. package/dist/interface/ha/Logs-Dlx-X1NS.js +418 -0
  315. package/dist/interface/ha/Menu-iqEe01qO.js +156 -0
  316. package/dist/interface/ha/Metrics-Br2Dyvzh.js +1444 -0
  317. package/dist/interface/ha/OAuthDeviceFlow-CIGk92FD.js +112 -0
  318. package/dist/interface/ha/Plugin-DklIr7j2.js +1405 -0
  319. package/dist/interface/ha/PluginConsole-DCfxPtGU.js +56 -0
  320. package/dist/interface/ha/PluginDetail-BFfRnkdG.js +230 -0
  321. package/dist/interface/ha/PluginSearch-BTKBnjxb.js +462 -0
  322. package/dist/interface/ha/PluginUpdateProgress-Dej5AcCt.js +34 -0
  323. package/dist/interface/ha/Plugins-C2fONspm.js +692 -0
  324. package/dist/interface/ha/RecentEventsFilter-ylgjiDo8.js +79 -0
  325. package/dist/interface/ha/Recordings-w39I43cc.js +1498 -0
  326. package/dist/interface/ha/SensorEdit-BkKi1l-A.js +1462 -0
  327. package/dist/interface/ha/SensorHistory-BGJjMlc3.js +54 -0
  328. package/dist/interface/ha/Sensors-D_Wi9XPa.js +1386 -0
  329. package/dist/interface/ha/Settings-Bn7WLWf0.js +218 -0
  330. package/dist/interface/ha/SettingsAccount-CRTex-1j.js +971 -0
  331. package/dist/interface/ha/SettingsAppearance-B1qmJnYk.js +220 -0
  332. package/dist/interface/ha/SettingsAssistant-DDd1X0BC.js +1857 -0
  333. package/dist/interface/ha/SettingsBackup-DZbhSB13.js +556 -0
  334. package/dist/interface/ha/SettingsList-BQdyPe0H.js +40 -0
  335. package/dist/interface/ha/SettingsMqtt-CSZcY6ht.js +526 -0
  336. package/dist/interface/ha/SettingsNotifications-CfEhl0-y.js +529 -0
  337. package/dist/interface/ha/SettingsPermissions-Jh0FuIF7.js +84 -0
  338. package/dist/interface/ha/SettingsRecordings-BnAGDvcH.js +152 -0
  339. package/dist/interface/ha/SettingsRemote-w86TQVUA.js +1810 -0
  340. package/dist/interface/ha/SettingsSystem-CENjHL3k.js +376 -0
  341. package/dist/interface/ha/SettingsUsers-CqSHRklV.js +379 -0
  342. package/dist/interface/ha/Terminal-WsuxG3k-.js +617 -0
  343. package/dist/interface/ha/Training-hu_XOYBk.js +1505 -0
  344. package/dist/interface/ha/Updates-Dl_lLLR2.js +343 -0
  345. package/dist/interface/ha/VariableInput-C8Q81GUt.js +52 -0
  346. package/dist/interface/ha/VariableSuggestions-DXV2b7S4.js +201 -0
  347. package/dist/interface/ha/VersionsHandler-BOvjesvp.js +216 -0
  348. package/dist/interface/ha/VirtualSensorCreate-sgwATaky.js +101 -0
  349. package/dist/interface/ha/Workers-CkDuQ9NG.js +765 -0
  350. package/dist/interface/ha/accordion-Xem2SzgR.js +577 -0
  351. package/dist/interface/ha/account-DJh6O-cw.js +19 -0
  352. package/dist/interface/ha/alert-circle-C7oDe-WY.js +19 -0
  353. package/dist/interface/ha/alert-outline-FcLLjoOK.js +89 -0
  354. package/dist/interface/ha/api-BmYisoxj.js +62452 -0
  355. package/dist/interface/ha/api-oqpIZTkx.js +29 -0
  356. package/dist/interface/ha/arrow-left-OsxzW9Af.js +19 -0
  357. package/dist/interface/ha/assistant-0jE4C19U.js +345 -0
  358. package/dist/interface/ha/auth-B4Msg7R-.js +271 -0
  359. package/dist/interface/ha/autocomplete-B94Amei3.js +1373 -0
  360. package/dist/interface/ha/automationBlueprint-C-12Yjl7.js +250 -0
  361. package/dist/interface/ha/back-filled-CaxrZv0Q.js +20 -0
  362. package/dist/interface/ha/bell-ring-CBt11ejv.js +19 -0
  363. package/dist/interface/ha/brain-BiKXGva0.js +19 -0
  364. package/dist/interface/ha/button-BouAFgf5.js +406 -0
  365. package/dist/interface/ha/cameraui-cards.js +1 -1
  366. package/dist/interface/ha/cards-BrOcoiQJ.js +13352 -0
  367. package/dist/interface/ha/cctv-BD2g3nbO.js +19 -0
  368. package/dist/interface/ha/check-circle-B5OGJJIu.js +19 -0
  369. package/dist/interface/ha/check-circle-outline-DS7eEinv.js +19 -0
  370. package/dist/interface/ha/checkbox-CAKzZcqk.js +279 -0
  371. package/dist/interface/ha/chevron-down-BNj8w2js.js +19 -0
  372. package/dist/interface/ha/chevron-up-DDKj43BW.js +19 -0
  373. package/dist/interface/ha/chip-BTHURsTF.js +149 -0
  374. package/dist/interface/ha/clock-outline-DNStdM39.js +19 -0
  375. package/dist/interface/ha/close-CxFbonhd.js +19 -0
  376. package/dist/interface/ha/close-circle-DfYSNAKm.js +19 -0
  377. package/dist/interface/ha/cloud-check-aaxn1VZr.js +33 -0
  378. package/dist/interface/ha/config-IG56wp6m.js +116 -0
  379. package/dist/interface/ha/content-copy-CHPYjxRC.js +19 -0
  380. package/dist/interface/ha/copy-ApwNNqcL.js +22 -0
  381. package/dist/interface/ha/datepicker-B4Azs5zr.js +2961 -0
  382. package/dist/interface/ha/delete-DWdURc9X.js +19 -0
  383. package/dist/interface/ha/dist-C6MBHJhs.js +3251 -0
  384. package/dist/interface/ha/divider-DeFEXTGs.js +110 -0
  385. package/dist/interface/ha/dots-vertical-B0dv1-jL.js +19 -0
  386. package/dist/interface/ha/download-B64w9GvF.js +19 -0
  387. package/dist/interface/ha/eventIcons-BFNUgeGr.js +676 -0
  388. package/dist/interface/ha/eye-off-UG_p9nl8.js +33 -0
  389. package/dist/interface/ha/eye-off-outline-ACbzsGuK.js +19 -0
  390. package/dist/interface/ha/help-circle-outline-BniRuJRv.js +19 -0
  391. package/dist/interface/ha/history-XMyO_cLc.js +19 -0
  392. package/dist/interface/ha/home-36M6iydk.js +19 -0
  393. package/dist/interface/ha/information-outline-DSSRyysT.js +19 -0
  394. package/dist/interface/ha/inputicon-1w06U-Jl.js +324 -0
  395. package/dist/interface/ha/inputnumber-DZRwKgXr.js +1033 -0
  396. package/dist/interface/ha/inputtext-C_ygnPrC.js +257 -0
  397. package/dist/interface/ha/intercomService-B7HkLs6z.js +1414 -0
  398. package/dist/interface/ha/message-D6dIy_hz.js +244 -0
  399. package/dist/interface/ha/microphone-C4oQPpzp.js +19 -0
  400. package/dist/interface/ha/minus-Bp1AYyQv.js +46 -0
  401. package/dist/interface/ha/minus-D3V6azhV.js +19 -0
  402. package/dist/interface/ha/mqtt-pl13wSmG.js +56 -0
  403. package/dist/interface/ha/multiselect-Dp4XDBRR.js +1492 -0
  404. package/dist/interface/ha/notifications-B6wxSmou.js +159 -0
  405. package/dist/interface/ha/pause-BbFQ0FqK.js +19 -0
  406. package/dist/interface/ha/pencil-outline-SN9ingm5.js +19 -0
  407. package/dist/interface/ha/pinia-C6gt7A_Q.js +7641 -0
  408. package/dist/interface/ha/plugins-BwwaWxye.js +592 -0
  409. package/dist/interface/ha/plus-CgxY7W0L.js +19 -0
  410. package/dist/interface/ha/plus-brDoEzN2.js +46 -0
  411. package/dist/interface/ha/progressbar-CaUaM8Bt.js +95 -0
  412. package/dist/interface/ha/protocol-BB4jdtUC-DW3jl2tV.js +708 -0
  413. package/dist/interface/ha/radar-BG-Tcwg_.js +19 -0
  414. package/dist/interface/ha/refresh-CpjKkasY.js +19 -0
  415. package/dist/interface/ha/restore-BxzmXRET.js +19 -0
  416. package/dist/interface/ha/ring-resize-Dr2PxWIg.js +16 -0
  417. package/dist/interface/ha/ripple-ZDATPc2w.js +2928 -0
  418. package/dist/interface/ha/rooms-NIzjFYAd.js +45 -0
  419. package/dist/interface/ha/round-alt-arrow-left-bold-DDy2dLUM.js +37 -0
  420. package/dist/interface/ha/runtime-core.esm-bundler-_TfE0DWz.js +3306 -0
  421. package/dist/interface/ha/search-BViwEHdF.js +19 -0
  422. package/dist/interface/ha/select-UR3ZRDew.js +1382 -0
  423. package/dist/interface/ha/server-YOLwDVAW.js +239 -0
  424. package/dist/interface/ha/settings-lWJfHaif.js +22 -0
  425. package/dist/interface/ha/source-branch-C2kcmBcO.js +19 -0
  426. package/dist/interface/ha/speeddial-LCbl5g8p.js +682 -0
  427. package/dist/interface/ha/spinner-DIILjDT9.js +46 -0
  428. package/dist/interface/ha/tag-mchuCAPR.js +95 -0
  429. package/dist/interface/ha/textarea-ByXnzJzx.js +130 -0
  430. package/dist/interface/ha/tooltip-Z7VN-E1u.js +277 -0
  431. package/dist/interface/ha/trash-2-pgydLlch.js +23 -0
  432. package/dist/interface/ha/trash-can-outline-CBwv40Ck.js +19 -0
  433. package/dist/interface/ha/trash-fill-TFkvFuRj.js +21 -0
  434. package/dist/interface/ha/types-B8B9MqK0.js +1062 -0
  435. package/dist/interface/ha/types-XqA3YJPD.js +123 -0
  436. package/dist/interface/ha/ungrouped-DttNEB62.js +1320 -0
  437. package/dist/interface/ha/updates-DVhiQhMM.js +341 -0
  438. package/dist/interface/ha/upload-B-9Mumdm.js +19 -0
  439. package/dist/interface/ha/upload-BF0iIQFa.js +23 -0
  440. package/dist/interface/ha/useAppVersion-CG4D44Aa.js +22 -0
  441. package/dist/interface/ha/useAssistantActions-S1FrNe9b.js +29 -0
  442. package/dist/interface/ha/useLogsSocket-PKsRDttg.js +59 -0
  443. package/dist/interface/ha/useNavLayout-DoEcPx9Z.js +125 -0
  444. package/dist/interface/ha/usePermissions-DaE_wFch.js +72 -0
  445. package/dist/interface/ha/useServerRestart-CMl589qX.js +23 -0
  446. package/dist/interface/ha/useTabSwipe-Cmqdn0J5.js +45 -0
  447. package/dist/interface/ha/useUpdateChannel-BBW2EX7N.js +22 -0
  448. package/dist/interface/ha/useUpdatesSocket-B6ICpKKC.js +34 -0
  449. package/dist/interface/ha/useUserOptions-CzclRfar.js +15 -0
  450. package/dist/interface/ha/virtualscroller-C5j7FXj4.js +996 -0
  451. package/dist/interface/ha/vue-flow-background-8ZUqhPBF.js +6835 -0
  452. package/dist/interface/ha/vue-i18n-D5EAy78K.js +2422 -0
  453. package/dist/interface/ha/zoom-in-BCxZo2jC.js +41 -0
  454. package/dist/interface/index.html +68 -68
  455. package/dist/interface/sw.js +1 -1
  456. package/dist/server/package.json +16 -16
  457. package/dist/server/requirements.txt +2 -2
  458. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/camera/streaming.py +4 -0
  459. package/dist/server/src/api/controllers/cameras.controller.d.ts +1 -1
  460. package/dist/server/src/api/controllers/cameras.controller.js +5 -1
  461. package/dist/server/src/api/controllers/cameras.controller.js.map +1 -1
  462. package/dist/server/src/api/controllers/shares.controller.js +2 -2
  463. package/dist/server/src/api/controllers/shares.controller.js.map +1 -1
  464. package/dist/server/src/api/services/cameras.service.d.ts +1 -0
  465. package/dist/server/src/api/services/cameras.service.js +21 -20
  466. package/dist/server/src/api/services/cameras.service.js.map +1 -1
  467. package/dist/server/src/api/services/shares.service.d.ts +4 -2
  468. package/dist/server/src/api/services/shares.service.js +9 -11
  469. package/dist/server/src/api/services/shares.service.js.map +1 -1
  470. package/dist/server/src/api/websocket/nsp/main.d.ts +7 -2
  471. package/dist/server/src/api/websocket/nsp/main.js +38 -18
  472. package/dist/server/src/api/websocket/nsp/main.js.map +1 -1
  473. package/dist/server/src/api/websocket/nsp/metrics.d.ts +4 -0
  474. package/dist/server/src/api/websocket/nsp/metrics.js +33 -0
  475. package/dist/server/src/api/websocket/nsp/metrics.js.map +1 -1
  476. package/dist/server/src/api/websocket/types.d.ts +9 -0
  477. package/dist/server/src/assistant/tools/system.js +6 -9
  478. package/dist/server/src/assistant/tools/system.js.map +1 -1
  479. package/dist/server/src/camera/controller.d.ts +7 -3
  480. package/dist/server/src/camera/controller.js +88 -68
  481. package/dist/server/src/camera/controller.js.map +1 -1
  482. package/dist/server/src/camera/utils.d.ts +5 -4
  483. package/dist/server/src/camera/utils.js +69 -307
  484. package/dist/server/src/camera/utils.js.map +1 -1
  485. package/dist/server/src/go2rtc/api/routes/streams.d.ts +1 -2
  486. package/dist/server/src/go2rtc/api/routes/streams.js +0 -7
  487. package/dist/server/src/go2rtc/api/routes/streams.js.map +1 -1
  488. package/dist/server/src/go2rtc/index.js +2 -0
  489. package/dist/server/src/go2rtc/index.js.map +1 -1
  490. package/dist/server/src/go2rtc/state.d.ts +66 -0
  491. package/dist/server/src/go2rtc/state.js +194 -0
  492. package/dist/server/src/go2rtc/state.js.map +1 -0
  493. package/dist/server/src/go2rtc/stream-rates.d.ts +12 -0
  494. package/dist/server/src/go2rtc/stream-rates.js +44 -0
  495. package/dist/server/src/go2rtc/stream-rates.js.map +1 -0
  496. package/dist/server/src/go2rtc/types.d.ts +23 -0
  497. package/dist/server/src/go2rtc/types.js.map +1 -1
  498. package/dist/server/src/main.d.ts +1 -0
  499. package/dist/server/src/main.js +3 -0
  500. package/dist/server/src/main.js.map +1 -1
  501. package/package.json +16 -16
  502. package/dist/interface/assets/404-6ZpTZ3KD.js +0 -1
  503. package/dist/interface/assets/About-DNvcZ3EY.js +0 -1
  504. package/dist/interface/assets/Assistant-kFFjOesz.js +0 -1
  505. package/dist/interface/assets/Automation-DPH-VMGf.js +0 -3
  506. package/dist/interface/assets/AutomationImport-Db74ZBgg.js +0 -2
  507. package/dist/interface/assets/AutomationStore-CFnapdvO.js +0 -2
  508. package/dist/interface/assets/AutomationStoreDetail-BCmfVMtC.js +0 -2
  509. package/dist/interface/assets/Automations-D41at64b.js +0 -2
  510. package/dist/interface/assets/Camera-BhFx-a1S.js +0 -2
  511. package/dist/interface/assets/CameraConsole-C89mOigo.js +0 -7
  512. package/dist/interface/assets/Cameras-TiX75P_R.js +0 -651
  513. package/dist/interface/assets/Camview-Bs3Ze0VB.js +0 -1
  514. package/dist/interface/assets/CertificateUpload-DBfJBo-w.js +0 -1
  515. package/dist/interface/assets/Config-CiCqmjhC.js +0 -2
  516. package/dist/interface/assets/ConfigActionAssistant-DCW9F-o_.js +0 -1
  517. package/dist/interface/assets/ConfigActionCameraControl-V170tTXG.js +0 -1
  518. package/dist/interface/assets/ConfigActionDelay-D1CZOls9.js +0 -1
  519. package/dist/interface/assets/ConfigActionHttp-ZOsjh7jZ.js +0 -1
  520. package/dist/interface/assets/ConfigActionImageInput-Dq5NtDno.js +0 -1
  521. package/dist/interface/assets/ConfigActionMqtt-Cyk0f9mh.js +0 -1
  522. package/dist/interface/assets/ConfigActionNotification-Ca6IygV-.js +0 -1
  523. package/dist/interface/assets/ConfigActionNotificationControl-CCiWBmJq.js +0 -1
  524. package/dist/interface/assets/ConfigActionOutput-B4zPAsNS.js +0 -1
  525. package/dist/interface/assets/ConfigActionPlugin-C25suoOA.js +0 -1
  526. package/dist/interface/assets/ConfigActionSensor-CgIBk5qS.js +0 -1
  527. package/dist/interface/assets/ConfigActionSnapshot-Dj4_bcR-.js +0 -1
  528. package/dist/interface/assets/ConfigActionVariable-CDlIj4Ji.js +0 -1
  529. package/dist/interface/assets/ConfigConditionIfElse-B9Q2pZxM.js +0 -1
  530. package/dist/interface/assets/ConfigConditionSensorState-DrOBPrDB.js +0 -1
  531. package/dist/interface/assets/ConfigConditionSwitch-BdfA75Z4.js +0 -1
  532. package/dist/interface/assets/ConfigConditionTime-CCpFkanY.js +0 -1
  533. package/dist/interface/assets/ConfigSensorValueInput-B7Qc06SA.js +0 -1
  534. package/dist/interface/assets/ConfigTriggerDetection-QOLhT23F.js +0 -1
  535. package/dist/interface/assets/ConfigTriggerGeofence-HUhmtzd_.js +0 -1
  536. package/dist/interface/assets/ConfigTriggerManual-Bpyy9Jzz.js +0 -1
  537. package/dist/interface/assets/ConfigTriggerMqtt-wxB4LtkP.js +0 -1
  538. package/dist/interface/assets/ConfigTriggerSchedule-D7X5Oa5t.js +0 -1
  539. package/dist/interface/assets/ConfigTriggerSensor-DM7qewdx.js +0 -1
  540. package/dist/interface/assets/ConfigTriggerSystem-CK573JKn.js +0 -1
  541. package/dist/interface/assets/ConfigTriggerWebhook-yoouSRHG.js +0 -1
  542. package/dist/interface/assets/Console-BCL2lVJv.js +0 -1
  543. package/dist/interface/assets/CuiAssistantConversation-BmjsGo2l.js +0 -5
  544. package/dist/interface/assets/CuiAutomationRunsDialog-BFZjtF9o.js +0 -1
  545. package/dist/interface/assets/CuiBottomSheet-CVHz2Vrq.js +0 -1
  546. package/dist/interface/assets/CuiBottomSheet-DLtu4FrC.js +0 -1
  547. package/dist/interface/assets/CuiCameraPipCard-BGZQsVHc.js +0 -1
  548. package/dist/interface/assets/CuiCameraRecordings-5pcLjdf8.js +0 -1
  549. package/dist/interface/assets/CuiCameraShares-CNNvqXns.js +0 -1
  550. package/dist/interface/assets/CuiCameraTable-BDN5NGr2.js +0 -1
  551. package/dist/interface/assets/CuiCameraTable-DF_IOFyD.js +0 -2
  552. package/dist/interface/assets/CuiChartTable-rOLdUaOa.js +0 -1
  553. package/dist/interface/assets/CuiConsole-B75tQO-y.js +0 -5
  554. package/dist/interface/assets/CuiDataTable-C8ZywwaZ.js +0 -1
  555. package/dist/interface/assets/CuiLightControl-D6PaG8aL.js +0 -1
  556. package/dist/interface/assets/CuiList-B8wJe291.js +0 -1
  557. package/dist/interface/assets/CuiMarkdownContent-D-S1LZy3.js +0 -1
  558. package/dist/interface/assets/CuiMarkdownContent-yHrnDzQd.js +0 -1
  559. package/dist/interface/assets/CuiPluginCard-aGMkvpeM.js +0 -2
  560. package/dist/interface/assets/CuiPluginCategoryChip-BCgADU71.js +0 -1
  561. package/dist/interface/assets/CuiPluginOAuthButton-mrm1vDAP.js +0 -2
  562. package/dist/interface/assets/CuiPluginTrustBadge-J3818in1.js +0 -1
  563. package/dist/interface/assets/CuiQRCode-Dv4w0udN.js +0 -1
  564. package/dist/interface/assets/CuiSchema-Cn5geGt7.js +0 -1
  565. package/dist/interface/assets/CuiTopNavbarItem-cP_SiDnw.js +0 -1
  566. package/dist/interface/assets/Faces-b611-5Ep.js +0 -1
  567. package/dist/interface/assets/FirstSteps-DcVdjoXr.js +0 -1
  568. package/dist/interface/assets/Floorplan-CZu7D3L2.js +0 -1
  569. package/dist/interface/assets/Instances-BGM2M_vr.js +0 -1
  570. package/dist/interface/assets/Logs-BXDALPw6.js +0 -6
  571. package/dist/interface/assets/Menu-DV63hDK5.js +0 -1
  572. package/dist/interface/assets/Metrics-CrojTUIw.js +0 -9
  573. package/dist/interface/assets/Metrics-Ebv4qK2a.css +0 -1
  574. package/dist/interface/assets/OAuthDeviceFlow-E2q5BNUN.js +0 -1
  575. package/dist/interface/assets/Plugin-BFovKMPD.js +0 -1
  576. package/dist/interface/assets/PluginConsole-BLG5Srww.js +0 -7
  577. package/dist/interface/assets/PluginDetail-Dghf_z9y.js +0 -2
  578. package/dist/interface/assets/PluginSchema-C3u0PCYu.js +0 -1
  579. package/dist/interface/assets/PluginSearch-DQb6r45_.js +0 -1
  580. package/dist/interface/assets/PluginSearch-XaJOsyFA.js +0 -2
  581. package/dist/interface/assets/PluginUpdateProgress-tMIWjHFs.js +0 -1
  582. package/dist/interface/assets/Plugins-DgKXf65s.js +0 -1
  583. package/dist/interface/assets/RecentEventsFilter-DlzWA8QR.js +0 -1
  584. package/dist/interface/assets/Recordings-DC47F4WC.js +0 -1
  585. package/dist/interface/assets/SensorEdit-BDeJ0tjj.js +0 -1
  586. package/dist/interface/assets/SensorHistory-C8oPVJEX.js +0 -1
  587. package/dist/interface/assets/Sensors-C29BBaNa.js +0 -2
  588. package/dist/interface/assets/Settings-bn3Pokuq.js +0 -1
  589. package/dist/interface/assets/SettingsAccount-B-SSNfmo.js +0 -1
  590. package/dist/interface/assets/SettingsAccount-BXClgcHw.js +0 -1
  591. package/dist/interface/assets/SettingsAppearance-1KCm8sJO.js +0 -1
  592. package/dist/interface/assets/SettingsAppearance-C5rHbPxY.js +0 -1
  593. package/dist/interface/assets/SettingsAssistant-ndgpk0jF.js +0 -1
  594. package/dist/interface/assets/SettingsBackup-Cw0OoGGY.js +0 -1
  595. package/dist/interface/assets/SettingsList--FB27rY6.js +0 -1
  596. package/dist/interface/assets/SettingsMqtt-DrHwxyfj.js +0 -1
  597. package/dist/interface/assets/SettingsNotifications-CHFxYyBM.js +0 -1
  598. package/dist/interface/assets/SettingsPermissions-CtR3k4N9.js +0 -1
  599. package/dist/interface/assets/SettingsRecordings-YTMBWiO2.js +0 -1
  600. package/dist/interface/assets/SettingsRemote-DTZo7Tnk.js +0 -2
  601. package/dist/interface/assets/SettingsSystem-C9L3_BPg.js +0 -2
  602. package/dist/interface/assets/SettingsUsers-BK6d7cMj.js +0 -1
  603. package/dist/interface/assets/Terminal-DWa4f8GL.js +0 -4
  604. package/dist/interface/assets/Training-BsgWYOlp.js +0 -1
  605. package/dist/interface/assets/Updates-CSvohiVI.js +0 -2
  606. package/dist/interface/assets/VariableInput-CiWT5dul.js +0 -1
  607. package/dist/interface/assets/VariableSuggestions-pbXYBWuw.js +0 -1
  608. package/dist/interface/assets/VersionsHandler-BE-YNUTe.js +0 -7
  609. package/dist/interface/assets/VirtualSensorCreate-Ba4XwvcD.js +0 -1
  610. package/dist/interface/assets/Workers-BtHqRqzx.js +0 -2
  611. package/dist/interface/assets/account-BxoX10XU.js +0 -1
  612. package/dist/interface/assets/alert-circle-pr3uC6jZ.js +0 -1
  613. package/dist/interface/assets/alert-outline-DHaYL1DY.js +0 -1
  614. package/dist/interface/assets/api--1J-SAjn.js +0 -1
  615. package/dist/interface/assets/api-C7-TgfI0.js +0 -4
  616. package/dist/interface/assets/api-DcaDMCnj.css +0 -2
  617. package/dist/interface/assets/arrow-left-5ht64ZGB.js +0 -1
  618. package/dist/interface/assets/assistant-Cl_fhAuJ.js +0 -1
  619. package/dist/interface/assets/assistantModels-DPcZCyld.js +0 -1
  620. package/dist/interface/assets/auth-CbzQl7TC.js +0 -1
  621. package/dist/interface/assets/automations-tJ_M8mwQ.js +0 -1
  622. package/dist/interface/assets/back-filled-BncmhmK7.js +0 -1
  623. package/dist/interface/assets/bell-ring-BrHmFuCb.js +0 -1
  624. package/dist/interface/assets/brain-DbFpT7Cq.js +0 -1
  625. package/dist/interface/assets/cameraSources-BoPq2cHU.js +0 -1
  626. package/dist/interface/assets/cctv-DO-BmfXS.js +0 -1
  627. package/dist/interface/assets/check-circle-DefdZO6b.js +0 -1
  628. package/dist/interface/assets/check-circle-outline-DLeND8yu.js +0 -1
  629. package/dist/interface/assets/chevron-down-COQqnpYB.js +0 -1
  630. package/dist/interface/assets/chevron-up-D1Xd7VoH.js +0 -1
  631. package/dist/interface/assets/clock-outline-DLIhBBQh.js +0 -1
  632. package/dist/interface/assets/close-C_pY8d5W.js +0 -1
  633. package/dist/interface/assets/close-circle-CUM5zI7N.js +0 -1
  634. package/dist/interface/assets/cloud-check-CqURJGod.js +0 -1
  635. package/dist/interface/assets/cloudHandoff-U-ME7kxo.js +0 -1
  636. package/dist/interface/assets/config-ConCokYZ.js +0 -1
  637. package/dist/interface/assets/content-copy-M0zk9eVL.js +0 -1
  638. package/dist/interface/assets/copy-DbP_BYcc.js +0 -1
  639. package/dist/interface/assets/cube-scan-DUOB_hmY.js +0 -1
  640. package/dist/interface/assets/delete-rtnOkwr8.js +0 -1
  641. package/dist/interface/assets/dist-Ce8wBKXN.js +0 -1
  642. package/dist/interface/assets/dots-vertical-BBZiQrJI.js +0 -1
  643. package/dist/interface/assets/download-CV7ETeuV.js +0 -1
  644. package/dist/interface/assets/esm-B0uV7sCS.js +0 -1
  645. package/dist/interface/assets/esm-B2yI2eHV.js +0 -1
  646. package/dist/interface/assets/esm-BGznyI26.js +0 -1
  647. package/dist/interface/assets/esm-BU06bvS2.js +0 -1
  648. package/dist/interface/assets/esm-CDZvvPo-.js +0 -1
  649. package/dist/interface/assets/esm-CQhKa6pe.js +0 -1
  650. package/dist/interface/assets/esm-C_cunepi.js +0 -1
  651. package/dist/interface/assets/esm-D7Wl3e71.js +0 -1
  652. package/dist/interface/assets/esm-DF51BosK.js +0 -1
  653. package/dist/interface/assets/esm-DGnwYAQM.js +0 -1
  654. package/dist/interface/assets/esm-DOPi7vcu.js +0 -1
  655. package/dist/interface/assets/esm-DhUjXDgk.js +0 -1
  656. package/dist/interface/assets/esm-Dy2zOjxI.js +0 -1
  657. package/dist/interface/assets/esm-kUcKqIWx.js +0 -1
  658. package/dist/interface/assets/eventIcons-CCFi3Fbj.js +0 -1
  659. package/dist/interface/assets/eye-off-CvhN3zxZ.js +0 -1
  660. package/dist/interface/assets/eye-off-outline-CCqCZfJ6.js +0 -1
  661. package/dist/interface/assets/flowSchema-CmXSZKQe.js +0 -1
  662. package/dist/interface/assets/help-circle-outline-CQl2D4oN.js +0 -1
  663. package/dist/interface/assets/history-BXFIMe6V.js +0 -1
  664. package/dist/interface/assets/home-D7fG7atW.js +0 -1
  665. package/dist/interface/assets/information-outline-1WzSLz5m.js +0 -1
  666. package/dist/interface/assets/intercomService-DyUZK0Im.js +0 -1
  667. package/dist/interface/assets/lan-CbNzy3jQ.js +0 -1
  668. package/dist/interface/assets/main-D4ZrTpOr.js +0 -3
  669. package/dist/interface/assets/microphone-CRLenDoX.js +0 -1
  670. package/dist/interface/assets/minus-COYpQ3vD.js +0 -1
  671. package/dist/interface/assets/mqtt-C_RLsZgN.js +0 -1
  672. package/dist/interface/assets/native-Chu05rXa.js +0 -1
  673. package/dist/interface/assets/native-DtAgV_35.js +0 -1
  674. package/dist/interface/assets/nodeDefinitions-DgM5EMJ0.js +0 -1
  675. package/dist/interface/assets/notifications-B8VdKX2U.js +0 -1
  676. package/dist/interface/assets/pause-DvYzloru.js +0 -1
  677. package/dist/interface/assets/pencil-Cd5KnMGq.js +0 -1
  678. package/dist/interface/assets/pencil-outline-BiVfpCP6.js +0 -1
  679. package/dist/interface/assets/plugin-CWPz0s-n.js +0 -1
  680. package/dist/interface/assets/plugins-CqWe1lUn.js +0 -1
  681. package/dist/interface/assets/plus-CjwCt143.js +0 -1
  682. package/dist/interface/assets/plus-IEiNd6x0.js +0 -1
  683. package/dist/interface/assets/power-C4NWLKUx.js +0 -1
  684. package/dist/interface/assets/radar-DBqhxkLO.js +0 -1
  685. package/dist/interface/assets/refresh-DBLQ62l4.js +0 -1
  686. package/dist/interface/assets/restore-mXNfiEUq.js +0 -1
  687. package/dist/interface/assets/ring-resize-DrTdJJZT.js +0 -1
  688. package/dist/interface/assets/rooms-CIxV7WRD.js +0 -1
  689. package/dist/interface/assets/round-alt-arrow-left-bold-BlJgH1Gs.js +0 -1
  690. package/dist/interface/assets/search-CGxnUtuo.js +0 -1
  691. package/dist/interface/assets/sensorIcons-CtsJEtFd.js +0 -1
  692. package/dist/interface/assets/sensorSlots-B0rJeEuw.js +0 -1
  693. package/dist/interface/assets/sensors-CyseZmxe.js +0 -1
  694. package/dist/interface/assets/server-BvOtzDbz.js +0 -1
  695. package/dist/interface/assets/settings-wlG-pPuL.js +0 -1
  696. package/dist/interface/assets/source-branch-AyOkkO8S.js +0 -1
  697. package/dist/interface/assets/theme-CqKA1ClW.js +0 -1
  698. package/dist/interface/assets/trash-2-BKLI42HM.js +0 -1
  699. package/dist/interface/assets/trash-can-outline-BFiV5RfR.js +0 -1
  700. package/dist/interface/assets/trash-fill-hfLSPgsP.js +0 -1
  701. package/dist/interface/assets/trash2-lr9UJJWi.js +0 -1
  702. package/dist/interface/assets/types-48CQutaE.js +0 -1
  703. package/dist/interface/assets/types-BRmIeoRR.js +0 -1
  704. package/dist/interface/assets/types-BlFbLEIJ.js +0 -1
  705. package/dist/interface/assets/undo-nleJllpv.js +0 -1
  706. package/dist/interface/assets/ungrouped-D4Eyspkn.js +0 -1
  707. package/dist/interface/assets/updates-iwZh9X-d.js +0 -1
  708. package/dist/interface/assets/upload-1FIs_qFI.js +0 -1
  709. package/dist/interface/assets/upload-BOBHxpZk.js +0 -1
  710. package/dist/interface/assets/useAppVersion-m7hrV2QZ.js +0 -1
  711. package/dist/interface/assets/useAssistantActions-BY-FVxFl.js +0 -1
  712. package/dist/interface/assets/useBackupRestore-BJSrIE1j.js +0 -1
  713. package/dist/interface/assets/useCameraOptions-U3cPq_8f.js +0 -1
  714. package/dist/interface/assets/useKeyboardInset-Ce6esuI4.js +0 -1
  715. package/dist/interface/assets/useLogsSocket-BprgpXs0.js +0 -1
  716. package/dist/interface/assets/useNavLayout-DKsBYcN-.js +0 -1
  717. package/dist/interface/assets/usePermissions-MJCC2mYf.js +0 -1
  718. package/dist/interface/assets/usePluginUpdates-DaoikUxc.js +0 -1
  719. package/dist/interface/assets/usePushRegistration-MBn4GqtF.js +0 -2
  720. package/dist/interface/assets/useServerRestart-_gMUanhL.js +0 -1
  721. package/dist/interface/assets/useStreamStatus-C1aDump3.js +0 -1
  722. package/dist/interface/assets/useTabSwipe-SnHqt6pf.js +0 -1
  723. package/dist/interface/assets/useUpdateChannel-BpYMuseR.js +0 -1
  724. package/dist/interface/assets/useUpdatesSocket-8rAwSOk0.js +0 -1
  725. package/dist/interface/assets/useUserOptions-BWz8j6Bt.js +0 -1
  726. package/dist/interface/assets/variable-BH_88zve.js +0 -1
  727. package/dist/interface/assets/vendor-CFZm55ei.js +0 -23
  728. package/dist/interface/assets/vendor-cameraui-DTALowLr.js +0 -2326
  729. package/dist/interface/assets/vendor-capacitor-NUBkdqQG.js +0 -2
  730. package/dist/interface/assets/vendor-chart-BQ9z8Beo.js +0 -3
  731. package/dist/interface/assets/vendor-core-DF66V0xE.js +0 -1
  732. package/dist/interface/assets/vendor-dnd-55LKiquc.js +0 -2
  733. package/dist/interface/assets/vendor-draggabilly-C2H7F3yh.js +0 -1
  734. package/dist/interface/assets/vendor-markdown-CvrBrdq-.js +0 -14
  735. package/dist/interface/assets/vendor-primevue-CpTHHdUJ.js +0 -3942
  736. package/dist/interface/assets/vendor-vueflow-DGnDS4SG.js +0 -26
  737. package/dist/interface/assets/web-1T-T_0WZ.js +0 -1
  738. package/dist/interface/assets/web-62WbTjlc.js +0 -1
  739. package/dist/interface/assets/web-BjKL51lK-6pj2Scsz.js +0 -1
  740. package/dist/interface/assets/web-BtY56waW.js +0 -1
  741. package/dist/interface/assets/web-Bv7Xkik0.js +0 -1
  742. package/dist/interface/assets/web-BvBEXTJW.js +0 -1
  743. package/dist/interface/assets/web-CFeS7fH5.js +0 -1
  744. package/dist/interface/assets/web-CUtMdd2B.js +0 -1
  745. package/dist/interface/assets/web-D6yoMUkZ.js +0 -1
  746. package/dist/interface/assets/web-DIOYyMNl.js +0 -1
  747. package/dist/interface/assets/web-D_hRP2qx.js +0 -1
  748. package/dist/interface/assets/web-DsY8tWI-.js +0 -1
  749. package/dist/interface/assets/web-DvetlpoV.js +0 -1
  750. package/dist/interface/assets/web-kt-Rh6Kp.js +0 -1
  751. package/dist/interface/assets/webhook-JRvzS9ld.js +0 -1
  752. package/dist/interface/assets/workbox-window.prod.es5-Bd3XD_Q4.js +0 -1
  753. package/dist/interface/assets/zoom-in-CWYu7bwA.js +0 -1
  754. package/dist/interface/ha/404-m6-uXJZq.js +0 -60
  755. package/dist/interface/ha/About-CNVuMwKe.js +0 -55
  756. package/dist/interface/ha/Assistant-C8ffhO3m.js +0 -9107
  757. package/dist/interface/ha/Automation-C6tJrgcC.js +0 -2025
  758. package/dist/interface/ha/AutomationImport-DH1bdVRV.js +0 -206
  759. package/dist/interface/ha/AutomationStore-Ckn6ExG6.js +0 -336
  760. package/dist/interface/ha/AutomationStoreDetail-BDXaoPzo.js +0 -122
  761. package/dist/interface/ha/Automations-B5uu-r94.js +0 -424
  762. package/dist/interface/ha/Camera-B4CwxT3A.js +0 -654
  763. package/dist/interface/ha/CameraConsole-BzaY7lMs.js +0 -52
  764. package/dist/interface/ha/Cameras-B1vU95xU.js +0 -1970
  765. package/dist/interface/ha/Camview-BcgBR-RV.js +0 -1331
  766. package/dist/interface/ha/CertificateUpload-BqyveJeF.js +0 -117
  767. package/dist/interface/ha/Config-C81MLCdk.js +0 -356
  768. package/dist/interface/ha/ConfigActionAssistant-DQfehzH6.js +0 -182
  769. package/dist/interface/ha/ConfigActionCameraControl-C3MnsSHv.js +0 -152
  770. package/dist/interface/ha/ConfigActionDelay-CQDVG521.js +0 -61
  771. package/dist/interface/ha/ConfigActionHttp-VqM0i3cV.js +0 -134
  772. package/dist/interface/ha/ConfigActionImageInput-D7Maj3R-.js +0 -171
  773. package/dist/interface/ha/ConfigActionMqtt-Cm51kwWp.js +0 -81
  774. package/dist/interface/ha/ConfigActionNotification-L5oaXgIQ.js +0 -199
  775. package/dist/interface/ha/ConfigActionNotificationControl-DUa2iWvF.js +0 -111
  776. package/dist/interface/ha/ConfigActionOutput-6e9FLeyi.js +0 -98
  777. package/dist/interface/ha/ConfigActionPlugin-DfWMHSOu.js +0 -172
  778. package/dist/interface/ha/ConfigActionSensor-KMyKW8a4.js +0 -139
  779. package/dist/interface/ha/ConfigActionSnapshot-BXUyBDrZ.js +0 -48
  780. package/dist/interface/ha/ConfigActionVariable-5gjlEinD.js +0 -88
  781. package/dist/interface/ha/ConfigConditionIfElse-KVINr4wM.js +0 -124
  782. package/dist/interface/ha/ConfigConditionSensorState-DfA7Z-rZ.js +0 -192
  783. package/dist/interface/ha/ConfigConditionSwitch-MMBCtsCG.js +0 -128
  784. package/dist/interface/ha/ConfigConditionTime-BFHFgE8n.js +0 -95
  785. package/dist/interface/ha/ConfigSensorValueInput-BGPONs-v.js +0 -170
  786. package/dist/interface/ha/ConfigTriggerDetection-Bl5RLc9-.js +0 -241
  787. package/dist/interface/ha/ConfigTriggerGeofence-C2P-lZvJ.js +0 -4888
  788. package/dist/interface/ha/ConfigTriggerManual-BHrZRxUA.js +0 -14
  789. package/dist/interface/ha/ConfigTriggerMqtt-DxE9E_We.js +0 -134
  790. package/dist/interface/ha/ConfigTriggerSchedule-DBaslXZn.js +0 -72
  791. package/dist/interface/ha/ConfigTriggerSensor-BW6R5G1E.js +0 -73
  792. package/dist/interface/ha/ConfigTriggerSystem-WTcomTVB.js +0 -192
  793. package/dist/interface/ha/ConfigTriggerWebhook-BuweCREC.js +0 -94
  794. package/dist/interface/ha/Console--3yf5q4a.js +0 -348
  795. package/dist/interface/ha/CuiAutomationRunsDialog-Bjx5DXXc.js +0 -130
  796. package/dist/interface/ha/CuiBottomSheet-CUWIERuK.js +0 -270
  797. package/dist/interface/ha/CuiCameraRecordings-DDBEVW_L.js +0 -552
  798. package/dist/interface/ha/CuiCameraShares-BaPKNvSs.js +0 -121
  799. package/dist/interface/ha/CuiCameraTable-CA7TQUBj.js +0 -153
  800. package/dist/interface/ha/CuiChartTable-Cjck-ymw.js +0 -6786
  801. package/dist/interface/ha/CuiConsole-4y2SrBqu.js +0 -244
  802. package/dist/interface/ha/CuiDataTable-3tEK7pxb.js +0 -8732
  803. package/dist/interface/ha/CuiList-1RbiYIWw.js +0 -57
  804. package/dist/interface/ha/CuiMarkdownContent-CU4eGw6l.js +0 -4724
  805. package/dist/interface/ha/CuiPluginCard-BfRbo1oT.js +0 -769
  806. package/dist/interface/ha/CuiPluginOAuthButton-DcZ5KJTX.js +0 -79
  807. package/dist/interface/ha/CuiPluginTrustBadge-DG9TJtBN.js +0 -123
  808. package/dist/interface/ha/CuiQRCode-D_pWqA6W.js +0 -86
  809. package/dist/interface/ha/CuiSchema-BYnQRNtd.js +0 -963
  810. package/dist/interface/ha/CuiTopNavbarItem-BLPX9F5P.js +0 -141
  811. package/dist/interface/ha/Faces-Do8dklvm.js +0 -1282
  812. package/dist/interface/ha/FirstSteps-1jyVgIMo.js +0 -251
  813. package/dist/interface/ha/Floorplan-DqpGLQc-.js +0 -3657
  814. package/dist/interface/ha/Instances-ChgYCEv4.js +0 -680
  815. package/dist/interface/ha/Logs-Dhi1-h8b.js +0 -418
  816. package/dist/interface/ha/Menu-C6ZrgRfI.js +0 -156
  817. package/dist/interface/ha/Metrics-BNTz7Ktd.js +0 -1335
  818. package/dist/interface/ha/OAuthDeviceFlow-DjWARnbi.js +0 -112
  819. package/dist/interface/ha/Plugin-juDjFBUz.js +0 -1405
  820. package/dist/interface/ha/PluginConsole-DqwmWMS6.js +0 -56
  821. package/dist/interface/ha/PluginDetail-Dg0s42Rn.js +0 -230
  822. package/dist/interface/ha/PluginSearch-CER_e1EL.js +0 -462
  823. package/dist/interface/ha/PluginUpdateProgress-D3viAJ-T.js +0 -34
  824. package/dist/interface/ha/Plugins-D6Q_xWx9.js +0 -692
  825. package/dist/interface/ha/RecentEventsFilter-DXlTE7iI.js +0 -79
  826. package/dist/interface/ha/Recordings-BEb8EGDn.js +0 -1498
  827. package/dist/interface/ha/SensorEdit-BjGyc2MJ.js +0 -1462
  828. package/dist/interface/ha/SensorHistory-Dm4WiNdC.js +0 -54
  829. package/dist/interface/ha/Sensors-5vAka-K6.js +0 -1386
  830. package/dist/interface/ha/Settings-Cb4v7LRJ.js +0 -218
  831. package/dist/interface/ha/SettingsAccount-DeZOlBDQ.js +0 -971
  832. package/dist/interface/ha/SettingsAppearance-CDyMzncv.js +0 -220
  833. package/dist/interface/ha/SettingsAssistant-DqGnG1RI.js +0 -1857
  834. package/dist/interface/ha/SettingsBackup-BnqZ-qlE.js +0 -556
  835. package/dist/interface/ha/SettingsList-CAIX3jD9.js +0 -40
  836. package/dist/interface/ha/SettingsMqtt-Dxqjg4OT.js +0 -526
  837. package/dist/interface/ha/SettingsNotifications-PAst5uDP.js +0 -529
  838. package/dist/interface/ha/SettingsPermissions-DFbjoUf-.js +0 -84
  839. package/dist/interface/ha/SettingsRecordings-GwPkWVQl.js +0 -152
  840. package/dist/interface/ha/SettingsRemote-CzYyIfWg.js +0 -1810
  841. package/dist/interface/ha/SettingsSystem-BC8IIFe2.js +0 -376
  842. package/dist/interface/ha/SettingsUsers-DS6HTws4.js +0 -379
  843. package/dist/interface/ha/Terminal-DHXMgeMz.js +0 -617
  844. package/dist/interface/ha/Training-CBSlZKBT.js +0 -1505
  845. package/dist/interface/ha/Updates-DTod9Jwm.js +0 -343
  846. package/dist/interface/ha/VariableInput-CuhqW4K7.js +0 -52
  847. package/dist/interface/ha/VariableSuggestions-D15u2aH6.js +0 -201
  848. package/dist/interface/ha/VersionsHandler-Bafq9Ej7.js +0 -216
  849. package/dist/interface/ha/VirtualSensorCreate-DCc5pfdG.js +0 -101
  850. package/dist/interface/ha/Workers-BFJWJvkK.js +0 -765
  851. package/dist/interface/ha/accordion-X9Wa7KVq.js +0 -577
  852. package/dist/interface/ha/account-DLg459mU.js +0 -19
  853. package/dist/interface/ha/alert-circle-CSp7J0pZ.js +0 -19
  854. package/dist/interface/ha/alert-outline-BssBb-kV.js +0 -89
  855. package/dist/interface/ha/api-CMboY32E.js +0 -62432
  856. package/dist/interface/ha/api-CibPJ53n.js +0 -29
  857. package/dist/interface/ha/arrow-left-B4_-vTM1.js +0 -19
  858. package/dist/interface/ha/assistant-B5j5Rwlf.js +0 -345
  859. package/dist/interface/ha/auth-C9gqBg0w.js +0 -271
  860. package/dist/interface/ha/autocomplete-gFZBpGxE.js +0 -1373
  861. package/dist/interface/ha/automationBlueprint-DS2u4IQM.js +0 -250
  862. package/dist/interface/ha/back-filled-B-jI6Dqb.js +0 -20
  863. package/dist/interface/ha/bell-ring-CjnpDomC.js +0 -19
  864. package/dist/interface/ha/brain-DBagansp.js +0 -19
  865. package/dist/interface/ha/button-DJDZxmKj.js +0 -406
  866. package/dist/interface/ha/cards-PAF_pPbZ.js +0 -13352
  867. package/dist/interface/ha/cctv-DBlnZEJ3.js +0 -19
  868. package/dist/interface/ha/check-circle-outline-DHmzynUf.js +0 -19
  869. package/dist/interface/ha/check-circle-w7z_NLrm.js +0 -19
  870. package/dist/interface/ha/checkbox-D012nd17.js +0 -279
  871. package/dist/interface/ha/chevron-down-CN3LNAsG.js +0 -19
  872. package/dist/interface/ha/chevron-up-D5-4qnos.js +0 -19
  873. package/dist/interface/ha/chip-BIYZHiP1.js +0 -149
  874. package/dist/interface/ha/clock-outline-CLOrwuhP.js +0 -19
  875. package/dist/interface/ha/close-C_ajB9j7.js +0 -19
  876. package/dist/interface/ha/close-circle-Qqtz5NiQ.js +0 -19
  877. package/dist/interface/ha/cloud-check-gKe6M70h.js +0 -33
  878. package/dist/interface/ha/config-DoZvm13z.js +0 -116
  879. package/dist/interface/ha/content-copy-ChfuNPUb.js +0 -19
  880. package/dist/interface/ha/copy-DfdE7y98.js +0 -22
  881. package/dist/interface/ha/datepicker-44Ub2Hx0.js +0 -2961
  882. package/dist/interface/ha/delete-LxFfoBRM.js +0 -19
  883. package/dist/interface/ha/dist-DLZYY_4u.js +0 -3251
  884. package/dist/interface/ha/divider-Cf59Ua0f.js +0 -110
  885. package/dist/interface/ha/dots-vertical-BEPlUtxU.js +0 -19
  886. package/dist/interface/ha/download-BnXoyA8p.js +0 -19
  887. package/dist/interface/ha/eventIcons-DrjNuTS2.js +0 -676
  888. package/dist/interface/ha/eye-off-BIuZGpjA.js +0 -33
  889. package/dist/interface/ha/eye-off-outline-cbzzWTdq.js +0 -19
  890. package/dist/interface/ha/help-circle-outline-Du1jH6xY.js +0 -19
  891. package/dist/interface/ha/history-Bm6QaZ6b.js +0 -19
  892. package/dist/interface/ha/home-CUD0JuUy.js +0 -19
  893. package/dist/interface/ha/information-outline-B1TiBdcz.js +0 -19
  894. package/dist/interface/ha/inputicon-BPVltPdr.js +0 -324
  895. package/dist/interface/ha/inputnumber-MSv4Pb-P.js +0 -1033
  896. package/dist/interface/ha/inputtext-vdcrNX6K.js +0 -257
  897. package/dist/interface/ha/intercomService-WdbgAuZn.js +0 -1414
  898. package/dist/interface/ha/message-BExXUXHN.js +0 -244
  899. package/dist/interface/ha/microphone-TB58caA2.js +0 -19
  900. package/dist/interface/ha/minus-BsY_Bojv.js +0 -46
  901. package/dist/interface/ha/minus-C6Qh7zWS.js +0 -19
  902. package/dist/interface/ha/mqtt-Bq2AL0mf.js +0 -56
  903. package/dist/interface/ha/multiselect-B0fAnW75.js +0 -1492
  904. package/dist/interface/ha/notifications-Cb1PNQoG.js +0 -159
  905. package/dist/interface/ha/pause-Ch6v65wA.js +0 -19
  906. package/dist/interface/ha/pencil-outline-3AYc7WXi.js +0 -19
  907. package/dist/interface/ha/pinia-D2fpp6nV.js +0 -7641
  908. package/dist/interface/ha/plugins-BAng0szW.js +0 -592
  909. package/dist/interface/ha/plus-CEoLXIS3.js +0 -46
  910. package/dist/interface/ha/plus-QEeSdL0x.js +0 -19
  911. package/dist/interface/ha/progressbar-C2663Zd7.js +0 -95
  912. package/dist/interface/ha/protocol-BB4jdtUC-CbXTLEB7.js +0 -708
  913. package/dist/interface/ha/radar-BCSebLvk.js +0 -19
  914. package/dist/interface/ha/refresh-Cf7GQyew.js +0 -19
  915. package/dist/interface/ha/restore-DMczh46P.js +0 -19
  916. package/dist/interface/ha/ring-resize-11TaovpK.js +0 -16
  917. package/dist/interface/ha/ripple-B_itunQV.js +0 -2928
  918. package/dist/interface/ha/rooms-BulA3xbr.js +0 -45
  919. package/dist/interface/ha/round-alt-arrow-left-bold-z7BNLjup.js +0 -37
  920. package/dist/interface/ha/runtime-core.esm-bundler-DCktklpY.js +0 -3295
  921. package/dist/interface/ha/search-DMJuYUDF.js +0 -19
  922. package/dist/interface/ha/select-CaVzuLaS.js +0 -1382
  923. package/dist/interface/ha/server-Ndqx0RmV.js +0 -239
  924. package/dist/interface/ha/settings-DkoB1zyf.js +0 -22
  925. package/dist/interface/ha/source-branch-CimaS9J1.js +0 -19
  926. package/dist/interface/ha/speeddial-CpW9sIFY.js +0 -682
  927. package/dist/interface/ha/spinner-BSEdDTno.js +0 -46
  928. package/dist/interface/ha/tag-Bko2QYOK.js +0 -95
  929. package/dist/interface/ha/textarea-DrKQ6YMZ.js +0 -130
  930. package/dist/interface/ha/tooltip-X5MY9FoG.js +0 -277
  931. package/dist/interface/ha/trash-2-Droax8m8.js +0 -23
  932. package/dist/interface/ha/trash-can-outline-XdMf3dMc.js +0 -19
  933. package/dist/interface/ha/trash-fill-B__41VdN.js +0 -21
  934. package/dist/interface/ha/types-B9Rna2FN.js +0 -123
  935. package/dist/interface/ha/types-CSqHjs73.js +0 -1062
  936. package/dist/interface/ha/ungrouped-CEyEfdNm.js +0 -1320
  937. package/dist/interface/ha/updates-BK41HPRa.js +0 -341
  938. package/dist/interface/ha/upload-CDAlIs3e.js +0 -23
  939. package/dist/interface/ha/upload-DMKlzavA.js +0 -19
  940. package/dist/interface/ha/useAppVersion-PLf1za07.js +0 -22
  941. package/dist/interface/ha/useAssistantActions-Uf0kmQ_Z.js +0 -29
  942. package/dist/interface/ha/useLogsSocket-CRUB4tiT.js +0 -59
  943. package/dist/interface/ha/useNavLayout-hpvRlYIg.js +0 -125
  944. package/dist/interface/ha/usePermissions-CEX3lAii.js +0 -72
  945. package/dist/interface/ha/useServerRestart-BN_2Gvwy.js +0 -23
  946. package/dist/interface/ha/useTabSwipe-BhBi1bXW.js +0 -45
  947. package/dist/interface/ha/useUpdateChannel-DoPFCimM.js +0 -22
  948. package/dist/interface/ha/useUpdatesSocket-CQ2qyv6W.js +0 -34
  949. package/dist/interface/ha/useUserOptions-Ck6NrMAe.js +0 -15
  950. package/dist/interface/ha/virtualscroller-DuRtMnNf.js +0 -996
  951. package/dist/interface/ha/vue-flow-background-ETLnaEUH.js +0 -6835
  952. package/dist/interface/ha/vue-i18n-CxWAK5Gn.js +0 -2422
  953. package/dist/interface/ha/zoom-in-ZVdIPder.js +0 -41
@@ -0,0 +1,3251 @@
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-BTp4AyuI.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
+ async function S(e, t = !1) {
349
+ if (!r.value || !e) return;
350
+ let n = t ? void 0 : k.get(e);
351
+ if (n) {
352
+ a.value = n, f.value = !0;
353
+ return;
354
+ }
355
+ u.value = !0;
356
+ try {
357
+ let t = await F(i, e);
358
+ t && (a.value = t);
359
+ } catch {} finally {
360
+ u.value = !1, f.value = !0;
361
+ }
362
+ }
363
+ function C(e) {
364
+ return typeof e == "object" && e?.disabled === !0;
365
+ }
366
+ async function w() {
367
+ let t = n(e), o = typeof t == "string" ? t : t._id;
368
+ if (o && r.value && !C(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
+ () => C(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), await b(r), await S(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: w
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
+ if (!h.cachedStorage) {
1307
+ let t = n(e);
1308
+ if (!t || !await v(t)) return;
1309
+ }
1310
+ return g.getConfig();
1311
+ }
1312
+ async function x() {
1313
+ let t = n(e);
1314
+ i.value && t ? (await v(t), g.getConfig()) : bt(h, m, a), f.value = !0;
1315
+ }
1316
+ return s([i, () => n(e)], x, { immediate: !0 }), t.on("reconnected", x), d(() => {
1317
+ t.off("reconnected", x), bt(h, m, a);
1318
+ }), {
1319
+ config: a,
1320
+ isLoading: o(() => u.value || !f.value),
1321
+ error: p,
1322
+ isConnected: m,
1323
+ getConfig: y,
1324
+ setValue: g.setValue,
1325
+ setConfig: g.setConfig,
1326
+ submitValue: g.submitValue
1327
+ };
1328
+ }
1329
+ function Et(e, t) {
1330
+ 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);
1331
+ async function y(e, t) {
1332
+ let n = i.value;
1333
+ if (!n || !a.value) return !1;
1334
+ try {
1335
+ let r = await ut(i, t);
1336
+ if (!r) throw Error(`Plugin "${t}" not found`);
1337
+ return xt(g, mt(r, e), n, u, () => {
1338
+ let t = b.pluginCameraNamespaces(r, e);
1339
+ return n.createProxy(t.cameraStorageRpc);
1340
+ }), h.value = !0, !0;
1341
+ } catch (e) {
1342
+ return m.value = e instanceof Error ? e : Error(String(e)), h.value = !1, !1;
1343
+ }
1344
+ }
1345
+ async function x() {
1346
+ let r = G(n(e)), i = n(t);
1347
+ if (r && i && (g.cachedStorage || await y(r, i))) return v.getConfig();
1348
+ }
1349
+ async function S() {
1350
+ let r = G(n(e)), i = n(t);
1351
+ a.value && r && i ? (await y(r, i), v.getConfig()) : bt(g, h, u), p.value = !0;
1352
+ }
1353
+ return s([
1354
+ a,
1355
+ () => G(n(e)),
1356
+ () => n(t)
1357
+ ], S, { immediate: !0 }), r.on("reconnected", S), d(() => {
1358
+ r.off("reconnected", S), bt(g, h, u);
1359
+ }), {
1360
+ config: u,
1361
+ isLoading: o(() => f.value || !p.value),
1362
+ error: m,
1363
+ isConnected: h,
1364
+ getConfig: x,
1365
+ setValue: v.setValue,
1366
+ setConfig: v.setConfig,
1367
+ submitValue: v.submitValue
1368
+ };
1369
+ }
1370
+ function Dt(e, t) {
1371
+ 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);
1372
+ function y(e, t) {
1373
+ let n = i.value;
1374
+ if (!n || !a.value) return !1;
1375
+ try {
1376
+ return xt(g, ht(t, e), n, u, () => {
1377
+ let r = b.pluginSensorNamespaces(t, e);
1378
+ return n.createProxy(r.sensorStorageRpc);
1379
+ }), h.value = !0, !0;
1380
+ } catch (e) {
1381
+ return m.value = e instanceof Error ? e : Error(String(e)), h.value = !1, !1;
1382
+ }
1383
+ }
1384
+ async function x() {
1385
+ let r = n(e), i = n(t);
1386
+ if (r && i && (g.cachedStorage || y(r, i))) return v.getConfig();
1387
+ }
1388
+ function S() {
1389
+ let r = n(e), i = n(t);
1390
+ a.value && r && i ? (y(r, i), v.getConfig()) : bt(g, h, u), p.value = !0;
1391
+ }
1392
+ return s([
1393
+ a,
1394
+ () => n(e),
1395
+ () => n(t)
1396
+ ], S, { immediate: !0 }), r.on("reconnected", S), d(() => {
1397
+ r.off("reconnected", S), bt(g, h, u);
1398
+ }), {
1399
+ config: u,
1400
+ isLoading: o(() => f.value || !p.value),
1401
+ error: m,
1402
+ isConnected: h,
1403
+ getConfig: x,
1404
+ setValue: v.setValue,
1405
+ setConfig: v.setConfig,
1406
+ submitValue: v.submitValue
1407
+ };
1408
+ }
1409
+ function Ot() {
1410
+ W(), ce(), vt(), We(), ie();
1411
+ }
1412
+ function kt() {
1413
+ W(), de(), Ge();
1414
+ }
1415
+ var At = Symbol("camera-ui"), jt = new m("plugin");
1416
+ function Mt(e) {
1417
+ return "rpc" in e && "isConnected" in e;
1418
+ }
1419
+ var Nt = 4e3;
1420
+ function Pt(e) {
1421
+ 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(() => {
1422
+ let e = n.value;
1423
+ if (e?.tokens.proxySession) return { session: e.tokens.proxySession };
1424
+ }), y = /* @__PURE__ */ new Map();
1425
+ function b(e, t) {
1426
+ let n = y.get(e);
1427
+ n || (n = /* @__PURE__ */ new Set(), y.set(e, n)), n.add(t);
1428
+ }
1429
+ function x(e, t) {
1430
+ y.get(e)?.delete(t);
1431
+ }
1432
+ function S(e) {
1433
+ let t = y.get(e);
1434
+ if (t) for (let e of t) try {
1435
+ e();
1436
+ } catch (e) {
1437
+ jt.warn("context listener threw:", e);
1438
+ }
1439
+ }
1440
+ return t.subscribeClient((e) => {
1441
+ if (e) {
1442
+ d !== null && (clearTimeout(d), d = null);
1443
+ let t = m.value, n = e !== u;
1444
+ 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;
1445
+ } else {
1446
+ if (f = !0, p.value = void 0, d !== null || !m.value) return;
1447
+ d = setTimeout(() => {
1448
+ d = null, m.value = !1, S("disconnected");
1449
+ }, Nt);
1450
+ }
1451
+ }), t.on("auth-error", (e) => {
1452
+ h.value = Error(e.message ?? "auth-error");
1453
+ }), t.on("down", (e) => {
1454
+ h.value ||= Error(e.reason);
1455
+ }), t.on("up", () => {
1456
+ h.value = void 0;
1457
+ }), r({
1458
+ rpc: p,
1459
+ target: i(n),
1460
+ isConnected: i(m),
1461
+ endpoint: g,
1462
+ token: _,
1463
+ extraProxyQuery: v,
1464
+ error: i(h),
1465
+ wsTransport: a,
1466
+ on: b,
1467
+ off: x
1468
+ });
1469
+ }
1470
+ function Ft(e) {
1471
+ return { install(t) {
1472
+ let n = Mt(e) ? e : Pt(e);
1473
+ t.provide(At, n);
1474
+ } };
1475
+ }
1476
+ var It = {
1477
+ standbyTimeout: 5e3,
1478
+ activityTimeout: 5e3
1479
+ };
1480
+ function Lt(e) {
1481
+ let { initialMode: t = "always-on", config: n = {}, onStreamStart: r, onStreamStop: i, isStreamPlaying: a } = e, o = {
1482
+ ...It,
1483
+ ...n
1484
+ }, s = l(t), c = l(!1), u = l(!1), d, f;
1485
+ function p() {
1486
+ d &&= (clearTimeout(d), void 0);
1487
+ }
1488
+ function m() {
1489
+ f &&= (clearTimeout(f), void 0);
1490
+ }
1491
+ function h() {
1492
+ p(), m();
1493
+ }
1494
+ function g() {
1495
+ c.value || (c.value = !0, i());
1496
+ }
1497
+ function _() {
1498
+ c.value && (c.value = !1, r());
1499
+ }
1500
+ function v() {
1501
+ switch (h(), s.value) {
1502
+ case "always-on":
1503
+ c.value = !1, a() || r();
1504
+ break;
1505
+ case "standby":
1506
+ c.value || (a() || r(), y());
1507
+ break;
1508
+ case "activity": u.value ? (c.value = !1, a() || r()) : d = setTimeout(() => {
1509
+ s.value === "activity" && !u.value && g();
1510
+ }, o.activityTimeout);
1511
+ }
1512
+ }
1513
+ function y() {
1514
+ m(), f = setTimeout(() => {
1515
+ s.value === "standby" && g();
1516
+ }, o.standbyTimeout);
1517
+ }
1518
+ function b(e) {
1519
+ s.value !== e && (s.value = e, v());
1520
+ }
1521
+ function x(e) {
1522
+ s.value === "activity" && (e ? (u.value = !0, p(), (c.value || !a()) && _()) : (u.value = !1, p(), d = setTimeout(() => {
1523
+ u.value || g();
1524
+ }, o.activityTimeout)));
1525
+ }
1526
+ function S() {
1527
+ if (c.value) switch (_(), s.value) {
1528
+ case "standby":
1529
+ y();
1530
+ break;
1531
+ case "activity": p(), u.value || (d = setTimeout(() => {
1532
+ g();
1533
+ }, o.activityTimeout));
1534
+ }
1535
+ }
1536
+ function C() {
1537
+ s.value === "standby" && !c.value && y();
1538
+ }
1539
+ function w() {
1540
+ h();
1541
+ }
1542
+ return {
1543
+ mode: s,
1544
+ inStandby: c,
1545
+ hasActivity: u,
1546
+ setMode: b,
1547
+ reportActivity: x,
1548
+ resumeFromStandby: S,
1549
+ resetIdleTimer: C,
1550
+ dispose: w
1551
+ };
1552
+ }
1553
+ 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;
1554
+ function Gt(e) {
1555
+ Y.debug(`paused listener fired (delay ${e.delayMs}ms reached)`);
1556
+ try {
1557
+ e.cb();
1558
+ } catch (e) {
1559
+ Y.error("onTabPaused listener threw:", e);
1560
+ }
1561
+ }
1562
+ function Kt(e) {
1563
+ Y.debug(`paused listener scheduled in ${e.delayMs}ms`), e.timer = setTimeout(() => {
1564
+ if (e.timer = null, zt.value) {
1565
+ Y.debug("paused listener skipped — tab visible before delay");
1566
+ return;
1567
+ }
1568
+ Gt(e);
1569
+ }, e.delayMs);
1570
+ }
1571
+ function qt() {
1572
+ for (let e of Ht) e.timer !== null && (clearTimeout(e.timer), e.timer = null);
1573
+ }
1574
+ function Jt() {
1575
+ Wt || typeof document > "u" || (Wt = !0, document.addEventListener("visibilitychange", () => {
1576
+ let e = document.visibilityState === "visible";
1577
+ if (!e && zt.value) {
1578
+ zt.value = !1, Bt = Date.now(), Y.debug(`tab → hidden (hidden=${Vt.size} paused=${Ht.size})`);
1579
+ for (let e of Vt) try {
1580
+ e.cb();
1581
+ } catch (e) {
1582
+ Y.error("onTabHidden listener threw:", e);
1583
+ }
1584
+ for (let e of Ht) Kt(e);
1585
+ } else if (e && !zt.value) {
1586
+ qt();
1587
+ let e = Bt == null ? 0 : Date.now() - Bt;
1588
+ Bt = null, zt.value = !0, Y.debug(`tab → visible (hiddenMs=${e}, visible-listeners=${Ut.size})`);
1589
+ for (let { cb: t } of Ut) try {
1590
+ t({ hiddenMs: e });
1591
+ } catch (e) {
1592
+ Y.error("onTabVisible listener threw:", e);
1593
+ }
1594
+ }
1595
+ }));
1596
+ }
1597
+ function Yt() {
1598
+ Jt();
1599
+ let e = o(() => zt.value);
1600
+ function t(e) {
1601
+ let t = { cb: e };
1602
+ Vt.add(t);
1603
+ let n = () => {
1604
+ Vt.delete(t);
1605
+ };
1606
+ return d(n), n;
1607
+ }
1608
+ function n(e, t = {}) {
1609
+ let n = {
1610
+ cb: e,
1611
+ delayMs: t.delayMs ?? Rt,
1612
+ timer: null
1613
+ };
1614
+ Ht.add(n);
1615
+ let r = () => {
1616
+ n.timer !== null && (clearTimeout(n.timer), n.timer = null), Ht.delete(n);
1617
+ };
1618
+ return d(r), r;
1619
+ }
1620
+ function r(e) {
1621
+ let t = { cb: e };
1622
+ Ut.add(t);
1623
+ let n = () => {
1624
+ Ut.delete(t);
1625
+ };
1626
+ return d(n), n;
1627
+ }
1628
+ return {
1629
+ isVisible: e,
1630
+ onTabHidden: t,
1631
+ onTabPaused: n,
1632
+ onTabVisible: r
1633
+ };
1634
+ }
1635
+ var X = {
1636
+ WEBRTC: {
1637
+ RECONNECT_DELAY: 1e3,
1638
+ CONNECT_TIMEOUT: 1e4,
1639
+ WS_CONNECT_TIMEOUT: 5e3,
1640
+ ICE_SERVERS: [{ urls: "stun:stun.l.google.com:19302" }]
1641
+ },
1642
+ MSE: {
1643
+ BUFFER_SIZE: 2097152,
1644
+ BUFFER_WINDOW: 5
1645
+ },
1646
+ CODECS: {
1647
+ DEFAULT: [
1648
+ "avc1.640029",
1649
+ "avc1.64002A",
1650
+ "avc1.640033",
1651
+ "hvc1.1.6.L153.B0",
1652
+ "mp4a.40.2",
1653
+ "mp4a.40.5",
1654
+ "flac",
1655
+ "opus"
1656
+ ],
1657
+ WEBRTC_VIDEO: [
1658
+ "H264",
1659
+ "VP8",
1660
+ "VP9"
1661
+ ],
1662
+ WEBRTC_AUDIO: [
1663
+ "opus",
1664
+ "G722",
1665
+ "PCMU",
1666
+ "PCMA"
1667
+ ]
1668
+ }
1669
+ }, Xt = "hvc1.1.6.L153.B0";
1670
+ function Zt() {
1671
+ return navigator.userAgent.match(/version\/(\d+)/i);
1672
+ }
1673
+ function Qt() {
1674
+ let e = [...X.CODECS.DEFAULT], t = Zt();
1675
+ if (t?.[1]) {
1676
+ let n = parseInt(t[1], 10);
1677
+ if (n < 13) {
1678
+ let t = e.indexOf("mp4a.40.2");
1679
+ t > -1 && e.splice(t);
1680
+ } else if (n < 14) {
1681
+ let t = e.indexOf("flac");
1682
+ t > -1 && e.splice(t);
1683
+ } else {
1684
+ let t = e.indexOf("opus");
1685
+ t > -1 && e.splice(t);
1686
+ }
1687
+ }
1688
+ return e;
1689
+ }
1690
+ function $t(e, t) {
1691
+ return e.filter((e) => t(`video/mp4; codecs="${e}"`)).join(",");
1692
+ }
1693
+ function en(e) {
1694
+ return X.CODECS.WEBRTC_AUDIO.includes(e);
1695
+ }
1696
+ function tn(e) {
1697
+ return X.CODECS.WEBRTC_VIDEO.includes(e) ? !0 : e === "H265" && sn();
1698
+ }
1699
+ var nn, rn;
1700
+ function an(e) {
1701
+ if (e === "auto") return an("webrtc") || an("mse");
1702
+ if (e === "mse") return nn === void 0 && (nn = !!un()?.isTypeSupported(`video/mp4; codecs="${Xt}"`)), nn;
1703
+ if (rn === void 0) try {
1704
+ rn = !!(RTCRtpReceiver?.getCapabilities("video")?.codecs)?.some((e) => e.mimeType.toLowerCase().includes("h265") || e.mimeType.toLowerCase().includes("hevc"));
1705
+ } catch {
1706
+ rn = !1;
1707
+ }
1708
+ return rn;
1709
+ }
1710
+ function on(e) {
1711
+ e === "mse" ? nn = !1 : rn = !1;
1712
+ }
1713
+ function sn() {
1714
+ return an("webrtc");
1715
+ }
1716
+ function cn(e) {
1717
+ 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 = [];
1718
+ return r || a.push(...t.map((e) => e.codec)), i || a.push(...n.map((e) => e.codec)), {
1719
+ compatible: r && i,
1720
+ audioCompatible: r,
1721
+ videoCompatible: i,
1722
+ incompatibleCodecs: a
1723
+ };
1724
+ }
1725
+ function ln() {
1726
+ return "ManagedMediaSource" in window;
1727
+ }
1728
+ function un() {
1729
+ if (ln()) return window.ManagedMediaSource;
1730
+ if ("MediaSource" in window) return window.MediaSource;
1731
+ }
1732
+ function dn(e, t) {
1733
+ return new Promise((n, r) => {
1734
+ if (t.aborted) {
1735
+ r(new DOMException("Aborted", "AbortError"));
1736
+ return;
1737
+ }
1738
+ let i = setTimeout(n, e);
1739
+ t.addEventListener("abort", () => {
1740
+ clearTimeout(i), r(new DOMException("Aborted", "AbortError"));
1741
+ }, { once: !0 });
1742
+ });
1743
+ }
1744
+ function fn(e) {
1745
+ 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();
1746
+ function h() {
1747
+ if (a.aborted) return;
1748
+ let e = un();
1749
+ if (!e) {
1750
+ i(/* @__PURE__ */ Error("MediaSource not supported"));
1751
+ return;
1752
+ }
1753
+ o = new e();
1754
+ let n = ln(), r = t.src;
1755
+ return o.addEventListener("sourceopen", () => {
1756
+ a.aborted || !n && r && r.startsWith("blob:") && r !== t.src && URL.revokeObjectURL(r);
1757
+ }, { 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));
1758
+ }
1759
+ function g(e) {
1760
+ if (a.aborted || !o) return;
1761
+ if (o.readyState !== "open") {
1762
+ o.addEventListener("sourceopen", () => {
1763
+ a.aborted || g(e);
1764
+ }, { once: !0 });
1765
+ return;
1766
+ }
1767
+ f = 0, d = new Uint8Array(X.MSE.BUFFER_SIZE);
1768
+ let t = un();
1769
+ if (t && !t.isTypeSupported(e)) {
1770
+ i(/* @__PURE__ */ Error(`MIME type not supported: ${e}`));
1771
+ return;
1772
+ }
1773
+ try {
1774
+ if (s = o.addSourceBuffer(e), s.mode = "segments", s.addEventListener("updateend", _), l = !0, p.length > 0) {
1775
+ for (let e of p) v(e);
1776
+ p.length = 0;
1777
+ }
1778
+ n();
1779
+ } catch (e) {
1780
+ i(e instanceof Error ? e : Error(String(e)));
1781
+ }
1782
+ }
1783
+ function _() {
1784
+ if (!a.aborted && s && o) {
1785
+ if (!s.updating && f > 0) try {
1786
+ let e = d.slice(0, f);
1787
+ s.appendBuffer(e), f = 0;
1788
+ } catch (e) {
1789
+ y(e) || i(e instanceof Error ? e : Error(String(e)));
1790
+ }
1791
+ if (!s.updating && s.buffered?.length) {
1792
+ let e = s.buffered.end(s.buffered.length - 1), n = e - X.MSE.BUFFER_WINDOW, i = s.buffered.start(0);
1793
+ if (u || (u = !0, r()), n > i) try {
1794
+ s.remove(i, n), o.setLiveSeekableRange(n, e);
1795
+ } catch {}
1796
+ t.currentTime < n && (t.currentTime = n);
1797
+ let a = e - t.currentTime;
1798
+ a > 1 ? t.playbackRate = 1.1 : a < .1 ? t.playbackRate = .9 : t.playbackRate = 1;
1799
+ }
1800
+ }
1801
+ }
1802
+ function v(e) {
1803
+ if (!a.aborted) {
1804
+ if (!s) {
1805
+ p.push(e);
1806
+ return;
1807
+ }
1808
+ if (o?.readyState === "closed") {
1809
+ i(/* @__PURE__ */ Error("MediaSource closed"));
1810
+ return;
1811
+ }
1812
+ if (s.updating || f > 0) {
1813
+ let t = new Uint8Array(e);
1814
+ if (f + t.byteLength > d.byteLength) {
1815
+ f = 0, i(/* @__PURE__ */ Error("MSE pending buffer overflow"));
1816
+ return;
1817
+ }
1818
+ d.set(t, f), f += t.byteLength;
1819
+ } else try {
1820
+ s.appendBuffer(e);
1821
+ } catch (t) {
1822
+ if (y(t)) {
1823
+ let t = new Uint8Array(e);
1824
+ t.byteLength <= d.byteLength && (d.set(t, 0), f = t.byteLength);
1825
+ }
1826
+ }
1827
+ }
1828
+ }
1829
+ function y(e) {
1830
+ if (e?.name !== "QuotaExceededError" || !s || s.updating || !s.buffered?.length) return !1;
1831
+ try {
1832
+ let e = s.buffered.start(0), t = s.buffered.end(s.buffered.length - 1), n = Math.max(e + 1, t - X.MSE.BUFFER_WINDOW);
1833
+ return n <= e ? !1 : (s.remove(e, n), !0);
1834
+ } catch {
1835
+ return !1;
1836
+ }
1837
+ }
1838
+ function b() {
1839
+ if (s) {
1840
+ if (s.removeEventListener("updateend", _), o?.readyState === "open") try {
1841
+ o.removeSourceBuffer(s);
1842
+ } catch {}
1843
+ s = null;
1844
+ }
1845
+ if (o?.readyState === "open") try {
1846
+ o.endOfStream();
1847
+ } catch {}
1848
+ o = null, c &&= (URL.revokeObjectURL(c), null), l = !1, u = !1, f = 0, p.length = 0;
1849
+ }
1850
+ return a.addEventListener("abort", b, { once: !0 }), {
1851
+ get mediaSource() {
1852
+ return o;
1853
+ },
1854
+ get sourceBuffer() {
1855
+ return s;
1856
+ },
1857
+ get isReady() {
1858
+ return l;
1859
+ },
1860
+ setup: h,
1861
+ initializeBuffer: g,
1862
+ appendBuffer: v,
1863
+ close: b
1864
+ };
1865
+ }
1866
+ async function Z(e) {
1867
+ try {
1868
+ await e.play();
1869
+ } catch {
1870
+ e.muted || (e.muted = !0, await Z(e));
1871
+ }
1872
+ }
1873
+ function pn(e, t, n) {
1874
+ let r = new RTCPeerConnection({
1875
+ bundlePolicy: "max-bundle",
1876
+ iceServers: [...X.WEBRTC.ICE_SERVERS]
1877
+ });
1878
+ return r.onicecandidate = (r) => {
1879
+ if (e.aborted || n && r.candidate?.protocol === "udp") return;
1880
+ let i = r.candidate?.toJSON().candidate ?? "";
1881
+ i && t(i);
1882
+ }, r;
1883
+ }
1884
+ async function mn(e, t, n) {
1885
+ !t.aborted && e && await e.setRemoteDescription({
1886
+ type: "answer",
1887
+ sdp: n
1888
+ });
1889
+ }
1890
+ async function hn(e, t, n, r) {
1891
+ !t.aborted && e && (r && n.includes(" udp ") || await e.addIceCandidate({
1892
+ candidate: n,
1893
+ sdpMid: "0"
1894
+ }));
1895
+ }
1896
+ async function gn(e, t, n) {
1897
+ if (!t.aborted && e) try {
1898
+ await e.sender.replaceTrack(n);
1899
+ } catch {}
1900
+ }
1901
+ function _n(e) {
1902
+ 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;
1903
+ }
1904
+ function vn(e) {
1905
+ let { mode: t, onConnected: n, onDisconnected: r, onFailed: i, onCandidate: a, signal: o } = e, s = {
1906
+ pc: null,
1907
+ micTransceiver: null,
1908
+ isConnected: !1
1909
+ }, c = t === "webrtc/tcp";
1910
+ function l() {
1911
+ let e = pn(o, a, c);
1912
+ return e.onconnectionstatechange = () => {
1913
+ if (o.aborted) return;
1914
+ let t = e.connectionState;
1915
+ if (t === "connected") {
1916
+ s.isConnected = !0;
1917
+ let t = new MediaStream(e.getTransceivers().filter((e) => e.currentDirection === "recvonly").map((e) => e.receiver.track));
1918
+ n(t);
1919
+ } else t === "failed" ? (s.isConnected = !1, i()) : t === "disconnected" && (s.isConnected = !1, r());
1920
+ }, e.addTransceiver("video", { direction: "recvonly" }), e.addTransceiver("audio", { direction: "recvonly" }), s.micTransceiver = e.addTransceiver("audio", { direction: "sendonly" }), e;
1921
+ }
1922
+ async function u() {
1923
+ if (o.aborted) return;
1924
+ s.pc = l();
1925
+ let e = await s.pc.createOffer();
1926
+ return await s.pc.setLocalDescription(e), e.sdp;
1927
+ }
1928
+ function d() {
1929
+ _n(s);
1930
+ }
1931
+ return o.addEventListener("abort", d, { once: !0 }), {
1932
+ get pc() {
1933
+ return s.pc;
1934
+ },
1935
+ get micTransceiver() {
1936
+ return s.micTransceiver;
1937
+ },
1938
+ get isConnected() {
1939
+ return s.isConnected;
1940
+ },
1941
+ createOffer: u,
1942
+ handleAnswer: (e) => mn(s.pc, o, e),
1943
+ handleCandidate: (e) => hn(s.pc, o, e, c),
1944
+ setMicrophoneTrack: (e) => gn(s.micTransceiver, o, e),
1945
+ close: d
1946
+ };
1947
+ }
1948
+ function yn(e) {
1949
+ let { onConnected: t, onDisconnected: n, onCandidate: r, signal: i } = e, a = {
1950
+ pc: null,
1951
+ micTransceiver: null,
1952
+ isConnected: !1
1953
+ };
1954
+ function o() {
1955
+ let e = pn(i, r, !1);
1956
+ return e.onconnectionstatechange = () => {
1957
+ if (i.aborted) return;
1958
+ let r = e.connectionState;
1959
+ r === "connected" ? (a.isConnected = !0, t()) : (r === "disconnected" || r === "failed") && (a.isConnected = !1, n());
1960
+ }, a.micTransceiver = e.addTransceiver("audio", { direction: "sendonly" }), e;
1961
+ }
1962
+ async function s() {
1963
+ if (i.aborted) return;
1964
+ a.pc = o();
1965
+ let e = await a.pc.createOffer();
1966
+ return await a.pc.setLocalDescription(e), e.sdp;
1967
+ }
1968
+ function c() {
1969
+ _n(a);
1970
+ }
1971
+ return i.addEventListener("abort", c, { once: !0 }), {
1972
+ get isConnected() {
1973
+ return a.isConnected;
1974
+ },
1975
+ createOffer: s,
1976
+ handleAnswer: (e) => mn(a.pc, i, e),
1977
+ handleCandidate: (e) => hn(a.pc, i, e, !1),
1978
+ setMicrophoneTrack: (e) => gn(a.micTransceiver, i, e),
1979
+ close: c
1980
+ };
1981
+ }
1982
+ async function bn(e, t) {
1983
+ switch (t.type) {
1984
+ case "webrtc/answer":
1985
+ await e.handleAnswer(t.value);
1986
+ break;
1987
+ case "webrtc/candidate": t.value && await e.handleCandidate(t.value);
1988
+ }
1989
+ }
1990
+ var Q = new m("StreamConnection"), xn = /mp4a|opus|flac|mp3/i;
1991
+ function Sn(e) {
1992
+ return e ? typeof document < "u" && "pictureInPictureElement" in document && document.pictureInPictureElement === e || e.webkitPresentationMode === "picture-in-picture" : !1;
1993
+ }
1994
+ var Cn = class {
1995
+ status;
1996
+ activeMode;
1997
+ requestedMode;
1998
+ activeResolution;
1999
+ requestedResolution;
2000
+ degradedFrom;
2001
+ degradeReason;
2002
+ source;
2003
+ hasVideo;
2004
+ hasAudio;
2005
+ hasBackchannel;
2006
+ isPlaying;
2007
+ error;
2008
+ probeInfo;
2009
+ muted;
2010
+ paused;
2011
+ nativeWidth;
2012
+ nativeHeight;
2013
+ camera;
2014
+ videoElement;
2015
+ containerElement;
2016
+ target;
2017
+ isReady;
2018
+ triedSourceIds = /* @__PURE__ */ new Set();
2019
+ options;
2020
+ wsTransport;
2021
+ scope = a(!0);
2022
+ connectionGeneration = 0;
2023
+ abortController = new AbortController();
2024
+ probedSourceId;
2025
+ wasPausedByVisibility = !1;
2026
+ disarmPipWatch = null;
2027
+ wsHandle;
2028
+ webrtcHandler;
2029
+ mseHandler;
2030
+ firstFrameCallbackId;
2031
+ backchannelHandler;
2032
+ pendingMicTrack = null;
2033
+ lastMediaStream = null;
2034
+ stopWatchers = [];
2035
+ mseMonitorInterval;
2036
+ offTabVisible;
2037
+ offTabPaused;
2038
+ onVideoPauseBound;
2039
+ onVideoPlayBound;
2040
+ onVideoResizeBound;
2041
+ startWsConnectTimeout;
2042
+ stopWsConnectTimeout;
2043
+ startConnectTimeout;
2044
+ stopConnectTimeout;
2045
+ startMseConnectTimeout;
2046
+ stopMseConnectTimeout;
2047
+ startReconnectTimeout;
2048
+ stopReconnectTimeout;
2049
+ constructor(e) {
2050
+ this.options = e;
2051
+ let t = _();
2052
+ if (!t.wsTransport) throw Error("[camera.ui] StreamConnection requires a wsTransport on CameraUiContext — pass `wsTransport` to createCameraUiPlugin.");
2053
+ this.target = t.target, this.wsTransport = t.wsTransport;
2054
+ let { autoStart: r = !0 } = e;
2055
+ 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(() => {
2056
+ let { onTabPaused: e, onTabVisible: t } = Yt(), n = f(() => {
2057
+ this.wsHandle?.readyState === WebSocket.CONNECTING && (this.disconnectWebSocket(), !this.abortController.signal.aborted && this.status.value !== "closed" && this.restart());
2058
+ }, X.WEBRTC.WS_CONNECT_TIMEOUT, { immediate: !1 }), i = f(() => {
2059
+ 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();
2060
+ }, X.WEBRTC.CONNECT_TIMEOUT, { immediate: !1 }), a = f(() => {
2061
+ this.abortController.signal.aborted || this.status.value === "connected" || this.status.value === "closed" || this.mseHandler && !this.mseHandler.isReady && (this.markSourceUndecodable(), this.restart());
2062
+ }, X.WEBRTC.CONNECT_TIMEOUT, { immediate: !1 }), o = f(() => {
2063
+ this.abortController.signal.aborted || this.restart();
2064
+ }, X.WEBRTC.RECONNECT_DELAY, { immediate: !1 });
2065
+ 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(() => {
2066
+ 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") {
2067
+ Q.debug(`onTabPaused — already in ${this.status.value}, skipping stop()`);
2068
+ return;
2069
+ }
2070
+ if (Sn(this.videoElement.value)) {
2071
+ Q.debug("onTabPaused — video is in picture-in-picture, keeping the stream"), this.watchPipLeave();
2072
+ return;
2073
+ }
2074
+ this.wasPausedByVisibility = !0, this.stop(), Q.debug("onTabPaused — stop() done, wasPausedByVisibility=true");
2075
+ }), this.offTabVisible = t(() => {
2076
+ if (Q.debug(`onTabVisible fired — wasPausedByVisibility=${this.wasPausedByVisibility}, status=${this.status.value}, isReady=${this.isReady.value}, target=${!!this.target.value}`), this.disarmPipWatch?.(), !this.wasPausedByVisibility) {
2077
+ Q.debug("onTabVisible — not paused by visibility, no-op");
2078
+ return;
2079
+ }
2080
+ this.wasPausedByVisibility = !1, this.startWhenReady();
2081
+ }), r && p(this.isReady, () => {
2082
+ (this.status.value === "idle" || this.status.value === "closed") && this.start();
2083
+ }, { immediate: !0 });
2084
+ });
2085
+ }
2086
+ watchPipLeave() {
2087
+ if (this.disarmPipWatch) return;
2088
+ let e = this.videoElement.value;
2089
+ if (!e) return;
2090
+ let t = () => {
2091
+ 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()));
2092
+ };
2093
+ e.addEventListener("leavepictureinpicture", t), e.addEventListener("webkitpresentationmodechanged", t), this.disarmPipWatch = () => {
2094
+ e.removeEventListener("leavepictureinpicture", t), e.removeEventListener("webkitpresentationmodechanged", t), this.disarmPipWatch = null;
2095
+ };
2096
+ }
2097
+ async start() {
2098
+ if (Q.debug(`start() called — status=${this.status.value}, isReady=${this.isReady.value}`), this.status.value !== "idle" && this.status.value !== "closed") {
2099
+ Q.debug(`start() — skipped, status is ${this.status.value}`);
2100
+ return;
2101
+ }
2102
+ if (!this.isReady.value) {
2103
+ Q.debug("start() — skipped, isReady=false");
2104
+ return;
2105
+ }
2106
+ this.cleanup(), this.abortController = new AbortController();
2107
+ let e = ++this.connectionGeneration;
2108
+ this.triedSourceIds.clear(), this.status.value = "connecting", this.error.value = void 0, this.isPlaying.value = !1;
2109
+ try {
2110
+ let t = this.initializeSource();
2111
+ if (t === "unsupported") {
2112
+ Q.debug("start() — no source with a playable codec"), this.setUnsupported();
2113
+ return;
2114
+ }
2115
+ if (!t) {
2116
+ Q.debug("start() — no streaming source available"), this.error.value = /* @__PURE__ */ Error("No streaming source available"), this.status.value = "error";
2117
+ return;
2118
+ }
2119
+ for (let t = 0; t < 3; t++) {
2120
+ let t = this.source.value?._id, n = await this.probeStream();
2121
+ if (e !== this.connectionGeneration) {
2122
+ Q.debug("start() — generation stale after probe, aborting");
2123
+ return;
2124
+ }
2125
+ n && t && this.probeSaysUnplayable(n) && this.triedSourceIds.add(t);
2126
+ let r = this.initializeSource();
2127
+ if (r === "unsupported") {
2128
+ this.setUnsupported();
2129
+ return;
2130
+ }
2131
+ if (!r) {
2132
+ this.error.value = /* @__PURE__ */ Error("No streaming source available"), this.status.value = "error";
2133
+ return;
2134
+ }
2135
+ if (!n || this.source.value?._id === t) break;
2136
+ }
2137
+ Q.debug("start() — connecting WebSocket"), this.connectWebSocket();
2138
+ } catch (t) {
2139
+ if (e !== this.connectionGeneration) return;
2140
+ Q.debug("start() — error:", t), this.error.value = t instanceof Error ? t : Error(String(t)), this.status.value = "error";
2141
+ }
2142
+ }
2143
+ stop() {
2144
+ if (this.status.value === "closed") {
2145
+ Q.debug("stop() — already closed, no-op");
2146
+ return;
2147
+ }
2148
+ Q.debug(`stop() — was ${this.status.value}, transitioning to closed`), ++this.connectionGeneration, this.status.value = "closed", this.cleanup();
2149
+ }
2150
+ async setMode(e) {
2151
+ if (this.requestedMode.value !== e) {
2152
+ if (this.requestedMode.value = e, this.activeMode.value = e === "auto" ? "webrtc" : e, this.status.value === "unsupported") {
2153
+ this.stop(), await this.start();
2154
+ return;
2155
+ }
2156
+ this.status.value === "connected" && await this.restart();
2157
+ }
2158
+ }
2159
+ async setResolution(e) {
2160
+ if (this.requestedResolution.value === e) return;
2161
+ if (this.requestedResolution.value = e, this.status.value === "unsupported") {
2162
+ this.stop(), await this.start();
2163
+ return;
2164
+ }
2165
+ let t = this.getSourceForResolution(e);
2166
+ 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());
2167
+ }
2168
+ async setMicrophone(e) {
2169
+ if (this.webrtcHandler) {
2170
+ await this.webrtcHandler.setMicrophoneTrack(e);
2171
+ return;
2172
+ }
2173
+ 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));
2174
+ }
2175
+ setMuted(e) {
2176
+ this.muted.value = e;
2177
+ let t = this.videoElement.value;
2178
+ t && (t.muted = e);
2179
+ }
2180
+ async play() {
2181
+ this.paused.value = !1;
2182
+ let e = this.videoElement.value;
2183
+ if (e) try {
2184
+ await e.play();
2185
+ } catch {
2186
+ if (!e.muted) {
2187
+ e.muted = !0, this.muted.value = !0;
2188
+ try {
2189
+ await e.play();
2190
+ } catch {}
2191
+ }
2192
+ }
2193
+ }
2194
+ pause() {
2195
+ this.paused.value = !0;
2196
+ let e = this.videoElement.value;
2197
+ e && e.pause();
2198
+ }
2199
+ destroy() {
2200
+ for (let e of this.stopWatchers) e();
2201
+ this.stopWatchers = [], this.offTabVisible?.(), this.offTabVisible = void 0, this.offTabPaused?.(), this.offTabPaused = void 0, this.disarmPipWatch?.();
2202
+ let e = this.videoElement.value;
2203
+ 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();
2204
+ }
2205
+ async restart() {
2206
+ this.status.value = "reconnecting", this.isPlaying.value = !1, this.cleanup(), this.abortController = new AbortController();
2207
+ let e = ++this.connectionGeneration;
2208
+ try {
2209
+ await dn(1e3, this.abortController.signal);
2210
+ } catch {
2211
+ return;
2212
+ }
2213
+ if (e === this.connectionGeneration) {
2214
+ if (!this.isReady.value) {
2215
+ this.status.value = "idle";
2216
+ return;
2217
+ }
2218
+ try {
2219
+ let e = this.initializeSource();
2220
+ if (e === "unsupported") {
2221
+ this.setUnsupported();
2222
+ return;
2223
+ }
2224
+ if (!e) {
2225
+ this.error.value = /* @__PURE__ */ Error("No streaming source available"), this.status.value = "error";
2226
+ return;
2227
+ }
2228
+ this.connectWebSocket();
2229
+ } catch (t) {
2230
+ if (e !== this.connectionGeneration) return;
2231
+ this.error.value = t instanceof Error ? t : Error(String(t)), this.status.value = "error";
2232
+ }
2233
+ }
2234
+ }
2235
+ startWhenReady() {
2236
+ if (this.isReady.value) {
2237
+ Q.debug("startWhenReady — already ready, calling start() now"), this.start();
2238
+ return;
2239
+ }
2240
+ Q.debug(`startWhenReady — not ready (camera=${!!this.camera.value}, video=${!!this.videoElement.value}, target=${!!this.target.value}), watching isReady`);
2241
+ let e = s(this.isReady, (t) => {
2242
+ t && (Q.debug("startWhenReady — isReady → true, calling start()"), e(), this.start());
2243
+ });
2244
+ this.stopWatchers.push(e);
2245
+ }
2246
+ setupWatchers() {
2247
+ let e = s(() => this.target.value?.endpoint.url ?? null, (e, t) => {
2248
+ e && t && e !== t && this.status.value !== "idle" && this.status.value !== "closed" && this.restart();
2249
+ });
2250
+ this.stopWatchers.push(e);
2251
+ let t = s(() => this.camera.value?.sources.value, () => {
2252
+ this.status.value === "unsupported" && (this.stop(), this.start());
2253
+ });
2254
+ this.stopWatchers.push(t);
2255
+ let r = s(() => n(this.options.mode), (e) => {
2256
+ e !== void 0 && e !== this.requestedMode.value && this.setMode(e);
2257
+ });
2258
+ this.stopWatchers.push(r);
2259
+ let i = s(() => n(this.options.resolution), (e) => {
2260
+ e !== void 0 && e !== this.requestedResolution.value && this.setResolution(e);
2261
+ });
2262
+ this.stopWatchers.push(i);
2263
+ let a = s(this.videoElement, (e, t) => {
2264
+ 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 = () => {
2265
+ this.paused.value || e.play().catch(() => {});
2266
+ }, this.onVideoPlayBound = () => {
2267
+ this.paused.value = !1;
2268
+ }, this.onVideoResizeBound = () => {
2269
+ e.videoWidth > 0 && e.videoHeight > 0 && (this.nativeWidth.value = e.videoWidth, this.nativeHeight.value = e.videoHeight);
2270
+ }, 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));
2271
+ }, { immediate: !0 });
2272
+ this.stopWatchers.push(a);
2273
+ let o = s(this.activeMode, (e) => {
2274
+ this.stopMseMonitor(), e === "mse" && (this.mseMonitorInterval = setInterval(() => this.monitorMseBuffer(), 1e3));
2275
+ }, { immediate: !0 });
2276
+ this.stopWatchers.push(o);
2277
+ let c = s([
2278
+ this.camera,
2279
+ this.videoElement,
2280
+ () => this.target.value
2281
+ ], ([e, t, n], [r, i]) => {
2282
+ if (e !== r) this.status.value === "connected" ? e && t && n && this.restart() : this.status.value === "unsupported" && e && t && n && (this.stop(), this.start());
2283
+ else if (t !== i && t) {
2284
+ if (t.srcObject instanceof MediaStream) {
2285
+ let e = t.srcObject;
2286
+ if (e.active && e.getTracks().some((e) => e.readyState === "live")) {
2287
+ Z(t), this.lastMediaStream = e;
2288
+ return;
2289
+ }
2290
+ }
2291
+ if (this.status.value === "connected" && this.activeMode.value !== "mse") {
2292
+ let e = this.lastMediaStream;
2293
+ e?.active && e.getTracks().some((e) => e.readyState === "live") ? (t.srcObject = e, Z(t)) : this.restart();
2294
+ } else if (this.status.value === "connected" && this.activeMode.value === "mse") this.restart();
2295
+ else if (this.status.value === "connecting" || this.status.value === "reconnecting") {
2296
+ let e = s(() => this.isPlaying.value, (t) => {
2297
+ let n = this.videoElement.value;
2298
+ t && n?.srcObject instanceof MediaStream ? (Z(n), e()) : t && n && !n.srcObject && this.lastMediaStream?.active && (n.srcObject = this.lastMediaStream, Z(n), e());
2299
+ }, { immediate: !0 });
2300
+ this.stopWatchers.push(e);
2301
+ }
2302
+ }
2303
+ });
2304
+ this.stopWatchers.push(c);
2305
+ }
2306
+ isSourcePlayable(e) {
2307
+ if (this.triedSourceIds.has(e._id)) return !1;
2308
+ if (e.videoCodec !== "H265") return !0;
2309
+ let t = this.requestedMode.value;
2310
+ return an(t === "auto" ? "auto" : t === "mse" ? "mse" : "webrtc");
2311
+ }
2312
+ getSourceForResolution(e) {
2313
+ let t = this.camera.value;
2314
+ if (!t) return;
2315
+ let n = [
2316
+ "high-resolution",
2317
+ "mid-resolution",
2318
+ "low-resolution"
2319
+ ], r = Math.max(0, n.indexOf(e)), i = !1;
2320
+ for (let a = r; a < n.length; a++) {
2321
+ let r = t.sources.value.find((e) => e.role === n[a]);
2322
+ if (r) {
2323
+ if (!this.isSourcePlayable(r)) {
2324
+ i = !0;
2325
+ continue;
2326
+ }
2327
+ return {
2328
+ source: r,
2329
+ effectiveResolution: n[a],
2330
+ degradedFrom: i ? e : null
2331
+ };
2332
+ }
2333
+ }
2334
+ let a = t.streamSource.value;
2335
+ if (a && this.isSourcePlayable(a)) return {
2336
+ source: a,
2337
+ effectiveResolution: a.role ?? "low-resolution",
2338
+ degradedFrom: i ? e : null
2339
+ };
2340
+ if (i || a) return "unsupported";
2341
+ }
2342
+ initializeSource() {
2343
+ let e = this.getSourceForResolution(this.requestedResolution.value);
2344
+ 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;
2345
+ }
2346
+ setUnsupported() {
2347
+ let e = this.camera.value?.sources.value.find((e) => e.videoCodec)?.videoCodec ?? "H265";
2348
+ this.error.value = /* @__PURE__ */ Error(`${e} cannot be played on this device`), this.status.value = "unsupported";
2349
+ }
2350
+ probeSaysUnplayable(e) {
2351
+ let t = e.video.filter((e) => e.direction === "sendonly");
2352
+ if (!t.length || !t.every((e) => e.codec === "H265")) return !1;
2353
+ let n = this.requestedMode.value;
2354
+ return !an(n === "auto" ? "auto" : n === "mse" ? "mse" : "webrtc");
2355
+ }
2356
+ sourceLikelyH265() {
2357
+ let e = this.source.value;
2358
+ if (!e) return !1;
2359
+ if (e.videoCodec === "H265") return !0;
2360
+ if (e.videoCodec !== void 0) return !1;
2361
+ let t = this.probeInfo.value?.video.filter((e) => e.direction === "sendonly") ?? [];
2362
+ return t.length > 0 && t.every((e) => e.codec === "H265");
2363
+ }
2364
+ markSourceUndecodable() {
2365
+ let e = this.source.value;
2366
+ e && this.sourceLikelyH265() && this.triedSourceIds.add(e._id);
2367
+ }
2368
+ handleNoFramesWhileConnected() {
2369
+ if (this.sourceLikelyH265() && on(this.activeMode.value === "mse" ? "mse" : "webrtc"), this.requestedMode.value === "auto" && this.activeMode.value !== "mse") {
2370
+ this.webrtcHandler?.close(), this.webrtcHandler = void 0, this.activeMode.value = "mse", this.status.value = "reconnecting", this.startMSE();
2371
+ return;
2372
+ }
2373
+ this.markSourceUndecodable(), this.restart();
2374
+ }
2375
+ noteDeliveredAudio(e) {
2376
+ e && !this.hasAudio.value && (this.hasAudio.value = !0);
2377
+ }
2378
+ async probeStream() {
2379
+ let e = this.camera.value, t = this.source.value;
2380
+ if (e && t && !this.abortController.signal.aborted) try {
2381
+ let n = await e.probeStream(t._id, {
2382
+ video: !0,
2383
+ audio: ["pcma", "opus"],
2384
+ microphone: !0
2385
+ });
2386
+ 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;
2387
+ } catch {
2388
+ return;
2389
+ }
2390
+ }
2391
+ connectWebSocket() {
2392
+ this.disconnectWebSocket();
2393
+ let e = this.camera.value;
2394
+ if (this.abortController.signal.aborted || !e || !this.source.value || !this.target.value) return;
2395
+ let t = this.source.value.name ?? this.source.value.role ?? this.source.value._id, n = y(e.name.value, t);
2396
+ this.startWsConnectTimeout(), this.wsHandle = this.wsTransport.open({
2397
+ path: "/api/go2rtc",
2398
+ query: { src: n },
2399
+ binaryType: "arraybuffer"
2400
+ }), this.wsHandle.on("open", () => this.handleWsOpen()), this.wsHandle.on("close", () => this.handleWsClose()), this.wsHandle.on("message", (e) => this.handleWsMessage(e)), this.wsHandle.on("error", () => {});
2401
+ }
2402
+ disconnectWebSocket() {
2403
+ this.stopWsConnectTimeout(), this.wsHandle &&= (this.wsHandle.dispose(), void 0);
2404
+ }
2405
+ sendWsMessage(e) {
2406
+ this.wsHandle?.readyState === WebSocket.OPEN && this.wsHandle.send(JSON.stringify(e));
2407
+ }
2408
+ handleWsOpen() {
2409
+ if (this.abortController.signal.aborted) return;
2410
+ this.stopWsConnectTimeout(), this.status.value = "connecting";
2411
+ let e = this.requestedMode.value;
2412
+ e === "auto" ? this.startAutoMode() : e === "webrtc" || e === "webrtc/tcp" ? this.startWebRTC(e) : e === "mse" && this.startMSE();
2413
+ }
2414
+ handleWsClose() {
2415
+ this.status.value !== "closed" && !this.abortController.signal.aborted && this.startReconnectTimeout();
2416
+ }
2417
+ handleWsMessage(e) {
2418
+ if (!this.abortController.signal.aborted) {
2419
+ if (typeof e.data == "string") {
2420
+ let t;
2421
+ try {
2422
+ t = JSON.parse(e.data);
2423
+ } catch {
2424
+ return;
2425
+ }
2426
+ this.handleMessage(t);
2427
+ } else this.mseHandler && (this.mseHandler.appendBuffer(e.data), this.handleFirstFrame());
2428
+ }
2429
+ }
2430
+ handleMessage(e) {
2431
+ switch (e.type) {
2432
+ case "webrtc/answer":
2433
+ case "webrtc/candidate":
2434
+ this.webrtcHandler ? bn(this.webrtcHandler, e) : this.backchannelHandler && bn(this.backchannelHandler, e);
2435
+ break;
2436
+ case "mse":
2437
+ this.mseHandler && typeof e.value == "string" && (this.noteDeliveredAudio(xn.test(e.value)), this.mseHandler.initializeBuffer(e.value));
2438
+ break;
2439
+ case "error": this.requestedMode.value !== "auto" && (this.error.value = Error(e.value), this.status.value = "error");
2440
+ }
2441
+ }
2442
+ async startWebRTC(e) {
2443
+ if (this.abortController.signal.aborted) return;
2444
+ this.startConnectTimeout(), this.webrtcHandler = vn({
2445
+ mode: e,
2446
+ signal: this.abortController.signal,
2447
+ onConnected: (e) => this.handleWebRTCConnected(e),
2448
+ onDisconnected: () => this.handleWebRTCDisconnected(),
2449
+ onFailed: () => this.handleWebRTCFailed(),
2450
+ onCandidate: (e) => this.sendWsMessage({
2451
+ type: "webrtc/candidate",
2452
+ value: e
2453
+ })
2454
+ });
2455
+ let t = await this.webrtcHandler.createOffer();
2456
+ t && !this.abortController.signal.aborted && this.sendWsMessage({
2457
+ type: "webrtc/offer",
2458
+ value: t
2459
+ });
2460
+ }
2461
+ handleWebRTCConnected(e) {
2462
+ if (this.abortController.signal.aborted) return;
2463
+ let t = this.videoElement.value;
2464
+ if (t) {
2465
+ if (this.hasVideo.value && e.getVideoTracks().length === 0) {
2466
+ this.handleWebRTCFailed();
2467
+ return;
2468
+ }
2469
+ 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" }));
2470
+ }
2471
+ }
2472
+ handleWebRTCDisconnected() {
2473
+ 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());
2474
+ }
2475
+ handleWebRTCFailed() {
2476
+ 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"));
2477
+ }
2478
+ startMSE() {
2479
+ if (this.mseHandler) return;
2480
+ let e = this.videoElement.value;
2481
+ if (this.abortController.signal.aborted || !e) return;
2482
+ this.mseHandler = fn({
2483
+ videoElement: e,
2484
+ signal: this.abortController.signal,
2485
+ onReady: () => this.handleMSEReady(),
2486
+ onFirstData: () => this.handleMSEFirstData(),
2487
+ onError: (e) => {
2488
+ 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");
2489
+ }
2490
+ });
2491
+ let t = this.mseHandler.setup();
2492
+ t && (this.sendWsMessage({
2493
+ type: "mse",
2494
+ value: t
2495
+ }), this.startMseConnectTimeout());
2496
+ }
2497
+ handleMSEReady() {
2498
+ this.abortController.signal.aborted || (this.stopMseConnectTimeout(), this.requestedMode.value === "auto" && this.webrtcHandler?.isConnected || (this.activeMode.value = "mse", this.status.value = "connected"));
2499
+ }
2500
+ handleMSEFirstData() {
2501
+ if (this.abortController.signal.aborted) return;
2502
+ let e = this.videoElement.value;
2503
+ e && Z(e);
2504
+ }
2505
+ async startAutoMode() {
2506
+ if (this.abortController.signal.aborted) return;
2507
+ let e = this.probeInfo.value ?? await this.probeStream();
2508
+ if (e && !cn(e).compatible) {
2509
+ this.activeMode.value = "mse", this.startMSE();
2510
+ return;
2511
+ }
2512
+ this.startMSE(), this.startWebRTC("webrtc");
2513
+ }
2514
+ handleFirstFrame() {
2515
+ !this.isPlaying.value && !this.abortController.signal.aborted && (this.stopConnectTimeout(), this.isPlaying.value = !0);
2516
+ }
2517
+ monitorMseBuffer() {
2518
+ let e = this.videoElement.value;
2519
+ if (e && this.activeMode.value === "mse" && this.isPlaying.value && e.buffered.length > 0) {
2520
+ let t = e.buffered.end(e.buffered.length - 1);
2521
+ t - e.currentTime > 1 && (e.currentTime = t);
2522
+ }
2523
+ }
2524
+ stopMseMonitor() {
2525
+ this.mseMonitorInterval !== void 0 && (clearInterval(this.mseMonitorInterval), this.mseMonitorInterval = void 0);
2526
+ }
2527
+ handleFirstFrameWebRTC(e) {
2528
+ let t = this.videoElement.value;
2529
+ if (this.isPlaying.value || this.abortController.signal.aborted || !t) return;
2530
+ if (!e.getVideoTracks()[0]) {
2531
+ this.handleFirstFrame();
2532
+ return;
2533
+ }
2534
+ let n = t;
2535
+ if (typeof n.requestVideoFrameCallback == "function") this.firstFrameCallbackId = n.requestVideoFrameCallback(() => {
2536
+ this.abortController.signal.aborted || this.handleFirstFrame();
2537
+ });
2538
+ else {
2539
+ let e = () => {
2540
+ this.abortController.signal.aborted || (t.readyState >= 2 && t.videoWidth > 0 ? this.handleFirstFrame() : this.firstFrameCallbackId = requestAnimationFrame(e));
2541
+ };
2542
+ this.firstFrameCallbackId = requestAnimationFrame(e);
2543
+ }
2544
+ }
2545
+ cleanup() {
2546
+ 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();
2547
+ let e = this.videoElement.value;
2548
+ 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());
2549
+ }
2550
+ async startBackchannel() {
2551
+ if (this.abortController.signal.aborted || !this.wsHandle || this.wsHandle.readyState !== WebSocket.OPEN) return;
2552
+ this.backchannelHandler = yn({
2553
+ signal: this.abortController.signal,
2554
+ onCandidate: (e) => this.sendWsMessage({
2555
+ type: "webrtc/candidate",
2556
+ value: e
2557
+ }),
2558
+ onConnected: async () => {
2559
+ this.pendingMicTrack && this.backchannelHandler && await this.backchannelHandler.setMicrophoneTrack(this.pendingMicTrack);
2560
+ },
2561
+ onDisconnected: () => {
2562
+ this.backchannelHandler = void 0;
2563
+ }
2564
+ });
2565
+ let e = await this.backchannelHandler.createOffer();
2566
+ e && !this.abortController.signal.aborted && this.sendWsMessage({
2567
+ type: "webrtc/offer",
2568
+ value: e
2569
+ });
2570
+ }
2571
+ closeBackchannel() {
2572
+ this.backchannelHandler?.close(), this.backchannelHandler = void 0, this.pendingMicTrack = null;
2573
+ }
2574
+ };
2575
+ function wn(e) {
2576
+ return new Cn(e);
2577
+ }
2578
+ var Tn = class {
2579
+ streams = /* @__PURE__ */ new Map();
2580
+ releaseTimers = /* @__PURE__ */ new Map();
2581
+ releaseDelay;
2582
+ DEFAULT_RELEASE_DELAY = 2e3;
2583
+ constructor(e = {}) {
2584
+ this.releaseDelay = e.releaseDelay ?? this.DEFAULT_RELEASE_DELAY;
2585
+ }
2586
+ has(e) {
2587
+ return this.streams.has(e);
2588
+ }
2589
+ getRefCount(e) {
2590
+ return this.streams.get(e)?.refCount ?? 0;
2591
+ }
2592
+ get(e) {
2593
+ return this.streams.get(e);
2594
+ }
2595
+ acquire(e, t) {
2596
+ this.cancelRelease(e);
2597
+ let n = this.streams.get(e);
2598
+ if (n) return n.refCount++, t && n.consumerContainerRefs.add(t), n;
2599
+ }
2600
+ register(e, t, n, r, i, a) {
2601
+ this.cancelRelease(e);
2602
+ let o = {
2603
+ stream: t,
2604
+ videoElementRef: n,
2605
+ cameraDeviceRef: r,
2606
+ containerElementRef: i,
2607
+ consumerContainerRefs: /* @__PURE__ */ new Set([i]),
2608
+ sharedVideoElement: a,
2609
+ mediaStream: null,
2610
+ refCount: 1
2611
+ };
2612
+ return this.streams.set(e, o), o;
2613
+ }
2614
+ updateContainerElement(e, t) {
2615
+ let n = this.streams.get(e);
2616
+ n && (n.containerElementRef.value = t);
2617
+ }
2618
+ updateSharedVideoElement(e, t) {
2619
+ let n = this.streams.get(e);
2620
+ n && (n.sharedVideoElement = t);
2621
+ }
2622
+ updateMediaStream(e, t) {
2623
+ let n = this.streams.get(e);
2624
+ n && (n.mediaStream = t);
2625
+ }
2626
+ release(e, t, n) {
2627
+ let r = this.streams.get(e);
2628
+ if (r) {
2629
+ if (r.refCount--, n) {
2630
+ r.consumerContainerRefs.delete(n);
2631
+ let e = r.sharedVideoElement, t = n.value, i = e?.parentElement ?? null;
2632
+ if (r.refCount > 0 && e && (i === t || i === null || !i.isConnected)) {
2633
+ let n = this.pickVisibleConsumer(r, t);
2634
+ n && (r.containerElementRef = n.ref, e.parentElement !== n.el && (n.el.appendChild(e), e.play().catch(() => {})));
2635
+ }
2636
+ }
2637
+ if (r.refCount <= 0) {
2638
+ let t = setTimeout(() => {
2639
+ this.doRelease(e);
2640
+ }, this.releaseDelay);
2641
+ this.releaseTimers.set(e, t);
2642
+ }
2643
+ }
2644
+ }
2645
+ forceRelease(e) {
2646
+ this.cancelRelease(e), this.doRelease(e);
2647
+ }
2648
+ clear() {
2649
+ for (let e of this.releaseTimers.values()) clearTimeout(e);
2650
+ this.releaseTimers.clear();
2651
+ for (let [e, t] of this.streams) En(t.stream), this.streams.delete(e);
2652
+ }
2653
+ getDebugInfo() {
2654
+ return Array.from(this.streams.entries()).map(([e, t]) => ({
2655
+ cameraName: e,
2656
+ refCount: t.refCount,
2657
+ mode: t.stream.activeMode.value,
2658
+ resolution: t.stream.activeResolution.value
2659
+ }));
2660
+ }
2661
+ pickVisibleConsumer(e, t) {
2662
+ let n;
2663
+ for (let r of e.consumerContainerRefs) {
2664
+ let e = r.value;
2665
+ if (e && e !== t && e.isConnected) {
2666
+ if (e.checkVisibility?.() ?? e.offsetParent !== null) return {
2667
+ ref: r,
2668
+ el: e
2669
+ };
2670
+ n ??= {
2671
+ ref: r,
2672
+ el: e
2673
+ };
2674
+ }
2675
+ }
2676
+ return n;
2677
+ }
2678
+ cancelRelease(e) {
2679
+ let t = this.releaseTimers.get(e);
2680
+ t && (clearTimeout(t), this.releaseTimers.delete(e));
2681
+ }
2682
+ doRelease(e) {
2683
+ let t = this.streams.get(e);
2684
+ t && (t.refCount <= 0 && (En(t.stream), this.streams.delete(e)), this.releaseTimers.delete(e));
2685
+ }
2686
+ };
2687
+ function En(e) {
2688
+ let t = e;
2689
+ typeof t.destroy == "function" ? t.destroy() : t.stop();
2690
+ }
2691
+ var $ = new Tn(), Dn = /* @__PURE__ */ new WeakMap(), On = null;
2692
+ function kn(e) {
2693
+ On = e;
2694
+ }
2695
+ var An = [], jn = c(null);
2696
+ function Mn() {
2697
+ jn.value = An[An.length - 1] ?? null;
2698
+ }
2699
+ function Nn() {
2700
+ return o(() => jn.value);
2701
+ }
2702
+ function Pn(e, t = {}) {
2703
+ let r = t.mode ?? "fit", i = l(!1), a = c(null);
2704
+ s(() => n(e), (e) => {
2705
+ a.value = e ?? null;
2706
+ }, { immediate: !0 });
2707
+ function u(e) {
2708
+ e.key === "Escape" && i.value && p();
2709
+ }
2710
+ async function f() {
2711
+ let e = a.value;
2712
+ if (!e || i.value) return;
2713
+ let t = document.createElement("div");
2714
+ t.className = `cui-fullscreen cui-fullscreen-${r}`, Fn(t, r);
2715
+ let n = {
2716
+ wrapper: t,
2717
+ parent: e.parentElement,
2718
+ next: e.nextSibling,
2719
+ bodyOverflow: document.body.style.overflow,
2720
+ htmlOverflow: document.documentElement.style.overflow
2721
+ };
2722
+ 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;
2723
+ }
2724
+ async function p() {
2725
+ let e = a.value;
2726
+ if (!e || !i.value) return;
2727
+ let t = Dn.get(e);
2728
+ if (!t) return;
2729
+ 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);
2730
+ let n = An.indexOf(t.wrapper);
2731
+ n !== -1 && An.splice(n, 1), Mn(), i.value = !1;
2732
+ }
2733
+ async function m() {
2734
+ i.value ? await p() : await f();
2735
+ }
2736
+ return d(() => {
2737
+ i.value && a.value && p(), document.removeEventListener("keydown", u);
2738
+ }), {
2739
+ isFullscreen: o(() => i.value),
2740
+ isSupported: o(() => !0),
2741
+ enter: f,
2742
+ exit: p,
2743
+ toggle: m
2744
+ };
2745
+ }
2746
+ function Fn(e, t) {
2747
+ let n = {
2748
+ position: "fixed",
2749
+ top: "0",
2750
+ right: "0",
2751
+ bottom: "0",
2752
+ left: "0",
2753
+ zIndex: "2147483647",
2754
+ margin: "0",
2755
+ background: "black",
2756
+ paddingTop: "env(safe-area-inset-top)",
2757
+ paddingRight: "env(safe-area-inset-right)",
2758
+ paddingBottom: "env(safe-area-inset-bottom)",
2759
+ paddingLeft: "env(safe-area-inset-left)",
2760
+ boxSizing: "border-box"
2761
+ };
2762
+ t === "fit" ? Object.assign(e.style, n, {
2763
+ display: "flex",
2764
+ alignItems: "center",
2765
+ justifyContent: "center",
2766
+ overflow: "hidden"
2767
+ }) : Object.assign(e.style, n, {
2768
+ display: "block",
2769
+ overflowY: "auto",
2770
+ overflowX: "hidden",
2771
+ WebkitOverflowScrolling: "touch",
2772
+ overscrollBehavior: "contain"
2773
+ });
2774
+ }
2775
+ var In = 75, Ln = 500, Rn = 0, zn = 0;
2776
+ function Bn() {
2777
+ let e = performance.now();
2778
+ e - zn > Ln && (Rn = 0);
2779
+ let t = Rn * In;
2780
+ return Rn++, zn = e, t;
2781
+ }
2782
+ function Vn(e) {
2783
+ return !e || !e.isConnected ? !1 : e.checkVisibility?.() ?? e.offsetParent !== null;
2784
+ }
2785
+ function Hn(e) {
2786
+ 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(() => {
2787
+ let e = v.value;
2788
+ return typeof e == "string" ? e : e.name.value;
2789
+ }), { 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);
2790
+ m > 0 && (T = setTimeout(() => {
2791
+ I.value = !0;
2792
+ }, m)), s(w, (e) => {
2793
+ M.value = e;
2794
+ }, { immediate: !0 });
2795
+ 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({
2796
+ initialMode: n(e.activityMode) ?? "always-on",
2797
+ config: r,
2798
+ onStreamStart: () => {
2799
+ L.value || j.value?.start();
2800
+ },
2801
+ onStreamStop: () => {
2802
+ if (N.value) {
2803
+ let e = D ?? b.value;
2804
+ if (e && $.getRefCount(e) > 1) return;
2805
+ }
2806
+ j.value?.stop();
2807
+ },
2808
+ isStreamPlaying: () => z.value
2809
+ }), { isFullscreen: ve, toggle: ye } = Pn(_e);
2810
+ function be() {
2811
+ return E = wn({
2812
+ camera: M,
2813
+ videoElement: A,
2814
+ containerElement: O,
2815
+ mode: o(() => n(e.mode) ?? "auto"),
2816
+ resolution: o(() => n(e.resolution) ?? "high-resolution"),
2817
+ autoStart: !1
2818
+ }), E;
2819
+ }
2820
+ let W = be();
2821
+ function xe() {
2822
+ let e = document.createElement("video");
2823
+ 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;
2824
+ }
2825
+ function Se(e, t) {
2826
+ e.parentElement && e.parentElement !== t && e.parentElement.removeChild(e), e.parentElement !== t && t.appendChild(e);
2827
+ }
2828
+ function Ce() {
2829
+ if (u) return;
2830
+ let e = O.value, t = k.value;
2831
+ if (!e || !t || t.parentElement === e || !Vn(e) || Vn(t.parentElement)) return;
2832
+ Se(t, e), t.play().catch(() => {});
2833
+ let n = b.value, r = n ? $.get(n) : void 0;
2834
+ r && (r.containerElementRef = O);
2835
+ }
2836
+ function we() {
2837
+ re.value = !0;
2838
+ }
2839
+ function Te() {
2840
+ re.value = !1;
2841
+ }
2842
+ function Ee() {
2843
+ if (P.value) return;
2844
+ let e = O.value, t = w.value;
2845
+ if (!e || !t || !g.value) return;
2846
+ P.value = !0, N.value = !1, j.value = W;
2847
+ let n = xe();
2848
+ k.value = n, A.value = n, p() && I.value && U.mode.value === "always-on" && !L.value && W.start();
2849
+ }
2850
+ function G() {
2851
+ if (P.value) return;
2852
+ if (u) {
2853
+ Ee();
2854
+ return;
2855
+ }
2856
+ let e = O.value, t = b.value, n = w.value;
2857
+ if (!e || !t || !g.value) return;
2858
+ let r = $.get(t);
2859
+ if (r && r.refCount > 0) {
2860
+ let n = r.containerElementRef.value;
2861
+ if (n && n !== e && Vn(n)) {
2862
+ f || (f = setTimeout(() => {
2863
+ if (f = void 0, F.value || P.value) return;
2864
+ let e = $.get(t), n = e?.containerElementRef.value;
2865
+ e && e.refCount > 0 && n && n !== O.value && Vn(n) && (u = !0), G();
2866
+ }, 200), h.push(() => {
2867
+ f && clearTimeout(f), f = void 0;
2868
+ }));
2869
+ return;
2870
+ }
2871
+ }
2872
+ let i = $.acquire(t, O);
2873
+ if (i) {
2874
+ P.value = !0, D = t, N.value = !0, j.value = i.stream, n && i.cameraDeviceRef && (i.cameraDeviceRef.value = n);
2875
+ let r = i.sharedVideoElement;
2876
+ 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));
2877
+ } else if (n) {
2878
+ P.value = !0, D = t, N.value = !1, j.value = W;
2879
+ let e = xe();
2880
+ 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();
2881
+ let n = s(() => W.isPlaying.value, (n) => {
2882
+ n && e.srcObject instanceof MediaStream && $.updateMediaStream(t, e.srcObject);
2883
+ }, { immediate: !0 });
2884
+ h.push(n);
2885
+ let r = s(() => W.status.value, (n) => {
2886
+ n === "connected" && e.srcObject instanceof MediaStream && $.updateMediaStream(t, e.srcObject);
2887
+ });
2888
+ h.push(r);
2889
+ }
2890
+ }
2891
+ function K(e, t, n) {
2892
+ if (!e) return;
2893
+ let r = e.stream, i = r.activeMode.value, a = r.status.value, o = e.mediaStream?.active && e.mediaStream.getTracks().some((e) => e.readyState === "live");
2894
+ 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));
2895
+ }
2896
+ function De(e, t, n) {
2897
+ let r = s([() => e.isPlaying.value, () => e.status.value], ([e, i]) => {
2898
+ if (i === "connected" || e) {
2899
+ let e = $.get(n)?.mediaStream;
2900
+ 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());
2901
+ }
2902
+ }, { immediate: !0 });
2903
+ h.push(r);
2904
+ }
2905
+ function Oe(e, t, n) {
2906
+ let r = e.status.value !== "connected", i = s(() => e.status.value, (e) => {
2907
+ e === "reconnecting" || e === "connecting" ? r = !0 : e === "connected" && r && (r = !1, setTimeout(() => {
2908
+ t.srcObject instanceof MediaStream && ($.updateMediaStream(n, t.srcObject), t.play().catch(() => {}));
2909
+ }, 100));
2910
+ }, { immediate: !0 });
2911
+ h.push(i);
2912
+ let a = s(() => e.isPlaying.value, (r) => {
2913
+ r && e.activeMode.value !== "mse" && t.srcObject instanceof MediaStream && ($.updateMediaStream(n, t.srcObject), t.play().catch(() => {}));
2914
+ }, { immediate: !0 });
2915
+ h.push(a);
2916
+ }
2917
+ async function ke() {
2918
+ L.value || (U.inStandby.value ? U.resumeFromStandby() : await j.value?.start());
2919
+ }
2920
+ function Ae() {
2921
+ j.value?.stop();
2922
+ }
2923
+ async function je() {
2924
+ await j.value?.restart();
2925
+ }
2926
+ function Me() {
2927
+ L.value || U.resumeFromStandby();
2928
+ }
2929
+ async function Ne(e) {
2930
+ let t = b.value;
2931
+ t && $.updateMediaStream(t, null), await j.value?.setMode(e);
2932
+ }
2933
+ async function Pe(e) {
2934
+ await j.value?.setResolution(e);
2935
+ }
2936
+ async function Fe(e) {
2937
+ await j.value?.setMicrophone(e);
2938
+ }
2939
+ function Ie(e) {
2940
+ U.setMode(e);
2941
+ }
2942
+ function Le(e) {
2943
+ U.reportActivity(e);
2944
+ }
2945
+ function Re(e) {
2946
+ j.value?.setMuted(e);
2947
+ let t = k.value;
2948
+ t && (t.muted = e);
2949
+ }
2950
+ async function ze() {
2951
+ await j.value?.play();
2952
+ }
2953
+ function Be() {
2954
+ j.value?.pause();
2955
+ }
2956
+ function Ve() {
2957
+ document.pictureInPictureElement ? document.exitPictureInPicture() : document.pictureInPictureEnabled && k.value && k.value.requestPictureInPicture();
2958
+ }
2959
+ function He() {
2960
+ let e = k.value;
2961
+ if (!e || e.videoWidth === 0) return null;
2962
+ let t = document.createElement("canvas");
2963
+ return t.width = e.videoWidth, t.height = e.videoHeight, t.getContext("2d")?.drawImage(e, 0, 0), t.toDataURL("image/png");
2964
+ }
2965
+ function Ue() {
2966
+ if (F.value) return;
2967
+ F.value = !0, T &&= (clearTimeout(T), void 0), j.value?.setMuted(!0);
2968
+ let e = k.value;
2969
+ e && (e.muted = !0);
2970
+ for (let e of h) e();
2971
+ if (h.length = 0, u) E?.destroy();
2972
+ else {
2973
+ let e = D, t = k.value;
2974
+ e && P.value && $.release(e, t, O), (!P.value || j.value !== W) && E?.destroy();
2975
+ }
2976
+ U.dispose();
2977
+ }
2978
+ function We(t) {
2979
+ let r = n(e.canvasStyle), i = n(e.canvasClass);
2980
+ if (r) {
2981
+ if (typeof r == "string") t.style.cssText += ";" + r;
2982
+ else if (Array.isArray(r)) for (let e of r) typeof e == "string" ? t.style.cssText += ";" + e : e && Object.assign(t.style, e);
2983
+ else Object.assign(t.style, r);
2984
+ }
2985
+ if (i) {
2986
+ if (typeof i == "string") t.className = i;
2987
+ else if (Array.isArray(i)) t.className = i.filter(Boolean).join(" ");
2988
+ else for (let [e, n] of Object.entries(i)) t.classList.toggle(e, !!n);
2989
+ }
2990
+ }
2991
+ if (!a && typeof IntersectionObserver < "u") {
2992
+ let e, t = s(O, (t) => {
2993
+ e?.disconnect(), e = void 0, t && (e = new IntersectionObserver((e) => {
2994
+ e.some((e) => e.isIntersecting) && Ce();
2995
+ }), e.observe(t));
2996
+ }, { immediate: !0 });
2997
+ h.push(() => {
2998
+ t(), e?.disconnect();
2999
+ });
3000
+ }
3001
+ if (e.canvasStyle !== void 0 || e.canvasClass !== void 0) {
3002
+ let e, t = s(O, (t) => {
3003
+ if (e?.(), e = void 0, !t) return;
3004
+ Array.from(t.querySelectorAll("canvas")).forEach((e) => {
3005
+ We(e);
3006
+ });
3007
+ let n = new MutationObserver((e) => {
3008
+ for (let t of e) Array.from(t.addedNodes).forEach((e) => {
3009
+ e instanceof HTMLCanvasElement ? We(e) : e instanceof HTMLElement && Array.from(e.querySelectorAll("canvas")).forEach((e) => We(e));
3010
+ });
3011
+ });
3012
+ n.observe(t, {
3013
+ childList: !0,
3014
+ subtree: !0
3015
+ }), e = () => n.disconnect();
3016
+ }, { immediate: !0 });
3017
+ h.push(() => {
3018
+ t(), e?.();
3019
+ });
3020
+ }
3021
+ if (e.videoStyle !== void 0 || e.videoClass !== void 0) {
3022
+ let t = s([
3023
+ k,
3024
+ () => n(e.videoStyle),
3025
+ () => n(e.videoClass)
3026
+ ], ([e, t, n]) => {
3027
+ if (e) {
3028
+ if (t) {
3029
+ if (typeof t == "string") e.style.cssText += ";" + t;
3030
+ else if (Array.isArray(t)) for (let n of t) typeof n == "string" ? e.style.cssText += ";" + n : n && Object.assign(e.style, n);
3031
+ else Object.assign(e.style, t);
3032
+ }
3033
+ if (n) {
3034
+ if (typeof n == "string") e.className = n;
3035
+ else if (Array.isArray(n)) e.className = n.filter(Boolean).join(" ");
3036
+ else for (let [t, r] of Object.entries(n)) e.classList.toggle(t, r);
3037
+ }
3038
+ }
3039
+ }, { immediate: !0 });
3040
+ h.push(t);
3041
+ }
3042
+ let Ge = s([() => j.value?.nativeWidth.value, () => j.value?.nativeHeight.value], ([e, t]) => {
3043
+ e && e > 0 && (te.value = e), t && t > 0 && (ne.value = t);
3044
+ });
3045
+ h.push(Ge);
3046
+ let Ke = s(k, (e, t) => {
3047
+ t && (t.removeEventListener("enterpictureinpicture", we), t.removeEventListener("leavepictureinpicture", Te)), e && (e.addEventListener("enterpictureinpicture", we), e.addEventListener("leavepictureinpicture", Te));
3048
+ }, { immediate: !0 });
3049
+ return h.push(Ke), s([O, k], ([e, t]) => {
3050
+ e && t && Se(t, e);
3051
+ }, { immediate: !0 }), s(() => n(e.activityMode), (e) => {
3052
+ e && e !== U.mode.value && U.setMode(e);
3053
+ }), s([
3054
+ O,
3055
+ w,
3056
+ g,
3057
+ I
3058
+ ], () => {
3059
+ P.value ? I.value && p() && U.mode.value === "always-on" && !z.value && R.value === "idle" && !L.value && j.value?.start() : G();
3060
+ }, { immediate: !0 }), s(L, (e, t) => {
3061
+ P.value && (!t && e ? j.value?.stop() : t && !e && p() && j.value?.restart());
3062
+ }), t(Ue), d(Ue), {
3063
+ status: R,
3064
+ isPlaying: z,
3065
+ activeMode: ie,
3066
+ activeResolution: ae,
3067
+ degradedFrom: oe,
3068
+ unsupported: se,
3069
+ hasAudio: B,
3070
+ hasBackchannel: V,
3071
+ error: ce,
3072
+ isReconnecting: le,
3073
+ activityMode: U.mode,
3074
+ inStandby: U.inStandby,
3075
+ hasActivity: U.hasActivity,
3076
+ isBusy: ue,
3077
+ hasSound: de,
3078
+ hasIntercom: pe,
3079
+ videoElement: k,
3080
+ containerElement: O,
3081
+ fullscreenElement: ee,
3082
+ renderElement: ge,
3083
+ stream: j,
3084
+ muted: me,
3085
+ paused: H,
3086
+ nativeWidth: te,
3087
+ nativeHeight: ne,
3088
+ isPip: re,
3089
+ supportsPip: he,
3090
+ isFullscreen: ve,
3091
+ start: ke,
3092
+ stop: Ae,
3093
+ restart: je,
3094
+ resumeFromStandby: Me,
3095
+ setMode: Ne,
3096
+ setResolution: Pe,
3097
+ setMicrophone: Fe,
3098
+ setActivityMode: Ie,
3099
+ reportActivity: Le,
3100
+ setMuted: Re,
3101
+ play: ze,
3102
+ pause: Be,
3103
+ togglePip: Ve,
3104
+ isCameraDisabled: L,
3105
+ toggleFullscreen: ye,
3106
+ captureScreenshot: He
3107
+ };
3108
+ }
3109
+ function Un() {
3110
+ let e = _(), t = b.coreManagerNamespaces(), n = (e) => e.createProxy(t.coreManagerRpc);
3111
+ return {
3112
+ getFFmpegPath: () => C(e.rpc, (e) => n(e).getFFmpegPath()),
3113
+ getServerAddresses: () => C(e.rpc, (e) => n(e).getServerAddresses()),
3114
+ getPluginsByInterface: (t) => C(e.rpc, (e) => n(e).getPluginsByInterface(t)),
3115
+ getCloudServerId: () => C(e.rpc, (e) => n(e).getCloudServerId())
3116
+ };
3117
+ }
3118
+ var Wn = 1500, Gn = 3e4, Kn = /* @__PURE__ */ new Map();
3119
+ function qn(e) {
3120
+ let t = _(), n = l({ status: "disconnected" }), r = l(null), i = null, a = (n) => C(t.rpc, async (r) => {
3121
+ let i = await ut(t.rpc, e);
3122
+ if (!i) throw Error(`Plugin "${e}" not found`);
3123
+ return n(r.createProxy(b.pluginNamespaces(i).pluginChildRpc));
3124
+ });
3125
+ async function o() {
3126
+ n.value = await a((e) => e.getOAuthState()), r.value ||= await a((e) => e.getOAuthMetadata());
3127
+ }
3128
+ function c(e) {
3129
+ i && clearInterval(i), i = setInterval(() => {
3130
+ o().catch(() => void 0);
3131
+ }, e);
3132
+ }
3133
+ return s(() => n.value.status, (e) => {
3134
+ c(e === "awaiting_user" || e === "polling" ? Wn : Gn);
3135
+ }, { immediate: !0 }), o().catch(() => void 0), {
3136
+ state: n,
3137
+ metadata: r,
3138
+ call: a,
3139
+ refresh: o
3140
+ };
3141
+ }
3142
+ function Jn(e) {
3143
+ Kn.has(e) || Kn.set(e, qn(e));
3144
+ let { state: t, metadata: n, call: r, refresh: i } = Kn.get(e);
3145
+ async function a(e) {
3146
+ t.value = await r((t) => t.startDeviceFlow(e));
3147
+ }
3148
+ async function o(e) {
3149
+ t.value = await r((t) => t.startAuthCodeFlow(e));
3150
+ }
3151
+ async function s() {
3152
+ (t.value.status === "awaiting_user" || t.value.status === "polling") && await r((e) => e.cancelDeviceFlow?.() ?? e.cancelAuthCodeFlow?.() ?? Promise.resolve()), await i();
3153
+ }
3154
+ async function c() {
3155
+ await r((e) => e.disconnect()), await i();
3156
+ }
3157
+ return {
3158
+ state: t,
3159
+ metadata: n,
3160
+ startDeviceFlow: a,
3161
+ startAuthCodeFlow: o,
3162
+ cancel: s,
3163
+ disconnect: c,
3164
+ refresh: i
3165
+ };
3166
+ }
3167
+ function Yn() {
3168
+ let e = _(), { rpc: t, isConnected: n } = e, r = b.terminalManagerNamespaces(), a = c(), o = l(!1), s = l(!1), u = l(), f = l({
3169
+ cols: 80,
3170
+ rows: 24
3171
+ }), p, m, h = 0, g = (e) => e.createProxy(r.terminalManagerRpc);
3172
+ async function v(e) {
3173
+ if (!(s.value || o.value)) {
3174
+ s.value = !0, u.value = void 0, m = e;
3175
+ try {
3176
+ let n = await C(t, (t) => g(t).createSession({
3177
+ cols: e?.cols ?? 80,
3178
+ rows: e?.rows ?? 24,
3179
+ cwd: e?.cwd,
3180
+ shell: e?.shell,
3181
+ env: e?.env
3182
+ }));
3183
+ a.value = n.sessionId, f.value = n.dimensions, o.value = !0, p = new AbortController();
3184
+ let r = ++h;
3185
+ y(n.sessionId, e, r);
3186
+ } catch (t) {
3187
+ u.value = t instanceof Error ? t : Error(String(t)), e?.onError?.(u.value);
3188
+ } finally {
3189
+ s.value = !1;
3190
+ }
3191
+ }
3192
+ }
3193
+ async function y(e, n, r) {
3194
+ try {
3195
+ let i = t.value;
3196
+ if (!i) return;
3197
+ for await (let t of g(i).generateOutput(e)) {
3198
+ if (r !== h || p?.signal.aborted) break;
3199
+ n?.onData?.(t);
3200
+ }
3201
+ } catch (e) {
3202
+ r === h && !p?.signal.aborted && (u.value = e instanceof Error ? e : Error(String(e)), n?.onError?.(u.value));
3203
+ } finally {
3204
+ r === h && !p?.signal.aborted && (o.value = !1, n?.onClose?.());
3205
+ }
3206
+ }
3207
+ async function x(e) {
3208
+ if (a.value && o.value) try {
3209
+ await C(t, (t) => g(t).writeInput(a.value, e));
3210
+ } catch (e) {
3211
+ u.value = e instanceof Error ? e : Error(String(e)), m?.onError?.(u.value);
3212
+ }
3213
+ }
3214
+ async function S(e) {
3215
+ if (a.value && o.value) try {
3216
+ await C(t, (t) => g(t).resize(a.value, e)), f.value = e;
3217
+ } catch (e) {
3218
+ u.value = e instanceof Error ? e : Error(String(e)), m?.onError?.(u.value);
3219
+ }
3220
+ }
3221
+ async function w() {
3222
+ if (p?.abort(), h++, a.value) try {
3223
+ await C(t, (e) => g(e).closeSession(a.value), {
3224
+ awaitConnect: !1,
3225
+ maxRetries: 0
3226
+ });
3227
+ } catch {}
3228
+ a.value = void 0, o.value = !1, m = void 0;
3229
+ }
3230
+ function T() {
3231
+ if (!a.value && !o.value) return;
3232
+ let e = m;
3233
+ p?.abort(), h++, a.value = void 0, o.value = !1, m = void 0, e?.onClose?.(), e && v(e);
3234
+ }
3235
+ return e.on("reconnected", T), d(() => {
3236
+ e.off("reconnected", T), w();
3237
+ }), {
3238
+ sessionId: i(a),
3239
+ isConnected: i(o),
3240
+ isConnecting: i(s),
3241
+ isClientConnected: i(n),
3242
+ error: i(u),
3243
+ dimensions: i(f),
3244
+ connect: v,
3245
+ write: x,
3246
+ resize: S,
3247
+ close: w
3248
+ };
3249
+ }
3250
+ //#endregion
3251
+ 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 };