"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[89195],{101955:(e,t,n)=>{n.d(t,{X:()=>a});const a="PROPERTY_PANEL_CLASSNAME"},123396:(e,t,n)=>{n.d(t,{A:()=>h});var a=n(296540),l=n(813040),r=n(469733),i=n(271856),c=n(927099),o=n(71479),s=n(998837),E=n(132196),m=n(137625),d=n(955161),A=n(734707),u=n(845030),_=n(699784),C=n(691189),I=n(294201);var p=n(83344),S=n(602021),T=n(837612),D=n(602197),O=n(171073),v=n(765268);const N=(0,o.A)(A.Ay,{shouldForwardProp:e=>"disabled"!==e})`
  padding: 0;
  ${({disabled:e})=>e?"pointer-events: none; opacity: 0.4;":""};
  color: ${({theme:{motifPalette:{red05:e,red06:t}},disabled:n})=>n?e:t};
  &:hover {
    color: ${({theme:{motifPalette:{red05:e}}})=>e};
  }
  &:active {
    color: ${({theme:{motifPalette:{red05:e,red07:t}},disabled:n})=>n?e:t};
  }
`,P=E.AH`
  flex: 1;
  width: 100%;
`,g=e=>a.createElement(i.A,{portal:!0,description:a.createElement(c.A,{whiteSpacePreWrap:!0},a.createElement(_.sA,{id:"DEVICE_ACTIONS_REMOVE_TOOLTIP"})),className:P},e),f=({device:e,disabled:t,variant:n})=>{const l=(0,r.useDispatch)(),i=(0,s.u)(),[o,E]=(0,a.useState)(!1),[f,h]=(0,a.useState)(!1),M=(0,r.useSelector)(S.EL),b=(0,T.S9)(e),{isDeviceDisconnected:y,isDeviceAdoptionFailed:R,deviceBusy:U}=(0,a.useMemo)(()=>({isDeviceDisconnected:b===D.g.DISCONNECTED,isDeviceAdoptionFailed:b===D.g.ADOPTION_FAILED,deviceBusy:(0,T.C1)(b)}),[b]),V=(0,a.useMemo)(()=>t||U||M||y||R,[t,U,M,y,R]),L=(0,a.useMemo)(()=>"tertiary"===n,[n]);return a.createElement(d.A,{condition:U,wrapper:g},a.createElement(m.A,{isOpen:f,title:"DEVICE_ACTIONS_UNPAIR_CONFIRM_TITLE",message:"DEVICE_ACTIONS_UNPAIR_CONFIRM_MESSAGE",buttonMessage:"COMMON_ACTION_PROCEED",buttonVariant:"danger",handleConfirm:async()=>{var t;E(!0),l((t=e.mac,(0,C.Xj)(I.A.UBB_UNPAIR,"/api/s/{site}/cmd/devmgr/ubb-unpair",{mac:t}))).then(()=>{l((0,p.W)(e.mac)),l((0,O.XL)(e.mac)),E(!1),h(!1),l((0,u.K5)()),l((0,v.O)())}).finally(()=>{E(!1),h(!1)})},handleClose:()=>{E(!1),h(!1)},className:L?P:""},a.createElement(N,{disabled:V,variant:L?void 0:"link",className:L?(0,A.sC)(i):"",onClick:e=>{e.preventDefault(),e.stopPropagation(),h(!0)},loader:o?"spinner":null,type:"button"},a.createElement(c.A,{color:"danger",size:"body"},a.createElement(_.sA,{id:"COMMON_ACTION_UNPAIR"})))))},h=({activeItem:e})=>a.createElement(l.R,{tooltipId:"DEVICE_ACTIONS_UNPAIR_INFO",tooltipProps:{tooltipClassName:"tooltip-position-fixer",variant:"outline"}},a.createElement(f,{device:e}))},142208:(e,t,n)=>{n.d(t,{A:()=>$});var a=n(469733),l=n(296540),r=n(271856),i=n(927099),c=n(71479),o=n(998837),s=n(132196),E=n(6510),m=n(249304),d=n(280258),A=n(137625),u=n(845030),_=n(699784),C=n(267509),I=n(600446),p=n(656883),S=n(290480),T=n(814803),D=n(157766),O=n(994791),v=n(953048),N=n(293016),P=n(649413),g=n(497470),f=n(83344),h=n(323572),M=n(457311),b=n(602021),y=n(789768),R=n(837612),U=n(602197),V=n(171073),L=n(765268),k=n(190497),w=n(955161),x=n(734707);const G=(0,c.A)(x.Ay,{shouldForwardProp:e=>"disabled"!==e})`
  padding: 0;
  ${({disabled:e})=>e?"pointer-events: none; opacity: 0.4;":""};
  color: ${({theme:{motifPalette:{red05:e,red06:t}},disabled:n})=>n?e:t};
  &:hover {
    color: ${({theme:{motifPalette:{red05:e}}})=>e};
  }
  &:active {
    color: ${({theme:{motifPalette:{red05:e,red07:t}},disabled:n})=>n?e:t};
  }
`,z=s.AH`
  flex: 1;
  width: 100%;
`,W=e=>l.createElement(r.A,{portal:!0,width:180,description:l.createElement(i.A,{whiteSpacePreWrap:!0},l.createElement(_.sA,{id:"DEVICE_ACTIONS_REMOVE_TOOLTIP"})),className:z},e),$=({device:e,disabled:t,variant:n})=>{const r=(0,a.useDispatch)(),c=(0,o.u)(),[s,$]=(0,l.useState)(!1),[F,H]=(0,l.useState)(!1),B=(0,a.useSelector)(b.EL),X=(0,a.useSelector)(O.OA),j=(0,a.useSelector)(I.W),Y=(0,a.useSelector)(T.yD),K=(0,R.S9)(e),{isDeviceDisconnected:Q,isDeviceAdoptionFailed:Z,deviceBusy:J}=(0,l.useMemo)(()=>({isDeviceDisconnected:K===U.g.DISCONNECTED,isDeviceAdoptionFailed:K===U.g.ADOPTION_FAILED,deviceBusy:(0,R.C1)(K)}),[K]),q=(0,l.useMemo)(()=>t||J||B,[t,J,B]),ee=(0,l.useCallback)(()=>{const{id:t,type:n}=(0,P.Se)(X);if(n===N.F7.DEVICE&&t===e?.mac&&(r((0,g.U)(v.Zt)),r((0,g.Ao)([]))),Y===e?.mac){const e={...j,[C.dp.DEVICE]:d.H,[C.dp.MACS]:k.oA};r((0,p.n)(e)),r((0,y.yT)(m.l.RADIOS,{filters:e})),r((0,D.OI)(S.TE.ALL))}},[e?.mac,r,j,X,Y]);return l.createElement(w.A,{condition:J,wrapper:W},l.createElement(A.A,{isOpen:F,title:"COMMON_ACTION_REMOVE_CONFIRM_TITLE",titleValues:{deviceName:(0,E.Q)(e)},message:Q||Z?"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()=>{$(!0),r((0,h.Yl)(e.mac)).then(()=>{ee(),r((0,f.W)(e.mac)),r((0,V.XL)(e.mac)),$(!1),H(!1),r((0,u.K5)()),r((0,M.Uc)()),r((0,L.O)())}).finally(()=>{$(!1),H(!1)})},handleClose:()=>{$(!1),H(!1)},className:"tertiary"===n?z:""},l.createElement(G,{disabled:q,variant:"tertiary"===n?void 0:"link",className:"tertiary"===n?(0,x.sC)(c):"",onClick:e=>{e.preventDefault(),e.stopPropagation(),H(!0)},loader:s?"spinner":null,type:"button"},l.createElement(i.A,{color:"danger",size:"body"},l.createElement(_.sA,{id:"COMMON_ACTION_REMOVE"})))))}},224948:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(296540),l=n(217439),r=n(71479),i=n(566723),c=n(294303),o=n(689965);const s=(0,r.A)("div")`
  margin-right: ${i.kc};
