"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[10640],{505946(e,t,i){var s;i.d(t,{o:()=>s}),function(e){e.MASTER="master",e.BACKUP="backup",e.FAULT="fault",e.INIT="init",e.STOP="stop",e.UNKNOWN="unknown"}(s||(s={}))},453007(e,t,i){i.d(t,{A:()=>r});var s=i(938984),n=i(247816),o=i(291508);const r=(0,n.A)(s.A,(0,o.A)("colorOverride"))`
  ${({colorOverride:e})=>e?`color: ${e} !important`:""};
`},796091(e,t,i){i.d(t,{A:()=>l});var s=i(274934),n=i(833466),o=i(309130),r=i(100978);const l=e=>(0,s.jsx)(r.A,{paddingTop:o.YC,paddingBottom:o.YC,gap:o.Ln,rowGap:o.YC,flexWrap:"wrap",minHeight:n.b,alignItems:"center",...e})},89469(e,t,i){i.d(t,{A:()=>l});var s=i(274934),n=i(602086),o=i(309130),r=i(100978);const l=(0,n.forwardRef)((e,t)=>(0,s.jsx)(r.A,{ref:t,flexDirection:"column",gap:o.kc,width:"100%",...e}))},384783(e,t,i){i.d(t,{A:()=>r});var s=i(274934),n=i(832162),o=i(826600);const r=({children:e=null,hideModal:t,onRequestClose:i,portalSelector:r=o.J,forwardedRef:l=null,...a})=>(0,s.jsx)(n.A,{isOpen:!0,shouldCloseOnEsc:!0,onRequestClose:i||t,parentSelector:r,ref:l,...a,children:e})},826600(e,t,i){i.d(t,{J:()=>s,g:()=>n});const s=()=>document.getElementById("modal-container"),n=()=>document.getElementById("modal-settings-container")},241092(e,t,i){i.d(t,{A:()=>v});var s=i(274934),n=i(558948),o=i(309130),r=i(376892),l=i(100978),a=i(535322),d=i(125799),c=i(814557),A=i(938984),_=i(799329),x=i(600191),E=i(247816),m=i(291508),u=i(470070);var O,h=i(820510);!function(e){e.ORANGE="orange",e.RED="red"}(O||(O={}));const p=(e,t)=>(e.index||0)-(t.index||0),j=(0,E.A)(_.A)`
  color: ${({theme:e})=>c.Ay[`desktop-color-neutral-00-${e.themeName}`]};
`,D=(0,E.A)(x.A,(0,m.A)("color"))`
  color: ${({theme:e,color:t})=>c.Ay[`desktop-color-${t}-06-${e.themeName}`]};
`,I=(0,E.A)(l.A)`
  width: ${o.S2};
  height: ${o.S2};
  border-radius: 4px;
  background-color: ${({theme:e})=>c.Ay[`desktop-color-green-06-${e.themeName}`]};
`,C=(0,E.A)(I)`
  background-color: ${({theme:e})=>c.Ay[`desktop-color-neutral-03-${e.themeName}`]};
`,S=({fan:{index:e,speed:t}})=>(0,s.jsxs)(h.m,{children:[(0,s.jsx)(h.Y,{id:"DEVICE_FAN",children:e}),(0,s.jsx)(h.Y,{id:"DEVICE_LEVEL",children:t})]}),N=({fan:e})=>(0,s.jsx)(d.A,{description:(0,s.jsx)(S,{fan:e}),width:100,children:(0,s.jsx)(I,{justifyContent:"center",alignItems:"center",children:(0,s.jsx)(j,{})})}),g=({index:e,messageId:t,color:i=O.ORANGE})=>(0,s.jsx)(d.A,{description:(0,s.jsx)(u.sA,{id:t,values:{index:e}}),width:199,children:(0,s.jsx)(C,{justifyContent:"center",alignItems:"center",children:(0,s.jsx)(D,{color:i,size:"original",variant:"fill"})})}),R=({fan:e})=>{switch(!0){case!e.present:return(0,s.jsx)(g,{index:e.index,messageId:"DEVICE_FAN_UNAVAILABLE",color:O.RED});case!!(1&e.critical_state):return(0,s.jsx)(g,{index:e.index,messageId:"DEVICE_FAN_SPEED_TOO_HIGH"});case!!(2&e.critical_state):return(0,s.jsx)(g,{index:e.index,messageId:"DEVICE_FAN_STOPPED"});case!!(4&e.critical_state):return(0,s.jsx)(g,{index:e.index,messageId:"DEVICE_FAN_UNAVAILABLE",color:O.RED});default:return(0,s.jsx)(N,{fan:e})}},T=({fan:e})=>(0,s.jsxs)(l.A,{flexDirection:"column",justifyContent:"center",alignItems:"center",children:[(0,s.jsx)(R,{fan:e}),(0,s.jsx)(A.A,{size:"small",color:"text-3",children:e.present&&void 0!==e.speed?e.speed:(0,s.jsx)(u.sA,{id:"COMMON_FALLBACK"})})]}),M=({fan_table:e})=>(0,s.jsx)(l.A,{flexDirection:"row",justifyContent:"center",gap:o.S2,children:e.sort(p).map(e=>(0,s.jsx)(T,{fan:e},e.index))});var f=i(203071);const v=({psu_table:e=[],fan_table:t=[]})=>e.length>0?(0,s.jsx)(a.A,{type:a.I.ACCORDION,items:[{id:"powerSource",openByDefault:!0,label:(0,s.jsx)(r.A,{id:t.length?"DEVICE_HEADER_POWER_AND_FAN_UTILIZATION":"DEVICE_HEADER_POWER_UTILIZATION"}),renderContent:()=>(0,s.jsxs)(l.A,{flexDirection:"column",gap:o.Ln,children:[(0,s.jsx)(f.A,{psuTable:e,marginBottom:0}),t.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.A,{}),(0,s.jsx)(M,{fan_table:t})]}):null]})}]}):null},948803(e,t,i){i.d(t,{A:()=>a});var s=i(274934),n=i(938984),o=i(347625),r=i(470070),l=i(664092);const a=({model:e})=>(0,s.jsxs)(l.A,{children:[(0,s.jsx)(n.A,{color:"text-2",size:"medium",children:(0,s.jsx)(r.sA,{id:"COMMON_MODEL"})}),(0,s.jsx)(n.A,{color:"text-3",size:"medium",children:(0,o.Lm)(e)})]})},203071(e,t,i){i.d(t,{A:()=>N});var s=i(274934),n=i(602086),o=i(43009),r=i(125799),l=i(814557),a=i(367551),d=i(900302),c=i(938984),A=i(600191),_=i(247816),x=i(263705),E=i(662986),m=i(309130),u=i(100978),O=i(453007),h=i(470070),p=i(314229),j=i(820510);const D=(0,_.A)(u.A)`
  justify-content: space-between;
