"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[56619],{142208:(e,t,a)=>{a.d(t,{A:()=>x});var n=a(469733),l=a(296540),E=a(271856),i=a(927099),s=a(71479),o=a(998837),c=a(132196),r=a(6510),m=a(249304),d=a(280258),_=a(137625),A=a(845030),C=a(699784),u=a(267509),I=a(600446),O=a(656883),T=a(290480),N=a(814803),p=a(157766),D=a(994791),S=a(953048),R=a(293016),M=a(649413),v=a(497470),b=a(83344),g=a(323572),P=a(457311),L=a(602021),h=a(789768),V=a(837612),f=a(602197),y=a(171073),k=a(765268),w=a(190497),F=a(955161),G=a(734707);const U=(0,s.A)(G.Ay,{shouldForwardProp:e=>"disabled"!==e})`
  padding: 0;
  ${({disabled:e})=>e?"pointer-events: none; opacity: 0.4;":""};
  color: ${({theme:{motifPalette:{red05:e,red06:t}},disabled:a})=>a?e:t};
  &:hover {
    color: ${({theme:{motifPalette:{red05:e}}})=>e};
  }
  &:active {
    color: ${({theme:{motifPalette:{red05:e,red07:t}},disabled:a})=>a?e:t};
  }
`,W=c.AH`
  flex: 1;
  width: 100%;
`,B=e=>l.createElement(E.A,{portal:!0,width:180,description:l.createElement(i.A,{whiteSpacePreWrap:!0},l.createElement(C.sA,{id:"DEVICE_ACTIONS_REMOVE_TOOLTIP"})),className:W},e),x=({device:e,disabled:t,variant:a})=>{const E=(0,n.useDispatch)(),s=(0,o.u)(),[c,x]=(0,l.useState)(!1),[X,Y]=(0,l.useState)(!1),$=(0,n.useSelector)(L.EL),z=(0,n.useSelector)(D.OA),j=(0,n.useSelector)(I.W),Q=(0,n.useSelector)(N.yD),q=(0,V.S9)(e),{isDeviceDisconnected:H,isDeviceAdoptionFailed:K,deviceBusy:Z}=(0,l.useMemo)(()=>({isDeviceDisconnected:q===f.g.DISCONNECTED,isDeviceAdoptionFailed:q===f.g.ADOPTION_FAILED,deviceBusy:(0,V.C1)(q)}),[q]),J=(0,l.useMemo)(()=>t||Z||$,[t,Z,$]),ee=(0,l.useCallback)(()=>{const{id:t,type:a}=(0,M.Se)(z);if(a===R.F7.DEVICE&&t===e?.mac&&(E((0,v.U)(S.Zt)),E((0,v.Ao)([]))),Q===e?.mac){const e={...j,[u.dp.DEVICE]:d.H,[u.dp.MACS]:w.oA};E((0,O.n)(e)),E((0,h.yT)(m.l.RADIOS,{filters:e})),E((0,p.OI)(T.TE.ALL))}},[e?.mac,E,j,z,Q]);return l.createElement(F.A,{condition:Z,wrapper:B},l.createElement(_.A,{isOpen:X,title:"COMMON_ACTION_REMOVE_CONFIRM_TITLE",titleValues:{deviceName:(0,r.Q)(e)},message:H||K?"DEVICE_DISCONNECTED_ACTIONS_REMOVE_CONFIRM_MESSAGE":"DEVICE_ACTIONS_REMOVE_CONFIRM_MESSAGE",messageValues:{deviceName:(0,r.Q)(e)},buttonMessage:"COMMON_ACTION_REMOVE",buttonVariant:"danger",handleConfirm:async()=>{x(!0),E((0,g.Yl)(e.mac)).then(()=>{ee(),E((0,b.W)(e.mac)),E((0,y.XL)(e.mac)),x(!1),Y(!1),E((0,A.K5)()),E((0,P.Uc)()),E((0,k.O)())}).finally(()=>{x(!1),Y(!1)})},handleClose:()=>{x(!1),Y(!1)},className:"tertiary"===a?W:""},l.createElement(U,{disabled:J,variant:"tertiary"===a?void 0:"link",className:"tertiary"===a?(0,G.sC)(s):"",onClick:e=>{e.preventDefault(),e.stopPropagation(),Y(!0)},loader:c?"spinner":null,type:"button"},l.createElement(i.A,{color:"danger",size:"body"},l.createElement(C.sA,{id:"COMMON_ACTION_REMOVE"})))))}},175875:(e,t,a)=>{a.d(t,{A:()=>c});var n=a(469733),l=a(296540),E=a(718073),i=a(592563),s=a(602021),o=a(294303);const c=(0,l.forwardRef)(({allowReadOnly:e,disabledReason:t,...a},c)=>{const r=(0,n.useSelector)(s.EL)&&!e;return l.createElement(o.A,{alignItems:"center"},l.createElement(E.A,{description:t,placement:"left"},l.createElement(i.A,{fontSize:"medium",type:"button",...a,isDisabled:r||a.isDisabled||!!t,ref:c})))})},211908:(e,t,a)=>{a.d(t,{A:()=>Y});var n=a(469733),l=a(296540),E=a(353899),i=a(758649),s=a(742920),o=a(421130),c=a(675359),r=a(699784),m=a(801081),d=a(25553),_=a(87485),A=a(264963);const C=e=>(0,m.Mz)((e=>(0,d.uh)((0,A.lX)({queryParams:{mac:e}})))(e),e=>(0,_.i6)(e)?.devices||[]);var u,I,O=a(768195),T=a(546391);!function(e){e.EXISTING="existing",e.NEW="new"}(u||(u={})),function(e){e.MAC="mac",e.TYPE="type",e.MODEL="model"}(I||(I={}));var N,p=a(238761),D=a(271856),S=a(438628),R=a(162420),M=a(400261),v=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"}(N||(N={}));const b={[N.DEVICE_REPLACEMENT_MODE]:void 0,[N.SET_DEVICE_REPLACEMENT_MODE]:v.P1,[N.NEW_MAC]:void 0,[N.SET_NEW_MAC]:v.P1,[N.EXISTING_MAC]:void 0,[N.SET_EXISTING_MAC]:v.P1,[N.REPLACEMENT_CANDIDATES]:[],[N.ERROR]:void 0,[N.RESET_ERROR]:v.P1},g=(0,l.createContext)(b);const P=a(132196).AH`
  height: 54px;
`;var L=a(71479),h=a(566723),V=a(294303);const f=(0,L.A)(V.A)`
  align-items: center;
  gap: ${h.YC};
`,y=(0,l.memo)(()=>{const{newMac:e,setNewMac:t,error:a,resetError:n}=(0,l.useContext)(g),E=(0,l.useCallback)(({target:{value:e}})=>{t((0,M.Z)(e)),n()},[t,n]);return l.createElement(S.A,{className:P,value:e,onChange:E,onFocus:n,variant:"secondary",label:l.createElement(f,null,l.createElement(r.sA,{id:"COMMON_MAC_ADDRESS"}),l.createElement(D.A,{portal:!0,width:"100%",maxWidth:248,description:l.createElement(r.sA,{id:"DEVICE_REPLACEMENT_MAC_LOCATION"})},l.createElement(R.A,{isActive:!0}))),width:"100%",invalid:a})});var k=a(362412),w=a(6176);const F=(0,l.memo)(()=>{const{replacementCandidates:e,existingMac:t,setExistingMac:a,error:n,resetError:E}=(0,l.useContext)(g),i=(0,l.useMemo)(()=>e.map(({mac:e,model:t,name:a})=>({label:a,value:e,image:l.createElement(w.A,{model:t}),additionalInfo:e})),[e]),s=(0,l.useCallback)(({value:e})=>{a(String(e)),E()},[a,E]);return l.createElement(k.A.Sorted,{value:t,label:l.createElement(r.sA,{id:"COMMON_DEVICE"}),width:"100%",searchable:!0,onChange:s,onFocus:E,maxHeight:228,options:i,invalid:n})}),G=(0,L.A)(V.A)`
  flex-direction: column;
  gap: ${h.kc};
