(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[96580],{605977(e,t,n){var a=n(596221);e.exports=function(e){var t=a(e);return t.setMinutes(0,0,0),t}},689965(e,t,n){"use strict";n.d(t,{A:()=>p,I:()=>a});var a,r=n(296540),i=n(822336),l=n(963724),o=n(71479),s=n(825032),d=n(566723),c=n(294303),m=n(311785);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(a||(a={}));const u=(0,o.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:n})=>n||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({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,o.A)(l.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  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,theme:{themeName:t}})=>e||i.Ay[t===s.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,p=({type:e,marginBottom:t,margin:n,padding:i,flex:l,width:o,nested:s,...d})=>"items"in d?r.createElement(g,{marginBottom:t,margin:n,padding:i,flex:l,nested:s,...d}):r.createElement(u,{nested:s,width:o,marginBottom:t,margin:n,padding:i,flex:l,isButtonList:e===a.BUTTON_LIST,...d},d.children)},566524(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>G});var a=n(469733),r=n(296540),i=n(979106),l=n(888170),o=n(943887),s=n(943805),d=n(566723),c=n(86571),m=n(294303),u=n(689965),g=n(916537),p=n(87250),A=n(656372),h=n(275357),E=n(540739),f=n(13739),b=n(847439),x=n(429252),I=n.n(x),M=n(93404),N=n.n(M),T=n(605977),y=n.n(T),S=n(966353),_=n.n(S),L=n(894713),O=n.n(L),k=n(633297),v=n(831743),$=n(217439),R=n(936344),C=n(71479),U=n(382389),B=n(132196),D=n(853699),Y=n(195462),w=n(212401),P=n(198494),F=n(311785);const H=(0,C.A)($.A,(0,F.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;
  }
`,K=(0,b.A)(6,e=>({value:e,label:String(e)})).reverse(),V=({motifPalette:{text02:e}})=>B.AH`
  fill: ${e};
  font-size: 11px;
`,j=(0,U.b)((0,r.memo)(({mac:e,keys:t,heading:n,theme:i,colors:l,noLegend:o=!1,fetchReport:s,legend:d,reportType:c=p.qv.UBB})=>{const u=(0,a.useSelector)((0,r.useMemo)(()=>(0,w.dF)(e,s,c,t),[e,s,c,t])),A=(0,a.useSelector)(P.jc),{xAxis:h,startDate:E}=(0,r.useMemo)(()=>(e=>({xAxis:e,startDate:e[0].value}))(((e,t,n=6)=>new Array(n+1).fill(0).map((a,r)=>{return i=N()(e,24/n*(n-r)),{label:_()(i,t),value:i.getTime()};var i}))(y()(O()(Date.now(),1)).getTime(),A?"H:ss":"ha")),[A]),f=(0,r.useMemo)(()=>{const e={},n=(0,k.Hf)(u.filter(e=>e.time>E).map(e=>({...e,x:e.time})),D.UE.MINUTES.grain);return n[0]&&t[0]in n[0]&&n.forEach(n=>{t.forEach((t,a)=>{e[t]||(e[t]={key:t,lineColor:l[a],maxY:0,data:[]}),e[t].data.push({x:n.x,y:n[t]})})}),e},[l,u,t,E]),b=(0,r.useMemo)(()=>{return(e=Math.max(...t.flatMap(e=>f[e]?f[e].data.map(e=>e.y||0):0),4))>5?(0,Y.Y)(e,6):K;var e},[f,t]);return r.createElement(r.Fragment,null,r.createElement(m.A,{justifyContent:"space-between",marginBottom:20},r.createElement($.A,{size:"medium",weight:"bold",color:"text-1"},r.createElement(g.sA,{id:n})),o?null:r.createElement(m.A,{justifyContent:"flex-end"},r.createElement(m.A,null,d.map((e,t)=>r.createElement(H,{size:"medium",legendcolor:l[t],key:e},r.createElement(g.sA,{id:e})))))),r.createElement(m.A,null,r.createElement(R.A,{xAxis:h,yAxis:b,width:336,height:150,margin:[0,0,20,35],labelClassName:V(i)},(e,n,a)=>r.createElement(r.Fragment,null,t.map(t=>f[t]&&f[t].data.length?r.createElement(v.A,{key:f[t].key,data:f[t].data,maxY:a,mouseData:n,getCoordinates:e,variant:"gradientArea",lineColor:f[t].lineColor,dashed:!1,hideMissingData:!0}):null)))))},(e,t)=>e.mac===t.mac&&I()(e.keys,t.keys))),G=({activeItem:{mac:e,peer_ubb:t={},radio_table:n=[],model:b}})=>{const{formatMessage:x}=(0,g.tz)(),I=(0,a.useDispatch)(),M=(0,r.useMemo)(()=>(n||[]).map(({name:e,radio:t})=>({id:e,label:`${x({id:(0,o.dI)(t)})}`})),[n,x]),N=(0,r.useMemo)(()=>[{id:e,label:r.createElement(g.sA,{id:"COMMON_AP"})},{id:t.mac,label:r.createElement(g.sA,{id:"DEVICE_TYPE_UBB_STATION"})}],[e,t.mac]),[T,y]=(0,r.useState)(e),[S,_]=(0,r.useState)(n?.[0]?.name||s._),{droppedStatKeys:L,retriesStatKeys:O}=(0,r.useMemo)(()=>({retriesStatKeys:[`${S}-tx_retries`],droppedStatKeys:[`${S}-rx_dropped`,`${S}-tx_dropped`]}),[S]);(0,r.useEffect)(()=>{I((0,A.aN)(T,p.qv.UBB))},[I,T]),(0,r.useEffect)(()=>{I((0,A.jU)(T,p.qv.UBB,L)),I((0,A.lV)(T,p.qv.UBB,O))},[I,L,O,T]);const k=(0,r.useCallback)(({id:e})=>{y(e)},[y]),v=(0,r.useCallback)(({id:e})=>{_(e)},[_]),$=(0,r.useMemo)(()=>[{id:"statistics",openByDefault:!0,label:r.createElement(c.A,null,r.createElement(g.sA,{id:"DEVICE_PROPERTY_SYSTEM_STATISTICS"})),renderContent:()=>r.createElement(m.A,{flexDirection:"column",gap:d.Ln},r.createElement(m.A,{width:"fit-content"},r.createElement(i.A,{variant:"filter",tabs:N,onSelectTab:k})),r.createElement(j,{mac:T,keys:["cpu","mem"],colors:[l.Ay["orange-1"],l.Ay["blue-3"]],heading:"DEVICE_PROPERTIES_LABEL_USAGE_PERCENT",fetchReport:A.aN,legend:["COMMON_CPU","COMMON_MEMORY"]}),r.createElement(m.A,{width:"fit-content"},r.createElement(i.A,{variant:"filter",tabs:M,onSelectTab:v})),r.createElement(j,{mac:T,keys:L,colors:[l.Ay["purple-1"],l.Ay["purple-1"]],noLegend:!0,fetchReport:A.jU,heading:"DEVICE_PROPERTIES_LABEL_DROPPED"}),r.createElement(j,{mac:T,keys:O,colors:[l.Ay["purple-1"]],noLegend:!0,fetchReport:A.lV,heading:"DEVICE_PROPERTIES_LABEL_RETRIES"}))}],[M,L,O,T,N,k,v]);return r.createElement(r.Fragment,null,r.createElement(f.A,{mac:e,model:b,logType:E.F.DEVICE,label:"COMMON_HISTORY",ignoreActionableValues:[h.dl.DEVICE],hideClientTabs:!0}),r.createElement(u.A,{type:u.I.ACCORDION,items:$}))}},195462(e,t,n){"use strict";n.d(t,{Y:()=>r,v:()=>i});var a=n(847439);const r=(e,t,n=!1)=>{const r=t-1;let i=Math.ceil(e);if(Number.isNaN(i))return[];const l=i%r;return 0!==l&&(i+=r-l),(0,a.A)(t,e=>{return{value:t=e?Math.ceil(e*(i/r)):0,label:n?e%2==0&&String(t)||null:String(t)};var t}).reverse()},i=(e,t)=>{const[n]=e,a=[n],r=e.length-1;for(let n=1;n<t-1;n+=1){const i=n*r/(t-1),l=Math.floor(i).toFixed();a[n]=Math.round(e[l]+(e[Math.ceil(i).toFixed()]-e[l])*(+i-+l))}return a[t-1]=e[r],a}},853699(e,t,n){"use strict";n.d(t,{$V:()=>o,UE:()=>l,Vi:()=>s});var a=n(741494),r=n.n(a),i=n(874734);const l={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"}},o=(e,t,n,a)=>{const i=r()(t,e);return n&&(i<1||a&&i<=1)?l.MINUTES:i<=7?l.HOURLY:i<120?l.DAILY:l.MONTHLY},s=(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""}}},383149(e,t,n){"use strict";n.d(t,{A:()=>r});var a=n(885205);const r=function(e,t){return!(null==e||!e.length)&&(0,a.A)(e,t,0)>-1}},887809(e,t,n){"use strict";n.d(t,{A:()=>a});const a=function(e,t,n){for(var a=-1,r=null==e?0:e.length;++a<r;)if(n(t,e[a]))return!0;return!1}},458043(e,t,n){"use strict";n.d(t,{A:()=>d});var a=n(8300),r=n(383149),i=n(887809),l=n(45572),o=n(552789),s=n(764099);const d=function(e,t,n,d){var c=-1,m=r.A,u=!0,g=e.length,p=[],A=t.length;if(!g)return p;n&&(t=(0,l.A)(t,(0,o.A)(n))),d?(m=i.A,u=!1):t.length>=200&&(m=s.A,u=!1,t=new a.A(t));e:for(;++c<g;){var h=e[c],E=null==n?h:n(h);if(h=d||0!==h?h:0,u&&E==E){for(var f=A;f--;)if(t[f]===E)continue e;p.push(h)}else m(t,E,d)||p.push(h)}return p}},144757(e,t,n){"use strict";n.d(t,{A:()=>o});var a=n(458043),r=n(187671),i=n(224326),l=n(153533);const o=(0,i.A)(function(e,t){return(0,l.A)(e)?(0,a.A)(e,(0,r.A)(t,1,l.A,!0)):[]})}}]);