"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[86304],{243322(e,t,a){a.d(t,{A:()=>l});var n=a(217439);const l=(0,a(71479).A)(n.A)`
  white-space: nowrap;
`},553432(e,t,a){a.d(t,{A:()=>c});var n=a(296540),l=a(454195),i=a(566723),r=a(294303);const c=e=>n.createElement(r.A,{paddingTop:i.YC,paddingBottom:i.YC,gap:i.Ln,rowGap:i.YC,flexWrap:"wrap",minHeight:l.b,alignItems:"center",...e})},186304(e,t,a){a.r(t),a.d(t,{default:()=>Z});var n=a(296540),l=a(469733),i=a(54227),r=a(48598),c=a(314714),o=a(217439),s=a(132196),d=a(6510),E=a(742920),m=a(96512),u=a(860631),_=a(566723),A=a(252093),O=a(281884),p=a(129361),C=a(515219),h=a(553432),N=a(294303),v=a(876250),g=a(126457),D=a(916537),I=a(564985),b=a(302167),f=a(780811),T=a(768195),k=a(532419),S=a(171073),L=a(213583),M=a(349107),R=a(6176),x=a(765562),w=a(892145),y=a(261847),H=a(985370);const G=({searchText:e,setSearchText:t})=>{const a=(0,n.useCallback)((e,a)=>{t((0,y.Zx)(a.toLowerCase()))},[t]),l=(0,n.useCallback)(()=>{t("")},[t]);return n.createElement(w.A,{iconBefore:n.createElement(H.A,{size:"small"}),full:!0,onChange:a,onClear:l,value:e,variant:"secondary",placeholder:(0,D.tz)().formatMessage({id:"COMMON_SEARCH"}),keepRefOnClear:!0})};var V=a(822336),B=a(617147),F=a(71479),U=a(311785);const P=(0,F.A)(B.A,(0,U.A)("haveOptions"))`
  width: 460px;
  ${({haveOptions:e})=>e?"min-height: 200px;":""}
`,W=(0,F.A)("div")`
  padding: ${_.kc} ${_.kc} 0 ${_.kc};
  border-radius: ${V.Ay["desktop-radius-base"]};
  border: 1px solid ${({theme:{themeName:e}})=>V.Ay[`desktop-color-neutral-03-${e}`]};
`,$=s.AH`
  padding-left: 0;
`,z=s.AH`
  overflow-y: auto;
  height: 100%;
  min-height: 150px;
  max-height: 275px;
  padding: ${_.kc} 0 0 0;
