"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[4281],{963495:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Yt});var r=a(296540),n=a(469733),l=a(340936),i=a(582724),s=a(413357),c=a(834959),o=a(592510),E=a(984652),m=a(171073),A=a(580987),u=a(755528),d=a(71479),p=a(294303),C=a(566723);const h=(0,d.A)(p.A)`
  flex-direction: column;
  height: 100%;
  padding-top: ${C.xO};
  gap: ${C.Ln};
  overflow: hidden;
`;var S,y=a(762629);!function(e){e.RETRIES="retries",e.SIGNAL="signal",e.EVENTS="events",e.DOWNLOAD_PACKETS="downloadPackets",e.UPLOAD_PACKETS="uploadPackets",e.POE_USAGE="poeUsage"}(S||(S={}));const N={limit:200,separateConnectionSignalParam:!1,scope:void 0},O={[S.RETRIES]:!0,[S.SIGNAL]:!1,[S.EVENTS]:!0,[S.DOWNLOAD_PACKETS]:!1,[S.UPLOAD_PACKETS]:!1,[S.POE_USAGE]:!1},D={[S.RETRIES]:!1,[S.SIGNAL]:!0,[S.EVENTS]:!1,[S.DOWNLOAD_PACKETS]:!1,[S.UPLOAD_PACKETS]:!1,[S.POE_USAGE]:!0};var g=a(936344),_=a(656372),T=a(87250),M=a(212401),x=a(840279),z=a(468063),P=a(964238),f=a(998837),I=a(822336);const k={[S.RETRIES]:"green-06",[S.SIGNAL]:"aqua-06",[S.EVENTS]:"ublue-06",[S.DOWNLOAD_PACKETS]:"aqua-06",[S.UPLOAD_PACKETS]:"purple-06",[S.POE_USAGE]:"orange-06"},L=({userReport:e,getCoordinates:t,mouseData:a,maxY:n,yAxisMax:l,yAxisMin:i,y2AxisMax:s,y2AxisMin:c,chartHovered:o,tooltipContainer:E,analyzerGraphState:m,renderTooltip:d})=>{const p=(0,r.useContext)(u.A),{themeName:C}=(0,f.u)(),h=(0,r.useMemo)(()=>`${m}GradientId`,[m]),y=(0,r.useMemo)(()=>I.Ay[`desktop-color-${k[m]}-${C}`],[m,C]),N=(0,r.useCallback)(({txRetries:e,signal:t,tx_packets:a,rx_packets:r,poe_usage:n})=>{switch(m){case S.RETRIES:return e;case S.SIGNAL:return t||-100;case S.DOWNLOAD_PACKETS:return r;case S.UPLOAD_PACKETS:return a;case S.POE_USAGE:return n;default:return 0}},[m]),g=(0,r.useMemo)(()=>e.map(({time:e,signal:t=0,tx_retries:a=0,wifi_tx_attempts:r=0,wifi_tx_dropped:n=0,tx_packets:l=0,rx_packets:i=0,poe_usage:s=0})=>{return c=Math.round(100*a/(a+r+n||1)),{x:e,y:N({txRetries:c,signal:t,tx_packets:l,rx_packets:i,poe_usage:s}),custom:{txRetries:c,signalStrength:t,txPackets:l,rxPackets:i,poeUsage:s}};var c}),[e,N]),_=(0,r.useCallback)(e=>d(e,m,y),[d,y,m]);return r.createElement(P.A,{data:g,maxY:n,forY2Axis:D[m],yAxisMax:l,yAxisMin:i,y2AxisMax:s,y2AxisMin:c,mouseData:a,getCoordinates:t,lineColor:y,variant:"line",interpolation:"curved",dashed:O[m],tooltipPortal:E?.current,customGradientId:h,renderTooltip:_,showTooltip:o&&!p[A.z.ACTIVE_ROWS].length})};var G=a(584916),v=a(675556),R=a(874734);const w={[v.sw.THIRTY_MINUTES]:R.FE.MINUTES,[v.sw.ONE_HOUR]:R.FE.MINUTES,[v.sw.ONE_DAY]:R.FE.MINUTES,[v.sw.ONE_WEEK]:R.FE.HOURLY,[v.sw.ONE_MONTH]:R.FE.DAILY,[G.j]:R.FE.DAILY},U={[R.FE.MINUTES]:3e5,[R.FE.HOURLY]:36e5,[R.FE.DAILY]:864e5};var W=a(13994),b=a(217439),$=a(459449);const H=({timestamp:e,dayDifference:t,intervalSeconds:a,txRetries:n,signalStrength:l,analyzerDateTimeFormats:{full:i,short:s},analyzerGraphRetriesState:c,analyzerGraphSignalState:o})=>r.createElement(p.A,{flexDirection:"column",width:"100%",whiteSpace:"nowrap",gap:C.YC},r.createElement(p.A,{justifyContent:"space-between"},r.createElement(b.A,{size:"small",color:"text-1"},r.createElement($.sA,{id:"COMMON_DATE_TIME"})),r.createElement(b.A,{size:"small",color:"text-2"},i.format(e),t<=7&&a?r.createElement(r.Fragment,null," - ",s.format(e+1e3*a)):null)),c?r.createElement(p.A,{alignItems:"center",justifyContent:"space-between"},r.createElement(b.A,{size:"small",color:"text-1"},r.createElement($.sA,{id:"COMMON_TX_RETRIES"})),r.createElement(b.A,{size:"small",color:"text-2"},(-1===n?0:n).toFixed(1),"%")):null,o?r.createElement(p.A,{alignItems:"center",justifyContent:"space-between"},r.createElement(b.A,{size:"small",color:"text-1"},r.createElement($.sA,{id:"COMMON_SIGNAL_STRENGTH"})),r.createElement(b.A,{size:"small",color:"text-2"},l.toFixed(1)," ",r.createElement($.sA,{id:"COMMON_UNIT_DBM"}))):null),K=({x:e,left:t,top:a,hidden:n,gradientColor:l,signalTooltipProps:i,analyzerGraphRetriesState:s,analyzerGraphSignalState:c,analyzerGraphState:o,dayDifference:E,chartHeight:m,chartWidth:A,txRetries:u,signalStrength:d,analyzerDateTimeFormats:p,intervalSeconds:C})=>r.createElement(W.A,{width:300,topA:a,leftA:t,topB:i.top,leftB:i.left,chartWidth:A,chartHeight:m,hidden:n,description:r.createElement(H,{timestamp:e,dayDifference:E,intervalSeconds:C,txRetries:u,signalStrength:d,analyzerDateTimeFormats:p,analyzerGraphRetriesState:s,analyzerGraphSignalState:c}),innerColor:l,tooltipRenderCondition:![s,c].every(Boolean)||o===S.SIGNAL});var V=a(866816),F=a(500235);const Y=(0,d.A)(p.A)`
  width: 100%;
  flex-direction: column;
