"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[78394,89965],{23582:(e,t,n)=>{n.d(t,{A:()=>A});var r,a=n(469733),o=n(296540),l=n(525512),i=n(687573),s=n(648092),c=n(523275),E=n(874807),d=n(906593),u=n(434008);!function(e){e.TYPE="type",e.SUBSCRIPTION="subscription",e.ENABLED="enabled",e.META="meta"}(r||(r={}));const m=(e,t,n)=>({[r.TYPE]:u.uw.SUBSCRIBE,[r.SUBSCRIPTION]:e,[r.ENABLED]:t,[r.META]:n}),A=(e,t=E.P1,n=(0,c.A)(),r=!1)=>{const u=(0,a.useDispatch)(),A=(0,o.useMemo)(()=>JSON.stringify(n),[n]),I=(0,a.useSelector)(s.a),C=(0,o.useMemo)(()=>[I[d.Uz],...r?[I[d.o4]]:[]].filter(Boolean),[I,r]),p=(0,o.useCallback)(e=>(0,l.K6)(e,t),[t]),S=(0,o.useCallback)(e=>{(0,l.$N)(e)},[]);(0,o.useEffect)(()=>(C.forEach(t=>{t.send(m(e,!0,JSON.parse(A)))}),()=>{C.forEach(t=>{t.send(m(e,!1,JSON.parse(A)))})}),[u,e,A,C]),(0,o.useEffect)(()=>{const t=i._[e].map(p);return()=>{t.forEach(S)}},[u,e,p,S])}},83604:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(296540),a=n(795342);const o=e=>r.createElement(a.A,{...e})},88502:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(469733),a=n(23582),o=n(413914),l=n(624489),i=n(897254);const s=()=>{const e=(0,r.useSelector)(l.V);(0,a.A)(o.E.DASHBOARD,void 0,(e=>({history_seconds:e[i.GB.HISTORY_SECONDS]}))(e))}},143748:(e,t,n)=>{n.d(t,{A:()=>m});var r=n(296540),a=n(888170),o=n(509796),l=n(125832);const i=16.5,s=.5,c=32,E=32;const d=(0,n(722860).c)(l.A);function u({motif:e="light",parent:t,expanded:n,child:l,hideLines:u,lastChild:m,rowHeight:A=E,onClick:I,position:C}){const p={width:"32px",height:1},S=a.Ay.motifs[e].neutral04;if(t)return r.createElement(o.A,{className:d("hierarchyGlyphIcon"),value:n?"minus":"plus",motif:e,isExpanded:n,onClick:I});if(u)return null;if((m||l)&&"top"===C){const e=A/2;return r.createElement("svg",{...p,height:e+s},r.createElement("line",{stroke:S,strokeWidth:1,x1:i,y1:s,x2:i,y2:e}),r.createElement("line",{stroke:S,strokeWidth:1,x1:i,y1:e,x2:c,y2:e}))}return m||l?r.createElement("svg",{...p},r.createElement("line",{stroke:S,strokeWidth:1,x1:"15.5",y1:"0.5",x2:"32",y2:"0.5"})):null}function m(e){const{className:t="",motif:n="light",hideCellBorder:a,tag:o="td",lastChild:l,expanded:i,parent:s,position:c="center",hideLines:E,...m}=e;return r.createElement(o,{className:d.concat(t)(!a&&"borderedCell",!a&&`borderedCell-${n}`,"hierarchyGlyph",`hierarchyGlyph-${n}`,i&&!E&&"hierarchyGlyph-expanded",l&&"hierarchyGlyph-lastChild",s&&"hierarchyGlyph-parent","top"===c&&"top")},r.createElement(u,{motif:n,lastChild:l,expanded:i,parent:s,position:c,...m}))}m.defaultProps={child:!1,lastChild:!1,expanded:!1,parent:!1,hideLines:!1,hideCellBorder:!1,motif:"light"}},212178:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(296540);const a=e=>{const t=(0,r.useRef)();return(0,r.useEffect)(()=>{t.current=e},[e]),t.current}},306644:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(296540),a=n(629318);const o=(0,n(51946).w)(e=>(0,r.createElement)("svg",(0,a.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,r.createElement)("path",{d:"M15 12a.498.498 0 0 0-.16-.366L10.7 7.785a1.001 1.001 0 0 0-1.4 0l-4.14 3.848a.5.5 0 0 0 .68.733L10 8.5l.013.013 4.147 3.853A.5.5 0 0 0 15 12Z",fill:"currentColor",className:e.baseclassname}),(0,r.createElement)("path",{d:"M15.25 12a.75.75 0 0 0-.239-.55l-4.139-3.846a1.25 1.25 0 0 0-1.744 0L4.99 11.45a.75.75 0 0 0 1.021 1.099L10 8.84l3.989 3.708a.75.75 0 0 0 1.261-.55Z",fill:"currentColor",className:e.fillclassname})))},525512:(e,t,n)=>{n.d(t,{$N:()=>i,K6:()=>l,WM:()=>o});var r=n(300477);const a={},o=()=>a,l=(e,t,n=!1,o=null)=>{const l=o||(0,r.A)();return a[l]||(a[l]={eventKeys:Array.isArray(e)?e:[e],id:l,action:t,forSuperSite:n}),l},i=e=>{delete a[e]}},528745:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ve});var r=n(296540),a=n(689965),o=n(930005),l=n(88502),i=n(71479),s=n(294303),c=n(566723);const E=(0,i.A)(s.A)`
  flex-direction: column;
  gap: ${c.Ln};
