"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[8788],{824443:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Dt});var r=a(296540),l=a(469733),i=a(340936),n=a(582724),o=a(670180),c=a(592510),m=a(947027),s=a(987309),A=a(874807);const u=(e=A.Ay,t=A.Ay)=>((0,r.useEffect)(()=>(e(),t),[]),null);var T=a(792542),d=a(89716),E=a(71479),C=a(294303);const p=(0,E.A)(C.A)`
  flex-direction: column;
`;var h=a(936344),O=a(489391),y=a(195462),I=a(177846),_=a(86747),f=a(964238),M=a(998837),g=a(822336);const P={[_.u.INTERNET_ACTIVITY]:void 0,[_.u.DOWNLOAD]:"aqua-06",[_.u.UPLOAD]:"purple-06"},L=({trafficRate:e,getCoordinates:t,mouseData:a,maxY:l,yAxisMax:i,yAxisMin:n,tooltipContainer:o,activityTrafficGraphState:c,renderTooltip:m,chartHovered:s})=>{const{themeName:A}=(0,M.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===_.u.UPLOAD?a:t,custom:{total_bytes:r,top_app:l,interval_seconds:i,rxValue:t,txValue:a}})),[e,c]),T=(0,r.useMemo)(()=>`${c}GradientId`,[c]),d=(0,r.useMemo)(()=>g.Ay[`desktop-color-${P[c]}-${A}`],[c,A]),E=(0,r.useCallback)(()=>r.createElement("defs",null,r.createElement("linearGradient",{id:T,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},r.createElement("stop",{offset:"0%",stopColor:d,stopOpacity:.5}),r.createElement("stop",{offset:"100%",stopColor:d,stopOpacity:.1}))),[d,T]),C=(0,r.useCallback)(e=>m(e,c,d),[m,d,c]);return r.createElement(f.A,{data:u,maxY:l,yAxisMax:i,yAxisMin:n,mouseData:a,getCoordinates:t,lineColor:d,variant:"gradientArea",interpolation:"curved",allowCustomDots:!0,tooltipPortal:o?o.current:void 0,customGradientId:T,renderCustomGradient:E,renderTooltip:C,showTooltip:s})};var N=a(13994),S=a(217439),D=a(705145),v=a(459449),b=a(668995),F=a(903216),w=a(566723),x=a(601242),W=a(670),z=a(438369),U=a(455155),R=a(137298);const Y=(0,r.memo)(({value:e,activityTrafficGraphState:t})=>{const a=(0,r.useMemo)(()=>t===_.u.DOWNLOAD?W.A:z.A,[t]);return r.createElement(C.A,{alignItems:"center",justifyContent:"space-between"},r.createElement(S.A,{size:"small",color:"text-1"},r.createElement(v.sA,{id:t===_.u.DOWNLOAD?"COMMON_DOWNLOAD":"COMMON_UPLOAD"})),r.createElement(C.A,{alignItems:"center"},r.createElement(a.Icon,{size:"small"}),r.createElement(S.A,{size:"small",color:t===_.u.DOWNLOAD?"traffic-down":"traffic-up"},(0,R.zX)(Math.max(e,0)))))}),H=(0,r.memo)(({name:e,iconFileName:t})=>r.createElement(C.A,{gap:w.YC,alignItems:"center"},r.createElement(U.A,{iconFileName:t}),r.createElement(D.A,{size:"small",color:"text-2",isTruncated:!0},e||r.createElement(v.sA,{id:"COMMON_UNKNOWN"})))),B=({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(C.A,{flexDirection:"column",width:"100%",whiteSpace:"nowrap",gap:w.YC},r.createElement(C.A,{marginBottom:w.YC},r.createElement(S.A,{color:"text-1",weight:"bold",size:"medium"},r.createElement(v.sA,{id:"COMMON_TRAFFIC"}))),r.createElement(C.A,{justifyContent:"space-between"},r.createElement(S.A,{size:"small",color:"text-1"},r.createElement(v.sA,{id:"COMMON_DATE_TIME"})),r.createElement(S.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(C.A,{justifyContent:"space-between"},r.createElement(S.A,{size:"small",color:"text-1"},r.createElement(v.sA,{id:"COMMON_TOTAL_TRAFFIC"})),r.createElement(S.A,{size:"small",color:"text-2"},(0,F.FI)(t))),r.createElement(r.Fragment,null,n?r.createElement(Y,{value:c,activityTrafficGraphState:_.u.DOWNLOAD}):null,o?r.createElement(Y,{value:m,activityTrafficGraphState:_.u.UPLOAD}):null),a?r.createElement(C.A,{justifyContent:"space-between",alignItems:"center"},r.createElement(S.A,{size:"small",color:"text-1"},r.createElement(v.sA,{id:"COMMON_MOST_ACTIVE"})),r.createElement(C.A,{alignItems:"center",maxWidth:"70%"},r.createElement(H,{...(0,x.HH)((0,b.h)(a.category,a.application))}),r.createElement(D.A,{size:"small",color:"text-2",isTruncated:!0}," (",(0,F.FI)(a.total_bytes||0),")"))):null),G=({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:T,uploadTooltipProps:d,rxValue:E,txValue:C,dayDifference:p,activityDateTimeFormats:h})=>r.createElement(N.A,{width:300,topA:t,leftA:a,topB:d.top,leftB:d.left,chartWidth:c,chartHeight:m,hidden:e,description:r.createElement(B,{timestamp:l,totalBytes:i,topApp:n,intervalSeconds:o,dayDifference:p,activityTrafficDownloadGraphState:s,activityTrafficUploadGraphState:A,rxValue:E,txValue:C,activityDateTimeFormats:h}),innerColor:T,tooltipRenderCondition:![s,A].every(Boolean)||u===_.u.UPLOAD}),V=625e3,$=(0,E.A)(C.A)`
  width: 100%;
  position: relative;