`;var B=a(118818);const Z=(0,d.A)(p.A)`
  flex-direction: column;
  gap: ${C.YC};
`,j=(0,d.A)(p.A)`
  gap: ${C.xO};
  > div:first-child {
    margin-top: 6px;
  }
`,X=(0,d.A)(p.A)`
  flex-direction: column;
  gap: 2px;
`;var Q=a(351063),q=a(758649),J=a(956347),ee=a(959341),te=a(928085),ae=a(275357),re=a(845030),ne=a(398300);const le=({parameters:e})=>{const t=(0,n.useDispatch)(),a=(0,J.W6)(),l=(0,r.useCallback)(()=>{t((0,re.XP)({type:ne.H.DEVICE,id:e[ae.cr.DEVICE]?.id}))},[t,e]),i=e[ae.cr.WLAN]?.id,s=(0,te.A)(`${ee._L}${i?`/${i}`:""}`),c=(0,r.useCallback)(()=>{a.push(s)},[a,s]);return r.createElement(b.A,{size:"inherit",color:"inherit"},r.createElement($.sA,{id:"ANALYZER_CONNECTED_EVENT",values:{network:r.createElement(q.A,{type:"button",variant:"inline",onClick:c},e[ae.cr.WLAN]?.name||r.createElement($.sA,{id:"COMMON_UNKNOWN"})),device:r.createElement(q.A,{type:"button",variant:"inline",onClick:l},e[ae.cr.DEVICE]?.name||r.createElement($.sA,{id:"COMMON_UNKNOWN"}))}}))},ie=({parameters:e})=>{const t=(0,n.useDispatch)(),a=(0,J.W6)(),l=(0,r.useCallback)(()=>{t((0,re.XP)({type:ne.H.DEVICE,id:e[ae.cr.DEVICE]?.id}))},[t,e]),i=e[ae.cr.WLAN]?.id,s=(0,te.A)(`${ee._L}${i?`/${i}`:""}`),c=(0,r.useCallback)(()=>{a.push(s)},[a,s]);return r.createElement(b.A,{size:"inherit",color:"inherit"},r.createElement($.sA,{id:"ANALYZER_DISCONNECTED_EVENT",values:{network:r.createElement(q.A,{type:"button",variant:"inline",onClick:c},e[ae.cr.WLAN]?.name||r.createElement($.sA,{id:"COMMON_UNKNOWN"})),device:r.createElement(q.A,{type:"button",variant:"inline",onClick:l},e[ae.cr.DEVICE]?.name||r.createElement($.sA,{id:"COMMON_UNKNOWN"}))}}))},se=({parameters:e})=>{const t=(0,n.useDispatch)(),a=(0,r.useCallback)(()=>{t((0,re.XP)({type:ne.H.DEVICE,id:e[ae.cr.DEVICE_FROM]?.id}))},[t,e]),l=(0,r.useCallback)(()=>{t((0,re.XP)({type:ne.H.DEVICE,id:e[ae.cr.DEVICE_TO]?.id}))},[t,e]);return r.createElement(b.A,{size:"inherit",color:"inherit"},r.createElement($.sA,{id:"ANALYZER_ROAMED_EVENT",values:{deviceFrom:r.createElement(q.A,{type:"button",variant:"inline",onClick:a},e[ae.cr.DEVICE_FROM]?.name||r.createElement($.sA,{id:"COMMON_UNKNOWN"})),deviceTo:r.createElement(q.A,{type:"button",variant:"inline",onClick:l},e[ae.cr.DEVICE_TO]?.name||r.createElement($.sA,{id:"COMMON_UNKNOWN"}))}}))},ce=({parameters:e})=>{const t=(0,n.useDispatch)(),a=(0,J.W6)(),l=(0,r.useCallback)(()=>{t((0,re.XP)({type:ne.H.DEVICE,id:e[ae.cr.DEVICE]?.id}))},[t,e]),i=e[ae.cr.NETWORK]?.id,s=(0,te.A)(`${ee.Cs}${i?`/${i}`:""}`),c=(0,r.useCallback)(()=>{a.push(s)},[a,s]);return r.createElement(b.A,{size:"inherit",color:"inherit"},r.createElement($.sA,{id:"ANALYZER_CONNECTED_EVENT",values:{network:r.createElement(q.A,{type:"button",variant:"inline",onClick:c},e[ae.cr.NETWORK]?.name||r.createElement($.sA,{id:"COMMON_UNKNOWN"})),device:r.createElement(q.A,{type:"button",variant:"inline",onClick:l},e[ae.cr.DEVICE]?.name||r.createElement($.sA,{id:"COMMON_UNKNOWN"}))}}))},oe=({parameters:e})=>{const t=(0,n.useDispatch)(),a=(0,J.W6)(),l=(0,r.useCallback)(()=>{t((0,re.XP)({type:ne.H.DEVICE,id:e[ae.cr.DEVICE]?.id}))},[t,e]),i=e[ae.cr.NETWORK]?.id,s=(0,te.A)(`${ee.Cs}${i?`/${i}`:""}`),c=(0,r.useCallback)(()=>{a.push(s)},[a,s]);return r.createElement(b.A,{size:"inherit",color:"inherit"},r.createElement($.sA,{id:"ANALYZER_DISCONNECTED_EVENT",values:{network:r.createElement(q.A,{type:"button",variant:"inline",onClick:c},e[ae.cr.NETWORK]?.name||r.createElement($.sA,{id:"COMMON_UNKNOWN"})),device:r.createElement(q.A,{type:"button",variant:"inline",onClick:l},e[ae.cr.DEVICE]?.name||r.createElement($.sA,{id:"COMMON_UNKNOWN"}))}}))},Ee=({log:{key:e,parameters:t}})=>Q.w0.includes(e)?r.createElement(le,{parameters:t}):Q.fq.includes(e)?r.createElement(ce,{parameters:t}):Q.en.includes(e)?r.createElement(ie,{parameters:t}):Q.pV.includes(e)?r.createElement(oe,{parameters:t}):Q.dD.includes(e)?r.createElement(se,{parameters:t}):null,me=({analyzerEventValue:e,analyzerDateTimeFormats:t})=>{const{themeName:a}=(0,f.u)();return r.createElement(Z,null,e.slice(0,5).map(e=>r.createElement(j,{key:e.id},r.createElement(B.A,{size:"smaller",color:`${I.Ay[`desktop-color-text-2-${a}`]}`}),r.createElement(X,null,r.createElement(Ee,{log:e}),r.createElement(b.A,{size:"inherit",color:"text-3"},t.tooltip.format(e.timestamp))))))},Ae=({analyzerEventValue:e,analyzerDateTimeFormats:t})=>e.length>1?r.createElement(me,{analyzerEventValue:e,analyzerDateTimeFormats:t}):r.createElement(Ee,{log:e[0]}),ue=(0,d.A)(p.A)`
  margin-bottom: ${C.kc};
