@camstack/addon-admin-ui 1.2.530 → 1.2.531
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.
- package/CHANGELOG.md +6 -0
- package/dist/assets/{AddonAssetIcon-B1rn0DLw.js → AddonAssetIcon-Cp5zLEvD.js} +1 -1
- package/dist/assets/Addons-BES3OMn0.js +5 -0
- package/dist/assets/{AdminPage-DmkuRREx.js → AdminPage-D2S65e6Q.js} +1 -1
- package/dist/assets/{AdminSectionedPage-Dv8ahC-U.js → AdminSectionedPage-CKX5JkdQ.js} +1 -1
- package/dist/assets/{AiProfiles-BJrqkjtX.js → AiProfiles-BIQHK5vc.js} +1 -1
- package/dist/assets/{Build-DTcg9gkb.js → Build-DjlUwtu8.js} +3 -3
- package/dist/assets/{Calendars-x_EpS-cd.js → Calendars-Brkz06fF.js} +1 -1
- package/dist/assets/{Cluster-aj2_8TZC.js → Cluster-BtvDTlfe.js} +1 -1
- package/dist/assets/{ComposedDeviceEditDialog-DNGwDK80.js → ComposedDeviceEditDialog-UYQVMVk7.js} +1 -1
- package/dist/assets/{CompositionBlockEditor-O3eDPOLD.js → CompositionBlockEditor-CYd3iEcq.js} +2 -2
- package/dist/assets/{CompositionEditorPage-D09wEj7N.js → CompositionEditorPage-GtC8DYG6.js} +1 -1
- package/dist/assets/{Data-D4Sz8Rl9.js → Data-39SL2gbC.js} +1 -1
- package/dist/assets/{DeviceDetail-BE-C2aGY.js → DeviceDetail-C9eCLTmW.js} +2 -2
- package/dist/assets/{DeviceDoActionFields-D1rhgn3I.js → DeviceDoActionFields-Ca2TmJDn.js} +1 -1
- package/dist/assets/{Devices-BBsDc0QJ.js → Devices-DwFifk2g.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-D0lVyXps.js → EmbedPlayerPage-D91A6i3P.js} +1 -1
- package/dist/assets/{FormBuilder-BvQZWKCS.js → FormBuilder-C01MTb_b.js} +1 -1
- package/dist/assets/{History-TMZn0v_I.js → History-OBh3harZ.js} +1 -1
- package/dist/assets/{Identity-DNIHuEKY.js → Identity-Bx-Ja-MP.js} +1 -1
- package/dist/assets/IntegrationDetail-TLO47L5-.js +1 -0
- package/dist/assets/{IntegrationHub-DviGnYgu.js → IntegrationHub-C--hpDK-.js} +1 -1
- package/dist/assets/{Integrations-9bupF3uw.js → Integrations-Cm9BV3o8.js} +1 -1
- package/dist/assets/{Integrations-B7okjAJ8.js → Integrations-GHsM_7uc.js} +1 -1
- package/dist/assets/{Library-BHn4Iifg.js → Library-D2EugVqE.js} +1 -1
- package/dist/assets/{Locations-BVaRTbq0.js → Locations-Cb8RSNkt.js} +1 -1
- package/dist/assets/{Logs-DI7IZGug.js → Logs-Gsq1EPYC.js} +1 -1
- package/dist/assets/{MaskShapeCanvas-HJuLPIJP.js → MaskShapeCanvas-4rUt1muq.js} +1 -1
- package/dist/assets/{MotionZonesSettings-COMPKhfx.js → MotionZonesSettings-D8frKIxI.js} +1 -1
- package/dist/assets/{MyAccess-YiGVb3gF.js → MyAccess-WsIYje4M.js} +1 -1
- package/dist/assets/{Network-ZYEqAiF5.js → Network-CjuJ-PkF.js} +1 -1
- package/dist/assets/{NodeAddonsSettingsPanel-Chb7RIE6.js → NodeAddonsSettingsPanel-DYEAw_0K.js} +1 -1
- package/dist/assets/{Notifications-DrVDMEuK.js → Notifications-DcpvQo5d.js} +1 -1
- package/dist/assets/Pipeline-CoNbGWDs.js +1 -0
- package/dist/assets/{PrivacyMaskSettings-C88JqmdE.js → PrivacyMaskSettings-LVUmj3W4.js} +1 -1
- package/dist/assets/Recordings-DeZnE3O5.js +1 -0
- package/dist/assets/RemoteGrid-CjSx3Aah.js +1 -0
- package/dist/assets/{ScanNetworkModal-Cq9BlXXk.js → ScanNetworkModal-CvlBpDgq.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-mE7W6emU.js → SceneMonitorEditor-CUgqZlLF.js} +1 -1
- package/dist/assets/SessionsList-CPlqGJSE.js +2 -0
- package/dist/assets/{Showroom-Crq5JUKV.js → Showroom-CoWYMVAI.js} +1 -1
- package/dist/assets/{System-CfurcyNZ.js → System-CqV_BBXI.js} +1 -1
- package/dist/assets/Templates-CMETwZM5.js +1 -0
- package/dist/assets/{Terminal-UyKanKPS.js → Terminal-BiuPjGjh.js} +5 -5
- package/dist/assets/{Trans-Bsz5Pghy.js → Trans-DlVN2FAm.js} +1 -1
- package/dist/assets/{Viewer-BTxcZ-BR.js → Viewer-VFeL3oiK.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-CmowmspB.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-BzI5prAS.js} +1 -1
- package/dist/assets/{addon-icons-context-DZZCjo9x.js → addon-icons-context-D_SbgBlL.js} +1 -1
- package/dist/assets/{archive-Bu9T4BL0.js → archive-BdOuJA6D.js} +1 -1
- package/dist/assets/{assignment-candidates-DWivr3bV.js → assignment-candidates-FrlfxULJ.js} +1 -1
- package/dist/assets/{authed-media-yW7W_8pm.js → authed-media-Cdlj2yED.js} +1 -1
- package/dist/assets/{bell-off-E0Abr7jJ.js → bell-off-DE260sCQ.js} +1 -1
- package/dist/assets/{board-model-CCD7fB3T.js → board-model-C8M8reLO.js} +1 -1
- package/dist/assets/{boxes-BkzsIUkw.js → boxes-ncBMqqF7.js} +1 -1
- package/dist/assets/circle-slash-bDMoAvuJ.js +1 -0
- package/dist/assets/{client-BvflqtP1.js → client-3nhKn2xf.js} +1 -1
- package/dist/assets/{cloud-upload-BIjzjy_K.js → cloud-upload-xWhkZB2K.js} +1 -1
- package/dist/assets/crop-BZhdHvRT.js +1 -0
- package/dist/assets/{device-integration-icon-BpHHi90B.js → device-integration-icon-DXsx1ovH.js} +1 -1
- package/dist/assets/device-picker-model-yyadLjpT.js +1 -0
- package/dist/assets/{dist-DoqhrZoo.js → dist-CxGqD88j.js} +1 -1
- package/dist/assets/{dist-Gm_hHBN2.js → dist-dKXZSA43.js} +1 -1
- package/dist/assets/{file-up-Cyg6A2qN.js → file-up-DSkaqgrs.js} +1 -1
- package/dist/assets/{format-ChSVChsY.js → format-5kuRrylR.js} +1 -1
- package/dist/assets/{grip-vertical-CLVyc1HC.js → grip-vertical-oBh5I9hk.js} +1 -1
- package/dist/assets/{hard-drive-download-Cd122TYb.js → hard-drive-download-BJ9Vaf4q.js} +1 -1
- package/dist/assets/{hostInit-DR1ykbVx.js → hostInit-ClzsOBVS.js} +1 -1
- package/dist/assets/{i18n-Bg2ooh3q.js → i18n-BTbD-8vc.js} +1 -1
- package/dist/assets/icons-B7ZVbtoQ.js +1 -0
- package/dist/assets/index-BGL4RiB2.css +2 -0
- package/dist/assets/{index-DGvsu0ui.js → index-BoU7NTPo.js} +3 -3
- package/dist/assets/{key-D_zqd1r-.js → key-5z5CPQqC.js} +1 -1
- package/dist/assets/{key-round-pNw827HU.js → key-round-DE61GWtp.js} +1 -1
- package/dist/assets/{layers-CFNXRt4j.js → layers-DUXoEBYs.js} +1 -1
- package/dist/assets/{linked-devices-model-D9m6pafu.js → linked-devices-model-D76tAwE6.js} +1 -1
- package/dist/assets/{list-ordered-Dy6tCUD8.js → list-ordered-DSox6EY0.js} +1 -1
- package/dist/assets/{location-owned-usage-DasgH3RR.js → location-owned-usage-BSaNp20e.js} +1 -1
- package/dist/assets/{memory-stick-Bt2KoB-0.js → memory-stick-f2B4Aw1x.js} +1 -1
- package/dist/assets/{message-square-plus-rkd_X0vs.js → message-square-plus-DUwM59NW.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-3390b09e.js → mf-entry-bootstrap-0-167f91f2.js} +2 -2
- package/dist/assets/{mic-off-DWb36TX2.js → mic-off-DpDwbFnF.js} +1 -1
- package/dist/assets/{monitor-off-B2GWMMt_.js → monitor-off-Cevi7ihB.js} +1 -1
- package/dist/assets/{monitor-smartphone-DJzvbVtx.js → monitor-smartphone-DPzM2qXf.js} +1 -1
- package/dist/assets/mount-yyadLjpT.js +1 -0
- package/dist/assets/{notification-schedule-field-B7FdiF_t.js → notification-schedule-field-B_Y6t98m.js} +1 -1
- package/dist/assets/{player-overlays-DpZIxQHp.js → player-overlays-D0HsTHUG.js} +1 -1
- package/dist/assets/{recycle-BWLoavmg.js → recycle-CK0-gO9v.js} +1 -1
- package/dist/assets/remoteEntry-CURqqH0d.js +1 -0
- package/dist/assets/{ruler-C1SbVRl3.js → ruler-C_9y2OuS.js} +1 -1
- package/dist/assets/{scan-eye-Bv4PGTFl.js → scan-eye-Cqs3dsDB.js} +1 -1
- package/dist/assets/{scissors-BsEkbrx_.js → scissors-BomV8klv.js} +1 -1
- package/dist/assets/{search-x-DE4DxdsF.js → search-x-Ck_vydrn.js} +1 -1
- package/dist/assets/{send-Dd0BBamd.js → send-B8Po_JT_.js} +1 -1
- package/dist/assets/{settings-2-z3X6U2eo.js → settings-2-CyAo_nYh.js} +1 -1
- package/dist/assets/shapes-CuqJ7CA_.js +1 -0
- package/dist/assets/{sigma-CxBVWJ85.js → sigma-YkVVm5dQ.js} +1 -1
- package/dist/assets/{speaker-Dy79a571.js → speaker-iL5Ep2q1.js} +1 -1
- package/dist/assets/{src-KDhMZ5Ob.js → src-D1j-98hX.js} +14 -14
- package/dist/assets/{sso-popup-BjTl8T6g.js → sso-popup-aQr_3YWW.js} +1 -1
- package/dist/assets/{step-inspector-model-D6NC9QoX.js → step-inspector-model-gcGmLTWD.js} +1 -1
- package/dist/assets/{table-2-IUuOvuT8.js → table-2-Bx38akVK.js} +1 -1
- package/dist/assets/{timer-reset-D1H0hoMf.js → timer-reset-Z1XvH6K-.js} +1 -1
- package/dist/assets/{unlink-DTu1e00O.js → unlink-Dx9zRmL9.js} +1 -1
- package/dist/assets/{usb-CFK8z-TS.js → usb-_-9JyMyy.js} +1 -1
- package/dist/assets/{use-device-bound-caps-DS4FtJtN.js → use-device-bound-caps-BR0aNe6v.js} +1 -1
- package/dist/assets/{use-scenes-feed-CE-KFGxN.js → use-scenes-feed-CNxJKI3Y.js} +1 -1
- package/dist/assets/{use-stationary-objects-CFLRkxjx.js → use-stationary-objects-CFFufETF.js} +1 -1
- package/dist/assets/useEventInvalidation-yyadLjpT.js +1 -0
- package/dist/assets/{useNodeUrlSelection-DytighTL.js → useNodeUrlSelection-zNi606-l.js} +1 -1
- package/dist/assets/user-round-BnFLdVEf.js +1 -0
- package/dist/assets/{user-x-KWsBR0tG.js → user-x-DCKuWnFc.js} +1 -1
- package/dist/assets/{variable-BG_qKWYf.js → variable-pzTTvzbo.js} +1 -1
- package/dist/assets/{video-D0guHpd1.js → video-Dn2Lqozt.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-FCSZ5q7m.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-o917suSb.js} +2 -2
- package/dist/index.html +14 -14
- package/dist/server/addon.js +9 -2
- package/package.json +1 -1
- package/dist/assets/Addons-DRU_qk60.js +0 -5
- package/dist/assets/IntegrationDetail-CYhU0hEL.js +0 -1
- package/dist/assets/Pipeline-BT9k34b_.js +0 -1
- package/dist/assets/Recordings-Dl-l1Vzi.js +0 -1
- package/dist/assets/RemoteGrid-CF92aN64.js +0 -1
- package/dist/assets/SessionsList-84zwfhuD.js +0 -2
- package/dist/assets/Templates-D0V7IdcS.js +0 -1
- package/dist/assets/circle-slash-pdaivo-U.js +0 -1
- package/dist/assets/crop-CZJDrMcX.js +0 -1
- package/dist/assets/device-picker-model-2dkiqOI6.js +0 -1
- package/dist/assets/icons-BSJCF6qM.js +0 -1
- package/dist/assets/index-CyqhCHax.css +0 -2
- package/dist/assets/mount-2dkiqOI6.js +0 -1
- package/dist/assets/remoteEntry-CD4F7fE2.js +0 -1
- package/dist/assets/shapes-D-IaC6en.js +0 -1
- package/dist/assets/useEventInvalidation-2dkiqOI6.js +0 -1
- package/dist/assets/user-round-BSVSJsjB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,J as t,K as n,R as r,S as i,V as a,Y as o,a as s,et as c,o as l,t as u,x as d}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Fn as f,Hn as p,Ht as m,In as h,On as g,bt as _,dt as v,hn as y,lr as b,pr as x,st as S}from"./player-overlays-DpZIxQHp.js";import{Ci as C,ba as w,tn as T}from"./client-BvflqtP1.js";import{_ as E,c as D,s as O}from"./video-D0guHpd1.js";import{t as k}from"./monitor-smartphone-DJzvbVtx.js";import{t as ee}from"./recycle-BWLoavmg.js";import{Ia as A,Lr as te,Ma as j,Mt as M,Na as N,Nt as P,Ra as ne,Ui as re,_t as ie,fi as F,ii as I,kn as ae,oo as L,pr as oe,yt as se}from"./src-KDhMZ5Ob.js";import{t as R}from"./i18n-Bg2ooh3q.js";import{t as z}from"./useTranslation-BJr-n0es.js";import{G as B,J as V,K as H,Q as U,b as W,et as G,i as K,q}from"./index-DGvsu0ui.js";import{t as J}from"./AdminSectionedPage-Dv8ahC-U.js";import{t as ce}from"./NodeAddonsSettingsPanel-Chb7RIE6.js";import{n as Y,r as X,t as le}from"./IntegrationHub-DviGnYgu.js";c();var Z={connected:`success`,connecting:`warning`,disconnected:`default`,"auth-failed":`danger`,unreachable:`danger`,error:`danger`};function Q({status:e}){return i(F,{variant:Z[e],className:`text-[10px]`,children:e})}function ue({broker:t,interactiveConnectPath:n,interactiveDisconnectPath:r,kindLabel:a,onEdit:s}){let{t:c}=z(),u=l(),d=S(),[f,h]=o(null),g=ne({onSuccess:e=>h(e.ok?{ok:!0}:{ok:!1,error:e.error}),onError:e=>h({ok:!1,error:e instanceof Error?e.message:String(e)})}),v=A({onSuccess:()=>{u.invalidateQueries({queryKey:[[`broker`,`list`]]})}}),y=async()=>{await d({title:c(`brokers.brokerManager.deleteBroker`,`Delete broker`),message:c(`brokers.brokerManager.deleteBrokerIntegrationsThatDepend`,`Delete broker "{{name}}"? Integrations that depend on it will stop working.`,{name:t.name}),confirmLabel:c(`common.delete`,`Delete`),variant:`danger`})&&v.mutate({id:t.id,addonId:t.addonId})},b=n!==void 0&&n.length>0&&t.status!==`connected`,C=r!==void 0&&r.length>0&&t.status===`connected`;return e(`tr`,{className:`border-b border-border last:border-0`,children:[i(`td`,{className:`px-3 py-2 text-xs text-foreground font-medium`,children:t.name}),i(`td`,{className:`px-3 py-2 text-xs text-foreground-subtle`,children:a}),e(`td`,{className:`px-3 py-2`,children:[i(Q,{status:t.status}),f&&i(`span`,{className:`ml-2 text-[10px] ${f.ok?`text-success`:`text-danger`}`,children:f.ok?`OK`:f.error??c(`common.failedWord`)})]}),i(`td`,{className:`px-3 py-2`,children:e(`div`,{className:`flex items-center justify-end gap-1.5`,children:[b&&e(I,{variant:`primary`,size:`sm`,onClick:()=>{V(n,t.id,()=>{u.invalidateQueries({queryKey:[[`broker`,`list`]]})})},title:c(`brokers.brokerManager.signInOpensAPopup`,`Sign in — opens a popup that closes when done`),children:[i(D,{className:`h-3 w-3`}),` `,c(`brokers.brokerManager.signIn`)]}),C&&e(I,{variant:`outline`,size:`sm`,onClick:()=>{V(r,t.id,()=>{u.invalidateQueries({queryKey:[[`broker`,`list`]]})})},title:c(`brokers.brokerManager.signOutClearsTheLinked`,`Sign out — clears the linked Google account on this broker`),children:[i(O,{className:`h-3 w-3`}),` `,c(`brokers.brokerManager.signOut`)]}),e(I,{variant:`outline`,size:`sm`,onClick:()=>g.mutate({id:t.id,addonId:t.addonId}),disabled:g.isPending,title:c(`brokers.brokerManager.testConnection`,`Test connection`),children:[g.isPending?i(x,{className:`h-3 w-3 animate-spin`}):i(_,{className:`h-3 w-3`}),c(`brokers.brokerManager.test`,`Test`)]}),e(I,{variant:`outline`,size:`sm`,onClick:()=>s(t),title:c(`common.edit`,`Edit`),children:[i(p,{className:`h-3 w-3`}),` `,c(`common.edit`)]}),e(I,{variant:`outline`,size:`sm`,className:`border-danger/40 text-danger hover:bg-danger/10`,onClick:()=>{y()},disabled:v.isPending,title:c(`common.delete`,`Delete`),children:[v.isPending?i(x,{className:`h-3 w-3 animate-spin`}):i(m,{className:`h-3 w-3`}),c(`common.delete`,`Delete`)]})]})})]})}function de({addonId:t}={}){let{t:r}=z(),a=N({}),s=n(()=>H(a.data).filter(e=>t===void 0||e.addonId===t),[a.data,t]),[c,l]=o(!1),[u,d]=o(null),{options:f}=q(t===void 0?{}:{addonId:t}),p=n(()=>new Map(f.map(e=>[e.kind,e.label])),[f]),m=n(()=>{let e=new Map;for(let t of f)e.has(t.kind)||e.set(t.kind,{...t.interactiveConnectPath===void 0?{}:{connect:t.interactiveConnectPath},...t.interactiveDisconnectPath===void 0?{}:{disconnect:t.interactiveDisconnectPath}});return e},[f]);return e(`div`,{className:`space-y-3`,children:[i(`div`,{className:`flex items-center justify-end`,children:e(I,{variant:`primary`,size:`sm`,onClick:()=>l(!0),disabled:f.length===0,title:f.length===0?r(`brokers.brokerManager.noBrokerProvidersAvailable`,`No broker providers available`):void 0,children:[i(h,{className:`h-3.5 w-3.5`}),` `,r(`brokers.brokerManager.addBroker`)]})}),i(`div`,{className:`rounded-lg border border-border bg-surface overflow-x-auto`,children:e(`table`,{className:`w-full min-w-[36rem] border-collapse`,children:[i(`thead`,{children:e(`tr`,{className:`border-b border-border bg-background/50`,children:[i(`th`,{className:`px-3 py-2 text-left text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle`,children:r(`brokers.brokerManager.name`,`Name`)}),i(`th`,{className:`px-3 py-2 text-left text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle`,children:r(`brokers.brokerManager.kind`,`Kind`)}),i(`th`,{className:`px-3 py-2 text-left text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle`,children:r(`brokers.brokerManager.status`,`Status`)}),i(`th`,{className:`px-3 py-2 text-right text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle`,children:r(`brokers.brokerManager.actions`,`Actions`)})]})}),e(`tbody`,{children:[a.isLoading&&i(`tr`,{children:e(`td`,{colSpan:4,className:`px-3 py-6 text-center text-xs text-foreground-subtle`,children:[i(x,{className:`inline h-4 w-4 animate-spin`}),` `,r(`brokers.brokerManager.loadingBrokers`)]})}),a.isError&&i(`tr`,{children:e(`td`,{colSpan:4,className:`px-3 py-4 text-center text-xs text-danger`,children:[r(`brokers.brokerManager.failedToLoadBrokers`,`Failed to load brokers:`),` `,a.error instanceof Error?a.error.message:r(`brokers.brokerManager.unknownError`,`Unknown error`)]})}),!a.isLoading&&!a.isError&&s.length===0&&i(`tr`,{children:i(`td`,{colSpan:4,className:`px-3 py-6 text-center text-xs text-foreground-subtle`,children:r(`brokers.brokerManager.noBrokersRegisteredYetAdd`,`No brokers registered yet. Add one to publish device events for downstream automations.`)})}),s.map(e=>{let t=m.get(e.kind);return i(ue,{broker:e,...t?.connect===void 0?{}:{interactiveConnectPath:t.connect},...t?.disconnect===void 0?{}:{interactiveDisconnectPath:t.disconnect},kindLabel:p.get(e.kind)??e.kind,onEdit:d},e.id)})]})]})}),c&&i(B,{...t===void 0?{}:{addonId:t},onClose:()=>l(!1),onSaved:()=>l(!1)}),u&&i(B,{broker:u,onClose:()=>d(null),onSaved:()=>d(null)})]})}function fe(e){if(typeof e==`string`)return e;if(typeof e==`object`&&e){let t=e.name;if(typeof t==`string`)return t}return null}function pe(e){let t=e,n=t?.manifest;if(n?.id===void 0)return null;let r=(n.capabilities??[]).map(fe).filter(e=>e!==null);return{addonId:n.id,displayName:n.packageDisplayName??n.name??n.id,capNames:r,processState:t?.process?.state??null}}function me(e,t){return Object.entries(e).filter(([,e])=>e===t).map(([e])=>e)}function he(e,t){return t.find(t=>e.capNames.includes(t))??null}function ge(e){switch(e){case`running`:return{state:`ok`,label:R.t(`helpers.connectivityModel.running`)};case`crashed`:case`failed`:return{state:`error`,label:e};case`stopped`:case`disabled`:return{state:`off`,label:R.t(`helpers.connectivityModel.stopped`)};default:return{state:`unknown`,label:e??R.t(`common.unknownWord`)}}}c();var _e=[`wasteCollections`,`listSources`],ve=[`wasteCollections`,`listCountries`];function ye(e){return e instanceof Error?e.message:String(e)}function be(e){return typeof e!=`object`||!e?!1:Array.isArray(Reflect.get(e,`sections`))}function xe(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let e=Reflect.get(n,`id`),r=Reflect.get(n,`label`),i=Reflect.get(n,`module`);if(typeof e!=`string`||typeof r!=`string`||typeof i!=`string`)continue;let a=Reflect.get(n,`enabled`),o=Reflect.get(n,`formValues`),s=Reflect.get(n,`serviceId`),c=Reflect.get(n,`countryId`);t.push({id:e,label:r,module:i,enabled:typeof a==`boolean`?a:!0,formValues:typeof o==`object`&&o&&!Array.isArray(o)?o:void 0,serviceId:typeof s==`string`?s:void 0,countryId:typeof c==`string`?c:void 0})}return t}function Se(e){return Array.isArray(e)?e.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=Reflect.get(e,`id`),n=Reflect.get(e,`label`);return typeof t!=`string`||typeof n!=`string`?[]:[{id:t,label:n}]}):[]}function Ce(e){return Array.isArray(e)?e.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=Reflect.get(e,`id`),n=Reflect.get(e,`label`),r=Reflect.get(e,`module`);if(typeof t!=`string`||typeof n!=`string`||typeof r!=`string`)return[];let i=Reflect.get(e,`title`);return[{id:t,label:n,title:typeof i==`string`&&i.length>0?i:n,module:r}]}):[]}function we(e,t,n){return{sections:[{id:`picker`,title:R.t(`system.wasteSettingsSources.countryService`,`Country & service`),columns:2,fields:[{type:`select`,key:`countryId`,label:R.t(`system.wasteSettingsSources.country`,`Country`),options:[{value:``,label:R.t(`system.wasteSettingsSources.selectCountry`,`Select country…`)},...e.map(e=>({value:e.id,label:e.label}))]},{type:`select`,key:`serviceId`,label:R.t(`system.wasteSettingsSources.service`,`Service`),options:[{value:``,label:n===``?R.t(`system.wasteSettingsSources.pickACountryFirst`,`Pick a country first`):R.t(`system.wasteSettingsSources.selectService`,`Select service…`)},...t.map(e=>({value:e.id,label:e.label}))]}]}]}}function Te({addonId:c,capName:f}){let{t:p}=z(),g=v(),_=l(),y=S(),b=ie({editKey:`wasteEdit`,newKey:`wasteNew`}),[x,C]=o(!1),[w,T]=o(null),[E,D]=o({countryId:``,serviceId:``}),[O,k]=o({label:p(`system.wasteSettingsSources.newSource`,`New source`),enabled:!0}),A=t(null),j=typeof E.countryId==`string`?E.countryId:``,M=typeof E.serviceId==`string`?E.serviceId:``,N=r((e,t)=>g.trpcClient.addons.custom.mutate({addonId:c,action:e,input:t}),[c,g]),P=s({queryKey:[..._e,c],queryFn:async()=>xe(await N(`listSources`,{}))}),ne=s({queryKey:[...ve,c],queryFn:async()=>Se(await N(`listCountries`,{}))}),re=s({queryKey:[`wasteCollections`,`listServices`,c,j],enabled:j!==``,queryFn:async()=>Ce(await N(`listServices`,{countryId:j}))}),L=s({queryKey:[`wasteCollections`,`serviceFormSchema`,c,M],enabled:M!==``,queryFn:async()=>N(`serviceFormSchema`,{serviceId:M})}),R=P.data??[],B=ne.data??[],V=re.data??[],H=be(L.data)?L.data:void 0,U=n(()=>we(B,j===``?[]:V,j),[B,V,j]),W=b.state,G=W.mode===`edit`?R.find(e=>e.id===W.id)??null:null;a(()=>{if(b.state.mode===`edit`&&G!==null){let e=`edit:${G.id}`;if(A.current===e)return;A.current=e,T(null),D({countryId:G.countryId??``,serviceId:G.serviceId??``}),k(G.formValues===void 0?{label:G.label,enabled:G.enabled}:{...G.formValues});return}if(b.state.mode===`new`){if(A.current===`new`)return;A.current=`new`,T(null),D({countryId:``,serviceId:``}),k({label:p(`system.wasteSettingsSources.newSource`,`New source`),enabled:!0})}},[G,b.state]),a(()=>{if(b.state.mode!==`new`||M===``)return;let e=V.find(e=>e.id===M);e&&k(t=>{let n=t.label;return typeof n==`string`&&n!==``&&n!==`New source`?t:{...t,label:e.title}})},[b.state.mode,M,V]);let K=r(e=>{D(t=>{let n=typeof e.countryId==`string`?e.countryId:``;return n===(typeof t.countryId==`string`?t.countryId:``)?e:{countryId:n,serviceId:``}})},[]),q=r(async()=>{await _.invalidateQueries({queryKey:_e})},[_]),J=u({mutationFn:async e=>N(`deleteSource`,{id:e}),onSuccess:async()=>q()}),Y=r(async e=>{await y({title:p(`system.wasteSettingsSources.deleteWasteSource`,`Delete waste source?`),message:p(`system.wasteSettingsSources.removeItsCalendarUnderSystem`,`Remove “{{label}}” ({{id}}). Its calendar under System → Calendars is dropped.`,{label:e.label,id:e.id}),confirmLabel:p(`common.delete`,`Delete`),cancelLabel:p(`common.cancel`,`Cancel`),variant:`danger`})&&(await J.mutateAsync(e.id),b.state.mode===`edit`&&b.state.id===e.id&&(b.close(),A.current=null))},[y,J,b,p]),X=r(async()=>{let e=O.label,t=typeof e==`string`&&e.trim()!==``?e.trim():``;if(t===``){T(`Label is required.`);return}if(M===``){T(`Pick a country and a service.`);return}let n=b.state.mode===`new`,r=G?.id;if(!n&&(r===void 0||r===``)){T(`That source is no longer available.`);return}let i=O.enabled,a={...O};delete a.label,delete a.enabled,C(!0),T(null);try{n?await N(`createSource`,{label:t,serviceId:M,args:a,enabled:typeof i==`boolean`?i:!0}):r!==void 0&&await N(`updateSource`,{id:r,label:t,serviceId:M,args:a,enabled:typeof i==`boolean`?i:!0}),await q(),b.close(),A.current=null}catch(e){T(ye(e))}finally{C(!1)}},[N,G,b,O,q,M]),le=n(()=>[{key:`label`,header:p(`system.wasteSettingsSources.label`,`Label`),sortValue:e=>e.label,render:e=>i(`span`,{className:`text-sm text-foreground`,children:e.label})},{key:`module`,header:p(`system.wasteSettingsSources.module`,`Module`),sortValue:e=>e.module,render:e=>i(`span`,{className:`font-mono text-xs text-foreground-muted`,children:e.module})},{key:`enabled`,header:p(`system.wasteSettingsSources.enabled`,`Enabled`),sortValue:e=>+!!e.enabled,render:e=>i(F,{variant:e.enabled?`success`:`default`,children:e.enabled?p(`system.wasteSettingsSources.on`,`On`):p(`system.wasteSettingsSources.off`,`Off`)})},{key:`actions`,header:``,notSortableReason:`actions`,render:e=>i(I,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":p(`system.wasteSettingsSources.delete`,`Delete {{label}}`,{label:e.label}),"data-testid":`waste-source-delete-${e.id}`,onClick:t=>{t.stopPropagation(),Y(e)},children:i(m,{className:`h-3.5 w-3.5 text-danger`})})}],[Y,p]),Z=b.state.mode===`new`,Q=Z||G!==null,ue=`${M}:${Z?`new`:G?.id??`closed`}`;return e(`div`,{className:`flex min-h-0 flex-col gap-4`,"data-testid":`waste-settings-sources`,children:[e(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[i(`p`,{className:`text-sm text-foreground-muted`,children:p(`system.wasteSettingsSources.pickACountryAndA`,`Pick a country and a service — configuration fields come from that HACS source.`)}),e(I,{type:`button`,size:`sm`,"data-testid":`waste-sources-add`,onClick:()=>b.openNew(),children:[i(h,{className:`h-3.5 w-3.5`}),p(`system.wasteSettingsSources.addSource`,`Add source`)]})]}),P.isError?i(`p`,{className:`text-sm text-danger`,children:p(`system.wasteSettingsSources.couldNotLoadSources`,`Could not load sources.`)}):null,P.isPending?i(te,{className:`h-32 w-full`}):i(ae,{columns:le,rows:R,rowKey:e=>e.id,pageSize:25,emptyMessage:p(`system.wasteSettingsSources.noWasteSourcesYetAdd`,`No waste sources yet. Add one to register a municipal service.`),onRowClick:e=>b.openEdit(e.id),defaultSort:{columnKey:`label`,dir:`asc`}}),i(se,{open:Q,onClose:()=>{b.close(),T(null),A.current=null},title:Z?p(`system.wasteSettingsSources.addWasteSource`,`Add waste source`):p(`system.wasteSettingsSources.edit`,`Edit {{value1}}`,{value1:G?.label??`source`}),icon:ee,width:`xl`,testId:`waste-source-editor`,error:w,footer:i(I,{type:`button`,size:`sm`,disabled:x||M===``,onClick:()=>void X(),children:x?p(`system.wasteSettingsSources.saving`,`Saving…`):p(`common.save`,`Save`)}),children:Q?e(d,{children:[i(`div`,{"data-testid":`waste-country-service`,children:i(oe,{schema:U,values:E,onChange:K},`picker:${j}:${V.length}`)}),M!==``&&H!==void 0?i(oe,{schema:H,values:O,onChange:k,bare:!0},ue):M!==``&&L.isPending?i(`p`,{className:`text-sm text-foreground-muted`,children:p(`system.wasteSettingsSources.loadingFields`,`Loading fields…`)}):i(`p`,{className:`text-sm text-foreground-muted`,children:p(`system.wasteSettingsSources.chooseACountryAndService`,`Choose a country and service to see the required fields.`)})]}):null}),i(ce,{nodeId:`hub`,addonIds:[c],level:`global`,capability:f,hideSectionChrome:!0})]})}c();var $=1e4,Ee={"device-export":`exporters`,exporters:`exporters`,email:`email`,broker:`brokers`,brokers:`brokers`,"message-brokers":`brokers`,calendar:`calendars`,calendars:`calendars`,"calendar-source":`calendars`},De=[{sectionId:`exporters`,kind:`device-export`,labelKey:`system.connectivity.exporters`,icon:y,installLabelKey:`system.connectivity.exportersInstall`,emptyTitleKey:`system.connectivity.exportersEmptyTitle`,emptyDescriptionKey:`system.connectivity.exportersEmptyDescription`},{sectionId:`email`,kind:`email`,labelKey:`system.connectivity.email`,icon:b,installLabelKey:`system.connectivity.emailInstall`,emptyTitleKey:`system.connectivity.emailEmptyTitle`,emptyDescriptionKey:`system.connectivity.emailEmptyDescription`},{sectionId:`brokers`,kind:`broker`,labelKey:`system.connectivity.brokers`,icon:g,installLabelKey:`system.connectivity.brokersInstall`,emptyTitleKey:`system.connectivity.brokersEmptyTitle`,emptyDescriptionKey:`system.connectivity.brokersEmptyDescription`},{sectionId:`calendars`,kind:`calendar`,labelKey:`system.connectivity.calendars`,icon:E,installLabelKey:`system.connectivity.calendarsInstall`,emptyTitleKey:`system.connectivity.calendarsEmptyTitle`,emptyDescriptionKey:`system.connectivity.calendarsEmptyDescription`}];function Oe(t,n,r,a){let o=me(T,t.kind),s=n.flatMap(n=>{let a=he(n,o);if(a===null)return[];let s=ge(n.processState);return[{id:n.addonId,name:n.displayName,fallbackIcon:t.icon,state:s.state,stateLabel:s.label,render:()=>i(Y,{addonId:n.addonId,displayName:n.displayName,capName:a,isActive:n.processState===`running`,badges:e(d,{children:[i(Me,{processState:n.processState}),i(Ne,{kind:t.kind,addonId:n.addonId})]}),lead:t.kind===`device-export`?i(P,{addonId:n.addonId}):void 0,panels:je(t.kind,n.addonId,e=>r(`/devices/${e}`)),settingsContent:n.addonId===`waste-collections`?i(Te,{addonId:n.addonId,capName:a}):void 0})}]});return{id:t.sectionId,label:a(t.labelKey),entries:s,install:{capability:o[0]??t.kind,label:a(t.installLabelKey)}}}function ke({descriptor:e,rows:t,isLoading:r}){let{t:a}=z(),o=U(),s=n(()=>Oe(e,t,o,a),[e,t,o,a]);return i(le,{embedded:!0,icon:e.icon,title:a(e.labelKey),subtitle:null,groups:[s],isLoading:r,emptyTitle:a(e.emptyTitleKey),emptyDescription:a(e.emptyDescriptionKey)})}function Ae(){let{t:e}=z(),t=re(void 0,{refetchInterval:$}),[r,o]=G(),s=W(`/system/integrations`,{t:e,isAdmin:!0})??{icon:f,title:e(`admin.system.integrations.connectivity`,`Connectivity`)};a(()=>{let e=r.get(`tab`);if(e===null)return;let t=Ee[e];t===void 0||t===e||o(e=>{let n=new URLSearchParams(e);return n.set(`tab`,t),n},{replace:!0})},[r,o]);let c=n(()=>(t.data??[]).map(pe).filter(e=>e!==null),[t.data]),l=n(()=>De.map(n=>({id:n.sectionId,label:e(n.labelKey),ownedParams:K,content:i(ke,{descriptor:n,rows:c,isLoading:t.isLoading})})),[t.isLoading,c,e]);return i(J,{icon:s.icon,title:s.title,subtitle:e(`admin.system.integrations.externalSystemsThisHubTalks`,`External systems this hub talks to — exporters, email, brokers and calendar sources.`),defaultSection:`exporters`,sectionsLabel:`Connectivity sections`,sections:l})}function je(e,t,n){return e===`device-export`?[{id:`devices`,title:R.t(`admin.system.integrations.devices`,`Devices`),icon:k,placement:`end`,content:i(M,{addonId:t,onOpenDevice:n,showSetup:!1})}]:e===`broker`?[{id:`connections`,title:R.t(`admin.system.integrations.connections`,`Connections`),icon:g,content:i(de,{addonId:t})}]:[]}function Me({processState:e}){let{state:t,label:n}=ge(e);return i(F,{variant:t===`ok`?`success`:t===`error`?`danger`:`default`,className:`${X} capitalize`,children:n})}function Ne({kind:e,addonId:t}){return e===`broker`?i(Pe,{addonId:t}):e===`device-export`?i(Fe,{addonId:t}):null}function Pe({addonId:e}){let{t}=z(),{data:n}=j({addonId:e},{refetchInterval:$,retry:!1}),r=w.safeParse(n);if(!r.success)return null;let{brokerCount:a,connectedCount:o}=r.data;return i(F,{variant:`info`,className:X,children:o>0?t(`system.connectivity.connectionsConnected`,{count:a,connected:o}):t(`system.connectivity.connections`,{count:a})})}function Fe({addonId:e}){let{t}=z(),{data:n}=L({addonId:e},{refetchInterval:$,retry:!1}),r=C.safeParse(n);if(!r.success)return null;let{linkState:a,exposedDeviceCount:o}=r.data;return i(F,{variant:a===`linked`?`success`:a===`error`?`danger`:`default`,className:X,children:t(`admin.system.integrations.exposed`,`{{linkState}} · {{exposedDeviceCount}} exposed`,{linkState:a,exposedDeviceCount:o})})}export{Ae as IntegrationsPage};
|
|
1
|
+
import{C as e,J as t,K as n,R as r,S as i,V as a,Y as o,a as s,et as c,o as l,t as u,x as d}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Fn as f,Hn as p,Ht as m,In as h,On as g,bt as _,dt as v,hn as y,lr as b,pr as x,st as S}from"./player-overlays-D0HsTHUG.js";import{Ci as C,ba as w,tn as T}from"./client-3nhKn2xf.js";import{_ as E,c as D,s as O}from"./video-Dn2Lqozt.js";import{t as k}from"./monitor-smartphone-DPzM2qXf.js";import{t as ee}from"./recycle-CK0-gO9v.js";import{Ia as A,Lr as te,Ma as j,Mt as M,Na as N,Nt as P,Ra as ne,Ui as re,_t as ie,fi as F,ii as I,kn as ae,oo as L,pr as oe,yt as se}from"./src-D1j-98hX.js";import{t as R}from"./i18n-BTbD-8vc.js";import{t as z}from"./useTranslation-BJr-n0es.js";import{G as B,J as V,K as H,Q as U,b as W,et as G,i as K,q}from"./index-BoU7NTPo.js";import{t as J}from"./AdminSectionedPage-CKX5JkdQ.js";import{t as ce}from"./NodeAddonsSettingsPanel-DYEAw_0K.js";import{n as Y,r as X,t as le}from"./IntegrationHub-C--hpDK-.js";c();var Z={connected:`success`,connecting:`warning`,disconnected:`default`,"auth-failed":`danger`,unreachable:`danger`,error:`danger`};function Q({status:e}){return i(F,{variant:Z[e],className:`text-[10px]`,children:e})}function ue({broker:t,interactiveConnectPath:n,interactiveDisconnectPath:r,kindLabel:a,onEdit:s}){let{t:c}=z(),u=l(),d=S(),[f,h]=o(null),g=ne({onSuccess:e=>h(e.ok?{ok:!0}:{ok:!1,error:e.error}),onError:e=>h({ok:!1,error:e instanceof Error?e.message:String(e)})}),v=A({onSuccess:()=>{u.invalidateQueries({queryKey:[[`broker`,`list`]]})}}),y=async()=>{await d({title:c(`brokers.brokerManager.deleteBroker`,`Delete broker`),message:c(`brokers.brokerManager.deleteBrokerIntegrationsThatDepend`,`Delete broker "{{name}}"? Integrations that depend on it will stop working.`,{name:t.name}),confirmLabel:c(`common.delete`,`Delete`),variant:`danger`})&&v.mutate({id:t.id,addonId:t.addonId})},b=n!==void 0&&n.length>0&&t.status!==`connected`,C=r!==void 0&&r.length>0&&t.status===`connected`;return e(`tr`,{className:`border-b border-border last:border-0`,children:[i(`td`,{className:`px-3 py-2 text-xs text-foreground font-medium`,children:t.name}),i(`td`,{className:`px-3 py-2 text-xs text-foreground-subtle`,children:a}),e(`td`,{className:`px-3 py-2`,children:[i(Q,{status:t.status}),f&&i(`span`,{className:`ml-2 text-[10px] ${f.ok?`text-success`:`text-danger`}`,children:f.ok?`OK`:f.error??c(`common.failedWord`)})]}),i(`td`,{className:`px-3 py-2`,children:e(`div`,{className:`flex items-center justify-end gap-1.5`,children:[b&&e(I,{variant:`primary`,size:`sm`,onClick:()=>{V(n,t.id,()=>{u.invalidateQueries({queryKey:[[`broker`,`list`]]})})},title:c(`brokers.brokerManager.signInOpensAPopup`,`Sign in — opens a popup that closes when done`),children:[i(D,{className:`h-3 w-3`}),` `,c(`brokers.brokerManager.signIn`)]}),C&&e(I,{variant:`outline`,size:`sm`,onClick:()=>{V(r,t.id,()=>{u.invalidateQueries({queryKey:[[`broker`,`list`]]})})},title:c(`brokers.brokerManager.signOutClearsTheLinked`,`Sign out — clears the linked Google account on this broker`),children:[i(O,{className:`h-3 w-3`}),` `,c(`brokers.brokerManager.signOut`)]}),e(I,{variant:`outline`,size:`sm`,onClick:()=>g.mutate({id:t.id,addonId:t.addonId}),disabled:g.isPending,title:c(`brokers.brokerManager.testConnection`,`Test connection`),children:[g.isPending?i(x,{className:`h-3 w-3 animate-spin`}):i(_,{className:`h-3 w-3`}),c(`brokers.brokerManager.test`,`Test`)]}),e(I,{variant:`outline`,size:`sm`,onClick:()=>s(t),title:c(`common.edit`,`Edit`),children:[i(p,{className:`h-3 w-3`}),` `,c(`common.edit`)]}),e(I,{variant:`outline`,size:`sm`,className:`border-danger/40 text-danger hover:bg-danger/10`,onClick:()=>{y()},disabled:v.isPending,title:c(`common.delete`,`Delete`),children:[v.isPending?i(x,{className:`h-3 w-3 animate-spin`}):i(m,{className:`h-3 w-3`}),c(`common.delete`,`Delete`)]})]})})]})}function de({addonId:t}={}){let{t:r}=z(),a=N({}),s=n(()=>H(a.data).filter(e=>t===void 0||e.addonId===t),[a.data,t]),[c,l]=o(!1),[u,d]=o(null),{options:f}=q(t===void 0?{}:{addonId:t}),p=n(()=>new Map(f.map(e=>[e.kind,e.label])),[f]),m=n(()=>{let e=new Map;for(let t of f)e.has(t.kind)||e.set(t.kind,{...t.interactiveConnectPath===void 0?{}:{connect:t.interactiveConnectPath},...t.interactiveDisconnectPath===void 0?{}:{disconnect:t.interactiveDisconnectPath}});return e},[f]);return e(`div`,{className:`space-y-3`,children:[i(`div`,{className:`flex items-center justify-end`,children:e(I,{variant:`primary`,size:`sm`,onClick:()=>l(!0),disabled:f.length===0,title:f.length===0?r(`brokers.brokerManager.noBrokerProvidersAvailable`,`No broker providers available`):void 0,children:[i(h,{className:`h-3.5 w-3.5`}),` `,r(`brokers.brokerManager.addBroker`)]})}),i(`div`,{className:`rounded-lg border border-border bg-surface overflow-x-auto`,children:e(`table`,{className:`w-full min-w-[36rem] border-collapse`,children:[i(`thead`,{children:e(`tr`,{className:`border-b border-border bg-background/50`,children:[i(`th`,{className:`px-3 py-2 text-left text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle`,children:r(`brokers.brokerManager.name`,`Name`)}),i(`th`,{className:`px-3 py-2 text-left text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle`,children:r(`brokers.brokerManager.kind`,`Kind`)}),i(`th`,{className:`px-3 py-2 text-left text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle`,children:r(`brokers.brokerManager.status`,`Status`)}),i(`th`,{className:`px-3 py-2 text-right text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle`,children:r(`brokers.brokerManager.actions`,`Actions`)})]})}),e(`tbody`,{children:[a.isLoading&&i(`tr`,{children:e(`td`,{colSpan:4,className:`px-3 py-6 text-center text-xs text-foreground-subtle`,children:[i(x,{className:`inline h-4 w-4 animate-spin`}),` `,r(`brokers.brokerManager.loadingBrokers`)]})}),a.isError&&i(`tr`,{children:e(`td`,{colSpan:4,className:`px-3 py-4 text-center text-xs text-danger`,children:[r(`brokers.brokerManager.failedToLoadBrokers`,`Failed to load brokers:`),` `,a.error instanceof Error?a.error.message:r(`brokers.brokerManager.unknownError`,`Unknown error`)]})}),!a.isLoading&&!a.isError&&s.length===0&&i(`tr`,{children:i(`td`,{colSpan:4,className:`px-3 py-6 text-center text-xs text-foreground-subtle`,children:r(`brokers.brokerManager.noBrokersRegisteredYetAdd`,`No brokers registered yet. Add one to publish device events for downstream automations.`)})}),s.map(e=>{let t=m.get(e.kind);return i(ue,{broker:e,...t?.connect===void 0?{}:{interactiveConnectPath:t.connect},...t?.disconnect===void 0?{}:{interactiveDisconnectPath:t.disconnect},kindLabel:p.get(e.kind)??e.kind,onEdit:d},e.id)})]})]})}),c&&i(B,{...t===void 0?{}:{addonId:t},onClose:()=>l(!1),onSaved:()=>l(!1)}),u&&i(B,{broker:u,onClose:()=>d(null),onSaved:()=>d(null)})]})}function fe(e){if(typeof e==`string`)return e;if(typeof e==`object`&&e){let t=e.name;if(typeof t==`string`)return t}return null}function pe(e){let t=e,n=t?.manifest;if(n?.id===void 0)return null;let r=(n.capabilities??[]).map(fe).filter(e=>e!==null);return{addonId:n.id,displayName:n.packageDisplayName??n.name??n.id,capNames:r,processState:t?.process?.state??null}}function me(e,t){return Object.entries(e).filter(([,e])=>e===t).map(([e])=>e)}function he(e,t){return t.find(t=>e.capNames.includes(t))??null}function ge(e){switch(e){case`running`:return{state:`ok`,label:R.t(`helpers.connectivityModel.running`)};case`crashed`:case`failed`:return{state:`error`,label:e};case`stopped`:case`disabled`:return{state:`off`,label:R.t(`helpers.connectivityModel.stopped`)};default:return{state:`unknown`,label:e??R.t(`common.unknownWord`)}}}c();var _e=[`wasteCollections`,`listSources`],ve=[`wasteCollections`,`listCountries`];function ye(e){return e instanceof Error?e.message:String(e)}function be(e){return typeof e!=`object`||!e?!1:Array.isArray(Reflect.get(e,`sections`))}function xe(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let e=Reflect.get(n,`id`),r=Reflect.get(n,`label`),i=Reflect.get(n,`module`);if(typeof e!=`string`||typeof r!=`string`||typeof i!=`string`)continue;let a=Reflect.get(n,`enabled`),o=Reflect.get(n,`formValues`),s=Reflect.get(n,`serviceId`),c=Reflect.get(n,`countryId`);t.push({id:e,label:r,module:i,enabled:typeof a==`boolean`?a:!0,formValues:typeof o==`object`&&o&&!Array.isArray(o)?o:void 0,serviceId:typeof s==`string`?s:void 0,countryId:typeof c==`string`?c:void 0})}return t}function Se(e){return Array.isArray(e)?e.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=Reflect.get(e,`id`),n=Reflect.get(e,`label`);return typeof t!=`string`||typeof n!=`string`?[]:[{id:t,label:n}]}):[]}function Ce(e){return Array.isArray(e)?e.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=Reflect.get(e,`id`),n=Reflect.get(e,`label`),r=Reflect.get(e,`module`);if(typeof t!=`string`||typeof n!=`string`||typeof r!=`string`)return[];let i=Reflect.get(e,`title`);return[{id:t,label:n,title:typeof i==`string`&&i.length>0?i:n,module:r}]}):[]}function we(e,t,n){return{sections:[{id:`picker`,title:R.t(`system.wasteSettingsSources.countryService`,`Country & service`),columns:2,fields:[{type:`select`,key:`countryId`,label:R.t(`system.wasteSettingsSources.country`,`Country`),options:[{value:``,label:R.t(`system.wasteSettingsSources.selectCountry`,`Select country…`)},...e.map(e=>({value:e.id,label:e.label}))]},{type:`select`,key:`serviceId`,label:R.t(`system.wasteSettingsSources.service`,`Service`),options:[{value:``,label:n===``?R.t(`system.wasteSettingsSources.pickACountryFirst`,`Pick a country first`):R.t(`system.wasteSettingsSources.selectService`,`Select service…`)},...t.map(e=>({value:e.id,label:e.label}))]}]}]}}function Te({addonId:c,capName:f}){let{t:p}=z(),g=v(),_=l(),y=S(),b=ie({editKey:`wasteEdit`,newKey:`wasteNew`}),[x,C]=o(!1),[w,T]=o(null),[E,D]=o({countryId:``,serviceId:``}),[O,k]=o({label:p(`system.wasteSettingsSources.newSource`,`New source`),enabled:!0}),A=t(null),j=typeof E.countryId==`string`?E.countryId:``,M=typeof E.serviceId==`string`?E.serviceId:``,N=r((e,t)=>g.trpcClient.addons.custom.mutate({addonId:c,action:e,input:t}),[c,g]),P=s({queryKey:[..._e,c],queryFn:async()=>xe(await N(`listSources`,{}))}),ne=s({queryKey:[...ve,c],queryFn:async()=>Se(await N(`listCountries`,{}))}),re=s({queryKey:[`wasteCollections`,`listServices`,c,j],enabled:j!==``,queryFn:async()=>Ce(await N(`listServices`,{countryId:j}))}),L=s({queryKey:[`wasteCollections`,`serviceFormSchema`,c,M],enabled:M!==``,queryFn:async()=>N(`serviceFormSchema`,{serviceId:M})}),R=P.data??[],B=ne.data??[],V=re.data??[],H=be(L.data)?L.data:void 0,U=n(()=>we(B,j===``?[]:V,j),[B,V,j]),W=b.state,G=W.mode===`edit`?R.find(e=>e.id===W.id)??null:null;a(()=>{if(b.state.mode===`edit`&&G!==null){let e=`edit:${G.id}`;if(A.current===e)return;A.current=e,T(null),D({countryId:G.countryId??``,serviceId:G.serviceId??``}),k(G.formValues===void 0?{label:G.label,enabled:G.enabled}:{...G.formValues});return}if(b.state.mode===`new`){if(A.current===`new`)return;A.current=`new`,T(null),D({countryId:``,serviceId:``}),k({label:p(`system.wasteSettingsSources.newSource`,`New source`),enabled:!0})}},[G,b.state]),a(()=>{if(b.state.mode!==`new`||M===``)return;let e=V.find(e=>e.id===M);e&&k(t=>{let n=t.label;return typeof n==`string`&&n!==``&&n!==`New source`?t:{...t,label:e.title}})},[b.state.mode,M,V]);let K=r(e=>{D(t=>{let n=typeof e.countryId==`string`?e.countryId:``;return n===(typeof t.countryId==`string`?t.countryId:``)?e:{countryId:n,serviceId:``}})},[]),q=r(async()=>{await _.invalidateQueries({queryKey:_e})},[_]),J=u({mutationFn:async e=>N(`deleteSource`,{id:e}),onSuccess:async()=>q()}),Y=r(async e=>{await y({title:p(`system.wasteSettingsSources.deleteWasteSource`,`Delete waste source?`),message:p(`system.wasteSettingsSources.removeItsCalendarUnderSystem`,`Remove “{{label}}” ({{id}}). Its calendar under System → Calendars is dropped.`,{label:e.label,id:e.id}),confirmLabel:p(`common.delete`,`Delete`),cancelLabel:p(`common.cancel`,`Cancel`),variant:`danger`})&&(await J.mutateAsync(e.id),b.state.mode===`edit`&&b.state.id===e.id&&(b.close(),A.current=null))},[y,J,b,p]),X=r(async()=>{let e=O.label,t=typeof e==`string`&&e.trim()!==``?e.trim():``;if(t===``){T(`Label is required.`);return}if(M===``){T(`Pick a country and a service.`);return}let n=b.state.mode===`new`,r=G?.id;if(!n&&(r===void 0||r===``)){T(`That source is no longer available.`);return}let i=O.enabled,a={...O};delete a.label,delete a.enabled,C(!0),T(null);try{n?await N(`createSource`,{label:t,serviceId:M,args:a,enabled:typeof i==`boolean`?i:!0}):r!==void 0&&await N(`updateSource`,{id:r,label:t,serviceId:M,args:a,enabled:typeof i==`boolean`?i:!0}),await q(),b.close(),A.current=null}catch(e){T(ye(e))}finally{C(!1)}},[N,G,b,O,q,M]),le=n(()=>[{key:`label`,header:p(`system.wasteSettingsSources.label`,`Label`),sortValue:e=>e.label,render:e=>i(`span`,{className:`text-sm text-foreground`,children:e.label})},{key:`module`,header:p(`system.wasteSettingsSources.module`,`Module`),sortValue:e=>e.module,render:e=>i(`span`,{className:`font-mono text-xs text-foreground-muted`,children:e.module})},{key:`enabled`,header:p(`system.wasteSettingsSources.enabled`,`Enabled`),sortValue:e=>+!!e.enabled,render:e=>i(F,{variant:e.enabled?`success`:`default`,children:e.enabled?p(`system.wasteSettingsSources.on`,`On`):p(`system.wasteSettingsSources.off`,`Off`)})},{key:`actions`,header:``,notSortableReason:`actions`,render:e=>i(I,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":p(`system.wasteSettingsSources.delete`,`Delete {{label}}`,{label:e.label}),"data-testid":`waste-source-delete-${e.id}`,onClick:t=>{t.stopPropagation(),Y(e)},children:i(m,{className:`h-3.5 w-3.5 text-danger`})})}],[Y,p]),Z=b.state.mode===`new`,Q=Z||G!==null,ue=`${M}:${Z?`new`:G?.id??`closed`}`;return e(`div`,{className:`flex min-h-0 flex-col gap-4`,"data-testid":`waste-settings-sources`,children:[e(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[i(`p`,{className:`text-sm text-foreground-muted`,children:p(`system.wasteSettingsSources.pickACountryAndA`,`Pick a country and a service — configuration fields come from that HACS source.`)}),e(I,{type:`button`,size:`sm`,"data-testid":`waste-sources-add`,onClick:()=>b.openNew(),children:[i(h,{className:`h-3.5 w-3.5`}),p(`system.wasteSettingsSources.addSource`,`Add source`)]})]}),P.isError?i(`p`,{className:`text-sm text-danger`,children:p(`system.wasteSettingsSources.couldNotLoadSources`,`Could not load sources.`)}):null,P.isPending?i(te,{className:`h-32 w-full`}):i(ae,{columns:le,rows:R,rowKey:e=>e.id,pageSize:25,emptyMessage:p(`system.wasteSettingsSources.noWasteSourcesYetAdd`,`No waste sources yet. Add one to register a municipal service.`),onRowClick:e=>b.openEdit(e.id),defaultSort:{columnKey:`label`,dir:`asc`}}),i(se,{open:Q,onClose:()=>{b.close(),T(null),A.current=null},title:Z?p(`system.wasteSettingsSources.addWasteSource`,`Add waste source`):p(`system.wasteSettingsSources.edit`,`Edit {{value1}}`,{value1:G?.label??`source`}),icon:ee,width:`xl`,testId:`waste-source-editor`,error:w,footer:i(I,{type:`button`,size:`sm`,disabled:x||M===``,onClick:()=>void X(),children:x?p(`system.wasteSettingsSources.saving`,`Saving…`):p(`common.save`,`Save`)}),children:Q?e(d,{children:[i(`div`,{"data-testid":`waste-country-service`,children:i(oe,{schema:U,values:E,onChange:K},`picker:${j}:${V.length}`)}),M!==``&&H!==void 0?i(oe,{schema:H,values:O,onChange:k,bare:!0},ue):M!==``&&L.isPending?i(`p`,{className:`text-sm text-foreground-muted`,children:p(`system.wasteSettingsSources.loadingFields`,`Loading fields…`)}):i(`p`,{className:`text-sm text-foreground-muted`,children:p(`system.wasteSettingsSources.chooseACountryAndService`,`Choose a country and service to see the required fields.`)})]}):null}),i(ce,{nodeId:`hub`,addonIds:[c],level:`global`,capability:f,hideSectionChrome:!0})]})}c();var $=1e4,Ee={"device-export":`exporters`,exporters:`exporters`,email:`email`,broker:`brokers`,brokers:`brokers`,"message-brokers":`brokers`,calendar:`calendars`,calendars:`calendars`,"calendar-source":`calendars`},De=[{sectionId:`exporters`,kind:`device-export`,labelKey:`system.connectivity.exporters`,icon:y,installLabelKey:`system.connectivity.exportersInstall`,emptyTitleKey:`system.connectivity.exportersEmptyTitle`,emptyDescriptionKey:`system.connectivity.exportersEmptyDescription`},{sectionId:`email`,kind:`email`,labelKey:`system.connectivity.email`,icon:b,installLabelKey:`system.connectivity.emailInstall`,emptyTitleKey:`system.connectivity.emailEmptyTitle`,emptyDescriptionKey:`system.connectivity.emailEmptyDescription`},{sectionId:`brokers`,kind:`broker`,labelKey:`system.connectivity.brokers`,icon:g,installLabelKey:`system.connectivity.brokersInstall`,emptyTitleKey:`system.connectivity.brokersEmptyTitle`,emptyDescriptionKey:`system.connectivity.brokersEmptyDescription`},{sectionId:`calendars`,kind:`calendar`,labelKey:`system.connectivity.calendars`,icon:E,installLabelKey:`system.connectivity.calendarsInstall`,emptyTitleKey:`system.connectivity.calendarsEmptyTitle`,emptyDescriptionKey:`system.connectivity.calendarsEmptyDescription`}];function Oe(t,n,r,a){let o=me(T,t.kind),s=n.flatMap(n=>{let a=he(n,o);if(a===null)return[];let s=ge(n.processState);return[{id:n.addonId,name:n.displayName,fallbackIcon:t.icon,state:s.state,stateLabel:s.label,render:()=>i(Y,{addonId:n.addonId,displayName:n.displayName,capName:a,isActive:n.processState===`running`,badges:e(d,{children:[i(Me,{processState:n.processState}),i(Ne,{kind:t.kind,addonId:n.addonId})]}),lead:t.kind===`device-export`?i(P,{addonId:n.addonId}):void 0,panels:je(t.kind,n.addonId,e=>r(`/devices/${e}`)),settingsContent:n.addonId===`waste-collections`?i(Te,{addonId:n.addonId,capName:a}):void 0})}]});return{id:t.sectionId,label:a(t.labelKey),entries:s,install:{capability:o[0]??t.kind,label:a(t.installLabelKey)}}}function ke({descriptor:e,rows:t,isLoading:r}){let{t:a}=z(),o=U(),s=n(()=>Oe(e,t,o,a),[e,t,o,a]);return i(le,{embedded:!0,icon:e.icon,title:a(e.labelKey),subtitle:null,groups:[s],isLoading:r,emptyTitle:a(e.emptyTitleKey),emptyDescription:a(e.emptyDescriptionKey)})}function Ae(){let{t:e}=z(),t=re(void 0,{refetchInterval:$}),[r,o]=G(),s=W(`/system/integrations`,{t:e,isAdmin:!0})??{icon:f,title:e(`admin.system.integrations.connectivity`,`Connectivity`)};a(()=>{let e=r.get(`tab`);if(e===null)return;let t=Ee[e];t===void 0||t===e||o(e=>{let n=new URLSearchParams(e);return n.set(`tab`,t),n},{replace:!0})},[r,o]);let c=n(()=>(t.data??[]).map(pe).filter(e=>e!==null),[t.data]),l=n(()=>De.map(n=>({id:n.sectionId,label:e(n.labelKey),ownedParams:K,content:i(ke,{descriptor:n,rows:c,isLoading:t.isLoading})})),[t.isLoading,c,e]);return i(J,{icon:s.icon,title:s.title,subtitle:e(`admin.system.integrations.externalSystemsThisHubTalks`,`External systems this hub talks to — exporters, email, brokers and calendar sources.`),defaultSection:`exporters`,sectionsLabel:`Connectivity sections`,sections:l})}function je(e,t,n){return e===`device-export`?[{id:`devices`,title:R.t(`admin.system.integrations.devices`,`Devices`),icon:k,placement:`end`,content:i(M,{addonId:t,onOpenDevice:n,showSetup:!1})}]:e===`broker`?[{id:`connections`,title:R.t(`admin.system.integrations.connections`,`Connections`),icon:g,content:i(de,{addonId:t})}]:[]}function Me({processState:e}){let{state:t,label:n}=ge(e);return i(F,{variant:t===`ok`?`success`:t===`error`?`danger`:`default`,className:`${X} capitalize`,children:n})}function Ne({kind:e,addonId:t}){return e===`broker`?i(Pe,{addonId:t}):e===`device-export`?i(Fe,{addonId:t}):null}function Pe({addonId:e}){let{t}=z(),{data:n}=j({addonId:e},{refetchInterval:$,retry:!1}),r=w.safeParse(n);if(!r.success)return null;let{brokerCount:a,connectedCount:o}=r.data;return i(F,{variant:`info`,className:X,children:o>0?t(`system.connectivity.connectionsConnected`,{count:a,connected:o}):t(`system.connectivity.connections`,{count:a})})}function Fe({addonId:e}){let{t}=z(),{data:n}=L({addonId:e},{refetchInterval:$,retry:!1}),r=C.safeParse(n);if(!r.success)return null;let{linkState:a,exposedDeviceCount:o}=r.data;return i(F,{variant:a===`linked`?`success`:a===`error`?`danger`:`default`,className:X,children:t(`admin.system.integrations.exposed`,`{{linkState}} · {{exposedDeviceCount}} exposed`,{linkState:a,exposedDeviceCount:o})})}export{Ae as IntegrationsPage};
|
|
@@ -1 +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,x as l}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Ai as u,An as d,Di as f,Dn as p,Fi as m,Fn as h,In as g,V as _,dt as v,gn as ee,ki as y,pr as te,vn as b,yr as x}from"./player-overlays-DpZIxQHp.js";import{t as S}from"./table-2-IUuOvuT8.js";import{Ai as ne,As as re,Do as ie,Er as ae,Fs as C,Ft as oe,Io as w,L as se,Lt as ce,Ns as le,Pr as ue,Pt as T,Sr as de,To as E,Tr as fe,Ui as pe,br as me,ii as D,po as he,qd as ge,r as O,ut as k,xr as _e,zd as A}from"./src-KDhMZ5Ob.js";import{t as j}from"./i18n-Bg2ooh3q.js";import{t as M}from"./useTranslation-BJr-n0es.js";import{H as ve,Q as ye,Z as be,et as xe,v as N}from"./index-DGvsu0ui.js";import{t as Se}from"./AdminPage-DmkuRREx.js";import"./useEventInvalidation-2dkiqOI6.js";import{t as Ce}from"./device-integration-icon-BpHHi90B.js";import{i as we,n as Te,r as P,t as Ee}from"./ScanNetworkModal-Cq9BlXXk.js";import{t as F}from"./framework-packages-B7oma9J4.js";s();function I(e){return e.some(e=>e.status===`running`)?`running`:e.some(e=>e.status===`stopped`)?`stopped`:`disabled`}function L(e,t){let n=new Map;for(let t of e){let e=n.get(t.addonId);e===void 0?n.set(t.addonId,[t]):e.push(t)}return[...n.entries()].map(([e,n])=>{let r=t.get(e)?.trim()??``;return{addonId:e,name:r.length>0?r:n[0]?.name??e,instances:n,instanceCount:n.length,deviceCount:n.reduce((e,t)=>e+t.deviceCount,0),status:I(n)}})}function R(e){return e.integrationSection===void 0?F(e.packageName)?`system`:`providers`:e.integrationSection}function z(e){let t=new Set;for(let n of e??[])R(n.manifest)===`system`&&t.add(n.manifest.id);return t}function B(e,t){return{providers:e.filter(e=>!t.has(e.addonId)),system:e.filter(e=>t.has(e.addonId))}}function V(e,t){return[...e].sort((e,n)=>e.name.localeCompare(n.name,t,{sensitivity:`base`}))}function H({kind:t,children:n}){let{t:r}=M(),a=`integrations-section-${t}`;return e(`section`,{"aria-labelledby":a,"data-testid":a,className:`min-w-0 space-y-2`,children:[i(`h2`,{id:a,className:_,children:t===`providers`?r(`integrations.sections.providers`,`Providers`):r(`integrations.sections.system`,`System`)}),n]})}function U({children:e}){return i(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-2 sm:gap-3 lg:grid-cols-3`,children:e})}function W({addonId:t,name:n,openLabel:r,onOpen:a,body:o,footer:s,disabled:c=!1,testId:l,buttonTestId:u}){return e(`article`,{"data-testid":l,className:`relative flex min-w-0 items-stretch gap-3 overflow-x-clip rounded-lg border border-border bg-surface p-3`,children:[i(D,{type:`button`,variant:`ghost`,"aria-label":r,disabled:c,"data-testid":u,onClick:a,className:`absolute inset-0 z-0 h-auto w-auto rounded-lg p-0 focus-visible:ring-2 focus-visible:ring-primary`}),i(`div`,{className:`pointer-events-none relative z-10 flex w-20 shrink-0 items-center justify-center`,children:i(ve,{type:t,size:`xl`})}),e(`div`,{className:`pointer-events-none relative z-10 grid min-w-0 flex-1 grid-rows-[1fr_auto_1fr] gap-1`,children:[i(`p`,{className:`min-w-0 self-start truncate text-sm font-semibold text-foreground`,children:n}),o,i(`div`,{className:`self-end justify-self-start`,children:s})]})]})}function De({providers:t,system:r,onOpen:a,searchPlaceholder:s,emptyLabel:c}){let[l,u]=o(``),d=n(()=>{let e=l.trim().toLowerCase(),n=t=>e.length===0||`${t.name} ${t.addonId} ${t.instances.map(e=>e.name).join(` `)}`.toLowerCase().includes(e);return{providers:t.filter(n),system:r.filter(n)}},[l,t,r]),f=d.providers.length===0&&d.system.length===0;return e(`div`,{className:`space-y-3`,children:[e(`div`,{className:`relative`,children:[i(b,{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,{type:`search`,value:l,onChange:e=>u(e.target.value),placeholder:s,"aria-label":s,className:`pl-8`})]}),f?i(`p`,{className:`py-8 text-center text-xs text-foreground-subtle`,children:c}):e(`div`,{className:`space-y-4`,children:[d.providers.length>0&&i(H,{kind:`providers`,children:i(G,{groups:d.providers,onOpen:a})}),d.system.length>0&&i(H,{kind:`system`,children:i(G,{groups:d.system,onOpen:a})})]})]})}function G({groups:e,onOpen:t}){let{t:r,i18n:a}=M();return i(U,{children:n(()=>V(e,a.language),[e,a.language]).map(e=>i(W,{testId:`integration-card-${e.addonId}`,addonId:e.addonId,name:e.name,openLabel:r(`integrations.openNamed`,{name:e.name,defaultValue:`Open {{name}}`}),onOpen:()=>t(e),body:i(`p`,{className:`text-xs text-foreground-muted`,children:r(`integrations.addonCard.summary`,{integrations:r(`integrations.addonCard.integrationCount`,{count:e.instanceCount}),devices:r(`integrations.integrationColumns.deviceCount`,{count:e.deviceCount}),defaultValue:`{{integrations}} · {{devices}}`})}),footer:i(k,{status:e.status,className:`shrink-0`})},e.addonId))})}s();var K=`camstack.admin.integrations.view`;function q(e){return e===`table`||e===`grid`}function J(){try{return typeof window>`u`?null:window.localStorage}catch{return null}}function Y(e=J()){if(e===null)return`table`;try{let t=e.getItem(K);return q(t)?t:`table`}catch{return`table`}}function X(e,t=J()){if(t!==null)try{t.setItem(K,e)}catch{}}function Oe(){let[e,t]=o(()=>Y());return[e,r(e=>{t(e),X(e)},[])]}s();function ke(e=!0){a(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e])}s();function Ae(e,t){let[n,r]=o(!1);return a(()=>{if(!e){r(!1);return}r(!1);let n=setTimeout(()=>r(!0),t);return()=>clearTimeout(n)},[e,t]),n}s();function je({providerId:t,onImport:n,onSkip:r}){let{t:s}=M(),[c,l]=o(new Set),d=E(),f=d.data,p=d.isPending||!d.data&&!d.isError;a(()=>{t&&(d.isPending||d.data||d.mutate({addonId:t}))},[t,d]);function h(e){l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}if(p)return e(`div`,{className:`flex flex-col items-center py-12`,children:[i(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent`}),i(`p`,{className:`mt-3 text-xs text-foreground-subtle`,children:s(`integrations.searchingDevices`)})]});let g=f??[];return e(`div`,{className:`space-y-4`,children:[i(`p`,{className:`text-xs text-foreground-subtle`,children:g.length>0?s(`integrations.foundDevices`,{count:g.length}):s(`integrations.noDevicesFound`)}),g.length>0&&i(`div`,{className:`space-y-1.5 max-h-64 overflow-y-auto`,children:g.map(t=>{let n=t.stableId,r=t.suggestedName??n,a=c.has(n),o=t.alreadyOnboarded===!0;return e(`button`,{onClick:()=>{o||h(n)},disabled:o,title:o?s(`integrations.alreadyAddedHint`,{defaultValue:`Already added as "{{name}}" — re-adding would overwrite its settings.`,name:t.onboardedName??r}):void 0,className:`flex w-full items-center gap-3 rounded-lg border p-3 text-left transition-colors ${o?`border-border bg-surface opacity-60 cursor-not-allowed`:a?`border-primary/40 bg-primary/5`:`border-border bg-surface hover:border-foreground-subtle/30`}`,children:[i(`div`,{className:`flex h-5 w-5 items-center justify-center rounded border flex-shrink-0 ${a&&!o?`border-primary bg-primary`:`border-border`}`,children:a&&!o&&i(u,{className:`h-3 w-3 text-primary-foreground`})}),i(m,{className:`h-3.5 w-3.5 text-foreground-subtle flex-shrink-0`}),i(`span`,{className:`text-xs font-medium text-foreground truncate`,children:r}),o&&i(`span`,{className:`ml-auto flex-shrink-0 rounded bg-surface-muted px-1.5 py-0.5 text-[10px] font-medium text-foreground-subtle`,children:s(`integrations.alreadyAdded`,{defaultValue:`Already added`})})]},n)})}),e(`div`,{className:`flex items-center justify-between pt-2`,children:[i(`button`,{onClick:r,className:`rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors`,children:s(`integrations.skip`)}),g.length>0&&e(`button`,{onClick:()=>n(Array.from(c)),disabled:c.size===0,className:`rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50`,children:[s(`integrations.importSelected`),` (`,c.size,`)`]})]})]})}var Me=`(hover: none) and (pointer: coarse)`;function Ne(){if(typeof window>`u`||typeof window.matchMedia!=`function`)return!0;try{return!window.matchMedia(Me).matches}catch{return!0}}s();function Pe({onSelect:r,onClose:s,pendingAddonId:c=null}){let{t:l,i18n:u}=M(),d=ye(),[f,p]=o(``),m=t(null),{data:h,isLoading:g}=le();a(()=>{g||!Ne()||m.current?.focus()},[g]);let _=n(()=>{let e=h??[],t=f.trim().toLowerCase();return t.length===0?e:e.filter(e=>`${e.name} ${e.description??``} ${e.addonId}`.toLowerCase().includes(t))},[h,f]),{data:v}=pe(void 0),y=n(()=>{let e=B(_,z(v));return{providers:V(e.providers,u.language),system:V(e.system,u.language)}},[_,v,u.language]);if(g)return i(`div`,{className:`grid grid-cols-1 gap-2 p-2 sm:grid-cols-2 lg:grid-cols-3`,children:[1,2,3,4].map(e=>i(`div`,{className:`h-24 rounded-lg bg-surface animate-pulse`},e))});let x=c!==null,S=t=>i(U,{children:t.map(t=>{let n=t.instanceMode===`unique`&&t.existingInstances.length>0,a=c===t.addonId;return i(W,{testId:`provider-card-${t.addonId}`,buttonTestId:`provider-pick-${t.addonId}`,addonId:t.addonId,name:t.name,openLabel:t.name,disabled:x,onOpen:()=>{if(n){let e=t.existingInstances[0].id;s(),d(N(t.addonId,e))}else r(t.addonId,t.instanceMode,t.discoveryMode,t.name,t.kind,t.brokerKind,t.mode,t.canTest)},body:t.description?i(`p`,{className:`line-clamp-2 text-xs text-foreground-muted`,children:t.description}):i(`span`,{}),footer:a?i(te,{className:`h-4 w-4 animate-spin text-primary`}):n?e(`span`,{className:`flex items-center gap-1 text-xs font-medium text-foreground-subtle`,children:[i(ee,{className:`h-3 w-3`}),l(`integrations.manage`)]}):null},t.addonId)})});return e(`div`,{className:`space-y-3`,"data-testid":`provider-picker`,children:[e(`div`,{className:`relative`,children:[i(b,{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,{ref:m,type:`search`,value:f,onChange:e=>p(e.target.value),placeholder:l(`integrations.searchProviders`,`Search integrations…`),className:`pl-8`,"data-testid":`provider-picker-search`,"aria-label":l(`integrations.searchProviders`,`Search integrations…`)})]}),y.providers.length>0&&i(H,{kind:`providers`,children:S(y.providers)}),y.system.length>0&&i(H,{kind:`system`,children:S(y.system)}),_.length===0&&i(`div`,{className:`py-8 text-center text-xs text-foreground-subtle`,children:(h??[]).length===0?l(`integrations.noProviders`):l(`integrations.noProvidersMatch`,`No integrations match your search.`)})]})}s();function Fe(e){let t=e=>{if(e.type===`separator`||e.type===`info`||e.type===`button`)return e;if(e.type===`group`)return{...e,fields:e.fields.map(e=>t(e))};let{value:n,...r}=e;return r};return{...e.tabs?{tabs:e.tabs}:{},sections:e.sections.map(e=>({...e,fields:e.fields.map(t)}))}}var Ie=2e4;function Z({open:t,onClose:r,seed:s=null}){let{t:u}=M(),d=ye(),f=c(),[p,m]=o(`picker`),[h,g]=o(null),[_,v]=o(null),[ee,y]=o(`manual`),[b,x]=o(null),[S,C]=o(``),[oe,w]=o(null),[se,ce]=o(null),[ue,T]=o(!1),[pe,D]=o({}),[ge,O]=o(``),[k,A]=o(!1),[j,ve]=o(0),[be,xe]=o(``),Se=ie({},{enabled:t&&p===`config`}),Ce=h!==null&&(Se.data?.providers??[]).some(e=>e.addonId===h),Te=s?.config.host,F=s===null?``:`${s.addonId}\0${s.name}\0${typeof Te==`string`?Te:``}`;t&&s!==null&&ge!==F&&(O(F),g(s.addonId),C(s.name),D({...s.config}),m(`config`));let I=le(void 0,{enabled:t&&s!==null}),{data:L}=ne({addonId:h??``,nodeId:`hub`},{enabled:h!=null}),R=n(()=>L?Fe(L):null,[L]),z=re({onSuccess:()=>f.invalidateQueries({queryKey:[[`integrations`]]})}),B=E(),V=B.data;a(()=>{if(!t||s===null)return;let e=I.data?.find(e=>e.addonId===s.addonId);e&&(T(e.canTest),y(e.discoveryMode))},[t,s,I.data]),a(()=>{p!==`discovery`||!_||!h||B.isPending||B.data||B.mutate({addonId:h})},[p,_,h,B]);let H=he({onSuccess:()=>f.invalidateQueries({queryKey:[[`deviceManager`]]})});function U(e,t,n,r,i,a,o,s){if(!z.isPending){if(g(e),T(s),y(n),C(r),ce(null),z.reset(),o===`broker`){if(!a){ce(`Addon '${e}' declares mode 'broker' but no brokerKind in its manifest`);return}x(a),m(`broker`);return}if(o===`account`){m(`config`);return}W(e,r)}}async function W(e,t){try{let n=await z.mutateAsync({addonId:e,name:t,settings:{}});r(),J(),d(`${N(e,n.id)}&add=1`)}catch{}}async function De(e){if(h)try{let t=await z.mutateAsync({addonId:h,name:e.name,settings:e.config,secretKeys:[...e.secretKeys]});v(t.id),w(t.id),ee===`auto`||ee===`both`?m(`discovery`):q(t.id,{openAdd:!0})}catch{}}async function G(e){if(h)try{let t=await z.mutateAsync({addonId:h,name:S,settings:{brokerId:e}});w(t.id),v(t.id),q(t.id)}catch{}}async function K(e){if(h){for(let t of e){let e=V?.find(e=>e.stableId===t);e&&await H.mutateAsync({addonId:h,candidate:e,...oe===null?{}:{integrationId:oe}})}q()}}function q(e,t){let n=e??_??h;if(r(),J(),n&&h){let e=N(h,n);d(t?.openAdd===!0?`${e}&add=1`:e)}}function J(){m(`picker`),g(null),v(null),y(`manual`),x(null),C(``),w(null),ce(null),z.reset(),T(!1),D({}),O(``)}function Y(){r(),J()}ke(t);let X=z.isPending,Oe=Ae(X,Ie);if(!t)return null;let Me={picker:u(`integrations.newIntegration`),config:u(`integrations.configureIntegration`),discovery:u(`integrations.importDevices`),broker:u(`integrations.connectBroker`,{defaultValue:`Connect a broker`})},Ne=X?h:null,Z=z.error,Le=X&&!Oe;return e(l,{children:[i(me,{open:!0,onOpenChange:e=>{!e&&!Le&&Y()},children:e(de,{width:p===`picker`?`xl`:`lg`,scroll:`body`,onCancel:e=>{Le&&e.preventDefault()},children:[i(fe,{children:i(ae,{children:Me[p]})}),e(_e,{children:[Z&&!X&&i(`div`,{className:`mb-3 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:Z instanceof Error?Z.message:String(Z)}),p===`picker`&&e(l,{children:[se&&i(`div`,{className:`mb-3 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:se}),i(Pe,{onSelect:U,onClose:Y,pendingAddonId:Ne})]}),p===`config`&&h&&i(P,{addonId:h,configSchema:R??null,canTest:ue,initialName:S.length>0&&Object.keys(pe).length>0?S:void 0,initialConfig:{...pe},onScan:Ce?()=>{xe(S.length>0?S:h),A(!0)}:void 0,onSave:De,onBack:()=>{D({}),m(`picker`)}},`${F.length>0?F:h}:${j}`),p===`broker`&&b&&i(we,{kind:b,onResolved:e=>{G(e)},onBack:()=>m(`picker`)}),p===`discovery`&&_&&i(je,{providerId:_,onImport:K,onSkip:q})]}),X&&e(`div`,{className:`absolute inset-0 z-20 flex flex-col items-center justify-center gap-2 rounded-lg bg-background/85 backdrop-blur-sm px-6 text-center`,children:[i(te,{className:`h-6 w-6 animate-spin text-primary`}),i(`p`,{className:`text-xs font-medium text-foreground`,children:u(`integrations.creating`,{defaultValue:`Creating integration…`})}),!Oe&&i(`p`,{className:`text-[10px] text-foreground-subtle`,children:u(`integrations.creatingHint`,{defaultValue:`Waiting for the addon to restart and register`})}),Oe&&e(l,{children:[i(`p`,{className:`text-[10px] text-foreground-subtle max-w-xs`,children:u(`integrations.creatingOverdue`,{defaultValue:`This is taking longer than expected. The integration may already have been created — close this dialog and refresh to check.`})}),i(`button`,{onClick:Y,className:`mt-1 rounded-md border border-border bg-surface px-3 py-1.5 text-[11px] font-medium text-foreground hover:bg-surface-hover transition-colors`,children:u(`integrations.closeAndRefresh`,{defaultValue:`Close`})})]})]})]})}),k&&h!==null&&i(Ee,{open:k,scope:{addonId:h,label:be},pickMode:`fill`,onClose:()=>A(!1),onSetupIntegration:e=>{C(e.name),D({...e.config}),ve(e=>e+1)}})]})}function Le({integration:t,expanded:n,onToggleExpand:r}){let{t:a}=M();return e(`div`,{className:`flex items-center gap-2.5`,children:[i(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),r(t.addonId)},"aria-label":n?a(`integrations.integrationColumns.collapse`,`Collapse`):a(`integrations.integrationColumns.expand`,`Expand`),"aria-expanded":n,className:`flex h-5 w-5 flex-shrink-0 items-center justify-center rounded text-foreground-subtle transition-colors hover:bg-surface-hover hover:text-foreground`,children:i(n?y:f,{className:`h-3.5 w-3.5`})}),i(ve,{type:t.addonId,size:`sm`}),e(`div`,{className:`flex min-w-0 flex-col`,children:[i(`span`,{className:`truncate text-xs font-semibold text-foreground`,children:t.name}),i(`span`,{className:`truncate text-[10px] text-foreground-subtle`,children:t.addonId})]})]})}function Re(e){let{isExpanded:t,onToggleExpand:n}=e;return[{key:`name`,header:j.t(`integrations.integrationColumns.integration`,`Integration`),headerClassName:`w-[55%]`,cell:e=>i(Le,{integration:e,expanded:t(e),onToggleExpand:n})},{key:`devices`,header:j.t(`integrations.integrationColumns.devices`,`Devices`),headerClassName:`w-[15%]`,cellClassName:`text-[11px] text-foreground-subtle`,cell:e=>j.t(`integrations.integrationColumns.deviceCount`,{count:e.deviceCount})},{key:`status`,header:j.t(`integrations.integrationColumns.status`,`Status`),headerClassName:`w-[15%]`,cell:e=>i(k,{status:e.status})}]}s();function ze(e){if(!e.enabled)return`disabled`;switch(e.processState){case`running`:return`running`;default:return`stopped`}}var Be=`expand`;function Ve(){let{t}=M(),s=ye(),c=be(),u=v(),[f]=xe(),[m,_]=Oe(),[ee,y]=o(!1),[te,b]=o(null),ne=r(()=>{b(null),y(!0)},[]),re=r(()=>{y(!1),b(null)},[]),ie=r(e=>{de(!1),b(e),y(!0)},[]),[ae,de]=o(!1);a(()=>{let e=Te(c.state);e!==null&&(b(e),y(!0),s(`/integrations`,{replace:!0,state:null}))},[c.state,s]);let E=f.get(`setup`);a(()=>{E===null||E.length===0||(b({addonId:E,name:E,config:{}}),y(!0))},[E]);let fe=r(()=>de(!0),[]),me=r(()=>de(!1),[]);O([`integrations`],[`integration.enabled`,`integration.disabled`,`integration.deleted`,`provider.started`,`provider.stopped`,`addon.installed`,`addon.uninstalled`,`addon.started`,`addon.stopped`,`addon.updated`]),O([`deviceManager`],[`device.registered`,`device.unregistered`,`device.online`,`device.offline`,`device.disabled`,`device.enabled`]);let{data:D,isLoading:he,isError:k,refetch:_e}=C(void 0),{data:A,isLoading:j,isError:ve,refetch:we}=w({projection:`slim`}),P=n(()=>A??[],[A]),F=n(()=>D??[],[D]),I=n(()=>{let e=new Map;for(let t of P)e.set(t.id,{id:t.id,name:t.name??t.stableId??`#${String(t.id)}`});return e},[P]),R=n(()=>oe(D),[D]),V=n(()=>{let e=new Map;for(let t of ce(P)){let n=R(t);if(n.kind!==`resolved`)continue;let r=n.integration.id;e.set(r,(e.get(r)??0)+1)}return e},[P,R]),U=n(()=>F.map(e=>({id:e.id,addonId:e.addonId,name:e.name,enabled:e.enabled,status:ze(e),deviceCount:V.get(e.id)??0})),[F,V]),{data:W}=le(),G=n(()=>new Map((W??[]).map(e=>[e.addonId,e.name])),[W]),K=f.get(Be),q=r(e=>{let t=new URLSearchParams(window.location.search);t.get(Be)===e?t.delete(Be):t.set(Be,e);let n=t.toString(),r=`${window.location.pathname}${n?`?${n}`:``}${window.location.hash}`;window.history.replaceState(window.history.state,``,r),window.dispatchEvent(new PopStateEvent(`popstate`))},[]),{data:J}=pe(void 0),Y=n(()=>z(J),[J]),X=n(()=>B(U,Y),[U,Y]),ke=n(()=>B(L(U,G),Y),[U,G,Y]),Ae=r(e=>s(N(e.addonId)),[s]),je=r(e=>s(N(e.addonId,e.id)),[s]),Me=r(e=>I.get(e)??null,[I]),Ne=r(e=>s(`/devices/${String(e)}`),[s]),Pe=r(e=>i(T,{context:`integration-detail`,devices:P,trpc:u.trpcClient,integrationOf:R,forceIntegrationId:e.id,urlScope:`nested`,lsKey:`integrations:nested:${e.addonId}`,resolveIntegrationIcon:Ce,resolveParent:Me,onNavigate:Ne}),[P,u.trpcClient,R,Me,Ne]),Fe=r(e=>K===e.addonId,[K]),Ie=n(()=>Re({isExpanded:Fe,onToggleExpand:q}),[Fe,q]),Le=r(e=>`${e.name} ${e.addonId}`,[]),Ve=r(e=>e.id,[]),He=e=>i(T,{mode:`generic`,items:e,getKey:Ve,getSearchText:Le,columns:Ie,onRowClick:je,isExpanded:Fe,renderExpanded:Pe,searchPlaceholder:t(`integrations.search`,{defaultValue:`Search integrations…`}),emptyLabel:t(`integrations.empty`,{defaultValue:`No integrations found.`})}),Ue=r(()=>{_e(),we()},[_e,we]),Q=k===!0||ve===!0,$=!Q&&(he||j||D===void 0||A===void 0),We=F.length>0,Ge=[{id:`table`,label:t(`integrations.viewTable`,`Table`),icon:S},{id:`grid`,label:t(`integrations.viewGrid`,`Grid`),icon:x}];return e(Se,{icon:h,title:t(`nav.integrations`,`Integrations`),actions:e(l,{children:[i(se,{ariaLabel:t(`integrations.viewLabel`,`Layout`),value:m,onChange:_,options:Ge,testId:`integrations-view`}),i(`button`,{onClick:Ue,disabled:$,className:`flex items-center gap-1 rounded-lg border border-border bg-surface px-2.5 py-1.5 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50`,title:t(`common.refresh`,`Refresh`),children:i(p,{className:ge(`h-3.5 w-3.5`,$&&`animate-spin`)})}),e(`button`,{onClick:fe,className:`flex items-center gap-1.5 rounded-lg border border-border bg-surface px-2.5 py-1.5 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,title:t(`integrations.scanTheLocalNetworkFor`,`Scan the local network for devices`),children:[i(d,{className:`h-3.5 w-3.5`}),t(`integrations.scanNetwork`,`Scan network`)]}),e(`button`,{onClick:ne,className:`flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground shadow-sm`,children:[i(g,{className:`h-3.5 w-3.5`}),t(`integrations.newIntegration`,`New Integration`)]})]}),children:[Q&&i(ue,{message:t(`integrations.loadFailed`,`Integrations could not be loaded.`),onRetry:Ue}),$&&i(`div`,{className:`space-y-2`,"data-testid":`integrations-pending`,children:[1,2,3].map(e=>i(`div`,{className:`h-12 rounded-lg border border-border bg-surface animate-pulse`},e))}),!Q&&!$&&!We&&e(`div`,{className:`flex flex-col items-center py-20 text-foreground-subtle`,children:[i(`p`,{className:`text-sm`,children:t(`integrations.noIntegrationsConfigured`,`No integrations configured.`)}),i(`p`,{className:`text-xs mt-1`,children:t(`integrations.clickNewIntegrationToConnect`,`Click "New Integration" to connect cameras and devices.`)})]}),!Q&&!$&&We&&m===`table`&&e(`div`,{className:`space-y-4`,children:[X.providers.length>0&&i(H,{kind:`providers`,children:He(X.providers)}),X.system.length>0&&i(H,{kind:`system`,children:He(X.system)})]}),!Q&&!$&&We&&m===`grid`&&i(De,{providers:ke.providers,system:ke.system,onOpen:Ae,searchPlaceholder:t(`integrations.search`,{defaultValue:`Search integrations…`}),emptyLabel:t(`integrations.empty`,{defaultValue:`No integrations found.`})}),i(Z,{open:ee,onClose:re,seed:te}),i(Ee,{open:ae,onClose:me,onSetupIntegration:ie})]})}export{Ve as IntegrationsPage};
|
|
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,x as l}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Ai as u,An as d,Di as f,Dn as p,Fi as m,Fn as h,In as g,V as _,dt as v,gn as ee,ki as y,pr as te,vn as b,yr as x}from"./player-overlays-D0HsTHUG.js";import{t as S}from"./table-2-Bx38akVK.js";import{Ai as ne,As as re,Do as ie,Er as ae,Fs as C,Ft as oe,Io as w,L as se,Lt as ce,Ns as le,Pr as ue,Pt as T,Sr as de,To as E,Tr as fe,Ui as pe,br as me,ii as D,po as he,qd as ge,r as O,ut as k,xr as _e,zd as A}from"./src-D1j-98hX.js";import{t as j}from"./i18n-BTbD-8vc.js";import{t as M}from"./useTranslation-BJr-n0es.js";import{H as ve,Q as ye,Z as be,et as xe,v as N}from"./index-BoU7NTPo.js";import{t as Se}from"./AdminPage-D2S65e6Q.js";import"./useEventInvalidation-yyadLjpT.js";import{t as Ce}from"./device-integration-icon-DXsx1ovH.js";import{i as we,n as Te,r as P,t as Ee}from"./ScanNetworkModal-CvlBpDgq.js";import{t as F}from"./framework-packages-B7oma9J4.js";s();function I(e){return e.some(e=>e.status===`running`)?`running`:e.some(e=>e.status===`stopped`)?`stopped`:`disabled`}function L(e,t){let n=new Map;for(let t of e){let e=n.get(t.addonId);e===void 0?n.set(t.addonId,[t]):e.push(t)}return[...n.entries()].map(([e,n])=>{let r=t.get(e)?.trim()??``;return{addonId:e,name:r.length>0?r:n[0]?.name??e,instances:n,instanceCount:n.length,deviceCount:n.reduce((e,t)=>e+t.deviceCount,0),status:I(n)}})}function R(e){return e.integrationSection===void 0?F(e.packageName)?`system`:`providers`:e.integrationSection}function z(e){let t=new Set;for(let n of e??[])R(n.manifest)===`system`&&t.add(n.manifest.id);return t}function B(e,t){return{providers:e.filter(e=>!t.has(e.addonId)),system:e.filter(e=>t.has(e.addonId))}}function V(e,t){return[...e].sort((e,n)=>e.name.localeCompare(n.name,t,{sensitivity:`base`}))}function H({kind:t,children:n}){let{t:r}=M(),a=`integrations-section-${t}`;return e(`section`,{"aria-labelledby":a,"data-testid":a,className:`min-w-0 space-y-2`,children:[i(`h2`,{id:a,className:_,children:t===`providers`?r(`integrations.sections.providers`,`Providers`):r(`integrations.sections.system`,`System`)}),n]})}function U({children:e}){return i(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-2 sm:gap-3 lg:grid-cols-3`,children:e})}function W({addonId:t,name:n,openLabel:r,onOpen:a,body:o,footer:s,disabled:c=!1,testId:l,buttonTestId:u}){return e(`article`,{"data-testid":l,className:`relative flex min-w-0 items-stretch gap-3 overflow-x-clip rounded-lg border border-border bg-surface p-3`,children:[i(D,{type:`button`,variant:`ghost`,"aria-label":r,disabled:c,"data-testid":u,onClick:a,className:`absolute inset-0 z-0 h-auto w-auto rounded-lg p-0 focus-visible:ring-2 focus-visible:ring-primary`}),i(`div`,{className:`pointer-events-none relative z-10 flex w-20 shrink-0 items-center justify-center`,children:i(ve,{type:t,size:`xl`})}),e(`div`,{className:`pointer-events-none relative z-10 grid min-w-0 flex-1 grid-rows-[1fr_auto_1fr] gap-1`,children:[i(`p`,{className:`min-w-0 self-start truncate text-sm font-semibold text-foreground`,children:n}),o,i(`div`,{className:`self-end justify-self-start`,children:s})]})]})}function De({providers:t,system:r,onOpen:a,searchPlaceholder:s,emptyLabel:c}){let[l,u]=o(``),d=n(()=>{let e=l.trim().toLowerCase(),n=t=>e.length===0||`${t.name} ${t.addonId} ${t.instances.map(e=>e.name).join(` `)}`.toLowerCase().includes(e);return{providers:t.filter(n),system:r.filter(n)}},[l,t,r]),f=d.providers.length===0&&d.system.length===0;return e(`div`,{className:`space-y-3`,children:[e(`div`,{className:`relative`,children:[i(b,{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,{type:`search`,value:l,onChange:e=>u(e.target.value),placeholder:s,"aria-label":s,className:`pl-8`})]}),f?i(`p`,{className:`py-8 text-center text-xs text-foreground-subtle`,children:c}):e(`div`,{className:`space-y-4`,children:[d.providers.length>0&&i(H,{kind:`providers`,children:i(G,{groups:d.providers,onOpen:a})}),d.system.length>0&&i(H,{kind:`system`,children:i(G,{groups:d.system,onOpen:a})})]})]})}function G({groups:e,onOpen:t}){let{t:r,i18n:a}=M();return i(U,{children:n(()=>V(e,a.language),[e,a.language]).map(e=>i(W,{testId:`integration-card-${e.addonId}`,addonId:e.addonId,name:e.name,openLabel:r(`integrations.openNamed`,{name:e.name,defaultValue:`Open {{name}}`}),onOpen:()=>t(e),body:i(`p`,{className:`text-xs text-foreground-muted`,children:r(`integrations.addonCard.summary`,{integrations:r(`integrations.addonCard.integrationCount`,{count:e.instanceCount}),devices:r(`integrations.integrationColumns.deviceCount`,{count:e.deviceCount}),defaultValue:`{{integrations}} · {{devices}}`})}),footer:i(k,{status:e.status,className:`shrink-0`})},e.addonId))})}s();var K=`camstack.admin.integrations.view`;function q(e){return e===`table`||e===`grid`}function J(){try{return typeof window>`u`?null:window.localStorage}catch{return null}}function Y(e=J()){if(e===null)return`table`;try{let t=e.getItem(K);return q(t)?t:`table`}catch{return`table`}}function X(e,t=J()){if(t!==null)try{t.setItem(K,e)}catch{}}function Oe(){let[e,t]=o(()=>Y());return[e,r(e=>{t(e),X(e)},[])]}s();function ke(e=!0){a(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e])}s();function Ae(e,t){let[n,r]=o(!1);return a(()=>{if(!e){r(!1);return}r(!1);let n=setTimeout(()=>r(!0),t);return()=>clearTimeout(n)},[e,t]),n}s();function je({providerId:t,onImport:n,onSkip:r}){let{t:s}=M(),[c,l]=o(new Set),d=E(),f=d.data,p=d.isPending||!d.data&&!d.isError;a(()=>{t&&(d.isPending||d.data||d.mutate({addonId:t}))},[t,d]);function h(e){l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}if(p)return e(`div`,{className:`flex flex-col items-center py-12`,children:[i(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent`}),i(`p`,{className:`mt-3 text-xs text-foreground-subtle`,children:s(`integrations.searchingDevices`)})]});let g=f??[];return e(`div`,{className:`space-y-4`,children:[i(`p`,{className:`text-xs text-foreground-subtle`,children:g.length>0?s(`integrations.foundDevices`,{count:g.length}):s(`integrations.noDevicesFound`)}),g.length>0&&i(`div`,{className:`space-y-1.5 max-h-64 overflow-y-auto`,children:g.map(t=>{let n=t.stableId,r=t.suggestedName??n,a=c.has(n),o=t.alreadyOnboarded===!0;return e(`button`,{onClick:()=>{o||h(n)},disabled:o,title:o?s(`integrations.alreadyAddedHint`,{defaultValue:`Already added as "{{name}}" — re-adding would overwrite its settings.`,name:t.onboardedName??r}):void 0,className:`flex w-full items-center gap-3 rounded-lg border p-3 text-left transition-colors ${o?`border-border bg-surface opacity-60 cursor-not-allowed`:a?`border-primary/40 bg-primary/5`:`border-border bg-surface hover:border-foreground-subtle/30`}`,children:[i(`div`,{className:`flex h-5 w-5 items-center justify-center rounded border flex-shrink-0 ${a&&!o?`border-primary bg-primary`:`border-border`}`,children:a&&!o&&i(u,{className:`h-3 w-3 text-primary-foreground`})}),i(m,{className:`h-3.5 w-3.5 text-foreground-subtle flex-shrink-0`}),i(`span`,{className:`text-xs font-medium text-foreground truncate`,children:r}),o&&i(`span`,{className:`ml-auto flex-shrink-0 rounded bg-surface-muted px-1.5 py-0.5 text-[10px] font-medium text-foreground-subtle`,children:s(`integrations.alreadyAdded`,{defaultValue:`Already added`})})]},n)})}),e(`div`,{className:`flex items-center justify-between pt-2`,children:[i(`button`,{onClick:r,className:`rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors`,children:s(`integrations.skip`)}),g.length>0&&e(`button`,{onClick:()=>n(Array.from(c)),disabled:c.size===0,className:`rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50`,children:[s(`integrations.importSelected`),` (`,c.size,`)`]})]})]})}var Me=`(hover: none) and (pointer: coarse)`;function Ne(){if(typeof window>`u`||typeof window.matchMedia!=`function`)return!0;try{return!window.matchMedia(Me).matches}catch{return!0}}s();function Pe({onSelect:r,onClose:s,pendingAddonId:c=null}){let{t:l,i18n:u}=M(),d=ye(),[f,p]=o(``),m=t(null),{data:h,isLoading:g}=le();a(()=>{g||!Ne()||m.current?.focus()},[g]);let _=n(()=>{let e=h??[],t=f.trim().toLowerCase();return t.length===0?e:e.filter(e=>`${e.name} ${e.description??``} ${e.addonId}`.toLowerCase().includes(t))},[h,f]),{data:v}=pe(void 0),y=n(()=>{let e=B(_,z(v));return{providers:V(e.providers,u.language),system:V(e.system,u.language)}},[_,v,u.language]);if(g)return i(`div`,{className:`grid grid-cols-1 gap-2 p-2 sm:grid-cols-2 lg:grid-cols-3`,children:[1,2,3,4].map(e=>i(`div`,{className:`h-24 rounded-lg bg-surface animate-pulse`},e))});let x=c!==null,S=t=>i(U,{children:t.map(t=>{let n=t.instanceMode===`unique`&&t.existingInstances.length>0,a=c===t.addonId;return i(W,{testId:`provider-card-${t.addonId}`,buttonTestId:`provider-pick-${t.addonId}`,addonId:t.addonId,name:t.name,openLabel:t.name,disabled:x,onOpen:()=>{if(n){let e=t.existingInstances[0].id;s(),d(N(t.addonId,e))}else r(t.addonId,t.instanceMode,t.discoveryMode,t.name,t.kind,t.brokerKind,t.mode,t.canTest)},body:t.description?i(`p`,{className:`line-clamp-2 text-xs text-foreground-muted`,children:t.description}):i(`span`,{}),footer:a?i(te,{className:`h-4 w-4 animate-spin text-primary`}):n?e(`span`,{className:`flex items-center gap-1 text-xs font-medium text-foreground-subtle`,children:[i(ee,{className:`h-3 w-3`}),l(`integrations.manage`)]}):null},t.addonId)})});return e(`div`,{className:`space-y-3`,"data-testid":`provider-picker`,children:[e(`div`,{className:`relative`,children:[i(b,{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,{ref:m,type:`search`,value:f,onChange:e=>p(e.target.value),placeholder:l(`integrations.searchProviders`,`Search integrations…`),className:`pl-8`,"data-testid":`provider-picker-search`,"aria-label":l(`integrations.searchProviders`,`Search integrations…`)})]}),y.providers.length>0&&i(H,{kind:`providers`,children:S(y.providers)}),y.system.length>0&&i(H,{kind:`system`,children:S(y.system)}),_.length===0&&i(`div`,{className:`py-8 text-center text-xs text-foreground-subtle`,children:(h??[]).length===0?l(`integrations.noProviders`):l(`integrations.noProvidersMatch`,`No integrations match your search.`)})]})}s();function Fe(e){let t=e=>{if(e.type===`separator`||e.type===`info`||e.type===`button`)return e;if(e.type===`group`)return{...e,fields:e.fields.map(e=>t(e))};let{value:n,...r}=e;return r};return{...e.tabs?{tabs:e.tabs}:{},sections:e.sections.map(e=>({...e,fields:e.fields.map(t)}))}}var Ie=2e4;function Z({open:t,onClose:r,seed:s=null}){let{t:u}=M(),d=ye(),f=c(),[p,m]=o(`picker`),[h,g]=o(null),[_,v]=o(null),[ee,y]=o(`manual`),[b,x]=o(null),[S,C]=o(``),[oe,w]=o(null),[se,ce]=o(null),[ue,T]=o(!1),[pe,D]=o({}),[ge,O]=o(``),[k,A]=o(!1),[j,ve]=o(0),[be,xe]=o(``),Se=ie({},{enabled:t&&p===`config`}),Ce=h!==null&&(Se.data?.providers??[]).some(e=>e.addonId===h),Te=s?.config.host,F=s===null?``:`${s.addonId}\0${s.name}\0${typeof Te==`string`?Te:``}`;t&&s!==null&&ge!==F&&(O(F),g(s.addonId),C(s.name),D({...s.config}),m(`config`));let I=le(void 0,{enabled:t&&s!==null}),{data:L}=ne({addonId:h??``,nodeId:`hub`},{enabled:h!=null}),R=n(()=>L?Fe(L):null,[L]),z=re({onSuccess:()=>f.invalidateQueries({queryKey:[[`integrations`]]})}),B=E(),V=B.data;a(()=>{if(!t||s===null)return;let e=I.data?.find(e=>e.addonId===s.addonId);e&&(T(e.canTest),y(e.discoveryMode))},[t,s,I.data]),a(()=>{p!==`discovery`||!_||!h||B.isPending||B.data||B.mutate({addonId:h})},[p,_,h,B]);let H=he({onSuccess:()=>f.invalidateQueries({queryKey:[[`deviceManager`]]})});function U(e,t,n,r,i,a,o,s){if(!z.isPending){if(g(e),T(s),y(n),C(r),ce(null),z.reset(),o===`broker`){if(!a){ce(`Addon '${e}' declares mode 'broker' but no brokerKind in its manifest`);return}x(a),m(`broker`);return}if(o===`account`){m(`config`);return}W(e,r)}}async function W(e,t){try{let n=await z.mutateAsync({addonId:e,name:t,settings:{}});r(),J(),d(`${N(e,n.id)}&add=1`)}catch{}}async function De(e){if(h)try{let t=await z.mutateAsync({addonId:h,name:e.name,settings:e.config,secretKeys:[...e.secretKeys]});v(t.id),w(t.id),ee===`auto`||ee===`both`?m(`discovery`):q(t.id,{openAdd:!0})}catch{}}async function G(e){if(h)try{let t=await z.mutateAsync({addonId:h,name:S,settings:{brokerId:e}});w(t.id),v(t.id),q(t.id)}catch{}}async function K(e){if(h){for(let t of e){let e=V?.find(e=>e.stableId===t);e&&await H.mutateAsync({addonId:h,candidate:e,...oe===null?{}:{integrationId:oe}})}q()}}function q(e,t){let n=e??_??h;if(r(),J(),n&&h){let e=N(h,n);d(t?.openAdd===!0?`${e}&add=1`:e)}}function J(){m(`picker`),g(null),v(null),y(`manual`),x(null),C(``),w(null),ce(null),z.reset(),T(!1),D({}),O(``)}function Y(){r(),J()}ke(t);let X=z.isPending,Oe=Ae(X,Ie);if(!t)return null;let Me={picker:u(`integrations.newIntegration`),config:u(`integrations.configureIntegration`),discovery:u(`integrations.importDevices`),broker:u(`integrations.connectBroker`,{defaultValue:`Connect a broker`})},Ne=X?h:null,Z=z.error,Le=X&&!Oe;return e(l,{children:[i(me,{open:!0,onOpenChange:e=>{!e&&!Le&&Y()},children:e(de,{width:p===`picker`?`xl`:`lg`,scroll:`body`,onCancel:e=>{Le&&e.preventDefault()},children:[i(fe,{children:i(ae,{children:Me[p]})}),e(_e,{children:[Z&&!X&&i(`div`,{className:`mb-3 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:Z instanceof Error?Z.message:String(Z)}),p===`picker`&&e(l,{children:[se&&i(`div`,{className:`mb-3 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:se}),i(Pe,{onSelect:U,onClose:Y,pendingAddonId:Ne})]}),p===`config`&&h&&i(P,{addonId:h,configSchema:R??null,canTest:ue,initialName:S.length>0&&Object.keys(pe).length>0?S:void 0,initialConfig:{...pe},onScan:Ce?()=>{xe(S.length>0?S:h),A(!0)}:void 0,onSave:De,onBack:()=>{D({}),m(`picker`)}},`${F.length>0?F:h}:${j}`),p===`broker`&&b&&i(we,{kind:b,onResolved:e=>{G(e)},onBack:()=>m(`picker`)}),p===`discovery`&&_&&i(je,{providerId:_,onImport:K,onSkip:q})]}),X&&e(`div`,{className:`absolute inset-0 z-20 flex flex-col items-center justify-center gap-2 rounded-lg bg-background/85 backdrop-blur-sm px-6 text-center`,children:[i(te,{className:`h-6 w-6 animate-spin text-primary`}),i(`p`,{className:`text-xs font-medium text-foreground`,children:u(`integrations.creating`,{defaultValue:`Creating integration…`})}),!Oe&&i(`p`,{className:`text-[10px] text-foreground-subtle`,children:u(`integrations.creatingHint`,{defaultValue:`Waiting for the addon to restart and register`})}),Oe&&e(l,{children:[i(`p`,{className:`text-[10px] text-foreground-subtle max-w-xs`,children:u(`integrations.creatingOverdue`,{defaultValue:`This is taking longer than expected. The integration may already have been created — close this dialog and refresh to check.`})}),i(`button`,{onClick:Y,className:`mt-1 rounded-md border border-border bg-surface px-3 py-1.5 text-[11px] font-medium text-foreground hover:bg-surface-hover transition-colors`,children:u(`integrations.closeAndRefresh`,{defaultValue:`Close`})})]})]})]})}),k&&h!==null&&i(Ee,{open:k,scope:{addonId:h,label:be},pickMode:`fill`,onClose:()=>A(!1),onSetupIntegration:e=>{C(e.name),D({...e.config}),ve(e=>e+1)}})]})}function Le({integration:t,expanded:n,onToggleExpand:r}){let{t:a}=M();return e(`div`,{className:`flex items-center gap-2.5`,children:[i(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),r(t.addonId)},"aria-label":n?a(`integrations.integrationColumns.collapse`,`Collapse`):a(`integrations.integrationColumns.expand`,`Expand`),"aria-expanded":n,className:`flex h-5 w-5 flex-shrink-0 items-center justify-center rounded text-foreground-subtle transition-colors hover:bg-surface-hover hover:text-foreground`,children:i(n?y:f,{className:`h-3.5 w-3.5`})}),i(ve,{type:t.addonId,size:`sm`}),e(`div`,{className:`flex min-w-0 flex-col`,children:[i(`span`,{className:`truncate text-xs font-semibold text-foreground`,children:t.name}),i(`span`,{className:`truncate text-[10px] text-foreground-subtle`,children:t.addonId})]})]})}function Re(e){let{isExpanded:t,onToggleExpand:n}=e;return[{key:`name`,header:j.t(`integrations.integrationColumns.integration`,`Integration`),headerClassName:`w-[55%]`,cell:e=>i(Le,{integration:e,expanded:t(e),onToggleExpand:n})},{key:`devices`,header:j.t(`integrations.integrationColumns.devices`,`Devices`),headerClassName:`w-[15%]`,cellClassName:`text-[11px] text-foreground-subtle`,cell:e=>j.t(`integrations.integrationColumns.deviceCount`,{count:e.deviceCount})},{key:`status`,header:j.t(`integrations.integrationColumns.status`,`Status`),headerClassName:`w-[15%]`,cell:e=>i(k,{status:e.status})}]}s();function ze(e){if(!e.enabled)return`disabled`;switch(e.processState){case`running`:return`running`;default:return`stopped`}}var Be=`expand`;function Ve(){let{t}=M(),s=ye(),c=be(),u=v(),[f]=xe(),[m,_]=Oe(),[ee,y]=o(!1),[te,b]=o(null),ne=r(()=>{b(null),y(!0)},[]),re=r(()=>{y(!1),b(null)},[]),ie=r(e=>{de(!1),b(e),y(!0)},[]),[ae,de]=o(!1);a(()=>{let e=Te(c.state);e!==null&&(b(e),y(!0),s(`/integrations`,{replace:!0,state:null}))},[c.state,s]);let E=f.get(`setup`);a(()=>{E===null||E.length===0||(b({addonId:E,name:E,config:{}}),y(!0))},[E]);let fe=r(()=>de(!0),[]),me=r(()=>de(!1),[]);O([`integrations`],[`integration.enabled`,`integration.disabled`,`integration.deleted`,`provider.started`,`provider.stopped`,`addon.installed`,`addon.uninstalled`,`addon.started`,`addon.stopped`,`addon.updated`]),O([`deviceManager`],[`device.registered`,`device.unregistered`,`device.online`,`device.offline`,`device.disabled`,`device.enabled`]);let{data:D,isLoading:he,isError:k,refetch:_e}=C(void 0),{data:A,isLoading:j,isError:ve,refetch:we}=w({projection:`slim`}),P=n(()=>A??[],[A]),F=n(()=>D??[],[D]),I=n(()=>{let e=new Map;for(let t of P)e.set(t.id,{id:t.id,name:t.name??t.stableId??`#${String(t.id)}`});return e},[P]),R=n(()=>oe(D),[D]),V=n(()=>{let e=new Map;for(let t of ce(P)){let n=R(t);if(n.kind!==`resolved`)continue;let r=n.integration.id;e.set(r,(e.get(r)??0)+1)}return e},[P,R]),U=n(()=>F.map(e=>({id:e.id,addonId:e.addonId,name:e.name,enabled:e.enabled,status:ze(e),deviceCount:V.get(e.id)??0})),[F,V]),{data:W}=le(),G=n(()=>new Map((W??[]).map(e=>[e.addonId,e.name])),[W]),K=f.get(Be),q=r(e=>{let t=new URLSearchParams(window.location.search);t.get(Be)===e?t.delete(Be):t.set(Be,e);let n=t.toString(),r=`${window.location.pathname}${n?`?${n}`:``}${window.location.hash}`;window.history.replaceState(window.history.state,``,r),window.dispatchEvent(new PopStateEvent(`popstate`))},[]),{data:J}=pe(void 0),Y=n(()=>z(J),[J]),X=n(()=>B(U,Y),[U,Y]),ke=n(()=>B(L(U,G),Y),[U,G,Y]),Ae=r(e=>s(N(e.addonId)),[s]),je=r(e=>s(N(e.addonId,e.id)),[s]),Me=r(e=>I.get(e)??null,[I]),Ne=r(e=>s(`/devices/${String(e)}`),[s]),Pe=r(e=>i(T,{context:`integration-detail`,devices:P,trpc:u.trpcClient,integrationOf:R,forceIntegrationId:e.id,urlScope:`nested`,lsKey:`integrations:nested:${e.addonId}`,resolveIntegrationIcon:Ce,resolveParent:Me,onNavigate:Ne}),[P,u.trpcClient,R,Me,Ne]),Fe=r(e=>K===e.addonId,[K]),Ie=n(()=>Re({isExpanded:Fe,onToggleExpand:q}),[Fe,q]),Le=r(e=>`${e.name} ${e.addonId}`,[]),Ve=r(e=>e.id,[]),He=e=>i(T,{mode:`generic`,items:e,getKey:Ve,getSearchText:Le,columns:Ie,onRowClick:je,isExpanded:Fe,renderExpanded:Pe,searchPlaceholder:t(`integrations.search`,{defaultValue:`Search integrations…`}),emptyLabel:t(`integrations.empty`,{defaultValue:`No integrations found.`})}),Ue=r(()=>{_e(),we()},[_e,we]),Q=k===!0||ve===!0,$=!Q&&(he||j||D===void 0||A===void 0),We=F.length>0,Ge=[{id:`table`,label:t(`integrations.viewTable`,`Table`),icon:S},{id:`grid`,label:t(`integrations.viewGrid`,`Grid`),icon:x}];return e(Se,{icon:h,title:t(`nav.integrations`,`Integrations`),actions:e(l,{children:[i(se,{ariaLabel:t(`integrations.viewLabel`,`Layout`),value:m,onChange:_,options:Ge,testId:`integrations-view`}),i(`button`,{onClick:Ue,disabled:$,className:`flex items-center gap-1 rounded-lg border border-border bg-surface px-2.5 py-1.5 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50`,title:t(`common.refresh`,`Refresh`),children:i(p,{className:ge(`h-3.5 w-3.5`,$&&`animate-spin`)})}),e(`button`,{onClick:fe,className:`flex items-center gap-1.5 rounded-lg border border-border bg-surface px-2.5 py-1.5 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,title:t(`integrations.scanTheLocalNetworkFor`,`Scan the local network for devices`),children:[i(d,{className:`h-3.5 w-3.5`}),t(`integrations.scanNetwork`,`Scan network`)]}),e(`button`,{onClick:ne,className:`flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground shadow-sm`,children:[i(g,{className:`h-3.5 w-3.5`}),t(`integrations.newIntegration`,`New Integration`)]})]}),children:[Q&&i(ue,{message:t(`integrations.loadFailed`,`Integrations could not be loaded.`),onRetry:Ue}),$&&i(`div`,{className:`space-y-2`,"data-testid":`integrations-pending`,children:[1,2,3].map(e=>i(`div`,{className:`h-12 rounded-lg border border-border bg-surface animate-pulse`},e))}),!Q&&!$&&!We&&e(`div`,{className:`flex flex-col items-center py-20 text-foreground-subtle`,children:[i(`p`,{className:`text-sm`,children:t(`integrations.noIntegrationsConfigured`,`No integrations configured.`)}),i(`p`,{className:`text-xs mt-1`,children:t(`integrations.clickNewIntegrationToConnect`,`Click "New Integration" to connect cameras and devices.`)})]}),!Q&&!$&&We&&m===`table`&&e(`div`,{className:`space-y-4`,children:[X.providers.length>0&&i(H,{kind:`providers`,children:He(X.providers)}),X.system.length>0&&i(H,{kind:`system`,children:He(X.system)})]}),!Q&&!$&&We&&m===`grid`&&i(De,{providers:ke.providers,system:ke.system,onOpen:Ae,searchPlaceholder:t(`integrations.search`,{defaultValue:`Search integrations…`}),emptyLabel:t(`integrations.empty`,{defaultValue:`No integrations found.`})}),i(Z,{open:ee,onClose:re,seed:te}),i(Ee,{open:ae,onClose:me,onSetupIntegration:ie})]})}export{Ve as IntegrationsPage};
|