"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[15066],{46119:(e,t,n)=>{n.d(t,{A:()=>a});const a={open:(e,t="_blank",n="noopener,noreferrer")=>window.open(e,t,n)}},71265:(e,t,n)=>{n.d(t,{R:()=>m,k:()=>A});var a=n(280258),r=n(190497),l=n(953048),c=n(175522),i=n(936621),o=n(305988);const s=[...new Set([a.H,c.Q.join(c.A),l.Zt,i.F,r.nc,o.Vr])],E={numeric:!0,sensitivity:"base"},m=(e,t)=>{const n=[];for(let a=e;a<=t;a+=1)n.push({value:a,label:String(a)});return n},A=e=>({value:t,label:n},{value:a,label:r})=>s.includes(t?.toString())||s.includes(a?.toString())?1/0:n?.toString().localeCompare(r?.toString(),e,E)??-1},87792:(e,t,n)=>{n.r(t),n.d(t,{default:()=>$});var a=n(296540),r=n(328787),l=n(686130),c=n(442728),i=n(812454),o=n(689965),s=n(999063),E=n(927099),m=n(699784),A=n(768195),u=n(360113);const d={[A.Y_.OPERATIONAL]:{color:"success",translationKey:"CI_STATE_OPERATIONAL"},[A.Y_.COAX_CABLE_NOT_PLUGGED]:{color:"danger",translationKey:"CI_STATE_COAX_CABLE_NOT_PLUGGED"}},_=({status:e})=>d[e]?a.createElement(u.A,null,a.createElement(E.A,{color:"secondary",size:"body"},a.createElement(m.sA,{id:"COMMON_MODEM_STATUS"})),a.createElement(E.A,{color:d[e].color,size:"body"},a.createElement(m.sA,{id:d[e].translationKey}))):null;var p=n(723544),C=n(500045);const I=({mac:e})=>a.createElement(u.A,null,a.createElement(E.A,{color:"secondary",size:"body"},a.createElement(m.sA,{id:"COMMON_CM_MAC_ADDRESS"})),a.createElement(E.A,{color:"tertiary",size:"body"},e)),N=({activeItem:{ci_state_table:e,mac:t,displayable_version:n,uptime:r}})=>a.createElement(o.A,null,a.createElement(_,{status:e?.ci_state}),a.createElement(p.A,{mac:t}),a.createElement(I,{mac:e?.ci_mac}),a.createElement(C.A,{displayable_version:n}),a.createElement(s.A,{uptime:r}));var T,v=n(469733),M=n(186169),g=n(758649),O=n(280160),D=n(574137),P=n(137298),R=n(398300),S=n(566723),b=n(707889),w=n(489391),y=n(271856),h=n(217439),f=n(71479),L=n(294303),k=n(438369),x=n(670);!function(e){e.TX="tx",e.RX="rx"}(T||(T={}));const z=({type:e,isp:{configuration:{wan_provider_capabilities:{upload_kilobits_per_second:t=0,download_kilobits_per_second:n=0}}={wan_provider_capabilities:{upload_kilobits_per_second:0,download_kilobits_per_second:0}},statistics:{peak_usage:{"max_rx_bytes-r":r=0,"max_tx_bytes-r":l=0}}={peak_usage:{"max_rx_bytes-r":0,"max_tx_bytes-r":0}},"rx_bytes-r":c=0,"tx_bytes-r":i=0},children:o})=>{const{value:s,unit:E,bytes:A}=new w.Un((0,P.Zz)(e===T.TX?t:n),"bitrate"),u=e===T.TX?l:r;return a.createElement(y.A,{width:250,portal:!0,description:a.createElement(L.A,{flexDirection:"column"},a.createElement(L.A,{marginBottom:S.kc},a.createElement(h.A,{size:"medium",color:"text-1",weight:"bold"},a.createElement(m.sA,{id:e===T.TX?"COMMON_UPLOAD":"COMMON_DOWNLOAD"}))),a.createElement(L.A,{justifyContent:"space-between",marginBottom:S.YC},a.createElement(h.A,{size:"small",color:"text-1"},a.createElement(m.sA,{id:"COMMON_ISP_CAPACITY"})),a.createElement(h.A,{size:"small",color:"text-2"},`${s} ${E}`)),a.createElement(L.A,{justifyContent:"space-between",marginBottom:S.YC},a.createElement(h.A,{size:"small",color:"text-1"},a.createElement(m.sA,{id:"DEVICE_ISP_ACTIVITY_INTERNET_REAL_TIME"})),a.createElement(h.A,{size:"small",color:"text-2"},(0,b.A)(Math.min(1,new w.Un(e===T.TX?i:c,"bitrate").bytes/A)))),a.createElement(L.A,{justifyContent:"space-between",marginBottom:S.YC},a.createElement(h.A,{size:"small",color:"text-1"},a.createElement(m.sA,{id:"DEVICE_ISP_ACTIVITY_INTERNET_PEAK"})),a.createElement(L.A,{alignItems:"center"},e===T.TX?a.createElement(k.A.Icon,{size:"small"}):a.createElement(x.A.Icon,{size:"small"}),(0,a.createElement)((d=h.A,(0,f.A)(d,{shouldForwardProp:e=>"type"!==e})`
  color: ${({theme:{motifPalette:{aqua06:e,purple06:t}},type:n})=>n===T.RX?e:t} !important;