`,Z=(0,n.memo)(({activeMacs:e})=>{const[t,a]=(0,n.useState)(e),s=(0,l.useDispatch)(),w=(0,m.I)(),y=(0,l.useSelector)(b.ZZ),H=y===L.A.US.numericCode,V=y===L.A.CA.numericCode,B=(0,l.useSelector)((0,k.nH)(t)).filter(e=>(0,f.ioy)(e)&&(0,u.X5)(e,y)),F=B.filter(e=>(0,f.KKO)(e.model,"outdoorModeSupport")),U=1===B.length||1===F.length,Z=F?.[0],K=U&&Z&&(0,f.KKO)(Z?.model,"outdoorModeSupport"),Y=U&&B?.[0]&&(0,f.J2F)(B[0]),X=U&&Z&&!((0,f.ERA)(Z)||(0,f.Ume)(Z)),[J,q]=(0,n.useState)(""),[Q,j]=(0,n.useState)(1===B.length?t:[]),[ee,te]=(0,n.useState)(!1),[ae,ne]=(0,n.useState)(!1),[le,ie]=(0,n.useState)(!1),[re,ce]=(0,n.useState)(K?T.Dd.OUTDOOR:T.Dd.INDOOR),oe=(e=>e.filter(({mac:e})=>Boolean(e)).map(({model:e,mac:t})=>({label:(0,d.Lm)(e),value:t,image:n.createElement(N.A,{maxWidth:20,maxHeight:20},n.createElement(R.A,{model:e,width:20,height:20})),additionalInfo:t})))(F.length?F:B),se=(0,n.useMemo)(()=>((e,t)=>e.filter(e=>"string"==typeof e.value&&e?.value&&e.value.toLowerCase()?.includes(t)||e.label.toLowerCase()?.includes(t)))(oe,J),[oe,J]);(0,n.useEffect)(()=>{ce(K?T.Dd.OUTDOOR:T.Dd.INDOOR)},[K]);const de=(0,n.useCallback)(()=>{s((0,g.AS)())},[s]),Ee=(0,n.useCallback)(()=>{const e=se.map(({value:e})=>e);if(ee){const t=[...Q];j(t.filter(t=>!e.includes(t)))}else j([...new Set([...Q,...e])])},[ee,se,Q]),me=(0,n.useCallback)((e,{value:t})=>{const a=Q.includes(t);j(a?Q.filter(e=>e!==t):[...Q,t])},[Q]),ue=(0,n.useCallback)(()=>{ne(!0);const e=[];B.forEach(t=>{if(!Q.includes(t.mac))return;const a=(0,f.KKO)(t?.model,"outdoorModeSupport"),n=(0,u.X5)(t,y)?{afc_enabled:!0}:{},l=!a||re!==T.Dd.OUTDOOR&&U?{outdoor_mode_override:T.Gi.OFF}:{outdoor_mode_override:T.Gi.ON},i={radio_table:[]};t?.radio_table.forEach(e=>{const t={radio:e.radio,name:e.name};i.radio_table.push(e.radio===I.sx.RADIO_6E&&e?.tx_power_mode===I.PB.DISABLED?{...t,tx_power_mode:I.PB.AUTO}:t)}),e.push(s((0,S.ex)({...n,...l,...i},t._id,t.mac,{failureToast:{icon:E.C.danger,message:"COMMON_AFC_ENABLING_ERROR_TOAST"},mergeAndOverrideKeys:["radio_table"],extend:!0})))}),Promise.all(e).catch(w).finally(()=>{ne(!1),de()})},[Q,w,B,y,re,s,de,U]),_e=(0,n.useMemo)(()=>{const e=[];e.push(U?{type:"button",variant:"link",target:"_blank",text:n.createElement(D.sA,{id:"COMMON_LEARN_MORE"}),href:x.A.afcArticle,className:$}:{type:"button",variant:"link",text:n.createElement(c.A,{checked:ee,id:"isSelectAllChecked",onChange:()=>te(!ee)},n.createElement(D.sA,{id:"COMMON_ACTION_SELECT_ALL"}),` (${se.length})`),onClick:Ee,className:$});const t=[[{type:"button",text:n.createElement(D.sA,{id:"COMMON_ACTION_CANCEL"}),autoFocus:!1,onClick:de},{type:"button",variant:"primary",text:n.createElement(D.sA,{id:"COMMON_ACTION_SAVE"}),autoFocus:!0,onClick:ue,disabled:0===Q.length||!le,loader:ae?"loading":void 0}]];return[...e,...t]},[U,de,ue,Q.length,le,ae,ee,se.length,Ee]),Ae=(0,n.useMemo)(()=>H?"DEVICE_ENABLE_AFC_MODAL_HEADER_US":V?"DEVICE_ENABLE_AFC_MODAL_HEADER_CA":"DEVICE_EXTEND_6GHZ_RANGE",[H,V]);return(0,n.useEffect)(()=>{var e;te((e=Q,se.every(t=>e.includes(t.value))))},[se,Q]),(0,n.useEffect)(()=>{1===B.length&&0===Q.length&&j(t)},[t,B.length,Q.length]),(0,n.useEffect)(()=>{if(1===e.length&&!t.includes(e[0])){const n=[...new Set([...t,...e])];a(n),j(n)}},[e,t]),n.createElement(P,{title:n.createElement(D.sA,{id:!K&&U?Ae:"DEVICE_ENABLE_6GHZ"}),isOpen:B.length>0,shouldCloseOnOverlayClick:!1,onRequestClose:de,actions:_e,haveOptions:!!oe.length},n.createElement(N.A,{flexDirection:"column",gap:_.kc},U?n.createElement(N.A,{flexDirection:"column",alignItems:"center"},n.createElement(R.A,{model:B[0].model,width:120,height:120,size:v.Xh.LARGE}),n.createElement(N.A,{alignItems:"center",gap:_.YC},n.createElement(o.A,{size:"medium",variant:"body-primary",weight:"bold"},(0,d.Q)(B[0])),n.createElement(o.A,{size:"medium",variant:"body-primary"},(0,d.oT)(B[0]))),B[0]?.uplink?.uplink_device_name?n.createElement(N.A,{alignItems:"center"},n.createElement(p.A,{activeItem:B[0],connectionStatus:(0,O.H)(B[0].deviceState,B[0].uplink.type)})):null):null,U&&K&&X?n.createElement(h.A,null,[T.Dd.INDOOR,T.Dd.OUTDOOR].map(e=>n.createElement(i.A,{key:e,id:e,value:e,checked:re===e,onChange:()=>ce(e)},n.createElement(N.A,{alignItems:"center",gap:_.YC},n.createElement(D.sA,{id:C.J[e]}),e===T.Dd.OUTDOOR?n.createElement(A.A,{messageId:Y?"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR_6GHZ_TOOLTIP":"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR_TOOLTIP",values:{link:n.createElement(M.A,{id:"COMMON_LEARN_MORE",href:x.A.afcArticle})},variant:"outline",isInteractive:!0,portal:!0}):null)))):null,U?null:n.createElement(W,null,n.createElement(G,{searchText:J,setSearchText:q}),n.createElement(r.A,{options:se,handleOptionChange:me,isChecked:e=>Q.includes(e.value),isDisabled:()=>!1,within:"popover",createOptionText:()=>null,handleCreateOption:()=>null,searchValue:J,showCreateOption:!1,isWindowed:!0,className:z})),n.createElement(N.A,{flexDirection:"column"},n.createElement(c.A,{id:"tos_agreement",checked:le,onChange:()=>ie(!le)},n.createElement(o.A,{size:"medium",variant:"body-primary"},n.createElement(D.sA,{id:K?"DEVICE_ENABLE_6GHZ":V?"DEVICE_ENABLE_AFC_MODAL_HEADER_CA":"DEVICE_EXTEND_6GHZ_RANGE",values:{link:n.createElement(M.A,{noWrap:!0,id:"COMMON_TOS",href:x.A.termsOfServiceUrl})}}),n.createElement("br",null),n.createElement(D.sA,{id:K?"DEVICE_ENABLE_6GHZ_TOS_AGREE":V?"DEVICE_INCREASE_SPECTRUM_INDOOR_TOS_AGREE":"DEVICE_ENABLE_EXTEND_6GHZ_RANGE_TOS_AGREE",values:{link:n.createElement(M.A,{noWrap:!0,id:"COMMON_TOS",href:x.A.termsOfServiceUrl})}}))))))})},515219(e,t,a){a.d(t,{J:()=>l});var n=a(768195);const l={[n.Dd.INDOOR]:"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_INDOOR",[n.Dd.OUTDOOR]:"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR"}},94313(e,t,a){a.d(t,{A:()=>_});var n=a(296540),l=a(71479),i=a(132196),r=a(311785),c=a(916537),o=a(566723),s=a(294303),d=a(243322);const E=(0,l.A)(s.A,(0,r.A)("alignLeft"))`
  ${({alignLeft:e})=>e?"max-width: 288px;":"max-width: 100%; justify-content: center;"}
  gap: ${o.YC};
  align-items: center;
