@camstack/addon-admin-ui 1.2.636 → 1.2.637

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 (195) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/assets/Addons-BlKy1u2u.js +5 -0
  3. package/dist/assets/{AdminPage-D13CJb8Q.js → AdminPage-_ITsYONa.js} +1 -1
  4. package/dist/assets/{AdminSectionedPage-BMFLLxeJ.js → AdminSectionedPage-Xr_hesYw.js} +1 -1
  5. package/dist/assets/AiProfiles-YERCq98T.js +3 -0
  6. package/dist/assets/{Authentication-Fcsaeo6T.js → Authentication-CWHj8Czl.js} +1 -1
  7. package/dist/assets/{Build-L6hr034C.js → Build-BmlbmwZw.js} +3 -3
  8. package/dist/assets/{Calendars-Sq4Gc6IV.js → Calendars-Bg6sl6iG.js} +1 -1
  9. package/dist/assets/{CameraGrids-SZQaxv-J.js → CameraGrids-BWF-BVdJ.js} +1 -1
  10. package/dist/assets/Cluster-BsLfi42d.js +1 -0
  11. package/dist/assets/CompositionBlockEditor-C0mH1XDD.js +2 -0
  12. package/dist/assets/{CompositionEditorPage-D9X-zVQH.js → CompositionEditorPage-5iKEcr6R.js} +1 -1
  13. package/dist/assets/Data-DSMQmnZv.js +2 -0
  14. package/dist/assets/DeviceDetail-kBF3z5wo.js +2 -0
  15. package/dist/assets/{Devices-DruLtWCC.js → Devices-DQ8VksMo.js} +1 -1
  16. package/dist/assets/EmbedDevicePage-DOj0N5Mn.js +1 -0
  17. package/dist/assets/{EmbedPlayerPage-BDyIh4lQ.js → EmbedPlayerPage-J9i3kCrj.js} +1 -1
  18. package/dist/assets/History-BFkKRlW8.js +1 -0
  19. package/dist/assets/Identity-5sx8SWa4.js +1 -0
  20. package/dist/assets/InstancesTable-BagVOERb.js +1 -0
  21. package/dist/assets/IntegrationDetail-ByG-grc8.js +1 -0
  22. package/dist/assets/Integrations-BReJ0gq9.js +1 -0
  23. package/dist/assets/{Integrations-D_D9IsZx.js → Integrations-DK9ZlSbS.js} +2 -2
  24. package/dist/assets/Library-CVdwKZBw.js +1 -0
  25. package/dist/assets/Locations-CDUPDAGA.js +3 -0
  26. package/dist/assets/{Logs-DPHzCD-k.js → Logs-qlrqjJUI.js} +1 -1
  27. package/dist/assets/{MaskShapeCanvas-ByGbdZex.js → MaskShapeCanvas-C_kXMOhj.js} +1 -1
  28. package/dist/assets/{MotionZonesSettings-CiobfarF.js → MotionZonesSettings-CarcYpLx.js} +1 -1
  29. package/dist/assets/MyAccess-sO6455Tp.js +2 -0
  30. package/dist/assets/Network-B-NGzfdC.js +1 -0
  31. package/dist/assets/{NodeAddonsSettingsPanel-8E1KZ_Zn.js → NodeAddonsSettingsPanel-BtSyXQ4v.js} +1 -1
  32. package/dist/assets/Notifications-BhHrfZKJ.js +1 -0
  33. package/dist/assets/Pipeline-C9_jNGPl.js +1 -0
  34. package/dist/assets/{PrivacyMaskSettings-CG3fC1u9.js → PrivacyMaskSettings-BCxCYZMd.js} +1 -1
  35. package/dist/assets/Recordings-DTwvvqkz.js +1 -0
  36. package/dist/assets/RemoteGrid-CDLuEg4n.js +1 -0
  37. package/dist/assets/{ScanSubnetEditor-Daxor7Ws.js → ScanSubnetEditor-L1fLOCgh.js} +1 -1
  38. package/dist/assets/SceneMonitorEditor-C6ytHNuF.js +1 -0
  39. package/dist/assets/SessionsList-WhsG7RxJ.js +2 -0
  40. package/dist/assets/{Showroom-BHPAz8BT.js → Showroom-DGD_uw5N.js} +1 -1
  41. package/dist/assets/StorageLocationsTable-CV0MMZ6R.js +1 -0
  42. package/dist/assets/{System-BP4Cs93o.js → System-CUM8c-ad.js} +1 -1
  43. package/dist/assets/{Templates-XTi8n4d2.js → Templates-B1e69LSo.js} +1 -1
  44. package/dist/assets/{Terminal-BCojSdwl.js → Terminal-BzbVWqvg.js} +3 -3
  45. package/dist/assets/{TrainingProviders-DNZfikzc.js → TrainingProviders-CF4NFH__.js} +1 -1
  46. package/dist/assets/{Viewer-B5-4q7UR.js → Viewer-XTh3fjp9.js} +1 -1
  47. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-CsPCUaXy.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-BezlQnHO.js} +1 -1
  48. package/dist/assets/{action-draft-BOfrcBkB.js → action-draft-DztPBE6P.js} +1 -1
  49. package/dist/assets/addon-icons-context-Bb2eBZv3.js +1 -0
  50. package/dist/assets/{ai-page.helpers-C_Yr1xBa.js → ai-page.helpers-B1a9LT5I.js} +1 -1
  51. package/dist/assets/archive-ChKlYFY2.js +1 -0
  52. package/dist/assets/{assignment-candidates-BVHvGld8.js → assignment-candidates-DtwDORE1.js} +1 -1
  53. package/dist/assets/{authed-media-D1AyMZAW.js → authed-media-C0rONCq5.js} +1 -1
  54. package/dist/assets/bell-off-ChsIJ9tx.js +1 -0
  55. package/dist/assets/{board-model-Dhq6ifuR.js → board-model-DB92Pi_O.js} +1 -1
  56. package/dist/assets/boxes-k5PsZ3NR.js +1 -0
  57. package/dist/assets/calendar-clock-Iy6okb6K.js +1 -0
  58. package/dist/assets/chevron-down-CBb-F8DT.js +1 -0
  59. package/dist/assets/circle-arrow-up-5n0C9Hkd.js +1 -0
  60. package/dist/assets/circle-slash-Duh934sZ.js +1 -0
  61. package/dist/assets/client-mnldOm50.js +921 -0
  62. package/dist/assets/create-composition-xpQJ_im0.js +2 -0
  63. package/dist/assets/crop-B-t0rzRY.js +1 -0
  64. package/dist/assets/database-zap-DHuELz_w.js +1 -0
  65. package/dist/assets/device-detail-rao8xQIi.js +1 -0
  66. package/dist/assets/{device-integration-icon-DpDOvLri.js → device-integration-icon-DSKbNj0K.js} +1 -1
  67. package/dist/assets/device-picker-model-CLxwtH6P.js +1 -0
  68. package/dist/assets/{dist-HZnBedB7.js → dist-AhzFc2N5.js} +1 -1
  69. package/dist/assets/dist-jfEaRcCl.js +921 -0
  70. package/dist/assets/eraser-B3lnG9yK.js +1 -0
  71. package/dist/assets/file-up-2YD_M6f_.js +1 -0
  72. package/dist/assets/{format-ClefNnBA.js → format-B0YD4Zes.js} +1 -1
  73. package/dist/assets/grip-vertical-C89CQZwo.js +1 -0
  74. package/dist/assets/hard-drive-download-C6N6tovA.js +1 -0
  75. package/dist/assets/{hostInit-CfH1B74s.js → hostInit-Cc2xXBkZ.js} +1 -1
  76. package/dist/assets/i18n-ByFr51sS.js +1 -0
  77. package/dist/assets/icons-B5aMnrp4.js +1 -0
  78. package/dist/assets/{index-BZIzoUuI.css → index-CcY1r6e1.css} +1 -1
  79. package/dist/assets/index-D5GcZJtC.js +4 -0
  80. package/dist/assets/key-CH4aXNMz.js +1 -0
  81. package/dist/assets/languages-Du_pOBpX.js +1 -0
  82. package/dist/assets/layers-BH9u1mrE.js +1 -0
  83. package/dist/assets/link-2-off-DmsjRAt7.js +1 -0
  84. package/dist/assets/{linked-devices-model-BTKuEEFr.js → linked-devices-model-DMdglvhv.js} +1 -1
  85. package/dist/assets/memory-stick-BQrJMbEW.js +1 -0
  86. package/dist/assets/message-square-plus-_aGccjyj.js +1 -0
  87. package/dist/assets/{mf-entry-bootstrap-0-eac89cb1.js → mf-entry-bootstrap-0-aa99f5e1.js} +2 -2
  88. package/dist/assets/mic-off-BIQ5bbUV.js +1 -0
  89. package/dist/assets/monitor-off-DnOkDa2s.js +1 -0
  90. package/dist/assets/monitor-smartphone-DPI9EQus.js +1 -0
  91. package/dist/assets/mount-CLxwtH6P.js +1 -0
  92. package/dist/assets/{notification-rule-status-CSdUF_tS.js → notification-rule-status-DfiT5MFH.js} +1 -1
  93. package/dist/assets/player-overlays-BZByYYB8.js +1 -0
  94. package/dist/assets/remoteEntry-BFXSwA_z.js +1 -0
  95. package/dist/assets/ruler-Buxogset.js +1 -0
  96. package/dist/assets/scan-eye-B0eLch9E.js +1 -0
  97. package/dist/assets/scissors-BgY-d4kD.js +1 -0
  98. package/dist/assets/search-x-C5ra3Aft.js +1 -0
  99. package/dist/assets/send-D_NAoo3n.js +1 -0
  100. package/dist/assets/settings-2-BIrKVPOG.js +1 -0
  101. package/dist/assets/shapes-BPdkDjXe.js +1 -0
  102. package/dist/assets/sigma-Bc8X6bFu.js +1 -0
  103. package/dist/assets/src-DKRp5NPI.js +169 -0
  104. package/dist/assets/{sso-popup-C1hR2YBu.js → sso-popup-CcJP5NlL.js} +1 -1
  105. package/dist/assets/{step-inspector-model-vWbbAD3j.js → step-inspector-model-DrTK6qqE.js} +1 -1
  106. package/dist/assets/table-2-DMxm3oyu.js +1 -0
  107. package/dist/assets/timer-reset-5221y6Jb.js +1 -0
  108. package/dist/assets/ungroup-BlQtUKBm.js +1 -0
  109. package/dist/assets/unlink-D3-IGpS8.js +1 -0
  110. package/dist/assets/usb-P4R9CjYI.js +1 -0
  111. package/dist/assets/{use-scenes-feed-Z9dHPg2s.js → use-scenes-feed-3gS-l6TV.js} +1 -1
  112. package/dist/assets/{use-stationary-objects-xEWFdcbm.js → use-stationary-objects-6FuPeLm0.js} +1 -1
  113. package/dist/assets/{useAdminDeviceRemoval-BskV-B_E.js → useAdminDeviceRemoval-Ds-ZvGNc.js} +1 -1
  114. package/dist/assets/useEventInvalidation-CLxwtH6P.js +1 -0
  115. package/dist/assets/{useNodeUrlSelection-PpcSePkt.js → useNodeUrlSelection-DAoFJ0Oq.js} +1 -1
  116. package/dist/assets/useTemplateSave-DZcYOuHu.js +1 -0
  117. package/dist/assets/user-round-CXEgJIXU.js +1 -0
  118. package/dist/assets/user-x-Dm3VRn93.js +1 -0
  119. package/dist/assets/variable-IcIR23WN.js +1 -0
  120. package/dist/assets/video-BV-3O_ZC.js +1 -0
  121. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BDhTmtK9.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-ZzcWUaNn.js} +2 -2
  122. package/dist/index.html +12 -10
  123. package/dist/server/addon.js +109 -8
  124. package/package.json +2 -2
  125. package/dist/assets/Addons-BPHEBwgB.js +0 -5
  126. package/dist/assets/AiProfiles-BS82tvr_.js +0 -3
  127. package/dist/assets/Cluster-AYu0bC0y.js +0 -1
  128. package/dist/assets/CompositionBlockEditor-DLKzOT_Z.js +0 -2
  129. package/dist/assets/Data-m24XW_1A.js +0 -2
  130. package/dist/assets/DeviceDetail-CtBuTHpi.js +0 -2
  131. package/dist/assets/History-B7zXtCqx.js +0 -1
  132. package/dist/assets/Identity-D7h9VlxP.js +0 -1
  133. package/dist/assets/InstancesTable-DJAoGLT7.js +0 -1
  134. package/dist/assets/IntegrationDetail-_DjBAUfS.js +0 -1
  135. package/dist/assets/Integrations-RdXuFBLO.js +0 -1
  136. package/dist/assets/Library-Bo5VMPHU.js +0 -1
  137. package/dist/assets/Locations-Bzbx2I8T.js +0 -3
  138. package/dist/assets/MyAccess-a5m99pH9.js +0 -2
  139. package/dist/assets/Network-6_mGQvda.js +0 -1
  140. package/dist/assets/Notifications-CANpi0fl.js +0 -1
  141. package/dist/assets/Pipeline-DXy1uxGI.js +0 -1
  142. package/dist/assets/Recordings-U1FdSuDg.js +0 -1
  143. package/dist/assets/SceneMonitorEditor-DoUH3vKa.js +0 -1
  144. package/dist/assets/SessionsList-CLG4ubwk.js +0 -2
  145. package/dist/assets/StorageLocationsTable-R3JA97a5.js +0 -1
  146. package/dist/assets/archive-CbCQODIH.js +0 -1
  147. package/dist/assets/bell-off-0BRa5Xnw.js +0 -1
  148. package/dist/assets/boxes-DwaGiTWo.js +0 -1
  149. package/dist/assets/calendar-clock-DxXmjbX-.js +0 -1
  150. package/dist/assets/circle-arrow-up-QFgY2pDM.js +0 -1
  151. package/dist/assets/circle-slash-D1PU0Pws.js +0 -1
  152. package/dist/assets/client-C0lbTORN.js +0 -839
  153. package/dist/assets/create-composition-rjKVG7Ea.js +0 -2
  154. package/dist/assets/crop-BE9be46d.js +0 -1
  155. package/dist/assets/database-zap-DM49YcQ2.js +0 -1
  156. package/dist/assets/device-picker-model-CUDIDEin.js +0 -1
  157. package/dist/assets/dist-CqSJqAHI.js +0 -839
  158. package/dist/assets/eraser-C49V6Xgz.js +0 -1
  159. package/dist/assets/file-up-DJCy37j8.js +0 -1
  160. package/dist/assets/hard-drive-download-CvIZPfEe.js +0 -1
  161. package/dist/assets/i18n-xBJb_nV7.js +0 -1
  162. package/dist/assets/icons-BAw5ExT5.js +0 -1
  163. package/dist/assets/index-DosV7QmO.js +0 -4
  164. package/dist/assets/key-QeyFcY2r.js +0 -1
  165. package/dist/assets/languages-flftEeCc.js +0 -1
  166. package/dist/assets/layers-I2gIsH5w.js +0 -1
  167. package/dist/assets/link-2-off-CDW3nS2X.js +0 -1
  168. package/dist/assets/memory-stick-3dE96Zxv.js +0 -1
  169. package/dist/assets/message-square-plus-DGwEztIa.js +0 -1
  170. package/dist/assets/mic-off-BmdlN5My.js +0 -1
  171. package/dist/assets/monitor-off-wdJY3-q4.js +0 -1
  172. package/dist/assets/monitor-smartphone-Bl6voNmx.js +0 -1
  173. package/dist/assets/mount-CUDIDEin.js +0 -1
  174. package/dist/assets/player-overlays-K3LnyuXU.js +0 -1
  175. package/dist/assets/remoteEntry-R0h-c7zx.js +0 -1
  176. package/dist/assets/ruler-2SK6v4x2.js +0 -1
  177. package/dist/assets/scan-eye-C8_EFUcN.js +0 -1
  178. package/dist/assets/scissors-C6KYQIFW.js +0 -1
  179. package/dist/assets/search-x-D-Hg9O-Y.js +0 -1
  180. package/dist/assets/send-CAIDeIAh.js +0 -1
  181. package/dist/assets/settings-2-CjaITzm2.js +0 -1
  182. package/dist/assets/shapes-DtaNsx8G.js +0 -1
  183. package/dist/assets/sigma-PjHLdD5t.js +0 -1
  184. package/dist/assets/src-BnhYqWbx.js +0 -169
  185. package/dist/assets/table-2-C9VskvlI.js +0 -1
  186. package/dist/assets/timer-reset-5MpoA_ms.js +0 -1
  187. package/dist/assets/ungroup-BA2l_gxU.js +0 -1
  188. package/dist/assets/unlink-iGZ9azi9.js +0 -1
  189. package/dist/assets/usb-B7ktYeJc.js +0 -1
  190. package/dist/assets/useEventInvalidation-CUDIDEin.js +0 -1
  191. package/dist/assets/useTemplateSave-DlVM9rMd.js +0 -1
  192. package/dist/assets/user-round-Bo7YdtBg.js +0 -1
  193. package/dist/assets/user-x-D3xK9W1_.js +0 -1
  194. package/dist/assets/variable-CWUlGlqi.js +0 -1
  195. package/dist/assets/video-DBmZRVRb.js +0 -1
