"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[49787],{147433(e,t,n){n.d(t,{A:()=>i});const i={PCAP:4194304,HWOFFLOAD_QOS_AND_SMART_QUEUE:2147483648,SUPPORT_FILE:65536}},602381(e,t,n){var i,s;n.d(t,{Z:()=>s,e:()=>i}),function(e){e.WIRED="WIRED",e.WIRELESS="WIRELESS"}(i||(i={})),function(e){e.CAPTURING="CAPTURING",e.STOP_CAPTURING="STOP_CAPTURING",e.UPLOADING="UPLOADING",e.READY_TO_DOWNLOAD="READY_TO_DOWNLOAD",e.TIMEOUT="TIMEOUT"}(s||(s={}))},358935(e,t,n){n.d(t,{X2:()=>_,lX:()=>A,uC:()=>E});var i=n(571766),s=n(29472),a=n(159469),r=n(774366);const o=`${n(290454).w}/device/:mac:`,l=`${o}/replacement-candidates`,c=`${o}/replace?replacementDeviceMac=:replacement-mac:`,d=`${o}/replace`,A=(e={},t={})=>(0,s.Kd)("replacementCandidates",`${l.replace(":mac:",e.queryParams?.mac)}`,e.queryParams?.mac,e,{...t,idField:"mac"}),E=(e,t)=>n=>n((0,s.vB)(i.aC,null,null,r.A.POST,c.replace(":mac:",e).replace(":replacement-mac:",t),{},null,{})),_=e=>t=>t((0,s.vB)(i.aC,null,null,r.A.DELETE,d.replace(":mac:",e),{},null,{failureToast:()=>({icon:a.C.danger,message:"COMMON_UNKNOWN_ERROR"})}))},752104(e,t,n){n.d(t,{A:()=>s,Q:()=>a});var i=n(765567);const s="_",a=[i.ZM,i.Je]},748094(e,t,n){n.d(t,{A:()=>p});var i=n(274934),s=n(814557),a=n(602086),r=n(599110),o=n(938984),l=n(853777),c=n(600191),d=n(847399),A=n(263705),E=n(613842),_=n(470070),u=n(620627),m=n(100978);const p=(0,a.memo)(({children:e,customIcon:t,link:n,nested:p,extra:C,variant:x="warning",...I})=>{const{themeName:h}=(0,A.u)(),T=(0,a.useMemo)(()=>{switch(x){case"warning":return(0,i.jsx)(c.A,{size:"original",color:s.Ay[`desktop-color-orange-06-${h}`],variant:"fill"});case"info":return(0,i.jsx)(l.A,{isActive:!0,size:"original",variant:"fill"});case"custom":return t;default:return(0,i.jsx)(d.A,{size:"medium",color:s.Ay[`desktop-color-red-06-${h}`],variant:"fill"})}},[x,h,t]),N=(0,a.useCallback)(()=>{E.A.open(n)},[n]);return(0,i.jsx)(u.A,{icon:T,nested:p,...I,children:(0,i.jsxs)(m.A,{flexDirection:"column",alignItems:"flex-start",children:[(0,i.jsx)(o.A,{children:e}),(0,i.jsx)(o.A,{children:n?(0,i.jsx)(r.A,{type:"button",variant:"inline",onClick:N,children:(0,i.jsx)(_.sA,{id:"COMMON_LEARN_MORE"})}):null}),C]})})})},216082(e,t,n){n.d(t,{A:()=>I});var i,s=n(274934),a=n(954702),r=n(602086),o=n(977872),l=n(938984),c=n(976458),d=n(470070),A=n(535322),E=n(376892),_=n(222102);!function(e){e.OPEN_MODAL="openModal"}(i||(i={}));const u=(0,_.Mz)(c.zn,e=>void 0!==e[i.OPEN_MODAL]);var m=n(828373),p=n(367821);const C=({uidbDevice:e})=>{const t=(0,o.d4)(c.zn),n=t?.[i.OPEN_MODAL];return n?(0,s.jsx)(a.A,{onClick:()=>n(e),children:(0,s.jsx)(l.A,{size:"medium",color:"inherit",children:(0,s.jsx)(d.sA,{id:"DEVICE_SHOW_DETAILS"})})}):null},x=({shortname:e})=>{(0,p.A)();const t=(0,o.d4)((0,r.useMemo)(()=>(0,m.$E)(e),[e]));return t?.compliance?(0,s.jsx)(A.A,{type:A.I.ACCORDION,items:[{id:"compliance",label:(0,s.jsx)(E.A,{id:"COMMON_COMPLIANCE"}),renderContent:()=>(0,s.jsx)(C,{uidbDevice:t}),openByDefault:!0}]}):null},I=({shortname:e})=>(0,o.d4)(u)?(0,s.jsx)(x,{shortname:e}):null},189042(e,t,n){n.d(t,{A:()=>f});var i=n(274934),s=n(977872),a=n(602086),r=n(244081),o=n(586566),l=n(441318),c=n(996077),d=n(539453),A=n(553732),E=n(897166),_=n(147433),u=n(247816),m=n(669439),p=n(648175),C=n(470070),x=n(956978),I=n(434521),h=n(45978),T=n(147045);const N=(0,u.A)("span")`
  width: 100%;
