zigbee2mqtt-windfront 2.3.0 → 2.3.1

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 (245) hide show
  1. package/dist/assets/{About-5ive9jRR.js → About-i-o7Fha7.js} +1 -1
  2. package/dist/assets/About-i-o7Fha7.js.br +0 -0
  3. package/dist/assets/{ActivityPage--C5u0Bwf.js → ActivityPage-GriRdyJK.js} +1 -1
  4. package/dist/assets/ActivityPage-GriRdyJK.js.br +0 -0
  5. package/dist/assets/{Availability-CCOMrAvr.js → Availability-YPjK9GZh.js} +1 -1
  6. package/dist/assets/Availability-YPjK9GZh.js.br +0 -0
  7. package/dist/assets/{Bind-G3e44cBT.js → Bind-Cvv2GXES.js} +1 -1
  8. package/dist/assets/Bind-Cvv2GXES.js.br +0 -0
  9. package/dist/assets/{BindRow-CXKtFkgv.js → BindRow-D9Od6x88.js} +1 -1
  10. package/dist/assets/BindRow-D9Od6x88.js.br +0 -0
  11. package/dist/assets/{BindingsPage-CH_6pS0h.js → BindingsPage-MMC7xnsC.js} +1 -1
  12. package/dist/assets/BindingsPage-MMC7xnsC.js.br +0 -0
  13. package/dist/assets/Bridge-C1yjMZnP.js +1 -0
  14. package/dist/assets/Bridge-C1yjMZnP.js.br +0 -0
  15. package/dist/assets/{CheckboxField-Vzfuua4m.js → CheckboxField-DDGxPCob.js} +1 -1
  16. package/dist/assets/CheckboxField-DDGxPCob.js.br +0 -0
  17. package/dist/assets/{ClusterSinglePicker-QVTVTJNd.js → ClusterSinglePicker-wRw4n9xD.js} +1 -1
  18. package/dist/assets/ClusterSinglePicker-wRw4n9xD.js.br +0 -0
  19. package/dist/assets/{Clusters-D_aeY0uN.js → Clusters-DchCgFcV.js} +1 -1
  20. package/dist/assets/Clusters-DchCgFcV.js.br +0 -0
  21. package/dist/assets/{ContributePage-CsEFC-N4.js → ContributePage-CyXoSvR_.js} +1 -1
  22. package/dist/assets/ContributePage-CyXoSvR_.js.br +0 -0
  23. package/dist/assets/{Dashboard-C3XyJ2vr.js → Dashboard-Bl8dJ0ah.js} +1 -1
  24. package/dist/assets/Dashboard-Bl8dJ0ah.js.br +0 -0
  25. package/dist/assets/{DashboardFeatureWrapper-IF-AwBR9.js → DashboardFeatureWrapper-UEMN2W33.js} +1 -1
  26. package/dist/assets/DashboardFeatureWrapper-UEMN2W33.js.br +0 -0
  27. package/dist/assets/{DebouncedInput-seIGAyZ5.js → DebouncedInput-B_mSPoL2.js} +1 -1
  28. package/dist/assets/DebouncedInput-B_mSPoL2.js.br +0 -0
  29. package/dist/assets/{DevConsole-rjP-ffwt.js → DevConsole-BGDUMunS.js} +1 -1
  30. package/dist/assets/DevConsole-BGDUMunS.js.br +0 -0
  31. package/dist/assets/{DevConsole-BBhhdBhq.js → DevConsole-DAJXOXwE.js} +1 -1
  32. package/dist/assets/DevConsole-DAJXOXwE.js.br +0 -0
  33. package/dist/assets/{DeviceCard-CqM8-MYx.js → DeviceCard-CE7t_uOW.js} +1 -1
  34. package/dist/assets/DeviceCard-CE7t_uOW.js.br +0 -0
  35. package/dist/assets/{DeviceImage-B6w8VrRf.js → DeviceImage-C6iSUjiJ.js} +1 -1
  36. package/dist/assets/DeviceImage-C6iSUjiJ.js.br +0 -0
  37. package/dist/assets/{DeviceInfo-GbR6czw4.js → DeviceInfo-BGYj26ZS.js} +1 -1
  38. package/dist/assets/DeviceInfo-BGYj26ZS.js.br +0 -0
  39. package/dist/assets/{DevicePage-DQQwZi4s.js → DevicePage-D4AS3RcM.js} +2 -2
  40. package/dist/assets/DevicePage-D4AS3RcM.js.br +0 -0
  41. package/dist/assets/{DevicePicker-Dr-4DW3x.js → DevicePicker-Eg-X3fKz.js} +1 -1
  42. package/dist/assets/DevicePicker-Eg-X3fKz.js.br +0 -0
  43. package/dist/assets/{DeviceSettings-DSNlkxW0.js → DeviceSettings-CduJmEdd.js} +1 -1
  44. package/dist/assets/DeviceSettings-CduJmEdd.js.br +0 -0
  45. package/dist/assets/{DeviceSpecificSettings-LjumBfx3.js → DeviceSpecificSettings-DW4AG8ZF.js} +1 -1
  46. package/dist/assets/DeviceSpecificSettings-DW4AG8ZF.js.br +0 -0
  47. package/dist/assets/{Devices-zZY0L8yI.js → Devices-BFJMMQk1.js} +1 -1
  48. package/dist/assets/Devices-BFJMMQk1.js.br +0 -0
  49. package/dist/assets/{DevicesPage-DRLz02x5.js → DevicesPage-WM7hxalV.js} +1 -1
  50. package/dist/assets/DevicesPage-WM7hxalV.js.br +0 -0
  51. package/dist/assets/{DisplayValue-Cko1Z4Vm.js → DisplayValue-BZ-eaAKu.js} +1 -1
  52. package/dist/assets/DisplayValue-BZ-eaAKu.js.br +0 -0
  53. package/dist/assets/{Duration-bceKVeXp.js → Duration-CzwYBX29.js} +1 -1
  54. package/dist/assets/Duration-CzwYBX29.js.br +0 -0
  55. package/dist/assets/{EndpointPicker-_bkZcPK6.js → EndpointPicker-DtqElVGb.js} +1 -1
  56. package/dist/assets/EndpointPicker-DtqElVGb.js.br +0 -0
  57. package/dist/assets/{Exposes-g-STiMw5.js → Exposes-DfrJAUra.js} +1 -1
  58. package/dist/assets/Exposes-DfrJAUra.js.br +0 -0
  59. package/dist/assets/{Feature-CsgctMqC.js → Feature-BJ8zY1Ga.js} +1 -1
  60. package/dist/assets/Feature-BJ8zY1Ga.js.br +0 -0
  61. package/dist/assets/{FrontendSettingsPage-Dwmoevlm.js → FrontendSettingsPage-CA1akody.js} +1 -1
  62. package/dist/assets/FrontendSettingsPage-CA1akody.js.br +0 -0
  63. package/dist/assets/{GroupPage-Cb9sV0Iq.js → GroupPage-fVYGZqzs.js} +2 -2
  64. package/dist/assets/GroupPage-fVYGZqzs.js.br +0 -0
  65. package/dist/assets/{GroupSettings-kzS_7sXT.js → GroupSettings-2DGc5J43.js} +1 -1
  66. package/dist/assets/GroupSettings-2DGc5J43.js.br +0 -0
  67. package/dist/assets/{Groups-CM897513.js → Groups-9FD4ZbHT.js} +1 -1
  68. package/dist/assets/Groups-9FD4ZbHT.js.br +0 -0
  69. package/dist/assets/{GroupsPage-DP7kWqhf.js → GroupsPage-DIXFxgLg.js} +1 -1
  70. package/dist/assets/GroupsPage-DIXFxgLg.js.br +0 -0
  71. package/dist/assets/{Health-78h6mZZ_.js → Health-BwDAB_DL.js} +1 -1
  72. package/dist/assets/Health-BwDAB_DL.js.br +0 -0
  73. package/dist/assets/{HomePage-gMeQdB1N.js → HomePage-CA93CxkX.js} +1 -1
  74. package/dist/assets/HomePage-CA93CxkX.js.br +0 -0
  75. package/dist/assets/{IndeterminateCheckbox-BV6gyFHo.js → IndeterminateCheckbox-xTLsM_wF.js} +1 -1
  76. package/dist/assets/IndeterminateCheckbox-xTLsM_wF.js.br +0 -0
  77. package/dist/assets/InfoAlert-BEMI4UFc.js +1 -0
  78. package/dist/assets/InfoAlert-BEMI4UFc.js.br +0 -0
  79. package/dist/assets/{InputField-CLgeChp0.js → InputField-BYfjYPOY.js} +1 -1
  80. package/dist/assets/InputField-BYfjYPOY.js.br +0 -0
  81. package/dist/assets/{Json-C725FVKM.js → Json-Bv-xu1u4.js} +1 -1
  82. package/dist/assets/Json-Bv-xu1u4.js.br +0 -0
  83. package/dist/assets/{LastSeen-DF8tUMAo.js → LastSeen-DA4kaWWb.js} +1 -1
  84. package/dist/assets/LastSeen-DA4kaWWb.js.br +0 -0
  85. package/dist/assets/{LogsPage-ChO7b4nK.js → LogsPage-DggXPpYo.js} +1 -1
  86. package/dist/assets/LogsPage-DggXPpYo.js.br +0 -0
  87. package/dist/assets/Lqi-BLFaxsM9.js +1 -0
  88. package/dist/assets/Lqi-BLFaxsM9.js.br +0 -0
  89. package/dist/assets/{NetworkPage-BhbmupcB.js → NetworkPage-fX6p5Jft.js} +2 -2
  90. package/dist/assets/NetworkPage-fX6p5Jft.js.br +0 -0
  91. package/dist/assets/{NumberField-fT7hilHb.js → NumberField-DVKVcA4j.js} +1 -1
  92. package/dist/assets/NumberField-DVKVcA4j.js.br +0 -0
  93. package/dist/assets/{OtaPage-CdSMJpcl.js → OtaPage-Bam-Dpba.js} +1 -1
  94. package/dist/assets/OtaPage-Bam-Dpba.js.br +0 -0
  95. package/dist/assets/{PowerSource-D9Tnu98A.js → PowerSource-D71Ibdxv.js} +1 -1
  96. package/dist/assets/PowerSource-D71Ibdxv.js.br +0 -0
  97. package/dist/assets/{RawNetworkData-DbCpzrKF.js → RawNetworkData-CTWMGGj7.js} +2 -2
  98. package/dist/assets/RawNetworkData-CTWMGGj7.js.br +0 -0
  99. package/dist/assets/{RawNetworkMap-D5AQXjYA.js → RawNetworkMap-C2gM7U6b.js} +2 -2
  100. package/dist/assets/RawNetworkMap-C2gM7U6b.js.br +0 -0
  101. package/dist/assets/{RecallRemove-_liyNDej.js → RecallRemove-ByQ3RXQY.js} +1 -1
  102. package/dist/assets/RecallRemove-ByQ3RXQY.js.br +0 -0
  103. package/dist/assets/{RemoveDeviceModal-CfUIep4N.js → RemoveDeviceModal-BFCk98E2.js} +1 -1
  104. package/dist/assets/RemoveDeviceModal-BFCk98E2.js.br +0 -0
  105. package/dist/assets/{Reporting-DfH4zZyA.js → Reporting-BkJlvwAN.js} +1 -1
  106. package/dist/assets/Reporting-BkJlvwAN.js.br +0 -0
  107. package/dist/assets/{ReportingPage-BW8_2ww5.js → ReportingPage-BohlZbl0.js} +1 -1
  108. package/dist/assets/ReportingPage-BohlZbl0.js.br +0 -0
  109. package/dist/assets/{ReportingRow-BIJxwYlc.js → ReportingRow-CxmihB6I.js} +1 -1
  110. package/dist/assets/ReportingRow-CxmihB6I.js.br +0 -0
  111. package/dist/assets/{Scene-BYiDHxmW.js → Scene-BJBl-O9V.js} +1 -1
  112. package/dist/assets/Scene-BJBl-O9V.js.br +0 -0
  113. package/dist/assets/{SelectField-WJRba65T.js → SelectField-CGrVloaL.js} +1 -1
  114. package/dist/assets/SelectField-CGrVloaL.js.br +0 -0
  115. package/dist/assets/{Settings-PhXVTFpi.js → Settings-CGw2oF0C.js} +1 -1
  116. package/dist/assets/Settings-CGw2oF0C.js.br +0 -0
  117. package/dist/assets/{SettingsList-Dd50eBCN.js → SettingsList-CTeXhdEC.js} +1 -1
  118. package/dist/assets/SettingsList-CTeXhdEC.js.br +0 -0
  119. package/dist/assets/{SettingsPage-CmRkuhQD.js → SettingsPage-prek-fOp.js} +2 -2
  120. package/dist/assets/SettingsPage-prek-fOp.js.br +0 -0
  121. package/dist/assets/State-B1hWOtmK.js +1 -0
  122. package/dist/assets/State-B1hWOtmK.js.br +0 -0
  123. package/dist/assets/{Table-nLICgiiZ.js → Table-DQSQ_sYq.js} +1 -1
  124. package/dist/assets/Table-DQSQ_sYq.js.br +0 -0
  125. package/dist/assets/{TextareaField-CJe6QP5j.js → TextareaField-Dnm7VOj3.js} +1 -1
  126. package/dist/assets/TextareaField-Dnm7VOj3.js.br +0 -0
  127. package/dist/assets/{TimeAgo-e8nXr4AB.js → TimeAgo-BBbvibZK.js} +1 -1
  128. package/dist/assets/TimeAgo-BBbvibZK.js.br +0 -0
  129. package/dist/assets/{Tools-fGclFwGV.js → Tools-BWzGZOoh.js} +1 -1
  130. package/dist/assets/Tools-BWzGZOoh.js.br +0 -0
  131. package/dist/assets/{TouchlinkPage-CfBmxsLM.js → TouchlinkPage-C3ESWw4F.js} +1 -1
  132. package/dist/assets/TouchlinkPage-C3ESWw4F.js.br +0 -0
  133. package/dist/assets/{VendorLink-D2j6lFZo.js → VendorLink-Cx9U94p9.js} +1 -1
  134. package/dist/assets/VendorLink-Cx9U94p9.js.br +0 -0
  135. package/dist/assets/{_createCompounder-Bb8q4vBx.js → _createCompounder-DvelL9we.js} +1 -1
  136. package/dist/assets/_createCompounder-DvelL9we.js.br +0 -0
  137. package/dist/assets/{floating-ui.react-BjV3LBOY.js → floating-ui.react-MIvSYIT3.js} +1 -1
  138. package/dist/assets/floating-ui.react-MIvSYIT3.js.br +0 -0
  139. package/dist/assets/{index-CT-zuS9u.js → index-BWJZAMXy.js} +1 -1
  140. package/dist/assets/index-BWJZAMXy.js.br +2 -0
  141. package/dist/assets/{index-DFi8ba4s.js → index-BnCNGENq.js} +1 -1
  142. package/dist/assets/index-BnCNGENq.js.br +0 -0
  143. package/dist/assets/{index-C4AO15gr.js → index-O2DLxYbj.js} +3 -3
  144. package/dist/assets/index-O2DLxYbj.js.br +0 -0
  145. package/dist/assets/{isObjectLike-DtP0zwgi.js → isObjectLike-D2GWafVk.js} +1 -1
  146. package/dist/assets/isObjectLike-D2GWafVk.js.br +0 -0
  147. package/dist/assets/{jszip.min-BhNGmgYw.js → jszip.min-CkTd3RZ4.js} +1 -1
  148. package/dist/assets/jszip.min-CkTd3RZ4.js.br +0 -0
  149. package/dist/assets/{merge-l7gh6IUF.js → merge-D15LJ0wW.js} +1 -1
  150. package/dist/assets/merge-D15LJ0wW.js.br +0 -0
  151. package/dist/assets/snakeCase-DDe65ywx.js +1 -0
  152. package/dist/assets/snakeCase-DDe65ywx.js.br +0 -0
  153. package/dist/assets/{useColumnCount-DM6Ez2tO.js → useColumnCount-CDIFEtdP.js} +1 -1
  154. package/dist/assets/useColumnCount-CDIFEtdP.js.br +0 -0
  155. package/dist/assets/{useSearch-mUc3xkmI.js → useSearch-CiQm9ZMA.js} +1 -1
  156. package/dist/assets/useSearch-CiQm9ZMA.js.br +0 -0
  157. package/dist/assets/{useTable-DEG0rBUT.js → useTable-CC5yv3vQ.js} +1 -1
  158. package/dist/assets/useTable-CC5yv3vQ.js.br +0 -0
  159. package/dist/index.html +1 -1
  160. package/dist/index.html.br +0 -0
  161. package/package.json +1 -1
  162. package/dist/assets/About-5ive9jRR.js.br +0 -0
  163. package/dist/assets/ActivityPage--C5u0Bwf.js.br +0 -0
  164. package/dist/assets/Availability-CCOMrAvr.js.br +0 -0
  165. package/dist/assets/Bind-G3e44cBT.js.br +0 -0
  166. package/dist/assets/BindRow-CXKtFkgv.js.br +0 -0
  167. package/dist/assets/BindingsPage-CH_6pS0h.js.br +0 -0
  168. package/dist/assets/Bridge-CNCfrobG.js +0 -1
  169. package/dist/assets/Bridge-CNCfrobG.js.br +0 -0
  170. package/dist/assets/CheckboxField-Vzfuua4m.js.br +0 -0
  171. package/dist/assets/ClusterSinglePicker-QVTVTJNd.js.br +0 -0
  172. package/dist/assets/Clusters-D_aeY0uN.js.br +0 -0
  173. package/dist/assets/ContributePage-CsEFC-N4.js.br +0 -0
  174. package/dist/assets/Dashboard-C3XyJ2vr.js.br +0 -0
  175. package/dist/assets/DashboardFeatureWrapper-IF-AwBR9.js.br +0 -0
  176. package/dist/assets/DebouncedInput-seIGAyZ5.js.br +0 -0
  177. package/dist/assets/DevConsole-BBhhdBhq.js.br +0 -0
  178. package/dist/assets/DevConsole-rjP-ffwt.js.br +0 -0
  179. package/dist/assets/DeviceCard-CqM8-MYx.js.br +0 -0
  180. package/dist/assets/DeviceImage-B6w8VrRf.js.br +0 -0
  181. package/dist/assets/DeviceInfo-GbR6czw4.js.br +0 -0
  182. package/dist/assets/DevicePage-DQQwZi4s.js.br +0 -0
  183. package/dist/assets/DevicePicker-Dr-4DW3x.js.br +0 -0
  184. package/dist/assets/DeviceSettings-DSNlkxW0.js.br +0 -0
  185. package/dist/assets/DeviceSpecificSettings-LjumBfx3.js.br +0 -0
  186. package/dist/assets/Devices-zZY0L8yI.js.br +0 -0
  187. package/dist/assets/DevicesPage-DRLz02x5.js.br +0 -0
  188. package/dist/assets/DisplayValue-Cko1Z4Vm.js.br +0 -0
  189. package/dist/assets/Duration-bceKVeXp.js.br +0 -0
  190. package/dist/assets/EndpointPicker-_bkZcPK6.js.br +0 -0
  191. package/dist/assets/Exposes-g-STiMw5.js.br +0 -2
  192. package/dist/assets/Feature-CsgctMqC.js.br +0 -0
  193. package/dist/assets/FrontendSettingsPage-Dwmoevlm.js.br +0 -0
  194. package/dist/assets/GroupPage-Cb9sV0Iq.js.br +0 -0
  195. package/dist/assets/GroupSettings-kzS_7sXT.js.br +0 -0
  196. package/dist/assets/Groups-CM897513.js.br +0 -0
  197. package/dist/assets/GroupsPage-DP7kWqhf.js.br +0 -0
  198. package/dist/assets/Health-78h6mZZ_.js.br +0 -0
  199. package/dist/assets/HomePage-gMeQdB1N.js.br +0 -0
  200. package/dist/assets/IndeterminateCheckbox-BV6gyFHo.js.br +0 -0
  201. package/dist/assets/InfoAlert-Bmwt7g6d.js +0 -1
  202. package/dist/assets/InfoAlert-Bmwt7g6d.js.br +0 -0
  203. package/dist/assets/InputField-CLgeChp0.js.br +0 -0
  204. package/dist/assets/Json-C725FVKM.js.br +0 -0
  205. package/dist/assets/LastSeen-DF8tUMAo.js.br +0 -0
  206. package/dist/assets/LogsPage-ChO7b4nK.js.br +0 -0
  207. package/dist/assets/Lqi-CB7A3dn1.js +0 -1
  208. package/dist/assets/Lqi-CB7A3dn1.js.br +0 -0
  209. package/dist/assets/NetworkPage-BhbmupcB.js.br +0 -0
  210. package/dist/assets/NumberField-fT7hilHb.js.br +0 -0
  211. package/dist/assets/OtaPage-CdSMJpcl.js.br +0 -0
  212. package/dist/assets/PowerSource-D9Tnu98A.js.br +0 -0
  213. package/dist/assets/RawNetworkData-DbCpzrKF.js.br +0 -0
  214. package/dist/assets/RawNetworkMap-D5AQXjYA.js.br +0 -0
  215. package/dist/assets/RecallRemove-_liyNDej.js.br +0 -0
  216. package/dist/assets/RemoveDeviceModal-CfUIep4N.js.br +0 -0
  217. package/dist/assets/Reporting-DfH4zZyA.js.br +0 -0
  218. package/dist/assets/ReportingPage-BW8_2ww5.js.br +0 -0
  219. package/dist/assets/ReportingRow-BIJxwYlc.js.br +0 -0
  220. package/dist/assets/Scene-BYiDHxmW.js.br +0 -0
  221. package/dist/assets/SelectField-WJRba65T.js.br +0 -0
  222. package/dist/assets/Settings-PhXVTFpi.js.br +0 -0
  223. package/dist/assets/SettingsList-Dd50eBCN.js.br +0 -0
  224. package/dist/assets/SettingsPage-CmRkuhQD.js.br +0 -0
  225. package/dist/assets/State-3lsSoRaT.js +0 -1
  226. package/dist/assets/State-3lsSoRaT.js.br +0 -0
  227. package/dist/assets/Table-nLICgiiZ.js.br +0 -0
  228. package/dist/assets/TextareaField-CJe6QP5j.js.br +0 -0
  229. package/dist/assets/TimeAgo-e8nXr4AB.js.br +0 -0
  230. package/dist/assets/Tools-fGclFwGV.js.br +0 -0
  231. package/dist/assets/TouchlinkPage-CfBmxsLM.js.br +0 -0
  232. package/dist/assets/VendorLink-D2j6lFZo.js.br +0 -0
  233. package/dist/assets/_createCompounder-Bb8q4vBx.js.br +0 -0
  234. package/dist/assets/floating-ui.react-BjV3LBOY.js.br +0 -0
  235. package/dist/assets/index-C4AO15gr.js.br +0 -0
  236. package/dist/assets/index-CT-zuS9u.js.br +0 -1
  237. package/dist/assets/index-DFi8ba4s.js.br +0 -0
  238. package/dist/assets/isObjectLike-DtP0zwgi.js.br +0 -0
  239. package/dist/assets/jszip.min-BhNGmgYw.js.br +0 -0
  240. package/dist/assets/merge-l7gh6IUF.js.br +0 -0
  241. package/dist/assets/snakeCase-D0qZI2R1.js +0 -1
  242. package/dist/assets/snakeCase-D0qZI2R1.js.br +0 -0
  243. package/dist/assets/useColumnCount-DM6Ez2tO.js.br +0 -0
  244. package/dist/assets/useSearch-mUc3xkmI.js.br +0 -0
  245. package/dist/assets/useTable-DEG0rBUT.js.br +0 -0