`,I=(0,_.A)(d.A)`
  margin: 0 6px;
  height: 10px;
`,C=(0,_.A)(A.A)`
  margin: 0 6px;
`,S=({index:e,item:t})=>(0,s.jsxs)(j.m,{children:[(0,s.jsx)(j.Y,{id:"COMMON_POWER_SUPPLY_UNIT",values:{psuIndex:""},children:e+1}),t.temp?Object.entries(t.temp).map(([e,t])=>(0,s.jsxs)(j.Y,{id:"DEVICE_TEMPERATURE_SENSOR",values:{index:+e+1},children:[t?.toFixed(1)||(0,s.jsx)(h.sA,{id:"COMMON_FALLBACK"})," ",(0,s.jsx)(h.sA,{id:"COMMON_UNIT_CELSIUS"})]},e)):null,t.fanSpeed?(0,s.jsxs)(j.Y,{id:"DEVICE_FAN_SPEED",children:[t.fanSpeed," ",(0,s.jsx)(h.sA,{id:"COMMON_UNIT_RPM"})]}):null]}),N=({psuTable:e=[],marginBottom:t})=>{const{themeName:i,motifPalette:d}=(0,x.u)(),{motif:A}=(0,o.A)(),{formatMessage:_}=(0,h.tz)(),j=(0,n.useMemo)(()=>e.map(({power:t,power_capacity:n,temp:o,fan:x,present:m,online:j,label:N},g)=>{const R=n||550,T=Math.ceil(Number.parseFloat(t)/R*100),M={variant:(0,p.NH)(T),value:T,temp:o,fanSpeed:x?.[0],online:j,present:m},f=e?.[g]?.power;return(0,s.jsxs)(u.A,{flexDirection:"column",children:[(0,s.jsxs)(D,{children:[(0,s.jsx)(c.A,{color:"text-2",size:"medium",children:(0,s.jsx)(h.sA,{id:"COMMON_POWER_SUPPLY_UNIT",values:{psuIndex:g+1}})}),(0,s.jsx)(u.A,{justifyContent:"space-between",alignItems:"center",children:M.present?(0,s.jsxs)(s.Fragment,{children:[M.online||M.value?null:(0,s.jsx)(r.A,{description:_({id:"DEVICE_USW_MC_PSU_OFFLINE_TOOLTIP"},{index:g+1}),portal:!0,children:(0,s.jsx)(C,{size:"original",variant:"fill",color:l.Ay[`desktop-color-orange-06-${i}`],fill:l.Ay[`desktop-color-neutral-00-${i}`]})}),M.online?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.A,{color:"text-3",size:"medium",children:(0,s.jsx)(h.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:`${Math.ceil(Number.parseFloat(f))}/${R}`}})}),(0,s.jsx)(I,{orientation:"vertical",color:l.Ay[`desktop-color-neutral-04-${i}`]}),(0,s.jsx)(O.A,{size:"medium",colorOverride:M.value?d[M.variant]:l.Ay[`desktop-color-text-3-${A}`],children:(0,E.A)(M.value)})]}):null]}):(0,s.jsx)(c.A,{color:"text-3",size:"medium",children:(0,s.jsx)(h.sA,{id:"DEVICE_NOT_INSTALLED"})})})]}),(0,s.jsx)(r.A,{description:M.present?(0,s.jsx)(S,{index:g,item:M}):null,width:250,children:(0,s.jsx)(a.A,{items:[M],rounded:!0})})]},N)}),[e]);return(0,s.jsx)(u.A,{flexDirection:"column",marginBottom:t??m.kI,gap:m.kc,children:j})}},384780(e,t,i){i.d(t,{A:()=>U});var s=i(274934),n=i(814557),o=i(977872),r=i(602086),l=i(125799),a=i(792929),d=i(600191),c=i(263705),A=i(244081),_=i(112104),x=i(61322),E=i(449339),m=i(974390),u=i(650632),O=i(535322),h=i(205521),p=i(347625),j=i(754924),D=i(223597),I=i(34118),C=i(239627),S=i(645682),N=i(254590),g=i(857780);const R=({name:e,mac:t,model:i})=>e===t&&i?i:e,T=e=>{switch(e?.uplink?.type){case g.au.WIRE:return e?.connection_network_name||N.L;case g.au.WIRELESS:return e?.connection_network_name||e?.uplink?.essid||N.L;default:return N.L}};var M,f=i(599110),v=i(594005),y=i(309130),w=i(421314);!function(e){e.NAME="name",e.PORT="port",e.NETWORK="network"}(M||(M={}));const L={[M.NAME]:"COMMON_NAME",[M.PORT]:"COMMON_PORT",[M.NETWORK]:"COMMON_NETWORK"};var k=i(100978),P=i(470070),b=i(850352);const W=({port:e,mac:t})=>{const{handleGoToPortsPage:i}=(0,b.e)();return(0,s.jsx)(f.A,{variant:"inline",type:"button",size:"medium",onClick:()=>{i(t,e)},children:e})},U=({activeItem:e})=>{const{themeName:t}=(0,c.u)(),i=(0,o.wA)(),N=(0,o.d4)(j.ID),g=(0,r.useMemo)(()=>((e,t)=>(e||[]).map(e=>{const i=t.find(({mac:t})=>t===e.mac||t===e.ap_mac);return i?{...e,id:i._id,name:(0,p.Q)(i),activeItem:i,model:(0,p.Lm)(i.model)}:null}).filter(Boolean))(e.downlink_table,N),[e.downlink_table,N]),f=(0,o.d4)((0,I.Ax)(e.mac)).filter(e=>e.type===D.sK.WIRED);(0,r.useEffect)(()=>{i((0,C.$3)(void 0,{crudCacheStrategy:{type:A.e.CACHE}}))},[i]);const b=(0,r.useMemo)(()=>f.map(e=>({id:`${e.id}${e.sw_port}`,name:e.display_name,mac:e.mac,network:e.network_name,port:e.sw_port,image:(0,s.jsx)(u.A,{client:e}),isClient:!0})),[f]),U=(0,r.useMemo)(()=>g.map(({id:e,name:i,mac:o,port_idx:r,activeItem:a})=>({id:`${e}${r}`,name:R({name:i,mac:a.mac,model:a.model}),mac:o,network:T(a),port:r,image:(0,s.jsx)(m.A,{model:a.model}),isClient:!1,warning:a.detailed_states?.negotiated_low_uplink_port_speed?(0,s.jsx)(l.A,{portal:!0,description:(0,s.jsx)(S.A,{color:"text-1"}),children:(0,s.jsx)(d.A,{size:"medium",color:n.Ay[`desktop-color-orange-06-${t}`]})}):void 0,stacking_group_id:a.stacking_group_id})),[g,n.Ay[`desktop-color-orange-06-${t}`]]),V=(0,r.useMemo)(()=>Array.prototype.concat.apply([],[b,U]),[U,b]),F=(0,r.useMemo)(()=>(({mac:e})=>[{id:M.NAME,label:(0,s.jsx)(P.sA,{id:L[M.NAME]}),renderCell:({image:e,name:t})=>(0,s.jsxs)(k.A,{alignItems:"center",justifyContent:"center",width:"100%",children:[(0,s.jsx)(k.A,{alignItems:"center",justifyContent:"center",height:"20px",width:"20px",children:e}),(0,s.jsx)(w.A,{color:"inherit",size:"medium",style:{width:"170px",paddingLeft:"6px",paddingRight:"6px"},children:t})]}),width:170,compare:(0,v.l0)(({name:e})=>e)},{id:M.NETWORK,label:(0,s.jsx)(P.sA,{id:L[M.NETWORK]}),renderCell:({network:e})=>(0,s.jsx)(w.A,{color:"inherit",size:"medium",children:e}),width:112,compare:(0,v.l0)(({network:e})=>e)},{id:M.PORT,align:"right",label:(0,s.jsx)(P.sA,{id:L[M.PORT]}),renderCell:({port:t,warning:i})=>(0,s.jsxs)(k.A,{justifyContent:"flex-end",alignItems:"center",flexGrow:1,children:[(0,s.jsx)(k.A,{marginTop:-2,marginRight:y.YC,children:i}),(0,s.jsx)(W,{port:t,mac:e})]}),width:54,compare:(0,v.l0)(({port:e})=>e)}])({mac:e.mac}),[e.mac]),H=(0,r.useCallback)(({mac:e,isClient:t,stacking_group_id:s})=>{i((0,h.XP)({type:t?E.H.CLIENT:s?E.H.STACKING:E.H.DEVICE,id:s||e}))},[i]),{rowLimit:G,renderFooter:z}=(0,_.A)(V.length,{defaultCount:10});return V.length?(0,s.jsx)(O.A,{children:(0,s.jsx)(a.A,{items:V,columns:F,idField:"id",initialSortBy:"port",initiallySortAscending:!0,disableColumnFilters:!0,rowOffset:0,disableSelection:!0,onRowClick:H,rowLimit:G,renderFooter:()=>z,rowHeight:x.I.ROW_HEIGHT,truncateHeaderCells:!0})}):null}},979653(e,t,i){i.d(t,{A:()=>O});var s=i(274934),n=i(906701),o=i(100978),r=i(535322),l=i(857780),a=i(893762),d=i(766022),c=i(382583),A=i(948803),_=i(725870),x=i(924453),E=i(664613),m=i(597377),u=i(643334);const O=({name:e,model:t,ip:i,lan_ip:O,ipv6:h,mac:p,connection_network_id:j,displayable_version:D,uptime:I,sys_stats:C,systemStatsMem:S,type:N,total_used_power:g,device_mode_override:R,deviceState:T,ethernet_overrides:M,port_table:f,uplink:v})=>{const y=R===l.Yp.MANAGED_SHADOW_GATEWAY;return(0,s.jsx)(r.A,{children:(0,s.jsxs)(o.A,{height:"100%",flexDirection:"column",children:[(0,s.jsx)(A.A,{model:t}),y?null:(0,s.jsx)(m.A,{ip:i,lan_ip:O,type:N,ethernet_overrides:M,port_table:f,uplink:v,device_mode_override:R}),y?null:(0,s.jsx)(n.A,{ipv6_address:h}),y?null:(0,s.jsx)(c.A,{connection_network_id:j}),(0,s.jsx)(x.A,{mac:p}),(0,s.jsx)(u.A,{displayable_version:D,mac:p,name:e,model:t,type:N,uptime:I,deviceState:T}),(0,s.jsx)(a.A,{uptime:I}),y?null:(0,s.jsx)(_.A,{systemStatsMem:S}),y?null:(0,s.jsx)(E.A,{sys_stats:C}),y?null:(0,s.jsx)(d.A,{totalPower:g})]})})}},77206(e,t,i){i.r(t),i.d(t,{default:()=>Ge});var s=i(274934),n=i(871808),o=i(241092),r=i(376892),l=i(535322),a=i(95857),d=i(857780),c=i(979653),A=i(808202),_=i(872926),x=i(814557),E=i(977872),m=i(602086),u=i(938984),O=i(247816),h=i(409844),p=i(347625),j=i(724081),D=i(309130),I=i(421314),C=i(100978),S=i(541819),N=i(974390),g=i(470070),R=i(698478),T=i(68105),M=i(652236),f=i(956978),v=i(434521),y=i(954702),w=i(304151),L=i(793442),k=i(726831);const P=({onSetup:e})=>{const t=(0,E.d4)(T.Z9)!==R.f.NO_SHADOW_CANDIDATE_ADOPTED;return(0,s.jsxs)(C.A,{alignItems:"center",gap:D.YC,children:[(0,s.jsx)(y.A,{type:"button",fontSize:"medium",onClick:e,isDisabled:!t,children:(0,s.jsx)(g.sA,{id:"COMMON_CLICK_TO_SET_UP"})}),(0,s.jsx)(w.A,{isInteractive:!0,description:(0,s.jsx)(g.sA,{id:t?"DEVICE_SHADOW_MODE_SETUP_TOOLTIP":"DEVICE_SHADOW_MODE_SETUP_TOOLTIP_ADOPTION_NEEDED",values:{link:(0,s.jsx)(L.A,{href:k.A.shadowModeArticle,id:"COMMON_LEARN_MORE",noWrap:!0})}})})]})};var b=i(505946);const W=()=>(0,s.jsx)(I.A,{size:"medium",color:"green-06",children:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_READY_TO_TAKE_OVER"})}),U=()=>(0,s.jsx)(I.A,{size:"medium",color:"text-4",weight:"bold",children:(0,s.jsx)(g.sA,{id:"COMMON_OFFLINE"})}),V=()=>(0,s.jsx)(I.A,{size:"medium",color:"orange-06",children:(0,s.jsx)(g.sA,{id:"COMMON_NOT_READY"})}),F=()=>(0,s.jsx)(I.A,{size:"medium",color:"orange-06",children:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_INVALID_FIRMWARE_VERSION"})}),H=()=>(0,s.jsx)(I.A,{size:"medium",color:"green-06",children:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_FAILOVER_ACTIVATED"})}),G=({isPrimaryOffline:e,isSecondaryOffline:t,secondaryVrrpState:i,shadowModeState:n})=>{const o=(0,E.d4)(T.Gc);return e&&i===b.o.MASTER?(0,s.jsx)(H,{}):t?(0,s.jsx)(U,{}):o?(0,s.jsx)(W,{}):[R.f.FIRMWARE_NOT_MATCHED,R.f.FIRMWARE_NOT_SUPPORTED].includes(n)?(0,s.jsx)(F,{}):(0,s.jsx)(V,{})};var z=i(138997),Y=i(187503),$=i(890932);const K=({isDisabled:e,onCancel:t})=>({type:"button",variant:"tertiary",text:(0,s.jsx)(g.sA,{id:"COMMON_ACTION_CANCEL"}),disabled:e,onClick:()=>t()}),B=({isDisabled:e,onNext:t,text:i})=>({type:"button",variant:"primary",text:i||(0,s.jsx)(g.sA,{id:"COMMON_ACTION_NEXT"}),disabled:e,onClick:()=>t()}),X=({isDisabled:e,onRetry:t})=>({type:"button",variant:"primary",text:(0,s.jsx)(g.sA,{id:"COMMON_ACTION_RETRY"}),disabled:e,onClick:()=>t()}),Z=({onFinish:e})=>({type:"button",variant:"primary",text:(0,s.jsx)(g.sA,{id:"COMMON_ACTION_FINISH"}),onClick:()=>e()});var Q=i(384783);const q=h.AH`
  width: 432px;