`,j=({activeItem:e,onClick:t,disabledWithReason:n,[T.L]:s})=>{const a=(e=>{const t=(0,I.S9)(e);return e.disabled||t!==h.g.CONNECTED||!(0,x.sc7)(t)?"DEVICE_PCAP_DISABLED_TOOLTIP":null})(e)||n;return(0,i.jsx)(m.A,{description:a?(0,i.jsx)(C.sA,{id:a}):void 0,children:(0,i.jsx)(N,{...s&&{[T.L]:s},children:(0,i.jsx)(p.A,{onClick:t,isDisabled:!!a,width:"full",children:(0,i.jsx)(C.sA,{id:"COMMON_PACKET_CAPTURE"})})})})};var M=n(205521),g=n(449339),v=n(590979),O=n(231083),R=n(409844),w=n(309130),D=n(100978);const P=R.AH`
  &:empty {
    display: none;
  }
`,S=(0,u.A)("div")`
  flex: 1 1 0;
  min-width: 33%;
  box-sizing: border-box;
  padding-right: ${w.kc};

  &:last-child {
    padding-right: 0;
  }
`,b=({children:e,...t})=>(0,i.jsx)(D.A,{marginTop:w.kc,className:P,...t,children:a.Children.map(e,e=>e?(0,i.jsx)(S,{className:P,children:e}):null)}),f=({activeItem:e,showPortsButton:t,showCaptureButton:n})=>{const u=(0,s.wA)(),m=(0,s.d4)(E.vc),p=(0,s.d4)(l.ar),C=n&&m===e.mac&&p&&(0,o.W4)(e,_.A.PCAP),x=t&&e.port_table?.length>0;(0,a.useEffect)(()=>{u((0,A.Sk)(void 0,{crudCacheStrategy:{type:r.e.CACHE}})),u((0,d.hh)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}))},[u]);const I=(0,a.useCallback)(()=>{u((0,M.XP)({type:g.H.PACKET_CAPTURE,id:e.mac,customData:{captureDeviceType:c.X.GATEWAY}}))},[u,e.mac]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(b,{children:[x?(0,i.jsx)(O.A,{mac:e.mac}):null,C?(0,i.jsx)(j,{activeItem:e,captureDeviceType:c.X.GATEWAY,onClick:I,...v.A.addDataTestId(v.A.TestId.SIDE_PANEL_TRIGGER)}):null]})})}},721398(e,t,n){n.d(t,{A:()=>o});var i=n(274934),s=n(125799),a=n(853777),r=n(470070);const o=({messageId:e,tooltipClassName:t,values:n,isInteractive:o,portal:l,variant:c="twoTone",size:d="medium"})=>(0,i.jsx)(s.A,{description:(0,i.jsx)(r.sA,{id:e,values:n}),width:210,isInteractive:o,portal:l,tooltipClassName:t,children:(0,i.jsx)(a.A,{isActive:!0,omitSvgMargin:!0,variant:c,size:d})})},996077(e,t,n){var i,s;n.d(t,{A:()=>i,X:()=>s}),function(e){e.DEFAULT="default",e.IN_PROGRESS="inProgress",e.READY="ready",e.DOWNLOADING="downloading",e.STOPPING="stopping"}(i||(i={})),function(e){e.AP="ap",e.GATEWAY="gateway"}(s||(s={}))},441318(e,t,n){n.d(t,{VQ:()=>M,ar:()=>v,ax:()=>O,r8:()=>R});var i=n(222102),s=n(430328),a=n(197719),r=n(254590),o=n(243436),l=n(910577),c=n(407386),d=n(423564),A=n(581814),E=n(197571),_=n(267142),u=n(644533),m=n(754924),p=n(544691),C=n(602381),x=n(996077);const I=[A.rR.CORPORATE,A.rR.GUEST],h=e=>void 0===e||e,T=({_id:e,name:t,enabled:n,ip_subnet:i,ipv6_subnet:s,wan_networkgroup:a,vpn_type:o,purpose:l,l2tp_interface:c,openvpn_interface:A,wireguard_interface:E,ipsec_interface:u,sdwan_hub_spoke_local_wan_id:m},p)=>({_id:e,enabled:h(n),name:t||r.L,ip_subnet:p?r.L:(0,d.Qe)({ip_subnet:i,ipv6_subnet:s},_.L),wan_networkgroup:a,vpn_type:o,ipsec_interface:u,l2tp_interface:c,openvpn_interface:A,purpose:l,sdwan_hub_spoke_local_wan_id:m,wireguard_interface:E}),N=(e,t)=>e?e===a.C.WAN?t.wan1:t[e.toLocaleLowerCase()]||{}:{},j=(e,t=C.e.WIRELESS)=>(0,i.Mz)(E.Ct,l.Ag,(0,p.a5)(e),m.fq,m.Dx,(e,n,i,s,a)=>{const r=n.reduce((e,{enabled:t,networkconf_id:n,ap_group_ids:s=[]})=>(t&&i.some(({_id:e})=>s.includes(e))&&e.push(n),e),[]);return e.reduce((e,n)=>(u.A.includes(n.purpose)&&(r.includes(n._id)||t===C.e.WIRED)&&e.push(T(n,(0,o.cH)({gateway_device:n.gateway_device,purpose:n.purpose},s,a))),e),[])}),M=(e,t=C.e.WIRELESS)=>(0,i.Mz)(j(e,t),e=>Boolean(e.length)),g=(0,s.WY)()((0,i.Mz)(E.Ct,m.U$,c.$D,m.AL,(e,t,n,i)=>[...e.reduce((e,n)=>(n&&t.network_table?.some(({_id:e})=>e===n._id)&&h(n.enabled)&&n.gateway_type!==A.xk.SWITCH&&I.includes(n.purpose)&&e.push(T(n)),e),[]),...n.reduce((e,{configuration:n={}})=>{if((({purpose:e,wan_networkgroup:t},n)=>{if(e!==A.rR.WAN)return!1;if(t===a.C.WAN_LTE_FAILOVER)return!0;const i=N(t,n);return!!i?.up})(n,t)){let s;if(n.wan_networkgroup===a.C.WAN_LTE_FAILOVER)s=i?.lte_ip;else{const e=N(n.wan_networkgroup,t);s=e?.ip}e.push({...T(n),...s?{ip_subnet:s}:{}})}return e},[])]),e=>e),v=(0,s.WY)()((0,i.Mz)(g,e=>Boolean(e.length)),e=>e),O=(e,t,n)=>{switch(t){case x.X.AP:return n===C.e.WIRELESS?j(e,n):(e=>(0,i.Mz)((0,m.tG)(e),E.Ct,m.fq,m.Dx,(e,t,n,i)=>{if(!e.connection_network_id)return[];const s=t.find(({_id:t})=>t===e.connection_network_id);return s?[T(s,(0,o.cH)({gateway_device:s.gateway_device,purpose:s.purpose},n,i))]:[]}))(e);case x.X.GATEWAY:return g;default:return()=>[]}},R=e=>(0,i.Mz)(l.Ag,t=>{const n=t.filter(t=>t.networkconf_id===e);return[...new Set(n.flatMap(e=>e.wlan_bands))]})},999837(e,t,n){n.d(t,{A:()=>U});var i=n(274934),s=n(977872),a=n(602086),r=n(696264),o=n(599110),l=n(159469),c=n(706925),d=n(700444),A=n(470070),E=n(222102),_=n(656466),u=n(401042),m=n(358935);var p,C,x=n(857780),I=n(570866);!function(e){e.EXISTING="existing",e.NEW="new"}(p||(p={})),function(e){e.MAC="mac",e.TYPE="type",e.MODEL="model"}(C||(C={}));var h,T=n(990330),N=n(125799),j=n(843615),M=n(853777),g=n(489714),v=n(947414);!function(e){e.DEVICE_REPLACEMENT_MODE="deviceReplacementMode",e.SET_DEVICE_REPLACEMENT_MODE="setDeviceReplacementMode",e.NEW_MAC="newMac",e.SET_NEW_MAC="setNewMac",e.EXISTING_MAC="existingMac",e.SET_EXISTING_MAC="setExistingMac",e.REPLACEMENT_CANDIDATES="replacementCandidates",e.ERROR="error",e.RESET_ERROR="resetError"}(h||(h={}));const O=(0,a.createContext)({[h.DEVICE_REPLACEMENT_MODE]:void 0,[h.SET_DEVICE_REPLACEMENT_MODE]:v.P1,[h.NEW_MAC]:void 0,[h.SET_NEW_MAC]:v.P1,[h.EXISTING_MAC]:void 0,[h.SET_EXISTING_MAC]:v.P1,[h.REPLACEMENT_CANDIDATES]:[],[h.ERROR]:void 0,[h.RESET_ERROR]:v.P1}),R=n(409844).AH`
  height: 54px;
