"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[49915,89965],{86571:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(296540),i=r(217439),o=r(699784);const a=({id:e,children:t,values:r})=>n.createElement(i.A,{color:"text-1",weight:"bold",size:"medium"},e?n.createElement(o.sA,{id:e,values:r}):null,t)},216211:(e,t,r)=>{r.d(t,{e:()=>u});var n=r(956347),i=r(469733),o=r(296540),a=r(15095),l=r(627440),c=r(431247),s=r(293016),d=r(649413),m=r(497470);const u=()=>{const e=(0,i.useDispatch)(),t=(0,n.W6)(),r=(0,a.A)(`${l.VO.PORTS}`);return{handleGoToPortsPage:(0,o.useCallback)((n,i,o)=>{if(n)if(e((0,m.gU)(!0)),e((0,m.U)((0,d.HN)(s.F7.DEVICE,[n]))),o&&(e((0,m.IU)(!0)),e((0,m.E1)(!1))),i){const t=(0,c.FS)(n,i);e((0,m.Ao)([t]))}else e((0,m.Ao)([]));t.push(r)},[r,t,e])}}},319826:(e,t,r)=>{r.d(t,{$3:()=>v,SD:()=>k,b5:()=>I,nR:()=>C,sD:()=>S,yz:()=>O});var n=r(296540),i=r(566401),o=r(927099),a=r(71479),l=r(316144),c=r(137298),s=r(6510),d=r(266714),m=r(294303),u=r(6176),p=r(703447),g=r(699784),h=r(768941),E=r(962669),A=r(757167),_=r(552020),b=r(780811),x=(r(154828),r(951106));const f=(0,a.A)(o.A)`
  padding-left: 10px;
  color: inherit;
  font-size: inherit;
