"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[83550],{260449(e,t,i){i.d(t,{A:()=>A});var n=i(274934),r=i(814557),s=i(602086),o=i(938984),c=i(600191),l=i(263705),a=i(309130),d=i(620627),m=i(793442),u=i(100978),_=i(470070),p=i(726831);const A=(0,s.memo)(({children:e})=>{const{themeName:t}=(0,l.u)();return(0,n.jsx)(d.A,{icon:(0,n.jsx)(c.A,{size:"original",color:r.Ay[`desktop-color-orange-06-${t}`],variant:"fill"}),children:(0,n.jsxs)(u.A,{flexDirection:"column",gap:a.kc,children:[(0,n.jsx)(o.A,{size:"medium",color:"text-2",children:(0,n.jsx)(_.sA,{id:"COMMON_DEVICE_OFFLINE_WARNING",values:{b:_.b,link:(0,n.jsx)(m.A,{href:p.A.offlineArticle,id:"COMMON_LEARN_MORE",noWrap:!0})}})}),e]})})})},249295(e,t,i){i.d(t,{A:()=>h});var n=i(274934),r=i(977872),s=i(135469),o=i(95032),c=i(247816),l=i(409844),a=i(347625),d=i(890932),m=i(309130),u=i(100978),_=i(974390);const p=l.AH`
  margin-bottom: ${m.Ln};
  margin-top: ${m.Ln};
`,A=(0,c.A)("div")`
  align-self: center;
  overflow: hidden;
  word-break: break-word;
`,E=(0,c.A)("img")`
  width: 40px;
  height: 40px;
  object-fit: contain;
`,h=({children:e,description:t,meshingDescription:i,isOffline:c,activeItem:h,style:g,className:k,isStacking:x,badge:N})=>{const f=(0,r.d4)(d.p);return(0,n.jsx)(s.A,{className:(0,l.cx)(p,k),sections:[(0,n.jsxs)("div",{children:[(0,n.jsxs)(u.A,{gap:m.kc,children:[x?(0,n.jsx)(E,{src:`${f}/topology/stacking.png`,alt:"stacked"}):(0,n.jsx)(_.A,{model:h.model,width:40,height:40}),(0,n.jsxs)(A,{style:g,children:[(0,n.jsxs)(o.A,{color:c?"text-3":"text-1",weight:"bold",isTruncated:!0,children:[(0,a.Lm)(h.model),N]}),t]})]}),i,e]})]})}},383550(e,t,i){i.d(t,{A:()=>B});var n=i(274934),r=i(602086),s=i(977872),o=i(247816),c=i(938984),l=i(309130),a=i(969819),d=i(423564),m=i(613609),u=i(100978),_=i(470070),p=i(197571),A=i(263705),E=i(378767),h=i(620627),g=i(360689),k=i(358935),x=i(814557),N=i(95032);const f=(0,o.A)(u.A)`
  flex-direction: column;
  margin-top: ${l.kc};
  padding-top: ${l.kc};
  border-top: ${({theme:{themeName:e}})=>x.Ay[`desktop-border-divider-${e}`]};
`,v=(0,o.A)(u.A)`
  width: 100%;
  justify-content: space-between;
`,I=(0,o.A)(u.A)`
  gap: ${l.Ln};
  align-items: center;
`,j=(0,o.A)(N.A)`
  max-width: 150px;
`,C=(0,r.memo)(({mac:e,replacementMac:t})=>{const i=(0,s.wA)(),[o,l]=(0,r.useState)(!1),a=(0,r.useCallback)(()=>{l(!0),i((0,k.X2)(e)).finally(()=>{l(!1)})},[i,e]);return(0,n.jsx)(f,{children:(0,n.jsxs)(v,{children:[(0,n.jsx)(j,{isTruncated:!0,size:"medium",color:"text-2",children:(0,n.jsx)(_.sA,{id:"DEVICE_REPLACEMENT_DEVICE"})}),(0,n.jsxs)(I,{children:[(0,n.jsx)(c.A,{size:"medium",color:"text-3",children:t}),(0,n.jsx)(g.A,{actionable:!0,onClick:a,disabled:o})]})]})})}),w=(0,o.A)(u.A)`
  flex-direction: column;
  gap: ${l.kc};
