"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[48522],{175522(e,t,r){r.d(t,{A:()=>a,Q:()=>o});var n=r(416348);const a="_",o=[n.ZM,n.Je]},319826(e,t,r){r.d(t,{$3:()=>T,SD:()=>R,b5:()=>N,nR:()=>k,sD:()=>g,yz:()=>x});var n=r(296540),a=r(566401),o=r(217439),l=r(71479),i=r(316144),s=r(137298),m=r(6510),d=r(721332),c=r(294303),p=r(6176),E=r(703447),u=r(916537),_=r(768941),A=r(962669),O=r(757167),I=r(552020),f=r(780811),C=(r(154828),r(951106)),S=r(237628);const P=(0,l.A)(o.A)`
  padding-left: 10px;
  color: inherit;
  font-size: inherit;
`,T=({activeItem:e,networkGroups:t,rest:r,hideStatus:o=!1})=>{const{diagram:l}=(0,S.j)(e.model),_=[(0,f.D6h)(e),(0,f.bf1)(e),(0,f.Bh_)(e)],{uplinkItems:T,...N}=r||{},x=(0,f.Tl7)(e)||(0,f.kYz)(e)||(0,f.vqp)(e),g=l.length?(0,A.sT)(l,e):(0,A.oJ)(e);return g?g.flat().reduce((r,l)=>{if(!l)return r;const A=(0,f.NF$)(l.portNumber,e);if((0,a.A)(A))return r;const S=n.createElement(c.A,{alignItems:"center"},n.createElement(d.A,{cellData:A,activeItem:e,style:{minWidth:20},...N}),n.createElement(P,{isTruncated:!0},A.port_idx)),g=n.createElement(c.A,{alignItems:"center"},n.createElement(d.A,{cellData:A,activeItem:e,style:{minWidth:20},disableOnPortClick:x,portSizeOverride:"20px",...N}),n.createElement(P,{isTruncated:!0},o?A.port_idx:((e,t)=>{if(t.poe_caps&&!(0,f.C6C)(e)){const e=(0,I.Ki)(t);return e?n.createElement(u.sA,{id:e,values:{power:t.poe_power}}):""}return t.up?(0,s.ap)(t?.speed||0)||n.createElement(u.sA,{id:"DEVICE_PORT_STATE_CONNECTED"}):n.createElement(u.sA,t.enable?{id:"COMMON_DISCONNECTED"}:{id:"COMMON_DISABLED"})})(e,A))),k=(0,i.nL)(A.ifname,e,t),R="Internal"===k?.label,b=k?.id?.startsWith("LAN")||R,h=T?.find(e=>e.portIdx===A.port_idx)?.connected[0];let v=n.createElement(c.A,null);if(h){const e="device_id"in h?(0,m.Q)(h):(0,C.tn)(h),t="device_id"in h?n.createElement(p.A,{model:h.model,width:18,height:22}):n.createElement(c.A,{height:26,minWidth:22,maxWidth:22,justifyContent:"center",alignItems:"center"},n.createElement(E.A,{client:h}));v=n.createElement(c.A,{alignItems:"center"},n.createElement(c.A,{alignItems:"center",marginRight:"14px"},t),n.createElement(c.A,{alignItems:"center",flex:1},e))}const D={...A,id:A.port_idx?.toString()||A.ifname,defaultNetworkGroupLabel:(0,f.Xq1)(e,A),disabled:A.masked||(0,O.dC)(A.ifname),isInternalPort:R,isLanPort:b,isWanPort:!b,networkGroup:k?.id,portUplinkItemName:v,portStatus:g,portSymbol:S};return _.every(e=>!e)&&(D.macFilters=A.port_security_mac_address?.length),r.push(D),r},[]).sort(({port_idx:e},{port_idx:t})=>e-t):[]},N=e=>e.isWanPort,x=e=>e.isLanPort,g=e=>e.filter(({disabled:e})=>!e).map(({port_idx:e})=>String(e)),k=(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:a,rx_dropped:o,rx_errors:l,rx_multicast:i,rx_packets:s,tx_broadcast:m,tx_bytes:d,tx_dropped:c,tx_errors:p,tx_multicast:E,tx_packets:u}=r;return{...e,rx_broadcast:n,rx_bytes:a,rx_dropped:o,rx_errors:l,rx_multicast:i,rx_packets:s,tx_broadcast:m,tx_bytes:d,tx_dropped:c,tx_errors:p,tx_multicast:E,tx_packets:u}}),R=e=>{const{isPoeOffSupported:t,isPoePassthroughSupported:r,isPoePassive24Supported:n,isPoeAutoSupported:a}=e,o=[];return t&&o.push(_.Gu.OFF),r&&o.push(_.Gu.PASSTHROUGH),!r&&n&&o.push(_.Gu.PASSIVE_24V),!r&&a&&o.push(_.Gu.AUTO),o}},137625(e,t,r){r.d(t,{A:()=>m});var n=r(296540),a=r(353899),o=r(132196),l=r(372737),i=r(566723),s=r(916537);const m=({children:e=null,title:t,titleValues:r,message:m,messageValues:d,handleConfirm:c=()=>null,handleClose:p=()=>null,handleCancel:E,isOpen:u,buttonVariant:_="primary",cancelButtonVariant:A="tertiary",cancelButtonMessage:O="COMMON_ACTION_CANCEL",buttonMessage:I="COMMON_ACTION_CONFIRM",buttonDisabled:f=!1,position:C="top",offset:S,showHeaderClose:P=!1,contentClassName:T="",body:N,titleBody:x,className:g,rootClose:k=!1,footerActions:R})=>{const b=(0,n.useCallback)(e=>{u&&(e.stopPropagation(),e.key===l.U.ENTER?c():e.key===l.U.ESCAPE&&p(!1))},[u,c,p]);(0,n.useEffect)(()=>(window.addEventListener("keydown",b,!0),()=>{window.removeEventListener("keydown",b,!0)}),[b]);const h=(0,n.useCallback)(()=>{p(!1),E?.()},[p,E]),v=(0,n.useCallback)(()=>{p(!1),c()},[p,c]),D=(0,n.useMemo)(()=>[{text:n.createElement(s.sA,{id:O}),variant:A,onClick:h},{text:n.createElement(s.sA,{id:I}),disabled:f,variant:_,onClick:v}],[I,_,O,A,h,v,f]),M=(0,n.useCallback)(()=>{p(!1)},[p]),w=o.AH`
    ${t?"":`margin-top: ${i.xO}`}
  `;return n.createElement(a.A,{title:t?n.createElement(s.sA,{id:t,values:r}):x||null,...m?{body:n.createElement(n.Fragment,null,n.createElement(s.sA,{id:m,values:d}),N)}:{body:N},position:C,portal:!0,offset:S,actions:R||D,showHeaderClose:P,contentClassName:o.AH`
        ${w}
        ${T}
      `,onRequestClose:M,isOpen:u,allowOverflow:!0,rootClose:k,className:g},e)}},373229(e,t,r){r.d(t,{A:()=>d});var n=r(296540),a=r(758649),o=r(71479),l=r(566723),i=r(916537),s=r(311785);const m=(0,o.A)("footer",(0,s.A)("hasFormResetButton"))`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${l.S2} ${l.fS};
  gap: ${l.kc};
