@camstack/addon-admin-ui 1.2.110 → 1.2.111

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 (80) hide show
  1. package/dist/assets/{AddLocationWizard-B2pYT5l3.js → AddLocationWizard-CEgiBGeK.js} +1 -1
  2. package/dist/assets/{AddonCollectionPage-BM--U5wi.js → AddonCollectionPage-DH55gIbE.js} +1 -1
  3. package/dist/assets/{Addons-C1fP2vbH.js → Addons-CGooWY5T.js} +1 -1
  4. package/dist/assets/{AdminTabs-CLeY5YpY.js → AdminTabs-CR-73Caj.js} +1 -1
  5. package/dist/assets/{AiProfiles-B4OqaOyL.js → AiProfiles-9KKYGhmH.js} +1 -1
  6. package/dist/assets/{BrokerForm-BBcYgkU0.js → BrokerForm-5ka8xuo5.js} +1 -1
  7. package/dist/assets/{Build-Clz-9wEa.js → Build-NmOv_ttA.js} +1 -1
  8. package/dist/assets/{Capabilities-GMmZShHl.js → Capabilities-D8IlmLou.js} +1 -1
  9. package/dist/assets/{CapabilityBadges-ls5u4iSS.js → CapabilityBadges-CXpMHOmO.js} +1 -1
  10. package/dist/assets/{Cluster-B0miuhVw.js → Cluster-DbR9yx2R.js} +1 -1
  11. package/dist/assets/{Data-BsJaaX8N.js → Data-Do5W9Wl2.js} +1 -1
  12. package/dist/assets/{DetectionIntelligence-DwAMtJfh.js → DetectionIntelligence-03FqDXd8.js} +1 -1
  13. package/dist/assets/{DeviceAggregateSection-CfbUJ--n.js → DeviceAggregateSection-DijwEDkL.js} +1 -1
  14. package/dist/assets/{DeviceDetail-kxj_2AT4.js → DeviceDetail-B9IIayJd.js} +1 -1
  15. package/dist/assets/{Devices-CrvA2yT8.js → Devices-CLzII3FS.js} +1 -1
  16. package/dist/assets/Events-zRoA9Jz6.js +1 -0
  17. package/dist/assets/{FormBuilder-Sl0aUAjm.js → FormBuilder-DobHTqPD.js} +1 -1
  18. package/dist/assets/{Identity-3wRL60eh.js → Identity-BxhLyy_z.js} +1 -1
  19. package/dist/assets/{IntegrationDetail-DYdXG7zw.js → IntegrationDetail-C-Il9aYL.js} +1 -1
  20. package/dist/assets/{Integrations-DWirlHH2.js → Integrations-C6zctJcf.js} +1 -1
  21. package/dist/assets/{Integrations-GhhEgWTs.js → Integrations-CSyV2oCS.js} +1 -1
  22. package/dist/assets/{Logs-OCVO9mBC.js → Logs-k2AatW44.js} +1 -1
  23. package/dist/assets/{MyAccess-C1FnwEV1.js → MyAccess-Df7ce85Y.js} +1 -1
  24. package/dist/assets/{Network-C1tyUle7.js → Network-NH7cqo5t.js} +1 -1
  25. package/dist/assets/{NodeAddonsSettingsPanel-C51CLAUV.js → NodeAddonsSettingsPanel-CZgCHLIC.js} +1 -1
  26. package/dist/assets/{NodeInferenceDevices-BheDiA_Y.js → NodeInferenceDevices-rr-TGfyF.js} +1 -1
  27. package/dist/assets/{Notifications-2oJHn7yF.js → Notifications-D1EmPjgE.js} +1 -1
  28. package/dist/assets/{Pipeline-BWgUjIBu.js → Pipeline-DrJnzJ9t.js} +1 -1
  29. package/dist/assets/{Plates-B1CFXuYH.js → Plates-6NNWxuhT.js} +1 -1
  30. package/dist/assets/{ProviderIcon-CSGCWRat.js → ProviderIcon-CvKyMo33.js} +1 -1
  31. package/dist/assets/{Recordings-CVBJ-fTE.js → Recordings-BWG4GaMv.js} +1 -1
  32. package/dist/assets/{ScanNetworkModal-DP3Q1lJf.js → ScanNetworkModal-lm518Ul1.js} +1 -1
  33. package/dist/assets/{Scenes-CMobnBno.js → Scenes-BK317X1w.js} +1 -1
  34. package/dist/assets/{Settings-Boxw0bXQ.js → Settings-DgNT8lpk.js} +1 -1
  35. package/dist/assets/{Showroom-BLra8xK_.js → Showroom-CFtZjm_S.js} +1 -1
  36. package/dist/assets/{Terminal-DJKkbuyK.js → Terminal-N1q4JLrF.js} +1 -1
  37. package/dist/assets/{bell-ring-BrNXSpTM.js → bell-ring-Dc40Lz_m.js} +1 -1
  38. package/dist/assets/{boxes-BBQZcZmf.js → boxes-D_EBN2IO.js} +1 -1
  39. package/dist/assets/circle-check-big-BLcbyBkC.js +1 -0
  40. package/dist/assets/{circle-x-duYSDFk4.js → circle-x-9TEaOYMh.js} +1 -1
  41. package/dist/assets/clock-CmWJJCCR.js +1 -0
  42. package/dist/assets/{copy-sWO8ojL1.js → copy-2sJiEWo5.js} +1 -1
  43. package/dist/assets/{debounced-invalidate-CsEaF8m7.js → debounced-invalidate-BPm0xQjE.js} +1 -1
  44. package/dist/assets/{download-BG5cgMLB.js → download-Bi9sN8UV.js} +1 -1
  45. package/dist/assets/{face-bbox-CuCo2m34.js → face-bbox-BiVLa1QE.js} +1 -1
  46. package/dist/assets/{index-TIovJNJd.js → index-BWNViBw0.js} +2 -2
  47. package/dist/assets/{index-2B_jjVhf.css → index-CChcWx2e.css} +1 -1
  48. package/dist/assets/{key-round-DFB6Ddil.js → key-round-Cwk2sFDK.js} +1 -1
  49. package/dist/assets/{layers-Dg2FntHR.js → layers-Bkhxc8O8.js} +1 -1
  50. package/dist/assets/{mf-entry-bootstrap-0-78ce8935.js → mf-entry-bootstrap-0-767fb92e.js} +1 -1
  51. package/dist/assets/{pencil-DfqU4z4Q.js → pencil-BF1cI2bF.js} +1 -1
  52. package/dist/assets/play-DrhkSF52.js +1 -0
  53. package/dist/assets/plus-BNmythl0.js +1 -0
  54. package/dist/assets/power-bOdAXjkP.js +1 -0
  55. package/dist/assets/{radio-PpN-ewHt.js → radio-BWOwFRH2.js} +1 -1
  56. package/dist/assets/{refresh-cw-BP3l62v-.js → refresh-cw-D7w1H6wV.js} +1 -1
  57. package/dist/assets/rotate-ccw-BSwQUT3g.js +1 -0
  58. package/dist/assets/rotate-cw-C-Y0NZbw.js +1 -0
  59. package/dist/assets/{send-BhFSH1Dx.js → send-MJzFX77B.js} +1 -1
  60. package/dist/assets/{server-DTziPc-j.js → server-DhlXaMrU.js} +1 -1
  61. package/dist/assets/{shield-DloVBwF4.js → shield-CAl6DSIT.js} +1 -1
  62. package/dist/assets/square-DmrJdKXC.js +1 -0
  63. package/dist/assets/{square-check-big-DCkSuowJ.js → square-check-big-Bh9qEI5Y.js} +1 -1
  64. package/dist/assets/{star-mh10UPuW.js → star-BLl-AYwU.js} +1 -1
  65. package/dist/assets/{undo-2-BdzAmJva.js → undo-2-DY_9xHcZ.js} +1 -1
  66. package/dist/assets/{video-B8iXv4k7.js → video-B4mg6mWU.js} +1 -1
  67. package/dist/assets/{wifi-CA7EJ_s4.js → wifi-ywTK10OM.js} +1 -1
  68. package/dist/assets/{zap-Bm8mq3x-.js → zap-BCx1At6u.js} +1 -1
  69. package/dist/index.html +3 -3
  70. package/dist/server/addon.js +1 -1
  71. package/package.json +1 -1
  72. package/dist/assets/Events-C0HDOEKf.js +0 -1
  73. package/dist/assets/circle-check-big-BA325w7j.js +0 -1
  74. package/dist/assets/clock-C2SeIGR3.js +0 -1
  75. package/dist/assets/play-B850xDzN.js +0 -1
  76. package/dist/assets/plus-C1RBhRwm.js +0 -1
  77. package/dist/assets/power-DSSFcNbH.js +0 -1
  78. package/dist/assets/rotate-ccw-BiOviRuW.js +0 -1
  79. package/dist/assets/rotate-cw-PvJE7LD3.js +0 -1
  80. package/dist/assets/square-BxxA8zwF.js +0 -1
@@ -1 +1 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]);export{t};
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]);export{t};
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]);export{t};
@@ -16,4 +16,4 @@ const __mfImport = (src) =>
16
16
  await __mfHostInit.__tla;
17
17
  const { initHost } = __mfHostInit;
18
18
  await initHost();
19
- })().then(() => __mfImport("./index-TIovJNJd.js"));
19
+ })().then(() => __mfImport("./index-BWNViBw0.js"));
@@ -1 +1 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);export{t};
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`radio`,[[`path`,{d:`M4.9 19.1C1 15.2 1 8.8 4.9 4.9`,key:`1vaf9d`}],[`path`,{d:`M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5`,key:`u1ii0m`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5`,key:`1j5fej`}],[`path`,{d:`M19.1 4.9C23 8.8 23 15.1 19.1 19`,key:`10b0cb`}]]);export{t};
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`radio`,[[`path`,{d:`M4.9 19.1C1 15.2 1 8.8 4.9 4.9`,key:`1vaf9d`}],[`path`,{d:`M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5`,key:`u1ii0m`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5`,key:`1j5fej`}],[`path`,{d:`M19.1 4.9C23 8.8 23 15.1 19.1 19`,key:`10b0cb`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),n=e(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]);export{t as n,n as t};
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),n=e(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]);export{t as n,n as t};
@@ -1 +1 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]);export{t};
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]);export{t};
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`square-check-big`,[[`path`,{d:`M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5`,key:`1uzm8b`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]);export{t};
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`square-check-big`,[[`path`,{d:`M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5`,key:`1uzm8b`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]);export{t};
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]);export{t};
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`mic`,[[`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`,key:`131961`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}]]),n=e(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]);export{t as n,n as t};
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`mic`,[[`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`,key:`131961`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}]]),n=e(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]);export{t as n,n as t};
@@ -1 +1 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]);export{t};
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);export{t};
1
+ import{K as e}from"./index-BWNViBw0.js";var t=e(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);export{t};
package/dist/index.html CHANGED
@@ -99,13 +99,13 @@
99
99
  })
100
100
  })()
101
101
  </script>
102
- <script type="module" crossorigin src="/assets/mf-entry-bootstrap-0-78ce8935.js"></script>
102
+ <script type="module" crossorigin src="/assets/mf-entry-bootstrap-0-767fb92e.js"></script>
103
103
  <link rel="modulepreload" crossorigin href="/assets/__vite-browser-external-B6qJ4svC.js">
104
104
  <link rel="modulepreload" crossorigin href="/assets/src-Db_n2ue2.js">
105
105
  <link rel="modulepreload" crossorigin href="/assets/player-overlays-BrCS3AFF.js">