`,de=({analyzerDateTimeFormats:e,timestamp:t})=>r.createElement(ue,null,e.tooltip.format(t)),pe=(0,d.A)(p.A)`
  width: 100%;
  flex-direction: column;
  margin-top: ${C.kc};
`,Ce=(0,d.A)(p.A)`
  width: 100%;
  flex-direction: column;
  margin-top: ${C.YC};
`,he=(0,d.A)(p.A)`
  width: 100%;
  flex-direction: column;
  gap: ${C.YC};
`,Se=(0,d.A)(p.A)`
  width: 100%;
  justify-content: space-between;
`,ye=({parameters:e})=>{const[t,a]=e[ae.cr.WIFI_STATS]?.name?.split(", -")||[];return r.createElement(he,null,t?r.createElement(Se,null,r.createElement($.sA,{id:"COMMON_CHANNEL"}),r.createElement("div",null,t)):null,a?r.createElement(Se,null,r.createElement($.sA,{id:"COMMON_SIGNAL"}),r.createElement("div",null,"-",a)):null)};var Ne=a(670),Oe=a(438369);const De=(0,d.A)(p.A)`
  width: 100%;
  min-width: 260px;
  flex-direction: column;
  gap: ${C.YC};
`,ge=(0,d.A)(p.A)`
  width: 100%;
  justify-content: space-between;
`,_e=(0,d.A)(p.A)`
  gap: ${C.YC};
`,Te=(0,d.A)(p.A)`
  align-items: center;
`,Me=({parameters:e})=>{const t=(0,n.useDispatch)(),a=e[ae.cr.DURATION]?.name,l=e[ae.cr.DATA_DOWN]?.name,i=e[ae.cr.DATA_UP]?.name,s=e[ae.cr.DEVICE]?.name,c=e[ae.cr.SIGNAL_STRENGTH]?.name,o=(0,r.useCallback)(()=>{t((0,re.XP)({type:ne.H.DEVICE,id:e[ae.cr.DEVICE]?.id}))},[t,e]);return r.createElement(De,null,a?r.createElement(ge,null,r.createElement($.sA,{id:"COMMON_TIME_CONNECTED"}),r.createElement("div",null,a)):null,i||l?r.createElement(ge,{gap:C.YC},r.createElement($.sA,{id:"COMMON_DATA_USED"}),r.createElement(_e,null,l?r.createElement(Te,null,r.createElement(Ne.A.Icon,{size:"small"}),r.createElement(b.A,{size:"inherit",color:"traffic-down"},l)):null,i?r.createElement(Te,null,r.createElement(Oe.A.Icon,{size:"small"}),r.createElement(b.A,{size:"inherit",color:"traffic-up"},i)):null)):null,s||c?r.createElement(ge,null,r.createElement($.sA,{id:"COMMON_LAST_CONNECTED"}),r.createElement("div",null,r.createElement(q.A,{type:"button",variant:"inline",onClick:o},s||r.createElement($.sA,{id:"COMMON_UNKNOWN"}))," ",r.createElement("span",{style:{textTransform:"lowercase"}},r.createElement($.sA,{id:"COMMON_AT"}))," ",c||r.createElement($.sA,{id:"COMMON_FALLBACK"})," ",r.createElement($.sA,{id:"COMMON_UNIT_DBM"}))):null)},xe=(0,d.A)(p.A)`
  width: 100%;
  flex-direction: column;
  gap: ${C.YC};
`,ze=(0,d.A)(p.A)`
  width: 100%;
  justify-content: space-between;
`,Pe=({parameters:e})=>{const{formatMessage:t}=(0,$.tz)(),a=e[ae.cr.WIFI_STATS]?.name?.split(", -")?.[0],n=e[ae.cr.SIGNAL_STRENGTH_FROM]?.name,l=e[ae.cr.SIGNAL_STRENGTH]?.name;return r.createElement(xe,null,a?r.createElement(ze,null,r.createElement($.sA,{id:"COMMON_CHANNEL"}),r.createElement("div",null,a)):null,n&&l?r.createElement(ze,null,r.createElement($.sA,{id:"COMMON_ROAMING_DECISION"}),r.createElement("div",null,`${n} ${t({id:"COMMON_UNIT_DBM"})} ${t({id:"COMMON_TO"})} ${l} ${t({id:"COMMON_UNIT_DBM"})}`)):null)},fe=(0,d.A)(p.A)`
  width: 100%;
  flex-direction: column;
  gap: ${C.YC};
`,Ie=(0,d.A)(p.A)`
  width: 100%;
  justify-content: space-between;
`,ke=({parameters:e})=>{const t=e[ae.cr.CONNECTION_SPEED]?.name,a=e[ae.cr.IP]?.name;return r.createElement(fe,null,t?r.createElement(Ie,null,r.createElement($.sA,{id:"COMMON_LINK_SPEED"}),r.createElement("div",null,t)):null,a?r.createElement(Ie,null,r.createElement($.sA,{id:"COMMON_IP_ADDRESS"}),r.createElement("div",null,a)):null)},Le=(0,d.A)(p.A)`
  width: 100%;
  min-width: 260px;
  flex-direction: column;
  gap: ${C.YC};