`,d=({allowCancel:e,isDirty:t,isInvalid:r,isSubmitting:o,onFormSubmit:l,onFormReset:s,onFormCancel:d,className:c,submitButtonText:p,customButton:E,applyButton:u,applyButtonFirst:_,hideCancelButton:A,form:O})=>{const I=(0,n.useMemo)(()=>u||n.createElement(a.A,{name:"submit",variant:"primary",type:"submit",onClick:l,disabled:!t||r||o,form:O},n.createElement(i.sA,{id:p||"COMMON_ACTION_APPLY_CHANGES"})),[u,O,t,r,o,l,p]);return n.createElement(m,{className:c,hasFormResetButton:!!s},_?I:E,A?null:n.createElement(a.A,{name:"cancel",variant:"default",type:"button",onClick:d,disabled:!e&&!t},n.createElement(i.sA,{id:"COMMON_ACTION_CANCEL"})),s?n.createElement(a.A,{name:"reset",variant:"default",type:"button",onClick:s,disabled:!t},n.createElement(i.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULT"})):null,_?E:I)}},684271(e,t,r){r.r(t),r.d(t,{default:()=>ie});var n=r(822336),a=r(82960),o=r(469733),l=r(296540),i=r(951272),s=r(217439),m=r(823858),d=r(71479),c=r(316144),p=r(742920),E=r(513180),u=r(870443),_=r(960407),A=r(398300),O=r(566723),I=r(855019),f=r(294303),C=r(845030),S=r(916537),P=r(319826),T=r(233187),N=r(366188),x=r(780811),g=r(392290),k=r(171073),R=r(604561),b=r(594903),h=r(842151),v=r(350312),D=r(373229),M=r(237628),w=r(143811),L=r(768941),y=r(578819);const V=(0,d.A)(s.A)`
  line-height: 2.4em;
