@camstack/addon-admin-ui 1.2.680 → 1.2.681

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/assets/{Addons-CbMQ6QOZ.js → Addons-BQtbFugf.js} +1 -1
  3. package/dist/assets/{AdminPage-DfT8N7Bl.js → AdminPage-B_CqiZWp.js} +1 -1
  4. package/dist/assets/{AdminSectionedPage-CpcwVaPi.js → AdminSectionedPage-Bi6ieNaT.js} +1 -1
  5. package/dist/assets/{AiProfiles-CO02Pe8C.js → AiProfiles-C1vrJXE5.js} +1 -1
  6. package/dist/assets/{BootstrapSettingsForm-I_pzlg37.js → BootstrapSettingsForm-D9ajaHYy.js} +1 -1
  7. package/dist/assets/Build-B98-wY2k.js +42 -0
  8. package/dist/assets/{Calendars-POqrL2K5.js → Calendars-DIEH_kLH.js} +1 -1
  9. package/dist/assets/{CameraGrids-D3AIHu1F.js → CameraGrids-DSjiIeBb.js} +1 -1
  10. package/dist/assets/{Cluster-BsA55loF.js → Cluster-C5JyEJ_7.js} +1 -1
  11. package/dist/assets/CompositionBlockEditor-UFNxlGZe.js +2 -0
  12. package/dist/assets/{CompositionEditorPage-DkZ7A2su.js → CompositionEditorPage-BGj5lN5X.js} +1 -1
  13. package/dist/assets/{Data-BFSr2kfu.js → Data-CtdHC-NQ.js} +1 -1
  14. package/dist/assets/DeviceDetail-CgxTShJf.js +2 -0
  15. package/dist/assets/{Devices-PYzlrYFi.js → Devices-DhTJc2h5.js} +1 -1
  16. package/dist/assets/{EmbedDevicePage-QfJaH9et.js → EmbedDevicePage-7EKQlkJA.js} +1 -1
  17. package/dist/assets/{EmbedPlayerPage-ChsM6fwV.js → EmbedPlayerPage-N4CeYehf.js} +1 -1
  18. package/dist/assets/History-6XjzgdEM.js +1 -0
  19. package/dist/assets/{Identity-CRHUOPkL.js → Identity-2_EKARzZ.js} +1 -1
  20. package/dist/assets/{InstancesTable-YQdXCtaA.js → InstancesTable-Dv8_CDEW.js} +1 -1
  21. package/dist/assets/{IntegrationDetail-gc_y7FHB.js → IntegrationDetail-B_dOpKox.js} +1 -1
  22. package/dist/assets/{Integrations-nPzZ9j6g.js → Integrations-ePo9zoSs.js} +1 -1
  23. package/dist/assets/{Integrations-Dlfm_5eM.js → Integrations-j7sA6lL0.js} +1 -1
  24. package/dist/assets/{Library-DLR5ijVt.js → Library-DLxvvSAf.js} +1 -1
  25. package/dist/assets/{Locations-BpAIZ5Q8.js → Locations-CMTtpwaE.js} +2 -2
  26. package/dist/assets/{Logs-BgeE52Vx.js → Logs-De6w9VHU.js} +1 -1
  27. package/dist/assets/{MaskShapeCanvas-BN-PRLjb.js → MaskShapeCanvas-BC-_RIpC.js} +1 -1
  28. package/dist/assets/{MotionZonesSettings-D9Prrwl-.js → MotionZonesSettings-Cz4AZLNE.js} +1 -1
  29. package/dist/assets/{MyAccess-By6dpree.js → MyAccess-4ZJbItjF.js} +1 -1
  30. package/dist/assets/{Network-DJ3mA02D.js → Network-BcR1Yi2y.js} +1 -1
  31. package/dist/assets/{NodeAddonsSettingsPanel-CPSGG58L.js → NodeAddonsSettingsPanel-BM3aVGQV.js} +1 -1
  32. package/dist/assets/Notifications-04zYxBDE.js +1 -0
  33. package/dist/assets/{Pipeline-Ciwjdo9n.js → Pipeline-CxnU9Z7j.js} +1 -1
  34. package/dist/assets/{PrivacyMaskSettings-uNqMIBUf.js → PrivacyMaskSettings-DPK93B-Y.js} +1 -1
  35. package/dist/assets/{Recordings-DejfD-rw.js → Recordings-DjWfYoYL.js} +1 -1
  36. package/dist/assets/{SceneMonitorEditor-Dd67GOFm.js → SceneMonitorEditor-BPviZK6D.js} +1 -1
  37. package/dist/assets/{ServerShell-XefvzbRy.js → ServerShell-BidgiCvP.js} +1 -1
  38. package/dist/assets/{SessionsList-B80DJWoE.js → SessionsList-DMAhNExR.js} +1 -1
  39. package/dist/assets/{Showroom-CRsxAvxN.js → Showroom-EEFOBJ4t.js} +1 -1
  40. package/dist/assets/{StorageLocationsTable-x4CVbzbw.js → StorageLocationsTable-XwahMgvr.js} +1 -1
  41. package/dist/assets/{System-Cd2nwJE8.js → System-B0-NhksG.js} +1 -1
  42. package/dist/assets/{Terminal-Y4RMF5FN.js → Terminal-DKG5qGBG.js} +1 -1
  43. package/dist/assets/{TerminalPanel-DRRt2yqB.js → TerminalPanel-A76tI9B7.js} +1 -1
  44. package/dist/assets/{TrainingProviders-BeskzFPx.js → TrainingProviders-C6Vp8Kx2.js} +1 -1
  45. package/dist/assets/{Viewer-CkH9wbpr.js → Viewer-D3P-XeoR.js} +1 -1
  46. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-BOfg6zTM.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-BUt85QW8.js} +1 -1
  47. package/dist/assets/{action-draft-DgC3sdIv.js → action-draft-DXMlq9FI.js} +1 -1
  48. package/dist/assets/{ai-page.helpers-BGxGEY-d.js → ai-page.helpers-B5v8iqae.js} +1 -1
  49. package/dist/assets/{assignment-candidates-DeoBl894.js → assignment-candidates-BMK-mZl3.js} +1 -1
  50. package/dist/assets/{authed-media-CG5cnS5J.js → authed-media-CHQ98iUN.js} +1 -1
  51. package/dist/assets/{board-model-C2Tzni7-.js → board-model-CjzLOUob.js} +1 -1
  52. package/dist/assets/{client-B0p6WiZb.js → client-7xAXvbSV.js} +15 -15
  53. package/dist/assets/{command-vocab-DNAnc4zd.js → command-vocab-CNLk_jHm.js} +1 -1
  54. package/dist/assets/{device-detail-BnrDlPnk.js → device-detail-DGj-xI73.js} +1 -1
  55. package/dist/assets/{device-integration-icon-jRlZnIlZ.js → device-integration-icon-DbXZ_QBE.js} +1 -1
  56. package/dist/assets/device-picker-model-BCpE0nbp.js +1 -0
  57. package/dist/assets/dist-BQg5yMPw.js +1120 -0
  58. package/dist/assets/{dist-BZGaAsKc.js → dist-BYXyw8YS.js} +1 -1
  59. package/dist/assets/{format-YT7IgtG9.js → format-B7w01njJ.js} +1 -1
  60. package/dist/assets/{hostInit-DcxonsQJ.js → hostInit-DhGJDDr0.js} +1 -1
  61. package/dist/assets/i18n-DOHnQXwh.js +1 -0
  62. package/dist/assets/{icons-f0SVFd9I.js → icons-ESLu3bG0.js} +1 -1
  63. package/dist/assets/{index-CkPnVqy7.js → index-DIc4finm.js} +3 -3
  64. package/dist/assets/{linked-devices-model-EHzqFFKo.js → linked-devices-model-BxWNWSfy.js} +1 -1
  65. package/dist/assets/{mf-entry-bootstrap-0-35098dbd.js → mf-entry-bootstrap-0-d3635612.js} +2 -2
  66. package/dist/assets/mount-BCpE0nbp.js +1 -0
  67. package/dist/assets/{notification-rule-status-BRCNbkxe.js → notification-rule-status-Cknn1Y-4.js} +1 -1
  68. package/dist/assets/{player-overlays-ClFSGefV.js → player-overlays-Bft_u1cV.js} +1 -1
  69. package/dist/assets/remoteEntry-DwKW4wbF.js +1 -0
  70. package/dist/assets/src-ClU5wqNT.js +279 -0
  71. package/dist/assets/{sso-popup-Bxcrh_Ga.js → sso-popup-BjxzH099.js} +1 -1
  72. package/dist/assets/{step-inspector-model-FH8OnNrR.js → step-inspector-model-DotIEdMX.js} +1 -1
  73. package/dist/assets/{use-scenes-feed-CV_7Z6wY.js → use-scenes-feed-D-MjPnl-.js} +1 -1
  74. package/dist/assets/{use-stationary-objects-Dt0C-TIU.js → use-stationary-objects-DrEMPNxS.js} +1 -1
  75. package/dist/assets/{useAdminDeviceRemoval-N5ijtZ-Z.js → useAdminDeviceRemoval-PGn91CYm.js} +1 -1
  76. package/dist/assets/useEventInvalidation-BCpE0nbp.js +1 -0
  77. package/dist/assets/{useNodeUrlSelection-ZwCw4opF.js → useNodeUrlSelection-EPVEm-W_.js} +1 -1
  78. package/dist/assets/useTemplateSave-BiSlomhV.js +1 -0
  79. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-C0iz7ghi.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-3eh8KieP.js} +2 -2
  80. package/dist/index.html +8 -8
  81. package/dist/server/addon.js +47 -6
  82. package/package.json +2 -2
  83. package/dist/assets/Build-BjVdqRW2.js +0 -42
  84. package/dist/assets/CompositionBlockEditor-B9Dfae1t.js +0 -2
  85. package/dist/assets/DeviceDetail-na0OsrsC.js +0 -2
  86. package/dist/assets/History-Bdz_0QAJ.js +0 -1
  87. package/dist/assets/Notifications-Dw06-CPi.js +0 -1
  88. package/dist/assets/device-picker-model-gF32i0sF.js +0 -1
  89. package/dist/assets/dist-auYATUda.js +0 -1120
  90. package/dist/assets/i18n-NPZM0HGc.js +0 -1
  91. package/dist/assets/mount-gF32i0sF.js +0 -1
  92. package/dist/assets/remoteEntry-DQV7Iljf.js +0 -1
  93. package/dist/assets/src-1hzzyrfp.js +0 -279
  94. package/dist/assets/useEventInvalidation-gF32i0sF.js +0 -1
  95. package/dist/assets/useTemplateSave-KMK9W_j4.js +0 -1
