"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[50032],{15532:(e,t,a)=>{a.d(t,{A:()=>o});var l=a(296540),r=a(927099),n=a(699784),i=a(360113);const o=({has_fan:e,fan_level:t})=>e&&Number.isFinite(t)?l.createElement(i.A,null,l.createElement(r.A,{color:"secondary",size:"body"},l.createElement(n.sA,{id:"DEVICE_PROPERTY_OVERVIEW_FAN_LEVEL"})),l.createElement(r.A,{color:"tertiary",size:"body"},t)):null},32753:(e,t,a)=>{a.d(t,{A:()=>c});var l=a(296540),r=a(927099),n=a(699784),i=a(780811),o=a(360113);const c=({systemStatsMem:e,compact:t=!1})=>{const a=(0,i.HBQ)(e);return a?l.createElement(o.A,{compact:t},l.createElement(r.A,{color:"secondary",size:"body"},l.createElement(n.sA,{id:"DEVICE_PROPERTY_OVERVIEW_MEMORY_USAGE"})),l.createElement(r.A,{color:"tertiary",size:"body"},a,"%")):null}},34662:(e,t,a)=>{a.d(t,{A:()=>v});var l=a(469733),r=a(296540),n=a(927099),i=a(963070),o=a(897547),c=a(71479),E=a(960407),s=a(398300),m=a(855019),d=a(294303),_=a(955161),A=a(689965),u=a(845030),p=a(699784),T=a(170163),O=a(56437),C=a(436953),R=a(325530);const I=(0,c.A)(o.A)`
  position: absolute;
  right: 8px;
  color: inherit;
`,P=(0,c.A)("div")`
  table {
    tr {
      cursor: pointer;
    }
  }
`,b=e=>r.createElement(A.A,null,e),v=({activeItem:e,onRowClick:t,isInSection:a})=>{const o=(0,l.useDispatch)(),c=(0,l.useSelector)(E.oI),A=e.rps?.rps_port_table?.map(({port_idx:t})=>({id:t,...(0,T.Z4)(e,t)})),v=(0,r.useCallback)(({id:a})=>{A.some(({port_state:e})=>e)&&(t?t(String(a)):o((0,u.XP)({type:s.H.DEVICE,id:e.mac,tab:c,subPanel:m.uY.RPS_OUTLETS,subId:String(a)})))},[e.mac,c,o,A,t]),S=(0,r.useMemo)(()=>{return t=e.mac,[{id:"name",label:r.createElement(p.sA,{id:"COMMON_NAME"}),renderCell:({name:e})=>r.createElement(n.A,{color:"inherit",size:"body",truncate:!0},e)},{id:"outletStatus",label:r.createElement(p.sA,{id:"COMMON_STATUS"}),width:45,renderCell:e=>{let a;return e.port_mode===O.c.DISABLED&&(a="COMMON_DISABLED"),e.port_state&&(a=(0,R.x)(e.port_state)),r.createElement(r.Fragment,null,r.createElement(d.A,{alignItems:"center"},r.createElement(C.A,{activeItemMac:t,cellData:e,isTableItem:!0}),r.createElement(n.A,{color:"inherit",size:"body"},r.createElement(p.sA,{id:a||"COMMON_INITIALIZING"}),a?null:r.createElement(n.A,{color:"inherit",size:"body"},"..."))),r.createElement(I,{size:"small"}))}}];var t},[e.mac]);return A?.length?r.createElement(_.A,{condition:!a,wrapper:b},r.createElement(P,null,r.createElement(i.A,{columns:S,items:A,disableColumnFilters:!0,hideCellOverflow:!1,onRowClick:v,truncateHeaderCells:!0}))):null}},71749:(e,t,a)=>{a.r(t),a.d(t,{default:()=>W});var l=a(868238),r=a(469733),n=a(296540),i=a(951272),o=a(271856),c=a(217439),E=a(392659),s=a(162420),m=a(350312),d=a(71479),_=a(132196),A=a(742920),u=a(870443),p=a(960407),T=a(860631),O=a(398300),C=a(566723),R=a(551753),I=a(143811),P=a(294303),b=a(955161),v=a(734707),S=a(689965),M=a(845030),N=a(699784),y=a(170163),g=a(780811),h=a(532419),D=a(171073),L=a(373229);const w=(0,d.A)(P.A)`
  margin-bottom: ${C.Ln};
`,f=(0,d.A)(c.A)`
  margin-bottom: ${C.YC};
`,x=_.AH`
  padding: 0 !important;
  gap: ${C.kc};
`,V=e=>n.createElement(o.A,{description:n.createElement(N.sA,{id:"COMMON_REQUIRES_GATEWAY"}),width:200},e),G=(0,i.bk)({enableReinitialize:!0,mapPropsToValues:({outletInfo:{name:e,cycle_enabled:t,relay_state:a}})=>({name:e||"",cycle_enabled:t,relay_state:a}),validationSchema:u.A.object().shape({name:u.A.string().label("COMMON_NAME").max(128),cycle_enabled:u.A.boolean(),relay_state:u.A.boolean()}),handleSubmit:(e,{props:{outletInfo:t,updateDeviceWithIdEndpoint:a,activeItem:l,activeItem:{mac:r,_id:n,outlet_overrides:i},propertyPanelActiveItemTab:o,showPropertyPanel:c}})=>{a({outlet_overrides:[...(i||[]).filter(e=>e.index!==t.index),{index:t.index,...e}].map(a=>t.index===(0,y.eq)(a,(0,g.Tl7)(l))?{...a,relay_state:e.relay_state}:a).sort((e,t)=>e.index-t.index)},n,r,{failureToast:{icon:A.C.danger,message:"DEVICE_OUTLET_FORM_SAVE_ERROR"},mergeAndOverrideKeys:["outlet_overrides"],extend:!0}).then(()=>c({type:O.H.DEVICE,id:r,tab:o}))}}),B={updateDeviceWithIdEndpoint:D.ex,showPropertyPanel:M.XP},W=(0,l.Zz)((0,r.connect)((e,{activeItem:t,isInSection:a,subId:l})=>({outletInfo:(0,y.o3)(t,void 0,a?+l:+(0,p.Oh)(e)),propertyPanelActiveItemTab:(0,p.oI)(e)}),B),G)(({dirty:e,submitForm:t,outletInfo:a,resetForm:l,activeItem:i,isInSection:d,goBack:_})=>{const A=(0,r.useDispatch)(),u=(0,r.useSelector)(p.oI),G=(0,r.useSelector)(h.m9),B=(0,n.useCallback)(()=>{l(),d?_():A((0,M.XP)({type:O.H.DEVICE,id:i.mac,tab:u}))},[l,A,i.mac,u,d,_]),W=(0,y.eq)(a,(0,g.Tl7)(i));return n.createElement(S.A,{padding:d?"0":void 0,marginBottom:d?"0":void 0},n.createElement(P.A,{alignItems:"center",marginBottom:C.Ln,gap:C.kc},n.createElement(m.A,{onClick:B,style:{cursor:"pointer"}}),n.createElement(c.A,{weight:"bold",color:"text-1"},a.name)),n.createElement(P.A,{marginBottom:C.Ln},n.createElement(I.A,{full:!0,name:"name",variant:"secondary",label:"COMMON_NAME"})),n.createElement(P.A,{marginBottom:C.Ln,alignItems:"center"},n.createElement(I.A,{type:"realCheckbox",name:"relay_state"},n.createElement(N.sA,{id:"COMMON_OUTLET_POWER"})),n.createElement(o.A,{style:{marginLeft:C.YC},width:208,description:[n.createElement(N.sA,{id:"DEVICE_PROPERTIES_OUTLET_RELAY_STATE_LABEL_DESCRIPTION"}),W?n.createElement(n.Fragment,null," ",n.createElement(N.sA,{id:"DEVICE_PROPERTIES_OUTLET_TOOLTIP_LABEL_TWIN_RELAY_STATE",values:{index:W}})):""]},n.createElement(s.A,{isActive:!0,size:"original"}))),(0,T.TT)(a,"POWER_METER")?n.createElement(w,null,n.createElement(P.A,{flexDirection:"column",justifyContent:"space-between",width:"100%"},a.outlet_power?n.createElement(P.A,{justifyContent:"space-between"},n.createElement(f,null,n.createElement(N.sA,{id:"COMMON_POWER"})),n.createElement(c.A,null,n.createElement(N.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:Number(a.outlet_power).toFixed(2)}}))):null,a.outlet_current?n.createElement(P.A,{justifyContent:"space-between"},n.createElement(f,null,n.createElement(N.sA,{id:"COMMON_CURRENT"})),n.createElement(c.A,null,n.createElement(N.sA,{id:"COMMON_UNIT_AMPERES_SHORT",values:{value:Number(a.outlet_current||0).toFixed(2)}}))):null,a.outlet_voltage?n.createElement(P.A,{justifyContent:"space-between"},n.createElement(f,null,n.createElement(N.sA,{id:"COMMON_VOLTAGE"})),n.createElement(c.A,null,n.createElement(N.sA,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:Number(a.outlet_voltage).toFixed(2)}}))):null,a.outlet_power_factor?n.createElement(P.A,{justifyContent:"space-between"},n.createElement(f,null,n.createElement(N.sA,{id:"DEVICE_PROPERTY_OVERVIEW_POWER_FACTOR"})),n.createElement(c.A,null,Number(a.outlet_power_factor).toFixed(2))):null)):null,n.createElement(b.A,{condition:!G,wrapper:V},n.createElement(P.A,{marginBottom:C.Ln,alignItems:"center"},n.createElement(I.A,{type:"realCheckbox",name:"cycle_enabled",disabled:!G},n.createElement(N.sA,{id:"COMMON_MODEM_POWER_CYCLE"})),n.createElement(o.A,{style:{marginLeft:C.YC},width:208,description:n.createElement(N.sA,{id:"DEVICE_PROPERTIES_OUTLET_CTL_POWER_CYCLE_DESCRIPTION"}),disableHover:!G},n.createElement(s.A,{isActive:!0,size:"original",transparent:!G})))),n.createElement(R.A,{variant:"info",nested:!0,padding:C.kc,margin:"0"},n.createElement(c.A,{weight:"bold"},n.createElement(N.sA,{id:"DEVICE_PROPERTIES_OUTLET_MANUAL_POWER_CYCLE"}),". "),n.createElement(N.sA,{id:"DEVICE_PROPERTIES_OUTLET_MANUAL_POWER_CYCLE_DESCRIPTION"})),n.createElement(P.A,{marginTop:C.Ln,justifyContent:"space-between",alignItems:"center"},n.createElement(v.Ay,{type:"button",variant:"link",onClick:()=>A((0,D.t)(i,a)),Icon:n.createElement(E.A,null)},n.createElement(N.sA,{id:"DEVICE_ACTIONS_POWER_CYCLE"})),n.createElement(L.A,{isDirty:e,onFormSubmit:t,onFormCancel:B,allowCancel:!0,className:x})))})},175734:(e,t,a)=>{a.d(t,{A:()=>p});var l=a(296540),r=a(162420),n=a(71479),i=a(566723),o=a(294303),c=a(699784),E=a(170163),s=a(780811),m=a(436953);const d=(0,n.A)(o.A)`
  font-size: ${({theme:{fontSizes:e}})=>e[0]}px;