`,E=(0,r.A)("div")`
  margin-left: ${i.kc};
`,m=({icon:e,closeIcon:t,nested:n,children:r,...i})=>a.createElement(o.A,{nested:n,...i},a.createElement(c.A,null,a.createElement(s,null,e),a.createElement(l.A,{size:"medium"},r),t?a.createElement(E,null,t):null))},252093:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(296540),l=n(271856),r=n(162420),i=n(699784);const c=({messageId:e,tooltipClassName:t,values:n,isInteractive:c,portal:o,variant:s="twoTone",size:E="medium"})=>a.createElement(l.A,{description:a.createElement(i.sA,{id:e,values:n}),width:210,isInteractive:c,portal:o,tooltipClassName:t},a.createElement(r.A,{isActive:!0,omitSvgMargin:!0,variant:s,size:E}))},284388:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(296540),l=n(450514),r=n(463107),i=n(74750),c=n(699784);const o=({onCancel:e,onConfirm:t,cssProperties:n})=>a.createElement(r.aF.Root,{isOpen:!0},a.createElement(l.A,{actionButtons:a.createElement(a.Fragment,null,a.createElement(i.A,{type:"button",variant:"neutral",onPress:e},a.createElement(c.sA,{id:"COMMON_UNSAVED_CHANGES_STAY"})),a.createElement(i.A,{type:"button",variant:"destructive",onPress:t},a.createElement(c.sA,{id:"COMMON_UNSAVED_CHANGES_LEAVE"}))),title:(0,c.tz)().formatMessage({id:"COMMON_UNSAVED_CHANGES_TITLE"}),width:"small",isDismissable:!1,onClose:e,style:n},a.createElement(c.sA,{id:"COMMON_UNSAVED_CHANGES_CONTENT"})))},323572:(e,t,n)=>{n.d(t,{TG:()=>m,Ve:()=>s,Yl:()=>S,x_:()=>u,zK:()=>_,us:()=>I,jk:()=>C,p5:()=>A,RZ:()=>o,rA:()=>d,gM:()=>T,NA:()=>E,_F:()=>p});var a=n(691189),l=n(736318),r=n(294201),i=n(87485);const c="/api/s/{site}/cmd/sitemgr",o=(e={},t={})=>(0,a.t9)("autoIpsec","/v2/api/vpn/auto/sites",e,{idField:"id",...t}),s=e=>(0,a.Xj)(r.A.ADD_SITE_VPN,c,e),E=e=>(0,a.Xj)(r.A.REBUILD_SITE_VPN,c,e),m=e=>(0,a.Xj)(r.A.ADD_SITE,c,{desc:e}),d=e=>(0,a.Xj)(r.A.IMPORT_SITE,l.g1,{site_desc:e.newSiteName,backup_id:e.importedSiteId}),A=()=>(0,a.Xj)(r.A.EXPORT_SITE,l.g1),u=e=>(0,a.Xj)(r.A.DELETE_SITE,c,{site:e}),_=(e,t={})=>(0,a.Xj)(r.A.DELETE_SITE_VPN,c,{site:e.remote_site_id,name:e.name},t),C=(e,t={})=>(0,a.Xj)(r.A.ENABLE_SITE_VPN,c,{site:e.site,name:e.name},t),I=(e,t={})=>(0,a.Xj)(r.A.DISABLE_SITE_VPN,c,{site:e.site,name:e.name},t),p=e=>(0,a.Xj)(r.A.UPDATE_SITE,c,{desc:e}),S=(e,t={})=>(0,a.Xj)(r.A.DELETE_DEVICE,c,{macs:[].concat(e)},{...(0,i.rk)("COMMON_COMMAND_DELETE_DEVICE_TOAST_ERROR",{count:[].concat(e).length}),...t}),T=(e,t,n={})=>(0,a.Xj)(r.A.MOVE_DEVICE,c,{mac:e,site:t},n)},339577:(e,t,n)=>{n.d(t,{R:()=>A});var a=n(296540),l=n(613910),r=n(566723),i=n(115829),c=n(568777),o=n(294303),s=n(765562),E=n(746289);const m={width:"auto",maxWidth:"80px",height:"20px"},d=`${s.A.asnPath}65534${E.m1}`,A=({carrier:e,asn:t})=>e?a.createElement(o.A,{gap:r.YC,flex:"0 1 auto",overflow:"hidden"},a.createElement(o.A,{flex:"0 0 auto"},void 0!==t?a.createElement(c.A,{asn:t,style:m,useFallback:!0,customFallback:d}):a.createElement(l.A,{size:"original"})),a.createElement(i.A,{color:"text-2",size:"medium"},e)):null},360113:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(296540),l=n(71479),r=n(566723),i=n(294303);const c=(0,l.A)(i.A,{shouldForwardProp:e=>!["valueMaxWidth","keyMinWidth","compact"].includes(e)})`
  &:not(:last-child) {
    ${({compact:e})=>e?"":`margin-bottom: ${r.kc};`}
  }
  & > {
    &:nth-child(1) {
      min-width: ${({keyMinWidth:e})=>e}px;
    }
    &:nth-child(2) {
      max-width: ${({valueMaxWidth:e})=>e}px;
    }
  }
