"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[90124],{689965(e,t,r){r.d(t,{A:()=>u,I:()=>n});var n,a=r(296540),l=r(822336),i=r(963724),o=r(71479),m=r(825032),c=r(566723),d=r(294303),s=r(311785);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(n||(n={}));const E=(0,o.A)(d.A,(0,s.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:r}})=>e||l.Ay[r===m.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}})=>l.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,p=(0,o.A)(i.A,(0,s.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:r}})=>e||l.Ay[r===m.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||l.Ay[t===m.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${c.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${c.Ln} ${c.Ln};
      }
    }
  }
`,u=({type:e,marginBottom:t,margin:r,padding:l,flex:i,width:o,nested:m,...c})=>"items"in c?a.createElement(p,{marginBottom:t,margin:r,padding:l,flex:i,nested:m,...c}):a.createElement(E,{nested:m,width:o,marginBottom:t,margin:r,padding:l,flex:i,isButtonList:e===n.BUTTON_LIST,...c},c.children)},471047(e,t,r){r.d(t,{A:()=>I});var n=r(469733),a=r(296540),l=r(217439),i=r(180524),o=r(968906),m=r(960407),c=r(398300),d=r(855019),s=r(548212),E=r(213601),p=r(137625),u=r(955161),_=r(845030),A=r(916537),g=r(431247),O=r(780811),f=r(171073),h=r(842235),T=r(85570);const I=({extendedPort:e,keyValue:t,portSize:r,portSizeOverride:I,disableOnPortClick:k=!1,centerIcon:S,marginLeft:C,tooltipPlacement:x="bottom"})=>{const P=(0,n.useDispatch)(),R=(0,n.useSelector)(m.oI),b=(0,n.useSelector)(m.rw),[L,N]=(0,a.useState)(!1),{device:$}=e,{mac:D,model:v}=$,z=(0,a.useCallback)(()=>{P((0,f.Fx)($,e.port_idx)),N(!1)},[P,$,e.port_idx]),M=Boolean(e.poe_enable&&!(0,O.ioy)($));return a.createElement(u.A,{condition:M,wrapper:t=>a.createElement(p.A,{title:"DEVICE_PORT_POWER_CYCLE_CONFIRMATION_TITLE",titleValues:{portId:e.port_idx},buttonMessage:"COMMON_ACTION_PROCEED",handleClose:N,handleConfirm:z,isOpen:L,rootClose:!0,body:a.createElement(l.A,{size:"inherit"},a.createElement(A.sA,{id:"DEVICE_PORT_POWER_CYCLE_CONFIRMATION_BODY",values:{portId:e.port_idx}}))},t)},a.createElement(i.A,{description:a.createElement(h.A,{portData:e,showPowerCycleHeader:M,portName:e.name,device:b}),delay:0,closeDelay:0,isDisabled:L,key:t,placement:x,className:T.K5},a.createElement(T.Dn,{onClick:t=>M?(N(!0),null):k||e.masked?null:(t?.preventDefault?.(),t?.stopPropagation?.(),P((0,_.XP)({type:c.H.DEVICE,id:D,tab:R,subPanel:d.uY.PORTS,subId:String(e.port_idx)}))),...o.A.addDataTestId(o.A.TestId.SIDE_PANEL_TRIGGER)},a.createElement(T.MM,{centerIcon:S,marginLeft:C,colorInfo:(0,s.PI)(e),portSize:r,portSizeOverride:I,hasTransparentBorder:(0,g._R)(e.port_idx,v)},a.createElement(E.A,{icon:e.icon,smallerIcons:!0})),(0,g.jw)(e.port_idx,v)?a.createElement(T.lh,null):null)))}},799552(e,t,r){r.d(t,{A:()=>R});var n=r(296540),a=r(23514),l=r(162420),i=r(71479),o=r(132196),m=r(469733),c=r(966784),d=r(780811),s=r(962669),E=r(916537),p=r(294303),u=r(566723),_=r(854726),A=r(944373),g=r(538535),O=r(366188),f=r(792072),h=r(460680),T=r(156472),I=r(237628),k=r(335165),S=r(471047),C=r(85570);const x=(0,i.A)(p.A)`
  font-size: ${({theme:{fontSizes:e}})=>e[0]}px;
`,P=({spacing:e},t)=>o.AH`
  &:not(:first-child) {
    margin-top: ${u.YC};
  }
  &:nth-child(2n) {
    margin-top: ${e};
  }

  justify-content: ${t?"space-between":"unset"};
