"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[88788],{824443(e,t,a){a.r(t),a.d(t,{default:()=>Lt});var r=a(296540),l=a(340936),i=a(469733),n=a(592510),o=a(874807);var c,m,s=a(422969),A=a(670180),u=a(792542),d=a(947027),T=a(89716),E=a(987309),p=a(177846),C=a(71479),h=a(566723),O=a(294303);!function(e){e.CLIENT="client",e.TOTAL_TRAFFIC="total_bytes",e.DOWNLOAD="bytes_received",e.UPLOAD="bytes_transmitted",e.EMPTY_SPACE="isSummary",e.TIME_ESTIMATE="timeEstimate",e.TOP_APPS="topApps",e.APP_COUNT="appCount"}(c||(c={})),function(e){e.APPLICATION="name",e.TOTAL_TRAFFIC="total_bytes",e.DOWNLOAD="bytes_received",e.UPLOAD="bytes_transmitted",e.EMPTY_SPACE="isSummary",e.TIME_ESTIMATE="timeEstimate",e.TOP_CLIENT="topClient",e.CLIENT_COUNT="clientCount"}(m||(m={}));const I="summaryId",y=[m.APPLICATION,m.TOTAL_TRAFFIC,m.DOWNLOAD,m.UPLOAD,m.TOP_CLIENT,m.CLIENT_COUNT],_=[m.APPLICATION,m.TOTAL_TRAFFIC,m.DOWNLOAD,m.UPLOAD,m.EMPTY_SPACE,m.TIME_ESTIMATE],f=[c.CLIENT,c.TOTAL_TRAFFIC,c.DOWNLOAD,c.UPLOAD,c.TOP_APPS,c.APP_COUNT],M=[c.CLIENT,c.TOTAL_TRAFFIC,c.DOWNLOAD,c.UPLOAD,c.EMPTY_SPACE,c.TIME_ESTIMATE],g={[m.APPLICATION]:90,[m.TOTAL_TRAFFIC]:65,[m.DOWNLOAD]:45,[m.UPLOAD]:45,[m.EMPTY_SPACE]:80,[m.TIME_ESTIMATE]:40,[m.TOP_CLIENT]:80,[m.CLIENT_COUNT]:40},L={[c.CLIENT]:90,[c.TOTAL_TRAFFIC]:65,[c.DOWNLOAD]:45,[c.UPLOAD]:45,[c.EMPTY_SPACE]:80,[c.TIME_ESTIMATE]:40,[c.TOP_APPS]:80,[c.APP_COUNT]:40},P="ACTIVITY_TRAFFIC_TABLE_PLACEHOLDER_CLASSNAME",N=(0,C.A)(O.A)`
  flex-direction: column;
  overflow: auto;
  scrollbar-width: none;
  padding: 0 ${h.Ln};
  width: 100%;
  height: 100%;
  > div:first-child {
    width: 100%;
    height: 90%;
    > div:last-child {
      width: 100%;
      justify-content: center;
    }
  }
  th {
    svg {
      width: 16px;
      height: 16px;
    }
  }
  .${P} {
    width: 100%;
    height: 100%;
    justify-content: center;
  }
`;var S=a(120205),D=a(822336),v=a(895795),b=a(199582),F=a(311785),w=a(668995),x=a(416348);(0,C.A)(v.A)`
  color: ${({theme:{themeName:e}})=>D.Ay[`desktop-color-neutral-08-${e}`]};
`;const U=(0,C.A)(O.A,(0,F.A)("activityTab","activityGraphApp","activityGraphClient"))`
  ${({activityTab:e,activityGraphApp:t,activityGraphClient:a,theme:{themeName:r}})=>`[${b.L}="${((e,{cat:t,app:a},r)=>{switch(e){case S.f.CLIENTS:return t!==x.ZM&&a!==x.Je?String((0,w.h)(t,a)):I;case S.f.APPS:return r&&r!==x.Y$?r:I;default:return I}})(e,t,a)}"]{ background-color: ${D.Ay[`desktop-color-neutral-02-${r}`]}; }`}}
`;var R=a(963070),W=a(523275),z=a(840279),Y=a(916537),H=a(217439),B=a(903216),$=a(75354),G=a(501103),V=a(445772);const k=(0,r.memo)(({isSummary:e,total_bytes:t,traffic_percentage:a})=>{const l=(0,r.useMemo)(()=>{let t;if(!e){const e=a.toFixed(1);t=a>0?"0.0"===e?"<0.1":e:"0.0"}return t?` (${t}%)`:null},[e,a]);return r.createElement(H.A,{color:"text-2",size:"medium"},(0,B.FI)(t),l)});var j=a(396660),q=a(934645);const Z=e=>(t,a,r,l,i)=>(0,j.l0)(t=>t.isSummary?(0,q.K)(!i):(t=>{switch(e){case c.CLIENT:return t.name;case m.TOP_CLIENT:return"topClientTotalBytes"in t?t.topClientTotalBytes:t;case c.TOP_APPS:return Array.isArray(t)?t.reduce((e,{topApp:{total_bytes:t}})=>e+t,0):t;default:return t}})(t[e]))(t,a,r,l,i),X={[c.CLIENT]:"COMMON_CLIENT",[c.TOTAL_TRAFFIC]:"ACTIVITY_DATA_TRAFFIC",[c.DOWNLOAD]:"COMMON_DOWNLOAD",[c.UPLOAD]:"COMMON_UPLOAD",[c.EMPTY_SPACE]:void 0,[c.TIME_ESTIMATE]:"ACTIVITY_TIME_ESTIMATE",[c.TOP_APPS]:"COMMON_TOP_APPS",[c.APP_COUNT]:"COMMON_APPS"};var K=a(523023),J=a(601242),Q=a(455155),ee=a(271856);const te=(0,C.A)(O.A)`
  align-items: center;
  width: 25px;
  height: 25px;
`,ae=(0,C.A)(ee.A)`
  display: flex;
  align-items: center;
