@camstack/addon-admin-ui 1.2.355 → 1.2.356
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/dist/assets/Addons-vaVt3N8c.js +4 -0
- package/dist/assets/{AdminTabs-jmzYA4Gj.js → AdminTabs-BOhyA0v_.js} +1 -1
- package/dist/assets/AiProfiles-gc9Na6rv.js +3 -0
- package/dist/assets/{BrokerForm-Cv_WPhvt.js → BrokerForm-Bxjn8Xkb.js} +1 -1
- package/dist/assets/Build-DNhwnx2k.js +40 -0
- package/dist/assets/{Calendars-MFMnXqjT.js → Calendars-9eEuusHn.js} +1 -1
- package/dist/assets/{Capabilities-BzcFdoxe.js → Capabilities-BuQgXiX1.js} +1 -1
- package/dist/assets/Cluster-BGpeqgpD.js +11 -0
- package/dist/assets/ClusterStepModel-Cg0YqJM-.js +1 -0
- package/dist/assets/{CompositionEditor-C9f51ycE.js → CompositionEditor-DsZomdtR.js} +1 -1
- package/dist/assets/{CompositionEditorPage-GhqEH8fu.js → CompositionEditorPage-CEYhfRyr.js} +1 -1
- package/dist/assets/{Data-DW-C0JmT.js → Data-CxzcaPPX.js} +1 -1
- package/dist/assets/DetectionIntelligence-esy4sm8-.js +1 -0
- package/dist/assets/DeviceDetail-BUFpgkeN.js +2 -0
- package/dist/assets/{DeviceDoActionFields-DTRBrGeQ.js → DeviceDoActionFields-C_OPAByq.js} +1 -1
- package/dist/assets/{Devices-urEV4IEL.js → Devices-D5wKCK9_.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-RP6PYmQ3.js → EmbedPlayerPage-xTUcKS8t.js} +1 -1
- package/dist/assets/Events-BD2v1o2Z.js +1 -0
- package/dist/assets/Identity-hydVfEcG.js +1 -0
- package/dist/assets/IntegrationDetail-IjNeTPn2.js +1 -0
- package/dist/assets/{IntegrationHub-3NtGsJ8f.js → IntegrationHub-Czg3bSVM.js} +1 -1
- package/dist/assets/Integrations-ErVYCOG1.js +1 -0
- package/dist/assets/{Integrations-EkMwKxz0.js → Integrations-xrJzBxAs.js} +1 -1
- package/dist/assets/Locations-BBu_JUg1.js +3 -0
- package/dist/assets/{Logs-BwMwasxy.js → Logs-hVhOlpsU.js} +1 -1
- package/dist/assets/{MotionZonesSettings--ZP6wq8p.js → MotionZonesSettings-B8426WyB.js} +1 -1
- package/dist/assets/MyAccess-D0PqfqUg.js +2 -0
- package/dist/assets/Network-1FUHkoPH.js +1 -0
- package/dist/assets/{NodeAddonsSettingsPanel-BbRT6OqB.js → NodeAddonsSettingsPanel-Bin020YC.js} +1 -1
- package/dist/assets/Notifications-DBedpZv-.js +1 -0
- package/dist/assets/{Plates-D82UR8AW.js → Plates-D1_YX1bj.js} +1 -1
- package/dist/assets/{PrivacyMaskSettings-UJpZQuWF.js → PrivacyMaskSettings-C-lyYBaQ.js} +1 -1
- package/dist/assets/Recordings-9M71-km4.js +1 -0
- package/dist/assets/{ScanNetworkModal-Dq6vPLgX.js → ScanNetworkModal-DjrnLqkB.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-CwTxeG1H.js → SceneMonitorEditor-CnTzBKHk.js} +1 -1
- package/dist/assets/{Scenes-BxWxF9RG.js → Scenes-9o38vvfG.js} +1 -1
- package/dist/assets/{Secrets-B1Py-XlE.js → Secrets-Di_XuHEM.js} +1 -1
- package/dist/assets/{Settings-D3l2szna.js → Settings-CdsQXImT.js} +1 -1
- package/dist/assets/{Showroom-DCK8-7b8.js → Showroom-CueI9Hof.js} +1 -1
- package/dist/assets/{Terminal-C2SFvaOH.js → Terminal-CgkhEdVL.js} +3 -3
- package/dist/assets/{Viewer-qJaACnXs.js → Viewer-CXSln4qp.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-4FAaqbgl.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-D23uSeCV.js} +1 -1
- package/dist/assets/{archive-C9jrGy5Q.js → archive-HjFKqcYJ.js} +1 -1
- package/dist/assets/{authed-media-DQAkskU5.js → authed-media-DTi-1YAt.js} +1 -1
- package/dist/assets/{boxes-BNIPhLCT.js → boxes-Bhz-2O4q.js} +1 -1
- package/dist/assets/circle-slash-RDy1aZkR.js +1 -0
- package/dist/assets/client-DuQQ55XQ.js +357 -0
- package/dist/assets/crop-BWtvQsYY.js +1 -0
- package/dist/assets/{debounced-invalidate-COhAlfWE.js → debounced-invalidate-BmvWt3Mf.js} +1 -1
- package/dist/assets/{device-integration-icon-KaXkp2LK.js → device-integration-icon-vpQeGGPt.js} +1 -1
- package/dist/assets/device-picker-model-C1VaG3XC.js +1 -0
- package/dist/assets/dist-B46vwY9Q.js +357 -0
- package/dist/assets/{dist-YROsaxnC.js → dist-BVQ0qNkk.js} +1 -1
- package/dist/assets/{face-bbox-CFdWEIAo.js → face-bbox-DIMw9bdN.js} +1 -1
- package/dist/assets/{hard-drive-download-D11tb7sM.js → hard-drive-download-DGUpD-NK.js} +1 -1
- package/dist/assets/{hostInit-C1Zchdpp.js → hostInit-jbr3yepU.js} +1 -1
- package/dist/assets/{index-d2QAhmc-.js → index-I9Gc2ACc.js} +3 -3
- package/dist/assets/{layers-DYdFVal1.js → layers-TAdyTRRS.js} +1 -1
- package/dist/assets/{location-owned-usage-DJjVpEH8.js → location-owned-usage-D5P9h6fD.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-164529ae.js → mf-entry-bootstrap-0-c002b961.js} +2 -2
- package/dist/assets/mount-C1VaG3XC.js +1 -0
- package/dist/assets/notification-schedule-field-DdO5UXE-.js +1 -0
- package/dist/assets/{player-overlays-tKtUzh3g.js → player-overlays-PPtffSZH.js} +1 -1
- package/dist/assets/remoteEntry-CdbrIBDO.js +1 -0
- package/dist/assets/{send-C3mZ85mq.js → send-qYTKAtys.js} +1 -1
- package/dist/assets/{settings-2-CCI879zJ.js → settings-2-BfvfZMIZ.js} +1 -1
- package/dist/assets/{src-Y4G_LfLc.js → src-EnVigh-D.js} +17 -17
- package/dist/assets/{unlink-m4c0iz87.js → unlink-CvsfIFka.js} +1 -1
- package/dist/assets/{use-scenes-feed-DyIyOk7m.js → use-scenes-feed-DupdXK3r.js} +1 -1
- package/dist/assets/{use-stationary-objects-DqQJT1ff.js → use-stationary-objects-Blrh3fb3.js} +1 -1
- package/dist/assets/useEventInvalidation-C1VaG3XC.js +1 -0
- package/dist/assets/{useNodeUrlSelection-CEK0v_3k.js → useNodeUrlSelection-DemYJ0D7.js} +1 -1
- package/dist/assets/user-round-BCwcukON.js +1 -0
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-B0TfzpP_.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-CFcHLszk.js} +2 -2
- package/dist/index.html +7 -7
- package/dist/server/addon.js +126 -2
- package/package.json +1 -1
- package/dist/assets/Addons-Bzf-UqEw.js +0 -4
- package/dist/assets/AiProfiles-DDUitYj8.js +0 -3
- package/dist/assets/Build-3A9gyeeL.js +0 -40
- package/dist/assets/Cluster-B8MOp6Pr.js +0 -11
- package/dist/assets/ClusterStepModel-DCIodYpM.js +0 -1
- package/dist/assets/DetectionIntelligence-CrH_kLX1.js +0 -1
- package/dist/assets/DeviceDetail-CDOw1qyD.js +0 -2
- package/dist/assets/Events-zS0-6Rd3.js +0 -1
- package/dist/assets/Identity-Dqul-DNR.js +0 -1
- package/dist/assets/IntegrationDetail-wBX3nT_i.js +0 -1
- package/dist/assets/Integrations-BAPCCTL_.js +0 -1
- package/dist/assets/Locations-CLBXHuE9.js +0 -3
- package/dist/assets/MyAccess-DRVHIYEW.js +0 -2
- package/dist/assets/Network-vx7gg32u.js +0 -1
- package/dist/assets/Notifications-DlINBoX1.js +0 -1
- package/dist/assets/Recordings-C9JJ_i3X.js +0 -1
- package/dist/assets/circle-slash-BYpk_wjd.js +0 -1
- package/dist/assets/client-HDm3z1QL.js +0 -357
- package/dist/assets/crop-9g1Z5sFT.js +0 -1
- package/dist/assets/device-picker-model-D_5ynS9o.js +0 -1
- package/dist/assets/dist-DPdG1Rf2.js +0 -357
- package/dist/assets/mount-D_5ynS9o.js +0 -1
- package/dist/assets/notification-schedule-field-C3V8Yo1S.js +0 -1
- package/dist/assets/remoteEntry-8SJYH9n-.js +0 -1
- package/dist/assets/useEventInvalidation-D_5ynS9o.js +0 -1
- package/dist/assets/user-round-BGmDt-wq.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as e,Q as t,S as n,W as r,b as i,o as a,q as o,x as s,z as c}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{J as l,_t as u,at as d,st as f,vt as p}from"./player-overlays-tKtUzh3g.js";import{$c as m,$d as h,Ad as g,Bc as _,Cs as v,Gc as y,Hc as b,Hn as x,Kd as S,Ln as C,Nt as w,Pn as T,Pt as E,Pu as D,Qc as O,Qs as k,Rc as A,Uc as j,Vc as M,Wc as ee,Xc as N,al as te,as as ne,cl as re,dl as ie,dr as P,fl as ae,il as oe,ll as se,mr as ce,nc as le,nl as ue,ol as de,ps as fe,pu as F,qn as I,rl as pe,sa as L,sf as me,sl as he,tf as R,tl as ge,ts as _e,ul as ve,uu as z,yu as B,zc as V,zd as H,zf as U}from"./src-Y4G_LfLc.js";import{c as ye,i as be,l as xe,n as Se,o as Ce,r as we,s as Te,t as Ee,u as De}from"./location-owned-usage-DJjVpEH8.js";import{t as Oe}from"./settings-2-CCI879zJ.js";import{pi as W}from"./client-HDm3z1QL.js";import{w as ke}from"./index-d2QAhmc-.js";import{t as Ae}from"./AdminPage-BSFohA3i.js";import{n as je}from"./authed-media-DQAkskU5.js";import{t as Me}from"./AdminTabs-jmzYA4Gj.js";import{t as G}from"./format-size-DIxKXxtj.js";var Ne=p(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),Pe=p(`scissors`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]);t();var Fe=[{value:`all`,label:`All`},{value:`recording`,label:`Recordings`},{value:`events`,label:`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[e,t]=o(`all`),{data:a,isLoading:c,isError:l}=_({},{refetchOnWindowFocus:!1}),{data:u,isLoading:d,isError:f}=fe({},{refetchOnWindowFocus:!1}),{data:p}=L({isCamera:!0,projection:`slim`}),m=r(()=>{let e=new Map;for(let t of p??[])e.set(t.id,t.name);return e},[p]),h=r(()=>{let t=[...a??[],...u??[]];return(e===`all`?t:t.filter(t=>t.domain===e)).toSorted((e,t)=>t.at-e.at)},[a,u,e]),v=r(()=>{let t=[];return l&&e!==`events`&&t.push(`Recordings`),f&&e!==`recording`&&t.push(`Events`),t},[l,f,e]),y=r(()=>[{key:`at`,header:`When`,nowrap:!0,sortValue:e=>e.at,render:e=>s(`span`,{className:`text-foreground-subtle tabular-nums`,children:Re(e.at)})},{key:`domain`,header:`Domain`,sortValue:e=>e.domain,render:e=>s(`span`,{className:`inline-flex rounded px-1.5 py-0.5 text-[10px] font-medium ${Ie[e.domain]}`,children:e.domain})},{key:`op`,header:`Operation`,sortValue:e=>e.op,render:e=>s(`span`,{className:`text-foreground`,children:e.op})},{key:`reason`,header:`Reason`,sortValue:e=>e.reason,render:e=>s(`span`,{className:`text-foreground-subtle`,children:e.reason})},{key:`device`,header:`Camera`,sortValue:e=>e.deviceId===null?`cluster`:m.get(e.deviceId)??`#${String(e.deviceId)}`,render:e=>e.deviceId===null?s(`span`,{className:`text-foreground-subtle`,children:`cluster`}):s(`span`,{className:`text-foreground`,children:m.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`items`,header:`Items`,align:`right`,nowrap:!0,sortValue:e=>e.itemsAffected,render:e=>s(`span`,{className:`tabular-nums`,children:e.itemsAffected.toLocaleString()})},{key:`bytes`,header:`Reclaimed`,align:`right`,nowrap:!0,sortValue:e=>e.bytesReclaimed,render:e=>s(`span`,{className:`tabular-nums`,children:e.bytesReclaimed>0?G(e.bytesReclaimed):`—`})}],[m]),b=c||d;return n(`div`,{className:`flex flex-col gap-4`,children:[s(`div`,{className:`flex items-center gap-1`,children:Fe.map(n=>s(`button`,{onClick:()=>t(n.value),className:`rounded px-2 py-1 text-xs font-medium ${e===n.value?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-muted`}`,children:n.label},n.value))}),b&&h.length===0?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(g,{className:`h-4 w-4 animate-spin`}),`Loading activity…`]}):h.length===0?v.length>0?s(T,{icon:D,title:`Activity could not be read`,description:`The ${v.join(` and `)} ops log did not answer. This is not "nothing happened" — retry, or check the node that owns it.`}):s(T,{icon:U,title:`No activity yet`,description:`Prune, delete and rescan operations across recordings and events show up here.`}):n(i,{children:[v.length>0&&n(`p`,{className:`flex items-center gap-1.5 text-[11px] text-amber-500`,children:[s(D,{className:`h-3 w-3 shrink-0`}),v.join(` and `),` did not answer — rows from`,` `,v.length===1?`that domain`:`those domains`,` are missing below.`]}),s(w,{columns:y,rows:h,rowKey:e=>e.id,minWidthPx:720,mobileMode:`scroll`,maxBodyHeight:E,defaultSort:Le})]})]})}t();function Be(){let e=L({isCamera:!0,projection:`slim`}),t=r(()=>(e.data??[]).toSorted((e,t)=>e.name.localeCompare(t.name)),[e.data]),[i,a]=o(null),c=i??t[0]?.id??null;return!e.isLoading&&t.length===0?s(T,{icon:u,title:`No cameras`,description:`Add a camera first.`}):n(`div`,{className:`space-y-3`,children:[n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Per-camera recording & retention`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`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.`})]}),n(`div`,{className:`flex items-center gap-2`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Camera`}),s(`select`,{value:c??``,onChange:e=>a(Number(e.target.value)),className:`rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:t.map(e=>s(`option`,{value:e.id,children:e.name},e.id))})]}),c!==null&&s(x,{deviceId:c,children:s(ke,{deviceId:c,sectionFilter:e=>e.location===`top-tab`&&e.tab===`recording`})},c)]})}t();function Ve({types:e}){let t=a(),i=I(),{data:c}=m({}),l=O(),u=r(()=>l.data??[],[l.data]),{data:d}=V({},{refetchOnWindowFocus:!1}),f=r(()=>Ee(c??[],d?.locations),[c,d?.locations]),[p,h]=o(null),[g,_]=o(null),v=()=>{t.invalidateQueries({queryKey:[[`storage`,`listLocations`]]})},y=ae({onSuccess:v}),b=N({onSuccess:v}),x=r(()=>{let e=new Map;for(let t of c??[]){let n=e.get(t.type);n?n.push(t):e.set(t.type,[t])}return e},[c]),S=async(e,t)=>{xe(t)&&!await i({title:`Disable "${e.displayName}"?`,message:`${ye(t).consequence}\n\nNothing is deleted — set the location back to Read-only or Active to bring its footage back.`,confirmLabel:`Disable`,variant:`danger`})||y.mutate(Te(e,{mode:t}))},C=async e=>{if(await i({title:`Delete location "${e.displayName}"?`,message:`Removes the record; files on disk are untouched.`,confirmLabel:`Delete`,variant:`danger`}))try{await b.mutateAsync({id:e.id})}catch(t){await i({title:`Delete anyway?`,message:`${t instanceof Error?t.message:String(t)}\n\nForcing removes the record only. Anything still on that location becomes unreachable.`,confirmLabel:`Force delete`,variant:`danger`})&&b.mutate({id:e.id,force:!0})}},w=e.map(e=>u.find(t=>t.id===e)).filter(e=>e!==void 0);return n(`div`,{className:`space-y-3`,children:[w.length===0?s(`p`,{className:`text-[11px] text-foreground-subtle italic`,children:`No storage locations declared for this purpose.`}):w.map(e=>s(Se,{type:e.id,displayName:e.displayName,description:e.description,cardinality:e.cardinality,locations:x.get(e.id)??[],onAdd:e=>h(e),onEdit:e=>_(e),onDelete:e=>{C(e)},ownedBytesById:f,onSetMode:(e,t)=>{S(e,t)}},e.id)),p!==null&&s(De,{initialType:p,onClose:()=>h(null),onCreated:()=>{v(),h(null)}}),g!==null&&s(Ce,{location:g,onClose:()=>_(null),onSaved:()=>{v(),_(null)}})]})}t();var He=`pipeline-analytics`;function Ue(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 We(){let e=a(),{nodes:t}=z(),{data:i,isLoading:o}=P({addonId:He}),c=Ue(i),l=ce({onSuccess:()=>{e.invalidateQueries({queryKey:[[`addonSettings`,`getGlobalSettings`]]})}}),u=r(()=>{let e=t.filter(e=>e.isOnline).map(e=>e.id);return[...new Set([`hub`,c,...e])].filter(Boolean)},[t,c]);return n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Post-processing node`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`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.`}),n(`div`,{className:`mt-3 flex items-center gap-2`,children:[o?s(g,{className:`h-4 w-4 animate-spin text-foreground-subtle`}):s(`select`,{value:c,onChange:e=>{e.target.value!==c&&l.mutate({addonId:He,patch:{postProcessingNodeId:e.target.value}})},disabled:l.isPending,className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:u.map(e=>s(`option`,{value:e,children:e===`hub`?`hub (default)`:e},e))}),l.isPending&&s(g,{className:`h-4 w-4 animate-spin text-primary`})]})]}),n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`Events folder`}),s(`p`,{className:`mb-3 text-[11px] text-foreground-subtle`,children:`Where event crops / full frames are stored. A single folder — no collection / equal-splitting.`}),s(Ve,{types:[`eventMedia`]})]})]})}t();var Ge=[[`pipelineAnalytics`]],Ke=1440*60*1e3;function qe(e,t){return t.get(e)??`Removed camera #${String(e)}`}var Je=[{days:1,label:`1 day`},{days:7,label:`7 days`},{days:30,label:`30 days`},{days:90,label:`90 days`}];function Ye(){let t=a(),i=I(),[c,u]=o(30),[d,p]=o(null),{data:m,isLoading:h}=ne({},{refetchOnWindowFocus:!1}),{data:_}=L({isCamera:!0,projection:`slim`}),y=r(()=>{let e=new Map;for(let t of _??[])e.set(t.id,t.name);return e},[_]),b=e(()=>{t.invalidateQueries({queryKey:Ge})},[t]),x=v({onSuccess:b}),S=_e(),C=e(async()=>{await i({title:`Prune events older than ${String(c)} day${c===1?``:`s`}?`,message:`Permanently deletes every event (motion / object / audio) older than the cutoff across all cameras, and their media. This cannot be undone.`,confirmLabel:`Prune events`,variant:`danger`})&&x.mutate({olderThanMs:Date.now()-c*Ke,reason:`retention`})},[i,x,c]),E=e(async e=>{let t=qe(e.deviceId,y);if(await i({title:`Delete all events for ${t}?`,message:`Permanently deletes ${String(e.rows)} event${e.rows===1?``:`s`} (${G(e.bytes)} of media) for this camera. This cannot be undone.`,confirmLabel:`Delete events`,variant:`danger`})){p(null);try{let n=await S.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 (${G(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))}}},[i,S,y,b]),D=r(()=>[{key:`camera`,header:`Camera`,render:e=>s(`span`,{className:`text-foreground`,children:qe(e.deviceId,y)})},{key:`rows`,header:`Events`,align:`right`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:e.rows.toLocaleString()})},{key:`bytes`,header:`Media`,align:`right`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:G(e.bytes)})},{key:`actions`,header:``,align:`right`,render:e=>n(`button`,{onClick:()=>{E(e)},disabled:S.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:`Delete all events for this camera`,children:[s(f,{className:`h-3 w-3`}),`Delete`]})}],[y,E,S.isPending]);return h&&!m?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(g,{className:`h-4 w-4 animate-spin`}),`Loading event-store footprint…`]}):m?n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[s(l,{label:`Total events`,icon:s(R,{className:`h-3 w-3`}),footer:`across ${String(m.devices.length)} camera${m.devices.length===1?``:`s`}`,children:m.totalRows.toLocaleString()}),s(l,{label:`Event media on disk`,children:G(m.totalBytes)})]}),n(`section`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[s(`span`,{className:`text-foreground-subtle`,children:`Prune events older than`}),s(`select`,{value:c,onChange:e=>u(Number(e.target.value)),className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:Je.map(e=>s(`option`,{value:e.days,children:e.label},e.days))}),n(`button`,{onClick:()=>{C()},disabled:x.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-amber-500/10 hover:text-amber-500 disabled:opacity-50`,children:[x.isPending?s(g,{className:`h-3 w-3 animate-spin`}):s(Pe,{className:`h-3 w-3`}),`Prune now`]})]}),m.devices.length===0?s(T,{icon:R,title:`No stored events`,description:`No camera has persisted events yet.`}):s(w,{columns:D,rows:[...m.devices],rowKey:e=>e.deviceId,minWidthPx:480}),d===null?null:s(`p`,{className:d.startsWith(`Deleted `)?`text-[11px] text-foreground-subtle`:`text-[11px] text-destructive`,children:d})]}):s(T,{icon:R,title:`No event data`,description:`Pipeline analytics has not reported any event-store footprint yet.`})}function Xe(){return n(`div`,{className:`flex flex-col gap-8`,children:[n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Event store`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`What the durable event store occupies, per camera, with fleet-wide prune-by-age and delete-all-events.`}),s(`div`,{className:`mt-3`,children:s(Ye,{})})]}),n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Post-processing node & folders`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`The single node that writes event crops, and the storage location they land in.`}),s(`div`,{className:`mt-3`,children:s(We,{})})]})]})}function Ze(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 Qe(e){return new Date(e).toLocaleString(void 0,{day:`2-digit`,month:`short`,hour:`2-digit`,minute:`2-digit`})}function $e(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`${Qe(e)} · ${o}`}function et(e,t){let n=e-t;if(n<=0)return`expired`;let r=Math.floor(n/6e4);if(r<60)return`in ${String(r)}m`;let i=Math.floor(r/60);return i<24?`in ${String(i)}h`:`in ${String(Math.floor(i/24))}d`}function tt(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})}t();var nt=[`high`,`mid`,`low`],rt=[{value:1,label:`Real time (1×)`},{value:2,label:`2×`},{value:4,label:`4×`},{value:8,label:`8×`},{value:16,label:`16×`}],it=10080*60*1e3;function at(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 ot({onClose:e,onCreated:t}){let i=L({isCamera:!0,projection:`slim`}),a=r(()=>(i.data??[]).toSorted((e,t)=>e.name.localeCompare(t.name)),[i.data]),[c,l]=o(``),[u,d]=o(`high`),[f,p]=o(at(60)),[m,h]=o(at(0)),[g,_]=o(1),[v,y]=o(!0),[b,x]=o(``),[C,w]=o(null),T=c===``?a[0]?.id??null:c,E=new Date(f).getTime(),D=new Date(m).getTime(),O=Number.isFinite(E)&&Number.isFinite(D)&&E<D,k=j({onSuccess:()=>{t(),e()},onError:e=>w(e instanceof Error?e.message:String(e))});return s(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm`,onClick:e,children:n(`div`,{className:`w-full max-w-md rounded-xl border border-border bg-surface shadow-2xl`,onClick:e=>e.stopPropagation(),children:[n(`div`,{className:`flex items-start justify-between border-b border-border px-4 py-3`,children:[n(`h2`,{className:`flex items-center gap-1.5 text-sm font-semibold text-foreground`,children:[s(S,{className:`h-3.5 w-3.5`}),`New export`]}),s(`button`,{onClick:e,className:`text-foreground-subtle hover:text-foreground`,children:s(B,{className:`h-4 w-4`})})]}),n(`div`,{className:`p-4 space-y-3`,children:[n(`div`,{className:`grid grid-cols-2 gap-3`,children:[n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Camera`}),s(`select`,{value:T??``,onChange:e=>l(Number(e.target.value)),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:a.map(e=>s(`option`,{value:e.id,children:e.name},e.id))})]}),n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Profile`}),s(`select`,{value:u,onChange:e=>d(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:nt.map(e=>s(`option`,{value:e,children:e},e))})]})]}),n(`div`,{className:`grid grid-cols-2 gap-3`,children:[n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`From`}),s(`input`,{type:`datetime-local`,value:f,onChange:e=>p(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`})]}),n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`To`}),s(`input`,{type:`datetime-local`,value:m,onChange:e=>h(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`})]})]}),n(`div`,{className:`grid grid-cols-2 gap-3`,children:[n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Speed`}),s(`select`,{value:g,onChange:e=>_(Number(e.target.value)),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:rt.map(e=>s(`option`,{value:e.value,children:e.label},e.value))})]}),n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Title (optional)`}),s(`input`,{type:`text`,value:b,onChange:e=>x(e.target.value),placeholder:`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`})]})]}),n(`label`,{className:`flex items-center gap-2 text-xs text-foreground cursor-pointer`,children:[s(`input`,{type:`checkbox`,checked:v,disabled:g!==1,onChange:e=>y(e.target.checked),className:`accent-primary`}),`Include audio`,g===1?``:` (real-time only)`]}),!O&&s(`p`,{className:`text-[11px] text-danger`,children:`"From" must be before "To".`}),C&&s(`p`,{className:`text-[11px] text-danger`,children:C})]}),n(`div`,{className:`flex justify-end gap-2 border-t border-border px-4 py-3`,children:[s(`button`,{onClick:e,className:`rounded border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground`,children:`Cancel`}),s(`button`,{onClick:()=>{if(T===null||!O)return;w(null);let e=b.trim();k.mutate({deviceId:T,profile:u,fromMs:E,toMs:D,options:{includeAudio:v,maxLifeMs:it,deleteAfterDownload:!1,...g===1?{}:{speed:g},...e.length>0?{title:e}:{}}})},disabled:T===null||!O||k.isPending,className:`rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground disabled:opacity-50`,children:k.isPending?`Queuing…`:`Create export`})]})]})})}t();var st=[[`recordingExport`]],ct={queued:{cls:`bg-muted text-foreground-subtle`,label:`queued`},rendering:{cls:`bg-primary/10 text-primary`,label:`rendering`,spin:!0},ready:{cls:`bg-success/10 text-success`,label:`ready`},failed:{cls:`bg-danger/10 text-danger`,label:`failed`},expired:{cls:`bg-muted text-foreground-subtle`,label:`expired`},deleted:{cls:`bg-muted text-foreground-subtle`,label:`deleted`}};function lt(){let{data:e,isLoading:t}=y({},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data??[]).some(e=>e.state===`queued`||e.state===`rendering`)?3e3:!1}),{map:n}=F(W.RecordingExportProgress,e=>e.exportId),{map:i}=F(W.RecordingExportCompleted,e=>e.exportId),{map:a}=F(W.RecordingExportFailed,e=>e.exportId);return{rows:r(()=>tt(e??[],n,i,a),[e,n,i,a]),isLoading:t}}function ut(e){let[t,n]=o(()=>Date.now());return c(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function dt(){let t=a(),[i,c]=o(!1),l=()=>{t.invalidateQueries({queryKey:[[`recordingExport`,`listExports`]]})},u=I(),p=d().trpcClient,m=ut(6e4),{rows:_,isLoading:v}=lt(),{data:y}=L({isCamera:!0,projection:`slim`}),x=r(()=>{let e=new Map;for(let t of y??[])e.set(t.id,t.name);return e},[y]),C=e(()=>{t.invalidateQueries({queryKey:st})},[t]),E=b({onSuccess:C}),D=ee({onSuccess:C}),[O,k]=o(null),A=e(async e=>{k(e.id);try{let{url:t}=await p.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),C()}finally{k(null)}},[p,C]),j=e(async e=>{await u({title:`Cancel this export?`,message:`Stops the render. The partial file is discarded.`,confirmLabel:`Cancel export`,variant:`danger`})&&E.mutate({exportId:e.id})},[u,E]),M=e(async e=>{await u({title:`Delete this export?`,message:`Permanently removes the rendered file and its history row.`,confirmLabel:`Delete`,variant:`danger`})&&D.mutate({exportId:e.id})},[u,D]),N=r(()=>[{key:`camera`,header:`Camera`,render:e=>s(`span`,{className:`text-foreground`,children:x.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`range`,header:`Range`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:$e(e.fromMs,e.toMs)})},{key:`variant`,header:`Variant`,render:e=>s(`span`,{className:`text-foreground-subtle`,children:Ze(e.options)})},{key:`state`,header:`State`,render:e=>{let t=ct[e.state];return n(`span`,{className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium ${t.cls}`,children:[t.spin&&s(g,{className:`h-2.5 w-2.5 animate-spin`}),t.label,e.state===`rendering`&&e.progressPct!==null&&n(`span`,{className:`tabular-nums`,children:[e.progressPct,`%`]})]})}},{key:`expiry`,header:`Expires`,nowrap:!0,render:e=>e.state===`deleted`?s(`span`,{className:`text-foreground-subtle`,children:`—`}):s(`span`,{className:`text-foreground-subtle tabular-nums`,children:et(e.expiresAt,m)})},{key:`size`,header:`Size`,align:`right`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:e.fileBytes===null?`—`:G(e.fileBytes)})},{key:`actions`,header:``,align:`right`,render:e=>{let t=e.state===`ready`,r=e.state===`queued`||e.state===`rendering`,i=e.state!==`deleted`;return n(`div`,{className:`flex items-center justify-end gap-1`,children:[t&&n(`button`,{onClick:()=>{A(e)},disabled:O===e.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:`Download MP4`,children:[O===e.id?s(g,{className:`h-3 w-3 animate-spin`}):s(h,{className:`h-3 w-3`}),`Download`]}),r&&n(`button`,{onClick:()=>{j(e)},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:`Cancel render`,children:[s(me,{className:`h-3 w-3`}),`Cancel`]}),i&&s(`button`,{onClick:()=>{M(e)},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:`Delete export`,children:s(f,{className:`h-3 w-3`})})]})}}],[x,m,O,E.isPending,D.isPending,A,j,M]);return v&&_.length===0?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(g,{className:`h-4 w-4 animate-spin`}),`Loading exports…`]}):n(`div`,{className:`space-y-3`,children:[s(`div`,{className:`flex justify-end`,children:n(`button`,{onClick:()=>c(!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:[s(S,{className:`h-3.5 w-3.5`}),`New export`]})}),_.length===0?s(T,{icon:S,title:`No exports yet`,description:`Create one here (New export) or from a camera's timeline in the viewer. Rendered clips show up here to download or manage.`}):s(w,{columns:N,rows:_,rowKey:e=>e.id,minWidthPx:720}),i&&s(ot,{onClose:()=>c(!1),onCreated:l})]})}var ft=`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`;t();var pt=`storage-migration`,mt=new Set([`orphans`,`debug-media`,`ghost-ledger`]);function ht(e){return[`${e.orphansReclaimed} orphan rows (${G(e.orphanBytesReclaimed)})`,e.includeDebugMedia?`${e.debugMediaReclaimed} debug files (${G(e.debugMediaBytesReclaimed)})`:null,`${e.ghostsForgotten} ghost rows (${G(e.ghostBytesForgotten)})`].filter(e=>e!==null).join(` · `)}function gt(){let e=C(pt);return e===`pending`?null:e===`unknown`?s(`p`,{className:`py-2 text-xs text-foreground-subtle`,children:`Could not check whether storage cleanup is installed on this hub.`}):e===`present`?s(_t,{}):null}function _t(){let e=I(),[t,r]=o(!1),[i,a]=o(null),c=oe({},{refetchInterval:2e3}),l=c.data??null,u=l!==null&&mt.has(l.phase),d=pe(),p=ue(),m=async()=>{if(await e({title:`Run storage cleanup?`,message:t?`Reclaims leftover analytics rows and files, debug stills/filmstrips, and ghost footage rows on frozen locations. Safe to re-run.`:`Reclaims leftover analytics rows and files, and ghost footage rows on frozen locations. Debug stills are left alone. Safe to re-run.`,confirmLabel:`Run cleanup`,variant:`danger`})){a(null);try{await d.mutateAsync({includeDebugMedia:t}),await c.refetch()}catch(e){a(e instanceof Error?e.message:String(e))}}},h=async()=>{if(l&&await e({title:`Cancel cleanup?`,message:`Stops after the current step. Work already done stays done.`,confirmLabel:`Cancel cleanup`,variant:`danger`}))try{await p.mutateAsync({jobId:l.jobId}),await c.refetch()}catch{}};return n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Cleanup`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`One pass over leftover analytics (database + files) and ghost footage rows on frozen locations. Does not time out — progress updates here until it finishes.`}),n(`label`,{className:`mt-3 flex items-start gap-2 text-[11px] text-foreground`,children:[s(`input`,{type:`checkbox`,checked:t,disabled:u,onChange:e=>{r(e.target.checked)},className:`mt-0.5 h-3.5 w-3.5 accent-primary`}),s(`span`,{children:`Also remove debug media (motion stills and track filmstrips)`})]}),n(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[n(`button`,{type:`button`,disabled:u||d.isPending,onClick:()=>{m()},className:ft,children:[(u||d.isPending)&&s(g,{className:`h-3 w-3 animate-spin`}),s(f,{className:`h-3 w-3`}),`Run cleanup`]}),u&&s(`button`,{type:`button`,onClick:()=>{h()},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:`Cancel`})]}),i&&s(`p`,{className:`mt-2 text-[11px] text-danger`,children:i}),l&&n(`div`,{className:`mt-3 space-y-1 rounded-md border border-border px-2.5 py-2`,children:[n(`p`,{className:`text-xs text-foreground`,children:[`Phase: `,s(`span`,{className:`font-medium`,children:l.phase}),u&&s(g,{className:`ml-2 inline h-3 w-3 animate-spin text-primary`})]}),l.detail&&s(`p`,{className:`text-[11px] text-foreground-subtle`,children:l.detail}),s(`p`,{className:`text-[11px] text-foreground-subtle`,children:ht(l)}),l.error&&s(`p`,{className:`text-[11px] text-danger`,children:l.error})]})]})}t();var vt=2e3;function yt(){let e=I(),t=a(),r=le(),i=k(void 0,{refetchInterval:e=>e.state.data?.state===`running`?vt:!1}),o=i.data,l=o?.state===`running`,u=l||r.isPending;c(()=>{o?.state!==`done`||o.finishedAtMs===null||(t.invalidateQueries({queryKey:[[`recording`]]}),t.invalidateQueries({queryKey:[[`pipelineAnalytics`]]}))},[o?.state,o?.finishedAtMs,t]);let d=async()=>{await e({title:`Reconcile storage from disk?`,message:`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:`Reconcile`,variant:`warning`})&&(await r.mutateAsync(),await i.refetch())},f=l?o.total>0?`Reconciling ${String(o.completed)}/${String(o.total)}…`:`Reconciling…`:r.isPending?`Reconciling…`:`Reconcile from disk`;return n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Disk reconcile`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`Deletes database rows whose files are gone. Enrolled identities stay.`}),n(`div`,{className:`mt-3 flex flex-col gap-2`,children:[n(`button`,{type:`button`,onClick:()=>void d(),disabled:u,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:[u?s(g,{className:`h-3.5 w-3.5 animate-spin`}):s(H,{className:`h-3.5 w-3.5`}),f]}),o?.state===`done`?n(`p`,{className:`text-[11px] text-foreground-subtle`,children:[`Last run: `,String(o.completed),` camera(s) — dropped `,String(o.tracks),` tracks,`,` `,String(o.events),` events, `,String(o.mediaDropped),` media`,o.failed.length>0?`, ${String(o.failed.length)} failed (${o.failed.join(`, `)})`:``,`.`]}):null,o?.state===`error`&&o.error!==null?n(`p`,{className:`text-[11px] text-destructive`,children:[`Reconcile failed: `,o.error]}):null]})]})}var K=1e3,q=60*K,J=60*q;function Y(e){return e.toLocaleString(`en-US`)}function bt(e){if(!Number.isFinite(e)||e<0)return`—`;if(e>=J){let t=Math.floor(e/J),n=Math.round(e%J/q);return`${t.toString()}h ${n.toString()}m`}if(e>=q){let t=Math.floor(e/q),n=Math.round(e%q/K);return`${t.toString()}m ${n.toString()}s`}return`${Math.max(0,Math.round(e/K)).toString()}s`}function xt(e){let t=Math.max(0,e.observedAt-e.startedAt),n=e.filesTotal===null?`${Y(e.filesMoved)} files`:`${Y(e.filesMoved)} / ${Y(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?`${G(e.bytesMoved/t*K)}/s`:null,o=e.filesTotal===null?null:e.filesTotal-e.filesMoved,s=!i||o===null||o<=0?null:`~${bt(o*t/e.filesMoved)} left`;return{counted:n,fraction:r,moved:`${G(e.bytesMoved)} moved`,rate:a,eta:s}}function St(e){let t=xt(e);return[t.counted,t.moved,t.rate,t.eta].filter(e=>e!==null).join(` · `)}t();var Ct=`storage-migration`,X=[{id:`recordings`,label:`Recordings`,locationType:`recordings`},{id:`recordingsLow`,label:`Low-res recordings`,locationType:`recordingsLow`},{id:`eventMedia`,label:`Event media`,locationType:`eventMedia`}],wt=new Set([`planning`,`sealing`,`pausing`,`moving`,`draining`,`verifying`,`repointing`,`refreshing`,`resuming`]);function Tt(){let e=C(Ct);return e===`pending`?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(g,{className:`h-4 w-4 animate-spin`}),`Checking whether storage migration is installed…`]}):e===`unknown`?s(T,{icon:D,title:`Couldn't check whether storage migration is installed`,description:`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.`}):e===`absent`?s(T,{icon:Ne,title:`Storage migration not installed`,description:`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.`}):s(Et,{})}function Et(){let e=I(),{data:t}=m({}),[i,a]=o({}),[c,l]=o({}),[u,d]=o(null),[f,p]=o(null),h=r(()=>{let e=new Map;for(let n of t??[]){let t=e.get(n.type);t?t.push(n):e.set(n.type,[n])}return e},[t]),_=r(()=>{let e=new Map;for(let n of t??[]){if(n.enabled===!1)continue;let t=e.get(n.type);t?t.push(n.id):e.set(n.type,[n.id])}let n=new Map;for(let[t,r]of e)r.length===1&&n.set(t,r[0]);return n},[t]),v=ie({},{refetchInterval:2e3}),y=v.data??null,b=y!==null&&wt.has(y.phase),x=r(()=>{let e={};for(let t of X){let n=i[t.id];n&&(e[t.id]=n)}return Object.keys(e).length>0?e:void 0},[i]),S=r(()=>{let e={};for(let t of X){if(!i[t.id])continue;let n=c[t.id]??_.get(t.locationType);n&&(e[t.id]=n)}return Object.keys(e).length>0?e:void 0},[i,c,_]),C=r(()=>({destinations:x??{},...S?{sources:S}:{}}),[x,S]),w=re(C,{enabled:!1,retry:!1}),T=ve(),E=ge(),D=async()=>{if(!x)return;p(null);let e=await w.refetch();if(e.error){p(e.error instanceof Error?e.error.message:String(e.error));return}d(e.data??null)},O=async()=>{if(x&&await e({title:`Start storage migration?`,message:`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:`Start migration`,variant:`danger`})){p(null);try{await T.mutateAsync(C),d(null),await v.refetch()}catch(e){p(e instanceof Error?e.message:String(e))}}},k=async()=>{if(y&&await e({title:`Cancel migration?`,message:`Stops the in-progress migration. Data already moved and verified stays at the destination; anything already repointed is not reverted.`,confirmLabel:`Cancel migration`,variant:`danger`}))try{await E.mutateAsync({jobId:y.jobId}),await v.refetch()}catch{}};return n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[n(`h3`,{className:`flex items-center gap-1.5 text-sm font-semibold text-foreground`,children:[s(Ne,{className:`h-3.5 w-3.5`}),`Storage migration`]}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`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.`}),s(`div`,{className:`mt-3 grid grid-cols-1 gap-3 sm:grid-cols-3`,children:X.map(e=>{let t=h.get(e.locationType)??[],r=_.get(e.locationType)??``;return n(`div`,{className:`space-y-2`,children:[s(`div`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:e.label}),n(`div`,{className:`space-y-1`,children:[n(`label`,{htmlFor:`migration-from-${e.id}`,className:`text-[10px] text-foreground-subtle`,children:[e.label,` from`]}),s(`select`,{id:`migration-from-${e.id}`,value:c[e.id]??r,onChange:t=>{let n=t.target.value;l(t=>({...t,[e.id]:n}))},disabled:b,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground disabled:opacity-50`,children:t.map(e=>n(`option`,{value:e.id,children:[e.displayName,e.enabled===!1?` (read-only)`:``]},e.id))})]}),n(`div`,{className:`space-y-1`,children:[n(`label`,{htmlFor:`migration-dest-${e.id}`,className:`text-[10px] text-foreground-subtle`,children:[e.label,` to`]}),n(`select`,{id:`migration-dest-${e.id}`,value:i[e.id]??``,onChange:t=>{let n=t.target.value;a(t=>({...t,[e.id]:n}))},disabled:b,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground disabled:opacity-50`,children:[s(`option`,{value:``,children:`— skip —`}),t.map(e=>s(`option`,{value:e.id,children:e.displayName},e.id))]})]})]},e.id)})}),f&&s(`p`,{className:`mt-2 text-[11px] text-danger`,children:f}),n(`div`,{className:`mt-3 flex items-center gap-2`,children:[n(`button`,{type:`button`,onClick:()=>{D()},disabled:!x||w.isFetching||b,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:[w.isFetching&&s(g,{className:`h-3 w-3 animate-spin`}),`Plan`]}),n(`button`,{type:`button`,onClick:()=>{O()},disabled:!x||T.isPending||b,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:[T.isPending&&s(g,{className:`h-3 w-3 animate-spin`}),`Start migration`]})]}),u&&s(`div`,{className:`mt-3 divide-y divide-border rounded-md border border-border`,children:u.moves.length===0?s(`p`,{className:`px-2.5 py-1.5 text-[11px] text-foreground-subtle`,children:`Nothing to move — selected destinations match the current defaults.`}):u.moves.map(e=>n(`div`,{className:`px-2.5 py-1.5 text-[11px] text-foreground`,children:[e.storageClass,`: `,e.fromLocationId,` → `,e.toLocationId]},`${e.storageClass}-${e.toLocationId}`))}),y&&n(`div`,{className:`mt-4 border-t border-border pt-3`,children:[n(`div`,{className:`flex items-center justify-between`,children:[s(`h4`,{className:`text-xs font-semibold text-foreground`,children:`Migration status`}),b&&n(`button`,{type:`button`,onClick:()=>{k()},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:[s(B,{className:`h-3 w-3`}),`Cancel`]})]}),n(`p`,{className:`mt-1 text-xs text-foreground`,children:[`Phase: `,s(`span`,{className:`font-medium`,children:y.phase}),b&&s(g,{className:`ml-2 inline h-3 w-3 animate-spin text-primary`})]}),y.error&&s(`p`,{className:`mt-1 text-[11px] text-danger`,children:y.error}),y.pausedParticipants.length>0&&n(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:[`Paused: `,y.pausedParticipants.join(`, `)]}),s(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:y.moves.map(e=>s(Dt,{move:e},`${e.storageClass}-${e.fromLocationId}`))})]}),s(Ot,{})]}),s(kt,{running:b}),s(jt,{})]})}function Dt({move:e}){let t=e.progress===null?null:xt(e.progress);return n(`div`,{className:`px-2.5 py-1.5 text-[11px]`,children:[n(`div`,{className:`flex items-center justify-between`,children:[n(`span`,{className:`text-foreground`,children:[e.storageClass,`: `,e.fromLocationId,` → `,e.toLocationId]}),n(`span`,{className:`text-foreground-subtle`,children:[e.state??`pending`,e.error?` (${e.error})`:``]})]}),e.progress!==null&&n(`div`,{className:`mt-1 space-y-1`,children:[t!==null&&t.fraction!==null&&s(`div`,{className:`h-1 w-full overflow-hidden rounded bg-border`,children:s(`div`,{className:`h-full bg-primary`,style:{width:`${(t.fraction*100).toFixed(1)}%`}})}),s(`p`,{className:`text-[10px] text-foreground-subtle`,children:St(e.progress)})]})]})}function Ot(){let{data:e}=de({});return!e||e.length===0?null:n(`div`,{className:`mt-4 border-t border-border pt-3`,children:[s(`h4`,{className:`text-xs font-semibold text-foreground`,children:`Migration history`}),s(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:e.map(e=>n(`div`,{className:`px-2.5 py-1.5 text-[11px] text-foreground-subtle`,children:[s(`span`,{className:`font-medium text-foreground`,children:e.phase}),` · `,Object.entries(e.destinations).filter(e=>typeof e[1]==`string`).map(([e,t])=>`${e} → ${t}`).join(`, `),` · `,new Date(e.startedAt).toLocaleString()]},e.jobId))})]})}function kt({running:e}){let t=I(),r=se({},{staleTime:1/0,refetchOnWindowFocus:!1}),i=te(),[a,c]=o(null),l=r.data??[];if(l.length===0)return null;let u=async e=>{if(await t({title:`Drain remaining ${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:`Drain remaining`,variant:`danger`})){c(null);try{await i.mutateAsync({classes:[e.storageClass]}),await r.refetch()}catch(e){c(e instanceof Error?e.message:String(e))}}};return n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[n(`div`,{className:`flex items-start justify-between gap-2`,children:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Left on the old location`}),n(`div`,{className:`flex shrink-0 items-center gap-2`,children:[s(`span`,{className:`text-[10px] text-foreground-subtle`,children:r.dataUpdatedAt>0?`Measured ${new Date(r.dataUpdatedAt).toLocaleTimeString()}`:`Measured — never`}),s(`button`,{type:`button`,onClick:()=>{r.refetch()},disabled:r.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:r.isFetching?`Counting…`:`Refresh`})]})]}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`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.`}),s(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:`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.`}),a&&s(`p`,{className:`mt-2 text-[11px] text-danger`,children:a}),s(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:l.map(t=>n(`div`,{className:`flex items-center justify-between gap-2 px-2.5 py-1.5 text-[11px]`,children:[n(`span`,{className:`text-foreground`,children:[t.storageClass,`: `,t.fromLocationId,` → `,t.toLocationId,s(`span`,{className:`ml-2 text-foreground-subtle`,children:At(t)})]}),s(`button`,{type:`button`,onClick:()=>{u(t)},disabled:e||i.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:`Drain remaining`})]},`${t.storageClass}-${t.fromLocationId}`))})]})}function At(e){if(e.items===null)return`amount unknown — the archive could not be read`;let t=e.items.toLocaleString(`en-US`);return e.bytes===null?`${t} rows`:`${t} segments · ${G(e.bytes)}`}function jt(){let{data:e}=he({},{refetchInterval:2e3}),t=(e??[]).filter(e=>e.migrationJobId===null&&e.job.state===`running`);return t.length===0?null:n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Movers running outside a migration`}),s(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:t.map(e=>n(`div`,{className:`px-2.5 py-1.5 text-[11px]`,children:[n(`div`,{className:`text-foreground`,children:[e.lane,`: `,e.job.fromLocationId,` → `,e.job.toLocationId]}),s(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:St({filesMoved:e.job.filesMoved,filesTotal:e.job.filesTotal,bytesMoved:e.job.bytesMoved,startedAt:e.job.startedAt,observedAt:e.observedAt})})]},e.job.jobId))})]})}function Mt(){return n(`div`,{className:`flex flex-col gap-4`,children:[s(gt,{}),s(yt,{}),n(`section`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Move storage`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`Copy recordings, low-res recordings or event media to a new location, verify, then repoint the default. Applies to every camera.`}),s(`div`,{className:`mt-3`,children:s(Tt,{})})]})]})}t();var Nt=`recorder`;function Pt(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 Ft(){let e=a(),{nodes:t}=z(),{data:i,isLoading:o}=P({addonId:Nt}),c=Pt(i,`recordingNodeId`,`hub`),l=ce({onSuccess:()=>{e.invalidateQueries({queryKey:[[`addonSettings`,`getGlobalSettings`]]})}}),u=r(()=>{let e=t.filter(e=>e.isOnline).map(e=>e.id);return[...new Set([`hub`,c,...e])].filter(Boolean)},[t,c]);return n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Recording node`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`The single node that records (continuous & events) and serves playback. Every other node stays inert — no multi-node balancing. Takes effect on addon restart.`}),n(`div`,{className:`mt-3 flex items-center gap-2`,children:[o?s(g,{className:`h-4 w-4 animate-spin text-foreground-subtle`}):s(`select`,{value:c,onChange:e=>{e.target.value!==c&&l.mutate({addonId:Nt,patch:{recordingNodeId:e.target.value}})},disabled:l.isPending,className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:u.map(e=>s(`option`,{value:e,children:e===`hub`?`hub (default)`:e},e))}),l.isPending&&s(g,{className:`h-4 w-4 animate-spin text-primary`})]}),c!==`hub`&&n(`p`,{className:`mt-2 text-[11px] text-amber-500`,children:[`The stream-broker is hub-only — an agent recorder pulls streams from the hub over the network. The hub's RTSP restream port must be reachable from`,` `,s(`span`,{className:`font-medium`,children:c}),`. If the auto-derived host doesn't work, set the recorder's`,s(`span`,{className:`font-medium`,children:` recordingHubHostname`}),` global setting.`]})]}),n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`Recordings folders`}),s(`p`,{className:`mb-3 text-[11px] text-foreground-subtle`,children:`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.`}),s(Ve,{types:[`recordings`,`recordingsLow`]})]})]})}function Z(e){return e.locationIds!==void 0&&e.locationIds.length>0?e.locationIds:e.locationId===null?[]:[e.locationId]}function It(e,t){let n=Z(e);return n.length===0?`default root`:n.map(e=>t.get(e)??e).join(` + `)}function Lt(e,t,n){if(e.length===0)return null;let r=e[0];if(e.length===1&&r!==void 0)return{label:It(r,t),exact:!0};if(n===null)return null;let i=e.find(e=>Z(e).includes(n));return i===void 0?null:{label:It(i,t),exact:!1}}t();var Rt=[[`recording`]],zt=[{value:`retention`,label:`Retention policy`},{value:`quota`,label:`Quota / disk pressure`},{value:`operator`,label:`Operator`}],Bt={ok:`bg-primary`,warn:`bg-amber-500`,critical:`bg-danger`},Q={ok:`text-foreground-subtle`,warn:`text-amber-500`,critical:`text-danger`};function $(e){return`${String(Math.round(e*100))}%`}function Vt(e){return e==null?`—`:new Date(e).toLocaleString()}function Ht(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(` + `):`default root`:e.root}function Ut(){let t=a(),i=I(),[c,u]=o(`retention`),{data:d,isLoading:p}=V({},{refetchOnWindowFocus:!1}),{data:h}=L({isCamera:!0,projection:`slim`}),{data:_}=m({}),v=r(()=>{let e=new Map;for(let t of h??[])e.set(t.id,t.name);return e},[h]),y=r(()=>{let e=new Map;for(let t of _??[])e.set(t.id,t.displayName);return e},[_]),b=r(()=>{let e=_??[];return e.find(e=>e.type===`recordings`&&e.enabled!==!1)?.id??e.find(e=>e.type===`recordings`)?.id??null},[_]),x=r(()=>d?.locations??[],[d?.locations]),S=r(()=>Lt(x,y,b),[x,y,b]),C=r(()=>be(x),[x]),E=e(()=>{t.invalidateQueries({queryKey:Rt})},[t]),D=M({onSuccess:E}),O=A({onSuccess:E}),k=e(async e=>{await i({title:`Prune ${v.get(e.deviceId)??`#${String(e.deviceId)}`}?`,message:`Applies the retention policy now (reason: ${c}). Footage beyond the policy is permanently deleted.`,confirmLabel:`Prune now`,variant:`danger`})&&D.mutate({deviceId:e.deviceId,reason:c})},[i,D,c,v]),j=e(async e=>{await i({title:`Delete all footage for ${v.get(e.deviceId)??`#${String(e.deviceId)}`}?`,message:`Permanently deletes ${G(e.usedBytes)} of recorded footage for this camera. This cannot be undone.`,confirmLabel:`Delete ${G(e.usedBytes)}`,variant:`danger`})&&O.mutate({deviceId:e.deviceId})},[i,O,v]),ee=r(()=>[{key:`camera`,header:`Camera`,render:e=>s(`span`,{className:`text-foreground`,children:v.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`disk`,header:`Disk`,nowrap:!0,render:()=>S===null?s(`span`,{className:`text-foreground-subtle`,children:`—`}):n(`span`,{className:S.exact?`text-foreground`:`text-foreground-subtle`,title:S.exact?`The only recordings volume on this node — this camera can only be here.`:`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:[S.label,!S.exact&&s(`span`,{className:`ml-1 text-foreground-subtle`,children:`(default)`})]})},{key:`used`,header:`Used`,align:`right`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:G(e.usedBytes)})},{key:`oldest`,header:`Oldest footage`,align:`right`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums text-foreground-subtle`,title:`The oldest segment the ARCHIVE holds for this camera — the per-camera answer to 'is retention actually holding?'.`,children:Vt(e.oldestMs)})},{key:`actions`,header:``,align:`right`,render:e=>n(`div`,{className:`flex items-center justify-end gap-1`,children:[n(`button`,{onClick:()=>{k(e)},disabled:D.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:`Apply retention policy now`,children:[s(Pe,{className:`h-3 w-3`}),`Prune`]}),n(`button`,{onClick:()=>{j(e)},disabled:O.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:`Delete all footage`,children:[s(f,{className:`h-3 w-3`}),`Delete`]})]})}],[v,S,k,j,D.isPending,O.isPending]);if(p&&!d)return n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(g,{className:`h-4 w-4 animate-spin`}),`Loading storage usage…`]});if(!d)return s(T,{icon:H,title:`No storage data`,description:`The recording node has not reported any storage usage yet.`});let N=d.devices.length;return n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[s(l,{label:`Total used`,icon:s(H,{className:`h-3 w-3`}),footer:`${String(N)} camera${N===1?``:`s`} on ${d.nodeId}`,children:G(d.totalUsedBytes)}),C!==null&&C.severity!==null&&s(l,{label:`Free on recordings volumes`,icon:s(H,{className:`h-3 w-3`}),footer:`across ${String(C.knownVolumes)} volume${C.knownVolumes===1?``:`s`} of ${G(C.totalBytes)}`+(C.unknownVolumes>0?` · ${String(C.unknownVolumes)} did not report capacity`:``),children:s(`span`,{className:`tabular-nums ${Q[C.severity]}`,children:G(C.freeBytes)})}),x.map(e=>{let t=we(e),r=e.locationId??e.root??`default`;return s(l,{label:`Disk: ${Ht(e,y)}`,footer:t===null?`${G(e.usedBytes)} of recordings · volume capacity unknown`:`${G(t.freeBytes)} free of ${G(t.totalBytes)} · ${G(e.usedBytes)} recordings (${$(t.recordingsFraction)})`,children:t===null?s(`span`,{className:`tabular-nums`,children:G(e.usedBytes)}):n(`div`,{className:`flex items-center gap-2`,title:`Volume fill — everything on the disk, not only recordings. Warn at 85%, critical at 95%.`,children:[s(`div`,{className:`h-2 flex-1 overflow-hidden rounded bg-muted`,children:s(`div`,{className:`h-full rounded ${Bt[t.severity]}`,style:{width:$(t.fraction)}})}),s(`span`,{className:`tabular-nums text-xs ${Q[t.severity]}`,children:$(t.fraction)})]})},r)})]}),n(`section`,{className:`flex items-center gap-2 text-xs`,children:[s(`label`,{htmlFor:`prune-reason`,className:`text-foreground-subtle`,children:`Prune reason`}),s(`select`,{id:`prune-reason`,value:c,onChange:e=>{let t=zt.find(t=>t.value===e.target.value);t&&u(t.value)},className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:zt.map(e=>s(`option`,{value:e.value,children:e.label},e.value))})]}),N===0?s(T,{icon:H,title:d.devicesRead===`unavailable`?`Per-camera usage unavailable`:`No recorded footage`,description:d.devicesRead===`unavailable`?`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.`:`No camera has recorded footage on this node yet.`}):s(w,{columns:ee,rows:[...d.devices],rowKey:e=>e.deviceId,minWidthPx:480})]})}function Wt(){return n(`div`,{className:`flex flex-col gap-8`,children:[n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Footage on disk`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`What recorded footage occupies, per camera and per volume, with prune-by-policy and delete-all-footage.`}),s(`div`,{className:`mt-3`,children:s(Ut,{})})]}),n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Recording node & folders`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`The single node that records and serves playback, and the storage locations footage is written to.`}),s(`div`,{className:`mt-3`,children:s(Ft,{})})]})]})}function Gt(){return s(Ae,{icon:S,title:`Recordings`,subtitle:`Recorded footage and the durable event store — what each occupies, where it is written, and the operations that move or reconcile both.`,children:s(Me,{tabs:[{id:`storage`,label:`Recordings`,icon:H,content:s(Wt,{})},{id:`events`,label:`Events`,icon:R,content:s(Xe,{})},{id:`cameras`,label:`Cameras`,icon:u,content:s(Be,{})},{id:`exports`,label:`Export`,icon:S,content:s(dt,{})},{id:`activity`,label:`Activity`,icon:U,content:s(ze,{})},{id:`management`,label:`Management`,icon:Oe,content:s(Mt,{})}]})})}export{Gt as RecordingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{vt as e}from"./player-overlays-tKtUzh3g.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};
|