`;var k=a(584916),q=a(854398);const j=e=>e<400,Z=({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[c.length-1]||s.getTime(),T=0===a?k.l.ONE_DAY:k.j,(0,y.v)([A,u],q.P[e||T].frequency(t,a)).map((a,c)=>({label:q.P[e||T].label({index:c,value:a,use24HourTime:r,siteTimezone:l,language:i,selfHourCycle:n,documentWidth:t,formatMessage:o}),value:a}));var A,u,T},X=e=>{const t=(0,r.useMemo)(()=>{return Math.max((t=e,Math.round(.8*Math.round((t||0)/2))),188);var t},[e]);return(0,r.useMemo)(()=>({chartHeight:t,isNarrowChart:j(t)}),[t])};var K=a(638334),J=a(366702),Q=a(198494),ee=a(602021),te=a(282556);const ae=(e,{startDate:t,endDate:a,preset:i})=>{const{formatMessage:n}=(0,v.tz)(),{width:o}=(0,J.A)(),c=(0,r.useMemo)(()=>(0,K.w)(t,a),[t,a]),m=(0,l.useSelector)(Q.jc),s=(0,l.useSelector)(Q.BQ),A=(0,l.useSelector)(ee.hq),u=(0,l.useSelector)(te.zi);return{xAxis:Z({preset:i,documentWidth:o,dayDifference:c,use24HourTime:m,siteTimezone:A,language:u,selfHourCycle:s,formatMessage:n,startDate:t,endDate:a,timestamps:e}),dayDifference:c}},re=()=>{const e=(0,l.useSelector)(Q.BQ),t=(0,l.useSelector)(ee.hq),a=(0,l.useSelector)(te.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])},le=({activityContainerHeight:e,activityDateRange:t})=>{const a=(0,r.useRef)(null),n=(0,r.useRef)({left:0,top:0}),{ref:o,width:c=0}=(0,i.A)(),{chartHeight:m,isNarrowChart:s}=X(e),A=(0,l.useSelector)(I.mE),u=(0,l.useSelector)(T.Sm),{activityTrafficDownloadGraphState:d,activityTrafficUploadGraphState:E}=(0,r.useMemo)(()=>({activityTrafficDownloadGraphState:[_.u.DOWNLOAD,_.u.INTERNET_ACTIVITY].includes(A),activityTrafficUploadGraphState:[_.u.UPLOAD,_.u.INTERNET_ACTIVITY].includes(A)}),[A]),{power:C,unit:p,bytes:f}=(0,r.useMemo)(()=>{return e=Math.max(0,...u.map(({"tx_byte-r":e=0,"rx_byte-r":t=0})=>Math.max(V,d?t:0,E?e:0))),(0,O.cS)(e,"bitrate","SI",e?void 0:2);var e},[u,d,E]),{xAxis:M,dayDifference:g}=ae(u.map(({timestamp:e})=>e),t),P=(0,r.useMemo)(()=>{return e=f>V?Math.ceil(f+1/(s?5:10)*f):f,(0,y.Y)((0,O.cS)(e,"bitrate","SI",C).value<1e3?e:f,s?6:11);var e},[f,C,s]),N=(0,r.useCallback)(({value:e},t)=>{return t!==(s?5:10)?(a=(0,O.cS)(+e,"bitrate","SI",C).value,r=a.toFixed(1),0===t?p:String(r.length<=4?r:Math.trunc(a))):void 0;var a,r},[C,s,p]),S=re(),D=(0,r.useCallback)(({hidden:e,left:t=0,top:a=0,x:l,y:i,custom:o},s,A)=>(d&&E&&s===_.u.UPLOAD&&(n.current={left:t,top:a}),r.createElement(G,{hidden:e,left:t,top:a,uploadTooltipProps:n.current,x:l,rxValue:o?.rxValue,txValue:o?.txValue,customTooltipProps:o,chartHeight:m,chartWidth:c,activityTrafficDownloadGraphState:d,activityTrafficUploadGraphState:E,activityTrafficGraphState:s,gradientColor:A,dayDifference:g,activityDateTimeFormats:S})),[m,c,d,E,n,g,S]),v=(0,r.useCallback)((e,t,l,i,n,o,c,m,s,A)=>r.createElement(r.Fragment,null,d?r.createElement(L,{trafficRate:u,getCoordinates:e,mouseData:t,maxY:l,yAxisMax:o,yAxisMin:c,tooltipContainer:a,renderTooltip:D,activityTrafficGraphState:_.u.DOWNLOAD,chartHovered:A}):null,E?r.createElement(L,{trafficRate:u,getCoordinates:e,mouseData:t,maxY:l,yAxisMax:o,yAxisMin:c,tooltipContainer:a,renderTooltip:D,activityTrafficGraphState:_.u.UPLOAD,chartHovered:A}):null),[d,E,u,D]);return r.createElement($,{ref:o},r.createElement(h.A,{xAxis:M,yAxis:P,width:c,height:m,renderYLabel:N},v),r.createElement("div",{ref:a}))},ie=({activityContainerHeight:e,activityDateRange:t})=>r.createElement(p,null,r.createElement(le,{activityContainerHeight:e,activityDateRange:t})),ne=(0,E.A)(C.A)`
  margin: ${w.Ln};
  border: ${({theme:{themeName:e}})=>g.Ay[`desktop-border-divider-${e}`]};
  border-radius: 6px;
  overflow: auto;
  width: 100%;