`,_=(0,n.A)(o.A)`
  &:not(:first-child) {
    margin-top: ${i.YC};
  }
`,A=(0,n.A)(r.A)`
  margin-right: ${i.xO};
`,u=(0,n.A)("div")`
  width: 5px;
`,p=({activeItem:e,activeItem:{model:t,mac:a},multiIcon:r,disableOnPortClick:n})=>{const{rps:{diagram:i,primaryPortGroupCount:o}}=(0,s.joB)(t),p=i.length?(0,E.FP)(i,e.model):(0,E.ST)(o,e.model);return p&&0!==p.length?l.createElement(l.Fragment,null,p.map((t,i)=>l.createElement(_,{justifyContent:"center",width:"100%",key:`RpsOutletLayoutRow-${i+1}`},t.map((t,o)=>t?l.createElement(m.A,{activeItemMac:a,cellData:(0,E.Z4)(e,t.outletNumber),key:`RpsOutlet-${i+1}-${o+1}`,multiIcon:r,disableOnPortClick:n}):l.createElement(u,{key:`RpsOutletSpacer-${i+1}-${o+1}`}))))):l.createElement(d,null,l.createElement(A,{isActive:!0}),l.createElement(c.sA,{id:"DEVICE_DIAGRAM_MISSING"}))}},205830:(e,t,a)=>{a.d(t,{A:()=>m});var l=a(296540),r=a(217439),n=a(83438),i=a(566723),o=a(294303),c=a(699784),E=a(780811),s=a(360113);const m=({sys_stats:e,flexProps:t,withTooltip:a,compact:m=!1})=>{const d=(0,E.eiG)(e);return d?l.createElement(s.A,{flexProps:t,compact:m},l.createElement(r.A,{color:"text-2",size:"medium"},l.createElement(c.sA,{id:"COMMON_LOAD_AVERAGE"})),a?l.createElement(o.A,{alignItems:"center",gap:i.YC},l.createElement(r.A,{color:"text-3",size:"medium"},d),l.createElement(n.A,{description:l.createElement(c.sA,{id:"DEVICE_PROPERTY_OVERVIEW_LOAD_AVERAGE_TOOLTIP"}),placement:"top left"})):l.createElement(r.A,{color:"text-3",size:"medium"},d)):null}},211908:(e,t,a)=>{a.d(t,{A:()=>z});var l=a(469733),r=a(296540),n=a(353899),i=a(758649),o=a(742920),c=a(421130),E=a(675359),s=a(699784),m=a(801081),d=a(25553),_=a(87485),A=a(264963);const u=e=>(0,m.Mz)((e=>(0,d.uh)((0,A.lX)({queryParams:{mac:e}})))(e),e=>(0,_.i6)(e)?.devices||[]);var p,T,O=a(768195),C=a(546391);!function(e){e.EXISTING="existing",e.NEW="new"}(p||(p={})),function(e){e.MAC="mac",e.TYPE="type",e.MODEL="model"}(T||(T={}));var R,I=a(238761),P=a(271856),b=a(438628),v=a(162420),S=a(400261),M=a(874807);!function(e){e.DEVICE_REPLACEMENT_MODE="deviceReplacementMode",e.SET_DEVICE_REPLACEMENT_MODE="setDeviceReplacementMode",e.NEW_MAC="newMac",e.SET_NEW_MAC="setNewMac",e.EXISTING_MAC="existingMac",e.SET_EXISTING_MAC="setExistingMac",e.REPLACEMENT_CANDIDATES="replacementCandidates",e.ERROR="error",e.RESET_ERROR="resetError"}(R||(R={}));const N={[R.DEVICE_REPLACEMENT_MODE]:void 0,[R.SET_DEVICE_REPLACEMENT_MODE]:M.P1,[R.NEW_MAC]:void 0,[R.SET_NEW_MAC]:M.P1,[R.EXISTING_MAC]:void 0,[R.SET_EXISTING_MAC]:M.P1,[R.REPLACEMENT_CANDIDATES]:[],[R.ERROR]:void 0,[R.RESET_ERROR]:M.P1},y=(0,r.createContext)(N);const g=a(132196).AH`
  height: 54px;
`;var h=a(71479),D=a(566723),L=a(294303);const w=(0,h.A)(L.A)`
  align-items: center;
  gap: ${D.YC};
`,f=(0,r.memo)(()=>{const{newMac:e,setNewMac:t,error:a,resetError:l}=(0,r.useContext)(y),n=(0,r.useCallback)(({target:{value:e}})=>{t((0,S.Z)(e)),l()},[t,l]);return r.createElement(b.A,{className:g,value:e,onChange:n,onFocus:l,variant:"secondary",label:r.createElement(w,null,r.createElement(s.sA,{id:"COMMON_MAC_ADDRESS"}),r.createElement(P.A,{portal:!0,width:"100%",maxWidth:248,description:r.createElement(s.sA,{id:"DEVICE_REPLACEMENT_MAC_LOCATION"})},r.createElement(v.A,{isActive:!0}))),width:"100%",invalid:a})});var x=a(362412),V=a(6176);const G=(0,r.memo)(()=>{const{replacementCandidates:e,existingMac:t,setExistingMac:a,error:l,resetError:n}=(0,r.useContext)(y),i=(0,r.useMemo)(()=>e.map(({mac:e,model:t,name:a})=>({label:a,value:e,image:r.createElement(V.A,{model:t}),additionalInfo:e})),[e]),o=(0,r.useCallback)(({value:e})=>{a(String(e)),n()},[a,n]);return r.createElement(x.A.Sorted,{value:t,label:r.createElement(s.sA,{id:"COMMON_DEVICE"}),width:"100%",searchable:!0,onChange:o,onFocus:n,maxHeight:228,options:i,invalid:l})}),B=(0,h.A)(L.A)`
  flex-direction: column;
  gap: ${D.kc};
`,W=(0,r.memo)(()=>{const{replacementCandidates:e,deviceReplacementMode:t,setDeviceReplacementMode:a,resetError:l}=(0,r.useContext)(y),n=(0,r.useMemo)(()=>e.length?[{id:p.EXISTING,children:r.createElement(s.sA,{id:"COMMON_EXISTING"}),onChange:()=>{a(p.EXISTING),l()},checked:t===p.EXISTING},{id:p.NEW,children:r.createElement(s.sA,{id:"COMMON_NEW"}),onChange:()=>{a(p.NEW),l()},checked:t===p.NEW}]:[],[e.length,t,a,l]);return r.createElement(B,null,r.createElement(I.A,{direction:"row",items:n}),t===p.EXISTING?r.createElement(G,null):null,t===p.NEW?r.createElement(f,null):null)}),k=(0,h.A)(L.A)`
  align-items: center;
  gap: ${D.YC};
  width: fit-content;