`,Ge=(0,d.A)(p.A)`
  width: 100%;
  justify-content: space-between;
`,ve=(0,d.A)(p.A)`
  gap: ${C.YC};
`,Re=(0,d.A)(p.A)`
  align-items: center;
`,we=({parameters:e})=>{const t=e[ae.cr.DURATION]?.name,a=e[ae.cr.DATA_DOWN]?.name,n=e[ae.cr.DATA_UP]?.name;return r.createElement(Le,null,t?r.createElement(Ge,null,r.createElement($.sA,{id:"COMMON_TIME_CONNECTED"}),r.createElement("div",null,t)):null,n||a?r.createElement(Ge,{gap:C.YC},r.createElement($.sA,{id:"COMMON_DATA_USED"}),r.createElement(ve,null,a?r.createElement(Re,null,r.createElement(Ne.A.Icon,{size:"small"}),r.createElement(b.A,{size:"inherit",color:"traffic-down"},a)):null,n?r.createElement(Re,null,r.createElement(Oe.A.Icon,{size:"small"}),r.createElement(b.A,{size:"inherit",color:"traffic-up"},n)):null)):null)},Ue=({log:{key:e,parameters:t}})=>Q.w0.includes(e)?r.createElement(ye,{parameters:t}):Q.fq.includes(e)?r.createElement(ke,{parameters:t}):Q.en.includes(e)?r.createElement(Me,{parameters:t}):Q.pV.includes(e)?r.createElement(we,{parameters:t}):Q.dD.includes(e)?r.createElement(Pe,{parameters:t}):null,We=({analyzerEventValue:e})=>e.length>1?e.length>5?r.createElement(Ce,null,r.createElement($.sA,{id:"COMMON_X_MORE",values:{count:e.length-5}})):null:r.createElement(pe,null,r.createElement(Ue,{log:e[0]})),be=({analyzerEventValue:e,analyzerDateTimeFormats:t})=>r.createElement(Y,null,1===e.length?r.createElement(de,{analyzerDateTimeFormats:t,timestamp:e[0].timestamp}):null,r.createElement(Ae,{analyzerEventValue:e,analyzerDateTimeFormats:t}),r.createElement(We,{analyzerEventValue:e}));var $e=a(945132);const He=e=>e===v.sw.ONE_DAY?$e.$_/2:8*$e.$_,Ke=({clientLogsQueryParams:e,wifiPerformanceDateRange:{startDate:t,endDate:a,preset:l},getCoordinates:i,analyzerDateTimeFormats:s})=>{const c=(0,r.useContext)(u.A),o=(0,n.useSelector)((0,r.useMemo)(()=>(0,F.p)(e),[e])),E=(0,r.useCallback)(e=>{c[A.z.SET_ACTIVE_ROWS](e)},[c]),m=(0,r.useCallback)(()=>{c[A.z.SET_ACTIVE_ROWS]([])},[c]),d=(0,r.useCallback)(e=>r.createElement(be,{analyzerEventValue:e,analyzerDateTimeFormats:s}),[s]),p=(0,r.useCallback)(e=>(0,r.createElement)(Q.Q8[e[0].key],{...Q.n0}),[]);return r.createElement(V.A,{logs:o,range:{startDate:t,endDate:a},getCoordinates:i,getLogsDescription:d,getLogsIcon:p,onMouseEnter:E,onMouseLeave:m,eventGroupingRange:He(l)})},Ve=(0,d.A)(p.A)`
  width: 100%;
  position: relative;
  padding-right: ${C.xO};
