(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[25220],{146750(e,t,n){var r=n(199554);e.exports=function(e){var t=r(e);return t.setMinutes(0,0,0),t}},535322(e,t,n){"use strict";n.d(t,{A:()=>h,I:()=>r});var r,a=n(274934),i=n(505817),o=n(753583),s=n(247816),d=n(565527),l=n(309130),m=n(100978),c=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(r||(r={}));const u=(0,s.A)(m.A,(0,c.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===d.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${d.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${d.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${i.Ay[`desktop-border-divider-${t}`]};`:""}
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${l.Ln}`:l.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||l.Ln};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>i.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,g=(0,s.A)(o.A,(0,c.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===d.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${d.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${d.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${i.Ay[`desktop-border-divider-${t}`]};`:""}
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===d.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${d.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${d.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${l.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${l.Ln} ${l.Ln};
      }
    }
  }
`,h=({type:e,marginBottom:t,margin:n,padding:i,flex:o,width:s,nested:d,...l})=>"items"in l?(0,a.jsx)(g,{marginBottom:t,margin:n,padding:i,flex:o,nested:d,...l}):(0,a.jsx)(u,{nested:d,width:s,marginBottom:t,margin:n,padding:i,flex:o,isButtonList:e===r.BUTTON_LIST,...l,children:l.children})},325220(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>q});var r=n(274934),a=n(977872),i=n(602086),o=n(684935),s=n(751271),d=n(293668),l=n(345272),m=n(309130),c=n(376892),u=n(100978),g=n(535322),h=n(470070),p=n(532565),A=n(416233),x=n(412160),f=n(113592),b=n(320018),E=n(752572),$=n(396489),I=n.n($),N=n(506411),T=n.n(N),M=n(146750),S=n.n(M),L=n(402868),y=n.n(L),R=n(601334),_=n.n(R),O=n(267740),j=n(702381),k=n(179102),C=n(833881),U=n(247816),v=n(263705),D=n(409844),B=n(528116),Y=n(927027),w=n(358248),H=n(570801),K=n(291508);const P=(0,U.A)(k.A,(0,K.A)("legendcolor"))`
  display: block;
  position: relative;
  padding-left: 20px;
  margin-left: 15px;

  ::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 1px;
    width: 12px;
    border-bottom: 1px ${({legendcolor:e})=>`solid ${e}`};
  }

  :last-of-type {
    margin-right: 0;
  }
`,F=(0,E.A)(6,e=>({value:e,label:String(e)})).reverse(),V=({motifPalette:{text02:e}})=>D.AH`
  fill: ${e};
  font-size: 11px;
`,G=(0,v.b)((0,i.memo)(({mac:e,keys:t,heading:n,theme:o,colors:s,noLegend:d=!1,fetchReport:l,legend:m,reportType:c=p.qv.UBB})=>{const g=(0,a.d4)((0,i.useMemo)(()=>(0,w.dF)(e,l,c,t),[e,l,c,t])),A=(0,a.d4)(H.jc),{xAxis:x,startDate:f}=(0,i.useMemo)(()=>(e=>({xAxis:e,startDate:e[0].value}))(((e,t,n=6)=>new Array(n+1).fill(0).map((r,a)=>{return i=T()(e,24/n*(n-a)),{label:y()(i,t),value:i.getTime()};var i}))(S()(_()(Date.now(),1)).getTime(),A?"H:ss":"ha")),[A]),b=(0,i.useMemo)(()=>{const e={},n=(0,O.Hf)(g.filter(e=>e.time>f).map(e=>({...e,x:e.time})),B.UE.MINUTES.grain);return n[0]&&t[0]in n[0]&&n.forEach(n=>{t.forEach((t,r)=>{e[t]||(e[t]={key:t,lineColor:s[r],maxY:0,data:[]}),e[t].data.push({x:n.x,y:n[t]})})}),e},[s,g,t,f]),E=(0,i.useMemo)(()=>{return(e=Math.max(...t.flatMap(e=>b[e]?b[e].data.map(e=>e.y||0):0),4))>5?(0,Y.Y)(e,6):F;var e},[b,t]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(u.A,{justifyContent:"space-between",marginBottom:20,children:[(0,r.jsx)(k.A,{size:"medium",weight:"bold",color:"text-1",children:(0,r.jsx)(h.sA,{id:n})}),d?null:(0,r.jsx)(u.A,{justifyContent:"flex-end",children:(0,r.jsx)(u.A,{children:m.map((e,t)=>(0,r.jsx)(P,{size:"medium",legendcolor:s[t],children:(0,r.jsx)(h.sA,{id:e})},e))})})]}),(0,r.jsx)(u.A,{children:(0,r.jsx)(C.A,{xAxis:x,yAxis:E,width:336,height:150,margin:[0,0,20,35],labelClassName:V(o),children:(e,n,a)=>(0,r.jsx)(r.Fragment,{children:t.map(t=>b[t]&&b[t].data.length?(0,r.jsx)(j.A,{data:b[t].data,maxY:a,mouseData:n,getCoordinates:e,variant:"gradientArea",lineColor:b[t].lineColor,dashed:!1,hideMissingData:!0},b[t].key):null)})})})]})},(e,t)=>e.mac===t.mac&&I()(e.keys,t.keys))),q=({activeItem:{mac:e,peer_ubb:t={},radio_table:n=[],model:E}})=>{const{formatMessage:$}=(0,h.tz)(),I=(0,a.wA)(),N=(0,i.useMemo)(()=>(n||[]).map(({name:e,radio:t})=>({id:e,label:`${$({id:(0,d.dI)(t)})}`})),[n,$]),T=(0,i.useMemo)(()=>[{id:e,label:(0,r.jsx)(h.sA,{id:"COMMON_AP"})},{id:t.mac,label:(0,r.jsx)(h.sA,{id:"DEVICE_TYPE_UBB_STATION"})}],[e,t.mac]),[M,S]=(0,i.useState)(e),[L,y]=(0,i.useState)(n?.[0]?.name||l._),{droppedStatKeys:R,retriesStatKeys:_}=(0,i.useMemo)(()=>({retriesStatKeys:[`${L}-tx_retries`],droppedStatKeys:[`${L}-rx_dropped`,`${L}-tx_dropped`]}),[L]);(0,i.useEffect)(()=>{I((0,A.aN)(M,p.qv.UBB))},[I,M]),(0,i.useEffect)(()=>{I((0,A.jU)(M,p.qv.UBB,R)),I((0,A.lV)(M,p.qv.UBB,_))},[I,R,_,M]);const O=(0,i.useCallback)(({id:e})=>{S(e)},[S]),j=(0,i.useCallback)(({id:e})=>{y(e)},[y]),k=(0,i.useMemo)(()=>[{id:"statistics",openByDefault:!0,label:(0,r.jsx)(c.A,{children:(0,r.jsx)(h.sA,{id:"DEVICE_PROPERTY_SYSTEM_STATISTICS"})}),renderContent:()=>(0,r.jsxs)(u.A,{flexDirection:"column",gap:m.Ln,children:[(0,r.jsx)(u.A,{width:"fit-content",children:(0,r.jsx)(o.A,{variant:"filter",tabs:T,onSelectTab:O})}),(0,r.jsx)(G,{mac:M,keys:["cpu","mem"],colors:[s.Ay["orange-1"],s.Ay["blue-3"]],heading:"DEVICE_PROPERTIES_LABEL_USAGE_PERCENT",fetchReport:A.aN,legend:["COMMON_CPU","COMMON_MEMORY"]}),(0,r.jsx)(u.A,{width:"fit-content",children:(0,r.jsx)(o.A,{variant:"filter",tabs:N,onSelectTab:j})}),(0,r.jsx)(G,{mac:M,keys:R,colors:[s.Ay["purple-1"],s.Ay["purple-1"]],noLegend:!0,fetchReport:A.jU,heading:"DEVICE_PROPERTIES_LABEL_DROPPED"}),(0,r.jsx)(G,{mac:M,keys:_,colors:[s.Ay["purple-1"]],noLegend:!0,fetchReport:A.lV,heading:"DEVICE_PROPERTIES_LABEL_RETRIES"})]})}],[N,R,_,M,T,O,j]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b.A,{mac:e,model:E,logType:f.F.DEVICE,label:"COMMON_HISTORY",ignoreActionableValues:[x.dl.DEVICE],hideClientTabs:!0}),(0,r.jsx)(g.A,{type:g.I.ACCORDION,items:k})]})}},927027(e,t,n){"use strict";n.d(t,{Y:()=>a,v:()=>i});var r=n(752572);const a=(e,t,n=!1)=>{const a=t-1;let i=Math.ceil(e);if(Number.isNaN(i))return[];const o=i%a;return 0!==o&&(i+=a-o),(0,r.A)(t,e=>{return{value:t=e?Math.ceil(e*(i/a)):0,label:n?e%2==0&&String(t)||null:String(t)};var t}).reverse()},i=(e,t)=>{const[n]=e,r=[n],a=e.length-1;for(let n=1;n<t-1;n+=1){const i=n*a/(t-1),o=Math.floor(i).toFixed();r[n]=Math.round(e[o]+(e[Math.ceil(i).toFixed()]-e[o])*(+i-+o))}return r[t-1]=e[a],r}},528116(e,t,n){"use strict";n.d(t,{$V:()=>s,UE:()=>o,Vi:()=>d});var r=n(368741),a=n.n(r),i=n(232087);const o={NONE:{url:null,grain:null,grainInSeconds:null,translationKey:null},MINUTES:{url:i.FE.MINUTES,grain:3e5,grainInSeconds:300,translationKey:"GRANULARITY_5_MINUTES"},HOURLY:{url:i.FE.HOURLY,grain:36e5,grainInSeconds:3600,translationKey:"GRANULARITY_HOURLY"},DAILY:{url:i.FE.DAILY,grain:864e5,grainInSeconds:86400,translationKey:"GRANULARITY_DAILY"},MONTHLY:{url:i.FE.MONTHLY,grain:2592e6,grainInSeconds:2592e3,translationKey:"GRANULARITY_MONTHLY"}},s=(e,t,n,r)=>{const i=a()(t,e);return n&&(i<1||r&&i<=1)?o.MINUTES:i<=7?o.HOURLY:i<120?o.DAILY:o.MONTHLY},d=(e,t)=>{switch(e){case i.FE.DAILY:return`1${t({id:"COMMON_UNIT_D"})}`;case i.FE.HOURLY:return`1${t({id:"COMMON_UNIT_H"})}`;case i.FE.MINUTES:return`5${t({id:"COMMON_UNIT_MIN"})}`;default:return""}}}}]);