`),{type:e,size:"small"},(0,P.zX)(u,2)))),a.createElement(L.A,{justifyContent:"space-between",marginBottom:S.YC},a.createElement(h.A,{size:"small",color:"text-1"},a.createElement(m.sA,{id:"DEVICE_ISP_ACTIVITY_INTERNET_PEAK"})),a.createElement(h.A,{size:"small",color:"text-2"},Math.round(Math.min(100,u/A*100))||0,"%")))},o);var d};var W=n(568777),X=n(845030),V=n(14851);const G=({isp:e})=>{const t=e?.details?.service_provider?.name;return t?a.createElement(L.A,{alignItems:"center"},e?.isWanConnected?a.createElement(W.A,{style:{height:32},asn:e?.details?.service_provider?.asn,name:t,key:t}):a.createElement(O.A,{size:"original",color:D.PA.danger}),a.createElement(E.A,{size:"header-xs",weight:"bold",style:{marginLeft:S.YC}},t)):null},B=({uptimePercentage:e})=>{if(!e||-1===e)return null;const t=Math.max(0,Math.round(e));return a.createElement(u.A,null,a.createElement(E.A,{size:"body"},a.createElement(m.sA,{id:"COMMON_IPS_UPTIME"})),a.createElement(E.A,{size:"body",style:{color:M.A.getGradientColor(t/100)}},t,"%"))},Y=({type:e,isp:t})=>{const n=e===T.RX?x.A:k.A,r=e===T.RX?"rx_bytes-r":"tx_bytes-r";return a.createElement(z,{type:e,isp:t},a.createElement(L.A,{alignItems:"center",marginRight:e===T.RX?S.xO:0},a.createElement(n.Icon,null),a.createElement(n.Bytes,{size:"medium"},(0,P.zX)(t?.[r],2))))},U=({isp:e})=>a.createElement(u.A,null,a.createElement(E.A,{size:"body"},a.createElement(m.sA,{id:"COMMON_IPS_STATUS"})),a.createElement(L.A,null,a.createElement(Y,{type:T.RX,isp:e}),a.createElement(Y,{type:T.TX,isp:e}))),F=({wan_networkgroup:e})=>{const t=(0,v.useDispatch)(),n=(0,v.useSelector)(V.X),r=(0,a.useMemo)(()=>n.find(({networkgroup:t})=>t===e),[e,n]),l=(0,a.useCallback)(()=>{t((0,X.XP)({type:R.H.ISP_DETAILS,id:e}))},[t,e]);return r?a.createElement(o.A,{type:o.I.ACCORDION,items:[{id:"isp",openByDefault:!0,label:a.createElement(G,{isp:r}),renderContent:()=>a.createElement(a.Fragment,null,a.createElement(U,{isp:r}),a.createElement(B,{uptimePercentage:r?.statistics?.uptime_percentage}),a.createElement(g.A,{type:"button",variant:"inline",onClick:l},a.createElement(E.A,{size:"body",color:"info"},a.createElement(m.sA,{id:"COMMON_INTERNET_HEALTH"}))))}]}):null};var H=n(772317);const $=({activeItem:e,activeItem:{adopted:t,ip:n,config_network:o,wan_networkgroup:s,shortname:E}})=>a.createElement(a.Fragment,null,a.createElement(i.A,{activeItem:e,showPortOverview:!0,hidePortsButton:!0},a.createElement(l.A,{activeItem:e,showPortsButton:!0,showCaptureButton:!0})),a.createElement(r.A,{ip:n,adopted:t,config_network:o}),a.createElement(c.A,{activeItem:e}),a.createElement(N,{activeItem:e}),a.createElement(F,{wan_networkgroup:s}),a.createElement(H.A,{shortname:E}))},175522:(e,t,n)=>{n.d(t,{A:()=>r,Q:()=>l});var a=n(416348);const r="_",l=[a.ZM,a.Je]},211908:(e,t,n)=>{n.d(t,{A:()=>U});var a=n(469733),r=n(296540),l=n(353899),c=n(758649),i=n(742920),o=n(421130),s=n(675359),E=n(699784),m=n(801081),A=n(25553),u=n(87485),d=n(264963);const _=e=>(0,m.Mz)((e=>(0,A.uh)((0,d.lX)({queryParams:{mac:e}})))(e),e=>(0,u.i6)(e)?.devices||[]);var p,C,I=n(768195),N=n(546391);!function(e){e.EXISTING="existing",e.NEW="new"}(p||(p={})),function(e){e.MAC="mac",e.TYPE="type",e.MODEL="model"}(C||(C={}));var T,v=n(238761),M=n(271856),g=n(438628),O=n(162420),D=n(400261),P=n(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"}(T||(T={}));const R={[T.DEVICE_REPLACEMENT_MODE]:void 0,[T.SET_DEVICE_REPLACEMENT_MODE]:P.P1,[T.NEW_MAC]:void 0,[T.SET_NEW_MAC]:P.P1,[T.EXISTING_MAC]:void 0,[T.SET_EXISTING_MAC]:P.P1,[T.REPLACEMENT_CANDIDATES]:[],[T.ERROR]:void 0,[T.RESET_ERROR]:P.P1},S=(0,r.createContext)(R);const b=n(132196).AH`
  height: 54px;
