@camstack/addon-admin-ui 1.2.0 → 1.2.1

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 (84) hide show
  1. package/dist/assets/{AddLocationWizard-DS7BizJv.js → AddLocationWizard-r5xWfOLZ.js} +1 -1
  2. package/dist/assets/{AddonCollectionPage-D7lHEbwI.js → AddonCollectionPage-BmcSdSkl.js} +1 -1
  3. package/dist/assets/{Addons-D6z52udO.js → Addons-CLf82zRJ.js} +1 -1
  4. package/dist/assets/{AdminTabs-ZprmiCN3.js → AdminTabs-7mkfimpe.js} +1 -1
  5. package/dist/assets/{AiProfiles-Z7ksIPFF.js → AiProfiles-R33NnzxL.js} +1 -1
  6. package/dist/assets/{BrokerForm-DbfBwy1x.js → BrokerForm-SDrahZJq.js} +1 -1
  7. package/dist/assets/{Capabilities-BeYEhvPF.js → Capabilities-BS_pV5kK.js} +1 -1
  8. package/dist/assets/{CapabilityBadges-DXbYtBuK.js → CapabilityBadges-B5gVN9yo.js} +1 -1
  9. package/dist/assets/{Cluster-CC5_CGJA.js → Cluster-DwLZwcXa.js} +1 -1
  10. package/dist/assets/{ClusterRecordingTab-BSJTZsGS.js → ClusterRecordingTab-CFs8rzNM.js} +1 -1
  11. package/dist/assets/{Dashboard-B44hFAIO.js → Dashboard-DaH-7MeN.js} +1 -1
  12. package/dist/assets/{Data-o2lHojn-.js → Data-DM2CB0tr.js} +1 -1
  13. package/dist/assets/{DetectionIntelligence-CBn9zwCs.js → DetectionIntelligence-DTA_96Ae.js} +1 -1
  14. package/dist/assets/{DeviceDetail-CiJPK_Hg.js → DeviceDetail-Cobtc6wN.js} +1 -1
  15. package/dist/assets/{Devices-CuAPCnH8.js → Devices-BYHdwUA9.js} +1 -1
  16. package/dist/assets/{EmbedPlayerPage-C8Qwuzjd.js → EmbedPlayerPage-BpW4lsWq.js} +1 -1
  17. package/dist/assets/Events-Db4fPx9x.js +1 -0
  18. package/dist/assets/{FormBuilder-2eKUDBn_.js → FormBuilder-BwFnNOpt.js} +1 -1
  19. package/dist/assets/{Identity-BKqc54Et.js → Identity-C_r6Mgc9.js} +1 -1
  20. package/dist/assets/{IntegrationDetail-BRX1Cgc7.js → IntegrationDetail-B3nptv5G.js} +1 -1
  21. package/dist/assets/{Integrations-GzRXWJY0.js → Integrations-BF1ngbno.js} +1 -1
  22. package/dist/assets/{Integrations-CAdnay5c.js → Integrations-BNxwRAw3.js} +1 -1
  23. package/dist/assets/{Logs-DBBumaMc.js → Logs-CR6FjpSE.js} +1 -1
  24. package/dist/assets/{MotionZonesSettings-rxIHdY6l.js → MotionZonesSettings-CH8c2gQJ.js} +1 -1
  25. package/dist/assets/{MyAccess-BbPpIYRJ.js → MyAccess-D6FVIObH.js} +1 -1
  26. package/dist/assets/{Network-C5ZntFKl.js → Network-DZjk05lH.js} +1 -1
  27. package/dist/assets/{NodeAddonsSettingsPanel-KR29Oo7P.js → NodeAddonsSettingsPanel-BvaibJiq.js} +1 -1
  28. package/dist/assets/{NodeInferenceDevices-BowEeg99.js → NodeInferenceDevices-Ch5rjESF.js} +1 -1
  29. package/dist/assets/{NotificationTargets-f-LdcumZ.js → NotificationTargets-3YNCICGO.js} +1 -1
  30. package/dist/assets/{Pipeline-BUL-ABEL.js → Pipeline-BzxPuzJh.js} +1 -1
  31. package/dist/assets/{Plates-re0O5v8R.js → Plates-C48k-46Q.js} +1 -1
  32. package/dist/assets/{PrivacyMaskSettings-DB5GYkOu.js → PrivacyMaskSettings-BwJCGD0l.js} +1 -1
  33. package/dist/assets/{ProviderIcon-CYHRodqA.js → ProviderIcon-BNV0FRHJ.js} +1 -1
  34. package/dist/assets/{Recordings-Cshnuw6r.js → Recordings-CT0gChTC.js} +1 -1
  35. package/dist/assets/{ScanNetworkModal-DAkm1Fdk.js → ScanNetworkModal-BOpbimbE.js} +1 -1
  36. package/dist/assets/{Settings-KX75IP58.js → Settings-BdPbbCyr.js} +1 -1
  37. package/dist/assets/{Showroom-Dztrxiso.js → Showroom-BjnHBP5S.js} +1 -1
  38. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-G3thYr_7.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-D5_wAHv9.js} +1 -1
  39. package/dist/assets/{build-cluster-graph-DUCV6DVF.js → build-cluster-graph-CY__30ZO.js} +1 -1
  40. package/dist/assets/circle-check-big-CE4wAvoQ.js +1 -0
  41. package/dist/assets/clock-B9UjbLDl.js +1 -0
  42. package/dist/assets/{copy-C11dg8eq.js → copy-D5asBldD.js} +1 -1
  43. package/dist/assets/{debounced-invalidate-C_DB9sqL.js → debounced-invalidate-DYWZ0mPG.js} +1 -1
  44. package/dist/assets/{dist-CYW0dAGQ.js → dist-DFASlyrs.js} +1 -1
  45. package/dist/assets/dist-Dx_vZxMI.js +7 -0
  46. package/dist/assets/{download-DshuRjOL.js → download-CeG-HJtH.js} +1 -1
  47. package/dist/assets/{face-bbox-D4Ljg5be.js → face-bbox-6vUFpDk7.js} +1 -1
  48. package/dist/assets/{hostInit-DnViVaCH.js → hostInit-BT2qoJBv.js} +1 -1
  49. package/dist/assets/{index-PRd5ZDug.js → index-CS131rnv.js} +3 -3
  50. package/dist/assets/{key-round-DQuSsH_p.js → key-round-DPrVlcVK.js} +1 -1
  51. package/dist/assets/{mf-entry-bootstrap-0-3b353fa3.js → mf-entry-bootstrap-0-cc4be7d0.js} +2 -2
  52. package/dist/assets/{pencil-DoH-KTcO.js → pencil-BGFPzGyL.js} +1 -1
  53. package/dist/assets/{player-overlays-BfnV1C0Q.js → player-overlays-CWRGbPFt.js} +1 -1
  54. package/dist/assets/plus-CnPG0Tyf.js +1 -0
  55. package/dist/assets/{radio-nxBAF-O0.js → radio-BW_yEv9p.js} +1 -1
  56. package/dist/assets/{refresh-cw-Bh7jR0Ir.js → refresh-cw-53RBMMNj.js} +1 -1
  57. package/dist/assets/remoteEntry-CNnEAmGt.js +1 -0
  58. package/dist/assets/{rotate-ccw-RKms_9rY.js → rotate-ccw-CLPp2z9s.js} +1 -1
  59. package/dist/assets/rotate-cw-BgRV22iV.js +1 -0
  60. package/dist/assets/search-BGpt8p5m.js +1 -0
  61. package/dist/assets/{send-h8PoRj0P.js → send-DUPHYluz.js} +1 -1
  62. package/dist/assets/{server-D6u4qxlr.js → server-DRSIdxSw.js} +1 -1
  63. package/dist/assets/square-TBVq6Wu4.js +1 -0
  64. package/dist/assets/{square-check-big-COxvcZ2K.js → square-check-big-2shiyBaF.js} +1 -1
  65. package/dist/assets/src-BS1NDJr1.js +7 -0
  66. package/dist/assets/{src-DKAxBIDH.js → src-CjlMsFRd.js} +4 -4
  67. package/dist/assets/{upload-cX_3Ogx3.js → upload-BmROjXzl.js} +1 -1
  68. package/dist/assets/{useEventInvalidation-DMfSVBY-.js → useEventInvalidation-DD_0VNer.js} +1 -1
  69. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BBpdMDOB.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BNFfTwsx.js} +2 -2
  70. package/dist/assets/{wifi-Bk03mxTw.js → wifi-_GGDG2Kl.js} +1 -1
  71. package/dist/assets/{zap-B7VEvais.js → zap-CNKAzXbX.js} +1 -1
  72. package/dist/index.html +5 -5
  73. package/dist/server/addon.js +21 -4
  74. package/package.json +1 -1
  75. package/dist/assets/Events-De1MNcJg.js +0 -1
  76. package/dist/assets/circle-check-big-Ctn01sEf.js +0 -1
  77. package/dist/assets/clock-CdqW_Msl.js +0 -1
  78. package/dist/assets/dist-D7nNU2QV.js +0 -7
  79. package/dist/assets/plus-CIHjZPFg.js +0 -1
  80. package/dist/assets/remoteEntry-Bk3nWhnN.js +0 -1
  81. package/dist/assets/rotate-cw-64smQO88.js +0 -1
  82. package/dist/assets/search-C0Kh9F13.js +0 -1
  83. package/dist/assets/square-BtiVHmLU.js +0 -1
  84. package/dist/assets/src-CCZM6rtM.js +0 -7