`,W=(0,d.A)("div")`
  flex: 1;
  max-width: calc(50% - 8px);
`,z=({wanPortData:e})=>{const{formatMessage:t}=(0,S.tz)(),{portIdx:r,networkGroup:n,speed:a,...o}=e,i=(0,y.kO)(o),m=`ports[${r-1}].poe_mode`,d=(0,l.useMemo)(()=>{const{isPoeOffSupported:e,isPoePassthroughSupported:r,isPoeAutoSupported:n,isPoePlusPlusSupported:a,isPoePlusSupported:o}=i,l=[];if(e&&l.push({label:t({id:"COMMON_DEVICE_POE_MODE_OFF"}),value:L.Gu.OFF}),!r&&n){let e="";e=t(a?{id:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS"}:o?{id:"COMMON_DEVICE_POE_MODE_AUTO"}:{id:"COMMON_DEVICE_POE_MODE_POE"}),l.push({label:e,value:L.Gu.AUTO})}return l},[t,i]);return l.createElement(f.A,{justifyContent:"space-between",alignItems:"center",marginBottom:24},l.createElement(f.A,{padding:"0 8px",flexDirection:"column"},l.createElement(s.A,{size:"small",color:"text-3"},l.createElement(S.sA,{id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_NETWORK_GROUP",values:{port:r,networkGroup:n}})),l.createElement(V,{size:"medium",color:"text-1"},l.createElement(S.sA,{id:"COMMON_DEVICE_POE_MODE_POE"}))),l.createElement(W,null,l.createElement(w.A,{name:m,type:"dropdown",variant:"secondary",options:d,full:!0})))};var F=r(489391),G=r(137298),$=r(860631),U=r(431247),B=r(158216),H=r(311785);const j=(0,d.A)(f.A,(0,H.A)("omitSpacing"))`
  margin-bottom: ${O.S2};
  ${({omitSpacing:e})=>e?"":`&:nth-of-type(3) {\n    padding-top: ${O.S2};\n  }`}
`,Y=(0,d.A)("div")`
  flex: 1;
  max-width: calc(50% - 8px);