`,R=({activeItem:e,portSizeOverride:t,disableOnPortClick:r,isStacking:i})=>{const{model:o}=e,{diagram:u}=(0,I.j)(o),R=u?.length?(0,s.sT)(u,e):(0,s.oJ)(e),b=Number((0,a.A)(R.map(e=>e.length))),L=Object.values(k.J).find(e=>b<=e.threshold)||k.J.xsmall,N=L===k.J.xsmall,$=(0,d.ez9)(e)||(0,d.gE3)(e),D=(0,m.useSelector)(_.wD),v=(0,m.useSelector)(A.D),z=(0,m.useSelector)(g.D5),M=(0,m.useSelector)(O.wf),w=(0,m.useSelector)(f.pB),y=(0,m.useSelector)(T.G),V=(0,m.useSelector)(h.qS),B=(0,n.useMemo)(()=>(0,c.Vi)(e,D,v,z,M,w,y,V),[e,D,v,z,M,w,y,V]);return R&&0!==R.length?n.createElement(n.Fragment,null,R.map((e,a)=>n.createElement(p.A,{"align-items":"flex-end",key:`PortLayoutRow-${a+1}`,className:P(L,i),flex:`1 1 ${t||L.size}`,gap:L?.spacing||k.J.large.spacing},e.map((e,l)=>{const i=`Port-${a+1}-${l+1}`,o=e&&B.find(t=>t.port_idx===e.portNumber);return o?n.createElement(S.A,{extendedPort:o,key:i,keyValue:i,portSize:L,portSizeOverride:t,disableOnPortClick:Boolean(r)}):$||N&&((e,t)=>{if(e[0]?.[t]||0!==e.length&&e[1]?.[t])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})(R,l)?null:n.createElement(C.hK,{key:i,portSize:L,portSizeOverride:t})})))):n.createElement(x,null,n.createElement(l.A,{isActive:!0,className:"mr-2"}),n.createElement(E.sA,{id:"DEVICE_DIAGRAM_MISSING"}))}},842235(e,t,r){r.d(t,{A:()=>k});var n=r(469733),a=r(296540),l=r(822336),i=r(777916),o=r(217439),m=r(705145),c=r(71479),d=r(6510),s=r(566723),E=r(294303),p=r(916537),u=r(854726),_=r(962669),A=r(431247),g=r(552020),O=r(532419);const f=(0,c.A)("div")`
  display: flex;
  justify-content: space-between;
  gap: ${s.YC};

  & > :last-child {
    max-width: 60%;
    text-align: right;
  }
`,h=(0,c.A)(E.A)`
  margin-bottom: ${s.kc};
  padding-bottom: ${s.kc};
  border-bottom: ${({theme:{themeName:e}})=>l.Ay[`desktop-border-divider-${e}`]};
`,T=(0,c.A)(m.A)`
  white-space: nowrap;
