"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[84558],{124092:(e,t,n)=>{n.d(t,{A:()=>C});var l=n(469733),a=n(296540),r=n(962926),i=n(705145),c=n(71479),o=n(132196),m=n(6510),E=n(130851),s=n(566723),d=n(294303),A=n(6176);const u=o.AH`
  margin-bottom: ${s.Ln};
  margin-top: ${s.Ln};
`,_=(0,c.A)("div")`
  align-self: center;
  overflow: hidden;
  word-break: break-word;
`,p=(0,c.A)("img")`
  width: 40px;
  height: 40px;
  object-fit: contain;
`,C=({children:e,description:t,meshingDescription:n,isOffline:c,activeItem:C,style:I,className:N,isStacking:g})=>{const O=(0,l.useSelector)(E.p);return a.createElement(r.A,{className:(0,o.cx)(u,N),sections:[a.createElement("div",null,a.createElement(d.A,{gap:s.kc},g?a.createElement(p,{src:`${O}/topology/stacking.png`,alt:"stacked"}):a.createElement(A.A,{model:C.model,width:40,height:40}),a.createElement(_,{style:I},a.createElement(i.A,{color:c?"text-3":"text-1",weight:"bold",isTruncated:!0},(0,m.Lm)(C.model)),t)),n,e)]})}},442728:(e,t,n)=>{n.d(t,{A:()=>x});var l=n(469733),a=n(296540),r=n(271856),i=n(963070),c=n(823858),o=n(998837),m=n(592510),E=n(879905),s=n(596441),d=n(398300),A=n(6176),u=n(703447),_=n(689965),p=n(845030),C=n(6510);var I=n(532419),N=n(691294),g=n(239417),O=n(984652),T=n(643633),h=n(573531),M=n(768195);const D=({name:e,mac:t,model:n})=>e===t&&n?n:e,L=e=>{switch(e?.uplink?.type){case M.au.WIRE:return e?.connection_network_name||h.L;case M.au.WIRELESS:return e?.connection_network_name||e?.uplink?.essid||h.L;default:return h.L}};var R,v=n(758649),f=n(396660),w=n(566723),P=n(115829);!function(e){e.NAME="name",e.PORT="port",e.NETWORK="network"}(R||(R={}));const k={[R.NAME]:"COMMON_NAME",[R.PORT]:"COMMON_PORT",[R.NETWORK]:"COMMON_NETWORK"};var b=n(294303),y=n(699784),S=n(216211);const H=({port:e,mac:t})=>{const{handleGoToPortsPage:n}=(0,S.e)();return a.createElement(v.A,{variant:"inline",type:"button",size:"medium",onClick:()=>{n(t,e)}},e)},x=({activeItem:e})=>{const{motifPalette:{warning:t}}=(0,o.u)(),n=(0,l.useDispatch)(),h=(0,l.useSelector)(I.ID),M=(0,a.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,C.Q)(n),activeItem:n,model:(0,C.Lm)(n.model)}:null}).filter(Boolean))(e.downlink_table,h),[e.downlink_table,h]),v=(0,l.useSelector)((0,g.Ax)(e.mac)).filter(e=>e.type===N.sK.WIRED);(0,a.useEffect)(()=>{n((0,O.$3)(void 0,{crudCacheStrategy:{type:m.e.CACHE}}))},[n]);const S=(0,a.useMemo)(()=>v.map(e=>({id:`${e.id}${e.sw_port}`,name:e.display_name,mac:e.mac,network:e.network_name,port:e.sw_port,image:a.createElement(u.A,{client:e}),isClient:!0})),[v]),x=(0,a.useMemo)(()=>M.map(({id:e,name:n,mac:l,port_idx:i,activeItem:o})=>({id:`${e}${i}`,name:D({name:n,mac:o.mac,model:o.model}),mac:l,network:L(o),port:i,image:a.createElement(A.A,{model:o.model}),isClient:!1,warning:o.detailed_states?.negotiated_low_uplink_port_speed?a.createElement(r.A,{portal:!0,description:a.createElement(T.A,{color:"text-1"})},a.createElement(c.A,{size:"medium",color:t})):void 0})),[M,t]),F=(0,a.useMemo)(()=>Array.prototype.concat.apply([],[S,x]),[x,S]),G=(0,a.useMemo)(()=>(({mac:e})=>[{id:R.NAME,label:a.createElement(y.sA,{id:k[R.NAME]}),renderCell:({image:e,name:t})=>a.createElement(b.A,{alignItems:"center",justifyContent:"center",width:"100%"},a.createElement(b.A,{alignItems:"center",justifyContent:"center",height:"20px",width:"20px"},e),a.createElement(P.A,{color:"inherit",size:"medium",style:{width:"170px",paddingLeft:"6px",paddingRight:"6px"}},t)),width:170,compare:(0,f.l0)(({name:e})=>e)},{id:R.NETWORK,label:a.createElement(y.sA,{id:k[R.NETWORK]}),renderCell:({network:e})=>a.createElement(P.A,{color:"inherit",size:"medium"},e),width:112,compare:(0,f.l0)(({network:e})=>e)},{id:R.PORT,align:"right",label:a.createElement(y.sA,{id:k[R.PORT]}),renderCell:({port:t,warning:n})=>a.createElement(b.A,{justifyContent:"flex-end",alignItems:"center",flexGrow:1},a.createElement(b.A,{marginTop:-2,marginRight:w.YC},n),a.createElement(H,{port:t,mac:e})),width:54,compare:(0,f.l0)(({port:e})=>e)}])({mac:e.mac}),[e.mac]),W=(0,a.useCallback)(({mac:e,isClient:t})=>{n((0,p.XP)({type:t?d.H.CLIENT:d.H.DEVICE,id:e}))},[n]),{rowLimit:z,renderFooter:V}=(0,E.A)(F.length,{defaultCount:10});return F.length?a.createElement(_.A,null,a.createElement(i.A,{items:F,columns:G,idField:"id",initialSortBy:"port",initiallySortAscending:!0,disableColumnFilters:!0,rowOffset:0,disableSelection:!0,onRowClick:W,rowLimit:z,renderFooter:()=>V,rowHeight:s.I.ROW_HEIGHT,truncateHeaderCells:!0})):null}},470962:(e,t,n)=>{n.d(t,{A:()=>A});var l=n(296540),a=n(217439),r=n(823858),i=n(998837),c=n(566723),o=n(224948),m=n(349107),E=n(294303),s=n(699784),d=n(765562);const A=(0,l.memo)(({children:e})=>l.createElement(o.A,{icon:l.createElement(r.A,{size:"original",color:(0,i.u)().motifPalette.warning,variant:"fill"})},l.createElement(E.A,{flexDirection:"column",gap:c.kc},l.createElement(a.A,{size:"medium",color:"text-2"},l.createElement(s.sA,{id:"COMMON_DEVICE_OFFLINE_WARNING",values:{b:s.b,link:l.createElement(m.A,{href:d.A.offlineArticle,id:"COMMON_LEARN_MORE",noWrap:!0})}})),e)))},500045:(e,t,n)=>{n.d(t,{A:()=>c});var l=n(296540),a=n(927099),r=n(699784),i=n(360113);const c=({displayable_version:e,flexProps:t})=>e?l.createElement(i.A,{flexProps:t},l.createElement(a.A,{color:"secondary",size:"body"},l.createElement(r.sA,{id:"COMMON_DEVICE_VERSION"})),l.createElement(a.A,{color:"tertiary",size:"body"},e)):null},596441:(e,t,n)=>{n.d(t,{I:()=>l});const l={HEADER_HEIGHT:32,ROW_HEIGHT:32,EDIT_FIELD_HEIGHT:36,getHeight(e,t,n,l){return Math.min((l||this.ROW_HEIGHT)*e+(n??this.HEADER_HEIGHT),(l||this.ROW_HEIGHT)*t+(n??this.HEADER_HEIGHT))},getEditContainerHeight(e,t,n){return Math.min((n||this.EDIT_FIELD_HEIGHT)*e,(n||this.EDIT_FIELD_HEIGHT)*t)}}},643633:(e,t,n)=>{n.d(t,{A:()=>c});var l=n(296540),a=n(217439),r=n(294303),i=n(699784);const c=({color:e})=>l.createElement(l.Fragment,null,l.createElement(r.A,null,l.createElement(a.A,{weight:"bold",color:e},l.createElement(i.sA,{id:"AP_LOW_UPLINK_SPEED_NOTIFICATION_TITLE"}))),l.createElement(r.A,null,l.createElement(a.A,{color:e},l.createElement(i.sA,{id:"AP_LOW_UPLINK_SPEED_NOTIFICATION_BODY"}))))},723544:(e,t,n)=>{n.d(t,{A:()=>c});var l=n(296540),a=n(927099),r=n(699784),i=n(360113);const c=({mac:e,compact:t=!1})=>e?l.createElement(i.A,{compact:t},l.createElement(a.A,{color:"secondary",size:"body"},l.createElement(r.sA,{id:"COMMON_MAC_ADDRESS"})),l.createElement(a.A,{color:"tertiary",size:"body"},e)):null},812454:(e,t,n)=>{n.d(t,{A:()=>W});var l=n(296540),a=n(71479),r=n(566723),i=n(218234),c=n(294303),o=n(217439),m=n(998837),E=n(842630),s=n(224948),d=n(699784),A=n(469733),u=n(824182),_=n(264963),p=n(822336),C=n(705145);const I=(0,a.A)(c.A)`
  flex-direction: column;
  margin-top: ${r.kc};
  padding-top: ${r.kc};
  border-top: ${({theme:{themeName:e}})=>p.Ay[`desktop-border-divider-${e}`]};