`,J=({activeItem:e,port:t,groupOptions:r,speedOptions:n,group:a,omitSpacing:o})=>{const i=(0,x.Dh3)(e)||!(0,x.oWO)(e)&&!(0,$.jP)(e),{bindWith:s}=(0,c.Nk)(e.model,t.ifname);return l.createElement(j,{justifyContent:"space-between",omitSpacing:o},l.createElement(Y,null,l.createElement(w.A,{type:"dropdown",variant:"secondary",name:`ports[${t.portIdx-1}].networkGroup`,label:(0,x.lRq)(e)||(0,x.GJ5)(e)?"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_NETWORK_GROUP_SHORT":"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_NETWORK_GROUP",translateLabel:!0,translateLabelValues:{port:(0,x.oWO)(e)?(0,M.j)(e.model).ports[t.ifname]:t.portIdx,networkGroup:a},options:r,readOnly:i,validated:!0,full:!0})),n.length>0?l.createElement(Y,null,l.createElement(w.A,{label:"DEVICE_PROPERTIES_GATEWAY_PORTS_SPEED_DUPLEX",name:`ports[${t.portIdx-1}].speed`,type:"dropdown",variant:"secondary",full:!0,translateLabel:!0,translateOptions:!0,options:n,disabled:!!s&&s!==t.ifname})):null)},K=[8,9,10,11],X=({activeItem:e,ports:t})=>{const{formatMessage:r}=(0,S.tz)(),n=(0,o.useSelector)(_.n6),a=(0,o.useSelector)(N.LV),i=(0,x.UiL)(e)||(0,x.oaW)(e),s=(0,$.iw)(e),m=(0,x.lRq)(e),d=(0,x.oWO)(e),p=(0,l.useCallback)(({ifname:t})=>((0,c.Nk)(e.model,t)?.supportedValues||[]).filter(e=>!!R.A.linkNegotiationOptions[e]).map(e=>{const{speed:t=0,full_duplex:r=!1,autoneg:n}=R.A.linkNegotiationOptions[e],{value:a,unit:o}=(0,F.cS)((0,G.N8)(t),"bitrate"),l=`${a}${o}`;return{label:(0,B.K)(n,r),value:JSON.stringify({speed:t,full_duplex:r}),values:!n&&{speed:l}}}),[e.model]),E=(0,l.useMemo)(()=>n!==I.uj.WAN||s?a.filter(({id:e})=>e.startsWith("LAN")):[],[n,s,a]),u=(0,l.useMemo)(()=>r({id:"COMMON_DISABLED"}),[r]),A=(0,l.useCallback)(e=>[...[...a.filter(({id:e})=>e.startsWith("WAN")&&e!==T._4.WAN_LTE_FAILOVER),...E].filter(({id:r})=>s&&!d&&!!r.startsWith("LAN")||((e,t,r)=>!t.some(({networkGroup:t})=>t===e)||e===r.networkGroup)(r,t,e)).map(({id:e})=>({value:e,label:e})),{value:g.zJ,label:u}],[u,s,d,E,a,t]),O=(0,l.useMemo)(()=>t.filter(({isWanPort:e,media:t})=>n!==I.uj.WAN&&s?!(0,U.wp)({media:t}):e).sort((e,t)=>e.portIdx-t.portIdx),[s,t,n]),f=(0,l.useMemo)(()=>t.filter(({media:e})=>!(n===I.uj.WAN&&!i||!s)&&(0,U.wp)({media:e})),[s,i,t,n]);return i&&s?l.createElement(l.Fragment,null,t.filter(({portIdx:e})=>K.includes(e)).map(t=>l.createElement(J,{activeItem:e,port:t,groupOptions:A(t),speedOptions:p(t),group:t.media||t.defaultNetworkGroupLabel,key:t.portIdx,omitSpacing:!0}))):l.createElement(l.Fragment,null,O.map(t=>l.createElement(J,{activeItem:e,port:t,groupOptions:A(t),speedOptions:p(t),group:t.defaultNetworkGroupLabel||u,key:t.portIdx,omitSpacing:!m})),f.map(t=>l.createElement(J,{activeItem:e,port:t,groupOptions:A(t),speedOptions:p(t),group:t.media||t.defaultNetworkGroupLabel,key:t.portIdx,omitSpacing:!m})))},q=(0,d.A)(f.A)`
  position: relative;
  margin: -18px -30px 40px;
  padding: 12px 0;
  border-bottom: ${({theme:{themeName:e}})=>n.Ay[`desktop-border-divider-${e}`]};

  svg {
    position: absolute;
    left: 24px;
  }
`,Q=(0,d.A)(D.A,(0,H.A)("isFullPage"))`
  ${({isFullPage:e})=>e&&"\n    width: 100%;\n    justify-content: flex-end;  \n    gap:10px;\n  "};
`,Z=(0,d.A)(b.A)`
  & > div > span {
    flex: 1;
  }
`,ee=(0,d.A)(s.A)`
  width: 100%;
  text-align: center;
`,te=(0,d.A)(f.A)`
  width: 100%;
  padding: 16px 30px;
`,re=(0,d.A)(f.A)`
  margin-bottom: 24px;
`,ne=(0,d.A)(m.A)`
  margin-right: 8px;
  color: ${({theme:{themeName:e}})=>n.Ay[`desktop-color-orange-06-${e}`]};
`,ae=(0,d.A)(m.A)`
  margin-right: ${O.kc};
  color: ${({theme:{themeName:e}})=>n.Ay[`desktop-color-red-06-${e}`]};