`,I=e=>a.createElement(T,{size:"small",...e}),k=({portData:e,portName:t,showPowerCycleHeader:r=!1,device:l})=>{const{ifname:m,port_idx:c,tx_bytes:T,rx_bytes:k,sfp_txfault:S,sfp_rxfault:C,sfp_vendor:x,sfp_serial:P,sfp_part:R,sfp_rev:b,sfp_compliance:L,sfp_voltage:N,sfp_current:$,sfp_txpower:D,sfp_rxpower:v,sfp_temperature:z}=e||{},{formatMessage:M}=(0,p.tz)(),w=(0,n.useSelector)(u.wD),y=(0,A.Hn)(e,w),V=(0,n.useSelector)(O.ID),B=(0,_.Uz)(e.port_idx,l.mac,l.downlink_table,V),W=(0,_.RK)(e,l,V),U=e&&(0,A.wp)(e)&&e.sfp_found,H=(0,_.xx)(e,M),F=(0,_.m3)(e,M),Y=(0,g.Ki)(e),K=[];return U&&(S&&K.push(M({id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_TX_FAULT"})),C&&K.push(M({id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_RX_FAULT"}))),a.createElement(E.A,{flexDirection:"column",minWidth:100},r?a.createElement(h,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"DEVICE_ACTIONS_PORT_CLICK_TO_POWER_CYCLE"}))):null,a.createElement(E.A,{gap:s.YC,flexDirection:"column"},e.masked||!c&&!m?null:a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_PORT"})),a.createElement(I,{motif:"dark"},(0,_.LS)(e,l.model))),t?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_NAME"})),a.createElement(I,{motif:"dark",isTruncated:!0},t)):null,H?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_SPEED"})),a.createElement(I,{motif:"dark",isTruncated:!0},H)):null,F||K.length>0?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_STATUS"})),a.createElement(I,{motif:"dark",isTruncated:!0},F,K.length>0?a.createElement(o.A,{color:"destructive"},K.join(", ")):null)):null,T&&T>0?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_TX"})),a.createElement(I,{motif:"dark"},a.createElement(i.A,{type:"bytes",input:T,motif:"dark"}))):null,k&&k>0?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_RX"})),a.createElement(I,{motif:"dark"},a.createElement(i.A,{type:"bytes",input:k,motif:"dark"}))):null,Y?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_DEVICE_POE_MODE_POE"})),a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:Y,values:{power:e.poe_power}}))):null,y?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_PROFILE"})),a.createElement(I,{motif:"dark",isTruncated:!0},y)):null,B?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_DOWNLINK"})),a.createElement(I,{motif:"dark",isTruncated:!0},(0,d.Q)(B))):null,W?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_UPLINK"})),a.createElement(I,{motif:"dark",isTruncated:!0},(0,d.Q)(W))):null,U?a.createElement(a.Fragment,null,x?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_VENDOR"})),a.createElement(I,{motif:"dark"},String(x))):null,P?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_SERIAL"})),a.createElement(I,{motif:"dark"},String(P))):null,R?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_PART_NUMBER"})),a.createElement(I,{motif:"dark"},String(R))):null,b?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_REV"})),a.createElement(I,{motif:"dark"},String(b))):null,L?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_COMPLIANCE"})),a.createElement(I,{motif:"dark",isTruncated:!0},String(L))):null,N?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_VOLTAGE"})),a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_VOLTAGE",values:{voltage:Number(N||0).toFixed(2)}}))):null,$?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_CURRENT"})),a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_CURRENT",values:{current:+$}}))):null,z?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"COMMON_TEMPERATURE"})),a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_VALUE",values:{temperature:Number(z).toFixed(1)}}))):null,Number(D)?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_OUTPUT_POWER"})),a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_IO_POWER",values:{power:Number(D).toFixed(2)}}))):null,Number(v)?a.createElement(f,null,a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_INPUT_POWER"})),a.createElement(I,{motif:"dark"},a.createElement(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_IO_POWER",values:{power:Number(v).toFixed(2)}}))):null):null))}},85570(e,t,r){r.d(t,{Dn:()=>_,K5:()=>A,MM:()=>E,hK:()=>p,lh:()=>u});var n=r(822336),a=r(71479),l=r(132196),i=r(566723),o=r(335165),m=r(294303),c=r(966784),d=r(376272),s=r(311785);const E=(0,a.A)(m.A,(0,s.A)("colorInfo","portSize","portSizeOverride","isDisabled","centerIcon","hasTransparentBorder"))`
  height: ${({portSizeOverride:e,portSize:t})=>e||t?.size||o.J.large.size};
  width: ${({portSizeOverride:e,portSize:t})=>e||t?.size||o.J.large.size};
  ${({portSize:e})=>e?.marginSize?`margin-left: ${e.marginSize}`:""};
  ${({portSize:e,marginLeft:t})=>e?.marginSize||t?`margin-left: ${t||e?.marginSize};`:""};
  align-items: center;
  border-radius: 2px;
  justify-content: center;
  position: relative;
  pointer-events: auto;
  z-index: 3;

  ${({colorInfo:e,theme:{themeName:t}})=>e.background===d.A.DISABLED.background&&`border: ${(0,c.oX)(e.border,t)} 1px solid;`}
  background-color: ${({colorInfo:e,theme:{themeName:t}})=>(0,c.oX)(e.background,t)};
  color: ${({colorInfo:e,theme:{themeName:t}})=>(0,c.oX)(e.text,t)};

  /* Fix hover area of combo ports */
  ${({hasTransparentBorder:e})=>e&&"\n      position: relative;\n      &:before {\n        content: '';\n        position: absolute;\n        top: -3px;\n        right: -3px;\n        bottom: -3px;\n        left: -3px;   \n        background: transparent;\n        z-index: 2; \n      }\n  "}

  ${({centerIcon:e,portSize:t})=>e&&t?.spacing&&`transform: translateY(calc(50% + ${t?.spacing} / 2))`};
`,p=(0,a.A)("div",(0,s.A)("portSize","portSizeOverride"))`
  width: ${({portSizeOverride:e,portSize:t})=>e||t?.size||o.J.large.size};
  flex-shrink: 0;
`,u=(0,a.A)("div",(0,s.A)("size"))`
  position: absolute;
  width: calc(${o.J.large.size} + ${o.J.large.size} + 8px);
  height: calc(${o.J.large.size} + 4px);
  top: -2px;
  left: -2px;
  z-index: 1;
  background: ${({theme:{themeName:e}})=>n.Ay[`desktop-color-ublue-01-${e}`]};
  border-radius: ${i.YC};
  border: 1px solid ${({theme:{themeName:e}})=>n.Ay[`desktop-color-ublue-04-${e}`]};
`,_=(0,a.A)(m.A)`
  position: relative;
  cursor: pointer;
`,A=l.AH`
  [data-uic-component='Tooltip.Arrow'] {
    pointer-events: none;
  }
`},335165(e,t,r){r.d(t,{J:()=>a});var n=r(566723);const a={large:{threshold:12,size:"24px",spacing:n.YC},medium:{threshold:15,size:"16px",spacing:n.YC},small:{threshold:20,size:"12px",spacing:n.YC},xsmall:{threshold:50,size:"11px",spacing:"1px"}}},372737(e,t,r){var n;r.d(t,{U:()=>n}),function(e){e.ARROW_LEFT="ArrowLeft",e.ARROW_RIGHT="ArrowRight",e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape",e.BACKSPACE="Backspace",e.DELETE="Delete",e.TAB="Tab"}(n||(n={}))}}]);