`;var b=i(831721),P=i(600191),M=i(857780);const D=({state:e},{uBlue06:t,orange06:i})=>e===M.gQ.WAITING_FOR_REPLACEMENT?(0,n.jsx)(b.A,{size:"original",color:t,variant:"fill"}):(0,n.jsx)(P.A,{size:"original",color:i,variant:"fill"}),L=({state:e})=>{switch(e){case M.gQ.WAITING_FOR_REPLACEMENT:return"DEVICE_REPLACEMENT_PENDING_WAITING_FOR_REPLACEMENT";case M.gQ.WAITING_FOR_REPLACED_DEVICE_DISCONNECT:return"DEVICE_REPLACEMENT_PENDING_WAITING_FOR_REPLACED_DEVICE_DISCONNECT";case M.gQ.INCOMPATIBLE_REPLACEMENT:return"DEVICE_REPLACEMENT_PENDING_INCOMPATIBLE_REPLACEMENT";default:return"DEVICE_REPLACEMENT_PENDING_CANNOT_REPLACE"}},O=(0,r.memo)(({mac:e,replacement:t})=>{const{motifPalette:i}=(0,A.u)();return t?.device_mac?(0,n.jsx)(E.A,{children:(0,n.jsxs)(h.A,{icon:D(t,i),children:[(0,n.jsx)(w,{children:(0,n.jsx)(c.A,{size:"medium",color:"text-2",children:(0,n.jsx)(_.sA,{id:L(t),values:{b:_.b}})})}),(0,n.jsx)(C,{mac:e,replacementMac:t.device_mac})]})}):null});var T=i(999837),R=i(451336),y=i(260449),F=i(159911),$=i(326841),S=i(562896),G=i(249295),V=i(83597),W=i(231083);const Q=(0,o.A)(u.A)`
  & > :first-child {
    margin-top: ${l.kc};
  }