`,oe=[1,2,6],le=(0,i.bk)({enableReinitialize:!0,mapPropsToValues:({networkGroups:e,activeItem:t})=>{const r=(0,P.$3)({activeItem:t,networkGroups:e});return{ports:r.sort((e,t)=>e.portIdx-t.portIdx).map((e,n)=>{const{supportedValues:a=[],bindWith:o}=(0,c.Nk)(t.model,e.ifname),l=!("autoneg"in e?e.autoneg:R.A.autoneg)&&e.speed&&e.full_duplex?{speed:e.speed,full_duplex:e.full_duplex}:{speed:0,full_duplex:!1};if(o){const e=r.find(e=>e.ifname===o);l.speed=e.speed,l.full_duplex=e.full_duplex}const i=JSON.stringify(l),{portName:s,portStatus:m,portSymbol:d,portUplinkItemName:p,...E}=e;return{...E,networkGroup:e.networkGroup||g.zJ,...a.length?{speed:i}:{},itemIndex:n}})}},validationSchema:({intl:{formatMessage:e},activeItem:t,params:r})=>{const n=r?.subPanelId===I.uj.ALL;return u.A.object().shape({ports:u.A.array().of(u.A.object().shape({networkGroup:u.A.string().label(e({id:"COMMON_INTERFACE"})).oneOf([E.C.WAN,E.C.WAN2,g.zJ,...(0,c.m9)(t)]).required()})).test("has-default-network-groups",l.createElement(f.A,{marginBottom:O.S2},l.createElement(ae,{width:19,height:19}),l.createElement(s.A,null,l.createElement(S.sA,{id:n?"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES_NO_WAN_OR_LAN_WARNING":"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES_NO_WAN_WARNING"}))),e=>e.some(e=>e.networkGroup===E.C.WAN)&&(!n||e.some(e=>e.networkGroup===T._4.LAN)))})},handleSubmit:({ports:e},{props:{networkGroups:t,updateDeviceWithIdEndpoint:r,showPropertyPanel:n,activeItem:{_id:a,port_overrides:o=[],mac:l},activeItem:i,onFormCloseAction:s,intl:{formatMessage:m},propertyPanelActiveItemTab:d}})=>{const c=(0,P.$3)({activeItem:i,networkGroups:t}),E=m({id:"DEVICE_PROPERTY_HEADER_PORTS"}),u=(0,x.ziy)({model:i.model}),_=u?e.filter(e=>oe.includes(e.portIdx)):e,O=u?(o||[]).filter(e=>oe.includes(e.port_idx)):o,I=[..._.map(e=>{const{speed:t,full_duplex:r}=JSON.parse(e.speed),{speed:n,full_duplex:a,...o}=O?.find(t=>t.port_idx===e.portIdx)||{};return{...o,...t?{speed:t,full_duplex:r}:{},...e.poe_mode!==c[e.portIdx-1].poe_mode?{poe_mode:e.poe_mode}:{},port_idx:e.portIdx,autoneg:!t}}),...(O||[])?.filter(e=>!_.some(t=>t.portIdx===e.port_idx))||[]],f=[];c.forEach(e=>{if(e.ifname.startsWith("eth")){const t=_.find(t=>t.ifname===e.ifname);if(t){if(t.networkGroup===g.zJ)return;f.push({ifname:t.ifname,networkgroup:t.networkGroup})}else e.networkGroup&&f.push({ifname:e.ifname,networkgroup:e.networkGroup})}}),r({port_overrides:I,ethernet_overrides:f},a,l,{failureToast:{icon:p.C.danger,message:"DEVICE_NOTICE_SAVE_ERROR",values:{section:E}},mergeAndOverrideKeys:["port_overrides","ethernet_overrides"],extend:!0}).then(()=>{s?s():n({type:A.H.DEVICE,id:i.mac,tab:d})})}}),ie=(0,a.Zz)(S.j4,(0,o.connect)((e,{onFormCloseAction:t})=>({networkGroups:(0,N.LV)(e),onFormCloseAction:t,propertyPanelActiveItemTab:(0,_.oI)(e)}),{updateDeviceWithIdEndpoint:k.ex,showPropertyPanel:C.XP}),le)(({activeItem:e,submitForm:t,resetForm:r,values:n,dirty:a,setFieldValue:i,errors:m,isFullPage:d,onFormCloseAction:c})=>{const p=(0,o.useDispatch)(),E=(0,o.useSelector)(_.oI),u=(0,o.useSelector)(N.LV),{networkGroups:O}=(0,M.j)(e.model),I=()=>{r(),c?c():p((0,C.XP)({type:A.H.DEVICE,id:e.mac,tab:E}))},f=n.ports.filter(({isWanPort:e,port_poe:t})=>e&&t),P=(0,l.useMemo)(()=>n.ports.some(e=>JSON.parse(e.speed||"{}").speed),[n.ports]);return l.createElement(l.Fragment,null,l.createElement(te,{flexDirection:"column",flex:"1 1 85%"},d?l.createElement(h.A,{padding:"none"},l.createElement(Z,{title:l.createElement(S.sA,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES"})})):l.createElement(q,{alignItems:"center"},l.createElement(v.A,{onClick:I,style:{cursor:"pointer"}}),l.createElement(ee,{size:"medium",weight:"bold"},l.createElement(S.sA,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES"}))),l.createElement(X,{activeItem:e,ports:n.ports}),(0,l.isValidElement)(m.ports)?m.ports:null,P?l.createElement(re,null,l.createElement(ne,{width:19,height:19}),l.createElement(s.A,{size:"medium"},l.createElement(S.sA,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES_SPEED_WARNING"}))):null,f.length>0?l.createElement(l.Fragment,null,l.createElement(b.A,{title:l.createElement(S.sA,{id:"DEVICE_PORT_PROFILE_OVERRIDE"})}),f.map(e=>l.createElement(z,{key:e.id,wanPortData:e}))):null),l.createElement(Q,{isDirty:a,onFormSubmit:t,onFormCancel:I,onFormReset:()=>{i("ports",n.ports.map(e=>{const t=u.find(t=>t.id===O[e.ifname]);return{...e,networkGroup:t?.id||g.zJ,autoneg:!0,speed:JSON.stringify({speed:0,full_duplex:!1})}}))},submitButtonText:d?null:"COMMON_ACTION_APPLY",allowCancel:!0,isFullPage:!!d}))})},158216(e,t,r){r.d(t,{K:()=>n});const n=(e,t)=>e?"COMMON_DEVICE_AUTONEG_FULL":t?"COMMON_DEVICE_DUPLEX_FULL":"COMMON_DEVICE_DUPLEX_HALF"},721332(e,t,r){r.d(t,{A:()=>v});var n=r(296540),a=r(469733),o=r(217439),l=r(180524),i=r(968906),s=r(960407),m=r(398300),d=r(855019),c=r(548212),p=r(213601),E=r(137625),u=r(955161),_=r(845030),A=r(916537),O=r(966784),I=r(538535),f=r(768941),C=r(366188),S=r(944373),P=r(792072),T=r(962669),N=r(431247),x=r(780811),g=r(171073),k=r(460680),R=r(842235),b=r(85570);const h=({cellData:e,activeItem:t,activeItem:{mac:r,name:h,model:v},keyValue:D,portSize:M,portSizeOverride:w,disableOnPortClick:L=!1,centerIcon:y,tooltipPlacement:V="bottom"})=>{const W=(0,a.useDispatch)(),z=(0,a.useSelector)(S.D),F=(0,a.useSelector)(s.oI),G=(0,a.useSelector)(I.D5),$=e||{},U=(0,a.useSelector)(C.wf),B=(0,a.useSelector)(P.pB),H=(0,a.useSelector)(k.qS),j=(0,O.vT)($,t,z,G,U,B,[],H),[Y,J]=(0,n.useState)(!1),K=(0,n.useCallback)(()=>{W((0,g.Fx)({mac:r,name:h},e.port_idx)),J(!1)},[r,h,e.port_idx,W]),X=Boolean(e.poe_enable&&!(0,x.ioy)({type:t.type}));return n.createElement(u.A,{condition:X,wrapper:t=>n.createElement(E.A,{title:"DEVICE_PORT_POWER_CYCLE_CONFIRMATION_TITLE",titleValues:{portId:e.port_idx},buttonMessage:"COMMON_ACTION_PROCEED",handleClose:J,handleConfirm:K,isOpen:Y,rootClose:!0,body:n.createElement(o.A,{size:"inherit"},n.createElement(A.sA,{id:"DEVICE_PORT_POWER_CYCLE_CONFIRMATION_BODY",values:{portId:e.port_idx}}))},t)},n.createElement(l.A,{description:n.createElement(R.A,{portData:$,showPowerCycleHeader:X,portName:$.name,device:t}),delay:0,closeDelay:0,isDisabled:Y,key:D,placement:V,className:b.K5},n.createElement(b.Dn,{onClick:n=>X?(J(!0),null):L||e.masked?null:(n.preventDefault(),n.stopPropagation(),(0,x.Cyy)(t)||(0,x.oWO)(t)?W((0,_.XP)({type:m.H.DEVICE,id:r,tab:F,subPanel:d.uY.PORTS,subId:$?.ifname})):W((0,_.XP)("wan"===$?.network_name||"wan2"===$?.network_name?{type:m.H.DEVICE,id:r,tab:F,subPanel:d.uY.PORTS,subId:d.uj.WAN}:$?.dns?{type:m.H.DEVICE,id:r,tab:F,subPanel:d.uY.PORTS,subId:d.uj.ALL}:{type:m.H.DEVICE,id:r,tab:F,subPanel:d.uY.PORTS,subId:$.op_mode===f.RC.AGGREGATE?$.portIdx||$.port_idx||$.ifname:(0,T.Cu)($)}))),...i.A.addDataTestId(i.A.TestId.SIDE_PANEL_TRIGGER)},n.createElement(b.MM,{centerIcon:y,colorInfo:(0,c.PI)(j),portSize:M,portSizeOverride:w,hasTransparentBorder:(0,N._R)(e.port_idx,v)},n.createElement(p.A,{icon:j.icon,smallerIcons:!0})),(0,N.jw)(e.port_idx,v)?n.createElement(b.lh,null):null)))},v=({cellData:e,activeItem:t,keyValue:r,portSize:a,portSizeOverride:o,...l})=>e?n.createElement(h,{cellData:e,activeItem:t,keyValue:r,portSize:a,portSizeOverride:o,...l}):(0,x.ez9)(t)||(0,x.gE3)(t)?null:n.createElement(b.hK,{key:r,portSize:a,portSizeOverride:o})},842235(e,t,r){r.d(t,{A:()=>T});var n=r(469733),a=r(296540),o=r(822336),l=r(777916),i=r(217439),s=r(705145),m=r(71479),d=r(6510),c=r(566723),p=r(294303),E=r(916537),u=r(854726),_=r(962669),A=r(431247),O=r(552020),I=r(532419);const f=(0,m.A)("div")`
  display: flex;
  justify-content: space-between;
  gap: ${c.YC};

  & > :last-child {
    max-width: 60%;
    text-align: right;
  }
