"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[17696],{964795(e,t,n){n.d(t,{O:()=>a,g:()=>r});var i=n(45978);var s=n(434521);const a=e=>{const t=(0,s.S9)(e);return[i.g.PENDING,i.g.ADOPTION_REQUIRED,i.g.ADOPTING].includes(t)&&(!e.unsupported||e.adoptable_when_upgraded)},r=e=>{const t=(0,s.S9)(e),n=!e.unsupported||(e.adoptable_when_upgraded??(e.unsupported&&2===e.unsupported_reason));return[i.g.ADOPTION_FAILED].includes(t)&&n}},889702(e,t,n){var i;n.d(t,{S:()=>i}),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"}(i||(i={}))},952566(e,t,n){n.d(t,{p:()=>l});var i=n(222102),s=n(591256),a=n(897166),r=n(570801),o=n(889702);const l=e=>(0,i.Mz)(a.ah,s.pw,a.dK,r.fR,(t,n,i,s)=>{switch(e){case o.S.API_DEVICE_ADOPT:case o.S.API_DEVICE_RESTART:return i||t.includes(e);case o.S.API_WIDGET_OS_STATS:return s||n.includes(e);default:return i}})},88945(e,t,n){n.d(t,{A:()=>l});var i=n(274934),s=n(3651),a=n(626324),r=n(642687),o=n(470070);const l=({onCancel:e,onConfirm:t,cssProperties:n})=>(0,i.jsx)(a.aF.Root,{isOpen:!0,children:(0,i.jsx)(s.A,{actionButtons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.A,{type:"button",variant:"neutral",onPress:e,children:(0,i.jsx)(o.sA,{id:"COMMON_UNSAVED_CHANGES_STAY"})}),(0,i.jsx)(r.A,{type:"button",variant:"destructive",onPress:t,children:(0,i.jsx)(o.sA,{id:"COMMON_UNSAVED_CHANGES_LEAVE"})})]}),title:(0,o.tz)().formatMessage({id:"COMMON_UNSAVED_CHANGES_TITLE"}),width:"small",isDismissable:!1,onClose:e,style:n,children:(0,i.jsx)(o.sA,{id:"COMMON_UNSAVED_CHANGES_CONTENT"})})})},626404(e,t,n){n.d(t,{A:()=>l});var i=n(274934),s=n(602086),a=n(290190),r=n.n(a);var o=n(88945);const l=({ignoredPaths:e,onLeave:t,beforeOnLeave:n,zIndex:a})=>{const l=(e=>(t,n)=>null==e||!t||!n||![].concat(e).some(e=>"string"==typeof e?n.pathname===e&&t.pathname===e:e instanceof RegExp&&(e.test(n.pathname)||e.test(t.pathname))))(e),c=(0,s.useMemo)(()=>(e,t)=>l(e,t)&&((e,t)=>t?.pathname!==e.pathname)(e,t),[l]),d=(0,s.useCallback)(e=>{n?.(),e()},[n]);return(0,i.jsx)(r(),{when:c,afterConfirm:t,beforeConfirm:d,children:({onCancel:e,onConfirm:t})=>(0,i.jsx)(o.A,{onCancel:e,onConfirm:t,cssProperties:{zIndex:a}})})}},45216(e,t,n){n.d(t,{A:()=>l});var i=n(274934),s=n(938984),a=n(309130),r=n(100978),o=n(254193);const l=({groupSize:e=4,maxWidth:t,value:n})=>{return(0,i.jsxs)(r.A,{alignItems:"flex-start",children:[(0,i.jsx)(r.A,{gap:a.YC,rowGap:0,flexFlow:"row wrap",maxWidth:t,justifyContent:"space-between",children:(l=n,c=e,l.match(new RegExp(`.{1,${c}}`,"g"))??[]).map(e=>(0,i.jsx)(s.A,{color:"text-3",size:"medium",children:e}))}),(0,i.jsx)(o.A,{value:n})]});var l,c}},620627(e,t,n){n.d(t,{A:()=>A});var i=n(274934),s=n(938984),a=n(247816),r=n(309130),o=n(100978),l=n(535322);const c=(0,a.A)("div")`
  margin-right: ${r.kc};
`,d=(0,a.A)("div")`
  margin-left: ${r.kc};
`,A=({icon:e,closeIcon:t,nested:n,children:a,...r})=>(0,i.jsx)(l.A,{nested:n,...r,children:(0,i.jsxs)(o.A,{children:[(0,i.jsx)(c,{children:e}),(0,i.jsx)(s.A,{size:"medium",children:a}),t?(0,i.jsx)(d,{children:t}):null]})})},54849(e,t,n){n.d(t,{A:()=>U});var i=n(274934),s=n(814557),a=n(602086),r=n(977872),o=n(125799),l=n(938984),c=n(247816),d=n(263705),A=n(409844),m=n(347625),u=n(250266),E=n(205521),C=n(470070),_=n(20049),I=n(177173),h=n(212635),x=n(251905),p=n(10695),j=n(393629),O=n(561500),T=n(598990),v=n(897166),D=n(434521),S=n(45978),g=n(795206),N=n(427714),P=n(408402),f=n(648576),M=n(291508);const R=(0,c.A)(f.Ay,(0,M.A)("disabled"))`
  padding: 0;
  ${({disabled:e})=>e?"pointer-events: none; opacity: 0.4;":""};
  color: ${({theme:{themeName:e,motifPalette:{red05:t}},disabled:n})=>n?t:s.Ay[`desktop-color-red-06-${e}`]};
  &:hover {
    color: ${({theme:{motifPalette:{red05:e}}})=>e};
  }
  &:active {
    color: ${({theme:{motifPalette:{red05:e,red07:t}},disabled:n})=>n?e:t};
  }
`,b=A.AH`
  flex: 1;
  width: 100%;
`,y=e=>(0,i.jsx)(o.A,{portal:!0,width:180,description:(0,i.jsx)(l.A,{style:{whiteSpace:"pre-wrap"},children:(0,i.jsx)(C.sA,{id:"DEVICE_ACTIONS_REMOVE_TOOLTIP"})}),className:b,children:e}),U=({device:e,disabled:t,variant:n})=>{const s=(0,r.wA)(),o=(0,d.u)(),[c,A]=(0,a.useState)(!1),[M,U]=(0,a.useState)(!1),k=(0,r.d4)(v.EL),w=(0,r.d4)(_.OA),V=(0,D.S9)(e),{isDeviceDisconnected:L,isDeviceAdoptionFailed:z,deviceBusy:$}=(0,a.useMemo)(()=>({isDeviceDisconnected:V===S.g.DISCONNECTED,isDeviceAdoptionFailed:V===S.g.ADOPTION_FAILED,deviceBusy:(0,D.C1)(V)}),[V]),G=(0,a.useMemo)(()=>t||$||k,[t,$,k]),W=(0,a.useMemo)(()=>(0,m.Q)({name:e.name,model:e.model,mac:e.mac}),[e.name,e.model,e.mac]),H=(0,a.useCallback)(()=>{const{id:t,type:n}=(0,x.Se)(w);n===h.F7.DEVICE&&t===e.mac&&(s((0,p.U)(I.Zt)),s((0,p.Ao)([])))},[e.mac,s,w]),F=(0,a.useCallback)(async()=>{A(!0),s((0,O.Yl)(e.mac)).then(()=>{H(),s((0,j.W)(e.mac)),s((0,g.XL)(e.mac)),A(!1),U(!1),s((0,E.K5)()),s((0,T.Uc)()),s((0,N.O)())}).finally(()=>{A(!1),U(!1)})},[e.mac,s,H]),B=(0,a.useCallback)(()=>{A(!1),U(!1)},[]),Y=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),U(!0)},[]);return(0,i.jsx)(P.A,{condition:$,wrapper:y,children:(0,i.jsx)(u.A,{isOpen:M,title:"COMMON_ACTION_REMOVE_CONFIRM_TITLE",titleValues:{deviceName:W},message:L||z?"DEVICE_DISCONNECTED_ACTIONS_REMOVE_CONFIRM_MESSAGE":"DEVICE_ACTIONS_REMOVE_CONFIRM_MESSAGE",messageValues:{deviceName:W},buttonMessage:"COMMON_ACTION_REMOVE",buttonVariant:"danger",handleConfirm:F,handleClose:B,className:"tertiary"===n?b:"",children:(0,i.jsx)(R,{disabled:G,variant:"tertiary"===n?void 0:"link",className:"tertiary"===n?(0,f.sC)(o):"",onClick:Y,loader:c?"spinner":null,type:"button",children:(0,i.jsx)(l.A,{color:"red-06",size:"medium",children:(0,i.jsx)(C.sA,{id:"COMMON_ACTION_REMOVE"})})})})})}},748094(e,t,n){n.d(t,{A:()=>_});var i=n(274934),s=n(814557),a=n(602086),r=n(599110),o=n(938984),l=n(853777),c=n(600191),d=n(847399),A=n(263705),m=n(613842),u=n(470070),E=n(620627),C=n(100978);const _=(0,a.memo)(({children:e,customIcon:t,link:n,nested:_,extra:I,variant:h="warning",...x})=>{const{themeName:p}=(0,A.u)(),j=(0,a.useMemo)(()=>{switch(h){case"warning":return(0,i.jsx)(c.A,{size:"original",color:s.Ay[`desktop-color-orange-06-${p}`],variant:"fill"});case"info":return(0,i.jsx)(l.A,{isActive:!0,size:"original",variant:"fill"});case"custom":return t;default:return(0,i.jsx)(d.A,{size:"medium",color:s.Ay[`desktop-color-red-06-${p}`],variant:"fill"})}},[h,p,t]),O=(0,a.useCallback)(()=>{m.A.open(n)},[n]);return(0,i.jsx)(E.A,{icon:j,nested:_,...x,children:(0,i.jsxs)(C.A,{flexDirection:"column",alignItems:"flex-start",children:[(0,i.jsx)(o.A,{children:e}),(0,i.jsx)(o.A,{children:n?(0,i.jsx)(r.A,{type:"button",variant:"inline",onClick:O,children:(0,i.jsx)(u.sA,{id:"COMMON_LEARN_MORE"})}):null}),I]})})})},374402(e,t,n){n.d(t,{X:()=>i,c:()=>s});const i="PROPERTY_PANEL_CLASSNAME",s=[]},279279(e,t,n){n.d(t,{A:()=>l});var i=n(977872),s=n(602086),a=n(820633),r=n(897166),o=n(570801);const l=()=>{const e=(0,i.d4)(a.zi),t=(0,i.d4)(o.BQ),n=(0,i.d4)(r.hq),l=(0,s.useMemo)(()=>new Intl.DateTimeFormat(e,{hourCycle:t,month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZone:n}),[e,t,n]);return(0,s.useCallback)(e=>l.format(e),[l])}},208583(e,t,n){n.d(t,{Z:()=>s,z:()=>a});var i=n(347625);const s=(e,t)=>e?t.find(({mac:t})=>t===e):void 0,a=(e,t,n,s,a)=>{const r=!a&&t?` ${s({id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER"},{port:t})}`:"";return e?`${e}${r}`:n?`${(0,i.Q)(n)}${r}`:s({id:"COMMON_FALLBACK"})}},721398(e,t,n){n.d(t,{A:()=>o});var i=n(274934),s=n(125799),a=n(853777),r=n(470070);const o=({messageId:e,tooltipClassName:t,values:n,isInteractive:o,portal:l,variant:c="twoTone",size:d="medium"})=>(0,i.jsx)(s.A,{description:(0,i.jsx)(r.sA,{id:e,values:n}),width:210,isInteractive:o,portal:l,tooltipClassName:t,children:(0,i.jsx)(a.A,{isActive:!0,omitSvgMargin:!0,variant:c,size:d})})},667758(e,t,n){n.d(t,{A:()=>l});var i=n(274934),s=n(938984),a=n(664092),r=n(470070),o=n(45216);const l=({eid:e})=>e?(0,i.jsxs)(a.A,{flexProps:{height:"auto"},children:[(0,i.jsx)(s.A,{color:"text-2",size:"medium",children:(0,i.jsx)(r.sA,{id:"DEVICE_ESIM_EID"})}),(0,i.jsx)(o.A,{maxWidth:145,value:e})]}):null},303008(e,t,n){n.d(t,{A:()=>l});var i=n(274934),s=n(938984),a=n(470070),r=n(45216),o=n(664092);const l=({imei:e})=>(0,i.jsxs)(o.A,{flexProps:{height:"auto"},children:[(0,i.jsx)(s.A,{color:"text-2",size:"medium",children:(0,i.jsx)(a.sA,{id:"DEVICE_IMEI"})}),(0,i.jsx)(r.A,{maxWidth:141,value:e})]})},956731(e,t,n){n.d(t,{A:()=>m,R:()=>A});var i=n(274934),s=n(814557),a=n(247816),r=n(669439),o=n(309130),l=n(100978),c=n(721398);const d=(0,a.A)(l.A)`
  flex-direction: column;
  height: ${48}px;
  border-bottom: ${({theme:{themeName:e}})=>s.Ay[`desktop-border-divider-${e}`]};
  padding: ${o.xO} 0;
  position: relative;
  .tooltip-position-fixer {
    margin-right: -${o.Ln};
  }
`,A=({tooltipId:e,disabledTooltip:t,children:n,tooltipProps:s={},...a})=>(0,i.jsx)(d,{...a,children:(0,i.jsxs)(l.A,{justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(r.A,{description:t,placement:"left",children:(0,i.jsx)("span",{children:n})}),e?(0,i.jsx)(c.A,{messageId:e,tooltipClassName:"tooltip-position-fixer",variant:"outline",...s}):null]})}),m=A},254193(e,t,n){n.d(t,{A:()=>l});var i=n(274934),s=n(602086),a=n(954702),r=n(688684),o=n(316628);const l=({value:e})=>{const t=(0,o.A)(),n=(0,s.useCallback)(()=>t(e),[e,t]);return(0,i.jsx)(a.A,{onPress:n,variant:"neutral",children:(0,i.jsx)(r.A,{size:"original"})})}},664092(e,t,n){n.d(t,{A:()=>c});var i=n(274934),s=n(247816),a=n(309130),r=n(100978),o=n(291508);const l=(0,s.A)(r.A,(0,o.A)("valueMaxWidth","keyMinWidth","compact"))`
  &:not(:last-child) {
    ${({compact:e})=>e?"":`margin-bottom: ${a.kc};`}
  }
  & > {
    &:nth-child(1) {
      min-width: ${({keyMinWidth:e})=>e}px;
    }
    &:nth-child(2) {
      max-width: ${({valueMaxWidth:e})=>e}px;
    }
  }
`,c=({children:e,valueMaxWidth:t=215,keyMinWidth:n=0,flexProps:s={},compact:r=!1})=>(0,i.jsx)(l,{width:"100%",justifyContent:"space-between",gap:a.kc,height:r?void 0:24,valueMaxWidth:t,keyMinWidth:n,compact:r,...s,children:e})},633797(e,t,n){n.d(t,{A:()=>I});var i=n(274934),s=n(903736),a=n.n(s),r=n(853777),o=n(600191),l=n(847399),c=n(247816),d=n(263705),A=n(309130),m=n(100978),u=n(291508);const E=(0,c.A)(m.A,(0,u.A)("borderColor","backgroundColor","dividerColor"))`
  background-color: ${({backgroundColor:e})=>e};
  border-left: 2px solid ${({borderColor:e})=>e};
  padding: ${A.Ln} ${A.Ln} ${A.Ln} 0;

  & + & {
    border-top: 1px solid ${({dividerColor:e})=>e};
  }
`,C=(0,c.A)(m.A)`
  min-width: 36px;
  max-width: 36px;
`,_=(e,{warning:t,neutral01:n,danger:s,info:c})=>{switch(e){case"warning":return{icon:(0,i.jsx)(o.A,{size:"medium",color:t,variant:"fill"}),backgroundColor:n,borderColor:t,dividerColor:a()(t).alpha(.2).css()};case"danger":return{icon:(0,i.jsx)(l.A,{size:"medium",color:s,variant:"fill"}),backgroundColor:n,borderColor:s,dividerColor:a()(s).alpha(.2).css()};default:return{icon:(0,i.jsx)(r.A,{isActive:!0,size:"original"}),backgroundColor:n,borderColor:c,dividerColor:a()(c).alpha(.2).css()}}},I=({level:e,children:t,overrideLevel:n})=>{const{motifPalette:s}=(0,d.u)(),{icon:a,backgroundColor:r,borderColor:o,dividerColor:l}={..._(e,s),...n};return(0,i.jsxs)(E,{flexDirection:"row",width:"100%",backgroundColor:r,borderColor:o,dividerColor:l,children:[(0,i.jsx)(C,{justifyContent:"center",children:a}),(0,i.jsx)(m.A,{flexDirection:"column",justifyContent:"center",children:t})]})}},769778(e,t,n){n.d(t,{R:()=>E,n:()=>u});var i=n(274934),s=n(75033),a=n(309130),r=n(421314),o=n(579902),l=n(100978),c=n(726831),d=n(244398);const A={width:"auto",maxWidth:"80px",height:"20px"},m=`${c.A.asnPath}65534${d.m1}`,u={ATT:7018,TMOBILE:21928,VERIZON:701},E=({carrier:e,asn:t})=>e?(0,i.jsxs)(l.A,{gap:a.YC,flex:"0 1 auto",overflow:"hidden",children:[(0,i.jsx)(l.A,{flex:"0 0 auto",children:void 0!==t?(0,i.jsx)(o.A,{asn:t,style:A,useFallback:!0,customFallback:m}):(0,i.jsx)(s.A,{size:"original"})}),(0,i.jsx)(r.A,{color:"text-2",size:"medium",children:e})]}):null},463872(e,t,n){n.d(t,{A:()=>T});var i=n(274934),s=n(977872),a=n(558948),r=n(535322),o=n(309130),l=n(100978),c=n(887481),d=n(291935),A=n(956978),m=n(938984),u=n(470070),E=n(769778);const C=({children:e})=>(0,i.jsx)(m.A,{color:"text-3",size:"small",children:e}),_=({children:e,reference:t})=>(0,i.jsxs)(l.A,{gap:o.YC,children:[(0,i.jsx)(l.A,{width:12,children:(0,i.jsx)(C,{children:t})}),(0,i.jsx)(l.A,{children:(0,i.jsx)(m.A,{color:"text-3",size:"small",children:e})})]}),I=({children:e,reference:t})=>(0,i.jsxs)(l.A,{children:[e,(0,i.jsx)(C,{children:t})]}),h=()=>(0,i.jsxs)(l.A,{flexDirection:"column",gap:o.YC,children:[(0,i.jsxs)(l.A,{children:[(0,i.jsxs)(m.A,{color:"text-2",size:"medium",children:[(0,i.jsx)(u.sA,{id:"DEVICE_CERTIFIED_WITH"})," "]}),(0,i.jsxs)(l.A,{gap:o.kc,children:[(0,i.jsx)(E.R,{carrier:(0,i.jsx)(u.sA,{id:"DEVICE_CARRIER_ATT"}),asn:E.n.ATT}),(0,i.jsx)(I,{reference:"*",children:(0,i.jsx)(E.R,{carrier:(0,i.jsx)(u.sA,{id:"DEVICE_CARRIER_TMOBILE"}),asn:E.n.TMOBILE})})]})]}),(0,i.jsx)(_,{reference:"*",children:(0,i.jsx)(u.sA,{id:"DEVICE_TMOBILE_NOT_SUPPORTED",values:{br:(0,i.jsx)("br",{})}})}),(0,i.jsx)(_,{reference:"**",children:(0,i.jsx)(u.sA,{id:"DEVICE_CARRIER_NOT_SUPPORTED",values:{carrier:(0,i.jsx)(u.sA,{id:"DEVICE_CARRIER_VERIZON"})}})})]});var x=n(303008),p=n(667758),j=n(262768);const O=({networkScanOperators:e=[]})=>e.length?(0,i.jsxs)(l.A,{gap:o.kc,children:[(0,i.jsxs)(m.A,{color:"text-2",size:"medium",children:[(0,i.jsx)(u.sA,{id:"DEVICE_MBB_LOCAL_CARRIERS"}),":"]}),e.map(e=>(0,i.jsx)(E.R,{carrier:(0,j.ap)(e.name),asn:e.asn},e.name))]}):null,T=({imei:e,eId:t,networkScanOperators:n=[],model:m})=>{const u=(0,s.d4)(d.AP),E=(0,A.uMn)({model:m})||(0,A.KLl)({model:m})||(0,A.evX)({model:m})||(0,A.ocB)({model:m}),C=(0,c.Kq)(u)&&E;return e||t||n?.length||C?(0,i.jsx)(r.A,{children:(0,i.jsxs)(l.A,{flexDirection:"column",gap:o.kc,children:[(0,i.jsxs)(l.A,{flexDirection:"column",gap:o.xO,paddingBottom:o.YC,children:[C?(0,i.jsx)(h,{}):(0,i.jsx)(O,{networkScanOperators:n}),(0,i.jsx)(a.A,{})]}),e?(0,i.jsx)(x.A,{imei:e}):null,t?(0,i.jsx)(p.A,{eid:t}):null]})}):null}},286462(e,t,n){n.d(t,{A:()=>R});var i=n(274934),s=n(956731),a=n(814557),r=n(977872),o=n(602086),l=n(125799),c=n(938984),d=n(247816),A=n(263705),m=n(409844),u=n(250266),E=n(408402),C=n(648576),_=n(205521),I=n(470070),h=n(29472),x=n(193730);const p=`${n(290454).J}/cmd/devmgr/ubb-unpair`;var j=n(393629),O=n(897166),T=n(434521),v=n(45978),D=n(795206),S=n(427714),g=n(291508);const N=(0,d.A)(C.Ay,(0,g.A)("disabled"))`
  padding: 0;
  ${({disabled:e})=>e?"pointer-events: none; opacity: 0.4;":""};
  color: ${({theme:{themeName:e,motifPalette:{red05:t}},disabled:n})=>n?t:a.Ay[`desktop-color-red-06-${e}`]};
  &:hover {
    color: ${({theme:{motifPalette:{red05:e}}})=>e};
  }
  &:active {
    color: ${({theme:{motifPalette:{red05:e,red07:t}},disabled:n})=>n?e:t};
  }
`,P=m.AH`
  flex: 1;
  width: 100%;
`,f=e=>(0,i.jsx)(l.A,{portal:!0,description:(0,i.jsx)(c.A,{style:{whiteSpace:"pre-wrap"},children:(0,i.jsx)(I.sA,{id:"DEVICE_ACTIONS_REMOVE_TOOLTIP"})}),className:P,children:e}),M=({device:e,disabled:t,variant:n})=>{const s=(0,r.wA)(),a=(0,A.u)(),[l,d]=(0,o.useState)(!1),[m,g]=(0,o.useState)(!1),M=(0,r.d4)(O.EL),R=(0,T.S9)(e),{isDeviceDisconnected:b,isDeviceAdoptionFailed:y,deviceBusy:U}=(0,o.useMemo)(()=>({isDeviceDisconnected:R===v.g.DISCONNECTED,isDeviceAdoptionFailed:R===v.g.ADOPTION_FAILED,deviceBusy:(0,T.C1)(R)}),[R]),k=(0,o.useMemo)(()=>t||U||M||b||y,[t,U,M,b,y]),w=(0,o.useMemo)(()=>"tertiary"===n,[n]);return(0,i.jsx)(E.A,{condition:U,wrapper:f,children:(0,i.jsx)(u.A,{isOpen:m,title:"DEVICE_ACTIONS_UNPAIR_CONFIRM_TITLE",message:"DEVICE_ACTIONS_UNPAIR_CONFIRM_MESSAGE",buttonMessage:"COMMON_ACTION_PROCEED",buttonVariant:"danger",handleConfirm:async()=>{var t;d(!0),s((t=e.mac,(0,h.Xj)(x.A.UBB_UNPAIR,p,{mac:t}))).then(()=>{s((0,j.W)(e.mac)),s((0,D.XL)(e.mac)),d(!1),g(!1),s((0,_.K5)()),s((0,S.O)())}).finally(()=>{d(!1),g(!1)})},handleClose:()=>{d(!1),g(!1)},className:w?P:"",children:(0,i.jsx)(N,{disabled:k,variant:w?void 0:"link",className:w?(0,C.sC)(a):"",onClick:e=>{e.preventDefault(),e.stopPropagation(),g(!0)},loader:l?"spinner":null,type:"button",children:(0,i.jsx)(c.A,{color:"red-06",size:"medium",children:(0,i.jsx)(I.sA,{id:"COMMON_ACTION_UNPAIR"})})})})})},R=({activeItem:e})=>(0,i.jsx)(s.R,{tooltipId:"DEVICE_ACTIONS_UNPAIR_INFO",tooltipProps:{tooltipClassName:"tooltip-position-fixer",variant:"outline"},children:(0,i.jsx)(M,{device:e})})},17696(e,t,n){n.r(t),n.d(t,{default:()=>vt});var i=n(274934),s=n(602086),a=n(977872),r=n(254585),o=n(720770),l=n(724081),c=n(237725),d=n(852531),A=n(105472),m=n(279740),u=n(205521),E=n(570801),C=n(626404);const _=()=>{const e=(0,a.wA)(),t=(0,s.useCallback)(()=>{e((0,u.SQ)(!1))},[e]);return(0,i.jsx)(C.A,{onLeave:t})};var I=n(88945);const h=()=>{const e=(0,a.wA)(),t=(0,s.useCallback)(()=>{e((0,u.Fr)())},[e]),n=(0,s.useCallback)(()=>{e((0,u.nw)())},[e]);return(0,i.jsx)(I.A,{onCancel:t,onConfirm:n})};var x=n(449339),p=n(470070),j=n(434521),O=n(92151),T=n(247816),v=n(309130);const D=(0,T.A)(O.A)`
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: ${v.Ln};
`,S=(0,s.memo)(({tabs:e,currentTab:t})=>{const n=(0,a.wA)(),r=(0,s.useCallback)(e=>{n((0,u.X2)(e))},[n]);return e?.length?(0,i.jsx)(D,{tabs:e,value:t,iconOnly:!0,onChange:r,tooltipProps:{animate:!1}}):null});var g=n(814557),N=n(443502),P=n(225211),f=n(956978),M=n(100978);const R=(0,T.A)(M.A)`
  background-color: ${N.PA.success};
  color: ${N.N0};
  font-size: 11px;
`,b=(0,T.A)("div")`
  font-weight: ${g.Ay["desktop-font-weight-semibold"]};
  margin-bottom: ${v.YC};
`,y=({activeItem:e})=>(e=>Object(e)===e&&"type"in e&&"model"in e&&"adopted"in e&&!("product_line"in e))(e)&&(0,f.tNJ)(e)&&(0,f.Vly)(e)?(0,i.jsxs)(R,{flex:"none",height:50,minHeight:50,padding:`${v.kc} ${v.fS}`,position:"relative",children:[(0,i.jsx)(M.A,{alignItems:"center",justifyContent:"center",marginRight:v.Ln,children:(0,i.jsx)(P.A,{width:18,height:18,strength:(0,f.KwR)(e),color:"currentColor",inactiveColor:N.kv})}),(0,i.jsxs)(M.A,{flexDirection:"column",justifyContent:"center",flex:1,children:[(0,i.jsx)(b,{children:(0,i.jsx)(p.sA,{id:"DEVICE_ULTE_IS_ACTIVE_TITLE"})}),(0,i.jsx)(p.sA,{id:"DEVICE_ULTE_IS_ACTIVE_DETAILS"})]})]}):null;var U=n(135469),k=n(938984),w=n(853777),V=n(263705),L=n(409844),z=n(347625),$=n(586566),G=n(620627),W=n(793442),H=n(754924),F=n(726831),B=n(208583);const Y=({last_uplink:e={}})=>{const{formatMessage:t}=(0,p.tz)(),n=(0,a.d4)(H.CC),s=(0,B.Z)(e.uplink_mac,n),r=(0,B.z)(e.uplink_device_name,e.uplink_remote_port,s,t);return(0,i.jsx)(G.A,{icon:(0,i.jsx)(w.A,{size:"original",isActive:!0,variant:"fill"}),children:(0,i.jsx)(k.A,{children:(0,i.jsx)(p.sA,{id:"COMMON_DEVICE_CONNECTION_INTERRUPTED_WARNING",values:{strong:p.ko,uplinkDeviceName:r||(0,i.jsx)(p.sA,{id:"COMMON_UNKNOWN"}),link:(0,i.jsx)(W.A,{href:F.A.offlineArticle,id:"COMMON_HERE",noWrap:!0})}})})})};var K=n(251263),X=n(748094),Q=n(541819),Z=n(974390),q=n(54849),J=n(425040),ee=n(87449),te=n(599110),ne=n(244081),ie=n(890932),se=n(871808),ae=n(815436),re=n(988757),oe=n(700444),le=n(869332),ce=n(771927),de=n(355108),Ae=n(910577),me=n(301940),ue=n(68105),Ee=n(652236),Ce=n(952566),_e=n(889702),Ie=n(34725),he=n(961603),xe=n(95857),pe=n(651561),je=n(964795),Oe=n(45978),Te=n(795206),ve=n(228502),De=n(291935),Se=n(544691),ge=n(393482),Ne=n(969288),Pe=n(112340),fe=n(600191);const Me=()=>(0,i.jsxs)(M.A,{gap:v.kc,marginTop:v.kc,children:[(0,i.jsx)(fe.A,{size:"original",color:N.PA.warning,variant:"fill"}),(0,i.jsx)(k.A,{children:(0,i.jsx)(p.sA,{id:"DEVICE_UBB_ADOPT_WARNING_MESSAGE",values:{b:p.b}})})]}),Re=(0,s.memo)(({name:e,model:t,mac:n})=>(0,i.jsxs)(M.A,{gap:v.kc,marginTop:v.kc,children:[(0,i.jsx)(fe.A,{size:"original",color:N.PA.warning,variant:"fill"}),(0,i.jsx)(k.A,{size:"small",children:(0,i.jsx)(p.sA,{id:(0,f.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:p.b,br:p.br}})})]})),be=()=>(0,i.jsxs)(M.A,{gap:v.kc,marginTop:v.kc,children:[(0,i.jsx)(fe.A,{size:"original",color:N.PA.warning,variant:"fill"}),(0,i.jsx)(k.A,{children:(0,i.jsx)(p.sA,{id:"DEVICE_ULTE_PRO_SETUP_SIM_INCOMPATIBLE",values:{strong:p.ko}})})]}),ye=()=>(0,i.jsxs)(M.A,{gap:v.kc,marginTop:v.kc,children:[(0,i.jsx)(fe.A,{size:"original",color:N.PA.warning,variant:"fill"}),(0,i.jsx)(k.A,{children:(0,i.jsx)(p.sA,{id:"DEVICE_ULTE_USG_REQUIRED"})})]});var Ue=n(633797);const ke=(0,T.A)(k.A)`
  line-height: 20px;
  margin-bottom: 10px;
`,we=()=>(0,i.jsx)(Ue.A,{level:"warning",children:(0,i.jsx)(ke,{size:"small",children:(0,i.jsx)(p.sA,{id:"DEVICE_ACTIONS_ADOPT_WARNING_MESSAGE",values:{b:p.b}})})});var Ve=n(685925);const Le=L.AH`
  flex: 1;
`,ze=({device:e,onAdoptionInitiated:t,disabled:n})=>{const{formatMessage:r}=(0,p.tz)(),o=(0,a.wA)(),l=(0,j.S9)(e),[c,d]=(0,s.useState)(!0),[A,m]=(0,s.useState)(l===Oe.g.ADOPTING),C=(0,a.d4)((0,Ce.p)(_e.S.API_DEVICE_ADOPT)),_=(0,a.d4)(H.ID),I=(0,a.d4)(H.U$),h=(0,a.d4)(Ie.fV),O=((0,a.d4)(ie.p),(0,a.d4)(Ae.hX)),T=(0,a.d4)(Se.Xs),D=(0,a.d4)(ve.A),S=(0,a.d4)(ue.Z9),g=(0,se.A)(xe.Xj.MANAGED_SHADOW_MODE),N=((0,a.d4)(E.ay),(0,a.d4)(De.jE)),P=N?.cloud_template,R=l===Oe.g.ADOPTION_FAILED,b=(0,j.YP)(e),y=(0,je.O)(e),U=(0,je.g)(e),k=!!e?.adoptable_when_upgraded,w=(0,f.moU)(e)&&!(0,f.DBW)(_,e,S,g),V=(0,f.tNJ)(e),L=V&&!(0,f.nKo)(_,e),z=V&&!e?.lte_imei,$=!!e?.lte_sim_incompatible,G=!b&&(y||U)&&C&&!(L||w)&&!z,W=V&&!h,F=(0,f.YdF)(e)&&!(0,pe.Ck)(e)&&!(0,f.IOl)(e),B=n||A||c||W||F||$;(0,s.useEffect)(()=>{m(l===Oe.g.ADOPTING)},[l,e.mac]),(0,s.useEffect)(()=>{Promise.all([o((0,ge.Yo)(void 0,{crudCacheStrategy:{type:ne.e.CACHE}})),o((0,me.uy)(void 0,{crudCacheStrategy:{type:ne.e.CACHE}})),...g?[o((0,Ee.V9)(void 0,{crudCacheStrategy:{type:ne.e.CACHE}}))]:[]]).then(()=>d(!1))},[o,g]),(0,s.useEffect)(()=>{o((0,he.T)(void 0,{crudCacheStrategy:{type:ne.e.CACHE}}))},[o]);return G?(0,i.jsxs)(M.A,{flexDirection:"column",children:[W?(0,i.jsx)(ye,{}):null,$?(0,i.jsx)(be,{}):null,F?(0,i.jsx)(Me,{}):null,R&&!U?(0,i.jsx)(we,{}):null,R&&U?(0,i.jsx)(q.A,{device:e,variant:"tertiary"}):null,y?(0,i.jsx)(M.A,{gap:v.kc,alignItems:"center",marginTop:v.kc,children:(0,i.jsx)(Ve.e,{device:e,children:(0,i.jsx)(te.A,{variant:"primary",onClick:n=>{n?.preventDefault(),n?.stopPropagation(),(n=>{function i(){V?(o((0,de.ji)(e.mac,(0,f.mHb)(e)?"LTE_PRO_ADOPTION":"LTE_ADOPTION")),m(!1)):function(){if(e.discovered_by===Pe.A.PROTOCOL_V2_ID)m(!1);else if(U?o((0,Te.T3)(e,n.values)).catch(()=>m(!1)):o((0,Te.Hk)(e)).catch(()=>m(!1)),(0,f.G5G)(e)){const t=(0,J.A)();O||(Z.C.getRemoteImagePath(D[e?.model]),o((0,oe.ox)({iconUrl:Z.C.getRemoteImagePath(D[e?.model]),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:()=>{o((0,oe.uU)(t)),o((0,u.XP)({type:x.H.WIFI,id:Ne.R6}))}},translateTitle:!0},t))),T||(0,f.r$V)(e)||o((0,oe.ox)({iconUrl:Z.C.getRemoteImagePath(D[e?.model]),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:()=>{o((0,oe.uU)(t)),o((0,u.XP)({type:x.H.WIFI,id:Ne.R6}))}}},t))}}()}function s(){if(e.elite&&e.elite.replacement_for_mac){const t=_.find(t=>t.mac===e.elite.replacement_for_mac);o((0,ce.E)({title:"DEVICE_APPLY_CONFIGURATION_HEADER",titleValues:{deviceName:t.name},message:"DEVICE_APPLY_CONFIGURATION_MESSAGE",messageValues:{deviceName:t.name},size:"small",onConfirm:()=>{o((0,le.AS)())},onCancel:()=>{o((0,le.AS)()),U?i():(0,re.A)([e.mac],{dispatch:o,cloudTemplate:P}).then(i).catch(()=>m(!1))}}))}else(0,f.m_j)({type:e.type})?o((0,le.to)({modalType:ae.A.REGISTER_ISP_GUIDE,modalProps:{onConfirm:i,onCancel:()=>m(!1)}})):U?i():(0,re.A)([e.mac],{dispatch:o,cloudTemplate:P}).then(i).catch(()=>m(!1))}k?o((0,ce.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:()=>{o((0,le.AS)()),s()},onCancel:()=>{o((0,le.AS)()),m(!1)}})):s(),m(!0),t?.()})()},disabled:B,wrapClassName:Le,children:(0,i.jsx)(p.sA,A?{id:"COMMON_DEVICE_STATE_ADOPTING"}:{id:k?"DEVICE_ACTIONS_ADOPT_AND_UPGRADE":"DEVICE_ACTIONS_ADOPT"})})})}):null]}):(0,i.jsx)(M.A,{flexDirection:"column",children:!w||g&&I.model===e.model?null:(0,i.jsx)(Re,{name:I.name,model:I.model,mac:I.mac})})};var $e,Ge=n(976458),We=n(591256),He=n(313369),Fe=n(369343),Be=n(570866),Ye=n(286462),Ke=n(535322),Xe=n(43009),Qe=n(857780);!function(e){e[e.AP=0]="AP",e[e.SWITCH=1]="SWITCH",e[e.DEFAULT=2]="DEFAULT"}($e||($e={}));const Ze={[$e.AP]:()=>{const e=(0,a.d4)(ie.p),{motif:t}=(0,Xe.A)();return(0,i.jsx)(M.A,{justifyContent:"center",children:(0,i.jsx)("video",{height:226,loop:!0,muted:!0,autoPlay:!0,src:`${e}/resetButton/reset-AP_${t}.mp4`})})},[$e.SWITCH]:()=>{const e=(0,a.d4)(ie.p);return(0,i.jsx)(M.A,{justifyContent:"end",children:(0,i.jsx)("img",{width:326,height:226,src:`${e}/resetButton/switch.png`,alt:"reset"})})},[$e.DEFAULT]:()=>{const e=(0,a.d4)(ie.p);return(0,i.jsx)(M.A,{justifyContent:"center",children:(0,i.jsx)("img",{width:"100%",height:152,src:`${e}/resetButton/other.png`,alt:"reset"})})}},qe={[Qe.W4.U5GMAX]:"DEVICE_RESET_DESC_LCM"},Je=["U7HD","U7NHD","UCXG","U7SHD","U7PG2","U7LR","U7LT","UAL6","UAP6","UALR6","UALR6v2","UALR6v3","UAP6MP","UAPL6","UALRPL6","U6ENT"],et=["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"],tt=({model:e})=>{const t=(0,s.useMemo)(()=>{const t=Je.includes(e),n=et.includes(e);let i=$e.DEFAULT;return t?i=$e.AP:n&&(i=$e.SWITCH),i},[e]),n=Ze[t];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(M.A,{marginTop:v.kc,children:[(0,i.jsx)(M.A,{marginRight:v.kc,children:(0,i.jsx)(w.A,{isActive:!0,variant:"fill",size:"original"})}),(0,i.jsx)(k.A,{children:(0,i.jsx)(p.sA,{id:qe[e]||"DEVICE_PROPERTIES_RESET_DESC"})})]}),(0,i.jsx)(n,{})]})};var nt=n(664092),it=n(463872);const st=L.AH`
  margin-bottom: ${v.Ln};
`,at=(0,T.A)("div")`
  align-self: center;
`,rt=({activeItem:e,activeItem:{mac:t,model:n,ip:r,state:o,last_uplink:l,mbb:c,type:d,wan_networkgroup:A}})=>{const m=(0,a.d4)(Fe.IN),u=(0,a.d4)(H.k4),E=(0,a.d4)(H.pV),C=(0,a.d4)(Fe.Eo),_=(0,a.d4)(H.YS),I=(0,a.d4)(We.C7),h=(0,a.d4)(Ge.TP),{motifPalette:{orange01:x}}=(0,V.u)(),O=(0,f.R30)({type:d,model:n})&&E&&!A,T=(0,j.S9)(e),D=T===Oe.g.MANAGED_BY_OTHER,S=T===Oe.g.ADOPTION_FAILED,[g,N]=(0,s.useState)(T===Oe.g.ADOPTING),P=(0,f.X6b)(e),R=(0,$.UA)(e);(0,s.useEffect)(()=>{N(T===Oe.g.ADOPTING)},[t,T]);let b=null;m&&C&&(I&&(b=(0,i.jsxs)(M.A,{flexDirection:"column",children:[(0,i.jsx)(p.sA,{id:"DEVICE_ADOPTION_LIMIT_REACHED_CLOUD_CONSOLE",values:{limit:C.limit}}),(0,i.jsx)(W.A,{id:"DEVICE_ADOPTION_MANAGE_CLOUD_CONSOLE_SUBSCRIPTION",href:h.replace(Be.pG,"/console-settings")})]})),_&&(b=(0,i.jsx)(p.sA,{id:"DEVICE_ADOPTION_UNIFI_EXPRESS",values:{limit:C.limit,link:(0,i.jsx)(W.A,{href:F.A.unifiConsoles,id:"DEVICE_ADOPTION_HIGHER_CAPACITY_CONSOLE"})}})));const y=b&&!g;return(0,i.jsxs)(i.Fragment,{children:[(0,f.JWq)(e)||(0,f.R$Q)(e)?(0,i.jsx)(X.A,{variant:"warning",children:(0,i.jsx)(k.A,{children:(0,i.jsx)(p.sA,{id:"DEVICE_POE_PASSTHROUGH_WARNING",values:{port:(0,f.R$Q)(e)?1:2}})})}):null,(0,i.jsx)(U.A,{className:st,sections:[(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(M.A,{gap:v.kc,children:[(0,i.jsx)(Z.A,{model:e.model,size:Q.Xh.MEDIUM,width:40,height:40}),(0,i.jsx)(at,{children:(0,i.jsx)("div",{children:(0,i.jsx)(k.A,{weight:"bold",children:(0,z.Lm)(e.model)})})})]}),m?null:(0,i.jsx)(ze,{device:e,onAdoptionInitiated:()=>N(!0),disabled:O}),D?(0,i.jsx)(tt,{model:n}):null,y&&_&&S?(0,i.jsx)(q.A,{device:e,variant:"tertiary"}):null]})]}),He.q[o]===Oe.g.ADOPTION_FAILED?(0,i.jsx)(Y,{last_uplink:l}):null,y?(0,i.jsx)(G.A,{icon:(0,i.jsx)(w.A,{size:"original",isActive:!0,variant:"fill"}),children:(0,i.jsx)(k.A,{children:b})}):null,O?(0,i.jsx)(G.A,{icon:(0,i.jsx)(K.k0,{size:"original",variant:"fill",color:x}),children:(0,i.jsx)(k.A,{children:(0,i.jsx)(p.sA,{id:"DEVICE_RESTRICT_ADOPTION_ONE_CELLULAR_DEVICE",values:{deviceName:u,model:(0,z.Lm)(e.model)}})})}):null,(0,f.zqY)({mbb:c})?(0,i.jsx)(it.A,{imei:c?.imei,eId:c?.esim?.eid,networkScanOperators:c?.network_scan?.operators||[],model:n}):null,(0,i.jsxs)(Ke.A,{children:[t?(0,i.jsxs)(nt.A,{children:[(0,i.jsx)(k.A,{color:"text-2",size:"medium",children:(0,i.jsx)(p.sA,{id:"COMMON_MAC_ADDRESS"})}),(0,i.jsx)(k.A,{color:"text-3",size:"medium",children:t})]}):null,r?(0,i.jsxs)(nt.A,{children:[(0,i.jsx)(k.A,{color:"text-2",size:"medium",children:(0,i.jsx)(p.sA,{id:"COMMON_IP_ADDRESS"})}),(0,i.jsx)(k.A,{color:"text-3",size:"medium",children:r})]}):null]}),P&&R&&!I?(0,i.jsx)(Ke.A,{type:Ke.I.BUTTON_LIST,children:(0,i.jsx)(Ye.A,{activeItem:e})}):null]})};var ot=n(374402);const lt=(0,s.memo)(e=>{const{activeItem:{type:t,data:n},content:o}=e,l=(0,a.d4)(r.oI),c=(0,a.d4)(r.Oh),d=(0,a.d4)(r.n6),A=l&&l in o.panels?l:o.defaultId,{formatMessage:m}=(0,p.tz)(),u=t===x.H.DEVICE&&!(0,j.YP)(n),E=(0,s.useMemo)(()=>{if(o.singlePanel)return ot.c;const t=Object.keys(o.panels).reduce((t,n)=>{const{disabled:i,title:s,icon:a}=o.panels[n];return i?.({...e})||t.push({value:n,label:s&&m({id:s}),icon:a}),t},[]);return t.length<2?ot.c:u?[{value:o.defaultId,label:m({id:o.panels[o.defaultId].title}),icon:o.panels[o.defaultId].icon}]:t},[e,o,u,m]),C=(0,s.useMemo)(()=>{if(u)return(0,i.jsx)(rt,{activeItem:n},"adopt-panel");if((d||c)&&o.subComponent)return(0,i.jsx)(o.subComponent,{activeItem:n,subPanel:d,subId:c});const{component:e}=o.panels[A];return(0,i.jsx)(e,{activeItem:n,subPanel:l})},[o,n,u,A,c,l,d]);return(0,i.jsxs)(s.Suspense,{fallback:null,children:[!o.singlePanel&&E.length>1&&!u?(0,i.jsx)(S,{tabs:E,currentTab:A}):null,(0,i.jsx)(y,{activeItem:n}),C]})});var ct=n(929568),dt=n(847944),At=n(279279);var mt=n(179060),ut=n(947414);const Et=({activeItem:{data:e,type:t}})=>{const{formatMessage:n}=(0,p.tz)(),i=(0,At.A)(),s=(0,ct.B)(t);return s?.renderTitle(s?.getLabel(e,{formatMessage:n,formatDateTime:i})||"",e)||null},Ct=({id:e,panelType:t})=>{const n=(0,s.useRef)(null),l=(0,a.wA)(),{pathname:C}=(0,c.zy)(),I=(0,a.d4)(r.WS),x=(0,a.d4)(r.Em),j=(0,a.d4)(r.aK),O=(0,a.d4)(r.gm),T=(0,a.d4)(r.LK),v=(0,a.d4)(r.oI),D=(0,a.d4)(r.S5),S=(0,a.d4)(E.P),g=(({id:e,type:t})=>{const{formatMessage:n}=(0,p.tz)(),i=(0,a.d4)((0,s.useMemo)(()=>e&&(0,ct.B)(t)?.selectData(e,{formatMessage:n})||ut.P1,[e,t,n]))||{};return{type:t,data:i}})({id:e,type:t||T});((e,t)=>{const n=(0,a.wA)(),i=(0,s.useMemo)(()=>(0,dt.Tl)(t.type,e)?(0,dt.iy)(t.type,e):void 0,[t.type,e]),r=(0,dt.As)(t),o=(0,At.A)(),l=(0,dt.Zs)(t,(0,p.tz)().formatMessage,o);(0,s.useEffect)(()=>{i&&n(void 0!==r.imageId&&void 0!==l?(0,u.WN)({id:i,element:r.image,label:l,closable:!0}):(0,u.CY)(i))},[n,i,l,r.imageId])})(e,g),(0,m.A)(e);const{views:N,currentViewId:P}=(0,s.useMemo)(()=>({views:S&&D.length>1?D:(0,o.A)(),currentViewId:D.find(({id:e})=>O&&T&&e.includes(O)&&e.includes(T))?.id}),[S,D,T,O]),f=(0,s.useCallback)(e=>{if(e===P){const t=N.filter(({id:t})=>t!==e).pop();if(t?.id){const[e,n]=t.id.split(mt._H);l((0,u.XP)({type:e,id:n}))}}l((0,u.CY)(e))},[l,N,P]),M=(0,s.useCallback)(()=>{P&&l((0,u.CY)(P)),l((0,u.DW)(C)),l((0,u.K5)())},[l,P,C]);(0,A.A)(()=>{I&&M()},[I]),(0,s.useEffect)(()=>{I&&!g.type&&M()},[I,g.type,M]);const R=(0,ct.B)(g.type),b=g&&g.type&&Object.keys(g?.data||{})?.length?R?.content:void 0,y="function"==typeof b?b(g.data):b,U=R?.getContentRoot?.(e,g.data);(0,s.useEffect)(()=>{n.current&&(n.current.scrollTop=0)},[v]);const k=(0,s.useCallback)(e=>{const[t,n]=e.split(mt._H);l((0,u.XP)({type:t,id:n}))},[l]);return(0,s.useEffect)(()=>{I&&!y&&M()},[M,I,y]),y?(0,i.jsxs)(d.A,{in:I,header:(0,i.jsx)(Et,{activeItem:g}),onClose:M,scrollableRef:n,views:N,currentViewId:P,onViewClick:k,onViewClose:f,className:ot.X,children:[U,I?(0,i.jsx)(lt,{content:y,activeItem:g}):null,x?(0,i.jsx)(h,{}):null,j?(0,i.jsx)(_,{}):null]},P||`${g.type}${mt._H}${e}`):null};var _t;!function(e){e.TYPE="type",e.ID="id",e.SUB_ID="subId"}(_t||(_t={}));const It=Object.values(x.H);var ht=n(909924),xt=n(968021);var pt=n(104997);const jt=new RegExp(`/${pt.VO.DEVICES}/properties/(.*)`);var Ot=n(864099);const Tt=({id:e,type:t})=>{const n=(0,s.useMemo)(()=>(0,ct.B)(t)?.getDependencies(e)||(0,o.A)(),[t,e]);return(0,l.A)(n,e&&t?(0,i.jsx)(Ct,{id:e,panelType:t}):null)},vt=(0,s.memo)(()=>{const{pathname:e,search:t}=(0,Ot.A)(),n=(0,a.d4)(r.gm),o=(0,a.d4)(r.LK);((e,t,n)=>{const i=(0,a.wA)(),{pathname:o}=(0,c.zy)(),l=(0,xt.A)(o),d=(0,xt.A)(e),A=(0,a.d4)(r.oI),m=(0,a.d4)(r.SP),E=(0,a.d4)(r.RJ);(0,s.useEffect)(()=>{if(o!==l||e!==d){t&&n&&(l||d)&&!m&&i((0,u.mn)({[l||d]:{[ht.QK.ID]:t,[ht.QK.TYPE]:n,[ht.QK.TAB]:A}}));const s=E[o||e];i(s&&!m?(0,u.XP)({[ht.QK.ID]:s[ht.QK.ID],[ht.QK.TYPE]:s[ht.QK.TYPE],[ht.QK.TAB]:s[ht.QK.TAB]}):(0,u.K5)())}},[i,o,l,e,d,t,n,A,E,m])})(e,n,o),(e=>{const t=(0,a.wA)();(0,s.useEffect)(()=>{const n=e.match(jt)?.[1]?.split("/")?.[0];n&&t((0,u.XP)({type:x.H.DEVICE,id:n}))},[t,e])})(e),(e=>{const t=(0,a.wA)();(0,s.useEffect)(()=>{const n=new URLSearchParams(e),i=n.get(_t.TYPE),s=n.get(_t.ID),a=n.get(_t.SUB_ID);s&&It.includes(i)&&t((0,u.XP)({type:i,id:s,subId:a}))},[t,e])})(t);const l=(0,s.useMemo)(()=>[n,o].join(),[n,o]);return n&&o?(0,i.jsx)(Tt,{id:n,type:o},l):null})},864099(e,t,n){n.d(t,{A:()=>a});var i=n(602086),s=n(237725);const a=()=>{const e=(0,s.zy)(),[t,n]=(0,i.useState)(e.search),[a,r]=(0,i.useState)(e.pathname),o=(0,i.useCallback)(e=>{const{search:t,pathname:i}=e.target.location;n(t),r(i)},[]);return(0,i.useEffect)(()=>(window.addEventListener("replacestate",o),()=>{window.removeEventListener("replacestate",o)})),{search:t,pathname:a}}},279740(e,t,n){n.d(t,{A:()=>P});var i=n(602086),s=n(977872),a=n(244081),r=n(653547),o=n(348185),l=n(747922),c=n(79777),d=n(648552),A=n(795206),m=n(239627),u=n(45978),E=n(648126),C=n(223597);const _=new Map,I="device-watch-mode-listener",h=["mac","state"],x=["uplink_mac","type","unifi_device"],p=({mac:e,state:t},n)=>Boolean(e&&n)&&e!==n&&t===E.A[u.g.CONNECTED],j=e=>e.type!==C.sK.WIRELESS&&e.type!==C.sK.WIRED||e.unifi_device?void 0:e.uplink_mac;var O,T,v=n(222102),D=n(430328),S=n(897166),g=n(754924),N=n(34118);!function(e){e.DEVICE_MAC="device_mac",e.IS_WATCHED="is_watched",e.WATCHED_TIMEOUT="watched_timeout",e.UPDATE_INTERVAL_SECONDS="update_interval_seconds"}(O||(O={})),function(e){e.INSTANCES="instances",e.TIMEOUT="timeout"}(T||(T={}));const P=e=>{const t=(0,s.wA)(),n=(0,s.d4)((0,i.useMemo)(()=>{return t=e,(0,D.WY)()((0,v.Mz)((0,N.kV)(t,x),j),e=>e);var t},[e])),u=(0,i.useMemo)(()=>n||e,[n,e]),E=(0,s.d4)((0,i.useMemo)(()=>{return e=u,(0,D.WY)()((0,v.Mz)((0,g.bw)(e,h),S.vc,p),e=>e);var e},[u])),C=(0,s.d4)(c.a),P=(0,i.useMemo)(()=>C[d.Uz],[C]),f=(0,i.useCallback)(e=>{P.send({type:o.E.WATCH_DEVICE,device_mac:e})},[P]),M=(0,i.useCallback)(({[O.IS_WATCHED]:e,[O.WATCHED_TIMEOUT]:t,[O.DEVICE_MAC]:n})=>{if(e){const e=1e3*t;if(e>Date.now()){const t=_.get(n);t&&(t[T.TIMEOUT]=setTimeout(()=>{f(n)},(e=>Math.max(e-Date.now()-5e3,5e3))(e)))}}},[f]),R=(0,i.useCallback)(e=>(0,r.K6)(e,M,!1,(e=>`${I}::${e}`)(e)),[M]);(0,i.useEffect)(()=>{if(E){Object.keys((0,r.WM)()).some(e=>e.startsWith(I))||l._[o.E.WATCH_DEVICE].map(R);const e=_.get(u);e?e[T.INSTANCES]+=1:(f(u),_.set(u,{[T.INSTANCES]:1,[T.TIMEOUT]:void 0}))}return()=>{const e=_.get(u);e&&(e[T.INSTANCES]>1?e[T.INSTANCES]-=1:(clearTimeout(e[T.TIMEOUT]),_.delete(u)),_.size||Object.keys((0,r.WM)()).filter(e=>e.startsWith(I)).forEach(r.$N))}},[f,R,u,E]),(0,i.useEffect)(()=>{t((0,A.Uc)(void 0,{crudCacheStrategy:{type:a.e.CACHE}})),t((0,m.$3)(void 0,{crudCacheStrategy:{type:a.e.CACHE}}))},[t])}},105472(e,t,n){n.d(t,{A:()=>s});var i=n(602086);const s=(e,t=[])=>{const n=t=>{27===t.keyCode&&e(t)};(0,i.useEffect)(()=>(document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}),t)}},871808(e,t,n){n.d(t,{A:()=>r});var i=n(602086),s=n(977872),a=n(167933);const r=e=>(0,s.d4)((0,i.useMemo)(()=>(0,a.jN)(e),[e]))}}]);