`,Fe=e=>{const t=(0,r.useMemo)(()=>Math.round(.7*Math.round((e||0)/2)),[e]),a=(0,r.useMemo)(()=>t<400,[t]);return{chartHeight:t,isNarrowChart:a}};var Ye=a(638334),Be=a(366702),Ze=a(198494),je=a(602021),Xe=a(282556),Qe=a(195462),qe=a(854398);const Je=({preset:e,documentWidth:t,dayDifference:a,use24HourTime:r,siteTimezone:n,language:l,selfHourCycle:i,formatMessage:s,timestamps:c,startDate:o,endDate:E})=>{return m=c[0]||o.getTime(),A=c.length>1&&c[c.length-1]||E.getTime(),u=0===a?G.l.ONE_DAY:G.j,(0,Qe.v)([m,A],qe.P[e||u].frequency(t,a)).map((a,c)=>({label:qe.P[e||u].label({index:c,value:a,use24HourTime:r,siteTimezone:n,language:l,selfHourCycle:i,documentWidth:t,formatMessage:s}),value:a}));var m,A,u},et=({startDate:e,endDate:t,preset:a})=>{const{formatMessage:l}=(0,$.tz)(),{width:i}=(0,Be.A)(),s=(0,r.useMemo)(()=>(0,Ye.w)(e,t),[e,t]),c=(0,n.useSelector)(Ze.jc),o=(0,n.useSelector)(Ze.BQ),E=(0,n.useSelector)(je.hq),m=(0,n.useSelector)(Xe.zi);return{xAxis:Je({preset:a,documentWidth:i,dayDifference:s,use24HourTime:c,siteTimezone:E,language:m,selfHourCycle:o,formatMessage:l,startDate:e,endDate:t,timestamps:[]}),dayDifference:s}},tt=()=>{const e=(0,n.useSelector)(Ze.BQ),t=(0,n.useSelector)(je.hq),a=(0,n.useSelector)(Xe.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])},at=({isNarrowChart:e,isAnalyzerClientWireless:t,highestPackets:a,highestPoeUsage:l})=>{const i=(0,n.useSelector)(Xe.zi),{yAxis:s,y2Axis:c}=(0,r.useMemo)(()=>{const r=(0,Qe.Y)(t?-100:l?1.1*l:100,e?6:11,!e);return{yAxis:(0,Qe.Y)(t?100:a?1.1*a:100,e?6:11,!e),y2Axis:t?r.reverse():r}},[e,t,a,l]),o=(0,r.useMemo)(()=>Intl.NumberFormat(i,{notation:"compact",maximumFractionDigits:0}),[i]);return{yAxis:t?s:s.map(e=>({...e,label:o.format(+e.value)})),y2Axis:c}},rt=({isAnalyzerClientWireless:e})=>{const{formatMessage:t}=(0,$.tz)(),{yAxisTitle:a,y2AxisTitle:n}=(0,r.useMemo)(()=>({yAxisTitle:e?`${t({id:"COMMON_TX_RETRIES"})} (%)`:t({id:"COMMON_PACKETS"}),y2AxisTitle:t({id:e?"COMMON_UNIT_DBM":"COMMON_UNIT_W"})}),[t,e]);return{yAxisTitle:a,y2AxisTitle:n}},nt=({timestamp:e,dayDifference:t,intervalSeconds:a,txPackets:n,rxPackets:l,poeUsage:i,analyzerGraphDownloadPacketsState:s,analyzerGraphUploadPacketsState:c,analyzerGraphPoeUsageState:o,analyzerDateTimeFormats:{full:E,short:m}})=>r.createElement(p.A,{flexDirection:"column",width:"100%",whiteSpace:"nowrap",gap:C.YC},r.createElement(p.A,{justifyContent:"space-between"},r.createElement(b.A,{size:"small",color:"text-1"},r.createElement($.sA,{id:"COMMON_DATE_TIME"})),r.createElement(b.A,{size:"small",color:"text-2"},E.format(e),t<=7&&a?r.createElement(r.Fragment,null," - ",m.format(e+1e3*a)):null)),s?r.createElement(p.A,{alignItems:"center",justifyContent:"space-between"},r.createElement(b.A,{size:"small",color:"text-1"},r.createElement($.sA,{id:"COMMON_DOWNLOAD_PACKETS"})),r.createElement(b.A,{size:"small",color:"text-2"},Math.round(l).toLocaleString())):null,c?r.createElement(p.A,{alignItems:"center",justifyContent:"space-between"},r.createElement(b.A,{size:"small",color:"text-1"},r.createElement($.sA,{id:"COMMON_UPLOAD_PACKETS"})),r.createElement(b.A,{size:"small",color:"text-2"},Math.round(n).toLocaleString())):null,o?r.createElement(p.A,{alignItems:"center",justifyContent:"space-between"},r.createElement(b.A,{size:"small",color:"text-1"},r.createElement($.sA,{id:"COMMON_POE_USAGE"})),r.createElement(b.A,{size:"small",color:"text-2"},i.toFixed(1)," ",r.createElement($.sA,{id:"COMMON_UNIT_W"}))):null),lt=({x:e,left:t,top:a,hidden:n,gradientColor:l,poeUsageTooltipProps:i,analyzerGraphDownloadPacketsState:s,analyzerGraphUploadPacketsState:c,analyzerGraphPoeUsageState:o,analyzerGraphState:E,dayDifference:m,chartHeight:A,chartWidth:u,txPackets:d,rxPackets:p,poeUsage:C,analyzerDateTimeFormats:h,intervalSeconds:y})=>r.createElement(W.A,{width:300,topA:a,leftA:t,topB:i.top,leftB:i.left,chartWidth:u,chartHeight:A,hidden:n,description:r.createElement(nt,{timestamp:e,dayDifference:m,intervalSeconds:y,analyzerGraphDownloadPacketsState:s,analyzerGraphUploadPacketsState:c,analyzerGraphPoeUsageState:o,txPackets:d,rxPackets:p,poeUsage:C,analyzerDateTimeFormats:h}),innerColor:l,tooltipRenderCondition:![s,c].every(Boolean)||E===S.DOWNLOAD_PACKETS});var it=a(254476);const st=({isAnalyzerClientWireless:e,analyzerGraphRetriesState:t,analyzerGraphSignalState:a,analyzerGraphWirelessEventsState:i,analyzerGraphWiredEventsState:s,analyzerGraphDownloadPacketsState:c,analyzerGraphUploadPacketsState:o,analyzerGraphPoeUsageState:E,clientLogsQueryParams:m,analyzerClientMac:A,analyzerContainerHeight:u})=>{const d=(0,n.useDispatch)(),p=(0,r.useRef)(null),C=(0,r.useRef)({left:0,top:0}),h=(0,r.useRef)({left:0,top:0}),{ref:y,width:N=0}=(0,l.A)(),O=(0,n.useSelector)(z.Bl),{startDate:D,endDate:P,preset:f}=O,I=(0,r.useMemo)(()=>w[f],[f]),k=(0,r.useMemo)(()=>[A,D.getTime(),I,T.qv.USER],[A,D,I]),G=(0,n.useSelector)((0,r.useMemo)(()=>(0,M.aO)(...k),[k])),v=(0,n.useSelector)((0,r.useMemo)(()=>(0,it.hZ)(A),[A])),R=(0,r.useMemo)(()=>[v.mac,D.getTime(),v.port_idx,I],[v.mac,v.port_idx,D,I]),W=(0,n.useSelector)((0,r.useMemo)(()=>e?x.A:(0,M.A3)(...R),[e,R])),b=(0,r.useMemo)(()=>{const e={},t=G.length;for(let a=0;a<t;a+=1){const{time:t}=G[a];e[t]=W.find(e=>e.time===t)?.[`port_${v.port_idx}-poe_power`]||0}return e},[G,W,v.port_idx]),$=(0,r.useMemo)(()=>U[I],[I]),H=(0,r.useMemo)(()=>G.flatMap((e,t,a)=>{const r=a[t-1],n=r?(e.time-r.time)/$:null,l=b[e.time];return n>1?Array.from(Array(n).keys()).map(t=>({...e,signal:0,tx_retries:0,wifi_tx_attempts:0,wifi_tx_dropped:0,tx_packets:0,rx_packets:0,poe_usage:l,time:r.time+(t+1)*$})):[{...e,poe_usage:l}]}),[G,$,b]),{highestPackets:V,highestPoeUsage:F}=(0,r.useMemo)(()=>{let e=0,t=0,a=0;for(let r=0;r<H.length;r+=1){const{tx_packets:n=0,rx_packets:l=0,poe_usage:i=0}=H[r];l>e&&(e=l),n>t&&(t=n),i>a&&(a=i)}return{highestPackets:Math.max(0,c?e:0,o?t:0),highestPoeUsage:Math.max(0,E?a:0)}},[H,o,c,E]),Y=(0,r.useMemo)(()=>$/1e3,[$]),{chartHeight:B,isNarrowChart:Z}=Fe(u),{xAxis:j,dayDifference:X}=et({startDate:D,endDate:P,preset:f}),{yAxis:Q,y2Axis:q}=at({isNarrowChart:Z,isAnalyzerClientWireless:e,highestPackets:V,highestPoeUsage:F}),{y2AxisTitle:J}=rt({isAnalyzerClientWireless:e}),ee=tt(),te=(0,r.useCallback)(({hidden:e,left:n=0,top:l=0,x:i,custom:s},c,o)=>(t&&a&&c===S.SIGNAL&&(C.current={left:n,top:l}),r.createElement(K,{hidden:e,left:n,top:l,signalTooltipProps:C.current,x:i,customTooltipProps:s,chartHeight:B,chartWidth:N,analyzerGraphRetriesState:t,analyzerGraphSignalState:a,analyzerGraphState:c,gradientColor:o,dayDifference:X,txRetries:s?.txRetries,signalStrength:s?.signalStrength,analyzerDateTimeFormats:ee,intervalSeconds:Y})),[ee,B,N,t,a,C,X,Y]),ae=(0,r.useCallback)(({hidden:e,left:t=0,top:a=0,x:n,custom:l},i,s)=>(c&&o&&i===S.DOWNLOAD_PACKETS&&(h.current={left:t,top:a}),r.createElement(lt,{hidden:e,left:t,top:a,poeUsageTooltipProps:h.current,x:n,customTooltipProps:l,chartHeight:B,chartWidth:N,analyzerGraphDownloadPacketsState:c,analyzerGraphUploadPacketsState:o,analyzerGraphPoeUsageState:E,analyzerGraphState:i,gradientColor:s,dayDifference:X,txPackets:l?.txPackets,rxPackets:l?.rxPackets,poeUsage:l?.poeUsage,analyzerDateTimeFormats:ee,intervalSeconds:Y})),[ee,B,N,c,o,E,X,Y]),re=(0,r.useCallback)((e,n,l,i,s,c)=>r.createElement(r.Fragment,null,t?r.createElement(L,{userReport:H,getCoordinates:e,mouseData:n,maxY:l,yAxisMax:i,yAxisMin:s,y2AxisMax:i,y2AxisMin:s,chartHovered:c,tooltipContainer:p,analyzerGraphState:S.RETRIES,renderTooltip:te}):null,a?r.createElement(L,{userReport:H,getCoordinates:e,mouseData:n,maxY:l,yAxisMax:i,yAxisMin:s,y2AxisMax:i,y2AxisMin:s,chartHovered:c,tooltipContainer:p,analyzerGraphState:S.SIGNAL,renderTooltip:te}):null),[H,t,a,te]),ne=(0,r.useCallback)((e,t,a,n,l,i)=>r.createElement(r.Fragment,null,c?r.createElement(L,{userReport:H,getCoordinates:e,mouseData:t,maxY:a,yAxisMax:n,yAxisMin:l,y2AxisMax:n,y2AxisMin:l,chartHovered:i,tooltipContainer:p,analyzerGraphState:S.DOWNLOAD_PACKETS,renderTooltip:ae}):null,o?r.createElement(L,{userReport:H,getCoordinates:e,mouseData:t,maxY:a,yAxisMax:n,yAxisMin:l,y2AxisMax:n,y2AxisMin:l,chartHovered:i,tooltipContainer:p,analyzerGraphState:S.UPLOAD_PACKETS,renderTooltip:ae}):null,E?r.createElement(L,{userReport:H,getCoordinates:e,mouseData:t,maxY:a,yAxisMax:n,yAxisMin:l,y2AxisMax:n,y2AxisMin:l,chartHovered:i,tooltipContainer:p,analyzerGraphState:S.POE_USAGE,renderTooltip:ae}):null),[H,o,c,E,ae]),le=(0,r.useCallback)(t=>e&&i||!e&&s?r.createElement(Ke,{clientLogsQueryParams:m,wifiPerformanceDateRange:O,getCoordinates:t,analyzerDateTimeFormats:ee}):null,[e,m,O,i,s,ee]),ie=(0,r.useCallback)((t,a,n,l,i,s,c,o,E,m)=>r.createElement(r.Fragment,null,e?re(t,a,n,s,c,m):ne(t,a,n,s,c,m),le(t)),[e,re,ne,le]);return(0,r.useEffect)(()=>{d((0,_.EG)(...k))},[d,k,e]),(0,r.useEffect)(()=>{e||d((0,_.Kz)(...R))},[d,R,e]),r.createElement(Ve,{ref:y},r.createElement(g.A,{key:k.join(),xAxis:j,yAxis:Q,y2Axis:q,width:N,height:B,y2AxisTitle:J,margin:[20,48,20,24]},ie),r.createElement("div",{ref:p}))},ct=(0,d.A)(p.A)`
  flex-direction: column;