`,oe=(0,E.A)(C.A)`
  width: 100%;
  min-width: 820px;
  height: 100%;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  gap: ${w.kc};
`;var ce,me;!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"}(ce||(ce={})),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"}(me||(me={}));const se="summaryId",Ae=[ce.APPLICATION,ce.TOTAL_TRAFFIC,ce.DOWNLOAD,ce.UPLOAD,ce.TOP_CLIENT,ce.CLIENT_COUNT],ue=[ce.APPLICATION,ce.TOTAL_TRAFFIC,ce.DOWNLOAD,ce.UPLOAD,ce.EMPTY_SPACE,ce.TIME_ESTIMATE],Te=[me.CLIENT,me.TOTAL_TRAFFIC,me.DOWNLOAD,me.UPLOAD,me.TOP_APPS,me.APP_COUNT],de=[me.CLIENT,me.TOTAL_TRAFFIC,me.DOWNLOAD,me.UPLOAD,me.EMPTY_SPACE,me.TIME_ESTIMATE],Ee={[ce.APPLICATION]:90,[ce.TOTAL_TRAFFIC]:65,[ce.DOWNLOAD]:45,[ce.UPLOAD]:45,[ce.EMPTY_SPACE]:80,[ce.TIME_ESTIMATE]:40,[ce.TOP_CLIENT]:80,[ce.CLIENT_COUNT]:40},Ce={[me.CLIENT]:90,[me.TOTAL_TRAFFIC]:65,[me.DOWNLOAD]:45,[me.UPLOAD]:45,[me.EMPTY_SPACE]:80,[me.TIME_ESTIMATE]:40,[me.TOP_APPS]:80,[me.APP_COUNT]:40},pe="ACTIVITY_TRAFFIC_TABLE_PLACEHOLDER_CLASSNAME",he=(0,E.A)(C.A)`
  flex-direction: column;
  overflow: auto;
  scrollbar-width: none;
  padding: 0 ${w.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;
    }
  }
  .${pe} {
    width: 100%;
    height: 100%;
    justify-content: center;
  }
`;var Oe=a(120205),ye=a(895795),Ie=a(199582),_e=a(416348);(0,E.A)(ye.A)`
  color: ${({theme:{motifPalette:{neutral08:e}}})=>e};
`;const fe=(0,E.A)(C.A,{shouldForwardProp:e=>!["activityTab","activityGraphApp","activityGraphClient"].includes(e)})`
  ${({activityTab:e,activityGraphApp:t,activityGraphClient:a,theme:{motifPalette:{neutral02:r}}})=>`[${Ie.L}="${((e,{cat:t,app:a},r)=>{switch(e){case Oe.f.CLIENTS:return t!==_e.ZM&&a!==_e.Je?String((0,b.h)(t,a)):se;case Oe.f.APPS:return r&&r!==_e.Y$?r:se;default:return se}})(e,t,a)}"]{ background-color: ${r}; }`}}
`;var Me=a(963070),ge=a(532419),Pe=a(663591),Le=a(523275),Ne=a(840279),Se=a(767974),De=a(260411),ve=a(75354);const be=(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(S.A,{color:"text-2",size:"medium"},(0,F.FI)(t),l)});var Fe=a(934645),we=a(396660);const xe=e=>(t,a,r,l,i)=>(0,we.l0)(t=>t.isSummary?(0,Fe.K)(!i):(t=>{switch(e){case ce.TOP_CLIENT:return"topClientTotalBytes"in t?t.topClientTotalBytes:t;case me.TOP_APPS:return Array.isArray(t)?t.length:t;default:return t}})(t[e]))(t,a,r,l,i);var We=a(758649),ze=a(845030),Ue=a(398300),Re=a(703447),Ye=a(518689),He=a(271856);const Be=(0,E.A)(C.A)`
  align-items: center;
  width: 25px;
  height: 25px;