`;var U=a(252093);const Y={[O.gQ.INCOMPATIBLE_REPLACEMENT]:"DEVICE_REPLACEMENT_DEVICE_INCOMPATIBLE_REPLACEMENT_ERROR",[O.gQ.REPLACEMENT_ALREADY_ASSIGNED]:"DEVICE_REPLACEMENT_DEVICE_REPLACEMENT_ALREADY_ASSIGNED_ERROR"},F=({mac:e,hideTooltip:t=!1})=>{const{formatMessage:a}=(0,s.tz)(),c=(0,l.useDispatch)(),[m,d]=(0,r.useState)(!1),[_,T]=(0,r.useState)(!1),[I,P]=(0,r.useState)(p.NEW),[b,v]=(0,r.useState)(""),[S,M]=(0,r.useState)(""),[N,g]=(0,r.useState)(void 0),h=(0,l.useSelector)((0,r.useMemo)(()=>u(e),[e])),D=(0,r.useCallback)(()=>{d(!0)},[]),L=(0,r.useCallback)(()=>{d(!1),v(""),M(""),T(!1),P(p.NEW),g(void 0)},[]),w=(0,r.useCallback)(()=>{switch(I){case p.EXISTING:return S;case p.NEW:return b;default:return}},[I,S,b]),f=(0,r.useCallback)(()=>{c((0,E.ox)({icon:o.C.success,message:"DEVICE_REPLACEMENT_DEVICE_SET",duration:3e3})),L()},[c,L]),x=(0,r.useCallback)(e=>{switch(e.apiData?.replacement_state){case O.gQ.INCOMPATIBLE_REPLACEMENT:case O.gQ.REPLACEMENT_ALREADY_ASSIGNED:g(a({id:Y[e.apiData.replacement_state]}));break;case O.gQ.CANNOT_REPLACE:default:c((0,E.ox)({icon:o.C.danger,message:"DEVICE_FAILED_TO_SET_REPLACEMENT_DEVICE",duration:3e3}))}},[c,a]),V=(0,r.useCallback)(()=>{T(!1)},[]),G=(0,r.useCallback)(()=>{T(!0),c((0,A.uC)(e,w())).then(f).catch(x).finally(V)},[c,f,x,e,w,V]),B=(0,r.useMemo)(()=>Boolean(w().match(C.b8)),[w]),F=(0,r.useMemo)(()=>[{text:r.createElement(s.sA,{id:"COMMON_ACTION_CANCEL"}),variant:"tertiary",onClick:L},{text:r.createElement(s.sA,{id:"COMMON_ACTION_APPLY"}),variant:"primary",onClick:G,disabled:!B||_,loader:_?"spinner":void 0}],[L,G,B,_]),z=(0,r.useCallback)(()=>{g(void 0)},[g]),X=(0,r.useMemo)(()=>({[R.DEVICE_REPLACEMENT_MODE]:I,[R.SET_DEVICE_REPLACEMENT_MODE]:P,[R.NEW_MAC]:b,[R.SET_NEW_MAC]:v,[R.EXISTING_MAC]:S,[R.SET_EXISTING_MAC]:M,[R.REPLACEMENT_CANDIDATES]:h,[R.ERROR]:N,[R.RESET_ERROR]:z}),[I,b,S,h,N,z]);return(0,r.useEffect)(()=>{c((0,A.lX)({queryParams:{mac:e}}))},[c,e]),r.createElement(y.Provider,{value:X},r.createElement(n.A,{allowOverflow:!0,title:r.createElement(s.sA,{id:"DEVICE_SET_REPLACEMENT_DEVICE"}),body:r.createElement(W,null),position:"top",portal:!0,actions:F,isOpen:m,onRequestClose:L},r.createElement(k,null,r.createElement(i.A,{type:"button",variant:"inline",size:"medium",onClick:D},r.createElement(s.sA,{id:"DEVICE_SET_REPLACEMENT_DEVICE"})),t?null:r.createElement(U.A,{messageId:"DEVICE_SET_REPLACEMENT_DEVICE_DESCRIPTION",variant:"outline"}))))},z=(0,r.memo)(({model:e,type:t,...a})=>(0,c.G)({type:t,model:e})?r.createElement(F,{type:t,model:e,...a}):null)},252093:(e,t,a)=>{a.d(t,{A:()=>o});var l=a(296540),r=a(271856),n=a(162420),i=a(699784);const o=({messageId:e,tooltipClassName:t,values:a,isInteractive:o,portal:c,variant:E="twoTone",size:s="medium"})=>l.createElement(r.A,{description:l.createElement(i.sA,{id:e,values:a}),width:210,isInteractive:o,portal:c,tooltipClassName:t},l.createElement(n.A,{isActive:!0,omitSvgMargin:!0,variant:E,size:s}))},264963:(e,t,a)=>{a.d(t,{X2:()=>_,lX:()=>m,uC:()=>d});var l=a(516693),r=a(691189),n=a(742920),i=a(887831);const o="/v2/api/site/{site}/device/:mac:",c=`${o}/replacement-candidates`,E=`${o}/replace?replacementDeviceMac=:replacement-mac:`,s=`${o}/replace`,m=(e={},t={})=>(0,r.Kd)("replacementCandidates",`${c.replace(":mac:",e.queryParams?.mac)}`,e.queryParams?.mac,e,{...t,idField:"mac"}),d=(e,t)=>a=>a((0,r.vB)(l.aC,null,null,i.A.POST,E.replace(":mac:",e).replace(":replacement-mac:",t),{},null,{})),_=e=>t=>t((0,r.vB)(l.aC,null,null,i.A.DELETE,s.replace(":mac:",e),{},null,{failureToast:()=>({icon:n.C.danger,message:"COMMON_UNKNOWN_ERROR"})}))},325530:(e,t,a)=>{a.d(t,{x:()=>r});var l=a(56437);const r=e=>{switch(e){case l.e.INITIALIZING:return"COMMON_INITIALIZING";case l.e.DISCONNECTED:return"COMMON_DISCONNECTED";case l.e.SEARCHING:return"COMMON_SEARCHING";case l.e.BOUND:return"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_BOUND";case l.e.STANDBY:return"COMMON_ENABLED";case l.e.POWER_DELIVERING:return"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_POWER_DELIVERING";case l.e.OUT_OF_POWER_BUDGET:return"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_OUT_OF_POWER_BUDGET";case l.e.POWER_OVERLOAD:return"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_POWER_OVERLOAD";case l.e.BLOCKED:return"COMMON_BLOCKED";default:return"COMMON_UNKNOWN"}}},400242:(e,t,a)=>{a.d(t,{A:()=>o});var l=a(296540),r=a(927099),n=a(699784),i=a(360113);const o=({ip:e,lan_ip:t,wan:a=!1,lan:o=!1,compact:c=!1})=>t||e?l.createElement(i.A,{compact:c},l.createElement(r.A,{color:"secondary",size:"body"},l.createElement(n.sA,{id:a?"DEVICE_PROPERTY_OVERVIEW_WAN_IP_ADDRESS":o?"DEVICE_PROPERTY_OVERVIEW_LAN_IP_ADDRESS":"COMMON_IP_ADDRESS"})),l.createElement(r.A,{color:"tertiary",size:"body"},t||e)):null},400261:(e,t,a)=>{a.d(t,{Z:()=>r});var l=a(546391);const r=e=>e?e.replace(l.SD,"").replace(l.fA,"$&:").substring(0,17).toLowerCase():e},421130:(e,t,a)=>{a.d(t,{G:()=>o});var l=a(780811),r=a(768195);const n=[r.bq.USW,r.bq.UAP],i=[r.W4.UDBA69F],o=({type:e,model:t})=>(n.includes(e)||i.includes(t))&&!(0,l.tNJ)({model:t})},436953:(e,t,a)=>{a.d(t,{A:()=>N});var l=a(469733),r=a(296540),n=a(271856),i=a(927099),o=a(71479),c=a(273299),E=a(6510),s=a(960407),m=a(398300),d=a(566723),_=a(855019),A=a(213601),u=a(294303),p=a(845030),T=a(699784),O=a(170163),C=a(56437),R=a(532419),I=a(167579),P=a(325530);const b=(0,o.A)(n.A,{shouldForwardProp:e=>"color"!==e&&"isTableItem"!==e})`
  width: ${({isTableItem:e})=>e?"20px":"90px"};
  height: ${({isTableItem:e})=>e?"20px":"18px"};
  align-items: center;
  background-color: ${({color:e,theme:{motifPalette:t}})=>t[e]};
  border-radius: 2px;
  color: #fff;
  justify-content: center;
  display: flex;
  position: relative;
  ${({isTableItem:e})=>e&&"margin-right: 8px;"}

  border: ${({theme:{motifPalette:e},borderColor:t})=>t?`1px solid ${e[t]}`:"none"};

  &:not(:first-child) {
    margin-left: ${d.YC};
  }
`,v=(0,o.A)("div")`
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  svg {
    max-width: 70%;
    max-height: 70%;
  }
`,S=(0,o.A)("div")`
  width: initial;
  position: relative;
  height: 100%;

  > div {
    position: initial;
    width: 18px;
  }
`,M=(0,o.A)(i.A)`
  max-width: 140px;