`,U=(0,l.memo)(()=>{const{replacementCandidates:e,deviceReplacementMode:t,setDeviceReplacementMode:a,resetError:n}=(0,l.useContext)(g),E=(0,l.useMemo)(()=>e.length?[{id:u.EXISTING,children:l.createElement(r.sA,{id:"COMMON_EXISTING"}),onChange:()=>{a(u.EXISTING),n()},checked:t===u.EXISTING},{id:u.NEW,children:l.createElement(r.sA,{id:"COMMON_NEW"}),onChange:()=>{a(u.NEW),n()},checked:t===u.NEW}]:[],[e.length,t,a,n]);return l.createElement(G,null,l.createElement(p.A,{direction:"row",items:E}),t===u.EXISTING?l.createElement(F,null):null,t===u.NEW?l.createElement(y,null):null)}),W=(0,L.A)(V.A)`
  align-items: center;
  gap: ${h.YC};
  width: fit-content;
`;var B=a(252093);const x={[O.gQ.INCOMPATIBLE_REPLACEMENT]:"DEVICE_REPLACEMENT_DEVICE_INCOMPATIBLE_REPLACEMENT_ERROR",[O.gQ.REPLACEMENT_ALREADY_ASSIGNED]:"DEVICE_REPLACEMENT_DEVICE_REPLACEMENT_ALREADY_ASSIGNED_ERROR"},X=({mac:e,hideTooltip:t=!1})=>{const{formatMessage:a}=(0,r.tz)(),o=(0,n.useDispatch)(),[m,d]=(0,l.useState)(!1),[_,I]=(0,l.useState)(!1),[p,D]=(0,l.useState)(u.NEW),[S,R]=(0,l.useState)(""),[M,v]=(0,l.useState)(""),[b,P]=(0,l.useState)(void 0),L=(0,n.useSelector)((0,l.useMemo)(()=>C(e),[e])),h=(0,l.useCallback)(()=>{d(!0)},[]),V=(0,l.useCallback)(()=>{d(!1),R(""),v(""),I(!1),D(u.NEW),P(void 0)},[]),f=(0,l.useCallback)(()=>{switch(p){case u.EXISTING:return M;case u.NEW:return S;default:return}},[p,M,S]),y=(0,l.useCallback)(()=>{o((0,c.ox)({icon:s.C.success,message:"DEVICE_REPLACEMENT_DEVICE_SET",duration:3e3})),V()},[o,V]),k=(0,l.useCallback)(e=>{switch(e.apiData?.replacement_state){case O.gQ.INCOMPATIBLE_REPLACEMENT:case O.gQ.REPLACEMENT_ALREADY_ASSIGNED:P(a({id:x[e.apiData.replacement_state]}));break;case O.gQ.CANNOT_REPLACE:default:o((0,c.ox)({icon:s.C.danger,message:"DEVICE_FAILED_TO_SET_REPLACEMENT_DEVICE",duration:3e3}))}},[o,a]),w=(0,l.useCallback)(()=>{I(!1)},[]),F=(0,l.useCallback)(()=>{I(!0),o((0,A.uC)(e,f())).then(y).catch(k).finally(w)},[o,y,k,e,f,w]),G=(0,l.useMemo)(()=>Boolean(f().match(T.b8)),[f]),X=(0,l.useMemo)(()=>[{text:l.createElement(r.sA,{id:"COMMON_ACTION_CANCEL"}),variant:"tertiary",onClick:V},{text:l.createElement(r.sA,{id:"COMMON_ACTION_APPLY"}),variant:"primary",onClick:F,disabled:!G||_,loader:_?"spinner":void 0}],[V,F,G,_]),Y=(0,l.useCallback)(()=>{P(void 0)},[P]),$=(0,l.useMemo)(()=>({[N.DEVICE_REPLACEMENT_MODE]:p,[N.SET_DEVICE_REPLACEMENT_MODE]:D,[N.NEW_MAC]:S,[N.SET_NEW_MAC]:R,[N.EXISTING_MAC]:M,[N.SET_EXISTING_MAC]:v,[N.REPLACEMENT_CANDIDATES]:L,[N.ERROR]:b,[N.RESET_ERROR]:Y}),[p,S,M,L,b,Y]);return(0,l.useEffect)(()=>{o((0,A.lX)({queryParams:{mac:e}}))},[o,e]),l.createElement(g.Provider,{value:$},l.createElement(E.A,{allowOverflow:!0,title:l.createElement(r.sA,{id:"DEVICE_SET_REPLACEMENT_DEVICE"}),body:l.createElement(U,null),position:"top",portal:!0,actions:X,isOpen:m,onRequestClose:V},l.createElement(W,null,l.createElement(i.A,{type:"button",variant:"inline",size:"medium",onClick:h},l.createElement(r.sA,{id:"DEVICE_SET_REPLACEMENT_DEVICE"})),t?null:l.createElement(B.A,{messageId:"DEVICE_SET_REPLACEMENT_DEVICE_DESCRIPTION",variant:"outline"}))))},Y=(0,l.memo)(({model:e,type:t,...a})=>(0,o.G)({type:t,model:e})?l.createElement(X,{type:t,model:e,...a}):null)},252093:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(296540),l=a(271856),E=a(162420),i=a(699784);const s=({messageId:e,tooltipClassName:t,values:a,isInteractive:s,portal:o,variant:c="twoTone",size:r="medium"})=>n.createElement(l.A,{description:n.createElement(i.sA,{id:e,values:a}),width:210,isInteractive:s,portal:o,tooltipClassName:t},n.createElement(E.A,{isActive:!0,omitSvgMargin:!0,variant:c,size:r}))},264963:(e,t,a)=>{a.d(t,{X2:()=>_,lX:()=>m,uC:()=>d});var n=a(516693),l=a(691189),E=a(742920),i=a(887831);const s="/v2/api/site/{site}/device/:mac:",o=`${s}/replacement-candidates`,c=`${s}/replace?replacementDeviceMac=:replacement-mac:`,r=`${s}/replace`,m=(e={},t={})=>(0,l.Kd)("replacementCandidates",`${o.replace(":mac:",e.queryParams?.mac)}`,e.queryParams?.mac,e,{...t,idField:"mac"}),d=(e,t)=>a=>a((0,l.vB)(n.aC,null,null,i.A.POST,c.replace(":mac:",e).replace(":replacement-mac:",t),{},null,{})),_=e=>t=>t((0,l.vB)(n.aC,null,null,i.A.DELETE,r.replace(":mac:",e),{},null,{failureToast:()=>({icon:E.C.danger,message:"COMMON_UNKNOWN_ERROR"})}))},323572:(e,t,a)=>{a.d(t,{TG:()=>m,Ve:()=>c,Yl:()=>T,x_:()=>A,zK:()=>C,us:()=>I,jk:()=>u,p5:()=>_,RZ:()=>o,rA:()=>d,gM:()=>N,NA:()=>r,_F:()=>O});var n=a(691189),l=a(736318),E=a(294201),i=a(87485);const s="/api/s/{site}/cmd/sitemgr",o=(e={},t={})=>(0,n.t9)("autoIpsec","/v2/api/vpn/auto/sites",e,{idField:"id",...t}),c=e=>(0,n.Xj)(E.A.ADD_SITE_VPN,s,e),r=e=>(0,n.Xj)(E.A.REBUILD_SITE_VPN,s,e),m=e=>(0,n.Xj)(E.A.ADD_SITE,s,{desc:e}),d=e=>(0,n.Xj)(E.A.IMPORT_SITE,l.g1,{site_desc:e.newSiteName,backup_id:e.importedSiteId}),_=()=>(0,n.Xj)(E.A.EXPORT_SITE,l.g1),A=e=>(0,n.Xj)(E.A.DELETE_SITE,s,{site:e}),C=(e,t={})=>(0,n.Xj)(E.A.DELETE_SITE_VPN,s,{site:e.remote_site_id,name:e.name},t),u=(e,t={})=>(0,n.Xj)(E.A.ENABLE_SITE_VPN,s,{site:e.site,name:e.name},t),I=(e,t={})=>(0,n.Xj)(E.A.DISABLE_SITE_VPN,s,{site:e.site,name:e.name},t),O=e=>(0,n.Xj)(E.A.UPDATE_SITE,s,{desc:e}),T=(e,t={})=>(0,n.Xj)(E.A.DELETE_DEVICE,s,{macs:[].concat(e)},{...(0,i.rk)("COMMON_COMMAND_DELETE_DEVICE_TOAST_ERROR",{count:[].concat(e).length}),...t}),N=(e,t,a={})=>(0,n.Xj)(E.A.MOVE_DEVICE,s,{mac:e,site:t},a)},398146:(e,t,a)=>{a.d(t,{A:()=>m,U:()=>r});var n=a(296540),l=a(951272),E=a(870443),i=a(242366),s=a(143811),o=a(821580),c=a(699784);const r={snmpEnabled:E.A.boolean(),snmp_location:E.A.string().when("snmpEnabled",{is:!0,then:E.A.string().test({name:"provideEitherLocationOrContact",test:(e,{parent:{snmp_contact:t},createError:a})=>!(!e&&!t)||a({message:n.createElement(c.sA,{id:"DEVICE_VALIDATION_LOCATION_OR_CONTACT_REQUIRED"})})})}),snmp_contact:E.A.string().when("snmpEnabled",{is:!0,then:E.A.string().test({name:"provideEitherLocationOrContact",test:(e,{parent:{snmp_location:t},createError:a})=>!(!e&&!t)||a({message:n.createElement(c.sA,{id:"DEVICE_VALIDATION_LOCATION_OR_CONTACT_REQUIRED"})})})})},m=(0,n.memo)(({disabled:e,valueOverride:t})=>n.createElement(i.A,null,n.createElement(o.A,null,n.createElement(s.A,{type:"realCheckbox",name:"snmpEnabled",disabled:e,checked:t},n.createElement(c.sA,{id:"COMMON_SNMP"}))),(0,l.j7)()?.values?.snmpEnabled?n.createElement(n.Fragment,null,n.createElement(s.A,{label:"DEVICE_PROPERTIES_LABEL_SNMP_LOCATION",name:"snmp_location",full:!0,variant:"secondary"}),n.createElement(s.A,{label:"DEVICE_PROPERTIES_LABEL_SNMP_CONTACT",name:"snmp_contact",full:!0,variant:"secondary"})):null))},400261:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(546391);const l=e=>e?e.replace(n.SD,"").replace(n.fA,"$&:").substring(0,17).toLowerCase():e},421130:(e,t,a)=>{a.d(t,{G:()=>s});var n=a(780811),l=a(768195);const E=[l.bq.USW,l.bq.UAP],i=[l.W4.UDBA69F],s=({type:e,model:t})=>(E.includes(e)||i.includes(t))&&!(0,n.tNJ)({model:t})},535362:(e,t,a)=>{a.d(t,{A:()=>T});var n=a(469733),l=a(296540),E=a(314714),i=a(566723),s=a(699784),o=a(575593),c=a(949909),r=a(578819),m=a(780811),d=a(837612),_=a(602197),A=a(171073),C=a(175875),u=a(147606),I=a(294303);const O=({device:e,disabled:t,confirmTitle:a,confirmMessage:O,confirmButtonMessage:T,hidePoe:N,customName:p,unit_id:D})=>{const S=(0,n.useDispatch)(),R=(0,n.useSelector)((0,o.p)(c.S.API_DEVICE_RESTART)),[M,v]=(0,l.useState)(!1),b=p||e.name||e.mac,g=(0,m.Tbi)(e)&&(0,r.b0)(e.port_table),P=(0,d.S9)(e),L=P!==_.g.CONNECTED&&P!==_.g.RFSCANNING,h=g||(0,m.moU)(e),V=!e.bypassConfirmRestart,f=h||V,y=(0,l.useCallback)(()=>{S((0,A.CP)(e,M?"hard":"soft",D))},[S,e,M,D]);return R?l.createElement(u.A,{title:l.createElement(s.sA,{id:a||"DEVICE_ACTIONS_RESTART_CONFIRM_TITLE",values:{deviceName:b}}),message:l.createElement(l.Fragment,null,l.createElement(s.sA,{id:O||"DEVICE_ACTIONS_RESTART_CONFIRM_MESSAGE",values:{deviceName:b}}),g&&!N?l.createElement(I.A,{paddingTop:i.kc},l.createElement(E.A,{checked:M,id:"hardReboot",onChange:()=>{v(e=>!e)}},l.createElement(s.sA,{id:"DEVICE_ACTIONS_RESTART_CONFIRM_CYCLE_POE_POWER"}))):null),confirmButtonLabel:l.createElement(s.sA,{id:T||"DEVICE_ACTIONS_RESTART"}),confirmButtonVariant:"destructive",onConfirm:y,trigger:f?l.createElement(C.A,{isDisabled:L||t},l.createElement(s.sA,{id:"DEVICE_ACTIONS_RESTART"})):null}):null},T=(0,l.memo)(({device:e,disabled:t,confirmTitle:a,confirmMessage:n,confirmButtonMessage:E,hidePoe:i,customName:s,unit_id:o})=>l.createElement(O,{device:e,disabled:t,confirmTitle:a,confirmMessage:n,confirmButtonMessage:E,hidePoe:i,customName:s,unit_id:o}))},575593:(e,t,a)=>{a.d(t,{p:()=>o});var n=a(801081),l=a(215454),E=a(602021),i=a(198494),s=a(949909);const o=e=>(0,n.Mz)(E.ah,l.pw,E.dK,i.fR,(t,a,n,l)=>{switch(e){case s.S.API_DEVICE_ADOPT:case s.S.API_DEVICE_RESTART:return n||t.includes(e);case s.S.API_WIDGET_OS_STATS:return l||a.includes(e);default:return n}})},598274:(e,t,a)=>{a.d(t,{A:()=>_});var n=a(469733),l=a(296540),E=a(71479),i=a(699784),s=a(780811),o=a(837612),c=a(602197),r=a(171073),m=a(734707);const d=(0,E.A)(m.Ay)`
  padding: 0;
  white-space: nowrap;