`,N=(0,a.A)(c.A)`
  width: 100%;
  justify-content: space-between;
`,g=(0,a.A)(c.A)`
  gap: ${r.Ln};
  align-items: center;
`,O=(0,a.A)(C.A)`
  max-width: 150px;
`,T=(0,l.memo)(({mac:e,replacementMac:t})=>{const n=(0,A.useDispatch)(),[a,r]=(0,l.useState)(!1),i=(0,l.useCallback)(()=>{r(!0),n((0,_.X2)(e)).finally(()=>{r(!1)})},[n,e]);return l.createElement(I,null,l.createElement(N,null,l.createElement(O,{isTruncated:!0,size:"medium",color:"text-2"},l.createElement(d.sA,{id:"DEVICE_REPLACEMENT_DEVICE"})),l.createElement(g,null,l.createElement(o.A,{size:"medium",color:"text-3"},t),l.createElement(u.A,{actionable:!0,onClick:i,disabled:a}))))}),h=(0,a.A)(c.A)`
  flex-direction: column;
  gap: ${r.kc};
`;var M=n(709690),D=n(823858),L=n(768195);const R=({state:e},{uBlue06:t,orange06:n})=>{switch(e){case L.gQ.WAITING_FOR_REPLACEMENT:return l.createElement(M.A,{size:"original",color:t,variant:"fill"});case L.gQ.WAITING_FOR_REPLACED_DEVICE_DISCONNECT:case L.gQ.INCOMPATIBLE_REPLACEMENT:case L.gQ.REPLACEMENT_ALREADY_ASSIGNED:case L.gQ.CANNOT_REPLACE:default:return l.createElement(D.A,{size:"original",color:n,variant:"fill"})}},v=({state:e})=>{switch(e){case L.gQ.WAITING_FOR_REPLACEMENT:return"DEVICE_REPLACEMENT_PENDING_WAITING_FOR_REPLACEMENT";case L.gQ.WAITING_FOR_REPLACED_DEVICE_DISCONNECT:return"DEVICE_REPLACEMENT_PENDING_WAITING_FOR_REPLACED_DEVICE_DISCONNECT";case L.gQ.INCOMPATIBLE_REPLACEMENT:return"DEVICE_REPLACEMENT_PENDING_INCOMPATIBLE_REPLACEMENT";case L.gQ.REPLACEMENT_ALREADY_ASSIGNED:case L.gQ.CANNOT_REPLACE:default:return"DEVICE_REPLACEMENT_PENDING_CANNOT_REPLACE"}},f=(0,l.memo)(({mac:e,replacement:t})=>{const{motifPalette:n}=(0,m.u)();return t?.device_mac?l.createElement(E.A,null,l.createElement(s.A,{icon:R(t,n)},l.createElement(h,null,l.createElement(o.A,{size:"medium",color:"text-2"},l.createElement(d.sA,{id:v(t),values:{b:d.b}}))),l.createElement(T,{mac:e,replacementMac:t.device_mac}))):null});var w=n(211908),P=n(188912),k=n(470962),b=n(281884),y=n(130648),S=n(392699),H=n(124092),x=n(236037),F=n(683086);const G=(0,a.A)(c.A)`
  & > :first-child {
    margin-top: ${r.kc};
  }
