"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[56619],{776288(e,t,a){a.d(t,{A:()=>n});const n={PCAP:4194304,HWOFFLOAD_QOS_AND_SMART_QUEUE:2147483648,SUPPORT_FILE:65536}},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={}))},575593(e,t,a){a.d(t,{p:()=>s});var n=a(801081),l=a(215454),i=a(602021),o=a(198494),E=a(949909);const s=e=>(0,n.Mz)(i.ah,l.pw,i.dK,o.fR,(t,a,n,l)=>{switch(e){case E.S.API_DEVICE_ADOPT:case E.S.API_DEVICE_RESTART:return n||t.includes(e);case E.S.API_WIDGET_OS_STATS:return l||a.includes(e);default:return n}})},535362(e,t,a){a.d(t,{A:()=>T});var n=a(296540),l=a(469733),i=a(314714),o=a(566723),E=a(916537),s=a(575593),c=a(949909),r=a(578819),m=a(780811),d=a(837612),_=a(602197),A=a(171073),C=a(175875),O=a(147606),u=a(294303);const I=({device:e,disabled:t,confirmTitle:a,confirmMessage:I,confirmButtonMessage:T,hidePoe:N,customName:p,unit_id:D})=>{const S=(0,l.useDispatch)(),R=(0,l.useSelector)((0,s.p)(c.S.API_DEVICE_RESTART)),[b,v]=(0,n.useState)(!1),M=p||e.name||e.mac,g=(0,m.Tbi)(e)&&(0,r.b0)(e.port_table),h=(0,d.S9)(e),P=h!==_.g.CONNECTED&&h!==_.g.RFSCANNING,L=g||(0,m.moU)(e)||!e.bypassConfirmRestart,f=(0,n.useCallback)(()=>{S((0,A.CP)(e,b?"hard":"soft",D))},[S,e,b,D]);return R?n.createElement(O.A,{title:n.createElement(E.sA,{id:a||"DEVICE_ACTIONS_RESTART_CONFIRM_TITLE",values:{deviceName:M}}),message:n.createElement(n.Fragment,null,n.createElement(E.sA,{id:I||"DEVICE_ACTIONS_RESTART_CONFIRM_MESSAGE",values:{deviceName:M}}),g&&!N?n.createElement(u.A,{paddingTop:o.kc},n.createElement(i.A,{checked:b,id:"hardReboot",onChange:()=>{v(e=>!e)}},n.createElement(E.sA,{id:"DEVICE_ACTIONS_RESTART_CONFIRM_CYCLE_POE_POWER"}))):null),confirmButtonLabel:T||"DEVICE_ACTIONS_RESTART",confirmButtonVariant:"destructive",onConfirm:f,trigger:L?n.createElement(C.A,{isDisabled:P||t},n.createElement(E.sA,{id:"DEVICE_ACTIONS_RESTART"})):null}):null},T=(0,n.memo)(({device:e,disabled:t,confirmTitle:a,confirmMessage:l,confirmButtonMessage:i,hidePoe:o,customName:E,unit_id:s})=>n.createElement(I,{device:e,disabled:t,confirmTitle:a,confirmMessage:l,confirmButtonMessage:i,hidePoe:o,customName:E,unit_id:s}))},598274(e,t,a){a.d(t,{A:()=>_});var n=a(296540),l=a(469733),i=a(71479),o=a(916537),E=a(780811),s=a(837612),c=a(602197),r=a(171073),m=a(734707);const d=(0,i.A)(m.Ay)`
  padding: 0;
  white-space: nowrap;