@@ -1 +1 @@
1
- import{t as e}from"./i18n-xBJb_nV7.js";function t(e){return e===`totp`||e===`passkey`}function n(e){if(!e.startsWith(`#`))return null;let n=new URLSearchParams(e.slice(1)),r=n.get(`challenge`);if(r!==null){if(r.length===0)return null;let e=(n.get(`factors`)??``).split(`,`).filter(t);return e.length===0?null:{kind:`challenge`,challengeToken:r,factors:e}}let i=n.get(`error`);return i===`sso-not-linked`||i===`sso-state`?{kind:`error`,code:i,provider:n.get(`provider`)}:null}function r(t,n){switch(t){case`sso-not-linked`:return e.t(`helpers.ssoReturn.notLinked`,{provider:n??e.t(`helpers.ssoReturn.signInFallback`)});case`sso-state`:return e.t(`helpers.ssoReturn.state`)}}var i={expired:`helpers.ssoReturn.link.expired`,provider:`helpers.ssoReturn.link.provider`,session:`helpers.ssoReturn.link.session`,conflict:`helpers.ssoReturn.link.conflict`,state:`helpers.ssoReturn.link.state`};function a(t){let n=new URLSearchParams(t),r=n.get(`linked`);if(r!==null&&r.length>0)return{kind:`linked`,provider:r};let a=n.get(`linkError`);return a===null?null:{kind:`error`,message:e.t(i[a]??`helpers.ssoReturn.link.failed`)}}var o=`camstack:sso-return`,s=`camstack:sso-ack`,c=`/sso-complete`,l=1500,u=520,d=680;function f(e){if(!e.startsWith(`#`))return null;let t=new URLSearchParams(e.slice(1)),n=t.get(`return`);t.delete(`return`);let r=t.toString();return n===`login`?r.length>0?{target:n,fragment:r}:null:n===`profile`&&r.length>0?{target:n,query:r}:null}function p(e){return e.target===`login`?`/login#${e.fragment}`:`/system/my-access?${e.query}`}function m(e){let t=new URL(e,`http://placeholder.invalid`);return t.searchParams.set(`popup`,`1`),/^[a-z][a-z0-9+.-]*:/i.test(e)?t.toString():`${t.pathname}${t.search}${t.hash}`}function h(e=window){let t=Math.max(0,Math.round(e.screenX+(e.outerWidth-u)/2)),n=Math.max(0,Math.round(e.screenY+(e.outerHeight-d)/2));return[`popup=yes`,`width=${u}`,`height=${d}`,`left=${t}`,`top=${n}`,`toolbar=no`,`menubar=no`,`location=no`,`status=no`,`resizable=yes`,`scrollbars=yes`].join(`,`)}function g(e){try{return window.open(e??`about:blank`,`camstack-sso`,h())??null}catch{return null}}function _(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.target===`login`?typeof t.fragment==`string`:t.target===`profile`?typeof t.query==`string`:!1}function v(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`camstack:sso-return`&&_(t.completion)}function y(e,t,n){return t===null||e.source!==t||e.origin!==n?null:v(e.data)?e.data.completion:null}var b=`camstack-sso`,x=`camstack:sso-done`;function S(e,t){return e.target===`profile`?{target:`profile`,query:e.query}:t?{target:`login`}:null}function C(e){if(typeof e!=`object`||!e)return null;let t=e;if(t.type!==`camstack:sso-done`)return null;let n=Object.keys(t).sort().join(`,`);return t.target===`login`&&n===`target,type`?{target:`login`}:t.target===`profile`&&typeof t.query==`string`&&n===`query,target,type`?{target:`profile`,query:t.query}:null}function w(e){return typeof e==`object`&&!!e&&e.type===`camstack:sso-done-ack`}function T(e){try{let t=e.location.origin;return typeof t==`string`?t:null}catch{return null}}function E(){if(typeof BroadcastChannel>`u`)return null;try{let e=new BroadcastChannel(b);return{post:t=>e.postMessage(t),subscribe:t=>{let n=e=>t(e.data);return e.addEventListener(`message`,n),()=>e.removeEventListener(`message`,n)},close:()=>e.close()}}catch{return null}}var D=500;function O(e,t,n=window,r={}){let i=n.location.origin,a=r.channel===void 0?E():null,o=r.channel===void 0?a:r.channel,c=r.setInterval??((e,t)=>window.setInterval(e,t)),l=r.clearInterval??(e=>window.clearInterval(e)),u=!1,d=!1,f=r=>{let a=y(r,e,i);a===null||u||(u=!0,n.removeEventListener(`message`,f),e.postMessage({type:s},i),t.onReturn(a))};n.addEventListener(`message`,f);let p=o?.subscribe(e=>{let n=C(e);n===null||u||(u=!0,o.post({type:`camstack:sso-done-ack`}),t.onDone?.(n))})??null,m=c(()=>{d||!e.closed||(d=!0,l(m),t.onClosed?.())},D);return()=>{n.removeEventListener(`message`,f),p?.(),a?.close(),l(m)}}function k(e,t,n){if(t===null||e.source!==t||e.origin!==n)return!1;let r=e.data;return typeof r==`object`&&!!r&&r.type===`camstack:sso-ack`}function A(e,t){return new Promise(n=>{let r=!1,i=t(()=>{r||(r=!0,i(),n(!0))});e.setTimeout(()=>{r||(r=!0,i(),n(!1))},l)})}function j(e,t,n){let r=A(n,e=>{let r=r=>{k(r,t,n.origin)&&e()};return n.addEventListener(`message`,r),()=>n.removeEventListener(`message`,r)});try{let r={type:o,completion:e};t.postMessage(r,n.origin)}catch{}return r}function M(e,t,n){let r=A(n,e=>t.subscribe(t=>{w(t)&&e()}));return t.post({type:x,...e}),r}async function N(e,t){let n=t.opener!==null&&!t.opener.closed?t.opener:null;if(n!==null&&T(n)===t.origin&&await j(e,n,t)){t.close();return}let r=e.target===`login`?new URLSearchParams(e.fragment).get(`token`):null,i=r!==null&&r.length>0,o=S(e,i);if(o!==null&&t.channel!==null&&(r!==null&&i&&await t.persistSession(r),await M(o,t.channel,t))){t.close();return}if(n!==null&&e.target===`profile`){let n=a(`?${e.query}`);if(n?.kind===`error`){t.showResult({kind:`link-error`,message:n.message});return}t.close();return}t.continueAt(p(e))}function P(e,t){return(t.length>0&&e.startsWith(t)?e.slice(t.length):e).replace(/\/+$/,``)===c}export{f as a,m as c,r as d,g as i,a as l,P as n,T as o,E as r,O as s,N as t,n as u};
1
+ import{t as e}from"./i18n-ByFr51sS.js";function t(e){return e===`totp`||e===`passkey`}function n(e){if(!e.startsWith(`#`))return null;let n=new URLSearchParams(e.slice(1)),r=n.get(`challenge`);if(r!==null){if(r.length===0)return null;let e=(n.get(`factors`)??``).split(`,`).filter(t);return e.length===0?null:{kind:`challenge`,challengeToken:r,factors:e}}let i=n.get(`error`);return i===`sso-not-linked`||i===`sso-state`?{kind:`error`,code:i,provider:n.get(`provider`)}:null}function r(t,n){switch(t){case`sso-not-linked`:return e.t(`helpers.ssoReturn.notLinked`,{provider:n??e.t(`helpers.ssoReturn.signInFallback`)});case`sso-state`:return e.t(`helpers.ssoReturn.state`)}}var i={expired:`helpers.ssoReturn.link.expired`,provider:`helpers.ssoReturn.link.provider`,session:`helpers.ssoReturn.link.session`,conflict:`helpers.ssoReturn.link.conflict`,state:`helpers.ssoReturn.link.state`};function a(t){let n=new URLSearchParams(t),r=n.get(`linked`);if(r!==null&&r.length>0)return{kind:`linked`,provider:r};let a=n.get(`linkError`);return a===null?null:{kind:`error`,message:e.t(i[a]??`helpers.ssoReturn.link.failed`)}}var o=`camstack:sso-return`,s=`camstack:sso-ack`,c=`/sso-complete`,l=1500,u=520,d=680;function f(e){if(!e.startsWith(`#`))return null;let t=new URLSearchParams(e.slice(1)),n=t.get(`return`);t.delete(`return`);let r=t.toString();return n===`login`?r.length>0?{target:n,fragment:r}:null:n===`profile`&&r.length>0?{target:n,query:r}:null}function p(e){return e.target===`login`?`/login#${e.fragment}`:`/system/my-access?${e.query}`}function m(e){let t=new URL(e,`http://placeholder.invalid`);return t.searchParams.set(`popup`,`1`),/^[a-z][a-z0-9+.-]*:/i.test(e)?t.toString():`${t.pathname}${t.search}${t.hash}`}function h(e=window){let t=Math.max(0,Math.round(e.screenX+(e.outerWidth-u)/2)),n=Math.max(0,Math.round(e.screenY+(e.outerHeight-d)/2));return[`popup=yes`,`width=${u}`,`height=${d}`,`left=${t}`,`top=${n}`,`toolbar=no`,`menubar=no`,`location=no`,`status=no`,`resizable=yes`,`scrollbars=yes`].join(`,`)}function g(e){try{return window.open(e??`about:blank`,`camstack-sso`,h())??null}catch{return null}}function _(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.target===`login`?typeof t.fragment==`string`:t.target===`profile`?typeof t.query==`string`:!1}function v(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`camstack:sso-return`&&_(t.completion)}function y(e,t,n){return t===null||e.source!==t||e.origin!==n?null:v(e.data)?e.data.completion:null}var b=`camstack-sso`,x=`camstack:sso-done`;function S(e,t){return e.target===`profile`?{target:`profile`,query:e.query}:t?{target:`login`}:null}function C(e){if(typeof e!=`object`||!e)return null;let t=e;if(t.type!==`camstack:sso-done`)return null;let n=Object.keys(t).sort().join(`,`);return t.target===`login`&&n===`target,type`?{target:`login`}:t.target===`profile`&&typeof t.query==`string`&&n===`query,target,type`?{target:`profile`,query:t.query}:null}function w(e){return typeof e==`object`&&!!e&&e.type===`camstack:sso-done-ack`}function T(e){try{let t=e.location.origin;return typeof t==`string`?t:null}catch{return null}}function E(){if(typeof BroadcastChannel>`u`)return null;try{let e=new BroadcastChannel(b);return{post:t=>e.postMessage(t),subscribe:t=>{let n=e=>t(e.data);return e.addEventListener(`message`,n),()=>e.removeEventListener(`message`,n)},close:()=>e.close()}}catch{return null}}var D=500;function O(e,t,n=window,r={}){let i=n.location.origin,a=r.channel===void 0?E():null,o=r.channel===void 0?a:r.channel,c=r.setInterval??((e,t)=>window.setInterval(e,t)),l=r.clearInterval??(e=>window.clearInterval(e)),u=!1,d=!1,f=r=>{let a=y(r,e,i);a===null||u||(u=!0,n.removeEventListener(`message`,f),e.postMessage({type:s},i),t.onReturn(a))};n.addEventListener(`message`,f);let p=o?.subscribe(e=>{let n=C(e);n===null||u||(u=!0,o.post({type:`camstack:sso-done-ack`}),t.onDone?.(n))})??null,m=c(()=>{d||!e.closed||(d=!0,l(m),t.onClosed?.())},D);return()=>{n.removeEventListener(`message`,f),p?.(),a?.close(),l(m)}}function k(e,t,n){if(t===null||e.source!==t||e.origin!==n)return!1;let r=e.data;return typeof r==`object`&&!!r&&r.type===`camstack:sso-ack`}function A(e,t){return new Promise(n=>{let r=!1,i=t(()=>{r||(r=!0,i(),n(!0))});e.setTimeout(()=>{r||(r=!0,i(),n(!1))},l)})}function j(e,t,n){let r=A(n,e=>{let r=r=>{k(r,t,n.origin)&&e()};return n.addEventListener(`message`,r),()=>n.removeEventListener(`message`,r)});try{let r={type:o,completion:e};t.postMessage(r,n.origin)}catch{}return r}function M(e,t,n){let r=A(n,e=>t.subscribe(t=>{w(t)&&e()}));return t.post({type:x,...e}),r}async function N(e,t){let n=t.opener!==null&&!t.opener.closed?t.opener:null;if(n!==null&&T(n)===t.origin&&await j(e,n,t)){t.close();return}let r=e.target===`login`?new URLSearchParams(e.fragment).get(`token`):null,i=r!==null&&r.length>0,o=S(e,i);if(o!==null&&t.channel!==null&&(r!==null&&i&&await t.persistSession(r),await M(o,t.channel,t))){t.close();return}if(n!==null&&e.target===`profile`){let n=a(`?${e.query}`);if(n?.kind===`error`){t.showResult({kind:`link-error`,message:n.message});return}t.close();return}t.continueAt(p(e))}function P(e,t){return(t.length>0&&e.startsWith(t)?e.slice(t.length):e).replace(/\/+$/,``)===c}export{f as a,m as c,r as d,g as i,a as l,P as n,T as o,E as r,O as s,N as t,n as u};
@@ -1 +1 @@
1
- import{K as e,R as t,et as n}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Is as r,ci as i,es as a,fi as o,ts as s}from"./client-C0lbTORN.js";import{Er as c,Mr as l,Nr as u,Or as d,Tr as f,kr as p}from"./src-BnhYqWbx.js";import{t as m}from"./i18n-xBJb_nV7.js";import{qr as h}from"./index-DosV7QmO.js";n();var g=`step`,_=[g,`acc`];function v(e,t){return`${e}/${t}`}function y(e,t,n){let r=n.step!==null&&e.includes(n.step),i=n.acc!==null&&t.includes(n.acc);return{stepId:r?n.step:null,acceleratorId:i?n.acc:null,staleStepId:n.step!==null&&n.step!==``&&!r&&e.length>0?n.step:null}}var b=`armed:`;function x(e){return e.assignment.reasons.detection?.startsWith(b)===!0}function S(e){let{assignment:t,detection:n}=e;return n!==null&&n.provisioning.state===`failed`||t.detectionNodeId===null&&n===null&&!x(e)?`error`:n!==null&&n.phase===`active`?`healthy`:`idle`}function C(e){let t=[],n=[],{assignment:r,detection:i,broker:a}=e;i!==null&&i.provisioning.state===`failed`&&t.push({code:`provisioning-failed`,severity:`error`,message:i.provisioning.error!==void 0&&i.provisioning.error.length>0?m.t(`helpers.cameraCardModel.provisioningFailedWith`,{error:i.provisioning.error}):m.t(`helpers.cameraCardModel.provisioningFailed`)}),i!==null&&i.phase===`active`&&i.actualFps===0&&t.push({code:`detection-black-hole`,severity:`error`,message:m.t(`helpers.cameraCardModel.blackHole`)}),r.detectionNodeId===null&&i===null&&!x(e)&&n.push({code:`unassigned`,severity:`warning`,message:m.t(`helpers.cameraCardModel.unassigned`)});let o=e.degraded??[];if(o.length>0){let e=[...new Set(o.map(e=>e.stage))].join(`, `);n.push({code:`status-unreadable`,severity:`warning`,message:m.t(`helpers.cameraCardModel.statusUnreadable`,{stages:e})})}n.push(...ne(e.cameraSensors));for(let e of a?.profiles??[])e.status===`streaming`&&e.inFps===0&&n.push({code:`broker-stalled`,severity:`warning`,message:m.t(`helpers.cameraCardModel.brokerStalled`,{profile:e.profile})});return[...t,...n]}function ee(e){return e.state===`unreadable`&&o.state===`unreadable`&&e.reason===o.reason}function te(e){switch(e.state){case`ready`:return null;case`missing`:return{code:`camera-sensor-missing`,severity:`warning`,message:m.t(`helpers.cameraCardModel.sensorMissing`,{addonId:e.addonId,stableId:e.stableId})};case`offline`:return{code:`camera-sensor-offline`,severity:`warning`,message:m.t(`helpers.cameraCardModel.sensorOffline`,{name:e.name,deviceId:e.deviceId,reason:e.reason})};case`unsupported`:return{code:`camera-sensor-unsupported`,severity:`warning`,message:m.t(`helpers.cameraCardModel.sensorUnsupported`,{name:e.name,deviceId:e.deviceId,reason:e.reason})};case`unreadable`:return{code:`camera-sensor-unreadable`,severity:`warning`,message:m.t(`helpers.cameraCardModel.sensorUnreadable`,{addonId:e.addonId,stableId:e.stableId,reason:e.reason})}}}function ne(e){if(e===void 0||e.state===`not-configured`)return[];if(e.state===`unreadable`)return ee(e)?[]:[{code:`camera-sensors-unreadable`,severity:`warning`,message:m.t(`helpers.cameraCardModel.sensorsUnreadable`,{reason:e.reason})}];let t=e.sensors.flatMap(e=>{let t=te(e);return t===null?[]:[t]}),n=e.notForwarded===void 0?t:[w(e.notForwarded),...t];return e.notEnforced===void 0?n:[{code:`camera-sensors-not-enforced`,severity:`warning`,message:m.t(`helpers.cameraCardModel.notEnforced`)},...n]}function w(e){return{code:`camera-sensors-not-forwarded`,severity:`warning`,message:e===`onboard-not-listed`?m.t(`helpers.cameraCardModel.notForwardedOnboard`):m.t(`helpers.cameraCardModel.notForwardedNoDetection`)}}function T(e){return e===void 0?m.t(`helpers.cameraCardModel.summaryUnavailable`):e.state===`not-configured`?m.t(`helpers.cameraCardModel.summaryNone`):e.state===`unreadable`?m.t(`helpers.cameraCardModel.summaryUnknown`,{reason:e.reason}):e.sensors.map(D).join(`, `)}function E(e){return e.mode===`in-addition`?``:` · ${e.mode}`}function D(e){return`${O(e)}${E(e)}`}function O(e){switch(e.state){case`ready`:return`${e.name} (#${e.deviceId})`;case`offline`:return`${e.name} (#${e.deviceId}) — ${e.reason}`;case`unsupported`:return m.t(`helpers.cameraCardModel.summaryUnsupported`,{name:e.name,deviceId:e.deviceId});case`missing`:case`unreadable`:return`${e.addonId}/${e.stableId} — ${e.state}`}}function k(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function A(e){return typeof e==`string`&&e.length>0?e:null}function j(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function M(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function N(e,t){return e==null?!1:JSON.stringify(e)!==JSON.stringify(t??null)}var P={detectionMode:null,detectionStreamProfile:null,detectionFps:null,motionSources:[],motionFps:null,motionCooldownMs:null,motionStreamProfile:null,audioMode:null,pipelineNodeId:null,decoderNodeId:null,audioNodeId:null,overriddenKeys:new Set};function F(e){if(!k(e)||!Array.isArray(e.sections))return P;let t=r(e),n=e=>{let n=t.get(e);if(n!==void 0)return n.value??n.default},i=new Set;for(let[e,n]of t)N(n.value,n.default)&&i.add(e);return{detectionMode:A(n(`detectionMode`)),detectionStreamProfile:A(n(`detectionStreamProfile`)),detectionFps:j(n(`detectionFps`)),motionSources:M(n(`motionSources`)),motionFps:j(n(`motionFps`)),motionCooldownMs:j(n(`motionCooldownMs`)),motionStreamProfile:A(n(`motionStreamProfile`)),audioMode:A(n(`audioMode`)),pipelineNodeId:A(n(`pipelineNodeId`)),decoderNodeId:A(n(`decoderNodeId`)),audioNodeId:A(n(`audioNodeId`)),overriddenKeys:i}}function I(e,t=0){let n=[];for(let r of e)n.push({addonId:r.addonId,modelId:r.modelId??null,enabled:r.enabled,depth:t}),r.children!==void 0&&r.children.length>0&&n.push(...I(r.children,t+1));return n}function L(n,r){let[i,a]=h(),o=i.get(g),s=i.get(`acc`),c=e(()=>y(n,r,{step:o,acc:s}),[n,r,o,s]),l=t(e=>{a(t=>{let n=new URLSearchParams(t);return e(n),n},{replace:!0})},[a]);return{selection:c,open:t(e=>l(t=>{t.set(g,e.stepId),e.acceleratorId===void 0?t.delete(`acc`):t.set(`acc`,e.acceleratorId)}),[l]),close:t(()=>l(e=>{e.delete(g),e.delete(`acc`)}),[l])}}function R(e,t){for(let n of e?.slots??[])for(let e of n.addons)if(e.id===t)return e;return null}function z(e){return e.split(`.`)[0]??e}function B(e,t,n){return{id:v(e,n.key),nodeId:e,deviceKey:n.key,device:n,label:`${z(t)} · ${l(n)}`,shortLabel:`${z(t)} · ${u(n)}`,nodeLabel:z(t),disabled:!n.enabled}}function V(e,t,n,r=!1){return n.filter(e=>r||e.enabled).map(n=>B(e,t,n))}function H(e,t,n){return{modelId:d({catalog:e,device:t.device,base:n.nodePin}),source:n.nodePin===void 0?`default`:`node`}}function U(e,t){let n=R(e,`object-detection`);if(n===null)return;let r=d({catalog:n,device:t.device,base:t.device.steps?.[`object-detection`]?.modelId});if(r===void 0)return;let i=n.models.find(e=>e.id===r);return{modelId:r,name:i?.name??r,supplies:i?.suppliesSteps??[]}}function W(e,t,n){return!a(e)||n===void 0?!1:s(e,t,n.supplies).effective}function G(e,t){return e!==null&&p(e.models,t.device.format)}function K(e){return G(e.addon,e.acc)?e.clusterModelId===void 0?{kind:`enabled`,modelId:e.model.modelId??`Auto`,...e.rootName===void 0?{}:{suppliedByRoot:e.rootName},...e.jumpTo===void 0?{}:{jumpTo:e.jumpTo}}:{kind:`enabled`,modelId:e.clusterModelId,clusterWide:!0}:e.gatedOn?e.jumpTo===void 0?{kind:`skip`}:{kind:`skip`,jumpTo:e.jumpTo}:{kind:`na`}}function q(e){if(e===null)return[];let t=(e.configSchema??[]).flatMap(e=>`label`in e&&typeof e.label==`string`?[e.label]:[]),n=i(e.id).map(e=>e.label);return[...new Set([...t,...n])]}function J(e){return e.flatMap(e=>[{node:e,depth:0},...J(e.children).map(e=>({node:e.node,depth:e.depth+1}))])}function Y(e){return c(e)}function X(e){return{nodeFields:Y(e),acceleratorFields:Z(e)}}function Z(e){return e.flatMap(e=>{if(e.type===`group`){let t=Z(e.fields);return t.length>0?[{...e,fields:[...t]}]:[]}return f(e)?[e]:[]})}function Q(e){return e.some(e=>e.type===`group`?Q(e.fields):f(e))}function $(e,t){return e.flatMap(e=>{let n=$(e.children,t);return t.has(e.addonId)||n.length>0?[{...e,children:n}]:[]})}export{F as _,J as a,_ as b,U as c,q as d,H as f,C as g,T as h,R as i,G as l,L as m,K as n,Q as o,W as p,$ as r,V as s,Y as t,X as u,I as v,S as y};
1
+ import{K as e,R as t,et as n}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Rs as r,ci as i,fi as a,ns as o,rs as s}from"./client-mnldOm50.js";import{Er as c,Sr as l,Tr as u,vr as d,xr as f,yr as p}from"./src-DKRp5NPI.js";import{t as m}from"./i18n-ByFr51sS.js";import{Kr as h}from"./index-D5GcZJtC.js";n();var g=`step`,_=[g,`acc`];function v(e,t){return`${e}/${t}`}function y(e,t,n){let r=n.step!==null&&e.includes(n.step),i=n.acc!==null&&t.includes(n.acc);return{stepId:r?n.step:null,acceleratorId:i?n.acc:null,staleStepId:n.step!==null&&n.step!==``&&!r&&e.length>0?n.step:null}}var b=`armed:`;function x(e){return e.assignment.reasons.detection?.startsWith(b)===!0}function S(e){let{assignment:t,detection:n}=e;return n!==null&&n.provisioning.state===`failed`||t.detectionNodeId===null&&n===null&&!x(e)?`error`:n!==null&&n.phase===`active`?`healthy`:`idle`}function C(e){let t=[],n=[],{assignment:r,detection:i,broker:a}=e;i!==null&&i.provisioning.state===`failed`&&t.push({code:`provisioning-failed`,severity:`error`,message:i.provisioning.error!==void 0&&i.provisioning.error.length>0?m.t(`helpers.cameraCardModel.provisioningFailedWith`,{error:i.provisioning.error}):m.t(`helpers.cameraCardModel.provisioningFailed`)}),i!==null&&i.phase===`active`&&i.actualFps===0&&t.push({code:`detection-black-hole`,severity:`error`,message:m.t(`helpers.cameraCardModel.blackHole`)}),r.detectionNodeId===null&&i===null&&!x(e)&&n.push({code:`unassigned`,severity:`warning`,message:m.t(`helpers.cameraCardModel.unassigned`)});let o=e.degraded??[];if(o.length>0){let e=[...new Set(o.map(e=>e.stage))].join(`, `);n.push({code:`status-unreadable`,severity:`warning`,message:m.t(`helpers.cameraCardModel.statusUnreadable`,{stages:e})})}n.push(...ne(e.cameraSensors));for(let e of a?.profiles??[])e.status===`streaming`&&e.inFps===0&&n.push({code:`broker-stalled`,severity:`warning`,message:m.t(`helpers.cameraCardModel.brokerStalled`,{profile:e.profile})});return[...t,...n]}function ee(e){return e.state===`unreadable`&&a.state===`unreadable`&&e.reason===a.reason}function te(e){switch(e.state){case`ready`:return null;case`missing`:return{code:`camera-sensor-missing`,severity:`warning`,message:m.t(`helpers.cameraCardModel.sensorMissing`,{addonId:e.addonId,stableId:e.stableId})};case`offline`:return{code:`camera-sensor-offline`,severity:`warning`,message:m.t(`helpers.cameraCardModel.sensorOffline`,{name:e.name,deviceId:e.deviceId,reason:e.reason})};case`unsupported`:return{code:`camera-sensor-unsupported`,severity:`warning`,message:m.t(`helpers.cameraCardModel.sensorUnsupported`,{name:e.name,deviceId:e.deviceId,reason:e.reason})};case`unreadable`:return{code:`camera-sensor-unreadable`,severity:`warning`,message:m.t(`helpers.cameraCardModel.sensorUnreadable`,{addonId:e.addonId,stableId:e.stableId,reason:e.reason})}}}function ne(e){if(e===void 0||e.state===`not-configured`)return[];if(e.state===`unreadable`)return ee(e)?[]:[{code:`camera-sensors-unreadable`,severity:`warning`,message:m.t(`helpers.cameraCardModel.sensorsUnreadable`,{reason:e.reason})}];let t=e.sensors.flatMap(e=>{let t=te(e);return t===null?[]:[t]}),n=e.notForwarded===void 0?t:[w(e.notForwarded),...t];return e.notEnforced===void 0?n:[{code:`camera-sensors-not-enforced`,severity:`warning`,message:m.t(`helpers.cameraCardModel.notEnforced`)},...n]}function w(e){return{code:`camera-sensors-not-forwarded`,severity:`warning`,message:e===`onboard-not-listed`?m.t(`helpers.cameraCardModel.notForwardedOnboard`):m.t(`helpers.cameraCardModel.notForwardedNoDetection`)}}function T(e){return e===void 0?m.t(`helpers.cameraCardModel.summaryUnavailable`):e.state===`not-configured`?m.t(`helpers.cameraCardModel.summaryNone`):e.state===`unreadable`?m.t(`helpers.cameraCardModel.summaryUnknown`,{reason:e.reason}):e.sensors.map(D).join(`, `)}function E(e){return e.mode===`in-addition`?``:` · ${e.mode}`}function D(e){return`${O(e)}${E(e)}`}function O(e){switch(e.state){case`ready`:return`${e.name} (#${e.deviceId})`;case`offline`:return`${e.name} (#${e.deviceId}) — ${e.reason}`;case`unsupported`:return m.t(`helpers.cameraCardModel.summaryUnsupported`,{name:e.name,deviceId:e.deviceId});case`missing`:case`unreadable`:return`${e.addonId}/${e.stableId} — ${e.state}`}}function k(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function A(e){return typeof e==`string`&&e.length>0?e:null}function j(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function M(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function N(e,t){return e==null?!1:JSON.stringify(e)!==JSON.stringify(t??null)}var P={detectionMode:null,detectionStreamProfile:null,detectionFps:null,motionSources:[],motionFps:null,motionCooldownMs:null,motionStreamProfile:null,audioMode:null,pipelineNodeId:null,decoderNodeId:null,audioNodeId:null,overriddenKeys:new Set};function F(e){if(!k(e)||!Array.isArray(e.sections))return P;let t=r(e),n=e=>{let n=t.get(e);if(n!==void 0)return n.value??n.default},i=new Set;for(let[e,n]of t)N(n.value,n.default)&&i.add(e);return{detectionMode:A(n(`detectionMode`)),detectionStreamProfile:A(n(`detectionStreamProfile`)),detectionFps:j(n(`detectionFps`)),motionSources:M(n(`motionSources`)),motionFps:j(n(`motionFps`)),motionCooldownMs:j(n(`motionCooldownMs`)),motionStreamProfile:A(n(`motionStreamProfile`)),audioMode:A(n(`audioMode`)),pipelineNodeId:A(n(`pipelineNodeId`)),decoderNodeId:A(n(`decoderNodeId`)),audioNodeId:A(n(`audioNodeId`)),overriddenKeys:i}}function I(e,t=0){let n=[];for(let r of e)n.push({addonId:r.addonId,modelId:r.modelId??null,enabled:r.enabled,depth:t}),r.children!==void 0&&r.children.length>0&&n.push(...I(r.children,t+1));return n}function L(n,r){let[i,a]=h(),o=i.get(g),s=i.get(`acc`),c=e(()=>y(n,r,{step:o,acc:s}),[n,r,o,s]),l=t(e=>{a(t=>{let n=new URLSearchParams(t);return e(n),n},{replace:!0})},[a]);return{selection:c,open:t(e=>l(t=>{t.set(g,e.stepId),e.acceleratorId===void 0?t.delete(`acc`):t.set(`acc`,e.acceleratorId)}),[l]),close:t(()=>l(e=>{e.delete(g),e.delete(`acc`)}),[l])}}function R(e,t){for(let n of e?.slots??[])for(let e of n.addons)if(e.id===t)return e;return null}function z(e){return e.split(`.`)[0]??e}function B(e,t,n){return{id:v(e,n.key),nodeId:e,deviceKey:n.key,device:n,label:`${z(t)} · ${u(n)}`,shortLabel:`${z(t)} · ${c(n)}`,nodeLabel:z(t),disabled:!n.enabled}}function V(e,t,n,r=!1){return n.filter(e=>r||e.enabled).map(n=>B(e,t,n))}function H(e,t,n){return{modelId:f({catalog:e,device:t.device,base:n.nodePin}),source:n.nodePin===void 0?`default`:`node`}}function U(e,t){let n=R(e,`object-detection`);if(n===null)return;let r=f({catalog:n,device:t.device,base:t.device.steps?.[`object-detection`]?.modelId});if(r===void 0)return;let i=n.models.find(e=>e.id===r);return{modelId:r,name:i?.name??r,supplies:i?.suppliesSteps??[]}}function W(e,t,n){return!o(e)||n===void 0?!1:s(e,t,n.supplies).effective}function G(e,t){return e!==null&&l(e.models,t.device.format)}function K(e){return G(e.addon,e.acc)?e.clusterModelId===void 0?{kind:`enabled`,modelId:e.model.modelId??`Auto`,...e.rootName===void 0?{}:{suppliedByRoot:e.rootName},...e.jumpTo===void 0?{}:{jumpTo:e.jumpTo}}:{kind:`enabled`,modelId:e.clusterModelId,clusterWide:!0}:e.gatedOn?e.jumpTo===void 0?{kind:`skip`}:{kind:`skip`,jumpTo:e.jumpTo}:{kind:`na`}}function q(e){if(e===null)return[];let t=(e.configSchema??[]).flatMap(e=>`label`in e&&typeof e.label==`string`?[e.label]:[]),n=i(e.id).map(e=>e.label);return[...new Set([...t,...n])]}function J(e){return e.flatMap(e=>[{node:e,depth:0},...J(e.children).map(e=>({node:e.node,depth:e.depth+1}))])}function Y(e){return p(e)}function X(e){return{nodeFields:Y(e),acceleratorFields:Z(e)}}function Z(e){return e.flatMap(e=>{if(e.type===`group`){let t=Z(e.fields);return t.length>0?[{...e,fields:[...t]}]:[]}return d(e)?[e]:[]})}function Q(e){return e.some(e=>e.type===`group`?Q(e.fields):d(e))}function $(e,t){return e.flatMap(e=>{let n=$(e.children,t);return t.has(e.addonId)||n.length>0?[{...e,children:n}]:[]})}export{F as _,J as a,_ as b,U as c,q as d,H as f,C as g,T as h,R as i,G as l,L as m,K as n,Q as o,W as p,$ as r,V as s,Y as t,X as u,I as v,S as y};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chevron-down-CBb-F8DT.js";var t=e(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chevron-down-CBb-F8DT.js";var t=e(`timer-reset`,[[`path`,{d:`M10 2h4`,key:`n1abiw`}],[`path`,{d:`M12 14v-4`,key:`1evpnu`}],[`path`,{d:`M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6`,key:`1ts96g`}],[`path`,{d:`M9 17H4v5`,key:`8t5av`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chevron-down-CBb-F8DT.js";var t=e(`ungroup`,[[`rect`,{width:`8`,height:`6`,x:`5`,y:`4`,rx:`1`,key:`nzclkv`}],[`rect`,{width:`8`,height:`6`,x:`11`,y:`14`,rx:`1`,key:`4tytwb`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chevron-down-CBb-F8DT.js";var t=e(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chevron-down-CBb-F8DT.js";var t=e(`circuit-board`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M11 9h4a2 2 0 0 0 2-2V3`,key:`1ve2rv`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`M7 21v-4a2 2 0 0 1 2-2h4`,key:`1fwkro`}],[`circle`,{cx:`15`,cy:`15`,r:`2`,key:`3i40o0`}]]),n=e(`crown`,[[`path`,{d:`M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z`,key:`1vdc57`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),r=e(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),i=e(`scale`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]),a=e(`usb`,[[`circle`,{cx:`10`,cy:`7`,r:`1`,key:`dypaad`}],[`circle`,{cx:`4`,cy:`20`,r:`1`,key:`22iqad`}],[`path`,{d:`M4.7 19.3 19 5`,key:`1enqfc`}],[`path`,{d:`m21 3-3 1 2 2Z`,key:`d3ov82`}],[`path`,{d:`M9.26 7.68 5 12l2 5`,key:`1esawj`}],[`path`,{d:`m10 14 5 2 3.5-3.5`,key:`v8oal5`}],[`path`,{d:`m18 12 1-1 1 1-1 1Z`,key:`1bh22v`}]]);export{t as a,n as i,i as n,r,a as t};
@@ -1 +1 @@
1
- import{a as e}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{gt as t}from"./player-overlays-K3LnyuXU.js";import"./src-BnhYqWbx.js";var n=3e4,r={results:[],unreachableCount:0};function i(i){let a=t(),o=i.length>0,s=[...i].sort((e,t)=>e-t),{data:c,isLoading:l,isError:u}=e({queryKey:[`scenes-feed`,s],enabled:o,staleTime:n,refetchInterval:n,retry:!1,queryFn:async()=>{let e=await a.trpcClient.sceneMonitor.listScenesBatch.query({deviceIds:s}),t=[],n=0;for(let r of e){if(r.status===null){n++;continue}t.push({deviceId:r.deviceId,monitors:r.status.monitors})}return{results:t,unreachableCount:n}}}),d=c??(u?{results:[],unreachableCount:s.length}:r);return{results:d.results,isLoading:o&&l,unreachableCount:d.unreachableCount}}export{i as t};
1
+ import{a as e}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{gt as t}from"./player-overlays-BZByYYB8.js";import"./src-DKRp5NPI.js";var n=3e4,r={results:[],unreachableCount:0};function i(i){let a=t(),o=i.length>0,s=[...i].sort((e,t)=>e-t),{data:c,isLoading:l,isError:u}=e({queryKey:[`scenes-feed`,s],enabled:o,staleTime:n,refetchInterval:n,retry:!1,queryFn:async()=>{let e=await a.trpcClient.sceneMonitor.listScenesBatch.query({deviceIds:s}),t=[],n=0;for(let r of e){if(r.status===null){n++;continue}t.push({deviceId:r.deviceId,monitors:r.status.monitors})}return{results:t,unreachableCount:n}}}),d=c??(u?{results:[],unreachableCount:s.length}:r);return{results:d.results,isLoading:o&&l,unreachableCount:d.unreachableCount}}export{i as t};
@@ -1 +1 @@
1
- import{a as e}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{gt as t}from"./player-overlays-K3LnyuXU.js";import"./src-BnhYqWbx.js";var n=15e3,r={rows:[],unreadableCount:0};function i(i){let a=t(),o=i.length>0,s=[...i].sort((e,t)=>e-t),{data:c,isLoading:l}=e({queryKey:[`stationary-objects`,s],enabled:o,staleTime:n,refetchInterval:n,queryFn:async()=>{let e=await a.trpcClient.zoneAnalytics.getCurrentSnapshotBatch.query({deviceIds:s}),t=[],n=0;for(let r of e){if(r.read===`unreadable`){n++;continue}for(let e of r.snapshot?.stationaryObjects??[])t.push({...e,deviceId:r.deviceId})}return{rows:t,unreadableCount:n}}}),u=c??r;return{rows:u.rows.toSorted((e,t)=>t.becameStationaryAt-e.becameStationaryAt),isLoading:o&&l,unreadableCount:u.unreadableCount}}export{i as t};
1
+ import{a as e}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{gt as t}from"./player-overlays-BZByYYB8.js";import"./src-DKRp5NPI.js";var n=15e3,r={rows:[],unreadableCount:0};function i(i){let a=t(),o=i.length>0,s=[...i].sort((e,t)=>e-t),{data:c,isLoading:l}=e({queryKey:[`stationary-objects`,s],enabled:o,staleTime:n,refetchInterval:n,queryFn:async()=>{let e=await a.trpcClient.zoneAnalytics.getCurrentSnapshotBatch.query({deviceIds:s}),t=[],n=0;for(let r of e){if(r.read===`unreadable`){n++;continue}for(let e of r.snapshot?.stationaryObjects??[])t.push({...e,deviceId:r.deviceId})}return{rows:t,unreadableCount:n}}}),u=c??r;return{rows:u.rows.toSorted((e,t)=>t.becameStationaryAt-e.becameStationaryAt),isLoading:o&&l,unreadableCount:u.unreadableCount}}export{i as t};
@@ -1 +1 @@
1
- import{R as e,et as t,o as n}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{c as r,fs as i}from"./src-BnhYqWbx.js";import{t as a}from"./useTranslation-BJr-n0es.js";import{st as o}from"./index-DosV7QmO.js";t();function s(){let{t}=a(),s=n(),{mutateAsync:c}=i();return r({remove:e(e=>c({deviceId:e.deviceId}),[c]),refresh:e(()=>s.invalidateQueries({queryKey:[[`deviceManager`]]}),[s]),onError:e((e,n)=>{o({severity:`critical`,title:t(`devices.removeFailed.title`,`Could not remove the device`),message:n,duration:8e3})},[t])})}export{s as t};
1
+ import{R as e,et as t,o as n}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{c as r,is as i}from"./src-DKRp5NPI.js";import{t as a}from"./useTranslation-BJr-n0es.js";import{ot as o}from"./index-D5GcZJtC.js";t();function s(){let{t}=a(),s=n(),{mutateAsync:c}=i();return r({remove:e(e=>c({deviceId:e.deviceId}),[c]),refresh:e(()=>s.invalidateQueries({queryKey:[[`deviceManager`]]}),[s]),onError:e((e,n)=>{o({severity:`critical`,title:t(`devices.removeFailed.title`,`Could not remove the device`),message:n,duration:8e3})},[t])})}export{s as t};
@@ -0,0 +1 @@
1
+ import"./src-DKRp5NPI.js";
@@ -1 +1 @@
1
- import{C as e,K as t,R as n,S as r,V as i,Y as a,et as o,x as s}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Kt as c,gt as l}from"./player-overlays-K3LnyuXU.js";import{Gr as u,Jr as d,Ni as f,Ur as p,Wr as m,Yr as h,bt as g,qr as _,zi as v}from"./src-BnhYqWbx.js";import{t as y}from"./useTranslation-BJr-n0es.js";import{Vr as b,qr as x}from"./index-DosV7QmO.js";o();var S=3e3;function C(e){return{backup:!e.skipBackup,addons:!e.skipAddons}}function w(e,t,n){return e.ok?e.job===null?t?{kind:`restarting`,last:n}:{kind:`idle`}:{kind:`job`,job:e.job}:t?{kind:`restarting`,last:n}:{kind:`error`,message:e.message}}function T(e,t){return t.kind===`restarting`?e:t.kind===`job`?t.job.state===`running`:!1}function E(e,t){return t!==null||e.kind===`restarting`||e.kind===`job`&&e.job.state===`running`?`progress`:`preview`}function D(e){return e.kind===`restarting`?e.last:e.kind===`job`&&e.job.state===`running`?e.job:null}var O={pending:`idle`,running:`running`,ok:`online`,failed:`error`,skipped:`disabled`};function k(e){return O[e]}function A({steps:t,restarting:n,targetVersion:i,skippedOffline:a}){let{t:o}=y();return e(`div`,{className:`flex flex-col gap-2`,children:[i!==null&&i!==``&&r(`p`,{className:`text-xs text-foreground-muted`,children:o(`clusterUpdate.target`,{defaultValue:`Target {{version}}`,version:i})}),n&&r(`p`,{role:`status`,className:`text-xs text-warning`,children:o(`clusterUpdate.restarting`,`The hub is restarting. Progress resumes when it answers.`)}),r(`ul`,{"aria-label":o(`clusterUpdate.stepsLabel`,`Cluster update steps`),className:`flex flex-col gap-1`,children:t.map((e,t)=>r(M,{step:e},j(e,t)))}),a.length>0&&r(`p`,{className:`text-xs text-foreground-subtle`,children:o(`clusterUpdate.offline`,{defaultValue:`Offline, not updated: {{nodes}}`,nodes:a.join(`, `)})})]})}function j(e,t){return`${t}:${e.kind}:${e.nodeId??``}`}function M({step:t}){let{t:n}=y();return e(`li`,{"data-status":t.status,"data-kind":t.kind,...t.reason===void 0?{}:{"data-reason":t.reason},className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5 rounded border border-border bg-surface px-2 py-1 text-xs`,children:[r(g,{status:k(t.status),label:P(t.status,n)}),r(`span`,{className:`font-medium text-foreground`,children:N(t,n)}),r(`span`,{className:`text-foreground-muted`,children:t.detail}),t.reason!==void 0&&r(`span`,{className:`text-danger`,children:n(`clusterUpdate.reason.${t.reason}`)})]})}function N(e,t){let n=String(t(`clusterUpdate.step.${e.kind}`,{defaultValue:e.kind}));return e.nodeId===void 0?n:`${n} · ${e.nodeId}`}function P(e,t){return String(t(`clusterUpdate.status.${e}`,{defaultValue:e}))}var F={later:(e,t)=>{let n=setTimeout(t,e);return()=>clearTimeout(n)}};function I(){let{trpcClient:e}=l();return t(()=>({preview:t=>e.clusterUpdate.previewClusterUpdate.query(t),start:t=>e.clusterUpdate.startClusterUpdate.mutate(t),readJob:t=>e.clusterUpdate.getClusterUpdateJob.query(t===void 0?{}:{jobId:t})}),[e])}o();function L(e){let t=I();return r(R,{...e,client:t,clock:F})}function R({open:i,onOpenChange:o,client:c,clock:l}){let{t:f}=y(),[g,b]=a(!1),[x,S]=a(!1),[w,T]=a(null),[O,k]=a(!1),[j,M]=a(null),[N,P]=a({kind:`idle`}),[F,I]=a({kind:`idle`}),L=t(()=>C({skipBackup:g,skipAddons:x}),[g,x]),R=E(N,w),V=z(N),G=D(N);B(c,l,w,P),H(c,i,R,L,I);let K=n(async()=>{k(!0),M(null);try{let e=await c.start(L);if(!e.accepted||e.jobId===null){M(e.message);return}T(e.jobId)}catch(e){M(e instanceof Error?e.message:String(e))}finally{k(!1)}},[c,L]),q=n(()=>{(N.kind!==`job`||N.job.state!==`running`)&&T(null),o(!1)},[o,N]);return e(s,{children:[!i&&G!==null&&r(A,{steps:G.steps,restarting:N.kind===`restarting`,targetVersion:G.targetVersion,skippedOffline:G.skippedOffline}),r(p,{open:i,onOpenChange:o,children:e(u,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,"aria-label":f(`clusterUpdate.title`,`Update the cluster`),children:[r(d,{children:r(h,{children:f(`clusterUpdate.title`,`Update the cluster`)})}),r(m,{children:R===`progress`?r(U,{view:N,shown:V}):r(W,{planState:F,skipBackup:g,skipAddons:x,startMessage:j,onSkipBackup:b,onSkipAddons:S})}),r(_,{children:R===`preview`?e(s,{children:[r(v,{type:`button`,variant:`ghost`,onClick:q,children:f(`clusterUpdate.cancel`,`Cancel`)}),r(v,{type:`button`,disabled:O||F.kind!==`ready`||F.plan.blocker!==null,onClick:()=>void K(),children:f(`clusterUpdate.start`,`Start update`)})]}):r(v,{type:`button`,variant:`ghost`,onClick:q,children:f(`clusterUpdate.close`,`Close`)})})]})})]})}function z(e){return e.kind===`job`?e.job:e.kind===`restarting`?e.last:null}function B(e,t,n,r){i(()=>{let i=!1,a,o=n!==null,s=null,c=async()=>{let l=await V(e,n??void 0);if(i)return;let u=w(l,o||s?.state===`running`,s);u.kind===`job`&&(s=u.job),o=T(o||s?.state===`running`,u),r(u),!(!o||i)&&(a=t.later(S,()=>void c()))};return c(),()=>{i=!0,a?.()}},[e,t,n,r])}async function V(e,t){try{return{ok:!0,job:await e.readJob(t)}}catch(e){return{ok:!1,message:e instanceof Error?e.message:String(e)}}}function H(e,t,n,r,a){i(()=>{if(!t||n!==`preview`)return;let i=!1;return a({kind:`loading`}),e.preview(r).then(e=>{i||a({kind:`ready`,plan:e})},e=>{i||a({kind:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{i=!0}},[e,t,n,r,a])}function U({view:t,shown:n}){let{t:i}=y();return n===null?r(`p`,{role:`status`,className:`text-xs text-warning`,children:i(`clusterUpdate.restarting`,`The hub is restarting. Progress resumes when it answers.`)}):e(`div`,{className:`flex flex-col gap-2`,children:[n.state===`succeeded`&&r(`p`,{role:`status`,className:`text-xs text-success`,children:i(`clusterUpdate.succeeded`,`Cluster update finished.`)}),n.state===`failed`&&r(`p`,{role:`alert`,className:`text-xs text-danger`,children:i(`clusterUpdate.failed`,{defaultValue:`Stopped at {{where}}.`,where:n.stoppedAt??n.reason??``})}),r(A,{steps:n.steps,restarting:t.kind===`restarting`,targetVersion:n.targetVersion,skippedOffline:n.skippedOffline})]})}function W({planState:t,skipBackup:n,skipAddons:i,startMessage:a,onSkipBackup:o,onSkipAddons:s}){let{t:c}=y();return e(`div`,{className:`flex flex-col gap-3`,children:[r(`p`,{className:`text-xs text-foreground-muted`,children:c(`clusterUpdate.previewBody`,`Backup, then the hub, then each online agent, then the addons. This page keeps the progress while the hub restarts.`)}),t.kind===`loading`&&r(`p`,{role:`status`,className:`text-xs text-foreground-subtle`,children:c(`clusterUpdate.loadingPlan`,`Reading what this update would do…`)}),t.kind===`error`&&r(`p`,{role:`alert`,className:`text-xs text-danger`,children:c(`clusterUpdate.planFailed`,{defaultValue:`Could not read the plan: {{message}}`,message:t.message})}),t.kind===`ready`&&r(G,{plan:t.plan,skipBackup:n,skipAddons:i,onSkipBackup:o,onSkipAddons:s}),a!==null&&r(`p`,{role:`alert`,className:`text-xs text-danger`,children:a})]})}function G({plan:t,skipBackup:n,skipAddons:i,onSkipBackup:a,onSkipAddons:o}){let{t:s}=y();return e(`div`,{className:`flex flex-col gap-3`,children:[t.blocker!==null&&e(`p`,{role:`alert`,"data-blocker":t.blocker,className:`text-xs text-warning`,children:[s(`clusterUpdate.blocker.${t.blocker}`),t.blockerDetail!==null&&t.blockerDetail!==``?` ${t.blockerDetail}`:``]}),r(A,{steps:t.steps,restarting:!1,targetVersion:t.targetVersion,skippedOffline:t.skippedOffline}),e(`label`,{className:`flex items-center gap-2 text-xs text-foreground`,children:[r(f,{checked:n,onChange:e=>a(e.target.checked)}),s(`clusterUpdate.skipBackup`,`Skip the backup`)]}),e(`label`,{className:`flex items-center gap-2 text-xs text-foreground`,children:[r(f,{checked:i,onChange:e=>o(e.target.checked)}),s(`clusterUpdate.skipAddons`,`Skip addon updates`)]})]})}function K({staleNodeId:t,shownNodeName:n}){return t===null?null:e(`div`,{role:`status`,className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-3 py-2 text-[11px] text-foreground-subtle`,children:[r(c,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-warning`}),r(`span`,{children:r(b,{i18nKey:`shared.staleNodeNotice.notice`,values:{id:t,name:n},components:{b:r(`span`,{className:`font-medium text-foreground`})}})})]})}var q=`node`;function J(e){return[...e].toSorted((e,t)=>e.isHub===t.isHub?e.isOnline===t.isOnline?e.name.localeCompare(t.name):e.isOnline?-1:1:e.isHub?-1:1)}function Y(e,t){let n=J(e),r=n[0]??null;if(r===null)return{node:null,outcome:`empty`,staleNodeId:null};if(t===null||t.length===0)return{node:r,outcome:`default`,staleNodeId:null};let i=n.find(e=>e.id===t);return i===void 0?{node:r,outcome:`stale`,staleNodeId:t}:{node:i,outcome:`requested`,staleNodeId:null}}o();function X(e){let[r,i]=x(),a=r.get(q);return{selection:t(()=>Y(e,a),[e,a]),selectNode:n(e=>{let t=new URLSearchParams(r);t.set(q,e),i(t,{replace:!0})},[r,i]),requestedNodeId:a}}export{K as n,L as r,X as t};
1
+ import{C as e,K as t,R as n,S as r,V as i,Y as a,et as o,x as s}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Kt as c,Sa as l,gt as u}from"./player-overlays-BZByYYB8.js";import{Br as d,Hr as f,Ir as p,Lr as m,Rr as h,Vr as g,bt as _,ji as v}from"./src-DKRp5NPI.js";import{t as y}from"./useTranslation-BJr-n0es.js";import{Br as b,Kr as x}from"./index-D5GcZJtC.js";o();var S=3e3;function C(e){return{backup:!e.skipBackup,addons:!e.skipAddons}}function w(e,t,n){return e.ok?e.job===null?t?{kind:`restarting`,last:n}:{kind:`idle`}:{kind:`job`,job:e.job}:t?{kind:`restarting`,last:n}:{kind:`error`,message:e.message}}function T(e,t){return t.kind===`restarting`?e:t.kind===`job`?t.job.state===`running`:!1}function E(e,t){return t!==null||e.kind===`restarting`||e.kind===`job`&&e.job.state===`running`?`progress`:`preview`}function D(e){return e.kind===`restarting`?e.last:e.kind===`job`&&e.job.state===`running`?e.job:null}var O={pending:`idle`,running:`running`,ok:`online`,failed:`error`,skipped:`disabled`};function k(e){return O[e]}function A({steps:t,restarting:n,targetVersion:i,skippedOffline:a}){let{t:o}=y();return e(`div`,{className:`flex flex-col gap-2`,children:[i!==null&&i!==``&&r(`p`,{className:`text-xs text-foreground-muted`,children:o(`clusterUpdate.target`,{defaultValue:`Target {{version}}`,version:i})}),n&&r(`p`,{role:`status`,className:`text-xs text-warning`,children:o(`clusterUpdate.restarting`,`The hub is restarting. Progress resumes when it answers.`)}),r(`ul`,{"aria-label":o(`clusterUpdate.stepsLabel`,`Cluster update steps`),className:`flex flex-col gap-1`,children:t.map((e,t)=>r(M,{step:e},j(e,t)))}),a.length>0&&r(`p`,{className:`text-xs text-foreground-subtle`,children:o(`clusterUpdate.offline`,{defaultValue:`Offline, not updated: {{nodes}}`,nodes:a.join(`, `)})})]})}function j(e,t){return`${t}:${e.kind}:${e.nodeId??``}`}function M({step:t}){let{t:n}=y();return e(`li`,{"data-status":t.status,"data-kind":t.kind,...t.reason===void 0?{}:{"data-reason":t.reason},className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5 rounded border border-border bg-surface px-2 py-1 text-xs`,children:[r(_,{status:k(t.status),label:P(t.status,n)}),r(`span`,{className:`font-medium text-foreground`,children:N(t,n)}),r(`span`,{className:`text-foreground-muted`,children:t.detail}),t.reason!==void 0&&r(`span`,{className:`text-danger`,children:n(`clusterUpdate.reason.${t.reason}`)})]})}function N(e,t){let n=String(t(`clusterUpdate.step.${e.kind}`,{defaultValue:e.kind}));return e.nodeId===void 0?n:`${n} · ${e.nodeId}`}function P(e,t){return String(t(`clusterUpdate.status.${e}`,{defaultValue:e}))}var F={later:(e,t)=>{let n=setTimeout(t,e);return()=>clearTimeout(n)}};function I(){let{trpcClient:e}=u();return t(()=>({preview:t=>e.clusterUpdate.previewClusterUpdate.query(t),start:t=>e.clusterUpdate.startClusterUpdate.mutate(t),readJob:t=>e.clusterUpdate.getClusterUpdateJob.query(t===void 0?{}:{jobId:t})}),[e])}o();function L(e){let t=I();return r(R,{...e,client:t,clock:F})}function R({open:i,onOpenChange:o,client:c,clock:l}){let{t:u}=y(),[_,b]=a(!1),[x,S]=a(!1),[w,T]=a(null),[O,k]=a(!1),[j,M]=a(null),[N,P]=a({kind:`idle`}),[F,I]=a({kind:`idle`}),L=t(()=>C({skipBackup:_,skipAddons:x}),[_,x]),R=E(N,w),V=z(N),G=D(N);B(c,l,w,P),H(c,i,R,L,I);let K=n(async()=>{k(!0),M(null);try{let e=await c.start(L);if(!e.accepted||e.jobId===null){M(e.message);return}T(e.jobId)}catch(e){M(e instanceof Error?e.message:String(e))}finally{k(!1)}},[c,L]),q=n(()=>{(N.kind!==`job`||N.job.state!==`running`)&&T(null),o(!1)},[o,N]);return e(s,{children:[!i&&G!==null&&r(A,{steps:G.steps,restarting:N.kind===`restarting`,targetVersion:G.targetVersion,skippedOffline:G.skippedOffline}),r(p,{open:i,onOpenChange:o,children:e(h,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,"aria-label":u(`clusterUpdate.title`,`Update the cluster`),children:[r(g,{children:r(f,{children:u(`clusterUpdate.title`,`Update the cluster`)})}),r(m,{children:R===`progress`?r(U,{view:N,shown:V}):r(W,{planState:F,skipBackup:_,skipAddons:x,startMessage:j,onSkipBackup:b,onSkipAddons:S})}),r(d,{children:R===`preview`?e(s,{children:[r(v,{type:`button`,variant:`ghost`,onClick:q,children:u(`clusterUpdate.cancel`,`Cancel`)}),r(v,{type:`button`,disabled:O||F.kind!==`ready`||F.plan.blocker!==null,onClick:()=>void K(),children:u(`clusterUpdate.start`,`Start update`)})]}):r(v,{type:`button`,variant:`ghost`,onClick:q,children:u(`clusterUpdate.close`,`Close`)})})]})})]})}function z(e){return e.kind===`job`?e.job:e.kind===`restarting`?e.last:null}function B(e,t,n,r){i(()=>{let i=!1,a,o=n!==null,s=null,c=async()=>{let l=await V(e,n??void 0);if(i)return;let u=w(l,o||s?.state===`running`,s);u.kind===`job`&&(s=u.job),o=T(o||s?.state===`running`,u),r(u),!(!o||i)&&(a=t.later(S,()=>void c()))};return c(),()=>{i=!0,a?.()}},[e,t,n,r])}async function V(e,t){try{return{ok:!0,job:await e.readJob(t)}}catch(e){return{ok:!1,message:e instanceof Error?e.message:String(e)}}}function H(e,t,n,r,a){i(()=>{if(!t||n!==`preview`)return;let i=!1;return a({kind:`loading`}),e.preview(r).then(e=>{i||a({kind:`ready`,plan:e})},e=>{i||a({kind:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{i=!0}},[e,t,n,r,a])}function U({view:t,shown:n}){let{t:i}=y();return n===null?r(`p`,{role:`status`,className:`text-xs text-warning`,children:i(`clusterUpdate.restarting`,`The hub is restarting. Progress resumes when it answers.`)}):e(`div`,{className:`flex flex-col gap-2`,children:[n.state===`succeeded`&&r(`p`,{role:`status`,className:`text-xs text-success`,children:i(`clusterUpdate.succeeded`,`Cluster update finished.`)}),n.state===`failed`&&r(`p`,{role:`alert`,className:`text-xs text-danger`,children:i(`clusterUpdate.failed`,{defaultValue:`Stopped at {{where}}.`,where:n.stoppedAt??n.reason??``})}),r(A,{steps:n.steps,restarting:t.kind===`restarting`,targetVersion:n.targetVersion,skippedOffline:n.skippedOffline})]})}function W({planState:t,skipBackup:n,skipAddons:i,startMessage:a,onSkipBackup:o,onSkipAddons:s}){let{t:c}=y();return e(`div`,{className:`flex flex-col gap-3`,children:[r(`p`,{className:`text-xs text-foreground-muted`,children:c(`clusterUpdate.previewBody`,`Backup, then the hub, then each online agent, then the addons. This page keeps the progress while the hub restarts.`)}),t.kind===`loading`&&r(`p`,{role:`status`,className:`text-xs text-foreground-subtle`,children:c(`clusterUpdate.loadingPlan`,`Reading what this update would do…`)}),t.kind===`error`&&r(`p`,{role:`alert`,className:`text-xs text-danger`,children:c(`clusterUpdate.planFailed`,{defaultValue:`Could not read the plan: {{message}}`,message:t.message})}),t.kind===`ready`&&r(G,{plan:t.plan,skipBackup:n,skipAddons:i,onSkipBackup:o,onSkipAddons:s}),a!==null&&r(`p`,{role:`alert`,className:`text-xs text-danger`,children:a})]})}function G({plan:t,skipBackup:n,skipAddons:i,onSkipBackup:a,onSkipAddons:o}){let{t:s}=y();return e(`div`,{className:`flex flex-col gap-3`,children:[t.blocker!==null&&e(`p`,{role:`alert`,"data-blocker":t.blocker,className:`text-xs text-warning`,children:[s(`clusterUpdate.blocker.${t.blocker}`),t.blockerDetail!==null&&t.blockerDetail!==``?` ${t.blockerDetail}`:``]}),r(A,{steps:t.steps,restarting:!1,targetVersion:t.targetVersion,skippedOffline:t.skippedOffline}),e(`label`,{className:`flex items-center gap-2 text-xs text-foreground`,children:[r(l,{checked:n,onChange:e=>a(e.target.checked)}),s(`clusterUpdate.skipBackup`,`Skip the backup`)]}),e(`label`,{className:`flex items-center gap-2 text-xs text-foreground`,children:[r(l,{checked:i,onChange:e=>o(e.target.checked)}),s(`clusterUpdate.skipAddons`,`Skip addon updates`)]})]})}function K({staleNodeId:t,shownNodeName:n}){return t===null?null:e(`div`,{role:`status`,className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-3 py-2 text-[11px] text-foreground-subtle`,children:[r(c,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-warning`}),r(`span`,{children:r(b,{i18nKey:`shared.staleNodeNotice.notice`,values:{id:t,name:n},components:{b:r(`span`,{className:`font-medium text-foreground`})}})})]})}var q=`node`;function J(e){return[...e].toSorted((e,t)=>e.isHub===t.isHub?e.isOnline===t.isOnline?e.name.localeCompare(t.name):e.isOnline?-1:1:e.isHub?-1:1)}function Y(e,t){let n=J(e),r=n[0]??null;if(r===null)return{node:null,outcome:`empty`,staleNodeId:null};if(t===null||t.length===0)return{node:r,outcome:`default`,staleNodeId:null};let i=n.find(e=>e.id===t);return i===void 0?{node:r,outcome:`stale`,staleNodeId:t}:{node:i,outcome:`requested`,staleNodeId:null}}o();function X(e){let[r,i]=x(),a=r.get(q);return{selection:t(()=>Y(e,a),[e,a]),selectNode:n(e=>{let t=new URLSearchParams(r);t.set(q,e),i(t,{replace:!0})},[r,i]),requestedNodeId:a}}export{K as n,L as r,X as t};
@@ -0,0 +1 @@
1
+ import{C as e,J as t,K as n,R as r,S as i,V as a,Y as o,et as s,o as c,q as l,x as u}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Ht as d,Jn as f,On as p,Sa as m,Yt as h,_a as g,ga as _,ha as v,pa as y,ut as b}from"./player-overlays-BZByYYB8.js";import{Br as x,Er as S,Fr as C,Pr as w,Tr as T,Uo as E,_a as D,ga as ee,va as te,wr as ne,zr as re}from"./client-mnldOm50.js";import{n as ie,t as ae}from"./shapes-BPdkDjXe.js";import{t as oe}from"./unlink-D3-IGpS8.js";import{Br as se,Cd as ce,Ci as le,Ed as ue,Ei as O,Hr as de,Ir as fe,Lr as pe,Lt as k,Nu as me,Rr as he,Vr as ge,Xr as _e,af as A,bi as ve,gf as ye,ji as j,of as M,sf as be,yn as N}from"./src-DKRp5NPI.js";import{t as P}from"./useTranslation-BJr-n0es.js";import{A as F,C as xe,D as I,E as L,O as Se,S as Ce,T as we,_ as Te,a as Ee,b as De,c as Oe,d as ke,f as Ae,g as je,i as Me,k as Ne,l as Pe,m as R,o as z,p as Fe,s as Ie,t as Le,u as B,v as Re,w as ze,x as Be,y as Ve}from"./RemoteGrid-CDLuEg4n.js";s();function He(e){return{past:[],present:e,future:[]}}var Ue=e=>e.past.length>0,We=e=>e.future.length>0;function Ge(e,t){switch(t.type){case`edit`:return Object.is(t.value,e.present)?e:{past:[...e.past,e.present].slice(-100),present:t.value,future:[]};case`undo`:{let t=e.past.at(-1);return t===void 0?e:{past:e.past.slice(0,-1),present:t,future:[e.present,...e.future]}}case`redo`:{let[t,...n]=e.future;return t===void 0?e:{past:[...e.past,e.present],present:t,future:n}}}}var V=12,H=4,U=3,W=(e,t,n,r,i,a={})=>({id:e,role:t,row:n,col:r,colSpan:i,...a}),G=e=>`custom:${e}`;function K(e,t,n=[]){return t.map((t,r)=>W(`r${e}c${r}`,t,e,r*H,H,{...n[r]===void 0?{}:{label:n[r]}}))}function q(e){return[W(`up`,`up`,e,H,H),W(`left`,`left`,e+1,0,H),W(`ok`,`ok`,e+1,H,H),W(`right`,`right`,e+1,2*H,H),W(`down`,`down`,e+2,H,H)]}function J(e,t){return t.map((t,n)=>W(`app_${t}`,G(`app_${t}`),e,n*U,U,{icon:z(t)}))}var Y=(e,t)=>({id:`core:section-divider`,row:e,col:0,options:{scale:{cols:V},title:t}});function Ke(e,t,n){let r=B(V,e,t);for(let e of n){let t=S(r,ne(e.id),{row:e.row,col:e.col},e.options);if(!t.ok)throw Error(`preset component ${e.id} at ${e.row}:${e.col}: ${t.reason}`);r=t.layout}return r}var X={scale:{cols:H}},qe={scale:{rows:2,cols:H}},Je=(e,t,n,r)=>({idSuffix:e,row:3,col:t,rowSpan:1,colSpan:1,role:n,label:r}),Ye={red:`A`,green:`B`,yellow:`C`,blue:`D`},Xe=Ke(24,[W(`input`,`input`,0,2*H,H),W(`source_select`,`source_select`,0,2,6),...J(1,[`netflix`,`youtube`,`primevideo`,`disneyplus`]),W(`mute`,`mute`,8,H,H),W(`ch_list`,G(`ch_list`),9,H,H,{label:`CH LIST`}),W(`settings`,G(`settings`),10,H,H,{label:`Settings`}),W(`home`,`home`,11,H,H),W(`guide`,`guide`,13,0,H),W(`e_manual`,G(`e_manual`),13,H,H,{label:`e-Manual`}),W(`info`,`info`,13,2*H,H),W(`back`,`back`,18,0,H),W(`exit`,`exit`,18,2*H,H),W(`pic_size`,G(`pic_size`),21,0,H,{label:`P.SIZE`}),W(`picture`,G(`picture`),21,H,H,{label:`Picture`}),W(`ad_subt`,G(`ad_subt`),21,2*H,H,{label:`AD/SUBT`})],[{id:`core:power`,row:0,col:0,options:{scale:{cols:2}}},Y(2,`Numbers`),{id:`core:keypad`,row:3,col:0,options:{scale:X.scale,extras:[Je(`ttx`,0,G(`ttx_mix`),`TTX/MIX`),Je(`prech`,2,G(`pre_ch`),`PRE-CH`)]}},Y(7,`Volume and channels`),{id:`core:rocker-volume-v`,row:8,col:0,options:qe},{id:`core:rocker-channel-v`,row:8,col:2*H,options:qe},Y(12,`Menus`),Y(14,`Navigation`),{id:`core:dpad`,row:15,col:0,options:X},Y(19,`Colour and picture`),{id:`core:colour-keys`,row:20,col:0,options:{scale:{cols:U},legends:Ye}},Y(22,`Playback`),{id:`core:media-transport`,row:23,col:1,options:{scale:{cols:2}}}]),Ze=[`netflix`,`youtube`,`primevideo`,`disneyplus`,`dazn`,`raiplay`],Qe=Ke(20,[W(`input`,`input`,0,2*H,H),...K(4,[`menu`,`home`,`exit`]),W(`guide`,`guide`,6,0,H),W(`info`,`info`,6,2*H,H),W(`back`,`back`,10,0,H),W(`play_pause`,`play_pause`,10,2*H,H),W(`mute`,`mute`,12,H,H),W(`ch_list`,G(`ch_list`),13,H,H,{label:`CH.LIST`}),W(`subtitle`,G(`subtitle`),14,0,6,{label:`Subtitle`}),W(`text`,G(`text`),14,6,6,{label:`Text`})],[{id:`core:power`,row:0,col:0,options:{scale:{cols:2}}},{id:`core:panel`,row:1,col:0,options:{scale:X.scale,title:`Apps`,extras:Ze.map((e,t)=>({idSuffix:e,row:Math.floor(t/3),col:t%3,rowSpan:1,colSpan:1,role:G(`app_${e}`),icon:z(e)}))}},{id:`core:colour-keys`,row:3,col:0,options:{scale:{cols:U}}},Y(5,`Navigation`),{id:`core:dpad`,row:7,col:0,options:X},Y(11,`Volume and channels`),{id:`core:rocker-volume-v`,row:12,col:0,options:X},{id:`core:rocker-channel-v`,row:12,col:2*H,options:X},Y(15,`Numbers`),{id:`core:keypad`,row:16,col:0,options:X}]),$e=B(V,8,[W(`power`,`power`,0,0,H),W(`input`,`input`,0,2*H,H),...q(1),...K(4,[`back`,`home`,`play_pause`]),W(`vol_up`,`volume_up`,5,0,H),W(`mute`,`mute`,5,H,H,{rowSpan:2}),W(`ch_up`,`channel_up`,5,2*H,H),W(`vol_down`,`volume_down`,6,0,H),W(`ch_down`,`channel_down`,6,2*H,H),...J(7,[`netflix`,`primevideo`,`disneyplus`,`youtube`])]),et=B(V,9,[W(`power`,`power`,0,0,H),W(`input`,`input`,0,2*H,H),W(`settings`,G(`settings`),1,0,H,{label:`Settings`}),W(`up`,`up`,1,H,H),W(`guide`,`guide`,1,2*H,H),W(`left`,`left`,2,0,H),W(`ok`,`ok`,2,H,H),W(`right`,`right`,2,2*H,H),W(`back`,`back`,3,0,H),W(`down`,`down`,3,H,H),W(`home`,`home`,3,2*H,H),W(`vol_up`,`volume_up`,4,0,H,{rowSpan:2}),W(`vol_down`,`volume_down`,6,0,H,{rowSpan:2}),W(`mute`,`mute`,4,H,H),W(`info`,`info`,5,H,H),W(`menu`,`menu`,6,H,H),W(`exit`,`exit`,7,H,H),W(`ch_up`,`channel_up`,4,2*H,H,{rowSpan:2}),W(`ch_down`,`channel_down`,6,2*H,H,{rowSpan:2}),...J(8,[`netflix`,`primevideo`,`disneyplus`,`youtube`])]),tt=B(V,8,[W(`assistant`,G(`assistant`),0,0,H,{label:`Assistant`}),W(`input`,`input`,0,H,H),W(`power`,`power`,0,2*H,H),...q(1),...K(4,[`back`,`home`,`guide`]),W(`vol_up`,`volume_up`,5,0,H),W(`mute`,`mute`,5,H,H),W(`ch_up`,`channel_up`,5,2*H,H),W(`vol_down`,`volume_down`,6,0,H),W(`play_pause`,`play_pause`,6,H,H),W(`ch_down`,`channel_down`,6,2*H,H),...J(7,[`youtube`,`netflix`,`primevideo`,`disneyplus`])]),nt=B(V,7,[W(`siri`,G(`siri`),0,0,H,{label:`Siri`}),W(`power`,`power`,0,2*H,H),...q(1),...K(4,[`back`,`play_pause`,`home`]),W(`vol_up`,`volume_up`,5,0,6),W(`vol_down`,`volume_down`,5,6,6),W(`mute`,`mute`,6,H,H)]);function rt(e){return K(e,[`digit_1`,`digit_2`,`digit_3`]).concat(K(e+1,[`digit_4`,`digit_5`,`digit_6`]),K(e+2,[`digit_7`,`digit_8`,`digit_9`]))}var it=[{name:`red`,tone:`red`},{name:`green`,tone:`green`},{name:`yellow`,tone:`yellow`},{name:`blue`,tone:`blue`}];function at(e,t){return it.map(({name:n,tone:r},i)=>W(`color_${n}`,G(`color_${n}`),e,i*U,U,{label:t?String.fromCharCode(65+i):n,tone:r,...t?{showLegend:!0}:{}}))}var ot=B(V,18,[W(`power`,`power`,0,0,H),W(`input`,`input`,0,2*H,H),...rt(1),W(`ttx_mix`,G(`ttx_mix`),4,0,H,{label:`TTX/MIX`}),W(`digit_0`,`digit_0`,4,H,H),W(`pre_ch`,G(`pre_ch`),4,2*H,H,{label:`PRE-CH`}),W(`vol_up`,`volume_up`,5,0,H),W(`mute`,`mute`,5,H,H,{rowSpan:2}),W(`ch_up`,`channel_up`,5,2*H,H),W(`vol_down`,`volume_down`,6,0,H),W(`ch_down`,`channel_down`,6,2*H,H),W(`ch_list`,G(`ch_list`),7,H,H,{label:`CH LIST`}),W(`settings`,G(`settings`),8,0,H,{label:`Settings`}),W(`home`,`home`,8,H,H),W(`guide`,`guide`,8,2*H,H),...q(9),W(`back`,`back`,12,0,H),W(`info`,`info`,12,H,H),W(`exit`,`exit`,12,2*H,H),...K(13,[`rewind`,`play`,`fast_forward`]),W(`pause`,`pause`,14,0,6),W(`stop`,`stop`,14,6,6),...at(15,!0),W(`ad_subt`,G(`ad_subt`),16,0,12,{label:`AD/SUBT`}),W(`app_netflix`,G(`netflix`),17,0,H,{icon:z(`netflix`)}),W(`app_prime`,G(`prime_video`),17,H,H,{icon:z(`primevideo`)}),W(`samsung_tv_plus`,G(`samsung_tv_plus`),17,2*H,H,{label:`TV Plus`})]),st=B(V,18,[W(`power`,`power`,0,0,H),W(`input`,`input`,0,2*H,H),W(`app_youtube`,G(`youtube`),1,0,6,{icon:z(`youtube`)}),W(`app_netflix`,G(`netflix`),1,6,6,{icon:z(`netflix`)}),...K(2,[`menu`,`home`,`exit`]),W(`settings`,G(`settings`),3,0,H,{label:`Settings`}),W(`guide`,`guide`,3,H,H),W(`info`,`info`,3,2*H,H),...q(4),W(`back`,`back`,7,0,H),W(`ch_list`,G(`ch_list`),7,H,H,{label:`CH.LIST`}),W(`media`,G(`media`),7,2*H,H,{label:`Media`}),W(`vol_up`,`volume_up`,8,0,H),W(`mute`,`mute`,8,H,H,{rowSpan:2}),W(`ch_up`,`channel_up`,8,2*H,H),W(`vol_down`,`volume_down`,9,0,H),W(`ch_down`,`channel_down`,9,2*H,H),...rt(10),W(`sleep`,G(`sleep`),13,0,H,{label:`Sleep`}),W(`digit_0`,`digit_0`,13,H,H),W(`subtitle`,G(`subtitle`),13,2*H,H,{label:`Subtitle`}),W(`txt`,G(`txt`),14,0,6,{label:`Text`}),W(`rec`,G(`rec`),14,6,6,{label:`Rec`}),...K(15,[`rewind`,`play`,`fast_forward`]),W(`pause`,`pause`,16,0,6),W(`stop`,`stop`,16,6,6),...at(17,!1)]),ct=[{id:`samsung-classic`,layout:Xe},{id:`hisense-vidaa`,layout:Qe},{id:`samsung-bn59-01315`,layout:ot},{id:`hisense-erf3-vidaa`,layout:st},{id:`samsung-smart`,layout:$e},{id:`lg-magic`,layout:et},{id:`google-tv`,layout:tt},{id:`apple-tv`,layout:nt}];function lt(e){let t=ct.find(t=>t.id===e);return t===void 0?null:{...t.layout,buttons:t.layout.buttons.map(e=>({...e}))}}function ut(e){let t=new Map;for(let n of e)for(let e of n)t.has(e.id)||t.set(e.id,e);let n=[...t.values()];return[...n.filter(e=>e.id.startsWith(`core:`)),...n.filter(e=>!e.id.startsWith(`core:`))]}function dt(e,t){let n=e.nameI18n;return n===void 0?e.name:t.startsWith(`it`)?n.it:n.en}function ft(e){let t=S({columns:e.size.cols,rows:e.size.rows,buttons:[]},e,{row:0,col:0});return t.ok?t.layout:null}function pt(e,t,n,r){let i=t.trim().toLowerCase();return i===``?[...e]:e.filter(e=>dt(e,n).toLowerCase().includes(i)||r(e.category).toLowerCase().includes(i))}function mt(e,t){let n=T(e,t);return n!==null&&n>1}function ht(e,t,n={}){let r=n.fillWidth===!0?T(e,t):null,i=r===null||r<2?{}:{scale:{cols:r}};if(n.at!==void 0)return S(e,t,n.at,i);let a=S(e,t,{row:0,col:0},i);if(a.ok||a.reason===`outside`||a.reason===`too-many`)return a;for(let n=0;n<e.rows;n+=1)for(let r=0;r<e.columns;r+=1){let a=S(e,t,{row:n,col:r},i);if(a.ok)return a}return a}function gt({open:t,grid:n,onOpenChange:r,onPick:a}){let{t:o,i18n:s}=P();return i(fe,{open:t,onOpenChange:r,children:e(he,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[i(ge,{children:i(de,{children:o(`remote.palette.title`)})}),i(pe,{children:t&&i(_t,{grid:n,language:s.language,onPick:a})})]})})}function _t({grid:t,language:r,onPick:a}){let{t:s}=P(),c=me({}),[l,u]=o(``),[d,f]=o(!1),[h,g]=o(null),_=e=>s(`remote.palette.category.${e}`,e),v=pt(n(()=>ut(c.data===void 0?[]:[c.data]),[c.data]),l,r,_),y=v.some(e=>mt(t,e));return c.isError?i(le,{title:s(`remote.palette.errorTitle`),message:c.error.message,onRetry:()=>void c.refetch()}):c.data===void 0?e(`div`,{className:`grid gap-2 sm:grid-cols-2`,"data-testid":`palette-loading`,children:[i(O,{className:`h-24`}),i(O,{className:`h-24`}),i(O,{className:`h-24`}),i(O,{className:`h-24`})]}):e(`div`,{className:`space-y-3`,children:[e(`div`,{className:`relative`,children:[i(p,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-foreground-subtle`,"aria-hidden":!0}),i(A,{value:l,className:`pl-8`,placeholder:s(`remote.palette.search`),"aria-label":s(`remote.palette.search`),onChange:e=>u(e.target.value),"data-testid":`palette-search`})]}),y&&e(`label`,{className:`flex items-center gap-2 text-xs text-foreground-muted`,children:[i(m,{checked:d,onChange:e=>f(e.target.checked),"data-testid":`palette-fill-width`}),s(`remote.palette.fillWidth`)]}),h!==null&&i(`p`,{role:`status`,className:`text-xs text-success`,"data-testid":`palette-added`,children:s(`remote.palette.added`,{name:h})}),v.length===0?i(_e,{icon:ae,title:s(`remote.palette.emptyTitle`),description:s(`remote.palette.emptyDescription`)}):i(`ul`,{className:`grid gap-2 sm:grid-cols-2`,"data-testid":`palette-list`,children:v.map(e=>i(`li`,{children:i(vt,{component:e,language:r,category:_(e.category),onPick:()=>{a(e,{fillWidth:d}),g(dt(e,r))}})},e.id))})]})}function vt({component:t,language:r,category:a,onPick:o}){let{t:s}=P(),c=n(()=>ft(t),[t]),l=dt(t,r);return e(`button`,{type:`button`,className:`flex h-full w-full items-center gap-3 rounded-lg border border-border bg-surface p-2 text-left hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,"data-testid":`palette-item-${t.id}`,onClick:o,children:[i(`span`,{className:`w-20 shrink-0`,children:c!==null&&i(Le,{grid:c,label:l,compact:!0})}),e(`span`,{className:`min-w-0`,children:[i(`span`,{className:`block truncate text-sm font-medium text-foreground`,children:l}),e(`span`,{className:`block truncate text-xs text-foreground-muted`,children:[a,` ·`,` `,s(`remote.palette.size`,{cols:t.size.cols,rows:t.size.rows})]})]})]})}function Z(e,t){let n=t.kind===`group`?R(e,t.id):e.buttons.find(e=>e.id===t.id);return n===void 0?void 0:{row:n.row,col:n.col,rowSpan:n.rowSpan,colSpan:n.colSpan}}function yt(e,t,n,r,i){if(e.width<=0||e.height<=0)return{row:0,col:0};let a=Math.floor((n-e.left)/e.width*t.columns),o=(r-e.top)/e.height;if(i===void 0||i.length!==t.rows||o<0)return{col:a,row:Math.floor(o*t.rows)};let s=i.reduce((e,t)=>e+t,0),c=0;for(let[e,t]of i.entries())if(c+=t/s,o<c)return{col:a,row:e};return{col:a,row:Math.max(t.rows,Math.floor(o*t.rows))}}function bt(e,t,n){return{row:n.row-(t.row-e.row),col:n.col-(t.col-e.col)}}function xt(e,t,n){return t.kind===`group`?Be(e,t.id,n.row,n.col):De(e,t.id,n.row,n.col)}function St(e,t,n){let r=Z(e,t);if(r===void 0)return null;let i=xt(e,t,n);return{rect:{...r,row:n.row,col:n.col},valid:i.status===`ok`,reason:i.status===`ok`?null:i.reason}}function Ct(e){switch(e){case`ArrowUp`:return{dRow:-1,dCol:0};case`ArrowDown`:return{dRow:1,dCol:0};case`ArrowLeft`:return{dRow:0,dCol:-1};case`ArrowRight`:return{dRow:0,dCol:1};default:return null}}function wt(e,t,n,r){let i=Z(e,t);return i===void 0?{status:`refused`,reason:`unknown-button`}:xt(e,t,{row:i.row+n,col:i.col+r})}s();var Tt=4;function Et(e,n,i){let[s,c]=o(null),l=t({grid:e,onDrop:i});l.current={grid:e,onDrop:i};let u=t(null),d=t(!1);return a(()=>()=>u.current?.(),[]),{drag:s,onItemPointerDown:r((e,t)=>{let r=n.current;if(r===null||t.button!==0)return;let i=r.getBoundingClientRect();if(Z(l.current.grid,e)===void 0)return;let a={item:e,startX:t.clientX,startY:t.clientY,grabbed:yt(i,l.current.grid,t.clientX,t.clientY,we(l.current.grid)),active:!1,target:null},o=e=>{if(!a.active){if(Math.hypot(e.clientX-a.startX,e.clientY-a.startY)<Tt)return;a.active=!0}let t=l.current.grid,n=yt(r.getBoundingClientRect(),t,e.clientX,e.clientY,we(t)),i=Z(t,a.item);i!==void 0&&(a.target=bt(i,a.grabbed,n),c({item:a.item,preview:St(t,a.item,a.target)}))},s=e=>{window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,f),window.removeEventListener(`pointercancel`,p),window.removeEventListener(`keydown`,m),u.current=null,c(null),a.active&&(d.current=!0,window.setTimeout(()=>{d.current=!1},0),e&&a.target!==null&&l.current.onDrop(xt(l.current.grid,a.item,a.target)))},f=()=>s(!0),p=()=>s(!1),m=e=>{e.key===`Escape`&&s(!1)};window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,f),window.addEventListener(`pointercancel`,p),window.addEventListener(`keydown`,m),u.current=()=>s(!1)},[n]),consumeDragClick:r(()=>{let e=d.current;return d.current=!1,e},[])}}s();var Dt=`__custom__`;function Ot({value:n,onChange:r}){let{t:a}=P(),[s,c]=o(null),[l,u]=o(null),[d,p]=o(!1),m=t(null),h=s?.kind===`button`?s.id:null,g=s?.kind===`group`?s.id:null,_=n.buttons.find(e=>e.id===h)??null,v=g===null?void 0:R(n,g),y=(e,t)=>{if(e.status===`ok`){u(null),r(e.grid),t?.(e.grid);return}u(a(`remote.layout.refusal.${e.reason}`))},b=Et(n,m,e=>y(e));return e(`div`,{className:`grid gap-4 md:grid-cols-[minmax(0,18rem)_minmax(0,1fr)]`,children:[e(`div`,{className:`space-y-3`,children:[e(`div`,{className:`grid grid-cols-2 gap-2`,children:[i(k,{label:a(`remote.layout.columns`),children:i(N,{value:n.columns,onDelta:e=>y(ze(n,n.columns+e,n.rows))})}),i(k,{label:a(`remote.layout.rows`),children:i(N,{value:n.rows,onDelta:e=>y(ze(n,n.columns,n.rows+e))})})]}),i(Le,{grid:n,label:a(`remote.layout.previewLabel`),selectedId:h,selectedGroupId:g,onSelect:e=>{b.consumeDragClick()||c({kind:`button`,id:e})},onSelectGroup:e=>{b.consumeDragClick()||c({kind:`group`,id:e})},showEmptyCells:!0,gridRef:m,drag:b.drag,onItemPointerDown:b.onItemPointerDown,onItemKeyDown:(e,t)=>{let r=Ct(t.key);r!==null&&(t.preventDefault(),y(wt(n,e,r.dRow,r.dCol)))}}),i(`p`,{className:`text-xs text-foreground-subtle`,children:a(`remote.layout.dragHint`)}),e(`div`,{className:`flex flex-wrap gap-2`,children:[e(j,{variant:`outline`,size:`sm`,onClick:()=>p(!0),"data-testid":`remote-add-component`,children:[i(ae,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),a(`remote.layout.addComponent`)]}),e(j,{variant:`outline`,size:`sm`,onClick:()=>y(Pe(n,`ok`),e=>{let t=e.buttons.at(-1);c(t===void 0?null:{kind:`button`,id:t.id})}),"data-testid":`remote-add-button`,children:[i(f,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),a(`remote.layout.addButton`)]})]}),l!==null&&i(`p`,{role:`alert`,className:`text-xs text-warning`,"data-testid":`remote-layout-refusal`,children:l})]}),i(`div`,{className:`min-w-0`,children:_===null?v===void 0?i(`p`,{className:`text-xs text-foreground-subtle`,children:a(`remote.layout.selectHint`)}):i(jt,{grid:n,groupId:v.id,apply:y,onGone:()=>c(null)}):i(At,{grid:n,buttonId:_.id,apply:y,onRemove:()=>{r(Ce(n,_.id)),c(null),u(null)}})}),i(gt,{open:d,grid:n,onOpenChange:p,onPick:(e,t)=>{let i=ht(n,e,t);if(!i.ok){u(a(`remote.layout.refusal.${i.reason}`));return}u(null),r(i.layout);let o=i.buttonIds[0];c(i.groupId===null?o===void 0?null:{kind:`button`,id:o}:{kind:`group`,id:i.groupId})}})]})}function kt(e,t){return[...Oe.flatMap(n=>Te(n).map(r=>({value:r,label:Me(r,t),group:e(`remote.roleGroup.${n}`)}))),{value:Dt,label:e(`remote.layout.customRole`),group:e(`remote.roleGroup.custom`)}]}function At({grid:t,buttonId:n,apply:r,onRemove:a}){let{t:s,i18n:c}=P(),l=t.buttons.find(e=>e.id===n),u=l===void 0?null:ee(l.role),[d,f]=o(null);if(l===void 0)return null;let p=je(l.role)||d!==null,S=d??u??``,C=te(S),w={trigger:s(`remote.layout.pickIcon`),panel:s(`remote.layout.iconPanel`),searchPlaceholder:s(`deviceDisplay.iconSearchPlaceholder`),clear:s(`remote.layout.noIcon`),noMatches:s(`deviceDisplay.iconNoMatches`)},T=e=>s(`deviceDisplay.iconCategory.${e}`,{defaultValue:E(e)});return e(`div`,{className:`space-y-3 rounded-lg border border-border bg-surface p-3`,"data-testid":`remote-inspector`,children:[i(ve,{mode:`single`,singleDisplay:`field`,label:s(`remote.layout.role`),options:kt((e,t)=>s(e,t??e),c.language),value:p?Dt:l.role,onChange:e=>{if(e===Dt){f(u??``);return}f(null),r(L(t,l.id,{role:e}))}}),p&&i(k,{label:s(`remote.layout.customKey`),...S!==``&&!C?{error:s(`remote.layout.customKeyInvalid`)}:{},children:i(A,{value:S,placeholder:`hdmi_1`,onChange:e=>{let n=e.target.value;f(n),te(n)&&r(L(t,l.id,{role:D(n)}))}})}),e(`div`,{className:`grid grid-cols-[auto_minmax(0,1fr)] items-end gap-2`,children:[i(k,{label:s(`remote.layout.icon`),children:i(be,{value:l.icon??null,onPick:e=>r(L(t,l.id,{icon:e})),fallbackGlyph:ae,categoryLabel:T,labels:w})}),i(k,{label:s(`remote.layout.label`),children:i(A,{value:l.label??``,maxLength:40,onChange:e=>r(L(t,l.id,{label:e.target.value}))})})]}),i(k,{label:s(`remote.layout.appIcon`),children:i(b,{value:Ie(l.icon)?.key??``,options:[{value:``,label:s(`remote.layout.noApp`)},...Ee.map(e=>({value:e.key,label:e.label}))],onChange:e=>{let n=e.target.value;n===``?Ie(l.icon)!==void 0&&r(L(t,l.id,{icon:null})):r(L(t,l.id,{icon:z(n)}))},"data-testid":`remote-app-icon`})}),e(`div`,{className:`grid grid-cols-2 gap-3`,children:[i(k,{label:s(`remote.layout.shape`),children:i(b,{value:l.shape??``,options:[{value:``,label:s(`remote.layout.lookDefault`)},...re.map(e=>({value:e,label:s(`remote.layout.shapes.${e}`)}))],onChange:e=>{let n=re.find(t=>t===e.target.value);r(I(t,l.id,{shape:n??null}))},"data-testid":`remote-shape`})}),i(k,{label:s(`remote.layout.tone`),children:i(b,{value:l.tone??``,options:[{value:``,label:s(`remote.layout.lookDefault`)},...x.map(e=>({value:e,label:s(`remote.layout.tones.${e}`)}))],onChange:e=>{let n=x.find(t=>t===e.target.value);r(I(t,l.id,{tone:n??null}))},"data-testid":`remote-tone`})})]}),l.tone!==void 0&&[`red`,`green`,`yellow`,`blue`].includes(l.tone)&&e(`label`,{className:`flex items-center gap-2 text-xs text-foreground-muted`,children:[i(m,{checked:l.showLegend===!0,onChange:e=>r(I(t,l.id,{showLegend:e.target.checked})),"data-testid":`remote-show-legend`}),s(`remote.layout.showLegend`)]}),e(`div`,{className:`grid grid-cols-2 gap-3`,children:[i(k,{label:s(`remote.layout.move`),children:e(`div`,{className:`flex items-center gap-1`,children:[i(M,{icon:_,size:`sm`,variant:`secondary`,"aria-label":s(`remote.layout.moveLeft`),onClick:()=>r(F(t,l.id,0,-1))}),i(M,{icon:y,size:`sm`,variant:`secondary`,"aria-label":s(`remote.layout.moveUp`),onClick:()=>r(F(t,l.id,-1,0))}),i(M,{icon:g,size:`sm`,variant:`secondary`,"aria-label":s(`remote.layout.moveDown`),onClick:()=>r(F(t,l.id,1,0))}),i(M,{icon:v,size:`sm`,variant:`secondary`,"aria-label":s(`remote.layout.moveRight`),onClick:()=>r(F(t,l.id,0,1))})]})}),i(k,{label:s(`remote.layout.position`),children:i(`p`,{className:`text-xs text-foreground-muted`,"data-testid":`remote-position`,children:s(`remote.layout.positionValue`,{row:l.row+1,col:l.col+1})})}),i(k,{label:s(`remote.layout.height`),children:i(N,{value:l.rowSpan,onDelta:e=>r(xe(t,l.id,l.rowSpan+e,l.colSpan))})}),i(k,{label:s(`remote.layout.width`),children:i(N,{value:l.colSpan,onDelta:e=>r(xe(t,l.id,l.rowSpan,l.colSpan+e))})})]}),e(j,{variant:`danger`,size:`sm`,onClick:a,children:[i(h,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),s(`remote.layout.removeButton`)]})]})}function jt({grid:t,groupId:n,apply:r,onGone:a}){let{t:o}=P(),s=R(t,n);if(s===void 0)return null;let c=Ve(t,n).length;return e(`div`,{className:`space-y-3 rounded-lg border border-border bg-surface p-3`,"data-testid":`remote-group-inspector`,children:[i(`p`,{className:`text-xs text-foreground-muted`,children:o(`remote.layout.groupSummary`,{frame:o(`remote.layout.frames.${s.frame}`,s.frame),count:c,row:s.row+1,col:s.col+1})}),i(k,{label:o(`remote.layout.groupTitle`),children:i(A,{value:s.title??``,maxLength:40,onChange:e=>r(Se(t,s.id,e.target.value)),"data-testid":`remote-group-title`})}),s.frame===`divider`&&e(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[i(k,{label:o(`remote.layout.separatorSize`),children:i(b,{value:s.size??`compact`,options:[{value:`compact`,label:o(`remote.layout.separatorSizeCompact`)},{value:`normal`,label:o(`remote.layout.separatorSizeNormal`)}],onChange:e=>r(Ne(t,s.id,{size:e.target.value===`normal`?`normal`:`compact`})),"data-testid":`remote-separator-size`})}),e(`label`,{className:`flex items-center gap-2 self-end pb-2 text-xs text-foreground-muted`,children:[i(m,{checked:s.hideTitle===!0,onChange:e=>r(Ne(t,s.id,{hideTitle:e.target.checked})),"data-testid":`remote-separator-hide-title`}),o(`remote.layout.separatorHideLabel`)]})]}),e(`div`,{className:`flex flex-wrap gap-2`,children:[e(j,{variant:`outline`,size:`sm`,"data-testid":`remote-group-ungroup`,onClick:()=>{r(Ae(t,s.id,!0)),a()},children:[i(oe,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),o(`remote.layout.ungroup`)]}),e(j,{variant:`danger`,size:`sm`,"data-testid":`remote-group-delete`,onClick:()=>{r(Ae(t,s.id,!1)),a()},children:[i(h,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),o(`remote.layout.deleteGroup`)]})]})]})}var Mt={remote:{label:e=>e(`remote.templates.kind.remote`),emptyPayload:Fe,summary:(e,t)=>{let n=Re(e);return t(`remote.templates.layoutSummary`,{columns:n.columns,rows:n.rows,count:n.buttons.length})},renderEditor:(e,t)=>i(Ot,{value:Re(e),onChange:t}),isSavable:e=>ke(Re(e))!==null,presets:e=>ct.map(t=>({id:t.id,label:e(`remote.templates.preset.${t.id}`),payload:()=>lt(t.id)}))}};function Q(e){return Mt[e]}var $=w;function Nt(e,t){let n=C(e,t);return n.ok?n.payload:null}s();function Pt({draft:e,saving:t,error:n,onSave:r,onClose:a}){return i(fe,{open:e!==null,onOpenChange:e=>!e&&a(),children:i(he,{width:`xl`,placement:`sheet-on-mobile`,scroll:`body`,children:e!==null&&i(Ft,{draft:e,saving:t,error:n,onSave:r,onClose:a},e.id??`new`)})})}function Ft({draft:t,saving:n,error:r,onSave:a,onClose:s,back:c}){let{t:f}=P(),[p,m]=o(t.name),[h,g]=l(Ge,{kind:t.kind,presetId:``,payload:t.payload},He),{kind:v,presetId:y,payload:x}=h.present,S=e=>g({type:`edit`,value:{...h.present,payload:e}}),C=()=>g({type:`undo`}),w=()=>g({type:`redo`});ye(`mod+z`,C,{allowInInput:!1,label:`Undo`}),ye(`mod+shift+z`,w,{allowInInput:!1,label:`Redo`});let T=Q(v),E=T.presets(f),D=Nt(v,x),ee=p.trim()!==``&&D!==null&&T.isSavable(x)&&!n;return e(u,{children:[e(ge,{className:`flex-row items-center justify-between gap-2`,children:[e(`div`,{className:`flex min-w-0 items-center gap-2`,children:[c!==void 0&&e(j,{size:`sm`,variant:`ghost`,onClick:c.onBack,"data-testid":`template-back`,children:[i(_,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),i(`span`,{className:`truncate`,children:c.label})]}),i(de,{className:`truncate`,children:c===void 0?t.id===null?f(`remote.templates.newTitle`):f(`remote.templates.editTitle`):c.title})]}),e(`div`,{className:`flex shrink-0 items-center gap-1`,children:[i(M,{icon:d,size:`sm`,variant:`ghost`,"aria-label":f(`remote.history.undo`),title:f(`remote.history.undo`),disabled:!Ue(h),onClick:C,"data-testid":`template-undo`}),i(M,{icon:ie,size:`sm`,variant:`ghost`,"aria-label":f(`remote.history.redo`),title:f(`remote.history.redo`),disabled:!We(h),onClick:w,"data-testid":`template-redo`})]})]}),e(pe,{className:`space-y-4`,children:[e(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[i(k,{label:f(`remote.templates.name`),children:i(A,{value:p,maxLength:120,onChange:e=>m(e.target.value),"data-testid":`template-name`})}),t.id===null&&$.length>1&&i(k,{label:f(`remote.templates.kind.label`),children:i(b,{value:v,options:$.map(e=>({value:e,label:Q(e).label(f)})),onChange:e=>{let t=$.find(t=>t===e.target.value);t!==void 0&&g({type:`edit`,value:{kind:t,presetId:``,payload:Q(t).emptyPayload()}})}})}),t.id===null&&E.length>0&&i(k,{label:f(`remote.templates.startFrom`),children:i(b,{value:y,options:[{value:``,label:f(`remote.templates.startBlank`)},...E.map(e=>({value:e.id,label:e.label}))],onChange:e=>{let t=E.find(t=>t.id===e.target.value);g({type:`edit`,value:{kind:v,presetId:t?.id??``,payload:t===void 0?T.emptyPayload():t.payload()}}),t!==void 0&&p.trim()===``&&m(t.label)},"data-testid":`template-preset`})})]}),T.renderEditor(x,S),r!==null&&i(`p`,{role:`alert`,className:`text-xs text-danger`,children:r})]}),e(se,{children:[i(j,{variant:`ghost`,onClick:s,children:f(`common.cancel`)}),i(j,{disabled:!ee,onClick:()=>a({id:t.id,kind:v,name:p.trim(),payload:D}),"data-testid":`template-save`,children:f(`common.save`)})]})]})}s();function It(){let e=c(),t=ce(),n=ue(),[r,i]=o(null);return{save:async r=>{i(null);try{let a=r.id===null?await t.mutateAsync({kind:r.kind,name:r.name,payload:r.payload}):await n.mutateAsync({id:r.id,name:r.name,payload:r.payload});return a.status===`refused`?(i(a.detail),!1):(await e.invalidateQueries({queryKey:[[`template`]]}),!0)}catch(e){return i(e instanceof Error?e.message:String(e)),!1}},saving:t.isPending||n.isPending,error:r,clearError:()=>i(null)}}export{Q as i,Ft as n,Pt as r,It as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chevron-down-CBb-F8DT.js";var t=e(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chevron-down-CBb-F8DT.js";var t=e(`arrow-down-wide-narrow`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h10`,key:`1w87gc`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}]]),n=e(`badge-check`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),r=e(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),i=e(`scan-face`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`path`,{d:`M9 9h.01`,key:`1q5me6`}],[`path`,{d:`M15 9h.01`,key:`x1ddxp`}]]),a=e(`scan-line`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}]]),o=e(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),s=e(`square-parking`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 17V7h4a3 3 0 0 1 0 6H9`,key:`1dfk2c`}]]),c=e(`user-x`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`17`,x2:`22`,y1:`8`,y2:`13`,key:`3nzzx3`}],[`line`,{x1:`22`,x2:`17`,y1:`8`,y2:`13`,key:`1swrse`}]]);export{i as a,t as c,a as i,s as n,r as o,o as r,n as s,c as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chevron-down-CBb-F8DT.js";var t=e(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),n=e(`variable`,[[`path`,{d:`M8 21s-4-3-4-9 4-9 4-9`,key:`uto9ud`}],[`path`,{d:`M16 3s4 3 4 9-4 9-4 9`,key:`4w2vsq`}],[`line`,{x1:`15`,x2:`9`,y1:`9`,y2:`15`,key:`f7djnv`}],[`line`,{x1:`9`,x2:`15`,y1:`9`,y2:`15`,key:`1shsy8`}]]);export{t as n,n as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chevron-down-CBb-F8DT.js";var t=e(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),n=e(`cctv`,[[`path`,{d:`M16.75 12h3.632a1 1 0 0 1 .894 1.447l-2.034 4.069a1 1 0 0 1-1.708.134l-2.124-2.97`,key:`ir91b5`}],[`path`,{d:`M17.106 9.053a1 1 0 0 1 .447 1.341l-3.106 6.211a1 1 0 0 1-1.342.447L3.61 12.3a2.92 2.92 0 0 1-1.3-3.91L3.69 5.6a2.92 2.92 0 0 1 3.92-1.3z`,key:`jlp8i1`}],[`path`,{d:`M2 19h3.76a2 2 0 0 0 1.8-1.1L9 15`,key:`19bib8`}],[`path`,{d:`M2 21v-4`,key:`l40lih`}],[`path`,{d:`M7 9h.01`,key:`19b3jx`}]]),r=e(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),i=e(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),a=e(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),o=e(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),s=e(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),c=e(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),l=e(`layout-template`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]),u=e(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),d=e(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),f=e(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),p=e(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),m=e(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),h=e(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),g=e(`shield-x`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m14.5 9.5-5 5`,key:`17q4r4`}],[`path`,{d:`m9.5 9.5 5 5`,key:`18nt4w`}]]),_=e(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),v=e(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),y=e(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]);export{r as _,h as a,f as c,l as d,c as f,i as g,a as h,g as i,d as l,o as m,v as n,m as o,s as p,_ as r,p as s,y as t,u,n as v,t as y};