`,_=({device:e,labelId:t,disabled:a})=>{const E=(0,n.useDispatch)(),m=(0,o.S9)(e),_=(0,l.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),(0,s.YdF)({type:e.type})&&Boolean(e.peer_ubb?.mac)&&E((0,r.VO)({locating:e.peer_ubb.locating,mac:e.peer_ubb.mac,name:e.peer_ubb.name,model:e.peer_ubb.model})),E((0,r.VO)({locating:e.locating,mac:e.mac,name:e.name,model:e.model}))},[E,e.type,e.mac,e.name,e.model,e.locating,e.peer_ubb?.mac,e.peer_ubb?.name,e.peer_ubb?.model,e.peer_ubb?.locating]);return l.createElement(d,{variant:"link",onClick:_,disabled:a||m!==c.g.CONNECTED},l.createElement(i.sA,{id:e.locating?"DEVICE_ACTIONS_LOCATE_STOP":t||"DEVICE_ACTIONS_LOCATE"}))}},776288:(e,t,a)=>{a.d(t,{A:()=>n});const n={PCAP:4194304,HWOFFLOAD_QOS_AND_SMART_QUEUE:2147483648,SUPPORT_FILE:65536}},813040:(e,t,a)=>{a.d(t,{A:()=>d,R:()=>m});var n=a(296540),l=a(822336),E=a(718073),i=a(71479),s=a(566723),o=a(294303),c=a(252093);const r=(0,i.A)(o.A)`
  flex-direction: column;
  height: ${48}px;
  border-bottom: ${({theme:{themeName:e}})=>l.Ay[`desktop-border-divider-${e}`]};
  padding: ${s.xO} 0;
  position: relative;
  .tooltip-position-fixer {
    margin-right: -${s.Ln};
  }