`,re=24,le=({topApps:e})=>r.createElement(O.A,{gap:h.kc},e.map(({isSummary:e,totalBytes:t,topAppTotalBytes:a,topAppBytesReceived:l,topAppBytesTransmitted:i,timeEstimate:n,topApp:{category:o,application:c}})=>(o=>(({name:c,iconFileName:m})=>{return r.createElement(te,{key:o},r.createElement(ae,{description:r.createElement(O.A,{flexDirection:"column",gap:h.YC,minWidth:200},r.createElement(O.A,{position:"relative",right:h.YC,alignItems:"center",gap:h.YC},r.createElement(Q.A,{iconFileName:m,dimension:re}),r.createElement(H.A,{size:"small",color:"text-1",weight:"bold"},c)),r.createElement(O.A,{justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(Y.sA,{id:"COMMON_TRAFFIC"})),r.createElement(H.A,{size:"small",color:"text-2"},`${(0,B.FI)(t-(t-a))} (${s=(0,K.i)(a/t*100),String(0===s?"<0.1":s)}%)`)),r.createElement(O.A,{justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(Y.sA,{id:"COMMON_DOWNLOAD"})),r.createElement(H.A,{size:"small",color:"traffic-down"},(0,B.FI)(l))),r.createElement(O.A,{justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(Y.sA,{id:"COMMON_UPLOAD"})),r.createElement(H.A,{size:"small",color:"traffic-up"},(0,B.FI)(i))),e?null:r.createElement(O.A,{justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(Y.sA,{id:"ACTIVITY_TIME_ESTIMATE"})),r.createElement(H.A,{size:"small",color:"text-2"},r.createElement($.A,{uptime:n})))),portal:!0,delay:0,cursorType:"pointer"},r.createElement(Q.A,{iconFileName:m,dimension:re})));var s})((0,J.HH)(o)))((0,w.h)(o,c))));var ie=a(398300),ne=a(703447),oe=a(845030),ce=a(705145),me=a(411502),se=a(956347),Ae=a(162420),ue=a(15095),de=a(627440),Te=a(277517),Ee=a(758649);const pe=({onClick:e})=>r.createElement(Y.sA,{id:"ACTIVITY_VIEW_ENCRYPTED_TOOLTIP",values:{button:r.createElement(Ee.A,{type:"button",variant:"inline",onClick:e},r.createElement(Y.sA,{id:"COMMON_FLOWS"}))}}),Ce={open:0,close:200},he=(0,r.memo)(()=>{const e=(0,se.W6)(),t=(0,i.useSelector)(Te.YX),a=(0,ue.A)(`${de.VO.INSIGHTS}/${A.H.FLOWS}`),l=(0,r.useCallback)(t=>{t.stopPropagation(),e.push(a)},[e,a]);return t?r.createElement(ee.A,{description:r.createElement(pe,{onClick:l}),portal:!0,delay:Ce,isInteractive:!0,cursorType:"pointer"},r.createElement(Ae.A,{isActive:!0,size:"original"})):null}),Oe=(0,r.memo)(()=>r.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("g",{clipPath:"url(#clip0_874_261811)"},r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.96036 14.417L11.5726 18.2407C11.815 18.4059 12.1334 18.4075 12.3774 18.2448L18.1191 14.417L19.0205 15.0179C19.4479 15.3029 19.4479 15.9311 19.0205 16.2161L12.3774 20.6448C12.1334 20.8075 11.815 20.8059 11.5726 20.6407L5.07241 16.212C4.65295 15.9262 4.65295 15.3078 5.07241 15.022L5.96036 14.417Z",fill:"#A252E3"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.96036 10.8174L11.5726 14.6411C11.815 14.8063 12.1334 14.8079 12.3774 14.6452L18.1191 10.8174L19.0205 11.4183C19.4479 11.7033 19.4479 12.3315 19.0205 12.6165L12.3774 17.0452C12.1334 17.2079 11.815 17.2063 11.5726 17.0411L5.07241 12.6124C4.65295 12.3266 4.65295 11.7082 5.07241 11.4224L5.96036 10.8174Z",fill:"#46C7FD"}),r.createElement("path",{d:"M11.5726 3.39353L5.07241 7.82224C4.65295 8.10803 4.65295 8.72649 5.07241 9.01228L11.5726 13.441C11.815 13.6061 12.1334 13.6077 12.3774 13.445L19.0205 9.01634C19.4479 8.73135 19.4479 8.10318 19.0205 7.81819L12.3774 3.38948C12.1334 3.22678 11.815 3.22839 11.5726 3.39353Z",fill:"#006FFF"})),r.createElement("defs",null,r.createElement("clipPath",{id:"clip0_874_261811"},r.createElement("rect",{width:"24",height:"24",rx:"12",fill:"white"}))))),Ie=(0,r.memo)(({isSummary:e,name:t,children:a,...l})=>r.createElement(O.A,{alignItems:"center",width:"100%",gap:h.YC},r.createElement(O.A,{alignItems:"center",justifyContent:"center",width:25,height:25,gap:h.YC},e?r.createElement(Oe,null):a),r.createElement(O.A,{gap:h.YC,alignItems:"center"},r.createElement(ce.A,{color:"text-2",size:"medium",style:{whiteSpace:"nowrap"},isTruncated:!0},t||r.createElement(Y.sA,{id:"COMMON_UNKNOWN"})),"compoundId"in l&&l.compoundId===me.jV?r.createElement(he,null):null))),ye=({isSummary:e,client:t,name:a})=>{const l=(0,i.useDispatch)(),n=(0,r.useCallback)(e=>{e.stopPropagation(),l((0,oe.XP)({type:ie.H.CLIENT,id:t.mac}))},[l,t.mac]);return r.createElement(Ie,{isSummary:e,name:a},r.createElement(ne.A,{width:re,height:re,client:t,onClick:n}))},_e=[{id:c.CLIENT,sortable:!0,label:r.createElement(H.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(Y.sA,{id:X[c.CLIENT]})),minWidth:L[c.CLIENT],renderCell:({isSummary:e,client:t,name:a})=>r.createElement(ye,{isSummary:e,client:t,name:a}),compare:Z(c.CLIENT)},{id:c.TOTAL_TRAFFIC,sortable:!0,label:r.createElement(H.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(Y.sA,{id:X[c.TOTAL_TRAFFIC]})),minWidth:L[c.TOTAL_TRAFFIC],renderCell:({isSummary:e,traffic_percentage:t=0,total_bytes:a=0})=>r.createElement(k,{isSummary:e,traffic_percentage:t,total_bytes:a}),compare:Z(c.TOTAL_TRAFFIC)},{id:c.DOWNLOAD,sortable:!0,label:r.createElement(H.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(Y.sA,{id:X[c.DOWNLOAD]})),minWidth:L[c.DOWNLOAD],renderCell:({bytes_received:e=0})=>r.createElement(V.A.Bytes,{size:"medium"},(0,B.FI)(e)),compare:Z(c.DOWNLOAD)},{id:c.UPLOAD,sortable:!0,label:r.createElement(H.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(Y.sA,{id:X[c.UPLOAD]})),minWidth:L[c.UPLOAD],renderCell:({bytes_transmitted:e=0})=>r.createElement(G.A.Bytes,{size:"medium"},(0,B.FI)(e)),compare:Z(c.UPLOAD)},{id:c.EMPTY_SPACE,sortable:!1,label:null,minWidth:L[c.EMPTY_SPACE],renderCell:()=>null},{id:c.TIME_ESTIMATE,sortable:!0,label:r.createElement(H.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(Y.sA,{id:X[c.TIME_ESTIMATE]})),minWidth:L[c.TIME_ESTIMATE],renderCell:({isSummary:e,timeEstimate:t})=>r.createElement(H.A,{size:"medium",color:"text-2"},e?r.createElement(Y.sA,{id:"COMMON_FALLBACK"}):r.createElement($.A,{uptime:t})),compare:Z(c.TIME_ESTIMATE)},{id:c.TOP_APPS,sortable:!0,label:r.createElement(H.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(Y.sA,{id:X[c.TOP_APPS]})),minWidth:L[c.TOP_APPS],renderCell:({topApps:e})=>r.createElement(le,{topApps:e}),compare:Z(c.TOP_APPS)},{id:c.APP_COUNT,sortable:!0,label:r.createElement(H.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(Y.sA,{id:X[c.APP_COUNT]})),minWidth:L[c.APP_COUNT],renderCell:({appCount:e})=>r.createElement(H.A,{size:"medium",color:"text-2"},e),compare:Z(c.APP_COUNT)}];var fe=a(260411);const Me=({formattedUsageByClient:e,activityGraphClient:t,queryParams:a})=>{const l=(0,i.useDispatch)(),o=(0,i.useSelector)(p.Uz);return(0,r.useEffect)(()=>{t!==x.Y$?e.some(({mac:e})=>e===t)?l((0,d.C)(a,{apps:o,client_macs:[]},void 0,{crudCacheStrategy:{type:n.e.CACHE}})):l((0,fe.fT)(x.Y$)):1===e.length&&e[0].mac!==t&&l((0,fe.fT)(e[0].mac))},[l,e,a,o,t]),null},ge=({isSummary:e,client:{mac:t}})=>({[b.L]:e?I:t});var Le=a(596441),Pe=a(928085),Ne=a(196010),Se=a(588233),De=a(302167),ve=a(959341);const be=()=>{const e=(0,Pe.A)(`${ve.bB}/${ve.Uy.TRAFFIC_LOGGING}`),t=(0,Pe.A)(`${ve.bB}/${ve.Uy.CYBERSECURE}`),{enabled:a}=(0,i.useSelector)(De.JY),{time_series_per_client_stats_enabled:l}=(0,i.useSelector)(De.aK),n=(0,r.useMemo)(()=>r.createElement(Ne.A,{to:t},r.createElement(Y.sA,{id:"COMMON_TRAFFIC_IDENTIFICATION"})),[t]),o=(0,r.useMemo)(()=>r.createElement(Ne.A,{to:`${e}?${Se.mv}=super_mgmt.time_series_per_client_stats_enabled`},r.createElement(Y.sA,{id:"COMMON_COLLECT_HISTORICAL_CLIENT_DATA"})),[e]),c=(0,r.useMemo)(()=>r.createElement(Y.sA,a||l?a?l?{id:"ACTIVITY_NO_TRAFFIC"}:{id:"ACTIVITY_ENABLE_TO_VIEW_TRAFFIC_STATISTICS",values:{action:o}}:{id:"ACTIVITY_ENABLE_TO_VIEW_TRAFFIC_STATISTICS",values:{action:n}}:{id:"ACTIVITY_MULTI_ENABLE_TO_VIEW_TRAFFIC_STATISTICS",values:{action1:n,action2:o}}),[a,l,n,o]);return r.createElement(H.A,{color:"text-2",size:"medium"},c)},Fe=()=>r.createElement(be,null),we={disableColumnFilters:!0,rowHeight:Le.I.ROW_HEIGHT,initiallySortAscending:!1,renderPlaceholder:Fe,placeholderClassName:P};var xe=a(663591),Ue=a(767974),Re=a(602021),We=a(532419);const ze={[m.APPLICATION]:"COMMON_APPLICATION",[m.TOTAL_TRAFFIC]:"ACTIVITY_DATA_TRAFFIC",[m.TIME_ESTIMATE]:"ACTIVITY_TIME_ESTIMATE",[m.DOWNLOAD]:"COMMON_DOWNLOAD",[m.UPLOAD]:"COMMON_UPLOAD",[m.EMPTY_SPACE]:void 0,[m.TOP_CLIENT]:"ACTIVITY_TOP_CLIENT",[m.CLIENT_COUNT]:"COMMON_CLIENTS"};var Ye=a(968906);const He=({topClientBytesReceived:e,topClientBytesTransmitted:t,timeEstimate:a,topClientTotalBytes:l,client:i})=>r.createElement(O.A,{flexDirection:"column",minWidth:200,gap:h.YC},r.createElement(O.A,{alignItems:"center",gap:h.YC},r.createElement(ne.A,{client:i,width:re,height:re}),r.createElement(H.A,{size:"small",color:"text-1",weight:"bold"},i.name)),r.createElement(O.A,{justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(Y.sA,{id:"COMMON_DOWNLOAD"})),r.createElement(H.A,{size:"small",color:"traffic-down"},(0,B.FI)(e))),r.createElement(O.A,{justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(Y.sA,{id:"COMMON_UPLOAD"})),r.createElement(H.A,{size:"small",color:"traffic-up"},(0,B.FI)(t))),r.createElement(O.A,{justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(Y.sA,{id:"COMMON_TRAFFIC"})),r.createElement(H.A,{size:"small",color:"text-2"},(0,B.FI)(l))),a?r.createElement(O.A,{justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(Y.sA,{id:"ACTIVITY_TIME_ESTIMATE"})),r.createElement(H.A,{size:"small",color:"text-2"},r.createElement($.A,{uptime:a}))):null),Be="TRAFFIC_APP_TOP_CLIENT_IMAGE_CLASSNAME",$e=(0,C.A)(O.A)`
  gap: ${h.kc};
  align-items: center;
  .${Be} {
    width: ${re}px !important;
    min-width: ${re}px;
    height: ${re}px !important;
    min-height: ${re}px;
  }