`,m=i.AH`
  max-width: 50%;
`,u=i.AH`
  flex: 0 1 auto;
  min-width: 0;
`,_=({messageId:e,messageValues:t,buttonEl:a,alignLeft:l=!0,color:i="text-3",variant:r="body-primary"})=>n.createElement(E,{alignLeft:l},n.createElement(d.A,{variant:r,color:i},t?n.createElement(s.A,{maxWidth:288,whiteSpace:"nowrap",paddingRight:o.YC},n.createElement(c.sA,{id:e,values:t})):n.createElement(c.sA,{id:e})),a?n.createElement(s.A,{className:l?u:m},a):null)},532988(e,t,a){a.d(t,{A:()=>C});var n=a(469733),l=a(296540),i=a(217439),r=a(968906),c=a(90757),o=a(566723),s=a(294303),d=a(398300),E=a(623771),m=a(845030),u=a(916537),_=a(532419),A=a(413146),O=a(94313),p=a(932752);const C=({last_uplink_mac:e,last_uplink_name:t,last_uplink_remote_port:a,disconnected_at:C,disabled:h,separatePortNumber:N,maxWidth:v})=>{const{formatMessage:g}=(0,u.tz)(),D=(0,n.useDispatch)(),I=(0,n.useSelector)(_.CC),b=(0,p.Z)(e,I),f=(0,p.z)(t,a,b,g,N),T=(0,l.useCallback)(()=>{h||D((0,m.XP)({type:d.H.DEVICE,id:e}))},[h,D,e]);return l.createElement(l.Fragment,null,b?l.createElement(O.A,{messageId:"COMMON_DEVICE_LAST_CONNECTED_TO",messageValues:{deviceWithPort:l.createElement(s.A,{width:"100%",overflow:"hidden",paddingLeft:o.YC},l.createElement(E.A,{onClick:T,disabled:h,...r.A.addDataTestId(r.A.TestId.SIDE_PANEL_TRIGGER),name:f,port:a,separatePortNumber:N,maxWidth:v}))}}):null,C?l.createElement("div",null,l.createElement(i.A,{color:"text-3"},l.createElement(A.A,{date:(0,c.gH)(C)}))):null)}},932752(e,t,a){a.d(t,{Z:()=>l,z:()=>i});var n=a(6510);const l=(e,t)=>e?t.find(({mac:t})=>t===e):void 0,i=(e,t,a,l,i)=>{const r=!i&&t?` ${l({id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER"},{port:t})}`:"";return e?`${e}${r}`:a?`${(0,n.Q)(a)}${r}`:l({id:"COMMON_FALLBACK"})}},708019(e,t,a){a.d(t,{A:()=>o});var n=a(296540),l=a(370969),i=a(780811),r=a(94313),c=a(762334);const o=({type:e,name:t,mac:a,uplink:o,state:s,model:d,disabled:E,alignLeft:m})=>(0,c.n)(s,o)?n.createElement(r.A,{messageId:(0,i.E4T)({model:d})?"COMMON_CONNECTED_TO":"DEVICE_MESHING_TO",alignLeft:m,buttonEl:n.createElement(l.E,{device:{type:e,name:t,mac:a,uplink:o},size:"medium",disabled:E})}):null},762334(e,t,a){a.d(t,{n:()=>c});var n=a(469733),l=a(602197),i=a(532419),r=a(211368);const c=(e,t)=>{const a=(0,n.useSelector)(i.CC),c=t.uplink_mac?a.find(({mac:e})=>e===t.uplink_mac):void 0,o=Boolean(t.signal);return r.q[e]===l.g.CONNECTED&&c&&o?c:void 0}},252093(e,t,a){a.d(t,{A:()=>c});var n=a(296540),l=a(271856),i=a(162420),r=a(916537);const c=({messageId:e,tooltipClassName:t,values:a,isInteractive:c,portal:o,variant:s="twoTone",size:d="medium"})=>n.createElement(l.A,{description:n.createElement(r.sA,{id:e,values:a}),width:210,isInteractive:c,portal:o,tooltipClassName:t},n.createElement(i.A,{isActive:!0,omitSvgMargin:!0,variant:s,size:d}))},129361(e,t,a){a.d(t,{A:()=>d});var n=a(296540),l=a(708019),i=a(392699),r=a(532988),c=a(370969),o=a(94313);const s=({type:e,name:t,mac:a,uplink:l,disabled:i,maxWidth:r,peer_ubb:s,deviceState:d,ubb_pairing_state:E})=>n.createElement(o.A,{messageId:"COMMON_CONNECTED_TO",buttonEl:n.createElement(c.E,{device:{type:e,name:t,mac:a,uplink:l,peer_ubb:s,deviceState:d,ubb_pairing_state:E},maxWidth:r,disabled:i,separatePortNumber:!0})}),d=({connectionStatus:e,activeItem:{type:t,last_uplink:a,uplink:c,state:o,name:d,mac:E,model:m,disconnected_at:u,peer_ubb:_,deviceState:A,ubb_pairing_state:O},disabled:p,uplinkNameMaxWidth:C=195})=>{switch(e){case i.v.OFFLINE:return n.createElement(r.A,{last_uplink_mac:a?.uplink_mac,last_uplink_name:a?.uplink_device_name,last_uplink_remote_port:a?.uplink_remote_port,disconnected_at:u,disabled:p,separatePortNumber:!0,maxWidth:C});case i.v.MESHING:return n.createElement(l.A,{type:t,name:d,model:m,mac:E,uplink:c,state:o,disabled:p});case i.v.CONNECTED:return n.createElement(s,{type:t,name:d,mac:E,uplink:c,disabled:p,maxWidth:C,peer_ubb:_,deviceState:A,ubb_pairing_state:O});default:return null}}},392699(e,t,a){var n;a.d(t,{v:()=>n}),function(e){e.OFFLINE="offline",e.MESHING="meshing",e.CONNECTED_INTERRUPTED="connected-interrupted",e.CONNECTED="connected"}(n||(n={}))},281884(e,t,a){a.d(t,{H:()=>r});var n=a(780811),l=a(768195),i=a(392699);const r=(e,t)=>(0,n.aK8)(e)?i.v.OFFLINE:t===l.au.WIRELESS?i.v.MESHING:i.v.CONNECTED}}]);