`,ot=(0,d.A)(p.A)`
  align-items: center;
  width: 100%;
  gap: ${C.kc};
  height: 32px;
`;(0,d.A)(p.A)`
  gap: ${C.kc};
`,(0,d.A)(p.A)`
  align-items: center;
  gap: ${C.kc};
  border-radius: ${I.Ay["desktop-radius-base"]};
  background: ${({theme:{themeName:e}})=>I.Ay[`desktop-color-neutral-01-${e}`]};
  padding: ${C.YC} ${C.kc};
  cursor: pointer;
  > label {
    > div:first-child {
      margin-right: 0;
    }
  }
`,(0,d.A)(p.A)`
  gap: 2px;
`,(0,d.A)(p.A,{shouldForwardProp:e=>"legend"!==e&&"dotted"!==e})`
  width: ${({dotted:e})=>e?"3px":"8px"};
  height: 3px;
  background-color: ${({legend:e,theme:{themeName:t}})=>I.Ay[`desktop-color-${e}-${t}`]};
`;var Et;!function(e){e.ID="id",e.LABEL="label",e.LEGEND="legend",e.CHECKED="checked",e.DASHED="dashed",e.ON_CLICK="onClick"}(Et||(Et={}));var mt=a(939416);const At=(0,d.A)(p.A)`
  gap: ${C.kc};