`,o=({children:e,valueMaxWidth:t=215,keyMinWidth:n=0,flexProps:l={},compact:i=!1})=>a.createElement(c,{width:"100%",justifyContent:"space-between",gap:r.kc,height:i?void 0:24,valueMaxWidth:t,keyMinWidth:n,compact:i,...l},e)},412952:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(846885),l=n.n(a),r=n(296540);const i=e=>(t,n)=>{if(null==e||!t||!n)return!0;return![].concat(e).some(e=>"string"==typeof e?n.pathname===e&&t.pathname===e:e instanceof RegExp&&(e.test(n.pathname)||e.test(t.pathname)))};var c=n(284388);const o=({ignoredPaths:e,onLeave:t,beforeOnLeave:n,zIndex:a})=>{const o=i(e),s=(0,r.useMemo)(()=>(e,t)=>o(e,t)&&((e,t)=>t?.pathname!==e.pathname)(e,t),[o]),E=(0,r.useCallback)(e=>{n?.(),e()},[n]);return r.createElement(l(),{when:s,afterConfirm:t,beforeConfirm:E},({onCancel:e,onConfirm:t})=>r.createElement(c.A,{onCancel:e,onConfirm:t,cssProperties:{zIndex:a}}))}},464265:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(469733),l=n(296540),r=n(792072);const i=e=>(0,a.useSelector)((0,l.useMemo)(()=>(0,r.jN)(e),[e]))},551753:(e,t,n)=>{n.d(t,{A:()=>u});var a=n(296540),l=n(758649),r=n(217439),i=n(162420),c=n(823858),o=n(793336),s=n(998837),E=n(46119),m=n(699784),d=n(224948),A=n(294303);const u=(0,a.memo)(({children:e,customIcon:t,link:n,nested:u,extra:_,variant:C="warning",...I})=>{const{motifPalette:{warning:p,danger:S}}=(0,s.u)(),T=(0,a.useMemo)(()=>{switch(C){case"warning":return a.createElement(c.A,{size:"original",color:p,variant:"fill"});case"info":return a.createElement(i.A,{isActive:!0,size:"original",variant:"fill"});case"custom":return t;default:return a.createElement(o.A,{size:"medium",color:S,variant:"fill"})}},[C,p,S,t]),D=(0,a.useCallback)(()=>{E.A.open(n)},[n]);return a.createElement(d.A,{icon:T,nested:u,...I},a.createElement(A.A,{flexDirection:"column",alignItems:"flex-start"},a.createElement(r.A,null,e),a.createElement(r.A,null,n?a.createElement(l.A,{type:"button",variant:"inline",onClick:D},a.createElement(m.sA,{id:"COMMON_LEARN_MORE"})):null),_))})},575593:(e,t,n)=>{n.d(t,{p:()=>o});var a=n(801081),l=n(215454),r=n(602021),i=n(198494),c=n(949909);const o=e=>(0,a.Mz)(r.ah,l.pw,r.dK,i.fR,(t,n,a,l)=>{switch(e){case c.S.API_DEVICE_ADOPT:case c.S.API_DEVICE_RESTART:return a||t.includes(e);case c.S.API_WIDGET_OS_STATS:return l||n.includes(e);default:return a}})},589195:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Vt});var a=n(469733),l=n(296540),r=n(960407),i=n(840279),c=n(582724),o=n(956347),s=n(840124),E=n(973581),m=n(935780),d=n(845030),A=n(198494),u=n(412952);const _=()=>{const e=(0,a.useDispatch)(),t=(0,l.useCallback)(()=>{e((0,d.SQ)(!1))},[e]);return l.createElement(u.A,{onLeave:t})};var C=n(284388);const I=()=>{const e=(0,a.useDispatch)(),t=(0,l.useCallback)(()=>{e((0,d.Fr)())},[e]),n=(0,l.useCallback)(()=>{e((0,d.nw)())},[e]);return l.createElement(C.A,{onCancel:t,onConfirm:n})};var p=n(398300),S=n(699784),T=n(837612),D=n(991e3),O=n(71479),v=n(566723);const N=(0,O.A)(D.A)`
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: ${v.Ln};
`,P=(0,l.memo)(({tabs:e,currentTab:t})=>{const n=(0,a.useDispatch)(),r=(0,l.useCallback)(e=>{n((0,d.X2)(e))},[n]);return e?.length?l.createElement(N,{tabs:e,value:t,iconOnly:!0,onChange:r,tooltipProps:{animate:!1}}):null});var g=n(822336),f=n(574137),h=n(613870),M=n(780811),b=n(294303);const y=(0,O.A)(b.A)`
  background-color: ${f.PA.success};
  color: ${f.N0};
  font-size: 11px;
`,R=(0,O.A)("div")`
  font-weight: ${g.Ay["desktop-font-weight-semibold"]};
  margin-bottom: ${v.YC};
