@camstack/addon-admin-ui 1.2.610 → 1.2.611
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 +9 -0
- package/dist/assets/Addons-dzEoAtna.js +5 -0
- package/dist/assets/{AdminPage-TQfWsIdl.js → AdminPage-BhZ_VePJ.js} +1 -1
- package/dist/assets/{AdminSectionedPage-C-Sp15FZ.js → AdminSectionedPage-UsW8fkeW.js} +1 -1
- package/dist/assets/{AiProfiles-76h_TlLL.js → AiProfiles-Bafd5beY.js} +2 -2
- package/dist/assets/Authentication-CrPmjO6x.js +1 -0
- package/dist/assets/{Build-Cw5reaqN.js → Build-h7foMuCO.js} +3 -3
- package/dist/assets/{Calendars-Dek6lYax.js → Calendars-DWG5ZPJ3.js} +1 -1
- package/dist/assets/{CameraGrids-T4pHG6q5.js → CameraGrids-SlbSfzSp.js} +1 -1
- package/dist/assets/{Cluster-ChvHyJVl.js → Cluster-CCxXrm4a.js} +1 -1
- package/dist/assets/{CompositionBlockEditor-eCVeE5hf.js → CompositionBlockEditor-DuGXbJtF.js} +2 -2
- package/dist/assets/{CompositionEditorPage-DNMtUON1.js → CompositionEditorPage-Q0iUJPqd.js} +1 -1
- package/dist/assets/{Data-BRoEVppU.js → Data-MB6zjI5c.js} +2 -2
- package/dist/assets/DeviceDetail-OBsa2it2.js +2 -0
- package/dist/assets/{DeviceDoActionFields-Bw1Fouyk.js → DeviceDoActionFields-Boe7qhrE.js} +1 -1
- package/dist/assets/{Devices-DmMoxyfb.js → Devices-eTTJB4aq.js} +1 -1
- package/dist/assets/{EditTemplateButton-CywFwPHo.js → EditTemplateButton-BbXZhb1b.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-CmqHixWJ.js → EmbedPlayerPage-tMSOsuMm.js} +1 -1
- package/dist/assets/History-Cly-X0kM.js +1 -0
- package/dist/assets/Identity-BlWgl_Sz.js +1 -0
- package/dist/assets/{InstancesTable-FjdeKpTU.js → InstancesTable-BjBbsg4s.js} +1 -1
- package/dist/assets/IntegrationDetail-DHCf07HY.js +1 -0
- package/dist/assets/{IntegrationHub-CCRQOfas.js → IntegrationHub-joySlkYR.js} +1 -1
- package/dist/assets/{Integrations-CKuGcRVg.js → Integrations-32La43u7.js} +2 -2
- package/dist/assets/Integrations-BxzYc7P-.js +1 -0
- package/dist/assets/{Library-AkTuXuVH.js → Library-qTq0AaC6.js} +1 -1
- package/dist/assets/Locations-BCMa-IeZ.js +3 -0
- package/dist/assets/{Logs-DkyTj2fX.js → Logs-CpgTUPKb.js} +1 -1
- package/dist/assets/{MaskShapeCanvas-IwWIrUk1.js → MaskShapeCanvas-B7acndcq.js} +1 -1
- package/dist/assets/{MotionZonesSettings-Cl2atAb3.js → MotionZonesSettings-CRxB6roe.js} +1 -1
- package/dist/assets/MyAccess-BUoYI14X.js +2 -0
- package/dist/assets/Network-sl4oakCw.js +1 -0
- package/dist/assets/NodeAddonsSettingsPanel-Dxq6lu8k.js +1 -0
- package/dist/assets/{Notifications-XSgF7BJG.js → Notifications-2BBaGCkA.js} +1 -1
- package/dist/assets/{Pipeline-Db9hTfvU.js → Pipeline-ZpHfoCwe.js} +1 -1
- package/dist/assets/{PrivacyMaskSettings-AAkpSAVp.js → PrivacyMaskSettings-Cqv_Alnn.js} +1 -1
- package/dist/assets/Recordings-C5AUJVfz.js +1 -0
- package/dist/assets/{ScanSubnetEditor-BNJSHNhZ.js → ScanSubnetEditor-CYp-W62j.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-Cc1gcu2Q.js → SceneMonitorEditor-CuNrEnqp.js} +1 -1
- package/dist/assets/{SessionsList-C7_pLhlj.js → SessionsList-Buq3aa4I.js} +2 -2
- package/dist/assets/{Showroom-50tNNEJy.js → Showroom-CQzykrxR.js} +1 -1
- package/dist/assets/{StorageLocationsTable-CUKUl-r4.js → StorageLocationsTable-DdiMcYSB.js} +1 -1
- package/dist/assets/{System-CTgYsDSj.js → System-Dg1Sqr5Y.js} +1 -1
- package/dist/assets/{Templates-C0EZ5ath.js → Templates-BCEWEi2s.js} +1 -1
- package/dist/assets/{Terminal-Dy-oi1D7.js → Terminal-C2-AJvoa.js} +3 -3
- package/dist/assets/{TrainingProviders-C5Iqm6rs.js → TrainingProviders-DmpsT5cs.js} +1 -1
- package/dist/assets/{Viewer-C3m_dwEd.js → Viewer-BsgaVF35.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-BYAWcskr.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-Btig6zmW.js} +1 -1
- package/dist/assets/{addon-icons-context-BwQEO879.js → addon-icons-context-DS_A8BlD.js} +1 -1
- package/dist/assets/{ai-page.helpers-DGXwQprW.js → ai-page.helpers-Bj7xufkQ.js} +1 -1
- package/dist/assets/{archive-D6cC_FzU.js → archive-UoWI2uJH.js} +1 -1
- package/dist/assets/{assignment-candidates-COhz1sU6.js → assignment-candidates-DhrgOH8O.js} +1 -1
- package/dist/assets/{authed-media-BB_fTARR.js → authed-media-BOb-F9Jh.js} +1 -1
- package/dist/assets/{bell-off-DW6SdJiW.js → bell-off-B9aPvK6f.js} +1 -1
- package/dist/assets/{board-model-B8l9njz1.js → board-model-DgqamWrA.js} +1 -1
- package/dist/assets/{boxes-TY92pmL8.js → boxes-DLKqnuEj.js} +1 -1
- package/dist/assets/{calendar-clock-awcDXwmA.js → calendar-clock-BStqfnbg.js} +1 -1
- package/dist/assets/circle-slash-CPlAWJRi.js +1 -0
- package/dist/assets/client-Mx9AmjBL.js +809 -0
- package/dist/assets/create-composition-BeMU5FfH.js +2 -0
- package/dist/assets/crop-BaKf0XlN.js +1 -0
- package/dist/assets/{database-zap-BOyGS2Mw.js → database-zap-BZmTPYf5.js} +1 -1
- package/dist/assets/{device-integration-icon-DD03zp5X.js → device-integration-icon-w8yj8eHk.js} +1 -1
- package/dist/assets/device-picker-model-DZVTsK08.js +1 -0
- package/dist/assets/dist-Ba0PMcmz.js +809 -0
- package/dist/assets/{dist-CCtrnp2n.js → dist-crF8D7Uc.js} +1 -1
- package/dist/assets/{eraser-pdT0dQfU.js → eraser-j4TAiWeJ.js} +1 -1
- package/dist/assets/{file-up-CKQP4aNd.js → file-up-zESwu296.js} +1 -1
- package/dist/assets/{format-C6537Q4C.js → format-DXxwNIyt.js} +1 -1
- package/dist/assets/{grip-vertical-CG0ZJugp.js → grip-vertical-DwW4Yxs8.js} +1 -1
- package/dist/assets/{hard-drive-download-DOHV5Bd5.js → hard-drive-download-DAJ8MOcc.js} +1 -1
- package/dist/assets/{hostInit-BsFrL2Hf.js → hostInit-lLmzQjvA.js} +1 -1
- package/dist/assets/i18n-0sDSykZR.js +1 -0
- package/dist/assets/{icons-D8UIu3sD.js → icons-DGcrBbZf.js} +1 -1
- package/dist/assets/{index-B5JUA6GN.js → index-DDV53vFk.js} +3 -3
- package/dist/assets/{key-DjzFeOdY.js → key-BMMDG-pV.js} +1 -1
- package/dist/assets/{key-square-B56nI7zn.js → key-square-BoHZ1XjF.js} +1 -1
- package/dist/assets/{layers-Ca7GS53F.js → layers-dfb9Gxfe.js} +1 -1
- package/dist/assets/{link-2-off-Du8Urbdy.js → link-2-off-xom26Qw0.js} +1 -1
- package/dist/assets/linked-devices-model-BAfraTXn.js +1 -0
- package/dist/assets/{list-ordered-mMwdp0ZK.js → list-ordered-B4D264-Z.js} +1 -1
- package/dist/assets/{memory-stick-DOE_IdHU.js → memory-stick-DJXZ25SJ.js} +1 -1
- package/dist/assets/{message-square-plus-CIFSHLN_.js → message-square-plus-_77DXl5T.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-53e5b236.js → mf-entry-bootstrap-0-b444926c.js} +2 -2
- package/dist/assets/{mic-off-B3VyeLBb.js → mic-off-BJG6Fm99.js} +1 -1
- package/dist/assets/{monitor-off-CxVuHFKc.js → monitor-off-Czsoo7xs.js} +1 -1
- package/dist/assets/{monitor-smartphone-BY5USNY0.js → monitor-smartphone-D_cdypSO.js} +1 -1
- package/dist/assets/mount-DZVTsK08.js +1 -0
- package/dist/assets/{notification-rule-status-Epq-1UHH.js → notification-rule-status-DQdXQer1.js} +1 -1
- package/dist/assets/{player-overlays-CATQyQ4F.js → player-overlays-CW2gZp1V.js} +1 -1
- package/dist/assets/remoteEntry-0iAyZT8V.js +1 -0
- package/dist/assets/{ruler-B1kFAWFQ.js → ruler-fLB3DQQl.js} +1 -1
- package/dist/assets/{scan-eye-N0-Ys_Ky.js → scan-eye-fvTxA4BS.js} +1 -1
- package/dist/assets/{scissors-vS1vNFdB.js → scissors-BmmiVH2z.js} +1 -1
- package/dist/assets/{search-x-C3ydK90I.js → search-x-B822AUih.js} +1 -1
- package/dist/assets/{send-BgRjj7lW.js → send-CcRJSMWY.js} +1 -1
- package/dist/assets/{settings-2-D5RL9k4c.js → settings-2-0mQ2HCMq.js} +1 -1
- package/dist/assets/{shapes-OA7O-srE.js → shapes-QK3PIPmq.js} +1 -1
- package/dist/assets/{sigma-BruF2jUs.js → sigma-C8LUvV_G.js} +1 -1
- package/dist/assets/{speaker-C1_rli9I.js → speaker-DU_wbE6N.js} +1 -1
- package/dist/assets/src-B_7qCqtR.js +100 -0
- package/dist/assets/{sso-popup-CzdB5jm4.js → sso-popup-cY73C2uJ.js} +1 -1
- package/dist/assets/{step-inspector-model---6MDM_X.js → step-inspector-model-Dh2UWMEs.js} +1 -1
- package/dist/assets/{table-2-BLYpLdPR.js → table-2-zWOZVjsk.js} +1 -1
- package/dist/assets/{timer-reset-BuYNGxew.js → timer-reset-CYowm0Ii.js} +1 -1
- package/dist/assets/{unlink-DunbvAGa.js → unlink-BrsKfTDL.js} +1 -1
- package/dist/assets/{usb-DLy934kH.js → usb-CTgGYL1V.js} +1 -1
- package/dist/assets/{use-device-bound-caps-AsPNiCAs.js → use-device-bound-caps-D35kBUUJ.js} +1 -1
- package/dist/assets/{use-scenes-feed-CCt-pfFx.js → use-scenes-feed-DeUtfmq0.js} +1 -1
- package/dist/assets/{use-stationary-objects-DCghXJMZ.js → use-stationary-objects-BlgjrUVY.js} +1 -1
- package/dist/assets/{useAdminDeviceRemoval-DkbwUbqi.js → useAdminDeviceRemoval-CTqki1Qc.js} +1 -1
- package/dist/assets/useEventInvalidation-DZVTsK08.js +1 -0
- package/dist/assets/useInvalidateAddonSettings-CyofQfBo.js +1 -0
- package/dist/assets/{useNodeUrlSelection-LyLE5Mzl.js → useNodeUrlSelection-DazRnggs.js} +1 -1
- package/dist/assets/user-round-DqgsnB_a.js +1 -0
- package/dist/assets/{user-x-CZ51m8nh.js → user-x-BYht-gc9.js} +1 -1
- package/dist/assets/{variable-DkAg-mZC.js → variable-_cUaDGra.js} +1 -1
- package/dist/assets/{video-Au7ufp69.js → video-DcELsjY3.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-C2yXHCKA.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BsI4VtJv.js} +2 -2
- package/dist/index.html +10 -10
- package/dist/server/addon.js +32 -2
- package/package.json +2 -2
- package/dist/assets/Addons-EJqMDTNi.js +0 -5
- package/dist/assets/Authentication-DZ3LIfF4.js +0 -1
- package/dist/assets/DeviceDetail-Di2x5kWl.js +0 -2
- package/dist/assets/History-DP4YRoPu.js +0 -1
- package/dist/assets/Identity-BawXql-S.js +0 -1
- package/dist/assets/IntegrationDetail-uJpoaFxb.js +0 -1
- package/dist/assets/Integrations-C_Y4uSbR.js +0 -1
- package/dist/assets/Locations-vkxzxyNK.js +0 -3
- package/dist/assets/MyAccess-OxWuTXp3.js +0 -2
- package/dist/assets/Network-Bbfx627C.js +0 -1
- package/dist/assets/NodeAddonsSettingsPanel-DLOzyrXN.js +0 -1
- package/dist/assets/Recordings-DCAqnPqo.js +0 -1
- package/dist/assets/circle-slash-Bg_ao9-J.js +0 -1
- package/dist/assets/client-SlkZY5Jo.js +0 -809
- package/dist/assets/create-composition-J79Ys0Gw.js +0 -2
- package/dist/assets/crop-XrG1VTds.js +0 -1
- package/dist/assets/device-picker-model-D_UMfR6-.js +0 -1
- package/dist/assets/dist-DaCNKJWn.js +0 -809
- package/dist/assets/i18n-CPzNqU40.js +0 -1
- package/dist/assets/linked-devices-model-CVJNLYnw.js +0 -1
- package/dist/assets/mount-D_UMfR6-.js +0 -1
- package/dist/assets/remoteEntry-9JxY3iRA.js +0 -1
- package/dist/assets/src-Bo0PxLi8.js +0 -100
- package/dist/assets/useEventInvalidation-D_UMfR6-.js +0 -1
- package/dist/assets/user-round-DZR_is5s.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,K as t,R as n,S as r,V as i,Y as a,et as o,o as s,x as c}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Cn as l,D as u,Dn as d,Fn as f,Gn as p,Kt as m,L as h,Li as g,Mn as _,Ut as v,Wn as y,Z as b,bt as x,cn as S,er as C,fi as w,ht as T,on as E,ti as D,ut as O,vn as k,vr as A,wt as ee,xr as j}from"./player-overlays-CATQyQ4F.js";import{$r as M,Hr as te,ei as ne,ti as re}from"./client-SlkZY5Jo.js";import{t as ie}from"./boxes-TY92pmL8.js";import{c as ae,l as oe,p as N}from"./video-Au7ufp69.js";import{Bc as se,Cc as ce,Ec as le,Ei as P,Fc as ue,Fn as de,Ic as fe,In as F,Jr as pe,Ko as me,Ld as he,Mc as ge,Nc as _e,Nn as ve,Pc as ye,Rn as I,Sc as be,Tc as xe,Ur as Se,Vc as Ce,bc as we,ca as Te,gc as Ee,hc as De,lr as Oe,mc as ke,of as L,sa as Ae,vi as R,zc as je}from"./src-Bo0PxLi8.js";import{t as z}from"./i18n-CPzNqU40.js";import{t as B}from"./useTranslation-BJr-n0es.js";import"./mount-D_UMfR6-.js";import{Br as Me,Fr as Ne,Ir as Pe,S as Fe,a as V,i as H,ot as Ie}from"./index-B5JUA6GN.js";import{t as Le}from"./AdminSectionedPage-C-Sp15FZ.js";import{t as U}from"./AdminPage-TQfWsIdl.js";import{t as Re}from"./NodeAddonsSettingsPanel-DLOzyrXN.js";import{f as W,t as G}from"./InstancesTable-FjdeKpTU.js";o();var K=5e3,ze=`network-access`,Be={connected:!1,endpoint:null};function Ve(){let{t:n}=B(),i=s(),o=Te({capName:`network-access`},{refetchInterval:K}),c=Ae(void 0,{refetchInterval:K}),l=t(()=>Ie(c.data??[]),[c.data]),u=t(()=>(o.data??[]).map(e=>({addonId:e.addonId,displayName:l.get(e.addonId)??e.addonId,isActive:e.isActive})),[o.data,l]),[d,f]=a(null),[p,m]=a({}),h=(e,t)=>{let n=t?.addonId;i.invalidateQueries({queryKey:[[`networkAccess`,`getStatus`],{input:{addonId:n},type:`query`}]}),f(null),m(e=>{if(n===void 0||!(n in e))return e;let t={...e};return delete t[n],t})},g=(e,t)=>{f(null);let n=t?.addonId;if(n===void 0)return;let r=e instanceof Error?e.message:String(e);m(e=>({...e,[n]:r}))},_=se({onSuccess:h,onError:g}),v=Ce({onSuccess:h,onError:g});return e(`div`,{className:`flex flex-col gap-4`,children:[r(G,{functionCap:ze,icon:N,title:n(`system.remoteAccess.remoteAccess2`,`Remote Access`),subtitle:n(`system.remoteAccess.publicFacingTunnelsThatExpose`,`Public-facing tunnels that expose this hub to the internet (Cloudflare Tunnel, ngrok, …).`),emptyTitle:n(`system.remoteAccess.noRemoteAccessProvidersInstalled`,`No remote-access providers installed`),emptyDescription:n(`system.remoteAccess.installATunnelAddonE`,`Install a tunnel addon (e.g. @camstack/addon-cloudflare) to expose this hub publicly.`),addLabel:n(`system.remoteAccess.addTunnel`,`Add tunnel`)}),u.length>0&&r(F,{headingId:`remote-access-control`,title:n(`system.remoteAccess.tunnelControl`,`Tunnel control`),icon:N,children:r(`ul`,{className:`divide-y divide-border`,children:u.map(t=>e(`li`,{className:`p-2 sm:p-3 lg:p-4 flex flex-col gap-2`,children:[e(`div`,{className:`flex flex-wrap items-center gap-3`,children:[r(`span`,{className:`text-sm font-medium text-foreground`,children:t.displayName}),r(He,{addonId:t.addonId}),r(`span`,{className:`ml-auto`,children:r(Ue,{addonId:t.addonId,busyId:d,onStart:e=>{f(e),_.mutate({addonId:e})},onStop:e=>{f(e),v.mutate({addonId:e})}})})]}),p[t.addonId]!==void 0&&r(`p`,{role:`alert`,className:`text-xs text-danger`,children:p[t.addonId]})]},t.addonId))})})]})}function q(e){let{data:t}=je({addonId:e},{refetchInterval:K,retry:!1}),n=t?te.safeParse(t):null;return n?.success?n.data:Be}function He({addonId:t}){let{t:n}=B(),i=q(t);return e(c,{children:[r(P,{variant:i.connected?`success`:`default`,className:W,children:i.connected?n(`system.remoteAccess.connected`,`Connected`):n(`system.remoteAccess.disconnected`,`Disconnected`)}),i.endpoint&&e(`a`,{href:i.endpoint.url,target:`_blank`,rel:`noopener noreferrer`,className:`flex min-w-0 items-center gap-1 break-all text-[11px] text-success hover:underline`,children:[r(D,{className:`h-3 w-3`}),i.endpoint.url]})]})}function Ue({addonId:t,busyId:n,onStart:i,onStop:a}){let{t:o}=B(),s=q(t),c=n===t;return s.connected?e(R,{size:`sm`,variant:`secondary`,disabled:c,onClick:()=>a(t),children:[c?r(j,{className:`h-3 w-3 animate-spin`}):r(E,{className:`h-3 w-3`}),o(`system.remoteAccess.stop`,`Stop`)]}):e(R,{size:`sm`,variant:`primary`,disabled:c,onClick:()=>i(t),children:[c?r(j,{className:`h-3 w-3 animate-spin`}):r(p,{className:`h-3 w-3`}),o(`system.remoteAccess.start`,`Start`)]})}function We(){let{t}=B(),n=he(),i=n.data??[];return e(`div`,{className:`flex flex-col gap-4`,children:[r(G,{functionCap:`turn-provider`,icon:C,title:t(`system.turnServers.turnServers`,`TURN Servers`),subtitle:t(`system.turnServers.iceServersUsedForWebrtc`,`ICE servers used for WebRTC NAT traversal. Multiple providers can coexist — the WebRTC layer concatenates servers from all enabled providers per session.`),emptyTitle:t(`system.turnServers.noTurnProvidersInstalled`,`No TURN providers installed`),emptyDescription:t(`system.turnServers.installATurnAddonE`,`Install a TURN addon (e.g. @camstack/addon-cloudflare) to enable WebRTC behind restrictive NATs.`),addLabel:t(`system.turnServers.addProvider`,`Add provider`)}),r(F,{headingId:`turn-combined-ice`,title:t(`system.turnServers.combinedIceServerListAll`,`Combined ICE server list — all enabled providers`),icon:C,actions:r(R,{size:`sm`,variant:`secondary`,onClick:()=>n.refetch(),disabled:n.isFetching,children:t(`common.refresh`,`Refresh`)}),children:r(`div`,{className:u,children:i.length===0?r(`div`,{className:`text-xs text-foreground-subtle`,children:t(`system.turnServers.noServersFromEnabledProviders`,`No servers from enabled providers.`)}):r(`div`,{className:`flex flex-col gap-3`,children:i.map((t,n)=>{let i=Array.isArray(t.urls)?t.urls:[t.urls];return e(`div`,{className:`rounded border border-border bg-surface`,children:[(t.username||t.credential)&&e(`div`,{className:`px-3 py-1.5 border-b border-border text-[10px] font-mono text-foreground-subtle flex items-center gap-3`,children:[t.username&&e(`span`,{children:[r(`span`,{className:`text-foreground-subtle`,children:`user:`}),` `,r(`span`,{className:`text-foreground`,children:t.username})]}),t.credential&&e(`span`,{children:[r(`span`,{className:`text-foreground-subtle`,children:`credential:`}),` `,r(`span`,{className:`text-foreground`,children:`••••••••`})]})]}),r(`ul`,{className:`divide-y divide-border`,children:i.map(e=>r(`li`,{className:`px-3 py-1.5 font-mono text-xs text-foreground break-all`,children:e},e))})]},n)})})})})]})}o();var Ge={lan:C,wifi:ee,docker:ie,vpn:A,loopback:l,other:l},Ke={lan:`LAN`,wifi:`Wi-Fi`,docker:`Docker`,vpn:`VPN`,loopback:`Loopback`,other:`Other`},qe=[`lan`,`wifi`,`vpn`,`docker`,`other`,`loopback`];function Je(n){let{t:i}=B(),{interfaces:a,disabled:o,hideLoopback:s,ipv4Only:c,emptyMessage:u}=n,d=t(()=>a.filter(e=>!(s&&e.kind===`loopback`||c&&e.family!==`IPv4`)),[a,s,c]),f=t(()=>{let e=new Map;for(let t of d){let n=e.get(t.kind)??[];n.push(t),e.set(t.kind,n)}return qe.filter(t=>e.has(t)).map(t=>({kind:t,items:e.get(t)}))},[d]),p=e=>n.mode===`single`?n.value===e:n.value.includes(e),m=e=>{if(o||e.kind===`loopback`)return;if(n.mode===`single`){n.onChange(n.value===e.address?null:e.address);return}let t=new Set(n.value);t.has(e.address)?t.delete(e.address):t.add(e.address),n.onChange([...t])};return d.length===0?r(`div`,{className:`text-xs text-foreground-subtle italic`,children:u??i(`shared.addressSelector.noAddressesAvailable`,`No addresses available.`)}):r(`div`,{className:`flex flex-col gap-3`,children:f.map(({kind:t,items:a})=>e(`div`,{className:`rounded-md border border-border overflow-hidden`,children:[e(`div`,{className:`flex items-center gap-2 px-3 py-1.5 bg-surface-hover/30 border-b border-border`,children:[r(Ge[t]??l,{className:`h-3.5 w-3.5 text-foreground-subtle`}),r(`span`,{className:`text-[11px] font-semibold uppercase tracking-wide text-foreground-subtle`,children:Ke[t]??t}),e(`span`,{className:`text-[10px] text-foreground-subtle`,children:[`· `,a.length]})]}),r(`ul`,{className:`divide-y divide-border`,children:a.map(t=>{let a=p(t.address),s=t.kind===`loopback`,c=!t.plausible&&!s;return e(`li`,{className:`flex items-center gap-3 px-3 py-2 ${s?`opacity-60 cursor-not-allowed`:o?`opacity-60`:c?`cursor-pointer hover:bg-surface-hover/30 bg-amber-500/[0.04]`:`cursor-pointer hover:bg-surface-hover/30`}`,onClick:()=>m(t),children:[r(`span`,{className:`flex items-center justify-center h-4 w-4 rounded ${n.mode===`single`?`rounded-full`:`rounded`} border ${a?`border-primary bg-primary text-primary-foreground`:`border-border bg-surface`}`,children:a&&r(g,{className:`h-3 w-3`})}),e(`div`,{className:`flex-1 min-w-0 ${c?`text-foreground-subtle`:``}`,children:[e(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[r(`span`,{className:`font-mono text-xs font-semibold ${c?`text-foreground-subtle`:`text-foreground`}`,children:t.name}),r(`span`,{className:`text-[10px] rounded px-1.5 py-0.5 bg-foreground-subtle/10 text-foreground-subtle font-mono`,children:t.family}),t.preferred&&r(`span`,{className:`text-[10px] rounded-full px-2 py-0.5 font-medium bg-primary/15 text-primary`,children:i(`shared.addressSelector.autoPreferred`,`Auto-preferred`)}),s&&r(`span`,{className:`text-[10px] rounded-full px-2 py-0.5 font-medium bg-foreground-subtle/15 text-foreground-subtle`,children:i(`shared.addressSelector.alwaysIncluded`,`Always included`)}),c&&e(`span`,{className:`inline-flex items-center gap-1 text-[10px] rounded-full px-2 py-0.5 font-medium bg-amber-500/15 text-amber-700 dark:text-amber-300`,title:t.plausibleReason||void 0,children:[r(v,{className:`h-2.5 w-2.5`}),i(`shared.addressSelector.unlikelyUsable`,`Unlikely usable`)]})]}),e(`div`,{className:`text-xs text-foreground-subtle mt-0.5 font-mono break-all`,children:[t.address,t.cidr&&t.cidr!==t.address?` (${t.cidr})`:``]})]})]},`${t.name}-${t.family}-${t.address}`)})})]},t))})}var J=[{role:`appConnections`,get title(){return z.t(`helpers.addressTableModel.appConnectionsTitle`)},single:!1,get help(){return z.t(`helpers.addressTableModel.appConnectionsHelp`)}},{role:`notificationTaps`,get title(){return z.t(`helpers.addressTableModel.notificationTapsTitle`)},single:!0,get help(){return z.t(`helpers.addressTableModel.notificationTapsHelp`)}},{role:`publicEndpoint`,get title(){return z.t(`helpers.addressTableModel.publicEndpointTitle`)},single:!0,get help(){return z.t(`helpers.addressTableModel.publicEndpointHelp`)}},{role:`internal`,get title(){return z.t(`helpers.addressTableModel.internalTitle`)},single:!0,get help(){return z.t(`helpers.addressTableModel.internalHelp`)}}],Ye=`A role with nothing ticked is automatic. Add a custom address when the hub is reached at an address it cannot see itself (NAT, reverse proxy, VPN, Docker bridge).`;function Y(e,t){return e.inUse.includes(t)}function Xe(e,t){if(!e.eligible.includes(t))return{kind:`none`};if(e.kind===`app-link`)return Y(e,t)?{kind:`none`}:{kind:`set`,input:{role:t,baseUrl:null,enabled:!0}};if(e.flags.includes(t)||t===`appConnections`&&Y(e,t))return{kind:`set`,input:{role:t,baseUrl:e.baseUrl,enabled:!1}};let n={role:t,baseUrl:e.baseUrl,enabled:!0};return t===`publicEndpoint`&&e.baseUrl.startsWith(`http:`)?{kind:`confirm-http`,input:n,reason:ne}:{kind:`set`,input:n}}function Ze(e){return J.map(({role:t,title:n})=>{if(t===`appConnections`){let r=e.roles.appConnections;return{role:t,title:n,inUse:r.resolved.length===0?`nothing reachable`:r.resolved.join(`, `),automatic:r.source!==`flagged`}}let r=e.roles[t];return{role:t,title:n,inUse:r.resolved===null?`nothing reachable`:t===`notificationTaps`&&r.source===`auto`?`CamStack app link`:r.resolved,automatic:r.source!==`flagged`}})}o();var X={"lan-ipv4":{labelKey:`system.addressesCard.kindIpv4`,className:`bg-emerald-500/15 text-emerald-700 dark:text-emerald-300`},"lan-ipv6":{labelKey:`system.addressesCard.kindIpv6`,className:`bg-violet-500/15 text-violet-700 dark:text-violet-300`},public:{labelKey:`system.addressesCard.kindPublic`,className:`bg-blue-500/15 text-blue-700 dark:text-blue-300`},"app-link":{labelKey:`system.addressesCard.kindAppLink`,className:`bg-amber-500/15 text-amber-700 dark:text-amber-300`},custom:{labelKey:`system.addressesCard.kindCustom`,className:`bg-sky-500/15 text-sky-700 dark:text-sky-300`},loopback:{labelKey:`system.addressesCard.kindLoopback`,className:`bg-foreground-subtle/15 text-foreground-subtle`}};function Qe({book:t,loading:n,saving:i,error:o,onSetRole:s,onAdd:c,onRemove:l}){let{t:u}=B(),[d,f]=a(``),[p,h]=a(``),[g,_]=a(null),[b,x]=a(null),S=()=>{let e=re(d);if(!e.ok){_(e.reason);return}_(null),f(``),h(``),c(e.baseUrl,p.trim())},C=(e,t)=>{let n=Xe(e,t.role);if(n.kind!==`none`){if(n.kind===`confirm-http`){x({input:n.input,reason:n.reason});return}x(null),s(n.input)}},w=[{key:`url`,header:u(`system.addressesCard.address`,`Address`),render:n=>e(`div`,{className:`min-w-0 py-0.5`,children:[r(`div`,{className:`font-mono text-[12px] break-all ${n.plausible?`text-foreground`:`text-foreground-subtle`}`,children:n.baseUrl}),e(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-1.5 text-[11px] text-foreground-subtle`,children:[r(`span`,{children:n.label}),n.kind===`app-link`&&e(`span`,{className:`font-mono`,children:[`hub=`,` `,t?.appLinkHub??u(`system.addressesCard.noneNoTunnelOrTailscale`,`none (no tunnel or Tailscale)`)]}),n.custom&&n.detected&&r(`span`,{children:u(`system.addressesCard.alsoAddedAsACustom`,`also added as a custom address`)}),n.kind!==`custom`&&n.interfaceKind!==`lan`&&n.interfaceKind!==`public`&&n.interfaceKind!==`other`&&r(`span`,{className:`uppercase tracking-wide`,children:n.interfaceKind}),!n.plausible&&n.interfaceKind!==`loopback`&&e(`span`,{className:`inline-flex items-center gap-1 text-amber-700 dark:text-amber-300`,title:n.plausibleReason||void 0,children:[r(v,{className:`h-2.5 w-2.5`}),u(`system.addressesCard.unlikelyUsable`,`Unlikely usable`)]})]})]})},{key:`kind`,header:u(`system.addressesCard.kind`,`Kind`),nowrap:!0,render:e=>{let t=X[e.kind]??X.loopback;return r(`span`,{className:`text-[10px] rounded-full px-2 py-0.5 font-medium ${t.className}`,children:u(t.labelKey)})}},...J.map(t=>({key:t.role,headerRender:()=>r(`span`,{title:t.help,children:t.title}),align:`center`,nowrap:!0,width:`w-24`,render:n=>{let a=n.eligible.includes(t.role),o=n.flags.includes(t.role),s=Y(n,t.role);return e(`label`,{className:`inline-flex items-center justify-center gap-1 ${a?`cursor-pointer`:`cursor-not-allowed opacity-40`}`,title:a?s&&!o?u(`system.addressesCard.inUseAutomatically`,`{{title}}: in use automatically. {{help}}`,{title:t.title,help:t.help}):t.help:u(`system.addressesCard.thisAddressCannotBeUsed`,`This address cannot be used for this.`),children:[r(Oe,{checked:a&&s,disabled:!a||i,onChange:()=>C(n,t),"aria-label":`${t.title}: ${n.baseUrl}`}),s&&!o&&a&&r(`span`,{className:`text-[9px] text-foreground-subtle`,children:u(`common.auto`)})]})}})),{key:`actions`,header:``,align:`right`,nowrap:!0,render:e=>e.custom?r(R,{size:`sm`,variant:`ghost`,disabled:i,onClick:()=>l(e.baseUrl),"aria-label":u(`system.addressesCard.remove`,`Remove {{baseUrl}}`,{baseUrl:e.baseUrl}),title:u(`system.addressesCard.removeThisCustomAddressIts`,`Remove this custom address (its roles turn automatic)`),children:r(m,{className:`h-3 w-3`})}):null}],T=t===void 0?[]:Ze(t);return e(Se,{children:[e(`div`,{className:`px-4 py-3 border-b border-border flex flex-col gap-2`,children:[e(`div`,{children:[r(`div`,{className:`text-sm font-semibold`,children:u(`system.addressesCard.addresses`,`Addresses`)}),r(`div`,{className:`text-xs text-foreground-subtle max-w-3xl`,children:u(`system.addressesCard.everyAddressThisHubIs`,`Every address this hub is reached at, detected or added by you. Tick what each one is used for.`)}),e(`details`,{className:`mt-1.5 text-xs max-w-3xl`,"data-testid":`address-roles-help`,children:[r(`summary`,{className:`cursor-pointer select-none text-foreground-subtle hover:text-foreground`,children:u(`system.addressesCard.whatAreRoles`,`What are roles?`)}),r(`dl`,{className:`mt-1.5 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1`,children:J.map(t=>e(`div`,{className:`contents`,children:[r(`dt`,{className:`font-medium`,children:t.title}),r(`dd`,{className:`text-foreground-subtle`,children:t.help})]},t.role))}),r(`p`,{className:`mt-1.5 text-foreground-subtle`,children:Ye})]})]}),T.length>0&&r(`div`,{className:`grid grid-cols-[auto_1fr_auto] gap-x-3 gap-y-1 items-baseline text-xs`,"data-testid":`address-roles-summary`,children:T.map(t=>e(`div`,{className:`contents`,children:[r(`span`,{className:`text-foreground-subtle`,children:t.title}),e(`span`,{className:`font-mono break-all`,"data-testid":`address-role-${t.role}`,children:[t.inUse,r(`span`,{className:`ml-1.5 font-sans text-foreground-subtle`,children:t.automatic?u(`system.addressesCard.automatic`,`(automatic)`):u(`system.addressesCard.setByYou`,`(set by you)`)})]}),t.automatic?r(`span`,{}):r(R,{size:`sm`,variant:`secondary`,disabled:i,onClick:()=>s({role:t.role,baseUrl:null,enabled:!1}),children:u(`system.addressesCard.useAutomatic`,`Use automatic`)})]},t.role))}),b!==null&&e(`div`,{className:`rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-xs flex flex-wrap items-center gap-2`,children:[r(v,{className:`h-3.5 w-3.5 text-amber-600`}),r(`span`,{className:`flex-1 min-w-[220px]`,children:b.reason}),r(R,{size:`sm`,variant:`secondary`,onClick:()=>{s({...b.input,acceptInsecureHttp:!0}),x(null)},children:u(`system.addressesCard.useHttpAnyway`,`Use http anyway`)}),r(R,{size:`sm`,variant:`ghost`,onClick:()=>x(null),children:u(`common.cancel`,`Cancel`)})]}),o!==null&&r(`div`,{className:`text-[11px] text-red-600 dark:text-red-400`,role:`alert`,children:o})]}),r(I,{columns:w,rows:t?.rows??[],rowKey:e=>`${e.kind}-${e.baseUrl}`,minWidthPx:760,bordered:!1,emptyMessage:n?u(`common.loading`,`Loading…`):u(`system.addressesCard.noAddressesAvailable`,`No addresses available.`),rowClassName:e=>e.plausible?void 0:`opacity-80`}),e(`div`,{className:`px-4 py-3 border-t border-border flex flex-wrap items-start gap-2`,children:[e(`div`,{className:`flex-1 min-w-[220px]`,children:[r(L,{value:d,onChange:e=>{f(e.target.value),_(null)},placeholder:`https://cams.example.com or https://192.0.2.20:4443`,"aria-label":u(`system.addressesCard.customAddress`,`Custom address`),disabled:i}),g!==null&&r(`div`,{className:`mt-1 text-[11px] text-red-600 dark:text-red-400`,children:g})]}),r(`div`,{className:`w-48`,children:r(L,{value:p,onChange:e=>h(e.target.value),placeholder:u(`system.addressesCard.labelOptional`,`Label (optional)`),"aria-label":u(`system.addressesCard.customAddressLabel`,`Custom address label`),maxLength:80,disabled:i})}),e(R,{size:`sm`,variant:`secondary`,disabled:i||d.trim()===``,onClick:S,children:[r(y,{className:`h-3 w-3`}),u(`system.addressesCard.addCustomAddress`,`Add custom address`)]})]})]})}o();function $e(){let{t:n}=B(),o=s(),c=()=>{o.invalidateQueries({queryKey:[[`localNetwork`]]})},l=we(void 0,{refetchInterval:3e4}),p=Ee(void 0),m=le({onSuccess:c}),h=ce({onSuccess:e=>{E(e.addresses),c()}}),g=t(()=>l.data?.interfaces??[],[l.data]),v=De({scheme:typeof window<`u`&&window.location.protocol===`https:`?`https`:`http`},{refetchInterval:3e4}),y=xe({onSuccess:c}),b=ke({onSuccess:c}),x=be({onSuccess:c}),C=y.error?.message??b.error?.message??x.error?.message??null,w=y.isPending||b.isPending||x.isPending,[T,E]=a([]),[D,O]=a(!1);i(()=>{!D&&p.data&&(E(p.data.addresses),O(!0))},[p.data,D]);let k=p.data?.addresses??[],A=t(()=>{if(T.length!==k.length)return!0;let e=[...T].toSorted(),t=[...k].toSorted();return e.some((e,n)=>e!==t[n])},[T,k]);return e(U,{embedded:!0,children:[e(`div`,{className:`flex items-center justify-between gap-3 flex-wrap`,children:[r(`p`,{className:`text-xs text-foreground-subtle max-w-2xl`,children:n(`system.networkAddresses.pinWhichHostInterfacesExist`,`Pin which host interfaces exist, then tick what each address is used for. Add a custom address when this hub is reached at one it cannot detect.`)}),r(`div`,{className:`flex items-center gap-2 shrink-0`,children:e(R,{size:`sm`,variant:`secondary`,onClick:()=>{l.refetch(),p.refetch(),v.refetch()},disabled:l.isLoading,children:[r(f,{className:`h-3 w-3 ${l.isLoading?`animate-spin`:``}`}),n(`common.refresh`,`Refresh`)]})})]}),r(F,{headingId:`network-allowed-addresses`,title:n(`system.networkAddresses.allowedAddresses`,`Allowed addresses`),actions:e(`div`,{className:`flex flex-wrap items-center gap-1`,children:[e(R,{size:`sm`,variant:`secondary`,onClick:()=>h.mutate(void 0),disabled:h.isPending||m.isPending,title:n(`system.networkAddresses.reRunTheAutoDetection`,`Re-run the auto-detection heuristic + overwrite the current allowlist with the best matches.`),children:[r(S,{className:`h-3 w-3`}),h.isPending?n(`system.networkAddresses.detecting`,`Detecting…`):n(`system.networkAddresses.bestMatch`,`Best match`)]}),e(R,{size:`sm`,variant:`secondary`,onClick:()=>{E([])},disabled:T.length===0||m.isPending,children:[r(_,{className:`h-3 w-3`}),n(`system.networkAddresses.clear`,`Clear`)]}),A&&r(R,{size:`sm`,variant:`secondary`,onClick:()=>{E(k)},disabled:m.isPending,children:n(`system.networkAddresses.discard`,`Discard`)}),e(R,{size:`sm`,variant:`primary`,onClick:()=>{m.mutate({addresses:[...T]})},disabled:!A||m.isPending,children:[r(d,{className:`h-3 w-3`}),m.isPending?n(`system.networkAddresses.saving`,`Saving…`):n(`common.save`,`Save`)]})]}),children:e(`div`,{className:u,children:[r(`p`,{className:`mb-3 text-xs text-foreground-subtle`,children:T.length===0?n(`system.networkAddresses.autoEveryNonLoopbackNon`,`Auto — every non-loopback / non-link-local interface participates.`):n(`system.networkAddresses.pinned`,`{{value1}} pinned`,{value1:String(T.length)})}),r(Je,{mode:`multiple`,interfaces:g,value:T,onChange:E,disabled:m.isPending,emptyMessage:l.isLoading?n(`system.networkAddresses.loadingInterfaces`,`Loading interfaces…`):n(`system.networkAddresses.noInterfacesDetected`,`No interfaces detected.`)})]})}),r(Qe,{book:v.data,loading:v.isLoading,saving:w,error:C,onSetRole:e=>y.mutate({...e}),onAdd:(e,t)=>b.mutate({baseUrl:e,label:t}),onRemove:e=>x.mutate({baseUrl:e})})]})}var et=5e3,tt={joined:!1,meshIp:``,magicDnsHostname:``,peerCount:0,endpoints:[],tenantName:``,magicDnsSuffix:``,userLogin:null,controlPlaneUrl:``,keyExpiry:null};function Z(e){let{data:t,isLoading:n}=ge({addonId:e},{refetchInterval:et,retry:!1}),r=t?M.safeParse(t):null;return{status:r?.success?r.data:tt,isLoading:n}}function Q({addonId:t}){let{t:n}=B(),{status:i}=Z(t);return e(`span`,{className:`flex flex-wrap items-center gap-1`,children:[r(P,{variant:i.joined?`success`:`default`,className:W,children:i.joined?n(`system.meshNetworks.joined`,`Joined`):n(`system.meshNetworks.notJoined`,`Not joined`)}),i.joined&&r(P,{className:`text-[10px]`,children:n(`common.peers`,{count:i.peerCount})}),i.error!==void 0&&r(P,{variant:`danger`,className:`text-[10px]`,title:i.error,children:n(`system.meshNetworks.error`,`Error`)})]})}o();function nt({addonId:t}){return e(`div`,{className:`flex flex-wrap items-center gap-2`,children:[r(Q,{addonId:t}),r(rt,{addonId:t})]})}function rt({addonId:t}){let{t:i}=B(),o=s(),[l,u]=a(!1),[d,f]=a(null),p=T(),{status:m}=Z(t),h=n(()=>{o.invalidateQueries({queryKey:[[`meshNetwork`]]})},[o]),g=fe(),_=_e({onSuccess:h}),v=ue({onSuccess:h}),y=n(async()=>{u(!0);let e={cancelled:!1};f(e);try{let n=await g.mutateAsync({addonId:t});if(e.cancelled)return;n.loginUrl&&window.open(n.loginUrl,`_blank`,`noopener,noreferrer`);let r=Date.now();for(;!e.cancelled&&(await it(2e3),!e.cancelled);){let e=await p.trpcClient.meshNetwork.getStatus.query({addonId:t}).catch(()=>null),n=e?M.safeParse(e):null;if(n?.success&&n.data.joined){h();break}if(Date.now()-r>6e5)break}}finally{u(!1),f(null)}},[t,h,g,p]),b=n(()=>{d&&(d.cancelled=!0),u(!1),f(null)},[d]);return r(c,{children:m.joined?e(c,{children:[e(R,{size:`sm`,variant:`secondary`,disabled:_.isPending,onClick:()=>_.mutate({addonId:t}),children:[_.isPending?r(j,{className:`h-3 w-3 animate-spin`}):r(ae,{className:`h-3 w-3`}),i(`system.meshNetworks.disconnect`,`Disconnect`)]}),e(R,{size:`sm`,variant:`ghost`,disabled:v.isPending,onClick:()=>v.mutate({addonId:t}),children:[v.isPending?r(j,{className:`h-3 w-3 animate-spin`}):r(k,{className:`h-3 w-3`}),i(`system.meshNetworks.logOut`,`Log out`)]})]}):l?e(R,{size:`sm`,variant:`ghost`,onClick:b,children:[r(x,{className:`h-3 w-3 mr-1`}),` `,i(`common.cancel`)]}):e(c,{children:[e(R,{size:`sm`,variant:`primary`,onClick:()=>void y(),children:[r(oe,{className:`h-3 w-3`}),i(`system.meshNetworks.connect`,`Connect`)]}),e(R,{size:`sm`,variant:`ghost`,disabled:v.isPending,onClick:()=>v.mutate({addonId:t}),children:[v.isPending?r(j,{className:`h-3 w-3 animate-spin`}):r(k,{className:`h-3 w-3`}),i(`system.meshNetworks.logOut`,`Log out`)]})]})})}function it(e){return new Promise(t=>setTimeout(t,e))}o();var at={mesh:`bg-info/15 text-info`,public:`bg-primary/15 text-primary`},ot=3e4;function st({addonId:t}){let{t:n}=B(),{status:i}=Z(t),a=ye({addonId:t},{refetchInterval:ot,retry:!1});return e(`div`,{className:`rounded-lg border border-border bg-surface`,children:[e(`div`,{className:`space-y-4 p-2 sm:p-4`,children:[i.error&&r(pe,{message:i.error}),r(ct,{status:i}),i.endpoints.length>0&&e(`div`,{className:`space-y-1.5`,children:[r(`div`,{className:`text-[11px] font-semibold text-foreground-subtle uppercase tracking-wide`,children:n(`system.meshNetworks.endpoints`,`Endpoints`)}),i.endpoints.map(t=>e(`div`,{className:`flex items-center gap-2 text-xs flex-wrap`,children:[e(`span`,{className:`text-[10px] rounded-full px-2 py-0.5 font-medium ${at[t.scope]??`bg-foreground-subtle/15 text-foreground-subtle`}`,children:[t.scope===`public`?r(N,{className:`inline h-2.5 w-2.5 mr-0.5`}):null,t.label]}),e(`a`,{href:t.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-success hover:underline break-all flex items-center gap-1`,children:[r(D,{className:`h-3 w-3 shrink-0`}),t.url]})]},t.id))]})]}),r(`div`,{className:`border-t border-border`,children:r(ut,{peers:a.data?.peers??[],loading:a.isLoading})})]})}function ct({status:t}){let{t:n}=B();return r(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-1.5`,children:[{label:n(`system.meshNetworks.tenant`,`Tenant`),value:t.tenantName||`—`},{label:n(`system.meshNetworks.user`,`User`),value:t.userLogin??`—`},{label:n(`system.meshNetworks.controlPlane`,`Control plane`),value:t.controlPlaneUrl||`—`},{label:n(`system.meshNetworks.meshIp`,`Mesh IP`),value:t.meshIp||`—`,mono:!0},{label:n(`system.meshNetworks.magicdns`,`MagicDNS`),value:t.magicDnsHostname||`—`,mono:!0},{label:n(`system.meshNetworks.dnsSuffix`,`DNS suffix`),value:t.magicDnsSuffix||`—`,mono:!0},{label:n(`system.meshNetworks.peers`,`Peers`),value:String(t.peerCount)},{label:n(`system.meshNetworks.keyExpiry`,`Key expiry`),value:t.keyExpiry?lt(t.keyExpiry):`—`}].map(t=>e(`div`,{className:`flex items-baseline justify-between gap-3 text-xs`,children:[r(`span`,{className:`text-foreground-subtle shrink-0`,children:t.label}),r(`span`,{className:`text-foreground truncate ${t.mono?`font-mono`:``}`,children:t.value})]},t.label))})}function lt(e){let t=e-Date.now();if(t<0)return z.t(`system.meshNetworks.expiredAgo`,{when:pt(e)});let n=Math.floor(t/864e5);if(n>60)return new Date(e).toLocaleDateString();if(n>1)return z.t(`system.meshNetworks.expiryDays`,{count:n});let r=Math.floor(t/36e5);return r>1?z.t(`system.meshNetworks.expiryHours`,{count:r}):z.t(`system.meshNetworks.expiryMin`,{count:Math.max(1,Math.floor(t/6e4))})}function ut({peers:i,loading:a}){let{t:o}=B(),s=t(()=>i.map(e=>({...e,_id:e.id})),[i]),c=n(e=>{e&&navigator.clipboard?.writeText(e)},[]),l=t(()=>[{key:`hostname`,header:o(`system.meshNetworks.hostname`,`Hostname`),render:t=>e(`div`,{className:`flex flex-col`,children:[e(`div`,{className:`flex items-center gap-1.5`,children:[r(`span`,{className:`font-medium text-foreground`,children:t.hostname||o(`system.meshNetworks.unknown`,`(unknown)`)}),t.isSelf&&r(P,{variant:`info`,children:o(`common.self`)}),t.exitNodeOption&&r(P,{variant:`warning`,children:`exit-node`})]}),t.userLogin&&r(`div`,{className:`text-[10px] text-foreground-subtle truncate`,children:t.userLogin})]})},{key:`magicDns`,header:o(`system.meshNetworks.magicdns`,`MagicDNS`),render:t=>t.magicDns?e(`div`,{className:`flex items-center gap-1`,children:[r(`span`,{className:`font-mono text-xs truncate`,children:t.magicDns}),r(R,{variant:`unstyled`,onClick:()=>c(t.magicDns),className:`p-0.5 hover:bg-foreground-subtle/10 rounded`,"aria-label":o(`system.meshNetworks.copyMagicdns`,`Copy MagicDNS`),children:r(w,{className:`h-3 w-3 text-foreground-subtle`})})]}):r(`span`,{className:`text-foreground-subtle`,children:`—`})},{key:`addresses`,header:`IP`,render:t=>{let n=t.addresses[0]??``;return n?e(`div`,{className:`flex items-center gap-1`,children:[r(`span`,{className:`font-mono text-xs`,children:n}),r(R,{variant:`unstyled`,onClick:()=>c(n),className:`p-0.5 hover:bg-foreground-subtle/10 rounded`,"aria-label":o(`system.meshNetworks.copyIp`,`Copy IP`),children:r(w,{className:`h-3 w-3 text-foreground-subtle`})})]}):r(`span`,{className:`text-foreground-subtle`,children:`—`})}},{key:`connection`,header:o(`system.meshNetworks.connection`,`Connection`),render:t=>e(`div`,{className:`flex items-center gap-1.5`,children:[r(P,{variant:dt(t.connection),children:t.connection}),t.relay&&r(`span`,{className:`text-[10px] text-foreground-subtle font-mono`,children:t.relay})]})},{key:`routes`,header:o(`system.meshNetworks.routes`,`Routes`),render:e=>e.advertisedRoutes.length>0?r(`span`,{className:`text-[10px] font-mono text-foreground-subtle truncate`,children:e.advertisedRoutes.join(`, `)}):r(`span`,{className:`text-foreground-subtle`,children:`—`})},{key:`tx`,header:o(`system.meshNetworks.txRx`,`TX / RX`),render:t=>e(`span`,{className:`text-[10px] text-foreground-subtle font-mono`,children:[`↑ `,ft(t.txBytes),` · ↓ `,ft(t.rxBytes)]})},{key:`lastSeen`,header:o(`system.meshNetworks.lastSeen`,`Last seen`),render:e=>r(`span`,{className:`text-[10px] text-foreground-subtle`,children:e.lastSeenMs>0?pt(e.lastSeenMs):`—`})}],[c,o]);return a&&i.length===0?e(`div`,{className:`p-4 text-xs text-foreground-subtle`,children:[r(j,{className:`h-3 w-3 animate-spin inline mr-1`}),` `,o(`systemPage.meshNetworks.loadingPeers`)]}):i.length===0?r(`div`,{className:`p-4 text-xs text-foreground-subtle`,children:o(`system.meshNetworks.noPeersVisibleYourTailnet`,`No peers visible — your tailnet may be empty or the host is not joined.`)}):r(`div`,{className:`p-4`,children:r(I,{columns:l,rows:s,rowKey:e=>e._id,minWidthPx:820})})}function dt(e){return e===`direct`?`success`:e===`relay`?`warning`:`info`}function ft(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(1)}MB`:`${(e/1024/1024/1024).toFixed(2)}GB`}function pt(e){let t=Date.now()-e;return t<6e4?z.t(`system.meshNetworks.justNow`):t<36e5?z.t(`system.meshNetworks.agoMin`,{count:Math.round(t/6e4)}):t<864e5?z.t(`system.meshNetworks.agoHour`,{count:Math.round(t/36e5)}):z.t(`system.meshNetworks.agoDay`,{count:Math.round(t/864e5)})}var mt=`mesh-network`;function ht(){let{t}=B();return r(G,{functionCap:mt,icon:C,title:t(`system.meshNetworks.meshNetworks2`,`Mesh Networks`),subtitle:t(`system.meshNetworks.privateVpnMeshesThatConnect`,`Private VPN meshes that connect CamStack to your other devices (Tailscale, Headscale, …). Each provider can also expose this hub publicly via its ingress (Tailscale Funnel).`),emptyTitle:t(`system.meshNetworks.noMeshNetworkProvidersInstalled`,`No mesh-network providers installed`),emptyDescription:t(`system.meshNetworks.installAMeshAddonE`,`Install a mesh addon (e.g. @camstack/addon-tailscale) to join this hub into a private VPN mesh.`),addLabel:t(`system.meshNetworks.addMesh`,`Add mesh`),install:{capability:mt,label:t(`system.meshNetworks.addMesh`,`Add mesh`)},extraColumns:[{key:`mesh-state`,header:t(`system.meshNetworks.connectionState`,`Mesh`),notSortableReason:t(`system.meshNetworks.connectionStateNotSortable`,`Live state of the tailnet, not a stored value.`),render:e=>r(Q,{addonId:e.addonId})}],lead:t=>e(`div`,{className:`flex flex-col gap-3`,children:[r(nt,{addonId:t.addonId}),r(st,{addonId:t.addonId})]})})}var $=`/system/identity?tab=certificates`;function gt(){let{t}=B();return r(U,{embedded:!0,children:e(`div`,{className:h,children:[r(Re,{nodeId:`hub`,addonIds:[`local-network`],level:`global`,title:t(`system.localAccess.lanHttp`,`LAN HTTP`),description:t(`system.localAccess.nativeAppsOnThisWi`,`Native apps on this Wi-Fi use http:// and skip the private certificate. The tunnel and this admin UI stay on HTTPS.`)}),e(`p`,{className:`text-xs text-foreground-subtle`,"data-testid":`https-certificate-hint`,children:[t(`system.localAccess.certificateMoved`,`The HTTPS certificate and the local CA are managed under`),` `,r(Ne,{className:`underline`,to:$,children:t(`system.localAccess.certificateMovedLink`,`Identity → Certificates`)}),`.`]})]})})}o();function _t({value:n,onChange:i}){let{t:a}=B(),{data:o}=me({isCamera:!0,projection:`slim`}),s=t(()=>o===void 0?[{value:``,label:a(`system.networkDiagnostics.loadingCameras`,`Loading cameras…`)}]:o.length===0?[{value:``,label:a(`system.networkDiagnostics.noCameras`,`No cameras`)}]:[{value:``,label:a(`system.networkDiagnostics.pickACamera`,`Pick a camera`)},...o.toSorted((e,t)=>e.name.localeCompare(t.name)).map(e=>({value:String(e.id),label:`${e.name} (#${String(e.id)})`}))],[o,a]);return e(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[r(`span`,{className:`text-[11px] text-foreground-subtle`,children:a(`system.networkDiagnostics.camera`,`Camera`)}),r(O,{value:n===null?``:String(n),disabled:o===void 0||o.length===0,onChange:e=>i(e.target.value===``?null:Number(e.target.value)),options:s})]})}function vt(){let t=T(),[i,o]=a(null);return r(U,{embedded:!0,children:e(`div`,{className:h,"data-testid":`network-diagnostics`,children:[r(de,{loadServers:n(async()=>t.trpcClient.turnProvider.getTurnServers.query(),[t])}),r(ve,{trpc:t.trpcClient,serverUrl:b(),deviceId:i,cameraField:r(_t,{value:i,onChange:o})})]})})}var yt=[`certificate`,`certificates`,`https`];function bt(){let{t:e}=B(),[t]=Me();if(yt.includes(t.get(`tab`)??``))return r(Pe,{to:$,replace:!0});let n=Fe(`/system/network`,{t:e,isAdmin:!0})??{icon:N,title:e(`system.network`,`Network`)};return r(Le,{icon:n.icon,title:n.title,defaultSection:`addresses`,sectionsLabel:`${n.title} sections`,sections:[{id:`local-access`,label:e(`systemPage.network.localAccess`,`Local access`),content:r(gt,{})},{id:`addresses`,label:e(`systemPage.network.networkAddresses`,`Network Addresses`),content:r($e,{})},{id:V.remoteAccess.tab,label:e(`systemPage.network.remoteAccess`,`Remote Access`),content:r(Ve,{}),ownedParams:H},{id:V.mesh.tab,label:e(`systemPage.network.meshNetworks`,`Mesh Networks`),content:r(ht,{}),ownedParams:H},{id:V.turn.tab,label:e(`systemPage.network.turnServers`,`TURN Servers`),content:r(We,{}),ownedParams:H},{id:`diagnostics`,label:e(`systemPage.network.diagnostics`,`Diagnostics`),content:r(vt,{})}]})}export{bt as NetworkPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,J as t,K as n,R as r,S as i,V as a,W as o,Y as s,et as c,i as l,j as u,o as d,p as f,t as p}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{ht as m}from"./player-overlays-CATQyQ4F.js";import{rs as h}from"./client-SlkZY5Jo.js";import{Oa as g,Ot as _,Xi as v,Yi as y,fo as ee,sa as te,vi as b}from"./src-Bo0PxLi8.js";import{t as ne}from"./useTranslation-BJr-n0es.js";import{F as x,N as re,P as ie,ut as S}from"./index-B5JUA6GN.js";c();var C=u(function({addonId:e,schema:s,serverValues:c,onImmediateSave:l,onStateChange:u,onAction:d,disabled:f},p){let m=x({schema:s,serverValues:c,onImmediateSave:r(t=>l(e,t),[e,l]),onDeferredSave:r(()=>{},[])});o(p,()=>({flush:()=>{let e={};for(let t of m.pendingKeys)e[t]=m.values[t];return m.handleDiscard(m.pendingKeys),e},discard:()=>m.resetAll()}),[m]);let h=m.pendingKeys,g=h.join(`|`),_=n(()=>h.map(e=>`${e}=${JSON.stringify(m.values[e])}`).join(`,`),[h,m.values]),v=t(u);a(()=>{v.current=u},[u]),a(()=>{let t={};for(let e of h)t[e]=m.values[e];v.current({addonId:e,pendingKeys:h,pendingValues:t})},[e,g,_]);let y=n(()=>{if(d)return(t,n,r)=>d(e,t,n,r)},[e,d]);return i(S,{schema:s,values:m.values,onChange:m.handleChange,disabled:f,onAction:y})});function w(e){return`perNode`in e&&e.perNode===!0}function T(e,t){if(e.type===`group`){let n=E(e.fields,t);return n.length>0?{...e,fields:n}:null}if(e.type===`sub-tabs`){let n=e.tabs.map(e=>({...e,fields:E(e.fields,t)})).filter(e=>e.fields.length>0);return n.length>0?{...e,tabs:n}:null}return w(e)===(t===`perNode`)?e:null}function E(e,t){let n=[];for(let r of e){let e=T(r,t);e!==null&&n.push(e)}return n}function ae(e,t){let n=[];for(let r of e.sections){let e=E(r.fields,t);e.length!==0&&n.push({...r,fields:e})}return{...e,sections:n}}function oe(e,t){let n=e??`general`;return t?.[n]??n}function D(e){return typeof e!=`object`||!e||!(`key`in e)?null:typeof e.key==`string`?e.key:null}function O(e,t){let n=t.fieldKeys===void 0?null:new Set(t.fieldKeys),r=[];for(let i of e){let e=n===null?i.fields:i.fields.filter(e=>{let t=D(e);return t!==null&&n.has(t)});e.length!==0&&r.push({...i,fields:e,...t.tabAliases===void 0?{}:{tab:oe(i.tab,t.tabAliases)},...t.hideSectionChrome===!0?{title:``,description:void 0}:{}})}return r}c();function k(e,t){if(e.type===`separator`||e.type===`info`||e.type===`button`)return e;if(e.type===`group`){let n=e.fields.map(e=>k(e,t));return{...e,fields:n}}let n=e;t[e.key]=n.value;let{value:r,...i}=n;return i}function A(e,t){return{...e,fields:e.fields.map(e=>k(e,t))}}function se(e){let t={};return{schema:{...e.tabs?{tabs:e.tabs}:{},sections:e.sections.map(e=>A(e,t))},values:t}}function j({nodeId:a,addonIds:o,level:c,deviceId:u,capability:b,sectionIds:x,omitSectionIds:S,fieldKeys:C,hideSectionChrome:w,tabAliases:T,tabLabelOverrides:E,sectionTab:D,fieldScope:k,surface:A,emptyMessage:j,extraTabs:M,schemaTabExtras:N,title:P,description:F,selfTabbed:le,activeTab:ue,onActiveTabChange:de}){let{t:I}=ne(),L=d(),R=m().trpcClient,z=v(),B=y(),fe=ee(),pe=g(),V=le===!0||!!(M&&M.length>0),[me,he]=s(null);if(c===`device`&&!u)throw Error(`NodeAddonsSettingsPanel: deviceId is required when level === "device"`);if(A!==void 0){if(c!==`global`||u!==void 0)throw Error(`NodeAddonsSettingsPanel: integration-level settings are addon-wide — they cannot be mounted at device level or with a deviceId. A second page, never a second scope.`);if(a!==null)throw Error(`NodeAddonsSettingsPanel: an integration has no node behind it — pass nodeId={null}. Received ${JSON.stringify(a)}.`);if(k!==void 0)throw Error("NodeAddonsSettingsPanel: integration-level settings arrive already cluster-scoped from core — remove `fieldScope` rather than restating it.")}let H=a??`hub`,U=l({queries:o.map(e=>({queryKey:[[`addonSettings`,A===void 0?c===`global`?`getGlobalSettings`:`getDeviceSettings`:`getIntegrationSettings`],{addonId:e,nodeId:H,deviceId:u??null,cap:b??null,scope:k??null}],queryFn:async()=>{let t=e=>e!==null&&k!==void 0?ae(e,k):e;return A===void 0?c===`global`?{addonId:e,result:t(await R.addonSettings.getGlobalSettings.query({addonId:e,nodeId:H,...b?{cap:b}:{}}))}:{addonId:e,result:t(await R.addonSettings.getDeviceSettings.query({addonId:e,deviceId:u,nodeId:H}))}:{addonId:e,result:await R.addonSettings.getIntegrationSettings.query({addonId:e,nodeId:H})}},placeholderData:f}))}),ge=U.some(e=>e.isLoading),_e=U.map(e=>{if(!e.data)return`-`;if(e.data.result===null)return`${e.data.addonId}:n`;let t=[];for(let n of e.data.result.sections){t.push(`s:${n.id}:${n.tab??`general`}`);for(let e of n.fields){if(!(`key`in e))continue;let n=`options`in e&&Array.isArray(e.options)?e.options.map(e=>e.value).join(`,`):``,r=e.value,i=r===void 0?``:typeof r==`string`?r:JSON.stringify(r);t.push(`f:${e.key}:${n}:${i}`)}}return`${e.data.addonId}:${t.join(`|`)}`}).join(`||`),W=n(()=>{let e=new Set;for(let t of U){let n=t.data?.result?.sections;if(n)for(let t of n)e.add(oe(t.tab,T))}return[...e]},[T,_e+`::`+U.map(e=>(e.data?.result?.sections??[]).map(e=>e.tab??`general`).join(`,`)).join(`::`)]),G=n(()=>new Map((M??[]).map(e=>[e.id,e])),[M]),K=n(()=>{if(!V)return[];let e=[...new Set([...W,...(M??[]).map(e=>e.id),...(N??[]).map(e=>e.tabId)])],t=e=>{let t=G.get(e);if(t?.order!==void 0)return t.order;let n=h[e];return n?n.order:50};return e.toSorted((e,n)=>{let r=t(e),i=t(n);return r===i?e.localeCompare(n):r-i})},[V,W,M,G,N]),ve=n(()=>{let e=new Map,t=e=>h[e]?.label??e.charAt(0).toUpperCase()+e.slice(1);for(let n of W)e.set(n,t(n));for(let n of N??[])e.has(n.tabId)||e.set(n.tabId,t(n.tabId));for(let t of M??[])e.set(t.id,t.label);for(let[t,n]of Object.entries(E??{}))e.set(t,n);return e},[W,M,N,E]),q=ue===void 0?me:ue,J=V?q&&K.includes(q)?q:K[0]??null:null,ye=e=>{he(e),de?.(e)},be=J!==null&&G.has(J),Y=V?J&&!be?J:void 0:D,{data:xe}=te(void 0),Se=n(()=>{let e=new Map;for(let t of xe??[]){let n=t.manifest?.id;if(!n)continue;let r=t.manifest?.name??t.manifest?.packageDisplayName??n;e.set(n,r)}return e},[xe]),Ce=t(new Map),X=n(()=>{let e=x?new Set(x):null,t=S?new Set(S):null,n=n=>!(e!==null&&!e.has(n)||t!==null&&t.has(n)),r=[];for(let e of U){if(!e.data)continue;let t=e.data.result??Ce.current.get(e.data.addonId)??null;if(e.data.result!==null&&Ce.current.set(e.data.addonId,e.data.result),t===null)continue;let{schema:i,values:a}=se(t),o={...C===void 0?{}:{fieldKeys:C},...w===void 0?{}:{hideSectionChrome:w},...T===void 0?{}:{tabAliases:T}},s=O(i.sections.filter(e=>n(e.id)),o);if(s.length===0)continue;let c={...t,sections:O(t.sections.filter(e=>n(e.id)),o)},l={...i,sections:s};r.push({addonId:e.data.addonId,schemaWithValues:c,schema:l,serverValues:a})}return r},[_e,x,S,C,w,T]),[Z,we]=s(new Map),Te=r(e=>{we(t=>{let n=new Map(t);return n.set(e.addonId,e),n})},[]),Q=t(new Map),Ee=r(e=>t=>{t?Q.current.set(e,t):Q.current.delete(e)},[]),De=r(async(e,t)=>{c===`global`?await z.mutateAsync({addonId:e,nodeId:H,patch:t}):await B.mutateAsync({addonId:e,deviceId:u,nodeId:H,patch:t}),L.invalidateQueries({queryKey:[[`addonSettings`]]})},[z,B,H,c,u,L]),Oe=r(async(e,t,n,r)=>{let i=H;try{switch(t){case`reprobe-hwaccel`:await fe.mutateAsync({nodeId:i}),L.invalidateQueries({queryKey:[[`addonSettings`]]});return;case`reprobe-audio-engine`:await pe.mutateAsync({nodeId:i}),L.invalidateQueries({queryKey:[[`addonSettings`]]});return;default:{let n=await R.addons.custom.mutate({addonId:e,action:t,input:r});return L.invalidateQueries({queryKey:[[`addonSettings`]]}),n}}}catch(n){throw console.error(`[NodeAddonsSettingsPanel] action failed`,{addonId:e,action:t,err:n}),n}},[fe,pe,H,L,R]),ke=r((e,t)=>{De(e,t)},[De]),$=p({mutationFn:async()=>{let e=[];for(let t of X){let n=Z.get(t.addonId);!n||n.pendingKeys.length===0||e.push({addonId:t.addonId,patch:n.pendingValues})}return e.length===0?{saved:[]}:{saved:await Promise.all(e.map(async({addonId:e,patch:t})=>(c===`global`?await z.mutateAsync({addonId:e,nodeId:H,patch:t}):await B.mutateAsync({addonId:e,deviceId:u,nodeId:H,patch:t}),e)))}},onSuccess:({saved:e})=>{for(let t of e)Q.current.get(t)?.discard();L.invalidateQueries({queryKey:[[`addonSettings`]]})}}),Ae=r(()=>{for(let e of Q.current.values())e.discard()},[]),je=n(()=>{let e=0;for(let t of X){let n=Z.get(t.addonId);n&&(e+=n.pendingKeys.length)}return e},[X,Z]),Me=n(()=>{let e=new Map;for(let t of X){let n=Z.get(t.addonId);if(!n||n.pendingKeys.length===0)continue;let r=new Set(n.pendingKeys);for(let n of t.schema.sections){let t=n.tab??`general`;for(let i of n.fields)`key`in i&&r.has(i.key)&&e.set(t,(e.get(t)??0)+1)}}return e},[X,Z]);if(ge)return i(`div`,{className:`h-24 rounded-lg border border-border bg-surface animate-pulse`});let Ne=J&&be?G.get(J):void 0;if(!V&&X.length===0)return i(`div`,{className:`text-[11px] text-foreground-subtle italic`,children:j??I(`settings.nodeAddonsSettingsPanel.noAddonsIn`,{scope:o.length>0?`[${o.join(`, `)}]`:I(`settings.nodeAddonsSettingsPanel.theCurrentSelection`,`the current selection`),level:c})});let Pe=$.isPending;return e(`div`,{className:`space-y-4`,children:[(P||F)&&e(`div`,{className:`border-b border-border pb-2`,children:[P&&i(`h2`,{className:`text-sm font-semibold text-foreground`,children:P}),F&&i(`p`,{className:`text-[11px] text-foreground-subtle mt-0.5`,children:F})]}),V&&i(re,{tabs:K.map(e=>({id:e,label:ve.get(e)??e})),activeId:J,onChange:ye,pendingByTab:Me}),$.isError&&e(`div`,{className:`rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2 text-[11px] text-red-400`,children:[I(`settings.nodeAddonsSettingsPanel.saveFailed`,`Save failed:`),` `,String($.error?.message??$.error)]}),i(_,{tabKey:Ne?`extra:${J??``}`:`tab:${J??``}`,children:Ne?Ne.content:(()=>{let t=Y?X.reduce((e,t)=>e+t.schemaWithValues.sections.filter(e=>(e.tab??`general`)===Y).length,0):0,n=!!Y&&t<=1,r=X.map(e=>({...e,renderedWithValues:{...e.schemaWithValues,sections:e.schemaWithValues.sections.filter(e=>Y?(e.tab??`general`)===Y:!0).map(e=>n?{...e,title:``,description:void 0}:e)}})).filter(e=>e.renderedWithValues.sections.length>0).toSorted((e,t)=>{let n=e=>{let t=1/0;for(let n of e)typeof n.order==`number`&&n.order<t&&(t=n.order);return t},r=n(e.renderedWithValues.sections),i=n(t.renderedWithValues.sections);return r===i?0:r-i}),a=(N??[]).filter(e=>e.tabId===Y),o=a.filter(e=>(e.placement??`before`)===`before`),s=a.filter(e=>e.placement===`after`);return r.length===0&&a.length===0?i(`div`,{className:`text-[11px] text-foreground-subtle italic`,children:j??I(`settings.nodeAddonsSettingsPanel.nothingToConfigureHereFor`,`Nothing to configure here for this node.`)}):e(`div`,{className:`space-y-6`,children:[o.map((e,t)=>i(`div`,{children:e.content},`extra-before-${t}`)),r.length>0&&i(ce,{entries:r,paneStates:Z,displayNames:Se,disabled:Pe,setPaneRef:Ee,onPaneStateChange:Te,onImmediateSave:ke,onAction:Oe,inline:V||!!D}),s.map((e,t)=>i(`div`,{children:e.content},`extra-after-${t}`))]})})()}),!ge&&i(ie,{pendingCount:je,onSave:()=>$.mutate(),onDiscard:Ae,saving:Pe})]})}function ce({entries:t,paneStates:r,displayNames:o,disabled:c,setPaneRef:l,onPaneStateChange:u,onImmediateSave:d,onAction:f,inline:p}){let m=n(()=>[...t].toSorted((e,t)=>{let n=o.get(e.addonId)??e.addonId,r=o.get(t.addonId)??t.addonId;return n.localeCompare(r)}),[t,o]),[h,g]=s(m[0]?.addonId??``);a(()=>{m.length!==0&&(m.find(e=>e.addonId===h)||g(m[0].addonId))},[m,h]);let _=m.find(e=>e.addonId===h)??m[0];if(!_)return null;let v=n(()=>f?(e,t,n,r)=>f(e,t,n,r):void 0,[f]),y=e=>i(C,{ref:l(e.addonId),addonId:e.addonId,schema:e.renderedWithValues,serverValues:e.serverValues,onImmediateSave:d,onStateChange:u,onAction:v,disabled:c},e.addonId);return m.length===1||p?i(`div`,{className:`flex flex-col gap-4`,children:m.map(y)}):e(`div`,{className:`flex flex-col gap-3`,children:[i(`div`,{className:`flex flex-wrap items-center gap-1 border-b border-border shrink-0`,children:m.map(t=>{let n=o.get(t.addonId)??t.addonId,a=t.addonId===_.addonId,s=(r.get(t.addonId)?.pendingKeys.length??0)>0;return e(b,{variant:`unstyled`,type:`button`,onClick:()=>g(t.addonId),className:`relative px-3 py-1.5 text-xs font-medium rounded-t-md transition-colors -mb-px border-b-2 whitespace-nowrap ${a?`text-primary border-primary bg-primary/5`:`text-foreground-subtle border-transparent hover:text-foreground hover:bg-surface-hover`}`,children:[n,s&&i(`span`,{className:`ml-1.5 inline-flex h-1.5 w-1.5 rounded-full bg-amber-400`})]},t.addonId)})}),i(`div`,{className:`space-y-2`,children:m.map(e=>i(`div`,{style:e.addonId===_.addonId?void 0:{display:`none`},children:y(e)},e.addonId))})]})}export{O as n,j as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,K as t,R as n,S as r,V as i,Y as a,et as o,o as s,x as c}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Hi as l,Kt as u,Lr as d,Si as f,Ut as p,Xr as m,Y as h,ai as g,bt as _,ct as v,ga as y,ht as b,li as x,ut as S,xr as C}from"./player-overlays-CATQyQ4F.js";import{hs as w}from"./client-SlkZY5Jo.js";import{n as T,t as E}from"./scissors-vS1vNFdB.js";import{Au as D,Br as O,Du as k,Eu as A,Fl as j,Fr as M,Ir as N,Ji as P,Ko as F,Mf as I,Mu as ee,Ou as te,Pr as ne,Rn as L,Rr as re,Tu as ie,Xr as R,Yr as z,Zi as B,ad as ae,cd as oe,cl as se,dd as ce,el as le,fd as ue,hi as de,id as fe,ju as pe,kf as V,ku as me,ld as he,lr as H,nd as ge,nl as _e,od as ve,of as U,ol as ye,rd as be,sd as xe,td as Se,ud as Ce,vi as W,zl as we,zn as Te,zr as Ee}from"./src-Bo0PxLi8.js";import{t as G}from"./i18n-CPzNqU40.js";import{t as K}from"./useTranslation-BJr-n0es.js";import{D as De,Pr as Oe,S as ke}from"./index-B5JUA6GN.js";import{t as Ae}from"./AdminSectionedPage-C-Sp15FZ.js";import{n as je}from"./authed-media-BB_fTARR.js";import{t as q}from"./format-size-DIxKXxtj.js";import{n as Me,r as Ne,t as Pe}from"./StorageLocationsTable-CUKUl-r4.js";o();var Fe=[{value:`all`,labelKey:`common.all`},{value:`recording`,labelKey:`recordings.activitySection.domainRecordings`},{value:`events`,labelKey:`common.events`}],Ie={recording:`bg-primary/10 text-primary`,events:`bg-violet-500/10 text-violet-400`},Le={columnKey:`at`,dir:`desc`};function Re(e){return new Date(e).toLocaleString()}function ze(){let{t:n,i18n:i}=K(),[o,s]=a(`all`),{data:l,isLoading:u,isError:d}=k({},{refetchOnWindowFocus:!1}),{data:f,isLoading:m,isError:h}=ye({},{refetchOnWindowFocus:!1}),{data:g}=F({isCamera:!0,projection:`slim`}),_=t(()=>{let e=new Map;for(let t of g??[])e.set(t.id,t.name);return e},[g]),v=t(()=>{let e=[...l??[],...f??[]];return(o===`all`?e:e.filter(e=>e.domain===o)).toSorted((e,t)=>t.at-e.at)},[l,f,o]),b=t(()=>{let e=[];return d&&o!==`events`&&e.push(n(`recordings.activitySection.domainRecordings`)),h&&o!==`recording`&&e.push(n(`common.events`)),e},[d,h,o,n]),x=t(()=>new Intl.ListFormat(i.language,{type:`conjunction`}).format(b),[b,i.language]),S=t(()=>[{key:`at`,header:n(`recordings.activitySection.when`,`When`),nowrap:!0,sortValue:e=>e.at,render:e=>r(`span`,{className:`text-foreground-subtle tabular-nums`,children:Re(e.at)})},{key:`domain`,header:n(`recordings.activitySection.domain`,`Domain`),sortValue:e=>e.domain,render:e=>r(`span`,{className:`inline-flex rounded px-1.5 py-0.5 text-[10px] font-medium ${Ie[e.domain]}`,children:e.domain})},{key:`op`,header:n(`recordings.activitySection.operation`,`Operation`),sortValue:e=>e.op,render:e=>r(`span`,{className:`text-foreground`,children:e.op})},{key:`reason`,header:n(`recordings.activitySection.reason`,`Reason`),sortValue:e=>e.reason,render:e=>r(`span`,{className:`text-foreground-subtle`,children:e.reason})},{key:`device`,header:n(`recordings.activitySection.camera`,`Camera`),sortValue:e=>e.deviceId===null?`cluster`:_.get(e.deviceId)??`#${String(e.deviceId)}`,render:e=>e.deviceId===null?r(`span`,{className:`text-foreground-subtle`,children:n(`common.cluster`)}):r(`span`,{className:`text-foreground`,children:_.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`items`,header:n(`recordings.activitySection.items`,`Items`),align:`right`,nowrap:!0,sortValue:e=>e.itemsAffected,render:e=>r(`span`,{className:`tabular-nums`,children:e.itemsAffected.toLocaleString()})},{key:`bytes`,header:n(`recordings.activitySection.reclaimed`,`Reclaimed`),align:`right`,nowrap:!0,sortValue:e=>e.bytesReclaimed,render:e=>r(`span`,{className:`tabular-nums`,children:e.bytesReclaimed>0?q(e.bytesReclaimed):`—`})}],[_,n]),w=u||m;return e(`div`,{className:`flex flex-col gap-4`,children:[r(`div`,{className:`flex items-center gap-1`,children:Fe.map(e=>r(W,{variant:`unstyled`,onClick:()=>s(e.value),className:`rounded px-2 py-1 text-xs font-medium ${o===e.value?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-muted`}`,children:n(e.labelKey)},e.value))}),w&&v.length===0?e(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[r(C,{className:`h-4 w-4 animate-spin`}),n(`recordings.activitySection.loadingActivity`,`Loading activity…`)]}):v.length===0?b.length>0?r(z,{icon:p,title:n(`recordings.activitySection.activityCouldNotBeRead`,`Activity could not be read`),description:n(`recordings.activitySection.theOpsLogDidNot`,`The {{value1}} ops log did not answer. This is not "nothing happened" — retry, or check the node that owns it.`,{value1:x})}):r(z,{icon:y,title:n(`recordings.activitySection.noActivityYet`,`No activity yet`),description:n(`recordings.activitySection.pruneDeleteAndRescanOperations`,`Prune, delete and rescan operations across recordings and events show up here.`)}):e(c,{children:[b.length>0&&e(`p`,{className:`flex items-center gap-1.5 text-[11px] text-amber-500`,children:[r(p,{className:`h-3 w-3 shrink-0`}),n(`recordings.activitySection.domainsMissing`,{count:b.length,names:x})]}),r(L,{columns:S,rows:v,rowKey:e=>e.id,minWidthPx:720,maxBodyHeight:Te,defaultSort:Le})]})]})}o();function Be(){let{t:n}=K(),i=F({isCamera:!0,projection:`slim`}),o=t(()=>(i.data??[]).toSorted((e,t)=>e.name.localeCompare(t.name)),[i.data]),[s,c]=a(null),u=s??o[0]?.id??null;return!i.isLoading&&o.length===0?r(z,{icon:l,title:n(`recordings.cameraRecordingSettingsSection.noCameras`,`No cameras`),description:n(`recordings.cameraRecordingSettingsSection.addACameraFirst`,`Add a camera first.`)}):e(`div`,{className:`space-y-3`,children:[e(`div`,{children:[r(`h2`,{className:`text-sm font-semibold text-foreground`,children:n(`recordings.cameraRecordingSettingsSection.perCameraRecordingRetention`,`Per-camera recording & retention`)}),r(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:n(`recordings.cameraRecordingSettingsSection.recordingModeScheduleBandsAnd`,`Recording mode, schedule bands and the retention policy for one camera — the same controls as the camera's own Recording tab. Retention is one policy over footage and analytics; per-camera event deletion lives on the Events tab.`)})]}),e(`div`,{className:`flex items-center gap-2`,children:[r(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:n(`recordings.cameraRecordingSettingsSection.camera`,`Camera`)}),r(S,{wrapperClassName:`inline-block w-auto`,value:u??``,onChange:e=>c(Number(e.target.value)),children:o.map(e=>r(`option`,{value:e.id,children:e.name},e.id))})]}),u!==null&&r(de,{deviceId:u,children:r(De,{deviceId:u,sectionFilter:e=>e.location===`top-tab`&&e.tab===`recording`})},u)]})}function Ve({types:e}){return r(Pe,{kinds:e})}o();var He=`pipeline-analytics`,Ue=`pipeline-analytics`;function We(e){for(let t of e?.sections??[])for(let e of t.fields??[])if(e.key===`postProcessingNodeId`&&typeof e.value==`string`)return e.value;return`hub`}function Ge(){let{t:n}=K(),i=s(),{nodes:a}=V(),{data:o,isLoading:c}=P({addonId:He,cap:Ue,scope:`cluster`}),l=We(o),u=B({onSuccess:()=>{i.invalidateQueries({queryKey:[[`addonSettings`,`getScopedSettings`]]})}}),d=t(()=>{let e=a.filter(e=>e.isOnline).map(e=>e.id);return[...new Set([`hub`,l,...e])].filter(Boolean)},[a,l]);return e(`div`,{className:`flex flex-col gap-6`,children:[e(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground`,children:n(`pipeline.clusterEventsTab.postProcessingNode`,`Post-processing node`)}),r(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:n(`pipeline.clusterEventsTab.theSingleNodeThatRuns`,`The single node that runs detection post-processing (events, media, audio & motion). Every other node stays inert — no multi-node balancing. Takes effect on addon restart.`)}),e(`div`,{className:`mt-3 flex items-center gap-2`,children:[c?r(C,{className:`h-4 w-4 animate-spin text-foreground-subtle`}):r(S,{wrapperClassName:`inline-block w-auto`,value:l,onChange:e=>{e.target.value!==l&&u.mutate({addonId:He,cap:Ue,scope:`cluster`,patch:{postProcessingNodeId:e.target.value}})},disabled:u.isPending,children:d.map(e=>r(`option`,{value:e,children:e===`hub`?n(`pipeline.clusterEventsTab.hubDefault`,`hub (default)`):e},e))}),u.isPending&&r(C,{className:`h-4 w-4 animate-spin text-primary`})]})]}),e(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[r(`h3`,{className:`mb-1 text-sm font-semibold text-foreground`,children:n(`pipeline.clusterEventsTab.eventsFolder`,`Events folder`)}),r(`p`,{className:`mb-3 text-[11px] text-foreground-subtle`,children:n(`pipeline.clusterEventsTab.whereEventCropsFullFrames`,`Where event crops / full frames are stored. A single folder — no collection / equal-splitting.`)}),r(Ve,{types:[`eventMedia`]})]})]})}o();var Ke=[[`pipelineAnalytics`]],qe=1440*60*1e3;function Je(e,t){return t.get(e)??G.t(`recordings.eventsManagementSection.removedCamera`,{id:String(e)})}var Ye=[{days:1},{days:7},{days:30},{days:90}];function Xe(){let{t:i}=K(),o=s(),c=v(),[l,d]=a(30),[f,p]=a(null),{data:m,isLoading:g}=_e({},{refetchOnWindowFocus:!1}),{data:_}=F({isCamera:!0,projection:`slim`}),y=t(()=>{let e=new Map;for(let t of _??[])e.set(t.id,t.name);return e},[_]),b=n(()=>{o.invalidateQueries({queryKey:Ke})},[o]),w=se({onSuccess:b}),T=le(),D=n(async()=>{await c({title:i(`recordings.eventsManagementSection.pruneTitle`,{count:l}),message:i(`recordings.eventsManagementSection.permanentlyDeletesEveryEventMotion`,`Permanently deletes every event (motion / object / audio) older than the cutoff across all cameras, and their media. This cannot be undone.`),confirmLabel:i(`recordings.eventsManagementSection.pruneEvents`,`Prune events`),variant:`danger`})&&w.mutate({olderThanMs:Date.now()-l*qe,reason:`retention`})},[c,w,l,i]),O=n(async e=>{let t=Je(e.deviceId,y);if(await c({title:i(`recordings.eventsManagementSection.deleteAllEventsFor`,`Delete all events for {{label}}?`,{label:t}),message:i(`recordings.eventsManagementSection.deleteRowsMessage`,{count:e.rows,size:q(e.bytes)}),confirmLabel:i(`recordings.eventsManagementSection.deleteEvents`,`Delete events`),variant:`danger`})){p(null);try{let n=await T.mutateAsync({deviceId:e.deviceId});b();let r=n.motion+n.object+n.audio;if(r===0&&e.bytes>0){p(`0 events deleted for ${t}. Media still listed (${q(e.bytes)}) — those blobs are not event rows; use Management → Count leftovers or Disk reconcile.`);return}p(`Deleted ${String(r)} event${r===1?``:`s`} for ${t}.`)}catch(e){p(e instanceof Error?e.message:String(e))}}},[c,T,y,b,i]),k=t(()=>[{key:`camera`,header:i(`recordings.eventsManagementSection.camera`,`Camera`),render:e=>r(`span`,{className:`text-foreground`,children:Je(e.deviceId,y)})},{key:`rows`,header:i(`recordings.eventsManagementSection.events`,`Events`),align:`right`,nowrap:!0,render:e=>r(`span`,{className:`tabular-nums`,children:e.rows.toLocaleString()})},{key:`bytes`,header:i(`recordings.eventsManagementSection.media`,`Media`),align:`right`,nowrap:!0,render:e=>r(`span`,{className:`tabular-nums`,children:q(e.bytes)})},{key:`actions`,header:``,align:`right`,render:t=>e(W,{variant:`unstyled`,onClick:()=>{O(t)},disabled:T.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10 disabled:opacity-50`,title:i(`recordings.eventsManagementSection.deleteAllEventsForThis`,`Delete all events for this camera`),children:[r(u,{className:`h-3 w-3`}),i(`common.delete`,`Delete`)]})}],[y,O,T.isPending,i]);return g&&!m?e(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[r(C,{className:`h-4 w-4 animate-spin`}),i(`recordings.eventsManagementSection.loadingEventStoreFootprint`,`Loading event-store footprint…`)]}):m?e(`div`,{className:`flex flex-col gap-6`,children:[e(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[r(h,{label:i(`recordings.eventsManagementSection.totalEvents`,`Total events`),icon:r(x,{className:`h-3 w-3`}),footer:`across ${String(m.devices.length)} camera${m.devices.length===1?``:`s`}`,children:m.totalRows.toLocaleString()}),r(h,{label:i(`recordings.eventsManagementSection.eventMediaOnDisk`,`Event media on disk`),children:q(m.totalBytes)})]}),e(`section`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[r(`span`,{className:`text-foreground-subtle`,children:i(`recordings.eventsManagementSection.pruneEventsOlderThan`,`Prune events older than`)}),r(S,{wrapperClassName:`inline-block w-auto`,value:l,onChange:e=>d(Number(e.target.value)),children:Ye.map(e=>r(`option`,{value:e.days,children:i(`recordings.eventsManagementSection.ageDays`,{count:e.days})},e.days))}),e(W,{variant:`unstyled`,onClick:()=>{D()},disabled:w.isPending,className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs font-medium text-foreground-subtle hover:bg-warning/10 hover:text-warning disabled:opacity-50`,children:[w.isPending?r(C,{className:`h-3 w-3 animate-spin`}):r(E,{className:`h-3 w-3`}),i(`recordings.eventsManagementSection.pruneNow`,`Prune now`)]})]}),m.devices.length===0?r(z,{icon:x,title:i(`recordings.eventsManagementSection.noStoredEvents`,`No stored events`),description:i(`recordings.eventsManagementSection.noCameraHasPersistedEvents`,`No camera has persisted events yet.`)}):r(L,{columns:k,rows:[...m.devices],rowKey:e=>e.deviceId,minWidthPx:480}),f===null?null:r(`p`,{className:f.startsWith(`Deleted `)?`text-[11px] text-foreground-subtle`:`text-[11px] text-destructive`,children:f})]}):r(z,{icon:x,title:i(`recordings.eventsManagementSection.noEventData`,`No event data`),description:i(`recordings.eventsManagementSection.pipelineAnalyticsHasNotReported`,`Pipeline analytics has not reported any event-store footprint yet.`)})}function Ze(){let{t}=K();return e(`div`,{className:`flex flex-col gap-8`,children:[e(`div`,{children:[r(`h2`,{className:`text-sm font-semibold text-foreground`,children:t(`recordings.eventsSection.eventStore`,`Event store`)}),r(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:t(`recordings.eventsSection.whatTheDurableEventStore`,`What the durable event store occupies, per camera, with fleet-wide prune-by-age and delete-all-events.`)}),r(`div`,{className:`mt-3`,children:r(Xe,{})})]}),e(`div`,{children:[r(`h2`,{className:`text-sm font-semibold text-foreground`,children:t(`recordings.eventsSection.postProcessingNodeFolders`,`Post-processing node & folders`)}),r(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:t(`recordings.eventsSection.theSingleNodeThatWrites`,`The single node that writes event crops, and the storage location they land in.`)}),r(`div`,{className:`mt-3`,children:r(Ge,{})})]})]})}function Qe(e){let t=[];return e.timelapse?t.push(`timelapse ${String(e.timelapse.everyMs/1e3)}s`):(t.push(`${String(e.speed??1)}×`),e.includeAudio&&t.push(`+ audio`)),t.join(` `)}function $e(e){return new Date(e).toLocaleString(void 0,{day:`2-digit`,month:`short`,hour:`2-digit`,minute:`2-digit`})}function et(e,t){let n=Math.max(0,Math.round((t-e)/1e3)),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60,o=r>0?`${String(r)}:${String(i).padStart(2,`0`)}:${String(a).padStart(2,`0`)}`:`${String(i)}:${String(a).padStart(2,`0`)}`;return`${$e(e)} · ${o}`}function tt(e,t){let n=e-t;if(n<=0)return G.t(`helpers.exportFormat.expired`);let r=Math.floor(n/6e4);if(r<60)return G.t(`helpers.exportFormat.inMinutes`,{n:String(r)});let i=Math.floor(r/60);return i<24?G.t(`helpers.exportFormat.inHours`,{n:String(i)}):G.t(`helpers.exportFormat.inDays`,{n:String(Math.floor(i/24))})}function nt(e,t,n,r){return e.map(e=>{if(e.state===`expired`||e.state===`deleted`)return e;let i=r.get(e.id);if(i)return{...e,state:`failed`,error:i.error,progressPct:null};let a=n.get(e.id);if(a)return{...e,state:`ready`,fileBytes:a.fileBytes,progressPct:100};let o=t.get(e.id);return o&&(e.state===`queued`||e.state===`rendering`)?{...e,state:`rendering`,progressPct:o.progressPct}:e})}o();var rt=[`high`,`mid`,`low`],it=[{value:1,labelKey:`recordings.newExportModal.speedRealTime`},{value:2,labelKey:null},{value:4,labelKey:null},{value:8,labelKey:null},{value:16,labelKey:null}],at=10080*60*1e3;function ot(e){let t=new Date(Date.now()-e*6e4),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function st({onClose:n,onCreated:i}){let{t:o}=K(),s=F({isCamera:!0,projection:`slim`}),c=t(()=>(s.data??[]).toSorted((e,t)=>e.name.localeCompare(t.name)),[s.data]),[l,u]=a(``),[d,f]=a(`high`),[p,h]=a(ot(60)),[g,_]=a(ot(0)),[v,y]=a(1),[b,x]=a(!0),[C,w]=a(``),[T,E]=a(null),k=l===``?c[0]?.id??null:l,A=new Date(p).getTime(),j=new Date(g).getTime(),P=Number.isFinite(A)&&Number.isFinite(j)&&A<j,I=D({onSuccess:()=>{i(),n()},onError:e=>E(e instanceof Error?e.message:String(e))});return r(ne,{open:!0,onOpenChange:e=>!e&&n(),children:e(N,{width:`md`,placement:`sheet-on-mobile`,scroll:`body`,children:[r(Ee,{children:e(O,{className:`flex items-center gap-1.5`,children:[r(m,{className:`h-3.5 w-3.5`}),o(`recordings.newExportModal.newExport`,`New export`)]})}),e(M,{className:`space-y-3`,children:[e(`div`,{className:`grid grid-cols-2 gap-3`,children:[e(`div`,{className:`space-y-1`,children:[r(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:o(`recordings.newExportModal.camera`,`Camera`)}),r(S,{value:k??``,onChange:e=>u(Number(e.target.value)),className:`w-full`,children:c.map(e=>r(`option`,{value:e.id,children:e.name},e.id))})]}),e(`div`,{className:`space-y-1`,children:[r(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:o(`recordings.newExportModal.profile`,`Profile`)}),r(S,{value:d,onChange:e=>f(e.target.value),className:`w-full`,children:rt.map(e=>r(`option`,{value:e,children:e},e))})]})]}),e(`div`,{className:`grid grid-cols-2 gap-3`,children:[e(`div`,{className:`space-y-1`,children:[r(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:o(`recordings.newExportModal.from`,`From`)}),r(U,{type:`datetime-local`,value:p,onChange:e=>h(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`})]}),e(`div`,{className:`space-y-1`,children:[r(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:o(`recordings.newExportModal.to`,`To`)}),r(U,{type:`datetime-local`,value:g,onChange:e=>_(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`})]})]}),e(`div`,{className:`grid grid-cols-2 gap-3`,children:[e(`div`,{className:`space-y-1`,children:[r(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:o(`recordings.newExportModal.speed`,`Speed`)}),r(S,{value:v,onChange:e=>y(Number(e.target.value)),className:`w-full`,children:it.map(e=>r(`option`,{value:e.value,children:e.labelKey===null?`${e.value}×`:o(e.labelKey)},e.value))})]}),e(`div`,{className:`space-y-1`,children:[r(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:o(`recordings.newExportModal.titleOptional`,`Title (optional)`)}),r(U,{type:`text`,value:C,onChange:e=>w(e.target.value),placeholder:o(`recordings.newExportModal.eGCourierAtThe`,`e.g. courier at the gate`),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle`})]})]}),e(`label`,{className:`flex items-center gap-2 text-xs text-foreground cursor-pointer`,children:[r(H,{checked:b,disabled:v!==1,onChange:e=>x(e.target.checked),className:`accent-primary`}),o(v===1?`recordings.newExportModal.includeAudio`:`recordings.newExportModal.includeAudioRealtimeOnly`)]}),!P&&r(`p`,{className:`text-[11px] text-danger`,children:o(`recordings.newExportModal.fromMustBeBeforeTo`,`"From" must be before "To".`)}),T&&r(`p`,{className:`text-[11px] text-danger`,children:T})]}),e(re,{children:[r(W,{variant:`outline`,size:`sm`,onClick:n,children:o(`common.cancel`,`Cancel`)}),r(W,{size:`sm`,onClick:()=>{if(k===null||!P)return;E(null);let e=C.trim();I.mutate({deviceId:k,profile:d,fromMs:A,toMs:j,options:{includeAudio:b,maxLifeMs:at,deleteAfterDownload:!1,...v===1?{}:{speed:v},...e.length>0?{title:e}:{}}})},disabled:k===null||!P||I.isPending,children:I.isPending?o(`recordings.newExportModal.queuing`,`Queuing…`):o(`recordings.newExportModal.createExport`,`Create export`)})]})]})})}o();var ct=[[`recordingExport`]],lt={queued:{cls:`bg-muted text-foreground-subtle`,labelKey:`recordings.exportsSection.queued`},rendering:{cls:`bg-primary/10 text-primary`,labelKey:`recordings.exportsSection.rendering`,spin:!0},ready:{cls:`bg-success/10 text-success`,labelKey:`recordings.exportsSection.ready`},failed:{cls:`bg-danger/10 text-danger`,labelKey:`recordings.exportsSection.failed`},expired:{cls:`bg-muted text-foreground-subtle`,labelKey:`recordings.exportsSection.expired`},deleted:{cls:`bg-muted text-foreground-subtle`,labelKey:`recordings.exportsSection.deleted`}};function ut(){let{data:e,isLoading:n}=ee({},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data??[]).some(e=>e.state===`queued`||e.state===`rendering`)?3e3:!1}),{map:r}=I(w.RecordingExportProgress,e=>e.exportId),{map:i}=I(w.RecordingExportCompleted,e=>e.exportId),{map:a}=I(w.RecordingExportFailed,e=>e.exportId);return{rows:t(()=>nt(e??[],r,i,a),[e,r,i,a]),isLoading:n}}function dt(e){let[t,n]=a(()=>Date.now());return i(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function ft(){let{t:i}=K(),o=s(),[c,l]=a(!1),d=()=>{o.invalidateQueries({queryKey:[[`recordingExport`,`listExports`]]})},p=v(),h=b().trpcClient,_=dt(6e4),{rows:y,isLoading:x}=ut(),{data:S}=F({isCamera:!0,projection:`slim`}),w=t(()=>{let e=new Map;for(let t of S??[])e.set(t.id,t.name);return e},[S]),T=n(()=>{o.invalidateQueries({queryKey:ct})},[o]),E=me({onSuccess:T}),D=pe({onSuccess:T}),[O,k]=a(null),A=n(async e=>{k(e.id);try{let{url:t}=await h.recordingExport.getDownloadUrl.query({exportId:e.id}),n=await je(t),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${e.options.title??e.id}.mp4`,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r),T()}finally{k(null)}},[h,T]),j=n(async e=>{await p({title:i(`recordings.exportsSection.cancelThisExport`,`Cancel this export?`),message:i(`recordings.exportsSection.stopsTheRenderThePartial`,`Stops the render. The partial file is discarded.`),confirmLabel:i(`recordings.exportsSection.cancelExport`,`Cancel export`),variant:`danger`})&&E.mutate({exportId:e.id})},[p,E,i]),M=n(async e=>{await p({title:i(`recordings.exportsSection.deleteThisExport`,`Delete this export?`),message:i(`recordings.exportsSection.permanentlyRemovesTheRenderedFile`,`Permanently removes the rendered file and its history row.`),confirmLabel:i(`common.delete`,`Delete`),variant:`danger`})&&D.mutate({exportId:e.id})},[p,D,i]),N=t(()=>[{key:`camera`,header:i(`recordings.exportsSection.camera`,`Camera`),render:e=>r(`span`,{className:`text-foreground`,children:w.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`range`,header:i(`recordings.exportsSection.range`,`Range`),nowrap:!0,render:e=>r(`span`,{className:`tabular-nums`,children:et(e.fromMs,e.toMs)})},{key:`variant`,header:i(`recordings.exportsSection.variant`,`Variant`),render:e=>r(`span`,{className:`text-foreground-subtle`,children:Qe(e.options)})},{key:`state`,header:i(`recordings.exportsSection.state`,`State`),render:t=>{let n=lt[t.state];return e(`span`,{className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium ${n.cls}`,children:[n.spin&&r(C,{className:`h-2.5 w-2.5 animate-spin`}),i(n.labelKey),t.state===`rendering`&&t.progressPct!==null&&e(`span`,{className:`tabular-nums`,children:[t.progressPct,`%`]})]})}},{key:`expiry`,header:i(`recordings.exportsSection.expires`,`Expires`),nowrap:!0,render:e=>e.state===`deleted`?r(`span`,{className:`text-foreground-subtle`,children:`—`}):r(`span`,{className:`text-foreground-subtle tabular-nums`,children:tt(e.expiresAt,_)})},{key:`size`,header:i(`recordings.exportsSection.size`,`Size`),align:`right`,nowrap:!0,render:e=>r(`span`,{className:`tabular-nums`,children:e.fileBytes===null?`—`:q(e.fileBytes)})},{key:`actions`,header:``,align:`right`,render:t=>{let n=t.state===`ready`,a=t.state===`queued`||t.state===`rendering`,o=t.state!==`deleted`;return e(`div`,{className:`flex items-center justify-end gap-1`,children:[n&&e(W,{variant:`unstyled`,onClick:()=>{A(t)},disabled:O===t.id,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-primary/10 hover:text-foreground disabled:opacity-50`,title:i(`recordings.exportsSection.downloadMp4`,`Download MP4`),children:[O===t.id?r(C,{className:`h-3 w-3 animate-spin`}):r(g,{className:`h-3 w-3`}),i(`recordings.exportsSection.download`,`Download`)]}),a&&e(W,{variant:`unstyled`,onClick:()=>{j(t)},disabled:E.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-amber-500/10 hover:text-amber-500 disabled:opacity-50`,title:i(`recordings.exportsSection.cancelRender`,`Cancel render`),children:[r(f,{className:`h-3 w-3`}),i(`common.cancel`,`Cancel`)]}),o&&r(W,{variant:`unstyled`,onClick:()=>{M(t)},disabled:D.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10 disabled:opacity-50`,title:i(`recordings.exportsSection.deleteExport`,`Delete export`),children:r(u,{className:`h-3 w-3`})})]})}}],[w,_,O,E.isPending,D.isPending,A,j,M,i]);return x&&y.length===0?e(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[r(C,{className:`h-4 w-4 animate-spin`}),i(`recordings.exportsSection.loadingExports`,`Loading exports…`)]}):e(`div`,{className:`space-y-3`,children:[r(`div`,{className:`flex justify-end`,children:e(W,{variant:`unstyled`,onClick:()=>l(!0),className:`inline-flex items-center gap-1.5 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground`,children:[r(m,{className:`h-3.5 w-3.5`}),i(`recordings.exportsSection.newExport`,`New export`)]})}),y.length===0?r(z,{icon:m,title:i(`recordings.exportsSection.noExportsYet`,`No exports yet`),description:i(`recordings.exportsSection.createOneHereNewExport`,`Create one here (New export) or from a camera's timeline in the viewer. Rendered clips show up here to download or manage.`)}):r(L,{columns:N,rows:y,rowKey:e=>e.id,minWidthPx:720}),c&&r(st,{onClose:()=>l(!1),onCreated:d})]})}var pt=`inline-flex w-fit items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-[11px] font-medium border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50`;o();var mt=`storage-migration`,ht=new Set([`orphans`,`debug-media`,`ghost-ledger`]);function gt(e){return[`${e.orphansReclaimed} orphan rows (${q(e.orphanBytesReclaimed)})`,e.includeDebugMedia?`${e.debugMediaReclaimed} debug files (${q(e.debugMediaBytesReclaimed)})`:null,`${e.ghostsForgotten} ghost rows (${q(e.ghostBytesForgotten)})`].filter(e=>e!==null).join(` · `)}function _t(){let{t:e}=K(),t=R(mt);return t===`pending`?null:t===`unknown`?r(`p`,{className:`py-2 text-xs text-foreground-subtle`,children:e(`recordings.cleanupSection.couldNotCheckWhetherStorage`,`Could not check whether storage cleanup is installed on this hub.`)}):t===`present`?r(vt,{}):null}function vt(){let{t}=K(),n=v(),[i,o]=a(!1),[s,c]=a(null),l=ae({},{refetchInterval:2e3}),d=l.data??null,f=d!==null&&ht.has(d.phase),p=fe(),m=be(),h=async()=>{if(await n({title:t(`recordings.cleanupSection.runStorageCleanup`,`Run storage cleanup?`),message:i?t(`recordings.cleanupSection.reclaimsLeftoverAnalyticsRowsAnd`,`Reclaims leftover analytics rows and files, debug stills/filmstrips, and ghost footage rows on frozen locations. Safe to re-run.`):t(`recordings.cleanupSection.reclaimsLeftoverAnalyticsRowsAnd2`,`Reclaims leftover analytics rows and files, and ghost footage rows on frozen locations. Debug stills are left alone. Safe to re-run.`),confirmLabel:t(`recordings.cleanupSection.runCleanup`,`Run cleanup`),variant:`danger`})){c(null);try{await p.mutateAsync({includeDebugMedia:i}),await l.refetch()}catch(e){c(e instanceof Error?e.message:String(e))}}},g=async()=>{if(d&&await n({title:t(`recordings.cleanupSection.cancelCleanup`,`Cancel cleanup?`),message:t(`recordings.cleanupSection.stopsAfterTheCurrentStep`,`Stops after the current step. Work already done stays done.`),confirmLabel:t(`recordings.cleanupSection.cancelCleanup2`,`Cancel cleanup`),variant:`danger`}))try{await m.mutateAsync({jobId:d.jobId}),await l.refetch()}catch{}};return e(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[r(`h2`,{className:`text-sm font-semibold text-foreground`,children:t(`recordings.cleanupSection.cleanup`,`Cleanup`)}),r(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:t(`recordings.cleanupSection.onePassOverLeftoverAnalytics`,`One pass over leftover analytics (database + files) and ghost footage rows on frozen locations. Does not time out — progress updates here until it finishes.`)}),e(`label`,{className:`mt-3 flex items-start gap-2 text-[11px] text-foreground`,children:[r(H,{checked:i,disabled:f,onChange:e=>{o(e.target.checked)},className:`mt-0.5 h-3.5 w-3.5 accent-primary`}),r(`span`,{children:t(`recordings.cleanupSection.alsoRemoveDebugMediaMotion`,`Also remove debug media (motion stills and track filmstrips)`)})]}),e(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[e(W,{variant:`unstyled`,type:`button`,disabled:f||p.isPending,onClick:()=>{h()},className:pt,children:[(f||p.isPending)&&r(C,{className:`h-3 w-3 animate-spin`}),r(u,{className:`h-3 w-3`}),t(`recordings.cleanupSection.runCleanup`,`Run cleanup`)]}),f&&r(W,{variant:`unstyled`,type:`button`,onClick:()=>{g()},className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10`,children:t(`common.cancel`,`Cancel`)})]}),s&&r(`p`,{className:`mt-2 text-[11px] text-danger`,children:s}),d&&e(`div`,{className:`mt-3 space-y-1 rounded-md border border-border px-2.5 py-2`,children:[e(`p`,{className:`text-xs text-foreground`,children:[t(`recordings.cleanupSection.phase`,`Phase:`),` `,r(`span`,{className:`font-medium`,children:d.phase}),f&&r(C,{className:`ml-2 inline h-3 w-3 animate-spin text-primary`})]}),d.detail&&r(`p`,{className:`text-[11px] text-foreground-subtle`,children:d.detail}),r(`p`,{className:`text-[11px] text-foreground-subtle`,children:gt(d)}),d.error&&r(`p`,{className:`text-[11px] text-danger`,children:d.error})]})]})}o();var yt=2e3;function bt(){let{t}=K(),n=v(),a=s(),o=we(),c=j(void 0,{refetchInterval:e=>e.state.data?.state===`running`?yt:!1}),l=c.data,u=l?.state===`running`,f=u||o.isPending;i(()=>{l?.state!==`done`||l.finishedAtMs===null||(a.invalidateQueries({queryKey:[[`recording`]]}),a.invalidateQueries({queryKey:[[`pipelineAnalytics`]]}))},[l?.state,l?.finishedAtMs,a]);let p=async()=>{await n({title:t(`recordings.diskReconcileSection.reconcileStorageFromDisk`,`Reconcile storage from disk?`),message:t(`recordings.diskReconcileSection.makesTheDatabaseMatchThe`,`Makes the database match the filesystem: recordings index, tracks, events and media whose files are gone. Favourited tracks without files are deleted. Snapshot-less motion/audio events are deleted. Enrolled identities stay. This cannot be undone.`),confirmLabel:t(`recordings.diskReconcileSection.reconcile`,`Reconcile`),variant:`warning`})&&(await o.mutateAsync(),await c.refetch())},m=u?l.total>0?`Reconciling ${String(l.completed)}/${String(l.total)}…`:`Reconciling…`:o.isPending?`Reconciling…`:`Reconcile from disk`;return e(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(`recordings.diskReconcileSection.diskReconcile`,`Disk reconcile`)}),r(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:t(`recordings.diskReconcileSection.deletesDatabaseRowsWhoseFiles`,`Deletes database rows whose files are gone. Enrolled identities stay.`)}),e(`div`,{className:`mt-3 flex flex-col gap-2`,children:[e(W,{variant:`unstyled`,type:`button`,onClick:()=>void p(),disabled:f,className:`inline-flex w-fit items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-[11px] font-medium border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50`,children:[f?r(C,{className:`h-3.5 w-3.5 animate-spin`}):r(d,{className:`h-3.5 w-3.5`}),m]}),l?.state===`done`?e(`p`,{className:`text-[11px] text-foreground-subtle`,children:[t(`recordings.diskReconcileSection.lastRun`,`Last run:`),` `,t(`recordings.diskReconcileSection.summary`,{completed:String(l.completed),tracks:String(l.tracks),events:String(l.events),media:String(l.mediaDropped)}),l.failed.length>0?t(`recordings.diskReconcileSection.failed`,`, {{value1}} failed ({{value2}})`,{value1:String(l.failed.length),value2:l.failed.join(`, `)}):``,`.`]}):null,l?.state===`error`&&l.error!==null?e(`p`,{className:`text-[11px] text-destructive`,children:[t(`recordings.diskReconcileSection.reconcileFailed`,`Reconcile failed:`),` `,l.error]}):null]})]})}var J=1e3,Y=60*J,X=60*Y;function Z(e){return e.toLocaleString(`en-US`)}function xt(e){if(!Number.isFinite(e)||e<0)return`—`;if(e>=X){let t=Math.floor(e/X),n=Math.round(e%X/Y);return`${t.toString()}h ${n.toString()}m`}if(e>=Y){let t=Math.floor(e/Y),n=Math.round(e%Y/J);return`${t.toString()}m ${n.toString()}s`}return`${Math.max(0,Math.round(e/J)).toString()}s`}function St(e){let t=Math.max(0,e.observedAt-e.startedAt),n=e.filesTotal===null?`${Z(e.filesMoved)} files`:`${Z(e.filesMoved)} / ${Z(e.filesTotal)} files`,r=e.filesTotal===null||e.filesTotal===0?null:Math.min(1,e.filesMoved/e.filesTotal),i=t>0&&e.filesMoved>0,a=i?`${q(e.bytesMoved/t*J)}/s`:null,o=e.filesTotal===null?null:e.filesTotal-e.filesMoved,s=!i||o===null||o<=0?null:`~${xt(o*t/e.filesMoved)} left`;return{counted:n,fraction:r,moved:`${q(e.bytesMoved)} moved`,rate:a,eta:s}}function Ct(e){let t=St(e);return[t.counted,t.moved,t.rate,t.eta].filter(e=>e!==null).join(` · `)}o();var wt=`storage-migration`,Q=[{id:`recordings`,labelKey:`recordings.storageMigrationSection.classRecordings`,locationType:`recordings`},{id:`recordingsLow`,labelKey:`recordings.storageMigrationSection.classRecordingsLow`,locationType:`recordingsLow`},{id:`eventMedia`,labelKey:`recordings.storageMigrationSection.classEventMedia`,locationType:`eventMedia`}],Tt=new Set([`planning`,`sealing`,`pausing`,`moving`,`draining`,`verifying`,`repointing`,`refreshing`,`resuming`]);function Et(){let{t}=K(),n=R(wt);return n===`pending`?e(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[r(C,{className:`h-4 w-4 animate-spin`}),t(`migration.storageMigrationSection.checkingWhetherStorageMigrationIs`,`Checking whether storage migration is installed…`)]}):n===`unknown`?r(z,{icon:p,title:t(`migration.storageMigrationSection.couldnTCheckWhetherStorage`,`Couldn't check whether storage migration is installed`),description:t(`migration.storageMigrationSection.theCapabilityRegistryDidNot`,`The capability registry did not answer, so this panel has nothing to report either way — it is not a statement that the capability is missing. Reload to ask again.`)}):n===`absent`?r(z,{icon:T,title:t(`migration.storageMigrationSection.storageMigrationNotInstalled`,`Storage migration not installed`),description:t(`migration.storageMigrationSection.theCapabilityRegistryAnsweredNo`,`The capability registry answered: no addon in this cluster provides storage-migration. Once one is deployed, this panel moves recordings, low-res recordings and event media to new storage locations in one coordinated, verified operation.`)}):r(Dt,{})}function Dt(){let{t:n}=K(),i=v(),{data:o}=Se({}),[s,c]=a({}),[l,u]=a({}),[d,f]=a(null),[p,m]=a(null),h=t(()=>{let e=new Map;for(let t of o??[]){let n=e.get(t.type);n?n.push(t):e.set(t.type,[t])}return e},[o]),g=t(()=>{let e=new Map;for(let t of o??[]){if(t.enabled===!1)continue;let n=e.get(t.type);n?n.push(t.id):e.set(t.type,[t.id])}let t=new Map;for(let[n,r]of e)r.length===1&&t.set(n,r[0]);return t},[o]),y=ue({},{refetchInterval:2e3}),b=y.data??null,x=b!==null&&Tt.has(b.phase),w=t(()=>{let e={};for(let t of Q){let n=s[t.id];n&&(e[t.id]=n)}return Object.keys(e).length>0?e:void 0},[s]),E=t(()=>{let e={};for(let t of Q){if(!s[t.id])continue;let n=l[t.id]??g.get(t.locationType);n&&(e[t.id]=n)}return Object.keys(e).length>0?e:void 0},[s,l,g]),D=t(()=>({destinations:w??{},...E?{sources:E}:{}}),[w,E]),O=he(D,{enabled:!1,retry:!1}),k=ce(),A=ge(),j=async()=>{if(!w)return;m(null);let e=await O.refetch();if(e.error){m(e.error instanceof Error?e.error.message:String(e.error));return}f(e.data??null)},M=async()=>{if(w&&await i({title:n(`migration.storageMigrationSection.startStorageMigration`,`Start storage migration?`),message:n(`migration.storageMigrationSection.copiesTheSelectedClassesFrom`,`Copies the selected classes from the chosen source to the destination, verifies, then either makes the destination the default (if the source was) or disables the source. Safe to re-run if interrupted.`),confirmLabel:n(`migration.storageMigrationSection.startMigration`,`Start migration`),variant:`danger`})){m(null);try{await k.mutateAsync(D),f(null),await y.refetch()}catch(e){m(e instanceof Error?e.message:String(e))}}},N=async()=>{if(b&&await i({title:n(`migration.storageMigrationSection.cancelMigration`,`Cancel migration?`),message:n(`migration.storageMigrationSection.stopsTheInProgressMigration`,`Stops the in-progress migration. Data already moved and verified stays at the destination; anything already repointed is not reverted.`),confirmLabel:n(`migration.storageMigrationSection.cancelMigration2`,`Cancel migration`),variant:`danger`}))try{await A.mutateAsync({jobId:b.jobId}),await y.refetch()}catch{}};return e(`div`,{className:`flex flex-col gap-6`,children:[e(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[e(`h3`,{className:`flex items-center gap-1.5 text-sm font-semibold text-foreground`,children:[r(T,{className:`h-3.5 w-3.5`}),n(`migration.storageMigrationSection.storageMigration`,`Storage migration`)]}),r(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:n(`migration.storageMigrationSection.moveRecordingsLowResRecordings`,`Move recordings, low-res recordings and/or event media from one location to another: copies via the recorder / pipeline-analytics movers, verifies, then either repoints the default (when the source was the default) or disables the source (when it was not). Skip a class with an empty destination.`)}),r(`div`,{className:`mt-3 grid grid-cols-1 gap-3 sm:grid-cols-3`,children:Q.map(t=>{let i=h.get(t.locationType)??[],a=g.get(t.locationType)??``;return e(`div`,{className:`space-y-2`,children:[r(`div`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:n(t.labelKey)}),e(`div`,{className:`space-y-1`,children:[r(`label`,{htmlFor:`migration-from-${t.id}`,className:`text-[10px] text-foreground-subtle`,children:n(`recordings.storageMigrationSection.classFrom`,{label:n(t.labelKey)})}),r(S,{id:`migration-from-${t.id}`,value:l[t.id]??a,onChange:e=>{let n=e.target.value;u(e=>({...e,[t.id]:n}))},disabled:x,className:`w-full`,children:i.map(t=>e(`option`,{value:t.id,children:[t.displayName,t.enabled===!1?` (${n(`recordings.storageMigrationSection.readOnly`)})`:``]},t.id))})]}),e(`div`,{className:`space-y-1`,children:[r(`label`,{htmlFor:`migration-dest-${t.id}`,className:`text-[10px] text-foreground-subtle`,children:n(`recordings.storageMigrationSection.classTo`,{label:n(t.labelKey)})}),e(S,{id:`migration-dest-${t.id}`,value:s[t.id]??``,onChange:e=>{let n=e.target.value;c(e=>({...e,[t.id]:n}))},disabled:x,className:`w-full`,children:[r(`option`,{value:``,children:n(`migration.storageMigrationSection.skip`,`— skip —`)}),i.map(e=>r(`option`,{value:e.id,children:e.displayName},e.id))]})]})]},t.id)})}),p&&r(`p`,{className:`mt-2 text-[11px] text-danger`,children:p}),e(`div`,{className:`mt-3 flex items-center gap-2`,children:[e(W,{variant:`unstyled`,type:`button`,onClick:()=>{j()},disabled:!w||O.isFetching||x,className:`inline-flex items-center gap-1.5 rounded border border-border px-2.5 py-1.5 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover disabled:opacity-50`,children:[O.isFetching&&r(C,{className:`h-3 w-3 animate-spin`}),n(`migration.storageMigrationSection.plan`,`Plan`)]}),e(W,{variant:`unstyled`,type:`button`,onClick:()=>{M()},disabled:!w||k.isPending||x,className:`inline-flex items-center gap-1.5 rounded bg-primary px-2.5 py-1.5 text-xs font-medium text-primary-foreground disabled:opacity-50`,children:[k.isPending&&r(C,{className:`h-3 w-3 animate-spin`}),n(`migration.storageMigrationSection.startMigration`,`Start migration`)]})]}),d&&r(`div`,{className:`mt-3 divide-y divide-border rounded-md border border-border`,children:d.moves.length===0?r(`p`,{className:`px-2.5 py-1.5 text-[11px] text-foreground-subtle`,children:n(`migration.storageMigrationSection.nothingToMoveSelectedDestinations`,`Nothing to move — selected destinations match the current defaults.`)}):d.moves.map(t=>e(`div`,{className:`px-2.5 py-1.5 text-[11px] text-foreground`,children:[t.storageClass,`: `,t.fromLocationId,` → `,t.toLocationId]},`${t.storageClass}-${t.toLocationId}`))}),b&&e(`div`,{className:`mt-4 border-t border-border pt-3`,children:[e(`div`,{className:`flex items-center justify-between`,children:[r(`h4`,{className:`text-xs font-semibold text-foreground`,children:n(`migration.storageMigrationSection.migrationStatus`,`Migration status`)}),x&&e(W,{variant:`unstyled`,type:`button`,onClick:()=>{N()},className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10`,children:[r(_,{className:`h-3 w-3`}),n(`common.cancel`,`Cancel`)]})]}),e(`p`,{className:`mt-1 text-xs text-foreground`,children:[n(`migration.storageMigrationSection.phase`,`Phase:`),` `,r(`span`,{className:`font-medium`,children:b.phase}),x&&r(C,{className:`ml-2 inline h-3 w-3 animate-spin text-primary`})]}),b.error&&r(`p`,{className:`mt-1 text-[11px] text-danger`,children:b.error}),b.pausedParticipants.length>0&&e(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:[n(`migration.storageMigrationSection.paused`,`Paused:`),` `,b.pausedParticipants.join(`, `)]}),r(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:b.moves.map(e=>r(Ot,{move:e},`${e.storageClass}-${e.fromLocationId}`))})]}),r(kt,{})]}),r(At,{running:x}),r(Mt,{})]})}function Ot({move:t}){let{t:n}=K(),i=t.progress===null?null:St(t.progress);return e(`div`,{className:`px-2.5 py-1.5 text-[11px]`,children:[e(`div`,{className:`flex items-center justify-between`,children:[e(`span`,{className:`text-foreground`,children:[t.storageClass,`: `,t.fromLocationId,` → `,t.toLocationId]}),e(`span`,{className:`text-foreground-subtle`,children:[t.state??n(`common.pending`),t.error?` (${t.error})`:``]})]}),t.progress!==null&&e(`div`,{className:`mt-1 space-y-1`,children:[i!==null&&i.fraction!==null&&r(`div`,{className:`h-1 w-full overflow-hidden rounded bg-border`,children:r(`div`,{className:`h-full bg-primary`,style:{width:`${(i.fraction*100).toFixed(1)}%`}})}),r(`p`,{className:`text-[10px] text-foreground-subtle`,children:Ct(t.progress)})]})]})}function kt(){let{t}=K(),{data:n}=xe({});return!n||n.length===0?null:e(`div`,{className:`mt-4 border-t border-border pt-3`,children:[r(`h4`,{className:`text-xs font-semibold text-foreground`,children:t(`migration.storageMigrationSection.migrationHistory`,`Migration history`)}),r(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:n.map(t=>e(`div`,{className:`px-2.5 py-1.5 text-[11px] text-foreground-subtle`,children:[r(`span`,{className:`font-medium text-foreground`,children:t.phase}),` · `,Object.entries(t.destinations).filter(e=>typeof e[1]==`string`).map(([e,t])=>`${e} → ${t}`).join(`, `),` · `,new Date(t.startedAt).toLocaleString()]},t.jobId))})]})}function At({running:t}){let{t:n}=K(),i=v(),o=Ce({},{staleTime:1/0,refetchOnWindowFocus:!1}),s=ve(),[c,l]=a(null),u=o.data??[];if(u.length===0)return null;let d=async e=>{if(await i({title:n(`migration.storageMigrationSection.drainRemaining`,`Drain remaining {{storageClass}}?`,{storageClass:e.storageClass}),message:`Moves what is still on ${e.fromLocationId} to ${e.toLocationId}. Nothing is paused and no default is changed — this is the second half of a migration, run on its own. It is resumable: cancelling leaves everything readable from both locations.`,confirmLabel:n(`migration.storageMigrationSection.drainRemaining2`,`Drain remaining`),variant:`danger`})){l(null);try{await s.mutateAsync({classes:[e.storageClass]}),await o.refetch()}catch(e){l(e instanceof Error?e.message:String(e))}}};return e(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[e(`div`,{className:`flex items-start justify-between gap-2`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground`,children:n(`migration.storageMigrationSection.leftOnTheOldLocation`,`Left on the old location`)}),e(`div`,{className:`flex shrink-0 items-center gap-2`,children:[r(`span`,{className:`text-[10px] text-foreground-subtle`,children:o.dataUpdatedAt>0?n(`migration.storageMigrationSection.measured`,`Measured {{value1}}`,{value1:new Date(o.dataUpdatedAt).toLocaleTimeString()}):n(`migration.storageMigrationSection.measuredNever`,`Measured — never`)}),r(W,{variant:`unstyled`,type:`button`,onClick:()=>{o.refetch()},disabled:o.isFetching,className:`rounded border border-border px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-surface-hover hover:text-foreground disabled:opacity-50`,children:o.isFetching?n(`migration.storageMigrationSection.counting`,`Counting…`):n(`common.refresh`,`Refresh`)})]})]}),r(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:n(`migration.storageMigrationSection.aMigrationRepointsFirstAnd`,`A migration repoints first and drains behind. If the drain was cancelled, failed, or was interrupted by a restart, the data below is still on the source — readable, but not where the defaults now point. Draining moves it; it changes no default and pauses nothing.`)}),r(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:n(`migration.storageMigrationSection.thisCountIsTakenOn`,`This count is taken on demand: measuring it walks the whole media collection, so it is not refreshed on a timer. Press Refresh after a drain finishes.`)}),c&&r(`p`,{className:`mt-2 text-[11px] text-danger`,children:c}),r(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:u.map(i=>e(`div`,{className:`flex items-center justify-between gap-2 px-2.5 py-1.5 text-[11px]`,children:[e(`span`,{className:`text-foreground`,children:[i.storageClass,`: `,i.fromLocationId,` → `,i.toLocationId,r(`span`,{className:`ml-2 text-foreground-subtle`,children:jt(i)})]}),r(W,{variant:`unstyled`,type:`button`,onClick:()=>{d(i)},disabled:t||s.isPending,className:`shrink-0 rounded border border-border px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-surface-hover hover:text-foreground disabled:opacity-50`,children:n(`migration.storageMigrationSection.drainRemaining2`,`Drain remaining`)})]},`${i.storageClass}-${i.fromLocationId}`))})]})}function jt(e){if(e.items===null)return G.t(`recordings.storageMigrationSection.residueUnknown`);let t=e.items.toLocaleString(`en-US`);return e.bytes===null?G.t(`recordings.storageMigrationSection.residueRows`,{count:e.items,items:t}):G.t(`recordings.storageMigrationSection.residueSegments`,{count:e.items,items:t,size:q(e.bytes)})}function Mt(){let{t}=K(),{data:n}=oe({},{refetchInterval:2e3}),i=(n??[]).filter(e=>e.migrationJobId===null&&e.job.state===`running`);return i.length===0?null:e(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(`migration.storageMigrationSection.moversRunningOutsideAMigration`,`Movers running outside a migration`)}),r(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:i.map(t=>e(`div`,{className:`px-2.5 py-1.5 text-[11px]`,children:[e(`div`,{className:`text-foreground`,children:[t.lane,`: `,t.job.fromLocationId,` → `,t.job.toLocationId]}),r(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:Ct({filesMoved:t.job.filesMoved,filesTotal:t.job.filesTotal,bytesMoved:t.job.bytesMoved,startedAt:t.job.startedAt,observedAt:t.observedAt})})]},t.job.jobId))})]})}function Nt(){let{t}=K();return e(`div`,{className:`flex flex-col gap-4`,children:[r(_t,{}),r(bt,{}),e(`section`,{children:[r(`h2`,{className:`text-sm font-semibold text-foreground`,children:t(`recordings.recordingsManagementSection.moveStorage`,`Move storage`)}),r(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:t(`recordings.recordingsManagementSection.copyRecordingsLowResRecordings`,`Copy recordings, low-res recordings or event media to a new location, verify, then repoint the default. Applies to every camera.`)}),r(`div`,{className:`mt-3`,children:r(Et,{})})]})]})}o();var Pt=`recorder`,Ft=`recording`;function It(e,t,n){for(let n of e?.sections??[])for(let e of n.fields??[])if(e.key===t&&typeof e.value==`string`)return e.value;return n}function Lt(){let{t:n}=K(),i=s(),{nodes:a}=V(),{data:o,isLoading:c}=P({addonId:Pt,cap:Ft,scope:`cluster`}),l=It(o,`recordingNodeId`,`hub`),u=B({onSuccess:()=>{i.invalidateQueries({queryKey:[[`addonSettings`,`getScopedSettings`]]})}}),d=t(()=>{let e=a.filter(e=>e.isOnline).map(e=>e.id);return[...new Set([`hub`,l,...e])].filter(Boolean)},[a,l]);return e(`div`,{className:`flex flex-col gap-6`,children:[e(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground`,children:n(`pipeline.clusterRecordingTab.recordingNode`,`Recording node`)}),r(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:n(`pipeline.clusterRecordingTab.theSingleNodeThatRecords`,`The single node that records (continuous & events) and serves playback. Every other node stays inert — no multi-node balancing. Takes effect on addon restart.`)}),e(`div`,{className:`mt-3 flex items-center gap-2`,children:[c?r(C,{className:`h-4 w-4 animate-spin text-foreground-subtle`}):r(S,{wrapperClassName:`inline-block w-auto`,value:l,onChange:e=>{e.target.value!==l&&u.mutate({addonId:Pt,cap:Ft,scope:`cluster`,patch:{recordingNodeId:e.target.value}})},disabled:u.isPending,children:d.map(e=>r(`option`,{value:e,children:e===`hub`?n(`pipeline.clusterRecordingTab.hubDefault`,`hub (default)`):e},e))}),u.isPending&&r(C,{className:`h-4 w-4 animate-spin text-primary`})]}),l!==`hub`&&r(`p`,{className:`mt-2 text-[11px] text-amber-500`,children:r(Oe,{i18nKey:`pipeline.clusterRecordingTab.hubOnlyNote`,values:{node:l},components:{b:r(`span`,{className:`font-medium`})}})})]}),e(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[r(`h3`,{className:`mb-1 text-sm font-semibold text-foreground`,children:n(`pipeline.clusterRecordingTab.recordingsFolders`,`Recordings folders`)}),r(`p`,{className:`mb-3 text-[11px] text-foreground-subtle`,children:n(`pipeline.clusterRecordingTab.whereRecordingsAreStoredMulti`,`Where recordings are stored. Multi-location collections — segments are split across the locations of a type. Add a location to grow capacity; mark one default per type.`)}),r(Ve,{types:[`recordings`,`recordingsLow`]})]})]})}function Rt(e){return e.locationIds!==void 0&&e.locationIds.length>0?e.locationIds:e.locationId===null?[]:[e.locationId]}function zt(e,t){let n=Rt(e);return n.length===0?G.t(`helpers.cameraDisk.defaultRoot`):n.map(e=>t.get(e)??e).join(` + `)}function Bt(e,t,n){if(e.length===0)return null;let r=e[0];if(e.length===1&&r!==void 0)return{label:zt(r,t),exact:!0};if(n===null)return null;let i=e.find(e=>Rt(e).includes(n));return i===void 0?null:{label:zt(i,t),exact:!1}}o();var Vt=[[`recording`]],Ht=[{value:`retention`,labelKey:`recordings.storageSection.pruneRetention`},{value:`quota`,labelKey:`recordings.storageSection.pruneQuota`},{value:`operator`,labelKey:`recordings.storageSection.pruneOperator`}],Ut={ok:`bg-primary`,warn:`bg-amber-500`,critical:`bg-danger`},Wt={ok:`text-foreground-subtle`,warn:`text-amber-500`,critical:`text-danger`};function $(e){return`${String(Math.round(e*100))}%`}function Gt(e){return e==null?`—`:new Date(e).toLocaleString()}function Kt(e,t){let n=e.locationIds??(e.locationId===null?[]:[e.locationId]),r=n.map(e=>t.get(e)).filter(e=>e!==void 0);return r.length>0?r.join(` + `):e.root===void 0?n.length>0?n.join(` + `):G.t(`recordings.storageSection.defaultRoot`):e.root}function qt(){let{t:i}=K(),o=s(),c=v(),[l,f]=a(`retention`),{data:p,isLoading:m}=A({},{refetchOnWindowFocus:!1}),{data:g}=F({isCamera:!0,projection:`slim`}),{data:_}=Se({}),y=t(()=>{let e=new Map;for(let t of g??[])e.set(t.id,t.name);return e},[g]),b=t(()=>{let e=new Map;for(let t of _??[])e.set(t.id,t.displayName);return e},[_]),x=t(()=>{let e=_??[];return e.find(e=>e.type===`recordings`&&e.enabled!==!1)?.id??e.find(e=>e.type===`recordings`)?.id??null},[_]),w=t(()=>p?.locations??[],[p?.locations]),T=t(()=>Bt(w,b,x),[w,b,x]),D=t(()=>Ne(w),[w]),O=n(()=>{o.invalidateQueries({queryKey:Vt})},[o]),k=te({onSuccess:O}),j=ie({onSuccess:O}),M=n(async e=>{await c({title:i(`recordings.storageSection.prune`,`Prune {{label}}?`,{label:y.get(e.deviceId)??`#${String(e.deviceId)}`}),message:i(`recordings.storageSection.appliesTheRetentionPolicyNow`,`Applies the retention policy now (reason: {{reason}}). Footage beyond the policy is permanently deleted.`,{reason:l}),confirmLabel:i(`recordings.storageSection.pruneNow`,`Prune now`),variant:`danger`})&&k.mutate({deviceId:e.deviceId,reason:l})},[c,k,l,y,i]),N=n(async e=>{await c({title:i(`recordings.storageSection.deleteAllFootageFor`,`Delete all footage for {{label}}?`,{label:y.get(e.deviceId)??`#${String(e.deviceId)}`}),message:i(`recordings.storageSection.permanentlyDeletesOfRecordedFootage`,`Permanently deletes {{value1}} of recorded footage for this camera. This cannot be undone.`,{value1:q(e.usedBytes)}),confirmLabel:i(`recordings.storageSection.delete`,`Delete {{value1}}`,{value1:q(e.usedBytes)}),variant:`danger`})&&j.mutate({deviceId:e.deviceId})},[c,j,y,i]),P=t(()=>[{key:`camera`,header:i(`recordings.storageSection.camera`,`Camera`),render:e=>r(`span`,{className:`text-foreground`,children:y.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`disk`,header:i(`recordings.storageSection.disk`,`Disk`),nowrap:!0,render:()=>T===null?r(`span`,{className:`text-foreground-subtle`,children:`—`}):e(`span`,{className:T.exact?`text-foreground`:`text-foreground-subtle`,title:T.exact?i(`recordings.storageSection.theOnlyRecordingsVolumeOn`,`The only recordings volume on this node — this camera can only be here.`):i(`recordings.storageSection.theRecordingsDefaultThisNode`,`The recordings DEFAULT. This node has several recordings volumes and the per-camera placement is not reported by recording.getStorageUsage, so this is where footage lands by default rather than a per-camera fact.`),children:[T.label,!T.exact&&r(`span`,{className:`ml-1 text-foreground-subtle`,children:i(`recordings.storageSection.default`,`(default)`)})]})},{key:`used`,header:i(`recordings.storageSection.used`,`Used`),align:`right`,nowrap:!0,render:e=>r(`span`,{className:`tabular-nums`,children:q(e.usedBytes)})},{key:`oldest`,header:i(`recordings.storageSection.oldestFootage`,`Oldest footage`),align:`right`,nowrap:!0,render:e=>r(`span`,{className:`tabular-nums text-foreground-subtle`,title:i(`recordings.storageSection.theOldestSegmentTheArchive`,`The oldest segment the ARCHIVE holds for this camera — the per-camera answer to 'is retention actually holding?'.`),children:Gt(e.oldestMs)})},{key:`actions`,header:``,align:`right`,render:t=>e(`div`,{className:`flex items-center justify-end gap-1`,children:[e(W,{variant:`unstyled`,onClick:()=>{M(t)},disabled:k.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-amber-500/10 hover:text-amber-500 disabled:opacity-50`,title:i(`recordings.storageSection.applyRetentionPolicyNow`,`Apply retention policy now`),children:[r(E,{className:`h-3 w-3`}),i(`recordings.storageSection.prune2`,`Prune`)]}),e(W,{variant:`unstyled`,onClick:()=>{N(t)},disabled:j.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10 disabled:opacity-50`,title:i(`recordings.storageSection.deleteAllFootage`,`Delete all footage`),children:[r(u,{className:`h-3 w-3`}),i(`common.delete`,`Delete`)]})]})}],[y,T,M,N,k.isPending,j.isPending,i]);if(m&&!p)return e(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[r(C,{className:`h-4 w-4 animate-spin`}),i(`recordings.storageSection.loadingStorageUsage`,`Loading storage usage…`)]});if(!p)return r(z,{icon:d,title:i(`recordings.storageSection.noStorageData`,`No storage data`),description:i(`recordings.storageSection.theRecordingNodeHasNot`,`The recording node has not reported any storage usage yet.`)});let I=p.devices.length;return e(`div`,{className:`flex flex-col gap-6`,children:[e(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[r(h,{label:i(`recordings.storageSection.totalUsed`,`Total used`),icon:r(d,{className:`h-3 w-3`}),footer:`${String(I)} camera${I===1?``:`s`} on ${p.nodeId}`,children:q(p.totalUsedBytes)}),D!==null&&D.severity!==null&&r(h,{label:i(`recordings.storageSection.freeOnRecordingsVolumes`,`Free on recordings volumes`),icon:r(d,{className:`h-3 w-3`}),footer:`across ${String(D.knownVolumes)} volume${D.knownVolumes===1?``:`s`} of ${q(D.totalBytes)}`+(D.unknownVolumes>0?` · ${String(D.unknownVolumes)} did not report capacity`:``),children:r(`span`,{className:`tabular-nums ${Wt[D.severity]}`,children:q(D.freeBytes)})}),w.map(t=>{let n=Me(t),a=t.locationId??t.root??`default`;return r(h,{label:i(`recordings.storageSection.disk2`,`Disk: {{label}}`,{label:Kt(t,b)}),footer:n===null?`${q(t.usedBytes)} of recordings · volume capacity unknown`:`${q(n.freeBytes)} free of ${q(n.totalBytes)} · ${q(t.usedBytes)} recordings (${$(n.recordingsFraction)})`,children:n===null?r(`span`,{className:`tabular-nums`,children:q(t.usedBytes)}):e(`div`,{className:`flex items-center gap-2`,title:i(`recordings.storageSection.volumeFillEverythingOnThe`,`Volume fill — everything on the disk, not only recordings. Warn at 85%, critical at 95%.`),children:[r(`div`,{className:`h-2 flex-1 overflow-hidden rounded bg-muted`,children:r(`div`,{className:`h-full rounded ${Ut[n.severity]}`,style:{width:$(n.fraction)}})}),r(`span`,{className:`tabular-nums text-xs ${Wt[n.severity]}`,children:$(n.fraction)})]})},a)})]}),e(`section`,{className:`flex items-center gap-2 text-xs`,children:[r(`label`,{htmlFor:`prune-reason`,className:`text-foreground-subtle`,children:i(`recordings.storageSection.pruneReason`,`Prune reason`)}),r(S,{wrapperClassName:`inline-block w-auto`,id:`prune-reason`,value:l,onChange:e=>{let t=Ht.find(t=>t.value===e.target.value);t&&f(t.value)},children:Ht.map(e=>r(`option`,{value:e.value,children:i(e.labelKey)},e.value))})]}),I===0?r(z,{icon:d,title:p.devicesRead===`unavailable`?i(`recordings.storageSection.perCameraUsageUnavailable`,`Per-camera usage unavailable`):i(`recordings.storageSection.noRecordedFootage`,`No recorded footage`),description:p.devicesRead===`unavailable`?i(`recordings.storageSection.thisRecordingNodeHasNo`,`This recording node has no footage ledger, so it refused to answer the per-camera table rather than report what it happens to hold in memory. The disk totals above are unaffected.`):i(`recordings.storageSection.noCameraHasRecordedFootage`,`No camera has recorded footage on this node yet.`)}):r(L,{columns:P,rows:[...p.devices],rowKey:e=>e.deviceId,minWidthPx:480})]})}function Jt(){let{t}=K();return e(`div`,{className:`flex flex-col gap-8`,children:[e(`div`,{children:[r(`h2`,{className:`text-sm font-semibold text-foreground`,children:t(`recordings.recordingsStorageSection.footageOnDisk`,`Footage on disk`)}),r(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:t(`recordings.recordingsStorageSection.whatRecordedFootageOccupiesPer`,`What recorded footage occupies, per camera and per volume, with prune-by-policy and delete-all-footage.`)}),r(`div`,{className:`mt-3`,children:r(qt,{})})]}),e(`div`,{children:[r(`h2`,{className:`text-sm font-semibold text-foreground`,children:t(`recordings.recordingsStorageSection.recordingNodeFolders`,`Recording node & folders`)}),r(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:t(`recordings.recordingsStorageSection.theSingleNodeThatRecords`,`The single node that records and serves playback, and the storage locations footage is written to.`)}),r(`div`,{className:`mt-3`,children:r(Lt,{})})]})]})}function Yt(){let{t:e}=K(),t=ke(`/recordings`,{t:e,isAdmin:!0})??{icon:m,title:e(`nav.recordings`,`Recordings`)};return r(Ae,{icon:t.icon,title:t.title,subtitle:e(`recordings.recordedFootageAndTheDurable`,`Recorded footage and the durable event store — what each occupies, where it is written, and the operations that move or reconcile both.`),defaultSection:`storage`,sectionsLabel:`${t.title} sections`,sections:[{id:`storage`,label:e(`recordings.recordings`,`Recordings`),content:r(Jt,{})},{id:`events`,label:e(`recordings.events`,`Events`),content:r(Ze,{})},{id:`cameras`,label:e(`recordings.cameras`,`Cameras`),content:r(Be,{})},{id:`exports`,label:e(`recordings.export`,`Export`),content:r(ft,{})},{id:`activity`,label:e(`recordings.activity`,`Activity`),content:r(ze,{})},{id:`management`,label:e(`recordings.management`,`Management`),content:r(Nt,{})}]})}export{Yt as RecordingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_a as e}from"./player-overlays-CATQyQ4F.js";var t=e(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]);export{t};
|