`,ut=(0,d.A)(p.A)`
  align-items: center;
  gap: ${C.kc};
  border-radius: ${I.Ay["desktop-radius-base"]};
  background: ${({theme:{themeName:e}})=>I.Ay[`desktop-color-neutral-01-${e}`]};
  padding: ${C.YC} ${C.kc};
  cursor: pointer;
  > label {
    > div:first-child {
      margin-right: 0;
    }
  }
`,dt=(0,d.A)(p.A)`
  gap: 2px;
`,pt=(0,d.A)(p.A,{shouldForwardProp:e=>"legend"!==e&&"dashed"!==e})`
  width: ${({dashed:e})=>e?"3px":"8px"};
  height: 3px;
  background-color: ${({legend:e,theme:{themeName:t}})=>I.Ay[`desktop-color-${e}-${t}`]};
`;var Ct=a(314714),ht=a(874807);const St=({id:e,label:t,legend:a,checked:n,dashed:l,onClick:i})=>r.createElement(ut,{key:e,onClick:i},r.createElement(Ct.A,{id:e,checked:n,onChange:ht.A}),r.createElement(dt,null,r.createElement(pt,{legend:a,dashed:l}),l?r.createElement(pt,{legend:a,dashed:l}):null),r.createElement(b.A,{size:"medium",color:"text-2"},r.createElement($.sA,{id:t}))),yt=({isAnalyzerClientWireless:e,analyzerGraphRetriesState:t,analyzerGraphSignalState:a,analyzerGraphWirelessEventsState:l,analyzerGraphWiredEventsState:i,analyzerGraphDownloadPacketsState:s,analyzerGraphUploadPacketsState:c,analyzerGraphPoeUsageState:o})=>{const E=(0,n.useDispatch)(),m=(0,r.useCallback)(()=>{(a||l)&&E((0,mt.u_)(!t))},[E,t,a,l]),A=(0,r.useCallback)(()=>{(t||l)&&E((0,mt.Sk)(!a))},[E,t,a,l]),u=(0,r.useCallback)(()=>{(t||a)&&E((0,mt.FN)(!l))},[E,t,a,l]),d=(0,r.useCallback)(()=>{(c||s||o)&&E((0,mt.Yb)(!i))},[E,c,i,s,o]),p=(0,r.useCallback)(()=>{(c||i)&&E((0,mt.Zq)(!s))},[E,s,c,i]),C=(0,r.useCallback)(()=>{(s||i||o)&&E((0,mt.aw)(!c))},[E,c,s,i,o]),h=(0,r.useCallback)(()=>{(s||c||i)&&E((0,mt.fv)(!o))},[E,c,s,i,o]),y=(0,r.useCallback)(t=>()=>{switch(t){case S.RETRIES:m();break;case S.SIGNAL:A();break;case S.EVENTS:(e?u:d)();break;case S.DOWNLOAD_PACKETS:p();break;case S.UPLOAD_PACKETS:C();break;case S.POE_USAGE:h()}},[e,m,A,C,p,u,d,h]),N=(0,r.useMemo)(()=>[{[Et.ID]:S.RETRIES,[Et.LABEL]:"COMMON_TX_RETRIES",[Et.LEGEND]:k[S.RETRIES],[Et.CHECKED]:t,[Et.DASHED]:O[S.RETRIES],[Et.ON_CLICK]:y(S.RETRIES)},{[Et.ID]:S.SIGNAL,[Et.LABEL]:"COMMON_SIGNAL_STRENGTH",[Et.LEGEND]:k[S.SIGNAL],[Et.CHECKED]:a,[Et.DASHED]:O[S.SIGNAL],[Et.ON_CLICK]:y(S.SIGNAL)},{[Et.ID]:S.EVENTS,[Et.LABEL]:"COMMON_EVENTS",[Et.LEGEND]:k[S.EVENTS],[Et.CHECKED]:l,[Et.DASHED]:O[S.EVENTS],[Et.ON_CLICK]:y(S.EVENTS)}],[y,t,a,l]),D=(0,r.useMemo)(()=>[{[Et.ID]:S.DOWNLOAD_PACKETS,[Et.LABEL]:"COMMON_DOWNLOAD_PACKETS",[Et.LEGEND]:k[S.DOWNLOAD_PACKETS],[Et.CHECKED]:s,[Et.DASHED]:O[S.DOWNLOAD_PACKETS],[Et.ON_CLICK]:y(S.DOWNLOAD_PACKETS)},{[Et.ID]:S.UPLOAD_PACKETS,[Et.LABEL]:"COMMON_UPLOAD_PACKETS",[Et.LEGEND]:k[S.UPLOAD_PACKETS],[Et.CHECKED]:c,[Et.DASHED]:O[S.UPLOAD_PACKETS],[Et.ON_CLICK]:y(S.UPLOAD_PACKETS)},{[Et.ID]:S.POE_USAGE,[Et.LABEL]:"COMMON_POE_USAGE",[Et.LEGEND]:k[S.POE_USAGE],[Et.CHECKED]:o,[Et.DASHED]:O[S.POE_USAGE],[Et.ON_CLICK]:y(S.POE_USAGE)},{[Et.ID]:S.EVENTS,[Et.LABEL]:"COMMON_EVENTS",[Et.LEGEND]:k[S.EVENTS],[Et.CHECKED]:i,[Et.DASHED]:O[S.EVENTS],[Et.ON_CLICK]:y(S.EVENTS)}],[y,c,s,i,o]);return r.createElement(At,null,(e?N:D).map(St))},Nt=({isAnalyzerClientWireless:e,analyzerGraphRetriesState:t,analyzerGraphSignalState:a,analyzerGraphWirelessEventsState:n,analyzerGraphWiredEventsState:l,analyzerGraphDownloadPacketsState:i,analyzerGraphUploadPacketsState:s,analyzerGraphPoeUsageState:c})=>r.createElement(ot,null,r.createElement(yt,{isAnalyzerClientWireless:e,analyzerGraphRetriesState:t,analyzerGraphSignalState:a,analyzerGraphWirelessEventsState:n,analyzerGraphWiredEventsState:l,analyzerGraphDownloadPacketsState:i,analyzerGraphUploadPacketsState:s,analyzerGraphPoeUsageState:c})),Ot=(0,r.memo)(({analyzerClientMac:e,isAnalyzerClientWireless:t,clientLogsQueryParams:a,analyzerContainerHeight:l})=>{const i=(0,n.useSelector)(y.OP),s=(0,n.useSelector)(y.SX),c=(0,n.useSelector)(y.x2),o=(0,n.useSelector)(y.CB),E=(0,n.useSelector)(y.XX),m=(0,n.useSelector)(y.ou),A=(0,n.useSelector)(y.xj);return r.createElement(ct,null,r.createElement(Nt,{isAnalyzerClientWireless:t,analyzerGraphRetriesState:i,analyzerGraphSignalState:s,analyzerGraphWirelessEventsState:c,analyzerGraphWiredEventsState:o,analyzerGraphDownloadPacketsState:E,analyzerGraphUploadPacketsState:m,analyzerGraphPoeUsageState:A}),r.createElement(st,{isAnalyzerClientWireless:t,analyzerGraphRetriesState:i,analyzerGraphSignalState:s,analyzerGraphWirelessEventsState:c,analyzerGraphWiredEventsState:o,analyzerGraphDownloadPacketsState:E,analyzerGraphUploadPacketsState:m,analyzerGraphPoeUsageState:A,clientLogsQueryParams:a,analyzerClientMac:e,analyzerContainerHeight:l}))});var Dt,gt=a(432589),_t=a(82226),Tt=a(481413);!function(e){e.DESCRIPTION="description",e.DATE="date"}(Dt||(Dt={}));var Mt=a(362156);const xt=({timestamp:e})=>r.createElement(Mt.A,{timestamp:e});var zt=a(690033);const Pt=e=>r.createElement(zt.A.Actionable,{log:e}),ft={[Dt.DESCRIPTION]:Pt,[Dt.DATE]:xt},It={[Dt.DESCRIPTION]:{size:700,minSize:700,maxSize:1/0},[Dt.DATE]:{size:80,minSize:80,maxSize:1/0}},kt={[Dt.DESCRIPTION]:"COMMON_DESCRIPTION",[Dt.DATE]:"COMMON_DATE_TIME"},Lt=e=>e,Gt=({header:{id:e}})=>r.createElement($.sA,{id:kt[e]}),vt=e=>It[e],Rt=({column:{id:e},getValue:t})=>ft[e](t()),wt=Object.values(Dt).map(e=>({id:e,accessorFn:Lt,header:Gt,cell:Rt,...vt(e),enableResizing:!1,enableSorting:!1}));var Ut=a(596441);const Wt="ANALYZER_LOG_TABLE_WRAPPER_CLASSNAME",bt="ANALYZER_LOG_TABLE_HEADER_CLASSNAME",$t="ANALYZER_LOG_TABLE_ROW_CLASSNAME",Ht=(0,d.A)(p.A)`
  width: 100%;
  height: 100%;
  overflow: auto;
  .${Wt} {
    width: 100%;
  }
  .${bt} {
    height: ${Ut.I.HEADER_HEIGHT}px;
    > tr {
      > th {
        padding-left: ${C.kc};
      }
    }
  }
  .${$t} {
    > td {
      padding-left: ${C.kc};
      > div {
        white-space: pre-line;
      }
    }
  }