`,_=({device:e,labelId:t,disabled:a})=>{const i=(0,l.useDispatch)(),m=(0,s.S9)(e),_=(0,n.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),(0,E.YdF)({type:e.type})&&e.peer_ubb?.mac&&i((0,r.VO)({locating:e.peer_ubb.locating,mac:e.peer_ubb.mac,name:e.peer_ubb.name,model:e.peer_ubb.model})),i((0,r.VO)({locating:e.locating,mac:e.mac,name:e.name,model:e.model}))},[i,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 n.createElement(d,{variant:"link",onClick:_,disabled:a||m!==c.g.CONNECTED},n.createElement(o.sA,{id:e.locating?"DEVICE_ACTIONS_LOCATE_STOP":t||"DEVICE_ACTIONS_LOCATE"}))}},142208(e,t,a){a.d(t,{A:()=>y});var n=a(822336),l=a(296540),i=a(469733),o=a(271856),E=a(217439),s=a(71479),c=a(382389),r=a(132196),m=a(6510),d=a(137625),_=a(845030),A=a(916537),C=a(286818),O=a(953048),u=a(293016),I=a(649413),T=a(497470),N=a(83344),p=a(323572),D=a(457311),S=a(602021),R=a(837612),b=a(602197),v=a(171073),M=a(765268),g=a(955161),h=a(734707),P=a(311785);const L=(0,s.A)(h.Ay,(0,P.A)("disabled"))`
  padding: 0;
  ${({disabled:e})=>e?"pointer-events: none; opacity: 0.4;":""};
  color: ${({theme:{themeName:e,motifPalette:{red05:t}},disabled:a})=>a?t:n.Ay[`desktop-color-red-06-${e}`]};
  &:hover {
    color: ${({theme:{motifPalette:{red05:e}}})=>e};
  }
  &:active {
    color: ${({theme:{motifPalette:{red05:e,red07:t}},disabled:a})=>a?e:t};
  }
`,f=r.AH`
  flex: 1;
  width: 100%;
`,V=e=>l.createElement(o.A,{portal:!0,width:180,description:l.createElement(E.A,{style:{whiteSpace:"pre-wrap"}},l.createElement(A.sA,{id:"DEVICE_ACTIONS_REMOVE_TOOLTIP"})),className:f},e),y=({device:e,disabled:t,variant:a})=>{const n=(0,i.useDispatch)(),o=(0,c.u)(),[s,r]=(0,l.useState)(!1),[P,y]=(0,l.useState)(!1),k=(0,i.useSelector)(S.EL),F=(0,i.useSelector)(C.OA),U=(0,R.S9)(e),{isDeviceDisconnected:w,isDeviceAdoptionFailed:G,deviceBusy:B}=(0,l.useMemo)(()=>({isDeviceDisconnected:U===b.g.DISCONNECTED,isDeviceAdoptionFailed:U===b.g.ADOPTION_FAILED,deviceBusy:(0,R.C1)(U)}),[U]),W=(0,l.useMemo)(()=>t||B||k,[t,B,k]),x=(0,l.useCallback)(()=>{const{id:t,type:a}=(0,I.Se)(F);a===u.F7.DEVICE&&t===e?.mac&&(n((0,T.U)(O.Zt)),n((0,T.Ao)([])))},[e?.mac,n,F]);return l.createElement(g.A,{condition:B,wrapper:V},l.createElement(d.A,{isOpen:P,title:"COMMON_ACTION_REMOVE_CONFIRM_TITLE",titleValues:{deviceName:(0,m.Q)(e)},message:w||G?"DEVICE_DISCONNECTED_ACTIONS_REMOVE_CONFIRM_MESSAGE":"DEVICE_ACTIONS_REMOVE_CONFIRM_MESSAGE",messageValues:{deviceName:(0,m.Q)(e)},buttonMessage:"COMMON_ACTION_REMOVE",buttonVariant:"danger",handleConfirm:async()=>{r(!0),n((0,p.Yl)(e.mac)).then(()=>{x(),n((0,N.W)(e.mac)),n((0,v.XL)(e.mac)),r(!1),y(!1),n((0,_.K5)()),n((0,D.Uc)()),n((0,M.O)())}).finally(()=>{r(!1),y(!1)})},handleClose:()=>{r(!1),y(!1)},className:"tertiary"===a?f:""},l.createElement(L,{disabled:W,variant:"tertiary"===a?void 0:"link",className:"tertiary"===a?(0,h.sC)(o):"",onClick:e=>{e.preventDefault(),e.stopPropagation(),y(!0)},loader:s?"spinner":null,type:"button"},l.createElement(E.A,{color:"red-06",size:"medium"},l.createElement(A.sA,{id:"COMMON_ACTION_REMOVE"})))))}},452663(e,t,a){a.d(t,{i:()=>D,A:()=>S});var n=a(296540),l=a(469733),i=a(314714),o=a(566723),E=a(137625),s=a(294303),c=a(916537),r=a(575593),m=a(949909),d=a(578819),_=a(780811),A=a(602197),C=a(171073),O=a(6510),u=a(535362),I=a(71479),T=a(734707);const N=(0,I.A)(T.Ay)`
  padding: 0;