`;var w=n(71479),y=n(566723),h=n(294303);const f=(0,w.A)(h.A)`
  align-items: center;
  gap: ${y.YC};
`,L=(0,r.memo)(()=>{const{newMac:e,setNewMac:t,error:n,resetError:a}=(0,r.useContext)(S),l=(0,r.useCallback)(({target:{value:e}})=>{t((0,D.Z)(e)),a()},[t,a]);return r.createElement(g.A,{className:b,value:e,onChange:l,onFocus:a,variant:"secondary",label:r.createElement(f,null,r.createElement(E.sA,{id:"COMMON_MAC_ADDRESS"}),r.createElement(M.A,{portal:!0,width:"100%",maxWidth:248,description:r.createElement(E.sA,{id:"DEVICE_REPLACEMENT_MAC_LOCATION"})},r.createElement(O.A,{isActive:!0}))),width:"100%",invalid:n})});var k=n(362412),x=n(6176);const z=(0,r.memo)(()=>{const{replacementCandidates:e,existingMac:t,setExistingMac:n,error:a,resetError:l}=(0,r.useContext)(S),c=(0,r.useMemo)(()=>e.map(({mac:e,model:t,name:n})=>({label:n,value:e,image:r.createElement(x.A,{model:t}),additionalInfo:e})),[e]),i=(0,r.useCallback)(({value:e})=>{n(String(e)),l()},[n,l]);return r.createElement(k.A.Sorted,{value:t,label:r.createElement(E.sA,{id:"COMMON_DEVICE"}),width:"100%",searchable:!0,onChange:i,onFocus:l,maxHeight:228,options:c,invalid:a})}),W=(0,w.A)(h.A)`
  flex-direction: column;
  gap: ${y.kc};
