"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[86446],{142208(e,t,a){a.d(t,{A:()=>P});var n=a(822336),l=a(296540),i=a(469733),r=a(271856),c=a(217439),m=a(71479),o=a(382389),s=a(132196),E=a(6510),d=a(137625),A=a(845030),u=a(916537),O=a(286818),C=a(953048),p=a(293016),v=a(649413),_=a(497470),N=a(83344),I=a(323572),b=a(457311),M=a(602021),R=a(837612),D=a(602197),y=a(171073),T=a(765268),g=a(955161),k=a(734707),f=a(311785);const w=(0,m.A)(k.Ay,(0,f.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};
  }
`,h=s.AH`
  flex: 1;
  width: 100%;
`,S=e=>l.createElement(r.A,{portal:!0,width:180,description:l.createElement(c.A,{style:{whiteSpace:"pre-wrap"}},l.createElement(u.sA,{id:"DEVICE_ACTIONS_REMOVE_TOOLTIP"})),className:h},e),P=({device:e,disabled:t,variant:a})=>{const n=(0,i.useDispatch)(),r=(0,o.u)(),[m,s]=(0,l.useState)(!1),[f,P]=(0,l.useState)(!1),V=(0,i.useSelector)(M.EL),L=(0,i.useSelector)(O.OA),F=(0,R.S9)(e),{isDeviceDisconnected:x,isDeviceAdoptionFailed:U,deviceBusy:W}=(0,l.useMemo)(()=>({isDeviceDisconnected:F===D.g.DISCONNECTED,isDeviceAdoptionFailed:F===D.g.ADOPTION_FAILED,deviceBusy:(0,R.C1)(F)}),[F]),B=(0,l.useMemo)(()=>t||W||V,[t,W,V]),z=(0,l.useCallback)(()=>{const{id:t,type:a}=(0,v.Se)(L);a===p.F7.DEVICE&&t===e?.mac&&(n((0,_.U)(C.Zt)),n((0,_.Ao)([])))},[e?.mac,n,L]);return l.createElement(g.A,{condition:W,wrapper:S},l.createElement(d.A,{isOpen:f,title:"COMMON_ACTION_REMOVE_CONFIRM_TITLE",titleValues:{deviceName:(0,E.Q)(e)},message:x||U?"DEVICE_DISCONNECTED_ACTIONS_REMOVE_CONFIRM_MESSAGE":"DEVICE_ACTIONS_REMOVE_CONFIRM_MESSAGE",messageValues:{deviceName:(0,E.Q)(e)},buttonMessage:"COMMON_ACTION_REMOVE",buttonVariant:"danger",handleConfirm:async()=>{s(!0),n((0,I.Yl)(e.mac)).then(()=>{z(),n((0,N.W)(e.mac)),n((0,y.XL)(e.mac)),s(!1),P(!1),n((0,A.K5)()),n((0,b.Uc)()),n((0,T.O)())}).finally(()=>{s(!1),P(!1)})},handleClose:()=>{s(!1),P(!1)},className:"tertiary"===a?h:""},l.createElement(w,{disabled:B,variant:"tertiary"===a?void 0:"link",className:"tertiary"===a?(0,k.sC)(r):"",onClick:e=>{e.preventDefault(),e.stopPropagation(),P(!0)},loader:m?"spinner":null,type:"button"},l.createElement(c.A,{color:"red-06",size:"medium"},l.createElement(u.sA,{id:"COMMON_ACTION_REMOVE"})))))}},137625(e,t,a){a.d(t,{A:()=>o});var n=a(296540),l=a(353899),i=a(132196),r=a(372737),c=a(566723),m=a(916537);const o=({children:e=null,title:t,titleValues:a,message:o,messageValues:s,handleConfirm:E=()=>null,handleClose:d=()=>null,handleCancel:A,isOpen:u,buttonVariant:O="primary",cancelButtonVariant:C="tertiary",cancelButtonMessage:p="COMMON_ACTION_CANCEL",buttonMessage:v="COMMON_ACTION_CONFIRM",buttonDisabled:_=!1,position:N="top",offset:I,showHeaderClose:b=!1,contentClassName:M="",body:R,titleBody:D,className:y,rootClose:T=!1,footerActions:g})=>{const k=(0,n.useCallback)(e=>{u&&(e.stopPropagation(),e.key===r.U.ENTER?E():e.key===r.U.ESCAPE&&d(!1))},[u,E,d]);(0,n.useEffect)(()=>(window.addEventListener("keydown",k,!0),()=>{window.removeEventListener("keydown",k,!0)}),[k]);const f=(0,n.useCallback)(()=>{d(!1),A?.()},[d,A]),w=(0,n.useCallback)(()=>{d(!1),E()},[d,E]),h=(0,n.useMemo)(()=>[{text:n.createElement(m.sA,{id:p}),variant:C,onClick:f},{text:n.createElement(m.sA,{id:v}),disabled:_,variant:O,onClick:w}],[v,O,p,C,f,w,_]),S=(0,n.useCallback)(()=>{d(!1)},[d]),P=i.AH`
    ${t?"":`margin-top: ${c.xO}`}
  `;return n.createElement(l.A,{title:t?n.createElement(m.sA,{id:t,values:a}):D||null,...o?{body:n.createElement(n.Fragment,null,n.createElement(m.sA,{id:o,values:s}),R)}:{body:R},position:N,portal:!0,offset:I,actions:g||h,showHeaderClose:b,contentClassName:i.AH`
        ${P}
        ${M}
      `,onRequestClose:S,isOpen:u,allowOverflow:!0,rootClose:T,className:y},e)}},986446(e,t,a){a.r(t),a.d(t,{default:()=>B});var n=a(296540),l=a(837612),i=a(962926),r=a(217439),c=a(170121),m=a(162420),o=a(6510),s=a(566723),E=a(242366),d=a(294303),A=a(876250),u=a(6176),O=a(142208),C=a(916537),p=a(996734),v=a(689965),_=a(360113),N=a(777741);const I=n.createElement(C.sA,{id:"COMMON_NETWORK_PURPOSE_WAN"}),b=n.createElement(C.sA,{id:"COMMON_NETWORK_PURPOSE_LANX",values:{number:""}}),M=({activeItem:e,activeItem:{mac:t,model:a,ip:l,mbb:M}})=>{const R=M?.mode===p.c9.PRIMARY_INTERNET,D=R?I:b,y=R?b:I;return n.createElement(E.A,null,n.createElement(i.A,{sections:[n.createElement(d.A,{flexDirection:"column",gap:s.Ln},n.createElement(d.A,{gap:s.kc,alignItems:"center"},n.createElement(u.A,{model:a,size:A.Xh.MEDIUM,width:40,height:40}),n.createElement(c.A,{variant:"medium"},(0,o.Lm)(a))),n.createElement(d.A,{marginTop:s.kc},n.createElement(d.A,{marginRight:s.kc},n.createElement(m.A,{isActive:!0,variant:"fill",size:"original"})),n.createElement(d.A,{flexDirection:"column",gap:s.kc},n.createElement(c.A,{variant:"medium"},n.createElement(C.sA,{id:"DEVICE_INCORRECT_TOPOLOGY_WARNING_TITLE",values:{currentPort:y}})),n.createElement(r.A,null,n.createElement(C.sA,{id:"DEVICE_INCORRECT_TOPOLOGY_WARNING",values:{b:C.b,currentPort:y,adoptedPort:D}})))),n.createElement(O.A,{device:e,variant:"tertiary"}))]}),n.createElement(v.A,null,t?n.createElement(_.A,null,n.createElement(r.A,{color:"text-2",size:"medium"},n.createElement(C.sA,{id:"COMMON_MAC_ADDRESS"})),n.createElement(r.A,{color:"text-3",size:"medium"},t)):null,l?n.createElement(_.A,null,n.createElement(r.A,{color:"text-2",size:"medium"},n.createElement(C.sA,{id:"COMMON_IP_ADDRESS"})),n.createElement(r.A,{color:"text-3",size:"medium"},l)):null,M?.imei?n.createElement(_.A,null,n.createElement(r.A,{color:"text-2",size:"medium"},n.createElement(C.sA,{id:"DEVICE_IMEI"})),n.createElement(r.A,{color:"text-3",size:"medium"},M.imei)):null,M?.esim?.eid?n.createElement(N.A,{eid:M.esim.eid}):null))};var R=a(86571),D=a(328787),y=a(932832),T=a(673283),g=a(243),k=a(281884),f=a(392699),w=a(124092),h=a(470962),S=a(602197),P=a(129361),V=a(937491),L=a(236037);const F=({activeItem:e,activeItem:{mac:t,deviceState:a,uplink:l,mbb:i,mbb_overrides:r,wan_networkgroup:c}})=>{const m=(0,n.useMemo)(()=>(0,k.H)(a||S.g.UNKNOWN,l?.type),[a,l?.type]),o=m===f.v.OFFLINE,E=Boolean(c)||Boolean(l?.uplink_device_name);return n.createElement(n.Fragment,null,n.createElement(w.A,{activeItem:e,isOffline:o,description:E?n.createElement(P.A,{activeItem:e,connectionStatus:m}):null,style:{flex:1}},i?.sim&&!o?n.createElement(d.A,{marginTop:s.xO},n.createElement(V.A,{mac:t,deviceState:a,mbb:i,mbb_overrides:r})):null,n.createElement(L.A,{activeItem:e})),o?n.createElement(h.A,null):null)};var x=a(78853),U=a(675116);const W=({activeItem:e,activeItem:{adopted:t,name:a,type:l,model:i,ip:r,ipv6:c,mac:m,config_network:o,uplink:s,sys_stats:E,displayable_version:d,uptime:A,mbb:u={},mbb_overrides:O={},wan_networkgroup:C,shortname:p}})=>n.createElement(n.Fragment,null,n.createElement(F,{activeItem:e}),C?null:n.createElement(D.A,{ip:r,adopted:t,config_network:o}),n.createElement(U.A,{imei:u?.imei,eId:u?.esim?.eid,model:i}),n.createElement(T.A,{name:a,type:l,model:i,sys_stats:E,ip:r,ipv6:c,mac:m,displayable_version:d,uptime:A}),n.createElement(g.F,{sim:u?.sim,radio:u?.radio,mbb_overrides:O}),s?.mac?n.createElement(v.A,{type:v.I.ACCORDION,items:[{id:"uplink",openByDefault:!0,label:n.createElement(R.A,{id:"COMMON_PARENT_DEVICE"}),renderContent:()=>n.createElement(y.A,{activeItem:e})}]}):null,n.createElement(x.A,{shortname:p})),B=({activeItem:e})=>(0,l.RS)(e)?n.createElement(M,{activeItem:e}):n.createElement(W,{activeItem:e})},372737(e,t,a){var n;a.d(t,{U:()=>n}),function(e){e.ARROW_LEFT="ArrowLeft",e.ARROW_RIGHT="ArrowRight",e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape",e.BACKSPACE="Backspace",e.DELETE="Delete",e.TAB="Tab"}(n||(n={}))}}]);