`,m=({tooltipId:e,disabledTooltip:t,children:a,tooltipProps:l={},...i})=>n.createElement(r,{...i},n.createElement(o.A,{justifyContent:"space-between",alignItems:"center"},n.createElement(E.A,{description:t,placement:"left"},n.createElement("span",null,a)),e?n.createElement(c.A,{messageId:e,tooltipClassName:"tooltip-position-fixer",variant:"outline",...l}):null)),d=m},902923:(e,t,a)=>{a.d(t,{A:()=>D,i:()=>p});var n=a(469733),l=a(296540),E=a(314714),i=a(71479),s=a(566723),o=a(137625),c=a(294303),r=a(699784),m=a(575593),d=a(949909),_=a(578819),A=a(780811),C=a(837612),u=a(602197),I=a(171073),O=a(535362),T=a(734707);const N=(0,i.A)(T.Ay)`
  padding: 0;
`,p=({device:e,isConfirmOpen:t,setIsConfirmOpen:a,disabled:i})=>{const O=(0,n.useDispatch)(),T=(0,n.useSelector)((0,m.p)(d.S.API_DEVICE_RESTART)),[p,D]=(0,l.useState)(!1),S=e.name||e.mac,R=(0,A.Tbi)(e)&&(0,_.b0)(e.port_table),M=(0,C.S9)(e),v=M!==u.g.CONNECTED&&M!==u.g.RFSCANNING,b=(0,l.useCallback)(()=>{O((0,I.CP)(e,p?"hard":"soft"))},[O,e,p]);return T?l.createElement(o.A,{isOpen:t,title:"DEVICE_ACTIONS_RESTART_CONFIRM_TITLE",titleValues:{deviceName:S},message:"DEVICE_ACTIONS_RESTART_CONFIRM_MESSAGE",messageValues:{deviceName:S},...R?{body:l.createElement(c.A,{paddingTop:s.kc},l.createElement(E.A,{checked:p,id:"hardReboot",onChange:()=>{D(e=>!e)}},l.createElement(r.sA,{id:"DEVICE_ACTIONS_RESTART_CONFIRM_CYCLE_POE_POWER"})))}:{},buttonMessage:"DEVICE_ACTIONS_RESTART",buttonVariant:"danger",handleConfirm:b,handleClose:()=>{a(!1)}},l.createElement(N,{variant:"link",onClick:t=>{t.preventDefault(),t.stopPropagation();const n=R||(0,A.moU)(e),l=!e.bypassConfirmRestart;n||l?a(!0):O((0,I.CP)(e))},disabled:v||i},l.createElement(r.sA,{id:"DEVICE_ACTIONS_RESTART"}))):null},D=(0,l.memo)(({device:e,disabled:t})=>l.createElement(O.A,{device:e,disabled:t}))},949909:(e,t,a)=>{var n;a.d(t,{S:()=>n}),function(e){e.API_DEVICE_ADOPT="API_DEVICE_ADOPT",e.API_DEVICE_RESTART="API_DEVICE_RESTART",e.API_WIDGET_OS_STATS="API_WIDGET_OS_STATS"}(n||(n={}))},956619:(e,t,a)=>{a.d(t,{f:()=>bt,A:()=>ht});var n=a(469733),l=a(296540),E=a(271856),i=a(927099),s=a(718073),o=a(162420),c=a(71479),r=a(6510),m=a(421130),d=a(15095),_=a(860631),A=a(566723),C=a(842630),u=a(137625),I=a(143811),O=a(196010),T=a(294303),N=a(955161),p=a(902923),D=a(758649),S=a(132196),R=a(778851),M=a(742920),v=a(46119),b=a(130851),g=a(6176),P=a(845030),L=a(675359),h=a(126457),V=a(86392),f=a(699784),y=a(83344),k=a(323572),w=a(417378),F=a(198494),G=a(780811),U=a(837612),W=a(902786),B=a(602197),x=a(171073),X=a(573363),Y=a(727270),$=a(876250);const z=(0,c.A)(D.A)`
  padding: 0;
  color: ${({theme:{motifPalette:{red06:e}}})=>e};

  &:hover {
    color: ${({theme:{motifPalette:{red05:e}}})=>e};
  }

  &:active {
    color: ${({theme:{motifPalette:{red07:e}}})=>e};
  }
`,j=(0,c.A)("div")`
  margin-top: ${({theme:{space:e}})=>e[4]}px;
  line-height: 1.5;
`,Q=S.AH`
  width: auto !important;
  padding: 0 8px;
`,q=S.AH`
  button {
    border-radius: 0;
    font-size: 12px;
  }