`,Ge=({topClient:{client:e={mac:void 0,name:void 0},topClientTotalBytes:t,topClientBytesReceived:a,topClientBytesTransmitted:l,isSummary:n,totalBytes:o,timeEstimate:c}={}})=>{const m=(0,i.useDispatch)(),s=(0,r.useCallback)(t=>{t.stopPropagation(),m((0,oe.XP)({type:ie.H.CLIENT,id:e.mac}))},[m,e.mac]);return r.createElement($e,null,r.createElement(ae,{delay:0,portal:!0,cursorType:"pointer",description:r.createElement(He,{client:e,topClientTotalBytes:t,topClientBytesReceived:a,topClientBytesTransmitted:l,timeEstimate:n?void 0:c})},r.createElement(ne.A,{client:e,className:Be})),r.createElement(O.A,{alignItems:"center",gap:h.YC},r.createElement(Ee.A,{type:"button",variant:"inline",onClick:s,...Ye.A.addDataTestId(Ye.A.TestId.SIDE_PANEL_TRIGGER)},r.createElement(H.A,{color:"inherit",size:"medium"},e.name||r.createElement(Y.sA,{id:"COMMON_UNKNOWN"}))),r.createElement(H.A,{size:"medium",color:"text-2"},`${(0,B.FI)(t)} (${(0,K.i)((t||0)/(o||0)*100)}%)`)))},Ve=[{id:m.APPLICATION,sortable:!0,label:r.createElement(H.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(Y.sA,{id:ze[m.APPLICATION]})),minWidth:g[m.APPLICATION],renderCell:({isSummary:e,name:t,iconFileName:a,compoundId:l})=>r.createElement(Ie,{isSummary:e,name:t,compoundId:l},r.createElement(Q.A,{iconFileName:a,dimension:re})),compare:Z(m.APPLICATION)},{id:m.TOTAL_TRAFFIC,sortable:!0,label:r.createElement(H.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(Y.sA,{id:ze[m.TOTAL_TRAFFIC]})),minWidth:g[m.TOTAL_TRAFFIC],renderCell:({isSummary:e,traffic_percentage:t=0,total_bytes:a=0})=>r.createElement(k,{isSummary:e,traffic_percentage:t,total_bytes:a}),compare:Z(m.TOTAL_TRAFFIC)},{id:m.DOWNLOAD,sortable:!0,label:r.createElement(H.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(Y.sA,{id:ze[m.DOWNLOAD]})),minWidth:g[m.DOWNLOAD],renderCell:({bytes_received:e=0})=>r.createElement(V.A.Bytes,{size:"medium"},(0,B.FI)(e)),compare:Z(m.DOWNLOAD)},{id:m.UPLOAD,sortable:!0,label:r.createElement(H.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(Y.sA,{id:ze[m.UPLOAD]})),minWidth:g[m.UPLOAD],renderCell:({bytes_transmitted:e=0})=>r.createElement(G.A.Bytes,{size:"medium"},(0,B.FI)(e)),compare:Z(m.UPLOAD)},{id:m.EMPTY_SPACE,sortable:!1,label:null,minWidth:g[m.EMPTY_SPACE],renderCell:()=>null},{id:m.TIME_ESTIMATE,sortable:!0,label:r.createElement(H.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(Y.sA,{id:ze[m.TIME_ESTIMATE]})),minWidth:g[m.TIME_ESTIMATE],renderCell:({isSummary:e,timeEstimate:t})=>r.createElement(H.A,{size:"medium",color:"text-2"},e?r.createElement(Y.sA,{id:"COMMON_FALLBACK"}):r.createElement($.A,{uptime:t})),compare:Z(m.TIME_ESTIMATE)},{id:m.TOP_CLIENT,sortable:!0,label:r.createElement(H.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(Y.sA,{id:ze[m.TOP_CLIENT]})),minWidth:g[m.TOP_CLIENT],renderCell:({topClient:e})=>r.createElement(Ge,{topClient:e}),compare:Z(m.TOP_CLIENT)},{id:m.CLIENT_COUNT,sortable:!0,label:r.createElement(H.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(Y.sA,{id:ze[m.CLIENT_COUNT]})),minWidth:g[m.CLIENT_COUNT],renderCell:({clientCount:e=0})=>r.createElement(H.A,{size:"medium",color:"text-2"},e),compare:Z(m.CLIENT_COUNT)}],ke=({formattedUsageByApp:e,activityGraphApp:t,queryParams:a})=>{const l=(0,i.useDispatch)(),o=(0,i.useSelector)(p.Wq);return(0,r.useEffect)(()=>{t[Ue.wA.CAT]!==x.ZM||t[Ue.wA.APP]!==x.Je?e.some(({application:e,category:a})=>t[Ue.wA.CAT]===a&&t[Ue.wA.APP]===e)?l((0,d.C)(a,{apps:[],client_macs:o},void 0,{crudCacheStrategy:{type:n.e.CACHE}})):l((0,fe.Hl)({[Ue.wA.CAT]:x.ZM,[Ue.wA.APP]:x.Je})):1===e.length&&t[Ue.wA.CAT]!==e[0].category&&t[Ue.wA.APP]!==e[0].application&&l((0,fe.Hl)({[Ue.wA.CAT]:e[0].category,[Ue.wA.APP]:e[0].application}))},[l,e,a,o,t]),null},je=({isSummary:e,compoundId:t})=>({[b.L]:e?I:String(t)}),qe={disableColumnFilters:!0,rowHeight:Le.I.ROW_HEIGHT,initiallySortAscending:!1,renderPlaceholder:Fe,placeholderClassName:P},Ze=({queryParams:e})=>{const t=(0,i.useSelector)(p.nc),a=(0,i.useSelector)(p.Jd),l=(0,i.useSelector)(p.dX),n=((e,t)=>{const{formatMessage:a}=(0,Y.tz)(),l=(0,i.useDispatch)(),n=(0,i.useSelector)(We.m9),o=(0,i.useSelector)(Re.EL),c=(0,i.useSelector)(We.jY),s=(0,i.useSelector)(p.Wq),A=(0,r.useMemo)(()=>a({id:"COMMON_ALL_TRAFFIC"}),[a]),u=(0,i.useSelector)((0,r.useMemo)(()=>(0,T.mH)(e),[e])),d=(0,i.useSelector)((0,r.useMemo)(()=>(0,T.Gb)(A,e),[A,e])),E=(0,i.useSelector)((0,r.useMemo)(()=>s.length?(0,T.Nu)(A):W.A,[A,s])),C=(0,i.useSelector)((0,r.useMemo)(()=>s.length?(0,T.Hy)(s,e):z.A,[s,e])),h=(0,r.useMemo)(()=>u.length>1?Array.prototype.concat.apply([],[d,u]).flat():u,[d,u]),O=(0,r.useMemo)(()=>C.length>1?Array.prototype.concat.apply([],[E,C]).flat():C,[E,C]),I=(0,r.useCallback)(({category:e,application:t})=>l((0,fe.Hl)({[Ue.wA.CAT]:e,[Ue.wA.APP]:t})),[l]),f=(0,r.useCallback)(({isSummary:e,compoundId:t})=>n&&!e&&c&&!o?r.createElement(xe.A,{dpiAppId:t}):null,[n,c,o]),M=(0,r.useMemo)(()=>({idField:"compoundId",items:s.length?O:h,columns:Ve,columnOverride:s.length?_:y,initialSortBy:m.TOTAL_TRAFFIC,onRowClick:I,rowProps:je,renderHoverContent:f}),[h,O,s,I,f]),g=(0,r.useMemo)(()=>r.createElement(R.A,{...qe,...M}),[M]);return r.createElement(r.Fragment,null,r.createElement(ke,{formattedUsageByApp:M.items,activityGraphApp:t,queryParams:e}),g)})(e,l),s=((e,t)=>{const{formatMessage:a}=(0,Y.tz)(),l=(0,i.useDispatch)(),n=(0,i.useSelector)(p.Uz),m=(0,r.useMemo)(()=>a({id:"COMMON_ALL_CLIENTS"}),[a]),s=(0,i.useSelector)((0,r.useMemo)(()=>(0,T.WY)(e),[e])),A=(0,i.useSelector)((0,r.useMemo)(()=>(0,T._)(m,e),[m,e])),u=(0,i.useSelector)((0,r.useMemo)(()=>n.length?(0,T.x4)(n,e):z.A,[n,e])),d=(0,i.useSelector)((0,r.useMemo)(()=>n.length?(0,T.lz)(m):W.A,[m,n])),E=(0,r.useMemo)(()=>s.length>1?Array.prototype.concat.apply([],[A,s]).flat():s,[A,s]),C=(0,r.useMemo)(()=>u.length>1?Array.prototype.concat.apply([],[d,u]).flat():u,[d,u]),h=(0,r.useCallback)(({client:{mac:e=x.Y$}})=>l((0,fe.fT)(e)),[l]),O=(0,r.useMemo)(()=>({idField:"mac",items:n.length?C:E,columns:_e,columnOverride:n.length?M:f,initialSortBy:c.TOTAL_TRAFFIC,onRowClick:h,rowProps:ge,renderHoverContent:o.P1}),[E,C,n,h]),I=(0,r.useMemo)(()=>r.createElement(R.A,{...we,...O}),[O]);return r.createElement(r.Fragment,null,r.createElement(Me,{formattedUsageByClient:O.items,activityGraphClient:t,queryParams:e}),I)})(e,a);return r.createElement(U,{activityTab:t,activityGraphApp:l,activityGraphClient:a},t===S.f.CLIENTS?n:s)},Xe=({queryParams:e})=>r.createElement(N,null,r.createElement(Ze,{queryParams:e})),Ke=(0,C.A)(O.A)`
  flex-direction: column;