`;var w=n(247816),D=n(309130),P=n(100978);const S=(0,w.A)(P.A)`
  align-items: center;
  gap: ${D.YC};
`,b=(0,a.memo)(()=>{const{newMac:e,setNewMac:t,error:n,resetError:s}=(0,a.useContext)(O),r=(0,a.useCallback)(({target:{value:e}})=>{t((0,g.Z)(e)),s()},[t,s]);return(0,i.jsx)(j.A,{className:R,value:e,onChange:r,onFocus:s,variant:"secondary",label:(0,i.jsxs)(S,{children:[(0,i.jsx)(A.sA,{id:"COMMON_MAC_ADDRESS"}),(0,i.jsx)(N.A,{portal:!0,width:"100%",maxWidth:248,description:(0,i.jsx)(A.sA,{id:"DEVICE_REPLACEMENT_MAC_LOCATION"}),children:(0,i.jsx)(M.A,{isActive:!0})})]}),width:"100%",invalid:n})});var f=n(237887),y=n(974390);const L=(0,a.memo)(()=>{const{replacementCandidates:e,existingMac:t,setExistingMac:n,error:s,resetError:r}=(0,a.useContext)(O),o=(0,a.useMemo)(()=>e.map(({mac:e,model:t,name:n})=>({label:n,value:e,image:(0,i.jsx)(y.A,{model:t}),additionalInfo:e})),[e]),l=(0,a.useCallback)(({value:e})=>{n(String(e)),r()},[n,r]);return(0,i.jsx)(f.A.Sorted,{value:t,label:(0,i.jsx)(A.sA,{id:"COMMON_DEVICE"}),width:"100%",searchable:!0,onChange:l,onFocus:r,maxHeight:228,options:o,invalid:s})}),k=(0,w.A)(P.A)`
  flex-direction: column;
  gap: ${D.kc};
