"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[61529],{602381(e,n,s){var i,t;s.d(n,{Z:()=>t,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"}(t||(t={}))},216082(e,n,s){s.d(n,{A:()=>O});var i,t=s(274934),r=s(954702),o=s(602086),d=s(977872),a=s(938984),c=s(976458),l=s(470070),A=s(535322),_=s(376892),u=s(222102);!function(e){e.OPEN_MODAL="openModal"}(i||(i={}));const p=(0,u.Mz)(c.zn,e=>void 0!==e[i.OPEN_MODAL]);var x=s(828373),m=s(367821);const h=({uidbDevice:e})=>{const n=(0,d.d4)(c.zn),s=n?.[i.OPEN_MODAL];return s?(0,t.jsx)(r.A,{onClick:()=>s(e),children:(0,t.jsx)(a.A,{size:"medium",color:"inherit",children:(0,t.jsx)(l.sA,{id:"DEVICE_SHOW_DETAILS"})})}):null},E=({shortname:e})=>{(0,m.A)();const n=(0,d.d4)((0,o.useMemo)(()=>(0,x.$E)(e),[e]));return n?.compliance?(0,t.jsx)(A.A,{type:A.I.ACCORDION,items:[{id:"compliance",label:(0,t.jsx)(_.A,{id:"COMMON_COMPLIANCE"}),renderContent:()=>(0,t.jsx)(h,{uidbDevice:n}),openByDefault:!0}]}):null},O=({shortname:e})=>(0,d.d4)(p)?(0,t.jsx)(E,{shortname:e}):null},189042(e,n,s){s.d(n,{A:()=>L});var i=s(274934),t=s(977872),r=s(602086),o=s(244081),d=s(586566),a=s(441318),c=s(996077),l=s(539453),A=s(553732),_=s(897166),u=s(147433),p=s(247816),x=s(669439),m=s(648175),h=s(470070),E=s(956978),O=s(434521),j=s(45978),C=s(147045);const N=(0,p.A)("span")`
  width: 100%;
`,v=({activeItem:e,onClick:n,disabledWithReason:s,[C.L]:t})=>{const r=(e=>{const n=(0,O.S9)(e);return e.disabled||n!==j.g.CONNECTED||!(0,E.sc7)(n)?"DEVICE_PCAP_DISABLED_TOOLTIP":null})(e)||s;return(0,i.jsx)(x.A,{description:r?(0,i.jsx)(h.sA,{id:r}):void 0,children:(0,i.jsx)(N,{...t&&{[C.L]:t},children:(0,i.jsx)(m.A,{onClick:n,isDisabled:!!r,width:"full",children:(0,i.jsx)(h.sA,{id:"COMMON_PACKET_CAPTURE"})})})})};var w=s(205521),I=s(449339),P=s(590979),T=s(231083),f=s(409844),D=s(309130),M=s(100978);const g=f.AH`
  &:empty {
    display: none;
  }
`,R=(0,p.A)("div")`
  flex: 1 1 0;
  min-width: 33%;
  box-sizing: border-box;
  padding-right: ${D.kc};

  &:last-child {
    padding-right: 0;
  }
`,b=({children:e,...n})=>(0,i.jsx)(M.A,{marginTop:D.kc,className:g,...n,children:r.Children.map(e,e=>e?(0,i.jsx)(R,{className:g,children:e}):null)}),L=({activeItem:e,showPortsButton:n,showCaptureButton:s})=>{const p=(0,t.wA)(),x=(0,t.d4)(_.vc),m=(0,t.d4)(a.ar),h=s&&x===e.mac&&m&&(0,d.W4)(e,u.A.PCAP),E=n&&e.port_table?.length>0;(0,r.useEffect)(()=>{p((0,A.Sk)(void 0,{crudCacheStrategy:{type:o.e.CACHE}})),p((0,l.hh)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}))},[p]);const O=(0,r.useCallback)(()=>{p((0,w.XP)({type:I.H.PACKET_CAPTURE,id:e.mac,customData:{captureDeviceType:c.X.GATEWAY}}))},[p,e.mac]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(b,{children:[E?(0,i.jsx)(T.A,{mac:e.mac}):null,h?(0,i.jsx)(v,{activeItem:e,captureDeviceType:c.X.GATEWAY,onClick:O,...P.A.addDataTestId(P.A.TestId.SIDE_PANEL_TRIGGER)}):null]})})}},996077(e,n,s){var i,t;s.d(n,{A:()=>i,X:()=>t}),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"}(t||(t={}))},441318(e,n,s){s.d(n,{VQ:()=>w,ar:()=>P,ax:()=>T,r8:()=>f});var i=s(222102),t=s(430328),r=s(197719),o=s(254590),d=s(243436),a=s(910577),c=s(407386),l=s(423564),A=s(581814),_=s(197571),u=s(267142),p=s(644533),x=s(754924),m=s(544691),h=s(602381),E=s(996077);const O=[A.rR.CORPORATE,A.rR.GUEST],j=e=>void 0===e||e,C=({_id:e,name:n,enabled:s,ip_subnet:i,ipv6_subnet:t,wan_networkgroup:r,vpn_type:d,purpose:a,l2tp_interface:c,openvpn_interface:A,wireguard_interface:_,ipsec_interface:p,sdwan_hub_spoke_local_wan_id:x},m)=>({_id:e,enabled:j(s),name:n||o.L,ip_subnet:m?o.L:(0,l.Qe)({ip_subnet:i,ipv6_subnet:t},u.L),wan_networkgroup:r,vpn_type:d,ipsec_interface:p,l2tp_interface:c,openvpn_interface:A,purpose:a,sdwan_hub_spoke_local_wan_id:x,wireguard_interface:_}),N=(e,n)=>e?e===r.C.WAN?n.wan1:n[e.toLocaleLowerCase()]||{}:{},v=(e,n=h.e.WIRELESS)=>(0,i.Mz)(_.Ct,a.Ag,(0,m.a5)(e),x.fq,x.Dx,(e,s,i,t,r)=>{const o=s.reduce((e,{enabled:n,networkconf_id:s,ap_group_ids:t=[]})=>(n&&i.some(({_id:e})=>t.includes(e))&&e.push(s),e),[]);return e.reduce((e,s)=>(p.A.includes(s.purpose)&&(o.includes(s._id)||n===h.e.WIRED)&&e.push(C(s,(0,d.cH)({gateway_device:s.gateway_device,purpose:s.purpose},t,r))),e),[])}),w=(e,n=h.e.WIRELESS)=>(0,i.Mz)(v(e,n),e=>Boolean(e.length)),I=(0,t.WY)()((0,i.Mz)(_.Ct,x.U$,c.$D,x.AL,(e,n,s,i)=>[...e.reduce((e,s)=>(s&&n.network_table?.some(({_id:e})=>e===s._id)&&j(s.enabled)&&s.gateway_type!==A.xk.SWITCH&&O.includes(s.purpose)&&e.push(C(s)),e),[]),...s.reduce((e,{configuration:s={}})=>{if((({purpose:e,wan_networkgroup:n},s)=>{if(e!==A.rR.WAN)return!1;if(n===r.C.WAN_LTE_FAILOVER)return!0;const i=N(n,s);return!!i?.up})(s,n)){let t;if(s.wan_networkgroup===r.C.WAN_LTE_FAILOVER)t=i?.lte_ip;else{const e=N(s.wan_networkgroup,n);t=e?.ip}e.push({...C(s),...t?{ip_subnet:t}:{}})}return e},[])]),e=>e),P=(0,t.WY)()((0,i.Mz)(I,e=>Boolean(e.length)),e=>e),T=(e,n,s)=>{switch(n){case E.X.AP:return s===h.e.WIRELESS?v(e,s):(e=>(0,i.Mz)((0,x.tG)(e),_.Ct,x.fq,x.Dx,(e,n,s,i)=>{if(!e.connection_network_id)return[];const t=n.find(({_id:n})=>n===e.connection_network_id);return t?[C(t,(0,d.cH)({gateway_device:t.gateway_device,purpose:t.purpose},s,i))]:[]}))(e);case E.X.GATEWAY:return I;default:return()=>[]}},f=e=>(0,i.Mz)(a.Ag,n=>{const s=n.filter(n=>n.networkconf_id===e);return[...new Set(s.flatMap(e=>e.wlan_bands))]})},664613(e,n,s){s.d(n,{A:()=>A});var i=s(274934),t=s(938984),r=s(703639),o=s(309130),d=s(100978),a=s(470070),c=s(956978),l=s(664092);const A=({sys_stats:e,flexProps:n,withTooltip:s,compact:A=!1})=>{const _=(0,c.eiG)(e);return _?(0,i.jsxs)(l.A,{flexProps:n,compact:A,children:[(0,i.jsx)(t.A,{color:"text-2",size:"medium",children:(0,i.jsx)(a.sA,{id:"COMMON_LOAD_AVERAGE"})}),s?(0,i.jsxs)(d.A,{alignItems:"center",gap:o.YC,children:[(0,i.jsx)(t.A,{color:"text-3",size:"medium",children:_}),(0,i.jsx)(r.A,{description:(0,i.jsx)(a.sA,{id:"DEVICE_PROPERTY_OVERVIEW_LOAD_AVERAGE_TOOLTIP"}),placement:"top start"})]}):(0,i.jsx)(t.A,{color:"text-3",size:"medium",children:_})]}):null}},382583(e,n,s){s.d(n,{A:()=>_});var i=s(274934),t=s(602086),r=s(938984),o=s(95032),d=s(977872),a=s(421314),c=s(470070),l=s(197571),A=s(664092);const _=({connection_network_id:e})=>{const n=(0,d.d4)(l.Tn),s=(0,t.useMemo)(()=>e?n.find(n=>n._id===e):void 0,[n,e]);return s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(A.A,{children:[(0,i.jsx)(r.A,{color:"text-2",size:"medium",children:(0,i.jsx)(c.sA,{id:"COMMON_NETWORK"})}),(0,i.jsx)(a.A,{color:"text-3",size:"medium",flexProps:{justifyContent:"flex-end"},children:s.name})]}),null!=s.vlan?(0,i.jsxs)(A.A,{children:[(0,i.jsx)(r.A,{color:"text-2",size:"medium",children:(0,i.jsx)(c.sA,{id:"COMMON_VLAN_ID"})}),(0,i.jsx)(o.A,{color:"text-3",size:"medium",isTruncated:!0,children:s.vlan})]}):null]}):null}},766022(e,n,s){s.d(n,{A:()=>d});var i=s(274934),t=s(938984),r=s(470070),o=s(664092);const d=({totalPower:e})=>e?(0,i.jsxs)(o.A,{children:[(0,i.jsx)(t.A,{color:"text-2",size:"medium",children:(0,i.jsx)(r.sA,{id:"DEVICE_HEADER_POWER_CONSUMPTION"})}),(0,i.jsx)(t.A,{color:"text-3",size:"medium",children:(0,i.jsx)(r.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:e.toFixed(1)}})})]}):null},23377(e,n,s){s.d(n,{A:()=>M});var i=s(274934),t=s(977872),r=s(602086),o=s(383061),d=s(237887),a=s(733360),c=s(197719),l=s(309130),A=s(100978),_=s(535322),u=s(470070),p=s(407386),x=s(51411),m=s(853109),h=s(886140),E=s(127347);var O=s(87052),j=s(938984),C=s(878151),N=s(320509),v=s(570203),w=s(635187),I=s(664092),P=s(631692),T=s(924453),f=s(906701);const D=({uplinkAttrs:e,configuration:n={wan_dns1:void 0,wan_dns2:void 0,wan_dhcpv6_pd_size:void 0,wan_type_v6:void 0,wan_prefixlen:void 0},details:s={},gatewayPort:{ipv6:t=[]}={}})=>{const{ip:r,speed:o,rx_packets:d,rx_bytes:a,tx_packets:c,tx_bytes:l,"rx_bytes-r":_,"tx_bytes-r":p,mac:x}=e||{};return(0,i.jsxs)(A.A,{height:"100%",flexDirection:"column",children:[r?(0,i.jsxs)(I.A,{children:[(0,i.jsx)(j.A,{size:"medium",children:(0,i.jsx)(u.sA,{id:"COMMON_IP_ADDRESS"})}),(0,i.jsx)(j.A,{size:"medium",color:"text-3",children:r})]}):null,t.length?(0,i.jsx)(f.A,{ipv6_address:t,wan_dhcpv6_pd_size:n.wan_type_v6===v.c.SLAAC||n.wan_type_v6===v.c.DHCPV6?n.wan_dhcpv6_pd_size:void 0}):null,(0,i.jsx)(T.A,{mac:x}),(0,i.jsx)(P.A,{portSpeed:o}),s.service_provider?.name?(0,i.jsxs)(I.A,{children:[(0,i.jsx)(j.A,{size:"medium",children:(0,i.jsx)(u.sA,{id:"COMMON_ISP"})}),(0,i.jsx)(j.A,{size:"medium",color:"text-3",children:s.service_provider.name})]}):null,(0,i.jsxs)(i.Fragment,{children:[n.wan_dns1?(0,i.jsxs)(I.A,{children:[(0,i.jsx)(j.A,{color:"text-2",size:"medium",children:(0,i.jsx)(u.sA,{id:"COMMON_DNS_SERVER_N",values:{n:1}})}),(0,i.jsx)(j.A,{color:"text-3",size:"medium",children:n.wan_dns1})]}):null,n.wan_dns2?(0,i.jsxs)(I.A,{children:[(0,i.jsx)(j.A,{color:"text-2",size:"medium",children:(0,i.jsx)(u.sA,{id:"COMMON_DNS_SERVER_N",values:{n:2}})}),(0,i.jsx)(j.A,{color:"text-3",size:"medium",children:n.wan_dns2})]}):null]}),d&&a?(0,i.jsxs)(I.A,{children:[(0,i.jsx)(j.A,{size:"medium",children:(0,i.jsx)(u.sA,{id:"COMMON_DOWN_PKTS_BYTES"})}),(0,i.jsxs)(j.A,{size:"medium",color:"text-3",children:[(0,O.A)(d,{spacer:w.HY})," / ",(0,N.z3)(a)]})]}):null,c&&l?(0,i.jsxs)(I.A,{children:[(0,i.jsx)(j.A,{size:"medium",children:(0,i.jsx)(u.sA,{id:"COMMON_UP_PKTS_BYTES"})}),(0,i.jsxs)(j.A,{size:"medium",color:"text-3",children:[(0,O.A)(c,{spacer:w.HY})," / ",(0,N.z3)(l)]})]}):null,(0,i.jsxs)(I.A,{children:[(0,i.jsx)(j.A,{size:"medium",children:(0,i.jsx)(u.sA,{id:"DEVICE_PROPERTY_UPLINK_DOWN_ACTIVITY"})}),(0,i.jsx)(j.A,{size:"medium",color:"text-3",children:void 0!==_?(0,i.jsx)(C.A,{type:"bytes",input:_,options:"bitrate",size:"body",color:"inherit"}):(0,i.jsx)(u.sA,{id:"COMMON_FALLBACK"})})]}),(0,i.jsxs)(I.A,{children:[(0,i.jsx)(j.A,{size:"medium",children:(0,i.jsx)(u.sA,{id:"DEVICE_PROPERTY_UPLINK_UP_ACTIVITY"})}),(0,i.jsx)(j.A,{size:"medium",color:"text-3",children:void 0!==p?(0,i.jsx)(C.A,{type:"bytes",input:p,options:"bitrate",size:"body",color:"inherit"}):(0,i.jsx)(u.sA,{id:"COMMON_FALLBACK"})})]})]})},M=({activeItem:e})=>{const{formatMessage:n}=(0,u.tz)(),s=((e,n)=>{const s=(e.port_table||[]).filter(({up:e})=>e);return Object.values(E.s).reduce((i,t)=>{const r=1===(0,a.si)(t)?c.C.WAN:t.toUpperCase();if(s.find(({ifname:n})=>n===(0,x.KF)(r,{ethernet_overrides:e.ethernet_overrides,model:e.model,usg_caps:e.usg_caps,usg2_caps:e.usg2_caps}))||(o=e[t],o?.type===h.YT)){const s=(0,m.q$)(e,t);s&&i.push({wanNetworkGroup:r,uplinkAttrs:s,...(()=>{const{configuration:e={},details:s={}}=n.find(({configuration:{wan_networkgroup:e}})=>e===r)||{};return{configuration:e,details:s}})(),gatewayPort:e[t]})}var o;return i},[])})(e,(0,t.d4)(p.ht)),O=(0,r.useMemo)(()=>s.map(({wanNetworkGroup:e})=>({id:e,label:n({id:"COMMON_NETWORK_PURPOSE_WANX"},{number:(0,a.si)(e)})})),[n,s]),j=(0,r.useMemo)(()=>s.map(({wanNetworkGroup:e,configuration:n={}})=>({value:e,label:n.name||"",additionalInfo:(0,i.jsx)(u.sA,{id:"COMMON_NETWORK_PURPOSE_WANX",values:{number:(0,a.si)(e)}})})),[s]),[C,N]=(0,r.useState)(s?.[0]?.wanNetworkGroup||c.C.WAN),v=s.length<=4,w=(0,r.useMemo)(()=>s.find(({wanNetworkGroup:e})=>e===C)||{},[s,C]),I=(0,r.useMemo)(()=>[{id:"wan",openByDefault:!0,label:(0,i.jsx)(u.sA,1===O.length?{id:"COMMON_NETWORK_PURPOSE_WANX",values:{number:1}}:{id:"COMMON_NETWORK_PURPOSE_WAN"}),renderContent:()=>(0,i.jsxs)(i.Fragment,{children:[O.length>1?(0,i.jsx)(A.A,{paddingBottom:l.kc,inline:v,children:v?(0,i.jsx)(o.A,{tabs:O,variant:"filter",onSelectTab:({id:e})=>{N(e)},selectedTab:C}):(0,i.jsx)(d.A,{options:j,width:"100%",variant:"secondary",value:C,onChange:({value:e})=>{N(e)}})}):null,(0,i.jsx)(D,{...w})]})}],[O,v,j,C,N,w]);return w?(0,i.jsx)(_.A,{type:_.I.ACCORDION,items:I}):null}},872926(e,n,s){s.d(n,{A:()=>_});var i=s(274934),t=s(977872),r=s(810024),o=s(589650),d=s(748094),a=s(470070),c=s(754924),l=s(726831);const A=({adopted:e})=>(0,i.jsx)(d.A,{link:l.A.virtualNetworkConnectivity,children:(0,i.jsx)(a.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)(a.sA,{id:e?"DEVICE_WARNING_FALLBACK_IP":"DEVICE_WARNING_ADOPTION_FAILED"})})}})}),_=({ip:e,adopted:n,config_network:s})=>(0,t.d4)(c.m9)&&(0,r.W5)(e)&&s?.type===o.NL.DHCP?(0,i.jsx)(A,{adopted:n}):null},367821(e,n,s){s.d(n,{A:()=>a});var i=s(602086),t=s(977872),r=s(726831),o=s(575478),d=s(828373);const a=()=>{const e=(0,t.wA)(),n=(0,t.d4)(d.eo);return(0,i.useEffect)(()=>{n||(async()=>{const n=await fetch(r.A.fingerprintPublicDatabasePath),s=await n.json();e((0,o.$)(s))})()},[n,e]),n}},828373(e,n,s){s.d(n,{$E:()=>l,eo:()=>a});var i=s(222102),t=s(271656),r=s(720770),o=s(172205);const d=e=>e[o.U.UIDB]||(0,t.A)(),a=(0,i.Mz)(d,({version:e})=>Boolean(e)),c=(0,i.Mz)(d,({devices:e})=>e||(0,r.A)()),l=e=>(0,i.Mz)(c,n=>n.find(({shortnames:n})=>e&&(n||[]).includes(e))||(0,t.A)());(0,i.Mz)(c,e=>{const n=new Map;for(let s=0;s<e.length;s+=1){const i=e[s].power?.baseConsumption;if(void 0!==i){const{shortnames:t}=e[s];for(let e=0;e<(t||[]).length;e+=1)n.set(t[e],i)}}return n})}}]);