`,N=({activeItemMac:e,cellData:t,isTableItem:a=!1,multiIcon:n,disableOnPortClick:o})=>{const N=(0,l.useDispatch)(),y=(0,l.useSelector)(s.oI),g=(0,l.useSelector)(R.ID).find(e=>e.mac===t.peer?.mac),h=(0,E.Q)(g),D=(0,E.Lm)(g?.model)||t.peer?.model,L=(0,O.Yf)(t),w=(0,O.Yk)(t),f=(0,O.AD)(t),x=(0,O.y$)(t),V=(0,r.useCallback)(a=>{a?.preventDefault?.(),a?.stopPropagation?.(),o||N((0,p.XP)({type:m.H.DEVICE,id:e,tab:y,subPanel:_.uY.RPS_OUTLETS,subId:String(t.port_idx)}))},[N,y,e,t.port_idx,o]);return r.createElement(b,{color:f,borderColor:x,onClick:V,width:g?240:200,isTableItem:a,description:r.createElement(u.A,{flexDirection:"column",justifyContent:"space-between",width:"100%"},t?.port_state===C.e.OUT_OF_POWER_BUDGET?r.createElement(u.A,{marginBottom:d.kc},r.createElement(i.A,{size:"caption",weight:"bold"},r.createElement(T.sA,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_OUT_OF_POWER_BUDGET_DESCRIPTION",values:{peer:h||r.createElement(T.sA,{id:"COMMON_DEVICE"})}}))):null,r.createElement(u.A,{justifyContent:"space-between"},r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"COMMON_PORT"})),r.createElement(i.A,{size:"caption",color:"secondary"},t.port_idx)),r.createElement(u.A,{justifyContent:"space-between",alignItems:"center",gap:d.YC},r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"COMMON_NAME"})),r.createElement(i.A,{size:"caption",color:"secondary",truncate:!0},t?.name)),t?.port_mode?r.createElement(u.A,{justifyContent:"space-between"},r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"COMMON_MODE"})),r.createElement(i.A,{size:"caption",color:"secondary"},(0,c.Z)(t.port_mode))):null,t?.port_state?r.createElement(u.A,{justifyContent:"space-between"},r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"COMMON_STATE"})),r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:(0,P.x)(t.port_state)}))):null,t?.up?I.A.map(e=>r.createElement("div",{key:e},r.createElement(u.A,{justifyContent:"space-between"},r.createElement(i.A,{size:"caption",color:"secondary",weight:"bold"},r.createElement(T.sA,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:e}}))),r.createElement(u.A,{justifyContent:"space-between"},r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"COMMON_CURRENT"})),r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"COMMON_UNIT_AMPERES_SHORT",values:{value:t[`power_${e}v_current`]}}))),r.createElement(u.A,{justifyContent:"space-between"},r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"COMMON_VOLTAGE"})),r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:t[`power_${e}v_voltage`]}}))),r.createElement(u.A,{justifyContent:"space-between"},r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"COMMON_POWER"})),r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:t[`power_${e}v_power`]}}))))):null,t.peer||g?r.createElement(r.Fragment,null,r.createElement(u.A,{justifyContent:"space-between"},r.createElement(i.A,{size:"caption",color:"secondary",weight:"bold"},r.createElement(T.sA,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_PEER"}))),h||t.peer?.hostname?r.createElement(u.A,{justifyContent:"space-between",gap:d.YC},r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"COMMON_NAME"})),r.createElement(M,{size:"caption",color:"secondary",truncate:!0},h||t.peer?.hostname)):null,t.peer.mac?r.createElement(u.A,{justifyContent:"space-between"},r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"COMMON_MAC"})),r.createElement(i.A,{size:"caption",color:"secondary"},t.peer.mac)):null,D?r.createElement(u.A,{justifyContent:"space-between",gap:d.YC},r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"COMMON_MODEL"})),r.createElement(M,{size:"caption",color:"secondary",truncate:!0},D)):null,I.A.map(e=>r.createElement(u.A,{key:e,justifyContent:"space-between"},r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_PEER_POWER_REQUIRED",values:{voltage:e}})),r.createElement(i.A,{size:"caption",color:"secondary"},r.createElement(T.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:t.peer?.[`power_required_${e}v`]}}))))):null),portal:!0},n?r.createElement(r.Fragment,null,w.map(e=>r.createElement(S,{key:e},r.createElement(A.A,{icon:e,smallerIcons:!0})))):r.createElement(v,null,t.port_mode!==C.c.DISABLED?r.createElement(A.A,{icon:L,smallerIcons:!0}):null))}},690198:(e,t,a)=>{a.r(t),a.d(t,{default:()=>L});var l=a(868238),r=a(469733),n=a(296540),i=a(951272),o=a(271856),c=a(217439),E=a(392659),s=a(162420),m=a(350312),d=a(132196),_=a(742920),A=a(870443),u=a(960407),p=a(398300),T=a(566723),O=a(551753),C=a(143811),R=a(294303),I=a(734707),P=a(689965),b=a(845030),v=a(699784),S=a(170163),M=a(56437),N=a(171073),y=a(373229);const g=d.AH`
  padding: 0 !important;
  gap: ${T.kc};
`,h=(0,i.bk)({enableReinitialize:!0,mapPropsToValues:({outletInfo:{name:e,port_mode:t}})=>({name:e||"",portModeAuto:t===M.c.AUTO}),validationSchema:A.A.object().shape({name:A.A.string().label("COMMON_NAME").max(32),portModeAuto:A.A.boolean()}),handleSubmit:({portModeAuto:e,...t},{props:{outletInfo:a,updateDeviceWithIdEndpoint:l,activeItem:{rps_override:r,mac:n,_id:i},propertyPanelActiveItemTab:o,showPropertyPanel:c}})=>{l({rps_override:{...r,rps_port_table:[{port_idx:a.port_idx,port_mode:e?M.c.AUTO:M.c.DISABLED,...t},...(r?.rps_port_table||[]).filter(e=>e.port_idx!==a.port_idx)||[]]}},i,n,{failureToast:{icon:_.C.danger,message:"DEVICE_OUTLET_FORM_SAVE_ERROR"},mergeAndOverrideKeys:["rps_override"],extend:!0}).then(()=>c({type:p.H.DEVICE,id:n,tab:o}))}}),D={updateDeviceWithIdEndpoint:N.ex,showPropertyPanel:b.XP},L=(0,l.Zz)((0,r.connect)((e,{activeItem:t,isInSection:a,subId:l})=>({outletInfo:(0,S.Z4)(t,a?+l:+(0,u.Oh)(e)),propertyPanelActiveItemTab:(0,u.oI)(e)}),D),h)(({activeItem:e,dirty:t,submitForm:a,outletInfo:l,resetForm:i,isInSection:d,goBack:_})=>{const A=(0,r.useDispatch)(),S=(0,r.useSelector)(u.oI),M=(0,n.useCallback)(()=>{i(),d?_():A((0,b.XP)({type:p.H.DEVICE,id:e.mac,tab:S}))},[A,i,e.mac,S,_,d]);return n.createElement(P.A,{padding:d?"0":void 0,marginBottom:d?"0":void 0},n.createElement(R.A,{alignItems:"center",marginBottom:T.Ln,gap:T.kc},n.createElement(m.A,{onClick:M,style:{cursor:"pointer"}}),n.createElement(c.A,{weight:"bold",color:"text-1"},l.name)),n.createElement(R.A,{marginBottom:T.Ln},n.createElement(C.A,{full:!0,name:"name",variant:"secondary",label:"COMMON_NAME"})),n.createElement(R.A,{marginBottom:T.Ln,alignItems:"center"},n.createElement(C.A,{type:"realCheckbox",name:"portModeAuto"},n.createElement(v.sA,{id:"COMMON_OUTLET_POWER"})),n.createElement(o.A,{style:{marginLeft:T.YC},width:208,description:n.createElement(v.sA,{id:"DEVICE_PROPERTIES_OUTLET_RELAY_STATE_LABEL_DESCRIPTION"})},n.createElement(s.A,{isActive:!0,size:"original"}))),n.createElement(O.A,{variant:"info",nested:!0,padding:T.kc,margin:"0"},n.createElement(c.A,{weight:"bold"},n.createElement(v.sA,{id:"DEVICE_PROPERTIES_RPS_PORT_RECOVERY"}),". "),n.createElement(v.sA,{id:"DEVICE_PROPERTIES_RPS_PORT_RECOVERY_DESCRIPTION"})),n.createElement(R.A,{marginTop:T.Ln,justifyContent:"space-between",alignItems:"center"},n.createElement(I.Ay,{variant:"link",disabled:!l.port_error_disabled,onClick:()=>A((0,N.C4)(e,l)),Icon:n.createElement(E.A,null)},n.createElement(v.sA,{id:"DEVICE_ACTIONS_PORT_RECOVERY"})),n.createElement(y.A,{isDirty:t,onFormSubmit:a,onFormCancel:M,allowCancel:!0,className:g})))})},794751:(e,t,a)=>{a.r(t),a.d(t,{default:()=>ut});var l=a(296540),r=a(566723),n=a(294303),i=a(837612),o=a(175734),c=a(799552),E=a(377588),s=a(406816),m=a(812454),d=a(86571),_=a(699784),A=a(956347),u=a(469733),p=a(927099),T=a(963070),O=a(758649),C=a(176484),R=a(141979),I=a(948177),P=a(71479),b=a(998837),v=a(960407),S=a(860631),M=a(398300),N=a(855019),y=a(845030),g=a(854726),h=a(366188),D=a(780811),L=a(532419),w=a(319826),f=a(897547);const x=(0,P.A)(f.A)`
  margin-right: ${r.kc};
  color: inherit;