`,v=({activeItem:e,networkGroups:t,rest:r})=>{const{diagram:o}=(0,b.joB)(e.model),a=[(0,b.D6h)(e),(0,b.bf1)(e),(0,b.Bh_)(e)],{uplinkItems:h,...v}=r||{},I=(0,b.Tl7)(e)||(0,b.kYz)(e)||(0,b.vqp)(e),O=o.length?(0,E.sT)(o,e):(0,E.oJ)(e);return O?O.flat().reduce((r,o)=>{if(!o)return r;const E=(0,b.NF$)(o.portNumber,e);if((0,i.A)(E))return r;const O=n.createElement(m.A,{alignItems:"center"},n.createElement(d.A,{cellData:E,activeItem:e,style:{minWidth:20},...v}),n.createElement(f,{truncate:!0},E.port_idx)),S=n.createElement(m.A,{alignItems:"center"},n.createElement(d.A,{cellData:E,activeItem:e,style:{minWidth:20},disableOnPortClick:I,...v}),n.createElement(f,{truncate:!0},((e,t)=>{if(t.poe_caps&&!(0,b.C6C)(e)){const e=(0,_.Ki)(t);return e?n.createElement(g.sA,{id:e,values:{power:t.poe_power}}):""}return t.up?(0,c.ap)(t?.speed||0)||n.createElement(g.sA,{id:"DEVICE_PORT_STATE_CONNECTED"}):t.enable?n.createElement(g.sA,{id:"COMMON_DISCONNECTED"}):n.createElement(g.sA,{id:"COMMON_DISABLED"})})(e,E))),C=(0,l.nL)(E.ifname,e,t),k="Internal"===C?.label,N=C?.id?.startsWith("LAN")||k,P=h?.find(e=>e.portIdx===E.port_idx)?.connected[0];let $=n.createElement(m.A,null);if(P){const e="device_id"in P?(0,s.Q)(P):(0,x.tn)(P),t="device_id"in P?n.createElement(u.A,{model:P.model,width:18,height:22}):n.createElement(m.A,{height:26,minWidth:22,maxWidth:22,justifyContent:"center",alignItems:"center"},n.createElement(p.A,{client:P}));$=n.createElement(m.A,{alignItems:"center"},n.createElement(m.A,{alignItems:"center",marginRight:"14px"},t),n.createElement(m.A,{alignItems:"center",flex:1},e))}const T={...E,id:E.port_idx?.toString()||E.ifname,defaultNetworkGroupLabel:(0,b.Xq1)(e,E),disabled:E.masked||(0,A.dC)(E.ifname),isInternalPort:k,isLanPort:N,isWanPort:!N,networkGroup:C?.id,portUplinkItemName:$,portStatus:S,portSymbol:O};return a.every(e=>!e)&&(T.macFilters=E.port_security_mac_address?.length),r.push(T),r},[]).sort(({port_idx:e},{port_idx:t})=>e-t):[]},I=e=>e.isWanPort,O=e=>e.isLanPort,S=e=>e.filter(({disabled:e})=>!e).map(({port_idx:e})=>String(e)),C=(e,t)=>e.map(e=>{const r=t.find(t=>e.port_idx===t.portIdx);if(!r)return e;const{rx_broadcast:n,rx_bytes:i,rx_dropped:o,rx_errors:a,rx_multicast:l,rx_packets:c,tx_broadcast:s,tx_bytes:d,tx_dropped:m,tx_errors:u,tx_multicast:p,tx_packets:g}=r;return{...e,rx_broadcast:n,rx_bytes:i,rx_dropped:o,rx_errors:a,rx_multicast:l,rx_packets:c,tx_broadcast:s,tx_bytes:d,tx_dropped:m,tx_errors:u,tx_multicast:p,tx_packets:g}}),k=e=>{const{isPoeOffSupported:t,isPoePassthroughSupported:r,isPoePassive24Supported:n,isPoeAutoSupported:i}=e,o=[];return t&&o.push(h.Gu.OFF),r&&o.push(h.Gu.PASSTHROUGH),!r&&n&&o.push(h.Gu.PASSIVE_24V),!r&&i&&o.push(h.Gu.AUTO),o}},575177:(e,t,r)=>{r.r(t),r.d(t,{default:()=>g});var n=r(296540),i=r(86571),o=r(689965),a=r(87250),l=r(780811),c=r(275357),s=r(949810),d=r(540739),m=r(525901),u=r(470995),p=r(943089);const g=({activeItem:e,activeItem:{mac:t,model:r}})=>n.createElement(n.Fragment,null,n.createElement(o.A,null,n.createElement(s.A,{activeItem:e,hidePorts:(0,l.kYz)(e)})),n.createElement(o.A,{type:o.I.ACCORDION,items:[{id:"outlets",openByDefault:!0,label:n.createElement(i.A,{id:"COMMON_OUTLETS"}),renderContent:()=>n.createElement(p.A,{activeItem:e})}]}),n.createElement(m.A,{mac:t,model:r,logType:d.F.DEVICE,ignoreActionableValues:[c.dl.DEVICE],label:"COMMON_HISTORY",hideClientTabs:!0}),n.createElement(u.A,{mac:t,object:a.qv.SW}))},689965:(e,t,r)=>{r.d(t,{A:()=>p,I:()=>n});var n,i=r(296540),o=r(822336),a=r(427853),l=r(71479),c=r(825032),s=r(566723),d=r(294303);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(n||(n={}));const m=(0,l.A)(d.A,{shouldForwardProp:e=>!["marginBottom","isButtonList","margin","flex","width","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:r}})=>e||o.Ay[r===c.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:r})=>r||(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}})=>o.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,l.A)(a.A,{shouldForwardProp:e=>!["marginBottom","margin","flex","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:r}})=>e||o.Ay[r===c.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||o.Ay[t===c.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${s.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0 ${s.Ln} ${s.Ln};
      > div {
        padding: 0;
      }
    }
  }
`,p=({type:e,marginBottom:t,margin:r,padding:o,flex:a,width:l,nested:c,...s})=>"items"in s?i.createElement(u,{marginBottom:t,margin:r,padding:o,flex:a,nested:c,...s}):i.createElement(m,{nested:c,width:l,marginBottom:t,margin:r,padding:o,flex:a,isButtonList:e===n.BUTTON_LIST,...s},s.children)},799552:(e,t,r)=>{r.d(t,{A:()=>_});var n=r(296540),i=r(23514),o=r(162420),a=r(71479),l=r(132196),c=r(566723),s=r(294303),d=r(699784),m=r(962669),u=r(780811),p=r(266714),g=r(335165);const h=(0,a.A)(s.A)`
  font-size: ${({theme:{fontSizes:e}})=>e[0]}px;
`,E=(0,a.A)("div",{shouldForwardProp:e=>!["portSize","portSizeOverride"].includes(e)})`
  width: ${({portSizeOverride:e,portSize:t})=>e||t?.size||g.J.large.size};
  flex-shrink: 0;
`,A=({spacing:e},t)=>l.AH`
  &:not(:first-child) {
    margin-top: ${c.YC};
  }
  &:nth-child(2n) {
    margin-top: ${e};
  }

  justify-content: ${t?"space-between":"unset"};
`,_=({activeItem:e,activeItem:{model:t},portSizeOverride:r,disableOnPortClick:a,isStacking:l})=>{const{diagram:c}=(0,u.joB)(t),_=c?.length?(0,m.sT)(c,e):(0,m.oJ)(e);if(!_||0===_.length)return n.createElement(h,null,n.createElement(o.A,{isActive:!0,className:"mr-2"}),n.createElement(d.sA,{id:"DEVICE_DIAGRAM_MISSING"}));const b=Number((0,i.A)(_.map(e=>e.length))),x=Object.values(g.J).find(e=>b<=e.threshold)||g.J.xsmall,f=x===g.J.xsmall;return n.createElement(n.Fragment,null,_.map((t,i)=>n.createElement(s.A,{"align-items":"flex-end",key:`PortLayoutRow-${i+1}`,className:A(x,l),flex:`1 1 ${r||x.size}`,gap:x?.spacing||g.J.large.spacing},t.map((t,o)=>{const l=`Port-${i+1}-${o+1}`,c=t&&e?.port_table?(0,u.NF$)(t.portNumber,e):null;return c?n.createElement(p.A,{cellData:c,activeItem:e,key:l,keyValue:l,portSize:x,portSizeOverride:r,disableOnPortClick:a}):f&&((e,t)=>{const r=!e[0]?.[t],n=0===e.length||!e[1]?.[t];if(!r||!n)return!1;if(t>0){const r=e[0]?.[t-1],n=e.length>1?e[1]?.[t-1]:null;if(!(r?.portType||"").includes("sfp")||!(n?.portType||"").includes("sfp"))return!1}return!0})(_,o)?null:n.createElement(E,{key:l,portSize:x,portSizeOverride:r})}))))}},943089:(e,t,r)=>{r.d(t,{A:()=>C});var n=r(296540),i=r(469733),o=r(271856),a=r(927099),l=r(963070),c=r(897547),s=r(71479),d=r(960407),m=r(860631),u=r(398300),p=r(855019),g=r(294303),h=r(845030),E=r(699784),A=r(319826),_=r(170163),b=r(780811),x=r(953394),f=r(405639);const v=(0,s.A)("div")`
  font-size: ${({theme:{fontSizes:e}})=>e[2]}px;
  padding-left: 10px;
`,I=(0,s.A)("div")`
  table {
    tr {
      cursor: pointer;
    }
  }
`,O=(0,s.A)(c.A)`
  position: absolute;
  right: 8px;
  color: inherit;
`,S=(0,n.memo)(({activeItem:e,activeItem:{outlet_table:t},hidePorts:r,overrideNameHeader:c,onRowClick:s})=>{const S=(0,i.useDispatch)(),C=(0,i.useSelector)(d.oI),k=(0,_.Ib)(e.model),{outletsDiagram:N,primaryOutletGroupCount:P}=(0,b.joB)(e.model),$=t?.some(e=>(0,m.TT)(e,"POWER_METER")),T=(0,n.useMemo)(()=>((e,t,r)=>[{id:"name",label:r||n.createElement(E.sA,{id:"COMMON_NAME"}),renderCell:({name:e})=>n.createElement(o.A,{noWrap:!0,description:n.createElement(a.A,{truncate:!0,color:"inherit",size:"body",style:{whiteSpace:"nowrap"}},e)},n.createElement(a.A,{color:"inherit",size:"body",truncate:!0},e))},...e?[{id:"power",label:n.createElement(E.sA,{id:"DEVICE_PROPERTIES_LABEL_POWER"}),renderCell:({outlet_power:e})=>n.createElement(a.A,{color:"inherit",size:"body"},e?Number(e).toFixed(2):n.createElement(E.sA,{id:"COMMON_FALLBACK"}))}]:[],{id:"outletStatus",label:n.createElement(E.sA,{id:"COMMON_STATUS"}),width:45,renderCell:e=>n.createElement(n.Fragment,null,n.createElement(g.A,{alignItems:"center"},e.portStatus?n.createElement(a.A,{color:"inherit",size:"body"},e.portStatus):n.createElement(n.Fragment,null,n.createElement(f.A,{activeItemMac:t,cellData:e,iconRotation:e.iconRotation,tooltipPlacement:"top right"}),n.createElement(v,null,n.createElement(E.sA,{id:e.relay_state?"COMMON_ENABLED":"COMMON_DISABLED"})))),n.createElement(O,{size:"small"}))}])($,e.mac,c),[$,e.mac,c]),y=N.length?(0,_.FP)(N,e.model):(0,_.ST)(P,e.model),w=(0,A.$3)({activeItem:e,networkGroups:[],rest:{position:"topRight"}}),D=(0,n.useMemo)(()=>[...y.flat().filter(e=>!!e&&[x.s.STANDARD,x.s.USB].includes(e.outletType)).sort(({outletNumber:e},{outletNumber:t})=>e-t),...r?[]:w],[r,w,y]).map(t=>{const r=(0,_.o3)(e,void 0,t.outletNumber);return{...t.portStatus?t:r,id:t.portStatus?`port-${t.id}`:t.outletNumber,outletType:t.portStatus?null:(0,_.I)(k,t.outletNumber),iconRotation:t?.iconRotation}}),R=(0,n.useCallback)(({index:t,port_idx:r,outletType:n})=>{if([x.s.STANDARD,x.s.USB].includes(n)){const n=String(t||r);s?s(n):S((0,h.XP)({type:u.H.DEVICE,id:e.mac,tab:C,subPanel:t?p.uY.OUTLETS:p.uY.PORTS,subId:n}))}},[S,C,e.mac,s]);return n.createElement(I,null,n.createElement(l.A,{columns:T,disableColumnFilters:!0,items:D,hideCellOverflow:!1,onRowClick:R,truncateHeaderCells:!0}))},({activeItem:e},{activeItem:t})=>e.model===t.model&&e.outlet_table===t.outlet_table&&e.outlet_overrides===t.outlet_overrides),C=({activeItem:e,hidePorts:t,overrideNameHeader:r,onRowClick:i})=>n.createElement(S,{activeItem:e,hidePorts:t,overrideNameHeader:r,onRowClick:i})},949810:(e,t,r)=>{r.d(t,{A:()=>v});var n=r(296540),i=r(927099),o=r(822336),a=r(823858),l=r(618983),c=r(71479),s=r(566723),d=r(294303),m=r(699784),u=r(170163),p=r(780811),g=r(837612),h=r(799552),E=r(377588),A=r(406816);const _=(0,c.A)("div")`
  display: flex;
  flex-direction: column;
`,b=(0,c.A)("div")`
  margin-top: ${s.Ln};
  padding-top: ${s.Ln};
  border-top: ${({theme:{themeName:e}})=>o.Ay[`desktop-border-divider-${e}`]};

  div:first-child {
    margin-bottom: ${s.xO};
  }
`,x=(0,c.A)(a.A)`
  color: ${({theme:{motifPalette:{warning:e}}})=>e};
  height: 18px;
  width: 18px;
  margin-right: 10px;
`,f=(0,c.A)(l.A)`
  color: ${({theme:{motifPalette:{success:e}}})=>e};
  height: 18px;
  width: 18px;
  margin-right: 10px;
`,v=({activeItem:e,activeItem:{outlet_table:t,outlet_ac_power_budget:r,outlet_ac_power_consumption:o,port_table:a},hidePorts:l,noDivider:c,gap:v=s.xO,legend:I,verticalLegend:O,tooltipPlacement:S="bottom right"})=>{const{usedPower:C,maxPower:k}=(0,n.useMemo)(()=>(0,u.hf)({outlet_table:t,outlet_ac_power_budget:r,outlet_ac_power_consumption:o}),[t,r,o]),N=(0,p.Tl7)(e)||(0,p.kYz)(e);return n.createElement(_,null,n.createElement(d.A,{justifyContent:"center",gap:v,alignItems:O?"center":void 0},n.createElement(d.A,{flexDirection:"column",alignItems:"center"},n.createElement(E.A,{activeItem:e,tooltipPlacement:S,isEU:(0,p.KaR)(e)||(0,p.K30)(e),offline:(0,p.aK8)((0,g.S9)(e))})),a&&!l?n.createElement("div",null,n.createElement(h.A,{activeItem:e,portSizeOverride:"19px",disableOnPortClick:N})):null,O),O?null:I||n.createElement(A.Ay,{activeItem:e,noTopBorder:c}),C>k?n.createElement(b,null,n.createElement(d.A,{justifyContent:"space-between"},n.createElement(x,null),n.createElement(i.A,{size:"caption"},n.createElement(m.sA,{id:"DEVICE_PROPERTIES_OUTLET_POWER_OVERLOAD_WARNING"}))),n.createElement(d.A,{justifyContent:"space-between"},n.createElement(f,null),n.createElement(i.A,{size:"caption"},n.createElement(m.sA,{id:"DEVICE_PROPERTIES_OUTLET_POWER_OVERLOAD_INFO"})))):null)}}}]);