`,W=({activeItem:e,activeItem:{deviceState:t,uplink:n,mac:a,model:c,type:o,replacement:m},showPortOverview:E,hidePortsButton:s,isStacking:d,multipleDisplayedDevicesData:A,overviewChildren:u,children:_})=>{const p=(0,l.useMemo)(()=>(0,b.H)(t,n?.type),[t,n?.type]),C=Boolean(e?.port_table?.length),I=E&&C;return l.createElement(l.Fragment,null,l.createElement(H.A,{activeItem:e,isOffline:p===S.v.OFFLINE,description:l.createElement(P.A,{activeItem:e,connectionStatus:p}),meshingDescription:l.createElement(y.A,{activeItem:e,connectionStatus:p}),isStacking:d},u,I?l.createElement("div",{style:{marginTop:r.Ln}},l.createElement(i.A,{activeItem:e,disableOnPortClick:!0,showFullScreenDiagramButton:!1,useBubbleWrapper:!1,multipleDisplayedDevicesData:A,isStacking:d})):null,l.createElement(G,{gap:r.kc,flexDirection:"column"},l.createElement(x.A,{activeItem:e}),!s&&C?l.createElement(F.A,{mac:a}):null),_),p===S.v.OFFLINE?l.createElement(k.A,null,m?.device_mac?null:l.createElement(w.A,{mac:a,model:c,type:o})):null,l.createElement(f,{mac:a,replacement:m}))}},842630:(e,t,n)=>{n.d(t,{A:()=>i});var l=n(469733),a=n(296540),r=n(602021);const i=({children:e=null})=>(0,l.useSelector)(r.EL)?null:a.createElement(a.Fragment,null,e)},879905:(e,t,n)=>{n.d(t,{A:()=>m});var l=n(296540),a=n(927099),r=n(758649),i=n(566723),c=n(294303),o=n(699784);const m=(e,t={})=>{const{formatMessage:n}=(0,o.tz)(),[m,E]=(0,l.useState)(!1),{defaultCount:s,label:{singular:d,plural:A}}=(0,l.useMemo)(()=>({defaultCount:t.defaultCount||6,label:{singular:n({id:t.label?.singular||"COMMON_DEVICE"}),plural:n({id:t.label?.plural||"COMMON_DEVICES"})}}),[t,n]),u=(0,l.useCallback)(()=>{E(e=>!e)},[]);return{rowLimit:e>s&&!m?s:e,renderFooter:e>s?l.createElement(c.A,{marginTop:i.kc},l.createElement(a.A,{size:"body"},l.createElement(o.sA,{id:"COMMON_ADV_TABLE_FOOTER",values:{length:e>s&&!m?s:e,total:e,singular:d,plural:A}}),l.createElement(l.Fragment,null," ",l.createElement(r.A,{type:"button",variant:"inline",onClick:u},l.createElement(o.sA,{id:"COMMON_SHOW"})," ",l.createElement(o.sA,{id:m?"COMMON_LESS":"COMMON_ALL"}))))):null,setExpand:E}}}}]);