`,z=({device:e})=>{const t=(0,s.d4)(p.wf),i=(0,s.d4)(p.Tn),r=e.mgmt_network_id,o=r&&r!==t,l=(0,a.ki)(o?e:void 0,r);if(!o||!l.hasConflict)return null;const m=i.find(e=>e._id===r),u=m?(0,d.gm)(m):r;return(0,n.jsx)(c.A,{size:"medium",color:"text-2",children:(0,n.jsx)(_.sA,{id:"DEVICE_OFFLINE_CHECK_NETWORK_OVERRIDE",values:{networkName:u}})})},B=({activeItem:e,activeItem:{deviceState:t,uplink:i,mac:s,model:o,type:c,replacement:a},showPortOverview:d,hidePortsButton:u,isStacking:_,multipleDisplayedDevicesData:p,overviewChildren:A,children:E,badge:h})=>{const g=(0,r.useMemo)(()=>(0,F.H)(t,i?.type),[t,i?.type]),k=Boolean(e?.port_table?.length),x=d&&k;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(G.A,{activeItem:e,isOffline:g===S.v.OFFLINE,description:(0,n.jsx)(R.A,{activeItem:e,connectionStatus:g}),meshingDescription:(0,n.jsx)($.A,{activeItem:e,connectionStatus:g}),isStacking:_,badge:h,children:[A,x?(0,n.jsx)("div",{style:{marginTop:l.Ln},children:(0,n.jsx)(m.A,{activeItem:e,disableOnPortClick:!0,showFullScreenDiagramButton:!1,useBubbleWrapper:!1,multipleDisplayedDevicesData:p,isStacking:_})}):null,(0,n.jsxs)(Q,{gap:l.kc,flexDirection:"column",children:[(0,n.jsx)(V.A,{activeItem:e}),!u&&k?(0,n.jsx)(W.A,{mac:s}):null]}),E]}),g===S.v.OFFLINE?(0,n.jsxs)(y.A,{children:[a?.device_mac?null:(0,n.jsx)(T.A,{mac:s,model:o,type:c}),(0,n.jsx)(z,{device:e})]}):null,(0,n.jsx)(O,{mac:s,replacement:a})]})}},378767(e,t,i){i.d(t,{A:()=>o});var n=i(274934),r=i(977872),s=i(897166);const o=({children:e=null})=>(0,r.d4)(s.EL)?null:(0,n.jsx)(n.Fragment,{children:e})},969819(e,t,i){i.d(t,{GJ:()=>A,Sn:()=>f,US:()=>n,Xs:()=>N,bO:()=>h,gJ:()=>g,ki:()=>x,uj:()=>k});var n,r=i(602086),s=i(977872),o=i(539140),c=i(826022),l=i(994177),a=i(904614),d=i(423564),m=i(754924),u=i(197571),_=i(347625);!function(e){e.WIFI="wifi",e.MGMT="mgmt",e.VNO="vno"}(n||(n={}));const p=(e,t)=>{if(e?.port_table&&null!=t)return e.port_table.find(e=>e.port_idx===t)},A=(e,t)=>!(!e||!t||(0,c.cd)(t,e.tagged_vlan_mgmt,e.native_networkconf_id,e.excluded_networkconf_ids)),E=(e,t)=>{const i=t.find(t=>t._id===e);return i?(0,d.gm)(i):e},h=e=>e.find(e=>e.attr_no_delete&&"LAN"===e.attr_hidden_id)?._id,g=({mac:e,devicesMap:t,wlanConfigs:i,apGroups:r,networks:s,clients:c,defaultNetworkId:d,isVlanCarried:m,seen:u,base:p})=>{const A=[],h=t.get(e);if(h&&(e=>(0,l.j)(e.model)?.deviceCapabilities?.includes(o.t.ACCESS_POINT)??!1)(h)){const t=((e,t,i)=>t.filter(t=>{if(!t.enabled)return!1;if(t.ap_group_mode===a.qq.ALL)return!0;const n=new Set(t.ap_group_ids??[]);return i.some(t=>n.has(t._id)&&t.device_macs?.includes(e))}))(e,i,r);for(const i of t){const t=i.networkconf_id;if(!t||t===d)continue;const r=`${e}:${t}`;u.has(r)||(u.add(r),m(t)||A.push({networkName:E(t,s),entityName:(0,_.Q)(h),reason:n.WIFI,...p}))}}if(h?.mgmt_network_id){const t=h.mgmt_network_id;if(t!==d){const i=`${e}:mgmt:${t}`;u.has(i)||(u.add(i),m(t)||A.push({networkName:E(t,s),entityName:(0,_.Q)(h),reason:n.MGMT,...p}))}}if(!h){const t=c.find(t=>"mac"in t&&t.mac===e);if(t&&"virtual_network_override_enabled"in t&&t.virtual_network_override_enabled){const i=t.virtual_network_override_id;if(i&&i!==d){const r=`${e}:vno:${i}`;u.has(r)||(u.add(r),m(i)||A.push({networkName:E(i,s),entityName:t.display_name||t.name||e,reason:n.VNO,...p}))}}}return A},k=(e,t)=>{const i=e.uplink?.uplink_mac??e.last_uplink?.uplink_mac,n=e.uplink?.uplink_remote_port??e.last_uplink?.uplink_remote_port,r=e.uplink?.port_idx??e.last_uplink?.port_idx,s=i?t.get(i):void 0;return{localPort:p(e,r),remotePort:p(s,n)}},x=(e,t)=>{const i=(0,s.d4)(m.Kh);return(0,r.useMemo)(()=>{if(!e||!t)return{hasConflict:!1,localPortMissing:!1,remotePortMissing:!1};const{localPort:n,remotePort:r}=k(e,i),s=A(r,t),o=A(n,t);return{hasConflict:s||o,localPortMissing:o,remotePortMissing:s}},[e,t,i])},N=(e,t,i,n,r)=>{if(!e)return;if(null!=t){const s=n.get(e),o=p(s,t);if(!o||!A(o,i))return;return{networkName:E(i,r),switchName:(0,_.Q)(s??{mac:e}),port:t}}const s=n.get(e),o=s?.uplink?.uplink_mac??s?.last_uplink?.uplink_mac,c=s?.uplink?.uplink_remote_port??s?.last_uplink?.uplink_remote_port;if(!o||null==c)return;const l=n.get(o),a=p(l,c);return a&&A(a,i)?{networkName:E(i,r),switchName:(0,_.Q)(l??{mac:o}),port:c,apName:(0,_.Q)(s??{mac:e})}:void 0},f=(e,t,i,n)=>{const o=(0,s.d4)(m.Kh),c=(0,s.d4)(u.Tn);return(0,r.useMemo)(()=>{if(n&&i)return N(e,t,i,o,c)},[n,e,t,i,o,c])}}}]);