`,p=({device:e,isConfirmOpen:t,setIsConfirmOpen:a,disabled:r})=>{const m=(0,l.useDispatch)(),[u,I]=(0,n.useState)(!1),T=(0,n.useMemo)(()=>(0,O.Q)({name:e.name,model:e.model,mac:e.mac}),[e.name,e.model,e.mac]),p=(0,n.useMemo)(()=>(0,_.Tbi)({type:e.type})&&(0,d.b0)(e.port_table),[e.type,e.port_table]),D=(0,n.useMemo)(()=>e.deviceState!==A.g.CONNECTED&&e.deviceState!==A.g.RFSCANNING,[e.deviceState]),S=(0,n.useCallback)(()=>{m((0,C.CP)({name:e.name,model:e.model,mac:e.mac},u?"hard":"soft"))},[m,e.name,e.model,e.mac,u]),R=(0,n.useCallback)(()=>{a(!1)},[a]),b=(0,n.useCallback)(()=>{I(e=>!e)},[]),v=(0,n.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),p||(0,_.moU)({type:e.type,model:e.model,device_mode_override:e.device_mode_override})||!e.bypassConfirmRestart?a(!0):m((0,C.CP)({name:e.name,model:e.model,mac:e.mac}))},[m,p,e.bypassConfirmRestart,a,e.type,e.model,e.device_mode_override,e.name,e.mac]);return n.createElement(E.A,{isOpen:t,title:"DEVICE_ACTIONS_RESTART_CONFIRM_TITLE",titleValues:{deviceName:T},message:"DEVICE_ACTIONS_RESTART_CONFIRM_MESSAGE",messageValues:{deviceName:T},...p?{body:n.createElement(s.A,{paddingTop:o.kc},n.createElement(i.A,{checked:u,id:"hardReboot",onChange:b},n.createElement(c.sA,{id:"DEVICE_ACTIONS_RESTART_CONFIRM_CYCLE_POE_POWER"})))}:{},buttonMessage:"DEVICE_ACTIONS_RESTART",buttonVariant:"danger",handleConfirm:S,handleClose:R,offset:-1},n.createElement(N,{variant:"link",onClick:v,disabled:D||r},n.createElement(c.sA,{id:"DEVICE_ACTIONS_RESTART"})))},D=e=>(0,l.useSelector)((0,n.useMemo)(()=>(0,r.p)(m.S.API_DEVICE_RESTART),[]))?n.createElement(p,{...e}):null,S=(0,n.memo)(({device:e,disabled:t})=>n.createElement(u.A,{device:e,disabled:t}))},175875(e,t,a){a.d(t,{A:()=>c});var n=a(469733),l=a(296540),i=a(592563),o=a(180524),E=a(602021),s=a(294303);const c=(0,l.forwardRef)(({allowReadOnly:e,disabledReason:t,...a},c)=>{const r=(0,n.useSelector)(E.EL)&&!e;return l.createElement(s.A,{alignItems:"center"},l.createElement(o.A,{description:t,placement:"left"},l.createElement(i.A,{fontSize:"medium",type:"button",...a,isDisabled:r||a.isDisabled||!!t,ref:c})))})},956619(e,t,a){a.d(t,{f:()=>bt,A:()=>gt});var n=a(469733),l=a(296540),i=a(271856),o=a(217439),E=a(162420),s=a(71479),c=a(180524),r=a(6510),m=a(421130),d=a(15095),_=a(860631),A=a(566723),C=a(842630),O=a(137625),u=a(143811),I=a(196010),T=a(294303),N=a(955161),p=a(452663),D=a(822336),S=a(758649),R=a(132196),b=a(778851),v=a(742920),M=a(46119),g=a(130851),h=a(6176),P=a(845030),L=a(675359),f=a(126457),V=a(86392),y=a(916537),k=a(83344),F=a(323572),U=a(417378),w=a(198494),G=a(780811),B=a(837612),W=a(902786),x=a(602197),$=a(171073),Y=a(573363),z=a(727270),Q=a(876250);const H=(0,s.A)(S.A)`
  padding: 0;
  color: ${({theme:{themeName:e}})=>D.Ay[`desktop-color-red-06-${e}`]};

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

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