`,Ge=(0,E.A)(He.A)`
  display: flex;
  align-items: center;
`,Ve=24,$e=({topClientBytesReceived:e,topClientBytesTransmitted:t,timeEstimate:a,topClientTotalBytes:l,client:i})=>r.createElement(C.A,{flexDirection:"column",minWidth:200,gap:w.YC},r.createElement(C.A,{alignItems:"center",gap:w.YC},r.createElement(Re.A,{client:i,width:Ve,height:Ve}),r.createElement(S.A,{size:"small",color:"text-1",weight:"bold"},i.name)),r.createElement(C.A,{justifyContent:"space-between"},r.createElement(S.A,{size:"small",color:"text-1"},r.createElement(v.sA,{id:"COMMON_DOWNLOAD"})),r.createElement(S.A,{size:"small",color:"traffic-down"},(0,F.FI)(e))),r.createElement(C.A,{justifyContent:"space-between"},r.createElement(S.A,{size:"small",color:"text-1"},r.createElement(v.sA,{id:"COMMON_UPLOAD"})),r.createElement(S.A,{size:"small",color:"traffic-up"},(0,F.FI)(t))),r.createElement(C.A,{justifyContent:"space-between"},r.createElement(S.A,{size:"small",color:"text-1"},r.createElement(v.sA,{id:"COMMON_TRAFFIC"})),r.createElement(S.A,{size:"small",color:"text-2"},(0,F.FI)(l))),a?r.createElement(C.A,{justifyContent:"space-between"},r.createElement(S.A,{size:"small",color:"text-1"},r.createElement(v.sA,{id:"ACTIVITY_TIME_ESTIMATE"})),r.createElement(S.A,{size:"small",color:"text-2"},r.createElement(ve.A,{uptime:a}))):null),ke="TRAFFIC_APP_TOP_CLIENT_IMAGE_CLASSNAME",qe=(0,E.A)(C.A)`
  gap: ${w.kc};
  align-items: center;
  .${ke} {
    width: ${Ve}px !important;
    min-width: ${Ve}px;
    height: ${Ve}px !important;
    min-height: ${Ve}px;
  }