@@ -1 +1 @@
1
- import{Gi as e,Ms as t}from"./client-B0p6WiZb.js";import{t as n}from"./i18n-NPZM0HGc.js";import{t as r}from"./assignment-candidates-DeoBl894.js";function i(n,r){let i=e[n];return i.hostDeviceTypes.some(e=>e===r)?`host`:i.descriptor.sourceCaps===`any`&&r!==t.Container?`guest`:null}function a(e){return e.slot===`linked-devices`}function o(e){if(e.status===`error`)return{kind:`unknown`,reason:e.error?.message??n.t(`helpers.customize.requestFailed`)};if(e.status===`pending`||e.data===void 0)return{kind:`pending`};for(let t of e.data)if(t.state===`ok`&&t.slot===`linked-devices`&&a(t.value))return{kind:`present`,slot:t,value:t.value};let t=e.data.find(e=>e.state===`unreachable`);return t!==void 0&&t.state===`unreachable`?{kind:`unknown`,reason:t.reason}:{kind:`absent`}}function s(e,t){let n=t.trackedDeviceIds??[],r=e=>t=>({deviceId:t.deviceId,name:t.name,health:t.health,implied:e,tracked:n.includes(t.deviceId)});return[...e.sources.map(r(!1)),...(e.impliedSources??[]).map(r(!0))]}function c(e,t){let n=new Set([...e.sources,...e.impliedSources??[]].map(e=>e.deviceId));return(t.trackedDeviceIds??[]).filter(e=>!n.has(e))}function l(e,t){return{...e,deviceIds:[...e.deviceIds,...t.filter(t=>!e.deviceIds.includes(t))]}}function u(e,t){return{...e,deviceIds:e.deviceIds.filter(e=>e!==t),...e.trackedDeviceIds===void 0?{}:{trackedDeviceIds:e.trackedDeviceIds.filter(e=>e!==t)}}}function d(e,t,n){let r=e.trackedDeviceIds??[],i=n?[...r.filter(e=>e!==t),t]:r.filter(e=>e!==t);return{...e,trackedDeviceIds:i}}function f(e,t,n){return e.flatMap(e=>{let i=t.get(e.deviceId);return n.has(e.deviceId)||i===void 0?[]:[{deviceId:e.deviceId,ref:{addonId:i.addonId,stableId:i.stableId},name:e.parentName===null?e.name:`${e.parentName} · ${e.name}`,detail:r(i.integration,e.location),meta:e.type,caps:[],value:null}]})}function p(e,t,n){return n?l(e,[t]):u(e,t)}function m(e,t,n){if(t.deviceIds.includes(n))return{linked:!0,implied:!1};let r=(e.impliedSources??[]).some(e=>e.deviceId===n);return{linked:r,implied:r}}export{c as a,l as c,m as i,d as l,s as n,i as o,o as r,p as s,f as t,u};
1
+ import{Ji as e,Ls as t}from"./client-7xAXvbSV.js";import{t as n}from"./i18n-DOHnQXwh.js";import{t as r}from"./assignment-candidates-BMK-mZl3.js";function i(n,r){let i=e[n];return i.hostDeviceTypes.some(e=>e===r)?`host`:i.descriptor.sourceCaps===`any`&&r!==t.Container?`guest`:null}function a(e){return e.slot===`linked-devices`}function o(e){if(e.status===`error`)return{kind:`unknown`,reason:e.error?.message??n.t(`helpers.customize.requestFailed`)};if(e.status===`pending`||e.data===void 0)return{kind:`pending`};for(let t of e.data)if(t.state===`ok`&&t.slot===`linked-devices`&&a(t.value))return{kind:`present`,slot:t,value:t.value};let t=e.data.find(e=>e.state===`unreachable`);return t!==void 0&&t.state===`unreachable`?{kind:`unknown`,reason:t.reason}:{kind:`absent`}}function s(e,t){let n=t.trackedDeviceIds??[],r=e=>t=>({deviceId:t.deviceId,name:t.name,health:t.health,implied:e,tracked:n.includes(t.deviceId)});return[...e.sources.map(r(!1)),...(e.impliedSources??[]).map(r(!0))]}function c(e,t){let n=new Set([...e.sources,...e.impliedSources??[]].map(e=>e.deviceId));return(t.trackedDeviceIds??[]).filter(e=>!n.has(e))}function l(e,t){return{...e,deviceIds:[...e.deviceIds,...t.filter(t=>!e.deviceIds.includes(t))]}}function u(e,t){return{...e,deviceIds:e.deviceIds.filter(e=>e!==t),...e.trackedDeviceIds===void 0?{}:{trackedDeviceIds:e.trackedDeviceIds.filter(e=>e!==t)}}}function d(e,t,n){let r=e.trackedDeviceIds??[],i=n?[...r.filter(e=>e!==t),t]:r.filter(e=>e!==t);return{...e,trackedDeviceIds:i}}function f(e,t,n){return e.flatMap(e=>{let i=t.get(e.deviceId);return n.has(e.deviceId)||i===void 0?[]:[{deviceId:e.deviceId,ref:{addonId:i.addonId,stableId:i.stableId},name:e.parentName===null?e.name:`${e.parentName} · ${e.name}`,detail:r(i.integration,e.location),meta:e.type,caps:[],value:null}]})}function p(e,t,n){return n?l(e,[t]):u(e,t)}function m(e,t,n){if(t.deviceIds.includes(n))return{linked:!0,implied:!1};let r=(e.impliedSources??[]).some(e=>e.deviceId===n);return{linked:r,implied:r}}export{c as a,l as c,m as i,d as l,s as n,i as o,o as r,p as s,f as t,u};
@@ -12,8 +12,8 @@ const __mfImport = (src) =>
12
12
 