`,X=(0,r.memo)(()=>{const{replacementCandidates:e,deviceReplacementMode:t,setDeviceReplacementMode:n,resetError:a}=(0,r.useContext)(S),l=(0,r.useMemo)(()=>e.length?[{id:p.EXISTING,children:r.createElement(E.sA,{id:"COMMON_EXISTING"}),onChange:()=>{n(p.EXISTING),a()},checked:t===p.EXISTING},{id:p.NEW,children:r.createElement(E.sA,{id:"COMMON_NEW"}),onChange:()=>{n(p.NEW),a()},checked:t===p.NEW}]:[],[e.length,t,n,a]);return r.createElement(W,null,r.createElement(v.A,{direction:"row",items:l}),t===p.EXISTING?r.createElement(z,null):null,t===p.NEW?r.createElement(L,null):null)}),V=(0,w.A)(h.A)`
  align-items: center;
  gap: ${y.YC};
  width: fit-content;
`;var G=n(252093);const B={[I.gQ.INCOMPATIBLE_REPLACEMENT]:"DEVICE_REPLACEMENT_DEVICE_INCOMPATIBLE_REPLACEMENT_ERROR",[I.gQ.REPLACEMENT_ALREADY_ASSIGNED]:"DEVICE_REPLACEMENT_DEVICE_REPLACEMENT_ALREADY_ASSIGNED_ERROR"},Y=({mac:e,hideTooltip:t=!1})=>{const{formatMessage:n}=(0,E.tz)(),o=(0,a.useDispatch)(),[m,A]=(0,r.useState)(!1),[u,C]=(0,r.useState)(!1),[v,M]=(0,r.useState)(p.NEW),[g,O]=(0,r.useState)(""),[D,P]=(0,r.useState)(""),[R,b]=(0,r.useState)(void 0),w=(0,a.useSelector)((0,r.useMemo)(()=>_(e),[e])),y=(0,r.useCallback)(()=>{A(!0)},[]),h=(0,r.useCallback)(()=>{A(!1),O(""),P(""),C(!1),M(p.NEW),b(void 0)},[]),f=(0,r.useCallback)(()=>{switch(v){case p.EXISTING:return D;case p.NEW:return g;default:return}},[v,D,g]),L=(0,r.useCallback)(()=>{o((0,s.ox)({icon:i.C.success,message:"DEVICE_REPLACEMENT_DEVICE_SET",duration:3e3})),h()},[o,h]),k=(0,r.useCallback)(e=>{switch(e.apiData?.replacement_state){case I.gQ.INCOMPATIBLE_REPLACEMENT:case I.gQ.REPLACEMENT_ALREADY_ASSIGNED:b(n({id:B[e.apiData.replacement_state]}));break;case I.gQ.CANNOT_REPLACE:default:o((0,s.ox)({icon:i.C.danger,message:"DEVICE_FAILED_TO_SET_REPLACEMENT_DEVICE",duration:3e3}))}},[o,n]),x=(0,r.useCallback)(()=>{C(!1)},[]),z=(0,r.useCallback)(()=>{C(!0),o((0,d.uC)(e,f())).then(L).catch(k).finally(x)},[o,L,k,e,f,x]),W=(0,r.useMemo)(()=>Boolean(f().match(N.b8)),[f]),Y=(0,r.useMemo)(()=>[{text:r.createElement(E.sA,{id:"COMMON_ACTION_CANCEL"}),variant:"tertiary",onClick:h},{text:r.createElement(E.sA,{id:"COMMON_ACTION_APPLY"}),variant:"primary",onClick:z,disabled:!W||u,loader:u?"spinner":void 0}],[h,z,W,u]),U=(0,r.useCallback)(()=>{b(void 0)},[b]),F=(0,r.useMemo)(()=>({[T.DEVICE_REPLACEMENT_MODE]:v,[T.SET_DEVICE_REPLACEMENT_MODE]:M,[T.NEW_MAC]:g,[T.SET_NEW_MAC]:O,[T.EXISTING_MAC]:D,[T.SET_EXISTING_MAC]:P,[T.REPLACEMENT_CANDIDATES]:w,[T.ERROR]:R,[T.RESET_ERROR]:U}),[v,g,D,w,R,U]);return(0,r.useEffect)(()=>{o((0,d.lX)({queryParams:{mac:e}}))},[o,e]),r.createElement(S.Provider,{value:F},r.createElement(l.A,{allowOverflow:!0,title:r.createElement(E.sA,{id:"DEVICE_SET_REPLACEMENT_DEVICE"}),body:r.createElement(X,null),position:"top",portal:!0,actions:Y,isOpen:m,onRequestClose:h},r.createElement(V,null,r.createElement(c.A,{type:"button",variant:"inline",size:"medium",onClick:y},r.createElement(E.sA,{id:"DEVICE_SET_REPLACEMENT_DEVICE"})),t?null:r.createElement(G.A,{messageId:"DEVICE_SET_REPLACEMENT_DEVICE_DESCRIPTION",variant:"outline"}))))},U=(0,r.memo)(({model:e,type:t,...n})=>(0,o.G)({type:t,model:e})?r.createElement(Y,{type:t,model:e,...n}):null)},252093:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(296540),r=n(271856),l=n(162420),c=n(699784);const i=({messageId:e,tooltipClassName:t,values:n,isInteractive:i,portal:o,variant:s="twoTone",size:E="medium"})=>a.createElement(r.A,{description:a.createElement(c.sA,{id:e,values:n}),width:210,isInteractive:i,portal:o,tooltipClassName:t},a.createElement(l.A,{isActive:!0,omitSvgMargin:!0,variant:s,size:E}))},264963:(e,t,n)=>{n.d(t,{X2:()=>u,lX:()=>m,uC:()=>A});var a=n(516693),r=n(691189),l=n(742920),c=n(887831);const i="/v2/api/site/{site}/device/:mac:",o=`${i}/replacement-candidates`,s=`${i}/replace?replacementDeviceMac=:replacement-mac:`,E=`${i}/replace`,m=(e={},t={})=>(0,r.Kd)("replacementCandidates",`${o.replace(":mac:",e.queryParams?.mac)}`,e.queryParams?.mac,e,{...t,idField:"mac"}),A=(e,t)=>n=>n((0,r.vB)(a.aC,null,null,c.A.POST,s.replace(":mac:",e).replace(":replacement-mac:",t),{},null,{})),u=e=>t=>t((0,r.vB)(a.aC,null,null,c.A.DELETE,E.replace(":mac:",e),{},null,{failureToast:()=>({icon:l.C.danger,message:"COMMON_UNKNOWN_ERROR"})}))},284428:(e,t,n)=>{n.d(t,{Im:()=>o,iL:()=>s,mQ:()=>c,pv:()=>l,q:()=>i});var a=n(296540),r=n(451449);function l(){return(0,a.useContext)(r.I)}function c(){return l().fields}function i(){return l().tooltipPopovers}function o(){return l().tooltipIcons}function s(){return l().labels}},328787:(e,t,n)=>{n.d(t,{A:()=>A});var a=n(469733),r=n(296540),l=n(149133),c=n(855019),i=n(551753),o=n(699784),s=n(532419),E=n(765562);const m=({adopted:e})=>r.createElement(i.A,{link:E.A.virtualNetworkConnectivity},r.createElement(o.sA,{id:e?"DEVICE_FALLBACK_IP_ADOPTED_WITH_UNIFI_GATEWAY_WARNING":"DEVICE_FALLBACK_IP_NOT_ADOPTED_WARNING",values:{bold:r.createElement("strong",null,r.createElement(o.sA,{id:e?"DEVICE_WARNING_FALLBACK_IP":"DEVICE_WARNING_ADOPTION_FAILED"}))}})),A=({ip:e,adopted:t,config_network:n})=>(0,a.useSelector)(s.m9)&&(0,l.W5)(e)&&n?.type===c.NL.DHCP?r.createElement(m,{adopted:t}):null},362412:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(469733),r=n(296540),l=n(436331),c=n(805837),i=n(282556),o=n(71265);const s=e=>r.createElement(l.A,{renderOption:c.q,...e}),E=e=>r.createElement(s,{...e});E.Sorted=e=>{const t=(0,a.useSelector)(i.zi),n=(0,r.useMemo)(()=>(0,o.k)(t),[t]);return r.createElement(s,{...e,sortBy:n})};const m=E},400261:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(546391);const r=e=>e?e.replace(a.SD,"").replace(a.fA,"$&:").substring(0,17).toLowerCase():e},421130:(e,t,n)=>{n.d(t,{G:()=>i});var a=n(780811),r=n(768195);const l=[r.bq.USW,r.bq.UAP],c=[r.W4.UDBA69F],i=({type:e,model:t})=>(l.includes(e)||c.includes(t))&&!(0,a.tNJ)({model:t})},451449:(e,t,n)=>{n.d(t,{I:()=>a});const a=(0,n(296540).createContext)({fields:!1,labels:!1,tooltipPopovers:!1,tooltipIcons:!1})},551753:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(296540),r=n(758649),l=n(217439),c=n(162420),i=n(823858),o=n(793336),s=n(998837),E=n(46119),m=n(699784),A=n(224948),u=n(294303);const d=(0,a.memo)(({children:e,customIcon:t,link:n,nested:d,extra:_,variant:p="warning",...C})=>{const{motifPalette:{warning:I,danger:N}}=(0,s.u)(),T=(0,a.useMemo)(()=>{switch(p){case"warning":return a.createElement(i.A,{size:"original",color:I,variant:"fill"});case"info":return a.createElement(c.A,{isActive:!0,size:"original",variant:"fill"});case"custom":return t;default:return a.createElement(o.A,{size:"medium",color:N,variant:"fill"})}},[p,I,N,t]),v=(0,a.useCallback)(()=>{E.A.open(n)},[n]);return a.createElement(A.A,{icon:T,nested:d,...C},a.createElement(u.A,{flexDirection:"column",alignItems:"flex-start"},a.createElement(l.A,null,e),a.createElement(l.A,null,n?a.createElement(r.A,{type:"button",variant:"inline",onClick:v},a.createElement(m.sA,{id:"COMMON_LEARN_MORE"})):null),_))})},635740:(e,t,n)=>{var a,r;n.d(t,{A:()=>a,X:()=>r}),function(e){e.DEFAULT="default",e.IN_PROGRESS="inProgress",e.READY="ready",e.DOWNLOADING="downloading",e.STOPPING="stopping"}(a||(a={})),function(e){e.AP="ap",e.GATEWAY="gateway"}(r||(r={}))},666889:(e,t,n)=>{n.d(t,{ar:()=>O,ax:()=>D,r8:()=>P});var a=n(801081),r=n(189601),l=n(513180),c=n(573531),i=n(938325),o=n(477544),s=n(339879),E=n(524936),m=n(233187),A=n(366188),u=n(535657),d=n(615720),_=n(532419),p=n(180830),C=n(635740);const I=[m.rR.CORPORATE,m.rR.GUEST],N=e=>void 0===e||e,T=({_id:e,name:t,enabled:n,ip_subnet:a,ipv6_subnet:r,wan_networkgroup:l,vpn_type:i,purpose:o,l2tp_interface:s,openvpn_interface:m,wireguard_interface:A,ipsec_interface:d,sdwan_hub_spoke_local_wan_id:_},p)=>({_id:e,enabled:N(n),name:t||c.L,ip_subnet:p?c.L:(0,E.Qe)({ip_subnet:a,ipv6_subnet:r},u.L),wan_networkgroup:l,vpn_type:i,ipsec_interface:d,l2tp_interface:s,openvpn_interface:m,purpose:o,sdwan_hub_spoke_local_wan_id:_,wireguard_interface:A}),v=(e,t)=>e?e===l.C.WAN?t.wan1:t[e.toLocaleLowerCase()]||{}:{},M=e=>(0,a.Mz)(A.Ct,o.Ag,(0,p.a5)(e),_.fq,_.Dx,(e,t,n,a,r)=>{const l=t.reduce((e,{enabled:t,networkconf_id:a,ap_group_ids:r=[]})=>(t&&n.some(({_id:e})=>r.includes(e))&&e.push(a),e),[]);return e.reduce((e,t)=>(d.A.includes(t.purpose)&&l.includes(t._id)&&e.push(T(t,(0,i.cH)({gateway_device:t.gateway_device,purpose:t.purpose},a,r))),e),[])}),g=(0,r.WY)()((0,a.Mz)(A.Ct,_.U$,s.$D,_.AL,(e,t,n,a)=>{const r=e.reduce((e,n)=>(n&&t.network_table?.some(({_id:e})=>e===n._id)&&N(n.enabled)&&n.gateway_type!==m.xk.SWITCH&&I.includes(n.purpose)&&e.push(T(n)),e),[]),c=e.reduce((e,t)=>((0,E._L)(t)&&N(t.enabled)&&e.push(T(t)),e),[]);return[...r,...n.reduce((e,{configuration:n={}})=>{if((({purpose:e,wan_networkgroup:t},n)=>{if(e!==m.rR.WAN)return!1;if(t===l.C.WAN_LTE_FAILOVER)return!0;const a=v(t,n);return!!a?.up})(n,t)){let r;if(n.wan_networkgroup===l.C.WAN_LTE_FAILOVER)r=a?.lte_ip;else{const e=v(n.wan_networkgroup,t);r=e?.ip}e.push({...T(n),...r?{ip_subnet:r}:{}})}return e},[]),...c]}),e=>e),O=(0,r.WY)()((0,a.Mz)(g,e=>Boolean(e.length)),e=>e),D=(e,t)=>{switch(t){case C.X.AP:return M(e);case C.X.GATEWAY:return g;default:return()=>[]}},P=e=>(0,a.Mz)(o.Ag,t=>{const n=t.filter(t=>t.networkconf_id===e);return[...new Set(n.flatMap(e=>e.wlan_bands))]})},686130:(e,t,n)=>{n.d(t,{A:()=>y});var a=n(469733),r=n(296540),l=n(592510),c=n(860631),i=n(666889),o=n(635740),s=n(745667),E=n(634229),m=n(602021),A=n(776288),u=n(718073),d=n(71479),_=n(369702),p=n(699784),C=n(780811),I=n(837612),N=n(602197);const T=(0,d.A)("span")`
  width: 100%;