`,H=({device:e,showOnlyIfInactive:t})=>{const{formatMessage:a}=(0,f.tz)(),{mac:E,name:i,adopted:s,model:o}=e,c=(0,n.useDispatch)(),[r,m]=(0,l.useState)(!1),d=(0,n.useSelector)(w.S$),_=(0,n.useSelector)(b.p),A=(0,n.useSelector)(X.A),C=(0,n.useSelector)(F.ay),u=(0,R.Qh)(d),I=(0,G.tNJ)(e),O=(0,W.zQ)(e),T=(0,U.S9)(e),N=I&&(!t||[B.g.UNKNOWN,B.g.FIRMWARE_MISMATCH,B.g.ADOPTION_FAILED,B.g.DISCONNECTED].includes(T)),p=(0,l.useCallback)(async()=>{try{await c((0,k.Yl)(E)),c((0,x.XL)(E)),c((0,y.W)(E)),c((0,P.K5)()),O||setTimeout(()=>{c((0,L.ox)({duration:0,onClose:()=>c((0,L.uU)("LTE_SUBSCRIPTION_NEEDS_ATTENTION")),type:M.C.warning,title:a({id:"ON_LOAD_WARNING_SUBSCRIPTION_NEEDS_ATTENTION_TITLE"}),message:"ON_LOAD_WARNING_SUBSCRIPTION_NEEDS_ATTENTION_BODY",icon:l.createElement(g.C,{className:Q,model:o,size:$.Xh.MEDIUM,imagePath:_,theme:C,deviceModelMap:A}),stateIndicator:M.C.info,primaryButton:{label:a({id:"ON_LOAD_WARNING_PAYMENT_ACTION_CANCEL_SUBSCRIPTIONS"}),onClick:()=>v.A.open(`${Y.DU}${u}/subscriptions`)},className:q},"LTE_SUBSCRIPTION_NEEDS_ATTENTION"))},10),c((0,h.AS)())}catch(e){m(!1)}},[u,c,E,O,o,_,C,A,a]),D=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),m(!0);const t={name:i&&i!==E?i:a({id:"DEVICE_TYPE_ULTE"})};O?p():c((0,V.E)({title:"DEVICE_ULTE_REMOVE_HEADER",titleValues:t,message:"DEVICE_ULTE_REMOVE_DETAILS",messageValues:t,confirmButtonProps:{text:l.createElement(f.sA,{id:"COMMON_ACTION_REMOVE"}),variant:"primary"},children:l.createElement(j,null,l.createElement(f.sA,{id:"DEVICE_ULTE_REMOVE_INFO"})),onConfirm:p,onCancel:()=>{c((0,h.AS)()),m(!1)}}))},[E,i,O,a,c,p]);return N&&s?l.createElement(z,{variant:"link",onClick:D,loader:r?"spinner":null},l.createElement(f.sA,{id:"DEVICE_ACTIONS_REMOVE_LABEL"})):null};var K=a(142208),Z=a(592563),J=a(691189),ee=a(602021),te=a(54087),ae=a(294201),ne=a(147606),le=a(74750);const Ee=({children:e,countdownFrom:t,renderCountdownLabel:a,autoStart:n,...E})=>{const[i,s]=(0,l.useState)(-1),[o,c]=(0,l.useState)(!1),r=(0,l.useRef)(null),m=E.isDisabled||o,d=(0,l.useCallback)(()=>{window.clearInterval(r.current),r.current=null},[r]),_=(0,l.useCallback)(()=>{c(!1),s(-1),d()},[d,c,s]),A=(0,l.useCallback)(()=>{_()},[_]);return(0,l.useEffect)(()=>{o&&0===i&&A()},[i,_]),(0,l.useEffect)(()=>(n&&(c(!0),s(t),r.current=window.setInterval(()=>s(e=>e-1),1e3)),d),[d]),l.createElement(le.A,{isDisabled:m,...E},o?a(i):e)},ie=(0,l.memo)(({_id:e,mac:t,vbms_table:{is_battery_mode:a}={is_battery_mode:!1},deviceState:E,disabled:i})=>{const s=(0,n.useDispatch)(),o=(0,n.useSelector)(ee.EL),c=(0,l.useRef)(null),[r,m]=(0,l.useState)(!1),d=i||o||a||(0,U.C1)(E)||r,_=(0,l.useCallback)(()=>{m(!0),s((0,J.Xj)(ae.A.OUTLET_CTL,te.CMD_PATH,{mac:t,delay_time_to_off:0})).catch(({msg:e})=>{s((0,L.ox)({icon:M.C.danger,message:e||"COMMON_NOTICE_REQUEST_ERROR"}))}).finally(()=>{m(!0),c.current=window.setTimeout(()=>m(!1),3e4)})},[e,t,s,m]);return l.createElement(T.A,{justifyContent:"space-between",alignItems:"center"},l.createElement(T.A,{gap:A.Ln},l.createElement(ne.A,{message:l.createElement(f.sA,{id:"DEVICE_REMOTE_POWER_CYCLE_TOOLTIP",values:{seconds:60}}),title:l.createElement(f.sA,{id:"DEVICE_OUTLET_POWER_CYCLE"}),trigger:l.createElement(Z.A,{type:"button",fontSize:"medium",variant:"destructive",isDisabled:d},l.createElement(f.sA,{id:"DEVICE_REMOTE_POWER_CYCLE"})),renderConfirmButton:e=>l.createElement(Ee,{autoStart:!0,countdownFrom:5,renderCountdownLabel:e=>l.createElement(f.sA,{id:"DEVICE_REMOTE_POWER_CYCLING_IN",values:{seconds:e}}),onPress:()=>{e(),_()},variant:"destructive",motif:"dark"},l.createElement(f.sA,{id:"COMMON_ACTION_PROCEED"})),onConfirm:_})))});var se=a(96512);const oe=(0,l.memo)(({_id:e,mac:t,name:a,model:E,outlet_enabled:i,disabled:s})=>{const o=(0,n.useDispatch)(),c=(0,n.useSelector)(ee.EL),[m,d]=(0,l.useState)(!1),[_,A]=(0,l.useState)(!1),C=c||_||s,I=(0,se.I)(),O=(0,l.useCallback)(()=>{A(!0),o((0,x.ex)({outlet_enabled:!i},e,t,{})).catch(e=>{I(e)}).finally(()=>{A(!1)})},[e,t,i,o,I]),T=(0,l.useCallback)(()=>{d(!1)},[d]),N=(0,l.useCallback)(()=>{d(!0)},[d]);return l.createElement(u.A,{isOpen:m,title:i?"DEVICE_ACTIONS_REMOTE_POWER_OFF_CONFIRM_TITLE":"DEVICE_ACTIONS_REMOTE_POWER_ON_CONFIRM_TITLE",message:i?"DEVICE_ACTIONS_REMOTE_POWER_OFF_AC_CONFIRM_MESSAGE":"DEVICE_ACTIONS_REMOTE_POWER_ON_CONFIRM_MESSAGE",messageValues:{deviceName:(0,r.Q)({name:a,model:E,mac:t})},buttonMessage:"COMMON_ACTION_PROCEED",buttonVariant:i?"danger":"primary",handleConfirm:O,handleClose:T},l.createElement(Z.A,{type:"button",fontSize:"medium",variant:i?"destructive":"emphasis",isDisabled:C,onClick:N},l.createElement(f.sA,{id:i?"DEVICE_ACTIONS_REMOTE_POWER_OFF":"DEVICE_ACTIONS_REMOTE_POWER_ON"})))});var ce=a(598274),re=a(734707);const me=(0,c.A)(re.Ay)`
  padding: 0;
`,de=({device:e})=>{const t=(0,n.useDispatch)();return l.createElement(me,{variant:"link",onClick:a=>{a.preventDefault(),a.stopPropagation(),t((0,x.uv)({device:e,onConfirm:()=>{t((0,x.c8)({disabled:!e.disabled},e._id,{failureToast:{icon:M.C.danger,message:"DEVICE_NOTICE_SAVE_ERROR"}}))},onCancel:()=>{t((0,h.AS)())}}))}},l.createElement(f.sA,{id:e.disabled?"COMMON_ACTION_ENABLE":"COMMON_ACTION_DISABLE"}))},_e=(0,c.A)(re.Ay)`
  padding: 0;
`,Ae=({device:e,disabled:t,device:{name:a,upgrade_to_firmware:E,mac:i}})=>{const s=(0,n.useDispatch)(),[o,c]=(0,l.useState)(!1),r=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),s((0,x.xv)({titleValues:{deviceName:a},messageValues:{deviceName:a,toVersion:E},onConfirm:()=>{c(!0),s((0,x.Pv)(i,a)).finally(()=>c(!1))},onCancel:()=>{s((0,h.AS)()),c(!1)}}))},[a,E,i,s]);return l.createElement(_e,{variant:"link",onClick:r,disabled:t||o||(0,U.S9)(e)!==B.g.CONNECTED},l.createElement(f.sA,{id:"COMMON_ACTION_UPDATE_DEVICE"}))},Ce=(0,c.A)(re.Ay)`
  padding: 0;
`,ue=({device:e})=>{const t=(0,n.useDispatch)(),[a,E]=(0,l.useState)(!1),i=(0,U.S9)(e);return l.createElement(Ce,{variant:"link",onClick:async()=>{E(!0),await t((0,x.ci)({device:e})),E(!1)},disabled:a||i!==B.g.CONNECTED},l.createElement(f.sA,{id:"DEVICE_ACTIONS_DEBUG_LABEL"}))},Ie=e=>{const[t,a]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{fetch(e,{mode:"no-cors"}).then(()=>{a(!0)}).catch(()=>a(!1))},[e]),t};var Oe=a(776309),Te=a(789768),Ne=a(765562);const pe=(0,c.A)(re.Ay)`
  padding: 0;