`;var d=n(217439),u=n(699784);const m=(0,i.A)(s.A)`
  flex-direction: column;
  gap: ${c.YC};
`,A=e=>e.some(({[o.Me.OPTIMIZATION_STATUS]:e})=>e===o.CK.IN_PROGRESS),I=e=>e.every(({[o.Me.OPTIMIZATION_STATUS]:e})=>e===o.CK.COMPLETED),C=(0,r.memo)(({[o.Ss.ACTIONS]:e})=>{const t=(0,r.useMemo)(()=>I(e),[e]);return r.createElement(m,null,r.createElement(d.A,{weight:"bold",size:"medium",color:"text-1"},r.createElement(u.sA,{id:t?"DASHBOARD_WIFI_OPTIMIZATION_COMPLETE":"DASHBOARD_WIFI_OPTIMIZATION_AVAILABLE"})),r.createElement(d.A,{size:"medium",color:"text-3"},r.createElement(u.sA,{id:t?"DASHBOARD_RECOMMENDED_OPTIMIZATIONS_APPLIED":"DASHBOARD_RECOMMENDED_OPTIMIZATIONS"}),t?"":":"))}),p=(0,i.A)(s.A)`
  flex-direction: column;
  gap: ${c.kc};
`;var S=n(998837),O=n(822336),D=n(247016),N=n(629318);const h=(0,n(51946).w)(e=>(0,r.createElement)("svg",(0,N.d)({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.495 2.427a.5.5 0 0 0-.983-.035L8.909 14.103 6.876 7.845a.5.5 0 0 0-.943-.024L4.526 11.5H2.5a.5.5 0 0 0 0 1h2.37a.5.5 0 0 0 .467-.321l1.025-2.68 2.162 6.655a.5.5 0 0 0 .964-.046L11.9 5.253l2.405 16.32a.5.5 0 0 0 .992-.017l1.25-11.056h1.516a2 2 0 1 0 0-1H16.1a.5.5 0 0 0-.497.444l-.868 7.683-2.24-15.2ZM20 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",fill:"currentColor",className:e.baseclassname}),(0,r.createElement)("path",{d:"M20 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",fill:"currentColor",className:e.twotonedclassname}),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.495 2.427a.5.5 0 0 0-.983-.035L8.909 14.103 6.876 7.845a.5.5 0 0 0-.943-.024L4.526 11.5H2.5a.5.5 0 0 0 0 1h2.37a.5.5 0 0 0 .467-.321l1.025-2.68 2.162 6.655a.5.5 0 0 0 .964-.046L11.9 5.253l2.405 16.32a.5.5 0 0 0 .99-.008L16.74 10.5h1.324a2 2 0 1 0 0-1H16.3a.5.5 0 0 0-.496.435l-1.034 7.93-2.275-15.438Z",fill:"currentColor",className:e.fillclassname})));var g=n(793336);const _=(e,t)=>`\n    @keyframes ${e} {\n      ${Array.from({length:100},(e,n)=>`\n      ${2*n}% {\n        background: conic-gradient(\n          from 0deg,\n          ${t} 0deg,\n          ${t} ${2*n*3.6}deg,\n          transparent ${2*n*3.6}deg,\n          transparent 360deg\n        );\n      }`).join("")}\n    }\n    &::before {\n      content: '';\n      position: absolute;\n      inset: -1px;\n      border-radius: ${c.fS};\n      animation: ${e} 1.5s ease-in-out infinite;\n      \n      -webkit-mask: \n        linear-gradient(#fff 0 0) content-box, \n        linear-gradient(#fff 0 0);\n      -webkit-mask-composite: xor;\n      mask: \n        linear-gradient(#fff 0 0) content-box, \n        linear-gradient(#fff 0 0);\n      mask-composite: exclude;\n      padding: 1px;\n      pointer-events: none;\n      z-index: 1;\n    }\n  `,T=(e,t)=>{switch(e){case o.CK.IN_PROGRESS:return O.Ay[`desktop-color-ublue-06-${t}`];case o.CK.FAILED:return O.Ay[`desktop-color-red-06-${t}`];case o.CK.COMPLETED:return O.Ay[`desktop-color-green-06-${t}`];case o.CK.PENDING:default:return O.Ay[`desktop-color-ublue-06-${t}`]}},R=(0,i.A)(s.A,{shouldForwardProp:e=>"optimizationStatus"!==e})`
  width: ${c.S2};
  height: ${c.S2};
  justify-content: center;
  align-items: center;
  border-radius: ${c.fS};
  position: relative;
  ${({optimizationStatus:e,theme:{themeName:t}})=>`\n    background-color: ${((e,t)=>{switch(e){case o.CK.COMPLETED:return O.Ay[`desktop-color-green-01-${t}`];case o.CK.FAILED:return O.Ay[`desktop-color-red-01-${t}`];case o.CK.IN_PROGRESS:case o.CK.PENDING:default:return O.Ay[`desktop-color-ublue-01-${t}`]}})(e,t)};\n    border: 1px solid ${((e,t)=>{switch(e){case o.CK.COMPLETED:return O.Ay[`desktop-color-green-02-${t}`];case o.CK.FAILED:return O.Ay[`desktop-color-red-02-${t}`];case o.CK.IN_PROGRESS:case o.CK.PENDING:default:return O.Ay[`desktop-color-ublue-02-${t}`]}})(e,t)};\n    ${((e,t)=>{switch(e){case o.CK.IN_PROGRESS:return _("optimization",O.Ay[`desktop-color-ublue-06-${t}`]);case o.CK.COMPLETED:case o.CK.PENDING:case o.CK.FAILED:default:return""}})(e,t)}\n  `}
`,M=(0,r.memo)(({[o.Me.OPTIMIZATION_STATUS]:e})=>{const t=(0,r.useMemo)(()=>(e=>{switch(e){case o.CK.IN_PROGRESS:return h;case o.CK.FAILED:return g.A;case o.CK.COMPLETED:return D.A;case o.CK.PENDING:default:return h}})(e),[e]);return r.createElement(R,{optimizationStatus:e},r.createElement(t,{color:T(e,(0,S.u)().themeName),size:"medium"}))}),P=(0,i.A)(s.A)`
  background-color: ${({theme:{themeName:e}})=>O.Ay[`desktop-color-neutral-02-${e}`]};
  border-radius: ${c.kc};
  padding: ${c.kc};
  flex-direction: column;
  gap: ${c.xO};
`,f=(0,i.A)(s.A)`
  justify-content: space-between;
  align-items: center;
`,L=(0,i.A)(s.A)`
  gap: ${c.kc};
  align-items: center;
`;var $=n(240131),k=n(208236),b=n(469733),x=n(83604),K=n(845030),v=n(398300);const y=(0,i.A)(s.A)`
  width: 100%;
  height: 100%;
  flex-direction: column;
  thead {
    background: ${({theme:{themeName:e}})=>O.Ay[`desktop-color-neutral-02-${e}`]};
  }
  max-height: 351px;
  overflow: auto;
`;var B,G,U;!function(e){e.DEVICE="DEVICE",e.VERSION="VERSION"}(B||(B={})),function(e){e.UPGRADABLE_DEVICES_COLUMN="upgradableDevicesColumn"}(G||(G={})),function(e){e.UPGRADABLE_DEVICE="upgradableDevice"}(U||(U={}));const w=({[G.UPGRADABLE_DEVICES_COLUMN]:e})=>r.createElement(u.sA,{id:te[e]}),V=({[G.UPGRADABLE_DEVICES_COLUMN]:e})=>r.createElement(w,{upgradableDevicesColumn:e}),z=({[G.UPGRADABLE_DEVICES_COLUMN]:e})=>r.createElement(w,{upgradableDevicesColumn:e});var Z=n(705145),F=n(6510),W=n(6176);const H=(e,t)=>{switch(e){case o.CK.COMPLETED:return O.Ay[`desktop-color-green-06-${t}`];case o.CK.FAILED:return O.Ay[`desktop-color-red-06-${t}`];case o.CK.IN_PROGRESS:return O.Ay[`desktop-color-ublue-06-${t}`];case o.CK.PENDING:default:return O.Ay[`desktop-color-neutral-06-${t}`]}},j=(0,i.A)(s.A)`
  align-items: center;
  gap: ${c.YC};
  padding: 0 0 0 2px;
`,Y=(0,i.A)(s.A,{shouldForwardProp:e=>!["optimizationStatus"].includes(e)})`
  width: ${c.Ln};
  height: ${c.Ln};
  justify-content: center;
  align-items: center;

  ${({optimizationStatus:e,theme:{themeName:t}})=>`\n    border: 1px solid ${((e,t)=>{switch(e){case o.CK.COMPLETED:return O.Ay[`desktop-color-green-02-${t}`];case o.CK.FAILED:return O.Ay[`desktop-color-red-02-${t}`];case o.CK.IN_PROGRESS:return O.Ay[`desktop-color-ublue-02-${t}`];case o.CK.PENDING:default:return O.Ay[`desktop-color-neutral-06-${t}`]}})(e,t)};\n    background-color: ${((e,t)=>{switch(e){case o.CK.COMPLETED:return O.Ay[`desktop-color-green-01-${t}`];case o.CK.FAILED:return O.Ay[`desktop-color-red-01-${t}`];case o.CK.IN_PROGRESS:return O.Ay[`desktop-color-ublue-01-${t}`];case o.CK.PENDING:default:return"transparent"}})(e,t)};\n    ${((e,t)=>{switch(e){case o.CK.IN_PROGRESS:return _("upgradableDevice",O.Ay[`desktop-color-ublue-06-${t}`]);case o.CK.COMPLETED:case o.CK.PENDING:case o.CK.FAILED:default:return""}})(e,t)}\n  `};

  border-radius: ${c.fS};
  position: relative;
  margin: 4px;
`,X=({[U.UPGRADABLE_DEVICE]:{[o.j0.MAC]:e,[o.j0.MODEL]:t,[o.j0.NAME]:n,[o.j0.OPTIMIZATION_STATUS]:a}})=>{const l=(0,r.useMemo)(()=>(e=>{switch(e){case o.CK.IN_PROGRESS:return h;case o.CK.FAILED:return g.A;case o.CK.COMPLETED:return D.A;case o.CK.PENDING:default:return h}})(a),[a]);return r.createElement(j,null,r.createElement(Y,{optimizationStatus:a},r.createElement(l,{color:H(a,(0,S.u)().themeName),size:"small"})),r.createElement(W.A,{model:t,width:20,height:20}),r.createElement(Z.A,{isTruncated:!0,size:"medium",color:"text-2"},(0,F.Q)({mac:e,model:t,name:n})))};var J=n(275737),Q=n(999589);const q=(0,i.A)(s.A)`
  align-items: center;
  gap: ${c.YC};
`,ee=({[U.UPGRADABLE_DEVICE]:{[o.j0.CURRENT_VERSION]:e,[o.j0.UPGRADABLE_VERSION]:t}})=>r.createElement(q,null,r.createElement(d.A,{size:"medium",color:"text-2"},(0,Q.coerce)(e)?.version||r.createElement(u.sA,{id:"COMMON_UNKNOWN"})),r.createElement(J.A,{size:"original",style:{transform:"rotate(-90deg)"}}),r.createElement(d.A,{size:"medium",color:"text-2"},(0,Q.coerce)(t)?.version||r.createElement(u.sA,{id:"COMMON_UNKNOWN"}))),te={[B.DEVICE]:"COMMON_DEVICE",[B.VERSION]:"COMMON_VERSION"},ne={[B.DEVICE]:V,[B.VERSION]:z},re={[B.DEVICE]:{size:110,minSize:110,maxSize:1/0},[B.VERSION]:{size:90,minSize:90,maxSize:1/0}},ae={[B.DEVICE]:X,[B.VERSION]:ee},oe=Object.values(B),le=e=>e,ie=({header:{id:e}})=>ne[e]({[G.UPGRADABLE_DEVICES_COLUMN]:e}),se=e=>re[e],ce=({column:{id:e},getValue:t})=>ae[e]({[U.UPGRADABLE_DEVICE]:t()}),Ee={stickyHeader:!0,columns:oe.map(e=>({id:e,accessorFn:le,header:ie,cell:ce,...se(e),enableResizing:!1,enableSorting:!1}))},de=(0,r.memo)(({[o.Me.UPGRADABLE_DEVICES]:e})=>{const t=(0,b.useDispatch)(),n=(0,r.useCallback)(({[o.j0.MAC]:e})=>{t((0,K.XP)({type:v.H.DEVICE,id:e}))},[t]);return r.createElement(y,null,r.createElement(x.A,{data:e,onRowClick:n,...Ee}))}),ue=(0,r.memo)(({[o.Me.ID]:e,[o.Me.UPGRADABLE_DEVICES]:t})=>{switch(e){case o.iR.UPDATE_DEVICE_FIRMWARE:return t.length?r.createElement(de,{upgradable_devices:t}):null;case o.iR.OPTIMIZE_IOT_CONNECTIVITY:case o.iR.OPTIMIZE_WIRED_AP_CONNECTIVITY:case o.iR.INTER_ROAMING_ENHANCEMENT:default:return null}});var me,Ae=n(306644);!function(e){e.ID="id",e.UPGRADABLE_DEVICES="upgradable_devices",e.IS_EXPANDED="isExpanded",e.SET_IS_EXPANDED="setIsExpanded"}(me||(me={}));const Ie=(0,r.memo)(({[me.IS_EXPANDED]:e,[me.SET_IS_EXPANDED]:t})=>{const n=(0,r.useCallback)(()=>{t(e=>!e)},[t]);return r.createElement(Ae.A,{style:{cursor:"pointer",transform:"rotate("+(e?"0deg":"180deg")},onClick:n,size:"original"})}),Ce=(0,r.memo)(({[me.ID]:e,[me.UPGRADABLE_DEVICES]:t,[me.IS_EXPANDED]:n,[me.SET_IS_EXPANDED]:a})=>(0,r.useMemo)(()=>e===o.iR.UPDATE_DEVICE_FIRMWARE&&t.length>0,[e,t.length])?r.createElement(Ie,{isExpanded:n,setIsExpanded:a}):null),pe=(0,r.memo)(({[o.Me.ID]:e,[o.Me.OPTIMIZATION_STATUS]:t,[o.Me.UPGRADABLE_DEVICES]:n})=>{const[a,l]=(0,r.useState)(!1);return r.createElement(P,null,r.createElement(f,null,r.createElement(L,null,r.createElement(M,{optimization_status:t}),r.createElement(d.A,{size:"medium",color:"text-2"},k.V[e][$.a.GET_LABEL]({[$.K.UPGRADABLE_DEVICES]:n}))),r.createElement(Ce,{id:e,upgradable_devices:n,isExpanded:a,setIsExpanded:l})),a?r.createElement(ue,{id:e,upgradable_devices:n}):null)}),Se=(0,r.memo)(({[o.Ss.ACTIONS]:e})=>r.createElement(p,null,e.map(({[o.Me.ID]:e,[o.Me.OPTIMIZATION_STATUS]:t,[o.Me.UPGRADABLE_DEVICES]:n=[]})=>r.createElement(pe,{key:e,id:e,optimization_status:t,upgradable_devices:n}))));var Oe=n(930662);const De=(0,i.A)(s.A)`
  flex-direction: column;
`,Ne=(0,r.memo)(({[o.Ss.ACTIONS]:e})=>{const{percentage:t,optimizationInProgress:n}=(0,r.useMemo)(()=>{return{percentage:(t=e.reduce((e,{[o.Me.ID]:t,[o.Me.UPGRADABLE_DEVICES]:n=[]})=>t===o.iR.UPDATE_DEVICE_FIRMWARE?e+n.length:e+1,0),n=e.reduce((e,{[o.Me.ID]:t,[o.Me.UPGRADABLE_DEVICES]:n=[],[o.Me.OPTIMIZATION_STATUS]:r})=>t===o.iR.UPDATE_DEVICE_FIRMWARE?e+n.filter(({[o.j0.OPTIMIZATION_STATUS]:e})=>e!==o.CK.COMPLETED).length:e+(r!==o.CK.COMPLETED?1:0),0),t>0?100-Math.round(n/t*100):0),optimizationInProgress:A(e)};var t,n},[e]);return 100!==t&&n?r.createElement(De,null,r.createElement(Oe.A,{value:t,variant:"primary",size:"large"}),r.createElement(Z.A,{isTruncated:!0,size:"medium",color:"text-3"},(e=>{const t=e.find(({[o.Me.OPTIMIZATION_STATUS]:e})=>e===o.CK.IN_PROGRESS);if(t){if(t[o.Me.ID]===o.iR.UPDATE_DEVICE_FIRMWARE){const e=t[o.Me.UPGRADABLE_DEVICES].find(({[o.j0.OPTIMIZATION_STATUS]:e})=>e===o.CK.IN_PROGRESS);return e?r.createElement(u.sA,{id:k.V[o.iR.UPDATE_DEVICE_FIRMWARE][$.a.DESCRIPTION],values:{deviceName:(0,F.Q)({mac:e[o.j0.MAC],model:e[o.j0.MODEL],name:e[o.j0.NAME]})}}):null}return r.createElement(u.sA,{id:k.V[t[o.Me.ID]][$.a.DESCRIPTION]})}return null})(e),"...")):null});var he=n(74750),ge=n(718073),_e=n(874807),Te=n(887831),Re=n(691189),Me=n(516693);const Pe="/v2/api/site/{site}/wifi-doctor/optimization",fe=`${Pe}/start`,Le=`${Pe}/stop`;var $e,ke=n(212178),be=n(147606);!function(e){e.LABEL="label",e.ON_CLICK="onClick"}($e||($e={}));const xe=(0,r.memo)(({[o.Ss.ACTIONS]:e,[o.Ss.IN_PROGRESS]:t,[o.Ss.IN_PROGRESS_IN_SITE]:n})=>{const a=(0,b.useDispatch)(),[l,i]=(0,r.useState)(!1),{formatMessage:s}=(0,u.tz)(),c=(0,r.useCallback)(()=>{i(!0)},[]),E=(0,r.useCallback)(()=>{c(),a((0,Re.vB)(Me.aC,null,null,Te.A.POST,fe,{},null,{}))},[a,c]),d=(0,r.useCallback)(()=>{c(),a((0,Re.vB)(Me.aC,null,null,Te.A.POST,Le,{},null,{}))},[a,c]),m=(0,r.useCallback)(()=>{c(),a((0,K.K5)())},[a,c]),C=(0,r.useMemo)(()=>{return A(t=e)||I(t)?A(e)?o.CK.IN_PROGRESS:I(e)?o.CK.COMPLETED:void 0:o.CK.PENDING;var t},[e]),{[$e.LABEL]:p,[$e.ON_CLICK]:S}=(0,r.useMemo)(()=>{switch(C){case o.CK.PENDING:return{[$e.LABEL]:s({id:"DASHBOARD_CLICK_TO_OPTIMIZE"}),[$e.ON_CLICK]:E};case o.CK.IN_PROGRESS:return{[$e.LABEL]:s({id:"COMMON_STOP"}),[$e.ON_CLICK]:d};case o.CK.COMPLETED:return{[$e.LABEL]:s({id:"COMMON_ACTION_DONE"}),[$e.ON_CLICK]:m};default:return{[$e.LABEL]:"",[$e.ON_CLICK]:_e.P1}}},[C,s,E,d,m]),O=(0,ke.A)(C);(0,r.useEffect)(()=>{O!==C&&i(!1)},[C,O]);const D=n&&!t,N=(0,r.useMemo)(()=>C===o.CK.PENDING&&e.some(({[o.Me.ID]:e,[o.Me.OPTIMIZATION_STATUS]:t})=>e===o.iR.UPDATE_DEVICE_FIRMWARE&&t===o.CK.PENDING),[e,C]),h=(0,r.useCallback)((e=_e.P1)=>r.createElement(he.A,{type:"button",size:"medium",onClick:e,isDisabled:D||l},p),[p,D,l]);return p?r.createElement(ge.A,{description:D?r.createElement(u.sA,{id:"DASHBOARD_WIFI_DOCTOR_OPTIMIZATION_ONE_PER_SITE"}):void 0},N?r.createElement(r.Fragment,null,r.createElement(be.A,{shouldCloseOnInteractOutside:!0,onConfirm:S,trigger:h(),title:r.createElement(u.sA,{id:"DASHBOARD_WIFI_DOCTOR_OPTIMIZATION_CONFIRMATION_TITLE"}),message:r.createElement(u.sA,{id:"DASHBOARD_WIFI_DOCTOR_OPTIMIZATION_CONFIRMATION_DESCRIPTION"})})):h(S)):null}),Ke=e=>{const[t,n]=(0,r.useState)(e),a=(0,r.useRef)(e),l=(0,r.useRef)(null);return(0,r.useEffect)(()=>{l.current&&(clearTimeout(l.current),l.current=null);const t=a.current,r=new Map(t.map(e=>[e[o.Me.ID],e]));return e.some(e=>{const t=e[o.Me.ID],n=r.get(t);return n?.[o.Me.OPTIMIZATION_STATUS],e[o.Me.OPTIMIZATION_STATUS],!!n&&n[o.Me.OPTIMIZATION_STATUS]!==e[o.Me.OPTIMIZATION_STATUS]})?l.current=setTimeout(()=>{n(e),a.current=e},2500):(n(e),a.current=e),()=>{l.current&&clearTimeout(l.current)}},[e]),t},ve=({activeItem:{[o.Ss.ACTIONS]:e,[o.Ss.IN_PROGRESS]:t,[o.Ss.IN_PROGRESS_IN_SITE]:n}})=>{(0,l.A)();const i=Ke(e);return r.createElement(a.A,null,r.createElement(E,null,r.createElement(C,{actions:i}),r.createElement(Se,{actions:i}),r.createElement(Ne,{actions:i}),r.createElement(xe,{actions:i,in_progress:t,in_progress_in_site:n})))}},648092:(e,t,n)=>{n.d(t,{a:()=>s,m:()=>c});var r=n(801081),a=n(386234),o=n(276907),l=n(919952),i=n(434008);const s=(0,r.Mz)(e=>e[l.U.SHARED][o.N.WEB_SOCKET],e=>e?.[i.SC.POOL]||{}),c=(0,r.Mz)(s,e=>(0,a.UI)(t=>e[t]))},689965:(e,t,n)=>{n.d(t,{A:()=>m,I:()=>r});var r,a=n(296540),o=n(822336),l=n(427853),i=n(71479),s=n(825032),c=n(566723),E=n(294303);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(r||(r={}));const d=(0,i.A)(E.A,{shouldForwardProp:e=>!["marginBottom","isButtonList","margin","flex","width","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||o.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:n})=>n||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>o.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,i.A)(l.A,{shouldForwardProp:e=>!["marginBottom","margin","flex","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||o.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:t}})=>e||o.Ay[t===s.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${c.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0 ${c.Ln} ${c.Ln};
      > div {
        padding: 0;
      }
    }
  }
`,m=({type:e,marginBottom:t,margin:n,padding:o,flex:l,width:i,nested:s,...c})=>"items"in c?a.createElement(u,{marginBottom:t,margin:n,padding:o,flex:l,nested:s,...c}):a.createElement(d,{nested:s,width:i,marginBottom:t,margin:n,padding:o,flex:l,isButtonList:e===r.BUTTON_LIST,...c},c.children)}}]);