`;var Je=a(489391),Qe=a(936344),et=a(195462);const tt=(0,C.A)(O.A)`
  width: 100%;
  position: relative;
`;var at=a(282556),rt=a(366702),lt=a(638334),it=a(198494),nt=a(632017),ot=a(584916);const ct=e=>e<400,mt=({preset:e,documentWidth:t,dayDifference:a,use24HourTime:r,siteTimezone:l,language:i,selfHourCycle:n,formatMessage:o,timestamps:c,startDate:m,endDate:s})=>{return A=c[0]||m.getTime(),u=c.length>1&&c.at(-1)||s.getTime(),d=0===a?ot.l.ONE_DAY:ot.j,(0,et.v)([A,u],nt.P[e||d].frequency(t,a)).map((a,c)=>({label:nt.P[e||d].label({index:c,value:a,use24HourTime:r,siteTimezone:l,language:i,selfHourCycle:n,documentWidth:t,formatMessage:o}),value:a}));var A,u,d};var st=a(86747);const At=625e3;var ut=a(8795),dt=a(137298);const Tt=(0,r.memo)(({value:e,activityTrafficGraphState:t})=>{const a=(0,r.useMemo)(()=>t===st.u.DOWNLOAD?V.A:G.A,[t]);return r.createElement(O.A,{alignItems:"center",justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(Y.sA,{id:t===st.u.DOWNLOAD?"COMMON_DOWNLOAD":"COMMON_UPLOAD"})),r.createElement(O.A,{alignItems:"center"},r.createElement(a.Icon,{size:"small"}),r.createElement(H.A,{size:"small",color:t===st.u.DOWNLOAD?"traffic-down":"traffic-up"},(0,dt.zX)(Math.max(e,0)))))}),Et=(0,r.memo)(({name:e,iconFileName:t})=>r.createElement(O.A,{gap:h.YC,alignItems:"center"},r.createElement(Q.A,{iconFileName:t}),r.createElement(ce.A,{size:"small",color:"text-2",isTruncated:!0},e||r.createElement(Y.sA,{id:"COMMON_UNKNOWN"})))),pt=({timestamp:e,totalBytes:t,topApp:a,intervalSeconds:l,dayDifference:i,activityTrafficDownloadGraphState:n,activityTrafficUploadGraphState:o,rxValue:c,txValue:m,activityDateTimeFormats:{full:s,short:A}})=>r.createElement(O.A,{flexDirection:"column",width:"100%",whiteSpace:"nowrap",gap:h.YC},r.createElement(O.A,{marginBottom:h.YC},r.createElement(H.A,{color:"text-1",weight:"bold",size:"medium"},r.createElement(Y.sA,{id:"COMMON_TRAFFIC"}))),r.createElement(O.A,{justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(Y.sA,{id:"COMMON_DATE_TIME"})),r.createElement(H.A,{size:"small",color:"text-2"},s.format(e),i<=7&&l?r.createElement(r.Fragment,null," - ",A.format(e+1e3*l)):null)),r.createElement(O.A,{justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(Y.sA,{id:"COMMON_TOTAL_TRAFFIC"})),r.createElement(H.A,{size:"small",color:"text-2"},(0,B.FI)(t))),r.createElement(r.Fragment,null,n?r.createElement(Tt,{value:c,activityTrafficGraphState:st.u.DOWNLOAD}):null,o?r.createElement(Tt,{value:m,activityTrafficGraphState:st.u.UPLOAD}):null),a?r.createElement(O.A,{justifyContent:"space-between",alignItems:"center"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(Y.sA,{id:"COMMON_MOST_ACTIVE"})),r.createElement(O.A,{alignItems:"center",maxWidth:"70%"},r.createElement(Et,{...(0,J.HH)((0,w.h)(a.category,a.application))}),r.createElement(ce.A,{size:"small",color:"text-2",isTruncated:!0}," (",(0,B.FI)(a.total_bytes||0),")"))):null),Ct=({hidden:e,top:t,left:a,x:l,customTooltipProps:{total_bytes:i=0,top_app:n,interval_seconds:o=null}={},chartWidth:c,chartHeight:m,activityTrafficDownloadGraphState:s,activityTrafficUploadGraphState:A,activityTrafficGraphState:u,gradientColor:d,uploadTooltipProps:T,rxValue:E,txValue:p,dayDifference:C,activityDateTimeFormats:h})=>r.createElement(ut.A,{width:300,topA:t,leftA:a,topB:T.top,leftB:T.left,chartWidth:c,chartHeight:m,hidden:e,description:r.createElement(pt,{timestamp:l,totalBytes:i,topApp:n,intervalSeconds:o,dayDifference:C,activityTrafficDownloadGraphState:s,activityTrafficUploadGraphState:A,rxValue:E,txValue:p,activityDateTimeFormats:h}),innerColor:d,tooltipRenderCondition:![s,A].every(Boolean)||u===st.u.UPLOAD});var ht=a(831743),Ot=a(382389);const It={[st.u.INTERNET_ACTIVITY]:void 0,[st.u.DOWNLOAD]:"aqua-06",[st.u.UPLOAD]:"purple-06"},yt=({trafficRate:e,getCoordinates:t,mouseData:a,maxY:l,yAxisMax:i,yAxisMin:n,tooltipContainer:o,activityTrafficGraphState:c,renderTooltip:m,chartHovered:s})=>{const{themeName:A}=(0,Ot.u)(),u=(0,r.useMemo)(()=>e.map(({timestamp:e,"rx_byte-r":t,"tx_byte-r":a,total_bytes:r,top_app:l,interval_seconds:i})=>({x:e,y:c===st.u.UPLOAD?a:t,custom:{total_bytes:r,top_app:l,interval_seconds:i,rxValue:t,txValue:a}})),[e,c]),d=(0,r.useMemo)(()=>`${c}GradientId`,[c]),T=(0,r.useMemo)(()=>D.Ay[`desktop-color-${It[c]}-${A}`],[c,A]),E=(0,r.useCallback)(()=>r.createElement("defs",null,r.createElement("linearGradient",{id:d,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},r.createElement("stop",{offset:"0%",stopColor:T,stopOpacity:.5}),r.createElement("stop",{offset:"100%",stopColor:T,stopOpacity:.1}))),[T,d]),p=(0,r.useCallback)(e=>m(e,c,T),[m,T,c]);return r.createElement(ht.A,{data:u,maxY:l,yAxisMax:i,yAxisMin:n,mouseData:a,getCoordinates:t,lineColor:T,variant:"gradientArea",interpolation:"curved",allowCustomDots:!0,tooltipPortal:o?.current||void 0,customGradientId:d,renderCustomGradient:E,renderTooltip:p,showTooltip:s})},_t=({activityContainerHeight:e,activityDateRange:t})=>{const a=(0,r.useRef)(null),n=(0,r.useRef)({left:0,top:0}),{ref:o,width:c=0}=(0,l.A)(),{chartHeight:m,isNarrowChart:s}=(e=>{const t=(0,r.useMemo)(()=>Math.max(Math.round(.8*Math.round((e||0)/2)),188),[e]);return(0,r.useMemo)(()=>({chartHeight:t,isNarrowChart:ct(t)}),[t])})(e),A=(0,i.useSelector)(p.mE),d=(0,i.useSelector)(u.Sm),{activityTrafficDownloadGraphState:T,activityTrafficUploadGraphState:E}=(0,r.useMemo)(()=>({activityTrafficDownloadGraphState:[st.u.DOWNLOAD,st.u.INTERNET_ACTIVITY].includes(A),activityTrafficUploadGraphState:[st.u.UPLOAD,st.u.INTERNET_ACTIVITY].includes(A)}),[A]),{power:C,unit:h,bytes:O}=(0,r.useMemo)(()=>{return e=Math.max(0,...d.map(({"tx_byte-r":e=0,"rx_byte-r":t=0})=>Math.max(At,T?t:0,E?e:0))),(0,Je.cS)(e,"bitrate","SI",e?void 0:2);var e},[d,T,E]),{xAxis:I,dayDifference:y}=((e,{startDate:t,endDate:a,preset:l})=>{const{formatMessage:n}=(0,Y.tz)(),{width:o}=(0,rt.Ay)(),c=(0,r.useMemo)(()=>(0,lt.w)(t,a),[t,a]),m=(0,i.useSelector)(it.jc),s=(0,i.useSelector)(it.BQ),A=(0,i.useSelector)(Re.hq),u=(0,i.useSelector)(at.zi);return{xAxis:mt({preset:l,documentWidth:o,dayDifference:c,use24HourTime:m,siteTimezone:A,language:u,selfHourCycle:s,formatMessage:n,startDate:t,endDate:a,timestamps:e}),dayDifference:c}})(d.map(({timestamp:e})=>e),t),_=(0,r.useMemo)(()=>{return e=O>At?Math.ceil(O+1/(s?5:10)*O):O,(0,et.Y)((0,Je.cS)(e,"bitrate","SI",C).value<1e3?e:O,s?6:11);var e},[O,C,s]),f=(0,r.useCallback)(({value:e},t)=>{return t!==(s?5:10)?(r=(a=(0,Je.cS)(+e,"bitrate","SI",C).value).toFixed(1),0===t?h:String(r.length<=4?r:Math.trunc(a))):void 0;var a,r},[C,s,h]),M=(()=>{const e=(0,i.useSelector)(it.BQ),t=(0,i.useSelector)(Re.hq),a=(0,i.useSelector)(at.zi);return(0,r.useMemo)(()=>({full:new Intl.DateTimeFormat(a,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"numeric",hourCycle:e,timeZone:t}),short:new Intl.DateTimeFormat(a,{hour:"numeric",minute:"numeric",hourCycle:e,timeZone:t}),tooltip:new Intl.DateTimeFormat(a,{day:"numeric",month:"short",hour:"numeric",minute:"numeric",hourCycle:e,timeZone:t})}),[e,t,a])})(),g=(0,r.useCallback)(({hidden:e,left:t=0,top:a=0,x:l,custom:i},o,s)=>(T&&E&&o===st.u.UPLOAD&&(n.current={left:t,top:a}),r.createElement(Ct,{hidden:e,left:t,top:a,uploadTooltipProps:n.current,x:l,rxValue:i?.rxValue,txValue:i?.txValue,customTooltipProps:i,chartHeight:m,chartWidth:c,activityTrafficDownloadGraphState:T,activityTrafficUploadGraphState:E,activityTrafficGraphState:o,gradientColor:s,dayDifference:y,activityDateTimeFormats:M})),[m,c,T,E,n,y,M]),L=(0,r.useCallback)((e,t,l,i,n,o,c,m,s,A)=>r.createElement(r.Fragment,null,T?r.createElement(yt,{trafficRate:d,getCoordinates:e,mouseData:t,maxY:l,yAxisMax:o,yAxisMin:c,tooltipContainer:a,renderTooltip:g,activityTrafficGraphState:st.u.DOWNLOAD,chartHovered:A}):null,E?r.createElement(yt,{trafficRate:d,getCoordinates:e,mouseData:t,maxY:l,yAxisMax:o,yAxisMin:c,tooltipContainer:a,renderTooltip:g,activityTrafficGraphState:st.u.UPLOAD,chartHovered:A}):null),[T,E,d,g]);return r.createElement(tt,{ref:o},r.createElement(Qe.A,{xAxis:I,yAxis:_,width:c,height:m,renderYLabel:f},L),r.createElement("div",{ref:a}))},ft=({activityContainerHeight:e,activityDateRange:t})=>r.createElement(Ke,null,r.createElement(_t,{activityContainerHeight:e,activityDateRange:t})),Mt=(0,C.A)(O.A)`
  margin: ${h.Ln};
  border: ${({theme:{themeName:e}})=>D.Ay[`desktop-border-divider-${e}`]};
  border-radius: 6px;
  overflow: auto;
  width: 100%;