`,W=(0,a.memo)(()=>{const{replacementCandidates:e,deviceReplacementMode:t,setDeviceReplacementMode:n,resetError:s}=(0,a.useContext)(O),r=(0,a.useMemo)(()=>e.length?[{id:p.EXISTING,children:(0,i.jsx)(A.sA,{id:"COMMON_EXISTING"}),onChange:()=>{n(p.EXISTING),s()},checked:t===p.EXISTING},{id:p.NEW,children:(0,i.jsx)(A.sA,{id:"COMMON_NEW"}),onChange:()=>{n(p.NEW),s()},checked:t===p.NEW}]:[],[e.length,t,n,s]);return(0,i.jsxs)(k,{children:[(0,i.jsx)(T.A,{direction:"row",items:r}),t===p.EXISTING?(0,i.jsx)(L,{}):null,t===p.NEW?(0,i.jsx)(b,{}):null]})}),z=(0,w.A)(P.A)`
  align-items: center;
  gap: ${D.YC};
  width: fit-content;
`;var G=n(721398);const X={[x.gQ.INCOMPATIBLE_REPLACEMENT]:"DEVICE_REPLACEMENT_DEVICE_INCOMPATIBLE_REPLACEMENT_ERROR",[x.gQ.REPLACEMENT_ALREADY_ASSIGNED]:"DEVICE_REPLACEMENT_DEVICE_REPLACEMENT_ALREADY_ASSIGNED_ERROR"},V=({mac:e,hideTooltip:t=!1})=>{const{formatMessage:n}=(0,A.tz)(),c=(0,s.wA)(),[C,T]=(0,a.useState)(!1),[N,j]=(0,a.useState)(!1),[M,g]=(0,a.useState)(p.NEW),[v,R]=(0,a.useState)(""),[w,D]=(0,a.useState)(""),[P,S]=(0,a.useState)(void 0),b=(0,s.d4)((0,a.useMemo)(()=>(e=>(0,E.Mz)((e=>(0,_.uh)((0,m.lX)({queryParams:{mac:e}})))(e),e=>(0,u.i6)(e)?.devices||[]))(e),[e])),f=(0,a.useCallback)(()=>{T(!0)},[]),y=(0,a.useCallback)(()=>{T(!1),R(""),D(""),j(!1),g(p.NEW),S(void 0)},[]),L=(0,a.useCallback)(()=>{switch(M){case p.EXISTING:return w;case p.NEW:return v;default:return}},[M,w,v]),k=(0,a.useCallback)(()=>{c((0,d.ox)({icon:l.C.success,message:"DEVICE_REPLACEMENT_DEVICE_SET",duration:3e3})),y()},[c,y]),V=(0,a.useCallback)(e=>{switch(e.apiData?.replacement_state){case x.gQ.INCOMPATIBLE_REPLACEMENT:case x.gQ.REPLACEMENT_ALREADY_ASSIGNED:S(n({id:X[e.apiData.replacement_state]}));break;default:c((0,d.ox)({icon:l.C.danger,message:"DEVICE_FAILED_TO_SET_REPLACEMENT_DEVICE",duration:3e3}))}},[c,n]),U=(0,a.useCallback)(()=>{j(!1)},[]),B=(0,a.useCallback)(()=>{j(!0),c((0,m.uC)(e,L())).then(k).catch(V).finally(U)},[c,k,V,e,L,U]),Y=(0,a.useMemo)(()=>Boolean(L().match(I.b8)),[L]),$=(0,a.useMemo)(()=>[{text:(0,i.jsx)(A.sA,{id:"COMMON_ACTION_CANCEL"}),variant:"tertiary",onClick:y},{text:(0,i.jsx)(A.sA,{id:"COMMON_ACTION_APPLY"}),variant:"primary",onClick:B,disabled:!Y||N,loader:N?"spinner":void 0}],[y,B,Y,N]),H=(0,a.useCallback)(()=>{S(void 0)},[S]),F=(0,a.useMemo)(()=>({[h.DEVICE_REPLACEMENT_MODE]:M,[h.SET_DEVICE_REPLACEMENT_MODE]:g,[h.NEW_MAC]:v,[h.SET_NEW_MAC]:R,[h.EXISTING_MAC]:w,[h.SET_EXISTING_MAC]:D,[h.REPLACEMENT_CANDIDATES]:b,[h.ERROR]:P,[h.RESET_ERROR]:H}),[M,v,w,b,P,H]);return(0,a.useEffect)(()=>{c((0,m.lX)({queryParams:{mac:e}}))},[c,e]),(0,i.jsx)(O.Provider,{value:F,children:(0,i.jsx)(r.A,{allowOverflow:!0,title:(0,i.jsx)(A.sA,{id:"DEVICE_SET_REPLACEMENT_DEVICE"}),body:(0,i.jsx)(W,{}),position:"top",portal:!0,actions:$,isOpen:C,onRequestClose:y,children:(0,i.jsxs)(z,{children:[(0,i.jsx)(o.A,{type:"button",variant:"inline",size:"medium",onClick:f,children:(0,i.jsx)(A.sA,{id:"DEVICE_SET_REPLACEMENT_DEVICE"})}),t?null:(0,i.jsx)(G.A,{messageId:"DEVICE_SET_REPLACEMENT_DEVICE_DESCRIPTION",variant:"outline"})]})})})},U=(0,a.memo)(({model:e,type:t,...n})=>(0,c.G)({type:t,model:e})?(0,i.jsx)(V,{type:t,model:e,...n}):null)},384780(e,t,n){n.d(t,{A:()=>z});var i=n(274934),s=n(814557),a=n(977872),r=n(602086),o=n(125799),l=n(792929),c=n(600191),d=n(263705),A=n(244081),E=n(112104),_=n(61322),u=n(449339),m=n(974390),p=n(650632),C=n(535322),x=n(205521),I=n(347625),h=n(754924),T=n(223597),N=n(34118),j=n(239627),M=n(645682),g=n(254590),v=n(857780);const O=({name:e,mac:t,model:n})=>e===t&&n?n:e,R=e=>{switch(e?.uplink?.type){case v.au.WIRE:return e?.connection_network_name||g.L;case v.au.WIRELESS:return e?.connection_network_name||e?.uplink?.essid||g.L;default:return g.L}};var w,D=n(599110),P=n(594005),S=n(309130),b=n(421314);!function(e){e.NAME="name",e.PORT="port",e.NETWORK="network"}(w||(w={}));const f={[w.NAME]:"COMMON_NAME",[w.PORT]:"COMMON_PORT",[w.NETWORK]:"COMMON_NETWORK"};var y=n(100978),L=n(470070),k=n(850352);const W=({port:e,mac:t})=>{const{handleGoToPortsPage:n}=(0,k.e)();return(0,i.jsx)(D.A,{variant:"inline",type:"button",size:"medium",onClick:()=>{n(t,e)},children:e})},z=({activeItem:e})=>{const{themeName:t}=(0,d.u)(),n=(0,a.wA)(),g=(0,a.d4)(h.ID),v=(0,r.useMemo)(()=>((e,t)=>(e||[]).map(e=>{const n=t.find(({mac:t})=>t===e.mac||t===e.ap_mac);return n?{...e,id:n._id,name:(0,I.Q)(n),activeItem:n,model:(0,I.Lm)(n.model)}:null}).filter(Boolean))(e.downlink_table,g),[e.downlink_table,g]),D=(0,a.d4)((0,N.Ax)(e.mac)).filter(e=>e.type===T.sK.WIRED);(0,r.useEffect)(()=>{n((0,j.$3)(void 0,{crudCacheStrategy:{type:A.e.CACHE}}))},[n]);const k=(0,r.useMemo)(()=>D.map(e=>({id:`${e.id}${e.sw_port}`,name:e.display_name,mac:e.mac,network:e.network_name,port:e.sw_port,image:(0,i.jsx)(p.A,{client:e}),isClient:!0})),[D]),z=(0,r.useMemo)(()=>v.map(({id:e,name:n,mac:a,port_idx:r,activeItem:l})=>({id:`${e}${r}`,name:O({name:n,mac:l.mac,model:l.model}),mac:a,network:R(l),port:r,image:(0,i.jsx)(m.A,{model:l.model}),isClient:!1,warning:l.detailed_states?.negotiated_low_uplink_port_speed?(0,i.jsx)(o.A,{portal:!0,description:(0,i.jsx)(M.A,{color:"text-1"}),children:(0,i.jsx)(c.A,{size:"medium",color:s.Ay[`desktop-color-orange-06-${t}`]})}):void 0,stacking_group_id:l.stacking_group_id})),[v,s.Ay[`desktop-color-orange-06-${t}`]]),G=(0,r.useMemo)(()=>Array.prototype.concat.apply([],[k,z]),[z,k]),X=(0,r.useMemo)(()=>(({mac:e})=>[{id:w.NAME,label:(0,i.jsx)(L.sA,{id:f[w.NAME]}),renderCell:({image:e,name:t})=>(0,i.jsxs)(y.A,{alignItems:"center",justifyContent:"center",width:"100%",children:[(0,i.jsx)(y.A,{alignItems:"center",justifyContent:"center",height:"20px",width:"20px",children:e}),(0,i.jsx)(b.A,{color:"inherit",size:"medium",style:{width:"170px",paddingLeft:"6px",paddingRight:"6px"},children:t})]}),width:170,compare:(0,P.l0)(({name:e})=>e)},{id:w.NETWORK,label:(0,i.jsx)(L.sA,{id:f[w.NETWORK]}),renderCell:({network:e})=>(0,i.jsx)(b.A,{color:"inherit",size:"medium",children:e}),width:112,compare:(0,P.l0)(({network:e})=>e)},{id:w.PORT,align:"right",label:(0,i.jsx)(L.sA,{id:f[w.PORT]}),renderCell:({port:t,warning:n})=>(0,i.jsxs)(y.A,{justifyContent:"flex-end",alignItems:"center",flexGrow:1,children:[(0,i.jsx)(y.A,{marginTop:-2,marginRight:S.YC,children:n}),(0,i.jsx)(W,{port:t,mac:e})]}),width:54,compare:(0,P.l0)(({port:e})=>e)}])({mac:e.mac}),[e.mac]),V=(0,r.useCallback)(({mac:e,isClient:t,stacking_group_id:i})=>{n((0,x.XP)({type:t?u.H.CLIENT:i?u.H.STACKING:u.H.DEVICE,id:i||e}))},[n]),{rowLimit:U,renderFooter:B}=(0,E.A)(G.length,{defaultCount:10});return G.length?(0,i.jsx)(C.A,{children:(0,i.jsx)(l.A,{items:G,columns:X,idField:"id",initialSortBy:"port",initiallySortAscending:!0,disableColumnFilters:!0,rowOffset:0,disableSelection:!0,onRowClick:V,rowLimit:U,renderFooter:()=>B,rowHeight:_.I.ROW_HEIGHT,truncateHeaderCells:!0})}):null}},872926(e,t,n){n.d(t,{A:()=>E});var i=n(274934),s=n(977872),a=n(810024),r=n(589650),o=n(748094),l=n(470070),c=n(754924),d=n(726831);const A=({adopted:e})=>(0,i.jsx)(o.A,{link:d.A.virtualNetworkConnectivity,children:(0,i.jsx)(l.sA,{id:e?"DEVICE_FALLBACK_IP_ADOPTED_WITH_UNIFI_GATEWAY_WARNING":"DEVICE_FALLBACK_IP_NOT_ADOPTED_WARNING",values:{bold:(0,i.jsx)("strong",{children:(0,i.jsx)(l.sA,{id:e?"DEVICE_WARNING_FALLBACK_IP":"DEVICE_WARNING_ADOPTION_FAILED"})})}})}),E=({ip:e,adopted:t,config_network:n})=>(0,s.d4)(c.m9)&&(0,a.W5)(e)&&n?.type===r.NL.DHCP?(0,i.jsx)(A,{adopted:t}):null},400359(e,t,n){n.r(t),n.d(t,{default:()=>q});var i=n(274934),s=n(872926),a=n(189042),r=n(384780),o=n(383550),l=n(535322),c=n(893762),d=n(938984),A=n(470070),E=n(857780),_=n(664092);const u={[E.Y_.OPERATIONAL]:{color:"positive",translationKey:"CI_STATE_OPERATIONAL"},[E.Y_.COAX_CABLE_NOT_PLUGGED]:{color:"destructive",translationKey:"CI_STATE_COAX_CABLE_NOT_PLUGGED"}},m=({status:e})=>u[e]?(0,i.jsxs)(_.A,{children:[(0,i.jsx)(d.A,{color:"text-2",size:"medium",children:(0,i.jsx)(A.sA,{id:"COMMON_MODEM_STATUS"})}),(0,i.jsx)(d.A,{color:u[e].color,size:"medium",children:(0,i.jsx)(A.sA,{id:u[e].translationKey})})]}):null;var p=n(924453),C=n(643334);const x=({mac:e})=>(0,i.jsxs)(_.A,{children:[(0,i.jsx)(d.A,{color:"text-2",size:"medium",children:(0,i.jsx)(A.sA,{id:"COMMON_CM_MAC_ADDRESS"})}),(0,i.jsx)(d.A,{color:"text-3",size:"medium",children:e})]}),I=({activeItem:{name:e,model:t,ci_state_table:n,mac:s,type:a,displayable_version:r,uptime:o,deviceState:d}})=>(0,i.jsxs)(l.A,{children:[(0,i.jsx)(m,{status:n?.ci_state}),(0,i.jsx)(p.A,{mac:s}),(0,i.jsx)(x,{mac:n?.ci_mac}),(0,i.jsx)(C.A,{name:e,model:t,mac:s,type:a,displayable_version:r,uptime:o,deviceState:d}),(0,i.jsx)(c.A,{uptime:o})]});var h,T=n(977872),N=n(602086),j=n(157622),M=n(599110),g=n(501807),v=n(443502),O=n(320509),R=n(449339),w=n(309130),D=n(814557),P=n(861094),S=n(729736),b=n(125799),f=n(247816),y=n(100978),L=n(964978),k=n(122109),W=n(291508);!function(e){e.TX="tx",e.RX="rx"}(h||(h={}));const z=({type:e,isp:{configuration:{wan_provider_capabilities:{upload_kilobits_per_second:t=0,download_kilobits_per_second:n=0}}={wan_provider_capabilities:{upload_kilobits_per_second:0,download_kilobits_per_second:0}},statistics:{peak_usage:{"max_rx_bytes-r":s=0,"max_tx_bytes-r":a=0}}={peak_usage:{"max_rx_bytes-r":0,"max_tx_bytes-r":0}},"rx_bytes-r":r=0,"tx_bytes-r":o=0},children:l})=>{const{value:c,unit:E,bytes:_}=new S.Un((0,O.Zz)(e===h.TX?t:n),"bitrate"),u=e===h.TX?a:s;return(0,i.jsx)(b.A,{width:250,portal:!0,description:(0,i.jsxs)(y.A,{flexDirection:"column",children:[(0,i.jsx)(y.A,{marginBottom:w.kc,children:(0,i.jsx)(d.A,{size:"medium",color:"text-1",weight:"bold",children:(0,i.jsx)(A.sA,{id:e===h.TX?"COMMON_UPLOAD":"COMMON_DOWNLOAD"})})}),(0,i.jsxs)(y.A,{justifyContent:"space-between",marginBottom:w.YC,children:[(0,i.jsx)(d.A,{size:"small",color:"text-1",children:(0,i.jsx)(A.sA,{id:"COMMON_ISP_CAPACITY"})}),(0,i.jsx)(d.A,{size:"small",color:"text-2",children:`${c} ${E}`})]}),(0,i.jsxs)(y.A,{justifyContent:"space-between",marginBottom:w.YC,children:[(0,i.jsx)(d.A,{size:"small",color:"text-1",children:(0,i.jsx)(A.sA,{id:"DEVICE_ISP_ACTIVITY_INTERNET_REAL_TIME"})}),(0,i.jsx)(d.A,{size:"small",color:"text-2",children:(0,P.A)(Math.min(1,new S.Un(e===h.TX?o:r,"bitrate").bytes/_))})]}),(0,i.jsxs)(y.A,{justifyContent:"space-between",marginBottom:w.YC,children:[(0,i.jsx)(d.A,{size:"small",color:"text-1",children:(0,i.jsx)(A.sA,{id:"DEVICE_ISP_ACTIVITY_INTERNET_PEAK"})}),(0,i.jsxs)(y.A,{alignItems:"center",children:[(0,i.jsx)(e===h.TX?L.A.Icon:k.A.Icon,{size:"small"}),(0,N.createElement)((m=d.A,(0,f.A)(m,(0,W.A)("type"))`
  color: ${({theme:{themeName:e,motifPalette:{purple06:t}},type:n})=>n===h.RX?D.Ay[`desktop-color-aqua-06-${e}`]:t} !important;