`,V=e=>[{id:"portName",label:l.createElement(_.sA,{id:"DEVICE_PROPERTIES_LABEL_ETHERNET_PORT"}),renderCell:({portName:e})=>l.createElement(p.A,{size:"body",color:"inherit",truncate:!0},e)},{id:"portStatus",width:45,label:l.createElement(_.sA,{id:"COMMON_STATUS"}),renderCell:({portStatus:t,isInternalPort:a})=>l.createElement(n.A,{justifyContent:"space-between",width:"100%",alignItems:"center"},l.createElement(p.A,{color:"inherit",size:"body",truncate:!0},t),!e&&!a&&l.createElement(x,{size:"small"}))}];var G=a(271856),B=a(773412),W=a(396660),k=a(903216),U=a(137298),Y=a(438369),F=a(670),z=a(962669),X=a(431247),$=a(552020),H=a(987552);const j=({id:e})=>l.createElement(p.A,{size:"body",color:"inherit",weight:"bold"},l.createElement(_.sA,{id:e})),K=({value:e,color:t})=>l.createElement(p.A,{size:"body",color:"inherit",style:{color:t},truncate:!0},e),Z=({formatMessage:e,portConfig:t,txColor:a,rxColor:i})=>[{id:H.yG.PORT_SYMBOL,minWidth:85,label:l.createElement(j,{id:H.sF[H.yG.PORT_SYMBOL]}),renderCell:({portSymbol:e})=>l.createElement(K,{value:e}),sortable:!0,compare:(0,W.l0)(e=>e?.port_idx)},{id:H.yG.PORT_NAME,minWidth:140,label:l.createElement(j,{id:H.sF[H.yG.PORT_NAME]}),renderCell:({portName:e})=>l.createElement(K,{value:e}),sortable:!0,compare:(0,W.l0)(e=>e?.name)},{id:H.yG.PORT_UPLINK_ITEM_NAME,minWidth:180,label:l.createElement(j,{id:H.sF[H.yG.PORT_UPLINK_ITEM_NAME]}),renderCell:({portUplinkItemName:e})=>l.createElement(K,{value:e})},{id:H.yG.PORT_POE_MODE,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_POE_MODE]}),renderCell:e=>{const t=(0,$.Ki)(e);return t?l.createElement(_.sA,{id:t,values:{power:e.poe_power}}):""}},{id:H.yG.PORT_POE_DETECTION,minWidth:130,label:l.createElement(j,{id:H.sF[H.yG.PORT_POE_DETECTION]}),renderCell:e=>l.createElement(K,{value:(0,$.bK)(e)})},{id:H.yG.PORT_POE_CLASS,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_POE_CLASS]}),renderCell:({poe_class:e,...t})=>(0,$.Gl)(t)&&l.createElement(K,{value:e}),sortable:!0,compare:(0,W.l0)(e=>e?.poe_class)},{id:H.yG.PORT_POE_POWER,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_POE_POWER]}),renderCell:({poe_power:e,...t})=>(0,$.Gl)(t)&&l.createElement(K,{value:l.createElement(_.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:e}})}),sortable:!0,compare:(0,W.l0)(e=>e?.poe_power)},{id:H.yG.PORT_POE_VOLTAGE,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_POE_VOLTAGE]}),renderCell:({poe_voltage:e,...t})=>((0,$.Gl)(t)||(0,z.sz)(t))&&l.createElement(K,{value:l.createElement(_.sA,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:e}})}),sortable:!0,compare:(0,W.l0)(e=>e?.poe_voltage)},{id:H.yG.PORT_POE_CURRENT,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_POE_CURRENT]}),renderCell:({poe_current:e,...t})=>(0,$.Gl)(t)&&l.createElement(K,{value:l.createElement(_.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_CURRENT",values:{current:e}})}),sortable:!0,compare:(0,W.l0)(e=>e?.poe_current)},{id:H.yG.PORT_OPERATION_MODE,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_OPERATION_MODE]}),renderCell:t=>l.createElement(K,{value:(0,z.WR)(t,e)})},{id:H.yG.PORT_PROFILE,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_PROFILE]}),renderCell:e=>l.createElement(K,{value:(0,X.Hn)(e,t)})},{id:H.yG.SPEED,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.SPEED]}),renderCell:({autoneg:e,speed:t,up:a})=>!!t&&(a||!e)&&l.createElement(K,{value:(0,k.ir)(t)}),sortable:!0,compare:(0,W.l0)(e=>e?.speed)},{id:H.yG.PORT_LINK_STATUS,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_LINK_STATUS]}),renderCell:t=>l.createElement(K,{value:(0,z.m3)(t,e)}),sortable:!0,compare:(0,W.l0)(e=>e?.speed)},{id:"portStp",minWidth:110,label:l.createElement(j,{id:"DEVICE_PROPERTIES_LABEL_STP"}),renderCell:e=>l.createElement(K,{value:(0,z.tx)(e)})},{id:H.yG.PORT_ACTIVITY,minWidth:160,label:l.createElement(j,{id:H.sF[H.yG.PORT_ACTIVITY]}),renderCell:e=>{const t=(0,X.m0)(e);return e.up?l.createElement(n.A,{flexDirection:"column",flex:1,paddingRight:r.xO},l.createElement(G.A,{width:112,portal:!0,description:l.createElement(n.A,{flexDirection:"column"},l.createElement(n.A,{justifyContent:"space-between"},l.createElement(n.A,{alignItems:"center",gap:r.YC},l.createElement(Y.A.Box,null),l.createElement(_.sA,{id:"COMMON_TX"})),(0,X.V4)(t),"%"),l.createElement(n.A,{justifyContent:"space-between"},l.createElement(n.A,{alignItems:"center",gap:r.YC},l.createElement(F.A.Box,null),l.createElement(_.sA,{id:"COMMON_RX"})),(0,X.V4)(t),"%"))},l.createElement(B.A,{items:[{color:a,value:(0,X.hb)((0,X.Sz)(e))}],height:4,style:{borderRadius:"2px"}}),l.createElement(B.A,{items:[{color:i,value:(0,X.hb)(t)}],height:4,style:{borderRadius:"2px"}}))):null}},{id:H.yG.PORT_TX,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_TX]}),renderCell:({tx_bytes:e})=>l.createElement(K,{value:(0,U.z3)(e,3),color:a}),sortable:!0,compare:(0,W.l0)(e=>e?.tx_bytes)},{id:H.yG.PORT_RX,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_RX]}),renderCell:({rx_bytes:e})=>l.createElement(K,{value:(0,U.z3)(e,3),color:i}),sortable:!0,compare:(0,W.l0)(e=>e?.rx_bytes)},{id:H.yG.PORT_TX_BYTES,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_TX_BYTES]}),renderCell:({tx_bytes:e})=>l.createElement(K,{value:e,color:a}),sortable:!0,compare:(0,W.l0)(e=>e?.tx_bytes)},{id:H.yG.PORT_RX_BYTES,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_RX_BYTES]}),renderCell:({rx_bytes:e})=>l.createElement(K,{value:e,color:i}),sortable:!0,compare:(0,W.l0)(e=>e?.rx_bytes)},{id:H.yG.PORT_TX_PACKETS,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_TX_PACKETS]}),renderCell:({tx_packets:e})=>l.createElement(K,{value:e,color:a}),sortable:!0,compare:(0,W.l0)(e=>e?.tx_packets)},{id:H.yG.PORT_RX_PACKETS,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_RX_PACKETS]}),renderCell:({rx_packets:e})=>l.createElement(K,{value:e,color:i}),sortable:!0,compare:(0,W.l0)(e=>e?.rx_packets)},{id:H.yG.PORT_TX_MULTICAST,minWidth:120,label:l.createElement(j,{id:H.sF[H.yG.PORT_TX_MULTICAST]}),renderCell:({tx_multicast:e})=>l.createElement(K,{value:e,color:a}),sortable:!0,compare:(0,W.l0)(e=>e?.tx_multicast)},{id:H.yG.PORT_RX_MULTICAST,minWidth:120,label:l.createElement(j,{id:H.sF[H.yG.PORT_RX_MULTICAST]}),renderCell:({rx_multicast:e})=>l.createElement(K,{value:e,color:i}),sortable:!0,compare:(0,W.l0)(e=>e?.rx_multicast)},{id:H.yG.PORT_TX_BROADCAST,minWidth:120,label:l.createElement(j,{id:H.sF[H.yG.PORT_TX_BROADCAST]}),renderCell:({tx_broadcast:e})=>l.createElement(K,{value:e,color:a}),sortable:!0,compare:(0,W.l0)(e=>e?.tx_broadcast)},{id:H.yG.PORT_RX_BROADCAST,minWidth:120,label:l.createElement(j,{id:H.sF[H.yG.PORT_RX_BROADCAST]}),renderCell:({rx_broadcast:e})=>l.createElement(K,{value:e,color:i}),sortable:!0,compare:(0,W.l0)(e=>e?.rx_broadcast)},{id:H.yG.PORT_TX_ERRORS,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_TX_ERRORS]}),renderCell:({tx_errors:e})=>l.createElement(K,{value:e,color:a}),sortable:!0,compare:(0,W.l0)(e=>e?.tx_errors)},{id:H.yG.PORT_RX_ERRORS,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_RX_ERRORS]}),renderCell:({rx_errors:e})=>l.createElement(K,{value:e,color:i}),sortable:!0,compare:(0,W.l0)(e=>e?.rx_errors)},{id:H.yG.PORT_TX_DROPPED,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_TX_DROPPED]}),renderCell:({tx_dropped:e})=>l.createElement(K,{value:e,color:a}),sortable:!0,compare:(0,W.l0)(e=>e?.tx_dropped)},{id:H.yG.PORT_RX_DROPPED,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_RX_DROPPED]}),renderCell:({rx_dropped:e})=>l.createElement(K,{value:e,color:i}),sortable:!0,compare:(0,W.l0)(e=>e?.rx_dropped)},{id:H.yG.PORT_TX_RATE,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_TX_RATE]}),renderCell:({"tx_bytes-r":e})=>l.createElement(K,{value:(0,U.zX)(e),color:a}),sortable:!0,compare:(0,W.l0)(e=>e?.["tx_bytes-r"])},{id:H.yG.PORT_RX_RATE,minWidth:110,label:l.createElement(j,{id:H.sF[H.yG.PORT_RX_RATE]}),renderCell:({"rx_bytes-r":e})=>l.createElement(K,{value:(0,U.zX)(e),color:i}),sortable:!0,compare:(0,W.l0)(e=>e?.["rx_bytes-r"])}],q=(0,P.A)("div")`
  width: 100%;
  height: 100%;
  overflow-x: auto;

  ::-webkit-scrollbar-thumb {
    min-height: 3em;
  }

  .selectedRowClassName {
    background: ${({theme:{motifPalette:{neutral01:e}}})=>e};
  }

  .headerRowHidden {
    display: none;
  }
`,Q=(0,P.A)(O.A)`
  font-size: ${({theme:{fontSizes:e}})=>e[2]}px;
  margin-top: 16px;
  justify-content: flex-end;
  svg {
    height: 14px;
    width: 13px;
  }
`,J=(0,P.A)("div")`
  margin-bottom: 32px;
`,ee=(0,P.A)(n.A)`
  position: sticky;
  left: 0;
  align-items: center;
  margin-bottom: ${({fullData:e})=>e?16:0}px;
`,te=(0,P.A)(p.A)`
  margin-left: ${({theme:{spacing:e}})=>e["spacing-s"]};