106
106
  <link rel="modulepreload" crossorigin href="/assets/src-CTpgEWRF.js">
107
- <link rel="stylesheet" crossorigin href="/assets/index-2B_jjVhf.css">
108
- <link rel="modulepreload" crossorigin href="/assets/hostInit-BXhxZCos.js"><link rel="modulepreload" crossorigin href="/assets/index-TIovJNJd.js"><link rel="modulepreload" crossorigin href="/assets/remoteEntry-y4f0U6fp.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-MSGGSFff.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-8kv6pj9W.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-DX7sYWrs.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-BsvPG3BX.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DtoGixA1.js"></head>
107
+ <link rel="stylesheet" crossorigin href="/assets/index-CChcWx2e.css">
108
+ <link rel="modulepreload" crossorigin href="/assets/hostInit-BXhxZCos.js"><link rel="modulepreload" crossorigin href="/assets/index-BWNViBw0.js"><link rel="modulepreload" crossorigin href="/assets/remoteEntry-y4f0U6fp.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-MSGGSFff.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-8kv6pj9W.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-DX7sYWrs.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-BsvPG3BX.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DtoGixA1.js"></head>
109
109
  <body>
110
110
  <div id="root"></div>
111
111
  <!-- Lock the app shell at 1x zoom. iOS Safari ignores `user-scalable=no`
@@ -35936,7 +35936,7 @@ var AdminUIAddon = class extends BaseAddon {
35936
35936
  capability: adminUiCapability,
35937
35937
  provider: {
35938
35938
  getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
35939
- getVersion: async () => ({ version: "1.2.110" })
35939
+ getVersion: async () => ({ version: "1.2.111" })
35940
35940
  }
35941
35941
  }];