`,U=({activeItem:e})=>(e=>Object(e)===e&&"type"in e&&"model"in e&&"adopted"in e&&!("product_line"in e))(e)&&(0,M.tNJ)(e)&&(0,M.Vly)(e)?l.createElement(y,{flex:"none",height:50,minHeight:50,padding:`${v.kc} ${v.fS}`,position:"relative"},l.createElement(b.A,{alignItems:"center",justifyContent:"center",marginRight:v.Ln},l.createElement(h.A,{width:18,height:18,strength:(0,M.KwR)(e),color:"currentColor",inactiveColor:f.kv})),l.createElement(b.A,{flexDirection:"column",justifyContent:"center",flex:1},l.createElement(R,null,l.createElement(S.sA,{id:"DEVICE_ULTE_IS_ACTIVE_TITLE"})),l.createElement(S.sA,{id:"DEVICE_ULTE_IS_ACTIVE_DETAILS"}))):null;var V=n(962926),L=n(217439),k=n(170121),w=n(162420),x=n(998837),G=n(132196),z=n(6510),W=n(860631),$=n(224948),F=n(349107),H=n(532419),B=n(765562),X=n(675845);const j=({last_uplink:e={}})=>{const{formatMessage:t}=(0,S.tz)(),n=(0,a.useSelector)(H.CC),r=(0,X.Z)(e.uplink_mac,n),i=(0,X.z)(e.uplink_device_name,e.uplink_remote_port,r,t);return l.createElement($.A,{icon:l.createElement(w.A,{size:"original",isActive:!0,variant:"fill"})},l.createElement(L.A,null,l.createElement(S.sA,{id:"COMMON_DEVICE_CONNECTION_INTERRUPTED_WARNING",values:{strong:S.ko,uplinkDeviceName:i||l.createElement(S.sA,{id:"COMMON_UNKNOWN"}),link:l.createElement(F.A,{href:B.A.offlineArticle,id:"COMMON_HERE",noWrap:!0})}})))};var Y=n(984576),K=n(551753),Q=n(876250),Z=n(6176),J=n(142208),q=n(300477),ee=n(999589),te=n(758649),ne=n(592510),ae=n(130851),le=n(464265),re=n(776309),ie=n(465860),ce=n(675359),oe=n(126457),se=n(86392),Ee=n(811569),me=n(477544),de=n(632169),Ae=n(460680),ue=n(766254),_e=n(575593),Ce=n(949909),Ie=n(975503),pe=n(990249),Se=n(598796),Te=n(154628),De=n(785976),Oe=n(602197),ve=n(171073),Ne=n(573363),Pe=n(180830),ge=n(328403),fe=n(959341),he=n(274509),Me=n(823858);const be=()=>l.createElement(b.A,{gap:v.kc,marginTop:v.kc},l.createElement(Me.A,{size:"original",color:f.PA.warning,variant:"fill"}),l.createElement(L.A,null,l.createElement(S.sA,{id:"DEVICE_UBB_ADOPT_WARNING_MESSAGE",values:{b:S.b}})));var ye=n(927099);const Re=(0,l.memo)(({name:e,model:t,mac:n})=>l.createElement(b.A,{gap:v.kc,marginTop:v.kc},l.createElement(Me.A,{size:"original",color:f.PA.warning,variant:"fill"}),l.createElement(ye.A,{size:"caption"},l.createElement(S.sA,{id:(0,M.P1n)(t)?"DEVICE_ADOPT_SECOND_GATEWAY_WHEN_UDM_USED_INFO":"DEVICE_ADOPT_SECOND_GATEWAY_INFO",values:{gateway:(0,z.Q)({name:e,model:t,mac:n}),b:S.b,br:S.br}})))),Ue=()=>l.createElement(b.A,{gap:v.kc,marginTop:v.kc},l.createElement(Me.A,{size:"original",color:f.PA.warning,variant:"fill"}),l.createElement(L.A,null,l.createElement(S.sA,{id:"DEVICE_ULTE_PRO_SETUP_SIM_INCOMPATIBLE",values:{strong:S.ko}}))),Ve=()=>l.createElement(b.A,{gap:v.kc,marginTop:v.kc},l.createElement(Me.A,{size:"original",color:f.PA.warning,variant:"fill"}),l.createElement(L.A,null,l.createElement(S.sA,{id:"DEVICE_ULTE_USG_REQUIRED"})));var Le=n(906936);const ke=(0,O.A)(ye.A)`
  line-height: 20px;
  margin-bottom: 10px;
`,we=()=>l.createElement(Le.A,{level:"warning"},l.createElement(ke,{size:"caption"},l.createElement(S.sA,{id:"DEVICE_ACTIONS_ADOPT_WARNING_MESSAGE",values:{b:S.b}})));var xe=n(715504);const Ge=G.AH`
  flex: 1;