`,ae=({activeItem:e,deviceInsightsPorts:t=[],portManagementSearch:a=[],isPortManagementVariant:r=!1,columnOverride:n=[],onPortOpen:i,onPortsSelect:o})=>{const c=(0,u.useDispatch)(),E=(0,A.W6)(),{params:s,path:m}=(0,A.W5)(),{formatMessage:d}=(0,_.tz)(),p=(0,S.jP)(e),O=(0,D.moU)(e),P=(0,D.m_j)(e),f=(0,u.useSelector)(h.LV),x=(0,u.useSelector)(g.wD),G=(0,u.useSelector)(v.oI),B=(0,u.useSelector)((0,L.jf)(e)),{motifPalette:{purple06:W,aqua06:k}}=(0,b.u)(),U=(0,l.useMemo)(()=>({txColor:W,rxColor:k}),[W,k]),Y=(0,l.useMemo)(()=>r&&!!o,[r,o]),[F,z]=(0,l.useState)([]),[X,$]=(0,l.useState)([]);(0,l.useEffect)(()=>{Y&&o([...F,...X])},[Y,o,F,X]);const H=({port_idx:t,masked:a,isInternalPort:l})=>{i?i(t,!0):Y||!a&&!l&&c((0,y.XP)({type:M.H.DEVICE,id:e.mac,tab:G,subPanel:N.uY.PORTS,subId:String(t)}))},j=({port_idx:e})=>{var t;i?i(e,!0):Y||E.push((t=N.uj.WAN,(0,A.tW)(m,{site:s.site,page:s.page,id:s.id,panel:s.panel,subPanel:"ports",subPanelId:t})))},K=(0,l.useMemo)(()=>r?Z({formatMessage:d,portConfig:x,...U}):V(),[r,d,x,U]),ae=(0,l.useMemo)(()=>(0,w.nR)((0,w.$3)({activeItem:e,networkGroups:f,rest:{uplinkItems:B,portSizeOverride:"20px"}}),t).filter(e=>!a.length||a.includes(e.portIdx)),[e,f,t,a,B]),le=(0,l.useMemo)(()=>ae.filter(w.yz),[ae]),re=(0,l.useMemo)(()=>ae.filter(w.b5),[ae]),ne=(0,l.useMemo)(()=>(0,w.sD)(ae),[ae]),ie=(0,l.useMemo)(()=>(0,w.sD)(le),[le]),oe=(0,l.useMemo)(()=>(0,w.sD)(re),[re]);if((0,l.useEffect)(()=>{P?$(oe):O?(z(ie),$(oe)):z(ne)},[]),O){const e=r?Z({formatMessage:d,portConfig:x,...U}):V(p);return l.createElement(q,null,r?null:l.createElement(J,null),le.length?l.createElement(l.Fragment,null,l.createElement(ee,{fullData:r},l.createElement(I.A,{omitSvgMargin:!0}),l.createElement(te,{weight:"bold",color:"primary",size:"body"},l.createElement(_.sA,{id:"DEVICE_PORTS_TABLE_LAN_PORTS"}))),l.createElement(T.A,{hideCellOverflow:!1,columns:K,columnOverride:n,disableColumnFilters:!0,items:le,onRowClick:H,multiSelectMode:Y,rowSelectedClassName:"selectedRowClassName",onChangeSelection:z,initialSelectedIds:ie})):null,le.length&&re.length?l.createElement(J,null):null,re.length?l.createElement(l.Fragment,null,l.createElement(ee,{fullData:r},l.createElement(C.A,{omitSvgMargin:!0}),l.createElement(te,{weight:"bold",color:"primary",size:"body"},l.createElement(_.sA,{id:"DEVICE_PORTS_TABLE_WAN_PORTS"}))),l.createElement(T.A,{hideCellOverflow:!1,columns:e,columnOverride:n,headerRowClassName:le.length?"headerRowHidden":"",disableColumnFilters:!0,disableTextPointer:p,items:re,onRowClick:!p||r?j:null,multiSelectMode:Y,rowSelectedClassName:"selectedRowClassName",disableSelection:!Y&&p,onChangeSelection:$,initialSelectedIds:oe})):null,p&&!r?l.createElement(Q,{variant:"link",onClick:j,Icon:l.createElement(R.A,{isActive:!0})},l.createElement(_.sA,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES"})):null)}return l.createElement(q,null,l.createElement(T.A,{hideCellOverflow:!1,columns:K,columnOverride:n,disableColumnFilters:!0,items:ae,onRowClick:P?void 0:H,multiSelectMode:Y,rowSelectedClassName:"selectedRowClassName",onChangeSelection:P?$:z,initialSelectedIds:ne}))},le=({activeItem:e,onPortOpen:t})=>l.createElement(ae,{activeItem:e,onPortOpen:t});var re,ne=a(360694),ie=a(34662),oe=a(690198),ce=a(71749),Ee=a(943089),se=a(689965);!function(e){e.Outlet="outlet",e.Power="power",e.EthernetPort="ethernetPort"}(re||(re={}));const me=({activeItem:e})=>{const{formatMessage:t}=(0,_.tz)(),[a,n]=(0,l.useState)(null),[i,o]=(0,l.useState)(""),c=(0,l.useCallback)(()=>{n(null),o("")},[]);return l.createElement(se.A,{type:se.I.ACCORDION,items:[{id:"ports",label:l.createElement(d.A,{id:"COMMON_PORTS"}),openByDefault:!0,renderContent:()=>l.createElement(l.Fragment,null,a?null:l.createElement(l.Fragment,null,l.createElement(ie.A,{isInSection:!0,activeItem:e,onRowClick:e=>{n(re.Outlet),o(e)}}),l.createElement("div",{style:{marginTop:r.Ln}},l.createElement(le,{activeItem:e,onPortOpen:e=>{n(re.EthernetPort),o(String(e))}})),l.createElement("div",{style:{marginTop:r.Ln}},l.createElement(Ee.A,{hidePorts:!0,activeItem:e,overrideNameHeader:t({id:"COMMON_OUTLETS"}),onRowClick:e=>{n(re.Power),o(e)}}))),a?l.createElement(l.Fragment,null,a===re.Outlet?l.createElement(oe.default,{activeItem:e,goBack:c,subId:i,isInSection:!0}):null,a===re.EthernetPort?l.createElement(ne.default,{activeItem:e,goBack:c,subId:i,isInSection:!0}):null,a===re.Power?l.createElement(ce.default,{activeItem:e,goBack:c,subId:i,isInSection:!0}):null):null)}]})};var de=a(999063),_e=a(32753),Ae=a(723544),ue=a(205830),pe=a(400242),Te=a(15532),Oe=a(500045),Ce=a(146784);const Re=({ip:e,lan_ip:t,ipv6:a,mac:r,displayable_version:n,uptime:i,has_fan:o,fan_level:c,sys_stats:E,systemStatsMem:s})=>l.createElement(se.A,null,l.createElement(pe.A,{ip:e,lan_ip:t}),l.createElement(Ce.A,{ipv6_address:a}),l.createElement(Ae.A,{mac:r}),l.createElement(Oe.A,{displayable_version:n}),l.createElement(de.A,{uptime:i}),l.createElement(_e.A,{systemStatsMem:s}),l.createElement(Te.A,{has_fan:o,fan_level:c}),l.createElement(ue.A,{sys_stats:E}));var Ie=a(962926),Pe=a(194912),be=a(217439),ve=a(423646),Se=a(709690),Me=a(400374),Ne=a(27075),ye=a(574137),ge=a(885414),he=a(90757),De=a(524803),Le=a(551753),we=a(955161);const fe=(0,P.A)(Ie.A)`
  margin-bottom: ${r.Ln};

  div[class^='triggerContent'] {
    padding-right: 0;
  }
`,xe=(0,P.A)(Pe.A)`
  width: 16px;
  height: 16px;
`,Ve=(0,P.A)(Ne.A)`
  margin-right: 2px;
`,Ge=({battpool:e,noBattery:t})=>{const a=(0,he.Ay)(e.timeToRemain,[he.Au.DAYS,he.Au.HOURS,he.Au.MINUTES]).join("");return t?l.createElement(_.sA,{id:"COMMON_DISCONNECTED"}):e.ischarging&&100===e.batteryLevel?l.createElement(l.Fragment,null,l.createElement(Ve,{variant:"fill",color:ye.PA.success}),l.createElement(_.sA,{id:"COMMON_READY"})):e.ischarging?l.createElement(_.sA,{id:"RPS_BATTERY_DURATION_UNTIL_FULLY_CHARGED",values:{duration:a}}):l.createElement(l.Fragment,null,l.createElement(_.sA,{id:"RPS_BATTERY_TIME_UNITE_EMPTY",values:{duration:a}}),": ",a)},Be=(0,P.A)("div",{shouldForwardProp:e=>"color"!==e})`
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: ${({color:e})=>e};
  margin-right: ${r.YC};