`,J=({children:e,title:t,actions:i,onDismiss:n})=>(0,s.jsx)(Q.A,{size:"small",actions:i,title:t,className:q,onRequestClose:n,children:e}),ee=({onCancel:e,onNext:t})=>{const i=(0,E.d4)($.p);return(0,s.jsx)(J,{title:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_SETUP_TITLE_STEP",values:{currentStep:3,totalSteps:4}}),onDismiss:e,actions:[K({onCancel:e}),B({onNext:t})],children:(0,s.jsxs)(C.A,{flexDirection:"column",gap:D.kc,children:[(0,s.jsxs)(C.A,{flexDirection:"column",gap:D.YC,children:[(0,s.jsxs)(C.A,{gap:D.YC,children:[(0,s.jsx)(Y.A,{size:"original",isActive:!0}),(0,s.jsx)(u.A,{size:"medium",color:"text-2",children:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_DO_NOT_DISCONNECT",values:{port:2}})}),(0,s.jsx)(w.A,{description:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_DISCONNECTION_TOOLTIP",values:{port:2}})})]}),(0,s.jsxs)(C.A,{gap:D.YC,children:[(0,s.jsx)(z.A,{size:"original",isActive:!0}),(0,s.jsx)(u.A,{size:"medium",color:"text-2",children:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_WAN_TO_ISP"})})]})]}),(0,s.jsx)("video",{height:245,width:"100%",loop:!0,muted:!0,autoPlay:!0,src:`${i}/shadowMode/EfgWanConnection.mp4`})]})})};var te,ie=i(125799),se=i(599110),ne=i(453862),oe=i(600191),re=i(695679),le=i(343954),ae=i(263705),de=i(565527);!function(e){e.IDLE="IDLE",e.LOADING="LOADING",e.SUCCESS="SUCCESS",e.ERROR="ERROR"}(te||(te={}));const ce=({onCancel:e,onNext:t})=>{const i=(0,E.wA)(),{themeName:n}=(0,ae.u)(),o=(0,E.d4)($.p),[r,l]=(0,m.useState)(te.IDLE);return(0,s.jsx)(J,{title:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_SETUP_TITLE_STEP",values:{currentStep:1,totalSteps:4}}),onDismiss:e,actions:[K({onCancel:e}),B({isDisabled:r!==te.SUCCESS,onNext:t})],children:(0,s.jsxs)(C.A,{flexDirection:"column",gap:D.kc,children:[(0,s.jsx)(u.A,{size:"medium",color:"text-2",children:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_VERIFY_DESCRIPTION"})}),(0,s.jsxs)(C.A,{gap:D.YC,width:"100%",flexDirection:"column",children:[(0,s.jsxs)(C.A,{gap:D.YC,children:[(0,s.jsx)(re.A,{size:"original",isActive:!0}),(0,s.jsx)(u.A,{size:"medium",color:"text-2",children:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_VERIFY_INSTRUCTION_WAN",values:{port:2}})})]}),(0,s.jsxs)(C.A,{gap:D.YC,children:[(0,s.jsx)(Y.A,{size:"original",isActive:!0}),(0,s.jsx)(u.A,{size:"medium",color:"text-2",children:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_VERIFY_INSTRUCTION_CONNECT",values:{port:2}})})]})]}),(0,s.jsx)("video",{height:245,width:"100%",loop:!0,muted:!0,autoPlay:!0,src:`${o}/shadowMode/EfgInterconnection.mp4`}),(0,s.jsxs)(C.A,{borderRadius:D.YC,padding:`${D.xO} ${D.kc}`,gap:D.kc,maxWidth:"100%",justifyContent:"space-between",alignItems:"center",background:n===de.S.DARK?x.Ay["desktop-color-neutral-01-dark"]:x.Ay["desktop-color-neutral-01-light"],children:[(0,s.jsxs)(C.A,{gap:D.YC,alignItems:"center",minHeight:20,children:[(0,s.jsx)(u.A,{size:"medium",color:"text-2",children:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_VERIFY_INTERCONNECTION_MESSAGE",values:{port:2}})}),r===te.ERROR?(0,s.jsx)(ie.A,{title:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_VERIFY_ERROR_TITLE"}),description:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_VERIFY_ERROR_MESSAGE",values:{port:2}}),width:280,noWrap:!0,children:(0,s.jsx)(C.A,{height:20,children:(0,s.jsx)(oe.A,{variant:"fill",color:n===de.S.DARK?x.Ay["desktop-color-orange-06-dark"]:x.Ay["desktop-color-orange-06-light"],size:"original"})})}):null]}),[te.IDLE,te.ERROR].includes(r)?(0,s.jsx)(se.A,{variant:"inline",type:"button",onClick:()=>{l(te.LOADING),i((0,M.Us)(void 0,{resolveWithExisting:!1})).then(e=>{if(!0!==e?.data)throw new Error("VRRP connection not established")}).then(()=>{l(te.SUCCESS)}).catch(()=>{l(te.ERROR)})},children:(0,s.jsx)(g.sA,{id:"COMMON_ACTION_VERIFY"})}):null,r===te.LOADING?(0,s.jsx)(C.A,{paddingRight:2,children:(0,s.jsx)(ne.A,{size:16})}):null,r===te.SUCCESS?(0,s.jsx)(le.A,{variant:"fill",size:"original",color:n===de.S.DARK?x.Ay["desktop-color-green-06-dark"]:x.Ay["desktop-color-green-06-light"]}):null]})]})})};var Ae;!function(e){e[e.LOADING=0]="LOADING",e[e.LOADING_ROLLBACK=1]="LOADING_ROLLBACK",e[e.FAILED=2]="FAILED"}(Ae||(Ae={}));const _e=({onCancel:e,onNext:t})=>{const i=(0,E.wA)(),n=(0,E.d4)(T.Z9),[o,r]=(0,m.useState)(n===R.f.READY_FOR_SETUP?Ae.LOADING:Ae.FAILED),l=(0,m.useRef)(t);return(0,m.useEffect)(()=>{l.current=t},[t]),(0,m.useEffect)(()=>{o===Ae.LOADING&&i((0,M.bR)()).then(()=>l.current()).catch(()=>r(Ae.FAILED)),o===Ae.LOADING_ROLLBACK&&i((0,M.EY)(void 0,{resolveWithExisting:!1})).then(()=>i((0,M.bR)(void 0,{resolveWithExisting:!1}))).then(()=>l.current()).catch(()=>r(Ae.FAILED))},[i,o]),(0,s.jsx)(J,o===Ae.FAILED?{title:(0,s.jsx)(g.sA,{id:n===R.f.MANAGEMENT_PORT_IN_USE?"COMMON_ACTION_REQUIRED":"DEVICE_SHADOW_MODE_SETUP_TITLE_ERROR"}),onDismiss:e,actions:[X({onRetry:()=>r(Ae.LOADING_ROLLBACK)})],children:(0,s.jsx)(u.A,{size:"medium",color:"text-2",children:(0,s.jsx)(g.sA,n===R.f.MANAGEMENT_PORT_IN_USE?{id:"DEVICE_SHADOW_MODE_SETUP_PORT_IN_USE_MESSAGE",values:{link:(0,s.jsx)(L.A,{href:k.A.shadowModeArticle,id:"COMMON_LEARN_MORE",noWrap:!0})}}:n===R.f.NO_SHADOW_CANDIDATE_ADOPTED?{id:"DEVICE_SHADOW_MODE_SETUP_ADOPT_MESSAGE",values:{link:(0,s.jsx)(L.A,{href:k.A.shadowModeArticle,id:"COMMON_LEARN_MORE",noWrap:!0})}}:{id:"DEVICE_SHADOW_MODE_SETUP_ERROR"})})}:{title:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_SETUP_TITLE"}),onDismiss:e,children:(0,s.jsxs)(C.A,{flexDirection:"column",gap:D.YC,alignItems:"center",padding:D.Er,children:[(0,s.jsxs)(C.A,{gap:D.YC,alignItems:"center",children:[(0,s.jsx)(ne.A,{size:14}),(0,s.jsx)(u.A,{size:"medium",color:"text-1",weight:"bold",children:(0,s.jsx)(g.sA,{id:"COMMON_PREPARING"})})]}),(0,s.jsx)(u.A,{size:"medium",color:"text-2",children:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_SETUP_WAIT_MESSAGE"})})]})})};var xe=i(795206),Ee=i(603606);const me=async(e,t,i)=>{for(;!await e()&&!i.aborted;)await(0,Ee.u)(t)};var ue=i(127254);const Oe=120,he=50;var pe;!function(e){e.LOADING="LOADING",e.SUCCESS="SUCCESS",e.ERROR="ERROR"}(pe||(pe={}));const je=({color:e})=>(0,s.jsxs)("svg",{width:Oe,height:Oe,children:[(0,s.jsx)("path",{d:"M 57 46 L 57 74",stroke:e,strokeDasharray:2,strokeDashoffset:1}),(0,s.jsx)("path",{d:"M 63 46 L 63 74",stroke:e,strokeDasharray:2,strokeDashoffset:1})]}),De=({deviceModel:e,state:t})=>{const{themeName:i}=(0,ae.u)();return(0,s.jsxs)(C.A,{position:"relative",width:Oe,height:Oe,children:[(0,s.jsx)(t===pe.LOADING?ne.A:ue.A,{percentage:t===pe.LOADING?void 0:100,size:Oe,thickness:3,style:{position:"absolute",inset:0},className:t===pe.ERROR?h.AH`
                g > path:last-of-type {
                  fill: ${x.Ay[`desktop-color-orange-06-${i}`]};
                }
              `:void 0}),(0,s.jsx)(C.A,{position:"absolute",left:0,right:0,bottom:0,top:0,children:(0,s.jsx)(je,{color:t===pe.ERROR?x.Ay[`desktop-color-orange-06-${i}`]:x.Ay[`desktop-color-ublue-06-${i}`]})}),(0,s.jsx)(C.A,{alignItems:"center",justifyContent:"center",width:"100%",height:he,position:"absolute",bottom:5,left:0,right:0,children:(0,s.jsx)(N.A,{model:e,width:he,height:he,size:S.Xh.MEDIUM})}),(0,s.jsx)(C.A,{alignItems:"center",justifyContent:"center",width:"100%",height:he,position:"absolute",top:5,left:0,right:0,children:(0,s.jsx)(N.A,{model:e,width:he,height:he,size:S.Xh.MEDIUM})}),t===pe.ERROR?(0,s.jsx)(C.A,{alignItems:"center",justifyContent:"center",position:"absolute",top:0,bottom:0,left:0,right:0,children:(0,s.jsx)(C.A,{background:i===de.S.DARK?x.Ay[`desktop-color-neutral-01-${i}`]:x.Ay[`desktop-color-neutral-00-${i}`],width:20,height:20,alignItems:"center",justifyContent:"center",children:(0,s.jsx)(oe.A,{size:"original",variant:"fill",color:x.Ay[`desktop-color-orange-06-${i}`]})})}):null,t===pe.SUCCESS?(0,s.jsx)(C.A,{alignItems:"center",justifyContent:"center",position:"absolute",top:0,bottom:0,left:0,right:0,children:(0,s.jsx)(C.A,{background:i===de.S.DARK?x.Ay[`desktop-color-neutral-01-${i}`]:x.Ay[`desktop-color-neutral-00-${i}`],width:20,height:20,alignItems:"center",justifyContent:"center",children:(0,s.jsx)(le.A,{size:"original",variant:"fill",color:x.Ay[`desktop-color-green-06-${i}`]})})}):null]})};var Ie;!function(e){e[e.LOADING=0]="LOADING",e[e.FAILED=1]="FAILED",e[e.SUCCESS=2]="SUCCESS"}(Ie||(Ie={}));const Ce=({title:e,description:t,animation:i})=>(0,s.jsxs)(C.A,{flexDirection:"column",gap:D.Ln,padding:`${D.xO} 0`,alignItems:"center",children:[(0,s.jsx)(u.A,{size:"medium",color:"text-2",weight:"bold",style:{textAlign:"center"},children:e}),i,(0,s.jsx)(u.A,{size:"small",color:"text-3",style:{textAlign:"center"},children:t})]}),Se=({onCancel:e,onNext:t,deviceModel:i})=>{const n=(0,E.wA)(),[o,r]=(0,m.useState)(Ie.LOADING);return(0,m.useEffect)(()=>{r(Ie.LOADING),n((0,M.lU)(void 0,{fetchConfig:{getAllPostData:!0}})).then(async e=>{if(e?.state!==R.f.SETUP_COMPLETED)throw new Error("Setup failed");await(async(e,t,i,s=6e4,n=1e3)=>{const o=new AbortController;return Promise.race([(0,Ee.u)(s),me(async()=>{const s=await(async(e,t)=>{const i=await t((0,xe.pI)(e,void 0,{resolveWithExisting:!1}));return i.data?.[0]?.vrrp?.state})(e,i).catch(()=>{});return s===t},n,o.signal)]).finally(()=>o.abort())})(e.secondary_mac,b.o.BACKUP,n)}).then(()=>r(Ie.SUCCESS)).catch(()=>r(Ie.FAILED)).then(()=>n((0,M.V9)()))},[n]),(0,s.jsx)(J,{title:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_SETUP_TITLE_STEP",values:{currentStep:2,totalSteps:4}}),onDismiss:e,actions:[K({onCancel:e}),o===Ie.FAILED?X({onRetry:()=>r(Ie.LOADING)}):B({onNext:t,isDisabled:o!==Ie.SUCCESS})],children:(0,s.jsx)(Ce,o===Ie.LOADING?{title:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_LOADING_TITLE"}),description:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_DO_NOT_DISCONNECT",values:{port:2}}),animation:(0,s.jsx)(De,{state:pe.LOADING,deviceModel:i})}:o===Ie.SUCCESS?{title:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_SUCCESS_TITLE"}),description:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_SUCCESS_MESSAGE"}),animation:(0,s.jsx)(De,{state:pe.SUCCESS,deviceModel:i})}:{title:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_FAILURE_TITLE"}),description:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_FAILURE_MESSAGE",values:{port:2}}),animation:(0,s.jsx)(De,{state:pe.ERROR,deviceModel:i})})})};var Ne=i(831721),ge=i(688684);const Re=({onCancel:e,onFinish:t})=>{const i=(0,E.d4)($.p);return(0,s.jsx)(J,{title:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_SETUP_TITLE_STEP",values:{currentStep:4,totalSteps:4}}),onDismiss:e,actions:[K({onCancel:e}),Z({onFinish:t})],children:(0,s.jsxs)(C.A,{flexDirection:"column",gap:D.kc,children:[(0,s.jsxs)(C.A,{flexDirection:"column",gap:D.YC,children:[(0,s.jsxs)(C.A,{gap:D.YC,children:[(0,s.jsx)(Y.A,{size:"original",isActive:!0}),(0,s.jsx)(u.A,{size:"medium",color:"text-2",children:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_DO_NOT_DISCONNECT",values:{port:2}})}),(0,s.jsx)(ie.A,{description:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_DISCONNECTION_TOOLTIP",values:{port:2}}),portal:!0,children:(0,s.jsx)(Ne.A,{isActive:!0,size:"original"})})]}),(0,s.jsxs)(C.A,{gap:D.YC,children:[(0,s.jsx)(ge.A,{size:"original",isActive:!0}),(0,s.jsx)(u.A,{size:"medium",color:"text-2",children:(0,s.jsx)(g.sA,{id:"DEVICE_SHADOW_MODE_LAN_INSTRUCTIONS"})})]})]}),(0,s.jsx)("video",{height:245,width:"100%",loop:!0,muted:!0,autoPlay:!0,src:`${i}/shadowMode/EfgLanConnection.mp4`})]})})};var Te;!function(e){e[e.PREPARE=0]="PREPARE",e[e.VERIFY=1]="VERIFY",e[e.LOADING=2]="LOADING",e[e.WAN_INSTRUCTIONS=3]="WAN_INSTRUCTIONS",e[e.LAN_INSTRUCTIONS=4]="LAN_INSTRUCTIONS"}(Te||(Te={}));const Me=({onCancel:e,onFinish:t,deviceModel:i})=>{const[n,o]=(0,m.useState)(Te.PREPARE);switch(n){case Te.PREPARE:return(0,s.jsx)(_e,{onCancel:e,onNext:()=>{o(Te.VERIFY)}});case Te.VERIFY:return(0,s.jsx)(ce,{onCancel:e,onNext:()=>{o(Te.LOADING)}});case Te.LOADING:return(0,s.jsx)(Se,{deviceModel:i,onCancel:e,onNext:()=>{o(Te.WAN_INSTRUCTIONS)}});case Te.WAN_INSTRUCTIONS:return(0,s.jsx)(ee,{onCancel:e,onNext:()=>{o(Te.LAN_INSTRUCTIONS)}});case Te.LAN_INSTRUCTIONS:return(0,s.jsx)(Re,{onCancel:e,onFinish:t});default:return null}},fe=e=>(0,j.A)([(0,M.V9)(void 0,{resolveWithExisting:!1})],(0,s.jsx)(Me,{...e})),ve=({isPrimaryOffline:e})=>e?(0,s.jsx)(U,{}):null,ye=h.AH`
  opacity: 0.4;