`,C=(0,m.A)(p.A)`
  margin-bottom: ${c.kc};
  padding-bottom: ${c.kc};
  border-bottom: ${({theme:{themeName:e}})=>o.Ay[`desktop-border-divider-${e}`]};
`,S=(0,m.A)(s.A)`
  white-space: nowrap;
`,P=e=>a.createElement(S,{size:"small",...e}),T=({portData:e,portName:t,showPowerCycleHeader:r=!1,device:o})=>{const{ifname:s,port_idx:m,tx_bytes:S,rx_bytes:T,sfp_txfault:N,sfp_rxfault:x,sfp_vendor:g,sfp_serial:k,sfp_part:R,sfp_rev:b,sfp_compliance:h,sfp_voltage:v,sfp_current:D,sfp_txpower:M,sfp_rxpower:w,sfp_temperature:L}=e||{},{formatMessage:y}=(0,E.tz)(),V=(0,n.useSelector)(u.wD),W=(0,A.Hn)(e,V),z=(0,n.useSelector)(I.ID),F=(0,_.Uz)(e.port_idx,o.mac,o.downlink_table,z),G=(0,_.RK)(e,o,z),$=e&&(0,A.wp)(e)&&e.sfp_found,U=(0,_.xx)(e,y),B=(0,_.m3)(e,y),H=(0,O.Ki)(e),j=[];return $&&(N&&j.push(y({id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_TX_FAULT"})),x&&j.push(y({id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_RX_FAULT"}))),a.createElement(p.A,{flexDirection:"column",minWidth:100},r?a.createElement(C,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"DEVICE_ACTIONS_PORT_CLICK_TO_POWER_CYCLE"}))):null,a.createElement(p.A,{gap:c.YC,flexDirection:"column"},e.masked||!m&&!s?null:a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_PORT"})),a.createElement(P,{motif:"dark"},(0,_.LS)(e,o.model))),t?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_NAME"})),a.createElement(P,{motif:"dark",isTruncated:!0},t)):null,U?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_SPEED"})),a.createElement(P,{motif:"dark",isTruncated:!0},U)):null,B||j.length>0?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_STATUS"})),a.createElement(P,{motif:"dark",isTruncated:!0},B,j.length>0?a.createElement(i.A,{color:"destructive"},j.join(", ")):null)):null,S&&S>0?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_TX"})),a.createElement(P,{motif:"dark"},a.createElement(l.A,{type:"bytes",input:S,motif:"dark"}))):null,T&&T>0?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_RX"})),a.createElement(P,{motif:"dark"},a.createElement(l.A,{type:"bytes",input:T,motif:"dark"}))):null,H?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_DEVICE_POE_MODE_POE"})),a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:H,values:{power:e.poe_power}}))):null,W?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_PROFILE"})),a.createElement(P,{motif:"dark",isTruncated:!0},W)):null,F?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_DOWNLINK"})),a.createElement(P,{motif:"dark",isTruncated:!0},(0,d.Q)(F))):null,G?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_UPLINK"})),a.createElement(P,{motif:"dark",isTruncated:!0},(0,d.Q)(G))):null,$?a.createElement(a.Fragment,null,g?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_VENDOR"})),a.createElement(P,{motif:"dark"},String(g))):null,k?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_SERIAL"})),a.createElement(P,{motif:"dark"},String(k))):null,R?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_PART_NUMBER"})),a.createElement(P,{motif:"dark"},String(R))):null,b?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_REV"})),a.createElement(P,{motif:"dark"},String(b))):null,h?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_COMPLIANCE"})),a.createElement(P,{motif:"dark",isTruncated:!0},String(h))):null,v?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_VOLTAGE"})),a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_VOLTAGE",values:{voltage:Number(v||0).toFixed(2)}}))):null,D?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_CURRENT"})),a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_CURRENT",values:{current:+D}}))):null,L?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"COMMON_TEMPERATURE"})),a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_VALUE",values:{temperature:Number(L).toFixed(1)}}))):null,Number(M)?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_OUTPUT_POWER"})),a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_IO_POWER",values:{power:Number(M).toFixed(2)}}))):null,Number(w)?a.createElement(f,null,a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_INPUT_POWER"})),a.createElement(P,{motif:"dark"},a.createElement(E.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_IO_POWER",values:{power:Number(w).toFixed(2)}}))):null):null))}},85570(e,t,r){r.d(t,{Dn:()=>_,K5:()=>A,MM:()=>p,hK:()=>E,lh:()=>u});var n=r(822336),a=r(71479),o=r(132196),l=r(566723),i=r(335165),s=r(294303),m=r(966784),d=r(376272),c=r(311785);const p=(0,a.A)(s.A,(0,c.A)("colorInfo","portSize","portSizeOverride","isDisabled","centerIcon","hasTransparentBorder"))`
  height: ${({portSizeOverride:e,portSize:t})=>e||t?.size||i.J.large.size};
  width: ${({portSizeOverride:e,portSize:t})=>e||t?.size||i.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,m.oX)(e.border,t)} 1px solid;`}
  background-color: ${({colorInfo:e,theme:{themeName:t}})=>(0,m.oX)(e.background,t)};
  color: ${({colorInfo:e,theme:{themeName:t}})=>(0,m.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))`};