`,De=({device:e})=>{const{isUbbAlignmentToolModalClosed:t}=(0,n.useSelector)(F.tg),a=(0,n.useDispatch)(),E=Ie(`${Ne.A.feStaticAssets}/videos`);return l.createElement(pe,{variant:"link",onClick:n=>{n.preventDefault(),n.stopPropagation(),e.is_aligning||t||!E||a((0,h.to)({modalType:Oe.A.UBB_ALIGNMENT_TOOL,modalProps:{closeModal:()=>{a((0,Te.i4)({isUbbAlignmentToolModalClosed:!0})),a((0,h.AS)())}}})),a((0,x.MF)(e))},disabled:(0,U.S9)(e)!==B.g.CONNECTED},l.createElement(f.sA,{id:e.is_aligning?"DEVICE_ACTIONS_ALIGNMENT_DISABLE":"DEVICE_ACTIONS_ALIGNMENT_ENABLE"}))};var Se=a(627440),Re=a(302167),Me=a(215454),ve=a(575593),be=a(949909),ge=a(757167),Pe=a(578819),Le=a(927806),he=a(768195),Ve=a(532419),fe=a(959341),ye=a(776288),ke=a(510497),we=a(398146),Fe=a(211908),Ge=a(813040);const Ue=(0,c.A)(re.Ay)`
  padding: 0;
`,We=({mac:e,deviceName:t})=>{const a=(0,n.useDispatch)(),E=(0,n.useSelector)(ee.n),i=(0,n.useSelector)(Re.HG),s=(0,l.useCallback)(()=>{a((0,h.to)({modalType:Oe.A.MOVE_TO_SITE,modalProps:{mac:e,deviceName:t}}))},[a,e,t]);return i||E.length>1?l.createElement(Ge.R,{tooltipId:"DEVICE_MOVE_TO_SITE_DISABLED_TOOLTIP"},l.createElement(Ue,{variant:"link",onClick:s,disabled:E.length<2},l.createElement(f.sA,{id:"DEVICE_ACTIONS_MOVE_TO_SITE"}))):null};var Be=a(353899),xe=a(217439),Xe=a(137273),Ye=a(362412),$e=a(801081),ze=a(25553),je=a(87485);const Qe=(e={},t={})=>(0,J.Kd)("cloneCandidates",`${"/v2/api/site/{site}/device/:mac:/clone-candidates".replace(":mac:",e.queryParams?.mac)}`,e.queryParams?.mac,e,{...t,idField:"mac"}),qe=e=>(0,$e.Mz)((e=>(0,ze.uh)(Qe({queryParams:{mac:e}})))(e),e=>(0,je.i6)(e)?.devices||[]);var He,Ke=a(874807);!function(e){e.MAC="mac",e.NAME="name",e.MODEL="model",e.CLONE_CANDIDATE="cloneCandidate",e.SET_CLONE_CANDIDATE="setCloneCandidate"}(He||(He={}));const Ze={[He.MAC]:void 0,[He.MODEL]:void 0,[He.NAME]:void 0,[He.CLONE_CANDIDATE]:void 0,[He.SET_CLONE_CANDIDATE]:Ke.P1},Je=(0,l.createContext)(Ze),et=(0,c.A)(T.A)`
  flex-direction: column;
  gap: ${A.Ln};
`,tt=(0,c.A)(T.A)`
  flex-direction: column;
`,at=(0,c.A)("ul")`
  margin: 0;
  padding-inline-start: ${A.Er};
`,nt=(0,l.memo)(()=>{const e=(0,n.useDispatch)(),{formatMessage:t}=(0,f.tz)(),[a,E]=(0,l.useState)([]),{mac:i,model:s,name:o,cloneCandidate:c,setCloneCandidate:r}=(0,l.useContext)(Je),m=(0,n.useSelector)((0,l.useMemo)(()=>qe(i),[i])),d=(0,l.useMemo)(()=>m.map(({mac:e,model:t,name:a})=>({label:a,value:e,image:l.createElement(g.A,{model:t}),additionalInfo:e})),[m]),_=(0,l.useCallback)(async({value:t})=>{const a=m.find(e=>e.mac===t);e((0,x.aU)({mac:i,name:o,model:s},a,!0)).then(e=>{E(e?.data?.[0]?.failures||[]),r(a)})},[r,e,m,i,o,s]);return(0,l.useEffect)(()=>{e(Qe({queryParams:{mac:i}}))},[e,i]),l.createElement(et,null,l.createElement(xe.A,{color:"text-2",size:"medium"},l.createElement(f.sA,{id:"DEVICE_LOAD_CONFIGURATION_DESCRIPTION"})),l.createElement(Ye.A.Sorted,{value:c.mac,label:l.createElement(f.sA,{id:"COMMON_DEVICE"}),width:"100%",searchable:!0,direction:"bottom",onChange:_,optionsWidth:"contentWidth",searchEmptyMessage:t({id:"DEVICE_NO_DEVICES_FOUND"}),options:d}),a.length?l.createElement(Xe.A,{type:"info",text:l.createElement(tt,null,l.createElement(xe.A,{size:"medium",color:"text-2"},l.createElement(f.sA,{id:"DEVICE_LOAD_CONFIGURATION_MISSING_FEATURES"})),l.createElement(at,null,a.map(e=>l.createElement("li",{key:e},e))))}):null)}),lt=(0,c.A)(re.Ay)`
  padding: 0;