`,je=({topClient:{client:e={mac:void 0,name:void 0},topClientTotalBytes:t,topClientBytesReceived:a,topClientBytesTransmitted:i,isSummary:n,totalBytes:o,timeEstimate:c}={}})=>{const m=(0,l.useDispatch)(),s=(0,r.useCallback)(t=>{t.stopPropagation(),m((0,ze.XP)({type:Ue.H.CLIENT,id:e.mac}))},[m,e.mac]);return r.createElement(qe,null,r.createElement(Ge,{delay:0,portal:!0,cursorType:"pointer",description:r.createElement($e,{client:e,topClientTotalBytes:t,topClientBytesReceived:a,topClientBytesTransmitted:i,timeEstimate:n?void 0:c})},r.createElement(Re.A,{client:e,className:ke})),r.createElement(C.A,{alignItems:"center",gap:w.YC},r.createElement(We.A,{type:"button",variant:"inline",onClick:s},r.createElement(S.A,{color:"inherit",size:"medium"},e.name||r.createElement(v.sA,{id:"COMMON_UNKNOWN"}))),r.createElement(S.A,{size:"medium",color:"text-2"},`${(0,F.FI)(t)} (${(0,Ye.E)((t||0)/(o||0)*100)}%)`)))},Ze={[ce.APPLICATION]:"COMMON_APPLICATION",[ce.TOTAL_TRAFFIC]:"ACTIVITY_DATA_TRAFFIC",[ce.TIME_ESTIMATE]:"ACTIVITY_TIME_ESTIMATE",[ce.DOWNLOAD]:"COMMON_DOWNLOAD",[ce.UPLOAD]:"COMMON_UPLOAD",[ce.EMPTY_SPACE]:void 0,[ce.TOP_CLIENT]:"ACTIVITY_TOP_CLIENT",[ce.CLIENT_COUNT]:"COMMON_CLIENTS"};var Xe=a(411502);const Ke=(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"})))));var Je=a(162420),Qe=a(956347),et=a(15095),tt=a(627440),at=a(277517);const rt=({onClick:e})=>r.createElement(v.sA,{id:"ACTIVITY_VIEW_ENCRYPTED_TOOLTIP",values:{button:r.createElement(We.A,{type:"button",variant:"inline",onClick:e},r.createElement(v.sA,{id:"COMMON_FLOWS"}))}}),lt={open:0,close:200},it=(0,r.memo)(()=>{const e=(0,Qe.W6)(),t=(0,l.useSelector)(at.YX),a=(0,et.A)(`${tt.VO.INSIGHTS}/${o.H.FLOWS}`),i=(0,r.useCallback)(t=>{t.stopPropagation(),e.push(a)},[e,a]);return t?r.createElement(He.A,{description:r.createElement(rt,{onClick:i}),portal:!0,delay:lt,isInteractive:!0,cursorType:"pointer"},r.createElement(Je.A,{isActive:!0,size:"original"})):null}),nt=(0,r.memo)(({isSummary:e,name:t,children:a,...l})=>r.createElement(C.A,{alignItems:"center",width:"100%",gap:w.YC},r.createElement(C.A,{alignItems:"center",justifyContent:"center",width:25,height:25,gap:w.YC},e?r.createElement(Ke,null):a),r.createElement(C.A,{gap:w.YC,alignItems:"center"},r.createElement(D.A,{color:"text-2",size:"medium",style:{whiteSpace:"nowrap"},isTruncated:!0},t||r.createElement(v.sA,{id:"COMMON_UNKNOWN"})),"compoundId"in l&&l.compoundId===Xe.jV?r.createElement(it,null):null))),ot=[{id:ce.APPLICATION,sortable:!0,label:r.createElement(S.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(v.sA,{id:Ze[ce.APPLICATION]})),minWidth:Ee[ce.APPLICATION],renderCell:({isSummary:e,name:t,iconFileName:a,compoundId:l})=>r.createElement(nt,{isSummary:e,name:t,compoundId:l},r.createElement(U.A,{iconFileName:a,dimension:Ve})),compare:xe(ce.APPLICATION)},{id:ce.TOTAL_TRAFFIC,sortable:!0,label:r.createElement(S.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(v.sA,{id:Ze[ce.TOTAL_TRAFFIC]})),minWidth:Ee[ce.TOTAL_TRAFFIC],renderCell:({isSummary:e,traffic_percentage:t=0,total_bytes:a=0})=>r.createElement(be,{isSummary:e,traffic_percentage:t,total_bytes:a}),compare:xe(ce.TOTAL_TRAFFIC)},{id:ce.DOWNLOAD,sortable:!0,label:r.createElement(S.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(v.sA,{id:Ze[ce.DOWNLOAD]})),minWidth:Ee[ce.DOWNLOAD],renderCell:({bytes_received:e=0})=>r.createElement(W.A.Bytes,{size:"medium"},(0,F.FI)(e)),compare:xe(ce.DOWNLOAD)},{id:ce.UPLOAD,sortable:!0,label:r.createElement(S.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(v.sA,{id:Ze[ce.UPLOAD]})),minWidth:Ee[ce.UPLOAD],renderCell:({bytes_transmitted:e=0})=>r.createElement(z.A.Bytes,{size:"medium"},(0,F.FI)(e)),compare:xe(ce.UPLOAD)},{id:ce.EMPTY_SPACE,sortable:!1,label:null,minWidth:Ee[ce.EMPTY_SPACE],renderCell:()=>null},{id:ce.TIME_ESTIMATE,sortable:!0,label:r.createElement(S.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(v.sA,{id:Ze[ce.TIME_ESTIMATE]})),minWidth:Ee[ce.TIME_ESTIMATE],renderCell:({isSummary:e,timeEstimate:t})=>r.createElement(S.A,{size:"medium",color:"text-2"},e?r.createElement(v.sA,{id:"COMMON_FALLBACK"}):r.createElement(ve.A,{uptime:t})),compare:xe(ce.TIME_ESTIMATE)},{id:ce.TOP_CLIENT,sortable:!0,label:r.createElement(S.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(v.sA,{id:Ze[ce.TOP_CLIENT]})),minWidth:Ee[ce.TOP_CLIENT],renderCell:({topClient:e})=>r.createElement(je,{topClient:e}),compare:xe(ce.TOP_CLIENT)},{id:ce.CLIENT_COUNT,sortable:!0,label:r.createElement(S.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(v.sA,{id:Ze[ce.CLIENT_COUNT]})),minWidth:Ee[ce.CLIENT_COUNT],renderCell:({clientCount:e=0})=>r.createElement(S.A,{size:"medium",color:"text-2"},e),compare:xe(ce.CLIENT_COUNT)}],ct=({formattedUsageByApp:e,activityGraphApp:t,queryParams:a})=>{const i=(0,l.useDispatch)(),n=(0,l.useSelector)(I.Wq);return(0,r.useEffect)(()=>{t[Se.wA.CAT]!==_e.ZM||t[Se.wA.APP]!==_e.Je?e.some(({application:e,category:a})=>t[Se.wA.CAT]===a&&t[Se.wA.APP]===e)?i((0,m.C)(a,{apps:[],client_macs:n},void 0,{crudCacheStrategy:{type:c.e.CACHE}})):i((0,De.Hl)({[Se.wA.CAT]:_e.ZM,[Se.wA.APP]:_e.Je})):1===e.length&&t[Se.wA.CAT]!==e[0].category&&t[Se.wA.APP]!==e[0].application&&i((0,De.Hl)({[Se.wA.CAT]:e[0].category,[Se.wA.APP]:e[0].application}))},[i,e,a,n,t]),null};var mt=a(596441),st=a(302167),At=a(928085),ut=a(959341),Tt=a(166048),dt=a(196010);const Et=()=>{const e=(0,At.A)(`${ut.bB}/${ut.Uy.TRAFFIC_LOGGING}`),t=(0,At.A)(`${ut.bB}/${ut.Uy.CYBERSECURE}`),{enabled:a}=(0,l.useSelector)(st.JY),{time_series_per_client_stats_enabled:i}=(0,l.useSelector)(st.aK),n=(0,r.useMemo)(()=>r.createElement(dt.A,{to:t},r.createElement(v.sA,{id:"COMMON_TRAFFIC_IDENTIFICATION"})),[t]),o=(0,r.useMemo)(()=>r.createElement(dt.A,{to:`${e}?${Tt.mv}=super_mgmt.time_series_per_client_stats_enabled`},r.createElement(v.sA,{id:"COMMON_COLLECT_HISTORICAL_CLIENT_DATA"})),[e]),c=(0,r.useMemo)(()=>a||i?a?i?r.createElement(v.sA,{id:"ACTIVITY_NO_TRAFFIC"}):r.createElement(v.sA,{id:"ACTIVITY_ENABLE_TO_VIEW_TRAFFIC_STATISTICS",values:{action:o}}):r.createElement(v.sA,{id:"ACTIVITY_ENABLE_TO_VIEW_TRAFFIC_STATISTICS",values:{action:n}}):r.createElement(v.sA,{id:"ACTIVITY_MULTI_ENABLE_TO_VIEW_TRAFFIC_STATISTICS",values:{action1:n,action2:o}}),[a,i,n,o]);return r.createElement(S.A,{color:"text-2",size:"medium"},c)},Ct=()=>r.createElement(Et,null),pt={disableColumnFilters:!0,rowHeight:mt.I.ROW_HEIGHT,initiallySortAscending:!1,renderPlaceholder:Ct,placeholderClassName:pe},ht=({isSummary:e,compoundId:t})=>({[Ie.L]:e?se:String(t)}),Ot=(e,t)=>{const{formatMessage:a}=(0,v.tz)(),i=(0,l.useDispatch)(),n=(0,l.useSelector)(ge.m9),o=(0,l.useSelector)(ee.EL),c=(0,l.useSelector)(ge.jY),m=(0,l.useSelector)(I.Wq),s=(0,r.useMemo)(()=>a({id:"COMMON_ALL_TRAFFIC"}),[a]),A=(0,l.useSelector)((0,r.useMemo)(()=>(0,d.mH)(e),[e])),u=(0,l.useSelector)((0,r.useMemo)(()=>(0,d.Gb)(s,e),[s,e])),T=(0,l.useSelector)((0,r.useMemo)(()=>m.length?(0,d.Nu)(s):Le.A,[s,m])),E=(0,l.useSelector)((0,r.useMemo)(()=>m.length?(0,d.Hy)(m,e):Ne.A,[m,e])),C=(0,r.useMemo)(()=>A.length>1?Array.prototype.concat.apply([],[u,A]).flat():A,[u,A]),p=(0,r.useMemo)(()=>E.length>1?Array.prototype.concat.apply([],[T,E]).flat():E,[T,E]),h=(0,r.useCallback)(({category:e,application:t})=>i((0,De.Hl)({[Se.wA.CAT]:e,[Se.wA.APP]:t})),[i]),O=(0,r.useCallback)(({isSummary:e,compoundId:t})=>n&&!e&&c&&!o?r.createElement(Pe.A,{dpiAppId:t}):null,[n,c,o]),y=(0,r.useMemo)(()=>({idField:"compoundId",items:m.length?p:C,columns:ot,columnOverride:m.length?ue:Ae,initialSortBy:ce.TOTAL_TRAFFIC,onRowClick:h,rowProps:ht,renderHoverContent:O}),[C,p,m,h,O]),_=(0,r.useMemo)(()=>r.createElement(Me.A,{...pt,...y}),[y]);return r.createElement(r.Fragment,null,r.createElement(ct,{formattedUsageByApp:y.items,activityGraphApp:t,queryParams:e}),_)},yt={[me.CLIENT]:"COMMON_CLIENT",[me.TOTAL_TRAFFIC]:"ACTIVITY_DATA_TRAFFIC",[me.DOWNLOAD]:"COMMON_DOWNLOAD",[me.UPLOAD]:"COMMON_UPLOAD",[me.EMPTY_SPACE]:void 0,[me.TIME_ESTIMATE]:"ACTIVITY_TIME_ESTIMATE",[me.TOP_APPS]:"COMMON_TOP_APPS",[me.APP_COUNT]:"COMMON_APPS"},It=({topApps:e})=>r.createElement(C.A,{gap:w.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(Be,{key:o},r.createElement(Ge,{description:r.createElement(C.A,{flexDirection:"column",gap:w.YC,minWidth:200},r.createElement(C.A,{position:"relative",right:w.YC,alignItems:"center",gap:w.YC},r.createElement(U.A,{iconFileName:m,dimension:Ve}),r.createElement(S.A,{size:"small",color:"text-1",weight:"bold"},c)),r.createElement(C.A,{justifyContent:"space-between"},r.createElement(S.A,{size:"small",color:"text-1"},r.createElement(v.sA,{id:"COMMON_TRAFFIC"})),r.createElement(S.A,{size:"small",color:"text-2"},`${(0,F.FI)(t-(t-a))} (${s=(0,Ye.E)(a/t*100),String(0===s?"<0.1":s)}%)`)),r.createElement(C.A,{justifyContent:"space-between"},r.createElement(S.A,{size:"small",color:"text-1"},r.createElement(v.sA,{id:"COMMON_DOWNLOAD"})),r.createElement(S.A,{size:"small",color:"traffic-down"},(0,F.FI)(l))),r.createElement(C.A,{justifyContent:"space-between"},r.createElement(S.A,{size:"small",color:"text-1"},r.createElement(v.sA,{id:"COMMON_UPLOAD"})),r.createElement(S.A,{size:"small",color:"traffic-up"},(0,F.FI)(i))),e?null:r.createElement(C.A,{justifyContent:"space-between"},r.createElement(S.A,{size:"small",color:"text-1"},r.createElement(v.sA,{id:"ACTIVITY_TIME_ESTIMATE"})),r.createElement(S.A,{size:"small",color:"text-2"},r.createElement(ve.A,{uptime:n})))),portal:!0,delay:0,cursorType:"pointer"},r.createElement(U.A,{iconFileName:m,dimension:Ve})));var s})((0,x.HH)(o)))((0,b.h)(o,c)))),_t=({isSummary:e,client:t,name:a})=>{const i=(0,l.useDispatch)(),n=(0,r.useCallback)(e=>{e.stopPropagation(),i((0,ze.XP)({type:Ue.H.CLIENT,id:t.mac}))},[i,t.mac]);return r.createElement(nt,{isSummary:e,name:a},r.createElement(Re.A,{width:Ve,height:Ve,client:t,onClick:n}))},ft=[{id:me.CLIENT,sortable:!0,label:r.createElement(S.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(v.sA,{id:yt[me.CLIENT]})),minWidth:Ce[me.CLIENT],renderCell:({isSummary:e,client:t,name:a})=>r.createElement(_t,{isSummary:e,client:t,name:a}),compare:xe(me.CLIENT)},{id:me.TOTAL_TRAFFIC,sortable:!0,label:r.createElement(S.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(v.sA,{id:yt[me.TOTAL_TRAFFIC]})),minWidth:Ce[me.TOTAL_TRAFFIC],renderCell:({isSummary:e,traffic_percentage:t=0,total_bytes:a=0})=>r.createElement(be,{isSummary:e,traffic_percentage:t,total_bytes:a}),compare:xe(me.TOTAL_TRAFFIC)},{id:me.DOWNLOAD,sortable:!0,label:r.createElement(S.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(v.sA,{id:yt[me.DOWNLOAD]})),minWidth:Ce[me.DOWNLOAD],renderCell:({bytes_received:e=0})=>r.createElement(W.A.Bytes,{size:"medium"},(0,F.FI)(e)),compare:xe(me.DOWNLOAD)},{id:me.UPLOAD,sortable:!0,label:r.createElement(S.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(v.sA,{id:yt[me.UPLOAD]})),minWidth:Ce[me.UPLOAD],renderCell:({bytes_transmitted:e=0})=>r.createElement(z.A.Bytes,{size:"medium"},(0,F.FI)(e)),compare:xe(me.UPLOAD)},{id:me.EMPTY_SPACE,sortable:!1,label:null,minWidth:Ce[me.EMPTY_SPACE],renderCell:()=>null},{id:me.TIME_ESTIMATE,sortable:!0,label:r.createElement(S.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(v.sA,{id:yt[me.TIME_ESTIMATE]})),minWidth:Ce[me.TIME_ESTIMATE],renderCell:({isSummary:e,timeEstimate:t})=>r.createElement(S.A,{size:"medium",color:"text-2"},e?r.createElement(v.sA,{id:"COMMON_FALLBACK"}):r.createElement(ve.A,{uptime:t})),compare:xe(me.TIME_ESTIMATE)},{id:me.TOP_APPS,sortable:!0,label:r.createElement(S.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(v.sA,{id:yt[me.TOP_APPS]})),minWidth:Ce[me.TOP_APPS],renderCell:({topApps:e})=>r.createElement(It,{topApps:e}),compare:xe(me.TOP_APPS)},{id:me.APP_COUNT,sortable:!0,label:r.createElement(S.A,{size:"medium",weight:"bold",color:"inherit"},r.createElement(v.sA,{id:yt[me.APP_COUNT]})),minWidth:Ce[me.APP_COUNT],renderCell:({appCount:e})=>r.createElement(S.A,{size:"medium",color:"text-2"},e),compare:xe(me.APP_COUNT)}],Mt=({formattedUsageByClient:e,activityGraphClient:t,queryParams:a})=>{const i=(0,l.useDispatch)(),n=(0,l.useSelector)(I.Uz);return(0,r.useEffect)(()=>{t!==_e.Y$?e.some(({mac:e})=>e===t)?i((0,m.C)(a,{apps:n,client_macs:[]},void 0,{crudCacheStrategy:{type:c.e.CACHE}})):i((0,De.fT)(_e.Y$)):1===e.length&&e[0].mac!==t&&i((0,De.fT)(e[0].mac))},[i,e,a,n,t]),null},gt=({isSummary:e,client:{mac:t}})=>({[Ie.L]:e?se:t}),Pt={disableColumnFilters:!0,rowHeight:mt.I.ROW_HEIGHT,initiallySortAscending:!1,renderPlaceholder:Ct,placeholderClassName:pe},Lt=(e,t)=>{const{formatMessage:a}=(0,v.tz)(),i=(0,l.useDispatch)(),n=(0,l.useSelector)(I.Uz),o=(0,r.useMemo)(()=>a({id:"COMMON_ALL_CLIENTS"}),[a]),c=(0,l.useSelector)((0,r.useMemo)(()=>(0,d.WY)(e),[e])),m=(0,l.useSelector)((0,r.useMemo)(()=>(0,d._)(o,e),[o,e])),s=(0,l.useSelector)((0,r.useMemo)(()=>n.length?(0,d.x4)(n,e):Ne.A,[n,e])),u=(0,l.useSelector)((0,r.useMemo)(()=>n.length?(0,d.lz)(o):Le.A,[o,n])),T=(0,r.useMemo)(()=>c.length>1?Array.prototype.concat.apply([],[m,c]).flat():c,[m,c]),E=(0,r.useMemo)(()=>s.length>1?Array.prototype.concat.apply([],[u,s]).flat():s,[u,s]),C=(0,r.useCallback)(({client:{mac:e=_e.Y$}})=>i((0,De.fT)(e)),[i]),p=(0,r.useMemo)(()=>({idField:"mac",items:n.length?E:T,columns:ft,columnOverride:n.length?de:Te,initialSortBy:me.TOTAL_TRAFFIC,onRowClick:C,rowProps:gt,renderHoverContent:A.Ay}),[T,E,n,C]),h=(0,r.useMemo)(()=>r.createElement(Me.A,{...Pt,...p}),[p]);return r.createElement(r.Fragment,null,r.createElement(Mt,{formattedUsageByClient:p.items,activityGraphClient:t,queryParams:e}),h)},Nt=({queryParams:e})=>{const t=(0,l.useSelector)(I.nc),a=(0,l.useSelector)(I.Jd),i=(0,l.useSelector)(I.dX),n=Ot(e,i),o=Lt(e,a);return r.createElement(fe,{activityTab:t,activityGraphApp:i,activityGraphClient:a},t===Oe.f.CLIENTS?n:o)},St=({queryParams:e})=>r.createElement(he,null,r.createElement(Nt,{queryParams:e})),Dt=(0,r.memo)(()=>{const e=(0,l.useDispatch)(),{ref:t,height:a}=(0,i.A)(),A=(0,l.useSelector)(I.Vn),E=(0,l.useSelector)(I.Bw),C=(0,l.useSelector)(I.eD),p=(0,r.useMemo)(()=>({start:E.startDate.getTime(),end:E.endDate.getTime(),includeUnidentified:!0}),[E]),h=(0,l.useSelector)(T.Z7),O=(0,l.useSelector)((0,r.useMemo)(()=>(0,d.Vg)(p),[p]));return u(()=>{h||e((0,m.C)(p,C)),O||e((0,s._)(p))}),(0,n.A)([(0,m.C)(p,C,void 0,{crudCacheStrategy:{type:c.e.CACHE}}),(0,s._)(p,void 0,{crudCacheStrategy:{type:c.e.CACHE}})],r.createElement(ne,null,r.createElement(oe,{ref:t},A?r.createElement(ie,{activityContainerHeight:a,activityDateRange:E}):null,r.createElement(St,{queryParams:p}))),{trackingName:o.H.ACTIVITY})})},854398:(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,{w:()=>l});var r=a(945132);const l=(e,t)=>Math.floor(Math.abs(new Date(t).getTime()-new Date(e).getTime())/r.jU)}}]);