`,E=(0,a.A)("div",(0,c.A)("portSize","portSizeOverride"))`
  width: ${({portSizeOverride:e,portSize:t})=>e||t?.size||i.J.large.size};
  flex-shrink: 0;
`,u=(0,a.A)("div",(0,c.A)("size"))`
  position: absolute;
  width: calc(${i.J.large.size} + ${i.J.large.size} + 8px);
  height: calc(${i.J.large.size} + 4px);
  top: -2px;
  left: -2px;
  z-index: 1;
  background: ${({theme:{themeName:e}})=>n.Ay[`desktop-color-ublue-01-${e}`]};
  border-radius: ${l.YC};
  border: 1px solid ${({theme:{themeName:e}})=>n.Ay[`desktop-color-ublue-04-${e}`]};
`,_=(0,a.A)(s.A)`
  position: relative;
  cursor: pointer;
`,A=o.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"}}},280258(e,t,r){r.d(t,{H:()=>n});const n=""},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={}))},362412(e,t,r){r.d(t,{A:()=>c});var n=r(296540),a=r(469733),o=r(436331),l=r(805837),i=r(282556),s=r(71265);const m=e=>n.createElement(o.A,{renderOption:l.q,...e}),d=e=>n.createElement(m,{...e});d.Sorted=e=>{const t=(0,a.useSelector)(i.zi),r=(0,n.useMemo)(()=>(0,s.k)(t),[t]);return n.createElement(m,{...e,sortBy:r})};const c=d},71265(e,t,r){r.d(t,{R:()=>c,k:()=>p});var n=r(280258),a=r(190497),o=r(953048),l=r(175522),i=r(936621),s=r(742525);const m=[...new Set([n.H,l.Q.join(l.A),o.Zt,i.F,a.nc,s.Vr])],d={numeric:!0,sensitivity:"base"},c=(e,t)=>{const r=[];for(let n=e;n<=t;n+=1)r.push({value:n,label:String(n)});return r},p=e=>({value:t,label:r},{value:n,label:a})=>m.includes(t?.toString())||m.includes(n?.toString())?1/0:r?.toString().localeCompare(a?.toString(),e,d)??-1}}]);