`,We=({color:e,label:t,value:a})=>{const{formatMessage:r}=(0,_.tz)();return l.createElement(n.A,{alignItems:"center"},l.createElement(Be,{color:e}),l.createElement(be.A,{color:"text-3",size:"small"},t," ",r({id:"COMMON_UNIT_WATTS_SHORT"},{value:a})))},ke=({items:e,percentage:t,percentageColor:a})=>l.createElement(n.A,{alignItems:"center",marginBottom:r.kc},l.createElement(B.A,{items:e,rounded:!0}),l.createElement(n.A,{width:52,justifyContent:"flex-end",flexShrink:0},l.createElement(G.A,{description:l.createElement(_.sA,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_CAPACITY"}),width:120},l.createElement(be.A,{color:a},t,"%")))),Ue=()=>l.createElement(l.Fragment,null,l.createElement(ke,{percentage:0,percentageColor:"text-3",items:[{value:0,variant:"primary"}]}),l.createElement(be.A,{color:"text-2"},l.createElement(_.sA,{id:"RPS_BATTERY_WARNING_NO_BATTERY"}))),Ye=({activeItem:{vbms_table:e}})=>{const{colors:t,motifPalette:{purple06:a,red06:i}}=(0,b.u)(),{battpool:o,bms_run_anomaly:c}=e||{battpool:{},bms_run_anomaly:0},E=0===o.readycnt,{barVariant:s,textColor:m}=(0,l.useMemo)(()=>o.batteryLevel>=o.batteryLevelLow?{barVariant:"success",textColor:"positive"}:o.batteryLevel>=o.batteryLevelLowest?{barVariant:"warning",textColor:"notice"}:{barVariant:"danger",textColor:"destructive"},[o.batteryLevel,o.batteryLevelLow,o.batteryLevelLowest]),d=(0,l.useMemo)(()=>{const e={color:a,value:o.device_total_power_output/o.device_total_power_budget*100},t={variant:"primary",value:o.batt_available_power/o.device_total_power_budget*100};return o.device_total_power_output>o.batt_available_power?[t,{...e,value:e.value-t.value}]:o.device_total_power_output<o.batt_available_power?[e,{...t,value:t.value-e.value}]:[t,{...e,value:e.value+1}]},[o.device_total_power_output,o.batt_available_power,o.device_total_power_budget,a]),A=(0,l.useMemo)(()=>{const e=[];return(0,ge.Qx)(c)&&e.push("RPS_BATTERY_WARNING_BMS_ANOMALY_CELL_BALANCE"),(0,ge.eM)(c)&&e.push("RPS_BATTERY_WARNING_BMS_ANOMALY_POWER_BUDGET"),((0,ge.lR)(c)||(0,ge.g$)(c))&&e.push("RPS_BATTERY_WARNING_BMS_ANOMALY_BATT_SOH_OR_BAD"),o.batteryLevel<o.batteryLevelLowest?e.push("RPS_BATTERY_WARNING_ALMOST_NO_BATTERY_LEVEL"):o.batteryLevel<o.batteryLevelLow&&e.push("RPS_BATTERY_WARNING_LOW_BATTERY_LEVEL"),e},[c,o.batteryLevel,o.batteryLevelLow,o.batteryLevelLowest]);return e?l.createElement(fe,{header:l.createElement(n.A,{justifyContent:"space-between"},l.createElement(n.A,{alignItems:"center",gap:r.YC},l.createElement(_.sA,{id:"DEVICE_BATTERY_TYPE_EXTERNAL"}),o.ischarging&&o.batteryLevel<100?l.createElement(xe,{variant:"success"},l.createElement(ve.A,{color:"white"})):null,E?l.createElement(Me.A,{variant:"fill",color:i,size:"original"}):null),l.createElement(be.A,{color:"text-3"},l.createElement(Ge,{battpool:o,noBattery:E}))),sections:[E?l.createElement(Ue,null):l.createElement(l.Fragment,null,l.createElement(ke,{items:[{variant:s,value:o.batteryLevel}],percentage:o.batteryLevel,percentageColor:m}),l.createElement(n.A,{alignItems:"center"},l.createElement(B.A,{items:d,rounded:!0}),l.createElement(n.A,{width:52,justifyContent:"flex-end",flexShrink:0},l.createElement(_.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:o.device_total_power_budget}}))),l.createElement(n.A,{gap:r.kc},l.createElement(we.A,{condition:!!o.device_system_power_csum,wrapper:(0,De.rR)("RPS_BATTERY_BACK_UP_POWER_TOOLTIP",void 0,{portal:!0},{watt:o.device_system_power_csum})},l.createElement(n.A,{gap:r.YC},l.createElement(We,{color:a,label:l.createElement(_.sA,{id:"RPS_BATTERY_BACK_UP_POWER"}),value:o.device_total_power_output}),o.device_system_power_csum?l.createElement(Se.A,{isActive:!0,size:"original"}):null)),l.createElement(We,{color:t.blue,label:l.createElement(_.sA,{id:"RPS_BATTERY_POWER"}),value:o.batt_available_power})),A.map(e=>l.createElement(Le.A,{variant:"warning",padding:"0",margin:`${r.kc} 0 0`,key:e},l.createElement(_.sA,{id:e}))))],isCollapsible:!1}):null};var Fe,ze=a(54227),Xe=a(362412),$e=a(137625),He=a(734707),je=a(126457);!function(e){e.SET_LOCATE="set-locate",e.UNSET_LOCATE="unset-locate",e.REBOOT="reboot"}(Fe||(Fe={}));var Ke=a(516693),Ze=a(691189),qe=a(887831);const Qe=(e,t,a="")=>(0,Ze.vB)(Ke.aC,null,null,qe.A.POST,"/v2/api/site/{site}/device/:mac/battery/update".replace(":mac",e),{},{macs:t,action:"upgrade",url:a},{}),Je=(e,t,a)=>(0,Ze.vB)(Ke.aC,null,null,qe.A.POST,"/v2/api/site/{site}/device/:mac/battery/action".replace(":mac",t),{},{macs:[a],action:e},{});var et,tt=a(757167);!function(e){e.INIT="init",e.CONNECT="connect",e.DISCONNECT="disconnect",e.FOUND="found",e.BIND="bind",e.READY="ready",e.UPDATE="update",e.UNKNOWN="unknown"}(et||(et={}));var at=a(171073),lt=a(360113),rt=a(822336);const nt=({isPoweredByExternalPower:e,areTooManyBatteries:t,children:a})=>{const r=(0,l.useMemo)(()=>e?"DEVICE_ACTIONS_CUSTOM_UPGRADE_EXTERNAL_BATTERY_WARNING":t?"DEVICE_ACTIONS_CUSTOM_UPGRADE_EXCESS_BATTERY_WARNING":"",[e,t]);return l.createElement(we.A,{condition:e||t,wrapper:(0,De.rR)(r,void 0,{portal:!0})},a)},it=(0,P.A)(be.A,{shouldForwardProp:e=>"disabled"!==e})`
  color: ${({theme:{themeName:e},disabled:t})=>t?rt.Ay[`desktop-color-link-primary-disabled-${e}`]:rt.Ay[`desktop-color-link-primary-enabled-${e}`]};
`,ot=({deviceMac:e,batteryMacs:t,toVersion:a,isSingleBatteryUpdate:r,isPoweredByExternalPower:n,areTooManyBatteries:i})=>{const o=(0,b.u)(),{formatMessage:c}=(0,_.tz)(),E=(0,u.useDispatch)(),[s,m]=(0,l.useState)(!1);return l.createElement(nt,{isPoweredByExternalPower:n,areTooManyBatteries:i},l.createElement(He.Ay,{className:(0,He.sC)(o),onClick:()=>{E((0,at.xv)({titleValues:{deviceName:r?t[0]:`${t.length} ${c({id:"COMMON_BATTERIES"})}`},messageValues:{deviceName:r?t[0]:`${t.length} ${c({id:"COMMON_BATTERIES"})}`,toVersion:a},onConfirm:()=>{E(Qe(e,t)),m(!0)},onCancel:()=>{E((0,je.AS)())}}))},disabled:s||n||i},l.createElement(it,{disabled:n||i,color:"inherit"},r?l.createElement(_.sA,{id:"COMMON_ACTION_UPDATE"}):l.createElement(_.sA,{id:"DEVICE_ACTIONS_UPDATE_ALL_BATTERIES"}))))},ct={[et.UPDATE]:"COMMON_UPDATING",[et.READY]:"COMMON_READY"},Et=(0,P.A)("div")`
  margin-top: ${r.Ln};
`,st=(0,P.A)("div")`
  background-color: ${({theme:{motifPalette:{neutral03:e}}})=>e};
  width: 1px;
  height: 16px;