`,Kt=()=>r.createElement(b.A,{size:"medium",color:"text-2"},r.createElement($.sA,{id:"ANALYZER_NO_LOGS"})),Vt=({clientLogsQueryParams:e})=>{const t=(0,n.useDispatch)(),a=(0,r.useRef)(null),l=(0,r.useContext)(u.A),{startDate:E,endDate:m}=(0,n.useSelector)(z.Bl),d=(0,n.useSelector)((0,r.useMemo)(()=>(0,F.p)(e),[e])),p=(0,r.useMemo)(()=>{const e=E.getTime(),t=m.getTime();return d.filter(({timestamp:a})=>(0,Tt.O)(a,e,t))},[d,E,m]);return(0,r.useEffect)(()=>{t((0,_t.p)({crudCacheStrategy:{type:o.e.CACHE}},{queryParams:e}))},[e,t]),(0,i.A)([(0,s.Zi)(c.B.SYSTEM_LOG),(0,s.Zi)(c.B.LOG_MESSAGES),(0,s.Zi)(c.B.SYSTEM_LOG_ACTION),(0,s.Zi)(c.B.LOG_SECTION)],p.length?r.createElement(Ht,{ref:a},r.createElement(gt.A,{data:p,columns:wt,wrapperClassName:Wt,parentRef:a,rowStyle:C.gc,headerClassName:bt,rowClassName:$t,renderPlaceholder:Kt,virtualize:p.length>50,activeRows:l[A.z.ACTIVE_ROWS]})):null)},Ft=(0,r.memo)(({clientLogsQueryParams:e})=>r.createElement(Vt,{clientLogsQueryParams:e})),Yt=(0,r.memo)(()=>{const e=(0,n.useDispatch)(),{ref:t,height:a}=(0,l.A)(),[d,p]=(0,r.useState)([]),C=(0,n.useSelector)(y.rI),S=(0,n.useSelector)((0,r.useMemo)(()=>(0,it.e8)(C),[C])),O=(0,r.useMemo)(()=>({mac:C,...N}),[C]),D=(0,r.useMemo)(()=>({[A.z.ACTIVE_ROWS]:d,[A.z.SET_ACTIVE_ROWS]:p}),[d]);return(0,r.useEffect)(()=>{e((0,E.Ic)(void 0,{crudCacheStrategy:{type:o.e.CACHE}})),e((0,m.Uc)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}))},[e]),(0,i.A)([(0,s.Zi)(c.B.ANALYZER),(0,E.$3)(void 0,{crudCacheStrategy:{type:o.e.CACHE}})],r.createElement(h,{ref:t},r.createElement(u.A.Provider,{value:D},r.createElement(Ot,{analyzerClientMac:C,isAnalyzerClientWireless:S,clientLogsQueryParams:O,analyzerContainerHeight:a}),r.createElement(Ft,{clientLogsQueryParams:O}))))})}}]);