@@ -1 +1 @@
1
- import{Co as e,So as t,xo as n}from"./src-DKAxBIDH.js";import{I as r,K as i,Q as a,S as o,W as s,b as c,q as l,x as u,z as d}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{L as f,V as p,c as ee,g as m,n as h,p as g,s as te}from"./player-overlays-BfnV1C0Q.js";import{MaskShapeCanvas as _}from"./MaskShapeCanvas-pGn6MKOi.js";var ne=m(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]);a();var v=120,y=`privacy-mask`,b=`rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors`,x=`rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors`;function S(e){return e.kind===`rect`||e.kind===`polygon`?e:null}function re(e){let t=new Set(e.map(e=>e.id)),n=0;for(;t.has(n);)n+=1;return n}function C(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(JSON.stringify(e[n])!==JSON.stringify(t[n]))return!1;return!0}function w({deviceId:a}){let m=ee(g().trpcClient,a),[w,T]=l(null),[E,D]=l(!1),[O,k]=l(null),[A,j]=l(null),[M,N]=l(!1),[P,F]=l(!1),[I,L]=l(null),[R,z]=l(null),B=i(!1);d(()=>{if(!m)return;let e=!1;return B.current=!1,T(null),D(!1),k(null),j(null),F(!1),L(null),z(null),(async()=>{try{let t=await m.privacyMask?.getOptions({});if(e)return;if(!t)throw Error(`device proxy not ready`);if(T(t),B.current)return;let n=await m.privacyMask?.getStatus({});if(e)return;if(!n)throw Error(`device proxy not ready`);B.current=!0;let r={enabled:n.enabled,regions:n.regions};j(r),k(r)}catch(t){if(e)return;p(t)?D(!0):console.error(`Privacy Mask load failed`,t)}})(),()=>{e=!0}},[m]);let V=s(()=>O!==null&&A!==null&&(O.enabled!==A.enabled||!C(O.regions,A.regions)),[O,A]),H=O?O.regions.length:0,U=w?w.maxRegions:0,W=i(0);d(()=>{W.current=U},[U]);let G=U>0&&H>=U,K=r(()=>{k(e=>e&&{...e,enabled:!e.enabled})},[]),q=r(e=>{L(typeof e==`number`?e:null)},[]),J=s(()=>O?O.regions.map(e=>({id:e.id,shape:e.shape,enabled:e.enabled,label:`Zone ${String(e.id)}`})):[],[O]),Y=r((e,t)=>{let n=S(t);n&&k(t=>t&&{...t,regions:t.regions.map(t=>t.id===e?{...t,shape:n}:t)})},[]),X=r(e=>{let t=S(e);t&&(z(null),k(e=>{if(!e)return e;let n=W.current;if(n>0&&e.regions.length>=n)return e;let r=re(e.regions),i={id:r,enabled:!0,shape:t};return L(r),{...e,regions:[...e.regions,i]}}))},[]),Z=r(e=>{F(!0),L(null),z(e)},[]),ie=r(e=>{F(!0),z(null),L(e)},[]),ae=r(e=>{L(t=>t===e?null:t),k(t=>t&&{...t,regions:t.regions.filter(t=>t.id!==e)})},[]),oe=r(()=>{z(null),L(null),A&&k({enabled:A.enabled,regions:A.regions})},[A]),se=r(async()=>{if(!(!m||!O)){N(!0);try{await m.privacyMask?.setMask({patch:{enabled:O.enabled,regions:[...O.regions]}});let e=await m.privacyMask?.getStatus({});if(e){let t={enabled:e.enabled,regions:e.regions};j(t),k(t)}}catch(e){console.error(`Privacy Mask save failed`,e)}finally{N(!1)}}},[m,O]),ce=r(()=>{F(e=>(e&&(z(null),L(null)),!e))},[]),Q=w?.supportedShapes??[];h(s(()=>P&&!E&&w&&O?{id:y,order:v,node:u(_,{transparent:!0,items:J,supportedShapes:Q,polygonVertices:w.polygonVertices,selectedId:I,onSelect:q,onShapeChange:Y,onDrawComplete:X,drawingKind:R})}:null,[P,E,w,O,J,Q,I,q,Y,X,R]));let le=w?.supportedShapes.includes(`rect`)??!1,ue=w?.supportedShapes.includes(`polygon`)??!1,$=w!==null&&(w.maxRegions<=0||w.supportedShapes.length===0);return m?u(te,{title:`Privacy Mask`,icon:u(e,{className:`h-3.5 w-3.5 text-foreground-subtle`}),children:u(`div`,{className:`flex flex-col gap-3`,children:E||$?u(`p`,{className:`${f} leading-relaxed`,children:`This camera doesn't support an on-board privacy mask.`}):!E&&!$&&w!==null&&O!==null?o(c,{children:[o(`p`,{className:`${f} leading-relaxed`,children:[`Toggle `,u(`strong`,{className:`text-foreground`,children:`Edit mask`}),` to draw blanked-out zones on the live frame, then `,u(`strong`,{className:`text-foreground`,children:`Save`}),` to push them to the camera. Drag a rectangle to move, its corner to resize; drag polygon vertices, click an edge midpoint to add one, or right-click a vertex to remove it.`]}),o(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[u(`button`,{type:`button`,onClick:ce,disabled:M,"aria-pressed":P,className:P?x:b,children:P?`Done editing`:`Edit mask`}),u(`button`,{type:`button`,onClick:K,disabled:M,"aria-pressed":O.enabled,className:O.enabled?x:b,children:O.enabled?`Mask on`:`Mask off`}),le&&u(`button`,{type:`button`,onClick:()=>Z(`rect`),disabled:M||G,"aria-pressed":R===`rect`,className:R===`rect`?x:b,title:G?`Maximum zones reached`:`Add a rectangle zone`,children:`+ Rect`}),ue&&u(`button`,{type:`button`,onClick:()=>Z(`polygon`),disabled:M||G,"aria-pressed":R===`polygon`,className:R===`polygon`?x:b,title:G?`Maximum zones reached`:`Add a polygon zone`,children:`+ Polygon`}),o(`span`,{className:`${f} ml-1 tabular-nums`,children:[H,` / `,U,` zones`]}),u(`span`,{className:`flex-1`}),u(`button`,{type:`button`,onClick:oe,disabled:M||!V,className:`rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors`,children:`Revert`}),u(`button`,{type:`button`,onClick:()=>void se(),disabled:M||!V,className:x,children:M?`Saving…`:`Save`})]}),H>0?u(`div`,{className:`flex flex-col gap-1`,children:O.regions.map(e=>{let r=I===e.id,i=e.shape.kind===`polygon`?ne:t;return o(`div`,{className:`flex items-center gap-2 rounded-md border px-2 py-1 transition-colors ${r?`border-primary/50 bg-primary/10`:`border-border bg-surface`}`,children:[o(`button`,{type:`button`,onClick:()=>ie(e.id),disabled:M,className:`flex flex-1 items-center gap-2 text-left text-[11px] font-medium text-foreground-subtle hover:text-foreground disabled:opacity-40 transition-colors`,children:[u(i,{className:`h-3.5 w-3.5 shrink-0`}),o(`span`,{children:[`Zone `,e.id]}),u(`span`,{className:`text-foreground-faint capitalize`,children:e.shape.kind})]}),u(`button`,{type:`button`,onClick:()=>ae(e.id),disabled:M,"aria-label":`Delete zone ${String(e.id)}`,title:`Delete zone`,className:`inline-flex h-6 w-6 items-center justify-center rounded border border-border bg-surface text-foreground-subtle hover:border-red-400/40 hover:bg-red-500/10 hover:text-red-400 disabled:opacity-40 transition-colors`,children:u(n,{className:`h-3.5 w-3.5`})})]},e.id)})}):null]}):u(`p`,{className:`${f} leading-relaxed`,children:`Loading the camera's privacy mask…`})})}):null}export{w as PrivacyMaskSettings};
1
+ import{Co as e,So as t,xo as n}from"./src-CjlMsFRd.js";import{I as r,K as i,Q as a,S as o,W as s,b as c,q as l,x as u,z as d}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{L as f,V as p,c as ee,g as m,n as h,p as g,s as te}from"./player-overlays-CWRGbPFt.js";import{MaskShapeCanvas as _}from"./MaskShapeCanvas-pGn6MKOi.js";var ne=m(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]);a();var v=120,y=`privacy-mask`,b=`rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors`,x=`rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors`;function S(e){return e.kind===`rect`||e.kind===`polygon`?e:null}function re(e){let t=new Set(e.map(e=>e.id)),n=0;for(;t.has(n);)n+=1;return n}function C(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(JSON.stringify(e[n])!==JSON.stringify(t[n]))return!1;return!0}function w({deviceId:a}){let m=ee(g().trpcClient,a),[w,T]=l(null),[E,D]=l(!1),[O,k]=l(null),[A,j]=l(null),[M,N]=l(!1),[P,F]=l(!1),[I,L]=l(null),[R,z]=l(null),B=i(!1);d(()=>{if(!m)return;let e=!1;return B.current=!1,T(null),D(!1),k(null),j(null),F(!1),L(null),z(null),(async()=>{try{let t=await m.privacyMask?.getOptions({});if(e)return;if(!t)throw Error(`device proxy not ready`);if(T(t),B.current)return;let n=await m.privacyMask?.getStatus({});if(e)return;if(!n)throw Error(`device proxy not ready`);B.current=!0;let r={enabled:n.enabled,regions:n.regions};j(r),k(r)}catch(t){if(e)return;p(t)?D(!0):console.error(`Privacy Mask load failed`,t)}})(),()=>{e=!0}},[m]);let V=s(()=>O!==null&&A!==null&&(O.enabled!==A.enabled||!C(O.regions,A.regions)),[O,A]),H=O?O.regions.length:0,U=w?w.maxRegions:0,W=i(0);d(()=>{W.current=U},[U]);let G=U>0&&H>=U,K=r(()=>{k(e=>e&&{...e,enabled:!e.enabled})},[]),q=r(e=>{L(typeof e==`number`?e:null)},[]),J=s(()=>O?O.regions.map(e=>({id:e.id,shape:e.shape,enabled:e.enabled,label:`Zone ${String(e.id)}`})):[],[O]),Y=r((e,t)=>{let n=S(t);n&&k(t=>t&&{...t,regions:t.regions.map(t=>t.id===e?{...t,shape:n}:t)})},[]),X=r(e=>{let t=S(e);t&&(z(null),k(e=>{if(!e)return e;let n=W.current;if(n>0&&e.regions.length>=n)return e;let r=re(e.regions),i={id:r,enabled:!0,shape:t};return L(r),{...e,regions:[...e.regions,i]}}))},[]),Z=r(e=>{F(!0),L(null),z(e)},[]),ie=r(e=>{F(!0),z(null),L(e)},[]),ae=r(e=>{L(t=>t===e?null:t),k(t=>t&&{...t,regions:t.regions.filter(t=>t.id!==e)})},[]),oe=r(()=>{z(null),L(null),A&&k({enabled:A.enabled,regions:A.regions})},[A]),se=r(async()=>{if(!(!m||!O)){N(!0);try{await m.privacyMask?.setMask({patch:{enabled:O.enabled,regions:[...O.regions]}});let e=await m.privacyMask?.getStatus({});if(e){let t={enabled:e.enabled,regions:e.regions};j(t),k(t)}}catch(e){console.error(`Privacy Mask save failed`,e)}finally{N(!1)}}},[m,O]),ce=r(()=>{F(e=>(e&&(z(null),L(null)),!e))},[]),Q=w?.supportedShapes??[];h(s(()=>P&&!E&&w&&O?{id:y,order:v,node:u(_,{transparent:!0,items:J,supportedShapes:Q,polygonVertices:w.polygonVertices,selectedId:I,onSelect:q,onShapeChange:Y,onDrawComplete:X,drawingKind:R})}:null,[P,E,w,O,J,Q,I,q,Y,X,R]));let le=w?.supportedShapes.includes(`rect`)??!1,ue=w?.supportedShapes.includes(`polygon`)??!1,$=w!==null&&(w.maxRegions<=0||w.supportedShapes.length===0);return m?u(te,{title:`Privacy Mask`,icon:u(e,{className:`h-3.5 w-3.5 text-foreground-subtle`}),children:u(`div`,{className:`flex flex-col gap-3`,children:E||$?u(`p`,{className:`${f} leading-relaxed`,children:`This camera doesn't support an on-board privacy mask.`}):!E&&!$&&w!==null&&O!==null?o(c,{children:[o(`p`,{className:`${f} leading-relaxed`,children:[`Toggle `,u(`strong`,{className:`text-foreground`,children:`Edit mask`}),` to draw blanked-out zones on the live frame, then `,u(`strong`,{className:`text-foreground`,children:`Save`}),` to push them to the camera. Drag a rectangle to move, its corner to resize; drag polygon vertices, click an edge midpoint to add one, or right-click a vertex to remove it.`]}),o(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[u(`button`,{type:`button`,onClick:ce,disabled:M,"aria-pressed":P,className:P?x:b,children:P?`Done editing`:`Edit mask`}),u(`button`,{type:`button`,onClick:K,disabled:M,"aria-pressed":O.enabled,className:O.enabled?x:b,children:O.enabled?`Mask on`:`Mask off`}),le&&u(`button`,{type:`button`,onClick:()=>Z(`rect`),disabled:M||G,"aria-pressed":R===`rect`,className:R===`rect`?x:b,title:G?`Maximum zones reached`:`Add a rectangle zone`,children:`+ Rect`}),ue&&u(`button`,{type:`button`,onClick:()=>Z(`polygon`),disabled:M||G,"aria-pressed":R===`polygon`,className:R===`polygon`?x:b,title:G?`Maximum zones reached`:`Add a polygon zone`,children:`+ Polygon`}),o(`span`,{className:`${f} ml-1 tabular-nums`,children:[H,` / `,U,` zones`]}),u(`span`,{className:`flex-1`}),u(`button`,{type:`button`,onClick:oe,disabled:M||!V,className:`rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors`,children:`Revert`}),u(`button`,{type:`button`,onClick:()=>void se(),disabled:M||!V,className:x,children:M?`Saving…`:`Save`})]}),H>0?u(`div`,{className:`flex flex-col gap-1`,children:O.regions.map(e=>{let r=I===e.id,i=e.shape.kind===`polygon`?ne:t;return o(`div`,{className:`flex items-center gap-2 rounded-md border px-2 py-1 transition-colors ${r?`border-primary/50 bg-primary/10`:`border-border bg-surface`}`,children:[o(`button`,{type:`button`,onClick:()=>ie(e.id),disabled:M,className:`flex flex-1 items-center gap-2 text-left text-[11px] font-medium text-foreground-subtle hover:text-foreground disabled:opacity-40 transition-colors`,children:[u(i,{className:`h-3.5 w-3.5 shrink-0`}),o(`span`,{children:[`Zone `,e.id]}),u(`span`,{className:`text-foreground-faint capitalize`,children:e.shape.kind})]}),u(`button`,{type:`button`,onClick:()=>ae(e.id),disabled:M,"aria-label":`Delete zone ${String(e.id)}`,title:`Delete zone`,className:`inline-flex h-6 w-6 items-center justify-center rounded border border-border bg-surface text-foreground-subtle hover:border-red-400/40 hover:bg-red-500/10 hover:text-red-400 disabled:opacity-40 transition-colors`,children:u(n,{className:`h-3.5 w-3.5`})})]},e.id)})}):null]}):u(`p`,{className:`${f} leading-relaxed`,children:`Loading the camera's privacy mask…`})})}):null}export{w as PrivacyMaskSettings};
@@ -1 +1 @@
1
- import{Q as e,S as t,q as n,x as r}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{t as i}from"./radio-nxBAF-O0.js";import{t as a}from"./server-D6u4qxlr.js";import{t as o}from"./wifi-Bk03mxTw.js";import{W as s}from"./index-PRd5ZDug.js";var c=s(`cctv`,[[`path`,{d:`M16.75 12h3.632a1 1 0 0 1 .894 1.447l-2.034 4.069a1 1 0 0 1-1.708.134l-2.124-2.97`,key:`ir91b5`}],[`path`,{d:`M17.106 9.053a1 1 0 0 1 .447 1.341l-3.106 6.211a1 1 0 0 1-1.342.447L3.61 12.3a2.92 2.92 0 0 1-1.3-3.91L3.69 5.6a2.92 2.92 0 0 1 3.92-1.3z`,key:`jlp8i1`}],[`path`,{d:`M2 19h3.76a2 2 0 0 0 1.8-1.1L9 15`,key:`19bib8`}],[`path`,{d:`M2 21v-4`,key:`l40lih`}],[`path`,{d:`M7 9h.01`,key:`19b3jx`}]]),l=s(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]);e();var u={frigate:{icon:c,color:`#3b82f6`,label:`Frigate`},scrypted:{icon:a,color:`#a855f7`,label:`Scrypted`},reolink:{icon:i,color:`#06b6d4`,label:`Reolink`},homeassistant:{icon:l,color:`#22d3ee`,label:`Home Assistant`},rtsp:{icon:o,color:`#78716c`,label:`RTSP`},onvif:{icon:o,color:`#78716c`,label:`ONVIF`}},d={sm:`h-4 w-4`,md:`h-5 w-5`,lg:`h-6 w-6`},f={sm:`h-7 w-7`,md:`h-8 w-8`,lg:`h-10 w-10`};function p(e){let t=e.toLowerCase();return t.startsWith(`provider-`)?t.slice(9):t}function m(e){return u[p(e)]??{icon:c,color:`#78716c`,label:e}}function h(e){let t=p(e);return`/api/addon-assets/${e.toLowerCase().startsWith(`provider-`)?e:`provider-${t}`}/assets/icon.svg`}function g({type:e,size:i=`md`,showLabel:a}){let o=m(e),s=o.icon,[c,l]=n(!1),u=h(e);return t(`div`,{className:`flex items-center gap-2`,children:[r(`div`,{className:`flex items-center justify-center rounded-lg ${f[i]}`,style:{backgroundColor:`${o.color}15`},children:c?r(s,{className:d[i],style:{color:o.color}}):r(`img`,{src:u,alt:o.label,className:d[i],onError:()=>l(!0)})}),a&&r(`span`,{className:`text-xs font-medium text-foreground-subtle`,children:o.label})]})}export{g as t};
1
+ import{Q as e,S as t,q as n,x as r}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{t as i}from"./radio-BW_yEv9p.js";import{t as a}from"./server-DRSIdxSw.js";import{t as o}from"./wifi-_GGDG2Kl.js";import{W as s}from"./index-CS131rnv.js";var c=s(`cctv`,[[`path`,{d:`M16.75 12h3.632a1 1 0 0 1 .894 1.447l-2.034 4.069a1 1 0 0 1-1.708.134l-2.124-2.97`,key:`ir91b5`}],[`path`,{d:`M17.106 9.053a1 1 0 0 1 .447 1.341l-3.106 6.211a1 1 0 0 1-1.342.447L3.61 12.3a2.92 2.92 0 0 1-1.3-3.91L3.69 5.6a2.92 2.92 0 0 1 3.92-1.3z`,key:`jlp8i1`}],[`path`,{d:`M2 19h3.76a2 2 0 0 0 1.8-1.1L9 15`,key:`19bib8`}],[`path`,{d:`M2 21v-4`,key:`l40lih`}],[`path`,{d:`M7 9h.01`,key:`19b3jx`}]]),l=s(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]);e();var u={frigate:{icon:c,color:`#3b82f6`,label:`Frigate`},scrypted:{icon:a,color:`#a855f7`,label:`Scrypted`},reolink:{icon:i,color:`#06b6d4`,label:`Reolink`},homeassistant:{icon:l,color:`#22d3ee`,label:`Home Assistant`},rtsp:{icon:o,color:`#78716c`,label:`RTSP`},onvif:{icon:o,color:`#78716c`,label:`ONVIF`}},d={sm:`h-4 w-4`,md:`h-5 w-5`,lg:`h-6 w-6`},f={sm:`h-7 w-7`,md:`h-8 w-8`,lg:`h-10 w-10`};function p(e){let t=e.toLowerCase();return t.startsWith(`provider-`)?t.slice(9):t}function m(e){return u[p(e)]??{icon:c,color:`#78716c`,label:e}}function h(e){let t=p(e);return`/api/addon-assets/${e.toLowerCase().startsWith(`provider-`)?e:`provider-${t}`}/assets/icon.svg`}function g({type:e,size:i=`md`,showLabel:a}){let o=m(e),s=o.icon,[c,l]=n(!1),u=h(e);return t(`div`,{className:`flex items-center gap-2`,children:[r(`div`,{className:`flex items-center justify-center rounded-lg ${f[i]}`,style:{backgroundColor:`${o.color}15`},children:c?r(s,{className:d[i],style:{color:o.color}}):r(`img`,{src:u,alt:o.label,className:d[i],onError:()=>l(!0)})}),a&&r(`span`,{className:`text-xs font-medium text-foreground-subtle`,children:o.label})]})}export{g as t};
@@ -1 +1 @@
1
- import{$i as e,Kr as t,La as n,Qi as r,Ua as i,Ur as a,Xr as o,Yr as s,Za as c,Zi as l,ea as u,jn as d,na as f,ra as p,ta as m,za as h}from"./src-DKAxBIDH.js";import{I as g,Q as _,S as v,W as y,o as b,q as x,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-DTufy7Ue.js";import{K as w}from"./src-CCZM6rtM.js";import{o as T,p as E}from"./player-overlays-BfnV1C0Q.js";import{t as D}from"./download-DshuRjOL.js";import{i as O}from"./AddLocationWizard-DS7BizJv.js";import{A as k,E as A,S as j,U as M,W as N,s as P}from"./index-PRd5ZDug.js";import{t as F}from"./AdminPage-BwmGKnRf.js";import{n as I}from"./authed-media-XfBD4Ma-.js";import{t as L}from"./format-size-CO9d3C3-.js";import{t as ee}from"./ClusterRecordingTab-BSJTZsGS.js";import{t as R}from"./AdminTabs-ZprmiCN3.js";var z=N(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),B=N(`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`}]]);_();function V(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 H(e){return new Date(e).toLocaleString(void 0,{day:`2-digit`,month:`short`,hour:`2-digit`,minute:`2-digit`})}function U(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`${H(e)} · ${o}`}function W(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 G(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})}var K=[[`recordingExport`]],q={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 J(){let{data:e,isLoading:t}=u({},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data??[]).some(e=>e.state===`queued`||e.state===`rendering`)?3e3:!1}),{map:n}=i(w.RecordingExportProgress,e=>e.exportId),{map:r}=i(w.RecordingExportCompleted,e=>e.exportId),{map:a}=i(w.RecordingExportFailed,e=>e.exportId);return{rows:y(()=>G(e??[],n,r,a),[e,n,r,a]),isLoading:t}}function Y(e){let[t,n]=x(()=>Date.now());return C(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function X(){let t=b(),i=n(),a=E().trpcClient,o=Y(6e4),{rows:s,isLoading:l}=J(),{data:u}=d({}),f=y(()=>{let e=new Map;for(let t of u??[])e.set(t.id,t.name);return e},[u]),p=g(()=>{t.invalidateQueries({queryKey:K})},[t]),m=r({onSuccess:p}),_=e({onSuccess:p}),[C,w]=x(null),T=g(async e=>{w(e.id);try{let{url:t}=await a.recordingExport.getDownloadUrl.query({exportId:e.id}),n=await I(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),p()}finally{w(null)}},[a,p]),O=g(async e=>{await i({title:`Cancel this export?`,message:`Stops the render. The partial file is discarded.`,confirmLabel:`Cancel export`,variant:`danger`})&&m.mutate({exportId:e.id})},[i,m]),k=g(async e=>{await i({title:`Delete this export?`,message:`Permanently removes the rendered file and its history row.`,confirmLabel:`Delete`,variant:`danger`})&&_.mutate({exportId:e.id})},[i,_]),M=y(()=>[{key:`camera`,header:`Camera`,render:e=>S(`span`,{className:`text-foreground`,children:f.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`range`,header:`Range`,nowrap:!0,render:e=>S(`span`,{className:`tabular-nums`,children:U(e.fromMs,e.toMs)})},{key:`variant`,header:`Variant`,render:e=>S(`span`,{className:`text-foreground-subtle`,children:V(e.options)})},{key:`state`,header:`State`,render:e=>{let t=q[e.state];return v(`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(j,{className:`h-2.5 w-2.5 animate-spin`}),t.label,e.state===`rendering`&&e.progressPct!==null&&v(`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:W(e.expiresAt,o)})},{key:`size`,header:`Size`,align:`right`,nowrap:!0,render:e=>S(`span`,{className:`tabular-nums`,children:e.fileBytes===null?`—`:L(e.fileBytes)})},{key:`actions`,header:``,align:`right`,render:e=>{let t=e.state===`ready`,n=e.state===`queued`||e.state===`rendering`,r=e.state!==`deleted`;return v(`div`,{className:`flex items-center justify-end gap-1`,children:[t&&v(`button`,{onClick:()=>{T(e)},disabled:C===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:[C===e.id?S(j,{className:`h-3 w-3 animate-spin`}):S(D,{className:`h-3 w-3`}),`Download`]}),n&&v(`button`,{onClick:()=>{O(e)},disabled:m.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(z,{className:`h-3 w-3`}),`Cancel`]}),r&&S(`button`,{onClick:()=>{k(e)},disabled:_.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(P,{className:`h-3 w-3`})})]})}}],[f,o,C,m.isPending,_.isPending,T,O,k]);return l&&s.length===0?v(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[S(j,{className:`h-4 w-4 animate-spin`}),`Loading exports…`]}):s.length===0?S(h,{icon:A,title:`No exports yet`,description:`Export a footage range from a camera's timeline in the viewer. Rendered clips show up here to download or manage.`}):S(c,{columns:M,rows:s,rowKey:e=>e.id,minWidthPx:720})}_();var Z=[[`recording`]],Q=[{value:`retention`,label:`Retention policy`},{value:`quota`,label:`Quota / disk pressure`},{value:`operator`,label:`Operator`}];function te(e){return e.totalBytes===null||e.totalBytes<=0?null:Math.min(1,Math.max(0,e.usedBytes/e.totalBytes))}function ne(){let e=b(),t=n(),[r,i]=x(`retention`),{data:a,isLoading:o}=m({},{refetchOnWindowFocus:!1}),{data:s}=d({}),u=y(()=>{let e=new Map;for(let t of s??[])e.set(t.id,t.name);return e},[s]),f=g(()=>{e.invalidateQueries({queryKey:Z})},[e]),_=p({onSuccess:f}),C=l({onSuccess:f}),w=g(async e=>{await t({title:`Prune ${u.get(e.deviceId)??`#${String(e.deviceId)}`}?`,message:`Applies the retention policy now (reason: ${r}). Footage beyond the policy is permanently deleted.`,confirmLabel:`Prune now`,variant:`danger`})&&_.mutate({deviceId:e.deviceId,reason:r})},[t,_,r,u]),E=g(async e=>{await t({title:`Delete all footage for ${u.get(e.deviceId)??`#${String(e.deviceId)}`}?`,message:`Permanently deletes ${L(e.usedBytes)} of recorded footage for this camera. This cannot be undone.`,confirmLabel:`Delete ${L(e.usedBytes)}`,variant:`danger`})&&C.mutate({deviceId:e.deviceId})},[t,C,u]),D=y(()=>[{key:`camera`,header:`Camera`,render:e=>S(`span`,{className:`text-foreground`,children:u.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`used`,header:`Used`,align:`right`,nowrap:!0,render:e=>S(`span`,{className:`tabular-nums`,children:L(e.usedBytes)})},{key:`actions`,header:``,align:`right`,render:e=>v(`div`,{className:`flex items-center justify-end gap-1`,children:[v(`button`,{onClick:()=>{w(e)},disabled:_.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(B,{className:`h-3 w-3`}),`Prune`]}),v(`button`,{onClick:()=>{E(e)},disabled:C.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(P,{className:`h-3 w-3`}),`Delete`]})]})}],[u,w,E,_.isPending,C.isPending]);if(o&&!a)return v(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[S(j,{className:`h-4 w-4 animate-spin`}),`Loading storage usage…`]});if(!a)return S(h,{icon:O,title:`No storage data`,description:`The recording node has not reported any storage usage yet.`});let k=a.devices.length;return v(`div`,{className:`flex flex-col gap-6`,children:[v(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[S(T,{label:`Total used`,icon:S(O,{className:`h-3 w-3`}),footer:`${String(k)} camera${k===1?``:`s`} on ${a.nodeId}`,children:L(a.totalUsedBytes)}),a.locations.map(e=>{let t=te(e),n=e.locationId??`default`;return S(T,{label:`Disk ${n}`,footer:e.availableBytes===null?`${L(e.usedBytes)} used (capacity unknown)`:`${L(e.availableBytes)} free${e.totalBytes===null?``:` of ${L(e.totalBytes)}`}`,children:t===null?S(`span`,{className:`tabular-nums`,children:L(e.usedBytes)}):v(`div`,{className:`flex items-center gap-2`,children:[S(`div`,{className:`h-2 flex-1 overflow-hidden rounded bg-muted`,children:S(`div`,{className:`h-full rounded ${t>.9?`bg-danger`:t>.75?`bg-amber-500`:`bg-primary`}`,style:{width:`${String(Math.round(t*100))}%`}})}),v(`span`,{className:`tabular-nums text-xs`,children:[Math.round(t*100),`%`]})]})},n)})]}),v(`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:r,onChange:e=>{let t=Q.find(t=>t.value===e.target.value);t&&i(t.value)},className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:Q.map(e=>S(`option`,{value:e.value,children:e.label},e.value))})]}),k===0?S(h,{icon:O,title:`No recorded footage`,description:`No camera has recorded footage on this node yet.`}):S(c,{columns:D,rows:[...a.devices],rowKey:e=>e.deviceId,minWidthPx:480})]})}_();var re=[[`pipelineAnalytics`]],ie=1440*60*1e3,ae=[{days:1,label:`1 day`},{days:7,label:`7 days`},{days:30,label:`30 days`},{days:90,label:`90 days`}];function oe(){let e=b(),r=n(),[i,s]=x(30),{data:l,isLoading:u}=t({},{refetchOnWindowFocus:!1}),{data:f}=d({}),p=y(()=>{let e=new Map;for(let t of f??[])e.set(t.id,t.name);return e},[f]),m=g(()=>{e.invalidateQueries({queryKey:re})},[e]),_=o({onSuccess:m}),C=a({onSuccess:m}),w=g(async()=>{await r({title:`Prune events older than ${String(i)} day${i===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`})&&_.mutate({olderThanMs:Date.now()-i*ie,reason:`retention`})},[r,_,i]),E=g(async e=>{await r({title:`Delete all events for ${p.get(e.deviceId)??`#${String(e.deviceId)}`}?`,message:`Permanently deletes ${String(e.rows)} event${e.rows===1?``:`s`} (${L(e.bytes)} of media) for this camera. This cannot be undone.`,confirmLabel:`Delete events`,variant:`danger`})&&C.mutate({deviceId:e.deviceId})},[r,C,p]),D=y(()=>[{key:`camera`,header:`Camera`,render:e=>S(`span`,{className:`text-foreground`,children:p.get(e.deviceId)??`#${String(e.deviceId)}`})},{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:L(e.bytes)})},{key:`actions`,header:``,align:`right`,render:e=>v(`button`,{onClick:()=>{E(e)},disabled:C.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(P,{className:`h-3 w-3`}),`Delete`]})}],[p,E,C.isPending]);return u&&!l?v(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[S(j,{className:`h-4 w-4 animate-spin`}),`Loading event-store footprint…`]}):l?v(`div`,{className:`flex flex-col gap-6`,children:[v(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[S(T,{label:`Total events`,icon:S(k,{className:`h-3 w-3`}),footer:`across ${String(l.devices.length)} camera${l.devices.length===1?``:`s`}`,children:l.totalRows.toLocaleString()}),S(T,{label:`Event media on disk`,children:L(l.totalBytes)})]}),v(`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:i,onChange:e=>s(Number(e.target.value)),className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:ae.map(e=>S(`option`,{value:e.days,children:e.label},e.days))}),v(`button`,{onClick:()=>{w()},disabled:_.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:[_.isPending?S(j,{className:`h-3 w-3 animate-spin`}):S(B,{className:`h-3 w-3`}),`Prune now`]})]}),l.devices.length===0?S(h,{icon:k,title:`No stored events`,description:`No camera has persisted events yet.`}):S(c,{columns:D,rows:[...l.devices],rowKey:e=>e.deviceId,minWidthPx:480})]}):S(h,{icon:k,title:`No event data`,description:`Pipeline analytics has not reported any event-store footprint yet.`})}_();var $=[{value:`all`,label:`All`},{value:`recording`,label:`Recordings`},{value:`events`,label:`Events`}],se={recording:`bg-primary/10 text-primary`,events:`bg-violet-500/10 text-violet-400`};function ce(e){return new Date(e).toLocaleString()}function le(){let[e,t]=x(`all`),{data:n,isLoading:r}=f({},{refetchOnWindowFocus:!1}),{data:i,isLoading:a}=s({},{refetchOnWindowFocus:!1}),{data:o}=d({}),l=y(()=>{let e=new Map;for(let t of o??[])e.set(t.id,t.name);return e},[o]),u=y(()=>{let t=[...n??[],...i??[]];return(e===`all`?t:t.filter(t=>t.domain===e)).toSorted((e,t)=>t.at-e.at)},[n,i,e]),p=y(()=>[{key:`at`,header:`When`,nowrap:!0,render:e=>S(`span`,{className:`text-foreground-subtle tabular-nums`,children:ce(e.at)})},{key:`domain`,header:`Domain`,render:e=>S(`span`,{className:`inline-flex rounded px-1.5 py-0.5 text-[10px] font-medium ${se[e.domain]}`,children:e.domain})},{key:`op`,header:`Operation`,render:e=>S(`span`,{className:`text-foreground`,children:e.op})},{key:`reason`,header:`Reason`,render:e=>S(`span`,{className:`text-foreground-subtle`,children:e.reason})},{key:`device`,header:`Camera`,render:e=>e.deviceId===null?S(`span`,{className:`text-foreground-subtle`,children:`cluster`}):S(`span`,{className:`text-foreground`,children:l.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`items`,header:`Items`,align:`right`,nowrap:!0,render:e=>S(`span`,{className:`tabular-nums`,children:e.itemsAffected.toLocaleString()})},{key:`bytes`,header:`Reclaimed`,align:`right`,nowrap:!0,render:e=>S(`span`,{className:`tabular-nums`,children:e.bytesReclaimed>0?L(e.bytesReclaimed):`—`})}],[l]),m=r||a;return v(`div`,{className:`flex flex-col gap-4`,children:[S(`div`,{className:`flex items-center gap-1`,children:$.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))}),m&&u.length===0?v(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[S(j,{className:`h-4 w-4 animate-spin`}),`Loading activity…`]}):u.length===0?S(h,{icon:M,title:`No activity yet`,description:`Prune, delete and rescan operations across recordings and events show up here.`}):S(c,{columns:p,rows:u,rowKey:e=>e.id,minWidthPx:720})]})}function ue(){return S(F,{icon:A,title:`Recordings`,subtitle:`Recording node & storage, event-store management, exported clips, and an activity log.`,children:S(R,{tabs:[{id:`recordings`,label:`Recordings`,icon:O,content:S(ee,{})},{id:`storage`,label:`Storage`,icon:O,content:S(ne,{})},{id:`events`,label:`Events`,icon:k,content:S(oe,{})},{id:`exports`,label:`Exports`,icon:A,content:S(X,{})},{id:`activity`,label:`Activity`,icon:M,content:S(le,{})}]})})}export{ue as RecordingsPage};
1
+ import{$i as e,Kr as t,La as n,Qi as r,Ua as i,Ur as a,Xr as o,Yr as s,Za as c,Zi as l,ea as u,jn as d,na as f,ra as p,ta as m,za as h}from"./src-CjlMsFRd.js";import{I as g,Q as _,S as v,W as y,o as b,q as x,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-DTufy7Ue.js";import{K as w}from"./src-BS1NDJr1.js";import{o as T,p as E}from"./player-overlays-CWRGbPFt.js";import{t as D}from"./download-CeG-HJtH.js";import{i as O}from"./AddLocationWizard-r5xWfOLZ.js";import{A as k,E as A,S as j,U as M,W as N,s as P}from"./index-CS131rnv.js";import{t as F}from"./AdminPage-BwmGKnRf.js";import{n as I}from"./authed-media-XfBD4Ma-.js";import{t as L}from"./format-size-CO9d3C3-.js";import{t as ee}from"./ClusterRecordingTab-CFs8rzNM.js";import{t as R}from"./AdminTabs-7mkfimpe.js";var z=N(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),B=N(`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`}]]);_();function V(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 H(e){return new Date(e).toLocaleString(void 0,{day:`2-digit`,month:`short`,hour:`2-digit`,minute:`2-digit`})}function U(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`${H(e)} · ${o}`}function W(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 G(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})}var K=[[`recordingExport`]],q={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 J(){let{data:e,isLoading:t}=u({},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data??[]).some(e=>e.state===`queued`||e.state===`rendering`)?3e3:!1}),{map:n}=i(w.RecordingExportProgress,e=>e.exportId),{map:r}=i(w.RecordingExportCompleted,e=>e.exportId),{map:a}=i(w.RecordingExportFailed,e=>e.exportId);return{rows:y(()=>G(e??[],n,r,a),[e,n,r,a]),isLoading:t}}function Y(e){let[t,n]=x(()=>Date.now());return C(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function X(){let t=b(),i=n(),a=E().trpcClient,o=Y(6e4),{rows:s,isLoading:l}=J(),{data:u}=d({}),f=y(()=>{let e=new Map;for(let t of u??[])e.set(t.id,t.name);return e},[u]),p=g(()=>{t.invalidateQueries({queryKey:K})},[t]),m=r({onSuccess:p}),_=e({onSuccess:p}),[C,w]=x(null),T=g(async e=>{w(e.id);try{let{url:t}=await a.recordingExport.getDownloadUrl.query({exportId:e.id}),n=await I(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),p()}finally{w(null)}},[a,p]),O=g(async e=>{await i({title:`Cancel this export?`,message:`Stops the render. The partial file is discarded.`,confirmLabel:`Cancel export`,variant:`danger`})&&m.mutate({exportId:e.id})},[i,m]),k=g(async e=>{await i({title:`Delete this export?`,message:`Permanently removes the rendered file and its history row.`,confirmLabel:`Delete`,variant:`danger`})&&_.mutate({exportId:e.id})},[i,_]),M=y(()=>[{key:`camera`,header:`Camera`,render:e=>S(`span`,{className:`text-foreground`,children:f.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`range`,header:`Range`,nowrap:!0,render:e=>S(`span`,{className:`tabular-nums`,children:U(e.fromMs,e.toMs)})},{key:`variant`,header:`Variant`,render:e=>S(`span`,{className:`text-foreground-subtle`,children:V(e.options)})},{key:`state`,header:`State`,render:e=>{let t=q[e.state];return v(`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(j,{className:`h-2.5 w-2.5 animate-spin`}),t.label,e.state===`rendering`&&e.progressPct!==null&&v(`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:W(e.expiresAt,o)})},{key:`size`,header:`Size`,align:`right`,nowrap:!0,render:e=>S(`span`,{className:`tabular-nums`,children:e.fileBytes===null?`—`:L(e.fileBytes)})},{key:`actions`,header:``,align:`right`,render:e=>{let t=e.state===`ready`,n=e.state===`queued`||e.state===`rendering`,r=e.state!==`deleted`;return v(`div`,{className:`flex items-center justify-end gap-1`,children:[t&&v(`button`,{onClick:()=>{T(e)},disabled:C===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:[C===e.id?S(j,{className:`h-3 w-3 animate-spin`}):S(D,{className:`h-3 w-3`}),`Download`]}),n&&v(`button`,{onClick:()=>{O(e)},disabled:m.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(z,{className:`h-3 w-3`}),`Cancel`]}),r&&S(`button`,{onClick:()=>{k(e)},disabled:_.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(P,{className:`h-3 w-3`})})]})}}],[f,o,C,m.isPending,_.isPending,T,O,k]);return l&&s.length===0?v(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[S(j,{className:`h-4 w-4 animate-spin`}),`Loading exports…`]}):s.length===0?S(h,{icon:A,title:`No exports yet`,description:`Export a footage range from a camera's timeline in the viewer. Rendered clips show up here to download or manage.`}):S(c,{columns:M,rows:s,rowKey:e=>e.id,minWidthPx:720})}_();var Z=[[`recording`]],Q=[{value:`retention`,label:`Retention policy`},{value:`quota`,label:`Quota / disk pressure`},{value:`operator`,label:`Operator`}];function te(e){return e.totalBytes===null||e.totalBytes<=0?null:Math.min(1,Math.max(0,e.usedBytes/e.totalBytes))}function ne(){let e=b(),t=n(),[r,i]=x(`retention`),{data:a,isLoading:o}=m({},{refetchOnWindowFocus:!1}),{data:s}=d({}),u=y(()=>{let e=new Map;for(let t of s??[])e.set(t.id,t.name);return e},[s]),f=g(()=>{e.invalidateQueries({queryKey:Z})},[e]),_=p({onSuccess:f}),C=l({onSuccess:f}),w=g(async e=>{await t({title:`Prune ${u.get(e.deviceId)??`#${String(e.deviceId)}`}?`,message:`Applies the retention policy now (reason: ${r}). Footage beyond the policy is permanently deleted.`,confirmLabel:`Prune now`,variant:`danger`})&&_.mutate({deviceId:e.deviceId,reason:r})},[t,_,r,u]),E=g(async e=>{await t({title:`Delete all footage for ${u.get(e.deviceId)??`#${String(e.deviceId)}`}?`,message:`Permanently deletes ${L(e.usedBytes)} of recorded footage for this camera. This cannot be undone.`,confirmLabel:`Delete ${L(e.usedBytes)}`,variant:`danger`})&&C.mutate({deviceId:e.deviceId})},[t,C,u]),D=y(()=>[{key:`camera`,header:`Camera`,render:e=>S(`span`,{className:`text-foreground`,children:u.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`used`,header:`Used`,align:`right`,nowrap:!0,render:e=>S(`span`,{className:`tabular-nums`,children:L(e.usedBytes)})},{key:`actions`,header:``,align:`right`,render:e=>v(`div`,{className:`flex items-center justify-end gap-1`,children:[v(`button`,{onClick:()=>{w(e)},disabled:_.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(B,{className:`h-3 w-3`}),`Prune`]}),v(`button`,{onClick:()=>{E(e)},disabled:C.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(P,{className:`h-3 w-3`}),`Delete`]})]})}],[u,w,E,_.isPending,C.isPending]);if(o&&!a)return v(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[S(j,{className:`h-4 w-4 animate-spin`}),`Loading storage usage…`]});if(!a)return S(h,{icon:O,title:`No storage data`,description:`The recording node has not reported any storage usage yet.`});let k=a.devices.length;return v(`div`,{className:`flex flex-col gap-6`,children:[v(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[S(T,{label:`Total used`,icon:S(O,{className:`h-3 w-3`}),footer:`${String(k)} camera${k===1?``:`s`} on ${a.nodeId}`,children:L(a.totalUsedBytes)}),a.locations.map(e=>{let t=te(e),n=e.locationId??`default`;return S(T,{label:`Disk ${n}`,footer:e.availableBytes===null?`${L(e.usedBytes)} used (capacity unknown)`:`${L(e.availableBytes)} free${e.totalBytes===null?``:` of ${L(e.totalBytes)}`}`,children:t===null?S(`span`,{className:`tabular-nums`,children:L(e.usedBytes)}):v(`div`,{className:`flex items-center gap-2`,children:[S(`div`,{className:`h-2 flex-1 overflow-hidden rounded bg-muted`,children:S(`div`,{className:`h-full rounded ${t>.9?`bg-danger`:t>.75?`bg-amber-500`:`bg-primary`}`,style:{width:`${String(Math.round(t*100))}%`}})}),v(`span`,{className:`tabular-nums text-xs`,children:[Math.round(t*100),`%`]})]})},n)})]}),v(`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:r,onChange:e=>{let t=Q.find(t=>t.value===e.target.value);t&&i(t.value)},className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:Q.map(e=>S(`option`,{value:e.value,children:e.label},e.value))})]}),k===0?S(h,{icon:O,title:`No recorded footage`,description:`No camera has recorded footage on this node yet.`}):S(c,{columns:D,rows:[...a.devices],rowKey:e=>e.deviceId,minWidthPx:480})]})}_();var re=[[`pipelineAnalytics`]],ie=1440*60*1e3,ae=[{days:1,label:`1 day`},{days:7,label:`7 days`},{days:30,label:`30 days`},{days:90,label:`90 days`}];function oe(){let e=b(),r=n(),[i,s]=x(30),{data:l,isLoading:u}=t({},{refetchOnWindowFocus:!1}),{data:f}=d({}),p=y(()=>{let e=new Map;for(let t of f??[])e.set(t.id,t.name);return e},[f]),m=g(()=>{e.invalidateQueries({queryKey:re})},[e]),_=o({onSuccess:m}),C=a({onSuccess:m}),w=g(async()=>{await r({title:`Prune events older than ${String(i)} day${i===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`})&&_.mutate({olderThanMs:Date.now()-i*ie,reason:`retention`})},[r,_,i]),E=g(async e=>{await r({title:`Delete all events for ${p.get(e.deviceId)??`#${String(e.deviceId)}`}?`,message:`Permanently deletes ${String(e.rows)} event${e.rows===1?``:`s`} (${L(e.bytes)} of media) for this camera. This cannot be undone.`,confirmLabel:`Delete events`,variant:`danger`})&&C.mutate({deviceId:e.deviceId})},[r,C,p]),D=y(()=>[{key:`camera`,header:`Camera`,render:e=>S(`span`,{className:`text-foreground`,children:p.get(e.deviceId)??`#${String(e.deviceId)}`})},{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:L(e.bytes)})},{key:`actions`,header:``,align:`right`,render:e=>v(`button`,{onClick:()=>{E(e)},disabled:C.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(P,{className:`h-3 w-3`}),`Delete`]})}],[p,E,C.isPending]);return u&&!l?v(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[S(j,{className:`h-4 w-4 animate-spin`}),`Loading event-store footprint…`]}):l?v(`div`,{className:`flex flex-col gap-6`,children:[v(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[S(T,{label:`Total events`,icon:S(k,{className:`h-3 w-3`}),footer:`across ${String(l.devices.length)} camera${l.devices.length===1?``:`s`}`,children:l.totalRows.toLocaleString()}),S(T,{label:`Event media on disk`,children:L(l.totalBytes)})]}),v(`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:i,onChange:e=>s(Number(e.target.value)),className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:ae.map(e=>S(`option`,{value:e.days,children:e.label},e.days))}),v(`button`,{onClick:()=>{w()},disabled:_.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:[_.isPending?S(j,{className:`h-3 w-3 animate-spin`}):S(B,{className:`h-3 w-3`}),`Prune now`]})]}),l.devices.length===0?S(h,{icon:k,title:`No stored events`,description:`No camera has persisted events yet.`}):S(c,{columns:D,rows:[...l.devices],rowKey:e=>e.deviceId,minWidthPx:480})]}):S(h,{icon:k,title:`No event data`,description:`Pipeline analytics has not reported any event-store footprint yet.`})}_();var $=[{value:`all`,label:`All`},{value:`recording`,label:`Recordings`},{value:`events`,label:`Events`}],se={recording:`bg-primary/10 text-primary`,events:`bg-violet-500/10 text-violet-400`};function ce(e){return new Date(e).toLocaleString()}function le(){let[e,t]=x(`all`),{data:n,isLoading:r}=f({},{refetchOnWindowFocus:!1}),{data:i,isLoading:a}=s({},{refetchOnWindowFocus:!1}),{data:o}=d({}),l=y(()=>{let e=new Map;for(let t of o??[])e.set(t.id,t.name);return e},[o]),u=y(()=>{let t=[...n??[],...i??[]];return(e===`all`?t:t.filter(t=>t.domain===e)).toSorted((e,t)=>t.at-e.at)},[n,i,e]),p=y(()=>[{key:`at`,header:`When`,nowrap:!0,render:e=>S(`span`,{className:`text-foreground-subtle tabular-nums`,children:ce(e.at)})},{key:`domain`,header:`Domain`,render:e=>S(`span`,{className:`inline-flex rounded px-1.5 py-0.5 text-[10px] font-medium ${se[e.domain]}`,children:e.domain})},{key:`op`,header:`Operation`,render:e=>S(`span`,{className:`text-foreground`,children:e.op})},{key:`reason`,header:`Reason`,render:e=>S(`span`,{className:`text-foreground-subtle`,children:e.reason})},{key:`device`,header:`Camera`,render:e=>e.deviceId===null?S(`span`,{className:`text-foreground-subtle`,children:`cluster`}):S(`span`,{className:`text-foreground`,children:l.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`items`,header:`Items`,align:`right`,nowrap:!0,render:e=>S(`span`,{className:`tabular-nums`,children:e.itemsAffected.toLocaleString()})},{key:`bytes`,header:`Reclaimed`,align:`right`,nowrap:!0,render:e=>S(`span`,{className:`tabular-nums`,children:e.bytesReclaimed>0?L(e.bytesReclaimed):`—`})}],[l]),m=r||a;return v(`div`,{className:`flex flex-col gap-4`,children:[S(`div`,{className:`flex items-center gap-1`,children:$.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))}),m&&u.length===0?v(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[S(j,{className:`h-4 w-4 animate-spin`}),`Loading activity…`]}):u.length===0?S(h,{icon:M,title:`No activity yet`,description:`Prune, delete and rescan operations across recordings and events show up here.`}):S(c,{columns:p,rows:u,rowKey:e=>e.id,minWidthPx:720})]})}function ue(){return S(F,{icon:A,title:`Recordings`,subtitle:`Recording node & storage, event-store management, exported clips, and an activity log.`,children:S(R,{tabs:[{id:`recordings`,label:`Recordings`,icon:O,content:S(ee,{})},{id:`storage`,label:`Storage`,icon:O,content:S(ne,{})},{id:`events`,label:`Events`,icon:k,content:S(oe,{})},{id:`exports`,label:`Exports`,icon:A,content:S(X,{})},{id:`activity`,label:`Activity`,icon:M,content:S(le,{})}]})})}export{ue as RecordingsPage};
@@ -1 +1 @@
1
- import{Fn as e,Xt as t,bn as n,en as r,jn as i,tn as a,un as o,vn as s}from"./src-DKAxBIDH.js";import{I as c,K as l,Q as u,S as d,W as f,b as p,q as m,x as h,z as g}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{t as _}from"./download-DshuRjOL.js";import{t as v}from"./FormBuilder-2eKUDBn_.js";import{t as y}from"./refresh-cw-Bh7jR0Ir.js";import{F as b,L as x,S,W as C,i as w,k as T,o as E}from"./index-PRd5ZDug.js";import{t as D}from"./BrokerForm-DbfBwy1x.js";var O=C(`radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]);u();var k=[`amazon.com`,`amazon.it`,`amazon.de`,`amazon.co.uk`,`amazon.fr`,`amazon.es`,`amazon.ca`,`amazon.com.au`,`amazon.co.jp`,`amazon.in`,`amazon.com.br`,`amazon.com.mx`],A=`/addon/import-alexa`,j=2e3;function M(e){return typeof e==`object`&&!!e&&typeof e.sessionId==`string`&&typeof e.loginUrl==`string`}function N(e){return typeof e==`object`&&!!e&&typeof e.phase==`string`&&typeof e.sessionId==`string`}function P(e){return typeof e==`object`&&!!e&&typeof e.brokerId==`string`}function F(e){return{"Content-Type":`application/json`,Authorization:`Bearer ${localStorage.getItem(`camstack_admin_token`)??``}`,...e}}async function I(e,t,n){let r=await fetch(`${A}${e}`,{method:`POST`,headers:F(),body:JSON.stringify(t)}),i=await r.json();if(!r.ok){let e=typeof i==`object`&&i?i.error??`Unknown error`:`Unknown error`;throw Error(String(e))}if(!n(i))throw Error(`Unexpected response from server`);return i}async function L(e){let t=new URLSearchParams({sessionId:e}),n=localStorage.getItem(`camstack_admin_token`)??``,r=await fetch(`${A}/login/status?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}}),i=await r.json();if(!r.ok){let e=typeof i==`object`&&i?i.error??`Unknown error`:`Unknown error`;throw Error(String(e))}if(!N(i))throw Error(`Unexpected status response from server`);return i}async function R(e){try{await fetch(`${A}/login/cancel`,{method:`POST`,headers:F(),body:JSON.stringify({sessionId:e})})}catch{}}function z({brokerId:e,onResolved:t,onCancel:n}){let[r,i]=m(`amazon.it`),[a,o]=m(`Alexa account`),[s,u]=m({kind:`idle`}),f=l(!0);g(()=>(f.current=!0,()=>{f.current=!1}),[]);let p=l(null),_=l(null),v=c(()=>{_.current!==null&&(clearInterval(_.current),_.current=null)},[]),b=c(async n=>{v(),f.current&&u({kind:`committing`,sessionId:n});try{let r=await I(`/login/commit`,{sessionId:n,name:a.trim().length>0?a.trim():`Alexa account`,...e===void 0?{}:{brokerId:e}},P);p.current=null,t(r.brokerId)}catch(e){let t=e instanceof Error?e.message:String(e);f.current&&u({kind:`error`,message:t,sessionId:n})}},[e,a,t,v]),x=c((e,t)=>{v();let n=async()=>{try{let n=await L(e);if(n.phase===`captured`){v(),b(e);return}if(n.phase===`error`){v(),f.current&&u({kind:`error`,message:n.error??`Login proxy returned an error`,sessionId:e});return}if(n.phase===`cancelled`){v(),f.current&&u({kind:`idle`});return}f.current&&u({kind:`polling`,sessionId:e,loginUrl:n.loginUrl||t,phase:n.phase})}catch(e){let t=e instanceof Error?e.message:String(e);f.current&&u(e=>e.kind===`polling`?{...e}:{kind:`error`,message:t,sessionId:null})}};_.current=setInterval(()=>{n()},j)},[v,b]);g(()=>()=>{v(),p.current!==null&&R(p.current)},[v]);let C=async()=>{v(),p.current!==null&&(R(p.current),p.current=null),u({kind:`starting`});try{let e=await I(`/login/start`,{amazonDomain:r},M);p.current=e.sessionId,u({kind:`polling`,sessionId:e.sessionId,loginUrl:e.loginUrl,phase:`starting`}),x(e.sessionId,e.loginUrl)}catch(e){u({kind:`error`,message:e instanceof Error?e.message:String(e),sessionId:null})}},w=()=>{v(),p.current!==null&&(R(p.current),p.current=null),u({kind:`idle`})},D=()=>{w()},O=s.kind===`idle`,A=s.kind===`starting`,N=s.kind===`polling`,F=s.kind===`committing`,z=s.kind===`error`,B=A||N||F,V=s.kind===`polling`?s.phase:null,H=s.kind===`polling`?s.loginUrl:null,U=N&&V===`awaiting-login`,W=N&&(V===`starting`||V===null);return d(`div`,{className:`space-y-4`,children:[(O||z)&&d(`div`,{className:`space-y-3`,children:[e===void 0&&d(`div`,{className:`space-y-1`,children:[h(`label`,{htmlFor:`alexa-account-name`,className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Account name`}),h(`input`,{id:`alexa-account-name`,type:`text`,value:a,onChange:e=>o(e.target.value),placeholder:`Alexa account`,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),d(`div`,{className:`space-y-1`,children:[h(`label`,{htmlFor:`alexa-amazon-region`,className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Amazon region`}),h(`select`,{id:`alexa-amazon-region`,value:r,onChange:e=>i(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`,children:k.map(e=>h(`option`,{value:e,children:e},e))})]})]}),z&&d(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px] flex items-start gap-2`,children:[h(E,{className:`h-3.5 w-3.5 mt-0.5 flex-shrink-0`}),h(`span`,{children:s.message})]}),A&&d(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-3 text-xs text-foreground-subtle`,children:[h(S,{className:`h-4 w-4 animate-spin flex-shrink-0`}),`Starting login proxy…`]}),W&&d(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-3 text-xs text-foreground-subtle`,children:[h(S,{className:`h-4 w-4 animate-spin flex-shrink-0`}),`Waiting for proxy to be ready…`]}),F&&d(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-3 text-xs text-foreground-subtle`,children:[h(S,{className:`h-4 w-4 animate-spin flex-shrink-0`}),`Saving credentials…`]}),U&&H!==null&&d(`div`,{className:`space-y-3`,children:[d(`div`,{className:`rounded-lg border border-border bg-surface p-3 space-y-2`,children:[h(`p`,{className:`text-xs font-semibold text-foreground`,children:`Open the link below to log in to your Amazon account`}),h(`p`,{className:`text-[10px] text-foreground-subtle`,children:`After completing the login and any 2FA steps, this wizard will continue automatically.`}),d(`a`,{href:H,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 rounded bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90`,children:[h(T,{className:`h-3.5 w-3.5`}),`Login to Amazon`]})]}),d(`div`,{className:`rounded border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[10px] text-amber-700 dark:text-amber-300`,children:[h(`strong`,{children:`Note:`}),` The login proxy runs directly on the hub. If the link does not open or the page does not load, make sure the hub's proxy host and port are reachable from your browser. You can configure `,h(`code`,{className:`font-mono`,children:`proxyHost`}),` in the Alexa addon settings and ensure the proxy port is published (Docker port mapping).`]}),d(`div`,{className:`flex items-center gap-2 text-[10px] text-foreground-subtle`,children:[h(S,{className:`h-3 w-3 animate-spin`}),`Waiting for Amazon login to complete…`]})]}),d(`div`,{className:`flex items-center justify-between gap-2 pt-1`,children:[h(`button`,{type:`button`,onClick:B?w:n,className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:B?`Cancel login`:`Back`}),d(`div`,{className:`flex items-center gap-2`,children:[z&&d(`button`,{type:`button`,onClick:D,className:`inline-flex items-center gap-1.5 rounded border border-border px-3 py-1.5 text-xs text-foreground hover:bg-primary/10`,children:[h(y,{className:`h-3.5 w-3.5`}),`Retry`]}),O&&h(`button`,{type:`button`,onClick:()=>{C()},disabled:e===void 0&&a.trim().length===0,className:`inline-flex items-center gap-1.5 rounded bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:`Start login`})]})]})]})}u();var B=`alexa`;function V(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.id==`string`):[]}function H(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.addonId==`string`&&Array.isArray(e.kinds)):[]}var U={connected:`bg-emerald-500/15 text-emerald-700 dark:text-emerald-300`,connecting:`bg-amber-500/15 text-amber-700 dark:text-amber-300`,disconnected:`bg-foreground-subtle/15 text-foreground-subtle`,"auth-failed":`bg-danger/15 text-danger`,unreachable:`bg-danger/15 text-danger`,error:`bg-danger/15 text-danger`};function W({kind:e,onResolved:n,onBack:i}){let[o,s]=m(e===B?`alexa-login`:`existing`),c=r({kind:e}),l=f(()=>V(c.data).filter(t=>t.kind===e),[c.data,e]),u=a(),p=f(()=>{for(let t of H(u.data))if(t.kinds.some(t=>t.kind===e))return t.addonId},[u.data,e]),[g,_]=m(null),[v,y]=m(``),x=t({}),C=()=>{g&&n(g)},w=async t=>{v.trim().length!==0&&n((await x.mutateAsync({kind:e,name:v.trim(),settings:t,...p===void 0?{}:{addonId:p}})).id)},T=e=>{e===`new`?_(null):x.reset(),s(e)};return d(`div`,{className:`space-y-4`,children:[d(`button`,{type:`button`,onClick:i,className:`inline-flex items-center gap-1 text-[11px] text-foreground-subtle hover:text-foreground`,children:[h(b,{className:`h-3.5 w-3.5`}),` Back`]}),d(`div`,{className:`inline-flex rounded-lg border border-border p-0.5 flex-wrap gap-0.5`,children:[e===B&&h(`button`,{type:`button`,onClick:()=>T(`alexa-login`),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${o===`alexa-login`?`bg-primary text-primary-foreground`:`text-foreground-subtle hover:text-foreground`}`,children:`Login interactively`}),h(`button`,{type:`button`,onClick:()=>T(`existing`),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${o===`existing`?`bg-primary text-primary-foreground`:`text-foreground-subtle hover:text-foreground`}`,children:`Use existing`}),h(`button`,{type:`button`,onClick:()=>T(`new`),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${o===`new`?`bg-primary text-primary-foreground`:`text-foreground-subtle hover:text-foreground`}`,children:e===B?`Paste cookie`:`Create new`})]}),o===`alexa-login`&&h(z,{onResolved:n,onCancel:i}),o===`existing`&&d(`div`,{className:`space-y-3`,children:[c.isLoading&&d(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[h(S,{className:`h-3.5 w-3.5 animate-spin`}),` Loading brokers…`]}),c.isError&&d(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px]`,children:[`Failed to load brokers:`,` `,c.error instanceof Error?c.error.message:`Unknown error`]}),!c.isLoading&&!c.isError&&l.length===0&&d(`div`,{className:`rounded-lg border border-border bg-surface px-3 py-6 text-center text-xs text-foreground-subtle`,children:[`No brokers of this kind yet. Switch to`,` `,h(`span`,{className:`font-medium text-foreground`,children:e===B?`Login interactively`:`Create new`}),` `,`to register one.`]}),h(`div`,{className:`space-y-2`,children:l.map(e=>d(`button`,{type:`button`,onClick:()=>_(e.id),className:`flex w-full items-center justify-between gap-3 rounded-lg border bg-surface p-3 text-left transition-colors ${g===e.id?`border-primary ring-1 ring-primary`:`border-border hover:border-foreground-subtle/30`}`,children:[h(`span`,{className:`text-xs font-semibold text-foreground`,children:e.name}),h(`span`,{className:`text-[10px] rounded-full px-2 py-0.5 font-medium ${U[e.status]}`,children:e.status})]},e.id))}),l.length>0&&h(`div`,{className:`flex justify-end pt-1`,children:h(`button`,{type:`button`,onClick:C,disabled:!g,className:`inline-flex items-center gap-1.5 rounded bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:`Use this broker`})})]}),o===`new`&&d(`div`,{className:`space-y-3`,children:[d(`div`,{className:`space-y-1`,children:[h(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Name`}),h(`input`,{type:`text`,value:v,onChange:e=>y(e.target.value),placeholder:`My Home Assistant`,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),x.isError&&h(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px]`,children:x.error instanceof Error?x.error.message:String(x.error)}),h(D,{kind:e,...p===void 0?{}:{addonId:p},onSubmit:e=>{w(e).catch(()=>{})},onCancel:i,submitLabel:x.isPending?`Creating…`:`Create broker`,disabled:x.isPending||v.trim().length===0}),v.trim().length===0&&h(`p`,{className:`text-[10px] text-foreground-subtle`,children:`Enter a name before creating.`})]})]})}u();function G({open:e,onClose:t,scope:n}){let r=o(),[a,s]=m(new Set),[l,u]=m(new Set),{data:p}=i({}),g=f(()=>new Set((p??[]).map(e=>e.stableId)),[p]),v=c(async(e,t)=>{u(e=>new Set(e).add(t.stableId));try{await r.mutateAsync({addonId:e,candidate:t}),s(e=>new Set(e).add(t.stableId))}catch{}finally{u(e=>{let n=new Set(e);return n.delete(t.stableId),n})}},[r]),y=c((e,t)=>{let n=typeof t.prefilledConfig.host==`string`?t.prefilledConfig.host:null,r=g.has(t.stableId),i=a.has(t.stableId)||r,o=l.has(t.stableId);return d(`div`,{className:`flex items-center justify-between rounded-lg border border-border bg-surface px-3 py-2`,children:[d(`div`,{className:`min-w-0`,children:[h(`p`,{className:`truncate text-xs font-medium text-foreground`,children:t.suggestedName}),n&&h(`p`,{className:`truncate text-[10px] font-mono text-foreground-subtle`,children:n})]}),i?d(`span`,{className:`flex items-center gap-1 text-[11px] text-foreground-subtle`,children:[h(x,{className:`h-3.5 w-3.5`}),` `,r?`Already added`:`Added`]}):d(`button`,{type:`button`,onClick:()=>void v(e,t),disabled:o,className:`flex items-center gap-1 rounded-md bg-primary px-2.5 py-1 text-[11px] font-medium text-primary-foreground disabled:opacity-50`,children:[o?h(S,{className:`h-3.5 w-3.5 animate-spin`}):h(_,{className:`h-3.5 w-3.5`}),`Add`]})]},t.stableId)},[a,l,g,v]);if(!e)return null;let b=n?`Scan network — ${n.label}`:`Scan network for devices`;return d(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[h(`div`,{className:`absolute inset-0 bg-black/60`,onClick:t}),d(`div`,{className:`relative z-10 flex w-full max-w-2xl flex-col max-h-[90vh] rounded-xl border border-border bg-background shadow-2xl`,children:[d(`div`,{className:`flex items-center justify-between border-b border-border px-5 py-4 shrink-0`,children:[d(`div`,{className:`flex items-center gap-2`,children:[h(O,{className:`h-4 w-4 text-primary`}),h(`h2`,{className:`text-sm font-semibold text-foreground`,children:b})]}),h(`button`,{onClick:t,className:`rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,children:h(w,{className:`h-4 w-4`})})]}),n?h(q,{scope:n,onAdopt:y,onReset:()=>s(new Set)}):h(K,{onAdopt:y,onReset:()=>s(new Set)})]})]})}function K({onAdopt:e,onReset:t}){let n=s(),r=c(()=>{t(),n.mutate({})},[n,t]);g(()=>{!n.isPending&&!n.data&&r()},[]);let i=f(()=>(n.data?.groups??[]).filter(e=>e.candidates.length>0),[n.data]),a=f(()=>i.reduce((e,t)=>e+t.candidates.length,0),[i]);return d(p,{children:[h(`div`,{className:`flex items-center justify-end gap-2 border-b border-border px-5 py-2 shrink-0`,children:d(`button`,{onClick:r,disabled:n.isPending,className:`flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50`,children:[h(y,{className:`h-3.5 w-3.5 ${n.isPending?`animate-spin`:``}`}),`Re-scan`]})}),d(`div`,{className:`flex-1 min-h-0 overflow-y-auto px-5 py-4 space-y-4`,children:[n.isPending&&h(J,{label:`Scanning the local network…`}),!n.isPending&&n.isError&&h(Y,{}),!n.isPending&&n.data&&i.length===0&&h(`p`,{className:`py-8 text-center text-xs text-foreground-subtle`,children:`No devices responded to the scan.`}),!n.isPending&&i.length>0&&d(`p`,{className:`text-xs text-foreground-subtle`,children:[`Found `,a,` device`,a===1?``:`s`,` on the network.`]}),!n.isPending&&i.map(t=>d(`div`,{className:`space-y-1.5`,children:[d(`div`,{className:`flex items-center gap-2`,children:[h(`span`,{className:`text-[11px] font-semibold text-foreground`,children:t.label}),d(`span`,{className:`text-[10px] text-foreground-subtle`,children:[`(`,t.candidates.length,`)`]})]}),t.candidates.map(n=>e(t.addonId,n))]},t.addonId))]})]})}function q({scope:t,onAdopt:r,onReset:i}){let a=e({addonId:t.addonId}).data??null,[o,s]=m({}),l=n(),u=c(()=>{i(),l.mutate({addonId:t.addonId,params:o})},[l,t.addonId,o,i]),f=l.data?.candidates??[];return h(p,{children:d(`div`,{className:`flex-1 min-h-0 overflow-y-auto px-5 py-4 space-y-4`,children:[a&&h(v,{schema:a,values:o,onChange:s}),d(`button`,{onClick:u,disabled:l.isPending,className:`flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground disabled:opacity-50`,children:[l.isPending?h(S,{className:`h-3.5 w-3.5 animate-spin`}):h(O,{className:`h-3.5 w-3.5`}),l.isPending?`Scanning…`:`Scan`]}),l.isError&&h(Y,{}),!l.isPending&&l.data&&f.length===0&&h(`p`,{className:`py-6 text-center text-xs text-foreground-subtle`,children:`No devices responded to the scan.`}),!l.isPending&&f.length>0&&d(`div`,{className:`space-y-1.5`,children:[d(`p`,{className:`text-xs text-foreground-subtle`,children:[`Found `,f.length,` device`,f.length===1?``:`s`,`.`]}),f.map(e=>r(t.addonId,e))]})]})})}function J({label:e}){return d(`div`,{className:`flex flex-col items-center py-12`,children:[h(S,{className:`h-6 w-6 animate-spin text-primary`}),h(`p`,{className:`mt-3 text-xs text-foreground-subtle`,children:e})]})}function Y(){return d(`div`,{className:`flex items-start gap-3 rounded-lg border border-destructive/40 bg-destructive/10 px-4 py-3`,children:[h(E,{className:`h-4 w-4 text-destructive mt-0.5 shrink-0`}),h(`p`,{className:`text-xs text-destructive`,children:`The scan failed. Try again.`})]})}export{W as n,O as r,G as t};
1
+ import{Fn as e,Xt as t,bn as n,en as r,jn as i,tn as a,un as o,vn as s}from"./src-CjlMsFRd.js";import{I as c,K as l,Q as u,S as d,W as f,b as p,q as m,x as h,z as g}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{t as _}from"./download-CeG-HJtH.js";import{t as v}from"./FormBuilder-BwFnNOpt.js";import{t as y}from"./refresh-cw-53RBMMNj.js";import{F as b,L as x,S,W as C,i as w,k as T,o as E}from"./index-CS131rnv.js";import{t as D}from"./BrokerForm-SDrahZJq.js";var O=C(`radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]);u();var k=[`amazon.com`,`amazon.it`,`amazon.de`,`amazon.co.uk`,`amazon.fr`,`amazon.es`,`amazon.ca`,`amazon.com.au`,`amazon.co.jp`,`amazon.in`,`amazon.com.br`,`amazon.com.mx`],A=`/addon/import-alexa`,j=2e3;function M(e){return typeof e==`object`&&!!e&&typeof e.sessionId==`string`&&typeof e.loginUrl==`string`}function N(e){return typeof e==`object`&&!!e&&typeof e.phase==`string`&&typeof e.sessionId==`string`}function P(e){return typeof e==`object`&&!!e&&typeof e.brokerId==`string`}function F(e){return{"Content-Type":`application/json`,Authorization:`Bearer ${localStorage.getItem(`camstack_admin_token`)??``}`,...e}}async function I(e,t,n){let r=await fetch(`${A}${e}`,{method:`POST`,headers:F(),body:JSON.stringify(t)}),i=await r.json();if(!r.ok){let e=typeof i==`object`&&i?i.error??`Unknown error`:`Unknown error`;throw Error(String(e))}if(!n(i))throw Error(`Unexpected response from server`);return i}async function L(e){let t=new URLSearchParams({sessionId:e}),n=localStorage.getItem(`camstack_admin_token`)??``,r=await fetch(`${A}/login/status?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}}),i=await r.json();if(!r.ok){let e=typeof i==`object`&&i?i.error??`Unknown error`:`Unknown error`;throw Error(String(e))}if(!N(i))throw Error(`Unexpected status response from server`);return i}async function R(e){try{await fetch(`${A}/login/cancel`,{method:`POST`,headers:F(),body:JSON.stringify({sessionId:e})})}catch{}}function z({brokerId:e,onResolved:t,onCancel:n}){let[r,i]=m(`amazon.it`),[a,o]=m(`Alexa account`),[s,u]=m({kind:`idle`}),f=l(!0);g(()=>(f.current=!0,()=>{f.current=!1}),[]);let p=l(null),_=l(null),v=c(()=>{_.current!==null&&(clearInterval(_.current),_.current=null)},[]),b=c(async n=>{v(),f.current&&u({kind:`committing`,sessionId:n});try{let r=await I(`/login/commit`,{sessionId:n,name:a.trim().length>0?a.trim():`Alexa account`,...e===void 0?{}:{brokerId:e}},P);p.current=null,t(r.brokerId)}catch(e){let t=e instanceof Error?e.message:String(e);f.current&&u({kind:`error`,message:t,sessionId:n})}},[e,a,t,v]),x=c((e,t)=>{v();let n=async()=>{try{let n=await L(e);if(n.phase===`captured`){v(),b(e);return}if(n.phase===`error`){v(),f.current&&u({kind:`error`,message:n.error??`Login proxy returned an error`,sessionId:e});return}if(n.phase===`cancelled`){v(),f.current&&u({kind:`idle`});return}f.current&&u({kind:`polling`,sessionId:e,loginUrl:n.loginUrl||t,phase:n.phase})}catch(e){let t=e instanceof Error?e.message:String(e);f.current&&u(e=>e.kind===`polling`?{...e}:{kind:`error`,message:t,sessionId:null})}};_.current=setInterval(()=>{n()},j)},[v,b]);g(()=>()=>{v(),p.current!==null&&R(p.current)},[v]);let C=async()=>{v(),p.current!==null&&(R(p.current),p.current=null),u({kind:`starting`});try{let e=await I(`/login/start`,{amazonDomain:r},M);p.current=e.sessionId,u({kind:`polling`,sessionId:e.sessionId,loginUrl:e.loginUrl,phase:`starting`}),x(e.sessionId,e.loginUrl)}catch(e){u({kind:`error`,message:e instanceof Error?e.message:String(e),sessionId:null})}},w=()=>{v(),p.current!==null&&(R(p.current),p.current=null),u({kind:`idle`})},D=()=>{w()},O=s.kind===`idle`,A=s.kind===`starting`,N=s.kind===`polling`,F=s.kind===`committing`,z=s.kind===`error`,B=A||N||F,V=s.kind===`polling`?s.phase:null,H=s.kind===`polling`?s.loginUrl:null,U=N&&V===`awaiting-login`,W=N&&(V===`starting`||V===null);return d(`div`,{className:`space-y-4`,children:[(O||z)&&d(`div`,{className:`space-y-3`,children:[e===void 0&&d(`div`,{className:`space-y-1`,children:[h(`label`,{htmlFor:`alexa-account-name`,className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Account name`}),h(`input`,{id:`alexa-account-name`,type:`text`,value:a,onChange:e=>o(e.target.value),placeholder:`Alexa account`,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),d(`div`,{className:`space-y-1`,children:[h(`label`,{htmlFor:`alexa-amazon-region`,className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Amazon region`}),h(`select`,{id:`alexa-amazon-region`,value:r,onChange:e=>i(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`,children:k.map(e=>h(`option`,{value:e,children:e},e))})]})]}),z&&d(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px] flex items-start gap-2`,children:[h(E,{className:`h-3.5 w-3.5 mt-0.5 flex-shrink-0`}),h(`span`,{children:s.message})]}),A&&d(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-3 text-xs text-foreground-subtle`,children:[h(S,{className:`h-4 w-4 animate-spin flex-shrink-0`}),`Starting login proxy…`]}),W&&d(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-3 text-xs text-foreground-subtle`,children:[h(S,{className:`h-4 w-4 animate-spin flex-shrink-0`}),`Waiting for proxy to be ready…`]}),F&&d(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-3 text-xs text-foreground-subtle`,children:[h(S,{className:`h-4 w-4 animate-spin flex-shrink-0`}),`Saving credentials…`]}),U&&H!==null&&d(`div`,{className:`space-y-3`,children:[d(`div`,{className:`rounded-lg border border-border bg-surface p-3 space-y-2`,children:[h(`p`,{className:`text-xs font-semibold text-foreground`,children:`Open the link below to log in to your Amazon account`}),h(`p`,{className:`text-[10px] text-foreground-subtle`,children:`After completing the login and any 2FA steps, this wizard will continue automatically.`}),d(`a`,{href:H,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 rounded bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90`,children:[h(T,{className:`h-3.5 w-3.5`}),`Login to Amazon`]})]}),d(`div`,{className:`rounded border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[10px] text-amber-700 dark:text-amber-300`,children:[h(`strong`,{children:`Note:`}),` The login proxy runs directly on the hub. If the link does not open or the page does not load, make sure the hub's proxy host and port are reachable from your browser. You can configure `,h(`code`,{className:`font-mono`,children:`proxyHost`}),` in the Alexa addon settings and ensure the proxy port is published (Docker port mapping).`]}),d(`div`,{className:`flex items-center gap-2 text-[10px] text-foreground-subtle`,children:[h(S,{className:`h-3 w-3 animate-spin`}),`Waiting for Amazon login to complete…`]})]}),d(`div`,{className:`flex items-center justify-between gap-2 pt-1`,children:[h(`button`,{type:`button`,onClick:B?w:n,className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:B?`Cancel login`:`Back`}),d(`div`,{className:`flex items-center gap-2`,children:[z&&d(`button`,{type:`button`,onClick:D,className:`inline-flex items-center gap-1.5 rounded border border-border px-3 py-1.5 text-xs text-foreground hover:bg-primary/10`,children:[h(y,{className:`h-3.5 w-3.5`}),`Retry`]}),O&&h(`button`,{type:`button`,onClick:()=>{C()},disabled:e===void 0&&a.trim().length===0,className:`inline-flex items-center gap-1.5 rounded bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:`Start login`})]})]})]})}u();var B=`alexa`;function V(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.id==`string`):[]}function H(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.addonId==`string`&&Array.isArray(e.kinds)):[]}var U={connected:`bg-emerald-500/15 text-emerald-700 dark:text-emerald-300`,connecting:`bg-amber-500/15 text-amber-700 dark:text-amber-300`,disconnected:`bg-foreground-subtle/15 text-foreground-subtle`,"auth-failed":`bg-danger/15 text-danger`,unreachable:`bg-danger/15 text-danger`,error:`bg-danger/15 text-danger`};function W({kind:e,onResolved:n,onBack:i}){let[o,s]=m(e===B?`alexa-login`:`existing`),c=r({kind:e}),l=f(()=>V(c.data).filter(t=>t.kind===e),[c.data,e]),u=a(),p=f(()=>{for(let t of H(u.data))if(t.kinds.some(t=>t.kind===e))return t.addonId},[u.data,e]),[g,_]=m(null),[v,y]=m(``),x=t({}),C=()=>{g&&n(g)},w=async t=>{v.trim().length!==0&&n((await x.mutateAsync({kind:e,name:v.trim(),settings:t,...p===void 0?{}:{addonId:p}})).id)},T=e=>{e===`new`?_(null):x.reset(),s(e)};return d(`div`,{className:`space-y-4`,children:[d(`button`,{type:`button`,onClick:i,className:`inline-flex items-center gap-1 text-[11px] text-foreground-subtle hover:text-foreground`,children:[h(b,{className:`h-3.5 w-3.5`}),` Back`]}),d(`div`,{className:`inline-flex rounded-lg border border-border p-0.5 flex-wrap gap-0.5`,children:[e===B&&h(`button`,{type:`button`,onClick:()=>T(`alexa-login`),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${o===`alexa-login`?`bg-primary text-primary-foreground`:`text-foreground-subtle hover:text-foreground`}`,children:`Login interactively`}),h(`button`,{type:`button`,onClick:()=>T(`existing`),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${o===`existing`?`bg-primary text-primary-foreground`:`text-foreground-subtle hover:text-foreground`}`,children:`Use existing`}),h(`button`,{type:`button`,onClick:()=>T(`new`),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${o===`new`?`bg-primary text-primary-foreground`:`text-foreground-subtle hover:text-foreground`}`,children:e===B?`Paste cookie`:`Create new`})]}),o===`alexa-login`&&h(z,{onResolved:n,onCancel:i}),o===`existing`&&d(`div`,{className:`space-y-3`,children:[c.isLoading&&d(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[h(S,{className:`h-3.5 w-3.5 animate-spin`}),` Loading brokers…`]}),c.isError&&d(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px]`,children:[`Failed to load brokers:`,` `,c.error instanceof Error?c.error.message:`Unknown error`]}),!c.isLoading&&!c.isError&&l.length===0&&d(`div`,{className:`rounded-lg border border-border bg-surface px-3 py-6 text-center text-xs text-foreground-subtle`,children:[`No brokers of this kind yet. Switch to`,` `,h(`span`,{className:`font-medium text-foreground`,children:e===B?`Login interactively`:`Create new`}),` `,`to register one.`]}),h(`div`,{className:`space-y-2`,children:l.map(e=>d(`button`,{type:`button`,onClick:()=>_(e.id),className:`flex w-full items-center justify-between gap-3 rounded-lg border bg-surface p-3 text-left transition-colors ${g===e.id?`border-primary ring-1 ring-primary`:`border-border hover:border-foreground-subtle/30`}`,children:[h(`span`,{className:`text-xs font-semibold text-foreground`,children:e.name}),h(`span`,{className:`text-[10px] rounded-full px-2 py-0.5 font-medium ${U[e.status]}`,children:e.status})]},e.id))}),l.length>0&&h(`div`,{className:`flex justify-end pt-1`,children:h(`button`,{type:`button`,onClick:C,disabled:!g,className:`inline-flex items-center gap-1.5 rounded bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:`Use this broker`})})]}),o===`new`&&d(`div`,{className:`space-y-3`,children:[d(`div`,{className:`space-y-1`,children:[h(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Name`}),h(`input`,{type:`text`,value:v,onChange:e=>y(e.target.value),placeholder:`My Home Assistant`,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),x.isError&&h(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px]`,children:x.error instanceof Error?x.error.message:String(x.error)}),h(D,{kind:e,...p===void 0?{}:{addonId:p},onSubmit:e=>{w(e).catch(()=>{})},onCancel:i,submitLabel:x.isPending?`Creating…`:`Create broker`,disabled:x.isPending||v.trim().length===0}),v.trim().length===0&&h(`p`,{className:`text-[10px] text-foreground-subtle`,children:`Enter a name before creating.`})]})]})}u();function G({open:e,onClose:t,scope:n}){let r=o(),[a,s]=m(new Set),[l,u]=m(new Set),{data:p}=i({}),g=f(()=>new Set((p??[]).map(e=>e.stableId)),[p]),v=c(async(e,t)=>{u(e=>new Set(e).add(t.stableId));try{await r.mutateAsync({addonId:e,candidate:t}),s(e=>new Set(e).add(t.stableId))}catch{}finally{u(e=>{let n=new Set(e);return n.delete(t.stableId),n})}},[r]),y=c((e,t)=>{let n=typeof t.prefilledConfig.host==`string`?t.prefilledConfig.host:null,r=g.has(t.stableId),i=a.has(t.stableId)||r,o=l.has(t.stableId);return d(`div`,{className:`flex items-center justify-between rounded-lg border border-border bg-surface px-3 py-2`,children:[d(`div`,{className:`min-w-0`,children:[h(`p`,{className:`truncate text-xs font-medium text-foreground`,children:t.suggestedName}),n&&h(`p`,{className:`truncate text-[10px] font-mono text-foreground-subtle`,children:n})]}),i?d(`span`,{className:`flex items-center gap-1 text-[11px] text-foreground-subtle`,children:[h(x,{className:`h-3.5 w-3.5`}),` `,r?`Already added`:`Added`]}):d(`button`,{type:`button`,onClick:()=>void v(e,t),disabled:o,className:`flex items-center gap-1 rounded-md bg-primary px-2.5 py-1 text-[11px] font-medium text-primary-foreground disabled:opacity-50`,children:[o?h(S,{className:`h-3.5 w-3.5 animate-spin`}):h(_,{className:`h-3.5 w-3.5`}),`Add`]})]},t.stableId)},[a,l,g,v]);if(!e)return null;let b=n?`Scan network — ${n.label}`:`Scan network for devices`;return d(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[h(`div`,{className:`absolute inset-0 bg-black/60`,onClick:t}),d(`div`,{className:`relative z-10 flex w-full max-w-2xl flex-col max-h-[90vh] rounded-xl border border-border bg-background shadow-2xl`,children:[d(`div`,{className:`flex items-center justify-between border-b border-border px-5 py-4 shrink-0`,children:[d(`div`,{className:`flex items-center gap-2`,children:[h(O,{className:`h-4 w-4 text-primary`}),h(`h2`,{className:`text-sm font-semibold text-foreground`,children:b})]}),h(`button`,{onClick:t,className:`rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,children:h(w,{className:`h-4 w-4`})})]}),n?h(q,{scope:n,onAdopt:y,onReset:()=>s(new Set)}):h(K,{onAdopt:y,onReset:()=>s(new Set)})]})]})}function K({onAdopt:e,onReset:t}){let n=s(),r=c(()=>{t(),n.mutate({})},[n,t]);g(()=>{!n.isPending&&!n.data&&r()},[]);let i=f(()=>(n.data?.groups??[]).filter(e=>e.candidates.length>0),[n.data]),a=f(()=>i.reduce((e,t)=>e+t.candidates.length,0),[i]);return d(p,{children:[h(`div`,{className:`flex items-center justify-end gap-2 border-b border-border px-5 py-2 shrink-0`,children:d(`button`,{onClick:r,disabled:n.isPending,className:`flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50`,children:[h(y,{className:`h-3.5 w-3.5 ${n.isPending?`animate-spin`:``}`}),`Re-scan`]})}),d(`div`,{className:`flex-1 min-h-0 overflow-y-auto px-5 py-4 space-y-4`,children:[n.isPending&&h(J,{label:`Scanning the local network…`}),!n.isPending&&n.isError&&h(Y,{}),!n.isPending&&n.data&&i.length===0&&h(`p`,{className:`py-8 text-center text-xs text-foreground-subtle`,children:`No devices responded to the scan.`}),!n.isPending&&i.length>0&&d(`p`,{className:`text-xs text-foreground-subtle`,children:[`Found `,a,` device`,a===1?``:`s`,` on the network.`]}),!n.isPending&&i.map(t=>d(`div`,{className:`space-y-1.5`,children:[d(`div`,{className:`flex items-center gap-2`,children:[h(`span`,{className:`text-[11px] font-semibold text-foreground`,children:t.label}),d(`span`,{className:`text-[10px] text-foreground-subtle`,children:[`(`,t.candidates.length,`)`]})]}),t.candidates.map(n=>e(t.addonId,n))]},t.addonId))]})]})}function q({scope:t,onAdopt:r,onReset:i}){let a=e({addonId:t.addonId}).data??null,[o,s]=m({}),l=n(),u=c(()=>{i(),l.mutate({addonId:t.addonId,params:o})},[l,t.addonId,o,i]),f=l.data?.candidates??[];return h(p,{children:d(`div`,{className:`flex-1 min-h-0 overflow-y-auto px-5 py-4 space-y-4`,children:[a&&h(v,{schema:a,values:o,onChange:s}),d(`button`,{onClick:u,disabled:l.isPending,className:`flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground disabled:opacity-50`,children:[l.isPending?h(S,{className:`h-3.5 w-3.5 animate-spin`}):h(O,{className:`h-3.5 w-3.5`}),l.isPending?`Scanning…`:`Scan`]}),l.isError&&h(Y,{}),!l.isPending&&l.data&&f.length===0&&h(`p`,{className:`py-6 text-center text-xs text-foreground-subtle`,children:`No devices responded to the scan.`}),!l.isPending&&f.length>0&&d(`div`,{className:`space-y-1.5`,children:[d(`p`,{className:`text-xs text-foreground-subtle`,children:[`Found `,f.length,` device`,f.length===1?``:`s`,`.`]}),f.map(e=>r(t.addonId,e))]})]})})}function J({label:e}){return d(`div`,{className:`flex flex-col items-center py-12`,children:[h(S,{className:`h-6 w-6 animate-spin text-primary`}),h(`p`,{className:`mt-3 text-xs text-foreground-subtle`,children:e})]})}function Y(){return d(`div`,{className:`flex items-start gap-3 rounded-lg border border-destructive/40 bg-destructive/10 px-4 py-3`,children:[h(E,{className:`h-4 w-4 text-destructive mt-0.5 shrink-0`}),h(`p`,{className:`text-xs text-destructive`,children:`The scan failed. Try again.`})]})}export{W as n,O as r,G as t};
@@ -1 +1 @@
1
- import{Vr as e}from"./src-DKAxBIDH.js";import{S as t,x as n}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{p as r}from"./index-PRd5ZDug.js";import{t as i}from"./AdminPage-BwmGKnRf.js";import{t as a}from"./NodeAddonsSettingsPanel-KR29Oo7P.js";function o(){let{data:o,isLoading:s}=e(void 0),c=(o??[]).find(e=>e.isHub&&e.isOnline),l=c?.addons.map(e=>e.id)??[];return n(i,{children:s?n(`div`,{className:`text-muted-foreground text-sm py-12 text-center`,children:`Loading hub topology…`}):c?l.length===0?n(`div`,{className:`text-muted-foreground text-sm py-12 text-center`,children:`No addons installed on the hub yet.`}):n(a,{nodeId:c.id,addonIds:l,level:`global`}):t(`div`,{className:`flex flex-col items-center justify-center text-muted-foreground text-sm gap-2 py-12`,children:[n(r,{className:`h-8 w-8 opacity-30`}),n(`p`,{children:`No online hub node found.`}),n(`p`,{className:`text-xs`,children:`Settings will appear once the hub is reachable.`})]})})}export{o as SettingsPage};
1
+ import{Vr as e}from"./src-CjlMsFRd.js";import{S as t,x as n}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{p as r}from"./index-CS131rnv.js";import{t as i}from"./AdminPage-BwmGKnRf.js";import{t as a}from"./NodeAddonsSettingsPanel-BvaibJiq.js";function o(){let{data:o,isLoading:s}=e(void 0),c=(o??[]).find(e=>e.isHub&&e.isOnline),l=c?.addons.map(e=>e.id)??[];return n(i,{children:s?n(`div`,{className:`text-muted-foreground text-sm py-12 text-center`,children:`Loading hub topology…`}):c?l.length===0?n(`div`,{className:`text-muted-foreground text-sm py-12 text-center`,children:`No addons installed on the hub yet.`}):n(a,{nodeId:c.id,addonIds:l,level:`global`}):t(`div`,{className:`flex flex-col items-center justify-center text-muted-foreground text-sm gap-2 py-12`,children:[n(r,{className:`h-8 w-8 opacity-30`}),n(`p`,{children:`No online hub node found.`}),n(`p`,{className:`text-xs`,children:`Settings will appear once the hub is reachable.`})]})})}export{o as SettingsPage};
@@ -1 +1 @@
1
- import{Q as e,S as t,q as n,x as r}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{t as i}from"./CapabilityBadges-DXbYtBuK.js";import{t as a}from"./ProviderIcon-CYHRodqA.js";import{t as o}from"./FormBuilder-2eKUDBn_.js";import{t as s}from"./StatusBadge-Dcr2bw58.js";e();function c({title:e,children:n}){return t(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[r(`div`,{className:`border-b border-border px-4 py-2.5`,children:r(`h2`,{className:`text-xs font-semibold text-foreground uppercase tracking-wider`,children:e})}),r(`div`,{className:`p-4`,children:n})]})}function l({name:e,cssVar:n,hex:i}){return t(`div`,{className:`flex flex-col items-center gap-1.5`,children:[r(`div`,{className:`h-10 w-10 rounded-lg border border-border shadow-inner`,style:{backgroundColor:n?`var(${n})`:i}}),r(`span`,{className:`text-[10px] text-foreground-subtle text-center leading-tight`,children:e})]})}var u={sections:[{id:`demo`,title:`Demo Fields`,columns:2,fields:[{key:`name`,type:`text`,label:`Name`,placeholder:`Enter name`},{key:`count`,type:`number`,label:`Count`,min:0,max:100,unit:`items`},{key:`enabled`,type:`boolean`,label:`Enabled`},{key:`mode`,type:`select`,label:`Mode`,options:[{value:`a`,label:`Alpha`},{value:`b`,label:`Beta`}]},{key:`tags`,type:`tags`,label:`Tags`,span:2,suggestions:[`camera`,`zone`,`alert`]},{key:`confidence`,type:`slider`,label:`Confidence`,min:0,max:100,step:5,unit:`%`,span:2},{key:`info`,type:`info`,label:`Note`,content:`This is an informational message for the user.`,variant:`info`}]}]};function d(){let[e,d]=n({name:`Example`,count:10,enabled:!0,mode:`a`,tags:[`camera`],confidence:60});return t(`div`,{className:`p-6 space-y-6 max-w-5xl mx-auto`,children:[t(`div`,{className:`mb-6`,children:[r(`h1`,{className:`text-xl font-bold text-foreground`,children:`Component Showroom`}),r(`p`,{className:`text-sm text-foreground-subtle mt-1`,children:`All UI components at a glance`})]}),r(c,{title:`Typography`,children:t(`div`,{className:`space-y-3`,children:[r(`h1`,{className:`text-2xl font-bold text-foreground`,children:`Heading 1 — Display title`}),r(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Heading 2 — Section title`}),r(`h3`,{className:`text-base font-semibold text-foreground`,children:`Heading 3 — Card title`}),r(`h4`,{className:`text-sm font-semibold text-foreground`,children:`Heading 4 — Sub-section`}),r(`p`,{className:`text-sm text-foreground`,children:`Body text — Regular paragraph content goes here. It uses the foreground color.`}),r(`p`,{className:`text-sm text-foreground-subtle`,children:`Subtle text — Secondary/descriptive text with reduced emphasis.`}),r(`p`,{className:`text-xs text-foreground-subtle uppercase tracking-wider font-semibold`,children:`Label / Caption`}),r(`p`,{className:`text-xs text-foreground-disabled`,children:`Disabled / placeholder text`})]})}),r(c,{title:`Colors`,children:t(`div`,{className:`flex flex-wrap gap-4`,children:[r(l,{name:`primary`,cssVar:`--color-primary`}),r(l,{name:`background`,cssVar:`--color-background`}),r(l,{name:`surface`,cssVar:`--color-surface`}),r(l,{name:`foreground`,cssVar:`--color-foreground`}),r(l,{name:`success`,cssVar:`--color-success`}),r(l,{name:`warning`,cssVar:`--color-warning`}),r(l,{name:`danger`,cssVar:`--color-danger`}),r(l,{name:`info`,cssVar:`--color-info`}),r(l,{name:`border`,cssVar:`--color-border`}),r(`div`,{className:`w-px`}),r(l,{name:`frigate`,hex:`#3b82f6`}),r(l,{name:`scrypted`,hex:`#a855f7`}),r(l,{name:`reolink`,hex:`#06b6d4`}),r(l,{name:`ha`,hex:`#22d3ee`}),r(l,{name:`rtsp`,hex:`#78716c`})]})}),r(c,{title:`Buttons`,children:t(`div`,{className:`flex flex-wrap gap-3`,children:[r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90 transition-opacity`,children:`Primary`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-surface px-4 py-2 text-sm font-medium text-foreground hover:bg-surface-hover transition-colors`,children:`Secondary`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-danger/40 bg-danger/10 px-4 py-2 text-sm font-medium text-danger hover:bg-danger/20 transition-colors`,children:`Danger`}),r(`button`,{disabled:!0,className:`inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white opacity-40 cursor-not-allowed`,children:`Disabled`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-4 py-2 text-sm font-medium text-warning hover:bg-warning/20 transition-colors`,children:`Warning`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-success/40 bg-success/10 px-4 py-2 text-sm font-medium text-success hover:bg-success/20 transition-colors`,children:`Success`})]})}),r(c,{title:`Inputs`,children:t(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Text input`}),r(`input`,{type:`text`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`Type something...`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Number input`}),r(`input`,{type:`number`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`0`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Password input`}),r(`input`,{type:`password`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`••••••••`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Select`}),t(`select`,{className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,children:[r(`option`,{children:`Option A`}),r(`option`,{children:`Option B`}),r(`option`,{children:`Option C`})]})]}),t(`div`,{className:`md:col-span-2`,children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Textarea`}),r(`textarea`,{className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30 resize-y min-h-[60px]`,placeholder:`Enter multi-line text...`,rows:3})]}),r(`div`,{children:t(`label`,{className:`flex items-center gap-2 cursor-pointer select-none`,children:[r(`input`,{type:`checkbox`,className:`h-3.5 w-3.5 rounded border-border accent-primary`,defaultChecked:!0}),r(`span`,{className:`text-xs font-medium text-foreground`,children:`Checkbox (checked)`})]})}),r(`div`,{children:t(`div`,{className:`flex items-center justify-between`,children:[r(`span`,{className:`text-xs font-medium text-foreground`,children:`Toggle switch`}),r(f,{})]})}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Slider`}),r(`input`,{type:`range`,className:`w-full h-1 accent-primary cursor-pointer`,min:0,max:100,defaultValue:60})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Tags example`}),r(`div`,{className:`flex flex-wrap gap-1.5 rounded-md border border-border bg-background px-2 py-1.5 min-h-[38px]`,children:[`camera`,`zone`,`alert`].map(e=>r(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-primary/10 px-1.5 py-0.5 text-xs text-primary`,children:e},e))})]})]})}),r(c,{title:`Badges`,children:t(`div`,{className:`space-y-3`,children:[t(`div`,{children:[r(`p`,{className:`text-xs text-foreground-subtle mb-2`,children:`StatusBadge`}),r(`div`,{className:`flex flex-wrap gap-2`,children:[`running`,`stopped`,`error`,`online`,`offline`,`idle`].map(e=>r(s,{status:e},e))})]}),t(`div`,{children:[r(`p`,{className:`text-xs text-foreground-subtle mb-2`,children:`CapabilityBadges`}),r(i,{capabilities:[`streaming`,`detection`,`recording`,`audio`]})]})]})}),r(c,{title:`Cards`,children:t(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[t(`div`,{className:`rounded-lg bg-surface p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Surface card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `bg-surface`. Default card background."})]}),t(`div`,{className:`rounded-lg border border-border bg-surface p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Bordered card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `border border-border bg-surface`."})]}),t(`div`,{className:`rounded-lg border border-primary/30 bg-primary/5 p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-primary mb-1`,children:`Accent card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:`Highlighted with primary color.`})]}),t(`div`,{className:`rounded-lg bg-background p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Background card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `bg-background`. Inset card."})]})]})}),r(c,{title:`Provider Icons`,children:r(`div`,{className:`flex flex-wrap gap-4`,children:[`frigate`,`scrypted`,`reolink`,`homeassistant`,`rtsp`,`onvif`].map(e=>r(a,{type:e,size:`lg`,showLabel:!0},e))})}),t(c,{title:`Form Builder Demo`,children:[r(o,{schema:u,values:e,onChange:d}),t(`details`,{className:`mt-3`,children:[r(`summary`,{className:`text-[10px] text-foreground-subtle cursor-pointer hover:text-foreground`,children:`View current values`}),r(`pre`,{className:`mt-2 rounded-md bg-background p-3 text-[10px] text-foreground-subtle overflow-auto`,children:JSON.stringify(e,null,2)})]})]}),r(c,{title:`Info Boxes`,children:r(`div`,{className:`space-y-2`,children:[{variant:`info`,label:`Info`,content:`This is an informational message. Use it for tips and hints.`},{variant:`warning`,label:`Warning`,content:`This action may have side effects. Proceed with caution.`},{variant:`success`,label:`Success`,content:`Operation completed successfully. All systems are green.`},{variant:`danger`,label:`Danger`,content:`This operation is irreversible. Data will be permanently deleted.`}].map(({variant:e,label:n,content:i})=>{let a={info:{border:`border-info`,bg:`bg-info/5`,text:`text-info`},warning:{border:`border-warning`,bg:`bg-warning/5`,text:`text-warning`},success:{border:`border-success`,bg:`bg-success/5`,text:`text-success`},danger:{border:`border-danger`,bg:`bg-danger/5`,text:`text-danger`}}[e];return t(`div`,{className:`rounded-md border-l-4 px-3 py-2.5 ${a.border} ${a.bg}`,children:[r(`p`,{className:`text-xs font-semibold mb-0.5 ${a.text}`,children:n}),r(`p`,{className:`text-xs text-foreground-subtle leading-relaxed`,children:i})]},e)})})})]})}function f(){let[e,t]=n(!0);return r(`button`,{type:`button`,role:`switch`,"aria-checked":e,onClick:()=>t(e=>!e),className:[`relative inline-flex h-4 w-8 shrink-0 items-center rounded-full transition-colors duration-150 cursor-pointer`,e?`bg-primary`:`bg-foreground-subtle/30`].join(` `),children:r(`span`,{className:[`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform duration-150`,e?`translate-x-4`:`translate-x-0.5`].join(` `)})})}export{d as ShowroomPage};
1
+ import{Q as e,S as t,q as n,x as r}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{t as i}from"./CapabilityBadges-B5gVN9yo.js";import{t as a}from"./ProviderIcon-BNV0FRHJ.js";import{t as o}from"./FormBuilder-BwFnNOpt.js";import{t as s}from"./StatusBadge-Dcr2bw58.js";e();function c({title:e,children:n}){return t(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[r(`div`,{className:`border-b border-border px-4 py-2.5`,children:r(`h2`,{className:`text-xs font-semibold text-foreground uppercase tracking-wider`,children:e})}),r(`div`,{className:`p-4`,children:n})]})}function l({name:e,cssVar:n,hex:i}){return t(`div`,{className:`flex flex-col items-center gap-1.5`,children:[r(`div`,{className:`h-10 w-10 rounded-lg border border-border shadow-inner`,style:{backgroundColor:n?`var(${n})`:i}}),r(`span`,{className:`text-[10px] text-foreground-subtle text-center leading-tight`,children:e})]})}var u={sections:[{id:`demo`,title:`Demo Fields`,columns:2,fields:[{key:`name`,type:`text`,label:`Name`,placeholder:`Enter name`},{key:`count`,type:`number`,label:`Count`,min:0,max:100,unit:`items`},{key:`enabled`,type:`boolean`,label:`Enabled`},{key:`mode`,type:`select`,label:`Mode`,options:[{value:`a`,label:`Alpha`},{value:`b`,label:`Beta`}]},{key:`tags`,type:`tags`,label:`Tags`,span:2,suggestions:[`camera`,`zone`,`alert`]},{key:`confidence`,type:`slider`,label:`Confidence`,min:0,max:100,step:5,unit:`%`,span:2},{key:`info`,type:`info`,label:`Note`,content:`This is an informational message for the user.`,variant:`info`}]}]};function d(){let[e,d]=n({name:`Example`,count:10,enabled:!0,mode:`a`,tags:[`camera`],confidence:60});return t(`div`,{className:`p-6 space-y-6 max-w-5xl mx-auto`,children:[t(`div`,{className:`mb-6`,children:[r(`h1`,{className:`text-xl font-bold text-foreground`,children:`Component Showroom`}),r(`p`,{className:`text-sm text-foreground-subtle mt-1`,children:`All UI components at a glance`})]}),r(c,{title:`Typography`,children:t(`div`,{className:`space-y-3`,children:[r(`h1`,{className:`text-2xl font-bold text-foreground`,children:`Heading 1 — Display title`}),r(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Heading 2 — Section title`}),r(`h3`,{className:`text-base font-semibold text-foreground`,children:`Heading 3 — Card title`}),r(`h4`,{className:`text-sm font-semibold text-foreground`,children:`Heading 4 — Sub-section`}),r(`p`,{className:`text-sm text-foreground`,children:`Body text — Regular paragraph content goes here. It uses the foreground color.`}),r(`p`,{className:`text-sm text-foreground-subtle`,children:`Subtle text — Secondary/descriptive text with reduced emphasis.`}),r(`p`,{className:`text-xs text-foreground-subtle uppercase tracking-wider font-semibold`,children:`Label / Caption`}),r(`p`,{className:`text-xs text-foreground-disabled`,children:`Disabled / placeholder text`})]})}),r(c,{title:`Colors`,children:t(`div`,{className:`flex flex-wrap gap-4`,children:[r(l,{name:`primary`,cssVar:`--color-primary`}),r(l,{name:`background`,cssVar:`--color-background`}),r(l,{name:`surface`,cssVar:`--color-surface`}),r(l,{name:`foreground`,cssVar:`--color-foreground`}),r(l,{name:`success`,cssVar:`--color-success`}),r(l,{name:`warning`,cssVar:`--color-warning`}),r(l,{name:`danger`,cssVar:`--color-danger`}),r(l,{name:`info`,cssVar:`--color-info`}),r(l,{name:`border`,cssVar:`--color-border`}),r(`div`,{className:`w-px`}),r(l,{name:`frigate`,hex:`#3b82f6`}),r(l,{name:`scrypted`,hex:`#a855f7`}),r(l,{name:`reolink`,hex:`#06b6d4`}),r(l,{name:`ha`,hex:`#22d3ee`}),r(l,{name:`rtsp`,hex:`#78716c`})]})}),r(c,{title:`Buttons`,children:t(`div`,{className:`flex flex-wrap gap-3`,children:[r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90 transition-opacity`,children:`Primary`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-surface px-4 py-2 text-sm font-medium text-foreground hover:bg-surface-hover transition-colors`,children:`Secondary`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-danger/40 bg-danger/10 px-4 py-2 text-sm font-medium text-danger hover:bg-danger/20 transition-colors`,children:`Danger`}),r(`button`,{disabled:!0,className:`inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white opacity-40 cursor-not-allowed`,children:`Disabled`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-4 py-2 text-sm font-medium text-warning hover:bg-warning/20 transition-colors`,children:`Warning`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-success/40 bg-success/10 px-4 py-2 text-sm font-medium text-success hover:bg-success/20 transition-colors`,children:`Success`})]})}),r(c,{title:`Inputs`,children:t(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Text input`}),r(`input`,{type:`text`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`Type something...`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Number input`}),r(`input`,{type:`number`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`0`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Password input`}),r(`input`,{type:`password`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`••••••••`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Select`}),t(`select`,{className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,children:[r(`option`,{children:`Option A`}),r(`option`,{children:`Option B`}),r(`option`,{children:`Option C`})]})]}),t(`div`,{className:`md:col-span-2`,children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Textarea`}),r(`textarea`,{className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30 resize-y min-h-[60px]`,placeholder:`Enter multi-line text...`,rows:3})]}),r(`div`,{children:t(`label`,{className:`flex items-center gap-2 cursor-pointer select-none`,children:[r(`input`,{type:`checkbox`,className:`h-3.5 w-3.5 rounded border-border accent-primary`,defaultChecked:!0}),r(`span`,{className:`text-xs font-medium text-foreground`,children:`Checkbox (checked)`})]})}),r(`div`,{children:t(`div`,{className:`flex items-center justify-between`,children:[r(`span`,{className:`text-xs font-medium text-foreground`,children:`Toggle switch`}),r(f,{})]})}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Slider`}),r(`input`,{type:`range`,className:`w-full h-1 accent-primary cursor-pointer`,min:0,max:100,defaultValue:60})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Tags example`}),r(`div`,{className:`flex flex-wrap gap-1.5 rounded-md border border-border bg-background px-2 py-1.5 min-h-[38px]`,children:[`camera`,`zone`,`alert`].map(e=>r(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-primary/10 px-1.5 py-0.5 text-xs text-primary`,children:e},e))})]})]})}),r(c,{title:`Badges`,children:t(`div`,{className:`space-y-3`,children:[t(`div`,{children:[r(`p`,{className:`text-xs text-foreground-subtle mb-2`,children:`StatusBadge`}),r(`div`,{className:`flex flex-wrap gap-2`,children:[`running`,`stopped`,`error`,`online`,`offline`,`idle`].map(e=>r(s,{status:e},e))})]}),t(`div`,{children:[r(`p`,{className:`text-xs text-foreground-subtle mb-2`,children:`CapabilityBadges`}),r(i,{capabilities:[`streaming`,`detection`,`recording`,`audio`]})]})]})}),r(c,{title:`Cards`,children:t(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[t(`div`,{className:`rounded-lg bg-surface p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Surface card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `bg-surface`. Default card background."})]}),t(`div`,{className:`rounded-lg border border-border bg-surface p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Bordered card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `border border-border bg-surface`."})]}),t(`div`,{className:`rounded-lg border border-primary/30 bg-primary/5 p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-primary mb-1`,children:`Accent card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:`Highlighted with primary color.`})]}),t(`div`,{className:`rounded-lg bg-background p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Background card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `bg-background`. Inset card."})]})]})}),r(c,{title:`Provider Icons`,children:r(`div`,{className:`flex flex-wrap gap-4`,children:[`frigate`,`scrypted`,`reolink`,`homeassistant`,`rtsp`,`onvif`].map(e=>r(a,{type:e,size:`lg`,showLabel:!0},e))})}),t(c,{title:`Form Builder Demo`,children:[r(o,{schema:u,values:e,onChange:d}),t(`details`,{className:`mt-3`,children:[r(`summary`,{className:`text-[10px] text-foreground-subtle cursor-pointer hover:text-foreground`,children:`View current values`}),r(`pre`,{className:`mt-2 rounded-md bg-background p-3 text-[10px] text-foreground-subtle overflow-auto`,children:JSON.stringify(e,null,2)})]})]}),r(c,{title:`Info Boxes`,children:r(`div`,{className:`space-y-2`,children:[{variant:`info`,label:`Info`,content:`This is an informational message. Use it for tips and hints.`},{variant:`warning`,label:`Warning`,content:`This action may have side effects. Proceed with caution.`},{variant:`success`,label:`Success`,content:`Operation completed successfully. All systems are green.`},{variant:`danger`,label:`Danger`,content:`This operation is irreversible. Data will be permanently deleted.`}].map(({variant:e,label:n,content:i})=>{let a={info:{border:`border-info`,bg:`bg-info/5`,text:`text-info`},warning:{border:`border-warning`,bg:`bg-warning/5`,text:`text-warning`},success:{border:`border-success`,bg:`bg-success/5`,text:`text-success`},danger:{border:`border-danger`,bg:`bg-danger/5`,text:`text-danger`}}[e];return t(`div`,{className:`rounded-md border-l-4 px-3 py-2.5 ${a.border} ${a.bg}`,children:[r(`p`,{className:`text-xs font-semibold mb-0.5 ${a.text}`,children:n}),r(`p`,{className:`text-xs text-foreground-subtle leading-relaxed`,children:i})]},e)})})})]})}function f(){let[e,t]=n(!0);return r(`button`,{type:`button`,role:`switch`,"aria-checked":e,onClick:()=>t(e=>!e),className:[`relative inline-flex h-4 w-8 shrink-0 items-center rounded-full transition-colors duration-150 cursor-pointer`,e?`bg-primary`:`bg-foreground-subtle/30`].join(` `),children:r(`span`,{className:[`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform duration-150`,e?`translate-x-4`:`translate-x-0.5`].join(` `)})})}export{d as ShowroomPage};
@@ -1 +1 @@
1
- import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BBpdMDOB.js";import{t as e}from"./vite-preload-helper-zJ_50EbN.js";var t={"@camstack/sdk":async()=>await e(()=>import(`./dist-CYW0dAGQ.js`),[]),"@camstack/types":async()=>await e(()=>import(`./dist-D7nNU2QV.js`),[]),"@camstack/ui-library":async()=>await e(()=>import(`./src-DKAxBIDH.js`).then(e=>e.t),[]),"@tanstack/react-query":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js`).then(e=>e.y),[]),"@trpc/client":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-CSJxMxg6.js`).then(e=>e.A),[]),"@trpc/react-query":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-DkcC9IVF.js`).then(e=>e.r),[]),konva:async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare__konva__loadShare__.js-B7XYY0cV.js`).then(e=>e.n),[]),react:async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js`).then(e=>(e.et(),e.$)),[]),"react-dom":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-D9-wIasd.js`).then(e=>(e.a(),e.i)),[]),"react-dom/client":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DstpX0yz.js`).then(e=>e.r),[]),"react-konva":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.js-BBBrLLEa.js`).then(e=>e.u),[]),"react/jsx-runtime":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js`).then(e=>e.w),[])},n={"@camstack/sdk":{name:`@camstack/sdk`,version:`1.2.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@camstack/sdk`].loaded=!0;let{"@camstack/sdk":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^1.2.0`}},"@camstack/types":{name:`@camstack/types`,version:`1.2.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@camstack/types`].loaded=!0;let{"@camstack/types":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^1.2.0`}},"@camstack/ui-library":{name:`@camstack/ui-library`,version:`1.2.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@camstack/ui-library`].loaded=!0;let{"@camstack/ui-library":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^1.2.0`}},"@tanstack/react-query":{name:`@tanstack/react-query`,version:`5.101.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@tanstack/react-query`].loaded=!0;let{"@tanstack/react-query":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^5.101.0`}},"@trpc/client":{name:`@trpc/client`,version:`11.18.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@trpc/client`].loaded=!0;let{"@trpc/client":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^11.18.0`}},"@trpc/react-query":{name:`@trpc/react-query`,version:`11.18.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@trpc/react-query`].loaded=!0;let{"@trpc/react-query":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^11.18.0`}},konva:{name:`konva`,version:`10.3.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n.konva.loaded=!0;let{konva:e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^10.3.0`}},react:{name:`react`,version:`19.2.7`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n.react.loaded=!0;let{react:e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.7`}},"react-dom":{name:`react-dom`,version:`19.2.7`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`react-dom`].loaded=!0;let{"react-dom":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.7`}},"react-dom/client":{name:`react-dom/client`,version:`19.2.7`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`react-dom/client`].loaded=!0;let{"react-dom/client":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.7`}},"react-konva":{name:`react-konva`,version:`19.2.5`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`react-konva`].loaded=!0;let{"react-konva":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.5`}},"react/jsx-runtime":{name:`react/jsx-runtime`,version:`19.2.7`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`react/jsx-runtime`].loaded=!0;let{"react/jsx-runtime":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.7`}}},r=[];export{r as usedRemotes,n as usedShared};
1
+ import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BNFfTwsx.js";import{t as e}from"./vite-preload-helper-zJ_50EbN.js";var t={"@camstack/sdk":async()=>await e(()=>import(`./dist-DFASlyrs.js`),[]),"@camstack/types":async()=>await e(()=>import(`./dist-Dx_vZxMI.js`),[]),"@camstack/ui-library":async()=>await e(()=>import(`./src-CjlMsFRd.js`).then(e=>e.t),[]),"@tanstack/react-query":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js`).then(e=>e.y),[]),"@trpc/client":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-CSJxMxg6.js`).then(e=>e.A),[]),"@trpc/react-query":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-DkcC9IVF.js`).then(e=>e.r),[]),konva:async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare__konva__loadShare__.js-B7XYY0cV.js`).then(e=>e.n),[]),react:async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js`).then(e=>(e.et(),e.$)),[]),"react-dom":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-D9-wIasd.js`).then(e=>(e.a(),e.i)),[]),"react-dom/client":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DstpX0yz.js`).then(e=>e.r),[]),"react-konva":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.js-BBBrLLEa.js`).then(e=>e.u),[]),"react/jsx-runtime":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js`).then(e=>e.w),[])},n={"@camstack/sdk":{name:`@camstack/sdk`,version:`1.2.1`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@camstack/sdk`].loaded=!0;let{"@camstack/sdk":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^1.2.1`}},"@camstack/types":{name:`@camstack/types`,version:`1.2.1`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@camstack/types`].loaded=!0;let{"@camstack/types":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^1.2.1`}},"@camstack/ui-library":{name:`@camstack/ui-library`,version:`1.2.1`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@camstack/ui-library`].loaded=!0;let{"@camstack/ui-library":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^1.2.1`}},"@tanstack/react-query":{name:`@tanstack/react-query`,version:`5.101.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@tanstack/react-query`].loaded=!0;let{"@tanstack/react-query":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^5.101.0`}},"@trpc/client":{name:`@trpc/client`,version:`11.18.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@trpc/client`].loaded=!0;let{"@trpc/client":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^11.18.0`}},"@trpc/react-query":{name:`@trpc/react-query`,version:`11.18.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@trpc/react-query`].loaded=!0;let{"@trpc/react-query":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^11.18.0`}},konva:{name:`konva`,version:`10.3.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n.konva.loaded=!0;let{konva:e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^10.3.0`}},react:{name:`react`,version:`19.2.7`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n.react.loaded=!0;let{react:e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.7`}},"react-dom":{name:`react-dom`,version:`19.2.7`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`react-dom`].loaded=!0;let{"react-dom":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.7`}},"react-dom/client":{name:`react-dom/client`,version:`19.2.7`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`react-dom/client`].loaded=!0;let{"react-dom/client":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.7`}},"react-konva":{name:`react-konva`,version:`19.2.5`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`react-konva`].loaded=!0;let{"react-konva":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.5`}},"react/jsx-runtime":{name:`react/jsx-runtime`,version:`19.2.7`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`react/jsx-runtime`].loaded=!0;let{"react/jsx-runtime":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.7`}}},r=[];export{r as usedRemotes,n as usedShared};