`),{type:e,size:"small"},(0,O.zX)(u,2))]})]}),(0,i.jsxs)(y.A,{justifyContent:"space-between",marginBottom:w.YC,children:[(0,i.jsx)(d.A,{size:"small",color:"text-1",children:(0,i.jsx)(A.sA,{id:"DEVICE_ISP_ACTIVITY_INTERNET_PEAK"})}),(0,i.jsxs)(d.A,{size:"small",color:"text-2",children:[Math.round(Math.min(100,u/_*100))||0,"%"]})]})]}),children:l});var m};var G=n(579902),X=n(205521),V=n(93114),U=n(590979);const B=({isp:e})=>{const t=e?.details?.service_provider?.name;return t?(0,i.jsxs)(y.A,{alignItems:"center",children:[e?.isWanConnected?(0,i.jsx)(G.A,{style:{height:32},asn:e?.details?.service_provider?.asn,name:t},t):(0,i.jsx)(g.A,{size:"original",color:v.PA.danger}),(0,i.jsx)(d.A,{size:"large",weight:"bold",style:{marginLeft:w.YC},children:t})]}):null},Y=({uptimePercentage:e})=>{if(!e||-1===e)return null;const t=Math.max(0,Math.round(e));return(0,i.jsxs)(_.A,{children:[(0,i.jsx)(d.A,{size:"medium",children:(0,i.jsx)(A.sA,{id:"COMMON_IPS_UPTIME"})}),(0,i.jsxs)(d.A,{size:"medium",style:{color:j.A.getGradientColor(t/100)},children:[t,"%"]})]})},$=({type:e,isp:t})=>{const n=e===h.RX?k.A:L.A,s=e===h.RX?"rx_bytes-r":"tx_bytes-r";return(0,i.jsx)(z,{type:e,isp:t,children:(0,i.jsxs)(y.A,{alignItems:"center",marginRight:e===h.RX?w.xO:0,children:[(0,i.jsx)(n.Icon,{}),(0,i.jsx)(n.Bytes,{size:"medium",children:(0,O.zX)(t?.[s],2)})]})})},H=({isp:e})=>(0,i.jsxs)(_.A,{children:[(0,i.jsx)(d.A,{size:"medium",children:(0,i.jsx)(A.sA,{id:"COMMON_IPS_STATUS"})}),(0,i.jsxs)(y.A,{children:[(0,i.jsx)($,{type:h.RX,isp:e}),(0,i.jsx)($,{type:h.TX,isp:e})]})]}),F=({wan_networkgroup:e})=>{const t=(0,T.wA)(),n=(0,T.d4)(V.X),s=(0,N.useMemo)(()=>n.find(({networkgroup:t})=>t===e),[e,n]),a=(0,N.useCallback)(()=>{t((0,X.XP)({type:R.H.ISP,id:e}))},[t,e]);return s?(0,i.jsx)(l.A,{type:l.I.ACCORDION,items:[{id:"isp",openByDefault:!0,label:(0,i.jsx)(B,{isp:s}),renderContent:()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(H,{isp:s}),(0,i.jsx)(Y,{uptimePercentage:s?.statistics?.uptime_percentage}),(0,i.jsx)(M.A,{type:"button",variant:"inline",onClick:a,...U.A.addDataTestId(U.A.TestId.SIDE_PANEL_TRIGGER),children:(0,i.jsx)(d.A,{size:"medium",color:"ublue-06",children:(0,i.jsx)(A.sA,{id:"COMMON_INTERNET_HEALTH"})})})]})}]}):null};var K=n(216082);const q=({activeItem:e,activeItem:{adopted:t,ip:n,config_network:l,wan_networkgroup:c,shortname:d}})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.A,{activeItem:e,showPortOverview:!0,hidePortsButton:!0,children:(0,i.jsx)(a.A,{activeItem:e,showPortsButton:!0,showCaptureButton:!0})}),(0,i.jsx)(s.A,{ip:n,adopted:t,config_network:l}),(0,i.jsx)(r.A,{activeItem:e}),(0,i.jsx)(I,{activeItem:e}),(0,i.jsx)(F,{wan_networkgroup:c}),(0,i.jsx)(K.A,{shortname:d})]})},696049(e,t,n){n.d(t,{H:()=>i});const i=""},367821(e,t,n){n.d(t,{A:()=>l});var i=n(602086),s=n(977872),a=n(726831),r=n(575478),o=n(828373);const l=()=>{const e=(0,s.wA)(),t=(0,s.d4)(o.eo);return(0,i.useEffect)(()=>{t||(async()=>{const t=await fetch(a.A.fingerprintPublicDatabasePath),n=await t.json();e((0,r.$)(n))})()},[t,e]),t}},828373(e,t,n){n.d(t,{$E:()=>d,eo:()=>l});var i=n(222102),s=n(271656),a=n(720770),r=n(172205);const o=e=>e[r.U.UIDB]||(0,s.A)(),l=(0,i.Mz)(o,({version:e})=>Boolean(e)),c=(0,i.Mz)(o,({devices:e})=>e||(0,a.A)()),d=e=>(0,i.Mz)(c,t=>t.find(({shortnames:t})=>e&&(t||[]).includes(e))||(0,s.A)());(0,i.Mz)(c,e=>{const t=new Map;for(let n=0;n<e.length;n+=1){const i=e[n].power?.baseConsumption;if(void 0!==i){const{shortnames:s}=e[n];for(let e=0;e<(s||[]).length;e+=1)t.set(s[e],i)}}return t})},706925(e,t,n){n.d(t,{G:()=>o});var i=n(956978),s=n(857780);const a=[s.bq.USW,s.bq.UAP,s.bq.USP],r=[s.W4.UDBA69F],o=({type:e,model:t})=>(a.includes(e)||r.includes(t))&&!(0,i.tNJ)({model:t})},237887(e,t,n){n.d(t,{A:()=>E});var i=n(274934),s=n(602086),a=n(977872),r=n(693371),o=n(767822),l=n(820633),c=n(308111);const d=e=>(0,i.jsx)(r.A,{renderOption:o.q,...e}),A=e=>(0,i.jsx)(d,{...e});A.Sorted=e=>{const t=(0,a.d4)(l.zi),n=(0,s.useMemo)(()=>(0,c.k)(t),[t]);return(0,i.jsx)(d,{...e,sortBy:n})};const E=A},308111(e,t,n){n.d(t,{R:()=>A,k:()=>E});var i=n(696049),s=n(350068),a=n(177173),r=n(752104),o=n(64222),l=n(332530);const c=[...new Set([i.H,r.Q.join(r.A),a.Zt,o.F,s.nc,l.Vr])],d={numeric:!0,sensitivity:"base"},A=(e,t)=>{const n=[];for(let i=e;i<=t;i+=1)n.push({value:i,label:String(i)});return n},E=e=>({value:t,label:n},{value:i,label:s})=>c.includes(t?.toString())||c.includes(i?.toString())?1/0:n?.toString().localeCompare(s?.toString(),e,d)??-1},489714(e,t,n){n.d(t,{Z:()=>s});var i=n(570866);const s=e=>e?e.replace(i.SD,"").replace(i.fA,"$&:").substring(0,17).toLowerCase():e}}]);