`,Et=(0,l.memo)(({mac:e,model:t,name:a,disabled:E=!1})=>{const i=(0,n.useDispatch)(),[s,o]=(0,l.useState)(!1),[c,r]=(0,l.useState)(!1),[m,d]=(0,l.useState)({}),_=(0,l.useCallback)(()=>{o(!0)},[]),A=(0,l.useCallback)(()=>{d({}),o(!1),r(!1)},[]),C=(0,l.useCallback)(()=>{i((0,L.ox)({icon:M.C.success,message:"DEVICE_CONFIGURATION_LOADED",duration:3e3}))},[i]),u=(0,l.useCallback)(()=>{i((0,L.ox)({icon:M.C.warning,message:"DEVICE_FAILED_TO_LOAD_CONFIGURATION",duration:3e3}))},[i]),I=(0,l.useCallback)(()=>{r(!0),i((0,x.aU)({mac:e,model:t,name:a},m)).then(C).then(A).catch(u).finally(()=>{r(!1)})},[i,C,u,e,t,a,A,m]),O=(0,l.useMemo)(()=>Boolean(m.mac),[m.mac]),T=(0,l.useMemo)(()=>[{text:l.createElement(f.sA,{id:"COMMON_ACTION_CANCEL"}),variant:"tertiary",onClick:A},{text:l.createElement(f.sA,{id:"COMMON_ACTION_APPLY"}),variant:"primary",onClick:I,disabled:!O||c,loader:c?"spinner":null}],[A,I,O,c]),N=(0,l.useMemo)(()=>({[He.MAC]:e,[He.MODEL]:t,[He.NAME]:a,[He.CLONE_CANDIDATE]:m,[He.SET_CLONE_CANDIDATE]:d}),[e,t,a,m]);return l.createElement(Je.Provider,{value:N},l.createElement(Be.A,{allowOverflow:!0,title:l.createElement(f.sA,{id:"DEVICE_LOAD_CONFIGURATION"}),body:l.createElement(nt,null),position:"top",portal:!0,actions:T,onRequestClose:A,isOpen:s},l.createElement(lt,{variant:"link",type:"button",onClick:_,disabled:c||E},l.createElement(f.sA,{id:"DEVICE_LOAD_CONFIGURATION"}))))});var it=a(999589),st=a(752263),ot=(a(874734),a(187483)),ct=a(809893);const rt=/_([0-9]+\.[0-9]+\.[0-9]+)\+/,mt=(0,l.memo)(({name:e,model:t,mac:a,version:E,disabled:i})=>{const s=(0,n.useDispatch)(),o=(0,n.useSelector)(w.S$),c=(0,R.GO)(o),m=(0,n.useSelector)(Me.Eh),d=(0,n.useSelector)(ot.ap),_=(0,n.useSelector)(ot.YL),A=(0,l.useCallback)(e=>{s((0,h.to)({modalType:Oe.A.DOWNGRADE_FEEDBACK,modalProps:e}))},[s]),C=(0,l.useCallback)(async(e,a,n)=>{const l=`${Y.DU}${ct.Fx[c]}/v1/firmware-downgrade`;try{await fetch(l,{method:"POST",headers:{"Content-Type":"application/json","X-Captcha":n},mode:"cors",body:JSON.stringify({message:e,applicationName:"Network",applicationVersion:m,deviceModel:(0,r.Lm)(t),deviceFirmwareCurrentVersion:(0,st._)(E),deviceFirmwareNewVersion:a,anonymousId:d})})}catch(e){0}},[d,c,t,m,E]),u=(0,l.useCallback)(n=>{if(s((0,x._1)({name:e,model:t,mac:a},n)),s((0,h.AS)()),_)return;const l=(e=>{const t=rt.exec(e);return t?.[1]?(0,st._)(t[1]):null})(n);!!l&&(0,it.compare)(l,(0,st._)(E))<0&&A({onSubmit:(e,t)=>C(e,l,t)})},[s,e,t,a,_,E,A,C]),I=(0,l.useCallback)(()=>{s((0,x.IK)({onConfirm:u,onCancel:()=>{s((0,h.AS)())}}))},[s,u]);return l.createElement(re.Ay,{style:{padding:0},name:"customUpgrade",variant:"link",type:"submit",onClick:I,disabled:i},l.createElement(f.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_CONFIRM_TITLE"}))});var dt=a(516693),_t=a(887831),At=a(648549),Ct=a(545332),ut=a(258840),It=a(501139);const Ot="/v2/api/site/{site}/support/{mac}",Tt=`${Ot}/generation`,Nt=`${Ot}/download`;var pt;!function(e){e.READY_TO_GENERATE="READY_TO_GENERATE",e.GENERATING="GENERATING",e.READY_TO_DOWNLOAD="READY_TO_DOWNLOAD"}(pt||(pt={}));var Dt=a(23582),St=a(413914);const Rt=({onClick:e,children:t,isDisabled:a})=>l.createElement(Z.A,{type:"button",onClick:e,isDisabled:a},l.createElement(xe.E,{size:"medium",color:"inherit"},t)),Mt=()=>l.createElement(Rt,{isDisabled:!0},l.createElement(f.sA,{id:"COMMON_GENERATING"}),"... ",l.createElement(f.sA,{id:"COMMON_ESTIMATED_TIME",values:{time:l.createElement(l.Fragment,null,"3 ",l.createElement(f.sA,{id:"COMMON_UNIT_MIN"}))}})),vt=({mac:e,disabled:t,name:a=e})=>{const E=(0,n.useDispatch)(),[i,s]=(0,l.useState)(pt.READY_TO_GENERATE),[o,c]=(0,l.useState)(!1),r=(0,l.useCallback)(()=>{E((e=>t=>t((0,J.vB)(dt.aC,null,null,_t.A.POST,(0,At.P)(Tt,{mac:e}),{},{},{})))(e)).then(()=>{s(pt.GENERATING)}).catch(({msg:e})=>{E((0,L.ox)({icon:M.C.danger,message:e||"COMMON_UNKNOWN_ERROR",values:{name:a}}))})},[E,e,a]),m=(0,l.useCallback)(()=>{c(!0),E(((e,t,{isCancelled:a,...n}={})=>async(l,E)=>{const i=(0,At.P)(Nt,{mac:e}),s=await l((0,J.t2)(Ct.A,i,void 0,n));return a?.call(null)?Promise.resolve():(0,ut.LR)((0,It.k)(E())(i),t??(0,ut.v6)(s),!0)})(e)).then(()=>{s(pt.READY_TO_GENERATE)}).catch(({msg:e})=>{E((0,L.ox)({icon:M.C.danger,message:e||"COMMON_UNKNOWN_ERROR",values:{name:a}}))}).finally(()=>{c(!1)})},[E,e,a]),d=(0,l.useCallback)((t={})=>{e===t?.mac&&t?.status&&t.status in pt&&s(t.status)},[e]);return(0,Dt.A)(St.E.DEVICE_SUPPORT_FILE,d),(0,l.useEffect)(()=>{E((e=>t=>t((0,J.vB)(dt.aC,null,null,_t.A.GET,(0,At.P)(Ot,{mac:e}),{},null,{})))(e)).then(({data:e={}})=>{d(e)})},[E,e]),i?l.createElement(Ge.A,{tooltipId:"DEVICE_DOWNLOAD_SUPPORT_FILE_TOOLTIP"},i===pt.READY_TO_GENERATE?l.createElement(Rt,{onClick:r,isDisabled:t},l.createElement(f.sA,{id:"DEVICE_GENERATE_SUPPORT_FILE"})):null,i===pt.GENERATING?l.createElement(Mt,null):null,i===pt.READY_TO_DOWNLOAD?l.createElement(Rt,{onClick:m,isDisabled:t||o},l.createElement(f.sA,{id:"DEVICE_DOWNLOAD_SUPPORT_FILE"})):null):null},bt="manage",gt="true"===ke.D.getItem("supportFileDownloadButtonVisible"),Pt=(0,c.A)(T.A)`
  > div:last-child {
    border-bottom: none;
    padding-bottom: 0px;
    height: 36px;
  }
`,Lt=(0,c.A)("div")`
  margin-right: 6px;