`,v=({activeItem:e,captureDeviceType:t,onClick:n,...a})=>{const l=(e=>{const t=(0,I.S9)(e);return e.disabled||t!==N.g.CONNECTED||!(0,C.sc7)(t)?"DEVICE_PCAP_DISABLED_TOOLTIP":null})(e)||a.disabledWithReason;return r.createElement(u.A,{description:l?r.createElement(p.sA,{id:l}):void 0},r.createElement(T,null,r.createElement(_.A,{onClick:n,isDisabled:!!l,width:"full"},r.createElement(p.sA,{id:"COMMON_PACKET_CAPTURE"}))))};var M=n(845030),g=n(398300),O=n(683086),D=n(132196),P=n(566723),R=n(294303);const S=D.AH`
  &:empty {
    display: none;
  }
`,b=(0,d.A)("div")`
  flex: 1 1 0;
  min-width: 33%;
  box-sizing: border-box;
  padding-right: ${P.kc};

  &:last-child {
    padding-right: 0;
  }
`,w=({children:e,...t})=>r.createElement(R.A,{marginTop:P.kc,className:S,...t},r.Children.map(e,e=>e?r.createElement(b,{className:S},e):null)),y=({activeItem:e,showPortsButton:t,showCaptureButton:n})=>{const u=(0,a.useDispatch)(),d=(0,a.useSelector)(m.vc),_=(0,a.useSelector)(i.ar),p=n&&d===e.mac&&_&&(0,c.W4)(e,A.A.PCAP),C=t&&e.port_table?.length>0;(0,r.useEffect)(()=>{u((0,E.Sk)(void 0,{crudCacheStrategy:{type:l.e.CACHE}})),u((0,s.hh)(void 0,{crudCacheStrategy:{type:l.e.CACHE}}))},[u]);const I=(0,r.useCallback)(()=>{u((0,M.XP)({type:g.H.PACKET_CAPTURE,id:e.mac,customData:{captureDeviceType:o.X.GATEWAY}}))},[u,e.mac]);return r.createElement(r.Fragment,null,r.createElement(w,null,C?r.createElement(O.A,{mac:e.mac}):null,p?r.createElement(v,{activeItem:e,captureDeviceType:o.X.GATEWAY,onClick:I}):null))}},766624:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(296540),r=n(271856),l=n(709690),c=n(284428),i=n(566723);const o=({description:e,isInteractive:t,portal:n=!0,cursorType:o,title:s,position:E,width:m,iconProps:A,disabled:u=!1})=>{const d=(0,c.Im)()||u,_=(0,c.q)();return a.createElement(r.A,{description:e,portal:n,isInteractive:t,style:{display:"flex",alignItems:"center"},cursorType:o,title:s,position:E,width:m,disableHover:_},a.createElement(l.A,{isActive:!0,size:"original",opacity:d?i.xN:void 0,...A}))}},772317:(e,t,n)=>{n.d(t,{A:()=>D});var a,r=n(592563),l=n(296540),c=n(469733),i=n(217439),o=n(187483),s=n(699784),E=n(689965),m=n(86571),A=n(801081);!function(e){e.OPEN_MODAL="openModal"}(a||(a={}));const u=(0,A.Mz)(o.zn,e=>void 0!==e[a.OPEN_MODAL]);var d=n(523275),_=n(840279),p=n(919952);const C=e=>e[p.U.UIDB]||(0,d.A)(),I=(0,A.Mz)(C,({version:e})=>Boolean(e)),N=(0,A.Mz)(C,({devices:e})=>e||(0,_.A)());var T=n(765562),v=n(79871);const M=()=>{const e=(0,c.useDispatch)(),t=(0,c.useSelector)(I);return(0,l.useEffect)(()=>{t||(async()=>{const t=await fetch(T.A.fingerprintPublicDatabasePath),n=await t.json();e((0,v.$)(n))})()},[t,e]),t},g=({uidbDevice:e})=>{const t=(0,c.useSelector)(o.zn),n=t?.[a.OPEN_MODAL];return n?l.createElement(r.A,{onClick:()=>n(e)},l.createElement(i.A,{size:"medium",color:"inherit"},l.createElement(s.sA,{id:"DEVICE_SHOW_DETAILS"}))):null},O=({shortname:e})=>{const t=(0,c.useSelector)((e=>(0,A.Mz)(N,t=>t.find(t=>t.shortnames?.includes(e))||(0,d.A)()))(e));return M(),t?.compliance?l.createElement(E.A,{type:E.I.ACCORDION,items:[{id:"compliance",label:l.createElement(m.A,{id:"COMMON_COMPLIANCE"}),renderContent:()=>l.createElement(g,{uidbDevice:t}),openByDefault:!0}]}):null},D=({shortname:e})=>(0,c.useSelector)(u)?l.createElement(O,{shortname:e}):null},776288:(e,t,n)=>{n.d(t,{A:()=>a});const a={PCAP:4194304,HWOFFLOAD_QOS_AND_SMART_QUEUE:2147483648,SUPPORT_FILE:65536}}}]);