`,ze=({device:e,onAdoptionInitiated:t,disabled:n})=>{const{formatMessage:r}=(0,S.tz)(),i=(0,a.useDispatch)(),c=(0,T.S9)(e),[o,s]=(0,l.useState)(!0),[E,m]=(0,l.useState)(c===Oe.g.ADOPTING),u=(0,a.useSelector)((0,_e.p)(Ce.S.API_DEVICE_ADOPT)),_=(0,a.useSelector)(H.ID),C=(0,a.useSelector)(H.U$),I=(0,a.useSelector)(Ie.fV),D=(0,a.useSelector)(ae.p),O=(0,a.useSelector)(me.hX),N=(0,a.useSelector)(Pe.Xs),P=(0,a.useSelector)(Ne.A),g=(0,a.useSelector)(Ae.Z9),f=(0,le.A)(Se.Xj.MANAGED_SHADOW_MODE),h=(0,a.useSelector)(A.ay),y=c===Oe.g.ADOPTION_FAILED,R=(0,T.YP)(e),U=(0,De.O)(e),V=(0,De.g)(e),L=!!e?.adoptable_when_upgraded,k=(0,M.moU)(e)&&!(0,M.DBW)(_,e,g,f),w=(0,M.tNJ)(e),x=w&&!(0,M.nKo)(_,e),G=w&&!e?.lte_imei,z=!!e?.lte_sim_incompatible,W=!R&&(U||V)&&u&&!(x||k)&&!G,$=w&&!I,F=(0,M.YdF)(e)&&!(0,Te.Ck)(e)&&!(0,M.IOl)(e),B=n||E||o||$||F||z;(0,l.useEffect)(()=>{m(c===Oe.g.ADOPTING)},[c,e.mac]),(0,l.useEffect)(()=>{Promise.all([i((0,ge.Yo)(void 0,{crudCacheStrategy:{type:ne.e.CACHE}})),i((0,de.uy)(void 0,{crudCacheStrategy:{type:ne.e.CACHE}})),...f?[i((0,ue.V9)(void 0,{crudCacheStrategy:{type:ne.e.CACHE}}))]:[]]).then(()=>s(!1))},[i,f]),(0,l.useEffect)(()=>{i((0,pe.T)(void 0,{crudCacheStrategy:{type:ne.e.CACHE}}))},[i]);const X=n=>{function a(){w?(i((0,Ee.ji)(e.mac,(0,M.mHb)(e)?"LTE_PRO_ADOPTION":"LTE_ADOPTION")),m(!1)):function(){if(e.discovered_by===he.A.PROTOCOL_V2_ID)m(!1);else if(V?i((0,ve.T3)(e,n.values)).catch(()=>m(!1)):i((0,ve.Hk)(e)).catch(()=>m(!1)),(0,M.G5G)(e)){const t=(0,q.A)();O||i((0,ce.ox)({icon:l.createElement("div",null,l.createElement(Z.C,{model:e?.model,width:53,height:53,imagePath:D,deviceModelMap:P,theme:h})),title:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_TITLE",message:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_MESSAGE",primaryButton:{label:r({id:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_ACTION"}),onClick:()=>{i((0,ce.uU)(t)),i((0,d.XP)({type:p.H.WIFI,id:fe.R6}))}},translateTitle:!0},t)),N||(0,M.r$V)(e)||i((0,ce.ox)({icon:l.createElement("div",null,l.createElement(Z.C,{model:e?.model,width:53,height:53,imagePath:D,deviceModelMap:P,theme:h})),title:r({id:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_AP_GROUP_NOT_DEFAULT_TITLE"},{deviceName:e?.hostname}),message:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_AP_GROUP_NOT_DEFAULT_MESSAGE",primaryButton:{label:r({id:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_ACTION"}),onClick:()=>{i((0,ce.uU)(t)),i((0,d.XP)({type:p.H.WIFI,id:fe.R6}))}}},t))}}()}function c(){if(e.elite&&e.elite.replacement_for_mac){const t=_.find(t=>t.mac===e.elite.replacement_for_mac);i((0,se.E)({title:"DEVICE_APPLY_CONFIGURATION_HEADER",titleValues:{deviceName:t.name},message:"DEVICE_APPLY_CONFIGURATION_MESSAGE",messageValues:{deviceName:t.name},size:"small",onConfirm:()=>{i((0,oe.AS)())},onCancel:()=>{i((0,oe.AS)()),V?a():(0,ie.A)([e.mac],{dispatch:i}).then(a).catch(()=>m(!1))}}))}else(0,M.m_j)({type:e.type})?i((0,oe.to)({modalType:re.A.REGISTER_ISP_GUIDE,modalProps:{onConfirm:a,onCancel:()=>m(!1)}})):V?a():(0,ie.A)([e.mac],{dispatch:i}).then(a).catch(()=>m(!1))}L?i((0,se.E)({title:"DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_TITLE",titleValues:{deviceName:e.name},message:e.upgrade_to_firmware?"DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_VERSION_MESSAGE":"DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_MESSAGE",messageValues:{fromVersion:(0,ee.coerce)(e.version)?.version,toVersion:(0,ee.coerce)(e.upgrade_to_firmware)?.version},size:"small",onConfirm:()=>{i((0,oe.AS)()),c()},onCancel:()=>{i((0,oe.AS)()),m(!1)}})):c(),m(!0),t?.()};return W?l.createElement(b.A,{flexDirection:"column"},$?l.createElement(Ve,null):null,z?l.createElement(Ue,null):null,F?l.createElement(be,null):null,y&&!V?l.createElement(we,null):null,y&&V?l.createElement(J.A,{device:e,variant:"tertiary"}):null,U?l.createElement(b.A,{gap:v.kc,alignItems:"center",marginTop:v.kc},l.createElement(xe.e,{device:e},l.createElement(te.A,{variant:"primary",onClick:e=>{e?.preventDefault(),e?.stopPropagation(),X()},disabled:B,wrapClassName:Ge},E?l.createElement(S.sA,{id:"COMMON_DEVICE_STATE_ADOPTING"}):l.createElement(S.sA,{id:L?"DEVICE_ACTIONS_ADOPT_AND_UPGRADE":"DEVICE_ACTIONS_ADOPT"})))):null):l.createElement(b.A,{flexDirection:"column"},!k||f&&C.model===e.model?null:l.createElement(Re,{name:C.name,model:C.model,mac:C.mac}))};var We=n(187483),$e=n(215454),Fe=n(569299),He=n(211368),Be=n(231226),Xe=n(546391),je=n(123396),Ye=n(339577),Ke=n(689965),Qe=n(325898),Ze=n(768195);var Je;!function(e){e[e.AP=0]="AP",e[e.SWITCH=1]="SWITCH",e[e.DEFAULT=2]="DEFAULT"}(Je||(Je={}));const qe={[Je.AP]:()=>{const e=(0,a.useSelector)(ae.p),{motif:t}=(0,Qe.A)();return l.createElement(b.A,{justifyContent:"center"},l.createElement("video",{height:226,loop:!0,muted:!0,autoPlay:!0,src:`${e}/resetButton/reset-AP_${t}.mp4`}))},[Je.SWITCH]:()=>{const e=(0,a.useSelector)(ae.p);return l.createElement(b.A,{justifyContent:"end"},l.createElement("img",{width:326,height:226,src:`${e}/resetButton/switch.png`,alt:"reset"}))},[Je.DEFAULT]:()=>{const e=(0,a.useSelector)(ae.p);return l.createElement(b.A,{justifyContent:"center"},l.createElement("img",{width:"100%",height:152,src:`${e}/resetButton/other.png`,alt:"reset"}))}},et={[Ze.W4.U5GMAX]:"DEVICE_RESET_DESC_LCM"},tt=["U7HD","U7NHD","UCXG","U7SHD","U7PG2","U7LR","U7LT","UAL6","UAP6","UALR6","UALR6v2","UALR6v3","UAP6MP","UAPL6","UALRPL6","U6ENT"],nt=["US24P250","S224250","US48P500","S248500","US8P150","S28150","USC8P150","US16P150","S216150","USL24P","USL24PB","US24PRO2","US24PRO","USLP24P","USL48","USL48B","USL48P","USL48PB","US48PRO","USLP48P","US48PRO2","USL16P","USL16PB","USXG","US6XG150","US624P","US648P","USXG24","USL8A","USAGGPRO","USL8MP"],at=({model:e})=>{const t=(0,l.useMemo)(()=>{const t=tt.includes(e),n=nt.includes(e);let a=Je.DEFAULT;return t?a=Je.AP:n&&(a=Je.SWITCH),a},[e]),n=qe[t];return l.createElement(l.Fragment,null,l.createElement(b.A,{marginTop:v.kc},l.createElement(b.A,{marginRight:v.kc},l.createElement(w.A,{isActive:!0,variant:"fill",size:"original"})),l.createElement(L.A,null,l.createElement(S.sA,{id:et[e]||"DEVICE_PROPERTIES_RESET_DESC"}))),l.createElement(n,null))};var lt=n(360113),rt=n(777741);const it=G.AH`
  margin-bottom: ${v.Ln};
`,ct=(0,O.A)("div")`
  align-self: center;