`,ht=({activeItem:e,hideLocate:t,disableLocateWithReason:a,hideRestart:c,disableRestartWithReason:D,hideRemove:S,disableRemoveWithReason:R,hideManualFwUpdate:M,disableManualFwUpdateWithReason:v,hideDowngrade:b,disableDowngradeWithReason:g,hideReplacementDevice:P,hideSnmp:L,hideDebug:h,hideCopyConfig:V,hideReplace:y,disableCopyConfigWithReason:k,values:w={},setFieldValue:F,renderApFields:x,showEnableDisableSwitch:X,additionalItems:Y=null,unpairItem:$=null,disableRemotePowerOffWithReason:z,restartButton:j=null})=>{const Q=`${(0,d.A)(Se.VO.DEVICES)}?${fe.Ej}`,q=(0,n.useSelector)((0,l.useMemo)(()=>(0,Ve.Xr)({model:e.model,type:e.type,device_mode_override:e.device_mode_override}),[e.model,e.type,e.device_mode_override])),Z=(0,U.S9)(e),J=(0,n.useSelector)(Re.G3),ee=(0,n.useSelector)(Me.kC),te=(0,n.useSelector)((0,ve.p)(be.S.API_DEVICE_RESTART)),ae=(0,n.useSelector)(Ve.ID),ne=(0,Le.$Y)({device:e,devices:ae}),le=(0,l.useMemo)(()=>(0,G.jS2)(e.version,e.upgrade_to_firmware),[e.version,e.upgrade_to_firmware]),Ee=(0,l.useMemo)(()=>(0,_.Vq)(e.fw_caps)&&!h,[e.fw_caps,h]),se=(0,l.useMemo)(()=>(0,ge.Pi)(e.psu_table)?.online,[e.psu_table]),re=(0,l.useMemo)(()=>Z===B.g.UPGRADING?"DEVICE_ACTIONS_CUSTOM_UPGRADE_IN_PROGRESS":J?"DEVICE_ACTIONS_CUSTOM_UPGRADE_NOT_AVAILABLE":"DEVICE_ACTIONS_CUSTOM_UPGRADE_INFO",[Z,J]),[me,_e]=(0,l.useState)(!1),Ce=(0,l.useMemo)(()=>(e.port_table||[]).some(Pe.PA),[e.port_table]),Ie=(0,l.useCallback)(()=>{w.lowpfmode_override?F?.("lowpfmode_override",!1):Ce?_e(!0):F?.("lowpfmode_override",!0)},[F,w.lowpfmode_override,Ce]);return l.createElement(Pt,{flexDirection:"column"},x?l.createElement(l.Fragment,null,(0,_.mo)(e)?l.createElement(T.A,{marginBottom:A.Ln,gap:A.YC,alignItems:"center"},l.createElement(I.A,{type:"realCheckbox",name:"green_ap_enabled"},l.createElement(f.sA,{id:"COMMON_ENHANCED_POE_PLUS_INTEROPERABILITY"})),l.createElement(E.A,{width:220,description:l.createElement(f.sA,{id:"COMMON_ENHANCED_POE_PLUS_INTEROPERABILITY_DESC"})},l.createElement(o.A,{isActive:!0,size:"original"}))):null,L?null:(0,_.A6)(e)?l.createElement(T.A,{marginBottom:A.Ln,flexDirection:"column"},l.createElement(we.A,null)):null,e.lowpfmode?l.createElement(T.A,{marginBottom:A.Ln,justifyContent:"space-between"},l.createElement(T.A,{alignItems:"center"},l.createElement(i.A,{size:"body"},l.createElement(Lt,null,l.createElement(f.sA,{id:"COMMON_LOW_PERFORMANCE_MODE"}))),l.createElement(E.A,{width:200,description:l.createElement(f.sA,{id:(0,_.gU)(e,ne),values:{name:(0,r.Q)(e)}})},l.createElement(o.A,{isActive:!0,size:"original"}))),l.createElement(u.A,{title:"DEVICE_PROPERTIES_LABEL_LOW_PRFM_MODE_CONFIRM_TITLE",message:"DEVICE_PROPERTIES_LABEL_LOW_PRFM_MODE_CONFIRM_MESSAGE",handleClose:()=>_e(!1),handleConfirm:()=>F?.("lowpfmode_override",!0),isOpen:me,position:"topStart",buttonMessage:"COMMON_ACTION_PROCEED"},l.createElement(I.A,{type:"checkbox",name:"lowpfmode_override",onChange:Ie}))):null):null,(0,m.G)({type:e.type,model:e.model})&&!P?l.createElement(C.A,null,y?null:l.createElement(Ge.R,{tooltipId:"DEVICE_SET_REPLACEMENT_DEVICE_DESCRIPTION"},l.createElement(Fe.A,{mac:e.mac,model:e.model,type:e.type,hideTooltip:!0})),V?null:l.createElement(Ge.R,{tooltipId:"DEVICE_LOAD_CONFIGURATION_DESCRIPTION",disabledTooltip:k},l.createElement(Et,{mac:e.mac,model:e.model,name:e.name,disabled:!!k}))):null,gt&&(0,_.W4)(e,ye.A.SUPPORT_FILE)?l.createElement(vt,{mac:e.mac,name:(0,r.Q)(e),disabled:Z!==B.g.CONNECTED}):null,Ee?l.createElement(Ge.R,{tooltipId:"DEVICE_ACTIONS_DEBUG_INFO"},l.createElement(ue,{device:e})):null,ee?l.createElement(We,{mac:e.mac,deviceName:(0,r.Q)(e)}):null,q||M?null:l.createElement(Ge.R,{tooltipId:"DEVICE_ACTIONS_CUSTOM_UPGRADE_INFO",tooltipProps:{messageId:re,values:{button:l.createElement(O.A,{to:Q},l.createElement(f.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_NOT_AVAILABLE_BUTTON"}))},isInteractive:!0},disabledTooltip:v},l.createElement(N.A,{condition:se,wrapper:(Oe="DEVICE_ACTIONS_CUSTOM_UPGRADE_EXTERNAL_BATTERY_WARNING",e=>l.createElement(E.A,{description:l.createElement(f.sA,{id:Oe}),position:"topLeft",width:245},e))},l.createElement(mt,{name:e.name,model:e.model,mac:e.mac,version:e.version,disabled:se||Z===B.g.UPGRADING||J||!!v}))),t?null:l.createElement(Ge.R,{tooltipId:"DEVICE_ACTIONS_LOCATE_DEVICE_DESCRIPTION",disabledTooltip:a},l.createElement(ce.A,{device:e,disabled:!!a})),!c&&te?l.createElement(Ge.R,{tooltipId:"DEVICE_ACTIONS_RESTART_INFO",disabledTooltip:D},j||l.createElement(p.A,{device:e,disabled:!!D})):null,X||e.disabled?l.createElement(Ge.R,{tooltipId:e.disabled?"DEVICE_ACTIONS_ENABLE_INFO":"DEVICE_ACTIONS_DISABLE_INFO"},l.createElement(de,{device:e})):null,e.type===he.bq.UBB||(0,G.vyh)(e)?l.createElement(Ge.R,{tooltipId:"DEVICE_ACTIONS_ALIGNMENT_INFO"},l.createElement(De,{device:e})):null,le&&!b?l.createElement(Ge.R,{disabledTooltip:g},l.createElement(Ae,{device:e,disabled:!!g})):null,(0,G.VkX)({model:e.model})?l.createElement(l.Fragment,null,!e.vbms_table?.is_battery_mode&&e.outlet_enabled?l.createElement(Ge.R,{flexDirection:"column",tooltipId:"DEVICE_REMOTE_POWER_CYCLE_TOOLTIP",tooltipProps:{values:{seconds:60}}},l.createElement(ie,{_id:e._id,mac:e.mac,vbms_table:e.vbms_table,deviceState:e.deviceState,disabled:!e.outlet_enabled||Z!==B.g.CONNECTED})):null,l.createElement(Ge.R,{tooltipId:e.outlet_enabled?"DEVICE_ACTIONS_REMOTE_POWER_OFF_TOOLTIP":"DEVICE_ACTIONS_REMOTE_POWER_ON_TOOLTIP",tooltipProps:{values:{deviceName:l.createElement(l.Fragment,null,(0,r.Q)({name:e.name,model:e.model,mac:e.mac}))}},disabledTooltip:z},l.createElement(oe,{_id:e._id,mac:e.mac,name:e.name,model:e.model,outlet_enabled:e.outlet_enabled,disabled:!!z||Z!==B.g.CONNECTED}))):null,$,S?null:l.createElement(Ge.R,{tooltipId:"DEVICE_ACTIONS_REMOVE_INFO"},(0,W.pY)(e)?l.createElement(H,{device:e}):l.createElement(s.A,{description:R??(se?l.createElement(f.sA,{id:"DEVICE_ACTIONS_REMOVE_EXTERNAL_BATTERY_WARNING"}):void 0)},l.createElement("span",null,l.createElement(K.A,{device:e,disabled:se||!!R})))),Y);var Oe}}}]);