`,gt=(0,C.A)(O.A)`
  width: 100%;
  min-width: 820px;
  height: 100%;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  gap: ${h.kc};
`,Lt=(0,r.memo)(()=>{const e=(0,i.useDispatch)(),{ref:t,height:a=0}=(0,l.A)(),c=(0,i.useSelector)(p.Vn),m=(0,i.useSelector)(p.Bw),C=(0,i.useSelector)(p.eD),h=(0,r.useMemo)(()=>({start:m.startDate.getTime(),end:m.endDate.getTime(),includeUnidentified:!0}),[m]),O=(0,i.useSelector)(u.Z7),I=(0,i.useSelector)((0,r.useMemo)(()=>(0,T.Vg)(h),[h]));return((e=o.P1,t=o.P1)=>{(0,r.useEffect)(()=>(e(),t),[])})(()=>{O||e((0,d.C)(h,C)),I||e((0,E._)(h))}),(0,s.A)([(0,d.C)(h,C,void 0,{crudCacheStrategy:{type:n.e.CACHE}}),(0,E._)(h,void 0,{crudCacheStrategy:{type:n.e.CACHE}})],r.createElement(Mt,null,r.createElement(gt,{ref:t},c?r.createElement(ft,{activityContainerHeight:a,activityDateRange:m}):null,r.createElement(Xe,{queryParams:h}))),{trackingName:A.H.ACTIVITY})})},564328(e,t,a){a.d(t,{Fw:()=>i,Ql:()=>r,pN:()=>l,vB:()=>n});const r="createSimpleAppBlock",l="mac",i="appId",n="simpleAppBlockId"},966376(e,t,a){var r;a.d(t,{D:()=>r}),function(e){e.TRAFFIC_RULES="traffic-rules",e.FIREWALL_RULES="firewall-rules"}(r||(r={}))},663591(e,t,a){a.d(t,{A:()=>p});var r=a(296540),l=a(469733),i=a(758649),n=a(928085),o=a(566723),c=a(294303),m=a(916537),s=a(564328),A=a(767974),u=a(792072),d=a(959341),T=a(196010),E=a(966376);const p=(0,r.memo)(({dpiAppId:e,mac:t})=>{const a=(0,l.useSelector)(u.JP),p=(0,n.A)(d.bB),C=(0,n.A)(d.tz),h=(0,r.useMemo)(()=>{if(a){const a=new URLSearchParams;return a.set(s.Ql,"true"),t&&a.set(s.pN,t),e&&a.set(s.Fw,e.toString()),{pathname:`${p}/${d.Uy.CYBERSECURE}`,search:a.toString()}}return{pathname:`${C}/${E.D.TRAFFIC_RULES}/${d.fW}/${d.R6}`,state:{[A.U3.APP_ID]:e.toString(),[A.U3.CLIENT]:t}}},[e,a,t,p,C]);return r.createElement(c.A,{justifyContent:"flex-end",paddingRight:o.xO},r.createElement(i.A,{component:T.A,to:h,variant:"inline",color:"danger"},r.createElement(m.sA,{id:"COMMON_ACTION_BLOCK_APP"})))})},632017(e,t,a){a.d(t,{P:()=>o});var r=a(572112),l=a(546391),i=a(584916);const n=e=>e>=r.A.XXL.TO?25:e>=r.A.L.TO?13:e>=r.A.M.TO?7:4,o={[i.l.ONE_HOUR]:{frequency:n,label:({index:e,value:t,selfHourCycle:a,documentWidth:r,formatMessage:l,siteTimezone:i,language:o})=>e!==n(r)-1?new Intl.DateTimeFormat(o,{hourCycle:a,hour:"numeric",timeZone:i,minute:"numeric"}).format(t):l({id:"COMMON_NOW"})},[i.l.ONE_DAY]:{frequency:n,label:({index:e,value:t,use24HourTime:a,selfHourCycle:r,siteTimezone:l,language:i,documentWidth:o,formatMessage:c})=>e!==n(o)-1?new Intl.DateTimeFormat(i,{hourCycle:r,hour:"numeric",minute:"numeric",timeZone:l,...a&&{minute:"numeric"}}).format(t).toUpperCase():c({id:"COMMON_NOW"})},[i.l.ONE_WEEK]:{frequency:()=>7,label:({value:e,language:t})=>new Intl.DateTimeFormat(t,{weekday:"short"}).format(e)},[i.l.ONE_MONTH]:{frequency:(e,t)=>Math.ceil(t/(e>=r.A.XXL.TO?1:e>=r.A.M.TO?2:4)),label:({value:e,language:t})=>new Intl.DateTimeFormat(t,{month:"short",day:"numeric"}).format(e)},[i.l.TWELVE_HOURS]:{frequency:()=>12,label:({value:e,selfHourCycle:t,siteTimezone:a,language:r})=>new Intl.DateTimeFormat(r,{hourCycle:t,hour:"numeric",timeZone:a}).format(e)},[i.l.SIX_HOURS]:{frequency:()=>6,label:({value:e,selfHourCycle:t,siteTimezone:a,language:r})=>new Intl.DateTimeFormat(r,{hourCycle:t,hour:"numeric",timeZone:a}).format(e)},[i.l.THIRTY_MINUTES]:{frequency:()=>6,label:({value:e,selfHourCycle:t,siteTimezone:a,language:r})=>new Intl.DateTimeFormat(r,{hourCycle:t,hour:"numeric",minute:"numeric",timeZone:a}).format(e)},[i.j]:{frequency:()=>10,label:({value:e,selfHourCycle:t,siteTimezone:a,language:r})=>new Intl.DateTimeFormat(r,{hourCycle:t,timeZone:a,month:"short",day:"numeric",hour:"numeric",minute:"numeric"}).format(e).replace(l.sO,e=>e.toUpperCase())}}},638334(e,t,a){a.d(t,{I:()=>i,w:()=>l});var r=a(945132);const l=(e,t)=>Math.floor(Math.abs(new Date(t).getTime()-new Date(e).getTime())/r.jU),i=(e,t)=>Math.floor(Math.abs(t-e)/r.jU)},588233(e,t,a){a.d(t,{Lv:()=>l,Mp:()=>i,mv:()=>r,n9:()=>o,sC:()=>n});const r="highlightFieldId",l="resultId",i=`${r}=rsyslogd.remoteLoggingLocation.siem&${l}=security-static-33`,n="global_network.radiusprofiles",o=`${r}=${n}`}}]);