@@ -1 +1 @@
1
- import{a as c,u as N,r as n,A as S,s as m,j as i,p as k,t as y,S as q,F as z,q as C,L as w,v as f,N as V,M as D}from"./index-C4AO15gr.js";import{A as $,D as A}from"./Availability-CCOMrAvr.js";import{D as I}from"./DeviceImage-B6w8VrRf.js";import{T as L}from"./Table-nLICgiiZ.js";import{u as M,T}from"./useTable-DEG0rBUT.js";import{L as E}from"./LastSeen-DF8tUMAo.js";import{L as O}from"./Lqi-CB7A3dn1.js";import{M as R,V as B}from"./VendorLink-D2j6lFZo.js";import"./envs-CSqIi4cL.js";import"./RemoveDeviceModal-CfUIep4N.js";import"./CheckboxField-Vzfuua4m.js";import"./InputField-CLgeChp0.js";import"./index-CT-zuS9u.js";import"./DebouncedInput-seIGAyZ5.js";import"./TimeAgo-e8nXr4AB.js";import"./index-DFi8ba4s.js";import"./DisplayValue-Cko1Z4Vm.js";function le(){const b=c(e=>e.devices),u=c(e=>e.deviceStates),l=c(e=>e.bridgeInfo),g=c(e=>e.availability),{t}=N(["zigbee","common","availability"]),F=n.useMemo(()=>{const e=[];for(let a=0;a<S.length;a++)for(const s of b[a])if(s.type!=="Coordinator"){const r=u[a][s.friendly_name]??{},d=l[a].config.devices[s.ieee_address]?.availability;let o;s.power_source==="Battery"&&(o=!1,"battery"in r?r.battery<20&&(o=!0):"battery_state"in r?r.battery_state==="low"&&(o=!0):"battery_low"in r&&(o=!!r.battery_low)),e.push({sourceIdx:a,device:s,state:r,availabilityState:g[a][s.friendly_name]?.state??"offline",availabilityEnabledForDevice:d!=null?!!d:void 0,batteryLow:o})}return e},[b,u,l,g]),v=n.useCallback(async(e,a,s,r)=>{await m(e,"bridge/request/device/rename",{from:a,to:s,homeassistant_rename:r,last:void 0})},[]),x=n.useCallback(async([e,a])=>{await m(e,"bridge/request/device/configure",{id:a})},[]),p=n.useCallback(async([e,a])=>{await m(e,"bridge/request/device/interview",{id:a})},[]),_=n.useCallback(async(e,a,s,r)=>{await m(e,"bridge/request/device/remove",{id:a,force:s,block:r})},[]),j=n.useMemo(()=>[{id:"source",size:60,header:()=>i.jsx("span",{title:t(e=>e.source,{ns:"common"}),children:i.jsx(z,{icon:C})}),accessorFn:({sourceIdx:e})=>k[e],cell:({row:{original:{sourceIdx:e}}})=>i.jsx(q,{idx:e,nameClassName:"hidden md:inline-block"}),filterFn:"equals",meta:{filterVariant:"select",showFacetedOccurrences:!0}},{id:"friendly_name",size:250,minSize:175,header:t(e=>e.friendly_name,{ns:"common"}),accessorFn:({device:e})=>`${e.friendly_name} ${e.description??""}`,cell:({row:{original:{sourceIdx:e,device:a,state:s}}})=>i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"avatar",children:i.jsx("div",{className:"h-11 w-11",style:{overflow:"visible"},children:i.jsx(I,{device:a,otaState:s.update?.state,disabled:a.disabled})})}),i.jsxs("div",{className:"flex-grow flex flex-col min-w-0",children:[i.jsx(w,{to:`/device/${e}/${a.ieee_address}/info`,className:"link link-hover truncate",children:a.friendly_name}),a.description&&i.jsx("div",{className:"max-w-3xs text-xs opacity-50 truncate",title:a.description,children:a.description})]})]}),sortingFn:(e,a)=>e.original.device.friendly_name.localeCompare(a.original.device.friendly_name),filterFn:"includesString",meta:{filterVariant:"text",textFaceted:!0}},{id:"ieee_address",minSize:175,header:t(e=>e.ieee_address),accessorFn:({device:e})=>`${e.ieee_address} ${y(e.network_address,4)} ${e.network_address}`,cell:({row:{original:{sourceIdx:e,device:a}}})=>i.jsxs(i.Fragment,{children:[i.jsx("div",{children:i.jsx(w,{to:`/device/${e}/${a.ieee_address}/info`,className:"link link-hover",children:a.ieee_address})}),i.jsxs("div",{className:"flex flex-row gap-1",children:[i.jsx("span",{className:"badge badge-ghost badge-sm cursor-default",title:t(s=>s.network_address_hex),children:y(a.network_address,4)}),i.jsx("span",{className:"badge badge-ghost badge-sm cursor-default",title:t(s=>s.network_address_dec),children:a.network_address})]})]}),sortingFn:(e,a)=>e.original.device.ieee_address.localeCompare(a.original.device.ieee_address),filterFn:"includesString",meta:{filterVariant:"text"}},{id:"model",minSize:175,header:t(e=>e.model),accessorFn:({device:e})=>`${e.definition?.model??""} ${e.model_id??""} ${e.definition?.vendor??e.manufacturer??""}`,cell:({row:{original:{device:e}}})=>i.jsxs(i.Fragment,{children:[i.jsx(R,{device:e}),i.jsx("div",{className:"flex flex-row gap-1",children:i.jsx("span",{className:"badge badge-ghost badge-sm tooltip tooltip-bottom","data-tip":t(a=>a.manufacturer),children:i.jsx(B,{device:e})})})]}),filterFn:"includesString",meta:{filterVariant:"text",textFaceted:!0,showFacetedOccurrences:!0}},{id:"type",size:100,header:t(e=>e.type),accessorFn:({device:e})=>t(a=>a[e.type]),cell:({row:{original:{device:e}}})=>t(a=>a[e.type]),filterFn:"equals",meta:{filterVariant:"select",showFacetedOccurrences:!0}},{id:"lqi",size:70,header:t(e=>e.lqi),accessorFn:({state:e})=>e.linkquality,cell:({row:{original:{state:e}}})=>i.jsx(O,{value:e.linkquality}),filterFn:"inNumberRange",meta:{filterVariant:"range"}},{id:"last_seen",size:120,header:t(e=>e.last_seen),accessorFn:({sourceIdx:e,state:a})=>{const s=f(a.last_seen,l[e].config.advanced.last_seen);return s?Math.round((Date.now()-s)/1e3/60):void 0},cell:({row:{original:{sourceIdx:e,state:a}}})=>i.jsx(E,{lastSeen:a.last_seen,config:l[e].config.advanced.last_seen}),sortingFn:(e,a)=>{const s=f(e.original.state.last_seen,l[e.original.sourceIdx].config.advanced.last_seen),r=f(a.original.state.last_seen,l[a.original.sourceIdx].config.advanced.last_seen);return s>r?-1:s<r?1:0},enableGlobalFilter:!1,filterFn:"inNumberRange",meta:{filterVariant:"range",tooltip:t(e=>e.last_seen_filter_info,{ns:"common"})}},{id:"availability",size:125,header:t(e=>e.availability,{ns:"availability"}),accessorFn:({sourceIdx:e,availabilityState:a,availabilityEnabledForDevice:s,device:r})=>t(d=>d[r.disabled?"disabled":s??l[e].config.availability.enabled?a:"disabled"],{ns:"availability"}),cell:({row:{original:{sourceIdx:e,device:a,availabilityState:s,availabilityEnabledForDevice:r}}})=>i.jsx($,{disabled:a.disabled,availability:s,availabilityEnabledForDevice:r,availabilityFeatureEnabled:l[e].config.availability.enabled}),filterFn:"equals",meta:{filterVariant:"select",showFacetedOccurrences:!0}},{id:"power_source",size:100,header:t(e=>e.power_source),accessorFn:({device:e})=>e.power_source,filterFn:"equals",meta:{filterVariant:"select",showFacetedOccurrences:!0}},{id:"battery_level",size:100,header:t(e=>e.battery_level),accessorFn:({state:e})=>e.battery??void 0,cell:({row:{original:{state:e,batteryLow:a}}})=>e.battery==null?"N/A":i.jsxs("span",{className:a?"text-error":void 0,children:[String(e.battery),"%"]}),filterFn:"inNumberRange",meta:{filterVariant:"range"}},{id:"battery_low",size:100,header:t(e=>e.battery_low),accessorFn:({batteryLow:e})=>e,cell:({row:{original:{batteryLow:e}}})=>e===void 0?"N/A":i.jsx("span",{className:e?"text-error":void 0,children:String(e)}),filterFn:"equals",meta:{filterVariant:"boolean"}},{id:"disabled",size:100,header:t(e=>e.disabled,{ns:"common"}),accessorFn:({device:e})=>`${!!e.disabled}`,filterFn:"equals",meta:{filterVariant:"select"}},{id:"actions",minSize:130,cell:({row:{original:{sourceIdx:e,device:a,state:s}}})=>i.jsx(A,{sourceIdx:e,device:a,otaState:s.update?.state,homeassistantEnabled:l[e].config.homeassistant.enabled,renameDevice:v,removeDevice:_,configureDevice:x,interviewDevice:p,btnClassName:"btn-sm"}),enableSorting:!1,enableColumnFilter:!1,enableGlobalFilter:!1}],[l,v,_,x,p,t]),h=M({id:"all-devices",columns:j,data:F,visibleColumns:{source:D,type:!1,power_source:!1,battery_level:!1,battery_low:!1,disabled:!1},sorting:[{id:"friendly_name",desc:!1}]});return i.jsxs(i.Fragment,{children:[i.jsx(V,{children:i.jsx(T,{...h})}),i.jsx("div",{className:"mb-5",children:i.jsx(L,{id:"all-devices",...h})})]})}export{le as default};
1
+ import{a as c,u as N,r as n,A as S,s as m,j as i,p as k,t as y,S as q,F as z,q as C,L as w,v as f,N as V,M as D}from"./index-O2DLxYbj.js";import{A as $,D as A}from"./Availability-YPjK9GZh.js";import{D as I}from"./DeviceImage-C6iSUjiJ.js";import{T as L}from"./Table-DQSQ_sYq.js";import{u as M,T}from"./useTable-CC5yv3vQ.js";import{L as E}from"./LastSeen-DA4kaWWb.js";import{L as O}from"./Lqi-BLFaxsM9.js";import{M as R,V as B}from"./VendorLink-Cx9U94p9.js";import"./envs-CSqIi4cL.js";import"./RemoveDeviceModal-BFCk98E2.js";import"./CheckboxField-DDGxPCob.js";import"./InputField-BYfjYPOY.js";import"./index-BWJZAMXy.js";import"./DebouncedInput-B_mSPoL2.js";import"./TimeAgo-BBbvibZK.js";import"./index-BnCNGENq.js";import"./DisplayValue-BZ-eaAKu.js";function le(){const b=c(e=>e.devices),u=c(e=>e.deviceStates),l=c(e=>e.bridgeInfo),g=c(e=>e.availability),{t}=N(["zigbee","common","availability"]),F=n.useMemo(()=>{const e=[];for(let a=0;a<S.length;a++)for(const s of b[a])if(s.type!=="Coordinator"){const r=u[a][s.friendly_name]??{},d=l[a].config.devices[s.ieee_address]?.availability;let o;s.power_source==="Battery"&&(o=!1,"battery"in r?r.battery<20&&(o=!0):"battery_state"in r?r.battery_state==="low"&&(o=!0):"battery_low"in r&&(o=!!r.battery_low)),e.push({sourceIdx:a,device:s,state:r,availabilityState:g[a][s.friendly_name]?.state??"offline",availabilityEnabledForDevice:d!=null?!!d:void 0,batteryLow:o})}return e},[b,u,l,g]),v=n.useCallback(async(e,a,s,r)=>{await m(e,"bridge/request/device/rename",{from:a,to:s,homeassistant_rename:r,last:void 0})},[]),x=n.useCallback(async([e,a])=>{await m(e,"bridge/request/device/configure",{id:a})},[]),p=n.useCallback(async([e,a])=>{await m(e,"bridge/request/device/interview",{id:a})},[]),_=n.useCallback(async(e,a,s,r)=>{await m(e,"bridge/request/device/remove",{id:a,force:s,block:r})},[]),j=n.useMemo(()=>[{id:"source",size:60,header:()=>i.jsx("span",{title:t(e=>e.source,{ns:"common"}),children:i.jsx(z,{icon:C})}),accessorFn:({sourceIdx:e})=>k[e],cell:({row:{original:{sourceIdx:e}}})=>i.jsx(q,{idx:e,nameClassName:"hidden md:inline-block"}),filterFn:"equals",meta:{filterVariant:"select",showFacetedOccurrences:!0}},{id:"friendly_name",size:250,minSize:175,header:t(e=>e.friendly_name,{ns:"common"}),accessorFn:({device:e})=>`${e.friendly_name} ${e.description??""}`,cell:({row:{original:{sourceIdx:e,device:a,state:s}}})=>i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"avatar",children:i.jsx("div",{className:"h-11 w-11",style:{overflow:"visible"},children:i.jsx(I,{device:a,otaState:s.update?.state,disabled:a.disabled})})}),i.jsxs("div",{className:"flex-grow flex flex-col min-w-0",children:[i.jsx(w,{to:`/device/${e}/${a.ieee_address}/info`,className:"link link-hover truncate",children:a.friendly_name}),a.description&&i.jsx("div",{className:"max-w-3xs text-xs opacity-50 truncate",title:a.description,children:a.description})]})]}),sortingFn:(e,a)=>e.original.device.friendly_name.localeCompare(a.original.device.friendly_name),filterFn:"includesString",meta:{filterVariant:"text",textFaceted:!0}},{id:"ieee_address",minSize:175,header:t(e=>e.ieee_address),accessorFn:({device:e})=>`${e.ieee_address} ${y(e.network_address,4)} ${e.network_address}`,cell:({row:{original:{sourceIdx:e,device:a}}})=>i.jsxs(i.Fragment,{children:[i.jsx("div",{children:i.jsx(w,{to:`/device/${e}/${a.ieee_address}/info`,className:"link link-hover",children:a.ieee_address})}),i.jsxs("div",{className:"flex flex-row gap-1",children:[i.jsx("span",{className:"badge badge-ghost badge-sm cursor-default",title:t(s=>s.network_address_hex),children:y(a.network_address,4)}),i.jsx("span",{className:"badge badge-ghost badge-sm cursor-default",title:t(s=>s.network_address_dec),children:a.network_address})]})]}),sortingFn:(e,a)=>e.original.device.ieee_address.localeCompare(a.original.device.ieee_address),filterFn:"includesString",meta:{filterVariant:"text"}},{id:"model",minSize:175,header:t(e=>e.model),accessorFn:({device:e})=>`${e.definition?.model??""} ${e.model_id??""} ${e.definition?.vendor??e.manufacturer??""}`,cell:({row:{original:{device:e}}})=>i.jsxs(i.Fragment,{children:[i.jsx(R,{device:e}),i.jsx("div",{className:"flex flex-row gap-1",children:i.jsx("span",{className:"badge badge-ghost badge-sm tooltip tooltip-bottom","data-tip":t(a=>a.manufacturer),children:i.jsx(B,{device:e})})})]}),filterFn:"includesString",meta:{filterVariant:"text",textFaceted:!0,showFacetedOccurrences:!0}},{id:"type",size:100,header:t(e=>e.type),accessorFn:({device:e})=>t(a=>a[e.type]),cell:({row:{original:{device:e}}})=>t(a=>a[e.type]),filterFn:"equals",meta:{filterVariant:"select",showFacetedOccurrences:!0}},{id:"lqi",size:70,header:t(e=>e.lqi),accessorFn:({state:e})=>e.linkquality,cell:({row:{original:{state:e}}})=>i.jsx(O,{value:e.linkquality}),filterFn:"inNumberRange",meta:{filterVariant:"range"}},{id:"last_seen",size:120,header:t(e=>e.last_seen),accessorFn:({sourceIdx:e,state:a})=>{const s=f(a.last_seen,l[e].config.advanced.last_seen);return s?Math.round((Date.now()-s)/1e3/60):void 0},cell:({row:{original:{sourceIdx:e,state:a}}})=>i.jsx(E,{lastSeen:a.last_seen,config:l[e].config.advanced.last_seen}),sortingFn:(e,a)=>{const s=f(e.original.state.last_seen,l[e.original.sourceIdx].config.advanced.last_seen),r=f(a.original.state.last_seen,l[a.original.sourceIdx].config.advanced.last_seen);return s>r?-1:s<r?1:0},enableGlobalFilter:!1,filterFn:"inNumberRange",meta:{filterVariant:"range",tooltip:t(e=>e.last_seen_filter_info,{ns:"common"})}},{id:"availability",size:125,header:t(e=>e.availability,{ns:"availability"}),accessorFn:({sourceIdx:e,availabilityState:a,availabilityEnabledForDevice:s,device:r})=>t(d=>d[r.disabled?"disabled":s??l[e].config.availability.enabled?a:"disabled"],{ns:"availability"}),cell:({row:{original:{sourceIdx:e,device:a,availabilityState:s,availabilityEnabledForDevice:r}}})=>i.jsx($,{disabled:a.disabled,availability:s,availabilityEnabledForDevice:r,availabilityFeatureEnabled:l[e].config.availability.enabled}),filterFn:"equals",meta:{filterVariant:"select",showFacetedOccurrences:!0}},{id:"power_source",size:100,header:t(e=>e.power_source),accessorFn:({device:e})=>e.power_source,filterFn:"equals",meta:{filterVariant:"select",showFacetedOccurrences:!0}},{id:"battery_level",size:100,header:t(e=>e.battery_level),accessorFn:({state:e})=>e.battery??void 0,cell:({row:{original:{state:e,batteryLow:a}}})=>e.battery==null?"N/A":i.jsxs("span",{className:a?"text-error":void 0,children:[String(e.battery),"%"]}),filterFn:"inNumberRange",meta:{filterVariant:"range"}},{id:"battery_low",size:100,header:t(e=>e.battery_low),accessorFn:({batteryLow:e})=>e,cell:({row:{original:{batteryLow:e}}})=>e===void 0?"N/A":i.jsx("span",{className:e?"text-error":void 0,children:String(e)}),filterFn:"equals",meta:{filterVariant:"boolean"}},{id:"disabled",size:100,header:t(e=>e.disabled,{ns:"common"}),accessorFn:({device:e})=>`${!!e.disabled}`,filterFn:"equals",meta:{filterVariant:"select"}},{id:"actions",minSize:130,cell:({row:{original:{sourceIdx:e,device:a,state:s}}})=>i.jsx(A,{sourceIdx:e,device:a,otaState:s.update?.state,homeassistantEnabled:l[e].config.homeassistant.enabled,renameDevice:v,removeDevice:_,configureDevice:x,interviewDevice:p,btnClassName:"btn-sm"}),enableSorting:!1,enableColumnFilter:!1,enableGlobalFilter:!1}],[l,v,_,x,p,t]),h=M({id:"all-devices",columns:j,data:F,visibleColumns:{source:D,type:!1,power_source:!1,battery_level:!1,battery_low:!1,disabled:!1},sorting:[{id:"friendly_name",desc:!1}]});return i.jsxs(i.Fragment,{children:[i.jsx(V,{children:i.jsx(T,{...h})}),i.jsx("div",{className:"mb-5",children:i.jsx(L,{id:"all-devices",...h})})]})}export{le as default};
@@ -1 +1 @@
1
- import{r as c,u,j as n}from"./index-C4AO15gr.js";const l=c.memo(r=>{const{value:a,name:s}=r,{t}=u("values");switch(s){case"contact":return t(a?e=>e.closed:e=>e.open);case"occupancy":return t(a?e=>e.occupied:e=>e.clear);case"water_leak":return a?n.jsx("span",{className:"text-error animate-pulse",children:t(e=>e.leaking)}):t(e=>e.clear);case"tamper":return a?n.jsx("span",{className:"text-error animate-pulse",children:t(e=>e.tampered)}):t(e=>e.clear);case"supported":return t(a?e=>e.supported:e=>e.not_supported);default:return t(a?e=>e.true:e=>e.false)}}),i=c.memo(r=>{const{t:a}=u("values"),{value:s}=r;switch(typeof s){case"boolean":return n.jsx(l,{...r});case"undefined":return"N/A";case"object":return s===null?a(t=>t.null):JSON.stringify(s);case"string":return s===""?n.jsx("span",{className:"text-xs opacity-50",children:a(t=>t.empty_string)}):s;default:return JSON.stringify(s)}});export{i as D};
1
+ import{r as c,u,j as n}from"./index-O2DLxYbj.js";const l=c.memo(r=>{const{value:a,name:s}=r,{t}=u("values");switch(s){case"contact":return t(a?e=>e.closed:e=>e.open);case"occupancy":return t(a?e=>e.occupied:e=>e.clear);case"water_leak":return a?n.jsx("span",{className:"text-error animate-pulse",children:t(e=>e.leaking)}):t(e=>e.clear);case"tamper":return a?n.jsx("span",{className:"text-error animate-pulse",children:t(e=>e.tampered)}):t(e=>e.clear);case"supported":return t(a?e=>e.supported:e=>e.not_supported);default:return t(a?e=>e.true:e=>e.false)}}),i=c.memo(r=>{const{t:a}=u("values"),{value:s}=r;switch(typeof s){case"boolean":return n.jsx(l,{...r});case"undefined":return"N/A";case"object":return s===null?a(t=>t.null):JSON.stringify(s);case"string":return s===""?n.jsx("span",{className:"text-xs opacity-50",children:a(t=>t.empty_string)}):s;default:return JSON.stringify(s)}});export{i as D};
@@ -1 +1 @@
1
- import{r as h,j as r}from"./index-C4AO15gr.js";const l=h.memo(({durationSec:t})=>{if(t&&t>0){const o=Math.floor(t/3600),s=Math.floor(t/60)%60,n=Math.floor(t%60),a=o>0,e=s>0;return r.jsxs(r.Fragment,{children:[a?`${o}:`:"",e?`${s.toString().padStart(2,"0")}:`:"",n.toString().padStart(2,"0")]})}return null});export{l as D};
1
+ import{r as h,j as r}from"./index-O2DLxYbj.js";const l=h.memo(({durationSec:t})=>{if(t&&t>0){const o=Math.floor(t/3600),s=Math.floor(t/60)%60,n=Math.floor(t%60),a=o>0,e=s>0;return r.jsxs(r.Fragment,{children:[a?`${o}:`:"",e?`${s.toString().padStart(2,"0")}:`:"",n.toString().padStart(2,"0")]})}return null});export{l as D};
@@ -1 +1 @@
1
- import{r as a,u,j as s}from"./index-C4AO15gr.js";import{S as h}from"./SelectField-WJRba65T.js";const E=a.memo(({value:o,values:t,disabled:c,onChange:l,label:p,...d})=>{const{t:i}=u("common"),r=t.size===1,m=a.useMemo(()=>{const e=[];for(const n of t)e.push(s.jsx("option",{value:n,children:n},n));return e},[t]);return s.jsxs(h,{name:"endpoint_picker",label:p,value:o??"",onChange:e=>l(e.target.value),title:r?i(e=>e.the_only_endpoint):`${o}`,disabled:o&&r||c,className:"select validator w-32",...d,children:[s.jsx("option",{value:"",disabled:!0,children:i(e=>e.select_endpoint)}),m]})});export{E};
1
+ import{r as a,u,j as s}from"./index-O2DLxYbj.js";import{S as h}from"./SelectField-CGrVloaL.js";const E=a.memo(({value:o,values:t,disabled:c,onChange:l,label:p,...d})=>{const{t:i}=u("common"),r=t.size===1,m=a.useMemo(()=>{const e=[];for(const n of t)e.push(s.jsx("option",{value:n,children:n},n));return e},[t]);return s.jsxs(h,{name:"endpoint_picker",label:p,value:o??"",onChange:e=>l(e.target.value),title:r?i(e=>e.the_only_endpoint):`${o}`,disabled:o&&r||c,className:"select validator w-32",...d,children:[s.jsx("option",{value:"",disabled:!0,children:i(e=>e.select_endpoint)}),m]})});export{E};
@@ -1 +1 @@
1
- import{u as l,a as u,C as f,r as t,s as r,j as n}from"./index-C4AO15gr.js";import{F as d,a as g}from"./Feature-CsgctMqC.js";import{g as _}from"./index-DFi8ba4s.js";import"./envs-CSqIi4cL.js";import"./DisplayValue-Cko1Z4Vm.js";import"./isObject--vsEa_js.js";import"./_createCompounder-Bb8q4vBx.js";import"./isObjectLike-DtP0zwgi.js";function S({sourceIdx:s,device:a}){const{t:o}=l("common"),i=u(f(e=>e.deviceStates[s][a.friendly_name]??{})),p=t.useCallback(async e=>{await r(s,`${a.ieee_address}/set`,e)},[s,a.ieee_address]),m=t.useCallback(async e=>{await r(s,`${a.ieee_address}/get`,e)},[s,a.ieee_address]);return a.definition?.exposes?.length?n.jsx("div",{className:"list bg-base-100",children:a.definition.exposes.map(e=>n.jsx(d,{feature:e,device:a,deviceState:i,onChange:p,onRead:m,featureWrapperClass:g,parentFeatures:[]},_(e)))}):o(e=>e.empty_exposes_definition)}export{S as default};
1
+ import{u as l,a as u,C as f,r as t,s as r,j as n}from"./index-O2DLxYbj.js";import{F as d,a as g}from"./Feature-BJ8zY1Ga.js";import{g as _}from"./index-BnCNGENq.js";import"./envs-CSqIi4cL.js";import"./DisplayValue-BZ-eaAKu.js";import"./isObject--vsEa_js.js";import"./_createCompounder-DvelL9we.js";import"./isObjectLike-D2GWafVk.js";function S({sourceIdx:s,device:a}){const{t:o}=l("common"),i=u(f(e=>e.deviceStates[s][a.friendly_name]??{})),p=t.useCallback(async e=>{await r(s,`${a.ieee_address}/set`,e)},[s,a.ieee_address]),m=t.useCallback(async e=>{await r(s,`${a.ieee_address}/get`,e)},[s,a.ieee_address]);return a.definition?.exposes?.length?n.jsx("div",{className:"list bg-base-100",children:a.definition.exposes.map(e=>n.jsx(d,{feature:e,device:a,deviceState:i,onChange:p,onRead:m,featureWrapperClass:g,parentFeatures:[]},_(e)))}):o(e=>e.empty_exposes_definition)}export{S as default};
@@ -1 +1 @@
1
- import{r as f,j as o,bm as j,u as F,B as A,F as ie,bn as Le,aL as Re,bo as ze,a1 as De}from"./index-C4AO15gr.js";import{D as z}from"./DisplayValue-Cko1Z4Vm.js";import{r as Pe}from"./isObject--vsEa_js.js";import{r as Xe,a as Ke,b as Je}from"./_createCompounder-Bb8q4vBx.js";import{g as Ee,c as ue,a as Ye}from"./index-DFi8ba4s.js";const q=f.memo(({feature:e,deviceValue:r})=>o.jsxs("div",{children:[e.property&&o.jsx("span",{className:"font-bold",children:o.jsx(z,{value:r,name:e.name})}),"unit"in e&&o.jsx("span",{className:"text-xs ms-1",children:e.unit})]})),M=f.memo(e=>o.jsxs("div",{className:"alert alert-warning",role:"alert",children:["Unknown access ",o.jsx("pre",{children:e.feature.access})]})),Ze=f.memo(e=>{const{feature:{access:r=j.SET,name:n,property:t,value_off:a,value_on:s},deviceValue:i,onChange:m,minimal:l}=e,{t:c}=F("zigbee"),h=f.useCallback(x=>m(t?{[t]:x}:x),[t,m]),u=f.useCallback(x=>{const g=x.target.checked?s:a;m(t?{[t]:g}:g)},[s,a,t,m]);if(r&j.SET){const x=i!=null,g=!l||l&&!x;return o.jsxs("div",{children:[g&&o.jsx(A,{className:"btn btn-link",item:a,onClick:h,children:o.jsx(z,{value:a,name:n})}),x?o.jsx("input",{className:"toggle",type:"checkbox",checked:i===s,onChange:u}):o.jsx("span",{className:"tooltip","data-tip":c(y=>y.unknown),children:o.jsx(ie,{icon:Le})}),g&&o.jsx(A,{className:"btn btn-link",item:s,onClick:h,children:o.jsx(z,{value:s,name:n})})]})}return r&j.STATE?o.jsx(q,{...e}):o.jsx(M,{...e})});function Qe(e,r){if(e==="composite"&&r!==void 0){if(r.length===0)return!0;if(r.length===1){const n=r[0].type;return n!=null&&n!=="composite"&&n!=="list"}}return!1}function E({feature:e,onChange:r,parentFeatures:n,onRead:t,device:a,deviceState:s,featureWrapperClass:i,minimal:m,endpointSpecific:l,steps:c}){const{type:h,property:u}=e,[x,g]=f.useState({}),{t:y}=F("common"),v=f.useMemo(()=>({...s,...x}),[s,x]),S="features"in e&&e.features||[],N=Qe(h,n);f.useEffect(()=>{g({})},[a.ieee_address]);const d=f.useCallback(p=>{g($=>({...$,...p})),N||r(h==="composite"&&u?{[u]:{...x,...p}}:p)},[x,h,u,N,r]),b=f.useCallback(()=>{const p={...s,...x};r(u?{[u]:p}:p)},[u,r,x,s]),_=f.useCallback(p=>{t?.(h==="composite"&&u?{[u]:p}:p)},[t,h,u]);return o.jsxs(o.Fragment,{children:[S.map(p=>o.jsx(He,{feature:p,parentFeatures:n??[],device:a,deviceState:v,onChange:d,onRead:_,featureWrapperClass:i,minimal:m,endpointSpecific:l,steps:c?.[p.name]},Ee(p))),N&&o.jsx("div",{className:"self-end float-right",children:o.jsx(A,{className:`btn btn-primary ${m?"btn-sm":""}`,onClick:b,children:y(p=>p.apply)})})]})}function We(e){return o.jsx(E,{...e})}var P,me;function en(){if(me)return P;me=1;function e(r,n,t){return r===r&&(t!==void 0&&(r=r<=t?r:t),n!==void 0&&(r=r>=n?r:n)),r}return P=e,P}var X,fe;function nn(){if(fe)return X;fe=1;var e=/\s/;function r(n){for(var t=n.length;t--&&e.test(n.charAt(t)););return t}return X=r,X}var K,xe;function rn(){if(xe)return K;xe=1;var e=nn(),r=/^\s+/;function n(t){return t&&t.slice(0,e(t)+1).replace(r,"")}return K=n,K}var J,he;function tn(){if(he)return J;he=1;var e=rn(),r=Pe(),n=Xe(),t=NaN,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,i=/^0o[0-7]+$/i,m=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return t;if(r(c)){var h=typeof c.valueOf=="function"?c.valueOf():c;c=r(h)?h+"":h}if(typeof c!="string")return c===0?c:+c;c=e(c);var u=s.test(c);return u||i.test(c)?m(c.slice(2),u?2:8):a.test(c)?t:+c}return J=l,J}var Y,de;function sn(){if(de)return Y;de=1;var e=en(),r=tn();function n(t,a,s){return s===void 0&&(s=a,a=void 0),s!==void 0&&(s=r(s),s=s===s?s:0),a!==void 0&&(a=r(a),a=a===a?a:0),e(r(t),a,s)}return Y=n,Y}var on=sn();const R=Re(on),an=[.412453,.35758,.180423,.212671,.71516,.072169,.019334,.119193,.950227],cn=[3.2404813432005266,-1.5371515162713183,-.49853632616888777,-.9692549499965684,1.8759900014898907,.041555926558292815,.05564663913517715,-.20404133836651123,1.0573110696453443],ke=.42,we=.0031308,Ie=12.92,D=.055,H=e=>e<=we?Ie*e:(1+D)*e**ke-D,ln=1/ke,un=H(we),mn=1/Ie,Z=e=>e<=un?e*mn:((e+D)/(1+D))**ln,Fe=(e,r)=>{const n=[0,0,0];for(let t=0;t<3;t++){n[t]=0;for(let a=0;a<3;a++)n[t]+=r[t*3+a]*e[a]}return n},ge=(e,r,n)=>{const t=[Z(e),Z(r),Z(n)];return Fe(t,an)},fn=(e,r,n)=>{const t=Fe([e,r,n],cn);return[H(t[0]),H(t[1]),H(t[2])]},$e=(e,r,n)=>{const t=1-e-r;return fn(n/r*e,n,n/r*t)},qe=(e,r,n=10)=>{let t=1;for(let a=0;a<n;a++){const s=Math.max(...$e(e,r,t));t=t/s}return t},B=(e,r,n)=>{if(e/=255,r/=255,n/=255,e<1e-12&&r<1e-12&&n<1e-12){const[m,l,c]=ge(1,1,1),h=m+l+c;return[m/h,l/h,0]}const[t,a,s]=ge(e,r,n),i=t+a+s;return[t/i,a/i,a]},xn=(e,r,n)=>{n===void 0&&(n=qe(e,r));const[t,a,s]=$e(e,r,n);return[R(t*255,0,255),R(a*255,0,255),R(s*255,0,255)]},V=(e,r,n)=>{e/=255,r/=255,n/=255;const t=Math.max(e,r,n),a=t-Math.min(e,r,n),s=a?(t===e?(r-n)/a+(r<n?6:0):t===r?2+(n-e)/a:4+(e-r)/a)*60:0,i=t?a/t*100:0,m=t*100;return[R(s,0,360),R(i,0,100),R(m,0,100)]},hn=(e,r,n)=>{r/=100,n/=100;const t=~~(e/60),a=e/60-t,s=n*(1-r),i=n*(1-r*a),m=n*(1-r*(1-a)),l=t%6,c=[n,i,s,s,m,n][l]*255,h=[m,n,n,i,s,s][l]*255,u=[s,s,m,n,n,i][l]*255;return[R(c,0,255),R(h,0,255),R(u,0,255)]},O=(e,r,n)=>{const[t,a,s]=[e,r,n].map(i=>Math.round(i).toString(16).padStart(2,"0"));return`#${t}${a}${s}`},dn=e=>(e=e.slice(1),Array.from({length:3}).map((r,n)=>Number.parseInt(e.slice(n*2,n*2+2),16))),I=(e,r)=>{switch(r){case"color_xy":{const{x:n=.313,y:t=.329,Y:a=qe(n,t===0?.329:t)}=e,s=t===0?[255,255,255]:xn(n,t,a);return{color_rgb:s,color_hs:V(...s),color_xy:[n,t,a],hex:O(...s)}}case"color_hs":{const{hue:n=0,saturation:t=0}=e,a=100,s=hn(n,t,a);return{color_rgb:s,color_hs:[n,t,a],color_xy:B(...s),hex:O(...s)}}case"color_rgb":{const{r:n=255,g:t=255,b:a=255}=e;return{color_rgb:[n,t,a],color_hs:V(n,t,a),color_xy:B(n,t,a),hex:O(n,t,a)}}case"hex":{const n=e.hex,t=dn(n);return{color_rgb:t,color_hs:V(...t),color_xy:B(...t),hex:n}}default:{const n=[255,255,255];return{color_rgb:n,color_hs:V(...n),color_xy:B(...n),hex:O(...n)}}}},be=(e,r)=>{switch(r){case"color_xy":return{x:e.color_xy[0],y:e.color_xy[1]};case"color_hs":return{hue:e.color_hs[0],saturation:e.color_hs[1]};case"color_rgb":return{r:e.color_rgb[0],g:e.color_rgb[1],b:e.color_rgb[2]};case"hex":return{hex:e.hex}}},Me=e=>`${e[0].toFixed(3)}, ${e[1].toFixed(3)}, ${e[2].toFixed(3)}`,L=e=>`${e[0].toFixed(2)}°, ${e[1].toFixed(2)}%, ${e[2].toFixed(2)}%`,Be=e=>`${e[0].toFixed(0)}, ${e[1].toFixed(0)}, ${e[2].toFixed(0)}`,Ve=e=>e,pe=e=>({color_xy:Me(e.color_xy),color_hs:L(e.color_hs),color_rgb:Be(e.color_rgb),hex:Ve(e.hex)}),gn=e=>{const r=e.match(/\d+(\.\d+)?/gu)??[];return Array.from({length:3}).map((n,t)=>+(r[t]??0))},bn=e=>{const r=e.match(/\d+(\.\d+)?/gu)??[];return Array.from({length:3}).map((n,t)=>R(+(r[t]??0),0,t?100:360))},pn=e=>{const r=e.match(/\d+(\.\d+)?/gu)??[];return Array.from({length:3}).map((n,t)=>R(+(r[t]??0),0,255))},Q=(e,r)=>{switch(r){case"color_xy":{const n=gn(e);return I({x:n[0],y:n[1]},"color_xy")}case"color_hs":{const n=bn(e);return I({hue:n[0],saturation:n[1]},"color_hs")}case"color_rgb":{const n=pn(e);return I({r:n[0],g:n[1],b:n[2]},"color_rgb")}case"hex":return I({hex:e},"hex")}},yn="linear-gradient(to right, white, transparent)",_n="linear-gradient(to right, rgb(255, 0, 0), rgb(255, 255, 0), rgb(0, 255, 0), rgb(0, 255, 255), rgb(0, 0, 255), rgb(255, 0, 255), rgb(255, 0, 0))",U=f.memo(({label:e,...r})=>o.jsxs("label",{className:"input",children:[e,o.jsx("input",{type:"text",className:"grow",...r})]})),Oe=f.memo(e=>{const{onChange:r,value:n={},format:t,minimal:a}=e,[s,i]=f.useState(I(n,t)),[m,l]=f.useState(pe(s)),[c,h]=f.useState({color_rgb:!1,color_hs:!1,color_xy:!1,hex:!1});f.useEffect(()=>{const d=I(n,t);i(d),l(pe(d))},[n,t]),f.useEffect(()=>{if(!c.color_xy){const d=Me(s.color_xy);l(b=>({...b,color_xy:d}))}},[c.color_xy,s.color_xy]),f.useEffect(()=>{if(!c.color_hs){const d=L(s.color_hs);l(b=>({...b,color_hs:d}))}},[c.color_hs,s.color_hs]),f.useEffect(()=>{if(!c.color_rgb){const d=Be(s.color_rgb);l(b=>({...b,color_rgb:d}))}},[c.color_rgb,s.color_rgb]),f.useEffect(()=>{if(!c.hex){const d=Ve(s.hex);l(b=>({...b,hex:d}))}},[c.hex,s.hex]);const u=f.useCallback(d=>{if(d.target.value){const b=Array.from(s.color_hs);b[1]=d.target.valueAsNumber;const _=L(b);l(p=>({...p,color_hs:_})),i(Q(_,"color_hs"))}},[s.color_hs]),x=f.useCallback(d=>{if(d.target.value){const b=Array.from(s.color_hs),_=b[1];b[1]=_===0?100:_,b[0]=d.target.valueAsNumber;const p=L(b);l($=>({...$,color_hs:p})),i(Q(p,"color_hs"))}},[s.color_hs]),g=f.useCallback(d=>{const{value:b,name:_}=d.target;l(p=>({...p,[_]:b})),i(Q(b,_))},[]),y=f.useCallback(d=>{h(b=>({...b,[d.target.name]:!0}))},[]),v=f.useCallback(d=>{h(b=>({...b,[d.target.name]:!1})),r(be(s,t))},[s,t,r]),S=f.useCallback(()=>{r(be(s,t))},[s,t,r]),N=f.useMemo(()=>`hsl(${s.color_hs[0]}, 100%, 50%)`,[s.color_hs[0]]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex flex-row flex-wrap gap-3 items-center",children:o.jsx("div",{className:`w-full${a?" max-w-xs":""}`,children:o.jsx("input",{type:"range",min:0,max:100,value:s.color_hs[1],className:`range [--range-bg:transparent] [--range-fill:0] w-full${a?" range-xs ":""}`,style:{backgroundImage:yn,backgroundColor:N},onChange:u,onTouchEnd:S,onMouseUp:S,onKeyUp:S})})}),o.jsx("div",{className:"flex flex-row flex-wrap gap-3 items-center",children:o.jsx("div",{className:`w-full${a?" max-w-xs":""}`,children:o.jsx("input",{type:"range",min:0,max:360,value:s.color_hs[0],className:`range [--range-bg:transparent] [--range-fill:0] w-full${a?" range-xs ":""}`,style:{backgroundImage:_n},onChange:x,onTouchEnd:S,onMouseUp:S,onKeyUp:S})})}),!a&&o.jsxs("div",{className:"flex flex-row flex-wrap gap-2 justify-around",children:[o.jsx(U,{label:"hex",name:"hex",value:m.hex,onChange:g,onFocus:y,onBlur:v}),o.jsx(U,{label:"rgb",name:"color_rgb",value:m.color_rgb,onChange:g,onFocus:y,onBlur:v}),o.jsx(U,{label:"hsv",name:"color_hs",value:m.color_hs,onChange:g,onFocus:y,onBlur:v}),o.jsx(U,{label:"xyY",name:"color_xy",value:m.color_xy,onChange:g,onFocus:y,onBlur:v})]})]})}),vn=f.memo(e=>{const{deviceValue:r,feature:{name:n,features:t,property:a},onChange:s,minimal:i}=e,m=f.useMemo(()=>{const c={},h=r!=null&&typeof r=="object"?r:{};for(const u of t){const x=Number.parseFloat(h[u.name]);c[u.name]=Number.isNaN(x)?0:x}return c},[r,t]),l=f.useCallback(c=>s({[a??"color"]:c}),[a,s]);return o.jsx(Oe,{onChange:l,value:m,format:n,minimal:i})}),Cn={position:[0,25,50,75,100].map(e=>({value:e,name:`${e}`})),tilt:[0,25,50,75,100].map(e=>({value:e,name:`${e}`}))};function jn(e){return o.jsx(E,{...e,steps:Cn})}function G(e){return typeof e!="object"}const Ue=f.memo(e=>{const{onChange:r,values:n,value:t,minimal:a}=e,{t:s}=F("common"),i=G(t),m=f.useCallback(l=>{const c=n.find(h=>G(h)?h===l.target.value:h.value===Number.parseInt(l.target.value,10));r(c)},[n,r]);return a?o.jsxs("select",{className:"select",onChange:m,value:(i?t:t?.value)??"",children:[o.jsx("option",{value:"",disabled:!0,children:s(l=>l.select_value)}),n.map(l=>{const c=G(l);return o.jsx("option",{value:c?l:l.value,children:c?l:l.name},c?l:l.name)})]}):o.jsx("div",{className:"flex flex-row flex-wrap gap-1",children:n.map(l=>{const c=G(l),h=c?l===t:l.value===(i?t:t?.value);return o.jsx(A,{className:`btn btn-outline btn-primary btn-sm join-item${h?" btn-active":""}`,onClick:r,item:c?l:l.value,title:c?`${l}`:l.description,children:c?o.jsx(z,{value:l,name:""}):l.name},c?l:l.name)})})}),Sn=6,Tn=f.memo(e=>{const{onChange:r,feature:{access:n=j.SET,values:t,property:a},deviceValue:s,minimal:i}=e;return n&j.SET?o.jsx(Ue,{onChange:m=>r(a?{[a]:m}:m),values:t,value:s!=null&&(typeof s=="string"||typeof s=="number"||typeof s=="object")?s:"",minimal:i||t.length>Sn}):n&j.STATE?o.jsx(q,{...e}):o.jsx(M,{...e})});function Nn(e){return o.jsx(E,{...e})}const W=e=>e>0?Array(e).fill("#ffffff"):[],An=f.memo(e=>{const{minimal:r,onChange:n,feature:{length_min:t,length_max:a,property:s},deviceValue:i}=e,{t:m}=F("common"),[l,c]=f.useState(W(t)),[h,u]=f.useState(!1),[x,g]=f.useState(!1);f.useEffect(()=>{i&&Array.isArray(i)?c(ue(i,t,a,d=>W(d))):c(W(t))},[i,t,a]),f.useEffect(()=>{u(l.length<a),g(l.length>t)},[l,t,a]);const y=f.useCallback((d,b)=>{c(_=>{const p=Array.from(_);return p[d]=b,p})},[]),v=f.useCallback(()=>{c(d=>[...d,"#ffffff"])},[]),S=f.useCallback(d=>{c(b=>{const _=Array.from(b);return _.splice(d,1),_})},[]),N=f.useCallback(()=>n({[s??"gradient"]:l}),[l,s,n]);return o.jsxs(o.Fragment,{children:[l.map((d,b)=>o.jsxs("div",{className:"flex flex-row flex-wrap gap-2 items-center",children:[o.jsx(Oe,{onChange:_=>{y(b,_.hex)},value:{hex:d},format:"hex",minimal:r}),x&&o.jsx(A,{item:b,className:"btn btn-sm btn-error",onClick:S,children:"-"})]},`${d}-${b}`)),h&&o.jsx("div",{className:"flex flex-row flex-wrap gap-2",children:o.jsx(A,{className:"btn btn-sm btn-success",onClick:v,children:"+"})}),o.jsx("div",{children:o.jsx(A,{className:`btn btn-primary ${r?"btn-sm":""}`,onClick:N,children:m(d=>d.apply)})})]})}),Rn={brightness:[0,25,50,75,100].map(e=>({value:ze(e,[0,100],[0,255]),name:`${e}%`})),color_temp:[1e3,2e3,3e3,4e3,5e3,6500].map(e=>({value:1e6/e,name:`${e}K`}))};function En(e){return o.jsx(E,{...e,steps:Rn})}var ee,ye;function kn(){if(ye)return ee;ye=1;function e(r,n,t){var a=-1,s=r.length;n<0&&(n=-n>s?0:s+n),t=t>s?s:t,t<0&&(t+=s),s=n>t?0:t-n>>>0,n>>>=0;for(var i=Array(s);++a<s;)i[a]=r[a+n];return i}return ee=e,ee}var ne,_e;function wn(){if(_e)return ne;_e=1;var e=kn();function r(n,t,a){var s=n.length;return a=a===void 0?s:a,!t&&a>=s?n:e(n,t,a)}return ne=r,ne}var re,ve;function Ge(){if(ve)return re;ve=1;var e="\\ud800-\\udfff",r="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",t="\\u20d0-\\u20ff",a=r+n+t,s="\\ufe0e\\ufe0f",i="\\u200d",m=RegExp("["+i+e+a+s+"]");function l(c){return m.test(c)}return re=l,re}var te,Ce;function In(){if(Ce)return te;Ce=1;function e(r){return r.split("")}return te=e,te}var se,je;function Fn(){if(je)return se;je=1;var e="\\ud800-\\udfff",r="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",t="\\u20d0-\\u20ff",a=r+n+t,s="\\ufe0e\\ufe0f",i="["+e+"]",m="["+a+"]",l="\\ud83c[\\udffb-\\udfff]",c="(?:"+m+"|"+l+")",h="[^"+e+"]",u="(?:\\ud83c[\\udde6-\\uddff]){2}",x="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",y=c+"?",v="["+s+"]?",S="(?:"+g+"(?:"+[h,u,x].join("|")+")"+v+y+")*",N=v+y+S,d="(?:"+[h+m+"?",m,u,x,i].join("|")+")",b=RegExp(l+"(?="+l+")|"+d+N,"g");function _(p){return p.match(b)||[]}return se=_,se}var oe,Se;function $n(){if(Se)return oe;Se=1;var e=In(),r=Ge(),n=Fn();function t(a){return r(a)?n(a):e(a)}return oe=t,oe}var ae,Te;function qn(){if(Te)return ae;Te=1;var e=wn(),r=Ge(),n=$n(),t=Ke();function a(s){return function(i){i=t(i);var m=r(i)?n(i):void 0,l=m?m[0]:i.charAt(0),c=m?e(m,1).join(""):i.slice(1);return l[s]()+c}}return ae=a,ae}var ce,Ne;function Mn(){if(Ne)return ce;Ne=1;var e=qn(),r=e("toUpperCase");return ce=r,ce}var le,Ae;function Bn(){if(Ae)return le;Ae=1;var e=Je(),r=Mn(),n=e(function(t,a,s){return t+(s?" ":"")+r(a)});return le=n,le}var Vn=Bn();const On=Re(Vn);function Un(e){return e.type==="composite"&&(e.name==="color_xy"||e.name==="color_hs")}function Gn({children:e,feature:r,deviceValue:n,onRead:t,endpointSpecific:a,parentFeatures:s}){const{t:i}=F("zigbee"),m=r.unit,[l,c]=Ye(r.name,n,m),h=t!==void 0&&(!!(r.property&&r.access&j.GET)||Un(r)),u=s[s.length-1],x=r.name==="state"?r.property:r.name;let g=r.label||On(x);u?.label&&r.name==="state"&&u.type!=="light"&&u.type!=="switch"&&(g=`${u.label} ${r.label.charAt(0).toLowerCase()}${r.label.slice(1)}`);const y=f.useCallback(v=>{v.property&&t?.({[v.property]:""})},[t]);return o.jsxs("div",{className:"list-row p-3",children:[o.jsx("div",{children:o.jsx(ie,{icon:l,className:c,size:"2xl"})}),o.jsxs("div",{children:[o.jsxs("div",{title:x,children:[g,!a&&r.endpoint?` (${i(v=>v.endpoint)}: ${r.endpoint})`:""]}),o.jsx("div",{className:"text-xs font-semibold opacity-60",children:r.description})]}),o.jsx("div",{className:"list-col-wrap flex flex-col gap-2",children:e}),h&&o.jsx(A,{item:r,onClick:y,className:"btn btn-xs btn-square btn-primary btn-soft",children:o.jsx(ie,{icon:De})})]})}function Hn(e){if(e!==void 0){if(e.length===0)return!0;if(e.length===1){const r=e[0].type;return r!=null&&r!=="composite"&&r!=="list"}}return!1}const w=(e,r)=>e>0?Array(e).fill(r==="composite"?{}:""):[],Ln=f.memo(e=>{const{t:r}=F("common"),{feature:n,minimal:t,parentFeatures:a,onChange:s,deviceValue:i}=e,{property:m,access:l=j.SET,item_type:c,length_min:h,length_max:u}=n,[x,g]=f.useState(w(h??0,c.type)),[y,v]=f.useState(!1),[S,N]=f.useState(!1),d=Hn(a);f.useEffect(()=>{if(i)if(Array.isArray(i))g(ue(i,h,u,C=>w(C,c.type)));else if(m&&typeof i=="object"){const C=i[m];g(C?ue(C,h,u,T=>w(T,c.type)):w(h??0,c.type))}else g(w(h??0,c.type));else g(w(h??0,c.type))},[i,m,c.type,h,u]),f.useEffect(()=>{v(u!==void 0&&u>0?x.length<u:!0),N(h!==void 0&&h>0?x.length>h:!0)},[x,h,u]);const b=f.useCallback((C,T)=>{const k=Array.from(x);typeof C=="object"&&C!=null&&(C={...x[T],...C}),k[T]=C??"",g(k),d||s(m?{[m]:k}:k)},[x,m,d,s]),_=f.useCallback(()=>g(C=>[...C,c.type==="composite"?{}:""]),[c.type]),p=f.useCallback(C=>{const T=Array.from(x);T.splice(C,1),g(T),d||s(m?{[m]:T}:T)},[x,m,d,s]),$=f.useCallback(()=>{s(m?{[m]:x}:x)},[m,s,x]);return l&j.SET?o.jsxs(o.Fragment,{children:[x.map((C,T)=>o.jsxs("div",{className:"flex flex-row flex-wrap gap-2 items-center",children:[o.jsx(He,{feature:c,device:{},deviceState:C,onChange:k=>b(k,T),featureWrapperClass:Gn,parentFeatures:[...a,n]}),S&&o.jsx(A,{item:T,className:"btn btn-sm btn-error btn-square",onClick:p,children:"-"})]},T)),y&&o.jsx("div",{className:"flex flex-row flex-wrap gap-2",children:o.jsx(A,{className:"btn btn-sm btn-success btn-square",onClick:_,children:"+"})}),d&&o.jsx("div",{children:o.jsx(A,{className:`btn btn-primary ${t?"btn-sm":""}`,onClick:$,children:r(C=>C.apply)})})]}):l&j.STATE?o.jsx(q,{...e}):o.jsx(M,{...e})});function zn(e){return o.jsx(E,{...e})}const Dn=f.memo(e=>{const{onChange:r,value:n,min:t,max:a,unit:s,steps:i,minimal:m,...l}=e,[c,h]=f.useState(n),u=t!=null&&a!=null;f.useEffect(()=>{h(n)},[n]);const x=f.useCallback(y=>{h(y.target.value?y.target.valueAsNumber:"")},[]),g=f.useCallback(y=>!y.target.validationMessage&&r(c===""?null:c),[c,r]);return o.jsxs("div",{className:"flex flex-row flex-wrap gap-3 items-center",children:[!m&&i?o.jsx(Ue,{values:i,onChange:r,value:c}):null,u?o.jsxs("div",{className:"w-full max-w-xs",children:[o.jsx("input",{min:t,max:a,type:"range",className:"range range-xs range-primary validator",value:c,onChange:x,onTouchEnd:g,onMouseUp:g,onKeyUp:g,...l}),o.jsxs("div",{className:"flex justify-between px-1 mt-1 text-xs",children:[o.jsx("span",{children:t}),m&&o.jsx("span",{children:c}),o.jsx("span",{children:a})]})]}):null,(!m||!u)&&o.jsxs("label",{className:"input",children:[o.jsx("input",{type:"number",className:"grow validator",value:c,onChange:x,onBlur:g,min:t,max:a,...l}),s]})]})}),Pn=f.memo(e=>{const{feature:{presets:r,access:n=j.SET,property:t,unit:a,value_max:s,value_min:i,value_step:m},deviceValue:l,steps:c,onChange:h,minimal:u}=e;return n&j.SET?o.jsx(Dn,{onChange:x=>h(t?{[t]:x}:x),value:typeof l=="number"?l:"",min:i,max:s,step:m,steps:r?.length?r:c,unit:a,minimal:u}):n&j.STATE?o.jsx(q,{...e}):o.jsx(M,{...e})});function Xn(e){return o.jsx(E,{...e})}const Kn=f.memo(e=>{const{onChange:r,value:n,...t}=e,[a,s]=f.useState(n);return f.useEffect(()=>{s(n)},[n]),o.jsx("input",{type:"text",className:"input validator",value:a,onChange:i=>s(i.target.value),onBlur:i=>!i.target.validationMessage&&r(a),...t})}),Jn=f.memo(e=>{const{feature:{access:r=j.SET,property:n},deviceValue:t,onChange:a}=e;return r&j.SET?o.jsx(Kn,{onChange:s=>a(n?{[n]:s}:s),value:t!=null?typeof t=="string"?t:JSON.stringify(t):""}):r&j.STATE?o.jsx(q,{...e}):o.jsx(M,{...e})});function He({feature:e,device:r,deviceState:n,steps:t,onRead:a,onChange:s,featureWrapperClass:i,minimal:m,endpointSpecific:l,parentFeatures:c}){const h=e.property?n[e.property]:n,u=Ee(e),x={device:r,deviceValue:h,onChange:s,onRead:a,featureWrapperClass:i,minimal:m,endpointSpecific:l,parentFeatures:c},g={feature:e,onRead:a,deviceValue:h,parentFeatures:c,endpointSpecific:l};switch(e.type){case"binary":return o.jsx(i,{...g,children:o.jsx(Ze,{feature:e,...x},u)},u);case"numeric":return o.jsx(i,{...g,children:o.jsx(Pn,{feature:e,...x,steps:t},u)},u);case"list":return e.name==="gradient"&&e.length_min!=null&&e.length_max!=null?o.jsx(i,{...g,children:o.jsx(An,{feature:e,...x},u)},u):o.jsx(i,{...g,children:o.jsx(Ln,{feature:e,...x},u)},u);case"text":return o.jsx(i,{...g,children:o.jsx(Jn,{feature:e,...x},u)},u);case"enum":return o.jsx(i,{...g,children:o.jsx(Tn,{feature:e,...x},u)},u);case"light":return o.jsx(En,{feature:e,...x,deviceState:n},u);case"switch":return o.jsx(Xn,{feature:e,...x,deviceState:n},u);case"cover":return o.jsx(jn,{feature:e,...x,deviceState:n},u);case"lock":return o.jsx(zn,{feature:e,...x,deviceState:n},u);case"climate":return o.jsx(We,{feature:e,...x,deviceState:n},u);case"fan":return o.jsx(Nn,{feature:e,...x,deviceState:n},u);case"composite":return e.name==="color_xy"||e.name==="color_hs"?o.jsx(i,{...g,children:o.jsx(vn,{feature:e,...x},u)},u):o.jsx(i,{...g,children:o.jsx(E,{feature:e,...x,deviceState:e.property?n[e.property]:n},u)},u);default:return console.error("Unsupported feature",e),o.jsx(i,{...g,children:o.jsx("pre",{children:JSON.stringify(e,null,4)})},u)}}export{He as F,Gn as a,On as s};
1
+ import{r as f,j as o,bm as j,u as F,B as A,F as ie,bn as Le,aL as Re,bo as ze,a1 as De}from"./index-O2DLxYbj.js";import{D as z}from"./DisplayValue-BZ-eaAKu.js";import{r as Pe}from"./isObject--vsEa_js.js";import{r as Xe,a as Ke,b as Je}from"./_createCompounder-DvelL9we.js";import{g as Ee,c as ue,a as Ye}from"./index-BnCNGENq.js";const q=f.memo(({feature:e,deviceValue:r})=>o.jsxs("div",{children:[e.property&&o.jsx("span",{className:"font-bold",children:o.jsx(z,{value:r,name:e.name})}),"unit"in e&&o.jsx("span",{className:"text-xs ms-1",children:e.unit})]})),M=f.memo(e=>o.jsxs("div",{className:"alert alert-warning",role:"alert",children:["Unknown access ",o.jsx("pre",{children:e.feature.access})]})),Ze=f.memo(e=>{const{feature:{access:r=j.SET,name:n,property:t,value_off:a,value_on:s},deviceValue:i,onChange:m,minimal:l}=e,{t:c}=F("zigbee"),h=f.useCallback(x=>m(t?{[t]:x}:x),[t,m]),u=f.useCallback(x=>{const g=x.target.checked?s:a;m(t?{[t]:g}:g)},[s,a,t,m]);if(r&j.SET){const x=i!=null,g=!l||l&&!x;return o.jsxs("div",{children:[g&&o.jsx(A,{className:"btn btn-link",item:a,onClick:h,children:o.jsx(z,{value:a,name:n})}),x?o.jsx("input",{className:"toggle",type:"checkbox",checked:i===s,onChange:u}):o.jsx("span",{className:"tooltip","data-tip":c(y=>y.unknown),children:o.jsx(ie,{icon:Le})}),g&&o.jsx(A,{className:"btn btn-link",item:s,onClick:h,children:o.jsx(z,{value:s,name:n})})]})}return r&j.STATE?o.jsx(q,{...e}):o.jsx(M,{...e})});function Qe(e,r){if(e==="composite"&&r!==void 0){if(r.length===0)return!0;if(r.length===1){const n=r[0].type;return n!=null&&n!=="composite"&&n!=="list"}}return!1}function E({feature:e,onChange:r,parentFeatures:n,onRead:t,device:a,deviceState:s,featureWrapperClass:i,minimal:m,endpointSpecific:l,steps:c}){const{type:h,property:u}=e,[x,g]=f.useState({}),{t:y}=F("common"),v=f.useMemo(()=>({...s,...x}),[s,x]),S="features"in e&&e.features||[],N=Qe(h,n);f.useEffect(()=>{g({})},[a.ieee_address]);const d=f.useCallback(p=>{g($=>({...$,...p})),N||r(h==="composite"&&u?{[u]:{...x,...p}}:p)},[x,h,u,N,r]),b=f.useCallback(()=>{const p={...s,...x};r(u?{[u]:p}:p)},[u,r,x,s]),_=f.useCallback(p=>{t?.(h==="composite"&&u?{[u]:p}:p)},[t,h,u]);return o.jsxs(o.Fragment,{children:[S.map(p=>o.jsx(He,{feature:p,parentFeatures:n??[],device:a,deviceState:v,onChange:d,onRead:_,featureWrapperClass:i,minimal:m,endpointSpecific:l,steps:c?.[p.name]},Ee(p))),N&&o.jsx("div",{className:"self-end float-right",children:o.jsx(A,{className:`btn btn-primary ${m?"btn-sm":""}`,onClick:b,children:y(p=>p.apply)})})]})}function We(e){return o.jsx(E,{...e})}var P,me;function en(){if(me)return P;me=1;function e(r,n,t){return r===r&&(t!==void 0&&(r=r<=t?r:t),n!==void 0&&(r=r>=n?r:n)),r}return P=e,P}var X,fe;function nn(){if(fe)return X;fe=1;var e=/\s/;function r(n){for(var t=n.length;t--&&e.test(n.charAt(t)););return t}return X=r,X}var K,xe;function rn(){if(xe)return K;xe=1;var e=nn(),r=/^\s+/;function n(t){return t&&t.slice(0,e(t)+1).replace(r,"")}return K=n,K}var J,he;function tn(){if(he)return J;he=1;var e=rn(),r=Pe(),n=Xe(),t=NaN,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,i=/^0o[0-7]+$/i,m=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return t;if(r(c)){var h=typeof c.valueOf=="function"?c.valueOf():c;c=r(h)?h+"":h}if(typeof c!="string")return c===0?c:+c;c=e(c);var u=s.test(c);return u||i.test(c)?m(c.slice(2),u?2:8):a.test(c)?t:+c}return J=l,J}var Y,de;function sn(){if(de)return Y;de=1;var e=en(),r=tn();function n(t,a,s){return s===void 0&&(s=a,a=void 0),s!==void 0&&(s=r(s),s=s===s?s:0),a!==void 0&&(a=r(a),a=a===a?a:0),e(r(t),a,s)}return Y=n,Y}var on=sn();const R=Re(on),an=[.412453,.35758,.180423,.212671,.71516,.072169,.019334,.119193,.950227],cn=[3.2404813432005266,-1.5371515162713183,-.49853632616888777,-.9692549499965684,1.8759900014898907,.041555926558292815,.05564663913517715,-.20404133836651123,1.0573110696453443],ke=.42,we=.0031308,Ie=12.92,D=.055,H=e=>e<=we?Ie*e:(1+D)*e**ke-D,ln=1/ke,un=H(we),mn=1/Ie,Z=e=>e<=un?e*mn:((e+D)/(1+D))**ln,Fe=(e,r)=>{const n=[0,0,0];for(let t=0;t<3;t++){n[t]=0;for(let a=0;a<3;a++)n[t]+=r[t*3+a]*e[a]}return n},ge=(e,r,n)=>{const t=[Z(e),Z(r),Z(n)];return Fe(t,an)},fn=(e,r,n)=>{const t=Fe([e,r,n],cn);return[H(t[0]),H(t[1]),H(t[2])]},$e=(e,r,n)=>{const t=1-e-r;return fn(n/r*e,n,n/r*t)},qe=(e,r,n=10)=>{let t=1;for(let a=0;a<n;a++){const s=Math.max(...$e(e,r,t));t=t/s}return t},B=(e,r,n)=>{if(e/=255,r/=255,n/=255,e<1e-12&&r<1e-12&&n<1e-12){const[m,l,c]=ge(1,1,1),h=m+l+c;return[m/h,l/h,0]}const[t,a,s]=ge(e,r,n),i=t+a+s;return[t/i,a/i,a]},xn=(e,r,n)=>{n===void 0&&(n=qe(e,r));const[t,a,s]=$e(e,r,n);return[R(t*255,0,255),R(a*255,0,255),R(s*255,0,255)]},V=(e,r,n)=>{e/=255,r/=255,n/=255;const t=Math.max(e,r,n),a=t-Math.min(e,r,n),s=a?(t===e?(r-n)/a+(r<n?6:0):t===r?2+(n-e)/a:4+(e-r)/a)*60:0,i=t?a/t*100:0,m=t*100;return[R(s,0,360),R(i,0,100),R(m,0,100)]},hn=(e,r,n)=>{r/=100,n/=100;const t=~~(e/60),a=e/60-t,s=n*(1-r),i=n*(1-r*a),m=n*(1-r*(1-a)),l=t%6,c=[n,i,s,s,m,n][l]*255,h=[m,n,n,i,s,s][l]*255,u=[s,s,m,n,n,i][l]*255;return[R(c,0,255),R(h,0,255),R(u,0,255)]},O=(e,r,n)=>{const[t,a,s]=[e,r,n].map(i=>Math.round(i).toString(16).padStart(2,"0"));return`#${t}${a}${s}`},dn=e=>(e=e.slice(1),Array.from({length:3}).map((r,n)=>Number.parseInt(e.slice(n*2,n*2+2),16))),I=(e,r)=>{switch(r){case"color_xy":{const{x:n=.313,y:t=.329,Y:a=qe(n,t===0?.329:t)}=e,s=t===0?[255,255,255]:xn(n,t,a);return{color_rgb:s,color_hs:V(...s),color_xy:[n,t,a],hex:O(...s)}}case"color_hs":{const{hue:n=0,saturation:t=0}=e,a=100,s=hn(n,t,a);return{color_rgb:s,color_hs:[n,t,a],color_xy:B(...s),hex:O(...s)}}case"color_rgb":{const{r:n=255,g:t=255,b:a=255}=e;return{color_rgb:[n,t,a],color_hs:V(n,t,a),color_xy:B(n,t,a),hex:O(n,t,a)}}case"hex":{const n=e.hex,t=dn(n);return{color_rgb:t,color_hs:V(...t),color_xy:B(...t),hex:n}}default:{const n=[255,255,255];return{color_rgb:n,color_hs:V(...n),color_xy:B(...n),hex:O(...n)}}}},be=(e,r)=>{switch(r){case"color_xy":return{x:e.color_xy[0],y:e.color_xy[1]};case"color_hs":return{hue:e.color_hs[0],saturation:e.color_hs[1]};case"color_rgb":return{r:e.color_rgb[0],g:e.color_rgb[1],b:e.color_rgb[2]};case"hex":return{hex:e.hex}}},Me=e=>`${e[0].toFixed(3)}, ${e[1].toFixed(3)}, ${e[2].toFixed(3)}`,L=e=>`${e[0].toFixed(2)}°, ${e[1].toFixed(2)}%, ${e[2].toFixed(2)}%`,Be=e=>`${e[0].toFixed(0)}, ${e[1].toFixed(0)}, ${e[2].toFixed(0)}`,Ve=e=>e,pe=e=>({color_xy:Me(e.color_xy),color_hs:L(e.color_hs),color_rgb:Be(e.color_rgb),hex:Ve(e.hex)}),gn=e=>{const r=e.match(/\d+(\.\d+)?/gu)??[];return Array.from({length:3}).map((n,t)=>+(r[t]??0))},bn=e=>{const r=e.match(/\d+(\.\d+)?/gu)??[];return Array.from({length:3}).map((n,t)=>R(+(r[t]??0),0,t?100:360))},pn=e=>{const r=e.match(/\d+(\.\d+)?/gu)??[];return Array.from({length:3}).map((n,t)=>R(+(r[t]??0),0,255))},Q=(e,r)=>{switch(r){case"color_xy":{const n=gn(e);return I({x:n[0],y:n[1]},"color_xy")}case"color_hs":{const n=bn(e);return I({hue:n[0],saturation:n[1]},"color_hs")}case"color_rgb":{const n=pn(e);return I({r:n[0],g:n[1],b:n[2]},"color_rgb")}case"hex":return I({hex:e},"hex")}},yn="linear-gradient(to right, white, transparent)",_n="linear-gradient(to right, rgb(255, 0, 0), rgb(255, 255, 0), rgb(0, 255, 0), rgb(0, 255, 255), rgb(0, 0, 255), rgb(255, 0, 255), rgb(255, 0, 0))",U=f.memo(({label:e,...r})=>o.jsxs("label",{className:"input",children:[e,o.jsx("input",{type:"text",className:"grow",...r})]})),Oe=f.memo(e=>{const{onChange:r,value:n={},format:t,minimal:a}=e,[s,i]=f.useState(I(n,t)),[m,l]=f.useState(pe(s)),[c,h]=f.useState({color_rgb:!1,color_hs:!1,color_xy:!1,hex:!1});f.useEffect(()=>{const d=I(n,t);i(d),l(pe(d))},[n,t]),f.useEffect(()=>{if(!c.color_xy){const d=Me(s.color_xy);l(b=>({...b,color_xy:d}))}},[c.color_xy,s.color_xy]),f.useEffect(()=>{if(!c.color_hs){const d=L(s.color_hs);l(b=>({...b,color_hs:d}))}},[c.color_hs,s.color_hs]),f.useEffect(()=>{if(!c.color_rgb){const d=Be(s.color_rgb);l(b=>({...b,color_rgb:d}))}},[c.color_rgb,s.color_rgb]),f.useEffect(()=>{if(!c.hex){const d=Ve(s.hex);l(b=>({...b,hex:d}))}},[c.hex,s.hex]);const u=f.useCallback(d=>{if(d.target.value){const b=Array.from(s.color_hs);b[1]=d.target.valueAsNumber;const _=L(b);l(p=>({...p,color_hs:_})),i(Q(_,"color_hs"))}},[s.color_hs]),x=f.useCallback(d=>{if(d.target.value){const b=Array.from(s.color_hs),_=b[1];b[1]=_===0?100:_,b[0]=d.target.valueAsNumber;const p=L(b);l($=>({...$,color_hs:p})),i(Q(p,"color_hs"))}},[s.color_hs]),g=f.useCallback(d=>{const{value:b,name:_}=d.target;l(p=>({...p,[_]:b})),i(Q(b,_))},[]),y=f.useCallback(d=>{h(b=>({...b,[d.target.name]:!0}))},[]),v=f.useCallback(d=>{h(b=>({...b,[d.target.name]:!1})),r(be(s,t))},[s,t,r]),S=f.useCallback(()=>{r(be(s,t))},[s,t,r]),N=f.useMemo(()=>`hsl(${s.color_hs[0]}, 100%, 50%)`,[s.color_hs[0]]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex flex-row flex-wrap gap-3 items-center",children:o.jsx("div",{className:`w-full${a?" max-w-xs":""}`,children:o.jsx("input",{type:"range",min:0,max:100,value:s.color_hs[1],className:`range [--range-bg:transparent] [--range-fill:0] w-full${a?" range-xs ":""}`,style:{backgroundImage:yn,backgroundColor:N},onChange:u,onTouchEnd:S,onMouseUp:S,onKeyUp:S})})}),o.jsx("div",{className:"flex flex-row flex-wrap gap-3 items-center",children:o.jsx("div",{className:`w-full${a?" max-w-xs":""}`,children:o.jsx("input",{type:"range",min:0,max:360,value:s.color_hs[0],className:`range [--range-bg:transparent] [--range-fill:0] w-full${a?" range-xs ":""}`,style:{backgroundImage:_n},onChange:x,onTouchEnd:S,onMouseUp:S,onKeyUp:S})})}),!a&&o.jsxs("div",{className:"flex flex-row flex-wrap gap-2 justify-around",children:[o.jsx(U,{label:"hex",name:"hex",value:m.hex,onChange:g,onFocus:y,onBlur:v}),o.jsx(U,{label:"rgb",name:"color_rgb",value:m.color_rgb,onChange:g,onFocus:y,onBlur:v}),o.jsx(U,{label:"hsv",name:"color_hs",value:m.color_hs,onChange:g,onFocus:y,onBlur:v}),o.jsx(U,{label:"xyY",name:"color_xy",value:m.color_xy,onChange:g,onFocus:y,onBlur:v})]})]})}),vn=f.memo(e=>{const{deviceValue:r,feature:{name:n,features:t,property:a},onChange:s,minimal:i}=e,m=f.useMemo(()=>{const c={},h=r!=null&&typeof r=="object"?r:{};for(const u of t){const x=Number.parseFloat(h[u.name]);c[u.name]=Number.isNaN(x)?0:x}return c},[r,t]),l=f.useCallback(c=>s({[a??"color"]:c}),[a,s]);return o.jsx(Oe,{onChange:l,value:m,format:n,minimal:i})}),Cn={position:[0,25,50,75,100].map(e=>({value:e,name:`${e}`})),tilt:[0,25,50,75,100].map(e=>({value:e,name:`${e}`}))};function jn(e){return o.jsx(E,{...e,steps:Cn})}function G(e){return typeof e!="object"}const Ue=f.memo(e=>{const{onChange:r,values:n,value:t,minimal:a}=e,{t:s}=F("common"),i=G(t),m=f.useCallback(l=>{const c=n.find(h=>G(h)?h===l.target.value:h.value===Number.parseInt(l.target.value,10));r(c)},[n,r]);return a?o.jsxs("select",{className:"select",onChange:m,value:(i?t:t?.value)??"",children:[o.jsx("option",{value:"",disabled:!0,children:s(l=>l.select_value)}),n.map(l=>{const c=G(l);return o.jsx("option",{value:c?l:l.value,children:c?l:l.name},c?l:l.name)})]}):o.jsx("div",{className:"flex flex-row flex-wrap gap-1",children:n.map(l=>{const c=G(l),h=c?l===t:l.value===(i?t:t?.value);return o.jsx(A,{className:`btn btn-outline btn-primary btn-sm join-item${h?" btn-active":""}`,onClick:r,item:c?l:l.value,title:c?`${l}`:l.description,children:c?o.jsx(z,{value:l,name:""}):l.name},c?l:l.name)})})}),Sn=6,Tn=f.memo(e=>{const{onChange:r,feature:{access:n=j.SET,values:t,property:a},deviceValue:s,minimal:i}=e;return n&j.SET?o.jsx(Ue,{onChange:m=>r(a?{[a]:m}:m),values:t,value:s!=null&&(typeof s=="string"||typeof s=="number"||typeof s=="object")?s:"",minimal:i||t.length>Sn}):n&j.STATE?o.jsx(q,{...e}):o.jsx(M,{...e})});function Nn(e){return o.jsx(E,{...e})}const W=e=>e>0?Array(e).fill("#ffffff"):[],An=f.memo(e=>{const{minimal:r,onChange:n,feature:{length_min:t,length_max:a,property:s},deviceValue:i}=e,{t:m}=F("common"),[l,c]=f.useState(W(t)),[h,u]=f.useState(!1),[x,g]=f.useState(!1);f.useEffect(()=>{i&&Array.isArray(i)?c(ue(i,t,a,d=>W(d))):c(W(t))},[i,t,a]),f.useEffect(()=>{u(l.length<a),g(l.length>t)},[l,t,a]);const y=f.useCallback((d,b)=>{c(_=>{const p=Array.from(_);return p[d]=b,p})},[]),v=f.useCallback(()=>{c(d=>[...d,"#ffffff"])},[]),S=f.useCallback(d=>{c(b=>{const _=Array.from(b);return _.splice(d,1),_})},[]),N=f.useCallback(()=>n({[s??"gradient"]:l}),[l,s,n]);return o.jsxs(o.Fragment,{children:[l.map((d,b)=>o.jsxs("div",{className:"flex flex-row flex-wrap gap-2 items-center",children:[o.jsx(Oe,{onChange:_=>{y(b,_.hex)},value:{hex:d},format:"hex",minimal:r}),x&&o.jsx(A,{item:b,className:"btn btn-sm btn-error",onClick:S,children:"-"})]},`${d}-${b}`)),h&&o.jsx("div",{className:"flex flex-row flex-wrap gap-2",children:o.jsx(A,{className:"btn btn-sm btn-success",onClick:v,children:"+"})}),o.jsx("div",{children:o.jsx(A,{className:`btn btn-primary ${r?"btn-sm":""}`,onClick:N,children:m(d=>d.apply)})})]})}),Rn={brightness:[0,25,50,75,100].map(e=>({value:ze(e,[0,100],[0,255]),name:`${e}%`})),color_temp:[1e3,2e3,3e3,4e3,5e3,6500].map(e=>({value:1e6/e,name:`${e}K`}))};function En(e){return o.jsx(E,{...e,steps:Rn})}var ee,ye;function kn(){if(ye)return ee;ye=1;function e(r,n,t){var a=-1,s=r.length;n<0&&(n=-n>s?0:s+n),t=t>s?s:t,t<0&&(t+=s),s=n>t?0:t-n>>>0,n>>>=0;for(var i=Array(s);++a<s;)i[a]=r[a+n];return i}return ee=e,ee}var ne,_e;function wn(){if(_e)return ne;_e=1;var e=kn();function r(n,t,a){var s=n.length;return a=a===void 0?s:a,!t&&a>=s?n:e(n,t,a)}return ne=r,ne}var re,ve;function Ge(){if(ve)return re;ve=1;var e="\\ud800-\\udfff",r="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",t="\\u20d0-\\u20ff",a=r+n+t,s="\\ufe0e\\ufe0f",i="\\u200d",m=RegExp("["+i+e+a+s+"]");function l(c){return m.test(c)}return re=l,re}var te,Ce;function In(){if(Ce)return te;Ce=1;function e(r){return r.split("")}return te=e,te}var se,je;function Fn(){if(je)return se;je=1;var e="\\ud800-\\udfff",r="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",t="\\u20d0-\\u20ff",a=r+n+t,s="\\ufe0e\\ufe0f",i="["+e+"]",m="["+a+"]",l="\\ud83c[\\udffb-\\udfff]",c="(?:"+m+"|"+l+")",h="[^"+e+"]",u="(?:\\ud83c[\\udde6-\\uddff]){2}",x="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",y=c+"?",v="["+s+"]?",S="(?:"+g+"(?:"+[h,u,x].join("|")+")"+v+y+")*",N=v+y+S,d="(?:"+[h+m+"?",m,u,x,i].join("|")+")",b=RegExp(l+"(?="+l+")|"+d+N,"g");function _(p){return p.match(b)||[]}return se=_,se}var oe,Se;function $n(){if(Se)return oe;Se=1;var e=In(),r=Ge(),n=Fn();function t(a){return r(a)?n(a):e(a)}return oe=t,oe}var ae,Te;function qn(){if(Te)return ae;Te=1;var e=wn(),r=Ge(),n=$n(),t=Ke();function a(s){return function(i){i=t(i);var m=r(i)?n(i):void 0,l=m?m[0]:i.charAt(0),c=m?e(m,1).join(""):i.slice(1);return l[s]()+c}}return ae=a,ae}var ce,Ne;function Mn(){if(Ne)return ce;Ne=1;var e=qn(),r=e("toUpperCase");return ce=r,ce}var le,Ae;function Bn(){if(Ae)return le;Ae=1;var e=Je(),r=Mn(),n=e(function(t,a,s){return t+(s?" ":"")+r(a)});return le=n,le}var Vn=Bn();const On=Re(Vn);function Un(e){return e.type==="composite"&&(e.name==="color_xy"||e.name==="color_hs")}function Gn({children:e,feature:r,deviceValue:n,onRead:t,endpointSpecific:a,parentFeatures:s}){const{t:i}=F("zigbee"),m=r.unit,[l,c]=Ye(r.name,n,m),h=t!==void 0&&(!!(r.property&&r.access&j.GET)||Un(r)),u=s[s.length-1],x=r.name==="state"?r.property:r.name;let g=r.label||On(x);u?.label&&r.name==="state"&&u.type!=="light"&&u.type!=="switch"&&(g=`${u.label} ${r.label.charAt(0).toLowerCase()}${r.label.slice(1)}`);const y=f.useCallback(v=>{v.property&&t?.({[v.property]:""})},[t]);return o.jsxs("div",{className:"list-row p-3",children:[o.jsx("div",{children:o.jsx(ie,{icon:l,className:c,size:"2xl"})}),o.jsxs("div",{children:[o.jsxs("div",{title:x,children:[g,!a&&r.endpoint?` (${i(v=>v.endpoint)}: ${r.endpoint})`:""]}),o.jsx("div",{className:"text-xs font-semibold opacity-60",children:r.description})]}),o.jsx("div",{className:"list-col-wrap flex flex-col gap-2",children:e}),h&&o.jsx(A,{item:r,onClick:y,className:"btn btn-xs btn-square btn-primary btn-soft",children:o.jsx(ie,{icon:De})})]})}function Hn(e){if(e!==void 0){if(e.length===0)return!0;if(e.length===1){const r=e[0].type;return r!=null&&r!=="composite"&&r!=="list"}}return!1}const w=(e,r)=>e>0?Array(e).fill(r==="composite"?{}:""):[],Ln=f.memo(e=>{const{t:r}=F("common"),{feature:n,minimal:t,parentFeatures:a,onChange:s,deviceValue:i}=e,{property:m,access:l=j.SET,item_type:c,length_min:h,length_max:u}=n,[x,g]=f.useState(w(h??0,c.type)),[y,v]=f.useState(!1),[S,N]=f.useState(!1),d=Hn(a);f.useEffect(()=>{if(i)if(Array.isArray(i))g(ue(i,h,u,C=>w(C,c.type)));else if(m&&typeof i=="object"){const C=i[m];g(C?ue(C,h,u,T=>w(T,c.type)):w(h??0,c.type))}else g(w(h??0,c.type));else g(w(h??0,c.type))},[i,m,c.type,h,u]),f.useEffect(()=>{v(u!==void 0&&u>0?x.length<u:!0),N(h!==void 0&&h>0?x.length>h:!0)},[x,h,u]);const b=f.useCallback((C,T)=>{const k=Array.from(x);typeof C=="object"&&C!=null&&(C={...x[T],...C}),k[T]=C??"",g(k),d||s(m?{[m]:k}:k)},[x,m,d,s]),_=f.useCallback(()=>g(C=>[...C,c.type==="composite"?{}:""]),[c.type]),p=f.useCallback(C=>{const T=Array.from(x);T.splice(C,1),g(T),d||s(m?{[m]:T}:T)},[x,m,d,s]),$=f.useCallback(()=>{s(m?{[m]:x}:x)},[m,s,x]);return l&j.SET?o.jsxs(o.Fragment,{children:[x.map((C,T)=>o.jsxs("div",{className:"flex flex-row flex-wrap gap-2 items-center",children:[o.jsx(He,{feature:c,device:{},deviceState:C,onChange:k=>b(k,T),featureWrapperClass:Gn,parentFeatures:[...a,n]}),S&&o.jsx(A,{item:T,className:"btn btn-sm btn-error btn-square",onClick:p,children:"-"})]},T)),y&&o.jsx("div",{className:"flex flex-row flex-wrap gap-2",children:o.jsx(A,{className:"btn btn-sm btn-success btn-square",onClick:_,children:"+"})}),d&&o.jsx("div",{children:o.jsx(A,{className:`btn btn-primary ${t?"btn-sm":""}`,onClick:$,children:r(C=>C.apply)})})]}):l&j.STATE?o.jsx(q,{...e}):o.jsx(M,{...e})});function zn(e){return o.jsx(E,{...e})}const Dn=f.memo(e=>{const{onChange:r,value:n,min:t,max:a,unit:s,steps:i,minimal:m,...l}=e,[c,h]=f.useState(n),u=t!=null&&a!=null;f.useEffect(()=>{h(n)},[n]);const x=f.useCallback(y=>{h(y.target.value?y.target.valueAsNumber:"")},[]),g=f.useCallback(y=>!y.target.validationMessage&&r(c===""?null:c),[c,r]);return o.jsxs("div",{className:"flex flex-row flex-wrap gap-3 items-center",children:[!m&&i?o.jsx(Ue,{values:i,onChange:r,value:c}):null,u?o.jsxs("div",{className:"w-full max-w-xs",children:[o.jsx("input",{min:t,max:a,type:"range",className:"range range-xs range-primary validator",value:c,onChange:x,onTouchEnd:g,onMouseUp:g,onKeyUp:g,...l}),o.jsxs("div",{className:"flex justify-between px-1 mt-1 text-xs",children:[o.jsx("span",{children:t}),m&&o.jsx("span",{children:c}),o.jsx("span",{children:a})]})]}):null,(!m||!u)&&o.jsxs("label",{className:"input",children:[o.jsx("input",{type:"number",className:"grow validator",value:c,onChange:x,onBlur:g,min:t,max:a,...l}),s]})]})}),Pn=f.memo(e=>{const{feature:{presets:r,access:n=j.SET,property:t,unit:a,value_max:s,value_min:i,value_step:m},deviceValue:l,steps:c,onChange:h,minimal:u}=e;return n&j.SET?o.jsx(Dn,{onChange:x=>h(t?{[t]:x}:x),value:typeof l=="number"?l:"",min:i,max:s,step:m,steps:r?.length?r:c,unit:a,minimal:u}):n&j.STATE?o.jsx(q,{...e}):o.jsx(M,{...e})});function Xn(e){return o.jsx(E,{...e})}const Kn=f.memo(e=>{const{onChange:r,value:n,...t}=e,[a,s]=f.useState(n);return f.useEffect(()=>{s(n)},[n]),o.jsx("input",{type:"text",className:"input validator",value:a,onChange:i=>s(i.target.value),onBlur:i=>!i.target.validationMessage&&r(a),...t})}),Jn=f.memo(e=>{const{feature:{access:r=j.SET,property:n},deviceValue:t,onChange:a}=e;return r&j.SET?o.jsx(Kn,{onChange:s=>a(n?{[n]:s}:s),value:t!=null?typeof t=="string"?t:JSON.stringify(t):""}):r&j.STATE?o.jsx(q,{...e}):o.jsx(M,{...e})});function He({feature:e,device:r,deviceState:n,steps:t,onRead:a,onChange:s,featureWrapperClass:i,minimal:m,endpointSpecific:l,parentFeatures:c}){const h=e.property?n[e.property]:n,u=Ee(e),x={device:r,deviceValue:h,onChange:s,onRead:a,featureWrapperClass:i,minimal:m,endpointSpecific:l,parentFeatures:c},g={feature:e,onRead:a,deviceValue:h,parentFeatures:c,endpointSpecific:l};switch(e.type){case"binary":return o.jsx(i,{...g,children:o.jsx(Ze,{feature:e,...x},u)},u);case"numeric":return o.jsx(i,{...g,children:o.jsx(Pn,{feature:e,...x,steps:t},u)},u);case"list":return e.name==="gradient"&&e.length_min!=null&&e.length_max!=null?o.jsx(i,{...g,children:o.jsx(An,{feature:e,...x},u)},u):o.jsx(i,{...g,children:o.jsx(Ln,{feature:e,...x},u)},u);case"text":return o.jsx(i,{...g,children:o.jsx(Jn,{feature:e,...x},u)},u);case"enum":return o.jsx(i,{...g,children:o.jsx(Tn,{feature:e,...x},u)},u);case"light":return o.jsx(En,{feature:e,...x,deviceState:n},u);case"switch":return o.jsx(Xn,{feature:e,...x,deviceState:n},u);case"cover":return o.jsx(jn,{feature:e,...x,deviceState:n},u);case"lock":return o.jsx(zn,{feature:e,...x,deviceState:n},u);case"climate":return o.jsx(We,{feature:e,...x,deviceState:n},u);case"fan":return o.jsx(Nn,{feature:e,...x,deviceState:n},u);case"composite":return e.name==="color_xy"||e.name==="color_hs"?o.jsx(i,{...g,children:o.jsx(vn,{feature:e,...x},u)},u):o.jsx(i,{...g,children:o.jsx(E,{feature:e,...x,deviceState:e.property?n[e.property]:n},u)},u);default:return console.error("Unsupported feature",e),o.jsx(i,{...g,children:o.jsx("pre",{children:JSON.stringify(e,null,4)})},u)}}export{He as F,Gn as a,On as s};
@@ -1 +1 @@
1
- import{u as k,r as o,l as t,ar as u,as as f,at as h,m as E,n as x,au as S,av as O,H as K,$ as Y,aw as L,ax as M,ay as H,az as y,aA as R,aB as F,aC as W,j as a,M as U,N as G,a5 as N}from"./index-C4AO15gr.js";import{C as r}from"./CheckboxField-Vzfuua4m.js";import{N as b}from"./NumberField-fT7hilHb.js";import"./envs-CSqIi4cL.js";function J(){const{t:s}=k(["settings","navbar","network","common"]),[i,p]=o.useState(t.get(u,254)),[l,g]=o.useState(t.get(f,3)),[m,C]=o.useState(t.get(h,!1)),[c,T]=o.useState(t.get(E,!0)),[_,w]=o.useState(t.get(x,!0)),[d,v]=o.useState(t.get(S,!0));o.useEffect(()=>{t.set(u,i)},[i]),o.useEffect(()=>{t.set(f,l)},[l]),o.useEffect(()=>{t.set(h,m)},[m]),o.useEffect(()=>{t.set(E,c)},[c]),o.useEffect(()=>{t.set(x,_)},[_]),o.useEffect(()=>{t.set(S,d)},[d]);const A=o.useCallback(()=>{const e=t.keys();t.remove(O),t.remove(u),t.remove(f),t.remove(h),t.remove(K),t.remove(E),t.remove(x),t.remove(Y),t.remove(L),t.remove(S),t.remove(M);for(const n of e)(n.startsWith(H)||n.startsWith(y)||n.startsWith(R))&&t.remove(n);window.location.reload()},[]),I=o.useCallback(()=>{const e=t.keys();for(const n of e)(n.startsWith(F)||n.startsWith(W))&&t.remove(n);window.location.reload()},[]),j=o.useCallback(()=>{t.clearAll(),window.location.reload()},[]);return a.jsxs(a.Fragment,{children:[a.jsx(G,{children:a.jsxs("div",{className:"flex flex-row flex-wrap flex-1 gap-1.5",children:[a.jsx(N,{className:"btn btn-sm btn-outline btn-error tooltip-bottom",onClick:A,title:s(e=>e.reset_settings),modalDescription:s(e=>e.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:s(e=>e.cancel,{ns:"common"}),children:s(e=>e.reset_settings)}),a.jsx(N,{className:"btn btn-sm btn-outline btn-error tooltip-bottom",onClick:I,title:s(e=>e.reset_auth),modalDescription:s(e=>e.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:s(e=>e.cancel,{ns:"common"}),children:s(e=>e.reset_auth)}),a.jsx(N,{className:"btn btn-sm btn-outline btn-error tooltip-bottom",onClick:j,title:s(e=>e.reset_all),modalDescription:s(e=>e.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:s(e=>e.cancel,{ns:"common"}),children:s(e=>e.reset_all)})]})}),a.jsx("div",{className:"alert alert-info alert-vertical sm:alert-horizontal",children:s(e=>e.frontend_notice)}),a.jsxs("div",{className:"flex flex-row flex-wrap gap-4 mt-3",children:[a.jsx(b,{type:"number",name:"permit_join_time",label:s(e=>e.permit_join_time),min:10,max:254,required:!0,minimal:!0,initialValue:i,onSubmit:(e,n)=>n&&e!==""&&p(e)}),a.jsx(b,{type:"number",name:"max_on_screen_notifications",label:s(e=>e.max_on_screen_notifications),min:1,max:5,required:!0,minimal:!0,initialValue:l,onSubmit:(e,n)=>n&&e!==""&&g(e)}),a.jsx(r,{name:"hide_static_info_alerts",label:s(e=>e.hide_static_info_alerts,{ns:"common"}),onChange:e=>C(e.target.checked),defaultChecked:m})]}),a.jsx("h2",{className:"text-lg mt-2",children:s(e=>e.home,{ns:"navbar"})}),a.jsxs("div",{className:"flex flex-row flex-wrap gap-4",children:[a.jsx(r,{name:"show_activity",label:`${s(e=>e.show,{ns:"common"})}: ${s(e=>e.activity,{ns:"navbar"})}`,onChange:e=>T(e.target.checked),defaultChecked:c}),a.jsx(r,{name:"show_group_scenes",label:`${s(e=>e.show,{ns:"common"})}: ${s(e=>e.group_scenes,{ns:"common"})}`,onChange:e=>w(e.target.checked),defaultChecked:_})]}),U&&a.jsxs(a.Fragment,{children:[a.jsx("h2",{className:"text-lg mt-2",children:s(e=>e.multi_instance,{ns:"common"})}),a.jsx("div",{className:"flex flex-row flex-wrap gap-4",children:a.jsx(r,{name:"show_source_name",label:s(e=>e.show_source_name,{ns:"common"}),onChange:e=>v(e.target.checked),defaultChecked:d})})]})]})}export{J as default};
1
+ import{u as k,r as o,l as t,ar as u,as as f,at as h,m as E,n as x,au as S,av as O,H as K,$ as Y,aw as L,ax as M,ay as H,az as y,aA as R,aB as F,aC as W,j as a,M as U,N as G,a5 as N}from"./index-O2DLxYbj.js";import{C as r}from"./CheckboxField-DDGxPCob.js";import{N as b}from"./NumberField-DVKVcA4j.js";import"./envs-CSqIi4cL.js";function J(){const{t:s}=k(["settings","navbar","network","common"]),[i,p]=o.useState(t.get(u,254)),[l,g]=o.useState(t.get(f,3)),[m,C]=o.useState(t.get(h,!1)),[c,T]=o.useState(t.get(E,!0)),[_,w]=o.useState(t.get(x,!0)),[d,v]=o.useState(t.get(S,!0));o.useEffect(()=>{t.set(u,i)},[i]),o.useEffect(()=>{t.set(f,l)},[l]),o.useEffect(()=>{t.set(h,m)},[m]),o.useEffect(()=>{t.set(E,c)},[c]),o.useEffect(()=>{t.set(x,_)},[_]),o.useEffect(()=>{t.set(S,d)},[d]);const A=o.useCallback(()=>{const e=t.keys();t.remove(O),t.remove(u),t.remove(f),t.remove(h),t.remove(K),t.remove(E),t.remove(x),t.remove(Y),t.remove(L),t.remove(S),t.remove(M);for(const n of e)(n.startsWith(H)||n.startsWith(y)||n.startsWith(R))&&t.remove(n);window.location.reload()},[]),I=o.useCallback(()=>{const e=t.keys();for(const n of e)(n.startsWith(F)||n.startsWith(W))&&t.remove(n);window.location.reload()},[]),j=o.useCallback(()=>{t.clearAll(),window.location.reload()},[]);return a.jsxs(a.Fragment,{children:[a.jsx(G,{children:a.jsxs("div",{className:"flex flex-row flex-wrap flex-1 gap-1.5",children:[a.jsx(N,{className:"btn btn-sm btn-outline btn-error tooltip-bottom",onClick:A,title:s(e=>e.reset_settings),modalDescription:s(e=>e.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:s(e=>e.cancel,{ns:"common"}),children:s(e=>e.reset_settings)}),a.jsx(N,{className:"btn btn-sm btn-outline btn-error tooltip-bottom",onClick:I,title:s(e=>e.reset_auth),modalDescription:s(e=>e.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:s(e=>e.cancel,{ns:"common"}),children:s(e=>e.reset_auth)}),a.jsx(N,{className:"btn btn-sm btn-outline btn-error tooltip-bottom",onClick:j,title:s(e=>e.reset_all),modalDescription:s(e=>e.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:s(e=>e.cancel,{ns:"common"}),children:s(e=>e.reset_all)})]})}),a.jsx("div",{className:"alert alert-info alert-vertical sm:alert-horizontal",children:s(e=>e.frontend_notice)}),a.jsxs("div",{className:"flex flex-row flex-wrap gap-4 mt-3",children:[a.jsx(b,{type:"number",name:"permit_join_time",label:s(e=>e.permit_join_time),min:10,max:254,required:!0,minimal:!0,initialValue:i,onSubmit:(e,n)=>n&&e!==""&&p(e)}),a.jsx(b,{type:"number",name:"max_on_screen_notifications",label:s(e=>e.max_on_screen_notifications),min:1,max:5,required:!0,minimal:!0,initialValue:l,onSubmit:(e,n)=>n&&e!==""&&g(e)}),a.jsx(r,{name:"hide_static_info_alerts",label:s(e=>e.hide_static_info_alerts,{ns:"common"}),onChange:e=>C(e.target.checked),defaultChecked:m})]}),a.jsx("h2",{className:"text-lg mt-2",children:s(e=>e.home,{ns:"navbar"})}),a.jsxs("div",{className:"flex flex-row flex-wrap gap-4",children:[a.jsx(r,{name:"show_activity",label:`${s(e=>e.show,{ns:"common"})}: ${s(e=>e.activity,{ns:"navbar"})}`,onChange:e=>T(e.target.checked),defaultChecked:c}),a.jsx(r,{name:"show_group_scenes",label:`${s(e=>e.show,{ns:"common"})}: ${s(e=>e.group_scenes,{ns:"common"})}`,onChange:e=>w(e.target.checked),defaultChecked:_})]}),U&&a.jsxs(a.Fragment,{children:[a.jsx("h2",{className:"text-lg mt-2",children:s(e=>e.multi_instance,{ns:"common"})}),a.jsx("div",{className:"flex flex-row flex-wrap gap-4",children:a.jsx(r,{name:"show_source_name",label:s(e=>e.show_source_name,{ns:"common"}),onChange:e=>v(e.target.checked),defaultChecked:d})})]})]})}export{J as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Devices-zZY0L8yI.js","./index-C4AO15gr.js","./envs-CSqIi4cL.js","./index-Zvf07u5t.css","./RecallRemove-_liyNDej.js","./DashboardFeatureWrapper-IF-AwBR9.js","./Feature-CsgctMqC.js","./DisplayValue-Cko1Z4Vm.js","./isObject--vsEa_js.js","./_createCompounder-Bb8q4vBx.js","./isObjectLike-DtP0zwgi.js","./index-DFi8ba4s.js","./InputField-CLgeChp0.js","./SelectField-WJRba65T.js","./DevicePicker-Dr-4DW3x.js","./EndpointPicker-_bkZcPK6.js","./useColumnCount-DM6Ez2tO.js","./DeviceCard-CqM8-MYx.js","./LastSeen-DF8tUMAo.js","./TimeAgo-e8nXr4AB.js","./Lqi-CB7A3dn1.js","./PowerSource-D9Tnu98A.js","./snakeCase-D0qZI2R1.js","./DeviceImage-B6w8VrRf.js","./index-CT-zuS9u.js","./GroupSettings-kzS_7sXT.js","./InfoAlert-Bmwt7g6d.js","./SettingsList-Dd50eBCN.js","./CheckboxField-Vzfuua4m.js","./NumberField-fT7hilHb.js"])))=>i.map(i=>d[i]);
2
- import{r as d,u as j,a as _,A as b,j as e,L as y,S as x,D as N,F as g,w as $,x as w,y as S,z as T,C as k,N as D,E as f,U as I,O as C,_ as v}from"./index-C4AO15gr.js";import{u as E}from"./useSearch-mUc3xkmI.js";import{D as A}from"./DebouncedInput-seIGAyZ5.js";import"./envs-CSqIi4cL.js";const L=d.memo(({currentSourceIdx:a,currentGroup:n,tab:t="devices"})=>{const[r,i,c]=E(),{t:u}=j("common"),p=_(s=>s.groups),l=d.useMemo(()=>{const s=[];for(let o=0;o<b.length;o++)for(const m of p[o])o===a&&m.id===n?.id||i.length>0&&!m.friendly_name.toLowerCase().includes(i)||s.push(e.jsx("li",{children:e.jsxs(y,{to:`/group/${o}/${m.id}/${t}`,onClick:()=>c(""),className:"dropdown-item",children:[e.jsx(x,{idx:o,autoHide:!0,namePostfix:" – "})," ",m.friendly_name]})},`${m.friendly_name}-${m.id}-${o}`));return s.sort((o,m)=>o.key.localeCompare(m.key)),s},[p,i,a,n,t,c]);return e.jsxs(N,{buttonChildren:e.jsxs(e.Fragment,{children:[a!==void 0&&e.jsx(x,{idx:a,autoHide:!0}),n?n.friendly_name:u(s=>s.unknown_group)]}),children:[e.jsxs("label",{className:"input min-h-10",children:[e.jsx(g,{icon:$}),e.jsx(A,{onChange:c,placeholder:u(s=>s.type_to_filter),value:r,title:u(s=>s.type_to_filter)})]},"search"),l]})}),P=d.lazy(async()=>await v(()=>import("./Devices-zZY0L8yI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url)),z=d.lazy(async()=>await v(()=>import("./GroupSettings-kzS_7sXT.js"),__vite__mapDeps([25,1,2,3,26,27,28,12,29,13]),import.meta.url));function F(a,n,t){const r=`${a}-${t.id}`;switch(n){case"devices":return e.jsx(P,{sourceIdx:a,group:t},r);case"settings":return e.jsx(z,{sourceIdx:a,group:t},r)}}const h=({isActive:a})=>a?"tab tab-active":"tab";function V(){const a=w(),{t:n}=j(["groups","common"]),{sourceIdx:t,groupId:r,tab:i}=S(),[c,u]=T(t),p=Number.parseInt(r,10),l=_(k(s=>r?s.groups[c].find(o=>o.id===p):void 0));return d.useEffect(()=>{t&&u&&l?i||a(`/group/${t}/${l.id}/devices`,{replace:!0}):a("/groups",{replace:!0})},[t,u,i,l,a]),e.jsxs(e.Fragment,{children:[e.jsx(D,{children:e.jsx(L,{currentSourceIdx:c,currentGroup:l,tab:i})}),e.jsxs("div",{className:"tabs tabs-border mt-2",children:[e.jsxs(f,{to:`/group/${c}/${r}/devices`,className:h,children:[e.jsx(g,{icon:I,className:"me-2"}),n(s=>s.devices,{ns:"common"})]}),e.jsxs(f,{to:`/group/${c}/${r}/settings`,className:h,children:[e.jsx(g,{icon:C,className:"me-2"}),n(s=>s.settings)]})]}),e.jsx("div",{className:"tab-content block h-full bg-base-100 p-3",children:i&&l?F(c,i,l):e.jsx("div",{className:"flex-auto justify-center items-center",children:n(s=>s.unknown_group,{ns:"common"})})})]})}export{V as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Devices-BFJMMQk1.js","./index-O2DLxYbj.js","./envs-CSqIi4cL.js","./index-Zvf07u5t.css","./RecallRemove-ByQ3RXQY.js","./DashboardFeatureWrapper-UEMN2W33.js","./Feature-BJ8zY1Ga.js","./DisplayValue-BZ-eaAKu.js","./isObject--vsEa_js.js","./_createCompounder-DvelL9we.js","./isObjectLike-D2GWafVk.js","./index-BnCNGENq.js","./InputField-BYfjYPOY.js","./SelectField-CGrVloaL.js","./DevicePicker-Eg-X3fKz.js","./EndpointPicker-DtqElVGb.js","./useColumnCount-CDIFEtdP.js","./DeviceCard-CE7t_uOW.js","./LastSeen-DA4kaWWb.js","./TimeAgo-BBbvibZK.js","./Lqi-BLFaxsM9.js","./PowerSource-D71Ibdxv.js","./snakeCase-DDe65ywx.js","./DeviceImage-C6iSUjiJ.js","./index-BWJZAMXy.js","./GroupSettings-2DGc5J43.js","./InfoAlert-BEMI4UFc.js","./SettingsList-CTeXhdEC.js","./CheckboxField-DDGxPCob.js","./NumberField-DVKVcA4j.js"])))=>i.map(i=>d[i]);
2
+ import{r as d,u as j,a as _,A as b,j as e,L as y,S as x,D as N,F as g,w as $,x as w,y as S,z as T,C as k,N as D,E as f,U as I,O as C,_ as v}from"./index-O2DLxYbj.js";import{u as E}from"./useSearch-CiQm9ZMA.js";import{D as A}from"./DebouncedInput-B_mSPoL2.js";import"./envs-CSqIi4cL.js";const L=d.memo(({currentSourceIdx:a,currentGroup:n,tab:t="devices"})=>{const[r,i,c]=E(),{t:u}=j("common"),p=_(s=>s.groups),l=d.useMemo(()=>{const s=[];for(let o=0;o<b.length;o++)for(const m of p[o])o===a&&m.id===n?.id||i.length>0&&!m.friendly_name.toLowerCase().includes(i)||s.push(e.jsx("li",{children:e.jsxs(y,{to:`/group/${o}/${m.id}/${t}`,onClick:()=>c(""),className:"dropdown-item",children:[e.jsx(x,{idx:o,autoHide:!0,namePostfix:" – "})," ",m.friendly_name]})},`${m.friendly_name}-${m.id}-${o}`));return s.sort((o,m)=>o.key.localeCompare(m.key)),s},[p,i,a,n,t,c]);return e.jsxs(N,{buttonChildren:e.jsxs(e.Fragment,{children:[a!==void 0&&e.jsx(x,{idx:a,autoHide:!0}),n?n.friendly_name:u(s=>s.unknown_group)]}),children:[e.jsxs("label",{className:"input min-h-10",children:[e.jsx(g,{icon:$}),e.jsx(A,{onChange:c,placeholder:u(s=>s.type_to_filter),value:r,title:u(s=>s.type_to_filter)})]},"search"),l]})}),P=d.lazy(async()=>await v(()=>import("./Devices-BFJMMQk1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url)),z=d.lazy(async()=>await v(()=>import("./GroupSettings-2DGc5J43.js"),__vite__mapDeps([25,1,2,3,26,27,28,12,29,13]),import.meta.url));function F(a,n,t){const r=`${a}-${t.id}`;switch(n){case"devices":return e.jsx(P,{sourceIdx:a,group:t},r);case"settings":return e.jsx(z,{sourceIdx:a,group:t},r)}}const h=({isActive:a})=>a?"tab tab-active":"tab";function V(){const a=w(),{t:n}=j(["groups","common"]),{sourceIdx:t,groupId:r,tab:i}=S(),[c,u]=T(t),p=Number.parseInt(r,10),l=_(k(s=>r?s.groups[c].find(o=>o.id===p):void 0));return d.useEffect(()=>{t&&u&&l?i||a(`/group/${t}/${l.id}/devices`,{replace:!0}):a("/groups",{replace:!0})},[t,u,i,l,a]),e.jsxs(e.Fragment,{children:[e.jsx(D,{children:e.jsx(L,{currentSourceIdx:c,currentGroup:l,tab:i})}),e.jsxs("div",{className:"tabs tabs-border mt-2",children:[e.jsxs(f,{to:`/group/${c}/${r}/devices`,className:h,children:[e.jsx(g,{icon:I,className:"me-2"}),n(s=>s.devices,{ns:"common"})]}),e.jsxs(f,{to:`/group/${c}/${r}/settings`,className:h,children:[e.jsx(g,{icon:C,className:"me-2"}),n(s=>s.settings)]})]}),e.jsx("div",{className:"tab-content block h-full bg-base-100 p-3",children:i&&l?F(c,i,l):e.jsx("div",{className:"flex-auto justify-center items-center",children:n(s=>s.unknown_group,{ns:"common"})})})]})}export{V as default};
@@ -1 +1 @@
1
- import{u as a,a as m,C as p,r as c,s as d,j as e,d6 as f}from"./index-C4AO15gr.js";import{I as l}from"./InfoAlert-Bmwt7g6d.js";import{S as g}from"./SettingsList-Dd50eBCN.js";import"./envs-CSqIi4cL.js";import"./CheckboxField-Vzfuua4m.js";import"./InputField-CLgeChp0.js";import"./NumberField-fT7hilHb.js";import"./SelectField-WJRba65T.js";function k({sourceIdx:t,group:i}){const{t:r}=a(["settings","common"]),o=m(p(s=>s.bridgeInfo[t])),n=c.useCallback(async s=>{await d(t,"bridge/request/group/options",{id:i.id.toString(),options:s})},[t,i.id]);return e.jsxs(e.Fragment,{children:[e.jsx(l,{children:e.jsx("a",{href:f,target:"_blank",rel:"noreferrer",className:"link link-hover",children:r(s=>s.read_the_docs_info,{ns:"common"})})}),e.jsx(g,{schema:o.config_schema.definitions.group??{properties:{}},data:o.config.groups[i.id]??{},set:n,namespace:"definitions-group"})]})}export{k as default};
1
+ import{u as a,a as m,C as p,r as c,s as d,j as e,d6 as f}from"./index-O2DLxYbj.js";import{I as l}from"./InfoAlert-BEMI4UFc.js";import{S as g}from"./SettingsList-CTeXhdEC.js";import"./envs-CSqIi4cL.js";import"./CheckboxField-DDGxPCob.js";import"./InputField-BYfjYPOY.js";import"./NumberField-DVKVcA4j.js";import"./SelectField-CGrVloaL.js";function k({sourceIdx:t,group:i}){const{t:r}=a(["settings","common"]),o=m(p(s=>s.bridgeInfo[t])),n=c.useCallback(async s=>{await d(t,"bridge/request/group/options",{id:i.id.toString(),options:s})},[t,i.id]);return e.jsxs(e.Fragment,{children:[e.jsx(l,{children:e.jsx("a",{href:f,target:"_blank",rel:"noreferrer",className:"link link-hover",children:r(s=>s.read_the_docs_info,{ns:"common"})})}),e.jsx(g,{schema:o.config_schema.definitions.group??{properties:{}},data:o.config.groups[i.id]??{},set:n,namespace:"definitions-group"})]})}export{k as default};
@@ -1 +1 @@
1
- import{j as e,u as g,L as f,F as b,aY as h,aZ as j,a5 as _,Y as v,r as l,a7 as C,s as x,B as N,a as k,C as w}from"./index-C4AO15gr.js";import{u as G,b as y}from"./useColumnCount-DM6Ez2tO.js";import{E as S}from"./EndpointPicker-_bkZcPK6.js";import{S as M}from"./SelectField-WJRba65T.js";import"./envs-CSqIi4cL.js";const E=({sourceIdx:a,group:s,endpoint:i,removeFromGroup:d})=>{const{t:n}=g(["groups","common","zigbee"]);return e.jsxs("div",{className:"mb-3 card card-border bg-base-200 border-base-300 rounded-box shadow-md",children:[e.jsx("div",{className:"card-body p-3",children:e.jsx("div",{className:"flex flex-row items-center gap-3 w-full",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs(f,{to:`/group/${a}/${s.id}/devices`,className:"link link-hover font-semibold",children:["#",s.id," - ",s.friendly_name,i?` (${n(o=>o.endpoint,{ns:"zigbee"})}: ${i})`:""]}),s.description&&e.jsx("div",{className:"text-xs opacity-50 truncate",title:s.description,children:s.description})]})})}),e.jsxs("div",{className:"flex flex-row flex-wrap gap-1 mx-2 mb-2 justify-around items-center",children:[e.jsxs("div",{className:"badge badge-soft badge-ghost cursor-default me-2 tooltip","data-tip":n(o=>o.group_members),children:[e.jsx(b,{icon:h})," ",s.members.length]}),e.jsxs("div",{className:"badge badge-soft badge-ghost cursor-default me-2 tooltip","data-tip":n(o=>o.group_scenes),children:[e.jsx(b,{icon:j}),s.scenes.length]}),e.jsx(_,{item:[s,i],onClick:d,className:"btn btn-square btn-error btn-sm",title:n(o=>o.remove_from_group),modalDescription:n(o=>o.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:n(o=>o.cancel,{ns:"common"}),children:e.jsx(b,{icon:v})})]})]})},F=a=>a?.data?e.jsx(E,{...a.data}):null,q=l.memo(({groups:a,value:s,label:i,onChange:d,...n})=>{const{t:o}=g("common"),m=l.useCallback(r=>{const{value:u}=r.target,p=Number.parseInt(u,10);d(a.find(t=>p===t.id))},[a,d]),c=l.useMemo(()=>a.map(r=>e.jsx("option",{value:r.id,children:r.friendly_name},r.friendly_name)).sort((r,u)=>r.key.localeCompare(u.key)),[a]);return e.jsxs(M,{name:"group_picker",label:i,value:s,onChange:m,...n,children:[e.jsx("option",{value:"",disabled:!0,children:o(r=>r.select_group)}),c]})}),z=l.memo(({sourceIdx:a,device:s,nonMemberGroups:i})=>{const{t:d}=g(["groups","zigbee"]),[n,o]=l.useState(""),[m,c]=l.useState(""),r=l.useMemo(()=>C(s),[s]),u=l.useCallback(t=>{c(t.id),o(r.values().next().value)},[r]),p=l.useCallback(async()=>await x(a,"bridge/request/group/members/add",{group:m.toString(),endpoint:n,device:s.ieee_address}),[a,m,s.ieee_address,n]);return e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-lg font-semibold",children:d(t=>t.add_to_group)}),e.jsxs("div",{className:"mb-3",children:[e.jsx(q,{label:d(t=>t.group,{ns:"zigbee"}),value:m,groups:i,onChange:u,required:!0}),e.jsx(S,{label:d(t=>t.endpoint,{ns:"zigbee"}),values:r,value:n,onChange:t=>o(t),required:!0})]}),e.jsx(N,{onClick:p,className:"btn btn-primary",disabled:n==null||m==null||n===""||m==="",children:d(t=>t.add_to_group)})]})});function D({sourceIdx:a,device:s}){const i=k(w(c=>c.groups[a])),d=G(),n=l.useCallback(async([c,r])=>await x(a,"bridge/request/group/members/remove",{device:s.ieee_address,endpoint:r,group:c.id.toString()}),[a,s.ieee_address]),[o,m]=l.useMemo(()=>{const c=[],r=[];for(const u of i){const p=u.members.filter(t=>t.ieee_address===s.ieee_address);if(p.length>0)for(const t of p)c.push({sourceIdx:a,group:u,endpoint:t.endpoint,removeFromGroup:n});else r.push(u)}return[c,r]},[a,i,s.ieee_address,n]);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-row flex-wrap gap-4 mb-3 w-full",children:e.jsx("div",{className:"card card-border bg-base-200 border-base-300 rounded-box shadow-md flex-1",children:e.jsx("div",{className:"card-body p-4",children:e.jsx(z,{sourceIdx:a,device:s,nonMemberGroups:m})})})}),e.jsx("div",{children:e.jsx(y,{useWindowScroll:!0,columnCount:d,data:o,ItemContent:F,className:"gap-3"},`membergroups-${o.length}`)})]})}export{D as default};
1
+ import{j as e,u as g,L as f,F as b,aY as h,aZ as j,a5 as _,Y as v,r as l,a7 as C,s as x,B as N,a as k,C as w}from"./index-O2DLxYbj.js";import{u as G,b as y}from"./useColumnCount-CDIFEtdP.js";import{E as S}from"./EndpointPicker-DtqElVGb.js";import{S as M}from"./SelectField-CGrVloaL.js";import"./envs-CSqIi4cL.js";const E=({sourceIdx:a,group:s,endpoint:i,removeFromGroup:d})=>{const{t:n}=g(["groups","common","zigbee"]);return e.jsxs("div",{className:"mb-3 card card-border bg-base-200 border-base-300 rounded-box shadow-md",children:[e.jsx("div",{className:"card-body p-3",children:e.jsx("div",{className:"flex flex-row items-center gap-3 w-full",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs(f,{to:`/group/${a}/${s.id}/devices`,className:"link link-hover font-semibold",children:["#",s.id," - ",s.friendly_name,i?` (${n(o=>o.endpoint,{ns:"zigbee"})}: ${i})`:""]}),s.description&&e.jsx("div",{className:"text-xs opacity-50 truncate",title:s.description,children:s.description})]})})}),e.jsxs("div",{className:"flex flex-row flex-wrap gap-1 mx-2 mb-2 justify-around items-center",children:[e.jsxs("div",{className:"badge badge-soft badge-ghost cursor-default me-2 tooltip","data-tip":n(o=>o.group_members),children:[e.jsx(b,{icon:h})," ",s.members.length]}),e.jsxs("div",{className:"badge badge-soft badge-ghost cursor-default me-2 tooltip","data-tip":n(o=>o.group_scenes),children:[e.jsx(b,{icon:j}),s.scenes.length]}),e.jsx(_,{item:[s,i],onClick:d,className:"btn btn-square btn-error btn-sm",title:n(o=>o.remove_from_group),modalDescription:n(o=>o.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:n(o=>o.cancel,{ns:"common"}),children:e.jsx(b,{icon:v})})]})]})},F=a=>a?.data?e.jsx(E,{...a.data}):null,q=l.memo(({groups:a,value:s,label:i,onChange:d,...n})=>{const{t:o}=g("common"),m=l.useCallback(r=>{const{value:u}=r.target,p=Number.parseInt(u,10);d(a.find(t=>p===t.id))},[a,d]),c=l.useMemo(()=>a.map(r=>e.jsx("option",{value:r.id,children:r.friendly_name},r.friendly_name)).sort((r,u)=>r.key.localeCompare(u.key)),[a]);return e.jsxs(M,{name:"group_picker",label:i,value:s,onChange:m,...n,children:[e.jsx("option",{value:"",disabled:!0,children:o(r=>r.select_group)}),c]})}),z=l.memo(({sourceIdx:a,device:s,nonMemberGroups:i})=>{const{t:d}=g(["groups","zigbee"]),[n,o]=l.useState(""),[m,c]=l.useState(""),r=l.useMemo(()=>C(s),[s]),u=l.useCallback(t=>{c(t.id),o(r.values().next().value)},[r]),p=l.useCallback(async()=>await x(a,"bridge/request/group/members/add",{group:m.toString(),endpoint:n,device:s.ieee_address}),[a,m,s.ieee_address,n]);return e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-lg font-semibold",children:d(t=>t.add_to_group)}),e.jsxs("div",{className:"mb-3",children:[e.jsx(q,{label:d(t=>t.group,{ns:"zigbee"}),value:m,groups:i,onChange:u,required:!0}),e.jsx(S,{label:d(t=>t.endpoint,{ns:"zigbee"}),values:r,value:n,onChange:t=>o(t),required:!0})]}),e.jsx(N,{onClick:p,className:"btn btn-primary",disabled:n==null||m==null||n===""||m==="",children:d(t=>t.add_to_group)})]})});function D({sourceIdx:a,device:s}){const i=k(w(c=>c.groups[a])),d=G(),n=l.useCallback(async([c,r])=>await x(a,"bridge/request/group/members/remove",{device:s.ieee_address,endpoint:r,group:c.id.toString()}),[a,s.ieee_address]),[o,m]=l.useMemo(()=>{const c=[],r=[];for(const u of i){const p=u.members.filter(t=>t.ieee_address===s.ieee_address);if(p.length>0)for(const t of p)c.push({sourceIdx:a,group:u,endpoint:t.endpoint,removeFromGroup:n});else r.push(u)}return[c,r]},[a,i,s.ieee_address,n]);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-row flex-wrap gap-4 mb-3 w-full",children:e.jsx("div",{className:"card card-border bg-base-200 border-base-300 rounded-box shadow-md flex-1",children:e.jsx("div",{className:"card-body p-4",children:e.jsx(z,{sourceIdx:a,device:s,nonMemberGroups:m})})})}),e.jsx("div",{children:e.jsx(y,{useWindowScroll:!0,columnCount:d,data:o,ItemContent:F,className:"gap-3"},`membergroups-${o.length}`)})]})}export{D as default};
@@ -1 +1 @@
1
- import{X as w,a2 as G,u as F,r,j as n,a3 as I,B as g,a as q,A as E,s as x,p as N,S as M,F as f,q as $,L as v,a4 as T,a5 as z,Y as L,N as R,M as _,a6 as A}from"./index-C4AO15gr.js";import{I as b}from"./InputField-CLgeChp0.js";import{S as V}from"./SelectField-WJRba65T.js";import{T as B}from"./Table-nLICgiiZ.js";import{u as P,T as D}from"./useTable-DEG0rBUT.js";import"./envs-CSqIi4cL.js";import"./DebouncedInput-seIGAyZ5.js";const O=w.create(({sourceIdx:m,name:l,onRename:o})=>{const c=G(),{t}=F(["groups","common"]),[u,d]=r.useState(l);return r.useEffect(()=>{d(l)},[l]),r.useEffect(()=>{const a=p=>{p.key==="Escape"&&(p.preventDefault(),c.remove())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[c]),n.jsx(I,{isOpen:c.visible,title:`${t(a=>a.rename_group)} ${l}`,footer:n.jsxs(n.Fragment,{children:[n.jsx(g,{className:"btn btn-neutral",onClick:c.remove,children:t(a=>a.cancel,{ns:"common"})}),n.jsx(g,{className:"btn btn-primary ms-1",onClick:async()=>{u&&(c.remove(),await o(m,l,u))},children:t(a=>a.rename_group)})]}),children:n.jsx("div",{className:"flex flex-col gap-2",children:n.jsx(b,{name:"friendly_name",label:t(a=>a.friendly_name,{ns:"common"}),onChange:a=>d(a.target.value),value:u,type:"text",required:!0})})})});function W(){const[m,l]=r.useState(""),[o,c]=r.useState(""),[t,u]=r.useState(0),d=q(e=>e.groups),{t:a}=F(["groups","common"]),p=r.useMemo(()=>{const e=[];for(let s=0;s<E.length;s++)for(const i of d[s])e.push({sourceIdx:s,group:i});return e},[d]),S=r.useCallback(async()=>{const e={friendly_name:m};o&&(e.id=o),await x(t,"bridge/request/group/add",e),l(""),c(""),u(0)},[m,o,t]),h=r.useCallback(async(e,s,i)=>await x(e,"bridge/request/group/rename",{from:s,to:i}),[]),j=r.useCallback(async([e,s])=>await x(e,"bridge/request/group/remove",{id:s}),[]),C=r.useMemo(()=>m?!o||!d[t].find(e=>e.id.toString()===o):!1,[m,o,t,d]),k=r.useMemo(()=>[{id:"source",size:60,header:()=>n.jsx("span",{title:a(e=>e.source,{ns:"common"}),children:n.jsx(f,{icon:$})}),accessorFn:({sourceIdx:e})=>N[e],cell:({row:{original:{sourceIdx:e}}})=>n.jsx(M,{idx:e,nameClassName:"hidden md:inline-block"}),filterFn:"equals",meta:{filterVariant:"select",showFacetedOccurrences:!0}},{id:"friendly_name",size:250,minSize:175,header:a(e=>e.friendly_name,{ns:"common"}),accessorFn:({group:e})=>`${e.friendly_name} ${e.description??""}`,cell:({row:{original:{sourceIdx:e,group:s}}})=>n.jsxs("div",{className:"flex-grow flex flex-col min-w-0",children:[n.jsx(v,{to:`/group/${e}/${s.id}/devices`,className:"link link-hover truncate",children:s.friendly_name}),s.description&&n.jsx("div",{className:"max-w-3xs text-xs opacity-50 truncate",title:s.description,children:s.description})]}),sortingFn:(e,s)=>e.original.group.friendly_name.localeCompare(s.original.group.friendly_name),filterFn:"includesString",meta:{filterVariant:"text",textFaceted:!0}},{id:"group_id",minSize:175,header:a(e=>e.group_id),accessorFn:({group:e})=>e.id,cell:({row:{original:{sourceIdx:e,group:s}}})=>n.jsx(v,{to:`/group/${e}/${s.id}/devices`,className:"link link-hover",children:s.id}),filterFn:"weakEquals",meta:{filterVariant:"text"}},{id:"members",size:125,header:a(e=>e.group_members),accessorFn:({group:e})=>e.members.length??0,filterFn:"inNumberRange",meta:{filterVariant:"range"}},{id:"scenes",size:125,header:a(e=>e.group_scenes),accessorFn:({group:e})=>e.scenes.length??0,filterFn:"inNumberRange",meta:{filterVariant:"range"}},{id:"actions",minSize:130,cell:({row:{original:{sourceIdx:e,group:s}}})=>n.jsxs("div",{className:"join join-horizontal",children:[n.jsx(g,{className:"btn btn-sm btn-square btn-outline btn-primary join-item",onClick:async()=>await w.show(O,{sourceIdx:e,name:s.friendly_name,onRename:h}),title:a(i=>i.rename_group),disabled:s.friendly_name==="default_bind_group",children:n.jsx(f,{icon:T})}),n.jsx(z,{title:a(i=>i.remove_group),item:[e,s.id.toString()],onClick:j,className:"btn btn-sm btn-square btn-outline btn-error join-item",modalDescription:a(i=>i.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:a(i=>i.cancel,{ns:"common"}),children:n.jsx(f,{icon:L})})]}),enableSorting:!1,enableColumnFilter:!1,enableGlobalFilter:!1}],[h,j,a]),y=P({id:"all-groups",columns:k,data:p,visibleColumns:{source:_},sorting:[{id:"friendly_name",desc:!1}]});return n.jsxs(n.Fragment,{children:[n.jsx(R,{children:n.jsx(D,{...y})}),n.jsxs("div",{className:"flex flex-row flex-wrap justify-center gap-2 mb-2",children:[_&&n.jsx(V,{name:"source",label:a(e=>e.source,{ns:"common"}),value:t,required:!0,onChange:e=>!e.target.validationMessage&&u(Number.parseInt(e.target.value,10)),className:"select",children:N.map((e,s)=>n.jsx("option",{value:s,children:e},`${s}-${e}`))}),n.jsx(b,{type:"text",name:"friendly_name",label:a(e=>e.friendly_name,{ns:"common"}),value:m,placeholder:a(e=>e.friendly_name_placeholder),onChange:e=>l(e.target.value),required:!0,minLength:1,className:"input"}),n.jsx(b,{type:"number",name:"group_id",label:a(e=>e.group_id),value:o,min:0,max:255,onChange:e=>c(e.target.value),className:"input"}),n.jsx("fieldset",{className:"fieldset self-end",children:n.jsxs(g,{onClick:S,className:"btn btn-outline btn-primary",disabled:!C,children:[n.jsx(f,{icon:A}),a(e=>e.create_group)]})})]}),n.jsx("div",{className:"mb-5",children:n.jsx(B,{id:"all-groups",...y})})]})}export{W as default};
1
+ import{X as w,a2 as G,u as F,r,j as n,a3 as I,B as g,a as q,A as E,s as x,p as N,S as M,F as f,q as $,L as v,a4 as T,a5 as z,Y as L,N as R,M as _,a6 as A}from"./index-O2DLxYbj.js";import{I as b}from"./InputField-BYfjYPOY.js";import{S as V}from"./SelectField-CGrVloaL.js";import{T as B}from"./Table-DQSQ_sYq.js";import{u as P,T as D}from"./useTable-CC5yv3vQ.js";import"./envs-CSqIi4cL.js";import"./DebouncedInput-B_mSPoL2.js";const O=w.create(({sourceIdx:m,name:l,onRename:o})=>{const c=G(),{t}=F(["groups","common"]),[u,d]=r.useState(l);return r.useEffect(()=>{d(l)},[l]),r.useEffect(()=>{const a=p=>{p.key==="Escape"&&(p.preventDefault(),c.remove())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[c]),n.jsx(I,{isOpen:c.visible,title:`${t(a=>a.rename_group)} ${l}`,footer:n.jsxs(n.Fragment,{children:[n.jsx(g,{className:"btn btn-neutral",onClick:c.remove,children:t(a=>a.cancel,{ns:"common"})}),n.jsx(g,{className:"btn btn-primary ms-1",onClick:async()=>{u&&(c.remove(),await o(m,l,u))},children:t(a=>a.rename_group)})]}),children:n.jsx("div",{className:"flex flex-col gap-2",children:n.jsx(b,{name:"friendly_name",label:t(a=>a.friendly_name,{ns:"common"}),onChange:a=>d(a.target.value),value:u,type:"text",required:!0})})})});function W(){const[m,l]=r.useState(""),[o,c]=r.useState(""),[t,u]=r.useState(0),d=q(e=>e.groups),{t:a}=F(["groups","common"]),p=r.useMemo(()=>{const e=[];for(let s=0;s<E.length;s++)for(const i of d[s])e.push({sourceIdx:s,group:i});return e},[d]),S=r.useCallback(async()=>{const e={friendly_name:m};o&&(e.id=o),await x(t,"bridge/request/group/add",e),l(""),c(""),u(0)},[m,o,t]),h=r.useCallback(async(e,s,i)=>await x(e,"bridge/request/group/rename",{from:s,to:i}),[]),j=r.useCallback(async([e,s])=>await x(e,"bridge/request/group/remove",{id:s}),[]),C=r.useMemo(()=>m?!o||!d[t].find(e=>e.id.toString()===o):!1,[m,o,t,d]),k=r.useMemo(()=>[{id:"source",size:60,header:()=>n.jsx("span",{title:a(e=>e.source,{ns:"common"}),children:n.jsx(f,{icon:$})}),accessorFn:({sourceIdx:e})=>N[e],cell:({row:{original:{sourceIdx:e}}})=>n.jsx(M,{idx:e,nameClassName:"hidden md:inline-block"}),filterFn:"equals",meta:{filterVariant:"select",showFacetedOccurrences:!0}},{id:"friendly_name",size:250,minSize:175,header:a(e=>e.friendly_name,{ns:"common"}),accessorFn:({group:e})=>`${e.friendly_name} ${e.description??""}`,cell:({row:{original:{sourceIdx:e,group:s}}})=>n.jsxs("div",{className:"flex-grow flex flex-col min-w-0",children:[n.jsx(v,{to:`/group/${e}/${s.id}/devices`,className:"link link-hover truncate",children:s.friendly_name}),s.description&&n.jsx("div",{className:"max-w-3xs text-xs opacity-50 truncate",title:s.description,children:s.description})]}),sortingFn:(e,s)=>e.original.group.friendly_name.localeCompare(s.original.group.friendly_name),filterFn:"includesString",meta:{filterVariant:"text",textFaceted:!0}},{id:"group_id",minSize:175,header:a(e=>e.group_id),accessorFn:({group:e})=>e.id,cell:({row:{original:{sourceIdx:e,group:s}}})=>n.jsx(v,{to:`/group/${e}/${s.id}/devices`,className:"link link-hover",children:s.id}),filterFn:"weakEquals",meta:{filterVariant:"text"}},{id:"members",size:125,header:a(e=>e.group_members),accessorFn:({group:e})=>e.members.length??0,filterFn:"inNumberRange",meta:{filterVariant:"range"}},{id:"scenes",size:125,header:a(e=>e.group_scenes),accessorFn:({group:e})=>e.scenes.length??0,filterFn:"inNumberRange",meta:{filterVariant:"range"}},{id:"actions",minSize:130,cell:({row:{original:{sourceIdx:e,group:s}}})=>n.jsxs("div",{className:"join join-horizontal",children:[n.jsx(g,{className:"btn btn-sm btn-square btn-outline btn-primary join-item",onClick:async()=>await w.show(O,{sourceIdx:e,name:s.friendly_name,onRename:h}),title:a(i=>i.rename_group),disabled:s.friendly_name==="default_bind_group",children:n.jsx(f,{icon:T})}),n.jsx(z,{title:a(i=>i.remove_group),item:[e,s.id.toString()],onClick:j,className:"btn btn-sm btn-square btn-outline btn-error join-item",modalDescription:a(i=>i.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:a(i=>i.cancel,{ns:"common"}),children:n.jsx(f,{icon:L})})]}),enableSorting:!1,enableColumnFilter:!1,enableGlobalFilter:!1}],[h,j,a]),y=P({id:"all-groups",columns:k,data:p,visibleColumns:{source:_},sorting:[{id:"friendly_name",desc:!1}]});return n.jsxs(n.Fragment,{children:[n.jsx(R,{children:n.jsx(D,{...y})}),n.jsxs("div",{className:"flex flex-row flex-wrap justify-center gap-2 mb-2",children:[_&&n.jsx(V,{name:"source",label:a(e=>e.source,{ns:"common"}),value:t,required:!0,onChange:e=>!e.target.validationMessage&&u(Number.parseInt(e.target.value,10)),className:"select",children:N.map((e,s)=>n.jsx("option",{value:s,children:e},`${s}-${e}`))}),n.jsx(b,{type:"text",name:"friendly_name",label:a(e=>e.friendly_name,{ns:"common"}),value:m,placeholder:a(e=>e.friendly_name_placeholder),onChange:e=>l(e.target.value),required:!0,minLength:1,className:"input"}),n.jsx(b,{type:"number",name:"group_id",label:a(e=>e.group_id),value:o,min:0,max:255,onChange:e=>c(e.target.value),className:"input"}),n.jsx("fieldset",{className:"fieldset self-end",children:n.jsxs(g,{onClick:S,className:"btn btn-outline btn-primary",disabled:!C,children:[n.jsx(f,{icon:A}),a(e=>e.create_group)]})})]}),n.jsx("div",{className:"mb-5",children:n.jsx(B,{id:"all-groups",...y})})]})}export{W as default};
@@ -1 +1 @@
1
- import{u as k,a as r,C as n,r as N,j as s,t as p,L as _,F as d,a0 as y,de as F,df as T,M,S as D,dg as z,q as R}from"./index-C4AO15gr.js";import{u as q,T as A}from"./useTable-DEG0rBUT.js";import{D as C}from"./DeviceImage-B6w8VrRf.js";import{I as $}from"./InfoAlert-Bmwt7g6d.js";import{T as L}from"./Table-nLICgiiZ.js";import{D as V}from"./Duration-bceKVeXp.js";import{T as u}from"./TimeAgo-e8nXr4AB.js";import"./envs-CSqIi4cL.js";import"./DebouncedInput-seIGAyZ5.js";import"./index-CT-zuS9u.js";function K({sourceIdx:c}){const{t:a,i18n:m}=k(["health","settings","common","zigbee"]),t=r(n(e=>e.bridgeHealth[c])),o=r(n(e=>e.devices[c])),i=r(n(e=>e.webSocketMetrics[c])),f=r(n(e=>e.readyStates[c])),x=z[f],b=N.useMemo(()=>{const e=[];if(t)for(const l in t.devices){const j=o.find(S=>S.ieee_address===l);j&&e.push({device:j,health:t.devices[l]})}return e},[t,o]),w=N.useMemo(()=>[{id:"friendly_name",minSize:175,header:a(e=>e.friendly_name,{ns:"common"}),accessorFn:({device:e})=>`${e.friendly_name} ${e.description??""}`,cell:({row:{original:{device:e}}})=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"avatar",children:s.jsx("div",{className:"h-11 w-11",style:{overflow:"visible"},children:s.jsx(C,{device:e,disabled:!1})})}),s.jsxs("div",{className:"flex flex-col min-w-0",children:[s.jsx(_,{to:`/device/${c}/${e.ieee_address}/info`,className:"link link-hover truncate",children:e.friendly_name}),e.friendly_name!==e.ieee_address?e.ieee_address:null]})]}),sortingFn:(e,l)=>e.original.device.friendly_name.localeCompare(l.original.device.friendly_name),filterFn:"includesString",meta:{filterVariant:"text",textFaceted:!0}},{id:"ieee_address",minSize:175,header:a(e=>e.ieee_address,{ns:"zigbee"}),accessorFn:({device:e})=>`${e.ieee_address} ${p(e.network_address,4)} ${e.network_address}`,cell:({row:{original:{device:e}}})=>s.jsxs(s.Fragment,{children:[s.jsx("div",{children:s.jsx(_,{to:`/device/${c}/${e.ieee_address}/info`,className:"link link-hover",children:e.ieee_address})}),s.jsxs("div",{className:"flex flex-row gap-1",children:[s.jsx("span",{className:"badge badge-ghost badge-sm cursor-default",title:a(l=>l.network_address_hex,{ns:"zigbee"}),children:p(e.network_address,4)}),s.jsx("span",{className:"badge badge-ghost badge-sm cursor-default",title:a(l=>l.network_address_dec,{ns:"zigbee"}),children:e.network_address})]})]}),sortingFn:(e,l)=>e.original.device.ieee_address.localeCompare(l.original.device.ieee_address),filterFn:"includesString",meta:{filterVariant:"text"}},{id:"messages",header:a(e=>e.messages),accessorFn:({health:e})=>e.messages,filterFn:"inNumberRange",meta:{filterVariant:"range"}},{id:"messages_per_sec",header:a(e=>e.messages_per_sec),accessorFn:({health:e})=>e.messages_per_sec,cell:({row:{original:{health:e}}})=>s.jsx("span",{className:e.messages_per_sec>1?e.messages_per_sec>3?"text-error":"text-warning":e.messages_per_sec<.2?"text-success":"",children:e.messages_per_sec<=.001?a(l=>l.very_low):e.messages_per_sec}),filterFn:"inNumberRange",meta:{filterVariant:"range"}},{id:"leave_count",header:a(e=>e.leave_count),accessorFn:({health:e})=>e.leave_count,filterFn:"inNumberRange",meta:{filterVariant:"range"}},{id:"network_address_changes",header:a(e=>e.network_address_changes),accessorFn:({health:e})=>e.network_address_changes,filterFn:"inNumberRange",meta:{filterVariant:"range"}}],[c,a]),h=q({id:"health-devices",columns:w,data:b,sorting:[{id:"friendly_name",desc:!1}]});if(t.response_time===0)return s.jsxs("div",{className:"alert alert-info alert-soft",role:"alert",children:[s.jsx(d,{icon:y,size:"2xl"}),a(e=>e.awaiting_next_check)]});const v=new Date(t.response_time),g=new Date(i.lastMessageTs);return s.jsxs(s.Fragment,{children:[s.jsx($,{children:a(e=>e.interview_info)}),s.jsxs("div",{className:"collapse collapse-arrow bg-base-100 shadow mb-3",children:[s.jsx("input",{type:"checkbox"}),s.jsxs("div",{className:"collapse-title text-lg font-semibold text-center w-full",children:[a(e=>e.os)," / ",a(e=>e.process)," / MQTT"]}),s.jsx("div",{className:"collapse-content",children:s.jsxs("div",{className:"flex flex-col gap-3 items-center mb-2 w-full",children:[s.jsxs("p",{className:"text-sm",title:v.toLocaleString(),children:[a(e=>e.last_check),": ",s.jsx(u,{datetime:v,locale:m.language})]}),s.jsxs("div",{className:"stats stats-vertical lg:stats-horizontal shadow",children:[s.jsx("div",{className:"stat place-items-center",children:s.jsx("div",{className:"stat-value text-xl",children:a(e=>e.os)})}),t.os.load_average.some(e=>e!==0)&&s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.load_average)}),s.jsx("div",{className:"stat-value text-lg",children:t.os.load_average.join(", ")}),s.jsx("div",{className:"stat-desc",children:s.jsx("a",{href:F,target:"_blank",rel:"noreferrer",className:"link link-hover",children:"1min, 5min, 15min"})})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.ram_usage)}),s.jsxs("div",{className:"stat-value text-lg",children:[t.os.memory_percent," %"]}),s.jsxs("div",{className:"stat-desc",children:[t.os.memory_used_mb," MB"]})]})]}),s.jsxs("div",{className:"stats stats-vertical lg:stats-horizontal shadow",children:[s.jsx("div",{className:"stat place-items-center",children:s.jsx("div",{className:"stat-value text-xl",children:a(e=>e.process)})}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.uptime)}),s.jsx("div",{className:"stat-value text-lg",children:s.jsx(V,{durationSec:t.process.uptime_sec})})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.ram_usage)}),s.jsxs("div",{className:"stat-value text-lg",children:[t.process.memory_percent," %"]}),s.jsxs("div",{className:"stat-desc",children:[t.process.memory_used_mb," MB"]})]})]}),s.jsxs("div",{className:"stats stats-vertical lg:stats-horizontal shadow",children:[s.jsx("div",{className:"stat place-items-center",children:s.jsx("div",{className:"stat-value text-xl",children:a(e=>e.mqtt,{ns:"settings"})})}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-value text-lg",children:s.jsx(d,{icon:T,className:t.mqtt.connected?"text-success":"text-error"})}),s.jsxs("div",{className:"stat-desc",children:[a(e=>e.queued),": ",t.mqtt.queued]})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.published)}),s.jsx("div",{className:"stat-value text-lg",children:t.mqtt.published})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.received)}),s.jsx("div",{className:"stat-value text-lg",children:t.mqtt.received})]})]})]})})]}),s.jsxs("div",{className:"collapse collapse-arrow bg-base-100 shadow mb-3",children:[s.jsx("input",{type:"checkbox"}),s.jsx("div",{className:"collapse-title text-lg font-semibold text-center w-full",children:"WebSocket"}),s.jsx("div",{className:"collapse-content",children:s.jsxs("div",{className:"flex flex-col gap-3 items-center mb-2 w-full",children:[s.jsxs("div",{className:"stats stats-vertical lg:stats-horizontal shadow",children:[M&&s.jsx("div",{className:"stat place-items-center",children:s.jsx("div",{className:"stat-value text-lg",children:s.jsx(D,{idx:c,alwaysShowName:!0})})}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-value text-lg",children:s.jsx(d,{icon:R,className:x?.[1]})}),s.jsx("div",{className:"stat-desc",children:x?.[0]})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.reconnects)}),s.jsx("div",{className:"stat-value text-lg",children:i.reconnects})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.pending_requests)}),s.jsx("div",{className:"stat-value text-lg",children:i.pendingRequests})]})]}),s.jsxs("div",{className:"stats stats-vertical lg:stats-horizontal shadow",children:[s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.last_message)}),s.jsx("div",{className:"stat-value text-lg",children:s.jsx(u,{datetime:g,locale:m.language})}),s.jsx("div",{className:"stat-desc",children:g.toLocaleString()})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.sent)}),s.jsx("div",{className:"stat-value text-lg",children:i.messagesSent}),s.jsxs("div",{className:"stat-desc",children:[Math.round(i.bytesSent/1024/1024*100)/100," MB"]})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.received)}),s.jsx("div",{className:"stat-value text-lg",children:i.messagesReceived}),s.jsxs("div",{className:"stat-desc",children:[Math.round(i.bytesReceived/1024/1024*100)/100," MB"]})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsxs("div",{className:"stat-title",children:[a(e=>e.received),": ",a(e=>e.bridge,{ns:"settings"})]}),s.jsx("div",{className:"stat-value text-lg",children:i.messagesBridge})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsxs("div",{className:"stat-title",children:[a(e=>e.received),": ",a(e=>e.devices,{ns:"common"})]}),s.jsx("div",{className:"stat-value text-lg",children:i.messagesDevice})]})]})]})})]}),s.jsx("div",{className:"mb-3",children:s.jsx(A,{...h})}),s.jsx("div",{className:"mb-5",children:s.jsx(L,{id:"health-devices",...h})})]})}export{K as default};
1
+ import{u as k,a as r,C as n,r as N,j as s,t as p,L as _,F as d,a0 as y,de as F,df as T,M,S as D,dg as z,q as R}from"./index-O2DLxYbj.js";import{u as q,T as A}from"./useTable-CC5yv3vQ.js";import{D as C}from"./DeviceImage-C6iSUjiJ.js";import{I as $}from"./InfoAlert-BEMI4UFc.js";import{T as L}from"./Table-DQSQ_sYq.js";import{D as V}from"./Duration-CzwYBX29.js";import{T as u}from"./TimeAgo-BBbvibZK.js";import"./envs-CSqIi4cL.js";import"./DebouncedInput-B_mSPoL2.js";import"./index-BWJZAMXy.js";function K({sourceIdx:c}){const{t:a,i18n:m}=k(["health","settings","common","zigbee"]),t=r(n(e=>e.bridgeHealth[c])),o=r(n(e=>e.devices[c])),i=r(n(e=>e.webSocketMetrics[c])),f=r(n(e=>e.readyStates[c])),x=z[f],b=N.useMemo(()=>{const e=[];if(t)for(const l in t.devices){const j=o.find(S=>S.ieee_address===l);j&&e.push({device:j,health:t.devices[l]})}return e},[t,o]),w=N.useMemo(()=>[{id:"friendly_name",minSize:175,header:a(e=>e.friendly_name,{ns:"common"}),accessorFn:({device:e})=>`${e.friendly_name} ${e.description??""}`,cell:({row:{original:{device:e}}})=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"avatar",children:s.jsx("div",{className:"h-11 w-11",style:{overflow:"visible"},children:s.jsx(C,{device:e,disabled:!1})})}),s.jsxs("div",{className:"flex flex-col min-w-0",children:[s.jsx(_,{to:`/device/${c}/${e.ieee_address}/info`,className:"link link-hover truncate",children:e.friendly_name}),e.friendly_name!==e.ieee_address?e.ieee_address:null]})]}),sortingFn:(e,l)=>e.original.device.friendly_name.localeCompare(l.original.device.friendly_name),filterFn:"includesString",meta:{filterVariant:"text",textFaceted:!0}},{id:"ieee_address",minSize:175,header:a(e=>e.ieee_address,{ns:"zigbee"}),accessorFn:({device:e})=>`${e.ieee_address} ${p(e.network_address,4)} ${e.network_address}`,cell:({row:{original:{device:e}}})=>s.jsxs(s.Fragment,{children:[s.jsx("div",{children:s.jsx(_,{to:`/device/${c}/${e.ieee_address}/info`,className:"link link-hover",children:e.ieee_address})}),s.jsxs("div",{className:"flex flex-row gap-1",children:[s.jsx("span",{className:"badge badge-ghost badge-sm cursor-default",title:a(l=>l.network_address_hex,{ns:"zigbee"}),children:p(e.network_address,4)}),s.jsx("span",{className:"badge badge-ghost badge-sm cursor-default",title:a(l=>l.network_address_dec,{ns:"zigbee"}),children:e.network_address})]})]}),sortingFn:(e,l)=>e.original.device.ieee_address.localeCompare(l.original.device.ieee_address),filterFn:"includesString",meta:{filterVariant:"text"}},{id:"messages",header:a(e=>e.messages),accessorFn:({health:e})=>e.messages,filterFn:"inNumberRange",meta:{filterVariant:"range"}},{id:"messages_per_sec",header:a(e=>e.messages_per_sec),accessorFn:({health:e})=>e.messages_per_sec,cell:({row:{original:{health:e}}})=>s.jsx("span",{className:e.messages_per_sec>1?e.messages_per_sec>3?"text-error":"text-warning":e.messages_per_sec<.2?"text-success":"",children:e.messages_per_sec<=.001?a(l=>l.very_low):e.messages_per_sec}),filterFn:"inNumberRange",meta:{filterVariant:"range"}},{id:"leave_count",header:a(e=>e.leave_count),accessorFn:({health:e})=>e.leave_count,filterFn:"inNumberRange",meta:{filterVariant:"range"}},{id:"network_address_changes",header:a(e=>e.network_address_changes),accessorFn:({health:e})=>e.network_address_changes,filterFn:"inNumberRange",meta:{filterVariant:"range"}}],[c,a]),h=q({id:"health-devices",columns:w,data:b,sorting:[{id:"friendly_name",desc:!1}]});if(t.response_time===0)return s.jsxs("div",{className:"alert alert-info alert-soft",role:"alert",children:[s.jsx(d,{icon:y,size:"2xl"}),a(e=>e.awaiting_next_check)]});const v=new Date(t.response_time),g=new Date(i.lastMessageTs);return s.jsxs(s.Fragment,{children:[s.jsx($,{children:a(e=>e.interview_info)}),s.jsxs("div",{className:"collapse collapse-arrow bg-base-100 shadow mb-3",children:[s.jsx("input",{type:"checkbox"}),s.jsxs("div",{className:"collapse-title text-lg font-semibold text-center w-full",children:[a(e=>e.os)," / ",a(e=>e.process)," / MQTT"]}),s.jsx("div",{className:"collapse-content",children:s.jsxs("div",{className:"flex flex-col gap-3 items-center mb-2 w-full",children:[s.jsxs("p",{className:"text-sm",title:v.toLocaleString(),children:[a(e=>e.last_check),": ",s.jsx(u,{datetime:v,locale:m.language})]}),s.jsxs("div",{className:"stats stats-vertical lg:stats-horizontal shadow",children:[s.jsx("div",{className:"stat place-items-center",children:s.jsx("div",{className:"stat-value text-xl",children:a(e=>e.os)})}),t.os.load_average.some(e=>e!==0)&&s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.load_average)}),s.jsx("div",{className:"stat-value text-lg",children:t.os.load_average.join(", ")}),s.jsx("div",{className:"stat-desc",children:s.jsx("a",{href:F,target:"_blank",rel:"noreferrer",className:"link link-hover",children:"1min, 5min, 15min"})})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.ram_usage)}),s.jsxs("div",{className:"stat-value text-lg",children:[t.os.memory_percent," %"]}),s.jsxs("div",{className:"stat-desc",children:[t.os.memory_used_mb," MB"]})]})]}),s.jsxs("div",{className:"stats stats-vertical lg:stats-horizontal shadow",children:[s.jsx("div",{className:"stat place-items-center",children:s.jsx("div",{className:"stat-value text-xl",children:a(e=>e.process)})}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.uptime)}),s.jsx("div",{className:"stat-value text-lg",children:s.jsx(V,{durationSec:t.process.uptime_sec})})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.ram_usage)}),s.jsxs("div",{className:"stat-value text-lg",children:[t.process.memory_percent," %"]}),s.jsxs("div",{className:"stat-desc",children:[t.process.memory_used_mb," MB"]})]})]}),s.jsxs("div",{className:"stats stats-vertical lg:stats-horizontal shadow",children:[s.jsx("div",{className:"stat place-items-center",children:s.jsx("div",{className:"stat-value text-xl",children:a(e=>e.mqtt,{ns:"settings"})})}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-value text-lg",children:s.jsx(d,{icon:T,className:t.mqtt.connected?"text-success":"text-error"})}),s.jsxs("div",{className:"stat-desc",children:[a(e=>e.queued),": ",t.mqtt.queued]})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.published)}),s.jsx("div",{className:"stat-value text-lg",children:t.mqtt.published})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.received)}),s.jsx("div",{className:"stat-value text-lg",children:t.mqtt.received})]})]})]})})]}),s.jsxs("div",{className:"collapse collapse-arrow bg-base-100 shadow mb-3",children:[s.jsx("input",{type:"checkbox"}),s.jsx("div",{className:"collapse-title text-lg font-semibold text-center w-full",children:"WebSocket"}),s.jsx("div",{className:"collapse-content",children:s.jsxs("div",{className:"flex flex-col gap-3 items-center mb-2 w-full",children:[s.jsxs("div",{className:"stats stats-vertical lg:stats-horizontal shadow",children:[M&&s.jsx("div",{className:"stat place-items-center",children:s.jsx("div",{className:"stat-value text-lg",children:s.jsx(D,{idx:c,alwaysShowName:!0})})}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-value text-lg",children:s.jsx(d,{icon:R,className:x?.[1]})}),s.jsx("div",{className:"stat-desc",children:x?.[0]})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.reconnects)}),s.jsx("div",{className:"stat-value text-lg",children:i.reconnects})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.pending_requests)}),s.jsx("div",{className:"stat-value text-lg",children:i.pendingRequests})]})]}),s.jsxs("div",{className:"stats stats-vertical lg:stats-horizontal shadow",children:[s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.last_message)}),s.jsx("div",{className:"stat-value text-lg",children:s.jsx(u,{datetime:g,locale:m.language})}),s.jsx("div",{className:"stat-desc",children:g.toLocaleString()})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.sent)}),s.jsx("div",{className:"stat-value text-lg",children:i.messagesSent}),s.jsxs("div",{className:"stat-desc",children:[Math.round(i.bytesSent/1024/1024*100)/100," MB"]})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsx("div",{className:"stat-title",children:a(e=>e.received)}),s.jsx("div",{className:"stat-value text-lg",children:i.messagesReceived}),s.jsxs("div",{className:"stat-desc",children:[Math.round(i.bytesReceived/1024/1024*100)/100," MB"]})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsxs("div",{className:"stat-title",children:[a(e=>e.received),": ",a(e=>e.bridge,{ns:"settings"})]}),s.jsx("div",{className:"stat-value text-lg",children:i.messagesBridge})]}),s.jsxs("div",{className:"stat place-items-center",children:[s.jsxs("div",{className:"stat-title",children:[a(e=>e.received),": ",a(e=>e.devices,{ns:"common"})]}),s.jsx("div",{className:"stat-value text-lg",children:i.messagesDevice})]})]})]})})]}),s.jsx("div",{className:"mb-3",children:s.jsx(A,{...h})}),s.jsx("div",{className:"mb-5",children:s.jsx(L,{id:"health-devices",...h})})]})}export{K as default};
@@ -1 +1 @@
1
- import{j as e,r as d,u as S,L as $,S as W,s as te,B as N,a as E,g as le,t as ne,F as g,f as re,M as oe,b as ce,c as Z,d as de,e as me,h as xe,i as fe,k as be,l as k,H as z,m as Q,n as ee,A as se,R as he,N as pe,o as H}from"./index-C4AO15gr.js";import{u as ue,b as je}from"./useColumnCount-DM6Ez2tO.js";import{L as ve}from"./LastSeen-DF8tUMAo.js";import{L as Ne}from"./Lqi-CB7A3dn1.js";import{P as ye}from"./PowerSource-D9Tnu98A.js";import{D as ge}from"./DeviceImage-B6w8VrRf.js";import{u as we,a as _e,b as ke,c as Ee,F as Ce,d as Se,o as $e,e as Ae,s as Te,f as Re}from"./floating-ui.react-BjV3LBOY.js";import Pe from"./Exposes-g-STiMw5.js";import"./envs-CSqIi4cL.js";import"./TimeAgo-e8nXr4AB.js";import"./index-DFi8ba4s.js";import"./DisplayValue-Cko1Z4Vm.js";import"./snakeCase-D0qZI2R1.js";import"./_createCompounder-Bb8q4vBx.js";import"./isObjectLike-DtP0zwgi.js";import"./index-CT-zuS9u.js";import"./Feature-CsgctMqC.js";import"./isObject--vsEa_js.js";const De=d.memo(({sourceIdx:a,device:l,deviceState:n,deviceAvailability:m,lastSeenConfig:o,onClick:r})=>{const{t:p}=S("zigbee"),c=l.description??l.definition?.description;return e.jsxs("article",{className:`mb-2 card bg-base-200 rounded-box shadow-md ${m==="disabled"?"card-dash border-warning/40":m==="offline"?"card-border border-error/50":"card-border border-base-300"} cursor-pointer will-change-transform transition-transform hover:-translate-y-1`,onClick:h=>{h.target.nodeName!=="A"&&r(a,l,h.currentTarget)},children:[e.jsx("div",{className:"card-body p-1",children:e.jsxs("div",{className:"flex flex-row items-center gap-3 w-full",children:[e.jsx("div",{className:"flex-none h-11 w-11 overflow-visible",children:e.jsx(ge,{disabled:l.disabled,device:l,otaState:n.update?.state})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate",children:e.jsx($,{to:`/device/${a}/${l.ieee_address}/info`,className:"truncate link link-hover font-semibold",children:l.friendly_name})}),c&&e.jsx("div",{className:"text-xs opacity-50 truncate",title:c,children:c}),e.jsx("div",{className:"text-xs opacity-50",children:e.jsx(ve,{lastSeen:n.last_seen,config:o})}),e.jsx("span",{className:"absolute top-2 right-2",children:e.jsx(W,{idx:a,autoHide:!0})})]})]})}),e.jsxs("div",{className:"flex flex-row flex-wrap gap-1 mx-2 mb-2 justify-end items-center",children:[e.jsx("span",{className:"badge badge-soft badge-ghost cursor-default tooltip","data-tip":p(h=>h.lqi),children:e.jsx(Ne,{value:n.linkquality})}),e.jsx("span",{className:"badge badge-soft badge-ghost cursor-default tooltip","data-tip":p(h=>h.power),children:e.jsx(ye,{device:l,batteryPercent:n.battery,batteryState:n.battery_state,batteryLow:n.battery_low,showLevel:!0})})]})]})}),Le=a=>a?.data?e.jsx(De,{...a.data}):null,ze=d.memo(({sourceIdx:a,group:l})=>{const{t:n}=S("zigbee"),m=d.useCallback(async o=>await te(a,`${l.friendly_name}/set`,{scene_recall:o}),[a,l.friendly_name]);return e.jsx("article",{className:"card bg-base-200 rounded-box shadow-md",children:e.jsxs("div",{className:"card-body p-3",children:[e.jsx("div",{className:"flex flex-row items-center gap-3 w-full",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"truncate",children:[n(o=>o.scenes),":"," ",e.jsx($,{to:`/group/${a}/${l.id}/devices`,className:"link link-hover font-semibold",children:l.friendly_name})]}),e.jsx("span",{className:"absolute top-2 right-2",children:e.jsx(W,{idx:a,autoHide:!0})})]})}),e.jsx("div",{className:"flex flex-row flex-wrap gap-1 justify-around items-center",children:l.scenes.map(o=>e.jsx(N,{className:"btn btn-outline btn-primary btn-sm",onClick:m,item:o.id,children:o.name},o.id))})]})})}),He=d.memo(({devices:a,maxRows:l})=>{const{t:n}=S(["common","availability"]),m=E(r=>r.recentActivityFeed),o=d.useMemo(()=>[...new Array(Math.max(0,l-m.length))],[l,m.length]);return e.jsx("section",{className:"card bg-base-100",children:e.jsxs("div",{className:"card-body py-3",children:[e.jsx("h2",{className:"card-title",children:n(r=>r.recent_activity)}),e.jsxs("ul",{className:`grid grid-rows-${l} gap-1 w-full`,children:[m.map(r=>{let p=r.ieeeAddress;return p||(p=a[r.sourceIdx].find(h=>h.friendly_name===r.friendlyName)?.ieee_address),e.jsxs("li",{className:"flex flex-row gap-1 items-center w-full px-1 rounded-field hover:bg-base-200",children:[e.jsxs("div",{className:"text-xs font-semibold opacity-60 min-w-0",children:[e.jsx(W,{idx:r.sourceIdx,autoHide:!0,namePostfix:" –",className:"me-1"}),p?e.jsx($,{to:`/device/${r.sourceIdx}/${p}/info`,className:"link link-hover font-semibold truncate",children:r.friendlyName}):e.jsx("span",{className:"font-semibold truncate",children:r.friendlyName})]}),e.jsx("div",{className:"min-w-0 grow",children:e.jsxs("p",{className:"text-xs text-base-content/60 truncate",children:["— ",r.activity]})}),e.jsx("div",{children:e.jsx("p",{className:"text-xs text-base-content/60",children:r.time})})]},`${r.friendlyName}-${r.sourceIdx}-${r.activity}`)}),o.map((r,p)=>e.jsx("li",{className:"flex flex-row gap-3 items-center",children:e.jsx("div",{className:"w-full font-semibold text-xs text-base-content/0",children:"-"})},`placeholder-${p}`))]})]})})}),Ie=d.memo(({selection:{anchor:a,sourceIdx:l,device:n},onClose:m})=>{const{t:o}=S("zigbee"),r=d.useRef(null),{refs:p,floatingStyles:c,context:h}=we({elements:{reference:a},open:!0,onOpenChange:b=>{b||m()},middleware:[$e(4),Ae({padding:16,crossAxis:!0}),Te({padding:16,crossAxis:!0}),Re({element:r})]}),u=_e(h),f=ke(h,{outsidePress:!0,escapeKey:!0}),{getFloatingProps:i}=Ee([u,f]),j=d.useMemo(()=>le(n),[n]),s=d.useCallback(async b=>await te(l,`${n.friendly_name}/set`,{scene_recall:b}),[l,n.friendly_name]),A=n.description??n.definition?.description;return e.jsx(Ce,{children:e.jsxs("aside",{ref:p.setFloating,style:c,...i({className:"card bg-base-200 shadow-lg border border-base-300 w-[min(32rem,calc(100vw-2.5rem))] max-h-[80vh] z-11"}),children:[e.jsxs("div",{className:"card-body p-3 gap-2 w-full h-full overflow-hidden",children:[e.jsxs("header",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx($,{to:`/device/${l}/${n.ieee_address}/info`,className:"truncate link link-hover font-semibold text-lg",children:n.friendly_name}),e.jsx("p",{className:"truncate text-sm opacity-60",children:A}),e.jsx("span",{className:"badge cursor-default tooltip tooltip-bottom","data-tip":o(b=>b.ieee_address),children:n.ieee_address}),e.jsx("span",{className:"badge cursor-default tooltip tooltip-bottom","data-tip":o(b=>b.network_address_hex),children:ne(n.network_address,4)}),e.jsx("span",{className:"badge cursor-default tooltip tooltip-bottom","data-tip":o(b=>b.network_address_dec),children:n.network_address})]}),e.jsx(N,{onClick:m,className:"btn btn-ghost btn-sm",children:e.jsx(g,{icon:re})})]}),j.length>0&&e.jsxs("div",{className:"flex flex-row flex-wrap items-center gap-2",children:[o(b=>b.scenes),":",j.map(b=>e.jsx(N,{className:"btn btn-outline btn-primary btn-sm",onClick:s,item:b.id,children:b.name},b.id))]}),e.jsx("div",{className:"w-full h-full overflow-y-auto rounded-box",style:{scrollbarWidth:"thin"},children:e.jsx(Pe,{sourceIdx:l,device:n})})]}),e.jsx(Se,{ref:r,context:h,className:"fill-base-200 [&>path:first-of-type]:stroke-base-300 [&>path:last-of-type]:stroke-base-300"})]})})});var y=(a=>(a[a.Availability=0]="Availability",a[a.Type=1]="Type",a[a.Lqi=2]="Lqi",a))(y||{});const I=[y.Availability,"offline"],M=[y.Type,"Router"],O=[y.Type,"EndDevice"],G=[y.Type,"GreenPower"],Y=[y.Lqi,50],Me=d.memo(({totalDevices:a,onlineDevices:l,disabledDevices:n,totalInstances:m,onlineInstances:o,routers:r,endDevices:p,gpDevices:c,lowLqiDevices:h,setQuickFilter:u,quickFilter:f})=>{const{t:i}=S(["common","availability","zigbee","settings"]),j=d.useCallback(s=>{s[0]===y.Type?u(f?.[0]===s[0]&&f?.[1]===s[1]?null:s):u(f?.[0]===s[0]?null:s)},[u,f]);return e.jsx("section",{className:"card bg-base-100 w-full",children:e.jsxs("div",{className:"card-body py-3",children:[e.jsx("h2",{className:"card-title",children:i(s=>s.overview)}),e.jsxs("div",{className:"flex flex-row flex-wrap justify-center gap-y-3",children:[oe?e.jsxs("div",{className:"flex flex-row w-48 px-3 py-1 gap-4 justify-center justify-center border-dashed border-e border-current/25 last:border-e-0",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-base-content/70",children:i(s=>s.instances)}),e.jsxs("div",{className:`font-semibold text-xl ${o===m?"":"text-error"}`,children:[o," / ",m]}),m>0&&e.jsxs("div",{className:"text-xs text-base-content/50",children:[Math.round(o/m*100),"% ",i(s=>s.online,{ns:"availability"})]})]}),e.jsx("div",{className:"self-center",children:e.jsx($,{to:"/settings/0/health",className:"link text-primary tooltip tooltip-bottom","data-tip":i(s=>s.health,{ns:"settings"}),children:e.jsx(g,{icon:ce,size:"xl"})})})]}):null,e.jsxs("div",{className:"flex flex-row w-48 px-3 py-1 gap-4 justify-center border-dashed border-e border-current/25 last:border-e-0",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-base-content/70",children:i(s=>s.devices)}),e.jsxs("div",{className:"font-semibold text-xl",children:[e.jsxs("span",{className:l===a?void 0:"text-error",children:[l," / ",a]}),n>0&&e.jsxs(e.Fragment,{children:[" ",e.jsxs("span",{className:"text-sm text-base-content/75 tooltip tooltip-bottom","data-tip":i(s=>s.disabled),children:["(+",n,")"]})]})]}),a>0&&e.jsxs("div",{className:"text-xs text-base-content/50",children:[Math.round(l/a*100),"% ",i(s=>s.online,{ns:"availability"})]})]}),e.jsx("div",{className:"self-center",children:e.jsx(N,{className:`link tooltip tooltip-bottom ${f?.[0]===I[0]?"text-accent":"text-primary"}`,"data-tip":`${i(s=>s.quick_search)}: ${i(s=>s.offline,{ns:"availability"})}`,onClick:j,item:I,children:e.jsxs("span",{className:"fa-layers fa-xl",children:[e.jsx(g,{icon:Z,className:`${f?.[0]===I[0]?"text-accent/60":"text-primary/60"}`}),e.jsx(g,{icon:de,transform:"shrink-5 down-2 right-1"})]})})})]}),e.jsxs("div",{className:"flex flex-row w-48 px-3 py-1 gap-4 justify-center border-dashed border-e border-current/25 last:border-e-0",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-base-content/70",children:i(s=>s.Router,{ns:"zigbee"})}),e.jsx("div",{className:"font-semibold text-xl",children:r})]}),e.jsx("div",{className:"self-center",children:e.jsx(N,{className:`link tooltip tooltip-bottom ${f?.[0]===M[0]&&f[1]===M[1]?"text-accent":"text-primary"}`,"data-tip":`${i(s=>s.quick_search)}: ${i(s=>s.Router,{ns:"zigbee"})}`,onClick:j,item:M,children:e.jsx(g,{icon:me,size:"xl"})})})]}),e.jsxs("div",{className:"flex flex-row w-48 px-3 py-1 gap-4 justify-center border-dashed border-e border-current/25 last:border-e-0",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-base-content/70",children:i(s=>s.EndDevice,{ns:"zigbee"})}),e.jsx("div",{className:"font-semibold text-xl",children:p})]}),e.jsx("div",{className:"self-center",children:e.jsx(N,{className:`link tooltip tooltip-bottom ${f?.[0]===O[0]&&f[1]===O[1]?"text-accent":"text-primary"}`,"data-tip":`${i(s=>s.quick_search)}: ${i(s=>s.EndDevice,{ns:"zigbee"})}`,onClick:j,item:O,children:e.jsx(g,{icon:xe,size:"xl"})})})]}),c>0&&e.jsxs("div",{className:"flex flex-row w-48 px-3 py-1 gap-4 justify-center border-dashed border-e border-current/25 last:border-e-0",children:[e.jsx("div",{children:e.jsxs("div",{className:"text-sm text-base-content/70",children:[i(s=>s.Router,{ns:"zigbee"})," - ",i(s=>s.GreenPower,{ns:"zigbee"})]})}),e.jsx("div",{className:"font-semibold text-xl",children:c}),e.jsx("div",{className:"self-center",children:e.jsx(N,{className:`link tooltip tooltip-bottom ${f?.[0]===G[0]&&f[1]===G[1]?"text-accent":"text-primary"}`,"data-tip":`${i(s=>s.quick_search)}: ${i(s=>s.GreenPower,{ns:"zigbee"})}`,onClick:j,item:G,children:e.jsx(g,{icon:fe,size:"xl"})})})]}),h>0&&e.jsxs("div",{className:"flex flex-row w-48 px-3 py-1 gap-4 justify-center border-dashed border-e border-current/25 last:border-e-0",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-base-content/70",children:i(s=>s.low_lqi,{ns:"zigbee"})}),e.jsx("div",{className:"font-semibold text-xl text-error",children:h}),e.jsx("div",{className:"text-xs text-base-content/50",children:"< 50"})]}),e.jsx("div",{className:"self-center",children:e.jsx(N,{className:`link tooltip tooltip-bottom ${f?.[0]===Y[0]?"text-accent":"text-primary"}`,"data-tip":`${i(s=>s.quick_search)}: ${i(s=>s.low_lqi,{ns:"zigbee"})}`,onClick:j,item:Y,children:e.jsxs("span",{className:"fa-layers fa-xl",children:[e.jsx(g,{icon:Z,className:`${f?.[0]===Y[0]?"text-accent/60":"text-primary/60"}`}),e.jsx(g,{icon:be,transform:"shrink-4 down-2"})]})})})]})]})]})})});function ls(){const a=E(t=>t.readyStates),l=E(t=>t.groups),n=E(t=>t.devices),m=E(t=>t.deviceStates),o=E(t=>t.availability),r=E(t=>t.bridgeInfo),p=ue(),[c,h]=d.useState(k.get(z,null)),[u,f]=d.useState(k.get(Q,!0)),[i,j]=d.useState(k.get(ee,!0)),[s,A]=d.useState(void 0);d.useEffect(()=>{c==null?k.remove(z):k.set(z,c)},[c]),d.useEffect(()=>{k.set(Q,u)},[u]),d.useEffect(()=>{k.set(ee,i)},[i]);const b=d.useCallback((t,v,w)=>{A(T=>T?.device.ieee_address===v.ieee_address?void 0:{anchor:w,sourceIdx:t,device:v})},[]),R=d.useMemo(()=>{const t=[];let v=0,w=0,T=0,B=0,K=0,U=0,V=0,F=0,J=0;for(let x=0;x<se.length;x++){B+=1,a[x]===WebSocket.OPEN&&(K+=1);const P=r[x].config.advanced.last_seen,ie=r[x].config.availability.enabled;for(const _ of n[x]){if(_.type==="Coordinator")continue;switch(_.type){case"Router":U+=1;break;case"EndDevice":V+=1;break;case"GreenPower":F+=1;break}const D=m[x][_.friendly_name]??{};let L="disabled";if(_.disabled)T+=1;else{v+=1;const X=r[x].config.devices[_.ieee_address]?.availability;L=(X!=null?!!X:void 0)??ie?o[x][_.friendly_name]?.state??"offline":"disabled",L==="online"&&(w+=1)}typeof D.linkquality=="number"&&D.linkquality<50&&(J+=1),t.push({sourceIdx:x,device:_,deviceState:D,deviceAvailability:L,lastSeenConfig:P,onClick:b})}}t.sort((x,P)=>x.device.friendly_name.localeCompare(P.device.friendly_name));let C=[];if(c!=null)switch(c[0]){case y.Availability:{C=t.filter(x=>x.deviceAvailability===c[1]);break}case y.Type:{C=t.filter(x=>x.device.type===c[1]);break}case y.Lqi:{C=t.filter(x=>typeof x.deviceState.linkquality=="number"&&x.deviceState.linkquality<c[1]);break}}else C=t;return{counters:{totalDevices:v,onlineDevices:w,disabledDevices:T,totalInstances:B,onlineInstances:K,routers:U,endDevices:V,gpDevices:F,lowLqiDevices:J},deviceData:t,filteredDeviceData:C}},[n,m,r,o,a,c,b]),q=d.useMemo(()=>{const t=[];if(!i)return t;for(let v=0;v<se.length;v++)for(const w of l[v])w.scenes.length!==0&&t.push({sourceIdx:v,group:w});return t},[i,l]),ae=Math.min(he,R.counters.totalDevices);return e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsxs("span",{className:"text-sm",children:[H(t=>t.show),": "]}),e.jsx(N,{className:`btn btn-outline btn-sm ${u?"btn-active":""}`,onClick:f,item:!u,children:H(t=>t.recent_activity)}),e.jsx(N,{className:`btn btn-outline btn-sm ${i?"btn-active":""}`,onClick:j,item:!i,children:H(t=>t.group_scenes)})]}),e.jsxs("div",{className:"flex flex-col mb-5",children:[e.jsx(Me,{...R.counters,setQuickFilter:h,quickFilter:c}),u&&e.jsx(He,{devices:n,maxRows:ae}),e.jsx("div",{className:"divider m-0 mb-1"}),q.length>0&&e.jsx("section",{className:"mb-4 flex flex-row flex-wrap justify-center gap-2",children:q.map(t=>e.jsx(ze,{...t},t.group.id))}),e.jsx(je,{useWindowScroll:!0,columnCount:p,data:R.filteredDeviceData,ItemContent:Le,className:"gap-2 select-none"},`device-tiles-${c?.[0]}-${c?.[1]}`),s&&e.jsx(Ie,{selection:s,onClose:()=>A(void 0)})]})]})}export{ls as default};
1
+ import{j as e,r as d,u as S,L as $,S as W,s as te,B as N,a as E,g as le,t as ne,F as g,f as re,M as oe,b as ce,c as Z,d as de,e as me,h as xe,i as fe,k as be,l as k,H as z,m as Q,n as ee,A as se,R as he,N as pe,o as H}from"./index-O2DLxYbj.js";import{u as ue,b as je}from"./useColumnCount-CDIFEtdP.js";import{L as ve}from"./LastSeen-DA4kaWWb.js";import{L as Ne}from"./Lqi-BLFaxsM9.js";import{P as ye}from"./PowerSource-D71Ibdxv.js";import{D as ge}from"./DeviceImage-C6iSUjiJ.js";import{u as we,a as _e,b as ke,c as Ee,F as Ce,d as Se,o as $e,e as Ae,s as Te,f as Re}from"./floating-ui.react-MIvSYIT3.js";import Pe from"./Exposes-DfrJAUra.js";import"./envs-CSqIi4cL.js";import"./TimeAgo-BBbvibZK.js";import"./index-BnCNGENq.js";import"./DisplayValue-BZ-eaAKu.js";import"./snakeCase-DDe65ywx.js";import"./_createCompounder-DvelL9we.js";import"./isObjectLike-D2GWafVk.js";import"./index-BWJZAMXy.js";import"./Feature-BJ8zY1Ga.js";import"./isObject--vsEa_js.js";const De=d.memo(({sourceIdx:a,device:l,deviceState:n,deviceAvailability:m,lastSeenConfig:o,onClick:r})=>{const{t:p}=S("zigbee"),c=l.description??l.definition?.description;return e.jsxs("article",{className:`mb-2 card bg-base-200 rounded-box shadow-md ${m==="disabled"?"card-dash border-warning/40":m==="offline"?"card-border border-error/50":"card-border border-base-300"} cursor-pointer will-change-transform transition-transform hover:-translate-y-1`,onClick:h=>{h.target.nodeName!=="A"&&r(a,l,h.currentTarget)},children:[e.jsx("div",{className:"card-body p-1",children:e.jsxs("div",{className:"flex flex-row items-center gap-3 w-full",children:[e.jsx("div",{className:"flex-none h-11 w-11 overflow-visible",children:e.jsx(ge,{disabled:l.disabled,device:l,otaState:n.update?.state})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate",children:e.jsx($,{to:`/device/${a}/${l.ieee_address}/info`,className:"truncate link link-hover font-semibold",children:l.friendly_name})}),c&&e.jsx("div",{className:"text-xs opacity-50 truncate",title:c,children:c}),e.jsx("div",{className:"text-xs opacity-50",children:e.jsx(ve,{lastSeen:n.last_seen,config:o})}),e.jsx("span",{className:"absolute top-2 right-2",children:e.jsx(W,{idx:a,autoHide:!0})})]})]})}),e.jsxs("div",{className:"flex flex-row flex-wrap gap-1 mx-2 mb-2 justify-end items-center",children:[e.jsx("span",{className:"badge badge-soft badge-ghost cursor-default tooltip","data-tip":p(h=>h.lqi),children:e.jsx(Ne,{value:n.linkquality})}),e.jsx("span",{className:"badge badge-soft badge-ghost cursor-default tooltip","data-tip":p(h=>h.power),children:e.jsx(ye,{device:l,batteryPercent:n.battery,batteryState:n.battery_state,batteryLow:n.battery_low,showLevel:!0})})]})]})}),Le=a=>a?.data?e.jsx(De,{...a.data}):null,ze=d.memo(({sourceIdx:a,group:l})=>{const{t:n}=S("zigbee"),m=d.useCallback(async o=>await te(a,`${l.friendly_name}/set`,{scene_recall:o}),[a,l.friendly_name]);return e.jsx("article",{className:"card bg-base-200 rounded-box shadow-md",children:e.jsxs("div",{className:"card-body p-3",children:[e.jsx("div",{className:"flex flex-row items-center gap-3 w-full",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"truncate",children:[n(o=>o.scenes),":"," ",e.jsx($,{to:`/group/${a}/${l.id}/devices`,className:"link link-hover font-semibold",children:l.friendly_name})]}),e.jsx("span",{className:"absolute top-2 right-2",children:e.jsx(W,{idx:a,autoHide:!0})})]})}),e.jsx("div",{className:"flex flex-row flex-wrap gap-1 justify-around items-center",children:l.scenes.map(o=>e.jsx(N,{className:"btn btn-outline btn-primary btn-sm",onClick:m,item:o.id,children:o.name},o.id))})]})})}),He=d.memo(({devices:a,maxRows:l})=>{const{t:n}=S(["common","availability"]),m=E(r=>r.recentActivityFeed),o=d.useMemo(()=>[...new Array(Math.max(0,l-m.length))],[l,m.length]);return e.jsx("section",{className:"card bg-base-100",children:e.jsxs("div",{className:"card-body py-3",children:[e.jsx("h2",{className:"card-title",children:n(r=>r.recent_activity)}),e.jsxs("ul",{className:`grid grid-rows-${l} gap-1 w-full`,children:[m.map(r=>{let p=r.ieeeAddress;return p||(p=a[r.sourceIdx].find(h=>h.friendly_name===r.friendlyName)?.ieee_address),e.jsxs("li",{className:"flex flex-row gap-1 items-center w-full px-1 rounded-field hover:bg-base-200",children:[e.jsxs("div",{className:"text-xs font-semibold opacity-60 min-w-0",children:[e.jsx(W,{idx:r.sourceIdx,autoHide:!0,namePostfix:" –",className:"me-1"}),p?e.jsx($,{to:`/device/${r.sourceIdx}/${p}/info`,className:"link link-hover font-semibold truncate",children:r.friendlyName}):e.jsx("span",{className:"font-semibold truncate",children:r.friendlyName})]}),e.jsx("div",{className:"min-w-0 grow",children:e.jsxs("p",{className:"text-xs text-base-content/60 truncate",children:["— ",r.activity]})}),e.jsx("div",{children:e.jsx("p",{className:"text-xs text-base-content/60",children:r.time})})]},`${r.friendlyName}-${r.sourceIdx}-${r.activity}`)}),o.map((r,p)=>e.jsx("li",{className:"flex flex-row gap-3 items-center",children:e.jsx("div",{className:"w-full font-semibold text-xs text-base-content/0",children:"-"})},`placeholder-${p}`))]})]})})}),Ie=d.memo(({selection:{anchor:a,sourceIdx:l,device:n},onClose:m})=>{const{t:o}=S("zigbee"),r=d.useRef(null),{refs:p,floatingStyles:c,context:h}=we({elements:{reference:a},open:!0,onOpenChange:b=>{b||m()},middleware:[$e(4),Ae({padding:16,crossAxis:!0}),Te({padding:16,crossAxis:!0}),Re({element:r})]}),u=_e(h),f=ke(h,{outsidePress:!0,escapeKey:!0}),{getFloatingProps:i}=Ee([u,f]),j=d.useMemo(()=>le(n),[n]),s=d.useCallback(async b=>await te(l,`${n.friendly_name}/set`,{scene_recall:b}),[l,n.friendly_name]),A=n.description??n.definition?.description;return e.jsx(Ce,{children:e.jsxs("aside",{ref:p.setFloating,style:c,...i({className:"card bg-base-200 shadow-lg border border-base-300 w-[min(32rem,calc(100vw-2.5rem))] max-h-[80vh] z-11"}),children:[e.jsxs("div",{className:"card-body p-3 gap-2 w-full h-full overflow-hidden",children:[e.jsxs("header",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx($,{to:`/device/${l}/${n.ieee_address}/info`,className:"truncate link link-hover font-semibold text-lg",children:n.friendly_name}),e.jsx("p",{className:"truncate text-sm opacity-60",children:A}),e.jsx("span",{className:"badge cursor-default tooltip tooltip-bottom","data-tip":o(b=>b.ieee_address),children:n.ieee_address}),e.jsx("span",{className:"badge cursor-default tooltip tooltip-bottom","data-tip":o(b=>b.network_address_hex),children:ne(n.network_address,4)}),e.jsx("span",{className:"badge cursor-default tooltip tooltip-bottom","data-tip":o(b=>b.network_address_dec),children:n.network_address})]}),e.jsx(N,{onClick:m,className:"btn btn-ghost btn-sm",children:e.jsx(g,{icon:re})})]}),j.length>0&&e.jsxs("div",{className:"flex flex-row flex-wrap items-center gap-2",children:[o(b=>b.scenes),":",j.map(b=>e.jsx(N,{className:"btn btn-outline btn-primary btn-sm",onClick:s,item:b.id,children:b.name},b.id))]}),e.jsx("div",{className:"w-full h-full overflow-y-auto rounded-box",style:{scrollbarWidth:"thin"},children:e.jsx(Pe,{sourceIdx:l,device:n})})]}),e.jsx(Se,{ref:r,context:h,className:"fill-base-200 [&>path:first-of-type]:stroke-base-300 [&>path:last-of-type]:stroke-base-300"})]})})});var y=(a=>(a[a.Availability=0]="Availability",a[a.Type=1]="Type",a[a.Lqi=2]="Lqi",a))(y||{});const I=[y.Availability,"offline"],M=[y.Type,"Router"],O=[y.Type,"EndDevice"],G=[y.Type,"GreenPower"],Y=[y.Lqi,50],Me=d.memo(({totalDevices:a,onlineDevices:l,disabledDevices:n,totalInstances:m,onlineInstances:o,routers:r,endDevices:p,gpDevices:c,lowLqiDevices:h,setQuickFilter:u,quickFilter:f})=>{const{t:i}=S(["common","availability","zigbee","settings"]),j=d.useCallback(s=>{s[0]===y.Type?u(f?.[0]===s[0]&&f?.[1]===s[1]?null:s):u(f?.[0]===s[0]?null:s)},[u,f]);return e.jsx("section",{className:"card bg-base-100 w-full",children:e.jsxs("div",{className:"card-body py-3",children:[e.jsx("h2",{className:"card-title",children:i(s=>s.overview)}),e.jsxs("div",{className:"flex flex-row flex-wrap justify-center gap-y-3",children:[oe?e.jsxs("div",{className:"flex flex-row w-48 px-3 py-1 gap-4 justify-center justify-center border-dashed border-e border-current/25 last:border-e-0",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-base-content/70",children:i(s=>s.instances)}),e.jsxs("div",{className:`font-semibold text-xl ${o===m?"":"text-error"}`,children:[o," / ",m]}),m>0&&e.jsxs("div",{className:"text-xs text-base-content/50",children:[Math.round(o/m*100),"% ",i(s=>s.online,{ns:"availability"})]})]}),e.jsx("div",{className:"self-center",children:e.jsx($,{to:"/settings/0/health",className:"link text-primary tooltip tooltip-bottom","data-tip":i(s=>s.health,{ns:"settings"}),children:e.jsx(g,{icon:ce,size:"xl"})})})]}):null,e.jsxs("div",{className:"flex flex-row w-48 px-3 py-1 gap-4 justify-center border-dashed border-e border-current/25 last:border-e-0",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-base-content/70",children:i(s=>s.devices)}),e.jsxs("div",{className:"font-semibold text-xl",children:[e.jsxs("span",{className:l===a?void 0:"text-error",children:[l," / ",a]}),n>0&&e.jsxs(e.Fragment,{children:[" ",e.jsxs("span",{className:"text-sm text-base-content/75 tooltip tooltip-bottom","data-tip":i(s=>s.disabled),children:["(+",n,")"]})]})]}),a>0&&e.jsxs("div",{className:"text-xs text-base-content/50",children:[Math.round(l/a*100),"% ",i(s=>s.online,{ns:"availability"})]})]}),e.jsx("div",{className:"self-center",children:e.jsx(N,{className:`link tooltip tooltip-bottom ${f?.[0]===I[0]?"text-accent":"text-primary"}`,"data-tip":`${i(s=>s.quick_search)}: ${i(s=>s.offline,{ns:"availability"})}`,onClick:j,item:I,children:e.jsxs("span",{className:"fa-layers fa-xl",children:[e.jsx(g,{icon:Z,className:`${f?.[0]===I[0]?"text-accent/60":"text-primary/60"}`}),e.jsx(g,{icon:de,transform:"shrink-5 down-2 right-1"})]})})})]}),e.jsxs("div",{className:"flex flex-row w-48 px-3 py-1 gap-4 justify-center border-dashed border-e border-current/25 last:border-e-0",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-base-content/70",children:i(s=>s.Router,{ns:"zigbee"})}),e.jsx("div",{className:"font-semibold text-xl",children:r})]}),e.jsx("div",{className:"self-center",children:e.jsx(N,{className:`link tooltip tooltip-bottom ${f?.[0]===M[0]&&f[1]===M[1]?"text-accent":"text-primary"}`,"data-tip":`${i(s=>s.quick_search)}: ${i(s=>s.Router,{ns:"zigbee"})}`,onClick:j,item:M,children:e.jsx(g,{icon:me,size:"xl"})})})]}),e.jsxs("div",{className:"flex flex-row w-48 px-3 py-1 gap-4 justify-center border-dashed border-e border-current/25 last:border-e-0",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-base-content/70",children:i(s=>s.EndDevice,{ns:"zigbee"})}),e.jsx("div",{className:"font-semibold text-xl",children:p})]}),e.jsx("div",{className:"self-center",children:e.jsx(N,{className:`link tooltip tooltip-bottom ${f?.[0]===O[0]&&f[1]===O[1]?"text-accent":"text-primary"}`,"data-tip":`${i(s=>s.quick_search)}: ${i(s=>s.EndDevice,{ns:"zigbee"})}`,onClick:j,item:O,children:e.jsx(g,{icon:xe,size:"xl"})})})]}),c>0&&e.jsxs("div",{className:"flex flex-row w-48 px-3 py-1 gap-4 justify-center border-dashed border-e border-current/25 last:border-e-0",children:[e.jsx("div",{children:e.jsxs("div",{className:"text-sm text-base-content/70",children:[i(s=>s.Router,{ns:"zigbee"})," - ",i(s=>s.GreenPower,{ns:"zigbee"})]})}),e.jsx("div",{className:"font-semibold text-xl",children:c}),e.jsx("div",{className:"self-center",children:e.jsx(N,{className:`link tooltip tooltip-bottom ${f?.[0]===G[0]&&f[1]===G[1]?"text-accent":"text-primary"}`,"data-tip":`${i(s=>s.quick_search)}: ${i(s=>s.GreenPower,{ns:"zigbee"})}`,onClick:j,item:G,children:e.jsx(g,{icon:fe,size:"xl"})})})]}),h>0&&e.jsxs("div",{className:"flex flex-row w-48 px-3 py-1 gap-4 justify-center border-dashed border-e border-current/25 last:border-e-0",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-base-content/70",children:i(s=>s.low_lqi,{ns:"zigbee"})}),e.jsx("div",{className:"font-semibold text-xl text-error",children:h}),e.jsx("div",{className:"text-xs text-base-content/50",children:"< 50"})]}),e.jsx("div",{className:"self-center",children:e.jsx(N,{className:`link tooltip tooltip-bottom ${f?.[0]===Y[0]?"text-accent":"text-primary"}`,"data-tip":`${i(s=>s.quick_search)}: ${i(s=>s.low_lqi,{ns:"zigbee"})}`,onClick:j,item:Y,children:e.jsxs("span",{className:"fa-layers fa-xl",children:[e.jsx(g,{icon:Z,className:`${f?.[0]===Y[0]?"text-accent/60":"text-primary/60"}`}),e.jsx(g,{icon:be,transform:"shrink-4 down-2"})]})})})]})]})]})})});function ls(){const a=E(t=>t.readyStates),l=E(t=>t.groups),n=E(t=>t.devices),m=E(t=>t.deviceStates),o=E(t=>t.availability),r=E(t=>t.bridgeInfo),p=ue(),[c,h]=d.useState(k.get(z,null)),[u,f]=d.useState(k.get(Q,!0)),[i,j]=d.useState(k.get(ee,!0)),[s,A]=d.useState(void 0);d.useEffect(()=>{c==null?k.remove(z):k.set(z,c)},[c]),d.useEffect(()=>{k.set(Q,u)},[u]),d.useEffect(()=>{k.set(ee,i)},[i]);const b=d.useCallback((t,v,w)=>{A(T=>T?.device.ieee_address===v.ieee_address?void 0:{anchor:w,sourceIdx:t,device:v})},[]),R=d.useMemo(()=>{const t=[];let v=0,w=0,T=0,B=0,K=0,U=0,V=0,F=0,J=0;for(let x=0;x<se.length;x++){B+=1,a[x]===WebSocket.OPEN&&(K+=1);const P=r[x].config.advanced.last_seen,ie=r[x].config.availability.enabled;for(const _ of n[x]){if(_.type==="Coordinator")continue;switch(_.type){case"Router":U+=1;break;case"EndDevice":V+=1;break;case"GreenPower":F+=1;break}const D=m[x][_.friendly_name]??{};let L="disabled";if(_.disabled)T+=1;else{v+=1;const X=r[x].config.devices[_.ieee_address]?.availability;L=(X!=null?!!X:void 0)??ie?o[x][_.friendly_name]?.state??"offline":"disabled",L==="online"&&(w+=1)}typeof D.linkquality=="number"&&D.linkquality<50&&(J+=1),t.push({sourceIdx:x,device:_,deviceState:D,deviceAvailability:L,lastSeenConfig:P,onClick:b})}}t.sort((x,P)=>x.device.friendly_name.localeCompare(P.device.friendly_name));let C=[];if(c!=null)switch(c[0]){case y.Availability:{C=t.filter(x=>x.deviceAvailability===c[1]);break}case y.Type:{C=t.filter(x=>x.device.type===c[1]);break}case y.Lqi:{C=t.filter(x=>typeof x.deviceState.linkquality=="number"&&x.deviceState.linkquality<c[1]);break}}else C=t;return{counters:{totalDevices:v,onlineDevices:w,disabledDevices:T,totalInstances:B,onlineInstances:K,routers:U,endDevices:V,gpDevices:F,lowLqiDevices:J},deviceData:t,filteredDeviceData:C}},[n,m,r,o,a,c,b]),q=d.useMemo(()=>{const t=[];if(!i)return t;for(let v=0;v<se.length;v++)for(const w of l[v])w.scenes.length!==0&&t.push({sourceIdx:v,group:w});return t},[i,l]),ae=Math.min(he,R.counters.totalDevices);return e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsxs("span",{className:"text-sm",children:[H(t=>t.show),": "]}),e.jsx(N,{className:`btn btn-outline btn-sm ${u?"btn-active":""}`,onClick:f,item:!u,children:H(t=>t.recent_activity)}),e.jsx(N,{className:`btn btn-outline btn-sm ${i?"btn-active":""}`,onClick:j,item:!i,children:H(t=>t.group_scenes)})]}),e.jsxs("div",{className:"flex flex-col mb-5",children:[e.jsx(Me,{...R.counters,setQuickFilter:h,quickFilter:c}),u&&e.jsx(He,{devices:n,maxRows:ae}),e.jsx("div",{className:"divider m-0 mb-1"}),q.length>0&&e.jsx("section",{className:"mb-4 flex flex-row flex-wrap justify-center gap-2",children:q.map(t=>e.jsx(ze,{...t},t.group.id))}),e.jsx(je,{useWindowScroll:!0,columnCount:p,data:R.filteredDeviceData,ItemContent:Le,className:"gap-2 select-none"},`device-tiles-${c?.[0]}-${c?.[1]}`),s&&e.jsx(Ie,{selection:s,onClose:()=>A(void 0)})]})]})}export{ls as default};
@@ -1 +1 @@
1
- import{r as t,j as r}from"./index-C4AO15gr.js";function n({indeterminate:e,...o}){const c=t.useRef(null);return t.useEffect(()=>{typeof e=="boolean"&&(c.current.indeterminate=!o.checked&&e)},[c,e]),r.jsx("input",{ref:c,type:"checkbox",className:"checkbox",...o})}export{n as I};
1
+ import{r as t,j as r}from"./index-O2DLxYbj.js";function n({indeterminate:e,...o}){const c=t.useRef(null);return t.useEffect(()=>{typeof e=="boolean"&&(c.current.indeterminate=!o.checked&&e)},[c,e]),r.jsx("input",{ref:c,type:"checkbox",className:"checkbox",...o})}export{n as I};
@@ -0,0 +1 @@
1
+ import{l as t,at as e,j as o,F as a,a0 as r}from"./index-O2DLxYbj.js";function i({children:s}){return t.get(e,!1)?null:o.jsxs("div",{className:"alert alert-info alert-soft mb-2",role:"alert",children:[o.jsx(a,{icon:r,size:"2xl"}),s]})}export{i as I};
@@ -1 +1 @@
1
- import{r as i,j as s}from"./index-C4AO15gr.js";const c=i.memo(e=>{const{label:l,detail:t,onChange:a,onBlur:n,...r}=e;return s.jsxs("fieldset",{className:"fieldset",children:[l&&s.jsxs("legend",{className:"fieldset-legend",children:[l,e.required?" *":""]}),s.jsx("input",{className:`input min-w-xs${e.pattern||e.required?" validator":""}`,onChange:a,onBlur:n,...r}),t&&s.jsx("p",{className:"label",children:t})]})});export{c as I};
1
+ import{r as i,j as s}from"./index-O2DLxYbj.js";const c=i.memo(e=>{const{label:l,detail:t,onChange:a,onBlur:n,...r}=e;return s.jsxs("fieldset",{className:"fieldset",children:[l&&s.jsxs("legend",{className:"fieldset-legend",children:[l,e.required?" *":""]}),s.jsx("input",{className:`input min-w-xs${e.pattern||e.required?" validator":""}`,onChange:a,onBlur:n,...r}),t&&s.jsx("p",{className:"label",children:t})]})});export{c as I};
@@ -1 +1 @@
1
- import{r,j as n}from"./index-C4AO15gr.js";const m=r.memo(({obj:e,lines:s})=>{const t=JSON.stringify(e,null,4),a=s??Math.max(10,(t.match(/\n/g)||"").length+1);return n.jsx("textarea",{className:"textarea w-full",readOnly:!0,rows:a,value:t})});export{m as J};
1
+ import{r,j as n}from"./index-O2DLxYbj.js";const m=r.memo(({obj:e,lines:s})=>{const t=JSON.stringify(e,null,4),a=s??Math.max(10,(t.match(/\n/g)||"").length+1);return n.jsx("textarea",{className:"textarea w-full",readOnly:!0,rows:a,value:t})});export{m as J};
Binary file
@@ -1 +1 @@
1
- import{r as n,u as o,j as s}from"./index-C4AO15gr.js";import{T as c}from"./TimeAgo-e8nXr4AB.js";const i=(e,t)=>{if(e)switch(t){case"ISO_8601":case"ISO_8601_local":return new Date(Date.parse(e));case"epoch":return new Date(e);case"disable":return;default:console.error(`Unknown last_seen type ${t}`);return}},p=n.memo(({lastSeen:e,config:t})=>{const{i18n:r}=o(),a=i(e,t);return a?s.jsx("span",{children:s.jsx(c,{datetime:a,locale:r.language})}):s.jsx("span",{children:"N/A"})});export{p as L};
1
+ import{r as n,u as o,j as s}from"./index-O2DLxYbj.js";import{T as c}from"./TimeAgo-BBbvibZK.js";const i=(e,t)=>{if(e)switch(t){case"ISO_8601":case"ISO_8601_local":return new Date(Date.parse(e));case"epoch":return new Date(e);case"disable":return;default:console.error(`Unknown last_seen type ${t}`);return}},p=n.memo(({lastSeen:e,config:t})=>{const{i18n:r}=o(),a=i(e,t);return a?s.jsx("span",{children:s.jsx(c,{datetime:a,locale:r.language})}):s.jsx("span",{children:"N/A"})});export{p as L};
@@ -1 +1 @@
1
- import{x as I,y as E,z as A,u as _,a as r,r as t,j as s,N as T,M,A as F,E as G,S as D,a5 as O,F as h,aj as C,C as L,ak as P,s as z,al as v,w as B,B as N,f as H,am as V}from"./index-C4AO15gr.js";import{C as $}from"./CheckboxField-Vzfuua4m.js";import{D as q}from"./DebouncedInput-seIGAyZ5.js";import{S as p}from"./SelectField-WJRba65T.js";import{u as R}from"./useSearch-mUc3xkmI.js";import"./envs-CSqIi4cL.js";const U={error:"bg-error text-error-content",warning:"bg-warning text-warning-content",info:"bg-info text-info-content",debug:"bg-accent text-accent-content opacity-50"},J=t.memo(({sourceIdx:l})=>{const{t:a}=_(["logs","common"]),x=r(L(e=>e.bridgeInfo[l].config.advanced.log_level)),o=r(L(e=>e.logs[l])),c=r(e=>e.logsLimit),u=r(e=>e.setLogsLimit),n=r(e=>e.clearLogs),[m,i,j]=R(),[d,w]=t.useState("all"),[f,S]=t.useState(!1),b=t.useMemo(()=>o.filter(e=>(d==="all"||e.level===d)&&(f||i.length===0||e.message.toLowerCase().includes(i))),[i,f,d,o]),y=t.useCallback((e,g)=>i.length>0&&e.toLowerCase().includes(i)?U[g]:P[g],[i]),k=t.useCallback(async e=>{await z(l,"bridge/request/options",{options:{advanced:{log_level:e}}})},[l]);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-row flex-wrap gap-3 items-top",children:[s.jsxs(p,{name:"log_level",label:a(e=>e.show_only,{ns:"common"}),value:d,onChange:e=>w(e.target.value),className:"select select-sm",children:[s.jsx("option",{value:"all",children:"all"},"all"),v.map(e=>s.jsx("option",{value:e,children:e},e))]}),s.jsxs("fieldset",{className:"fieldset",children:[s.jsx("legend",{className:"fieldset-legend",children:a(e=>e.filter_by_text)}),s.jsxs("div",{className:"join",children:[s.jsxs("label",{className:"input input-sm w-64 join-item",children:[s.jsx(h,{icon:B}),s.jsx(q,{onChange:j,placeholder:a(e=>e.search,{ns:"common"}),value:m})]}),s.jsx(N,{item:"",onClick:j,className:"btn btn-sm btn-square btn-warning btn-outline join-item",title:a(e=>e.clear,{ns:"common"}),disabled:m.length===0,children:s.jsx(h,{icon:H})})]})]}),s.jsx($,{name:"highlight_only",label:a(e=>e.highlight_only),checked:f,onChange:e=>S(e.target.checked),className:"checkbox checkbox-sm"}),s.jsx("fieldset",{className:"fieldset self-end",children:s.jsxs(N,{item:l,onClick:n,className:"btn btn-sm btn-outline btn-warning btn-primary",disabled:o.length===0,children:[s.jsx(h,{icon:C}),a(e=>e.clear,{ns:"common"})]})}),s.jsxs("div",{className:"ml-auto flex flex-row gap-3",children:[s.jsx(p,{name:"log_limit",label:a(e=>e.logs_limit),onChange:e=>{u(Number.parseInt(e.target.value,10))},value:c,className:"select select-sm",children:V.map(e=>s.jsx("option",{value:e,children:e},e))}),s.jsx(p,{name:"log_level_config",label:a(e=>e.log_level_config),value:x,onChange:e=>!e.target.validationMessage&&k(e.target.value),className:"select select-sm",children:v.map(e=>s.jsx("option",{value:e,children:e},e))})]})]}),s.jsx("div",{className:"mockup-code w-full mt-1 mb-3 before:content-none",children:b.length>0?b.map((e,g)=>s.jsx("pre",{"data-prefix":g,className:y(e.message,e.level),children:s.jsxs("code",{children:["[",e.timestamp,"] ",e.message]})},`${g}-${e.timestamp}`)):s.jsx("pre",{"data-prefix":"~",children:s.jsxs("code",{children:["[",new Date().toLocaleString(),"] ",a(e=>e.empty_logs_message)]})})})]})}),K=({isActive:l})=>l?"menu-active":void 0;function se(){const l=I(),{sourceIdx:a}=E(),[x,o]=A(a),{t:c}=_(["logs","common"]),u=r(n=>n.clearAllLogs);return t.useEffect(()=>{(!a||!o)&&l("/logs/0",{replace:!0})},[a,o,l]),s.jsxs(s.Fragment,{children:[s.jsx(T,{children:M&&s.jsxs("div",{className:"flex-1 flex flex-col",children:[s.jsx("div",{className:"menu menu-horizontal flex-1 pb-0",children:F.map((n,m)=>s.jsx("li",{children:s.jsx(G,{to:`/logs/${m}`,className:K,children:s.jsx(D,{idx:m,alwaysShowName:!0})})},n))}),s.jsx("div",{className:"menu menu-horizontal justify-end",children:s.jsxs(O,{onClick:u,className:"btn btn-sm btn-outline btn-warning btn-primary",title:c(n=>n.clear_all,{ns:"common"}),modalDescription:c(n=>n.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:c(n=>n.cancel,{ns:"common"}),children:[s.jsx(h,{icon:C}),c(n=>n.clear_all,{ns:"common"})]})})]})}),s.jsx(J,{sourceIdx:x},a)]})}export{se as default};
1
+ import{x as I,y as E,z as A,u as _,a as r,r as t,j as s,N as T,M,A as F,E as G,S as D,a5 as O,F as h,aj as C,C as L,ak as P,s as z,al as v,w as B,B as N,f as H,am as V}from"./index-O2DLxYbj.js";import{C as $}from"./CheckboxField-DDGxPCob.js";import{D as q}from"./DebouncedInput-B_mSPoL2.js";import{S as p}from"./SelectField-CGrVloaL.js";import{u as R}from"./useSearch-CiQm9ZMA.js";import"./envs-CSqIi4cL.js";const U={error:"bg-error text-error-content",warning:"bg-warning text-warning-content",info:"bg-info text-info-content",debug:"bg-accent text-accent-content opacity-50"},J=t.memo(({sourceIdx:l})=>{const{t:a}=_(["logs","common"]),x=r(L(e=>e.bridgeInfo[l].config.advanced.log_level)),o=r(L(e=>e.logs[l])),c=r(e=>e.logsLimit),u=r(e=>e.setLogsLimit),n=r(e=>e.clearLogs),[m,i,j]=R(),[d,w]=t.useState("all"),[f,S]=t.useState(!1),b=t.useMemo(()=>o.filter(e=>(d==="all"||e.level===d)&&(f||i.length===0||e.message.toLowerCase().includes(i))),[i,f,d,o]),y=t.useCallback((e,g)=>i.length>0&&e.toLowerCase().includes(i)?U[g]:P[g],[i]),k=t.useCallback(async e=>{await z(l,"bridge/request/options",{options:{advanced:{log_level:e}}})},[l]);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-row flex-wrap gap-3 items-top",children:[s.jsxs(p,{name:"log_level",label:a(e=>e.show_only,{ns:"common"}),value:d,onChange:e=>w(e.target.value),className:"select select-sm",children:[s.jsx("option",{value:"all",children:"all"},"all"),v.map(e=>s.jsx("option",{value:e,children:e},e))]}),s.jsxs("fieldset",{className:"fieldset",children:[s.jsx("legend",{className:"fieldset-legend",children:a(e=>e.filter_by_text)}),s.jsxs("div",{className:"join",children:[s.jsxs("label",{className:"input input-sm w-64 join-item",children:[s.jsx(h,{icon:B}),s.jsx(q,{onChange:j,placeholder:a(e=>e.search,{ns:"common"}),value:m})]}),s.jsx(N,{item:"",onClick:j,className:"btn btn-sm btn-square btn-warning btn-outline join-item",title:a(e=>e.clear,{ns:"common"}),disabled:m.length===0,children:s.jsx(h,{icon:H})})]})]}),s.jsx($,{name:"highlight_only",label:a(e=>e.highlight_only),checked:f,onChange:e=>S(e.target.checked),className:"checkbox checkbox-sm"}),s.jsx("fieldset",{className:"fieldset self-end",children:s.jsxs(N,{item:l,onClick:n,className:"btn btn-sm btn-outline btn-warning btn-primary",disabled:o.length===0,children:[s.jsx(h,{icon:C}),a(e=>e.clear,{ns:"common"})]})}),s.jsxs("div",{className:"ml-auto flex flex-row gap-3",children:[s.jsx(p,{name:"log_limit",label:a(e=>e.logs_limit),onChange:e=>{u(Number.parseInt(e.target.value,10))},value:c,className:"select select-sm",children:V.map(e=>s.jsx("option",{value:e,children:e},e))}),s.jsx(p,{name:"log_level_config",label:a(e=>e.log_level_config),value:x,onChange:e=>!e.target.validationMessage&&k(e.target.value),className:"select select-sm",children:v.map(e=>s.jsx("option",{value:e,children:e},e))})]})]}),s.jsx("div",{className:"mockup-code w-full mt-1 mb-3 before:content-none",children:b.length>0?b.map((e,g)=>s.jsx("pre",{"data-prefix":g,className:y(e.message,e.level),children:s.jsxs("code",{children:["[",e.timestamp,"] ",e.message]})},`${g}-${e.timestamp}`)):s.jsx("pre",{"data-prefix":"~",children:s.jsxs("code",{children:["[",new Date().toLocaleString(),"] ",a(e=>e.empty_logs_message)]})})})]})}),K=({isActive:l})=>l?"menu-active":void 0;function se(){const l=I(),{sourceIdx:a}=E(),[x,o]=A(a),{t:c}=_(["logs","common"]),u=r(n=>n.clearAllLogs);return t.useEffect(()=>{(!a||!o)&&l("/logs/0",{replace:!0})},[a,o,l]),s.jsxs(s.Fragment,{children:[s.jsx(T,{children:M&&s.jsxs("div",{className:"flex-1 flex flex-col",children:[s.jsx("div",{className:"menu menu-horizontal flex-1 pb-0",children:F.map((n,m)=>s.jsx("li",{children:s.jsx(G,{to:`/logs/${m}`,className:K,children:s.jsx(D,{idx:m,alwaysShowName:!0})})},n))}),s.jsx("div",{className:"menu menu-horizontal justify-end",children:s.jsxs(O,{onClick:u,className:"btn btn-sm btn-outline btn-warning btn-primary",title:c(n=>n.clear_all,{ns:"common"}),modalDescription:c(n=>n.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:c(n=>n.cancel,{ns:"common"}),children:[s.jsx(h,{icon:C}),c(n=>n.clear_all,{ns:"common"})]})})]})}),s.jsx(J,{sourceIdx:x},a)]})}export{se as default};
@@ -0,0 +1 @@
1
+ import{r as a,j as s,F as m}from"./index-O2DLxYbj.js";import{b as n}from"./index-BnCNGENq.js";import{D as e}from"./DisplayValue-BZ-eaAKu.js";const x=a.memo(({value:o})=>{const[t,r]=n(o);return s.jsxs(s.Fragment,{children:[s.jsx(m,{icon:t,className:r})," ",s.jsx(e,{value:o,name:"linkquality"})]})});export{x as L};
Binary file