`,mt="update",dt="manualUpdate",_t=({activeItem:e})=>{const{battery_table:t=[],bms_run_anomaly:a}=e?.vbms_table||{battery_table:[],bms_run_anomaly:0},[i,o]=(0,l.useState)(t[0]||{}),[c,E]=(0,l.useState)(!1),[s,m]=(0,l.useState)(!1),[A,p]=(0,l.useState)(i.upgradable?mt:dt),T=(0,u.useDispatch)(),{formatMessage:C}=(0,_.tz)(),R=i.client_state===et.READY,I=t.filter(e=>e.upgradable)||[],P=I.map(e=>e.id),b=t.map(e=>({label:e.id,value:e.id})),v=(0,l.useMemo)(()=>(0,tt.Pi)(e?.psu_table)?.online,[e?.psu_table]),S=!!(0,ge.Zd)(a),M=()=>{i.isLocating?T(Je(Fe.UNSET_LOCATE,e.mac,i.id)):T(Je(Fe.SET_LOCATE,e.mac,i.id))},N=()=>{T(Je(Fe.REBOOT,e.mac,i.id))},y=({target:{value:e}})=>{p(e)};return(0,l.useEffect)(()=>{if(t?.length>0){const e=t.find(e=>e.id===i.id)||t[0];o(e)}},[t,i.id]),t?.length>0?l.createElement(se.A,{type:se.I.ACCORDION,items:[{id:"battery",label:l.createElement(d.A,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_COUNT",values:{count:t.length}}),openByDefault:!0,renderContent:()=>l.createElement(l.Fragment,null,l.createElement(n.A,{marginBottom:r.Ln},l.createElement(Xe.A.Sorted,{options:b,variant:"secondary",value:i.id,width:240,onChange:(e,a)=>{const l=t.find(e=>e.id===a);o(l),p(l.upgradable?mt:dt)}})),l.createElement(lt.A,null,l.createElement(be.A,null,l.createElement(_.sA,{id:"COMMON_DEVICE_VERSION"})),l.createElement(be.A,{color:"text-3"},i.fwv)),l.createElement(lt.A,null,l.createElement(be.A,null,l.createElement(_.sA,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_HEALTH"})),i.isBadBattery?l.createElement(be.A,{color:"text-3"},l.createElement(_.sA,{id:"COMMON_BAD"})):l.createElement(be.A,{color:"positive"},l.createElement(_.sA,{id:"COMMON_GOOD"}))),l.createElement(lt.A,null,l.createElement(be.A,null,l.createElement(_.sA,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_STATE"})),l.createElement(be.A,{color:"text-3"},l.createElement(_.sA,{id:ct[i.client_state]||"COMMON_NOT_READY"}))),l.createElement(n.A,{gap:r.kc,alignItems:"center"},l.createElement($e.A,{title:"COMMON_ACTION_MANAGE_BATTERY",message:"RPS_BATTERY_MANAGE_MESSAGE",messageValues:{time:C({id:"COMMON_MINUTES"},{minutes:Math.ceil(i.upgradeDuration/60)})},body:l.createElement(n.A,{marginTop:r.kc,gap:r.Ln},l.createElement(ze.A,{id:mt,value:mt,checked:A===mt,onChange:y,disabled:!i.upgradable},l.createElement(_.sA,{id:"COMMON_ACTION_UPDATE"})),l.createElement(ze.A,{id:dt,value:dt,checked:A===dt,onChange:y},l.createElement(_.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_CONFIRM_TITLE"}))),isOpen:c,handleClose:()=>E(!1),handleConfirm:()=>{T(A===mt?(0,at.xv)({titleValues:{deviceName:i.id},messageValues:{deviceName:i.id,toVersion:i.upgrade_to_firmware},onConfirm:()=>{T(Qe(e.mac,[i.id])),T((0,je.AS)())},onCancel:()=>{T((0,je.AS)())}}):(0,at.IK)({onConfirm:t=>{T(Qe(e.mac,[i.id],t)),T((0,je.AS)())},onCancel:()=>{T((0,je.AS)())}}))}},l.createElement(nt,{isPoweredByExternalPower:v,areTooManyBatteries:S},l.createElement(He.Ay,{variant:"inline",size:"medium",disabled:!R||v||S,onClick:()=>E(!0)},l.createElement(_.sA,{id:"COMMON_ACTION_MANUAL_UPDATE"})))),l.createElement(st,null),l.createElement(O.A,{variant:"inline",size:"medium",onClick:M,disabled:!R},i.isLocating?l.createElement(_.sA,{id:"DEVICE_ACTIONS_LOCATE_STOP"}):l.createElement(_.sA,{id:"DEVICE_ACTIONS_LOCATE"})),l.createElement(st,null),l.createElement($e.A,{isOpen:s,title:"DEVICE_ACTIONS_RESTART_CONFIRM_TITLE",titleValues:{deviceName:i.id},message:"DEVICE_ACTIONS_RESTART_CONFIRM_MESSAGE",messageValues:{deviceName:i.id},buttonMessage:"DEVICE_ACTIONS_RESTART",buttonVariant:"danger",handleConfirm:N,handleClose:()=>{m(!1)}},l.createElement(O.A,{variant:"inline",size:"medium",disabled:!R,onClick:()=>{m(!0)}},l.createElement(_.sA,{id:"DEVICE_ACTIONS_RESTART"})))),0!==P.length&&R?1===P.length?l.createElement(Et,null,l.createElement(ot,{deviceMac:e.mac,batteryMacs:P,toVersion:i.upgrade_to_firmware,isSingleBatteryUpdate:!0,isPoweredByExternalPower:v,areTooManyBatteries:S})):l.createElement(Et,null,v||S?null:l.createElement(Le.A,{variant:"info",padding:"0"},l.createElement(_.sA,{id:"RPS_BATTERY_UPDATE_INFO",values:{time:C({id:"COMMON_MINUTES"},{minutes:Math.ceil((I?.[0].upgradeDuration||0)/60)})}})),l.createElement(ot,{deviceMac:e.mac,batteryMacs:P,toVersion:i.upgrade_to_firmware,isPoweredByExternalPower:v,areTooManyBatteries:S})):null)}]}):null};var At=a(772317);const ut=({activeItem:e,activeItem:{ip:t,lan_ip:a,ipv6:d,mac:_,displayable_version:A,uptime:u,has_fan:p,fan_level:T,sys_stats:O,"system-stats":C,vbms_table:R,port_table:I,shortname:P}})=>{const b=(0,l.useMemo)(()=>R?.battery_table?.length>0,[R?.battery_table?.length]);return l.createElement(l.Fragment,null,l.createElement(m.A,{activeItem:e},(0,i.YP)(e)?l.createElement("div",{style:{marginTop:r.Ln}},l.createElement(n.A,{justifyContent:"center",gap:r.Er},l.createElement(n.A,{flexDirection:"column",alignItems:"center"},l.createElement(o.A,{activeItem:e,multiIcon:!0,disableOnPortClick:!0})),l.createElement(n.A,{justifyContent:"center",gap:r.YC,alignItems:"flex-end"},l.createElement(E.A,{activeItem:e,disableOnPortClick:!0,sizeOverride:"large",tooltipPlacement:"bottom right"}),I?l.createElement(c.A,{activeItem:e,portSizeOverride:"18px",disableOnPortClick:!0}):null)),l.createElement(s.Ay,{activeItem:e,noTopBorder:!0})):null),(0,i.YP)(e)?l.createElement(l.Fragment,null,b?l.createElement(Ye,{activeItem:e}):null,l.createElement(Re,{ip:t,lan_ip:a,ipv6:d,mac:_,displayable_version:A,uptime:u,has_fan:p,fan_level:T,sys_stats:O,systemStatsMem:C?.mem}),l.createElement(me,{activeItem:e}),b?l.createElement(_t,{activeItem:e}):null,l.createElement(At.A,{shortname:P})):null)}},943089:(e,t,a)=>{a.d(t,{A:()=>M});var l=a(296540),r=a(469733),n=a(271856),i=a(927099),o=a(963070),c=a(897547),E=a(71479),s=a(960407),m=a(860631),d=a(398300),_=a(855019),A=a(294303),u=a(845030),p=a(699784),T=a(319826),O=a(170163),C=a(780811),R=a(953394),I=a(405639);const P=(0,E.A)("div")`
  font-size: ${({theme:{fontSizes:e}})=>e[2]}px;
  padding-left: 10px;
`,b=(0,E.A)("div")`
  table {
    tr {
      cursor: pointer;
    }
  }
`,v=(0,E.A)(c.A)`
  position: absolute;
  right: 8px;
  color: inherit;
`,S=(0,l.memo)(({activeItem:e,activeItem:{outlet_table:t},hidePorts:a,overrideNameHeader:c,onRowClick:E})=>{const S=(0,r.useDispatch)(),M=(0,r.useSelector)(s.oI),N=(0,O.Ib)(e.model),{outletsDiagram:y,primaryOutletGroupCount:g}=(0,C.joB)(e.model),h=t?.some(e=>(0,m.TT)(e,"POWER_METER")),D=(0,l.useMemo)(()=>((e,t,a)=>[{id:"name",label:a||l.createElement(p.sA,{id:"COMMON_NAME"}),renderCell:({name:e})=>l.createElement(n.A,{noWrap:!0,description:l.createElement(i.A,{truncate:!0,color:"inherit",size:"body",style:{whiteSpace:"nowrap"}},e)},l.createElement(i.A,{color:"inherit",size:"body",truncate:!0},e))},...e?[{id:"power",label:l.createElement(p.sA,{id:"DEVICE_PROPERTIES_LABEL_POWER"}),renderCell:({outlet_power:e})=>l.createElement(i.A,{color:"inherit",size:"body"},e?Number(e).toFixed(2):l.createElement(p.sA,{id:"COMMON_FALLBACK"}))}]:[],{id:"outletStatus",label:l.createElement(p.sA,{id:"COMMON_STATUS"}),width:45,renderCell:e=>l.createElement(l.Fragment,null,l.createElement(A.A,{alignItems:"center"},e.portStatus?l.createElement(i.A,{color:"inherit",size:"body"},e.portStatus):l.createElement(l.Fragment,null,l.createElement(I.A,{activeItemMac:t,cellData:e,iconRotation:e.iconRotation,tooltipPlacement:"top right"}),l.createElement(P,null,l.createElement(p.sA,{id:e.relay_state?"COMMON_ENABLED":"COMMON_DISABLED"})))),l.createElement(v,{size:"small"}))}])(h,e.mac,c),[h,e.mac,c]),L=y.length?(0,O.FP)(y,e.model):(0,O.ST)(g,e.model),w=(0,T.$3)({activeItem:e,networkGroups:[],rest:{position:"topRight"}}),f=(0,l.useMemo)(()=>[...L.flat().filter(e=>!!e&&[R.s.STANDARD,R.s.USB].includes(e.outletType)).sort(({outletNumber:e},{outletNumber:t})=>e-t),...a?[]:w],[a,w,L]).map(t=>{const a=(0,O.o3)(e,void 0,t.outletNumber);return{...t.portStatus?t:a,id:t.portStatus?`port-${t.id}`:t.outletNumber,outletType:t.portStatus?null:(0,O.I)(N,t.outletNumber),iconRotation:t?.iconRotation}}),x=(0,l.useCallback)(({index:t,port_idx:a,outletType:l})=>{if([R.s.STANDARD,R.s.USB].includes(l)){const l=String(t||a);E?E(l):S((0,u.XP)({type:d.H.DEVICE,id:e.mac,tab:M,subPanel:t?_.uY.OUTLETS:_.uY.PORTS,subId:l}))}},[S,M,e.mac,E]);return l.createElement(b,null,l.createElement(o.A,{columns:D,disableColumnFilters:!0,items:f,hideCellOverflow:!1,onRowClick:x,truncateHeaderCells:!0}))},({activeItem:e},{activeItem:t})=>e.model===t.model&&e.outlet_table===t.outlet_table&&e.outlet_overrides===t.outlet_overrides),M=({activeItem:e,hidePorts:t,overrideNameHeader:a,onRowClick:r})=>l.createElement(S,{activeItem:e,hidePorts:t,overrideNameHeader:a,onRowClick:r})}}]);