13
13
 
14
14
  (async () => {
15
- const __mfHostInit = await __mfImport("./hostInit-DcxonsQJ.js");
15
+ const __mfHostInit = await __mfImport("./hostInit-DhGJDDr0.js");
16
16
  await __mfHostInit.__tla;
17
17
  const { initHost } = __mfHostInit;
18
18
  await initHost();
19
- })().then(() => __mfImport("./index-CkPnVqy7.js"));
19
+ })().then(() => __mfImport("./index-DIc4finm.js"));
@@ -0,0 +1 @@
1
+ import"./src-ClU5wqNT.js";
@@ -1 +1 @@
1
- import{t as e}from"./i18n-NPZM0HGc.js";var t=`pipeline-analytics`,n=`nc.getRuleStatus`,r=`nc.testRule`;function i(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function a(e,t){let n=e[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function o(e,t){let n=e[t];return typeof n==`string`&&n.length>0?n:void 0}function s(e){if(!i(e))return;let t=o(e,`id`),n=o(e,`downloadPath`),r=a(e,`capturedAt`);if(!(t===void 0||n===void 0||r===void 0))return{id:t,mediaType:o(e,`mediaType`)??`video`,sizeBytes:a(e,`sizeBytes`)??0,capturedAt:r,downloadPath:n}}function c(e){if(!i(e))return;let t=a(e,`startMs`),n=a(e,`endMs`);if(!(t===void 0||n===void 0))return{startMs:t,endMs:n}}function l(e){if(!i(e))return null;let t=a(e,`deviceId`);if(t===void 0)return null;let n=a(e,`lastGeneratedAt`),r=s(e.lastArtifact),o=e.rendering,c=i(o)?{startedAt:a(o,`startedAt`)??0,windowStartMs:a(o,`windowStartMs`)??0,windowEndMs:a(o,`windowEndMs`)??0}:void 0;return{deviceId:t,...n===void 0?{}:{lastGeneratedAt:n},...r===void 0?{}:{lastArtifact:r},...c===void 0?{}:{rendering:c}}}function u(e){if(!i(e))return null;let t=a(e,`deviceId`),n=o(e,`windowKey`),r=a(e,`openedAt`),s=a(e,`closesAt`),c=a(e,`members`),l=a(e,`pending`);return t===void 0||n===void 0||r===void 0||s===void 0||c===void 0||l===void 0?null:{deviceId:t,windowKey:n,openedAt:r,closesAt:s,members:c,pending:l}}function d(e){if(!i(e))return null;let t=o(e,`kind`);if(t===`none`)return{kind:`none`,reason:o(e,`reason`)??``};if(t===`occupancy`){let t=a(e,`deviceId`),n=a(e,`threshold`),r=a(e,`sustainSeconds`);if(t===void 0||n===void 0||r===void 0)return null;let i=o(e,`unavailable`),s=i===`no-snapshot`||i===`zone-absent`?i:void 0,c=a(e,`count`),l=a(e,`observedAt`),u=a(e,`since`),d=o(e,`scope`),f=o(e,`className`),p=o(e,`warning`);return{kind:`occupancy`,deviceId:t,threshold:n,sustainSeconds:r,...d===void 0?{}:{scope:d},...f===void 0?{}:{className:f},...c===void 0?{}:{count:c},...typeof e.occupied==`boolean`?{occupied:e.occupied}:{},...l===void 0?{}:{observedAt:l},...u===void 0?{}:{since:u},...s===void 0?{}:{unavailable:s},...p===void 0?{}:{warning:p}}}if(t===`grouped`){let t=a(e,`groupingSec`);if(t===void 0)return null;if(e.openWindows===null){let n=o(e,`reason`);return{kind:`grouped`,groupingSec:t,openWindows:null,...n===void 0?{}:{reason:n}}}if(!Array.isArray(e.openWindows))return null;let n=[];for(let t of e.openWindows){let e=u(t);if(e===null)return null;n.push(e)}return{kind:`grouped`,groupingSec:t,openWindows:n}}if(t===`timelapse`){let t=Array.isArray(e.devices)?e.devices:[],n=[];for(let e of t){let t=l(e);t!==null&&n.push(t)}let r=c(e.lastWindow),o=e.nextWindow,s=i(o)?{startMs:a(o,`startMs`)??0,endMs:a(o,`endMs`)??null}:void 0;return{kind:`timelapse`,devices:n,...r===void 0?{}:{lastWindow:r},...s===void 0?{}:{nextWindow:s},settleMs:a(e,`settleMs`)??0}}return null}function f(t){let n=Math.max(0,Math.floor(t/6e4));if(n<1)return e.t(`helpers.notificationRuleStatus.lessThanMinute`);if(n<60)return e.t(`helpers.notificationRuleStatus.durMin`,{count:n});let r=Math.floor(n/60),i=n%60;if(r<24)return i===0?e.t(`helpers.notificationRuleStatus.durH`,{count:r}):e.t(`helpers.notificationRuleStatus.durHMin`,{hours:r,minutes:i});let a=Math.floor(r/24),o=r%24;return o===0?e.t(`helpers.notificationRuleStatus.durD`,{count:a}):e.t(`helpers.notificationRuleStatus.durDH`,{days:a,hours:o})}function p(t){if(t<1024)return`${String(t)} B`;let n=t/1024;if(n<1024)return e.t(`helpers.notificationRuleStatus.sizeKb`,{value:n.toFixed(0)});let r=n/1024;return r<1024?e.t(`helpers.notificationRuleStatus.sizeMb`,{value:r.toFixed(1)}):e.t(`helpers.notificationRuleStatus.sizeGb`,{value:(r/1024).toFixed(2)})}function m(e,t){let n=e.scope??`the whole frame`,r=e.className??`objects`;if(e.unavailable!==void 0){let t=e.unavailable===`no-snapshot`?`no live count for this camera yet — the condition fails closed until one arrives`:`“${n}” is not in this camera’s current snapshot — the condition fails closed (deleted zone?)`;return e.warning===void 0?t:`${e.warning} · ${t}`}let i=[`Now: ${String(e.count??0)}/${String(e.threshold)} ${r} in ${n}`,e.occupied===!0?`condition TRUE`:`condition false`];e.since!==void 0&&i.push(`for ${f(Math.max(0,t-e.since))}`),i.push(`holds ${String(e.sustainSeconds)} s before firing`);let a=i.join(` · `);return e.warning===void 0?a:`${e.warning} · ${a}`}function h(t,n,r){if(t.rendering!==void 0)return e.t(`helpers.notificationRuleStatus.tlRendering`,{camera:n,duration:f(Math.max(0,r-t.rendering.startedAt)),from:new Date(t.rendering.windowStartMs).toLocaleString(),to:new Date(t.rendering.windowEndMs).toLocaleString()});if(t.lastGeneratedAt===void 0)return e.t(`helpers.notificationRuleStatus.tlNever`,{camera:n});let i=new Date(t.lastGeneratedAt).toLocaleString(),a=t.lastArtifact;return a===void 0?e.t(`helpers.notificationRuleStatus.tlGone`,{camera:n,when:i}):e.t(`helpers.notificationRuleStatus.tlLast`,{camera:n,when:i,size:p(a.sizeBytes)})}function g(e){return{windows:e.length,waiting:e.reduce((e,t)=>e+t.pending,0)}}export{f as a,h as c,g as i,n,m as o,r,d as s,t};
1
+ import{t as e}from"./i18n-DOHnQXwh.js";var t=`pipeline-analytics`,n=`nc.getRuleStatus`,r=`nc.testRule`;function i(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function a(e,t){let n=e[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function o(e,t){let n=e[t];return typeof n==`string`&&n.length>0?n:void 0}function s(e){if(!i(e))return;let t=o(e,`id`),n=o(e,`downloadPath`),r=a(e,`capturedAt`);if(!(t===void 0||n===void 0||r===void 0))return{id:t,mediaType:o(e,`mediaType`)??`video`,sizeBytes:a(e,`sizeBytes`)??0,capturedAt:r,downloadPath:n}}function c(e){if(!i(e))return;let t=a(e,`startMs`),n=a(e,`endMs`);if(!(t===void 0||n===void 0))return{startMs:t,endMs:n}}function l(e){if(!i(e))return null;let t=a(e,`deviceId`);if(t===void 0)return null;let n=a(e,`lastGeneratedAt`),r=s(e.lastArtifact),o=e.rendering,c=i(o)?{startedAt:a(o,`startedAt`)??0,windowStartMs:a(o,`windowStartMs`)??0,windowEndMs:a(o,`windowEndMs`)??0}:void 0;return{deviceId:t,...n===void 0?{}:{lastGeneratedAt:n},...r===void 0?{}:{lastArtifact:r},...c===void 0?{}:{rendering:c}}}function u(e){if(!i(e))return null;let t=a(e,`deviceId`),n=o(e,`windowKey`),r=a(e,`openedAt`),s=a(e,`closesAt`),c=a(e,`members`),l=a(e,`pending`);return t===void 0||n===void 0||r===void 0||s===void 0||c===void 0||l===void 0?null:{deviceId:t,windowKey:n,openedAt:r,closesAt:s,members:c,pending:l}}function d(e){if(!i(e))return null;let t=o(e,`kind`);if(t===`none`)return{kind:`none`,reason:o(e,`reason`)??``};if(t===`occupancy`){let t=a(e,`deviceId`),n=a(e,`threshold`),r=a(e,`sustainSeconds`);if(t===void 0||n===void 0||r===void 0)return null;let i=o(e,`unavailable`),s=i===`no-snapshot`||i===`zone-absent`?i:void 0,c=a(e,`count`),l=a(e,`observedAt`),u=a(e,`since`),d=o(e,`scope`),f=o(e,`className`),p=o(e,`warning`);return{kind:`occupancy`,deviceId:t,threshold:n,sustainSeconds:r,...d===void 0?{}:{scope:d},...f===void 0?{}:{className:f},...c===void 0?{}:{count:c},...typeof e.occupied==`boolean`?{occupied:e.occupied}:{},...l===void 0?{}:{observedAt:l},...u===void 0?{}:{since:u},...s===void 0?{}:{unavailable:s},...p===void 0?{}:{warning:p}}}if(t===`grouped`){let t=a(e,`groupingSec`);if(t===void 0)return null;if(e.openWindows===null){let n=o(e,`reason`);return{kind:`grouped`,groupingSec:t,openWindows:null,...n===void 0?{}:{reason:n}}}if(!Array.isArray(e.openWindows))return null;let n=[];for(let t of e.openWindows){let e=u(t);if(e===null)return null;n.push(e)}return{kind:`grouped`,groupingSec:t,openWindows:n}}if(t===`timelapse`){let t=Array.isArray(e.devices)?e.devices:[],n=[];for(let e of t){let t=l(e);t!==null&&n.push(t)}let r=c(e.lastWindow),o=e.nextWindow,s=i(o)?{startMs:a(o,`startMs`)??0,endMs:a(o,`endMs`)??null}:void 0;return{kind:`timelapse`,devices:n,...r===void 0?{}:{lastWindow:r},...s===void 0?{}:{nextWindow:s},settleMs:a(e,`settleMs`)??0}}return null}function f(t){let n=Math.max(0,Math.floor(t/6e4));if(n<1)return e.t(`helpers.notificationRuleStatus.lessThanMinute`);if(n<60)return e.t(`helpers.notificationRuleStatus.durMin`,{count:n});let r=Math.floor(n/60),i=n%60;if(r<24)return i===0?e.t(`helpers.notificationRuleStatus.durH`,{count:r}):e.t(`helpers.notificationRuleStatus.durHMin`,{hours:r,minutes:i});let a=Math.floor(r/24),o=r%24;return o===0?e.t(`helpers.notificationRuleStatus.durD`,{count:a}):e.t(`helpers.notificationRuleStatus.durDH`,{days:a,hours:o})}function p(t){if(t<1024)return`${String(t)} B`;let n=t/1024;if(n<1024)return e.t(`helpers.notificationRuleStatus.sizeKb`,{value:n.toFixed(0)});let r=n/1024;return r<1024?e.t(`helpers.notificationRuleStatus.sizeMb`,{value:r.toFixed(1)}):e.t(`helpers.notificationRuleStatus.sizeGb`,{value:(r/1024).toFixed(2)})}function m(e,t){let n=e.scope??`the whole frame`,r=e.className??`objects`;if(e.unavailable!==void 0){let t=e.unavailable===`no-snapshot`?`no live count for this camera yet — the condition fails closed until one arrives`:`“${n}” is not in this camera’s current snapshot — the condition fails closed (deleted zone?)`;return e.warning===void 0?t:`${e.warning} · ${t}`}let i=[`Now: ${String(e.count??0)}/${String(e.threshold)} ${r} in ${n}`,e.occupied===!0?`condition TRUE`:`condition false`];e.since!==void 0&&i.push(`for ${f(Math.max(0,t-e.since))}`),i.push(`holds ${String(e.sustainSeconds)} s before firing`);let a=i.join(` · `);return e.warning===void 0?a:`${e.warning} · ${a}`}function h(t,n,r){if(t.rendering!==void 0)return e.t(`helpers.notificationRuleStatus.tlRendering`,{camera:n,duration:f(Math.max(0,r-t.rendering.startedAt)),from:new Date(t.rendering.windowStartMs).toLocaleString(),to:new Date(t.rendering.windowEndMs).toLocaleString()});if(t.lastGeneratedAt===void 0)return e.t(`helpers.notificationRuleStatus.tlNever`,{camera:n});let i=new Date(t.lastGeneratedAt).toLocaleString(),a=t.lastArtifact;return a===void 0?e.t(`helpers.notificationRuleStatus.tlGone`,{camera:n,when:i}):e.t(`helpers.notificationRuleStatus.tlLast`,{camera:n,when:i,size:p(a.sizeBytes)})}function g(e){return{windows:e.length,waiting:e.reduce((e,t)=>e+t.pending,0)}}export{f as a,h as c,g as i,n,m as o,r,d as s,t};