35942
35942
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-admin-ui",
3
- "version": "1.2.110",
3
+ "version": "1.2.111",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Admin UI — Vite frontend build and server-side addon",
@@ -1 +0,0 @@
1
- import{I as e,K as t,Q as n,S as r,U as i,W as a,a as o,b as s,i as c,o as l,q as u,x as d,z as f}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{Z as p}from"./player-overlays-BrCS3AFF.js";import{Ca as m,Da as h,Dt as g,Ea as _,Ft as v,Hr as y,It as b,Lt as x,Ps as S,Pt as C,Rs as w,Rt as T,Ta as E,Tt as D,Xt as O,Yi as k,_a as A,ba as j,da as M,fn as N,ha as P,j as F,kn as I,la as L,ma as ee,pa as R,pn as z,sa as te,ua as B,va as ne,wa as V,xa as H,ya as re}from"./src-CTpgEWRF.js";import{Vt as U,at as W}from"./src-Db_n2ue2.js";import{t as ie}from"./clock-C2SeIGR3.js";import{t as G}from"./copy-sWO8ojL1.js";import{t as ae}from"./download-BG5cgMLB.js";import{a as oe,c as se,d as ce,f as le,i as ue,m as de,n as fe,o as pe,p as me,r as he,s as ge,t as _e}from"./debounced-invalidate-CsEaF8m7.js";import{t as ve}from"./refresh-cw-BP3l62v-.js";import{t as ye}from"./square-check-big-DCkSuowJ.js";import{t as be}from"./square-BxxA8zwF.js";import{t as xe}from"./star-mh10UPuW.js";import{t as Se}from"./undo-2-BdzAmJva.js";import{C as K,G as Ce,I as we,K as q,O as Te,P as Ee,R as De,c as Oe,o as ke,p as Ae,r as je,t as Me,z as Ne}from"./index-TIovJNJd.js";import{t as Pe}from"./AdminPage-CCD07UMs.js";import{i as Fe,n as Ie,t as Le}from"./authed-media-BPd_L9jr.js";import{t as Re}from"./AdminTabs-CLeY5YpY.js";var ze=q(`arrow-down-wide-narrow`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h10`,key:`1w87gc`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}]]),Be=q(`bug`,[[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M9 7.13v-1a3.003 3.003 0 1 1 6 0v1`,key:`d7y7pr`}],[`path`,{d:`M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6`,key:`xs1cw7`}],[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M6.53 9C4.6 8.8 3 7.1 3 5`,key:`32zzws`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`M3 21c0-2.1 1.7-3.9 3.8-4`,key:`4p0ekp`}],[`path`,{d:`M20.97 5c0 2.1-1.6 3.8-3.5 4`,key:`18gb23`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M17.2 17c2.1.1 3.8 1.9 3.8 4`,key:`k3fwyw`}]]),Ve=q(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),He=q(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ue=q(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),We=q(`graduation-cap`,[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]),Ge=q(`square-parking`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 17V7h4a3 3 0 0 1 0 6H9`,key:`1dfk2c`}]]),Ke=q(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]);n();var qe=`pipeline-analytics`,Je=`debug.listTracks`,Ye=`debug.analyze`,Xe=`/addon/pipeline-analytics/debug-export`;function Ze(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Qe(e,t){let n=e[t];return typeof n==`string`?n:null}function J(e,t){let n=e[t];return typeof n==`number`&&Number.isFinite(n)?n:null}function $e(e,t){let n=e[t];return typeof n==`boolean`?n:null}function et(e){return e===`error`||e===`warn`||e===`info`}function tt(e){if(!Ze(e))return null;let t=Qe(e,`code`),n=Qe(e,`detail`),r=e.severity;return t===null||n===null||!et(r)?null:{code:t,severity:r,detail:n}}function nt(e){if(!Ze(e))return null;let t=Qe(e,`trackId`),n=J(e,`deviceId`),r=Qe(e,`className`),i=J(e,`firstSeen`),a=J(e,`lastSeen`),o=J(e,`durationMs`),s=$e(e,`active`);if(t===null||n===null||r===null||i===null||a===null||o===null||s===null)return null;let c=Qe(e,`label`);return{trackId:t,deviceId:n,className:r,...c===null?{}:{label:c},firstSeen:i,lastSeen:a,durationMs:o,active:s}}function rt(e){let t=nt(e);if(t===null||!Ze(e))return null;let n=J(e,`mediaCount`),r=J(e,`eventCount`),i=J(e,`positionCount`);if(n===null||r===null||i===null)return null;let a=e.mediaKinds,o=e.findings;if(!Array.isArray(a)||!Array.isArray(o))return null;let s=a.filter(e=>typeof e==`string`),c=[];for(let e of o){let t=tt(e);t!==null&&c.push(t)}return{...t,mediaCount:n,mediaKinds:s,eventCount:r,positionCount:i,findings:c}}function it(e){if(!Ze(e))return null;let t=$e(e,`truncated`),n=e.tracks;if(t===null||!Array.isArray(n))return null;let r=[];for(let e of n){let t=nt(e);if(t===null)return null;r.push(t)}return{tracks:r,truncated:t}}function at(e){if(!Ze(e))return null;let t=e.reports,n=e.vanished;if(!Array.isArray(t)||!Array.isArray(n))return null;let r=[];for(let e of t){let t=rt(e);if(t===null)return null;r.push(t)}return{reports:r,vanished:n.filter(e=>typeof e==`string`)}}var ot={MEDIA_EVICTED_OR_NEVER:`no media`,MISSING_KEYFRAME:`no keyframe`,MISSING_FIRSTFRAME:`no first frame`,MISSING_LASTFRAME:`no last frame`,MISSING_THUMBNAIL:`no thumbnail`,MISSING_BEST_CROP:`no crop`,SHORT_TRACK:`very short`,ZERO_EVENTS:`no events`,ZERO_POSITIONS:`no trajectory`,NO_PERIODIC_SNAPSHOTS:`no snapshots`,LASTFRAME_STALE:`stale last frame`,MEDIA_STOPPED_EARLY:`media stopped early`,NO_BEST_EVENT:`no best event`,LOW_BEST_SCORE:`low score`};function st(e){return ot[e]??e}var ct={error:0,warn:1,info:2};function lt(e){return e.toSorted((e,t)=>ct[e.severity]-ct[t.severity]||e.code.localeCompare(t.code))}function ut(e){return e.length===0?Xe:`${Xe}?deviceIds=${e.join(`,`)}`}function dt(e){if(e<1e4)return`${(e/1e3).toFixed(1)}s`;let t=Math.round(e/1e3);if(t<60)return`${String(t)}s`;let n=Math.floor(t/60);return`${String(n)}m ${String(t%60).padStart(2,`0`)}s`}var ft=`all`,pt=`The server answered in a shape this build does not understand.`,mt={error:`danger`,warn:`warning`,info:`info`};function ht({findings:e}){return e.length===0?d(x,{variant:`success`,children:`no anomaly found`}):d(`div`,{className:`flex flex-wrap gap-1`,children:lt(e).map(e=>d(x,{variant:mt[e.severity],title:e.detail,children:st(e.code)},e.code))})}function gt({track:e,report:t,cameraName:n,analyzing:i}){return r(`div`,{className:`flex flex-col gap-1.5 border-b border-border px-3 py-2.5 last:border-b-0`,children:[r(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[d(`span`,{className:`font-medium text-foreground`,children:n}),d(`span`,{className:`text-foreground-subtle`,children:e.label??e.className}),r(`span`,{className:`text-foreground-subtle`,children:[new Date(e.lastSeen).toLocaleString(),` · `,dt(e.durationMs)]}),e.active&&d(x,{variant:`default`,children:`still open`}),t!==void 0&&r(`span`,{className:`text-foreground-subtle`,children:[String(t.mediaCount),` media · `,String(t.eventCount),` events ·`,` `,String(t.positionCount),` positions`]})]}),d(`div`,{className:`flex items-center gap-2`,children:t===void 0?d(`span`,{className:`text-xs text-foreground-subtle`,children:i?`analysing…`:`not analysed`}):d(ht,{findings:t.findings})}),d(`code`,{className:`text-[10px] text-foreground-subtle`,children:e.trackId})]})}function _t(){let e=p(),[t,n]=u(ft),[i,s]=u(!1),[c,l]=u(null),f=y({isCamera:!0,projection:`slim`}),m=a(()=>[{value:ft,label:`All cameras`},...(f.data??[]).map(e=>({value:String(e.id),label:e.name}))],[f.data]),h=a(()=>{let e=new Map;for(let t of f.data??[])e.set(t.id,t.name);return e},[f.data]),g=a(()=>t===ft?[]:[Number.parseInt(t,10)],[t]),_=o({queryKey:[`events-debug`,`list`,g],queryFn:async()=>it(await e.trpcClient.addons.custom.mutate({addonId:qe,action:Je,input:g.length===0?{}:{deviceIds:g}}))}),v=a(()=>(_.data?.tracks??[]).map(e=>e.trackId),[_.data]),x=o({queryKey:[`events-debug`,`analyze`,v],enabled:v.length>0,queryFn:async()=>at(await e.trpcClient.addons.custom.mutate({addonId:qe,action:Ye,input:{trackIds:v}}))}),S=a(()=>{let e=new Map;for(let t of x.data?.reports??[])e.set(t.trackId,t);return e},[x.data]),w=()=>{_.refetch(),x.refetch()},E=async()=>{s(!0),l(null);try{await Ie(ut(g),`camstack-debug.zip`)}catch(e){l(e instanceof Error?e.message:`Export failed.`)}finally{s(!1)}},D=_.data?.tracks??[],k=_.data===null||x.data===null;return d(Pe,{children:r(`section`,{className:`space-y-3`,children:[r(`div`,{className:`flex flex-wrap items-center gap-2`,children:[d(`div`,{className:`w-44`,children:d(C,{value:t,options:m,onChange:e=>n(e.target.value)})}),r(T,{variant:`secondary`,onClick:w,disabled:_.isFetching,children:[_.isFetching?d(K,{className:`h-3.5 w-3.5 animate-spin`}):d(ve,{className:`h-3.5 w-3.5`}),`Refresh`]}),r(T,{onClick:()=>void E(),disabled:i||D.length===0,children:[i?d(K,{className:`h-3.5 w-3.5 animate-spin`}):d(ae,{className:`h-3.5 w-3.5`}),`Export all (`,String(D.length),`)`]})]}),r(`p`,{className:`text-xs text-foreground-subtle`,children:[`A `,d(`code`,{children:`debug`}),` mark does not pin retention — this lists the marked tracks that still exist. A track whose media was evicted shows as missing media.`]}),_.isError&&d(O,{message:`Could not load the marked tracks.`}),k&&!_.isError&&d(O,{message:pt}),c!==null&&d(O,{message:c}),_.data?.truncated===!0&&d(O,{message:`A camera filled the per-camera cap — some marked tracks are not listed. Un-mark a few, or filter to one camera.`}),(x.data?.vanished.length??0)>0&&r(`p`,{className:`text-xs text-foreground-subtle`,children:[String(x.data?.vanished.length),` marked track(s) were evicted between the list and the analysis.`]}),d(b,{children:_.isLoading?d(`div`,{className:`px-3 py-6 text-center text-xs text-foreground-subtle`,children:`Loading…`}):D.length===0?r(`div`,{className:`flex flex-col items-center gap-2 px-3 py-8 text-center`,children:[d(Be,{className:`h-5 w-5 text-foreground-subtle`}),d(`p`,{className:`text-xs text-foreground-subtle`,children:`No track is marked for debug. Mark one from a track's actions to see it here.`})]}):D.map(e=>d(gt,{track:e,report:S.get(e.trackId),cameraName:h.get(e.deviceId)??`Camera ${String(e.deviceId)}`,analyzing:x.isFetching},e.trackId))})]})})}function vt(e){return e.subLabel??e.label}var yt=720*60*60*1e3;function bt(e){let t=[];for(let n of e)t.push(...n);return t}function xt(e,t){let n=[...e];return n.sort((e,n)=>t===`importance`?n.importance-e.importance:n.timestamp-e.timestamp),n}function St(e,t){return e.filter(e=>!(e.importance<t.minImportance||t.cameras.size>0&&!t.cameras.has(e.deviceId)||t.classes.size>0&&!t.classes.has(e.className)))}function Ct(e,t){return`${String(e)}:${t}`}function wt(e,t){let n=new Map,r=new Set;for(let i of e){let e=Ct(i.deviceId,i.trackId);if(!t.has(e)||r.has(e))continue;r.add(e);let a=n.get(i.deviceId);a?a.push(i.trackId):n.set(i.deviceId,[i.trackId])}return n}function Tt(e,t){return{since:e.fromMs??t-yt,until:e.toMs??t}}var Y=typeof L==`function`,Et=`Track deletion arrives with the next server update`;function Dt(){return{mutateAsync:async()=>{throw Error(`deleteTracks unavailable`)},isPending:!1}}var Ot=Y?L:Dt,kt=200,At=3e4;function jt(e){let t=p(),n=c({queries:e.deviceIds.map(n=>({queryKey:[`events-feed`,n,e.since,e.until,e.minImportance??null,e.classFilter??null],staleTime:At,refetchInterval:At,queryFn:async()=>(await t.trpcClient.pipelineAnalytics.getKeyEvents.query({deviceId:n,since:e.since,until:e.until,limit:kt,...e.minImportance===void 0?{}:{minImportance:e.minImportance},...e.classFilter===void 0?{}:{classFilter:e.classFilter}})).map(e=>({...e,deviceId:n}))}))});return{rows:xt(bt(n.map(e=>e.data??[])),`importance`),isLoading:n.some(e=>e.isLoading)}}n();var Mt=[`events-feed`],Nt=2e3;function Pt(n){let r=l(),i=n?.paused===!0,a=t(r);a.current=r;let o=t(i);o.current=i;let[s,c]=u(!1),d=e(()=>{a.current.invalidateQueries({queryKey:Mt})},[]),p=t(void 0);p.current||=_e({delayMs:Nt,invalidate:()=>{o.current?c(!0):d()}}),f(()=>()=>p.current?.cancel(),[]),f(()=>{i||!s||(c(!1),d())},[i,s,d]);let m=e(()=>{c(!1),d()},[d]);return w(U.PipelineAnalyticsDetectionEvent,()=>{p.current?.trigger()}),w(U.PipelineAnalyticsTrackEnded,()=>{p.current?.trigger()}),{pending:s,refreshNow:m}}n();function Ft({groups:e,selected:t,onChange:n,loading:i=!1}){let{t:o}=Me(),[s,c]=u(!1),[l,f]=u(``),[p,m]=u(new Set),h=l.trim().toLowerCase(),g=e=>h.length===0||N(e,o).toLowerCase().includes(h),_=a(()=>e.map(e=>({macro:e.macro,subs:e.subs.filter(t=>g(t)||g(e.macro))})).filter(e=>g(e.macro)||e.subs.length>0),[e,h]),v=e=>m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),y=e=>{let r=new Set(t),i=t.has(e.macro.kind)&&e.subs.every(e=>t.has(e.kind)),a=[e.macro.kind,...e.subs.map(e=>e.kind)];if(i)for(let e of a)r.delete(e);else for(let e of a)r.add(e);n(r)},b=e=>{let r=new Set(t);r.has(e)?r.delete(e):r.add(e),n(r)},x=()=>n(new Set),S=t.size;return r(`div`,{className:`relative`,children:[r(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`flex items-center gap-1 rounded-md px-2.5 py-1 text-xs transition-colors ${S>0?`bg-primary/12 text-primary font-medium`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:[d(Ke,{className:`h-3.5 w-3.5`}),S>0?`Kinds (${String(S)})`:`Kinds`,d(De,{className:`h-3 w-3`})]}),s&&r(`div`,{className:`absolute z-20 mt-1 max-h-80 w-64 overflow-auto rounded-md border border-border bg-surface p-2 shadow-lg`,children:[r(`div`,{className:`mb-2 flex items-center gap-1 rounded border border-border px-1.5`,children:[d(Ae,{className:`h-3.5 w-3.5 text-foreground-subtle`}),d(`input`,{type:`text`,value:l,onChange:e=>f(e.target.value),placeholder:`Search kinds…`,className:`w-full bg-transparent py-1 text-xs outline-none`}),S>0&&d(`button`,{type:`button`,onClick:x,className:`text-[10px] text-foreground-subtle hover:text-foreground`,children:`Clear`})]}),_.length===0&&d(`div`,{className:`px-1 py-2 text-[11px] text-foreground-subtle`,children:i?`Loading kinds…`:h.length>0?`No kind matches that search.`:`These cameras advertise no event kinds.`}),_.map(e=>{let n=z(e.macro.iconId),i=p.has(e.macro.kind)||h.length>0,a=t.has(e.macro.kind);return r(`div`,{className:`mb-0.5`,children:[r(`div`,{className:`flex items-center gap-1`,children:[e.subs.length>0?d(`button`,{type:`button`,onClick:()=>v(e.macro.kind),className:`text-foreground-subtle hover:text-foreground`,"aria-label":`Expand`,children:d(i?De:we,{className:`h-3 w-3`})}):d(`span`,{className:`w-3`}),r(`label`,{className:`flex flex-1 cursor-pointer items-center gap-1.5 rounded px-1 py-0.5 text-xs hover:bg-surface-hover`,children:[d(`input`,{type:`checkbox`,checked:a,onChange:()=>y(e),className:`accent-primary`}),d(n,{className:`h-3.5 w-3.5`,style:{color:e.macro.color}}),d(`span`,{className:`font-medium`,children:N(e.macro,o)})]})]}),i&&e.subs.map(e=>{let n=z(e.iconId);return r(`label`,{className:`ml-5 flex cursor-pointer items-center gap-1.5 rounded px-1 py-0.5 text-xs hover:bg-surface-hover`,children:[d(`input`,{type:`checkbox`,checked:t.has(e.kind),onChange:()=>b(e.kind),className:`accent-primary`}),d(n,{className:`h-3.5 w-3.5`,style:{color:e.color}}),d(`span`,{children:N(e,o)})]},e.kind)})]},e.macro.kind)})]})]})}function It(e,t){let n=new Map;for(let r of e)if(!(t.size>0&&!t.has(r.deviceId)))for(let e of r.kinds)n.has(e.kind)||n.set(e.kind,e);return n}function Lt(e,t){return{...t,kind:e,labelKey:`eventKind.${e}`,label:e.charAt(0).toUpperCase()+e.slice(1),iconId:e,parentKind:null,level:`macro`}}var Rt=new Set([`detection`,`package`]);function zt(e,t){return[...It(e,t).values()].filter(e=>e.parentKind===null&&Rt.has(e.category)).sort((e,t)=>e.label.localeCompare(t.label))}function Bt(e,t){let n=It(e,t),r=new Map,i=new Map;for(let e of n.values()){if(e.parentKind===null){i.set(e.kind,e);continue}let t=r.get(e.parentKind);t===void 0?r.set(e.parentKind,[e]):t.push(e)}for(let[e,t]of r){if(i.has(e))continue;let n=t[0];n!==void 0&&i.set(e,Lt(e,n))}return[...i.values()].map(e=>({macro:e,subs:[...r.get(e.kind)??[]].sort((e,t)=>e.label.localeCompare(t.label))})).sort((e,t)=>e.macro.label.localeCompare(t.macro.label))}n();var Vt=1400,Ht=`Admin-gated URL — opens only inside an authenticated session`;function Ut({label:t,value:n,title:i}){let[a,o]=u(!1);return f(()=>{if(!a)return;let e=setTimeout(()=>o(!1),Vt);return()=>clearTimeout(e)},[a]),r(`button`,{type:`button`,onClick:e(()=>{(async()=>{try{await navigator.clipboard.writeText(n),o(!0)}catch{window.prompt(`Copy the media URL:`,n)}})()},[n]),title:i,"aria-label":`Copy ${t} URL`,className:`flex min-w-0 items-center gap-1 rounded border px-1.5 py-0.5 text-[10px] font-medium transition-colors ${a?`border-emerald-500/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:`border-border text-foreground-subtle hover:border-primary hover:text-foreground`}`,children:[d(a?Ne:G,{className:`h-2.5 w-2.5 shrink-0`}),d(`span`,{className:`truncate`,children:a?`Copied`:t})]})}function Wt({localUrl:e,publicUrl:t}){return r(`div`,{className:`flex flex-wrap gap-1`,children:[d(Ut,{label:`Local`,value:e,title:`Copy LAN URL — ${Ht}`}),t&&d(Ut,{label:`Public`,value:t,title:`Copy public URL — ${Ht}`})]})}var Gt={firstFrame:`First frame (track start)`,lastFrame:`Last frame (track end)`,thumbnail:`Best detection`,thumbnailSmall:`Best detection (480)`,snapshot:`Snapshot`,keyFrame:`Key frame (native-res)`,keyFrameSmall:`Key frame (960)`,crop:`Object crop`,fullFrame:`Full frame`,fullFrameBoxed:`Full frame (boxed)`,faceCrop:`Face crop`,plateCrop:`Plate crop`};function Kt(e){return e in Gt}function qt(e){return Kt(e)?Gt[e]:e}function Jt(e,t){return`${e}${Le}/${encodeURIComponent(t)}`}n();var Yt=3e4;function Xt(t){let[n,r]=u(null),i=e(e=>{r(t=>t??e)},[]);return f(()=>{t||r(null)},[t]),{publicOrigin:n,probes:t?d(Zt,{onOrigin:i}):null}}function Zt({onOrigin:e}){let{data:t}=I({capName:`network-access`});return d(s,{children:(t??[]).map(t=>d(Qt,{addonId:t.addonId,onOrigin:e},t.addonId))})}function Qt({addonId:e,onOrigin:t}){let{data:n}=k({addonId:e},{refetchInterval:Yt,retry:!1});return f(()=>{let e=n?W.safeParse(n):null,r=e?.success?e.data.endpoint?.url:void 0;if(r)try{t(new URL(r).origin)}catch{}},[n,t]),null}var $t=typeof h==`function`,en=`Track flags arrive with the next server update`;function tn(){return{mutateAsync:async()=>{throw Error(`setTrackFlags unavailable`)},isPending:!1}}var nn=$t?h:tn;function rn(e){if(typeof e!=`object`||!e||!(`trackId`in e)||!(`markForTrain`in e)||!(`debug`in e)||!(`favourited`in e))return null;let{trackId:t,markForTrain:n,debug:r,favourited:i}=e;return typeof t!=`string`||typeof n!=`boolean`||typeof r!=`boolean`||typeof i!=`boolean`?null:{trackId:t,markForTrain:n,debug:r,favourited:i}}n();function an({label:e,hint:t,checked:n,disabled:i,title:a,icon:o,onToggle:s}){return r(`button`,{type:`button`,role:`switch`,"aria-checked":n,"aria-label":e,disabled:i,title:a,onClick:s,className:`flex w-full items-center gap-2 rounded-md border px-2 py-1.5 text-left transition-colors disabled:opacity-50 ${n?`border-primary bg-primary/10`:`border-border bg-surface hover:bg-surface-hover`}`,children:[d(`span`,{className:n?`text-primary`:`text-foreground-subtle`,children:o}),r(`span`,{className:`min-w-0 flex-1`,children:[d(`span`,{className:`block text-[11px] font-medium text-foreground`,children:e}),d(`span`,{className:`block text-[10px] text-foreground-subtle`,children:t})]}),d(`span`,{"aria-hidden":`true`,className:`h-4 w-7 shrink-0 rounded-full p-0.5 transition-colors ${n?`bg-primary`:`bg-border`}`,children:d(`span`,{className:`block h-3 w-3 rounded-full bg-white transition-transform ${n?`translate-x-3`:``}`})})]})}function on({deviceId:e,trackId:t,markForTrain:n,debug:i,favourited:a,onChange:o}){let s=nn(),[c,l]=u(null),f=c?.markForTrain??n===!0,p=c?.debug??i===!0,m=c?.favourited??a===!0,h=!$t||s.isPending,g=$t?void 0:en,_=n=>{h||(async()=>{try{let r=rn(await s.mutateAsync({deviceId:e,trackId:t,flags:n}));if(!r)return;l(r),o?.(r)}catch(e){let t=e instanceof Error?e.message:``;window.alert(t===``?`Could not update this track. Check the server logs.`:`Could not update this track — ${t}`)}})()};return r(`div`,{className:`grid gap-1.5 sm:grid-cols-2`,children:[d(an,{label:`Mark for training`,hint:`Keeps this track and its media past retention`,checked:f,disabled:h,...g===void 0?{}:{title:g},icon:d(We,{className:`h-4 w-4`}),onToggle:()=>_({markForTrain:!f})}),d(an,{label:`Debug`,hint:`Flag this track for diagnostic attention`,checked:p,disabled:h,...g===void 0?{}:{title:g},icon:d(Be,{className:`h-4 w-4`}),onToggle:()=>_({debug:!p})}),d(an,{label:`Favourited`,hint:`Keeps this track and its media past retention`,checked:m,disabled:h,...g===void 0?{}:{title:g},icon:d(xe,{className:`h-4 w-4`}),onToggle:()=>_({favourited:!m})})]})}var X=100,sn=120,cn={polyline:``,points:[],snapshots:[],start:null,end:null,peakBox:null},Z=e=>e<0?0:e>1?1:e,Q=e=>Math.round(e*100)/100;function ln(e,t){if(e.length<=t)return[...e];let n=(e.length-1)/(t-1),r=[];for(let i=0;i<t;i++)r.push(e[Math.round(i*n)]);return r[r.length-1]=e[e.length-1],r}function un(e,t,n){if(e.length===0||t===null)return cn;let{width:r,height:i}=t;if(!Number.isFinite(r)||!Number.isFinite(i)||r<=0||i<=0)return cn;let a=ln(e,n?.maxPoints??sn).map(e=>({x:Q(Z(e.x/r)*X),y:Q(Z(e.y/i)*X)})),o=a[0]??null,s=a[a.length-1]??null,c=a.length>=2?a.map(e=>`${e.x},${e.y}`).join(` `):``,l=(n?.snapshots??[]).map(e=>({x:Q(Z(e.x/r)*X),y:Q(Z(e.y/i)*X),mediaKey:e.mediaKey})),u=null,d=-1;for(let t of e){let e=Z(t.bbox.w/r)*Z(t.bbox.h/i);e>d&&(d=e,u=t)}return{polyline:c,points:a,snapshots:l,start:o,end:s,peakBox:u?{x:Q(Z(u.bbox.x/r)*X),y:Q(Z(u.bbox.y/i)*X),w:Q(Z(u.bbox.w/r)*X),h:Q(Z(u.bbox.h/i)*X)}:null}}n();var dn=15e3;function fn(e){return`${Le}/${encodeURIComponent(e)}`}var pn=window.location.origin;function mn({mediaKey:e,label:t}){let{src:n,failed:r}=Fe(fn(e));return n===null?d(`div`,{className:`flex h-full w-full items-center justify-center bg-surface-hover`,children:r?d(de,{className:`h-4 w-4 text-foreground-subtle opacity-60`}):d(K,{className:`h-4 w-4 animate-spin text-foreground-subtle opacity-70`})}):d(`img`,{src:n,alt:t,className:`h-full w-full object-cover`})}var hn=new Set([`firstFrame`,`lastFrame`,`thumbnail`,`snapshot`]),gn=new Set([`keyFrame`,`fullFrame`,`fullFrameBoxed`,`firstFrame`,`lastFrame`,`thumbnail`,`snapshot`]);function _n(e){let[t,n]=u(null);return f(()=>{if(n(null),!e)return;let t=!1,r=new Image;return r.onload=()=>{t||n({width:r.naturalWidth,height:r.naturalHeight})},r.src=e,()=>{t=!0,r.onload=null}},[e]),t}function vn({overlay:e,onPickSnapshot:t}){return!e.polyline&&!e.peakBox&&e.snapshots.length===0?null:r(`svg`,{viewBox:`0 0 100 100`,preserveAspectRatio:`none`,className:`pointer-events-none absolute inset-0 h-full w-full`,children:[e.peakBox&&d(`rect`,{x:e.peakBox.x,y:e.peakBox.y,width:e.peakBox.w,height:e.peakBox.h,fill:`none`,stroke:`#f59e0b`,strokeWidth:2,vectorEffect:`non-scaling-stroke`,rx:1}),e.polyline&&d(`polyline`,{points:e.polyline,fill:`none`,stroke:`#38bdf8`,strokeWidth:2,strokeLinejoin:`round`,strokeLinecap:`round`,strokeOpacity:.85,vectorEffect:`non-scaling-stroke`}),e.points.map((e,t)=>d(`circle`,{cx:e.x,cy:e.y,r:1,fill:`#38bdf8`,fillOpacity:.6,vectorEffect:`non-scaling-stroke`},`${String(e.x)}-${String(e.y)}-${String(t)}`)),e.snapshots.map((e,n)=>d(`circle`,{cx:e.x,cy:e.y,r:1.9,fill:`#0ea5e9`,fillOpacity:.95,stroke:`#082f49`,strokeWidth:.7,vectorEffect:`non-scaling-stroke`,className:t?`pointer-events-auto cursor-pointer`:void 0,onClick:t?n=>{n.stopPropagation(),t(e.mediaKey)}:void 0,children:d(`title`,{children:`Snapshot checkpoint — click to view this frame`})},`snap-${e.mediaKey}-${String(n)}`)),e.start&&d(`circle`,{cx:e.start.x,cy:e.start.y,r:2.4,fill:`#22c55e`,stroke:`#052e16`,strokeWidth:.6,vectorEffect:`non-scaling-stroke`}),e.end&&d(`circle`,{cx:e.end.x,cy:e.end.y,r:2.4,fill:`#ef4444`,stroke:`#450a0a`,strokeWidth:.6,vectorEffect:`non-scaling-stroke`})]})}function $({label:e,value:t,mono:n}){return r(`div`,{className:`flex items-baseline justify-between gap-3 border-b border-border/60 py-1.5 last:border-0`,children:[d(`span`,{className:`shrink-0 text-[11px] uppercase tracking-wide text-foreground-subtle`,children:e}),d(`span`,{className:`min-w-0 truncate text-right text-xs font-medium text-foreground ${n?`font-mono text-[11px]`:``}`,title:t,children:t})]})}function yn({row:t,cameraName:n,deleteAvailable:i,onClose:o,onDeleted:c,onFlagsChanged:l}){let m=p(),h=Ot(),_=t!==null,v=t?.deviceId??0,y=t?.trackId??``,b=t?.bestEventId??``,x=t?.timestamp??0,C=t?.windowMs??0,{data:w}=ee({deviceId:v,trackId:y},{enabled:_}),{data:E}=j({trackId:y,deviceId:v},{enabled:_}),{data:O}=M({eventId:b,deviceId:v},{enabled:_&&b!==``}),{data:k}=S({deviceId:v,since:x-dn,until:x+C+dn},{enabled:_}),[A,N]=u(null),[P,F]=u(!1),{publicOrigin:I,probes:L}=Xt(_);f(()=>{N(null)},[v,y]);let R=a(()=>{let e=E??[],t=O??[];return e.find(e=>e.kind===`keyFrame`)||t.find(e=>e.kind===`fullFrameBoxed`)||([...t,...e].find(e=>e.kind===`crop`)??null)},[E,O]),z=A??R,te=Fe(z?fn(z.key):void 0),B=a(()=>{let e=new Set,t=[];for(let n of[...O??[],...E??[]])n.key===``||e.has(n.key)||(e.add(n.key),t.push(n));return t},[O,E]),ne=a(()=>B.find(e=>hn.has(e.kind))??null,[B]),V=_n(Fe(ne?fn(ne.key):void 0).src),H=a(()=>un(w?.positions??[],V,{snapshots:(w?.snapshots??[]).map(e=>({x:e.position.x,y:e.position.y,mediaKey:e.mediaKey}))}),[w?.positions,w?.snapshots,V]),re=e(e=>{let t=B.find(t=>t.key===e);t&&N(t)},[B]);if(t===null)return null;let U=te.src,W=z?.kind,ie=W!==void 0&&gn.has(W)&&V!==null&&(w?.positions.length??0)>=2,G=k&&k.length>0?k[0]:null,ae=()=>{G&&(F(!0),(async()=>{try{let e=await m.trpcClient.videoclips.getClipPlayback.query({deviceId:t.deviceId,clipId:G.id});window.open(e.playbackUrl,`_blank`,`noopener`)}catch{window.alert(`Could not resolve clip playback. Check the server logs.`)}finally{F(!1)}})())},oe=()=>{!i||h.isPending||window.confirm(`Delete this track and all its media? This cannot be undone.`)&&(async()=>{try{await h.mutateAsync({deviceId:t.deviceId,trackIds:[t.trackId]}),c()}catch{window.alert(`Failed to delete this track. Check the server logs.`)}})()},se=Math.round(t.importance*100),le=w?.importanceReason?`${String(se)}% · ${w.importanceReason}`:`${String(se)}%`,ue=w?.zonesVisited&&w.zonesVisited.length>0?w.zonesVisited.join(`, `):`—`,pe=w?.audioLabels&&w.audioLabels.length>0?w.audioLabels.map(e=>`${e.label} ×${String(e.count)} (${String(Math.round(e.peakScore*100))}%)`).join(` · `):`—`,he=w?w.totalDistance.toFixed(2):`—`,ge=me(w?w.firstSeen:x),_e=w?me(w.lastSeen):`—`;return d(D,{open:!0,onOpenChange:e=>!e&&o(),children:r(g,{width:`lg`,placement:`sheet-on-mobile`,"aria-label":`Event detail`,className:`flex h-[92dvh] flex-col gap-0 overflow-hidden p-0 bottom-0 left-0 right-0 top-auto w-full max-w-full translate-x-0 translate-y-0 rounded-b-none md:bottom-auto md:left-1/2 md:right-auto md:top-1/2 md:h-auto md:w-[calc(100vw-2rem)] md:max-w-xl md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-lg md:max-h-[calc(100dvh-2rem)]`,children:[r(`header`,{className:`flex shrink-0 items-start justify-between gap-2 border-b border-border px-4 py-3`,children:[r(`div`,{className:`min-w-0`,children:[r(`div`,{className:`truncate text-sm font-semibold text-foreground`,children:[t.className,vt(t)?r(`span`,{className:`text-foreground-subtle`,children:[` · `,vt(t)]}):null]}),d(`div`,{className:`mt-0.5 truncate text-[11px] text-foreground-subtle`,children:n})]}),d(`button`,{type:`button`,onClick:o,className:`rounded p-1 text-foreground-subtle hover:bg-surface-hover hover:text-foreground`,"aria-label":`Close`,children:d(je,{className:`h-4 w-4`})})]}),r(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto overscroll-contain px-4 py-3`,children:[U?d(`div`,{className:`overflow-hidden rounded-lg border border-border bg-background`,children:d(fe,{src:U,alt:`Key frame from ${n}`,fit:`natural`,className:`w-full`,overlay:ie?d(vn,{overlay:H,onPickSnapshot:re}):void 0})}):d(`div`,{className:`flex aspect-video w-full flex-col items-center justify-center gap-1.5 rounded-lg border border-border bg-surface-hover text-foreground-subtle`,children:te.failed?r(s,{children:[d(de,{className:`h-8 w-8 opacity-60`}),d(`span`,{className:`text-[11px]`,children:`Key-frame media unavailable`})]}):d(K,{className:`h-6 w-6 animate-spin opacity-70`})}),B.length>0&&d(`div`,{className:`-mx-1 flex gap-2 overflow-x-auto px-1 pb-1`,children:B.map(e=>{let t=qt(e.kind),n=Jt(pn,e.key),i=I?Jt(I,e.key):null;return r(`figure`,{className:`flex w-32 shrink-0 flex-col gap-1`,children:[d(`button`,{type:`button`,onClick:()=>N(e),className:`relative h-16 w-full overflow-hidden rounded border border-border hover:border-primary`,title:`${t} · ${me(e.timestamp)}`,children:d(mn,{mediaKey:e.key,label:t})}),r(`figcaption`,{className:`min-w-0 px-0.5`,children:[d(`div`,{className:`truncate text-[10px] font-medium leading-tight text-foreground`,title:t,children:t}),d(`div`,{className:`text-[10px] leading-tight text-foreground-subtle`,title:me(e.timestamp),children:ce(e.timestamp)})]}),d(Wt,{localUrl:n,publicUrl:i})]},e.key)})}),L,G&&r(T,{variant:`secondary`,onClick:ae,disabled:P,children:[P?d(K,{className:`h-3.5 w-3.5 animate-spin`}):d(Te,{className:`h-3.5 w-3.5`}),` `,`View clip`]}),d(on,{deviceId:t.deviceId,trackId:t.trackId,...(w?.markForTrain??t.markForTrain)===void 0?{}:{markForTrain:w?.markForTrain??t.markForTrain},...(w?.debug??t.debug)===void 0?{}:{debug:w?.debug??t.debug},...(w?.favourited??t.favourited)===void 0?{}:{favourited:w?.favourited??t.favourited},onChange:l}),r(`div`,{className:`rounded-lg border border-border bg-surface px-3 py-1`,children:[d($,{label:`Camera`,value:n}),d($,{label:`Class`,value:t.className}),d($,{label:`Label`,value:t.label??`—`}),d($,{label:`Sub-label`,value:t.subLabel??`—`}),d($,{label:`Importance`,value:le}),d($,{label:`Zones visited`,value:ue}),d($,{label:`Audio heard`,value:pe}),d($,{label:`Total distance`,value:he}),d($,{label:`First seen`,value:ge}),d($,{label:`Last seen`,value:_e}),d($,{label:`Track`,value:t.trackId,mono:!0})]})]}),d(`footer`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-border px-4 py-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]`,children:d(`span`,{title:i?void 0:Et,children:r(T,{variant:`secondary`,onClick:oe,disabled:!i||h.isPending,children:[h.isPending?d(K,{className:`h-3.5 w-3.5 animate-spin`}):d(ke,{className:`h-3.5 w-3.5`}),` `,`Delete track`]})})})]})})}function bn(e){if(e===void 0||!Number.isFinite(e)||e<=0)return``;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let n=Math.floor(t/60),r=Math.round(t%60);return`${String(n)}m ${String(r).padStart(2,`0`)}s`}function xn({row:e,cameraName:t,nowMs:n,onOpenDetail:i,selected:a=!1,onToggleSelect:o,score:s}){let c=Fe(e.bestEventId?`${Le}/${e.bestEventId}`:void 0),l=Math.round(e.importance*100),u=s===void 0?void 0:Math.round(s*100),f=bn(e.windowMs),p=()=>i(e);return r(`div`,{className:`relative flex flex-col rounded-md border bg-surface overflow-hidden ${a?`border-primary ring-1 ring-primary`:`border-border`}`,children:[r(`div`,{className:`aspect-video relative overflow-hidden bg-surface-hover`,children:[c.src?d(`img`,{src:c.src,alt:`Event from ${t}`,onClick:p,className:`h-full w-full cursor-zoom-in object-cover`}):d(`button`,{type:`button`,onClick:p,className:`flex h-full w-full flex-col items-center justify-center gap-1 bg-surface-hover text-foreground-subtle`,title:c.failed?`Key-event media unavailable`:`No key-event media`,children:d(de,{className:`h-6 w-6 opacity-60`})}),o&&d(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),o(Ct(e.deviceId,e.trackId))},className:`absolute left-0 top-0 z-10 rounded-br-md bg-black/50 p-1.5 text-white hover:bg-black/70`,"aria-label":a?`Deselect`:`Select`,children:a?d(ye,{className:`h-4 w-4 text-primary`}):d(be,{className:`h-4 w-4`})}),u!==void 0&&r(`span`,{className:`absolute left-1 top-1 z-10 rounded bg-primary/85 px-1.5 py-0.5 text-[10px] font-semibold text-white tabular-nums`,title:`CLIP semantic-match score`,children:[String(u),`%`]}),l>0&&d(`span`,{className:`absolute right-1 top-1 z-10 rounded bg-black/60 px-1.5 py-0.5 text-[10px] font-semibold text-white`,children:String(l)}),(e.markForTrain===!0||e.debug===!0||e.favourited===!0)&&r(`span`,{className:`absolute bottom-1 left-1 z-10 flex gap-1`,children:[e.markForTrain===!0&&d(`span`,{className:`rounded bg-primary/85 p-0.5 text-white`,title:`Marked for training`,"aria-label":`Marked for training`,children:d(We,{className:`h-3 w-3`})}),e.debug===!0&&d(`span`,{className:`rounded bg-black/70 p-0.5 text-white`,title:`Flagged for debug`,"aria-label":`Flagged for debug`,children:d(Be,{className:`h-3 w-3`})}),e.favourited===!0&&d(`span`,{className:`rounded bg-primary/85 p-0.5 text-white`,title:`Favourited`,"aria-label":`Favourited`,children:d(xe,{className:`h-3 w-3`})})]})]}),r(`button`,{type:`button`,onClick:p,className:`min-w-0 px-2 py-1.5 text-left space-y-0.5`,children:[r(`p`,{className:`text-[11px] font-medium text-foreground truncate`,title:e.className,children:[e.className,vt(e)?r(`span`,{className:`text-foreground-subtle`,children:[` · `,vt(e)]}):null]}),d(`p`,{className:`text-[10px] text-foreground-subtle truncate`,title:t,children:t}),r(`div`,{className:`flex items-center justify-between gap-2`,children:[d(`span`,{className:`text-[10px] text-foreground-subtle truncate`,children:le(e.timestamp,n)}),f&&d(`span`,{className:`text-[10px] text-foreground-subtle shrink-0`,children:f})]})]})]})}n();function Sn(){let[n,r]=u(!1),i=t(null),[a,o]=u(0),s=e(e=>{i.current!==e&&(i.current=e,o(e=>e+1))},[]);return f(()=>{let e=i.current;if(!e||typeof IntersectionObserver>`u`){r(!1);return}let t=new IntersectionObserver(e=>{let t=e[e.length-1];t&&r(!t.isIntersecting)},{rootMargin:`64px 0px 0px 0px`,threshold:0});return t.observe(e),()=>t.disconnect()},[a]),{ref:s,scrolledPast:n}}n();var Cn=[`events-feed`],wn=60,Tn=[{value:`importance`,label:`Importance`,icon:ze},{value:`time`,label:`Recent`,icon:ie}];function En(){let e=l(),[t,n]=u(ge),[i,o]=u(new Set),[c,p]=u(new Set),[m,h]=u(0),[g,_]=u(`time`),[v,b]=u(new Set),[x,S]=u(null),[C,w]=u(()=>Date.now());f(()=>{let e=setInterval(()=>w(Date.now()),6e4);return()=>clearInterval(e)},[]);let{since:E,until:D}=a(()=>Tt({fromMs:t.fromMs,toMs:t.toMs},C),[t.fromMs,t.toMs,C]),O=Sn(),{pending:k,refreshNow:A}=Pt({paused:x!==null||v.size>0||O.scrolledPast}),{data:j=[]}=y({isCamera:!0,projection:`slim`}),M=a(()=>j.map(e=>e.id),[j]),{data:N,isLoading:F}=P({deviceIds:M},{enabled:M.length>0,staleTime:5*6e4}),I=a(()=>Bt(N??[],i),[N,i]),L=Ot(),ee=L.isPending,{rows:R,isLoading:z}=jt({deviceIds:M,since:E,until:D,minImportance:m>0?m:void 0,classFilter:c.size===1?[...c][0]:void 0}),te=a(()=>{let e=new Map;for(let t of j??[])e.set(t.id,t.name);return e},[j]),B=e=>te.get(e)??`Camera #${String(e)}`,ne=a(()=>se(R).map(e=>({id:e,name:B(e)})).sort((e,t)=>e.name.localeCompare(t.name)),[R,te]),V=a(()=>xt(St(R,{cameras:i,classes:c,minImportance:m}),g),[R,i,c,m,g]),H=pe(V,wn,a(()=>JSON.stringify([[...i].sort((e,t)=>e-t),[...c].sort(),m,g,E,D]),[i,c,m,g,E,D])),re=()=>{e.invalidateQueries({queryKey:Cn})},U=()=>b(new Set);function W(e){b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function ie(){if(v.size===0||!Y)return;let e=wt(R,v),t=[...e.values()].reduce((e,t)=>e+t.length,0);if(t===0||!window.confirm(`Delete ${String(t)} track${t===1?``:`s`} and all their media? This cannot be undone.`))return;let n=[...e];Promise.allSettled(n.map(([e,t])=>L.mutateAsync({deviceId:e,trackIds:t}))).then(e=>{re();let t=[],r=new Set;if(e.forEach((e,i)=>{let a=n[i];if(!a)return;let[o,s]=a;if(e.status===`fulfilled`)for(let e of s)r.add(Ct(o,e));else t.push(o)}),b(e=>{let t=new Set(e);for(let e of r)t.delete(e);return t}),t.length>0){let e=t.map(e=>B(e)).join(`, `);window.alert(`Failed to delete tracks on: ${e}. They remain selected — retry, or check the server logs.`)}})}let G=V.length!==R.length;return r(`div`,{className:`relative space-y-3`,children:[r(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[d(he,{onChange:n}),d(ue,{cameras:ne,selected:i,onChange:o}),d(Ft,{groups:I,selected:c,onChange:p,loading:F}),r(`label`,{className:`flex items-center gap-1.5 text-[11px] text-foreground-subtle`,children:[d(`span`,{children:`Min score`}),d(`input`,{type:`range`,min:0,max:1,step:.05,value:m,onChange:e=>h(Number(e.target.value)),className:`h-1 w-24 cursor-pointer accent-primary`,"aria-label":`Minimum importance`}),d(`span`,{className:`w-6 tabular-nums text-foreground`,children:Math.round(m*100)})]}),d(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:Tn.map(e=>{let t=e.icon;return r(`button`,{type:`button`,onClick:()=>_(e.value),className:`flex items-center gap-1 rounded px-2 py-1 text-[11px] transition-colors ${g===e.value?`bg-primary/12 text-primary font-medium`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:[d(t,{className:`h-3.5 w-3.5`}),` `,e.label]},e.value)})}),!z&&d(`span`,{className:`ml-auto text-[10px] text-foreground-subtle`,children:G?`${String(V.length)} of ${String(R.length)} events`:`${String(V.length)} event${V.length===1?``:`s`}`})]}),v.size>0&&r(`div`,{className:`flex flex-wrap items-center gap-2 rounded-md border border-primary/40 bg-primary/8 px-3 py-2`,children:[r(`span`,{className:`text-xs font-medium text-foreground`,children:[v.size,` selected`]}),r(`div`,{className:`ml-auto flex flex-wrap items-center gap-1.5`,children:[d(`span`,{title:Y?void 0:`Track deletion arrives with the next server update`,children:r(T,{variant:`secondary`,onClick:ie,disabled:!Y||ee,children:[ee?d(K,{className:`h-3.5 w-3.5 animate-spin`}):d(ke,{className:`h-3.5 w-3.5`}),` `,`Delete`]})}),d(T,{variant:`ghost`,onClick:U,disabled:ee,children:d(je,{className:`h-3.5 w-3.5`})})]})]}),z&&r(`div`,{className:`flex items-center gap-2 py-4 text-xs text-foreground-subtle`,children:[d(K,{className:`h-4 w-4 animate-spin`}),` Loading events…`]}),!z&&V.length===0&&d(`p`,{className:`py-4 text-xs text-foreground-subtle`,children:`No key events in this window.`}),k&&d(`div`,{className:`sticky top-2 z-20 flex justify-center`,children:d(`button`,{type:`button`,onClick:A,className:`rounded-full border border-primary/40 bg-surface px-3 py-1 text-[11px] font-medium text-primary shadow-sm hover:bg-primary/10`,children:`New events — refresh`})}),!z&&V.length>0&&r(s,{children:[d(`div`,{ref:O.ref,"aria-hidden":!0,className:`h-0`}),d(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(11rem,1fr))] gap-2`,children:H.pageItems.map(e=>d(xn,{row:e,cameraName:B(e.deviceId),nowMs:C,selected:v.has(Ct(e.deviceId,e.trackId)),onToggleSelect:W,onOpenDetail:S},Ct(e.deviceId,e.trackId)))}),d(oe,{currentPage:H.page,totalItems:H.totalItems,pageSize:H.pageSize,onPageChange:H.setPage,itemNoun:`events`})]}),x&&d(yn,{row:x,cameraName:B(x.deviceId),deleteAvailable:Y,onClose:()=>S(null),onDeleted:()=>{re(),S(null)},onFlagsChanged:e=>{S(t=>t&&t.trackId===e.trackId?{...t,markForTrain:e.markForTrain,debug:e.debug,favourited:e.favourited}:t)}})]})}n();var Dn=50,On=350,kn=[{value:.2,label:`Loose`},{value:.25,label:`Balanced`},{value:.3,label:`Strict`}];function An(e){return{id:e.id,trackId:e.trackId??e.id,deviceId:e.deviceId,timestamp:e.timestamp,className:e.className,label:e.label,subLabel:e.subLabel,importance:e.importance??0,bestEventId:e.mediaKey??e.trackId??e.id,windowMs:void 0}}function jn({onActiveChange:e}){let[t,n]=u(``),[i,o]=u(.2),[s,c]=u(null),[l,p]=u(null),[m,h]=u(null),g=F(t,On).trim(),_=g.length>0;f(()=>{e(_)},[_,e]);let[v,b]=u(()=>Date.now());f(()=>{let e=setInterval(()=>b(Date.now()),6e4);return()=>clearInterval(e)},[]);let{data:x=[]}=y({isCamera:!0,projection:`slim`}),S=a(()=>{let e=new Map;for(let t of x)e.set(t.id,t.name);return e},[x]),C=e=>S.get(e)??`Camera #${String(e)}`,w=a(()=>x.map(e=>e.id),[x]),{data:T}=P({deviceIds:w},{enabled:w.length>0,staleTime:5*6e4}),D=a(()=>zt(T??[],new Set(l===null?[]:[l])),[T,l]);f(()=>{s!==null&&(D.some(e=>e.kind===s)||c(null))},[D,s]);let{data:O,isFetching:k,isError:A,error:j}=E({text:g,minScore:i,limit:Dn,classFilter:s??void 0,deviceId:l??void 0},{enabled:_}),M=a(()=>[...O??[]].sort((e,t)=>t.score-e.score).map(e=>({...An(e),score:e.score})),[O]);function I(e){c(t=>t===e?null:e)}return r(`div`,{className:`space-y-3`,children:[r(`div`,{className:`rounded-lg border border-border bg-surface p-3 space-y-3`,children:[r(`div`,{className:`flex flex-wrap items-center gap-2`,children:[r(`div`,{className:`relative min-w-[16rem] flex-1`,children:[d(Ae,{className:`pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-foreground-subtle`}),d(`input`,{type:`text`,value:t,onChange:e=>n(e.target.value),placeholder:`Semantic search — describe what you're looking for…`,className:`h-9 w-full rounded-md border border-border bg-background pl-8 pr-8 text-sm text-foreground placeholder:text-foreground-subtle focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary`,"aria-label":`Semantic event search`}),t&&d(`button`,{type:`button`,onClick:()=>n(``),className:`absolute right-2 top-1/2 -translate-y-1/2 rounded p-0.5 text-foreground-subtle hover:bg-surface-hover hover:text-foreground`,"aria-label":`Clear search`,children:d(je,{className:`h-3.5 w-3.5`})})]}),k&&_&&d(K,{className:`h-4 w-4 shrink-0 animate-spin text-foreground-subtle`})]}),r(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[d(`div`,{className:`flex items-center gap-1`,children:D.map(e=>d(`button`,{type:`button`,onClick:()=>I(e.kind),className:`rounded-md px-2.5 py-1 text-xs transition-colors ${s===e.kind?`bg-primary/12 text-primary font-medium`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:N(e)},e.kind))}),r(`label`,{className:`flex items-center gap-1.5 text-[11px] text-foreground-subtle`,children:[d(`span`,{children:`Camera`}),r(`select`,{value:l===null?``:String(l),onChange:e=>p(e.target.value===``?null:Number(e.target.value)),className:`h-7 rounded-md border border-border bg-background px-1.5 text-xs text-foreground focus:border-primary focus:outline-none`,"aria-label":`Filter by camera`,children:[d(`option`,{value:``,children:`All`}),x.map(e=>d(`option`,{value:String(e.id),children:e.name},e.id))]})]}),r(`div`,{className:`flex items-center gap-1.5 text-[11px] text-foreground-subtle`,children:[d(`span`,{children:`Match`}),d(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:kn.map(e=>d(`button`,{type:`button`,onClick:()=>o(e.value),className:`rounded px-2 py-1 text-[11px] transition-colors ${i===e.value?`bg-primary/12 text-primary font-medium`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,title:`Minimum CLIP score ${e.value.toFixed(2)}`,children:e.label},e.value))})]}),_&&!k&&!A&&r(`span`,{className:`ml-auto text-[10px] text-foreground-subtle`,children:[M.length,` match`,M.length===1?``:`es`]})]})]}),_&&r(`div`,{className:`space-y-3`,children:[A&&r(`p`,{className:`py-4 text-xs text-danger`,children:[`Search failed: `,j instanceof Error?j.message:`unknown error`,`. Check that the CLIP embedding step is enabled.`]}),!A&&k&&M.length===0&&r(`div`,{className:`flex items-center gap-2 py-4 text-xs text-foreground-subtle`,children:[d(K,{className:`h-4 w-4 animate-spin`}),` Searching…`]}),!A&&!k&&M.length===0&&r(`p`,{className:`py-4 text-xs text-foreground-subtle`,children:[`No semantic matches for “`,g,`”. Try a looser match threshold or a different phrasing.`]}),!A&&M.length>0&&d(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(11rem,1fr))] gap-2`,children:M.map(e=>d(xn,{row:e,cameraName:C(e.deviceId),nowMs:v,score:e.score,onOpenDetail:h},e.id))})]}),m&&d(yn,{row:m,cameraName:C(m.deviceId),deleteAvailable:Y,onClose:()=>h(null),onDeleted:()=>h(null)})]})}var Mn=15e3;function Nn(e){let t=p(),n=c({queries:e.map(e=>({queryKey:[`stationary-objects`,e],staleTime:Mn,refetchInterval:Mn,queryFn:async()=>((await t.trpcClient.zoneAnalytics.getCurrentSnapshot.query({deviceId:e}))?.stationaryObjects??[]).map(t=>({...t,deviceId:e}))}))});return{rows:n.flatMap(e=>e.data??[]).toSorted((e,t)=>t.becameStationaryAt-e.becameStationaryAt),isLoading:n.some(e=>e.isLoading)}}n();function Pn(e,t){let n=Math.max(0,Math.round((e-t)/6e4));if(n<1)return`just now`;if(n<60)return`${String(n)}m`;let r=Math.floor(n/60);return`${String(r)}h ${String(n%60)}m`}function Fn({row:e,cameraName:t,nowMs:n}){let i=e.keyFrameMediaKey?.startsWith(`track:`)?e.keyFrameMediaKey.split(`:`)[1]:e.keyFrameMediaKey,a=Fe(i?`${Le}/${i}`:void 0);return r(`div`,{className:`flex flex-col overflow-hidden rounded-md border border-border bg-surface`,children:[r(`div`,{className:`relative aspect-video overflow-hidden bg-surface-hover`,children:[a.src?d(`img`,{src:a.src,alt:`Parked ${e.className} on ${t}`,className:`h-full w-full object-cover`}):d(`div`,{className:`flex h-full w-full items-center justify-center text-foreground-subtle`,children:d(Ge,{className:`h-6 w-6`})}),d(`span`,{className:`absolute left-1 top-1 rounded bg-black/60 px-1.5 py-0.5 text-[10px] font-medium capitalize text-white`,children:e.label??e.className})]}),r(`div`,{className:`flex flex-col gap-0.5 p-1.5`,children:[d(`span`,{className:`truncate text-[11px] text-foreground`,children:t}),r(`span`,{className:`text-[10px] text-foreground-subtle`,children:[`parked `,Pn(n,e.becameStationaryAt)]})]})]})}function In(){let[e,t]=u(!1),n=Date.now(),{data:i=[]}=y({isCamera:!0,projection:`slim`}),o=a(()=>i.map(e=>e.id),[i]),s=a(()=>{let e=new Map;for(let t of i)e.set(t.id,t.name);return e},[i]),{rows:c}=Nn(o);return c.length===0?null:r(`div`,{className:`rounded-md border border-border bg-surface/40`,children:[r(`button`,{type:`button`,onClick:()=>t(e=>!e),className:`flex w-full items-center gap-2 px-3 py-2 text-left`,children:[d(e?De:we,{className:`h-4 w-4 text-foreground-subtle`}),d(Ge,{className:`h-4 w-4 text-foreground-subtle`}),d(`span`,{className:`text-sm font-semibold text-foreground`,children:`Stationary`}),d(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[10px] font-medium text-foreground-subtle`,children:c.length}),d(`span`,{className:`ml-2 text-[11px] text-foreground-subtle`,children:`Parked objects — kept out of the event feed`})]}),e&&d(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(9rem,1fr))] gap-2 p-3 pt-0`,children:c.map(e=>d(Fn,{row:e,cameraName:s.get(e.deviceId)??`Camera #${String(e.deviceId)}`,nowMs:n},e.id))})]})}n();function Ln(){let[e,t]=u(!1);return d(Pe,{children:r(`section`,{className:`space-y-3`,children:[d(jn,{onActiveChange:t}),!e&&d(In,{}),!e&&d(En,{})]})})}var Rn=[`person`,`vehicle`,`animal`,`package`,`face`,`plate`],zn=new Set(Rn);function Bn(e){let t=e?.trim().toLowerCase();return t===void 0||t===``?null:zn.has(t)?`"${t}" is a macro class, not a label — person / postman / Marco are three different tiers`:null}function Vn({annotations:e,selectedIndex:t,onSelect:n,onChange:i,onDelete:a}){return e.length===0?r(`p`,{className:`text-[11px] text-foreground-subtle p-3`,children:[`No subject on this frame yet. Drag on the image to draw one, or ask the pipeline for a proposal. Annotate `,d(`strong`,{children:`every`}),` subject — a frame with one box and three unlabelled people teaches the model that two thirds of the people in it are background.`]}):d(`ul`,{className:`divide-y divide-border`,children:e.map((e,o)=>{let s=o===t,c=Bn(e.label),l=Bn(e.subLabel);return r(`li`,{className:`p-2.5 space-y-1.5 ${s?`bg-surface-hover`:``}`,onFocus:()=>{n(o)},children:[r(`div`,{className:`flex items-center gap-2`,children:[d(C,{className:`w-28`,value:e.macroClass,options:Rn.map(e=>({value:e,label:e})),onChange:e=>{let t=Rn.find(t=>t===e.target.value);t!==void 0&&i(o,{macroClass:t})}}),d(C,{className:`w-32`,value:e.kind,options:[{value:`subject`,label:`subject`},{value:`model_error`,label:`model error`}],onChange:e=>{i(o,{kind:e.target.value===`model_error`?`model_error`:`subject`})}}),e.source===`assist`&&r(x,{variant:`info`,children:[e.assistModelId??`assist`,e.assistScore===void 0?``:` ${e.assistScore.toFixed(2)}`]}),d(T,{variant:`ghost`,size:`sm`,"aria-label":`Delete this subject`,onClick:()=>{a(o)},children:d(ke,{className:`h-3 w-3`})})]}),r(`div`,{className:`flex items-center gap-2`,children:[d(v,{className:`flex-1`,placeholder:`label (postman, van, cat…)`,value:e.label??``,onChange:e=>{i(o,{label:e.target.value})}}),d(v,{className:`flex-1`,placeholder:`sub-label (a name, a plate…)`,value:e.subLabel??``,onChange:e=>{i(o,{subLabel:e.target.value})}})]}),c!==null&&d(`p`,{className:`text-[11px] text-danger`,children:c}),l!==null&&d(`p`,{className:`text-[11px] text-danger`,children:l})]},`${String(o)}-${String(e.bbox.x)}`)})})}function Hn(e){return e.every(e=>Bn(e.label)===null&&Bn(e.subLabel)===null&&zn.has(e.macroClass))}function Un(e){return e<0?0:e>1?1:e}function Wn(e,t,n,r){if(!(e>0)||!(t>0)||!(n>0)||!(r>0))return null;let i=Math.min(e/n,t/r),a=n*i,o=r*i;return{left:(e-a)/2,top:(t-o)/2,width:a,height:o}}function Gn(e,t,n){return{x:Un((e-n.left)/n.width),y:Un((t-n.top)/n.height)}}function Kn(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),w:Math.abs(t.x-e.x),h:Math.abs(t.y-e.y)}}function qn(e){return e.w>=.01&&e.h>=.01}function Jn(e,t){return{left:t.left+e.x*t.width,top:t.top+e.y*t.height,width:e.w*t.width,height:e.h*t.height}}function Yn(e,t){let n=-1,r=1/0;return e.forEach((e,i)=>{if(!(t.x>=e.x&&t.x<=e.x+e.w&&t.y>=e.y&&t.y<=e.y+e.h))return;let a=e.w*e.h;a<r&&(n=i,r=a)}),n}n();function Xn({imageSrc:n,imageWidth:a,imageHeight:o,boxes:s,selectedIndex:c,onSelect:l,onDraw:f}){let p=t(null),[m,h]=u({w:0,h:0}),[g,_]=u(null);i(()=>{let e=p.current;if(e===null)return;let t=new ResizeObserver(()=>{h({w:e.clientWidth,h:e.clientHeight})});return t.observe(e),h({w:e.clientWidth,h:e.clientHeight}),()=>{t.disconnect()}},[]);let v=Wn(m.w,m.h,a,o),y=e(e=>{let t=p.current;if(t===null||v===null)return null;let n=t.getBoundingClientRect();return Gn(e.clientX-n.left,e.clientY-n.top,v)},[v]);return r(`div`,{ref:p,className:`relative w-full h-full min-h-[280px] bg-surface-sunken select-none touch-none`,onPointerDown:e=>{let t=y(e);t!==null&&(e.currentTarget.setPointerCapture(e.pointerId),_({start:t,current:Kn(t,t)}))},onPointerMove:e=>{if(g===null)return;let t=y(e);t!==null&&_({start:g.start,current:Kn(g.start,t)})},onPointerUp:()=>{if(g===null)return;let e=g.current;_(null),qn(e)?f(e):l(Yn(s.map(e=>e.bbox),g.start))},children:[d(`img`,{src:n,alt:`Frame being annotated`,className:`absolute inset-0 w-full h-full object-contain pointer-events-none`}),v!==null&&s.map((e,t)=>{let n=Jn(e.bbox,v),i=e.kind===`model_error`,a=t===c,o=i?`#ef4444`:a?`#22c55e`:`#3b82f6`;return d(`div`,{className:`absolute pointer-events-none`,style:{left:n.left,top:n.top,width:n.width,height:n.height,border:`${a?`2px`:`1px`} ${i?`dashed`:`solid`} ${o}`,opacity:e.source===`assist`&&!a?.65:1},children:r(`span`,{className:`absolute -top-4 left-0 text-[10px] px-1 rounded`,style:{background:o,color:`#08121f`},children:[e.label??e.macroClass,i?` ✕`:``]})},`${String(t)}-${String(e.bbox.x)}-${String(e.bbox.y)}`)}),g!==null&&v!==null&&d(`div`,{className:`absolute border border-dashed border-primary pointer-events-none`,style:Jn(g.current,v)})]})}function Zn(e){return e>=1e6?`${(e/1e6).toFixed(1)} MB`:`${Math.round(e/1e3)} KB`}function Qn({candidates:e,copies:t,activeFrameId:n,refusals:i,isSelecting:a,onSelectCandidate:o,onOpenCopy:s,onRemoveCopy:c}){let l=new Set(t.map(e=>e.sourceMediaKey)),u=e.filter(e=>!l.has(e.mediaKey));return r(`div`,{className:`space-y-3`,children:[r(`section`,{children:[r(`h3`,{className:`text-xs font-semibold text-foreground mb-1.5`,children:[`In the dataset (`,t.length,`)`]}),t.length===0?d(`p`,{className:`text-[11px] text-foreground-subtle`,children:`No frame copied yet. Selecting a frame copies it into retrain storage immediately — the dataset stops depending on the track's own media from that moment.`}):d(`ul`,{className:`flex flex-wrap gap-2`,children:t.map(e=>d(`li`,{children:r(`div`,{className:`rounded-md border px-2 py-1.5 text-[11px] ${e.frameId===n?`border-primary bg-surface-hover`:`border-border`}`,children:[r(`button`,{type:`button`,className:`flex items-center gap-1.5 text-left`,onClick:()=>{s(e.frameId)},children:[d(Ne,{className:`h-3 w-3 text-success`}),d(`span`,{className:`font-medium text-foreground`,children:e.sourceKind}),r(`span`,{className:`text-foreground-subtle`,children:[e.width,`×`,e.height,` · `,Zn(e.sizeBytes)]})]}),r(`button`,{type:`button`,"aria-label":`Remove this frame from the dataset`,className:`mt-1 flex items-center gap-1 text-foreground-muted hover:text-danger`,onClick:()=>{c(e.frameId)},children:[d(ke,{className:`h-3 w-3`}),`remove`]})]})},e.frameId))})]}),r(`section`,{children:[r(`h3`,{className:`text-xs font-semibold text-foreground mb-1.5`,children:[`Available frames (`,u.length,`)`]}),u.length===0?d(`p`,{className:`text-[11px] text-foreground-subtle`,children:e.length===0?`This track has no whole, unannotated frame left — its media aged out before it was marked. Anything already copied above is still usable.`:`Every available frame is already in the dataset.`}):d(`ul`,{className:`flex flex-wrap gap-2`,children:u.map(e=>{let t=i.get(e.mediaKey);return r(`li`,{children:[r(T,{variant:`secondary`,size:`sm`,disabled:a||t!==void 0,onClick:()=>{o(e.mediaKey)},children:[a?d(K,{className:`h-3 w-3 animate-spin`}):d(t===void 0?Ue:de,{className:`h-3 w-3`}),d(`span`,{className:`ml-1`,children:e.kind}),d(`span`,{className:`ml-1 text-foreground-subtle`,children:Zn(e.sizeBytes)})]}),t!==void 0&&d(x,{variant:`danger`,className:`ml-1`,children:t})]},e.mediaKey)})})]})]})}function $n(e){return e.frameCount===0?`untouched`:e.annotationCount===0?`started`:`ready`}var er={untouched:{icon:He,label:`to do`,variant:`default`},started:{icon:Ve,label:`frames only`,variant:`info`},ready:{icon:Ee,label:`annotated`,variant:`success`}};function tr(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function nr({tracks:e,isLoading:t,selectedTrackId:n,deviceNames:i,onSelect:a}){return t?r(`div`,{className:`flex items-center gap-2 p-4 text-xs text-foreground-subtle`,children:[d(K,{className:`h-3.5 w-3.5 animate-spin`}),`Loading staging tracks…`]}):e.length===0?d(`div`,{className:`p-4 text-xs text-foreground-subtle`,children:`Nothing in staging. Mark a track for training from the viewer or the Events grid and it appears here.`}):d(`ul`,{className:`divide-y divide-border`,children:e.map(e=>{let t=er[$n(e)],o=t.icon;return d(`li`,{children:r(`button`,{type:`button`,onClick:()=>{a(e)},className:`w-full text-left px-3 py-2 flex items-start gap-2 hover:bg-surface-hover ${e.trackId===n?`bg-surface-hover`:``}`,children:[d(o,{className:`h-3.5 w-3.5 mt-0.5 shrink-0 text-foreground-subtle`}),r(`span`,{className:`min-w-0 flex-1`,children:[r(`span`,{className:`flex items-center gap-2`,children:[d(`span`,{className:`text-xs font-medium text-foreground truncate`,children:e.label??e.className}),d(x,{variant:t.variant,children:t.label})]}),r(`span`,{className:`block text-[11px] text-foreground-subtle truncate`,children:[i.get(e.deviceId)??`Camera ${String(e.deviceId)}`,` ·`,` `,tr(e.lastSeen)]}),r(`span`,{className:`block text-[11px] text-foreground-muted`,children:[e.frameCount,` frame`,e.frameCount===1?``:`s`,` ·`,` `,e.annotationCount,` subject`,e.annotationCount===1?``:`s`]})]})]})},e.trackId)})})}n();var rr=`person`;function ir(){let[t,n]=u(null),[i,o]=u(null),[c,l]=u([]),[p,h]=u(-1),[g,v]=u(new Map),[b,S]=u(null),C=y({projection:`slim`,isCamera:!0}),w=a(()=>{let e=new Map;for(let t of C.data??[])e.set(t.id,t.name);return e},[C.data]),E=re({}),D=ne({trackId:t?.trackId??``},{enabled:t!==null}),O=A({trackId:t?.trackId??``},{enabled:t!==null}),k=R({frameId:i??``},{enabled:i!==null}),j=_(),M=B(),N=H(),P=V(),F=te(),I=m();f(()=>{if(i===null){l([]);return}l((O.data??[]).filter(e=>e.mediaKey===i).map(e=>({bbox:e.bbox,macroClass:e.macroClass,...e.label===void 0?{}:{label:e.label},...e.subLabel===void 0?{}:{subLabel:e.subLabel},kind:e.kind,source:e.source,...e.assistModelId===void 0?{}:{assistModelId:e.assistModelId},...e.assistScore===void 0?{}:{assistScore:e.assistScore}}))),h(-1)},[i,O.data]),f(()=>{let e=D.data?.copies??[];i===null&&e.length>0&&o(e[0].frameId)},[D.data,i]);let L=e(e=>{n(e),o(null),l([]),v(new Map),S(null)},[]),ee=e(async e=>{if(t===null)return;let n=await j.mutateAsync({deviceId:t.deviceId,trackId:t.trackId,mediaKeys:[e]});if(n.refused.length>0){let e=new Map(g);for(let t of n.refused)e.set(t.sourceMediaKey,t.reason);v(e)}n.copied.length>0&&o(n.copied[0].frameId),await D.refetch(),await E.refetch()},[t,j,g,D,E]),z=e(async e=>{t!==null&&(await M.mutateAsync({deviceId:t.deviceId,trackId:t.trackId,frameId:e}),i===e&&o(null),await D.refetch(),await O.refetch(),await E.refetch())},[t,M,i,D,O,E]),U=e(async e=>{if(t===null||i===null)return;S(null);let n=await N.mutateAsync({deviceId:t.deviceId,trackId:t.trackId,frameId:i,subject:e===`package`?{kind:`package`}:{kind:`objects`,modelId:`yolo26n`,minScore:.3}});if(n.kind===`refused`){S(n.reason===`no-zone`?`A package proposal runs on the zone crop only — this camera has no zone, and running the detector on the whole frame at 0.35 proposes furniture.`:`The pipeline refused: ${n.reason}${n.detail===void 0?``:` — ${n.detail}`}`);return}l(e=>[...e,...n.proposals.map(e=>({bbox:e.bbox,macroClass:e.macroClass,...e.label===void 0?{}:{label:e.label},kind:e.kind,source:e.source,...e.assistModelId===void 0?{}:{assistModelId:e.assistModelId},...e.assistScore===void 0?{}:{assistScore:e.assistScore}}))]),S(`${n.proposals.length} proposal${n.proposals.length===1?``:`s`} from ${n.modelId}`+(n.belowThreshold>0?` — ${n.belowThreshold} more were below ${n.minScore.toFixed(2)}`:``))},[t,i,N]),W=e(e=>{l(t=>[...t,{bbox:e,macroClass:rr,kind:`subject`,source:`operator`}]),h(c.length)},[c.length]),ie=e((e,t)=>{l(n=>n.map((n,r)=>r===e?{...n,...t}:n))},[]),G=e(e=>{l(t=>t.filter((t,n)=>n!==e)),h(-1)},[]),ae=e(async()=>{t===null||i===null||(await P.mutateAsync({deviceId:t.deviceId,trackId:t.trackId,frameId:i,annotations:c.map(e=>({bbox:e.bbox,macroClass:e.macroClass,...e.label!==void 0&&e.label!==``?{label:e.label}:{},...e.subLabel!==void 0&&e.subLabel!==``?{subLabel:e.subLabel}:{},kind:e.kind,source:e.source,...e.assistModelId===void 0?{}:{assistModelId:e.assistModelId},...e.assistScore===void 0?{}:{assistScore:e.assistScore}}))}),await O.refetch(),await E.refetch(),S(`Annotations saved.`))},[t,i,c,P,O,E]),oe=e(async()=>{if(t===null)return;let e=await F.mutateAsync({deviceId:t.deviceId,trackId:t.trackId});S(e.changed?`Track completed — it is now trained, and its own media is evictable again.`:e.reason===`no-frames-copied`?`Refused: no frame was ever copied into the dataset. Completing would let retention delete material nothing was extracted from.`:`Refused: ${e.reason??`unknown`}`),await E.refetch(),e.changed&&n(null)},[t,F,E]),se=e(async()=>{if(t===null)return;let e=await I.mutateAsync({deviceId:t.deviceId,trackId:t.trackId});S(e.changed?`Track returned to staging. Its copies and annotations were left alone.`:`Refused: ${e.reason??`unknown`}`),await E.refetch()},[t,I,E]),ce=k.data,le=Hn(c)&&i!==null;return r(Pe,{subtitle:`Turn the tracks you marked for training into an annotated dataset. Selecting a frame copies it — the dataset never depends on media that can be swept.`,actions:t===null?null:r(`div`,{className:`flex items-center gap-2`,children:[r(T,{variant:`secondary`,size:`sm`,onClick:()=>void se(),children:[d(Se,{className:`h-3 w-3`}),d(`span`,{className:`ml-1`,children:`Back to staging`})]}),r(T,{size:`sm`,onClick:()=>void oe(),children:[d(We,{className:`h-3 w-3`}),d(`span`,{className:`ml-1`,children:`Complete track`})]})]}),children:[b!==null&&d(`div`,{className:`rounded-md border border-border bg-surface px-3 py-2 text-xs text-foreground`,children:b}),r(`div`,{className:`grid grid-cols-1 lg:grid-cols-[minmax(0,260px)_minmax(0,1fr)] gap-4`,children:[r(`aside`,{className:`rounded-md border border-border bg-surface overflow-hidden`,children:[r(`div`,{className:`px-3 py-2 border-b border-border flex items-center justify-between`,children:[d(`h2`,{className:`text-xs font-semibold text-foreground`,children:`Staging`}),d(x,{children:E.data?.length??0})]}),d(nr,{tracks:E.data??[],isLoading:E.isLoading,selectedTrackId:t?.trackId??null,deviceNames:w,onSelect:L})]}),d(`section`,{className:`space-y-3 min-w-0`,children:t===null?d(`p`,{className:`text-xs text-foreground-subtle`,children:`Pick a track from the staging list to start annotating it.`}):r(s,{children:[d(`div`,{className:`rounded-md border border-border bg-surface p-3`,children:d(Qn,{candidates:D.data?.candidates??[],copies:D.data?.copies??[],activeFrameId:i,refusals:g,isSelecting:j.isPending,onSelectCandidate:e=>void ee(e),onOpenCopy:o,onRemoveCopy:e=>void z(e)})}),i!==null&&r(`div`,{className:`grid grid-cols-1 xl:grid-cols-[minmax(0,1fr)_minmax(0,380px)] gap-3`,children:[d(`div`,{className:`rounded-md border border-border overflow-hidden`,children:ce===void 0?r(`div`,{className:`flex items-center gap-2 p-6 text-xs text-foreground-subtle`,children:[d(K,{className:`h-3.5 w-3.5 animate-spin`}),`Loading the frame…`]}):d(Xn,{imageSrc:`data:image/jpeg;base64,${ce.base64}`,imageWidth:ce.width,imageHeight:ce.height,boxes:c,selectedIndex:p,onSelect:h,onDraw:W})}),r(`div`,{className:`rounded-md border border-border bg-surface flex flex-col min-h-0`,children:[r(`div`,{className:`px-3 py-2 border-b border-border flex items-center gap-2`,children:[d(`h2`,{className:`text-xs font-semibold text-foreground flex-1`,children:`Subjects`}),r(T,{variant:`secondary`,size:`sm`,disabled:N.isPending,onClick:()=>void U(`objects`),children:[d(Oe,{className:`h-3 w-3`}),d(`span`,{className:`ml-1`,children:`Propose`})]}),r(T,{variant:`secondary`,size:`sm`,disabled:N.isPending,onClick:()=>void U(`package`),children:[d(Oe,{className:`h-3 w-3`}),d(`span`,{className:`ml-1`,children:`Packages`})]})]}),d(`div`,{className:`flex-1 overflow-y-auto`,children:d(Vn,{annotations:c,selectedIndex:p,onSelect:h,onChange:ie,onDelete:G})}),r(`div`,{className:`px-3 py-2 border-t border-border flex items-center justify-between`,children:[r(`span`,{className:`text-[11px] text-foreground-subtle`,children:[c.filter(e=>e.kind===`model_error`).length,` marked as model errors`]}),d(T,{size:`sm`,disabled:!le||P.isPending,onClick:()=>void ae(),children:`Save frame`})]})]})]})]})})]})]})}function ar(){return d(`div`,{className:`flex flex-col p-4`,children:d(Re,{tabs:[{id:`feed`,label:`Feed`,icon:Ce,content:d(Ln,{})},{id:`retrain`,label:`Retrain`,icon:We,content:d(ir,{})},{id:`debug`,label:`Debug`,icon:Be,content:d(_t,{})}]})})}export{ar as EventsPage};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-TIovJNJd.js";var t=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);export{t};