`,ot=({activeItem:e,activeItem:{mac:t,model:n,ip:r,state:i,last_uplink:c,mbb:o,type:s,wan_networkgroup:E}})=>{const m=(0,a.useSelector)(Be.IN),d=(0,a.useSelector)(H.k4),A=(0,a.useSelector)(H.pV),u=(0,a.useSelector)(Be.Eo),_=(0,a.useSelector)(H.YS),C=(0,a.useSelector)($e.C7),I=(0,a.useSelector)(We.TP),{motifPalette:{orange01:p}}=(0,x.u)(),D=(0,M.R30)({type:s,model:n})&&A&&!E,O=(0,T.S9)(e),N=O===Oe.g.MANAGED_BY_OTHER,P=O===Oe.g.ADOPTION_FAILED,[g,f]=(0,l.useState)(O===Oe.g.ADOPTING),h=(0,M.X6b)(e),y=(0,W.UA)(e),R=o?.network_scan?.operators||[];(0,l.useEffect)(()=>{f(O===Oe.g.ADOPTING)},[t,O]);let U=null;m&&u&&(C&&(U=l.createElement(b.A,{flexDirection:"column"},l.createElement(S.sA,{id:"DEVICE_ADOPTION_LIMIT_REACHED_CLOUD_CONSOLE",values:{limit:u.limit}}),l.createElement(F.A,{id:"DEVICE_ADOPTION_MANAGE_CLOUD_CONSOLE_SUBSCRIPTION",href:I.replace(Xe.pG,"/console-settings")}))),_&&(U=l.createElement(S.sA,{id:"DEVICE_ADOPTION_UNIFI_EXPRESS",values:{limit:u.limit,link:l.createElement(F.A,{href:B.A.unifiConsoles,id:"DEVICE_ADOPTION_HIGHER_CAPACITY_CONSOLE"})}})));const G=U&&!g;return l.createElement(l.Fragment,null,(0,M.JWq)(e)||(0,M.R$Q)(e)?l.createElement(K.A,{variant:"warning"},l.createElement(L.A,null,l.createElement(S.sA,{id:"DEVICE_POE_PASSTHROUGH_WARNING",values:{port:(0,M.R$Q)(e)?1:2}}))):null,l.createElement(V.A,{className:it,sections:[l.createElement(l.Fragment,null,l.createElement(b.A,{gap:v.kc},l.createElement(Z.A,{model:e.model,size:Q.Xh.MEDIUM,width:40,height:40}),l.createElement(ct,null,l.createElement("div",null,l.createElement(L.A,{weight:"bold"},(0,z.Lm)(e.model))))),m?null:l.createElement(ze,{device:e,onAdoptionInitiated:()=>f(!0),disabled:D}),N?l.createElement(at,{model:n}):null,G&&_&&P?l.createElement(J.A,{device:e,variant:"tertiary"}):null)]}),He.q[i]===Oe.g.ADOPTION_FAILED?l.createElement(j,{last_uplink:c}):null,G?l.createElement($.A,{icon:l.createElement(w.A,{size:"original",isActive:!0,variant:"fill"})},l.createElement(L.A,null,U)):null,D?l.createElement($.A,{icon:l.createElement(Y.k0,{size:"original",variant:"fill",color:p})},l.createElement(L.A,null,l.createElement(S.sA,{id:"DEVICE_RESTRICT_ADOPTION_ONE_CELLULAR_DEVICE",values:{deviceName:d,model:(0,z.Lm)(e.model)}}))):null,l.createElement(Ke.A,null,t?l.createElement(lt.A,null,l.createElement(L.A,{color:"text-2",size:"medium"},l.createElement(S.sA,{id:"COMMON_MAC_ADDRESS"})),l.createElement(L.A,{color:"text-3",size:"medium"},t)):null,r?l.createElement(lt.A,null,l.createElement(L.A,{color:"text-2",size:"medium"},l.createElement(S.sA,{id:"COMMON_IP_ADDRESS"})),l.createElement(L.A,{color:"text-3",size:"medium"},r)):null,o?.imei?l.createElement(lt.A,null,l.createElement(L.A,{color:"text-2",size:"medium"},l.createElement(S.sA,{id:"DEVICE_IMEI"})),l.createElement(L.A,{color:"text-3",size:"medium"},o.imei)):null,o?.esim?.eid?l.createElement(rt.A,{eid:o.esim.eid}):null),h&&y&&!C?l.createElement(Ke.A,{type:Ke.I.BUTTON_LIST},l.createElement(je.A,{activeItem:e})):null,R.length?l.createElement(Ke.A,null,l.createElement(b.A,{flexDirection:"column",gap:v.kc},l.createElement(k.A,{variant:"medium"},l.createElement(S.sA,{id:"DEVICE_MBB_LOCAL_CARRIERS"})),R.map(e=>l.createElement(Ye.R,{key:e.name,carrier:(0,Fe.ap)(e.name),asn:e.asn})))):null)},st=[],Et=(0,l.memo)(e=>{const{activeItem:{type:t,data:n},content:i}=e,c=(0,a.useSelector)(r.oI),o=(0,a.useSelector)(r.Oh),s=(0,a.useSelector)(r.n6),E=c&&c in i.panels?c:i.defaultId,{formatMessage:m}=(0,S.tz)(),d=t===p.H.DEVICE&&!(0,T.YP)(n),A=(0,l.useMemo)(()=>{if(i.singlePanel)return st;const t=Object.keys(i.panels).reduce((t,n)=>{const{disabled:a,title:l,icon:r}=i.panels[n];return a?.({...e})||t.push({value:n,label:l&&m({id:l}),icon:r}),t},[]);return t.length<2?st:d?[{value:i.defaultId,label:m({id:i.panels[i.defaultId].title}),icon:i.panels[i.defaultId].icon}]:t},[e,i,d,m]),u=(0,l.useMemo)(()=>{if(d)return l.createElement(ot,{activeItem:n,key:"adopt-panel"});if((s||o)&&i.subComponent){const e=i.subComponent;return l.createElement(e,{activeItem:n,subPanel:s,subId:o})}const{component:e}=i.panels[E];return l.createElement(e,{activeItem:n,subPanel:c})},[i,n,d,E,o,c,s]);return l.createElement(l.Suspense,{fallback:null},!i.singlePanel&&A.length>1&&!d?l.createElement(P,{tabs:A,currentTab:E}):null,l.createElement(U,{activeItem:n}),u)});var mt=n(260447),dt=n(117639),At=n(282556),ut=n(602021);const _t=()=>{const e=(0,a.useSelector)(At.zi),t=(0,a.useSelector)(A.BQ),n=(0,a.useSelector)(ut.hq),r=(0,l.useMemo)(()=>new Intl.DateTimeFormat(e,{hourCycle:t,month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZone:n}),[e,t,n]);return(0,l.useCallback)(e=>r.format(e),[r])},Ct=(e,t)=>{const n=(0,a.useDispatch)(),r=(0,l.useMemo)(()=>(0,dt.Tl)(t.type,e)?(0,dt.iy)(t.type,e):void 0,[t.type,e]),i=(0,dt.As)(t),c=_t(),o=(0,dt.Zs)(t,(0,S.tz)().formatMessage,c);(0,l.useEffect)(()=>{r&&(void 0!==i.imageId&&void 0!==o?n((0,d.WN)({id:r,element:i.image,label:o,closable:!0})):n((0,d.CY)(r)))},[n,r,o,i.imageId])};var It=n(798517),pt=n(874807);const St=({id:e,type:t})=>{const{formatMessage:n}=(0,S.tz)(),r=(0,a.useSelector)((0,l.useMemo)(()=>e&&(0,mt.B)(t)?.selectData(e,{formatMessage:n})||pt.P1,[e,t,n]))||{};return{type:t,data:r}};var Tt=n(101955);const Dt=({activeItem:{data:e,type:t}})=>{const{formatMessage:n}=(0,S.tz)(),a=_t(),l=(0,mt.B)(t);return l?.renderTitle(l?.getLabel(e,{formatMessage:n,formatDateTime:a})||"",e)||null},Ot=({id:e,panelType:t})=>{const n=(0,l.useRef)(null),c=(0,a.useDispatch)(),{pathname:u}=(0,o.zy)(),C=(0,a.useSelector)(r.WS),p=(0,a.useSelector)(r.Em),S=(0,a.useSelector)(r.aK),T=(0,a.useSelector)(r.LK),D=(0,a.useSelector)(r.gm),O=(0,a.useSelector)(r.S5),v=(0,a.useSelector)(A.P),N=St({id:e,type:t||T});Ct(e,N),(0,m.A)(e);const{views:P,currentViewId:g}=(0,l.useMemo)(()=>({views:v&&O.length>1?O:(0,i.A)(),currentViewId:O.find(({id:e})=>D&&T&&e.includes(D)&&e.includes(T))?.id}),[v,O,T,D]),f=(0,l.useCallback)(e=>{if(e===g){const t=P.filter(({id:t})=>t!==e).pop();if(t?.id){const[e,n]=t.id.split(It._H);c((0,d.XP)({type:e,id:n}))}}c((0,d.CY)(e))},[c,P,g]),h=(0,l.useCallback)(()=>{g&&c((0,d.CY)(g)),c((0,d.DW)(u)),c((0,d.K5)())},[c,g,u]);(0,E.A)(()=>{C&&h()},[C]),(0,l.useEffect)(()=>{C&&!N.type&&h()},[C,N.type,h]);const M=(0,mt.B)(N.type),b=N&&N.type&&Object.keys(N?.data||{})?.length?M?.content:void 0,y="function"==typeof b?b(N.data):b,R=(0,a.useSelector)(r.oI);(0,l.useEffect)(()=>{n.current&&(n.current.scrollTop=0)},[R]);const U=(0,l.useCallback)(e=>{const[t,n]=e.split(It._H);c((0,d.XP)({type:t,id:n}))},[c]);return(0,l.useEffect)(()=>{C&&!y&&h()},[h,C,y]),y?l.createElement(s.A,{key:g,in:C,header:l.createElement(Dt,{activeItem:N}),onClose:h,scrollableRef:n,views:P,currentViewId:g,onViewClick:U,onViewClose:f,className:Tt.X},C?l.createElement(Et,{content:y,activeItem:N}):null,p?l.createElement(I,null):null,S?l.createElement(_,null):null):null};var vt;!function(e){e.TYPE="type",e.ID="id",e.SUB_ID="subId"}(vt||(vt={}));const Nt=Object.values(p.H),Pt=e=>{const t=(0,a.useDispatch)();return(0,l.useEffect)(()=>{const n=new URLSearchParams(e),a=n.get(vt.TYPE),l=n.get(vt.ID),r=n.get(vt.SUB_ID);l&&Nt.includes(a)&&t((0,d.XP)({type:a,id:l,subId:r}))},[t,e]),null};var gt=n(849513),ft=n(212178);const ht=(e,t,n)=>{const i=(0,a.useDispatch)(),{pathname:c}=(0,o.zy)(),s=(0,ft.A)(c),E=(0,ft.A)(e),m=(0,a.useSelector)(r.oI),A=(0,a.useSelector)(r.SP),u=(0,a.useSelector)(r.RJ);return(0,l.useEffect)(()=>{if(c!==s||e!==E){t&&n&&(s||E)&&!A&&i((0,d.mn)({[s||E]:{[gt.QK.ID]:t,[gt.QK.TYPE]:n,[gt.QK.TAB]:m}}));const a=u[c||e];i(a&&!A?(0,d.XP)({[gt.QK.ID]:a[gt.QK.ID],[gt.QK.TYPE]:a[gt.QK.TYPE],[gt.QK.TAB]:a[gt.QK.TAB]}):(0,d.K5)())}},[i,c,s,e,E,t,n,m,u,A]),null};var Mt=n(627440);const bt=new RegExp(`/${Mt.VO.DEVICES}/properties/(.*)`),yt=e=>{const t=(0,a.useDispatch)();(0,l.useEffect)(()=>{const n=e.match(bt)?.[1]?.split("/")?.[0];n&&t((0,d.XP)({type:p.H.DEVICE,id:n}))},[t,e])};var Rt=n(775586);const Ut=({id:e,type:t})=>{const n=(0,l.useMemo)(()=>(0,mt.B)(t)?.dependencies||(0,i.A)(),[t]);return(0,c.A)(n,l.createElement(Ot,{id:e,panelType:t}))},Vt=(0,l.memo)(()=>{const{pathname:e,search:t}=(0,Rt.A)(),n=(0,a.useSelector)(r.gm),i=(0,a.useSelector)(r.LK);ht(e,n,i),yt(e),Pt(t);const c=(0,l.useMemo)(()=>[n,i].join(),[n,i]);return n&&i?l.createElement(Ut,{key:c,id:n,type:i}):null})},675845:(e,t,n)=>{n.d(t,{Z:()=>l,z:()=>r});var a=n(6510);const l=(e,t)=>e?t.find(({mac:t})=>t===e):void 0,r=(e,t,n,l)=>{const r=t?` ${l({id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER"},{port:t})}`:"";return e?`${e}${r}`:n?`${(0,a.Q)(n)}${r}`:l({id:"COMMON_FALLBACK"})}},775586:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(956347),l=n(296540);const r=()=>{const e=(0,a.zy)(),[t,n]=(0,l.useState)(e.search),[r,i]=(0,l.useState)(e.pathname),c=(0,l.useCallback)(e=>{const{search:t,pathname:a}=e.target.location;n(t),i(a)},[]);return(0,l.useEffect)(()=>(window.addEventListener("replacestate",c),()=>{window.removeEventListener("replacestate",c)})),{search:t,pathname:r}}},777741:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(296540),l=n(217439),r=n(115829),i=n(360113),c=n(699784);const o=({eid:e})=>e?a.createElement(i.A,{valueMaxWidth:270},a.createElement(l.A,{color:"text-2"},a.createElement(c.sA,{id:"DEVICE_ESIM_EID"})),a.createElement(r.A,{color:"text-3",size:"medium",flexProps:{justifyContent:"flex-end"}},e)):null},785976:(e,t,n)=>{n.d(t,{O:()=>i,g:()=>c});var a=n(602197);const l=2;var r=n(837612);const i=e=>{const t=(0,r.S9)(e);return[a.g.PENDING,a.g.ADOPTION_REQUIRED,a.g.ADOPTING].includes(t)&&(!e.unsupported||e.adoptable_when_upgraded)},c=e=>{const t=(0,r.S9)(e),n=e.adoptable_when_upgraded??(e.unsupported&&e.unsupported_reason===l),i=!e.unsupported||n;return[a.g.ADOPTION_FAILED].includes(t)&&i}},813040:(e,t,n)=>{n.d(t,{A:()=>d,R:()=>m});var a=n(296540),l=n(822336),r=n(718073),i=n(71479),c=n(566723),o=n(294303),s=n(252093);const E=(0,i.A)(o.A)`
  flex-direction: column;
  height: ${48}px;
  border-bottom: ${({theme:{themeName:e}})=>l.Ay[`desktop-border-divider-${e}`]};
  padding: ${c.xO} 0;
  position: relative;
  .tooltip-position-fixer {
    margin-right: -${c.Ln};
  }
`,m=({tooltipId:e,disabledTooltip:t,children:n,tooltipProps:l={},...i})=>a.createElement(E,{...i},a.createElement(o.A,{justifyContent:"space-between",alignItems:"center"},a.createElement(r.A,{description:t,placement:"left"},a.createElement("span",null,n)),e?a.createElement(s.A,{messageId:e,tooltipClassName:"tooltip-position-fixer",variant:"outline",...l}):null)),d=m},906936:(e,t,n)=>{n.d(t,{A:()=>_});var a=n(296540),l=n(819663),r=n(162420),i=n(823858),c=n(793336),o=n(71479),s=n(998837),E=n(566723),m=n(294303);const d=(0,o.A)(m.A,{shouldForwardProp:e=>!["borderColor","backgroundColor","dividerColor"].includes(e)})`
  background-color: ${({backgroundColor:e})=>e};
  border-left: 2px solid ${({borderColor:e})=>e};
  padding: ${E.Ln} ${E.Ln} ${E.Ln} 0;

  & + & {
    border-top: 1px solid ${({dividerColor:e})=>e};
  }
`,A=(0,o.A)(m.A)`
  min-width: 36px;
  max-width: 36px;
`,u=(e,{warning:t,neutral01:n,danger:o,info:s})=>{switch(e){case"warning":return{icon:a.createElement(i.A,{size:"medium",color:t,variant:"fill"}),backgroundColor:n,borderColor:t,dividerColor:(0,l.A)(t).alpha(.2).css()};case"danger":return{icon:a.createElement(c.A,{size:"medium",color:o,variant:"fill"}),backgroundColor:n,borderColor:o,dividerColor:(0,l.A)(o).alpha(.2).css()};default:return{icon:a.createElement(r.A,{isActive:!0,size:"original"}),backgroundColor:n,borderColor:s,dividerColor:(0,l.A)(s).alpha(.2).css()}}},_=({level:e,children:t,overrideLevel:n})=>{const{motifPalette:l}=(0,s.u)(),{icon:r,backgroundColor:i,borderColor:c,dividerColor:o}={...u(e,l),...n};return a.createElement(d,{flexDirection:"row",width:"100%",backgroundColor:i,borderColor:c,dividerColor:o},a.createElement(A,{justifyContent:"center"},r),a.createElement(m.A,{flexDirection:"column",justifyContent:"center"},t))}},935780:(e,t,n)=>{n.d(t,{A:()=>O});var a=n(469733),l=n(296540),r=n(592510),i=n(525512),c=n(413914),o=n(687573),s=n(648092),E=n(906593),m=n(171073);const d=new Map,A="device-watch-mode-listener";var u=n(801081),_=n(189601),C=n(602021),I=n(602197),p=n(532419),S=n(960987);var T,D;!function(e){e.DEVICE_MAC="device_mac",e.IS_WATCHED="is_watched",e.WATCHED_TIMEOUT="watched_timeout",e.UPDATE_INTERVAL_SECONDS="update_interval_seconds"}(T||(T={})),function(e){e.INSTANCES="instances",e.TIMEOUT="timeout"}(D||(D={}));const O=e=>{const t=(0,a.useDispatch)(),n=(0,a.useSelector)((0,l.useMemo)(()=>{return t=e,(0,_.WY)()((0,u.Mz)((0,p.tG)(t),C.vc,({mac:e,state:t},n)=>e&&n&&e!==n&&t===S.A[I.g.CONNECTED]),e=>e);var t},[e])),O=(0,a.useSelector)(s.a),v=(0,l.useMemo)(()=>O[E.Uz],[O]),N=(0,l.useCallback)(e=>{v.send({type:c.E.WATCH_DEVICE,device_mac:e})},[v]),P=(0,l.useCallback)(e=>{if(e[T.IS_WATCHED]){const t=1e3*e[T.WATCHED_TIMEOUT];if(t>Date.now()){const n=d.get(e[T.DEVICE_MAC]);n&&(n[D.TIMEOUT]=setTimeout(()=>{N(e[T.DEVICE_MAC])},(e=>Math.max(e-Date.now()-5e3,5e3))(t)))}}},[N]),g=(0,l.useCallback)(e=>(0,i.K6)(e,P,!1,(e=>`${A}::${e}`)(e)),[P]);(0,l.useEffect)(()=>{if(n){Object.keys((0,i.WM)()).some(e=>e.startsWith(A))||o._[c.E.WATCH_DEVICE].map(g);const t=d.get(e);t?t[D.INSTANCES]+=1:(N(e),d.set(e,{[D.INSTANCES]:1,[D.TIMEOUT]:void 0}))}return()=>{const t=d.get(e);t&&(t[D.INSTANCES]>1?t[D.INSTANCES]-=1:(clearTimeout(t[D.TIMEOUT]),d.delete(e)),d.size||Object.keys((0,i.WM)()).filter(e=>e.startsWith(A)).forEach(i.$N))}},[N,g,e,n]),(0,l.useEffect)(()=>{t((0,m.Uc)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}))},[t])}},949909:(e,t,n)=>{var a;n.d(t,{S:()=>a}),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"}(a||(a={}))},973581:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(296540);const l=(e,t=[])=>{const n=t=>{27===t.keyCode&&e(t)};(0,a.useEffect)(()=>(document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}),t)}}}]);