`,we=(0,O.A)("div")`
  width: 50px;
  height: 0;
  border-bottom: ${({theme:{themeName:e}})=>`1px dashed ${x.Ay[`desktop-color-neutral-04-${e}`]}`};
`,Le=({isFaded:e,model:t,name:i,subTitle:n})=>(0,s.jsxs)(C.A,{alignItems:"center",flexDirection:"column",width:130,children:[(0,s.jsx)(N.A,{model:t,width:96,height:96,size:S.Xh.MEDIUM,className:e?ye:void 0}),(0,s.jsx)(I.A,{weight:"bold",size:"medium",color:"text-2",style:{textAlign:"center",maxWidth:"100%"},children:i}),n]}),ke=()=>{const e=(0,E.wA)(),[t,i]=(0,m.useState)(!1),n=(0,E.d4)(T.h),o=(0,E.d4)(T.bv),r=(0,E.d4)(T.Z9),a=(0,E.d4)(T.Bc);if(!r||!n)return null;const d=(0,f.aK8)((0,v.S9)(n)),c=!!o&&(0,f.aK8)((0,v.S9)(o));return(0,s.jsxs)(l.A,{children:[(0,s.jsxs)(C.A,{gap:D.Ln,flexDirection:"column",width:"100%",children:[(0,s.jsx)(u.A,{weight:"bold",size:"medium",color:"text-1",children:(0,s.jsx)(g.sA,{id:"COMMON_SHADOW_MODE"})}),(0,s.jsxs)(C.A,{justifyContent:"center",children:[(0,s.jsx)(Le,{isFaded:d,model:n.model,name:(0,p.Q)(n),subTitle:(0,s.jsx)(ve,{isPrimaryOffline:d})}),(0,s.jsx)(C.A,{height:96,alignItems:"center",children:(0,s.jsx)(we,{})}),(0,s.jsx)(Le,{isFaded:c,model:o?o.model:n.model,name:o?(0,p.Q)(o):(0,s.jsx)(g.sA,{id:"COMMON_SHADOW_GATEWAY"}),subTitle:a||r===R.f.NO_SHADOW_CANDIDATE_ADOPTED?(0,s.jsx)(P,{onSetup:()=>i(!0)}):(0,s.jsx)(G,{isPrimaryOffline:d,isSecondaryOffline:c,secondaryVrrpState:o?.vrrp?.state,shadowModeState:r})})]})]}),t?(0,s.jsx)(fe,{onCancel:()=>{i(!1),e((0,M.EY)())},onFinish:()=>i(!1),deviceModel:n.model}):null]})},Pe=()=>(0,j.A)([(0,M.V9)()],(0,s.jsx)(ke,{}));var be=i(23377),We=i(189042),Ue=i(384780),Ve=i(383550),Fe=i(532635),He=i(216082);const Ge=({activeItem:e,activeItem:{adopted:t,name:i,mac:x,shortname:E,type:m,ip:u,detailed_states:{device_near_power_limit:O}={device_near_power_limit:!1},total_used_power:h,total_max_power:p,config_network:j,model:D,lan_ip:I,ipv6:C,displayable_version:S,uptime:N,sys_stats:g,"system-stats":R,psu_table:T,device_mode_override:M,ethernet_overrides:f,port_table:v,uplink:y}})=>{const w=(0,n.A)(a.Xj.MANAGED_SHADOW_MODE),L=M===d.Yp.MANAGED_SHADOW_GATEWAY;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ve.A,{activeItem:e,showPortOverview:!0,hidePortsButton:!0,children:(0,s.jsx)(We.A,{activeItem:e,showPortsButton:!L,showCaptureButton:!L})}),(0,s.jsx)(_.A,{ip:u,adopted:t,config_network:j}),(0,s.jsx)(A.A,{mac:x,type:m,model:D,device_near_power_limit:O,total_used_power:h,total_max_power:p}),(0,s.jsx)(Ue.A,{activeItem:e}),w?(0,s.jsx)(Pe,{}):null,(0,s.jsx)(o.A,{psu_table:T}),(0,s.jsx)(c.A,{name:i,model:D,type:m,ip:u,uplink:y,lan_ip:I,ipv6:C,mac:x,displayable_version:S,connection_network_id:e.connection_network_id,uptime:N,sys_stats:g,systemStatsMem:R?.mem,total_used_power:h,device_mode_override:M,ethernet_overrides:f,port_table:v}),(0,s.jsx)(be.A,{activeItem:e}),L?(0,s.jsx)(l.A,{type:l.I.ACCORDION,items:[{id:"manage",label:(0,s.jsx)(r.A,{id:"COMMON_ACTION_MANAGE"}),openByDefault:!0,renderContent:()=>(0,s.jsx)(Fe.A,{activeItem:e})}]}):null,(0,s.jsx)(He.A,{shortname:E})]})}},871808(e,t,i){i.d(t,{A:()=>r});var s=i(602086),n=i(977872),o=i(167933);const r=e=>(0,n.d4)((0,s.useMemo)(()=>(0,o.jN)(e),[e]))},603606(e,t,i){i.d(t,{u:()=>s});const s=e=>new Promise(t=>{setTimeout(t,e)})}}]);